bootstrap.bundle.js 207 KB
Newer Older
Mark Otto's avatar
dist  
Mark Otto committed
1
/*!
Mark Otto's avatar
Mark Otto committed
2
  * Bootstrap v4.1.3 (https://getbootstrap.com/)
Mark Otto's avatar
dist    
Mark Otto committed
3
  * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
Mark Otto's avatar
dist  
Mark Otto committed
4
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  */
Mark Otto's avatar
dist    
Mark Otto committed
6
(function (global, factory) {
Mark Otto's avatar
dist    
Mark Otto committed
7
8
9
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
  typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
  (factory((global.bootstrap = {}),global.jQuery));
Mark Otto's avatar
dist    
Mark Otto committed
10
}(this, (function (exports,$) { 'use strict';
Mark Otto's avatar
dist  
Mark Otto committed
11

Mark Otto's avatar
dist    
Mark Otto committed
12
  $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
Mark Otto's avatar
dist  
Mark Otto committed
13

Mark Otto's avatar
dist    
Mark Otto committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  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);
    }
  }

  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
Mark Otto's avatar
Mark Otto committed
28
29
  }

Mark Otto's avatar
dist    
Mark Otto committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }

    return obj;
  }
Mark Otto's avatar
Mark Otto committed
44

Mark Otto's avatar
dist    
Mark Otto committed
45
  function _objectSpread(target) {
Mark Otto's avatar
dist    
Mark Otto committed
46
    for (var i = 1; i < arguments.length; i++) {
Mark Otto's avatar
dist    
Mark Otto committed
47
48
      var source = arguments[i] != null ? arguments[i] : {};
      var ownKeys = Object.keys(source);
Mark Otto's avatar
dist    
Mark Otto committed
49

Mark Otto's avatar
dist    
Mark Otto committed
50
51
52
53
      if (typeof Object.getOwnPropertySymbols === 'function') {
        ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
        }));
Mark Otto's avatar
dist    
Mark Otto committed
54
      }
Mark Otto's avatar
dist    
Mark Otto committed
55
56
57
58

      ownKeys.forEach(function (key) {
        _defineProperty(target, key, source[key]);
      });
Mark Otto's avatar
dist    
Mark Otto committed
59
60
61
    }

    return target;
Mark Otto's avatar
dist    
Mark Otto committed
62
  }
Mark Otto's avatar
Mark Otto committed
63

Mark Otto's avatar
dist    
Mark Otto committed
64
65
66
67
68
  function _inheritsLoose(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    subClass.__proto__ = superClass;
  }
Mark Otto's avatar
dist  
Mark Otto committed
69
70

  /**
Mark Otto's avatar
dist    
Mark Otto committed
71
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
72
   * Bootstrap (v4.1.3): util.js
Mark Otto's avatar
dist    
Mark Otto committed
73
74
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
75
   */
Mark Otto's avatar
dist    
Mark Otto committed
76

Mark Otto's avatar
dist    
Mark Otto committed
77
78
79
80
81
82
83
84
85
  var Util = function ($$$1) {
    /**
     * ------------------------------------------------------------------------
     * Private TransitionEnd Helpers
     * ------------------------------------------------------------------------
     */
    var TRANSITION_END = 'transitionend';
    var MAX_UID = 1000000;
    var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
Mark Otto's avatar
dist  
Mark Otto committed
86

Mark Otto's avatar
dist    
Mark Otto committed
87
88
    function toType(obj) {
      return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
Mark Otto's avatar
dist  
Mark Otto committed
89
90
    }

Mark Otto's avatar
dist    
Mark Otto committed
91
92
93
94
95
96
97
98
    function getSpecialTransitionEndEvent() {
      return {
        bindType: TRANSITION_END,
        delegateType: TRANSITION_END,
        handle: function handle(event) {
          if ($$$1(event.target).is(this)) {
            return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
          }
Mark Otto's avatar
dist  
Mark Otto committed
99

Mark Otto's avatar
dist    
Mark Otto committed
100
101
102
103
          return undefined; // eslint-disable-line no-undefined
        }
      };
    }
Mark Otto's avatar
dist  
Mark Otto committed
104

Mark Otto's avatar
dist    
Mark Otto committed
105
106
    function transitionEndEmulator(duration) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
107

Mark Otto's avatar
dist    
Mark Otto committed
108
109
110
111
112
113
114
115
116
117
118
      var called = false;
      $$$1(this).one(Util.TRANSITION_END, function () {
        called = true;
      });
      setTimeout(function () {
        if (!called) {
          Util.triggerTransitionEnd(_this);
        }
      }, duration);
      return this;
    }
Mark Otto's avatar
dist  
Mark Otto committed
119

Mark Otto's avatar
dist    
Mark Otto committed
120
121
    function setTransitionEndSupport() {
      $$$1.fn.emulateTransitionEnd = transitionEndEmulator;
Mark Otto's avatar
dist    
Mark Otto committed
122
      $$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
Mark Otto's avatar
dist  
Mark Otto committed
123
    }
Mark Otto's avatar
dist    
Mark Otto committed
124
125
126
127
128
    /**
     * --------------------------------------------------------------------------
     * Public Util Api
     * --------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
129
130


Mark Otto's avatar
dist    
Mark Otto committed
131
132
133
134
135
136
137
    var Util = {
      TRANSITION_END: 'bsTransitionEnd',
      getUID: function getUID(prefix) {
        do {
          // eslint-disable-next-line no-bitwise
          prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
        } while (document.getElementById(prefix));
Mark Otto's avatar
dist    
Mark Otto committed
138

Mark Otto's avatar
dist    
Mark Otto committed
139
140
141
142
        return prefix;
      },
      getSelectorFromElement: function getSelectorFromElement(element) {
        var selector = element.getAttribute('data-target');
Mark Otto's avatar
dist    
Mark Otto committed
143

Mark Otto's avatar
dist    
Mark Otto committed
144
145
146
        if (!selector || selector === '#') {
          selector = element.getAttribute('href') || '';
        }
Mark Otto's avatar
dist  
Mark Otto committed
147

Mark Otto's avatar
dist    
Mark Otto committed
148
        try {
Mark Otto's avatar
dist    
Mark Otto committed
149
          return document.querySelector(selector) ? selector : null;
Mark Otto's avatar
dist    
Mark Otto committed
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
        } catch (err) {
          return null;
        }
      },
      getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
        if (!element) {
          return 0;
        } // Get transition-duration of the element


        var transitionDuration = $$$1(element).css('transition-duration');
        var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found

        if (!floatTransitionDuration) {
          return 0;
        } // If multiple durations are defined, take the first


        transitionDuration = transitionDuration.split(',')[0];
        return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;
      },
      reflow: function reflow(element) {
        return element.offsetHeight;
      },
      triggerTransitionEnd: function triggerTransitionEnd(element) {
        $$$1(element).trigger(TRANSITION_END);
      },
      // TODO: Remove in v5
      supportsTransitionEnd: function supportsTransitionEnd() {
        return Boolean(TRANSITION_END);
      },
      isElement: function isElement(obj) {
        return (obj[0] || obj).nodeType;
      },
      typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
        for (var property in configTypes) {
          if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
            var expectedTypes = configTypes[property];
            var value = config[property];
            var valueType = value && Util.isElement(value) ? 'element' : toType(value);

            if (!new RegExp(expectedTypes).test(valueType)) {
              throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
            }
Mark Otto's avatar
dist  
Mark Otto committed
194
195
196
          }
        }
      }
Mark Otto's avatar
dist    
Mark Otto committed
197
198
199
200
201
    };
    setTransitionEndSupport();
    return Util;
  }($);

Mark Otto's avatar
dist  
Mark Otto committed
202
  /**
Mark Otto's avatar
dist    
Mark Otto committed
203
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
204
   * Bootstrap (v4.1.3): alert.js
Mark Otto's avatar
dist    
Mark Otto committed
205
206
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
207
   */
Mark Otto's avatar
dist    
Mark Otto committed
208
209

  var Alert = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
210
211
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
212
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
213
214
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
215
    var NAME = 'alert';
Mark Otto's avatar
Mark Otto committed
216
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
    var DATA_KEY = 'bs.alert';
    var EVENT_KEY = "." + DATA_KEY;
    var DATA_API_KEY = '.data-api';
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var Selector = {
      DISMISS: '[data-dismiss="alert"]'
    };
    var Event = {
      CLOSE: "close" + EVENT_KEY,
      CLOSED: "closed" + EVENT_KEY,
      CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
    };
    var ClassName = {
      ALERT: 'alert',
      FADE: 'fade',
      SHOW: 'show'
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
238

Mark Otto's avatar
dist    
Mark Otto committed
239
    };
Mark Otto's avatar
dist  
Mark Otto committed
240

