(c=>{c.fn.YouTubePopUp=function(o){var t=c.extend({autoplay:1},o);c(this).on("click",function(o){var e,u,a=c(this).attr("href"),p=(a.match(/(youtube.com)/)&&(p="v=",e=1),(a.match(/(youtu.be)/)||a.match(/(vimeo.com\/)+[0-9]/))&&(p="/",e=3),a.match(/(vimeo.com\/)+[a-zA-Z]/)&&(p="/",e=5),a.split(p)[e].replace(/(&)+(.*)/,""));(a.match(/(youtu.be)/)||a.match(/(youtube.com)/))&&(u="https://www.youtube.com/embed/"+p+"?autoplay="+t.autoplay),(a.match(/(vimeo.com\/)+[0-9]/)||a.match(/(vimeo.com\/)+[a-zA-Z]/))&&(u="https://player.vimeo.com/video/"+p+"?autoplay="+t.autoplay),c("body").append('<div class="YouTubePopUp-Wrap YouTubePopUp-animation"><div class="YouTubePopUp-Content"><span class="YouTubePopUp-Close"></span><iframe src="'+u+'" allowfullscreen></iframe></div></div>'),c(".YouTubePopUp-Wrap").hasClass("YouTubePopUp-animation")&&setTimeout(function(){c(".YouTubePopUp-Wrap").removeClass("YouTubePopUp-animation")},600),c(".YouTubePopUp-Wrap, .YouTubePopUp-Close").click(function(){c(".YouTubePopUp-Wrap").addClass("YouTubePopUp-Hide").delay(515).queue(function(){c(this).remove()})}),o.preventDefault()}),c(document).keyup(function(o){27==o.keyCode&&c(".YouTubePopUp-Wrap, .YouTubePopUp-Close").click()})}})(jQuery);