PageSourceSearch

https://www.ags-demenagement.com/wp-content/themes/ags_sage/dist/scripts/main.js

js ags-demenagement.com collected 2026-10-07 01:55:54 UTC 232,756 bytes, 6,843 lines download raw bytes

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/******/ 	// identity function for calling harmony imports with the correct context
37/******/ 	__webpack_require__.i = function(value) { return value; };
38/******/
39/******/ 	// define getter function for harmony exports
40/******/ 	__webpack_require__.d = function(exports, name, getter) {
41/******/ 		if(!__webpack_require__.o(exports, name)) {
42/******/ 			Object.defineProperty(exports, name, {
43/******/ 				configurable: false,
44/******/ 				enumerable: true,
45/******/ 				get: getter
46/******/ 			});
47/******/ 		}
48/******/ 	};
49/******/
50/******/ 	// getDefaultExport function for compatibility with non-harmony modules
51/******/ 	__webpack_require__.n = function(module) {
52/******/ 		var getter = module && module.__esModule ?
53/******/ 			function getDefault() { return module['default']; } :
54/******/ 			function getModuleExports() { return module; };
55/******/ 		__webpack_require__.d(getter, 'a', getter);
56/******/ 		return getter;
57/******/ 	};
58/******/
59/******/ 	// Object.prototype.hasOwnProperty.call
60/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
61/******/
62/******/ 	// __webpack_public_path__
63/******/ 	__webpack_require__.p = "/wp-content/themes/ags_sage//dist/";
64/******/
65/******/ 	// Load entry module and return exports
66/******/ 	return __webpack_require__(__webpack_require__.s = 16);
67/******/ })
68/************************************************************************/
69/******/ ([
70/* 0 */
71/***/ (function(module, exports) {
72
73  module.exports = jQuery;
74
75  /***/ }),
76  /* 1 */,
77  /* 2 */
78  /***/ (function(module, __webpack_exports__, __webpack_require__) {
79  
80  "use strict";
81  Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
82  /* WEBPACK VAR INJECTION */(function(jQuery) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0);
83  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
84  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_bootstrap__ = __webpack_require__(4);
85  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_bootstrap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_bootstrap__);
86  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_Router__ = __webpack_require__(12);
87  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__routes_common__ = __webpack_require__(7);
88  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__routes_home__ = __webpack_require__(9);
89  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__routes_about__ = __webpack_require__(5);
90  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__routes_archive__ = __webpack_require__(6);
91  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__routes_single__ = __webpack_require__(11);
92  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__routes_job__ = __webpack_require__(10);
93  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__routes_contact_us__ = __webpack_require__(8);
94  /** import external dependencies */
95  
96  
97  
98  /** import local dependencies */
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  /**
111   * Populate Router instance with DOM routes
112   * @type {Router} routes - An instance of our router
113   */
114  var routes = new __WEBPACK_IMPORTED_MODULE_2__util_Router__["a" /* default */]({
115    /** All pages */
116    common: __WEBPACK_IMPORTED_MODULE_3__routes_common__["a" /* default */],
117    /** Home page */
118    home: __WEBPACK_IMPORTED_MODULE_4__routes_home__["a" /* default */],
119    /** About Us page, note the change from about-us to aboutUs. */
120    aboutUs: __WEBPACK_IMPORTED_MODULE_5__routes_about__["a" /* default */],
121    /** Archive page. */
122    archive: __WEBPACK_IMPORTED_MODULE_6__routes_archive__["a" /* default */],
123    /** Post page. */
124    single: __WEBPACK_IMPORTED_MODULE_7__routes_single__["a" /* default */],
125      /** Jobs page. */
126    job: __WEBPACK_IMPORTED_MODULE_8__routes_job__["a" /* default */],
127    /** Contact Page*/
128    contact: __WEBPACK_IMPORTED_MODULE_9__routes_contact_us__["a" /* default */],
129  });
130  
131  
132  /** Load Events */
133  jQuery(document).ready(function () { return routes.loadEvents(); });
134  
135  
136  
137  /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
138  
139  /***/ }),
140  /* 3 */
141  /***/ (function(module, exports) {
142  
143  // removed by extract-text-webpack-plugin
144  
145  /***/ }),
146  /* 4 */
147  /***/ (function(module, exports, __webpack_require__) {
148  
149  /* WEBPACK VAR INJECTION */(function(jQuery, Tether) {/*!
150   * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com)
151   * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
152   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
153   */
154  
155  if (typeof jQuery === 'undefined') {
156    throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.')
157  }
158  
159  +function ($) {
160    var version = $.fn.jquery.split(' ')[0].split('.')
161    if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {
162      throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
163    }
164  }(jQuery);
165  
166  
167  +function () {
168  
169  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
170  
171  var _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }();
172  
173  function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
174  
175  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } }
176  
177  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
178  
179  /**
180   * --------------------------------------------------------------------------
181   * Bootstrap (v4.0.0-alpha.6): util.js
182   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
183   * --------------------------------------------------------------------------
184   */
185  
186  var Util = function ($) {
187  
188    /**
189     * ------------------------------------------------------------------------
190     * Private TransitionEnd Helpers
191     * ------------------------------------------------------------------------
192     */
193  
194    var transition = false;
195  
196    var MAX_UID = 1000000;
197  
198    var TransitionEndEvent = {
199      WebkitTransition: 'webkitTransitionEnd',
200      MozTransition: 'transitionend',
201      OTransition: 'oTransitionEnd otransitionend',
202      transition: 'transitionend'
203    };
204  
205    // shoutout AngusCroll (https://goo.gl/pxwQGp)
206    function toType(obj) {
207      return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
208    }
209  
210    function isElement(obj) {
211      return (obj[0] || obj).nodeType;
212    }
213  
214    function getSpecialTransitionEndEvent() {
215      return {
216        bindType: transition.end,
217        delegateType: transition.end,
218        handle: function handle(event) {
219          if ($(event.target).is(this)) {
220            return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
221          }
222          return undefined;
223        }
224      };
225    }
226  
227    function transitionEndTest() {
228      if (window.QUnit) {
229        return false;
230      }
231  
232      var el = document.createElement('bootstrap');
233  
234      for (var name in TransitionEndEvent) {
235        if (el.style[name] !== undefined) {
236          return {
237            end: TransitionEndEvent[name]
238          };
239        }
240      }
241  
242      return false;
243    }
244  
245    function transitionEndEmulator(duration) {
246      var _this = this;
247  
248      var called = false;
249  
250      $(this).one(Util.TRANSITION_END, function () {
251        called = true;
252      });
253  
254      setTimeout(function () {
255        if (!called) {
256          Util.triggerTransitionEnd(_this);
257        }
258      }, duration);
259  
260      return this;
261    }
262  
263    function setTransitionEndSupport() {
264      transition = transitionEndTest();
265  
266      $.fn.emulateTransitionEnd = transitionEndEmulator;
267  
268      if (Util.supportsTransitionEnd()) {
269        $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
270      }
271    }
272  
273    /**
274     * --------------------------------------------------------------------------
275     * Public Util Api
276     * --------------------------------------------------------------------------
277     */
278  
279    var Util = {
280  
281      TRANSITION_END: 'bsTransitionEnd',
282  
283      getUID: function getUID(prefix) {
284        do {
285          // eslint-disable-next-line no-bitwise
286          prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
287        } while (document.getElementById(prefix));
288        return prefix;
289      },
290      getSelectorFromElement: function getSelectorFromElement(element) {
291        var selector = element.getAttribute('data-target');
292  
293        if (!selector) {
294          selector = element.getAttribute('href') || '';
295          selector = /^#[a-z]/i.test(selector) ? selector : null;
296        }
297  
298        return selector;
299      },
300      reflow: function reflow(element) {
301        return element.offsetHeight;
302      },
303      triggerTransitionEnd: function triggerTransitionEnd(element) {
304        $(element).trigger(transition.end);
305      },
306      supportsTransitionEnd: function supportsTransitionEnd() {
307        return Boolean(transition);
308      },
309      typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
310        for (var property in configTypes) {
311          if (configTypes.hasOwnProperty(property)) {
312            var expectedTypes = configTypes[property];
313            var value = config[property];
314            var valueType = value && isElement(value) ? 'element' : toType(value);
315  
316            if (!new RegExp(expectedTypes).test(valueType)) {
317              throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".'));
318            }
319          }
320        }
321      }
322    };
323  
324    setTransitionEndSupport();
325  
326    return Util;
327  }(jQuery);
328  
329  /**
330   * --------------------------------------------------------------------------
331   * Bootstrap (v4.0.0-alpha.6): alert.js
332   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
333   * --------------------------------------------------------------------------
334   */
335  
336  var Alert = function ($) {
337  
338    /**
339     * ------------------------------------------------------------------------
340     * Constants
341     * ------------------------------------------------------------------------
342     */
343  
344    var NAME = 'alert';
345    var VERSION = '4.0.0-alpha.6';
346    var DATA_KEY = 'bs.alert';
347    var EVENT_KEY = '.' + DATA_KEY;
348    var DATA_API_KEY = '.data-api';
349    var JQUERY_NO_CONFLICT = $.fn[NAME];
350    var TRANSITION_DURATION = 150;
351  
352    var Selector = {
353      DISMISS: '[data-dismiss="alert"]'
354    };
355  
356    var Event = {
357      CLOSE: 'close' + EVENT_KEY,
358      CLOSED: 'closed' + EVENT_KEY,
359      CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
360    };
361  
362    var ClassName = {
363      ALERT: 'alert',
364      FADE: 'fade',
365      SHOW: 'show'
366    };
367  
368    /**
369     * ------------------------------------------------------------------------
370     * Class Definition
371     * ------------------------------------------------------------------------
372     */
373  
374    var Alert = function () {
375      function Alert(element) {
376        _classCallCheck(this, Alert);
377  
378        this._element = element;
379      }
380  
381      // getters
382  
383      // public
384  
385      Alert.prototype.close = function close(element) {
386        element = element || this._element;
387  
388        var rootElement = this._getRootElement(element);
389        var customEvent = this._triggerCloseEvent(rootElement);
390  
391        if (customEvent.isDefaultPrevented()) {
392          return;
393        }
394  
395        this._removeElement(rootElement);
396      };
397  
398      Alert.prototype.dispose = function dispose() {
399        $.removeData(this._element, DATA_KEY);
400        this._element = null;
401      };
402  
403      // private
404  
405      Alert.prototype._getRootElement = function _getRootElement(element) {
406        var selector = Util.getSelectorFromElement(element);
407        var parent = false;
408  
409        if (selector) {
410          parent = $(selector)[0];
411        }
412  
413        if (!parent) {
414          parent = $(element).closest('.' + ClassName.ALERT)[0];
415        }
416  
417        return parent;
418      };
419  
420      Alert.prototype._triggerCloseEvent = function _triggerCloseEvent(element) {
421        var closeEvent = $.Event(Event.CLOSE);
422  
423        $(element).trigger(closeEvent);
424        return closeEvent;
425      };
426  
427      Alert.prototype._removeElement = function _removeElement(element) {
428        var _this2 = this;
429  
430        $(element).removeClass(ClassName.SHOW);
431  
432        if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
433          this._destroyElement(element);
434          return;
435        }
436  
437        $(element).one(Util.TRANSITION_END, function (event) {
438          return _this2._destroyElement(element, event);
439        }).emulateTransitionEnd(TRANSITION_DURATION);
440      };
441  
442      Alert.prototype._destroyElement = function _destroyElement(element) {
443        $(element).detach().trigger(Event.CLOSED).remove();
444      };
445  
446      // static
447  
448      Alert._jQueryInterface = function _jQueryInterface(config) {
449        return this.each(function () {
450          var $element = $(this);
451          var data = $element.data(DATA_KEY);
452  
453          if (!data) {
454            data = new Alert(this);
455            $element.data(DATA_KEY, data);
456          }
457  
458          if (config === 'close') {
459            data[config](this);
460          }
461        });
462      };
463  
464      Alert._handleDismiss = function _handleDismiss(alertInstance) {
465        return function (event) {
466          if (event) {
467            event.preventDefault();
468          }
469  
470          alertInstance.close(this);
471        };
472      };
473  
474      _createClass(Alert, null, [{
475        key: 'VERSION',
476        get: function get() {
477          return VERSION;
478        }
479      }]);
480  
481      return Alert;
482    }();
483  
484    /**
485     * ------------------------------------------------------------------------
486     * Data Api implementation
487     * ------------------------------------------------------------------------
488     */
489  
490    $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
491  
492    /**
493     * ------------------------------------------------------------------------
494     * jQuery
495     * ------------------------------------------------------------------------
496     */
497  
498    $.fn[NAME] = Alert._jQueryInterface;
499    $.fn[NAME].Constructor = Alert;
500    $.fn[NAME].noConflict = function () {
501      $.fn[NAME] = JQUERY_NO_CONFLICT;
502      return Alert._jQueryInterface;
503    };
504  
505    return Alert;
506  }(jQuery);
507  
508  /**
509   * --------------------------------------------------------------------------
510   * Bootstrap (v4.0.0-alpha.6): button.js
511   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
512   * --------------------------------------------------------------------------
513   */
514  
515  var Button = function ($) {
516  
517    /**
518     * ------------------------------------------------------------------------
519     * Constants
520     * ------------------------------------------------------------------------
521     */
522  
523    var NAME = 'button';
524    var VERSION = '4.0.0-alpha.6';
525    var DATA_KEY = 'bs.button';
526    var EVENT_KEY = '.' + DATA_KEY;
527    var DATA_API_KEY = '.data-api';
528    var JQUERY_NO_CONFLICT = $.fn[NAME];
529  
530    var ClassName = {
531      ACTIVE: 'active',
532      BUTTON: 'btn',
533      FOCUS: 'focus'
534    };
535  
536    var Selector = {
537      DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
538      DATA_TOGGLE: '[data-toggle="buttons"]',
539      INPUT: 'input',
540      ACTIVE: '.active',
541      BUTTON: '.btn'
542    };
543  
544    var Event = {
545      CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
546      FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY)
547    };
548  
549    /**
550     * ------------------------------------------------------------------------
551     * Class Definition
552     * ------------------------------------------------------------------------
553     */
554  
555    var Button = function () {
556      function Button(element) {
557        _classCallCheck(this, Button);
558  
559        this._element = element;
560      }
561  
562      // getters
563  
564      // public
565  
vendor: 5,277 bytes, lines 566-745
566      Button.prototype.toggle = function toggle() {
567        var triggerChangeEvent = true;
568        var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
569  
570        if (rootElement) {
571          var input = $(this._element).find(Selector.INPUT)[0];
572  
573          if (input) {
574            if (input.type === 'radio') {
575              if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
576                triggerChangeEvent = false;
577              } else {
578                var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
579  
580                if (activeElement) {
581                  $(activeElement).removeClass(ClassName.ACTIVE);
582                }
583              }
584            }
585  
586            if (triggerChangeEvent) {
587              input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
588              $(input).trigger('change');
589            }
590  
591            input.focus();
592          }
593        }
594  
595        this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
596  
597        if (triggerChangeEvent) {
598          $(this._element).toggleClass(ClassName.ACTIVE);
599        }
600      };
601  
602      Button.prototype.dispose = function dispose() {
603        $.removeData(this._element, DATA_KEY);
604        this._element = null;
605      };
606  
607      // static
608  
609      Button._jQueryInterface = function _jQueryInterface(config) {
610        return this.each(function () {
611          var data = $(this).data(DATA_KEY);
612  
613          if (!data) {
614            data = new Button(this);
615            $(this).data(DATA_KEY, data);
616          }
617  
618          if (config === 'toggle') {
619            data[config]();
620          }
621        });
622      };
623  
624      _createClass(Button, null, [{
625        key: 'VERSION',
626        get: function get() {
627          return VERSION;
628        }
629      }]);
630  
631      return Button;
632    }();
633  
634    /**
635     * ------------------------------------------------------------------------
636     * Data Api implementation
637     * ------------------------------------------------------------------------
638     */
639  
640    $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
641      event.preventDefault();
642  
643      var button = event.target;
644  
645      if (!$(button).hasClass(ClassName.BUTTON)) {
646        button = $(button).closest(Selector.BUTTON);
647      }
648  
649      Button._jQueryInterface.call($(button), 'toggle');
650    }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
651      var button = $(event.target).closest(Selector.BUTTON)[0];
652      $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
653    });
654  
655    /**
656     * ------------------------------------------------------------------------
657     * jQuery
658     * ------------------------------------------------------------------------
659     */
660  
661    $.fn[NAME] = Button._jQueryInterface;
662    $.fn[NAME].Constructor = Button;
663    $.fn[NAME].noConflict = function () {
664      $.fn[NAME] = JQUERY_NO_CONFLICT;
665      return Button._jQueryInterface;
666    };
667  
668    return Button;
669  }(jQuery);
670  
671  /**
672   * --------------------------------------------------------------------------
673   * Bootstrap (v4.0.0-alpha.6): carousel.js
674   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
675   * --------------------------------------------------------------------------
676   */
677  
678  var Carousel = function ($) {
679  
680    /**
681     * ------------------------------------------------------------------------
682     * Constants
683     * ------------------------------------------------------------------------
684     */
685  
686    var NAME = 'carousel';
687    var VERSION = '4.0.0-alpha.6';
688    var DATA_KEY = 'bs.carousel';
689    var EVENT_KEY = '.' + DATA_KEY;
690    var DATA_API_KEY = '.data-api';
691    var JQUERY_NO_CONFLICT = $.fn[NAME];
692    var TRANSITION_DURATION = 600;
693    var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
694    var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
695  
696    var Default = {
697      interval: 5000,
698      keyboard: true,
699      slide: false,
700      pause: 'hover',
701      wrap: true
702    };
703  
704    var DefaultType = {
705      interval: '(number|boolean)',
706      keyboard: 'boolean',
707      slide: '(boolean|string)',
708      pause: '(string|boolean)',
709      wrap: 'boolean'
710    };
711  
712    var Direction = {
713      NEXT: 'next',
714      PREV: 'prev',
715      LEFT: 'left',
716      RIGHT: 'right'
717    };
718  
719    var Event = {
720      SLIDE: 'slide' + EVENT_KEY,
721      SLID: 'slid' + EVENT_KEY,
722      KEYDOWN: 'keydown' + EVENT_KEY,
723      MOUSEENTER: 'mouseenter' + EVENT_KEY,
724      MOUSELEAVE: 'mouseleave' + EVENT_KEY,
725      LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY,
726      CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
727    };
728  
729    var ClassName = {
730      CAROUSEL: 'carousel',
731      ACTIVE: 'active',
732      SLIDE: 'slide',
733      RIGHT: 'carousel-item-right',
734      LEFT: 'carousel-item-left',
735      NEXT: 'carousel-item-next',
736      PREV: 'carousel-item-prev',
737      ITEM: 'carousel-item'
738    };
739  
740    var Selector = {
741      ACTIVE: '.active',
742      ACTIVE_ITEM: '.active.carousel-item',
743      ITEM: '.carousel-item',
744      NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
745      INDICATORS: '.carousel-indicators',
746      DATA_SLIDE: '[data-slide], [data-slide-to]',
747      DATA_RIDE: '[data-ride="carousel"]'
748    };
749  
750    /**
751     * ------------------------------------------------------------------------
752     * Class Definition
753     * ------------------------------------------------------------------------
754     */
755  
756    var Carousel = function () {
757      function Carousel(element, config) {
758        _classCallCheck(this, Carousel);
759  
760        this._items = null;
761        this._interval = null;
762        this._activeElement = null;
763  
764        this._isPaused = false;
765        this._isSliding = false;
766  
767        this._config = this._getConfig(config);
768        this._element = $(element)[0];
769        this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
770  
771        this._addEventListeners();
772      }
773  
774      // getters
775  
776      // public
777  
778      Carousel.prototype.next = function next() {
779        if (this._isSliding) {
780          throw new Error('Carousel is sliding');
781        }
782        this._slide(Direction.NEXT);
783      };
784  
785      Carousel.prototype.nextWhenVisible = function nextWhenVisible() {
786        // Don't call next when the page isn't visible
787        if (!document.hidden) {
788          this.next();
789        }
790      };
791  
792      Carousel.prototype.prev = function prev() {
793        if (this._isSliding) {
794          throw new Error('Carousel is sliding');
795        }
796        this._slide(Direction.PREVIOUS);
797      };
798  
799      Carousel.prototype.pause = function pause(event) {
800        if (!event) {
801          this._isPaused = true;
802        }
803  
804        if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
805          Util.triggerTransitionEnd(this._element);
806          this.cycle(true);
807        }
808  
809        clearInterval(this._interval);
810        this._interval = null;
811      };
812  
813      Carousel.prototype.cycle = function cycle(event) {
814        if (!event) {
815          this._isPaused = false;
816        }
817  
818        if (this._interval) {
819          clearInterval(this._interval);
820          this._interval = null;
821        }
822  
823        if (this._config.interval && !this._isPaused) {
824          this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
825        }
826      };
827  
828      Carousel.prototype.to = function to(index) {
829        var _this3 = this;
830  
831        this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
832  
833        var activeIndex = this._getItemIndex(this._activeElement);
834  
835        if (index > this._items.length - 1 || index < 0) {
836          return;
837        }
838  
839        if (this._isSliding) {
840          $(this._element).one(Event.SLID, function () {
841            return _this3.to(index);
842          });
843          return;
844        }
845  
846        if (activeIndex === index) {
847          this.pause();
848          this.cycle();
849          return;
850        }
851  
852        var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
853  
854        this._slide(direction, this._items[index]);
855      };
856  
857      Carousel.prototype.dispose = function dispose() {
858        $(this._element).off(EVENT_KEY);
859        $.removeData(this._element, DATA_KEY);
860  
861        this._items = null;
862        this._config = null;
863        this._element = null;
864        this._interval = null;
865        this._isPaused = null;
866        this._isSliding = null;
867        this._activeElement = null;
868        this._indicatorsElement = null;
869      };
870  
871      // private
872  
873      Carousel.prototype._getConfig = function _getConfig(config) {
874        config = $.extend({}, Default, config);
875        Util.typeCheckConfig(NAME, config, DefaultType);
876        return config;
877      };
878  
879      Carousel.prototype._addEventListeners = function _addEventListeners() {
880        var _this4 = this;
881  
882        if (this._config.keyboard) {
883          $(this._element).on(Event.KEYDOWN, function (event) {
884            return _this4._keydown(event);
885          });
886        }
887  
888        if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
889          $(this._element).on(Event.MOUSEENTER, function (event) {
890            return _this4.pause(event);
891          }).on(Event.MOUSELEAVE, function (event) {
892            return _this4.cycle(event);
893          });
894        }
895      };
896  
897      Carousel.prototype._keydown = function _keydown(event) {
898        if (/input|textarea/i.test(event.target.tagName)) {
899          return;
900        }
901  
902        switch (event.which) {
903          case ARROW_LEFT_KEYCODE:
904            event.preventDefault();
905            this.prev();
906            break;
907          case ARROW_RIGHT_KEYCODE:
908            event.preventDefault();
909            this.next();
910            break;
911          default:
912            return;
913        }
914      };
915  
916      Carousel.prototype._getItemIndex = function _getItemIndex(element) {
917        this._items = $.makeArray($(element).parent().find(Selector.ITEM));
918        return this._items.indexOf(element);
919      };
920  
921      Carousel.prototype._getItemByDirection = function _getItemByDirection(direction, activeElement) {
922        var isNextDirection = direction === Direction.NEXT;
923        var isPrevDirection = direction === Direction.PREVIOUS;
924        var activeIndex = this._getItemIndex(activeElement);
925        var lastItemIndex = this._items.length - 1;
926        var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
927  
928        if (isGoingToWrap && !this._config.wrap) {
929          return activeElement;
930        }
931  
932        var delta = direction === Direction.PREVIOUS ? -1 : 1;
933        var itemIndex = (activeIndex + delta) % this._items.length;
934  
935        return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
936      };
937  
938      Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
939        var slideEvent = $.Event(Event.SLIDE, {
940          relatedTarget: relatedTarget,
941          direction: eventDirectionName
942        });
943  
944        $(this._element).trigger(slideEvent);
945  
946        return slideEvent;
947      };
948  
949      Carousel.prototype._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
950        if (this._indicatorsElement) {
951          $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
952  
953          var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
954  
955          if (nextIndicator) {
956            $(nextIndicator).addClass(ClassName.ACTIVE);
957          }
958        }
959      };
960  
961      Carousel.prototype._slide = function _slide(direction, element) {
962        var _this5 = this;
963  
964        var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
965        var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
966  
967        var isCycling = Boolean(this._interval);
968  
969        var directionalClassName = void 0;
970        var orderClassName = void 0;
971        var eventDirectionName = void 0;
972  
973        if (direction === Direction.NEXT) {
974          directionalClassName = ClassName.LEFT;
975          orderClassName = ClassName.NEXT;
976          eventDirectionName = Direction.LEFT;
977        } else {
978          directionalClassName = ClassName.RIGHT;
979          orderClassName = ClassName.PREV;
980          eventDirectionName = Direction.RIGHT;
981        }
982  
983        if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
984          this._isSliding = false;
985          return;
986        }
987  
988        var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
989        if (slideEvent.isDefaultPrevented()) {
990          return;
991        }
992  
993        if (!activeElement || !nextElement) {
994          // some weirdness is happening, so we bail
995          return;
996        }
997  
998        this._isSliding = true;
999  
1000        if (isCycling) {
1001          this.pause();
1002        }
1003  
1004        this._setActiveIndicatorElement(nextElement);
1005  
1006        var slidEvent = $.Event(Event.SLID, {
1007          relatedTarget: nextElement,
1008          direction: eventDirectionName
1009        });
1010  
1011        if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
1012  
1013          $(nextElement).addClass(orderClassName);
1014  
1015          Util.reflow(nextElement);
1016  
1017          $(activeElement).addClass(directionalClassName);
1018          $(nextElement).addClass(directionalClassName);
1019  
1020          $(activeElement).one(Util.TRANSITION_END, function () {
1021            $(nextElement).removeClass(directionalClassName + ' ' + orderClassName).addClass(ClassName.ACTIVE);
1022  
1023            $(activeElement).removeClass(ClassName.ACTIVE + ' ' + orderClassName + ' ' + directionalClassName);
1024  
1025            _this5._isSliding = false;
1026  
1027            setTimeout(function () {
1028              return $(_this5._element).trigger(slidEvent);
1029            }, 0);
1030          }).emulateTransitionEnd(TRANSITION_DURATION);
1031        } else {
1032          $(activeElement).removeClass(ClassName.ACTIVE);
1033          $(nextElement).addClass(ClassName.ACTIVE);
1034  
1035          this._isSliding = false;
1036          $(this._element).trigger(slidEvent);
1037        }
1038  
1039        if (isCycling) {
1040          this.cycle();
1041        }
1042      };
1043  
1044      // static
1045  
1046      Carousel._jQueryInterface = function _jQueryInterface(config) {
1047        return this.each(function () {
1048          var data = $(this).data(DATA_KEY);
1049          var _config = $.extend({}, Default, $(this).data());
1050  
1051          if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') {
1052            $.extend(_config, config);
1053          }
1054  
1055          var action = typeof config === 'string' ? config : _config.slide;
1056  
1057          if (!data) {
1058            data = new Carousel(this, _config);
1059            $(this).data(DATA_KEY, data);
1060          }
1061  
1062          if (typeof config === 'number') {
1063            data.to(config);
1064          } else if (typeof action === 'string') {
1065            if (data[action] === undefined) {
1066              throw new Error('No method named "' + action + '"');
1067            }
1068            data[action]();
1069          } else if (_config.interval) {
1070            data.pause();
1071            data.cycle();
1072          }
1073        });
1074      };
1075  
1076      Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
1077        var selector = Util.getSelectorFromElement(this);
1078  
1079        if (!selector) {
1080          return;
1081        }
1082  
1083        var target = $(selector)[0];
1084  
1085        if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
1086          return;
1087        }
1088  
1089        var config = $.extend({}, $(target).data(), $(this).data());
1090        var slideIndex = this.getAttribute('data-slide-to');
1091  
1092        if (slideIndex) {
1093          config.interval = false;
1094        }
1095  
1096        Carousel._jQueryInterface.call($(target), config);
1097  
1098        if (slideIndex) {
1099          $(target).data(DATA_KEY).to(slideIndex);
1100        }
1101  
1102        event.preventDefault();
1103      };
1104  
1105      _createClass(Carousel, null, [{
1106        key: 'VERSION',
1107        get: function get() {
1108          return VERSION;
1109        }
1110      }, {
1111        key: 'Default',
1112        get: function get() {
1113          return Default;
1114        }
1115      }]);
1116  
1117      return Carousel;
1118    }();
1119  
1120    /**
1121     * ------------------------------------------------------------------------
1122     * Data Api implementation
1123     * ------------------------------------------------------------------------
1124     */
1125  
1126    $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
1127  
1128    $(window).on(Event.LOAD_DATA_API, function () {
1129      $(Selector.DATA_RIDE).each(function () {
1130        var $carousel = $(this);
1131        Carousel._jQueryInterface.call($carousel, $carousel.data());
1132      });
1133    });
1134  
1135    /**
1136     * ------------------------------------------------------------------------
1137     * jQuery
1138     * ------------------------------------------------------------------------
1139     */
1140  
1141    $.fn[NAME] = Carousel._jQueryInterface;
1142    $.fn[NAME].Constructor = Carousel;
1143    $.fn[NAME].noConflict = function () {
1144      $.fn[NAME] = JQUERY_NO_CONFLICT;
1145      return Carousel._jQueryInterface;
1146    };
1147  
1148    return Carousel;
1149  }(jQuery);
1150  
1151  /**
1152   * --------------------------------------------------------------------------
1153   * Bootstrap (v4.0.0-alpha.6): collapse.js
1154   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1155   * --------------------------------------------------------------------------
1156   */
1157  
1158  var Collapse = function ($) {
1159  
1160    /**
1161     * ------------------------------------------------------------------------
1162     * Constants
1163     * ------------------------------------------------------------------------
1164     */
1165  
1166    var NAME = 'collapse';
1167    var VERSION = '4.0.0-alpha.6';
1168    var DATA_KEY = 'bs.collapse';
1169    var EVENT_KEY = '.' + DATA_KEY;
1170    var DATA_API_KEY = '.data-api';
1171    var JQUERY_NO_CONFLICT = $.fn[NAME];
1172    var TRANSITION_DURATION = 600;
1173  
1174    var Default = {
1175      toggle: true,
1176      parent: ''
1177    };
1178  
1179    var DefaultType = {
1180      toggle: 'boolean',
1181      parent: 'string'
1182    };
1183  
1184    var Event = {
1185      SHOW: 'show' + EVENT_KEY,
1186      SHOWN: 'shown' + EVENT_KEY,
1187      HIDE: 'hide' + EVENT_KEY,
1188      HIDDEN: 'hidden' + EVENT_KEY,
1189      CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
1190    };
1191  
1192    var ClassName = {
1193      SHOW: 'show',
1194      COLLAPSE: 'collapse',
1195      COLLAPSING: 'collapsing',
1196      COLLAPSED: 'collapsed'
1197    };
1198  
1199    var Dimension = {
1200      WIDTH: 'width',
1201      HEIGHT: 'height'
1202    };
1203  
1204    var Selector = {
1205      ACTIVES: '.card > .show, .card > .collapsing',
1206      DATA_TOGGLE: '[data-toggle="collapse"]'
1207    };
1208  
1209    /**
1210     * ------------------------------------------------------------------------
1211     * Class Definition
1212     * ------------------------------------------------------------------------
1213     */
1214  
1215    var Collapse = function () {
1216      function Collapse(element, config) {
1217        _classCallCheck(this, Collapse);
1218  
1219        this._isTransitioning = false;
1220        this._element = element;
1221        this._config = this._getConfig(config);
1222        this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]')));
1223  
1224        this._parent = this._config.parent ? this._getParent() : null;
1225  
1226        if (!this._config.parent) {
1227          this._addAriaAndCollapsedClass(this._element, this._triggerArray);
1228        }
1229  
1230        if (this._config.toggle) {
1231          this.toggle();
1232        }
1233      }
1234  
1235      // getters
1236  
1237      // public
1238  
1239      Collapse.prototype.toggle = function toggle() {
1240        if ($(this._element).hasClass(ClassName.SHOW)) {
1241          this.hide();
1242        } else {
1243          this.show();
1244        }
1245      };
1246  
1247      Collapse.prototype.show = function show() {
1248        var _this6 = this;
1249  
1250        if (this._isTransitioning) {
1251          throw new Error('Collapse is transitioning');
1252        }
1253  
1254        if ($(this._element).hasClass(ClassName.SHOW)) {
1255          return;
1256        }
1257  
1258        var actives = void 0;
1259        var activesData = void 0;
1260  
1261        if (this._parent) {
1262          actives = $.makeArray($(this._parent).find(Selector.ACTIVES));
1263          if (!actives.length) {
1264            actives = null;
1265          }
1266        }
1267  
1268        if (actives) {
1269          activesData = $(actives).data(DATA_KEY);
1270          if (activesData && activesData._isTransitioning) {
1271            return;
1272          }
1273        }
1274  
1275        var startEvent = $.Event(Event.SHOW);
1276        $(this._element).trigger(startEvent);
1277        if (startEvent.isDefaultPrevented()) {
1278          return;
1279        }
1280  
1281        if (actives) {
1282          Collapse._jQueryInterface.call($(actives), 'hide');
1283          if (!activesData) {
1284            $(actives).data(DATA_KEY, null);
1285          }
1286        }
1287  
1288        var dimension = this._getDimension();
1289  
1290        $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
1291  
1292        this._element.style[dimension] = 0;
1293        this._element.setAttribute('aria-expanded', true);
1294  
1295        if (this._triggerArray.length) {
1296          $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
1297        }
1298  
1299        this.setTransitioning(true);
1300  
1301        var complete = function complete() {
1302          $(_this6._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
1303  
1304          _this6._element.style[dimension] = '';
1305  
1306          _this6.setTransitioning(false);
1307  
1308          $(_this6._element).trigger(Event.SHOWN);
1309        };
1310  
1311        if (!Util.supportsTransitionEnd()) {
1312          complete();
1313          return;
1314        }
1315  
1316        var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
1317        var scrollSize = 'scroll' + capitalizedDimension;
1318  
1319        $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
1320  
1321        this._element.style[dimension] = this._element[scrollSize] + 'px';
1322      };
1323  
1324      Collapse.prototype.hide = function hide() {
1325        var _this7 = this;
1326  
1327        if (this._isTransitioning) {
1328          throw new Error('Collapse is transitioning');
1329        }
1330  
1331        if (!$(this._element).hasClass(ClassName.SHOW)) {
1332          return;
1333        }
1334  
1335        var startEvent = $.Event(Event.HIDE);
1336        $(this._element).trigger(startEvent);
1337        if (startEvent.isDefaultPrevented()) {
1338          return;
1339        }
1340  
1341        var dimension = this._getDimension();
1342        var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
1343  
1344        this._element.style[dimension] = this._element[offsetDimension] + 'px';
1345  
1346        Util.reflow(this._element);
1347  
1348        $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
1349  
1350        this._element.setAttribute('aria-expanded', false);
1351  
1352        if (this._triggerArray.length) {
1353          $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
1354        }
1355  
1356        this.setTransitioning(true);
1357  
1358        var complete = function complete() {
1359          _this7.setTransitioning(false);
1360          $(_this7._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
1361        };
1362  
1363        this._element.style[dimension] = '';
1364  
1365        if (!Util.supportsTransitionEnd()) {
1366          complete();
1367          return;
1368        }
1369  
1370        $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
1371      };
1372  
1373      Collapse.prototype.setTransitioning = function setTransitioning(isTransitioning) {
1374        this._isTransitioning = isTransitioning;
1375      };
1376  
1377      Collapse.prototype.dispose = function dispose() {
1378        $.removeData(this._element, DATA_KEY);
1379  
1380        this._config = null;
1381        this._parent = null;
1382        this._element = null;
1383        this._triggerArray = null;
1384        this._isTransitioning = null;
1385      };
1386  
1387      // private
1388  
1389      Collapse.prototype._getConfig = function _getConfig(config) {
1390        config = $.extend({}, Default, config);
1391        config.toggle = Boolean(config.toggle); // coerce string values
1392        Util.typeCheckConfig(NAME, config, DefaultType);
1393        return config;
1394      };
1395  
1396      Collapse.prototype._getDimension = function _getDimension() {
1397        var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
1398        return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
1399      };
1400  
1401      Collapse.prototype._getParent = function _getParent() {
1402        var _this8 = this;
1403  
1404        var parent = $(this._config.parent)[0];
1405        var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';
1406  
1407        $(parent).find(selector).each(function (i, element) {
1408          _this8._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
1409        });
1410  
1411        return parent;
1412      };
1413  
1414      Collapse.prototype._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
1415        if (element) {
1416          var isOpen = $(element).hasClass(ClassName.SHOW);
1417          element.setAttribute('aria-expanded', isOpen);
1418  
1419          if (triggerArray.length) {
1420            $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
1421          }
1422        }
1423      };
1424  
1425      // static
1426  
1427      Collapse._getTargetFromElement = function _getTargetFromElement(element) {
1428        var selector = Util.getSelectorFromElement(element);
1429        return selector ? $(selector)[0] : null;
1430      };
1431  
1432      Collapse._jQueryInterface = function _jQueryInterface(config) {
1433        return this.each(function () {
1434          var $this = $(this);
1435          var data = $this.data(DATA_KEY);
1436          var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
1437  
1438          if (!data && _config.toggle && /show|hide/.test(config)) {
1439            _config.toggle = false;
1440          }
1441  
1442          if (!data) {
1443            data = new Collapse(this, _config);
1444            $this.data(DATA_KEY, data);
1445          }
1446  
1447          if (typeof config === 'string') {
1448            if (data[config] === undefined) {
1449              throw new Error('No method named "' + config + '"');
1450            }
1451            data[config]();
1452          }
1453        });
1454      };
1455  
1456      _createClass(Collapse, null, [{
1457        key: 'VERSION',
1458        get: function get() {
1459          return VERSION;
1460        }
1461      }, {
1462        key: 'Default',
1463        get: function get() {
1464          return Default;
1465        }
1466      }]);
1467  
1468      return Collapse;
1469    }();
1470  
1471    /**
1472     * ------------------------------------------------------------------------
1473     * Data Api implementation
1474     * ------------------------------------------------------------------------
1475     */
1476  
1477    $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
1478      event.preventDefault();
1479  
1480      var target = Collapse._getTargetFromElement(this);
1481      var data = $(target).data(DATA_KEY);
1482      var config = data ? 'toggle' : $(this).data();
1483  
1484      Collapse._jQueryInterface.call($(target), config);
1485    });
1486  
1487    /**
1488     * ------------------------------------------------------------------------
1489     * jQuery
1490     * ------------------------------------------------------------------------
1491     */
1492  
1493    $.fn[NAME] = Collapse._jQueryInterface;
1494    $.fn[NAME].Constructor = Collapse;
1495    $.fn[NAME].noConflict = function () {
1496      $.fn[NAME] = JQUERY_NO_CONFLICT;
1497      return Collapse._jQueryInterface;
1498    };
1499  
1500    return Collapse;
1501  }(jQuery);
1502  
1503  /**
1504   * --------------------------------------------------------------------------
1505   * Bootstrap (v4.0.0-alpha.6): dropdown.js
1506   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1507   * --------------------------------------------------------------------------
1508   */
1509  
1510  var Dropdown = function ($) {
1511  
1512    /**
1513     * ------------------------------------------------------------------------
1514     * Constants
1515     * ------------------------------------------------------------------------
1516     */
1517  
1518    var NAME = 'dropdown';
1519    var VERSION = '4.0.0-alpha.6';
1520    var DATA_KEY = 'bs.dropdown';
1521    var EVENT_KEY = '.' + DATA_KEY;
1522    var DATA_API_KEY = '.data-api';
1523    var JQUERY_NO_CONFLICT = $.fn[NAME];
1524    var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
1525    var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
1526    var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
1527    var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
1528  
1529    var Event = {
1530      HIDE: 'hide' + EVENT_KEY,
1531      HIDDEN: 'hidden' + EVENT_KEY,
1532      SHOW: 'show' + EVENT_KEY,
1533      SHOWN: 'shown' + EVENT_KEY,
1534      CLICK: 'click' + EVENT_KEY,
1535      CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
1536      FOCUSIN_DATA_API: 'focusin' + EVENT_KEY + DATA_API_KEY,
1537      KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY
1538    };
1539  
1540    var ClassName = {
1541      BACKDROP: 'dropdown-backdrop',
1542      DISABLED: 'disabled',
1543      SHOW: 'show'
1544    };
1545  
1546    var Selector = {
1547      BACKDROP: '.dropdown-backdrop',
1548      DATA_TOGGLE: '[data-toggle="dropdown"]',
1549      FORM_CHILD: '.dropdown form',
1550      ROLE_MENU: '[role="menu"]',
1551      ROLE_LISTBOX: '[role="listbox"]',
1552      NAVBAR_NAV: '.navbar-nav',
1553      VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a'
1554    };
1555  
1556    /**
1557     * ------------------------------------------------------------------------
1558     * Class Definition
1559     * ------------------------------------------------------------------------
1560     */
1561  
1562    var Dropdown = function () {
1563      function Dropdown(element) {
1564        _classCallCheck(this, Dropdown);
1565  
1566        this._element = element;
1567  
1568        this._addEventListeners();
1569      }
1570  
1571      // getters
1572  
1573      // public
1574  
1575      Dropdown.prototype.toggle = function toggle() {
1576        if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
1577          return false;
1578        }
1579  
1580        var parent = Dropdown._getParentFromElement(this);
1581        var isActive = $(parent).hasClass(ClassName.SHOW);
1582  
1583        Dropdown._clearMenus();
1584  
1585        if (isActive) {
1586          return false;
1587        }
1588  
1589        if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
1590  
1591          // if mobile we use a backdrop because click events don't delegate
1592          var dropdown = document.createElement('div');
1593          dropdown.className = ClassName.BACKDROP;
1594          $(dropdown).insertBefore(this);
1595          $(dropdown).on('click', Dropdown._clearMenus);
1596        }
1597  
1598        var relatedTarget = {
1599          relatedTarget: this
1600        };
1601        var showEvent = $.Event(Event.SHOW, relatedTarget);
1602  
1603        $(parent).trigger(showEvent);
1604  
1605        if (showEvent.isDefaultPrevented()) {
1606          return false;
1607        }
1608  
1609        this.focus();
1610        this.setAttribute('aria-expanded', true);
1611  
1612        $(parent).toggleClass(ClassName.SHOW);
1613        $(parent).trigger($.Event(Event.SHOWN, relatedTarget));
1614  
1615        return false;
1616      };
1617  
1618      Dropdown.prototype.dispose = function dispose() {
1619        $.removeData(this._element, DATA_KEY);
1620        $(this._element).off(EVENT_KEY);
1621        this._element = null;
1622      };
1623  
1624      // private
1625  
1626      Dropdown.prototype._addEventListeners = function _addEventListeners() {
1627        $(this._element).on(Event.CLICK, this.toggle);
1628      };
1629  
1630      // static
1631  
1632      Dropdown._jQueryInterface = function _jQueryInterface(config) {
1633        return this.each(function () {
1634          var data = $(this).data(DATA_KEY);
1635  
1636          if (!data) {
1637            data = new Dropdown(this);
1638            $(this).data(DATA_KEY, data);
1639          }
1640  
1641          if (typeof config === 'string') {
1642            if (data[config] === undefined) {
1643              throw new Error('No method named "' + config + '"');
1644            }
1645            data[config].call(this);
1646          }
1647        });
1648      };
1649  
1650      Dropdown._clearMenus = function _clearMenus(event) {
1651        if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {
1652          return;
1653        }
1654  
1655        var backdrop = $(Selector.BACKDROP)[0];
1656        if (backdrop) {
1657          backdrop.parentNode.removeChild(backdrop);
1658        }
1659  
1660        var toggles = $.makeArray($(Selector.DATA_TOGGLE));
1661  
1662        for (var i = 0; i < toggles.length; i++) {
1663          var parent = Dropdown._getParentFromElement(toggles[i]);
1664          var relatedTarget = {
1665            relatedTarget: toggles[i]
1666          };
1667  
1668          if (!$(parent).hasClass(ClassName.SHOW)) {
1669            continue;
1670          }
1671  
1672          if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'focusin') && $.contains(parent, event.target)) {
1673            continue;
1674          }
1675  
1676          var hideEvent = $.Event(Event.HIDE, relatedTarget);
1677          $(parent).trigger(hideEvent);
1678          if (hideEvent.isDefaultPrevented()) {
1679            continue;
1680          }
1681  
1682          toggles[i].setAttribute('aria-expanded', 'false');
1683  
1684          $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
1685        }
1686      };
1687  
1688      Dropdown._getParentFromElement = function _getParentFromElement(element) {
1689        var parent = void 0;
1690        var selector = Util.getSelectorFromElement(element);
1691  
1692        if (selector) {
1693          parent = $(selector)[0];
1694        }
1695  
1696        return parent || element.parentNode;
1697      };
1698  
1699      Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
1700        if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
1701          return;
1702        }
1703  
1704        event.preventDefault();
1705        event.stopPropagation();
1706  
1707        if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
1708          return;
1709        }
1710  
1711        var parent = Dropdown._getParentFromElement(this);
1712        var isActive = $(parent).hasClass(ClassName.SHOW);
1713  
1714        if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) {
1715  
1716          if (event.which === ESCAPE_KEYCODE) {
1717            var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
1718            $(toggle).trigger('focus');
1719          }
1720  
1721          $(this).trigger('click');
1722          return;
1723        }
1724  
1725        var items = $(parent).find(Selector.VISIBLE_ITEMS).get();
1726  
1727        if (!items.length) {
1728          return;
1729        }
1730  
1731        var index = items.indexOf(event.target);
1732  
1733        if (event.which === ARROW_UP_KEYCODE && index > 0) {
1734          // up
1735          index--;
1736        }
1737  
1738        if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
1739          // down
1740          index++;
1741        }
1742  
1743        if (index < 0) {
1744          index = 0;
1745        }
1746  
1747        items[index].focus();
1748      };
1749  
1750      _createClass(Dropdown, null, [{
1751        key: 'VERSION',
1752        get: function get() {
1753          return VERSION;
1754        }
1755      }]);
1756  
1757      return Dropdown;
1758    }();
1759  
1760    /**
1761     * ------------------------------------------------------------------------
1762     * Data Api implementation
1763     * ------------------------------------------------------------------------
1764     */
1765  
1766    $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + ' ' + Event.FOCUSIN_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
1767      e.stopPropagation();
1768    });
1769  
1770    /**
1771     * ------------------------------------------------------------------------
1772     * jQuery
1773     * ------------------------------------------------------------------------
1774     */
1775  
1776    $.fn[NAME] = Dropdown._jQueryInterface;
1777    $.fn[NAME].Constructor = Dropdown;
1778    $.fn[NAME].noConflict = function () {
1779      $.fn[NAME] = JQUERY_NO_CONFLICT;
1780      return Dropdown._jQueryInterface;
1781    };
1782  
1783    return Dropdown;
1784  }(jQuery);
1785  
1786  var matched, browser;
1787  
1788  jQuery.uaMatch = function( ua ) {
1789      ua = ua.toLowerCase();
1790  
1791      var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
1792          /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
1793          /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
1794          /(msie) ([\w.]+)/.exec( ua ) ||
1795          ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
1796          [];
1797  
1798      return {
1799          browser: match[ 1 ] || "",
1800          version: match[ 2 ] || "0"
1801      };
1802  };
1803  
1804  matched = jQuery.uaMatch( navigator.userAgent );
1805  browser = {};
1806  
1807  if ( matched.browser ) {
1808      browser[ matched.browser ] = true;
1809      browser.version = matched.version;
1810  }
1811  
1812  // Chrome is Webkit, but Webkit is also Safari.
1813  if ( browser.chrome ) {
1814      browser.webkit = true;
1815  } else if ( browser.webkit ) {
1816      browser.safari = true;
1817  }
1818  
1819  jQuery.browser = browser;
1820  /**
1821   * --------------------------------------------------------------------------
1822   * Bootstrap (v4.0.0-alpha.6): modal.js
1823   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1824   * --------------------------------------------------------------------------
1825   */
1826  
1827  var Modal = function ($) {
1828  
1829    /**
1830     * ------------------------------------------------------------------------
1831     * Constants
1832     * ------------------------------------------------------------------------
1833     */
1834  
1835    var NAME = 'modal';
1836    var VERSION = '4.0.0-alpha.6';
1837    var DATA_KEY = 'bs.modal';
1838    var EVENT_KEY = '.' + DATA_KEY;
1839    var DATA_API_KEY = '.data-api';
1840    var JQUERY_NO_CONFLICT = $.fn[NAME];
1841    var TRANSITION_DURATION = 300;
1842    var BACKDROP_TRANSITION_DURATION = 150;
1843    var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
1844  
1845    var Default = {
1846      backdrop: true,
1847      keyboard: true,
1848      focus: true,
1849      show: true
1850    };
1851  
1852    var DefaultType = {
1853      backdrop: '(boolean|string)',
1854      keyboard: 'boolean',
1855      focus: 'boolean',
1856      show: 'boolean'
1857    };
1858  
1859    var Event = {
1860      HIDE: 'hide' + EVENT_KEY,
1861      HIDDEN: 'hidden' + EVENT_KEY,
1862      SHOW: 'show' + EVENT_KEY,
1863      SHOWN: 'shown' + EVENT_KEY,
1864      FOCUSIN: 'focusin' + EVENT_KEY,
1865      RESIZE: 'resize' + EVENT_KEY,
1866      CLICK_DISMISS: 'click.dismiss' + EVENT_KEY,
1867      KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY,
1868      MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY,
1869      MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY,
1870      CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
1871    };
1872  
1873    var ClassName = {
1874      SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
1875      BACKDROP: 'modal-backdrop',
1876      OPEN: 'modal-open',
1877      FADE: 'fade',
1878      SHOW: 'show'
1879    };
1880  
1881    var Selector = {
1882      DIALOG: '.modal-dialog',
1883      DATA_TOGGLE: '[data-toggle="modal"]',
1884      DATA_DISMISS: '[data-dismiss="modal"]',
1885      FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'
1886    };
1887  
1888    /**
1889     * ------------------------------------------------------------------------
1890     * Class Definition
1891     * ------------------------------------------------------------------------
1892     */
1893  
1894    var Modal = function () {
1895      function Modal(element, config) {
1896        _classCallCheck(this, Modal);
1897  
1898        this._config = this._getConfig(config);
1899        this._element = element;
1900        this._dialog = $(element).find(Selector.DIALOG)[0];
1901        this._backdrop = null;
1902        this._isShown = false;
1903        this._isBodyOverflowing = false;
1904        this._ignoreBackdropClick = false;
1905        this._isTransitioning = false;
1906        this._originalBodyPadding = 0;
1907        this._scrollbarWidth = 0;
1908      }
1909  
1910      // getters
1911  
1912      // public
1913  
1914      Modal.prototype.toggle = function toggle(relatedTarget) {
1915        return this._isShown ? this.hide() : this.show(relatedTarget);
1916      };
1917  
1918      Modal.prototype.show = function show(relatedTarget) {
1919        var _this9 = this;
1920  
1921        if (this._isTransitioning) {
1922          throw new Error('Modal is transitioning');
1923        }
1924  
1925        if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
1926          this._isTransitioning = true;
1927        }
1928        var showEvent = $.Event(Event.SHOW, {
1929          relatedTarget: relatedTarget
1930        });
1931  
1932        $(this._element).trigger(showEvent);
1933  
1934        if (this._isShown || showEvent.isDefaultPrevented()) {
1935          return;
1936        }
1937  
1938        this._isShown = true;
1939  
1940        this._checkScrollbar();
1941        this._setScrollbar();
1942  
1943        $(document.body).addClass(ClassName.OPEN);
1944  
1945        this._setEscapeEvent();
1946        this._setResizeEvent();
1947  
1948        $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
1949          return _this9.hide(event);
1950        });
1951  
1952        $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
1953          $(_this9._element).one(Event.MOUSEUP_DISMISS, function (event) {
1954            if ($(event.target).is(_this9._element)) {
1955              _this9._ignoreBackdropClick = true;
1956            }
1957          });
1958        });
1959  
1960        this._showBackdrop(function () {
1961          return _this9._showElement(relatedTarget);
1962        });
1963      };
1964  
1965      Modal.prototype.hide = function hide(event) {
1966        var _this10 = this;
1967  
1968        if (event) {
1969          event.preventDefault();
1970        }
1971  
1972        if (this._isTransitioning) {
1973          throw new Error('Modal is transitioning');
1974        }
1975  
1976        var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
1977        if (transition) {
1978          this._isTransitioning = true;
1979        }
1980  
1981        var hideEvent = $.Event(Event.HIDE);
1982        $(this._element).trigger(hideEvent);
1983  
1984        if (!this._isShown || hideEvent.isDefaultPrevented()) {
1985          return;
1986        }
1987  
1988        this._isShown = false;
1989  
1990        this._setEscapeEvent();
1991        this._setResizeEvent();
1992  
1993        $(document).off(Event.FOCUSIN);
1994  
1995        $(this._element).removeClass(ClassName.SHOW);
1996  
1997        $(this._element).off(Event.CLICK_DISMISS);
1998        $(this._dialog).off(Event.MOUSEDOWN_DISMISS);
1999  
2000        if (transition) {
2001          $(this._element).one(Util.TRANSITION_END, function (event) {
2002            return _this10._hideModal(event);
2003          }).emulateTransitionEnd(TRANSITION_DURATION);
2004        } else {
2005          this._hideModal();
2006        }
2007      };
2008  
2009      Modal.prototype.dispose = function dispose() {
2010        $.removeData(this._element, DATA_KEY);
2011  
2012        $(window, document, this._element, this._backdrop).off(EVENT_KEY);
2013  
2014        this._config = null;
2015        this._element = null;
2016        this._dialog = null;
2017        this._backdrop = null;
2018        this._isShown = null;
2019        this._isBodyOverflowing = null;
2020        this._ignoreBackdropClick = null;
2021        this._originalBodyPadding = null;
2022        this._scrollbarWidth = null;
2023      };
2024  
2025      // private
2026  
2027      Modal.prototype._getConfig = function _getConfig(config) {
2028        config = $.extend({}, Default, config);
2029        Util.typeCheckConfig(NAME, config, DefaultType);
2030        return config;
2031      };
2032  
2033      Modal.prototype._showElement = function _showElement(relatedTarget) {
2034        var _this11 = this;
2035  
2036        var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
2037  
2038        if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
2039          // don't move modals dom position
2040          document.body.appendChild(this._element);
2041        }
2042  
2043        this._element.style.display = 'block';
2044        this._element.removeAttribute('aria-hidden');
2045        this._element.scrollTop = 0;
2046  
2047        if (transition) {
2048          Util.reflow(this._element);
2049        }
2050  
2051        $(this._element).addClass(ClassName.SHOW);
2052  
2053        if (this._config.focus) {
2054          this._enforceFocus();
2055        }
2056  
2057        var shownEvent = $.Event(Event.SHOWN, {
2058          relatedTarget: relatedTarget
2059        });
2060  
2061        var transitionComplete = function transitionComplete() {
2062          if (_this11._config.focus) {
2063            _this11._element.focus();
2064          }
2065          _this11._isTransitioning = false;
2066          $(_this11._element).trigger(shownEvent);
2067        };
2068  
2069        if (transition) {
2070          $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
2071        } else {
2072          transitionComplete();
2073        }
2074      };
2075  
2076      Modal.prototype._enforceFocus = function _enforceFocus() {
2077        var _this12 = this;
2078  
2079        $(document).off(Event.FOCUSIN) // guard against infinite focus loop
2080        .on(Event.FOCUSIN, function (event) {
2081          if (document !== event.target && _this12._element !== event.target && !$(_this12._element).has(event.target).length) {
2082            _this12._element.focus();
2083          }
2084        });
2085      };
2086  
2087      Modal.prototype._setEscapeEvent = function _setEscapeEvent() {
2088        var _this13 = this;
2089  
2090        if (this._isShown && this._config.keyboard) {
2091          $(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
2092            if (event.which === ESCAPE_KEYCODE) {
2093              _this13.hide();
2094            }
2095          });
2096        } else if (!this._isShown) {
2097          $(this._element).off(Event.KEYDOWN_DISMISS);
2098        }
2099      };
2100  
2101      Modal.prototype._setResizeEvent = function _setResizeEvent() {
2102        var _this14 = this;
2103  
2104        if (this._isShown) {
2105          $(window).on(Event.RESIZE, function (event) {
2106            return _this14._handleUpdate(event);
2107          });
2108        } else {
2109          $(window).off(Event.RESIZE);
2110        }
2111      };
2112  
2113      Modal.prototype._hideModal = function _hideModal() {
2114        var _this15 = this;
2115  
2116        this._element.style.display = 'none';
2117        this._element.setAttribute('aria-hidden', 'true');
2118        this._isTransitioning = false;
2119        this._showBackdrop(function () {
2120          $(document.body).removeClass(ClassName.OPEN);
2121          _this15._resetAdjustments();
2122          _this15._resetScrollbar();
2123          $(_this15._element).trigger(Event.HIDDEN);
2124        });
2125      };
2126  
2127      Modal.prototype._removeBackdrop = function _removeBackdrop() {
2128        if (this._backdrop) {
2129          $(this._backdrop).remove();
2130          this._backdrop = null;
2131        }
2132      };
2133  
2134      Modal.prototype._showBackdrop = function _showBackdrop(callback) {
2135        var _this16 = this;
2136  
2137        var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
2138  
2139        if (this._isShown && this._config.backdrop) {
2140          var doAnimate = Util.supportsTransitionEnd() && animate;
2141  
2142          this._backdrop = document.createElement('div');
2143          this._backdrop.className = ClassName.BACKDROP;
2144  
2145          if (animate) {
2146            $(this._backdrop).addClass(animate);
2147          }
2148  
2149          $(this._backdrop).appendTo(document.body);
2150  
2151          $(this._element).on(Event.CLICK_DISMISS, function (event) {
2152            if (_this16._ignoreBackdropClick) {
2153              _this16._ignoreBackdropClick = false;
2154              return;
2155            }
2156            if (event.target !== event.currentTarget) {
2157              return;
2158            }
2159            if (_this16._config.backdrop === 'static') {
2160              _this16._element.focus();
2161            } else {
2162              _this16.hide();
2163            }
2164          });
2165  
2166          if (doAnimate) {
2167            Util.reflow(this._backdrop);
2168          }
2169  
2170          $(this._backdrop).addClass(ClassName.SHOW);
2171  
2172          if (!callback) {
2173            return;
2174          }
2175  
2176          if (!doAnimate) {
2177            callback();
2178            return;
2179          }
2180  
2181          $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
2182        } else if (!this._isShown && this._backdrop) {
2183          $(this._backdrop).removeClass(ClassName.SHOW);
2184  
2185          var callbackRemove = function callbackRemove() {
2186            _this16._removeBackdrop();
2187            if (callback) {
2188              callback();
2189            }
2190          };
2191  
2192          if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
2193            $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
2194          } else {
2195            callbackRemove();
2196          }
2197        } else if (callback) {
2198          callback();
2199        }
2200      };
2201  
2202      // ----------------------------------------------------------------------
2203      // the following methods are used to handle overflowing modals
2204      // todo (fat): these should probably be refactored out of modal.js
2205      // ----------------------------------------------------------------------
2206  
2207      Modal.prototype._handleUpdate = function _handleUpdate() {
2208        this._adjustDialog();
2209      };
2210  
2211      Modal.prototype._adjustDialog = function _adjustDialog() {
2212        var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
2213  
2214        if (!this._isBodyOverflowing && isModalOverflowing) {
2215          this._element.style.paddingLeft = this._scrollbarWidth + 'px';
2216        }
2217  
2218        if (this._isBodyOverflowing && !isModalOverflowing) {
2219          this._element.style.paddingRight = this._scrollbarWidth + 'px';
2220        }
2221      };
2222  
2223      Modal.prototype._resetAdjustments = function _resetAdjustments() {
2224        this._element.style.paddingLeft = '';
2225        this._element.style.paddingRight = '';
2226      };
2227  
2228      Modal.prototype._checkScrollbar = function _checkScrollbar() {
2229        this._isBodyOverflowing = document.body.clientWidth < window.innerWidth;
2230        this._scrollbarWidth = this._getScrollbarWidth();
2231      };
2232  
2233      Modal.prototype._setScrollbar = function _setScrollbar() {
2234        var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
2235  
2236        this._originalBodyPadding = document.body.style.paddingRight || '';
2237  
2238        if (this._isBodyOverflowing) {
2239          document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px';
2240        }
2241      };
2242  
2243      Modal.prototype._resetScrollbar = function _resetScrollbar() {
2244        document.body.style.paddingRight = this._originalBodyPadding;
2245      };
2246  
2247      Modal.prototype._getScrollbarWidth = function _getScrollbarWidth() {
2248        // thx d.walsh
2249        var scrollDiv = document.createElement('div');
2250        scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
2251        document.body.appendChild(scrollDiv);
2252        var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
2253        document.body.removeChild(scrollDiv);
2254        return scrollbarWidth;
2255      };
2256  
2257      // static
2258  
2259      Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
2260        return this.each(function () {
2261          var data = $(this).data(DATA_KEY);
2262          var _config = $.extend({}, Modal.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
2263  
2264          if (!data) {
2265            data = new Modal(this, _config);
2266            $(this).data(DATA_KEY, data);
2267          }
2268  
2269          if (typeof config === 'string') {
2270            if (data[config] === undefined) {
2271              throw new Error('No method named "' + config + '"');
2272            }
2273            data[config](relatedTarget);
2274          } else if (_config.show) {
2275            data.show(relatedTarget);
2276          }
2277        });
2278      };
2279  
2280      _createClass(Modal, null, [{
2281        key: 'VERSION',
2282        get: function get() {
2283          return VERSION;
2284        }
2285      }, {
2286        key: 'Default',
2287        get: function get() {
2288          return Default;
2289        }
2290      }]);
2291  
2292      return Modal;
2293    }();
2294  
2295    /**
2296     * ------------------------------------------------------------------------
2297     * Data Api implementation
2298     * ------------------------------------------------------------------------
2299     */
2300  
2301    $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
2302      var _this17 = this;
2303  
2304      var target = void 0;
2305      var selector = Util.getSelectorFromElement(this);
2306  
2307      if (selector) {
2308        target = $(selector)[0];
2309      }
2310  
2311      var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data());
2312  
2313      if (this.tagName === 'A' || this.tagName === 'AREA') {
2314        event.preventDefault();
2315      }
2316  
2317      var $target = $(target).one(Event.SHOW, function (showEvent) {
2318        if (showEvent.isDefaultPrevented()) {
2319          // only register focus restorer if modal will actually get shown
2320          return;
2321        }
2322  
2323        $target.one(Event.HIDDEN, function () {
2324          if ($(_this17).is(':visible')) {
2325            _this17.focus();
2326          }
2327        });
2328      });
2329  
2330      Modal._jQueryInterface.call($(target), config, this);
2331    });
2332  
2333    /**
2334     * ------------------------------------------------------------------------
2335     * jQuery
2336     * ------------------------------------------------------------------------
2337     */
2338  
2339    $.fn[NAME] = Modal._jQueryInterface;
2340    $.fn[NAME].Constructor = Modal;
2341    $.fn[NAME].noConflict = function () {
2342      $.fn[NAME] = JQUERY_NO_CONFLICT;
2343      return Modal._jQueryInterface;
2344    };
2345  
2346    return Modal;
2347  }(jQuery);
2348  
2349  /**
2350   * --------------------------------------------------------------------------
2351   * Bootstrap (v4.0.0-alpha.6): scrollspy.js
2352   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2353   * --------------------------------------------------------------------------
2354   */
2355  
2356  var ScrollSpy = function ($) {
2357  
2358    /**
2359     * ------------------------------------------------------------------------
2360     * Constants
2361     * ------------------------------------------------------------------------
2362     */
2363  
2364    var NAME = 'scrollspy';
2365    var VERSION = '4.0.0-alpha.6';
2366    var DATA_KEY = 'bs.scrollspy';
2367    var EVENT_KEY = '.' + DATA_KEY;
2368    var DATA_API_KEY = '.data-api';
2369    var JQUERY_NO_CONFLICT = $.fn[NAME];
2370  
2371    var Default = {
2372      offset: 10,
2373      method: 'auto',
2374      target: ''
2375    };
2376  
2377    var DefaultType = {
2378      offset: 'number',
2379      method: 'string',
2380      target: '(string|element)'
2381    };
2382  
2383    var Event = {
2384      ACTIVATE: 'activate' + EVENT_KEY,
2385      SCROLL: 'scroll' + EVENT_KEY,
2386      LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY
2387    };
2388  
2389    var ClassName = {
2390      DROPDOWN_ITEM: 'dropdown-item',
2391      DROPDOWN_MENU: 'dropdown-menu',
2392      NAV_LINK: 'nav-link',
2393      NAV: 'nav',
2394      ACTIVE: 'active'
2395    };
2396  
2397    var Selector = {
2398      DATA_SPY: '[data-spy="scroll"]',
2399      ACTIVE: '.active',
2400      LIST_ITEM: '.list-item',
2401      LI: 'li',
2402      LI_DROPDOWN: 'li.dropdown',
2403      NAV_LINKS: '.nav-link',
2404      DROPDOWN: '.dropdown',
2405      DROPDOWN_ITEMS: '.dropdown-item',
2406      DROPDOWN_TOGGLE: '.dropdown-toggle'
2407    };
2408  
2409    var OffsetMethod = {
2410      OFFSET: 'offset',
2411      POSITION: 'position'
2412    };
2413  
2414    /**
2415     * ------------------------------------------------------------------------
2416     * Class Definition
2417     * ------------------------------------------------------------------------
2418     */
2419  
2420    var ScrollSpy = function () {
2421      function ScrollSpy(element, config) {
2422        var _this18 = this;
2423  
2424        _classCallCheck(this, ScrollSpy);
2425  
2426        this._element = element;
2427        this._scrollElement = element.tagName === 'BODY' ? window : element;
2428        this._config = this._getConfig(config);
2429        this._selector = this._config.target + ' ' + Selector.NAV_LINKS + ',' + (this._config.target + ' ' + Selector.DROPDOWN_IT
2429EMS);
2430        this._offsets = [];
2431        this._targets = [];
2432        this._activeTarget = null;
2433        this._scrollHeight = 0;
2434  
2435        $(this._scrollElement).on(Event.SCROLL, function (event) {
2436          return _this18._process(event);
2437        });
2438  
2439        this.refresh();
2440        this._process();
2441      }
2442  
2443      // getters
2444  
2445      // public
2446  
2447      ScrollSpy.prototype.refresh = function refresh() {
2448        var _this19 = this;
2449  
2450        var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
2451  
2452        var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
2453  
2454        var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
2455  
2456        this._offsets = [];
2457        this._targets = [];
2458  
2459        this._scrollHeight = this._getScrollHeight();
2460  
2461        var targets = $.makeArray($(this._selector));
2462  
2463        targets.map(function (element) {
2464          var target = void 0;
2465          var targetSelector = Util.getSelectorFromElement(element);
2466  
2467          if (targetSelector) {
2468            target = $(targetSelector)[0];
2469          }
2470  
2471          if (target && (target.offsetWidth || target.offsetHeight)) {
2472            // todo (fat): remove sketch reliance on jQuery position/offset
2473            return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
2474          }
2475          return null;
2476        }).filter(function (item) {
2477          return item;
2478        }).sort(function (a, b) {
2479          return a[0] - b[0];
2480        }
2480).forEach(function (item) {
2481          _this19._offsets.push(item[0]);
2482          _this19._targets.push(item[1]);
2483        });
2484      };
2485  
2486      ScrollSpy.prototype.dispose = function dispose() {
2487        $.removeData(this._element, DATA_KEY);
2488        $(this._scrollElement).off(EVENT_KEY);
2489  
2490        this._element = null;
2491        this._scrollElement = null;
2492        this._config = null;
2493        this._selector = null;
2494        this._offsets = null;
2495        this._targets = null;
2496        this._activeTarget = null;
2497        this._scrollHeight = null;
2498      };
2499  
2500      // private
2501  
2502      ScrollSpy.prototype._getConfig = function _getConfig(config) {
2503        config = $.extend({}, Default, config);
2504  
2505        if (typeof config.target !== 'string') {
2506          var id = $(config.target).attr('id');
2507          if (!id) {
2508            id = Util.getUID(NAME);
2509            $(config.target).attr('id', id);
2510          }
2511          config.target = '#' + id;
2512        }
2513  
2514        Util.typeCheckConfig(NAME, config, DefaultType);
2515  
2516        return config;
2517      };
2518  
2519      ScrollSpy.prototype._getScrollTop = function _getScrollTop() {
2520        return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
2521      };
2522  
2523      ScrollSpy.prototype._getScrollHeight = function _getScrollHeight() {
2524        return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
2525      };
2526  
2527      ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() {
2528        return this._scrollElement === window ? window.innerHeight : this._scrollElement.offsetHeight;
2529      };
2530  
2531      ScrollSpy.prototype._process = function _process() {
2532        var this$1 = this;
2533  
2534        var scrollTop = this._getScrollTop() + this._config.offset;
2535        var scrollHeight = this._getScrollHeight();
2536        var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
2537  
2538        if (this._scrollHeight !== scrollHeight) {
2539          this.refresh();
2540        }
2541  
2542        if (scrollTop >= maxScroll) {
2543          var target = this._targets[this._targets.length - 1];
2544  
2545          if (this._activeTarget !== target) {
2546            this._activate(target);
2547          }
2548          return;
2549        }
2550  
2551        if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
2552          this._activeTarget = null;
2553          this._clear();
2554          return;
2555        }
2556  
2557        for (var i = this._offsets.length; i--;) {
2558          var isActiveTarget = this$1._activeTarget !== this$1._targets[i] && scrollTop >= this$1._offsets[i] && (this$1._offsets[i + 1] === undefined || scrollTop < this$1._offsets[i + 1]);
2559  
2560          if (isActiveTarget) {
2561            this$1._activate(this$1._targets[i]);
2562          }
2563        }
2564      };
2565  
2566      ScrollSpy.prototype._activate = function _activate(target) {
2567        this._activeTarget = target;
2568  
2569        this._clear();
2570  
2571        var queries = this._selector.split(',');
2572        queries = queries.map(function (selector) {
2573          return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
2574        });
2575  
2576        var $link = $(queries.join(','));
2577  
2578        if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
2579          $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
2580          $link.addClass(ClassName.ACTIVE);
2581        } else {
2582          // todo (fat) this is kinda sus...
2583          // recursively add actives to tested nav-links
2584          $link.parents(Selector.LI).find('> ' + Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
2585        }
2586  
2587        $(this._scrollElement).trigger(Event.ACTIVATE, {
2588          relatedTarget: target
2589        });
2590      };
2591  
2592      ScrollSpy.prototype._clear = function _clear() {
2593        $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
2594      };
2595  
2596      // static
2597  
2598      ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
2599        return this.each(function () {
2600          var data = $(this).data(DATA_KEY);
2601          var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config;
2602  
2603          if (!data) {
2604            data = new ScrollSpy(this, _config);
2605            $(this).data(DATA_KEY, data);
2606          }
2607  
2608          if (typeof config === 'string') {
2609            if (data[config] === undefined) {
2610              throw new Error('No method named "' + config + '"');
2611            }
2612            data[config]();
2613          }
2614        });
2615      };
2616  
2617      _createClass(ScrollSpy, null, [{
2618        key: 'VERSION',
2619        get: function get() {
2620          return VERSION;
2621        }
2622      }, {
2623        key: 'Default',
2624        get: function get() {
2625          return Default;
2626        }
2627      }]);
2628  
2629      return ScrollSpy;
2630    }();
2631  
2632    /**
2633     * ------------------------------------------------------------------------
2634     * Data Api implementation
2635     * ------------------------------------------------------------------------
2636     */
2637  
2638    $(window).on(Event.LOAD_DATA_API, function () {
2639      var scrollSpys = $.makeArray($(Selector.DATA_SPY));
2640  
2641      for (var i = scrollSpys.length; i--;) {
2642        var $spy = $(scrollSpys[i]);
2643        ScrollSpy._jQueryInterface.call($spy, $spy.data());
2644      }
2645    });
2646  
2647    /**
2648     * ------------------------------------------------------------------------
2649     * jQuery
2650     * ------------------------------------------------------------------------
2651     */
2652  
2653    $.fn[NAME] = ScrollSpy._jQueryInterface;
2654    $.fn[NAME].Constructor = ScrollSpy;
2655    $.fn[NAME].noConflict = function () {
2656      $.fn[NAME] = JQUERY_NO_CONFLICT;
2657      return ScrollSpy._jQueryInterface;
2658    };
2659  
2660    return ScrollSpy;
2661  }(jQuery);
2662  
2663  /**
2664   * --------------------------------------------------------------------------
2665   * Bootstrap (v4.0.0-alpha.6): tab.js
2666   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2667   * --------------------------------------------------------------------------
2668   */
2669  
2670  var Tab = function ($) {
2671  
2672    /**
2673     * ------------------------------------------------------------------------
2674     * Constants
2675     * ------------------------------------------------------------------------
2676     */
2677  
2678    var NAME = 'tab';
2679    var VERSION = '4.0.0-alpha.6';
2680    var DATA_KEY = 'bs.tab';
2681    var EVENT_KEY = '.' + DATA_KEY;
2682    var DATA_API_KEY = '.data-api';
2683    var JQUERY_NO_CONFLICT = $.fn[NAME];
2684    var TRANSITION_DURATION = 150;
2685  
2686    var Event = {
2687      HIDE: 'hide' + EVENT_KEY,
2688      HIDDEN: 'hidden' + EVENT_KEY,
2689      SHOW: 'show' + EVENT_KEY,
2690      SHOWN: 'shown' + EVENT_KEY,
2691      CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
2692    };
2693  
2694    var ClassName = {
2695      DROPDOWN_MENU: 'dropdown-menu',
2696      ACTIVE: 'active',
2697      DISABLED: 'disabled',
2698      FADE: 'fade',
2699      SHOW: 'show'
2700    };
2701  
2702    var Selector = {
2703      A: 'a',
2704      LI: 'li',
2705      DROPDOWN: '.dropdown',
2706      LIST: 'ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)',
2707      FADE_CHILD: '> .nav-item .fade, > .fade',
2708      ACTIVE: '.active',
2709      ACTIVE_CHILD: '> .nav-item > .active, > .active',
2710      DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"]',
2711      DROPDOWN_TOGGLE: '.dropdown-toggle',
2712      DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
2713    };
2714  
2715    /**
2716     * ------------------------------------------------------------------------
2717     * Class Definition
2718     * ------------------------------------------------------------------------
2719     */
2720  
2721    var Tab = function () {
2722      function Tab(element) {
2723        _classCallCheck(this, Tab);
2724  
2725        this._element = element;
2726      }
2727  
2728      // getters
2729  
2730      // public
2731  
2732      Tab.prototype.show = function show() {
2733        var _this20 = this;
2734  
2735        if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) {
2736          return;
2737        }
2738  
2739        var target = void 0;
2740        var previous = void 0;
2741        var listElement = $(this._element).closest(Selector.LIST)[0];
2742        var selector = Util.getSelectorFromElement(this._element);
2743  
2744        if (listElement) {
2745          previous = $.makeArray($(listElement).find(Selector.ACTIVE));
2746          previous = previous[previous.length - 1];
2747        }
2748  
2749        var hideEvent = $.Event(Event.HIDE, {
2750          relatedTarget: this._element
2751        });
2752  
2753        var showEvent = $.Event(Event.SHOW, {
2754          relatedTarget: previous
2755        });
2756  
2757        if (previous) {
2758          $(previous).trigger(hideEvent);
2759        }
2760  
2761        $(this._element).trigger(showEvent);
2762  
2763        if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
2764          return;
2765        }
2766  
2767        if (selector) {
2768          target = $(selector)[0];
2769        }
2770  
2771        this._activate(this._element, listElement);
2772  
2773        var complete = function complete() {
2774          var hiddenEvent = $.Event(Event.HIDDEN, {
2775            relatedTarget: _this20._element
2776          });
2777  
2778          var shownEvent = $.Event(Event.SHOWN, {
2779            relatedTarget: previous
2780          });
2781  
2782          $(previous).trigger(hiddenEvent);
2783          $(_this20._element).trigger(shownEvent);
2784        };
2785  
2786        if (target) {
2787          this._activate(target, target.parentNode, complete);
2788        } else {
2789          complete();
2790        }
2791      };
2792  
2793      Tab.prototype.dispose = function dispose() {
2794        $.removeClass(this._element, DATA_KEY);
2795        this._element = null;
2796      };
2797  
2798      // private
2799  
2800      Tab.prototype._activate = function _activate(element, container, callback) {
2801        var _this21 = this;
2802  
2803        var active = $(container).find(Selector.ACTIVE_CHILD)[0];
2804        var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
2805  
2806        var complete = function complete() {
2807          return _this21._transitionComplete(element, active, isTransitioning, callback);
2808        };
2809  
2810        if (active && isTransitioning) {
2811          $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
2812        } else {
2813          complete();
2814        }
2815  
2816        if (active) {
2817          $(active).removeClass(ClassName.SHOW);
2818        }
2819      };
2820  
2821      Tab.prototype._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) {
2822        if (active) {
2823          $(active).removeClass(ClassName.ACTIVE);
2824  
vendor: 4,639 bytes, lines 2825-2994
2825          var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
2826  
2827          if (dropdownChild) {
2828            $(dropdownChild).removeClass(ClassName.ACTIVE);
2829          }
2830  
2831          active.setAttribute('aria-expanded', false);
2832        }
2833  
2834        $(element).addClass(ClassName.ACTIVE);
2835        element.setAttribute('aria-expanded', true);
2836  
2837        if (isTransitioning) {
2838          Util.reflow(element);
2839          $(element).addClass(ClassName.SHOW);
2840        } else {
2841          $(element).removeClass(ClassName.FADE);
2842        }
2843  
2844        if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
2845  
2846          var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
2847          if (dropdownElement) {
2848            $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
2849          }
2850  
2851          element.setAttribute('aria-expanded', true);
2852        }
2853  
2854        if (callback) {
2855          callback();
2856        }
2857      };
2858  
2859      // static
2860  
2861      Tab._jQueryInterface = function _jQueryInterface(config) {
2862        return this.each(function () {
2863          var $this = $(this);
2864          var data = $this.data(DATA_KEY);
2865  
2866          if (!data) {
2867            data = new Tab(this);
2868            $this.data(DATA_KEY, data);
2869          }
2870  
2871          if (typeof config === 'string') {
2872            if (data[config] === undefined) {
2873              throw new Error('No method named "' + config + '"');
2874            }
2875            data[config]();
2876          }
2877        });
2878      };
2879  
2880      _createClass(Tab, null, [{
2881        key: 'VERSION',
2882        get: function get() {
2883          return VERSION;
2884        }
2885      }]);
2886  
2887      return Tab;
2888    }();
2889  
2890    /**
2891     * ------------------------------------------------------------------------
2892     * Data Api implementation
2893     * ------------------------------------------------------------------------
2894     */
2895  
2896    $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
2897      event.preventDefault();
2898      Tab._jQueryInterface.call($(this), 'show');
2899    });
2900  
2901    /**
2902     * ------------------------------------------------------------------------
2903     * jQuery
2904     * ------------------------------------------------------------------------
2905     */
2906  
2907    $.fn[NAME] = Tab._jQueryInterface;
2908    $.fn[NAME].Constructor = Tab;
2909    $.fn[NAME].noConflict = function () {
2910      $.fn[NAME] = JQUERY_NO_CONFLICT;
2911      return Tab._jQueryInterface;
2912    };
2913  
2914    return Tab;
2915  }(jQuery);
2916  
2917  /* global Tether */
2918  
2919  /**
2920   * --------------------------------------------------------------------------
2921   * Bootstrap (v4.0.0-alpha.6): tooltip.js
2922   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2923   * --------------------------------------------------------------------------
2924   */
2925  
2926  var Tooltip = function ($) {
2927  
2928    /**
2929     * Check for Tether dependency
2930     * Tether - http://tether.io/
2931     */
2932    if (typeof Tether === 'undefined') {
2933      throw new Error('Bootstrap tooltips require Tether (http://tether.io/)');
2934    }
2935  
2936    /**
2937     * ------------------------------------------------------------------------
2938     * Constants
2939     * ------------------------------------------------------------------------
2940     */
2941  
2942    var NAME = 'tooltip';
2943    var VERSION = '4.0.0-alpha.6';
2944    var DATA_KEY = 'bs.tooltip';
2945    var EVENT_KEY = '.' + DATA_KEY;
2946    var JQUERY_NO_CONFLICT = $.fn[NAME];
2947    var TRANSITION_DURATION = 150;
2948    var CLASS_PREFIX = 'bs-tether';
2949  
2950    var Default = {
2951      animation: true,
2952      template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-inner"></div></div>',
2953      trigger: 'hover focus',
2954      title: '',
2955      delay: 0,
2956      html: false,
2957      selector: false,
2958      placement: 'top',
2959      offset: '0 0',
2960      constraints: [],
2961      container: false
2962    };
2963  
2964    var DefaultType = {
2965      animation: 'boolean',
2966      template: 'string',
2967      title: '(string|element|function)',
2968      trigger: 'string',
2969      delay: '(number|object)',
2970      html: 'boolean',
2971      selector: '(string|boolean)',
2972      placement: '(string|function)',
2973      offset: 'string',
2974      constraints: 'array',
2975      container: '(string|element|boolean)'
2976    };
2977  
2978    var AttachmentMap = {
2979      TOP: 'bottom center',
2980      RIGHT: 'middle left',
2981      BOTTOM: 'top center',
2982      LEFT: 'middle right'
2983    };
2984  
2985    var HoverState = {
2986      SHOW: 'show',
2987      OUT: 'out'
2988    };
2989  
2990    var Event = {
2991      HIDE: 'hide' + EVENT_KEY,
2992      HIDDEN: 'hidden' + EVENT_KEY,
2993      SHOW: 'show' + EVENT_KEY,
2994      SHOWN: 'shown' + EVENT_KEY,
2995      INSERTED: 'inserted' + EVENT_KEY,
2996      CLICK: 'click' + EVENT_KEY,
2997      FOCUSIN: 'focusin' + EVENT_KEY,
2998      FOCUSOUT: 'focusout' + EVENT_KEY,
2999      MOUSEENTER: 'mouseenter' + EVENT_KEY,
3000      MOUSELEAVE: 'mouseleave' + EVENT_KEY
3001    };
3002  
3003    var ClassName = {
3004      FADE: 'fade',
3005      SHOW: 'show'
3006    };
3007  
3008    var Selector = {
3009      TOOLTIP: '.tooltip',
3010      TOOLTIP_INNER: '.tooltip-inner'
3011    };
3012  
3013    var TetherClass = {
3014      element: false,
3015      enabled: false
3016    };
3017  
3018    var Trigger = {
3019      HOVER: 'hover',
3020      FOCUS: 'focus',
3021      CLICK: 'click',
3022      MANUAL: 'manual'
3023    };
3024  
3025    /**
3026     * ------------------------------------------------------------------------
3027     * Class Definition
3028     * ------------------------------------------------------------------------
3029     */
3030  
3031    var Tooltip = function () {
3032      function Tooltip(element, config) {
3033        _classCallCheck(this, Tooltip);
3034  
3035        // private
3036        this._isEnabled = true;
3037        this._timeout = 0;
3038        this._hoverState = '';
3039        this._activeTrigger = {};
3040        this._isTransitioning = false;
3041        this._tether = null;
3042  
3043        // protected
3044        this.element = element;
3045        this.config = this._getConfig(config);
3046        this.tip = null;
3047  
3048        this._setListeners();
3049      }
3050  
3051      // getters
3052  
3053      // public
3054  
3055      Tooltip.prototype.enable = function enable() {
3056        this._isEnabled = true;
3057      };
3058  
3059      Tooltip.prototype.disable = function disable() {
3060        this._isEnabled = false;
3061      };
3062  
3063      Tooltip.prototype.toggleEnabled = function toggleEnabled() {
3064        this._isEnabled = !this._isEnabled;
3065      };
3066  
3067      Tooltip.prototype.toggle = function toggle(event) {
3068        if (event) {
3069          var dataKey = this.constructor.DATA_KEY;
3070          var context = $(event.currentTarget).data(dataKey);
3071  
3072          if (!context) {
3073            context = new this.constructor(event.currentTarget, this._getDelegateConfig());
3074            $(event.currentTarget).data(dataKey, context);
3075          }
3076  
3077          context._activeTrigger.click = !context._activeTrigger.click;
3078  
3079          if (context._isWithActiveTrigger()) {
3080            context._enter(null, context);
3081          } else {
3082            context._leave(null, context);
3083          }
3084        } else {
3085  
3086          if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
3087            this._leave(null, this);
3088            return;
3089          }
3090  
3091          this._enter(null, this);
3092        }
3093      };
3094  
3095      Tooltip.prototype.dispose = function dispose() {
3096        clearTimeout(this._timeout);
3097  
3098        this.cleanupTether();
3099  
3100        $.removeData(this.element, this.constructor.DATA_KEY);
3101  
3102        $(this.element).off(this.constructor.EVENT_KEY);
3103        $(this.element).closest('.modal').off('hide.bs.modal');
3104  
3105        if (this.tip) {
3106          $(this.tip).remove();
3107        }
3108  
3109        this._isEnabled = null;
3110        this._timeout = null;
3111        this._hoverState = null;
3112        this._activeTrigger = null;
3113        this._tether = null;
3114  
3115        this.element = null;
3116        this.config = null;
3117        this.tip = null;
3118      };
3119  
3120      Tooltip.prototype.show = function show() {
3121        var _this22 = this;
3122  
3123        if ($(this.element).css('display') === 'none') {
3124          throw new Error('Please use show on visible elements');
3125        }
3126  
3127        var showEvent = $.Event(this.constructor.Event.SHOW);
3128        if (this.isWithContent() && this._isEnabled) {
3129          if (this._isTransitioning) {
3130            throw new Error('Tooltip is transitioning');
3131          }
3132          $(this.element).trigger(showEvent);
3133  
3134          var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
3135  
3136          if (showEvent.isDefaultPrevented() || !isInTheDom) {
3137            return;
3138          }
3139  
3140          var tip = this.getTipElement();
3141          var tipId = Util.getUID(this.constructor.NAME);
3142  
3143          tip.setAttribute('id', tipId);
3144          this.element.setAttribute('aria-describedby', tipId);
3145  
3146          this.setContent();
3147  
3148          if (this.config.animation) {
3149            $(tip).addClass(ClassName.FADE);
3150          }
3151  
3152          var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
3153  
3154          var attachment = this._getAttachment(placement);
3155  
3156          var container = this.config.container === false ? document.body : $(this.config.container);
3157  
3158          $(tip).data(this.constructor.DATA_KEY, this).appendTo(container);
3159  
3160          $(this.element).trigger(this.constructor.Event.INSERTED);
3161  
3162          this._tether = new Tether({
3163            attachment: attachment,
3164            element: tip,
3165            target: this.element,
3166            classes: TetherClass,
3167            classPrefix: CLASS_PREFIX,
3168            offset: this.config.offset,
3169            constraints: this.config.constraints,
3170            addTargetClasses: false
3171          });
3172  
3173          Util.reflow(tip);
3174          this._tether.position();
3175  
3176          $(tip).addClass(ClassName.SHOW);
3177  
3178          var complete = function complete() {
3179            var prevHoverState = _this22._hoverState;
3180            _this22._hoverState = null;
3181            _this22._isTransitioning = false;
3182  
3183            $(_this22.element).trigger(_this22.constructor.Event.SHOWN);
3184  
3185            if (prevHoverState === HoverState.OUT) {
3186              _this22._leave(null, _this22);
3187            }
3188          };
3189  
3190          if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
3191            this._isTransitioning = true;
3192            $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
3193            return;
3194          }
3195  
3196          complete();
3197        }
3198      };
3199  
3200      Tooltip.prototype.hide = function hide(callback) {
3201        var _this23 = this;
3202  
3203        var tip = this.getTipElement();
3204        var hideEvent = $.Event(this.constructor.Event.HIDE);
3205        if (this._isTransitioning) {
3206          throw new Error('Tooltip is transitioning');
3207        }
3208        var complete = function complete() {
3209          if (_this23._hoverState !== HoverState.SHOW && tip.parentNode) {
3210            tip.parentNode.removeChild(tip);
3211          }
3212  
3213          _this23.element.removeAttribute('aria-describedby');
3214          $(_this23.element).trigger(_this23.constructor.Event.HIDDEN);
3215          _this23._isTransitioning = false;
3216          _this23.cleanupTether();
3217  
3218          if (callback) {
3219            callback();
3220          }
3221        };
3222  
3223        $(this.element).trigger(hideEvent);
3224  
3225        if (hideEvent.isDefaultPrevented()) {
3226          return;
3227        }
3228  
3229        $(tip).removeClass(ClassName.SHOW);
3230  
3231        this._activeTrigger[Trigger.CLICK] = false;
3232        this._activeTrigger[Trigger.FOCUS] = false;
3233        this._activeTrigger[Trigger.HOVER] = false;
3234  
3235        if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
3236          this._isTransitioning = true;
3237          $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
3238        } else {
3239          complete();
3240        }
3241  
3242        this._hoverState = '';
3243      };
3244  
3245      // protected
3246  
3247      Tooltip.prototype.isWithContent = function isWithContent() {
3248        return Boolean(this.getTitle());
3249      };
3250  
3251      Tooltip.prototype.getTipElement = function getTipElement() {
3252        return this.tip = this.tip || $(this.config.template)[0];
3253      };
3254  
3255      Tooltip.prototype.setContent = function setContent() {
3256        var $tip = $(this.getTipElement());
3257  
3258        this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
3259  
3260        $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW);
3261  
3262        this.cleanupTether();
3263      };
3264  
3265      Tooltip.prototype.setElementContent = function setElementContent($element, content) {
3266        var html = this.config.html;
3267        if ((typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && (content.nodeType || content.jquery)) {
3268          // content is a DOM node or a jQuery
3269          if (html) {
3270            if (!$(content).parent().is($element)) {
3271              $element.empty().append(content);
3272            }
3273          } else {
3274            $element.text($(content).text());
3275          }
3276        } else {
3277          $element[html ? 'html' : 'text'](content);
3278        }
3279      };
3280  
3281      Tooltip.prototype.getTitle = function getTitle() {
3282        var title = this.element.getAttribute('data-original-title');
3283  
3284        if (!title) {
3285          title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
3286        }
3287  
3288        return title;
3289      };
3290  
3291      Tooltip.prototype.cleanupTether = function cleanupTether() {
3292        if (this._tether) {
3293          this._tether.destroy();
3294        }
3295      };
3296  
3297      // private
3298  
3299      Tooltip.prototype._getAttachment = function _getAttachment(placement) {
3300        return AttachmentMap[placement.toUpperCase()];
3301      };
3302  
3303      Tooltip.prototype._setListeners = function _setListeners() {
3304        var _this24 = this;
3305  
3306        var triggers = this.config.trigger.split(' ');
3307  
3308        triggers.forEach(function (trigger) {
3309          if (trigger === 'click') {
3310            $(_this24.element).on(_this24.constructor.Event.CLICK, _this24.config.selector, function (event) {
3311              return _this24.toggle(event);
3312            });
3313          } else if (trigger !== Trigger.MANUAL) {
3314            var eventIn = trigger === Trigger.HOVER ? _this24.constructor.Event.MOUSEENTER : _this24.constructor.Event.FOCUSIN;
3315            var eventOut = trigger === Trigger.HOVER ? _this24.constructor.Event.MOUSELEAVE : _this24.constructor.Event.FOCUSOUT;
3316  
3317            $(_this24.element).on(eventIn, _this24.config.selector, function (event) {
3318              return _this24._enter(event);
3319            }).on(eventOut, _this24.config.selector, function (event) {
3320              return _this24._leave(event);
3321            });
3322          }
3323  
3324          $(_this24.element).closest('.modal').on('hide.bs.modal', function () {
3325            return _this24.hide();
3326          });
3327        });
3328  
3329        if (this.config.selector) {
3330          this.config = $.extend({}, this.config, {
3331            trigger: 'manual',
3332            selector: ''
3333          });
3334        } else {
3335          this._fixTitle();
3336        }
3337      };
3338  
3339      Tooltip.prototype._fixTitle = function _fixTitle() {
3340        var titleType = _typeof(this.element.getAttribute('data-original-title'));
3341        if (this.element.getAttribute('title') || titleType !== 'string') {
3342          this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
3343          this.element.setAttribute('title', '');
3344        }
3345      };
3346  
3347      Tooltip.prototype._enter = function _enter(event, context) {
3348        var dataKey = this.constructor.DATA_KEY;
3349  
3350        context = context || $(event.currentTarget).data(dataKey);
3351  
3352        if (!context) {
3353          context = new this.constructor(event.currentTarget, this._getDelegateConfig());
3354          $(event.currentTarget).data(dataKey, context);
3355        }
3356  
3357        if (event) {
3358          context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
3359        }
3360  
3361        if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
3362          context._hoverState = HoverState.SHOW;
3363          return;
3364        }
3365  
3366        clearTimeout(context._timeout);
3367  
3368        context._hoverState = HoverState.SHOW;
3369  
3370        if (!context.config.delay || !context.config.delay.show) {
3371          context.show();
3372          return;
3373        }
3374  
3375        context._timeout = setTimeout(function () {
3376          if (context._hoverState === HoverState.SHOW) {
3377            context.show();
3378          }
3379        }, context.config.delay.show);
3380      };
3381  
3382      Tooltip.prototype._leave = function _leave(event, context) {
3383        var dataKey = this.constructor.DATA_KEY;
3384  
3385        context = context || $(event.currentTarget).data(dataKey);
3386  
3387        if (!context) {
3388          context = new this.constructor(event.currentTarget, this._getDelegateConfig());
3389          $(event.currentTarget).data(dataKey, context);
3390        }
3391  
3392        if (event) {
3393          context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
3394        }
3395  
3396        if (context._isWithActiveTrigger()) {
3397          return;
3398        }
3399  
3400        clearTimeout(context._timeout);
3401  
3402        context._hoverState = HoverState.OUT;
3403  
3404        if (!context.config.delay || !context.config.delay.hide) {
3405          context.hide();
3406          return;
3407        }
3408  
3409        context._timeout = setTimeout(function () {
3410          if (context._hoverState === HoverState.OUT) {
3411            context.hide();
3412          }
3413        }, context.config.delay.hide);
3414      };
3415  
3416      Tooltip.prototype._isWithActiveTrigger = function _isWithActiveTrigger() {
3417        var this$1 = this;
3418  
3419        for (var trigger in this$1._activeTrigger) {
3420          if (this$1._activeTrigger[trigger]) {
3421            return true;
3422          }
3423        }
3424  
3425        return false;
3426      };
3427  
3428      Tooltip.prototype._getConfig = function _getConfig(config) {
3429        config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
3430  
3431        if (config.delay && typeof config.delay === 'number') {
3432          config.delay = {
3433            show: config.delay,
3434            hide: config.delay
3435          };
3436        }
3437  
3438        Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
3439  
3440        return config;
3441      };
3442  
3443      Tooltip.prototype._getDelegateConfig = function _getDelegateConfig() {
3444        var this$1 = this;
3445  
3446        var config = {};
3447  
3448        if (this.config) {
3449          for (var key in this$1.config) {
3450            if (this$1.constructor.Default[key] !== this$1.config[key]) {
3451              config[key] = this$1.config[key];
3452            }
3453          }
3454        }
3455  
3456        return config;
3457      };
3458  
3459      // static
3460  
3461      Tooltip._jQueryInterface = function _jQueryInterface(config) {
3462        return this.each(function () {
3463          var data = $(this).data(DATA_KEY);
3464          var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config;
3465  
3466          if (!data && /dispose|hide/.test(config)) {
3467            return;
3468          }
3469  
3470          if (!data) {
3471            data = new Tooltip(this, _config);
3472            $(this).data(DATA_KEY, data);
3473          }
3474  
3475          if (typeof config === 'string') {
3476            if (data[config] === undefined) {
3477              throw new Error('No method named "' + config + '"');
3478            }
3479            data[config]();
3480          }
3481        });
3482      };
3483  
3484      _createClass(Tooltip, null, [{
3485        key: 'VERSION',
3486        get: function get() {
3487          return VERSION;
3488        }
3489      }, {
3490        key: 'Default',
3491        get: function get() {
3492          return Default;
3493        }
3494      }, {
3495        key: 'NAME',
3496        get: function get() {
3497          return NAME;
3498        }
3499      }, {
3500        key: 'DATA_KEY',
3501        get: function get() {
3502          return DATA_KEY;
3503        }
3504      }, {
3505        key: 'Event',
3506        get: function get() {
3507          return Event;
3508        }
3509      }, {
3510        key: 'EVENT_KEY',
3511        get: function get() {
3512          return EVENT_KEY;
3513        }
3514      }, {
3515        key: 'DefaultType',
3516        get: function get() {
3517          return DefaultType;
3518        }
3519      }]);
3520  
3521      return Tooltip;
3522    }();
3523  
3524    /**
3525     * ------------------------------------------------------------------------
3526     * jQuery
3527     * ------------------------------------------------------------------------
3528     */
3529  
3530    $.fn[NAME] = Tooltip._jQueryInterface;
3531    $.fn[NAME].Constructor = Tooltip;
3532    $.fn[NAME].noConflict = function () {
3533      $.fn[NAME] = JQUERY_NO_CONFLICT;
3534      return Tooltip._jQueryInterface;
3535    };
3536  
3537    return Tooltip;
3538  }(jQuery);
3539  
3540  /**
3541   * --------------------------------------------------------------------------
3542   * Bootstrap (v4.0.0-alpha.6): popover.js
3543   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
3544   * --------------------------------------------------------------------------
3545   */
3546  
3547  var Popover = function ($) {
3548  
3549    /**
3550     * ------------------------------------------------------------------------
3551     * Constants
3552     * ------------------------------------------------------------------------
3553     */
3554  
3555    var NAME = 'popover';
3556    var VERSION = '4.0.0-alpha.6';
3557    var DATA_KEY = 'bs.popover';
3558    var EVENT_KEY = '.' + DATA_KEY;
3559    var JQUERY_NO_CONFLICT = $.fn[NAME];
3560  
3561    var Default = $.extend({}, Tooltip.Default, {
3562      placement: 'right',
3563      trigger: 'click',
3564      content: '',
3565      template: '<div class="popover" role="tooltip">' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
3566    });
3567  
3568    var DefaultType = $.extend({}, Tooltip.DefaultType, {
3569      content: '(string|element|function)'
3570    });
3571  
3572    var ClassName = {
3573      FADE: 'fade',
3574      SHOW: 'show'
3575    };
3576  
3577    var Selector = {
3578      TITLE: '.popover-title',
3579      CONTENT: '.popover-content'
3580    };
3581  
3582    var Event = {
3583      HIDE: 'hide' + EVENT_KEY,
3584      HIDDEN: 'hidden' + EVENT_KEY,
3585      SHOW: 'show' + EVENT_KEY,
3586      SHOWN: 'shown' + EVENT_KEY,
3587      INSERTED: 'inserted' + EVENT_KEY,
3588      CLICK: 'click' + EVENT_KEY,
3589      FOCUSIN: 'focusin' + EVENT_KEY,
3590      FOCUSOUT: 'focusout' + EVENT_KEY,
3591      MOUSEENTER: 'mouseenter' + EVENT_KEY,
3592      MOUSELEAVE: 'mouseleave' + EVENT_KEY
3593    };
3594  
3595    /**
3596     * ------------------------------------------------------------------------
3597     * Class Definition
3598     * ------------------------------------------------------------------------
3599     */
3600  
3601    var Popover = function (_Tooltip) {
3602      _inherits(Popover, _Tooltip);
3603  
3604      function Popover() {
3605        _classCallCheck(this, Popover);
3606  
3607        return _possibleConstructorReturn(this, _Tooltip.apply(this, arguments));
3608      }
3609  
3610      // overrides
3611  
3612      Popover.prototype.isWithContent = function isWithContent() {
3613        return this.getTitle() || this._getContent();
3614      };
3615  
3616      Popover.prototype.getTipElement = function getTipElement() {
3617        return this.tip = this.tip || $(this.config.template)[0];
3618      };
3619  
3620      Popover.prototype.setContent = function setContent() {
3621        var $tip = $(this.getTipElement());
3622  
3623        // we use append for html objects to maintain js events
3624        this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
3625        this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
3626  
3627        $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW);
3628  
3629        this.cleanupTether();
3630      };
3631  
3632      // private
3633  
3634      Popover.prototype._getContent = function _getContent() {
3635        return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
3636      };
3637  
3638      // static
3639  
3640      Popover._jQueryInterface = function _jQueryInterface(config) {
3641        return this.each(function () {
3642          var data = $(this).data(DATA_KEY);
3643          var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
3644  
3645          if (!data && /destroy|hide/.test(config)) {
3646            return;
3647          }
3648  
3649          if (!data) {
3650            data = new Popover(this, _config);
3651            $(this).data(DATA_KEY, data);
3652          }
3653  
3654          if (typeof config === 'string') {
3655            if (data[config] === undefined) {
3656              throw new Error('No method named "' + config + '"');
3657            }
3658            data[config]();
3659          }
3660        });
3661      };
3662  
3663      _createClass(Popover, null, [{
3664        key: 'VERSION',
3665  
3666  
3667        // getters
3668  
3669        get: function get() {
3670          return VERSION;
3671        }
3672      }, {
3673        key: 'Default',
3674        get: function get() {
3675          return Default;
3676        }
3677      }, {
3678        key: 'NAME',
3679        get: function get() {
3680          return NAME;
3681        }
3682      }, {
3683        key: 'DATA_KEY',
3684        get: function get() {
3685          return DATA_KEY;
3686        }
3687      }, {
3688        key: 'Event',
3689        get: function get() {
3690          return Event;
3691        }
3692      }, {
3693        key: 'EVENT_KEY',
3694        get: function get() {
3695          return EVENT_KEY;
3696        }
3697      }, {
3698        key: 'DefaultType',
3699        get: function get() {
3700          return DefaultType;
3701        }
3702      }]);
3703  
3704      return Popover;
3705    }(Tooltip);
3706  
3707    /**
3708     * ------------------------------------------------------------------------
3709     * jQuery
3710     * ------------------------------------------------------------------------
3711     */
3712  
3713    $.fn[NAME] = Popover._jQueryInterface;
3714    $.fn[NAME].Constructor = Popover;
3715    $.fn[NAME].noConflict = function () {
3716      $.fn[NAME] = JQUERY_NO_CONFLICT;
3717      return Popover._jQueryInterface;
3718    };
3719  
3720    return Popover;
3721  }(jQuery);
3722  
3723  }();
3724  
3725  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(14)))
3726  
3727  /***/ }),
3728  /* 5 */
3729  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3730  
3731  "use strict";
3732  /* harmony default export */ __webpack_exports__["a"] = ({
3733    init: function init() {
3734    // js to fire on Abous Us page
3735    },
3736  });
3737  
3738  
3739  /***/ }),
3740  /* 6 */
3741  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3742  
3743  "use strict";
3744  /* harmony default export */ __webpack_exports__["a"] = ({
3745    init: function init() {
3746      // JavaScript to be fired on all archive pages, specifically network pages
3747      
3748    },
3749    finalize: function finalize() {
3750      // JavaScript to be fired on all pages, after page specific JS is fired
3751    },
3752  });
3753  
3754  /***/ }),
3755  /* 7 */
3756  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3757  
3758  "use strict";
3759  /* WEBPACK VAR INJECTION */(function($, jQuery) {/* harmony default export */ __webpack_exports__["a"] = ({
3760    init: function init() {
3761      // JavaScript to be fired on all pages
3762  
3763  $(document).ready(function() { // Choosing AGS dropdown menu
3764  
3765    document.getElementsByTagName('body')[0].style.visibility = 'visible';
3766    $('.ags_relocation .ags-form').find('.container').removeClass();
3767  
3768    $('.wpcf7-form fieldset input').blur(function(){
3769  
3770      var className = $(this).attr('class');
3771  
3772      if ( className.indexOf('first-name') > -1 ) {
3773        $('#tabs-1 form').find('#first_name').val($('.first-name').val());
3774      }
3775  
3776      if ( className.indexOf('last-name') > -1 ) {
3777        $('#tabs-1 form').find('#last_name').val($('.last-name').val());
3778      }
3779  
3780      if ( className.indexOf('email') > -1 ) {
3781        $('#tabs-1 form').find('#email_address').val($('input.email').val());
3782      }
3783  
3784      if ( className.indexOf('telephone') > -1 ) {
3785        $('#tabs-1 form').find('#tel_contact').val($('.telephone').val());
3786      }
3787    });
3788  
3789    $('.ags_relocation #form input').blur(function() {
3790      var idName = $(this).attr('id')
3791  
3792      if ( idName.indexOf('first_name') > -1 ) {
3793        $('.wpcf7-form').find('.first-name').val($('#first_name').val());
3794      }
3795  
3796      if ( idName.indexOf('last_name') > -1 ) {
3797        $('.wpcf7-form').find('.last-name').val($('#last_name').val());
3798      }
3799  
3800      if ( idName.indexOf('email_address') > -1 ) {
3801        $('.wpcf7-form').find('.email').val($('#email_address').val());
3802      }
3803  
3804      if ( idName.indexOf('tel_contact') > -1 ) {
3805        $('.wpcf7-form').find('.telephone').val($('#tel_contact').val());
3806      }
3807    });
3808  
3809    $('.ags_relocation.page-id-35 .subject select option:nth-child(1)').val('');
3810  
3811    $('fieldset .subject select').change(function() {
3812      if ( $(this).val() == 'Removal Quote' )
3813      {
3814      
3815        $('.wpcf7-form').fadeOut(200, function(){
3816          $('#tabs-1, .return-form').fadeIn(200);
3817        });
3818        $('#intro h1').text("Get a free moving quote");
3819        $('#intro h5 span:nth-child(2)').show();
3820        //$('#intro h5 span:nth-child(2) span').show();
3821        $('#intro h5 span:nth-child(2)').prev().hide();
3822      }
3823    });
3824  
3825    $('.ags_relocation .return-form a').click(function() {
3826      $('#tabs-1, .return-form').fadeOut(200, function() {
3827        $('.wpcf7-form').fadeIn(200);
3828        $('.subject select').val('');
3829        $('.ags_relocation #intro h1').text('Contact Us');
3830        $('#intro h5 span:nth-child(2)').hide();
3831        //$('#intro h5 span:nth-child(2) span').hide();
3832        $('#intro h5 span:nth-child(2)').prev().show();
3833      }); 
3834    });
3835  
3836    $('.ags_relocation .wpcf7-form').prepend('<p class="error-response-msg">Please correct the below fields highlighted in red.</p>');
3837  
3838    $('.ags_relocation #tabs-1').find('.error-msg').each(function(){
3839      if ( $.trim($(this).text()) != '' )
3840      {
3841        $('#tabs-1').show();
3842        $('.wpcf7-form').hide();
3843      }
3844    });
3845  
3846    $('#sidebar .widget, .footer-post-col').find('ul li').each(function() {
3847      var pwd = $(this)[0].innerText;
3848      if ( pwd.indexOf('Protected:') >= 0 )
3849      { $(this).addClass('hide') }
3850    });
3851  
3852    if ( $(window).width() > 900 ) {
3853  
3854      $("li#menu-item-45 a:nth-child(1)").attr("href", "#"); // relo
3855      $('.nav > li:nth-child(2)').click(function() { 
3856        $('#choose-dropdown').toggleClass('display-block');
3857      });
3858  
3859      $('.nav > li:not(:nth-child(2))').click(function() {
3860        $('#choose-dropdown').delay(500).removeClass('display-block');
3861      });
3862      //$('.wpml-ls-item-pt-pt').hide();
3863      //$('.wpml-ls-item-de').hide();
3864    }
3865  });
3866  
3867  $(document).ready(function() { // Services dropdown menu
3868    if ( $(window).width() > 900 ) {
3869      $("li#menu-item-23847 a:nth-child(1)").attr("href", "#"); // relo
3870  
3871      $('.nav > li:nth-child(3)').click(function(){
3872        $('#services-dropdown').toggleClass('display-block');
3873      }); 
3874  
3875      $('.nav > li:not(:nth-child(3))').click(function(){
3876        $('#services-dropdown').delay(500).removeClass('display-block');
3877      });
3878    }
3879  });
3880  
3881  $(document).ready(function() { // Network dropdown menu
3882  
3883    if ( $(window).width() > 900 ) {
3884  
3885      $("li#menu-item-39 a:nth-child(1)").attr("href", "#"); // relo
3886  
3887      $('.nav > li:nth-child(4)').click(function(){
3888        $('#branch_dropdown_menu').toggleClass('display-block');
3889      });
3890  
3891      $('#mega-menu-primary_navigation > li:nth-child(4)').click(function(){
3892        $('#branch_dropdown_menu').toggleClass('display-block');
3893      });
3894  
3895      $('.nav > li:not(:nth-child(4))').click(function(){
3896        $('#branch_dropdown_menu').delay(500).removeClass('display-block');
3897      });
3898  
3899      $('#mega-menu-primary_navigation > li:not(:nth-child(4))').click(function(){
3900        $('#branch_dropdown_menu').delay(500).removeClass('display-block');
3901      });
3902  
3903      // WORKS FOR ALL DROPDOWNS!
3904      $('#topbar .container').hover(function(){
3905        $('.dropdown-base').delay(500).removeClass('display-block');
3906      });
3907  
3908      $('.custom-logo').hover(function(){
3909        $('.dropdown-base').delay(500).removeClass('display-block');
3910      });
3911  
3912      $('.ags_container').hover(function(){
3913        $('.dropdown-base').delay(500).removeClass('display-block');
3914      })
3915    
3916      $('.nav > li:nth-child(6)').hover(function(){
3917        $('.dropdown-base').delay(500).removeClass('display-block');
3918      });
3919  
3920      $('#mega-menu-primary_navigation > li:nth-child(6)').hover(function(){
3921        $('.dropdown-base').delay(500).removeClass('display-block');
3922      });
3923  
3924      $('button.cross').click(function(){
3925        $('.dropdown-base').delay(500).removeClass('display-block');
3926      });
3927    }
3928  });
3929  
3930  $(document).ready(function(){ 
3931  
3932    if ( $(window).width() > 900 ) { // Regular submenu (hover)
3933      $('body.pt-pt #menu-item-26092').addClass('menu-animation');
3934  
3935      $('.nav > li.menu-animation >  a:nth-of-type(1)').hover(function() {
3936        $('.menu-animation ul.sub-menu').css({'visibility': 'visible'});
3937      });
3938  
3939      $('#topbar .container').hover(function() {
3940        $('.menu-animation ul.sub-menu').delay(500).css({'visibility': 'hidden'});
3941      });
3942  
3943      $('.custom-logo').hover(function() {
3944        $('.menu-animation ul.sub-menu').delay(500).css({'visibility': 'hidden'});
3945      });
3946  
3947      $('.ags_container').hover(function() {
3948        $('.menu-animation ul.sub-menu').delay(500).css({'visibility': 'hidden'});
3949      });
3950  
3951      $('.nav > li:not(.menu-animation)').hover(function() {
3952        $('.menu-animation ul.sub-menu').css({'visibility': 'hidden'});
3953      });
3954    }
3955    // end
3956  
3957    if ( $('.country-content').is(':visible') ) {
3958      $('.content-dynamic').remove()
3959    }
3960    // Query desktop screens
3961    if ( $(window).width() > 900 ) {
3962      // Froesch Receipt
3963      var url = window.location.href;
3964      var brand_name = url.split('=');
3965  
3966      if ( brand_name[1] == 'froesch' ){
3967        $('input[name="brand-name"]').val('AGS FROESCH');
3968      }
3969  
3970      if ( $('.single-branch').length == 1 ){ // fire only on branch pages
3971  
3972        $('.accr_logos img').each(function(){
3973          if ( $(this).attr('title') == 'iso_logo.gig' ){
3974            $(this).replaceWith('<a href="http://www.sgs.com/certifiedclients" target="_blank"><img src="https://tray-international.intragest.info/images/accreditation/iso_logo.gif" align="center" title="iso_logo.gig"></a>');
3975          }
3976        });
3977      }
3978  
3979      // quote/contact menu buttons
3980      $('.de.ags_records ul.nav > li:nth-child(6)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-post_type menu-item-object-page menu-item-75" id="mega-menu-item-75"><div><a class="menu-quote-button-link" href="/kontaktseite" tabindex="0"><i class="fa fa-edit"></i>Kontaktseite</a></div></li>');
3981      $('.en.ags_movers ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="https://www.agsmovers.com/moving-quote" tabindex="0"><i class="fa fa-edit"></i>Get a quote</a></div></li>');
3982      $('.fr.ags_movers ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="https://www.ags-demenagement.com/devis-demenagement" tabindex="0"><i class="fa fa-edit"></i>DEMANDE DE DEVIS</a></div></li>');
3983      $('li#menu-item-75').replaceWith('<li class="menu-btn-red menu-item menu-item-type-post_type menu-item-object-page menu-item-75" id="mega-menu-item-75"><div><a class="menu-quote-button-link" href="/contact-us" tabindex="0"><i class="fa fa-edit"></i>CONTACT</a></div></li>');
3984      $('li#menu-item-23705').replaceWith('<li class="menu-btn-red menu-item menu-item-type-post_type menu-item-object-page menu-item-23705"><div><a class="menu-quote-button-link" href="/nous-contacter" tabindex="0"><i class="fa fa-edit"></i>NOUS CONTACTER</a></div></li>');
3985      $('li#menu-item-37').replaceWith('<li class="menu-btn-red menu-item menu-item-type-post_type menu-item-object-page menu-item-37" id="mega-menu-item-37"><div><a class="menu-quote-button-link" href="/contact-us" tabindex="0"><i class="fa fa-edit"></i>CONTACT</a></div></li>');
3986      $('li#menu-item-26109').replaceWith('<li class="menu-btn-red menu-item menu-item-type-post_type menu-item-object-page menu-item-26109" id="mega-menu-item-26109"><div><a class="menu-quote-button-link" href="/contact-us" tabindex="0"><i class="fa fa-edit"></i>CONTACT</a></div></li>');
3987  
3988      $('.menu-item-41372, .menu-item-41373, .menu-item-41374, .menu-item-41375').addClass('display-none');
3989  
3990      // different button for every language
3991      $('.ags_movers.de ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/angebot-anfordern/" tabindex="0"><i class="fa fa-edit"></i> Kostenloses Angebot</a></div></li>');
3992      $('.ags_movers.zh-hans ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/%E5%BC%95%E7%94%A8%E5%8F%A5/" tabindex="0"><i class="fa fa-edit"></i> 报价</a></div></li>');
3993      $('.ags_movers.cs ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/pozadat-o-cenovou-nabidku/" tabindex="0"><i class="fa fa-edit"></i> Získejte cenovou nabídku</a></div></li>');
3994      $('.ags_movers.pl ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/moving-quote/" tabindex="0"><i class="fa fa-edit"></i> Uzyskaj wycenę</a></div></li>');
3995      $('.ags_movers.bg ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/moving-quote/" tabindex="0"><i class="fa fa-edit"></i>
3995 получете безплатна оферта</a></div></li>');
3996      $('.ags_movers.hr ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/moving-quote/" tabindex="0"><i class="fa fa-edit"></i> ZATRAŽITE ponudu</a></div></li>');
3997      $('.ags_movers.ru ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/moving-quote/" tabindex="0"><i class="fa fa-edit"></i> Предложение</a></div></li>');
3998      $('.ags_movers.ko ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/moving-quote/" tabindex="0"><i class="fa fa-edit"></i> 무료견적</a></div></li>');
3999      $('.ags_movers.hu ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/moving-quote/" tabindex="0"><i class="fa fa-edit"></i> Ajánlat</a></div></li>');
4000      $('.ags_movers.es ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/solicite-un-presupuesto/" tabindex="0"><i class="fa fa-edit"></i> Obtener presupuesto</a></div></li>');
4001      $('.ags_movers.sl ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/pozadat-o-cenovou-nabidku/" tabindex="0"><i class="fa fa-edit"></i> Obrazec za povpraševanje</a></div></li>');
4002      $('.ags_movers.ro ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/moving-quote/" tabindex="0"><i class="fa fa-edit"></i> Solicita o oferta</a></div></li>');
4003      $('.ags_movers.pt-pt ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/solicite-um-orcamento/" tabindex="0"><i class="fa fa-edit"></i> Obter um orçamento</a></div></li>');
4004      $('.ags_movers.he ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="/moving-quote/" tabindex="0"><i class="fa fa-edit"></i> קבל הצעת מחיר</a></div></li>');
4005      $('.ags_movers.nl ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="https://www.agsmovers.nl/een-offerte-aanvragen/" tabindex="0"><i class="fa fa-edit"></i> Offerte aanvragen</a></div></li>');
4006      $('.ags_movers.fl ul.nav > li:nth-child(7)').replaceWith('<li class="menu-btn-red menu-item menu-item-type-custom menu-item-object-custom menu-item-15981" id="menu-item-15981"><div><a class="menu-quote-button-link" href="https://www.agscoussaert.com/een-offerte-aanvragen/" tabindex="0"><i class="fa fa-edit"></i> Offerte aanvragen</a></div></li>');
4007  
4008      if ($(".quality-accreditations").is(":visible") || $(".page-id-31549 ").is(":visible")) { 
4009        // adjusting icon list quality accreds page movers
4010        $(".col-md-6.padding-bottom-70.float_left:last-of-type()").removeClass("col-md-6").addClass("last-list");
4011        $(".padding-bottom-70.float_left.last-list").css({'padding-bottom': '70px', 'margin-top': '-35px'});
4012        $(".padding-bottom-70.float_left.last-list .list_content").css({'padding': '0 12px 0 166px'});
4013      }
4014    }
4015  
4016    if ($('.ags_froesch').is(':visible')) { // ags froesch changes
4017      $('div.center.column-image.block-1').replaceWith('<div class="center column-image  block-1"><img src="https://www.agsmovers.com/wp-content/uploads/2018/07/ags-froesch-indiv
4017iduals.jpg" class="attachment-full size-full" alt="" srcset="https://www.agsmovers.com/wp-content/uploads/2018/07/ags-froesch-individuals.jpg 580w, https://www.agsmovers.com/wp-content/uploads/2018/07/ags-froesch-individuals.jpg 300w" sizes="(max-width: 580px) 100vw, 580px" width="580" height="300"></div>');
4018      $("#figures").insertAfter($("#network-home"));
4019    }
4020  
4021    if ( $(".full_accreditations").is(":visible") && $(".row.right").is(":visible")) {
4022      $(".useful-links").insertAfter($(".row").last());
4023    } else {
4024      $(".useful-links").insertAfter($(".more-content").last());
4025    }
4026    // Wysiwyg editor fix
4027    $('#icon-list h5 p, #intro h5 p, #error404 h5 p, #columns_plus h5 p, #flexi h5 p').replaceWith(function() {
4028      return '<span>' + $(this).html() + '</span>';
4029    });
4030  
4031  }); // document.ready END 
4032  
4033  $('figcaption').replaceWith(function() { //adds italics to post captions
4034      return '<em><p><figcaption class="wp-caption-text">' + $(this).html() + '</figcaption></p></em>';
4035    });
4036  
4037    $('.no_branch').hide();// hide country with no branch
4038  
4039    if ($('.ags_records.de').is(':visible')) {
4040      $(".custom-logo").attr("src", "/wp-content/uploads/2018/04/pietsch.png").css({'height': '68px', 'width':'auto'});
4041    }
4042  
4043    var html = document.getElementsByTagName("html")[0].getAttribute("lang");
4044    var url = window.location.href;
4045  
4046    if( $('.de').is(':visible') ) {
4047      $(document).ready(function(){$(".ags_movers .custom-logo").attr("src", "/wp-content/uploads/2018/04/froesch.png").css({'height': '68px', 'width':'220px'});});
4048    } 
4049    else if ( url.indexOf('russia') !== -1 || url.indexOf('russie') !== -1) {
4050      $(document).ready(function(){$(".ags_movers .custom-logo").attr("src", "/wp-content/uploads/2018/06/froesch_russia.png").css({'height': '68px', 'width':'220px'});});
4051    } 
4052    else if (html == 'fr-FR' ) {
4053      $(document).ready(function(){$(".ags_records .custom-logo").attr("src", "/wp-content/uploads/sites/5/2018/01/ags_logo_fr.png");});
4054      $(document).ready(function(){$(".ags_movers .custom-logo").attr("src", "/wp-content/uploads/2018/05/ags_movers_fr.png");});
4055  
4056      if (url.indexOf('chine') !== -1) {
4057        $(document).ready(function(){$(".ags_movers .custom-logo").attr("src", "/wp-content/uploads/2018/12/AGS_Logo_Removals_China-regions-en-1.png");});
4058        $(document).ready(function(){$(".ags_movers .custom_foot_logo").attr("src", "https://www.agsmovers.com/wp-content/uploads/2018/12/AGS_Logo_Removals_China-foot-en.png");});        
4059      }
4060      else if (url.indexOf('brexit') !== -1) {
4061        $(document).ready(function(){$(".ags_movers .custom-logo").attr("src", "/wp-content/uploads/2019/04/relo_logo.png");});
4062        $(document).ready(function(){$(".ags_movers .custom_foot_logo").attr("src", "/wp-content/uploads/2019/04/footer-logo-relo.png");});
4063        $('#intro .col-md-6').removeClass('col-md-6').addClass('col-md-8');
4064      }
4065    }
4066    else if (html == 'zh-hans' ) {
4067      if (url.indexOf('agsfourwinds.cn') !== -1 ) {
4068        $(document).ready(function(){$(".ags_movers .custom-logo").attr("src", "/wp-content/uploads/2018/12/AGS_Logo_Removals_China-regions-en-1.png");});
4069        $(document).ready(function(){$(".ags_movers .custom_foot_logo").attr("src", "https://www.agsmovers.com/wp-content/uploads/2018/12/AGS_Logo_Removals_China-foot-en.png");});        
4070      }    
4071    }    
4072    else if ( url.indexOf('china') !== -1) {
4073      $(document).ready(function(){$(".ags_movers .custom-logo").attr("src", "/wp-content/uploads/2018/12/AGS_Logo_Removals_China-regions-en-1.png");});
4074      $(document).ready(function(){$(".ags_movers .custom_foot_logo").attr("src", "https://www.agsmovers.com/wp-content/uploads/2018/12/AGS_Logo_Removals_China-foot-en.png");});        
4075    }
4076  
4077    /* Detect Version of Firefox  */   
4078    if ($.browser.mozilla && $.browser.version <= "50.1.0" || $.browser.safari && $.browser.version <= "534.59.10" ) {
4079      $(document).ready(function() {
4080        $('.rb-shape.col-md-6').hide();
4081        $("#flexi div.row div.container div.content h3").addClass('flx-title');
4082        $("h3.card-title").addClass('crd-title');
4083        $(".column-title").addClass('column_ttl');
4084      });
4085    }
4086    if ( $.browser.safari && $.browser.version <= "534.59.10" ) {
4087      $(document).ready(function() {
4088        $('.layer2_text h4, .layer2-1_text h4,.layer3_text h4, .layer3-1_text h4').addClass('saf_534');
4089      });
4090    }
4091  
4092   // Query Mobile screens
4093  if ( $(window).width() < 900 ) {
4094    //$('.wpml-ls-item-de').hide();
4095    // mobile menu styling 
4096    $('.menu-item-41374, .menu-item-41375').addClass('mobile-quote-btn');
4097    
4098    if ($('.page-template-form-quote').is(':visible')) {
4099      $('.quote-button.mobile').addClass('form-page');
4100    }
4101    
4102    var menu_toggle = '<div class="menu-toggle"><div class="toggle-block menu-toggle-block toggle-block-1" id="toggle-block-1"></div></div>';
4103  
4104    $('.menu-main_menu-container').prepend(menu_toggle); // Movers
4105    $('.menu-main_menu-french-container').prepend(menu_toggle);
4106    $('.menu-main_menu_sk-container').prepend(menu_toggle);
4107    $('.menu-main_menu_be-container').prepend(menu_toggle);
4108    $('.menu-main_menu_fl-container').prepend(menu_toggle);
4109    $('.menu-main_menu_nl-container').prepend(menu_toggle);
4110    $('.menu-main_menu_sl-container').prepend(menu_toggle);
4111    $('.menu-main_menu_pl-container').prepend(menu_toggle);
4112    $('.menu-main_menu_bg-container').prepend(menu_toggle);
4113    $('.menu-man_menu_hr-container').prepend(menu_toggle);
4114    
4115    $('.menu-main-menu-container').prepend(menu_toggle); // RM
4116    $('.menu-main-menu-fr-container').prepend(menu_toggle);
4117  
4118    $('li#menu-item-23978').replaceWith('<li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-23978"><span class="active-site"><a href="https://www.ags-archivage.com" style="float:left;">Archivage</a><a class="dropDwn fa fa-chevron-down"></a></span></li>');
4119    $('li#menu-item-24421').replaceWith('<li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-24421"><span class="active-site"><a href="https://www.ags-demenagement.com" style="float:left">Déménagement</a><a class="dropDwn fa fa-chevron-down"></a></span></li>');
4120    $('li#menu-item-17').replaceWith('<li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-17"><span class="active-site"><a href="https://www.ags-recordsmanagement.com" style="float:left;">Records Management</a><a class="dropDwn fa fa-chevron-down"></a></span></li>');
4121    $('li#menu-item-15566').replaceWith('<li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-15566"><span class="active-site"><a href="https://www.agsmovers.com/" style="float:left">Worldwide Movers</a><a class="dropDwn fa fa-chevron-down"></a></span></li>');
4122    $('li#menu-item-11').replaceWith('<li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-11"><span class="active-site"><a href="#" style="float:left">Relocation</a><a class="dropDwn fa fa-chevron-down"></a></span></li>');
4123    $('li#menu-item-52767').replaceWith('<li id="menu-item-52767" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-52767"><span class="active-site"><a href="#" style="float:left">Wereldwijde Verhuizers</a><a class="dropDwn dropdown-use fa fa-chevron-down"></a></span></li>');
4124    $('li#menu-item-54025').replaceWith('<li id="menu-item-54025" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-54025"><span class="active-site"><a href="#" style="float:left">Wereldwijde Verhuizers</a><a class="dropDwn dropdown-use fa fa-chevron-down"></a></span></li>');
4125    $('li#menu-item-51235').replaceWith('<li id="menu-item-51235" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-51235"><span class="active-site"><a href="#" style="float:left">Wereldwijde Verhuizers</a><a class="dropDwn dropdown-use fa fa-chevron-down"></a></span></li>');
4126    
4127    $('#topmenu').append('<a class="dropDwn fa fa-chevron-down"></a>');
4128    $('.nav-primary').addClass('original');
4129    $('#intro').removeClass('lifted');
4130  
4131    $(document).ready(function() {
4132      if ($('.ags_records').is(':visible')) {
4133        $("li#menu-item-23685 a:nth-child(2)").attr("href", "/#");
4134        $("li#menu-item-22537 a:nth-child(2)").attr("href", "/#");
4135        $('li#menu-item-25137 a').attr("href", "/filiales");
4136        $('li#menu-item-25134 a').attr("href", "/branches");
4137      }
4138    });
4139  
4140    if ($('.ags_movers').is(':visible')) {
4141      $('#menu-main_menu-french > li:nth-child(4)').replaceWith('<li id="menu-item-33928" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-33928"><a href="https://www.ags-demenagement.com/filiales">Notre réseau</a></li>');
4142      $('#menu-main_menu > li:nth-child(4)').replaceWith('<li id="menu-item-33926" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-33926"><a href="https://www.agsmovers.com/branches">Our Network</a></li>');
4143    } // links network page on mobile menu
4144  
4145    // to style all languages except fr
4146    if ($('.fr').is(':visible')) {
4147      $('#menu-top-menu-fr').removeClass('topnav');
4148    }
4149  
4150    // movers mobile menu toggle
4151    $(function() {
4152      $('.menu-toggle').click(function(){ // opens & closes menu.
4153        $('.wp-custom-logo').toggleClass('open-menu');
4154      });
4155  
4156      $('.wrap.ags_container').click(function() {
4157        $('.wp-custom-logo').removeClass('open-menu');
4158      });
4159    });
4160  
4161    $('.menu-item-has-children').prepend('<div class="sub-drop-closed"></div>'); // target for sub-menu item
4162  
4163    //add display classes to menu with child items onclick - 09/02/2021 Tasmyn
4164    $.fn.mobileChildMenuItems = function(id) { 
4165      var menu_item = 'li.'+id;
4166      $(menu_item).find( "ul" ).toggleClass('display-block display-none');
4167      $(menu_item).find( 'div').toggleClass('sub-drop-open');
4168    }
4169  
4170    // call function to dropdown menu with child items. - 09/02/2021 Tasmyn
4171    $('.menu-item-has-children').click(function() { 
4172      $.fn.mobileChildMenuItems($(this).attr('id'));
4173    });
4174  
4175    /*commented out 09/02/2021 - What is the point of this code? Should the menu not be dynamic why are we calling individual menu items? (Tasmyn)
4176    var choosing_ags = '.menu-item-33924';
4177    var choisir_ags = '.menu-item-33927';
4178    var services = '.menu-item-33925';
4179    var services_fr = '.menu-item-33929';
4180    var about_us = '.menu-item-22537';
4181    var rm_services = '.menu-item-25273';
4182    var sobre = '.menu-item-26092'; // pt
4183    var rm_services_pt = '.menu-item-26111';
4184    var a_propos = '.menu-item-23685';
4185    var rm_services_fr = '.menu-item-25272';
4186    var our_values = '.menu-item-24151';
4187    var relo_services = '.menu-item-24152';
4188  
4189    $(relo_services).click(function() { 
4190      // relo
4191      $('body').addClass('stevewashere');
4192  
4193      $(our_values).removeClass('sub-drop-open');
4194      $('.menu-item-24151 .sub-menu').removeClass('display-block');
4195    });
4196  
4197    $(our_values).click(function() { 
4198      $(relo_services).removeClass('sub-drop-open');
4199      $('.menu-item-24152 .sub-menu').removeClass('display-block');
4200    });
4201  
4202    $(services).click(function() { 
4203      // movers
4204    $(choosing_ags).removeClass('sub-drop-open');
4205      $('.menu-item-33924 .sub-menu').removeClass('display-block');
4206    });
4207  
4208    $(choosing_ags).click(function() {
4209      $(services).removeClass('sub-drop-open');
4210      $('.menu-item-33925 .sub-menu').removeClass('display-block');
4211    });
4212  
4213    $(services_fr).click(function() {
4214      $(choisir_ags).removeClass('sub-drop-open');
4215      $('.menu-item-33927 .sub-menu').removeClass('display-block');
4216    });
4217  
4218    $(choisir_ags).click(function() {
4219      $(services_fr).removeClass('sub-drop-open');
4220      $('.menu-item-33929 .sub-menu').removeClass('display-block');
4221    });
4222  
4223    $(about_us).click(function() { 
4224      // records
4225      $(rm_services).removeClass('sub-drop-open');
4226      $('.menu-item-25273 .sub-menu').removeClass('display-block');
4227    });
4228  
4229    $(sobre).click(function() { // records
4230      $(rm_services_pt).removeClass('sub-drop-open');
4231      $('.menu-item-26092 .sub-menu').removeClass('display-block');
4232    });
4233  
4234    $(rm_services).click(function() {
4235      $(about_us).removeClass('sub-drop-open');
4236      $('.menu-item-22537 .sub-menu').removeClass('display-block');
4237    });
4238  
4239    $(a_propos).click(function() {
4240      $(rm_services_fr).removeClass('sub-drop-open');
4241      $('.menu-item-25272 .sub-menu').removeClass('display-block');
4242    });
4243  
4244    $(rm_services_fr).click(function() {
4245      $(a_propos).removeClass('sub-drop-open');
4246      $('.menu-item-23685 .sub-menu').removeClass('display-block');
4247    });*/
4248  
4249    // fixes spacing on network section
4250    $("#network-home .container.padding-top-30").removeClass("container").removeClass("padding-top-30");
4251  
4252    // end of spacing fix
4253    $(window).scroll(function() {
4254      if ($(window).scrollTop() > 0) {
4255        $('.wp-custom-logo').delay(500).removeClass('open-menu');
4256      }
4257  
4258      if ($(window).scrollTop() > 128 ){
4259        $('#mega-menu-primary_navigation').css('visibility','hidden');
4260        $('.mega-menu-open').removeClass('mega-menu-open');
4261      }
4262      if ( $(window).scrollTop() == 0 || $(window).scrollTop() > 127 ) {
4263        $('#mega-menu-primary_navigation').css('visibility', 'visible');
4264      }
4265    });
4266  
4267    $('.wpml-ls-sub-menu a').css({'margin-right':'6px', 'background-color':'transparent'});
4268  
4269      $('.dropDwn').click(function() {
4270        $(this).toggleClass('fa-chevron-up fa-chevron-down');
4271        $('.wp-custom-logo').removeClass('open-menu');
4272  
4273        if ($(this).hasClass('fa-chevron-up')) {
4274          $("#topbar").animate({height: "55px"});
4275          $(".topnav li:not(:first-child)").css({'display': 'block'});
4276          $("#menu-top-menu-fr li:not(:first-child)").css({'display': 'block'});
4277        } else {
4278          $("#topbar").animate({height: "28px"}, 300);
4279          $(".topnav li:not(:first-child)").css({'display': 'none'});
4280          $("#menu-top-menu-fr li:not(:first-child)").css({'display': 'none'});
4281        }
4282      });
4283    } // end mobile scripts
4284  
4285    // add default scripts here
4286    if ($('#portal').is(':visible')) { // client portal page
4287      $('#intro div.col-md-6').removeClass('col-md-6');
4288    }
4289  
4290    /* COMMENTED OUT COOKIES JS - REPLACE WITH COOKIEYES PLUGIN 29SEP2021
4291    if ( localStorage.getItem('cookie_banner') !== 'notice' ) // Set Up Cookie Notice
4292    {
4293      $('.cookies').fadeIn();
4294      $('.site-info').addClass('margin-bottom-60');
4295    }
4296  
4297    $('.cookie_dismiss').click(function() {
4298      $('.cookies').fadeOut();
4299      localStorage.setItem('cookie_banner', 'notice'); // Setting the localStorage key = cookie_banner
4300      $('.site-info').removeClass('margin-bottom-60');
4301    });
4302    */
4303  
4304    $(document).ready(function(){
4305      if ($('.rtl.he').is(':visible')) { // coz we got that jewish flow 02.10.18
4306        $('#intro a.ags_cta').text(' קבל הצעת מחיר');
4307      } 
4308  
4309    $(function() {
4310    /* Movers also gets an interactive map 24.10.2018 {NB} */
4311      $('.africa-a').hover(function() { // hover over tooltip
4312        $('.tooltipp.africa').fadeTo("fast", 0.9);
4313      },function() {
4314        $('.tooltipp.africa').delay(500).fadeTo("fast", 0);
4315      });
4316  
4317      $('.americas-a').hover(function() { // hover over tooltip
4318        $('.tooltipp.americas').fadeTo("fast", 0.9);
4319      },function() {
4320        $('.tooltipp.americas').fadeTo("fast", 0);
4321      });
4322  
4323      $('.asia-a').hover(function() { // hover over tooltip
4324        $('.tooltipp.asia').fadeTo("fast", 0.9);
4325      },function() {
4326        $('.tooltipp.asia').fadeTo("fast", 0);
4327      });
4328  
4329      $('.europe-a').hover(function(){ // hover over tooltip
4330        $('.tooltipp.europe').fadeTo("fast", 0.9);
4331      },function(){
4332        $('.tooltipp.europe').fadeTo("fast", 0);
4333      });
4334  
4335      $('.middle-east-a').hover(function() { // hover over tooltip
4336        $('.tooltipp.middle-east').fadeTo("fast", 0.9);
4337      },function() {
4338        $('.tooltipp.middle-east').fadeTo("fast", 0);
4339      });
4340  
4341      $('.australasia-a').hover(function() { // hover over tooltip
4342        $('.tooltipp.australasia').fadeTo("fast", 0.9);
4343      },function() {
4344        $('.tooltipp.australasia').fadeTo("fast", 0);
4345      });
4346    });
4347  
4348    if ($('.ags_relocation').is(':visible')) {
4349      $('#footer-services h3').wrap('<a href="/our-services"></a>');
4350      $('#footer-hubs h3').wrap('<a href="/our-hubs"></a>');
4351      $('.footer-post-col h3').wrap('<a href="/news"></a>');
4352  
4353      $(function() { // network map tooltips 19.10.2018 {NB}
4354        $('.hong-kong-a').hover(function(){ // hover over tooltip
4355        $('.tooltipp.hong-kong').fadeTo("fast", 0.9);
4356        },function(){
4357          $('.tooltipp.hong-kong').delay(500).fadeTo("fast", 0);
4358        });
4359      
4360        $('.dubai-a').hover(function(){ // hover over tooltip
4361          $('.tooltipp.dubai').fadeTo("fast", 0.9);
4362        },function(){
4363          $('.tooltipp.dubai').fadeTo("fast", 0);
4364        });
4365  
4366        $('.london-a').hover(function(){ // hover over tooltip
4367          $('.tooltipp.london').fadeTo("fast", 0.9);
4368        },function(){
4369          $('.tooltipp.london').fadeTo("fast", 0);
4370        });
4371  
4372        $('.amsterdam-a').hover(function(){ // hover over tooltip
4373          $('.tooltipp.amsterdam').fadeTo("fast", 0.9);
4374        },function(){
4375          $('.tooltipp.amsterdam').fadeTo("fast", 0);
4376        });
4377  
4378        $('.paris-a').hover(function(){ // hover over tooltip
4379          $('.tooltipp.paris').fadeTo("fast", 0.9);
4380        },function(){
4381          $('.tooltipp.paris').fadeTo("fast", 0);
4382        });
4383  
4384        $('.cape-town-a').hover(function(){ // hover over tooltip
4385          $('.tooltipp.cape-town').fadeTo("fast", 0.9);
4386        },function(){
4387          $('.tooltipp.cape-town').fadeTo("fast", 0);
4388        });
4389  
4390        $('.united-states-a').hover(function(){ // hover over tooltip
4391          $('.tooltipp.united-states').fadeTo("fast", 0.9);
4392        },function(){
4393          $('.tooltipp.united-states').fadeTo("fast", 0);
4394        });
4395      }); 
4396    }
4397  
4398    if ($('.fr').is(':visible')) { // translates load more button on news page
4399      $('span.elm-button-text').replaceWith('<span class="elm-button-text">Voir plus de news</span>');
4400    }
4401  
4402    if ($("#network").is(":visible")) { // fixes breadcrumb styling for network pages
4403      $("#breadcrumbs").addClass("network-crumbs");
4404    }
4405  
4406    if ($('#related-news').is(':visible')) {
4407      $(".item").addClass('col-md-4');
4408    }
4409  
4410    if (($(".page-id-33408").is(":visible")) || ($(".page-id-33417").is(":visible"))) { // cta on tenancy management
4411      $(".more-content p").css({'text-align': 'center'});
4412    }
4413  
4414    if ( $('#error404').is(':visible') ){ // removing animations on 404
4415      $('.numbers').css({'opacity': '1'});
4416      $('.numbers-label').css({'opacity': '1'});
4417      $('.solution-box').css({'display': 'block'});
4418      $('#figures .col-md-3').css({'opacity': '1'});
4419    }
4420  
4421    if ($('.error404.en.fr').is(':visible')) {
4422      $('.error404.fr').removeClass('en');
4423    }
4424  
4425    // styling on error404
4426    $('#error404 span:nth-child(2)').prepend('<br /><br />');
4427    
4428    if ($(".no-city-content").is(":visible")) { //fixes spacing issues on custom RM branches
4429        $("#intro p").addClass("branch-no-city");
4430        $("#intro p:nth-of-type(1)").text($("#intro p:nth-child(-n+2)").text());
4431      }
4432    });
4433  
4434    $(window).scroll(function() {
4435  
4436      var side_img = $('.intro_img');
4437      var services_1 = $('.services-1');
4438      var services_2 = $('.services-2');
4439      var services_3 = $('.services-3');
4440      var services_4 = $('.services-4');
4441      var services_5 = $('.services-5');
4442      var services_6 = $('.services-6');
4443      var scrl = $(window).scrollTop();
4444  
4445      if ( $(window).width() < 900 ) {
4446        if (scrl > 0) {
4447          $('.wpml-ls-touch-device').css({'opacity': '0'}); // mobile language switcher (more than 2 languages)
4448        }
4449        if (scrl >= 100) {
4450          $('#menubar').addClass('low-index');
4451          $('.nav-primary').addClass('cloned');
4452          $('.nav-primary').removeClass('original');
4453        }
4454        else {
4455          $('.wpml-ls-touch-device').css({'opacity': '1'});
4456          $('#menubar').removeClass('low-index');
4457          $('.nav-primary').removeClass('cloned');
4458          $('.nav-primary').addClass('original');
4459        }
4460      }
4461      if (scrl >= 100) {
4462        // Intro Image Animation
4463        side_img.delay(500).queue(function(){side_img.addClass('image-fade-in')});
4464      }
4465      if ($('#error404').is(':visible') ) { // Services animation
4466        if (scrl >= 75) {
4467          services_1.delay(500).fadeIn();
4468          services_2.delay(700).fadeIn();
4469          services_3.delay(900).fadeIn();
4470          services_4.delay(1100).fadeIn();
4471          services_5.delay(1300).fadeIn();
4472          services_6.delay(1500).fadeIn();
4473        }
4474      }
4475      if ($('.ags_movers').is(':visible') ) { // Services animation
4476        if ($('.rtl').is(':visible')) { // Hebrew text 02.10.2018
4477          services_1.css({'display': 'block'});
4478          services_2.css({'display': 'block'});
4479          services_3.css({'display': 'block'});
4480          services_4.css({'display': 'block'});
4481          services_5.css({'display': 'block'});
4482          services_6.css({'display': 'block'});
4483        }
4484        if (scrl >= 650) {
4485            services_2.delay(500).fadeIn();
4486            services_1.delay(700).fadeIn();
4487            services_3.delay(900).fadeIn();
4488            services_4.delay(1100).fadeIn();
4489            services_5.delay(1300).fadeIn();
4490            services_6.delay(1500).fadeIn();
4491        }
4492      }
4493      else {
4494        if (scrl >= 450) {
4495          services_1.delay(500).fadeIn();
4496          services_2.delay(700).fadeIn();
4497          services_3.delay(900).fadeIn();
4498          services_4.delay(1100).fadeIn();
4499          services_5.delay(1300).fadeIn();
4500          services_6.delay(1500).fadeIn();
4501        }
4502      }
4503    });
4504  
4505    jQuery(document).ready(function(){ // card columns animation
4506      if ($('.ags_movers').is(':visible')) { // no animation for relo 17.10.2018 {NB}
4507        if ( jQuery('#card-columns').is(':visible') ){
4508          var aftr_cards = jQuery('#card-columns').next().next();
4509          var card_1 = jQuery('#card-columns .col-md-4 h3').first();
4510          var card_2 = jQuery('#card-columns .col-md-4').first().next().find('h3');
4511          var card_3 = jQuery('#card-columns .col-md-4').first().next().next().find('h3');
4512          var screen = jQuery(window);
4513  
4514          screen.scroll(function() {  
4515            // Start Cards Animation
4516            var cardT = card_1.offset().top,
4517                cardH = card_1.outerHeight(),
4518                cardwH = screen.height(),
4519                cardS = screen.scrollTop();
4520  
4521            if ( cardS > (cardT+cardH-cardwH) && (cardT > cardS) && (cardS+cardwH > cardT+cardH) ){
4522              // Cards Animation
4523              aftr_cards.queue(function() {
4524                card_1.delay(800).queue(function(){card_1.addClass('card-animation')});
4525                card_2.delay(1200).queue(function(){card_2.addClass('card-animation')});
4526                card_3.delay(1600).queue(function(){card_3.addClass('card-animation')});
4527              }); 
4528            }
4529          });
4530        }
4531      }
4532    });
4533  
4534    $('#columns').find('.alignnone').removeClass('alignnone').addClass('aligncenter'); // makes sure icons align correctly
4535    $('#columns .col-md-3 p').replaceWith(function() {
4536        return '<h4>' + $(this).html() + '</h4>';
4537      }); // gives icon titles h4
4538  
4539      if ($('body').hasClass('home') || $('body').hasClass('page-id-33')){ // Slides only load on home page + hub page relo
4540        // Slider scripts go here 
4541        $(document).ready(function(){
4542          $(".slide-images li:nth-child(1) img").addClass("fx_0");
4543          //$(".relo_slide li:nth-child(1)").addClass("number_0");
4544          var timer;
4545          var timers;
4546            // var relo_sliders = document.getElementsByClassName('slider_text'); // Array to loop through
4547            //   for (var x = 0; x < relo_sliders.length; x++){ // Loop
4548            //     relo_sliders[x].classList.add('number_'+x); // Adding classNames
4549            //   }
4550  
4551            //$(".relo_slide li").eq(2).addClass("current");// Specific to relo only
4552  
4553          //   function reloslide(){ // 
4554          //     var current = $(".relo_slide li.current");
4555          //     var next = current.next().length ? current.next() : current.parent().children(':first');
4556          //     current.removeClass("current").animate({"opacity": "0"}, 800);
4557          //     next.addClass("current").animate({"opacity" :"1"}, 800);
4558          //     // repeat by calling the loop method again 
4559          //     timers = setTimeout(reloslide, 8000);
4560          //  }
4561  
4562          // if ($('.ags_relocation').is(':visible')) { 
4563          //   reloslide(); // start the loop when the page loads
4564          // }
4565  
4566           // we set the 'fx' class on the first image when the page loads
4567          // you can increase or decrease this value to get different effects
4568            // this calls the kenBurns function every 4 seconds
4569            window.setInterval(kenBurns, 5000);
4570  
4571            //the third variable is to keep track of where we are in the loop
4572            //if it is set to 1 (instead of 0) it is because the first image is styled when the page loads
4573            var images          = $(".slide-images img");
4574            var numberOfImages  = images.length;
4575            
4576            var i= 1;
4577  
4578  
4579            function kenBurns() {
4580            if(i==numberOfImages){ i = 0;}
4581            images[i].className = "fx" + '_' + i;
4582            
4583            if(i===0){
4584              images[numberOfImages-2].className = " ";
4585             
4586            }
4587            if(i===1){
4588              images[numberOfImages-1].className = " ";
4589              
4590            }
4591            if(i>1){
4592              images[i-2].className = " ";
4593             
4594            }
4595            i++;
4596            }
4597  
4598         $(".slide_img li").eq(2).addClass("current");
4599         function textloop(){
4600            var current = $(".slide_img li.current");
4601            var next = current.next().length ? current.next() : current.parent().children(':first');
4602            current.removeClass("current").animate({"opacity": "0"}, 800);
4603            next.addClass("current").animate({"opacity" :"1"}, 800);
4604            // repeat by calling the loop method again 
4605            timers = setTimeout(textloop, 5000);
4606         }
4607           // call method when page loads
4608           textloop();
4609  
4610          $("#ags_slider span a.next").eq(2).addClass("active");
4611  
4612          function bullets(){
4613              var bullet = $("#ags_slider span a.active");
4614              var next = bullet.next().length ? bullet.next() : bullet.parent().children(':first');
4615              next.addClass("active");
4616              bullet.removeClass("active");
4617              timer = setTimeout(bullets, 5000);
4618          }
4619  
4620          // call method when page loads
4621          bullets();
4622  
4623          // sider code revised. Code was made more dynamic. Original co
4623de on staging site - Tasmyn 24/03/2021
4624          var slider_bullet_click = $(".next");
4625  
4626          slider_bullet_click.click(function () {
4627    
4628            var bulletClasses = this.className;
4629            var slide_id = bulletClasses.split(' '); // get slide id from bullet class
4630            var bullet_clicked = $('.next'+'.'+slide_id[1]);
4631    
4632            //add active class to bullet just clicked
4633            bullet_clicked.addClass("active");
4634    
4635              // to get index position of slider li minus 1 from slide id 
4636              var slider_li = slide_id[1] - 1;
4637              var slider_text = $("li.slider_text");
4638              
4639              // add classes to display slide text
4640              slider_text.eq(slider_li).addClass("current").animate({"left": "7em", "opacity" :"1"}, 300);
4641    
4642            if($(".next") != bullet_clicked) {
4643              $(".next").not(this).removeClass("active"); // remove other active bullet
4644              $("li.slider_text").not(slider_text.eq(slider_li)).removeClass("current").animate({"opacity": "0"}, 300);
4645            }
4646    
4647            clearTimeout(timers);
4648            clearTimeout(timer);
4649          });     
4650      });
4651    }
4652    $(document).ready(function() {
4653    if ($('.ags_records.de').is(':visible')) { // network, country, branch pages not in DE on RM 19.10.2018 {NB}
4654      $( '#branch_dropdown_menu a, #network-home a, .slider_text a:nth-child(1), .menu-our-network_de-container a' ).each( function( index, element ){var url = $( element ).prop( 'href' );if ( url.indexOf( '?' ) == -1 ) {url += '?de=not_available';}$( element ).prop( 'href', url );});
4655    }
4656  
4657    // Preselect corporate enquirires on general enquiries page 21.06.2018
4658    $( '.corporate-enquiries a' ).each( function( index, element ){var url = $( element ).prop( 'href' );if ( url.indexOf( '?' ) == -1 ) {url += '?corporation';}$( element ).prop( 'href', url );});
4659    $( 'a.corporate-enquiries' ).each( function( index, element ){var url = $( element ).prop( 'href' );if ( url.indexOf( '?' ) == -1 ) {url += '?corporation';}$( element ).prop( 'href', url );});
4660    var url = location.search;
4661    if (url == '?de=not_available') { // shows the message on /branches page
4662      $('.de-not-available').fadeTo('slow', 1);
4663      $('.de-not-available button.cross').click(function(){
4664        $('.de-not-available').fadeTo('slow', 0);
4665      });
4666    }
4667  
4668    if (url == '?corporation') {
4669    var pleaseChoose = 'select[name=PleaseChoose]';
4670    var new_value = 'Corporate Services';
4671    var new_value_fr = 'Services aux entreprises';
4672    if ($('.fr').is(':visible')) {
4673    $(pleaseChoose).val(new_value_fr);
4674    }
4675    else {
4676      $(pleaseChoose).val(new_value);
4677    }
4678    }
4679    });
4680  
4681    $(document).ready(function() {
4682    // Preselect containers from groupage destination pages
4683    var url = location.search;
4684    var destination = $(location).attr('pathname');
4685    destination.indexOf(2);
4686    destination = destination.split("/")[2];
4687    $( '.container_cta a' ).each( function( index, element ){var url = $( element ).prop( 'href' );if ( url.indexOf( '?' ) == -1 ) {url += '?destination=' + destination;}$( element ).prop( 'href', url );});
4688   
4689   // if there are no containers, the link on the pano goes to containers page
4690    if ($('.groupage-cta a:nth-child(1)').attr('href') == '/groupage') {
4691      $( '.groupage-cta a:nth-child(1)' ).each( function( index, element ){var url = $( element ).prop( 'href' );if ( url.indexOf( '?' ) == -1 ) {url += '?destination=' + destination;}$( element ).prop( 'href', url );});
4692    }
4693    function getQueryVariable(variable) { // for the containers page
4694      var query = window.location.search.substring(1);
4695      var vars = query.split("&");
4696      for (var i=0;i<vars.length;i++) {
4697          var pair = vars[i].split("=");
4698          if(pair[0] == variable){return pair[1];}
4699      }
4700      return(false);
4701    }
4702    var dest = getQueryVariable("destination");
4703    if (url == '?destination=' + dest) {
4704      var clean_dest = dest.replace(/\b\w/g, function (l) { return l.toUpperCase(); }); // adds capital
4705      var country = 'select[id=countries]';
4706      var new_val = $('#countries option:contains("' + clean_dest + '")').val();
4707      $(country).val(new_val);
4708    }
4709  
4710      // Tabs function
4711      function responsiveTabs() {
4712        // Tabs functionality
4713          $('.responsive-tabs').each(function() {
4714            // Hide all tab panels except for the first
4715              $('.responsive-tabs-panel').not(':first').hide();
4716  
4717            // Add active statuses to first tab and show display
4718              $('li', this).removeClass('active');
4719              $('li:first-child', this).addClass('active');
4720              $('.responsive-tabs-panel:first-child').show();
4721  
4722            // Tab clicked
4723              $('li', this).click(function(e) {
4724                // Prevent the anchor's default click action
4725                  e.preventDefault();
4726  
4727                // Corresponding tabs panel
4728                  var panel = $('a', this).attr('href');
4729  
4730                // Remove active statuses to other tabs
4731                  $(this).siblings().removeClass('active');
4732  
4733                // Add active status to this tab
4734                  $(this).addClass('active');
4735  
4736                // Hide other tab panels
4737                  $(panel).siblings().hide();
4738  
4739                // Showing the clicked tabs' panel
4740                  $(panel).fadeIn(400);
4741              });
4742  
4743            // Responsive
4744              if ($(window).width() < 768)
4745                { $('.responsive-tabs-panel').show(); }
4746          });
4747  
4748        // Panel link functionality
4749          $('.responsive-tabs-content .responsive-tabs-panel .responsive-tabs-panel-link').on('click', function(e) {
4750            // Corresponding tabs panel
4751              var panel = $(this).attr('href');
4752  
4753            // Remove active statuses to other tabs
4754              $(this).parents('.responsive-tabs-content').siblings('.responsive-tabs').find('a[href=' + panel + ']').parent().siblings().removeClass('active');
4755  
4756            // Add active status to this tab
4757              $(this).parents('.responsive-tabs-content').siblings('.responsive-tabs').find('a[href=' + panel + ']').parent().addClass('active');
4758  
4759            // Hide other tab panels
4760              //$(panel).siblings().hide();
4761  
4762            // Showing the clicked tabs' panel
4763              $(panel).fadeIn(400);
4764  
4765            // Prevent the anchor's default click action
4766              e.preventDefault();
4767          });
4768      }
4769  
4770    $(document).ready(function() {
4771      responsiveTabs();
4772  
4773      $('.responsive-tabs li a').each(function() {
4774        var tabID = $(this).attr('href');
4775        var tabTitle = $(this).html();
4776  
4777        $(tabID + ' .responsive-tab-title').prepend('<p><strong>' + tabTitle + '</strong></p>');
4778      });
4779    });
4780  
4781    $(window).resize(function() {
4782      responsiveTabs();
4783    });   
4784  
4785    $('.dark_bg').find('.column-block').css({'border' : 'none', 'border-radius' : '0', 'background' : 'none'});
4786    $('.dark_bg').find('h4').css({'color' : '#fff', 'text-transform' : 'none'});
4787    });
4788  
4789  },
4790  finalize: function finalize() {
4791      // JavaScript to be fired on all pages, after page specific JS is fired
4792    },
4793  });
4794  
4795  
4796  
4797  /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0), __webpack_require__(0)))
4798  
4799  /***/ }),
4800  /* 8 */
4801  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4802  
4803  "use strict";
4804  /* harmony default export */ __webpack_exports__["a"] = ({
4805    init: function init() {
4806    // js to fire on contact-us page
4807    },
4808  
4809  });
4810  
4811  
4812  /***/ }),
4813  /* 9 */
4814  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4815  
4816  "use strict";
4817  /* harmony default export */ __webpack_exports__["a"] = ({
4818    init: function init() {
4819      // JavaScript to be fired on the home page
4820    },
4821    finalize: function finalize() {
4822      // JavaScript to be fired on the home page, after the init JS
4823      
4824    },
4825  });
4826  
4827  
4828  /***/ }),
4829  /* 10 */
4830  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4831  
4832  "use strict";
4833  /* harmony default export */ __webpack_exports__["a"] = ({
4834    init: function init() {
4835      // JavaScript to be fired on Job page
4836   //	Responsive Tabs v1.4, Copyright 2014, Joe Mottershaw, https://github.com/joemottershaw/
4837  //	=======================================================================================
4838  
4839    // // Tabs function
4840    // 	function responsiveTabs() {
4841    // 		// Tabs functionality
4842    // 			jQuery('.responsive-tabs').each(function() {
4843    // 				// Hide all tab panels except for the first
4844    // 					jQuery('.responsive-tabs-panel').not(':first').hide();
4845  
4846    // 				// Add active statuses to first tab and show display
4847    // 					jQuery('li', this).removeClass('active');
4848    // 					jQuery('li:first-child', this).addClass('active');
4849    // 					jQuery('.responsive-tabs-panel:first-child').show();
4850  
4851    // 				// Tab clicked
4852    // 					jQuery('li', this).click(function(e) {
4853    // 						// Prevent the anchor's default click action
4854    // 							e.preventDefault();
4855  
4856    // 						// Corresponding tabs panel
4857    // 							var panel = jQuery('a', this).attr('href');
4858  
4859    // 						// Remove active statuses to other tabs
4860    // 							jQuery(this).siblings().removeClass('active');
4861  
4862    // 						// Add active status to this tab
4863    // 							jQuery(this).addClass('active');
4864  
4865    // 						// Hide other tab panels
4866    // 							jQuery(panel).siblings().hide();
4867  
4868    // 						// Showing the clicked tabs' panel
4869    // 							jQuery(panel).fadeIn(400);
4870    // 					});
4871  
4872    // 				// Responsive
4873    // 					if (jQuery(window).width() < 768)
4874    // 						jQuery('.responsive-tabs-panel').show();
4875    // 			});
4876  
4877    // 		// Panel link functionality
4878    // 			jQuery('.responsive-tabs-content .responsive-tabs-panel .responsive-tabs-panel-link').on('click', function(e) {
4879    // 				// Corresponding tabs panel
4880    // 					var panel = jQuery(this).attr('href');
4881  
4882    // 				// Remove active statuses to other tabs
4883    // 					jQuery(this).parents('.responsive-tabs-content').siblings('.responsive-tabs').find('a[href=' + panel + ']').parent().siblings().removeClass('active');
4884  
4885    // 				// Add active status to this tab
4886    // 					jQuery(this).parents('.responsive-tabs-content').siblings('.responsive-tabs').find('a[href=' + panel + ']').parent().addClass('active');
4887  
4888    // 				// Hide other tab panels
4889    // 					//jQuery(panel).siblings().hide();
4890  
4891    // 				// Showing the clicked tabs' panel
4892    // 					jQuery(panel).fadeIn(400);
4893  
4894    // 				// Prevent the anchor's default click action
4895    // 					e.preventDefault();
4896    // 			});
4897    // 	}
4898  
4899    // jQuery(document).ready(function() {
4900    // 	responsiveTabs();
4901  
4902    // 	jQuery('.responsive-tabs li a').each(function() {
4903    // 		var	tabID = jQuery(this).attr('href');
4904    // 		var	tabTitle = jQuery(this).html();
4905  
4906    // 		jQuery(tabID + ' .responsive-tab-title').prepend('<p><strong>' + tabTitle + '</strong></p>');
4907    // 	});
4908    // });
4909  
4910    // jQuery(window).resize(function() {
4911    // 	responsiveTabs();
4912    // });   
4913    },
4914    finalize: function finalize() {
4915      // JavaScript to be fired on all pages, after page specific JS is fired
4916    },
4917  });
4918  
4919  /***/ }),
4920  /* 11 */
4921  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4922  
4923  "use strict";
4924  /* WEBPACK VAR INJECTION */(function(jQuery) {/* harmony default export */ __webpack_exports__["a"] = ({
4925    init: function init() {
4926    // js to fire on Single posts
4927  
4928    jQuery(document).ready(function(){
4929  
4930    var sideHeight = jQuery('.entry-content').height();
4931    jQuery('#sidebar').css('height', sideHeight + 'px');
4932  
4933    });
4934  
4935    },
4936    finalize: function finalize() {
4937      // JavaScript to be fired on the home page, after the init JS
4938      
4939    },
4940  });
4941  
4942  /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
4943  
4944  /***/ }),
4945  /* 12 */
4946  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4947  
4948  "use strict";
4949  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__camelCase__ = __webpack_require__(13);
4950  /* ========================================================================
4951   * DOM-based Routing
4952   * Based on http://goo.gl/EUTi53 by Paul Irish
4953   *
4954   * Only fires on body classes that match. If a body class contains a dash,
4955   * replace the dash with an underscore when adding it to the object below.
4956   * ======================================================================== */
4957  
4958  
4959  
4960  // The routing fires all common scripts, followed by the page specific scripts.
4961  // Add additional events for more control over timing e.g. a finalize event
4962  var Router = function Router(routes) {
4963    this.routes = routes;
4964  };
4965  
4966  Router.prototype.fire = function fire (route, fn, args) {
4967      if ( fn === void 0 ) fn = 'init';
4968  
4969    var fire = route !== '' && this.routes[route] && typeof this.routes[route][fn] === 'function';
4970    if (fire) {
4971      this.routes[route][fn](args);
4972    }
4973  };
4974  
4975  Router.prototype.loadEvents = function loadEvents () {
4976      var this$1 = this;
4977  
4978    // Fire common init JS
4979    this.fire('common');
4980  
4981    // Fire page-specific init JS, and then finalize JS
4982    document.body.className
4983      .toLowerCase()
4984      .replace(/-/g, '_')
4985      .split(/\s+/)
4986      .map(__WEBPACK_IMPORTED_MODULE_0__camelCase__["a" /* default */])
4987      .forEach(function (className) {
4988        this$1.fire(className);
4989        this$1.fire(className, 'finalize');
4990      });
4991  
4992    // Fire common finalize JS
4993    this.fire('common', 'finalize');
4994  };
4995  
4996  /* harmony default export */ __webpack_exports__["a"] = (Router);
4997  
4998  
4999  /***/ }),
5000  /* 13 */
5001  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5002  
5003  "use strict";
5004  // the most terrible camelizer on the internet, guaranteed!
5005  /* harmony default export */ __webpack_exports__["a"] = (function (str) { return ("" + (str.charAt(0).toLowerCase()) + (str.replace(/[\W_]/g, '|').split('|')
5006    .map(function (part) { return ("" + (part.charAt(0).toUpperCase()) + (part.slice(1))); })
5007    .join('')
5008    .slice(1))); });;
5009  
5010  
5011  /***/ }),
5012  /* 14 */
5013  /***/ (function(module, exports, __webpack_require__) {
5014  
5015  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! tether 1.4.0 */
5016  
5017  (function(root, factory) {
5018    if (true) {
5019      !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
5020          __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
5021          (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
5022          __WEBPACK_AMD_DEFINE_FACTORY__),
5023          __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
5024    } else if (typeof exports === 'object') {
5025      module.exports = factory(require, exports, module);
5026    } else {
5027      root.Tether = factory();
5028    }
5029  }(this, function(require, exports, module) {
5030  
5031  'use strict';
5032  
5033  var _createClass = (function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
5034  
5035  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
5036  
5037  var TetherBase = undefined;
5038  if (typeof TetherBase === 'undefined') {
5039    TetherBase = { modules: [] };
5040  }
5041  
5042  var zeroElement = null;
5043  
5044  // Same as native getBoundingClientRect, except it takes into account parent <frame> offsets
5045  // if the element lies within a nested document (<frame> or <iframe>-like).
5046  function getActualBoundingClientRect(node) {
5047    var boundingRect = node.getBoundingClientRect();
5048  
5049    // The original object returned by getBoundingClientRect is immutable, so we clone it
5050    // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9
5051    var rect = {};
5052    for (var k in boundingRect) {
5053      rect[k] = boundingRect[k];
5054    }
5055  
5056    if (node.ownerDocument !== document) {
5057      var _frameElement = node.ownerDocument.defaultView.frameElement;
5058      if (_frameElement) {
5059        var frameRect = getActualBoundingClientRect(_frameElement);
5060        rect.top += frameRect.top;
5061        rect.bottom += frameRect.top;
5062        rect.left += frameRect.left;
5063        rect.right += frameRect.left;
5064      }
5065    }
5066  
5067    return rect;
5068  }
5069  
5070  function getScrollParents(el) {
5071    // In firefox if the el is inside an iframe with display: none; window.getComputedStyle() will return null;
5072    // https://bugzilla.mozilla.org/show_bug.cgi?id=548397
5073    var computedStyle = getComputedStyle(el) || {};
5074    var position = computedStyle.position;
5075    var parents = [];
5076  
5077    if (position === 'fixed') {
5078      return [el];
5079    }
5080  
5081    var parent = el;
5082    while ((parent = parent.parentNode) && parent && parent.nodeType === 1) {
5083      var style = undefined;
5084      try {
5085        style = getComputedStyle(parent);
5086      } catch (err) {}
5087  
5088      if (typeof style === 'undefined' || style === null) {
5089        parents.push(parent);
5090        return parents;
5091      }
5092  
5093      var _style = style;
5094      var overflow = _style.overflow;
5095      var overflowX = _style.overflowX;
5096      var overflowY = _style.overflowY;
5097  
5098      if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) {
5099        if (position !== 'absolute' || ['relative', 'absolute', 'fixed'].indexOf(style.position) >= 0) {
5100          parents.push(parent);
5101        }
5102      }
5103    }
5104  
5105    parents.push(el.ownerDocument.body);
5106  
5107    // If the node is within a frame, account for the parent window scroll
5108    if (el.ownerDocument !== document) {
5109      parents.push(el.ownerDocument.defaultView);
5110    }
5111  
5112    return parents;
5113  }
5114  
5115  var uniqueId = (function () {
5116    var id = 0;
5117    return function () {
5118      return ++id;
5119    };
5120  })();
5121  
5122  var zeroPosCache = {};
5123  var getOrigin = function getOrigin() {
5124    // getBoundingClientRect is unfortunately too accurate.  It introduces a pixel or two of
5125    // jitter as the user scrolls that messes with our ability to detect if tw
5125o positions
5126    // are equivilant or not.  We place an element at the top left of the page that will
5127    // get the same jitter, so we can cancel the two out.
5128    var node = zeroElement;
5129    if (!node || !document.body.contains(node)) {
5130      node = document.createElement('div');
5131      node.setAttribute('data-tether-id', uniqueId());
5132      extend(node.style, {
5133        top: 0,
5134        left: 0,
5135        position: 'absolute'
5136      });
5137  
5138      document.body.appendChild(node);
5139  
5140      zeroElement = node;
5141    }
5142  
5143    var id = node.getAttribute('data-tether-id');
5144    if (typeof zeroPosCache[id] === 'undefined') {
5145      zeroPosCache[id] = getActualBoundingClientRect(node);
5146  
5147      // Clear the cache when this position call is done
5148      defer(function () {
5149        delete zeroPosCache[id];
5150      });
5151    }
5152  
5153    return zeroPosCache[id];
5154  };
5155  
5156  function removeUtilElements() {
5157    if (zeroElement) {
5158      document.body.removeChild(zeroElement);
5159    }
5160    zeroElement = null;
5161  };
5162  
5163  function getBounds(el) {
5164    var doc = undefined;
5165    if (el === document) {
5166      doc = document;
5167      el = document.documentElement;
5168    } else {
5169      doc = el.ownerDocument;
5170    }
5171  
5172    var docEl = doc.documentElement;
5173  
5174    var box = getActualBoundingClientRect(el);
5175  
5176    var origin = getOrigin();
5177  
5178    box.top -= origin.top;
5179    box.left -= origin.left;
5180  
5181    if (typeof box.width === 'undefined') {
5182      box.width = document.body.scrollWidth - box.left - box.right;
5183    }
5184    if (typeof box.height === 'undefined') {
5185      box.height = document.body.scrollHeight - box.top - box.bottom;
5186    }
5187  
5188    box.top = box.top - docEl.clientTop;
5189    box.left = box.left - docEl.clientLeft;
5190    box.right = doc.body.clientWidth - box.width - box.left;
5191    box.bottom = doc.body.clientHeight - box.height - box.top;
5192  
5193    return box;
5194  }
5195  
5196  function getOffsetParent(el) {
5197    return el.offsetParent || document.documentElement;
5198  }
5199  
5200  var _scrollBarSize = null;
5201  function getScrollBarSize() {
5202    if (_scrollBarSize) {
5203      return _scrollBarSize;
5204    }
5205    var inner = document.createElement('div');
5206    inner.style.width = '100%';
5207    inner.style.height = '200px';
5208  
5209    var outer = document.createElement('div');
5210    extend(outer.style, {
5211      position: 'absolute',
5212      top: 0,
5213      left: 0,
5214      pointerEvents: 'none',
5215      visibility: 'hidden',
5216      width: '200px',
5217      height: '150px',
5218      overflow: 'hidden'
5219    });
5220  
5221    outer.appendChild(inner);
5222  
5223    document.body.appendChild(outer);
5224  
5225    var widthContained = inner.offsetWidth;
5226    outer.style.overflow = 'scroll';
5227    var widthScroll = inner.offsetWidth;
5228  
5229    if (widthContained === widthScroll) {
5230      widthScroll = outer.clientWidth;
5231    }
5232  
5233    document.body.removeChild(outer);
5234  
5235    var width = widthContained - widthScroll;
5236  
5237    _scrollBarSize = { width: width, height: width };
5238    return _scrollBarSize;
5239  }
5240  
5241  function extend() {
5242    var out = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
5243  
5244    var args = [];
5245  
5246    Array.prototype.push.apply(args, arguments);
5247  
5248    args.slice(1).forEach(function (obj) {
5249      if (obj) {
5250        for (var key in obj) {
5251          if (({}).hasOwnProperty.call(obj, key)) {
5252            out[key] = obj[key];
5253          }
5254        }
5255      }
5256    });
5257  
5258    return out;
5259  }
5260  
5261  function removeClass(el, name) {
5262    if (typeof el.classList !== 'undefined') {
5263      name.split(' ').forEach(function (cls) {
5264        if (cls.trim()) {
5265          el.classList.remove(cls);
5266        }
5267      });
5268    } else {
5269      var regex = new RegExp('(^| )' + name.split(' ').join('|') + '( |$)', 'gi');
5270      var className = getClassName(el).replace(regex, ' ');
5271      setClassName(el, className);
5272    }
5273  }
5274  
5275  function addClass(el, name) {
5276    if (typeof el.classList !== 'undefined') {
5277      name.split(' ').forEach(function (cls) {
5278        if (cls.trim()) {
5279          el.classList.add(cls);
5280        }
5281      });
5282    } else {
5283      removeClass(el, name);
5284      var cls = getClassName(el) + (' ' + name);
5285      setClassName(el, cls);
5286    }
5287  }
5288  
5289  function hasClass(el, name) {
5290    if (typeof el.classList !== 'undefined') {
5291      return el.classList.contains(name);
5292    }
5293    var className = getClassName(el);
5294    return new RegExp('(^| )' + name + '( |$)', 'gi').test(className);
5295  }
5296  
5297  function getClassName(el) {
5298    // Can't use just SVGAnimatedString here since nodes within a Frame in IE have
5299    // completely separately SVGAnimatedString base classes
5300    if (el.className instanceof el.ownerDocument.defaultView.SVGAnimatedString) {
5301      return el.className.baseVal;
5302    }
5303    return el.className;
5304  }
5305  
5306  function setClassName(el, className) {
5307    el.setAttribute('class', className);
5308  }
5309  
5310  function updateClasses(el, add, all) {
5311    // Of the set of 'all' classes, we need the 'add' classes, and only the
5312    // 'add' classes to be set.
5313    all.forEach(function (cls) {
5314      if (add.indexOf(cls) === -1 && hasClass(el, cls)) {
5315        removeClass(el, cls);
5316      }
5317    });
5318  
5319    add.forEach(function (cls) {
5320      if (!hasClass(el, cls)) {
5321        addClass(el, cls);
5322      }
5323    });
5324  }
5325  
5326  var deferred = [];
5327  
5328  var defer = function defer(fn) {
5329    deferred.push(fn);
5330  };
5331  
5332  var flush = function flush() {
5333    var fn = undefined;
5334    while (fn = deferred.pop()) {
5335      fn();
5336    }
5337  };
5338  
5339  var Evented = (function () {
5340    function Evented() {
5341      _classCallCheck(this, Evented);
5342    }
5343  
5344    _createClass(Evented, [{
5345      key: 'on',
5346      value: function on(event, handler, ctx) {
5347        var once = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
5348  
5349        if (typeof this.bindings === 'undefined') {
5350          this.bindings = {};
5351        }
5352        if (typeof this.bindings[event] === 'undefined') {
5353          this.bindings[event] = [];
5354        }
5355        this.bindings[event].push({ handler: handler, ctx: ctx, once: once });
5356      }
5357    }, {
5358      key: 'once',
5359      value: function once(event, handler, ctx) {
5360        this.on(event, handler, ctx, true);
5361      }
5362    }, {
5363      key: 'off',
5364      value: function off(event, handler) {
5365        if (typeof this.bindings === 'undefined' || typeof this.bindings[event] === 'undefined') {
5366          return;
5367        }
5368  
5369        if (typeof handler === 'undefined') {
5370          delete this.bindings[event];
5371        } else {
5372          var i = 0;
5373          while (i < this.bindings[event].length) {
5374            if (this.bindings[event][i].handler === handler) {
5375              this.bindings[event].splice(i, 1);
5376            } else {
5377              ++i;
5378            }
5379          }
5380        }
5381      }
5382    }, {
5383      key: 'trigger',
5384      value: function trigger(event) {
5385        if (typeof this.bindings !== 'undefined' && this.bindings[event]) {
5386          var i = 0;
5387  
5388          for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5389            args[_key - 1] = arguments[_key];
5390          }
5391  
5392          while (i < this.bindings[event].length) {
5393            var _bindings$event$i = this.bindings[event][i];
5394            var handler = _bindings$event$i.handler;
5395            var ctx = _bindings$event$i.ctx;
5396            var once = _bindings$event$i.once;
5397  
5398            var context = ctx;
5399            if (typeof context === 'undefined') {
5400              context = this;
5401            }
5402  
5403            handler.apply(context, args);
5404  
5405            if (once) {
5406              this.bindings[event].splice(i, 1);
5407            } else {
5408              ++i;
5409            }
5410          }
5411        }
5412      }
5413    }]);
5414  
5415    return Evented;
5416  })();
5417  
5418  TetherBase.Utils = {
5419    getActualBoundingClientRect: getActualBoundingClientRect,
5420    getScrollParents: getScrollParents,
5421    getBounds: getBounds,
5422    getOffsetParent: getOffsetParent,
5423    extend: extend,
5424    addClass: addClass,
5425    removeClass: removeClass,
5426    hasClass: hasClass,
5427    updateClasses: updateClasses,
5428    defer: defer,
5429    flush: flush,
5430    uniqueId: uniqueId,
5431    Evented: Evented,
5432    getScrollBarSize: getScrollBarSize,
5433    removeUtilElements: removeUtilElements
5434  };
5435  /* globals TetherBase, performance */
5436  
5437  'use strict';
5438  
5439  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
5440  
5441  var _createClass = (function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
5442  
5443  var _get = function get(_x6, _x7, _x8) { var _again = true; _function: while (_again) { var object = _x6, property = _x7, receiver = _x8; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x6 = parent; _x7 = property; _x8 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
5444  
5445  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
5446  
5447  function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
5447onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
5448  
5449  if (typeof TetherBase === 'undefined') {
5450    throw new Error('You must include the utils.js file before tether.js');
5451  }
5452  
5453  var _TetherBase$Utils = TetherBase.Utils;
5454  var getScrollParents = _TetherBase$Utils.getScrollParents;
5455  var getBounds = _TetherBase$Utils.getBounds;
5456  var getOffsetParent = _TetherBase$Utils.getOffsetParent;
5457  var extend = _TetherBase$Utils.extend;
5458  var addClass = _TetherBase$Utils.addClass;
5459  var removeClass = _TetherBase$Utils.removeClass;
5460  var updateClasses = _TetherBase$Utils.updateClasses;
5461  var defer = _TetherBase$Utils.defer;
5462  var flush = _TetherBase$Utils.flush;
5463  var getScrollBarSize = _TetherBase$Utils.getScrollBarSize;
5464  var removeUtilElements = _TetherBase$Utils.removeUtilElements;
5465  
5466  function within(a, b) {
5467    var diff = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];
5468  
5469    return a + diff >= b && b >= a - diff;
5470  }
5471  
5472  var transformKey = (function () {
5473    if (typeof document === 'undefined') {
5474      return '';
5475    }
5476    var el = document.createElement('div');
5477  
5478    var transforms = ['transform', 'WebkitTransform', 'OTransform', 'MozTransform', 'msTransform'];
5479    for (var i = 0; i < transforms.length; ++i) {
5480      var key = transforms[i];
5481      if (el.style[key] !== undefined) {
5482        return key;
5483      }
5484    }
5485  })();
5486  
5487  var tethers = [];
5488  
5489  var position = function position() {
5490    tethers.forEach(function (tether) {
5491      tether.position(false);
5492    });
5493    flush();
5494  };
5495  
5496  function now() {
5497    if (typeof performance !== 'undefined' && typeof performance.now !== 'undefined') {
5498      return performance.now();
5499    }
5500    return +new Date();
5501  }
5502  
5503  (function () {
5504    var lastCall = null;
5505    var lastDuration = null;
5506    var pendingTimeout = null;
5507  
5508    var tick = function tick() {
5509      if (typeof lastDuration !== 'undefined' && lastDuration > 16) {
5510        // We voluntarily throttle ourselves if we can't manage 60fps
5511        lastDuration = Math.min(lastDuration - 16, 250);
5512  
5513        // Just in case this is the last event, remember to position just once more
5514        pendingTimeout = setTimeout(tick, 250);
5515        return;
5516      }
5517  
5518      if (typeof lastCall !== 'undefined' && now() - lastCall < 10) {
5519        // Some browsers call events a little too frequently, refuse to run more than is reasonable
5520        return;
5521      }
5522  
5523      if (pendingTimeout != null) {
5524        clearTimeout(pendingTimeout);
5525        pendingTimeout = null;
5526      }
5527  
5528      lastCall = now();
5529      position();
5530      lastDuration = now() - lastCall;
5531    };
5532  
5533    if (typeof window !== 'undefined' && typeof window.addEventListener !== 'undefined') {
5534      ['resize', 'scroll', 'touchmove'].forEach(function (event) {
5535        window.addEventListener(event, tick);
5536      });
5537    }
5538  })();
5539  
5540  var MIRROR_LR = {
5541    center: 'center',
5542    left: 'right',
5543    right: 'left'
5544  };
5545  
5546  var MIRROR_TB = {
5547    middle: 'middle',
5548    top: 'bottom',
5549    bottom: 'top'
5550  };
5551  
5552  var OFFSET_MAP = {
5553    top: 0,
5554    left: 0,
5555    middle: '50%',
5556    center: '50%',
5557    bottom: '100%',
5558    right: '100%'
5559  };
5560  
5561  var autoToFixedAttachment = function autoToFixedAttachment(attachment, relativeToAttachment) {
5562    var left = attachment.left;
5563    var top = attachment.top;
5564  
5565    if (left === 'auto') {
5566      left = MIRROR_LR[relativeToAttachment.left];
5567    }
5568  
5569    if (top === 'auto') {
5570      top = MIRROR_TB[relativeToAttachment.top];
5571    }
5572  
5573    return { left: left, top: top };
5574  };
5575  
5576  var attachmentToOffset = function attachmentToOffset(attachment) {
5577    var left = attachment.left;
5578    var top = attachment.top;
5579  
5580    if (typeof OFFSET_MAP[attachment.left] !== 'undefined') {
5581      left = OFFSET_MAP[attachment.left];
5582    }
5583  
5584    if (typeof OFFSET_MAP[attachment.top] !== 'undefined') {
5585      top = OFFSET_MAP[attachment.top];
5586    }
5587  
5588    return { left: left, top: top };
5589  };
5590  
5591  function addOffset() {
5592    var out = { top: 0, left: 0 };
5593  
5594    for (var _len = arguments.length, offsets = Array(_len), _key = 0; _key < _len; _key++) {
5595      offsets[_key] = arguments[_key];
5596    }
5597  
5598    offsets.forEach(function (_ref) {
5599      var top = _ref.top;
5600      var left = _ref.left;
5601  
5602      if (typeof top === 'string') {
5603        top = parseFloat(top, 10);
5604      }
5605      if (typeof left === 'string') {
5606        left = parseFloat(left, 10);
5607      }
5608  
5609      out.top += top;
5610      out.left += left;
5611    });
5612  
5613    return out;
5614  }
5615  
5616  function offsetToPx(offset, size) {
5617    if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) {
5618      offset.left = parseFloat(offset.left, 10) / 100 * size.width;
5619    }
5620    if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) {
5621      offset.top = parseFloat(offset.top, 10) / 100 * size.height;
5622    }
5623  
5624    return offset;
5625  }
5626  
5627  var parseOffset = function parseOffset(value) {
5628    var _value$split = value.split(' ');
5629  
5630    var _value$split2 = _slicedToArray(_value$split, 2);
5631  
5632    var top = _value$split2[0];
5633    var left = _value$split2[1];
5634  
5635    return { top: top, left: left };
5636  };
5637  var parseAttachment = parseOffset;
5638  
5639  var TetherClass = (function (_Evented) {
5640    _inherits(TetherClass, _Evented);
5641  
5642    function TetherClass(options) {
5643      var _this = this;
5644  
5645      _classCallCheck(this, TetherClass);
5646  
5647      _get(Object.getPrototypeOf(TetherClass.prototype), 'constructor', this).call(this);
5648      this.position = this.position.bind(this);
5649  
5650      tethers.push(this);
5651  
5652      this.history = [];
5653  
5654      this.setOptions(options, false);
5655  
5656      TetherBase.modules.forEach(function (module) {
5657        if (typeof module.initialize !== 'undefined') {
5658          module.initialize.call(_this);
5659        }
5660      });
5661  
5662      this.position();
5663    }
5664  
5665    _createClass(TetherClass, [{
5666      key: 'getClass',
5667      value: function getClass() {
5668        var key = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
5669        var classes = this.options.classes;
5670  
5671        if (typeof classes !== 'undefined' && classes[key]) {
5672          return this.options.classes[key];
5673        } else if (this.options.classPrefix) {
5674          return this.options.classPrefix + '-' + key;
5675        } else {
5676          return key;
5677        }
5678      }
5679    }, {
5680      key: 'setOptions',
5681      value: function setOptions(options) {
5682        var _this2 = this;
5683  
5684        var pos = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
5685  
5686        var defaults = {
5687          offset: '0 0',
5688          targetOffset: '0 0',
5689          targetAttachment: 'auto auto',
5690          classPrefix: 'tether'
5691        };
5692  
5693        this.options = extend(defaults, options);
5694  
5695        var _options = this.options;
5696        var element = _options.element;
5697        var target = _options.target;
5698        var targetModifier = _options.targetModifier;
5699  
5700        this.element = element;
5701        this.target = target;
5702        this.targetModifier = targetModifier;
5703  
5704        if (this.target === 'viewport') {
5705          this.target = document.body;
5706          this.targetModifier = 'visible';
5707        } else if (this.target === 'scroll-handle') {
5708          this.target = document.body;
5709          this.targetModifier = 'scroll-handle';
5710        }
5711  
5712        ['element', 'target'].forEach(function (key) {
5713          if (typeof _this2[key] === 'undefined') {
5714            throw new Error('Tether Error: Both element and target must be defined');
5715          }
5716  
5717          if (typeof _this2[key].jquery !== 'undefined') {
5718            _this2[key] = _this2[key][0];
5719          } else if (typeof _this2[key] === 'string') {
5720            _this2[key] = document.querySelector(_this2[key]);
5721          }
5722        });
5723  
5724        addClass(this.element, this.getClass('element'));
5725        if (!(this.options.addTargetClasses === false)) {
5726          addClass(this.target, this.getClass('target'));
5727        }
5728  
5729        if (!this.options.attachment) {
5730          throw new Error('Tether Error: You must provide an attachment');
5731        }
5732  
5733        this.targetAttachment = parseAttachment(this.options.targetAttachment);
5734        this.attachment = parseAttachment(this.options.attachment);
5735        this.offset = parseOffset(this.options.offset);
5736        this.targetOffset = parseOffset(this.options.targetOffset);
5737  
5738        if (typeof this.scrollParents !== 'undefined') {
5739          this.disable();
5740        }
5741  
5742        if (this.targetModifier === 'scroll-handle') {
5743          this.scrollParents = [this.target];
5744        } else {
5745          this.scrollParents = getScrollParents(this.target);
5746        }
5747  
5748        if (!(this.options.enabled === false)) {
5749          this.enable(pos);
5750        }
5751      }
5752    }, {
5753      key: 'getTargetBounds',
5754      value: function getTargetBounds() {
5755        if (typeof this.targetModifier !== 'undefined') {
5756          if (this.targetModifier === 'visible') {
5757            if (this.target === document.body) {
5758              return { top: pageYOffset, left: pageXOffset, height: innerHeight, width: innerWidth };
5759            } else {
5760              var bounds = getBounds(this.target);
5761  
5762              var out = {
5763                height: bounds.height,
5764                width: bounds.width,
5765                top: bounds.top,
5766                left: bounds.left
5767              };
5768  
5769              out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top));
5770              out.height = Math.min(out.height, bounds.height - (bounds.top + bounds.height - (pageYOffset + innerHeight)));
5771              out.height = Math.min(innerHeight, out.height);
5772              out.height -= 2;
5773  
5774              out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left));
5775              out.width = Math.min(out.width, bounds.width - (bounds.left + bounds.width - (pageXOffset + innerWidth)));
5776              out.width = Math.min(innerWidth, out.width);
5777              out.width -= 2;
5778  
5779              if (out.top < pageYOffset) {
5780                out.top = pageYOffset;
5781              }
5782              if (out.left < pageXOffset) {
5783                out.left = pageXOffset;
5784              }
5785  
5786              return out;
5787            }
5788          } else if (this.targetModifier === 'scroll-handle') {
5789            var bounds = undefined;
5790            var target = this.target;
5791            if (target === document.body) {
5792              target = document.documentElement;
5793  
5794              bounds = {
5795                left: pageXOffset,
5796                top: pageYOffset,
5797                height: innerHeight,
5798                width: innerWidth
5799              };
5800            } else {
5801              bounds = getBounds(target);
5802            }
5803  
5804            var style = getComputedStyle(target);
5805  
5806            var hasBottomScroll = target.scrollWidth > target.clientWidth || [style.overflow, style.overflowX].indexOf('scroll') >= 0 || this.target !== document.body;
5807  
5808            var scrollBottom = 0;
5809            if (hasBottomScroll) {
5810              scrollBottom = 15;
5811            }
5812  
5813            var height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom;
5814  
5815            var out = {
5816              width: 15,
5817              height: height * 0.975 * (height / target.scrollHeight),
5818              left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15
5819            };
5820  
5821            var fitAdj = 0;
5822            if (height < 408 && this.target === document.body) {
5823              fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58;
5824            }
5825  
5826            if (this.target !== document.body) {
5827              out.height = Math.max(out.height, 24);
5828            }
5829  
5830            var scrollPercentage = this.target.scrollTop / (target.scrollHeight - height);
5831            out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth);
5832  
5833            if (this.target === document.body) {
5834              out.height = Math.max(out.height, 24);
5835            }
5836  
5837            return out;
5838          }
5839        } else {
5840          return getBounds(this.target);
5841        }
5842      }
5843    }, {
5844      key: 'clearCache',
5845      value: function clearCache() {
5846        this._cache = {};
5847      }
5848    }, {
5849      key: 'cache',
5850      value: function cache(k, getter) {
5851        // More than one module will often need the same DOM info, so
5852        // we keep a cache which is cleared on each position call
5853        if (typeof this._cache === 'undefined') {
5854          this._cache = {};
5855        }
5856  
5857        if (typeof this._cache[k] === 'undefined') {
5858          this._cache[k] = getter.call(this);
5859        }
5860  
5861        return this._cache[k];
5862      }
5863    }, {
5864      key: 'enable',
5865      value: function enable() {
5866        var _this3 = this;
5867  
5868        var pos = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
5869  
5870        if (!(this.options.addTargetClasses === false)) {
5871          addClass(this.target, this.getClass('enabled'));
5872        }
5873        addClass(this.element, this.getClass('enabled'));
5874        this.enabled = true;
5875  
5876        this.scrollParents.forEach(function (parent) {
5877          if (parent !== _this3.target.ownerDocument) {
5878            parent.addEventListener('scroll', _this3.position);
5879          }
5880        });
5881  
5882        if (pos) {
5883          this.position();
5884        }
5885      }
5886    }, {
5887      key: 'disable',
5888      value: function disable() {
5889        var _this4 = this;
5890  
5891        removeClass(this.target, this.getClass('enabled'));
5892        removeClass(this.element, this.getClass('enabled'));
5893        this.enabled = false;
5894  
5895        if (typeof this.scrollParents !== 'undefined') {
5896          this.scrollParents.forEach(function (parent) {
5897            parent.removeEventListener('scroll', _this4.position);
5898          });
5899        }
5900      }
5901    }, {
5902      key: 'destroy',
5903      value: function destroy() {
5904        var _this5 = this;
5905  
5906        this.disable();
5907  
5908        tethers.forEach(function (tether, i) {
5909          if (tether === _this5) {
5910            tethers.splice(i, 1);
5911          }
5912        });
5913  
5914        // Remove any elements we were using for convenience from the DOM
5915        if (tethers.length === 0) {
5916          removeUtilElements();
5917        }
5918      }
5919    }, {
5920      key: 'updateAttachClasses',
5921      value: function updateAttachClasses(elementAttach, targetAttach) {
5922        var _this6 = this;
5923  
5924        elementAttach = elementAttach || this.attachment;
5925        targetAttach = targetAttach || this.targetAttachment;
5926        var sides = ['left', 'top', 'bottom', 'right', 'middle', 'center'];
5927  
5928        if (typeof this._addAttachClasses !== 'undefined' && this._addAttachClasses.length) {
5929          // updateAttachClasses can be called more than once in a position call, so
5930          // we need to clean up after ourselves such that when the last defer gets
5931          // ran it doesn't add any extra classes from previous calls.
5932          this._addAttachClasses.splice(0, this._addAttachClasses.length);
5933        }
5934  
5935        if (typeof this._addAttachClasses === 'undefined') {
5936          this._addAttachClasses = [];
5937        }
5938        var add = this._addAttachClasses;
5939  
5940        if (elementAttach.top) {
5941          add.push(this.getClass('element-attached') + '-' + elementAttach.top);
5942        }
5943        if (elementAttach.left) {
5944          add.push(this.getClass('element-attached') + '-' + elementAttach.left);
5945        }
5946        if (targetAttach.top) {
5947          add.push(this.getClass('target-attached') + '-' + targetAttach.top);
5948        }
5949        if (targetAttach.left) {
5950          add.push(this.getClass('target-attached') + '-' + targetAttach.left);
5951        }
5952  
5953        var all = [];
5954        sides.forEach(function (side) {
5955          all.push(_this6.getClass('element-attached') + '-' + side);
5956          all.push(_this6.getClass('target-attached') + '-' + side);
5957        });
5958  
5959        defer(function () {
5960          if (!(typeof _this6._addAttachClasses !== 'undefined')) {
5961            return;
5962          }
5963  
5964          updateClasses(_this6.element, _this6._addAttachClasses, all);
5965          if (!(_this6.options.addTargetClasses === false)) {
5966            updateClasses(_this6.target, _this6._addAttachClasses, all);
5967          }
5968  
5969          delete _this6._addAttachClasses;
5970        });
5971      }
5972    }, {
5973      key: 'position',
5974      value: function position() {
5975        var _this7 = this;
5976  
5977        var flushChanges = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
5978  
5979        // flushChanges commits the changes immediately, leave true unless you are positioning multiple
5980        // tethers (in which case call Tether.Utils.flush yourself when you're done)
5981  
5982        if (!this.enabled) {
5983          return;
5984        }
5985  
5986        this.clearCache();
5987  
5988        // Turn 'auto' attachments into the appropriate corner or edge
5989        var targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment);
5990  
5991        this.updateAttachClasses(this.attachment, targetAttachment);
5992  
5993        var elementPos = this.cache('element-bounds', function () {
5994          return getBounds(_this7.element);
5995        });
5996  
5997        var width = elementPos.width;
5998        var height = elementPos.height;
5999  
6000        if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') {
6001          var _lastSize = this.lastSize;
6002  
6003          // We cache the height and width to make it possible to position elements that are
6004          // getting hidden.
6005          width = _lastSize.width;
6006          height = _lastSize.height;
6007        } else {
6008          this.lastSize = { width: width, height: height };
6009        }
6010  
6011        var targetPos = this.cache('target-bounds', function () {
6012          return _this7.getTargetBounds();
6013        });
6014        var targetSize = targetPos;
6015  
6016        // Get an actual px offset from the attachment
6017        var offset = offsetToPx(attachmentToOffset(this.attachment), { width: width, height: height });
6018        var targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize);
6019  
6020        var manualOffset = offsetToPx(this.offset, { width: width, height: height });
6021        var manualTargetOffset = offsetToPx(this.targetOffset, targetSize);
6022  
6023        // Add the manually provided offset
6024        offset = addOffset(offset, manualOffset);
6025        targetOffset = addOffset(targetOffset, manualTargetOffset);
6026  
6027        // It's now our goal to make (element position + offset) == (target position + target offset)
6028        var left = targetPos.left + targetOffset.left - offset.left;
6029        var top = targetPos.top + targetOffset.top - offset.top;
6030  
6031        for (var i = 0; i < TetherBase.modules.length; ++i) {
6032          var _module2 = TetherBase.modules[i];
6033          var ret = _module2.position.call(this, {
6034            left: left,
6035            top: top,
6036            targetAttachment: targetAttachment,
6037            targetPos: targetPos,
6038            elementPos: elementPos,
6039            offset: offset,
6040            targetOffset: targetOffset,
6041            manualOffset: manualOffset,
6042            manualTargetOffset: manualTargetOffset,
6043            scrollbarSize: scrollbarSize,
6044            attachment: this.attachment
6045          });
6046  
6047          if (ret === false) {
6048            return false;
6049          } else if (typeof ret === 'undefined' || typeof ret !== 'object') {
6050            continue;
6051          } else {
6052            top = ret.top;
6053            left = ret.left;
6054          }
6055        }
6056  
6057        // We describe the position three different ways to give the optimizer
6058        // a chance to decide the best possible way to position the element
6059        // with the fewest repaints.
6060        var next = {
6061          // It's position relative to the page (absolute positioning when
6062          // the element is a child of the body)
6063          page: {
6064            top: top,
6065            left: left
6066          },
6067  
6068          // It's position relative to the viewport (fixed positioning)
6069          viewport: {
6070            top: top - pageYOffset,
6071            bottom: pageYOffset - top - height + innerHeight,
6072            left: left - pageXOffset,
6073            right: pageXOffset - left - width + innerWidth
6074          }
6075        };
6076  
6077        var doc = this.target.ownerDocument;
6078        var win = doc.defaultView;
6079  
6080        var scrollbarSize = undefined;
6081        if (win.innerHeight > doc.documentElement.clientHeight) {
6082          scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
6083          next.viewport.bottom -= scrollbarSize.height;
6084        }
6085  
6086        if (win.innerWidth > doc.documentElement.clientWidth) {
6087          scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
6088          next.viewport.right -= scrollbarSize.width;
6089        }
6090  
6091        if (['', 'static'].indexOf(doc.body.style.position) === -1 || ['', 'static'].indexOf(doc.body.parentElement.style.position) === -1) {
6092          // Absolute positioning in the body will be relative to the page, not the 'initial containing block'
6093          next.page.bottom = doc.body.scrollHeight - top - height;
6094          next.page.right = doc.body.scrollWidth - left - width;
6095        }
6096  
6097        if (typeof this.options.optimizations !== 'undefined' && this.options.optimizations.moveElement !== false && !(typeof this.targetModifier !== 'undefined')) {
6098          (function () {
6099            var offsetParent = _this7.cache('target-offsetparent', function () {
6100              return getOffsetParent(_this7.target);
6101            });
6102            var offsetPosition = _this7.cache('target-offsetparent-bounds', function () {
6103              return getBounds(offsetParent);
6104            });
6105            var offsetParentStyle = getComputedStyle(offsetParent);
6106            var offsetParentSize = offsetPosition;
6107  
6108            var offsetBorder = {};
6109            ['Top', 'Left', 'Bottom', 'Right'].forEach(function (side) {
6110              offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle['border' + side + 'Width']);
6111            });
6112  
6113            offsetPosition.right = doc.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right;
6114            offsetPosition.bottom = doc.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom;
6115  
6116            if (next.page.top >= offsetPosition.top + offsetBorder.top && next.page.bottom >= offsetPosition.bottom) {
6117              if (next.page.left >= offsetPosition.left + offsetBorder.left && next.page.right >= offsetPosition.right) {
6118                // We're within the visible part of the target's scroll parent
6119                var scrollTop = offsetParent.scrollTop;
6120                var scrollLeft = offsetParent.scrollLeft;
6121  
6122                // It's position relative to the target's offset parent (absolute positioning when
6123                // the element is moved to be a child of the target's offset parent).
6124                next.offset = {
6125                  top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top,
6126                  left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left
6127                };
6128              }
6129            }
6130          })();
6131        }
6132  
6133        // We could also travel up the DOM and try each containing context, rather than only
6134        // looking at the body, but we're gonna get diminishing returns.
6135  
6136        this.move(next);
6137  
6138        this.history.unshift(next);
6139  
6140        if (this.history.length > 3) {
6141          this.history.pop();
6142        }
6143  
6144        if (flushChanges) {
6145          flush();
6146        }
6147  
6148        return true;
6149      }
6150  
6151      // THE ISSUE
6152    }, {
6153      key: 'move',
6154      value: function move(pos) {
6155        var _this8 = this;
6156  
6157        if (!(typeof this.element.parentNode !== 'undefined')) {
6158          return;
6159        }
6160  
6161        var same = {};
6162  
6163        for (var type in pos) {
6164          same[type] = {};
6165  
6166          for (var key in pos[type]) {
6167            var found = false;
6168  
6169            for (var i = 0; i < this.history.length; ++i) {
6170              var point = this.history[i];
6171              if (typeof point[type] !== 'undefined' && !within(point[type][key], pos[type][key])) {
6172                found = true;
6173                break;
6174              }
6175            }
6176  
6177            if (!found) {
6178              same[type][key] = true;
6179            }
6180          }
6181        }
6182  
6183        var css = { top: '', left: '', right: '', bottom: '' };
6184  
6185        var transcribe = function transcribe(_same, _pos) {
6186          var hasOptimizations = typeof _this8.options.optimizations !== 'undefined';
6187          var gpu = hasOptimizations ? _this8.options.optimizations.gpu : null;
6188          if (gpu !== false) {
6189            var yPos = undefined,
6190                xPos = undefined;
6191            if (_same.top) {
6192              css.top = 0;
6193              yPos = _pos.top;
6194            } else {
6195              css.bottom = 0;
6196              yPos = -_pos.bottom;
6197            }
6198  
6199            if (_same.left) {
6200              css.left = 0;
6201              xPos = _pos.left;
6202            } else {
6203              css.right = 0;
6204              xPos = -_pos.right;
6205            }
6206  
6207            if (window.matchMedia) {
6208              // HubSpot/tether#207
6209              var retina = window.matchMedia('only screen and (min-resolution: 1.3dppx)').matches || window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 1.3)').matches;
6210              if (!retina) {
6211                xPos = Math.round(xPos);
6212                yPos = Math.round(yPos);
6213              }
6214            }
6215  
6216            css[transformKey] = 'translateX(' + xPos + 'px) translateY(' + yPos + 'px)';
6217  
6218            if (transformKey !== 'msTransform') {
6219              // The Z transform will keep this in the GPU (faster, and prevents artifacts),
6220              // but IE9 doesn't support 3d transforms and will choke.
6221              css[transformKey] += " translateZ(0)";
6222            }
6223          } else {
6224            if (_same.top) {
6225              css.top = _pos.top + 'px';
6226            } else {
6227              css.bottom = _pos.bottom + 'px';
6228            }
6229  
6230            if (_same.left) {
6231              css.left = _pos.left + 'px';
6232            } else {
6233              css.right = _pos.right + 'px';
6234            }
6235          }
6236        };
6237  
6238        var moved = false;
6239        if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) {
6240          css.position = 'absolute';
6241          transcribe(same.page, pos.page);
6242        } else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) {
6243          css.position = 'fixed';
6244          transcribe(same.viewport, pos.viewport);
6245        } else if (typeof same.offset !== 'undefined' && same.offset.top && same.offset.left) {
6246          (function () {
6247            css.position = 'absolute';
6248            var offsetParent = _this8.cache('target-offsetparent', function () {
6249              return getOffsetParent(_this8.target);
6250            });
6251  
6252            if (getOffsetParent(_this8.element) !== offsetParent) {
6253              defer(function () {
6254                _this8.element.parentNode.removeChild(_this8.element);
6255                offsetParent.appendChild(_this8.element);
6256              });
6257            }
6258  
6259            transcribe(same.offset, pos.offset);
6260            moved = true;
6261          })();
6262        } else {
6263          css.position = 'absolute';
6264          transcribe({ top: true, left: true }, pos.page);
6265        }
6266  
6267        if (!moved) {
6268          if (this.options.bodyElement) {
6269            this.options.bodyElement.appendChild(this.element);
6270          } else {
6271            var offsetParentIsBody = true;
6272            var currentNode = this.element.parentNode;
6273            while (currentNode && currentNode.nodeType === 1 && currentNode.tagName !== 'BODY') {
6274              if (getComputedStyle(currentNode).position !== 'static') {
6275                offsetParentIsBody = false;
6276                break;
6277              }
6278  
6279              currentNode = currentNode.parentNode;
6280            }
6281  
6282            if (!offsetParentIsBody) {
6283              this.element.parentNode.removeChild(this.element);
6284              this.element.ownerDocument.body.appendChild(this.element);
6285            }
6286          }
6287        }
6288  
6289        // Any css change will trigger a repaint, so let's avoid one if nothing changed
6290        var writeCSS = {};
6291        var write = false;
6292        for (var key in css) {
6293          var val = css[key];
6294          var elVal = this.element.style[key];
6295  
6296          if (elVal !== val) {
6297            write = true;
6298            writeCSS[key] = val;
6299          }
6300        }
6301  
6302        if (write) {
6303          defer(function () {
6304            extend(_this8.element.style, writeCSS);
6305            _this8.trigger('repositioned');
6306          });
6307        }
6308      }
6309    }]);
6310  
6311    return TetherClass;
6312  })(Evented);
6313  
6314  TetherClass.modules = [];
6315  
6316  TetherBase.position = position;
6317  
6318  var Tether = extend(TetherClass, TetherBase);
6319  /* globals TetherBase */
6320  
6321  'use strict';
6322  
6323  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
6324  
6325  var _TetherBase$Utils = TetherBase.Utils;
6326  var getBounds = _TetherBase$Utils.getBounds;
6327  var extend = _TetherBase$Utils.extend;
6328  var updateClasses = _TetherBase$Utils.updateClasses;
6329  var defer = _TetherBase$Utils.defer;
6330  
6331  var BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom'];
6332  
6333  function getBoundingRect(tether, to) {
6334    if (to === 'scrollParent') {
6335      to = tether.scrollParents[0];
6336    } else if (to === 'window') {
6337      to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset];
6338    }
6339  
6340    if (to === document) {
6341      to = to.documentElement;
6342    }
6343  
6344    if (typeof to.nodeType !== 'undefined') {
6345      (function () {
6346        var node = to;
6347        var size = getBounds(to);
6348        var pos = size;
6349        var style = getComputedStyle(to);
6350  
6351        to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top];
6352  
6353        // Account any parent Frames scroll offset
6354        if (node.ownerDocument !== document) {
6355          var win = node.ownerDocument.defaultView;
6356          to[0] += win.pageXOffset;
6357          to[1] += win.pageYOffset;
6358          to[2] += win.pageXOffset;
6359          to[3] += win.pageYOffset;
6360        }
6361  
6362        BOUNDS_FORMAT.forEach(function (side, i) {
6363          side = side[0].toUpperCase() + side.substr(1);
6364          if (side === 'Top' || side === 'Left') {
6365            to[i] += parseFloat(style['border' + side + 'Width']);
6366          } else {
6367            to[i] -= parseFloat(style['border' + side + 'Width']);
6368          }
6369        });
6370      })();
6371    }
6372  
6373    return to;
6374  }
6375  
6376  TetherBase.modules.push({
6377    position: function position(_ref) {
6378      var _this = this;
6379  
6380      var top = _ref.top;
6381      var left = _ref.left;
6382      var targetAttachment = _ref.targetAttachment;
6383  
6384      if (!this.options.constraints) {
6385        return true;
6386      }
6387  
6388      var _cache = this.cache('element-bounds', function () {
6389        return getBounds(_this.element);
6390      });
6391  
6392      var height = _cache.height;
6393      var width = _cache.width;
6394  
6395      if (width === 0 && height === 0 && typeof this.lastSize !== 'undefined') {
6396        var _lastSize = this.lastSize;
6397  
6398        // Handle the item getting hidden as a result of our positioning without glitching
6399        // the classes in and out
6400        width = _lastSize.width;
6401        height = _lastSize.height;
6402      }
6403  
6404      var targetSize = this.cache('target-bounds', function () {
6405        return _this.getTargetBounds();
6406      });
6407  
6408      var targetHeight = targetSize.height;
6409      var targetWidth = targetSize.width;
6410  
6411      var allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')];
6412  
vendor: 4,455 bytes, lines 6413-6545
6413      this.options.constraints.forEach(function (constraint) {
6414        var outOfBoundsClass = constraint.outOfBoundsClass;
6415        var pinnedClass = constraint.pinnedClass;
6416  
6417        if (outOfBoundsClass) {
6418          allClasses.push(outOfBoundsClass);
6419        }
6420        if (pinnedClass) {
6421          allClasses.push(pinnedClass);
6422        }
6423      });
6424  
6425      allClasses.forEach(function (cls) {
6426        ['left', 'top', 'right', 'bottom'].forEach(function (side) {
6427          allClasses.push(cls + '-' + side);
6428        });
6429      });
6430  
6431      var addClasses = [];
6432  
6433      var tAttachment = extend({}, targetAttachment);
6434      var eAttachment = extend({}, this.attachment);
6435  
6436      this.options.constraints.forEach(function (constraint) {
6437        var to = constraint.to;
6438        var attachment = constraint.attachment;
6439        var pin = constraint.pin;
6440  
6441        if (typeof attachment === 'undefined') {
6442          attachment = '';
6443        }
6444  
6445        var changeAttachX = undefined,
6446            changeAttachY = undefined;
6447        if (attachment.indexOf(' ') >= 0) {
6448          var _attachment$split = attachment.split(' ');
6449  
6450          var _attachment$split2 = _slicedToArray(_attachment$split, 2);
6451  
6452          changeAttachY = _attachment$split2[0];
6453          changeAttachX = _attachment$split2[1];
6454        } else {
6455          changeAttachX = changeAttachY = attachment;
6456        }
6457  
6458        var bounds = getBoundingRect(_this, to);
6459  
6460        if (changeAttachY === 'target' || changeAttachY === 'both') {
6461          if (top < bounds[1] && tAttachment.top === 'top') {
6462            top += targetHeight;
6463            tAttachment.top = 'bottom';
6464          }
6465  
6466          if (top + height > bounds[3] && tAttachment.top === 'bottom') {
6467            top -= targetHeight;
6468            tAttachment.top = 'top';
6469          }
6470        }
6471  
6472        if (changeAttachY === 'together') {
6473          if (tAttachment.top === 'top') {
6474            if (eAttachment.top === 'bottom' && top < bounds[1]) {
6475              top += targetHeight;
6476              tAttachment.top = 'bottom';
6477  
6478              top += height;
6479              eAttachment.top = 'top';
6480            } else if (eAttachment.top === 'top' && top + height > bounds[3] && top - (height - targetHeight) >= bounds[1]) {
6481              top -= height - targetHeight;
6482              tAttachment.top = 'bottom';
6483  
6484              eAttachment.top = 'bottom';
6485            }
6486          }
6487  
6488          if (tAttachment.top === 'bottom') {
6489            if (eAttachment.top === 'top' && top + height > bounds[3]) {
6490              top -= targetHeight;
6491              tAttachment.top = 'top';
6492  
6493              top -= height;
6494              eAttachment.top = 'bottom';
6495            } else if (eAttachment.top === 'bottom' && top < bounds[1] && top + (height * 2 - targetHeight) <= bounds[3]) {
6496              top += height - targetHeight;
6497              tAttachment.top = 'top';
6498  
6499              eAttachment.top = 'top';
6500            }
6501          }
6502  
6503          if (tAttachment.top === 'middle') {
6504            if (top + height > bounds[3] && eAttachment.top === 'top') {
6505              top -= height;
6506              eAttachment.top = 'bottom';
6507            } else if (top < bounds[1] && eAttachment.top === 'bottom') {
6508              top += height;
6509              eAttachment.top = 'top';
6510            }
6511          }
6512        }
6513  
6514        if (changeAttachX === 'target' || changeAttachX === 'both') {
6515          if (left < bounds[0] && tAttachment.left === 'left') {
6516            left += targetWidth;
6517            tAttachment.left = 'right';
6518          }
6519  
6520          if (left + width > bounds[2] && tAttachment.left === 'right') {
6521            left -= targetWidth;
6522            tAttachment.left = 'left';
6523          }
6524        }
6525  
6526        if (changeAttachX === 'together') {
6527          if (left < bounds[0] && tAttachment.left === 'left') {
6528            if (eAttachment.left === 'right') {
6529              left += targetWidth;
6530              tAttachment.left = 'right';
6531  
6532              left += width;
6533              eAttachment.left = 'left';
6534            } else if (eAttachment.left === 'left') {
6535              left += targetWidth;
6536              tAttachment.left = 'right';
6537  
6538              left -= width;
6539              eAttachment.left = 'right';
6540            }
6541          } else if (left + width > bounds[2] && tAttachment.left === 'right') {
6542            if (eAttachment.left === 'left') {
6543              left -= targetWidth;
6544              tAttachment.left = 'left';
6545  
6546              left -= width;
6547              eAttachment.left = 'right';
6548            } else if (eAttachment.left === 'right') {
6549              left -= targetWidth;
6550              tAttachment.left = 'left';
6551  
6552              left += width;
6553              eAttachment.left = 'left';
6554            }
6555          } else if (tAttachment.left === 'center') {
6556            if (left + width > bounds[2] && eAttachment.left === 'left') {
6557              left -= width;
6558              eAttachment.left = 'right';
6559            } else if (left < bounds[0] && eAttachment.left === 'right') {
6560              left += width;
6561              eAttachment.left = 'left';
6562            }
6563          }
6564        }
6565  
6566        if (changeAttachY === 'element' || changeAttachY === 'both') {
6567          if (top < bounds[1] && eAttachment.top === 'bottom') {
6568            top += height;
6569            eAttachment.top = 'top';
6570          }
6571  
6572          if (top + height > bounds[3] && eAttachment.top === 'top') {
6573            top -= height;
6574            eAttachment.top = 'bottom';
6575          }
6576        }
6577  
6578        if (changeAttachX === 'element' || changeAttachX === 'both') {
6579          if (left < bounds[0]) {
6580            if (eAttachment.left === 'right') {
6581              left += width;
6582              eAttachment.left = 'left';
6583            } else if (eAttachment.left === 'center') {
6584              left += width / 2;
6585              eAttachment.left = 'left';
6586            }
6587          }
6588  
6589          if (left + width > bounds[2]) {
6590            if (eAttachment.left === 'left') {
6591              left -= width;
6592              eAttachment.left = 'right';
6593            } else if (eAttachment.left === 'center') {
6594              left -= width / 2;
6595              eAttachment.left = 'right';
6596            }
6597          }
6598        }
6599  
6600        if (typeof pin === 'string') {
6601          pin = pin.split(',').map(function (p) {
6602            return p.trim();
6603          });
6604        } else if (pin === true) {
6605          pin = ['top', 'left', 'right', 'bottom'];
6606        }
6607  
6608        pin = pin || [];
6609  
6610        var pinned = [];
6611        var oob = [];
6612  
6613        if (top < bounds[1]) {
6614          if (pin.indexOf('top') >= 0) {
6615            top = bounds[1];
6616            pinned.push('top');
6617          } else {
6618            oob.push('top');
6619          }
6620        }
6621  
6622        if (top + height > bounds[3]) {
6623          if (pin.indexOf('bottom') >= 0) {
6624            top = bounds[3] - height;
6625            pinned.push('bottom');
6626          } else {
6627            oob.push('bottom');
6628          }
6629        }
6630  
6631        if (left < bounds[0]) {
6632          if (pin.indexOf('left') >= 0) {
6633            left = bounds[0];
6634            pinned.push('left');
6635          } else {
6636            oob.push('left');
6637          }
6638        }
6639  
6640        if (left + width > bounds[2]) {
6641          if (pin.indexOf('right') >= 0) {
6642            left = bounds[2] - width;
6643            pinned.push('right');
6644          } else {
6645            oob.push('right');
6646          }
6647        }
6648  
6649        if (pinned.length) {
6650          (function () {
6651            var pinnedClass = undefined;
6652            if (typeof _this.options.pinnedClass !== 'undefined') {
6653              pinnedClass = _this.options.pinnedClass;
6654            } else {
6655              pinnedClass = _this.getClass('pinned');
6656            }
6657  
6658            addClasses.push(pinnedClass);
6659            pinned.forEach(function (side) {
6660              addClasses.push(pinnedClass + '-' + side);
6661            });
6662          })();
6663        }
6664  
6665        if (oob.length) {
6666          (function () {
6667            var oobClass = undefined;
6668            if (typeof _this.options.outOfBoundsClass !== 'undefined') {
6669              oobClass = _this.options.outOfBoundsClass;
6670            } else {
6671              oobClass = _this.getClass('out-of-bounds');
6672            }
6673  
6674            addClasses.push(oobClass);
6675            oob.forEach(function (side) {
6676              addClasses.push(oobClass + '-' + side);
6677            });
6678          })();
6679        }
6680  
6681        if (pinned.indexOf('left') >= 0 || pinned.indexOf('right') >= 0) {
6682          eAttachment.left = tAttachment.left = false;
6683        }
6684        if (pinned.indexOf('top') >= 0 || pinned.indexOf('bottom') >= 0) {
6685          eAttachment.top = tAttachment.top = false;
6686        }
6687  
6688        if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== _this.attachment.top || eAttachment.left !== _this.attachment.left) {
6689          _this.updateAttachClasses(eAttachment, tAttachment);
6690          _this.trigger('update', {
6691            attachment: eAttachment,
6692            targetAttachment: tAttachment
6693          });
6694        }
6695      });
6696  
6697      defer(function () {
6698        if (!(_this.options.addTargetClasses === false)) {
6699          updateClasses(_this.target, addClasses, allClasses);
6700        }
6701        updateClasses(_this.element, addClasses, allClasses);
6702      });
6703  
6704      return { top: top, left: left };
6705    }
6706  });
6707  /* globals TetherBase */
6708  
6709  'use strict';
6710  
6711  var _TetherBase$Utils = TetherBase.Utils;
6712  var getBounds = _TetherBase$Utils.getBounds;
6713  var updateClasses = _TetherBase$Utils.updateClasses;
6714  var defer = _TetherBase$Utils.defer;
6715  
6716  TetherBase.modules.push({
6717    position: function position(_ref) {
6718      var _this = this;
6719  
6720      var top = _ref.top;
6721      var left = _ref.left;
6722  
6723      var _cache = this.cache('element-bounds', function () {
6724        return getBounds(_this.element);
6725      });
6726  
6727      var height = _cache.height;
6728      var width = _cache.width;
6729  
6730      var targetPos = this.getTargetBounds();
6731  
6732      var bottom = top + height;
6733      var right = left + width;
6734  
6735      var abutted = [];
6736      if (top <= targetPos.bottom && bottom >= targetPos.top) {
6737        ['left', 'right'].forEach(function (side) {
6738          var targetPosSide = targetPos[side];
6739          if (targetPosSide === left || targetPosSide === right) {
6740            abutted.push(side);
6741          }
6742        });
6743      }
6744  
6745      if (left <= targetPos.right && right >= targetPos.left) {
6746        ['top', 'bottom'].forEach(function (side) {
6747          var targetPosSide = targetPos[side];
6748          if (targetPosSide === top || targetPosSide === bottom) {
6749            abutted.push(side);
6750          }
6751        });
6752      }
6753  
6754      var allClasses = [];
6755      var addClasses = [];
6756  
6757      var sides = ['left', 'top', 'right', 'bottom'];
6758      allClasses.push(this.getClass('abutted'));
6759      sides.forEach(function (side) {
6760        allClasses.push(_this.getClass('abutted') + '-' + side);
6761      });
6762  
6763      if (abutted.length) {
6764        addClasses.push(this.getClass('abutted'));
6765      }
6766  
6767      abutted.forEach(function (side) {
6768        addClasses.push(_this.getClass('abutted') + '-' + side);
6769      });
6770  
6771      defer(function () {
6772        if (!(_this.options.addTargetClasses === false)) {
6773          updateClasses(_this.target, addClasses, allClasses);
6774        }
6775        updateClasses(_this.element, addClasses, allClasses);
6776      });
6777  
6778      return true;
6779    }
6780  });
6781  /* globals TetherBase */
6782  
6783  'use strict';
6784  
6785  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
6786  
6787  TetherBase.modules.push({
6788    position: function position(_ref) {
6789      var top = _ref.top;
6790      var left = _ref.left;
6791  
6792      if (!this.options.shift) {
6793        return;
6794      }
6795  
6796      var shift = this.options.shift;
6797      if (typeof this.options.shift === 'function') {
6798        shift = this.options.shift.call(this, { top: top, left: left });
6799      }
6800  
6801      var shiftTop = undefined,
6802          shiftLeft = undefined;
6803      if (typeof shift === 'string') {
6804        shift = shift.split(' ');
6805        shift[1] = shift[1] || shift[0];
6806  
6807        var _shift = shift;
6808  
6809        var _shift2 = _slicedToArray(_shift, 2);
6810  
6811        shiftTop = _shift2[0];
6812        shiftLeft = _shift2[1];
6813  
6814        shiftTop = parseFloat(shiftTop, 10);
6815        shiftLeft = parseFloat(shiftLeft, 10);
6816      } else {
6817        shiftTop = shift.top;
6818        shiftLeft = shift.left;
6819      }
6820  
6821      top += shiftTop;
6822      left += shiftLeft;
6823  
6824      return { top: top, left: left };
6825    }
6826  });
6827  return Tether;
6828  
6829  }));
6830  
6831  
6832  /***/ }),
6833  /* 15 */,
6834  /* 16 */
6835  /***/ (function(module, exports, __webpack_require__) {
6836  
6837  __webpack_require__(2);
6838  module.exports = __webpack_require__(3);
6839  
6840  
6841  /***/ })
6842  /******/ ]);
6843  //# sourceMappingURL=main.js.map

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.