Mark Otto's avatar
dist    
Mark Otto committed
241
242
243
244
245
246
    var Alert =
    /*#__PURE__*/
    function () {
      function Alert(element) {
        this._element = element;
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
247
248


Mark Otto's avatar
dist    
Mark Otto committed
249
      var _proto = Alert.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
250

Mark Otto's avatar
dist    
Mark Otto committed
251
252
      // Public
      _proto.close = function close(element) {
Mark Otto's avatar
dist    
Mark Otto committed
253
        var rootElement = this._element;
Mark Otto's avatar
dist  
Mark Otto committed
254

Mark Otto's avatar
dist    
Mark Otto committed
255
256
257
        if (element) {
          rootElement = this._getRootElement(element);
        }
Mark Otto's avatar
dist    
Mark Otto committed
258

Mark Otto's avatar
dist    
Mark Otto committed
259
        var customEvent = this._triggerCloseEvent(rootElement);
Mark Otto's avatar
dist  
Mark Otto committed
260

Mark Otto's avatar
dist    
Mark Otto committed
261
262
263
        if (customEvent.isDefaultPrevented()) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
264

Mark Otto's avatar
dist    
Mark Otto committed
265
266
        this._removeElement(rootElement);
      };
Mark Otto's avatar
dist  
Mark Otto committed
267

Mark Otto's avatar
dist    
Mark Otto committed
268
269
270
271
      _proto.dispose = function dispose() {
        $$$1.removeData(this._element, DATA_KEY);
        this._element = null;
      }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
272
273


Mark Otto's avatar
dist    
Mark Otto committed
274
275
276
      _proto._getRootElement = function _getRootElement(element) {
        var selector = Util.getSelectorFromElement(element);
        var parent = false;
Mark Otto's avatar
dist  
Mark Otto committed
277

Mark Otto's avatar
dist    
Mark Otto committed
278
        if (selector) {
Mark Otto's avatar
dist    
Mark Otto committed
279
          parent = document.querySelector(selector);
Mark Otto's avatar
dist    
Mark Otto committed
280
        }
Mark Otto's avatar
dist  
Mark Otto committed
281

Mark Otto's avatar
dist    
Mark Otto committed
282
283
284
        if (!parent) {
          parent = $$$1(element).closest("." + ClassName.ALERT)[0];
        }
Mark Otto's avatar
dist  
Mark Otto committed
285

Mark Otto's avatar
dist    
Mark Otto committed
286
287
        return parent;
      };
Mark Otto's avatar
dist  
Mark Otto committed
288

Mark Otto's avatar
dist    
Mark Otto committed
289
290
291
292
293
      _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
        var closeEvent = $$$1.Event(Event.CLOSE);
        $$$1(element).trigger(closeEvent);
        return closeEvent;
      };
Mark Otto's avatar
dist  
Mark Otto committed
294

Mark Otto's avatar
dist    
Mark Otto committed
295
296
      _proto._removeElement = function _removeElement(element) {
        var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
297

Mark Otto's avatar
dist    
Mark Otto committed
298
        $$$1(element).removeClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
299

Mark Otto's avatar
dist    
Mark Otto committed
300
301
        if (!$$$1(element).hasClass(ClassName.FADE)) {
          this._destroyElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
302

Mark Otto's avatar
dist    
Mark Otto committed
303
304
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
305

Mark Otto's avatar
dist    
Mark Otto committed
306
307
308
309
310
        var transitionDuration = Util.getTransitionDurationFromElement(element);
        $$$1(element).one(Util.TRANSITION_END, function (event) {
          return _this._destroyElement(element, event);
        }).emulateTransitionEnd(transitionDuration);
      };
Mark Otto's avatar
dist  
Mark Otto committed
311

Mark Otto's avatar
dist    
Mark Otto committed
312
313
314
      _proto._destroyElement = function _destroyElement(element) {
        $$$1(element).detach().trigger(Event.CLOSED).remove();
      }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
315
316


Mark Otto's avatar
dist    
Mark Otto committed
317
318
319
320
      Alert._jQueryInterface = function _jQueryInterface(config) {
        return this.each(function () {
          var $element = $$$1(this);
          var data = $element.data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
321

Mark Otto's avatar
dist    
Mark Otto committed
322
323
324
325
          if (!data) {
            data = new Alert(this);
            $element.data(DATA_KEY, data);
          }
Mark Otto's avatar
dist  
Mark Otto committed
326

Mark Otto's avatar
dist    
Mark Otto committed
327
328
329
330
331
          if (config === 'close') {
            data[config](this);
          }
        });
      };
Mark Otto's avatar
dist  
Mark Otto committed
332

Mark Otto's avatar
dist    
Mark Otto committed
333
334
335
336
337
      Alert._handleDismiss = function _handleDismiss(alertInstance) {
        return function (event) {
          if (event) {
            event.preventDefault();
          }
Mark Otto's avatar
dist  
Mark Otto committed
338

Mark Otto's avatar
dist    
Mark Otto committed
339
340
          alertInstance.close(this);
        };
Mark Otto's avatar
dist  
Mark Otto committed
341
342
      };

Mark Otto's avatar
dist    
Mark Otto committed
343
344
345
346
347
348
      _createClass(Alert, null, [{
        key: "VERSION",
        get: function get() {
          return VERSION;
        }
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
349

Mark Otto's avatar
dist    
Mark Otto committed
350
351
352
353
354
355
356
      return Alert;
    }();
    /**
     * ------------------------------------------------------------------------
     * Data Api implementation
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
357
358


Mark Otto's avatar
dist    
Mark Otto committed
359
360
361
362
363
364
    $$$1(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
365

Mark Otto's avatar
dist    
Mark Otto committed
366
367
    $$$1.fn[NAME] = Alert._jQueryInterface;
    $$$1.fn[NAME].Constructor = Alert;
Mark Otto's avatar
dist  
Mark Otto committed
368

Mark Otto's avatar
dist    
Mark Otto committed
369
370
371
372
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Alert._jQueryInterface;
    };
Mark Otto's avatar
dist  
Mark Otto committed
373

Mark Otto's avatar
dist    
Mark Otto committed
374
375
    return Alert;
  }($);
Mark Otto's avatar
dist  
Mark Otto committed
376
377

  /**
Mark Otto's avatar
dist    
Mark Otto committed
378
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
379
   * Bootstrap (v4.1.3): button.js
Mark Otto's avatar
dist    
Mark Otto committed
380
381
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
382
   */
Mark Otto's avatar
dist    
Mark Otto committed
383
384

  var Button = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
385
386
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
387
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
388
389
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
390
    var NAME = 'button';
Mark Otto's avatar
Mark Otto committed
391
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
    var DATA_KEY = 'bs.button';
    var EVENT_KEY = "." + DATA_KEY;
    var DATA_API_KEY = '.data-api';
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var ClassName = {
      ACTIVE: 'active',
      BUTTON: 'btn',
      FOCUS: 'focus'
    };
    var Selector = {
      DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
      DATA_TOGGLE: '[data-toggle="buttons"]',
      INPUT: 'input',
      ACTIVE: '.active',
      BUTTON: '.btn'
    };
    var Event = {
      CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
      FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
416

Mark Otto's avatar
dist    
Mark Otto committed
417
    };
Mark Otto's avatar
dist  
Mark Otto committed
418

Mark Otto's avatar
dist    
Mark Otto committed
419
420
421
422
423
424
    var Button =
    /*#__PURE__*/
    function () {
      function Button(element) {
        this._element = element;
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
425
426


Mark Otto's avatar
dist    
Mark Otto committed
427
      var _proto = Button.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
428

Mark Otto's avatar
dist    
Mark Otto committed
429
430
431
432
433
      // Public
      _proto.toggle = function toggle() {
        var triggerChangeEvent = true;
        var addAriaPressed = true;
        var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];
Mark Otto's avatar
dist  
Mark Otto committed
434

Mark Otto's avatar
dist    
Mark Otto committed
435
        if (rootElement) {
Mark Otto's avatar
dist    
Mark Otto committed
436
          var input = this._element.querySelector(Selector.INPUT);
Mark Otto's avatar
dist  
Mark Otto committed
437

Mark Otto's avatar
dist    
Mark Otto committed
438
439
          if (input) {
            if (input.type === 'radio') {
Mark Otto's avatar
dist    
Mark Otto committed
440
              if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
Mark Otto's avatar
dist    
Mark Otto committed
441
442
                triggerChangeEvent = false;
              } else {
Mark Otto's avatar
dist    
Mark Otto committed
443
                var activeElement = rootElement.querySelector(Selector.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
444

Mark Otto's avatar
dist    
Mark Otto committed
445
446
447
                if (activeElement) {
                  $$$1(activeElement).removeClass(ClassName.ACTIVE);
                }
Mark Otto's avatar
dist  
Mark Otto committed
448
449
450
              }
            }

Mark Otto's avatar
dist    
Mark Otto committed
451
452
453
454
455
            if (triggerChangeEvent) {
              if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
                return;
              }

Mark Otto's avatar
dist    
Mark Otto committed
456
              input.checked = !this._element.classList.contains(ClassName.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
457
              $$$1(input).trigger('change');
Mark Otto's avatar
dist  
Mark Otto committed
458
            }
Mark Otto's avatar
dist    
Mark Otto committed
459

Mark Otto's avatar
dist    
Mark Otto committed
460
461
            input.focus();
            addAriaPressed = false;
Mark Otto's avatar
dist  
Mark Otto committed
462
          }
Mark Otto's avatar
dist    
Mark Otto committed
463
        }
Mark Otto's avatar
dist  
Mark Otto committed
464

Mark Otto's avatar
dist    
Mark Otto committed
465
        if (addAriaPressed) {
Mark Otto's avatar
dist    
Mark Otto committed
466
          this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
Mark Otto's avatar
dist  
Mark Otto committed
467
468
        }

Mark Otto's avatar
dist    
Mark Otto committed
469
470
471
472
        if (triggerChangeEvent) {
          $$$1(this._element).toggleClass(ClassName.ACTIVE);
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
473

Mark Otto's avatar
dist    
Mark Otto committed
474
475
476
477
      _proto.dispose = function dispose() {
        $$$1.removeData(this._element, DATA_KEY);
        this._element = null;
      }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
478
479


Mark Otto's avatar
dist    
Mark Otto committed
480
481
482
      Button._jQueryInterface = function _jQueryInterface(config) {
        return this.each(function () {
          var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
483

Mark Otto's avatar
dist    
Mark Otto committed
484
485
486
487
          if (!data) {
            data = new Button(this);
            $$$1(this).data(DATA_KEY, data);
          }
Mark Otto's avatar
dist  
Mark Otto committed
488

Mark Otto's avatar
dist    
Mark Otto committed
489
490
491
492
493
          if (config === 'toggle') {
            data[config]();
          }
        });
      };
Mark Otto's avatar
dist  
Mark Otto committed
494

Mark Otto's avatar
dist    
Mark Otto committed
495
496
497
498
      _createClass(Button, null, [{
        key: "VERSION",
        get: function get() {
          return VERSION;
Mark Otto's avatar
dist  
Mark Otto committed
499
        }
Mark Otto's avatar
dist    
Mark Otto committed
500
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
501

Mark Otto's avatar
dist    
Mark Otto committed
502
503
504
505
506
507
508
      return Button;
    }();
    /**
     * ------------------------------------------------------------------------
     * Data Api implementation
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
509

Mark Otto's avatar
dist  
Mark Otto committed
510

Mark Otto's avatar
dist    
Mark Otto committed
511
512
513
    $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
      event.preventDefault();
      var button = event.target;
Mark Otto's avatar
dist  
Mark Otto committed
514

Mark Otto's avatar
dist    
Mark Otto committed
515
516
517
      if (!$$$1(button).hasClass(ClassName.BUTTON)) {
        button = $$$1(button).closest(Selector.BUTTON);
      }
Mark Otto's avatar
dist  
Mark Otto committed
518

Mark Otto's avatar
dist    
Mark Otto committed
519
520
521
522
523
524
525
526
527
528
      Button._jQueryInterface.call($$$1(button), 'toggle');
    }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
      var button = $$$1(event.target).closest(Selector.BUTTON)[0];
      $$$1(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
    });
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
529

Mark Otto's avatar
dist    
Mark Otto committed
530
531
    $$$1.fn[NAME] = Button._jQueryInterface;
    $$$1.fn[NAME].Constructor = Button;
Mark Otto's avatar
dist  
Mark Otto committed
532

Mark Otto's avatar
dist    
Mark Otto committed
533
534
535
536
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Button._jQueryInterface;
    };
Mark Otto's avatar
dist  
Mark Otto committed
537

Mark Otto's avatar
dist    
Mark Otto committed
538
539
    return Button;
  }($);
Mark Otto's avatar
dist  
Mark Otto committed
540
541

  /**
Mark Otto's avatar
dist    
Mark Otto committed
542
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
543
   * Bootstrap (v4.1.3): carousel.js
Mark Otto's avatar
dist    
Mark Otto committed
544
545
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
546
   */
Mark Otto's avatar
dist    
Mark Otto committed
547
548

  var Carousel = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
549
550
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
551
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
552
553
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
554
    var NAME = 'carousel';
Mark Otto's avatar
Mark Otto committed
555
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
    var DATA_KEY = 'bs.carousel';
    var EVENT_KEY = "." + DATA_KEY;
    var DATA_API_KEY = '.data-api';
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key

    var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key

    var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch

    var Default = {
      interval: 5000,
      keyboard: true,
      slide: false,
      pause: 'hover',
      wrap: true
Mark Otto's avatar
dist  
Mark Otto committed
572
    };
Mark Otto's avatar
dist    
Mark Otto committed
573
574
575
576
577
578
    var DefaultType = {
      interval: '(number|boolean)',
      keyboard: 'boolean',
      slide: '(boolean|string)',
      pause: '(string|boolean)',
      wrap: 'boolean'
Mark Otto's avatar
dist  
Mark Otto committed
579
    };
Mark Otto's avatar
dist    
Mark Otto committed
580
581
582
583
584
    var Direction = {
      NEXT: 'next',
      PREV: 'prev',
      LEFT: 'left',
      RIGHT: 'right'
Mark Otto's avatar
dist  
Mark Otto committed
585
    };
Mark Otto's avatar
dist    
Mark Otto committed
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
    var Event = {
      SLIDE: "slide" + EVENT_KEY,
      SLID: "slid" + EVENT_KEY,
      KEYDOWN: "keydown" + EVENT_KEY,
      MOUSEENTER: "mouseenter" + EVENT_KEY,
      MOUSELEAVE: "mouseleave" + EVENT_KEY,
      TOUCHEND: "touchend" + EVENT_KEY,
      LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
      CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
    };
    var ClassName = {
      CAROUSEL: 'carousel',
      ACTIVE: 'active',
      SLIDE: 'slide',
      RIGHT: 'carousel-item-right',
      LEFT: 'carousel-item-left',
      NEXT: 'carousel-item-next',
      PREV: 'carousel-item-prev',
      ITEM: 'carousel-item'
    };
    var Selector = {
      ACTIVE: '.active',
      ACTIVE_ITEM: '.active.carousel-item',
      ITEM: '.carousel-item',
      NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
      INDICATORS: '.carousel-indicators',
      DATA_SLIDE: '[data-slide], [data-slide-to]',
      DATA_RIDE: '[data-ride="carousel"]'
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
619
620
621

    };

Mark Otto's avatar
dist    
Mark Otto committed
622
623
624
625
626
627
628
    var Carousel =
    /*#__PURE__*/
    function () {
      function Carousel(element, config) {
        this._items = null;
        this._interval = null;
        this._activeElement = null;
Mark Otto's avatar
dist  
Mark Otto committed
629
        this._isPaused = false;
Mark Otto's avatar
dist    
Mark Otto committed
630
631
632
633
        this._isSliding = false;
        this.touchTimeout = null;
        this._config = this._getConfig(config);
        this._element = $$$1(element)[0];
Mark Otto's avatar
dist    
Mark Otto committed
634
        this._indicatorsElement = this._element.querySelector(Selector.INDICATORS);
Mark Otto's avatar
dist  
Mark Otto committed
635

Mark Otto's avatar
dist    
Mark Otto committed
636
637
        this._addEventListeners();
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
638
639


Mark Otto's avatar
dist    
Mark Otto committed
640
      var _proto = Carousel.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
641

Mark Otto's avatar
dist    
Mark Otto committed
642
643
644
645
646
647
      // Public
      _proto.next = function next() {
        if (!this._isSliding) {
          this._slide(Direction.NEXT);
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
648

Mark Otto's avatar
dist    
Mark Otto committed
649
650
651
652
653
654
655
      _proto.nextWhenVisible = function nextWhenVisible() {
        // Don't call next when the page isn't visible
        // or the carousel or its parent isn't visible
        if (!document.hidden && $$$1(this._element).is(':visible') && $$$1(this._element).css('visibility') !== 'hidden') {
          this.next();
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
656

Mark Otto's avatar
dist    
Mark Otto committed
657
658
659
660
661
      _proto.prev = function prev() {
        if (!this._isSliding) {
          this._slide(Direction.PREV);
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
662

Mark Otto's avatar
dist    
Mark Otto committed
663
664
665
666
      _proto.pause = function pause(event) {
        if (!event) {
          this._isPaused = true;
        }
Mark Otto's avatar
dist  
Mark Otto committed
667

Mark Otto's avatar
dist    
Mark Otto committed
668
        if (this._element.querySelector(Selector.NEXT_PREV)) {
Mark Otto's avatar
dist    
Mark Otto committed
669
670
671
          Util.triggerTransitionEnd(this._element);
          this.cycle(true);
        }
Mark Otto's avatar
dist  
Mark Otto committed
672

Mark Otto's avatar
dist    
Mark Otto committed
673
674
675
        clearInterval(this._interval);
        this._interval = null;
      };
Mark Otto's avatar
dist  
Mark Otto committed
676

Mark Otto's avatar
dist    
Mark Otto committed
677
678
679
680
      _proto.cycle = function cycle(event) {
        if (!event) {
          this._isPaused = false;
        }
Mark Otto's avatar
dist  
Mark Otto committed
681

Mark Otto's avatar
dist    
Mark Otto committed
682
683
684
685
        if (this._interval) {
          clearInterval(this._interval);
          this._interval = null;
        }
Mark Otto's avatar
dist  
Mark Otto committed
686

Mark Otto's avatar
dist    
Mark Otto committed
687
688
689
690
        if (this._config.interval && !this._isPaused) {
          this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
691

Mark Otto's avatar
dist    
Mark Otto committed
692
693
      _proto.to = function to(index) {
        var _this = this;
Mark Otto's avatar
dist    
Mark Otto committed
694

Mark Otto's avatar
dist    
Mark Otto committed
695
        this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
Mark Otto's avatar
dist    
Mark Otto committed
696

Mark Otto's avatar
dist    
Mark Otto committed
697
        var activeIndex = this._getItemIndex(this._activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
698

Mark Otto's avatar
dist    
Mark Otto committed
699
700
701
        if (index > this._items.length - 1 || index < 0) {
          return;
        }
Mark Otto's avatar
dist    
Mark Otto committed
702

Mark Otto's avatar
dist    
Mark Otto committed
703
704
705
706
707
708
        if (this._isSliding) {
          $$$1(this._element).one(Event.SLID, function () {
            return _this.to(index);
          });
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
709

Mark Otto's avatar
dist    
Mark Otto committed
710
711
712
713
714
        if (activeIndex === index) {
          this.pause();
          this.cycle();
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
715

Mark Otto's avatar
dist    
Mark Otto committed
716
        var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
Mark Otto's avatar
dist    
Mark Otto committed
717

Mark Otto's avatar
dist    
Mark Otto committed
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
        this._slide(direction, this._items[index]);
      };

      _proto.dispose = function dispose() {
        $$$1(this._element).off(EVENT_KEY);
        $$$1.removeData(this._element, DATA_KEY);
        this._items = null;
        this._config = null;
        this._element = null;
        this._interval = null;
        this._isPaused = null;
        this._isSliding = null;
        this._activeElement = null;
        this._indicatorsElement = null;
      }; // Private


      _proto._getConfig = function _getConfig(config) {
        config = _objectSpread({}, Default, config);
        Util.typeCheckConfig(NAME, config, DefaultType);
        return config;
      };

      _proto._addEventListeners = function _addEventListeners() {
        var _this2 = this;
Mark Otto's avatar
dist    
Mark Otto committed
743

Mark Otto's avatar
dist    
Mark Otto committed
744
745
746
        if (this._config.keyboard) {
          $$$1(this._element).on(Event.KEYDOWN, function (event) {
            return _this2._keydown(event);
Mark Otto's avatar
dist  
Mark Otto committed
747
748
749
          });
        }

Mark Otto's avatar
dist    
Mark Otto committed
750
751
752
753
754
755
        if (this._config.pause === 'hover') {
          $$$1(this._element).on(Event.MOUSEENTER, function (event) {
            return _this2.pause(event);
          }).on(Event.MOUSELEAVE, function (event) {
            return _this2.cycle(event);
          });
Mark Otto's avatar
dist  
Mark Otto committed
756

Mark Otto's avatar
dist    
Mark Otto committed
757
758
759
760
761
762
763
764
765
766
767
768
769
770
          if ('ontouchstart' in document.documentElement) {
            // If it's a touch-enabled device, mouseenter/leave are fired as
            // part of the mouse compatibility events on first tap - the carousel
            // would stop cycling until user tapped out of it;
            // here, we listen for touchend, explicitly pause the carousel
            // (as if it's the second time we tap on it, mouseenter compat event
            // is NOT fired) and after a timeout (to allow for mouse compatibility
            // events to fire) we explicitly restart cycling
            $$$1(this._element).on(Event.TOUCHEND, function () {
              _this2.pause();

              if (_this2.touchTimeout) {
                clearTimeout(_this2.touchTimeout);
              }
Mark Otto's avatar
dist    
Mark Otto committed
771

Mark Otto's avatar
dist    
Mark Otto committed
772
773
774
775
776
777
778
              _this2.touchTimeout = setTimeout(function (event) {
                return _this2.cycle(event);
              }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);
            });
          }
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
779

Mark Otto's avatar
dist    
Mark Otto committed
780
781
782
783
      _proto._keydown = function _keydown(event) {
        if (/input|textarea/i.test(event.target.tagName)) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
784

Mark Otto's avatar
dist    
Mark Otto committed
785
786
787
788
789
790
791
792
793
794
795
796
797
798
        switch (event.which) {
          case ARROW_LEFT_KEYCODE:
            event.preventDefault();
            this.prev();
            break;

          case ARROW_RIGHT_KEYCODE:
            event.preventDefault();
            this.next();
            break;

          default:
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
799

Mark Otto's avatar
dist    
Mark Otto committed
800
      _proto._getItemIndex = function _getItemIndex(element) {
Mark Otto's avatar
dist    
Mark Otto committed
801
        this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : [];
Mark Otto's avatar
dist    
Mark Otto committed
802
803
        return this._items.indexOf(element);
      };
Mark Otto's avatar
dist    
Mark Otto committed
804

Mark Otto's avatar
dist    
Mark Otto committed
805
806
807
      _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
        var isNextDirection = direction === Direction.NEXT;
        var isPrevDirection = direction === Direction.PREV;
Mark Otto's avatar
dist    
Mark Otto committed
808

Mark Otto's avatar
dist    
Mark Otto committed
809
        var activeIndex = this._getItemIndex(activeElement);
Mark Otto's avatar
dist  
Mark Otto committed
810

Mark Otto's avatar
dist    
Mark Otto committed
811
812
        var lastItemIndex = this._items.length - 1;
        var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
Mark Otto's avatar
dist  
Mark Otto committed
813

Mark Otto's avatar
dist    
Mark Otto committed
814
815
816
        if (isGoingToWrap && !this._config.wrap) {
          return activeElement;
        }
Mark Otto's avatar
dist  
Mark Otto committed
817

Mark Otto's avatar
dist    
Mark Otto committed
818
819
820
821
        var delta = direction === Direction.PREV ? -1 : 1;
        var itemIndex = (activeIndex + delta) % this._items.length;
        return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
      };
Mark Otto's avatar
dist    
Mark Otto committed
822

Mark Otto's avatar
dist    
Mark Otto committed
823
824
      _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
        var targetIndex = this._getItemIndex(relatedTarget);
Mark Otto's avatar
dist    
Mark Otto committed
825

Mark Otto's avatar
dist    
Mark Otto committed
826
        var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM));
Mark Otto's avatar
dist    
Mark Otto committed
827
828
829
830
831
832
833
834
835
836

        var slideEvent = $$$1.Event(Event.SLIDE, {
          relatedTarget: relatedTarget,
          direction: eventDirectionName,
          from: fromIndex,
          to: targetIndex
        });
        $$$1(this._element).trigger(slideEvent);
        return slideEvent;
      };
Mark Otto's avatar
dist  
Mark Otto committed
837

Mark Otto's avatar
dist    
Mark Otto committed
838
839
      _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
        if (this._indicatorsElement) {
Mark Otto's avatar
dist    
Mark Otto committed
840
841
          var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));
          $$$1(indicators).removeClass(ClassName.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
842

Mark Otto's avatar
dist    
Mark Otto committed
843
          var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
Mark Otto's avatar
dist  
Mark Otto committed
844

Mark Otto's avatar
dist    
Mark Otto committed
845
846
847
          if (nextIndicator) {
            $$$1(nextIndicator).addClass(ClassName.ACTIVE);
          }
Mark Otto's avatar
dist  
Mark Otto committed
848
        }
Mark Otto's avatar
dist    
Mark Otto committed
849
      };
Mark Otto's avatar
dist  
Mark Otto committed
850

Mark Otto's avatar
dist    
Mark Otto committed
851
852
      _proto._slide = function _slide(direction, element) {
        var _this3 = this;
Mark Otto's avatar
dist  
Mark Otto committed
853

Mark Otto's avatar
dist    
Mark Otto committed
854
        var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
Mark Otto's avatar
dist    
Mark Otto committed
855

Mark Otto's avatar
dist    
Mark Otto committed
856
        var activeElementIndex = this._getItemIndex(activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
857

Mark Otto's avatar
dist    
Mark Otto committed
858
        var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
859

Mark Otto's avatar
dist    
Mark Otto committed
860
        var nextElementIndex = this._getItemIndex(nextElement);
Mark Otto's avatar
dist  
Mark Otto committed
861

Mark Otto's avatar
dist    
Mark Otto committed
862
863
864
865
        var isCycling = Boolean(this._interval);
        var directionalClassName;
        var orderClassName;
        var eventDirectionName;
Mark Otto's avatar
dist  
Mark Otto committed
866

Mark Otto's avatar
dist    
Mark Otto committed
867
868
869
870
871
872
873
874
875
        if (direction === Direction.NEXT) {
          directionalClassName = ClassName.LEFT;
          orderClassName = ClassName.NEXT;
          eventDirectionName = Direction.LEFT;
        } else {
          directionalClassName = ClassName.RIGHT;
          orderClassName = ClassName.PREV;
          eventDirectionName = Direction.RIGHT;
        }
Mark Otto's avatar
dist  
Mark Otto committed
876

Mark Otto's avatar
dist    
Mark Otto committed
877
878
879
880
        if (nextElement && $$$1(nextElement).hasClass(ClassName.ACTIVE)) {
          this._isSliding = false;
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
881

Mark Otto's avatar
dist    
Mark Otto committed
882
        var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
Mark Otto's avatar
dist    
Mark Otto committed
883

Mark Otto's avatar
dist    
Mark Otto committed
884
885
886
        if (slideEvent.isDefaultPrevented()) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
887

Mark Otto's avatar
dist    
Mark Otto committed
888
889
890
891
        if (!activeElement || !nextElement) {
          // Some weirdness is happening, so we bail
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
892

Mark Otto's avatar
dist    
Mark Otto committed
893
        this._isSliding = true;
Mark Otto's avatar
dist  
Mark Otto committed
894

Mark Otto's avatar
dist    
Mark Otto committed
895
896
897
        if (isCycling) {
          this.pause();
        }
Mark Otto's avatar
dist  
Mark Otto committed
898

Mark Otto's avatar
dist    
Mark Otto committed
899
        this._setActiveIndicatorElement(nextElement);
Mark Otto's avatar
dist  
Mark Otto committed
900

Mark Otto's avatar
dist    
Mark Otto committed
901
902
903
904
905
906
        var slidEvent = $$$1.Event(Event.SLID, {
          relatedTarget: nextElement,
          direction: eventDirectionName,
          from: activeElementIndex,
          to: nextElementIndex
        });
Mark Otto's avatar
dist  
Mark Otto committed
907

Mark Otto's avatar
dist    
Mark Otto committed
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
        if ($$$1(this._element).hasClass(ClassName.SLIDE)) {
          $$$1(nextElement).addClass(orderClassName);
          Util.reflow(nextElement);
          $$$1(activeElement).addClass(directionalClassName);
          $$$1(nextElement).addClass(directionalClassName);
          var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
          $$$1(activeElement).one(Util.TRANSITION_END, function () {
            $$$1(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
            $$$1(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
            _this3._isSliding = false;
            setTimeout(function () {
              return $$$1(_this3._element).trigger(slidEvent);
            }, 0);
          }).emulateTransitionEnd(transitionDuration);
        } else {
          $$$1(activeElement).removeClass(ClassName.ACTIVE);
          $$$1(nextElement).addClass(ClassName.ACTIVE);
          this._isSliding = false;
          $$$1(this._element).trigger(slidEvent);
        }
Mark Otto's avatar
dist  
Mark Otto committed
928

Mark Otto's avatar
dist    
Mark Otto committed
929
930
931
932
        if (isCycling) {
          this.cycle();
        }
      }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
933
934


Mark Otto's avatar
dist    
Mark Otto committed
935
936
937
      Carousel._jQueryInterface = function _jQueryInterface(config) {
        return this.each(function () {
          var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
938

Mark Otto's avatar
dist    
Mark Otto committed
939
          var _config = _objectSpread({}, Default, $$$1(this).data());
Mark Otto's avatar
dist  
Mark Otto committed
940

Mark Otto's avatar
dist    
Mark Otto committed
941
942
943
          if (typeof config === 'object') {
            _config = _objectSpread({}, _config, config);
          }
Mark Otto's avatar
dist  
Mark Otto committed
944

Mark Otto's avatar
dist    
Mark Otto committed
945
          var action = typeof config === 'string' ? config : _config.slide;
Mark Otto's avatar
dist  
Mark Otto committed
946

Mark Otto's avatar
dist    
Mark Otto committed
947
948
949
950
951
952
953
954
955
956
957
          if (!data) {
            data = new Carousel(this, _config);
            $$$1(this).data(DATA_KEY, data);
          }

          if (typeof config === 'number') {
            data.to(config);
          } else if (typeof action === 'string') {
            if (typeof data[action] === 'undefined') {
              throw new TypeError("No method named \"" + action + "\"");
            }
Mark Otto's avatar
dist  
Mark Otto committed
958

Mark Otto's avatar
dist    
Mark Otto committed
959
960
961
962
            data[action]();
          } else if (_config.interval) {
            data.pause();
            data.cycle();
Mark Otto's avatar
dist  
Mark Otto committed
963
          }
Mark Otto's avatar
dist    
Mark Otto committed
964
965
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
966

Mark Otto's avatar
dist    
Mark Otto committed
967
968
969
970
971
      Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
        var selector = Util.getSelectorFromElement(this);

        if (!selector) {
          return;
Mark Otto's avatar
dist  
Mark Otto committed
972
973
        }

Mark Otto's avatar
dist    
Mark Otto committed
974
        var target = $$$1(selector)[0];
Mark Otto's avatar
dist  
Mark Otto committed
975

Mark Otto's avatar
dist    
Mark Otto committed
976
977
978
        if (!target || !$$$1(target).hasClass(ClassName.CAROUSEL)) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
979

Mark Otto's avatar
dist    
Mark Otto committed
980
        var config = _objectSpread({}, $$$1(target).data(), $$$1(this).data());
Mark Otto's avatar
dist  
Mark Otto committed
981

Mark Otto's avatar
dist    
Mark Otto committed
982
        var slideIndex = this.getAttribute('data-slide-to');
Mark Otto's avatar
dist  
Mark Otto committed
983

Mark Otto's avatar
dist    
Mark Otto committed
984
985
986
        if (slideIndex) {
          config.interval = false;
        }
Mark Otto's avatar
dist  
Mark Otto committed
987

Mark Otto's avatar
dist    
Mark Otto committed
988
        Carousel._jQueryInterface.call($$$1(target), config);
Mark Otto's avatar
dist  
Mark Otto committed
989

Mark Otto's avatar
dist    
Mark Otto committed
990
991
992
        if (slideIndex) {
          $$$1(target).data(DATA_KEY).to(slideIndex);
        }
Mark Otto's avatar
dist  
Mark Otto committed
993

Mark Otto's avatar
dist    
Mark Otto committed
994
995
        event.preventDefault();
      };
Mark Otto's avatar
dist  
Mark Otto committed
996

Mark Otto's avatar
dist    
Mark Otto committed
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
      _createClass(Carousel, null, [{
        key: "VERSION",
        get: function get() {
          return VERSION;
        }
      }, {
        key: "Default",
        get: function get() {
          return Default;
        }
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
1008

Mark Otto's avatar
dist    
Mark Otto committed
1009
1010
1011
1012
1013
1014
1015
      return Carousel;
    }();
    /**
     * ------------------------------------------------------------------------
     * Data Api implementation
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
1016
1017


Mark Otto's avatar
dist    
Mark Otto committed
1018
1019
    $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
    $$$1(window).on(Event.LOAD_DATA_API, function () {
Mark Otto's avatar
dist    
Mark Otto committed
1020
1021
1022
1023
      var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE));

      for (var i = 0, len = carousels.length; i < len; i++) {
        var $carousel = $$$1(carousels[i]);
Mark Otto's avatar
dist    
Mark Otto committed
1024

Mark Otto's avatar
dist    
Mark Otto committed
1025
        Carousel._jQueryInterface.call($carousel, $carousel.data());
Mark Otto's avatar
dist    
Mark Otto committed
1026
      }
Mark Otto's avatar
dist  
Mark Otto committed
1027
    });
Mark Otto's avatar
dist    
Mark Otto committed
1028
1029
1030
1031
1032
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
1033

Mark Otto's avatar
dist    
Mark Otto committed
1034
1035
    $$$1.fn[NAME] = Carousel._jQueryInterface;
    $$$1.fn[NAME].Constructor = Carousel;
Mark Otto's avatar
dist  
Mark Otto committed
1036

Mark Otto's avatar
dist    
Mark Otto committed
1037
1038
1039
1040
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Carousel._jQueryInterface;
    };
Mark Otto's avatar
dist  
Mark Otto committed
1041

Mark Otto's avatar
dist    
Mark Otto committed
1042
1043
    return Carousel;
  }($);
Mark Otto's avatar
dist  
Mark Otto committed
1044
1045

  /**
Mark Otto's avatar
dist    
Mark Otto committed
1046
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
1047
   * Bootstrap (v4.1.3): collapse.js
Mark Otto's avatar
dist    
Mark Otto committed
1048
1049
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
1050
   */
Mark Otto's avatar
dist    
Mark Otto committed
1051
1052

  var Collapse = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
1053
1054
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
1055
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
1056
1057
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
1058
    var NAME = 'collapse';
Mark Otto's avatar
Mark Otto committed
1059
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
    var DATA_KEY = 'bs.collapse';
    var EVENT_KEY = "." + DATA_KEY;
    var DATA_API_KEY = '.data-api';
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var Default = {
      toggle: true,
      parent: ''
    };
    var DefaultType = {
      toggle: 'boolean',
      parent: '(string|element)'
    };
    var Event = {
      SHOW: "show" + EVENT_KEY,
      SHOWN: "shown" + EVENT_KEY,
      HIDE: "hide" + EVENT_KEY,
      HIDDEN: "hidden" + EVENT_KEY,
      CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
    };
    var ClassName = {
      SHOW: 'show',
      COLLAPSE: 'collapse',
      COLLAPSING: 'collapsing',
      COLLAPSED: 'collapsed'
    };
    var Dimension = {
      WIDTH: 'width',
      HEIGHT: 'height'
    };
    var Selector = {
      ACTIVES: '.show, .collapsing',
      DATA_TOGGLE: '[data-toggle="collapse"]'
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
1097

Mark Otto's avatar
dist    
Mark Otto committed
1098
    };
Mark Otto's avatar
dist  
Mark Otto committed
1099

Mark Otto's avatar
dist    
Mark Otto committed
1100
1101
1102
1103
1104
1105
1106
    var Collapse =
    /*#__PURE__*/
    function () {
      function Collapse(element, config) {
        this._isTransitioning = false;
        this._element = element;
        this._config = this._getConfig(config);
Mark Otto's avatar
dist    
Mark Otto committed
1107
1108
        this._triggerArray = $$$1.makeArray(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
        var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
Mark Otto's avatar
dist    
Mark Otto committed
1109

Mark Otto's avatar
dist    
Mark Otto committed
1110
1111
        for (var i = 0, len = toggleList.length; i < len; i++) {
          var elem = toggleList[i];
Mark Otto's avatar
dist    
Mark Otto committed
1112
          var selector = Util.getSelectorFromElement(elem);
Mark Otto's avatar
dist    
Mark Otto committed
1113
1114
1115
          var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
            return foundElem === element;
          });
Mark Otto's avatar
dist    
Mark Otto committed
1116

Mark Otto's avatar
dist    
Mark Otto committed
1117
          if (selector !== null && filterElement.length > 0) {
Mark Otto's avatar
dist    
Mark Otto committed
1118
            this._selector = selector;
Mark Otto's avatar
dist    
Mark Otto committed
1119

Mark Otto's avatar
dist    
Mark Otto committed
1120
1121
            this._triggerArray.push(elem);
          }
Mark Otto's avatar
dist  
Mark Otto committed
1122
1123
        }

Mark Otto's avatar
dist    
Mark Otto committed
1124
        this._parent = this._config.parent ? this._getParent() : null;
Mark Otto's avatar
dist  
Mark Otto committed
1125

Mark Otto's avatar
dist    
Mark Otto committed
1126
1127
1128
        if (!this._config.parent) {
          this._addAriaAndCollapsedClass(this._element, this._triggerArray);
        }
Mark Otto's avatar
dist  
Mark Otto committed
1129

Mark Otto's avatar
dist    
Mark Otto committed
1130
1131
1132
1133
        if (this._config.toggle) {
          this.toggle();
        }
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
1134
1135


Mark Otto's avatar
dist    
Mark Otto committed
1136
      var _proto = Collapse.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
1137

Mark Otto's avatar
dist    
Mark Otto committed
1138
1139
1140
1141
1142
1143
1144
1145
      // Public
      _proto.toggle = function toggle() {
        if ($$$1(this._element).hasClass(ClassName.SHOW)) {
          this.hide();
        } else {
          this.show();
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
1146

Mark Otto's avatar
dist    
Mark Otto committed
1147
1148
      _proto.show = function show() {
        var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
1149

Mark Otto's avatar
dist    
Mark Otto committed
1150
1151
1152
        if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
1153

Mark Otto's avatar
dist    
Mark Otto committed
1154
1155
        var actives;
        var activesData;
Mark Otto's avatar
dist  
Mark Otto committed
1156

Mark Otto's avatar
dist    
Mark Otto committed
1157
        if (this._parent) {
Mark Otto's avatar
dist    
Mark Otto committed
1158
1159
1160
          actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) {
            return elem.getAttribute('data-parent') === _this._config.parent;
          });
Mark Otto's avatar
dist    
Mark Otto committed
1161

Mark Otto's avatar
dist    
Mark Otto committed
1162
1163
1164
          if (actives.length === 0) {
            actives = null;
          }
Mark Otto's avatar
dist  
Mark Otto committed
1165
1166
        }

Mark Otto's avatar
dist    
Mark Otto committed
1167
1168
        if (actives) {
          activesData = $$$1(actives).not(this._selector).data(DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
1169

Mark Otto's avatar
dist    
Mark Otto committed
1170
1171
1172
          if (activesData && activesData._isTransitioning) {
            return;
          }
Mark Otto's avatar
dist  
Mark Otto committed
1173
1174
        }

Mark Otto's avatar
dist    
Mark Otto committed
1175
1176
        var startEvent = $$$1.Event(Event.SHOW);
        $$$1(this._element).trigger(startEvent);
Mark Otto's avatar
dist    
Mark Otto committed
1177

Mark Otto's avatar
dist    
Mark Otto committed
1178
1179
1180
        if (startEvent.isDefaultPrevented()) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
1181

Mark Otto's avatar
dist    
Mark Otto committed
1182
1183
        if (actives) {
          Collapse._jQueryInterface.call($$$1(actives).not(this._selector), 'hide');
Mark Otto's avatar
dist    
Mark Otto committed
1184

Mark Otto's avatar
dist    
Mark Otto committed
1185
1186
1187
          if (!activesData) {
            $$$1(actives).data(DATA_KEY, null);
          }
Mark Otto's avatar
dist  
Mark Otto committed
1188
1189
        }

Mark Otto's avatar
dist    
Mark Otto committed
1190
        var dimension = this._getDimension();
Mark Otto's avatar
dist  
Mark Otto committed
1191

Mark Otto's avatar
dist    
Mark Otto committed
1192
1193
        $$$1(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
        this._element.style[dimension] = 0;
Mark Otto's avatar
dist  
Mark Otto committed
1194

Mark Otto's avatar
dist    
Mark Otto committed
1195
        if (this._triggerArray.length) {
Mark Otto's avatar
dist    
Mark Otto committed
1196
1197
          $$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
        }
Mark Otto's avatar
dist  
Mark Otto committed
1198

Mark Otto's avatar
dist    
Mark Otto committed
1199
        this.setTransitioning(true);
Mark Otto's avatar
dist  
Mark Otto committed
1200

Mark Otto's avatar
dist    
Mark Otto committed
1201
1202
1203
        var complete = function complete() {
          $$$1(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
          _this._element.style[dimension] = '';
Mark Otto's avatar
dist  
Mark Otto committed
1204

Mark Otto's avatar
dist    
Mark Otto committed
1205
          _this.setTransitioning(false);
Mark Otto's avatar
dist  
Mark Otto committed
1206

Mark Otto's avatar
dist    
Mark Otto committed
1207
1208
          $$$1(_this._element).trigger(Event.SHOWN);
        };
Mark Otto's avatar
dist  
Mark Otto committed
1209

Mark Otto's avatar
dist    
Mark Otto committed
1210
1211
1212
1213
1214
1215
        var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
        var scrollSize = "scroll" + capitalizedDimension;
        var transitionDuration = Util.getTransitionDurationFromElement(this._element);
        $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
        this._element.style[dimension] = this._element[scrollSize] + "px";
      };
Mark Otto's avatar
dist  
Mark Otto committed
1216

Mark Otto's avatar
dist    
Mark Otto committed
1217
1218
      _proto.hide = function hide() {
        var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
1219

Mark Otto's avatar
dist    
Mark Otto committed
1220
1221
1222
        if (this._isTransitioning || !$$$1(this._element).hasClass(ClassName.SHOW)) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
1223

Mark Otto's avatar
dist    
Mark Otto committed
1224
1225
        var startEvent = $$$1.Event(Event.HIDE);
        $$$1(this._element).trigger(startEvent);
Mark Otto's avatar
dist    
Mark Otto committed
1226

Mark Otto's avatar
dist    
Mark Otto committed
1227
1228
1229
        if (startEvent.isDefaultPrevented()) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
1230

Mark Otto's avatar
dist    
Mark Otto committed
1231
        var dimension = this._getDimension();
Mark Otto's avatar
dist  
Mark Otto committed
1232

Mark Otto's avatar
dist    
Mark Otto committed
1233
1234
1235
        this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
        Util.reflow(this._element);
        $$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
Mark Otto's avatar
dist    
Mark Otto committed
1236
        var triggerArrayLength = this._triggerArray.length;
Mark Otto's avatar
dist  
Mark Otto committed
1237

Mark Otto's avatar
dist    
Mark Otto committed
1238
1239
        if (triggerArrayLength > 0) {
          for (var i = 0; i < triggerArrayLength; i++) {
Mark Otto's avatar
dist    
Mark Otto committed
1240
1241
            var trigger = this._triggerArray[i];
            var selector = Util.getSelectorFromElement(trigger);
Mark Otto's avatar
dist    
Mark Otto committed
1242

Mark Otto's avatar
dist    
Mark Otto committed
1243
            if (selector !== null) {
Mark Otto's avatar
dist    
Mark Otto committed
1244
              var $elem = $$$1([].slice.call(document.querySelectorAll(selector)));
Mark Otto's avatar
dist    
Mark Otto committed
1245

Mark Otto's avatar
dist    
Mark Otto committed
1246
1247
1248
              if (!$elem.hasClass(ClassName.SHOW)) {
                $$$1(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
              }
Mark Otto's avatar
dist  
Mark Otto committed
1249
1250
1251
1252
            }
          }
        }

Mark Otto's avatar
dist    
Mark Otto committed
1253
        this.setTransitioning(true);
Mark Otto's avatar
dist    
Mark Otto committed
1254

Mark Otto's avatar
dist    
Mark Otto committed
1255
1256
        var complete = function complete() {
          _this2.setTransitioning(false);
Mark Otto's avatar
dist  
Mark Otto committed
1257

Mark Otto's avatar
dist    
Mark Otto committed
1258
1259
          $$$1(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
        };
Mark Otto's avatar
dist  
Mark Otto committed
1260

Mark Otto's avatar
dist    
Mark Otto committed
1261
1262
1263
1264
        this._element.style[dimension] = '';
        var transitionDuration = Util.getTransitionDurationFromElement(this._element);
        $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
      };
Mark Otto's avatar
dist  
Mark Otto committed
1265

Mark Otto's avatar
dist    
Mark Otto committed
1266
1267
1268
      _proto.setTransitioning = function setTransitioning(isTransitioning) {
        this._isTransitioning = isTransitioning;
      };
Mark Otto's avatar
dist  
Mark Otto committed
1269

Mark Otto's avatar
dist    
Mark Otto committed
1270
1271
1272
1273
1274
1275
1276
1277
      _proto.dispose = function dispose() {
        $$$1.removeData(this._element, DATA_KEY);
        this._config = null;
        this._parent = null;
        this._element = null;
        this._triggerArray = null;
        this._isTransitioning = null;
      }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
1278
1279


Mark Otto's avatar
dist    
Mark Otto committed
1280
1281
1282
      _proto._getConfig = function _getConfig(config) {
        config = _objectSpread({}, Default, config);
        config.toggle = Boolean(config.toggle); // Coerce string values
Mark Otto's avatar
dist    
Mark Otto committed
1283

Mark Otto's avatar
dist    
Mark Otto committed
1284
1285
1286
        Util.typeCheckConfig(NAME, config, DefaultType);
        return config;
      };
Mark Otto's avatar
dist  
Mark Otto committed
1287

Mark Otto's avatar
dist    
Mark Otto committed
1288
1289
1290
1291
      _proto._getDimension = function _getDimension() {
        var hasWidth = $$$1(this._element).hasClass(Dimension.WIDTH);
        return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
      };
Mark Otto's avatar
dist  
Mark Otto committed
1292

Mark Otto's avatar
dist    
Mark Otto committed
1293
1294
      _proto._getParent = function _getParent() {
        var _this3 = this;
Mark Otto's avatar
dist  
Mark Otto committed
1295

Mark Otto's avatar
dist    
Mark Otto committed
1296
        var parent = null;
Mark Otto's avatar
dist  
Mark Otto committed
1297

Mark Otto's avatar
dist    
Mark Otto committed
1298
1299
        if (Util.isElement(this._config.parent)) {
          parent = this._config.parent; // It's a jQuery object
Mark Otto's avatar
dist    
Mark Otto committed
1300

Mark Otto's avatar
dist    
Mark Otto committed
1301
1302
1303
1304
          if (typeof this._config.parent.jquery !== 'undefined') {
            parent = this._config.parent[0];
          }
        } else {
Mark Otto's avatar
dist    
Mark Otto committed
1305
          parent = document.querySelector(this._config.parent);
Mark Otto's avatar
dist    
Mark Otto committed
1306
1307
        }

Mark Otto's avatar
dist    
Mark Otto committed
1308
        var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
Mark Otto's avatar
dist    
Mark Otto committed
1309
1310
        var children = [].slice.call(parent.querySelectorAll(selector));
        $$$1(children).each(function (i, element) {
Mark Otto's avatar
dist    
Mark Otto committed
1311
1312
1313
1314
          _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
        });
        return parent;
      };
Mark Otto's avatar
dist  
Mark Otto committed
1315

Mark Otto's avatar
dist    
Mark Otto committed
1316
1317
1318
      _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
        if (element) {
          var isOpen = $$$1(element).hasClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
1319

Mark Otto's avatar
dist    
Mark Otto committed
1320
          if (triggerArray.length) {
Mark Otto's avatar
dist    
Mark Otto committed
1321
1322
            $$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
          }
Mark Otto's avatar
dist  
Mark Otto committed
1323
        }
Mark Otto's avatar
dist    
Mark Otto committed
1324
      }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
1325
1326


Mark Otto's avatar
dist    
Mark Otto committed
1327
1328
      Collapse._getTargetFromElement = function _getTargetFromElement(element) {
        var selector = Util.getSelectorFromElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
1329
        return selector ? document.querySelector(selector) : null;
Mark Otto's avatar
dist    
Mark Otto committed
1330
      };
Mark Otto's avatar
dist  
Mark Otto committed
1331

Mark Otto's avatar
dist    
Mark Otto committed
1332
1333
1334
1335
      Collapse._jQueryInterface = function _jQueryInterface(config) {
        return this.each(function () {
          var $this = $$$1(this);
          var data = $this.data(DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
1336

Mark Otto's avatar
dist    
Mark Otto committed
1337
          var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
Mark Otto's avatar
dist  
Mark Otto committed
1338

Mark Otto's avatar
dist    
Mark Otto committed
1339
1340
1341
          if (!data && _config.toggle && /show|hide/.test(config)) {
            _config.toggle = false;
          }
Mark Otto's avatar
dist  
Mark Otto committed
1342

Mark Otto's avatar
dist    
Mark Otto committed
1343
1344
1345
1346
1347
1348
1349
1350
1351
          if (!data) {
            data = new Collapse(this, _config);
            $this.data(DATA_KEY, data);
          }

          if (typeof config === 'string') {
            if (typeof data[config] === 'undefined') {
              throw new TypeError("No method named \"" + config + "\"");
            }
Mark Otto's avatar
dist  
Mark Otto committed
1352

Mark Otto's avatar
dist    
Mark Otto committed
1353
            data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
1354
          }
Mark Otto's avatar
dist    
Mark Otto committed
1355
1356
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
1357

Mark Otto's avatar
dist    
Mark Otto committed
1358
1359
1360
1361
      _createClass(Collapse, null, [{
        key: "VERSION",
        get: function get() {
          return VERSION;
Mark Otto's avatar
dist  
Mark Otto committed
1362
        }
Mark Otto's avatar
dist    
Mark Otto committed
1363
1364
1365
1366
1367
1368
      }, {
        key: "Default",
        get: function get() {
          return Default;
        }
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
1369

Mark Otto's avatar
dist    
Mark Otto committed
1370
1371
1372
1373
1374
1375
1376
      return Collapse;
    }();
    /**
     * ------------------------------------------------------------------------
     * Data Api implementation
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
1377

Mark Otto's avatar
dist    
Mark Otto committed
1378

Mark Otto's avatar
dist    
Mark Otto committed
1379
1380
1381
1382
1383
    $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
      // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
      if (event.currentTarget.tagName === 'A') {
        event.preventDefault();
      }
Mark Otto's avatar
dist  
Mark Otto committed
1384

Mark Otto's avatar
dist    
Mark Otto committed
1385
1386
      var $trigger = $$$1(this);
      var selector = Util.getSelectorFromElement(this);
Mark Otto's avatar
dist    
Mark Otto committed
1387
1388
      var selectors = [].slice.call(document.querySelectorAll(selector));
      $$$1(selectors).each(function () {
Mark Otto's avatar
dist    
Mark Otto committed
1389
1390
1391
        var $target = $$$1(this);
        var data = $target.data(DATA_KEY);
        var config = data ? 'toggle' : $trigger.data();
Mark Otto's avatar
dist    
Mark Otto committed
1392

Mark Otto's avatar
dist    
Mark Otto committed
1393
1394
        Collapse._jQueryInterface.call($target, config);
      });
Mark Otto's avatar
dist  
Mark Otto committed
1395
    });
Mark Otto's avatar
dist    
Mark Otto committed
1396
1397
1398
1399
1400
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
1401

Mark Otto's avatar
dist    
Mark Otto committed
1402
1403
    $$$1.fn[NAME] = Collapse._jQueryInterface;
    $$$1.fn[NAME].Constructor = Collapse;
Mark Otto's avatar
dist    
Mark Otto committed
1404

Mark Otto's avatar
dist    
Mark Otto committed
1405
1406
1407
1408
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Collapse._jQueryInterface;
    };
Mark Otto's avatar
dist  
Mark Otto committed
1409

Mark Otto's avatar
dist    
Mark Otto committed
1410
1411
    return Collapse;
  }($);
Mark Otto's avatar
dist  
Mark Otto committed
1412

Mark Otto's avatar
dist    
Mark Otto committed
1413
1414
  /**!
   * @fileOverview Kickass library to create and place poppers near their reference elements.
Mark Otto's avatar
dist    
Mark Otto committed
1415
   * @version 1.14.3
Mark Otto's avatar
dist    
Mark Otto committed
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
   * @license
   * Copyright (c) 2016 Federico Zivolo and contributors
   *
   * Permission is hereby granted, free of charge, to any person obtaining a copy
   * of this software and associated documentation files (the "Software"), to deal
   * in the Software without restriction, including without limitation the rights
   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   * copies of the Software, and to permit persons to whom the Software is
   * furnished to do so, subject to the following conditions:
   *
   * The above copyright notice and this permission notice shall be included in all
   * copies or substantial portions of the Software.
   *
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   * SOFTWARE.
   */
  var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
Mark Otto's avatar
dist    
Mark Otto committed
1438

Mark Otto's avatar
dist    
Mark Otto committed
1439
1440
1441
1442
1443
1444
  var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  var timeoutDuration = 0;
  for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
    if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
      timeoutDuration = 1;
      break;
Mark Otto's avatar
dist  
Mark Otto committed
1445
    }
Mark Otto's avatar
dist    
Mark Otto committed
1446
  }
Mark Otto's avatar
dist  
Mark Otto committed
1447

Mark Otto's avatar
dist    
Mark Otto committed
1448
1449
1450
1451
1452
1453
1454
1455
1456
  function microtaskDebounce(fn) {
    var called = false;
    return function () {
      if (called) {
        return;
      }
      called = true;
      window.Promise.resolve().then(function () {
        called = false;
Mark Otto's avatar
dist  
Mark Otto committed
1457
        fn();
Mark Otto's avatar
dist    
Mark Otto committed
1458
1459
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
1460
1461
  }

Mark Otto's avatar
dist    
Mark Otto committed
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
  function taskDebounce(fn) {
    var scheduled = false;
    return function () {
      if (!scheduled) {
        scheduled = true;
        setTimeout(function () {
          scheduled = false;
          fn();
        }, timeoutDuration);
      }
    };
Mark Otto's avatar
dist    
Mark Otto committed
1473
1474
  }

Mark Otto's avatar
dist    
Mark Otto committed
1475
  var supportsMicroTasks = isBrowser && window.Promise;
Mark Otto's avatar
dist  
Mark Otto committed
1476

Mark Otto's avatar
dist    
Mark Otto committed
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
  /**
  * Create a debounced version of a method, that's asynchronously deferred
  * but called in the minimum time possible.
  *
  * @method
  * @memberof Popper.Utils
  * @argument {Function} fn
  * @returns {Function}
  */
  var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
Mark Otto's avatar
dist  
Mark Otto committed
1487

Mark Otto's avatar
dist    
Mark Otto committed
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
  /**
   * Check if the given variable is a function
   * @method
   * @memberof Popper.Utils
   * @argument {Any} functionToCheck - variable to check
   * @returns {Boolean} answer to: is a function?
   */
  function isFunction(functionToCheck) {
    var getType = {};
    return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
Mark Otto's avatar
dist  
Mark Otto committed
1498
1499
  }

Mark Otto's avatar
dist    
Mark Otto committed
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
  /**
   * Get CSS computed property of the given element
   * @method
   * @memberof Popper.Utils
   * @argument {Eement} element
   * @argument {String} property
   */
  function getStyleComputedProperty(element, property) {
    if (element.nodeType !== 1) {
      return [];
Mark Otto's avatar
dist    
Mark Otto committed
1510
    }
Mark Otto's avatar
dist    
Mark Otto committed
1511
1512
1513
    // NOTE: 1 DOM access here
    var css = getComputedStyle(element, null);
    return property ? css[property] : css;
Mark Otto's avatar
dist  
Mark Otto committed
1514
1515
  }

Mark Otto's avatar
dist    
Mark Otto committed
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
  /**
   * Returns the parentNode or the host of the element
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Element} parent
   */
  function getParentNode(element) {
    if (element.nodeName === 'HTML') {
      return element;
    }
    return element.parentNode || element.host;
Mark Otto's avatar
dist  
Mark Otto committed
1528
1529
  }

Mark Otto's avatar
dist    
Mark Otto committed
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
  /**
   * Returns the scrolling parent of the given element
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Element} scroll parent
   */
  function getScrollParent(element) {
    // Return body, `getScroll` will take care to get the correct `scrollTop` from it
    if (!element) {
      return document.body;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1542

Mark Otto's avatar
dist    
Mark Otto committed
1543
1544
1545
1546
1547
1548
1549
    switch (element.nodeName) {
      case 'HTML':
      case 'BODY':
        return element.ownerDocument.body;
      case '#document':
        return element.body;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1550

Mark Otto's avatar
dist    
Mark Otto committed
1551
    // Firefox want us to check `-x` and `-y` variations as well
Mark Otto's avatar
dist  
Mark Otto committed
1552

Mark Otto's avatar
dist    
Mark Otto committed
1553
1554
1555
1556
    var _getStyleComputedProp = getStyleComputedProperty(element),
        overflow = _getStyleComputedProp.overflow,
        overflowX = _getStyleComputedProp.overflowX,
        overflowY = _getStyleComputedProp.overflowY;
Mark Otto's avatar
dist  
Mark Otto committed
1557

Mark Otto's avatar
dist    
Mark Otto committed
1558
1559
    if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
      return element;
Mark Otto's avatar
dist  
Mark Otto committed
1560
1561
    }

Mark Otto's avatar
dist    
Mark Otto committed
1562
    return getScrollParent(getParentNode(element));
Mark Otto's avatar
dist  
Mark Otto committed
1563
1564
  }

Mark Otto's avatar
dist    
Mark Otto committed
1565
1566
1567
  var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);

Mark Otto's avatar
dist    
Mark Otto committed
1568
  /**
Mark Otto's avatar
dist    
Mark Otto committed
1569
   * Determines if the browser is Internet Explorer
Mark Otto's avatar
dist    
Mark Otto committed
1570
1571
   * @method
   * @memberof Popper.Utils
Mark Otto's avatar
dist    
Mark Otto committed
1572
   * @param {Number} version to check
Mark Otto's avatar
dist    
Mark Otto committed
1573
1574
   * @returns {Boolean} isIE
   */
Mark Otto's avatar
dist    
Mark Otto committed
1575
1576
1577
  function isIE(version) {
    if (version === 11) {
      return isIE11;
Mark Otto's avatar
dist    
Mark Otto committed
1578
    }
Mark Otto's avatar
dist    
Mark Otto committed
1579
1580
    if (version === 10) {
      return isIE10;
Mark Otto's avatar
dist    
Mark Otto committed
1581
    }
Mark Otto's avatar
dist    
Mark Otto committed
1582
1583
    return isIE11 || isIE10;
  }
Mark Otto's avatar
dist  
Mark Otto committed
1584

Mark Otto's avatar
dist    
Mark Otto committed
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
  /**
   * Returns the offset parent of the given element
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Element} offset parent
   */
  function getOffsetParent(element) {
    if (!element) {
      return document.documentElement;
Mark Otto's avatar
dist  
Mark Otto committed
1595
1596
    }

Mark Otto's avatar
dist    
Mark Otto committed
1597
    var noOffsetParent = isIE(10) ? document.body : null;
Mark Otto's avatar
dist  
Mark Otto committed
1598

Mark Otto's avatar
dist    
Mark Otto committed
1599
1600
1601
1602
1603
1604
    // NOTE: 1 DOM access here
    var offsetParent = element.offsetParent;
    // Skip hidden elements which don't have an offsetParent
    while (offsetParent === noOffsetParent && element.nextElementSibling) {
      offsetParent = (element = element.nextElementSibling).offsetParent;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1605

Mark Otto's avatar
dist    
Mark Otto committed
1606
    var nodeName = offsetParent && offsetParent.nodeName;
Mark Otto's avatar
dist  
Mark Otto committed
1607

Mark Otto's avatar
dist    
Mark Otto committed
1608
1609
1610
    if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
      return element ? element.ownerDocument.documentElement : document.documentElement;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1611

Mark Otto's avatar
dist    
Mark Otto committed
1612
1613
1614
1615
1616
    // .offsetParent will return the closest TD or TABLE in case
    // no offsetParent is present, I hate this job...
    if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
      return getOffsetParent(offsetParent);
    }
Mark Otto's avatar
dist  
Mark Otto committed
1617

Mark Otto's avatar
dist    
Mark Otto committed
1618
    return offsetParent;
Mark Otto's avatar
dist  
Mark Otto committed
1619
1620
  }

Mark Otto's avatar
dist    
Mark Otto committed
1621
1622
  function isOffsetContainer(element) {
    var nodeName = element.nodeName;
Mark Otto's avatar
dist  
Mark Otto committed
1623

Mark Otto's avatar
dist    
Mark Otto committed
1624
1625
    if (nodeName === 'BODY') {
      return false;
Mark Otto's avatar
dist  
Mark Otto committed
1626
    }
Mark Otto's avatar
dist    
Mark Otto committed
1627
    return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
Mark Otto's avatar
dist  
Mark Otto committed
1628
1629
  }

Mark Otto's avatar
dist    
Mark Otto committed
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
  /**
   * Finds the root node (document, shadowDOM root) of the given element
   * @method
   * @memberof Popper.Utils
   * @argument {Element} node
   * @returns {Element} root node
   */
  function getRoot(node) {
    if (node.parentNode !== null) {
      return getRoot(node.parentNode);
    }
Mark Otto's avatar
dist  
Mark Otto committed
1641

Mark Otto's avatar
dist    
Mark Otto committed
1642
    return node;
Mark Otto's avatar
dist  
Mark Otto committed
1643
1644
  }

Mark Otto's avatar
dist    
Mark Otto committed
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
  /**
   * Finds the offset parent common to the two provided nodes
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element1
   * @argument {Element} element2
   * @returns {Element} common offset parent
   */
  function findCommonOffsetParent(element1, element2) {
    // This check is needed to avoid errors in case one of the elements isn't defined for any reason
    if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
      return document.documentElement;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1658

Mark Otto's avatar
dist    
Mark Otto committed
1659
1660
1661
1662
    // Here we make sure to give as "start" the element that comes first in the DOM
    var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
    var start = order ? element1 : element2;
    var end = order ? element2 : element1;
Mark Otto's avatar
dist  
Mark Otto committed
1663

Mark Otto's avatar
dist    
Mark Otto committed
1664
1665
1666
1667
1668
    // Get common ancestor container
    var range = document.createRange();
    range.setStart(start, 0);
    range.setEnd(end, 0);
    var commonAncestorContainer = range.commonAncestorContainer;
Mark Otto's avatar
dist  
Mark Otto committed
1669

Mark Otto's avatar
dist    
Mark Otto committed
1670
    // Both nodes are inside #document
Mark Otto's avatar
dist  
Mark Otto committed
1671

Mark Otto's avatar
dist    
Mark Otto committed
1672
1673
1674
1675
    if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
      if (isOffsetContainer(commonAncestorContainer)) {
        return commonAncestorContainer;
      }
Mark Otto's avatar
dist  
Mark Otto committed
1676

Mark Otto's avatar
dist    
Mark Otto committed
1677
1678
      return getOffsetParent(commonAncestorContainer);
    }
Mark Otto's avatar
dist  
Mark Otto committed
1679

Mark Otto's avatar
dist    
Mark Otto committed
1680
1681
1682
1683
    // one of the nodes is inside shadowDOM, find which one
    var element1root = getRoot(element1);
    if (element1root.host) {
      return findCommonOffsetParent(element1root.host, element2);
Mark Otto's avatar
dist  
Mark Otto committed
1684
    } else {
Mark Otto's avatar
dist    
Mark Otto committed
1685
      return findCommonOffsetParent(element1, getRoot(element2).host);
Mark Otto's avatar
dist  
Mark Otto committed
1686
    }
Mark Otto's avatar
dist    
Mark Otto committed
1687
  }
Mark Otto's avatar
dist  
Mark Otto committed
1688

Mark Otto's avatar
dist    
Mark Otto committed
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
  /**
   * Gets the scroll value of the given element in the given side (top and left)
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @argument {String} side `top` or `left`
   * @returns {number} amount of scrolled pixels
   */
  function getScroll(element) {
    var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
Mark Otto's avatar
dist  
Mark Otto committed
1699

Mark Otto's avatar
dist    
Mark Otto committed
1700
1701
    var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
    var nodeName = element.nodeName;
Mark Otto's avatar
dist  
Mark Otto committed
1702

Mark Otto's avatar
dist    
Mark Otto committed
1703
1704
1705
1706
    if (nodeName === 'BODY' || nodeName === 'HTML') {
      var html = element.ownerDocument.documentElement;
      var scrollingElement = element.ownerDocument.scrollingElement || html;
      return scrollingElement[upperSide];
Mark Otto's avatar
dist  
Mark Otto committed
1707
1708
    }

Mark Otto's avatar
dist    
Mark Otto committed
1709
    return element[upperSide];
Mark Otto's avatar
dist  
Mark Otto committed
1710
1711
  }

Mark Otto's avatar
dist    
Mark Otto committed
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
  /*
   * Sum or subtract the element scroll values (left and top) from a given rect object
   * @method
   * @memberof Popper.Utils
   * @param {Object} rect - Rect object you want to change
   * @param {HTMLElement} element - The element from the function reads the scroll values
   * @param {Boolean} subtract - set to true if you want to subtract the scroll values
   * @return {Object} rect - The modifier rect object
   */
  function includeScroll(rect, element) {
    var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

    var scrollTop = getScroll(element, 'top');
    var scrollLeft = getScroll(element, 'left');
    var modifier = subtract ? -1 : 1;
    rect.top += scrollTop * modifier;
    rect.bottom += scrollTop * modifier;
    rect.left += scrollLeft * modifier;
    rect.right += scrollLeft * modifier;
    return rect;
  }
Mark Otto's avatar
dist  
Mark Otto committed
1733

Mark Otto's avatar
dist    
Mark Otto committed
1734
1735
1736
1737
1738
1739
1740
1741
1742
  /*
   * Helper to detect borders of a given element
   * @method
   * @memberof Popper.Utils
   * @param {CSSStyleDeclaration} styles
   * Result of `getStyleComputedProperty` on the given element
   * @param {String} axis - `x` or `y`
   * @return {number} borders - The borders size of the given axis
   */
Mark Otto's avatar
dist  
Mark Otto committed
1743

Mark Otto's avatar
dist    
Mark Otto committed
1744
1745
1746
  function getBordersSize(styles, axis) {
    var sideA = axis === 'x' ? 'Left' : 'Top';
    var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
Mark Otto's avatar
dist  
Mark Otto committed
1747

Mark Otto's avatar
dist    
Mark Otto committed
1748
    return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
Mark Otto's avatar
dist  
Mark Otto committed
1749
1750
  }

Mark Otto's avatar
dist    
Mark Otto committed
1751
1752
  function getSize(axis, body, html, computedStyle) {
    return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);
Mark Otto's avatar
dist  
Mark Otto committed
1753
1754
  }

Mark Otto's avatar
dist    
Mark Otto committed
1755
1756
1757
1758
  function getWindowSizes() {
    var body = document.body;
    var html = document.documentElement;
    var computedStyle = isIE(10) && getComputedStyle(html);
Mark Otto's avatar
dist  
Mark Otto committed
1759

Mark Otto's avatar
dist    
Mark Otto committed
1760
1761
1762
1763
    return {
      height: getSize('Height', body, html, computedStyle),
      width: getSize('Width', body, html, computedStyle)
    };
Mark Otto's avatar
dist  
Mark Otto committed
1764
1765
  }

Mark Otto's avatar
dist    
Mark Otto committed
1766
1767
1768
1769
  var classCallCheck = function (instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
Mark Otto's avatar
dist  
Mark Otto committed
1770
1771
  };

Mark Otto's avatar
dist    
Mark Otto committed
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
  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);
      }
    }
Mark Otto's avatar
dist  
Mark Otto committed
1782

Mark Otto's avatar
dist    
Mark Otto committed
1783
1784
1785
1786
1787
1788
    return function (Constructor, protoProps, staticProps) {
      if (protoProps) defineProperties(Constructor.prototype, protoProps);
      if (staticProps) defineProperties(Constructor, staticProps);
      return Constructor;
    };
  }();
Mark Otto's avatar
dist  
Mark Otto committed
1789
1790
1791
1792
1793





Mark Otto's avatar
dist    
Mark Otto committed
1794
1795
1796
1797
1798
1799
1800
1801
  var defineProperty = function (obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
Mark Otto's avatar
dist  
Mark Otto committed
1802
    } else {
Mark Otto's avatar
dist    
Mark Otto committed
1803
      obj[key] = value;
Mark Otto's avatar
dist  
Mark Otto committed
1804
1805
    }

Mark Otto's avatar
dist    
Mark Otto committed
1806
1807
    return obj;
  };
Mark Otto's avatar
dist  
Mark Otto committed
1808

Mark Otto's avatar
dist    
Mark Otto committed
1809
1810
1811
  var _extends = Object.assign || function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
Mark Otto's avatar
dist  
Mark Otto committed
1812

Mark Otto's avatar
dist    
Mark Otto committed
1813
1814
1815
1816
1817
1818
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
Mark Otto's avatar
dist  
Mark Otto committed
1819

Mark Otto's avatar
dist    
Mark Otto committed
1820
    return target;
Mark Otto's avatar
dist  
Mark Otto committed
1821
1822
  };

Mark Otto's avatar
dist    
Mark Otto committed
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
  /**
   * Given element offsets, generate an output similar to getBoundingClientRect
   * @method
   * @memberof Popper.Utils
   * @argument {Object} offsets
   * @returns {Object} ClientRect like output
   */
  function getClientRect(offsets) {
    return _extends({}, offsets, {
      right: offsets.left + offsets.width,
      bottom: offsets.top + offsets.height
    });
Mark Otto's avatar
dist  
Mark Otto committed
1835
1836
  }

Mark Otto's avatar
dist    
Mark Otto committed
1837
1838
1839
1840
1841
1842
1843
1844
1845
  /**
   * Get bounding client rect of given element
   * @method
   * @memberof Popper.Utils
   * @param {HTMLElement} element
   * @return {Object} client rect
   */
  function getBoundingClientRect(element) {
    var rect = {};
Mark Otto's avatar
dist  
Mark Otto committed
1846

Mark Otto's avatar
dist    
Mark Otto committed
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
    // IE10 10 FIX: Please, don't ask, the element isn't
    // considered in DOM in some circumstances...
    // This isn't reproducible in IE10 compatibility mode of IE11
    try {
      if (isIE(10)) {
        rect = element.getBoundingClientRect();
        var scrollTop = getScroll(element, 'top');
        var scrollLeft = getScroll(element, 'left');
        rect.top += scrollTop;
        rect.left += scrollLeft;
        rect.bottom += scrollTop;
        rect.right += scrollLeft;
      } else {
        rect = element.getBoundingClientRect();
      }
    } catch (e) {}

    var result = {
      left: rect.left,
      top: rect.top,
      width: rect.right - rect.left,
      height: rect.bottom - rect.top
    };
Mark Otto's avatar
dist  
Mark Otto committed
1870

Mark Otto's avatar
dist    
Mark Otto committed
1871
1872
1873
1874
    // subtract scrollbar size from sizes
    var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};
    var width = sizes.width || element.clientWidth || result.right - result.left;
    var height = sizes.height || element.clientHeight || result.bottom - result.top;
Mark Otto's avatar
dist  
Mark Otto committed
1875

Mark Otto's avatar
dist    
Mark Otto committed
1876
1877
    var horizScrollbar = element.offsetWidth - width;
    var vertScrollbar = element.offsetHeight - height;
Mark Otto's avatar
dist  
Mark Otto committed
1878

Mark Otto's avatar
dist    
Mark Otto committed
1879
1880
1881
1882
1883
1884
1885
1886
1887
    // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
    // we make this check conditional for performance reasons
    if (horizScrollbar || vertScrollbar) {
      var styles = getStyleComputedProperty(element);
      horizScrollbar -= getBordersSize(styles, 'x');
      vertScrollbar -= getBordersSize(styles, 'y');

      result.width -= horizScrollbar;
      result.height -= vertScrollbar;
Mark Otto's avatar
dist  
Mark Otto committed
1888
    }
Mark Otto's avatar
dist    
Mark Otto committed
1889
1890

    return getClientRect(result);
Mark Otto's avatar
dist  
Mark Otto committed
1891
1892
  }

Mark Otto's avatar
dist    
Mark Otto committed
1893
1894
  function getOffsetRectRelativeToArbitraryNode(children, parent) {
    var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
Mark Otto's avatar
dist  
Mark Otto committed
1895

Mark Otto's avatar
dist    
Mark Otto committed
1896
1897
1898
1899
1900
    var isIE10 = isIE(10);
    var isHTML = parent.nodeName === 'HTML';
    var childrenRect = getBoundingClientRect(children);
    var parentRect = getBoundingClientRect(parent);
    var scrollParent = getScrollParent(children);
Mark Otto's avatar
dist  
Mark Otto committed
1901

Mark Otto's avatar
dist    
Mark Otto committed
1902
1903
1904
    var styles = getStyleComputedProperty(parent);
    var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
    var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
Mark Otto's avatar
dist  
Mark Otto committed
1905

Mark Otto's avatar
dist    
Mark Otto committed
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
    // In cases where the parent is fixed, we must ignore negative scroll in offset calc
    if (fixedPosition && parent.nodeName === 'HTML') {
      parentRect.top = Math.max(parentRect.top, 0);
      parentRect.left = Math.max(parentRect.left, 0);
    }
    var offsets = getClientRect({
      top: childrenRect.top - parentRect.top - borderTopWidth,
      left: childrenRect.left - parentRect.left - borderLeftWidth,
      width: childrenRect.width,
      height: childrenRect.height
    });
    offsets.marginTop = 0;
    offsets.marginLeft = 0;

    // Subtract margins of documentElement in case it's being used as parent
    // we do this only on HTML because it's the only element that behaves
    // differently when margins are applied to it. The margins are included in
    // the box of the documentElement, in the other cases not.
    if (!isIE10 && isHTML) {
      var marginTop = parseFloat(styles.marginTop, 10);
      var marginLeft = parseFloat(styles.marginLeft, 10);

      offsets.top -= borderTopWidth - marginTop;
      offsets.bottom -= borderTopWidth - marginTop;
      offsets.left -= borderLeftWidth - marginLeft;
      offsets.right -= borderLeftWidth - marginLeft;

      // Attach marginTop and marginLeft because in some circumstances we may need them
      offsets.marginTop = marginTop;
      offsets.marginLeft = marginLeft;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1937

Mark Otto's avatar
dist    
Mark Otto committed
1938
1939
1940
    if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
      offsets = includeScroll(offsets, parent);
    }
Mark Otto's avatar
dist  
Mark Otto committed
1941

Mark Otto's avatar
dist    
Mark Otto committed
1942
    return offsets;
Mark Otto's avatar
dist  
Mark Otto committed
1943
1944
  }

Mark Otto's avatar
dist    
Mark Otto committed
1945
1946
  function getViewportOffsetRectRelativeToArtbitraryNode(element) {
    var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
Mark Otto's avatar
dist  
Mark Otto committed
1947

Mark Otto's avatar
dist    
Mark Otto committed
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
    var html = element.ownerDocument.documentElement;
    var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
    var width = Math.max(html.clientWidth, window.innerWidth || 0);
    var height = Math.max(html.clientHeight, window.innerHeight || 0);

    var scrollTop = !excludeScroll ? getScroll(html) : 0;
    var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;

    var offset = {
      top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
      left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
      width: width,
      height: height
    };
Mark Otto's avatar
dist  
Mark Otto committed
1962

Mark Otto's avatar
dist    
Mark Otto committed
1963
    return getClientRect(offset);
Mark Otto's avatar
dist  
Mark Otto committed
1964
1965
  }

Mark Otto's avatar
dist    
Mark Otto committed
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
  /**
   * Check if the given element is fixed or is inside a fixed parent
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @argument {Element} customContainer
   * @returns {Boolean} answer to "isFixed?"
   */
  function isFixed(element) {
    var nodeName = element.nodeName;
    if (nodeName === 'BODY' || nodeName === 'HTML') {
      return false;
Mark Otto's avatar
dist  
Mark Otto committed
1978
    }
Mark Otto's avatar
dist    
Mark Otto committed
1979
1980
1981
1982
1983
    if (getStyleComputedProperty(element, 'position') === 'fixed') {
      return true;
    }
    return isFixed(getParentNode(element));
  }
Mark Otto's avatar
dist  
Mark Otto committed
1984

Mark Otto's avatar
dist    
Mark Otto committed
1985
1986
1987
1988
1989
1990
1991
  /**
   * Finds the first parent of an element that has a transformed property defined
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Element} first transformed parent or documentElement
   */
Mark Otto's avatar
dist  
Mark Otto committed
1992

Mark Otto's avatar
dist    
Mark Otto committed
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
  function getFixedPositionOffsetParent(element) {
    // This check is needed to avoid errors in case one of the elements isn't defined for any reason
    if (!element || !element.parentElement || isIE()) {
      return document.documentElement;
    }
    var el = element.parentElement;
    while (el && getStyleComputedProperty(el, 'transform') === 'none') {
      el = el.parentElement;
    }
    return el || document.documentElement;
  }
Mark Otto's avatar
dist  
Mark Otto committed
2004

Mark Otto's avatar
dist    
Mark Otto committed
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
  /**
   * Computed the boundaries limits and return them
   * @method
   * @memberof Popper.Utils
   * @param {HTMLElement} popper
   * @param {HTMLElement} reference
   * @param {number} padding
   * @param {HTMLElement} boundariesElement - Element used to define the boundaries
   * @param {Boolean} fixedPosition - Is in fixed position mode
   * @returns {Object} Coordinates of the boundaries
   */
  function getBoundaries(popper, reference, padding, boundariesElement) {
    var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
Mark Otto's avatar
dist  
Mark Otto committed
2018

Mark Otto's avatar
dist    
Mark Otto committed
2019
    // NOTE: 1 DOM access here
Mark Otto's avatar
dist  
Mark Otto committed
2020

Mark Otto's avatar
dist    
Mark Otto committed
2021
2022
    var boundaries = { top: 0, left: 0 };
    var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
Mark Otto's avatar
dist  
Mark Otto committed
2023

Mark Otto's avatar
dist    
Mark Otto committed
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
    // Handle viewport case
    if (boundariesElement === 'viewport') {
      boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
    } else {
      // Handle other cases based on DOM element used as boundaries
      var boundariesNode = void 0;
      if (boundariesElement === 'scrollParent') {
        boundariesNode = getScrollParent(getParentNode(reference));
        if (boundariesNode.nodeName === 'BODY') {
          boundariesNode = popper.ownerDocument.documentElement;
        }
      } else if (boundariesElement === 'window') {
        boundariesNode = popper.ownerDocument.documentElement;
      } else {
        boundariesNode = boundariesElement;
      }
Mark Otto's avatar
dist  
Mark Otto committed
2040

Mark Otto's avatar
dist    
Mark Otto committed
2041
      var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
Mark Otto's avatar
dist  
Mark Otto committed
2042

Mark Otto's avatar
dist    
Mark Otto committed
2043
2044
2045
2046
2047
      // In case of HTML, we need a different computation
      if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
        var _getWindowSizes = getWindowSizes(),
            height = _getWindowSizes.height,
            width = _getWindowSizes.width;
Mark Otto's avatar
dist  
Mark Otto committed
2048

Mark Otto's avatar
dist    
Mark Otto committed
2049
2050
2051
2052
2053
2054
2055
        boundaries.top += offsets.top - offsets.marginTop;
        boundaries.bottom = height + offsets.top;
        boundaries.left += offsets.left - offsets.marginLeft;
        boundaries.right = width + offsets.left;
      } else {
        // for all the other DOM elements, this one is good
        boundaries = offsets;
Mark Otto's avatar
dist  
Mark Otto committed
2056
      }
Mark Otto's avatar
dist    
Mark Otto committed
2057
    }
Mark Otto's avatar
dist  
Mark Otto committed
2058

Mark Otto's avatar
dist    
Mark Otto committed
2059
2060
2061
2062
2063
    // Add paddings
    boundaries.left += padding;
    boundaries.top += padding;
    boundaries.right -= padding;
    boundaries.bottom -= padding;
Mark Otto's avatar
dist  
Mark Otto committed
2064

Mark Otto's avatar
dist    
Mark Otto committed
2065
    return boundaries;
Mark Otto's avatar
dist  
Mark Otto committed
2066
2067
  }

Mark Otto's avatar
dist    
Mark Otto committed
2068
2069
2070
2071
2072
  function getArea(_ref) {
    var width = _ref.width,
        height = _ref.height;

    return width * height;
Mark Otto's avatar
dist  
Mark Otto committed
2073
2074
  }

Mark Otto's avatar
dist    
Mark Otto committed
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
  /**
   * Utility used to transform the `auto` placement to the placement with more
   * available space.
   * @method
   * @memberof Popper.Utils
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
    var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
Mark Otto's avatar
dist  
Mark Otto committed
2086

Mark Otto's avatar
dist    
Mark Otto committed
2087
2088
    if (placement.indexOf('auto') === -1) {
      return placement;
Mark Otto's avatar
dist  
Mark Otto committed
2089
2090
    }

Mark Otto's avatar
dist    
Mark Otto committed
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
    var boundaries = getBoundaries(popper, reference, padding, boundariesElement);

    var rects = {
      top: {
        width: boundaries.width,
        height: refRect.top - boundaries.top
      },
      right: {
        width: boundaries.right - refRect.right,
        height: boundaries.height
      },
      bottom: {
        width: boundaries.width,
        height: boundaries.bottom - refRect.bottom
      },
      left: {
        width: refRect.left - boundaries.left,
        height: boundaries.height
Mark Otto's avatar
dist  
Mark Otto committed
2109
      }
Mark Otto's avatar
dist    
Mark Otto committed
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
    };

    var sortedAreas = Object.keys(rects).map(function (key) {
      return _extends({
        key: key
      }, rects[key], {
        area: getArea(rects[key])
      });
    }).sort(function (a, b) {
      return b.area - a.area;
Mark Otto's avatar
dist  
Mark Otto committed
2120
2121
    });

Mark Otto's avatar
dist    
Mark Otto committed
2122
2123
2124
2125
    var filteredAreas = sortedAreas.filter(function (_ref2) {
      var width = _ref2.width,
          height = _ref2.height;
      return width >= popper.clientWidth && height >= popper.clientHeight;
Mark Otto's avatar
dist  
Mark Otto committed
2126
2127
    });

Mark Otto's avatar
dist    
Mark Otto committed
2128
2129
2130
    var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;

    var variation = placement.split('-')[1];
Mark Otto's avatar
dist  
Mark Otto committed
2131

Mark Otto's avatar
dist    
Mark Otto committed
2132
    return computedPlacement + (variation ? '-' + variation : '');
Mark Otto's avatar
dist  
Mark Otto committed
2133
2134
  }

Mark Otto's avatar
dist    
Mark Otto committed
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
  /**
   * Get offsets to the reference element
   * @method
   * @memberof Popper.Utils
   * @param {Object} state
   * @param {Element} popper - the popper element
   * @param {Element} reference - the reference element (the popper will be relative to this)
   * @param {Element} fixedPosition - is in fixed position mode
   * @returns {Object} An object containing the offsets which will be applied to the popper
   */
  function getReferenceOffsets(state, popper, reference) {
    var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
Mark Otto's avatar
dist  
Mark Otto committed
2147

Mark Otto's avatar
dist    
Mark Otto committed
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
    var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
    return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  }

  /**
   * Get the outer sizes of the given element (offset size + margins)
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Object} object containing width and height properties
   */
  function getOuterSizes(element) {
    var styles = getComputedStyle(element);
    var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
    var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
    var result = {
      width: element.offsetWidth + y,
      height: element.offsetHeight + x
    };
    return result;
  }

  /**
   * Get the opposite placement of the given one
   * @method
   * @memberof Popper.Utils
   * @argument {String} placement
   * @returns {String} flipped placement
   */
  function getOppositePlacement(placement) {
    var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
    return placement.replace(/left|right|bottom|top/g, function (matched) {
      return hash[matched];
    });
  }

  /**
   * Get offsets to the popper
   * @method
   * @memberof Popper.Utils
   * @param {Object} position - CSS position the Popper will get applied
   * @param {HTMLElement} popper - the popper element
   * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
   * @param {String} placement - one of the valid placement options
   * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
   */
  function getPopperOffsets(popper, referenceOffsets, placement) {
    placement = placement.split('-')[0];

    // Get popper node sizes
    var popperRect = getOuterSizes(popper);
Mark Otto's avatar
dist  
Mark Otto committed
2199

Mark Otto's avatar
dist    
Mark Otto committed
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
    // Add position, width and height to our offsets object
    var popperOffsets = {
      width: popperRect.width,
      height: popperRect.height
    };

    // depending by the popper placement we have to compute its offsets slightly differently
    var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
    var mainSide = isHoriz ? 'top' : 'left';
    var secondarySide = isHoriz ? 'left' : 'top';
    var measurement = isHoriz ? 'height' : 'width';
    var secondaryMeasurement = !isHoriz ? 'height' : 'width';

    popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
    if (placement === secondarySide) {
      popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
    } else {
      popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
    }

    return popperOffsets;
  }

  /**
   * Mimics the `find` method of Array
   * @method
   * @memberof Popper.Utils
   * @argument {Array} arr
   * @argument prop
   * @argument value
   * @returns index or -1
   */
  function find(arr, check) {
    // use native find if supported
    if (Array.prototype.find) {
      return arr.find(check);
    }

    // use `filter` to obtain the same behavior of `find`
    return arr.filter(check)[0];
  }

  /**
   * Return the index of the matching object
   * @method
   * @memberof Popper.Utils
   * @argument {Array} arr
   * @argument prop
   * @argument value
   * @returns index or -1
   */
  function findIndex(arr, prop, value) {
    // use native findIndex if supported
    if (Array.prototype.findIndex) {
      return arr.findIndex(function (cur) {
        return cur[prop] === value;
      });
    }

    // use `find` + `indexOf` if `findIndex` isn't supported
    var match = find(arr, function (obj) {
      return obj[prop] === value;
    });
    return arr.indexOf(match);
  }

  /**
   * Loop trough the list of modifiers and run them in order,
   * each of them will then edit the data object.
   * @method
   * @memberof Popper.Utils
   * @param {dataObject} data
   * @param {Array} modifiers
   * @param {String} ends - Optional modifier name used as stopper
   * @returns {dataObject}
   */
  function runModifiers(modifiers, data, ends) {
    var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));

    modifiersToRun.forEach(function (modifier) {
      if (modifier['function']) {
        // eslint-disable-line dot-notation
        console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
Mark Otto's avatar
dist  
Mark Otto committed
2283
      }
Mark Otto's avatar
dist    
Mark Otto committed
2284
2285
2286
2287
2288
2289
2290
2291
2292
      var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
      if (modifier.enabled && isFunction(fn)) {
        // Add properties to offsets to make them a complete clientRect object
        // we do this before each modifier to make sure the previous one doesn't
        // mess with these values
        data.offsets.popper = getClientRect(data.offsets.popper);
        data.offsets.reference = getClientRect(data.offsets.reference);

        data = fn(data, modifier);
Mark Otto's avatar
dist  
Mark Otto committed
2293
      }
Mark Otto's avatar
dist    
Mark Otto committed
2294
    });
Mark Otto's avatar
dist  
Mark Otto committed
2295

Mark Otto's avatar
dist    
Mark Otto committed
2296
2297
    return data;
  }
Mark Otto's avatar
dist  
Mark Otto committed
2298

Mark Otto's avatar
dist    
Mark Otto committed
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
  /**
   * Updates the position of the popper, computing the new offsets and applying
   * the new style.<br />
   * Prefer `scheduleUpdate` over `update` because of performance reasons.
   * @method
   * @memberof Popper
   */
  function update() {
    // if popper is destroyed, don't perform any further update
    if (this.state.isDestroyed) {
      return;
    }
Mark Otto's avatar
dist  
Mark Otto committed
2311

Mark Otto's avatar
dist    
Mark Otto committed
2312
2313
2314
2315
2316
2317
2318
    var data = {
      instance: this,
      styles: {},
      arrowStyles: {},
      attributes: {},
      flipped: false,
      offsets: {}
Mark Otto's avatar
dist  
Mark Otto committed
2319
2320
    };

Mark Otto's avatar
dist    
Mark Otto committed
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
    // compute reference element offsets
    data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);

    // compute auto placement, store placement inside the data object,
    // modifiers will be able to edit `placement` if needed
    // and refer to originalPlacement to know the original value
    data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);

    // store the computed placement inside `originalPlacement`
    data.originalPlacement = data.placement;

    data.positionFixed = this.options.positionFixed;

    // compute the popper offsets
    data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
Mark Otto's avatar
dist    
Mark Otto committed
2336

Mark Otto's avatar
dist    
Mark Otto committed
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
    data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';

    // run the modifiers
    data = runModifiers(this.modifiers, data);

    // the first `update` will call `onCreate` callback
    // the other ones will call `onUpdate` callback
    if (!this.state.isCreated) {
      this.state.isCreated = true;
      this.options.onCreate(data);
    } else {
      this.options.onUpdate(data);
    }
  }

  /**
   * Helper used to know if the given modifier is enabled.
   * @method
   * @memberof Popper.Utils
   * @returns {Boolean}
   */
  function isModifierEnabled(modifiers, modifierName) {
    return modifiers.some(function (_ref) {
      var name = _ref.name,
          enabled = _ref.enabled;
      return enabled && name === modifierName;
    });
  }

  /**
   * Get the prefixed supported property name
   * @method
   * @memberof Popper.Utils
   * @argument {String} property (camelCase)
   * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
   */
  function getSupportedPropertyName(property) {
    var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
    var upperProp = property.charAt(0).toUpperCase() + property.slice(1);

    for (var i = 0; i < prefixes.length; i++) {
      var prefix = prefixes[i];
      var toCheck = prefix ? '' + prefix + upperProp : property;
      if (typeof document.body.style[toCheck] !== 'undefined') {
        return toCheck;
      }
    }
    return null;
  }

  /**
   * Destroy the popper
   * @method
   * @memberof Popper
   */
  function destroy() {
    this.state.isDestroyed = true;

    // touch DOM only if `applyStyle` modifier is enabled
    if (isModifierEnabled(this.modifiers, 'applyStyle')) {
      this.popper.removeAttribute('x-placement');
      this.popper.style.position = '';
      this.popper.style.top = '';
      this.popper.style.left = '';
      this.popper.style.right = '';
      this.popper.style.bottom = '';
      this.popper.style.willChange = '';
      this.popper.style[getSupportedPropertyName('transform')] = '';
    }

    this.disableEventListeners();

    // remove the popper if user explicity asked for the deletion on destroy
    // do not use `remove` because IE11 doesn't support it
    if (this.options.removeOnDestroy) {
      this.popper.parentNode.removeChild(this.popper);
    }
    return this;
  }

  /**
   * Get the window associated with the element
   * @argument {Element} element
   * @returns {Window}
   */
  function getWindow(element) {
    var ownerDocument = element.ownerDocument;
    return ownerDocument ? ownerDocument.defaultView : window;
  }

  function attachToScrollParents(scrollParent, event, callback, scrollParents) {
    var isBody = scrollParent.nodeName === 'BODY';
    var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
    target.addEventListener(event, callback, { passive: true });

    if (!isBody) {
      attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
    }
    scrollParents.push(target);
  }

  /**
   * Setup needed event listeners used to update the popper position
   * @method
   * @memberof Popper.Utils
   * @private
   */
  function setupEventListeners(reference, options, state, updateBound) {
    // Resize event listener on window
    state.updateBound = updateBound;
    getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });

    // Scroll event listener on scroll parents
    var scrollElement = getScrollParent(reference);
    attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
    state.scrollElement = scrollElement;
    state.eventsEnabled = true;

    return state;
  }

  /**
   * It will add resize/scroll events and start recalculating
   * position of the popper element when they are triggered.
   * @method
   * @memberof Popper
   */
  function enableEventListeners() {
    if (!this.state.eventsEnabled) {
      this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
    }
  }

  /**
   * Remove event listeners used to update the popper position
   * @method
   * @memberof Popper.Utils
   * @private
   */
  function removeEventListeners(reference, state) {
    // Remove resize event listener on window
    getWindow(reference).removeEventListener('resize', state.updateBound);

    // Remove scroll event listener on scroll parents
    state.scrollParents.forEach(function (target) {
      target.removeEventListener('scroll', state.updateBound);
    });

    // Reset state
    state.updateBound = null;
    state.scrollParents = [];
    state.scrollElement = null;
    state.eventsEnabled = false;
    return state;
  }

  /**
   * It will remove resize/scroll events and won't recalculate popper position
   * when they are triggered. It also won't trigger onUpdate callback anymore,
   * unless you call `update` method manually.
   * @method
   * @memberof Popper
   */
  function disableEventListeners() {
    if (this.state.eventsEnabled) {
      cancelAnimationFrame(this.scheduleUpdate);
      this.state = removeEventListeners(this.reference, this.state);
    }
  }

  /**
   * Tells if a given input is a number
   * @method
   * @memberof Popper.Utils
   * @param {*} input to check
   * @return {Boolean}
   */
  function isNumeric(n) {
    return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  }

  /**
   * Set the style to the given popper
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element - Element to apply the style to
   * @argument {Object} styles
   * Object with a list of properties and values which will be applied to the element
   */
  function setStyles(element, styles) {
    Object.keys(styles).forEach(function (prop) {
      var unit = '';
      // add unit if the value is numeric and is one of the following
      if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
        unit = 'px';
      }
      element.style[prop] = styles[prop] + unit;
    });
Mark Otto's avatar
dist  
Mark Otto committed
2535
2536
  }

Mark Otto's avatar
dist    
Mark Otto committed
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
  /**
   * Set the attributes to the given popper
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element - Element to apply the attributes to
   * @argument {Object} styles
   * Object with a list of properties and values which will be applied to the element
   */
  function setAttributes(element, attributes) {
    Object.keys(attributes).forEach(function (prop) {
      var value = attributes[prop];
      if (value !== false) {
        element.setAttribute(prop, attributes[prop]);
      } else {
        element.removeAttribute(prop);
      }
    });
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} data.styles - List of style properties - values to apply to popper element
   * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The same data object
   */
  function applyStyle(data) {
    // any property present in `data.styles` will be applied to the popper,
    // in this way we can make the 3rd party modifiers add custom styles to it
    // Be aware, modifiers could override the properties defined in the previous
    // lines of this modifier!
    setStyles(data.instance.popper, data.styles);

    // any property present in `data.attributes` will be applied to the popper,
    // they will be set as HTML attributes of the element
    setAttributes(data.instance.popper, data.attributes);

    // if arrowElement is defined and arrowStyles has some properties
    if (data.arrowElement && Object.keys(data.arrowStyles).length) {
      setStyles(data.arrowElement, data.arrowStyles);
    }

Mark Otto's avatar
dist  
Mark Otto committed
2581
2582
2583
    return data;
  }

Mark Otto's avatar
dist    
Mark Otto committed
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
  /**
   * Set the x-placement attribute before everything else because it could be used
   * to add margins to the popper margins needs to be calculated to get the
   * correct popper offsets.
   * @method
   * @memberof Popper.modifiers
   * @param {HTMLElement} reference - The reference element used to position the popper
   * @param {HTMLElement} popper - The HTML element used as popper
   * @param {Object} options - Popper.js options
   */
  function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
    // compute reference element offsets
    var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);

    // compute auto placement, store placement inside the data object,
    // modifiers will be able to edit `placement` if needed
    // and refer to originalPlacement to know the original value
    var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
Mark Otto's avatar
dist  
Mark Otto committed
2602

Mark Otto's avatar
dist    
Mark Otto committed
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
    popper.setAttribute('x-placement', placement);

    // Apply `position` to popper before anything else because
    // without the position applied we can't guarantee correct computations
    setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });

    return options;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function computeStyle(data, options) {
    var x = options.x,
        y = options.y;
    var popper = data.offsets.popper;

    // Remove this legacy support in Popper.js v2

    var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
      return modifier.name === 'applyStyle';
    }).gpuAcceleration;
    if (legacyGpuAccelerationOption !== undefined) {
      console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
Mark Otto's avatar
dist  
Mark Otto committed
2631
    }
Mark Otto's avatar
dist    
Mark Otto committed
2632
2633
2634
2635
2636
2637
2638
2639
2640
    var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;

    var offsetParent = getOffsetParent(data.instance.popper);
    var offsetParentRect = getBoundingClientRect(offsetParent);

    // Styles
    var styles = {
      position: popper.position
    };
Mark Otto's avatar
dist  
Mark Otto committed
2641

Mark Otto's avatar
dist    
Mark Otto committed
2642
2643
2644
    // Avoid blurry text by using full pixel integers.
    // For pixel-perfect positioning, top/bottom prefers rounded
    // values, while left/right prefers floored values.
Mark Otto's avatar
dist    
Mark Otto committed
2645
2646
    var offsets = {
      left: Math.floor(popper.left),
Mark Otto's avatar
dist    
Mark Otto committed
2647
2648
      top: Math.round(popper.top),
      bottom: Math.round(popper.bottom),
Mark Otto's avatar
dist    
Mark Otto committed
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
      right: Math.floor(popper.right)
    };

    var sideA = x === 'bottom' ? 'top' : 'bottom';
    var sideB = y === 'right' ? 'left' : 'right';

    // if gpuAcceleration is set to `true` and transform is supported,
    //  we use `translate3d` to apply the position to the popper we
    // automatically use the supported prefixed version if needed
    var prefixedProperty = getSupportedPropertyName('transform');

    // now, let's make a step back and look at this code closely (wtf?)
    // If the content of the popper grows once it's been positioned, it
    // may happen that the popper gets misplaced because of the new content
    // overflowing its reference element
    // To avoid this problem, we provide two options (x and y), which allow
    // the consumer to define the offset origin.
    // If we position a popper on top of a reference element, we can set
    // `x` to `top` to make the popper grow towards its top instead of
    // its bottom.
    var left = void 0,
        top = void 0;
    if (sideA === 'bottom') {
      top = -offsetParentRect.height + offsets.bottom;
    } else {
      top = offsets.top;
    }
    if (sideB === 'right') {
      left = -offsetParentRect.width + offsets.right;
    } else {
      left = offsets.left;
    }
    if (gpuAcceleration && prefixedProperty) {
      styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
      styles[sideA] = 0;
      styles[sideB] = 0;
      styles.willChange = 'transform';
    } else {
      // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
      var invertTop = sideA === 'bottom' ? -1 : 1;
      var invertLeft = sideB === 'right' ? -1 : 1;
      styles[sideA] = top * invertTop;
      styles[sideB] = left * invertLeft;
      styles.willChange = sideA + ', ' + sideB;
    }

    // Attributes
    var attributes = {
      'x-placement': data.placement
    };

    // Update `data` attributes, styles and arrowStyles
    data.attributes = _extends({}, attributes, data.attributes);
    data.styles = _extends({}, styles, data.styles);
    data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);

    return data;
  }

  /**
   * Helper used to know if the given modifier depends from another one.<br />
   * It checks if the needed modifier is listed and enabled.
   * @method
   * @memberof Popper.Utils
   * @param {Array} modifiers - list of modifiers
   * @param {String} requestingName - name of requesting modifier
   * @param {String} requestedName - name of requested modifier
   * @returns {Boolean}
   */
  function isModifierRequired(modifiers, requestingName, requestedName) {
    var requesting = find(modifiers, function (_ref) {
      var name = _ref.name;
      return name === requestingName;
    });

    var isRequired = !!requesting && modifiers.some(function (modifier) {
      return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
    });

    if (!isRequired) {
      var _requesting = '`' + requestingName + '`';
      var requested = '`' + requestedName + '`';
      console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
    }
    return isRequired;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function arrow(data, options) {
    var _data$offsets$arrow;

    // arrow depends on keepTogether in order to work
    if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
Mark Otto's avatar
dist  
Mark Otto committed
2748
2749
2750
      return data;
    }

Mark Otto's avatar
dist    
Mark Otto committed
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
    var arrowElement = options.element;

    // if arrowElement is a string, suppose it's a CSS selector
    if (typeof arrowElement === 'string') {
      arrowElement = data.instance.popper.querySelector(arrowElement);

      // if arrowElement is not found, don't run the modifier
      if (!arrowElement) {
        return data;
      }
    } else {
      // if the arrowElement isn't a query selector we must check that the
      // provided DOM node is child of its popper node
      if (!data.instance.popper.contains(arrowElement)) {
        console.warn('WARNING: `arrow.element` must be child of its popper element!');
        return data;
      }
    }

    var placement = data.placement.split('-')[0];
    var _data$offsets = data.offsets,
        popper = _data$offsets.popper,
        reference = _data$offsets.reference;

    var isVertical = ['left', 'right'].indexOf(placement) !== -1;

    var len = isVertical ? 'height' : 'width';
    var sideCapitalized = isVertical ? 'Top' : 'Left';
    var side = sideCapitalized.toLowerCase();
    var altSide = isVertical ? 'left' : 'top';
    var opSide = isVertical ? 'bottom' : 'right';
    var arrowElementSize = getOuterSizes(arrowElement)[len];

    //
    // extends keepTogether behavior making sure the popper and its
    // reference have enough pixels in conjuction
    //

    // top/left side
    if (reference[opSide] - arrowElementSize < popper[side]) {
      data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
    }
    // bottom/right side
    if (reference[side] + arrowElementSize > popper[opSide]) {
      data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
    }
    data.offsets.popper = getClientRect(data.offsets.popper);

    // compute center of the popper
    var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;

    // Compute the sideValue using the updated popper offsets
    // take popper margin in account because we don't have this info available
    var css = getStyleComputedProperty(data.instance.popper);
    var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
    var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
    var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;

    // prevent arrowElement from being placed not contiguously to its popper
    sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);

    data.arrowElement = arrowElement;
    data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);

    return data;
Mark Otto's avatar
dist  
Mark Otto committed
2816
2817
2818
  }

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2819
2820
2821
2822
2823
   * Get the opposite placement variation of the given one
   * @method
   * @memberof Popper.Utils
   * @argument {String} placement variation
   * @returns {String} flipped placement variation
Mark Otto's avatar
dist  
Mark Otto committed
2824
   */
Mark Otto's avatar
dist    
Mark Otto committed
2825
2826
2827
2828
2829
2830
2831
2832
  function getOppositeVariation(variation) {
    if (variation === 'end') {
      return 'start';
    } else if (variation === 'start') {
      return 'end';
    }
    return variation;
  }
Mark Otto's avatar
dist  
Mark Otto committed
2833
2834

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2835
2836
2837
2838
2839
2840
2841
   * List of accepted placements to use as values of the `placement` option.<br />
   * Valid placements are:
   * - `auto`
   * - `top`
   * - `right`
   * - `bottom`
   * - `left`
Mark Otto's avatar
dist  
Mark Otto committed
2842
   *
Mark Otto's avatar
dist    
Mark Otto committed
2843
2844
2845
   * Each placement can have a variation from this list:
   * - `-start`
   * - `-end`
Mark Otto's avatar
dist  
Mark Otto committed
2846
   *
Mark Otto's avatar
dist    
Mark Otto committed
2847
2848
2849
2850
   * Variations are interpreted easily if you think of them as the left to right
   * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
   * is right.<br />
   * Vertically (`left` and `right`), `start` is top and `end` is bottom.
Mark Otto's avatar
dist  
Mark Otto committed
2851
   *
Mark Otto's avatar
dist    
Mark Otto committed
2852
2853
2854
2855
2856
   * Some valid examples are:
   * - `top-end` (on top of reference, right aligned)
   * - `right-start` (on right of reference, top aligned)
   * - `bottom` (on bottom, centered)
   * - `auto-right` (on the side with more space available, alignment depends by placement)
Mark Otto's avatar
dist  
Mark Otto committed
2857
   *
Mark Otto's avatar
dist    
Mark Otto committed
2858
2859
2860
2861
2862
2863
   * @static
   * @type {Array}
   * @enum {String}
   * @readonly
   * @method placements
   * @memberof Popper
Mark Otto's avatar
dist  
Mark Otto committed
2864
   */
Mark Otto's avatar
dist    
Mark Otto committed
2865
2866
2867
2868
  var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];

  // Get rid of `auto` `auto-start` and `auto-end`
  var validPlacements = placements.slice(3);
Mark Otto's avatar
dist  
Mark Otto committed
2869
2870

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2871
2872
   * Given an initial placement, returns all the subsequent placements
   * clockwise (or counter-clockwise).
Mark Otto's avatar
dist  
Mark Otto committed
2873
   *
Mark Otto's avatar
dist    
Mark Otto committed
2874
2875
2876
2877
2878
   * @method
   * @memberof Popper.Utils
   * @argument {String} placement - A valid placement (it accepts variations)
   * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
   * @returns {Array} placements including their variations
Mark Otto's avatar
dist  
Mark Otto committed
2879
   */
Mark Otto's avatar
dist    
Mark Otto committed
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
  function clockwise(placement) {
    var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    var index = validPlacements.indexOf(placement);
    var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
    return counter ? arr.reverse() : arr;
  }

  var BEHAVIORS = {
    FLIP: 'flip',
    CLOCKWISE: 'clockwise',
    COUNTERCLOCKWISE: 'counterclockwise'
  };
Mark Otto's avatar
dist  
Mark Otto committed
2893
2894

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2895
2896
2897
2898
2899
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
Mark Otto's avatar
dist  
Mark Otto committed
2900
   */
Mark Otto's avatar
dist    
Mark Otto committed
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
  function flip(data, options) {
    // if `inner` modifier is enabled, we can't use the `flip` modifier
    if (isModifierEnabled(data.instance.modifiers, 'inner')) {
      return data;
    }

    if (data.flipped && data.placement === data.originalPlacement) {
      // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
      return data;
    }

    var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);

    var placement = data.placement.split('-')[0];
    var placementOpposite = getOppositePlacement(placement);
    var variation = data.placement.split('-')[1] || '';

    var flipOrder = [];

    switch (options.behavior) {
      case BEHAVIORS.FLIP:
        flipOrder = [placement, placementOpposite];
        break;
      case BEHAVIORS.CLOCKWISE:
        flipOrder = clockwise(placement);
        break;
      case BEHAVIORS.COUNTERCLOCKWISE:
        flipOrder = clockwise(placement, true);
        break;
      default:
        flipOrder = options.behavior;
    }

    flipOrder.forEach(function (step, index) {
      if (placement !== step || flipOrder.length === index + 1) {
        return data;
      }

      placement = data.placement.split('-')[0];
      placementOpposite = getOppositePlacement(placement);

      var popperOffsets = data.offsets.popper;
      var refOffsets = data.offsets.reference;

      // using floor because the reference offsets may contain decimals we are not going to consider here
      var floor = Math.floor;
      var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);

      var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
      var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
      var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
      var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);

      var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;

      // flip the variation if required
      var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
      var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);

      if (overlapsRef || overflowsBoundaries || flippedVariation) {
        // this boolean to detect any flip loop
        data.flipped = true;

        if (overlapsRef || overflowsBoundaries) {
          placement = flipOrder[index + 1];
        }

        if (flippedVariation) {
          variation = getOppositeVariation(variation);
        }

        data.placement = placement + (variation ? '-' + variation : '');

        // this object contains `position`, we want to preserve it along with
        // any additional property we may add in the future
        data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));

        data = runModifiers(data.instance.modifiers, data, 'flip');
      }
    });
    return data;
  }
Mark Otto's avatar
dist  
Mark Otto committed
2983
2984

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2985
2986
2987
2988
2989
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
Mark Otto's avatar
dist  
Mark Otto committed
2990
   */
Mark Otto's avatar
dist    
Mark Otto committed
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
  function keepTogether(data) {
    var _data$offsets = data.offsets,
        popper = _data$offsets.popper,
        reference = _data$offsets.reference;

    var placement = data.placement.split('-')[0];
    var floor = Math.floor;
    var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
    var side = isVertical ? 'right' : 'bottom';
    var opSide = isVertical ? 'left' : 'top';
    var measurement = isVertical ? 'width' : 'height';

    if (popper[side] < floor(reference[opSide])) {
      data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
    }
    if (popper[opSide] > floor(reference[side])) {
      data.offsets.popper[opSide] = floor(reference[side]);
    }

    return data;
  }
Mark Otto's avatar
dist  
Mark Otto committed
3012
3013

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
   * Converts a string containing value + unit into a px value number
   * @function
   * @memberof {modifiers~offset}
   * @private
   * @argument {String} str - Value + unit string
   * @argument {String} measurement - `height` or `width`
   * @argument {Object} popperOffsets
   * @argument {Object} referenceOffsets
   * @returns {Number|String}
   * Value in pixels, or original string if no values were extracted
Mark Otto's avatar
dist  
Mark Otto committed
3024
   */
Mark Otto's avatar
dist    
Mark Otto committed
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
  function toValue(str, measurement, popperOffsets, referenceOffsets) {
    // separate value from unit
    var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
    var value = +split[1];
    var unit = split[2];

    // If it's not a number it's an operator, I guess
    if (!value) {
      return str;
    }

    if (unit.indexOf('%') === 0) {
      var element = void 0;
      switch (unit) {
        case '%p':
          element = popperOffsets;
          break;
        case '%':
        case '%r':
        default:
          element = referenceOffsets;
      }

      var rect = getClientRect(element);
      return rect[measurement] / 100 * value;
    } else if (unit === 'vh' || unit === 'vw') {
      // if is a vh or vw, we calculate the size based on the viewport
      var size = void 0;
      if (unit === 'vh') {
        size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
      } else {
        size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
      }
      return size / 100 * value;
    } else {
      // if is an explicit pixel unit, we get rid of the unit and keep the value
      // if is an implicit unit, it's px, and we return just the value
      return value;
    }
  }
Mark Otto's avatar
dist  
Mark Otto committed
3065
3066

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3067
3068
3069
3070
3071
3072
3073
3074
3075
   * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
   * @function
   * @memberof {modifiers~offset}
   * @private
   * @argument {String} offset
   * @argument {Object} popperOffsets
   * @argument {Object} referenceOffsets
   * @argument {String} basePlacement
   * @returns {Array} a two cells array with x and y offsets in numbers
Mark Otto's avatar
dist  
Mark Otto committed
3076
   */
Mark Otto's avatar
dist    
Mark Otto committed
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
  function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
    var offsets = [0, 0];

    // Use height if placement is left or right and index is 0 otherwise use width
    // in this way the first offset will use an axis and the second one
    // will use the other one
    var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;

    // Split the offset string to obtain a list of values and operands
    // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
    var fragments = offset.split(/(\+|\-)/).map(function (frag) {
      return frag.trim();
    });

    // Detect if the offset string contains a pair of values or a single one
    // they could be separated by comma or space
    var divider = fragments.indexOf(find(fragments, function (frag) {
      return frag.search(/,|\s/) !== -1;
    }));

    if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
      console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
    }

    // If divider is found, we divide the list of values and operands to divide
    // them by ofset X and Y.
    var splitRegex = /\s*,\s*|\s+/;
    var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];

    // Convert the values with units to absolute pixels to allow our computations
    ops = ops.map(function (op, index) {
      // Most of the units rely on the orientation of the popper
      var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
      var mergeWithPrevious = false;
      return op
      // This aggregates any `+` or `-` sign that aren't considered operators
      // e.g.: 10 + +5 => [10, +, +5]
      .reduce(function (a, b) {
        if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
          a[a.length - 1] = b;
          mergeWithPrevious = true;
          return a;
        } else if (mergeWithPrevious) {
          a[a.length - 1] += b;
          mergeWithPrevious = false;
          return a;
        } else {
          return a.concat(b);
        }
      }, [])
      // Here we convert the string values into number values (in px)
      .map(function (str) {
        return toValue(str, measurement, popperOffsets, referenceOffsets);
      });
    });

    // Loop trough the offsets arrays and execute the operations
    ops.forEach(function (op, index) {
      op.forEach(function (frag, index2) {
        if (isNumeric(frag)) {
          offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
        }
      });
    });
    return offsets;
  }
Mark Otto's avatar
dist  
Mark Otto committed
3143
3144

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3145
3146
3147
3148
3149
3150
3151
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @argument {Number|String} options.offset=0
   * The offset value as described in the modifier description
   * @returns {Object} The data object, properly modified
Mark Otto's avatar
dist  
Mark Otto committed
3152
   */
Mark Otto's avatar
dist    
Mark Otto committed
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
  function offset(data, _ref) {
    var offset = _ref.offset;
    var placement = data.placement,
        _data$offsets = data.offsets,
        popper = _data$offsets.popper,
        reference = _data$offsets.reference;

    var basePlacement = placement.split('-')[0];

    var offsets = void 0;
    if (isNumeric(+offset)) {
      offsets = [+offset, 0];
    } else {
      offsets = parseOffset(offset, popper, reference, basePlacement);
    }

    if (basePlacement === 'left') {
      popper.top += offsets[0];
      popper.left -= offsets[1];
    } else if (basePlacement === 'right') {
      popper.top += offsets[0];
      popper.left += offsets[1];
    } else if (basePlacement === 'top') {
      popper.left += offsets[0];
      popper.top -= offsets[1];
    } else if (basePlacement === 'bottom') {
      popper.left += offsets[0];
      popper.top += offsets[1];
    }

    data.popper = popper;
    return data;
  }
Mark Otto's avatar
dist  
Mark Otto committed
3186
3187

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function preventOverflow(data, options) {
    var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);

    // If offsetParent is the reference element, we really want to
    // go one step up and use the next offsetParent as reference to
    // avoid to make this modifier completely useless and look like broken
    if (data.instance.reference === boundariesElement) {
      boundariesElement = getOffsetParent(boundariesElement);
    }

Mark Otto's avatar
dist    
Mark Otto committed
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
    // NOTE: DOM access here
    // resets the popper's position so that the document size can be calculated excluding
    // the size of the popper element itself
    var transformProp = getSupportedPropertyName('transform');
    var popperStyles = data.instance.popper.style; // assignment to help minification
    var top = popperStyles.top,
        left = popperStyles.left,
        transform = popperStyles[transformProp];

    popperStyles.top = '';
    popperStyles.left = '';
    popperStyles[transformProp] = '';

Mark Otto's avatar
dist    
Mark Otto committed
3217
    var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
Mark Otto's avatar
dist    
Mark Otto committed
3218
3219
3220
3221
3222
3223
3224

    // NOTE: DOM access here
    // restores the original style properties after the offsets have been computed
    popperStyles.top = top;
    popperStyles.left = left;
    popperStyles[transformProp] = transform;

Mark Otto's avatar
dist    
Mark Otto committed
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
    options.boundaries = boundaries;

    var order = options.priority;
    var popper = data.offsets.popper;

    var check = {
      primary: function primary(placement) {
        var value = popper[placement];
        if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
          value = Math.max(popper[placement], boundaries[placement]);
        }
        return defineProperty({}, placement, value);
      },
      secondary: function secondary(placement) {
        var mainSide = placement === 'right' ? 'left' : 'top';
        var value = popper[mainSide];
        if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
          value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
        }
        return defineProperty({}, mainSide, value);
      }
    };

    order.forEach(function (placement) {
      var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
      popper = _extends({}, popper, check[side](placement));
    });

    data.offsets.popper = popper;

    return data;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function shift(data) {
    var placement = data.placement;
    var basePlacement = placement.split('-')[0];
    var shiftvariation = placement.split('-')[1];

    // if shift shiftvariation is specified, run the modifier
    if (shiftvariation) {
      var _data$offsets = data.offsets,
          reference = _data$offsets.reference,
          popper = _data$offsets.popper;

      var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
      var side = isVertical ? 'left' : 'top';
      var measurement = isVertical ? 'width' : 'height';

      var shiftOffsets = {
        start: defineProperty({}, side, reference[side]),
        end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
      };

      data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
    }

    return data;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function hide(data) {
    if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
      return data;
    }

    var refRect = data.offsets.reference;
    var bound = find(data.instance.modifiers, function (modifier) {
      return modifier.name === 'preventOverflow';
    }).boundaries;

    if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
      // Avoid unnecessary DOM access if visibility hasn't changed
      if (data.hide === true) {
        return data;
      }

      data.hide = true;
      data.attributes['x-out-of-boundaries'] = '';
    } else {
      // Avoid unnecessary DOM access if visibility hasn't changed
      if (data.hide === false) {
        return data;
      }

      data.hide = false;
      data.attributes['x-out-of-boundaries'] = false;
    }

    return data;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function inner(data) {
    var placement = data.placement;
    var basePlacement = placement.split('-')[0];
    var _data$offsets = data.offsets,
        popper = _data$offsets.popper,
        reference = _data$offsets.reference;

    var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;

    var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;

    popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);

    data.placement = getOppositePlacement(placement);
    data.offsets.popper = getClientRect(popper);

    return data;
  }

  /**
   * Modifier function, each modifier can have a function of this type assigned
   * to its `fn` property.<br />
   * These functions will be called on each update, this means that you must
   * make sure they are performant enough to avoid performance bottlenecks.
Mark Otto's avatar
dist  
Mark Otto committed
3360
   *
Mark Otto's avatar
dist    
Mark Otto committed
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
   * @function ModifierFn
   * @argument {dataObject} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {dataObject} The data object, properly modified
   */

  /**
   * Modifiers are plugins used to alter the behavior of your poppers.<br />
   * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
   * needed by the library.
Mark Otto's avatar
dist  
Mark Otto committed
3371
   *
Mark Otto's avatar
dist    
Mark Otto committed
3372
3373
3374
   * Usually you don't want to override the `order`, `fn` and `onLoad` props.
   * All the other properties are configurations that could be tweaked.
   * @namespace modifiers
Mark Otto's avatar
dist  
Mark Otto committed
3375
   */
Mark Otto's avatar
dist    
Mark Otto committed
3376
  var modifiers = {
Mark Otto's avatar
dist  
Mark Otto committed
3377
    /**
Mark Otto's avatar
dist    
Mark Otto committed
3378
3379
3380
3381
3382
3383
     * Modifier used to shift the popper on the start or end of its reference
     * element.<br />
     * It will read the variation of the `placement` property.<br />
     * It can be one either `-end` or `-start`.
     * @memberof modifiers
     * @inner
Mark Otto's avatar
dist  
Mark Otto committed
3384
     */
Mark Otto's avatar
dist    
Mark Otto committed
3385
3386
3387
3388
3389
3390
3391
3392
3393
    shift: {
      /** @prop {number} order=100 - Index used to define the order of execution */
      order: 100,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: shift
    },

Mark Otto's avatar
dist  
Mark Otto committed
3394
    /**
Mark Otto's avatar
dist    
Mark Otto committed
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
     * The `offset` modifier can shift your popper on both its axis.
     *
     * It accepts the following units:
     * - `px` or unitless, interpreted as pixels
     * - `%` or `%r`, percentage relative to the length of the reference element
     * - `%p`, percentage relative to the length of the popper element
     * - `vw`, CSS viewport width unit
     * - `vh`, CSS viewport height unit
     *
     * For length is intended the main axis relative to the placement of the popper.<br />
     * This means that if the placement is `top` or `bottom`, the length will be the
     * `width`. In case of `left` or `right`, it will be the height.
     *
     * You can provide a single value (as `Number` or `String`), or a pair of values
     * as `String` divided by a comma or one (or more) white spaces.<br />
     * The latter is a deprecated method because it leads to confusion and will be
     * removed in v2.<br />
     * Additionally, it accepts additions and subtractions between different units.
     * Note that multiplications and divisions aren't supported.
     *
     * Valid examples are:
     * ```
     * 10
     * '10%'
     * '10, 10'
     * '10%, 10'
     * '10 + 10%'
     * '10 - 5vh + 3%'
     * '-10px + 5vh, 5px - 6%'
     * ```
     * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
     * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
     * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)
     *
     * @memberof modifiers
     * @inner
Mark Otto's avatar
dist  
Mark Otto committed
3431
     */
Mark Otto's avatar
dist    
Mark Otto committed
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
    offset: {
      /** @prop {number} order=200 - Index used to define the order of execution */
      order: 200,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: offset,
      /** @prop {Number|String} offset=0
       * The offset value as described in the modifier description
       */
      offset: 0
    },

Mark Otto's avatar
dist  
Mark Otto committed
3445
    /**
Mark Otto's avatar
dist    
Mark Otto committed
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
     * Modifier used to prevent the popper from being positioned outside the boundary.
     *
     * An scenario exists where the reference itself is not within the boundaries.<br />
     * We can say it has "escaped the boundaries" — or just "escaped".<br />
     * In this case we need to decide whether the popper should either:
     *
     * - detach from the reference and remain "trapped" in the boundaries, or
     * - if it should ignore the boundary and "escape with its reference"
     *
     * When `escapeWithReference` is set to`true` and reference is completely
     * outside its boundaries, the popper will overflow (or completely leave)
     * the boundaries in order to remain attached to the edge of the reference.
     *
     * @memberof modifiers
     * @inner
Mark Otto's avatar
dist  
Mark Otto committed
3461
     */
Mark Otto's avatar
dist    
Mark Otto committed
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
    preventOverflow: {
      /** @prop {number} order=300 - Index used to define the order of execution */
      order: 300,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: preventOverflow,
      /**
       * @prop {Array} [priority=['left','right','top','bottom']]
       * Popper will try to prevent overflow following these priorities by default,
       * then, it could overflow on the left and on top of the `boundariesElement`
       */
      priority: ['left', 'right', 'top', 'bottom'],
      /**
       * @prop {number} padding=5
       * Amount of pixel used to define a minimum distance between the boundaries
       * and the popper this makes sure the popper has always a little padding
       * between the edges of its container
       */
      padding: 5,
      /**
       * @prop {String|HTMLElement} boundariesElement='scrollParent'
       * Boundaries used by the modifier, can be `scrollParent`, `window`,
       * `viewport` or any DOM element.
       */
      boundariesElement: 'scrollParent'
    },
Mark Otto's avatar
dist  
Mark Otto committed
3489
3490

    /**
Mark Otto's avatar
dist    
Mark Otto committed
3491
3492
3493
3494
3495
3496
3497
     * Modifier used to make sure the reference and its popper stay near eachothers
     * without leaving any gap between the two. Expecially useful when the arrow is
     * enabled and you want to assure it to point to its reference element.
     * It cares only about the first axis, you can still have poppers with margin
     * between the popper and its reference element.
     * @memberof modifiers
     * @inner
Mark Otto's avatar
dist  
Mark Otto committed
3498
     */
Mark Otto's avatar
dist    
Mark Otto committed
3499
3500
3501
3502
3503
3504
3505
3506
    keepTogether: {
      /** @prop {number} order=400 - Index used to define the order of execution */
      order: 400,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: keepTogether
    },
Mark Otto's avatar
dist  
Mark Otto committed
3507

Mark Otto's avatar
dist    
Mark Otto committed
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
    /**
     * This modifier is used to move the `arrowElement` of the popper to make
     * sure it is positioned between the reference element and its popper element.
     * It will read the outer size of the `arrowElement` node to detect how many
     * pixels of conjuction are needed.
     *
     * It has no effect if no `arrowElement` is provided.
     * @memberof modifiers
     * @inner
     */
    arrow: {
      /** @prop {number} order=500 - Index used to define the order of execution */
      order: 500,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: arrow,
      /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
      element: '[x-arrow]'
    },
Mark Otto's avatar
dist  
Mark Otto committed
3528

Mark Otto's avatar
dist    
Mark Otto committed
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
    /**
     * Modifier used to flip the popper's placement when it starts to overlap its
     * reference element.
     *
     * Requires the `preventOverflow` modifier before it in order to work.
     *
     * **NOTE:** this modifier will interrupt the current update cycle and will
     * restart it if it detects the need to flip the placement.
     * @memberof modifiers
     * @inner
     */
    flip: {
      /** @prop {number} order=600 - Index used to define the order of execution */
      order: 600,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: flip,
      /**
       * @prop {String|Array} behavior='flip'
       * The behavior used to change the popper's placement. It can be one of
       * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
       * placements (with optional variations).
       */
      behavior: 'flip',
      /**
       * @prop {number} padding=5
       * The popper will flip if it hits the edges of the `boundariesElement`
       */
      padding: 5,
      /**
       * @prop {String|HTMLElement} boundariesElement='viewport'
       * The element which will define the boundaries of the popper position,
       * the popper will never be placed outside of the defined boundaries
       * (except if keepTogether is enabled)
       */
      boundariesElement: 'viewport'
    },

    /**
     * Modifier used to make the popper flow toward the inner of the reference element.
     * By default, when this modifier is disabled, the popper will be placed outside
     * the reference element.
     * @memberof modifiers
     * @inner
     */
    inner: {
      /** @prop {number} order=700 - Index used to define the order of execution */
      order: 700,
      /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
      enabled: false,
      /** @prop {ModifierFn} */
      fn: inner
    },

    /**
     * Modifier used to hide the popper when its reference element is outside of the
     * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
     * be used to hide with a CSS selector the popper when its reference is
     * out of boundaries.
     *
     * Requires the `preventOverflow` modifier before it in order to work.
     * @memberof modifiers
     * @inner
     */
    hide: {
      /** @prop {number} order=800 - Index used to define the order of execution */
      order: 800,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: hide
    },

    /**
     * Computes the style that will be applied to the popper element to gets
     * properly positioned.
     *
     * Note that this modifier will not touch the DOM, it just prepares the styles
     * so that `applyStyle` modifier can apply it. This separation is useful
     * in case you need to replace `applyStyle` with a custom implementation.
     *
     * This modifier has `850` as `order` value to maintain backward compatibility
     * with previous versions of Popper.js. Expect the modifiers ordering method
     * to change in future major versions of the library.
     *
     * @memberof modifiers
     * @inner
     */
    computeStyle: {
      /** @prop {number} order=850 - Index used to define the order of execution */
      order: 850,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: computeStyle,
      /**
       * @prop {Boolean} gpuAcceleration=true
       * If true, it uses the CSS 3d transformation to position the popper.
       * Otherwise, it will use the `top` and `left` properties.
       */
      gpuAcceleration: true,
      /**
       * @prop {string} [x='bottom']
       * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
       * Change this if your popper should grow in a direction different from `bottom`
       */
      x: 'bottom',
      /**
       * @prop {string} [x='left']
       * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
       * Change this if your popper should grow in a direction different from `right`
       */
      y: 'right'
    },

    /**
     * Applies the computed styles to the popper element.
     *
     * All the DOM manipulations are limited to this modifier. This is useful in case
     * you want to integrate Popper.js inside a framework or view library and you
     * want to delegate all the DOM manipulations to it.
     *
     * Note that if you disable this modifier, you must make sure the popper element
     * has its position set to `absolute` before Popper.js can do its work!
     *
     * Just disable this modifier and define you own to achieve the desired effect.
     *
     * @memberof modifiers
     * @inner
     */
    applyStyle: {
      /** @prop {number} order=900 - Index used to define the order of execution */
      order: 900,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: applyStyle,
      /** @prop {Function} */
      onLoad: applyStyleOnLoad,
      /**
       * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
       * @prop {Boolean} gpuAcceleration=true
       * If true, it uses the CSS 3d transformation to position the popper.
       * Otherwise, it will use the `top` and `left` properties.
       */
      gpuAcceleration: undefined
    }
  };
Mark Otto's avatar
dist  
Mark Otto committed
3678
3679

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
   * The `dataObject` is an object containing all the informations used by Popper.js
   * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
   * @name dataObject
   * @property {Object} data.instance The Popper.js instance
   * @property {String} data.placement Placement applied to popper
   * @property {String} data.originalPlacement Placement originally defined on init
   * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
   * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.
   * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
   * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)
   * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)
   * @property {Object} data.boundaries Offsets of the popper boundaries
   * @property {Object} data.offsets The measurements of popper, reference and arrow elements.
   * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
   * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
   * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
