/* VimeoPlayer - v3.42.3 - 2021-10-04 - https://player.vimeo.com/NOTICE.txt */
!function(t){"use strict";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t,n,i){return t(i={path:n,exports:{},require:function(t,n){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==n&&i.path)}},i.exports),i.exports}var e=i((function(t,i){
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.6+9869a4bc
*/
t.exports=function(){function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},e=0,r=void 0,o=void 0,u=function(t,n){d[e]=t,d[e+1]=n,2===(e+=2)&&(o?o(v):p())},a="undefined"!=typeof window?window:void 0,s=a||{},c=s.MutationObserver||s.WebKitMutationObserver,l="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var t=setTimeout;return function(){return t(v,1)}}var d=new Array(1e3);function v(){for(var t=0;t-1},T=i((function(t){(t.exports=function(t,n){var i,e,r,o,u;return arguments.length<2||"string"!=typeof t?(o=n,n=t,t=null):o=arguments[2],null==t?(i=r=!0,e=!1):(i=E.call(t,"c"),e=E.call(t,"e"),r=E.call(t,"w")),u={value:n,configurable:i,enumerable:e,writable:r},o?p(g(o),u):u}).gs=function(t,n,i){var e,r,o,u;return"string"!=typeof t?(o=i,i=n,n=t,t=null):o=arguments[3],null==n?n=void 0:y(n)?null==i?i=void 0:y(i)||(o=i,i=void 0):(o=n,n=i=void 0),null==t?(e=!0,r=!1):(e=E.call(t,"c"),r=E.call(t,"e")),u={get:n,set:i,configurable:e,enumerable:r},o?p(g(o),u):u}})),S=function(t){if(!function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}(t))throw new TypeError(t+" is not a symbol");return t},A=Object.create,x=Object.defineProperties,C=Object.defineProperty,M=Object.prototype,I=A(null);if("function"==typeof Symbol){o=Symbol;try{String(o()),s=!0}catch(t){}}var R=function(){var t=A(null);return function(n){for(var i,e,r=0;t[n+(r||"")];)++r;return t[n+=r||""]=!0,C(M,i="@@"+n,T.gs(null,(function(t){e||(e=!0,C(this,i,T(t)),e=!1)}))),i}}();a=function(t){if(this instanceof a)throw new TypeError("TypeError: Symbol is not a constructor");return u(t)};var O=u=function t(n){var i;if(this instanceof t)throw new TypeError("TypeError: Symbol is not a constructor");return s?o(n):(i=A(a.prototype),n=void 0===n?"":String(n),x(i,{U:T("",n),F:T("",R(n))}))};x(u,{for:T((function(t){return I[t]?I[t]:I[t]=u(String(t))})),keyFor:T((function(t){var n;for(n in S(t),I)if(I[n]===t)return n})),hasInstance:T("",o&&o.hasInstance||u("hasInstance")),isConcatSpreadable:T("",o&&o.isConcatSpreadable||u("isConcatSpreadable")),iterator:T("",o&&o.iterator||u("iterator")),match:T("",o&&o.match||u("match")),replace:T("",o&&o.replace||u("replace")),search:T("",o&&o.search||u("search")),species:T("",o&&o.species||u("species")),split:T("",o&&o.split||u("split")),toPrimitive:T("",o&&o.toPrimitive||u("toPrimitive")),toStringTag:T("",o&&o.toStringTag||u("toStringTag")),unscopables:T("",o&&o.unscopables||u("unscopables"))}),x(a.prototype,{constructor:T(u),toString:T("",(function(){return this.F}))}),x(u.prototype,{toString:T((function(){return"Symbol ("+S(this).U+")"})),valueOf:T((function(){return S(this)}))}),C(u.prototype,u.toPrimitive,T("",(function(){var t=S(this);return"symbol"==typeof t?t:t.toString()}))),C(u.prototype,u.toStringTag,T("c","Symbol")),C(a.prototype,u.toStringTag,T("c",u.prototype[u.toStringTag])),C(a.prototype,u.toPrimitive,T("c",u.prototype[u.toPrimitive]));var L=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!c[typeof Symbol.iterator]&&!!c[typeof Symbol.toPrimitive]&&!!c[typeof Symbol.toStringTag]}()?Symbol:O;if(function(){for(var t=["webkit","moz"],n=0;n>>0,e=arguments[1],r=0;r>>0,e=arguments[1],r=0;r>>0;if(0===e)return!1;var r=0|n,o=Math.max(r>=0?r:e-Math.abs(r),0);function u(t,n){return t===n||"number"==typeof t&&"number"==typeof n&&isNaN(t)&&isNaN(n)}for(;othis.length)&&-1!==this.indexOf(t,n)}),Object.values||(Object.values=function(t){return Object.keys(t).map((function(n){return t[n]}))}),String.prototype.startsWith||(String.prototype.startsWith=function(t,n){return this.slice(n||0,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,n){return(void 0===n||n>this.length)&&(n=this.length),this.substring(n-t.length,n)===t}),Number.isNaN=Number.isNaN||function(t){return"number"==typeof t&&t!=t},void 0===Number.parseFloat&&(Number.parseFloat=window.parseFloat),void 0===Number.parseInt&&(Number.parseInt=window.parseInt),void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)}),Array.prototype.entries||(Array.prototype.entries=function(){var t,n=this,i=0;function e(){}return e.prototype.next=function(){return i>n.length-1&&(t=!0),t?{value:void 0,done:!0}:{value:[i,n[i++]],done:!1}},e.prototype[L.iterator]=function(){return this},new e}),Array.prototype[L.iterator]||(Array.prototype[L.iterator]=function(){var t,n=this,i=0;function e(){}return e.prototype.next=function(){return i>n.length-1&&(t=!0),t?{value:void 0,done:!0}:{value:n[i++],done:!1}},e.prototype[L.iterator]=function(){return this},new e});var j=window.Map||function(){var t,n,i,e=function(){n=[],i=[]},r=function(i){return-1<(t=n.indexOf(i))};return e(),{get size(){return n.length},has:r,clear:e,get:function(t){return i[n.indexOf(t)]},keys:function(){return n.slice()},values:function(){return i.slice()},entries:function(){return n.map((function(t,n){return[t,i[n]]}))},delete:function(e){return r(e)&&n.splice(t,1)&&!!i.splice(t,1)},forEach:function(t,e){var r=this;i.forEach((function(i,o){return t.call(e,i,n[o],r)}))},set:function(e,o){return r(e)?i[t]=o:i[n.push(e)-1]=o,this}}},N=window.WeakMap||function(){var t=Object.defineProperty,n=Date.now()%1e9,i=function(){this.name="__st"+(1e9*Math.random()>>>0)+n+++"__"};return i.prototype.set=function(n,i){if("object"!==V(n)&&"function"!=typeof n)throw new TypeError("Invalid value used as weak map key");var e=n[this.name];return e&&e[0]===n?e[1]=i:t(n,this.name,{value:[n,i],writable:!0}),this},i.prototype.get=function(t){var n;return(n=t[this.name])&&n[0]===t?n[1]:void 0},i.prototype.delete=function(t){var n=t[this.name];return!(!n||n[0]!==t||(n[0]=n[1]=void 0,0))},i.prototype.has=function(t){var n=t[this.name];return!!n&&n[0]===t},i}(),P=window.Array.from,U=[1];
/**
* @license
*
* Portions of this polyfill are a derivative work of the Polymer project, which requires the following licence notice:
*
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/"function"==typeof P&&P(U)===U&&(P=!1);var F=P||function(t){return[].slice.call(t,0)};function V(t){return(V="function"==typeof L&&"symbol"==typeof L.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof L&&t.constructor===L&&t!==L.prototype?"symbol":typeof t})(t)}function B(t,n){for(var i=0;it.length)&&(n=t.length);for(var i=0,e=new Array(n);i=t.length?{done:!0}:{done:!1,value:t[e++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(i=t[L.iterator]()).next.bind(i)}var rt=i((function(t,n){t.exports=function(t){var n={};return(t=t||{}).prependOn=function(n,i){return t.on(n,i,!0)},t.eventNames=function(){return Object.keys(n)},t.on=function(i,e,r){for(var o=0,u=(i=[].concat(i)).length;o1?i-1:0),r=1;r1?i-1:0),r=1;r=t){i=n.end(e);break}return i-t}function mt(t,n){if(!n||!n.length)return 0;if(1===n.length&&n.end(0)-n.start(0)<1e-6)return 0;for(var i=0,e=n.length-1;e>=0&&n.end(e)>t;--e)i+=n.end(e)-Math.max(n.start(e),t);return i}function bt(){return void 0!==window.performance&&"function"==typeof window.performance.now?window.performance.now():Date.now()}function wt(t){return bt()-t}function gt(t){return"string"!=typeof t?{}:t.replace("?","").split("&").reduce((function(t,n){if(n.length>0){var i=Q(n.split("="),2),e=i[0],r=i[1];t[e]=decodeURIComponent(r)}return t}),{})}function yt(t){var n=document.createElement("a");return n.href=t,n}function _t(t,n){var i=function(t){if("object"!==V(t))return"";var n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return n.length?n.join("&"):""}(n);return"".concat(t).concat(i?"?".concat(i):"")}function kt(t){var n=t.split("://");if(2!==n.length)return null;var i=n[1].split("/");if(i.length>1)return i[0];var e=n[1].split("?");if(e.length>1)return e[0];var r=n[1].split("#");return r.length>1?r[0]:n[1]}function Et(t,n,i){switch(i.length){case 0:return t.call(n);case 1:return t.call(n,i[0]);case 2:return t.call(n,i[0],i[1]);case 3:return t.call(n,i[0],i[1],i[2])}return t.apply(n,i)}function Tt(t){return t}var St=Math.max;function At(t,n,i){return n=St(void 0===n?t.length-1:n,0),function(){for(var e=arguments,r=-1,o=St(e.length-n,0),u=Array(o);++r0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}(Qt);function en(t,n){return nn(At(t,n,Tt),t+"")}function rn(t,n){return t===n||t!=t&&n!=n}function on(t,n){for(var i=t.length;i--;)if(rn(t[i][0],n))return i;return-1}var un=Array.prototype.splice;function an(t){var n=-1,i=null==t?0:t.length;for(this.clear();++n-1},an.prototype.set=function(t,n){var i=this.Y,e=on(i,t);return e<0?(++this.size,i.push([t,n])):i[e][1]=n,this};var sn=Xt(It,"Map"),cn=Xt(Object,"create"),ln=Object.prototype.hasOwnProperty,fn=Object.prototype.hasOwnProperty;function hn(t){var n=-1,i=null==t?0:t.length;for(this.clear();++n-1&&t%1==0&&t<=9007199254740991}function qn(t){return null!=t&&Hn(t.length)&&!Vt(t)}var Wn="object"==(void 0===t?"undefined":V(t))&&t&&!t.nodeType&&t,zn=Wn&&"object"==("undefined"==typeof module?"undefined":V(module))&&module&&!module.nodeType&&module,Gn=zn&&zn.exports===Wn?It.Buffer:void 0,Yn=(Gn?Gn.isBuffer:void 0)||function(){return!1},Kn=Function.prototype,Jn=Object.prototype,$n=Kn.toString,Xn=Jn.hasOwnProperty,Zn=$n.call(Object);function Qn(t){if(!jn(t)||"[object Object]"!=Ut(t))return!1;var n=Rn(t);if(null===n)return!0;var i=Xn.call(n,"constructor")&&n.constructor;return"function"==typeof i&&i instanceof i&&$n.call(i)==Zn}var ti={};function ni(t){return function(n){return t(n)}}ti["[object Float32Array]"]=ti["[object Float64Array]"]=ti["[object Int8Array]"]=ti["[object Int16Array]"]=ti["[object Int32Array]"]=ti["[object Uint8Array]"]=ti["[object Uint8ClampedArray]"]=ti["[object Uint16Array]"]=ti["[object Uint32Array]"]=!0,ti["[object Arguments]"]=ti["[object Array]"]=ti["[object ArrayBuffer]"]=ti["[object Boolean]"]=ti["[object DataView]"]=ti["[object Date]"]=ti["[object Error]"]=ti["[object Function]"]=ti["[object Map]"]=ti["[object Number]"]=ti["[object Object]"]=ti["[object RegExp]"]=ti["[object Set]"]=ti["[object String]"]=ti["[object WeakMap]"]=!1;var ii="object"==(void 0===t?"undefined":V(t))&&t&&!t.nodeType&&t,ei=ii&&"object"==("undefined"==typeof module?"undefined":V(module))&&module&&!module.nodeType&&module,ri=ei&&ei.exports===ii&&Ct.process,oi=function(){try{return ei&&ei.require&&ei.require("util").types||ri&&ri.binding&&ri.binding("util")}catch(t){}}(),ui=oi&&oi.isTypedArray,ai=ui?ni(ui):function(t){return jn(t)&&Hn(t.length)&&!!ti[Ut(t)]};function si(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}var ci=Object.prototype.hasOwnProperty;function li(t,n,i){var e=t[n];ci.call(t,n)&&rn(e,i)&&(void 0!==i||n in t)||mn(t,n,i)}function fi(t,n,i,e){var r=!i;i||(i={});for(var o=-1,u=n.length;++o-1&&t%1==0&&t1?i[r-1]:void 0,u=r>2?i[2]:void 0;for(o=t.length>3&&"function"==typeof o?(r--,o):void 0,u&&function(t,n,i){if(!Ft(i))return!1;var e=V(n);return!!("number"==e?qn(i)&&di(n,i.length):"string"==e&&n in i)&&rn(i[n],t)}(i[0],i[1],u)&&(o=r<3?void 0:o,r=1),n=Object(n);++e0&&void 0!==arguments[0]?arguments[0]:this.X;n.addEventListener(Ti.LOADED_METADATA,(function(n){t.fire(Ti.LOADED_METADATA,n)})),n.addEventListener("webkitplaybacktargetavailabilitychanged",(function(n){switch(n.availability){case"available":t.K||(t.K=!0,t.fire(Ai.AIRPLAY_AVAILABLE));break;case"not-available":t.K&&(t.K=!1,t.fire(Ai.AIRPLAY_UNAVAILABLE))}})),n.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",(function(n){if(n.target.webkitCurrentPlaybackTargetIsWireless)return t.J=!0,void t.fire(Ai.AIRPLAY_ACTIVATED);t.J=!1,t.fire(Ai.AIRPLAY_DEACTIVATED)}))},n.showPicker=function(){var t=this;this.X.webkitShowPlaybackTargetPicker(),this.loadMetadata().then((function(){return t.X.webkitShowPlaybackTargetPicker()})).catch((function(){}))},n.loadMetadata=function(){var t=this;return this.X.readyState>=1?r.resolve():new r((function(n,i){t.X.addEventListener(Ti.LOADED_METADATA,(function(){n()})),t.X.src=t.getFile().src}))},H(AirPlayExternalDisplay,[{key:"element",get:function(){return this.X},set:function(t){if(!(t instanceof HTMLVideoElement))throw new TypeError("The element for AirPlay must be a .");t!==this.X&&(this.addVideoEventListeners(t),this.X=t,this.X.setAttribute("x-webkit-airplay","allow"))}}]),AirPlayExternalDisplay}(Ei),Li=navigator.userAgent.toLowerCase();function Di(t){t=t.toLowerCase();var n=new RegExp(t).test(Li);return"safari"===t?n&&new RegExp("version").test(Li):n}function ji(t){var n=document.createElement("div"),i=t.charAt(0).toUpperCase()+t.slice(1),e=(t+" "+["Webkit","Moz","O","ms"].join(i+" ")+i).split(" ");for(var r in e){var o=e[r];if(void 0!==n.style[o])return o}return t}var Ni=!!Di("android")&&(parseFloat(Li.replace(/^.* android (\d+)\.(\d+).*$/,"$1.$2"))||!0),Pi=window.devicePixelRatio||1,Ui=!(!Di("windows phone")&&!Di("iemobile"))&&(parseFloat(Li.replace(/^.* windows phone (os )?(\d+)\.(\d+).*$/,"$2.$3"))||!0),Fi=!!Di("msie")&&parseFloat(Li.replace(/^.*msie (\d+).*$/,"$1")),Vi=!!Di("trident")&&parseFloat(Li.replace(/^.*trident\/(\d+)\.(\d+).*$/,"$1.$2"))+4,Bi=!!(Di("ipad;")||Di("iphone;")||Di("ipod touch;"))&&parseFloat(Li.replace(/^.* os (\d+)_(\d+).*$/,"$1.$2")),Hi="MacIntel"===navigator.platform&&void 0!==navigator.standalone,qi=Di("opera")||Di("opr"),Wi=/^Mozilla\/5\.0 \(.* Mac OS X.*\(KHTML, like Gecko\)(?: Mobile\/[\S]*|)$/i.test(Li);function zi(){if(!Di("safari"))return[];var t=Li.split(" ").find((function(t){return/version\//.test(t)}));return t?t.replace("version/","").split(".").map((function(t){return parseInt(t,10)})):[]}var Gi=Di("safari")&&Di("apple")&&!Di("chrome")&&!Di("android")&&zi()[0]>=11,Yi={airPlay:"WebKitPlaybackTargetAvailabilityEvent"in window,android:Ni,appleMail:Wi,hasAutoplayPolicy:Ni||Bi||Gi||function(){if(!Di("chrome"))return[];var t=Li.split(" ").find((function(t){return Bi?/CriOS\//.test(t):/chrome\//.test(t)}));return t?t.replace("chrome/","").split(".").map((function(t){return parseInt(t,10)})):[]}()[0]>=66,iOS:Bi,iPadOS:Hi,mobileAndroid:Ni&&Di("mobile"),browser:{bb10:Di("bb10"),chrome:Di("chrome"),firefox:Di("firefox"),ie:Fi||Vi,edge:Di("edge"),opera:qi,safari:Di("safari")&&Di("apple")&&!Di("chrome")&&!Di("android")},devicePixelRatio:Pi,iPhone:Di("iphone;")||Di("ipod touch;")||Di("ipod;"),iPad:Di("ipad;"),iPadNonRetina:Di("ipad;")&&Pi<2,mac:Di("mac os"),pointerEvents:window.navigator.pointerEnabled||window.navigator.msPointerEnabled||!1,passiveEvents:function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,n),window.removeEventListener("testPassive",null,n)}catch(t){}return t}(),svg:!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,touch:"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch||Di("windows phone")||window.navigator.maxTouchPoints>1||window.navigator.msMaxTouchPoints||!1,transformProperty:ji("transform"),transitionProperty:ji("transition"),webp:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))&&0===t.toDataURL("image/webp").indexOf("data:image/webp")}(),windowsPhone:Ui},Ki=/mac os x 10_13/.test(Li),Ji=Yi.iOS&&Yi.iOS>=11,$i=Yi.iPhone&&812===window.screen.availHeight&&375===window.screen.availWidth,Xi=Yi.iPhone&&896===window.screen.availHeight&&414===window.screen.availWidth,Zi=Yi.iPad&&1112===window.screen.availWidth&&834===window.screen.availHeight,Qi=Yi.iPad&&834===window.screen.availWidth&&1194===window.screen.availHeight,te=Yi.iPad&&1024===window.screen.availWidth&&1366===window.screen.availHeight,ne=$i||Xi||Zi||Qi||te;function ie(){return!!(Gi&&Ki||Gi&&Ji)||"undefined"!=typeof MediaSource&&MediaSource.isTypeSupported('video/mp4; codecs="hvc1"')}function ee(){return!(Yi.iOS||Yi.iPad||Yi.browser.ie)&&(!Di("safari")||zi()[0]>11||11===zi()[0]&&(zi()[2]>1||zi()[1]>0))}Yi.hevc=ie(),Yi.hdr=Gi&&Ji&&ne,Yi.dolbyVision=function(){var t="undefined"!=typeof MediaSource&&MediaSource.isTypeSupported('video/mp4; codecs="dvh1"');if(!t){var n=document.createElement("video");"canPlayType"in n&&(t="probably"===n.canPlayType('video/mp4; codecs="dvh1"'))}if(Hi||Yi.iOS){var i=zi(),e=i[0],r=i[1];if(e<14||14===e&&r<1)return!1}return t}(),Yi.vp9hdr=(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(color-gamut: rec2020)").matches)&&screen.colorDepth>=48&&(MediaSource.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.16.09.00"')||MediaSource.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.16.09.01"')||MediaSource.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.18.09.00"')||MediaSource.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.18.09.01"')),Yi.av1="undefined"!=typeof MediaSource&&MediaSource.isTypeSupported('video/mp4; codecs="av01.0.31M.08.0.110.01.01.01.0"'),Yi.webvr=!!(window.navigator&&"getVRDisplays"in window.navigator),Yi.webxr=!!(window.navigator&&"xr"in window.navigator&&"supportsSession"in window.navigator.xr),Yi.spatialPlayback=ee(),Yi.spatialHEVC=!Yi.browser.safari&&ee()&&ie(),Yi.stereoscopic=Yi.spatialPlayback&&Yi.mobileAndroid;var re=function(){var t=navigator.userAgent.match(/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\./);return!!t&&{major:parseInt(t[1],10),minor:parseInt(t[2],10)}}();function oe(t,n){var i,e=0;return q(i={},L.iterator,(function(){return this})),q(i,"next",(function(){return e0&&void 0!==arguments[0]?arguments[0]:[];return t.item=function(t){return this[t]},t.getTrackById=ue,t}function se(){return void 0!==window.performance&&"function"==typeof window.performance.now?window.performance.now():Date.now()}function ce(t){return se()-t}function le(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^(16*Math.random()>>t)/4).toString(16)}))}function fe(t){for(var n=window.atob(t),i=n.length,e=new Uint8Array(i),r=0;r=s?(o=a,r=(s*a).toFixed(2)):(r=u,o=(u/s).toFixed(2)),{width:r,height:o,left:Math.max((u-r)/2,0),top:Math.max((a-o)/2,0)}}function ve(t){var n=[document.fullscreenElement,document.webkitFullscreenElement,document.webkitCurrentFullScreenElement,document.mozFullScreenElement,document.msFullscreenElement].find((function(t){return void 0!==t}));return void 0!==n?!!n:t.webkitDisplayingFullscreen}function pe(t,n){var i=t;return n&&(i+=';codecs="'.concat(n,'"')),i}function me(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(t=parseFloat(t),isNaN(t))return 0;var i=Math.pow(10,n);return Math.round(t*i)/i}function be(t,n){return t&&t.tests&&t.tests[n]?t.tests[n]:null}function we(t){return t&&"ML"===t.displayName}var TelecineError=function(t,n){this.name=t,this.message=n,Object.freeze(this)},ge=new N,ye=function(){function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=parseFloat(t);if(isNaN(i))throw new TypeError("Time must be a number.");if(i<0)throw new TypeError("Time must be a positive number.");this.time=t,this.data=n,this.id=le();try{var e="undefined"==typeof VTTCue?TextTrackCue:VTTCue;this.vttCue=new e(t,t+.25,JSON.stringify(n)),this.vttCue.id=this.id}catch(t){throw new TelecineError("CuePointsNotSupported","Cue points are not supported in this browser.")}ge.set(this.vttCue,this),Object.freeze(this)}return t.fromVTTCue=function(n){if(ge.has(n))return ge.get(n);var i={};try{i=JSON.parse(n.text)}catch(t){}return new t(n.startTime,i)},t}();function _e(t,n,i){var e;try{document.removeChild({})}catch(r){e=Object.create(Object.getPrototypeOf(r),{name:{value:n,configurable:!0,writable:!0},code:{value:t,configurable:!0,writable:!0},message:{value:i,configurable:!0,writable:!0},toString:{value:function(){return"".concat(n,": DOM Exception ").concat(t)},configurable:!0,writable:!0}})}return Object.freeze(e)}var ke=function(t,n){if(!t||void 0===t[n])throw _e(1,"INDEX_SIZE_ERR");return t[n]};function Ee(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.freeze(q({get length(){return t.length},start:function(n){return ke(t,n)},end:function(t){return ke(n,t)}},L.iterator,(function(){return oe(t,n)})))}Ee.from=function(t){if(!(t instanceof TimeRanges))throw new TypeError("Can only create a TelecineTimeRange from a TimeRanges object.");for(var n=[],i=[],e=0,r=t.length;e1&&void 0!==arguments[1]?arguments[1]:{};this.Z=t,this.tt=i,this.nt=null,this.it=null,this.et=[],rt(this),this.on("play",(function(){return n.rt()}));var e=t.querySelector("video");e||((e=document.createElement("video")).preload="none",this.Z.appendChild(e)),e.setAttribute("tabindex","-1"),this.$=e,i.playRequest&&(this.ot=i.playRequest,this.ot.video=e),i.htmlScanner&&i.htmlScanner.controls&&(this.$.controls=!0),this.ut=this.handleVideoEvent.bind(this),this.addVideoEventListeners(),this.at="none",this.st=!1,this.ct=!1,this.lt=-1}H(t,null,[{key:"displayName",get:function(){return"HTMLScanner"}},{key:"supported",get:function(){return t.supportedVideoTypes.length>0}},{key:"supportedVideoTypes",get:function(){var t=[];if("function"!=typeof Te.canPlayType)return t;for(var n in Se){var i=Se[n];Yi.android&&"application/vnd.apple.mpegurl"===n||(Yi.android&&!Yi.mobileAndroid&&"video/mp4"===n&&Yi.android instanceof String?parseInt(Yi.android.split(".")[0],10)>3&&t.push(n):Te.canPlayType(i).replace(/^no$/,"")&&t.push(n))}return t}},{key:"supportedAudioTypes",get:function(){return[]}},{key:"supportedExternalDisplays",get:function(){return[AirPlayExternalDisplay]}},{key:"supportsSettingVolume",get:function(){if(Yi.android||Yi.iOS)return!1;var t=Te.volume;return Te.volume=.5*t,Te.volume!==t}},{key:"supportsTextTracks",get:function(){return void 0!==Te.textTracks&&Te.textTracks instanceof TextTrackList}},{key:"supportsPlaybackRate",get:function(){if(Yi.android&&re&&re.major<52)return!1;var t=Te.playbackRate;Te.playbackRate=.5*t;var n=t!==Te.playbackRate;return Te.playbackRate=t,n}}]);var n=t.prototype;return n.deactivate=function(){this.nt&&(this.nt.off("filesrcupdate"),this.nt.off("texttracksrcupdate")),this.removeVideoEventListeners(),this.removeSnapshot(),this.$.style.display="none"},n.reactivate=function(){this.addVideoEventListeners(),this.$.style.display=""},n.addVideoEventListeners=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.$;Object.keys(Ti).forEach((function(i){var e=Ti[i];n.addEventListener(e,t.ut)}))},n.removeVideoEventListeners=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.$;Object.keys(Ti).forEach((function(i){var e=Ti[i];n.removeEventListener(e,t.ut)}))},n.play=function(t){var n=this;return this.ot.start(t).catch((function(t){throw n.ft(t),t}))},n.ft=function(t){this.fire(Ti.ERROR,new TelecineError(t.name,t.message))},n.pause=function(){this.ot.cancel(),this.$.pause()},n.onpause=function(){},n.ontimeupdate=function(){this.lt=this.currentTime},n.addTextTrack=function(t){var n,i,e=this;t.src?((n=document.createElement("track")).kind=t.kind,n.src=t.src,n.id="telecine-track-".concat(t.id),n.srclang=t.language,n.label=t.label,this.$.appendChild(n),i=n.track):(i=this.$.addTextTrack(t.kind,t.label,t.language),this.ht=this.ht||{},this.ht["telecine-track-".concat(t.id)]=i),i.addEventListener("cuechange",(function(){return t.dispatchEvent("cuechange")})),this.$.addEventListener("timeupdate",(function(){ve(e.$)&&(t.mode=i.mode)}));var r=function(){var n=Yi.iOS&&ve(e.$);!t.dt||n?t.mode=i.mode:i.mode=Ae[t.mode]},o=[];if(n?n.addEventListener("load",r):r(),["loadeddata","seeking"].forEach((function(t){e.$.addEventListener(t,r),o.push([t,r])})),t.dt&&(i.mode=Ae[t.mode]),!xe){var u=[],a=function(){if(i&&"disabled"!==Ae[i.mode]){if(u.length!==i.activeCues.length)return t.dispatchEvent("cuechange"),void(u=F(i.activeCues));for(var n=0,e=i.activeCues.length;n2&&void 0!==arguments[2]?arguments[2]:null;this.wt||(this.wt=this.$.addTextTrack("chapters"),this.wt.mode="hidden");var r=t.timecode,o=e?e.timecode:n,u=window.VTTCue||window.TextTrackCue;try{i=new u(r,o,t.title)}catch(t){throw new TelecineError("ChaptersNotSupported","Chapters are not supported in this browser.")}i.size=(o-r)/n,i.id=r,this.wt.addCue(i)},n.addChapter=function(t,n){var i=this.video.chapters,e={timecode:t,title:n};i.push(e),i.sort((function(t,n){return t.timecode-n.timecode}));var r=i[i.indexOf(e)+1];this.pt(e,this.video.duration,r),this.gt(this.wt,this.video.duration)},n.removeChapter=function(t){try{this.wt.removeCue(t)}catch(t){throw new TelecineError("ChaptersNotSupported","Chapters are not supported in this browser.")}var n=this.video.chapters.find((function(n){return n.timecode===t.timecode}));this.video.chapters.splice(n,1),this.gt(this.wt,this.video.duration)},n.gt=function(t,n){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};if(this._t||(this._t=this.$.addTextTrack("metadata"),this._t.mode="hidden",this._t.addEventListener("cuechange",(function(t){F(t.target.activeCues).forEach((function(t){n.fire(xi.CUE_POINT,ye.fromVTTCue(t))}))})),this.$.addEventListener("canplay",(function(t){n._t.mode="hidden"}))),t=parseFloat(t),isNaN(t))throw new TypeError("Time must be a number.");if(t<0||t>=this.duration)throw new TypeError("Time must be a positive number less than the duration of the video.");var e=new ye(t,i);return this._t.addCue(e.vttCue),e},n.removeCuePoint=function(t){if(!t)throw new TelecineError("InvalidCuePoint","The specified cue point is not valid.");return this._t.removeCue(t.vttCue),!0},n.removeAllCuePoints=function(){var t=this;return this._t&&this._t.length&&F(this._t.cues).forEach((function(n){t._t.removeCue(n)})),!0},n.onerror=function(){if(!this.$.error)return!1;switch(this.$.error.code){case this.$.error.MEDIA_ERR_SRC_NOT_SUPPORTED:return this.kt("MediaSrcNotSupportedError","The media was not suitable."),this.Et(),!1;case this.$.error.MEDIA_ERR_DECODE:return-1!==this.lt&&Yi.iOS?(this.$.load(),this.currentTime=this.lt,this.lt=-1,!1):(this.kt("MediaDecodeError","The media could not be decoded."),this.Et(),!1);case this.$.error.MEDIA_ERR_NETWORK:return this.kt("MediaNetworkError","A network error ocurred while fetching the media."),!1;case this.$.error.MEDIA_ERR_ABORTED:return this.kt("MediaAbortedError","The user agent aborted the fetching of the media."),!1;default:return this.kt("MediaUnknownError","An unknown error occurred."),!1}},n.kt=function(t,n){this.fire(Ti.ERROR,new TelecineError(t,n))},n.onended=function(){if(this.$.paused||this.$.pause(),this.currentTimen&&(t=n),this.$.seekable.length>0)for(var i=0,e=this.$.seekable.length;i=t)return!0;return!1},n.seekToTime=function(t){var n=this;return this.canSeekTo(t)?(this.$.currentTime=t,r.resolve(this.$.currentTime)):new r((function(i,e){var r=function e(){n.canSeekTo(t)&&(Object.keys(Ti).forEach((function(t){var i=Ti[t];n.$.removeEventListener(i,e)})),n.$.currentTime=t,i(n.$.currentTime))};Object.keys(Ti).forEach((function(t){var i=Ti[t];n.$.addEventListener(i,r)}))}))},n.takeSnapshot=function(){var t=this.Z.querySelector("[telecine-snapshot]");t||((t=document.createElement("canvas")).setAttribute("telecine-snapshot",""),this.Z.appendChild(t)),t.setAttribute("width","".concat(this.Z.clientWidth,"px")),t.setAttribute("height","".concat(this.Z.clientHeight,"px")),t.style.display="";var n=de(this.$.clientWidth,this.$.clientHeight,this.$.videoWidth,this.$.videoHeight),i=n.width,e=n.height,r=n.left,o=n.top;t.style.cssText="position:absolute;width:".concat(i,"px;height:").concat(e,"px;left:").concat(r,"px;top:").concat(o,"px");var u=t.getContext("2d");t.width>0&&t.height>0&&u.drawImage(this.$,0,0,t.width,t.height)},n.removeSnapshot=function(){var t=this.Z.querySelector("[telecine-snapshot]");t&&(t.style.display="none")},n.getTrackById=function(t){if(this.ht&&this.ht[t])return this.ht[t];if("function"==typeof this.$.textTracks.getTrackById)return this.$.textTracks.getTrackById(t);var n=document.getElementById(t);return n?n.track:null},n.initDrm=function(){var t=this.nt.drmHandler;t&&t.init(this)},n.showExternalDisplayPicker=function(t){if(!this.et.length)throw new TelecineError("ExternalDisplayUnvailable","No external displays are available.");if(t){var n=this.et.filter((function(n){return n.constructor.displayName.replace("ExternalDisplay","")===t}))[0];if(!n)throw new TelecineError("InvalidExternalDisplay","The specified external display is not available.");n.showPicker()}else this.et[0].showPicker()},n.At=function(){this.$.requestPictureInPicture()},n.xt=function(){document.exitPictureInPicture()},n.Ct=function(){return this.Mt.length<1?null:this.Mt.slice(0).sort((function(t,n){return t.priority-n.priority}))[0]},n.It=function(){var t=this.Ct();t?this.currentFile=t:this.fire(xi.SCANNER_ERROR,{reason:"all files failed"})},n.yt=function(t,n){return void 0!==t.timecode&&t.timecode>=0&&t.timecode<=n&&void 0!==t.title},n.Et=function(){var t=this.Mt.indexOf(this.it);this.Mt.splice(t,1),this.It()},n.rt=function(){var t=this;if("mediaSession"in navigator){var n={title:this.nt.title,artist:this.nt.subtitle,artwork:[]};this.nt.metadata.thumbnail&&n.artwork.push({src:this.nt.metadata.thumbnail}),navigator.mediaSession.metadata=new MediaMetadata(n),"function"==typeof navigator.mediaSession.setActionHandler&&(navigator.mediaSession.setActionHandler("play",(function(){t.play().then((function(){return t.fire(Ii.MEDIASESSION_PLAY)})).catch(t.ft.bind(t))})),navigator.mediaSession.setActionHandler("pause",(function(){t.pause(),t.fire(Ii.MEDIASESSION_PAUSE)})),navigator.mediaSession.setActionHandler("seekforward",(function(){t.currentTime=Math.min(t.duration,t.currentTime+10),t.fire(Ii.MEDIASESSION_SEEK_FORWARD)})),navigator.mediaSession.setActionHandler("seekbackward",(function(){t.currentTime=Math.max(0,t.currentTime-10),t.fire(Ii.MEDIASESSION_SEEK_BACKWARD)})))}},H(t,[{key:"chaptersTrack",get:function(){return this.wt}},{key:"manifest",get:function(){return this.Rt}},{key:"buffered",get:function(){return Ee.from(this.$.buffered)}},{key:"cuePoints",get:function(){return this._t?F(this._t.cues).map((function(t){return ye.fromVTTCue(t)})):[]}},{key:"currentFile",get:function(){return this.it},set:function(n){var i=this,e=!this.$.paused,r=this.currentTime,o=!this.it||n.video.id!==this.it.video.id;if(o||this.takeSnapshot(),this.it=n,o&&(this.$.preload=this.at),this.constructor===t&&this.$.readyState>0&&(this.$.currentTime=0),(Yi.iOS||Yi.android)&&this.it.video.title){var u=this.it.video.title;this.it.video.subtitle&&(u="".concat(u," ").concat(this.it.video.subtitle)),this.$.setAttribute("title",u)}else this.$.removeAttribute("title");this.setVideoSrc(this.it.src,o),this.fire(xi.CURRENT_FILE_CHANGE,n),Yi.iOS&&!o&&this.play().catch(this.ft.bind(this)),this.constructor!==t||o?e&&this.play().catch(this.ft.bind(this)):(this.seekToTime(r).then((function(t){return e&&i.play().catch(i.ft.bind(i)),t})).catch((function(){})),this.once("canplay",(function(){return i.removeSnapshot()})),this.once("playing",(function(){return i.removeSnapshot()})))}},{key:"currentTime",get:function(){return this.$.currentTime},set:function(t){this.seekToTime(t)}},{key:"duration",get:function(){return this.$.duration}},{key:"ended",get:function(){return this.$.ended}},{key:"externalDisplayAvailable",get:function(){return this.et.some((function(t){return t.available}))}},{key:"externalDisplayActive",get:function(){return this.et.some((function(t){return t.active}))}},{key:"loop",get:function(){return this.$.loop},set:function(t){this.$.loop=t}},{key:"isLowerProfileAvailable",get:function(){return null}},{key:"muted",get:function(){return this.$.muted},set:function(t){this.$.muted=t}},{key:"playsinline",get:function(){return this.$.playsinline},set:function(t){this.$.playsinline=t,t?this.$.setAttribute("playsinline",""):this.$.removeAttribute("playsinline")}},{key:"paused",get:function(){return this.$.paused}},{key:"defaultPlaybackRate",get:function(){return this.$.defaultPlaybackRate},set:function(t){this.$.defaultPlaybackRate=t}},{key:"playbackRate",get:function(){return this.$.playbackRate},set:function(t){this.$.playbackRate=t}},{key:"played",get:function(){return this.$.played}},{key:"seekable",get:function(){return this.$.seekable}},{key:"seeking",get:function(){return this.$.seeking}},{key:"preload",get:function(){return this.at},set:function(t){this.$.preload=t,this.at=t}},{key:"autoPictureInPicture",get:function(){return this.$.autoPictureInPicture},set:function(t){this.$.autoPictureInPicture=t}},{key:"disablePictureInPicture",get:function(){return this.$.disablePictureInPicture},set:function(t){this.$.disablePictureInPicture=t}},{key:"presentationMode",get:function(){return this.$.webkitPresentationMode?this.$.webkitPresentationMode:document.pictureInPictureElement?"picture-in-picture":"inline"},set:function(t){if(-1===this.supportedPresentationModes.indexOf(t))throw new TelecineError("InvalidPresentationMode","The “".concat(t,"” presentation mode is not supported."));"pictureInPictureEnabled"in document?"picture-in-picture"===t?this.At():document.pictureInPictureElement===this.$&&this.xt():"function"==typeof this.$.webkitSetPresentationMode&&this.$.webkitSetPresentationMode(t)}},{key:"supportedPresentationModes",get:function(){var t=["inline"];return"pictureInPictureEnabled"in document?document.pictureInPictureEnabled&&!this.$.disablePictureInPicture&&t.push("picture-in-picture"):"function"==typeof this.$.webkitSupportsPresentationMode&&this.$.webkitSupportsPresentationMode("picture-in-picture")&&t.push("picture-in-picture"),t}},{key:"video",get:function(){return this.nt},set:function(t){var n=this;if(this.reactivate(),this.nt!==t){if(this.nt&&(this.nt.off("filesrcupdate"),this.nt.off("texttracksrcupdate")),this.removeAllCuePoints(),this.nt=t,this.Mt=t.files.filter((function(t){return-1!==n.constructor.supportedVideoTypes.indexOf(t.mime)})),this.nt.on("filesrcupdate",(function(t){t===n.it&&n.It()})),this.nt.on("texttracksrcupdate",(function(t){n.video.currentScanner&&n.video.currentScanner.setSrcForTrack(t,t.src)})),this.tt.externalDisplays&&this.tt.externalDisplays.length){this.et=[];var i=this.constructor.supportedExternalDisplays;Array.isArray(i)||(i=[]);var e=i.map((function(t){return t.displayName}));this.tt.externalDisplays.filter((function(t){return t.supported&&-1!==e.indexOf(t.displayName)})).forEach((function(i){var e=new i(t),r=i.displayName.replace("ExternalDisplay","");e.on(Ti.LOADED_METADATA,(function(t){return n.fire(Ti.LOADED_METADATA,t)})),e.on("available",(function(){return n.fire(Si.AVAILABLE,{type:r})})),e.on("unavailable",(function(){return n.fire(Si.UNAVAILABLE,{type:r})})),e.on("activated",(function(){"function"==typeof n.onexternaldisplayactivated&&n.onexternaldisplayactivated(e),n.fire(Si.ACTIVATED,{type:r})})),e.on("deactivated",(function(){"function"==typeof n.onexternaldisplaydeactivated&&n.onexternaldisplaydeactivated(e),n.fire(Si.DEACTIVATED,{type:r})})),n.et.push(e)}))}this.It(),Yi.iOS&&this.et.forEach((function(t){"AirPlay"===t.constructor.displayName&&(t.element=n.$)})),this.initDrm()}}},{key:"videoElement",get:function(){return this.$}},{key:"videoWidth",get:function(){return this.$.videoWidth}},{key:"videoHeight",get:function(){return this.$.videoHeight}},{key:"volume",get:function(){return this.$.volume},set:function(t){this.$.volume=t}},{key:"readyState",get:function(){return this.$.readyState}}]),t}(),Ie={};try{Ie.Set=Set}catch(t){!function(t,n){var i=n(e.prototype,{size:{configurable:!0,get:function(){return this.Ot.length}}});function e(t){n(this,{Ot:{value:[]}}),t&&t.forEach(this.add,this)}function r(n,i){return-1<(t=n.Ot.indexOf(i))}function o(t){return[t,t]}i.add=function(t){return r(this,t)||this.Ot.push(t),this},i.clear=function(){var t=this.Ot.length;this.Ot.splice(0,t)},i.delete=function(n){return r(this,n)&&!!this.Ot.splice(t,1)},i.entries=function(){return this.Ot.map(o)},i.forEach=function(t,n){this.Ot.forEach((function(i,e){t.call(n,i,i,this)}),this)},i.has=function(t){return r(this,t)},i.keys=i.values=function(){return this.Ot.slice(0)},Ie.Set=e}(0,Object.defineProperties)}var Re=Ie.Set,Oe={MANIFEST:"manifest",SEGMENT:"segment"},Le={method:"GET",async:!0,retry:0,throwHttpErrors:!0,headers:{},hooks:{beforeRequest:[],beforeRetry:[],afterResponse:[]},validateStatus:function(t){return t>=200&&t<300},retryStatus:function(t){return[408,413,429].includes(t)||t>=500&&t<600}};function De(t,n){var i=this;this.headers={},this.perfTimings={},dt(this,n),this.ok=2==(this.status/100|0),this.body=t,this.text=function(){return r.resolve(t)},this.json=function(){return r.resolve(JSON.parse(t))},this.blob=function(){return r.resolve(new Blob([t]))},this.arrayBuffer=function(){return r.resolve(t)},this.clone=function(){return new De(t,i)}}var je=function(t){function n(){var n;return(n=t.call(this,"The operation was aborted.")||this).name="AbortError",n}return G(n,t),n}(X(Error)),Ne=function(t){function n(n){var i;return(i=t.call(this,n.statusText)||this).name="HTTPError",i.response=n,i}return G(n,t),n}(X(Error)),Pe=function(t){function n(){var n;return(n=t.call(this,"A network error occurred.")||this).name="NetworkError",n}return G(n,t),n}(X(Error)),Ue=function(t){function n(n){var i;return(i=t.call(this,"Request timed out.")||this).name="TimeoutError",i.timeoutMs=n,i}return G(n,t),n}(X(Error));function Fe(){}function Ve(t,n,i){if(!t.s){if(i instanceof Be){if(!i.s)return void(i.o=Ve.bind(null,t,n));1&n&&(n=i.s),i=i.v}if(i&&i.then)return void i.then(Ve.bind(null,t,n),Ve.bind(null,t,2));t.s=n,t.v=i;var e=t.o;e&&e(t)}}var Be=function(){function t(){}return t.prototype.then=function(n,i){var e=new t,r=this.s;if(r){var o=1&r?n:i;if(o){try{Ve(e,1,o(this.v))}catch(t){Ve(e,2,t)}return e}return this}return this.o=function(t){try{var r=t.v;1&t.s?Ve(e,1,n?n(r):r):i?Ve(e,1,i(r)):Ve(e,2,r)}catch(t){Ve(e,2,t)}},e},t}();function He(t){return t instanceof Be&&1&t.s}function qe(t){var n=function(t){return function(){for(var n=[],i=0;i=t.retry)return 0;if(n instanceof Ne){if(!t.retryStatus(n.response.status))return 0;var e=n.response.headers["retry-after"];if(e&&t.retryStatus(n.response.status)){var r=Number(e);return isNaN(r)?r=Date.parse(e)-Date.now():r*=1e3,r}if(413===n.response.status)return 0}return.3*Math.pow(2,i-1)*1e3}(o);return function(s,c){var l=function(){if(0!==a&&i>0)return function(t,n,i){return t&&t.then||(t=r.resolve(t)),n?t.then(n):t}(ct(a),(function(){var a=t.hooks.beforeRetry||[];return function(t,n){return t&&t.then?t.then(n):n()}(function(t,n,i){var e,r,o=-1;return function i(u){try{for(;++o=u&&("function"==typeof c.clearResourceTimings&&c.clearResourceTimings(),"function"==typeof c.setResourceTimingBufferSize&&(c.setResourceTimingBufferSize(500),u=500)),i.length){var e=i.filter((function(t){return t.name===s.responseURL})).sort((function(t,n){return t.connectStart-n.connectStart}));e.length&&(n=e[e.length-1].toJSON())}}r(new De(s.response,{headers:t,statusText:s.statusText,status:s.status,url:s.responseURL,perfTimings:n}))}},s.onabort=function(){a(new je)},s.onerror=function(){a(new Pe)},s.ontimeout=function(){a(new Ue(t.timeout))},"function"==typeof o&&s.addEventListener("progress",o),t.headers)s.setRequestHeader(l,t.headers[l]);t.withCredentials&&(s.withCredentials=!0),t.responseType&&(s.responseType=t.responseType),t.abort=s.abort.bind(s),s.send(e||null)}))}(n).then(ir(n))}))})),e=n=new nr(t,n),o=e.method,u=e.json,a=e.jwt,s=e.searchParams;if(u&&(n.headers["Content-Type"]=Ze.json,n.body=JSON.stringify(u)),a&&(n.headers.Authorization="jwt ".concat(a)),s){var c=Q(n.url.split("?"),2),l=c[0],f=c[1];n.url=_t(l,z(z({},gt(f)),s))}var h=-1!==Qe.indexOf(o.toLowerCase())?qe(n)(i):i(),d=function(t){h[t]=$e((function(){return n.headers["Content-Type"]=Ze[t],We(h,(function(n){return n.clone()[t]()}))}))};for(var v in Ze)d(v);return function t(n,i){var e=n.then.bind(n);return Object.assign(n,{abort:i,then:function(){return t(e.apply(void 0,arguments),i)}})}(h,(function(){return n.abort()}))}function nr(t,n){dt(this,Le,t="string"==typeof t?{url:t}:t,n)}function ir(t){var n=t.validateStatus,i=t.throwHttpErrors,e=t.hooks;return $e((function(r){var o=e.afterResponse||[];return Je(Ke(o,(function(n){return We((0,o[n])(t,r.clone()),(function(t){t instanceof De&&(r=t)}))})),(function(){if(!n||n(r.status))return r;if(i)throw new Ne(r);return r}))}))}Xe.forEach((function(t){return tr[t]=function(n,i){return tr(n,z({method:t},i))},tr[t]}));var er=tr.get,rr=tr.post,or=tr.put,ur=tr.patch,ar=tr.head,sr={ARRAY_BUFFER:"arraybuffer"},cr=Object.freeze({__proto__:null,ContentTypes:Oe,defaults:Le,requestMethods:Xe,responseTypes:Ze,retryMethods:Qe,request:tr,Request:nr,get:er,post:rr,put:or,patch:ur,head:ar,Response:De,ResponseTypes:sr,AbortError:je,HTTPError:Ne,NetworkError:Pe,TimeoutError:Ue});function lr(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0===t.length)return 0;for(var i=0,e=0,r=0;r=1)return t[t.length-1];var i=t.length*n,e=Math.floor(i),r=e+1,o=i%1;return r>=t.length?t[e]:t[e]*(1-o)+t[r]*o}function dr(t){t.sort((function(t,n){return t-n}));var n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2}function vr(){return"undefined"!=typeof performance?performance.now():Date.now()}var pr=function(t){function n(){return t.apply(this,arguments)||this}return G(n,t),n}(X(Error));function mr(){}var br=[],wr=[],gr=[];function yr(t,n,i){return i?n?n(t):t:(t&&t.then||(t=r.resolve(t)),n?t.then(n):t)}var _r=[],kr=function(){function t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.retryCount,i=void 0===n?3:n,e=t.parallel,r=void 0===e?1:e,o=t.includeWithSpeeds,u=void 0===o||o,a=t.timeout,s=void 0===a?0:a,c=t.retryAbortErrors,l=void 0===c||c;this.Lt=[],this.Dt=new Re,this.jt=new N,this.Nt=i,this.Pt=!1,this.Ut=!1,this.Ft=r,this.Vt=u,this.Bt=s,this.Ht=l,this.qt()}t.getPercentileSpeed=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8,i=br.slice(-t);return hr(i,n)},t.getAverageSpeed=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=br.slice(-t);return lr(i,n)},t.getHarmonicAverageSpeed=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,n=br.slice(-t);return fr(n)},t.getVolatilityScaler=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,n=br.slice(-t);if(n.length<3)return null;var i=lr(n,[]),e=Math.min.apply(Math,tt(n));return e/i},t.getMedianSpeed=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,n=br.slice(-t);return dr(n)},t.getResponseSpeeds=function(){return br},t.getProgressSpeeds=function(){return _r},t.getFailedSegments=function(){return wr},t.getSuccessfulSegments=function(){return gr};var n=t.prototype;return n.add=function(t,n){var i=this;return new r((function(e,r){var o=i.Wt(t,e,r);i.zt(o,n),i.Pt&&!i.Ut&&i.Gt()}))},n.start=function(){this.Pt||(this.Pt=!0,this.Gt())},n.stop=function(){this.Pt=!1},n.abort=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=this.Lt.filter((function(t){return!n||n===t.stream}));i.forEach((function(n){n.reject(new pr("Stream manually aborted")),t.fire("downloadabort",n.identifier)})),this.Lt=this.Lt.filter((function(t){return n&&n!==t.stream})),this.Dt.forEach((function(t){n&&n!==t.stream||t.request.abort()}))},n.Yt=function(t){for(var n=0;nt.priority);n++);this.Lt.splice(n,0,t)},n.qt=function(){var t=this;this.Kt=new N,rt(this),window.addEventListener("online",(function(){t.start(),t.Jt&&(t.Jt.resolve(),t.Jt=null)})),window.addEventListener("offline",(function(){t.stop(),t.abort(),t.Jt=new vt}))},n.zt=function(t,n){t.hasOwnProperty("priority")?this.Yt(t):this.Lt[n?"unshift":"push"](t)},n.Gt=function(){if(this.Pt){this.Ut=!0;for(var t=this.Ft-this.Dt.size,n=0;n>t/4).toString(16)}))}},a=this.Bt,s=parseInt(o,10);s>=0&&(a=s);var c={url:n,type:Oe.SEGMENT,responseType:sr.ARRAY_BUFFER,retry:this.Nt,hooks:{beforeRetry:[this.Zt.bind(this)]},onDownloadProgress:this.Qt(r,u),headers:i&&{Range:"bytes=".concat(i)},retryAbortErrors:this.Ht,timeout:a};this.fire("downloadstart",r),u.request=tr(c).then(this.tn(u,t)).catch(this.nn(u,t)),this.Dt.add(u)}else this.Ut=!1},n.Zt=function(){try{var t=this;return function(n){var i=function(){if(t.Jt)return function(t,n){return t&&t.then?t.then(mr):r.resolve()}(t.Jt)}();if(i&&i.then)return i.then(mr)}()}catch(t){return r.reject(t)}},n.Qt=function(t,n){var i=this,e=0,r=0,o=vr();return function(u){if(u.lengthComputable){var a=8*(u.loaded-r),s=vr(),c=s-o,l={startTime:o,length:c,bitrate:a/(c/1e3),index:e};e>0&&(_r.length>=100&&_r.shift(),_r.push(l)),o=s,r=u.loaded,e+=1,i.Kt.set(n,{bytesTotal:u.total,bytesLoaded:u.loaded,percent:u.loaded/u.total,identifier:t}),i.fire("progress",t)}}},n.tn=function(t,n){var i=this,e=vr(),o=n.identifier,u=n.resolve;return function(t){return function(){for(var n=[],i=0;i8e3){var o=8*i,u=o/r;if(t.excludeConnectTime&&o<=16e5){var a=(50*Math.max(0,1-o/16e5)+150)/1e3;u=o/Math.max(.1,r-a)}br.length>100&&br.shift(),this.Vt&&e&&br.push(u)}},n.rn=function(t,n){return t.data.url&&t.data.url.match(".ts$")?this.un(t,n):r.resolve(new Uint8Array(n))},n.un=function(t,n){try{var i=this;return function(t,n){var e=function(){if(!i.an)return yr(ht("module/mux-mp4.js"),(function(t){i.an=new t({keepOriginalTimestamps:!0})}))}();return e&&e.then?e.then(n):n()}(0,(function(){return new r((function(e){i.an.on("data",(function(n){i.an.off("data");var r=new Uint8Array(n.initSegment.byteLength+n.data.byteLength);r.set(n.initSegment,0),r.set(n.data,n.initSegment.byteLength),e(t.data.isInitSegmentRequest?n.initSegment:r)})),i.an.push(new Uint8Array(n)),i.an.flush()}))}))}catch(t){return r.reject(t)}},n.nn=function(t,n){var i=this,e=n.identifier,r=n.reject,o=n.size;return function(n){var u=vr()-t.data.requestSendTime;if(t.data.duration=u,n instanceof je)wr.push({url:t.data.url,status:"abort",duration:u}),i.fire("downloadabort",e);else if(n instanceof Ne)wr.push({url:t.data.url,status:n.response.status,duration:u}),i.fire("downloaderror",e,n.response.status);else if(n instanceof Ue){if(wr.push({url:t.data.url,status:"timeout",duration:u}),o>0&&n.timeoutMs>0){var a=8*o/(n.timeoutMs/1e3);a*=.5,br.push(a)}i.fire("downloadtimeout",e,{timeoutMs:n.timeoutMs})}i.Kt.delete(t),i.Dt.delete(t),r(n),i.Xt()}},H(t,[{key:"parallel",get:function(){return this.Ft},set:function(t){this.Ft=t}},{key:"pendingFetches",get:function(){var t=this,n=[];return this.Dt.forEach((function(i){if(t.Kt.get(i)){var e=t.Kt.get(i);e.elapsedTime=vr()-i.data.requestSendTime,n.push(e)}})),n}}]),t}(),Er=function(){function t(t){rt(this),this.sn=t,this.cn=null,this.ln=null,this.fn=!1,this.hn=!0,this.dn=null,this.vn=[],this.pn=[],this.mn=!1,this.bn=null,this.wn=!1,this.gn=void 0,this.yn=!1,this._n=!0,this.kn={},this.En=this.Tn.bind(this),this.sn.on("durationset",this.Sn.bind(this))}var n=t.prototype;return n.addStream=function(t){var n=this;t.on("segmentadd",(function(){return n.An()}));var i=this.pn.push(t)-1;t.index=i,null===this.ln&&(this.xn(i),this.fn=!0)},n.streamIndexAtTime=function(t){return this.kn[void 0]?{stream:this.activeStreamIndex}:this.kn[Math.floor(t/6)]},n.switchTo=function(t){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=t;"object"===V(t)&&(e=t.index);var o=this.ln!==e,u=o;if(!o&&this.fn&&(o=!0),o){this.fn=!1;var a=this.ln,s=this.pn[a];this.fire("streamchangestart",a,e),s&&u&&i&&s.abort(),this.Cn=e,this.xn(e)}return this.An(),new r((function(t){o?n.Mn=function(){n.Cn===e&&(n.Mn=null,t(),n.fire("streamchange",e))}:t()}))},n.isTimeInBuffer=function(t){for(var n=0;n=t)return!0}return!1},n.hasAppendedFinalSegment=function(){return void 0!==this.gn&&this.isTimeInBuffer(this.gn)},n.clear=function(){this.pn.forEach((function(t){return t.clear()}))},n.remove=function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.sn.In.duration;return new r((function(e,r){n.vn.push([t,i,e]),n.An()}))},n.removeEventListeners=function(){this.cn&&this.cn.removeEventListener("updateend",this.En)},n.Sn=function(){var t=this.sn.In.duration,n=Math.floor(t/6);n+=6%t>1?1:0;for(var i=0;i0&&"open"===this.sn.In.readyState&&this.sn.checkEndOfStream()},n.Dn=function(){this.dn&&(this.fire("appendbufferend",this.dn),this.dn=null,this.Mn&&this.Mn())},n.An=function(){if(this.cn){if(this.activeStream&&"closed"!==this.sn.In.readyState&&!this.cn.updating)if(this.vn.length)this.jn();else if(!this.mn&&!this.yn)return this.hn?(this.hn=!1,void this.Nn()):void this.Pn()}else this.on("sourcebufferattach",this.An)},n.jn=function(){var t=this,n=Q(this.vn.shift(),3),i=n[0],e=n[1],r=n[2];this.cn.addEventListener("updateend",(function n(i){t.cn.removeEventListener("updateend",n),r(),clearTimeout(t.bn),t.bn=setTimeout((function(){t.mn=!1,t.An()}),5e3)})),this.cn.remove(i,e)},n.Nn=function(){var t=this;this.yn=!0,this.activeStream.getInitSegment().then((function(n){return t.dn=null,t.cn.appendBuffer(n),t.yn=!1,n})).catch((function(n){t.hn=!0,t.yn=!1}))},n.Pn=function(){var t=this.activeStream.getNextSegment();if(null!==t){var n=this.activeStream.getIdForSegment(t);this.activeStream.isFinal(t)&&(this.wn=!0),this.dn=n,this.fire("appendbufferstart",n);try{this.cn.appendBuffer(t),this.kn[n.segment]=n,this._n&&(this._n=!1,this.fire("initialbufferstart"))}catch(n){if("QuotaExceededError"===n.name){if(this.mn=!0,this.fire("quotaexceedederror",this.cn.buffered),this.sn.$.currentTime>6){var i=this.sn.$.currentTime-6;this.sn.removeBuffer(0,i)}this.activeStream.Un.unshift(t)}}}},H(t,[{key:"streams",get:function(){return this.pn}},{key:"activeStreamIndex",get:function(){return this.ln}},{key:"activeStream",get:function(){return this.pn[this.ln]}},{key:"sourceBuffer",get:function(){return this.cn},set:function(t){this.cn=t,this.Rn(),this.fire("sourcebufferattach")}},{key:"endTime",get:function(){var t=this.cn.buffered;if(t.length>0)return t.end(t.length-1)}}]),t}();function Tr(){}var Sr=function(){function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new kr;rt(this),this.Un=[],this.Fn=t,this.hn=!0,this.Vn=NaN,this.Bn=n,this.Hn=i,this.Hn.start(),this.qn=new N,this.Wn={}}t.isValidSegmentUrl=function(t){return"string"==typeof t||"string"==typeof t.url&&"string"==typeof t.byteRange};var n=t.prototype;return n.getIdForSegment=function(n){return t.isValidSegmentUrl(n)?this.Wn[n]:this.qn.get(n).id},n.isFinal=function(t){return this.qn.get(t).final},n.addSegment=function(n){var i=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=e.identifier,u=void 0===o?null:o,a=e.isFinalSegment,s=void 0!==a&&a,c=e.loadOnly,l=void 0!==c&&c,f=e.priority,h=void 0===f?0:f,d=e.includeWithBandwidthChecks,v=void 0===d||d,p=e.excludeConnectTime,m=void 0!==p&&p,b=e.timeout,w=void 0===b?null:b,g=e.size,y=void 0===g?null:g;return this.hn&&this.getInitSegment(),t.isValidSegmentUrl(n)?(this.Wn[n]=u||n,this.fire("queued",this.getIdForSegment(n)),this.Hn.add({url:n.url||n,byteRange:n.byteRange,id:this.getIdForSegment(n),stream:this,includeWithBandwidthChecks:v,excludeConnectTime:m,isInitSegmentRequest:!1,priority:h,timeout:w,size:y}).then((function(t){i.qn.set(t,{id:u||n,final:s}),i.Un.push(t),i.fire("bufferqueueadd",i.getIdForSegment(n)),l||i.fire("segmentadd")}))):(this.qn.set(n,{id:u,final:s}),this.Un.push(n),this.fire("bufferqueueadd",u),r.resolve())},n.clear=function(){this.Un=[]},n.abort=function(){try{var t=this;return function(n,i){var e=function(){if(t.hn)return function(t){if(t&&t.then)return t.then(Tr)}(function(n,i){try{var e=function(t,n){return t&&t.then?t.then(Tr):r.resolve()}(t.getInitSegment())}catch(t){return}return e&&e.then?e.then(void 0,i):e}(0,(function(t){})))}();return e&&e.then?e.then(i):i()}(0,(function(){t.Hn.abort(t)}))}catch(t){return r.reject(t)}},n.hasNextSegment=function(){return this.Un.length>0},n.getNextSegment=function(){return 0===this.Un.length?null:this.Un.shift()},n.getInitSegment=function(){var n=this,i="object"===V(this.Fn)&&"url"in this.Fn?this.Fn.url:this.Fn;return i?(this.hn=!1,t.isValidSegmentUrl(i)?this.Hn.add({url:i,byteRange:this.Fn.byteRange,id:null,stream:this,isInitSegmentRequest:!0,priority:0}).then((function(t){return n.Fn=t,n.Fn})):r.resolve(this.Fn)):r.resolve(null)},H(t,[{key:"codec",get:function(){return this.Bn},set:function(t){this.Bn=t}},{key:"index",get:function(){return this.Vn},set:function(t){this.Vn=t}},{key:"pendingFetches",get:function(){return this.Hn.pendingFetches}}]),t}(),Ar=function(){function t(t){this.$=t,this.Pt=!1,this.zn=null,this.Gn={},this.Yn={},this.Kn=0,this.Jn=0,this.$n="default",this.bound={startCheckingDroppedFrames:this.Xn.bind(this),stopCheckingDroppedFrames:this.Zn.bind(this)}}var n=t.prototype;return n.start=function(){return this.Xn(),this},n.stop=function(){return this.Zn(),this},n.destroy=function(){this.Zn(),this.Qn()},n.getDroppedFrameRate=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"average",e=this.Gn[n];if(!e)return 0;if(e.length100&&this.Gn[this.$n].shift(),this.Yn[this.$n].length>100&&this.Yn[this.$n].shift(),this.Gn[this.$n].push(i),this.Yn[this.$n].push(r),this.zn=setTimeout((function(){t.ii()}),1e3)}},n.ti=function(){return"function"==typeof this.$.getVideoPlaybackQuality?this.$.getVideoPlaybackQuality().droppedVideoFrames:this.$.webkitDroppedFrameCount||0},n.ni=function(){return"function"==typeof this.$.getVideoPlaybackQuality?this.$.getVideoPlaybackQuality().totalVideoFrames:this.$.webkitDecodedFrameCount||0},n.ei=function(){if("function"==typeof this.$.getVideoPlaybackQuality){var t=this.$.getVideoPlaybackQuality();return t.totalVideoFrames-t.droppedVideoFrames-t.corruptedVideoFrames}return this.$.webkitDecodedFrameCount||0},H(t,[{key:"streamIndex",get:function(){return this.$n},set:function(t){this.$n=t}}]),t}(),xr=function(){function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.$=t,this.tt=n,rt(this);var i=this.tt,e=i.fetcherTimeout,r=void 0===e?0:e,o=i.fetcherRetryAbortErrors,u=void 0===o||o;this.On=new Ar(t),this.In=new MediaSource,this.Hn=new kr({parallel:1,timeout:r,retryAbortErrors:u}),this.ri={},this.oi=[],this.ai=null,this.si=this.ci.bind(this),this.Rn()}var n=t.prototype;return n.switchTo=function(t){return 1===this.oi.length&&this.video.switchTo(t)},n.getCurrentSpeed=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.type,i=void 0===n?"average":n,e=t.howMany,r=void 0===e?10:e,o=t.weights,u=void 0===o?[]:o,a=t.percentile,s=void 0===a?null:a;return"harmonicAverage"===i?kr.getHarmonicAverageSpeed(r):"average"===i?kr.getAverageSpeed(r,u):"median"===i?kr.getMedianSpeed(r):kr.getPercentileSpeed(r,s)},n.getVolatilityScaler=function(t){return kr.getVolatilityScaler(t)},n.getResponseSpeeds=function(){return kr.getResponseSpeeds()},n.getFailedSegments=function(){return kr.getFailedSegments()},n.getSuccessfulSegments=function(){return kr.getSuccessfulSegments()},n.getDroppedFrameRate=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.activeStreamIndex,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"average";return this.On.getDroppedFrameRate(t,n,i)},n.getDroppedFrameTotal=function(){return this.On.getDroppedFrameTotal()},n.clear=function(){this.oi.forEach((function(t){return t.clear()}))},n.streamIndexAtTime=function(t,n){return this.ri[n].streamIndexAtTime(t)?this.ri[n].streamIndexAtTime(t).stream:null},n.removeBuffer=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.$.duration;if(t>=(n=n||0))return r.resolve();var i=this.oi.map((function(i){return i.remove(t,n)}));return r.all(i)},n.addStream=function(t,n){var i=this,e=this.li(t);if(!this.ri[e]){var r=new Er(this,e);this.ri[e]=r,this.oi.push(r),this.readyPromise.then((function(){var n;try{n=i.In.addSourceBuffer(t)}catch(t){if(22!==t.code)return void i.fire("srcnotsupported",t);n=i.ri[e]}i.tt.duration&&(n.appendWindowEnd=i.tt.duration+.1),r.sourceBuffer=n})).catch((function(t){})),["appendbufferstart","appendbufferend","streamchange","streamchangestart","initialbufferstart","quotaexceedederror"].forEach((function(t){r.on(t,(function(n){i.fire(t,n)}))}))}var o=new Sr(n,t,this.Hn);return["queued","bufferqueueadd"].forEach((function(t){o.on(t,(function(n){i.fire(t,n)}))})),this.ri[e].addStream(o),o},n.checkEndOfStream=function(){var t=this;this.oi.every((function(t){return t.hasAppendedFinalSegment()}))&&this.$.addEventListener("timeupdate",(function n(){t.$.removeEventListener("timeupdate",n),t.oi.every((function(n){return n.isTimeInBuffer(t.$.currentTime)}))&&t.endOfStream()}))},n.abortFetches=function(){this.Hn.abort()},n.endOfStream=function(){"open"===this.In.readyState&&(this.fi()||(this.In.endOfStream(),this.fire("endofstream")))},n.destroy=function(){this.clear(),this.hi(),this.off(),this.On.destroy(),this.Hn.abort(),this.$.src&&(this.$.removeAttribute("src"),this.$.load())},n.Rn=function(){var t=this;this.readyPromise=new r((function(n,i){t.ai=n,t.In.addEventListener("sourceopen",t.si)})),["downloadstart","downloadend","downloadabort","downloaderror","downloadtimeout","progress"].forEach((function(n){t.Hn.on(n,(function(){for(var i=arguments.length,e=new Array(i),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return(i=t.call(this,n)||this).tt=e,i.blacklisted=[],i.whitelisted=[],i.MAX_LOADABLE_SEGMENTS_AUTO=3,i.MAX_LOADABLE_SEGMENTS_LOCKED=15,i.SEGMENT_DURATION=6,i}G(n,t),H(n,[{key:"displayName",get:function(){return"MediaSource"}}]);var i=n.prototype;return i.isTimeInBuffer=function(t,n,i){return this.di(t,t,n,i,1)},i.getDistanceFromBuffer=function(t,n){for(var i=t,e=0;e=t){i=n.end(e);break}return i-t},i.blacklist=function(t){this.blacklisted[t]=1},i.lock=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.whitelisted=t},i.filterStreams=function(t,n,i){for(var e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=[],u=!1,a=0;a=l&&(u=!0),o.push(t[a]),e=[t[a].width,t[a].height]}}return o},i.getCurrentSpeed=function(){var t="average",n=3,i=[1,2,5];return this.tt.tests&&this.tt.tests.harmonic_average&&this.tt.tests.harmonic_average.group&&(t="harmonicAverage",n=this.pi(),i=[]),this.scanner.sorcerer.getCurrentSpeed({type:t,howMany:n,weights:i})},i.getAudioIndexFromVideo=function(t,n,i){if(0===n.length)return!1;if(!t[i])return 0;for(var e=0;e144e3&&t[i].bitrate>1e6)return e}return 0},i.mi=function(t,n,i,e){var r=i/e,o=t-n*r,u=n-t/r,a=t-o,s=n-u;return o>0&&(s=n),u>0&&(a=t),[a,s]},i.vi=function(t,n,i,e){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=this.mi(t,n,i,e),u=i*e;r&&(u*=r);var a=window.devicePixelRatio||1,s=o[0]*o[1]*a*a;return u/s},i.pi=function(){var t=be(this.tt,"lookahead_count");return t&&t.group&&t.data.count?t.data.count:t&&t.data.segment_lookahead_count?t.data.segment_lookahead_count:this.MAX_LOADABLE_SEGMENTS_AUTO},i.bi=function(t,n,i){var e=i&&i.bitrate>11e6;return 1===this.whitelisted.length?e?30:this.MAX_LOADABLE_SEGMENTS_LOCKED*this.SEGMENT_DURATION:this.pi()*this.SEGMENT_DURATION},i.di=function(t,n,i,e){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!i)return!1;n=Math.min(n,e);for(var o=0;o=n)return!0}return!1},i.wi=function(t){return t.video.length>0&&t.audio.length>0},i.gi=function(t,n,i,e){var r=1;return this.wi(e)&&(r=.05),this.di(t.start,t.end,n,i,r)},n}(function(){function t(t){this.scanner=t,this.STREAM_TYPE_VIDEO="video",this.STREAM_TYPE_AUDIO="audio"}H(t,[{key:"displayName",get:function(){return"Brain"}}]);var n=t.prototype;return n.destroy=function(){},n.shouldPowerUp=function(t,n){return!1},n.shouldPowerDown=function(t,n){return!1},n.canPowerUp=function(t,n){return 1!==t.length&&n0},n.filterStreams=function(t){return t},t}()),Mr=function(t){function n(n){var i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(i=t.call(this,n,e)||this).BANDWIDTH_UPSWITCH_THRESHOLD=.85,i.BANDWIDTH_DOWNSWITCH_THRESHOLD=.9,i.DEFAULT_TIMEOUT=8e3,i.SEGMENT_RELATIVE_TIMEOUT_RATIO=4/3,i.MINIMUM_TIMEOUT=1e3,i}G(n,t),H(n,[{key:"displayName",get:function(){return"Skyfire"}}]);var i=n.prototype;return i.shouldPowerUp=function(t,n,i){i&&this.tt.startingBandwidthThreshold&&(this.BANDWIDTH_UPSWITCH_THRESHOLD=this.tt.startingBandwidthThreshold);var e=t.indexOf(n);if(-1===e&&(e=0),!this.canPowerUp(t,e))return r.resolve(!1);var o=this.getCurrentSpeed();if(!o)return r.resolve(!1);var u=this.yi(o,this.BANDWIDTH_UPSWITCH_THRESHOLD,t);return u===e||!i&&u>e&&pt(this.scanner.currentTime,this.scanner.$.buffered)<1.5*this.SEGMENT_DURATION?r.resolve(!1):r.resolve(u)},i.shouldPowerDown=function(t,n){var i=t.indexOf(n);if(-1===i){var e=this.isTimeInBuffer(this.scanner.$.duration,this.scanner.$.buffered,this.scanner.$.duration);return this.whitelisted.length||this.blacklisted.length||!e?r.resolve(t.length-1):r.resolve(!1)}if(!this.canPowerDown(t,i))return r.resolve(!1);var o=this.getCurrentSpeed();if(!o)return r.resolve(!1);if(this.hasTooManyDroppedFrames(i,n,this.tt.droppedFrameSwitchPercent))return r.resolve(i-1);var u=this.yi(o,this.BANDWIDTH_DOWNSWITCH_THRESHOLD,t);return u===i?r.resolve(!1):r.resolve(u)},i.hasTooManyDroppedFrames=function(t,n,i){return this.scanner.sorcerer.getDroppedFrameRate(10,t,"median")/n.framerate*100>=i&&(this.blacklist(t),!0)},i.getTimeEstimateToLoad=function(t,n){if(null===n)return 3;var i=n.segments[t],e=i.end-i.start,r=this.getCurrentSpeed();return e*(n.bitrate+n.audioBitrate)/r*1.3},i.canPlayFromTimeInStream=function(t,n){if(!this.isTimeInBuffer(t,this.scanner.$.buffered,this.scanner.$.duration))return!1;if(!n)return!1;var i=this.getSegmentsToLoad(!1,this.STREAM_TYPE_VIDEO,n);if(0===i.length)return!0;var e=pt(t,this.scanner.$.buffered);return this.getTimeEstimateToLoad(i[0],n)1&&void 0!==arguments[1]?arguments[1]:this.STREAM_TYPE_VIDEO,i=arguments.length>2?arguments[2]:void 0,e=this.scanner.$,r=this.scanner.currentTime,o=[],u=this.bi(r,e.duration,i),a=r+u,s=this.scanner.sorcerer[n].activeStreamIndex,c=this.scanner.pn[n][s];if(!c)return o;var l=this.scanner.sorcerer[n].sourceBuffer,f=null;l&&(f=l.buffered);for(var h=0;ha)){var v=r>=d.start&&r=d.start)&&o.push(h)}}return o},i.getSegmentRelativeTimeout=function(t,n,i){var e,r=null==n?void 0:n.bitrate,o=null==(e=t[0])?void 0:e.bitrate;if(!r||!o||!i)return this.DEFAULT_TIMEOUT;if(r===o)return this.DEFAULT_TIMEOUT;var u=i*this.SEGMENT_RELATIVE_TIMEOUT_RATIO;return Math.max(this.MINIMUM_TIMEOUT,Math.min(this.DEFAULT_TIMEOUT,u))},i.yi=function(t,n,i){for(var e=0,r=e;ri[r].bitrate+i[r].audioBitrate&&(e=r);return e},n}(Cr),Ir=function(t){function n(n){var i,e,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(r=t.call(this,n,o)||this)._i=o.tests.ml_brain.data.mimir_url,r.ki=o.tests.ml_brain.data.geolocation,r.Ei={},r.Ti=null,r.Si=[],r.Ai=[],r.xi=[],r.Ci=[],r.Mi=[],r.Ii=[],r.Ri=[],r.Oi=[],r.Li=[],r.Di=null,r.ji=0,r.Ni=null,r.Pi=null,r.Ui=!1,r.Fi=!1,r.Vi=0,r.Bi=[],r.Hi=0,r.qi=[[xi.DOWNLOAD_START,r.Wi.bind(Z(r))],[xi.DOWNLOAD_END,r.zi.bind(Z(r))],[xi.APPEND_BUFFER_END,r.Gi.bind(Z(r))],[xi.DOWNLOAD_TIMEOUT,r.Yi.bind(Z(r))]],r.Ki=[r.Ji],r.$i=[r.Xi],r.qi.forEach((function(t){r.scanner.on(t[0],t[1])})),(i=Le.hooks.beforeRequest).push.apply(i,tt(r.Ki)),(e=Le.hooks.afterResponse).push.apply(e,tt(r.$i)),r}G(n,t),H(n,[{key:"displayName",get:function(){return"ML"}}]);var i=n.prototype;return i.destroy=function(){var t=this;this.qi.forEach((function(n){t.scanner.off(n[0],n[1])})),this.Ki.forEach((function(t){var n=Le.hooks.beforeRequest,i=n.indexOf(t);i>=0&&n.splice(i,1)})),this.$i.forEach((function(t){var n=Le.hooks.afterResponse,i=n.indexOf(t);i>=0&&n.splice(i,1)}))},i.Wi=function(t){var n=t.identifier;n.type===this.STREAM_TYPE_VIDEO&&(this.Ni={index:n.segment,streamIndex:n.stream,complete:null}),n.type===this.STREAM_TYPE_AUDIO&&(this.Pi={index:n.segment,streamIndex:n.stream,complete:null})},i.Zi=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.STREAM_TYPE_VIDEO;return n===this.STREAM_TYPE_VIDEO?null!==this.Ni&&this.Ni.index===t.segment&&this.Ni.streamIndex===t.stream:n===this.STREAM_TYPE_AUDIO&&null!==this.Pi&&this.Pi.index===t.segment},i.Qi=function(){return null!==this.Ni||null!==this.Pi},i.zi=function(t){var n=t.identifier,i=t.data,e=i.request,r=i.response,o=e.data.duration/1e3,u=r.body.byteLength,a=null;r.perfTimings&&(a=r.perfTimings.responseStart-r.perfTimings.connectStart),n.type===this.STREAM_TYPE_VIDEO&&this.Zi(n,this.STREAM_TYPE_VIDEO)&&(this.Ni.complete={downloadTime:o,byteLength:u,ttfb:a,uuid:e.data.uuid},this.Fi||(this.te({streamIndex:n.stream,segmentIndex:n.segment-1,segmentDLTime:o,segmentLength:u,ttfb:a,didSegmentTimeout:!1}),this.Fi=!0)),n.type===this.STREAM_TYPE_AUDIO&&this.Zi(n,this.STREAM_TYPE_AUDIO)&&(this.Pi.complete={downloadTime:o,byteLength:u,ttfb:a,uuid:e.data.uuid})},i.Yi=function(t){var n=t.identifier,i=(t.data.timeoutMs||8e3)/1e3,e=n.segment,r=this.scanner.pn[n.type][n.stream].segments[e].size;delete this.Ei[e],this.te({streamIndex:n.stream,segmentIndex:e,segmentDLTime:i,segmentLength:r,ttfb:.1,didSegmentTimeout:!0})},i.ne=function(){this.Ni=null,this.Pi=null},i.Gi=function(t){var n=t.identifier;if(n.type===this.STREAM_TYPE_VIDEO&&(this.Hi+=1),this.wi(this.scanner.pn)){if(this.Zi(n,this.STREAM_TYPE_VIDEO)&&this.Zi(n,this.STREAM_TYPE_AUDIO)&&null!==this.Ni.complete&&null!==this.Pi.complete){var i=this.Ni.complete,e=this.Pi.complete,r=i.downloadTime+e.downloadTime,o=i.byteLength+e.byteLength,u=i.ttfb+e.ttfb;this.te({streamIndex:n.stream,segmentIndex:n.segment-1,segmentDLTime:r,segmentLength:o,ttfb:u,segmentRequestID:i.uuid,didSegmentTimeout:!1}),this.ne()}}else if(this.Zi(n,this.STREAM_TYPE_VIDEO)&&null!==this.Ni.complete){var a=this.Ni.complete;this.te({streamIndex:n.stream,segmentIndex:n.segment-1,segmentDLTime:a.downloadTime,segmentLength:a.byteLength,ttfb:a.ttfb,segmentRequestID:a.uuid,didSegmentTimeout:!1}),this.ne()}},i.te=function(t){var n=t.streamIndex,i=t.segmentIndex,e=t.segmentDLTime,r=t.segmentLength,o=t.ttfb,u=t.segmentRequestID,a=t.didSegmentTimeout,s=this.scanner.pn.video[n],c=this.scanner.sorcerer.video.sourceBuffer;if(c&&s){this.Si.push(this.getTotalBufferDuration()),this.Ci.push(pt(this.scanner.currentTime,c.buffered)),this.Mi.push(n),this.Ai.push(e),this.xi.push(r);var l=o+this.ji;this.Ri.push(l),this.Ii.push(s.segments.length-i),this.Li.push(u),this.Oi.push(Number(a))}},i.handleScrubEnd=function(t){var n=this.Ai.length,i=n?this.Ai[n-1]:0,e=this.xi.length,r=e?this.xi[e-1]:0,o=this.Ri.length,u=o?this.Ri[o-1]:0,a=this.scanner.pn.video[t],s=this.ee(a),c=s?s.index:this.Ii[this.Ii.length-1],l=this.Li.length?this.Li[this.Li.length-1]:"";this.te({streamIndex:t,segmentIndex:c,segmentDLTime:i,segmentLength:r,ttfb:u,segmentRequestID:l,didSegmentTimeout:!1})},i.shouldPowerUp=function(t,n,i){var e=t.indexOf(n);if(-1===e&&(e=0),1===this.whitelisted.length)return this.whitelisted[0]>e?r.resolve(0):r.resolve(!1);if(1===this.scanner.pn.video.length)return r.resolve(!1);if(!this.canPowerUp(t,e))return r.resolve(!1);if(this.scrubInProgress)return r.resolve(!1);var o=this.ee(n);if(null===o)return r.resolve(!1);var u={index:o.index,streamIndex:o.streamIndex},a=o.index;if(null!==this.Ti&&this.Ti.index===u.index&&this.Ti.streamIndex===u.streamIndex)return r.resolve(!1);if(!(a in this.Ei))return this.re(u,t,n).then((function(t){return t>e&&t})).catch(console.error);var s=this.Ei[a];return s>e?r.resolve(s):r.resolve(!1)},i.shouldPowerDown=function(t,n){var i=t.indexOf(n);if(-1===i){var e=this.isTimeInBuffer(this.scanner.$.duration,this.scanner.$.buffered,this.scanner.$.duration);return this.whitelisted.length||this.blacklisted.length||!e?r.resolve(t.length-1):r.resolve(!1)}if(1===this.whitelisted.length)return this.whitelisted[0]1&&void 0!==arguments[1]?arguments[1]:0,i=t.slice(0);if(i.length<8){for(var e=8-i.length,r=0;re&&(e=t[r],i=r);for(var o=[],u=0;u=2&&e.scanner.resetBrain(!0);var u=t.streamIndex;return e.Ei[t.index]=u,e.Ti=null,u}))},i.ee=function(t){var n=this.scanner.sorcerer.video.sourceBuffer,i=null;if(n&&(i=n.buffered),null===i)return null;for(var e=this.ce(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:this.STREAM_TYPE_VIDEO,i=this.scanner.$,e=this.scanner.currentTime,r=this.bi(e,i.duration,t),o=e+r,u=[],a=this.scanner.sorcerer[n].activeStreamIndex,s=this.scanner.pn[n][a];if(!s)return u;for(var c=0;co)){var f=e>=l.start&&e=l.start)&&u.push({segment:l,index:c,streamIndex:a})}}return u},i.le=function(t,n){var i=this;Object.keys(this.Ei).filter((function(n){return-1===t.indexOf(parseInt(n,10))})).forEach((function(t){var e=i.Ei[t],r=i.scanner.pn.video[e].segments[t];i.gi(r,n,i.scanner.$.duration,i.scanner.pn)||delete i.Ei[t]}))},i.getSegmentsToLoad=function(t,n,i){var e=this.ce(i,n),r=this.scanner.sorcerer[n].sourceBuffer,o=null;r&&(o=r.buffered),this.le(e.map((function(t){return t.index})),o);for(var u=[],a=0;a=e)return this.$.currentTime=e-.1,!0;if(t.length<=i)return!1;var r=t.start(i);return!(r>=e||r-n>.5||0!==i||(this.stop(),this.pe("audio",r),this.pe("video",r),this.$.currentTime=r,0))},n.ve=function(t,n){if(!t||!t.length)return null;for(var i=0;in&&(0===i||r-n<=.1))break}return i>=0?i:null},n.pe=function(t,n){var i=this.fe(0,t);i&&i.segments&&i.segments[0]&&(i.segments[0].start=n)},t}(),Or=function(t){function n(n){var i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(i=t.call(this,n,e)||this).reset(),i.manifestLoadDurations=[],e.mediaSourceScanner&&(i.me=e.mediaSourceScanner.maxPreloadStreamIndex),i}G(n,t),H(n,null,[{key:"displayName",get:function(){return"MediaSourceScanner"}},{key:"supported",get:function(){return"undefined"!=typeof MediaSource&&MediaSource.isTypeSupported}},{key:"supportedVideoTypes",get:function(){return["application/vnd.vimeo.dash+json","video/vnd.mpeg.dash.mpd"]}}]);var i=n.prototype;return i.deactivate=function(){t.prototype.deactivate.call(this),this.sorcerer&&this.sorcerer.destroy(),this.reset()},i.reset=function(){this.be=new Re,this.we={},Yi.browser.safari&&(this.ge=new Rr(this.$,this.fe.bind(this))),this.resetBrain(),this.ye=!1,this._e=!1,this.Rt=null,this.pn={},this.pn.audio=[],this.pn.video=[],this.Bi=[],this.ke=null,this.Ee=null,this.Te=null,this.Se=null,this.Ae=null,this.xe=null,this.Ce=!1,this.Me=null,this.Ie=!1,this.Re=!1,this.Oe=null,this.Le=null,this.De=!1,this.je=[],this.Ne={},this.Pe=0,this.Ue=null,clearInterval(this.Fe),clearTimeout(this.Ve)},i.resetBrain=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.tt.mediaSourceScanner||{};n.tests=this.tt.tests;var i=Yi.ie;if(this.Be&&this.Be.destroy(),t||i){var e=we(this.Be);return this.Be=new Mr(this,n),void((e||i)&&this.fire(Ri.BRAIN_ML_SWITCH_TO_SKYFIRE))}this.Be=new Mr(this,n);var r=be(n,"ml_brain");r&&r.group&&r.data.use_model&&(this.Be=new Ir(this,n))},i.preloadStream=function(){var t=this;if(this.Oe)return this.Oe;var n=0,i=1;this.pn.audio.length&&(i=2);var e=this.sorcerer.video.activeStreamIndex;this.je.length&&(e=this.je[0]);var o=0,u=this.Be.getSegmentsToLoad(!1,"video",e);u.length>0&&(o=u[0]);var a=function(){},s=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n&&(e=t.sorcerer.video.activeStreamIndex),t.Ue=e,t.He(!0)},c=function(e){(n+=1)e.stream){if(t.sorcerer.video.switchTo(i,!1),t.pn.audio.length){var r=t.Be.getAudioIndexFromVideo(t.pn.video,t.pn.audio,i);t.sorcerer.audio.switchTo(r,!1)}return n=0,void s(!0)}a()})).catch(console.error):a())};return this.Oe=new r((function(n,i){a=function(){var i=t.fe(e).segments[0].end,r=t.We(!0);if(t.currentTime>=r&&(t.currentTime=r),t.currentTime>i&&(t.sorcerer.clear(),t.be=new Re),t.sorcerer.video.switchTo(e,!1),t.pn.audio.length){var o=t.Be.getAudioIndexFromVideo(t.pn.video,t.pn.audio,e);t.sorcerer.audio.switchTo(o,!1)}t.sorcerer.off("bufferqueueadd",c),t.Ue=null,t.ye=!0,n()},t.sorcerer.on("bufferqueueadd",c),s()})),this.Oe},i.loadManifest=function(t){var n=this,i=Date.now();return Yi.browser.ie&&t&&-1!==t.indexOf("archive_playlist")?(setTimeout((function(){n.kt("MediaUnknownError","An unknown error occurred.")}),250),new r((function(){}))):tr({url:t,timeout:1e4,type:Oe.MANIFEST}).then((function(e){return e.url&&e.url!==t&&-1!==e.url.indexOf("live-archive")&&(n.Ee=e.url.split("/").slice(0,-2).join("/")),n.manifestLoadDurations.push({url:t,status:e.status,duration:Date.now()-i}),n.fire(xi.MANIFEST_LOADED),e.text()})).then(function(t){return function(){for(var n=[],i=0;i2&&void 0!==arguments[2])||arguments[2];if(e&&!n&&this.ke){var r;if(("metadata"===this.at||"none"===this.at&&!this.paused)&&!this.ye)return void this.ke.then((function(){var n=i.paused;i.setVideoSrc(t,n,!1)})).catch(console.error);if("sd-fallback"===(null==(r=this.nt.drmHandler)?void 0:r.state))return void this.ke.then((function(){i.setVideoSrc(t,!0,!1)})).catch(console.error);if("auto"===this.at)return void this.ke.then((function(){i.setVideoSrc(t,!1,!1)})).catch(console.error)}n&&this.reset(),n||!this.paused||this.sorcerer||(n=!0);var o=this.ze;n&&(o=this.qt);var u=t.split("/");u.pop();var a="".concat(u.join("/"),"/");this.Ce=!n,this.ke=this.Ge(t,this.at).then(this.loadManifest.bind(this)).then((function(t){return"string"==typeof i.Ee&&-1!==i.Ee.indexOf("live-archive")||(i.Ee=a),t})).then(o.bind(this)),n&&"auto"===this.at&&(this.ke=this.Ye(this.ke,this.preloadStream.bind(this),!1)),this.ke=this.Ke(this.ke)},i.getBitrateAtTime=function(t,n){if(!this.sorcerer)return 0;var i=this.sorcerer.streamIndexAtTime(t,n);return this.pn[n][i]?this.pn[n][i].bitrate:0},i.lockStreamIndexes=function(){var t=this,n=this.je.map((function(n){return t.pn.video.indexOf(t.pn.video[n])})),i=!this.paused;if(i&&(this.Je=!0,this.$.pause()),this.Ne.video=!1,this.Be.lock(n),this._e||"auto"===this.at){var e=Math.max(this.currentTime-7,0),r=Math.min(this.currentTime+7,this.$.duration);this.sorcerer.removeBuffer(e,r).then((function(){!t._e&&"auto"===t.at||t.ended?t.$e():(t.seekToTime(t.currentTime),i&&t.paused&&(t.Xe=!0,t.$.play()))})).catch(console.error)}},i.seekToTime=function(t){var n=this;if(t===this.currentTime)return r.resolve();var i=null===this.Se;if(i||(this.Ze&&(this.Ze(),this.Ze=null),this.Qe=null,this.Se=null,this.Ae=null),this.Se=t,this.tr(),this.ye)for(var e in this.pn)if(this.pn[e].length>0){var o=this.sorcerer[e].activeStreamIndex;this.sorcerer[e].streams[o].abort()}return this.Qe=this.nr(t),r.all([this.ke,this.Le]).then((function(){n.$e()})).catch(console.error),this.ir&&0===t&&this.fire(Ti.SEEKING),i||this.play().catch(this.ft.bind(this)),this.ke.then((function(){return n.Qe})).catch((function(t){}))},i.takeSnapshot=function(){},i.initDrm=function(){},i.onstalled=function(){return!1},i.onseeked=function(t){this._e&&this.He()},i.onended=function(n){return t.prototype.onended.call(this,n),!0},i.onseeking=function(t){this._e},i.tr=function(){var t=this;this.er(),clearTimeout(this.rr),this.rr=setTimeout((function(){t.or()}),200)},i.er=function(){this.ur||(this.ur=!0,we(this.Be)&&(this.Be.scrubInProgress=!0))},i.or=function(){if(this.ur=!1,we(this.Be)){this.Be.scrubInProgress=!1;var t=this.sorcerer.video.activeStreamIndex;this.Be.handleScrubEnd(t),this.$e()}},i.ontimeupdate=function(n){if(!this.sorcerer)return!1;if(t.prototype.ontimeupdate.call(this),this.ge&&this.ge.stop(),0===this.currentTime)return this._e;if(this.Se)return!1;this._e||(this._e=!0),this.Re&&this.currentTime>=this.Re&&(this.sorcerer.removeBuffer(0,this.Re-2),this.Re=!1);var i=this.sorcerer.getDroppedFrameTotal();this.fire(xi.DROPPED_FRAMES,i);var e=this.sorcerer.getResponseSpeeds(),r=this.pn.video[this.sorcerer.video.activeStreamIndex],o=this.tt.tests&&this.tt.tests.download_bitrate;if((!o||!o.group)&&r&&this.Be.getCurrentSpeed){var u={speed:this.Be.getCurrentSpeed(),bitrate:r.bitrate,speeds:e};this.fire(xi.BANDWIDTH,u)}var a=this.$.buffered.length;if(!a)return!0;var s=this.$.buffered.end(a-1);return Math.ceil(s)===Math.ceil(this.$.duration)||(Math.abs(this.currentTime-s)<.2?(this.De||(this.fire(xi.STREAM_BUFFER_START,{hasLowerStreamIndex:this.sorcerer.video.activeStreamIndex>0}),this.De=!0),!1):void 0)},i.ar=function(){return!!this.ended||Math.ceil(this.currentTime)===Math.ceil(this.$.duration)},i.sr=function(){return!!this.sorcerer&&!this.ar()&&(null!==this.Ue?(this.cr(),!0):0!==this.currentTime||this.ye?(this.$e(),!0):this._e)},i.onprogress=function(){this.Be.canPlayFromTimeInStream(this.currentTime,this.fe())&&this.De&&(this.fire(xi.STREAM_BUFFER_END),this.De=!1)},i.onwaiting=function(){return!this.ge||!this.ge.start()},i.onerror=function(){return!!this.$.error&&(this.$.error.code===this.$.error.MEDIA_ERR_DECODE?(this.fire(xi.SCANNER_ERROR,{reason:"encountered media decode error"}),!1):t.prototype.onerror.call(this))},i.pause=function(){t.prototype.pause.call(this)},i.play=function(){var n=this;return this.He(),t.prototype.play.call(this,(function(){return n.xe&&n.xe(),n.Ce||n.ye||"auto"===n.at||(n.ke=n.Ye(n.ke,n.preloadStream.bind(n))),n.ke.then((function(){return r.resolve(n.Qe)}))}))},i.onpause=function(){return this.Je?(this.Je=!1,!1):(t.prototype.onpause.call(this),!0)},i.onplay=function(){return!this.Xe||(this.Xe=!1,!1)},i.Ye=function(t,n){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],e=t.then(n);return i&&(e=this.Ke(e)),e},i.Ke=function(t){var n=this;return t.catch((function(t){return n.fire(xi.FILE_ERROR,{reason:t}),new r((function(t,n){}))}))},i.lr=function(){this.ye&&this.pn.video[this.sorcerer.video.activeStreamIndex].bitrate/1e3>12e3&&(this.Le=this.sorcerer.removeBuffer())},i.Ge=function(t,n){var i=this;return new r((function(e,r){"none"!==n||i.Ce&&!i.paused?e(t):i.xe=function(){e(t),i.xe=null}}))},i.nr=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.Se;return new r((function(i,e){var r=t._e&&0===n,o=t.Be.canPlayFromTimeInStream(n,t.fe());r||o?i(n):(t.lr(),t.Ae=i)})).then((function(n){t.Se=null,t.Qe=null;var i=new r((function(n,i){t.Ze=i,t.$.addEventListener("seeked",(function i(){n(t.$.currentTime),t.$.removeEventListener("seeked",i)}))}));return t.$.currentTime=n,i}))},i.hr=function(t,n){"auto"!==t&&"auto"===n&&(this.ke=this.Ye(this.ke,this.preloadStream.bind(this))),t!==n&&"none"!==n&&this.xe&&this.xe()},i.dr=function(t){var n=t.audio.reduce((function(t,n){return t+n.duration}),0),i=t.video.reduce((function(t,n){return t+n.duration}),0),e=n/t.audio.length,r=i/t.video.length;return e+40)return n.fire(xi.AV_DURATION_MISMATCH,r),n.fire(xi.SCANNER_ERROR,{reason:"Encountered A/V duration mismatch"}),void e();var o=t.audio.filter((function(t){return"opus"===t.codecs})),u=t.audio.filter((function(t){return"opus"!==t.codecs})),a=Yi.browser.safari||Yi.iOS||Yi.iPadOS||!MediaSource.isTypeSupported('audio/mp4; codecs="opus"')||!o.length?u:o;n.pn.audio=n.mr(a)}for(var s=0;s0&&(n.Be.audioStreams=n.pn.audio),n.br(n.pn.video,n.pn.audio,n.Rt.key_info),n.pr(t)||n.resetBrain(!0),n.fire(xi.STREAMS_LOADED,n.pn),i()}))},i.wr=function(t,n){this.sorcerer&&this.sorcerer.destroy(),this.sorcerer=new xr(t,n),this.$.src=URL.createObjectURL(this.sorcerer.mediaSource),this.successfulSegments=this.sorcerer.getSuccessfulSegments(),this.failedSegments=this.sorcerer.getFailedSegments(),this.He()},i.He=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.gr(500),clearTimeout(this.Ve),this.Ve=setTimeout((function(){t.gr(5e3)}),6e4),n&&this.sr()},i.gr=function(t){var n=this;clearInterval(this.Fe),this.Fe=setInterval((function(){n.sr()}),t)},i.We=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t?1/0:0;for(var i in this.pn)this.pn[i].length&&(n=Math[t?"min":"max"](n,this.pn[i][0].duration));return n},i.qt=function(t){var n=this;return this.ze(t).then((function(){var i=n.video&&n.video.metadata.percentShown?n.video.metadata.percentShown:null,e=n.Be.filterStreams(n.pn.video,n.$.clientWidth,n.$.clientHeight,i).length-1,r=n.pn.video[0];n.je.length&&(r=n.pn.video[n.je[0]]),void 0!==n.me&&e<=n.pn.video.indexOf(t.video[n.me])&&(r=n.pn.video[e]),n.wr(n.$,{duration:n.We(),fetcherTimeout:8e3,fetcherRetryAbortErrors:!1}),n.sorcerer.on("srcnotsupported",(function(){n.fire(xi.SCANNER_ERROR,{reason:"this codec is not supported for mediasource playback"})}));var o=n.pn.video.indexOf(r),u=function(t){n.pn[t].forEach((function(i,e){var r=n.yr(e,"init",t);n._r(e,t)&&n.pn[t][e].init_segment_range&&(r={url:r,byteRange:n.kr(e,"init",t)}),n.sorcerer.addStream("".concat(i.mime_type,'; codecs="').concat(n.pn[t][e].codecs,'"'),r)}))};for(var a in n.pn)u(a);n.sorcerer.video.switchTo(o),n.sorcerer.on("queued",n.Er.bind(n)),n.sorcerer.on("downloadabort",n.Tr.bind(n)),n.sorcerer.on("appendbufferend",n.Gi.bind(n)),n.sorcerer.on("downloadstart",n.Wi.bind(n)),n.sorcerer.on("downloadend",n.zi.bind(n)),n.sorcerer.on("downloaderror",n.Sr.bind(n)),n.sorcerer.on("downloadtimeout",n.Yi.bind(n)),n.sorcerer.on("quotaexceedederror",n.Ar.bind(n)),n.sorcerer.video.on("streamchange",n.xr.bind(n)),n.sorcerer.video.on("streamchangestart",n.Cr.bind(n)),n.sorcerer.mediaSource.addEventListener("sourceended",(function(){n.fire(Ti.PROGRESS)}))}))},i.mr=function(t){var n=t.slice(0);return n.sort((function(t,n){var i=t.width*t.height*t.bitrate,e=n.width*n.height*n.bitrate;return t.width===n.width&&t.height===n.height?t.framerate-n.framerate:i-e})),n},i._r=function(t,n){return!!this.pn[n][t].segments[0].range},i.kr=function(t,n,i){return"init"===n?this.pn[i][t].init_segment_range:this.pn[i][t].segments[n].range},i.Mr=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"video",e="init"===n;if(e)return 0;var r=this.pn[i][t].segments[n].start;return r},i.yr=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"video",e="init"===n;if(e&&!this.pn[i][t].init_segment_range&&-1===this.pn[i][t].init_segment.indexOf(".")){var r=this.pn[i][t].init_segment;return he(r)}var o=this.Ee,u=this.Rt.base_url&&-1!==this.Rt.base_url.indexOf("//");return u&&(o=this.Rt.base_url),this.Rt.base_url&&!u&&(o+=this.Rt.base_url),this.pn[i][t].base_url&&(o+=this.pn[i][t].base_url),this._r(t,i)?o:"init"===n?o+=this.pn[i][t].init_segment:(this.pn[i][t].segments[n].url&&(o+=this.pn[i][t].segments[n].url),o)},i.Ir=function(t,n,i){return"".concat(t,":").concat(n,":").concat(i)},i.Rr=function(t,n,i){return n===this.pn[i][t].segments.length-1},i.Or=function(t,n){var i=[],e=this.we[t];if(!e)return i;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"video";return this.fe(0,t)},i.fe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"video";return void 0!==this.sorcerer&&(t=this.sorcerer[n].activeStreamIndex),this.pn[n][t]},i.qe=function(t,n){var i=this,e=this.pn.video,o=this.video&&this.video.metadata.percentShown?this.video.metadata.percentShown:null;if(0===(e=this.Be.filterStreams(e,this.$.clientWidth,this.$.clientHeight,o)).length)return r.resolve(!1);if(this.Ne.video&&!we(this.Be))return r.resolve(!1);var u=e[e.length-1];if(u.id!==this.Te){this.Te=u.id;var a={index:this.pn.video.indexOf(u),streams:this.pn.video};this.fire(xi.STREAM_TARGET_CHANGE,a)}var s=this.fe();return this.Be.shouldPowerUp(e,s,t).then((function(t){return!1===t?i.Be.shouldPowerDown(e,s).then((function(t){return!1===t?t:i.pn.video.indexOf(e[t])})):i.pn.video.indexOf(e[t])}))},i.Lr=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"video";this.qe(!1,n).then((function(i){"audio"===n&&(!1===i&&(i=t.sorcerer.video.activeStreamIndex),i=t.Be.getAudioIndexFromVideo(t.pn.video,t.pn.audio,i),t.sorcerer.audio.activeStreamIndex===i&&(i=!1));var e=!1;!1!==i&&(e=i>t.sorcerer[n].activeStreamIndex,t.Ne[n]=!0,t.sorcerer[n].switchTo(i).then((function(){t.Ne[n]=!1})).catch(console.error));for(var r=e,o=t.Be.getSegmentsToLoad(r,n,t.fe()),u=t.sorcerer[n].activeStreamIndex,a=function(i){var e=t.yr(u,o[i],n),r=t.Or(o[i],n);if(r.length>1)return"continue";if(1===r.length&&u<=r[0])return"continue";var a=t.Rr(u,o[i],n),s={stream:u,segment:o[i],type:n},c=t.sorcerer[n].streams[u],l=e;t._r(u,n)&&(l={url:l,byteRange:t.kr(u,o[i],n)});var f=t.Mr(u,o[i],n),h="video"===n,d=null;0===u&&"video"===n&&(d=16e3);var v=null;try{v=t.pn[n][u].segments[o[i]].size}catch(t){}c.addSegment(l,{identifier:s,isFinalSegment:a,priority:f,includeWithBandwidthChecks:h,timeout:d,size:v}).catch((function(t){if(!(t instanceof pr||t instanceof je||t instanceof Ue))throw t}))},s=0;s0&&(i=e[0]);var r=t.Ue;"audio"===n&&(r=t.Be.getAudioIndexFromVideo(t.pn.video,t.pn.audio,t.Ue));var o=t.Ir(r,i,n);if(t.be.has(o))return"continue";var u=t.yr(r,i,n),a=t.Rr(r,i,n),s=t.sorcerer[n].streams[r],c={stream:r,segment:i,type:n},l=u;t._r(r,n)&&(l={url:l,byteRange:t.kr(r,i,n)}),s.addSegment(l,{identifier:c,isFinalSegment:a,loadOnly:!0,priority:0}).catch((function(t){if(!(t instanceof pr||t instanceof je||t instanceof Ue))throw t}))};for(var i in this.pn)n(i)},i.$e=function(){var t=this;return this.ke&&this.ke.then((function(){for(var n in t.pn)t.pn[n].length>0&&t.Lr(n)}))},i.Er=function(t){this.be.add(this.Ir(t.stream,t.segment,t.type)),this.we[t.segment]||(this.we[t.segment]=[]),-1===this.we[t.segment].indexOf(t.stream)&&this.we[t.segment].push(t.stream)},i.Dr=function(t){var n=this;(this.we[t.segment]||[]).forEach((function(i){n.be.delete(n.Ir(i,t.segment,t.type))}))},i.Tr=function(t){this.we[t.segment]&&this.Dr(t)},i.Gi=function(t){this.fire(xi.APPEND_BUFFER_END,{identifier:t}),this.He(),this.Ie&&t.stream===this.Me&&(this.Ie=!1,this.Re=this.pn.video[t.stream].segments[t.segment].start),this.we[t.segment]&&this.Dr(t);var n=this.Be.canPlayFromTimeInStream(this.Se,this.fe());null!==this.Se&&this.Ae&&n&&(this.Ae(this.Se),this.Ae=null),this.ge&&this.ge.onSegmentAppended()},i.Wi=function(t){this.fire(xi.DOWNLOAD_START,{identifier:t})},i.zi=function(t,n){this.fire(xi.DOWNLOAD_END,{identifier:t,data:n})},i.Sr=function(t,n){this.Dr(t);var i=xi.DOWNLOAD_ERROR;410===n&&(i=xi.MEDIA_URL_EXPIRED),this.fire(i,{identifier:t,status:n})},i.Yi=function(t,n){this.fire(xi.DOWNLOAD_TIMEOUT,{identifier:t,data:n}),this.we[t.segment]&&this.Dr(t),"video"===t.type?this.Ne.video=!1:"audio"===t.type&&(this.Ne.audio=!1)},i.Ar=function(t){this.fire(xi.QUOTA_EXCEEDED_ERROR,{buffered:t})},i.Cr=function(t,n){var i={previousStreamIndex:this.Rt.video.indexOf(this.pn.video[t]),index:this.Rt.video.indexOf(this.pn.video[n]),streams:this.Rt.video};this.fire(xi.STREAM_CHANGE_START,i)},i.xr=function(t){t>this.Me&&this.currentTime>0&&(this.Ie=!0),this.Me=t;var n={index:this.Rt.video.indexOf(this.pn.video[t]),streams:this.Rt.video};this.fire(xi.STREAM_CHANGE,n)},i.br=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.nt.drmHandler;if(r){var o={audio:i.map((function(t){return"".concat(t.mime_type,';codecs="').concat(t.codecs,'"')})),video:n.map((function(t){return"".concat(t.mime_type,';codecs="').concat(t.codecs,'"')}))};r.init(this,o,e),r.setFallbackCallback((function(){return t.pause()}))}},H(n,[{key:"preload",get:function(){return this.at},set:function(t){this.hr(this.at,t),this.at=t}},{key:"videoElement",get:function(){return this.$}},{key:"videoWidth",get:function(){var t=this.fe();return t?t.width:this.$.videoWidth}},{key:"videoHeight",get:function(){var t=this.fe();return t?t.height:this.$.videoHeight}},{key:"restrictedStreamIndexes",get:function(){return this.je},set:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.je.join(",")!==n.join(",")&&(this.je=n,this.ke.then((function(){return t.lockStreamIndexes()})).catch(console.error))}},{key:"currentTime",get:function(){return null!==this.Se?this.Se:this.$.currentTime},set:function(t){(this._e||0!==t)&&this.seekToTime(t)}},{key:"downloadSpeed",get:function(){return this.Pe}},{key:"brainDebug",get:function(){var t=this.sorcerer&&this.Be&&this.Be.getCurrentSpeed?this.Be.getCurrentSpeed():null,n=this.sorcerer&&this.sorcerer.getResponseSpeeds?this.sorcerer.getResponseSpeeds():null;return{currentSpeed:t,responseSpeeds:n=n?n.slice(-20):[]}}},{key:"isLowerProfileAvailable",get:function(){return this.sorcerer?this.sorcerer.video.activeStreamIndex>0:null}}]),n}(Me),Lr=function(){function t(t){this.jr=t,this.Nr=0,this.Pr=setInterval(this.Ur.bind(this),500)}var n=t.prototype;return n.destroy=function(){clearInterval(this.Pr)},n.Ur=function(){var t=this.jr.videoElement,n=this.jr.getCurrentStream();if(t&&n){this.Nr=t.currentTime;var i=this.Fr();if(null!==i)if(this.Vr=i,this.jr.lowLatencyMode){if(!Yi.browser.ie&&!Yi.browser.safari){var e=this.jr.presentationDelay;if(null!==e){var r=i-e;if(r.05&&this.Br()>1){var o=Math.round(2/(1+Math.exp(-.75*r-this.edgeStalled))*20)/20;t.playbackRate=Math.min(1.02,Math.max(.98,o))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}else t.playbackRate=1}},n.Hr=function(){var t=this.jr.getCurrentStream();if(!t)return null;var n=t.segments[0],i=this.jr.videoElement.buffered.length&&(null==n?void 0:n.start);return n&&t.hasProgramDateTime&&i?i+(Date.now()-n.programDateTime)/1e3:t.edge},n.Fr=function(){var t=this.Hr();return null===t||0===this.Nr?null:t-this.Nr},n.Br=function(){var t=this.jr.videoElement,n=this.jr.getCurrentStream();if(!t||!n)return 0;var i=t.buffered.length;return i?t.buffered.end(i-1):n.edge-this.Nr},H(t,[{key:"latency",get:function(){return this.Vr}},{key:"liveSyncPosition",get:function(){var t=this.Hr(),n=this.jr.presentationDelay,i=this.jr.getCurrentStream();return null===t||null===n||null===i?0:Math.min(i.edge,t-n-this.edgeStalled)}},{key:"edgeStalled",get:function(){var t=this.jr.getCurrentStream();if(!t)return 0;var n=3*(this.jr.lowLatencyMode&&t.partTargetDuration||t.targetDuration);return Math.max(t.age-n,0)}}]),t}(),Dr=[1,2,5],jr=function(t){function n(n){var i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(i=t.call(this,n,e)||this).qr=.4,i.Wr=.6,i.consecutiveStreamIndex={},i.isNewPlayback=!0,i}G(n,t),H(n,[{key:"displayName",get:function(){return"Live"}}]);var i=n.prototype;return i.optimalStreamIndex=function(t,n){var i;if(this.isNewPlayback&&(null==(i=this.scanner.sorcerer)?void 0:i.getResponseSpeeds().length)>=2&&(this.isNewPlayback=!1),1===t.length)return 0;if(this.isNewPlayback){for(var e=0,r=0,o=this.scanner.videoElement.clientHeight,u=[],a=0;ar&&(e=a,r=t[a].height)}return Math.max(0,e-1)}for(var c=this.getCurrentSpeed(),l=n,f=n,h=0;ht[h].bandwidth&&(l=h),c*this.Wr>t[h].bandwidth&&(f=h);var d=n2&&d!==n?d:n:0},i.getCurrentSpeed=function(){var t;return null==(t=this.scanner.sorcerer)?void 0:t.getCurrentSpeed({type:"average",howMany:5,weights:Dr})},i.zr=function(t){for(var n in this.consecutiveStreamIndex[t]||(this.consecutiveStreamIndex[t]=0),this.consecutiveStreamIndex)this.consecutiveStreamIndex.hasOwnProperty(n)&&parseInt(n,10)!==t&&(this.consecutiveStreamIndex[n]=0)},i.getAvailabilityStart=function(t){return this.Gr(t.edge)},i.getAvailabilityEnd=function(t){return this.Yr(t.edge)},i.getSegmentsToLoad=function(t,n,i){var e,r,o,u=this,a=this.scanner,s=a.currentTime,c=a.sorcerer,l=a.bufferTarget,f=null==(e=c[n])||null==(r=e.sourceBuffer)?void 0:r.buffered,h=(null==f?void 0:f.length)?f.start(f.length-1):0,d=mt(Math.max(s,h),f);if(!t&&d>=l)return[];var v=this.Gr(i.edge),p=this.Yr(i.edge),m=this.scanner.lowLatencyMode&&(null==(o=i.parts)?void 0:o.length),b=(m?i.parts:i.segments).filter((function(n){return!!n.uri&&(t||!u.scanner.isSegmentAdded(n))&&!(n.endp)}));return m&&b.forEach((function(t,n){for(;t=t.dependentOn;)b.includes(t)||u.scanner.isStreamSegmentAdded(t)||b.splice(n,0,t)})),c[n].activeStreamIndex,b},i.Gr=function(t){var n=t-this.Kr();return Math.max(0,n)},i.Yr=function(t){var n=this.Kr(),i=this.scanner.bufferTarget,e=t-Math.max(0,n-i);return Math.max(0,e)},i.Kr=function(){return this.scanner.presentationDelay||this.scanner.manifest.presentationDelay},n}(Mr),Nr=["disabled","hidden","showing"],Pr=["subtitles","captions","descriptions","chapters","metadata"],Ur=["ar","fa","he","iw","ku","ps","sd","ur","yi"],Fr=new N,Vr=new N,TelecineTextTrack=function(){function TelecineTextTrack(t,n){var i=t.kind,e=t.src,r=void 0===e?null:e,o=t.label,u=void 0===o?"":o,a=t.language,s=void 0===a?"":a,c=t.id,l=void 0===c?le():c;if(-1===Pr.indexOf(i))throw _e(12,"SYNTAX_ERR","Syntax Error");rt(this),Object.defineProperties(this,{kind:{value:i,enumerable:!0},label:{value:u,enumerable:!0},language:{value:s,enumerable:!0},id:{value:"".concat(l),enumerable:!0},rtl:{value:-1!==Ur.indexOf(s.substr(0,2)),enumerable:!0}}),this.video=n,this.src=r,this.dt=!1,Fr.set(this,"disabled")}return TelecineTextTrack.prototype.dispatchEvent=function(t){this.fire(t,{target:this})},H(TelecineTextTrack,[{key:"mode",get:function(){return Fr.get(this)},set:function(t){if(Nr.indexOf(t)>-1){if(this.dt=!0,Fr.get(this)===t)return;Fr.set(this,t),this.video.currentScanner&&this.video.currentScanner.setModeForTrack(this,t),this.dispatchEvent("modechange")}}},{key:"src",get:function(){return Vr.get(this)},set:function(t){Vr.set(this,t),this.video.fire(xi.TEXT_SRC_UPDATE,this)}},{key:"cues",get:function(){return this.video.currentScanner?this.video.currentScanner.getCuesForTrack(this):[]}},{key:"activeCues",get:function(){return this.video.currentScanner?this.video.currentScanner.getActiveCuesForTrack(this):[]}}]),TelecineTextTrack}();function Br(t){var n=/^(?:(\d{2,}):)?(\d{2}):(\d{2})[,.](\d{3})$/.exec(t);if(!n)return-1;var i=parseInt(n[4],10)/1e3;return i+=parseInt(n[3],10),n[2]&&(i+=60*parseInt(n[2],10)),n[1]&&(i+=60*parseInt(n[1],10)*60),i}function Hr(t,n,i){return i?n?n(t):t:(t&&t.then||(t=r.resolve(t)),n?t.then(n):t)}function qr(t,n){try{var i=t()}catch(t){return n(t)}return i&&i.then?i.then(void 0,n):i}function Wr(t,n){return t&&t.then?t.then(n):n(t)}var zr=Yi.browser.ie||Yi.browser.edge?.5:.2;function Gr(){}function Yr(t){return function(){for(var n=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:{};(r=t.call(this,n,o)||this).Jr=!1,r.$r=!1,r.Xr=2e3,r.Zr=1e4,r.reset();var u=o.lowLatencyMode?5:12;return r.bufferTarget=o.bufferTarget||u,r.presentationDelay=o.presentationDelay||u,r.lowLatencyMode=o.lowLatencyMode,r.Qr=null==(i=r.tt.tests)||null==(e=i.llhls_timeout)?void 0:e.group,window.addEventListener("online",(function(){r.play()})),r}G(n,t),H(n,null,[{key:"displayName",get:function(){return"HLSLiveScanner"}},{key:"supported",get:function(){return"undefined"!=typeof MediaSource&&MediaSource.isTypeSupported}},{key:"supportedVideoTypes",get:function(){return["application/x-mpegURL"]}},{key:"supportsPlaybackRate",get:function(){return!1}}]);var i=n.prototype;return i.deactivate=function(){t.prototype.deactivate.call(this),this.reset()},i.reset=function(){var t,n,i;null==(t=this.sn)||t.destroy(),null==(n=this.to)||n.stop(),null==(i=this.no)||i.destroy(),this.io=new vt,this.sn=null,this.pn={},this.pn.video=[],this.pn.audio=[],this.Me=0,this.eo=!1,this.ro=!1,this.oo=0,this.uo=Number.NEGATIVE_INFINITY,this.ao=-1,this.so=new jr(this,this.tt),this.no=new Lr(this),this.je=[],this.Ne={},this.co={},this.lo={}},i.endLive=function(){var n;this.eo=!1,null==(n=this.to)||n.stop(),this.sn&&(this.sn.abortFetches(),this.sn.endOfStream()),this.ro=!0,t.prototype.deactivate.call(this),this.fire(Ti.ENDED)},i.fo=function(){this.eo||(this.eo=!0,this.fire(Ci.STREAM_ONLINE))},i.ho=function(){this.eo&&(this.eo=!1,this.fire(Ci.STREAM_OFFLINE))},i.do=function(t){t?this.fo():this.ho()},i.vo=function(t){try{var n=this;if(n.ro)return;n.to&&(n.to.stop(),n.to.off());var i=[ht("module/media-manifest.js")];return n.video.metadata.p2pReady&&i.push(n.video.metadata.p2pReady),Hr(r.allSettled(i),(function(i){var e=Q(i,1)[0].value,r=e.M3U8Loader,o=e.PLAYLIST_UPDATE,u=e.PLAYLIST_ERROR,a=e.convertTsCodecs;return n.to=new r,n.to.lowLatencyMode=n.lowLatencyMode,n.to.on(o,n.po.bind(n)),n.to.on(u,(function(t){n.ho()})),Wr(qr((function(){var i=n.video.metadata.playlistRefreshUrl;return Hr(n.to.start(t,i),(function(t){n.Rt=t,n.fo()}))}),(function(t){throw n.ho(),n.endLive(),t})),(function(t){n.pn.video=function(t){return t.filter((function(n){return n.codecs.split(".")[0]===t[0].codecs.split(".")[0]}))}(function(t){var n=t.slice(0);return n.sort((function(t,n){var i=t.width*t.height*t.bitrate,e=n.width*n.height*n.bitrate;return t.width===n.width&&t.height===n.height?t.framerate-n.framerate:i-e})),n}(n.Rt.video)),n.pn.audio=function(t){return t.filter((function(t,n,i){return i.indexOf(t)===n}))}(function(t,n){return t.reduce((function(t,n,i,e){return t.concat(function(t){return t.audio}(n))}),[])}(n.pn.video));var i=n.qe("video",!0),e=n.pn.video[i];return Hr(n.to.switchTo(n.Rt.video.indexOf(e)),(function(){var t,e;null==(t=n.sn)||t.destroy(),n.sn=new xr(n.$,{fetcherRetryAbortErrors:!1,fetcherTimeout:8e3}),n.pn.video.forEach((function(t){n.sn.addStream(a(pe(n.Rt.activeVideo.mimeType,t.codecs)),t.initSegment)})),n.pn.audio.forEach((function(t){n.sn.addStream(a(pe(n.Rt.activeAudio.mimeType,t.codecs)),t.initSegment)})),n.fire(xi.STREAMS_LOADED,n.pn),n.manifest.captions&&n.manifest.captions.length>0&&(n.manifest.captions.forEach(n.mo.bind(n)),n.fire(xi.TEXT_TRACKS_AVAILABLE)),n.bo(),n.sn.video.switchTo(i,!1),n.pn.audio.length&&(null==(e=n.sn.audio)||e.switchTo(n.qe("audio",!0),!1))}))}))}))}catch(t){return r.reject(t)}},i.wo=function(){try{var t=this;return function(t){if(t&&t.then)return t.then(Gr)}(qr((function(){return Hr(t.to.update(),(function(){t.fo()}))}),(function(){t.ho()})))}catch(t){return r.reject(t)}},i.yo=function(t){var n;null==(n=this.sn)||n.destroy(),this.sn=new xr(t,{fetcherRetryAbortErrors:!1,fetcherTimeout:8e3})},i.bo=function(){this.sn.video.on("streamchange",this.xr.bind(this)),this.sn.video.on("streamchangestart",this.Cr.bind(this)),this.sn.on("downloadend",this.zi.bind(this)),this.sn.on("downloadtimeout",this.Yi.bind(this)),this.sn.on("downloadabort",this._o.bind(this)),this.sn.on("appendbufferend",this.ko.bind(this))},i.zi=function(t,n){if(!t||!t.isInitSegmentRequest){var i=this.fe();n.extraContext={liveAvail:{start:this.so.getAvailabilityStart(i),end:this.so.getAvailabilityEnd(i)}},this.fire(xi.DOWNLOAD_END,{identifier:t,data:n})}},i.Yi=function(t,n){t&&t.isInitSegmentRequest||(this.Ir(t),this.Eo(t),this.Ne[t.type]=!1,this.fire(xi.DOWNLOAD_TIMEOUT,{identifier:t,data:n}))},i._o=function(t){t&&t.isInitSegmentRequest||(this.Ir(t),this.Eo(t))},i.Cr=function(t,n){var i={previousStreamIndex:this.pn.video.indexOf(this.pn.video[t]),index:this.pn.video.indexOf(this.pn.video[n]),streams:this.pn.video};this.fire(xi.STREAM_CHANGE_START,i)},i.xr=function(t){this.fire(xi.STREAM_CHANGE,{index:t,streams:this.pn.video})},i.ko=function(t){var n=t.type,i=t.stream,e=this.sorcerer[n].sourceBuffer.buffered,r=this.To(t);r&&e.length&&(this.pn[n][i].playlist.timeOffset=e.end(e.length-1)-(r.end-r.timeOffset))},i.Ir=function(t){var n=t.type,i=t.segment,e=t.part;return"".concat(n,"_").concat(i,"_").concat(e)},i.To=function(t){var n=t.type,i=t.stream,e=t.segment,r=t.part,o=this.pn[n][i].getSegmentBySN(e);return(null==o?void 0:o.getPart(r))||o},i.Eo=function(t){if(t.part>0){var n=z(z({},t),{},{part:t.part-1});this.Eo(n)}var i=this.Ir(t);delete this.co[i]},i.isSegmentAdded=function(t){return!!this.co[this.Ir(t)]},i.isStreamSegmentAdded=function(t){var n=this.Ir(t),i=this.sn[t.type].activeStreamIndex;return!!this.co[n]&&this.co[n].stream===i},i.po=function(t,n){try{var i,e=t.type;return this.fire(xi.STREAM_UPDATED,t),"subtitles"===e?void(this.$r&&(null==(i=this.manifest.captions)?void 0:i.length)>0&&this.So()):(n||this.Lr(e),this.do(this.Ao(e)||!this.xo()),this.Co(),(this.lowLatencyMode||this.video.metadata.p2pReady)&&this.Mo(),Hr())}catch(t){return r.reject(t)}},i.mo=function(t,n){var i=t.label,e=t.language;if(!this.Io){var r=new TelecineTextTrack({label:i,id:n,kind:"captions",language:e},this.nt);this.nt.textTracks=ae([r]),this.Io=this.addTextTrack(r)}},i.So=function(){try{var t=this;return Hr(t.io,(function(){t.manifest.captions&&t.manifest.captions[0].segments.forEach(Yr((function(n){var i="".concat(n.type,"_").concat(n.mediaSequenceNumber);if(!t.lo[i])return t.lo[i]=!0,Hr(tr(n.url).text(),(function(n){var i=function(t){var n=0,i=t.split(/(?:(?:\r\n|\n){2,})/),e=[],r=null;do{0===n&&/^\uFEFF?WEBVTT(?: .*)?/.test(i[n])&&n++,(r=/^(?:(.*)(?:\r\n|\n))?([\d:,.]+) --> ([\d:,.]+)(.*)?(?:\r\n|\n)([\s\S]*)/.exec(i[n]))&&e.push({startTime:Br(r[2]),endTime:Br(r[3]),text:r[5]}),n++}while(n0&&t.Lr(n)}))}catch(t){return r.reject(t)}},i.Lr=function(t){try{var n=this;return Hr(n.io,(function(){var i,e=n.qe(t);return Kr((function(){if(e>=0&&e!==n.sorcerer[t].activeStreamIndex){if(i=e>n.sorcerer[t].activeStreamIndex,n.Ne[t]=!0,"video"===t){var r=n.pn.video[e],o=n.Rt.video.indexOf(r);n.Ro=n.to.switchTo(o)}return Hr(n.Ro,(function(){n.sorcerer[t].switchTo(e).then((function(){n.Ne[t]=!1})).catch(console.error)}))}}),(function(){return Hr(ct(0),(function(){var e=n.lowLatencyMode&&void 0!==i,r=n.sn[t].activeStreamIndex,o=n.fe(t,r),u=n.so.getSegmentsToLoad(e,t,o),a=n.Oo();u.forEach((function(i){var e=n.Ir(i),u={type:t,stream:r,segment:i.segment,part:i.part},s="video"===t&&!i.hint,c=a;if(i.hint&&n.Jr&&i.start>n.currentTime){var l=1e3*(i.start-n.currentTime);c=Math.min(8e3,l+a)}var f=o.bitrate/8*i.duration;n.sorcerer[t].streams[r].addSegment(i.url,{identifier:u,includeWithBandwidthChecks:s,priority:i.programDateTime,excludeConnectTime:n.lowLatencyMode,timeout:n.Qr||n.lowLatencyMode?c:8e3,size:n.Qr||n.lowLatencyMode?f:void 0}).catch((function(t){t instanceof pr||t instanceof je||n.Eo(u)})),n.co[e]=u}))}))}))}))}catch(t){return r.reject(t)}},i.qe=function(t){var n,i,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.Ne[t])return-1;if("audio"===t)return this.pn.audio.indexOf(this.Rt.activeAudio);if(!e&&ce(this.oo)=0&&(e||s!==this.Me)){var c=s>this.Me;if(c&&ce(this.uo)0&&void 0!==arguments[0]?arguments[0]:"video";return this.fe(t)},i.fe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"video",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return void 0!==this.sn&&null!==this.sn&&(n=this.sn[t].activeStreamIndex),this.pn[t][n]},i.Mo=function(){if(this.$.currentTime===this.ao&&se()-this.Lo>=1e3&&this.Do()){var t="Jumping forward ".concat(.1,"s")+" because of stall at time of ".concat(this.$.currentTime);this.fire(Ci.STALL_JUMP,{msg:t}),this.$.currentTime+=.1}this.ao=this.$.currentTime,this.Lo=se()},i.Do=function(){return 0!==this.$.readyState&&!!this.$.buffered.length&&!this.$.paused&&this.jo(this.$.buffered,this.$.currentTime)},i.jo=function(t,n){for(var i=0;it.end(i)-.5))return!0;return!1},i.Co=function(){var t=this.buffered;if(t.length){var n,i=t.length,e=this.$.currentTime;try{n=function(t,n){if(!t||!t.length)return null;if(1===t.length&&t.end(0)-t.start(0)<1e-6)return null;for(var i,e=0;en&&(0===e||t.end(e-1)-n<=.5)){i=e;break}return i>=0?i:null}(t,e)}catch(t){throw DOMException,t}if(null!==n&&0!==this.$.readyState&&!(this.$.paused||i<=n)){var r,o;try{r=t.start(n),o=t.end(i-1)}catch(t){throw DOMException,t}var u=r-e,a=o-r,s=this.lowLatencyMode?1:2;if(a>0&&a<=this.segmentLength*s){var c="Preventing jump too close to buffered end time."+" Would have jumped to: ".concat(r,".")+" Last buffered end time ".concat(o,".");this.fire(Ci.BUFFER_GAP_JUMP_PREVENT,{msg:c})}else{if(0===n){var l="Jumping forward ".concat(u)+" seconds because of gap before start time of ".concat(r);this.fire(Ci.BUFFER_GAP_JUMP,{msg:l})}else{var f="Jumping forward ".concat(u," seconds because of gap starting at")+" ".concat(t.end(n-1)," and ending at ").concat(r);this.fire(Ci.BUFFER_GAP_JUMP,{msg:f})}this.$.currentTime=r+.1}}}},i.xo=function(){var t=this.buffered;return!!(t&&t.length&&this.$.currentTime+zr>t.end(t.length-1))},i.setVideoSrc=function(t){try{var n=this;return Hr(n.Ge(n.at),(function(){return Hr(n.vo(t),(function(){n.$.src=URL.createObjectURL(n.sn.mediaSource),n.io.resolve()}))}))}catch(t){return r.reject(t)}},i.Ge=function(t){try{return this.No=new vt,"none"===t&&this.paused||this.No.resolve(),this.No}catch(t){return r.reject(t)}},i.getBitrateAtTime=function(t,n){if(!this.sn)return 0;var i=this.sn.streamIndexAtTime(t,n);return this.pn[n][i]?this.pn[n][i].bandwidth:0},i.onprogress=function(){this.Co()},i.ondurationchange=function(){this.Co()},i.ontimeupdate=function(){if(this.sn){t.prototype.ontimeupdate.call(this),this.fire(xi.DROPPED_FRAMES,this.sn.getDroppedFrameTotal());var n=this.fe();if(n){var i={speed:this.so.getCurrentSpeed(),bitrate:n.bitrate,speeds:this.sn.getResponseSpeeds()};this.fire(xi.BANDWIDTH,i)}!this.eo&&this.xo()&&this.fire(Ci.STREAM_OFFLINE),!this.lowLatencyMode&&ce(this.oo)>this.Xr&&this.$e()}},i.seekToTime=function(){},i.onpause=function(){var t;null==(t=this.to)||t.stop(),this.sn&&(this.sn.abortFetches(),this.co={},this.sn.removeBuffer().catch((function(){})))},i.onplay=function(){this.Jr&&this.wo()},i.pause=function(){t.prototype.pause.call(this)},i.play=function(){var n=this;return t.prototype.play.call(this,Yr((function(){return n.No.resolve(),Kr((function(){if(n.Jr)return n.co={},Wr(qr((function(){return $r(n.sn.removeBuffer())}),(function(t){})),(function(){return $r(n.wo())}))}),(function(){return Hr(n.io,(function(){return n.$e(),Hr(n.Po(),(function(){var t=Math.max(n.no.liveSyncPosition,n.$.buffered.start(0));n.currentTime=t,n.Jr=!0}))}))}))})))},i.Po=function(){var t=this;return new r((function(n){var i=function i(){t.buffered.length&&(t.sn.off("appendbufferend",i),n())};t.sn.on("appendbufferend",i),i()}))},i.Oo=function(){return this.so.getSegmentRelativeTimeout(this.pn.video,this.fe("video"),1e3*this.segmentLength)},i.setCaptionsState=function(t){this.$r=t},H(n,[{key:"preload",get:function(){return this.at},set:function(t){this.at!==t&&"none"!==t&&this.No.resolve(),this.at=t}},{key:"latency",get:function(){var t;return null==(t=this.no)?void 0:t.latency}},{key:"lowLatencyMode",get:function(){return this._lowLatencyMode},set:function(t){this._lowLatencyMode=t,this.to&&(this.to.lowLatencyMode=t)}},{key:"downloadSpeed",get:function(){return this.so.getCurrentSpeed()}},{key:"restrictedStreamIndexes",get:function(){return this.je},set:function(t){this.je.join(",")!==t.join(",")&&(this.je=t,this.so.lock(this.je))}},{key:"videoWidth",get:function(){return this.Uo?this.Uo.width:this.$.videoWidth}},{key:"videoHeight",get:function(){return this.Uo?this.Uo.height:this.$.videoHeight}},{key:"currentTime",get:function(){return this.$.currentTime},set:function(t){this.$.readyState>0&&(this.$.currentTime=t)}},{key:"isLowerProfileAvailable",get:function(){return this.sn?this.sn.video.activeStreamIndex>0:null}},{key:"sorcerer",get:function(){return this.sn}},{key:"segmentLength",get:function(){return this.lowLatencyMode&&this.manifest.activeVideo.partTargetDuration||this.manifest.activeVideo.targetDuration}}]),n}(Me);function $r(t,n){if(!n)return t&&t.then?t.then(Gr):r.resolve()}var Xr=document.createElement("video"),Zr={"application/x-mpegURL":"application/x-mpegURL"},Qr=function(t){function n(n){var i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(i=t.call(this,n,e)||this).Fo=null,i.reset(),window.addEventListener("online",(function(){i.play()})),i}G(n,t),H(n,null,[{key:"displayName",get:function(){return"NativeHLSLiveScanner"}},{key:"supported",get:function(){return n.supportedVideoTypes.length>0}},{key:"supportedVideoTypes",get:function(){var t=[];if("function"!=typeof Xr.canPlayType)return t;for(var n in Zr){var i=Zr[n];Xr.canPlayType(i).replace(/^no$/,"")&&t.push(n)}return t}},{key:"supportsPlaybackRate",get:function(){return!1}}]);var i=n.prototype;return i.deactivate=function(){t.prototype.deactivate.call(this),this.reset()},i.reset=function(){this.Vo&&clearTimeout(this.Vo),this.ke=null,this.Vo=null,this.eo=!1,this.ro=!1,this.Bo=null,this.Ho=0,this.Vo=null,this.so=new jr(this,this.tt),this.je=[]},i.endLive=function(){var n=this;this.eo=!1,this.ro=!0,clearTimeout(this.Vo),this.$.pause(),setTimeout((function(){t.prototype.deactivate.call(n),n.fire(Ti.ENDED)}),0)},i.qo=function(){var t=this,n=gt(this.video.metadata.playlistRefreshUrl.split("?")[1]);n.expires&&(this.Vo=setTimeout((function(){t.Wo()}),1e3*(n.expires-10)))},i.Wo=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=this.video.metadata.playlistRefreshUrl;return tr(i).json().then((function(e){if(!("url"in e))throw new Error("Error parsing 'url' key from player live API refresh endpoint: ".concat(i," ").concat(e));return t.zo(e.url.hls).then((function(){return t.play(),t.Go(5e3),null})).catch((function(){return t.Wo(++n)}))})).catch((function(){if(n>=3)throw new Error("Manifest failed to load after ".concat(n," attempts."));return++n,t.Wo(n)}))},i.Yo=function(){var t=this;this.on(Ci.STREAM_OFFLINE,(function(){t.eo=!1}))},i.Ko=function(t){return this.Yo(),this.eo=!0,this.fire(Ci.STREAM_ONLINE),this.Go(5e3),r.resolve(t)},i.zo=function(t){var n=this;return this.Fo=t,/json=1/.test(t)?tr(t).json().then((function(t){if(!("url"in t))throw new Error("Error parsing 'url' key from Live API manifest endpoint: ".concat(n.Fo," ").concat(t));n.$.src=t.url,n.qo()})).catch((function(t){var i=n.video.metadata.playlistRefreshUrl;return tr(i).json().then((function(t){if(!("url"in t))throw new Error("Error parsing 'url' key from player live API refresh endpoint: ".concat(i," ").concat(t));n.Fo=t.url.ios,n.$.src=t.url.ios,n.qo()}))})):(this.$.src=t,this.qo(),r.resolve())},i.Go=function(t){var n=this;"number"==typeof Yi.iOS&&Yi.iOS<9||this.Bo||(this.Bo=setTimeout((function(){if(n.eo){var t=new XMLHttpRequest;t.onload=function(){410!==t.status?(200!==t.status&&n.fire(Ci.STREAM_OFFLINE),t.response.match(/^#EXTM3U\n#EXT-X-VERSION:3\n$/)&&n.fire(Ci.STREAM_OFFLINE)):n.Wo()},t.onerror=function(){n.fire(Ci.STREAM_OFFLINE)},/json=1/.test(n.Fo)?tr(n.Fo).json().then((function(i){"url"in i||n.fire(Ci.STREAM_OFFLINE),t.open("GET",i.url),t.send()})).catch((function(){t.open("GET",n.Fo),t.send()})):(t.open("GET",n.Fo),t.send())}}),t))},i.setVideoSrc=function(t){var n=this;this.ke=this.Ko(t).then((function(){return n.Fo=t,n.zo(t)}))},i.onprogress=function(){this.Bo&&(clearTimeout(this.Bo),this.Bo=null)},i.onstalled=function(){this.Go(1e4)},i.onerror=function(){var n=this;return this.$.error.code===this.$.error.MEDIA_ERR_SRC_NOT_SUPPORTED?(tr(this.Fo).then((function(){t.prototype.onerror.call(n)})).catch((function(i){i instanceof Pe?n.fire(Ti.ERROR,new TelecineError("MediaNetworkError","A network error ocurred while fetching the media.")):t.prototype.onerror.call(n)})),!1):t.prototype.onerror.call(this)},i.onwaiting=function(){this.Go(1e4)},i.seekToTime=function(){},i.play=function(){var n=this;return t.prototype.play.call(this,(function(){return n.ke}))},H(n,[{key:"currentTime",get:function(){return this.$.currentTime},set:function(t){this.$.currentTime=t}}]),n}(Me),to=function(){function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.Jo=t,this.Z=t.Z,this.tt=n}H(t,null,[{key:"displayName",get:function(){return"Effect"}},{key:"supported",get:function(){return!1}},{key:"supportedScanners",get:function(){return[]}}]);var n=t.prototype;return n.activate=function(){throw new TelecineError("NotImplemented","The effect must implement the activate method.")},n.deactivate=function(){throw new TelecineError("NotImplemented","The effect must implement the deactivate method.")},t}(),no=new N,io=new N,TelecineFile=function(){function TelecineFile(t,n){var i=t.src,e=t.mime,r=t.id,o=void 0===r?le():r,u=t.priority,a=void 0===u?0:u,s=t.metadata,c=void 0===s?{}:s;if(!i)throw new TypeError("Must provide a src for the file.");if(!e)throw new TypeError("Must provide a mime type for the file.");Object.defineProperties(this,{mime:{value:e,enumerable:!0},id:{value:"".concat(o),enumerable:!0},metadata:{value:c,enumerable:!0}}),this.video=n,this.priority=a,this.src=i}return H(TelecineFile,[{key:"priority",get:function(){return no.get(this)},set:function(t){if(!("number"==typeof(t=parseInt(t,10))&&isFinite(t)&&Math.floor(t)===t&&t>=0))throw new TypeError("The file priority must be an integer greater than or equal to 0.");no.set(this,t)}},{key:"src",get:function(){return io.get(this)},set:function(t){io.set(this,t),this.video.fire(xi.FILE_SRC_UPDATE,this)}},{key:"restrictedStreamIndexes",get:function(){if(!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this.video.currentScanner),"restrictedStreamIndexes"))throw new ReferenceError("The current scanner does not support streams.");return this.video.currentScanner.restrictedStreamIndexes},set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(t))throw new TypeError("Indexes must be an array.");if(!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this.video.currentScanner),"restrictedStreamIndexes"))throw new ReferenceError("The current scanner does not support streams.");this.video.currentScanner.restrictedStreamIndexes=t}}]),TelecineFile}();function eo(){return!!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration||window.WebKitMediaKeys)}function ro(t,n,i){"string"==typeof n&&(n=function(t){for(var n=new ArrayBuffer(2*t.length),i=new Uint16Array(n),e=0,r=t.length;e1&&void 0!==arguments[1])||arguments[1],i=n?t.buffer:t,e=String.fromCharCode.apply(null,new Uint16Array(i)),r=(new DOMParser).parseFromString(e,"application/xml"),o={},u=r.getElementsByTagName("HttpHeader"),a=0;a1&&void 0!==arguments[1]?arguments[1]:{};return this.$=t.$,this.jr=t,eo()?(this.au=ao(this.Xo,this.Zo),uo(this.$o,this.tu,!1,i).then((function(t){if(t.forEach((function(t){t.keySystem&&(n.eu=t)})),!n.eu)return n.jr.fire(xi.EME_UNSUPPORTED),!1;var i=so(n.$o,n.eu);return n.ru="encrypted",n.nu=i.license_url,n.tu&&(n.su=i.certificate_url,n.ru="webkitneedkey"),n.$.addEventListener(n.ru,n.ou),n.tu?(n.$.webkitSetMediaKeys(n.eu.keySystem),!0):n.$.mediaKeys?(n.iu=n.$.mediaKeys.createSession(),n.iu.addEventListener("message",(function(t){return n.cu(t)})),!0):(n.iu=n.eu.keySystem.createSession(),n.iu.addEventListener("message",(function(t){return n.cu(t)})),n.$.setMediaKeys(n.eu.keySystem),!0)}))):(this.jr.fire(xi.EME_UNSUPPORTED),!1)},n.destroy=function(){this.iu&&this.iu.sessionId&&this.iu.close(),this.$.removeEventListener(this.ru,this.ou)},n.uu=function(t){var n=this;return"com.apple.fps.1_0"===this.eu.name?(this.lu().then((function(i){n.fu="assetId=".concat(n.Qo);var e=ro(t.initData,n.fu,i);return n.iu=n.eu.keySystem.createSession("video/mp4",e),n.iu.addEventListener("webkitkeymessage",(function(t){return n.cu(t)})),i})).catch((function(t){n.jr.fire(t.error,t.payload)})),!0):!this.iu.sessionId&&!this.hu&&(this.hu=this.iu.generateRequest(t.initDataType,t.initData).catch((function(){n.jr.fire(xi.DRM_FAILURE)})),!0)},n.cu=function(t){var n=this;return new r((function(i,e){n.hu=null;var r=new XMLHttpRequest;r.keySession=t.target,r.responseType="arraybuffer",r.open("POST",n.nu),r.setRequestHeader("dt-custom-data",window.btoa(JSON.stringify(n.au)));var o=t.message;if("com.microsoft.playready"===n.eu.name){var u=oo(t.message,!1),a=u[0];Object.keys(a).forEach((function(t){r.setRequestHeader([t],a[t])})),o=u[1]}if("com.apple.fps.1_0"===n.eu.name){var s=btoa(String.fromCharCode.apply(null,o));s=encodeURIComponent(s),o="spc=".concat(s,"&").concat(n.fu),r.setRequestHeader("Content-type","application/x-www-form-urlencoded")}r.onload=function(){if(403!==r.status)if(r.status>=400)e({error:xi.DRM_FAILURE});else try{n.jr.fire(xi.DRM_AUTH_SUCCESS);var t=new Uint8Array(r.response),o=t.buffer;"com.apple.fps.1_0"===n.eu.name&&(o=function(t){var n=window.atob(t.trim());return""===n.substr(0,5)&&" "===n.substr(-6)&&(n=n.slice(5,-6)),new Uint8Array(atob(n).split("").map((function(t){return t.charCodeAt(0)})))}(btoa(String.fromCharCode.apply(null,t)))),r.keySession.update(o),i()}catch(t){e("Error updating key session: ".concat(t))}else{var u=JSON.parse(r.getResponseHeader("x-dt-error-message"));e({error:xi.DRM_AUTH_FAILURE,payload:{text:u.error,code:u.error_code}})}},r.onerror=e,r.send(o)})).catch((function(t){n.jr.fire(t.error,t.payload)}))},n.lu=function(){var t=this;return new r((function(n,i){var e=new XMLHttpRequest;e.responseType="arraybuffer",e.open("GET",t.su),e.setRequestHeader("dt-custom-data",window.btoa(JSON.stringify(t.au))),e.onload=function(){if(403!==e.status)if(e.status>=400)i({error:xi.DRM_FAILURE});else try{n(new Uint8Array(e.response))}catch(t){i(t)}else{var t=JSON.parse(e.getResponseHeader("x-dt-error-message"));i({error:xi.DRM_AUTH_FAILURE,payload:{text:t.error,code:t.error_code}})}},e.onerror=i,e.send()}))},t}(),lo=function(){function t(){this.du={},this.vu={},this.pu={},this.mu={},this.bu={},this.wu={},this.gu="default",this.yu={KEYCHAIN_DEFAULT:"default",KEYCHAIN_SD_FALLBACK:"sd-fallback"}}var n=t.prototype;return n.getAllKeySessions=function(){return Object.values(this.wu)||[]},n.getCdms=function(t){return this.du[t]},n.getAllPreferredKeySystems=function(){return this.vu},n.addCdms=function(t,n){this.du[n]=t},n.addKeySession=function(t,n){this.wu[n]=t},n.addLicenseTokenUrl=function(t,n){this.pu[n]=t},n.addLicenseUrl=function(t,n){this.mu[n]=t},n.addPreferedKeySystem=function(t,n){this.vu[n]=t},n.closeAllKeySessions=function(){for(var t in this.wu)this.wu[t]&&this.wu[t].sessionId&&this.wu[t].close()},H(t,[{key:"state",get:function(){return this.gu},set:function(t){Object.values(this.yu).indexOf(t)<0||(this.gu=t)}},{key:"activeKeySession",get:function(){return this.wu[this.gu]}},{key:"activeKeySystem",get:function(){return this.vu[this.gu]}},{key:"keyTypes",get:function(){return this.yu}},{key:"activeLicenseTokenUrl",get:function(){return this.pu[this.gu]}},{key:"activeLicenseUrl",get:function(){return this.mu[this.gu]}}]),t}(),fo=function(){function t(t,n){this._u=!!t.fallback_asset,this.tu=n,this.ku=function(){return null},this.Nr=0,this.ru=null,this.ou=this.uu.bind(this),this.Eu=this.Tu.bind(this),this.Su=new lo,this.yu=this.Su.keyTypes,this.Su.state=this.yu.KEYCHAIN_DEFAULT,this.Su.addCdms(t.cdms,this.yu.KEYCHAIN_DEFAULT),this._u&&this.Su.addCdms(t.fallback_cdms,this.yu.KEYCHAIN_SD_FALLBACK)}var n=t.prototype;return n.init=function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.$=t.$,this.jr=t,this.Au=!!window.MSMediaKeys,eo()||this.Au?this.Su.state===this.yu.KEYCHAIN_SD_FALLBACK?this.setUpKeySystem(i,e,this.yu.KEYCHAIN_SD_FALLBACK).then((function(){n.jr.currentTime=n.Nr,n.jr.play()})):this.setUpKeySystem(i,e).then((function(){return n.setUpKeySystem(i,e,n.yu.KEYCHAIN_SD_FALLBACK)})):(this.jr.fire(xi.EME_UNSUPPORTED),r.reject())},n.setUpKeySystem=function(t,n){var i=this,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.yu.KEYCHAIN_DEFAULT;return new r((function(r,o){var u=i.Su.getCdms(e);return u||o(),uo(u,i.tu,i.Au,t).then((function(t){i.Su.addPreferedKeySystem(t.find((function(t){return t.keySystem})),e);var r=i.Su.activeKeySystem&&so(u,i.Su.activeKeySystem);if(!r)throw i.jr.fire(xi.EME_UNSUPPORTED),new Error("No valid key system was found.");i.Su.addLicenseTokenUrl(r.license_url,e);var o=n&&n.inits&&n.inits[r.id];return o||i.xu(r,e),i.Cu(e).then((function(){var t=i.Su.state===e;return o&&t&&i.uu(o.cenc,e)}))})).then(r)}))},n.destroy=function(){this.Su&&this.Su.closeAllKeySessions(),this.$&&this.$.removeEventListener(this.ru,this.ou)},n.Mu=function(t){var n=this;return new r((function(i){n.Su.state=t,n.Su.activeKeySession.addEventListener("message",(function(t){return n.cu(t)})),i()}))},n.xu=function(t,n){this.ru="encrypted",this.Su.addLicenseUrl(t.license_url,n),this.tu?(this.su=t.certificate_url,this.ru="webkitneedkey"):this.Au&&(this.ru="msneedkey"),this.$.addEventListener(this.ru,this.ou)},n.Cu=function(t){var n=this;return new r((function(i){if(n.Au){var e=function t(){n.$.msSetMediaKeys(n.Su.activeKeySystem.keySystem),n.$.removeEventListener("loadedmetadata",t),i()};n.$.readyState>=1?e():n.$.addEventListener("loadedmetadata",e)}else{if(n.tu)n.$.webkitSetMediaKeys(n.Su.activeKeySystem.keySystem);else{var r=n.$.mediaKeys||n.Su.activeKeySystem.keySystem;n.Su.addKeySession(n.Iu(r),t),t===n.Su.state&&n.Su.activeKeySession.addEventListener("message",(function(t){return n.cu(t)})),n.$.mediaKeys||n.$.setMediaKeys(n.Su.activeKeySystem.keySystem)}i()}}))},n.Iu=function(t,n,i){var e=t.createSession(n,i);if(!e)throw new Error("Could not create key session");return e},n.uu=function(t,n){var i=this;n=n||this.Su.state;var e=new Error("A decryption key error was encountered");return"com.apple.fps.1_0"===this.Su.activeKeySystem.name?(this.lu(this.su).then((function(r){i.fu=function(t){var n=function(t){var n=new Uint16Array(t.buffer);return String.fromCharCode.apply(null,n)}(t),i=document.createElement("a");return i.href=n,i.hostname}(t.initData);var o=ro(t.initData,i.fu,r);return i.Su.addKeySession(i.Iu(i.Su.activeKeySystem.keySystem,"video/mp4",o),n),i.Su.activeKeySession.contentId=i.fu,i.Su.activeKeySession.addEventListener("webkitkeymessage",(function(t){return i.cu(t)})),i.Su.activeKeySession.addEventListener("webkitkeyerror",(function(t){throw e})),r})).catch((function(t){i.jr.fire(t.error,t.payload)})),!0):"com.microsoft.playready"===this.Su.activeKeySystem.name?(this.Su.addKeySession(this.Iu(this.$.msKeys,"video/mp4",t.initData),n),this.Su.activeKeySession.addEventListener("mskeymessage",(function(t){return i.cu(t)})),this.Su.activeKeySession.addEventListener("mskeyerror",(function(t){throw e})),!0):!this.Su.activeKeySession.sessionId&&!this.hu&&(this.Su.activeKeySession.addEventListener("keystatuseschange",this.Eu),this.hu=this.Su.activeKeySession.generateRequest(t.initDataType,t.initData).catch((function(){i.jr.fire(xi.DRM_FAILURE)})),!0)},n.Tu=function(){var t=this,n=!1,i=F(this.Su.activeKeySession.keyStatuses.values());if(i.forEach((function(t,i){switch(t){case"expired":n=!0}})),i.every((function(t){return"output-restricted"===t}))){if(this._u)return this.Nr=this.jr.currentTime,void this.Mu(this.yu.KEYCHAIN_SD_FALLBACK).then((function(){t.ku(),t.jr.fire(xi.DRM_KEY_SWITCH,t.yu.KEYCHAIN_SD_FALLBACK)})).catch((function(n){t.jr.fire(xi.DRM_OUTPUT_RESTRICTED)}));this.jr.fire(xi.DRM_OUTPUT_RESTRICTED)}n&&this.Su.activeKeySession.close()},n.cu=function(t){var n=this;return this.Ru(this.Su.activeLicenseTokenUrl).then((function(i){return new r((function(e,r){n.Su.addLicenseUrl(i,n.Su.state),n.hu=null;var o=new XMLHttpRequest;o.keySession=t.target,o.open("POST",n.Su.activeLicenseUrl),o.responseType="arraybuffer";var u=t.message;if("com.microsoft.playready"===n.Su.activeKeySystem.name){var a=oo(t.message),s=a[0];Object.keys(s).forEach((function(t){o.setRequestHeader(t,s[t])})),u=a[1]}"com.apple.fps.1_0"===n.Su.activeKeySystem.name&&(u=new Uint8Array(u),o.setRequestHeader("Content-type","application/octet-stream")),o.onload=function(){if(403!==o.status)if(o.status>=400)r(new TelecineError(xi.DRM_FAILURE));else try{n.jr.fire(xi.DRM_AUTH_SUCCESS);var t=new Uint8Array(o.response);o.keySession.update(t),e()}catch(t){r(new TelecineError(xi.DRM_FAILURE,"Error updating key session: ".concat(t)))}else r(new TelecineError(xi.DRM_AUTH_FAILURE))},o.onerror=r,o.send(u)})).catch((function(t){n.jr.fire(t.name,{text:t.message||"License request failed."})}))}))},n.Ru=function(t){return new r((function(n,i){var e=new XMLHttpRequest;e.open("GET",t),e.onload=function(){if(e.status>=400)i(new TelecineError(xi.DRM_FAILURE));else try{try{var t=JSON.parse(e.response),r=t.licenseAcquisitionUrl,o=t.token;if(!r&&!o)throw new Error;n("".concat(r,"?ExpressPlayToken=").concat(o))}catch(t){n(e.response)}}catch(t){i(new TelecineError(xi.DRM_FAILURE,"Error retrieving License Acquisition URL (LA_URL): ".concat(t)))}},e.onerror=i,e.send()}))},n.lu=function(t){return new r((function(n,i){var e=new XMLHttpRequest;e.open("GET",t),e.responseType="arraybuffer",e.setRequestHeader("Pragma","Cache-Control: no-cache"),e.setRequestHeader("Cache-Control","max-age=0"),e.onload=function(){if(403!==e.status)if(e.status>=400)i({error:xi.DRM_FAILURE});else try{n(new Uint8Array(e.response))}catch(t){i(t)}else i({error:xi.DRM_AUTH_FAILURE})},e.onerror=i,e.send()}))},n.setFallbackCallback=function(t){this.ku=function(){return t()}},H(t,[{key:"state",get:function(){return this.Su.state}},{key:"hasFallbackAssets",get:function(){return this._u}}]),t}(),ho=new N,TelecineVideo=function(){function TelecineVideo(t){var n=this,i=t.files,e=t.id,r=void 0===e?le():e,o=t.title,u=void 0===o?null:o,a=t.subtitle,s=void 0===a?null:a,c=t.metadata,l=void 0===c?{}:c,f=t.textTracks,h=void 0===f?ae():f,d=t.externalDisplayFiles,v=void 0===d?{}:d,p=t.chapters,m=void 0===p?[]:p,b=t.duration;if(!i||!Array.isArray(i))throw new TypeError("Must provide files for the video.");rt(this);var w=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.getFileById=ue,t}(i.map((function(t){return t instanceof TelecineFile?(t.video=n,t):new TelecineFile(t,n)}))),g=ae(h.map((function(t){return t instanceof TelecineTextTrack?(t.video=n,t):new TelecineTextTrack(t,n)})));Object.keys(v).forEach((function(t){!v[t]||v[t]instanceof TelecineFile||(v[t]=new TelecineFile(v[t],n))})),Object.defineProperties(this,{id:{value:"".concat(r),enumerable:!0},title:{value:u,enumerable:!0},subtitle:{value:s,enumerable:!0},metadata:{value:l,enumerable:!0},files:{value:w,enumerable:!0},textTracks:{value:g,enumerable:!0,writable:!0},chapters:{value:m,enumerable:!0},duration:{value:b,enumerable:!0},externalDisplayFiles:{value:v,enumerable:!0}}),l.drm&&(l.drm.fastly?this.Ou=new fo(l.drm,l.useHls):this.Ou=new co(l.drm,l.useHls))}return TelecineVideo.prototype.deactivate=function(){var t=this;this.Ou&&this.Ou.destroy(),this.textTracks.forEach((function(n){return t.currentScanner.removeTextTrack(n)}))},H(TelecineVideo,[{key:"drmHandler",get:function(){return this.Ou||null}},{key:"currentFile",get:function(){return this.currentScanner.currentFile},set:function(t){this.currentScanner.currentFile=t}},{key:"currentScanner",get:function(){return ho.get(this)},set:function(t){var n=this;this.currentScanner&&this.currentScanner.constructor.supportsTextTracks&&this.textTracks.forEach((function(t){return n.currentScanner.removeTextTrack(t)})),t.constructor.supportsTextTracks&&this.textTracks.forEach((function(n){return t.addTextTrack(n)})),ho.set(this,t)}},{key:"chapters",get:function(){return this.chapters}}]),TelecineVideo}(),vo=function(){function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.Jo=t,this.tt=n,this.Lu=null,this.Du=this.tt.embedTime?this.tt.embedTime:0,this.ju=!1,this.Nu=!1,this.Pu=!1,this.playInitiated=!1,this.Uu=!1,this.Fu=250,rt(this),this.Vu=this.Bu.bind(this),this.Hu=this.qu.bind(this),this.Wu=this.zu.bind(this),this.Gu=this.Yu.bind(this),this.Ku=this.Ju.bind(this),this.$u=this.Xu.bind(this),this.Zu(this.Jo.on),this.tt.noInterval||this.Qu()}var n=t.prototype;return n.destroy=function(){clearInterval(this.Lu),this.Zu(this.Jo.off),this.Bu()},n.Zu=function(t){t(Ti.PAUSE,this.Hu),t(Ti.PLAYING,this.Vu),t(Ti.SEEKING,this.Wu),t(Ti.SEEKED,this.Gu),t(Ci.STREAM_ONLINE,this.Ku),t(Ci.STREAM_OFFLINE,this.$u)},n.qu=function(){this.userPlayState=!1},n.Bu=function(){this.ju&&(this.ju=!1,this.fire(xi.BUFFER_ENDED))},n.zu=function(){this.Nu=!0},n.Yu=function(){this.Nu=!1},n.Ju=function(){this.Uu=!0},n.Xu=function(){this.Uu=!1},n.Qu=function(){clearInterval(this.Lu),this.Lu=setInterval(this.runIntervalCheck.bind(this),this.Fu)},n.runIntervalCheck=function(){if(this.Jo.video){var t=this.Jo.video.currentScanner;if(t){var n=this.Jo.isLive(),i=t.currentTime,e=this.Fu/2/1e3;if(this.playInitiated&&(!this.Nu||n)&&(!this.Jo.paused||this.userPlayState)&&!this.ju&&i=r.start(o)&&i+.2<=r.end(o))return;if(i+e>=this.Jo.duration)return;this.ju=!0,this.fire(xi.BUFFER_STARTED)}(this.playInitiated&&this.ju&&i>this.Du+e||n&&!this.Uu&&this.ju)&&(this.ju=!1,this.fire(xi.BUFFER_ENDED)),this.Du=i}}},H(t,[{key:"userPlayState",get:function(){return this.Pu},set:function(t){this.Pu=t,t||this.Bu()}}]),t}();function po(){var t,n;function i(){t.src?document.createElement("video").load():t.load()}function e(){if(!n)return r.reject();t.preload="";var i=t.play();return void 0===i&&(i=new r((function(n){t.addEventListener("playing",n)}))),i}function o(){n&&(n.resolve(),n=null)}function u(t){n&&(n.reject(t),n=null)}return{set video(n){t=n},get video(){return t},get active(){return!!n},start:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.resolve.bind(r);return n||(n=new vt),i(),t().then(e).then(o).catch(u),n},cancel:function(){n&&(n.reject(new TelecineError("PlayInterrupted","The play() request was interrupted by a call to pause()")),n=null)}}}var mo=function(){function t(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.Z=t,this.ta=n,this.tt=i,this.$=null,this.ht=ae(),this.na={},this.ia=new Me(t),this.tt.playRequest=new po,this.ea=[],this.ra=[],rt(this)}var n=t.prototype;return n.supportsEffect=function(t){var n=this;return!!t.supported&&t.supportedScanners.some((function(t){return n.oa(n.ia)===t.displayName}))},n.getEffectByName=function(t){var n=this,i=null;return this.ra.forEach((function(e){t===n.aa(e)&&(i=e)})),i},n.activateEffect=function(t,n){var i=new t(this,n);return i.activate(),this.ra.push(i),i},n.deactivateEffect=function(t){var n=this;return this.ra.some((function(i,e){return i.constructor===t&&(i.deactivate(),n.ra.splice(e,1),!0)}))},n.deactivateEffects=function(){var t=this;this.ra.forEach((function(n){return t.deactivateEffect(n.constructor)}))},n.play=function(){if(!this.$||this.$.files.length<1)throw new TelecineError("NoFiles","There are no files to play.");this.sa.playInitiated||(this.sa.playInitiated=!0),this.sa.userPlayState=!0;var t=this.ia.play();return this.na.paused=!1,t},n.pause=function(){if(!this.$||this.$.files.length<1)throw new TelecineError("NoFiles","There are no files to play.");return this.sa.userPlayState=!1,this.ia.pause(),this.na.paused=!0,this},n.isLive=function(){return this.currentScannerName.includes("Live")},n.endLive=function(){this.ia.endLive()},n.getBitrateAtTime=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"video";return"MediaSourceScanner"!==this.oa(this.ia)&&"HLSLiveScanner"!==this.oa(this.ia)||"audio"===n&&this.ia.pn[n].length<=1?0:this.ia.getBitrateAtTime(t,n)},n.getCurrentStream=function(){var t,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"video";return null==(t=(n=this.ia).getCurrentStream)?void 0:t.call(n,i)},n.showExternalDisplayPicker=function(t){this.ia.showExternalDisplayPicker(t)},n.supportsPresentationMode=function(t){return-1!==this.supportedPresentationModes.indexOf(t)},n.addChapter=function(t,n){this.ia.addChapter(t,n)},n.removeChapter=function(t){this.ia.removeChapter(t)},n.addCuePoint=function(t,n){return this.ia.addCuePoint(t,n)},n.removeCuePoint=function(t){return this.ia.removeCuePoint(t)},n.removeAllCuePoints=function(){return this.ia.removeAllCuePoints()},n.addVideoEventListeners=function(){return this.ia.addVideoEventListeners()},n.removeVideoEventListeners=function(){return this.ia.removeVideoEventListeners()},n.ca=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.textTrackSupport,e=void 0!==i&&i,r=this.$.files.sort((function(t,n){return t.priority-n.priority})),o=this.ta,u=function(n){var i=r[n];for(var u in o){var a=o[u];if(a.supported&&(!e||a.supportsTextTracks)&&-1===t.ea.indexOf(t.oa(a))&&a.supportedVideoTypes.some((function(t){return i.mime===t})))return{v:a}}};for(var a in r){var s=u(a);if("object"===V(s))return s.v}return e?(this.kt("TextTracksNotSupported","None of the scanners support text tracks in this browser."),this.ea=[],this.ca()):null},n.reactivate=function(){var t;(null==(t=this.ia)?void 0:t.reactivate)&&this.ia.reactivate(),this.play()},n.la=function(t,n){var i=this;if(this.ia.constructor!==t||this.ia.video!==n){this.ia.deactivate();var e=new t(this.Z,this.tt);Object.keys(Oi).forEach((function(t){var n=Oi[t];e.on(n,(function(t){return i.fa(n,t,e)}))})),this.ia=e,n.currentScanner=e,this.ia.video=n;for(var r=Object.keys(this.na),o=0;o0});t?this.la(t,this.$):this.kt("FilesNotPlayable","None of the files could be played in this browser.")}},n.da=function(){this.ia.deactivate(),this.ia=new Me(this.Z)},n.fa=function(t,n,i){if(i===this.ia){switch(t){case Ti.ERROR:return void(n instanceof TelecineError&&this.fire(Ti.ERROR,n));case xi.SCANNER_ERROR:this.kt("ScannerError","The current scanner can no longer be used because ".concat(n.reason)),this.ea.push(this.oa(this.ia)),this.ha([]);break;case xi.FILE_ERROR:this.kt("FileError","The current file can no longer be used because ".concat(n.reason)),this.ia.Et();break;case xi.DOWNLOAD_ERROR:this.kt("DownloadError",n),this.ia.Et();break;case xi.EME_UNSUPPORTED:this.kt("DRMFailure",{text:null,code:"emeunsupported"});break;case xi.DRM_FAILURE:case xi.DRM_AUTH_FAILURE:this.kt("DRMFailure",{text:n.text,code:n.code});break;case xi.DRM_OUTPUT_RESTRICTED:this.kt("DRMFailure",{text:null,code:"outputrestricted"});break;case xi.DRM_AUTH_SUCCESS:this.fire(xi.DRM_AUTH_SUCCESS);break;case Ti.TIME_UPDATE:this.na.currentTime=this.ia.currentTime;break;case xi.MEDIA_URL_EXPIRED:this.kt("MediaUrlExpired",n);break;case xi.MEDIA_URL_BAD_REQUEST:this.kt("MediaUrlBadRequest",n);break;case Ri.BRAIN_ML_MODEL_ERR:this.kt("MimirError",n);break;case Ri.BRAIN_ML_MODEL_NET_ERR:this.kt("MimirNetworkError",n);break;case Ri.BRAIN_ML_MODEL_TIMEOUT:this.kt("MimirNetworkTimeout",n);break;case Mi.SPATIAL_UNSUPPORTED:this.getEffectByName("ThreeSixtyEffect").deactivate();break;case Ti.ENDED:this.na.paused=!0;break;case Ti.WAITING:this.fire(Ti.WAITING)}this.ra.forEach((function(n){"function"==typeof n["on".concat(t)]&&n["on".concat(t)]()})),this.fire(t,n)}},n.kt=function(t,n){this.fire(Ti.ERROR,new TelecineError(t,n))},n.oa=function(t){return t instanceof Me?t.constructor.displayName:t.prototype.constructor.displayName},n.Qu=function(){var t=this;this.sa&&this.sa.destroy(),this.sa=new vo(this,this.tt),this.sa.on(xi.BUFFER_STARTED,(function(){t.fire(xi.BUFFER_STARTED)})),this.sa.on(xi.BUFFER_ENDED,(function(){t.fire(xi.BUFFER_ENDED)}))},n.aa=function(t){return t instanceof to?t.constructor.displayName:t.prototype.constructor.displayName},n.va=function(t){"HLSLiveScanner"===this.oa(this.ia)&&this.ia.setCaptionsState(t)},H(t,[{key:"element",get:function(){return this.Z}},{key:"videoElement",get:function(){return this.ia.videoElement}},{key:"manifest",get:function(){return this.ia.manifest||{video:[]}}},{key:"supportsSettingVolume",get:function(){return this.ta.some((function(t){return t.supported&&t.supportsSettingVolume}))}},{key:"supportsPlaybackRate",get:function(){return this.ia.constructor.supportsPlaybackRate}},{key:"supportsTextTracks",get:function(){return this.ta.some((function(t){return t.supported&&t.supportsTextTracks}))}},{key:"activeEffects",get:function(){return this.ra}},{key:"latency",get:function(){return this.ia.latency}},{key:"downloadSpeed",get:function(){return this.ia.downloadSpeed||0}},{key:"isLowerProfileAvailable",get:function(){return this.ia.isLowerProfileAvailable}},{key:"buffered",get:function(){return this.ia.buffered}},{key:"bufferTarget",get:function(){return this.ia.bufferTarget},set:function(t){this.na.bufferTarget=t,this.ia.bufferTarget=t}},{key:"presentationDelay",get:function(){return this.ia.presentationDelay},set:function(t){this.na.presentationDelay=t,this.ia.presentationDelay=t}},{key:"lowLatencyMode",get:function(){return this.ia.lowLatencyMode},set:function(t){this.na.lowLatencyMode=t,this.ia.lowLatencyMode=t}},{key:"manifestLoadDurations",get:function(){return this.ia.manifestLoadDurations?this.ia.manifestLoadDurations:[]}},{key:"successfulSegments",get:function(){return this.ia.successfulSegments?this.ia.successfulSegments:[]}},{key:"failedSegments",get:function(){return this.ia.failedSegments?this.ia.failedSegments:[]}},{key:"cuePoints",get:function(){return this.ia.cuePoints}},{key:"currentChapterID",get:function(){return this.ia&&this.ia.chaptersTrack&&this.ia.chaptersTrack.activeCues.length?this.ia.chaptersTrack.activeCues[0].id:null}},{key:"chapters",get:function(){return this.ia.chaptersTrack?this.ia.chaptersTrack.cues:[]}},{key:"chaptersTrack",get:function(){return this.ia.chaptersTrack}},{key:"currentFile",get:function(){return this.ia.currentFile},set:function(t){if("string"==typeof t&&(t=this.Mt.filter((function(n){return n.id===t}))[0]),!t)throw new TelecineError("FileNotValid","The file is not valid.");this.ia.currentFile=t}},{key:"currentScannerName",get:function(){return this.oa(this.ia)}},{key:"currentScanner",get:function(){return this.ia}},{key:"currentTime",get:function(){return this.ia.currentTime},set:function(t){this.na.currentTime=t,this.ia.currentTime=t}},{key:"duration",get:function(){return this.ia.duration}},{key:"ended",get:function(){return this.ia.ended}},{key:"externalDisplayAvailable",get:function(){return this.ia.externalDisplayAvailable}},{key:"externalDisplayActive",get:function(){return this.ia.externalDisplayActive}},{key:"loop",get:function(){return this.ia.loop},set:function(t){this.na.loop=t,this.ia.loop=t}},{key:"muted",get:function(){return this.ia.muted},set:function(t){this.na.muted=!!t,this.ia.muted=!!t}},{key:"playsinline",get:function(){return this.ia.playsinline},set:function(t){this.na.playsinline=!!t,this.ia.playsinline=!!t}},{key:"paused",get:function(){return this.ia.paused}},{key:"played",get:function(){return this.ia.played}},{key:"seekable",get:function(){return this.ia.seekable}},{key:"seeking",get:function(){return this.ia.seeking}},{key:"defaultPlaybackRate",get:function(){return this.ia.defaultPlaybackRate},set:function(t){this.na.defaultPlaybackRate=t,this.ia.defaultPlaybackRate=t}},{key:"playbackRate",get:function(){return this.ia.playbackRate},set:function(t){this.na.playbackRate=t,this.ia.playbackRate=t}},{key:"preload",get:function(){return this.ia.preload},set:function(t){this.na.preload=t,this.ia.preload=t}},{key:"autoPictureInPicture",get:function(){return this.ia.autoPictureInPicture},set:function(t){this.na.autoPictureInPicture=!!t,this.ia.autoPictureInPicture=!!t}},{key:"disablePictureInPicture",get:function(){return this.ia.disablePictureInPicture},set:function(t){this.na.disablePictureInPicture=!!t,this.ia.disablePictureInPicture=!!t}},{key:"presentationMode",get:function(){return this.ia.presentationMode},set:function(t){this.ia.presentationMode=t}},{key:"supportedPresentationModes",get:function(){return this.ia.supportedPresentationModes}},{key:"video",get:function(){return this.$},set:function(t){this.$&&this.$.deactivate(),this.ea=[],this.Qu(),null===t?(this.$=null,this.da()):(this.$=new TelecineVideo(t),this.ha())}},{key:"videoWidth",get:function(){return this.ia.videoWidth}},{key:"videoHeight",get:function(){return this.ia.videoHeight}},{key:"volume",get:function(){return this.ia.volume},set:function(t){if(t<0||t>1)throw new TelecineError("IndexSizeError","Failed to set the 'volume' property: The volume provided (".concat(t,") is outside of the range [0, 1]."));this.na.volume=t,this.ia.volume=t}},{key:"brainDebug",get:function(){return this.ia.brainDebug}}]),t}(),bo=function(t){function n(n){var i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(i=t.call(this,n,e)||this).pa=!1,i.$=i.Jo.ia.$,i}G(n,t),H(n,null,[{key:"displayName",get:function(){return"CanvasEffect"}},{key:"supported",get:function(){return!0}},{key:"supportedScanners",get:function(){return[Me,Or]}}]);var i=n.prototype;return i.activate=function(){this.pa=!0,this.ma=document.createElement("canvas"),this.ma.className="vp-canvas-effect",this.ma.style.cssText="\n position: absolute;\n top:0;\n left:0;\n bottom:0;\n right:0;\n ",this.ba=this.ma.getContext("2d",{alpha:!1}),this.Z.appendChild(this.ma),this.wa()},i.deactivate=function(){this.ma&&this.Z.removeChild(this.ma),this.ga(),this.pa=!1},i.wa=function(){this.ya()},i.ya=function(){this._a=window.requestAnimationFrame(this.ka.bind(this))},i.ka=function(){var t=this.$,n=this.ma;n.width=t.clientWidth,n.height=t.clientHeight;var i=Math.floor(this.Ea()),e=Math.floor(this.Ta()),r=Math.floor((t.clientWidth-i)/2),o=Math.floor((t.clientHeight-e)/2);this.ba.fillStyle="#000",this.ba.fillRect(0,0,n.width,n.height),this.ba.drawImage(t,r,o,i,e),this.ya()},i.Sa=function(){return this.$.videoHeight/this.$.videoWidth},i.Ea=function(){return Math.min(this.$.clientHeight/this.Sa(),this.$.clientWidth)},i.Ta=function(){return Math.min(this.$.clientWidth*this.Sa(),this.$.clientHeight)},i.ga=function(){this._a&&(window.cancelAnimationFrame(this._a),this._a=null)},n}(to),wo=function(){function t(){}return H(t,null,[{key:"Equirect",get:function(){return"equirectangular"}}]),t}(),go=function(){function t(){}return H(t,null,[{key:"Mono",get:function(){return"mono"}},{key:"TopBottom",get:function(){return"top-bottom"}}]),t}(),yo=function(){function t(t,n,i){switch(this.isStereo=n!==go.Mono,this.Aa=null,this.xa=null,t){case wo.Equirect:this.createEquirectProjection(i,n);break;default:this.createEquirectProjection(i,go.Mono)}}var n=t.prototype;return n.createEquirectProjection=function(t,n){switch(n){case go.Mono:this.Aa=this.Ca(t);break;case go.TopBottom:this.Aa=this.Ca(t),this.xa=this.Ca(t),this.Aa.layers.set(1),this.xa.layers.set(2),this.Ma(this.Aa.geometry,.5,0),this.Ma(this.xa.geometry,.5,.5)}},n.Ca=function(n,i,e,r){var o=new THREE.SphereBufferGeometry(i||t.SPHERE_RADIUS,e||t.TESSELATION_WIDTH,r||t.TESSELATION_HEIGHT);o.scale(-1,1,1);var u=new THREE.MeshBasicMaterial({map:n});return new THREE.Mesh(o,u)},n.Ma=function(t,n,i){for(var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=0;r0?(t.Ia.vr.setDevice(n[0]),n[0]):null})):null},n.enter=function(){return this.Ia.vr.getDevice()&&this.Ia.vr.getDevice().requestPresent([{source:this.Ia.domElement}])},n.exit=function(){return this.Ia.vr.getDevice()&&this.Ia.vr.getDevice().exitPresent()},H(t,[{key:"supported",get:function(){return Yi.webvr}},{key:"device",get:function(){return this.Ia&&this.Ia.vr.getDevice()?this.Ia.vr.getDevice():null}},{key:"isPresenting",get:function(){return!(!this.Ia||!this.Ia.vr.getDevice())&&this.Ia.vr.getDevice().isPresenting}}]),t}(),ko=function(t){function n(n){var i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(i=t.call(this,n,e)||this).pa=!1,i.Ra=null,i.Oa=null,i.Ia=null,i.isUserInteracting=!1,i.La=0,i.Da=0,i._coordinates={lat:0,long:0},i.ja={lat:0,long:0},i.Na={lat:0,long:0},i.Pa=i.cameraProps,i.Ua=0,i.Fa=0,i.Va=0,i.$=i.Jo.ia.$,i.Ba=null,i.Ha={x:0,y:0},i.qa={lat:0,long:0},i.Wa={videoFps:i.tt.fps,motionRenderSpeed:60},i.za=1e3/i.Wa.videoFps,i.Ga=[],i.Ya=!1,i.Ka=!1,i.Ja=!1,i.$a={up:!1,down:!1,left:!1,right:!1},i}G(n,t),H(n,[{key:"isUserInteracting",set:function(t){t!==this.Xa&&(this.Xa=t,t?this.tt.isMobile||this.Jo.fire(Mi.MOTION_START):this.tt.isMobile||this.Jo.fire(Mi.MOTION_END))},get:function(){return this.Xa}}],[{key:"displayName",get:function(){return"ThreeSixtyEffect"}},{key:"supported",get:function(){try{var t=document.createElement("canvas");return!!window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))}catch(t){return this.Jo.ia.fire(Mi.SPATIAL_UNSUPPORTED),!1}}},{key:"supportedScanners",get:function(){return[Me,Or]}}]),n.frustumSurfaceArea=function(t,n,i){var e=2*yo.SPHERE_RADIUS*2*Math.sin(Math.PI/180*(t/2));return e*(e*n/i)/(4*Math.PI*Math.pow(yo.SPHERE_RADIUS,2))};var i=n.prototype;return i.activate=function(){var t=this;return new r((function(n,i){if(window.THREE)n();else{var e=document.createElement("script");e.src=t.tt.threeUrl,document.body.appendChild(e),e.onload=function(){n()}}})).then((function(){return t.qt()}))},i.qt=function(){var t=this;this.pa=!0,this.Ra=new THREE.PerspectiveCamera(this.tt.fieldOfView,this.$.clientWidth/this.$.clientHeight,1,2*yo.SPHERE_RADIUS),this.Ra.target=new THREE.Vector3(0,0,0),this.Ra.layers.enable(1),this.Za(this.tt.directorTimeline),this.Oa=new THREE.Scene,this.Qa=new THREE.VideoTexture(this.$),this.Qa.generateMipmaps=!1,this.Qa.minFilter=THREE.NearestFilter,this.Qa.maxFilter=THREE.NearestFilter,this.Qa.format=THREE.RGBFormat,this.ts=new yo(this.tt.projection,this.tt.stereoMode,this.Qa),this.ts.isStereo&&this.Oa.add(this.ts.right),this.Oa.add(this.ts.left),this.Ia=new THREE.WebGLRenderer,this.Ia.vr.enabled=!0,this.Ia.setPixelRatio(window.devicePixelRatio),this.ns=document.createElement("div"),this.ns.appendChild(this.Ia.domElement),this.Z.appendChild(this.ns),this.es(),this.Jo.ia.$.setAttribute("crossorigin","anonymous"),this.wa(),this.Jo.ia.paused||this.rs(),this.os=new _o(this.Ia),this.os.supported&&this.os.hasVRHeadset().then((function(n){setTimeout((function(){t.Jo.fire(Mi.WEBVR_HARDWARE_AVAILABLE,t.os.device)}),100)})).catch((function(t){}))},i.toggleVR=function(){var t=this;if(this.os.isPresenting)this.os.exit().then((function(){t.adjustRenderSize()})).catch((function(t){}));else{if(this.Jo.ia.paused)return;this.os.enter().then((function(){t.adjustRenderSize()})).catch((function(t){}))}},i.onplay=function(){this.pa&&(this.rs(),this.adjustRenderSize())},i.deactivate=function(){this.ns&&this.Z.removeChild(this.ns),this.ga(),this.pa=!1},i.snapToCenter=function(){var t=this;this.Ga.forEach((function(t){return clearTimeout(t)}));var n=((this._coordinates.long>=180?360:0)-this._coordinates.long)/11,i=(0-this._coordinates.lat)/11;this.Va=0;for(var e=function(e){t.Ga.push(setTimeout((function(){0===e&&(t.Ya=!0,t.tt.isMobile||(t.za=1e3/t.Wa.motionRenderSpeed)),49===e&&(t.Ya=!1,t.tt.isMobile||(t.za=1e3/t.Wa.videoFps)),t.us(t._coordinates.lat+i/Math.pow(1.1,e),t._coordinates.long+n/Math.pow(1.1,e)),t.qa.lat=THREE.Math.radToDeg(t.Ha.x)+t._coordinates.lat+i/Math.pow(1.1,e),t.qa.long=THREE.Math.radToDeg(t.Ha.y)+t._coordinates.long+i/Math.pow(1.1,e)}),e*t.za))},r=0;r<50;r++)e(r)},i.isStereo=function(){return!!this.ts&&this.ts.isStereo},i.Za=function(t){t&&t[0]&&void 0!==t[0].p&&"undefined"!==t[0].y&&this.us(t[0].p,t[0].y)},i.us=function(t,n){this.ja.long=this._coordinates.long,this.ja.lat=this._coordinates.lat,t%=360,this._coordinates.lat=Math.max(-85,Math.min(85,t)),n=(n%=360)>=0?n:360+n,this._coordinates.long=n},i.makeContact=function(t){this.isUserInteracting=!0,this.Ga.forEach((function(t){return clearTimeout(t)})),this.Ya=!1,this.as={x:t.x,y:t.y},this.Na.long=this._coordinates.long,this.Na.lat=this._coordinates.lat,this.ss={long:this._coordinates.long,lat:this._coordinates.lat},this.tt.isMobile||(this.za=1e3/this.Wa.motionRenderSpeed)},i.move=function(t){this.qa.lat=THREE.Math.radToDeg(this.Ha.x)+this.ja.lat,this.qa.long=THREE.Math.radToDeg(this.Ha.y)+this.ja.long;var n=this.ss.lat-.2*(this.as.y-t.y),i=.2*(this.as.x-t.x)+this.ss.long;this.us(n,i)},i.moveWheel=function(t){this.qa.lat=THREE.Math.radToDeg(this.Ha.x)+this.ja.lat,this.qa.long=THREE.Math.radToDeg(this.Ha.y)+this.ja.long;var n=this._coordinates.lat-.1*t.y,i=this._coordinates.long+.1*t.x;this.us(n,i)},i.moveDevice=function(t,n,i,e){this.Ja=!0;var r=new THREE.Quaternion,o=window.orientation;null===o&&(o=this.$.clientWidth>this.$.clientHeight?90:0),t=t?THREE.Math.degToRad(t):0,n=n?THREE.Math.degToRad(n):0,i=i?THREE.Math.degToRad(i):0;var u=o?THREE.Math.degToRad(o):0,a=new THREE.Vector3(0,0,1),s=new THREE.Euler,c=new THREE.Quaternion,l=new THREE.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));s.set(n,t,-i,"YXZ"),r.setFromEuler(s),r.multiply(l),r.multiply(c.setFromAxisAngle(a,-u)),this.Ha=(new THREE.Euler).setFromQuaternion(r,"YXZ"),this.Va=this.Ha.z,this.isUserInteracting||this.Ya||this.us(THREE.Math.radToDeg(this.Ha.x)-this.qa.lat,-THREE.Math.radToDeg(this.Ha.y)+this.qa.long),this.Ka||(this.snapToCenter(),this.Jo.fire(Mi.MOTION_START),this.Ka=!0)},i.releaseContact=function(t){if(this.qa.lat=THREE.Math.radToDeg(this.Ha.x)-this._coordinates.lat,this.qa.long=THREE.Math.radToDeg(this.Ha.y)+this._coordinates.long,this.isUserInteracting=!1,this.ss&&!t){var n=Math.hypot(this._coordinates.long-this.ss.long,this._coordinates.lat-this.ss.lat);this.cs(n)}},i.abandonMotion=function(){this.isUserInteracting=!1,this.ss=null},i.keyPress=function(t){this.tt.keyboardDisabled||(this.ls()||(this.isUserInteracting=!0,this.Ga&&this.Ga.forEach((function(t){return clearTimeout(t)}))),this.$a[t]||(this.$a[t]=!0))},i.keyUp=function(t){this.$a[t]=!1,this.ls()||(this.isUserInteracting=!1,this.cs(1/0))},i.fs=function(){var t=this;Object.keys(this.$a).forEach((function(n){if(t.$a[n])switch(n){case"up":t.us(t._coordinates.lat+2,t._coordinates.long);break;case"down":t.us(t._coordinates.lat-2,t._coordinates.long);break;case"left":t.us(t._coordinates.lat,t._coordinates.long-2);break;case"right":t.us(t._coordinates.lat,t._coordinates.long+2)}}))},i.ls=function(){var t=this;return Object.keys(this.$a).map((function(n){return t.$a[n]})).some((function(t){return t}))},i.cs=function(t){var n=this;t>=20&&function(){var i={long:n._coordinates.long-n.ja.long,lat:n._coordinates.lat-n.ja.lat};t===1/0&&(i.long/=2,i.lat/=2);for(var e=function(t){n.Ga.push(setTimeout((function(){1===t&&(n.Ya=!0),49===t&&(n.Ya=!1,n.za=1e3/n.Wa.videoFps);var e=2/Math.pow(t,1.5);n.qa.lat=THREE.Math.radToDeg(n.Ha.x)+n._coordinates.lat+i.lat,n.qa.long=THREE.Math.radToDeg(n.Ha.y)+n._coordinates.long+i.long,n.us(n._coordinates.lat+i.lat*e,n._coordinates.long+i.long*e)}),t*n.za))},r=1;r<50;r++)e(r)}()},i.onseeked=function(){this.pa&&this.hs()},i.onresize=function(){this.adjustRenderSize(),this.isUserInteracting=!1},i.hs=function(){if(!this.isVRPresenting){this.Ua=THREE.Math.degToRad(90+this._coordinates.lat),this.Fa=THREE.Math.degToRad(this._coordinates.long),this.Ra.position.set(Math.sin(this.Ua)*Math.cos(this.Fa),Math.cos(this.Ua),Math.sin(this.Ua)*Math.sin(this.Fa)),this.Ra.lookAt(this.Ra.target),this.Ra.rotation.z+=this.Va;var t=this.cameraProps;this.Jo.fire(Mi.CAMERA_UPDATE,t),this.Pa.yaw===t.yaw&&this.Pa.pitch===t.pitch&&this.Pa.roll===t.roll&&this.Pa.fov===t.fov||(this.Pa=t,this.Jo.fire(Mi.CAMERA_CHANGE,t))}this.Ia.render(this.Oa,this.Ra)},i.adjustRenderSize=function(){if(this.isVRPresenting)this.Ra.aspect=this.$.clientWidth/this.$.clientHeight,this.Ra.updateProjectionMatrix(),this.Ia.setSize(this.$.clientWidth,this.$.clientHeight);else{this.$.clientWidth>this.$.clientHeight?this.Ra.aspect=Math.max(1,Math.min(2,this.$.clientWidth/this.$.clientHeight)):this.Ra.aspect=Math.max(1/3,Math.min(3,this.$.clientWidth/this.$.clientHeight)),this.Ra.updateProjectionMatrix();var t=de(this.$.clientWidth,this.$.clientHeight,this.Ra.aspect,1);this.Ia.setSize(t.width,t.height),this.ns.style.paddingTop="".concat(t.top,"px")}},i.wa=function(){var t=this;this.Ia.setAnimationLoop((function(){t.ls()&&t.fs(),t.hs()}))},i.ga=function(){this.Ia.setAnimationLoop(null)},i.rs=function(){this.ds({backgroundColor:"#000",display:"block"})},i.es=function(){this.ds({backgroundColor:"#000",display:"none"})},i.ds=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.backgroundColor,i=t.display;this.ns.style.cssText="position:absolute;left:0;top:0;margin-left:auto;margin-right:auto;padding:0;background:".concat(n,";width:100%;height:100%;text-align:center;display:").concat(i)},H(n,[{key:"currentCoordinates",get:function(){return this._coordinates},set:function(t){var n=Q(t,2),i=n[0],e=n[1];if(i>90||i<-90)throw new RangeError("Latitude should be a float between -90 and 90.");if(e<0||e>360)throw new RangeError("Longitude should be a float between 0 and 360.");this.us(i,e),this.hs()}},{key:"cameraProps",get:function(){return{yaw:this._coordinates.long,pitch:this._coordinates.lat,roll:this.roll,fov:this.fieldOfView}},set:function(t){t=z(z({},this.cameraProps),t),this.fieldOfView=t.fov,this.roll=t.roll,this.currentCoordinates=[t.pitch,t.yaw]}},{key:"roll",get:function(){return 180*this.Va/Math.PI},set:function(t){if(t<-180||t>180)throw new RangeError("Roll should be a float between -180 and 180.");this.Va=THREE.Math.degToRad(t)}},{key:"isVRPresenting",get:function(){return this.os&&this.os.isPresenting}},{key:"fieldOfView",get:function(){return this.Ra?this.Ra.fov:this.tt.fieldOfView},set:function(t){this.Ra.fov=t,this.Ra.updateProjectionMatrix(),this.Ia.render(this.Oa,this.Ra)}},{key:"hasVRHeadset",get:function(){return this.os&&!!this.os.device}}]),n}(to);function Eo(t){return"symbol"==V(t)||jn(t)&&"[object Symbol]"==Ut(t)}var To=/^\s+|\s+$/g,So=/^[-+]0x[0-9a-f]+$/i,Ao=/^0b[01]+$/i,xo=/^0o[0-7]+$/i,Co=parseInt;function Mo(t){if("number"==typeof t)return t;if(Eo(t))return NaN;if(Ft(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=Ft(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(To,"");var i=Ao.test(t);return i||xo.test(t)?Co(t.slice(2),i?2:8):So.test(t)?NaN:+t}var Io=Rt?Rt.prototype:void 0,Ro=Io?Io.toString:void 0;function Oo(t){if("string"==typeof t)return t;if(Bn(t))return function(t,n){for(var i=-1,e=null==t?0:t.length,r=Array(e);++i0&&void 0!==arguments[0]?arguments[0]:"b",n=++Fo;return"".concat(t).concat(n)}Vo(),Vo();var Bo=Vo(),Ho=Vo(),qo=Vo(),Wo=Vo(),zo=Vo(),Go=Vo(),Yo=Vo(),Ko=Vo(),Jo=Vo(),$o=Vo(),Xo=Vo(),Zo=Vo(),Qo=Vo(),tu=Vo(),nu=Vo(),iu=Vo(),eu=Vo(),ru=Vo(),ou=Vo(),uu=Vo(),au=Object.freeze({__proto__:null,CONFIG_CHANGED:Ko,TELECINE_READY:Jo,TELECINE_VIDEO_INIT:$o,PLAY_INITIATED:Xo,QUALITY_CHANGED:Zo,FORCED_QUALITY:Qo,CUE_CHANGED:tu,CAPTIONS_CHANGED:nu,SPATIAL_PLAYBACK_TOGGLED:iu,PICTURE_IN_PICTURE_AVAILABLE:eu,PICTURE_IN_PICTURE_NOT_AVAILABLE:ru,PICTURE_IN_PICTURE_ACTIVATED:ou,PICTURE_IN_PICTURE_DEACTIVATED:uu}),su=Object.freeze({__proto__:null,EVENT_PENDING:"liveeventpending",EVENT_ACTIVE:"liveeventactive",EVENT_STARTING:"liveeventstarting",EVENT_STARTED:"liveeventstarted",EVENT_ENDED:"liveeventended",ARCHIVE_STARTED:"livearchivestarted",ARCHIVE_DONE:"livearchivedone",ARCHIVE_ERROR:"livearchiveerror",SETTINGS_UPDATED:"livesettingsupdated",LOW_LATENCY_FALLBACK:"lowlatencyfallback"}),cu={h264:"video/mp4",hls:"application/vnd.apple.mpegurl",hlsLive:"application/x-mpegURL",dash:"application/vnd.vimeo.dash+json",dashMpd:"video/vnd.mpeg.dash.mpd",vp6:"video/x-flv",vp8:"video/webm",webm:"video/webm",hds:"application/f4m"},lu={"application/vnd.apple.mpegurl":"hls","application/vnd.vimeo.dash+json":"dash","video/vnd.mpeg.dash.mpd":"dash","video/mp4":"progressive","video/webm":"progressive","video/x-flv":"progressive","application/x-mpegURL":"hlslive"},fu=(z(z(z(z(z(z(z(z(z({},Ti),xi),Ci),su),Mi),Si),Ii),Ri),au),z(z({},Ci),su));function hu(t){var n;return"done"===(null==t||null==(n=t.archive)?void 0:n.status)}function du(t){return"pending"===(null==t?void 0:t.status)}function vu(t){return"started"===(null==t?void 0:t.status)}function pu(t){return"ended"===(null==t?void 0:t.status)}function mu(t){return bu(t,"/playlist/refresh")}function bu(t,n){var i,e=null==(i=t.request.files.hls)?void 0:i.default_cdn,r=t.request,o=r.signature,u=r.timestamp,a=r.expires,s="https://".concat(t.player_url,"/live/").concat(t.video.id),c="?signature=".concat(o,"&time=").concat(u,"&expires=").concat(a,"&cdn=").concat(e);return"".concat(s).concat(n).concat(c)}var wu=In(Object.keys,Object),gu=Object.prototype.hasOwnProperty;function yu(t){if(!Ln(t))return wu(t);var n=[];for(var i in Object(t))gu.call(t,i)&&"constructor"!=i&&n.push(i);return n}var _u=Xt(It,"DataView"),ku=Xt(It,"Promise"),Eu=Xt(It,"Set"),Tu=Xt(It,"WeakMap"),Su=Wt(_u),Au=Wt(sn),xu=Wt(ku),Cu=Wt(Eu),Mu=Wt(Tu),Iu=Ut;(_u&&"[object DataView]"!=Iu(new _u(new ArrayBuffer(1)))||sn&&"[object Map]"!=Iu(new sn)||ku&&"[object Promise]"!=Iu(ku.resolve())||Eu&&"[object Set]"!=Iu(new Eu)||Tu&&"[object WeakMap]"!=Iu(new Tu))&&(Iu=function(t){var n=Ut(t),i="[object Object]"==n?t.constructor:void 0,e=i?Wt(i):"";if(e)switch(e){case Su:return"[object DataView]";case Au:return"[object Map]";case xu:return"[object Promise]";case Cu:return"[object Set]";case Mu:return"[object WeakMap]"}return n});var Ru=Iu,Ou=Object.prototype.hasOwnProperty;function Lu(t){if(null==t)return!0;if(qn(t)&&(Bn(t)||"string"==typeof t||"function"==typeof t.splice||Yn(t)||ai(t)||Vn(t)))return!t.length;var n=Ru(t);if("[object Map]"==n||"[object Set]"==n)return!t.size;if(Ln(t))return!yu(t).length;for(var i in t)if(Ou.call(t,i))return!1;return!0}function Du(t){return qn(t)?pi(t):yu(t)}function ju(){return[]}var Nu=Object.prototype.propertyIsEnumerable,Pu=Object.getOwnPropertySymbols,Uu=Pu?function(t){return null==t?[]:(t=Object(t),function(t,n){for(var i=-1,e=null==t?0:t.length,r=0,o=[];++i=n?t:n)),t}(Mo(t),n,i)}function va(t){return t.quality||t.metadata.quality}function pa(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e=t.url;if("avc_url"in t&&(e=t.avc_url),i)return e;var r=n?Yi.spatialHEVC&&Yi.hevc:Yi.hevc,o=n?Yi.spatialHEVC&&Yi.hdr:Yi.hdr,u=Yi.dolbyVision;return u&&"hevc_dvh1_url"in t?e=t.hevc_dvh1_url:o&&"hevc_hdr_url"in t?e=t.hevc_hdr_url:r&&"hevc_sdr_url"in t?e=t.hevc_sdr_url:Yi.av1&&"av1_url"in t&&(e=t.av1_url),e}function ma(t){return t.fallback_url}function ba(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.request.files,e=i.hls.default_cdn,r=t.request.drm,o=i.hls.cdns[e],u=n?ma(o):pa(o,t.video.spatial,r);return{id:"hls-".concat(e,"-").concat(t.video.id),src:u,mime:cu.hls,priority:2,metadata:{cdn:e,origin:i.hls.cdns[e].origin,quality:"sd"}}}function wa(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.request.files;return Lu(i.dash)?[]:Object.keys(i.dash.cdns).map((function(e){var r=i.dash.cdns[e],o=n?ma(r):pa(r,t.video.spatial);return{id:"dash-".concat(e,"-").concat(t.video.id),src:o,mime:t.request.drm?cu.dashMpd:cu.dash,priority:e===i.dash.default_cdn?1:2,metadata:{cdn:e,origin:i.dash.cdns[e].origin,quality:"sd"}}}))}function ga(t){if(Lu(t.progressive))return[];var n=t.progressive;return"progressive_avc"in t&&(n=t.progressive_avc),n.filter(_a(n))}function ya(t){if("number"==typeof t)return t;var n=t.split("-");return 5===n.length?n[0]:parseInt(n[0],10)}function _a(t){var n=t.filter(ka).map(va);return function(t){return-1===n.indexOf(va(t))||ka(t)}}function ka(t){var n=t.fps;return"metadata"in t&&(n=t.metadata.fps),n>30}function Ea(t){return Ta(t)>=720}function Ta(t){return"string"!=typeof t&&(t=va(t)),parseInt(t,10)}function Sa(t){var n=ga(t.request.files).map((function(t){return t.quality}));return Aa(t,t.embed.quality,n)}function Aa(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t.embed.on_site||Yi.android||Yi.iOS||Yi.windowsPhone||!n||i.length&&-1===i.indexOf(n)?null:n}function xa(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"desc";return function(n,i){var e=Ta(n),r=Ca(n),o=Ta(i),u=Ca(i);return"asc"===t?e-o||r-u:o-e||u-r}}function Ca(t){return"object"!==V(t)?0:"fps"in t?t.fps:"metadata"in t&&"fps"in t.metadata?t.metadata.fps:0}function Ma(t){var n=t.video.live_event,i=t.request.files;if(!Lu(i.hls)){var e,r=i.hls.default_cdn,o=i.hls.cdns[r].json_url||(null==(e=n.playback)?void 0:e.hls_noredirect),u=t.request.flags.live_dash?2:1;return{id:"hls-".concat(r,"-").concat(t.video.id),src:o,mime:cu.hlsLive,priority:u,metadata:{cdn:r,origin:i.hls.cdns[r].origin,quality:"sd"}}}return null}function Ia(t,n){var i=[];if(n.video){var e=n.video.currentFile.mime;if(e===cu.hlsLive)return n.manifest.video.map((function(t){return z(z({},t),{},{quality:"".concat(t.height,"p")})}));if([cu.dash,cu.dashMpd].includes(e)){var r=n.video.drmHandler&&"sd-fallback"===n.video.drmHandler.state;i=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return[];var e=t.streams;"streams_avc"in t&&(e=t.streams_avc);var r=n?Yi.spatialHEVC&&Yi.hevc:Yi.hevc,o=n?Yi.spatialHEVC&&Yi.hdr:Yi.hdr;return o&&"streams_hevc_hdr"in t?e=t.streams_hevc_hdr:r&&"streams_hevc_sdr"in t?e=t.streams_hevc_sdr:Yi.av1&&"streams_av1"in t&&(e=t.streams_av1),i&&"streams_fallback"in t&&(e=t.streams_fallback),e}(t.request.files.dash,t.video.spatial,r)}else i=n.video.files.filter((function(t){return"progressive"===lu[t.mime]}))}return i.filter(_a(i)).sort(xa())}function Ra(t){var n=va(t),i={"1440p":"2K","2160p":"4K","2700p":"5K","3240p":"6K","3780p":"7K","4320p":"8K"};for(var e in i)n=n.replace(e,i[e]);return n}function Oa(t){return Yi.spatialPlayback&&t.video.spatial?35:50}function La(t){return t.request.text_tracks.map((function(t){return{id:t.id,src:t.url,kind:t.kind,label:t.label,language:t.lang}}))}var Da={captureException:function(t){},captureMessage:function(t){},captureBreadcrumb:function(){}},ja=Da,Na=function(t){ja=Object.assign({},Da,t)},Pa=function(t,n){return ja.captureException(t,n)},Ua=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"backbone",e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"info";return ja.captureBreadcrumb(t,n,i,e)};function Fa(t,n,i){var e=t.embed.playsinline&&(Yi.mobileAndroid||Yi.iOS>=10),r=!1,o=!1,u=!1,a=!0,s="auto";function c(t){if(!a&&i.buffered&&i.buffered.length>0){t=t||i.currentTime;var e=function(t,n){var i=t.length-1;if(t.length>1)for(var e=0,r=t.length;e=n){i=e;break}return i}(i.buffered,t),o=i.buffered.end(e),s=o/i.duration,c=i.duration;if(n.fire(Ti.PROGRESS,{loaded:o,duration:c,loadProgress:s}),u&&r&&o===i.duration)return void(r&&i.paused&&i.play().catch(Pa))}}function l(n){if("auto"!==n){var e=Ia(t,i).reverse().map((function(t){return t.quality})).indexOf(n);-1!==e&&(Ua("Switched to ".concat(n),{},"video"),i.video.currentFile.restrictedStreamIndexes=[e])}else i.video.currentFile.restrictedStreamIndexes=[]}function f(e){var r=Ia(t,i).map((function(t){return t.quality})),o=Aa(t,t.embed.quality,r);o&&n.fire(Qo,o),l(o||"auto")}return n.on($o,(function(){var n;i.playsinline=e,i.muted=t.embed.muted,i.disablePictureInPicture=!t.embed.pip,i.autoPictureInPicture=t.embed.autopip,i.lowLatencyMode=null==(n=t.video.live_event)?void 0:n.low_latency})),n.on(Ho,(function(){a=!0,i.paused||i.pause(),o=!1,r=!1,setTimeout((function(){i.currentTime=0}),300)})),i.on(Ti.PLAY,(function(){a=!1,n.fire(Ti.PLAY,i.currentTime)})),i.on(Ti.PAUSE,(function(){r=!1,n.fire(Ti.PAUSE,i.currentTime,i.ended)})),i.on(Ti.PLAYING,(function(t){c()})),i.on(Ti.TIME_UPDATE,(function(t){var e=i.currentTime;if(!a){var r=i.duration,o=e/r,u=i.playbackRate;n.fire(Ti.TIME_UPDATE,{currentTime:e,duration:r,timeProgress:o,playbackRate:u})}})),i.on(Ti.ENDED,(function(t){i.loop?i.play().catch(Pa):(r=!1,n.fire(Ti.ENDED,t))})),i.on(Ti.LOADED_METADATA,(function(n){var e=i.duration;if(isFinite(e)&&e>0){if(et.video.duration+1)return;t.video.duration=e}t.video.video_width=i.videoWidth,t.video.video_height=i.videoHeight})),i.on(Ti.DURATION_CHANGE,(function(n){var e=i.duration;isFinite(e)&&(t.video.duration>0&&(et.video.duration+1)||(t.video.duration=e))})),i.on(Ti.PROGRESS,c),i.on(xi.BUFFER_STARTED,(function(){u=!0})),i.on(xi.BUFFER_ENDED,(function(){u=!1})),n.on(Bo,(function(n,e){e||(e=(i.duration||t.video.duration)*da(n,0,1)),e=da(e,0,i.duration||t.video.duration),i.currentTime=e})),i.on(Ti.SEEKING,(function(){var t=i.currentTime,e=i.duration,r=t/e;n.fire(Ti.SEEKING,{currentTime:t,duration:e,timeProgress:r})})),i.on(Ti.SEEKED,(function(){c();var t=i.currentTime,e=i.duration,r=t/e;n.fire(Ti.SEEKED,{currentTime:t,duration:e,timeProgress:r})})),i.on(xi.CURRENT_FILE_CHANGE,(function(e){Ua("Current file changed",{id:e.id,mime:e.mime,src:e.src,metadata:e.metadata},"video"),e.metadata.quality,[cu.dash,cu.dashMpd].includes(e.mime)&&f(),[cu.hlsLive].includes(e.mime)?i.once(xi.STREAMS_LOADED,(function(){f()})):function(i){var e=Sa(t);e&&n.fire(Qo,e)}()})),{play:function(){return r=!0,o||(n.fire(Xo),o=!0),i.play()},pause:function(){r=!1,i.pause()},get quality(){return s},set quality(e){!function(e){var r=i.video.currentFile.mime;if([cu.dash,cu.dashMpd,cu.hlsLive].includes(r))l(e);else{var o=Ia(t,i).filter((function(t){return t.metadata.quality===e}));o.length>0&&(a=!0,i.video.currentFile=o[0])}s=e,n.fire(Zo,e)}(e)}}}function Va(t,n,i){var e=!1,r=i.presentationMode;function o(){!i.supportsPresentationMode("picture-in-picture")||Yi.spatialPlayback&&t.video.spatial?n.fire(ru):n.fire(eu)}i.on(Ti.LOADED_METADATA,(function(){e=!0})),i.on(Ti.PLAY,(function(){e?o():i.once(Ti.LOADED_METADATA,o)})),i.on(xi.PRESENTATION_MODE_CHANGE,(function(t){"inline"===r&&"picture-in-picture"===t&&n.fire(ou),"picture-in-picture"===r&&"inline"===t&&n.fire(uu),r=t,i.video.textTracks.forEach((function(n){"picture-in-picture"===t&&"hidden"===n.mode&&(n.mode="showing"),"inline"===t&&"showing"===n.mode&&(n.mode="hidden")}))})),n.on(Go,(function(){i.supportsPresentationMode("picture-in-picture")&&(i.presentationMode="picture-in-picture")})),n.on(Yo,(function(){i.supportsPresentationMode("picture-in-picture")&&(i.presentationMode="inline")}))}function Ba(t,n,i){var e=null;Yi.spatialPlayback&&(n.on($o,(function(){e&&(i.deactivateEffect(ko),e=null,n.fire(iu,e));var r=t.video.spatial;r&&(t.request.drm||i.supportsEffect(ko)&&(e=i.activateEffect(ko,{threeUrl:t.request.urls.three_js,fps:t.video.fps,fieldOfView:r.fov,directorTimeline:r.director_timeline,projection:r.projection,stereoMode:r.stereo_mode,initialView:r.initial_view,isMobile:Yi.android,dimensions:t.embed.on_site?{width:1080,height:540}:{width:640,height:360},keyboardDisabled:!t.embed.keyboard}),n.fire(iu,e)))})),i.on(Mi.SPATIAL_UNSUPPORTED,(function(){e&&(i.deactivateEffect(ko),e=null,n.fire(iu,e))})))}function Ha(t,n,i){var e=null;n.on($o,(function(){e&&(i.deactivateEffect(bo),e=null),t.video.canvas&&(t.request.drm||i.supportsEffect(bo)&&(e=i.activateEffect(bo)))}))}var qa=yi((function(t,n,i){wi(t,n,i)}));function Wa(t,n,i){return i?n?n(t):t:(t&&t.then||(t=r.resolve(t)),n?t.then(n):t)}var za=function(){function t(t,n,i){rt(this),this.vs=ta(t),this.ps=t.session_url||t.sessionUrl,this.ms=n,this.bs=i,this.ws=!1,this.ys=!1,this._s()}var n=t.prototype;return n.disable=function(){this.ys=!0},n.forcePolling=function(){this.isForcePolling||(this.ws=!0,this._s())},n.unforcePolling=function(){this.ws=!1},n._s=function(){!1!==this.vs.polling&&(this.ks()?this.Es():this.Ts()&&this.Ss())},n.Ts=function(){var t;return!(pu(this.vs)&&"started"!==(null==(t=this.vs.archive)?void 0:t.status)||!this.isForcePolling&&vu(this.vs))},n.ks=function(){return!this.ps||!(!du(this.vs)||null!==this.vs.id)},n.As=function(){try{var t=this;return Wa(tr(t.ms).json(),(function(n){return t.ps=n.url,n.url}))}catch(t){return r.reject(t)}},n.Ss=function(){try{var t=this;if(t.ys)return;var n,i={};return Yi.browser.ie&&(i={Pragma:"no-cache","Cache-Control":"no-cache"}),function(t,n){return t&&t.then?t.then(n):n()}(function(e,r){try{var o=Wa(tr({url:t.ps,retry:3,retryStatus:function(t){return[410].includes(t)||Le.retryStatus(t)},hooks:{beforeRetry:[t.Zt.bind(t)]},headers:i}).json(),(function(t){n=t}))}catch(t){return r()}return o&&o.then?o.then(void 0,r):o}(0,(function(){throw new Error("Hit max retries polling ".concat(t.ps))})),(function(i){if(n.status!==t.vs.status){var e;if(pu(n)&&"provision_expire"===n.terminate_reason)return t.ps=null,t.vs.id=null,void setTimeout(t._s.bind(t),5e3);var r=(q(e={},"active",fu.EVENT_ACTIVE),q(e,"pending",fu.EVENT_PENDING),q(e,"started",fu.EVENT_STARTED),q(e,"ended",fu.EVENT_ENDED),e)[n.status];try{t.fire(r,n)}catch(t){throw new Error("Error firing live event status change ".concat(t))}}if(n.archive&&(!t.vs.archive||n.archive.status!==t.vs.archive.status)){var o,u=(q(o={},"started",fu.ARCHIVE_STARTED),q(o,"done",fu.ARCHIVE_DONE),q(o,"error",fu.ARCHIVE_ERROR),o)[n.archive.status];t.fire(u,n)}t.vs=qa(t.vs,n),t.Ts()&&setTimeout(t.Ss.bind(t),5e3)}))}catch(t){return r.reject(t)}},n.Zt=function(t,n){try{return Wa(this.As(),(function(n){t.url=n}))}catch(t){return r.reject(t)}},n.Es=function(){try{var t=this;if(t.ys)return;return Wa(tr(t.bs).json(),(function(n){var i=!1;return function(e,r){var o=function(){if(null!==n.ingest.session_id)return t.vs.id=n.ingest.session_id,Wa(t.As(),(function(){t.Ss(),i=!0}))}();return o&&o.then?o.then(r):r(o)}(0,(function(n){if(i)return n;setTimeout(t.Es.bind(t),5e3)}))}))}catch(t){return r.reject(t)}},H(t,[{key:"isForcePolling",get:function(){return this.ws}}]),t}();function Ga(t,n,i){return i?n?n(t):t:(t&&t.then||(t=r.resolve(t)),n?t.then(n):t)}function Ya(t){return function(){for(var n=[],i=0;i12&&i.latency>10&&l&&(n.fire(fu.LOW_LATENCY_FALLBACK,{msg:"Rebuffer ratio > 12% and latency > 10s, fallback to normal HLS w/ target latency of 12s."}),i.lowLatencyMode=!1,i.presentationDelay=12,i.bufferTarget=12)}(h/f*100),e=bt()}),500)}()))})),n.on(qo,(function(){o&&(o.destroy(),o=null),d()})),i.on(fu.STREAM_ONLINE,(function(){r.isForcePolling&&r.unforcePolling()})),i.on(fu.STREAM_OFFLINE,(function(){r.isForcePolling||r.forcePolling()})),i.on(xi.BUFFER_STARTED,(function(){l=!0})),i.on(xi.BUFFER_ENDED,(function(){l=!1})),{get p2pReady(){return u}}}function Ja(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t||"null"===t||0===n.length)return{track:null};var i=t.split("."),e=Q(i,2),r=e[0],o=e[1],u=r.split(/[-_]/),a=Q(u,1),s=a[0],c=r!==s,l=n.filter((function(t){return c&&t.language===r||t.language===s})).sort((function(t,n){var i=2*(t.language===s&&t.kind===o)+2*(t.language===r)+1*(t.kind===o);return 2*(n.language===s&&n.kind===o)+2*(n.language===r)+1*(n.kind===o)-i}));return l.length>0?{track:l[0],exactMatch:l[0].language===r&&l[0].kind===o}:{track:null}}function $a(t,n,i){var e;function r(){if(0!==n.video.textTracks.length){if(n.video.textTracks.forEach((function(t){t.on("cuechange",o),t.on("modechange",u)})),n.video.textTracks.language&&Q(n.video.textTracks.language.split(/[-_]/),1)[0]!=Q(n.video.textTracks.language.split(/[-_]/),1)[0]){var i="".concat(n.video.textTracks.language,".subtitles");if(Ja(i,n.video.textTracks).track)return void t.fire(Wo,i)}t.fire(zo)}else t.fire(zo)}function o(n){for(var i,e=n.target,r=e.activeCues,o=[],u=0,a=r.length;u"),text:r[u].text}));t.fire(tu,e,o)}function u(n){var e=n.target,r=i.querySelector("video");Yi.iOS&&function(t){var n=[document.fullscreenElement,document.webkitFullscreenElement,document.webkitCurrentFullScreenElement,document.mozFullScreenElement,document.msFullscreenElement].find((function(t){return void 0!==t}));return void 0!==n?!!n:t.webkitDisplayingFullscreen}(r)&&"showing"===e.mode&&t.fire(nu,e)}t.on($o,r),t.on(Wo,(function(i){if(!e||e.id!==i){var r=n.video.textTracks.getTrackById(i),o=!0;if(!r){var u=Ja(i,n.video.textTracks);r=u.track,o=u.exactMatch}r!==e&&setTimeout((function(){n.video&&n.video.textTracks.forEach((function(t){t.mode=t===r?"hidden":"disabled"})),t.fire(nu,r,!o),e=r}),0)}})),t.on(zo,(function(){setTimeout((function(){n.video&&n.video.textTracks.forEach((function(t){t.mode="disabled"})),t.fire(tu),e&&(e=null,t.fire(nu,null))}),0)})),t.on(xi.TEXT_TRACKS_AVAILABLE,r)}function Xa(t,n,i){var e,r,o;function u(t,n){t.forEach((function(t){var n=e.video.files.getFileById(t.id);n&&n.src!==t.src&&(n.src=t.src)})),n.forEach((function(t){var n=e.video.textTracks.getTrackById(t.id);n&&n.src!==t.src&&(n.src=t.src)}))}return function(){var n;e=new mo(i,[Or,Jr,Qr,Me],{externalDisplays:[AirPlayExternalDisplay],mediaSourceScanner:{droppedFrameSwitchPercent:Oa(t)},tests:t.request.ab_tests,fileCodecs:t.request.file_codecs,bufferTarget:t.video.buffer_target,presentationDelay:t.video.presentation_delay,lowLatencyMode:null==(n=t.video.live_event)?void 0:n.low_latency})}(),Object.values(Ti).filter((function(t){return![Ti.TIME_UPDATE,Ti.PROGRESS,Ti.SUSPEND,Ti.ERROR].includes(t)})).forEach((function(t){e.on(t,(function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Ua(t,n,"video event")}))})),e.on(xi.STREAMS_LOADED,(function(n){n.video.forEach((function(n){var i=function(t,n){return n.find((function(n){return ya(n.id)===String(t)||ya(n.id)===ya(t)}))}(n.id,Ia(t,e));i?(n.profile=i.profile,n.quality=i.quality,n.fps=i.fps):(n.profile=null,n.quality="".concat(n.height,"p"),n.fps=n.framerate)}))})),e.on(xi.STREAM_CHANGE,(function(t){var i=t.index,e=t.streams,r=e[i];Ua("Stream changed",r,"video"),n.fire(xi.STREAM_CHANGE,r,i,e)})),e.on(xi.STREAM_TARGET_CHANGE,(function(t){var i=t.index,e=t.streams,r=e[i];n.fire(xi.STREAM_TARGET_CHANGE,r,i,e)})),e.on(xi.DRM_KEY_SWITCH,(function(){if(t.request.drm.fallback_asset){var n=La(t);u(function(t){var n=t.request.files,i=[],e=t.request.drm&&Yi.browser.safari;return(n.hls&&(Yi.iPhone||Yi.iPad)||e)&&(i=i.concat(ba(t,!0))),n.dash&&!e&&(i=i.concat(wa(t,!0))),i}(t),n)}})),function(t,n,i){i.forEach((function(i){t(i,(function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&Yi.dolbyVision;return(r.hls&&(Yi.iPhone||Yi.iPad)||c||l)&&(s=s.concat(ba(t))),!r.dash||c||l||(s=s.concat(wa(t))),s}(t),s=La(t);!e.video||t.isNewVideo()?function(r,u){var a=t.video.live_event,s=i.getBoundingClientRect(),c=vu(a)?Ma(t):function(t){var n=t.request.files;if(!Lu(n.hls)){var i=n.hls.default_cdn,e=n.hls.cdns[i],r=e.captions||e.url;return r?{src:r,mime:cu.hls,metadata:{cdn:i,origin:e.origin,quality:"sd"}}:null}return null}(t);e.video={id:t.video.id,title:t.video.title,subtitle:"from ".concat(t.video.owner.name),files:r,textTracks:u,chapters:ha(t,"embed.chapters",[]),duration:t.video.duration,externalDisplayFiles:{AirPlay:c},metadata:{playlistRefreshUrl:mu(t),thumbnail:t.video.thumbs[640],useHls:t.request.drm&&Yi.browser.safari,drm:t.request.drm,p2pReady:t.video.p2p&&o.p2pReady,percentShown:ko.frustumSurfaceArea(t.video.spatial.fov,s.width,s.height)}},n.fire($o)}(a,s):u(a,s)}})),st({telecine:e},r)}function Za(t,n,i){this.constructorName="BackboneError",this.message=t,this.name=n,this.source=i}Za.prototype=new Error;var Qa={embed:{},request:{cookie:{},files:{},flags:{},urls:{},text_tracks:[],file_codecs:{}},video:{owner:{},thumbs:{},version:{}},user:{}};function ts(t,n){var i,e,r,o=rt(),u=null,a=new ia(n,Qa);function s(t){return o.fire(Ko,t),t}var c={play:function(){return e.play()},pause:function(){return e.pause()},get currentTime(){return r.currentTime>.1?Uo(r.currentTime):0},set currentTime(t){if(t=parseFloat(t),isNaN(t)||t<0)throw new Za("Seconds must be a positive number less than the duration of the video.","RangeError","setCurrentTime");o.fire(Bo,null,t)},get duration(){return Uo(a.video.duration)},get enabledTextTrack(){return u},loadVideo:function(t){return a.reset(t),a=s(a),this},reactivate:function(){var t;return(null==(t=r)?void 0:t.reactivate)&&r.reactivate(),this},unload:function(){return o.fire(Ho),this},destroy:function(){return o.fire(qo),this},on:function(t,n){return o.on(t,n),this},once:function(t,n){return o.once(t,n),this},off:function(t,n){return o.off(t,n),this},hasTextTrack:function(t){var n,i,e=this.textTracks;if(Po(t))i=e.getTrackById(t);else{var r=t.split(".")[0];n=e.some((function(t){return t.language.toLowerCase()===r.toLowerCase()}))}return!(!i&&!n)},enableTextTrack:function(t){var n,i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=this.textTracks;if(Po(t))u=a.getTrackById(t);else{var s=t.split("."),c=Q(s,2);n=c[0];var l=c[1];if(i=void 0===l?e:l,!this.hasTextTrack(t))throw new Za("There are no tracks for “".concat(n.toUpperCase(),"”."),"InvalidTrackLanguageError","enableTextTrack");var f=i?"".concat(n,".").concat(i):n;u=Ja(f,a).track}if(!u||i&&u.kind!==i)throw new Za("There are no ".concat(i," tracks for “").concat(n.toUpperCase(),"”."),"InvalidTrackError","enableTextTrack");r.va(!0),o.fire(Wo,u.id)},disableTextTrack:function(){u=null,r.va(!1),o.fire(zo)},get qualities(){return function(t){var n,i=t.representations.map((function(n){var i=va(n);return{id:i,label:Ra(n),active:t.quality===i}})),e=null==(n=t.video)?void 0:n.currentFile.mime;return[cu.dash,cu.dashMpd,cu.hlsLive].includes(e)&&i.unshift({id:"auto",label:"Auto",active:!t.quality||"auto"===t.quality}),i}(this)},get quality(){return e.quality},set quality(t){e.quality=t},get playbackRate(){return r?r.playbackRate:1},set playbackRate(t){r.playbackRate=t,r.defaultPlaybackRate=t},get presentationMode(){return r.presentationMode},set presentationMode(t){"picture-in-picture"===t?o.fire(Go):o.fire(Yo)},get textTracks(){return r.video?r.video.textTracks:[]},get representations(){return Ia(a,r)},get volume(){return r?r.volume:Uo(a.request.cookie.volume)},set volume(t){if(t=parseFloat(t),isNaN(t)||t<0||t>1)throw new Za("Volume should be a number between 0 and 1.","RangeError","setVolume");r.volume=t},get videoId(){return a.video.id},get videoWidth(){return r.videoWidth||a.video.width},get videoHeight(){return r.videoHeight||a.video.height},get readyState(){return r.videoElement.readyState},get telecine(){return r}};return a=s(a),e=new Xa(a,o,t),r=e.telecine,i=Object.create(r),st(i,c)}var ns="object"==typeof global&&global&&global.Object===Object&&global,is="object"==typeof self&&self&&self.Object===Object&&self,es=(ns||is||Function("return this")()).Symbol,rs=Object.prototype,os=rs.hasOwnProperty,us=rs.toString,as=es?es.toStringTag:void 0,ss=Object.prototype.toString,cs=es?es.toStringTag:void 0;var ls=function(t,n){return function(i){return t(n(i))}}(Object.getPrototypeOf,Object),fs=Function.prototype,hs=Object.prototype,ds=fs.toString,vs=hs.hasOwnProperty,ps=ds.call(Object),ms=function(t){var n,i=("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()).Symbol;return"function"==typeof i?i.observable?n=i.observable:(n=i("observable"),i.observable=n):n="@@observable",n}();function bs(t,n,i){var e;if("function"==typeof n&&void 0===i&&(i=n,n=void 0),void 0!==i){if("function"!=typeof i)throw new Error("Expected the enhancer to be a function.");return i(bs)(t,n)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var r=t,o=n,u=[],a=u,s=!1;function c(){a===u&&(a=u.slice())}function l(){return o}function f(t){if("function"!=typeof t)throw new Error("Expected listener to be a function.");var n=!0;return c(),a.push(t),function(){if(n){n=!1,c();var i=a.indexOf(t);a.splice(i,1)}}}function h(t){if(!function(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||"[object Object]"!=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":cs&&cs in Object(t)?function(t){var n=os.call(t,as),i=t[as];try{t[as]=void 0;var e=!0}catch(t){}var r=us.call(t);return e&&(n?t[as]=i:delete t[as]),r}(t):function(t){return ss.call(t)}(t)}(t))return!1;var n=ls(t);if(null===n)return!0;var i=vs.call(n,"constructor")&&n.constructor;return"function"==typeof i&&i instanceof i&&ds.call(i)==ps}(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,o=r(o,t)}finally{s=!1}for(var n=u=a,i=0;i0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((null==(t=_s.en)?void 0:t[n])&&(n=_s.en[n]),Object.keys(i).forEach((function(t){n=n.replace(new RegExp("{".concat(t,"}"),"g"),i[t])})),n.match(/\{\w+}/))throw new Error("Missing token definition.");return n}function Es(t){return!isNaN(t)&&parseInt(Number(t),10)==t&&!isNaN(parseInt(t,10))}var Ts=function(t){for(var n=this,i=function i(e){return e.length>=t.length?t.apply(n,e):function(){for(var t=arguments.length,n=new Array(t),r=0;r1?e-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:[];return{get:function(n){return n?t.find(Ts(n)):t},insert:function(n){return(t=t.concat(n)).slice(-1).pop()},getOrInsert:function(t){return this.get(t)||this.insert(t)},remove:function(n){return t.splice(t.findIndex(Ts(n)),1).pop()}}};function As(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document.styleSheets[0];try{i.insertRule?i.insertRule(t+"{"+n+"}",(i.cssRules||i.rules).length):i.addRule(t,n)}catch(t){}}function xs(t){if(t&&t.detail>0)try{document.activeElement.blur()}catch(t){}}function Cs(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{t.blur()}catch(t){n&&n(t)}}function Ms(t){var n=t.getBoundingClientRect();return document.msFullscreenElement&&window.parent!==window&&t.offsetWidth0&&c0&&li?i:n>t?n:t}function Ls(t,n,i){var e=i.width,r=i.height,o=i.scrollbars,u=void 0===o?"yes":o,a=i.resizable,s=void 0===a?"yes":a,c=i.toolbar,l=void 0===c?"no":c,f=(window.screenY||window.screenTop||0)+window.outerHeight/2-r/2,h=(window.screenX||window.screenLeft||0)+window.outerWidth/2-e/2;window.chrome&&-1!==window.navigator.userAgent.toLowerCase().indexOf("mac os x")&&(r+=27),window.safari&&(r+=47);var d="scrollbars=".concat(u,",resizable=").concat(s,",toolbar=").concat(l);return window.open(t,n,"width=".concat(e,",height=").concat(r,",left=").concat(h,",top=").concat(f,",").concat(d))}function Ds(t){return function(t){return/^(https?:)?\/\/(.+)\.vimeo(ws)?\.(com|dev)(?=$|\/)/.test(t)}(t)?Is(t):""}function js(t,n,i){if(function(t){return/^(https?:)?\/\/(.+)\.vimeo(ws)?\.(com|dev)\/video\/\d+\/config(?=$|\?)/.test(t)}(n))return n;var e=function(t){if(Es(t))return parseInt(t,10);var n=t.match(/(video|\.com|\.dev)\/(\d+)/);if(!n||n.length<3)throw new Error("Please provide a Vimeo URL with a valid clip id.");return parseInt(n[2],10)}(n),r=gt(window.location.search),o=gt("".concat(n).split("?")[1]),u=Object.assign(r,o,i);return _t("".concat(t,"/video/").concat(e,"/config"),u)}function Ns(t){for(var n,i,e=(t||document).querySelectorAll("[tabindex]"),r=[],o=0,u=0,a=e.length;u0&&"none"!==i.display&&i.opacity>0&&"hidden"!==i.visibility&&(r[o++]=n);var s=r.shift();s&&(s.focus(),s.blur())}function Ps(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(t=parseFloat(t),isNaN(t))return 0;var i=Math.pow(10,n);return Math.round(t*i)/i}function Us(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^16*Math.random()>>t/4).toString(16)}))}function Fs(t,n){return-1!==F(n).indexOf(t)}function Vs(t){return t?F(t.parentNode.children).indexOf(t):-1}var Bs=function(){for(var t=arguments.length,n=new Array(t),i=0;i0&&void 0!==arguments[0]?arguments[0]:"p",n=++Gs;return"".concat(t).concat(n)}function Ks(t){var n=t;return!t||t instanceof Error||(n=new Error(t.message||t),t.name&&(n.name=t.name)),n}var Js={Cs:Ys(),Ms:Ys(),Is:Ys(),Rs:Ys()},$s={VIDEO_TITLE:"video-title",VIDEO_BYLINE:"video-byline",VIDEO_PORTRAIT:"video-portrait"},Xs="application/vnd.vimeo.dash+json",Zs={Os:Ys(),Ls:Ys(),Ds:Ys(),_hideOverlay:Ys(),_showOverlay:Ys(),Ns:Ys(),_updateEmailCapture:Ys(),_updateWebinarStartTime:Ys(),Ps:Ys(),Us:Ys(),Fs:Ys(),Vs:Ys(),Bs:Ys(),Hs:Ys(),qs:Ys(),Ws:Ys(),zs:Ys(),Gs:Ys(),Ys:Ys(),Ks:Ys(),Js:Ys(),$s:Ys(),Xs:Ys(),Zs:Ys(),_hideOutro:Ys(),Qs:Ys(),_overrideControlbarBehavior:Ys(),tc:Ys(),nc:Ys(),ic:Ys(),ec:Ys(),rc:Ys(),oc:Ys(),_addCard:Ys(),_removeCard:Ys(),uc:Ys(),ac:Ys()},Qs={will:"willLikeVideo",did:"didLikeVideo"},tc={will:"willUnlikeVideo",did:"didUnlikeVideo"},nc={will:"willAddToWatchLater",did:"didAddToWatchLater"},ic={will:"willRemoveFromWatchLater",did:"didRemoveFromWatchLater"},ec={will:"willOpenVodPurchaseForm",did:"didOpenVodPurchaseForm"},rc={will:"willOpenShareOverlay",did:"didOpenShareOverlay"},oc={will:"willOpenLoginForm",did:"didOpenLoginForm"},uc={will:"willOpenCollectionsOverlay",did:"didOpenCollectionsOverlay"},ac={will:"willShowOutro",did:"didShowOutro"},sc={will:"willSendPlayLog",did:"didSendPlayLog"},cc={sc:Ys(),cc:Ys(),lc:Ys(),fc:Ys(),ir:Ys(),hc:Ys(),dc:Ys(),vc:Ys(),pc:Ys(),mc:Ys(),bc:Ys(),wc:Ys(),gc:Ys(),yc:Ys(),_c:Ys(),kc:Ys(),Ec:Ys(),Tc:Ys(),Sc:Ys(),Ac:Ys(),xc:Ys(),Cc:Ys(),Mc:Ys(),Ic:Ys(),Rc:Ys(),Oc:Ys(),Lc:Ys(),Dc:Ys(),jc:Ys(),Nc:Ys(),Pc:Ys(),Uc:Ys(),Fc:Ys(),Vc:Ys(),Bc:Ys(),Hc:Ys(),qc:Ys(),Wc:Ys(),zc:Ys(),Gc:Ys(),Yc:Ys(),Kc:Ys(),Jc:Ys(),$c:Ys(),Xc:Ys(),Zc:Ys(),Qc:Ys(),tl:Ys(),nl:Ys(),il:Ys(),el:Ys(),rl:Ys(),ol:Ys(),ul:Ys(),al:Ys(),sl:Ys(),cl:Ys(),ll:Ys(),fl:Ys(),hl:Ys(),dl:Ys(),vl:Ys(),pl:Ys(),ml:Ys(),bl:Ys(),wl:Ys(),gl:Ys(),yl:Ys(),_l:Ys(),kl:Ys(),El:Ys(),Tl:Ys(),Sl:Ys(),Al:Ys(),Cl:Ys(),Ml:Ys(),Il:Ys(),Rl:Ys(),Ol:Ys(),Ll:Ys(),Dl:Ys(),jl:Ys(),Nl:Ys(),Pl:Ys(),Ul:Ys(),Fl:Ys(),Vl:Ys(),Bl:Ys(),Hl:Ys(),ql:Ys(),Wl:Ys(),zl:Ys(),Gl:Ys(),Yl:Ys(),Kl:Ys(),Jl:Ys(),$l:Ys(),Xl:Ys(),Zl:Ys(),Ql:Ys(),tf:Ys(),nf:Ys(),if:Ys(),ef:Ys(),rf:Ys(),uf:Ys(),_loadVideo:Ys(),af:Ys(),sf:Ys(),cf:Ys(),lf:Ys(),ff:Ys(),hf:Ys(),df:Ys(),vf:Ys(),pf:Ys(),mf:Ys(),bf:Ys(),wf:Ys(),gf:Ys(),yf:Ys(),_f:Ys(),kf:Ys(),Ef:Ys(),Tf:Ys(),Sf:Ys(),Af:Ys(),ye:Ys(),xf:Ys(),Cf:Ys(),Mf:Ys(),If:Ys(),Rf:Ys(),Of:Ys(),Lf:Ys(),Df:Ys(),jf:Ys(),Nf:Ys(),Pf:Ys(),Uf:Ys(),Ff:Ys(),Vf:Ys(),Bf:Ys(),Hf:Ys(),qf:Ys(),Wf:Ys(),zf:Ys()},lc={Os:Ys(),Gf:Ys(),Yf:Ys(),Kf:Ys()},fc={"application/vnd.apple.mpegurl":"hls","application/vnd.vimeo.dash+json":"dash","video/vnd.mpeg.dash.mpd":"dash","video/mp4":"progressive","video/webm":"progressive","video/x-flv":"progressive","application/x-mpegURL":"hlslive"},hc={AD_STARTED:"adstarted",AD_COMPLETED:"adcompleted",AD_ERROR:"aderror",AD_SKIPPED:"adskipped",AD_ALL_COMPLETED:"adallcompleted",AD_CLICKED:"adclicked",BUFFER_END:"bufferend",BUFFER_START:"bufferstart",CHAPTER_CHANGE:"chapterchange",CHROMECAST_CONNECTED:"chromecastconnected",CONTROL_BAR_VISIBILITY_CHANGED:"controlbarvisibilitychanged",CUE_CHANGE:"cuechange",CUEPOINT:"cuepoint",DURATION_CHANGE:"durationchange",EMAIL_CAPTURE_FAILED:"emailcapturefailed",EMAIL_CAPTURE:"emailcapture",ENDED:"ended",ERROR:"error",FULLSCREENCHANGE:"fullscreenchange",LIVE_EVENT_ENDED:"liveeventended",LIVE_EVENT_STARTED:"liveeventstarted",LIVE_STREAM_OFFLINE:"livestreamoffline",LIVE_STREAM_ONLINE:"livestreamonline",LOADED_DATA:"loadeddata",LOAD_START:"loadstart",LOADED_METADATA:"loadedmetadata",LOADED:"loaded",MOTION_END:"motionend",MOTION_START:"motionstart",CAMERA_CHANGE:"camerachange",WEBVR_HARDWARE_AVAILABLE:"webvrhardwareavailable",ENTER_WEBVR:"enterwebvr",EXIT_WEBVR:"exitwebvr",ENTER_PICTURE_IN_PICTURE:"enterpictureinpicture",LEAVE_PICTURE_IN_PICTURE:"leavepictureinpicture",SPATIAL_UNSUPPORTED:"spatialunsupported",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PLAYBACK_RATE_CHANGE:"playbackratechange",RATE_CHANGE:"ratechange",PROGRESS:"progress",QUALITY_CHANGE:"qualitychange",READY:"ready",RESIZE:"resize",SEEKING:"seeking",SEEKED:"seeked",SPACE_CHANGE:"spacechange",TEXT_TRACK_CHANGE:"texttrackchange",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"},dc={playProgress:"timeupdate",loadProgress:"progress",finish:"ended",seek:"seeked"},vc={MARKER_SEEKED:"seeked",MARKER_ENDED:"ended",MARKER_UPSWITCH:"upswitch",MARKER_DOWNSWITCH:"downswitch",MARKER_SWITCH_COMPLETE:"switchcomplete",MARKER_RESIZE:"resize",MARKER_SCANNER_CHANGE:"scannerchange",MARKER_FILE_CHANGE:"filechange",MARKER_STALLED:"stalled",MARKER_BUFFER_GAP_JUMP:"buffergapjump",MARKER_BUFFER_GAP_JUMP_PREVENT:"buffergapjumpprevent",MARKER_STALL_JUMP:"stalljump"},pc={MARKER_SEEKED:"#0088cc",MARKER_ENDED:"#503873",MARKER_UPSWITCH:"#5a9e02",MARKER_DOWNSWITCH:"#d93636",MARKER_RESIZE:"#FF8A00",MARKER_SCANNER_CHANGE:"#e9ff00",MARKER_FILE_CHANGE:"#b5d3e2",MARKER_STALLED:"#f44283"},mc={NOTHING:"nothing",BEGINNING:"beginning",EMAIL:"email",VOD:"vod",VIDEOS:"videos",LINK:"link",THREEVIDEOS:"threevideos",PROMOTED:"promoted",SHARE:"share"},bc=[{items:[{id:1,label:"Small"},{id:1.5,label:"Medium"},{id:2,label:"Large"}],id:"fontSize",cookie:"font_size",title:"Font size",dispatch:function(t){return{type:"CAPTIONS_SET_FONT_SIZE",payload:t}}},{items:[{id:"helvetica neue, sans-serif",label:"Helvetica Neue"},{id:"arial, sans-serif",label:"Arial"},{id:"verdana, sans-serif",label:"Verdana"},{id:"comic sans ms, sans-serif",label:"Comic Sans MS"}],id:"fontFamily",cookie:"font_family",title:"Font family",dispatch:function(t){return{type:"CAPTIONS_SET_FONT_FAMILY",payload:t}}},{items:[{id:"#fff",label:"White"},{id:"#ff0000",label:"Red"},{id:"#ffff00",label:"Yellow"},{id:"#008000",label:"Green"},{id:"#00adef",label:"Blue"},{id:"#000",label:"Black"}],id:"color",cookie:"color",title:"Font color",dispatch:function(t){return{type:"CAPTIONS_SET_COLOR",payload:t}}},{items:[{id:"default",label:"Default"},{id:"100",label:"100%"},{id:"75",label:"75%"},{id:"50",label:"50%"},{id:"25",label:"25%"},{id:"0",label:"0%"}],id:"bgOpacity",cookie:"bg_opacity",title:"Background opacity",dispatch:function(t){return{type:"CAPTIONS_SET_BACKGROUND_OPACITY",payload:t}}},{items:[{id:"black",label:"Black"},{id:"red",label:"Red"},{id:"yellow",label:"Yellow"},{id:"green",label:"Green"},{id:"blue",label:"Blue"},{id:"white",label:"White"}],id:"bgColor",cookie:"bg_color",title:"Background color",dispatch:function(t){return{type:"CAPTIONS_SET_BACKGROUND_COLOR",payload:t}}},{items:[{id:"none",label:"None"},{id:"shadow",label:"Shadow"},{id:"outline",label:"Outline"}],id:"edgeStyle",cookie:"edge",title:"Edge style",dispatch:function(t){return{type:"CAPTIONS_SET_EDGE_STYLE",payload:t}}}],wc={fontSize:1,fontFamily:"helvetica neue, sans-serif",color:"#fff",bgOpacity:"default",bgColor:"black",edgeStyle:"none"},gc=function(){return{id:"error",title:"Player error",message:"The player is having trouble. We’ll have it back up and running as soon as possible.",modal:!0,final:!0}},yc=Object.freeze({__proto__:null,BrowserNotSupported:function(){return{id:"not-supported",title:"Unsupported viewing environment",message:'Your system is having trouble playing this video. For more information, see our Help Center .',deferred:!0,final:!0}},DRMFailure:function(){return{id:"drm-failure",title:"Rights issue",message:"We’re having trouble authorizing playback for this video. ",final:!0}},FilesNotPlayable:function(){return{id:"not-supported",title:"Player error",message:"The player is having trouble. We’ll have it back up and running as soon as possible.",deferred:!0,final:!0}},MediaSrcNotSupportedError:function(){return{id:"not-supported",final:!1}},MediaDecodeError:function(){return{id:"decode",final:!1}},MediaNetworkError:function(){return{id:"network",title:"Network error",message:'A network hiccup interrupted playback. Please reload the player and try again.',final:!0}},MediaUnknownError:function(){return{id:"unknown",title:"Browser error",message:'We’re having trouble playing this video file. Please reload the player and try again.',final:!0}},FileError:function(){return{id:"telecine-file-error",final:!1}},DownloadError:function(){return{id:"telecine-download-error",final:!1}},MediaUrlExpired:function(){return{id:"media-url-expired",title:"Playback error",message:'We’re having trouble playing this video. Please reload the player and try again.',final:!1}},ScannerError:function(){return{id:"scanner-error",final:!1}},PlayerError:gc});function _c(){return void 0!==window.performance&&"function"==typeof window.performance.now?window.performance.now():Date.now()}function kc(t){return _c()-t}function Ec(){var t=0,n=null,i=0,e=!1;function r(){return t/1e3}return{trackBufferStart:function(t,r){n=_c(),i++,e=!0,t(r)},trackBufferEnd:function(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var o=kc(n);t+=o,r.buffer_duration=o/1e3,e=!1,i(r)}},trackVideoExit:function(i){e&&!i&&(t+=kc(n))},resetLastBufferTime:function(){n=null},getBufferRatio:function(t){var n=r()/t*100;return isNaN(n)?0:Math.round(100*n)/100},getBufferCount:function(){return i},getTotalBufferDuration:r,isVideoBuffering:function(){return e}}}var Tc={VIDEO_BUFFER_END:"video-buffer-end",VIDEO_BUFFER_START:"video-buffer-start",VIDEO_ENDED:"video-ended",VIDEO_EXIT:"video-exit",VIDEO_LOAD_FAILURE:"video-load-failure",VIDEO_MINUTE_WATCHED:"video-minute-watched",VIDEO_PAUSED:"video-paused",VIDEO_PLAYED:"video-played",VIDEO_PLAYBACK_ERROR:"video-playback-error",VIDEO_READY:"video-ready",VIDEO_START_ATTEMPT:"video-start-attempt",VIDEO_START_FAILURE:"video-start-failure",VIDEO_START_TIME:"video-start-time",VIDEO_SEEK:"video-seek",VIDEO_SEEKED:"video-seeked",CHUNK_DOWNLOADED:"chunk_downloaded"};function Sc(t){function n(t,n){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"POST";return new r((function(r,o){"POST"===e&&navigator.sendBeacon?r({status:navigator.sendBeacon(t,n)}):tr({url:t,body:n,method:e,async:i,headers:{"Content-Type":"text/plain; charset=UTF-8"}}).then((function(t){r({response:t,status:t.status})})).catch(o)}))}return{log:function(i){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];r&&(i.event_time=i.event_time||_c());var o=[i];return n(t,JSON.stringify(o),e)},logRequestPromiseWithUrl:n}}function Ac(t){var n=0,i=0,e=0,r=0,o=!1,u=-1,a=null,s=null,c=null,l={satisfied:0,tolerable:0,frustrated:0},f=null;function h(){var n=t.getBoundingClientRect(),i=t.videoWidth,e=t.videoHeight;if(0!==i||0!==e){var r="satisfied";if(n.width>i&&n.height>e&&(i/n.width<.4?r="satisfied":i/n.width<1?r="tolerable":i/n.width>1&&(r="frustrated")),s){var o=kc(s);l[c]+=o}c=r,s=_c()}}function d(){return o?0:1}function v(){return-1===u?null:u>8e3||-1===u?0:u>2e3?.5:1}function p(){return f?(r=e/kc(f),n>=4||r>=.12?0:n<4&&0!==n?r<.12?.5:0:1):null}function m(){if(-1===u)return null;switch(h(),Object.keys(l).reduce((function(t,n){return l[t]>l[n]?t:n}))){case"satisfied":return 1;case"tolerable":return.5;case"frustrated":return 0}return null}return t.addEventListener("playing",(function(){-1===u&&(a=_c())})),t.addEventListener("progress",(function(){-1===u&&(f=_c(),u=kc(a)),h()})),{startupTimeScore:v,rebufferScore:p,failureScore:d,videoQualityScore:m,overallScore:function(){return Math.min(d(),v(),p(),m())},trackBufferStart:function(){-1!==u&&(n++,i=_c())},trackBufferEnd:function(){-1!==u&&(e+=kc(i))},onError:function(t){t.final&&(o=!0)}}}function xc(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(t=parseFloat(t),isNaN(t))return 0;var i=Math.pow(10,n);return Math.round(t*i)/i}function Cc(t,n){var i,e,r,o,u,a,s,c,l,f,h,d,v=0;function p(){i=0,e=0,r=0,o=null,u=0,a=!1,s=!1,c=null,l=!1,f=new Ac(t),h=new Ec,d={bufferTracker:h,videoBufferCheck:function(){setInterval((function(){var n=t.currentTime;s&&!l&&!t.paused&&!d.bufferTracker.isVideoBuffering()&&nr+.125&&(d.bufferTracker.trackBufferEnd(w),d.bufferTracker.resetLastBufferTime()),r=n}),250)},addEventData:function(t){return null},playbackSessionTimer:function(){var n=_c();setInterval((function(){(!t.paused&&a||l||d.bufferTracker.isVideoBuffering())&&(u+=kc(n)/1e3),n=_c()}),500)}}}function m(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};0===v&&(i=Object.assign(i,d.addEventData(t)),n(t,i))}function b(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f.trackBufferStart(),m(Tc.VIDEO_BUFFER_START,t)}function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f.trackBufferEnd(),m(Tc.VIDEO_BUFFER_END,t)}return p(),m(Tc.VIDEO_READY),function(){var n=Math.floor(60*Math.random());setInterval((function(){!t.paused&&a&&(i++,0!==e?i>=60&&(i=0,e++,m(Tc.VIDEO_MINUTE_WATCHED)):i===n&&(i=0,e++,m(Tc.VIDEO_MINUTE_WATCHED)))}),1e3)}(),window.addEventListener("unload",(function(n){d.bufferTracker.trackVideoExit(t.paused);var i={startup:f.startupTimeScore(),rebuffer:f.rebufferScore(),failure:f.failureScore(),quality:f.videoQualityScore(),overall:f.overallScore()};c&&m(Tc.VIDEO_EXIT,{vxs:i},!1)}),!1),t.addEventListener("playing",(function(){a=!0,l||s&&m(Tc.VIDEO_PLAYED)})),t.addEventListener("timeupdate",(function(){if(!s){var t={startup_duration:c?xc(kc(c)/1e3,2):null};m(Tc.VIDEO_START_TIME,t),s=!0}})),t.addEventListener("pause",(function(){a=!1,m(Tc.VIDEO_PAUSED)})),t.addEventListener("seeking",(function(){l||(o=_c(),l=!0,a=!1,m(Tc.VIDEO_SEEK))})),t.addEventListener("seeked",(function(){l=!1,t.paused||(a=!0),m(Tc.VIDEO_SEEKED,{seek_duration:kc(o)/1e3}),o=null})),t.addEventListener("ended",(function(){m(Tc.VIDEO_ENDED)})),t.addEventListener("waiting",(function(){a=!1})),t.addEventListener("canplay",(function(){l||d.bufferTracker.isVideoBuffering()&&!a&&(d.bufferTracker.trackBufferEnd(w),d.bufferTracker.resetLastBufferTime())})),{globalProperties:function(){return{autoplay:t.autoplay,buffer_count:d.bufferTracker.getBufferCount(),total_buffer_duration:d.bufferTracker.getTotalBufferDuration(),buffer_ratio:d.bufferTracker.getBufferRatio(u),client_time:_c(),is_buffering:d.bufferTracker.isVideoBuffering(),looping:t.loop,minutes_watched:e,network_state:t.networkState,playback_rate:t.playbackRate,player_width:t.getBoundingClientRect().width,player_height:t.getBoundingClientRect().height,session_playback_duration:xc(u,2),video_time:t.currentTime,video_height:t.videoHeight,video_width:t.videoWidth,volume:xc(t.volume,2)}},logStartRequest:function(){c=_c(),m(Tc.VIDEO_START_ATTEMPT)},customizeHooks:function(t){d=Object.assign(d,t)},initHooks:function(){d.videoBufferCheck(),d.playbackSessionTimer()},logBufferStart:b,logBufferEnd:w,setDisplayContext:function(t){v=t},handleExternalError:function(t,n){a=!1,f.onError(n),m(s?Tc.VIDEO_PLAYBACK_ERROR:s?Tc.VIDEO_START_FAILURE:Tc.VIDEO_LOAD_FAILURE,t)},reset:p}}function Mc(t){return t.config.video.p2p?"vimeo-live-ecdn":t.config.request.flags.ott?"vimeo-ott-vod":t.config.video.webinar&&"ended"!==t.config.video.webinar.status?"vimeo-live-webinar":t.config.video.live_event?"vimeo-live":t.config.embed.context&&-1!==t.config.embed.context.indexOf("Stock")?"vimeo-stock-vod":t.config.video.vod?"vimeo-ondemand":"vimeo-vod"}function Ic(t){return"dev"===t.request.build.js?"dev":"3.42.3"}var Rc,Oc=new r((function(t){Rc=t}));function Lc(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Oc.then((function(e){return i/=.1,Math.random()<=i&&e.captureException(Ks(t),n),e.lastEventId()}))}window.addEventListener("unhandledrejection",(function(t){t.preventDefault(),t.reason&&Lc(t.reason).catch((function(t){}))}));var Dc={setUp:function(t){t.config.request.sentry.enabled&&ht("module/sentry.js").then((function(n){var i="dev"===t.config.request.build.js?"dev":"production",e=[new n.Integrations.Dedupe,new n.Integrations.ExtraErrorData,new n.Integrations.Breadcrumbs({console:!1}),new n.Integrations.GlobalHandlers({onunhandledrejection:!1})];return n.init({dsn:t.config.request.sentry.url,release:Ic(t.config),environment:i,integrations:e,ignoreErrors:["NotAllowedError","AbortError","PlayInterrupted","Failed to load image"],blacklistUrls:[/^moz-extension/i,/^chrome-extension/i],beforeSend:function(i,e){var r;if(!t.config.request)return null;if(Yi.appleMail)return null;if(zs("ReportingObserver",i.message)&&Math.random()>.01)return null;var o=null==(r=e.originalException)?void 0:r.error;return zs("Non-Error exception captured",i.message)&&o?(n.withScope((function(t){t.setExtra("nonErrorException",!0),n.captureException(o)})),null):(i.tags["document.visibilityState"]=document.visibilityState,t.config.request.sentry.enabled?i:null)}}),n.configureScope((function(n){if(n.setTag("session",t.config.request.session),n.setTag("locale",t.config.request.lang),n.setTag("debug_intent",t.config.request.sentry.debug_intent?1:0),n.setTag("product",Mc(t)),n.setTag("backend",t.config.request.build.backend),n.setTag("video_embed_permission",t.config.video.embed_permission),n.setTag("video_privacy",t.config.video.privacy),t.config.user.logged_in&&n.setUser({id:t.config.user.id}),t.config.request.ab_tests)for(var i in t.config.request.ab_tests){var e=t.config.request.ab_tests[i];for(var r in n.setTag("".concat(i,"_test"),1),n.setTag("".concat(i,"_group"),e.group),e.data)n.setTag("".concat(i,"_data_").concat(r),e.data[r])}})),t.config.request.sentry.debug_intent&&window.addEventListener("unload",(function(){n.captureMessage("Session debug",{level:"info"})}),!1),n})).then(Rc).catch((function(t){}))},captureException:Lc,captureMessage:function(t,n){return Oc.then((function(i){return i.captureMessage(t,n),i.lastEventId()}))},captureBreadcrumb:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"player",e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"info";return Oc.then((function(r){return r.addBreadcrumb({message:t,data:n,category:i,level:e})}))}};function jc(t){var n=t.events,i=null,e=null,o=null,u=null,a=null,s={video:{},request:{},embed:{}};function c(){return e&&e-6e4<=Date.now()}function l(t){var n=Date.now()+1e3*t;return a=setTimeout((function(){"onLine"in navigator&&!navigator.onLine||u||(u=h().catch(Dc.captureException))}),1e3*t-6e4-5e3),n}function f(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};clearTimeout(a);var u=i;if(isNaN(t)&&"string"!=typeof t)return e=l((i=t).request.expires),r.resolve({old:u,loaded:i});Date.now();var c=(s=qa(s,i)).request.referrer;c&&(o.referrer=c),s.video.webinar&&s.video.webinar.registrant&&(o.webinar_registrant_uuid=s.video.webinar.registrant);var f=(null==(n=i)?void 0:n.player_url)?"https://".concat(i.player_url):"",h=Ds(t)||f,d=js(h,t,o);return tr(d,{withCredentials:!0,throwHttpErrors:!1}).json().then((function(t){return 7!==(i=t).view&&(e=l(i.request.expires),s.request.session&&i.video.id===s.video.id&&(i.request.session=s.request.session),c&&(i.request.referrer=c),s.embed.player_id&&(i.embed.player_id=s.embed.player_id),s.embed.on_site&&(i.embed.on_site=1,i.embed.context=s.embed.context)),Date.now(),{old:u,loaded:i}})).catch((function(t){Dc.captureException(t)}))}function h(){var t;clearTimeout(a),Date.now();var r=null==(t=i)?void 0:t.request.referrer,o=i.request,s=o.signature,c=o.session,f=o.timestamp,h=o.expires,d=i.request.ott_chromecast_token,v="https://".concat(i.player_url,"/video/").concat(i.video.id,"/config/request?session=").concat(c,"&signature=").concat(s,"&time=").concat(f,"&expires=").concat(h);return d&&(v="".concat(v,"&ott_chromecast_token=").concat(d)),r&&(v+="".concat(-1===v.indexOf("?")?"?":"&","referrer=").concat(encodeURIComponent(r))),tr(v,{withCredentials:!0,retry:3}).json().then((function(t){return i.request=t,r&&(i.request.referrer=r),e=l(i.request.expires),Date.now(),u=null,n.fire(cc.Kl),i.request})).catch((function(t){var i={id:"network",title:"Network error",message:'A network hiccup interrupted playback. Please reload the player and try again.',final:!0};throw n.fire(cc.cc,i.id,i),t}))}return window.addEventListener("online",(function(){c()&&(u=h().catch(Dc.captureException))})),n.on(cc.cc,(function(t){u||"media-url-expired"!==t||(u=h().catch(Dc.captureException))})),{get isExpired(){return c()},load:function(t,n){return f(t,n)},reload:function(){var t;return(null==(t=i)?void 0:t.video.id)?f(i.video.id):r.reject(new Error("No config loaded."))},toJSON:function(){return i},get config(){return i},set config(t){i=t},verify:function(){return c()?(u||(u=h()),u):r.resolve(i.request)},get $(){return o},set $(t){o=t}}}var Nc=function(){return It.Date.now()},Pc=Math.max,Uc=Math.min;function Fc(t,n,i){var e,r,o,u,a,s,c=0,l=!1,f=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(n){var i=e,o=r;return e=r=void 0,c=n,u=t.apply(o,i)}function v(t){return c=t,a=setTimeout(m,n),l?d(t):u}function p(t){var i=t-s;return void 0===s||i>=n||i<0||f&&t-c>=o}function m(){var t=Nc();if(p(t))return b(t);a=setTimeout(m,function(t){var i=n-(t-s);return f?Uc(i,o-(t-c)):i}(t))}function b(t){return a=void 0,h&&e?d(t):(e=r=void 0,u)}function w(){var t=Nc(),i=p(t);if(e=arguments,r=this,s=t,i){if(void 0===a)return v(s);if(f)return clearTimeout(a),a=setTimeout(m,n),d(s)}return void 0===a&&(a=setTimeout(m,n)),u}return n=Mo(n)||0,Ft(i)&&(l=!!i.leading,o=(f="maxWait"in i)?Pc(Mo(i.maxWait)||0,n):o,h="trailing"in i?!!i.trailing:h),w.cancel=function(){void 0!==a&&clearTimeout(a),c=0,e=s=r=a=void 0},w.flush=function(){return void 0===a?u:b(Nc())},w}function Vc(t,n){var i=t,e=n;return i%320!=0&&(i=100*Math.ceil(t/100),e=Math.round(i/t*n)),{width:i,height:e}}function Bc(t){var n=t.width,i=t.height,e=t.baseUrl,r=t.crop,o=void 0!==r&&r;e=e.replace(/\.[^/.]+$/,"");var u={},a=parseInt(n,10),s=parseInt(i,10);return 0!==a&&(o?u.w=a:u.mw=a),0!==s&&(o?u.h=s:u.mh=s),Yi.devicePixelRatio>1&&(u.q=70),_t(e,u)}function Hc(t){return new r((function(n,i){var e=new Image;function r(){Dc.captureBreadcrumb("Load image: ".concat(t),{}),i(new Error("Failed to load image."))}e.onload=function(){e&&e.width>0&&e.height>0?n(e):r()},e.onerror=r,e.src=t}))}function qc(t){return Hc(t).catch((function(n){return Dc.captureException(n,{extra:{imageUrl:t}}),new r((function(){}))}))}var Wc={id:"7742C69E",name:"prod"},zc={id:"78077C77",name:"prod"},Gc={connected:Ys(),disconnected:Ys(),playing:Ys(),paused:Ys(),buffering:Ys(),idle:Ys(),ended:Ys(),sessionStateChanged:Ys(),timeUpdated:Ys(),mediaLoadedSuccess:Ys(),mediaLoadedFailed:Ys(),error:Ys()},Yc=function(){function t(t){var n=t.player,i=t.textAlert,e=void 0===i?null:i;this.Jf=e,this.$f=n,this.Xf=this.onControlSeek.bind(this),this.Zf=this.onChangeVolume.bind(this),this.Qf=this.onPlayOrPausePressed.bind(this),this.th=this.onConfigChanged.bind(this),this.nh=this.onReset.bind(this),this.ih=this.onPlayerStateChanged.bind(this),this.eh=this.onCurrentTimeChanged.bind(this),this.rh=this.onIsConnectedChanged.bind(this),this.oh=this.onSessionStateChanged.bind(this),this.uh=this.onIsMediaLoadedChanged.bind(this),this.ah=this.onVolumeLevelChanged.bind(this),this.sh=this.onIsMutedChanged.bind(this),this.lh=this.onCaptionsChanged.bind(this),this.fh=this.onMessageReceived.bind(this),this.hh=this.preventPlayerDefaultEvent.bind(this),this.endVideo=Fc(this.dh,500)}var n=t.prototype;return n.calculateStartTime=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=Number(t)||this.$f.backbone.currentTime-7;return n<0&&(n=0),this.isEndOfVideo&&(n=0),n},n.loadMedia=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.contentId,e=n.currentTime,o=void 0===e?null:e,u=n.duration,a=void 0===u?null:u,s=n.token,c=void 0===s?null:s,l=n.bypassToken,f=void 0===l?null:l,h=n.autoRequest,d=void 0!==h&&h,v=n.autoCaption,p=void 0===v||v,m=n.autoDisconnect,b=void 0===m||m,w=n.tracks,g=void 0===w?[]:w;if(Jc.isLoadingMedia)return r.resolve(!1);var y=this.$f.config;i=i||y.video.id;var _,k=y.request,E=k.drm;if(null==E?void 0:E.fastly){var T=ha(k,"files.dash.default_cdn");i=ha(k,"files.dash.cdns.".concat(T,".url")),_=ha(E,"cdms.widevine.license_url"),g=(k.text_tracks||[]).map((function(t){var n=yt(t.url),i=n.pathname,e=n.search;return z(z({},t),{},{url:"https://player.vimeo.com".concat(i).concat(e)})}))}var S=this.calculateStartTime(o);a=Number(a)||this.duration,c=c||y.user.vimeo_api_client_token,f=f||y.video.bypass_token,this.isEndOfVideo&&(this.vh=!1);var A={contentId:i,duration:a,autoRequest:d,tracks:g,currentTime:S,requestCustomData:{token:c,bypassToken:f,tokenType:"jwt"}};this.$f.config.request.ott_chromecast_token&&(A.requestCustomData.ottChromecastToken=this.$f.config.request.ott_chromecast_token);var x=_?this.Ru(_).then((function(t){return z(z({},A),{},{mediaCustomData:{widevineLicenseServerURL:t}})})):r.resolve(A);return x.then((function(t){return Jc.loadMedia(t)})).then((function(){return Jc.fire(Gc.mediaLoadedSuccess),t.addRemotePlayerListenersOnPlaying(),t.$f.events.fire(Xo),t.$f.events.fire(Zs._hideOutro),t.ph=!1,p&&t.onCaptionsChanged(t.$f.backbone.enabledTextTrack),t.$f.backbone.paused||t.$f.backbone.pause(),!0})).catch((function(n){return Jc.fire(Gc.mediaLoadedFailed,n),b&&t.endCurrentSession(),r.reject(n)}))},n.Ru=function(t){return new r((function(n,i){var e=new XMLHttpRequest;e.open("GET",t),e.onload=function(){var t=function(t){return new Error("Error retrieving License Acquisition URL (LA_URL): ".concat(t))};if(e.status>=200&&e.status<300)try{n(e.response)}catch(n){i(t(n))}else i(t(e.status))},e.onerror=i,e.send()}))},n.init=function(){this.removeInitListeners(),this.addInitListeners()},n.addInitListeners=function(){this.addSessionStateListener(),this.addIsConnectedListener()},n.endCurrentSession=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Jc.castContext&&Jc.castContext.endCurrentSession(t)},n.syncBackbone=function(){!this.isOutroRendered&&this.$f.backbone.paused&&(this.$f.backbone.currentTime=this.lastCurrentTime,this.syncTime())},n.stopBackbone=function(){this.$f.events.fire(Zs.Us)},n.enableUI=function(){if(this.Jf){var t,n=null==(t=Jc.currentSessionObj)?void 0:t.receiver;n&&this.Jf.show("Casting on "+n.friendlyName)}this.$f.preview.show(),this.$f.element.classList.add("is-casting")},n.disableUI=function(){this.Jf&&this.Jf.hide(),this.isOutroRendered||(this.$f.preview.hide(),this.$f.backbone.element.classList.remove("invisible")),this.$f.element.classList.remove("is-casting")},n.syncTime=function(){var t=this.lastCurrentTime/this.duration;Jc.fire(Gc.timeUpdated,{currentTime:this.lastCurrentTime,duration:this.duration,percent:t}),t>0&&this.$f.events.fire(Ti.TIME_UPDATE,{currentTime:this.lastCurrentTime,duration:this.duration,timeProgress:t})},n.dh=function(){var t=this;return this.vh=!0,this.$f.events.fire(cc.vc),this.removeRemotePlayerListenersOnPlaying(),this.isLooped?this.loadMedia().catch((function(){t.showOutro()})):this.showOutro(),Jc.fire(Gc.ended),!0},n.showOutro=function(){this.isOutroRendered||(this.ph=!0,this.$f.events.fire(Zs.Zs))},n.dispose=function(){this.endCurrentSession(),this.removeAllRemoteListeners()},n.onIsMediaLoadedChanged=function(t){!1===t.value?this.isTimeEnded&&this.endVideo():this.$f.backbone.paused||this.$f.backbone.pause()},n.onPlayerStateChanged=function(t){switch(null===t.value&&this.isTimeEnded&&this.endVideo(),t.value){case Jc.PlayerState.PLAYING:Jc.fire(Gc.playing);break;case Jc.PlayerState.PAUSED:Jc.fire(Gc.paused);break;case Jc.PlayerState.BUFFERING:Jc.fire(Gc.buffering);break;case Jc.PlayerState.IDLE:default:Jc.fire(Gc.idle)}},n.onVolumeLevelChanged=function(t){this.$f.events.fire(Zs.Ls,t.value,!0)},n.onIsMutedChanged=function(t){this.$f.events.fire(Zs.Ls,t.value?0:Jc.remotePlayer.volumeLevel,!0)},n.onCurrentTimeChanged=function(t){this.isMediaLoaded&&(this.lt=t.value),this.syncTime(),this.isTimeEnded&&this.endVideo()},n.onChangeVolume=function(t){this.volumeLevel=t},n.onCaptionsChanged=function(t){var n=Jc.currentSession;n&&n.sendMessage("urn:x-cast:com.vimeo.cast.media",{action:"setActiveByLanguage",value:null==t?void 0:t.language})},n.onSessionStateChanged=function(t){switch(t.sessionState){case Jc.SessionState.SESSION_STARTING:this.addPreventLocalPlayerEvents();break;case Jc.SessionState.SESSION_RESUMED:case Jc.SessionState.SESSION_STARTED:this.loadMedia();break;case Jc.SessionState.SESSION_ENDING:case Jc.SessionState.SESSION_ENDED:break;case Jc.SessionState.SESSION_START_FAILED:this.removePreventLocalPlayerEvents()}Jc.fire(Gc.sessionStateChanged,t.sessionState)},n.onIsConnectedChanged=function(t){t.value?this.onConnected():this.onDisconnected()},n.onConnected=function(){this.removePreventLocalPlayerEvents(),this.stopBackbone(),this.addLocalPlayerListeners(),this.addRemotePlayerListenersOnIdle(),this.addMessageListener(),this.enableUI(),Jc.fire(Gc.connected)},n.onDisconnected=function(){this.syncBackbone(),this.removeRemotePlayerListeners(),this.removeLocalPlayerListeners(),this.removeMessageListener(),this.disableUI(),Jc.fire(Gc.disconnected)},n.onConfigChanged=function(){this.loadMedia()},n.onReset=function(){this.loadMedia()},n.onPlayOrPausePressed=function(){this.isEndOfVideo?this.loadMedia():this.isPlayingOrPaused&&Jc.remotePlayerController.playOrPause(),this.$f.events.halt()},n.onControlSeek=function(t,n){!n&&t&&(t>1&&(t=1),n=this.duration*t),this.currentTime=n,this.$f.events.halt()},n.addSessionStateListener=function(){Jc.castContext&&Jc.castContext.addEventListener(Jc.CastContextEventType.SESSION_STATE_CHANGED,this.oh)},n.addMessageListener=function(){var t=Jc.currentSession;t&&t.addMessageListener("urn:x-cast:com.vimeo.cast.media",this.fh)},n.onMessageReceived=function(t,n){"MEDIA_FINISHED"===(n=JSON.parse(n)).type&&("END_OF_STREAM"===n.endedReason?this.endVideo():"ERROR"===n.endedReason&&(this.endCurrentSession(),Jc.fire(Gc.error,new Error("Chromecast encountered an error and media finished."))))},n.addIsConnectedListener=function(){Jc.remotePlayerController&&Jc.remotePlayerController.addEventListener(Jc.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.rh)},n.addPreventLocalPlayerEvents=function(){this.$f.events.prependOn([cc.Ac,cc.Sc,cc.Dc,cc.jc,xi.BUFFER_STARTED,xi.BUFFER_ENDED,Zs.Os,cc.pc,cc.Bc,cc.Bl,Zs.Us],this.hh)},n.addRemotePlayerListenersOnIdle=function(){this.removeRemotePlayerListenersOnIdle(),this.addIsMediaLoadedChangedListener(),this.addVolumeLevelChangedListener()},n.addLocalPlayerListeners=function(){this.$f.events.prependOn(cc.Ac,this.Qf),this.$f.events.prependOn(cc.Sc,this.Qf),this.$f.events.prependOn(cc.Dc,this.hh),this.$f.events.prependOn(cc.jc,this.hh),this.$f.events.prependOn(xi.BUFFER_STARTED,this.hh),this.$f.events.prependOn(xi.BUFFER_ENDED,this.hh),this.$f.events.prependOn(Zs.Os,this.Xf),this.$f.events.prependOn(cc.pc,this.Zf),this.$f.events.on(cc.Bc,this.lh),this.$f.events.on(cc.Bl,this.th),this.$f.events.on(Zs.Us,this.nh)},n.preventPlayerDefaultEvent=function(){this.$f.events.halt()},n.addCurrentTimeChangedListener=function(){Jc.remotePlayerController&&Jc.remotePlayerController.addEventListener(Jc.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.eh)},n.addIsMediaLoadedChangedListener=function(){Jc.remotePlayerController&&Jc.remotePlayerController.addEventListener(Jc.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED,this.uh)},n.addPlayerStateChangedListener=function(){Jc.remotePlayerController&&Jc.remotePlayerController.addEventListener(Jc.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.ih)},n.addVolumeLevelChangedListener=function(){Jc.remotePlayerController&&(Jc.remotePlayerController.addEventListener(Jc.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.ah),Jc.remotePlayerController.addEventListener(Jc.RemotePlayerEventType.IS_MUTED_CHANGED,this.sh))},n.addRemotePlayerListenersOnPlaying=function(){this.removeRemotePlayerListenersOnPlaying(),this.addCurrentTimeChangedListener(),this.addPlayerStateChangedListener()},n.removeRemotePlayerListenersOnIdle=function(){this.removeIsMediaLoadedChangedListener(),this.removeVolumeLevelChangedListener()},n.removeInitListeners=function(){Jc.castContext&&Jc.castContext.removeEventListener(Jc.CastContextEventType.SESSION_STATE_CHANGED,this.oh),Jc.remotePlayerController&&Jc.remotePlayerController.removeEventListener(Jc.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.rh)},n.removeRemotePlayerListenersOnPlaying=function(){this.removeCurrentTimeChangedListener(),this.removePlayerStateChangedListener()},n.removeMessageListener=function(){var t=Jc.currentSession;t&&t.removeMessageListener("urn:x-cast:com.vimeo.cast.media",this.fh)},n.removeCurrentTimeChangedListener=function(){Jc.remotePlayerController&&Jc.remotePlayerController.removeEventListener(Jc.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.eh)},n.removeIsMediaLoadedChangedListener=function(){Jc.remotePlayerController&&Jc.remotePlayerController.removeEventListener(Jc.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED,this.uh)},n.removePlayerStateChangedListener=function(){Jc.remotePlayerController&&Jc.remotePlayerController.removeEventListener(Jc.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.ih)},n.removeVolumeLevelChangedListener=function(){Jc.remotePlayerController&&(Jc.remotePlayerController.removeEventListener(Jc.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.ah),Jc.remotePlayerController.removeEventListener(Jc.RemotePlayerEventType.IS_MUTED_CHANGED,this.sh))},n.removePreventLocalPlayerEvents=function(){this.$f.events.off([cc.Ac,cc.Sc,cc.Dc,cc.jc,xi.BUFFER_STARTED,xi.BUFFER_ENDED,Zs.Os,cc.pc,cc.Bc,cc.Bl,Zs.Us],this.hh)},n.removeLocalPlayerListeners=function(){this.$f.events.off(cc.Ac,this.Qf),this.$f.events.off(cc.Sc,this.Qf),this.$f.events.off(cc.Dc,this.hh),this.$f.events.off(cc.jc,this.hh),this.$f.events.off(xi.BUFFER_STARTED,this.hh),this.$f.events.off(xi.BUFFER_ENDED,this.hh),this.$f.events.off(Zs.Os,this.Xf),this.$f.events.off(cc.pc,this.Zf),this.$f.events.off(cc.Bc,this.lh),this.$f.events.off(cc.Bl,this.th),this.$f.events.off(Zs.Us,this.nh)},n.removeRemotePlayerListeners=function(){this.removeRemotePlayerListenersOnPlaying(),this.removeRemotePlayerListenersOnIdle()},n.removeAllRemoteListeners=function(){this.removeRemotePlayerListeners(),this.removeInitListeners()},H(t,[{key:"currentTime",get:function(){return this.lt||0},set:function(t){Jc.remotePlayer&&Jc.remotePlayerController&&(Jc.remotePlayer.currentTime=t,Jc.remotePlayerController.seek(),this.lt=t)}},{key:"isTimeEnded",get:function(){return this.lastCurrentTime+.5>=this.duration}},{key:"isOutroRendered",get:function(){return this.ph||!1}},{key:"isLooped",get:function(){return this.$f.config.embed.loop}},{key:"isEndOfVideo",get:function(){return this.vh||!1}},{key:"volumeLevel",set:function(t){Jc.remotePlayer&&Jc.remotePlayerController&&(Jc.remotePlayer.volumeLevel=t,Jc.remotePlayerController.setVolumeLevel())},get:function(){return Jc.remotePlayer?Jc.remotePlayer.volumeLevel:0}},{key:"duration",get:function(){return this.$f.config.video.duration}},{key:"isPlayingOrPaused",get:function(){return Jc.remotePlayer?Jc.remotePlayer.playerState===Jc.PlayerState.PLAYING||Jc.remotePlayer.playerState===Jc.PlayerState.PAUSED:null}},{key:"isIdle",get:function(){return Jc.remotePlayer?null===Jc.remotePlayer.playerState||Jc.remotePlayer.playerState===Jc.PlayerState.IDLE:null}},{key:"isMediaLoaded",get:function(){return!!Jc.remotePlayer&&Jc.remotePlayer.isMediaLoaded}}]),t}(),Kc={SETUP_DONE:"SETUP_DONE",NOT_SETUP:"NOT_SETUP"},Jc=rt(new(function(t){function n(){return t.apply(this,arguments)||this}G(n,t);var i=n.prototype;return i.init=function(){var n,i=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=e.appId,u=e.chromecastPlayer,a=void 0===u?null:u;return o||(o=(null==a||null==(n=a.$f)?void 0:n.config.request.flags.ott)?zc.id:Wc.id),this.chromecastPlayer=a,this.setup().then((function(n){return n&&(t.prototype.init.call(i,{receiverApplicationId:o,autoJoinPolicy:i.AutoJoinPolicy.PAGE_SCOPED}),i.chromecastPlayer&&i.chromecastPlayer.init()),n})).catch((function(t){return i.fire(Gc.error,t),r.reject(t)}))},i.dispose=function(){this.chromecastPlayer=null},H(n,[{key:"chromecastPlayer",get:function(){return this.bh},set:function(t){if(t&&!(t instanceof Yc))throw new SyntaxError("An invalid ChromecastPlayer was specified");this.chromecastPlayer&&this.chromecastPlayer.dispose(),this.bh=t}}]),n}(function(){function t(){this.version="1.2.36",this.remotePlayer=null,this.remotePlayerController=null,this.CastContextEventType=null,this.RemotePlayerEventType=null,this.CastState=Kc,this.SessionState=null,this.PlayerState=null,this.currentLoadRequestId=null,this.currentLoadRequestPromise=null}var n=t.prototype;return n.init=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.receiverApplicationId,i=void 0===n?"":n,e=t.resumeSavedSession,r=void 0===e||e,o=t.language,u=void 0===o?null:o,a=t.autoJoinPolicy,s=void 0===a?"TAB_AND_ORIGIN_SCOPED":a;if(!this.isGCastApiAvailable)throw new Error("CAF is not available. Call setup() first.");if("string"!=typeof i||""===i.trim())throw new Error("Parameter 'receiverApplicationId' must be valid.");switch(s){case chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED:case chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED:case chrome.cast.AutoJoinPolicy.PAGE_SCOPED:break;default:s=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED}return this.CastContextEventType=cast.framework.CastContextEventType,this.RemotePlayerEventType=cast.framework.RemotePlayerEventType,this.CastState=Object.assign(this.CastState,cast.framework.CastState),this.SessionState=cast.framework.SessionState,this.PlayerState=chrome.cast.media.PlayerState,cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:i.trim(),resumeSavedSession:r,language:u,autoJoinPolicy:s}),this.isInitialized?this.remotePlayerController:this.initRemotePlayer()},n.initRemotePlayer=function(){if(!this.isGCastApiAvailable)throw new ReferenceError("CAF is not available. Call setup() first.");return this.remotePlayer=new cast.framework.RemotePlayer,this.remotePlayerController=new cast.framework.RemotePlayerController(this.remotePlayer),this.remotePlayerController},n.setup=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.loadLibrary,e=void 0===i||i;return new r((function(n,i){if(t.isGCastApiAvailable)return t.AutoJoinPolicy=chrome.cast.AutoJoinPolicy,void n(!0);window.__onGCastApiAvailable=function(e,r){if(r){var o=new Error(r);i(o)}else t.AutoJoinPolicy=chrome.cast.AutoJoinPolicy,n(e)};try{if(!1===e)throw new ReferenceError("Cast is not available. Make sure the library has been loaded.");t.loadLibrary()||n(!1)}catch(t){var r=new Error(t);i(r)}}))},n.loadLibrary=function(){if(this.isGCastApiAvailable)return!0;if(null!==window.chrome&&void 0!==window.chrome&&"Google Inc."===window.navigator.vendor){var t="//www.gstatic.com/cv/js/sender/v1/cast_sender.js";if(!(document.querySelectorAll('script[src^="'+t+'"]').length>0)){t+="?loadCastFramework=1";var n=document.createElement("script");return n.src=t,n.async=!0,n.defer=!0,document.head.appendChild(n),!0}}return!1},n.loadMedia=function(t){var n=this,i=t.contentId,e=t.contentType,o=t.currentTime,u=void 0===o?0:o,a=t.duration,s=void 0===a?0:a,c=t.requestCustomData,l=void 0===c?null:c,f=t.mediaCustomData,h=void 0===f?null:f,d=t.autoRequest,v=void 0!==d&&d,p=t.tracks,m=void 0===p?[]:p;return i?this.isSessionEstablished?this.loadMediaOnSession(this.currentSession,{contentId:i,contentType:e,currentTime:u,duration:s,requestCustomData:l,mediaCustomData:h,tracks:m}):!0!==v?r.reject(new TypeError("Option 'autoRequest' must be true when session is not connected.")):this.requestSession().then((function(t){return n.loadMediaOnSession(t,{contentId:i,contentType:e,currentTime:u,duration:s,requestCustomData:l,mediaCustomData:h,tracks:m})})):r.reject(new TypeError("Option 'contentId' must be valid."))},n.loadMediaOnSession=function(t,n){var i=this,e=n.contentId,o=n.contentType,u=n.currentTime,a=void 0===u?0:u,s=n.duration,c=n.requestCustomData,l=void 0===c?null:c,f=n.mediaCustomData,h=void 0===f?null:f,d=n.tracks,v=void 0===d?[]:d;if(t&&t instanceof cast.framework.CastSession){var p=t.getSessionState();if(p!==this.SessionState.SESSION_STARTING&&p!==this.SessionState.SESSION_STARTED&&p!==this.SessionState.SESSION_RESUMED)return r.reject(new ReferenceError("Session must be established."));var m=this.createLoadRequest(e,o,a,s,l,h,v);return null!==this.currentLoadRequestId&&this.currentLoadRequestId===m.requestId||(this.currentLoadRequestId=m.requestId,this.currentLoadingMediaPromise=t.loadMedia(m).finally((function(){i.currentLoadRequestId=null,i.currentLoadingMediaPromise=null}))),this.currentLoadingMediaPromise}return r.reject(new ReferenceError("Session must be cast.framework.CastSession."))},n.requestSession=function(){var t=this;return this.isSessionEstablished?r.resolve(this.currentSession):this.castContext?this.castContext.requestSession().then((function(){return t.currentSession})):r.reject(new Error("CastContext is not available. Call setup() first."))},n.sendMessage=function(t){var n=this,i=t.namespace,e=t.data,o=void 0===e?{}:e,u=t.autoRequest,a=void 0!==u&&u;return this.isSessionEstablished?this.sendMessageOnSession(this.currentSession,{namespace:i,data:o}):!0!==a?r.reject(new TypeError("Option 'autoRequest' must be true when session is not connected.")):this.requestSession().then((function(t){return n.sendMessageOnSession(t,{namespace:i,data:o})}))},n.sendMessageOnSession=function(t,n){var i=n.namespace,e=n.data,o=void 0===e?{}:e;if(t||!(t instanceof cast.framework.CastSession)){var u=t.getSessionState();return u!==this.SessionState.SESSION_STARTING&&u!==this.SessionState.SESSION_STARTED&&u!==this.SessionState.SESSION_RESUMED?r.reject(new ReferenceError("Session must be established.")):t.sendMessage(i,o)}return r.reject(new ReferenceError("Session must be cast.framework.CastSession."))},n.createCastButton=function(t){var n=document.createElement("button","google-cast-button");return t&&t.style&&(null===t.style["--disconnected-color"]&&(t.style["--disconnected-color"]="#00ADEF"),null===t.style["--connected-color"]&&(t.style["--connected-color"]="#E5E500")),t&&Object.keys(t).forEach((function(i){if("string"==typeof t[i])n.setAttribute(i,t[i]);else if("style"===i&&"object"===V(t[i])){var e="";Object.keys(t[i]).forEach((function(n){e+=n+":"+t[i][n]+";"})),n.setAttribute(i,e)}})),n},n.createLoadRequest=function(t,n,i,e,r,o,u){var a=new chrome.cast.media.MediaInfo(t.toString(),n);a.customData=o,a.duration=e;var s={subtitles:chrome.cast.media.TextTrackType.SUBTITLES,captions:chrome.cast.media.TextTrackType.CAPTIONS};a.tracks=u.map((function(t){var n=new chrome.cast.media.Track(t.id,chrome.cast.media.TrackType.TEXT);return n.trackContentId=t.url,n.trackContentType="text/vtt",n.subtype=s[t.kind],n.name=t.label,n.language=t.lang,n}));var c=new chrome.cast.media.LoadRequest(a);return c.customData=r,c.currentTime=i||0,c},H(t,[{key:"isGCastApiAvailable",get:function(){return!!("undefined"!=typeof cast&&cast&&cast.framework&&cast.framework.VERSION)}},{key:"castState",get:function(){return this.castContext?this.castContext.getCastState():this.isGCastApiAvailable?this.CastState.SETUP_DONE:this.CastState.NOT_SETUP}},{key:"versionGCastApi",get:function(){return this.isGCastApiAvailable?cast.framework.VERSION:null}},{key:"castContext",get:function(){return this.isGCastApiAvailable?cast.framework.CastContext.getInstance():null}},{key:"currentSession",get:function(){return this.castContext?this.castContext.getCurrentSession():null}},{key:"currentSessionObj",get:function(){var t=this.currentSession;return t?t.getSessionObj():null}},{key:"isInitialized",get:function(){return!(!this.isGCastApiAvailable||!this.remotePlayerController)}},{key:"isSessionEstablished",get:function(){var t=this.currentSessionObj;return!!t&&t.status===chrome.cast.SessionStatus.CONNECTED}},{key:"isCastConnected",get:function(){return this.castState===this.CastState.CONNECTED}}]),t}())));function $c(t){return t.replace(/(_\w)/g,(function(t){return t[1].toUpperCase()}))}function Xc(t){return function t(n,i){return Object.keys(i).reduce((function(e,r){return i[r]&&"object"===V(i[r])?e[n(r)]=t(n,i[r]):e[n(r)]=i[r],e}),{})}($c,t)}var Zc=function(t){return{type:"CONFIG_LOAD",payload:z({},Xc(t))}},Qc=function(t){return{type:"LIVE_SET_START_TIME",payload:t}};function tl(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=n.type,e=n.payload;switch(i){case"CONFIG_LOAD":return e.video.liveEvent?z(z({},t),e.video.liveEvent):null;case"LIVE_UPDATE":return z(z({},t),e);case"LIVE_SET_START_TIME":return z(z({},t),{},{ingest:z(z({},t.ingest),{},{startTime:e})});case"LIVE_SETTINGS_UPDATE":return z(z({},t),{},{settings:z(z({},t.settings),e)});default:return t}}var nl=function(t){var n;return!!(null==(n=t.liveEvent)?void 0:n.status)},il=function(t){var n;return null==(n=t.liveEvent)?void 0:n.status},el=function(t){var n,i;return(null==(n=t.liveEvent)||null==(i=n.ingest)?void 0:i.scheduledStartTime)||null},rl=function(t){var n,i;return(null==(n=t.liveEvent)||null==(i=n.ingest)?void 0:i.startTime)||null},ol=function(t){var n;return"pending"===(null==(n=t.liveEvent)?void 0:n.status)},ul=function(t){var n;return"active"===(null==(n=t.liveEvent)?void 0:n.status)},al=function(t){var n;return"started"===(null==(n=t.liveEvent)?void 0:n.status)},sl=function(t){var n;return"ended"===(null==(n=t.liveEvent)?void 0:n.status)},cl=function(t){return nl(t)&&!sl(t)},ll=function(t){var n,i;return"done"===(null==(n=t.liveEvent)||null==(i=n.archive)?void 0:i.status)},fl=function(t){var n,i;return null==t||null==(n=t.liveEvent)||null==(i=n.settings)?void 0:i.eventSchedule},hl=Object.freeze({__proto__:null,default:tl,liveExists:nl,liveStatus:il,liveArchiveStatus:function(t){var n,i;return null==(n=t.liveEvent)||null==(i=n.archive)?void 0:i.status},dashLiveUrl:function(t){var n;return null==(n=t.liveEvent)?void 0:n.playback.dash_noredirect},hlsLiveUrl:function(t){var n;return null==(n=t.liveEvent)?void 0:n.playback.hls},scheduledLiveStartTime:el,liveStartTime:rl,isLivePending:ol,isLiveActive:ul,isLiveStarted:al,isLiveEnded:sl,liveInProgress:cl,isLiveArchived:ll,hasEventSchedule:fl});function dl(t,n,i){var e=null;function o(){return i.getAttribute("data-thumb")}function u(){return Vc(n.get("ui.player.width")*Yi.devicePixelRatio,n.get("ui.player.height")*Yi.devicePixelRatio)}function a(){return n.get(nl)&&!n.get(al)||!t.config.embed.autoplay||Jc.isCastConnected}function s(){if(!t.config.video.thumbs.base)return r.resolve();var e=u(),s=e.width,c=Bc({width:s,height:e.height,baseUrl:t.config.video.thumbs.base});i.setAttribute("data-thumb",c),i.setAttribute("data-thumb-width",s);var l=qc(c).then((function(t){return n.dispatch(function(t,n){return{type:"PREVIEW_SET_SIZE",payload:{width:t,height:n}}}(t.width,t.height)),a()&&(i.style.backgroundImage="url(".concat(o(),")")),t}));return a()?r.race([l,new r((function(t){return setTimeout(t,2e3)}))]):r.resolve()}return e=s(),t.events.on(cc.Xc,(function(){i.classList.contains("vp-preview-invisible")&&"beginning"!==t.config.embed.outro||(e=s())})),n.watch("ui.player.width",Fc((function(){e=e.then((function(){return function(){var t=u().width,n=i.getAttribute("data-thumb-width");return t<=parseInt(n,10)||0===t?r.resolve():s()}()})).catch((function(t){}))}),150)),n.watch("ui.preview.scaleFactor",(function(t){i.classList.toggle("vp-preview-cover",t>1)})),{show:function(){i.style.backgroundImage="url(".concat(o(),")"),i.classList.remove("vp-preview-invisible")},hide:function(){i.classList.add("vp-preview-invisible")},resetThumbnail:function(){i.setAttribute("data-thumb",""),i.setAttribute("data-thumb-width",""),i.style.backgroundImage=""},getThumbnail:o,loadThumbnail:s,thumbnailPromise:e}}function vl(t){return!0===t||!1===t?Number(t):"null"===t?null:t}function pl(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.cookie;try{if(n&&""!==n)return n.split(";").reduce((function(n,i){return 0===(i=i.trim()).indexOf("".concat(t,"="))?decodeURIComponent(i.substr(t.length+1)):n}),null)}catch(t){}return null}var ml=["quality","volume","captions","captions_color","captions_font_family","captions_font_size","captions_bg_color","captions_bg_opacity","captions_edge"],bl=null;function wl(t){var n=0!==t.config.request.urls.proxy.indexOf(window.location.origin),i=0;function e(n,i){if(bl){var e={method:"set",key:"sync_".concat(n),val:i,session:t.config.request.session};return function(n){bl.then((function(i){var e=Is(t.config.request.urls.proxy);return i.contentWindow.postMessage(n,e),i})).catch((function(n){Dc.captureException(n,{extra:{proxyUrl:t.config.request.urls.proxy}})}))}(e),void function(n){t.config.embed.on_site&&window.postMessage(n,window.location.origin)}(e)}try{window.localStorage.setItem("sync_".concat(n),JSON.stringify(i))}catch(t){}}function o(n,i){ml.indexOf(n)>=0&&(t.config.request.cookie[n]=i);var e=[];ml.indexOf(n)>=0&&null!==i&&e.push("".concat(n,"=").concat(i));var r=u(ml);for(var o in r)o in r&&null!==r[o]&&o!==n&&e.push("".concat(o,"=").concat(r[o]));!function(t,n,i){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=e.samesite,o=e.secure,u=new Date;u.setFullYear(u.getFullYear()+1),u=u.toGMTString(),n=vl(n);var a="".concat(t,"=").concat(n);a+=";expires=".concat(u),a+=";path=/",a+=";domain=".concat(i),o&&(a+=";secure"),r&&(a+=";samesite=".concat(r));try{document.cookie=a}catch(t){return!1}}("player",'"'.concat(e.join("&"),'"'),t.config.request.cookie_domain,{secure:!0,samesite:"none"})}function u(t){var n=null;try{n=pl("player")}catch(t){}if(!n)return null;n=n.substring(1,n.length-1);var i={};n.split("&").forEach((function(t){t=t.split("="),i[t[0]]=vl(decodeURIComponent(t[1]||""))}));var e=[].concat(t),r=e.reduce((function(t,n){if(n in i){var e=parseFloat(i[n]);return t[n]=isNaN(e)||"quality"===n?i[n]:e,t}return t[n]=null,t}),{});return 1===e.length?r[t]:r}function a(n,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t.doNotTrackEnabled||(i=vl(i),r&&e(n,i),o(n,i))}function s(n,e){switch(n){case"sync_quality":t.events.fire(Zs.Vs,e,!0);break;case"sync_volume":if(t.config.embed.settings.background)break;t.events.fire(Zs.Ls,e,!0);break;case"sync_captions":if(null===e){t.events.fire(Zs.Js,!0);break}t.events.fire(Zs.Ks,e,!0);break;case"sync_login":!function(n){i>4||(i++,n&&!t.config.user.logged_in?t.events.fire(cc.Nl):!n&&t.config.user.logged_in&&t.events.fire(cc.Ul))}(e);break;case"sync_active":null!==e&&e!==t.config.request.session&&t.config.embed.autopause&&t.events.fire(cc.nf)}}return t.events.on(cc.mc,(function(t,n){n||a("quality",t)})),t.events.on(cc.pc,(function(n,i){t.config.request.cookie.volume=vl(n),i||a("volume",n,!1)})),t.events.on(cc.Bc,(function(n,i){if(n){var e="".concat(n.language,".").concat(n.kind);return t.config.request.cookie.captions=vl(e),void(i||a("captions",t.config.request.cookie.captions))}t.config.request.cookie.captions=null,i||a("captions",null)})),t.events.on(Zs.$s,(function(n,i){var e=n.dispatch,r=n.cookie;t.store.dispatch(e(i)),a("captions_".concat(r),vl(i))})),t.events.on(cc.Ac,(function(){t.config.embed.settings.background||(a("active",t.config.request.session),t.events.fire(cc.tf))})),t.events.on([cc.Sc,cc.vc],(function(){u("active")===t.config.request.session&&a("active",null)})),t.events.on(cc.Pl,(function(){a("login",!0)})),n&&!bl&&(bl=function(n){return new r((function(i,e){document.createElement("a").href=t.config.request.urls.proxy;var r=document.createElement("iframe");r.src=n,r.setAttribute("title","Vimeo LocalStorage Proxy"),r.setAttribute("aria-hidden","true"),r.setAttribute("hidden",""),r.onload=function(n){var i=Is(t.config.request.urls.proxy);r.contentWindow.postMessage({method:"ping"},i)},r.onerror=function(t){e(t)};var o=setTimeout((function(){e()}),1e4);window.addEventListener("message",(function t(e){0!==n.indexOf(e.origin)||"ready"!==e.data&&"ping"!==e.data||(window.removeEventListener("message",t,!1),clearTimeout(o),i(r))}),!1),document.body.appendChild(r)}))}(t.config.request.urls.proxy)),n?window.addEventListener("message",(function(n){var i=Is(t.config.request.urls.proxy);n.origin===i&&"object"===V(n.data)&&"key"in n.data&&"newValue"in n.data?s(n.data.key,n.data.newValue):n.origin===window.location.origin&&n.data.session!==t.config.request.session&&s(n.data.key,n.data.val)}),!1):window.addEventListener("storage",(function(t){if(0===t.key.indexOf("sync_")&&t.oldValue!==t.newValue){try{if(window.localStorage.getItem(t.key)!==t.newValue)return}catch(t){}try{s(t.key,JSON.parse(t.newValue))}catch(n){Dc.captureException(n,{extra:{key:t.key,oldValue:t.oldValue,newValue:t.newValue}})}}}),!1),{reset:function(){a("login",!!t.config.user.logged_in)}}}function gl(t,n){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i={feature:n,$deeplink_path:"app.vimeo.com/"+t,$always_deeplink:!0,ref:"player",context:"player"},e="",r=[];for(var o in i)r.push("".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(i[o])));return e=r.join("&"),"https://bnc.lt/a/".concat("key_live_jpj6Duy53e6MhounkriNljdgsBhGbf0d","?").concat(e)}("videos/".concat(t),n)}var yl=function(){function t(t,n){var i=this;this.fetchWIREWAXVideoId=function(t){return fetch("https://edge-player.wirewax.com/vimeoData/".concat(t,".txt")).then((function(t){if(!t.ok)throw Error(t.statusText);return t.json()}))};var e=window.createWirewaxEmbedder?r.resolve():new r((function(t,n){var i=document.createElement("script");i.src="https://wirewax.s3.eu-west-1.amazonaws.com/creativeData/bcp-wirewax-n-1/wirewax-plugin.js",i.addEventListener("load",t),i.addEventListener("error",(function(t){return n(t.error)})),document.head.appendChild(i)}));this.embedders={},this.player=t,this.events=n,this.playerContainer=t.backbone.element,this.wirewaxContainer=function(){var t=document.createElement("div");return t.classList.add("vjs-wirewax-container"),t.setAttribute("style","position: absolute; height: 100%; width: 100%; top: 0; pointer-events: none"),t}(),this.playerContainer.appendChild(this.wirewaxContainer),this.playHandler=this.handlePlay.bind(this),this.pauseHandler=this.handlePause.bind(this),this.seekedHandler=this.handleSeeked.bind(this),e.then((function(){i.init()})).catch((function(t){}))}var n=t.prototype;return n.init=function(){this.embedder=window.createWirewaxEmbedder(),this.setupEmbedder(this.player.config.video.id)},n.setupEmbedder=function(t){var n=this;this.fetchWIREWAXVideoId(t).then((function(t){n.playerContainer.dataset.wirewaxVideoId=t,n.embedder.createEl(n.wirewaxContainer,{isPlugin:!0,videoId:t}),n.embedder.ready().then((function(){n.registerWIREWAX()})).catch((function(t){}))})).catch((function(t){}))},n.registerWIREWAX=function(){var t=this;this.setWIREWAXCurrentTime=function(){t.embedder.setCurrentTime(t.player.backbone.currentTime),t.animationId=window.requestAnimationFrame(t.setWIREWAXCurrentTime)},this.events.on(Ti.PLAY,this.playHandler),this.events.on(Ti.PAUSE,this.pauseHandler),this.events.on(Ti.SEEKED,this.seekedHandler),this.player.config.embed.autoplay&&(this.startTimeUpdate(),this.embedder.play()),this.addWIREWAXListeners(),this.embedders[this.player.backbone.element.id]=this.embedder},n.disposeWIREWAX=function(){this.stopTimeUpdate(),this.embedder.dispose(),this.events.off(Ti.PLAY,this.playHandler),this.events.off(Ti.PAUSE,this.pauseHandler),this.events.off(Ti.SEEKED,this.seekedHandler)},n.addWIREWAXListeners=function(){var t=this;this.embedder.on("play",(function(){t.player.backbone.play()})),this.embedder.on("pause",(function(){t.player.backbone.pause()})),this.embedder.on("seeked",(function(n){var i=n.seekTo;t.player.backbone.currentTime(i)})),this.embedder.on("overlayOpen",(function(){})),this.embedder.on("overlayClose",(function(){}))},n.handlePlay=function(){this.startTimeUpdate(),this.embedder.play()},n.handlePause=function(){this.stopTimeUpdate(),this.embedder.pause()},n.handleSeeked=function(t){var n=t.seconds;this.embedder.setCurrentTime(n)},n.startTimeUpdate=function(){window.cancelAnimationFrame(this.animationId),this.animationId=window.requestAnimationFrame(this.setWIREWAXCurrentTime)},n.stopTimeUpdate=function(){window.cancelAnimationFrame(this.animationId)},t}();function _l(t,n,i){var e=t.events,o=t.backbone,u=!t.config.embed.playsinline&&(Yi.mobileAndroid||Yi.iOS&&!Yi.iPad),a=Yi.iOS>=8&&!Yi.iPad,s=!1,c=!1,l=!1,f=!1,h=null,d=!1,v=!1,p=!1,m=!1,b=!1,w=!1;function g(t){o.element.classList.remove("invisible"),y()}function y(){var t=o.play();return w&&(t=t.catch(_)),t.catch(E).then(T)}function _(t){if(w=!1,k(t))return e.fire(Zs.Ds,!0),o.play();throw t}function k(t){return t&&("NotAllowedError"===t.name||"AbortError"===t.name)}function E(t){return e.fire(cc.lc,t),new r((function(){}))}function T(){e.fire(cc.fc)}function S(t){try{o.currentTime=t}catch(t){}}function A(){f||d||s&&o.paused&&y()}function x(){var n="none";("metadata"===t.config.request.flags.preload_video||u||Yi.iOS>=8)&&(n="metadata"),"auto"===t.config.request.flags.preload_video&&(n="metadata","MediaSourceScanner"===o.currentScannerName&&(n="auto")),o.preload=n,e.on(cc.Il,(function(){t.config.request&&"metadata_on_hover"===t.config.request.flags.preload_video&&!l&&t.verifyConfig().then((function(){return o.preload="metadata",!0})).catch((function(t){}))}))}function C(){b=!1;var n=o.video;if(o.loadVideo(t.config),!n)if(t.config.embed.texttrack){var i=t.config.embed.texttrack;o.hasTextTrack(i)&&e.fire(Zs.Ks,i,!0)}else e.on(xi.TEXT_TRACKS_AVAILABLE,(function(){r(),u()})),r(),u();function r(){null===t.config.request.cookie.captions||"null"===t.config.request.cookie.captions||o.hasTextTrack(t.config.request.cookie.captions)&&e.fire(Zs.Ks,t.config.request.cookie.captions,!0)}function u(){t.config.request.cookie.captions_styles&&bc.forEach((function(n){var i=n.dispatch,e=n.id;t.store.dispatch(i(t.config.request.cookie.captions_styles[e]||wc[e]))}))}}function M(t,n,i,e){if(c){var r=new XMLHttpRequest;r.open("DELETE","".concat(t,"/plays/").concat(n,"/").concat(i,"?token=").concat(e),!1),r.send(),c=!1}}function I(){if(t.config.embed.autoplay){if(n.get(nl)&&!n.get(al))return;e.fire(cc.Ac)}}o.element.classList.add("invisible"),a&&o.element.classList.add("hide-webkit-controls"),t.config.video.live_event&&i.classList.add("live-background"),t.config.embed.transparent&&i.classList.add("transparent"),n.watch(il,(function(t){switch(t){case"started":setTimeout((function(){C(),o.element.classList.remove("invisible"),e.fire(cc.Ac)}),12e3)}})),n.watch(ll,(function(){t.loadVideo(t.config.video.id)})),n.watch("ui.video.scaleFactor",(function(t){o.element.classList.toggle("vp-telecine-cover",t>1)})),function n(){e.once(cc.af,n),qs((o=t.backbone).on,e.fire,[nu,tu,Qo,ou,eu,uu,ru,Xo,Zo,iu,Jo,$o,Si.ACTIVATED,Si.AVAILABLE,Si.DEACTIVATED,Si.UNAVAILABLE,fu.ARCHIVE_DONE,fu.EVENT_ACTIVE,fu.EVENT_ENDED,fu.EVENT_STARTED,fu.STREAM_OFFLINE,fu.STREAM_ONLINE,fu.BUFFER_GAP_JUMP,fu.BUFFER_GAP_JUMP_PREVENT,fu.STALL_JUMP,fu.SETTINGS_UPDATED,fu.LOW_LATENCY_FALLBACK,Ii.MEDIASESSION_PAUSE,Ii.MEDIASESSION_PLAY,Ii.MEDIASESSION_SEEK_BACKWARD,Ii.MEDIASESSION_SEEK_FORWARD,xi.AV_DURATION_MISMATCH,xi.BANDWIDTH,xi.BUFFER_ENDED,xi.BUFFER_OCCUPANCY,xi.BUFFER_STARTED,xi.CHAPTER_CUES_UPDATED,xi.CUE_POINT,xi.CURRENT_FILE_CHANGE,xi.DOWNLOAD_END,xi.DOWNLOAD_TIMEOUT,xi.DRM_AUTH_SUCCESS,xi.DRM_KEY_SWITCH,xi.DROPPED_FRAMES,xi.MANIFEST_LOADED,xi.MANIFEST_TIMEOUT,xi.QUOTA_EXCEEDED_ERROR,xi.SCANNER_CHANGE,xi.STREAM_BUFFER_START,xi.STREAM_CHANGE,xi.STREAM_CHANGE_START,xi.STREAM_TARGET_CHANGE,xi.TEXT_TRACKS_AVAILABLE,Mi.CAMERA_CHANGE,Mi.CAMERA_UPDATE,Mi.MOTION_END,Mi.MOTION_START,Mi.SPATIAL_UNSUPPORTED,Mi.WEBVR_ENTER,Mi.WEBVR_EXIT,Mi.WEBVR_HARDWARE_AVAILABLE,Ri.BRAIN_ML_SWITCH_TO_SKYFIRE,Ri.BRAIN_ML_MODEL_INPUTS,Ti.DURATION_CHANGE,Ti.ENDED,Ti.ERROR,Ti.LOAD_START,Ti.LOADED_DATA,Ti.LOADED_METADATA,Ti.PAUSE,Ti.PLAY,Ti.PLAYING,Ti.PROGRESS,Ti.RATE_CHANGE,Ti.RESIZE,Ti.SEEKED,Ti.SEEKING,Ti.STALLED,Ti.TIME_UPDATE,Ti.VOLUME_CHANGE,Ti.WAITING,Ti.ENTER_PICTURE_IN_PICTURE,Ti.LEAVE_PICTURE_IN_PICTURE])}(),qs(Jc.on,e.fire,[Gc.connected,Gc.disconnected]),x(),e.on(Ti.LOADED_METADATA,(function(n){t.config.video.duration=o.duration,t.config.video.video_width=o.videoWidth,t.config.video.video_height=o.videoHeight})),e.on(Ti.DURATION_CHANGE,(function(n){t.config.video.duration=o.duration})),e.on(xi.SCANNER_CHANGE,(function(){x(),setTimeout((function(){e.fire(o.supportsSettingVolume?Zs.Ws:Zs.qs),e.fire(o.supportsTextTracks?Zs.Gs:Zs.zs)}),0),Dc.captureBreadcrumb("Scanner changed to ".concat(o.currentScannerName),{},"video")})),e.on([fu.EVENT_ACTIVE,fu.EVENT_STARTED,fu.EVENT_ENDED,fu.ARCHIVE_DONE],(function(i){Object.assign(t.config.video.live_event,i),n.dispatch(function(t){return{type:"LIVE_UPDATE",payload:t}}(i))})),e.on(cc.Ac,(function(){t.displayContext!==t.backbone?t.displayContext.play():function(){if("disable"!==t.config.video.privacy&&t.config.video.spatial&&Yi.iOS&&!b||o.element.classList.remove("invisible"),h)return e.fire(cc.cc,h),void t.preview.show();if(s=!0,d)t.preview.show();else{if(o.off(Ti.PLAY,g),u&&(v=!0,e.fire(Zs.Ys)),n.get(al)&&(w=!0),!l)return t.config.video.spatial&&Yi.iOS&&!b?(b=!0,e.fire(Zs._showOverlay,"app-redirect",{redirectUrl:t.doNotTrackEnabled?t.config.video.share_url:gl(t.config.video.id,"player-spatial-redirect"),title:null,buttonText:"Watch in the Vimeo app",ignoreText:null,bottomText:"360 not supported in this browser",newWindow:!t.config.embed.on_site}),void e.once(Ti.PLAY,g)):void y().then((function(){!o.muted||!n.get(al)&&o.supportsSettingVolume||e.fire(cc.Jc)})).catch(console.error);l&&A()}}()})).on(cc.Sc,(function(){s=!1,t.displayContext.pause()})).on(cc.nf,(function(){(window.location.search.indexOf("autopause=0")<0&&!o.paused&&!t.config.embed.settings.background||s)&&(s=!1,e.fire(cc.Sc))})),e.on(Ti.ERROR,(function(n){if(k(n)&&!w){if(t.config.embed.autoplay=0,o.pause(),t.config.embed.time)return S(t.config.embed.time),void e.fire(cc.ir,o.currentTime);if(0===o.currentTime)return void e.fire(Zs.Us);e.fire(cc.ir,o.currentTime)}})),e.on(Ti.PLAY,(function(t){o.element.classList.remove("invisible")})),e.on(Ti.PAUSE,(function(t,n){f||e.fire(cc.ir,t,n)})),e.on(Ti.TIME_UPDATE,(function(t){t.currentTime})),e.on(Ti.ENDED,(function(n){f||t.config.embed.loop||(v&&e.fire(cc.Tc),s=!1,e.fire(cc.vc,n))})),e.on(xi.DRM_AUTH_SUCCESS,(function(){c=!0})),e.on(Xo,(function(){l=!0,e.once(Ti.TIME_UPDATE,(function(){e.fire(cc.yc)}))})),e.on(xi.BUFFER_STARTED,(function(){f||e.fire(Js.Ms)})),e.on(Ri.BRAIN_ML_SWITCH_TO_SKYFIRE,(function(){"ml_brain"in t.config.request.ab_tests&&delete t.config.request.ab_tests.ml_brain})),function(){var n=!1,i=!1;function r(o){if(!n&&!o.name.includes("PlayInterrupted"))if("TextTracksNotSupported"!==o.name){Dc.captureBreadcrumb(o.name,{message:o.message},"telecine error","error");var u=t.config.video.live_event?1:.001;if("MediaUrlBadRequest"===o.name&&!i){i=!0,u=1;var a=t.config.request,s=a.files,c=s.dash.cdns.fastly_skyfire.url,l=s.hls.cdns.fastly_skyfire.url,f=s.dash.cdns.akfire_interconnect_quic.url,d=s.hls.cdns.akfire_interconnect_quic.url,v=s.progressive.length?s.progressive[0].url:null,p=s.progressive.length?s.progressive[0].id:null,m=a.file_codecs,b=t.config.video.file_codecs,w=t.config.user.logged_in,g=a.build.js;Dc.captureBreadcrumb(o.name,{fastly_dash_url:c,fastly_hls_url:l,akamai_dash_url:f,akamai_hls_url:d,prog_url:v,prog_id:p,file_codecs:m,video_file_codecs:b,logged_in:w,version:g},"MediaUrlBadRequest config","error")}-1!==o.name.indexOf("Mimir")&&(u=1,Dc.captureBreadcrumb(o.name,o,"ABR","error"));var y=new Error(o.message);y.name=o.name,Dc.captureException(y,null,u);var _=yc[o.name];if("function"==typeof _){var k=_();if(k.final&&e.off(Ti.ERROR,r),h=k.deferred?k.id:null,"DRMFailure"===o.name){var E=t.config.request.dynamic_drm_translation_map,T=o.message.code;E&&T&&E[T]&&(k.title=E[T].title,k.message=E[T].msg),Dc.captureBreadcrumb("DRM failure",o,"video")}e.fire(cc.cc,k.id,k)}}else e.fire(Zs.zs)}window.addEventListener("unload",(function(){n=!0}),!1),e.on(Ti.ERROR,r),e.on("test-error",r)}(),e.on(Zs.Fs,(function(n){var i=!!n&&(!Yi.iOS||Yi.iOS>=10);t.config.embed.loop=i,o.loop=i})),e.fire(Zs.Fs,t.config.embed.loop),e.on(cc.Mc,(function(n,i){t.events.fire(cc.Ic,i),t.events.fire(Zs.Os,null,n),l||e.fire(cc.Ac)})),e.on(cc.Dc,(function(){d||(s=!o.paused,f=!0,o.pause())})),e.on(cc.jc,(function(t){f=!1,l?t||A():e.fire(cc.Ac)})),e.on(Zs.Os,(function(n,i){if(!d){i||(i=(o.duration||t.config.video.duration)*Os(n,0,1));var r=o.duration?i/o.duration:0;e.fire(Zs.oc,i,r)}})),e.on(Zs.oc,(function(t){S(t)})),function(){e.on(Zs.Ls,(function(n,i,e){e&&(n+=o.volume),n=Ps(n=Os(n,0,1)),t.displayContext!==o&&(t.displayContext.volume=n),o.volume=n,o.muted=0===n,t.events.fire(cc.pc,n,i)})),e.on(Zs.Ds,(function(n){o.muted=!!n,t.events.fire(cc.pc,o.volume,!0)})),e.on(Ti.VOLUME_CHANGE,(function(){return e.fire(cc.pc,o.volume,!0)}));var n=t.config.request.cookie.volume;e.fire(Zs.Ls,n,!0),e.fire(Zs.Ds,t.config.embed.muted)}(),function(){var t;e.on(Zs.Vs,(function(i,e){(o.video.currentFile.mime===Xs||n.get(al))&&(e=!0),t=e,o.quality=i})),e.on(Zo,(function(n){e.fire(cc.mc,n,t)}))}(),function(){var t=o.playbackRate;e.on(Ti.RATE_CHANGE,(function(n){o.playbackRate!==t&&(e.fire(cc._c,o.playbackRate,t),t=o.playbackRate)})),e.on(Zs.uc,(function(t){o.playbackRate=t})),e.on(cc._loadVideo,(function(){try{o.playbackRate=1}catch(t){}}))}(),function(){function t(){d=!0,l&&!m&&(s=s||!o.paused,o.pause(),e.fire(cc.ir,o.currentTime))}function n(){d=!1,s&&!m&&(v||p||!u||e.fire(Zs.Ys),A())}e.on(cc.al,t),e.on(cc.sl,n),e.on(cc.Vc,(function(i,e){e.isCentered()&&(e.isVisible()?t():n())}))}(),e.on(cc.ml,(function(t){l&&!m&&(s=!o.paused,o.pause())})),e.on(cc.gl,(function(t){m||A()})),e.on(cc.Xc,(function(n,i){o.element.classList.remove("hide-webkit-controls"),n&&(p=!0),n||(l||Yi.browser.safari||(o.poster=t.preview.getThumbnail()),v=!0,setTimeout((function(){o.textTracks.forEach((function(t){"hidden"===t.mode&&(t.mode="showing")}))}),500)),i||!Yi.windowsPhone||Yi.browser.edge||e.fire(Zs.Xs,!0)})),e.on(cc.Qc,(function(t){o.poster="",t||o.pause(),l||o.element.classList.add("invisible"),v=!1,p=!1,a&&o.element.classList.add("hide-webkit-controls"),o.textTracks.forEach((function(t){"showing"===t.mode&&(t.mode="hidden")}))})),e.on(Xo,(function(){o.poster=""})),e.on(Zs.Xs,(function(t){if(t)return o.controls=!0,void i.classList.add("native-controls");o.controls=!1,i.classList.remove("native-controls")})),e.on(cc.Kl,(function(){C()})),e.on(cc.Bl,(function(){C(),I()})),e.on(Zs.Us,(function(){o.unload(),e.fire(cc.ir,o.currentTime),t.preview.show(),o.element.classList.add("invisible"),l=!1,s=!1,h=null})),function(){var n;e.on(Zs.Ks,(function(i){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n=e;try{t.config.request.flags.ott&&o.videoElement&&o.videoElement.setAttribute("crossorigin","anonymous"),o.enableTextTrack(i)}catch(t){}})).on(Zs.Js,(function(){var i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n=i,t.config.request.flags.ott&&o.videoElement&&o.videoElement.removeAttribute("crossorigin"),o.disableTextTrack()})),e.on(nu,(function(t,i){e.fire(cc.Bc,t,n||i)}))}(),e.on(Si.AVAILABLE,(function(n){var i=n.type;if(!t.config.request.drm)switch(i){case"AirPlay":e.fire(cc.Mf)}})),e.on(Si.UNAVAILABLE,(function(n){var i=n.type;if(!t.config.request.drm)switch(i){case"AirPlay":e.fire(cc.If)}})),e.on(Si.ACTIVATED,(function(t){var n=t.type;switch(m=!0,n){case"AirPlay":e.fire(cc.Rf)}})),e.on(Si.DEACTIVATED,(function(t){var n=t.type;switch(m=!1,n){case"AirPlay":e.fire(cc.Of)}})),e.on(cc.Lf,(function(){o.showExternalDisplayPicker("AirPlay")})),e.on(Zs.tc,(function(){o.supportsPresentationMode("picture-in-picture")&&(o.presentationMode="picture-in-picture")})),e.on(Zs.nc,(function(){o.supportsPresentationMode("picture-in-picture")&&(o.presentationMode="inline")})),C(),Yi.spatialPlayback?(e.fire(Zs.ic),e.on([Ti.PLAY,Ti.SEEKED],(function(){e.fire(Zs.rc)})),e.on(Mi.SPATIAL_UNSUPPORTED,(function(){l?e.fire(Js.Rs,d):e.once(cc.yc,(function(){e.fire(Js.Rs,d)}))}))):e.once(cc.yc,(function(){t.config.video.spatial&&e.fire(Js.Is,d)})),window.addEventListener("beforeunload",(function(){var n=t.config.request.drm;n&&M(n.hoover_url,n.user,n.asset,n.hoover_token)}),!1),e.on(cc._loadVideo,(function(){var n=t.config.request&&t.config.request.drm;n&&M(n.hoover_url,n.user,n.asset,n.hoover_token)})),t.events.on(Zs.ac,(function(){return o.destroy()})),t.config.embed.wirewax&&new yl(t,e),t.ready().then((function(){return setTimeout((function(){return I()}),0),t.config.embed.time>0&&e.fire(Zs.oc,t.config.embed.time,t.config.embed.time/o.duration),null})).catch((function(t){})),e.fire(cc.kf)}var kl,El=0,Tl=0,Sl={},Al={};function xl(t,n,i){return"_root"==n?i:t!==i?function(t){return kl||(kl=t.matches?t.matches:t.webkitMatchesSelector?t.webkitMatchesSelector:t.mozMatchesSelector?t.mozMatchesSelector:t.msMatchesSelector?t.msMatchesSelector:t.oMatchesSelector?t.oMatchesSelector:Rl.matchesSelector)}(t).call(t,n)?t:t.parentNode?(El++,xl(t.parentNode,n,i)):void 0:void 0}function Cl(t,n,i,e){Sl[t.id]||(Sl[t.id]={}),Sl[t.id][n]||(Sl[t.id][n]={}),Sl[t.id][n][i]||(Sl[t.id][n][i]=[]),Sl[t.id][n][i].push(e)}function Ml(t,n,i,e){if(Sl[t.id])if(n)if(e||i)if(e){if(Sl[t.id][n][i])for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=n.type,e=n.payload;switch(i){case"CONFIG_LOAD":return e.video.webinar?z(z({},t),e.video.webinar):null;case"WEBINAR_FORM_SUCCESS":return z(z({},t),{},{formSuccess:e.formSuccess,registrantUuid:e.registrantUuid});case"WEBINAR_REGISTRANT_UUID_AVAILABLE":return z(z({},t),{},{registrantUuid:e.registrantUuid});default:return t}}var Vl=function(t){var n;return!!(null==(n=t.webinar)?void 0:n.formSuccess)},Bl=function(t){var n;return null==(n=t.webinar)?void 0:n.registrantUuid},Hl=Object.freeze({__proto__:null,default:Fl,webinarFormSuccess:Vl,webinarRegistrantUuid:Bl});function ql(t,n){var i,e,r,o,u,a,s=0,c={},l=new Sc;function f(){return Date.now?Date.now():(new Date).getTime()}function h(){return t.config.video.spatial?"mono"!==t.config.video.spatial.stereo_mode?2:1:0}function d(){var n=t.backbone.getEffectByName("ThreeSixtyEffect");return Yi.spatialPlayback&&n?n.isStereo()?2:1:0}function v(){i=!1,e=t.backbone?t.backbone.currentTime:0,r=0,o=0,u=0,a=!1}function p(n,i,e,r){t.verifyConfig().then((function(){var o=i;o.signature=t.config.request.signature,o.session=t.config.request.session,o.time=t.config.request.timestamp,o.expires=t.config.request.expires;var u=JSON.stringify(o);if(null===o.sessionTime&&(Dc.captureBreadcrumb("sessionTime is null breadcrumbs",{endpoint:n,allParams:o}),Dc.captureException("sessionTime is null when making stats request")),!t.config.request.urls.player_telemetry_url)throw new Error("Stats logging failed due to lack of telemetry host");var a=t.config.request.urls.player_telemetry_url+n;return l.logRequestPromiseWithUrl(a,u,!e).then((function(n){if(200!==n.status&&r<2){if(410===n.status)return void t.events.once(cc.Kl,(function(){p(a,i,e,r+1)}));setTimeout((function(){p(a,i,e,r+1)}),1e3)}})).catch((function(t){throw t}))})).catch((function(t){}))}function m(i,e,o){var u=t.backbone.currentFile||{},a=u.id,s=void 0===a?0:a,l=u.mime,f=void 0===l?"video/mp4":l,v=u.metadata,m=(v=void 0===v?{}:v).profile,b=void 0===m?-1:m;if(f===Xs){var w=c,g=w.id;s=void 0===g?0:g;var y=w.profile;b=void 0===y?-1:y}t.performDelegateAction(sc,(function(a){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=function(a){var l,v,m=z(z({referrer:t.config.request.referrer,embed:!t.config.embed.on_site,context:t.config.embed.context,autoplay:c.continuous?2:t.config.embed.autoplay,loop:t.config.embed.loop?1:0,id:t.config.video.id,vodId:(null==(l=t.config.video.vod)?void 0:l.id)?t.config.video.vod.id:null,vodSaleId:(null==(v=t.config.video.vod)?void 0:v.sale_id)?t.config.video.vod.sale_id:null,sessionTime:Ps(r),videoShape:h(),spatialPlayback:d(),userId:t.config.user.id,userAccountType:t.config.user.account_type,userIsMod:t.config.user.mod?1:0,teamOriginUserId:t.config.user.team_origin_user_id?t.config.user.team_origin_user_id:null,teamId:t.config.user.team_id?t.config.user.team_id:null,ownerId:t.config.video.owner.id,ownerAccountType:t.config.video.owner.account_type,privacy:t.config.video.privacy,rating:t.config.video.rating?t.config.video.rating.id:null,type:"html",videoFileId:Number.isInteger(Number(s))?s:"0",delivery:fc[f],profileId:b,quality:u.metadata?u.metadata.quality:null,duration:Ps(t.config.video.duration),seconds:Ps(e)},a),{},{playbackRate:t.backbone.playbackRate,build:Ic(t.config)});if(t.config.video.webinar){if(!n.get(Bl)){var w=pl("".concat(t.config.video.webinar.id,"_webinar_registrant"));n.dispatch(Ul(w))}m.webinarRegistrantUuid=n.get(Bl)}p(i,m,o)},v=n.get(cl)?1:0,m=n.get(rl),w={isLive:v};if(v){if(!m)return void tr("https://".concat(t.config.vimeo_url,"/live_event/status?clip_id=").concat(t.config.video.id)).json().then((function(t){return t&&t.ingest&&(n.dispatch(Qc(t.ingest.start_time)),m=n.get(rl)),m&&(w.liveStartTime=m),l(w),t})).catch((function(t){}));w.liveStartTime=m}l(w)}))}function b(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t.playLoggingEnabled){var u=f();r&&o+1e3>u||(o=u,r&&!t.config.request.flags.partials||i||m("/log/partial",n,e))}}function w(n,i){var e,r;i=i||{};var o={referrer:t.config.request.referrer,embed:!t.config.embed.on_site,context:t.config.embed.context,id:t.config.video.id,vodId:(null==(e=t.config.video.vod)?void 0:e.id)?t.config.video.vod.id:null,vodSaleId:(null==(r=t.config.video.vod)?void 0:r.sale_id)?t.config.video.vod.sale_id:null,userId:t.config.user.id,userAccountType:t.config.user.account_type,userIsMod:t.config.user.mod?1:0,ownerId:t.config.video.owner?t.config.video.owner.id:0,duration:Ps(t.config.video.duration),seconds:Ps(t.backbone.currentTime),playbackRate:t.backbone.playbackRate,build:Ic(t.config)};for(var u in i)i.hasOwnProperty(u)&&(o[u]=i[u]);p("/log/"+n,o)}return v(),function(){t.events.on(Ti.TIME_UPDATE,(function(t){var n=t.currentTime,o=(t.duration,t.timeProgress,t.playbackRate),a=Math.floor(n);!i&&u+1e3e&&(r+=(n-e)/o),e=n),a%30==0&&b(n)})),t.events.on(cc._c,(function(n,i){w("playback_rate_change",{oldPlaybackRate:i}),b(t.backbone.currentTime)})),t.events.on(Xo,(function(){!a&&t.playLoggingEnabled&&(a=!0,m("/log/play",0))})),t.events.on(cc.ir,(function(n){t.backbone.ended||b(n)})),t.events.on(Ti.SEEKED,(function(t){var n=t.currentTime;s=n,i||b(s)})),t.events.on(cc.Dc,(function(){u=f(),i=!0})),t.events.on(cc.jc,(function(){e=t.backbone.currentTime,i=!1,b(s)})),t.events.on(cc.xc,(function(){b(t.backbone.currentTime)})),t.events.on(cc.vc,(function(){r+=t.config.video.duration-e,b(t.config.video.duration,!1,!1)})),t.events.on(xi.STREAM_CHANGE,(function(t){c=t}));var n=[],o=!1;function l(){n.length&&t.performDelegateAction(sc,(function(i){var e,r;p("/log/spatial",{embed:!t.config.embed.on_site,id:t.config.video.id,context:t.config.embed.context,ownerId:t.config.video.owner?t.config.video.owner.id:0,referrer:t.config.request.referrer,vodId:(null==(e=t.config.video.vod)?void 0:e.id)?t.config.video.vod.id:null,vodSaleId:(null==(r=t.config.video.vod)?void 0:r.sale_id)?t.config.video.vod.sale_id:null,userId:t.config.user.id,userAccountType:t.config.user.account_type,userIsMod:t.config.user.mod?1:0,teamOriginUserId:t.config.user.team_origin_user_id?t.config.user.team_origin_user_id:null,teamId:t.config.user.team_id?t.config.user.team_id:null,build:Ic(t.config),motionLog:JSON.stringify(n)},!1)}))}t.events.on(Mi.MOTION_START,(function(){o=!0,function i(){var e=t.backbone.getEffectByName("ThreeSixtyEffect").currentCoordinates,u=Math.round(100*e.lat)/100,a=Math.round(100*e.long)/100,s={sessionTime:r,videoTime:t.backbone.currentTime,coordinates:{lat:u,lon:a}};n.push(s),setTimeout((function(){o&&i()}),1e3)}()})),t.events.on(Mi.MOTION_END,(function(){o=!1,l()})),t.events.on(cc._loadVideo,(function(){l(),n=[]})),window.addEventListener("unload",(function(){t.backbone&&t.backbone.currentTime>0&&(b(t.backbone.currentTime,!0,!1),l())}),!1)}(),[{type:"share_press",event:cc.il},{type:"facebook_press",event:cc.fl},{type:"twitter_press",event:cc.hl},{type:"tumblr_press",event:cc.dl},{type:"email_press",event:cc.vl},{type:"embed_press",event:cc.el},{type:"login_success",event:cc.Pl},{type:"airplay",event:cc.Rf},{type:"vod_press",event:cc.rl},{type:"collection_press",event:cc.ol},{type:"email_capture_submitted",event:cc.wl}].forEach((function(n){t.events.on(n.event,function(t){return function(){w(t)}}(n.type))})),t.events.on(cc.Xl,(function(n){var i={outroType:t.config.embed.outro,ownerAccountType:t.config.video.owner.account_type,playerWidth:t.element.clientWidth,playerHeight:t.element.clientHeight};(null==n?void 0:n.length)&&(i.outroVideos=n.join(",")),w("outro_displayed",i)})).on(cc.Ql,(function(n){w("outro_video_press",{ownerAccountType:t.config.video.owner.account_type,videoId:n})})).on(cc.ul,(function(){w("outro_follow_press",{add:!t.config.user.following})})).on(cc.df,(function(n){w("outro_cta_press",{ownerAccountType:t.config.video.owner.account_type,link:n})})).on(cc.sf,(function(n){w("outro_link_press",{ownerAccountType:t.config.video.owner.account_type,link:n})})).on(cc.hf,(function(n){w("outro_image_press",{ownerAccountType:t.config.video.owner.account_type,link:n})})).on(cc.tl,(function(){w("like_press",{add:!t.config.user.liked})})).on(cc.nl,(function(){w("watch_later_press",{add:!t.config.user.watch_later})})).on(cc.ml,(function(t){0===t.indexOf("login-")&&w("login_attempt")})).on(cc.Bc,(function(t,n){n||(t?w("text_track_change",{textTrackLanguage:t.language,textTrackKind:t.kind}):w("text_track_change"))})).on(cc.Kc,(function(t){1!==t&&12!==t||w("badge_press",{badgeId:t})})).on(cc.al,(function(t){"email-capture"===t&&w("email_capture_displayed")})).on(cc.sl,(function(t){"email-capture"===t&&w("email_capture_dismissed")})).on(cc.pf,(function(n){w("card_press",{ownerAccountType:t.config.video.owner.account_type,cardId:n,cardType:"link"})})).on(cc.vf,(function(n,i){t.config.embed.editor||w("card_displayed",{ownerAccountType:t.config.video.owner.account_type,cardId:n,cardType:i.url?"link":"text"})})),t.events.on(cc.Bl,(function(t){t&&v()})),t.events.fire(cc.Sf),{}}function Wl(t,n){return null==t||t!=t?n:t}function zl(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"CONFIG_LOAD":return z(z({},t),n.payload);default:return t}}var Gl={settings:{}};function Yl(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gl,n=arguments.length>1?arguments[1]:void 0,i=n.type,e=n.payload;switch(i){case"CONFIG_LOAD":return z(z({},t),e.embed);default:return t}}var Kl=Object.freeze({__proto__:null,default:Yl,transparent:function(t){return t.embed.transparent}});function Jl(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=n.type,e=n.payload;switch(i){case"CONFIG_LOAD":return z(z({},t),e.video);default:return t}}var $l=function(t){return t.video.height/t.video.width},Xl=Object.freeze({__proto__:null,default:Jl,ratio:$l});function Zl(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"CONTAINER_RESIZE":return z(z({},t),{},{width:n.payload.width,height:n.payload.height});default:return t}}var Ql=function(t){return t.ui.container.width},tf=function(t){return t.ui.container.height},nf=Object.freeze({__proto__:null,default:Zl,width:Ql,height:tf});function ef(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"PREVIEW_SET_SIZE":return z(z({},t),{},{width:n.payload.width,height:n.payload.height});default:return t}}var rf=Object.freeze({__proto__:null,default:ef,scaleFactor:function(t){return Rs({width:t.ui.preview.width,height:t.ui.preview.height,elementWidth:Tf(t),elementHeight:Sf(t)}).scaleFactor}});function of(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"CARDS_SET_SIZE":return z(z({},t),{},{size:n.payload});default:return t}}var uf=function(t){return t.ui.cards.size>0&&t.ui.container.width>=200&&t.ui.container.width<415},af=function(t){return uf(t)?60:0},sf=Object.freeze({__proto__:null,default:of,isCarouselVisible:uf,isCardsThumbVisible:function(t){return t.ui.cards.size>0&&t.ui.container.width>=300},getCarouselHeight:af});function cf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wc,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"CAPTIONS_SET_FONT_SIZE":return z(z({},t),{},{fontSize:n.payload});case"CAPTIONS_SET_COLOR":return z(z({},t),{},{color:n.payload});case"CAPTIONS_SET_FONT_FAMILY":return z(z({},t),{},{fontFamily:n.payload});case"CAPTIONS_SET_BACKGROUND_OPACITY":return z(z({},t),{},{bgOpacity:n.payload});case"CAPTIONS_SET_BACKGROUND_COLOR":return z(z({},t),{},{bgColor:n.payload});case"CAPTIONS_SET_EDGE_STYLE":return z(z({},t),{},{edgeStyle:n.payload});default:return t}}var lf=Object.freeze({__proto__:null,default:cf,calculatedFontSize:function(t){return Math.max(10,Math.round(.045*Sf(t)*t.ui.captions.fontSize))},fontFamily:function(t){return t.ui.captions.fontFamily},color:function(t){return t.ui.captions.color},backgroundOpacity:function(t){return t.ui.captions.bgOpacity},backgroundColor:function(t){return t.ui.captions.bgColor},edgeStyle:function(t){return t.ui.captions.edgeStyle}}),ff=i((function(t,n){function i(t,n){return t===n}function e(t,n,i){if(null===n||null===i||n.length!==i.length)return!1;for(var e=n.length,r=0;r1&&void 0!==arguments[1]?arguments[1]:i,r=null,o=null;return function(){return e(n,r,arguments)||(o=t.apply(null,arguments)),r=arguments,o}}function o(t){var n=Array.isArray(t[0])?t[0]:t;if(!n.every((function(t){return"function"==typeof t}))){var i=n.map((function(t){return typeof t})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+i+"]")}return n}function u(t){for(var n=arguments.length,i=Array(n>1?n-1:0),e=1;e1&&void 0!==arguments[1]?arguments[1]:a;if("object"!=typeof t)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof t);var i=Object.keys(t);return n(i.map((function(n){return t[n]})),(function(){for(var t=arguments.length,n=Array(t),e=0;e1},bf=function(t){return t.embed.transparent&&!mf(t)?df(t):Ql(t)},wf=function(t){return t.embed.transparent&&!mf(t)?vf(t):tf(t)},gf=function(t){return t.embed.transparent&&!mf(t)?"contain":"100% 100%"},yf=ff.createSelector(bf,wf,(function(t,n){return{width:t,height:n}})),_f=ff.createSelector($l,gf,hf,(function(t,n,i){return{ratio:t,size:n,bottom:i}})),kf=Object.freeze({__proto__:null,bottom:hf,scaleFactor:pf,width:bf,height:wf,size:gf,boundingRect:yf,settings:_f}),Ef={xxs:0,xs:390,sm:600,md:960,lg:1280,xl:1600,xxl:1920},Tf=function(t){return bf(t)},Sf=function(t){return wf(t)-hf(t)},Af=ff.createSelector(Tf,Sf,(function(t,n){return{width:t,height:n}})),xf=function(t){return Sf(t)>Tf(t)},Cf=function(t){var n=Tf(t),i=Sf(t);if(xf(t))return n<225;var e=Lu(t.embed.settings.customLogo)&&n<300||i<169,r=!Lu(t.embed.settings.customLogo)&&(n<338||i<190);return e||r},Mf=function(t){var n=Tf(t);if(xf(t))return n<300;var i=Lu(t.embed.settings.customLogo)&&n<=375,e=!Lu(t.embed.settings.customLogo)&&n<=450;return i||e},If=function(t){var n=Tf(t);return n>=Ef.xxs&&n=Ef.xs&&n=Ef.sm&&n=Ef.md&&n=Ef.lg&&n=Ef.xl&&n=Ef.xxl},Pf=Object.freeze({__proto__:null,breakpoints:Ef,width:Tf,height:Sf,boundingRect:Af,isTinyMode:Cf,isMiniMode:Mf,mode:function(t){return Cf(t)?"tiny":Mf(t)?"mini":"normal"},xxs:If,xs:Rf,sm:Of,md:Lf,lg:Df,xl:jf,xxl:Nf,breakpoint:function(t){var n={xxs:If,xs:Rf,sm:Of,md:Lf,lg:Df,xl:jf,xxl:Nf};return Object.keys(Ef).find((function(i){return n[i](t)}))}}),Uf=Object.freeze({__proto__:null,scaleFactor:function(t){return Rs({width:t.video.width,height:t.video.height,elementWidth:Tf(t),elementHeight:Sf(t)}).scaleFactor}}),Ff=Object.freeze({__proto__:null,isLinkTitleVisible:function(t){var n=t.ui;return n.container.width>=360&&n.container.height>=203||n.container.width>=415},isLinkDescriptionVisible:function(t){var n=t.ui;return n.container.width>=360&&n.container.height>=340||n.container.width>=415&&n.container.height>=234}}),Vf=Object.freeze({__proto__:null,isEmailCaptureVisible:function(t){var n=t.ui;return n.container.width>=300&&n.container.height>=169}}),Bf=Object.freeze({__proto__:null,isPrefsMenuCentered:function(t){return Yi.touch&&Tf(t)<415}});function Hf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return{container:Zl(t.container,n),preview:ef(t.preview,n),cards:of(t.cards,n),captions:cf(t.captions,n)}}var qf=Object.freeze({__proto__:null,default:Hf,container:nf,layout:kf,player:Pf,preview:rf,video:Uf,cards:sf,outro:Ff,overlay:Vf,controlbar:Bf,captions:lf});function Wf(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=z(z({},zl(t,n)),{},{embed:Yl(t.embed,n),video:Jl(t.video,n),liveEvent:tl(t.liveEvent,n),webinar:Fl(t.webinar,n)});return z(z({},i),{},{ui:Hf(t.ui,n,i)})}var zf=Object.freeze({__proto__:null,default:Wf,embed:Kl,video:Xl,liveEvent:hl,ui:qf,webinar:Hl});function Gf(t,n,i){var e=!1,r=!1;function o(t){i.style.fontSize="".concat(t,"px")}function u(t){i.style.fontFamily=t}function a(t){i.style.color=t}function s(t){["opacity-default","opacity-100","opacity-75","opacity-50","opacity-25","opacity-0"].forEach((function(t){i.classList.remove(t)})),i.classList.add("opacity-".concat(t))}function c(t){["color-white","color-red","color-green","color-blue","color-yellow","color-black"].forEach((function(t){i.classList.remove(t)})),i.classList.add("color-".concat(t))}function l(t){["edge-none","edge-shadow","edge-outline"].forEach((function(t){i.classList.remove(t)})),i.classList.add("edge-".concat(t))}function f(){i.classList.add("hidden"),i.setAttribute("hidden","")}function h(){"picture-in-picture"!==t.backbone.presentationMode&&(t.config.embed.settings.background||(i.classList.remove("hidden"),i.removeAttribute("hidden")))}function d(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];i.firstChild;)i.removeChild(i.firstChild);if(t.length){var n=document.createDocumentFragment();t.forEach((function(t){var i=document.createElement("span"),e=t.html;i.innerHTML=e,n.appendChild(i)})),i.appendChild(n)}}return t.events.on(tu,(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(d(n),n.length)return e?void h():void(r=!0);f()})).on(cc.Bc,(function(t){if(t)return i.setAttribute("lang",t.language),void i.setAttribute("dir",t.rtl?"rtl":"ltr");i.removeAttribute("dir"),i.removeAttribute("lang")})).on(Xo,(function(){e=!0,r&&(r=!1,h())})).on(ou,(function(){f()})).on(uu,(function(){h()})).on(Zs.Us,(function(){e=!1,f()})),function(){var t={calculatedFontSize:o,fontFamily:u,color:a,backgroundOpacity:s,backgroundColor:c,edgeStyle:l};Object.keys(t).forEach((function(i){n.watch("ui.captions.".concat(i),t[i]),t[i](n.get("ui.captions.".concat(i)))}))}(),t.events.on(cc.Uc,(function(t){t?i.classList.add("with-controls"):i.classList.remove("with-controls")})),t.events.on(cc.al,(function(){i.classList.add("invisible")})).on(cc.sl,(function(){i.classList.remove("invisible")})),t.events.on(cc.vc,(function(){"nothing"!==t.config.embed.outro&&i.classList.add("invisible")})).on([Ti.PLAY,cc.Dc],(function(){i.classList.remove("invisible")})),{}}var Yf=i((function(t){!function(){var n={templates:{},render:function(t,i){return n.templates[t]?n.templates[t].call(n,i||{}):""},map:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},escape:function(t){return null==t?"":String(t).replace(/[&<>"'\\/]/g,(function(t){return n.map[t]}))},helpers:{}};n.templates.adcountdown=function(t){return'
'},n.templates.notice=function(t){return""+t.strings.text+" "},n.templates.stream_studder=function(t){var n=" ";return(n+=this.render("icon_warning")||"")+' Having issues? Switch to Auto for smoother streaming. '},n.templates.warning_alert=function(t){var n=" ";return(n+=this.render("icon_warning")||"")+" "+t.strings.text+" "},n.templates.badge=function(t){var n="";return t.badge&&(t.badge.link&&(n+=''),n+=' ',t.badge.link&&(n+=" "),n+=""),n+""},n.templates.buffer_pattern=function(t){return' '},n.templates.card=function(t){var n=' ',t.url&&(n+='
'),n+=' ',t.image&&(n+='
'),n+='
',n+=this.escape(t.headline)||"",n+=" ",t.url&&(n+=this.render("icon_card_arrow")||""),n+=" ",t.teaser&&(n+='
',n+=this.escape(t.teaser)||"",n+="
"),n+="
",t.url&&(n+=" "),n+"
"},n.templates.chapter_marker=function(t){var n=''+t.index+" ";return(n+=this.escape(t.chapter.text)||"")+"
"},n.templates.chapters=function(t){for(var n="",i=0;i ':n+=' ',n+""},n.templates.controlbar_trailer=function(t){var n='';return n+=this.render("icon_play")||"",n+=" "+t.text+"
",t.vimeoLogo.show&&(n+=' "),n+="",t.customLogo&&(n+=' "),n+""},n.templates.controlbar=function(t){var n=' ';return n+=this.render("buffer_pattern",{id:"tiny-buffer"})||"",n+='
'+t.playIcon+'
'+t.pauseIcon+'
'+t.replayIcon+'
',n+=this.render("live_status")||"",n+=this.render("live_viewer_count")||"",n+='
",t.volume&&(n+='
'),t.castButton&&(n+='
'),t.ccButton&&(n+='
'+t.captionsIcon+" "),t.prefsButton&&(n+='
'+t.settingsIcon+" "),t.chapters&&(n+='
'+t.chaptersIcon+" "),t.airplayButton&&(n+='
',n+=this.render("icon_airplay")||"",n+=" "),t.stereoscopicButton&&(n+='
',n+=this.render("icon_stereoscopic")||"",n+=" "),n+='
',n+=this.render("icon_pip")||"",n+=' '+t.fullscreenIcon+'
'+t.unfullscreenIcon+"
",t.vimeoLogo.show&&(n+='
"),n+="
",t.customLogo&&(n+=' "),n+""},n.templates.debug_panel=function(t){var n="";return t.clipId&&(n+='Clip ID: '+t.clipId+"
"),n+=" ",n+=this.render("debug_values",t)||"",n+="
",t.hideCloseButton||(n+='',n+=this.render("icon_close")||"",n+=" "),n+=' ',t.isCopyDisabled||(n+='Copy Debug Payload '),n+="",t.isDNTEnabled&&(n+="No Debug Key available as Do Not Track is enabled."),n+""},n.templates.debug_values=function(t){var n="";return t.delivery&&(n+="Delivery: "+t.delivery+"
"),n+="",t.codec&&(n+="Codec: "+t.codec+"
"),n+="",t.resolution&&(n+="Playing: "+t.resolution+"
"),n+="",t.embedSize&&(n+="Embed Size: "+t.embedSize+"
"),n+="",t.isDash&&(n+="Separate AV: "+t.separateAudioVideo+"
"),n+="",(t.isDash||t.isLive)&&(n+="Dropped Frames: "+t.droppedFrames+" / "+t.totalFrames+" - "+t.droppedFramesPercent+"
"),n+="",t.vrHeadsetName&&(n+="VR Hardware: "+t.vrHeadsetName+"
"),n+="",t.isLive&&(n+="Live Latency: "+t.liveLatency+"
"),n+="",t.isLive&&t.liveSessionID&&(n+="Live Session ID: "+t.liveSessionID+"
"),n+="",t.p2pSources&&(n+="P2P: "+t.p2pSources+" - "+t.p2pOffload+"
"),n+="",t.drmEnabled&&(n+="DRM: Enabled; Fastly DRM: "+t.drmFastly+"
"),n+="Playhead / Buffer: "+t.currentTime+" / "+t.bufferEnd+" / "+t.bufferAhead+"
",(t.isDash||t.isLive)&&(n+="Bandwidth: "+t.bandwidthKbps+'
('+t.bandwidthMinKbps+' '+t.bandwidthMaxKbps+' )
'+t.bandwidthSeriesSvg+"
"),n+="",t.sessionId&&t.showSessionId&&(n+='Debug Key: '+t.sessionId+"
"),n+""},n.templates.icon_airplay=function(t){return' '},n.templates.icon_back=function(t){return' '},n.templates.icon_broken_heart=function(t){return' '},n.templates.icon_card_arrow=function(t){return' '},n.templates.icon_cc=function(t){return''+t.title+' '},n.templates.icon_chapters=function(t){return''+t.title+' '},n.templates.icon_check=function(t){return" "},n.templates.icon_circle_info=function(t){return' '},n.templates.icon_clock=function(t){return' '},n.templates.icon_close_new=function(t){return' '},n.templates.icon_close=function(t){return' '},n.templates.icon_collections=function(t){return' '},n.templates.icon_dolby_vision=function(t){return'Dolby Vision '},n.templates.icon_embed=function(t){return''+t.title+' '},n.templates.icon_facebook=function(t){return''+t.title+' '},n.templates.icon_fast_forward=function(t){return' '},n.templates.icon_follow=function(t){return' '},n.templates.icon_fullscreen=function(t){return''+t.title+' '},n.templates.icon_gear=function(t){return''+t.title+' '},n.templates.icon_heart=function(t){return' '},n.templates.icon_line_arrow=function(t){return' '},n.templates.icon_live_viewers=function(t){return' '},n.templates.icon_lock=function(t){return' '},n.templates.icon_mail=function(t){return''+t.title+' '},n.templates.icon_muted=function(t){return' '},n.templates.icon_pause=function(t){return''+t.title+' '},n.templates.icon_pip=function(t){return' '},n.templates.icon_play=function(t){return''+t.title+' '},n.templates.icon_prev=function(t){return' '},n.templates.icon_replay=function(t){return''+t.title+' '},n.templates.icon_share=function(t){return' '},n.templates.icon_spin=function(t){return' '},n.templates.icon_stereoscopic=function(t){return' '},n.templates.icon_tumblr=function(t){return''+t.title+' '},n.templates.icon_twitter=function(t){return''},n.templates.icon_unfullscreen=function(t){return''+t.title+' '},n.templates.icon_vod_download=function(t){return' '},n.templates.icon_vod_rent=function(t){return' '},n.templates.icon_vod_subscribe=function(t){return' '},n.templates.icon_vod=function(t){return' '},n.templates.icon_warning=function(t){return' '},n.templates.live_status=function(t){return''},n.templates.live_viewer_count=function(t){var n=' ';return(n+=this.render("icon_live_viewers")||"")+'
0 '},n.templates.logo=function(t){return'Vimeo '},n.templates.menu_list_panel=function(t){var n=''+t.title+' '+t.active+" ";n+=this.render("icon_line_arrow")||"",n+='
';for(var i=0;i ',t.items[i].index&&(n+=''+t.items[i].index+" "),n+=' '+t.items[i].label+" ";return n+'
'},n.templates.menu=function(t){var n='"},n.templates.nudge=function(t){var n='
';return n+=this.render("icon_fast_forward")||"",n+='
',(n+=this.render("icon_fast_forward")||"")+"
"},n.templates.outer=function(t){var n='
';return n+=this.render("icon_spin")||"",n+='
',n+=this.render("icon_prev")||"",n+=' ',(n+=this.render("icon_close_new")||"")+'
This opens in a new window. '},n.templates.sidedock=function(t){var n="";return t.vodButton&&(n+=' '+t.vodDisplayLabel+" ",n+=this.render("icon_vod")||"",n+='
'),t.likeButton&&(n+='
'+(t.liked?t.strings.unlike:t.strings.like)+' ',n+=this.render("icon_heart")||"",n+="
"),t.watchLaterButton&&(n+='
'+(t.addedToWatchLater?t.strings.watchLaterRemove:t.strings.watchLaterAdd)+' ',n+=this.render("icon_clock")||"",n+="
"),t.collectionsButton&&(n+='
'+t.strings.collections+' ',n+=this.render("icon_collections")||"",n+="
"),t.shareButton&&(n+='
'+t.strings.share+' ',n+=this.render("icon_share")||"",n+="
"),t.vodButton&&(n+="
"),n+""},n.templates.app_redirect=function(t){var n=' ';return t.strings.title&&(n+='
'+t.strings.title+"
"),t.hideRedirectButton||(n+='
"),t.strings.ignoreText&&(n+='
'+t.strings.ignoreText+"
"),t.strings.bottomText&&(n+='
'+t.strings.bottomText+"
"),n+"
"},n.templates.email_capture_disclaimer=function(t){var n='"},n.templates.email_capture_field=function(t){var n="";return t.field.required?(n+=' ',n+=this.escape(t.field.field_name)||"",n+='
'):(n+=' ',n+=this.escape(t.field.field_name)||"",n+='
'),n+""},n.templates.email_capture_fields=function(t){for(var n="",i=0;i'},n.templates.email_capture_skip=function(t){var n="";return t.positionIsAfter&&(n+=' '),n+="",t.positionIsAfter||(n+=' '),n+""},n.templates.email_capture_start_time=function(t){return' '+t.startTime+"
"},n.templates.email_capture_title=function(t){var n="";return(n+=this.escape(t.title)||"")+""},n.templates.email_capture=function(t){var n='"},n.templates.error=function(t){var n=''+t.aria_label+"
";return t.title&&(n+="
"+t.title+" "),t.message&&(n+="
"+t.message+"
"),n+"
"},n.templates.help=function(t){var n=''+t.strings.title+'
↑ '+t.strings.volumeUp+'
↓ '+t.strings.volumeDown+'
→ '+t.strings.scrubForward+'
← '+t.strings.scrubBackwards+'
L '+t.strings.like+'
S '+t.strings.share+'
W '+t.strings.watchLater+'
C '+t.strings.captions+'
H '+t.strings.prefs+'
F '+t.strings.fullscreen+" ";return t.onSite||(n+='
V '+t.strings.viewOnVimeo+" "),n+" "},n.templates.outro_email=function(t){var n='
'},n.templates.outro_image=function(t){var n='"},n.templates.outro_link=function(t){var n='
',t.title&&(n+='
',n+=this.escape(t.title)||"",n+=" "),t.description&&(n+='
',n+=this.escape(t.description)||"",n+="
"),t.text&&t.url&&(n+='
"),t.text2&&t.url2&&(n+='
"),n+"
"},n.templates.outro_nothing=function(t){return'
'},n.templates.outro_share=function(t){var n='
',(n+=this.render("icon_prev")||"")+" "},n.templates.outro_staticimage=function(t){var n='"},n.templates.outro_text=function(t){return'"},n.templates.outro_videos=function(t){var n='
"}return n+""},n.templates.outro_vod=function(t){var n=' ";var i=t.countries,e=t.country;if(this.helpers.isAvailableInCountry(i,e))if(t.purchased)n+='
'+t.strings.watch+" ";else{if(!t.isComingSoon){n+='
"}(t.isPreorder||t.isComingSoon)&&(n+="
"+t.strings.preRelease+"
")}return n+"
"},n.templates.password=function(t){return''},n.templates.private_locked=function(t){return''+t.strings.title+' '+t.strings.subtitle+'
"},n.templates.private_unlocked=function(t){return''+t.strings.title+' '+t.strings.subtitle+'
'+t.strings.watch+" "},n.templates.share=function(t){var n=''+t.strings.share+' ",t.embed&&(n+=' "),t.url&&(n+=' "),n+=" ",t.embed&&(n+='
'+t.strings.embedTitle+' '+t.strings.embedSubtitle+'
",t.customizeEmbed&&(n+=' "),n+="
"),n+"
"},n.templates.webinar_confirmation=function(t){var n=' ';return t.customLogo&&(n+=this.render("email_capture_logo",{url:t.customLogo})||""),t.webinarStartTime&&(n+=this.render("email_capture_start_time",{startTime:t.webinarStartTime})||""),n+'
'+t.strings.thank_you+' '+t.strings.thank_you_subtitle+"
"},n.templates.webinar_disclaimer=function(t){var n='"},n.templates.webinar_ended=function(t){var n=' ';return t.strings.title&&(n+='
'+t.strings.title+"
"),n+"
"},n.templates.webinar_registration_bypass_btn=function(t){var n="";return t.showWebinarLogin?t.showWebinarLogin&&(n+=' '+t.regGoBack+" "):n+=' '+t.regBypass+" ",n+""},n.templates.threesixty_reminder=function(t){var n=' ';return t.showArrows&&(n+='
'),n+"
"+t.text+"
"},n.templates.time_series_graph=function(t){return' '+t.markers+" "},n.templates.title_byline_badge=function(t){var n="";return t.displayBadge&&(n+=" ",t.link&&(n+='"),n+=' '+t.cssClass+" ",t.link&&(n+=" "),n+=""),n+""},n.templates.title_owner_byline=function(t){var n="";return t.linkToOwner?(n+='',n+=this.escape(t.owner)||"",n+=" "):(n+='',n+=this.escape(t.owner)||"",n+=" "),n+""},n.templates.title=function(t){var n='"},n.templates.unmute_button=function(t){var n=' ';return(n+=this.render("icon_muted")||"")+' '+t.title+" "},t.exports?t.exports=n:window.Aftershave=n}()}));function Kf(t,n){var i,e=t.querySelector(".vp-shade"),r=t.querySelector(".vp-spin");function o(){clearTimeout(i),e.classList.add("vp-shade-invisible"),r.classList.add("vp-spin-invisible")}return n.on(xi.BUFFER_STARTED,(function(){clearTimeout(i),i=setTimeout((function(){e.classList.remove("vp-shade-invisible"),r.classList.remove("vp-spin-invisible")}),600)})),n.on([xi.BUFFER_ENDED,cc.ir],o),Jc.on(Gc.buffering,(function(){r.classList.remove("vp-spin-invisible")})),Jc.on([Gc.playing,Gc.paused],(function(){clearTimeout(i),r.classList.add("vp-spin-invisible")})),Jc.on(Gc.connected,(function(){e.classList.remove("vp-shade-invisible")})),Jc.on(Gc.disconnected,(function(){o()})),{}}var Jf=function(t){return function(n){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r=12?"PM":"AM";return(n=(n%=12)||12)+":"+(i=i<10?"0"+i:i)+" "+e}function rh(t,n){var i=Math.floor(t/3600%60),e=Math.floor(t/60%60);if(t=Math.floor(t%60),n){var r=t+" second"+(1===t?"":"s");return e>0&&(r=e+" minute"+(1===e?"":"s")+", "+r),i>0&&(r=i+" hour"+(1===i?"":"s")+", "+r),r}return(i>0?i+":":"")+oh(e,2)+":"+oh(t,2)}function oh(t,n,i){return t=String(t),new Array(n-t.length+1).join(i||"0")+t}function uh(t){return"".concat(Zf[t.getDay()],", ").concat(Xf[t.getMonth()]," ").concat(t.getDate(),", ").concat(t.getFullYear()," ").concat("at"," ").concat(eh(t))}function ah(t,n,i){var e=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Ft(i)&&(e="leading"in i?!!i.leading:e,r="trailing"in i?!!i.trailing:r),Fc(t,n,{leading:e,maxWait:n,trailing:r})}var sh=function(){if(void 0!==j)return j;function t(t,n){var i=-1;return t.some((function(t,e){return t[0]===n&&(i=e,!0)})),i}return(function(){function n(){this.gh=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.gh.length},enumerable:!0,configurable:!0}),n.prototype.get=function(n){var i=t(this.gh,n),e=this.gh[i];return e&&e[1]},n.prototype.set=function(n,i){var e=t(this.gh,n);~e?this.gh[e][1]=i:this.gh.push([n,i])},n.prototype.delete=function(n){var i=this.gh,e=t(i,n);~e&&i.splice(e,1)},n.prototype.has=function(n){return!!~t(this.gh,n)},n.prototype.clear=function(){this.gh.splice(0)},n.prototype.forEach=function(t,n){void 0===n&&(n=null);for(var i=0,e=this.gh;i0},t.prototype.connect_=function(){ch&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),dh?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){ch&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var n=t.propertyName,i=void 0===n?"":n;hh.some((function(t){return!!~i.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),ph=function(t,n){for(var i=0,e=Object.keys(n);i0},t}(),Ah=void 0!==N?new N:new sh,xh=function t(n){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=vh.getInstance(),e=new Sh(n,i,this);Ah.set(this,e)};["observe","unobserve","disconnect"].forEach((function(t){xh.prototype[t]=function(){var n;return(n=Ah.get(this))[t].apply(n,arguments)}}));var Ch=void 0!==lh.ResizeObserver?lh.ResizeObserver:xh;function Mh(t,n,i){var e=u()?i.parentElement:i,r=ah(o,150);function o(){var t=Ms(e),i=t.width,r=t.height;n.dispatch(function(t,n){return{type:"CONTAINER_RESIZE",payload:{width:t,height:n}}}(i,r))}function u(){return i.parentElement===document.body}function a(t){var n=t.size,r=t.ratio,o=t.bottom;u()&&(e.classList.toggle("vp-center","contain"===n),function(t,n){[].concat(["height","max-width","max-height","bottom"]).map((function(n){return t.style.removeProperty(n)}))}(i),"contain"!==n?o>0&&Hs(i,{height:"calc(100% - ".concat(o,"px)"),bottom:"".concat(o/2,"px")}):Hs(i,o>0?{maxWidth:"calc((100vh - ".concat(o,"px) / ").concat(r,")"),maxHeight:"calc(100vh - ".concat(o,"px)"),height:"calc(".concat(r," * 100vw)"),bottom:"".concat(o/2,"px")}:{maxWidth:"calc(100vh / ".concat(r,")"),height:"calc(".concat(r," * 100vw)")}))}n.watch("ui.layout.bottom",(function(n){t.events.fire(cc.mf,[{bottom:n}])})),n.watch("ui.layout.settings",a),a(n.get("ui.layout.settings")),new Ch(r).observe(e),window.addEventListener("orientationchange",r),t.events.on(cc.Xc,r),t.events.on(cc.Qc,r),o()}function Ih(t,n,i){this.constructorName="MessageApiError",this.message=t,this.name=n,this.source=i}function Rh(t){return t}function Oh(t){if(!t||""===t)return{};if("object"===V(t))return t;try{return JSON.parse(t)}catch(t){return{}}}function Lh(t){}Ih.prototype=new Error;var Dh={captureException:function(t){},captureMessage:function(t){},captureBreadcrumb:function(){}},jh=Dh,Nh=function(t){jh=Object.assign({},Dh,t)},Ph=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"backbone",e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"info";return jh.captureBreadcrumb(t,n,i,e)};function Uh(t){var n=function(t){var n=document.referrer||t;try{n=decodeURIComponent(n)}catch(t){n=unescape(n)}return n}(t),i={},e={},o={parseMessage:Oh,buildMessage:Rh,logError:Lh},u={},a={get methods(){return i},extendMethods:function(){for(var t=arguments.length,n=new Array(t),e=0;e1?n-1:0),e=1;e-1))try{var a=function(t,n){if(!t)return null;var i=Object.getOwnPropertyDescriptor(n,t);if(i&&"function"==typeof i.value)return i.value;if(i&&"function"==typeof i.get)return i.get;var e=t.substr(0,3),r=t.substr(3,1).toLowerCase()+t.substr(4);return i=Object.getOwnPropertyDescriptor(n,r),"get"===e&&i&&"function"==typeof i.get?i.get:"set"===e&&i&&"function"==typeof i.set?i.set:null}(e,i);if(!a)throw new Ih("“".concat(t,"” is not a valid method. Valid methods are: ").concat(function(t){return Object.keys(t).reduce((function(n,i){var e=Object.getOwnPropertyDescriptor(t,i);return"function"==typeof e.value?(n.push(i),n):("function"==typeof e.get&&n.push("get"+i.charAt(0).toUpperCase()+i.slice(1)),"function"==typeof e.set&&n.push("set"+i.charAt(0).toUpperCase()+i.slice(1)),n)}),[]).sort()}(i).join(", "),"."),"TypeError",e);Ph("API message received",n,"api"),r.resolve(a.call(t,u)).then((function(t){return c({method:e,value:null==t?u:t})})).catch(o.logError)}catch(t){o.logError(t)}}}),!1),a}function Fh(t){return t.account_type&&"basic"!==t.account_type&&!/_lapsed|_expired/.test(t.account_type)}var Vh=self!==top,Bh=function(){var t=document.createElement("video"),n={request:["requestFullscreen","webkitRequestFullscreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"],exit:["exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],enabled:["fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled"],element:["fullscreenElement","webkitFullscreenElement","webkitCurrentFullScreenElement","mozFullScreenElement","msFullscreenElement"],change:["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],error:["fullscreenerror","webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"]},i={};for(var e in n)for(var r=0,o=n[e].length;r0){var i=$h.pop();n=n||i.element,i.error.call(n,t),nd.onerror(n,t),zh(Hh.ERROR,n,t)}},nd={request:function(t,n,i,e){if(t=t||document.body,$h.push({element:t,enter:n||Jh,exit:i||Jh,error:e||Jh}),void 0===Bh.request)return Xh(t);if(Vh&&!1===document[Bh.enabled])return Xh(t);try{t[Bh.request]()}catch(n){td("not_enabled",t)}},exit:function(){!document[Bh.exit]&&nd.element?nd.element[Bh.exit]():document[Bh.exit]()},toggle:function(t,n,i,e){nd.element?nd.exit():nd.request(t,n,i,e)},videoEnabled:function(t){if(nd.enabled)return!0;var n=Yh(t=t||document.body);return!(!n||void 0===n.webkitSupportsFullscreen)&&(n.readyState-1&&Wh[t].splice(i,1)})),onenter:Jh,onexit:Jh,onchange:Jh,onerror:Jh};try{Object.defineProperties(nd,{element:{enumerable:!0,get:function(){return Kh&&Kh.webkitDisplayingFullscreen?Kh:document[Bh.element]||null}},enabled:{enumerable:!0,get:function(){return document[Bh.enabled]||!1}}})}catch(t){nd.element=null,nd.enabled=!1}function id(t){return"string"==typeof(t=t.replace("#",""))&&(3===t.length||6===t.length)&&!isNaN(parseInt(t,16))}function ed(t){var n=/rgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(,\s*([\d.]+))?\)/.exec(t);if(!n)throw new Error("Invalid rgb value");return{red:parseInt(n[1],10),green:parseInt(n[2],10),blue:parseInt(n[3],10),alpha:parseFloat(n[5])||1}}function rd(){for(var t=arguments.length,n=new Array(t),i=0;i=0)return this.rgba=ed(n[0]),this;if(!id("".concat(n[0])))throw new Error("Invalid hex value");return this.hex=n[0],this}if(3===n.length||4===n.length){for(var r=0;r<3;r++)if(isNaN(parseInt(n[r],10))||parseInt(n[r],10)<0||parseInt(n[r],10)>255)throw new Error("Invalid rgb value");if(n[3]&&parseFloat(n[3])<0||parseFloat(n[3])>1)throw new Error("Invalid alpha value");return this.rgba={red:n[0],green:n[1],blue:n[2],alpha:parseFloat(n[3])||1},this}throw new Error("Invalid color")}function od(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t||"null"===t||0===n.length)return{track:null};var i=t.split("."),e=Q(i,2),r=e[0],o=e[1],u=r.split(/[-_]/),a=Q(u,1),s=a[0],c=r!==s,l=n.filter((function(t){return c&&t.language===r||t.language===s})).sort((function(t,n){var i=2*(t.language===s&&t.kind===o)+2*(t.language===r)+1*(t.kind===o);return 2*(n.language===s&&n.kind===o)+2*(n.language===r)+1*(n.kind===o)-i}));return l.length>0?{track:l[0],exactMatch:l[0].language===r&&l[0].kind===o}:{track:null}}function ud(t,n){switch(t.view){case 2:throw new Ih("The video is private.","PrivacyError",n);case 4:throw new Ih("The video is password-protected. The viewer must enter the password first.","PasswordError",n);case 7:throw new Ih(t.message,"NotFoundError",n)}}function ad(t){for(var n=[],i=0;it.config.video.duration)throw new Ih("Cue point time must be positive number less than the duration of the video (".concat(Ps(t.config.video.duration),")."),"RangeError","addCuePoint");try{var e=t.backbone.addCuePoint(n,i);return setTimeout((function(){o.fire(cc.Hc,e)}),0),e.id}catch(t){if("CuePointsNotSupported"===t.name)throw new Ih("Cue points are not supported in the current player.","UnsupportedError","addCuePoint");throw new Ih("Unable to add cue point","InvalidCuePoint","addCuePoint")}},removeCuePoint:function(n){var i=t.backbone.cuePoints.filter((function(t){return t.id===n}))[0];if(!i)throw new Ih("Cue point “".concat(n,"” was not found."),"InvalidCuePoint","removeCuePoint");t.backbone.removeCuePoint(i),setTimeout((function(){o.fire(cc.qc,i)}),0)},enableTextTrack:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=("text_tracks"in t.config.request?t.config.request.text_tracks:[]).map((function(t){return t.language=t.lang,t})),a=u.some((function(t){return t.language.toLowerCase()===n.toLowerCase()}));if(!a)throw new Ih("There are no tracks for “".concat(n.toUpperCase(),"”."),"InvalidTrackLanguageError","enableTextTrack");var s=e?"".concat(n,".").concat(e):n,c=od(s,u),l=c.track;if(!l||e&&l.kind!==e)throw new Ih("There are no ".concat(e," tracks for “").concat(n.toUpperCase(),"”."),"InvalidTrackError","enableTextTrack");return o.fire(Zs.Ks,l.id),i<3?null:new r((function(t,n){o.once(cc.Bc,(function(n,i){t({label:n.label,language:n.language,kind:n.kind})}))}))},disableTextTrack:function(){o.fire(Zs.Js)},toggleFullscreen:function(t){var n={not_supported:{name:"UnsupportedError",msg:"Fullscreen is not supported at all or for this element."},not_enabled:{name:"Error",msg:"The request was made from an iframe that does not allow fullscreen."},not_allowed:{name:"NotAllowedError",msg:"The request failed, probably because it was not called from a user-initiated event."}};return new r((function(i,e){if(!nd.element===t)return nd.on("enter",(function t(){nd.off("enter",t),i()})),nd.on("error",(function i(r,o){nd.off("error",i);var u=n[o]||n.not_supported;e(new Ih(u.msg,u.name,"".concat(t?"request":"exit","Fullscreen")))})),void o.fire(cc.Tc);i()}))},requestFullscreen:function(){return p.toggleFullscreen(!0)},exitFullscreen:function(){return p.toggleFullscreen(!1)},get fullscreen(){return!!nd.element},requestPictureInPicture:function(){return new r((function(n,i){o.once(Ti.ENTER_PICTURE_IN_PICTURE,n),"picture-in-picture"!==t.backbone.presentationMode&&(t.backbone.presentationMode="picture-in-picture")}))},exitPictureInPicture:function(){return new r((function(n,i){o.once(Ti.LEAVE_PICTURE_IN_PICTURE,n),"picture-in-picture"===t.backbone.presentationMode&&(t.backbone.presentationMode="inline")}))},get pictureInPicture(){return"picture-in-picture"===t.backbone.presentationMode},get autopause(){return!!t.config.embed.autopause},set autopause(n){t.config.embed.autopause=!!n},get chromecasting(){return!!Jc.currentSession},get color(){return t.config.embed.color.replace("#","")},set color(n){if(t.config.embed.settings.color&&!t.config.embed.on_site)throw new Ih("The creator of the video has chosen to always use ".concat(new rd(t.config.embed.color).hex,"."),"EmbedSettingsError","setColor");try{var i=new rd(n);o.fire(Zs.Hs,i.hex)}catch(t){throw new Ih("The color should be 3- or 6-digit hex value.","TypeError","setColor")}var e=new rd(30,30,30,.9);if(e.contrast(i).ratio<3){var r=i.clone().lighten(5,3,e);throw new Ih("".concat(i.hex," does not meet minimum contrast ratio. We recommend using brighter colors. (You could try ").concat(r.hex," instead.) See WCAG 2.0 guidelines: http://www.w3.org/TR/WCAG/#visual-audio-contrast"),"ContrastError","setColor")}},get cuePoints(){return t.backbone.cuePoints.map((function(t){return{time:t.time,data:t.data,id:t.id}}))},get currentTime(){return t.currentTime},set currentTime(n){if(n=parseFloat(n),isNaN(n)||n<0||n>t.config.video.duration)throw new Ih("Seconds must be a positive number less than the duration of the video (".concat(Ps(t.config.video.duration),")."),"RangeError","setCurrentTime");return o.fire(lc.Os),o.fire(Zs.Os,null,n),o.fire(cc.Il),i<3?null:new r((function(t,n){o.once(Ti.SEEKED,(function(n){var i=n.currentTime;t(i)}))}))},get duration(){return Ps(t.config.video.duration)},get ended(){return!!t.backbone.ended},get loop(){return!!t.config.embed.loop},set loop(t){o.fire(Zs.Fs,t)},set muted(n){t.backbone.muted=n},get muted(){return t.backbone.muted},get paused(){return!(t.backbone&&"paused"in t.backbone&&!t.backbone.paused)},get buffered(){return ad(t.backbone.buffered)},get played(){return ad(t.backbone.played)},get seekable(){return ad(t.backbone.seekable)},get seeking(){return t.backbone.seeking},get playbackRate(){return t.backbone?t.backbone.playbackRate:1},set playbackRate(n){if(!t.config.embed.settings.speed)throw new Ih("Setting the playback rate is not enabled for this video.","Error","setPlaybackRate");if(isNaN(n)||n>2)throw new Ih("Playback rate should be a number below or equal to ".concat(2,"."),"RangeError","setPlaybackRate");o.fire(Zs.uc,n)},get textTracks(){return(t.backbone?t.backbone.video.textTracks:[]).map((function(t){return{label:t.label,language:t.language,kind:t.kind,mode:t===f?"showing":"disabled"}}))},get videoEmbedCode(){return t.config.video.embed_code},get videoHeight(){return t.backbone.videoHeight||t.config.video.height},get videoId(){return t.config.video.id},get videoTitle(){return t.config.video.title},get videoWidth(){return t.backbone.videoWidth||t.config.video.width},get videoUrl(){if(!t.config.video.url)throw new Ih("The URL is not available because of the video’s privacy settings.","PrivacyError","getVideoUrl");return t.config.video.url},get volume(){var n=Ps(t.config.request.cookie.volume);return 1===i?Math.round(100*n):n},set volume(t){if(t=parseFloat(t),1===i&&(t/=100),isNaN(t)||t<0||t>1)throw new Ih("Volume should be a number between 0 and 1.","RangeError","setVolume");h=t,o.fire(Zs.Ls,t,!0)},get qualities(){return t.backbone.qualities},get quality(){return t.backbone.quality},set quality(n){if(!Fh(t.config.video.owner))throw new Ih("Setting the quality is not enabled for this video.","Error","setQuality");n=n.toLowerCase();var i=t.backbone.qualities.map((function(t){return t.id}));if(!i.includes(n))throw new Ih("“".concat(n,"” is not a valid quality. Valid qualities are: ").concat(i.join(", "),"."),"TypeError","on");t.backbone.quality=n},_loadVideo:function(n,i){return t.loadVideo(n,i)},get _like(){return!!t.config.user.liked},set _like(n){if(t.config.embed.on_site){if(t.config.user.liked===n)return;o.fire(cc.tl,n)}},get _watchLater(){return!!t.config.user.watch_later},set _watchLater(n){if(t.config.embed.on_site){if(t.config.user.watch_later===n)return;o.fire(cc.nl,n)}},get currentChapter(){var n=t.backbone.currentChapterID;if(!n)return null;var i=F(t.backbone.chapters),e=i.findIndex((function(t){return n===t.id}));return{startTime:i[e].startTime,title:i[e].text,index:e+1}},get chapters(){return F(t.backbone.chapters).map((function(t,n){return{startTime:t.startTime,title:t.text,index:n+1}}))},_addChapter:function(n,i){if(n=parseFloat(n),isNaN(n)||n<0||n>t.config.video.duration)throw new Ih("Chapter timecode must be positive number less than the duration of the video (".concat(Ps(t.config.video.duration),")."),"RangeError","_addChapter");try{t.backbone.addChapter(n,i)}catch(t){if("ChaptersNotSupported"===t.name)throw new Ih(t.message,"UnsupportedError","_addChapter");throw new Ih("Unable to add chapter","InvalidChapter","_addChapter")}},_removeChapter:function(n){var i;try{i=t.backbone.chapters.getCueById(n)}catch(t){throw new Ih("Chapters are not supported in this browser.","UnsupportedError","_removeChapter")}if(!i)throw new Ih("Chapter was not found.","InvalidChapter","_removeChapter");try{t.backbone.removeChapter(i)}catch(t){if("ChaptersNotSupported"===t.name)throw new Ih("Chapters are not supported in this browser.","UnsupportedError","_removeChapter");throw new Ih("Unable to remove chapter","InvalidChapter","_removeChapter")}},_addCard:function(t){o.fire(Zs._addCard,t)},_removeCard:function(t){o.fire(Zs._removeCard,t)},_setOutro:function(n,i){t.config.embed.outro!==n?(o.fire(Zs._hideOutro),setTimeout((function(){t.config.embed.outro=n,o.fire(Zs.Zs,n,i)}),400)):o.fire(Zs.Zs,n,i)},_hideOutro:function(){o.fire(Zs._hideOutro)},_setEmailCapture:function(n){if(n){var i=n.customFields?t.config.embed.email_capture_form||{}:t.config.embed.email||{};i.position=n.position.toLowerCase(),i.timecode=n.timecode,n.nohide=!0,n.noblur=!0,n.nofocus=ha(n,"nofocus",!0),p._showOverlay("email-capture",n)}else p._unsetEmailCapture()},_updateEmailCapture:function(n){var i;n.custom_fields?(Lu(null==(i=t.config.video.webinar)?void 0:i.registration_form)||(t.config.video.webinar.registration_form=n),o.fire(Zs._updateEmailCapture,n)):this._setEmailCapture(n)},_updateWebinarStartTime:function(n){t.config.video.webinar&&(t.config.video.webinar.scheduled_start_time=n),o.fire(Zs._updateWebinarStartTime,n)},_setActiveEmailCapturePage:function(t){o.fire(Zs.Ns,t)},_unsetEmailCapture:function(){t.config.embed.outro&&(o.fire(Zs._hideOutro),delete t.config.embed.outro),t.config.embed.email&&(o.fire(Zs._hideOverlay,{unmakeModal:!0}),delete t.config.embed.email)},_hideOverlay:function(t){o.fire(Zs._hideOverlay,{name:t,unmakeModal:!0})},_showOverlay:function(t,n){o.fire(Zs._showOverlay,t,n)},_fireEvent:function(){for(var t=arguments.length,n=new Array(t),i=0;i h1")),n=Ms(document.querySelector(".sub-title")),i=Ms(document.querySelector(".vp-portrait")),e=Math.max(t.width,n.width)+i.width,r=Math.max(i.height,t.height+n.height);return{top:10,left:10,width:Math.max(200,e),height:Math.max(60,r)}},get sidedock(){return{top:10,left:n-10-36,width:36,height:118}},get controls(){var t=e.customLogo,r=Math.max(60,t.height);return{height:r,top:i-10-r,left:10,width:n-20}},get customLogo(){var t=document.querySelector(".custom-logo"),e=t?Ms(t):{width:0,height:0};return{top:i-10-e.height,left:n-10-e.width,width:e.width,height:e.height}}};return e},set _lowLatencyMode(n){t.backbone.lowLatencyMode=n},get _lowLatencyMode(){return t.backbone.lowLatencyMode},get _presentationDelay(){return t.backbone.presentationDelay},set _presentationDelay(n){t.backbone.presentationDelay=n},get _liveLatency(){return t.backbone.latency},get _downloadSpeed(){return t.backbone.downloadSpeed},get _backbone(){return t.backbone},addEventListener:function(){p.on.apply(p,arguments)},removeEventListener:function(){p.off.apply(p,arguments)},seekTo:function(t){p.currentTime=t},changeColor:function(t){p.color=t}},m={addCuePoint:function(t){var n=t.time,i=t.data;return p.addCuePoint(n,i)},enableTextTrack:function(t){var n=t.language,i=t.kind,e=void 0===i?null:i;p.enableTextTrack(n,e)}};function b(t,i){n&&n.emit(t,i),u.fire(t,i)}var w=function(t,n){return function(){var i=n?n.apply(void 0,arguments):void 0;b(t,i)}};function g(t){var n=t.currentTime,i=t.duration,e=t.timeProgress;return{seconds:Ps(n),percent:Ps(e),duration:Ps(i)}}function y(t){return{playbackRate:t}}function _(){b(hc.LOADED,l?null:(l=!0,{id:t.config.video.id}))}function k(t){return E(function(t){switch(t){case"BrowserNotSupported":case"FilesNotPlayable":case"MediaSrcNotSupportedError":return new Ih("This video is not supported in this browser.","NotSupportedError");case"FileError":return new Ih("There was an error loading the files for this video.","FileError")}return new Ih("An error occurred during playback.","PlaybackError")}(c=t))}function E(t){var n={message:"An error occurred.",name:"Error",method:t.source};return"MessageApiError"===t.constructorName&&(n={message:t.message,name:t.name,method:t.source}),n}return function(){if(!t.config.embed.on_site){d(t.config.embed.api);var i=t.config.request.referrer;(n=new Uh(i)).listeners=Ws(hc).reduce((function(t,n){return z(z({},t),{},q({},n,!1))}),{}),n.listeners[hc.READY]=!0,n.listeners[hc.ERROR]=!0,n.filter((function(t){return n.listeners[t]}))}}(),function(){if(n){var e=Jf({},p,m);n.extendMethods(e),n.hooks({logError:function(t){b(hc.ERROR,E(t))},parseMessage:function(t){if(!t||""===t)return{};if(Qn(t))return d(3),t;try{var n=JSON.parse(t);return d(2),n}catch(t){return d(null),b(hc.ERROR,"The Vimeo Froogaloop v1 API is no longer supported.\n Please follow the upgrade instructions here: https://goo.gl/mueGRR"),{}}},buildMessage:function(n){var e;(null==(e=t.config.embed)?void 0:e.player_id)&&(n.player_id=t.config.embed.player_id);try{2===i&&(n=function(t){if(t.event){for(var n in dc)if(dc[n]===t.event){t.event=n;break}"cuechange"===t.event&&(t.data.text=t.data.cues[0].text,t.data.html=t.data.cues[0].html,delete t.data.cues)}return JSON.stringify(t)}(n)),Qn(n)&&"ready"===n.event&&(n=JSON.stringify(n))}catch(t){}return n}})}}(),o.on(xi.BUFFER_STARTED,w(hc.BUFFER_START)),o.on(xi.BUFFER_ENDED,w(hc.BUFFER_END)),o.on(xi.CUE_POINT,w(hc.CUEPOINT,(function(t){return{time:t.time,data:t.data,id:t.id}}))),o.on(tu,w(hc.CUE_CHANGE,(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=t||{},e=i.language,r=void 0===e?null:e,o=i.label,u=void 0===o?null:o,a=i.kind,s=void 0===a?null:a;return{label:u,language:r,kind:s,cues:n}}))),o.on(cc.Lc,w(hc.CHAPTER_CHANGE,(function(n){var i=F(t.backbone.chapters).findIndex((function(t){return n===t.id}));return i>=0?{startTime:t.backbone.chapters[i].startTime,title:t.backbone.chapters[i].text,index:i+1}:null}))),o.on(cc.vc,w(hc.ENDED,(function(){return s=!1,{seconds:Ps(t.config.video.duration),percent:1,duration:Ps(t.config.video.duration)}}))),o.on(cc.ir,w(hc.PAUSE,(function(n){return s=!1,{seconds:Ps(n),percent:Ps(n/t.config.video.duration),duration:Ps(t.config.video.duration)}}))),o.on(cc._c,w(hc.PLAYBACK_RATE_CHANGE,y)),o.on(cc._c,w(hc.RATE_CHANGE,y)),o.on(cc.Bc,w(hc.TEXT_TRACK_CHANGE,(function(t){f=t;var n=t||{},i=n.language,e=void 0===i?null:i,r=n.label,o=void 0===r?null:r,u=n.kind;return{label:o,language:e,kind:void 0===u?null:u}}))),o.on(cc.pc,w(hc.VOLUME_CHANGE,(function(t){return{volume:Ps(t)}}))),o.on(cc.Uc,w(hc.CONTROL_BAR_VISIBILITY_CHANGED,(function(t){return{visible:t}}))),o.on(cc.Bl,(function(t){h&&setTimeout((function(){o.fire(Zs.Ls,h,!0)}),0),t&&_()})),o.on(cc.cc,(function(t){var n=k(t);a&&b(hc.ERROR,n)})),o.on(cc.Xc,w(hc.FULLSCREENCHANGE,(function(){return{fullscreen:!0}}))),o.on(cc.Qc,w(hc.FULLSCREENCHANGE,(function(){return{fullscreen:!1}}))),o.on(cc.mc,w(hc.QUALITY_CHANGE,(function(t){return{quality:t}}))),o.on(cc.Vf,w(hc.AD_STARTED)),o.on(cc.jf,w(hc.AD_COMPLETED)),o.on(cc.Pf,w(hc.AD_ERROR)),o.on(cc.Bf,w(hc.AD_SKIPPED)),o.on(cc.Hf,w(hc.AD_ALL_COMPLETED)),o.on(cc.Nf,w(hc.AD_CLICKED)),o.once(cc.ye,(function(){a=!0,b(hc.READY),c&&(b(hc.ERROR,k(c)),c=null)})),o.on(fu.EVENT_ENDED,w(hc.LIVE_EVENT_ENDED)),o.on(fu.EVENT_STARTED,w(hc.LIVE_EVENT_STARTED)),o.on(fu.STREAM_OFFLINE,w(hc.LIVE_STREAM_OFFLINE)),o.on(fu.STREAM_ONLINE,w(hc.LIVE_STREAM_ONLINE)),o.on(Mi.CAMERA_CHANGE,w(hc.CAMERA_CHANGE,(function(t){return t}))),o.on(Mi.MOTION_END,w(hc.MOTION_END)),o.on(Mi.MOTION_START,w(hc.MOTION_START)),o.on(Mi.WEBVR_HARDWARE_AVAILABLE,w(hc.WEBVR_HARDWARE_AVAILABLE)),o.on(Mi.WEBVR_ENTER,w(hc.ENTER_WEBVR)),o.on(Mi.WEBVR_EXIT,w(hc.EXIT_WEBVR)),o.on(Mi.SPATIAL_UNSUPPORTED,w(hc.SPATIAL_UNSUPPORTED)),o.on(Ti.PLAY,w(hc.PLAY,(function(n){return s?null:(s=!0,{seconds:Ps(n),percent:Ps(n/t.config.video.duration),duration:Ps(t.config.video.duration)})}))),o.on(Ti.PLAYING,w(hc.PLAYING,(function(){return s?{seconds:Ps(t.currentTime),percent:Ps(t.currentTime/t.config.video.duration),duration:Ps(t.config.video.duration)}:null}))),o.on(Ti.PROGRESS,w(hc.PROGRESS,(function(t){var n=t.loaded,e=t.duration,r=t.loadProgress,o={seconds:Ps(n),percent:Ps(r),duration:Ps(e)};return i<3&&(o.bytesLoaded=-1,o.bytesTotal=-1),o}))),o.on(Ti.SEEKING,w(hc.SEEKING,g)),o.on(Ti.SEEKED,w(hc.SEEKED,g)),o.on(Ti.TIME_UPDATE,w(hc.TIME_UPDATE,(function(t){var n=t.currentTime,i=t.duration,e=t.timeProgress;return{seconds:Ps(n),percent:Ps(e),duration:Ps(i)}}))),o.on(Ti.LOADED_METADATA,w(hc.LOADED_METADATA)),o.on(Ti.DURATION_CHANGE,w(hc.DURATION_CHANGE,(function(n){return{duration:t.backbone.duration}}))),o.on(Ti.WAITING,w(hc.WAITING)),o.on(Ti.LOADED_DATA,w(hc.LOADED_DATA)),o.on(Ti.LOAD_START,w(hc.LOAD_START)),o.on(Ti.RESIZE,w(hc.RESIZE,(function(){return{videoWidth:t.backbone.videoWidth,videoHeight:t.backbone.videoHeight}}))),o.on(Ti.ENTER_PICTURE_IN_PICTURE,w(hc.ENTER_PICTURE_IN_PICTURE)),o.on(Ti.LEAVE_PICTURE_IN_PICTURE,w(hc.LEAVE_PICTURE_IN_PICTURE)),o.on(Gc.connected,w(hc.CHROMECAST_CONNECTED)),o.on(Zs.Us,(function(){c=null,l=!1})),t.doNotTrackEnabled||(o.on(cc.ef,(function(){b(hc.EMAIL_CAPTURE)})),o.on(cc.rf,(function(){b(hc.EMAIL_CAPTURE_FAILED)}))),o.on(cc.mf,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n&&(n.listeners[hc.SPACE_CHANGE]=!0,b(hc.SPACE_CHANGE,t))})),o.fire(cc.Af),p}Bh.change&&document.addEventListener(Bh.change,(function(t){if(nd.onchange(nd.element),zh(Hh.CHANGE,nd.element),nd.element){var n=$h[$h.length-2];n&&n.element===nd.element?Qh():Zh(nd.element)}else Qh()}),!1),document.addEventListener("webkitbeginfullscreen",(function(t){var n=!0;if($h.length>0)for(var i=0,e=$h.length;i=100)););return this},darken:function(t,n,i){if(this.hsl={hue:this.hue,saturation:this.saturation,lightness:this.lightness-t},n&&i)for(var e=i.contrast(this).ratio;e=1)return this;var n=this.clone();return n.rgba={red:n.red*this.alpha+t.red*t.alpha*(1-this.alpha),green:n.green*this.alpha+t.green*t.alpha*(1-this.alpha),blue:n.blue*this.alpha+t.blue*t.alpha*(1-this.alpha),alpha:n.alpha+t.alpha*(1-this.alpha)},n},contrast:function(t){var n=this.alpha;if(n>=1){t.alpha<1&&(t=t.overlayOn(this));var i=this.luminance+.05,e=t.luminance+.05,r=i/e;return e>i&&(r=1/r),{ratio:r=Math.round(10*r)/10,error:0,min:r,max:r}}var o=this.overlayOn(rd.white).contrast(t).ratio,u=this.overlayOn(rd.black).contrast(t).ratio,a=Math.max(o,u),s={red:Math.min(Math.max(0,(t.red-this.red*n)/(1-n)),255),green:Math.min(Math.max(0,(t.green-this.green*n)/(1-n)),255),blue:Math.min(Math.max(0,(t.blue-this.blue*n)/(1-n)),255)},c=this.clone();c.rgb=s;var l=this.overlayOn(c).contrast(t).ratio;return{ratio:Math.round((l+a)/2*10)/10,error:Math.round((a-l)/2*10)/10,min:l,max:a,closest:c,farthest:u===a?rd.white:rd.black}},wcagAACompliant:function(t){return this.contrast(t).ratio>=4.5},wcagAAACompliant:function(t){return this.contrast(t).ratio>=7},yiqContrastColor:function(){return this.yiq>=120?new rd(0,0,0):new rd(255,255,255)}},rd.hexToRgb=function(t){var n;return 3===(t=String(t)).length||4===t.length?(n=/^#?([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(t))&&(n[1]+=n[1],n[2]+=n[2],n[3]+=n[3]):n=/^#?([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(t),n?{red:parseInt(n[1],16),green:parseInt(n[2],16),blue:parseInt(n[3],16),alpha:1}:null},rd.rgbToHex=function(t,n,i){return"#"+((1<<24)+(Math.round(t)<<16)+(Math.round(n)<<8)+Math.round(i)).toString(16).slice(1)},rd.rgbToHsl=function(t,n,i){t/=255,n/=255,i/=255;var e,r=Math.max(t,n,i),o=Math.min(t,n,i),u=(r+o)/2,a=u;if(r===o)return{hue:0,saturation:0,lightness:100*a};var s=r-o;return e=a>.5?s/(2-r-o):s/(r+o),r===t?u=(n-i)/s+(n1&&(i-=1),6*i<1?t+6*(n-t)*i:2*i<1?n:3*i<2?t+6*(2/3-i)*(n-t):t}if(t/=360,i/=100,0==(n/=100))return{red:Math.floor(255*i),green:Math.floor(255*i),blue:Math.floor(255*i)};var r=i<.5?i*(1+n):i+n-n*i,o=2*i-r;return{red:Math.floor(255*e(o,r,t+1/3)),green:Math.floor(255*e(o,r,t)),blue:Math.floor(255*e(o,r,t-1/3))}},rd.hslToHex=function(t,n,i){var e=rd.hslToRgb(t,n,i);return rd.rgbToHex(e.red,e.green,e.blue)},rd.white=new rd("fff"),rd.black=new rd("000");var cd=function(){function t(t){this.alertTextElement=t.querySelector(".vp-text-alert-wrapper"),this.alertContentElement=this.alertTextElement.querySelector(".vp-alert-text")}var n=t.prototype;return n.show=function(t){this.alertContentElement.innerHTML=t,this.alertContentElement.classList.remove("hidden"),this.alertTextElement.classList.remove("hidden")},n.hide=function(){this.alertContentElement.classList.add("hidden"),this.alertTextElement.classList.add("hidden")},t}(),ld=Object.prototype.hasOwnProperty,fd=yi((function(t,n){if(Ln(n)||qn(n))fi(n,Du(n),t);else for(var i in n)ld.call(n,i)&&li(t,i,n[i])})),hd=i((function(t){!function(){var i="undefined"!=typeof window&&window===this?this:void 0!==n&&null!=n?n:this,e="function"==typeof Object.defineProperties?Object.defineProperty:function(t,n,i){t!=Array.prototype&&t!=Object.prototype&&(t[n]=i.value)};function o(){o=function(){},i.Symbol||(i.Symbol=a)}var u=0;function a(t){return"jscomp_symbol_"+(t||"")+u++}function s(){o();var t=i.Symbol.iterator;t||(t=i.Symbol.iterator=i.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&e(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return c(this)}}),s=function(){}}function c(t){var n=0;return function(t){return s(),(t={next:t})[i.Symbol.iterator]=function(){return this},t}((function(){return nn||(clearTimeout(t.j),t.j=setTimeout((function(){var n=performance.timing.navigationStart,i=p(t.g,t.b);if(n=(window.a&&window.a.A?1e3*window.a.A().C-n:0)||performance.timing.domContentLoadedEventEnd-n,t.u)var e=t.u;else e=performance.timing.domContentLoadedEventEnd?(e=performance.timing).domContentLoadedEventEnd-e.navigationStart:null;var r=performance.now();null===e&&w(t,Math.max(i+5e3,r+1e3));var o=t.a;(i=5e3>r-i||5e3>r-(i=o.length?o[o.length-1].end:n)?null:Math.max(i,e))&&(t.s(i),clearTimeout(t.j),t.i=!1,t.c&&t.c.disconnect(),t.h&&t.h.disconnect()),w(t,performance.now()+1e3)}),n-performance.now()),t.v=n)}m.prototype.getFirstConsistentlyInteractive=function(){var t=this;return new r((function(n){t.s=n,"complete"==document.readyState?b(t):window.addEventListener("load",(function(){b(t)}))}))},m.prototype.m=function(t){this.f.set(t,performance.now())},m.prototype.l=function(t){this.f.delete(t)},m.prototype.B=function(){w(this,performance.now()+5e3)},i.Object.defineProperties(m.prototype,{g:{configurable:!0,enumerable:!0,get:function(){return[].concat(f(this.f.values()))}}});var g={getFirstConsistentlyInteractive:function(t){return t=t||{},"PerformanceLongTaskTiming"in window?new m(t).getFirstConsistentlyInteractive():r.resolve(null)}};t.exports?t.exports=g:window.ttiPolyfill=g}()})),dd=z(z({},Tc),{},{ALERT_DISPLAYED:"alert-displayed",ALERT_HIDDEN:"alert-hidden",CAPTIONS_ENABLED:"captions-enabled",CAPTIONS_DISABLED:"captions-disabled",CHROMECAST_CONNECTED:"chromecast-connected",CHROMECAST_DISCONNECTED:"chromecast-disconnected",DRM_KEY_SWITCH:"drm-key-switch",ERROR_LINK_PRESSED:"error-link-pressed",MEDIASESSION_PLAY:"mediasession-play",MEDIASESSION_PAUSE:"mediasession-pause",MEDIASESSION_SEEK_FORWARD:"mediasession-seekforward",MEDIASESSION_SEEK_BACKWARD:"mediasession-seekbackward",SLATE_DISPLAYED:"slate-displayed",CLICK:"click",VIDEO_DURATION_MISMATCH:"video-duration-mismatch",VIDEO_FULLSCREEN_CHANGE:"video-fullscreen-change",VIDEO_MANIFEST_LOADED:"video-manifest-loaded",VIDEO_MANIFEST_TIMEOUT:"video-manifest-timeout",VIDEO_PLAYBACK_RATE_CHANGED:"video-playback-rate-changed",VIDEO_STREAM_CHANGE:"video-stream-change",VIDEO_SWITCH_BACK_TO_AUTO:"video-switch-back-to-auto",VIDEO_SWITCH_FROM_AUTO:"video-switch-from-auto",DOWNLOAD_TIMEOUT:"video-download-timeout",AD_BUFFERING:"ad-buffering",AD_COMPLETE:"ad-complete",AD_CLICKED:"ad-clicked",AD_ERROR:"ad-error",AD_PAUSED:"ad-paused",AD_RESUMED:"ad-resumed",AD_STARTED:"ad-started",AD_SKIPPED:"ad-skipped",OUTRO_VIDEO_SELECTED:"outro-video-selected",WEBVR_HARDWARE_AVAILABLE:"webvr-hardware-available",ENTER_WEBVR:"enter-webvr",EXIT_WEBVR:"exit-webvr",WEBINAR_REGISTRANT_BLOCKED:"webinar-registrant-blocked",WEBINAR_REGISTRANT_UNBLOCKED:"webinar-registrant-unblocked"});function vd(t){return zs("av01",t)?"AV1":zs("hvc1",t)?"HEVC":zs("avc1",t)?"AVC":null}function pd(t){return zs("mp4a",t)?"AAC":zs("opus",t)?"OPUS":null}function md(t,n){var i,e;return(null==t||null==(i=t.request)||null==(e=i.ab_tests)?void 0:e[n])?t.request.ab_tests[n]:{}}function bd(t,n,i,e){var o,u,a,s,c,l=function(t){return function(){for(var n=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:{};it(n)||((i=Object.assign(u?u.globalProperties():{},et(),i)).name=n,t.events.fire(cc.qf,{name:n,data:i}),o.log(i).catch((function(t){})))}function it(n){var i,e,r,o;switch(n){case dd.VIDEO_SEEK:case dd.VIDEO_SEEKED:return(null==(i=t.config.embed)?void 0:i.loop)||(null==(e=t.config.embed)||null==(r=e.settings)?void 0:r.background);case dd.VIDEO_PLAYBACK_RATE_CHANGED:return null==(o=t.config.video.live_event)?void 0:o.low_latency;default:return!1}}function et(){return Object.assign(function(){var n,e,r,o,u,a,s={autoplay:1===t.config.embed.autoplay,background:!!t.config.embed.settings.background,clip_id:t.config.video.id,context:t.config.embed.context,device_pixel_ratio:window.devicePixelRatio||1,drm:!!t.config.request.drm,embed:!t.config.embed.on_site,is_mod:!!t.config.user.mod,is_spatial:!(!Yi.spatialPlayback||!t.config.video.spatial),logged_in:!!t.config.user.logged_in,looping:!!t.config.embed.loop,owner_id:null==(n=t.config.video)||null==(e=n.owner)?void 0:e.id,product:Mc(t),referrer:t.config.request.referrer,session_id:t.config.request.session,stayed_on_auto:m,version:Ic(t.config),version_backend:t.config.request.build.backend,viewer_id:null==(r=t.config.user)?void 0:r.id,viewer_team_id:null==(o=t.config.user)?void 0:o.team_id,viewer_team_origin_user_id:null==(u=t.config.user)?void 0:u.team_origin_user_id,vuid:pl("vuid")};return t.config.video.owner&&(s.account_type=t.config.video.owner.account_type),t.config.embed.api&&(s.api_version=t.config.embed.api),t.config.embed.app_id&&(s.app_id=String(t.config.embed.app_id)),t.config.video.privacy&&(s.privacy=t.config.video.privacy),i.get(cl)&&(s.live_session_id=null==(a=t.config.video.live_event)?void 0:a.id),Yi.webvr&&t.config.video.spatial&&(s.webvr_support=!0),Yi.webxr&&t.config.video.spatial&&(s.webxr_support=!0),t.config.request.drm&&t.config.request.drm.fallback_asset&&(s.has_sd_drm_fallback=!0),t.config.video.webinar&&(s.webinar_uuid=t.config.video.webinar.id),s}(),function(){var n,i,e=t.backbone.video?t.backbone.video.currentFile:{},r=function(){var n={},i=Qf(),e=xa("asc"),r="MediaSourceScanner"===t.backbone.currentScannerName,o="HTMLScanner"===t.backbone.currentScannerName,u="HLSLiveScanner"===t.backbone.currentScannerName,a=[];o&&(a=ha(t.config,"request.files.progressive")||ha(t.config,"request.files.hls")||[]),r&&(a=ha(t.config,"request.files.dash.streams",[])),u&&(a="video/vnd.mpeg.dash.mpd"===t.backbone.video.currentFile.mime?ha(t.config,"request.files.dash.streams",[]):ha(t.config,"request.files.hls.streams",[]));var s=F(a).sort(e).map((function(t){return t.profile})),c=-1,l=0,f=null;if(Object.keys(_).forEach((function(t){var n=s.indexOf(parseInt(t,10));n>c&&(c=n);var e=_[t].reduce((function(t,n){return((n.end||i)-n.start)/1e3+t}),0);e>l&&(l=e,f=t)})),n.highest_profile=s[c],n.highest_available_profile=s[s.length-1],n.most_used_profile=f,(r||u)&&S){n.max_speed=Math.round(Math.max.apply(Math,tt(S)))/1e3,n.min_speed=Math.round(Math.min.apply(Math,tt(S)))/1e3;var h=S.reduce((function(t,n){return t+n}),0);n.average_speed=Math.round(h/S.length)/1e3}return n}(),o=e.id,u=void 0===o?0:o,a=e.mime,c=void 0===a?"video/mp4":a,l=e.metadata,f=(l=void 0===l?{}:l).profile,h=void 0===f?null:f,p=!1,m=!1;switch(c){case Xs:0===e.restrictedStreamIndexes.length&&(p=!0),ha(t.config,"request.files.dash.separate_av")&&(m=!0),h=y?y.profile:null;break;case"application/vnd.apple.mpegurl":p=!0}var b,w={audio_bitrate:t.backbone.getBitrateAtTime(t.backbone.currentTime,"audio")/1e3,auto:p,average_speed:r.average_speed||0,cdn:e.metadata?e.metadata.cdn:"akamai",delivery:"live"!==fc[c]?fc[c]:"dash",display:t.expose.pictureInPicture?"pip":t.expose.fullscreen?"fs":null,dropped_frames:j,dropped_frame_percent:D,event_time:d+th(v),ended:M,forced_embed_quality:I,fullscreen:R,highest_available_profile:r.highest_available_profile?String(r.highest_available_profile):null,highest_profile:r.highest_profile?String(r.highest_profile):null,max_speed:isFinite(r.max_speed)?r.max_speed:0,mime:e.mime||null,min_speed:isFinite(r.min_speed)?r.min_speed:0,most_used_profile:r.most_used_profile?String(r.most_used_profile):null,origin:e.metadata?e.metadata.origin:"",profile_id:h?String(h):null,codec:Lu(y)?"":vd(y.codecs),audio_codec:pd(null==(n=t.backbone)||null==n.getCurrentStream||null==(i=n.getCurrentStream("audio"))?void 0:i.codecs)||null,quality:y?y.quality:null,quality_downswitch_count:L,quality_upswitch_count:O,quality_switch_count:O+L,separate_av:m,target_profile_id:K,ttfb:rt(),video_bitrate:t.backbone.getBitrateAtTime(t.backbone.currentTime,"video")/1e3,video_duration:Ps(t.config.video.duration),video_file_id:Number.isInteger(Number(u))?parseInt(u,10):null};t.backbone.isLive&&(w.ecdn=!!t.config.video.p2p,w.ecdn&&(w.ecdn_peers=null==(b=window.Streamroot)?void 0:b.instances[0].stats.realtime.dnaSources),void 0!==t.backbone.latency&&(w.latency=t.backbone.latency),void 0!==t.backbone.lowLatencyMode&&(w.is_low_latency=t.backbone.lowLatencyMode));return t.config.request.drm&&(w.drm_mode=s),w}(),function(){var n={};if(t.config.request.ab_tests)for(var i in t.config.request.ab_tests){var e=t.config.request.ab_tests[i];for(var r in n["".concat(i,"_test")]=1,n["".concat(i,"_group")]=e.group,e.data)n["".concat(i,"_data_").concat(r)]=e.data[r]}return n}())}function rt(){var t=-1;if(void 0!==window.performance&&"function"==typeof window.performance.getEntriesByType){var n=window.performance.getEntriesByType("resource");if(n){var i=n.filter((function(t){return null!==t.name.split("?")[0].match(/\.m4s$|\.ts$/)}));t=i.map((function(t){return t.responseStart-t.connectStart})).reduce((function(t,n){return t+n}),0)/(i.length||1)}}return Ps(t,2)}function ot(t){var n=t.url,i=-1;if(window.performance){var e=window.performance.getEntriesByType("resource");if(e.length){var r=e.filter((function(t){return t.name===n})).sort((function(t,n){return t.connectStart-n.connectStart}));if(r.length){var o=r[r.length-1];i=o.responseStart-o.connectStart}}}return Ps(i,2)}function ut(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{final:!0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e={error_type:t,error_reason:i};u.handleExternalError(e,n)}v=nh(),d=t.config.request.timestamp,s=t.config.request.drm?"default":null,o=new Sc(function(){var n="?beacon=1&session-id=".concat(t.config.request.session);return t.config.request.urls.fresnel+n}()),t.events.on(cc.cc,ut),t.events.on(Zs.Us,(function(){C=!1})),t.events.on(Zs.Os,(function(){J=!0})),t.events.on(cc.cf,(function(t,n){nt(dd.ERROR_LINK_PRESSED,{error_type:n,error_url:t})})),t.events.on(cc.Xc,(function(){R=!0,nt(dd.VIDEO_FULLSCREEN_CHANGE)})),t.events.on(cc.Qc,(function(){R=!1,nt(dd.VIDEO_FULLSCREEN_CHANGE)})),t.events.on(cc.Cf,(function(t,n){nt(t?dd.ALERT_DISPLAYED:dd.ALERT_HIDDEN)})),t.events.on(cc.Bl,(function(){d=t.config.request.timestamp,v=nh(),p=!1,m=!0,b=!1,w=!1,g="auto",y={},_={},k=null,E=null,T=null,S=[],A=null,x={},C=!1,M=!1,I="none",R=!1,O=0,L=0,D=0,j=0,P=null,U=null,V=null,q=null,z=null,K=null,X=0,s=t.config.request.drm?"default":null,u&&(u.reset(),Q())})),t.events.on(cc.kc,(function(){Y={seek_type:"nudge"}})),t.events.on(cc.Dc,(function(t,n){Y={seek_type:n}})),t.events.on(cc.Ic,(function(t){Y={seek_type:"chapter-".concat(t)}})),t.events.on(cc.Ql,(function(t){nt(dd.OUTRO_VIDEO_SELECTED,{selected_video_id:t})})),t.events.on(Xo,(function(){C||Jc.isCastConnected||(t.performDelegateAction(sc,(function(t){C=!0,c.then((function(){return u.logStartRequest()})).catch((function(){}))})),md(t.config,"chunk_logging").group&&t.config.request.urls.fresnel_manifest_url&&function(t,n,i,e){var r=Date.now(),o=[{uuid:Us(),created_at:r,event:{name:"session_manifest",version:1,ts_ms:r,fields:{sessionID:n,manifest:i}},tracker:{name:"vimeo-player",version:e}}];new Sc(t).logRequestPromiseWithUrl(t,JSON.stringify(o),!0)}(t.config.request.urls.fresnel_manifest_url+"?beacon=1",t.config.request.session,t.backbone.manifest,Ic(t.config)))})),t.events.on(cc.al,(function(t){"email-capture"===t&&nt(dd.SLATE_DISPLAYED,{slate_type:"email"})})),t.events.on(cc._c,(function(t,n){nt(dd.VIDEO_PLAYBACK_RATE_CHANGED,{previous_playback_rate:n})})),t.events.on(cc.gc,(function(t){nt(dd.CLICK,{click_target:t})})),t.events.on(Zs.Vs,(function(n){"auto"!==n&&(m=!1),t.backbone.video.currentFile.mime===Xs&&("auto"===n||b?"auto"===n&&b&&!w&&(nt(dd.VIDEO_SWITCH_BACK_TO_AUTO,{quality:g,auto:1}),w=!0):(nt(dd.VIDEO_SWITCH_FROM_AUTO,{quality:n,auto:0}),b=!0),g=n)})),t.events.on(Zs.Ks,(function(t){A!==t&&(A=t,nt(dd.CAPTIONS_ENABLED,{captions_id:String(t)}))})),t.events.on(Zs.Js,(function(){A&&(A=null,nt(dd.CAPTIONS_DISABLED))})),t.events.on(Gc.connected,(function(){nt(dd.CHROMECAST_CONNECTED)})),t.events.on(Gc.disconnected,(function(){nt(dd.CHROMECAST_DISCONNECTED)})),t.events.on(xi.STREAM_CHANGE,(function(t,n,i){y=t;var e=t.profile?t.profile:t.id,r=Qf();if(_[e]=_[e]||[],k){var o=_[k].length-1;_[k][o]&&(_[k][o].end=r)}E&&(i[n].bitrate>E?O+=1:L+=1),_[e].push({start:r}),x[e]={bitrate:i[n].bitrate,width:i[n].width,height:i[n].height},nt(dd.VIDEO_STREAM_CHANGE,{previous_audio_bitrate:T/1e3,previous_video_bitrate:E/1e3,previous_profile_id:String(k)}),k=e,E=i[n].bitrate,T=i[n].audioBitrate})),t.events.on(xi.STREAM_TARGET_CHANGE,(function(t){t&&(K=String(t.profile||"")||null)})),t.events.on(Qo,(function(t){I=t})),t.events.on(Ti.PLAYING,(function(){J=!1})),t.events.once(cc.yc,(function(){p=!0})),t.events.on(cc.Df,(function(){nt(dd.AD_BUFFERING)})),t.events.on(cc.jf,(function(){nt(dd.AD_COMPLETE)})),t.events.on(cc.Nf,(function(){nt(dd.AD_CLICKED)})),t.events.on(cc.Pf,(function(t){nt(dd.AD_ERROR,{error_type:t.errorType,error_reason:t.errorReason})})),t.events.on(cc.Uf,(function(){nt(dd.AD_PAUSED)})),t.events.on(cc.Ff,(function(){nt(dd.AD_RESUMED)})),t.events.on(cc.Vf,(function(t){nt(dd.AD_STARTED,{startup_duration:t.time?Ps(t.time/1e3,2):null})})),t.events.on(cc.Bf,(function(){nt(dd.AD_SKIPPED)})),t.events.on(cc.hc,(function(){Yi.iPhone&&u.setDisplayContext(1)})),t.events.on(cc.dc,(function(){Yi.iPhone&&u.setDisplayContext(0)})),t.events.on(cc.Wf,(function(){nt(dd.WEBINAR_REGISTRANT_BLOCKED)})),t.events.on(cc.zf,(function(){nt(dd.WEBINAR_REGISTRANT_UNBLOCKED)})),t.events.on(xi.DROPPED_FRAMES,(function(t){var n=t.dropped/t.total*100;D=Math.round(100*n)/100,j=t.dropped})),t.events.on(xi.BANDWIDTH,(function(t){var n=t.speed;S.push(n),S.length>500&&S.shift()})),t.events.on(xi.MANIFEST_TIMEOUT,(function(){nt(dd.VIDEO_MANIFEST_TIMEOUT)})),t.events.on(xi.MANIFEST_LOADED,(function(){nt(dd.VIDEO_MANIFEST_LOADED)})),t.events.on(xi.DOWNLOAD_END,l),t.events.on(xi.DOWNLOAD_TIMEOUT,(function(){nt(dd.DOWNLOAD_TIMEOUT)})),t.events.on(xi.DRM_KEY_SWITCH,(function(){s="sd-fallback",nt(dd.DRM_KEY_SWITCH)})),t.events.on(xi.SCANNER_CHANGE,(function(){q=null})),t.events.on(xi.AV_DURATION_MISMATCH,(function(t){nt(dd.VIDEO_DURATION_MISMATCH,{duration_difference:Math.round(100*t)/100})})),t.events.on(xi.QUOTA_EXCEEDED_ERROR,(function(t){var n=t.buffered,i={error_type:xi.QUOTA_EXCEEDED_ERROR};i.buffered=Ps(mt(0,n),2),i.bytes_loaded=X,nt(dd.VIDEO_PLAYBACK_ERROR,i)})),t.events.on(Ii.MEDIASESSION_PLAY,(function(){nt(dd.MEDIASESSION_PLAY)})),t.events.on(Ii.MEDIASESSION_PAUSE,(function(){nt(dd.MEDIASESSION_PAUSE)})),t.events.on(Ii.MEDIASESSION_SEEK_FORWARD,(function(){nt(dd.MEDIASESSION_SEEK_FORWARD)})),t.events.on(Ii.MEDIASESSION_SEEK_BACKWARD,(function(){nt(dd.MEDIASESSION_SEEK_BACKWARD)})),t.events.on(lc.Os,(function(){Y={seek_type:"api"}})),t.events.on(lc.Gf,(function(){$=!0})),t.events.on(lc.Yf,(function(){$=!0})),t.events.on(Mi.WEBVR_HARDWARE_AVAILABLE,(function(t){nt(dd.WEBVR_HARDWARE_AVAILABLE,{vr_hardware:t.displayName})})),t.events.on(Mi.WEBVR_ENTER,(function(){nt(dd.ENTER_WEBVR,!0)})),t.events.on(Mi.WEBVR_EXIT,(function(){nt(dd.EXIT_WEBVR,!0)})),t.events.on(Ri.BRAIN_ML_MODEL_INPUTS,(function(n){var i;(null==(i=n.geolocation)?void 0:i.length)&&n.geolocation[0].length?n.geolocation=n.geolocation[0][0]:n.geolocation="",t.config.request.urls.fresnel_mimir_inputs_url&&function(t,n,i,e){var r={chunk_request_id:i.chunkRequestID,duration:i.duration,available_qualities:i.availableQualities,next_chunk_sizes:i.nextChunkSizes,last_buffer_sizes:i.lastBufferSizes,last_chunk_download_times:i.lastChunkDownloadTimes,last_chunk_sizes:i.lastChunkSizes,last_chunk_qualities:i.lastChunkQualities,num_remaining_chunks:i.numRemainingChunks,last_playback_heads:i.lastPlaybackHeads,geolocation:i.geolocation,session_id:n},o=Date.now(),u=[{uuid:Us(),created_at:o,event:{name:"mimir_inputs",version:1,ts_ms:o,fields:r},tracker:{name:"vimeo-player",version:e}}];new Sc(t).logRequestPromiseWithUrl(t,JSON.stringify(u),!0)}(t.config.request.urls.fresnel_mimir_inputs_url+"?beacon=1",t.config.request.session,n,Ic(t.config))})),t.events.on(fu.STALL_JUMP,(function(t){ut("livestall",{final:!1},t.msg)})),t.events.on(fu.LOW_LATENCY_FALLBACK,(function(t){ut("livefallback",{final:!1},t.msg)})),(c=new r((function(n,i){var e;(null==(e=t.backbone)?void 0:e.video)&&n(),t.events.on($o,n)}))).then(Z).catch((function(){})),t.events.on(cc.af,Z),hd.getFirstConsistentlyInteractive().then((function(t){z=Ps(t)})).catch((function(){}))}var wd=function(){function t(t,n,i){this.player=t,this.element=n,this.store=i,this.shouldSample=!0,this.muxClient=null,this.kh()&&(this.shouldSample&&Math.random()>.75||this.Eh())}var n=t.prototype;return n.Th=function(){return!!this.player.config.request.flags.ott},n.kh=function(){var t;return!(this.player.doNotTrackEnabled||!this.Th()&&((null==(t=this.player.config.video.live_event)?void 0:t.low_latency)&&(this.shouldSample=!1),!this.store.get(cl)))},n.Eh=function(){var t=this;if(!document.getElementById("vp-mux-client")){var n=document.createElement("script");n.setAttribute("id","vp-mux-client"),n.setAttribute("src",this.player.config.request.urls.mux_url),n.onreadystatechange=n.onload=function(){t.Sh(),t.store.get(cl)||t.Ah()},document.getElementsByTagName("head")[0].appendChild(n)}},n.Sh=function(){var t=this;this.player.events.on(cc.Bl,(function(n){if(t.kh()&&n&&"undefined"!=typeof mux){var i=t.player.backbone.video?t.player.backbone.video.currentFile:{};mux.emit(t.player.backbone.videoElement,"videochange",z({video_title:t.player.config.video.title,video_id:t.player.config.video.id,video_duration:1e3*t.player.config.video.duration,video_cdn:i.metadata?i.metadata.cdn:"akamai",video_stream_type:t.xh(),viewer_user_id:t.player.config.request.session,view_session_id:t.player.config.request.session,sub_property_id:t.Th()?t.player.config.ott.site_id:t.player.config.video.owner.id},t.Ch()))}})),this.player.events.on(fu.STREAM_ONLINE,(function(){t.Ah()})),this.player.events.on(fu.STREAM_OFFLINE,(function(){var n;null==(n=mux)||n.emit(t.player.backbone.videoElement,"ended")})),this.player.events.on(xi.STREAM_CHANGE,(function(n){var i;(null==n?void 0:n.bitrate)&&(null==(i=mux)||i.emit(t.player.backbone.videoElement,"renditionchange",{video_source_bitrate:n.bitrate}))}))},n.Ah=function(){if("undefined"!=typeof mux){var t=this.player.backbone.video?this.player.backbone.video.currentFile:{};null!==this.muxClient&&mux.destroyMonitor(this.player.backbone.videoElement);var n="dev"===this.player.config.request.build.js?"6eq01ih8u9u8fkk4hbindded5":"73cngs5ov03sbnck36isdkndt";this.store.get(al)&&(n="dev"===this.player.config.request.build.js?"kghblrf3bb9uk33lv58ompm3k":"md0ig7ssl8unl2kpl0h6p0drn");var i=z({property_key:n,player_name:"Vimeo Player",player_init_time:Date.now(),player_version:Ic(this.player.config),video_title:this.player.config.video.title,video_id:this.player.config.video.id,video_duration:1e3*this.player.config.video.duration,video_cdn:t.metadata?t.metadata.cdn:"akamai",video_stream_type:this.xh(),viewer_user_id:this.player.config.request.session,view_session_id:this.player.config.request.session,sub_property_id:this.player.config.video.owner.id},this.Ch());this.Th()&&(i.property_key="dev"===this.player.config.request.build.js?"3tb8rggvj5m71caj9jfpiidos":"lrc6o7kvhc6npvqq2r5iks5u4",this.player.config.ott&&(i.sub_property_id=this.player.config.ott.site_id,i=Object.assign(i,this.player.config.ott))),this.muxClient=mux.monitor(this.player.backbone.videoElement,{debug:!1,minimumRebufferDuration:500,data:i})}},n.Ch=function(){var t=this.player.config.request.ab_tests||{},n=Object.keys(t).find((function(n){return t[n].mux}));return n?{experiment_name:n}:null},n.xh=function(){var t;return this.store.get(cl)?(null==(t=this.player.config.video.live_event)?void 0:t.low_latency)?"low_latency_live":this.player.config.video.p2p?"ecdn_live":"live":"vod"},t}();function gd(t){var n,i,e=t.config.ott||{},o=e.analytics_url||"https://collector.vhx.tv/events.gif",u=new Sc(o),a=ah((function(){l("timeupdate")}),1e4,{leading:!1}),s=ah((function(){l("seeking")}),500);function c(){e=t.config.ott||{},i=!1,n=!1}function l(i,r){(r=Object.assign({},r,{name:e.video_title,user_id:e.viewer_user_id,user_email:e.viewer_user_email,site_id:e.site_id,user_agent:navigator.userAgent,url:top===self?window.location.href:document.referrer,referrer:t.config.request.referrer,session_id:t.config.request.session,device:"html5",device_id:null,collection_id:e.collection_id,product_id:e.product_id,platform:e.platform,platform_id:null,platform_version:e.platform_version},{type:"video",video_id:e.video_id,current_src:t.backbone.currentFile.src,current_subtitle:"none",current_type:e.video_content_type,duration:e.video_duration,is_drm:t.config.request.drm?1:0,is_fullscreen:n?1:0,is_trailer:e.is_trailer?1:0,is_chromecast:Jc.isCastConnected?1:0,is_live:t.config.video.live_event,seconds:10,timecode:t.currentTime})).name=i,void 0===r.timestamp&&(r.timestamp=Math.round(.001*Date.now()));var a=_t(o,r);return u.logRequestPromiseWithUrl(a,{},!0,"GET").catch((function(t){}))}function f(){t.events.on(Ti.ENDED,h),t.events.on(Ti.ERROR,d),t.events.on(Ti.PAUSE,v),t.events.on(Ti.PLAY,p),t.events.on(Ti.TIME_UPDATE,a),t.events.on(Ti.SEEKING,s),t.events.on(Ti.SEEKED,m),t.events.on(Ti.WAITING,b),t.events.on(cc.Xc,w),t.events.on(cc.Qc,g),t.events.on(cc.jf,y),t.events.on(cc.Nf,_),t.events.on(cc.Pf,k),t.events.on(cc.Vf,E),t.events.on(cc.Bf,T)}function h(){a.cancel(),l("ended")}function d(){a.cancel(),l("error")}function v(){a.cancel(),l("pause")}function p(){if(!i)return i=!0,void l("firstplay");l("play")}function m(){s.cancel(),l("seeked")}function b(){l("waiting")}function w(){n=!0}function g(){n=!1}function y(){l(dd.AD_COMPLETE)}function _(){l(dd.AD_CLICKED)}function k(){l(dd.AD_ERROR)}function E(){l(dd.AD_STARTED)}function T(){l(dd.AD_SKIPPED)}t.events.on(cc.Bl,c),c(),t.config.ott?f():new r((function(n,i){t.ottVideoMetadata?n():t.events.on(cc.$l,(function(t){n()}))})).then((function(){e=t.ottVideoMetadata,f()})).catch((function(t){}))}var yd=function(t){return function(n){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r0&&e(s)?i>1?t(s,i-1,e,r,o):Fu(o,s):r||(o[o.length]=s)}return o}(t,1):[]}var Md=function(t){return nn(At(t,void 0,Cd),t+"")}((function(t,n){return null==t?{}:Sd(t,n)})),Id=["clip_id","profile_id","player_size","dropped_frames","total_frames","bandwidth","markers","streams","files","video_dims","min_bandwidth","max_badwidth","buffer_occupancy","live_latency","scanner","vr_headset"],Rd=function(){function t(t){this.$f=t,this.Mh={},this.Pr=null,this.Ih(),this.Rh(),this.Oh(),this.Lh()}var n=t.prototype;return n.reset=function(){this.Ih(),this.Lh(),this.$f.events.fire(cc.Al)},n.Dh=function(t,n){return this.Mh[t]=[n],this.$f.events.fire(cc.Al),this.Mh[t]},n.jh=function(t,n){return this.Mh[t].push(n),this.Mh[t].length>300&&this.Mh[t].splice(0,25),this.$f.events.fire(cc.Al),this.Mh[t]},n.getCurrent=function(t){return this.Mh[t].slice(-1)[0]},n.getSeries=function(t){return this.Mh[t]},n.Nh=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.name,i=qa({},t.data),e=this.Ph(n,i);this.Uh(n,n,e)},n.Ph=function(t,n){if(t===dd.CHUNK_DOWNLOADED){var i={};i.host=n.host,i.duration=Ps(n.duration,2),i.size=n.size,i.index=n.index,i.profile_id=n.profile_id,i.quality=n.quality,i.buffered=Ps(n.buffered,2),i.ttfb=Ps(n.ttfb,2),i.extraContext=n.extraContext,i.headers=Md(n.headers,["x_vim_cachebc","x_cache","akamai_edge_ip","x_akamai_request_id","ak_reference_id","content_type"]);var e=0,r=0,o=0,u=i.headers.x_vim_cachebc,a=i.headers.x_cache;return u?u.split(",").forEach((function(t){var n=Q(t.split(":"),2),i=n[0],e=n[1];"E"!==i||"h"!==e?"h"!==e||(r=1):o=1})):a&&(r="HIT"===a.substr(0,3),o="HIT"===a.substr(-3)),o?e=2:r&&(e=1),i.cache_hit=e,i}if(t===dd.VIDEO_PLAYBACK_ERROR||t===dd.VIDEO_LOAD_FAILURE||t===dd.VIDEO_START_FAILURE||t===dd.VIDEO_READY)return n;if(void 0!==n.autoplay&&void 0!==n.looping){var s={};return s.cdn=n.cdn,s.quality=n.quality,s}return n},n.Uh=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=this.$f.backbone.currentTime,r=Date.now(),o=Ps(mt(e,this.$f.backbone.buffered),2);this.jh("markers",{type:t,title:n,vt:e,t:r,bt:o,data:i})},n.Rh=function(){var t=this;this.$f.events.on(cc.Bl,(function(){t.reset()})),this.$f.events.on(xi.BANDWIDTH,this.Fh.bind(this)),this.$f.events.on(xi.BUFFER_OCCUPANCY,this.Vh.bind(this)),this.$f.events.on(xi.CURRENT_FILE_CHANGE,this.Bh.bind(this)),this.$f.events.on(xi.DROPPED_FRAMES,this.Hh.bind(this)),this.$f.events.on(xi.SCANNER_CHANGE,this.qh.bind(this)),this.$f.events.on(xi.STREAM_CHANGE,this.Wh.bind(this)),this.$f.events.on(xi.STREAM_CHANGE_START,this.zh.bind(this)),this.$f.events.on(Ti.TIME_UPDATE,this.Gh.bind(this)),this.$f.events.on(Mi.WEBVR_HARDWARE_AVAILABLE,this.Yh.bind(this)),this.$f.events.on(cc.qf,this.Nh.bind(this)),this.$f.events.on(fu.BUFFER_GAP_JUMP_PREVENT,this.Kh.bind(this)),this.$f.events.on(fu.BUFFER_GAP_JUMP,this.Jh.bind(this)),this.$f.events.on(fu.STALL_JUMP,this.$h.bind(this))},n.Yh=function(t){t.displayName&&this.Dh("vr_headset",t.displayName)},n.Xh=function(){var t=this;this.Pr=setInterval((function(){var n=t.$f.backbone.buffered,i=t.$f.backbone.videoElement;if(n&&n.length&&i&&i.currentTime){var e=t.$f.backbone.latency;t.Dh("live_latency",e)}else t.Dh("live_latency",0)}),500)},n.Zh=function(){clearInterval(this.Pr)},n.Oh=function(){var t=this;this.$f.store.watch("ui.player.boundingRect",(function(n){var i=t.getCurrent("video_dims"),e=t.Qh(n);t.jh("video_dims",e);var r=i?"Resized from ".concat(i," to ").concat(e):"Resized to ".concat(e);t.Uh(vc.MARKER_RESIZE,r)}))},n.Qh=function(t){var n="".concat(Math.round(t.width),"px"),i="".concat(Math.round(t.height),"px"),e=window.devicePixelRatio&&window.devicePixelRatio>1?"@".concat(Ps(window.devicePixelRatio,3),"x"):"";return n&&i?"".concat(parseInt(n,10),"×").concat(parseInt(i,10)," ").concat(e):""},n.Ih=function(){this.Mh=Id.reduce((function(t,n){return t[n]=[],t}),{})},n.Lh=function(){var t=this.$f.backbone.currentFile;this.jh("files",t),this.jh("scanner",this.$f.backbone.currentScannerName),"HLSLiveScanner"===this.$f.backbone.currentScannerName&&this.Xh(),this.Dh("min_bandwidth",0),this.Dh("max_badwidth",0);var n=this.$f.store.get("ui.player.boundingRect"),i=this.Qh(n);this.jh("video_dims",i)},n.Fh=function(t){var n=Math.round(100*t.speed)/100;this.jh("bandwidth",{videoTime:this.$f.backbone.currentTime,time:Date.now(),value:n});var i=this.getCurrent("max_badwidth"),e=this.getCurrent("min_bandwidth");(!e||ni)&&this.Dh("max_badwidth",n)},n.Hh=function(t){var n=t.dropped,i=t.total;this.Dh("total_frames",i),this.Dh("dropped_frames",n)},n.Yu=function(){this.Uh(vc.MARKER_SEEKED,"Seeked to ".concat(this.$f.backbone.currentTime))},n.td=function(){this.Uh(vc.MARKER_ENDED,"Ended")},n.zh=function(t){var n=t.previousStreamIndex,i=t.index,e=t.streams,r=e[i],o=e[n],u=o?o.bitrate:null;if(u!==r.bitrate&&null!==u){var a=this.nd(o),s=this.nd(r);r.bitrateu&&this.Uh(vc.MARKER_UPSWITCH,"Starting Upswitch from ".concat(a," to ").concat(s))}},n.Wh=function(t,n,i){var e,r=i[n],o=this.nd(r),u=vd(r.codecs),a=null==(e=this.$f.backbone)||null==e.getCurrentStream?void 0:e.getCurrentStream("audio"),s=pd(null==a?void 0:a.codecs),c="".concat(u).concat(s?" / ".concat(s):"");this.Uh(vc.MARKER_SWITCH_COMPLETE,"Completed switch to ".concat(o)),this.jh("streams",{profile:void 0!==t?t.profile:null,quality:void 0!==t?t.quality:"".concat(r.height,"p"),bitrate:r.bitrate,audioBitrate:null==a?void 0:a.bitrate,framerate:r.framerate,height:r.height,width:r.width,id:r.id,codec:c})},n.Bh=function(){var t=this.getCurrent("files"),n=this.$f.backbone.currentFile;this.jh("files",n);var i=n.metadata.cdn,e=t?t.metadata.cdn:null,r=t?fc[t.mime]:null,o=fc[n.mime],u="CDN to ".concat(i,"/").concat(o);e&&(u="CDN from ".concat(e,"/").concat(r," to ").concat(i,"/").concat(o)),this.Uh(vc.MARKER_FILE_CHANGE,u)},n.Vh=function(t){var n=Math.round(1e3*t)/1e3;this.jh("buffer_occupancy",{videoTime:this.$f.backbone.currentTime,time:Date.now(),value:n})},n.qh=function(){var t=this.getCurrent("scanner"),n=this.$f.backbone.currentScannerName;this.Dh("scanner",n),t&&this.Uh(vc.MARKER_SCANNER_CHANGE,"Scanner change to ".concat(n)),"HLSLiveScanner"===n?this.Xh():this.Zh()},n.Jh=function(t){this.Uh(vc.MARKER_BUFFER_GAP_JUMP,t.msg)},n.Kh=function(t){this.Uh(vc.MARKER_BUFFER_GAP_JUMP_PREVENT,t.msg)},n.$h=function(t){this.Uh(vc.MARKER_STALL_JUMP,t.msg)},n.ed=function(){this.Uh(vc.MARKER_STALLED,"Stalled")},n.nd=function(t){return"".concat(t.width,"×").concat(t.height,"@").concat(Math.round(t.framerate)," ").concat(Math.round(t.bitrate/1e3).toLocaleString()," Kbps")},n.Gh=function(){this.$f.events.fire(cc.Al)},t}();function Od(t){var n=t.element,i=t.delegate,e=void 0===i?{}:i,o=t.cssLoadedPromise,u=void 0===o?r.resolve(null):o,a=t.name,s=void 0===a?null:a;Na(Dc);var c=bs(Wf,ws((function(t){return function(){var n=t.apply(void 0,arguments),i=Ss();function e(t,n){return u(t,(function(t){var e=i.get({selector:t,listener:n});if(!e){var r=o(t,n);e=i.insert({selector:t,listener:n,unsubscribe:r})}return e.unsubscribe}))}function r(t,n){return u(t,(function(t){var e=i.get({selector:t,listener:n});return e&&e.unsubscribe()}))}function o(t,i){var e=t(n.getState());return n.subscribe((function(){var r=t(n.getState());if(e!==r){var o=e;i(e=r,o,n.getState())}}))}function u(t,i){return(t=[].concat(t)).map((function(t){return i(n.createGetter(t))}))}return z(z({},n),{},{watch:e,unwatch:r})}}),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){return function(){var i=n.apply(void 0,arguments);function e(){return t}var r=oa((function(t){if(Vt(t))return t;var n=ha(e(),t);return Vt(n)?n:function(n){return ha(n,t)}}));function o(t,n){var e=(t=r(t))(i.getState());return void 0!==n&&(e=Wl(e,n)),e}return z(z({},i),{},{getSelectors:e,createGetter:r,get:o})}}}(zf),ys.apply(void 0,[]))),l=new j,f=rt(),h=new jc({events:f}),d=Us();n.classList.add("player-".concat(d)),n.classList.add("loading"),n.id||(n.id="player".concat(d)),n.innerHTML=Yf.render("outer",{strings:{back:"Back",close:"Close overlay"}});var v=n.querySelector(".vp-telecine");if(Yi.iOS){var p=document.createElement("video");v.appendChild(p);try{p.setAttribute("muted",""),p.setAttribute("playsinline",""),p.load()}catch(t){Dc.captureException(t)}}var m,b,w,g,y,_=null,k=null,E=null,T=null,S=null,A=null,x=null,C={},M=new r((function(t,n){y=t})).then((function(){return f.fire(cc.ye),null})),I={get config(){return h.config},set config(t){h.config=t},get delegate(){return e},set delegate(t){e=t},ready:function(t){if(!t)return M;M.then((function(){return t()})).catch((function(t){Dc.captureException(t)}))},get sessionId(){return h.config.request.session}};function R(t){var n,i=t.old,e=t.loaded;if(function(t,n){var i;t&&s&&"".concat(s," "),null==(i=n.request)||i.ab_tests}(!i,e),(null==(n=e.request)?void 0:n.urls.js)&&function(t){lt=t.substring(0,t.lastIndexOf("/")+1)}(e.request.urls.js),window.parent!==window){var r,o="Private Video on Vimeo";1!==e.view&&3!==e.view&&12!==e.view||(o="".concat(e.video.title," from ").concat(e.video.owner.name," on Vimeo")),document.title=o,(null==(r=history)?void 0:r.replaceState)&&e.video&&i&&history.replaceState({id:e.video.id},"","/video/".concat(e.video.id).concat(window.location.search))}if(1!==e.view&&3!==e.view&&12!==e.view)throw new Error("Config not authorized: ".concat(e.view));(null==i?void 0:i.embed)&&i.embed.color!==e.embed.color&&f.fire(Zs.Hs,e.embed.color),T&&T.reset();var u=!i||!i.video||i.video.id!==e.video.id||i.video.version.current!==e.video.version.current;return m=null,w=_,f.fire(Zs.Us),c.dispatch(Zc(e)),f.fire(cc.Bl,u,e),t}function O(t){if("opacity"===t.propertyName){var n=document.querySelector(".vp-placeholder");n&&(Rl(n).off("transitionend",O),n.parentNode.removeChild(n))}}function L(){!function(){var t=document.querySelector(".vp-placeholder");t&&(Rl(t).on("transitionend",O),t.classList.add("vp-placeholder-fadeout"))}(),n.classList.remove("loading"),y()}function D(t){return u.then((function(){if(P(t),k&&k.resetThumbnail(),"function"!=typeof C.authorizationHandler)throw new Error("Config was not authorized.");return C.authorizationHandler(L)})).then((function(t){return h.config=t,m=null,c.dispatch(Zc(h.config)),f.fire(Zs.Us),f.fire(cc.Bl,!0,h.config),t}))}function N(t){(function(){var t=document.location.hash,n=function(t){var n,i=t.match(/\ba?t=([0-9hms:]+)/);null!==i&&(t=i[1]);var e=!1,r=0,o=0,u=0;if((null==(n=i=t.match(/^([0-9]+)$/))?void 0:n.length)&&(e=!0,u=i[1]),!1===e&&null!==(i=t.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s)?/))&&""!==i[0]){e=!0;var a=Q(i,4),s=a[1];r=void 0===s?0:s;var c=a[2];o=void 0===c?0:c;var l=a[3];u=void 0===l?0:l}if(!1===e&&null!==(i=t.match(/^([0-9:]+)/))){e=!0;var f=Q(t.split(":").reverse(),3);u=f[0];var h=f[1];o=void 0===h?0:h;var d=f[2];r=void 0===d?0:d}return e?60*parseInt(r,10)*60+60*parseInt(o,10)+parseInt(u,10):null}(t);null!==n&&(h.config.embed.time=Os(n,0,h.config.video.duration),-1!==t.indexOf("at=")&&history&&history.replaceState&&history.replaceState("","",window.location.pathname+window.location.search))})(),f.on(cc.Nl,(function(t){h.reload().then((function(n){if(!h.config.user.logged_in)return f.fire(cc.Fl),n;switch(f.fire(cc.Pl,t),t){case"like":h.config.user.liked&&f.fire(cc.Ol);break;case"watch-later":h.config.user.watch_later&&f.fire(cc.Dl);break;case"private":f.fire(cc.Wl)}return n})).catch((function(t){Dc.captureException(t)}))})),f.on(cc.Ul,(function(){h.reload().catch((function(t){Dc.captureException(t)}))})),function(t){var i,e;k=new dl(t,c,n.querySelector(".vp-preview")),f.on([xi.BUFFER_ENDED,Ti.PLAYING],(function(){k.hide()})),_=new ts(v,h.config),w=_,x=new Rd(t),new _l(t,c,n.querySelector(".vp-video-wrapper")),new Gf(t,c,n.querySelector(".vp-captions")),new Kf(n,f),U(t),t.doNotTrackEnabled||(h.config.request.urls.test_imp&&function(t,n){if(t.config.request.ab_tests){var i=new Sc(n);for(var e in t.config.request.ab_tests){var r=t.config.request.ab_tests[e];if(r.track){var o={session_id:t.config.request.session,test_id:e,test_group:String(r.group)};i.log(o,!0,!1).catch((function(t){}))}}}}(t,"".concat(h.config.request.urls.test_imp,"?beacon=1")),new bd(t,n,c,h.config.request.urls.fresnel),new ql(t,c),new wd(t,n,c),new gd(t)),T=new wl(t),(t.config.request.flags.ott||(null==(i=t.config.request.ab_tests)||null==(e=i.chromecast)?void 0:e.group))&&function(t){if(!t.config.video.spatial&&"stock"!==t.config.video.privacy){var i=new Yc({textAlert:new cd(n),player:t});Jc.init({chromecastPlayer:i}),Jc.on([Gc.error,Gc.mediaLoadedFailed],(function(t){Dc.captureException(t)}))}}(t),P(t)}(t)}function P(t){E||(E=new sd(t),Jf(I,E),Nh(Dc))}function U(t){var i=h.config.request.ads;i&&(i.adcode&&i.adunit||i.adurl)&&(S=new kd(t,n.querySelector(".vp-video-wrapper")),f.on(cc.hc,(function(){w=S,f.fire(cc.wf)})),f.on(cc.dc,(function(){w=_,f.fire(cc.wf)})),Jc&&(Jc.on(Gc.connected,(function(){S.toggleCastingState(!0)})),Jc.on(Gc.disconnected,(function(){S.toggleCastingState(!1)}))))}function F(t,n){var i=t;return isNaN(t)&&"string"!=typeof t||(i=js(Ds(t),t,n)),i}var V={get store(){return c},get config(){return h.config},get element(){return n},get events(){return f},get uuid(){return d},get expose(){return I},get backbone(){return _},get adHandler(){return S},get displayContext(){return w},get preview(){return k},get doNotTrackEnabled(){return h.config.embed.dnt||h.config.request.flags.dnt},get playLoggingEnabled(){return h.config.embed.log_plays&&h.config.request.flags.plays},get currentTime(){return Jc.isCastConnected?Jc.chromecastPlayer.currentTime:_.currentTime},get debugCollector(){return x},get ottVideoMetadata(){return A},set ottVideoMetadata(t){A=t},init:function(t,i){return b||(new Mh(V,c,n),C=i,b=h.load(t).then(R).catch((function(t){return D(V)})).then((function(){return"function"==typeof C.initializationHandler?r.resolve(i.initializationHandler()):null})).then((function(){return N(V),"function"==typeof C.postInitializationHandler?r.resolve(i.postInitializationHandler()):null})).then((function(){return r.all([k.thumbnailPromise,u])})).then(L).then((function(){return Dc.setUp(V),null})).catch((function(t){Dc.captureException(t)})))},loadVideo:function(t,i){if(g===t&&m)return m;if(k&&k.resetThumbnail(),null==i?void 0:i.video_version){var e=h.config.video.version.available;if(!e||!Array.isArray(e))return r.reject("No available video versions");if(-1===(e=e.map((function(t){return t.id}))).indexOf(i.video_version))return r.reject("Invalid version id specified")}f.fire(cc._loadVideo),g=t,n.classList.add("loading");var o=F(t,i),u=l.get(o);return t=u?u.rd.loaded:t,m=h.load(t,i).then((function(t){if(u){var n=_.element;(_=u._backbone).element.style.visibility="visible",n.parentNode.replaceChild(_.element,n),f.fire(cc.af)}return t=R(t),S||U(V),t})).catch((function(t){return D(V)})).then((function(t){var n=k.loadThumbnail();return r.resolve(n)})).then(L)},preloadVideo:function(t,n,i){var e=F(n,i),o=l.get(e);return o?r.resolve(o):new jc({events:f}).load(n,i).then((function(n){var i=_.element.cloneNode(!1);i.style.visibility="hidden",_.element.parentNode.insertBefore(i,_.element);var r=new ts(i,n.loaded);r.loadVideo(n.loaded),r.preload=t;var o={_backbone:r,rd:n};return l.set(e,o),o}))},performDelegateAction:function(t){var n,i,r,o,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];null!=(n=e)&&n[t.will]&&!1===(r=(o=e)[t.will].apply(o,[h.config.video.id].concat(tt(a))))||(u.apply(void 0,[h.config.video.id].concat(tt(a),[r])),(null==(i=e)?void 0:i[t.did])&&e[t.did]())},ready:function(){return M},verifyConfig:function(){return h.verify()},updatePhpTokens:function(){return new r((function(t,n){var i=h.config.user,e=i.vimeo_api_client_token,r=i.vimeo_api_interaction_tokens,o=i.vimeo_live_client_token,u=i.vimeo_bucketed_live_client_token,a=!1;if(e)try{a=ih(JSON.parse(atob(e.split(".")[1])).exp)>=0}catch(t){return void n(new Error("Failed to parse PHP client token expiration"))}if(r)try{var s=JSON.parse(atob(r.likes.split(".")[1])).exp,c=JSON.parse(atob(r.watch_later.split(".")[1])).exp,l=JSON.parse(atob(r.following.split(".")[1])).exp;a=ih(s)>=0||ih(c)>=0||ih(l)>=0}catch(t){return void n(new Error("Failed to parse PHP interaction tokens expiration"))}if(o)try{a=ih(JSON.parse(atob(o.split(".")[1])).exp)>=0}catch(t){return void n(new Error("Failed to parse PHP Live token expiration"))}if(u)try{a=ih(JSON.parse(atob(u.split(".")[1])).exp)>=0}catch(t){return void n(new Error("Failed to parse PHP Live token expiration"))}if(a){var f=h.config.request,d=f.signature,v=f.session,p=f.timestamp,m=f.expires;tr("https://".concat(h.config.player_url,"/video/").concat(h.config.video.id,"/token/refresh?signature=").concat(d,"&session=").concat(v,"&time=").concat(p,"&expires=").concat(m),{withCredentials:!0}).json().then((function(n){return h.config.user.vimeo_api_client_token=n?n.vimeo_api_client_token:null,h.config.user.vimeo_api_interaction_tokens=n?n.vimeo_api_interaction_tokens:null,h.config.user.vimeo_live_client_token=n?n.vimeo_live_client_token:null,h.config.user.vimeo_bucketed_live_client_token=n?n.vimeo_bucketed_live_client_token:null,t()})).catch((function(t){Dc.captureBreadcrumb("Failed to refresh JWT token",{},"auth","error"),n(t)}))}else t()}))}};return V}function Ld(t,n,i,e){var r=!1;e="function"==typeof n?i:e,i="function"==typeof n?n:i;var o=function(t){var n=!0;if(t.changedTouches){var o=t.changedTouches[0].pageX-window.pageXOffset,u=t.changedTouches[0].pageY-window.pageYOffset,a=document.elementFromPoint(o,u);null!==a&&this.contains(a)&&(n=i.call(this,t))}return"function"==typeof e&&e.call(this,t),r=!0,n},u=function(t){if(!r)return i.call(this,t);r=!1};(n="function"==typeof n?null:n)?Rl(t).on("click",n,u).on("touchend",n,o):Rl(t).on("click",u).on("touchend",o)}function Dd(t,n){var i,e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=[],a=!1,s=!1;function c(){i=f(),r.forEach(b),Ld(i,".js-menuClose",A),Ld(i,".js-menuInfo",M),Rl(window).on("resize",I)}function l(){Rl(window).off("resize",I)}function f(){var t=document.createElement("div");return t.innerHTML=Yf.render("menu",{strings:{close:"Close menu"}}),t.children[0]}function h(){return i.classList.contains("vp-menu-center")}function d(){return i.classList.contains("vp-menu-fullwidth")}function v(){return i.classList.contains("vp-menu-carousel")}function p(){var t=u.length>1&&!v();u.forEach((function(n){n.setCollapsible(t),n.resetCarousel(v())}))}function m(){if(o.defaultOpen&&!s){var t=u.find((function(t){return t.id===o.defaultOpen}));t&&(t.open(),s=!0)}}function b(t){u.push(t),i.insertBefore(t.element,i.lastChild),p(),t.on("open",g),t.on(["open","close"],y),t.on(["openEnd","closeEnd"],_),t.on("select",T)}function w(t){return u.find((function(n){return n.id===t}))}function g(t){u.filter((function(t){return t.isOpen()})).forEach((function(t){return t.close()}))}function y(t){a=!0,R()}function _(t){a=!1}function k(){return n&&"true"===n.getAttribute("aria-expanded")}function E(r){k()||(r=r||n.contains(document.activeElement),n.setAttribute("aria-expanded","true"),i.removeAttribute("hidden"),t.events.fire(cc.Vc,!0,e),I(),p(),m(),i.classList.remove("vp-menu-hidden"),window.requestAnimationFrame((function(){if(i.classList.remove("vp-menu-invisible"),r){var t=L();t.length>0&&t[0].focus()}})))}function T(){v()||o.persistOnClick||A()}function S(){L().some((function(t){return t===document.activeElement}))&&n.focus()}function A(){k()&&setTimeout((function(){S(),n.setAttribute("aria-expanded","false"),t.events.fire(cc.Vc,!1,e),i.classList.add("vp-menu-invisible")}),100)}function x(t){i.classList.add("vp-menu-hidden"),i.setAttribute("hidden","")}function C(t){return k()?(A(),!1):(E(t),!0)}function M(n){t.events.fire(cc.bl),A()}function I(){if(!d()){var n=Ms(t.element),e=Ms(i),r=window.getComputedStyle(i),o=parseFloat(r.fontSize),u=e.bottom-i.scrollHeight,a=Math.max(n.top,0)-u;if(a>0){var s=i.scrollHeight-a-o;return i.style.height="".concat(s/o,"em"),void i.classList.add("vp-menu-scroll")}i.style.height="auto",i.classList.remove("vp-menu-scroll")}}function R(){I(),a&&requestAnimationFrame(R)}function O(){Rl(i).on("transitionend",(function(t){this===i&&"opacity"===t.propertyName&&i.classList.contains("vp-menu-invisible")&&x()})),Rl(document).on("click",(function(t){null!==n&&(!k()||n.contains(t.target)||i.contains(t.target)||A())})),window.addEventListener("blur",A,!1)}function L(){return u.reduce((function(t,n){return t.concat(n.getTabindexItems())}),[])}return c(),O(),e={element:i,button:n,isCentered:h,isVisible:k,isFullwidth:d,show:E,hide:A,toggle:C,retargetFocusFromChild:S,setPanelModes:p,addPanel:b,getPanel:w,getTabindexItems:L,destroy:l}}var jd=function(t){return function(n){return null==t?void 0:t[n]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),Nd=/[&<>"']/g,Pd=RegExp(Nd.source);function Ud(t){return(t=Lo(t))&&Pd.test(t)?t.replace(Nd,jd):t}function Fd(t){rt(this);var n,i,e,r=this,o={x:0,y:0},u={x:0,y:0},a={x:0,y:0},s=0;function c(n){t.style["".concat(Yi.transitionProperty,"Duration")]=n}function l(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.children.length-1,r=-Math.round(n/h());return Math.min(Math.max(r,i),e)}function f(){return!1}function h(){var n=t.children[0],i=getComputedStyle(n);return n.offsetWidth+parseInt(i.marginLeft,10)+parseInt(i.marginRight,10)}function d(t){var n=[t.clientX,t.clientY],i=n[0],e=n[1];if(t.targetTouches&&t.targetTouches.length>0){var r=[t.touches[0].pageX,t.touches[0].pageY];i=r[0],e=r[1]}return{x:i,y:e}}function v(t){t.stopImmediatePropagation();var i=d(t),r=i.x,a=i.y;u.x=r-o.x,u.y=a-o.y,n=!1,(e=function(t){return function(n){var i=n?"on":"off",e={pointerdown:["pointermove","pointerup"],MSPointerDown:["pointermove","pointerup"],touchstart:["touchmove","touchend"],mousedown:["mousemove","mouseup"]};Rl(window)[i](e[t.type][0],p),Rl(window)[i](e[t.type][1],m)}}(t))(!0),c("0ms")}function p(t){var s=d(t),c=s.x,f=s.y;if(a.x=o.x,a.y=o.y,o.x=c-u.x,o.y=f-u.y,Math.abs(o.x-a.x)>=.15*Math.abs(o.y-a.y))return t.preventDefault(),n=!0,r.fire("touchMove"),i=Date.now(),void y(o.x);e(!1),b(l(o.x))}function m(u){if(u.stopImmediatePropagation(),e(!1),n){u.preventDefault();var c=o.x-a.x,f=Date.now()-i+1;return o.x+=50*c/f,b(l(o.x)),void r.fire("touchEnded")}!function(n){n.preventDefault();var i=Bs(n.target,t.children);if(-1!==i){if(i!==s)return void b(i);r.fire("tap",i)}}(u)}function b(t){g(t),r.fire("slide",t)}function w(){g(s,"0ms")}function g(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=h();-1!==t&&i>0&&(c(n),o.x=-t*i,y(o.x))}function y(n){var i=l(n,-1,t.children.length);i!==s&&(r.fire("focus",i),s=i),t.style[Yi.transformProperty]="translateX(".concat(n,"px)")}return{setUp:function(n){Rl(t).on(Yi.pointerEvents?"pointerdown":["touchstart","mousedown"],v),Rl(t).on("click","a",f),Rl(window).on("resize",w),w(),function(t){void 0!==t&&g(t,"0ms")}(n)},show:function(t){g(Vs(t))},resize:w,destroy:function(){Rl(t).off(Yi.pointerEvents?"pointerdown":["touchstart","mousedown"],v),Rl(t).off("click","a",f),Rl(window).off("resize",w),t.style.removeProperty(Yi.transformProperty)},on:this.on}}function Vd(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.items.forEach((function(t){void 0!==t.label&&(t.label=Ud(t.label))}));var i,e,r,o,u,a,s=rt(),c=n.id,l=n.items,f=!1;function h(){d(),i=v(),e=i.querySelector(".js-panelItems"),(r=new Fd(e)).on("slide",x),r.on("tap",C),Ld(i,".js-panelTitleButton",A),Ld(i,"li",M),Rl(i).on("keydown",I),Rl(i).on("keypress",I),Rl(i).on("transitionend",(function(t){t.target===i&&(_()?E():S())}))}function d(){n=Object.assign(n,{get active(){return D()?D().label:""}})}function v(){var t=document.createElement("div");return t.innerHTML=Yf.render("menu_list_panel",n),t.children[0]}function p(t){var n=F(i.querySelectorAll(".vp-panel-item"));return n[t]||n}function m(t){t!==b()&&(i.classList.toggle("vp-panel-open",!t),i.classList.toggle("vp-panel-collapsible",t),t?e.setAttribute("hidden",""):(e.removeAttribute("hidden"),i.style.removeProperty("height")))}function b(){return i.classList.contains("vp-panel-collapsible")}function w(t){if(f=t,u=i.querySelector(".vp-indicator"),r.destroy(),u.classList.remove("vp-indicator-visible"),f){var n=l.findIndex((function(t){return t.active}));r.setUp(n),g(),u.classList.add("vp-indicator-visible")}}function g(){r.on("touchMove",(function(){u.classList.add("vp-indicator-inactive")})),r.on("touchEnded",(function(){u.classList.remove("vp-indicator-inactive")}))}function y(){i.classList.add("vp-panel-pinTitle")}function _(){return i.classList.contains("vp-panel-open")}function k(){if(b()){s.fire("open",o),t.events.fire(cc.zc,!0,o),e.removeAttribute("hidden"),i.classList.add("vp-panel-open");var n=window.getComputedStyle(i),r=parseFloat(n.fontSize);i.style.height="".concat(i.scrollHeight/r,"em");var u="".concat(Yi.transitionProperty,"Delay");p().forEach((function(t,n){var i=40*n+100;t.style[u]="".concat(i,"ms"),t.classList.add("vp-panel-item-in")}))}}function E(t){s.fire("openEnd",o)}function T(){b()&&(s.fire("close",o),t.events.fire(cc.Gc,!1,o),i.classList.remove("vp-panel-open"),i.style.removeProperty("height"),L())}function S(t){e.setAttribute("hidden",""),p().forEach((function(t,n){t.classList.remove("vp-panel-item-in")})),s.fire("closeEnd",o)}function A(t){return t.preventDefault(),_()?T():k()}function x(t){s.fire("select",l[t].id)}function C(t){s.fire("select",l[t].id)}function M(t){if(!f){var n=Bs(t.target,p());s.fire("select",l[n].id)}}function I(t){if("keypress"===t.type&&13===t.which||"keydown"===t.type&&32===t.which){var n=Bs(t.target,p());if(-1!==n)return s.fire("select",l[n].id),!1}return null}function R(t){var n=l.findIndex((function(t){return t.active}));if(-1!==n){l[n].active=!1;var e=p(n);e.classList.remove("vp-panel-item-on"),e.setAttribute("aria-checked","false")}var r=l.findIndex((function(n){return"".concat(n.id)==="".concat(t)}));if(-1!==r){l[r].active=!0;var o=p(r);o.classList.add("vp-panel-item-on"),o.setAttribute("aria-checked","true"),i.querySelector(".js-panelStatText").innerHTML=l[r].label}u.classList.remove("vp-indicator-inactive")}function O(t){L(),a=t,t&&p(l.findIndex((function(t){return"".concat(t.id)==="".concat(a)}))).classList.add("vp-".concat(c,"-item-hover"))}function L(){if(a){var t=p(l.findIndex((function(t){return"".concat(t.id)==="".concat(a)})));t.length||t.classList.remove("vp-".concat(c,"-item-hover"))}}function D(){return l.find((function(t){return t.active}))}function j(t){D()&&"auto"!==D().id||(i.querySelector(".js-panelStatText").innerHTML=t)}function N(){return F(i.querySelectorAll('.vp-panel-collapsible button[tabindex="0"], .vp-panel-open li[tabindex="0"]'))}return h(),o={id:c,element:i,setCollapsible:m,resetCarousel:w,pinTitle:y,isOpen:_,open:k,close:T,setActiveItem:R,setHoverState:O,clearHoverState:L,setTitleStat:j,getTabindexItems:N,on:s.on,off:s.off}}function Bd(t){var n,i=0,e=!1,r=null,o=null,u=null;function a(){if(Yi.touch&&!t.store.get(cl)&&!t.config.video.spatial){var n=null,a=10;(r=t.element.querySelector(".vp-nudge-wrapper")).classList.remove("hidden"),r.innerHTML=Yf.render("nudge"),o=t.element.querySelector(".vp-nudge-forward"),u=t.element.querySelector(".vp-nudge-backward"),Ld(o,(function(t){t.preventDefault(),l("right"),n=setTimeout(f,250)})),Ld(u,(function(t){t.preventDefault(),l("left"),n=setTimeout(f,250)})),t.events.on(cc.yc,(function(){e=!0}))}function l(t){if(["left","right"].includes(t)){var e="right"===t?s:c,r="right"===t?o:u;i++,clearTimeout(n),i>=2&&(h(r,t,a),2===i&&e(10),e(10*(i-2)),i>2&&(h(r,t,a+=10),i=2))}}function f(){i>=2&&t.events.fire(cc.Ec),i=0,a=10}}function s(n){l((t.currentTime||0)+n)}function c(n){var i=(t.currentTime||0)-n;l(i>=0?i:0)}function l(n){t.events.fire(cc.kc),t.events.fire(Zs.Os,null,n),e||t.events.fire(cc.Ac)}function f(n,i){var e=t.currentTime||0,r="right"===i?"+":"-";return"right"===i&&e>t.config.video.duration-10||e<=10&&"left"===i?null:"".concat(r," ").concat(n)}function h(i,e,r){if(["left","right"].includes(e)){var o=t.element.querySelector(".vp-nudge-shade-".concat(e)),u=i.querySelector(".vp-nudge-seconds");f(r,e)&&(u.innerHTML=f(r,e),clearTimeout(n),i.classList.remove("invisible"),o.classList.remove("vp-nudge-shade-invisible"),n=setTimeout((function(){o.classList.add("vp-nudge-shade-invisible"),i.classList.add("invisible")}),500))}}return t.events.on(cc.Bl,(function(){[o,u].forEach((function(t){t&&Rl(t).off("click").off("touchend")})),a()})),a(),{}}var Hd=/^(%20|\s)*(javascript|data)/im,qd=/[^\x20-\x7E]/gim,Wd=/^([^:]+):/gm,zd=[".","/"];function Gd(t){var n=t.match(Wd);return null==n?void 0:n[0]}function Yd(t){return t?decodeURI(encodeURI(function(t){var n=Gd(t=t.trim());return t&&!n&&(t="http://".concat(t)),t}(function(t){var n=t.replace(qd,"");if(function(t){return zd.indexOf(t[0])>-1}(n))return n;var i=Gd(n);return i&&Hd.test(i)?"":n}(t)))):null}function Kd(t){var n=t.url,i=t.embedded,e=t.ownerId,r=t.element;return"".concat(n,"?embedded=").concat(i,"&source=").concat(r,"&owner=").concat(e)}function Jd(){for(var t=arguments.length,n=new Array(t),i=0;i1?n-1:0),e=1;e1?n-1:0),e=1;e0&&(e.style.left=c+"px"),l>0&&(e.style.right=l+"px")}}(),function(n){Rl(n).on("mouseenter",".js-chapter-marker",(function(n){t.events.fire(cc.Rc,{id:n.target.dataset.time,position:"marker"})})).on("mouseleave",".js-chapter-marker",(function(n){t.events.fire(cc.Oc)})),t.events.on([cc.Rc,cc.Oc],r),t.events.on(cc.Lc,o)}(a),i=F(n.querySelectorAll(".js-chapter-marker")),(null==(u=t.backbone)?void 0:u.chaptersTrack)&&t.backbone.chaptersTrack.addEventListener("cuechange",e)}}}function iv(t,n,i){var e,r,o,u,a,s,c,l,f,h,d,v,p,m,b,w,g,y,_,k,E,T,S,A,x,C,M=!1,I=!1,R=!1,O=!1,L=!1,D=!1,j=!1,P=!1,U=!1,V=!1,B=!1,H=!1,q=!0,W=!1,z=!1,G=null,Y=null,K=[],J=null,$=null,X=null,Z=!1,nt=!1,it=[],rt=new nv(t,i),ot=t.config.embed.autoplay&&t.config.request.flags.autohide_controls,ut=[{id:.5,label:"0.5x"},{id:.75,label:"0.75x"},{id:1,label:"Normal"},{id:1.25,label:"1.25x"},{id:1.5,label:"1.5x"},{id:2,label:"2x"}],at=Yi.touch?300:0;function st(){G=null,Y=null}function ct(){if(!Y){var t=Ms(c).left,n=parseInt(window.getComputedStyle(c,"").borderLeftWidth,10);Y=t+n}return Y}function lt(){if(!G){var t=Ms(c).right,n=parseInt(window.getComputedStyle(c,"").borderRightWidth,10);G=t-n}return G}function ft(t){var n=ct();return Os((t-n)/(lt()-n),0,1)}function ht(n){for(var i,e=et(K);!(i=e()).done;){var r=i.value,o=Ms(r),u=o.left,a=o.right;if(n>=u&&n<=a)return parseFloat(r.getAttribute("data-time"))/t.config.video.duration}return ft(n)}function dt(n,i){I&&!H&&(i=i||t.config.video.duration*n||0,window.requestAnimationFrame((function(){vt(n,i),pt(n,i)})))}function vt(t,i){(!n.get(nl)||W&&0!==i)&&(n.get(cl)&&(t=100),v.style.left=Math.min(Ps(100*t),100)+"%",p.innerHTML=rh(i),v.style.display="block")}function pt(i,e){n.get(cl)&&(i=100);var r=Math.min(Ps(100*i),100);h.style.width="".concat(r,"%"),l.setAttribute("aria-valuenow",Math.round(e)),l.setAttribute("aria-valuetext","".concat(rh(e)," of ").concat(rh(t.config.video.duration))),a.setAttribute("width","".concat(r,"%"))}function mt(t,i){n.get(cl)&&(t=100);var e=Math.min(Ps(100*t),100);f.style.width="".concat(e,"%"),u.setAttribute("width","".concat(e,"%"))}function bt(){W=!1,r.classList.remove("state-playing"),r.classList.add("state-paused")}function wt(){W=!0,z&&At(),r.classList.remove("state-paused"),r.classList.add("state-playing")}function gt(){q=!1,it.forEach((function(t){return t.retargetFocusFromChild()})),t.events.fire(cc.Uc,q),i.classList.add("invisible")}function yt(){setTimeout((function(){q=!0,t.events.fire(cc.Uc,q),i.classList.remove("invisible")}),at)}function _t(){O||q&&(M||(I&&B||L||ot)&&(R||(!Z&&!nt||L)&&(L&&3===t.config.view||P||D||gt())))}function kt(){O||q||L||yt()}function Et(t){return it.push(t),t.button.parentNode.insertBefore(t.element,t.button.nextSibling),t}function Tt(t){it=it.filter((function(n){return n!==t})),t.destroy()}function St(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(y){var n,i=1/_.length,e=t/i,r=Math.ceil(e),o=e%1;o<=.33&&(n="fill1"),o>.33&&o<=.66&&(n="fill2"),_.forEach((function(t,i){t.classList.remove("fill0"),t.classList.remove("fill1"),t.classList.remove("fill2"),i===r-1&&o&&o<=.66?t.classList.add(n):i>r-1&&t.classList.add("fill0")})),y.setAttribute("aria-valuenow",t.toFixed(3)),y.setAttribute("aria-valuetext",Math.round(100*t)+"%")}}function At(){var e;if(1===t.config.view||3===t.config.view||12===t.config.view){S&&(Tt(S),S=null),J&&(Tt(J),J=null);var M=t.backbone||{},O=t.config.embed.settings,L={show:O.logo,showLink:!!t.config.video.onsite_redirect_url,url:Kd({url:t.config.video.onsite_redirect_url,embedded:!t.config.embed.on_site,ownerId:t.config.video.owner.id,element:"vimeo_logo"})},D=function(){var n;if(!(null==(n=t.config.embed.settings.custom_logo)?void 0:n.img))return null;var i=t.config.embed.settings.custom_logo,e=i.img;return Yi.devicePixelRatio>=2&&(e=e.replace(/(mw|mh)=(\d+)/g,(function(t,n,i){return n+"="+2*parseInt(i,10)}))),{showLink:null!==i.url,url:Yd(i.url),img:e,sticky:i.sticky,width:i.width,height:i.height}}();if(!O.watch_trailer||I||W||t.config.embed.autoplay||!t.config.embed.on_site){var j=!t.backbone||t.backbone.supportsSettingVolume,N=!t.backbone||t.backbone.supportsTextTracks,P=md(t.config,"chromecast").group&&Yi.browser.chrome&&(void 0===O.chromecast||O.chromecast)&&!t.config.video.spatial&&"stock"!==t.config.video.privacy,U=t.displayContext===t.backbone,V=M.supportsPlaybackRate&&O.speed,B=U&&(V||M.qualities&&M.qualities.length>0),H="disable"!==t.config.video.privacy&&(Yi.webvr||Yi.stereoscopic)&&t.config.video.spatial&&md(t.config,"webvr").group,G=!!t.backbone&&(null==(e=t.backbone.textTracks)?void 0:e.length);t.events.on(xi.TEXT_TRACKS_AVAILABLE,(function(){var n;G=!!t.backbone&&(null==(n=t.backbone.textTracks)?void 0:n.length),At()}));var Y={targetBlank:0===t.config.embed.on_site,playState:W?"playing":"paused",volume:j&&O.volume,ccButton:N&&G&&U,castButton:P,ccOn:null!==X,prefsButton:B,airplayButton:Yi.airPlay,stereoscopicButton:H,fullscreenButton:O.fullscreen,vimeoLogo:U?L:{},duration:rh(t.config.video.duration),rawDuration:t.config.video.duration,captionsIcon:Yf.render("icon_cc",{title:"Choose captions"}),settingsIcon:Yf.render("icon_gear",{title:"Settings"}),fullscreenIcon:Yf.render("icon_fullscreen",{title:"Enter full screen"}),unfullscreenIcon:Yf.render("icon_unfullscreen",{title:"Exit full screen"}),playIcon:Yf.render("icon_play",{title:"Play"}),pauseIcon:Yf.render("icon_pause",{title:"Pause"}),replayIcon:Yf.render("icon_replay",{title:"Play"}),chaptersIcon:Yf.render("icon_chapters",{title:"Chapters"}),chapters:!!M.chapters&&M.chapters.length,strings:{loadedBar:"loaded",playedBar:"played",volume:"Volume (use up/down arrow keys to change)",airPlay:"Choose an AirPlay device",airPlayOff:"Turn off AirPlay",pipEnter:"Enter Picture-in-Picture",pipReturn:"Exit Picture-in-Picture",fullscreen:"Fullscreen",chromecast:"Cast",watchOnVimeo:"Watch on vimeo.com",stereoscopic:"Enable stereoscopic playback",stereoscopicOff:"Disable stereoscopic playback"}};if(D&&(Y.customLogo=D),i.classList.remove("trailer"),z=!1,i.innerHTML=Yf.render("controlbar",Y),r=i.querySelector(".play"),o=r.querySelector(".buffer"),u=r.querySelector(".loaded"),a=r.querySelector(".played"),s=i.querySelector(".play-bar"),c=i.querySelector(".vp-progress"),l=s.querySelector(".focus-target"),f=s.querySelector(".loaded"),h=s.querySelector(".played"),d=s.querySelector(".cuepoints"),v=i.querySelector(".timecode"),p=v.querySelector(".box"),m=i.querySelector(".ghost-timecode"),b=m.querySelector(".box"),w=i.querySelector(".thumb-preview"),g=i.querySelector(".thumb"),(y=i.querySelector(".volume"))&&(_=F(y.querySelectorAll("div")),t.config.embed.muted?St(0):St(t.config.request.cookie.volume)),T=i.querySelector(".play-bar .cc"),E=i.querySelector(".js-chapter-button"),(k=i.querySelector(".js-prefs"))&&Jc.isCastConnected&&$d(k),A=i.querySelector(".pip"),Yi.airPlay&&(x=i.querySelector(".airplay")),(Yi.webvr||Yi.stereoscopic)&&t.config.video.spatial&&(C=i.querySelector(".stereoscopic")),R=!1,q&&t.events.fire(cc.Uc,q),ot&&_t(),xt(),n.get(cl)){var K=i.querySelector(".vp-live-status");K.style.display="block";var $=K.querySelector(".vp-live-status-circle");n.get(al)?($.classList.remove("offline"),$.classList.add("online"),k&&!Jc.isCastConnected&&Jd(k)):($.classList.add("offline"),$.classList.remove("online"),r.classList.add("hidden"),k&&$d(k)),p.style.cursor="default",c.classList.add("disabled")}rt.renderChapterMarkers()}else!function(n,e){i.classList.add("trailer");var o={vimeoLogo:n,text:t.config.video.vod.button_text||"Watch Trailer",strings:{watchOnVimeo:"Watch on vimeo.com"}};e&&(o.customLogo=e),i.innerHTML=Yf.render("controlbar_trailer",o),r=i.querySelector(".play"),z=!0}(L,D)}}function xt(){if(n.get(cl)){var i=W&&t.config.duration>0;v.style.display=i?"block":"none"}}function Ct(){var e;function r(n){if(H=!1,e===n.pointerId&&!1!==n.isPrimary){var i=n.clientX;n.targetTouches&&n.targetTouches.length>0&&(i=n.targetTouches[0].clientX,n.preventDefault());var r=ht(i);dt(r),t.events.fire(Zs.Os,r)}}function o(n){var e=n.type;"pointerup"===e||"MSPointerUp"===e?Rl(i).off("pointermove",".vp-progress",r).off("pointerup",".vp-progress",o):"touchend"===n.type?Rl(i).off("touchmove",r).off("touchend",o):Rl(document).off("mousemove",r).off("mouseup",o),t.events.fire(cc.jc),t.element.classList.remove("scrubbing")}t.events.on(Ti.TIME_UPDATE,(function(n){var i=n.currentTime,e=n.timeProgress;H&&(0===t.config.embed.time||t.config.embed.time>0&&i>=t.config.embed.time)&&(H=!1),D||dt(e,i)})),t.events.on(cc.Dc,(function(t){D=!0,j=t})),t.events.on(cc.jc,(function(){D=!1,j=!1})),t.events.on(Ti.SEEKED,(function(t){var n=t.timeProgress;j&&dt(n)})),n.get(nl)&&!n.get(sl)||(Rl(i).on(Yi.pointerEvents?"pointerdown":["touchstart","mousedown"],".vp-progress",(function(n){if(!(n.button&&2===n.button||n.target.classList.contains("js-chapter-marker"))){var u=n.type;if(t.element.classList.add("scrubbing"),t.events.fire(cc.Dc,!1,u),"pointerdown"===u||"MSPointerDown"===u){e=n.pointerId;try{n.target.msSetPointerCapture?n.target.msSetPointerCapture(e):n.target.setPointerCapture(e)}catch(t){}Rl(i).on("pointermove",".vp-progress",r).on("pointerup",".vp-progress",o)}else"touchstart"===u?Rl(i).on("touchmove",r).on("touchend",o):Rl(document).on("mousemove",r).on("mouseup",o);var a=n.clientX;n.targetTouches&&n.targetTouches.length>0&&(a=n.targetTouches[0].clientX,n.preventDefault());var s=ht(a);if(I)dt(s);else{var c=t.config.video.duration*s;vt(s,c),pt(s,c),H=!0}return t.events.fire(Zs.Os,s,null),!1}})),t.events.on(Zs.oc,(function(n,i){n=Os(n,0,t.config.video.duration),i||(i=n/t.config.video.duration),window.requestAnimationFrame((function(){vt(i,n),pt(i,n)}))})))}function Mt(n){if(n.element.parentElement){if(n.isFullwidth())return n.element.style.right="",n.element.style.bottom="",void(n.element.style.height="");var i=Ms(t.element),e=Ms(n.button),r=Ms(n.element.parentElement),o=Ms(n.element),u=0,a=e.right-e.width/2+o.width/2;aEf.sm?.5:.33;function l(){return e||(e=t.verifyConfig().then((function(t){return qc(t.thumb_preview.url)}))),e.then((function(n){return g.style.backgroundImage||(g.style.width="".concat(t.config.request.thumb_preview.frame_width*a,"px"),g.style.height="".concat(t.config.request.thumb_preview.frame_height*a,"px"),g.style.backgroundImage="url(".concat(t.config.request.thumb_preview.url,")"),g.style.backgroundSize="".concat(t.config.request.thumb_preview.width*a,"px ").concat(t.config.request.thumb_preview.height*a,"px")),n}))}function f(n){if(n.target===s){var i=ft(n.clientX);dt(i),t.events.fire(Zs.Os,i)}}function h(t){return m.classList.contains("hidden")||(w.classList.remove("hidden"),window.requestAnimationFrame((function(){window.requestAnimationFrame((function(){w.classList.remove("invisible")}))}))),t}function d(n){if(t.config.request.thumb_preview&&null===o&&!u){var i=Ms(c).width,e=document.querySelector(".player").clientHeight;if(!(o=e>=300&&i>=185))return void w.classList.add("hidden");l().then(h).catch((function(){}))}if(V){var f=function(t){for(var n,i=et(K);!(n=i()).done;){var e=n.value,r=Ms(e),o=r.left,u=r.right,a=r.width;if(t>=o&&t<=u)return{clientX:o+a/2,snappedTo:e}}return{clientX:t,snappedTo:null}}(n.clientX),d=f.clientX,p=f.snappedTo,y=ft(d),_=t.config.video.duration*y;K.forEach((function(t){return t.classList.toggle("active",t===p)})),t.config.request.thumb_preview&&o&&!u&&l().then((function(n){var i=Q(function(n){var i=t.config.video.duration/t.config.request.thumb_preview.frames,e=Math.min(t.config.request.thumb_preview.frames-1,Math.ceil(n/i)),r=e%t.config.request.thumb_preview.columns,o=Math.floor(e/t.config.request.thumb_preview.columns);return[-r*t.config.request.thumb_preview.frame_width*a,-o*t.config.request.thumb_preview.frame_height*a]}(_),2),e=i[0],r=i[1];return window.requestAnimationFrame((function(){g.style.backgroundPosition="".concat(e,"px ").concat(r,"px")})),n})).catch((function(){})),window.requestAnimationFrame((function(){b.innerHTML=rh(_);var t=(100*y).toFixed(3);m.style.left="".concat(t,"%"),function(t){var n=Q(function(){var t=Ms(r).left,n=Ms(s).right,i=Ms(w).width,e=t+Math.ceil(i/2),o=n-Math.ceil(i/2),u=ct(),a=lt()-u;return[(e-u)/a,(o-u)/a]}(),2),i=n[0],e=n[1],o=(100*Math.max(i,Math.min(e,t))).toFixed(3);w.style.left="".concat(o,"%")}(y),n.clientX>lt()+10&&!w.contains(document.elementFromPoint(n.clientX,n.clientY))&&v()}))}}function v(){m&&(m.classList.add("invisible"),w.classList.add("invisible")),V=!1,Rl(s).off("click",f)}n.get(nl)&&!n.get(sl)||Rl(i).on("mouseenter",".vp-progress",(function(n){V||U||(m.classList.remove("hidden"),V=!0,d(n),window.requestAnimationFrame((function(){window.requestAnimationFrame((function(){m.classList.remove("invisible")}))})),t.config.request.thumb_preview&&o&&!u&&l().then(h).catch((function(){})),Rl(s).on("click",f))})).on("mousemove",".play-bar",d).on("mouseleave",".play-bar",v).on("mouseenter",".js-chapter-marker",(function(){u=!0})).on("mouseleave",".js-chapter-marker",(function(){u=!1,o=null})),Rl(i).on("transitionend",".ghost-timecode",(function(t){"opacity"===t.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&(m.classList.add("hidden"),w.classList.add("hidden"))}),!1),t.events.on(cc.Ml,v),t.events.on(cc.Bl,(function(){e=null}))}(),function(){var n;function e(n){var i=n.clientX;n.targetTouches&&(i=n.targetTouches[0].clientX,n.preventDefault());var e=o(i);t.events.fire(Zs.Ls,e),St(e)}function r(n){U=!1,t.events.fire(cc.Pc),t.element.classList.remove("scrubbing");var o=n.type;"pointerup"===o||"MSPointerUp"===o?Rl(i).off("pointermove",".volume",e).off("pointerup",".volume",r):"touchend"===n.type?Rl(document).off("touchmove",e).off("touchend",r):Rl(document).off("mousemove",e).off("mouseup",r),y.setAttribute("tabindex",y.getAttribute("data-tabindex")),y.removeAttribute("data-tabindex")}function o(t){var n=Ms(y).left;return Os((t-n)/(Ms(y).right-n),0,1)}Rl(i).on("mousemove",".volume",(function(t){var n=t.srcElement;if(-1===_.indexOf(n)){var i=Ms(y),e=t.clientX,r=i.bottom-2;if(n=document.elementFromPoint(e,r),-1===_.indexOf(n))return}n.classList.add("hover"),window.requestAnimationFrame((function(){window.requestAnimationFrame((function(){n.classList.remove("hover"),n.classList.add("animate")}))}))})),Rl(i).on("transitionend",".volume div",(function(t){"height"===t.propertyName&&this.classList.remove("animate")})),Rl(document).on("contextmenu",".volume",(function(){this.blur()})),Rl(i).on(Yi.pointerEvents?"pointerdown":["touchstart","mousedown"],".volume",(function(u){if(1===u.which){y.setAttribute("data-tabindex",y.getAttribute("tabindex")),y.removeAttribute("tabindex"),U=!0,t.element.classList.add("scrubbing"),t.events.fire(cc.Nc);var a=u.type;if("pointerdown"===a||"MSPointerDown"===a){n=u.pointerId;try{u.target.msSetPointerCapture?u.target.msSetPointerCapture(n):u.target.setPointerCapture(n)}catch(t){}Rl(i).on("pointermove",".volume",e).on("pointerup",".volume",r)}else"touchstart"===a?Rl(document).on("touchmove",e).on("touchend",r):Rl(document).on("mousemove",e).on("mouseup",r);var s=u.clientX;u.targetTouches&&(s=u.targetTouches[0].clientX);var c=o(s);t.events.fire(Zs.Ls,c),St(c)}})),t.events.on(cc.pc,(function(n){t.backbone.muted?St(0):!U&&_&&St(n)})).on([Zs.Ws,Zs.qs],(function(){At()}))}(),Ld(i,".js-chapter-marker",(function(n){var i=parseFloat(n.target.dataset.time)+.001;t.events.fire(cc.Mc,i,"controlbar")})),t.events.on(xi.CHAPTER_CUES_UPDATED,(function(){rt.renderChapterMarkers()})),function(){function e(){var n=t.backbone.chapters,i=0;return F(n).map((function(n){var e=t.currentTime;return{index:"".concat(i+=1),label:n.text,id:n.id,active:e>=n.startTime&&e0){var r=new Vd(t,{id:"quality",title:"Quality",items:t.backbone.qualities});r.on("select",(function(n){t.events.fire(Zs.Vs,n)})),e&&r.setTitleStat(e),r.pinTitle(),i.push(r)}if(t.backbone.supportsPlaybackRate&&t.config.embed.settings.speed){var o=ut.map((function(n){return n.active=n.id===t.backbone.playbackRate,n})),u=new Vd(t,{id:"speed",title:"Speed",items:o});u.on("select",(function(n){t.events.fire(Zs.uc,n)})),u.pinTitle(),i.push(u)}var a=new Dd(t,k,i);function s(n){a.element.classList.toggle("vp-menu-center",n),t.events.fire(cc.Yc,a.isCentered(),a)}return n.watch("ui.controlbar.isPrefsMenuCentered",s),s(n.get("ui.controlbar.isPrefsMenuCentered")),Yi.touch&&a.element.classList.add("vp-menu-carousel"),a}())).show(i);J.toggle(i)}})),t.events.on(cc.mc,(function(t){J&&J.getPanel("quality")&&J.getPanel("quality").setActiveItem(t)})),t.events.on(xi.STREAM_CHANGE,(function(n){var i=n.quality||"".concat(n.height,"p");if(e=i,J&&J.getPanel("quality")){var r=t.backbone.qualities.find((function(t){return t.id===i})).label;J.getPanel("quality").setTitleStat(r)}})),t.events.on(cc._c,(function(t){J&&J.getPanel("speed")&&J.getPanel("speed").setActiveItem(t)}))}(),Ld(i,".pip",(function(){"picture-in-picture"!==t.backbone.presentationMode?t.events.fire(Zs.tc):t.events.fire(Zs.nc)})),t.events.on(eu,(function(){A&&(A.classList.remove("hidden"),A.hidden=!1,st())})).on(ru,(function(){A&&(A.classList.add("hidden"),A.hidden=!0,st())})).on(ou,(function(){nt=!0,A&&(A.classList.add("on","return"),A.classList.remove("enter"),A.setAttribute("title",A.getAttribute("data-title-return")))})).on(uu,(function(){nt=!1,A&&(A.classList.add("enter"),A.classList.remove("on","return"),A.setAttribute("title",A.getAttribute("data-title-enter")))})),Yi.airPlay&&(Ld(i,".airplay",(function(){t.events.fire(cc.Lf)})),t.events.on(cc.Mf,(function(){x&&(x.classList.remove("hidden"),x.hidden=!1,st())})).on(cc.If,(function(){x&&(x.classList.add("hidden"),x.hidden=!0,st())})).on(cc.Rf,(function(){Z=!0,x&&(x.classList.remove("off"),x.classList.add("on"),x.setAttribute("title",x.getAttribute("data-title-on"))),kt()})).on(cc.Of,(function(){Z=!1,x&&(x.classList.remove("on"),x.classList.add("off"),x.setAttribute("title",x.getAttribute("data-title-off")))}))),Ld(i,".fullscreen",(function(){t.events.fire(cc.Tc)})),t.events.on(cc.Xc,(function(){M=!1,i.classList.remove("tiny")})),t.events.on(cc.Qc,(function(t){t||(M=!0),e&&i.classList.add("tiny")})),t.events.on([cc.Il,cc.Dc,Zs.Ls],kt).on([cc.Ml,cc.Rl],_t).on(cc.$c,(function(){R=!1,_t()})).on(cc.Zc,(function(){R=!1})).on(cc.bc,(function(){B=!0,_t()})).on(Zs.Ls,(function(t,n){n||kt()})),Rl(i).on(["pointerenter","pointerleave","mouseenter","mouseleave"],[".play",".play-bar",".custom-logo",".vp-menu"],(function(t){"pointerType"in t?"mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE||(R="pointerenter"===t.type||"MSPointerEnter"===t.type):Yi.touch||(R="mouseover"===t.type)})),t.events.on(Zs._overrideControlbarBehavior,(function(n){O=n,n?t.events.on(Zs.Qs,(function(t){t?yt():gt()})):t.events.off(Zs.Qs)})),t.events.on(cc.al,(function(t){if("not-supported"!==t&&"private-unlocked"!==t&&"help"!==t)L=!0,_t();else for(var n=i.querySelectorAll("a, button, input, [tabindex]"),e=0,r=n.length;e2&&void 0!==arguments[2]?arguments[2]:1;rt(this),this.version=e,this.visible=!1;var r=this.od=document.createElement("div");r.classList.add("compass-wrapper"),r.innerHTML=Yf.render("compass",{version:e}),r.classList.add("cloaked"),t.appendChild(r),n&&r.addEventListener("click",n),this.ud=r.querySelector(".compass-slice"),this.ad=r.querySelector(".compass-line");var o=function(){i.sd=!0},u=function(t){return function(){setTimeout((function(){i.sd||(i.fade(),i.sd=!1)}),t)}};Rl(this.od).on("mousein",o).on("pointerin",o).on("mouseout",u(1e3)).on("pointerout",u(1e3)),u(2500)()}var n=t.prototype;return n.setAngle=function(t,n){var i=this;this._a&&window.cancelAnimationFrame(this._a);var e=0;1===this.version?e=-45:2===this.version&&(e=-30);var r="".concat(e+n),o=(t+85)/170;this._a=window.requestAnimationFrame((function(){i.ud.setAttribute("transform","rotate(".concat(r,", ").concat(18,", ").concat(18,")")),i.ad&&i.ad.setAttribute("d",i.ld(o,18))}))},n.ld=function(t,n){var i=2*n-Math.round(2*n*t),e=(2*n-2*Math.sqrt(2*i*n-Math.pow(i,2)))/2,r=2*n-e-5;return"M".concat(e+5,",").concat(i," L").concat(r,",").concat(i," z")},n.reveal=function(){var t=this;this.od.classList.remove("cloaked"),window.requestAnimationFrame((function(){t.od.classList.add("in")})),this.visible=!0},n.fade=function(){this.od.classList.add("fade"),this.visible=!0},n.hide=function(){var t=this;this.od.classList.remove("in"),this.od.classList.remove("fade"),this.od.classList.add("leaving"),Rl(this.od).on("transitionend",(function n(){"opacity"===event.propertyName&&(t.od.classList.remove("leaving"),t.od.classList.add("cloaked"),t.visible=!1),Rl(t.od).off("transitionend",n)}))},n.updatePosition=function(t){if(t){var n=Ms(t);if(n.height<265)return this.od.classList.remove("align-bottom"),void this.od.classList.add("hidden");if(n.height<336)return this.od.classList.remove("hidden"),void this.od.classList.add("align-bottom");this.od.classList.remove("hidden"),this.od.classList.remove("align-bottom")}},n.getWrapper=function(){return this.od},t}();function rv(t,n,i){var e=null,r=Yi.touch?4500:2e3,o=!0,u=!0,a=!1,s=null,c=null,l=[],f=!1,h=null,d=null,v=!0,p=!1,m=!1,b=!1,w=!1,g=!1,y=i.querySelector(".vp-target"),_=i.querySelector(".vp-sidedock"),k=i.querySelector(".vp-controls"),E=i.querySelector(".vp-title"),T=i.querySelector(".vp-video"),S=F(i.querySelectorAll(".vp-nudge")),A=!!Yi.touch&&S.some((function(t){return!t.classList.contains("invisible")})),x=t.config.embed.autoplay&&t.config.request.flags.autohide_controls,C=Yi.touch?300:0,M=null,I=md(t.config,"webvr").group||!1;function R(){clearTimeout(e),e=null}function O(){g&&(clearTimeout(e),e=setTimeout(D,r))}function L(){nd.element&&nd.element.classList.contains("js-player-fullscreen")&&(a||(i.classList.add("player-cursor-hide"),u=!0,a=!0))}function D(n){(p||v)&&(b||(R(),document.activeElement&&document.body.classList.contains("showfocus")&&(_.contains(document.activeElement)||k.contains(document.activeElement))||(t.events.fire(n?cc.Ml:cc.Rl),u=!0,Yi.spatialPlayback&&t.config.video.spatial||(y.classList.add("hidden"),y.setAttribute("hidden","")),o=!0,L())))}function j(){O(),A||w||p&&v||(t.events.fire(cc.Il),y.classList.remove("hidden"),y.removeAttribute("hidden"))}function N(){p||v?i.removeAttribute("tabindex"):p||v||m||i.setAttribute("tabindex","0")}function P(){t.events.on([Ti.TIME_UPDATE,Ti.SEEKED],(function n(i){i.currentTime>=1.75&&null===e&&(t.events.fire(cc.bc),t.events.off([Ti.TIME_UPDATE,Ti.SEEKED],n))}))}function U(){T.classList.remove("threesixty-video"),t.element.classList.remove("grabbable"),t.element.classList.remove("grabbing"),s&&s.hide()}function V(){l.forEach((function(t){return clearTimeout(t)})),l=[]}function B(t){t&&(t.classList.remove("cloaked"),window.requestAnimationFrame((function(){t.classList.add("in")})))}function H(t){t&&(t.classList.add("leaving"),window.requestAnimationFrame((function(){Rl(t).on("transitionend",(function n(i){"opacity"===i.propertyName&&(t.classList.remove("in"),t.classList.remove("leaving"),t.classList.add("cloaked"),Rl(t).off("transitionend",n))}))})))}function q(t){Ms(_).width>60?t.classList.add("vp-alert-bumpdown"):t.classList.remove("vp-alert-bumpdown")}return function(){var n=!0;function e(){j()}function c(e){var s;if(r=2e3,u)u=!1;else if(a&&(i.classList.remove("player-cursor-hide"),a=!1),0!==e.screenX&&e.screenX!==screen.width-1&&0!==e.screenY&&e.screenY!==screen.height-1){if(n=!0,Yi.spatialPlayback&&(null==(s=t.config.video)?void 0:s.spatial)){var c=Ms(t.element),l=e.clientX-c.left,h=e.clientY-c.top,d=h>t.element.clientHeight-55,v=l>t.element.clientWidth-45&&h<180;if(f||!d&&!v)return}o&&j(),O()}else R(),L(),n&&(D(!0),n=!1)}function l(){D(!0)}function h(t){var n=k.contains(t.target)||_.contains(t.target),i=s&&s.getWrapper().contains(t.target);p&&v||i?n||!p&&!v||D(!0):(clearTimeout(M),M=setTimeout(j,C))}Yi.pointerEvents?Rl(i).on("pointerenter",(function(t){if("mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE)return r=2e3,e();r=4500,h(t)})).on("pointermove",(function(t){if("mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE)return c(t)})).on("pointerleave",(function(t){if("mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE)return l()})):Rl(i).on("touchmove",(function(){r=4500,O()})).on("touchend",h).on("mouseenter",e).on("mousemove",c).on("mouseleave",l)}(),t.events.on(Ti.PLAY,(function(t){x||0===t||j()})).on(cc.ir,j).on([xi.BUFFER_ENDED,Ti.SEEKED,cc.jc,cc.pc,cc.zc],O).on(Xo,(function(){g=!0})),t.events.on(cc.Vc,(function(t){t&&O()})),t.events.on(cc.al,N).on(cc.Uc,(function(t){v=t,N()})).on(cc.Fc,(function(t){p=t,N()})),t.events.on(cc.Xl,(function(){b=!0,j()})).on(cc.Zl,(function(){b=!1})),function(){var e=!1,r=!1,o=0;t.events.on(cc.Vc,(function(t){r=t})),Rl(i).on(Yi.pointerEvents?"pointerup":"click",(function(i){if(!r&&2!==i.button&&i.target.classList&&function(t){return(t.classList.contains("vp-title")||t.classList.contains("vp-target")||E.contains(t.parentNode)&&"HEADER"===t.parentNode.tagName||T.contains(t))&&!_.contains(t)}(i.target)){var e=("pointerup"===i.type||"MSPointerUp"===i.type)&&"mouse"!==i.pointerType&&i.pointerType!==i.MSPOINTER_TYPE_MOUSE,u=g&&Yi.spatialPlayback&&t.config.video.spatial&&c;if(Yi.touch||e){var a=-1!==t.backbone.supportedPresentationModes.indexOf("inline")&&!Yi.mobileAndroid;if(!u){if(g&&a)return;return void t.events.fire(cc.Ac)}}1==++o&&setTimeout((function(){if(u){var e=d&&d.x===i.clientX&&d.y===i.clientY;return 1===o&&e&&!Yi.mobileAndroid&&t.events.fire(t.backbone.paused?cc.Ac:cc.Sc),1!==o&&t.backbone.getEffectByName("ThreeSixtyEffect").snapToCenter(),void(o=0)}if(1===o){if(n.get(nl)&&!n.get(al))return;t.events.fire(t.backbone.paused?cc.Ac:cc.Sc)}else t.events.fire(cc.Tc);o=0}),200)}})),Rl(i).on("mousedown",".vp-video-wrapper",(function(t){var n;if(!e)return y.classList.remove("hidden"),y.removeAttribute("hidden"),2!==t.button&&document.createEvent&&((n=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,0,null),y.dispatchEvent(n)),!1})).on("contextmenu",".vp-video",(function(t){return y.classList.remove("hidden"),y.removeAttribute("hidden"),!1})),t.events.on(Zs.Xs,(function(t){if(t)return e=!0,void y.classList.add("hidden");e=!1,y.classList.remove("hidden")}))}(),function(){var n,e;Yi.touch||(Rl(i).on("focus","a, button, input, [tabindex]",(function(){e=this,clearTimeout(n),n=null,document.activeElement===this&&j()})),Rl(i).on("blur","a, button, input, [tabindex]",(function(){document.activeElement===this&&(n=setTimeout(D,50))})),i.addEventListener("focus",(function(t){j(),e&&e.focus()}),!1),t.events.on(cc.al,(function(){m=!0,i.removeAttribute("tabindex")})),t.events.on(cc.sl,(function(){m=!1,N()})))}(),t.events.on(cc.Xc,(function(t){L(),c&&c.adjustRenderSize(),b&&j()})).on(cc.Qc,(function(t){o=!0,c&&c.adjustRenderSize(),t?D():(j(),R())})),P(),t.events.on(Zs.Us,(function(){o=!0,u=!0,v=!0,p=!1,w=!1,g=!1,P(),R()})),t.events.on(Zs.ic,(function(){var n=function(t){return function(){c&&t.apply(void 0,arguments)}},e=n((function(n){var i=t.element.classList.contains("webvr");c&&i&&c.toggleVR()})),r=n((function(n){c.isVRPresenting?setTimeout((function(){t.events.fire(Mi.WEBVR_ENTER)}),100):setTimeout((function(){t.events.fire(Mi.WEBVR_EXIT)}),100)}));t.events.on(Zs.rc,n((function(){var n=t.element.classList.contains("webvr");n||t.element.classList.add("grabbable"),s&&s.updatePosition(t.element),!s||s.visible||n||s.reveal()}))),t.events.on(cc.vc,n((function(){U(),Yi.webvr&&c.isVRPresenting&&I&&c.toggleVR()}))),t.events.on(Mi.CAMERA_UPDATE,n((function(t){s&&s.setAngle(t.pitch,t.yaw)}))),t.events.on(Xo,n((function(){t.config.video.spatial?function(){function n(t){h&&(h.innerHTML=Yf.render("threesixty_reminder",t))}var e=t.backbone.getEffectByName("ThreeSixtyEffect");t.config.embed.settings.spatial_compass?(s||(s=new ev(t.element.querySelector(".vp-controls-wrapper"),(function(){e.snapToCenter()}))),s.updatePosition(t.element),s.reveal()):s&&s.hide(),t.events.once(cc.yc,(function(){var i=t.config.embed.cards;(null==i?void 0:i.length)&&i[0].timecode<15||(l.push(setTimeout((function(){n({showArrows:!1,text:Yi.android?"Look around":"Click and drag to look around"}),q(h),B(h),setTimeout((function(){return H(h)}),3e3)}),7e3)),Yi.android||l.push(setTimeout((function(){n({showArrows:!1,text:Yi.android?"Look around":"Use arrow keys to see more"}),q(h),B(h),setTimeout((function(){return H(h)}),3e3)}),14e3)))})),function(){var t=i;if(!h){var n=h=document.createElement("div");n.classList.add("cloaked"),n.classList.add("vp-alert-round"),n.classList.add("vp-alert-round--top"),n.classList.add("vp-alert-round--threesixty"),t.appendChild(n)}}()}():!t.config.video.spatial&&s&&(U(),V())}))),(Yi.webvr||Yi.stereoscopic||Yi.webxr)&&(Yi.webvr&&window.addEventListener("vrdisplaypresentchange",r,!1),t.events.on(cc.Wc,n((function(){V(),Yi.webvr&&c.hasVRHeadset&&I?c.toggleVR():t.events.fire(cc.Tl)}))),t.events.on(Mi.WEBVR_HARDWARE_AVAILABLE,n((function(t){var n=i.querySelector(".stereoscopic");n&&n.classList.contains("off")&&I&&n.classList.remove("off")}))),t.events.on(Mi.WEBVR_ENTER,n((function(n){window.addEventListener("vrdisplaydisconnect",e,!1),window.addEventListener("vrdisplaydeactivate",e,!1);var r=i.querySelector(".stereoscopic");r&&r.classList.add("on"),s&&s.hide(),t.element.classList.remove("grabbable"),t.element.classList.add("webvr"),c.isUserInteracting=!1}))),t.events.on(Mi.WEBVR_EXIT,n((function(n){window.removeEventListener("vrdisplaydisconnect",e),window.removeEventListener("vrdisplaydeactivate",e);var r=i.querySelector(".stereoscopic");r&&r.classList.remove("on"),s&&s.reveal(),t.element.classList.add("grabbable"),t.element.classList.remove("webvr"),c.isUserInteracting=!0}))));var o=null,u=n((function(n){var i=t.element.classList.contains("webvr");f||i||(f=!0,n.preventDefault(),t.element.classList.add("grabbing"),d={x:n.clientX,y:n.clientY},c.makeContact(d))})),a=n((function(n){var i=t.element.classList.contains("webvr");f&&!i&&(V(),c.move({x:n.clientX,y:n.clientY}))})),v=n((function(n){var i=t.element.classList.contains("webvr");f&&!i&&(t.element.classList.remove("grabbing"),c.releaseContact(!1),f=!1)})),p=n((function(n){n.preventDefault(),t.element.classList.contains("webvr")||(c.isUserInteracting||(c.isUserInteracting=!0),null!==o&&clearTimeout(o),V(),o=setTimeout((function(){t.element.classList.remove("player-cursor-hide"),t.element.classList.add("grabbable"),c.isUserInteracting=!1}),500),t.element.classList.add("player-cursor-hide"),t.element.classList.remove("grabbable"),c.moveWheel({x:n.deltaX,y:n.deltaY}))})),m=n((function(t){f||(f=!0,c.makeContact({x:t.touches[0].clientX,y:t.touches[0].clientY}))})),b=n((function(t){f&&(t.preventDefault(),V(),c.move({x:t.touches[0].clientX,y:t.touches[0].clientY}))})),w=n((function(t){c.releaseContact(!0),f=!1})),g=n((function(t){f||V(),c.moveDevice(t.alpha,t.beta,t.gamma,t.orientation)})),_=n((function(n){f=!1,t.element.classList.remove("grabbing"),c.abandonMotion()}));t.events.on(Xo,(function(){Yi.android&&c&&window.addEventListener("deviceorientation",g,!1)})),t.events.once(Xo,(function(){t.store.watch("ui.player.boundingRect",(function(){s&&s.updatePosition(t.element),c&&c.adjustRenderSize(),f=!1})),Yi.pointerEvents?(Rl(y).on("pointerdown",u),window.addEventListener("pointermove",a),window.addEventListener("pointerup",v),window.addEventListener("pointerleave",_)):(Rl(y).on("mousedown",u).on("wheel",p),window.addEventListener("touchstart",m,!!Yi.passiveEvents&&{passive:!1}),window.addEventListener("touchmove",b,!!Yi.passiveEvents&&{passive:!1}),window.addEventListener("touchend",w,!!Yi.passiveEvents&&{passive:!1}),window.addEventListener("mousemove",a),window.addEventListener("mouseup",v),window.addEventListener("mouseleave",_))}))})),t.events.on(iu,(function(t){U(),c=t,V()})),t.events.on(cc.kc,(function(){w=!0,clearTimeout(M),M=null})),t.events.on(cc.Ec,(function(){w=!1})),{}}var ov=function(){function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.$f=t,this.fd=this.$f.debugCollector,this.dd=n}var n=t.prototype;return n.getCurrent=function(t){return this.$f.debugCollector.getCurrent(t)},n.getSeries=function(t){return this.$f.debugCollector.getSeries(t)},n.getTemplateData=function(){var t,n,i,e=this.fd.getCurrent("scanner"),r="MediaSourceScanner"===e,o="HLSLiveScanner"===e,u=this.fd.getCurrent("video_dims"),a=!(!this.$f.config.request.files||!this.$f.config.request.files.dash)&&this.$f.config.request.files.dash.separate_av,s=this.fd.getCurrent("vr_headset")||null,c=this.$f.currentTime,l=pt(c,this.$f.backbone.buffered),f=c+l,h=this.vd(this.$f.backbone.buffered),d=this.$f.backbone.brainDebug,v={playerVersion:Ic(this.$f.config),sessionId:this.$f.config.request.session,clientIp:null==(t=this.$f.config.request)||null==(n=t.client)?void 0:n.ip,clipId:this.$f.config.video.id,isDash:r,isLive:o,embedSize:u,separateAudioVideo:a,isCopyDisabled:!!this.$f.doNotTrackEnabled||this.$f.config.embed.settings.background,isDNTEnabled:this.$f.doNotTrackEnabled,hideCloseButton:!!this.$f.config.embed.settings.background,vrHeadsetName:s,currentTime:Ps(c,3),bufferAhead:Ps(l,3),bufferEnd:Ps(f,3),readyState:this.$f.backbone.readyState,support:JSON.stringify(Yi),ua:null==(i=navigator)?void 0:i.userAgent,bufferedRanges:JSON.stringify(h),brainDebug:JSON.stringify(d)};return Object.assign(v,this.pd(),this.bd(),this.wd(),this.gd(),this.yd(),this._d(o),this.kd(),this.Ed())},n.pd=function(){var t=this.fd.getCurrent("bandwidth");return{bandwidthKbps:t?"".concat(Math.floor(t.value/1e3).toLocaleString()," Kbps"):0,bandwidthMinKbps:"".concat(Math.floor(this.fd.getCurrent("min_bandwidth")/1e3).toLocaleString()," Kbps"),bandwidthMaxKbps:"".concat(Math.floor(this.fd.getCurrent("max_badwidth")/1e3).toLocaleString()," Kbps")}},n.bd=function(){var t=this.fd.getCurrent("streams");return{codec:t?t.codec:null,resolution:t?"".concat(t.width,"×").concat(t.height,"@").concat(Math.round(t.framerate)," ").concat(Math.round(t.bitrate/1e3).toLocaleString()," Kbps ").concat(t.audioBitrate?" / ".concat(Math.round(t.audioBitrate/1e3).toLocaleString()," Kbps"):""):null}},n.wd=function(){var t=this;return{testGroup:Object.keys(this.$f.config.request.ab_tests).map((function(n){return"".concat(n,": ").concat(t.$f.config.request.ab_tests[n].group)})).join(", ")}},n.gd=function(){var t=this.fd.getCurrent("total_frames")||0,n=this.fd.getCurrent("dropped_frames")||0;return{totalFrames:t,droppedFrames:n,droppedFramesPercent:0!==t?"".concat((n/t*100).toFixed(2),"%"):0}},n.yd=function(){var t=this.fd.getCurrent("files");return t?{delivery:t.mime}:null},n._d=function(t){return t?{liveLatency:"".concat(this.fd.getCurrent("live_latency").toFixed(2)," seconds"),liveSessionID:this.$f.config.video.live_event.id}:null},n.kd=function(){if(!this.$f.config.video.p2p)return null;var t=ha(window,"Streamroot.instances[0].stats"),n=ha(t,"realtime.dnaSources");if(void 0===n)return null;var i=ha(t,"currentContent.cdnDownload"),e=ha(t,"currentContent.dnaDownload");return{p2pSources:n,p2pOffload:"".concat(Ps(e/(i+e)*100,1),"%")}},n.Ed=function(){var t=this.$f.config.request.drm;return t?{drmEnabled:!!t,drmFastly:t.fastly}:null},n.vd=function(t){if(!t)return null;for(var n=t.length,i=0,e=[];in)return"";var o=(r-t)/(n-t)*250;return isNaN(o)&&(o=0),"\n ".concat(e.title,' \n \n ')})).join("")},t}(),sv=function(){function t(t){this.alertTextElement=t.querySelector(".vp-text-alert-wrapper"),this.alertContentTitle=this.alertTextElement.querySelector(".vp-live-start-time-title"),this.alertContentTime=this.alertTextElement.querySelector(".vp-live-start-time-body"),this.alertContentFooter=this.alertTextElement.querySelector(".vp-live-start-time-footer")}var n=t.prototype;return n.show=function(t,n,i){this.alertContentTitle.innerHTML=t,this.alertContentTime.innerHTML=n,this.alertContentFooter.innerHTML=i,this.alertContentTitle.classList.remove("hidden"),this.alertContentTime.classList.remove("hidden"),this.alertContentFooter.classList.remove("hidden"),this.alertTextElement.classList.remove("hidden")},n.hide=function(){this.alertContentTitle.classList.add("hidden"),this.alertContentTime.classList.add("hidden"),this.alertContentFooter.classList.add("hidden"),this.alertTextElement.classList.add("hidden")},t}(),cv=function(){function t(t,n,i){this.textAlert=new cd(t),this.timeAlert=new sv(t),this.player=n,this.store=i,this.startTime=new Date(this.store.get(el,null)),this.ys=!1,this.Nd(),this.Pd()}var n=t.prototype;return n.disable=function(){this.hide(),this.ys=!0},n.hide=function(){this.textAlert.hide(),this.timeAlert.hide()},n.Pd=function(){(this.store.get(ol)||this.store.get(ul))&&this.Ud(),this.store.get(sl)&&this.Fd()},n.Nd=function(){this.player.events.on(fu.EVENT_ACTIVE,this.Ud.bind(this)),this.player.events.on(fu.STREAM_ONLINE,this.Vd.bind(this)),this.player.events.on(fu.STREAM_OFFLINE,this.Bd.bind(this)),this.player.events.on(fu.SETTINGS_UPDATED,this.Hd.bind(this)),this.player.events.once(fu.EVENT_ENDED,this.Fd.bind(this)),this.player.events.on(cc.Wf,this.Fd.bind(this)),this.player.events.on(cc.zf,this.Vd.bind(this))},n.Hd=function(t,n){"event_schedule"===t&&this.store.dispatch(function(t){return{type:"LIVE_SETTINGS_UPDATE",payload:t}}({eventSchedule:n}))},n.Ud=function(){this.qd(this.store.get(fl))},n.Wd=function(){var t=this.zd();this.timeAlert.show(t[0],t[1],t[2]),!this.store.get(ol)&&!this.store.get(ul)||this.ys||setTimeout(this.Pd.bind(this),3e4)},n.Gd=function(){return this.startTime-new Date},n.zd=function(){var t=this.Gd(),n=(t/6e4).toFixed(0),i=(t/36e5).toFixed(0),e=(t/864e5).toFixed(0),r=(new Date).toDateString()===this.startTime.toDateString();if(e>1||!r)return["This event is scheduled for","".concat($f[this.startTime.getMonth()]," ").concat(this.startTime.getDate()),"".concat("at"," ").concat(eh(this.startTime))];if(i>1&&r)return["This event is scheduled for","Today","".concat("at"," ").concat(eh(this.startTime))];var o=n>1?"minutes":"minute";return["This event will start in","".concat(n," ").concat(o),""]},n.Vd=function(){this.hide()},n.Bd=function(){this.textAlert.show("Live stream offline"),Yi.iOS&&nd.element&&(this.player.events.fire(cc.Zc),nd.exit())},n.Fd=function(){this.textAlert.show("Live event ended")},n.qd=function(t){t?this.Gd()>6e4?(this.textAlert.hide(),this.Wd()):(this.timeAlert.hide(),this.textAlert.show("This event hasn't started yet")):(this.timeAlert.hide(),this.textAlert.show(""))},t}();function lv(t,n){var i,e=n.querySelector(".vp-notification");function r(t,r){if(null!==n.parentElement.offsetParent){n.classList.remove("hidden"),n.removeAttribute("hidden"),n.setAttribute("data-name",t);var u=function(t){var i="watchlater"===t||"unwatchlater"===t?.5:.4,e=n.clientHeight;return n.clientHeight>n.clientWidth&&(e=n.clientWidth),{height:Math.round(e*i),width:Math.round(e*i*1.6)}}(t),a="width:"+u.width+"px;height:"+u.height+"px";e.style.cssText=a,e.innerHTML=r,"watchlater"!==t&&"unwatchlater"!==t||function(t,n){var i=t.querySelector(".hour-hand"),e=t.querySelector(".minute-hand");if(i&&e){var r=n?1:-1,o=new Date,u=Math.abs(o.getHours()-12),a=o.getMinutes(),s=a/60*360-135,c=u/12*360+a/60*5,l=c+45*r,f=s+540*r;i.style[Yi.transformProperty]="rotate("+c+"deg)",e.style[Yi.transformProperty]="rotate("+s+"deg)",window.requestAnimationFrame((function(){t.classList.add("animate"),Yi.browser.firefox||Yi.browser.opera||window.requestAnimationFrame((function(){i.style[Yi.transformProperty]="rotate("+l+"deg)",e.style[Yi.transformProperty]="rotate("+f+"deg)"}))}))}}(e,"watchlater"===t),clearTimeout(i),n.classList.remove("animate"),window.requestAnimationFrame((function(){n.classList.remove("invisible"),i=setTimeout(o,750)}))}}function o(){n.classList.add("animate"),n.classList.add("invisible")}function u(){n.classList.remove("animate"),n.classList.remove("invisible"),n.classList.add("hidden"),n.setAttribute("hidden",""),n.removeAttribute("data-name"),e.innerHTML="",e.classList.remove("filled"),e.classList.remove("animate"),t.events.fire(cc.xf)}return Rl(n).on("transitionend",(function(t){e.contains(t.target)&&"height"===t.propertyName?setTimeout(o,100):t.target===n&&"opacity"===t.propertyName&&window.requestAnimationFrame(u)})),t.events.on(cc.Ol,(function(t){t||r("like",Yf.render("icon_heart"))})),t.events.on(cc.Ll,(function(t){t||r("unlike",Yf.render("icon_broken_heart"))})),t.events.on(cc.Dl,(function(t){t||r("watchlater",Yf.render("icon_clock"))})),t.events.on(cc.jl,(function(t){t||r("unwatchlater",Yf.render("icon_clock"))})),t.events.fire(cc.Tf),{}}function fv(t,n){var i=rt(),e=!1;function r(t){Ls(t,"facebook",{width:580,height:400})}function o(t){Ls(t,"twitter",{width:550,height:420})}function u(t){Ls(t,"tumblr",{width:540,height:600})}var a={get events(){return i},setup:function(){var i;n.classList.remove("vp-share-embed-active","vp-share-embed-only"),(null==(i=t.config.embed.settings.share)?void 0:i.embed_only)&&n.classList.add("vp-share-embed-only");var e=n.querySelector(".js-embedCopy");e&&(e.style.width=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;n=Object.keys(n).map((function(t){return n[t]}));var e=t.cloneNode();e.style.visibility="hidden",e.style.padding=0,t.parentElement.appendChild(e);var r=n.map((function(t){return e.innerText=t,e.clientWidth})),o=Math.max.apply(Math,tt(r)),u=window.getComputedStyle(t),a=parseFloat(u.fontSize);return t.parentElement.removeChild(e),"".concat((o+i)/a,"em")}(e,["Copy","Copied!"])),t.events.on(cc.fl,r).on(cc.hl,o).on(cc.dl,u)},destroy:function(){t.events.off(cc.fl,r).off(cc.hl,o).off(cc.dl,u)},getShareData:function(){var n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.config.video.title,u=t.config.video.owner.name,a=t.config.video.share_url;e=document.queryCommandSupported&&document.queryCommandSupported("copy");var s=t.config.video.unlisted_hash?"h=".concat(t.config.video.unlisted_hash,"&"):"";return r.template=Yf.render("share",{url:t.config.video.url,shareUrl:a,playerShareUrl:"https://".concat(t.config.player_url,"/video/").concat(t.config.video.id,"/share").concat(s),title:o,owner:u,embed:"public"===t.config.video.embed_permission&&t.config.embed.settings.embed,embedOnly:null==(n=t.config.embed.settings.share)?void 0:n.embed_only,embedCode:Ud(t.config.video.embed_code),copyButton:e,customizeEmbed:!!t.config.video.url,readOnly:!Yi.touch,facebookIcon:Yf.render("icon_facebook",{title:"Share on Facebook"}),twitterIcon:Yf.render("icon_twitter",{title:"Share on Twitter"}),tumblrIcon:Yf.render("icon_tumblr",{title:"Share on Tumblr"}),emailIcon:Yf.render("icon_mail",{title:"Share via Email"}),embedIcon:Yf.render("icon_embed",{title:"Get embed code"}),strings:{share:"Share",emailSubject:"Check out “"+o+"” from "+u+" on Vimeo",emailBody:"Check out “"+o+"” from "+u+" on Vimeo.\n\nThe video is available for your viewing pleasure at "+a+"\n\nIf you like this video, make sure you share it, too!\n\nVimeo is filled with lots of amazing videos. See more at https://vimeo.com.",embedTitle:"Embed",embedSubtitle:"Add this video to your site with the embed code below.",copy:"Copy",copySuccess:"Copied!",customize:'')+"Customize this embed on Vimeo"}}),r.Yd=".js-facebook",(null==(i=t.config.embed.settings.share)?void 0:i.embed_only)&&(r.wrapperClass="embed-only",r.Yd=".js-embed-input"),r},showShareView:function(){n.querySelector(".js-share-screen").classList.remove("cloaked"),n.classList.remove("vp-share-embed-active"),i.fire(cc.yl)},showEmbedView:function(){t.config.embed.settings.share.embed_only||(n.querySelector(".js-embed-screen").classList.remove("cloaked"),n.classList.add("vp-share-embed-active")),i.fire(cc._l)}};return function(){var r;Rl(n).on("transitionend",".js-share-screen",(function(t){"opacity"===t.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&(i.fire(cc.El),this.classList.add("cloaked"))})).on("transitionend",".js-embed-screen",(function(t){"opacity"===t.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&(i.fire(cc.kl),this.classList.add("cloaked"),Ns(n))})).on("copy","input[name=embed_code]",(function(){t.events.fire(cc.pl)})),Ld(n,".js-facebook",(function(){return t.events.fire(cc.fl,this.href),Cs(),!1})),Ld(n,".js-twitter",(function(){return t.events.fire(cc.hl,this.href),Cs(),!1})),Ld(n,".js-tumblr",(function(){return t.events.fire(cc.dl,this.href),Cs(),!1})),Ld(n,".js-email",(function(){return t.events.fire(cc.vl),window.top.location=this.href,Cs(),!1})),Ld(n,".js-embed",(function(){return t.events.fire(cc.el),a.showEmbedView(),Cs(),!1})),Ld(n,".js-embedCopy",(function(){if(e){n.querySelector("input[name=embed_code]").select();try{document.execCommand("copy")&&function(){t.events.fire(cc.pl);var i=n.querySelector(".js-embedCopy");i.innerHTML=i.getAttribute("data-success-label"),clearTimeout(r),r=setTimeout((function(){i.innerHTML=i.getAttribute("data-label")}),2e3)}()}catch(t){}return document.activeElement.blur(),!1}})),Yi.touch?Rl(n).on("focus","input[name=embed_code]",(function(){var t=this;setTimeout((function(){t.setSelectionRange(0,9999),t.setAttribute("readonly","readonly")}),0)})).on("blur","input",(function(){this.removeAttribute("readonly")})):Rl(n).on("click","input[name=embed_code]",(function(){this.setSelectionRange(0,9999)}))}(),a}function hv(t,n,i){var e,o,u,a=i.querySelector(".vp-outro"),s=null,c=!1,l=!1,f=!1,h=!1,d=!1,v=ah(S,250),p=null,m=t.config.request.ads instanceof Object,b=!1;function w(){return!d&&null===s&&!t.config.embed.loop}function g(){if(t.config.embed.outro===mc.VOD)return o=mc.VOD,s=y(o),!0===h&&E(),r.resolve(s);d=!0;var n=t.config.embed.email_capture_form||t.config.embed.email||{},i=t.config.video.unlisted_hash?"h=".concat(t.config.video.unlisted_hash,"&"):"";return tr("https://".concat(t.config.player_url,"/video/").concat(t.config.video.id,"/outro?").concat(i,"on_site=").concat(t.config.embed.on_site,"&type=").concat(t.config.embed.outro,"&email=").concat(n?1:0),{withCredentials:!0}).json().then((function(n){return o=n.type,(s=y(o,n.data))&&(s.bgimage&&qc(s.bgimage),s.contexts&&s.contexts.forEach((function(t){t.videos.forEach((function(t){qc(t.thumbnail)}))}))),Fh(t.config.video.owner)&&function(n,i){[mc.VIDEOS,mc.THREEVIDEOS,mc.PROMOTED].includes(n)&&i.contexts&&i.contexts.forEach((function(n){n.videos.reduce((function(n,i){return n.then(function(n){return function(){return t.preloadVideo("auto",n.id,{autoplay:!0}).catch((function(t){}))}}(i))}),r.resolve())}))}(o,s),s}))}function y(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=Vc(t.element.clientWidth*Yi.devicePixelRatio,t.element.clientHeight*Yi.devicePixelRatio),r=e.width,o=e.height;if(i.img_base&&(i.bgimage=Bc({width:r,height:o,baseUrl:i.img_base})),n===mc.VOD){var u=void 0!==t.config.video.vod.is_preorder?t.config.video.vod.is_preorder:!!t.config.video.vod.date_available,a=t.config.video.vod.is_coming_soon,s=t.config.video.vod.date_available_formatted_datetime||t.config.video.vod.date_available,c="Coming soon to Vimeo On Demand.";a&&s&&(c="Coming soon to Vimeo On Demand on "+s+"."),u&&(c="Pre-order now. Watch on "+s+"."),i={purchased:t.config.user.purchased,title:t.config.video.vod.feature_title,url:t.config.video.vod.url,currency:t.config.request.currency,countries:t.config.video.vod.countries,country:t.config.request.country,buttons:t.config.video.vod.purchase_options,translationMap:t.config.request.dynamic_translation_map,isPreorder:u,isComingSoon:a,releaseDate:s,strings:{watch:u?"Watch on "+s:"Watch Now",preRelease:c}}}return[mc.VIDEOS,mc.THREEVIDEOS,mc.PROMOTED].includes(n)&&(t.config.user.following=i.following,(i={contexts:Array.isArray(i)?i:[i],owner:t.config.video.owner.id,bgimage:i.bgimage,following:i.following}).contexts&&i.contexts.forEach((function(t){t.videos.forEach((function(n){if(n.fullTitle=n.title,n.byline="",n.owner.id!==i.owner&&(n.fullTitle=n.title+" from "+n.owner.name,n.byline="from "+n.owner.name),n.thumbnail_base){var e=Math.round(r/t.videos.length);n.thumbnail=Bc({width:e,height:Math.round(e/1.778),baseUrl:n.thumbnail_base})}}))}))),n===mc.LINK&&(i.url=Yd(i.url),i.url2=Yd(i.url2)),n===mc.SHARE&&(i.strings={back:"Back"}),i}function _(t){a.classList.toggle("vp-outro--link-medium",t)}function k(t){a.classList.toggle("vp-outro--link-large",t)}function E(){if(c=!0,o===mc.BEGINNING)return a.innerHTML="",void t.events.fire(Zs.Us);if(w())g().then((function(){return E()})).catch((function(){}));else{var r=function(){if([mc.VIDEOS,mc.THREEVIDEOS,mc.PROMOTED].includes(o)){var n;if(0===((null==(n=s)?void 0:n.contexts)||[]).reduce((function(t,n){return t+n.videos.length}),0))return null;s.showFollowButton=!t.config.user.owner&&t.config.user.logged_in,s.strings={follow:"Follow",following:"Following",unfollow:"Unfollow"}}return s&&(s.target=!t.config.embed.on_site),p=o,[mc.THREEVIDEOS,mc.PROMOTED].includes(o)&&(p=mc.VIDEOS),Yf.render("outro_"+p,s)}();r&&(a.innerHTML=r,a.setAttribute("data-type",p),i.classList.remove("hidden"),i.removeAttribute("hidden"),l=!0,[mc.VIDEOS,mc.THREEVIDEOS].includes(o)?function(){var t=document.querySelector(".js-outro-followWrap");if(t){var n=window.getComputedStyle(t),i=parseFloat(n.fontSize);t.style.width="".concat(t.clientWidth/i,"em")}}():o===mc.LINK?(n.watch("ui.outro.isLinkTitleVisible",_),n.watch("ui.outro.isLinkDescriptionVisible",k),_(n.get("ui.outro.isLinkTitleVisible")),k(n.get("ui.outro.isLinkDescriptionVisible"))):o===mc.SHARE&&function(){var t=i.querySelector(".js-outro-content"),n=e.getShareData();t.innerHTML=n.template,e.setup()}(),window.requestAnimationFrame((function(){window.requestAnimationFrame((function(){i.classList.add("in"),S()}))})))}}function T(){if(l)return e.destroy(),c=!1,f=!1,l=!1,void window.requestAnimationFrame((function(){i.classList.remove("in"),t.events.fire(cc.Zl),x()}));c&&(c=!1,t.events.fire(cc.Zl))}function S(){var n;if(!f&&i.clientWidth){Rl(window).off("resize",v),f=!0;var e=[];(null==(n=s)?void 0:n.contexts)&&s.contexts.forEach((function(t){t.videos&&t.videos.forEach((function(t){var n=t.id,i=a.querySelector('[data-video-id="'+n+'"]');i&&i.clientWidth>0&&e.push(n)}))})),t.events.fire(cc.Xl,e)}}function A(){u=setTimeout((function(){var n=t.config.embed.email_capture_form||t.config.embed.email||{};"after-video"===n.position||"after"===n.position?(t.events.fire(cc.Sl),t.events.on(cc.bf,(function(){t.events.fire(Zs.Zs)}))):t.events.fire(Zs.Zs)}),250)}function x(){Rl(window).off("resize",v),Rl(window).on("resize",v)}return t.events.on(Ti.TIME_UPDATE,(function(t){var n=t.currentTime,i=t.duration;t.timeProgress,h=!1,w()&&n>=i-10&&g().catch((function(){}))})),t.events.on(Xo,(function(){[mc.NOTHING,mc.BEGINNING,mc.EMAIL].includes(t.config.embed.outro)&&(o=t.config.embed.outro,s=!1)})),t.events.on(cc.Hf,(function(){b=!0})),t.events.on(cc.vc,(function(){if(m&&!b)return t.events.on(cc.Hf,A),void(m=!1);A()})),t.events.on(cc._loadVideo,(function(){clearTimeout(u)})),t.events.on(cc.Wf,(function(){t.config.video.webinar&&clearTimeout(u)})),t.events.on(Zs.Zs,(function(n,i){t.performDelegateAction(ac,(function(){n&&(o=n,s=null,d=!1),i&&i.data&&(s=y(n,i.data)),h=!0,E()}))})),Rl(i).on("click",".js-videoLink",(function(n){var i=parseInt(this.getAttribute("data-video-id"),10);t.events.fire(cc.Ql,i),Fh(t.config.video.owner)&&(n.preventDefault(),t.loadVideo(i,{autoplay:!0}))})),Rl(i).on("click",".js-cta",(function(n){t.events.fire(cc.df,this.href)})),Rl(i).on("click",".js-link",(function(n){t.events.fire(cc.sf,this.href)})),Rl(i).on("click",".js-imageLink",(function(n){t.events.fire(cc.hf,this.href)})),Rl(i).on("transitionend",(function(t){i.classList.contains("in")||(i.classList.add("hidden"),i.setAttribute("hidden",""))}),!1),t.events.on([Zs._hideOutro,Zs.Us,Ti.PLAY,Ti.SEEKED,cc.Dc],T),t.events.on(cc.Xl,(function(){t.element.classList.add("player-outroVisible")})).on(cc.Zl,(function(){t.element.classList.remove("player-outroVisible")})),Ld(i,".js-outro-follow",(function(){t.events.fire(cc.ul)})),Rl(i).on("mouseleave",".js-outro-follow",(function(t){var n=document.querySelector(".js-outro-follow");n&&n.classList.remove("vp-outro-follow--activated")})),t.events.on(cc.lf,(function(){var t=document.querySelector(".js-outro-follow");t&&(t.setAttribute("aria-pressed",!0),t.classList.add("vp-outro-follow--activated"))})),t.events.on(cc.ff,(function(){var t=document.querySelector(".js-outro-follow");t&&t.setAttribute("aria-pressed",!1)})),t.events.on(Zs._showOverlay,(function(){setTimeout((function(){i.classList.add("hidden")}),150)})),t.events.on(cc.sl,(function(){i.classList.contains("in")&&i.classList.remove("hidden")})),t.events.on(Zs.Us,(function(){s=null,d=!1,m=t.config.request.ads instanceof Object})),Ld(i,".js-vod-button",(function(){var n=this.getAttribute("data-product-id");return t.events.fire(cc.rl,n),!1})),Ld(i,".js-vod-watch",(function(){if(!("date_available"in t.config.video.vod))return T(),t.events.fire(cc.rl),!1})),a&&((e=new fv(t,a)).events.on(cc._l,(function(){t.config.embed.settings.share.embed_only||(i.querySelector(".js-back").classList.remove("cloaked"),i.classList.add("embed-active"))})).on(cc.yl,(function(){i.classList.remove("embed-active")})),Ld(i,".js-back",(function(){return e.showShareView(),!1})),e.events.on(cc.kl,(function(){i.querySelector(".js-back").classList.add("cloaked")}))),x(),{}}var dv=0;function vv(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"b",n=++dv;return"".concat(t).concat(n)}vv(),vv(),vv(),vv(),vv(),vv(),vv(),vv(),vv();var pv=vv(),mv=vv(),bv=vv(),wv=vv(),gv=vv(),yv=vv(),_v=vv(),kv=vv(),Ev=vv(),Tv=vv(),Sv=vv(),Av=vv(),xv=vv(),Cv=Object.freeze({__proto__:null,CONFIG_CHANGED:pv,TELECINE_READY:mv,TELECINE_VIDEO_INIT:bv,PLAY_INITIATED:wv,QUALITY_CHANGED:gv,FORCED_QUALITY:yv,CUE_CHANGED:_v,CAPTIONS_CHANGED:kv,SPATIAL_PLAYBACK_TOGGLED:Ev,PICTURE_IN_PICTURE_AVAILABLE:Tv,PICTURE_IN_PICTURE_NOT_AVAILABLE:Sv,PICTURE_IN_PICTURE_ACTIVATED:Av,PICTURE_IN_PICTURE_DEACTIVATED:xv}),Mv=Object.freeze({__proto__:null,EVENT_PENDING:"liveeventpending",EVENT_ACTIVE:"liveeventactive",EVENT_STARTING:"liveeventstarting",EVENT_STARTED:"liveeventstarted",EVENT_ENDED:"liveeventended",ARCHIVE_STARTED:"livearchivestarted",ARCHIVE_DONE:"livearchivedone",ARCHIVE_ERROR:"livearchiveerror",SETTINGS_UPDATED:"livesettingsupdated",LOW_LATENCY_FALLBACK:"lowlatencyfallback"}),Iv=(z(z(z(z(z(z(z(z(z({},Ti),xi),Ci),Mv),Mi),Si),Ii),Ri),Cv),z(z({},Ci),Mv));function Rv(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"after-video"===(n=n||t.position)||"after"===n}function Ov(t){return Bc({width:150,height:75,baseUrl:t})}var Lv=function(){function t(t){this.element=t,this.cachedElements={}}var n=t.prototype;return n.getElement=function(t){return this.cachedElements[t]||(this.cachedElements[t]=this.element.querySelector(t)),this.cachedElements[t]},n.removeElement=function(t){this.getElement(t)&&(this.cachedElements[t].remove(),this.cachedElements[t]=null)},n.updateAll=function(t,n){this.updateTitle(t.text||t.custom_message),this.updateSkipBtn(t.allow_skip||t.skippable,t.position),this.updatePrivacyPolicy(t.privacy_policy),this.updateCustomLogo(t.custom_logo),this.updateFields(t.custom_fields,n)},n.updateTitle=function(t){var n=this.getElement(".vp-email-capture-title");t&&n?n.textContent=t:!t&&n&&(n.textContent="")},n.updateSkipBtn=function(t,n){var i=this.getElement(".vp-email-capture-form-button--cancel");if(t&&i)i.value=Rv(null,n)?"Skip":"Skip to video";else if(t&&!i){var e=this.getElement(".vp-email-capture-form-skip"),r=Yf.render("email_capture_skip",{position:n,skipText:"Skip",skipToVideoText:"Skip to video",positionIsAfter:Rv(null,n)});e.insertAdjacentHTML("afterbegin",r)}else!t&&i&&this.removeElement(".vp-email-capture-form-button--cancel")},n.updatePrivacyPolicy=function(t){var n=this.getElement(".vp-email-capture-privacy-policy");if(t&&n)n.href=encodeURI(t);else if(t&&!n){var i=this.getElement(".vp-email-capture-disclaimer-wrapper"),e=Yf.render("email_capture_privacy_policy",{text:"Privacy policy",url:t});i.insertAdjacentHTML("beforeend",e)}else!t&&n&&this.removeElement(".vp-email-capture-privacy-policy")},n.updateCustomLogo=function(t){var n=this.getElement(".vp-email-capture-logo");if(t&&n)n.src=Ov(t);else if(t&&!n){var i=this.getElement(".vp-email-capture-title-logo-wrap"),e=Yf.render("email_capture_logo",{url:Ov(t)});i.insertAdjacentHTML("afterbegin",e)}else!t&&n&&this.removeElement(".vp-email-capture-logo")},n.updateFields=function(t,n){var i=this;if(t){var e=this.getElement(".vp-email-capture-form-fields-slider").children;e.length&&F(e).forEach((function(i){t.some((function(t){return i.dataset.id===String(t.id)}))||(i.remove(),n())})),t.forEach((function(t){i.updateField(t,n)}))}},n.updateField=function(t,n){var i=t.id,e=t.field_name,r=t.required,o=t.position_in_form,u=this.getElement(".vp-email-capture-form-fields-slider"),a=this.element.querySelector("[for=custom-field-".concat(i,"]")),s=this.element.querySelector("#custom-field-".concat(i));if(a&&s){var c=s.parentElement,l=u.children;a.textContent=e,s.name=e,s.toggleAttribute("required",r),c.classList.toggle("required",r);var f=F(l).indexOf(c);f!==o&&(u.insertBefore(l[f],l[o]),n())}else{var h=Yf.render("email_capture_field",{field:t});o===u.children.length?u.insertAdjacentHTML("beforeend",h):u.children[o].insertAdjacentHTML("beforebegin",h),n()}},n.updateWebinarStartTime=function(t){var n=this.getElement(".vp-email-capture-wrapper"),i=n.querySelectorAll(".vp-email-capture-start-time"),e=uh(new Date(t));if(t&&i.length)F(i).forEach((function(t){t.textContent=e}));else if(t&&!i.length){var r=this.getElement(".vp-email-capture-title-logo-wrap"),o=n.querySelectorAll(".vp-email-capture-thank-you-title"),u=Yf.render("email_capture_start_time",{startTime:e});r.insertAdjacentHTML("afterbegin",u),F(o).forEach((function(t){u=Yf.render("email_capture_start_time",{startTime:e}),t.insertAdjacentHTML("afterbegin",u)}))}else!t&&i.length&&F(i).forEach((function(t){t.parentNode.removeChild(t)}))},n.clearCachedElements=function(){this.cachedElements={}},t}();function Dv(t,n,i){return i?n?n(t):t:(t&&t.then||(t=r.resolve(t)),n?t.then(n):t)}function jv(t,n){try{var i=t()}catch(t){return n(t)}return i&&i.then?i.then(void 0,n):i}function Nv(){}function Pv(t){if(t&&t.then)return t.then(Nv)}function Uv(t){return function(){for(var n=[],i=0;iVimeo\'s Terms of Service and Privacy Policy ',host_privacy_policy:"and the webinar host's Privacy Policy",reg_login_title:"Enter your email to see if you’re registered",reg_thank_you:"Thanks for registering!",reg_thank_you_subtitle:"Check your email for your registration confirmation. We'll also send you a reminder and a link to the event 24 hours before it begins.",reg_bypass:"Already registered?",reg_go_back:"Register for this event",login_thank_you:"Great news! You’re already registered.",login_thank_you_subtitle:"Check your email for your registration confirmation.",email_not_valid:"Email address not valid. Please try another email address.",email_not_registered:"Email not registered for this event",opt_in:"Opt into emails from this event host",event_is_live:"This event is live",unscheduled:"Unscheduled",add_to_calendar:"Add to calendar",opt_in_error:"Opting in is required to register for this webinar."}};function Vv(t,n,i){var e,r,o,u,a,s,c,l,f,h,d,v,p,m,b,w,g,y,_=Uv((function(){Ns(i);var e=W(c),r=t.config.request,o=r.timestamp,u=r.expires;function a(n){b.classList.remove("loading"),3152===(null==n?void 0:n.error_code)?H(!1):(d.setCustomValidity("Uh oh. There was a problem. Please try again."),d.setAttribute("aria-invalid","true"),t.events.fire(cc.rf),L())}var s="https://".concat(t.config.player_url,"/video/").concat(t.config.video.id,"/webinar/login?context=").concat(encodeURIComponent(A),"&time=").concat(o,"&expires=").concat(u);return b.classList.add("loading"),Pv(jv((function(){return Dv(tr(s,{method:"POST",body:e,headers:{"Content-type":"application/json"},withCredentials:!0}),(function(i){return Dv(i.json(),(function(i){!function(i){n.dispatch(Pl(!0,i.video.webinar.registrant)),t.events.fire(cc.uf,i),S?(B(),t.events.fire(cc.Ac)):H(!1)}(i)}))}))}),(function(t){return Pv(jv((function(){return Dv(t.response.json(),(function(t){a(t)}))}),(function(){a()})))})))})),k=Uv((function(){Ns(i);var e=W(c),r=t.config.request,o=r.timestamp,u=r.expires;function a(n){b.classList.remove("loading"),3152===(null==n?void 0:n.error_code)?H(!0):(d.setCustomValidity("Uh oh. There was a problem. Please try again."),d.setAttribute("aria-invalid","true"),t.events.fire(cc.rf),L())}var s="https://".concat(t.config.player_url,"/video/").concat(t.config.video.id,"/webinar/registration?context=").concat(encodeURIComponent(A),"&time=").concat(o,"&expires=").concat(u);return b.classList.add("loading"),Pv(jv((function(){return Dv(tr(s,{method:"PUT",body:e,headers:{"Content-type":"application/json"},withCredentials:!0}),(function(i){return Dv(i.json(),(function(i){!function(i){n.dispatch(Pl(!0,i.video.webinar.registrant)),t.events.fire(cc.uf,i),S?(B(),t.events.fire(cc.Ac)):H(!0)}(i)}))}))}),(function(t){return Pv(jv((function(){return Dv(t.response.json(),(function(t){a(t)}))}),(function(){a()})))})))})),E=rt(),T=!Lu(null==(e=t.config.video.webinar)?void 0:e.registration_form),S="started"===(null==(r=t.config.video.webinar)?void 0:r.status),A=t.config.embed.context,x="Vimeo\\Controller\\VideoSettings\\ServiceController.getInteractions"===A,C=new Lv(i),M=!1,I=!1,R=O(t.config);function O(t){var n,i,e;return T?(null==(e=t.video.webinar)?void 0:e.registration_form)||{}:(null==(n=t.embed)?void 0:n.email_capture_form)||(null==(i=t.embed)?void 0:i.email)||{}}function L(){p.querySelector(".vp-validation-bubble-message").innerHTML=d.validationMessage||"There is an error with this input.",p.classList.remove("hidden"),p.classList.remove("vp-validation-bubble-animate"),window.requestAnimationFrame((function(){p.classList.add("vp-validation-bubble-animate")})),d.focus()}function D(){h.classList.add("vp-email-capture-input-invalid"),L()}function j(){p.classList.remove("vp-validation-bubble-animate"),h.classList.remove("vp-email-capture-input-invalid"),m&&(g.classList.remove("vp-webinar-compliance-checkbox-invalid"),m.classList.remove("vp-opt-in-bubble-animate"),m.classList.add("hidden"))}var N=function t(n){n.target===a&&(a.removeEventListener("transitionend",t),d.focus())};function P(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=i.querySelector(".vp-email-capture-disclaimer-wrapper"),r=i.querySelector(".vp-email-capture-current-step"),l=i.querySelector(".vp-email-capture");h&&(h.setAttribute("aria-hidden",!0),d.tabIndex=-1);var p=!u&&!x;f&&(p||x)&&(u=Ms(o).height),h=s[(f=t)-1],d=c[f-1],h&&d&&(h.setAttribute("aria-hidden",!1),d.tabIndex=0),window.requestAnimationFrame((function(){a.style.transform="translateY(-".concat(u*(f-1),"px)"),r.textContent=f,v.style.width="".concat(f/s.length*100,"%")})),n&&a.addEventListener("transitionend",N),l.classList.toggle("vp-email-capture-first-step",1===f),T&&!I&&(e.classList.toggle("hidden",f1&&(l.classList.add("half"),t.classList.remove("hidden"),t.tabIndex=0,t.setAttribute("aria-hidden",!1),window.requestAnimationFrame((function(){t.classList.add("show")}))),f()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(d.value)?!(d.checkValidity&&!d.checkValidity()&&((d.validity.valueMissing||d.validity.typeMismatch)&&d.setCustomValidity("This field is required."),d.validity.typeMismatch&&d.setCustomValidity("Please enter a valid response."),1)):(d.setCustomValidity("Please enter a valid email address."),!1))}var B=function(){Rl(i).off(["click","touchend"],".vp-email-capture-form-button--cancel"),Rl(i).off(["click","keydown"],".vp-email-capture-form-button--next"),Rl(i).off(["click","keydown"],".vp-email-capture-form-button--back"),Rl(i).off(["click"],".vp-email-capture-form-button--submit"),Rl(i).off(["keyup","blur"],".vp-email-capture-form-button--next-submit-wrapper"),Rl(i).off("click",".vp-email-capture-wrapper"),Rl(i).off(["keyup","input","focus","blur"],".vp-email-capture-form-input"),Rl(i).off("submit",".vp-email-capture-form"),Rl(i).off(["keyup","click","focus","blur"],".vp-disclaimer-checkbox"),M=!1,E.fire(cc.bf)};function H(){var n,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=i.querySelector(".vp-email-capture");n=e?i.querySelector(".vp-email-capture-reg-thank-you"):i.querySelector(".vp-email-capture-login-thank-you"),r.classList.add("hidden"),n.classList.remove("hidden"),t.events.once(Iv.EVENT_STARTED,(function(){B()}))}function q(){function n(n){b.classList.remove("loading"),d.setCustomValidity("Uh oh. There was a problem. Please try again."),d.setAttribute("aria-invalid","true"),t.events.fire(cc.rf),L()}b.classList.add("loading"),function(e,r){Ns(i);var o=F(c),u=new XMLHttpRequest,a=t.config.request,s=a.referrer,l=a.signature,f=a.timestamp,h=a.expires,d="https://".concat(t.config.player_url,"/video/").concat(t.config.video.id,"/submit-email?signature=").concat(l,"&time=").concat(f,"&expires=").concat(h,"&referrer=").concat(s);u.open("POST",d+window.location.search,!0);var v={};o.forEach((function(t){v[t.name]=t.value}));var p=JSON.stringify(v);u.setRequestHeader("Content-Type","application/json"),u.withCredentials=!0,u.timeout=3e3,u.onload=function(){var e;try{e=JSON.parse(u.responseText)}catch(t){}!function(e,r){!1!==e?(t.config.embed.email_capture_form=null,t.config.embed.email=null,t.events.fire(cc.ef),function(){var t=i.querySelector(".vp-email-capture"),n=i.querySelector(".vp-email-capture-thank-you");t.classList.add("hidden"),n.classList.remove("hidden"),window.requestAnimationFrame((function(){var t=i.querySelector(".vp-email-capture-video-countdown-timer"),e=i.querySelector(".vp-email-capture-video-countdown-meter");n.classList.add("in"),t&&(e.classList.add("vp-email-capture-video-countdown-meter--active"),t.textContent=3);var r=2,o=setInterval((function(){r<=0?(B(),clearInterval(o)):(t&&(t.textContent=r),r-=1)}),1e3)}))}()):n(r.status)}(e,u)},u.onerror=function(t){r(t)},u.send(p)}(0,n)}function W(t){var n={};return F(t).forEach((function(t){var i=t.name,e=t.value;switch(i){case"email":n.email=e;break;case"First name":n.first_name=e;break;case"Last name":n.last_name=e;break;default:n.data||(n.data={}),n.data[i]=e}})),JSON.stringify(n)}var z=function(t){return V()?(j(),P(f+1),!0):(D(),!1)},G=function(){var n,i;return f===s.length&&(V()?!T||y.getAttribute("checked")||I?((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"before-video"===(n=n||t.position)||"before"===n}(R)&&!t.config.video.live_event||"started"===(null==(n=t.config.video.live_event)?void 0:n.status))&&(t.events.fire(cc.Ac),t.events.fire(cc.Sc)),j(),t.events.fire(cc.wl),T?I?_():k():(q(),(Rv(R)||t.config.video.live_event)&&"started"!==(null==(i=t.config.video.live_event)?void 0:i.status)||t.events.fire(cc.Ac)),!1):(y.classList.add("vp-disclaimer-checkbox-invalid"),m.classList.remove("hidden"),m.classList.remove("vp-opt-in-bubble-animate"),window.requestAnimationFrame((function(){m.classList.add("vp-opt-in-bubble-animate")})),g.classList.add("vp-webinar-compliance-checkbox-invalid"),y.focus(),!1):(D(),!1))};function Y(t){I=t;var n=R.custom_fields;I&&(n=[{field_name:"Email address",required:1,position_in_form:0,id:1,locked:1}]),function(t){var n=Yf.render("email_capture_fields",{customFields:t,strings:Fv});document.querySelector(".vp-email-capture-form-fields-slider").innerHTML=n,i.querySelector(".vp-email-capture-total-steps").innerText=t.length,s=i.querySelectorAll(".vp-email-capture-form-custom-field"),c=i.querySelectorAll(".vp-email-capture-form-input"),h=s[f-1],d=c[f-1],u=null,J(),P(f>s.length?s.length:f,!1)}(n),w.innerHTML=Yf.render("webinar_registration_bypass_btn",{showWebinarLogin:I,regBypass:Fv.webinar.reg_bypass,regGoBack:Fv.webinar.reg_go_back});var e=I?Fv.webinar.reg_login_title:R.custom_message;document.querySelector(".vp-email-capture-title").innerHTML=Yf.render("email_capture_title",{title:e}),j()}var K={get events(){return E},getData:function(){var n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R=O(t.config);var r=e.custom_logo||R.custom_logo,o=e.custom_fields||R.custom_fields||[{field_name:"Email address",required:1,position_in_form:0,id:1,locked:1},{field_name:"Name",required:0,position_in_form:1,id:2,static_field:1}];o.sort((function(t,n){return t.position_in_form-n.position_in_form}));var u=e.privacy_policy||R.privacy_policy,a=(null==(n=t.config.video.webinar)?void 0:n.scheduled_start_time)||null,s=a?uh(new Date(a)):"";return i.template=Yf.render("email_capture",{allowSkip:e.allow_skip||R.skippable||R.allow_skip,customLogo:r?Ov(r):null,text:e.text||R.custom_message||R.text,customFields:o,privacyPolicy:u,positionIsAfter:Rv(R),strings:Fv,showWebinarForm:T,showWebinarLogin:I,webinarStartTime:s,isWebinarStarted:S}),C.clearCachedElements(),i.Yd=".vp-email-capture-form-input",i.modal=!0,i.logo=!1,i.preventBackgroundClose=!0,i.noblur=e.noblur,i.nofocus=e.nofocus,i}};function J(){var t=i.querySelector(".locked_field"),n=i.querySelectorAll(".static_field");t&&(t.type="email",t.name="email"),n&&F(n).forEach((function(t){"Name"===t.name&&(t.name="name")}))}return t.events.on(cc.al,(function(e){if("email-capture"===e){if(o=i.querySelector(".vp-email-capture-form-fields-wrapper"),a=i.querySelector(".vp-email-capture-form-fields-slider"),s=i.querySelectorAll(".vp-email-capture-form-custom-field"),c=i.querySelectorAll(".vp-email-capture-form-input"),l=i.querySelector(".vp-email-capture-form-button--next-submit-wrapper"),v=i.querySelector(".vp-email-capture-progress-meter"),p=i.querySelector(".vp-validation-bubble"),m=i.querySelector(".vp-opt-in-bubble"),b=i.querySelector(".vp-email-capture-form-button--submit"),w=document.querySelector(".vp-email-capture-reg-bypass-wrapper"),g=document.querySelector(".vp-webinar-compliance-checkbox-border"),y=i.querySelector(".vp-disclaimer-checkbox")){var r=function(t){return t=(t=(t=t.replace(/"/g,"'")).replace(/>\s{1,}<")).replace(/\s{2,}/g,""),"".concat(t.replace(/[\r\n%#()<>?\\[\\\]^`{|}]/g,encodeURIComponent))}(Yf.render("icon_check"));y.style.backgroundImage='url("data:image/svg+xml;,'.concat(r,'")')}J(),P(1,!1),function(){if(!M){n.watch("ui.player.breakpoint",(function(){u=Ms(o).height,window.requestAnimationFrame((function(){a.style.transform="translateY(-".concat(u*(f-1),"px)")}))}));var e=!1;Ld(i,".vp-email-capture-form-button--cancel",(function(){var n;B(),(Rv(R)||t.config.video.live_event)&&"started"!==(null==(n=t.config.video.live_event)?void 0:n.status)||t.events.fire(cc.Ac)})),Rl(i).on("click",".vp-email-capture-form-button--next",z),Rl(i).on("click",".vp-email-capture-form-button--back",(function(t){j(),P(f-1)})),Rl(i).on("keyup",".vp-email-capture-form-button--next-submit-wrapper",(function(t){l.classList.add("showfocus")})),Rl(i).on("blur",".vp-email-capture-form-button--next-submit-wrapper",(function(t){l.classList.remove("showfocus")})),Rl(i).on("click",".vp-email-capture-wrapper",(function(){l.classList.remove("showfocus"),d.classList.remove("showfocus")})),Rl(i).on("keydown",".vp-email-capture-form-button--back",(function(t){e=!0})),Rl(i).on("keydown",".vp-email-capture-form-button--next",(function(t){e=!0})),Rl(i).on("keyup",".vp-email-capture-form-input",(function(t){"Enter"===t.key&&fs.length?s.length:f,!1)}))})),t.events.on(cc.Bl,(function(){var i=O(t.config);n.get(Vl)||!Lu(R)&&!Lu(i)&&R.id===i.id||t.events.fire(Zs._hideOverlay,{name:"email-capture",unmakeModal:!0})})),K}function Bv(t,n,i){var e,r,o,u=i.querySelector(".vp-overlay-cell"),a=i.querySelector(".vp-overlay"),s=i.querySelector(".vp-overlay-icon-wrapper"),c=s.querySelector(".vp-overlay-icon"),l=i.querySelector(".vp-overlay-logo"),f=!1,h=null,d=null,v=new fv(t,a),p=new Vv(t,n,a),m=!1,b=!1;function w(){var t=Ms(i),n=Ms(a),e=Ms(l),r=n.bottom+(t.height-n.bottom)/2;return t.height-r-e.height/2+"px"}function g(){var t=Ms(i),n=Ms(a),e=Ms(s),r=t.height/2,o=t.height-(t.bottom-n.bottom)/2;return{top:r-e.height/2+"px",transform:"translateY("+(o-r)+"px)"}}function y(n,e){i.setAttribute("data-name",n),a.innerHTML=e.template,Yi.iOS&&nd.element&&(t.events.fire(cc.Zc),nd.exit()),e.noblur||Cs(o=document.activeElement),e.modal&&(i.classList.add("modal"),i.setAttribute("data-modal","true")),e.preventBackgroundClose&&i.setAttribute("data-background-close","false"),e.wrapperClass&&i.classList.add(e.wrapperClass),e.icon.type&&(e.logo&&(l.classList.remove("hidden"),s.classList.add("cloaked"),window.requestAnimationFrame((function(){l.innerHTML=Yf.render("logo"),l.style.bottom=w()}))),s.classList.remove("hidden"),c.innerHTML=e.icon.html,window.requestAnimationFrame((function(){var t=g();s.style.top=t.top,s.style[Yi.transformProperty]=t.transform})),i.setAttribute("data-icon",e.icon.type),s.setAttribute("data-icon",e.icon.type),c.setAttribute("data-icon",e.icon.type),"private-unlocked"===n&&c.classList.add("open")),i.classList.add("invisible"),i.classList.remove("hidden"),i.removeAttribute("hidden"),i.classList.add("in"),d=e,h=n,f=!0,t.events.fire(cc.al,n),t.element.classList.add("player-overlayVisible"),window.requestAnimationFrame((function(){i.classList.remove("invisible"),!e.nofocus&&t.element.contains(o)&&function(t){if(t){var n=i.querySelector(t);n&&n.focus()}}(e.Yd),window.requestAnimationFrame((function(){a.classList.add("in"),u.classList.add("in")}))}))}function _(){a.classList.remove("in"),a.classList.add("out")}function k(n){if("true"!==i.getAttribute("data-modal")&&f){i.removeAttribute("data-background-close"),u.classList.remove("in"),u.classList.add("out"),_(),i.classList.remove("in"),i.classList.add("out"),clearTimeout(e),e=setTimeout(E,200),(null==n?void 0:n.preventDefault)&&n.preventDefault();var r=i.querySelector(".js-back");r&&r.classList.add("cloaked"),v.destroy(),t.events.fire(cc.sl,h),t.element.classList.remove("player-overlayVisible"),f=!1,h=null,d=null,window.requestAnimationFrame((function(){o&&(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{t.focus()}catch(t){n&&n(t)}}(o),o=null)}))}}function E(){i.setAttribute("hidden",""),i.removeAttribute("data-name"),i.removeAttribute("data-icon"),i.classList.add("hidden"),i.classList.remove("out"),i.classList.remove("embed-active"),i.classList.remove("modal"),i.classList.remove("embed-only"),u.classList.remove("out"),u.classList.remove("in"),s.removeAttribute("data-icon"),s.classList.add("hidden"),s.classList.remove("animate"),c.removeAttribute("data-icon"),c.innerHTML="",l.classList.add("hidden"),a.classList.remove("out"),a.innerHTML="",t.events.fire(cc.cl)}function T(){i.setAttribute("data-modal","false")}function S(t){if("yes"===t.form.getAttribute("data-bubble")){t.form.setAttribute("data-bubble","no");var n=i.querySelector(".vp-validation-bubble");n.querySelector(".vp-validation-bubble-message").innerHTML=t.validationMessage||"There is an error with this input.";var e=Ms(t),r=Ms(t.form);n.style.left=e.left-r.left+"px",n.style.top=e.height+1+"px",n.classList.remove("hidden"),t.focus(),window.requestAnimationFrame((function(){n.classList.add("vp-validation-bubble-animate")})),A()}}function A(t){var n=i.querySelector(".vp-validation-bubble");if(n){if(t)return clearTimeout(r),void n.classList.remove("vp-validation-bubble-animate");clearTimeout(r),r=setTimeout((function(){n.classList.remove("vp-validation-bubble-animate")}),5e3)}}function x(t){var n=i.querySelector("input[type=password]");return n.form.classList.contains("submitted")?(n.setAttribute("aria-invalid","false"),n.setCustomValidity(""),n.checkValidity&&!n.checkValidity()?(n.setAttribute("aria-invalid","true"),n.validity.valueMissing&&n.setCustomValidity("Please enter the password."),t||S(n),!1):(A(!0),!0)):null}function C(){M(),s.classList.remove("cloaked"),s.classList.add("animate"),window.requestAnimationFrame((function(){s.style[Yi.transformProperty]="translateY(-10px)"})),T(),_()}function M(){l.classList.add("animate")}function I(){c.classList.add("open")}function R(){c.classList.add("pulled-back")}function O(n){return n.icon={type:"lock",html:Yf.render("icon_lock")},n.Yd=".js-login",n.modal=!0,n.logo=!0,n.template=Yf.render("private_locked",{action:"https://".concat(t.config.vimeo_url,"/log_in"),strings:{title:"Private Video",subtitle:"Log in to watch (if you have permission)",logIn:"Log in"}}),n}function L(n){return n.icon={type:"lock",html:Yf.render("icon_lock")},n.template=Yf.render("password",{action:"https://".concat(t.config.player_url,"/video/").concat(t.config.video.id,"/check-password?referrer=").concat(t.config.request.referrer),strings:{title:"Password Required",subtitle:"If you’ve got it, enter it below.",password:"Password",watch:"Watch Video"}}),n.Yd=".js-password",n.modal=!0,n.logo=!!t.config.embed.settings.logo,n}function D(t){return t.icon={type:"lock",html:Yf.render("icon_lock")},t.template=Yf.render("private_unlocked",{strings:{title:"Private Video",subtitle:"You are logged in and have permission to watch (congrats).",watch:"Watch Video"}}),t.Yd=".js-watch",t}function j(t,n){return t.template=Yf.render("error",{title:n.title,message:n.message,aria_label:"Error"}),t.Yd=".js-close",t.modal=!!n.modal,t.logo=!!n.logo,n.icon&&"lock"===n.icon&&(t.icon={type:"lock",html:Yf.render("icon_lock")}),t}function N(n){return n.template=Yf.render("help",{onSite:t.config.embed.on_site,strings:{title:"Keyboard Shortcuts",volumeUp:"Volume up",volumeDown:"Volume down",scrubForward:"Scrub forward",scrubBackwards:"Scrub backwards",like:"Like",share:"Share",watchLater:"Watch Later",captions:"Toggle Captions",prefs:"Toggle Preferences Menu",fullscreen:"Toggle fullscreen",viewOnVimeo:"View on Vimeo"}}),n.Yd=".js-close",n}function P(n){var i,e,r=(null==(i=t.config.video.webinar)?void 0:i.scheduled_start_time)||null,o=r?uh(new Date(r)):"",u=null==(e=t.config.video.webinar)?void 0:e.custom_logo;return n.template=Yf.render("webinar_confirmation",{customLogo:u?Ov(u):null,webinarStartTime:o,strings:{thank_you:Fv.webinar.login_thank_you,thank_you_subtitle:Fv.webinar.login_thank_you_subtitle}}),n.modal=!0,n}function U(t){return t.template=Yf.render("webinar_ended",{strings:{title:"Live event ended"}}),t.modal=!0,t}function V(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=i.redirectUrl,r=i.title,o=i.buttonText,u=i.ignoreText,a=i.bottomText,s=i.newWindow,c=Fs(t.config.video.privacy,["disable","unlisted"]);return n.template=Yf.render("app_redirect",{hideRedirectButton:c,redirectUrl:e,newWindow:s,strings:{title:r,buttonText:o,ignoreText:u,bottomText:a}}),n.modal=!1,n.logo=!1,n.preventBackgroundClose=!0,n}function B(){var n=t.config.embed.email_capture_form||t.config.embed.email||{};if(t.backbone){var i=n.timecode||0;m=t.backbone.currentTime>i}("before-video"===n.position||"before"===n.position)&&!m&&H()}function H(){n.get("ui.overlay.isEmailCaptureVisible")?t.events.fire(Zs._showOverlay,"email-capture"):b=!0}return t.events.on(Zs._hideOverlay,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.name&&h!==t.name||(t.unmakeModal&&T(),k())})),t.events.on(Zs._showOverlay,(function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=function(){var t={modal:!1,template:null,logo:!1,icon:{type:null,html:null}};switch(n){case"share":return y(n,v.getShareData(t,i)),void v.setup();case"private-locked":return void y(n,O(t));case"password":return void y(n,L(t));case"private-unlocked":return void y(n,D(t));case"error":return void y(n,j(t,i));case"help":return void y(n,N(t));case"email-capture":return void y(n,p.getData(t,i));case"app-redirect":return void y(n,V(t,i));case"webinar-confirmation":return void y(n,P(t));case"webinar-blocked":y(n,U(t))}};if(f&&!i.nohide)return"share"!==h&&"help"!==h||h!==n?(t.events.once(cc.cl,e),T(),void k()):void k();e()})),Rl(i).on("input","input",(function(){this.form.classList.add("interacted")})).on("transitionend",".vp-validation-bubble",(function(t){"opacity"===t.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&this.classList.add("hidden")})),t.events.on([cc.ll,Ti.PLAY],k),t.events.on(cc.Wl,(function(){"private-locked"===h&&(T(),k())})),t.events.on(cc.Bl,(function(){"share"===h&&(d=v.getShareData({modal:!1,template:null,logo:!1,icon:{type:null,html:null}}),a.innerHTML=d.template,v.setup())})),Rl(window).on("resize",(function(){if(f){l.style.bottom=w();var t=g();s.style.top=t.top,s.style[Yi.transformProperty]=t.transform}})),Rl(i).on("transitionend",".vp-overlay-logo",(function(t){"opacity"===t.propertyName&&this.classList.contains("animate")&&(l.classList.add("hidden"),l.classList.remove("animate"))})),Rl(i).on("transitionend",".vp-overlay-icon-wrapper",(function(t){t.propertyName.indexOf("transform")>-1&&(""===this.style[Yi.transformProperty]?(this.classList.remove("centered"),"lock"!==this.getAttribute("data-icon")||c.classList.contains("open")||c.querySelector("canvas")?R():setTimeout(I,100)):"translateY(-10px)"===this.style[Yi.transformProperty]&&(s.classList.add("centered"),s.style[Yi.transformProperty]=""))})),Rl(i).on("transitionend",".vp-overlay-icon",(function(t){t.propertyName.indexOf("transform")>-1&&(this.classList.contains("out")?(T(),k()):this.classList.contains("pulled-back")?(c.classList.add("out"),c.classList.remove("pulled-back")):this.classList.contains("open")&&R())})),n.watch("ui.overlay.isEmailCaptureVisible",(function(n){!n&&f&&"email-capture"===h?(b=f,T(),k()):n&&b&&(b=!1,t.events.fire(Zs._showOverlay,"email-capture"))})),t.events.on(cc.ye,B),t.events.on(cc.Bl,B),t.events.on(Ti.TIME_UPDATE,(function(n){var i=n.currentTime,e=void 0===i?0:i,r=t.config.embed.email_capture_form||t.config.embed.email||{};("during-video"===r.position||"during"===r.position)&&(e=r.timecode&&!m&&(m=!0,H()))})),t.events.on(cc.Sl,(function(){H()})),p.events.on(cc.bf,(function(){t.events.fire(cc.bf),T(),k()})),v.events.on(cc._l,(function(){t.config.embed.settings.share.embed_only||(i.querySelector(".js-back").classList.remove("cloaked"),i.classList.add("embed-active"))})).on(cc.yl,(function(){i.classList.remove("embed-active")})),Ld(i,".js-back",(function(){return v.showShareView(),!1})),v.events.on(cc.kl,(function(){i.querySelector(".js-back").classList.add("cloaked")})),Yi.stereoscopic&&(t.events.on(cc.Tl,(function(){t.events.fire(Zs._showOverlay,"app-redirect",{redirectUrl:t.doNotTrackEnabled?t.config.video.share_url:gl(t.config.video.id,"player-spatial-redirect"),title:"Headset viewing isn’t currently supported in your mobile browser.",buttonText:"Watch in the Vimeo app",ignoreText:null,bottomText:null,newWindow:!t.config.embed.on_site})})),Rl(a).on("click",".app-redirect-ignore",(function(){k()})),Rl(a).on("click","[data-new-window]",(function(t){return window.open(document.querySelector(".app-redirect-button").getAttribute("href")),!1}))),Rl(a).on("click",".popup",(function(){return t.events.fire(Zs.Ps,"login-private-locked"),!1})),Rl(a).on("click",".password input[type=submit]",(function(){this.form.classList.add("submitted"),this.form.setAttribute("data-bubble","yes"),x(!0)})).on("submit",".password form",(function(){return function(n){if(!x())return!1;var e=n.querySelector("input[type=password]"),r=n.querySelector("input[type=submit]");function o(t){r.classList.remove("loading"),e.setCustomValidity("Uh oh. There was a problem. Please try again."),e.setAttribute("aria-invalid","true"),S(e)}r.classList.add("loading"),function(t,n,e){Ns(i);var r=F(t.querySelectorAll("input")).map((function(t){return t.name?encodeURIComponent(t.name)+"="+encodeURIComponent(window.btoa(function(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(t,n){return String.fromCharCode("0x"+n)}))}(t.value))):encodeURIComponent(t.value)})).join("&"),o=new XMLHttpRequest;o.open(t.method,t.action+window.location.search,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.withCredentials=!0,o.timeout=3e3,o.onload=function(){var t;try{t=JSON.parse(o.responseText)}catch(t){}n(t,o)},o.onerror=function(t){e(t)},o.send(r)}(n,(function(n,i){if(!1!==n){if(t.events.fire(cc.ql,n),"icon-hidden"===window.getComputedStyle(u,":after").content)return T(),void k();C()}else o(i.status)}),o)}(this),!1})).on(["focus","input"],[".password input[type=email]",".password input[type=password]"],(function(){x()})),Ld(a,".unlocked button",(function(){0===Ms(c).width?(M(),T(),k()):C(),Yi.iPad||Yi.iPhone||t.events.once(cc.cl,(function(){t.events.fire(cc.Ac)}))})),function(){var n;t.events.on(cc.cc,(function(i){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{modal:!0,final:!0};if(!1!==e.final){n=i;var r={modal:!1,template:null,logo:!1,icon:{type:null,html:null}};if(r.modal=e.modal,r.template=Yf.render("error",{title:e.title,message:e.message}),r.Yd=".js-close",f)return k(),void t.events.once(cc.cl,(function(){return y(i,r)}));y(i,r)}})),Rl(a).on("click",".error",(function(i){t.events.fire(cc.cf,i.target.href,n)}))}(),t.events.on(cc.Bl,(function(){"email-capture"!==h&&window.requestAnimationFrame((function(){T(),k()}))})),Ld(i,".js-close",(function(){t.events.fire(cc.ll)})),Rl(i).on(["click","touchend"],[".vp-overlay-content",".js-share",".vp-overlay-logo"],(function(t){t.stopPropagation()})).on(["click","touchend"],[".vp-overlay-cell","nav"],(function(){return"false"===i.getAttribute("data-background-close")||(t.events.fire(cc.ll),!1)})),t.events.on(Zs.Zs,(function(){i.classList.add("hidden")})),t.events.on(cc.Zl,(function(){i.classList.contains("in")&&i.classList.remove("hidden")})),t.events.fire(cc.Ef),{}}var Hv=[".vp-title a"],qv=[".vp-title a:hover"],Wv=["a",".button-link",".vp-overlay-wrapper .footnote.share a:hover",".vp-title h1",".vp-title span.user",".menu li:hover",".menu li.active",".vp-outro-link:hover",".vp-outro-videosTitle a:hover","li.vp-panel-item:hover","li.vp-panel-item-on",".vp-share-footnote a:hover",".card-link span",".vp-panel-collapsible .vp-panel-button:hover"],zv=["a:hover",".button-link:hover"],Gv=[".vp-overlay-wrapper .close:hover .fill",".vp-overlay-wrapper .back:hover .fill",".stats-debug-close:hover .fill",".stats-debug-copy:hover",".card-link:hover .fill"],Yv=[".play-bar .on .fill",".play-bar a:hover .fill",".play-bar button:not(.toggle):hover .fill",".tiny-bars .fill",".vp-sidedock .on .fill",".controls-outro a:hover .fill",".card-link .fill",".vp-panel-collapsible .vp-panel-button:hover .fill"],Kv=[".vp-controls .play-bar .vp-cast-button"],Jv=[".vp-sidedock .on:hover .fill"],$v=[".play-bar .on .stroke",".vp-sidedock .on .stroke"],Xv=[".vp-sidedock .on:hover .stroke"],Zv=[".vp-sidedock button:hover",".vp-sidedock button.selected","&.touch-support .vp-sidedock button:active",".vp-controls .play:hover",".vp-controls .play-bar .played","&.no-playbar .play-bar button:not(.toggle):hover",".vp-controls.tiny .play-bar button:not(.toggle):hover",".vp-controls .volume div",".vp-overlay .buttons li",".vp-overlay .vp-overlay-content button",'.vp-overlay .vp-overlay-content input[type="submit"]','.vp-overlay .vp-overlay-content a[role="button"]',"li.vp-panel-item-on:before",".vp-controls .replay:hover",".vp-share-buttons li","button.vp-share-embedCopy",".vp-outro-button","a.vp-outro-vodButton","input[type=checkbox][checked].vp-disclaimer-checkbox",".vp-email-capture-progress-meter",".chapter-marker",".vp-chapters-active-indicator"],Qv=["li.vp-panel-item-on:before"],tp=[".vp-overlay .vp-overlay-content button",'.vp-overlay .vp-overlay-content input[type="submit"]','.vp-overlay .vp-overlay-content a[role="button"]',".vp-sidedock button:hover",".vp-sidedock button.selected",".vp-sidedock button:hover .vod-label",".vp-sidedock button.selected .vod-label",".play:hover",".vp-share-footnote--embed a",".vp-outro-button",".vp-outro-button:hover",".vp-outro-wrapper .vp-outro-link:hover","button.vp-share-embedCopy",".vp-outro-vodWrapper a.vp-outro-vodButton",".vp-outro-vodWrapper a.vp-outro-vodButton:hover","li.vp-panel-item:hover","li.vp-panel-item-on",".vp-panel-collapsible .vp-panel-button:hover","input.vp-email-capture-form-button--next","input.vp-email-capture-form-button--submit"],np=[".vp-controls .play:hover .fill",".vp-sidedock button:hover .fill",".vp-sidedock button.selected .fill",".play-bar a:hover .fill",".play-bar button:not(.toggle):hover .fill","&.no-playbar .play-bar button:not(.toggle):hover .fill",".vp-controls.tiny .play-bar button:not(.toggle):hover .fill",".vp-sidedock .on .fill",'.vp-share-wrapper a[role="button"] .fill',".vp-outro-vodButton .fill",".vp-panel-collapsible .vp-panel-button:hover .fill"],ip=[".vp-controls .play:hover .stroke",".vp-sidedock button:hover .stroke",".vp-sidedock button.selected .stroke",".vp-sidedock .on .stroke"],ep=["li.vp-panel-item-on:before"],rp=["li.vp-panel-item-on:before"],op=['.vp-overlay-wrapper .vp-overlay a[role="button"]',".vp-sidedock button:hover",".vp-sidedock button.selected",".play:hover","button.vp-share-embedCopy",".vp-outro-button",".vp-outro-button:hover",".vp-outro-vodWrapper a.vp-outro-vodButton",".vp-outro-vodWrapper a.vp-outro-vodButton:hover","input.vp-email-capture-form-button--next","input.vp-email-capture-form-button--submit"],up=[".vp-controls .play:hover .fill",".vp-sidedock button:hover .fill",".vp-sidedock button.selected .fill",".vp-controls .play-bar .fullscreen.tiny:hover .fill",".vp-share-button .fill",".vp-outro-vodButton .fill"],ap=[".vp-sidedock button:hover .stroke",".vp-sidedock button.selected .stroke"],sp=["li.vp-panel-item-on:before",".vp-email-capture-form-fields-slider .vp-email-capture-form-custom-field.focus",".vp-email-capture-disclaimer-wrapper .vp-webinar-compliance-checkbox-border.showFocus"],cp=['.vp-overlay .vp-overlay-content input[type="submit"]:active','.vp-overlay a[role="button"]:active',".vp-sidedock button:active",".vp-outro-vodWrapper a.vp-outro-vodButton:active",".vp-email-capture-form-button--next:hover",".vp-email-capture-form-button--next:focus",".vp-email-capture-form-button--submit:hover",".vp-email-capture-form-button--submit:focus"],lp=[".vp-email-capture-form-button--next",".vp-email-capture-form-button--submit"];function fp(t,n){var i=n.uuid,e=n.id,r=n.isMobileDevice,o=null;function u(t,n){var o=".player-".concat(i," "),u=o+t.join(","+o);if(n){var a="".concat(e," ");u+=",".concat(a).concat(t.join(","+a))}return r&&(u=u.replace(/:hover/g,":active")),u.replace(/ &/g,"")}return t.events.on(Zs.Hs,(function(n){var e;try{e=new rd(n)}catch(t){e=new rd("00adef")}var r=function(t){o?function(){for(;o.cssRules.length>0;)o.deleteRule(0)}():function(){var t=document.createElement("style");t.setAttribute("data-player",i),document.querySelector("head").appendChild(t),o=t.sheet}();var n=t.complement,e=new rd(30,30,30,.9),r=new rd(0,0,0,.15).overlayOn(t);e.contrast(n).ratio<3&&n.lighten(5,3,e);var a,s=t.lightness<40?t.clone().lighten(15,3,t):t.clone().darken(15,3,t);As(u(Hv,!0),"color:"+t.hex+" !important",o),As(u(qv,!0),"color:"+n.hex+" !important",o),As(u(sp),"border-color:"+r.hex,o),As(u(Wv),"color:"+t.hex,o),As(u(Yv),"fill:"+t.hex,o),As(u(Kv),"--connected-color:"+t.hex,o),As(u($v),"stroke:"+t.hex,o),As(u(Zv),"background-color:"+t.hex,o),As(u(Qv),"border-color:"+t.hex,o),As(u(zv),"color:"+n.hex,o),As(u(Gv),"fill:"+n.hex,o),As(u(Jv),"fill:"+s.hex,o),As(u(Xv),"stroke:"+s.hex,o),As(u(cp),"background-color:"+r.hex,o),t.luminance>.95&&(n=t.clone().darken(15,3,t),As(u(tp),"color:"+n.hex,o),As(u(np),"fill:"+n.hex,o),As(u(ip),"stroke:"+n.hex,o),As(u(ep),"background-color:"+n.hex,o),As(u(rp),"border-color:"+n.hex,o),s=n.clone().darken(15,3,n),As(u(Jv),"fill:"+s.hex,o),As(u(Xv),"stroke:"+s.hex,o)),t.yiq>175&&t.luminance<.95&&(a=s.clone().darken(15,3,s),As(u(Jv),"fill:"+a.hex,o),As(u(Xv),"stroke:"+a.hex,o),As(u(op),"color:"+s.hex,o),As(u(up),"fill:"+s.hex,o),As(u(ap),"stroke:"+s.hex,o));var c=new rd(t.hex);return c.alpha=.8,As(u(lp),"background-color:"+c.rgba,o),{main:t.hex,selected:s.hex,sidedockHover:a?s.hex:t.luminance>.95?n.hex:rd.white.hex,sidedockSelected:t.luminance>.95?n.hex:t.hex,sidedockSelectedHover:a?a.hex:s.hex}}(e);t.config.Kd=r,t.config.embed.color=r.main.replace("#",""),t.events.fire(cc.Vl,t.config.embed.color)})),t.events.fire(Zs.Hs,t.config.embed.color),{}}function hp(t){var n=null;return t.events.on(Zs.Ps,(function(i,e){var r="https://".concat(t.config.player_url),o="".concat(r,"/video/").concat(t.config.video.id);switch(i){case"login-like":n=Ls("".concat(o,"/login/like"),"login",{width:670,height:545}),t.events.fire(cc.ml,i);break;case"login-watch-later":n=Ls("".concat(o,"/login/watch-later"),"login",{width:670,height:545}),t.events.fire(cc.ml,i);break;case"login-private-locked":n=Ls("".concat(o,"/login/private"),"login",{width:670,height:545}),t.events.fire(cc.ml,i);break;case"purchase":var u="".concat(r,"/video/").concat(t.config.video.vod.feature_id||t.config.video.id,"/purchase/vod");(null==e?void 0:e.productId)&&(u+="/".concat(e.productId)),u+="?referrer=".concat(encodeURIComponent(t.config.request.referrer)),n=Ls(u,"purchase",{width:790,height:670}),t.events.fire(cc.ml,i)}})),window.closePopup=function(i){if(n){try{n.close(),t.events.fire(cc.gl,i)}catch(t){}n=null}},t.config.embed.on_site||(window.confirmPurchase=function(n,i,e){i?t.loadVideo(n):e&&t.events.fire(cc.Ac)}),t.config.embed.on_site||(window.confirmLoginAction=function(n,i){t.events.fire(cc.Nl,i)}),{}}function dp(t,n,i,e){var r=e[n];return r?(r=vp(r=mp(t,r),i,e.prices),e.expires_in_duration_str&&(r=r.replace("{TIME}",e.expires_in_duration_str)),e.available_on_formatted&&(r=r.replace("{DATE}",e.available_on_formatted)),r):null}function vp(t,n,i){var e=i.USD;return n in i&&(e=i[n]),-1!==t.indexOf("${price}")?t.replace("${price}",e):-1!==t.indexOf("{PRICE}")?t.replace("{PRICE}",e):t}function pp(t,n){return!t||0===t.length||-1!==t.indexOf(n)}function mp(t,n){return void 0!==t&&void 0!==t[n]?t[n]:n}var bp=Object.freeze({__proto__:null,formatVodLabel:dp,getDisplayPrice:vp,isAvailableInCountry:pp,translateFromRequest:mp});function wp(t,n){var i,e,r,o,u,a,s,c,l,f=!1,h=!1,d=!1,v=!1,p=!1,m=!1,b=!1,w=!1,g=[],y=[],_=null,k=!1,E=!1,T=null,S=t.config.embed.autoplay&&t.config.request.flags.autohide_controls;function A(){return v||b||w}function x(){f&&(E||(h&&k||A()||S)&&(d||(!p&&!m||A())&&(f=!1,t.events.fire(cc.Fc,f),(T||n).classList.add("invisible"))))}function C(){if(!f&&!A()){var i=T||n;i.classList.add("invisible"),i.classList.remove("hidden"),i.removeAttribute("hidden"),n.classList.remove("hidden"),n.removeAttribute("hidden"),n.classList.contains("vod")&&n.classList.remove("vod"),setTimeout((function(){f=!0,t.events.fire(cc.Fc,f),i.classList.remove("invisible")}),0)}}function M(n,i,e){var r="data-label-"+e,o="add"!==e||t.config.user.logged_in?r:"data-label-add-logged-out";n.setAttribute("aria-label",n.getAttribute(o)),i.classList.add("hidden"),i.setAttribute("hidden",""),i.firstChild.innerHTML=n.getAttribute(r)}function I(){var t="BUTTON"===this.tagName?this:this.querySelector("button"),n=g.indexOf(t);n>=0&&y[n]&&(_&&(window.cancelAnimationFrame(_),_=null),y[n].classList.add("invisible"))}function R(){if(i){var t=i.parentElement;T.insertBefore(t,T.firstChild)}}function O(){var h;if(1===t.config.view||3===t.config.view||12===t.config.view){var d=t.config.embed.settings,v=t.config.video.vod&&"purchase_options"in t.config.video.vod&&t.config.video.vod.purchase_options.length,p=v&&t.config.video.vod.is_coming_soon,m="ondemand.main"===t.config.embed.context||"Vimeo\\Controller\\OnDemandController.main"===t.config.embed.context,b=t.config.video.vod&&t.config.user.purchased?1:0,w=v&&d.vod&&pp(t.config.video.vod.countries,t.config.request.country);w&&p&&m&&(w=!1);var _=v&&t.config.video.vod.purchase_options[0],k=null;_&&(k=dp(t.config.request.dynamic_translation_map,"label_string",t.config.request.currency,_)),n.innerHTML=Yf.render("sidedock",{loggedIn:!!t.config.user.logged_in,vodButton:w,purchased:b,vodPurchaseInfo:_,vodDisplayLabel:k,likeButton:d.like,liked:t.config.user.liked,watchLaterButton:d.watch_later,addedToWatchLater:t.config.user.watch_later,collectionsButton:d.collections,shareButton:d.share,strings:{like:"Like",likeLoggedOut:"Like (this opens in a new window)",unlike:"Unlike",watchLaterAdd:"Add to Watch Later",watchLaterAddLoggedOut:"Add to Watch Later (this opens in a new window)",watchLaterRemove:"Remove from Watch Later",collections:"Add to collections",share:(null==(h=d.share)?void 0:h.embed_only)?"Embed":"Share"}}),i=n.querySelector(".vod-button"),w&&(T=n.querySelector(".sidedock-inner"),b&&R());var E=T||n;v&&w&&!t.config.embed.settings.instant_sidedock?n.classList.add("vod"):Yi.touch&&(f=!0,t.events.fire(cc.Fc,f),E.classList.remove("hidden"),E.removeAttribute("hidden"),E.classList.remove("invisible")),e=n.querySelector(".like-button"),r=n.querySelector(".like-label"),o=n.querySelector(".watch-later-button"),u=n.querySelector(".watch-later-label"),a=n.querySelector(".collections-button"),s=n.querySelector(".collections-label"),c=n.querySelector(".share-button"),l=n.querySelector(".share-label"),g=[i,e,o,c,a],y=[null,r,u,l,s]}}return O(),function(){var n=t.config.embed.settings.instant_sidedock,i=t.config.video.vod,e=i&&"purchase_options"in i&&i.purchase_options.length,r=i&&pp(t.config.video.vod.countries,t.config.request.country);(n||e&&r)&&(S||C())}(),Ld(n,".vod-button",(function(){var n=i.getAttribute("data-product-id");t.events.fire(cc.rl,n)}),I),t.events.on(cc.Xl,(function(){R(),n.classList.add("sidedock-outro"),"share"===t.config.embed.outro&&(t.config.embed.settings.share=0,O())})),t.events.on(cc.Zl,(function(){!function(){if(i){var t=i.parentElement;n.insertBefore(t,T)}}(),n.classList.remove("sidedock-outro"),"share"===t.config.embed.outro&&(t.config.embed.settings.share=1,O())})),Ld(n,".like-button",(function(){t.events.fire(cc.tl)}),I),t.events.on(cc.Ol,(function(){e&&(e.classList.add("on"),M(e,r,"remove"))})),t.events.on(cc.Ll,(function(){e&&(e.classList.remove("on"),M(e,r,"add"))})),Ld(n,".watch-later-button",(function(){t.events.fire(cc.nl)}),I),t.events.on(cc.Dl,(function(){o&&(o.classList.add("on"),M(o,u,"remove"))})),t.events.on(cc.jl,(function(){o&&(o.classList.remove("on"),M(o,u,"add"))})),Ld(n,".collections-button",(function(){t.events.fire(cc.ol)}),I),Ld(n,".share-button",(function(){return t.events.fire(t.config.embed.settings.share.embed_only?cc.el:cc.il),!1}),I),Rl(n).on("blur","button",I).on("mouseleave",".box",I).on(["focus","pointerdown","touchstart","mouseenter"],"button",(function(){var t=g.indexOf(this);y.forEach((function(n,i){i!==t&&n&&n.classList.add("invisible")})),t>=0&&y[t]&&(y[t].classList.add("invisible"),y[t].classList.remove("hidden"),y[t].removeAttribute("hidden",""),_=window.requestAnimationFrame((function(){_=window.requestAnimationFrame((function(){y[t].classList.remove("invisible"),y[t].classList.add("visible")}))})))})).on("transitionend","label",(function(t){"opacity"===t.propertyName&&t.target.classList.contains("invisible")&&(t.target.classList.add("hidden"),t.target.setAttribute("hidden",""),t.target.classList.remove("visible"))})),Ld(n,"label",(function(){var t=y.indexOf(this);t>=0&&g[t].click()})),t.events.on([cc.Ml,cc.Rl,cc.kc],x).on(cc.Il,C).on(cc.bc,(function(){k=!0,x()})).on(Ti.PLAY,(function(){h=!0})),Rl(n).on(["pointerenter","pointerleave","mouseenter","mouseleave"],(function(t){"pointerType"in t?"mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE||(d="pointerenter"===t.type||"MSPointerEnter"===t.type):d="mouseover"===t.type})),Rl(n).on("transitionend",(function(t){var e=T||n;"opacity"===t.propertyName&&e.classList.contains("invisible")&&(e.classList.add("hidden"),e.setAttribute("hidden",""),i&&e.contains(i)&&(n.classList.add("hidden"),n.setAttribute("hidden","")))})),t.events.on(cc.$c,(function(){d=!1,x()})).on(cc.Qc,(function(t){t||(E=!0)})),t.events.on([cc.Rf],(function(){p=!0,C()})).on([cc.Of],(function(){p=!1})),t.events.on(ou,(function(){m=!0,C()})).on(uu,(function(){m=!1})),t.events.on(cc.al,(function(){v=!0,d=!1,x()})).on(cc.sl,(function(){v=!1,C()})),t.events.on(cc.Cf,(function(t){b=t,t&&x()})),t.events.on([cc.Yc,cc.Vc],(function(t,n){n.isCentered()&&n.isVisible()&&(w=!0,d=!1,x()),n.isCentered()&&n.isVisible()||(w=!1,C())})),t.events.on(cc.Bl,(function(){O()})),t.events.on(Zs.Us,(function(){d=!1,k=!1,x(),h=!1,d=!1,E=!1})),t.events.fire(cc.yf),{}}function gp(t,n){var i=!0,e=!1,r=!1,o=!1,u=!1,a=!1,s=!1,c=!0,l=!1,f=!1,h=!1;function d(){i=!1,n.classList.add("invisible")}function v(){n.classList.remove("hidden"),n.removeAttribute("hidden"),setTimeout((function(){i=!0,n.classList.remove("invisible")}),0)}function p(){return r||o||u}function m(){i&&(p()||l?d():a||s&&(c&&e||d()))}function b(){var n;i||(!a||p()?c&&!f&&(l||(s||p()?(null==(n=t.config.embed)?void 0:n.settings.info_on_pause)&&c&&!p()&&v():v())):v())}function w(){var i,e;if(1===t.config.view||3===t.config.view||12===t.config.view){var r=!!t.config.embed.settings.byline,o=null!==t.config.video.owner.url,u=0===t.config.embed.on_site,a=t.config.embed.settings.spatial_label,s=t.config.request.file_codecs||t.config.video.file_codecs,c=void 0!==s,l=c&&(null==(i=s.hevc)||null==(e=i.dvh1)?void 0:e.length)>0,f={ClickTargets:$s,linkToOwner:o,ownerLink:Kd({url:t.config.video.onsite_redirect_url,embedded:!t.config.embed.on_site,ownerId:t.config.video.owner.id,element:"owner_portrait"}),targetBlank:u,showPortrait:!!t.config.embed.settings.portrait,portraitImg:t.config.video.owner[Yi.devicePixelRatio>1?"img_2x":"img"],showByline:r,portraitAlt:"Link to video owner's profile",showTitle:!!t.config.embed.settings.title,showTitleLink:null!==t.config.video.url,titleLink:Kd({url:t.config.video.onsite_redirect_url,embedded:!t.config.embed.on_site,ownerId:t.config.video.owner.id,element:"video_title"}),title:t.config.video.title,is360:t.config.video.spatial&&a,hasHDR:c&&s.hevc.hdr.length>0,hasDolbyVision:l,dolbyVisionLogo:l&&Yf.render("icon_dolby_vision"),strings:{}};if(t.config.embed.settings.byline){var h=t.config.embed.settings.byline_badge,d="";(null==h?void 0:h.type)&&(d=Yf.render("title_byline_badge",{targetBlank:u,cssClass:h.type,link:h.url||!1,displayBadge:!t.config.video.live_event})),f.strings.byline="from "+Yf.render("title_owner_byline",{ClickTargets:$s,linkToOwner:o,ownerLink:Kd({url:t.config.video.onsite_redirect_url,embedded:!t.config.embed.on_site,ownerId:t.config.video.owner.id,element:"owner_name"}),targetBlank:u,owner:t.config.video.owner.name})+d}t.config.embed.settings.badge&&(f.showPortrait=!1),t.config.embed.autoplay&&(n.classList.add("hidden"),n.setAttribute("hidden","")),n.innerHTML=Yf.render("title",f)}}return w(),t.events.on([cc.Ml,cc.Rl],m).on(cc.Il,b).on(Xo,(function(){s=!0,c=!1,m()})).on([cc.Ac,Ti.PLAY],(function(){c=!1,f=!1,m()})).on(cc.ir,(function(t,n){n||(c=!0,b())})).on(cc.vc,(function(){l=!0,m()})).on(cc.Dc,(function(){h=c,f=!0})).on(cc.jc,(function(){h&&(f=!1)})).on(cc.$c,(function(){m()})).on(cc.Qc,(function(t){t||b()})),Rl(n).on(["pointerenter","pointerleave","mouseenter","mouseleave"],(function(t){"pointerType"in t?"mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE||(e="pointerenter"===t.type||"MSPointerEnter"===t.type):e="mouseover"===t.type})),Rl(n).on("transitionend",(function(t){"opacity"===t.propertyName&&n.classList.contains("invisible")&&(n.classList.add("hidden"),n.setAttribute("hidden",""))}),!1),t.events.on(cc.vc,(function(t){m()})),t.events.on([cc.Rf],(function(){a=!0,b()})).on([cc.Of],(function(){a=!1,m()})),t.events.on(cc.al,(function(t){"not-supported"!==t&&"private-unlocked"!==t&&"help"!==t&&(r=!0,e=!1,m())})).on(cc.sl,(function(){r=!1,e=!1,setTimeout(b,0)})),t.events.on(cc.Xl,(function(t){o=!0,e=!1,m()})).on(cc.Zl,(function(){o=!1,e=!1,setTimeout(b,0)})),t.events.on([cc.Yc,cc.Vc],(function(t,n){n.isCentered()&&n.isVisible()&&(u=!0,e=!1,m()),n.isCentered()&&n.isVisible()||(u=!1,e=!1,b())})),t.events.on(cc.Bl,(function(){w(),3===t.config.view&&b()})),t.events.on(Zs.Us,(function(){s=!1,c=!0,l=!1,f=!1,b()})),t.events.fire(cc.gf),{}}function yp(t,n){function i(){n.classList.remove("hidden"),n.removeAttribute("hidden"),n.classList.remove("invisible")}function e(){Rl(n).on("transitionend",(function(){Rl(n).off("transitionend"),n.classList.contains("invisible")&&(n.classList.add("hidden"),n.setAttribute("hidden",""))})),n.classList.add("invisible")}return function(){var r=t.config.embed.settings.badge;if(r){var o=Yi.devicePixelRatio>1?"img_2x":"img";Yi.svg&&r.svg&&(o="svg"),n.innerHTML=Yf.render("badge",{showPortrait:!1,targetBlank:0===t.config.embed.on_site,badge:{link:r.link,img:r[o],margin:r.margin||!1,width:r.width,height:r.height,name:r.name,shadow:r.shadow||!1}}),Ld(n,".vp-badge",(function(){t.events.fire(cc.Kc,r.id)})),t.config.embed.autoplay?e():i()}else e()}(),{show:i,hide:e}}function _p(t,n){var i=t.events;function e(t){t.preventDefault(),i.fire(Zs.Ds,!1)}function r(){n.classList.add("invisible"),n.classList.remove("hidden"),n.removeAttribute("hidden"),setTimeout((function(){n.classList.remove("invisible")}),0),i.once(cc.pc,o)}function o(t){t>0&&!n.classList.contains("invisible")&&u()}function u(){Rl(n).on("transitionend",a),n.classList.add("invisible")}function a(){Rl(n).off("transitionend",a),n.classList.add("hidden"),n.setAttribute("hidden","")}return function(){var t={title:Yi.touch?"Tap to Unmute":"Click to Unmute"};n.innerHTML=Yf.render("unmute_button",t),Ld(n,e),Ld(n,".vp-unmute-button",e),i.once(cc.Jc,r),i.on(fu.EVENT_ENDED,u)}(),{}}function kp(t,n){var i=null,e=!1;function r(){var r=n.querySelector(".vp-badge");if(i=new yp(t,r),r.innerHTML)return 16===t.config.embed.settings.badge.id?(i.show(),void t.events.on(cc.Uc,(function(t){t?i.show():i.hide()}))):void t.events.on([cc.Ac,Ti.PLAY],(function(){e&&i.hide()})).on(Xo,(function(){e=!0,i.hide()})).on(cc.vc,i.hide).on(cc.al,(function(t){"not-supported"!==t&&"private-unlocked"!==t&&"help"!==t&&i.hide()})).on(cc.sl,(function(){e||i.show()}))}r(),function(){var i=n.querySelector(".vp-unmute");new _p(t,i)}(),t.events.on(cc.Bl,(function(){r()})),t.events.on(Zs.Us,(function(){e=!1,r()}))}var Ep=function(){function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=6,e=76,r=parseInt(e*Yi.devicePixelRatio,10),o=parseFloat(n.timecode);if(isNaN(o))throw new TypeError("Time must be a number.");if(o<0)throw new TypeError("Time must be a positive number.");this.time=o,this.data=n,this.id=n.id,this.displayTime=n.display_time||i,n.url&&(this.data.url=Yd(n.url)),n.image_url&&(n.image=Bc({width:r,height:r,baseUrl:Yd(n.image_url),crop:!0})),this.renderTemplate()}var n=t.prototype;return n.renderTemplate=function(){var t=this,n=document.createElement("div");n.innerHTML=Yf.render("card",this.data),this.element=n.children[0],this.data.image&&Hc(this.data.image).catch((function(n){t.element.querySelector(".js-cardImageWrap").style.display="none"}))},n.isActive=function(t){return t>=this.time&&t0&&void 0!==arguments[0]?arguments[0]:function(t,n){return tn?this.Qd(t,n,i,r-1):t[r]0&&t.apply(void 0,arguments)}};function c(){v(),u.forEach((function(t,n){t.element.parentNode.removeChild(t.element)})),u=new Tp,Array.isArray(t.config.embed.cards)&&t.config.embed.cards.length&&(t.config.video.title&&t.config.embed.settings.title&&l(-1,{className:"card--contentInfo",timecode:0,headline:t.config.video.title,teaser:t.config.embed.settings.byline?t.config.video.owner.name:"",image:t.config.video.owner[Yi.devicePixelRatio>1?"img_2x":"img"],id:"title-card"}),t.config.embed.cards.forEach((function(t){l(t.timecode,t)})))}function l(i,e){var r=u.get(i),a=new Ep(t,e);if(u.set(i,a),r)return o.replaceChild(a.element,r.element),a;var s=u.keys().indexOf(i);return o.insertBefore(a.element,o.children[s]),n.dispatch(function(t){return{type:"CARDS_SET_SIZE",payload:t}}(u.size)),a}function f(n){t.element.classList.toggle("player-cardsCarousel",n),t.element.classList.toggle("player-cardsCorner",!n),e.destroy(),n&&e.setUp()}function h(n,i){n&&(i?n.element.classList.add("card-animating"):n.element.classList.remove("card-animating"),n.element.classList.add("card-active"),Rl(n.element.childNodes[1]).on("mouseover",(function(){a=!0})),Rl(n.element.childNodes[1]).on("mouseout",(function(){a=!1})),e.show(n.element),t.events.fire(cc.vf,n.id,n.data))}function d(t){a||t.classList.remove("card-active")}function v(){F(i.querySelectorAll(".card-active")).forEach(d)}return e=new Fd(o),n.watch("ui.cards.size",(function(n){t.element.classList.toggle("player-withCards",n>0)})),n.watch("ui.cards.isCarouselVisible",f),n.watch("ui.cards.isCardsThumbVisible",(function(t){i.classList.toggle("cards-wrapper--withThumbnails",t)})),f(n.get("ui.cards.isCarouselVisible")),t.events.on(cc.Bl,c),t.events.on(Zs._addCard,(function(t){var n=l(t.timecode,t);v(),h(n)})),t.events.on(Zs._removeCard,(function(t){v();var n=u.get(t.timecode).element;n.parentNode.removeChild(n),u.delete(t.timecode)})),e.on("slide",s((function(n){var i=u.values()[n];"title-card"!==i.id&&t.events.fire(cc.vf,i.id,i.data),t.events.fire(Zs.oc,i.time)}))),e.on("tap",s((function(n){var i=u.values()[n];i.data.url&&"title-card"!==i.id&&(t.events.fire(cc.pf,i.id,i.data),t.backbone.paused||t.events.fire(cc.Sc),window.open(i.data.url))}))),t.events.on(Ti.TIME_UPDATE,s((function(t){var i=function(t){var i=u.values().filter((function(n){return n.isActive(t)})).slice(-1)[0];if(i)return i;if(n.get("ui.cards.isCarouselVisible")){var e=u.values().slice(-1)[0];if(e&&t>e.end)return e}return null}(t.currentTime);i!==r&&(!i&&a||(a=!1,v(),(r=i)&&"title-card"===r.id?n.get("ui.cards.isCarouselVisible")&&h(r,!0):h(r,!0)))}))),t.events.on(cc.vc,s(v)),Ld(document,".player-cardsCorner .card",s((function(n){n.preventDefault();var i=Bs(n.target,o.children),e=u.values()[i];e.data.url&&"title-card"!==e.id&&(t.events.fire(cc.pf,e.id,e.data),t.backbone.paused||t.events.fire(cc.Sc),window.open(e.data.url))}))),c(),{}}var Ap={16:"shift",27:"esc",32:"space",37:"left",38:"up",39:"right",40:"down"};function xp(t,n,i){var e,r=!!t.config.embed.on_site,o=i.querySelector(".volume"),u=!1,a=null,s=t.config.video.fps/5,c=Math.max(s,.618*t.config.video.duration),l=s,f=0,h=!1,d=ah(g,80);function v(){return!r&&(1===t.config.view||3===t.config.view||12===t.config.view)}function p(){u&&"help"===e&&t.events.fire(cc.ll)}function m(t){return"number"!=typeof t.which&&(t.which=t.keyCode),t}function b(t){if("keypress"===t.type){var n=String.fromCharCode(t.which);return t.shiftKey||(n=n.toLowerCase()),n}return t.which in Ap?Ap[t.which]:String.fromCharCode(t.which).toLowerCase()}function w(n){if(t.config.embed.settings.background)return!0;var i=n.target||n.srcElement;return"INPUT"===i.tagName||"SELECT"===i.tagName||"TEXTAREA"===i.tagName||i.isContentEditable}function g(i,e){if(!n.get(nl)){h||(e&&!t.backbone.paused&&t.events.fire(cc.Sc),t.events.fire(cc.Dc,!0,"keyboard"),h=!0),!function(t){var n=t,i=Math.ceil(s),e=Math.ceil(c-s);l=function(t,n,i,e){return t/=100,i*(--t*t*t+1)+n}(n,i,e)}(f),1==++f&&(l=5*t.config.video.fps);var r=e?1:l,o="right"===i?r:-r;!function(n){var i=n/t.config.video.fps;t.events.fire(Zs.Os,null,i)}(Math["right"===i?"ceil":"floor"](t.currentTime*t.config.video.fps)+o)}}function y(t){var n=a.getTabindexItems(),i=n.indexOf(document.activeElement),e="up"===t?i-1:i+1,r=null;return!(r=e>=n.length?n[0]:e<0?n[n.length-1]:n[e])||(r.focus(),!1)}function _(){if(a)return!0;if(n.get(nl)&&!n.get(al))return!0;if(!document.activeElement||document.activeElement===document.body){var i=t.backbone.paused?cc.Ac:cc.Sc;return t.events.fire(i),p(),!1}}function k(){return a?(a.element.contains(document.activeElement)&&a.button.focus(),a.hide(),!1):u?(t.events.fire(cc.ll),!1):void 0}function E(){return a?!a.element.contains(document.activeElement)||y("up"):Yi.spatialPlayback&&t.config.video.spatial?(t.backbone.getEffectByName("ThreeSixtyEffect").keyPress("up"),!1):!(!t.config.embed.on_site||!document.activeElement||i.contains(document.activeElement))||(p(),t.events.fire(Zs.Ls,.05,!1,!0),!1)}function T(){return a?!a.element.contains(document.activeElement)||y("down"):Yi.spatialPlayback&&t.config.video.spatial?(t.backbone.getEffectByName("ThreeSixtyEffect").keyPress("down"),!1):!(!t.config.embed.on_site||!document.activeElement||i.contains(document.activeElement))||(p(),t.events.fire(Zs.Ls,-.05,!1,!0),!1)}function S(n,i){if(a)return!a.element.contains(document.activeElement)||y("left"===i?"up":"down");if(p(),Yi.spatialPlayback&&t.config.video.spatial)return t.backbone.getEffectByName("ThreeSixtyEffect").keyPress(i),!1;if(document.activeElement&&document.activeElement===o){var e="left"===i?-.05:.05;return t.events.fire(Zs.Ls,e,!1,!0),!1}n.shiftKey||0===f?g(i,n.shiftKey):d(i,n.shiftKey)}return t.events.on(cc.al,(function(t){u=!0,e=t,"not-supported"!==t&&"email-capture"!==t||(r=!0)})),t.events.on(cc.sl,(function(){u=!1,e=null})),t.events.on(cc.Vc,(function(t,n){t||a!==n?t&&(a=n):a=null})),t.events.on(cc.Bl,(function(t){t&&(r=!1)})),function(){var i={l:cc.tl,w:cc.nl,s:cc.il,c:[cc.Cc,!0],h:[cc.xc,!0],f:cc.Tc,d:cc.bl,space:_,up:E,down:T,left:S,right:S,esc:k,"?":[Zs._showOverlay,"help"]};function r(n){if(m(n),function(t){return!(t.ctrlKey||t.metaKey||t.altKey)&&(t.which in Ap?"keydown"===t.type:"keypress"===t.type)}(n)&&!w(n)&&v()){var r=b(n);if(r in i){if("function"==typeof i[r])return void(!1===i[r](n,r)&&(n.preventDefault(),n.stopPropagation()));!1===function(n){if(n=Array.isArray(n)?n:[n],u&&"help"===e){if(t.events.fire(cc.ll),n[0]===Zs._showOverlay&&"help"===n[1])return!1;if(n[0]!==Zs.Bs)return setTimeout((function(){t.events.fire.apply(null,n)}),250),!1}return t.events.fire.apply(null,n),!1}(i[r])&&(n.preventDefault(),n.stopPropagation())}}}t.config.embed.on_site||(i.v=Zs.Bs),t.config.embed.keyboard&&(document.addEventListener("keydown",r,!1),document.addEventListener("keypress",r,!1),document.addEventListener("keyup",(function(i){if(m(i),!w(i)&&v()){var e=b(i);!Yi.spatialPlayback||!t.config.video.spatial||"left"!==e&&"right"!==e&&"up"!==e&&"down"!==e?n.get(nl)||"left"!==e&&"right"!==e||function(n){l=s,f=0;var i=n.shiftKey;t.events.fire(cc.jc,i),h=!1}(i):t.backbone.getEffectByName("ThreeSixtyEffect").keyUp(e)}}),!1))}(),t.events.on(cc.tf,(function(){r=!1})).on(cc.nf,(function(){r=!0})),t.config.embed.on_site&&document.querySelector(".player")===i&&(r=!1),function(){var t,n=!1;document.body.addEventListener("keyup",(function(t){9!==t.which||document.body.classList.contains("showfocus")||document.body.classList.add("showfocus")})),document.body.addEventListener("keydown",(function(i){32!==i.which&&13!==i.which||(n=!0,clearTimeout(t),t=setTimeout((function(){n=!1}),200))})),document.body.addEventListener("click",(function(t){n||document.body.classList.remove("showfocus")}))}(),{pause:function(){r=!0},unpause:function(){r=!1}}}function Cp(){}var Mp=function(){function t(t,n){this.$f=t,this.tv=n,this.nv=!1,this.ys=!1,this._s()}var n=t.prototype;return n.disable=function(){this.ys=!0},n.iv=function(){this.$f.backbone.endLive(),this.$f.events.fire(cc.Wf),this.$f.events.fire(Zs._showOverlay,"webinar-blocked"),this.nv=!0},n.ev=function(){this.$f.backbone.reactivate(),this.$f.events.fire(cc.zf),this.$f.events.fire(Zs._hideOverlay,{unmakeModal:!0}),this.nv=!1},n.rv=function(){try{var t=this,n=t.$f.config.video.webinar.id,i=t.tv.get(Bl),e="https://".concat(t.$f.config.player_url,"/video/").concat(t.$f.config.video.id,"/webinar/").concat(n,"/registrant/").concat(i,"/status");return function(t){if(t&&t.then)return t.then(Cp)}(function(n,i){try{var o=function(t,n,i){return t&&t.then||(t=r.resolve(t)),n?t.then(n):t}(tr(e,{withCredentials:!0}).json(),(function(n){n.is_blocked&&!t.nv?t.iv():t.nv&&!n.is_blocked&&t.ev()}))}catch(t){return i(t)}return o&&o.then?o.then(void 0,i):o}(0,(function(t){Dc.captureException(t)})))}catch(t){return r.reject(t)}},n.Ts=function(){return!!(this.$f.config.video.webinar&&this.$f.config.video.webinar.id&&"ended"!==this.$f.config.video.webinar.status&&this.tv.get(Bl))},n._s=function(){this.ys||(this.Ts()&&this.rv(),setTimeout(this._s.bind(this),this.nv?6e4:3e4))},t}(),Ip=function(){function t(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.displayTimeout,e=void 0===i?0:i,r=n.label,o=void 0===r?"Alert":r;rt(this),this.ov=t,this.av=!1,this.sv=null,this.cv=null,this.lv=o;var u=Math.round(e/1e3);0!==u&&(this.lv="".concat(o," Will be dismissed in ").concat(u," seconds")),this.fv=null,this.hv=e,this.dv(),this.Rn()}var n=t.prototype;return n.show=function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.hv;if(!0!==this.av){clearTimeout(this.fv),this.cv.classList.remove("hidden"),this.cv.removeAttribute("hidden"),window.requestAnimationFrame((function(){n.cv.classList.add("in")}));var e=this.cv.querySelector("[data-alert-autofocus]")||this.cv;e.focus(),this.av=!0,this.fire("show",t),0!==i&&(this.fv=setTimeout((function(){n.hide("timeout")}),i))}},n.hide=function(t){var n=this;!1!==this.av&&(clearTimeout(this.fv),this.cv.classList.add("leaving"),window.requestAnimationFrame((function(){var t=n;n.vv(),Rl(n.cv).on("transitionend",(function n(i){"opacity"===i.propertyName&&(t.cv.classList.remove("leaving"),t.cv.classList.add("hidden"),t.cv.setAttribute("hidden",""),Rl(t.cv).off("transitionend",n))}))})),this.av=!1,this.fire("hide",t))},n.vv=function(){this.cv.classList.remove("in")},n.dv=function(){this.cv||(this.cv=document.createElement("div"),this.cv.classList.add("vp-alert"),this.cv.setAttribute("role","alertdialog"),this.cv.setAttribute("aria-atomic","true"),this.cv.classList.add("hidden"),this.cv.setAttribute("hidden",""),this.ov.appendChild(this.cv),this.vv()),this.sv instanceof HTMLElement?(this.cv.innerHTML="",this.cv.appendChild(this.sv)):(this.cv.textContent=this.sv,this.cv.innerHTML=this.sv);var t=document.createElement("button");t.setAttribute("data-close",""),t.setAttribute("aria-label","Close alert"),t.classList.add("close"),t.innerHTML=Yf.render("icon_close"),this.cv.appendChild(t)},n.Rn=function(){var t=this;Rl(this.cv).on("click","[data-close]",(function(n){t.hide(n)}))},H(t,[{key:"visible",get:function(){return this.av}},{key:"message",get:function(){return this.sv},set:function(t){t instanceof HTMLElement&&this.sv&&t.textContent===this.sv.textContent||t!==this.sv&&(this.sv=t,this.dv())}}]),t}(),Rp=function(){function t(t,n,i){this.player=t,this.backbone=n,this.isBufferingTooLong=!1,this.isBufferingTooFrequent=!1,this.autoAlertWasDismissed=!1,this.bufferCount=-1,this.badPlaybackTimer=null,this.pv(i),this.Rh()}var n=t.prototype;return n.handleBufferStarted=function(){this.bufferCount+=1,this.mv()},n.handleBufferEnded=function(){clearTimeout(this.badPlaybackTimer),this.badPlaybackTimer=null,this.isBufferingTooLong=!1},n.Rh=function(){var t=this;this.player.events.on(cc.Cl,(function(){t.bv()})),this.player.events.on(Js.Is,(function(n){t.wv(n)})),this.player.events.on(Js.Rs,(function(n){t.gv(n)})),this.player.events.on(Js.Ms,this.handleBufferStarted.bind(this)),this.player.events.on(xi.BUFFER_ENDED,this.handleBufferEnded.bind(this)),this.player.events.on(Js.Cs,(function(){t.autoAlertWasDismissed||(t.showAlert("stream_studder"),Dc.captureBreadcrumb("Alert shown",{message:"stream_studder"},"video"))})),this.player.events.on(cc.mc,(function(n){"auto"===n&&t.alertUI.hide("qualitymenuauto")}))},n.wv=function(t){t||this.showAlert("warning_alert",{strings:{text:'See a list of browsers that support 360 viewing.'}})},n.bv=function(){this.showAlert("notice",{strings:{text:"Debug Payload Copied"}},5e3)},n.gv=function(t){t||this.showAlert("warning_alert",{strings:{text:'Looking to watch a 360 video? See supported browsers and settings .'}})},n.showAlert=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0;this.alertUI&&!this.player.config.embed.settings.background&&(this.alertUI.message=Yf.render(t,n),this.alertUI.show(null,i))},n.pv=function(t){var n=this;this.alertUI=new Ip(t,{displayTimeout:1e3}),this.alertUI.on("show",(function(t){n.player.events.fire(cc.Cf,!0,t)})),this.alertUI.on("hide",(function(t){var i=t.target,e=i&&"function"==typeof i.getAttribute;if(e)switch(i.getAttribute("data-context")){case"suggestion":n.player.events.fire(Zs.Vs,"auto"),t="suggestion";break;default:t="close"}(e||"qualitymenuauto"===t)&&(n.autoAlertWasDismissed=!0),n.player.events.fire(cc.Cf,!1,t)}))},n.mv=function(){var t=this;null===this.badPlaybackTimer&&0!==this.bufferCount&&(this.badPlaybackTimer=setTimeout((function(){t.isBufferingTooLong=!0,t.yv()}),1e4))},n.yv=function(){"MediaSourceScanner"===this.backbone.currentScannerName&&(this.isBufferingTooLong||this.isBufferingTooFrequent)&&(this.backbone.video.currentFile.restrictedStreamIndexes.length<=0||(this.isBufferingTooLong,this.isBufferingTooFrequent,this.player.events.fire(Js.Cs),this.bufferCount=0,this.badPlaybackTimer=null,this.isBufferingTooFrequent=!1,this.isBufferingTooLong=!1))},t}();function Op(t,n,i){return i?n?n(t):t:(t&&t.then||(t=r.resolve(t)),n?t.then(n):t)}function Lp(t,n){try{var i=t()}catch(t){return n(t)}return i&&i.then?i.then(void 0,n):i}function Dp(){}var jp=function(){function t(t,n){this.$f=t,this.tv=n,this._v=0,this.kv()}var n=t.prototype;return n.Ev=function(){this.tv.get(al)&&(this.$f.element.querySelector(".vp-live-viewer-status-wrapper")||(this.od=document.createElement("div"),this.od.classList.add("vp-live-viewer-status-wrapper","invisible"),this.od.innerHTML=Yf.render("live_status"),this.od.querySelector(".vp-live-status-circle").classList.remove("offline"),this.$f.element.querySelector(".vp-controls-wrapper").appendChild(this.od)))},n.Tv=function(){var t=this.$f.element.querySelector(".vp-live-viewer-status-wrapper");t&&this.$f.element.querySelector(".vp-controls-wrapper").removeChild(t)},n.kv=function(){var t=this;this.tv.watch(ll,(function(){return t.Tv()})),this.$f.events.on(cc.Bl,(function(){t.$f.config.video.live_event?t.Ev():t.Tv()})),this.$f.events.on(fu.STREAM_ONLINE,(function(){t.Ev(),t.Sv()})),this.$f.events.on(cc.Uc,(function(n){var i;null==(i=t.od)||i.classList.toggle("invisible",n)})),this.$f.events.on(cc.Wf,(function(){t.$f.config.video.webinar&&t.Tv()})),this.$f.events.on(cc.zf,(function(){t.$f.config.video.webinar&&t.Ev()}))},n.Sv=function(){try{var t=this;if(!t.tv.get(al)||!t.$f.config.video.live_event.show_viewer_count)return;var n=setTimeout((function(){t.Sv()}),3e4),i="".concat(t.$f.config.video.id);"unlisted"===t.$f.config.video.privacy&&(i+=":".concat(t.$f.config.video.unlisted_hash));var e="https://".concat(t.$f.config.vimeo_api_url,"/videos/").concat(i,"/stats/live"),o={jwt_token:t.$f.config.user.vimeo_bucketed_live_client_token};return Np(Lp((function(){return Op(t.$f.updatePhpTokens(),(function(){return Np(Lp((function(){return Op(tr({url:e,searchParams:o}).json(),(function(n){n.viewers?(t._v=0,t.Av(n.viewers.current)):t._v++}))}),(function(){t._v++,t.xv()&&clearTimeout(n)})))}))}),(function(i){Dc.captureException(i),t._v++,t.xv()&&clearTimeout(n)})))}catch(t){return r.reject(t)}},n.Av=function(t){this.$f.config.video.live_event.show_viewer_count&&(this.od.querySelector(".vp-live-viewer-count")||(this.$f.element.querySelector(".vp-live-viewer-count").style.display="block",this.od.innerHTML+=Yf.render("live_viewer_count")),F(this.$f.element.querySelectorAll(".vp-live-viewer-count-value")).forEach((function(n){return n.innerHTML=function(t){return t=parseFloat(t),isNaN(t)||t<0?"0":t<1e3?t.toString():t>=1e3&&t<1e6?Math.floor(t/1e3)+"."+Math.round(t%1e3/100)+"k":Math.floor(t/1e6)+"."+Math.round(t%1e6/1e5)+"m"}(t)})))},n.xv=function(){return this._v>3&&(F(this.$f.element.querySelectorAll(".vp-live-viewer-count")).forEach((function(t){return t.classList.add("hidden")})),!0)},t}();function Np(t){if(t&&t.then)return t.then(Dp)}t.BigScreen=nd,t.VimeoPlayer=function(t,n,i,e){Yf.helpers=bp;var o=function(t){if(!0===t)return r.resolve(null);var n=!1;return new r((function(i,e){t.link.addEventListener("load",(function(){if(!n){n=!0;var e=(new Date).getTime()-t.startTime;setTimeout((function(){return i(e)}),100)}}),!1)}))}(i),u=new Od({element:t,delegate:e,cssLoadedPromise:o}),a=u.store;t.classList.add("js-player-fullscreen");var s=u.expose,c=null,l=null,f=null,h=null,d=null,v=null,p=null,m=null,b=t.querySelector(".vp-controls"),w=t.querySelector(".vp-sidedock"),g=t.querySelector(".vp-title"),y=t.querySelector(".vp-cards-wrapper"),_=Yi.mobileAndroid||Yi.iPhone||Yi.windowsPhone||Yi.browser.bb10,k={tiny:cc.zl,mini:cc.Gl,normal:cc.Yl,none:cc.Yl};function E(n){n&&void 0!==k[n]&&(u.events.fire(k[n]),t.classList.toggle("player-normal","normal"===n),t.classList.toggle("player-mini","mini"===n),t.classList.toggle("player-tiny","tiny"===n))}function T(n){Object.keys(Ef).forEach((function(i){return t.classList.toggle("player-".concat(i),n===i)}))}function S(){var n=u.config.embed.settings,i=(1===u.config.view||u.config.view,n&&!n.playbar);t.classList.toggle("no-playbar",i),t.classList.toggle("with-fullscreen",!!n.fullscreen);var e=n.custom_logo;t.classList.toggle("with-custom-logo",!!e),t.classList.toggle("with-sticky-custom-logo",e&&e.sticky),t.classList.toggle("hide-controls-mode",!!n.background||0===n.controls),t.classList.toggle("touch-support",Yi.touch)}function A(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.config.video.url;if(!(!n||t&&t.metaKey)){if(-1===n.indexOf("#")&&u.backbone.currentTime>0&&u.backbone.currentTime0&&window.innerHeight>0?t():i=setTimeout(n,250)};u.events.once(cc.ye,e),u.events.once(cc.cc,e)})),function(){var t=function(t,n){return u.verifyConfig().then((function(){var i=u.config.request,e=i.signature,r=i.session,o=i.timestamp,a=i.expires;return tr("https://".concat(u.config.player_url,"/video/").concat(u.config.video.id,"/").concat(t,"?signature=").concat(e,"&session=").concat(r,"&time=").concat(o,"&expires=").concat(a),{method:n,withCredentials:!0})})).catch((function(i){Dc.captureException(i,{extra:{action:t,method:n}})}))},n=function(t,n){return u.updatePhpTokens().then((function(){var i="following"===t?u.config.video.owner.id:u.config.video.id,e=u.config.user.vimeo_api_interaction_tokens,r="";if(e)switch(r="?auth=",t){case"likes":r+=e.likes;break;case"watchlater":r+=e.watch_later;break;case"following":r+=e.following}var o=u.config.video.unlisted_hash&&"following"!==t?":".concat(u.config.video.unlisted_hash):"";return tr("https://".concat(u.config.vimeo_api_url,"/users/").concat(u.config.user.id,"/").concat(t,"/").concat(i).concat(o).concat(r),{method:n,jwt:u.config.user.vimeo_api_client_token}).catch((function(i){Dc.captureException(i,{extra:{action:t,method:n}})}))})).catch((function(t){Dc.captureException(t)}))};u.events.on(cc.rl,(function(t){if(u.config.user.purchased)return!u.config.video.vod.is_feature&&u.config.video.vod.feature_id?void u.loadVideo(u.config.video.vod.feature_id).then((function(){return u.events.fire(cc.Ac),u.config.video.vod.feature_id})).catch((function(t){Dc.captureException(t),u.events.fire(Zs._showOverlay,"error",{title:"Sorry",message:"There was a problem. Please try again."})})):void u.events.fire(cc.Ac);u.config.video.vod&&u.config.video.vod.is_coming_soon?A(null,u.config.video.vod.url):u.performDelegateAction(ec,(function(){u.events.fire(Zs.Ps,"purchase",{productId:t})}),[t])})),u.events.on(cc.tl,(function(){u.config.user.logged_in?u.config.user.id!==u.config.video.owner.id&&(u.config.user.liked?u.performDelegateAction(tc,(function(){"disable"!==u.config.video.privacy?n("likes","DELETE"):t("like","DELETE"),u.config.user.liked=!1,u.events.fire(cc.Ll)})):u.performDelegateAction(Qs,(function(){"disable"!==u.config.video.privacy?n("likes","PUT"):t("like","PUT"),u.config.user.liked=!0,u.events.fire(cc.Ol)}))):u.performDelegateAction(oc,(function(){u.events.fire(Zs.Ps,"login-like")}))})),u.events.on(cc.nl,(function(){(u.config.video.url||"unlisted"===u.config.video.privacy)&&(u.config.user.logged_in?u.config.user.watch_later?u.performDelegateAction(ic,(function(){n("watchlater","DELETE"),u.config.user.watch_later=!1,u.events.fire(cc.jl)})):u.performDelegateAction(nc,(function(){n("watchlater","PUT"),u.config.user.watch_later=!0,u.events.fire(cc.Dl)})):u.performDelegateAction(oc,(function(){u.events.fire(Zs.Ps,"login-watch-later")})))})),u.events.on(cc.ol,(function(){u.performDelegateAction(uc,(function(){u.config.video.vod&&u.config.video.vod.url?A(null,"".concat(u.config.video.vod.url,"#collections")):u.config.video.url&&A(null,"".concat(u.config.video.url,"#collections"))}))})),u.events.on(cc.il,(function(){var t=u.config.embed.settings.share&&u.config.embed.settings.share.embed_only,n=function(){u.events.fire(Zs._showOverlay,"share",t)};nd.element?n():u.performDelegateAction(rc,n)})),u.events.on(cc.el,(function(){u.config.embed.settings.share.embed_only&&u.performDelegateAction(rc,(function(){u.events.fire(Zs._showOverlay,"share",!0)}))})),u.events.on(cc.ul,(function(){if(u.config.user.logged_in&&u.config.user.id!==u.config.video.owner.id){if(u.config.user.following)return n("following","DELETE"),u.config.user.following=!1,void u.events.fire(cc.ff);n("following","PUT"),u.config.user.following=!0,u.events.fire(cc.lf)}}))}(),u.events.on(cc.hc,(function(){t.classList.add("player-ad")})),u.events.on([cc.dc,Zs.Us],(function(){t.classList.remove("player-ad")})),function(){var n=function(){return function(t,n,i){return t&&t.then||(t=r.resolve(t)),n?t.then(n):t}(v,(function(){var n=function(){var n=Ms(t),i=n.width,e=n.height;return _?e<=200?"10px":i<450?"12px":i<=1024?"11px":"10px":"10px"}();b.style.fontSize=n,w.style.fontSize=n,g.style.fontSize=n}))};u.events.on(cc.Xc,n),u.events.on(cc.Qc,n),window.addEventListener("orientationchange",n),_&&(t.classList.add("mobile"),n())}(),x(),C(),function(){function n(){var n=t;if(e&&e.getFullscreenElement&&"function"==typeof e.getFullscreenElement){var i=e.getFullscreenElement();i&&i instanceof HTMLElement&&i.contains(t)&&i.classList.contains("js-player-fullscreen")&&(n=i)}return n}u.config.embed.fullscreen=!0,Yi.iPad&&t.classList.add("no-fullscreen-api-support");var i=u.config.embed.playsinline&&Yi.iOS>=10,r=Yi.iPad||i;nd.enabled||r||(t.classList.add("no-fullscreen-support"),Yi.iOS||(u.config.embed.fullscreen=!1));var o=!1,a=!1,s=!1;u.events.on([ou,uu],(function(){s=!0})),u.events.on(Zs.Ys,(function(){nd.enabled||nd.videoEnabled(t)?(u.events.fire(cc.$c),a=!1,nd.request(n())):u.events.fire(Zs.Xs,!0)})),u.events.on(cc.Tc,(function(){"picture-in-picture"===u.backbone.presentationMode&&u.events.fire(Zs.nc),nd.element?(u.events.fire(cc.Zc),nd.exit()):(u.events.fire(cc.$c),a=!0,nd.request(n()))}));var c=nd.onenter,l=nd.onexit;if(nd.onenter=function(t){o||(n().contains(t)?function(t,i){s?s=!1:o||(o=!0,u.events.fire(cc.Xc,n()===t,a))}(t):"function"==typeof c&&c(t))},nd.onexit=function(){o?s?s=!1:o&&(o=!1,u.events.fire(cc.Qc,a),a||u.events.fire(Zs.Xs,!1),a=!1):"function"==typeof l&&l()},Rl(t).on("click","a",(function(t){nd.element===n()&&nd.exit()})),Rl(t).on("gestureend",(function(t){t.scale>1&&u.events.fire(cc.Tc)})),"undefined"!=typeof MSGesture){var f=1,h=new MSGesture;h.target=t,Rl(t).on("pointerdown",(function(t){h.addPointer(t.pointerId)})).on(["MSGestureChange"],(function(t){f*=t.scale})).on(["MSGestureEnd"],(function(){(!o&&f>=2||o&&f<1)&&u.events.fire(cc.Tc),f=1}))}}(),function(){var n=Kd({url:u.config.video.onsite_redirect_url,embedded:!u.config.embed.on_site,ownerId:u.config.video.owner.id,element:"vimeo_logo"});Ld(t,"a[data-clip-link]",(function(t){return A(t,n)})),u.events.on(Zs.Bs,A)}(),Ld(t,"[data-track-click]",(function(t){var n=t.target.dataset.trackClick;u.events.fire(cc.gc,n)})),M(),u.config.video.webinar?m=new Mp(u,a):m&&(m.disable(),m=null),u.events.on(cc.Bl,(function(){S(),M()})),u.events.on(Zs.ac,(function(){p.disable()}))}function R(){c||(c=new Bv(u,a,t.querySelector(".vp-overlay-wrapper")))}function O(){l||(l=new fp(u,{uuid:u.uuid,id:t.id,isMobileDevice:!1}))}function L(){f||(f=new hp(u))}var D={initializationHandler:function(){return function(){R(),O(),L(),new iv(u,a,b),new rv(u,a,t);var n=new xp(u,a,t);new lv(u,t.querySelector(".vp-notification-wrapper")),new hv(u,a,t.querySelector(".vp-outro-wrapper")),new wp(u,w),new gp(u,g),new kp(u,t),Object.defineProperties(s,{pauseKeyboard:{enumerable:!0,value:n.pause},unpauseKeyboard:{enumerable:!0,value:n.unpause}})}(),I(),r.resolve()},postInitializationHandler:function(){return u.backbone&&(new av(t.querySelector(".vp-stats-debug"),u),new Sp(u,a,y),new Rp(u,u.backbone,t)),r.resolve()},authorizationHandler:function(t){var n;C(),x(),t(),R(),O();var i="Error",e="Unhandled video privacy";switch(u.config.view){case 4:return new r((function(t,n){u.events.fire(Zs._showOverlay,"password"),u.events.once(cc.ql,(function(n){t(n)}))}));case 2:L();var o="private-locked",a=null;return u.config.user.logged_in&&(o="error",a={title:"Private Video",message:"Sorry, you don’t have permission to watch.",modal:!0,logo:!!u.config.embed.settings.logo,icon:"lock"}),u.events.fire(Zs._showOverlay,o,a),r.reject();case 7:i=u.config.title,e=u.config.message;break;case 10:return L(),u.events.fire(Zs._showOverlay,"webinar-confirmation"),r.reject();case 11:if(null==(n=u.config.video.webinar)?void 0:n.registration_form)return new r((function(t,n){u.events.fire(Zs._showOverlay,"email-capture"),u.events.once(cc.uf,(function(n){t(n)}))}))}return u.events.fire(Zs._showOverlay,"error",{title:i,message:e,modal:!0}),r.reject()}};return u.init(n,D).then((function(){return 3!==u.config.view||u.config.embed.autoplay||u.events.fire(Zs._showOverlay,"private-unlocked"),!0})).catch((function(n){Dc.captureException(n),R(),O(),t.classList.remove("loading"),u.events.fire(cc.cc,gc.id,gc)})),s},t.requestModule=cr,Object.defineProperty(t,"wh",{value:!0})}(this.window=this.window||{});