/* VimeoPlayer - v2.42.1 - 2016-12-01 */ /* VimeoPlayer - v2.42.1 - 2016-12-01 - https://player.vimeo.com/NOTICE.txt */ var VimeoPlayer=function(){"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function t(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e,t){var n=arguments.length<=2||void 0===arguments[2]?document.styleSheets[0]:arguments[2];try{n.insertRule?n.insertRule(e+"{"+t+"}",(n.cssRules||n.rules).length):n.addRule(e,t)}catch(e){}}function i(e){if(e&&e.detail>0)try{document.activeElement.blur()}catch(e){}}function r(e){var t=e.getBoundingClientRect();return document.msFullscreenElement&&window.parent!==window&&(t={bottom:100*t.bottom,left:100*t.left,top:100*t.top,right:100*t.right,width:100*t.width,height:100*t.height}),t}function o(e){try{return new URL(e).origin}catch(e){}var t=document.createElement("a");return t.href=e,t.origin?t.origin:t.protocol.replace(":","")+"://"+t.host}function a(e){var t=e.width,n=e.height,i=e.elementWidth,r=e.elementHeight,o=e.threshold,a=void 0===o?10:o,s=1,c=t/n,u=i-r*c,l=r-i/c;if(u>0&&u0&&ln?n:t>e?t:e}function c(e){if(e===!0)return je.resolve(null);var t=!1;return new je(function(n,i){var r=function(){t||!function(){t=!0;var i=(new Date).getTime()-e.startTime;setTimeout(function(){return n(i)},100)}()};e.link.addEventListener("load",r,!1)})}function u(e,t,n){var i=n.width,r=n.height,o=n.scrollbars,a=void 0===o?"yes":o,s=n.resizable,c=void 0===s?"yes":s,u=n.toolbar,l=void 0===u?"no":u,d=(window.screenY||window.screenTop||0)+window.outerHeight/2-r/2,f=(window.screenX||window.screenLeft||0)+window.outerWidth/2-i/2;window.chrome&&window.navigator.userAgent.toLowerCase().indexOf("mac os x")!==-1&&(r+=27),window.safari&&(r+=47);var h="scrollbars="+a+",resizable="+c+",toolbar="+l;return window.open(e,t,"width="+i+",height="+r+",left="+f+",top="+d+","+h)}function l(e){var t=e.match(/\ba?t=([0-9hms:]+)/);null!==t&&(e=t[1]);var n=!1,i=0,r=0,o=0;if(t=e.match(/^([0-9]+)$/),t&&t.length&&(n=!0,o=t[1]),n===!1&&(t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s)?/),null!==t&&""!==t[0])){n=!0;var a=t,s=Qe(a,4),c=s[1];i=void 0===c?0:c;var u=s[2];r=void 0===u?0:u;var l=s[3];o=void 0===l?0:l}if(n===!1&&(t=e.match(/^([0-9:]+)/),null!==t)){n=!0;var d=e.split(":").reverse(),f=Qe(d,3);o=f[0];var h=f[1];r=void 0===h?0:h;var p=f[2];i=void 0===p?0:p}return n?60*parseInt(i,10)*60+60*parseInt(r,10)+parseInt(o,10):null}function d(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.method,i=void 0===n?"GET":n,r=t.withCredentials,o=void 0===r||r,a=t.allowErrorStatuses,s=void 0!==a&&a;return new je(function(t,n){var r=new XMLHttpRequest;r.open(i,e,!0),o&&(r.withCredentials=!0),r.onload=function(){return r.status>=400&&!s?void n(r.status):void t(r.responseText)},r.onerror=function(){return n(new Error("The request failed."))},r.send()})}function f(e){for(var t,n,i=(e||document).querySelectorAll("[tabindex]"),r=[],o=0,a=0,s=i.length;a0&&"none"!==n.display&&n.opacity>0&&"hidden"!==n.visibility&&(r[o++]=t);var c=r.shift();c&&(c.focus(),c.blur())}function h(e,t){if(e=parseFloat(e),isNaN(e))return 0;var n=Math.pow(10,t||3);return Math.round(e*n)/n}function p(e,t){var n,i,r,o,a=0,s=function(){a=new Date,r=null,o=e.apply(n,i)};return function(){var c=new Date,u=t-(c-a);return n=this,i=arguments,u<=0?(clearTimeout(r),r=null,a=c,o=e.apply(n,i)):r||(r=setTimeout(s,u)),o}}function v(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^16*Math.random()>>e/4).toString(16)})}function m(e,t,n,i){var r=i[t];return r=y(e,r),r=g(r,n,i.prices),i.expires_in_duration_str&&(r=r.replace("{TIME}",i.expires_in_duration_str)),i.available_on_formatted&&(r=r.replace("{DATE}",i.available_on_formatted)),r}function g(e,t,n){var i=n.USD;return t in n&&(i=n[t]),e.indexOf("${price}")!==-1?e.replace("${price}",i):e.indexOf("{PRICE}")!==-1?e.replace("{PRICE}",i):e}function _(e,t){return!e||0===e.length||e.indexOf(t)!==-1}function y(e,t){return"undefined"!=typeof e&&"undefined"!=typeof e[t]?e[t]:t}function b(e,t,n,i){return!i.relatedTarget||(!n||e===t)&&(t!==i.relatedTarget&&!t.contains(i.relatedTarget))}function w(e,t,n,i){var r=!1;i="function"==typeof t?n:i,n="function"==typeof t?t:n,t="function"==typeof t?null:t;var o=function(e){var t=!0;if(e.changedTouches){var o=e.changedTouches[0].pageX-window.pageXOffset,a=e.changedTouches[0].pageY-window.pageYOffset,s=document.elementFromPoint(o,a);null!==s&&this.contains(s)&&(t=n.call(this,e))}return"function"==typeof i&&i.call(this,e),r=!0,t},a=function(e){return r?void(r=!1):n.call(this,e)};return t?void et(e).on("click",t,a).on("touchend",t,o):void et(e).on("click",a).on("touchend",o)}function k(e){return new RegExp(e.toLowerCase()).test(ft)}function x(e){var t=document.createElement("div"),n=e.charAt(0).toUpperCase()+e.slice(1),i=(e+" "+["Webkit","Moz","O","ms"].join(n+" ")+n).split(" ");for(var r in i){var o=i[r];if(void 0!==t.style[o])return o}return e}function S(){var e=navigator,t=!1,n=[0,0,0],i=null,r="Shockwave Flash",o="application/x-shockwave-flash",a="ShockwaveFlash.ShockwaveFlash";if("undefined"!=typeof e.plugins&&"object"===Xe(e.plugins[r]))i=e.plugins[r].description,!i||"undefined"!=typeof e.mimeTypes&&e.mimeTypes[o]&&!e.mimeTypes[o].enabledPlugin||(t=!0,i=i.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),n[0]=parseInt(i.replace(/^(.*)\..*$/,"$1"),10),n[1]=parseInt(i.replace(/^.*\.(.*)\s.*$/,"$1"),10),n[2]=/[a-zA-Z]/.test(i)?parseInt(i.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if("undefined"!=typeof window.ActiveXObject)try{var s=new ActiveXObject(a);s&&(i=s.GetVariable("$version"),i&&(t=!0,i=i.split(" ")[1].split(","),n=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]))}catch(e){}return{installed:t,version:n.join("."),major:n[0],minor:n[1],revision:n[2]}}function T(e,t){var n=e,i=t;return n%320!==0&&(n=100*Math.ceil(e/100),i=Math.round(n/e*t)),{width:n,height:i}}function E(e){var t=e.width,n=e.height,i=e.baseUrl,r=e.webpSupport,o=void 0!==r&&r,a=i+(o?".webp":".jpg");return a+="?mw="+t,0!==n&&(a+="&mh="+n),yt.devicePixelRatio>1&&(a+="&q=70"),a}function P(e){return new je(function(t,n){var i=new Image;i.src=e,i.onload=function(){return t(i)},i.onerror=function(e){return n(e)}})}function L(e){function t(){var t=e.request.sentry?e.request.sentry.player_js_url:null;if(t){var n={logger:o,release:e.request.build.js,serverName:window.location.hostname||"",tags:{git_commit:e.request.build.player},ignoreErrors:["Permission denied to access property 'toString'"],includePaths:[/https?:\/\/.*vimeo\.com/]};try{Ht.config(t,n).install()}catch(e){}a=Ht.isSetup()}}function n(){window.addEventListener("unhandledrejection",function(e){i(e.reason.message)})}function i(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(a){"string"==typeof e&&(e=new Error(e)),Ht.captureException(e,t);var n=Ht.lastEventId();return n}return null}function r(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(a){Error.prototype.isPrototypeOf(e)&&(e=e.message),Ht.captureMessage(e,t);var n=Ht.lastEventId();return n}return null}var o="player-raven",a=!1;t(),n();var s={get isSetUp(){return a},reportException:function(e,t){return i(e,t)},reportMessage:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return r(e,t)}};return s}function C(e){e=e||{};var t={};return e.on=function(n,i){n=[].concat(n);for(var r=0,o=n.length;r0){var n=e.telecine.currentFile.metadata.quality,r="Buffer Time";d&&(d=!1,r="Start Time"),i(r,t,n),t=null}})}function a(){function t(){o=document.createElement("script"),o.id="player-comscore",o.async=!0,o.src=e.config.request.urls.comscore_js;var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(o,t)}function n(){try{r=new ns_.StreamingTag({customerC2:e.config.request.comscore_id}),a&&(i(),a=!1)}catch(e){}}function i(){try{r.playContentPart({ns_st_ci:e.config.video.id})}catch(e){}}if(!e.config.request.flags.dnt&&e.config.request.flags.plays){var r,o=document.getElementById("player-comscore"),a=!1;e.events.on(Ge.played,function(){if(!r){if("undefined"==typeof ns_)return o||t(),o.addEventListener("load",n,!1),void(a=!0);n()}i()}),e.events.on(Ge.paused,function(){try{r&&r.stop()}catch(e){}})}}function s(){"tracking_pixel"in e.config.video&&(e.config.request.flags.dnt||e.config.request.flags.plays&&e.events.on(Ge.playInitiated,function(){try{(new Image).src=e.config.video.tracking_pixel}catch(e){}}))}function c(){e.events.on(Ge.configChanged,function(){l!==e.config.request.session&&(window._gaq&&window._gaq.push(["player._trackPageview","/video/"+e.config.video.id]),d=!0)})}function u(){if(e.config.request.flags.mixpanel&&e.config.request.flags.plays&&!e.config.request.flags.dnt){new Qn(e)}}var l=e.config.request.session,d=!0;return r(),o(),a(),s(),c(),u(),e.events.fire(Ge.analyticsModuleReady),{}}function M(e){return e=e.replace("#",""),"string"==typeof e&&(3===e.length||6===e.length)&&!isNaN(parseInt(e,16))}function F(e){var t=/rgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(,\s*([\d\.]+))?\)/.exec(e);if(!t)throw new Error("Invalid rgb value");return{red:parseInt(t[1],10),green:parseInt(t[2],10),blue:parseInt(t[3],10),alpha:parseFloat(t[5])||1}}function q(){for(var e=arguments.length,t=Array(e),n=0;n=0)return this.rgba=F(t[0]),this;if(!M(""+t[0]))throw new Error("Invalid hex value");return this.hex=t[0],this}if(3===t.length||4===t.length){for(var r=0;r<3;r++)if(isNaN(parseInt(t[r],10))||parseInt(t[r],10)<0||parseInt(t[r],10)>255)throw new Error("Invalid rgb value");if(t[3]&&parseFloat(t[3])<0||parseFloat(t[3])>1)throw new Error("Invalid alpha value");return this.rgba={red:t[0],green:t[1],blue:t[2],alpha:parseFloat(t[3])||1},this}throw new Error("Invalid color")}function R(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];if(!e||"null"===e||0===t.length)return{track:null};var n=e.split("."),i=Qe(n,2),r=i[0],o=i[1],a=r.substr(0,2),s=r!==a,c=t.filter(function(e){return s?e.language===r||e.language===a:e.language===a}).sort(function(e,t){var n=2*(e.language===a&&e.kind===o)+2*(e.language===r)+1*(e.kind===o),i=2*(t.language===a&&t.kind===o)+2*(t.language===r)+1*(t.kind===o);return i-n});return c.length>0?{track:c[0],exactMatch:c[0].language===r&&c[0].kind===o}:{track:null}}function B(e){function t(e,t,n){this.message=e,this.name=t,this.source=n}function n(n){switch(e.config.view){case He.privateLocked:throw new t("The video is private.","PrivacyError",n);case He.privatePassword:throw new t("The video is password-protected. The viewer must enter the password first.","PasswordError",n);case He.error:throw new t(e.config.message,"NotFoundError",n)}}function i(){var e=[];for(var t in j)if(j.hasOwnProperty(t)&&0!==t.indexOf("_")){if("function"==typeof j[t]){e.push(t);continue}"function"==typeof j[t].get&&e.push("get"+t.charAt(0).toUpperCase()+t.slice(1)),"function"==typeof j[t].set&&e.push("set"+t.charAt(0).toUpperCase()+t.slice(1))}return e.sort()}function r(){I||(l({event:"loaded",data:{id:e.config.video.id}}),I=!0)}function o(e){if(!e||""===e)return{};if("object"===("undefined"==typeof e?"undefined":Xe(e)))return e;try{return E=2,JSON.parse(e)}catch(n){var t={};return e.split("&").forEach(function(e){try{var n=e.split("="),i=decodeURIComponent(n[0]),r=decodeURIComponent(n[1]);if("id"===i)return;"params"===i&&(i="value"),r=r.split(",")[0],t[i]=r}catch(e){}}),E=1,t}}function a(e){if(!e||"_"===e.substr(0,1))return null;switch(1===E&&(e=e.replace("api_","")),e){case"changeColor":return j.color.set;case"paused":return j.paused.get;case"seekTo":return j.currentTime.set}if("function"==typeof j[e])return j[e];var t=e.substr(0,3),n=e.substr(3,1).toLowerCase()+e.substr(4);return j[n]&&j[n][t]?j[n][t]:null}function s(e){if(e.source===window.parent){var n=o(e.data),r=n.method,s=n.value;if(void 0!==r)try{var c=a(r);if(!c)throw new t("“"+r+"” is not a valid method. Valid methods are: "+i().join(", ")+".","TypeError",r);var u=[s];c===j.addCuePoint&&"object"===("undefined"==typeof s?"undefined":Xe(s))?u=[s.time,s.data]:c===j.enableTextTrack&&"object"===("undefined"==typeof s?"undefined":Xe(s))&&(u=[s.language,s.kind]);var f=c.apply(e,u),h=0!==r.indexOf("get")&&"paused"!==r;if(f===b||h&&E<3)return;l({method:r,value:void 0!==f&&""!==f?f:s})}catch(e){d(e)}}}function c(e){var t=e.event;if(1===E)for(var n in D)if(D[n]===e.event){t=n;break}switch(t){case"onSeek":case"onProgress":delete e.data.percent,delete e.data.duration;break;case"onLoading":delete e.data.seconds,delete e.data.duration}var i="method="+encodeURIComponent(t||e.method);i+="¶ms=";var r=[];if(void 0!==e.value)r.push(encodeURIComponent(e.value));else if("object"===Xe(e.data))for(var o in e.data)r.push(encodeURIComponent(e.data[o]));else void 0!==e.data&&r.push(encodeURIComponent(e.data));return e.player_id&&r.push(e.player_id),i+=r.join(",")}function u(e){if(e.event){for(var t in N)if(N[t]===e.event){e.event=t;break}"cuechange"===e.event&&(e.data.text=e.data.cues[0].text,e.data.html=e.data.cues[0].html,delete e.data.cues)}return JSON.stringify(e)}function l(t){if((!t.event||(k.fire(t.event,t.data),w[t.event]))&&x){e.config.embed&&e.config.embed.player_id&&(t.player_id=e.config.embed.player_id);try{1===E?t=c(t):2===E&&(t=u(t)),"object"!==("undefined"==typeof t?"undefined":Xe(t))||"ready"!==t.event&&S||(t=JSON.stringify(t))}catch(e){}if(window.parent!=window)try{window.parent.postMessage(t,_&&"null"!==_?_:"*")}catch(e){}}}function d(e){var n={event:"error",data:{message:"An error occurred.",name:"Error",method:e.source}};e instanceof t&&(n={event:"error",data:{message:e.message,name:e.name,method:e.source}}),l(n)}function f(){if(P&&O){try{switch(O){case"not-supported":throw new t("This video is not supported in this browser.","NotSupportedError");case"no-files":throw new t("There was an error loading the files for this video.","FileError");default:throw new t("An error occurred during playback.","PlaybackError")}}catch(e){d(e)}O=null}}function p(){"embed"in e.config&&e.config.embed.on_site||(window.addEventListener?window.addEventListener("message",s,!1):window.attachEvent("onmessage",s))}function v(){e.events.on(Ge.played,function(t){L||(L=!0,l({event:"play",data:{seconds:h(t),percent:h(t/e.config.video.duration),duration:h(e.config.video.duration)}}))}),e.events.on(Ge.paused,function(t){L=!1,l({event:"pause",data:{seconds:h(t),percent:h(t/e.config.video.duration),duration:h(e.config.video.duration)}})}),e.events.on(Ge.ended,function(){L=!1,l({event:"ended",data:{seconds:h(e.config.video.duration),percent:1,duration:h(e.config.video.duration)}})}),e.events.on(Ge.playProgress,function(e,t,n){l({event:"timeupdate",data:{seconds:h(e),percent:h(n),duration:h(t)}})}),e.events.on(Ge.loadProgress,function(e,t,n){var i={event:"progress",data:{percent:h(n),duration:h(t),seconds:h(e)}};E<3&&(i.data.bytesLoaded=-1,i.data.bytesTotal=-1),l(i)}),e.events.on(Ge.seeked,function(e,t,n){l({event:"seeked",data:{seconds:h(e),percent:h(n),duration:h(t)}})}),e.events.on(Ge.volumeChanged,function(e){l({event:"volumechange",data:{volume:h(e)}})}),e.events.on(Ge.error,function(e){O=e,f()}),e.events.on(Ge.apiError,function(e){d(new t(e.message,e.name,e.method))}),e.events.on(Ge.cueChanged,function(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e||{},i=n.language,r=void 0===i?null:i,o=n.label,a=void 0===o?null:o,s=n.kind,c=void 0===s?null:s;l({event:"cuechange",data:{label:a,language:r,kind:c,cues:t}})}),e.events.on(Ge.captionsChanged,function(e){M=e;var t=e||{},n=t.language,i=void 0===n?null:n,r=t.label,o=void 0===r?null:r,a=t.kind,s=void 0===a?null:a;l({event:"texttrackchange",data:{label:o,language:i,kind:s}})}),e.config.request.flags.dnt||e.events.on(Ge.emailCaptureSuccess,function(){l({event:"emailcapture"})}),e.events.on(Ge.cuepoint,function(e){l({event:"cuepoint",data:{time:e.time,data:e.data,id:e.id}})})}function m(){e.events.on($e.reset,function(){O=null,A=!1,I=!1})}function g(){e.events.on(Ge.configChanged,function(t){T&&setTimeout(function(){var t=!0;e.events.fire($e.changeVolume,T,t)},0),t&&r()})}var _=document.referrer||e.config.request.referrer;try{_=decodeURIComponent(_)}catch(e){_=unescape(_)}var y,b="_ASYNC_",w={ready:!0},k=C(),x=!(!window.postMessage||!window.parent.postMessage),S=!(yt.browser.ie>=8&&yt.browser.ie<10),T=null,E=e.config.embed.api,P=!1,L=!1,O=null,A=!1,I=!1,M=null,F=["play","pause","ended","timeupdate","progress","seeked","error","texttrackchange","cuechange","volumechange","loaded","emailcapture","cuepoint"],B=F.filter(function(e){return"emailcapture"!==e}),D={onFinish:"ended",onLoading:"progress",onLoad:"ready",onProgress:"timeupdate",onPlay:"play",onPause:"pause",onSeek:"seeked"},N={playProgress:"timeupdate",loadProgress:"progress",finish:"ended",seek:"seeked"};t.prototype=new Error;var j={_setEmbedSetting:function(t,n){e.config.embed.on_site&&(n="object"===("undefined"==typeof n?"undefined":Xe(n))?n:Number(n),"badge"===t&&(n?n=y:y=e.config.embed.settings.badge),e.config.embed.settings[t]=n,e.events.fire(Ge.embedSettingChanged,t,n),e.events.fire(Ge.configChanged,e.config))},_showOverlay:function(t,n){e.events.fire($e.showOverlay,t,n)},_toggleDebugHud:function(){e.events.fire(Ge.debugButtonPressed)},addEventListener:function(n,i){if(n in D&&(n=D[n]),n in N&&(n=N[n]),F.indexOf(n)<0)throw new t("“"+n+"” is not a valid event. Valid events are: "+B.join(", ")+".","TypeError","addEventListener");i?k.on(n,i):w[n]=!0,("loaded"===n&&e.config.view===He.main||e.config.view===He.privateUnlocked)&&r()},removeEventListener:function(e,t){t?k.off(e,t):w[e]=!1},play:function(){n("play");var i="[object MessageEvent]"===Object.prototype.toString.call(this);if(i&&"undefined"!=typeof yt&&(yt.iPhone||yt.iPad||yt.iPod)&&!A)throw new t("The viewer must initiate playback first.","Error","play");e.events.fire(Ge.playButtonPressed)},pause:function(){n("pause"),e.events.fire(Ge.pauseButtonPressed)},loadVideo:function(i){if(isNaN(Number(i))&&i.match(null===new RegExp("^https?://"+e.config.player_url+"/video/([0-9]+)/config")))throw new t("The config url must be a valid Vimeo url.","TypeError","loadVideo");return e.loadVideo(i).then(function(){return E>2&&l({method:"loadVideo",value:i}),i}).catch(function(){try{n("loadVideo")}catch(e){if(e instanceof t)return void d(e);d(new t("An error occurred loading the video.","Error","loadVideo"))}}),b},unload:function(){e.config.view!==He.main&&e.config.view!==He.privateUnlocked||e.events.fire($e.reset)},enableTextTrack:function(n){var i=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r=("text_tracks"in e.config.request?e.config.request.text_tracks:[]).map(function(e){return e.language=e.lang,e}),o=r.some(function(e){return e.language.toLowerCase()===n.toLowerCase()});if(!o)throw new t("There are no tracks for “"+n.toUpperCase()+"”.","InvalidTrackLanguageError","enableTextTrack");var a=i?n+"."+i:n,s=R(a,r),c=s.track;if(!c||i&&c.kind!==i)throw new t("There are no "+i+" tracks for “"+n.toUpperCase()+"”.","InvalidTrackError","enableTextTrack");return e.events.fire($e.turnCaptionsOn,c.id,!0),E>2&&e.events.once(Ge.captionsChanged,function(e,t){l({method:"enableTextTrack",value:{label:e.label,language:e.language,kind:e.kind}})}),b},disableTextTrack:function(){e.events.fire($e.turnCaptionsOff)},ping:function(){return e.config.video.id},addCuePoint:function(n,i){if(e.telecine&&"moogaloop"===e.telecine.currentScanner)throw new t("Cue points are not supported in the current player.","UnsupportedError","addCuePoint");if(n=parseFloat(n),isNaN(n)||n<0||n>e.config.video.duration)throw new t("Cue point time must be positive number less than the duration of the video ("+h(e.config.video.duration)+").","RangeError","addCuePoint");var r=e.telecine.addCuePoint(n,i);return setTimeout(function(){e.events.fire(Ge.cuePointAdded,r)},0),r.id},removeCuePoint:function(n){if(e.telecine&&"moogaloop"===e.telecine.currentScanner)throw new t("Cue points are not supported in the current player.","UnsupportedError","removeCuePoint");var i=e.telecine.cuePoints.filter(function(e){return e.id===n})[0];if(!i)throw new t("Cue point “"+n+"” was not found.","InvalidCuePoint","removeCuePoint");e.telecine.removeCuePoint(i),setTimeout(function(){e.events.fire(Ge.cuePointRemoved,i)},0)},autopause:{get:function(){if(e.telecine&&"moogaloop"===e.telecine.currentScanner)throw new t("Autopause is not supported in the current player.","UnsupportedError","getAutopause");return!!e.config.embed.autopause},set:function(n){if(e.telecine&&"moogaloop"===e.telecine.currentScanner)throw new t("Autopause is not supported in the current player.","UnsupportedError","setAutopause");e.config.embed.autopause=!!n}},color:{get:function(){return e.config.embed.color.replace("#","")},set:function(n){if("moogaloop"===e.telecine.currentScanner)return void e.events.fire($e.changeColor,n);if(e.config.embed.settings.color&&!e.config.embed.on_site)throw new t("The creator of the video has chosen to always use "+new q(e.config.embed.color).hex+".","EmbedSettingsError","setColor");try{var i=new q(n);e.events.fire($e.changeColor,i.hex)}catch(e){throw new t("The color should be 3- or 6-digit hex value.","TypeError","setColor")}var r=new q(23,35,34,.75),o=r.contrast(i).ratio;if(o<3){var a=i.clone().lighten(5,3,r);throw new t(i.hex+" does not meet minimum contrast ratio. We recommend using brighter colors. (You could try "+a.hex+" instead.) See WCAG 2.0 guidelines: http://www.w3.org/TR/WCAG/#visual-audio-contrast","ContrastError","setColor")}}},cuePoints:{get:function(){if(e.telecine&&"moogaloop"===e.telecine.currentScanner)throw new t("Cue points are not supported in the current player.","UnsupportedError","getCuePoints");return e.telecine.cuePoints.map(function(e){return{time:e.time,data:e.data,id:e.id}})}},currentTime:{get:function(){return e.telecine&&e.telecine.currentTime>.1?h(e.telecine.currentTime):0},set:function(n){if(n=parseFloat(n),isNaN(n)||n<0||n>e.config.video.duration)throw new t("Seconds must be a positive number less than the duration of the video ("+h(e.config.video.duration)+").","RangeError","setCurrentTime");var i="[object MessageEvent]"===Object.prototype.toString.call(this);if(i&&"undefined"!=typeof yt&&(yt.iPhone||yt.iPad||yt.iPod)&&!A)throw new t("The viewer must initiate playback first.","Error","setCurrentTime");return e.events.fire($e.seek,null,n),e.events.fire(Ge.mousedOver),E>2&&e.events.once(Ge.seeked,function(e,t,n){l({method:"setCurrentTime",value:e})}),b}},duration:{get:function(){return h(e.config.video.duration)}},ended:{get:function(){return!!e.telecine.ended}},loop:{get:function(){return!!e.config.embed.loop},set:function(t){e.events.fire($e.changeLoop,t)}},paused:{get:function(){return!(e.telecine&&"paused"in e.telecine)||!!e.telecine.paused}},textTracks:{get:function(){var t=e.telecine?e.telecine.video.textTracks:[];return t.map(function(e){return{label:e.label,language:e.language,kind:e.kind,mode:e===M?"showing":"disabled"}})}},videoEmbedCode:{get:function(){return e.config.video.embed_code}},videoHeight:{get:function(){return e.telecine.videoHeight||e.config.video.height}},videoId:{get:function(){return e.config.video.id}},videoTitle:{get:function(){return e.config.video.title}},videoWidth:{get:function(){return e.telecine.videoWidth||e.config.video.width}},videoUrl:{get:function(){if(!e.config.video.url)throw new t("The URL is not available because of the video’s privacy settings.","PrivacyError","getVideoUrl");return e.config.video.url}},volume:{get:function(){var t=h(e.config.request.cookie.volume);return 1===E?Math.round(100*t):t},set:function(n){if(n=parseFloat(n),1===E&&(n/=100),isNaN(n)||n<0||n>1)throw new t("Volume should be a number between 0 and 1.","RangeError","setVolume");T=n;var i=!0;e.events.fire($e.changeVolume,n,i)}},_like:{get:function(){return!!e.config.user.liked},set:function(t){if(e.config.embed.on_site){if(e.config.user.liked===t)return;e.events.fire(Ge.likeButtonPressed,t)}}},_watchLater:{get:function(){return!!e.config.user.watch_later},set:function(t){if(e.config.embed.on_site){if(e.config.user.watch_later===t)return;e.events.fire(Ge.watchLaterButtonPressed,t)}}}};return e.events.on(Ge.playInitiated,function(){A=!0}),v(),m(),g(),e.events.fire(Ge.apiModuleReady),e.events.once(Ge.ready,function(){P=!0,p(),l({event:"ready"}),f()}),j}function D(e,t){function n(){return Math.max(10,Math.round(.045*e.element.clientHeight))+"px"}function i(){t.style.fontSize=n()}function r(){t.classList.add("hidden"),t.setAttribute("hidden","")}function o(){"picture-in-picture"!==e.telecine.presentationMode&&(t.classList.remove("hidden"),t.removeAttribute("hidden"))}function a(e){var t=e.text.replace("\n","
").split(/
/),n=t.reduce(function(e,t){return Math.max(e,t.replace(/<\/?\w>/g,"").length)},0),i="+"+Array(n+3).join("-")+"+";return t=t.map(function(e){var t=n-e.replace(/<\/?\w>/g,"").length,i=Math.floor(t/2),r=Math.ceil(t/2);return'| '+Array(i+1).join(" ")+e+Array(r+1).join(" ")+' |'}),i+"
"+t.join("
")+"
"+i}function s(){for(var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];t.firstChild;)t.removeChild(t.firstChild);if(e.length){var n=document.createDocumentFragment();e.forEach(function(e){var t=document.createElement("span"),i=e.html;v&&(i=a(e)),t.innerHTML=i,n.appendChild(t)}),t.appendChild(n)}}function c(){e.events.on(Ge.cueChanged,function(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return m=t,s(t),t.length?h?void o():void(p=!0):void r()}).on(Ge.captionsChanged,function(e){return e?(t.setAttribute("lang",e.language),void t.setAttribute("dir",e.rtl?"rtl":"ltr")):(t.removeAttribute("dir"),void t.removeAttribute("lang"))}).on(Ge.playInitiated,function(){h=!0,p&&(p=!1,o())}).on(Ge.pictureInPictureActivated,function(){r()}).on(Ge.pictureInPictureDeactivated,function(){o()}).on($e.reset,function(){h=!1,r()}).on($e.setEffect,function(e){v="ascii"===e,s(m)})}function u(){i(),window.addEventListener("resize",i,!1),e.events.on([Ge.didEnterFullscreen,Ge.didExitFullscreen,Ge.enteredTinyMode,Ge.enteredMiniMode,Ge.enteredNormalMode],i)}function l(){e.events.on(Ge.controlBarVisibilityChanged,function(e){return e?void t.classList.add("with-controls"):void t.classList.remove("with-controls")})}function d(){e.events.on(Ge.overlayOpened,function(){t.classList.add("invisible")}).on(Ge.overlayClosed,function(){t.classList.remove("invisible")})}function f(){e.events.on(Ge.ended,function(){"nothing"!==e.config.embed.outro&&t.classList.add("invisible")}).on([Ge.played,Ge.scrubbingStarted],function(){t.classList.remove("invisible")})}var h=!1,p=!1,v=!1,m=[];return c(),u(),l(),d(),f(),{}}function N(e){function t(){return s&&s-Jn<=(new Date).getTime()}function n(e){var t=(new Date).getTime()+1e3*e,n=1e3*e-Jn-5e3;return l=setTimeout(function(){"onLine"in navigator&&!navigator.onLine||(u=r(a.video.id))},n),t}function i(e){clearTimeout(l);var t=a;if(isNaN(e)&&"string"!=typeof e)return a=e,s=n(a.request.expires),je.resolve({old:t,loaded:a});var i=(new Date).getTime(),r=a&&a.video&&a.video.id,o=a&&a.request&&a.request.session,c=a&&a.request&&a.request.referrer,u=a&&a.embed&&a.embed.on_site,f=a&&a.embed&&a.embed.context,h=e;if(!isNaN(e)){var p=a&&a.player_url?"https://"+a.player_url:"";h=p+"/video/"+e+"/config"+window.location.search}return c&&(h+=(h.indexOf("?")===-1?"?":"&")+"referrer="+encodeURIComponent(c)),d(h,{allowErrorStatuses:!0}).then(function(e){a=JSON.parse(e),a.view!==He.error&&(s=n(a.request.expires),o&&a.video.id===r&&(a.request.session=o),c&&(a.request.referrer=c),u&&(a.embed.on_site=1,a.embed.context=f));(new Date).getTime()-i;return{old:t,loaded:a}})}function r(){clearTimeout(l);var e=(new Date).getTime(),t=a&&a.request.referrer,i=a.request,r=i.signature,c=i.session,f=i.timestamp,h=i.expires,p="https://"+a.player_url+"/video/"+a.video.id+"/config/request?session="+c+"&signature="+r+"&time="+f+"&expires="+h;return d(p).then(function(i){a.request=JSON.parse(i),t&&(a.request.referrer=t),s=n(a.request.expires);(new Date).getTime()-e;return u=null,o.fire(Ge.requestConfigReloaded),a.request})}var o=e.events,a=null,s=null,c=null,u=null,l=null;return window.addEventListener("online",function(){t()&&(u=r(a.video.id))}),{get isExpired(){return t()},load:function(e){return i(e)},reload:function(){return a&&a.video.id?i(a.video.id):je.reject(new Error("No config loaded."))},toJSON:function(){return a},get config(){return a},set config(e){a=e},verify:function(){return t()?(u||(u=r()),u):je.resolve(a.request)},get _video(){return c},set _video(e){c=e}}}function j(e){return function(t){return Ue[t.mime]===e}}function H(e){var t=e.fps;return"metadata"in e&&(t=e.metadata.fps),t>30}function V(e){return e.quality||e.metadata.quality}function U(e){return"string"!=typeof e&&(e=V(e)),parseInt(e,10)}function z(e){return U(e)>=720}function W(e){var t=ti(e).filter(H).map(V);return function(e){return!(t.indexOf(V(e))!==-1&&!H(e))}}function $(e){return"fps"in e?e.fps:"metadata"in e&&"fps"in e.metadata?e.metadata.fps:0}function G(){var e=arguments.length<=0||void 0===arguments[0]?"desc":arguments[0];return function(t,n){var i=U(t),r=$(t),o=U(n),a=$(n);return"asc"===e?i-o||r-a:o-i||a-r}}function X(e,t){var n=V(e);return n=n.replace("1440p","2K").replace("2160p","4K"),z(e)&&t&&(n+=t),n}function K(e){var t=e.files,n=void 0===t?[]:t,i=e.preference,r=void 0===i?"360p":i,o=e.priorityOffset,a=void 0===o?0:o;n=ti(n),n.sort(G());var s=n.map(V);if(r){s.indexOf(r)===-1&&(s.push(r),s.sort(function(e,t){return U(t)-U(e)}));var c=s.indexOf(r),u=s.splice(0,c);u.reverse(),s.push.apply(s,u)}return n.map(function(e){return{id:e.id,src:e.url,mime:e.mime,priority:s.indexOf(e.quality)+1+a,metadata:{profile:e.profile,cdn:e.cdn,origin:e.origin,quality:e.quality,fps:e.fps}}})}function Y(e){function t(){C=!1,O=!1,M=!1,F=!1,q=!1,R=!1,V=null,U=null,B=null,z=null, W=!1,$=0,X=0,K=e.config.embed.autoplay,H=u(),T=n(),E=e.config.request.urls.blurr,N="auto"}function n(){return parseInt(Date.now()/1e3,10)}function i(){return Date.now?Date.now():(new Date).getTime()}function r(e){return i()-e}function o(e){return n()-e}function a(){var t=document.createElement("a");return t.href=e.config.request.referrer,t.origin||t.protocol.replace(":","")+"://"+t.host}function s(){L=!0,setTimeout(c,P)}function c(t){var n=!0;if(t){if(n=!1,_&&O&&d("video-buffered",{time:r(b)/1e3,video_time:k}),y&&(O&&!R&&d("video-stopped-during-playback",{time:r(w)/1e3,video_time:x}),I+=r(w)/1e3),C&&!O){var i=r(g);i>=1e3&&!e.telecine.paused&&d("video-exit-before-start",{time:i/1e3})}O&&!e.config.embed.loop&&d("video-playback-session",v(H))}var o=S;if(S=[],0===o.length)return void s();var a=JSON.stringify(o);if(navigator.sendBeacon&&navigator.sendBeacon(E,a))return void s();var c=new XMLHttpRequest;c.open("POST",E,n),c.setRequestHeader("Content-Type","text/plain"),c.onload=function(){},c.send(a),s()}function u(){return{session_id:e.config.request.session,account_type:e.config.video.owner?e.config.video.owner.account_type:null,referrer:e.config.request.referrer,video_duration:e.config.video.duration,device_pixel_ratio:window.devicePixelRatio||1,startup_time:0,video_start_position:0,video_end_position:0,starting_profile:0,abandoned_during_buffer:0,forced_embed_quality:"none",_fullscreen:[],number_of_down_switches:0,number_of_up_switches:0,number_of_buffers:0,stayed_on_auto:1,alert_displayed:0,alert_dismissed:"none",_speeds:[],_playedProfiles:{},_targetProfiles:{},_embed_size:{},_target_profile_id:{},_profiles:{},session_playback_duration:0}}function l(){var t=e.telecine.video.currentFile||{},n=t.id,i=void 0===n?0:n,r=t.mime,o=void 0===r?ze.h264:r,a=t.metadata;a=void 0===a?{}:a;var s=a.profile,c=void 0===s?-1:s,u=!1,l=!1;switch(o){case ze.dash:0===t.restrictedStreamIndexes.length&&(u=!0),e.config.request.files.dash.separate_av&&(l=!0);var d=j,f=d.id;i=void 0===f?0:f;var h=d.profile;c=void 0===h?-1:h;break;case ze.hls:u=!0}var p={clip_id:e.config.video.id,video_file_id:Number.isInteger(Number(i))?parseInt(i,10):0,delivery:Ue[o],profile_id:c,auto:Number(u),player_type:"html",version:e.config.request.build.js,autoplay:K,cdn:t.metadata.cdn||"akamai",origin:t.metadata.origin,secure:t.src&&0===t.src.indexOf("https"),vod:e.config.video.vod?1:0,embed:!e.config.embed.on_site,context:e.config.embed.context,separate_av:l?1:0,video_shape:yt.threeSixtyVideo&&e.config.video.is_panorama?"spatial_mono":"flat_mono"};if(e.config.request.ab_tests)for(var v in e.config.request.ab_tests)p[v+"_test"]=1,p[v+"_group"]=e.config.request.ab_tests[v].group;return p}function d(t,n){var i=l();for(var r in n)n.hasOwnProperty(r)&&(i[r]=n[r]);i.name=t,i.event_time=e.config.request.timestamp+o(T),S.push(i),L||s()}function f(){var t=e.config.video.duration;e.config.request.flags.blurr&&E&&(e.events.on(Ge.playInitiated,function(){C||e.performDelegateAction(Ve.playLog,function(n){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];K=r.continuous?2:e.config.embed.autoplay,d("video-start-attempt"),C=!0,g=i();var o=e.config.user.progress,a=e.config.video.duration;!o||e.config.embed.autoplay||e.config.embed.time||setTimeout(function(){var e=o/a*100,n=tB?H.number_of_up_switches+=1:H.number_of_down_switches+=1),H._profiles[r].push({start:o}),H._playedProfiles[r]={bitrate:a,width:n[t].width,height:n[t].height},V=r,B=a}),e.events.on(Ge.ranIntoBuffer,function(e){H.number_of_buffers+=1,H.abandoned_during_buffer=1}),e.events.on($e.changeQuality,function(e){"auto"!==e&&(H.stayed_on_auto=0)}),e.events.on(Ge.playbackResumed,function(){H.abandoned_during_buffer=0}),e.events.on(Ge.resize,function(e){var i=e.width,r=e.height;if(i&&r){var o=t(i,r);n(o)}}),e.events.on(Ge.streamTargetChange,function(e,t,n){var r=e.profile,o=n[t].bitrate,a=i();if(H._target_profile_id[r]=H._target_profile_id[r]||[],U){var s=H._target_profile_id[U].length-1;H._target_profile_id[U][s]&&(H._target_profile_id[U][s].end=a)}H._target_profile_id[r].push({start:a}),H._targetProfiles[r]={bitrate:o,width:n[t].width,height:n[t].height},U=r}),e.events.on(Ge.forcedQuality,function(e){H.forced_embed_quality=e}),e.events.on(Ge.alertVisibilityChanged,function(e,t){return e?void(H.alert_displayed=1):void(H.alert_dismissed=t)})}function v(t){var n={},r=i(),o=G("asc"),a="MediaSourceScanner"===e.telecine.currentScanner,s="HTMLScanner"===e.telecine.currentScanner,c=[];s&&(c=e.config.request.files.progressive),a&&(c=e.config.request.files.dash.streams);var u=ti(c).sort(o).map(function(e){return e.profile});for(var l in t)t.hasOwnProperty(l)&&(n[l]=t[l]);n.seconds_in_fullscreen=n._fullscreen.reduce(function(e,t){var n=t.end||r;return(n-t.start)/1e3+e},0),n.session_playback_duration+=X-$;var d=null;if(Object.keys(n._embed_size).forEach(function(e){var t=n._embed_size[e];t>d&&(d=e)}),d){var f=d.split(":"),h=Qe(f,2),p=h[0],v=h[1];n.embed_width=parseInt(p,10),n.embed_height=parseInt(v,10)}var m=-1,g=0,_=null;if(Object.keys(n._profiles).forEach(function(e){var t=u.indexOf(parseInt(e,10));t>m&&(m=t);var i=n._profiles[e].reduce(function(e,t){var n=t.end||r;return(n-t.start)/1e3+e},0);i>g&&(g=i,_=e)}),n.highest_profile=u[m],n.highest_available_profile=u[u.length-1],n.most_used_profile=parseInt(_,10),n.percent_watched=n.session_playback_duration/e.config.video.duration,a&&!function(){n.max_speed=Math.round(Math.max.apply(Math,n._speeds))/1e3,n.min_speed=Math.round(Math.min.apply(Math,n._speeds))/1e3;var e=n._speeds.reduce(function(e,t){return e+t},0);n.average_speed=Math.round(e/n._speeds.length)/1e3;var t=0,i=null;Object.keys(n._target_profile_id).forEach(function(e){var o=n._target_profile_id[e].reduce(function(e,t){var n=t.end||r;return(n-t.start)/1e3+e},0);o>t&&(t=o,i=e)}),n.target_profile=parseInt(i,10);var o=[];Object.keys(n._playedProfiles).forEach(function(e){var t=n._playedProfiles[e],i=t.width,r=t.height,a=parseInt(i,10)*parseInt(r,10);o.push(a)});var a=o.reduce(function(e,t){return e+t},0)/o.length,s=[];Object.keys(n._targetProfiles).forEach(function(e){s.push(n._targetProfiles[e].bitrate)});var c=s.reduce(function(e,t){return e/1e3+t/1e3},0)/s.length,u=[];Object.keys(n._targetProfiles).forEach(function(e){var t=n._targetProfiles[e],i=t.width*t.height;u.push(i)});var l=u.reduce(function(e,t){return e+t},0)/u.length,d=n._playedProfiles[n.most_used_profile],f=d.width,h=d.height,p=f*h,v=Math.min(p,l),m=a*c/(v*Math.min(n.average_speed,c));n.appdex=m,n.rPlayed=a,n.bMax=c,n.rMax=v,n.bufferedWithLowerProfileAvailable=D,n.number_of_switches=n.number_of_up_switches+n.number_of_down_switches}(),"undefined"!=typeof window.performance&&"function"==typeof window.performance.getEntriesByType){var y=performance.getEntriesByType("resource").filter(function(e){return".m4s"===e.name.split("?")[0].substr(-4)});n.ttfb=y.map(function(e){return e.responseStart-e.connectStart}).reduce(function(e,t){return e+t},0)/(y.length||1)}return n.buffer_duration=I,n.buffer_ratio=I/(I+n.session_playback_duration)*100,Object.keys(n).forEach(function(e){"_"===e.charAt(0)&&delete n[e]}),n}function m(){e.events.on(Ge.configChanged,function(){t()})}var g,_,y,b,w,k,x,S=[],T=n(),E=e.config.request.urls.blurr,P=3e4,L=!1,C=!1,O=!1,I=0,M=!1,F=!1,q=!1,R=!1,B=null,D=!1,N="auto",j={},H=u(),V=null,U=null,z=null,W=!1,$=0,X=0,K=e.config.embed.autoplay;return f(),h(),p(),m(),{}}function Q(e){function t(){return Date.now?Date.now():(new Date).getTime()}function n(){f=!1,p=e.telecine?e.telecine.currentTime:0,v=0,m=0,g=0,_=!1}function i(t,n,r,o){e.verifyConfig().then(function(){var a=n;a.signature=e.config.request.signature,a.session=e.config.request.session,a.time=e.config.request.timestamp,a.expires=e.config.request.expires;var s=JSON.stringify(a),c="https://"+e.config.player_url+t;if(navigator.sendBeacon&&navigator.sendBeacon(c,s))return!0;var u=new XMLHttpRequest;return u.open("POST",c,!r),u.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),u.withCredentials=!0,u.onload=function(){200!==u.status&&o<2&&setTimeout(function(){i(t,n,r,o+1)},1e3)},u.send(s),u}).catch(function(e){})}function r(t,n,r){var o=e.telecine.currentFile||{},a=o.id,s=void 0===a?0:a,c=o.mime,u=void 0===c?ze.h264:c,l=o.metadata;l=void 0===l?{}:l;var d=l.profile,f=void 0===d?-1:d;if(u===ze.dash){var p=k,m=p.id;s=void 0===m?0:m;var g=p.profile;f=void 0===g?-1:g}e.performDelegateAction(Ve.playLog,function(a){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];i(t,{referrer:e.config.request.referrer,embed:!e.config.embed.on_site,context:e.config.embed.context,autoplay:c.continuous?2:e.config.embed.autoplay,loop:e.config.embed.loop?1:0,id:e.config.video.id,vodId:e.config.video.vod&&e.config.video.vod.id?e.config.video.vod.id:null,vodSaleId:e.config.video.vod&&e.config.video.vod.sale_id?e.config.video.vod.sale_id:null,sessionTime:h(v),videoShape:yt.threeSixtyVideo&&e.config.video.is_panorama?"spatial_mono":"flat_mono",userId:e.config.user.id,userAccountType:e.config.user.account_type,userIsMod:e.config.user.mod?1:0,ownerId:e.config.video.owner.id,ownerAccountType:e.config.video.owner.account_type,privacy:e.config.video.privacy,rating:e.config.video.rating?e.config.video.rating.id:null,type:We[e.telecine.currentScanner],videoFileId:Number.isInteger(Number(s))?s:0,delivery:Ue[u],profileId:f,quality:o.metadata.quality,duration:h(e.config.video.duration),seconds:h(n)},r)})}function o(){!_&&e.config.request.flags.plays&&(_=!0,r("/log/play",0))}function a(){var n=arguments.length<=0||void 0===arguments[0]?0:arguments[0],i=!(arguments.length<=1||void 0===arguments[1])&&arguments[1],o=arguments.length<=2||void 0===arguments[2]||arguments[2];if(e.config.request.flags.plays){var a=t();o&&m+w>a||(m=a,o&&!e.config.request.flags.partials||f||r("/log/partial",n,i))}}function s(t,n){if(!e.config.request.flags.dnt){n=n||{};var r={referrer:e.config.request.referrer,embed:!e.config.embed.on_site,context:e.config.embed.context,id:e.config.video.id,vodId:e.config.video.vod&&e.config.video.vod.id?e.config.video.vod.id:null,vodSaleId:e.config.video.vod&&e.config.video.vod.sale_id?e.config.video.vod.sale_id:null,userId:e.config.user.id,userAccountType:e.config.user.account_type,ownerId:e.config.video.owner?e.config.video.owner.id:0,duration:h(e.config.video.duration),seconds:h(e.telecine.currentTime)};for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o]);i("/log/"+t,r)}}function c(){e.events.on(Ge.playProgress,function(e,n,i){var r=Math.floor(e);!f&&g+wp&&(v+=e-p),p=e),r%y===0&&a(e)}),e.events.on(Ge.playInitiated,function(){o()}),e.events.on(Ge.paused,function(t){e.telecine.ended||a(t)}),e.events.on(Ge.seeked,function(e,t,n){b=e,f||a(b)}),e.events.on(Ge.scrubbingStarted,function(){g=t(),f=!0}),e.events.on(Ge.scrubbingEnded,function(){p=e.telecine.currentTime,f=!1,a(b)}),e.events.on(Ge.hdButtonPressed,function(){a(e.telecine.currentTime)}),e.events.on(Ge.ended,function(){v+=e.config.video.duration-p;var t=!1,n=!1;a(e.config.video.duration,t,n)}),e.events.on(Ge.streamChanged,function(e){k=e}),A(function(){if(e.telecine&&e.telecine.currentTime>0){var t=!0,n=!1;a(e.telecine.currentTime,t,n)}})}function u(){function t(e){return function(){s(e)}}if(!e.config.request.flags.dnt){var n=[{type:"share_press",event:Ge.shareButtonPressed},{type:"facebook_press",event:Ge.facebookButtonPressed},{type:"twitter_press",event:Ge.twitterButtonPressed},{type:"tumblr_press",event:Ge.tumblrButtonPressed},{type:"email_press",event:Ge.emailButtonPressed},{type:"embed_press",event:Ge.embedButtonPressed},{type:"login_success",event:Ge.userLoggedIn},{type:"airplay",event:Ge.airPlayActivated},{type:"vod_press",event:Ge.vodButtonPressed},{type:"collection_press",event:Ge.collectionsButtonPressed},{type:"email_capture_submitted",event:Ge.emailCaptureSubmitted}];n.forEach(function(n){e.events.on(n.event,t(n.type))}),e.events.on(Ge.outroDisplayed,function(t){var n={outroType:e.config.embed.outro,ownerAccountType:e.config.video.owner.account_type};t.length&&(n.outroVideos=t.join(",")),s("outro_displayed",n)}).on(Ge.outroVideoPressed,function(t){s("outro_video_press",{ownerAccountType:e.config.video.owner.account_type,videoId:t})}).on(Ge.likeButtonPressed,function(){s("like_press",{add:!e.config.user.liked})}).on(Ge.watchLaterButtonPressed,function(){s("watch_later_press",{add:!e.config.user.watch_later})}).on(Ge.popupOpened,function(e){0===e.indexOf("login-")&&s("login_attempt")}).on(Ge.captionsChanged,function(e,t){if(!t)return e?void s("text_track_change",{textTrackLanguage:e.language,textTrackKind:e.kind}):void s("text_track_change")}).on(Ge.badgePressed,function(e){1!==e&&12!==e||s("badge_press",{badgeId:e})}).on(Ge.overlayOpened,function(e){"email-capture"===e&&s("email_capture_displayed")}).on(Ge.overlayClosed,function(e){"email-capture"===e&&s("email_capture_dismissed")})}}function l(){e.events.on(Ge.configChanged,function(e){e&&n()})}function d(){var t=["not-supported","decode","network","aborted","unknown"];e.events.on(Ge.error,function(n,r){t.indexOf(n)>=0&&i("/log/"+n.replace("-","")+"_error",{id:e.config.video.id,context:e.config.embed.context})})}var f,p,v,m,g,_,y=30,b=0,w=1e3,k={};return n(),c(),u(),l(),d(),e.events.fire(Ge.statsModuleReady),{}}function J(e){return e===!0||e===!1?Number(e):"null"===e?null:e}function Z(e){var t=arguments.length<=1||void 0===arguments[1]?document.cookie:arguments[1];return t&&""!==t?t.split(";").reduce(function(t,n){return n=n.trim(),0===n.indexOf(e+"=")?decodeURIComponent(n.substr(e.length+1)):t},null):null}function ee(e,t,n){var i=new Date;i.setFullYear(i.getFullYear()+1),i=i.toGMTString(),t=J(t);var r=e+"="+t+";";r+="expires="+i+";",r+="path=/;",r+="domain="+n+";",document.cookie=r}function te(e){function t(t){return new je(function(n,i){var r=document.createElement("a");r.href=e.config.request.urls.proxy;var a=document.createElement("iframe");a.src=t,a.setAttribute("title","Vimeo LocalStorage Proxy"),a.setAttribute("aria-hidden","true"),a.setAttribute("hidden",""),a.onload=function(t){var n=o(e.config.request.urls.proxy);a.contentWindow.postMessage({method:"ping"},n)},a.onerror=function(e){i(e)};var s=setTimeout(function(){i()},1e4),c=function e(i){0!==t.indexOf(i.origin)||"ready"!==i.data&&"ping"!==i.data||(window.removeEventListener("message",e,!1),clearTimeout(s),n(a))};window.addEventListener("message",c,!1),document.body.appendChild(a)})}function n(){y&&!ii&&(ii=t(e.config.request.urls.proxy))}function i(t){return ii.then(function(n){var i=o(e.config.request.urls.proxy);return n.contentWindow.postMessage(t,i),n}).catch(function(t){e.reportException(t)})}function r(t){e.config.embed.on_site&&window.postMessage(t,window.location.origin)}function a(t,n){if(ii){var o={method:"set",key:"sync_"+t,val:n,session:e.config.request.session};return i(o),void r(o)}try{window.localStorage.setItem("sync_"+t,JSON.stringify(n))}catch(t){e.reportException(t)}}function s(t,n){ni.indexOf(t)>=0&&(e.config.request.cookie[t]=n);var i=[];ni.indexOf(t)>=0&&null!==n&&i.push(t+"="+n);var r=c(ni);for(var o in r)o in r&&null!==r[o]&&o!==t&&i.push(o+"="+r[o]);ee("player",'"'+i.join("&")+'"',e.config.request.cookie_domain)}function c(e){var t=Z("player");if(!t)return null;t=t.substring(1,t.length-1);var n={};t.split("&").forEach(function(e){e=e.split("="),n[e[0]]=J(decodeURIComponent(e[1]||""))});var i=[].concat(e),r=i.reduce(function(e,t){if(t in n){var i=parseFloat(n[t]);return e[t]=isNaN(i)||"quality"===t?n[t]:i,e}return e[t]=null,e},{});return 1===i.length?r[e]:r}function u(e,t){t=J(t),a(e,t),s(e,t)}function l(t,n){var i=!0;switch(t){case"sync_quality":e.events.fire($e.changeQuality,n,i);break;case"sync_volume":e.events.fire($e.changeVolume,n,i);break;case"sync_captions":if(null===n){e.events.fire($e.turnCaptionsOff,i);break}e.events.fire($e.turnCaptionsOn,n,i);break;case"sync_login":d(n);break;case"sync_active":null!==n&&n!==e.config.request.session&&e.config.embed.autopause&&e.events.fire(Ge.becameInactive)}}function d(t){b>4||(b++,t&&!e.config.user.logged_in?e.events.fire(Ge.userLogIn):!t&&e.config.user.logged_in&&e.events.fire(Ge.userLoggedOut))}function f(){u("login",!!e.config.user.logged_in)}function h(){e.events.on(Ge.qualityChanged,function(e,t){t||u("quality",e)})}function p(){e.events.on(Ge.volumeChanged,function(t,n){e.config.request.cookie.volume=J(t),n||u("volume",t)})}function v(){e.events.on(Ge.captionsChanged,function(t,n){if(t){var i=t.language+"."+t.kind;return e.config.request.cookie.captions=J(i),void(n||u("captions",i))}e.config.request.cookie.captions=null,n||u("captions",null)})}function m(){e.events.on(Ge.playButtonPressed,function(){e.config.embed.settings.background||(u("active",e.config.request.session),e.events.fire(Ge.becameActive))}),e.events.on([Ge.pauseButtonPressed,Ge.ended],function(){c("active")===e.config.request.session&&u("active",null)})}function g(){e.events.on(Ge.userLoggedIn,function(){u("login",!0)})}function _(){return y?void window.addEventListener("message",function(t){var n=o(e.config.request.urls.proxy);t.origin===n&&"object"===Xe(t.data)&&"key"in t.data&&"newValue"in t.data?l(t.data.key,t.data.newValue):t.origin===window.location.origin&&t.data.session!==e.config.request.session&&l(t.data.key,t.data.val)},!1):void window.addEventListener("storage",function(t){if(0===t.key.indexOf("sync_")&&t.oldValue!==t.newValue&&window.localStorage.getItem(t.key)===t.newValue)try{l(t.key,JSON.parse(t.newValue))}catch(t){e.reportException(t)}},!1)}var y=0!==e.config.request.urls.proxy.indexOf(window.location.origin),b=0;return h(),p(),v(),m(),g(),n(),_(),{reset:f}}function ne(e){e=e||{};var t={};return e.on=function(n,i){n=[].concat(n);for(var r=0,o=n.length;r0&&void 0!==arguments[0]?arguments[0]:[];return e.getFileById=kr,e}function ae(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.item=function(e){return this[e]},e.getTrackById=kr,e}function se(e,t){for(var n=e,i=Array.isArray(n),r=0,n=i?n:n[rr.iterator]();;){var o;if(i){if(r>=n.length)break;o=n[r++]}else{if(r=n.next(),r.done)break;o=r.value}var a=o,s=pr(a,2),c=s[0],u=s[1];if(c<=t&&u>=t)return[c,u]}return[]}function ce(){return"undefined"!=typeof window.performance&&"function"==typeof window.performance.now?window.performance.now():Date.now()}function ue(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^16*Math.random()>>e/4).toString(16)})}function le(e){for(var t=window.atob(e),n=t.length,i=new Uint8Array(n),r=0;r=l?(o=u,r=(l*u).toFixed(2)):(r=c,o=(c/l).toFixed(2)),a=Math.max((c-r)/2,0),s=Math.max((u-o)/2,0),{width:r,height:o,left:a,top:s}}function ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.freeze(ur({get length(){return e.length},start:function(t){return xr(e,t)},end:function(e){return xr(t,e)}},rr.iterator,function(){return re(e,t)}))}function me(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];if(0===e.length)return 0;for(var n=0,i=0,r=0;r=1)return e[e.length-1];var n=e.length*t,i=Math.floor(n),r=i+1,o=n%1;return r>=e.length?e[i]:e[i]*(1-o)+e[r]*o}function _e(e){e.sort(function(e,t){return e-t});var t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}function ye(e){e=e||{};var t={};return e.on=function(n,i){n=[].concat(n);for(var r=0,o=n.length;r1)for(var i=0,r=e.length;i=t){n=i;break}return n}function c(t){if(!Te&&re.buffered&&re.buffered.length>0){t=t||re.currentTime;var n=a(re.buffered,t),i=re.buffered.end(n),r=i/re.duration;if(e.events.fire(Ge.loadProgress,i,re.duration,r),_e&&fe&&i===re.duration)return void o()}}function u(){ne.style.backgroundImage="url("+ne.getAttribute("data-thumb")+")"}function l(t){for(var n=t.target,i=n.activeCues,r=[],o=void 0,a=0,s=i.length;a"),text:i[a].text}));e.events.fire(Ge.cueChanged,n,r)}function d(){var t=void 0;e.config.request.ab_tests&&e.config.request.ab_tests.preload_segment&&(t=e.config.request.ab_tests.preload_segment.data.max_preload_stream_index);var n=[uo,Vr,ho];re=new xo(ie,n,{externalDisplays:[AirPlayExternalDisplay],swfScanner:{swfUrl:e.config.request.urls.flideo},mediaSourceScanner:{maxPreloadStreamIndex:t}}),re.on("scannerchange",function(){f(),setTimeout(function(){e.events.fire(re.supportsSettingVolume?$e.enableVolume:$e.disableVolume),e.events.fire(re.supportsTextTracks?$e.enableCaptions:$e.disableCaptions)},0)}),re.on("currentfilechange",function(t){t.mime===ze.hls&&e.events.fire($e.disableHd);var n=t.metadata.quality;if(t.mime===ze.dash){var i=e.config.request.files.dash.streams.map(function(e){return e.quality});n=P(e.config.embed.quality,i)||"auto",L(n)}e.events.fire(Ge.qualityChanged,n,!0)}),re.on("streamchange",function(t){var n=t.index,i=t.streams,r=e.config.request.files.dash.streams[n];e.events.fire(Ge.streamChanged,r,n,i)}),re.on("streambufferstart",function(t){var n=t.hasLowerStreamIndex;e.events.fire(Ge.ranIntoBuffer,n)}),re.on("streambufferend",function(){e.events.fire(Ge.playbackResumed)}),re.on("bandwidth",function(t){e.events.fire(Ge.adaptiveBandwidth,t)}),re.on("alert",function(e){var t=void 0;switch(e){case"streamstudder":if(Ae)return;t=ut.render("stream_studder")}ae.message=t,ae.show()}),re.on("cuepoint",function(t){e.events.fire(Ge.cuepoint,t)})}function f(){var t="none";("metadata"===e.config.request.flags.preload_video||ue||yt.iOS>=8)&&(t="metadata"),"auto"===e.config.request.flags.preload_video&&(t="metadata","MediaSourceScanner"===re.currentScanner&&(t="auto")),re.preload=t,e.events.on(Ge.mousedOver,function(){"metadata_on_hover"!==e.config.request.flags.preload_video||pe||e.verifyConfig().then(function(){return re.preload="metadata",!0}).catch(function(e){})})}function h(){re.on("loadedmetadata",function(t){Se=!0;var n=re.duration;isFinite(n)&&n>0&&(e.config.video.duration=n),e.config.video.video_width=re.videoWidth,e.config.video.video_height=re.videoHeight}),re.on("loadeddata",function(){0===re.currentTime&&re.paused&&i()}),re.on("durationchange",function(t){var n=re.duration;isFinite(n)&&(e.config.video.duration>0&&(ne.config.video.duration+1)||(e.config.video.duration=n))}),re.on("waiting",function(){we||n()}),re.on("canplay",function(){me=!0,i(),(e.config.embed.autoplay||fe||de&&!pe&&ve)&&o()}),re.on("canplaythrough",function(){ge=!0,i(),!de||pe||ve||o(),(ye||fe&&re.paused)&&o()}),re.on("progress",function(e){c()})}function p(){e.events.on(Ge.playInitiated,function(){t.classList.remove("invisible")}).on(Ge.playButtonPressed,r).on(Ge.pauseButtonPressed,function(){fe=!1,re.pause()}).on(Ge.becameInactive,function(){window.location.search.indexOf("autopause=0")<0&&!re.paused&&!e.config.embed.settings.background&&(fe=!1,e.events.fire(Ge.pauseButtonPressed))}),re.on("play",function(t){return Te=!1,pe||(!ve||me)&&(ve||ge)?(ie.classList.remove("invisible"),void e.events.fire(Ge.played,re.currentTime)):(e.events.fire(Ge.playInitiated),pe=!0,de=!0,void(fe=!0))}),re.on("pause",function(t){!pe||ye||ke||xe||e.events.fire(Ge.paused,re.currentTime,re.ended)}),re.on("playing",function(t){pe||(e.events.fire(Ge.playInitiated),pe=!0),c(),be=!0}),re.on("timeupdate",function(t){var r=re.currentTime;if(be&&_e&&r>0&&(be=!1,i()),re.buffered.length>0&&!_e){var o=a(re.buffered,r),s=re.buffered.end(o);if(!Le&&r>0&&rte&&(te=null)}oe&&(oe.classList.add("hidden"),oe=null)}),re.on("ended",function(t){ke||(e.config.embed.loop?re.play():(Le&&e.events.fire(Ge.fullscreenButtonPressed),e.events.fire(Ge.ended),fe=!1,de=!1))}),re.on("drmauthsuccess",function(e){he=!0})}function v(){ae=new ri(t.parentElement),ae.on("show",function(t){e.events.fire(Ge.alertVisibilityChanged,!0,t)}),ae.on("hide",function(t){var n=t.target,i=n&&"function"==typeof n.getAttribute;if(i)switch(n.getAttribute("data-context")){case"suggestion":e.events.fire($e.changeQuality,"auto"),t="suggestion";break;default:t="close"}(i||"qualitymenuauto"===t)&&(Ae=!0),e.events.fire(Ge.alertVisibilityChanged,!1,t)})}function m(){var t=!1;A(function(){t=!0}),re.on("error",function(n){if(!t)switch(n.name){case"BrowserNotSupported":e.events.fire(Ge.error,"not-supported"),Ee="not-supported";break;case"DRMFailure":e.events.fire(Ge.error,"drm-failure",function(t){var n="Unable to play video.",i="Please try again.",r=e.config.request.dynamic_drm_translation_map,o=t.message.code;return r&&parseInt(o,10)>0&&r[o]&&(n=r[o].title,i=r[o].msg),{title:n,message:i}}(n));break;case"FilesNotPlayable":e.events.fire(Ge.error,"not-supported"),Ee="not-supported";break;case"TextTracksNotSupported":e.events.fire($e.disableCaptions);break;case"HTMLSourceNotSupported":e.events.fire(Ge.error,"not-supported",{final:!1});break;case"HTMLDecode":e.events.fire(Ge.error,"decode",{final:!1});break;case"HTMLNetwork":e.events.fire(Ge.error,"network");break;case"HTMLUnknown":e.events.fire(Ge.error,"unknown")}})}function g(){e.events.on($e.changeLoop,function(t){e.config.embed.loop=!!t,re.loop=!!t}),e.events.fire($e.changeLoop,e.config.embed.loop)}function _(){e.events.on(Ge.scrubbingStarted,function(){n(),fe=!re.paused,ke=!0,re.pause()}),e.events.on(Ge.scrubbingEnded,function(e){ke=!1,e||o()}),e.events.on($e.seek,function(t,n){n||(n=(re.duration||e.config.video.duration)*s(t,0,1)),n=s(n,0,re.duration||e.config.video.duration),pe||(e.events.fire(Ge.playButtonPressed),pe=!0,de=!0,fe=!0),re.currentTime=n}),re.on("seeking",function(){we=!0},!1),re.on("seeked",function(){c();var t=re.currentTime,n=re.duration;e.events.fire(Ge.seeked,t,n,t/n),we=!1},!1)}function y(){e.events.on($e.changeVolume,function(t,n,i){i&&(t+=re.volume),re.volume=s(t,0,1),e.events.fire(Ge.volumeChanged,s(t,0,1),n)});var t=e.config.request.cookie.volume;e.config.embed.mute&&(t=0),e.events.fire($e.changeVolume,t,!0)}function b(){e.events.on($e.changeQuality,function(t,n){if(re.video.currentFile.mime===ze.dash)n=!0,L(t);else{var i=ti(e.telecine.video.files).filter(function(e){return parseInt(e.metadata.quality,10)<=parseInt(t,10)});i.sort(G()),i.length>0&&(Te=!0,re.video.currentFile=i[0]); }"auto"===t&&ae.hide("qualitymenuauto"),e.events.fire(Ge.qualityChanged,t,n)})}function w(){e.events.on(Ge.overlayOpened,function(){Pe=!0,pe&&!Ce&&(fe=!re.paused,re.pause())}),e.events.on(Ge.overlayClosed,function(){Pe=!1,fe&&!Ce&&o()})}function k(){e.events.on(Ge.popupOpened,function(e){pe&&!Ce&&(fe=!re.paused,re.pause())}),e.events.on(Ge.popupClosed,function(e){Ce||o()})}function x(){e.events.on(Ge.didEnterFullscreen,function(t,n){ie.classList.remove("hide-webkit-controls"),t||(pe||yt.browser.safari||(re.poster=ne.getAttribute("data-thumb")),Le=!0,setTimeout(function(){re.video.textTracks.forEach(function(e){"hidden"===e.mode&&(e.mode="showing")})},500)),n||!yt.windowsPhone||yt.browser.edge||e.events.fire($e.toggleNativeControls,!0)}),e.events.on(Ge.didExitFullscreen,function(e){re.poster="",pe||ie.classList.add("invisible"),Le=!1,le&&ie.classList.add("hide-webkit-controls"),re.video.textTracks.forEach(function(e){"showing"===e.mode&&(e.mode="hidden")})}),e.events.on(Ge.playInitiated,function(){re.poster=""})}function S(){e.events.on($e.toggleNativeControls,function(e){return e?(re.controls=!0,void t.classList.add("native-controls")):(re.controls=!1,void t.classList.remove("native-controls"))})}function T(){e.events.on(Ge.signatureExpired,function(){te=re.currentTime}),e.events.on(Ge.requestConfigReloaded,function(e){M()}),e.events.on(Ge.configChanged,function(e){M(),j()})}function E(){et(ie).on("transitionend",function(e){"opacity"===e.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&ie.classList.remove("transition")},!1),e.events.on($e.reset,function(t){Te=!0,re.paused||(re.pause(),e.events.fire(Ge.paused,re.currentTime)),u(),ie.classList.add("transition"),ie.classList.add("invisible"),t&&(Se=!1),pe=!1,fe=!1,Ee=null,setTimeout(function(){re.currentTime=0},300)})}function P(t){var n=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return e.config.embed.on_site||yt.android||yt.iOS||yt.windowsPhone||e.config.video.vod||!t?null:n.length&&n.indexOf(t)===-1?null:(e.events.fire(Ge.forcedQuality,t),t)}function L(t){if("auto"===t)return re.video.currentFile.restrictedStreamIndexes=[],void(Ie=!1);var n=e.config.request.files.dash.streams.map(function(e){return e.quality}).indexOf(t);n!==-1&&(re.video.currentFile.restrictedStreamIndexes=[n],Ie=n)}function C(){var t=e.config.request.files,n=ti(t.progressive).filter(W(t.progressive)),i=n.some(z);yt.mobileAndroid&&(i=!1);var r="720p";if(i){var o=ti(n).map(V);o.indexOf("1080p")!==-1&&o.indexOf("720p")===-1&&(r="1080p")}var a=e.config.request.cookie.hd||e.config.video.default_to_hd?r:"360p",s=n.map(function(e){return e.quality}),c=P(e.config.embed.quality,s),u=e.config.request.cookie.quality||c||a,l=K({files:t.progressive,preference:u,priorityOffset:2}),d=e.config.request.drm&&yt.browser.safari;if(t.hls&&(yt.iPhone||yt.iPad)||d){var f=t.hls.default_cdn,h=t.hls.cdns[f].url;l.push({id:"hls-"+e.config.video.id,src:h,mime:ze.hls,priority:2,metadata:{cdn:f,origin:t.hls.cdns[f].origin,quality:"sd"}})}var p=!1;if(t.dash&&!d){var v=t.dash.default_cdn;p=t.dash.streams.some(z),l.push({id:"dash-"+e.config.video.id,src:t.dash.cdns[v].url,mime:ze.dash,priority:1,metadata:{cdn:v,origin:t.dash.cdns[v].origin,quality:"sd"}})}return i||p||e.events.fire($e.disableHd),l}function O(){return"text_tracks"in e.config.request?e.config.request.text_tracks.map(function(e){return{id:e.id,src:e.url,kind:e.kind,label:e.label,language:e.lang}}):[]}function I(){var t=e.config.request.files,n=t.hls.default_cdn;if(t.hls){var i=t.hls.cdns[n].url;return t.hls.cdns[n].captions&&(i=t.hls.cdns[n].captions),{src:i,mime:ze.hls,metadata:{cdn:e.config.request.files.hls.cdn,origin:e.config.request.files.hls.origin,quality:"sd"}}}return null}function M(){var t=C(),n=O();if(re.video&&re.video.id===""+e.config.video.id)return t.forEach(function(e){var t=re.video.files.getFileById(e.id);t&&(t.src=e.src)}),void n.forEach(function(e){var t=re.video.textTracks.getTrackById(e.id);t&&(t.src=e.src)});if(re.video={id:e.config.video.id,title:e.config.video.title,subtitle:"from "+e.config.video.owner.name,files:t,textTracks:n,externalDisplayFiles:{AirPlay:I()},metadata:{thumbnail:e.config.video.thumbs[640],useHls:e.config.request.drm&&yt.browser.safari,drm:e.config.request.drm}},0===n.length){var i=!0;return void e.events.fire($e.turnCaptionsOff,i)}if(re.video.textTracks.forEach(function(t){t.on("cuechange",l),t.on("modechange",function(n){Le&&"showing"===t.mode&&e.events.fire(Ge.captionsChanged,t)})}),null===e.config.request.cookie.captions||"null"===e.config.request.cookie.captions)return void e.events.fire($e.turnCaptionsOff);var r=!0;e.events.fire($e.turnCaptionsOn,e.config.request.cookie.captions,r)}function F(e,t,n,i){if(he){var r=new XMLHttpRequest;r.open("DELETE",e+"/plays/"+t+"/"+n+"?token="+i,!1),r.send(),he=!1}}function q(){e.config.embed.time>0&&(re.currentTime=e.config.embed.time,e.config.embed.time=0)}function B(){e.events.on($e.turnCaptionsOn,function(t,n){if(!Oe||Oe.id!==t){var i=re.video.textTracks.getTrackById(t),r=!0;if(!i){var o=R(t,re.video.textTracks);i=o.track,r=o.exactMatch}i!==Oe&&setTimeout(function(){re.video.textTracks.forEach(function(e){e.mode=e===i?"hidden":"disabled"}),e.events.fire(Ge.captionsChanged,i,n||!r),Oe=i},0)}}).on($e.turnCaptionsOff,function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];setTimeout(function(){re.video.textTracks.forEach(function(e){e.mode="disabled"}),e.events.fire(Ge.cueChanged),Oe&&(Oe=null,e.events.fire(Ge.captionsChanged,null,t))},0)})}function D(){re.on("externaldisplayavailable",function(t){var n=t.type;if(!e.config.request.drm)switch(n){case"AirPlay":e.events.fire(Ge.airPlayAvailable)}}),re.on("externaldisplayunavailable",function(t){var n=t.type;if(!e.config.request.drm)switch(n){case"AirPlay":e.events.fire(Ge.airPlayNotAvailable)}}),re.on("externaldisplayactivated",function(t){var n=t.type;switch(Ce=!0,n){case"AirPlay":e.events.fire(Ge.airPlayActivated)}}),re.on("externaldisplaydeactivated",function(t){var n=t.type;switch(Ce=!1,n){case"AirPlay":e.events.fire(Ge.airPlayDeactivated)}}),e.events.on(Ge.airPlayButtonPressed,function(){re.showExternalDisplayPicker("AirPlay")})}function N(){re.on("play",function(){return re.supportsPresentationMode("picture-in-picture")?void e.events.fire(Ge.pictureInPictureAvailable):void e.events.fire(Ge.pictureInPictureNotAvailable)}),re.on("presentationmodechange",function(t){e.events.fire("picture-in-picture"===t?Ge.pictureInPictureActivated:Ge.pictureInPictureDeactivated),re.video.textTracks.forEach(function(e){"picture-in-picture"===t&&"hidden"===e.mode&&(e.mode="showing"),"inline"===t&&"showing"===e.mode&&(e.mode="hidden")})}),e.events.on($e.activatePictureInPicture,function(){re.supportsPresentationMode("picture-in-picture")&&(re.presentationMode="picture-in-picture")}),e.events.on($e.deactivatePictureInPicture,function(){re.supportsPresentationMode("picture-in-picture")&&(re.presentationMode="inline")})}function j(){e.config.embed.autoplay&&(de=!0,e.events.fire(Ge.playButtonPressed))}function H(){e.events.on(Ge.enteredTinyMode,function(){ce=!0}).on([Ge.enteredMiniMode,Ge.enteredNormalMode],function(){ce=!1})}function U(){var t=0,n=null,i=function(){n||(n=e.config.embed.color),e.events.fire($e.changeColor,"#46d439")},r=function(){n&&(e.events.fire($e.changeColor,n),n=null)};e.events.on($e.setEffect,function(n){if(re.deactivateEffects(),"ascii"===n||"ascii-color"===n){if(re.supportsEffect(lo)){re.activateEffect(lo,{color:"ascii-color"===n,fps:t||re.video.currentFile.metadata.fps});try{var o=e.config.request.files.dash.streams;o.sort(G("asc"));var a=e.config.request.files.dash.streams.indexOf(o[0]);re.video.currentFile.restrictedStreamIndexes=[a]}catch(e){}return e.element.setAttribute("data-filter",n),"ascii"===n?void i():void r()}return void e.events.fire($e.setEffect,"none")}if("ascii"!==n&&"ascii-color"!==n){var s=[];Ie!==!1&&s.push(Ie),re.video.currentFile.restrictedStreamIndexes=s}r(),e.element.setAttribute("data-filter",n)}).on(Ge.streamChanged,function(e,n,i){t=e.fps})}function $(){A(function(){var t=e.config.request.drm;t&&F(t.hoover_url,t.user,t.asset,t.hoover_token)}),e.events.on(Ge.loadVideo,function(){var t=e.config.request.drm;t&&F(t.hoover_url,t.user,t.asset,t.hoover_token)})}function X(){function t(){window.addEventListener("resize",d,!1),window.addEventListener("orientationchange",d,!1),e.events.on(Ge.didEnterFullscreen,d),yt.android&&window.addEventListener("deviceorientation",_,!1),yt.pointerEvents?et(u).on("pointerdown",f).on("pointermove",h).on("pointerup",p).on("pointerleave",y):et(u).on("touchstart",v).on("touchend",g).on("touchmove",m).on("mousedown",f).on("mousemove",h).on("mouseup",p).on("mouseleave",y)}var n=this;if(!yt.threeSixtyVideo)return void e.events.on(Ge.playInitiated,function(){e.config.video.is_panorama&&(ae.message=ut.render("threesixty_support_alert",{faqLink:"https://vimeo.com/faq"}),ae.show())});var i="v1"===e.config.video.design_version_360,r="v2"===e.config.video.design_version_360,o=null,a=function(){ne.querySelector("video").classList.remove("threesixty-video"),e.element.classList.remove("threesixty-grabbable"),e.element.classList.remove("threesixty-grabbing"),se&&se.hide()},s=function(){Fe=!1,a(),o&&(re.deactivateEffect(Oo),o=null),e.config.video.is_panorama&&re.supportsEffect(Oo)&&(o=re.activateEffect(Oo,{threeUrl:e.config.request.urls.three_js,fps:e.config.video.fps,isMobile:yt.android,dimensions:e.config.embed.on_site?{width:1080,height:540}:{width:640,height:360},transparentCanvasWrap:i||r}),Fe=!0)};s(),e.events.on(Ge.configChanged,s);var c=function(e){return function(){for(var t=arguments.length,i=Array(t),r=0;r=8&&!yt.iPad,le=yt.iOS>=8&&!yt.iPad,de=!1,fe=!1,he=!1,pe=!1,ve=!0,me=!1,ge=!1,_e=!1,ye=!1,be=!1,we=!1,ke=!1,xe=!1,Se=!1,Te=!0,Ee=null,Pe=!1,Le=!1,Ce=!1,Oe=null,Ae=!1,Ie=!1;ie.classList.add("invisible"),le&&ie.classList.add("hide-webkit-controls");var Me=null,Fe=!1,qe=null;return d(),f(),h(),p(),v(),m(),g(),_(),y(),b(),w(),k(),x(),S(),T(),E(),B(),q(),D(),N(),H(),U(),M(),X(),$(),e.ready().then(function(){return setTimeout(function(){return j()},0),null}).catch(function(e){}),e.events.fire(Ge.videoModuleReady),{telecine:re}}function we(e){function t(){var e=T(g.clientWidth*yt.devicePixelRatio,g.clientHeight*yt.devicePixelRatio),t=e.width,n=e.height,i=O.getAttribute("data-thumb-width");if(t<=parseInt(i,10)||0===t)return je.resolve();var r=E({width:t,height:n,baseUrl:x.config.video.thumbs.base,webpSupport:x.config.request.flags.webp});if(O.setAttribute("data-thumb",r),O.setAttribute("data-thumb-width",t),x.config.embed.autoplay&&"beginning"!==x.config.embed.outro)return je.resolve();var o=P(r).then(function(e){"none"!==O.style.backgroundImage&&(O.style.backgroundImage="url("+e.src+")");var t=x.config.video.width/x.config.video.height,n=e.width/e.height;return(n<=.95*t||n>=1.05*t)&&O.classList.remove("cover"),e}).catch(function(e){c(e)});return je.race([o,new je(function(e){return setTimeout(e,2e3)})])}function n(){var e=a({width:x.config.video.width,height:x.config.video.height,elementWidth:g.clientWidth,elementHeight:g.clientHeight}),t=(e.extraWidth,e.extraHeight,e.scaleFactor);t>1?(O.classList.add("cover"),A.style.webkitTransform="scale("+t+")",A.style.transform="scale("+t+")"):(O.classList.remove("cover"),A.style.webkitTransform="",A.style.transform="")}function i(e){var t=e.old,n=e.loaded;if(!t);if(window.parent!==window){var i="Private Video on Vimeo";n.view!==He.main&&n.view!==He.privateUnlocked||(i=n.video.title+" from "+n.video.owner.name+" on Vimeo"),document.title=i,history&&history.replaceState&&n.video&&t&&history.replaceState({id:n.video.id},"","/video/"+n.video.id)}if(n.view!==He.main&&n.view!==He.privateUnlocked)throw new Error("Config not authorized: "+n.view);t&&t.embed&&t.embed.color!==n.embed.color&&k.fire($e.changeColor,n.embed.color),W&&W.reset(),(yt.mobileAndroid||yt.iPhone||yt.windowsPhone||yt.browser.bb10||yt.iPad||yt.android)&&(n.embed.autoplay=0);var r=!t||!t.video||t.video.id!==n.video.id;return r&&O.removeAttribute("data-thumb-width"),R=null,k.fire($e.reset),k.fire(Ge.configChanged,r),e}function r(){window.requestAnimationFrame(function(){g.classList.remove("loading"),$()})}function o(e){return w.then(function(){if(p(e),O.setAttribute("data-thumb",""),O.setAttribute("data-thumb-width",""),O.style.backgroundImage="","function"!=typeof U.authorizationHandler)throw new Error("Config was not authorized.");return U.authorizationHandler(r)}).then(function(e){x.config=e;var t=!0;return R=null,k.fire($e.reset),k.fire(Ge.configChanged,t),e})}function c(e,t){q&&q.reportException(e,t)}function u(){var e=document.location.hash,t=l(e);null!==t&&(x.config.embed.time=s(t,0,x.config.video.duration),yt.touch||(x.config.embed.autoplay=1),e.indexOf("at=")!==-1&&history&&history.replaceState&&history.replaceState("","",window.location.pathname+window.location.search))}function d(){k.on(Ge.userLogIn,function(e){x.reload().then(function(t){if(!x.config.user.logged_in)return k.fire(Ge.loginFailure),t;switch(k.fire(Ge.userLoggedIn,e),e){case"like":x.config.user.liked&&k.fire(Ge.liked);break;case"watch-later":x.config.user.watch_later&&k.fire(Ge.addedToWatchLater);break;case"private":k.fire(Ge.privateUnlocked)}return t}).catch(function(e){c(e)})}),k.on(Ge.userLoggedOut,function(){x.reload().catch(function(e){c(e)})})}function f(){H=t(),k.on([Ge.playInitiated,Ge.playButtonPressed],function(){var e=yt.threeSixtyVideo&&x.config.video.is_panorama;e||(O.style.backgroundImage="none")}),k.on(Ge.didEnterFullscreen,function(){"none"===O.style.backgroundImage&&"beginning"!==x.config.embed.outro||(H=t())});var e=null;window.addEventListener("resize",function(){clearTimeout(e),e=setTimeout(function(){H=H.then(function(){return t()}).catch(function(e){})},250),n()},!1)}function h(e){n(),u(),d(),f(),m(e)}function p(e){z||(z=new B(e),Object.keys(z).forEach(function(e){if("function"==typeof z[e])return void Object.defineProperty(X,e,{enumerable:!0,value:z[e]});var t={enumerable:!0,get:z[e].get};z[e].set&&(t.set=z[e].set),Object.defineProperty(X,e,t)}))}function m(e){var t=x.config.embed.settings.background&&(yt.iOS||yt.android);if(!t){var n=new be(e,g.querySelector(".video-wrapper"));F=n.telecine}void new I(e),void new D(e,g.querySelector(".captions")),void new Y(e),void new Q(e),W=new te(e),p(e)}var g=e.element,_=e.delegate,y=void 0===_?{}:_,b=e.cssLoadedPromise,w=void 0===b?je.resolve(null):b,k=(e.name,C()),x=new N({events:k}),S=v();g.classList.add("player-"+S),g.classList.add("loading"),g.id||(g.id="player"+S),g.innerHTML=ut.render("outer",{strings:{back:"Back",close:"Close overlay"}});var O=g.querySelector(".video"),A=g.querySelector(".telecine");if(yt.iOS){var M=document.createElement("video");A.appendChild(M);try{M.play(),M.pause()}catch(e){c(e)}}var F=null,q=null,R=null,j=null,H=null,V=null,U={},z=null,W=null,$=void 0,G=new je(function(e,t){$=e}).then(function(){return k.fire(Ge.ready),null}),X={get config(){return x.config},set config(e){x.config=e},get delegate(){return y},set delegate(e){y=e},ready:function(e){return e?void G.then(function(){return e()}).catch(function(e){c(e)}):G},get sessionId(){return x.config.request.session}},K={get config(){return x.config},get raven(){return q},get element(){return g},get events(){return k},get uuid(){return S},get externalApi(){return X},get telecine(){return F},init:function(e,t){return j?j:(U=t,j=x.load(e).then(i).catch(function(e){return o(K)}).then(function(){try{q=new L(x.config)}catch(e){}return null}).then(function(){return"function"==typeof U.initializationHandler?je.resolve(t.initializationHandler()):null}).then(function(){return h(K),"function"==typeof U.postInitializationHandler?je.resolve(t.postInitializationHandler()):null}).then(function(){return je.all([H,w])}).then(r).catch(function(e){c(e)}))},loadVideo:function(e){return V===e&&R?R:(k.fire(Ge.loadVideo),V=e,g.classList.add("loading"),R=x.load(e).then(i).catch(function(e){return c(e),o(K)}).then(function(e){return H=t(),je.resolve(H)}).then(r))},performDelegateAction:function(e){var t=arguments.length<=1||void 0===arguments[1]?function(){}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?[]:arguments[2],i=void 0;if(y&&y[e.will]){var r;if(i=(r=y)[e.will].apply(r,[x.config.video.id].concat(n)),i===!1)return}t.apply(void 0,[x.config.video.id].concat(n,[i])),y&&y[e.did]&&y[e.did]()},ready:function(){return G},verifyConfig:function(){return x.verify()},reportException:function(e,t){c(e,t)}};return K}function ke(e,t,i,o){function a(){x.style.left="-999999px";var e=r(t),o=r(i),a=r(x),s=e.left+e.width/2-a.width/2-o.left,c=o.height,u=o.left+s+a.width,l=i.classList.contains("play-bar")?o.right:o.width-parseInt(window.getComputedStyle(i).paddingRight,10);if(u>l){var d=u-l;s-=d;var f=e.left-(o.left+s)+e.width/2;f!==b&&(n(".player .menu::after","left:"+f+"px",document.styleSheets[document.styleSheets.length-1]),b=f)}x.style.left=s+"px",x.style.bottom=c+"px"}function s(){x.style.height="auto";var e=r(o.element),t=r(x),n=e.bottom-t.bottom,i=0,a=o.element.querySelector(".title");if(a){var s=r(a);i=Math.max(10,s.height)}var c=e.height-n-i,u=e.height/2,l=Math.max(c,u),d=x.querySelector(".scrollable-items"),f=d.children,h=0;if(f&&f.length){var p=f[0],v=getComputedStyle(p),m=p.clientHeight+parseInt(v.marginTop,10)+parseInt(v.marginBottom,10);h=m/2}t.height>l&&(x.style.height=Math.min(l-h,t.height)+"px")}function c(e){var t=document.createElement("ul");t.classList.add("menu"),t.classList.add("rounded-box"),t.classList.add("hidden"),t.classList.add("invisible"),t.setAttribute("hidden",""),t.setAttribute("id",E),t.setAttribute("role","menu"),A=document.createElement("div"),A.classList.add("item-container");var n=document.createDocumentFragment();e.forEach(function(e){var t=document.createElement("li");t.setAttribute("tabindex","0"),t.setAttribute("role","menuitemradio"),t.setAttribute("aria-checked","false"),t.setAttribute("data-id",e.id),t.innerHTML=""+e.label+"",e.active&&(t.classList.add("active"),t.setAttribute("aria-checked","true"),S=t),n.appendChild(t)}),O=document.createElement("div"),O.classList.add("scrollable-items");var i=document.createElement("div");i.classList.add("sticky-items"),i.appendChild(n.lastChild),O.appendChild(n);var r=document.createElement("div");return r.classList.add("top-shadow"),A.appendChild(O),A.appendChild(i),A.appendChild(r),t.appendChild(A),I=O.firstChild,M=O.lastChild,O.addEventListener("mousewheel",u),O.addEventListener("scroll",u),O.addEventListener("focusin",l),o.events.on(Ge.menuVisibilityChanged,function(e){setTimeout(u,10)}),o.events.on([Ge.enteredTinyMode,Ge.enteredMiniMode,Ge.enteredNormalMode],function(e){u(),a(),T&&o.events.fire(Ge.menuVisibilityChanged,T,y)}),t}function u(e){var t=O,n=t.scrollHeight,i=t.scrollTop,r=t.clientHeight,o=n-r,a=e||{},s=a.deltaY,c=void 0===s?0:s;return A.classList.remove("scroll-off"),n-r<=1?void A.classList.add("scroll-off"):(i>=o?(P=!0,A.classList.add("scroll-end")):P&&(P=!1,A.classList.remove("scroll-end")),i<=0?(L=!0,A.classList.add("scroll-start")):L&&(L=!1,A.classList.remove("scroll-start")),void((P&&c>0||L&&c<0)&&e.preventDefault()))}function l(e){var t=e.target,n=I.contains(t),i=M.contains(t);n?O.scrollTop=0:i&&(O.scrollTop=O.scrollHeight)}function d(e){T||(e=e||t.contains(document.activeElement),x.classList.remove("hidden"),x.removeAttribute("hidden"),a(),a(),s(),t.setAttribute("aria-expanded","true"),T=!0,o.events.fire(Ge.menuVisibilityChanged,T,y),window.requestAnimationFrame(function(){x.classList.remove("invisible"),x.classList.add("open"),u(),e&&(S||m()[0]).focus()}))}function f(){T&&(t.setAttribute("aria-expanded","false"),T=!1,o.events.fire(Ge.menuVisibilityChanged,T,y),x.classList.add("invisible"))}function h(e){return T?(f(),!1):(d(e),!0)}function p(e){S&&(S.classList.remove("active"),S.setAttribute("aria-checked","false"));var t=x.querySelector('[data-id="'+e+'"]');t&&(S=t,S.classList.add("active"),S.setAttribute("aria-checked","true"))}function v(){x.parentElement.removeChild(x)}function m(){var e=ti(x.querySelectorAll('[tabindex="0"]'));return e}function g(){x=c(e),t.setAttribute("aria-controls",E),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-haspopup","true"),w(x,["li","span"],function(){var e="SPAN"===this.tagName?this.parentElement:this;k.fire("selected",e.getAttribute("data-id"))}),w(t,function(){h()}),et(window).on("focus",function(e){var n=document.activeElement,i=x.contains(n),r=t.contains(n);i||r||f()});var n=function(e){if(("keypress"===e.type&&13===e.which||"keydown"===e.type&&32===e.which)&&x.contains(document.activeElement))return k.fire("selected",document.activeElement.getAttribute("data-id")),f(),!1};et(x).on("keydown",n),et(x).on("keypress",n),window.addEventListener("resize",a),i.insertBefore(x,t.nextSibling)}function _(){et(document).on("click",function(e){T&&!t.contains(e.target)&&f()}),et(x).on("transitionend",function(e){this===x&&"opacity"===e.propertyName&&x.classList.contains("invisible")&&(x.classList.add("hidden"),x.setAttribute("hidden",""),x.classList.remove("open"))}),window.addEventListener("blur",f,!1),o.events.on(Ge.didExitFullscreen,f).on(Ge.controlBarVisibilityChanged,function(e){e||f()})}var y,b,k=C(),x=null,S=null,T=!1,E="menu-"+Math.round(1e3*Math.random()+(new Date).getTime()),P=!1,L=!1,O=void 0,A=void 0,I=void 0,M=void 0;return g(),_(),y={show:d,hide:f,toggle:h,setActiveItem:p,on:k.on,off:k.off,destroy:v,button:t,element:x,get focusableItems(){return m()}}}function xe(e,t,n){return e=String(e),new Array(t-e.length+1).join(n||"0")+e}function Se(e,t){var n=Math.floor(e/3600%60),i=Math.floor(e/60%60);if(e=Math.floor(e%60),t){var r=e+" second"+(1===e?"":"s");return i>0&&(r=i+" minute"+(1===i?"":"s")+", "+r),n>0&&(r=n+" hour"+(1===n?"":"s")+", "+r),r}return(n>0?n+":":"")+xe(i,2)+":"+xe(e,2)}function Te(e,t){function n(){De=null,Ne=null}function i(){if(!Ne){var e=ie.getBoundingClientRect().left;ie.offsetWidth=n.length)break;a=n[r++]}else{if(r=n.next(),r.done)break;a=r.value}var s=a,c=s.getBoundingClientRect(),u=c.left,l=c.right;if(t>=u&&t<=l){var d=parseFloat(s.getAttribute("data-time"));return d/e.config.video.duration}}return o(t)}function c(t,n){Te&&!Fe&&(n=n||e.config.video.duration*t||0,window.requestAnimationFrame(function(){u(t,n),l(t,n)}))}function u(e,t){ce.style.left=Math.min(h(100*e),100)+"%",ue.innerHTML=Se(t)}function l(e,t){var n=Math.min(h(100*e),100);ae.style.width=n+"%",ae.setAttribute("aria-valuenow",h(t)),ae.setAttribute("aria-valuetext",Se(Math.round(t),!0)+" played"),te.setAttribute("width",n+"%")}function d(e,t){var n=Math.min(h(100*e),100);oe.style.width=n+"%",oe.setAttribute("aria-valuenow",h(t)),oe.setAttribute("aria-valuetext",Se(t,!0)+" loaded"),ee.setAttribute("width",n+"%")}function f(){return Te=!0,Be&&(qe=!1,t.classList.add("invisible"),S(),g()),J.classList.contains("state-playing")?(e.events.fire(Ge.pauseButtonPressed),p()):(e.events.fire(Ge.playButtonPressed),v()),!yt.android}function p(){Re=!1,J.classList.remove("state-playing"),J.classList.add("state-paused");var e=J.getAttribute("data-title-play");J.setAttribute("title",e),J.setAttribute("aria-label",e)}function v(){Re=!0,Be&&S(),J.classList.add("state-playing"),J.classList.remove("state-paused");var e=J.getAttribute("data-title-pause");J.setAttribute("title",e),J.setAttribute("aria-label",e)}function m(){qe&&(xe||(Te&&Me||Pe||Ze)&&(Ee||(!Ye&&!Je||Pe)&&(Pe&&e.config.view===He.privateUnlocked||Oe||Le||(qe=!1,e.events.fire(Ge.controlBarVisibilityChanged,qe),t.classList.add("invisible")))))}function g(){qe||Pe||(t.classList.remove("hidden"),t.removeAttribute("hidden"),setTimeout(function(){qe=!0,e.events.fire(Ge.controlBarVisibilityChanged,qe),t.classList.remove("invisible")},0))}function _(t,n){var i=[];"text_tracks"in e.config.request&&(e.config.request.text_tracks.forEach(function(e){var t="CC"===e.label.substring(e.label.length-2),n="captions"!==e.kind||t?"":" CC";i.push({label:e.label+n,id:e.id,active:Xe===""+e.id})}),i.push({label:"None",id:"off",active:null===Xe}));var r=new ke(i,t,n,e);return r.on("selected",function(t){return"off"===t?void e.events.fire($e.turnCaptionsOff):void e.events.fire($e.turnCaptionsOn,t)}),r}function y(){window.requestAnimationFrame(function(){u(0,e.config.video.duration),l(0,0),d(0,0)})}function b(){Te=!1,Ee=!1,Le=!1,Ae=!1,Fe=!1,xe=!1,Me=!1,We=!0,_e&&(_e.destroy(),_e=null),Ve&&(Ve.destroy(),Ve=null)}function k(){if(!e.config.embed.settings.custom_logo)return null;var t=e.config.embed.settings.custom_logo,n=t.img;return yt.devicePixelRatio>=2&&(n=n.replace(/(mw|mh)=(\d+)/g,function(e,t,n){return t+"="+2*parseInt(n,10)})),{showLink:null!==t.url,url:t.url,img:n,sticky:t.sticky,width:t.width,height:t.height}}function x(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];if(pe){var t,n=1/ve.length,i=e/n,r=Math.ceil(i),o=i%1;o<=.33&&(t="fill1"),o>.33&&o<=.66&&(t="fill2"),ve.forEach(function(e,n){return e.classList.remove("fill0"),e.classList.remove("fill1"),e.classList.remove("fill2"),n===r-1&&o&&o<=.66?void e.classList.add(t):void(n>r-1&&e.classList.add("fill0"))}),pe.setAttribute("aria-valuenow",e.toFixed(3)),pe.setAttribute("aria-valuetext",Math.round(100*e)+"%")}}function S(){if(e.config.view===He.main||e.config.view===He.privateUnlocked){var n=e.config.embed.settings,i={show:n.logo,showLink:!!e.config.video.url,url:e.config.video.url},r=k();if(e.config.embed.settings.watch_trailer&&!Te&&!Re&&!e.config.embed.autoplay&&e.config.embed.on_site)return void T(i,r);var o=!e.telecine||e.telecine.supportsSettingVolume,a=!e.telecine||e.telecine.supportsTextTracks,s="text_tracks"in e.config.request&&e.config.request.text_tracks.length,c={targetBlank:0===e.config.embed.on_site,playState:Re?"playing":"paused",volume:o&&n.volume,ccButton:a&&s,ccOn:null!==Xe,hdButton:We&&e.config.video.hd,airplayButton:yt.airPlay,fullscreenButton:n.fullscreen,vimeoLogo:i,duration:Se(e.config.video.duration),rawDuration:e.config.video.duration,strings:{play:"Play",pause:"Pause",loadedBar:"loaded",playedBar:"played",volume:"Volume (use arrow keys to change)",captions:"Choose captions",hd:"Select video quality",effect:"Choose an effect to apply to the video",airPlay:"Choose an AirPlay device",airPlayOff:"Turn off AirPlay",pipEnter:"Enter Picture-in-Picture",pipReturn:"Exit Picture-in-Picture",fullscreen:"Fullscreen",enterFullscreen:"Enter full screen",exitFullscreen:"Exit full screen",watchOnVimeo:"Watch on vimeo.com"}};r&&(c.customLogo=r),t.classList.remove("trailer"),Be=!1,t.innerHTML=ut.render("controlbar",c),J=t.querySelector(".play"),Z=J.querySelector(".buffer"),ee=J.querySelector(".loaded"),te=J.querySelector(".played"),ne=t.querySelector(".play-bar"),ie=t.querySelector(".progress"),re=ne.querySelector(".buffer"),oe=ne.querySelector(".loaded"),ae=ne.querySelector(".played"),se=ne.querySelector(".cuepoints"),ce=t.querySelector(".timecode"),ue=ce.querySelector(".box"),le=t.querySelector(".ghost-timecode"),de=le.querySelector(".box"),fe=t.querySelector(".thumb-preview"),he=t.querySelector(".thumb"),pe=t.querySelector(".volume"),pe&&(ve=ti(pe.querySelectorAll("div")),x(e.config.request.cookie.volume)),me=t.querySelector(".hd"),ge=t.querySelector(".play-bar .cc"),Ke=t.querySelector(".effect"),ye=t.querySelector(".pip"),yt.airPlay&&(be=t.querySelector(".airplay")),we=t.querySelector(".fullscreen"),Ee=!1,Te||K(),qe&&e.events.fire(Ge.controlBarVisibilityChanged,qe),Ze&&m()}}function T(n,i){t.classList.add("trailer");var r={vimeoLogo:n,text:e.config.video.vod.button_text||"Watch Trailer",strings:{playTrailer:"Play Trailer",watchOnVimeo:"Watch on vimeo.com"}};i&&(r.customLogo=i),t.innerHTML=ut.render("controlbar_trailer",r),J=t.querySelector(".play"),Be=!0}function E(){w(t,".play",f),e.events.on([Ge.playInitiated,Ge.playButtonPressed],v),e.events.on([Ge.pauseButtonPressed,Ge.paused,Ge.error],p),e.events.on(Ge.played,function(){v()}),e.events.on(Ge.ended,function(){Fe=!1,p(),c(1)}),e.events.on(Ge.overlayOpened,function(e){ "notsupported"===e&&p()})}function L(){e.events.on(Ge.loadProgress,function(e,t,n){xe||window.requestAnimationFrame(function(){d(n,e)})})}function C(){e.events.on(Ge.bufferStarted,function(e){e.initial;re.classList.remove("hidden"),oe.classList.add("hidden"),Z.setAttribute("class",Z.getAttribute("class").replace(/\s+hidden/,"")),Oe=!0,Ze||g()}),e.events.on(Ge.bufferEnded,function(){re.classList.add("hidden"),oe.classList.remove("hidden"),Z.setAttribute("class",Z.getAttribute("class")+" hidden"),Oe=!1})}function O(){function n(n){if(!n.button||2!==n.button){e.element.classList.add("scrubbing"),e.events.fire(Ge.scrubbingStarted);var s=n.type;if("pointerdown"===s||"MSPointerDown"===s){o=n.pointerId;try{n.target.msSetPointerCapture?n.target.msSetPointerCapture(o):n.target.setPointerCapture(o)}catch(e){}et(t).on("pointermove",".progress",i).on("pointerup",".progress",r)}else"touchstart"===s?et(t).on("touchmove",i).on("touchend",r):et(document).on("mousemove",i).on("mouseup",r);var d=n.clientX;n.targetTouches&&n.targetTouches.length>0&&(d=n.targetTouches[0].clientX,n.preventDefault());var f=a(d),h=null;if(Te)c(f);else{var p=e.config.video.duration*f;u(f,p),l(f,p),Fe=!0}return e.events.fire($e.seek,f,h),!1}}function i(t){if(Fe=!1,o===t.pointerId&&t.isPrimary!==!1){var n=t.clientX;t.targetTouches&&t.targetTouches.length>0&&(n=t.targetTouches[0].clientX,t.preventDefault());var i=a(n);c(i),e.events.fire($e.seek,i)}}function r(n){var o=n.type;"pointerup"===o||"MSPointerUp"===o?et(t).off("pointermove",".progress",i).off("pointerup",".progress",r):"touchend"===n.type?et(t).off("touchmove",i).off("touchend",r):et(document).off("mousemove",i).off("mouseup",r),e.events.fire(Ge.scrubbingEnded),e.element.classList.remove("scrubbing")}e.events.on(Ge.playProgress,function(t,n,i){Fe&&(0===e.config.embed.time||e.config.embed.time>0&&t>=e.config.embed.time)&&(Fe=!1),Le||c(i,t)}),e.events.on(Ge.scrubbingStarted,function(e){Le=!0,Ce=e}),e.events.on(Ge.scrubbingEnded,function(){Le=!1,Ce=!1});var o;e.events.on(Ge.seeked,function(e,t,n){Ce&&c(n)}),et(t).on(yt.pointerEvents?"pointerdown":["touchstart","mousedown"],".progress",n)}function A(){function n(){return m||(m=e.verifyConfig().then(function(e){return P(e.thumb_preview.url)})),m.then(function(t){var n=e.config.request.thumb_preview;return he.style.backgroundImage||(he.style.width=n.frame_width/2+"px",he.style.height=n.frame_height/2+"px",he.style.backgroundImage="url("+n.url+")",he.style.backgroundSize=n.width/2+"px "+n.height/2+"px"),t})}function a(t){if(t.target===ne){var n=o(t.clientX);c(n),e.events.fire($e.seek,n)}}function s(e){return le.classList.contains("hidden")?e:(fe.classList.remove("hidden"),window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){fe.classList.remove("invisible")})}),e)}function u(t){Ie||Ae||(le.classList.remove("hidden"),Ie=!0,f(t),window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){le.classList.remove("invisible")})}),e.config.request.thumb_preview&&g&&n().then(s).catch(function(){}),et(ne).on("click",a))}function l(t){var n=e.config.video.duration/e.config.request.thumb_preview.frames,i=Math.min(e.config.request.thumb_preview.frames-1,Math.ceil(t/n)),r=i%e.config.request.thumb_preview.columns,o=Math.floor(i/e.config.request.thumb_preview.columns),a=-(r*e.config.request.thumb_preview.frame_width/2),s=-(o*e.config.request.thumb_preview.frame_height/2);return[a,s]}function d(e){for(var t=je,n=Array.isArray(t),i=0,t=n?t:t[Symbol.iterator]();;){var r;if(n){if(i>=t.length)break;r=t[i++]}else{if(i=t.next(),i.done)break;r=i.value}var o=r,a=o.getBoundingClientRect(),s=a.left,c=a.right,u=a.width;if(e>=s&&e<=c)return{clientX:s+u/2,snappedTo:o}}return{clientX:e,snappedTo:null}}function f(t){if(e.config.request.thumb_preview&&null===g){var i=ie.getBoundingClientRect().width,a=document.querySelector(".player").clientHeight,c=215,u=185;if(g=a>=c&&i>=u,!g)return void fe.classList.add("hidden");n().then(s).catch(function(){})}Ie&&!function(){var i=d(t.clientX,je),a=i.clientX,s=i.snappedTo,c=o(a),u=e.config.video.duration*c;je.forEach(function(e){return e.classList.toggle("active",e===s)}),e.config.request.thumb_preview&&g&&n().then(function(e){var t=l(u),n=Qe(t,2),i=n[0],r=n[1];return window.requestAnimationFrame(function(){he.style.backgroundPosition=i+"px "+r+"px"}),e}).catch(function(){}),window.requestAnimationFrame(function(){de.innerHTML=Se(u);var e=(100*c).toFixed(3);le.style.left=e+"%",p(c),t.clientX>r()+10&&!fe.contains(document.elementFromPoint(t.clientX,t.clientY))&&v()})}()}function h(){var e=J.getBoundingClientRect().left,t=ne.getBoundingClientRect().right,n=fe.getBoundingClientRect().width,o=e+Math.ceil(n/2),a=t-Math.ceil(n/2),s=i(),c=r(),u=c-s,l=(o-s)/u,d=(a-s)/u;return[l,d]}function p(e){var t=h(),n=Qe(t,2),i=n[0],r=n[1],o=Math.max(i,Math.min(r,e)),a=(100*o).toFixed(3);fe.style.left=a+"%"}function v(){le&&(le.classList.add("invisible"),fe.classList.add("invisible")),Ie=!1,et(ne).off("click",a)}var m=void 0,g=null;e.events.on(Ge.resize,function(){g=null}),et(t).on("mouseenter",".progress",u).on("mousemove",".play-bar",f).on("mouseleave",".play-bar",v),et(t).on("transitionend",".ghost-timecode",function(e){"opacity"===e.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&(le.classList.add("hidden"),fe.classList.add("hidden"))},!1),e.events.on(Ge.mousedOut,v),e.events.on(Ge.configChanged,function(){m=null})}function I(){function n(e){Xe=e,_e&&(_e.setActiveItem(e),setTimeout(function(){_e.hide()},100)),ge&&(ge.classList.add("on"),ge.classList.remove("off"))}function i(){Xe=null,_e&&(_e.setActiveItem("off"),setTimeout(function(){_e.hide()},100)),ge&&(ge.classList.add("off"),ge.classList.remove("on"))}w(t,".cc",function(){e.events.fire(Ge.ccButtonPressed)}),e.events.on(Ge.ccButtonPressed,function(e){_e?e&&_e.toggle(e):(_e=_(ge,ne),_e.show(e))}),e.events.on(Ge.captionsChanged,function(e){return e?void n(e.id):void i()}).on(Ge.controlBarVisibilityChanged,function(e){e||_e&&_e.hide()}).on([$e.enableCaptions,$e.disableCaptions],function(){S()})}function M(){function n(){var t=ut.render("icon_hd");if(e.telecine.video.currentFile.mime===ze.dash){var n=e.config.request.files.dash.streams,i=ti(n).sort(G()).filter(W(n)).map(function(e){var n=V(e);return{id:n,label:X(e,t),active:r===n}});return i.push({id:"auto",label:"Auto",active:!r||"auto"===r}),i}var o=e.telecine.video.files;return ti(o).filter(j("progressive")).filter(W(o)).sort(G()).map(function(e){return{label:X(e,t),id:V(e),active:r===e.metadata.quality}})}function i(){var t=n(),i=new ke(t,me,ne,e);return i.on("selected",function(t){e.events.fire($e.changeQuality,t)}),i}var r=null;w(t,".hd",function(){e.events.fire(Ge.hdButtonPressed)}),e.events.on(Ge.hdButtonPressed,function(e){return Ve?void(e&&Ve.toggle(e)):(Ve=i(),void Ve.show(e))}),e.events.on(Ge.qualityChanged,function(e){r=e,Ve&&Ve.setActiveItem(e)}),e.events.on($e.disableHd,function(){We=!1,S()})}function F(){var n=document.createElement("a");if(n.style.cssText="-moz-filter:blur(2px);-webkit-filter:blur(2px);filter:blur(2px);",!(n.style.length<1)){var i=null,r=function(){var t=[{label:"Soporific",id:"aden"},{label:"Escutcheon",id:"earlybird"},{label:"Pluvious",id:"hudson"},{label:"Moribund",id:"inkwell"},{label:"Fecundity",id:"mayfair"},{label:"Jejune",id:"toaster"},{label:"None",id:"none",active:!0}],n=yt.browser.safari,i=e.telecine.supportsEffect(lo),r=Ue[e.telecine.video.currentFile.mime],o="dash"===r;return!n&&o&&i&&t.unshift({label:"ASCII",id:"ascii"}),t};w(t,".effect",function(){return e.events.fire(Ge.effectButtonPressed)}),e.events.on(Ge.effectButtonPressed,function(t){return Ke.classList.remove("hidden"),i?void(t&&i.toggle(t)):(i=new ke(r(),Ke,ne,e),i.on("selected",function(t){return e.events.fire($e.setEffect,t)}),void i.show(t))}),e.events.on($e.setEffect,function(e){return i.setActiveItem(e),"none"===e?(Ke.classList.add("off"),void Ke.classList.remove("on")):(Ke.classList.add("on"),void Ke.classList.remove("off"))}),e.events.on(Ge.ready,function(){e.telecine.on("scannerchange",function(){i&&(i.destroy(),i=null)})})}}function q(){w(t,".pip",function(){return"picture-in-picture"===e.telecine.presentationMode?void e.events.fire($e.deactivatePictureInPicture):void e.events.fire($e.activatePictureInPicture)}),e.events.on(Ge.pictureInPictureAvailable,function(){ye&&(ye.classList.remove("hidden"),ye.hidden=!1,n())}).on(Ge.pictureInPictureNotAvailable,function(){ye&&(ye.classList.add("hidden"),ye.hidden=!0,n())}).on(Ge.pictureInPictureActivated,function(){Je=!0,ye&&(ye.classList.add("return"),ye.classList.remove("enter"),ye.setAttribute("title",ye.getAttribute("data-title-return")))}).on(Ge.pictureInPictureDeactivated,function(){Je=!1,ye&&(ye.classList.add("enter"),ye.classList.remove("return"),ye.setAttribute("title",ye.getAttribute("data-title-enter")))})}function R(){yt.airPlay&&(w(t,".airplay",function(){e.events.fire(Ge.airPlayButtonPressed)}),e.events.on(Ge.airPlayAvailable,function(){be&&(be.classList.remove("hidden"),be.hidden=!1,n())}).on(Ge.airPlayNotAvailable,function(){be&&(be.classList.add("hidden"),be.hidden=!0,n())}).on(Ge.airPlayActivated,function(){Ye=!0,be&&(be.classList.remove("off"),be.classList.add("on"),be.setAttribute("title",be.getAttribute("data-title-on"))),g()}).on(Ge.airPlayDeactivated,function(){Ye=!1,be&&(be.classList.remove("on"),be.classList.add("off"),be.setAttribute("title",be.getAttribute("data-title-off")))}))}function B(){w(t,".fullscreen",function(){e.events.fire(Ge.fullscreenButtonPressed)}),e.events.on(Ge.didEnterFullscreen,function(){t.classList.remove("tiny"),we&&we.setAttribute("title",we.getAttribute("data-title-unfullscreen"))}),e.events.on(Ge.didExitFullscreen,function(e){we&&we.setAttribute("title",we.getAttribute("data-title-fullscreen")),e||(xe=!0,y()),Q&&t.classList.add("tiny")})}function D(){e.events.on([Ge.mousedOver,Ge.scrubbingStarted,$e.changeVolume],g).on([Ge.mousedOut,Ge.mouseTimeout],m).on(Ge.willEnterFullscreen,function(){Ee=!1,m()}).on(Ge.willExitFullscreen,function(){Ee=!1}).on(Ge.targetTimeReached,function(){Me=!0,m()}).on($e.changeVolume,function(e,t){t||g()});var n=[".play",".play-bar",".custom-logo",".menu"];et(t).on(["pointerenter","pointerleave","mouseenter","mouseleave"],n,function(e){return"pointerType"in e?void("mouse"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_MOUSE||(Ee="pointerenter"===e.type||"MSPointerEnter"===e.type)):void(yt.touch||(Ee="mouseover"===e.type))}),et(t).on("transitionend",function(e){this===t&&"opacity"===e.propertyName&&t.classList.contains("invisible")&&(t.classList.add("hidden"),t.setAttribute("hidden",""))})}function N(){function n(n){if(1===n.which){pe.setAttribute("data-tabindex",pe.getAttribute("tabindex")),pe.removeAttribute("tabindex"),Ae=!0,e.element.classList.add("scrubbing"),e.events.fire(Ge.volumeScrubbingStarted);var s=n.type;if("pointerdown"===s||"MSPointerDown"===s){a=n.pointerId;try{n.target.msSetPointerCapture?n.target.msSetPointerCapture(a):n.target.setPointerCapture(a)}catch(e){}et(t).on("pointermove",".volume",i).on("pointerup",".volume",r)}else"touchstart"===s?et(document).on("touchmove",i).on("touchend",r):et(document).on("mousemove",i).on("mouseup",r);var c=n.clientX;n.targetTouches&&(c=n.targetTouches[0].clientX);var u=o(c);e.events.fire($e.changeVolume,u),x(u)}}function i(t){var n=t.clientX;t.targetTouches&&(n=t.targetTouches[0].clientX,t.preventDefault());var i=o(n);e.events.fire($e.changeVolume,i),x(i)}function r(n){Ae=!1,e.events.fire(Ge.volumeScrubbingEnded),e.element.classList.remove("scrubbing");var o=n.type;"pointerup"===o||"MSPointerUp"===o?et(t).off("pointermove",".volume",i).off("pointerup",".volume",r):"touchend"===n.type?et(document).off("touchmove",i).off("touchend",r):et(document).off("mousemove",i).off("mouseup",r),pe.setAttribute("tabindex",pe.getAttribute("data-tabindex")),pe.removeAttribute("data-tabindex")}function o(e){var t=pe.getBoundingClientRect().left,n=pe.getBoundingClientRect().right,i=n-t,r=e-t,o=r/i;return s(o,0,1)}et(t).on("mouseover",".volume div",function(){var e=this;e.classList.add("hover"),window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){e.classList.remove("hover"),e.classList.add("animate")})})}),et(t).on("transitionend",".volume div",function(e){"height"===e.propertyName&&12===this.clientHeight&&this.classList.remove("animate")}),et(document).on("contextmenu",".volume",function(){this.blur()});var a;et(t).on(yt.pointerEvents?"pointerdown":["touchstart","mousedown"],".volume",n),e.events.on(Ge.volumeChanged,function(e){!Ae&&ve&&x(e)}).on([$e.enableVolume,$e.disableVolume],function(){S()})}function H(){e.events.on(Ge.overlayOpened,function(e){if("notsupported"!==e&&"private-unlocked"!==e&&"help"!==e)Pe=!0,m();else for(var n=t.querySelectorAll("a, button, input, [tabindex]"),i=0,r=n.length;ie.element.clientHeight-f,m=l>e.element.clientWidth-h&&d=L&&null===y&&(e.events.fire(Ge.targetTimeReached),e.events.off([Ge.playProgress,Ge.seeked],t))})}function m(){e.events.on($e.reset,function(){w=!0,k=!0,S=!0,T=!1,P=!1,v(),n()})}var g=2e3,_=4500,y=null,b=yt.touch?_:g,w=!0,k=!0,x=!1,S=!0,T=!1,E=!1,P=!1,L=1.75,C=t.querySelector(".target"),O=t.querySelector(".sidedock"),A=t.querySelector(".controls"),I=t.querySelector(".title"),M=t.querySelector(".video"),F=e.config.embed.autoplay&&e.config.request.flags.autohide_controls;return l(),d(),f(),h(),p(),v(),m(),{}}function Pe(e,t){function n(){return t.classList.contains("overflow")?void t.classList.remove("overflow"):void(t.clientHeight$&&($=t,l(j,Math.floor(t/1e3).toLocaleString()+" Kbps")),t',u=k[L].map(function(t){var n=t.time/e.telecine.duration*o,i=a-a*t.speed/$;return isNaN(i)&&(i=0),n+","+d(i,0,a)});if(Y){var f={time:e.telecine.currentTime,color:Y,type:Q[Y]};switch(f.type){case"resize":var h=i(W),p=r(h.width,h.height);T=p,f.title="Resized from "+T+" to "+p;break;case"downswitch":case"upswitch":f.title="Switched from "+E+" to "+P;break;default:f.title=Q[Y]}x[L].push(f),Y=!1}return x[L].forEach(function(t){var n=t.time,i=t.color,r=t.title,s=n/e.telecine.duration*o,u="";u+=""+r+"",u+='',u+="",c+=u}),c+="",c+='1?"@"+window.devicePixelRatio+"x":""}function p(e,t){L+=1,k.push([]),x.push([]),S.push([{title:e,time:Math.round(100*t)/100}])}function v(n,o){var a;C[n]||(C[n]=[]),C[n].length===b&&C[n].pop(),O||u(),C[n].unshift(o);var s=void 0;switch(n){case"resize":return Y=J.resize,s=i(W),e.events.fire(Ge.resize,s),void l(F,""+r(s.width,s.height));case"streamchange":var c=o.index,d=o.streams,h=d[c],v=e.config.request.files.dash.cdn,m=e.config.request.files.dash.streams[c].profile;return K!==h.bitrate&&(null!==K&&(Y=J.upswitch,h.bitrate=t.length?t[0]:i<0?t[t.length-1]:t[i],!r||(r.focus(),!1)}function m(){return!!A||(document.activeElement&&document.activeElement!==document.body?void 0:(e.events.fire(Ge[e.telecine.paused?"playButtonPressed":"pauseButtonPressed"]),i(),!1))}function g(){return A?(A.element.contains(document.activeElement)&&A.button.focus(),A.hide(),!1):document.activeElement&&t.contains(document.activeElement)?(document.activeElement.blur(),!0):O?(e.events.fire(Ge.overlayCloseButtonPressed),!1):void 0}function _(){if(A)return!A.element.contains(document.activeElement)||v("up");if(yt.threeSixtyVideo&&e.config.video.is_panorama)return e.telecine.getEffectByName("ThreeSixtyEffect").keyPress("up"),!1;if(e.config.embed.on_site&&document.activeElement&&!t.contains(document.activeElement))return!0;i();var n=!1,r=!0;return e.events.fire($e.changeVolume,Ao,n,r),!1}function y(){if(A)return!A.element.contains(document.activeElement)||v("down");if(yt.threeSixtyVideo&&e.config.video.is_panorama)return e.telecine.getEffectByName("ThreeSixtyEffect").keyPress("down"),!1;if(e.config.embed.on_site&&document.activeElement&&!t.contains(document.activeElement))return!0;i();var n=!1,r=!0;return e.events.fire($e.changeVolume,-Ao,n,r),!1}function b(t,n){if(A)return!A.element.contains(document.activeElement)||v("left"===n?"up":"down");if(i(),yt.threeSixtyVideo&&e.config.video.is_panorama)return e.telecine.getEffectByName("ThreeSixtyEffect").keyPress(n),!1;if(document.activeElement&&document.activeElement===C){var r=!1,o=!0,a="left"===n?-Ao:Ao;return e.events.fire($e.changeVolume,a,r,o),!1}return t.shiftKey||0===R?void u(n,t.shiftKey):void D(n,t.shiftKey)}function w(){e.events.on(Ge.overlayOpened,function(e){O=!0,P=e,"notsupported"===e&&(L=!0)}),e.events.on(Ge.overlayClosed,function(){O=!1,P=null})}function k(){e.events.on(Ge.menuVisibilityChanged,function(e,t){A=!!e&&t})}function x(){e.events.on(Ge.configChanged,function(e){e&&(L=!1)})}function S(){function t(e){if(r(e),a(e)&&!s(e)&&n()){var t=o(e);if(t in u){if("function"==typeof u[t])return void(u[t](e,t)===!1&&(e.preventDefault(),e.stopPropagation()));c(u[t])===!1&&(e.preventDefault(),e.stopPropagation())}}}function i(t){if(r(t),!s(t)&&n()){var i=o(t);return yt.threeSixtyVideo&&e.config.video.is_panorama&&("left"===i||"right"===i||"up"===i||"down"===i)?void e.telecine.getEffectByName("ThreeSixtyEffect").keyUp(i):void("left"!==i&&"right"!==i||d(t))}}var u={l:Ge.likeButtonPressed,w:Ge.watchLaterButtonPressed,s:Ge.shareButtonPressed,c:[Ge.ccButtonPressed,!0],h:[Ge.hdButtonPressed,!0],f:Ge.fullscreenButtonPressed,x:[Ge.effectButtonPressed,!0],e:[Ge.effectButtonPressed,!0],d:Ge.debugButtonPressed,space:m,up:_,down:y,left:b,right:b,esc:g,"?":[$e.showOverlay,"help"]};e.config.embed.on_site||(u.v=$e.openVimeo),document.addEventListener("keydown",t,!1),document.addEventListener("keypress",t,!1),document.addEventListener("keyup",i,!1)}function T(){e.events.on(Ge.becameActive,function(){L=!1}).on(Ge.becameInactive,function(){L=!0}),e.config.embed.on_site&&document.querySelector(".player")===t&&(L=!1)}function E(){var e=void 0,t=!1;document.body.addEventListener("keydown",function(n){9!==n.which||document.body.classList.contains("showfocus")?27===n.which?document.body.classList.remove("showfocus"):32!==n.which&&13!==n.which||(t=!0,clearTimeout(e),e=setTimeout(function(){t=!1},200)):document.body.classList.add("showfocus")}),document.body.addEventListener("click",function(e){ t||document.body.classList.remove("showfocus")})}var P,L=!!e.config.embed.on_site,C=t.querySelector(".volume"),O=!1,A=!1,I=e.config.video.fps/5,M=Math.max(I,.618*e.config.video.duration),F=100,q=I,R=0,B=!1,D=p(u,80);return w(),k(),x(),S(),T(),E(),{pause:function(){L=!0},unpause:function(){L=!1}}}function Ce(e,t){function n(e){var n="watchlater"===e||"unwatchlater"===e?.5:.4,i=t.clientHeight;return t.clientHeight>t.clientWidth&&(i=t.clientWidth),{height:Math.round(i*n),width:Math.round(i*n*1.6)}}function i(e,t){var n=e.querySelector(".hour-hand"),i=e.querySelector(".minute-hand");if(n&&i){var r=t?1:-1,o=new Date,a=Math.abs(o.getHours()-12),s=o.getMinutes(),c=s/60*360-135,u=a/12*360+s/60*5,l=1.5,d=u+30*l*r,f=c+360*l*r;if(yt.browser.firefox||yt.browser.opera){var h="10 10";n.setAttribute("transform","rotate("+u+","+h+")"),i.setAttribute("transform","rotate("+c+","+h+")");var p=document.createElementNS("http://www.w3.org/2000/svg","animateTransform");p.setAttribute("attributeName","transform"),p.setAttribute("type","rotate"),p.setAttribute("begin","0.1s"),p.setAttribute("repeatCount","indefinite");var v=p.cloneNode(!1);v.setAttribute("from",u+" "+h),v.setAttribute("to",u+360*r+" "+h),v.setAttribute("dur","0.8s"),n.appendChild(v);var m=p.cloneNode(!1);m.setAttribute("from",c+" "+h),m.setAttribute("to",c+360*r+" "+h),m.setAttribute("dur","9.6s"),i.appendChild(m)}else n.style[yt.transformProperty+"Origin"]="46% 81.5%",i.style[yt.transformProperty+"Origin"]="25.5% 26.5%",n.style[yt.transformProperty]="rotate("+u+"deg)",i.style[yt.transformProperty]="rotate("+c+"deg)";window.requestAnimationFrame(function(){e.classList.add("animate"),yt.browser.firefox||yt.browser.opera||window.requestAnimationFrame(function(){n.style[yt.transformProperty]="rotate("+d+"deg)",i.style[yt.transformProperty]="rotate("+f+"deg)"})})}}function r(e,r){if(null!==t.parentElement.offsetParent){t.classList.remove("hidden"),t.removeAttribute("hidden"),t.setAttribute("data-name",e);var a=n(e),s="width:"+a.width+"px;height:"+a.height+"px";d.style.cssText=s,d.innerHTML=r,"watchlater"!==e&&"unwatchlater"!==e||i(d,"watchlater"===e),clearTimeout(l),t.classList.remove("animate"),window.requestAnimationFrame(function(){t.classList.remove("invisible"),l=setTimeout(o,750)})}}function o(){t.classList.add("animate"),t.classList.add("invisible")}function a(){t.classList.remove("animate"),t.classList.remove("invisible"),t.classList.add("hidden"),t.setAttribute("hidden",""),t.removeAttribute("data-name"),d.innerHTML="",d.classList.remove("filled"),d.classList.remove("animate"),e.events.fire(Ge.notificationHidden)}function s(){e.events.on(Ge.liked,function(e){e||r("like",ut.render("icon_heart"))}),e.events.on(Ge.unliked,function(e){e||r("unlike",ut.render("icon_broken_heart"))})}function c(){e.events.on(Ge.addedToWatchLater,function(e){e||r("watchlater",ut.render("icon_clock"))}),e.events.on(Ge.removedFromWatchLater,function(e){e||r("unwatchlater",ut.render("icon_clock"))})}function u(){et(t).on("transitionend",function(e){d.contains(e.target)&&"height"===e.propertyName?setTimeout(o,100):e.target===t&&"opacity"===e.propertyName&&window.requestAnimationFrame(a)})}var l,d=t.querySelector(".notification");return u(),s(),c(),e.events.fire(Ge.notificationModuleReady),{}}function Oe(e,t){function n(t){if("vod"===e.config.embed.outro){var n="undefined"!=typeof e.config.video.vod.is_preorder?e.config.video.vod.is_preorder:!!e.config.video.vod.date_available,i=e.config.video.vod.is_coming_soon,o=e.config.video.vod.date_available_formatted_datetime||e.config.video.vod.date_available,s="Coming soon to Vimeo On Demand.";return i&&o&&(s="Coming soon to Vimeo On Demand on "+o+"."),n&&(s="Pre-order now. Watch on "+o+"."),g={purchased:e.config.user.purchased,title:e.config.video.vod.feature_title,url:e.config.video.vod.url,currency:e.config.request.currency,countries:e.config.video.vod.countries,country:e.config.request.country,buttons:e.config.video.vod.purchase_options,translationMap:e.config.request.dynamic_translation_map,isPreorder:n,isComingSoon:i,releaseDate:o,strings:{watch:n?"Watch on "+o:"Watch Now",preRelease:s}},void(b===!0&&a())}x=!0;var c=new XMLHttpRequest;c.open("GET","https://"+e.config.player_url+"/video/"+e.config.video.id+"/outro?on_site="+e.config.embed.on_site+"&type="+e.config.embed.outro,!0),c.withCredentials=!0,c.onload=function(){try{var n=JSON.parse(c.response);g=n.data,"videos"!==n.type&&"promoted"!==n.type||(g={contexts:Array.isArray(g)?g:[g],owner:e.config.video.owner.id},r()),"function"==typeof t&&t()}catch(e){}},c.send()}function i(e){for(var t=e.innerHTML;e.scrollHeight>e.clientHeight;)t=t.substring(0,t.length-1),e.innerHTML=t+"…"}function r(){for(var e=0,t=g.contexts.length;e0&&n.push(o)}e.events.fire(Ge.outroDisplayed,n)}}function u(){e.events.on(Ge.playProgress,function(e,t,i){b=!1,!x&&null===g&&e>=t-k&&n()})}function l(){e.events.on(Ge.playInitiated,function(){"nothing"!==e.config.embed.outro&&"beginning"!==e.config.embed.outro||(g=!1)}),e.events.on(Ge.ended,function(){return e.config.embed.email&&1===e.config.embed.email.time?(e.events.fire($e.showOverlay,"email-capture"),void e.events.once(Ge.overlayClosed,function(){return e.events.fire($e.showOutro)})):void e.events.fire($e.showOutro)}),e.events.on($e.showOutro,function(){e.performDelegateAction(Ve.showOutro,function(){b=!0,a()})}),e.events.on($e.hideOutro,function(){s()}),et(t).on("click",".videos a",function(t){e.events.fire(Ge.outroVideoPressed,parseInt(this.getAttribute("data-video-id"),10))}),et(t).on("transitionend",function(e){t.classList.contains("in")||(t.classList.add("hidden"),t.setAttribute("hidden",""))},!1),e.events.on([Ge.played,Ge.seeked,Ge.scrubbingStarted],s)}function d(){e.events.on($e.showOverlay,function(){setTimeout(function(){t.classList.add("hidden")},150)}),e.events.on(Ge.overlayClosed,function(){t.classList.contains("in")&&t.classList.remove("hidden")})}function f(){e.events.on($e.reset,function(){g=null,x=!1})}function h(){w(t,".vod-button",function(){var t=this.getAttribute("data-product-id");return e.events.fire(Ge.vodButtonPressed,t),!1}),w(t,".vod-watch-button",function(){if(!("date_available"in e.config.video.vod))return s(),e.events.fire(Ge.vodButtonPressed),!1})}function v(){window.removeEventListener("resize",S),window.addEventListener("resize",S)}var m=t.querySelector(".outro"),g=null,_=!1,y=!1,b=!1,k=10,x=!1,S=p(c,250);return u(),l(),d(),f(),h(),v(),{}}function Ae(){return Mo[Math.floor(Math.random()*Mo.length)]}function Ie(e,t){function n(){var e=t.getBoundingClientRect(),n=J.getBoundingClientRect(),i=te.getBoundingClientRect(),r=n.bottom+(e.height-n.bottom)/2;return e.height-r-i.height/2+"px"}function i(){var e=t.getBoundingClientRect(),n=J.getBoundingClientRect(),i=Z.getBoundingClientRect(),r=e.height/2,o=n.bottom+(e.height-n.bottom)/2;return{top:r-i.height/2+"px",transform:"translateY("+(o-r)+"px)"}}function r(r,o){t.setAttribute("data-name",r),J.innerHTML=o.template,Y=document.activeElement,Y.blur(),o.modal&&c(),o.preventBackgroundClose&&t.setAttribute("data-background-close","false"),o.wrapperClass&&t.classList.add(o.wrapperClass),o.icon.type&&(o.logo&&(te.classList.remove("hidden"),Z.classList.add("cloaked"),window.requestAnimationFrame(function(){te.innerHTML=ut.render("logo"),te.style.bottom=n()})),Z.classList.remove("hidden"),ee.innerHTML=o.icon.html,window.requestAnimationFrame(function(){var e=i();Z.style.top=e.top,Z.style[yt.transformProperty]=e.transform}),t.setAttribute("data-icon",o.icon.type),Z.setAttribute("data-icon",o.icon.type),ee.setAttribute("data-icon",o.icon.type),"private-unlocked"===r&&ee.classList.add("open")),t.classList.add("invisible"),t.classList.remove("hidden"),t.removeAttribute("hidden"),t.classList.add("in"),re=o,ie=r,ne=!0,e.events.fire(Ge.overlayOpened,r),["share","hd-not-allowed"].indexOf(r)>-1&&f(t),window.requestAnimationFrame(function(){t.classList.remove("invisible"),window.requestAnimationFrame(function(){J.classList.add("in"),Q.classList.add("in")})})}function o(){J.classList.remove("in"),J.classList.add("out")}function a(n){if(!d()&&ne){t.removeAttribute("data-background-close"),Q.classList.remove("in"),Q.classList.add("out"),o(),t.classList.remove("in"),t.classList.add("out"),clearTimeout(X),X=setTimeout(s,200),n&&n.preventDefault&&n.preventDefault();var i=t.querySelector(".back");i&&i.classList.add("cloaked"),e.events.fire(Ge.overlayClosed,ie),ne=!1,ie=null,re=null,window.requestAnimationFrame(function(){Y&&(Y.focus(),Y=null)})}}function s(){t.setAttribute("hidden",""),t.removeAttribute("data-name"),t.removeAttribute("data-icon"),t.classList.add("hidden"),t.classList.remove("out"),t.classList.remove("embed-active"),t.classList.remove("modal"),t.classList.remove("embed-only"),Q.classList.remove("out"),Q.classList.remove("in"),Z.removeAttribute("data-icon"),Z.classList.add("hidden"),Z.classList.remove("animate"),ee.removeAttribute("data-icon"),ee.innerHTML="",te.classList.add("hidden"),J.classList.remove("out"),J.innerHTML="",e.events.fire(Ge.overlayCleared)}function c(){t.classList.add("modal"),t.setAttribute("data-modal","true")}function l(){t.setAttribute("data-modal","false")}function d(){return"true"===t.getAttribute("data-modal")}function h(e){if("yes"===e.form.getAttribute("data-bubble")){e.form.setAttribute("data-bubble","no");var n=t.querySelector(".validation-bubble"),i=n.querySelector(".validation-bubble-message");i.innerHTML=e.validationMessage||"There is an error with this input.";var r=e.getBoundingClientRect(),o=e.form.getBoundingClientRect();n.style.left=r.left-o.left+"px",n.style.top=r.height+1+"px",n.classList.remove("hidden"),e.focus(),window.requestAnimationFrame(function(){n.classList.add("animate")}),p()}}function p(e){var n=t.querySelector(".validation-bubble");if(n){if(e)return clearTimeout(K),void n.classList.remove("animate");clearTimeout(K),K=setTimeout(function(){n.classList.remove("animate")},5e3)}}function v(e){var n=t.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."),e||h(n),!1):(p(!0),!0)):null}function m(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.showBubble,i=void 0===n||n,r=t.querySelector("input[type=email]");return r.setAttribute("aria-invalid","false"),r.setCustomValidity(""),r.checkValidity&&!r.checkValidity()?(r.setAttribute("aria-invalid","true"),r.validity.valueMissing&&r.setCustomValidity("Please enter your email."),r.validity.typeMismatch&&r.setCustomValidity("Please enter a valid email."),i&&h(r),!1):(p(!0),!0)}function g(e,n,i){f(t);var r=ti(e.querySelectorAll("input")),o=r.map(function(e){return e.name?encodeURIComponent(e.name)+"="+encodeURIComponent(e.value):encodeURIComponent(e.value)}).join("&"),a=new XMLHttpRequest;a.open(e.method,e.action+window.location.search,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.withCredentials=!0,a.timeout=3e3,a.onload=function(){var e;try{e=JSON.parse(a.responseText)}catch(e){}n(e,a)},a.onerror=function(e){i(e)},a.send(o)}function _(){y(),k(),l(),o()}function y(){te.classList.add("animate")}function b(){te.classList.add("hidden"),te.classList.remove("animate")}function k(){Z.classList.remove("cloaked"),Z.classList.add("animate"),window.requestAnimationFrame(function(){Z.style[yt.transformProperty]="translateY(-10px)"})}function x(){Z.classList.add("centered"),Z.style[yt.transformProperty]=""}function S(){ee.classList.add("open")}function T(){ee.classList.add("pulled-back")}function E(){ee.classList.add("out"),ee.classList.remove("pulled-back")}function P(){et(t).on("transitionend",".overlay-logo",function(e){"opacity"===e.propertyName&&this.classList.contains("animate")&&b()}),et(t).on("transitionend",".overlay-icon-wrapper",function(e){e.propertyName.indexOf("transform")>-1&&(""===this.style[yt.transformProperty]?(this.classList.remove("centered"),"lock"!==this.getAttribute("data-icon")||ee.classList.contains("open")||ee.querySelector("canvas")?T():setTimeout(S,100)):"translateY(-10px)"===this.style[yt.transformProperty]&&x())}),et(t).on("transitionend",".overlay-icon",function(e){e.propertyName.indexOf("transform")>-1&&(this.classList.contains("out")?(l(),a()):this.classList.contains("pulled-back")?E():this.classList.contains("open")&&T())})}function L(){return{modal:!1,template:null,logo:!1,icon:{type:null,html:null}}}function C(t,n){var i=e.config.video.title,r=e.config.video.owner.name,o=e.config.video.share_url;return t.template=ut.render("share",{url:e.config.video.url,shareUrl:o,playerShareUrl:"https://"+e.config.player_url+"/video/"+e.config.video.id+"/share",title:i,owner:r,embed:"public"===e.config.video.embed_permission&&e.config.embed.settings.embed,embedOnly:e.config.embed.settings.share&&e.config.embed.settings.share.embed_only,embedCode:e.config.video.embed_code.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),copyButton:oe||yt.flash.installed,customizeEmbed:!!e.config.video.url,readOnly:!yt.touch,strings:{share:"Share",facebook:"Share on Facebook",twitter:"Share on Twitter",tumblr:"Share on Tumblr",email:"Share via Email",emailSubject:"Check out “"+i+"” from "+r+" on Vimeo",emailBody:"Check out “"+i+"” from "+r+" on Vimeo.\n\nThe video is available for your viewing pleasure at "+o+"\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.",embedCode:"Get embed code",embedTitle:"Embed",embedSubtitle:"Add this video to your site with the embed code below.",copy:"Copy",copySuccess:"Copied!",customize:'Customize this embed on Vimeo'}}),e.config.embed.settings.share&&e.config.embed.settings.share.embed_only&&(t.wrapperClass="embed-only"),t}function O(t){return t.icon={type:"lock",html:ut.render("icon_lock")},t.modal=!0,t.logo=!0,t.template=ut.render("private_locked",{action:"https://"+e.config.vimeo_url+"/log_in",strings:{title:"Private Video",subtitle:"Log in to watch (if you have permission)",logIn:"Log in",logInLabel:"Log in (opens in a new window)"}}),t}function A(t){return t.icon={type:"lock",html:ut.render("icon_lock")},t.template=ut.render("password",{action:"https://"+e.config.player_url+"/video/"+e.config.video.id+"/check-password?referrer="+e.config.request.referrer,strings:{title:"Password Required",subtitle:"If you’ve got it, enter it below.",password:"Password",watch:"Watch Video"}}),t.modal=!0,t.logo=!!e.config.embed.settings.branding,t}function I(e){return e.icon={type:"lock",html:ut.render("icon_lock")},e.template=ut.render("private_unlocked",{strings:{title:"Private Video",subtitle:"You are logged in and have permission to watch (congrats).",watch:"Watch Video"}}),e}function M(e){return e.template=ut.render("content_rating",{logo:ut.render("logo"),strings:{title:"Hold up!",subtitle:"This video is hidden because it may contain mature content including: nudity, strong language, and violence.",update:'You can update your mature content filter at any time.',watch:"I still want to watch this video"}}),e.modal=!0,e}function F(e,t){return e.template=ut.render("error",{title:t.title,message:t.message}),e.modal=!!t.modal,e.logo=!!t.logo,t.icon&&"lock"===t.icon&&(e.icon={type:"lock",html:ut.render("icon_lock")}),e}function q(t){return t.template=ut.render("help",{onSite:e.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",hd:"Toggle HD menu",fullscreen:"Toggle fullscreen",viewOnVimeo:"View on Vimeo"}}),t}function R(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return t.template=ut.render("overlay_email_capture",{text:n.text||e.config.embed.email.text,subtitle:n.subtitle||"Share your email address with "+e.config.video.owner.name+".",action:"https://"+e.config.player_url+"/video/"+e.config.video.id+"/submit-email",confirmation:n.confirmation||e.config.embed.email.confirmation,referrer:e.config.request.referrer,strings:{email:"Email address",fullName:"Full name (optional)",submit:"Submit"}}),t.modal=!1,t.logo=!1,t.preventBackgroundClose=!0,t}function B(e){var t=window.getComputedStyle(e),n=document.createElement("button");n.style.visibility="hidden",n.style.padding=0,e.parentElement.appendChild(n),n.innerText="Copy";var i=n.clientWidth;n.innerText="Copied!";var r=n.clientWidth,o=parseFloat(t.fontSize),a=parseFloat(t.paddingLeft),s=parseFloat(t.paddingRight),c=a+Math.max(i,r)+s;return e.parentElement.removeChild(n),(c+2)/o+"em"}function D(){e.events.on($e.showOverlay,function(n,i){oe=document.queryCommandSupported&&document.queryCommandSupported("copy");var o=function(){var e=L();switch(n){case"share":r(n,C(e,i));var o=t.querySelector(".embed-copy");return void(o.style.width=B(o));case"private-locked":return void r(n,O(e));case"password":return void r(n,A(e));case"private-unlocked":return void r(n,I(e));case"error":return void r(n,F(e,i));case"help":return void r(n,q(e));case"content-rating":return void r(n,M(e));case"email-capture":return void r(n,R(e,i))}};return ne?"share"!==ie&&"help"!==ie&&"hd-not-allowed"!==ie||ie!==n?(e.events.once(Ge.overlayCleared,o),l(),void a()):void a():void o()}),et(t).on("input","input",function(){this.form.classList.add("interacted")}).on(["focus","blur"],"input",function(){p(!0)}).on("transitionend",".validation-bubble",function(e){"opacity"===e.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&this.classList.add("hidden")}),e.events.on([Ge.overlayCloseButtonPressed,Ge.played],a),e.events.on(Ge.privateUnlocked,function(){"private-locked"===ie&&(l(),a())}),e.events.on(Ge.configChanged,function(){"share"===ie&&(re=C(L(),e.config.embed.settings.share.embed_only),J.innerHTML=re.template)}),et(window).on("resize",function(){if(ne){te.style.bottom=n();var e=i();Z.style.top=e.top,Z.style[yt.transformProperty]=e.transform}})}function N(){function n(){e.events.fire(Ge.embedCodeCopied);var t=document.querySelector(".embed-copy");t.innerHTML=t.getAttribute("data-success-label"),clearTimeout(i),i=setTimeout(function(){t.innerHTML=t.getAttribute("data-label")},2e3)}var i;et(t).on("transitionend",".share-screen",function(e){"opacity"===e.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&this.classList.add("cloaked")}).on("transitionend",".embed-screen",function(e){"opacity"===e.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&(t.querySelector(".back").classList.add("cloaked"),this.classList.add("cloaked"),f(t))}).on("copy","input[name=embed_code]",function(){e.events.fire(Ge.embedCodeCopied)}),w(t,".back",function(){return t.querySelector(".share-screen").classList.remove("cloaked"),t.classList.remove("embed-active"),!1}),w(t,".facebook",function(){e.events.fire(Ge.facebookButtonPressed,this.href);try{document.activeElement.blur()}catch(e){}return!1}),w(t,".twitter",function(){e.events.fire(Ge.twitterButtonPressed,this.href);try{document.activeElement.blur()}catch(e){}return!1}),w(t,".tumblr",function(){e.events.fire(Ge.tumblrButtonPressed,this.href);try{document.activeElement.blur()}catch(e){}return!1}),w(t,".email",function(){e.events.fire(Ge.emailButtonPressed),window.location=this.href;try{document.activeElement.blur()}catch(e){}return!1}),w(t,".embed",function(){e.events.fire(Ge.embedButtonPressed);try{document.activeElement.blur()}catch(e){}return!1}),w(t,".embed-copy",function(){if(oe){var e=document.querySelector("input[name=embed_code]");e.select();try{document.execCommand("copy")&&n()}catch(e){}return document.activeElement.blur(),!1}}),yt.touch?et(J).on("focus","input[name=embed_code]",function(){var e=this;setTimeout(function(){e.setSelectionRange(0,9999),e.setAttribute("readonly","readonly")},0)}).on("blur","input",function(){this.removeAttribute("readonly")}):et(J).on("click","input[name=embed_code]",function(){this.setSelectionRange(0,9999)}),e.events.on(Ge.facebookButtonPressed,function(e){u(e,"facebook",{width:580,height:400})}).on(Ge.twitterButtonPressed,function(e){u(e,"twitter",{width:550,height:420})}).on(Ge.tumblrButtonPressed,function(e){u(e,"tumblr",{width:540,height:600})}).on(Ge.embedButtonPressed,function(){function i(){var t=document.querySelector(".embed-copy"),i=new ZeroClipboard(t,{moviePath:e.config.request.urls.zeroclip_swf,trustedDomains:["*"],allowScriptAccess:"always"});i.on("complete",n)}if(e.config.embed.settings.share.embed_only||(t.querySelector(".back").classList.remove("cloaked"),t.querySelector(".embed-screen").classList.remove("cloaked"),t.classList.add("embed-active")),!oe&&yt.flash.installed){var r="zc_script_loaded";if(!document.getElementById(r)){var o,a=document.createElement("script");return a.setAttribute("id",r),a.setAttribute("src",e.config.request.urls.zeroclip_js),a.onreadystatechange=a.onload=function(){o||i(),o=!0},void document.getElementsByTagName("head")[0].appendChild(a)}i()}})}function j(){et(J).on("click",".popup",function(){return e.events.fire($e.openPopup,"login-private-locked"),!1})}function H(){function t(t){function n(t,n){return t===!1?void i(n.status,n):(e.events.fire(Ge.passwordUnlocked,t),"icon-hidden"===window.getComputedStyle(Q,":after").content?(l(),void a()):void _())}function i(e){s.classList.remove("loading"),o.setCustomValidity("Uh oh. There was a problem. Please try again."),o.setAttribute("aria-invalid","true"),h(o)}var r=v();if(!r)return!1;var o=t.querySelector("input[type=password]"),s=t.querySelector("input[type=submit]");s.classList.add("loading"),g(t,n,i)}et(J).on("click",".password input[type=submit]",function(){this.form.classList.add("submitted"),this.form.setAttribute("data-bubble","yes"),v(!0)}).on("submit",".password form",function(){return t(this),!1}).on(["focus","input"],[".password input[type=email]",".password input[type=password]"],function(){v()})}function V(){w(J,".unlocked button",function(){_(),yt.iPad||yt.iPhone||e.events.once(Ge.overlayCleared,function(){e.events.fire(Ge.playButtonPressed)})})}function U(){w(J,".content-rating button",function(){l(),a()})}function z(){function t(){var e=J.querySelector(".email-capture-form"),t=J.querySelector(".email-capture-confirm");e.classList.add("invisible"),t.classList.remove("hidden"),window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){t.classList.add("in"),setTimeout(a,2750)})})}function n(n){function i(n,i){return n===!1?void r(i.status,i):(e.events.fire(Ge.emailCaptureSuccess),void t())}function r(e){a.classList.remove("loading"),o.setCustomValidity("Uh oh. There was a problem. Please try again."),o.setAttribute("aria-invalid","true"),h(o)}if(!m())return!1;var o=n.querySelector("input[type=email]"),a=n.querySelector("input[type=submit]"),s={signature:"signature",time:"timestamp",expires:"expires"};Object.keys(s).forEach(function(t){var i=n.querySelector("input[name="+t+"]");i.value=e.config.request[s[t]]}),a.classList.add("loading"),g(n,i,r)}et(J).on("click",".email-capture input[type=submit]",function(){this.form.classList.add("submitted"),this.form.setAttribute("data-bubble","yes"),m()}).on("submit",".email-capture form",function(){return e.events.fire(Ge.emailCaptureSubmitted),n(this),!1}).on(["focus","input"],".email-capture input[type=email]",function(){m({showBubble:!1})})}function W(){var t=function(e,t,n){var i=window.location.search.indexOf("partypooper=1")>-1||window.location.search.indexOf("fun=0")>-1;switch(e){case"not-supported":return{name:"notsupported",title:i?"Sorry":Ae(),message:n>.5?"There was an issue playing this video.":"This video can’t be played with your current setup."};default:return{name:e,title:t&&t.title||"Sorry",message:t&&t.message||"There was an issue with playback."}}};e.events.on(Ge.error,function(n){var i=arguments.length<=1||void 0===arguments[1]?{modal:!0,final:!0}:arguments[1];if(i.final!==!1){var o=e.telecine?e.telecine.currentTime:0,s=t(n,i,o),c=s.name,u=s.title,l=s.message,d=L();return d.modal=i.modal,d.template=ut.render("error",{title:u,message:l}),ne?(a(),void e.events.once(Ge.overlayClosed,function(){return r(c,d)})):void r(c,d)}})}function $(){e.events.on(Ge.configChanged,function(){window.requestAnimationFrame(function(){l(),a()})})}function G(){w(t,".close",function(){e.events.fire(Ge.overlayCloseButtonPressed)}),et(t).on(["click","touchend"],[".window-wrapper",".share-wrapper",".overlay-logo"],function(e){e.stopPropagation()}).on(["click","touchend"],[".overlay-cell","nav"],function(){return"false"===t.getAttribute("data-background-close")||(e.events.fire(Ge.overlayCloseButtonPressed),!1)})}var X,K,Y,Q=t.querySelector(".overlay-cell"),J=t.querySelector(".overlay"),Z=t.querySelector(".overlay-icon-wrapper"),ee=Z.querySelector(".overlay-icon"),te=t.querySelector(".overlay-logo"),ne=!1,ie=null,re=null,oe=!1;return D(),P(),N(),j(),H(),V(),U(),z(),W(),$(),G(),e.events.fire(Ge.overlayModuleReady),{}}function Me(e,t){function i(e,t){var n=".player-"+u+" ",i=n+e.join(","+n);if(t){var r=l+" ";i+=","+r+e.join(","+r)}return d&&(i=i.replace(/:hover/g,":active")),i=i.replace(/ &/g,"")}function r(){var e=document.createElement("style");return e.setAttribute("data-player",u),document.querySelector("head").appendChild(e),f=e.sheet}function o(){for(;f.cssRules.length>0;)f.deleteRule(0)}function a(){f?o():r()}function s(e){a();var t=e.complement,r=new q(23,35,34,.75),o=new q(0,0,0,.15),s=o.overlayOn(e);r.contrast(t).ratio<3&&t.lighten(5,3,r);var c,u=e.lightness<40?e.clone().lighten(15,3,e):e.clone().darken(15,3,e);return n(i(Fo,!0),"color:"+e.hex+" !important",f),n(i(qo,!0),"color:"+t.hex+" !important",f),n(i(Ro),"color:"+e.hex,f),n(i(No),"fill:"+e.hex,f),n(i(Ho),"stroke:"+e.hex,f),n(i(Uo),"background-color:"+e.hex,f),n(i(zo),"border-color:"+e.hex,f),n(i(Bo),"color:"+t.hex,f),n(i(Do),"fill:"+t.hex,f),n(i(jo),"fill:"+u.hex,f),n(i(Vo),"stroke:"+u.hex,f),n(i(Qo),"border-color:"+s.hex,f),n(i(Jo),"background-color:"+s.hex,f),e.luminance>.95&&(t=e.clone().darken(15,3,e),n(i(Wo),"color:"+t.hex,f),n(i($o),"fill:"+t.hex,f),n(i(Go),"stroke:"+t.hex,f),u=t.clone().darken(15,3,t),n(i(jo),"fill:"+u.hex,f),n(i(Vo),"stroke:"+u.hex,f)),e.yiq>175&&e.luminance<.95&&(c=u.clone().darken(15,3,u),n(i(jo),"fill:"+c.hex,f),n(i(Vo),"stroke:"+c.hex,f),n(i(Xo),"color:"+u.hex,f),n(i(Ko),"fill:"+u.hex,f),n(i(Yo),"stroke:"+u.hex,f)),{main:e.hex,selected:u.hex,sidedockHover:c?u.hex:e.luminance>.95?t.hex:q.white.hex,sidedockSelected:e.luminance>.95?t.hex:e.hex,sidedockSelectedHover:c?c.hex:u.hex}}function c(){e.events.on($e.changeColor,function(t){var n;try{n=new q(t)}catch(e){n=new q("00adef")}var i=s(n);e.config._colors=i,e.config.embed.color=i.main.replace("#",""),e.events.fire(Ge.colorChanged,e.config.embed.color)}),e.events.fire($e.changeColor,e.config.embed.color)}var u=t.uuid,l=t.id,d=t.isMobileDevice,f=null;return c(),{}}function Fe(e){function t(){e.events.on($e.openPopup,function(t,n){var i="https://"+e.config.player_url,o=i+"/video/"+e.config.video.id,a=670,s=545;switch(t){case"login-like":r=u(o+"/login/like","login",{width:a,height:s}),e.events.fire(Ge.popupOpened,t);break;case"login-watch-later":r=u(o+"/login/watch-later","login",{width:a,height:s}),e.events.fire(Ge.popupOpened,t);break;case"login-private-locked":r=u(o+"/login/private","login",{width:a,height:s}),e.events.fire(Ge.popupOpened,t);break;case"purchase":var c=i+"/video/"+(e.config.video.vod.feature_id||e.config.video.id)+"/purchase/vod";n&&n.productId&&(c+="/"+n.productId),c+="?referrer="+encodeURIComponent(e.config.request.referrer),r=u(c,"purchase",{width:790,height:670}),e.events.fire(Ge.popupOpened,t)}}),window.closePopup=function(t){if(r){try{r.close(),e.events.fire(Ge.popupClosed,t)}catch(e){}r=null}}}function n(){e.config.embed.on_site||(window.confirmPurchase=function(t,n,i){return n?void e.loadVideo(t):void(i&&e.events.fire(Ge.playButtonPressed))})}function i(){e.config.embed.on_site||(window.confirmLoginAction=function(t,n){e.events.fire(Ge.userLogIn,n)})}var r=null;return t(),n(),i(),{}}function qe(e,t){function n(){D&&(K||(N&&X||H||z||Q)&&(j||(!V&&!U||H||z)&&(D=!1,e.events.fire(Ge.sidedockVisibilityChanged,D),(Y||t).classList.add("invisible"))))}function i(){if(!D&&!z&&!H){var n=Y||t;n.classList.add("invisible"),n.classList.remove("hidden"),n.removeAttribute("hidden"),t.classList.remove("hidden"),t.removeAttribute("hidden"),t.classList.contains("vod")&&t.classList.remove("vod"),setTimeout(function(){D=!0,e.events.fire(Ge.sidedockVisibilityChanged,D),n.classList.remove("invisible")},0)}}function r(){N=!1,j=!1,K=!1}function o(t,n,i){var r="data-label-"+i,o="add"!==i||e.config.user.logged_in?r:"data-label-add-logged-out";t.setAttribute("aria-label",t.getAttribute(o)),n.classList.add("hidden"),n.setAttribute("hidden",""),n.firstChild.innerHTML=t.getAttribute(r)}function a(){var e=W.indexOf(this);$.forEach(function(t,n){n!==e&&t&&t.classList.add("invisible")}),e>=0&&$[e]&&($[e].classList.add("invisible"),$[e].classList.remove("hidden"),$[e].removeAttribute("hidden",""),G=window.requestAnimationFrame(function(){G=window.requestAnimationFrame(function(){$[e].classList.remove("invisible"),$[e].classList.add("visible")})}))}function s(){var e="BUTTON"===this.tagName?this:this.querySelector("button"),t=W.indexOf(e);t>=0&&$[t]&&(G&&(window.cancelAnimationFrame(G),G=null),$[t].classList.add("invisible"))}function c(){if(C){var e=C.parentElement;Y.insertBefore(e,Y.firstChild)}}function u(){if(C){var e=C.parentElement;t.insertBefore(e,Y)}}function l(){if(e.config.view===He.main||e.config.view===He.privateUnlocked){var n=e.config.embed.settings,i=e.config.video.vod&&"purchase_options"in e.config.video.vod&&e.config.video.vod.purchase_options.length,r=i&&e.config.video.vod.is_coming_soon,o="ondemand.main"===e.config.embed.context,a=e.config.video.vod&&e.config.user.purchased?1:0,s=i&&n.vod&&_(e.config.video.vod.countries,e.config.request.country);s&&r&&o&&(s=!1);var u=i&&e.config.video.vod.purchase_options[0],l=null;u&&(l=m(e.config.request.dynamic_translation_map,"label_string",e.config.request.currency,u)),t.innerHTML=ut.render("sidedock",{loggedIn:!!e.config.user.logged_in,vodButton:s,purchased:a,vodPurchaseInfo:u,vodDisplayLabel:l,likeButton:n.like,liked:e.config.user.liked,watchLaterButton:n.watch_later,addedToWatchLater:e.config.user.watch_later,collectionsButton:n.collections, shareButton:n.share,strings:{like:"Like",likeLoggedOut:"Like (opens in a new window)",unlike:"Unlike",watchLaterAdd:"Add to Watch Later",watchLaterAddLoggedOut:"Add to Watch Later (opens in a new window)",watchLaterRemove:"Remove from Watch Later",collections:"Add to collections",share:n.share&&n.share.embed_only?"Embed":"Share"}}),C=t.querySelector(".vod-button"),s&&(Y=t.querySelector(".sidedock-inner"),a&&c());var d=Y||t;i&&s&&!e.config.embed.settings.instant_sidedock?t.classList.add("vod"):yt.touch&&(D=!0,e.events.fire(Ge.sidedockVisibilityChanged,D),d.classList.remove("hidden"),d.removeAttribute("hidden"),d.classList.remove("invisible")),O=t.querySelector(".like-button"),A=t.querySelector(".like-label"),I=t.querySelector(".watch-later-button"),M=t.querySelector(".watch-later-label"),F=t.querySelector(".collections-button"),q=t.querySelector(".collections-label"),R=t.querySelector(".share-button"),B=t.querySelector(".share-label"),W=[C,O,I,R,F],$=[null,A,M,B,q]}}function d(){var t=e.config.embed.settings.instant_sidedock,n=e.config.video.vod,r=n&&"purchase_options"in n&&n.purchase_options.length,o=n&&_(e.config.video.vod.countries,e.config.request.country);(t||r&&o)&&(Q||i())}function f(){w(t,".vod-button",function(){var t=C.getAttribute("data-product-id");e.events.fire(Ge.vodButtonPressed,t)},s),e.events.on(Ge.outroDisplayed,function(){c()}),e.events.on(Ge.outroHidden,function(){u()})}function h(){w(t,".like-button",function(){e.events.fire(Ge.likeButtonPressed)},s),e.events.on(Ge.liked,function(){O&&(O.classList.add("on"),o(O,A,"remove"))}),e.events.on(Ge.unliked,function(){O&&(O.classList.remove("on"),o(O,A,"add"))})}function p(){w(t,".watch-later-button",function(){e.events.fire(Ge.watchLaterButtonPressed)},s),e.events.on(Ge.addedToWatchLater,function(){I&&(I.classList.add("on"),o(I,M,"remove"))}),e.events.on(Ge.removedFromWatchLater,function(){I&&(I.classList.remove("on"),o(I,M,"add"))})}function v(){w(t,".collections-button",function(){e.events.fire(Ge.collectionsButtonPressed)},s)}function g(){w(t,".share-button",function(){return e.events.fire(e.config.embed.settings.share.embed_only?Ge.embedButtonPressed:Ge.shareButtonPressed),!1},s)}function y(){var e=function(e){"opacity"===e.propertyName&&e.target.classList.contains("invisible")&&(e.target.classList.add("hidden"),e.target.setAttribute("hidden",""),e.target.classList.remove("visible"))};et(t).on("blur","button",s).on("mouseleave",".box",s).on(["focus","pointerdown","touchstart","mouseenter"],"button",a).on("transitionend","label",e),w(t,"label",function(){var e=$.indexOf(this);e>=0&&W[e].click()})}function b(){e.events.on([Ge.mousedOut,Ge.mouseTimeout],n).on(Ge.mousedOver,i).on(Ge.targetTimeReached,function(){X=!0,n()}).on(Ge.played,function(){N=!0}),et(t).on(["pointerenter","pointerleave","mouseenter","mouseleave"],function(e){return"pointerType"in e?void("mouse"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_MOUSE||(j="pointerenter"===e.type||"MSPointerEnter"===e.type)):void(j="mouseover"===e.type)}),et(t).on("transitionend",function(e){var n=Y||t;"opacity"===e.propertyName&&n.classList.contains("invisible")&&(n.classList.add("hidden"),n.setAttribute("hidden",""),C&&n.contains(C)&&(t.classList.add("hidden"),t.setAttribute("hidden","")))})}function k(){e.events.on(Ge.willEnterFullscreen,function(){j=!1,n()}).on(Ge.didExitFullscreen,function(e){e||(K=!0)})}function x(){e.events.on([Ge.airPlayActivated],function(){V=!0,i()}).on([Ge.airPlayDeactivated],function(){V=!1})}function S(){e.events.on(Ge.pictureInPictureActivated,function(){U=!0,i()}).on(Ge.pictureInPictureDeactivated,function(){U=!1})}function T(){e.events.on(Ge.overlayOpened,function(){H=!0,j=!1,n()}).on(Ge.overlayClosed,function(){H=!1,i()})}function E(){e.events.on(Ge.alertVisibilityChanged,function(e){z=e,e&&n()})}function P(){e.events.on(Ge.configChanged,function(){l()})}function L(){e.events.on($e.reset,function(){j=!1,X=!1,n(),r()})}var C,O,A,I,M,F,q,R,B,D=!1,N=!1,j=!1,H=!1,V=!1,U=!1,z=!1,W=[],$=[],G=null,X=!1,K=!1,Y=null,Q=e.config.embed.autoplay&&e.config.request.flags.autohide_controls;return l(),d(),f(),h(),p(),v(),g(),y(),b(),k(),x(),S(),T(),E(),P(),L(),e.events.fire(Ge.sidedockModuleReady),{}}function Re(e,t){function n(){p=!1,t.classList.add("invisible")}function i(){t.classList.remove("hidden"),t.removeAttribute("hidden"),setTimeout(function(){p=!0,t.classList.remove("invisible")},0)}function r(){if(p){if(m)return void n();if(b)return void n();if(!g&&_)return y&&v?void 0:void n()}}function o(){if(!p){if(g&&!m)return void i();if(y&&!k&&!b)return _||m?e.config.embed.settings.info_on_pause&&y&&!m?void i():void 0:void i()}}function a(){if(e.config.view===He.main||e.config.view===He.privateUnlocked){var n=!!e.config.embed.settings.byline,i=null!==e.config.video.owner.url,r=e.config.video.owner.url,o=0===e.config.embed.on_site,a="v1"===e.config.video.design_version_360,s="v2"===e.config.video.design_version_360,c={linkToOwner:i,ownerLink:r,targetBlank:o,showPortrait:!!e.config.embed.settings.portrait,portraitImg:e.config.video.owner[yt.devicePixelRatio>1?"img_2x":"img"],showByline:n,showTitle:!!e.config.embed.settings.title,showTitleLink:null!==e.config.video.url,titleLink:e.config.video.url,title:e.config.video.title,is360:e.config.video.is_panorama&&(a||s),strings:{}};if(e.config.embed.settings.byline){var u=e.config.embed.settings.byline_badge,l="";u&&u.type&&(l=ut.render("title_byline_badge",{targetBlank:o,cssClass:u.type,link:u.url||!1})),c.strings.byline="from "+ut.render("title_owner_byline",{linkToOwner:i,ownerLink:r,targetBlank:o,owner:e.config.video.owner.name})+l}var d=e.config.embed.settings.badge;if(d){var f=yt.devicePixelRatio>1?"img_2x":"img";yt.svg&&d.svg&&(f="svg"),c.showPortrait=!1,c.badge={link:d.link,img:d[f],offset:d.offset||!1,width:d.width,height:d.height,name:d.name,shadow:d.shadow||!1}}e.config.embed.autoplay&&(t.classList.add("hidden"),t.setAttribute("hidden","")),t.innerHTML=ut.render("title",c)}}function s(){e.events.on([Ge.mousedOut,Ge.mouseTimeout],r).on(Ge.mousedOver,o).on(Ge.playInitiated,function(){_=!0,y=!1,r()}).on([Ge.playButtonPressed,Ge.played],function(){y=!1,k=!1,r()}).on(Ge.paused,function(e,t){t||(y=!0,o())}).on(Ge.ended,function(){b=!0,r()}).on(Ge.scrubbingStarted,function(){x=y,k=!0}).on(Ge.scrubbingEnded,function(){x&&(k=!1)}).on(Ge.willEnterFullscreen,function(){r()}).on(Ge.didExitFullscreen,function(e){e||o()}),et(t).on(["pointerenter","pointerleave","mouseenter","mouseleave"],function(e){return"pointerType"in e?void("mouse"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_MOUSE||(v="pointerenter"===e.type||"MSPointerEnter"===e.type)):void(v="mouseover"===e.type)}),et(t).on("transitionend",function(e){"opacity"===e.propertyName&&t.classList.contains("invisible")&&(t.classList.add("hidden"),t.setAttribute("hidden",""))},!1)}function c(){e.events.on(Ge.ended,function(e){r()})}function u(){e.events.on([Ge.airPlayActivated],function(){g=!0,o()}).on([Ge.airPlayDeactivated],function(){g=!1,r()})}function l(){e.events.on(Ge.overlayOpened,function(e){"notsupported"!==e&&"private-unlocked"!==e&&"help"!==e&&(m=!0,v=!1,r())}).on(Ge.overlayClosed,function(){m=!1,v=!1,setTimeout(o,0)})}function d(){w(t,".badge",function(){e.events.fire(Ge.badgePressed,e.config.embed.settings.badge.id)})}function f(){e.events.on(Ge.configChanged,function(){a(),e.config.view===He.privateUnlocked&&o()})}function h(){e.events.on($e.reset,function(){_=!1,y=!0,b=!1,k=!1,o()})}var p=!0,v=!1,m=!1,g=!1,_=!1,y=!0,b=!1,k=!1,x=!1;return a(),s(),c(),u(),l(),d(),f(),h(),e.events.fire(Ge.titleModuleReady),{}}function Be(e,t,n,r){function o(){var t=F,n=window.getComputedStyle(e,":after");n&&(F=n.getPropertyValue("content").replace(/["'\s]*/g,""),F&&t!==F&&"undefined"!=typeof q[F]&&S.events.fire(q[F]))}function a(){var t=(S.config.view===He.main||S.config.view===He.privateUnlocked)&&S.config.embed.settings&&!S.config.embed.settings.playbar;e.classList.toggle("no-playbar",t),e.classList.toggle("with-fullscreen",!!S.config.embed.settings.fullscreen);var n=S.config.embed.settings.custom_logo;e.classList.toggle("with-custom-logo",!!n),e.classList.toggle("with-sticky-custom-logo",n&&n.sticky),e.classList.toggle("background-mode",!!S.config.embed.settings.background),e.classList.toggle("touch-support",yt.touch)}function s(e){var t=arguments.length<=1||void 0===arguments[1]?S.config.video.url:arguments[1];if(!(!t||e&&e.metaKey))return t.indexOf("#")===-1&&S.telecine.currentTime>0&&S.telecine.currentTime0&&window.innerHeight>0},i=null,r=function t(){return clearTimeout(i),n()?void e():void(i=setTimeout(t,250))};S.events.once(Ge.ready,r),S.events.once(Ge.error,r)})}function f(){var e=function(e,t){return S.verifyConfig().then(function(){var n=S.config.request,i=n.signature,r=n.session,o=n.timestamp,a=n.expires,s="https://"+S.config.player_url+"/video/"+S.config.video.id+"/"+e+"?signature="+i+"&session="+r+"&time="+o+"&expires="+a;return d(s,{method:t})})};S.events.on(Ge.vodButtonPressed,function(e){if(S.config.user.purchased){if(!S.config.video.vod.is_feature&&S.config.video.vod.feature_id)return void S.loadVideo(S.config.video.vod.feature_id).then(function(){return S.events.fire(Ge.playButtonPressed),S.config.video.vod.feature_id}).catch(function(e){S.reportException(e),S.events.fire($e.showOverlay,"error",{title:"Sorry",message:"There was a problem. Please try again."})});if(S.config.video.vod&&S.config.video.vod.is_coming_soon)return;return void S.events.fire(Ge.playButtonPressed)}S.performDelegateAction(Ve.purchase,function(){S.events.fire($e.openPopup,"purchase",{productId:e})},e)}),S.events.on(Ge.likeButtonPressed,function(){return S.config.user.logged_in?void(S.config.user.id!==S.config.video.owner.id&&(S.config.user.liked?S.performDelegateAction(Ve.unlike,function(){e("like","DELETE"),S.config.user.liked=!1,S.events.fire(Ge.unliked)}):S.performDelegateAction(Ve.like,function(){e("like","PUT"),S.config.user.liked=!0,S.events.fire(Ge.liked)}))):void S.performDelegateAction(Ve.loginForm,function(){S.events.fire($e.openPopup,"login-like")},"like")}),S.events.on(Ge.watchLaterButtonPressed,function(){if(S.config.video.url||"unlisted"===S.config.video.privacy)return S.config.user.logged_in?S.config.user.watch_later?void S.performDelegateAction(Ve.removeFromWatchLater,function(){e("watch-later","DELETE"),S.config.user.watch_later=!1,S.events.fire(Ge.removedFromWatchLater)}):void S.performDelegateAction(Ve.addToWatchLater,function(){e("watch-later","PUT"),S.config.user.watch_later=!0,S.events.fire(Ge.addedToWatchLater)}):void S.performDelegateAction(Ve.loginForm,function(){S.events.fire($e.openPopup,"login-watch-later")},"watch-later")}),S.events.on(Ge.collectionsButtonPressed,function(){S.performDelegateAction(Ve.collectionsOverlay,function(){return S.config.video.vod&&S.config.video.vod.url?void s(null,S.config.video.vod.url+"#collections"):S.config.video.url?void s(null,S.config.video.url+"#collections"):void 0})}),S.events.on(Ge.shareButtonPressed,function(){var e=S.config.embed.settings.share&&S.config.embed.settings.share.embed_only,t=function(){S.events.fire($e.showOverlay,"share",e)};return dt.element?void t():void S.performDelegateAction(Ve.shareOverlay,t)}),S.events.on(Ge.embedButtonPressed,function(){S.config.embed.settings.share.embed_only&&S.performDelegateAction(Ve.shareOverlay,function(){S.events.fire($e.showOverlay,"share",!0)})})}function h(){function t(){var e=90===Math.abs(window.orientation)?screen.height:screen.width;return yt.mobileAndroid&&!yt.browser.chrome&&!yt.browser.opera&&yt.android>=4&&(e/=window.devicePixelRatio),e/window.innerWidth}function n(e){var t=Math.round(10*Math.pow(e,-1.2));return Math.max(t,10)+"px"}function i(e){var t=Math.round(10*Math.pow(e,-.7));return Math.max(t,10)+"px"}function r(){C.then(function(){var e=t(),r=n(e),o=i(e);return O.style.fontSize=r,A.style.fontSize=o,I.style.fontSize=o,!0}).catch(function(){})}function o(){O.style.fontSize="",A.style.fontSize="",I.style.fontSize=""}S.events.on(Ge.didEnterFullscreen,o),S.events.on(Ge.didExitFullscreen,r),M&&(e.classList.add("mobile"),r())}function p(){if(et(window).on("resize",o),"undefined"!=typeof MutationObserver){var t=new MutationObserver(o);t.observe(e,{attributes:!0,attributeFilter:["class"]})}}function v(){function t(){var t=e;if(r&&r.getFullscreenElement&&"function"==typeof r.getFullscreenElement){var n=r.getFullscreenElement();n&&n instanceof HTMLElement&&n.contains(e)&&n.classList.contains("js-player-fullscreen")&&(t=n)}return t}function n(t,n){return s?void(s=!1):void(o||(o=!0,S.events.fire(Ge.didEnterFullscreen,e===t,a)))}function i(e){return s?void(s=!1):void(o&&(o=!1,S.events.fire(Ge.didExitFullscreen,a),a||S.events.fire($e.toggleNativeControls,!1),a=!1))}S.config.embed.fullscreen=!0,yt.iPad&&e.classList.add("no-fullscreen-api-support"),dt.enabled&&!yt.browser.bb10||yt.iPad||(e.classList.add("no-fullscreen-support"),yt.iOS||(S.config.embed.fullscreen=!1));var o=!1,a=!1,s=!1;S.events.on([Ge.pictureInPictureActivated,Ge.pictureInPictureDeactivated],function(){s=!0}),S.events.on($e.forceFullscreen,function(){return dt.enabled||dt.videoEnabled(e)?(S.events.fire(Ge.willEnterFullscreen),a=!1,void dt.request(t())):void S.events.fire($e.toggleNativeControls,!0)}),S.events.on(Ge.fullscreenButtonPressed,function(){"picture-in-picture"===S.telecine.presentationMode&&S.events.fire($e.deactivatePictureInPicture),dt.element?(S.events.fire(Ge.willExitFullscreen),dt.exit()):(S.events.fire(Ge.willEnterFullscreen),a=!0,dt.request(t()))});var c=dt.onenter,u=dt.onexit;if(dt.onenter=function(t){if(!o)return e.contains(t)?void n(t,!0):void("function"==typeof c&&c(t))},dt.onexit=function(){return o?void i(!0):void("function"==typeof u&&u())},et(e).on("click","a",function(e){dt.element===t()&&dt.exit()}),et(e).on("gestureend",function(e){e.scale>1&&S.events.fire(Ge.fullscreenButtonPressed)}),"undefined"!=typeof MSGesture){var l=1,d=new MSGesture;d.target=e,et(e).on("pointerdown",function(e){d.addPointer(e.pointerId)}).on(["MSGestureChange"],function(e){l*=e.scale}).on(["MSGestureEnd"],function(){(!o&&l>=2||o&&l<1)&&S.events.fire(Ge.fullscreenButtonPressed),l=1})}}function m(){w(e,"a[data-clip-link]",s),S.events.on($e.openVimeo,s)}function g(){u(),l(),f(),h(),p(),v(),m()}function _(){E||(E=new Ie(S,e.querySelector(".overlay-wrapper")))}function y(){P||(P=new Me(S,{uuid:S.uuid,id:e.id,isMobileDevice:!1}))}function b(){L||(L=new Fe(S))}function k(){_(),y(),b(),void new Te(S,O),void new Ee(S,e);var t=new Le(S,e);void new Ce(S,e.querySelector(".notification-wrapper")),void new Oe(S,e.querySelector(".outro-wrapper")),void new qe(S,A),void new Re(S,I),Object.defineProperties(T,{pauseKeyboard:{enumerable:!0,value:t.pause},unpauseKeyboard:{enumerable:!0,value:t.unpause}})}ut.helpers=Je;var x=c(n),S=new we({element:e,delegate:r,cssLoadedPromise:x});e.classList.add("js-player-fullscreen");var T=S.externalApi,E=null,P=null,L=null,C=null,O=e.querySelector(".controls"),A=e.querySelector(".sidedock"),I=e.querySelector(".title"),M=yt.mobileAndroid||yt.iPhone||yt.windowsPhone||yt.browser.bb10,F="normal",q={tiny:Ge.enteredTinyMode,mini:Ge.enteredMiniMode,normal:Ge.enteredNormalMode,none:Ge.enteredNormalMode},R={initializationHandler:function(){return k(),g(),je.resolve()},postInitializationHandler:function(){return S.telecine&&void new Pe(S,e.querySelector(".stats-debug")),je.resolve()},authorizationHandler:function(e){e(),_(),y();var t="Error",n="Unhandled video privacy";switch(S.config.view){case He.privatePassword:return new je(function(e,t){S.events.fire($e.showOverlay,"password"),S.events.once(Ge.passwordUnlocked,function(t){e(t)})});case He.privateLocked:b();var i="private-locked",r=null;return S.config.user.logged_in&&(i="error",r={title:"Private Video",message:"Sorry, you don’t have permission to watch.",modal:!0,logo:!!S.config.embed.settings.branding,icon:"lock"}),S.events.fire($e.showOverlay,i,r),je.reject();case He.error:t=S.config.title,n=S.config.message}return S.events.fire($e.showOverlay,"error",{title:t,message:n,modal:!0}),je.reject()}};return S.init(t,R).then(function(){return S.config.view!==He.privateUnlocked||S.config.embed.autoplay||S.events.fire($e.showOverlay,"private-unlocked"),!0}).catch(function(t){S.reportException(t),_(),y(),e.classList.remove("loading"),S.events.fire(Ge.error,"error",{message:"There was an error loading this video.",modal:!0,final:!0})}),T}var De="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ne=t(function(e){!function(t,n,i){n[t]=n[t]||i(),"undefined"!=typeof e&&e.exports?e.exports=n[t]:"function"==typeof define&&define.amd&&define(function(){return n[t]})}("Promise","undefined"!=typeof De?De:De,function(){function e(e,t){f.add(e,t),d||(d=p(f.drain))}function t(e){var t,n=typeof e;return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t&&t}function n(){for(var e=0;e0&&e(n,c))}catch(e){o.call(new s(c),e)}}}function o(t){var i=this;i.triggered||(i.triggered=!0,i.def&&(i=i.def),i.msg=t,i.state=2,i.chain.length>0&&e(n,i))}function a(e,t,n,i){for(var r=0;r":">",'"':""","'":"'","/":"/"},t.escape=function(e){return e.replace(/[&<>"'\/]/g,function(e){return t.map[e]})},t.helpers={},t.templates.stream_studder=function(e){var t="