Mark Otto's avatar
dist  
Mark Otto committed
3696
3697
3698
   */

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
   * Default options provided to Popper.js constructor.<br />
   * These can be overriden using the `options` argument of Popper.js.<br />
   * To override an option, simply pass as 3rd argument an object with the same
   * structure of this object, example:
   * ```
   * new Popper(ref, pop, {
   *   modifiers: {
   *     preventOverflow: { enabled: false }
   *   }
   * })
   * ```
   * @type {Object}
   * @static
   * @memberof Popper
Mark Otto's avatar
dist  
Mark Otto committed
3713
   */
Mark Otto's avatar
dist    
Mark Otto committed
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
  var Defaults = {
    /**
     * Popper's placement
     * @prop {Popper.placements} placement='bottom'
     */
    placement: 'bottom',

    /**
     * Set this to true if you want popper to position it self in 'fixed' mode
     * @prop {Boolean} positionFixed=false
     */
    positionFixed: false,

    /**
     * Whether events (resize, scroll) are initially enabled
     * @prop {Boolean} eventsEnabled=true
     */
    eventsEnabled: true,

    /**
     * Set to true if you want to automatically remove the popper when
     * you call the `destroy` method.
     * @prop {Boolean} removeOnDestroy=false
     */
    removeOnDestroy: false,

    /**
     * Callback called when the popper is created.<br />
     * By default, is set to no-op.<br />
     * Access Popper.js instance with `data.instance`.
     * @prop {onCreate}
     */
    onCreate: function onCreate() {},

    /**
     * Callback called when the popper is updated, this callback is not called
     * on the initialization/creation of the popper, but only on subsequent
     * updates.<br />
     * By default, is set to no-op.<br />
     * Access Popper.js instance with `data.instance`.
     * @prop {onUpdate}
     */
    onUpdate: function onUpdate() {},

    /**
     * List of modifiers used to modify the offsets before they are applied to the popper.
     * They provide most of the functionalities of Popper.js
     * @prop {modifiers}
     */
    modifiers: modifiers
  };
