PageSourceSearch

https://www.greenhatgin.com/wp-content/themes/GHG/dist/scripts/main.js

js greenhatgin.com collected 2026-10-02 10:31:01 UTC 58,673 bytes, 1,543 lines download raw bytes

vendor: 5,264 bytes, lines 1-134
1/******/ (function(modules) { // webpackBootstrap
2/******/ 	// The module cache
3/******/ 	var installedModules = {};
4/******/
5/******/ 	// The require function
6/******/ 	function __webpack_require__(moduleId) {
7/******/
8/******/ 		// Check if module is in cache
9/******/ 		if(installedModules[moduleId]) {
10/******/ 			return installedModules[moduleId].exports;
11/******/ 		}
12/******/ 		// Create a new module (and put it into the cache)
13/******/ 		var module = installedModules[moduleId] = {
14/******/ 			i: moduleId,
15/******/ 			l: false,
16/******/ 			exports: {}
17/******/ 		};
18/******/
19/******/ 		// Execute the module function
20/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ 		// Flag the module as loaded
23/******/ 		module.l = true;
24/******/
25/******/ 		// Return the exports of the module
26/******/ 		return module.exports;
27/******/ 	}
28/******/
29/******/
30/******/ 	// expose the modules object (__webpack_modules__)
31/******/ 	__webpack_require__.m = modules;
32/******/
33/******/ 	// expose the module cache
34/******/ 	__webpack_require__.c = installedModules;
35/******/
36/******/ 	// define getter function for harmony exports
37/******/ 	__webpack_require__.d = function(exports, name, getter) {
38/******/ 		if(!__webpack_require__.o(exports, name)) {
39/******/ 			Object.defineProperty(exports, name, {
40/******/ 				configurable: false,
41/******/ 				enumerable: true,
42/******/ 				get: getter
43/******/ 			});
44/******/ 		}
45/******/ 	};
46/******/
47/******/ 	// getDefaultExport function for compatibility with non-harmony modules
48/******/ 	__webpack_require__.n = function(module) {
49/******/ 		var getter = module && module.__esModule ?
50/******/ 			function getDefault() { return module['default']; } :
51/******/ 			function getModuleExports() { return module; };
52/******/ 		__webpack_require__.d(getter, 'a', getter);
53/******/ 		return getter;
54/******/ 	};
55/******/
56/******/ 	// Object.prototype.hasOwnProperty.call
57/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58/******/
59/******/ 	// __webpack_public_path__
60/******/ 	__webpack_require__.p = "/wp-content/themes/GHG/dist/";
61/******/
62/******/ 	// Load entry module and return exports
63/******/ 	return __webpack_require__(__webpack_require__.s = 1);
64/******/ })
65/************************************************************************/
66/******/ ([
67/* 0 */
68/***/ (function(module, exports) {
69
70module.exports = jQuery;
71
72/***/ }),
73/* 1 */
74/***/ (function(module, exports, __webpack_require__) {
75
76__webpack_require__(2);
77module.exports = __webpack_require__(10);
78
79
80/***/ }),
81/* 2 */
82/***/ (function(module, __webpack_exports__, __webpack_require__) {
83
84"use strict";
85Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
86/* WEBPACK VAR INJECTION */(function(jQuery, $) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
87/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
88/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery_popup_overlay__ = __webpack_require__(3);
89/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery_popup_overlay___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery_popup_overlay__);
90/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sal_js__ = __webpack_require__(5);
91/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sal_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_sal_js__);
92/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_Router__ = __webpack_require__(6);
93/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__routes_common__ = __webpack_require__(8);
94function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
95
96function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
97
98function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
99
100// import external dependencies
101
102
103/*import Rellax from 'rellax';*/
104
105 // import local dependencies
106
107
108
109/** Populate Router instance with DOM routes */
110
111var routes = new __WEBPACK_IMPORTED_MODULE_3__util_Router__["a" /* default */]({
112  // All pages
113  common: __WEBPACK_IMPORTED_MODULE_4__routes_common__["a" /* default */]
114}); // Load Events
115
116jQuery(document).ready(function () {
117  return routes.loadEvents();
118}); //Animation trigger
119
120__WEBPACK_IMPORTED_MODULE_2_sal_js___default()();
121document.addEventListener('sal:out', function (_ref) {
122  var detail = _ref.detail;
123
124  /*eslint-disable */
125  console.log('exiting', detail.target);
126  /*eslint-enable */
127});
128
129var mainNav = /*#__PURE__*/function () {
130  function mainNav(elm) {
131    _classCallCheck(this, mainNav);
132
133    this.elm = elm;
134    this.isOpened = false;
135    this.isAnimating = false;
136  }
137
138  _createClass(mainNav, [{
139    key: "toggle",
140    value: function toggle() {
141      this.isAnimating = true;
142
143      if (this.isOpened === false) {
144        this.open();
145      } else {
146        this.close();
147      }
148    }
149  }, {
150    key: "open",
151    value: function open() {
152      this.isOpened = true;
153      this.elm.classList.add('is-opened');
154    }
155  }, {
156    key: "close",
157    value: function close() {
158      this.isOpened = false;
159      this.elm.classList.remove('is-opened');
160    }
161  }]);
162
163  return mainNav;
164}();
165
166(function () {
167  var elmHamburger = document.querySelector('.hamburger');
168  var gNavItems = document.querySelectorAll('.c-menu__list li');
169  var elmOverlay = document.querySelector('.c-menu__list');
170  var overlay = new mainNav(elmOverlay);
171  elmHamburger.addEventListener('click', function () {
172    overlay.toggle();
173
174    if (overlay.isOpened === true) {
175      elmHamburger.classList.add('is-opened-navi');
176
177      for (var i = 0; i < gNavItems.length; i++) {
178        gNavItems[i].classList.add('is-opened');
179      }
180    } else {
181      elmHamburger.classList.remove('is-opened-navi');
182
183      for (var int = 0; int < gNavItems.length; int++) {
184        gNavItems[int].classList.remove('is-opened');
185      }
186    }
187  });
188})();
189
190function initYouTubeVideos() {
191  var youtube = document.querySelectorAll(".youtube");
192
193  for (var i = 0; i < youtube.length; i++) {
194    // thumbnail image source.
195    var source = "https://img.youtube.com/vi/" + youtube[i].dataset.embed + "/maxresdefault.jpg";
196
197    if (youtube[i].dataset.thumbnail) {
198      var overrideThumbnailSrc = youtube[i].dataset.thumbnail;
199    }
200
201    if (youtube[i].dataset.windowtarget == "_blank") {
202      var openInNewWindow = youtube[i].dataset.windowtarget;
203    } // Load the image asynchronously
204
205
206    var image = new Image();
207
208    if (overrideThumbnailSrc) {
209      image.src = overrideThumbnailSrc;
210    } else {
211      image.src = source;
212    }
213
214    image.addEventListener("load", function () {
215      youtube[i].appendChild(image);
216    }(i));
217    youtube[i].addEventListener("click", function () {
218      if (openInNewWindow) {
219        window.open("https://www.youtube.com/watch?v=" + this.dataset.embed);
220      } else {
221        var iframe = document.createElement("iframe");
222        iframe.setAttribute("frameborder", "0");
223        iframe.setAttribute("allowfullscreen", "");
224        iframe.setAttribute("src", "https://www.youtube.com/embed/" + this.dataset.embed + "?rel=0&showinfo=0&autoplay=1");
225        this.innerHTML = "";
226        this.appendChild(iframe);
227      }
228    });
229  }
230}
231
232$(document).ready(function () {
233  // Initialize the plugin
234  $('.o-popup-overlay').popup({
235    opacity: 0.95,
236    color: 'rgba(0,0,0,0)',
237    transition: '0s',
238    autozindex: true,
239    horizontal: 'center',
240    vertical: 'center',
241    scrolllock: true,
242    onopen: function onopen() {
243      $(this).addClass('active').removeClass('inactive');
244    },
245    onclose: function onclose() {
246      $(this).removeClass('active').addClass('inactive');
247      $('.youtube iframe, .youtube img, .youtube .play-button').remove();
248      $('.youtube').append('<div class="play-button"></div>');
249      initYouTubeVideos();
250    }
251  });
252  initYouTubeVideos();
253});
254$(function () {
255  var urlHash = window.location.hash;
256
257  if (urlHash && urlHash.indexOf('gin-rickey') == 1 || urlHash.indexOf('gin-rickey') != -1) {
258    $('#video_recipe_1').popup('show');
259  }
260
261  if (urlHash && urlHash.indexOf('summer-spritz') == 1 || urlHash.indexOf('summer-spritz') != -1) {
262    $('#video_recipe_2').popup('show');
263  }
264
265  if (urlHash && urlHash.indexOf('negroni') == 1 || urlHash.indexOf('negroni') != -1) {
266    $('#video_recipe_3').popup('show');
267  }
268
269  if (urlHash && urlHash.indexOf('fitzgerald') == 1 || urlHash.indexOf('fitzgerald') != -1) {
270    $('#video_recipe_4').popup('show');
271  }
272});
273/*$(function() {
274  new Rellax('.rellax-background', {
275    speed: -1,
276    center: true,
277    round: true,
278    vertical: true,
279    horizontal: false,
280    breakpoints: [440, 850, 1200],
281    wrapper: null,
282  });
283  new Rellax('.rellax-object', {
284    breakpoints: [440, 850, 1200],
285  });
286});*/
287/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0), __webpack_require__(0)))
288
289/***/ }),
290/* 3 */
291/***/ (function(module, exports, __webpack_require__) {
292
293/* WEBPACK VAR INJECTION */(function(jQuery) {/* eslint-disable */
294if (!jQuery) {
295    console.log('jquery.popupoverlay - jQuery not defined.');
296}
297__webpack_require__(4);
298/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
299
300/***/ }),
301/* 4 */
302/***/ (function(module, exports, __webpack_require__) {
303
304/* WEBPACK VAR INJECTION */(function(jQuery) {/*!
305 * jQuery Popup Overlay
306 *
307 * @requires jQuery v1.7.1+
308 * @link https://vast-engineering.github.com/jquery-popup-overlay/
309 */
310;(function ($) { /* eslint-disable-line */
311
312    var $window = $(window);
313    var options = {};
314    var zindexvalues = [];
315    var lastclicked = [];
316    var scrollbarwidth;
317    var bodymarginright = null;
318    var opensuffix = '_open';
319    var closesuffix = '_close';
320    var visiblePopupsArray = [];
321    var transitionsupport = null;
322    var opentimer;
323    var iOS = /(iPad|iPhone|iPod)/.test(navigator.userAgent);
324    var focusableElementsString = "a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]";
325
326    var methods = {
327
328        _init: function (el) {
329            var $el = $(el);
330            var options = $el.data('popupoptions');
331            lastclicked[el.id] = false;
332            zindexvalues[el.id] = 0;
333
334            if (!$el.data('popup-initialized')) {
335                $el.attr('data-popup-initialized', 'true');
336                methods._initonce(el);
337            }
338
339            if (options.autoopen) {
340                setTimeout(function() {
341                    methods.show(el, 0);
342                }, 0);
343            }
344        },
345
346        _initonce: function (el) {
347            var $el = $(el);
348            var $body = $('body');
349            var $wrapper;
350            var options = $el.data('popupoptions');
351
352            bodymarginright = parseInt($body.css('margin-right'), 10);
353            transitionsupport = document.body.style.webkitTransition !== undefined ||
354                                document.body.style.MozTransition !== undefined ||
355                                document.body.style.msTransition !== undefined ||
356                                document.body.style.OTransition !== undefined ||
357                                document.body.style.transition !== undefined;
358
359            if (options.scrolllock) {
360                // Calculate the browser's scrollbar width dynamically
361                var parent;
362                var child;
363                if (typeof scrollbarwidth === 'undefined') {
364                    parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body');
365                    child = parent.children();
366                    scrollbarwidth = child.innerWidth() - child.height(99).innerWidth();
367                    parent.remove();
368                }
369            }
370
371            if (!$el.attr('id')) {
372                $el.attr('id', 'j-popup-' + parseInt((Math.random() * 100000000), 10));
373            }
374
375            $el.addClass('popup_content');
376
377            if ((options.background) && (!$('#' + el.id + '_background').length)) {
378
379                $body.append('<div id="' + el.id + '_background" class="popup_background"></div>');
380
381                var $background = $('#' + el.id + '_background');
382
383                $background.css({
384                    opacity: 0,
385                    visibility: 'hidden',
386                    backgroundColor: options.color,
387                    position: 'fixed',
388                    top: 0,
389                    right: 0,
390                    bottom: 0,
391                    left: 0
392                });
393
394                if (options.setzindex && !options.autozindex) {
395                    $background.css('z-index', '100000');
396                }
397
398                if (options.transition) {
399                    $background.css('transition', options.transition);
400                }
401            }
402
403            $body.append(el);
404
405            $el.wrap('<div id="' + el.id + '_wrapper" class="popup_wrapper" />');
406
407            $wrapper = $('#' + el.id + '_wrapper');
408
409            $wrapper.css({
410                opacity: 0,
411                visibility: 'hidden',
412                position: 'absolute'
413            });
414
415            // Make div clickable in iOS
416            if (iOS) {
417                $background = $('#' + el.id + '_background');
418                $background.css('cursor', 'pointer');
419                $(options.pagecontainer).css('cursor', 'pointer');
420            }
421
422            if (options.type == 'overlay' && !options.absolute && options.background) {
423                $wrapper.css('overflow','auto');
424                $wrapper[0].style.WebkitOverflowScrolling = 'touch'; // for smooth scrolling in overflow:auto divs in iOS
425            }
426
427            $el.css({
428                opacity: 0,
429                visibility: 'hidden',
430                'pointer-events': 'auto', // reset pointer events back to default for a child element
431                display: 'inline-block'
432            });
433
434            if (options.setzindex && !options.autozindex) {
435                $wrapper.css('z-index', '100001');
436            }
437
438            if (!options.outline) {
439                $el.css('outline', 'none');
440            }
441
442            if (options.transition) {
443                $el.css('transition', options.transition);
444                $wrapper.css('transition', options.transition);
445            }
446
447            // Hide popup content from screen readers initially
448            $el.attr('aria-hidden', true);
449
450            if (options.type == 'overlay') {
451                $el.css({
452                    textAlign: 'left',
453                    position: 'relative',
454                    verticalAlign: 'middle'
455                });
456
457                $wrapper.css({
458                    position: 'fixed',
459                    width: '100%',
460                    height: '100%',
461                    top: 0,
462                    left: 0,
463                    textAlign: 'center'
464                });
465
466                // CSS vertical align helper
467                $wrapper.append('<div class="popup_align" />');
468
469                $('.popup_align').css({
470                    display: 'inline-block',
471                    verticalAlign: 'middle',
472                    height: '100%'
473                });
474            }
475
476            // Add WAI ARIA role to announce dialog to screen readers
477            $el.attr('role', 'dialog');
478
479            var openelement =  (options.openelement) ? options.openelement : ('.' + el.id + opensuffix);
480
481            $(openelement).each(function (i, item) {
482                $(item).attr('data-popup-ordinal', i);
483
484                if (!item.id) {
485                    $(item).attr('id', 'open_' + parseInt((Math.random() * 100000000), 10));
486                }
487            });
488
489            // Set aria-labelledby (if aria-label or aria-labelledby is not set in html)
490            if (!($el.attr('aria-labelledby') || $el.attr('aria-label'))) {
491                $el.attr('aria-labelledby', $(openelement).attr('id'));
492            }
493
494            // Show and hide tooltips on hover
495            if(options.action == 'hover'){
496                options.keepfocus = false;
497
498                // Handler: mouseenter, focusin
499                $(openelement).on('mouseenter', function () {
500                    methods.show(el, $(this).data('popup-ordinal'));
501                });
502
503                // Handler: mouseleave, focusout
504                $(openelement).on('mouseleave', function () {
505                    methods.hide(el);
506                });
507
508            } else {
509
510                // Handler: Show popup when clicked on `open` element
511                $(document).on('click.jqp', openelement, function (event) {
512                    event.preventDefault();
513
514                    var ord = $(this).data('popup-ordinal');
515                    setTimeout(function() { // setTimeout is to allow `close` method to finish (for issues with multiple tooltips)
516                        methods.show(el, ord);
517                    }, 0);
518                });
519            }
520
521            if (options.closebutton) {
522                methods.addclosebutton(el);
523            }
524
525            if (options.detach) {
526                $el.detach();
527            } else {
528                $el.hide();
529            }
530        },
531
532        /**
533         * Show method
534         *
535         * @param {object} el - popup instance DOM node
536         * @param {number} ordinal - order number of an `open` element
537         */
538        show: function (el, ordinal) {
539            var $el = $(el);
540
541            if ($el.data('popup-visible')) return;
542
543            // Initialize if not initialized. Required for: $('#popup').popup('show')
544            if (!$el.data('popup-initialized')) {
545                methods._init(el);
546            }
547            $el.attr('data-popup-initialized', 'true');
548
549            var $body = $('body');
550            var options = $el.data('popupoptions');
551            var $wrapper = $('#' + el.id + '_wrapper');
552            var $background = $('#' + el.id + '_background');
553
554            // `beforeopen` callback event
555            callback(el, ordinal, options.beforeopen);
556
557            // Remember last clicked place
558            lastclicked[el.id] = ordinal;
559
560            // Add popup id to visiblePopupsArray
561            setTimeout(function() {
562                visiblePopupsArray.push(el.id);
563            }, 0);
564
565            // Calculating maximum z-index
566            if (options.autozindex) {
567
568                var elements = document.getElementsByTagName('*');
569                var len = elements.length;
570                var maxzindex = 0;
571
572                for(var i=0; i<len; i++){
573
574                    var elementzindex = $(elements[i]).css('z-index');
575
576                    if(elementzindex !== 'auto'){
577
578                      elementzindex = parseInt(elementzindex, 10);
579
580                      if(maxzindex < elementzindex){
581                        maxzindex = elementzindex;
582                      }
583                    }
584                }
585
586                zindexvalues[el.id] = maxzindex;
587
588                // Add z-index to the background
589                if (options.background) {
590                    if (zindexvalues[el.id] >= 0) {
591                        $('#' + el.id + '_background').css({
592                            zIndex: (zindexvalues[el.id] + 1)
593                        });
594                    }
595                }
596
597                // Add z-index to the wrapper
598                if (zindexvalues[el.id] >= 0) {
599                    $wrapper.css({
600                        zIndex: (zindexvalues[el.id] + 2)
601                    });
602                }
603            }
604
605            if (options.detach) {
606                $wrapper.prepend(el);
607                $el.show();
608            } else {
609                $el.show();
610            }
611
612            opentimer = setTimeout(function() {
613                $wrapper.css({
614                    visibility: 'visible',
615                    opacity: 1
616                });
617
618                $('html').addClass('popup_visible').addClass('popup_visible_' + el.id);
619                $wrapper.addClass('popup_wrapper_visible');
620            }, 20); // 20ms required for opening animation to occur in FF
621
622            // Disable background layer scrolling when popup is opened
623            if (options.scrolllock) {
624                $body.css('overflow', 'hidden');
625                if ($body.height() > $window.height()) {
626                    $body.css('margin-right', bodymarginright + scrollbarwidth);
627                }
628            }
629
630            $el.css({
631                'visibility': 'visible',
632                'opacity': 1
633            });
634
635            // Show background
636            if (options.background) {
637                $background.css({
638                    'visibility': 'visible',
639                    'opacity': options.opacity
640                });
641
642                // Fix IE8 issue with background not appearing
643                setTimeout(function() {
644                    $background.css({
645                        'opacity': options.opacity
646                    });
647                }, 0);
648            }
649
650            $el.data('popup-visible', true);
651
652            // Position popup
653            methods.reposition(el, ordinal);
654
655            // Remember which element had focus before opening a popup
656            $el.data('focusedelementbeforepopup', document.activeElement);
657
658            // Make holder div programatically focusable with tabindex:-1 (tabindex:0 is keyboard focusable)
659            $el.attr('tabindex', -1);
660
661            // Focus the popup or user specified element.
662            // Initial timeout of 50ms is set to give some time to popup to show after clicking on
663            // `open` element, and after animation is complete to prevent background scrolling.
664            setTimeout(function() {
665                if (options.focuselement === 'closebutton') { // e.g. focuselement:'closebutton'
666                    $('#' + el.id + ' .' + el.id + closesuffix + ':first').focus();
667                } else if (options.focuselement) { // e.g. focuselement:'#my-close-button'
668                    $(options.focuselement).focus();
669                } else if (options.focuselement === true || options.keepfocus) { // e.g. focuselement:true OR keepfocus:true
670                    $el.focus();
671                }
672            }, options.focusdelay);
673
674            // Hide main content from screen readers
675            if (options.keepfocus) {
676                $(options.pagecontainer).attr('aria-hidden', true);
677            }
678
679            // Reveal popup content to screen readers
680            $el.attr('aria-hidden', false);
681
682            callback(el, ordinal, options.onopen);
683
684            if (transitionsupport) {
685                $wrapper.one('transitionend', function() {
686                    callback(el, ordinal, options.opentransitionend);
687                });
688            } else {
689                callback(el, ordinal, options.opentransitionend);
690            }
691
692            // Handler: Reposition tooltip when window is resized
693            if (options.type == 'tooltip') {
694                $(window).on('resize.' + el.id, function () {
695                    methods.reposition(el, ordinal);
696                });
697            }
698        },
699
700        /**
701         * Hide method
702         *
703         * @param object el - popup instance DOM node
704         * @param boolean outerClick - click on the outer content below popup
705         */
706        hide: function (el, outerClick) {
707            // Get index of popup ID inside of visiblePopupsArray
708            var popupIdIndex = $.inArray(el.id, visiblePopupsArray);
709
710            // If popup is not opened, ignore the rest of the function
711            if (popupIdIndex === -1) {
712                return;
713            }
714
715            if(opentimer) clearTimeout(opentimer);
716
717            var $body = $('body');
718            var $el = $(el);
719            var options = $el.data('popupoptions');
720            var $wrapper = $('#' + el.id + '_wrapper');
721            var $background = $('#' + el.id + '_background');
722
723            $el.data('popup-visible', false);
724
725            if (visiblePopupsArray.length === 1) {
726                $('html').removeClass('popup_visible').removeClass('popup_visible_' + el.id);
727            } else {
728                if($('html').hasClass('popup_visible_' + el.id)) {
729                    $('html').removeClass('popup_visible_' + el.id);
730                }
731            }
732
733            // Remove popup from the visiblePopupsArray
734            visiblePopupsArray.splice(popupIdIndex, 1);
735
736            if($wrapper.hasClass('popup_wrapper_visible')) {
737                $wrapper.removeClass('popup_wrapper_visible');
738            }
739
740            // Focus back on saved element
741            if (options.keepfocus && !outerClick) {
742                setTimeout(function() {
743                    if ($($el.data('focusedelementbeforepopup')).is(':visible')) {
744                        $el.data('focusedelementbeforepopup').focus();
745                    }
746                }, 0);
747            }
748
749            // Hide popup
750            $wrapper.css({
751                'visibility': 'hidden',
752                'opacity': 0
753            });
754            $el.css({
755                'visibility': 'hidden',
756                'opacity': 0
757            });
758
759            // Hide background
760            if (options.background) {
761                $background.css({
762                    'visibility': 'hidden',
763                    'opacity': 0
764                });
765            }
766
767            // Reveal main content to screen readers
768            $(options.pagecontainer).attr('aria-hidden', false);
769
770            // Hide popup content from screen readers
771            $el.attr('aria-hidden', true);
772
773            // `onclose` callback event
774            callback(el, lastclicked[el.id], options.onclose);
775
776            if (transitionsupport && $el.css('transition-duration') !== '0s') {
777                $el.one('transitionend', function() {
778
779                    if (!($el.data('popup-visible'))) {
780                        if (options.detach) {
781                            $el.detach();
782                        } else {
783                            $el.hide();
784                        }
785                    }
786
787                    // Re-enable scrolling of background layer, if needed
788                    if (options.scrolllock) {
789                        setTimeout(function() {
790                            if ($.grep(visiblePopupsArray, function(eid) { return $("#"+eid).data('popupoptions').scrolllock }).length) {
791                                // Some "scolllock=true" popup is currently visible, leave scrolling disabled
792                                return;
793                            }
794                            $body.css({
795                                overflow: 'visible',
796                                'margin-right': bodymarginright
797                            });
798                        }, 10); // 10ms added for CSS transition in Firefox which doesn't like overflow:auto
799                    }
800
801                    callback(el, lastclicked[el.id], options.closetransitionend);
802                });
803            } else {
804                if (options.detach) {
805                    $el.detach();
806                } else {
807                    $el.hide();
808                }
809
810                // Re-enable scrolling of background layer, if needed
811                if (options.scrolllock) {
812                    setTimeout(function() {
813                        if ($.grep(visiblePopupsArray, function(eid) { return $("#"+eid).data('popupoptions').scrolllock }).length) {
814                            // Some "scrolllock=true" popup is currently visible, leave scrolling disabled
815                            return;
816                        }
817                        $body.css({
818                            overflow: 'visible',
819                            'margin-right': bodymarginright
820                        });
821                    }, 10); // 10ms added for CSS transition in Firefox which doesn't like overflow:auto
822                }
823
824                callback(el, lastclicked[el.id], options.closetransitionend);
825            }
826
827            if (options.type == 'tooltip') {
828                $(window).off('resize.' + el.id);
829            }
830        },
831
832        /**
833         * Toggle method
834         *
835         * @param {object} el - popup instance DOM node
836         * @param {number} ordinal - order number of an `open` element
837         */
838        toggle: function (el, ordinal) {
839            if ($(el).data('popup-visible')) {
840                methods.hide(el);
841            } else {
842                setTimeout(function() {
843                    methods.show(el, ordinal);
844                }, 0);
845            }
846        },
847
848        /**
849         * Reposition method
850         *
851         * @param {object} el - popup instance DOM node
852         * @param {number} ordinal - order number of an `open` element
853         */
854        reposition: function (el, ordinal) {
855            var $el = $(el);
856            var options = $el.data('popupoptions');
857            var $wrapper = $('#' + el.id + '_wrapper');
858
859            ordinal = ordinal || 0;
860
861            // Tooltip type
862            if (options.type == 'tooltip') {
863                // TODO: this static assignments should probably be moved to init method
864                $wrapper.css({
865                    'position': 'absolute'
866                });
867
868                var $tooltipanchor;
869                if (options.tooltipanchor) {
870                    $tooltipanchor = $(options.tooltipanchor);
871                } else if (options.openelement) {
872                    $tooltipanchor = $(options.openelement).filter('[data-popup-ordinal="' + ordinal + '"]');
873                } else {
874                    $tooltipanchor = $('.' + el.id + opensuffix + '[data-popup-ordinal="' + ordinal + '"]');
875                }
876
877                var linkOffset = $tooltipanchor.offset() || { left
877: 0, top: 0 };
878
879                // Horizontal position for tooltip
880                if (options.horizontal == 'right') {
881                    $wrapper.css('left', linkOffset.left + $tooltipanchor.outerWidth() + options.offsetleft);
882                } else if (options.horizontal == 'leftedge') {
883                    $wrapper.css('left', linkOffset.left +  options.offsetleft);
884                } else if (options.horizontal == 'left') {
885                    $wrapper.css('right', $window.width() - linkOffset.left  - options.offsetleft);
886                } else if (options.horizontal == 'rightedge') {
887                    $wrapper.css('right', $window.width()  - linkOffset.left - $tooltipanchor.outerWidth() - options.offsetleft);
888                } else {
889                    $wrapper.css('left', linkOffset.left + ($tooltipanchor.outerWidth() / 2) - ($el.outerWidth() / 2) - parseFloat($el.css('marginLeft')) + options.offsetleft);
890                }
891
892                // Vertical position for tooltip
893                if (options.vertical == 'bottom') {
894                    $wrapper.css('top', linkOffset.top + $tooltipanchor.outerHeight() + options.offsettop);
895                } else if (options.vertical == 'bottomedge') {
896                    $wrapper.css('top', linkOffset.top + $tooltipanchor.outerHeight() - $el.outerHeight() + options.offsettop);
897                } else if (options.vertical == 'top') {
898                    $wrapper.css('bottom', $window.height() - linkOffset.top - options.offsettop);
899                } else if (options.vertical == 'topedge') {
900                    $wrapper.css('bottom', $window.height() - linkOffset.top - $el.outerHeight() - options.offsettop);
901                } else {
902                    $wrapper.css('top', linkOffset.top + ($tooltipanchor.outerHeight() / 2) - ($el.outerHeight() / 2) - parseFloat($el.css('marginTop')) + options.offsettop);
903                }
904
905            // Overlay type
906            } else if (options.type == 'overlay') {
907                // TODO all static assignments in this block should probably be moved to init method
908
909                // Horizontal position for overlay
910                if (options.horizontal) {
911                    $wrapper.css('text-align', options.horizontal);
912                } else {
913                    $wrapper.css('text-align', 'center');
914                }
915
916                // Vertical position for overlay
917                if (options.vertical) {
918                    $el.css('vertical-align', options.vertical);
919                } else {
920                    $el.css('vertical-align', 'middle');
921                }
922
923                if (options.absolute) {
924                    $wrapper.css({
925                        position: 'absolute',
926                        top: window.scrollY
927                    });
928                }
929
930                if (!options.background) {
931                    $wrapper.css({ 'pointer-events': 'none' });
932
933                    // If popup doesnt fit the viewport, and if background doesn't exist, add scrollbar to popup div instead of wrapper
934                    if (!options.absolute && !isInViewport(el)) {
935                        $el.css('overflow', 'auto');
936                        $el[0].style.WebkitOverflowScrolling = 'touch'; // for smooth scrolling in overflow:auto divs in iOS
937                        $el.css('max-height', 'calc(100% - ' + $el.css('margin-top') + ' - ' +  $el.css('margin-bottom') + ')');
938                    }
939                }
940            }
941        },
942
943        /**
944         * Add-close-button method
945         *
946         * @param {object} el - popup instance DOM node
947         */
948        addclosebutton: function (el) {
949            var genericCloseButton;
950
951            if ($(el).data('popupoptions').closebuttonmarkup) {
952                genericCloseButton = $(options.closebuttonmarkup).addClass(el.id + '_close');
953            } else {
954                genericCloseButton = '<button class="popup_close ' + el.id + '_close" title="Close" aria-label="Close"><span aria-hidden="true">×</span></button>';
955            }
956
957            if ($(el).data('popup-initialized')){
958                $(el).append(genericCloseButton);
959            }
960
961        }
962
963    };
964
965    /**
966     * Callback event calls
967     *
968     * @param {object} el - popup instance DOM node
969     * @param {number} ordinal - order number of an `open` element
970     * @param {function} func - callback function
971     */
972    var callback = function (el, ordinal, func) {
973        var options = $(el).data('popupoptions');
974        var openelement;
975        var elementclicked;
976        if (typeof options === 'undefined') return;
977        openelement =  options.openelement ? options.openelement : ('.' + el.id + opensuffix);
978        elementclicked = $(openelement + '[data-popup-ordinal="' + ordinal + '"]');
979        if (typeof func == 'function') {
980            func.call($(el), el, elementclicked);
981        }
982    };
983
984    /**
985     * Check if element is fully in viewport
986     *
987     * @param {object} el - popup instance DOM node
988     */
989    var isInViewport = function (el) {
990        var bounding = el.getBoundingClientRect();
991        return (
992            bounding.top >= 0 &&
993            bounding.left >= 0 &&
994            bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
995            bounding.right <= (window.innerWidth || document.documentElement.clientWidth)
996        );
997    };
998
999    // Hide popup if ESC key is pressed
1000    $(document).on('keydown', function (event) {
1001        if(visiblePopupsArray.length) {
1002            var elementId = visiblePopupsArray[visiblePopupsArray.length - 1];
1003            var el = document.getElementById(elementId);
1004
1005            if ($(el).data('popupoptions').escape && event.keyCode == 27) {
1006                methods.hide(el);
1007            }
1008        }
1009    });
1010
1011    var mousedownTarget;
1012
1013    $(document).on('mousedown', function (event) {
1014        mousedownTarget = event.target;
1015    });
1016
1017    // Hide popup on click
1018    $(document).on('click', function (event) {
1019        if(visiblePopupsArray.length) {
1020            var elementId = visiblePopupsArray[visiblePopupsArray.length - 1];
1021            var el = document.getElementById(elementId);
1022            var closeButton = ($(el).data('popupoptions').closeelement) ? $(el).data('popupoptions').closeelement : ('.' + el.id + closesuffix);
1023
1024            // If Close button clicked
1025            if ($(event.target).closest(closeButton).length) {
1026                event.preventDefault();
1027                methods.hide(el);
1028            }
1029
1030            // If clicked outside of popup
1031            if ($(el).data('popupoptions')
1032                && $(el).data('popupoptions').blur
1033                && !$(event.target).closest($(el).data('popupoptions').blurignore).length
1034                && !$(event.target).closest('#' + elementId).length
1035                && !$(mousedownTarget).closest('#' + elementId).length
1036                && event.which !== 2
1037                && $(event.target).is(':visible')) {
1038
1039                if ($(el).data('popupoptions').background) {
1040                    // If clicked on popup cover
1041                    methods.hide(el);
1042
1043                    // Older iOS/Safari will trigger a click on the elements below the cover,
1044                    // when tapping on the cover, so the default action needs to be prevented.
1045                    event.preventDefault();
1046
1047                } else {
1048                    // If clicked on outer content
1049                    methods.hide(el, true);
1050                }
1051            }
1052        }
1053    });
1054
1055    // Keep keyboard focus inside of popup
1056    $(document).on('keydown', function(event) {
1057        if(visiblePopupsArray.length && event.which == 9) {
1058            // If tab or shift-tab pressed
1059            var elementId = visiblePopupsArray[visiblePopupsArray.length - 1];
1060            var el = document.getElementById(elementId);
1061            var options = $(el).data('popupoptions');
1062
1063            // If the last opened popup doesn't have `keepfocus` option, ignore the rest and don't lock the focus inside of popup.
1064            if (!options.keepfocus) {
1065                return;
1066            }
1067
1068            // Get list of all children elements in given object
1069            var popupItems = $(el).find('*');
1070
1071            // Get list of focusable items
1072            var focusableItems = popupItems.filter(focusableElementsString).filter(':visible');
1073
1074            // Get currently focused item
1075            var focusedItem = $(':focus');
1076
1077            // Get the number of focusable items
1078            var numberOfFocusableItems = focusableItems.length;
1079
1080            // Get the index of the currently focused item
1081            var focusedItemIndex = focusableItems.index(focusedItem);
1082
1083            // If popup doesn't contain focusable elements, focus popup itself
1084            if (numberOfFocusableItems === 0) {
1085                $(el).focus();
1086                event.preventDefault();
1087            } else {
1088                if (event.shiftKey) {
1089                    // Back tab
1090                    // If focused on first item and user preses back-tab, go to the last focusable item
1091                    if (focusedItemIndex === 0) {
1092                        focusableItems.get(numberOfFocusableItems - 1).focus();
1093                        event.preventDefault();
1094                    }
1095
1096                } else {
1097                    // Forward tab
1098                    // If focused on the last item and user preses tab, go to the first focusable item
1099                    if (focusedItemIndex == numberOfFocusableItems - 1) {
1100                        focusableItems.get(0).focus();
1101                        event.preventDefault();
1102                    }
1103                }
1104            }
1105        }
1106    });
1107
1108    /**
1109     * Plugin API
1110     */
1111    $.fn.popup = function (customoptions) {
1112        return this.each(function () {
1113
1114            var $el = $(this);
1115            var newDefaults = $.extend(true, {}, $.fn.popup.defaults);
1116
1117            // Set defaults for tooltips dynamically instead of implicitly, so they can be overriden with custom options.
1118            if (customoptions && customoptions.type === 'tooltip') {
1119                newDefaults.background = false;
1120            }
1121
1122            if (typeof customoptions === 'object') {  // e.g. $('#popup').popup({'color':'blue'})
1123                var opt = $.extend({}, newDefaults, $el.data('popupoptions'), customoptions);
1124                $el.data('popupoptions', opt);
1125                options = $el.data('popupoptions');
1126
1127                methods._init(this);
1128
1129            } else if (typeof customoptions === 'string') { // e.g. $('#popup').popup('hide')
1130                if (!($el.data('popupoptions'))) {
1131                    $el.data('popupoptions', newDefaults);
1132                    options = $el.data('popupoptions');
1133                }
1134
1135                methods[customoptions].call(this, this);
1136
1137            } else { // e.g. $('#popup').popup()
1138                if (!($el.data('popupoptions'))) {
1139                    $el.data('popupoptions', newDefaults);
1140                    options = $el.data('popupoptions');
1141                }
1142
1143                methods._init(this);
1144
1145            }
1146
1147        });
1148    };
1149
1150    // destroy all popups
1151    $.fn.popup.destroyall = function () {
1152        // TODO: create tests to check if we can use `hide` method (perhaps we'll need to remove transitions)
1153        // or we need another way of removing the data when destroying.
1154        for(var i=0; i < visiblePopupsArray.length; i++) {
1155            $('#' + visiblePopupsArray[i]).popup('hide');
1156        }
1157        $('.popup_wrapper').remove();
1158        $('.popup_background').remove();
1159        // visiblePopupsArray = []; // TODO: check if we need this for SPA and popups with fadeOut animation and scrolllock
1160        $(document).off('click.jqp');
1161    };
1162
1163    $.fn.popup.defaults = {
1164        type: 'overlay',
1165        absolute: false,
1166        autoopen: false,
1167        background: true,
1168        color: 'black',
1169        opacity: '0.5',
1170        horizontal: 'center',
1171        vertical: 'middle',
1172        offsettop: 0,
1173        offsetleft: 0,
1174        escape: true,
1175        blur: true,
1176        blurignore: null,
1177        setzindex: true,
1178        autozindex: false,
1179        scrolllock: false,
1180        closebutton: false,
1181        closebuttonmarkup: null,
1182        keepfocus: true,
1183        focuselement: null,
1184        focusdelay: 50,
1185        outline: false,
1186        pagecontainer: null,
1187        detach: false,
1188        openelement: null,
1189        closeelement: null,
1190        transition: null,
1191        tooltipanchor: null,
1192        beforeopen: null,
1193        onclose: null,
1194        onopen: null,
1195        opentransitionend: null,
1196        closetransitionend: null
1197    };
1198
1199})(jQuery); /* eslint-disable-line */
1200
1201/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
1202
1203/***/ }),
1204/* 5 */
1205/***/ (function(module, exports, __webpack_require__) {
1206
1207!function(e,t){ true?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.sal=t():e.sal=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="dist/",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);n(1);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i="Sal was not initialised! Probably it is used in SSR.",a="Your browser does not support IntersectionObserver!\nGet a polyfill from here:\nhttps://github.com/w3c/IntersectionObserver/tree/master/polyfill",s={rootMargin:"0% 50%",threshold:.5,animateClassName:"sal-animate",disabledClassName:"sal-disabled",enterEventName:"sal:in",exitEventName:"sal:out",selector:"[data-sal]",once:!0,disabled:!1},l=[],c=null,u=function(e){e&&e!==s&&(s=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},s,{},e))},f=function(e){e.classList.remove(s.animateClassName)},d=function(e,t){var n=new CustomEvent(e,{bubbles:!0,detail:t});t.target.dispatchEvent(n)},b=function(){document.body.classList.add(s.disabledClassName)},p=function(){c.disconnect(),c=null},m=function(){return s.disabled||"function"==typeof s.disabled&&s.disabled()},y=function(e,t){e.forEach((function(e){e.intersectionRatio>=s.threshold?(!function(e){e.target.classList.add(s.animateClassName),d(s.enterEventName,e)}(e),s.once&&t.unobserve(e.target)):s.once||function(e){f(e.target),d(s.exitEventName,e)}(e)}))},v=function(){b(),p()},O=function(){document.body.classList.remove(s.disabledClassName),c=new IntersectionObserver(y,{rootMargin:s.rootMargin,threshold:s.threshold}),(l=[].filter.call(document.querySelectorAll(s.selector),(function(e){return!function(e){return e.classList.contains(s.animateClassName)}(e,s.animateClassName)}))).forEach((function(e){return c.observe(e)}))},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p(),Array.from(document.querySelectorAll(s.selector)).forEach(f),u(e),O()};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;if(u(e),"undefined"==typeof window)return console.warn(i),{elements:l,disable:v,enable:O,reset:g};if(!window.IntersectionObserver)throw b(),Error(a);return m()?b():O(),{elements:l,disable:v,enable:O,reset:g}}},function(e,t,n){}]).default}));
1208//# sourceMappingURL=sal.js.map
1209
1210/***/ }),
1211/* 6 */
1212/***/ (function(module, __webpack_exports__, __webpack_require__) {
1213
1214"use strict";
1215/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__camelCase__ = __webpack_require__(7);
1216function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1217
1218function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1219
1220function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1221
1222
1223/**
1224 * DOM-based Routing
1225 *
1226 * Based on {@link http://goo.gl/EUTi53|Markup-based Unobtrusive Comprehensive DOM-ready Execution} by Paul Irish
1227 *
1228 * The routing fires all common scripts, followed by the page specific scripts.
1229 * Add additional events for more control over timing e.g. a finalize event
1230 */
1231
1232var Router = /*#__PURE__*/function () {
1233  /**
1234   * Create a new Router
1235   * @param {Object} routes
1236   */
1237  function Router(routes) {
1238    _classCallCheck(this, Router);
1239
1240    this.routes = routes;
1241  }
1242  /**
1243   * Fire Router events
1244   * @param {string} route DOM-based route derived from body classes (`<body class="...">`)
1245   * @param {string} [event] Events on the route. By default, `init` and `finalize` events are called.
1246   * @param {string} [arg] Any custom argument to be passed to the event.
1247   */
1248
1249
1250  _createClass(Router, [{
1251    key: "fire",
1252    value: function fire(route) {
1253      var event = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'init';
1254      var arg = arguments.length > 2 ? arguments[2] : undefined;
1255      var fire = route !== '' && this.routes[route] && typeof this.routes[route][event] === 'function';
1256
1257      if (fire) {
1258        this.routes[route][event](arg);
1259      }
1260    }
1261    /**
1262     * Automatically load and fire Router events
1263     *
1264     * Events are fired in the following order:
1265     *  * common init
1266     *  * page-specific init
1267     *  * page-specific finalize
1268     *  * common finalize
1269     */
1270
1271  }, {
1272    key: "loadEvents",
1273    value: function loadEvents() {
1274      var _this = this;
1275
1276      // Fire common init JS
1277      this.fire('common'); // Fire page-specific init JS, and then finalize JS
1278
1279      document.body.className.toLowerCase().replace(/-/g, '_').split(/\s+/).map(__WEBPACK_IMPORTED_MODULE_0__camelCase__["a" /* default */]).forEac
1279h(function (className) {
1280        _this.fire(className);
1281
1282        _this.fire(className, 'finalize');
1283      }); // Fire common finalize JS
1284
1285      this.fire('common', 'finalize');
1286    }
1287  }]);
1288
1289  return Router;
1290}();
1291
1292/* harmony default export */ __webpack_exports__["a"] = (Router);
1293
1294/***/ }),
1295/* 7 */
1296/***/ (function(module, __webpack_exports__, __webpack_require__) {
1297
1298"use strict";
1299/**
1300 * the most terrible camelizer on the internet, guaranteed!
1301 * @param {string} str String that isn't camel-case, e.g., CAMeL_CaSEiS-harD
1302 * @return {string} String converted to camel-case, e.g., camelCaseIsHard
1303 */
1304/* harmony default export */ __webpack_exports__["a"] = (function (str) {
1305  return "".concat(str.charAt(0).toLowerCase()).concat(str.replace(/[\W_]/g, '|').split('|').map(function (part) {
1306    return "".concat(part.charAt(0).toUpperCase()).concat(part.slice(1));
1307  }).join('').slice(1));
1308});
1309
1310/***/ }),
1311/* 8 */
1312/***/ (function(module, __webpack_exports__, __webpack_require__) {
1313
1314"use strict";
1315/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_consent_management__ = __webpack_require__(9);
1316/* eslint-disable */
1317
1318/* harmony default export */ __webpack_exports__["a"] = ({
1319  init: function init() {
1320    // JavaScript to be fired on all pages
1321
1322    /**
1323     * General helper function to support toggle functions.
1324     */
1325    var toggleClasses = function toggleClasses(element) {
1326      var $this = element,
1327          $togglePrefix = $this.data('prefix') || 'this'; // If the element you need toggled is relative to the toggle, add the
1328      // .js-this class to the parent element and "this" to the data-toggled attr.
1329
1330      if ($this.data('toggled') == "this") {
1331        var $toggled = $this.closest('.js-this');
1332      } else {
1333        var $toggled = $('.' + $this.data('toggled'));
1334      }
1335
1336      if ($this.attr('aria-expanded', 'true')) {
1337        $this.attr('aria-expanded', 'true');
1338      } else {
1339        $this.attr('aria-expanded', 'false');
1340      }
1341
1342      $this.toggleClass($togglePrefix + '-is-active');
1343      $toggled.toggleClass($togglePrefix + '-is-active'); // Remove a class on another element, if needed.
1344
1345      if ($this.data('remove')) {
1346        $('.' + $this.data('remove')).removeClass($this.data('remove'));
1347      }
1348    };
1349    /*
1350     * Toggle Active Classes
1351     *
1352     * @description:
1353     *  toggle specific classes based on data-attr of clicked element
1354     *
1355     * @requires:
1356     *  'js-toggle' class and a data-attr with the element to be
1357     *  toggled's class name both applied to the clicked element
1358     *
1359     * @example usage:
1360     *  <span class="js-toggle" data-toggled="toggled-class">Toggler</span>
1361     *  <div class="toggled-class">This element's class will be toggled</div>
1362     *
1363     */
1364
1365
1366    $('.js-toggle').on('click', function (e) {
1367      e.preventDefault();
1368      e.stopPropagation();
1369      toggleClasses($(this));
1370    }); // Toggle parent class
1371
1372    $('.js-toggle-parent').on('click', function (e) {
1373      e.preventDefault();
1374      var $this = $(this);
1375      $this.toggleClass('this-is-active');
1376      $this.parent().toggleClass('this-is-active');
1377    }); // Prevent bubbling to the body. Add this class to the element (or element
1378    // container) that should allow the click event.
1379
1380    $('.js-stop-prop').on('click', function (e) {
1381      e.stopPropagation();
1382    }); // Toggle hovered classes
1383
1384    $('.js-hover').on('mouseenter mouseleave', function (e) {
1385      e.preventDefault();
1386      e.stopPropagation();
1387      toggleClasses($(this));
1388    });
1389    $('.js-hover-parent').on('mouseenter mouseleave', function (e) {
1390      e.preventDefault();
1391      var $this = $(this);
1392      $this.toggleClass('this-is-active');
1393      $this.parent().toggleClass('this-is-active');
1394    });
1395  },
1396  finalize: function finalize() {
1397    // JavaScript to be fired on all pages, after page specific JS is fired
1398    // Scripts that require consent.
1399    new __WEBPACK_IMPORTED_MODULE_0__util_consent_management__["a" /* default */](function () {
1400      if (Object(__WEBPACK_IMPORTED_MODULE_0__util_consent_management__["b" /* hasConsentGroup */])('performance')) {
1401        (function (w, d, s, l, i, t) {
1402          w[l] = w[l] || [];
1403          var f = d.getElementsByTagName(s)[0],
1404              j = d.createElement(s),
1405              dl = l != 'dataLayer' ? '&l=' + l : '';
1406          j.async = true;
1407          j.src = 'https://www.googletagmanager.com/gtag/js?id=' + i + dl;
1408          f.parentNode.insertBefore(j, f);
1409
1410          w[t] = function () {
1411            w[l].push(arguments);
1412          };
1413
1414          w[t]('js', new Date());
1415          w[t]('config', i);
1416        })(window, document, 'script', 'dataLayer', 'UA-164602271-1', 'gtag');
1417      }
1418    });
1419  }
1420});
1421/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
1422
1423/***/ }),
1424/* 9 */
1425/***/ (function(module, __webpack_exports__, __webpack_require__) {
1426
1427"use strict";
1428/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return consentManagement; });
1429/* harmony export (immutable) */ __webpack_exports__["b"] = hasConsentGroup;
1430/* unused harmony export hasConsentGroupId */
1431function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1432
1433function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1434
1435/**
1436 *
1437 * @description
1438 * This needs to be manually mantained as new groups are
1439 * Defined in our consent management platform (Onetrust).
1440 */
1441var consentGroups = {
1442  necessary: 'C0001',
1443  performance: 'C0002',
1444  functional: 'C0003',
1445  targeting: 'C0004'
1446};
1447/**
1448 *
1449 * @export
1450 * @class consentManagement
1451 */
1452
1453var consentManagement =
1454/**
1455 *Creates an instance of consentManagement.
1456 * @param {*} callBack
1457 * @memberof consentManagement
1458 */
1459function consentManagement(callBack) {
1460  var _this = this;
1461
1462  _classCallCheck(this, consentManagement);
1463
1464  _defineProperty(this, "callBackFired", false);
1465
1466  _defineProperty(this, "forceCallback", false);
1467
1468  // Abort if no onetrust.
1469  if (!window.OptanonWrapper) {
1470    callBack();
1471    this.callBackFired = true;
1472    return false;
1473  } // Primmed visitor.
1474
1475
1476  if (window.OnetrustActiveGroups && hasConsentGroup("necessary")) {
1477    this.callBackFired = true;
1478    callBack();
1479  } // Unprimmed visitor.
1480  else {
1481      this.forceCallback = true;
1482    } // Add previous functions to current callback.
1483
1484
1485  var prev_func = window.PomOnConsentChanged ? window.PomOnConsentChanged : function () {};
1486
1487  window.PomOnConsentChanged = function () {
1488    prev_func.call(_this);
1489    callBack();
1490    _this.callBackFired = true;
1491  }; // Update on consent change.
1492
1493
1494  window.OptanonWrapper = function () {
1495    // Force call back on unprimmed visitor.
1496    if (_this.forceCallback) {
1497      window.PomOnConsentChanged();
1498    } // Trigger on consent change.
1499
1500
1501    if (window.Optanon && window.Optanon.OnConsentChanged) {
1502      Optanon.OnConsentChanged(function () {
1503        if (_this.callBackFired) {//location.reload();
1504        } else {
1505          window.PomOnConsentChanged();
1506        }
1507      });
1508    }
1509  };
1510};
1511/**
1512 *
1513 * @export
1514 * @param {string} GroupName
1515 * @returns boolean
1516 */
1517
1518
1519
1520function hasConsentGroup(GroupName) {
1521  var activeGroups = window.OnetrustActiveGroups !== undefined ? OnetrustActiveGroups.split(',') : new Array(consentGroups[GroupName]);
1522  return consentGroups[GroupName] ? activeGroups.includes(consentGroups[GroupName]) : false;
1523}
1524/**
1525 *
1526 * @export
1527 * @param {string} GroupId
1528 * @returns boolean
1529 */
1530
1531function hasConsentGroupId(GroupId) {
1532  var activeGroups = window.OnetrustActiveGroups !== undefined ? OnetrustActiveGroups.split(',') : new Array(GroupId);
1533  return activeGroups.includes(GroupId);
1534}
1535
1536/***/ }),
1537/* 10 */
1538/***/ (function(module, exports) {
1539
1540// removed by extract-text-webpack-plugin
1541
1542/***/ })
1543/******/ ]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.