File: /var/www/vhosts/creativefellows.nl/figi.creativefellows.nl/public/js/app-min.js
// datepicker settings
!function(e){"function"==typeof define&&define.amd?
// AMD. Register as an anonymous module.
define(["../jquery.ui.datepicker"],e):
// Browser globals
e(jQuery.datepicker)}(function(e){return e.regional.nl={closeText:"Sluiten",prevText:"Vorige",nextText:"Volgende",currentText:"vandaag",monthNames:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthNamesShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],dayNamesShort:["zo","ma","di","wo","do","vr","za"],dayNamesMin:["z","m","d","w","d","v","z"],weekHeader:"Week",dateFormat:"dd-mm-yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.setDefaults(e.regional.nl),e.regional.nl}),$(document).foundation().ready(function(){$(".toggle-navigation").toggleSearchNavigation(),$("#header").fixednav(),
// cookie accept
$("#acceptCookie").on("click",function(e){e.preventDefault();var t=$(this).closest(".cookies");$.ajax({type:"POST",url:"accept-cookies",success:function(e){$("#cookies").slideUp("fast")}})}),
// open external links in new window
//$(document.links).filter(function() {
// return this.hostname != window.location.hostname;
//}).attr('target', '_blank');
// check form response
$(".form-response").checkIsSent(),
// showcase
$(".image-showcase").slick({pauseOnHover:!0,autoplay:!1,autoplaySpeed:4e3,dots:!1,infinite:!0,speed:500,fade:!0,cssEase:"linear",arrows:!0}),$(".slick-center").slick({centerMode:!0,slidesToShow:3,centerPadding:"40px",responsive:[{breakpoint:900,settings:{arrows:!0,centerMode:!0,slidesToShow:2}},{breakpoint:480,settings:{arrows:!1,centerMode:!0,slidesToShow:1}}]}),
// fade out header on scroll
$(window).scroll(function(){$(".image-showcase .cell .column-wrapper").css("opacity",1-$(window).scrollTop()/250)}),$(".show-schedule .fake-input-element").fakeInput(),
// search shows
$(".find-shows").findShows(),
// search shows
$(".figi-calendar").getCalendar(),
// scroll to element
$(".loopback button[data-toggle], button[data-scroll]").scrollToForm(),$("img.lazyLoad").lazyload({effect:"fadeIn"}),
// enlarge images
$(".enlarge-images img").enlargeImage(),
//$("img").showAltDescription();
$(".play-trailer").embedYoutube(),
// HP reviews
$("#reviews-gasten").showReviews(),
// HP
$(".agenda-figi").figiAgenda(),
// get iens widget
$(".iens-widget").embedIens(),$(".calendar").datepicker({dateFormat:"dd-mm-yy",minDate:0,showOtherMonths:!0,selectOtherMonths:!0,beforeShowDay:function(e){var t;return[0!=e.getDay(),""]},onSelect:function(e,t){var n=$(this).datepicker("getDate"),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=t.settings.dateFormat||$.datepicker._defaults.dateFormat,o=$.datepicker.formatDate("mm/dd/yy",a,t.settings),s=$(this).attr("data-copy");$(s).val(o),$(s).updateBookUrl()}}),$(".actueel-slider").horizontSlider()}),$.fn.horizontSlider=function(){return this.each(function(){var e=this,t=$(this).find(".agenda-items");e.init=function(){t.slick({infinite:!0,autoplay:!0,slidesToShow:4,arrows:!0,lazyLoad:"ondemand",responsive:[{breakpoint:480,settings:{slidesToShow:1}}]})}
// init the plugin
,e.init()})},$.fn.updateBookUrl=function(){return this.each(function(){var e=$(this),t=e.closest(".book-a-room"),n=t.find(".update-url"),a=t.find(".button"),i=a.attr("data-org"),o=[];e.init=function(){n.each(function(){o[$(this).attr("name")]=$(this).val(),e.updateParameter()})},e.updateParameter=function(){var e="";for(var t in o)""!=t&&""!=o[t]&&(e+="&"+t+"="+o[t],console.log(t+"="+o[t]));var n=i.replace("{data}",e);a.attr("href",n)},e.init()})},$.fn.embedIens=function(){return this.each(function(){var t=$(this),n=$('<div class="reveal tiny" data-reveal=""><div class="wrapper text-center"></div><button aria-label="Close reveal" class="close-button" data-close="" type="button"><span aria-hidden="true">×</span></button></div>'),a;t.init=function(){t.on("click",function(e){e.preventDefault(),
// new FD reveal
a=new Foundation.Reveal(n,{speed:500}),
// get data
t.getData(),
//open reveal
a.open()})},t.getData=function(){$.ajax("get-iens").done(function(e){n.find(".wrapper").html(e)})}
// init the plugin
,t.init()})},$.fn.figiAgenda=function(c){return this.each(function(){var e={duration:4e3,effectspeed:500},t=this;t.settings={};var a=$(this),n=0,i,o,s,r;t.init=function(){t.settings=$.extend({},e,c),t.getAgenda()}
// get json reviews
,t.getAgenda=function(){$.ajax({dataType:"json",type:"GET",url:"get-agenda",data:{},success:function(e){t.setAgenda(e)}})}
// set the reviews
,t.setAgenda=function(e){a.html(""),$(e).each(function(e,t){var n=$('<div class="agenda-item"><img src="'+t.image+'"><div class="text"><h3>'+t.title+"</h3><h4>"+t.artist+"</h4><p>"+t.date+'</p></div><a href="'+t.url+'" class="more">meer</a></div>');a.append(n)})}
// init the plugin
,t.init()})},$.fn.showReviews=function(d){return this.each(function(){var e={duration:4e3,effectspeed:500},t=this;t.settings={};var o=$(this).find(".reviews"),n=$(this).find("li"),a=0,s,r,c,i;t.init=function(){t.settings=$.extend({},e,d),t.getReviews(),n.on("click",function(){var e=$(this).index();n.removeClass("active"),$(this).addClass("active"),clearInterval(i),$(r).fadeOut(t.settings.effectspeed),$(s[e]).fadeIn(t.settings.effectspeed),r=s[e]})}
// get json reviews
,t.getReviews=function(){$.ajax({dataType:"json",type:"GET",url:"get-reviews",data:{},success:function(e){t.setReviews(e)}})}
// set the reviews
,t.setReviews=function(e){o.html("");var i=0;$(e).each(function(e,t){var n=$('<div class="review"><blockquote>'+t.review+"</blockquote><p><strong>"+t.naam+"</strong><br>"+t.plaats+"</p></div>");o.append(n);var a=n.height();i<a&&(i=a),n.css("height",a+"px"),
// only show first
0!=e&&n.hide()}),s=$(this).find(".review"),r=s[a],c=s[a+1],o.css("height",i+"px"),t.timeOut()}
// timeout
,t.timeOut=function(){n.removeClass("active"),$(n[a]).addClass("active"),i=setTimeout(t.showItem,t.settings.duration)}
// start the plugin
,t.showItem=function(){$(r).fadeOut(t.settings.effectspeed),$(c).fadeIn(t.settings.effectspeed),++a==s.length&&(a=0),setTimeout(function(){r=c,c=s[a],t.timeOut()},t.settings.effectspeed)}
// init the plugin
,t.init()})},$.fn.embedYoutube=function(){return this.each(function(){var t=$(this),e=t.attr("date-video-id"),n=t.closest(".showcase-case").find(".trailer"),a=n.find(".close-button"),i=!1,o=!1,s;t.init=function(){t.getYoutubeApi(),
// load and play video
t.click(function(e){e.preventDefault(),
// load the trailer
0==i?t.showTrailer():t.resumeVideo()}),
// stop video when closing
a.click(function(){setTimeout(t.stopVideo,500)})},t.showTrailer=function(){s=new YT.Player("player",{videoId:e,playerVars:{rel:0,color:"white",controls:0,showinfo:0,autohide:1,autoplay:1,modestbranding:1},events:{onReady:t.playVideo,onStateChange:t.onPlayerStateChange}})},t.getYoutubeApi=function(){var e=document.createElement("script");e.src="https://www.youtube.com/iframe_api";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)},t.playVideo=function(e){i=!0,e.target.playVideo()},t.onPlayerStateChange=function(e){0==e.data&&(o=!0,n.hide())},t.stopVideo=function(){s.stopVideo()},t.resumeVideo=function(){s.playVideo()}
// init the plugin
,t.init()})},$.fn.showAltDescription=function(){return this.each(function(){var t=$(this),n=$('<figure class="image-alt"></figure>');t.init=function(){
//var img = plugin.clone();
if(t.getAltText()){t.wrap(n);var e=n.find("img");$("<figcaption>"+t.getAltText()+"</figcaption>").insertAfter(t)}},t.getAltText=function(){return t.attr("alt")}
// init the plugin
,t.init()})},$.fn.enlargeImage=function(){return this.each(function(){var t=$(this),e=t.attr("alt"),n=$('<div class="reveal full text-center" data-reveal data-animation-in="scale-in-up" data-animation-out="scale-out-down"><button class="close-button" data-close aria-label="Close modal" type="button"><span aria-hidden="true">×</span></button><div><h2>'+e+"</h2></div></div>"),a=$('<div class="show-large-image"></div>'),i=!1,o;t.init=function(){
// duplicate image
t.duplicate(),o=new Foundation.Reveal(n,{speed:500}),t.on("click",function(){o.open()})},t.duplicate=function(){var e=t.clone();t.wrap(a),n.append(e),n.insertAfter(t)}
// init the plugin
,t.init()})},$.fn.scrollToForm=function(e,t){return this.each(function(){var e=$(this),t=e.attr("data-toggle");e.init=function(){$(this).on("click",function(){setTimeout(function(){e.animate()},100)})},e.animate=function(){$("html,body").animate({scrollTop:$("#"+t).offset().top-$("#header").height()},1e3),$("#"+t).find("input").first().focus()}
// init the plugin
,e.init()})},$.fn.getCalendar=function(){return this.each(function(){var t=$(this);t.settings={};var e=t.find("button"),n=t.find(".fake-input-element:not(.weekdays-select) "),a=$(t.attr("data-container")),i=$(t.attr("data-pagination")),o=t.find(".weekdays-select a");t.init=function(){
// Submit form
e.on("click",function(e){e.preventDefault(),t.getMonth()}),
// fake inputs
n.fakeInput()}
// get the shows
,t.getMonth=function(){$.ajax({url:"get-calendar",data:{date:t.getMonthId()},method:"POST",success:function(e){e&&t.setMonth(e)}})}
// update dom
,t.setMonth=function(e){var t;$(".reveal-overlay").remove(),a.html(e),a.find(".reveal").each(function(){var e=new Foundation.Reveal($(this))})}
// get selected date
,t.getMonthId=function(){return n.find("#date-id").val()}
// init the plugin
,t.init()})},$.fn.findShows=function(){return this.each(function(){var i=$(this);i.settings={};var e=i.find("button"),t=i.find(".fake-input-element:not(.weekdays-select) "),o=$(i.attr("data-container")),n=$(i.attr("data-pagination")),a=i.find(".weekdays-select a"),s=i.find(".fake-input-element:not(.weekdays-select) a.option"),r=i.find("a.search"),c=null;i.getTerm=function(){var e=2,t,n=null;
// focus search term
setTimeout(function(){$("#term").focus()},750),$("#term").keyup(function(){clearInterval(n),n=null;var e=$(this).val();n=setTimeout(function(){$.ajax({url:"get-tickets",data:{type:"cinema",q:e},method:"POST",success:function(e){i.clearCells(),e&&i.setShows(e)}})},500)})},i.init=function(){
// button search
e.on("click",function(e){e.preventDefault(),i.getShows(1)}),
// toggle search term input
r.one("click",function(e){e.preventDefault(),i.getTerm()}),
// cinema weekdays
a.on("click",function(e){
// toggle search shows
if(e.preventDefault(),
// set active
$(this).closest("ul").find("a.current").removeClass("current"),$(this).addClass("current"),!$(this).hasClass("search")){
// get IDs
var t=$(this).attr("data-value"),n=$(this).attr("data-genre"),a=$(this).attr("data-group-id");
// empty current cells
i.clearCells(),
// get tickets
$.ajax({url:"get-tickets",data:{type:"cinema",genre:n,date:t,group:a},method:"POST",success:function(e){
// insert shows
e&&i.setShows(e)}})}}),
// pagination clicks
i.paginationClick(),
// fake inputs
t.fakeInput(),
// click on fake input elements, auto update results
s.on("click",function(){i.getShows(1)}),
// ajax history
i.setBaseUrl(),window.addEventListener("popstate",function(e){e.state&&i.historyUrl(e.state)})},i.setBaseUrl=function(){c=i.find("#base").val();//window.location.pathname;
//alert(baseurl);
}
// fade oud and remove current shows
,i.clearCells=function(){var e=o.height(),t;o.css("height",e+"px"),o.find(".cell").each(function(){$(this).fadeOut("fast",function(){$(this).remove()})})},i.paginationClick=function(){n.on("click","a",function(e){e.preventDefault();var t=$(this).attr("data-page");i.getShows(t)})}
// get the shows
,i.getShows=function(e){
// empty current cells
i.clearCells(),$.ajax({url:"get-tickets",data:{date:i.getDate(),category:i.getCategory(),name:i.getCategoryName(),type:i.getTicketType(),q:i.getSearchQuery()},method:"POST",success:function(e){e&&i.setShows(e)}});var t={date:i.getDate(),category:i.getCategory(),name:i.getCategoryName(),type:i.getTicketType(),q:i.getSearchQuery()},n=c+"/"+i.getDate()+"/"+i.getCategory();window.history.pushState(t,"",n)},i.historyUrl=function(e){
// empty current cells
i.clearCells(),$.ajax({url:"get-tickets",data:{date:e.date,category:e.category,name:e.name,type:e.type,q:e.q},method:"POST",success:function(e){e&&i.setShows(e)}})}
// update dom
,i.setShows=function(e){
//console.log(shows.tickets);
if(
// toggle pagination
0===e.meta.pagination?$("#show-pagination").hide():i.setPagination(e.meta),e.tickets)$(".no-results").length&&$(".no-results").remove();else{var t=$('<div class="cell small-12 text-center no-results" style="width:100%;"><h3>Geen voorstellingen gevonden</h3><p>Wijzig de datum of kies een andere categorie.</p></div>');t.hide(),o.append(t),t.fadeIn("fast"),$("#show-pagination").hide()}$(e.tickets).each(function(e,t){var n=null!=t.genre?"<h5>"+t.genre+"</h5>":"",a=$('<div class="cell show"><div class="card">\t\t\t\t\t<div class="card-image"><a href="'+t.link+'"><img class="lazyload" src="'+t.image+'"></a></div>\t\t\t\t\t<div class="card-section">\t\t\t\t\t\t<h4 data-equalizer-watch><a href="'+t.link+'">'+t.artist+"</a></h4>\t\t\t\t\t\t"+n+"\t\t\t\t\t\t<p>"+t.lead+"</p>\t\t\t\t\t</div>\t\t\t\t\t</div></div>");t.date&&a.find(".card-section h4").after(t.icon),a.hide(),o.append(a),a.fadeIn("fast")}),o.css("height","");var n=new Foundation.Equalizer(o)}
// update the pagination
,i.setPagination=function(e){$("#show-pagination").html(e.pagination).show()},i.getSearchQuery=function(){return i.find("#search-shows").val()}
// get selected date
,i.getDate=function(){return t.find("#date-id").val()}
// get selected category
,i.getCategory=function(){return t.find("#genre-id").val()}
// fet ticket type
,i.getTicketType=function(){return t.find("#ticket-type").val()},i.getCategoryName=function(){return t.find("#genre-name").val()}
// init the plugin
,i.init()})},$.fn.fakeInput=function(){return this.each(function(){var i=$(this),e=$(this).find(".fake-input"),t=$(this).find("a.option"),o=$(this).find(".current-element span"),s=$($(this).attr("data-id")),r=$($(this).attr("data-name")),n=$(this).attr("data-update-element");i.init=function(){e.on("click",function(e){e.preventDefault();var t=$(this),n=$(this).next(),a;$(this).parent().toggleClass("active"),n.toggleClass("hidden"),
// hide open selects
$(".fake-input-values").not(n).addClass("hidden")})},t.on("click",function(e){e.preventDefault();var t=$(this).html(),n=$(this).attr("data-value"),a=$(this).attr("data-label");
//var name = $(this).attr('data-name');
// update label
o.text(t),
// set hidden input value
s.val(n),r.val(a),
// hide deopdowns
$(".fake-input-values").addClass("hidden"),
// update an alement with given id / url
i.updateOrderUrl(n)}),i.updateOrderUrl=function(e){$(n).attr("href",e)}
// init the plugin
,i.init()})},$.fn.checkIsSent=function(){return this.each(function(){var a=$(this);a.init=function(){var e=a.getUrlParameter("s"),t=a.getUrlParameter("id"),n=a.getUrlParameter("h");1==e&&$("html, body").animate({scrollTop:a.offset().top-200},1e3)},a.getUrlParameter=function(e){var t,n=decodeURIComponent(window.location.search.substring(1)).split("&"),a,i;for(i=0;i<n.length;i++)if((a=n[i].split("="))[0]===e)return void 0===a[1]||a[1]},
// init the plugin
a.init()})}
/*
* fixed navigation
*/,$.fn.fixednav=function(){function t(){return window.pageYOffset}function e(){var e=t();n<=e&&$("#header").addClass("has-scrolled")}var n=$("#header").height(),a=0;$(window).scroll(function(){var e=t();n<=e?$("#header").addClass("has-scrolled"):$("#header").removeClass("has-scrolled"),
// scrolling up
//if (scrollYpos < lastScrollTop) $('#header').removeClass('has-scrolled');
// set scroll pos
a=e}),e()}
/*
* toggle navigation
*/,$.fn.toggleSearchNavigation=function(){var t=null,n=500,a=new Foundation.ResponsiveToggle(".toggle-menu"),i=$(this),o=!1,e=$(".close-search"),s=$("#search-products");$(this).on("click",function(e){
// toggle open class
$(this).toggleClass("open"),$("#header").toggleClass("open"),
// create mask element if not exists
0==$(".shade-out").length&&r(),
// open
$(this).hasClass("open")?
// show shade-out
t.addClass("is-open").hide().fadeIn("fast"):
// hide shade-out
t.removeClass("is-open").delay(n).fadeOut("fast"),
// copy nav
0==o?d():l()}),$(".toggle-search").on("click",function(e){$("#header").toggleClass("navigation-open"),$("#header").hasClass("navigation-open")&&setTimeout(function(){$("#q").focus()},100)}),$(".close-search").on("click",function(e){$("#header").toggleClass("navigation-open")});var r=function(){(t=$('<div class="shade-out"></div>').hide()).insertAfter("#header"),t.on("click",function(e){
// fade shade
c(),
// close menu
a.toggleMenu("close"),
//
i.toggleClass("open")})},c=function(){
// hide shade-out
t.removeClass("is-open").delay(n).fadeOut("fast")},d=function(){
//var html = $('<li class="hide-for-large"><a href="agenda">Evenementenkalender</a></li>\
// <li class="hide-for-large"><a href="bezoekersinformatie">Bezoekersinformatie</a></li>\
// <li class="hide-for-large"><a href="tel:+31307210601" class="show-inline"><i class="fal fa-phone" aria-hidden="true"></i></a> <a href="mailto:info@slotzeist.nl" class="show-inline"><i class="fal fa-envelope"></i></a></li>');
0==o&&(
// html.insertBefore( $("#search-site") );
o=!0)},l=function(){
// delete inserted navs
//$(".sub-items").remove();
///navcopied = false;
}};