Mark Otto's avatar
dist  
Mark Otto committed
3765
3766

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3767
3768
   * @callback onCreate
   * @param {dataObject} data
Mark Otto's avatar
dist  
Mark Otto committed
3769
   */
Mark Otto's avatar
dist    
Mark Otto committed
3770

Mark Otto's avatar
dist  
Mark Otto committed
3771
  /**
Mark Otto's avatar
dist    
Mark Otto committed
3772
3773
   * @callback onUpdate
   * @param {dataObject} data
Mark Otto's avatar
dist  
Mark Otto committed
3774
3775
   */

Mark Otto's avatar
dist    
Mark Otto committed
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
  // Utils
  // Methods
  var Popper = function () {
    /**
     * Create a new Popper.js instance
     * @class Popper
     * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
     * @param {HTMLElement} popper - The HTML element used as popper.
     * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
     * @return {Object} instance - The generated Popper.js instance
     */
    function Popper(reference, popper) {
      var _this = this;

      var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
      classCallCheck(this, Popper);
Mark Otto's avatar
dist  
Mark Otto committed
3792

Mark Otto's avatar
dist    
Mark Otto committed
3793
3794
3795
      this.scheduleUpdate = function () {
        return requestAnimationFrame(_this.update);
      };
Mark Otto's avatar
dist  
Mark Otto committed
3796

Mark Otto's avatar
dist    
Mark Otto committed
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
      // make update() debounced, so that it only runs at most once-per-tick
      this.update = debounce(this.update.bind(this));

      // with {} we create a new object with the options inside it
      this.options = _extends({}, Popper.Defaults, options);

      // init state
      this.state = {
        isDestroyed: false,
        isCreated: false,
        scrollParents: []
      };
Mark Otto's avatar
dist  
Mark Otto committed
3809

Mark Otto's avatar
dist    
Mark Otto committed
3810
3811
3812
      // get reference and popper elements (allow jQuery wrappers)
      this.reference = reference && reference.jquery ? reference[0] : reference;
      this.popper = popper && popper.jquery ? popper[0] : popper;
Mark Otto's avatar
dist  
Mark Otto committed
3813

Mark Otto's avatar
dist    
Mark Otto committed
3814
3815
3816
3817
3818
      // Deep merge modifiers options
      this.options.modifiers = {};
      Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
        _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
      });
