/** * @file * Global utilities. * */ (function ($, Drupal) { var firebaseConfig = { apiKey: "AIzaSyBEYw4p40Dp-8s_D51hWEvryg9WCts220U", authDomain: "poker-fr.firebaseapp.com", databaseURL: "https://poker-fr.firebaseio.com", projectId: "poker-fr", storageBucket: "poker-fr.appspot.com", messagingSenderId: "593123066823", appId: "1:593123066823:web:23544741479f610d63cfe2", measurementId: "G-RK7HQVDMEZ" }; // Initialize Firebase firebase.initializeApp(firebaseConfig); var showalert = 0; function subscribetoken(currentToken) { var d= {}; $.ajax({ url :"https://api.coteur.com/notif/register", type: 'POST', contentType: 'application/json', data: JSON.stringify({token:currentToken,username:'',version:3,d,country:'fr' }) }) .done(function( data ) { // ok }); } const messaging = firebase.messaging(); messaging.usePublicVapidKey("BAHKZKft6iOKHdGffWnNlM3ggXmzJLm8AFeJ4Hr0BNN276f6T-nPh-NA3oltRk4qg1dib82JoSmwJ3bZYChe5SE"); messaging.onMessage((payload) => { console.log('Message received. ', payload); if (payload.notification!= null){ console.log('Message received. ', payload); showalert = 1; toastr.success(payload.data.title, payload.data.msg); } }); Notification.requestPermission().then((permission) => { if (permission === 'granted') { messaging.getToken().then((currentToken) => { if (currentToken != Cookies.get('currentToken')) { subscribetoken(currentToken); Cookies.set('currentToken', currentToken, { expires: 1, path: '/' }); } }).catch((err) => { //console.log('An error occurred while retrieving token. ', err); }); // Callback fired if Instance ID token is updated. messaging.onTokenRefresh(() => { messaging.getToken().then((refreshedToken) => { if (currentToken != Cookies.get('currentToken')) { //console.log("tokenrenew",currentToken); subscribetoken(currentToken); Cookies.set('currentToken', currentToken, { expires: 1, path: '/' }); } }).catch((err) => { // console.log('Unable to retrieve refreshed token ', err); //showToken('Unable to retrieve refreshed token ', err); }); }); } else { //console.log('Unable to get permission to notify.'); } }); 'use strict'; Drupal.behaviors.bootstrap_barrio_subtheme = { attach: function (context, settings) { } }; })(jQuery, Drupal); ; /*! js-cookie v3.0.0-rc.0 | MIT */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var r=e.Cookies,n=e.Cookies=t();n.noConflict=function(){return e.Cookies=r,n}}())}(this,function(){"use strict";function e(e){for(var t=1;t 1 && arguments[1] !== undefined ? arguments[1] : undefined; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; key = key && !$.cookie.raw ? encodeURIComponent(key) : key; if (value !== undefined && !isFunction(value)) { var attributes = Object.assign({}, $.cookie.defaults, options); if (typeof attributes.expires === 'string' && attributes.expires !== '') { attributes.expires = new Date(attributes.expires); } var cookieSetter = cookies.withConverter({ write: function write(cookieValue) { return encodeURIComponent(cookieValue); } }); value = $.cookie.json && !$.cookie.raw ? JSON.stringify(value) : String(value); return cookieSetter.set(key, value, attributes); } var userProvidedConverter = value; var cookiesShim = cookies.withConverter({ read: function read(cookieValue, cookieName) { return reader(cookieValue, cookieName, userProvidedConverter, $.cookie.raw, $.cookie.json); } }); if (key !== undefined) { return cookiesShim.get(key); } var results = cookiesShim.get(); Object.keys(results).forEach(function (resultKey) { if (results[resultKey] === undefined) { delete results[resultKey]; } }); return results; }; $.cookie.defaults = Object.assign({ path: '' }, cookies.defaults); $.cookie.json = false; $.cookie.raw = false; $.removeCookie = function (key, options) { cookies.remove(key, Object.assign({}, $.cookie.defaults, options)); return !cookies.get(key); }; })(jQuery, Drupal, window.Cookies);; /** * @file * eu_cookie_compliance.js * * Defines the behavior of the eu cookie compliance banner. * * Statuses: * null: not yet agreed (or withdrawn), show popup * 0: Disagreed * 1: Agreed, show thank you banner * 2: Agreed */ (function ($, Drupal, drupalSettings) { 'use strict'; var euCookieComplianceBlockCookies; Drupal.behaviors.euCookieCompliancePopup = { attach: function (context) { $('body').once('eu-cookie-compliance').each(function () { // If configured, check JSON callback to determine if in EU. if (drupalSettings.eu_cookie_compliance.popup_eu_only_js) { if (Drupal.eu_cookie_compliance.showBanner()) { var url = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + 'eu-cookie-compliance-check'; var data = {}; $.getJSON(url, data, function (data) { // If in the EU, show the compliance banner. if (data.in_eu) { Drupal.eu_cookie_compliance.execute(); } // If not in EU, set an agreed cookie automatically. else { Drupal.eu_cookie_compliance.setStatus(2); } }); } } // Otherwise, fallback to standard behavior which is to render the banner. else { Drupal.eu_cookie_compliance.execute(); } }); }, }; Drupal.eu_cookie_compliance = {}; Drupal.eu_cookie_compliance.execute = function () { try { if (!drupalSettings.eu_cookie_compliance.popup_enabled) { return; } if (!Drupal.eu_cookie_compliance.cookiesEnabled()) { return; } var status = Drupal.eu_cookie_compliance.getCurrentStatus(); if ((status === 0 && drupalSettings.eu_cookie_compliance.method === 'default') || status === null || (drupalSettings.eu_cookie_compliance.withdraw_enabled && drupalSettings.eu_cookie_compliance.withdraw_button_on_info_popup)) { if (!drupalSettings.eu_cookie_compliance.disagree_do_not_show_popup || status === null) { // Detect mobile here and use mobile_popup_html_info, if we have a mobile device. if (window.matchMedia('(max-width: ' + drupalSettings.eu_cookie_compliance.mobile_breakpoint + 'px)').matches && drupalSettings.eu_cookie_compliance.use_mobile_message) { Drupal.eu_cookie_compliance.createPopup(drupalSettings.eu_cookie_compliance.mobile_popup_html_info, (status !== null)); } else { Drupal.eu_cookie_compliance.createPopup(drupalSettings.eu_cookie_compliance.popup_html_info, (status !== null)); } Drupal.eu_cookie_compliance.initPopup(); } } if (status === 1 && drupalSettings.eu_cookie_compliance.popup_agreed_enabled) { // Thank you banner. Drupal.eu_cookie_compliance.createPopup(drupalSettings.eu_cookie_compliance.popup_html_agreed); Drupal.eu_cookie_compliance.attachHideEvents(); } else if (status === 2 && drupalSettings.eu_cookie_compliance.withdraw_enabled) { if (!drupalSettings.eu_cookie_compliance.withdraw_button_on_info_popup) { Drupal.eu_cookie_compliance.createWithdrawBanner(drupalSettings.eu_cookie_compliance.withdraw_markup); } Drupal.eu_cookie_compliance.attachWithdrawEvents(); } } catch (e) { } }; Drupal.eu_cookie_compliance.initPopup = function() { Drupal.eu_cookie_compliance.attachAgreeEvents(); if (drupalSettings.eu_cookie_compliance.method === 'categories') { var categories_checked = []; if (Drupal.eu_cookie_compliance.getCurrentStatus() === null) { if (drupalSettings.eu_cookie_compliance.select_all_categories_by_default) { categories_checked = drupalSettings.eu_cookie_compliance.cookie_categories; } } else { categories_checked = Drupal.eu_cookie_compliance.getAcceptedCategories(); } Drupal.eu_cookie_compliance.setPreferenceCheckboxes(categories_checked); Drupal.eu_cookie_compliance.attachSavePreferencesEvents(); } if (drupalSettings.eu_cookie_compliance.withdraw_enabled && drupalSettings.eu_cookie_compliance.withdraw_button_on_info_popup) { Drupal.eu_cookie_compliance.attachWithdrawEvents(); var currentStatus = Drupal.eu_cookie_compliance.getCurrentStatus(); if (currentStatus === 1 || currentStatus === 2) { $('.eu-cookie-withdraw-button').show(); } } } Drupal.eu_cookie_compliance.createWithdrawBanner = function (html) { var $html = $('
').html(html); var $banner = $('.eu-cookie-withdraw-banner', $html); $html.attr('id', 'sliding-popup'); $html.addClass('eu-cookie-withdraw-wrapper'); if (!drupalSettings.eu_cookie_compliance.popup_use_bare_css) { $banner.height(drupalSettings.eu_cookie_compliance.popup_height) .width(drupalSettings.eu_cookie_compliance.popup_width); } $html.hide(); var height = 0; if (drupalSettings.eu_cookie_compliance.popup_position) { $html.prependTo('body'); height = $html.outerHeight(); $html.show() .addClass('sliding-popup-top') .addClass('clearfix') .css({ top: !drupalSettings.eu_cookie_compliance.fixed_top_position ? -(parseInt($('body').css('padding-top')) + parseInt($('body').css('margin-top')) + height) : -1 * height }); // For some reason, the tab outerHeight is -10 if we don't use a timeout // function to reveal the tab. setTimeout(function () { var height = $html.outerHeight(); $html.animate({ top: !drupalSettings.eu_cookie_compliance.fixed_top_position ? -(parseInt($('body').css('padding-top')) + parseInt($('body').css('margin-top')) + height) : -1 * height }, drupalSettings.eu_cookie_compliance.popup_delay, null, function () { $html.trigger('eu_cookie_compliance_popup_open'); }); }.bind($html), 0); } else { if (drupalSettings.eu_cookie_compliance.better_support_for_screen_readers) { $html.prependTo('body'); } else { $html.appendTo('body'); } height = $html.outerHeight(); $html.show() .addClass('sliding-popup-bottom') .css({ bottom: -1 * height }); // For some reason, the tab outerHeight is -10 if we don't use a timeout // function to reveal the tab. setTimeout(function () { var height = $html.outerHeight(); $html.animate({ bottom: -1 * (height) }, drupalSettings.eu_cookie_compliance.popup_delay, null, function () { $html.trigger('eu_cookie_compliance_popup_open'); }); }.bind($html), 0); } }; Drupal.eu_cookie_compliance.toggleWithdrawBanner = function () { var $wrapper = $('#sliding-popup'); var $tab = $('.eu-cookie-withdraw-tab'); var topBottom = (drupalSettings.eu_cookie_compliance.popup_position ? 'top' : 'bottom'); var height = $wrapper.outerHeight(); var $bannerIsShowing = drupalSettings.eu_cookie_compliance.popup_position ? parseInt($wrapper.css('top')) === (!drupalSettings.eu_cookie_compliance.fixed_top_position ? -(parseInt($('body').css('padding-top')) + parseInt($('body').css('margin-top'))) : 0) : parseInt($wrapper.css('bottom')) === 0; if (drupalSettings.eu_cookie_compliance.popup_position) { if ($bannerIsShowing) { $wrapper.animate({ top: !drupalSettings.eu_cookie_compliance.fixed_top_position ? -(parseInt($('body').css('padding-top')) + parseInt($('body').css('margin-top')) + height) : -1 * height}, drupalSettings.eu_cookie_compliance.popup_delay); } else { $wrapper.animate({ top: !drupalSettings.eu_cookie_compliance.fixed_top_position ? -(parseInt($('body').css('padding-top')) + parseInt($('body').css('margin-top'))) : 0}, drupalSettings.eu_cookie_compliance.popup_delay); } } else { if ($bannerIsShowing) { $wrapper.animate({'bottom' : -1 * (height)}, drupalSettings.eu_cookie_compliance.popup_delay); } else { $wrapper.animate({'bottom' : 0}, drupalSettings.eu_cookie_compliance.popup_delay); } } }; Drupal.eu_cookie_compliance.createPopup = function (html, closed) { // This fixes a problem with jQuery 1.9. var popup = $('
').html(html); popup.attr('id', 'sliding-popup'); if (!drupalSettings.eu_cookie_compliance.popup_use_bare_css) { popup.height(drupalSettings.eu_cookie_compliance.popup_height) .width(drupalSettings.eu_cookie_compliance.popup_width); } popup.hide(); var height = 0; if (drupalSettings.eu_cookie_compliance.popup_position) { popup.prependTo('body'); height = popup.outerHeight(); popup.show() .addClass('sliding-popup-top clearfix') .css({ top: -1 * height }); if (closed !== true) { popup.animate({top: 0}, drupalSettings.eu_cookie_compliance.popup_delay, null, function () { popup.trigger('eu_cookie_compliance_popup_open'); }); } } else { if (drupalSettings.eu_cookie_compliance.better_support_for_screen_readers) { popup.prependTo('body'); } else { popup.appendTo('body'); } height = popup.outerHeight(); popup.show() .addClass('sliding-popup-bottom') .css({bottom: -1 * height}); if (closed !== true) { popup.animate({bottom: 0}, drupalSettings.eu_cookie_compliance.popup_delay, null, function () { popup.trigger('eu_cookie_compliance_popup_open'); }); } } }; Drupal.eu_cookie_compliance.attachAgreeEvents = function () { var clickingConfirms = drupalSettings.eu_cookie_compliance.popup_clicking_confirmation; var scrollConfirms = drupalSettings.eu_cookie_compliance.popup_scrolling_confirmation; if (drupalSettings.eu_cookie_compliance.method === 'categories' && drupalSettings.eu_cookie_compliance.enable_save_preferences_button) { // The agree button becomes an agree to all categories button when the 'save preferences' button is present. $('.agree-button').click(Drupal.eu_cookie_compliance.acceptAllAction); } else { $('.agree-button').click(Drupal.eu_cookie_compliance.acceptAction); } $('.decline-button').click(Drupal.eu_cookie_compliance.declineAction); if (clickingConfirms) { $('a, input[type=submit], button[type=submit]').not('.popup-content *').bind('click.euCookieCompliance', Drupal.eu_cookie_compliance.acceptAction); } if (scrollConfirms) { var alreadyScrolled = false; var scrollHandler = function () { if (alreadyScrolled) { Drupal.eu_cookie_compliance.acceptAction(); $(window).off('scroll', scrollHandler); } else { alreadyScrolled = true; } }; $(window).bind('scroll', scrollHandler); } $('.find-more-button').not('.find-more-button-processed').addClass('find-more-button-processed').click(Drupal.eu_cookie_compliance.moreInfoAction); }; Drupal.eu_cookie_compliance.attachSavePreferencesEvents = function () { $('.eu-cookie-compliance-save-preferences-button').click(Drupal.eu_cookie_compliance.savePreferencesAction); }; Drupal.eu_cookie_compliance.attachHideEvents = function () { var popupHideAgreed = drupalSettings.eu_cookie_compliance.popup_hide_agreed; var clickingConfirms = drupalSettings.eu_cookie_compliance.popup_clicking_confirmation; $('.hide-popup-button').click(function () { Drupal.eu_cookie_compliance.changeStatus(2); } ); if (clickingConfirms) { $('a, input[type=submit], button[type=submit]').unbind('click.euCookieCompliance'); } if (popupHideAgreed) { $('a, input[type=submit], button[type=submit]').bind('click.euCookieComplianceHideAgreed', function () { Drupal.eu_cookie_compliance.changeStatus(2); }); } $('.find-more-button').not('.find-more-button-processed').addClass('find-more-button-processed').click(Drupal.eu_cookie_compliance.moreInfoAction); }; Drupal.eu_cookie_compliance.attachWithdrawEvents = function () { $('.eu-cookie-withdraw-button').click(Drupal.eu_cookie_compliance.withdrawAction); $('.eu-cookie-withdraw-tab').click(Drupal.eu_cookie_compliance.toggleWithdrawBanner); }; Drupal.eu_cookie_compliance.acceptAction = function () { var agreedEnabled = drupalSettings.eu_cookie_compliance.popup_agreed_enabled; var nextStatus = 1; if (!agreedEnabled) { Drupal.eu_cookie_compliance.setStatus(1); nextStatus = 2; } if (!euCookieComplianceHasLoadedScripts && typeof euCookieComplianceLoadScripts === "function") { euCookieComplianceLoadScripts(); } if (typeof euCookieComplianceBlockCookies !== 'undefined') { clearInterval(euCookieComplianceBlockCookies); } if (drupalSettings.eu_cookie_compliance.method === 'categories') { // Select Checked categories. var categories = $("#eu-cookie-compliance-categories input:checkbox:checked").map(function(){ return $(this).val(); }).get(); Drupal.eu_cookie_compliance.setAcceptedCategories(categories); // Load scripts for all categories. Drupal.eu_cookie_compliance.loadCategoryScripts(categories); } Drupal.eu_cookie_compliance.changeStatus(nextStatus); }; Drupal.eu_cookie_compliance.acceptAllAction = function () { var allCategories = drupalSettings.eu_cookie_compliance.cookie_categories; Drupal.eu_cookie_compliance.setPreferenceCheckboxes(allCategories); Drupal.eu_cookie_compliance.acceptAction(); } Drupal.eu_cookie_compliance.savePreferencesAction = function () { var categories = $("#eu-cookie-compliance-categories input:checkbox:checked").map(function(){ return $(this).val(); }).get(); var agreedEnabled = drupalSettings.eu_cookie_compliance.popup_agreed_enabled; var nextStatus = 1; if (!agreedEnabled) { Drupal.eu_cookie_compliance.setStatus(1); nextStatus = 2; } Drupal.eu_cookie_compliance.setAcceptedCategories(categories); if (!euCookieComplianceHasLoadedScripts && typeof euCookieComplianceLoadScripts === "function") { euCookieComplianceLoadScripts(); } Drupal.eu_cookie_compliance.loadCategoryScripts(categories); Drupal.eu_cookie_compliance.changeStatus(nextStatus); }; Drupal.eu_cookie_compliance.loadCategoryScripts = function(categories) { for (var cat in categories) { if (euCookieComplianceHasLoadedScriptsForCategory[cat] !== true && typeof euCookieComplianceLoadScripts === "function") { euCookieComplianceLoadScripts(categories[cat]); euCookieComplianceHasLoadedScriptsForCategory[cat] = true; } } } Drupal.eu_cookie_compliance.declineAction = function () { Drupal.eu_cookie_compliance.setStatus(0); var popup = $('#sliding-popup'); if (popup.hasClass('sliding-popup-top')) { popup.animate({ top: !drupalSettings.eu_cookie_compliance.fixed_top_position ? -(parseInt($('body').css('padding-top')) + parseInt($('body').css('margin-top')) + popup.outerHeight()) : popup.outerHeight() * -1 }, drupalSettings.eu_cookie_compliance.popup_delay, null, function () { popup.hide(); }).trigger('eu_cookie_compliance_popup_close'); } else { popup.animate({ bottom: popup.outerHeight() * -1 }, drupalSettings.eu_cookie_compliance.popup_delay, null, function () { popup.hide(); }).trigger('eu_cookie_compliance_popup_close'); } }; Drupal.eu_cookie_compliance.withdrawAction = function () { Drupal.eu_cookie_compliance.setStatus(0); Drupal.eu_cookie_compliance.setAcceptedCategories([]); location.reload(); }; Drupal.eu_cookie_compliance.moreInfoAction = function () { if (drupalSettings.eu_cookie_compliance.disagree_do_not_show_popup) { Drupal.eu_cookie_compliance.setStatus(0); if (drupalSettings.eu_cookie_compliance.withdraw_enabled && drupalSettings.eu_cookie_compliance.withdraw_button_on_info_popup) { $('#sliding-popup .eu-cookie-compliance-banner').trigger('eu_cookie_compliance_popup_close').hide(); } else { $('#sliding-popup').trigger('eu_cookie_compliance_popup_close').remove(); } } else { if (drupalSettings.eu_cookie_compliance.popup_link_new_window) { window.open(drupalSettings.eu_cookie_compliance.popup_link); } else { window.location.href = drupalSettings.eu_cookie_compliance.popup_link; } } }; Drupal.eu_cookie_compliance.getCurrentStatus = function () { var cookieName = (typeof drupalSettings.eu_cookie_compliance.cookie_name === 'undefined' || drupalSettings.eu_cookie_compliance.cookie_name === '') ? 'cookie-agreed' : drupalSettings.eu_cookie_compliance.cookie_name; var value = $.cookie(cookieName); value = parseInt(value); if (isNaN(value)) { value = null; } return value; }; Drupal.eu_cookie_compliance.setPreferenceCheckboxes = function (categories) { for (var i in categories) { $("#eu-cookie-compliance-categories input:checkbox[value='" + categories[i] + "']").prop("checked", true); } } Drupal.eu_cookie_compliance.getAcceptedCategories = function () { var allCategories = drupalSettings.eu_cookie_compliance.cookie_categories; var cookieName = (typeof drupalSettings.eu_cookie_compliance.cookie_name === 'undefined' || drupalSettings.eu_cookie_compliance.cookie_name === '') ? 'cookie-agreed-categories' : drupalSettings.eu_cookie_compliance.cookie_name + '-categories'; var value = $.cookie(cookieName); var selectedCategories = []; if (value !== null && typeof value !== 'undefined') { value = JSON.parse(value); selectedCategories = value; } if (Drupal.eu_cookie_compliance.fix_first_cookie_category && !$.inArray(allCategories[0], selectedCategories)) { selectedCategories.push(allCategories[0]); } return selectedCategories; }; Drupal.eu_cookie_compliance.changeStatus = function (value) { var status = Drupal.eu_cookie_compliance.getCurrentStatus(); var reloadPage = drupalSettings.eu_cookie_compliance.reload_page; if (status === value) { return; } if (drupalSettings.eu_cookie_compliance.popup_position) { $('.sliding-popup-top').animate({ top: !drupalSettings.eu_cookie_compliance.fixed_top_position ? -(parseInt($('body').css('padding-top')) + parseInt($('body').css('margin-top')) + $('#sliding-popup').outerHeight()) : $('#sliding-popup').outerHeight() * -1 }, drupalSettings.eu_cookie_compliance.popup_delay, function () { if (value === 1 && status === null && !reloadPage) { $('.sliding-popup-top').not('.eu-cookie-withdraw-wrapper').html(drupalSettings.eu_cookie_compliance.popup_html_agreed).animate({ top: !drupalSettings.eu_cookie_compliance.fixed_top_position ? -(parseInt($('body').css('padding-top')) + parseInt($('body').css('margin-top'))) : 0 }, drupalSettings.eu_cookie_compliance.popup_delay); Drupal.eu_cookie_compliance.attachHideEvents(); } else if (status === 1 && !(drupalSettings.eu_cookie_compliance.withdraw_enabled && drupalSettings.eu_cookie_compliance.withdraw_button_on_info_popup)) { $('.sliding-popup-top').not('.eu-cookie-withdraw-wrapper').trigger('eu_cookie_compliance_popup_close').remove(); } Drupal.eu_cookie_compliance.showWithdrawBanner(value); }); } else { $('.sliding-popup-bottom').animate({ bottom: $('#sliding-popup').outerHeight() * -1 }, drupalSettings.eu_cookie_compliance.popup_delay, function () { if (value === 1 && status === null && !reloadPage) { $('.sliding-popup-bottom').not('.eu-cookie-withdraw-wrapper').html(drupalSettings.eu_cookie_compliance.popup_html_agreed).animate({ bottom: 0 }, drupalSettings.eu_cookie_compliance.popup_delay); Drupal.eu_cookie_compliance.attachHideEvents(); } else if (status === 1) { if (drupalSettings.eu_cookie_compliance.withdraw_enabled && drupalSettings.eu_cookie_compliance.withdraw_button_on_info_popup) { // Restore popup content. if (window.matchMedia('(max-width: ' + drupalSettings.eu_cookie_compliance.mobile_breakpoint + 'px)').matches && drupalSettings.eu_cookie_compliance.use_mobile_message) { $('.sliding-popup-bottom').not('.eu-cookie-withdraw-wrapper').html(drupalSettings.eu_cookie_compliance.mobile_popup_html_info); } else { $('.sliding-popup-bottom').not('.eu-cookie-withdraw-wrapper').html(drupalSettings.eu_cookie_compliance.popup_html_info); } Drupal.eu_cookie_compliance.initPopup(); } else { $('.sliding-popup-bottom').not('.eu-cookie-withdraw-wrapper').trigger('eu_cookie_compliance_popup_close').remove(); } } Drupal.eu_cookie_compliance.showWithdrawBanner(value); }); } if (drupalSettings.eu_cookie_compliance.reload_page) { location.reload(); } Drupal.eu_cookie_compliance.setStatus(value); }; Drupal.eu_cookie_compliance.showWithdrawBanner = function (value) { if (value === 2 && drupalSettings.eu_cookie_compliance.withdraw_enabled) { if (!drupalSettings.eu_cookie_compliance.withdraw_button_on_info_popup) { Drupal.eu_cookie_compliance.createWithdrawBanner(drupalSettings.eu_cookie_compliance.withdraw_markup); } Drupal.eu_cookie_compliance.attachWithdrawEvents(); } }; Drupal.eu_cookie_compliance.setStatus = function (status) { var date = new Date(); var domain = drupalSettings.eu_cookie_compliance.domain ? drupalSettings.eu_cookie_compliance.domain : ''; var path = drupalSettings.eu_cookie_compliance.domain_all_sites ? '/' : drupalSettings.path.baseUrl; var cookieName = (typeof drupalSettings.eu_cookie_compliance.cookie_name === 'undefined' || drupalSettings.eu_cookie_compliance.cookie_name === '') ? 'cookie-agreed' : drupalSettings.eu_cookie_compliance.cookie_name; if (path.length > 1) { var pathEnd = path.length - 1; if (path.lastIndexOf('/') === pathEnd) { path = path.substring(0, pathEnd); } } var cookie_session = parseInt(drupalSettings.eu_cookie_compliance.cookie_session); if (cookie_session) { $.cookie(cookieName, status, { path: path, domain: domain }); } else { var lifetime = parseInt(drupalSettings.eu_cookie_compliance.cookie_lifetime); date.setDate(date.getDate() + lifetime); $.cookie(cookieName, status, { expires: date, path: path, domain: domain }); } $(document).trigger('eu_cookie_compliance.changeStatus', [status]); // Store consent if applicable. if (drupalSettings.eu_cookie_compliance.store_consent && ((status === 1 && drupalSettings.eu_cookie_compliance.popup_agreed_enabled) || (status === 2 && !drupalSettings.eu_cookie_compliance.popup_agreed_enabled))) { var url = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + 'eu-cookie-compliance/store_consent/banner'; $.post(url, {}, function (data) { }); } }; Drupal.eu_cookie_compliance.setAcceptedCategories = function (categories) { var date = new Date(); var domain = drupalSettings.eu_cookie_compliance.domain ? drupalSettings.eu_cookie_compliance.domain : ''; var path = drupalSettings.eu_cookie_compliance.domain_all_sites ? '/' : drupalSettings.path.baseUrl; var cookieName = (typeof drupalSettings.eu_cookie_compliance.cookie_name === 'undefined' || drupalSettings.eu_cookie_compliance.cookie_name === '') ? 'cookie-agreed-categories' : drupalSettings.eu_cookie_compliance.cookie_name + '-categories'; if (path.length > 1) { var pathEnd = path.length - 1; if (path.lastIndexOf('/') === pathEnd) { path = path.substring(0, pathEnd); } } var categoriesString = JSON.stringify(categories); var cookie_session = parseInt(drupalSettings.eu_cookie_compliance.cookie_session); if (cookie_session) { $.cookie(cookieName, categoriesString, { path: path, domain: domain }); } else { var lifetime = parseInt(drupalSettings.eu_cookie_compliance.cookie_lifetime); date.setDate(date.getDate() + lifetime); $.cookie(cookieName, categoriesString, { expires: date, path: path, domain: domain }); } $(document).trigger('eu_cookie_compliance.changePreferences', [categories]); // TODO: Store categories with consent if applicable? }; Drupal.eu_cookie_compliance.hasAgreed = function (category) { var status = Drupal.eu_cookie_compliance.getCurrentStatus(); var agreed = (status === 1 || status === 2); if(category !== undefined && agreed) { agreed = Drupal.eu_cookie_compliance.hasAgreedWithCategory(category); } return agreed; }; Drupal.eu_cookie_compliance.hasAgreedWithCategory = function(category) { var allCategories = drupalSettings.eu_cookie_compliance.cookie_categories; var agreedCategories = Drupal.eu_cookie_compliance.getAcceptedCategories(); if (drupalSettings.eu_cookie_compliance.fix_first_cookie_category && category === allCategories[0]) { return true; } return $.inArray(category, agreedCategories) !== -1; }; Drupal.eu_cookie_compliance.showBanner = function () { var showBanner = false; var status = Drupal.eu_cookie_compliance.getCurrentStatus(); if ((status === 0 && drupalSettings.eu_cookie_compliance.method === 'default') || status === null) { if (!drupalSettings.eu_cookie_compliance.disagree_do_not_show_popup || status === null) { showBanner = true; } } else if (status === 1 && drupalSettings.eu_cookie_compliance.popup_agreed_enabled) { showBanner = true; } return showBanner; }; Drupal.eu_cookie_compliance.cookiesEnabled = function () { var cookieEnabled = (navigator.cookieEnabled); if (typeof navigator.cookieEnabled === 'undefined' && !cookieEnabled) { $.cookie('testcookie', 'testcookie', { expires: 100 }); cookieEnabled = ($.cookie('testcookie').indexOf('testcookie') !== -1); } return (cookieEnabled); }; Drupal.eu_cookie_compliance.isWhitelisted = function (cookieName) { // Skip the PHP session cookie. if (cookieName.indexOf('SESS') === 0 || cookieName.indexOf('SSESS') === 0) { return true; } // Split the white-listed cookies. var euCookieComplianceWhitelist = drupalSettings.eu_cookie_compliance.whitelisted_cookies.split(/\r\n|\n|\r/g); // Add the EU Cookie Compliance cookie. euCookieComplianceWhitelist.push((typeof drupalSettings.eu_cookie_compliance.cookie_name === 'undefined' || drupalSettings.eu_cookie_compliance.cookie_name === '') ? 'cookie-agreed' : drupalSettings.eu_cookie_compliance.cookie_name); euCookieComplianceWhitelist.push((typeof drupalSettings.eu_cookie_compliance.cookie_name === 'undefined' || drupalSettings.eu_cookie_compliance.cookie_name === '') ? 'cookie-agreed-categories' : drupalSettings.eu_cookie_compliance.cookie_name + '-categories'); // Check if the cookie is white-listed. for (var item in euCookieComplianceWhitelist) { if (cookieName === euCookieComplianceWhitelist[item]) { return true; } // Handle cookie names that are prefixed with a category. if (drupalSettings.eu_cookie_compliance.method === 'categories') { var separatorPos = euCookieComplianceWhitelist[item].indexOf(":"); if (separatorPos !== -1) { var category = euCookieComplianceWhitelist[item].substr(0, separatorPos); var wlCookieName = euCookieComplianceWhitelist[item].substr(separatorPos + 1); if (wlCookieName === cookieName && Drupal.eu_cookie_compliance.hasAgreedWithCategory(category)) { return true; } } } } return false; } // Load blocked scripts if the user has agreed to being tracked. var euCookieComplianceHasLoadedScripts = false; var euCookieComplianceHasLoadedScriptsForCategory = []; $(function () { if (Drupal.eu_cookie_compliance.hasAgreed() || (Drupal.eu_cookie_compliance.getCurrentStatus() === null && drupalSettings.eu_cookie_compliance.method !== 'opt_in' && drupalSettings.eu_cookie_compliance.method !== 'categories') ) { if (typeof euCookieComplianceLoadScripts === "function") { euCookieComplianceLoadScripts(); } euCookieComplianceHasLoadedScripts = true; if (drupalSettings.eu_cookie_compliance.method === 'categories') { var acceptedCategories = Drupal.eu_cookie_compliance.getAcceptedCategories(); Drupal.eu_cookie_compliance.loadCategoryScripts(acceptedCategories); } } }); // Block cookies when the user hasn't agreed. if ((drupalSettings.eu_cookie_compliance.method === 'opt_in' && (Drupal.eu_cookie_compliance.getCurrentStatus() === null || !Drupal.eu_cookie_compliance.hasAgreed())) || (drupalSettings.eu_cookie_compliance.method === 'opt_out' && !Drupal.eu_cookie_compliance.hasAgreed() && Drupal.eu_cookie_compliance.getCurrentStatus() !== null) || (drupalSettings.eu_cookie_compliance.method === 'categories') ) { var euCookieComplianceBlockCookies = setInterval(function () { // Load all cookies from jQuery. var cookies = $.cookie(); // Check each cookie and try to remove it if it's not white-listed. for (var i in cookies) { var remove = true; var hostname = window.location.hostname; var cookieRemoved = false; var index = 0; remove = !Drupal.eu_cookie_compliance.isWhitelisted(i); // Remove the cookie if it's not white-listed. if (remove) { while (!cookieRemoved && hostname !== '') { // Attempt to remove. cookieRemoved = $.removeCookie(i, { domain: '.' + hostname, path: '/' }); if (!cookieRemoved) { cookieRemoved = $.removeCookie(i, { domain: hostname, path: '/' }); } index = hostname.indexOf('.'); // We can be on a sub-domain, so keep checking the main domain as well. hostname = (index === -1) ? '' : hostname.substring(index + 1); } // Some jQuery Cookie versions don't remove cookies well. Try again // using plain js. if (!cookieRemoved) { document.cookie = i + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/;'; } } } }, 5000); } })(jQuery, Drupal, drupalSettings); ; (function ($, Drupal, drupalSettings) { "use strict"; Drupal.behaviors.magnific_popup = { attach: function (context, settings) { // Gallery. $(context).find('.mfp-all-items, .mfp-first-item, .mfp-random-item').once('mfp-processed').each( function() { $(this).magnificPopup({ delegate: 'a', type: 'image', gallery: { enabled: true }, image: { titleSrc: function (item) { return item.img.attr('alt') || ''; } } }); }); // Separate items. $(context).find('.mfp-separate-items').once('mfp-processed').each(function () { $(this).magnificPopup({ delegate: 'a', type: 'image', image: { titleSrc: function (item) { return item.img.attr('alt') || ''; } } }); }); } }; })(jQuery, Drupal, drupalSettings); ; /*! Magnific Popup - v1.1.0 - 2016-02-20 * http://dimsemenov.com/plugins/magnific-popup/ * Copyright (c) 2016 Dmitry Semenov; */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("
");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});;