(function e(n,t,i){function r(u,e){var s,h,o;if(!t[u]){if(!n[u]){if(s=typeof require=="function"&&require,!e&&s)return s(u,!0);if(f)return f(u,!0);h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h;}o=t[u]={exports:{}};n[u][0].call(o.exports,function(t){var i=n[u][1][t];return r(i?i:t)},o,o.exports,e,n,t,i)}return t[u].exports}for(var f=typeof require=="function"&&require,u=0;u<i.length;u++)r(i[u]);return r})({1:[function(){var n,t;try{if(n=new window.CustomEvent("test"),n.preventDefault(),n.defaultPrevented!==!0)throw new Error("Could not prevent default");}catch(i){t=function(n,t){var i,r;return t=t||{bubbles:!1,cancelable:!1,detail:undefined},i=document.createEvent("CustomEvent"),i.initCustomEvent(n,t.bubbles,t.cancelable,t.detail),r=i.preventDefault,i.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(n){this.defaultPrevented=!0}},i};t.prototype=window.Event.prototype;window.CustomEvent=t}},{}],2:[function(n,t){"use strict";function i(n){var f,i,t,e,r,s,u,o;if(n===undefined||n===null)throw new TypeError("Cannot convert first argument to object");for(f=Object(n),i=1;i<arguments.length;i++)if(t=arguments[i],t!==undefined&&t!==null)for(e=Object.keys(Object(t)),r=0,s=e.length;r<s;r++)u=e[r],o=Object.getOwnPropertyDescriptor(t,u),o!==undefined&&o.enumerable&&(f[u]=t[u]);return f}function r(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:i})}t.exports={assign:i,polyfill:r}},{}],3:[function(n,t){"use strict";var u=n("../index"),i=function(n){n.fn.modalVideo=function(n){return typeof n=="strings"||new u(this,n),this}},r;typeof define=="function"&&define.amd?define(["jquery"],i):(r=window.jQuery?window.jQuery:window.$,typeof r!="undefined"&&i(r));t.exports=i},{"../index":5}],4:[function(n,t,i){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var u,r;Object.defineProperty(i,"__esModule",{value:!0});u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}();n("custom-event-polyfill");r=n("../lib/util");var e=n("es6-object-assign").assign,o={channel:"youtube",facebook:{},youtube:{autoplay:1,cc_load_policy:1,color:null,controls:1,disablekb:0,enablejsapi:0,end:null,fs:1,h1:null,iv_load_policy:1,list:null,listType:null,loop:0,modestbranding:null,origin:null,playlist:null,playsinline:null,rel:0,showinfo:1,start:0,wmode:"transparent",theme:"dark",nocookie:!1},ratio:"16:9",vimeo:{api:!1,autopause:!0,autoplay:!0,byline:!0,callback:null,color:null,height:null,loop:!1,maxheight:null,maxwidth:null,player_id:null,portrait:!0,title:!0,width:null,xhtml:!1},allowFullScreen:!0,animationSpeed:300,classNames:{modalVideo:"modal-video",modalVideoClose:"modal-video-close",modalVideoBody:"modal-video-body",modalVideoInner:"modal-video-inner",modalVideoIframeWrap:"modal-video-movie-wrap",modalVideoCloseBtn:"modal-video-close-btn"},aria:{openMessage:"You just openned the modal video",dismissBtnMessage:"Close the modal by clicking here"}},s=function(){function n(t,i){var s=this;f(this,n);var u=e({},o,i),h=typeof t=="string"?document.querySelectorAll(t):t,c=document.querySelector("body"),l=u.classNames,a=u.animationSpeed;[].forEach.call(h,function(n){n.addEventListener("click",function(t){var i,f;n.tagName==="A"&&t.preventDefault();var o=n.dataset.videoId,h=n.dataset.channel||u.channel,e=r.getUniqId(),v=n.dataset.videoUrl||s.getVideoUrl(u,h,o),y=s.getHtml(u,v,e);r.append(c,y);i=document.getElementById(e);f=i.querySelector(".js-modal-video-dismiss-btn");i.focus();i.addEventListener("click",function(){r.addClass(i,l.modalVideoClose);setTimeout(function(){r.remove(i);n.focus()},a)});i.addEventListener("keydown",function(n){n.which===9&&(n.preventDefault(),document.activeElement===i?f.focus():(i.setAttribute("aria-label",""),i.focus()))});f.addEventListener("click",function(){r.triggerEvent(i,"click")})})})}return u(n,[{key:"getPadding",value:function(n){var t=n.split(":"),i=Number(t[0]),r=Number(t[1]),u=r*100/i;return u+"%"}},{key:"getQueryString",value:function(n){var t="";return Object.keys(n).forEach(function(i){t+=i+"="+n[i]+"&"}),t.substr(0,t.length-1)}},{key:"getVideoUrl",value:function(n,t,i){return t==="youtube"?this.getYoutubeUrl(n.youtube,i):t==="vimeo"?this.getVimeoUrl(n.vimeo,i):t==="facebook"?this.getFacebookUrl(n.facebook,i):""}},{key:"getVimeoUrl",value:function(n,t){var i=this.getQueryString(n);return"//player.vimeo.com/video/"+t+"?"+i}},{key:"getYoutubeUrl",value:function(n,t){var i=this.getQueryString(n);return n.nocookie===!0?"//www.youtube-nocookie.com/embed/"+t+"?"+i:"//www.youtube.com/embed/"+t+"?"+i}},{key:"getFacebookUrl",value:function(n,t){return"//www.facebook.com/v2.10/plugins/video.php?href=https://www.facebook.com/facebook/videos/"+t+"&"+this.getQueryString(n)}},{key:"getHtml",value:function(n,t,i){var u=this.getPadding(n.ratio),r=n.classNames;return'\n      <div class="'+r.modalVideo+'" tabindex="-1" role="dialog" aria-label="'+n.aria.openMessage+'" id="'+i+'">\n        <div class="'+r.modalVideoBody+'">\n          <div class="'+r.modalVideoInner+'">\n            <div class="'+r.modalVideoIframeWrap+'" style="padding-bottom:'+u+'">\n              <button class="'+r.modalVideoCloseBtn+' js-modal-video-dismiss-btn" aria-label="'+n.aria.dismissBtnMessage+"\"><\/button>\n              <iframe width='460' height='230' src=\""+t+"\" frameborder='0' allowfullscreen="+n.allowFullScreen+' tabindex="-1"/>\n            <\/div>\n          <\/div>\n        <\/div>\n      <\/div>\n    '}}]),n}();i.default=s;t.exports=i["default"]},{"../lib/util":6,"custom-event-polyfill":1,"es6-object-assign":2}],5:[function(n,t){"use strict";t.exports=n("./core/")},{"./core/":4}],6:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=i.append=function(n,t){var i=document.createElement("div");for(i.innerHTML=t;i.children.length>0;)n.appendChild(i.children[0])},u=i.getUniqId=function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()},f=i.remove=function(n){n&&n.parentNode&&n.parentNode.removeChild(n)},e=i.addClass=function(n,t){n.classList?n.classList.add(t):n.className+=" "+t},o=i.triggerEvent=function(n,t,i){var r=void 0;window.CustomEvent?r=new CustomEvent(t,{cancelable:!0}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(t,!1,!1,i));n.dispatchEvent(r)}},{}]},{},[3]);$(function(){$(".js-modal-btn").modalVideo()})