Mark Otto's avatar
dist  
Mark Otto committed
3819

Mark Otto's avatar
dist    
Mark Otto committed
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
      // Refactoring modifiers' list (Object => Array)
      this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
        return _extends({
          name: name
        }, _this.options.modifiers[name]);
      })
      // sort the modifiers by order
      .sort(function (a, b) {
        return a.order - b.order;
      });
Mark Otto's avatar
dist  
Mark Otto committed
3830

Mark Otto's avatar
dist    
Mark Otto committed
3831
3832
3833
3834
3835
3836
3837
3838
3839
      // modifiers have the ability to execute arbitrary code when Popper.js get inited
      // such code is executed in the same order of its modifier
      // they could add new properties to their options configuration
      // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
      this.modifiers.forEach(function (modifierOptions) {
        if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
          modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
        }
      });
Mark Otto's avatar
dist  
Mark Otto committed
3840

Mark Otto's avatar
dist    
Mark Otto committed
3841
3842
      // fire the first update to position the popper in the right place
      this.update();
Mark Otto's avatar
dist  
Mark Otto committed
3843

Mark Otto's avatar
dist    
Mark Otto committed
3844
3845
3846
3847
      var eventsEnabled = this.options.eventsEnabled;
      if (eventsEnabled) {
        // setup event listeners, they will take care of update the position in specific situations
        this.enableEventListeners();
Mark Otto's avatar
dist  
Mark Otto committed
3848
3849
      }

Mark Otto's avatar
dist    
Mark Otto committed
3850
      this.state.eventsEnabled = eventsEnabled;
Mark Otto's avatar
dist  
Mark Otto committed
3851
3852
    }

Mark Otto's avatar
dist    
Mark Otto committed
3853
3854
    // We can't use class properties because they don't get listed in the
    // class prototype and break stuff like Sinon stubs
Mark Otto's avatar
dist  
Mark Otto committed
3855
3856


Mark Otto's avatar
dist    
Mark Otto committed
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
    createClass(Popper, [{
      key: 'update',
      value: function update$$1() {
        return update.call(this);
      }
    }, {
      key: 'destroy',
      value: function destroy$$1() {
        return destroy.call(this);
      }
    }, {
      key: 'enableEventListeners',
      value: function enableEventListeners$$1() {
        return enableEventListeners.call(this);
      }
    }, {
      key: 'disableEventListeners',
      value: function disableEventListeners$$1() {
        return disableEventListeners.call(this);
      }
Mark Otto's avatar
dist  
Mark Otto committed
3877

Mark Otto's avatar
dist    
Mark Otto committed
3878
3879
3880
3881
3882
      /**
       * Schedule an update, it will run on the next UI update available
       * @method scheduleUpdate
       * @memberof Popper
       */
Mark Otto's avatar
dist  
Mark Otto committed
3883
3884


Mark Otto's avatar
dist    
Mark Otto committed
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
      /**
       * Collection of utilities useful when writing custom modifiers.
       * Starting from version 1.7, this method is available only if you
       * include `popper-utils.js` before `popper.js`.
       *
       * **DEPRECATION**: This way to access PopperUtils is deprecated
       * and will be removed in v2! Use the PopperUtils module directly instead.
       * Due to the high instability of the methods contained in Utils, we can't
       * guarantee them to follow semver. Use them at your own risk!
       * @static
       * @private
       * @type {Object}
       * @deprecated since version 1.8
       * @member Utils
       * @memberof Popper
       */
Mark Otto's avatar
dist  
Mark Otto committed
3901

Mark Otto's avatar
dist    
Mark Otto committed
3902
3903
3904
    }]);
    return Popper;
  }();
Mark Otto's avatar
dist  
Mark Otto committed
3905
3906

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
   * The `referenceObject` is an object that provides an interface compatible with Popper.js
   * and lets you use it as replacement of a real DOM node.<br />
   * You can use this method to position a popper relatively to a set of coordinates
   * in case you don't have a DOM node to use as reference.
   *
   * ```
   * new Popper(referenceObject, popperNode);
   * ```
   *
   * NB: This feature isn't supported in Internet Explorer 10
   * @name referenceObject
   * @property {Function} data.getBoundingClientRect
   * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
   * @property {number} data.clientWidth
   * An ES6 getter that will return the width of the virtual reference element.
   * @property {number} data.clientHeight
   * An ES6 getter that will return the height of the virtual reference element.
Mark Otto's avatar
dist  
Mark Otto committed
3924
   */
Mark Otto's avatar
dist    
Mark Otto committed
3925
3926
3927
3928
3929
3930
3931
3932


  Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  Popper.placements = placements;
  Popper.Defaults = Defaults;

  /**
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
3933
   * Bootstrap (v4.1.3): dropdown.js
Mark Otto's avatar
dist    
Mark Otto committed
3934
3935
3936
3937
3938
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
   */

  var Dropdown = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
3939
3940
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
3941
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
3942
3943
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
3944
    var NAME = 'dropdown';
Mark Otto's avatar
Mark Otto committed
3945
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
    var DATA_KEY = 'bs.dropdown';
    var EVENT_KEY = "." + DATA_KEY;
    var DATA_API_KEY = '.data-api';
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key

    var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key

    var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key

    var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key

    var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key

    var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)

    var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
    var Event = {
      HIDE: "hide" + EVENT_KEY,
      HIDDEN: "hidden" + EVENT_KEY,
      SHOW: "show" + EVENT_KEY,
      SHOWN: "shown" + EVENT_KEY,
      CLICK: "click" + EVENT_KEY,
      CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
      KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY,
      KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY
    };
    var ClassName = {
      DISABLED: 'disabled',
      SHOW: 'show',
      DROPUP: 'dropup',
      DROPRIGHT: 'dropright',
      DROPLEFT: 'dropleft',
      MENURIGHT: 'dropdown-menu-right',
      MENULEFT: 'dropdown-menu-left',
      POSITION_STATIC: 'position-static'
    };
    var Selector = {
      DATA_TOGGLE: '[data-toggle="dropdown"]',
      FORM_CHILD: '.dropdown form',
      MENU: '.dropdown-menu',
      NAVBAR_NAV: '.navbar-nav',
      VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
    };
    var AttachmentMap = {
      TOP: 'top-start',
      TOPEND: 'top-end',
      BOTTOM: 'bottom-start',
      BOTTOMEND: 'bottom-end',
      RIGHT: 'right-start',
      RIGHTEND: 'right-end',
      LEFT: 'left-start',
      LEFTEND: 'left-end'
    };
    var Default = {
      offset: 0,
      flip: true,
      boundary: 'scrollParent',
      reference: 'toggle',
      display: 'dynamic'
    };
    var DefaultType = {
      offset: '(number|string|function)',
      flip: 'boolean',
      boundary: '(string|element)',
      reference: '(string|element)',
      display: 'string'
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
4018

Mark Otto's avatar
dist    
Mark Otto committed
4019
    };
Mark Otto's avatar
dist  
Mark Otto committed
4020

Mark Otto's avatar
dist    
Mark Otto committed
4021
4022
4023
4024
4025
4026
4027
4028
4029
    var Dropdown =
    /*#__PURE__*/
    function () {
      function Dropdown(element, config) {
        this._element = element;
        this._popper = null;
        this._config = this._getConfig(config);
        this._menu = this._getMenuElement();
        this._inNavbar = this._detectNavbar();
Mark Otto's avatar
dist  
Mark Otto committed
4030

Mark Otto's avatar
dist    
Mark Otto committed
4031
4032
        this._addEventListeners();
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
4033
4034


Mark Otto's avatar
dist    
Mark Otto committed
4035
      var _proto = Dropdown.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
4036

Mark Otto's avatar
dist    
Mark Otto committed
4037
4038
4039
4040
4041
4042
4043
      // Public
      _proto.toggle = function toggle() {
        if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) {
          return;
        }

        var parent = Dropdown._getParentFromElement(this._element);
Mark Otto's avatar
dist  
Mark Otto committed
4044

Mark Otto's avatar
dist    
Mark Otto committed
4045
        var isActive = $$$1(this._menu).hasClass(ClassName.SHOW);
Mark Otto's avatar
dist    
Mark Otto committed
4046

Mark Otto's avatar
dist    
Mark Otto committed
4047
        Dropdown._clearMenus();
Mark Otto's avatar
dist  
Mark Otto committed
4048

Mark Otto's avatar
dist    
Mark Otto committed
4049
4050
4051
        if (isActive) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4052

Mark Otto's avatar
dist    
Mark Otto committed
4053
4054
4055
4056
4057
        var relatedTarget = {
          relatedTarget: this._element
        };
        var showEvent = $$$1.Event(Event.SHOW, relatedTarget);
        $$$1(parent).trigger(showEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4058

Mark Otto's avatar
dist    
Mark Otto committed
4059
4060
4061
        if (showEvent.isDefaultPrevented()) {
          return;
        } // Disable totally Popper.js for Dropdown in Navbar
Mark Otto's avatar
dist  
Mark Otto committed
4062

Mark Otto's avatar
dist    
Mark Otto committed
4063

Mark Otto's avatar
dist    
Mark Otto committed
4064
4065
4066
4067
4068
4069
4070
4071
        if (!this._inNavbar) {
          /**
           * Check for Popper dependency
           * Popper - https://popper.js.org
           */
          if (typeof Popper === 'undefined') {
            throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
          }
Mark Otto's avatar
dist    
Mark Otto committed
4072

Mark Otto's avatar
dist    
Mark Otto committed
4073
4074
4075
4076
4077
4078
          var referenceElement = this._element;

          if (this._config.reference === 'parent') {
            referenceElement = parent;
          } else if (Util.isElement(this._config.reference)) {
            referenceElement = this._config.reference; // Check if it's jQuery element
Mark Otto's avatar
dist  
Mark Otto committed
4079

Mark Otto's avatar
dist    
Mark Otto committed
4080
4081
4082
4083
4084
4085
            if (typeof this._config.reference.jquery !== 'undefined') {
              referenceElement = this._config.reference[0];
            }
          } // If boundary is not `scrollParent`, then set position to `static`
          // to allow the menu to "escape" the scroll parent's boundaries
          // https://github.com/twbs/bootstrap/issues/24251
Mark Otto's avatar
dist    
Mark Otto committed
4086

Mark Otto's avatar
dist    
Mark Otto committed
4087

Mark Otto's avatar
dist    
Mark Otto committed
4088
4089
          if (this._config.boundary !== 'scrollParent') {
            $$$1(parent).addClass(ClassName.POSITION_STATIC);
Mark Otto's avatar
dist    
Mark Otto committed
4090
          }
Mark Otto's avatar
dist    
Mark Otto committed
4091
4092
4093
4094
4095
4096

          this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
        } // If this is a touch-enabled device we add extra
        // empty mouseover listeners to the body's immediate children;
        // only needed because of broken event delegation on iOS
        // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
Mark Otto's avatar
dist    
Mark Otto committed
4097
4098


Mark Otto's avatar
dist    
Mark Otto committed
4099
4100
        if ('ontouchstart' in document.documentElement && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) {
          $$$1(document.body).children().on('mouseover', null, $$$1.noop);
Mark Otto's avatar
dist  
Mark Otto committed
4101
4102
        }

Mark Otto's avatar
dist    
Mark Otto committed
4103
        this._element.focus();
Mark Otto's avatar
dist    
Mark Otto committed
4104

Mark Otto's avatar
dist    
Mark Otto committed
4105
        this._element.setAttribute('aria-expanded', true);
Mark Otto's avatar
dist    
Mark Otto committed
4106

Mark Otto's avatar
dist    
Mark Otto committed
4107
4108
4109
        $$$1(this._menu).toggleClass(ClassName.SHOW);
        $$$1(parent).toggleClass(ClassName.SHOW).trigger($$$1.Event(Event.SHOWN, relatedTarget));
      };
Mark Otto's avatar
dist  
Mark Otto committed
4110

Mark Otto's avatar
dist    
Mark Otto committed
4111
4112
4113
4114
4115
      _proto.dispose = function dispose() {
        $$$1.removeData(this._element, DATA_KEY);
        $$$1(this._element).off(EVENT_KEY);
        this._element = null;
        this._menu = null;
Mark Otto's avatar
dist    
Mark Otto committed
4116

Mark Otto's avatar
dist    
Mark Otto committed
4117
4118
        if (this._popper !== null) {
          this._popper.destroy();
Mark Otto's avatar
dist  
Mark Otto committed
4119

Mark Otto's avatar
dist    
Mark Otto committed
4120
4121
4122
          this._popper = null;
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
4123

Mark Otto's avatar
dist    
Mark Otto committed
4124
4125
      _proto.update = function update() {
        this._inNavbar = this._detectNavbar();
Mark Otto's avatar
dist    
Mark Otto committed
4126

Mark Otto's avatar
dist    
Mark Otto committed
4127
4128
4129
4130
        if (this._popper !== null) {
          this._popper.scheduleUpdate();
        }
      }; // Private
Mark Otto's avatar
dist    
Mark Otto committed
4131

Mark Otto's avatar
dist  
Mark Otto committed
4132

Mark Otto's avatar
dist    
Mark Otto committed
4133
4134
      _proto._addEventListeners = function _addEventListeners() {
        var _this = this;
Mark Otto's avatar
dist    
Mark Otto committed
4135

Mark Otto's avatar
dist    
Mark Otto committed
4136
4137
4138
        $$$1(this._element).on(Event.CLICK, function (event) {
          event.preventDefault();
          event.stopPropagation();
Mark Otto's avatar
dist  
Mark Otto committed
4139

Mark Otto's avatar
dist    
Mark Otto committed
4140
4141
4142
          _this.toggle();
        });
      };
Mark Otto's avatar
dist  
Mark Otto committed
4143

Mark Otto's avatar
dist    
Mark Otto committed
4144
4145
4146
4147
4148
      _proto._getConfig = function _getConfig(config) {
        config = _objectSpread({}, this.constructor.Default, $$$1(this._element).data(), config);
        Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
        return config;
      };
Mark Otto's avatar
dist  
Mark Otto committed
4149

Mark Otto's avatar
dist    
Mark Otto committed
4150
4151
4152
      _proto._getMenuElement = function _getMenuElement() {
        if (!this._menu) {
          var parent = Dropdown._getParentFromElement(this._element);
Mark Otto's avatar
dist    
Mark Otto committed
4153

Mark Otto's avatar
dist    
Mark Otto committed
4154
4155
4156
          if (parent) {
            this._menu = parent.querySelector(Selector.MENU);
          }
Mark Otto's avatar
dist    
Mark Otto committed
4157
        }
Mark Otto's avatar
dist  
Mark Otto committed
4158

Mark Otto's avatar
dist    
Mark Otto committed
4159
4160
        return this._menu;
      };
Mark Otto's avatar
dist  
Mark Otto committed
4161

Mark Otto's avatar
dist    
Mark Otto committed
4162
      _proto._getPlacement = function _getPlacement() {
Mark Otto's avatar
dist    
Mark Otto committed
4163
        var $parentDropdown = $$$1(this._element.parentNode);
Mark Otto's avatar
dist    
Mark Otto committed
4164
        var placement = AttachmentMap.BOTTOM; // Handle dropup
Mark Otto's avatar
dist    
Mark Otto committed
4165

Mark Otto's avatar
dist    
Mark Otto committed
4166
4167
        if ($parentDropdown.hasClass(ClassName.DROPUP)) {
          placement = AttachmentMap.TOP;
Mark Otto's avatar
dist    
Mark Otto committed
4168

Mark Otto's avatar
dist    
Mark Otto committed
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
          if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
            placement = AttachmentMap.TOPEND;
          }
        } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
          placement = AttachmentMap.RIGHT;
        } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
          placement = AttachmentMap.LEFT;
        } else if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
          placement = AttachmentMap.BOTTOMEND;
        }

        return placement;
      };

      _proto._detectNavbar = function _detectNavbar() {
        return $$$1(this._element).closest('.navbar').length > 0;
      };
Mark Otto's avatar
dist  
Mark Otto committed
4186

Mark Otto's avatar
dist    
Mark Otto committed
4187
4188
      _proto._getPopperConfig = function _getPopperConfig() {
        var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4189

Mark Otto's avatar
dist    
Mark Otto committed
4190
        var offsetConf = {};
Mark Otto's avatar
dist    
Mark Otto committed
4191

Mark Otto's avatar
dist    
Mark Otto committed
4192
4193
4194
4195
4196
4197
4198
        if (typeof this._config.offset === 'function') {
          offsetConf.fn = function (data) {
            data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
            return data;
          };
        } else {
          offsetConf.offset = this._config.offset;
Mark Otto's avatar
dist  
Mark Otto committed
4199
        }
Mark Otto's avatar
dist    
Mark Otto committed
4200

Mark Otto's avatar
dist    
Mark Otto committed
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
        var popperConfig = {
          placement: this._getPlacement(),
          modifiers: {
            offset: offsetConf,
            flip: {
              enabled: this._config.flip
            },
            preventOverflow: {
              boundariesElement: this._config.boundary
            }
          } // Disable Popper.js if we have a static display
Mark Otto's avatar
dist  
Mark Otto committed
4212

Mark Otto's avatar
dist    
Mark Otto committed
4213
        };
Mark Otto's avatar
dist  
Mark Otto committed
4214

Mark Otto's avatar
dist    
Mark Otto committed
4215
4216
4217
4218
4219
        if (this._config.display === 'static') {
          popperConfig.modifiers.applyStyle = {
            enabled: false
          };
        }
Mark Otto's avatar
dist    
Mark Otto committed
4220

Mark Otto's avatar
dist    
Mark Otto committed
4221
4222
        return popperConfig;
      }; // Static
Mark Otto's avatar
dist    
Mark Otto committed
4223
4224


Mark Otto's avatar
dist    
Mark Otto committed
4225
4226
4227
4228
4229
4230
4231
4232
4233
      Dropdown._jQueryInterface = function _jQueryInterface(config) {
        return this.each(function () {
          var data = $$$1(this).data(DATA_KEY);

          var _config = typeof config === 'object' ? config : null;

          if (!data) {
            data = new Dropdown(this, _config);
            $$$1(this).data(DATA_KEY, data);
Mark Otto's avatar
dist  
Mark Otto committed
4234
          }
Mark Otto's avatar
dist    
Mark Otto committed
4235

Mark Otto's avatar
dist    
Mark Otto committed
4236
4237
4238
4239
4240
4241
4242
4243
          if (typeof config === 'string') {
            if (typeof data[config] === 'undefined') {
              throw new TypeError("No method named \"" + config + "\"");
            }

            data[config]();
          }
        });
Mark Otto's avatar
dist    
Mark Otto committed
4244
      };
Mark Otto's avatar
dist    
Mark Otto committed
4245

Mark Otto's avatar
dist    
Mark Otto committed
4246
4247
4248
4249
      Dropdown._clearMenus = function _clearMenus(event) {
        if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
          return;
        }
Mark Otto's avatar
dist    
Mark Otto committed
4250

Mark Otto's avatar
dist    
Mark Otto committed
4251
        var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
Mark Otto's avatar
dist  
Mark Otto committed
4252

Mark Otto's avatar
dist    
Mark Otto committed
4253
        for (var i = 0, len = toggles.length; i < len; i++) {
Mark Otto's avatar
dist    
Mark Otto committed
4254
          var parent = Dropdown._getParentFromElement(toggles[i]);
Mark Otto's avatar
dist  
Mark Otto committed
4255

Mark Otto's avatar
dist    
Mark Otto committed
4256
4257
4258
4259
          var context = $$$1(toggles[i]).data(DATA_KEY);
          var relatedTarget = {
            relatedTarget: toggles[i]
          };
Mark Otto's avatar
dist    
Mark Otto committed
4260

Mark Otto's avatar
dist    
Mark Otto committed
4261
4262
4263
4264
          if (event && event.type === 'click') {
            relatedTarget.clickEvent = event;
          }

Mark Otto's avatar
dist    
Mark Otto committed
4265
4266
4267
          if (!context) {
            continue;
          }
Mark Otto's avatar
dist  
Mark Otto committed
4268

Mark Otto's avatar
dist    
Mark Otto committed
4269
          var dropdownMenu = context._menu;
Mark Otto's avatar
dist  
Mark Otto committed
4270

Mark Otto's avatar
dist    
Mark Otto committed
4271
4272
          if (!$$$1(parent).hasClass(ClassName.SHOW)) {
            continue;
Mark Otto's avatar
dist  
Mark Otto committed
4273
          }
Mark Otto's avatar
dist    
Mark Otto committed
4274

Mark Otto's avatar
dist    
Mark Otto committed
4275
4276
4277
          if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) {
            continue;
          }
Mark Otto's avatar
dist  
Mark Otto committed
4278

Mark Otto's avatar
dist    
Mark Otto committed
4279
4280
          var hideEvent = $$$1.Event(Event.HIDE, relatedTarget);
          $$$1(parent).trigger(hideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4281

Mark Otto's avatar
dist    
Mark Otto committed
4282
4283
4284
4285
          if (hideEvent.isDefaultPrevented()) {
            continue;
          } // If this is a touch-enabled device we remove the extra
          // empty mouseover listeners we added for iOS support
Mark Otto's avatar
dist    
Mark Otto committed
4286
4287


Mark Otto's avatar
dist    
Mark Otto committed
4288
4289
4290
          if ('ontouchstart' in document.documentElement) {
            $$$1(document.body).children().off('mouseover', null, $$$1.noop);
          }
Mark Otto's avatar
dist  
Mark Otto committed
4291

Mark Otto's avatar
dist    
Mark Otto committed
4292
4293
4294
          toggles[i].setAttribute('aria-expanded', 'false');
          $$$1(dropdownMenu).removeClass(ClassName.SHOW);
          $$$1(parent).removeClass(ClassName.SHOW).trigger($$$1.Event(Event.HIDDEN, relatedTarget));
Mark Otto's avatar
dist  
Mark Otto committed
4295
        }
Mark Otto's avatar
dist    
Mark Otto committed
4296
      };
Mark Otto's avatar
dist  
Mark Otto committed
4297

Mark Otto's avatar
dist    
Mark Otto committed
4298
4299
4300
      Dropdown._getParentFromElement = function _getParentFromElement(element) {
        var parent;
        var selector = Util.getSelectorFromElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
4301

Mark Otto's avatar
dist    
Mark Otto committed
4302
        if (selector) {
Mark Otto's avatar
dist    
Mark Otto committed
4303
          parent = document.querySelector(selector);
Mark Otto's avatar
dist  
Mark Otto committed
4304
4305
        }

Mark Otto's avatar
dist    
Mark Otto committed
4306
4307
        return parent || element.parentNode;
      }; // eslint-disable-next-line complexity
Mark Otto's avatar
dist  
Mark Otto committed
4308

Mark Otto's avatar
dist    
Mark Otto committed
4309

Mark Otto's avatar
dist    
Mark Otto committed
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
      Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
        // If not input/textarea:
        //  - And not a key in REGEXP_KEYDOWN => not a dropdown command
        // If input/textarea:
        //  - If space key => not a dropdown command
        //  - If key is other than escape
        //    - If key is not up or down => not a dropdown command
        //    - If trigger inside the menu => not a dropdown command
        if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $$$1(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
          return;
        }
Mark Otto's avatar
dist    
Mark Otto committed
4321

Mark Otto's avatar
dist    
Mark Otto committed
4322
4323
        event.preventDefault();
        event.stopPropagation();
Mark Otto's avatar
dist    
Mark Otto committed
4324

Mark Otto's avatar
dist    
Mark Otto committed
4325
4326
        if (this.disabled || $$$1(this).hasClass(ClassName.DISABLED)) {
          return;
Mark Otto's avatar
dist  
Mark Otto committed
4327
4328
        }