";return t+=this.render("icon_warning")||"",t+=' Having issues? for smoother streaming.

'},t.templates.threesixty_support_alert=function(e){var t="

";return t+=this.render("icon_warning")||"",t+=' Looking for 360? See supported browsers for the full experience.

'},t.templates.buffer_pattern=function(e){var t='';return t},t.templates.compass=function(e){var t=' ';return t+=1==e.version?' ':' ',t+=""},t.templates.content_rating=function(e){var t='

'+e.strings.title+'

'+e.strings.subtitle+"

"+e.strings.update+"

";return t},t.templates.controlbar=function(e){var t='
", e.volume&&(t+='
'),e.ccButton&&(t+=' "),e.hdButton&&(t+=' "),t+=' ',e.airplayButton&&(t+=' "),t+=' ",e.vimeoLogo.show&&(t+=' "),t+='
",e.customLogo&&(t+='
',e.customLogo.showLink&&(t+=''),t+=' ',e.customLogo.showLink&&(t+=""),t+="
"),t+=""},t.templates.controlbar_trailer=function(e){var t='",e.vimeoLogo.show&&(t+=' "),t+="",e.customLogo&&(t+='
',e.customLogo.showLink&&(t+=''),t+=' ',e.customLogo.showLink&&(t+=""),t+="
"),t+=""},t.templates.error=function(e){var t='

'+e.title+"

";return e.message&&(t+="

"+e.message+"

"),t+="
"},t.templates.help=function(e){var t='

'+e.strings.title+'

'+e.strings.volumeUp+'
'+e.strings.volumeDown+'
'+e.strings.scrubForward+'
'+e.strings.scrubBackwards+'
W
'+e.strings.watchLater+'
C
'+e.strings.captions+'
H
'+e.strings.hd+'
F
'+e.strings.fullscreen+"
";return e.onSite||(t+='
V
'+e.strings.viewOnVimeo+"
"),t+="
"},t.templates.icon_airplay=function(e){var t='';return t},t.templates.icon_back=function(e){var t='';return t},t.templates.icon_broken_heart=function(e){var t='';return t},t.templates.icon_cc=function(e){var t='';return t},t.templates.icon_clock=function(e){var t='';return t},t.templates.icon_close=function(e){var t='';return t},t.templates.icon_collections=function(e){var t='';return t},t.templates.icon_embed=function(e){var t='';return t},t.templates.icon_facebook=function(e){var t='';return t},t.templates.icon_fullscreen=function(e){var t='';return t},t.templates.icon_hd=function(e){var t='';return t+=this.render("icon_back")||"",t+=''},t.templates.outro_image=function(e){var t="
";return e.url&&(t+=''),t+='',e.url&&(t+=""),t+="
"},t.templates.outro_link=function(e){var t='

'+(e.text?e.text:e.url)+"

";return t},t.templates.outro_text=function(e){var t='
'+e.text+"
";return t},t.templates.outro_videos=function(e){for(var t="",n=0,i=e.contexts.length;n"}return t+=""},t.templates.outro_vod=function(e){var t='"},t.templates.overlay_email_capture=function(e){var t='"},t.templates.password=function(e){var t='

'+e.strings.title+'

'+e.strings.subtitle+'

';return t},t.templates.private_locked=function(e){var t='";return t},t.templates.private_unlocked=function(e){var t='

'+e.strings.title+'

'+e.strings.subtitle+"

";return t},t.templates.share=function(e){var t='"},t.templates.sidedock=function(e){var t="";return e.vodButton&&(t+='
'),e.likeButton&&(t+='
"),e.watchLaterButton&&(t+='
"),e.collectionsButton&&(t+='
"),e.shareButton&&(t+='
"),e.vodButton&&(t+="
"),t+=""},t.templates.stats_debug=function(e){var t='

Clip ID:'+e.clipId+"

";return e.displayProfile&&(t+='

Profile ID:'+e.profileId+"

"),t+='

Delivery:'+e.delivery+'

Playing:'+e.resolution+'

Embed size:'+e.dimensions+'

CDN:'+e.cdn+"

",e.displayAudioVideoStream&&(t+='

Separate AV:'+e.separateAudioVideo+"

"),t+="",e.testGroup&&(t+='

Tests:'+e.testGroup+"

"),t+="",e.displayDroppedFrames&&(t+='

Dropped frames:0 / 0

'),t+="",e.displayBandwidth&&(t+='

Bandwidth:0 Kbps ()

'),t+='Open link'},t.templates.threesixty_instruct=function(e){var t='
';return t+=e.textOnly?" Click and drag to look around ":'

Look around!

',t+=""},t.templates.title=function(e){var t="
";return e.badge&&(t+='
',e.badge.link&&(t+=""),t+="
"),e.showPortrait&&(t+=' "),t+='
"},t.templates.title_byline_badge=function(e){var t=" ";return e.link&&(t+=''+e.cssClass+"",e.link&&(t+=""),t+=""},t.templates.title_owner_byline=function(e){var t="";return e.linkToOwner?(t+='"):(t+='',t+=this.escape(e.owner)||"",t+=""),t+=""},"undefined"!=typeof e&&e.exports?e.exports=t:window.Aftershave=t}()}),ut=e(ct),lt=t(function(e){!function(t,n,i){function r(){var e=Array.prototype.slice.apply(arguments),t=e.shift();v[t].forEach(function(t){"function"==typeof t&&t.apply(t,e)})}function o(e){return function(t,n){p.indexOf(t)!==-1&&e.call(this,t,n)}}function a(e){var t=null;if("VIDEO"===e.tagName)t=e;else{var n=e.getElementsByTagName("video");n[0]&&(t=n[0])}return t}function s(e){var t=a(e);if(t&&t.webkitEnterFullscreen){try{t.readyState=7,f=function(){var e=n.createElement("video"),t={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 r in t)for(var o=0,a=t[r].length;o0){var n=b.pop();t=t||n.element,n.error.call(t,e),P.onerror(t,e),r(h.ERROR,t,e)}},P={request:function(e,r,o,a){if(e=e||n.body,b.push({element:e,enter:r||y,exit:o||y,error:a||y}),void 0===f.request)return s(e);if(i&&n[f.enabled]===!1)return s(e);if(w!==!1&&w<32)return s(e);if(i&&void 0===f.enabled)return f.enabled="webkitFullscreenEnabled",e[f.request](),void setTimeout(function(){n[f.element]?n[f.enabled]=!0:(n[f.enabled]=!1,s(e))},250);try{!i&&t&&(m=t.scrollY),e[f.request](),k>=5.1&&setTimeout(function(){n[f.element]||E(i?"not_enabled":"not_allowed",e)},100)}catch(t){E("not_enabled",e)}},exit:function(){l(),!n[f.exit]&&P.element?P.element[f.exit]():n[f.exit]()},toggle:function(e,t,n,i){P.element?P.exit():P.request(e,t,n,i)},videoEnabled:function(e){if(P.enabled)return!0;e=e||n.body;var t=a(e);return!(!t||void 0===t.webkitSupportsFullscreen)&&(t.readyState-1&&v[e].splice(n,1)}),onenter:y,onexit:y,onchange:y,onerror:y};try{Object.defineProperties(P,{element:{enumerable:!0,get:function(){return g&&g.webkitDisplayingFullscreen?g:n[f.element]||null}},enabled:{enumerable:!0,get:function(){return"webkitCancelFullScreen"===f.exit&&!i||!(w!==!1&&w<32)&&(n[f.enabled]||!1)}}})}catch(e){P.element=null,P.enabled=!1}f.change&&n.addEventListener(f.change,function(e){if(P.onchange(P.element),r(h.CHANGE,P.element),P.element){var t=b[b.length-2];t&&t.element===P.element?T():(S(P.element),u())}else T()},!1),n.addEventListener("webkitbeginfullscreen",function(e){var t=!0;if(b.length>0)for(var n=0,i=b.length;n1||window.navigator.msMaxTouchPoints||!1,transformProperty:x("transform"),windowsPhone:vt};if(yt.threeSixtyVideo=!(yt.browser.safari||yt.iOS||yt.iPad),function(){for(var e=["webkit","moz"],t=0;t=0;--t)m[t]===e&&m.splice(t,1)}function s(){d(),m=[]}function c(e,t){var r=null;if(!t||n.collectWindowErrors){for(var o in m)if(m.hasOwnProperty(o))try{m[o].apply(null,[e].concat(i.call(arguments,2)))}catch(e){r=e}if(r)throw r}}function u(e,i,a,s,u){var l=null;if(y)n.computeStackTrace.augmentStackTraceWithInitialElement(y,i,a,e),f();else if(u)l=n.computeStackTrace(u),c(l,!0);else{var d,h={url:i,line:a,column:s},v=void 0,m=e;if("[object String]"==={}.toString.call(e)){var d=e.match(o);d&&(v=d[1],m=d[2])}h.func=r,l={name:v,message:m,url:t(),stack:[h]},c(l,!0)}return!!p&&p.apply(this,arguments)}function l(){v||(p=window.onerror,window.onerror=u,v=!0)}function d(){v&&(window.onerror=p,v=!1,p=void 0)}function f(){var e=y,t=g;g=null,y=null,_=null,c.apply(null,[e,!1].concat(t))}function h(e,t){var r=i.call(arguments,1);if(y){if(_===e)return;f()}var o=n.computeStackTrace(e);if(y=o,_=e,g=r,setTimeout(function(){_===e&&f()},o.incomplete?2e3:0),t!==!1)throw e}var p,v,m=[],g=null,_=null,y=null;return h.subscribe=e,h.unsubscribe=a,h.uninstall=s,h}(),n.computeStackTrace=function(){function e(e){if("undefined"!=typeof e.stack&&e.stack){for(var n,i,o=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i,s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=e.stack.split("\n"),u=[],l=(/^(.*) is undefined$/.exec(e.message),0),d=c.length;l0&&e.stack[0].url===o.url){if(e.stack[0].line===o.line)return!1;if(!e.stack[0].line&&e.stack[0].func===o.func)return e.stack[0].line=o.line,!1}return e.stack.unshift(o),e.partial=!0,!0}return e.incomplete=!0,!1}function o(e,s){for(var c,u,l=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,d=[],f={},h=!1,p=o.caller;p&&!h;p=p.caller)if(p!==a&&p!==n.report){if(u={url:null,func:r,line:null,column:null},p.name?u.func=p.name:(c=l.exec(p.toString()))&&(u.func=c[1]),"undefined"==typeof u.func)try{u.func=c.input.substring(0,c.input.indexOf("{"))}catch(e){}f[""+p]?h=!0:f[""+p]=!0,d.push(u)}s&&d.splice(0,s);var v={name:e.name,message:e.message,url:t(),stack:d};return i(v,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),v}function a(i,r){var a=null;r=null==r?0:+r;try{if(a=e(i))return a}catch(e){if(n.debug)throw e}try{if(a=o(i,r+1))return a}catch(e){if(n.debug)throw e}return{name:i.name,message:i.message,url:t()}}return a.augmentStackTraceWithInitialElement=i,a.computeStackTraceFromStackProp=e,a}(),e.exports=n}),St=e(xt),Tt=Object.freeze({default:St}),Et=t(function(e){function t(e){this.name="RavenConfigError",this.message=e}t.prototype=new Error,t.prototype.constructor=t,e.exports=t}),Pt=e(Et),Lt=Object.freeze({default:Pt}),Ct=t(function(e,t){function n(e,t,n,r){return JSON.stringify(e,i(t,r),n)}function i(e,t){var n=[],i=[];return null==t&&(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]"}),function(r,o){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?i.splice(a,1/0,r):i.push(r),~n.indexOf(o)&&(o=t.call(this,r,o))}else n.push(o);return null==e?o:e.call(this,r,o)}}t=e.exports=n,t.getSerialize=i}),Ot=e(Ct),At=Ct.getSerialize,It=Object.freeze({default:Ot,getSerialize:At}),Mt=t(function(e){var t=function(e,t,n){var i=e[t],r=e;if(t in e){var o="warn"===t?"warning":t;e[t]=function(){var e=[].slice.call(arguments),t=""+e.join(" "),a={level:o,logger:"console",extra:{arguments:e}};n&&n(t,a),i&&Function.prototype.apply.call(i,r,e)}}};e.exports={wrapMethod:t}}),Ft=e(Mt),qt=Mt.wrapMethod,Rt=Object.freeze({default:Ft,wrapMethod:qt}),Bt=t(function(t){function n(){return+new Date}function i(){this._hasJSON=!("object"!=typeof JSON||!JSON.stringify),this._hasDocument=!r(L),this._lastCapturedException=null,this._lastEventId=null,this._globalServer=null,this._globalKey=null,this._globalProject=null,this._globalContext={},this._globalOptions={logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],crossOrigin:"anonymous",collectWindowErrors:!0,maxMessageLength:0,stackTraceLimit:50,autoBreadcrumbs:!0},this._ignoreOnError=0,this._isRavenInstalled=!1,this._originalErrorStackTraceLimit=Error.stackTraceLimit,this._originalConsole=P.console||{},this._originalConsoleMethods={},this._plugins=[],this._startTime=n(),this._wrappedBuiltIns=[],this._breadcrumbs=[],this._lastCapturedEvent=null,this._keypressTimeout,this._location=P.location,this._lastHref=this._location&&this._location.href;for(var e in this._originalConsole)this._originalConsoleMethods[e]=this._originalConsole[e]}function r(e){return void 0===e}function o(e){return"function"==typeof e}function a(e){return"[object String]"===C.toString.call(e)}function s(e){return"object"==typeof e&&null!==e}function c(e){for(var t in e)return!1;return!0}function u(e){var t=C.toString.call(e);return s(e)&&"[object Error]"===t||"[object Exception]"===t||e instanceof Error}function l(e,t){var n,i;if(r(e.length))for(n in e)h(e,n)&&t.call(null,n,e[n]);else if(i=e.length)for(n=0;n ",c=s.length;e&&o++1&&a+r.length*c+t.length>=i));)r.push(t),a+=t.length,e=e.parentNode;return r.reverse().join(s)}function y(e){var t,n,i,r,o,s=[];if(!e||!e.tagName)return"";if(s.push(e.tagName.toLowerCase()),e.id&&s.push("#"+e.id),t=e.className,t&&a(t))for(n=t.split(" "),o=0;othis._globalOptions.maxBreadcrumbs&&this._breadcrumbs.shift(),this},addPlugin:function(e){var t=[].slice.call(arguments,1);return this._plugins.push([e,t]),this._isRavenInstalled&&this._drainPlugins(),this},setUserContext:function(e){return this._globalContext.user=e,this},setExtraContext:function(e){return this._mergeContext("extra",e),this},setTagsContext:function(e){return this._mergeContext("tags",e),this},clearContext:function(){return this._globalContext={},this},getContext:function(){return JSON.parse(x(this._globalContext))},setEnvironment:function(e){return this._globalOptions.environment=e,this},setRelease:function(e){return this._globalOptions.release=e,this},setDataCallback:function(e){var t=this._globalOptions.dataCallback;return this._globalOptions.dataCallback=o(e)?function(n){return e(n,t)}:e,this},setShouldSendCallback:function(e){var t=this._globalOptions.shouldSendCallback;return this._globalOptions.shouldSendCallback=o(e)?function(n){return e(n,t)}:e,this},setTransport:function(e){return this._globalOptions.transport=e,this},lastException:function(){return this._lastCapturedException},lastEventId:function(){return this._lastEventId},isSetup:function(){return!!this._hasJSON&&(!!this._globalServer||(this.ravenNotConfiguredError||(this.ravenNotConfiguredError=!0,this._logDebug("error","Error: Raven has not been configured.")),!1))},afterLoad:function(){var e=P.RavenConfig;e&&this.config(e.dsn,e.config).install()},showReportDialog:function(e){if(L){e=e||{};var t=e.eventId||this.lastEventId();if(!t)throw new k("Missing eventId");var n=e.dsn||this._dsn;if(!n)throw new k("Missing DSN");var i=encodeURIComponent,r="";r+="?eventId="+i(t),r+="&dsn="+i(n);var o=e.user||this._globalContext.user;o&&(o.name&&(r+="&name="+i(o.name)),o.email&&(r+="&email="+i(o.email)));var a=this._getGlobalServer(this._parseDSN(n)),s=L.createElement("script");s.async=!0,s.src=a+"/api/embed/error-page/"+r,(L.head||L.body).appendChild(s)}},_ignoreNextOnError:function(){var e=this;this._ignoreOnError+=1,setTimeout(function(){e._ignoreOnError-=1})},_triggerEvent:function(e,t){var n,i;if(this._hasDocument){t=t||{},e="raven"+e.substr(0,1).toUpperCase()+e.substr(1),L.createEvent?(n=L.createEvent("HTMLEvents"),n.initEvent(e,!0,!0)):(n=L.createEventObject(),n.eventType=e);for(i in t)h(t,i)&&(n[i]=t[i]);if(L.createEvent)L.dispatchEvent(n);else try{L.fireEvent("on"+n.eventType.toLowerCase(),n)}catch(e){}}},_breadcrumbEventHandler:function(e){var t=this;return function(n){if(t._keypressTimeout=null,t._lastCapturedEvent!==n){t._lastCapturedEvent=n;var i,r=n.target;try{i=_(r)}catch(e){i=""}t.captureBreadcrumb({category:"ui."+e,message:i})}}},_keypressEventHandler:function(){var e=this,t=1e3;return function(n){var i=n.target,r=i&&i.tagName;if(r&&("INPUT"===r||"TEXTAREA"===r||i.isContentEditable)){var o=e._keypressTimeout;o||e._breadcrumbEventHandler("input")(n),clearTimeout(o),e._keypressTimeout=setTimeout(function(){e._keypressTimeout=null},t)}}},_captureUrlChange:function(e,t){var n=m(this._location.href),i=m(t),r=m(e);this._lastHref=t,n.protocol===i.protocol&&n.host===i.host&&(t=i.relative),n.protocol===r.protocol&&n.host===r.host&&(e=r.relative),this.captureBreadcrumb({category:"navigation",data:{to:t,from:e}})},_instrumentTryCatch:function(){function e(e){return function(t,i){for(var r=new Array(arguments.length),a=0;a2?arguments[2]:void 0;return n&&t._captureUrlChange(t._lastHref,n+""),e.apply(this,arguments)}},i)}if(n.console&&"console"in P&&console.log){var f=function(e,n){t.captureBreadcrumb({message:e,level:n.level,category:"console"})};l(["debug","info","warn","error","log"],function(e,t){S(console,t,f)})}},_restoreBuiltIns:function(){for(var e;this._wrappedBuiltIns.length;){e=this._wrappedBuiltIns.shift();var t=e[0],n=e[1],i=e[2];t[n]=i}},_drainPlugins:function(){var e=this;l(this._plugins,function(t,n){var i=n[0],r=n[1];i.apply(e,[e].concat(r))})},_parseDSN:function(e){var t=E.exec(e),n={},i=7;try{for(;i--;)n[T[i]]=t[i]||""}catch(t){throw new k("Invalid DSN: "+e)}if(n.pass&&!this._globalOptions.allowSecretKey)throw new k("Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key");return n},_getGlobalServer:function(e){var t="//"+e.host+(e.port?":"+e.port:"");return e.protocol&&(t=e.protocol+":"+t),t},_handleOnErrorStackInfo:function(){this._ignoreOnError||this._handleStackInfo.apply(this,arguments)},_handleStackInfo:function(e,t){var n=this._prepareFrames(e,t);this._triggerEvent("handle",{stackInfo:e,options:t}),this._processException(e.name,e.message,e.url,e.lineno,n,t)},_prepareFrames:function(e,t){var n=this,i=[];if(e.stack&&e.stack.length&&(l(e.stack,function(e,t){var r=n._normalizeFrame(t);r&&i.push(r)}),t&&t.trimHeadFrames))for(var r=0;r0&&(e.breadcrumbs={values:[].slice.call(this._breadcrumbs,0)}),c(e.tags)&&delete e.tags,this._globalContext.user&&(e.user=this._globalContext.user),t.environment&&(e.environment=t.environment),t.release&&(e.release=t.release),t.serverName&&(e.server_name=t.serverName),o(t.dataCallback)&&(e=t.dataCallback(e)||e),e&&!c(e)&&(o(t.shouldSendCallback)&&!t.shouldSendCallback(e)||this._sendProcessedPayload(e))},_getUuid:function(){return g()},_sendProcessedPayload:function(e,t){var n=this,i=this._globalOptions;if(this._lastEventId=e.event_id||(e.event_id=this._getUuid()),e=this._trimPacket(e),this._logDebug("debug","Raven about to send:",e),this.isSetup()){var r={sentry_version:"7",sentry_client:"raven-js/"+this.VERSION,sentry_key:this._globalKey};this._globalSecret&&(r.sentry_secret=this._globalSecret);var o=e.exception&&e.exception.values[0];this.captureBreadcrumb({category:"sentry",message:o?(o.type?o.type+": ":"")+o.value:e.message,event_id:e.event_id,level:e.level||"error"});var a=this._globalEndpoint;(i.transport||this._makeRequest).call(this,{url:a,auth:r,data:e,options:i,onSuccess:function(){n._triggerEvent("success",{data:e,src:a}),t&&t()},onError:function(i){n._triggerEvent("failure",{data:e,src:a}),i=i||new Error("Raven send failed (no additional details provided)"),t&&t(i)}})}},_makeRequest:function(e){function t(){200===n.status?e.onSuccess&&e.onSuccess():e.onError&&e.onError(new Error("Sentry error code: "+n.status))}var n=new XMLHttpRequest,i="withCredentials"in n||"undefined"!=typeof XDomainRequest;if(i){var r=e.url;"withCredentials"in n?n.onreadystatechange=function(){4===n.readyState&&t()}:(n=new XDomainRequest,r=r.replace(/^https?:/,""),n.onload=t),n.open("POST",r+"?"+v(e.auth)),n.send(x(e.data))}},_logDebug:function(e){this._originalConsoleMethods[e]&&this.debug&&Function.prototype.apply.call(this._originalConsoleMethods[e],this._originalConsole,[].slice.call(arguments,1))},_mergeContext:function(e,t){r(t)?delete this._globalContext[e]:this._globalContext[e]=d(this._globalContext[e]||{},t)}};var C=Object.prototype;"undefined"!=typeof __false__&&__false__&&(i.utils={isUndefined:r,isFunction:o,isString:a,isObject:s,isEmptyObject:c,isError:u,each:l,objectMerge:d,truncate:f,hasKey:h,joinRegExp:p,urlencode:v,uuid4:g,htmlTreeAsString:_,htmlElementAsString:y,parseUrl:m,fill:b}),i.prototype.setUser=i.prototype.setUserContext,i.prototype.setReleaseContext=i.prototype.setRelease,t.exports=i}),Dt=e(Bt),Nt=Object.freeze({default:Dt}),jt=t(function(t){var n=e(Nt),i=window.Raven,r=new n;r.noConflict=function(){return window.Raven=i,r},r.afterLoad(),t.exports=r}),Ht=e(jt),Vt={false:!1,LIB_VERSION:"2.9.16"};kt="undefined"==typeof window?{navigator:{}}:window;var Ut=Array.prototype,zt=Function.prototype,Wt=Object.prototype,$t=Ut.slice,Gt=Wt.toString,Xt=Wt.hasOwnProperty,Kt=kt.console,Yt=kt.navigator,Qt=kt.document,Jt=Yt.userAgent,Zt=zt.bind,en=Ut.forEach,tn=Ut.indexOf,nn=Array.isArray,rn={},on={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},an={log:function(){if(Vt.false&&!on.isUndefined(Kt)&&Kt)try{Kt.log.apply(Kt,arguments)}catch(e){on.each(arguments,function(e){Kt.log(e)})}},error:function(){if(Vt.false&&!on.isUndefined(Kt)&&Kt){var e=["Mixpanel error:"].concat(on.toArray(arguments));try{Kt.error.apply(Kt,e)}catch(t){on.each(e,function(e){Kt.error(e)})}}},critical:function(){if(!on.isUndefined(Kt)&&Kt){var e=["Mixpanel error:"].concat(on.toArray(arguments));try{Kt.error.apply(Kt,e)}catch(t){on.each(e,function(e){Kt.error(e)})}}}};on.bind=function(e,t){var n,i;if(Zt&&e.bind===Zt)return Zt.apply(e,$t.call(arguments,1));if(!on.isFunction(e))throw new TypeError;return n=$t.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat($t.call(arguments)));var r={};r.prototype=e.prototype;var o=new r;r.prototype=null;var a=e.apply(o,n.concat($t.call(arguments)));return Object(a)===a?a:o}},on.bind_instance_methods=function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=on.bind(e[t],e))},on.each=function(e,t,n){if(null!==e&&void 0!==e)if(en&&e.forEach===en)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,r=e.length;i/g,">").replace(/"/g,""").replace(/'/g,"'")),t},on.extend=function(e){return on.each($t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},on.isArray=nn||function(e){return"[object Array]"===Gt.call(e)},on.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},on.isArguments=function(e){return!(!e||!Xt.call(e,"callee"))},on.toArray=function(e){return e?e.toArray?e.toArray():on.isArray(e)?$t.call(e):on.isArguments(e)?$t.call(e):on.values(e):[]},on.values=function(e){var t=[];return null===e?t:(on.each(e,function(e){t[t.length]=e}),t)},on.identity=function(e){return e},on.include=function(e,t){var n=!1;return null===e?n:tn&&e.indexOf===tn?e.indexOf(t)!=-1:(on.each(e,function(e){if(n||(n=e===t))return rn}),n)},on.includes=function(e,t){return e.indexOf(t)!==-1},on.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},on.isObject=function(e){return e===Object(e)&&!on.isArray(e)},on.isEmptyObject=function(e){if(on.isObject(e)){for(var t in e)if(Xt.call(e,t))return!1;return!0}return!1},on.isUndefined=function(e){return void 0===e},on.isString=function(e){return"[object String]"==Gt.call(e)},on.isDate=function(e){return"[object Date]"==Gt.call(e)},on.isNumber=function(e){return"[object Number]"==Gt.call(e)},on.isElement=function(e){return!(!e||1!==e.nodeType)},on.encodeDates=function(e){return on.each(e,function(t,n){on.isDate(t)?e[n]=on.formatDate(t):on.isObject(t)&&(e[n]=on.encodeDates(t))}),e},on.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},on.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},on.safewrap=function(e){return function(){try{return e.apply(this,arguments)}catch(e){an.critical("Implementation error. Please contact support@mixpanel.com.")}}},on.safewrap_class=function(e,t){for(var n=0;n0&&(t[n]=e)}),t},on.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):on.isArray(e)?(n=[],on.each(e,function(e){n.push(on.truncate(e,t))})):on.isObject(e)?(n={},on.each(e,function(e,i){n[i]=on.truncate(e,t)})):n=e,n},on.JSONEncode=function(){return function(e){var t=e,n=function(e){var t=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'},i=function(e,t){var r="",o=" ",a=0,s="",c="",u=0,l=r,d=[],f=t[e];switch(f&&"object"==typeof f&&"function"==typeof f.toJSON&&(f=f.toJSON(e)),typeof f){case"string":return n(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(r+=o,d=[],"[object Array]"===Gt.apply(f)){for(u=f.length,a=0;a="0"&&t<="9";)n+=t,a();if("."===t)for(n+=".";a()&&t>="0"&&t<="9";)n+=t;if("e"===t||"E"===t)for(n+=t,a(),"-"!==t&&"+"!==t||(n+=t,a());t>="0"&&t<="9";)n+=t,a();return e=+n,isFinite(e)?e:void o("Bad number")},c=function(){var e,n,i,s="";if('"'===t)for(;a();){if('"'===t)return a(),s;if("\\"===t)if(a(),"u"===t){for(i=0,n=0;n<4&&(e=parseInt(a(),16),isFinite(e));n+=1)i=16*i+e;s+=String.fromCharCode(i)}else{if("string"!=typeof r[t])break;s+=r[t]}else s+=t}o("Bad string")},u=function(){for(;t&&t<=" ";)a()},l=function(){switch(t){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o('Unexpected "'+t+'"')},d=function(){var e=[];if("["===t){if(a("["),u(),"]"===t)return a("]"),e;for(;t;){if(e.push(i()),u(),"]"===t)return a("]"),e;a(","),u()}}o("Bad array")},f=function(){var e,n={};if("{"===t){if(a("{"),u(),"}"===t)return a("}"),n;for(;t;){if(e=c(),u(),a(":"),Object.hasOwnProperty.call(n,e)&&o('Duplicate key "'+e+'"'),n[e]=i(),u(),"}"===t)return a("}"),n;a(","),u()}}o("Bad object")};return i=function(){switch(u(),t){case"{":return f();case"[":return d();case'"':return c();case"-":return s();default:return t>="0"&&t<="9"?s():l()}},function(r){var a;return n=r,e=0,t=" ",a=i(),u(),t&&o("Syntax error"),a}}(),on.base64Encode=function(e){var t,n,i,r,o,a,s,c,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,d=0,f="",h=[];if(!e)return e;e=on.utf8Encode(e);do t=e.charCodeAt(l++),n=e.charCodeAt(l++),i=e.charCodeAt(l++),c=t<<16|n<<8|i,r=c>>18&63,o=c>>12&63,a=c>>6&63,s=63&c,h[d++]=u.charAt(r)+u.charAt(o)+u.charAt(a)+u.charAt(s);while(l127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==s&&(n>t&&(r+=e.substring(t,n)),r+=s,t=n=i+1)}return n>t&&(r+=e.substring(t,e.length)),r},on.UUID=function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")},n=function(){function e(e,t){var n,i=0;for(n=0;n=4&&(o=e(o,r),r=[]);return r.length>0&&(o=e(o,r)),o.toString(16)};return function(){var i=(screen.height*screen.width).toString(16);return e()+"-"+t()+"-"+n()+"-"+i+"-"+e()}}(),on.isBlockedUA=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp)/i.test(e)},on.HTTPBuildQuery=function(e,t){var n,i,r=[];return on.isUndefined(t)&&(t="&"),on.each(e,function(e,t){n=encodeURIComponent(e.toString()),i=encodeURIComponent(t),r[r.length]=i+"="+n}),r.join(t)},on.getQueryParam=function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+t+"=([^&#]*)",i=new RegExp(n),r=i.exec(e);return null===r||r&&"string"!=typeof r[1]&&r[1].length?"":decodeURIComponent(r[1]).replace(/\+/g," ")},on.getHashParam=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},on.cookie={get:function(e){for(var t=e+"=",n=Qt.cookie.split(";"),i=0;i=0}function n(n){if(!Qt.getElementsByTagName)return[];var i,r,o,a,s,c,u,l,d,f,h=n.split(" "),p=[Qt];for(c=0;c-1){r=i.split("#"),o=r[0];var v=r[1],m=Qt.getElementById(v);if(!m||o&&m.nodeName.toLowerCase()!=o)return[];p=[m]}else if(i.indexOf(".")>-1){r=i.split("."),o=r[0];var g=r[1];for(o||(o="*"),a=[],s=0,u=0;u-1};break;default:k=function(e){return e.getAttribute(y)}}for(p=[],f=0,u=0;u=3?t[2]:""},properties:function(){return on.extend(on.strip_empty_properties({$os:on.info.os(),$browser:on.info.browser(Jt,Yt.vendor,window.opera),$referrer:Qt.referrer,$referring_domain:on.info.referringDomain(Qt.referrer),$device:on.info.device(Jt)}),{$current_url:window.location.href,$browser_version:on.info.browserVersion(Jt,Yt.vendor,window.opera),$screen_height:screen.height,$screen_width:screen.width,mp_lib:"web",$lib_version:Vt.LIB_VERSION})},people_properties:function(){return on.extend(on.strip_empty_properties({$os:on.info.os(),$browser:on.info.browser(Jt,Yt.vendor,window.opera)}),{$browser_version:on.info.browserVersion(Jt,Yt.vendor,window.opera)})},pageviewInfo:function(e){return on.strip_empty_properties({mp_page:e,mp_referrer:Qt.referrer,mp_browser:on.info.browser(Jt,Yt.vendor,window.opera),mp_platform:on.info.os()})}},on.toArray=on.toArray,on.isObject=on.isObject,on.JSONEncode=on.JSONEncode,on.JSONDecode=on.JSONDecode,on.isBlockedUA=on.isBlockedUA,on.isEmptyObject=on.isEmptyObject,on.info=on.info,on.info.device=on.info.device,on.info.browser=on.info.browser,on.info.properties=on.info.properties;var sn="__mpced",cn=1,un=3,ln={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;do e=e.previousSibling;while(e&&e.nodeType!==cn);return e},_loadScript:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var i=document.getElementsByTagName("script");i.length>0?i[0].parentNode.insertBefore(n,i[0]):document.body.appendChild(n)},_getClassName:function(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}},_getPropertiesFromElement:function(e){var t={classes:this._getClassName(e).split(" "),tag_name:e.tagName.toLowerCase()};if(on.includes(["input","select","textarea"],e.tagName.toLowerCase())){var n=this._getFormFieldValue(e);this._includeProperty(e,n)&&(t.value=n)}on.each(e.attributes,function(e){t["attr__"+e.name]=e.value});for(var i=1,r=1,o=e;o=this._previousElementSibling(o);)i++,o.tagName===e.tagName&&r++;return t.nth_child=i,t.nth_of_type=r,t},_isTag:function(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()},_shouldTrackDomEvent:function(e,t){if(!e||this._isTag(e,"html")||e.nodeType!==cn)return!1;var n=e.tagName.toLowerCase();switch(n){case"html":return!1;case"form":return"submit"===t.type;case"input":return["button","submit"].indexOf(e.getAttribute("type"))===-1?"change"===t.type:"click"===t.type;case"select":case"textarea":return"change"===t.type;default:return"click"===t.type}},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1,$host:window.location.host,$pathname:window.location.pathname}},_getInputValue:function(e){var t=null,n=e.type.toLowerCase();switch(n){case"checkbox":e.checked&&(t=[e.value]);break;case"radio":e.checked&&(t=e.value);break;default:t=e.value}return t},_getSelectValue:function(e){var t;if(e.multiple){var n=[];on.each(e.querySelectorAll("[selected]"),function(e){n.push(e.value)}),t=n}else t=e.value;return t},_includeProperty:function(e,t){for(var n=e;n.parentNode&&!this._isTag(n,"body");n=n.parentNode){var i=this._getClassName(n).split(" ");if(on.includes(i,"mp-sensitive")||on.includes(i,"mp-no-track"))return!1}if(on.includes(this._getClassName(e).split(" "),"mp-include"))return!0;if(null===t)return!1;var r=e.type||"";switch(r.toLowerCase()){case"hidden":return!1;case"password":return!1}var o=e.name||e.id||"",a=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(a.test(o.replace(/[^a-zA-Z0-9]/g,"")))return!1;if("string"==typeof t){var s=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(s.test((t||"").replace(/[\- ]/g,"")))return!1;var c=/(^\d{3}-?\d{2}-?\d{4}$)/;if(c.test(t))return!1}return!0},_getFormFieldValue:function(e){var t;switch(e.tagName.toLowerCase()){case"input":t=this._getInputValue(e);break;case"select":t=this._getSelectValue(e);break;default:t=e.value||e.textContent}return this._includeProperty(e,t)?t:null},_getFormFieldProperties:function(e){var t={};return on.each(e.elements,function(e){var n=e.getAttribute("name")||e.getAttribute("id");if(null!==n){n="$form_field__"+n;var i=this._getFormFieldValue(e);if(this._includeProperty(e,i)){var r=t[n];void 0!==r?t[n]=[].concat(r,i):t[n]=i}}},this),t},_extractCustomPropertyValue:function(e){var t=[];return on.each(document.querySelectorAll(e.css_selector),function(e){["input","select"].indexOf(e.tagName.toLowerCase())>-1?t.push(e.value):e.textContent&&t.push(e.textContent)}),t.join(", ")},_getCustomProperties:function(e){var t={};return on.each(this._customProperties,function(n){on.each(n.event_selectors,function(i){var r=document.querySelectorAll(i);on.each(r,function(i){on.includes(e,i)&&(t[n.name]=this._extractCustomPropertyValue(n))},this)},this)},this),t},checkForBackoff:function(e){var t=parseInt(e.getResponseHeader("X-MP-CE-Backoff"));if(!isNaN(t)&&t>0){on.timestamp()+1e3*t;on.cookie.set_seconds(sn,!0,t,!0)}},_getEventTarget:function(e){return"undefined"==typeof e.target?e.srcElement:e.target},_trackEvent:function(e,t){var n=this._getEventTarget(e);if(n.nodeType===un&&(n=n.parentNode),this._shouldTrackDomEvent(n,e)){for(var i=[n],r=n;r.parentNode&&!this._isTag(r,"body");)i.push(r.parentNode),r=r.parentNode;var o,a,s,c=[],u=!1;if(on.each(i,function(e,t){if("a"===e.tagName.toLowerCase()?o=e.getAttribute("href"):"form"===e.tagName.toLowerCase()&&(s=e),!a&&t<5&&e.textContent){var n=on.trim(e.textContent);n&&(a=n.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}var i=this._getClassName(e).split(" ");on.includes(i,"mp-no-track")&&(u=!0),c.push(this._getPropertiesFromElement(e))},this),u)return!1;var l=on.extend(this._getDefaultProperties(e.type),{$elements:c,$el_attr__href:o,$el_text:a},this._getCustomProperties(i));return!s||"submit"!==e.type&&"click"!==e.type||on.extend(l,this._getFormFieldProperties(s)),t.track("$web_event",l),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=on.bind(function(t){on.cookie.parse(sn)!==!0&&(t=t||window.event,this._trackEvent(t,e))},this);on.register_event(document,"submit",t,!1,!0),on.register_event(document,"change",t,!1,!0),on.register_event(document,"click",t,!1,!0)},_customProperties:{},init:function(e){if(!document||!document.body){var t=this;return void setTimeout(function(){t.init(e)},500)}var n=e.get_config("token");if(!(this._initializedTokens.indexOf(n)>-1||(this._initializedTokens.push(n),this._maybeLoadEditor(e)))){var i=on.bind(function(t){t&&t.config&&t.config.enable_collect_everything===!0?(t.custom_properties&&(this._customProperties=t.custom_properties),e.track("$web_event",on.extend({$title:document.title},this._getDefaultProperties("pageview"))),this._addDomEventHandlers(e)):e.__autotrack_enabled=!1},this);e._send_request(e.get_config("decide_host")+"/decide/",{verbose:!0,version:"1",lib:"web",token:n},e._prepare_callback(i))}},_editorParamsFromHash:function(e,t){var n;try{var i=on.getHashParam(t,"state");i=JSON.parse(decodeURIComponent(i));var r=on.getHashParam(t,"expires_in");n={accessToken:on.getHashParam(t,"access_token"),accessTokenExpiresAt:(new Date).getTime()+1e3*Number(r),bookmarkletMode:!!i.bookmarkletMode,projectId:i.projectId,projectOwnerId:i.projectOwnerId,projectToken:i.token,readOnly:i.readOnly,userFlags:i.userFlags,userId:i.userId},window.sessionStorage.setItem("editorParams",JSON.stringify(n)),i.desiredHash?window.location.hash=i.desiredHash:window.history?history.replaceState("",document.title,window.location.pathname+window.location.search):window.location.hash=""}catch(e){}return n},_maybeLoadEditor:function(e){var t=!1;if(on.getHashParam(window.location.hash,"state")){var n=on.getHashParam(window.location.hash,"state");n=JSON.parse(decodeURIComponent(n)),t="mpeditor"===n.action}var i,r=!!window.sessionStorage.getItem("_mpcehash");return t?i=this._editorParamsFromHash(e,window.location.hash):r?(i=this._editorParamsFromHash(e,window.sessionStorage.getItem("_mpcehash")),window.sessionStorage.removeItem("_mpcehash")):i=JSON.parse(window.sessionStorage.getItem("editorParams")||"{}"), !(!i.projectToken||e.get_config("token")!==i.projectToken)&&(this._loadEditor(e,i),!0)},_editorLoaded:!1,_loadEditor:function(e,t){if(!this._editorLoaded){this._editorLoaded=!0;var n,i="?_ts="+(new Date).getTime(),r=e.get_config("app_host")+"/site_media";return n=Vt.false?r+"/compiled/reports/collect-everything/editor.js"+i:r+"/bundle-webpack/reports/collect-everything/editor.min.js"+i,this._loadScript(n,function(){window.mp_load_editor(t)}),!0}return!1},enabledForProject:function(e,t,n){t=on.isUndefined(t)?10:t,n=on.isUndefined(n)?10:n;for(var i=0,r=0;rt&&delete e[n];on.isEmptyObject(e)&&delete this.props[Ln]}}),Nn.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register_once(on.info.campaignParams()),this.campaign_params_saved=!0)},Nn.prototype.update_search_keyword=function(e){this.register(on.info.searchInfo(e))},Nn.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:on.info.referringDomain(e)||"$direct"},"")},Nn.prototype.get_referrer_info=function(){return on.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Nn.prototype.safe_merge=function(e){return on.each(this.props,function(t,n){n in e||(e[n]=t)}),e},Nn.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Nn.prototype.set_disabled=function(e){this.disabled=e,this.disabled&&this.remove()},Nn.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Nn.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Nn.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Nn.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),i=t[e],r=this._get_or_create_queue(wn),o=this._get_or_create_queue(kn),a=this._get_or_create_queue(xn),s=this._get_or_create_queue(Tn),c=this._get_or_create_queue(Sn,[]);n===mn?(on.extend(r,i),this._pop_from_people_queue(xn,i),this._pop_from_people_queue(Tn,i)):n===gn?on.each(i,function(e,t){t in o||(o[t]=e)}):n===_n?on.each(i,function(e,t){t in r?r[t]+=e:(t in a||(a[t]=0),a[t]+=e)},this):n===bn?on.each(i,function(e,t){on.isArray(e)&&(t in s||(s[t]=[]),s[t]=s[t].concat(e))}):n===yn&&c.push(i),an.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),an.log(t),this.save()},Nn.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);on.isUndefined(n)||(on.each(t,function(e,t){delete n[t]},this),this.save())},Nn.prototype._get_queue_key=function(e){return e===wn?mn:e===kn?gn:e===xn?_n:e===Sn?yn:e===Tn?bn:void an.error("Invalid queue:",e)},Nn.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]},Nn.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=on.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Nn.prototype.set_event_timer=function(e,t){var n=this.props[Cn]||{};n[e]=t,this.props[Cn]=n,this.save()},Nn.prototype.remove_event_timer=function(e){var t=this.props[Cn]||{},n=t[e];return on.isUndefined(n)||(delete this.props[Cn][e],this.save()),n};var jn,Hn=function(){},Vn=function(){},Un=function(e,t,n){var i,r=n===vn?fn:fn[n];if(r&&dn===hn)i=r;else{if(r&&!on.isArray(r))return void an.error("You have already initialized "+n);i=new Hn}if(i._init(e,t,n),i.people=new Vn,i.people._init(i),Vt.false=Vt.false||i.get_config("debug"),i.__autotrack_enabled=i.get_config("autotrack"),i.get_config("autotrack")){var o=100,a=100;ln.enabledForProject(i.get_config("token"),o,a)?ln.isBrowserSupported()?ln.init(i):(i.__autotrack_enabled=!1,an.log("Disabling Automatic Event Collection because this browser is not supported")):(i.__autotrack_enabled=!1,an.log("Not in active bucket: disabling Automatic Event Collection."));try{Xn(i)}catch(e){an.error(e)}}return!on.isUndefined(r)&&on.isArray(r)&&(i._execute_array.call(i.people,r.people),i._execute_array(r)),i};Hn.prototype.init=function(e,t,n){if(on.isUndefined(n))return void an.error("You must name your new library: init(token, config, name)");if(n===vn)return void an.error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");var i=Un(e,t,n);return fn[n]=i,i._loaded(),i},Hn.prototype._init=function(e,t,n){this.__loaded=!0,this.config={},this.set_config(on.extend({},Fn,t,{name:n,token:e,callback_fn:(n===vn?n:"mixpanel."+n)+"._jsc"})),this._jsc=function(){},this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.persistence=this.cookie=new Nn(this.config),this.register_once({distinct_id:on.UUID()},"")},Hn.prototype._loaded=function(){this.get_config("loaded")(this),this.get_config("track_pageview")&&this.track_pageview()},Hn.prototype._dom_loaded=function(){on.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),on.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},Hn.prototype._track_dom=function(e,t){if(this.get_config("img"))return an.error("You can't use DOM tracking functions with img = true."),!1;if(!qn)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},Hn.prototype._prepare_callback=function(e,t){if(on.isUndefined(e))return null;if(In){var n=function(n){e(n,t)};return n}var i=this._jsc,r=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+r+"]";return i[r]=function(n){delete i[r],e(n,t)},o},Hn.prototype._send_request=function(e,t,n){if(Mn)return void this.__request_queue.push(arguments);var i=this.get_config("verbose");if(t.verbose&&(i=!0),this.get_config("test")&&(t.test=1),i&&(t.verbose=1),this.get_config("img")&&(t.img=1),In||(n?t.callback=n:(i||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),e+="?"+on.HTTPBuildQuery(t),"img"in t){var r=document.createElement("img");r.src=e,document.body.appendChild(r)}else if(In)try{var o=new XMLHttpRequest;o.open("GET",e,!0),o.withCredentials=!0,o.onreadystatechange=function(){if(4===o.readyState)if(e.indexOf("api.mixpanel.com/track")!==-1&&ln.checkForBackoff(o),200===o.status)n&&n(i?on.JSONDecode(o.responseText):Number(o.responseText));else{var t="Bad HTTP status: "+o.status+" "+o.statusText;an.error(t),n&&n(i?{status:0,error:t}:0)}},o.send(null)}catch(e){an.error(e)}else{var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.defer=!0,a.src=e;var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(a,s)}},Hn.prototype._execute_array=function(e){var t,n=[],i=[],r=[];on.each(e,function(e){e&&(t=e[0],"function"==typeof e?e.call(this):on.isArray(e)&&"alias"===t?n.push(e):on.isArray(e)&&t.indexOf("track")!==-1&&"function"==typeof this[t]?r.push(e):i.push(e))},this);var o=function(e,t){on.each(e,function(e){this[e[0]].apply(this,e.slice(1))},t)};o(n,this),o(i,this),o(r,this)},Hn.prototype.push=function(e){this._execute_array([e])},Hn.prototype.disable=function(e){"undefined"==typeof e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},Hn.prototype.track=function(e,t,n){if("function"!=typeof n&&(n=function(){}),on.isUndefined(e))return void an.error("No event name provided to mixpanel.track");if(this._event_is_disabled(e))return void n(0);t=t||{},t.token=this.get_config("token");var i=this.persistence.remove_event_timer(e);if(!on.isUndefined(i)){var r=(new Date).getTime()-i;t.$duration=parseFloat((r/1e3).toFixed(3))}this.persistence.update_search_keyword(document.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(document.referrer),t=on.extend({},on.info.properties(),this.persistence.properties(),t);try{this.get_config("autotrack")&&"mp_page_view"!==e&&"$create_alias"!==e&&(t=on.extend({},t,this.mp_counts),this.mp_counts={$__c:0},on.cookie.set("mp_"+this.get_config("name")+"__c",0,1,!0))}catch(e){an.error(e)}var o=this.get_config("property_blacklist");on.isArray(o)?on.each(o,function(e){delete t[e]}):an.error("Invalid value for property_blacklist config: "+o);var a={event:e,properties:t},s=on.truncate(a,255),c=on.JSONEncode(s),u=on.base64Encode(c);return an.log("MIXPANEL REQUEST:"),an.log(s),this._send_request(this.get_config("api_host")+"/track/",{data:u},this._prepare_callback(n,s)),s},Hn.prototype.track_pageview=function(e){on.isUndefined(e)&&(e=document.location.href),this.track("mp_page_view",on.info.pageviewInfo(e))},Hn.prototype.track_links=function(){return this._track_dom.call(this,Bn,arguments)},Hn.prototype.track_forms=function(){return this._track_dom.call(this,Dn,arguments)},Hn.prototype.time_event=function(e){return on.isUndefined(e)?void an.error("No event name provided to mixpanel.time_event"):void(this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime()))},Hn.prototype.register=function(e,t){this.persistence.register(e,t)},Hn.prototype.register_once=function(e,t,n){this.persistence.register_once(e,t,n)},Hn.prototype.unregister=function(e){this.persistence.unregister(e)},Hn.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},Hn.prototype.identify=function(e,t,n,i,r,o){e!==this.get_distinct_id()&&e!==this.get_property(Pn)&&(this.unregister(Pn),this._register_single("distinct_id",e)),this._check_and_handle_notifications(this.get_distinct_id()),this._flags.identify_called=!0,this.people._flush(t,n,i,r,o)},Hn.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1,this.register_once({distinct_id:on.UUID()},"")},Hn.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},Hn.prototype.alias=function(e,t){if(e===this.get_property(En))return an.critical("Attempting to create alias for existing People user - aborting."),-2;var n=this;return on.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Pn,e),this.track("$create_alias",{alias:e,distinct_id:t},function(){n.identify(e)})):(an.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},Hn.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},Hn.prototype.set_config=function(e){on.isObject(e)&&(on.extend(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Vt.false=Vt.false||this.get_config("debug"))},Hn.prototype.get_config=function(e){return this.config[e]},Hn.prototype.get_property=function(e){return this.persistence.props[e]},Hn.prototype.toString=function(){var e=this.get_config("name");return e!==vn&&(e="mixpanel."+e),e},Hn.prototype._event_is_disabled=function(e){return on.isBlockedUA(Jt)||this._flags.disable_all_events||on.include(this.__disabled_events,e)},Hn.prototype._check_and_handle_notifications=function(e){if(e&&!this._flags.identify_called&&!this.get_config("disable_notifications")){an.log("MIXPANEL NOTIFICATION CHECK");var t={verbose:!0,version:"1",lib:"web",token:this.get_config("token"),distinct_id:e},n=this;this._send_request(this.get_config("decide_host")+"/decide/",t,this._prepare_callback(function(e){e.notifications&&e.notifications.length>0&&n._show_notification.call(n,e.notifications[0])}))}},Hn.prototype._show_notification=function(e){var t=new jn(e,this);t.show()},Vn.prototype._init=function(e){this._mixpanel=e},Vn.prototype.set=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this),n=t):r[e]=t,this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r=on.extend({},on.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r),i[wn]=r,this._send_request(i,n)},Vn.prototype.set_once=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this),n=t):r[e]=t,i[kn]=r,this._send_request(i,n)},Vn.prototype.increment=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void an.error("Invalid increment value passed to mixpanel.people.increment - must be a number");r[t]=e}},this),n=t):(on.isUndefined(t)&&(t=1),r[e]=t),i[xn]=r,this._send_request(i,n)},Vn.prototype.append=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this),n=t):r[e]=t,i[Sn]=r,this._send_request(i,n)},Vn.prototype.union=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=on.isArray(e)?e:[e])},this),n=t):r[e]=on.isArray(t)?t:[t],i[Tn]=r,this._send_request(i,n)},Vn.prototype.track_charge=function(e,t,n){return!on.isNumber(e)&&(e=parseFloat(e),isNaN(e))?void an.error("Invalid value passed to mixpanel.people.track_charge - must be a number"):this.append("$transactions",on.extend({$amount:e},t),n)},Vn.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},Vn.prototype.delete_user=function(){if(!this._identify_called())return void an.error("mixpanel.people.delete_user() requires you to call identify() first");var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)},Vn.prototype.toString=function(){return this._mixpanel.toString()+".people"},Vn.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=on.encodeDates(e),i=on.truncate(n,255),r=on.JSONEncode(n),o=on.base64Encode(r);return this._identify_called()?(an.log("MIXPANEL PEOPLE REQUEST:"),an.log(i),this._mixpanel._send_request(this._get_config("api_host")+"/engage/",{data:o},this._mixpanel._prepare_callback(t,i)),i):(this._enqueue(e),on.isUndefined(t)||t(this._get_config("verbose")?{status:-1,error:null}:-1),i)},Vn.prototype._get_config=function(e){return this._mixpanel.get_config(e)},Vn.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},Vn.prototype._enqueue=function(e){wn in e?this._mixpanel.persistence._add_to_people_queue(wn,e):kn in e?this._mixpanel.persistence._add_to_people_queue(kn,e):xn in e?this._mixpanel.persistence._add_to_people_queue(xn,e):Sn in e?this._mixpanel.persistence._add_to_people_queue(Sn,e):Tn in e?this._mixpanel.persistence._add_to_people_queue(Tn,e):an.error("Invalid call to _enqueue():",e)},Vn.prototype._flush=function(e,t,n,i,r){var o=this,a=on.extend({},this._mixpanel.persistence._get_queue(wn)),s=on.extend({},this._mixpanel.persistence._get_queue(kn)),c=on.extend({},this._mixpanel.persistence._get_queue(xn)),u=this._mixpanel.persistence._get_queue(Sn),l=on.extend({},this._mixpanel.persistence._get_queue(Tn));if(on.isUndefined(a)||!on.isObject(a)||on.isEmptyObject(a)||(o._mixpanel.persistence._pop_from_people_queue(wn,a),this.set(a,function(t,n){0===t&&o._mixpanel.persistence._add_to_people_queue(wn,a),on.isUndefined(e)||e(t,n)})),on.isUndefined(s)||!on.isObject(s)||on.isEmptyObject(s)||(o._mixpanel.persistence._pop_from_people_queue(kn,s),this.set_once(s,function(e,t){0===e&&o._mixpanel.persistence._add_to_people_queue(kn,s),on.isUndefined(i)||i(e,t)})),on.isUndefined(c)||!on.isObject(c)||on.isEmptyObject(c)||(o._mixpanel.persistence._pop_from_people_queue(xn,c),this.increment(c,function(e,n){0===e&&o._mixpanel.persistence._add_to_people_queue(xn,c),on.isUndefined(t)||t(e,n)})),on.isUndefined(l)||!on.isObject(l)||on.isEmptyObject(l)||(o._mixpanel.persistence._pop_from_people_queue(Tn,l),this.union(l,function(e,t){0===e&&o._mixpanel.persistence._add_to_people_queue(Tn,l),on.isUndefined(r)||r(e,t)})),!on.isUndefined(u)&&on.isArray(u)&&u.length){for(var d,f=function(e,t){0===e&&o._mixpanel.persistence._add_to_people_queue(Sn,d),on.isUndefined(n)||n(e,t)},h=u.length-1;h>=0;h--)d=u.pop(),o.append(d,f);o._mixpanel.persistence.save()}},Vn.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e},Hn._Notification=function(e,t){on.bind_instance_methods(this),this.mixpanel=t,this.persistence=this.mixpanel.persistence,this.campaign_id=on.escapeHTML(e.id),this.message_id=on.escapeHTML(e.message_id),this.body=(on.escapeHTML(e.body)||"").replace(/\n/g,"
"),this.cta=on.escapeHTML(e.cta)||"Close",this.dest_url=on.escapeHTML(e.cta_url)||null,this.image_url=on.escapeHTML(e.image_url)||null,this.notif_type=on.escapeHTML(e.type)||"takeover",this.style=on.escapeHTML(e.style)||"light",this.thumb_image_url=on.escapeHTML(e.thumb_image_url)||null,this.title=on.escapeHTML(e.title)||"",this.video_url=on.escapeHTML(e.video_url)||null,this.video_width=jn.VIDEO_WIDTH,this.video_height=jn.VIDEO_HEIGHT,this.clickthrough=!0,this.dest_url||(this.dest_url="#dismiss",this.clickthrough=!1),this.mini="mini"===this.notif_type,this.mini||(this.notif_type="takeover"),this.notif_width=this.mini?jn.NOTIF_WIDTH_MINI:jn.NOTIF_WIDTH,this._set_client_config(),this.imgs_to_preload=this._init_image_html(),this._init_video()},jn=Hn._Notification,jn.ANIM_TIME=200,jn.MARKUP_PREFIX="mixpanel-notification",jn.BG_OPACITY=.6,jn.NOTIF_TOP=25,jn.NOTIF_START_TOP=200,jn.NOTIF_WIDTH=388,jn.NOTIF_WIDTH_MINI=420,jn.NOTIF_HEIGHT_MINI=85,jn.THUMB_BORDER_SIZE=5,jn.THUMB_IMG_SIZE=60,jn.THUMB_OFFSET=Math.round(jn.THUMB_IMG_SIZE/2),jn.VIDEO_WIDTH=595,jn.VIDEO_HEIGHT=334,jn.prototype.show=function(){var e=this;return this._set_client_config(),this.body_el?(this._init_styles(),this._init_notification_el(),void this._preload_images(this._attach_and_animate)):void setTimeout(function(){e.show()},300)},jn.prototype.dismiss=on.safewrap(function(){this.marked_as_shown||this._mark_delivery({invisible:!0});var e=this.showing_video?this._get_el("video"):this._get_notification_display_el();if(this.use_transitions)this._remove_class("bg","visible"),this._add_class(e,"exiting"),setTimeout(this._remove_notification_el,jn.ANIM_TIME);else{var t,n,i;this.mini?(t="right",n=20,i=-100):(t="top",n=jn.NOTIF_TOP,i=jn.NOTIF_START_TOP+jn.NOTIF_TOP),this._animate_els([{el:this._get_el("bg"),attr:"opacity",start:jn.BG_OPACITY,goal:0},{el:e,attr:"opacity",start:1,goal:0},{el:e,attr:t,start:n,goal:i}],jn.ANIM_TIME,this._remove_notification_el)}}),jn.prototype._add_class=on.safewrap(function(e,t){t=jn.MARKUP_PREFIX+"-"+t,"string"==typeof e&&(e=this._get_el(e)),e.className?~(" "+e.className+" ").indexOf(" "+t+" ")||(e.className+=" "+t):e.className=t}),jn.prototype._remove_class=on.safewrap(function(e,t){t=jn.MARKUP_PREFIX+"-"+t,"string"==typeof e&&(e=this._get_el(e)),e.className&&(e.className=(" "+e.className+" ").replace(" "+t+" ","").replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,""))}),jn.prototype._animate_els=on.safewrap(function(e,t,n,i){var r,o,a,s=this,c=!1,u=1*new Date;for(i=i||u,a=u-i,r=0;r=o.start?1:-1;o.val=o.start+l*a/t,"opacity"!==o.attr&&(o.val=Math.round(o.val)),(d>0&&o.val>=o.goal||d<0&&o.val<=o.goal)&&(o.val=o.goal)}if(!c)return void(n&&n());for(r=0;r'):this.img_html="",this.thumb_image_url?(e.push(this.thumb_image_url),this.thumb_img_html='
'):this.thumb_img_html=""),e},jn.prototype._init_notification_el=function(){var e="",t="",n="",i='
';if(this.notification_el=document.createElement("div"),this.notification_el.id=jn.MARKUP_PREFIX+"-wrapper",this.mini)e='
'+i+'
'+this.body+'
';else{var r=this.clickthrough||this.show_video?"":'
',o=this.show_video?'
':"";this._browser_lte("ie",7)&&(r="",o=""),e='
"}this.youtube_video?(t="//www.youtube.com/embed/"+this.youtube_video+"?wmode=transparent&showinfo=0&modestbranding=0&rel=0&autoplay=1&loop=0&vq=hd1080",this.yt_custom&&(t+="&enablejsapi=1&html5=1&controls=0",n='
')):this.vimeo_video&&(t="//player.vimeo.com/video/"+this.vimeo_video+"?autoplay=1&title=0&byline=0&portrait=0"),this.show_video&&(this.video_iframe='',n='
'+n+"
");var a=n+e;this.flip_animate&&(a=(this.mini?e:"")+'
'+(this.mini?n:a)+"
"),this.notification_el.innerHTML=('
'+a+"
").replace(/class=\"/g,'class="'+jn.MARKUP_PREFIX+"-").replace(/id=\"/g,'id="'+jn.MARKUP_PREFIX+"-")},jn.prototype._init_styles=function(){"dark"===this.style?this.style_vals={bg:"#1d1f25",bg_actions:"#282b32",bg_hover:"#3a4147",bg_light:"#4a5157",border_gray:"#32353c",cancel_opacity:"0.4",mini_hover:"#2a3137",text_title:"#fff",text_main:"#9498a3",text_tagline:"#464851",text_hover:"#ddd"}:this.style_vals={bg:"#fff",bg_actions:"#e7eaee",bg_hover:"#eceff3",bg_light:"#f5f5f5",border_gray:"#e4ecf2",cancel_opacity:"1.0",mini_hover:"#fafafa",text_title:"#5c6578",text_main:"#8b949b",text_tagline:"#ced9e6",text_hover:"#7c8598"};var e="0px 0px 35px 0px rgba(45, 49, 56, 0.7)",t=e,n=e,i=jn.THUMB_IMG_SIZE+2*jn.THUMB_BORDER_SIZE,r=jn.ANIM_TIME/1e3+"s";this.mini&&(e="none");var o={},a=jn.NOTIF_WIDTH_MINI+20;o["@media only screen and (max-width: "+(a-1)+"px)"]={"#overlay":{display:"none"}};var s={".flipped":{transform:"rotateY(180deg)"},"#overlay":{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",overflow:"auto","text-align":"center","z-index":"10000","font-family":'"Helvetica", "Arial", sans-serif',"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"},"#overlay.mini":{height:"0",overflow:"visible"},"#overlay a":{width:"initial",padding:"0","text-decoration":"none","text-transform":"none",color:"inherit"},"#bgwrapper":{position:"relative",width:"100%",height:"100%"},"#bg":{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","min-width":4*this.doc_width+"px","min-height":4*this.doc_height+"px","background-color":"black",opacity:"0.0","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)",filter:"alpha(opacity=60)",transition:"opacity "+r},"#bg.visible":{opacity:jn.BG_OPACITY},".mini #bg":{width:"0",height:"0","min-width":"0"},"#flipcontainer":{perspective:"1000px",position:"absolute",width:"100%"},"#flipper":{position:"relative","transform-style":"preserve-3d",transition:"0.3s"},"#takeover":{position:"absolute",left:"50%",width:jn.NOTIF_WIDTH+"px","margin-left":Math.round(-jn.NOTIF_WIDTH/2)+"px","backface-visibility":"hidden",transform:"rotateY(0deg)",opacity:"0.0",top:jn.NOTIF_START_TOP+"px",transition:"opacity "+r+", top "+r},"#takeover.visible":{opacity:"1.0",top:jn.NOTIF_TOP+"px"},"#takeover.exiting":{opacity:"0.0",top:jn.NOTIF_START_TOP+"px"},"#thumbspacer":{height:jn.THUMB_OFFSET+"px"},"#thumbborder-wrapper":{position:"absolute",top:-jn.THUMB_BORDER_SIZE+"px",left:jn.NOTIF_WIDTH/2-jn.THUMB_OFFSET-jn.THUMB_BORDER_SIZE+"px",width:i+"px",height:i/2+"px",overflow:"hidden"},"#thumbborder":{position:"absolute",width:i+"px",height:i+"px","border-radius":i+"px","background-color":this.style_vals.bg_actions,opacity:"0.5"},"#thumbnail":{position:"absolute",top:"0px",left:jn.NOTIF_WIDTH/2-jn.THUMB_OFFSET+"px", width:jn.THUMB_IMG_SIZE+"px",height:jn.THUMB_IMG_SIZE+"px",overflow:"hidden","z-index":"100","border-radius":jn.THUMB_IMG_SIZE+"px"},"#mini":{position:"absolute",right:"20px",top:jn.NOTIF_TOP+"px",width:this.notif_width+"px",height:2*jn.NOTIF_HEIGHT_MINI+"px","margin-top":20-jn.NOTIF_HEIGHT_MINI+"px","backface-visibility":"hidden",opacity:"0.0",transform:"rotateX(90deg)",transition:"opacity 0.3s, transform 0.3s, right 0.3s"},"#mini.visible":{opacity:"1.0",transform:"rotateX(0deg)"},"#mini.exiting":{opacity:"0.0",right:"-150px"},"#mainbox":{"border-radius":"4px","box-shadow":e,"text-align":"center","background-color":this.style_vals.bg,"font-size":"14px",color:this.style_vals.text_main},"#mini #mainbox":{height:jn.NOTIF_HEIGHT_MINI+"px","margin-top":jn.NOTIF_HEIGHT_MINI+"px","border-radius":"3px",transition:"background-color "+r},"#mini-border":{height:jn.NOTIF_HEIGHT_MINI+6+"px",width:jn.NOTIF_WIDTH_MINI+6+"px",position:"absolute",top:"-3px",left:"-3px","margin-top":jn.NOTIF_HEIGHT_MINI+"px","border-radius":"6px",opacity:"0.25","background-color":"#fff","z-index":"-1","box-shadow":n},"#mini-icon":{position:"relative",display:"inline-block",width:"75px",height:jn.NOTIF_HEIGHT_MINI+"px","border-radius":"3px 0 0 3px","background-color":this.style_vals.bg_actions,background:"linear-gradient(135deg, "+this.style_vals.bg_light+" 0%, "+this.style_vals.bg_actions+" 100%)",transition:"background-color "+r},"#mini:hover #mini-icon":{"background-color":this.style_vals.mini_hover},"#mini:hover #mainbox":{"background-color":this.style_vals.mini_hover},"#mini-icon-img":{position:"absolute","background-image":"url("+this.thumb_image_url+")",width:"48px",height:"48px",top:"20px",left:"12px"},"#content":{padding:"30px 20px 0px 20px"},"#mini-content":{"text-align":"left",height:jn.NOTIF_HEIGHT_MINI+"px",cursor:"pointer"},"#img":{width:"328px","margin-top":"30px","border-radius":"5px"},"#title":{"max-height":"600px",overflow:"hidden","word-wrap":"break-word",padding:"25px 0px 20px 0px","font-size":"19px","font-weight":"bold",color:this.style_vals.text_title},"#body":{"max-height":"600px","margin-bottom":"25px",overflow:"hidden","word-wrap":"break-word","line-height":"21px","font-size":"15px","font-weight":"normal","text-align":"left"},"#mini #body":{display:"inline-block","max-width":"250px",margin:"0 0 0 30px",height:jn.NOTIF_HEIGHT_MINI+"px","font-size":"16px","letter-spacing":"0.8px",color:this.style_vals.text_title},"#mini #body-text":{display:"table",height:jn.NOTIF_HEIGHT_MINI+"px"},"#mini #body-text div":{display:"table-cell","vertical-align":"middle"},"#tagline":{"margin-bottom":"15px","font-size":"10px","font-weight":"600","letter-spacing":"0.8px",color:"#ccd7e0","text-align":"left"},"#tagline a":{color:this.style_vals.text_tagline,transition:"color "+r},"#tagline a:hover":{color:this.style_vals.text_hover},"#cancel":{position:"absolute",right:"0",width:"8px",height:"8px",padding:"10px","border-radius":"20px",margin:"12px 12px 0 0","box-sizing":"content-box",cursor:"pointer",transition:"background-color "+r},"#mini #cancel":{margin:"7px 7px 0 0"},"#cancel-icon":{width:"8px",height:"8px",overflow:"hidden","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/cancel-x.png)",opacity:this.style_vals.cancel_opacity},"#cancel:hover":{"background-color":this.style_vals.bg_hover},"#button":{display:"block",height:"60px","line-height":"60px","text-align":"center","background-color":this.style_vals.bg_actions,"border-radius":"0 0 4px 4px",overflow:"hidden",cursor:"pointer",transition:"background-color "+r},"#button-close":{display:"inline-block",width:"9px",height:"60px","margin-right":"8px","vertical-align":"top","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/close-x-"+this.style+".png)","background-repeat":"no-repeat","background-position":"0px 25px"},"#button-play":{display:"inline-block",width:"30px",height:"60px","margin-left":"15px","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/play-"+this.style+"-small.png)","background-repeat":"no-repeat","background-position":"0px 15px"},"a#button-link":{display:"inline-block","vertical-align":"top","text-align":"center","font-size":"17px","font-weight":"bold",overflow:"hidden","word-wrap":"break-word",color:this.style_vals.text_title,transition:"color "+r},"#button:hover":{"background-color":this.style_vals.bg_hover,color:this.style_vals.text_hover},"#button:hover a":{color:this.style_vals.text_hover},"#video-noflip":{position:"relative",top:2*-this.video_height+"px"},"#video-flip":{"backface-visibility":"hidden",transform:"rotateY(180deg)"},"#video":{position:"absolute",width:this.video_width-1+"px",height:this.video_height+"px",top:jn.NOTIF_TOP+"px","margin-top":"100px",left:"50%","margin-left":Math.round(-this.video_width/2)+"px",overflow:"hidden","border-radius":"5px","box-shadow":t,transform:"translateZ(1px)",transition:"opacity "+r+", top "+r},"#video.exiting":{opacity:"0.0",top:this.video_height+"px"},"#video-holder":{position:"absolute",width:this.video_width-1+"px",height:this.video_height+"px",overflow:"hidden","border-radius":"5px"},"#video-frame":{"margin-left":"-1px",width:this.video_width+"px"},"#video-controls":{opacity:"0",transition:"opacity 0.5s"},"#video:hover #video-controls":{opacity:"1.0"},"#video .video-progress-el":{position:"absolute",bottom:"0",height:"25px","border-radius":"0 0 0 5px"},"#video-progress":{width:"90%"},"#video-progress-total":{width:"100%","background-color":this.style_vals.bg,opacity:"0.7"},"#video-elapsed":{width:"0","background-color":"#6cb6f5",opacity:"0.9"},"#video #video-time":{width:"10%",right:"0","font-size":"11px","line-height":"25px",color:this.style_vals.text_main,"background-color":"#666","border-radius":"0 0 5px 0"}};this._browser_lte("ie",8)&&on.extend(s,{"* html #overlay":{position:"absolute"},"* html #bg":{position:"absolute"},"html, body":{height:"100%"}}),this._browser_lte("ie",7)&&on.extend(s,{"#mini #body":{display:"inline",zoom:"1",border:"1px solid "+this.style_vals.bg_hover},"#mini #body-text":{padding:"20px"},"#mini #mini-icon":{display:"none"}});var c=["backface-visibility","border-radius","box-shadow","opacity","perspective","transform","transform-style","transition"],u=["khtml","moz","ms","o","webkit"];for(var l in s)for(var d=0;d=33||this.browser_versions.firefox>=15)&&this.body_el&&i("backfaceVisibility")&&i("perspective")&&i("transform")},jn.prototype._switch_to_video=on.safewrap(function(){var e=this,t=[{el:e._get_notification_display_el(),attr:"opacity",start:1,goal:0},{el:e._get_notification_display_el(),attr:"top",start:jn.NOTIF_TOP,goal:-500},{el:e._get_el("video-noflip"),attr:"opacity",start:0,goal:1},{el:e._get_el("video-noflip"),attr:"top",start:2*-e.video_height,goal:0}];if(e.mini){var n=e._get_el("bg"),i=e._get_el("overlay");n.style.width="100%",n.style.height="100%",i.style.width="100%",e._add_class(e._get_notification_display_el(),"exiting"),e._add_class(n,"visible"),t.push({el:e._get_el("bg"),attr:"opacity",start:0,goal:jn.BG_OPACITY})}var r=e._get_el("video-holder");r.innerHTML=e.video_iframe;var o=function(){window.YT&&window.YT.loaded&&e._yt_video_ready(),e.showing_video=!0,e._get_notification_display_el().style.visibility="hidden"};e.flip_animate?(e._add_class("flipper","flipped"),setTimeout(o,jn.ANIM_TIME)):e._animate_els(t,jn.ANIM_TIME,o)}),jn.prototype._track_event=function(e,t,n){this.campaign_id?(t=t||{},t=on.extend(t,{campaign_id:this.campaign_id,message_id:this.message_id,message_type:"web_inapp",message_subtype:this.notif_type}),this.mixpanel.track(e,t,n)):n&&n.call()},jn.prototype._yt_video_ready=on.safewrap(function(){var e=this;if(!e.video_inited){e.video_inited=!0;var t=e._get_el("video-elapsed"),n=e._get_el("video-time"),i=e._get_el("video-progress");new window.YT.Player(jn.MARKUP_PREFIX+"-video-frame",{events:{onReady:function(r){var o=r.target,a=o.getDuration(),s=function(e){return("00"+e).slice(-2)},c=function(e){var t=Math.round(a-e),i=Math.floor(t/60),r=Math.floor(i/60);t-=60*i,i-=60*r,n.innerHTML="-"+(r?r+":":"")+s(i)+":"+s(t)};c(0),e._video_progress_checker=window.setInterval(function(){var e=o.getCurrentTime();t.style.width=e/a*100+"%",c(e)},250),on.register_event(i,"click",function(e){var t=Math.max(0,e.pageX-i.getBoundingClientRect().left);o.seekTo(a*t/i.clientWidth,!0)})}}})}}),Hn.prototype.init=Hn.prototype.init,Hn.prototype.reset=Hn.prototype.reset,Hn.prototype.disable=Hn.prototype.disable,Hn.prototype.time_event=Hn.prototype.time_event,Hn.prototype.track=Hn.prototype.track,Hn.prototype.track_links=Hn.prototype.track_links,Hn.prototype.track_forms=Hn.prototype.track_forms,Hn.prototype.track_pageview=Hn.prototype.track_pageview,Hn.prototype.register=Hn.prototype.register,Hn.prototype.register_once=Hn.prototype.register_once,Hn.prototype.unregister=Hn.prototype.unregister,Hn.prototype.identify=Hn.prototype.identify,Hn.prototype.alias=Hn.prototype.alias,Hn.prototype.name_tag=Hn.prototype.name_tag,Hn.prototype.set_config=Hn.prototype.set_config,Hn.prototype.get_config=Hn.prototype.get_config,Hn.prototype.get_property=Hn.prototype.get_property,Hn.prototype.get_distinct_id=Hn.prototype.get_distinct_id,Hn.prototype.toString=Hn.prototype.toString,Hn.prototype._check_and_handle_notifications=Hn.prototype._check_and_handle_notifications,Hn.prototype._show_notification=Hn.prototype._show_notification,Nn.prototype.properties=Nn.prototype.properties,Nn.prototype.update_search_keyword=Nn.prototype.update_search_keyword,Nn.prototype.update_referrer_info=Nn.prototype.update_referrer_info,Nn.prototype.get_cross_subdomain=Nn.prototype.get_cross_subdomain,Nn.prototype.clear=Nn.prototype.clear,Vn.prototype.set=Vn.prototype.set,Vn.prototype.set_once=Vn.prototype.set_once,Vn.prototype.increment=Vn.prototype.increment,Vn.prototype.append=Vn.prototype.append,Vn.prototype.union=Vn.prototype.union,Vn.prototype.track_charge=Vn.prototype.track_charge,Vn.prototype.clear_charges=Vn.prototype.clear_charges,Vn.prototype.delete_user=Vn.prototype.delete_user,Vn.prototype.toString=Vn.prototype.toString,on.safewrap_class(Hn,["identify","_check_and_handle_notifications","_show_notification"]);var zn={},Wn=function(){on.each(zn,function(e,t){t!==vn&&(fn[t]=e)}),fn._=on},$n=function(){fn.init=function(e,t,n){if(n)return fn[n]||(fn[n]=zn[n]=Un(e,t,n),fn[n]._loaded()),fn[n];var i=fn;zn[vn]?i=zn[vn]:e&&(i=Un(e,t,vn),i._loaded(),zn[vn]=i),fn=i,dn===pn&&(window[vn]=fn),Wn()}},Gn=function(){function e(){e.done||(e.done=!0,qn=!0,Mn=!1,on.each(zn,function(e){e._dom_loaded()}))}function t(){try{document.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}e()}if(document.addEventListener)"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",e);var n=!1;try{n=null===window.frameElement}catch(e){}document.documentElement.doScroll&&n&&t()}on.register_event(window,"load",e,!0)},Xn=function(e){var t=e.get_config("name");e.mp_counts=e.mp_counts||{},e.mp_counts.$__c=parseInt(on.cookie.get("mp_"+t+"__c"))||0;var n=function(){e.mp_counts.$__c=(e.mp_counts.$__c||0)+1,on.cookie.set("mp_"+t+"__c",e.mp_counts.$__c,1,!0)},i=function(){try{e.mp_counts=e.mp_counts||{},n()}catch(e){an.error(e)}};on.register_event(document,"submit",i),on.register_event(document,"change",i);var r=null;on.register_event(document,"mousedown",function(e){r=e.target}),on.register_event(document,"mouseup",function(e){e.target===r&&i(e)})},Kn=O(),Yn={VIDEO_BUFFER_END:"video-buffer-end",VIDEO_BUFFER_START:"video-buffer-start",VIDEO_CHANGE_QUALITY:"video-change-quality",VIDEO_CONFIG_CHANGE:"video-config-change",VIDEO_ENDED:"video-ended",VIDEO_ERROR:"video-error",VIDEO_LEAVE:"video-leave",VIDEO_MINUTE_WATCHED:"video-minute-watched",VIDEO_PAUSE:"video-pause",VIDEO_PLAY:"video-play",VIDEO_PLAYING:"video-playing",VIDEO_READY:"video-ready",VIDEO_SEEK:"video-seek",VIDEO_SEEKED:"video-seeked",VIDEO_STALLED:"video-stalled",VIDEO_STREAM_CHANGE:"video-stream-change",VIDEO_STREAM_SELECT:"video-stream-select"},Qn=function(){function e(t){Ke(this,e),this.player=t,this.minuteWatchedTimerActive=!1,this.videoStarted=!1,this.videoSeeking=!1,this.videoPaused=!1,this.initialMinuteWatched=!0,this.currentMinuteWatchedTime=0,this.seekStartVideoTime=0,this.totalMinutesWatched=0,this.streamInfo=null,this.initMinuteWatchedTimer(),this.initMixPanel(),this.initEventListeners()}return Ye(e,[{key:"initMixPanel",value:function(){Kn.init(this.player.config.request.mixpanel_token),this.trackEvent(Yn.VIDEO_READY,this.eventGlobalProperties()),Kn.time_event(Yn.VIDEO_LEAVE),Kn.time_event(Yn.VIDEO_STREAM_SELECT)}},{key:"initEventListeners",value:function(){var e=this;this.player.events.on(Ge.playButtonPressed,function(){Kn.time_event(Yn.VIDEO_PLAYING);var t=e.eventGlobalProperties();e.videoStarted||(t.StartRequest=!0),e.trackEvent(Yn.VIDEO_PLAY,t)}),this.player.telecine.on("playing",function(){if(!e.minuteWatchedTimerActive){var t=e.eventGlobalProperties();e.videoStarted||(t.StartRequest=!0),e.minuteWatchedTimerActive=!0,e.videoStarted=!0,e.videoPaused=!1,e.trackEvent(Yn.VIDEO_PLAYING,t)}}),this.player.events.on(Ge.pauseButtonPressed,function(){e.minuteWatchedTimerActive=!1,e.videoPaused||(e.videoPaused=!0,e.trackEvent(Yn.VIDEO_PAUSE,e.eventGlobalProperties()))}),this.player.telecine.on("ended",function(){e.minuteWatchedTimerActive=!1,e.videoStarted=!1,e.trackEvent(Yn.VIDEO_ENDED,e.eventGlobalProperties())}),this.player.events.on(Ge.scrubbingStarted,function(){e.videoSeeking=!0,e.seekStartVideoTime=e.player.telecine.currentTime,Kn.time_event(Yn.VIDEO_SEEKED),e.trackEvent(Yn.VIDEO_SEEK,e.eventGlobalProperties())}),this.player.telecine.on("seeked",function(){if(e.videoSeeking){e.videoSeeking=!1;var t=e.eventGlobalProperties();t.SeekStartTime=e.seekStartVideoTime,t.SeekEndTime=e.player.telecine.currentTime,e.trackEvent(Yn.VIDEO_SEEKED,t)}}),this.player.telecine.on("error",function(t){e.minuteWatchedTimerActive=!1;var n=e.eventGlobalProperties();n.ErrorMessage=t.message,e.trackEvent(Yn.VIDEO_ERROR,n)}),this.player.telecine.on([Ge.bufferStarted,"streambufferstart"],function(){e.videoStarted&&(Kn.time_event(Yn.VIDEO_BUFFER_END),e.trackEvent(Yn.VIDEO_BUFFER_START,e.eventGlobalProperties()))}),this.player.telecine.on([Ge.bufferEnded,"streambufferend"],function(){e.videoStarted&&e.trackEvent(Yn.VIDEO_BUFFER_END,e.eventGlobalProperties())}),this.player.events.on($e.changeQuality,function(t){var n=e.eventGlobalProperties();n.RequestQuality=t,e.trackEvent(Yn.VIDEO_CHANGE_QUALITY,n)}),this.player.telecine.on("streamchange",function(t){var n=t.index,i=(t.streams,e.streamInfo);e.streamInfo=e.player.config.request.files.dash.streams[n];var r=e.eventGlobalProperties();e.videoStarted?(r.PreviousProfile=i.profile,r.PreviousStreamId=i.id,r.PreviousQuality=i.quality,e.trackEvent(Yn.VIDEO_STREAM_CHANGE,r)):e.trackEvent(Yn.VIDEO_STREAM_SELECT,r)}),this.player.events.on(Ge.configChanged,function(){e.minuteWatchedTimerActive=!1,e.videoSeeking=!1,e.videoPaused=!1,e.videoStarted=!1,e.minuteWatchedTimerActive=!1,Kn.time_event(Yn.VIDEO_STREAM_SELECT),e.trackEvent(Yn.VIDEO_CONFIG_CHANGE,e.eventGlobalProperties())}),this.player.telecine.on("bandwidth",function(t){e.streamInfo.bitrate=t.bitrate}),this.player.telecine.on("stalled",function(){e.trackEvent(Yn.VIDEO_STALLED,e.eventGlobalProperties())}),A(function(){e.trackEvent(Yn.VIDEO_LEAVE,e.eventGlobalProperties())})}},{key:"trackEvent",value:function(e,t){Kn.track(e,t)}},{key:"eventGlobalProperties",value:function(){var e={Autoplay:this.player.config.embed.autoplay,Bitrate:this.streamInfo?this.streamInfo.bitrate:null,CDN:this.player.telecine.currentFile.metadata.cdn||"akamai",Context:this.player.config.embed.context,Delivery:Ue[this.player.telecine.currentFile.mime],Embed:!this.player.config.embed.on_site,FileQuality:this.player.telecine.currentFile.metadata.quality,Fullscreen:!!dt.element,FPS:this.streamInfo?this.streamInfo.fps:null,ID:this.player.config.video.id,Loop:!!this.player.config.embed.loop,Mime:this.player.telecine.currentFile.mime,MinutesWatched:this.totalMinutesWatched,Origin:this.player.telecine.currentFile.metadata.origin,OwnerAccountType:this.player.config.video.owner.account_type,OwnerID:this.player.config.video.owner?this.player.config.video.owner.id:0,PlayerBuild:this.player.config.request.build.player,PlayerHeight:this.player.element.querySelector(".video").getBoundingClientRect().height,PlayerURL:this.player.config.player_url,PlayerWidth:this.player.element.querySelector(".video").getBoundingClientRect().width,Privacy:this.player.config.video.privacy,Profile:this.streamInfo?this.streamInfo.profile:null,Rating:this.player.config.video.rating?this.player.config.video.rating.id:null,Referrer:this.player.config.request.referrer,SeparateAV:!!this.player.config.request.files.dash&&this.player.config.request.files.dash.separate_av,Session:this.player.config.request.session,StreamID:this.streamInfo?this.streamInfo.id:null,StreamQuality:this.streamInfo?this.streamInfo.quality:null,Type:We[this.player.telecine.currentScanner],UserAccountType:this.player.config.user.account_type,UserIsMod:this.player.config.user.mod,VODID:this.player.config.video.vod&&this.player.config.video.vod.id?this.player.config.video.vod.id:null,VODSaleID:this.player.config.video.vod&&this.player.config.video.vod.sale_id?this.player.config.video.vod.sale_id:null,VideoDuration:this.player.config.video.duration,VideoTime:this.player.telecine.currentTime,ViewMode:window.getComputedStyle(this.player.element,":after").getPropertyValue("content").replace(/["'\s]*/g,""),Volume:Math.round(100*this.player.telecine.volume),Source:this.player.telecine.currentFile.src};for(var t in this.player.config.request.ab_tests)e["Test_"+t]=this.player.config.request.ab_tests[t];return e}},{key:"logMinuteWatched",value:function(){this.trackEvent(Yn.VIDEO_MINUTE_WATCHED,this.eventGlobalProperties())}},{key:"initMinuteWatchedTimer",value:function(){var e=this,t=Math.floor(60*Math.random());setInterval(function(){if(e.minuteWatchedTimerActive)return e.currentMinuteWatchedTime++,e.initialMinuteWatched?void(e.currentMinuteWatchedTime===t&&(e.initialMinuteWatched=!1,e.currentMinuteWatchedTime=0,e.totalMinutesWatched++,e.logMinuteWatched())):void(e.currentMinuteWatchedTime>=60&&(e.currentMinuteWatchedTime=0,e.totalMinutesWatched++,e.logMinuteWatched()))},1e3)}}]),e}();q.prototype={get complement(){var e=this.clone();return e.rgb={red:255-this.red,green:255-this.green,blue:255-this.blue},e},get hex(){return q.rgbToHex(this.red,this.green,this.blue)},set hex(e){return this.rgba=q.hexToRgb(e),this},get hsl(){return"hsl("+this.hue+","+this.saturation+"%,"+Math.round(this.lightness)+"%)"},set hsl(e){this.hue=e.hue,this.saturation=e.saturation,this.lightness=e.lightness;var t=q.hslToRgb(e.hue,e.saturation,e.lightness);return this.red=t.red,this.green=t.green,this.blue=t.blue,this.alpha=t.alpha,this},get luminance(){function e(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}var t=e(this.red/255),n=e(this.green/255),i=e(this.blue/255),r=.2126*t+.7152*n+.0722*i;return r},get rgb(){return"rgb("+this.red+","+this.green+","+this.blue+")"},set rgb(e){return this.rgba=e,this},get rgba(){return"rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")"},set rgba(e){this.red=e.red,this.green=e.green,this.blue=e.blue,this.alpha=e.alpha||1;var t=q.rgbToHsl(e.red,e.green,e.blue);return this.hue=t.hue,this.saturation=t.saturation,this.lightness=t.lightness,this},get yiq(){return(299*this.red+587*this.green+114*this.blue)/1e3},clone:function(){return new q(this)},lighten:function(e,t,n){if(this.hsl={hue:this.hue,saturation:this.saturation,lightness:this.lightness+e},t&&n)for(var i=n.contrast(this).ratio;i=100)););return this},darken:function(e,t,n){if(this.hsl={hue:this.hue,saturation:this.saturation,lightness:this.lightness-e},t&&n)for(var i=n.contrast(this).ratio;i=1)return this;var t=this.clone();return t.rgba={red:t.red*this.alpha+e.red*e.alpha*(1-this.alpha),green:t.green*this.alpha+e.green*e.alpha*(1-this.alpha),blue:t.blue*this.alpha+e.blue*e.alpha*(1-this.alpha),alpha:t.alpha+e.alpha*(1-this.alpha)},t},contrast:function(e){var t=this.alpha;if(t>=1){e.alpha<1&&(e=e.overlayOn(this));var n=this.luminance+.05,i=e.luminance+.05,r=n/i;return i>n&&(r=1/r),r=Math.round(10*r)/10,{ratio:r,error:0,min:r,max:r}}var o=this.overlayOn(q.white).contrast(e).ratio,a=this.overlayOn(q.black).contrast(e).ratio,s=Math.max(o,a),c={red:Math.min(Math.max(0,(e.red-this.red*t)/(1-t)),255),green:Math.min(Math.max(0,(e.green-this.green*t)/(1-t)),255),blue:Math.min(Math.max(0,(e.blue-this.blue*t)/(1-t)),255)},u=this.clone();u.rgb=c;var l=this.overlayOn(u).contrast(e).ratio;return{ratio:Math.round((l+s)/2*10)/10,error:Math.round((s-l)/2*10)/10,min:l,max:s,closest:u,farthest:a===s?q.white:q.black}},wcagAACompliant:function(e){return this.contrast(e).ratio>=4.5},wcagAAACompliant:function(e){return this.contrast(e).ratio>=7},yiqContrastColor:function(){return this.yiq>=120?new q(0,0,0):new q(255,255,255)}},q.hexToRgb=function(e){var t;return e=String(e),3===e.length||4===e.length?(t=/^#?([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(e),t&&(t[1]+=t[1],t[2]+=t[2],t[3]+=t[3])):t=/^#?([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(e),t?{red:parseInt(t[1],16),green:parseInt(t[2],16),blue:parseInt(t[3],16),alpha:1}:null},q.rgbToHex=function(e,t,n){return"#"+((1<<24)+(Math.round(e)<<16)+(Math.round(t)<<8)+Math.round(n)).toString(16).slice(1)},q.rgbToHsl=function(e,t,n){e/=255,t/=255,n/=255;var i=Math.max(e,t,n),r=Math.min(e,t,n),o=(i+r)/2,a=o,s=o;if(i===r)return{hue:0,saturation:0,lightness:100*s};var c=i-r;return a=s>.5?c/(2-i-r):c/(i+r),i===e?o=(t-n)/c+(t1&&(n-=1),6*n<1?e+6*(t-e)*n:2*n<1?t:3*n<2?e+(t-e)*(6*(2/3-n)):e}if(e/=360,t/=100,n/=100,0===t)return{red:Math.floor(255*n),green:Math.floor(255*n),blue:Math.floor(255*n)};var r=n<.5?n*(1+t):n+t-t*n,o=2*n-r;return{red:Math.floor(255*i(o,r,e+1/3)),green:Math.floor(255*i(o,r,e)),blue:Math.floor(255*i(o,r,e-1/3))}},q.hslToHex=function(e,t,n){var i=q.hslToRgb(e,t,n);return q.rgbToHex(i.red,i.green,i.blue)},q.white=new q("fff"),q.black=new q("000");var Jn=6e4,Zn=window.Array.from,ei=[1];"function"==typeof Zn&&Zn(ei)===ei&&(Zn=!1);var ti=Zn||function(e){return[].slice.call(e,0)},ni=["quality","volume","captions"],ii=null,ri=function(){function e(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=n.displayTimeout,r=void 0===i?0:i,o=n.label,a=void 0===o?"Alert":o;Ke(this,e),C(this),this._container=t,this._visible=!1,this._message=null,this._alert=null,this._alertLabel=a;var s=Math.round(r/1e3);0!==s&&(this._alertLabel=a+" Will be dismissed in "+s+" seconds"),this._displayTimer=null,this._displayTimeout=r,this._renderTemplate(),this._attachEvents()}return Ye(e,[{key:"show",value:function(e){var t=this;if(this._visible!==!0){clearTimeout(this._displayTimer),this._alert.classList.remove("hidden"),this._alert.removeAttribute("hidden"),window.requestAnimationFrame(function(){t._alert.classList.add("in")});var n=this._alert.querySelector("[data-alert-autofocus]")||this._alert;n.focus(),this._visible=!0,this.fire("show",e),0!==this._displayTimeout&&(this._displayTimer=setTimeout(function(){t.hide("timeout")},this._displayTimeout))}}},{key:"hide",value:function(e){var t=this;this._visible!==!1&&(clearTimeout(this._displayTimer),this._alert.classList.add("leaving"),window.requestAnimationFrame(function(){var e=t;t._setHideAttributes(),et(t._alert).on("transitionend",function t(n){"opacity"===n.propertyName&&(e._alert.classList.remove("leaving"),e._alert.classList.add("hidden"),e._alert.setAttribute("hidden",""),et(e._alert).off("transitionend",t))})}),this._visible=!1,this.fire("hide",e))}},{key:"_setHideAttributes",value:function(){this._alert.classList.remove("in")}},{key:"_renderTemplate",value:function(){this._alert||(this._alert=document.createElement("div"),this._alert.setAttribute("role","alertdialog"),this._alert.setAttribute("aria-label",this._alertLabel),this._alert.setAttribute("aria-atomic","true"),this._alert.classList.add("player-alert"),this._alert.classList.add("hidden"),this._alert.setAttribute("hidden",""),this._container.appendChild(this._alert),this._setHideAttributes()),this._message instanceof HTMLElement?(this._alert.innerHTML="",this._alert.appendChild(this._message)):(this._alert.textContent=this._message,this._alert.innerHTML=this._message);var e=document.createElement("button");e.setAttribute("data-close",""),e.setAttribute("aria-label","Close alert"),e.classList.add("close"),e.innerHTML=ut.render("icon_close"),this._alert.appendChild(e)}},{key:"_attachEvents",value:function(){var e=this;et(this._alert).on("click","[data-close]",function(t){e.hide(t)})}},{key:"visible",get:function(){return this._visible}},{key:"message",get:function(){return this._message},set:function(e){e instanceof HTMLElement&&this._message&&e.textContent===this._message.textContent||e!==this._message&&(this._message=e,this._renderTemplate())}}]),e}(),oi=function(){function e(t,n,i){var r=this;Ke(this,e),C(this),this.version=i,this.visible=!1;var o=this._wrap=document.createElement("div");o.classList.add("compass-wrapper"),o.innerHTML=ut.render("compass",{version:i}),o.classList.add("cloaked"),t.appendChild(o),n&&o.addEventListener("click",n),this._layerSlice=o.querySelector(".compass-slice"),this._lineSlice=o.querySelector(".compass-line");var a=function(){r._mouseIn=!0},s=function(e){return function(){setTimeout(function(){r._mouseIn||(r.fade(),r._mouseIn=!1)},e)}};et(this._wrap).on("mousein",a).on("pointerin",a).on("mouseout",s(1e3)).on("pointerout",s(1e3)),s(2e3)()}return Ye(e,[{key:"setAngle",value:function(e,t){var n=this;this._animationFrame&&window.cancelAnimationFrame(this._animationFrame);var i=0;1===this.version?i=-45:2===this.version&&(i=-30);var r=""+(i+t),o=(e+85)/170,a=18;this._animationFrame=window.requestAnimationFrame(function(){n._layerSlice.setAttribute("transform","rotate("+r+", "+a+", "+a+")"),n._lineSlice&&n._lineSlice.setAttribute("d",n._getLinePath(o,a))})}},{key:"_getLinePath",value:function(e,t){var n=5,i=2*t-Math.round(2*t*e),r=2*Math.sqrt(2*i*t-Math.pow(i,2)),o=(2*t-r)/2,a=o+n,s=2*t-o-n;return"M"+a+","+i+" L"+s+","+i+" z"}},{key:"reveal",value:function(){var e=this;this._wrap.classList.remove("cloaked"),window.requestAnimationFrame(function(){e._wrap.classList.add("in")}),this.visible=!0}},{key:"fade",value:function(){this._wrap.classList.add("fade"),this.visible=!0}},{key:"hide",value:function(){var e=this;this._wrap.classList.remove("in"),this._wrap.classList.remove("fade"),this._wrap.classList.add("leaving");var t=function t(){"opacity"===event.propertyName&&(e._wrap.classList.remove("leaving"),e._wrap.classList.add("cloaked"),e.visible=!1),et(e._wrap).off("transitionend",t)};et(this._wrap).on("transitionend",t)}}]),e}(),ai=t(function(e){e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return"symbol"==typeof Symbol.iterator||"object"==typeof Symbol.isConcatSpreadable&&("object"==typeof Symbol.iterator&&("object"==typeof Symbol.toPrimitive&&("object"==typeof Symbol.toStringTag&&"object"==typeof Symbol.unscopables)))}}),si=e(ai),ci=Object.freeze({default:si}),ui=t(function(e){e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(e={foo:"raz"},t(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}}),li=e(ui),di=Object.freeze({ default:li}),fi=t(function(e){e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}}),hi=e(fi),pi=Object.freeze({default:hi}),vi=t(function(e){var t=Object.keys;e.exports=function(e){return t(null==e?e:Object(e))}}),mi=e(vi),gi=Object.freeze({default:mi}),_i=t(function(t){t.exports=e(pi)()?Object.keys:e(gi)}),yi=e(_i),bi=Object.freeze({default:yi}),wi=t(function(e){e.exports=function(e){if(null==e)throw new TypeError("Cannot use null or undefined");return e}}),ki=e(wi),xi=Object.freeze({default:ki}),Si=t(function(t){var n=e(bi),i=e(xi),r=Math.max;t.exports=function(e,t){var o,a,s,c=r(arguments.length,2);for(e=Object(i(e)),s=function(n){try{e[n]=t[n]}catch(e){o||(o=e)}},a=1;a-1}}),ji=e(Ni),Hi=Object.freeze({default:ji}),Vi=t(function(t){t.exports=e(Di)()?String.prototype.contains:e(Hi)}),Ui=e(Vi),zi=Object.freeze({default:Ui}),Wi=t(function(t){var n,i=e(Ci),r=e(Ii),o=e(qi),a=e(zi);n=t.exports=function(e,t){var n,o,s,c,u;return arguments.length<2||"string"!=typeof e?(c=t,t=e,e=null):c=arguments[2],null==e?(n=s=!0,o=!1):(n=a.call(e,"c"),o=a.call(e,"e"),s=a.call(e,"w")),u={value:t,configurable:n,enumerable:o,writable:s},c?i(r(c),u):u},n.gs=function(e,t,n){var s,c,u,l;return"string"!=typeof e?(u=n,n=t,t=e,e=null):u=arguments[3],null==t?t=void 0:o(t)?null==n?n=void 0:o(n)||(u=n,n=void 0):(u=t,t=n=void 0),null==e?(s=!0,c=!1):(s=a.call(e,"c"),c=a.call(e,"e")),l={get:t,set:n,configurable:s,enumerable:c},u?i(r(u),l):l}}),$i=e(Wi),Gi=Object.freeze({default:$i}),Xi=t(function(e){e.exports=function(e){return e&&("symbol"==typeof e||"Symbol"===e["@@toStringTag"])||!1}}),Ki=e(Xi),Yi=Object.freeze({default:Ki}),Qi=t(function(t){var n=e(Yi);t.exports=function(e){if(!n(e))throw new TypeError(e+" is not a symbol");return e}}),Ji=e(Qi),Zi=Object.freeze({default:Ji}),er=t(function(t){var n,i,r,o=e(Gi),a=e(Zi),s=Object.create,c=Object.defineProperties,u=Object.defineProperty,l=Object.prototype,d=s(null);"function"==typeof Symbol&&(n=Symbol);var f=function(){var e=s(null);return function(t){for(var n,i,r=0;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,n="@@"+t,u(l,n,o.gs(null,function(e){i||(i=!0,u(this,n,o(e)),i=!1)})),n}}();r=function(e){if(this instanceof r)throw new TypeError("TypeError: Symbol is not a constructor");return i(e)},t.exports=i=function e(t){var n;if(this instanceof e)throw new TypeError("TypeError: Symbol is not a constructor");return n=s(r.prototype),t=void 0===t?"":String(t),c(n,{__description__:o("",t),__name__:o("",f(t))})},c(i,{for:o(function(e){return d[e]?d[e]:d[e]=i(String(e))}),keyFor:o(function(e){var t;a(e);for(t in d)if(d[t]===e)return t}),hasInstance:o("",n&&n.hasInstance||i("hasInstance")),isConcatSpreadable:o("",n&&n.isConcatSpreadable||i("isConcatSpreadable")),iterator:o("",n&&n.iterator||i("iterator")),match:o("",n&&n.match||i("match")),replace:o("",n&&n.replace||i("replace")),search:o("",n&&n.search||i("search")),species:o("",n&&n.species||i("species")),split:o("",n&&n.split||i("split")),toPrimitive:o("",n&&n.toPrimitive||i("toPrimitive")),toStringTag:o("",n&&n.toStringTag||i("toStringTag")),unscopables:o("",n&&n.unscopables||i("unscopables"))}),c(r.prototype,{constructor:o(i),toString:o("",function(){return this.__name__})}),c(i.prototype,{toString:o(function(){return"Symbol ("+a(this).__description__+")"}),valueOf:o(function(){return a(this)})}),u(i.prototype,i.toPrimitive,o("",function(){return a(this)})),u(i.prototype,i.toStringTag,o("c","Symbol")),u(r.prototype,i.toStringTag,o("c",i.prototype[i.toStringTag])),u(r.prototype,i.toPrimitive,o("c",i.prototype[i.toPrimitive]))}),tr=e(er),nr=Object.freeze({default:tr}),ir=t(function(t){t.exports=e(ci)()?Symbol:e(nr)}),rr=e(ir),or=window.WeakMap||function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};return n.prototype.set=function(t,n){if("object"!==("undefined"==typeof t?"undefined":Xe(t))&&"function"!=typeof t)throw new TypeError("Invalid value used as weak map key");var i=t[this.name];return i&&i[0]===t?i[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},n.prototype.get=function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},n.prototype.delete=function(e){var t=e[this.name];return!(!t||t[0]!==e)&&(t[0]=t[1]=void 0,!0)},n.prototype.has=function(e){var t=e[this.name];return!!t&&t[0]===e},n}(),ar="function"==typeof rr&&"symbol"==typeof rr.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof rr&&e.constructor===rr&&e!==rr.prototype?"symbol":typeof e},sr=(function(){function e(e){this.value=e}function t(t){function n(e,t){return new je(function(n,r){var s={key:e,arg:t,resolve:n,reject:r,next:null};a?a=a.next=s:(o=a=s,i(e,t))})}function i(n,o){try{var a=t[n](o),s=a.value;s instanceof e?je.resolve(s.value).then(function(e){i("next",e)},function(e){i("throw",e)}):r(a.done?"return":"normal",a.value)}catch(e){r("throw",e)}}function r(e,t){switch(e){case"return":o.resolve({value:t,done:!0});break;case"throw":o.reject(t);break;default:o.resolve({value:t,done:!1})}o=o.next,o?i(o.key,o.arg):a=null}var o,a;this._invoke=n,"function"!=typeof t.return&&(this.return=void 0)}return"function"==typeof rr&&rr.asyncIterator&&(t.prototype[rr.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)},{wrap:function(e){return function(){return new t(e.apply(this,arguments))}},await:function(t){return new e(t)}}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),cr=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};sr(this,e),this._telecine=t,this._element=t._element,this._options=n}return cr(e,null,[{key:"displayName",get:function(){return"Effect"}},{key:"supported",get:function(){return!1}},{key:"supportedScanners",get:function(){return[]}}]),cr(e,[{key:"activate",value:function(){throw new TelecineError("NotImplemented","The effect must implement the activate method.")}},{key:"deactivate",value:function(){throw new TelecineError("NotImplemented","The effect must implement the deactivate method.")}}]),e}(),gr=/Firefox/.test(navigator.userAgent),_r=/i(Phone|Pad|Pod touch);/.test(navigator.userAgent),yr=/Android/.test(navigator.userAgent),br=yr&&/mobile/.test(navigator.userAgent.toLowerCase()),wr={firefox:gr,iOS:_r,android:yr,androidMobile:br},kr=function(e){for(var t=0,n=this.length;t1&&void 0!==arguments[1]?arguments[1]:{};sr(this,e),this._element=t,this._options=n,this._telecineVideo=null,this._currentFile=null,this._externalDisplays=[],ne(this)}return cr(e,null,[{key:"displayName",get:function(){return"Scanner"}},{key:"supported",get:function(){return!1}},{key:"supportedVideoTypes",get:function(){return[]}},{key:"supportedAudioTypes",get:function(){return[]}},{key:"supportedExternalDisplays",get:function(){return[]}},{key:"supportsSettingVolume",get:function(){return!0}},{key:"supportsTextTracks",get:function(){return!1}}]),cr(e,[{key:"deactivate",value:function(){this._telecineVideo&&(this._telecineVideo.off("filesrcupdate"),this._telecineVideo.off("texttracksrcupdate"))}},{key:"reactivate",value:function(){}},{key:"play",value:function(){throw new TelecineError("NotImplemented","The scanner must implement the play method.")}},{key:"pause",value:function(){throw new TelecineError("NotImplemented","The scanner must implement the pause method.")}},{key:"addTextTrack",value:function(e){return this}},{key:"removeTextTrack",value:function(e){return this}},{key:"getCuesForTrack",value:function(e){return[]}},{key:"getActiveCuesForTrack",value:function(e){return[]}},{key:"setModeForTrack",value:function(e,t){return this}},{key:"setSrcForTrack",value:function(e,t){return this}},{key:"addCuePoint",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};throw new TelecineError("CuePointsNotSupported","Cue points are not supported in this scanner.")}},{key:"removeCuePoint",value:function(e){return!1}},{key:"removeAllCuePoints",value:function(){return!1}},{key:"showExternalDisplayPicker",value:function(e){if(!this._externalDisplays.length)throw new TelecineError("ExternalDisplayUnvailable","No external displays are available.");if(!e)return void this._externalDisplays[0].showPicker();var t=this._externalDisplays.filter(function(t){return t.constructor.displayName.replace("ExternalDisplay","")===e})[0];if(!t)throw new TelecineError("InvalidExternalDisplay","The specified external display is not available.");t.showPicker()}},{key:"_pickFile",value:function(){if(this._files.length<1)return null;var e=this._files.slice(0).sort(function(e,t){return e.priority-t.priority});return e[0]}},{key:"_updateCurrentFile",value:function(){var e=this._pickFile();return e?void(this.currentFile=e):void this.fire("scannererror",{reason:"all files failed"})}},{key:"_switchToNextFile",value:function(){var e=this._files.indexOf(this._currentFile);this._files.splice(e,1),this._updateCurrentFile()}},{key:"buffered",get:function(){return ve()}},{key:"cuePoints",get:function(){return[]}},{key:"currentFile",get:function(){return this._currentFile},set:function(e){this._currentFile=e,this.fire("currentfilechange",e)}},{key:"currentTime",get:function(){return 0},set:function(e){}},{key:"duration",get:function(){return NaN}},{key:"ended",get:function(){return!1}},{key:"externalDisplayAvailable",get:function(){return this._externalDisplays.some(function(e){return e.available})}},{key:"externalDisplayActive",get:function(){return this._externalDisplays.some(function(e){return e.active})}},{key:"loop",get:function(){return!1},set:function(e){}},{key:"muted",get:function(){return!1},set:function(e){}},{key:"paused",get:function(){return!0}},{key:"playbackRate",get:function(){return 1},set:function(e){}},{key:"preload",get:function(){return"none"},set:function(e){}},{key:"presentationMode",get:function(){return"inline"},set:function(e){if(this.supportedPresentationModes.indexOf(e)===-1)throw new TelecineError("InvalidPresentationMode","The “"+e+"” presentation mode is not supported.")}},{key:"supportedPresentationModes",get:function(){return["inline"]}},{key:"video",get:function(){return this._telecineVideo},set:function(e){var t=this;this.reactivate(),this._telecineVideo!==e&&(this._telecineVideo&&(this._telecineVideo.off("filesrcupdate"),this._telecineVideo.off("texttracksrcupdate")),this.removeAllCuePoints(),this._telecineVideo=e,this._files=e.files.filter(function(e){return t.constructor.supportedVideoTypes.indexOf(e.mime)!==-1}),this._telecineVideo.on("filesrcupdate",function(e){e===t._currentFile&&t._updateCurrentFile()}),this._telecineVideo.on("texttracksrcupdate",function(e){t.video.currentScanner&&t.video.currentScanner.setSrcForTrack(e,e.src)}),this._options.externalDisplays&&this._options.externalDisplays.length&&!function(){t._externalDisplays=[];var n=t.constructor.supportedExternalDisplays.map(function(e){return e.displayName});t._options.externalDisplays.filter(function(e){return e.supported&&n.indexOf(e.displayName)!==-1}).forEach(function(n){var i=new n(e),r=n.displayName.replace("ExternalDisplay","");i.on("available",function(){return t.fire("externaldisplayavailable",{type:r})}),i.on("unavailable",function(){return t.fire("externaldisplayunavailable",{type:r})}),i.on("activated",function(){"function"==typeof t.onexternaldisplayactivated&&t.onexternaldisplayactivated(i),t.fire("externaldisplayactivated",{type:r})}),i.on("deactivated",function(){"function"==typeof t.onexternaldisplaydeactivated&&t.onexternaldisplaydeactivated(i),t.fire("externaldisplaydeactivated",{type:r})}),t._externalDisplays.push(i)})}(),this._updateCurrentFile())}},{key:"videoWidth",get:function(){return 0}},{key:"videoHeight",get:function(){return 0}},{key:"volume",get:function(){return 1},set:function(e){}}]),e}(),Tr=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],Er=["externaldisplayavailable","externaldisplayunavailable","externaldisplayactivated","externaldisplaydeactivated"],Pr=["scannerchange","scannererror","drmauthfailure","drmauthsuccess","drmfailure","emeunsupported","currentfilechange","streamchange","streambufferstart","streambufferend","droppedframes","bandwidth","streamtargetchange","alert","presentationmodechange","cuepoint"],Lr=[].concat(Tr,Er,Pr),Cr=new or,Or=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};sr(this,e);var 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=ue(),this.vttCue=new VTTCue(t,t+.25,JSON.stringify(n)),this.vttCue.id=this.id,Cr.set(this.vttCue,this),Object.freeze(this)}return cr(e,null,[{key:"fromVTTCue",value:function(t){if(Cr.has(t))return Cr.get(t);var n={};try{n=JSON.parse(t.text)}catch(e){}return new e(t.startTime,n)}}]),e}(),Ar=function(){function e(t){var n=this;sr(this,e),this._interval=null,this._rates=[],this._averageRate=0,this._lastChecked=null,this._lastLoaded=0,this._scanner=t,this._scanner.on("loadstart",function(){return n.startInterval()}),this._scanner.on("progress",function(){return n.startInterval()}),this._scanner.on("ended",function(){return n.stopInterval()})}return cr(e,[{key:"startInterval",value:function(){var e=this;this._interval||(this._interval=window.setInterval(function(){return e.updateDownloadRate()},1e3))}},{key:"stopInterval",value:function(){window.clearInterval(this._interval)}},{key:"updateDownloadRate",value:function(){for(var e=ce(),t=0,n=this._scanner.buffered,i=Array.isArray(n),r=0,n=i?n:n[rr.iterator]();;){var o;if(i){if(r>=n.length)break;o=n[r++]}else{if(r=n.next(),r.done)break;o=r.value}var a=o,s=pr(a,2),c=s[0],u=s[1];t+=u-c}if(!this._lastChecked)return this._lastChecked=e,void(this._lastLoaded=t);if(this._lastLoaded!==t){var l=Math.max(t-this._lastLoaded,0);this._rates.push(l),this._rates=this._rates.slice(-15),this._averageRate=this._rates.reduce(function(e,t){return e+t})/this._rates.length,this._lastChecked=e,this._lastLoaded=t,Math.round(t)>=Math.round(this._scanner.duration)&&this.stopInterval()}}},{key:"averageDownloadRate",get:function(){return this._averageRate}}]),e}(),Ir=function(){function e(t){sr(this,e),this._available=!1,this._active=!1,this._video=t,ne(this)}return cr(e,null,[{key:"displayName",get:function(){return"ExternalDisplay"}},{key:"supported",get:function(){return!1}},{key:"supportedVideoTypes",get:function(){return[]}}]),cr(e,[{key:"showPicker",value:function(){}},{key:"getFile",value:function(){var e=this.constructor.displayName.replace("ExternalDisplay","");if(this._video.externalDisplayFiles[e])return this._video.externalDisplayFiles[e];var t=this.constructor.supportedVideoTypes,n=this._video.files.filter(function(e){return t.indexOf(e.mime)!==-1}).sort(function(e,n){return e.mime===n.mime?e.priority-n.priority:t.indexOf(e.mime)-t.indexOf(n.mime)});if(!n.length)throw new Error("No files available for "+this.constructor.displayName+" external display.");return n[0]}},{key:"active",get:function(){return this._active}},{key:"available",get:function(){return this._available}},{key:"element",get:function(){return document.createElement("div")}}]),e}(),AirPlayExternalDisplay=function(e){function AirPlayExternalDisplay(e){sr(this,AirPlayExternalDisplay);var t=fr(this,(AirPlayExternalDisplay.__proto__||Object.getPrototypeOf(AirPlayExternalDisplay)).call(this,e));return t._videoElement=document.createElement("video"),t._videoElement.setAttribute("data-airplay",""),t._videoElement.setAttribute("x-webkit-airplay","allow"),t.addVideoEventListeners(),t}return dr(AirPlayExternalDisplay,e),cr(AirPlayExternalDisplay,null,[{key:"displayName",get:function(){return"AirPlayExternalDisplay"}},{key:"supported",get:function(){return"WebKitPlaybackTargetAvailabilityEvent"in window}},{key:"supportedVideoTypes",get:function(){return["application/vnd.apple.mpegurl","video/mp4"]}}]),cr(AirPlayExternalDisplay,[{key:"addVideoEventListeners",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._videoElement;t.addEventListener("webkitplaybacktargetavailabilitychanged",function(t){switch(t.availability){case"available":e._available||(e._available=!0,e.fire("available"));break;case"not-available":e._available&&(e._available=!1,e.fire("unavailable"))}}),t.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",function(t){return t.target.webkitCurrentPlaybackTargetIsWireless?(e._active=!0,void e.fire("activated")):(e._active=!1,void e.fire("deactivated"))})}},{key:"showPicker",value:function(){var e=this;this._videoElement.webkitShowPlaybackTargetPicker(),this.loadMetadata().then(function(){e._videoElement.webkitShowPlaybackTargetPicker()})}},{key:"loadMetadata",value:function(){var e=this;return this._videoElement.readyState>=1?je.resolve():new je(function(t,n){e._videoElement.addEventListener("loadedmetadata",function(){t()}),e._videoElement.src=e.getFile().src})}},{key:"element",get:function(){return this._videoElement},set:function(e){if(!(e instanceof HTMLVideoElement))throw new TypeError("The element for AirPlay must be a