Mark Otto's avatar
dist    
Mark Otto committed
4329
        var parent = Dropdown._getParentFromElement(this);
Mark Otto's avatar
dist  
Mark Otto committed
4330

Mark Otto's avatar
dist    
Mark Otto committed
4331
        var isActive = $$$1(parent).hasClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
4332

Mark Otto's avatar
dist    
Mark Otto committed
4333
4334
        if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
          if (event.which === ESCAPE_KEYCODE) {
Mark Otto's avatar
dist    
Mark Otto committed
4335
            var toggle = parent.querySelector(Selector.DATA_TOGGLE);
Mark Otto's avatar
dist    
Mark Otto committed
4336
4337
            $$$1(toggle).trigger('focus');
          }
Mark Otto's avatar
dist    
Mark Otto committed
4338

Mark Otto's avatar
dist    
Mark Otto committed
4339
4340
4341
          $$$1(this).trigger('click');
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4342

Mark Otto's avatar
dist    
Mark Otto committed
4343
        var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS));
Mark Otto's avatar
dist  
Mark Otto committed
4344

Mark Otto's avatar
dist    
Mark Otto committed
4345
4346
4347
        if (items.length === 0) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4348

Mark Otto's avatar
dist    
Mark Otto committed
4349
        var index = items.indexOf(event.target);
Mark Otto's avatar
dist  
Mark Otto committed
4350

Mark Otto's avatar
dist    
Mark Otto committed
4351
4352
4353
4354
        if (event.which === ARROW_UP_KEYCODE && index > 0) {
          // Up
          index--;
        }
Mark Otto's avatar
dist    
Mark Otto committed
4355

Mark Otto's avatar
dist    
Mark Otto committed
4356
4357
4358
4359
        if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
          // Down
          index++;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4360

Mark Otto's avatar
dist    
Mark Otto committed
4361
4362
        if (index < 0) {
          index = 0;
Mark Otto's avatar
dist  
Mark Otto committed
4363
4364
        }

Mark Otto's avatar
dist    
Mark Otto committed
4365
4366
        items[index].focus();
      };
Mark Otto's avatar
dist  
Mark Otto committed
4367

Mark Otto's avatar
dist    
Mark Otto committed
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
      _createClass(Dropdown, null, [{
        key: "VERSION",
        get: function get() {
          return VERSION;
        }
      }, {
        key: "Default",
        get: function get() {
          return Default;
        }
      }, {
        key: "DefaultType",
        get: function get() {
          return DefaultType;
        }
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
4384

Mark Otto's avatar
dist    
Mark Otto committed
4385
4386
4387
4388
4389
4390
4391
      return Dropdown;
    }();
    /**
     * ------------------------------------------------------------------------
     * Data Api implementation
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
4392
4393


Mark Otto's avatar
dist    
Mark Otto committed
4394
4395
4396
    $$$1(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
      event.preventDefault();
      event.stopPropagation();
Mark Otto's avatar
dist  
Mark Otto committed
4397

Mark Otto's avatar
dist    
Mark Otto committed
4398
4399
4400
4401
4402
4403
4404
4405
4406
      Dropdown._jQueryInterface.call($$$1(this), 'toggle');
    }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
      e.stopPropagation();
    });
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
4407

Mark Otto's avatar
dist    
Mark Otto committed
4408
4409
    $$$1.fn[NAME] = Dropdown._jQueryInterface;
    $$$1.fn[NAME].Constructor = Dropdown;
Mark Otto's avatar
dist  
Mark Otto committed
4410

Mark Otto's avatar
dist    
Mark Otto committed
4411
4412
4413
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Dropdown._jQueryInterface;
Mark Otto's avatar
dist  
Mark Otto committed
4414
4415
4416
    };

    return Dropdown;
Mark Otto's avatar
dist    
Mark Otto committed
4417
  }($, Popper);
Mark Otto's avatar
dist    
Mark Otto committed
4418

Mark Otto's avatar
dist  
Mark Otto committed
4419
  /**
Mark Otto's avatar
dist    
Mark Otto committed
4420
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
4421
   * Bootstrap (v4.1.3): modal.js
Mark Otto's avatar
dist    
Mark Otto committed
4422
4423
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
4424
4425
   */

Mark Otto's avatar
dist    
Mark Otto committed
4426
  var Modal = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
4427
4428
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
4429
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
4430
4431
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
4432
    var NAME = 'modal';
Mark Otto's avatar
Mark Otto committed
4433
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
    var DATA_KEY = 'bs.modal';
    var EVENT_KEY = "." + DATA_KEY;
    var DATA_API_KEY = '.data-api';
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key

    var Default = {
      backdrop: true,
      keyboard: true,
      focus: true,
      show: true
    };
    var DefaultType = {
      backdrop: '(boolean|string)',
      keyboard: 'boolean',
      focus: 'boolean',
      show: 'boolean'
    };
    var Event = {
      HIDE: "hide" + EVENT_KEY,
      HIDDEN: "hidden" + EVENT_KEY,
      SHOW: "show" + EVENT_KEY,
      SHOWN: "shown" + EVENT_KEY,
      FOCUSIN: "focusin" + EVENT_KEY,
      RESIZE: "resize" + EVENT_KEY,
      CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
      KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY,
      MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY,
      MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY,
      CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
    };
    var ClassName = {
      SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
      BACKDROP: 'modal-backdrop',
      OPEN: 'modal-open',
      FADE: 'fade',
      SHOW: 'show'
    };
    var Selector = {
      DIALOG: '.modal-dialog',
      DATA_TOGGLE: '[data-toggle="modal"]',
      DATA_DISMISS: '[data-dismiss="modal"]',
      FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
Mark Otto's avatar
dist    
Mark Otto committed
4477
      STICKY_CONTENT: '.sticky-top'
Mark Otto's avatar
dist    
Mark Otto committed
4478
4479
4480
4481
4482
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
4483
4484
4485

    };

Mark Otto's avatar
dist    
Mark Otto committed
4486
4487
4488
4489
4490
4491
    var Modal =
    /*#__PURE__*/
    function () {
      function Modal(element, config) {
        this._config = this._getConfig(config);
        this._element = element;
Mark Otto's avatar
dist    
Mark Otto committed
4492
        this._dialog = element.querySelector(Selector.DIALOG);
Mark Otto's avatar
dist    
Mark Otto committed
4493
4494
4495
4496
4497
4498
        this._backdrop = null;
        this._isShown = false;
        this._isBodyOverflowing = false;
        this._ignoreBackdropClick = false;
        this._scrollbarWidth = 0;
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
4499
4500


Mark Otto's avatar
dist    
Mark Otto committed
4501
      var _proto = Modal.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
4502

Mark Otto's avatar
dist    
Mark Otto committed
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
      // Public
      _proto.toggle = function toggle(relatedTarget) {
        return this._isShown ? this.hide() : this.show(relatedTarget);
      };

      _proto.show = function show(relatedTarget) {
        var _this = this;

        if (this._isTransitioning || this._isShown) {
          return;
        }

        if ($$$1(this._element).hasClass(ClassName.FADE)) {
          this._isTransitioning = true;
        }

        var showEvent = $$$1.Event(Event.SHOW, {
          relatedTarget: relatedTarget
        });
        $$$1(this._element).trigger(showEvent);

        if (this._isShown || showEvent.isDefaultPrevented()) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4527

Mark Otto's avatar
dist    
Mark Otto committed
4528
        this._isShown = true;
Mark Otto's avatar
dist  
Mark Otto committed
4529

Mark Otto's avatar
dist    
Mark Otto committed
4530
        this._checkScrollbar();
Mark Otto's avatar
dist  
Mark Otto committed
4531

Mark Otto's avatar
dist    
Mark Otto committed
4532
        this._setScrollbar();
Mark Otto's avatar
dist    
Mark Otto committed
4533

Mark Otto's avatar
dist    
Mark Otto committed
4534
        this._adjustDialog();
Mark Otto's avatar
dist  
Mark Otto committed
4535

Mark Otto's avatar
dist    
Mark Otto committed
4536
        $$$1(document.body).addClass(ClassName.OPEN);
Mark Otto's avatar
dist  
Mark Otto committed
4537

Mark Otto's avatar
dist    
Mark Otto committed
4538
        this._setEscapeEvent();
Mark Otto's avatar
dist  
Mark Otto committed
4539

Mark Otto's avatar
dist    
Mark Otto committed
4540
        this._setResizeEvent();
Mark Otto's avatar
dist    
Mark Otto committed
4541

Mark Otto's avatar
dist    
Mark Otto committed
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
        $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
          return _this.hide(event);
        });
        $$$1(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
          $$$1(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
            if ($$$1(event.target).is(_this._element)) {
              _this._ignoreBackdropClick = true;
            }
          });
        });
Mark Otto's avatar
dist  
Mark Otto committed
4552

Mark Otto's avatar
dist    
Mark Otto committed
4553
4554
        this._showBackdrop(function () {
          return _this._showElement(relatedTarget);
Mark Otto's avatar
dist  
Mark Otto committed
4555
        });
Mark Otto's avatar
dist    
Mark Otto committed
4556
      };
Mark Otto's avatar
dist  
Mark Otto committed
4557

Mark Otto's avatar
dist    
Mark Otto committed
4558
4559
4560
4561
4562
4563
      _proto.hide = function hide(event) {
        var _this2 = this;

        if (event) {
          event.preventDefault();
        }
Mark Otto's avatar
dist  
Mark Otto committed
4564

Mark Otto's avatar
dist    
Mark Otto committed
4565
4566
4567
        if (this._isTransitioning || !this._isShown) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4568

Mark Otto's avatar
dist    
Mark Otto committed
4569
4570
        var hideEvent = $$$1.Event(Event.HIDE);
        $$$1(this._element).trigger(hideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4571

Mark Otto's avatar
dist    
Mark Otto committed
4572
4573
4574
        if (!this._isShown || hideEvent.isDefaultPrevented()) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4575

Mark Otto's avatar
dist    
Mark Otto committed
4576
4577
        this._isShown = false;
        var transition = $$$1(this._element).hasClass(ClassName.FADE);
Mark Otto's avatar
dist  
Mark Otto committed
4578

Mark Otto's avatar
dist    
Mark Otto committed
4579
4580
4581
        if (transition) {
          this._isTransitioning = true;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4582

Mark Otto's avatar
dist    
Mark Otto committed
4583
        this._setEscapeEvent();
Mark Otto's avatar
dist    
Mark Otto committed
4584

Mark Otto's avatar
dist    
Mark Otto committed
4585
        this._setResizeEvent();
Mark Otto's avatar
dist  
Mark Otto committed
4586

Mark Otto's avatar
dist    
Mark Otto committed
4587
4588
4589
4590
        $$$1(document).off(Event.FOCUSIN);
        $$$1(this._element).removeClass(ClassName.SHOW);
        $$$1(this._element).off(Event.CLICK_DISMISS);
        $$$1(this._dialog).off(Event.MOUSEDOWN_DISMISS);
Mark Otto's avatar
dist    
Mark Otto committed
4591

Mark Otto's avatar
dist    
Mark Otto committed
4592
4593
4594
4595
4596
4597
4598
4599
4600
        if (transition) {
          var transitionDuration = Util.getTransitionDurationFromElement(this._element);
          $$$1(this._element).one(Util.TRANSITION_END, function (event) {
            return _this2._hideModal(event);
          }).emulateTransitionEnd(transitionDuration);
        } else {
          this._hideModal();
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
4601

Mark Otto's avatar
dist    
Mark Otto committed
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
      _proto.dispose = function dispose() {
        $$$1.removeData(this._element, DATA_KEY);
        $$$1(window, document, this._element, this._backdrop).off(EVENT_KEY);
        this._config = null;
        this._element = null;
        this._dialog = null;
        this._backdrop = null;
        this._isShown = null;
        this._isBodyOverflowing = null;
        this._ignoreBackdropClick = null;
        this._scrollbarWidth = null;
      };
Mark Otto's avatar
dist  
Mark Otto committed
4614

Mark Otto's avatar
dist    
Mark Otto committed
4615
4616
4617
      _proto.handleUpdate = function handleUpdate() {
        this._adjustDialog();
      }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
4618
4619


Mark Otto's avatar
dist    
Mark Otto committed
4620
4621
4622
4623
4624
      _proto._getConfig = function _getConfig(config) {
        config = _objectSpread({}, Default, config);
        Util.typeCheckConfig(NAME, config, DefaultType);
        return config;
      };
Mark Otto's avatar
dist  
Mark Otto committed
4625

Mark Otto's avatar
dist    
Mark Otto committed
4626
4627
      _proto._showElement = function _showElement(relatedTarget) {
        var _this3 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4628

Mark Otto's avatar
dist    
Mark Otto committed
4629
        var transition = $$$1(this._element).hasClass(ClassName.FADE);
Mark Otto's avatar
dist  
Mark Otto committed
4630

Mark Otto's avatar
dist    
Mark Otto committed
4631
4632
4633
4634
        if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
          // Don't move modal's DOM position
          document.body.appendChild(this._element);
        }
Mark Otto's avatar
dist  
Mark Otto committed
4635

Mark Otto's avatar
dist    
Mark Otto committed
4636
        this._element.style.display = 'block';
Mark Otto's avatar
dist  
Mark Otto committed
4637

Mark Otto's avatar
dist    
Mark Otto committed
4638
        this._element.removeAttribute('aria-hidden');
Mark Otto's avatar
dist  
Mark Otto committed
4639

Mark Otto's avatar
dist    
Mark Otto committed
4640
        this._element.scrollTop = 0;
Mark Otto's avatar
dist    
Mark Otto committed
4641

Mark Otto's avatar
dist    
Mark Otto committed
4642
4643
4644
        if (transition) {
          Util.reflow(this._element);
        }
Mark Otto's avatar
dist    
Mark Otto committed
4645

Mark Otto's avatar
dist    
Mark Otto committed
4646
        $$$1(this._element).addClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
4647

Mark Otto's avatar
dist    
Mark Otto committed
4648
4649
4650
        if (this._config.focus) {
          this._enforceFocus();
        }
Mark Otto's avatar
dist  
Mark Otto committed
4651

Mark Otto's avatar
dist    
Mark Otto committed
4652
4653
4654
        var shownEvent = $$$1.Event(Event.SHOWN, {
          relatedTarget: relatedTarget
        });
Mark Otto's avatar
dist  
Mark Otto committed
4655

Mark Otto's avatar
dist    
Mark Otto committed
4656
4657
4658
4659
        var transitionComplete = function transitionComplete() {
          if (_this3._config.focus) {
            _this3._element.focus();
          }
Mark Otto's avatar
dist  
Mark Otto committed
4660

Mark Otto's avatar
dist    
Mark Otto committed
4661
4662
4663
          _this3._isTransitioning = false;
          $$$1(_this3._element).trigger(shownEvent);
        };
Mark Otto's avatar
dist  
Mark Otto committed
4664

Mark Otto's avatar
dist    
Mark Otto committed
4665
4666
4667
4668
4669
        if (transition) {
          var transitionDuration = Util.getTransitionDurationFromElement(this._element);
          $$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
        } else {
          transitionComplete();
Mark Otto's avatar
dist  
Mark Otto committed
4670
        }
Mark Otto's avatar
dist    
Mark Otto committed
4671
4672
4673
4674
      };

      _proto._enforceFocus = function _enforceFocus() {
        var _this4 = this;
Mark Otto's avatar
dist    
Mark Otto committed
4675

Mark Otto's avatar
dist    
Mark Otto committed
4676
4677
4678
4679
4680
4681
        $$$1(document).off(Event.FOCUSIN) // Guard against infinite focus loop
        .on(Event.FOCUSIN, function (event) {
          if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) {
            _this4._element.focus();
          }
        });
Mark Otto's avatar
dist  
Mark Otto committed
4682
4683
      };

Mark Otto's avatar
dist    
Mark Otto committed
4684
4685
      _proto._setEscapeEvent = function _setEscapeEvent() {
        var _this5 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4686

Mark Otto's avatar
dist    
Mark Otto committed
4687
4688
4689
4690
        if (this._isShown && this._config.keyboard) {
          $$$1(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
            if (event.which === ESCAPE_KEYCODE) {
              event.preventDefault();
Mark Otto's avatar
dist  
Mark Otto committed
4691

Mark Otto's avatar
dist    
Mark Otto committed
4692
4693
4694
4695
4696
              _this5.hide();
            }
          });
        } else if (!this._isShown) {
          $$$1(this._element).off(Event.KEYDOWN_DISMISS);
Mark Otto's avatar
dist  
Mark Otto committed
4697
        }
Mark Otto's avatar
dist    
Mark Otto committed
4698
      };
Mark Otto's avatar
dist  
Mark Otto committed
4699

Mark Otto's avatar
dist    
Mark Otto committed
4700
4701
      _proto._setResizeEvent = function _setResizeEvent() {
        var _this6 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4702

Mark Otto's avatar
dist    
Mark Otto committed
4703
4704
4705
4706
4707
4708
4709
4710
        if (this._isShown) {
          $$$1(window).on(Event.RESIZE, function (event) {
            return _this6.handleUpdate(event);
          });
        } else {
          $$$1(window).off(Event.RESIZE);
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
4711

Mark Otto's avatar
dist    
Mark Otto committed
4712
4713
      _proto._hideModal = function _hideModal() {
        var _this7 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4714

Mark Otto's avatar
dist    
Mark Otto committed
4715
        this._element.style.display = 'none';
Mark Otto's avatar
dist  
Mark Otto committed
4716

Mark Otto's avatar
dist    
Mark Otto committed
4717
        this._element.setAttribute('aria-hidden', true);
Mark Otto's avatar
dist  
Mark Otto committed
4718

Mark Otto's avatar
dist    
Mark Otto committed
4719
        this._isTransitioning = false;
Mark Otto's avatar
dist  
Mark Otto committed
4720

Mark Otto's avatar
dist    
Mark Otto committed
4721
4722
        this._showBackdrop(function () {
          $$$1(document.body).removeClass(ClassName.OPEN);
Mark Otto's avatar
dist    
Mark Otto committed
4723

Mark Otto's avatar
dist    
Mark Otto committed
4724
          _this7._resetAdjustments();
Mark Otto's avatar
dist    
Mark Otto committed
4725

Mark Otto's avatar
dist    
Mark Otto committed
4726
          _this7._resetScrollbar();
Mark Otto's avatar
dist    
Mark Otto committed
4727

Mark Otto's avatar
dist    
Mark Otto committed
4728
4729
4730
          $$$1(_this7._element).trigger(Event.HIDDEN);
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
4731

Mark Otto's avatar
dist    
Mark Otto committed
4732
4733
4734
4735
4736
4737
      _proto._removeBackdrop = function _removeBackdrop() {
        if (this._backdrop) {
          $$$1(this._backdrop).remove();
          this._backdrop = null;
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
4738

Mark Otto's avatar
dist    
Mark Otto committed
4739
4740
      _proto._showBackdrop = function _showBackdrop(callback) {
        var _this8 = this;
Mark Otto's avatar
dist    
Mark Otto committed
4741

Mark Otto's avatar
dist    
Mark Otto committed
4742
        var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
Mark Otto's avatar
dist  
Mark Otto committed
4743

Mark Otto's avatar
dist    
Mark Otto committed
4744
4745
4746
        if (this._isShown && this._config.backdrop) {
          this._backdrop = document.createElement('div');
          this._backdrop.className = ClassName.BACKDROP;
Mark Otto's avatar
dist  
Mark Otto committed
4747

Mark Otto's avatar
dist    
Mark Otto committed
4748
          if (animate) {
Mark Otto's avatar
dist    
Mark Otto committed
4749
            this._backdrop.classList.add(animate);
Mark Otto's avatar
dist    
Mark Otto committed
4750
          }
Mark Otto's avatar
dist  
Mark Otto committed
4751

Mark Otto's avatar
dist    
Mark Otto committed
4752
4753
4754
4755
4756
4757
          $$$1(this._backdrop).appendTo(document.body);
          $$$1(this._element).on(Event.CLICK_DISMISS, function (event) {
            if (_this8._ignoreBackdropClick) {
              _this8._ignoreBackdropClick = false;
              return;
            }
Mark Otto's avatar
dist  
Mark Otto committed
4758

Mark Otto's avatar
dist    
Mark Otto committed
4759
4760
4761
            if (event.target !== event.currentTarget) {
              return;
            }
Mark Otto's avatar
dist  
Mark Otto committed
4762

Mark Otto's avatar
dist    
Mark Otto committed
4763
4764
4765
4766
4767
4768
            if (_this8._config.backdrop === 'static') {
              _this8._element.focus();
            } else {
              _this8.hide();
            }
          });
Mark Otto's avatar
dist  
Mark Otto committed
4769

Mark Otto's avatar
dist    
Mark Otto committed
4770
4771
          if (animate) {
            Util.reflow(this._backdrop);
Mark Otto's avatar
dist  
Mark Otto committed
4772
          }
Mark Otto's avatar
dist    
Mark Otto committed
4773

Mark Otto's avatar
dist    
Mark Otto committed
4774
4775
4776
          $$$1(this._backdrop).addClass(ClassName.SHOW);

          if (!callback) {
Mark Otto's avatar
dist  
Mark Otto committed
4777
4778
            return;
          }
Mark Otto's avatar
dist    
Mark Otto committed
4779

Mark Otto's avatar
dist    
Mark Otto committed
4780
4781
4782
          if (!animate) {
            callback();
            return;
Mark Otto's avatar
dist  
Mark Otto committed
4783
4784
          }

Mark Otto's avatar
dist    
Mark Otto committed
4785
4786
4787
4788
          var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
          $$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
        } else if (!this._isShown && this._backdrop) {
          $$$1(this._backdrop).removeClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
4789

Mark Otto's avatar
dist    
Mark Otto committed
4790
4791
          var callbackRemove = function callbackRemove() {
            _this8._removeBackdrop();
Mark Otto's avatar
dist  
Mark Otto committed
4792

Mark Otto's avatar
dist    
Mark Otto committed
4793
4794
4795
4796
            if (callback) {
              callback();
            }
          };
Mark Otto's avatar
dist  
Mark Otto committed
4797

Mark Otto's avatar
dist    
Mark Otto committed
4798
4799
4800
4801
4802
4803
4804
4805
          if ($$$1(this._element).hasClass(ClassName.FADE)) {
            var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);

            $$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
          } else {
            callbackRemove();
          }
        } else if (callback) {
Mark Otto's avatar
dist  
Mark Otto committed
4806
4807
          callback();
        }
Mark Otto's avatar
dist    
Mark Otto committed
4808
4809
4810
4811
      }; // ----------------------------------------------------------------------
      // the following methods are used to handle overflowing modals
      // todo (fat): these should probably be refactored out of modal.js
      // ----------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
4812
4813


Mark Otto's avatar
dist    
Mark Otto committed
4814
4815
      _proto._adjustDialog = function _adjustDialog() {
        var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
Mark Otto's avatar
dist    
Mark Otto committed
4816

Mark Otto's avatar
dist    
Mark Otto committed
4817
4818
        if (!this._isBodyOverflowing && isModalOverflowing) {
          this._element.style.paddingLeft = this._scrollbarWidth + "px";
Mark Otto's avatar
dist  
Mark Otto committed
4819
4820
        }

Mark Otto's avatar
dist    
Mark Otto committed
4821
4822
4823
4824
        if (this._isBodyOverflowing && !isModalOverflowing) {
          this._element.style.paddingRight = this._scrollbarWidth + "px";
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
4825

Mark Otto's avatar
dist    
Mark Otto committed
4826
4827
4828
4829
      _proto._resetAdjustments = function _resetAdjustments() {
        this._element.style.paddingLeft = '';
        this._element.style.paddingRight = '';
      };
Mark Otto's avatar
dist  
Mark Otto committed
4830

Mark Otto's avatar
dist    
Mark Otto committed
4831
4832
4833
4834
4835
      _proto._checkScrollbar = function _checkScrollbar() {
        var rect = document.body.getBoundingClientRect();
        this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
        this._scrollbarWidth = this._getScrollbarWidth();
      };
Mark Otto's avatar
dist  
Mark Otto committed
4836

Mark Otto's avatar
dist    
Mark Otto committed
4837
4838
4839
4840
4841
4842
      _proto._setScrollbar = function _setScrollbar() {
        var _this9 = this;

        if (this._isBodyOverflowing) {
          // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
          //   while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
Mark Otto's avatar
dist    
Mark Otto committed
4843
          var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
Mark Otto's avatar
dist    
Mark Otto committed
4844
          var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding
Mark Otto's avatar
dist    
Mark Otto committed
4845
4846
4847

          $$$1(fixedContent).each(function (index, element) {
            var actualPadding = element.style.paddingRight;
Mark Otto's avatar
dist    
Mark Otto committed
4848
4849
4850
4851
            var calculatedPadding = $$$1(element).css('padding-right');
            $$$1(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
          }); // Adjust sticky content margin

Mark Otto's avatar
dist    
Mark Otto committed
4852
4853
          $$$1(stickyContent).each(function (index, element) {
            var actualMargin = element.style.marginRight;
Mark Otto's avatar
dist    
Mark Otto committed
4854
4855
4856
4857
4858
4859
4860
4861
4862
            var calculatedMargin = $$$1(element).css('margin-right');
            $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
          }); // Adjust body padding

          var actualPadding = document.body.style.paddingRight;
          var calculatedPadding = $$$1(document.body).css('padding-right');
          $$$1(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
4863

Mark Otto's avatar
dist    
Mark Otto committed
4864
4865
      _proto._resetScrollbar = function _resetScrollbar() {
        // Restore fixed content padding
Mark Otto's avatar
dist    
Mark Otto committed
4866
4867
        var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
        $$$1(fixedContent).each(function (index, element) {
Mark Otto's avatar
dist    
Mark Otto committed
4868
          var padding = $$$1(element).data('padding-right');
Mark Otto's avatar
dist    
Mark Otto committed
4869
4870
4871
          $$$1(element).removeData('padding-right');
          element.style.paddingRight = padding ? padding : '';
        }); // Restore sticky content
Mark Otto's avatar
dist  
Mark Otto committed
4872

Mark Otto's avatar
dist    
Mark Otto committed
4873
        var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT));
Mark Otto's avatar
dist    
Mark Otto committed
4874
        $$$1(elements).each(function (index, element) {
Mark Otto's avatar
dist    
Mark Otto committed
4875
          var margin = $$$1(element).data('margin-right');
Mark Otto's avatar
dist  
Mark Otto committed
4876

Mark Otto's avatar
dist    
Mark Otto committed
4877
4878
4879
4880
          if (typeof margin !== 'undefined') {
            $$$1(element).css('margin-right', margin).removeData('margin-right');
          }
        }); // Restore body padding
Mark Otto's avatar
dist  
Mark Otto committed
4881

Mark Otto's avatar
dist    
Mark Otto committed
4882
        var padding = $$$1(document.body).data('padding-right');
Mark Otto's avatar
dist    
Mark Otto committed
4883
4884
        $$$1(document.body).removeData('padding-right');
        document.body.style.paddingRight = padding ? padding : '';
Mark Otto's avatar
dist    
Mark Otto committed
4885
      };
Mark Otto's avatar
dist    
Mark Otto committed
4886

Mark Otto's avatar
dist    
Mark Otto committed
4887
4888
4889
4890
4891
4892
4893
4894
4895
      _proto._getScrollbarWidth = function _getScrollbarWidth() {
        // thx d.walsh
        var scrollDiv = document.createElement('div');
        scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
        document.body.appendChild(scrollDiv);
        var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
        document.body.removeChild(scrollDiv);
        return scrollbarWidth;
      }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
4896
4897


Mark Otto's avatar
dist    
Mark Otto committed
4898
4899
4900
      Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
        return this.each(function () {
          var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
4901

Mark Otto's avatar
dist    
Mark Otto committed
4902
          var _config = _objectSpread({}, Default, $$$1(this).data(), typeof config === 'object' && config ? config : {});
Mark Otto's avatar
dist    
Mark Otto committed
4903

Mark Otto's avatar
dist    
Mark Otto committed
4904
4905
4906
4907
          if (!data) {
            data = new Modal(this, _config);
            $$$1(this).data(DATA_KEY, data);
          }
Mark Otto's avatar
dist  
Mark Otto committed
4908

Mark Otto's avatar
dist    
Mark Otto committed
4909
4910
4911
4912
          if (typeof config === 'string') {
            if (typeof data[config] === 'undefined') {
              throw new TypeError("No method named \"" + config + "\"");
            }
Mark Otto's avatar
dist  
Mark Otto committed
4913

Mark Otto's avatar
dist    
Mark Otto committed
4914
4915
4916
            data[config](relatedTarget);
          } else if (_config.show) {
            data.show(relatedTarget);
Mark Otto's avatar
dist  
Mark Otto committed
4917
          }
Mark Otto's avatar
dist    
Mark Otto committed
4918
4919
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
4920

Mark Otto's avatar
dist    
Mark Otto committed
4921
4922
4923
4924
      _createClass(Modal, null, [{
        key: "VERSION",
        get: function get() {
          return VERSION;
Mark Otto's avatar
dist  
Mark Otto committed
4925
        }
Mark Otto's avatar
dist    
Mark Otto committed
4926
4927
4928
4929
4930
4931
      }, {
        key: "Default",
        get: function get() {
          return Default;
        }
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
4932

Mark Otto's avatar
dist    
Mark Otto committed
4933
4934
4935
4936
4937
4938
4939
      return Modal;
    }();
    /**
     * ------------------------------------------------------------------------
     * Data Api implementation
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
4940

Mark Otto's avatar
dist  
Mark Otto committed
4941

Mark Otto's avatar
dist    
Mark Otto committed
4942
4943
    $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
      var _this10 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4944

Mark Otto's avatar
dist    
Mark Otto committed
4945
4946
      var target;
      var selector = Util.getSelectorFromElement(this);
Mark Otto's avatar
dist  
Mark Otto committed
4947

Mark Otto's avatar
dist    
Mark Otto committed
4948
      if (selector) {
Mark Otto's avatar
dist    
Mark Otto committed
4949
        target = document.querySelector(selector);
Mark Otto's avatar
dist    
Mark Otto committed
4950
      }
Mark Otto's avatar
dist  
Mark Otto committed
4951

Mark Otto's avatar
dist    
Mark Otto committed
4952
      var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $$$1(target).data(), $$$1(this).data());
Mark Otto's avatar
dist  
Mark Otto committed
4953

Mark Otto's avatar
dist    
Mark Otto committed
4954
4955
      if (this.tagName === 'A' || this.tagName === 'AREA') {
        event.preventDefault();
Mark Otto's avatar
dist  
Mark Otto committed
4956
4957
      }

Mark Otto's avatar
dist    
Mark Otto committed
4958
4959
4960
4961
      var $target = $$$1(target).one(Event.SHOW, function (showEvent) {
        if (showEvent.isDefaultPrevented()) {
          // Only register focus restorer if modal will actually get shown
          return;
Mark Otto's avatar
dist  
Mark Otto committed
4962
4963
        }

Mark Otto's avatar
dist    
Mark Otto committed
4964
4965
4966
4967
4968
4969
        $target.one(Event.HIDDEN, function () {
          if ($$$1(_this10).is(':visible')) {
            _this10.focus();
          }
        });
      });
Mark Otto's avatar
dist  
Mark Otto committed
4970

Mark Otto's avatar
dist    
Mark Otto committed
4971
4972
4973
4974
4975
4976
4977
      Modal._jQueryInterface.call($$$1(target), config, this);
    });
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
4978

Mark Otto's avatar
dist    
Mark Otto committed
4979
4980
    $$$1.fn[NAME] = Modal._jQueryInterface;
    $$$1.fn[NAME].Constructor = Modal;
Mark Otto's avatar
dist  
Mark Otto committed
4981

Mark Otto's avatar
dist    
Mark Otto committed
4982
4983
4984
4985
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Modal._jQueryInterface;
    };
Mark Otto's avatar
dist  
Mark Otto committed
4986

Mark Otto's avatar
dist    
Mark Otto committed
4987
4988
    return Modal;
  }($);
Mark Otto's avatar
dist  
Mark Otto committed
4989
4990

  /**
Mark Otto's avatar
dist    
Mark Otto committed
4991
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
4992
   * Bootstrap (v4.1.3): tooltip.js
Mark Otto's avatar
dist    
Mark Otto committed
4993
4994
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
4995
   */
Mark Otto's avatar
dist    
Mark Otto committed
4996
4997

  var Tooltip = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
4998
4999
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
5000
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
5001
5002
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
5003
    var NAME = 'tooltip';
Mark Otto's avatar
Mark Otto committed
5004
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
    var DATA_KEY = 'bs.tooltip';
    var EVENT_KEY = "." + DATA_KEY;
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var CLASS_PREFIX = 'bs-tooltip';
    var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
    var DefaultType = {
      animation: 'boolean',
      template: 'string',
      title: '(string|element|function)',
      trigger: 'string',
      delay: '(number|object)',
      html: 'boolean',
      selector: '(string|boolean)',
      placement: '(string|function)',
      offset: '(number|string)',
      container: '(string|element|boolean)',
      fallbackPlacement: '(string|array)',
      boundary: '(string|element)'
    };
    var AttachmentMap = {
      AUTO: 'auto',
      TOP: 'top',
      RIGHT: 'right',
      BOTTOM: 'bottom',
      LEFT: 'left'
    };
    var Default = {
      animation: true,
      template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
      trigger: 'hover focus',
      title: '',
      delay: 0,
      html: false,
      selector: false,
      placement: 'top',
      offset: 0,
      container: false,
      fallbackPlacement: 'flip',
      boundary: 'scrollParent'
    };
    var HoverState = {
      SHOW: 'show',
      OUT: 'out'
    };
    var Event = {
      HIDE: "hide" + EVENT_KEY,
      HIDDEN: "hidden" + EVENT_KEY,
      SHOW: "show" + EVENT_KEY,
      SHOWN: "shown" + EVENT_KEY,
      INSERTED: "inserted" + EVENT_KEY,
      CLICK: "click" + EVENT_KEY,
      FOCUSIN: "focusin" + EVENT_KEY,
      FOCUSOUT: "focusout" + EVENT_KEY,
      MOUSEENTER: "mouseenter" + EVENT_KEY,
      MOUSELEAVE: "mouseleave" + EVENT_KEY
    };
    var ClassName = {
      FADE: 'fade',
      SHOW: 'show'
    };
    var Selector = {
      TOOLTIP: '.tooltip',
      TOOLTIP_INNER: '.tooltip-inner',
      ARROW: '.arrow'
    };
    var Trigger = {
      HOVER: 'hover',
      FOCUS: 'focus',
      CLICK: 'click',
      MANUAL: 'manual'
Mark Otto's avatar
dist    
Mark Otto committed
5075
      /**
Mark Otto's avatar
dist    
Mark Otto committed
5076
5077
5078
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
5079
5080
       */

Mark Otto's avatar
dist    
Mark Otto committed
5081
    };
Mark Otto's avatar
dist    
Mark Otto committed
5082

Mark Otto's avatar
dist    
Mark Otto committed
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
    var Tooltip =
    /*#__PURE__*/
    function () {
      function Tooltip(element, config) {
        /**
         * Check for Popper dependency
         * Popper - https://popper.js.org
         */
        if (typeof Popper === 'undefined') {
          throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');
        } // private
Mark Otto's avatar
dist  
Mark Otto committed
5094
5095


Mark Otto's avatar
dist    
Mark Otto committed
5096
5097
5098
5099
5100
        this._isEnabled = true;
        this._timeout = 0;
        this._hoverState = '';
        this._activeTrigger = {};
        this._popper = null; // Protected
Mark Otto's avatar
dist  
Mark Otto committed
5101

Mark Otto's avatar
dist    
Mark Otto committed
5102
5103
5104
        this.element = element;
        this.config = this._getConfig(config);
        this.tip = null;
Mark Otto's avatar
dist  
Mark Otto committed
5105

Mark Otto's avatar
dist    
Mark Otto committed
5106
5107
        this._setListeners();
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
5108
5109


Mark Otto's avatar
dist    
Mark Otto committed
5110
      var _proto = Tooltip.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
5111

Mark Otto's avatar
dist    
Mark Otto committed
5112
5113
5114
5115
      // Public
      _proto.enable = function enable() {
        this._isEnabled = true;
      };
Mark Otto's avatar
dist  
Mark Otto committed
5116

Mark Otto's avatar
dist    
Mark Otto committed
5117
5118
5119
      _proto.disable = function disable() {
        this._isEnabled = false;
      };
Mark Otto's avatar
dist  
Mark Otto committed
5120

Mark Otto's avatar
dist    
Mark Otto committed
5121
5122
5123
      _proto.toggleEnabled = function toggleEnabled() {
        this._isEnabled = !this._isEnabled;
      };
Mark Otto's avatar
dist  
Mark Otto committed
5124

Mark Otto's avatar
dist    
Mark Otto committed
5125
5126
5127
      _proto.toggle = function toggle(event) {
        if (!this._isEnabled) {
          return;
Mark Otto's avatar
dist  
Mark Otto committed
5128
5129
        }

Mark Otto's avatar
dist    
Mark Otto committed
5130
5131
5132
        if (event) {
          var dataKey = this.constructor.DATA_KEY;
          var context = $$$1(event.currentTarget).data(dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
5133

Mark Otto's avatar
dist    
Mark Otto committed
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
          if (!context) {
            context = new this.constructor(event.currentTarget, this._getDelegateConfig());
            $$$1(event.currentTarget).data(dataKey, context);
          }

          context._activeTrigger.click = !context._activeTrigger.click;

          if (context._isWithActiveTrigger()) {
            context._enter(null, context);
          } else {
            context._leave(null, context);
          }
Mark Otto's avatar
dist  
Mark Otto committed
5146
        } else {
Mark Otto's avatar
dist    
Mark Otto committed
5147
5148
          if ($$$1(this.getTipElement()).hasClass(ClassName.SHOW)) {
            this._leave(null, this);
Mark Otto's avatar
dist    
Mark Otto committed
5149

Mark Otto's avatar
dist    
Mark Otto committed
5150
5151
            return;
          }
Mark Otto's avatar
dist  
Mark Otto committed
5152

Mark Otto's avatar
dist    
Mark Otto committed
5153
5154
5155
          this._enter(null, this);
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
5156

Mark Otto's avatar
dist    
Mark Otto committed
5157
5158
5159
5160
5161
      _proto.dispose = function dispose() {
        clearTimeout(this._timeout);
        $$$1.removeData(this.element, this.constructor.DATA_KEY);
        $$$1(this.element).off(this.constructor.EVENT_KEY);
        $$$1(this.element).closest('.modal').off('hide.bs.modal');
Mark Otto's avatar
dist  
Mark Otto committed
5162

Mark Otto's avatar
dist    
Mark Otto committed
5163
5164
5165
        if (this.tip) {
          $$$1(this.tip).remove();
        }
Mark Otto's avatar
dist  
Mark Otto committed
5166

Mark Otto's avatar
dist    
Mark Otto committed
5167
5168
5169
5170
        this._isEnabled = null;
        this._timeout = null;
        this._hoverState = null;
        this._activeTrigger = null;
Mark Otto's avatar
dist    
Mark Otto committed
5171

Mark Otto's avatar
dist    
Mark Otto committed
5172
5173
5174
        if (this._popper !== null) {
          this._popper.destroy();
        }
Mark Otto's avatar
dist  
Mark Otto committed
5175

Mark Otto's avatar
dist    
Mark Otto committed
5176
5177
5178
5179
5180
        this._popper = null;
        this.element = null;
        this.config = null;
        this.tip = null;
      };
Mark Otto's avatar
dist  
Mark Otto committed
5181

Mark Otto's avatar
dist    
Mark Otto committed
5182
5183
      _proto.show = function show() {
        var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
5184

Mark Otto's avatar
dist    
Mark Otto committed
5185
5186
5187
        if ($$$1(this.element).css('display') === 'none') {
          throw new Error('Please use show on visible elements');
        }
Mark Otto's avatar
dist  
Mark Otto committed
5188

Mark Otto's avatar
dist    
Mark Otto committed
5189
        var showEvent = $$$1.Event(this.constructor.Event.SHOW);
Mark Otto's avatar
dist    
Mark Otto committed
5190

Mark Otto's avatar
dist    
Mark Otto committed
5191
5192
5193
        if (this.isWithContent() && this._isEnabled) {
          $$$1(this.element).trigger(showEvent);
          var isInTheDom = $$$1.contains(this.element.ownerDocument.documentElement, this.element);
Mark Otto's avatar
dist  
Mark Otto committed
5194

Mark Otto's avatar
dist    
Mark Otto committed
5195
5196
5197
          if (showEvent.isDefaultPrevented() || !isInTheDom) {
            return;
          }
Mark Otto's avatar
dist  
Mark Otto committed
5198

Mark Otto's avatar
dist    
Mark Otto committed
5199
5200
5201
5202
5203
          var tip = this.getTipElement();
          var tipId = Util.getUID(this.constructor.NAME);
          tip.setAttribute('id', tipId);
          this.element.setAttribute('aria-describedby', tipId);
          this.setContent();
Mark Otto's avatar
dist  
Mark Otto committed
5204

Mark Otto's avatar
dist    
Mark Otto committed
5205
5206
5207
          if (this.config.animation) {
            $$$1(tip).addClass(ClassName.FADE);
          }
Mark Otto's avatar
dist  
Mark Otto committed
5208

Mark Otto's avatar
dist    
Mark Otto committed
5209
          var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
Mark Otto's avatar
dist  
Mark Otto committed
5210

Mark Otto's avatar
dist    
Mark Otto committed
5211
          var attachment = this._getAttachment(placement);
Mark Otto's avatar
dist  
Mark Otto committed
5212

Mark Otto's avatar
dist    
Mark Otto committed
5213
          this.addAttachmentClass(attachment);
Mark Otto's avatar
dist    
Mark Otto committed
5214
          var container = this.config.container === false ? document.body : $$$1(document).find(this.config.container);
Mark Otto's avatar
dist    
Mark Otto committed
5215
          $$$1(tip).data(this.constructor.DATA_KEY, this);
Mark Otto's avatar
dist  
Mark Otto committed
5216

Mark Otto's avatar
dist    
Mark Otto committed
5217
5218
5219
          if (!$$$1.contains(this.element.ownerDocument.documentElement, this.tip)) {
            $$$1(tip).appendTo(container);
          }
Mark Otto's avatar
dist  
Mark Otto committed
5220

Mark Otto's avatar
dist    
Mark Otto committed
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
          $$$1(this.element).trigger(this.constructor.Event.INSERTED);
          this._popper = new Popper(this.element, tip, {
            placement: attachment,
            modifiers: {
              offset: {
                offset: this.config.offset
              },
              flip: {
                behavior: this.config.fallbackPlacement
              },
              arrow: {
                element: Selector.ARROW
              },
              preventOverflow: {
                boundariesElement: this.config.boundary
              }
Mark Otto's avatar
dist  
Mark Otto committed
5237
            },
Mark Otto's avatar
dist    
Mark Otto committed
5238
5239
5240
5241
            onCreate: function onCreate(data) {
              if (data.originalPlacement !== data.placement) {
                _this._handlePopperPlacementChange(data);
              }
Mark Otto's avatar
dist    
Mark Otto committed
5242
            },
Mark Otto's avatar
dist    
Mark Otto committed
5243
            onUpdate: function onUpdate(data) {
Mark Otto's avatar
dist  
Mark Otto committed
5244
5245
              _this._handlePopperPlacementChange(data);
            }
Mark Otto's avatar
dist    
Mark Otto committed
5246
5247
5248
5249
5250
5251
5252
5253
          });
          $$$1(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
          // empty mouseover listeners to the body's immediate children;
          // only needed because of broken event delegation on iOS
          // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html

          if ('ontouchstart' in document.documentElement) {
            $$$1(document.body).children().on('mouseover', null, $$$1.noop);
Mark Otto's avatar
dist  
Mark Otto committed
5254
          }
Mark Otto's avatar
dist    
Mark Otto committed
5255

Mark Otto's avatar
dist    
Mark Otto committed
5256
5257
5258
5259
          var complete = function complete() {
            if (_this.config.animation) {
              _this._fixTransition();
            }
Mark Otto's avatar
dist  
Mark Otto committed
5260

Mark Otto's avatar
dist    
Mark Otto committed
5261
5262
5263
            var prevHoverState = _this._hoverState;
            _this._hoverState = null;
            $$$1(_this.element).trigger(_this.constructor.Event.SHOWN);
Mark Otto's avatar
dist    
Mark Otto committed
5264

Mark Otto's avatar
dist    
Mark Otto committed
5265
5266
5267
5268
            if (prevHoverState === HoverState.OUT) {
              _this._leave(null, _this);
            }
          };
Mark Otto's avatar
dist  
Mark Otto committed
5269

Mark Otto's avatar
dist    
Mark Otto committed
5270
5271
5272
5273
5274
          if ($$$1(this.tip).hasClass(ClassName.FADE)) {
            var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
            $$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
          } else {
            complete();
Mark Otto's avatar
dist  
Mark Otto committed
5275
5276
          }
        }
Mark Otto's avatar
dist    
Mark Otto committed
5277
      };
Mark Otto's avatar
dist  
Mark Otto committed
5278

Mark Otto's avatar
dist    
Mark Otto committed
5279
5280
      _proto.hide = function hide(callback) {
        var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
5281

Mark Otto's avatar
dist    
Mark Otto committed
5282
5283
        var tip = this.getTipElement();
        var hideEvent = $$$1.Event(this.constructor.Event.HIDE);
Mark Otto's avatar
dist    
Mark Otto committed
5284

Mark Otto's avatar
dist    
Mark Otto committed
5285
5286
5287
5288
        var complete = function complete() {
          if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
            tip.parentNode.removeChild(tip);
          }
Mark Otto's avatar
dist  
Mark Otto committed
5289

Mark Otto's avatar
dist    
Mark Otto committed
5290
          _this2._cleanTipClass();
Mark Otto's avatar
dist    
Mark Otto committed
5291

Mark Otto's avatar
dist    
Mark Otto committed
5292
          _this2.element.removeAttribute('aria-describedby');
Mark Otto's avatar
dist    
Mark Otto committed
5293

Mark Otto's avatar
dist    
Mark Otto committed
5294
          $$$1(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
Mark Otto's avatar
dist    
Mark Otto committed
5295

Mark Otto's avatar
dist    
Mark Otto committed
5296
5297
5298
          if (_this2._popper !== null) {
            _this2._popper.destroy();
          }
Mark Otto's avatar
dist  
Mark Otto committed
5299

Mark Otto's avatar
dist    
Mark Otto committed
5300
5301
5302
5303
          if (callback) {
            callback();
          }
        };
Mark Otto's avatar
dist  
Mark Otto committed
5304

Mark Otto's avatar
dist    
Mark Otto committed
5305
        $$$1(this.element).trigger(hideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
5306

Mark Otto's avatar
dist    
Mark Otto committed
5307
5308
5309
        if (hideEvent.isDefaultPrevented()) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
5310

Mark Otto's avatar
dist    
Mark Otto committed
5311
5312
        $$$1(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
        // empty mouseover listeners we added for iOS support
Mark Otto's avatar
dist    
Mark Otto committed
5313

Mark Otto's avatar
dist    
Mark Otto committed
5314
5315
5316
        if ('ontouchstart' in document.documentElement) {
          $$$1(document.body).children().off('mouseover', null, $$$1.noop);
        }
Mark Otto's avatar
dist  
Mark Otto committed
5317

Mark Otto's avatar
dist    
Mark Otto committed
5318
5319
5320
        this._activeTrigger[Trigger.CLICK] = false;
        this._activeTrigger[Trigger.FOCUS] = false;
        this._activeTrigger[Trigger.HOVER] = false;
Mark Otto's avatar
dist  
Mark Otto committed
5321

Mark Otto's avatar
dist    
Mark Otto committed
5322
5323
5324
5325
5326
5327
        if ($$$1(this.tip).hasClass(ClassName.FADE)) {
          var transitionDuration = Util.getTransitionDurationFromElement(tip);
          $$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
        } else {
          complete();
        }
Mark Otto's avatar
dist  
Mark Otto committed
5328

Mark Otto's avatar
dist    
Mark Otto committed
5329
5330
        this._hoverState = '';
      };
Mark Otto's avatar
dist  
Mark Otto committed
5331

Mark Otto's avatar
dist    
Mark Otto committed
5332
5333
5334
5335
5336
      _proto.update = function update() {
        if (this._popper !== null) {
          this._popper.scheduleUpdate();
        }
      }; // Protected
Mark Otto's avatar
dist  
Mark Otto committed
5337
5338


Mark Otto's avatar
dist    
Mark Otto committed
5339
5340
5341
      _proto.isWithContent = function isWithContent() {
        return Boolean(this.getTitle());
      };
Mark Otto's avatar
dist  
Mark Otto committed
5342

Mark Otto's avatar
dist    
Mark Otto committed
5343
5344
5345
      _proto.addAttachmentClass = function addAttachmentClass(attachment) {
        $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
      };
Mark Otto's avatar
dist  
Mark Otto committed
5346

Mark Otto's avatar
dist    
Mark Otto committed
5347
5348
5349
5350
      _proto.getTipElement = function getTipElement() {
        this.tip = this.tip || $$$1(this.config.template)[0];
        return this.tip;
      };
Mark Otto's avatar
dist  
Mark Otto committed
5351

Mark Otto's avatar
dist    
Mark Otto committed
5352
      _proto.setContent = function setContent() {
Mark Otto's avatar
dist    
Mark Otto committed
5353
5354
5355
        var tip = this.getTipElement();
        this.setElementContent($$$1(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
        $$$1(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
Mark Otto's avatar
dist    
Mark Otto committed
5356
      };
Mark Otto's avatar
dist  
Mark Otto committed
5357

Mark Otto's avatar
dist    
Mark Otto committed
5358
5359
      _proto.setElementContent = function setElementContent($element, content) {
        var html = this.config.html;
Mark Otto's avatar
dist    
Mark Otto committed
5360

Mark Otto's avatar
dist    
Mark Otto committed
5361
5362
5363
5364
5365
5366
5367
5368
        if (typeof content === 'object' && (content.nodeType || content.jquery)) {
          // Content is a DOM node or a jQuery
          if (html) {
            if (!$$$1(content).parent().is($element)) {
              $element.empty().append(content);
            }
          } else {
            $element.text($$$1(content).text());
Mark Otto's avatar
dist  
Mark Otto committed
5369
5370
          }
        } else {
Mark Otto's avatar
dist    
Mark Otto committed
5371
          $element[html ? 'html' : 'text'](content);
Mark Otto's avatar
dist  
Mark Otto committed
5372
        }
Mark Otto's avatar
dist    
Mark Otto committed
5373
      };
Mark Otto's avatar
dist  
Mark Otto committed
5374

Mark Otto's avatar
dist    
Mark Otto committed
5375
5376
      _proto.getTitle = function getTitle() {
        var title = this.element.getAttribute('data-original-title');
Mark Otto's avatar
dist  
Mark Otto committed
5377

Mark Otto's avatar
dist    
Mark Otto committed
5378
5379
5380
        if (!title) {
          title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
        }
Mark Otto's avatar
dist  
Mark Otto committed
5381

Mark Otto's avatar
dist    
Mark Otto committed
5382
5383
        return title;
      }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
5384
5385


Mark Otto's avatar
dist    
Mark Otto committed
5386
5387
5388
      _proto._getAttachment = function _getAttachment(placement) {
        return AttachmentMap[placement.toUpperCase()];
      };
Mark Otto's avatar
dist  
Mark Otto committed
5389

Mark Otto's avatar
dist    
Mark Otto committed
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
      _proto._setListeners = function _setListeners() {
        var _this3 = this;

        var triggers = this.config.trigger.split(' ');
        triggers.forEach(function (trigger) {
          if (trigger === 'click') {
            $$$1(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
              return _this3.toggle(event);
            });
          } else if (trigger !== Trigger.MANUAL) {
            var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
            var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
            $$$1(_this3.element).on(eventIn, _this3.config.selector, function (event) {
              return _this3._enter(event);
            }).on(eventOut, _this3.config.selector, function (event) {
              return _this3._leave(event);
            });
          }
Mark Otto's avatar
dist  
Mark Otto committed
5408

Mark Otto's avatar
dist    
Mark Otto committed
5409
5410
          $$$1(_this3.element).closest('.modal').on('hide.bs.modal', function () {
            return _this3.hide();
Mark Otto's avatar
dist  
Mark Otto committed
5411
          });
Mark Otto's avatar
dist    
Mark Otto committed
5412
5413
5414
5415
5416
5417
        });

        if (this.config.selector) {
          this.config = _objectSpread({}, this.config, {
            trigger: 'manual',
            selector: ''
Mark Otto's avatar
dist  
Mark Otto committed
5418
          });
Mark Otto's avatar
dist    
Mark Otto committed
5419
5420
        } else {
          this._fixTitle();
Mark Otto's avatar
dist  
Mark Otto committed
5421
        }
Mark Otto's avatar
dist    
Mark Otto committed
5422
      };
Mark Otto's avatar
dist  
Mark Otto committed
5423

Mark Otto's avatar
dist    
Mark Otto committed
5424
5425
      _proto._fixTitle = function _fixTitle() {
        var titleType = typeof this.element.getAttribute('data-original-title');
Mark Otto's avatar
dist  
Mark Otto committed
5426

Mark Otto's avatar
dist    
Mark Otto committed
5427
5428
5429
5430
5431
        if (this.element.getAttribute('title') || titleType !== 'string') {
          this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
          this.element.setAttribute('title', '');
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
5432

Mark Otto's avatar
dist    
Mark Otto committed
5433
5434
5435
      _proto._enter = function _enter(event, context) {
        var dataKey = this.constructor.DATA_KEY;
        context = context || $$$1(event.currentTarget).data(dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
5436

Mark Otto's avatar
dist    
Mark Otto committed
5437
5438
5439
5440
        if (!context) {
          context = new this.constructor(event.currentTarget, this._getDelegateConfig());
          $$$1(event.currentTarget).data(dataKey, context);
        }
Mark Otto's avatar
dist  
Mark Otto committed
5441

Mark Otto's avatar
dist    
Mark Otto committed
5442
5443
5444
        if (event) {
          context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
        }
Mark Otto's avatar
dist  
Mark Otto committed
5445

Mark Otto's avatar
dist    
Mark Otto committed
5446
5447
5448
5449
        if ($$$1(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
          context._hoverState = HoverState.SHOW;
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
5450

Mark Otto's avatar
dist    
Mark Otto committed
5451
        clearTimeout(context._timeout);
Mark Otto's avatar
dist  
Mark Otto committed
5452
5453
        context._hoverState = HoverState.SHOW;

Mark Otto's avatar
dist    
Mark Otto committed
5454
        if (!context.config.delay || !context.config.delay.show) {
Mark Otto's avatar
dist  
Mark Otto committed
5455
          context.show();
Mark Otto's avatar
dist    
Mark Otto committed
5456
          return;
Mark Otto's avatar
dist  
Mark Otto committed
5457
5458
        }

Mark Otto's avatar
dist    
Mark Otto committed
5459
5460
5461
5462
5463
5464
        context._timeout = setTimeout(function () {
          if (context._hoverState === HoverState.SHOW) {
            context.show();
          }
        }, context.config.delay.show);
      };
Mark Otto's avatar
dist  
Mark Otto committed
5465

Mark Otto's avatar
dist    
Mark Otto committed
5466
5467
5468
      _proto._leave = function _leave(event, context) {
        var dataKey = this.constructor.DATA_KEY;
        context = context || $$$1(event.currentTarget).data(dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
5469

Mark Otto's avatar
dist    
Mark Otto committed
5470
5471
5472
5473
        if (!context) {
          context = new this.constructor(event.currentTarget, this._getDelegateConfig());
          $$$1(event.currentTarget).data(dataKey, context);
        }
Mark Otto's avatar
dist  
Mark Otto committed
5474

Mark Otto's avatar
dist    
Mark Otto committed
5475
5476
5477
        if (event) {
          context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
        }
Mark Otto's avatar
dist  
Mark Otto committed
5478

Mark Otto's avatar
dist    
Mark Otto committed
5479
5480
5481
        if (context._isWithActiveTrigger()) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
5482

Mark Otto's avatar
dist    
Mark Otto committed
5483
5484
        clearTimeout(context._timeout);
        context._hoverState = HoverState.OUT;
Mark Otto's avatar
dist  
Mark Otto committed
5485

Mark Otto's avatar
dist    
Mark Otto committed
5486
        if (!context.config.delay || !context.config.delay.hide) {
Mark Otto's avatar
dist  
Mark Otto committed
5487
          context.hide();
Mark Otto's avatar
dist    
Mark Otto committed
5488
          return;
Mark Otto's avatar
dist  
Mark Otto committed
5489
5490
        }

Mark Otto's avatar
dist    
Mark Otto committed
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
        context._timeout = setTimeout(function () {
          if (context._hoverState === HoverState.OUT) {
            context.hide();
          }
        }, context.config.delay.hide);
      };

      _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
        for (var trigger in this._activeTrigger) {
          if (this._activeTrigger[trigger]) {
            return true;
          }
Mark Otto's avatar
dist  
Mark Otto committed
5503
5504
        }

Mark Otto's avatar
dist    
Mark Otto committed
5505
5506
        return false;
      };
Mark Otto's avatar
dist  
Mark Otto committed
5507

Mark Otto's avatar
dist    
Mark Otto committed
5508
      _proto._getConfig = function _getConfig(config) {
Mark Otto's avatar
dist    
Mark Otto committed
5509
        config = _objectSpread({}, this.constructor.Default, $$$1(this.element).data(), typeof config === 'object' && config ? config : {});
Mark Otto's avatar
dist  
Mark Otto committed
5510

Mark Otto's avatar
dist    
Mark Otto committed
5511
5512
5513
5514
5515
5516
        if (typeof config.delay === 'number') {
          config.delay = {
            show: config.delay,
            hide: config.delay
          };
        }
Mark Otto's avatar
dist  
Mark Otto committed
5517

Mark Otto's avatar
dist    
Mark Otto committed
5518
5519
5520
        if (typeof config.title === 'number') {
          config.title = config.title.toString();
        }
Mark Otto's avatar
dist  
Mark Otto committed
5521

Mark Otto's avatar
dist    
Mark Otto committed
5522
5523
5524
        if (typeof config.content === 'number') {
          config.content = config.content.toString();
        }
Mark Otto's avatar
dist  
Mark Otto committed
5525

Mark Otto's avatar
dist    
Mark Otto committed
5526
5527
5528
        Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
        return config;
      };
Mark Otto's avatar
dist  
Mark Otto committed
5529

Mark Otto's avatar
dist    
Mark Otto committed
5530
5531
      _proto._getDelegateConfig = function _getDelegateConfig() {
        var config = {};
Mark Otto's avatar
dist  
Mark Otto committed
5532

Mark Otto's avatar
dist    
Mark Otto committed
5533
5534
5535
5536
5537
        if (this.config) {
          for (var key in this.config) {
            if (this.constructor.Default[key] !== this.config[key]) {
              config[key] = this.config[key];
            }
Mark Otto's avatar
dist  
Mark Otto committed
5538
5539
5540
          }
        }

Mark Otto's avatar
dist    
Mark Otto committed
5541
5542
        return config;
      };
Mark Otto's avatar
dist  
Mark Otto committed
5543

Mark Otto's avatar
dist    
Mark Otto committed
5544
5545
5546
      _proto._cleanTipClass = function _cleanTipClass() {
        var $tip = $$$1(this.getTipElement());
        var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
Mark Otto's avatar
dist    
Mark Otto committed
5547

Mark Otto's avatar
dist    
Mark Otto committed
5548
        if (tabClass !== null && tabClass.length) {
Mark Otto's avatar
dist    
Mark Otto committed
5549
5550
5551
          $tip.removeClass(tabClass.join(''));
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
5552

Mark Otto's avatar
dist    
Mark Otto committed
5553
5554
5555
5556
      _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
        var popperInstance = popperData.instance;
        this.tip = popperInstance.popper;

Mark Otto's avatar
dist    
Mark Otto committed
5557
        this._cleanTipClass();
Mark Otto's avatar
dist    
Mark Otto committed
5558

Mark Otto's avatar
dist    
Mark Otto committed
5559
        this.addAttachmentClass(this._getAttachment(popperData.placement));
Mark Otto's avatar
dist    
Mark Otto committed
5560
      };
Mark Otto's avatar
dist  
Mark Otto committed
5561

Mark Otto's avatar
dist    
Mark Otto committed
5562
5563
5564
      _proto._fixTransition = function _fixTransition() {
        var tip = this.getTipElement();
        var initConfigAnimation = this.config.animation;
Mark Otto's avatar
dist    
Mark Otto committed
5565

Mark Otto's avatar
dist    
Mark Otto committed
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
        if (tip.getAttribute('x-placement') !== null) {
          return;
        }

        $$$1(tip).removeClass(ClassName.FADE);
        this.config.animation = false;
        this.hide();
        this.show();
        this.config.animation = initConfigAnimation;
      }; // Static
Mark Otto's avatar
dist    
Mark Otto committed
5576

Mark Otto's avatar
dist  
Mark Otto committed
5577

Mark Otto's avatar
dist    
Mark Otto committed
5578
5579
5580
      Tooltip._jQueryInterface = function _jQueryInterface(config) {
        return this.each(function () {
          var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
5581

Mark Otto's avatar
dist    
Mark Otto committed
5582
          var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist    
Mark Otto committed
5583

Mark Otto's avatar
dist    
Mark Otto committed
5584
5585
5586
          if (!data && /dispose|hide/.test(config)) {
            return;
          }
Mark Otto's avatar
dist  
Mark Otto committed
5587

Mark Otto's avatar
dist    
Mark Otto committed
5588
5589
5590
5591
          if (!data) {
            data = new Tooltip(this, _config);
            $$$1(this).data(DATA_KEY, data);
          }
Mark Otto's avatar
dist  
Mark Otto committed
5592

Mark Otto's avatar
dist    
Mark Otto committed
5593
5594
5595
5596
          if (typeof config === 'string') {
            if (typeof data[config] === 'undefined') {
              throw new TypeError("No method named \"" + config + "\"");
            }
Mark Otto's avatar
dist  
Mark Otto committed
5597

Mark Otto's avatar
dist    
Mark Otto committed
5598
            data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
5599
          }
Mark Otto's avatar
dist    
Mark Otto committed
5600
5601
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
5602

Mark Otto's avatar
dist    
Mark Otto committed
5603
5604
5605
5606
      _createClass(Tooltip, null, [{
        key: "VERSION",
        get: function get() {
          return VERSION;
Mark Otto's avatar
dist  
Mark Otto committed
5607
        }
Mark Otto's avatar
dist    
Mark Otto committed
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
      }, {
        key: "Default",
        get: function get() {
          return Default;
        }
      }, {
        key: "NAME",
        get: function get() {
          return NAME;
        }
      }, {
        key: "DATA_KEY",
        get: function get() {
          return DATA_KEY;
        }
      }, {
        key: "Event",
        get: function get() {
          return Event;
        }
      }, {
        key: "EVENT_KEY",
        get: function get() {
          return EVENT_KEY;
        }
      }, {
        key: "DefaultType",
        get: function get() {
          return DefaultType;
        }
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
5639

Mark Otto's avatar
dist    
Mark Otto committed
5640
5641
5642
5643
5644
5645
5646
      return Tooltip;
    }();
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
5647
5648


Mark Otto's avatar
dist    
Mark Otto committed
5649
5650
    $$$1.fn[NAME] = Tooltip._jQueryInterface;
    $$$1.fn[NAME].Constructor = Tooltip;
Mark Otto's avatar
dist  
Mark Otto committed
5651

Mark Otto's avatar
dist    
Mark Otto committed
5652
5653
5654
5655
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Tooltip._jQueryInterface;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5656

Mark Otto's avatar
dist    
Mark Otto committed
5657
5658
    return Tooltip;
  }($, Popper);
Mark Otto's avatar
dist  
Mark Otto committed
5659
5660

  /**
Mark Otto's avatar
dist    
Mark Otto committed
5661
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
5662
   * Bootstrap (v4.1.3): popover.js
Mark Otto's avatar
dist    
Mark Otto committed
5663
5664
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
5665
   */
Mark Otto's avatar
dist    
Mark Otto committed
5666
5667

  var Popover = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
5668
5669
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
5670
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
5671
5672
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
5673
    var NAME = 'popover';
Mark Otto's avatar
Mark Otto committed
5674
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
    var DATA_KEY = 'bs.popover';
    var EVENT_KEY = "." + DATA_KEY;
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var CLASS_PREFIX = 'bs-popover';
    var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');

    var Default = _objectSpread({}, Tooltip.Default, {
      placement: 'right',
      trigger: 'click',
      content: '',
      template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
    });
Mark Otto's avatar
dist  
Mark Otto committed
5687

Mark Otto's avatar
dist    
Mark Otto committed
5688
5689
5690
    var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
      content: '(string|element|function)'
    });
Mark Otto's avatar
dist  
Mark Otto committed
5691

Mark Otto's avatar
dist    
Mark Otto committed
5692
5693
5694
    var ClassName = {
      FADE: 'fade',
      SHOW: 'show'
Mark Otto's avatar
dist  
Mark Otto committed
5695
    };
Mark Otto's avatar
dist    
Mark Otto committed
5696
5697
5698
    var Selector = {
      TITLE: '.popover-header',
      CONTENT: '.popover-body'
Mark Otto's avatar
dist  
Mark Otto committed
5699
    };
Mark Otto's avatar
dist    
Mark Otto committed
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
    var Event = {
      HIDE: "hide" + EVENT_KEY,
      HIDDEN: "hidden" + EVENT_KEY,
      SHOW: "show" + EVENT_KEY,
      SHOWN: "shown" + EVENT_KEY,
      INSERTED: "inserted" + EVENT_KEY,
      CLICK: "click" + EVENT_KEY,
      FOCUSIN: "focusin" + EVENT_KEY,
      FOCUSOUT: "focusout" + EVENT_KEY,
      MOUSEENTER: "mouseenter" + EVENT_KEY,
      MOUSELEAVE: "mouseleave" + EVENT_KEY
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
5716
5717
5718

    };

Mark Otto's avatar
dist    
Mark Otto committed
5719
5720
5721
5722
    var Popover =
    /*#__PURE__*/
    function (_Tooltip) {
      _inheritsLoose(Popover, _Tooltip);
Mark Otto's avatar
dist  
Mark Otto committed
5723

Mark Otto's avatar
dist    
Mark Otto committed
5724
5725
5726
      function Popover() {
        return _Tooltip.apply(this, arguments) || this;
      }
Mark Otto's avatar
Mark Otto committed
5727

Mark Otto's avatar
dist    
Mark Otto committed
5728
      var _proto = Popover.prototype;
Mark Otto's avatar
Mark Otto committed
5729

Mark Otto's avatar
dist    
Mark Otto committed
5730
5731
5732
5733
5734
5735
5736
5737
      // Overrides
      _proto.isWithContent = function isWithContent() {
        return this.getTitle() || this._getContent();
      };

      _proto.addAttachmentClass = function addAttachmentClass(attachment) {
        $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
      };
Mark Otto's avatar
Mark Otto committed
5738

Mark Otto's avatar
dist    
Mark Otto committed
5739
5740
5741
5742
      _proto.getTipElement = function getTipElement() {
        this.tip = this.tip || $$$1(this.config.template)[0];
        return this.tip;
      };
Mark Otto's avatar
dist  
Mark Otto committed
5743

Mark Otto's avatar
dist    
Mark Otto committed
5744
5745
      _proto.setContent = function setContent() {
        var $tip = $$$1(this.getTipElement()); // We use append for html objects to maintain js events
Mark Otto's avatar
dist  
Mark Otto committed
5746

Mark Otto's avatar
dist    
Mark Otto committed
5747
        this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
Mark Otto's avatar
dist  
Mark Otto committed
5748

Mark Otto's avatar
dist    
Mark Otto committed
5749
        var content = this._getContent();
Mark Otto's avatar
dist    
Mark Otto committed
5750

Mark Otto's avatar
dist    
Mark Otto committed
5751
5752
5753
5754
5755
5756
5757
        if (typeof content === 'function') {
          content = content.call(this.element);
        }

        this.setElementContent($tip.find(Selector.CONTENT), content);
        $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
      }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
5758
5759


Mark Otto's avatar
dist    
Mark Otto committed
5760
5761
5762
      _proto._getContent = function _getContent() {
        return this.element.getAttribute('data-content') || this.config.content;
      };
Mark Otto's avatar
dist    
Mark Otto committed
5763

Mark Otto's avatar
dist    
Mark Otto committed
5764
5765
5766
      _proto._cleanTipClass = function _cleanTipClass() {
        var $tip = $$$1(this.getTipElement());
        var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
Mark Otto's avatar
dist  
Mark Otto committed
5767

Mark Otto's avatar
dist    
Mark Otto committed
5768
5769
        if (tabClass !== null && tabClass.length > 0) {
          $tip.removeClass(tabClass.join(''));
Mark Otto's avatar
dist  
Mark Otto committed
5770
        }
Mark Otto's avatar
dist    
Mark Otto committed
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
      }; // Static


      Popover._jQueryInterface = function _jQueryInterface(config) {
        return this.each(function () {
          var data = $$$1(this).data(DATA_KEY);

          var _config = typeof config === 'object' ? config : null;

          if (!data && /destroy|hide/.test(config)) {
            return;
          }

          if (!data) {
            data = new Popover(this, _config);
            $$$1(this).data(DATA_KEY, data);
          }
Mark Otto's avatar
dist  
Mark Otto committed
5788

Mark Otto's avatar
dist    
Mark Otto committed
5789
5790
5791
5792
          if (typeof config === 'string') {
            if (typeof data[config] === 'undefined') {
              throw new TypeError("No method named \"" + config + "\"");
            }
Mark Otto's avatar
dist  
Mark Otto committed
5793

Mark Otto's avatar
dist    
Mark Otto committed
5794
            data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
5795
          }
Mark Otto's avatar
dist    
Mark Otto committed
5796
5797
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
5798

Mark Otto's avatar
dist    
Mark Otto committed
5799
5800
5801
5802
5803
      _createClass(Popover, null, [{
        key: "VERSION",
        // Getters
        get: function get() {
          return VERSION;
Mark Otto's avatar
dist  
Mark Otto committed
5804
        }
Mark Otto's avatar
dist    
Mark Otto committed
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
      }, {
        key: "Default",
        get: function get() {
          return Default;
        }
      }, {
        key: "NAME",
        get: function get() {
          return NAME;
        }
      }, {
        key: "DATA_KEY",
        get: function get() {
          return DATA_KEY;
        }
      }, {
        key: "Event",
        get: function get() {
          return Event;
        }
      }, {
        key: "EVENT_KEY",
        get: function get() {
          return EVENT_KEY;
        }
      }, {
        key: "DefaultType",
        get: function get() {
          return DefaultType;
        }
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
5836

Mark Otto's avatar
dist    
Mark Otto committed
5837
5838
5839
5840
5841
5842
5843
      return Popover;
    }(Tooltip);
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
5844
5845


Mark Otto's avatar
dist    
Mark Otto committed
5846
5847
    $$$1.fn[NAME] = Popover._jQueryInterface;
    $$$1.fn[NAME].Constructor = Popover;
Mark Otto's avatar
dist  
Mark Otto committed
5848

Mark Otto's avatar
dist    
Mark Otto committed
5849
5850
5851
5852
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Popover._jQueryInterface;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5853

Mark Otto's avatar
dist    
Mark Otto committed
5854
5855
    return Popover;
  }($);
Mark Otto's avatar
dist  
Mark Otto committed
5856
5857

  /**
Mark Otto's avatar
dist    
Mark Otto committed
5858
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
5859
   * Bootstrap (v4.1.3): scrollspy.js
Mark Otto's avatar
dist    
Mark Otto committed
5860
5861
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
5862
   */
Mark Otto's avatar
dist    
Mark Otto committed
5863
5864

  var ScrollSpy = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
5865
5866
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
5867
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
5868
5869
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
5870
    var NAME = 'scrollspy';
Mark Otto's avatar
Mark Otto committed
5871
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
    var DATA_KEY = 'bs.scrollspy';
    var EVENT_KEY = "." + DATA_KEY;
    var DATA_API_KEY = '.data-api';
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var Default = {
      offset: 10,
      method: 'auto',
      target: ''
    };
    var DefaultType = {
      offset: 'number',
      method: 'string',
      target: '(string|element)'
    };
    var Event = {
      ACTIVATE: "activate" + EVENT_KEY,
      SCROLL: "scroll" + EVENT_KEY,
      LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY
    };
    var ClassName = {
      DROPDOWN_ITEM: 'dropdown-item',
      DROPDOWN_MENU: 'dropdown-menu',
      ACTIVE: 'active'
    };
    var Selector = {
      DATA_SPY: '[data-spy="scroll"]',
      ACTIVE: '.active',
      NAV_LIST_GROUP: '.nav, .list-group',
      NAV_LINKS: '.nav-link',
      NAV_ITEMS: '.nav-item',
      LIST_ITEMS: '.list-group-item',
      DROPDOWN: '.dropdown',
      DROPDOWN_ITEMS: '.dropdown-item',
      DROPDOWN_TOGGLE: '.dropdown-toggle'
    };
    var OffsetMethod = {
      OFFSET: 'offset',
      POSITION: 'position'
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
5915

Mark Otto's avatar
dist    
Mark Otto committed
5916
    };
Mark Otto's avatar
dist  
Mark Otto committed
5917

Mark Otto's avatar
dist    
Mark Otto committed
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
    var ScrollSpy =
    /*#__PURE__*/
    function () {
      function ScrollSpy(element, config) {
        var _this = this;

        this._element = element;
        this._scrollElement = element.tagName === 'BODY' ? window : element;
        this._config = this._getConfig(config);
        this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS);
        this._offsets = [];
        this._targets = [];
        this._activeTarget = null;
        this._scrollHeight = 0;
        $$$1(this._scrollElement).on(Event.SCROLL, function (event) {
          return _this._process(event);
        });
        this.refresh();
Mark Otto's avatar
dist    
Mark Otto committed
5936

Mark Otto's avatar
dist    
Mark Otto committed
5937
5938
        this._process();
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
5939
5940


Mark Otto's avatar
dist    
Mark Otto committed
5941
      var _proto = ScrollSpy.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
5942

Mark Otto's avatar
dist    
Mark Otto committed
5943
5944
5945
      // Public
      _proto.refresh = function refresh() {
        var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
5946

Mark Otto's avatar
dist    
Mark Otto committed
5947
5948
5949
5950
5951
5952
        var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
        var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
        var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
        this._offsets = [];
        this._targets = [];
        this._scrollHeight = this._getScrollHeight();
Mark Otto's avatar
dist    
Mark Otto committed
5953
        var targets = [].slice.call(document.querySelectorAll(this._selector));
Mark Otto's avatar
dist    
Mark Otto committed
5954
5955
5956
        targets.map(function (element) {
          var target;
          var targetSelector = Util.getSelectorFromElement(element);
Mark Otto's avatar
dist  
Mark Otto committed
5957

Mark Otto's avatar
dist    
Mark Otto committed
5958
          if (targetSelector) {
Mark Otto's avatar
dist    
Mark Otto committed
5959
            target = document.querySelector(targetSelector);
Mark Otto's avatar
dist    
Mark Otto committed
5960
          }
Mark Otto's avatar
dist  
Mark Otto committed
5961

Mark Otto's avatar
dist    
Mark Otto committed
5962
5963
          if (target) {
            var targetBCR = target.getBoundingClientRect();
Mark Otto's avatar
dist    
Mark Otto committed
5964

Mark Otto's avatar
dist    
Mark Otto committed
5965
5966
5967
5968
            if (targetBCR.width || targetBCR.height) {
              // TODO (fat): remove sketch reliance on jQuery position/offset
              return [$$$1(target)[offsetMethod]().top + offsetBase, targetSelector];
            }
Mark Otto's avatar
dist  
Mark Otto committed
5969
          }
Mark Otto's avatar
dist    
Mark Otto committed
5970

Mark Otto's avatar
dist    
Mark Otto committed
5971
5972
5973
5974
5975
5976
5977
          return null;
        }).filter(function (item) {
          return item;
        }).sort(function (a, b) {
          return a[0] - b[0];
        }).forEach(function (item) {
          _this2._offsets.push(item[0]);
Mark Otto's avatar
dist    
Mark Otto committed
5978

Mark Otto's avatar
dist    
Mark Otto committed
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
          _this2._targets.push(item[1]);
        });
      };

      _proto.dispose = function dispose() {
        $$$1.removeData(this._element, DATA_KEY);
        $$$1(this._scrollElement).off(EVENT_KEY);
        this._element = null;
        this._scrollElement = null;
        this._config = null;
        this._selector = null;
        this._offsets = null;
        this._targets = null;
        this._activeTarget = null;
        this._scrollHeight = null;
      }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
5995
5996


Mark Otto's avatar
dist    
Mark Otto committed
5997
      _proto._getConfig = function _getConfig(config) {
Mark Otto's avatar
dist    
Mark Otto committed
5998
        config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {});
Mark Otto's avatar
dist  
Mark Otto committed
5999

Mark Otto's avatar
dist    
Mark Otto committed
6000
6001
        if (typeof config.target !== 'string') {
          var id = $$$1(config.target).attr('id');
Mark Otto's avatar
dist  
Mark Otto committed
6002

Mark Otto's avatar
dist    
Mark Otto committed
6003
6004
6005
6006
          if (!id) {
            id = Util.getUID(NAME);
            $$$1(config.target).attr('id', id);
          }
Mark Otto's avatar
dist    
Mark Otto committed
6007

Mark Otto's avatar
dist    
Mark Otto committed
6008
          config.target = "#" + id;
Mark Otto's avatar
dist  
Mark Otto committed
6009
        }
Mark Otto's avatar
dist    
Mark Otto committed
6010

Mark Otto's avatar
dist    
Mark Otto committed
6011
6012
6013
        Util.typeCheckConfig(NAME, config, DefaultType);
        return config;
      };
Mark Otto's avatar
dist  
Mark Otto committed
6014

Mark Otto's avatar
dist    
Mark Otto committed
6015
6016
6017
      _proto._getScrollTop = function _getScrollTop() {
        return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
      };
Mark Otto's avatar
dist  
Mark Otto committed
6018

Mark Otto's avatar
dist    
Mark Otto committed
6019
6020
6021
      _proto._getScrollHeight = function _getScrollHeight() {
        return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
      };
Mark Otto's avatar
dist  
Mark Otto committed
6022

Mark Otto's avatar
dist    
Mark Otto committed
6023
6024
6025
      _proto._getOffsetHeight = function _getOffsetHeight() {
        return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
      };
Mark Otto's avatar
dist  
Mark Otto committed
6026

Mark Otto's avatar
dist    
Mark Otto committed
6027
6028
      _proto._process = function _process() {
        var scrollTop = this._getScrollTop() + this._config.offset;
Mark Otto's avatar
dist  
Mark Otto committed
6029

Mark Otto's avatar
dist    
Mark Otto committed
6030
        var scrollHeight = this._getScrollHeight();
Mark Otto's avatar
dist    
Mark Otto committed
6031

Mark Otto's avatar
dist    
Mark Otto committed
6032
        var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
Mark Otto's avatar
dist    
Mark Otto committed
6033

Mark Otto's avatar
dist    
Mark Otto committed
6034
6035
6036
        if (this._scrollHeight !== scrollHeight) {
          this.refresh();
        }
Mark Otto's avatar
dist  
Mark Otto committed
6037

Mark Otto's avatar
dist    
Mark Otto committed
6038
6039
        if (scrollTop >= maxScroll) {
          var target = this._targets[this._targets.length - 1];
Mark Otto's avatar
dist  
Mark Otto committed
6040

Mark Otto's avatar
dist    
Mark Otto committed
6041
6042
6043
          if (this._activeTarget !== target) {
            this._activate(target);
          }
Mark Otto's avatar
dist  
Mark Otto committed
6044

Mark Otto's avatar
dist    
Mark Otto committed
6045
          return;
Mark Otto's avatar
dist  
Mark Otto committed
6046
        }
Mark Otto's avatar
dist    
Mark Otto committed
6047

Mark Otto's avatar
dist    
Mark Otto committed
6048
6049
        if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
          this._activeTarget = null;
Mark Otto's avatar
dist    
Mark Otto committed
6050

Mark Otto's avatar
dist    
Mark Otto committed
6051
          this._clear();
Mark Otto's avatar
dist    
Mark Otto committed
6052

Mark Otto's avatar
dist    
Mark Otto committed
6053
6054
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
6055

Mark Otto's avatar
dist    
Mark Otto committed
6056
6057
6058
        var offsetLength = this._offsets.length;

        for (var i = offsetLength; i--;) {
Mark Otto's avatar
dist    
Mark Otto committed
6059
          var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
Mark Otto's avatar
dist  
Mark Otto committed
6060

Mark Otto's avatar
dist    
Mark Otto committed
6061
6062
6063
          if (isActiveTarget) {
            this._activate(this._targets[i]);
          }
Mark Otto's avatar
dist  
Mark Otto committed
6064
        }
Mark Otto's avatar
dist    
Mark Otto committed
6065
      };
Mark Otto's avatar
dist  
Mark Otto committed
6066

Mark Otto's avatar
dist    
Mark Otto committed
6067
6068
      _proto._activate = function _activate(target) {
        this._activeTarget = target;
Mark Otto's avatar
dist  
Mark Otto committed
6069

Mark Otto's avatar
dist    
Mark Otto committed
6070
        this._clear();
Mark Otto's avatar
dist  
Mark Otto committed
6071

Mark Otto's avatar
dist    
Mark Otto committed
6072
        var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style
Mark Otto's avatar
dist    
Mark Otto committed
6073
6074


Mark Otto's avatar
dist    
Mark Otto committed
6075
6076
6077
        queries = queries.map(function (selector) {
          return selector + "[data-target=\"" + target + "\"]," + (selector + "[href=\"" + target + "\"]");
        });
Mark Otto's avatar
dist    
Mark Otto committed
6078
        var $link = $$$1([].slice.call(document.querySelectorAll(queries.join(','))));
Mark Otto's avatar
dist  
Mark Otto committed
6079

Mark Otto's avatar
dist    
Mark Otto committed
6080
6081
6082
6083
6084
6085
6086
        if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
          $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
          $link.addClass(ClassName.ACTIVE);
        } else {
          // Set triggered link as active
          $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active
          // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
Mark Otto's avatar
dist    
Mark Otto committed
6087

Mark Otto's avatar
dist    
Mark Otto committed
6088
          $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ", " + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item
Mark Otto's avatar
dist    
Mark Otto committed
6089

Mark Otto's avatar
dist    
Mark Otto committed
6090
6091
          $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6092

Mark Otto's avatar
dist    
Mark Otto committed
6093
6094
6095
6096
        $$$1(this._scrollElement).trigger(Event.ACTIVATE, {
          relatedTarget: target
        });
      };
Mark Otto's avatar
dist  
Mark Otto committed
6097

Mark Otto's avatar
dist    
Mark Otto committed
6098
      _proto._clear = function _clear() {
Mark Otto's avatar
dist    
Mark Otto committed
6099
6100
        var nodes = [].slice.call(document.querySelectorAll(this._selector));
        $$$1(nodes).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
6101
      }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
6102
6103


Mark Otto's avatar
dist    
Mark Otto committed
6104
6105
6106
      ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
        return this.each(function () {
          var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
6107

Mark Otto's avatar
dist    
Mark Otto committed
6108
          var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist  
Mark Otto committed
6109

Mark Otto's avatar
dist    
Mark Otto committed
6110
6111
6112
6113
6114
6115
6116
6117
6118
          if (!data) {
            data = new ScrollSpy(this, _config);
            $$$1(this).data(DATA_KEY, data);
          }

          if (typeof config === 'string') {
            if (typeof data[config] === 'undefined') {
              throw new TypeError("No method named \"" + config + "\"");
            }
Mark Otto's avatar
dist  
Mark Otto committed
6119

Mark Otto's avatar
dist    
Mark Otto committed
6120
            data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
6121
          }
Mark Otto's avatar
dist    
Mark Otto committed
6122
6123
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
6124

Mark Otto's avatar
dist    
Mark Otto committed
6125
6126
6127
6128
      _createClass(ScrollSpy, null, [{
        key: "VERSION",
        get: function get() {
          return VERSION;
Mark Otto's avatar
dist  
Mark Otto committed
6129
        }
Mark Otto's avatar
dist    
Mark Otto committed
6130
6131
6132
6133
6134
6135
      }, {
        key: "Default",
        get: function get() {
          return Default;
        }
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
6136

Mark Otto's avatar
dist    
Mark Otto committed
6137
6138
6139
6140
6141
6142
6143
      return ScrollSpy;
    }();
    /**
     * ------------------------------------------------------------------------
     * Data Api implementation
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
6144

Mark Otto's avatar
dist  
Mark Otto committed
6145

Mark Otto's avatar
dist    
Mark Otto committed
6146
    $$$1(window).on(Event.LOAD_DATA_API, function () {
Mark Otto's avatar
dist    
Mark Otto committed
6147
6148
      var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY));
      var scrollSpysLength = scrollSpys.length;
Mark Otto's avatar
dist    
Mark Otto committed
6149

Mark Otto's avatar
dist    
Mark Otto committed
6150
      for (var i = scrollSpysLength; i--;) {
Mark Otto's avatar
dist    
Mark Otto committed
6151
        var $spy = $$$1(scrollSpys[i]);
Mark Otto's avatar
dist  
Mark Otto committed
6152

Mark Otto's avatar
dist    
Mark Otto committed
6153
6154
6155
6156
6157
6158
6159
6160
        ScrollSpy._jQueryInterface.call($spy, $spy.data());
      }
    });
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
6161

Mark Otto's avatar
dist    
Mark Otto committed
6162
6163
    $$$1.fn[NAME] = ScrollSpy._jQueryInterface;
    $$$1.fn[NAME].Constructor = ScrollSpy;
Mark Otto's avatar
dist  
Mark Otto committed
6164

Mark Otto's avatar
dist    
Mark Otto committed
6165
6166
6167
6168
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return ScrollSpy._jQueryInterface;
    };
Mark Otto's avatar
dist  
Mark Otto committed
6169

Mark Otto's avatar
dist    
Mark Otto committed
6170
6171
    return ScrollSpy;
  }($);
Mark Otto's avatar
dist  
Mark Otto committed
6172
6173

  /**
Mark Otto's avatar
dist    
Mark Otto committed
6174
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
6175
   * Bootstrap (v4.1.3): tab.js
Mark Otto's avatar
dist    
Mark Otto committed
6176
6177
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
6178
   */
Mark Otto's avatar
dist    
Mark Otto committed
6179
6180

  var Tab = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
6181
6182
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
6183
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
6184
6185
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
6186
    var NAME = 'tab';
Mark Otto's avatar
Mark Otto committed
6187
    var VERSION = '4.1.3';
Mark Otto's avatar
dist    
Mark Otto committed
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
    var DATA_KEY = 'bs.tab';
    var EVENT_KEY = "." + DATA_KEY;
    var DATA_API_KEY = '.data-api';
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var Event = {
      HIDE: "hide" + EVENT_KEY,
      HIDDEN: "hidden" + EVENT_KEY,
      SHOW: "show" + EVENT_KEY,
      SHOWN: "shown" + EVENT_KEY,
      CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
    };
    var ClassName = {
      DROPDOWN_MENU: 'dropdown-menu',
      ACTIVE: 'active',
      DISABLED: 'disabled',
      FADE: 'fade',
      SHOW: 'show'
    };
    var Selector = {
      DROPDOWN: '.dropdown',
      NAV_LIST_GROUP: '.nav, .list-group',
      ACTIVE: '.active',
      ACTIVE_UL: '> li > .active',
      DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
      DROPDOWN_TOGGLE: '.dropdown-toggle',
      DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
6219

Mark Otto's avatar
dist    
Mark Otto committed
6220
    };
Mark Otto's avatar
dist  
Mark Otto committed
6221

Mark Otto's avatar
dist    
Mark Otto committed
6222
6223
6224
6225
6226
6227
    var Tab =
    /*#__PURE__*/
    function () {
      function Tab(element) {
        this._element = element;
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
6228
6229


Mark Otto's avatar
dist    
Mark Otto committed
6230
      var _proto = Tab.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
6231

Mark Otto's avatar
dist    
Mark Otto committed
6232
6233
6234
      // Public
      _proto.show = function show() {
        var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
6235

Mark Otto's avatar
dist    
Mark Otto committed
6236
6237
6238
        if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
6239

Mark Otto's avatar
dist    
Mark Otto committed
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
        var target;
        var previous;
        var listElement = $$$1(this._element).closest(Selector.NAV_LIST_GROUP)[0];
        var selector = Util.getSelectorFromElement(this._element);

        if (listElement) {
          var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;
          previous = $$$1.makeArray($$$1(listElement).find(itemSelector));
          previous = previous[previous.length - 1];
        }
Mark Otto's avatar
dist  
Mark Otto committed
6250

Mark Otto's avatar
dist    
Mark Otto committed
6251
6252
6253
6254
6255
6256
        var hideEvent = $$$1.Event(Event.HIDE, {
          relatedTarget: this._element
        });
        var showEvent = $$$1.Event(Event.SHOW, {
          relatedTarget: previous
        });
Mark Otto's avatar
dist  
Mark Otto committed
6257

Mark Otto's avatar
dist    
Mark Otto committed
6258
6259
6260
        if (previous) {
          $$$1(previous).trigger(hideEvent);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6261

Mark Otto's avatar
dist    
Mark Otto committed
6262
        $$$1(this._element).trigger(showEvent);
Mark Otto's avatar
dist  
Mark Otto committed
6263

Mark Otto's avatar
dist    
Mark Otto committed
6264
6265
6266
        if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
6267

Mark Otto's avatar
dist    
Mark Otto committed
6268
        if (selector) {
Mark Otto's avatar
dist    
Mark Otto committed
6269
          target = document.querySelector(selector);
Mark Otto's avatar
dist    
Mark Otto committed
6270
        }
Mark Otto's avatar
dist  
Mark Otto committed
6271

Mark Otto's avatar
dist    
Mark Otto committed
6272
        this._activate(this._element, listElement);
Mark Otto's avatar
dist  
Mark Otto committed
6273

Mark Otto's avatar
dist    
Mark Otto committed
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
        var complete = function complete() {
          var hiddenEvent = $$$1.Event(Event.HIDDEN, {
            relatedTarget: _this._element
          });
          var shownEvent = $$$1.Event(Event.SHOWN, {
            relatedTarget: previous
          });
          $$$1(previous).trigger(hiddenEvent);
          $$$1(_this._element).trigger(shownEvent);
        };

        if (target) {
          this._activate(target, target.parentNode, complete);
        } else {
          complete();
        }
Mark Otto's avatar
dist  
Mark Otto committed
6290
6291
      };

Mark Otto's avatar
dist    
Mark Otto committed
6292
6293
6294
6295
      _proto.dispose = function dispose() {
        $$$1.removeData(this._element, DATA_KEY);
        this._element = null;
      }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
6296
6297


Mark Otto's avatar
dist    
Mark Otto committed
6298
6299
      _proto._activate = function _activate(element, container, callback) {
        var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
6300

Mark Otto's avatar
dist    
Mark Otto committed
6301
        var activeElements;
Mark Otto's avatar
dist  
Mark Otto committed
6302

Mark Otto's avatar
dist    
Mark Otto committed
6303
6304
6305
6306
6307
        if (container.nodeName === 'UL') {
          activeElements = $$$1(container).find(Selector.ACTIVE_UL);
        } else {
          activeElements = $$$1(container).children(Selector.ACTIVE);
        }
Mark Otto's avatar
dist    
Mark Otto committed
6308

Mark Otto's avatar
dist    
Mark Otto committed
6309
6310
        var active = activeElements[0];
        var isTransitioning = callback && active && $$$1(active).hasClass(ClassName.FADE);
Mark Otto's avatar
dist  
Mark Otto committed
6311

Mark Otto's avatar
dist    
Mark Otto committed
6312
6313
6314
        var complete = function complete() {
          return _this2._transitionComplete(element, active, callback);
        };
Mark Otto's avatar
dist  
Mark Otto committed
6315

Mark Otto's avatar
dist    
Mark Otto committed
6316
6317
6318
6319
6320
6321
        if (active && isTransitioning) {
          var transitionDuration = Util.getTransitionDurationFromElement(active);
          $$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
        } else {
          complete();
        }
Mark Otto's avatar
dist  
Mark Otto committed
6322
6323
      };

Mark Otto's avatar
dist    
Mark Otto committed
6324
6325
6326
6327
      _proto._transitionComplete = function _transitionComplete(element, active, callback) {
        if (active) {
          $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
          var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
Mark Otto's avatar
dist  
Mark Otto committed
6328

Mark Otto's avatar
dist    
Mark Otto committed
6329
6330
6331
          if (dropdownChild) {
            $$$1(dropdownChild).removeClass(ClassName.ACTIVE);
          }
Mark Otto's avatar
dist  
Mark Otto committed
6332

Mark Otto's avatar
dist    
Mark Otto committed
6333
6334
6335
          if (active.getAttribute('role') === 'tab') {
            active.setAttribute('aria-selected', false);
          }
Mark Otto's avatar
dist  
Mark Otto committed
6336
6337
        }

Mark Otto's avatar
dist    
Mark Otto committed
6338
        $$$1(element).addClass(ClassName.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
6339

Mark Otto's avatar
dist    
Mark Otto committed
6340
6341
6342
        if (element.getAttribute('role') === 'tab') {
          element.setAttribute('aria-selected', true);
        }
Mark Otto's avatar
dist    
Mark Otto committed
6343

Mark Otto's avatar
dist    
Mark Otto committed
6344
6345
        Util.reflow(element);
        $$$1(element).addClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
6346

Mark Otto's avatar
dist    
Mark Otto committed
6347
6348
        if (element.parentNode && $$$1(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
          var dropdownElement = $$$1(element).closest(Selector.DROPDOWN)[0];
Mark Otto's avatar
dist  
Mark Otto committed
6349

Mark Otto's avatar
dist    
Mark Otto committed
6350
          if (dropdownElement) {
Mark Otto's avatar
dist    
Mark Otto committed
6351
6352
            var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE));
            $$$1(dropdownToggleList).addClass(ClassName.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
6353
          }
Mark Otto's avatar
dist    
Mark Otto committed
6354

Mark Otto's avatar
dist    
Mark Otto committed
6355
          element.setAttribute('aria-expanded', true);
Mark Otto's avatar
dist  
Mark Otto committed
6356
6357
        }

Mark Otto's avatar
dist    
Mark Otto committed
6358
6359
6360
6361
        if (callback) {
          callback();
        }
      }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
6362
6363


Mark Otto's avatar
dist    
Mark Otto committed
6364
6365
6366
6367
      Tab._jQueryInterface = function _jQueryInterface(config) {
        return this.each(function () {
          var $this = $$$1(this);
          var data = $this.data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
6368

Mark Otto's avatar
dist    
Mark Otto committed
6369
6370
6371
6372
          if (!data) {
            data = new Tab(this);
            $this.data(DATA_KEY, data);
          }
Mark Otto's avatar
dist  
Mark Otto committed
6373

Mark Otto's avatar
dist    
Mark Otto committed
6374
6375
6376
6377
          if (typeof config === 'string') {
            if (typeof data[config] === 'undefined') {
              throw new TypeError("No method named \"" + config + "\"");
            }
Mark Otto's avatar
dist  
Mark Otto committed
6378

Mark Otto's avatar
dist    
Mark Otto committed
6379
            data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
6380
          }
Mark Otto's avatar
dist    
Mark Otto committed
6381
6382
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
6383

Mark Otto's avatar
dist    
Mark Otto committed
6384
6385
6386
6387
      _createClass(Tab, null, [{
        key: "VERSION",
        get: function get() {
          return VERSION;
Mark Otto's avatar
dist  
Mark Otto committed
6388
        }
Mark Otto's avatar
dist    
Mark Otto committed
6389
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
6390

Mark Otto's avatar
dist    
Mark Otto committed
6391
6392
6393
6394
6395
6396
6397
      return Tab;
    }();
    /**
     * ------------------------------------------------------------------------
     * Data Api implementation
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
6398

Mark Otto's avatar
dist    
Mark Otto committed
6399

Mark Otto's avatar
dist    
Mark Otto committed
6400
6401
    $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
      event.preventDefault();
Mark Otto's avatar
dist    
Mark Otto committed
6402

Mark Otto's avatar
dist    
Mark Otto committed
6403
6404
6405
6406
6407
6408
6409
      Tab._jQueryInterface.call($$$1(this), 'show');
    });
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
6410

Mark Otto's avatar
dist    
Mark Otto committed
6411
6412
    $$$1.fn[NAME] = Tab._jQueryInterface;
    $$$1.fn[NAME].Constructor = Tab;
Mark Otto's avatar
dist    
Mark Otto committed
6413

Mark Otto's avatar
dist    
Mark Otto committed
6414
6415
6416
6417
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
      return Tab._jQueryInterface;
    };
Mark Otto's avatar
dist  
Mark Otto committed
6418

Mark Otto's avatar
dist    
Mark Otto committed
6419
6420
    return Tab;
  }($);
Mark Otto's avatar
dist  
Mark Otto committed
6421

Mark Otto's avatar
dist    
Mark Otto committed
6422
6423
  /**
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
6424
   * Bootstrap (v4.1.3): index.js
Mark Otto's avatar
dist    
Mark Otto committed
6425
6426
6427
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
6428

Mark Otto's avatar
dist    
Mark Otto committed
6429
6430
6431
6432
  (function ($$$1) {
    if (typeof $$$1 === 'undefined') {
      throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
    }
Mark Otto's avatar
dist  
Mark Otto committed
6433

Mark Otto's avatar
dist    
Mark Otto committed
6434
6435
6436
6437
6438
6439
    var version = $$$1.fn.jquery.split(' ')[0].split('.');
    var minMajor = 1;
    var ltMajor = 2;
    var minMinor = 9;
    var minPatch = 1;
    var maxMajor = 4;
Mark Otto's avatar
dist    
Mark Otto committed
6440

Mark Otto's avatar
dist    
Mark Otto committed
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
    if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
      throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
    }
  })($);

  exports.Util = Util;
  exports.Alert = Alert;
  exports.Button = Button;
  exports.Carousel = Carousel;
  exports.Collapse = Collapse;
  exports.Dropdown = Dropdown;
  exports.Modal = Modal;
  exports.Popover = Popover;
  exports.Scrollspy = ScrollSpy;
  exports.Tab = Tab;
  exports.Tooltip = Tooltip;

  Object.defineProperty(exports, '__esModule', { value: true });
Mark Otto's avatar
dist  
Mark Otto committed
6459

Mark Otto's avatar
dist    
Mark Otto committed
6460
})));
Mark Otto's avatar
dist    
Mark Otto committed
6461
//# sourceMappingURL=bootstrap.bundle.js.map