bootstrap.bundle.js 191 KB
Newer Older
Mark Otto's avatar
dist  
Mark Otto committed
1
/*!
Mark Otto's avatar
Mark Otto committed
2
  * Bootstrap v4.0.0 (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
7
8
9
10
(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
	typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
	(factory((global.bootstrap = {}),global.jQuery));
}(this, (function (exports,$) { 'use strict';
Mark Otto's avatar
dist  
Mark Otto committed
11
12
13

$ = $ && $.hasOwnProperty('default') ? $['default'] : $;

Mark Otto's avatar
Mark Otto committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
dist    
Mark Otto committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function _extends() {
  _extends = Object.assign || function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];

      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }

    return target;
  };

  return _extends.apply(this, arguments);
}

Mark Otto's avatar
Mark Otto committed
48
49
50
51
52
53
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
54
55
/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
56
 * Bootstrap (v4.0.0): util.js
Mark Otto's avatar
dist  
Mark Otto committed
57
58
59
60
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
61
var Util = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
62
63
64
65
66
67
  /**
   * ------------------------------------------------------------------------
   * Private TransitionEnd Helpers
   * ------------------------------------------------------------------------
   */
  var transition = false;
Mark Otto's avatar
dist    
Mark Otto committed
68
  var MAX_UID = 1000000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
Mark Otto's avatar
dist  
Mark Otto committed
69

Mark Otto's avatar
dist    
Mark Otto committed
70
  function toType(obj) {
Mark Otto's avatar
dist    
Mark Otto committed
71
    return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
Mark Otto's avatar
dist  
Mark Otto committed
72
73
74
75
76
77
78
  }

  function getSpecialTransitionEndEvent() {
    return {
      bindType: transition.end,
      delegateType: transition.end,
      handle: function handle(event) {
Mark Otto's avatar
dist    
Mark Otto committed
79
        if ($$$1(event.target).is(this)) {
Mark Otto's avatar
dist  
Mark Otto committed
80
81
          return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
        }
Mark Otto's avatar
dist    
Mark Otto committed
82

Mark Otto's avatar
dist  
Mark Otto committed
83
84
85
86
87
88
        return undefined; // eslint-disable-line no-undefined
      }
    };
  }

  function transitionEndTest() {
Mark Otto's avatar
dist    
Mark Otto committed
89
    if (typeof window !== 'undefined' && window.QUnit) {
Mark Otto's avatar
dist  
Mark Otto committed
90
91
92
      return false;
    }

Mark Otto's avatar
dist    
Mark Otto committed
93
94
95
    return {
      end: 'transitionend'
    };
Mark Otto's avatar
dist  
Mark Otto committed
96
97
98
99
100
101
  }

  function transitionEndEmulator(duration) {
    var _this = this;

    var called = false;
Mark Otto's avatar
dist    
Mark Otto committed
102
    $$$1(this).one(Util.TRANSITION_END, function () {
Mark Otto's avatar
dist  
Mark Otto committed
103
104
105
106
107
108
109
110
111
112
113
114
      called = true;
    });
    setTimeout(function () {
      if (!called) {
        Util.triggerTransitionEnd(_this);
      }
    }, duration);
    return this;
  }

  function setTransitionEndSupport() {
    transition = transitionEndTest();
Mark Otto's avatar
dist    
Mark Otto committed
115
    $$$1.fn.emulateTransitionEnd = transitionEndEmulator;
Mark Otto's avatar
dist  
Mark Otto committed
116
117

    if (Util.supportsTransitionEnd()) {
Mark Otto's avatar
dist    
Mark Otto committed
118
      $$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
Mark Otto's avatar
dist  
Mark Otto committed
119
120
121
122
123
124
125
126
127
    }
  }
  /**
   * --------------------------------------------------------------------------
   * Public Util Api
   * --------------------------------------------------------------------------
   */


Mark Otto's avatar
dist    
Mark Otto committed
128
  var Util = {
Mark Otto's avatar
dist  
Mark Otto committed
129
130
131
132
133
134
    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
135

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

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

      try {
Mark Otto's avatar
dist    
Mark Otto committed
146
        var $selector = $$$1(document).find(selector);
Mark Otto's avatar
dist  
Mark Otto committed
147
        return $selector.length > 0 ? selector : null;
Mark Otto's avatar
dist    
Mark Otto committed
148
      } catch (err) {
Mark Otto's avatar
dist  
Mark Otto committed
149
150
151
152
153
154
155
        return null;
      }
    },
    reflow: function reflow(element) {
      return element.offsetHeight;
    },
    triggerTransitionEnd: function triggerTransitionEnd(element) {
Mark Otto's avatar
dist    
Mark Otto committed
156
      $$$1(element).trigger(transition.end);
Mark Otto's avatar
dist  
Mark Otto committed
157
158
159
160
    },
    supportsTransitionEnd: function supportsTransitionEnd() {
      return Boolean(transition);
    },
Mark Otto's avatar
dist    
Mark Otto committed
161
162
163
    isElement: function isElement(obj) {
      return (obj[0] || obj).nodeType;
    },
Mark Otto's avatar
dist  
Mark Otto committed
164
165
166
167
168
    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];
Mark Otto's avatar
dist    
Mark Otto committed
169
          var valueType = value && Util.isElement(value) ? 'element' : toType(value);
Mark Otto's avatar
dist  
Mark Otto committed
170
171

          if (!new RegExp(expectedTypes).test(valueType)) {
Mark Otto's avatar
dist    
Mark Otto committed
172
            throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
Mark Otto's avatar
dist  
Mark Otto committed
173
174
175
176
177
178
179
          }
        }
      }
    }
  };
  setTransitionEndSupport();
  return Util;
Mark Otto's avatar
dist    
Mark Otto committed
180
}($);
Mark Otto's avatar
dist  
Mark Otto committed
181
182
183

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
184
 * Bootstrap (v4.0.0): alert.js
Mark Otto's avatar
dist  
Mark Otto committed
185
186
187
188
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
189
var Alert = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
190
191
192
193
194
195
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'alert';
Mark Otto's avatar
Mark Otto committed
196
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
197
  var DATA_KEY = 'bs.alert';
Mark Otto's avatar
dist    
Mark Otto committed
198
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist  
Mark Otto committed
199
  var DATA_API_KEY = '.data-api';
Mark Otto's avatar
dist    
Mark Otto committed
200
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
201
202
203
204
205
  var TRANSITION_DURATION = 150;
  var Selector = {
    DISMISS: '[data-dismiss="alert"]'
  };
  var Event = {
Mark Otto's avatar
dist    
Mark Otto committed
206
207
208
    CLOSE: "close" + EVENT_KEY,
    CLOSED: "closed" + EVENT_KEY,
    CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
Mark Otto's avatar
dist  
Mark Otto committed
209
210
211
212
213
  };
  var ClassName = {
    ALERT: 'alert',
    FADE: 'fade',
    SHOW: 'show'
Mark Otto's avatar
dist    
Mark Otto committed
214
215
216
217
218
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
219

Mark Otto's avatar
dist    
Mark Otto committed
220
  };
Mark Otto's avatar
dist  
Mark Otto committed
221

Mark Otto's avatar
dist    
Mark Otto committed
222
223
224
225
  var Alert =
  /*#__PURE__*/
  function () {
    function Alert(element) {
Mark Otto's avatar
dist  
Mark Otto committed
226
      this._element = element;
Mark Otto's avatar
dist    
Mark Otto committed
227
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
228
229


Mark Otto's avatar
dist    
Mark Otto committed
230
    var _proto = Alert.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
231

Mark Otto's avatar
dist    
Mark Otto committed
232
    // Public
Mark Otto's avatar
dist    
Mark Otto committed
233
    _proto.close = function close(element) {
Mark Otto's avatar
dist  
Mark Otto committed
234
235
236
      element = element || this._element;

      var rootElement = this._getRootElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
237

Mark Otto's avatar
dist  
Mark Otto committed
238
239
240
241
242
243
244
245
246
      var customEvent = this._triggerCloseEvent(rootElement);

      if (customEvent.isDefaultPrevented()) {
        return;
      }

      this._removeElement(rootElement);
    };

Mark Otto's avatar
dist    
Mark Otto committed
247
    _proto.dispose = function dispose() {
Mark Otto's avatar
dist    
Mark Otto committed
248
      $$$1.removeData(this._element, DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
249
      this._element = null;
Mark Otto's avatar
dist    
Mark Otto committed
250
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
251
252


Mark Otto's avatar
dist    
Mark Otto committed
253
    _proto._getRootElement = function _getRootElement(element) {
Mark Otto's avatar
dist  
Mark Otto committed
254
255
256
257
      var selector = Util.getSelectorFromElement(element);
      var parent = false;

      if (selector) {
Mark Otto's avatar
dist    
Mark Otto committed
258
        parent = $$$1(selector)[0];
Mark Otto's avatar
dist  
Mark Otto committed
259
260
261
      }

      if (!parent) {
Mark Otto's avatar
dist    
Mark Otto committed
262
        parent = $$$1(element).closest("." + ClassName.ALERT)[0];
Mark Otto's avatar
dist  
Mark Otto committed
263
264
265
266
267
      }

      return parent;
    };

Mark Otto's avatar
dist    
Mark Otto committed
268
    _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
Mark Otto's avatar
dist    
Mark Otto committed
269
270
      var closeEvent = $$$1.Event(Event.CLOSE);
      $$$1(element).trigger(closeEvent);
Mark Otto's avatar
dist  
Mark Otto committed
271
272
273
      return closeEvent;
    };

Mark Otto's avatar
dist    
Mark Otto committed
274
    _proto._removeElement = function _removeElement(element) {
Mark Otto's avatar
dist  
Mark Otto committed
275
276
      var _this = this;

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

Mark Otto's avatar
dist    
Mark Otto committed
279
      if (!Util.supportsTransitionEnd() || !$$$1(element).hasClass(ClassName.FADE)) {
Mark Otto's avatar
dist  
Mark Otto committed
280
        this._destroyElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
281

Mark Otto's avatar
dist  
Mark Otto committed
282
283
284
        return;
      }

Mark Otto's avatar
dist    
Mark Otto committed
285
      $$$1(element).one(Util.TRANSITION_END, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
286
287
288
289
        return _this._destroyElement(element, event);
      }).emulateTransitionEnd(TRANSITION_DURATION);
    };

Mark Otto's avatar
dist    
Mark Otto committed
290
    _proto._destroyElement = function _destroyElement(element) {
Mark Otto's avatar
dist    
Mark Otto committed
291
      $$$1(element).detach().trigger(Event.CLOSED).remove();
Mark Otto's avatar
dist    
Mark Otto committed
292
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
293
294
295
296


    Alert._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
Mark Otto's avatar
dist    
Mark Otto committed
297
        var $element = $$$1(this);
Mark Otto's avatar
dist  
Mark Otto committed
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
        var data = $element.data(DATA_KEY);

        if (!data) {
          data = new Alert(this);
          $element.data(DATA_KEY, data);
        }

        if (config === 'close') {
          data[config](this);
        }
      });
    };

    Alert._handleDismiss = function _handleDismiss(alertInstance) {
      return function (event) {
        if (event) {
          event.preventDefault();
        }

        alertInstance.close(this);
      };
    };

Mark Otto's avatar
Mark Otto committed
321
    _createClass(Alert, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
322
      key: "VERSION",
Mark Otto's avatar
dist  
Mark Otto committed
323
324
325
326
327
328
329
330
331
332
333
334
335
      get: function get() {
        return VERSION;
      }
    }]);
    return Alert;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */


Mark Otto's avatar
dist    
Mark Otto committed
336
  $$$1(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
Mark Otto's avatar
dist  
Mark Otto committed
337
338
339
340
341
342
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
343
344
  $$$1.fn[NAME] = Alert._jQueryInterface;
  $$$1.fn[NAME].Constructor = Alert;
Mark Otto's avatar
dist    
Mark Otto committed
345

Mark Otto's avatar
dist    
Mark Otto committed
346
347
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
348
349
350
351
    return Alert._jQueryInterface;
  };

  return Alert;
Mark Otto's avatar
dist    
Mark Otto committed
352
}($);
Mark Otto's avatar
dist  
Mark Otto committed
353
354
355

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
356
 * Bootstrap (v4.0.0): button.js
Mark Otto's avatar
dist  
Mark Otto committed
357
358
359
360
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
361
var Button = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
362
363
364
365
366
367
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'button';
Mark Otto's avatar
Mark Otto committed
368
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
369
  var DATA_KEY = 'bs.button';
Mark Otto's avatar
dist    
Mark Otto committed
370
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist  
Mark Otto committed
371
  var DATA_API_KEY = '.data-api';
Mark Otto's avatar
dist    
Mark Otto committed
372
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
373
374
375
376
377
378
379
380
381
382
383
384
385
  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 = {
Mark Otto's avatar
dist    
Mark Otto committed
386
387
    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)
Mark Otto's avatar
dist    
Mark Otto committed
388
389
390
391
392
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
393

Mark Otto's avatar
dist    
Mark Otto committed
394
  };
Mark Otto's avatar
dist  
Mark Otto committed
395

Mark Otto's avatar
dist    
Mark Otto committed
396
397
398
399
  var Button =
  /*#__PURE__*/
  function () {
    function Button(element) {
Mark Otto's avatar
dist  
Mark Otto committed
400
      this._element = element;
Mark Otto's avatar
dist    
Mark Otto committed
401
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
402
403


Mark Otto's avatar
dist    
Mark Otto committed
404
    var _proto = Button.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
405

Mark Otto's avatar
dist    
Mark Otto committed
406
    // Public
Mark Otto's avatar
dist    
Mark Otto committed
407
    _proto.toggle = function toggle() {
Mark Otto's avatar
dist  
Mark Otto committed
408
409
      var triggerChangeEvent = true;
      var addAriaPressed = true;
Mark Otto's avatar
dist    
Mark Otto committed
410
      var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];
Mark Otto's avatar
dist  
Mark Otto committed
411
412

      if (rootElement) {
Mark Otto's avatar
dist    
Mark Otto committed
413
        var input = $$$1(this._element).find(Selector.INPUT)[0];
Mark Otto's avatar
dist  
Mark Otto committed
414
415
416

        if (input) {
          if (input.type === 'radio') {
Mark Otto's avatar
dist    
Mark Otto committed
417
            if (input.checked && $$$1(this._element).hasClass(ClassName.ACTIVE)) {
Mark Otto's avatar
dist  
Mark Otto committed
418
419
              triggerChangeEvent = false;
            } else {
Mark Otto's avatar
dist    
Mark Otto committed
420
              var activeElement = $$$1(rootElement).find(Selector.ACTIVE)[0];
Mark Otto's avatar
dist  
Mark Otto committed
421
422

              if (activeElement) {
Mark Otto's avatar
dist    
Mark Otto committed
423
                $$$1(activeElement).removeClass(ClassName.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
424
425
426
427
428
429
430
431
              }
            }
          }

          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
432

Mark Otto's avatar
dist    
Mark Otto committed
433
434
            input.checked = !$$$1(this._element).hasClass(ClassName.ACTIVE);
            $$$1(input).trigger('change');
Mark Otto's avatar
dist  
Mark Otto committed
435
436
437
438
439
440
441
442
          }

          input.focus();
          addAriaPressed = false;
        }
      }

      if (addAriaPressed) {
Mark Otto's avatar
dist    
Mark Otto committed
443
        this._element.setAttribute('aria-pressed', !$$$1(this._element).hasClass(ClassName.ACTIVE));
Mark Otto's avatar
dist  
Mark Otto committed
444
445
446
      }

      if (triggerChangeEvent) {
Mark Otto's avatar
dist    
Mark Otto committed
447
        $$$1(this._element).toggleClass(ClassName.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
448
449
450
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
451
    _proto.dispose = function dispose() {
Mark Otto's avatar
dist    
Mark Otto committed
452
      $$$1.removeData(this._element, DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
453
      this._element = null;
Mark Otto's avatar
dist    
Mark Otto committed
454
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
455
456
457
458


    Button._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
Mark Otto's avatar
dist    
Mark Otto committed
459
        var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
460
461
462

        if (!data) {
          data = new Button(this);
Mark Otto's avatar
dist    
Mark Otto committed
463
          $$$1(this).data(DATA_KEY, data);
Mark Otto's avatar
dist  
Mark Otto committed
464
465
466
467
468
469
470
471
        }

        if (config === 'toggle') {
          data[config]();
        }
      });
    };

Mark Otto's avatar
Mark Otto committed
472
    _createClass(Button, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
473
      key: "VERSION",
Mark Otto's avatar
dist  
Mark Otto committed
474
475
476
477
478
479
480
481
482
483
484
485
      get: function get() {
        return VERSION;
      }
    }]);
    return Button;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
486

Mark Otto's avatar
dist    
Mark Otto committed
487
  $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
488
489
490
    event.preventDefault();
    var button = event.target;

Mark Otto's avatar
dist    
Mark Otto committed
491
492
    if (!$$$1(button).hasClass(ClassName.BUTTON)) {
      button = $$$1(button).closest(Selector.BUTTON);
Mark Otto's avatar
dist  
Mark Otto committed
493
494
    }

Mark Otto's avatar
dist    
Mark Otto committed
495
    Button._jQueryInterface.call($$$1(button), 'toggle');
Mark Otto's avatar
dist  
Mark Otto committed
496
  }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
Mark Otto's avatar
dist    
Mark Otto committed
497
498
    var button = $$$1(event.target).closest(Selector.BUTTON)[0];
    $$$1(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
Mark Otto's avatar
dist  
Mark Otto committed
499
500
501
502
503
504
505
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
506
507
  $$$1.fn[NAME] = Button._jQueryInterface;
  $$$1.fn[NAME].Constructor = Button;
Mark Otto's avatar
dist    
Mark Otto committed
508

Mark Otto's avatar
dist    
Mark Otto committed
509
510
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
511
512
513
514
    return Button._jQueryInterface;
  };

  return Button;
Mark Otto's avatar
dist    
Mark Otto committed
515
}($);
Mark Otto's avatar
dist  
Mark Otto committed
516
517
518

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
519
 * Bootstrap (v4.0.0): carousel.js
Mark Otto's avatar
dist  
Mark Otto committed
520
521
522
523
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
524
var Carousel = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
525
526
527
528
529
530
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'carousel';
Mark Otto's avatar
Mark Otto committed
531
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
532
  var DATA_KEY = 'bs.carousel';
Mark Otto's avatar
dist    
Mark Otto committed
533
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist  
Mark Otto committed
534
  var DATA_API_KEY = '.data-api';
Mark Otto's avatar
dist    
Mark Otto committed
535
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
536
537
  var TRANSITION_DURATION = 600;
  var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
Mark Otto's avatar
dist    
Mark Otto committed
538

Mark Otto's avatar
dist  
Mark Otto committed
539
  var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
Mark Otto's avatar
dist    
Mark Otto committed
540

Mark Otto's avatar
dist  
Mark Otto committed
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
  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
  };
  var DefaultType = {
    interval: '(number|boolean)',
    keyboard: 'boolean',
    slide: '(boolean|string)',
    pause: '(string|boolean)',
    wrap: 'boolean'
  };
  var Direction = {
    NEXT: 'next',
    PREV: 'prev',
    LEFT: 'left',
    RIGHT: 'right'
  };
  var Event = {
Mark Otto's avatar
dist    
Mark Otto committed
564
565
566
567
568
569
570
571
    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
Mark Otto's avatar
dist  
Mark Otto committed
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
  };
  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"]'
Mark Otto's avatar
dist    
Mark Otto committed
591
592
593
594
595
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
596

Mark Otto's avatar
dist    
Mark Otto committed
597
  };
Mark Otto's avatar
dist  
Mark Otto committed
598

Mark Otto's avatar
dist    
Mark Otto committed
599
600
601
602
  var Carousel =
  /*#__PURE__*/
  function () {
    function Carousel(element, config) {
Mark Otto's avatar
dist  
Mark Otto committed
603
604
605
606
607
608
609
      this._items = null;
      this._interval = null;
      this._activeElement = null;
      this._isPaused = false;
      this._isSliding = false;
      this.touchTimeout = null;
      this._config = this._getConfig(config);
Mark Otto's avatar
dist    
Mark Otto committed
610
611
      this._element = $$$1(element)[0];
      this._indicatorsElement = $$$1(this._element).find(Selector.INDICATORS)[0];
Mark Otto's avatar
dist  
Mark Otto committed
612
613

      this._addEventListeners();
Mark Otto's avatar
dist    
Mark Otto committed
614
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
615
616


Mark Otto's avatar
dist    
Mark Otto committed
617
    var _proto = Carousel.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
618

Mark Otto's avatar
dist    
Mark Otto committed
619
    // Public
Mark Otto's avatar
dist    
Mark Otto committed
620
    _proto.next = function next() {
Mark Otto's avatar
dist  
Mark Otto committed
621
622
623
624
625
      if (!this._isSliding) {
        this._slide(Direction.NEXT);
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
626
    _proto.nextWhenVisible = function nextWhenVisible() {
Mark Otto's avatar
dist  
Mark Otto committed
627
628
      // Don't call next when the page isn't visible
      // or the carousel or its parent isn't visible
Mark Otto's avatar
dist    
Mark Otto committed
629
      if (!document.hidden && $$$1(this._element).is(':visible') && $$$1(this._element).css('visibility') !== 'hidden') {
Mark Otto's avatar
dist  
Mark Otto committed
630
631
632
633
        this.next();
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
634
    _proto.prev = function prev() {
Mark Otto's avatar
dist  
Mark Otto committed
635
636
637
638
639
      if (!this._isSliding) {
        this._slide(Direction.PREV);
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
640
    _proto.pause = function pause(event) {
Mark Otto's avatar
dist  
Mark Otto committed
641
642
643
644
      if (!event) {
        this._isPaused = true;
      }

Mark Otto's avatar
dist    
Mark Otto committed
645
      if ($$$1(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
Mark Otto's avatar
dist  
Mark Otto committed
646
647
648
649
650
651
652
653
        Util.triggerTransitionEnd(this._element);
        this.cycle(true);
      }

      clearInterval(this._interval);
      this._interval = null;
    };

Mark Otto's avatar
dist    
Mark Otto committed
654
    _proto.cycle = function cycle(event) {
Mark Otto's avatar
dist  
Mark Otto committed
655
656
657
658
659
660
661
662
663
664
665
666
667
668
      if (!event) {
        this._isPaused = false;
      }

      if (this._interval) {
        clearInterval(this._interval);
        this._interval = null;
      }

      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
669
    _proto.to = function to(index) {
Mark Otto's avatar
dist  
Mark Otto committed
670
671
      var _this = this;

Mark Otto's avatar
dist    
Mark Otto committed
672
      this._activeElement = $$$1(this._element).find(Selector.ACTIVE_ITEM)[0];
Mark Otto's avatar
dist  
Mark Otto committed
673
674
675
676
677
678
679
680

      var activeIndex = this._getItemIndex(this._activeElement);

      if (index > this._items.length - 1 || index < 0) {
        return;
      }

      if (this._isSliding) {
Mark Otto's avatar
dist    
Mark Otto committed
681
        $$$1(this._element).one(Event.SLID, function () {
Mark Otto's avatar
dist  
Mark Otto committed
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
          return _this.to(index);
        });
        return;
      }

      if (activeIndex === index) {
        this.pause();
        this.cycle();
        return;
      }

      var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;

      this._slide(direction, this._items[index]);
    };

Mark Otto's avatar
dist    
Mark Otto committed
698
    _proto.dispose = function dispose() {
Mark Otto's avatar
dist    
Mark Otto committed
699
700
      $$$1(this._element).off(EVENT_KEY);
      $$$1.removeData(this._element, DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
701
702
703
704
705
706
707
708
      this._items = null;
      this._config = null;
      this._element = null;
      this._interval = null;
      this._isPaused = null;
      this._isSliding = null;
      this._activeElement = null;
      this._indicatorsElement = null;
Mark Otto's avatar
dist    
Mark Otto committed
709
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
710
711


Mark Otto's avatar
dist    
Mark Otto committed
712
    _proto._getConfig = function _getConfig(config) {
Mark Otto's avatar
dist    
Mark Otto committed
713
      config = _extends({}, Default, config);
Mark Otto's avatar
dist  
Mark Otto committed
714
715
716
717
      Util.typeCheckConfig(NAME, config, DefaultType);
      return config;
    };

Mark Otto's avatar
dist    
Mark Otto committed
718
    _proto._addEventListeners = function _addEventListeners() {
Mark Otto's avatar
dist  
Mark Otto committed
719
720
721
      var _this2 = this;

      if (this._config.keyboard) {
Mark Otto's avatar
dist    
Mark Otto committed
722
        $$$1(this._element).on(Event.KEYDOWN, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
723
724
725
726
727
          return _this2._keydown(event);
        });
      }

      if (this._config.pause === 'hover') {
Mark Otto's avatar
dist    
Mark Otto committed
728
        $$$1(this._element).on(Event.MOUSEENTER, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
729
730
731
732
          return _this2.pause(event);
        }).on(Event.MOUSELEAVE, function (event) {
          return _this2.cycle(event);
        });
Mark Otto's avatar
dist    
Mark Otto committed
733

Mark Otto's avatar
dist  
Mark Otto committed
734
        if ('ontouchstart' in document.documentElement) {
Mark Otto's avatar
dist    
Mark Otto committed
735
          // If it's a touch-enabled device, mouseenter/leave are fired as
Mark Otto's avatar
dist  
Mark Otto committed
736
737
738
739
740
741
          // 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
Mark Otto's avatar
dist    
Mark Otto committed
742
          $$$1(this._element).on(Event.TOUCHEND, function () {
Mark Otto's avatar
dist  
Mark Otto committed
743
            _this2.pause();
Mark Otto's avatar
dist    
Mark Otto committed
744

Mark Otto's avatar
dist  
Mark Otto committed
745
746
747
            if (_this2.touchTimeout) {
              clearTimeout(_this2.touchTimeout);
            }
Mark Otto's avatar
dist    
Mark Otto committed
748

Mark Otto's avatar
dist  
Mark Otto committed
749
750
751
752
753
754
755
756
            _this2.touchTimeout = setTimeout(function (event) {
              return _this2.cycle(event);
            }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);
          });
        }
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
757
    _proto._keydown = function _keydown(event) {
Mark Otto's avatar
dist  
Mark Otto committed
758
759
760
761
762
763
764
765
766
      if (/input|textarea/i.test(event.target.tagName)) {
        return;
      }

      switch (event.which) {
        case ARROW_LEFT_KEYCODE:
          event.preventDefault();
          this.prev();
          break;
Mark Otto's avatar
dist    
Mark Otto committed
767

Mark Otto's avatar
dist  
Mark Otto committed
768
769
770
771
        case ARROW_RIGHT_KEYCODE:
          event.preventDefault();
          this.next();
          break;
Mark Otto's avatar
dist    
Mark Otto committed
772

Mark Otto's avatar
dist  
Mark Otto committed
773
774
775
776
        default:
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
777
    _proto._getItemIndex = function _getItemIndex(element) {
Mark Otto's avatar
dist    
Mark Otto committed
778
      this._items = $$$1.makeArray($$$1(element).parent().find(Selector.ITEM));
Mark Otto's avatar
dist  
Mark Otto committed
779
780
781
      return this._items.indexOf(element);
    };

Mark Otto's avatar
dist    
Mark Otto committed
782
    _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
Mark Otto's avatar
dist  
Mark Otto committed
783
784
      var isNextDirection = direction === Direction.NEXT;
      var isPrevDirection = direction === Direction.PREV;
Mark Otto's avatar
dist    
Mark Otto committed
785

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

Mark Otto's avatar
dist  
Mark Otto committed
788
789
790
791
792
793
794
795
796
797
798
799
      var lastItemIndex = this._items.length - 1;
      var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;

      if (isGoingToWrap && !this._config.wrap) {
        return activeElement;
      }

      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
800
    _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
Mark Otto's avatar
dist  
Mark Otto committed
801
      var targetIndex = this._getItemIndex(relatedTarget);
Mark Otto's avatar
dist    
Mark Otto committed
802

Mark Otto's avatar
dist    
Mark Otto committed
803
      var fromIndex = this._getItemIndex($$$1(this._element).find(Selector.ACTIVE_ITEM)[0]);
Mark Otto's avatar
dist    
Mark Otto committed
804

Mark Otto's avatar
dist    
Mark Otto committed
805
      var slideEvent = $$$1.Event(Event.SLIDE, {
Mark Otto's avatar
dist  
Mark Otto committed
806
807
808
809
810
        relatedTarget: relatedTarget,
        direction: eventDirectionName,
        from: fromIndex,
        to: targetIndex
      });
Mark Otto's avatar
dist    
Mark Otto committed
811
      $$$1(this._element).trigger(slideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
812
813
814
      return slideEvent;
    };

Mark Otto's avatar
dist    
Mark Otto committed
815
    _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
Mark Otto's avatar
dist  
Mark Otto committed
816
      if (this._indicatorsElement) {
Mark Otto's avatar
dist    
Mark Otto committed
817
        $$$1(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
818
819
820
821

        var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];

        if (nextIndicator) {
Mark Otto's avatar
dist    
Mark Otto committed
822
          $$$1(nextIndicator).addClass(ClassName.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
823
824
825
826
        }
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
827
    _proto._slide = function _slide(direction, element) {
Mark Otto's avatar
dist  
Mark Otto committed
828
829
      var _this3 = this;

Mark Otto's avatar
dist    
Mark Otto committed
830
      var activeElement = $$$1(this._element).find(Selector.ACTIVE_ITEM)[0];
Mark Otto's avatar
dist    
Mark Otto committed
831

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

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

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

Mark Otto's avatar
dist    
Mark Otto committed
838
839
840
841
      var isCycling = Boolean(this._interval);
      var directionalClassName;
      var orderClassName;
      var eventDirectionName;
Mark Otto's avatar
dist  
Mark Otto committed
842
843
844
845
846
847
848
849
850
851
852

      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
853
      if (nextElement && $$$1(nextElement).hasClass(ClassName.ACTIVE)) {
Mark Otto's avatar
dist  
Mark Otto committed
854
855
856
857
858
        this._isSliding = false;
        return;
      }

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

Mark Otto's avatar
dist  
Mark Otto committed
860
861
862
863
864
      if (slideEvent.isDefaultPrevented()) {
        return;
      }

      if (!activeElement || !nextElement) {
Mark Otto's avatar
dist    
Mark Otto committed
865
        // Some weirdness is happening, so we bail
Mark Otto's avatar
dist  
Mark Otto committed
866
867
868
869
870
871
872
873
874
875
876
        return;
      }

      this._isSliding = true;

      if (isCycling) {
        this.pause();
      }

      this._setActiveIndicatorElement(nextElement);

Mark Otto's avatar
dist    
Mark Otto committed
877
      var slidEvent = $$$1.Event(Event.SLID, {
Mark Otto's avatar
dist  
Mark Otto committed
878
879
880
881
882
883
        relatedTarget: nextElement,
        direction: eventDirectionName,
        from: activeElementIndex,
        to: nextElementIndex
      });

Mark Otto's avatar
dist    
Mark Otto committed
884
885
      if (Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.SLIDE)) {
        $$$1(nextElement).addClass(orderClassName);
Mark Otto's avatar
dist  
Mark Otto committed
886
        Util.reflow(nextElement);
Mark Otto's avatar
dist    
Mark Otto committed
887
888
889
890
891
        $$$1(activeElement).addClass(directionalClassName);
        $$$1(nextElement).addClass(directionalClassName);
        $$$1(activeElement).one(Util.TRANSITION_END, function () {
          $$$1(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
          $$$1(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
Mark Otto's avatar
dist  
Mark Otto committed
892
893
          _this3._isSliding = false;
          setTimeout(function () {
Mark Otto's avatar
dist    
Mark Otto committed
894
            return $$$1(_this3._element).trigger(slidEvent);
Mark Otto's avatar
dist  
Mark Otto committed
895
896
897
          }, 0);
        }).emulateTransitionEnd(TRANSITION_DURATION);
      } else {
Mark Otto's avatar
dist    
Mark Otto committed
898
899
        $$$1(activeElement).removeClass(ClassName.ACTIVE);
        $$$1(nextElement).addClass(ClassName.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
900
        this._isSliding = false;
Mark Otto's avatar
dist    
Mark Otto committed
901
        $$$1(this._element).trigger(slidEvent);
Mark Otto's avatar
dist  
Mark Otto committed
902
903
904
905
906
      }

      if (isCycling) {
        this.cycle();
      }
Mark Otto's avatar
dist    
Mark Otto committed
907
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
908
909
910
911


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

Mark Otto's avatar
dist    
Mark Otto committed
914
        var _config = _extends({}, Default, $$$1(this).data());
Mark Otto's avatar
dist  
Mark Otto committed
915

Mark Otto's avatar
dist    
Mark Otto committed
916
        if (typeof config === 'object') {
Mark Otto's avatar
dist    
Mark Otto committed
917
          _config = _extends({}, _config, config);
Mark Otto's avatar
dist  
Mark Otto committed
918
919
920
921
922
923
        }

        var action = typeof config === 'string' ? config : _config.slide;

        if (!data) {
          data = new Carousel(this, _config);
Mark Otto's avatar
dist    
Mark Otto committed
924
          $$$1(this).data(DATA_KEY, data);
Mark Otto's avatar
dist  
Mark Otto committed
925
926
927
928
929
930
        }

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

Mark Otto's avatar
dist  
Mark Otto committed
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
          data[action]();
        } else if (_config.interval) {
          data.pause();
          data.cycle();
        }
      });
    };

    Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
      var selector = Util.getSelectorFromElement(this);

      if (!selector) {
        return;
      }

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

Mark Otto's avatar
dist    
Mark Otto committed
951
      if (!target || !$$$1(target).hasClass(ClassName.CAROUSEL)) {
Mark Otto's avatar
dist  
Mark Otto committed
952
953
954
        return;
      }

Mark Otto's avatar
dist    
Mark Otto committed
955
      var config = _extends({}, $$$1(target).data(), $$$1(this).data());
Mark Otto's avatar
dist  
Mark Otto committed
956
957
958
959
960
961
      var slideIndex = this.getAttribute('data-slide-to');

      if (slideIndex) {
        config.interval = false;
      }

Mark Otto's avatar
dist    
Mark Otto committed
962
      Carousel._jQueryInterface.call($$$1(target), config);
Mark Otto's avatar
dist  
Mark Otto committed
963
964

      if (slideIndex) {
Mark Otto's avatar
dist    
Mark Otto committed
965
        $$$1(target).data(DATA_KEY).to(slideIndex);
Mark Otto's avatar
dist  
Mark Otto committed
966
967
968
969
970
      }

      event.preventDefault();
    };

Mark Otto's avatar
Mark Otto committed
971
    _createClass(Carousel, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
972
      key: "VERSION",
Mark Otto's avatar
dist  
Mark Otto committed
973
974
975
976
      get: function get() {
        return VERSION;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
977
      key: "Default",
Mark Otto's avatar
dist  
Mark Otto committed
978
979
980
981
982
983
984
985
986
987
988
989
990
      get: function get() {
        return Default;
      }
    }]);
    return Carousel;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */


Mark Otto's avatar
dist    
Mark Otto committed
991
992
993
994
  $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
  $$$1(window).on(Event.LOAD_DATA_API, function () {
    $$$1(Selector.DATA_RIDE).each(function () {
      var $carousel = $$$1(this);
Mark Otto's avatar
dist    
Mark Otto committed
995

Mark Otto's avatar
dist  
Mark Otto committed
996
997
998
999
1000
1001
1002
1003
1004
      Carousel._jQueryInterface.call($carousel, $carousel.data());
    });
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
1005
1006
  $$$1.fn[NAME] = Carousel._jQueryInterface;
  $$$1.fn[NAME].Constructor = Carousel;
Mark Otto's avatar
dist    
Mark Otto committed
1007

Mark Otto's avatar
dist    
Mark Otto committed
1008
1009
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
1010
1011
1012
1013
    return Carousel._jQueryInterface;
  };

  return Carousel;
Mark Otto's avatar
dist    
Mark Otto committed
1014
}($);
Mark Otto's avatar
dist  
Mark Otto committed
1015
1016
1017

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
1018
 * Bootstrap (v4.0.0): collapse.js
Mark Otto's avatar
dist  
Mark Otto committed
1019
1020
1021
1022
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
1023
var Collapse = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
1024
1025
1026
1027
1028
1029
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'collapse';
Mark Otto's avatar
Mark Otto committed
1030
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
1031
  var DATA_KEY = 'bs.collapse';
Mark Otto's avatar
dist    
Mark Otto committed
1032
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist  
Mark Otto committed
1033
  var DATA_API_KEY = '.data-api';
Mark Otto's avatar
dist    
Mark Otto committed
1034
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
1035
1036
1037
1038
1039
1040
1041
  var TRANSITION_DURATION = 600;
  var Default = {
    toggle: true,
    parent: ''
  };
  var DefaultType = {
    toggle: 'boolean',
Mark Otto's avatar
dist    
Mark Otto committed
1042
    parent: '(string|element)'
Mark Otto's avatar
dist  
Mark Otto committed
1043
1044
  };
  var Event = {
Mark Otto's avatar
dist    
Mark Otto committed
1045
1046
1047
1048
1049
    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
Mark Otto's avatar
dist  
Mark Otto committed
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
  };
  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"]'
Mark Otto's avatar
dist    
Mark Otto committed
1064
1065
1066
1067
1068
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
1069

Mark Otto's avatar
dist    
Mark Otto committed
1070
  };
Mark Otto's avatar
dist  
Mark Otto committed
1071

Mark Otto's avatar
dist    
Mark Otto committed
1072
1073
1074
1075
  var Collapse =
  /*#__PURE__*/
  function () {
    function Collapse(element, config) {
Mark Otto's avatar
dist  
Mark Otto committed
1076
1077
1078
      this._isTransitioning = false;
      this._element = element;
      this._config = this._getConfig(config);
Mark Otto's avatar
dist    
Mark Otto committed
1079
1080
      this._triggerArray = $$$1.makeArray($$$1("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
      var tabToggles = $$$1(Selector.DATA_TOGGLE);
Mark Otto's avatar
dist    
Mark Otto committed
1081

Mark Otto's avatar
dist  
Mark Otto committed
1082
1083
1084
      for (var i = 0; i < tabToggles.length; i++) {
        var elem = tabToggles[i];
        var selector = Util.getSelectorFromElement(elem);
Mark Otto's avatar
dist    
Mark Otto committed
1085

Mark Otto's avatar
dist    
Mark Otto committed
1086
        if (selector !== null && $$$1(selector).filter(element).length > 0) {
Mark Otto's avatar
dist    
Mark Otto committed
1087
1088
          this._selector = selector;

Mark Otto's avatar
dist  
Mark Otto committed
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
          this._triggerArray.push(elem);
        }
      }

      this._parent = this._config.parent ? this._getParent() : null;

      if (!this._config.parent) {
        this._addAriaAndCollapsedClass(this._element, this._triggerArray);
      }

      if (this._config.toggle) {
        this.toggle();
      }
Mark Otto's avatar
dist    
Mark Otto committed
1102
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
1103
1104


Mark Otto's avatar
dist    
Mark Otto committed
1105
    var _proto = Collapse.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
1106

Mark Otto's avatar
dist    
Mark Otto committed
1107
    // Public
Mark Otto's avatar
dist    
Mark Otto committed
1108
    _proto.toggle = function toggle() {
Mark Otto's avatar
dist    
Mark Otto committed
1109
      if ($$$1(this._element).hasClass(ClassName.SHOW)) {
Mark Otto's avatar
dist  
Mark Otto committed
1110
1111
1112
1113
1114
1115
        this.hide();
      } else {
        this.show();
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
1116
    _proto.show = function show() {
Mark Otto's avatar
dist  
Mark Otto committed
1117
1118
      var _this = this;

Mark Otto's avatar
dist    
Mark Otto committed
1119
      if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) {
Mark Otto's avatar
dist  
Mark Otto committed
1120
1121
1122
        return;
      }

Mark Otto's avatar
dist    
Mark Otto committed
1123
1124
      var actives;
      var activesData;
Mark Otto's avatar
dist  
Mark Otto committed
1125
1126

      if (this._parent) {
Mark Otto's avatar
dist    
Mark Otto committed
1127
        actives = $$$1.makeArray($$$1(this._parent).find(Selector.ACTIVES).filter("[data-parent=\"" + this._config.parent + "\"]"));
Mark Otto's avatar
dist    
Mark Otto committed
1128

Mark Otto's avatar
dist    
Mark Otto committed
1129
        if (actives.length === 0) {
Mark Otto's avatar
dist  
Mark Otto committed
1130
1131
1132
1133
1134
          actives = null;
        }
      }

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

Mark Otto's avatar
dist  
Mark Otto committed
1137
1138
1139
1140
1141
        if (activesData && activesData._isTransitioning) {
          return;
        }
      }

Mark Otto's avatar
dist    
Mark Otto committed
1142
1143
      var startEvent = $$$1.Event(Event.SHOW);
      $$$1(this._element).trigger(startEvent);
Mark Otto's avatar
dist    
Mark Otto committed
1144

Mark Otto's avatar
dist  
Mark Otto committed
1145
1146
1147
1148
1149
      if (startEvent.isDefaultPrevented()) {
        return;
      }

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

Mark Otto's avatar
dist  
Mark Otto committed
1152
        if (!activesData) {
Mark Otto's avatar
dist    
Mark Otto committed
1153
          $$$1(actives).data(DATA_KEY, null);
Mark Otto's avatar
dist  
Mark Otto committed
1154
1155
1156
1157
1158
        }
      }

      var dimension = this._getDimension();

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

Mark Otto's avatar
dist    
Mark Otto committed
1162
      if (this._triggerArray.length > 0) {
Mark Otto's avatar
dist    
Mark Otto committed
1163
        $$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
Mark Otto's avatar
dist  
Mark Otto committed
1164
1165
1166
1167
1168
      }

      this.setTransitioning(true);

      var complete = function complete() {
Mark Otto's avatar
dist    
Mark Otto committed
1169
        $$$1(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
1170
1171
1172
1173
        _this._element.style[dimension] = '';

        _this.setTransitioning(false);

Mark Otto's avatar
dist    
Mark Otto committed
1174
        $$$1(_this._element).trigger(Event.SHOWN);
Mark Otto's avatar
dist  
Mark Otto committed
1175
1176
1177
1178
1179
1180
1181
1182
      };

      if (!Util.supportsTransitionEnd()) {
        complete();
        return;
      }

      var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
Mark Otto's avatar
dist    
Mark Otto committed
1183
      var scrollSize = "scroll" + capitalizedDimension;
Mark Otto's avatar
dist    
Mark Otto committed
1184
      $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
Mark Otto's avatar
dist    
Mark Otto committed
1185
      this._element.style[dimension] = this._element[scrollSize] + "px";
Mark Otto's avatar
dist  
Mark Otto committed
1186
1187
    };

Mark Otto's avatar
dist    
Mark Otto committed
1188
    _proto.hide = function hide() {
Mark Otto's avatar
dist  
Mark Otto committed
1189
1190
      var _this2 = this;

Mark Otto's avatar
dist    
Mark Otto committed
1191
      if (this._isTransitioning || !$$$1(this._element).hasClass(ClassName.SHOW)) {
Mark Otto's avatar
dist  
Mark Otto committed
1192
1193
1194
        return;
      }

Mark Otto's avatar
dist    
Mark Otto committed
1195
1196
      var startEvent = $$$1.Event(Event.HIDE);
      $$$1(this._element).trigger(startEvent);
Mark Otto's avatar
dist    
Mark Otto committed
1197

Mark Otto's avatar
dist  
Mark Otto committed
1198
1199
1200
1201
1202
1203
      if (startEvent.isDefaultPrevented()) {
        return;
      }

      var dimension = this._getDimension();

Mark Otto's avatar
dist    
Mark Otto committed
1204
      this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
Mark Otto's avatar
dist  
Mark Otto committed
1205
      Util.reflow(this._element);
Mark Otto's avatar
dist    
Mark Otto committed
1206
      $$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
1207

Mark Otto's avatar
dist    
Mark Otto committed
1208
      if (this._triggerArray.length > 0) {
Mark Otto's avatar
dist  
Mark Otto committed
1209
1210
1211
        for (var i = 0; i < this._triggerArray.length; i++) {
          var trigger = this._triggerArray[i];
          var selector = Util.getSelectorFromElement(trigger);
Mark Otto's avatar
dist    
Mark Otto committed
1212

Mark Otto's avatar
dist  
Mark Otto committed
1213
          if (selector !== null) {
Mark Otto's avatar
dist    
Mark Otto committed
1214
            var $elem = $$$1(selector);
Mark Otto's avatar
dist    
Mark Otto committed
1215

Mark Otto's avatar
dist  
Mark Otto committed
1216
            if (!$elem.hasClass(ClassName.SHOW)) {
Mark Otto's avatar
dist    
Mark Otto committed
1217
              $$$1(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
Mark Otto's avatar
dist  
Mark Otto committed
1218
1219
1220
1221
1222
1223
1224
1225
1226
            }
          }
        }
      }

      this.setTransitioning(true);

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

Mark Otto's avatar
dist    
Mark Otto committed
1228
        $$$1(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
Mark Otto's avatar
dist  
Mark Otto committed
1229
1230
1231
1232
1233
1234
1235
1236
1237
      };

      this._element.style[dimension] = '';

      if (!Util.supportsTransitionEnd()) {
        complete();
        return;
      }

Mark Otto's avatar
dist    
Mark Otto committed
1238
      $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
Mark Otto's avatar
dist  
Mark Otto committed
1239
1240
    };

Mark Otto's avatar
dist    
Mark Otto committed
1241
    _proto.setTransitioning = function setTransitioning(isTransitioning) {
Mark Otto's avatar
dist  
Mark Otto committed
1242
1243
1244
      this._isTransitioning = isTransitioning;
    };

Mark Otto's avatar
dist    
Mark Otto committed
1245
    _proto.dispose = function dispose() {
Mark Otto's avatar
dist    
Mark Otto committed
1246
      $$$1.removeData(this._element, DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
1247
1248
1249
1250
1251
      this._config = null;
      this._parent = null;
      this._element = null;
      this._triggerArray = null;
      this._isTransitioning = null;
Mark Otto's avatar
dist    
Mark Otto committed
1252
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
1253
1254


Mark Otto's avatar
dist    
Mark Otto committed
1255
    _proto._getConfig = function _getConfig(config) {
Mark Otto's avatar
dist    
Mark Otto committed
1256
      config = _extends({}, Default, config);
Mark Otto's avatar
dist    
Mark Otto committed
1257
      config.toggle = Boolean(config.toggle); // Coerce string values
Mark Otto's avatar
dist    
Mark Otto committed
1258

Mark Otto's avatar
dist  
Mark Otto committed
1259
1260
1261
1262
      Util.typeCheckConfig(NAME, config, DefaultType);
      return config;
    };

Mark Otto's avatar
dist    
Mark Otto committed
1263
    _proto._getDimension = function _getDimension() {
Mark Otto's avatar
dist    
Mark Otto committed
1264
      var hasWidth = $$$1(this._element).hasClass(Dimension.WIDTH);
Mark Otto's avatar
dist  
Mark Otto committed
1265
1266
1267
      return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
    };

Mark Otto's avatar
dist    
Mark Otto committed
1268
    _proto._getParent = function _getParent() {
Mark Otto's avatar
dist  
Mark Otto committed
1269
1270
      var _this3 = this;

Mark Otto's avatar
dist    
Mark Otto committed
1271
      var parent = null;
Mark Otto's avatar
dist  
Mark Otto committed
1272

Mark Otto's avatar
dist    
Mark Otto committed
1273
      if (Util.isElement(this._config.parent)) {
Mark Otto's avatar
dist    
Mark Otto committed
1274
        parent = this._config.parent; // It's a jQuery object
Mark Otto's avatar
dist    
Mark Otto committed
1275
1276
1277
1278
1279

        if (typeof this._config.parent.jquery !== 'undefined') {
          parent = this._config.parent[0];
        }
      } else {
Mark Otto's avatar
dist    
Mark Otto committed
1280
        parent = $$$1(this._config.parent)[0];
Mark Otto's avatar
dist    
Mark Otto committed
1281
1282
1283
      }

      var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
Mark Otto's avatar
dist    
Mark Otto committed
1284
      $$$1(parent).find(selector).each(function (i, element) {
Mark Otto's avatar
dist  
Mark Otto committed
1285
1286
1287
1288
1289
        _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
      });
      return parent;
    };

Mark Otto's avatar
dist    
Mark Otto committed
1290
    _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
Mark Otto's avatar
dist  
Mark Otto committed
1291
      if (element) {
Mark Otto's avatar
dist    
Mark Otto committed
1292
        var isOpen = $$$1(element).hasClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
1293

Mark Otto's avatar
dist    
Mark Otto committed
1294
        if (triggerArray.length > 0) {
Mark Otto's avatar
dist    
Mark Otto committed
1295
          $$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
Mark Otto's avatar
dist  
Mark Otto committed
1296
1297
        }
      }
Mark Otto's avatar
dist    
Mark Otto committed
1298
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
1299
1300
1301
1302


    Collapse._getTargetFromElement = function _getTargetFromElement(element) {
      var selector = Util.getSelectorFromElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
1303
      return selector ? $$$1(selector)[0] : null;
Mark Otto's avatar
dist  
Mark Otto committed
1304
1305
1306
1307
    };

    Collapse._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
Mark Otto's avatar
dist    
Mark Otto committed
1308
        var $this = $$$1(this);
Mark Otto's avatar
dist  
Mark Otto committed
1309
        var data = $this.data(DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
1310

Mark Otto's avatar
dist    
Mark Otto committed
1311
        var _config = _extends({}, Default, $this.data(), typeof config === 'object' && config);
Mark Otto's avatar
dist  
Mark Otto committed
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323

        if (!data && _config.toggle && /show|hide/.test(config)) {
          _config.toggle = false;
        }

        if (!data) {
          data = new Collapse(this, _config);
          $this.data(DATA_KEY, data);
        }

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

Mark Otto's avatar
dist  
Mark Otto committed
1327
1328
1329
1330
1331
          data[config]();
        }
      });
    };

Mark Otto's avatar
Mark Otto committed
1332
    _createClass(Collapse, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
1333
      key: "VERSION",
Mark Otto's avatar
dist  
Mark Otto committed
1334
1335
1336
1337
      get: function get() {
        return VERSION;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
1338
      key: "Default",
Mark Otto's avatar
dist  
Mark Otto committed
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
      get: function get() {
        return Default;
      }
    }]);
    return Collapse;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
1351

Mark Otto's avatar
dist    
Mark Otto committed
1352
  $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
1353
    // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
Mark Otto's avatar
dist    
Mark Otto committed
1354
    if (event.currentTarget.tagName === 'A') {
Mark Otto's avatar
dist  
Mark Otto committed
1355
1356
1357
      event.preventDefault();
    }

Mark Otto's avatar
dist    
Mark Otto committed
1358
    var $trigger = $$$1(this);
Mark Otto's avatar
dist  
Mark Otto committed
1359
    var selector = Util.getSelectorFromElement(this);
Mark Otto's avatar
dist    
Mark Otto committed
1360
1361
    $$$1(selector).each(function () {
      var $target = $$$1(this);
Mark Otto's avatar
dist  
Mark Otto committed
1362
1363
      var data = $target.data(DATA_KEY);
      var config = data ? 'toggle' : $trigger.data();
Mark Otto's avatar
dist    
Mark Otto committed
1364

Mark Otto's avatar
dist  
Mark Otto committed
1365
1366
1367
1368
1369
1370
1371
1372
1373
      Collapse._jQueryInterface.call($target, config);
    });
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
1374
1375
  $$$1.fn[NAME] = Collapse._jQueryInterface;
  $$$1.fn[NAME].Constructor = Collapse;
Mark Otto's avatar
dist    
Mark Otto committed
1376

Mark Otto's avatar
dist    
Mark Otto committed
1377
1378
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
1379
1380
1381
1382
    return Collapse._jQueryInterface;
  };

  return Collapse;
Mark Otto's avatar
dist    
Mark Otto committed
1383
}($);
Mark Otto's avatar
dist  
Mark Otto committed
1384
1385
1386

/**!
 * @fileOverview Kickass library to create and place poppers near their reference elements.
Mark Otto's avatar
dist    
Mark Otto committed
1387
 * @version 1.12.9
Mark Otto's avatar
dist  
Mark Otto committed
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
 * @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.
 */
Mark Otto's avatar
dist    
Mark Otto committed
1409
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
Mark Otto's avatar
dist  
Mark Otto committed
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
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;
  }
}

function microtaskDebounce(fn) {
Mark Otto's avatar
dist    
Mark Otto committed
1420
  var called = false;
Mark Otto's avatar
dist  
Mark Otto committed
1421
  return function () {
Mark Otto's avatar
dist    
Mark Otto committed
1422
1423
    if (called) {
      return;
Mark Otto's avatar
dist  
Mark Otto committed
1424
    }
Mark Otto's avatar
dist    
Mark Otto committed
1425
    called = true;
Mark Otto's avatar
dist    
Mark Otto committed
1426
    window.Promise.resolve().then(function () {
Mark Otto's avatar
dist    
Mark Otto committed
1427
1428
1429
      called = false;
      fn();
    });
Mark Otto's avatar
dist  
Mark Otto committed
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
  };
}

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
1446
var supportsMicroTasks = isBrowser && window.Promise;
Mark Otto's avatar
dist  
Mark Otto committed
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456

/**
* 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}
*/
Mark Otto's avatar
dist    
Mark Otto committed
1457
var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
Mark Otto's avatar
dist  
Mark Otto committed
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482

/**
 * 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]';
}

/**
 * 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 [];
  }
  // NOTE: 1 DOM access here
Mark Otto's avatar
dist    
Mark Otto committed
1483
  var css = getComputedStyle(element, null);
Mark Otto's avatar
dist  
Mark Otto committed
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
  return property ? css[property] : css;
}

/**
 * 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;
}

/**
 * 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
Mark Otto's avatar
dist    
Mark Otto committed
1510
  if (!element) {
Mark Otto's avatar
dist    
Mark Otto committed
1511
    return document.body;
Mark Otto's avatar
dist  
Mark Otto committed
1512
1513
  }

Mark Otto's avatar
dist    
Mark Otto committed
1514
1515
1516
1517
1518
1519
1520
1521
  switch (element.nodeName) {
    case 'HTML':
    case 'BODY':
      return element.ownerDocument.body;
    case '#document':
      return element.body;
  }

Mark Otto's avatar
dist  
Mark Otto committed
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
  // Firefox want us to check `-x` and `-y` variations as well

  var _getStyleComputedProp = getStyleComputedProperty(element),
      overflow = _getStyleComputedProp.overflow,
      overflowX = _getStyleComputedProp.overflowX,
      overflowY = _getStyleComputedProp.overflowY;

  if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) {
    return element;
  }

  return getScrollParent(getParentNode(element));
}

/**
 * Returns the offset parent of the given element
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @returns {Element} offset parent
 */
function getOffsetParent(element) {
  // NOTE: 1 DOM access here
  var offsetParent = element && element.offsetParent;
  var nodeName = offsetParent && offsetParent.nodeName;

  if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
Mark Otto's avatar
dist    
Mark Otto committed
1549
1550
1551
1552
    if (element) {
      return element.ownerDocument.documentElement;
    }

Mark Otto's avatar
dist    
Mark Otto committed
1553
    return document.documentElement;
Mark Otto's avatar
dist  
Mark Otto committed
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
  }

  // .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);
  }

  return offsetParent;
}

function isOffsetContainer(element) {
  var nodeName = element.nodeName;

  if (nodeName === 'BODY') {
    return false;
  }
  return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
}

/**
 * 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);
  }

  return node;
}

/**
 * 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) {
Mark Otto's avatar
dist    
Mark Otto committed
1600
    return document.documentElement;
Mark Otto's avatar
dist  
Mark Otto committed
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
  }

  // 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;

  // Get common ancestor container
  var range = document.createRange();
  range.setStart(start, 0);
  range.setEnd(end, 0);
  var commonAncestorContainer = range.commonAncestorContainer;

  // Both nodes are inside #document

  if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
    if (isOffsetContainer(commonAncestorContainer)) {
      return commonAncestorContainer;
    }

    return getOffsetParent(commonAncestorContainer);
  }

  // one of the nodes is inside shadowDOM, find which one
  var element1root = getRoot(element1);
  if (element1root.host) {
    return findCommonOffsetParent(element1root.host, element2);
  } else {
    return findCommonOffsetParent(element1, getRoot(element2).host);
  }
}

/**
 * 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';

  var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  var nodeName = element.nodeName;

  if (nodeName === 'BODY' || nodeName === 'HTML') {
Mark Otto's avatar
dist    
Mark Otto committed
1648
1649
    var html = element.ownerDocument.documentElement;
    var scrollingElement = element.ownerDocument.scrollingElement || html;
Mark Otto's avatar
dist  
Mark Otto committed
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
    return scrollingElement[upperSide];
  }

  return element[upperSide];
}

/*
 * 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;
}

/*
 * 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
 */

function getBordersSize(styles, axis) {
  var sideA = axis === 'x' ? 'Left' : 'Top';
  var sideB = sideA === 'Left' ? 'Right' : 'Bottom';

Mark Otto's avatar
dist    
Mark Otto committed
1692
  return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
Mark Otto's avatar
dist  
Mark Otto committed
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
}

/**
 * Tells if you are running Internet Explorer 10
 * @method
 * @memberof Popper.Utils
 * @returns {Boolean} isIE10
 */
var isIE10 = undefined;

var isIE10$1 = function () {
  if (isIE10 === undefined) {
    isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;
  }
  return isIE10;
};

function getSize(axis, body, html, computedStyle) {
  return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);
}

function getWindowSizes() {
Mark Otto's avatar
dist    
Mark Otto committed
1715
1716
1717
  var body = document.body;
  var html = document.documentElement;
  var computedStyle = isIE10$1() && getComputedStyle(html);
Mark Otto's avatar
dist  
Mark Otto committed
1718
1719
1720
1721
1722
1723
1724

  return {
    height: getSize('Height', body, html, computedStyle),
    width: getSize('Width', body, html, computedStyle)
  };
}

Mark Otto's avatar
dist    
Mark Otto committed
1725
var classCallCheck = function (instance, Constructor) {
Mark Otto's avatar
dist  
Mark Otto committed
1726
1727
1728
1729
1730
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
};

Mark Otto's avatar
Mark Otto committed
1731
var createClass = function () {
Mark Otto's avatar
dist  
Mark Otto committed
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
  function defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }

  return function (Constructor, protoProps, staticProps) {
    if (protoProps) defineProperties(Constructor.prototype, protoProps);
    if (staticProps) defineProperties(Constructor, staticProps);
    return Constructor;
  };
}();





var defineProperty = function (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
dist    
Mark Otto committed
1768
var _extends$1 = Object.assign || function (target) {
Mark Otto's avatar
dist  
Mark Otto committed
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i];

    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        target[key] = source[key];
      }
    }
  }

  return target;
};

/**
 * Given element offsets, generate an output similar to getBoundingClientRect
 * @method
 * @memberof Popper.Utils
 * @argument {Object} offsets
 * @returns {Object} ClientRect like output
 */
function getClientRect(offsets) {
Mark Otto's avatar
dist    
Mark Otto committed
1790
  return _extends$1({}, offsets, {
Mark Otto's avatar
dist  
Mark Otto committed
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
    right: offsets.left + offsets.width,
    bottom: offsets.top + offsets.height
  });
}

/**
 * Get bounding client rect of given element
 * @method
 * @memberof Popper.Utils
 * @param {HTMLElement} element
 * @return {Object} client rect
 */
function getBoundingClientRect(element) {
  var rect = {};

  // 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
  if (isIE10$1()) {
    try {
      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;
    } catch (err) {}
  } else {
    rect = element.getBoundingClientRect();
  }

  var result = {
    left: rect.left,
    top: rect.top,
    width: rect.right - rect.left,
    height: rect.bottom - rect.top
  };

  // 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;

  var horizScrollbar = element.offsetWidth - width;
  var vertScrollbar = element.offsetHeight - height;

  // 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;
  }

  return getClientRect(result);
}

function getOffsetRectRelativeToArbitraryNode(children, parent) {
  var isIE10 = isIE10$1();
  var isHTML = parent.nodeName === 'HTML';
  var childrenRect = getBoundingClientRect(children);
  var parentRect = getBoundingClientRect(parent);
  var scrollParent = getScrollParent(children);

  var styles = getStyleComputedProperty(parent);
Mark Otto's avatar
dist    
Mark Otto committed
1860
1861
  var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
  var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
Mark Otto's avatar
dist  
Mark Otto committed
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876

  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) {
Mark Otto's avatar
dist    
Mark Otto committed
1877
1878
    var marginTop = parseFloat(styles.marginTop, 10);
    var marginLeft = parseFloat(styles.marginLeft, 10);
Mark Otto's avatar
dist  
Mark Otto committed
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897

    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;
  }

  if (isIE10 ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
    offsets = includeScroll(offsets, parent);
  }

  return offsets;
}

function getViewportOffsetRectRelativeToArtbitraryNode(element) {
Mark Otto's avatar
dist    
Mark Otto committed
1898
  var html = element.ownerDocument.documentElement;
Mark Otto's avatar
dist  
Mark Otto committed
1899
1900
1901
1902
1903
1904
1905
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
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
  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 = getScroll(html);
  var scrollLeft = getScroll(html, 'left');

  var offset = {
    top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
    left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
    width: width,
    height: height
  };

  return getClientRect(offset);
}

/**
 * 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;
  }
  if (getStyleComputedProperty(element, 'position') === 'fixed') {
    return true;
  }
  return isFixed(getParentNode(element));
}

/**
 * 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
 * @returns {Object} Coordinates of the boundaries
 */
function getBoundaries(popper, reference, padding, boundariesElement) {
  // NOTE: 1 DOM access here
  var boundaries = { top: 0, left: 0 };
  var offsetParent = findCommonOffsetParent(popper, reference);

  // Handle viewport case
  if (boundariesElement === 'viewport') {
    boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent);
  } else {
    // Handle other cases based on DOM element used as boundaries
    var boundariesNode = void 0;
    if (boundariesElement === 'scrollParent') {
Mark Otto's avatar
dist    
Mark Otto committed
1957
      boundariesNode = getScrollParent(getParentNode(reference));
Mark Otto's avatar
dist  
Mark Otto committed
1958
      if (boundariesNode.nodeName === 'BODY') {
Mark Otto's avatar
dist    
Mark Otto committed
1959
        boundariesNode = popper.ownerDocument.documentElement;
Mark Otto's avatar
dist  
Mark Otto committed
1960
1961
      }
    } else if (boundariesElement === 'window') {
Mark Otto's avatar
dist    
Mark Otto committed
1962
      boundariesNode = popper.ownerDocument.documentElement;
Mark Otto's avatar
dist  
Mark Otto committed
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
    } else {
      boundariesNode = boundariesElement;
    }

    var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent);

    // In case of HTML, we need a different computation
    if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
      var _getWindowSizes = getWindowSizes(),
          height = _getWindowSizes.height,
          width = _getWindowSizes.width;

      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;
    }
  }

  // Add paddings
  boundaries.left += padding;
  boundaries.top += padding;
  boundaries.right -= padding;
  boundaries.bottom -= padding;

  return boundaries;
}

function getArea(_ref) {
  var width = _ref.width,
      height = _ref.height;

  return width * height;
}

/**
 * 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;

  if (placement.indexOf('auto') === -1) {
    return placement;
  }

  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
    }
  };

  var sortedAreas = Object.keys(rects).map(function (key) {
Mark Otto's avatar
dist    
Mark Otto committed
2039
    return _extends$1({
Mark Otto's avatar
dist  
Mark Otto committed
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
      key: key
    }, rects[key], {
      area: getArea(rects[key])
    });
  }).sort(function (a, b) {
    return b.area - a.area;
  });

  var filteredAreas = sortedAreas.filter(function (_ref2) {
    var width = _ref2.width,
        height = _ref2.height;
    return width >= popper.clientWidth && height >= popper.clientHeight;
  });

  var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;

  var variation = placement.split('-')[1];

  return computedPlacement + (variation ? '-' + variation : '');
}

/**
 * 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)
 * @returns {Object} An object containing the offsets which will be applied to the popper
 */
function getReferenceOffsets(state, popper, reference) {
  var commonOffsetParent = findCommonOffsetParent(popper, reference);
  return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent);
}

/**
 * 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) {
Mark Otto's avatar
dist    
Mark Otto committed
2083
  var styles = getComputedStyle(element);
Mark Otto's avatar
dist  
Mark Otto committed
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
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
2199
2200
2201
2202
  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);

  // 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) {
Mark Otto's avatar
dist    
Mark Otto committed
2203
2204
    if (modifier['function']) {
      // eslint-disable-line dot-notation
Mark Otto's avatar
dist  
Mark Otto committed
2205
2206
      console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
    }
Mark Otto's avatar
dist    
Mark Otto committed
2207
    var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
Mark Otto's avatar
dist  
Mark Otto committed
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
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
    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);
    }
  });

  return data;
}

/**
 * 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;
  }

  var data = {
    instance: this,
    styles: {},
    arrowStyles: {},
    attributes: {},
    flipped: false,
    offsets: {}
  };

  // compute reference element offsets
  data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference);

  // 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;

  // compute the popper offsets
  data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  data.offsets.popper.position = '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 - 1; i++) {
    var prefix = prefixes[i];
    var toCheck = prefix ? '' + prefix + upperProp : property;
Mark Otto's avatar
dist    
Mark Otto committed
2300
    if (typeof document.body.style[toCheck] !== 'undefined') {
Mark Otto's avatar
dist  
Mark Otto committed
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
      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.left = '';
    this.popper.style.position = '';
    this.popper.style.top = '';
    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;
}

Mark Otto's avatar
dist    
Mark Otto committed
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
/**
 * Get the window associated with the element
 * @argument {Element} element
 * @returns {Window}
 */
function getWindow(element) {
  var ownerDocument = element.ownerDocument;
  return ownerDocument ? ownerDocument.defaultView : window;
}

Mark Otto's avatar
dist  
Mark Otto committed
2344
2345
function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  var isBody = scrollParent.nodeName === 'BODY';
Mark Otto's avatar
dist    
Mark Otto committed
2346
  var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
Mark Otto's avatar
dist  
Mark Otto committed
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
  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;
Mark Otto's avatar
dist    
Mark Otto committed
2364
  getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
Mark Otto's avatar
dist  
Mark Otto committed
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

  // 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
Mark Otto's avatar
dist    
Mark Otto committed
2395
  getWindow(reference).removeEventListener('resize', state.updateBound);
Mark Otto's avatar
dist  
Mark Otto committed
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418

  // 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) {
Mark Otto's avatar
dist    
Mark Otto committed
2419
    cancelAnimationFrame(this.scheduleUpdate);
Mark Otto's avatar
dist  
Mark Otto committed
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
2535
2536
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
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
    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;
  });
}

/**
 * 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);
  }

  return data;
}

/**
 * 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);

  // 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);

  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: '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!');
  }
  var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;

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

  // Styles
  var styles = {
    position: popper.position
  };

  // floor sides to avoid blurry text
  var offsets = {
    left: Math.floor(popper.left),
    top: Math.floor(popper.top),
    bottom: Math.floor(popper.bottom),
    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
Mark Otto's avatar
dist    
Mark Otto committed
2616
2617
2618
  data.attributes = _extends$1({}, attributes, data.attributes);
  data.styles = _extends$1({}, styles, data.styles);
  data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles);
Mark Otto's avatar
dist  
Mark Otto committed
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658

  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) {
Mark Otto's avatar
dist    
Mark Otto committed
2659
2660
  var _data$offsets$arrow;

Mark Otto's avatar
dist  
Mark Otto committed
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
  // arrow depends on keepTogether in order to work
  if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
    return data;
  }

  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];
  }
Mark Otto's avatar
dist    
Mark Otto committed
2712
  data.offsets.popper = getClientRect(data.offsets.popper);
Mark Otto's avatar
dist  
Mark Otto committed
2713
2714
2715
2716
2717
2718

  // 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
Mark Otto's avatar
dist    
Mark Otto committed
2719
2720
2721
2722
  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;
Mark Otto's avatar
dist  
Mark Otto committed
2723
2724
2725
2726
2727

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

  data.arrowElement = arrowElement;
Mark Otto's avatar
dist    
Mark Otto committed
2728
  data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
Mark Otto's avatar
dist  
Mark Otto committed
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
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
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890

  return data;
}

/**
 * Get the opposite placement variation of the given one
 * @method
 * @memberof Popper.Utils
 * @argument {String} placement variation
 * @returns {String} flipped placement variation
 */
function getOppositeVariation(variation) {
  if (variation === 'end') {
    return 'start';
  } else if (variation === 'start') {
    return 'end';
  }
  return variation;
}

/**
 * List of accepted placements to use as values of the `placement` option.<br />
 * Valid placements are:
 * - `auto`
 * - `top`
 * - `right`
 * - `bottom`
 * - `left`
 *
 * Each placement can have a variation from this list:
 * - `-start`
 * - `-end`
 *
 * 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.
 *
 * 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)
 *
 * @static
 * @type {Array}
 * @enum {String}
 * @readonly
 * @method placements
 * @memberof Popper
 */
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);

/**
 * Given an initial placement, returns all the subsequent placements
 * clockwise (or counter-clockwise).
 *
 * @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
 */
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'
};

/**
 * @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 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);

  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
Mark Otto's avatar
dist    
Mark Otto committed
2891
      data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
Mark Otto's avatar
dist  
Mark Otto committed
2892
2893
2894
2895
2896
2897
2898
2899
2900
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
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
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
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
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
3143
3144

      data = runModifiers(data.instance.modifiers, data, 'flip');
    }
  });
  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 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;
}

/**
 * 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
 */
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;
  }
}

/**
 * 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
 */
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;
}

/**
 * @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
 */
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;
}

/**
 * @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);
  }

  var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement);
  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';
Mark Otto's avatar
dist    
Mark Otto committed
3145
    popper = _extends$1({}, popper, check[side](placement));
Mark Otto's avatar
dist  
Mark Otto committed
3146
3147
3148
3149
3150
3151
3152
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
  });

  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])
    };

Mark Otto's avatar
dist    
Mark Otto committed
3180
    data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]);
Mark Otto's avatar
dist  
Mark Otto committed
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
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
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
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
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
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
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
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
3678
3679
  }

  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.
 *
 * @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.
 *
 * 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
 */
var modifiers = {
  /**
   * 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
   */
  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
  },

  /**
   * 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
   */
  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
  },

  /**
   * 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
   */
  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'
  },

  /**
   * 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
   */
  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
  },

  /**
   * 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]'
  },

  /**
   * 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
  }
};

/**
 * 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
 */

/**
 * 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
 */
var Defaults = {
  /**
   * Popper's placement
   * @prop {Popper.placements} placement='bottom'
   */
  placement: 'bottom',

  /**
   * 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
};

/**
 * @callback onCreate
 * @param {dataObject} data
 */

/**
 * @callback onUpdate
 * @param {dataObject} data
 */

// 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] : {};
Mark Otto's avatar
dist    
Mark Otto committed
3680
    classCallCheck(this, Popper);
Mark Otto's avatar
dist  
Mark Otto committed
3681
3682
3683
3684
3685
3686
3687
3688
3689

    this.scheduleUpdate = function () {
      return requestAnimationFrame(_this.update);
    };

    // 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
Mark Otto's avatar
dist    
Mark Otto committed
3690
    this.options = _extends$1({}, Popper.Defaults, options);
Mark Otto's avatar
dist  
Mark Otto committed
3691
3692
3693
3694
3695
3696
3697
3698
3699

    // init state
    this.state = {
      isDestroyed: false,
      isCreated: false,
      scrollParents: []
    };

    // get reference and popper elements (allow jQuery wrappers)
Mark Otto's avatar
dist    
Mark Otto committed
3700
3701
    this.reference = reference && reference.jquery ? reference[0] : reference;
    this.popper = popper && popper.jquery ? popper[0] : popper;
Mark Otto's avatar
dist  
Mark Otto committed
3702
3703
3704

    // Deep merge modifiers options
    this.options.modifiers = {};
Mark Otto's avatar
dist    
Mark Otto committed
3705
3706
    Object.keys(_extends$1({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
      _this.options.modifiers[name] = _extends$1({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
Mark Otto's avatar
dist  
Mark Otto committed
3707
3708
3709
3710
    });

    // Refactoring modifiers' list (Object => Array)
    this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
Mark Otto's avatar
dist    
Mark Otto committed
3711
      return _extends$1({
Mark Otto's avatar
dist  
Mark Otto committed
3712
3713
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
        name: name
      }, _this.options.modifiers[name]);
    })
    // sort the modifiers by order
    .sort(function (a, b) {
      return a.order - b.order;
    });

    // 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);
      }
    });

    // fire the first update to position the popper in the right place
    this.update();

    var eventsEnabled = this.options.eventsEnabled;
    if (eventsEnabled) {
      // setup event listeners, they will take care of update the position in specific situations
      this.enableEventListeners();
    }

    this.state.eventsEnabled = eventsEnabled;
  }

  // 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
Mark Otto committed
3746
  createClass(Popper, [{
Mark Otto's avatar
dist  
Mark Otto committed
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
    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);
    }

    /**
     * Schedule an update, it will run on the next UI update available
     * @method scheduleUpdate
     * @memberof Popper
     */


    /**
     * 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
     */

  }]);
  return Popper;
}();

/**
 * 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.
 */


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

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
3822
 * Bootstrap (v4.0.0): dropdown.js
Mark Otto's avatar
dist  
Mark Otto committed
3823
3824
3825
3826
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
3827
var Dropdown = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
3828
3829
3830
3831
3832
3833
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'dropdown';
Mark Otto's avatar
Mark Otto committed
3834
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
3835
  var DATA_KEY = 'bs.dropdown';
Mark Otto's avatar
dist    
Mark Otto committed
3836
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist  
Mark Otto committed
3837
  var DATA_API_KEY = '.data-api';
Mark Otto's avatar
dist    
Mark Otto committed
3838
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
3839
  var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
Mark Otto's avatar
dist    
Mark Otto committed
3840

Mark Otto's avatar
dist  
Mark Otto committed
3841
  var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
Mark Otto's avatar
dist    
Mark Otto committed
3842

Mark Otto's avatar
dist  
Mark Otto committed
3843
  var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
Mark Otto's avatar
dist    
Mark Otto committed
3844

Mark Otto's avatar
dist  
Mark Otto committed
3845
  var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
Mark Otto's avatar
dist    
Mark Otto committed
3846

Mark Otto's avatar
dist  
Mark Otto committed
3847
  var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
Mark Otto's avatar
dist    
Mark Otto committed
3848

Mark Otto's avatar
dist  
Mark Otto committed
3849
3850
  var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)

Mark Otto's avatar
dist    
Mark Otto committed
3851
  var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
Mark Otto's avatar
dist  
Mark Otto committed
3852
  var Event = {
Mark Otto's avatar
dist    
Mark Otto committed
3853
3854
3855
3856
3857
3858
3859
3860
    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
Mark Otto's avatar
dist  
Mark Otto committed
3861
3862
3863
3864
3865
  };
  var ClassName = {
    DISABLED: 'disabled',
    SHOW: 'show',
    DROPUP: 'dropup',
Mark Otto's avatar
dist    
Mark Otto committed
3866
3867
    DROPRIGHT: 'dropright',
    DROPLEFT: 'dropleft',
Mark Otto's avatar
dist  
Mark Otto committed
3868
    MENURIGHT: 'dropdown-menu-right',
Mark Otto's avatar
dist    
Mark Otto committed
3869
3870
    MENULEFT: 'dropdown-menu-left',
    POSITION_STATIC: 'position-static'
Mark Otto's avatar
dist  
Mark Otto committed
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
  };
  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)'
  };
  var AttachmentMap = {
    TOP: 'top-start',
    TOPEND: 'top-end',
    BOTTOM: 'bottom-start',
Mark Otto's avatar
dist    
Mark Otto committed
3883
3884
3885
3886
3887
    BOTTOMEND: 'bottom-end',
    RIGHT: 'right-start',
    RIGHTEND: 'right-end',
    LEFT: 'left-start',
    LEFTEND: 'left-end'
Mark Otto's avatar
dist  
Mark Otto committed
3888
3889
3890
  };
  var Default = {
    offset: 0,
Mark Otto's avatar
dist    
Mark Otto committed
3891
    flip: true,
Mark Otto's avatar
dist    
Mark Otto committed
3892
3893
    boundary: 'scrollParent',
    reference: 'toggle'
Mark Otto's avatar
dist  
Mark Otto committed
3894
3895
  };
  var DefaultType = {
Mark Otto's avatar
dist    
Mark Otto committed
3896
    offset: '(number|string|function)',
Mark Otto's avatar
dist    
Mark Otto committed
3897
    flip: 'boolean',
Mark Otto's avatar
dist    
Mark Otto committed
3898
3899
    boundary: '(string|element)',
    reference: '(string|element)'
Mark Otto's avatar
dist    
Mark Otto committed
3900
3901
3902
3903
3904
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
3905

Mark Otto's avatar
dist    
Mark Otto committed
3906
  };
Mark Otto's avatar
dist  
Mark Otto committed
3907

Mark Otto's avatar
dist    
Mark Otto committed
3908
3909
3910
3911
  var Dropdown =
  /*#__PURE__*/
  function () {
    function Dropdown(element, config) {
Mark Otto's avatar
dist  
Mark Otto committed
3912
3913
3914
3915
3916
3917
3918
      this._element = element;
      this._popper = null;
      this._config = this._getConfig(config);
      this._menu = this._getMenuElement();
      this._inNavbar = this._detectNavbar();

      this._addEventListeners();
Mark Otto's avatar
dist    
Mark Otto committed
3919
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
3920
3921


Mark Otto's avatar
dist    
Mark Otto committed
3922
    var _proto = Dropdown.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
3923

Mark Otto's avatar
dist    
Mark Otto committed
3924
    // Public
Mark Otto's avatar
dist    
Mark Otto committed
3925
    _proto.toggle = function toggle() {
Mark Otto's avatar
dist    
Mark Otto committed
3926
      if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) {
Mark Otto's avatar
dist  
Mark Otto committed
3927
3928
3929
3930
        return;
      }

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

Mark Otto's avatar
dist    
Mark Otto committed
3932
      var isActive = $$$1(this._menu).hasClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942

      Dropdown._clearMenus();

      if (isActive) {
        return;
      }

      var relatedTarget = {
        relatedTarget: this._element
      };
Mark Otto's avatar
dist    
Mark Otto committed
3943
3944
      var showEvent = $$$1.Event(Event.SHOW, relatedTarget);
      $$$1(parent).trigger(showEvent);
Mark Otto's avatar
dist  
Mark Otto committed
3945
3946
3947

      if (showEvent.isDefaultPrevented()) {
        return;
Mark Otto's avatar
dist    
Mark Otto committed
3948
      } // Disable totally Popper.js for Dropdown in Navbar
Mark Otto's avatar
dist    
Mark Otto committed
3949
3950


Mark Otto's avatar
dist    
Mark Otto committed
3951
3952
3953
3954
3955
3956
      if (!this._inNavbar) {
        /**
         * Check for Popper dependency
         * Popper - https://popper.js.org
         */
        if (typeof Popper === 'undefined') {
Mark Otto's avatar
dist    
Mark Otto committed
3957
          throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
Mark Otto's avatar
dist    
Mark Otto committed
3958
        }
Mark Otto's avatar
dist  
Mark Otto committed
3959

Mark Otto's avatar
dist    
Mark Otto committed
3960
3961
3962
3963
3964
3965
        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
3966

Mark Otto's avatar
dist    
Mark Otto committed
3967
3968
          if (typeof this._config.reference.jquery !== 'undefined') {
            referenceElement = this._config.reference[0];
Mark Otto's avatar
dist    
Mark Otto committed
3969
          }
Mark Otto's avatar
dist    
Mark Otto committed
3970
3971
3972
3973
3974
3975
3976
        } // 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


        if (this._config.boundary !== 'scrollParent') {
          $$$1(parent).addClass(ClassName.POSITION_STATIC);
Mark Otto's avatar
dist  
Mark Otto committed
3977
3978
        }

Mark Otto's avatar
dist    
Mark Otto committed
3979
        this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
Mark Otto's avatar
dist    
Mark Otto committed
3980
      } // If this is a touch-enabled device we add extra
Mark Otto's avatar
dist  
Mark Otto committed
3981
3982
3983
      // 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
3984

Mark Otto's avatar
dist    
Mark Otto committed
3985

Mark Otto's avatar
dist    
Mark Otto committed
3986
      if ('ontouchstart' in document.documentElement && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) {
Mark Otto's avatar
dist    
Mark Otto committed
3987
        $$$1('body').children().on('mouseover', null, $$$1.noop);
Mark Otto's avatar
dist  
Mark Otto committed
3988
3989
3990
      }

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

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

Mark Otto's avatar
dist    
Mark Otto committed
3994
3995
      $$$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
3996
3997
    };

Mark Otto's avatar
dist    
Mark Otto committed
3998
    _proto.dispose = function dispose() {
Mark Otto's avatar
dist    
Mark Otto committed
3999
4000
      $$$1.removeData(this._element, DATA_KEY);
      $$$1(this._element).off(EVENT_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
4001
4002
      this._element = null;
      this._menu = null;
Mark Otto's avatar
dist    
Mark Otto committed
4003

Mark Otto's avatar
dist  
Mark Otto committed
4004
4005
      if (this._popper !== null) {
        this._popper.destroy();
Mark Otto's avatar
dist    
Mark Otto committed
4006

Mark Otto's avatar
dist    
Mark Otto committed
4007
4008
        this._popper = null;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4009
4010
    };

Mark Otto's avatar
dist    
Mark Otto committed
4011
    _proto.update = function update() {
Mark Otto's avatar
dist  
Mark Otto committed
4012
      this._inNavbar = this._detectNavbar();
Mark Otto's avatar
dist    
Mark Otto committed
4013

Mark Otto's avatar
dist  
Mark Otto committed
4014
4015
4016
      if (this._popper !== null) {
        this._popper.scheduleUpdate();
      }
Mark Otto's avatar
dist    
Mark Otto committed
4017
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
4018
4019


Mark Otto's avatar
dist    
Mark Otto committed
4020
    _proto._addEventListeners = function _addEventListeners() {
Mark Otto's avatar
dist  
Mark Otto committed
4021
4022
      var _this = this;

Mark Otto's avatar
dist    
Mark Otto committed
4023
      $$$1(this._element).on(Event.CLICK, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
4024
4025
        event.preventDefault();
        event.stopPropagation();
Mark Otto's avatar
dist    
Mark Otto committed
4026

Mark Otto's avatar
dist  
Mark Otto committed
4027
4028
4029
4030
        _this.toggle();
      });
    };

Mark Otto's avatar
dist    
Mark Otto committed
4031
    _proto._getConfig = function _getConfig(config) {
Mark Otto's avatar
dist    
Mark Otto committed
4032
      config = _extends({}, this.constructor.Default, $$$1(this._element).data(), config);
Mark Otto's avatar
dist  
Mark Otto committed
4033
4034
4035
4036
      Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
      return config;
    };

Mark Otto's avatar
dist    
Mark Otto committed
4037
    _proto._getMenuElement = function _getMenuElement() {
Mark Otto's avatar
dist  
Mark Otto committed
4038
4039
      if (!this._menu) {
        var parent = Dropdown._getParentFromElement(this._element);
Mark Otto's avatar
dist    
Mark Otto committed
4040

Mark Otto's avatar
dist    
Mark Otto committed
4041
        this._menu = $$$1(parent).find(Selector.MENU)[0];
Mark Otto's avatar
dist  
Mark Otto committed
4042
      }
Mark Otto's avatar
dist    
Mark Otto committed
4043

Mark Otto's avatar
dist  
Mark Otto committed
4044
4045
4046
      return this._menu;
    };

Mark Otto's avatar
dist    
Mark Otto committed
4047
    _proto._getPlacement = function _getPlacement() {
Mark Otto's avatar
dist    
Mark Otto committed
4048
      var $parentDropdown = $$$1(this._element).parent();
Mark Otto's avatar
dist    
Mark Otto committed
4049
      var placement = AttachmentMap.BOTTOM; // Handle dropup
Mark Otto's avatar
dist  
Mark Otto committed
4050

Mark Otto's avatar
dist    
Mark Otto committed
4051
      if ($parentDropdown.hasClass(ClassName.DROPUP)) {
Mark Otto's avatar
dist  
Mark Otto committed
4052
        placement = AttachmentMap.TOP;
Mark Otto's avatar
dist    
Mark Otto committed
4053

Mark Otto's avatar
dist    
Mark Otto committed
4054
        if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
Mark Otto's avatar
dist  
Mark Otto committed
4055
4056
          placement = AttachmentMap.TOPEND;
        }
Mark Otto's avatar
dist    
Mark Otto committed
4057
4058
4059
4060
      } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
        placement = AttachmentMap.RIGHT;
      } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
        placement = AttachmentMap.LEFT;
Mark Otto's avatar
dist    
Mark Otto committed
4061
      } else if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
Mark Otto's avatar
dist  
Mark Otto committed
4062
4063
        placement = AttachmentMap.BOTTOMEND;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4064

Mark Otto's avatar
dist  
Mark Otto committed
4065
4066
4067
      return placement;
    };

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

Mark Otto's avatar
dist    
Mark Otto committed
4072
    _proto._getPopperConfig = function _getPopperConfig() {
Mark Otto's avatar
dist    
Mark Otto committed
4073
4074
4075
4076
4077
4078
      var _this2 = this;

      var offsetConf = {};

      if (typeof this._config.offset === 'function') {
        offsetConf.fn = function (data) {
Mark Otto's avatar
dist    
Mark Otto committed
4079
          data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets) || {});
Mark Otto's avatar
dist    
Mark Otto committed
4080
4081
4082
4083
4084
4085
          return data;
        };
      } else {
        offsetConf.offset = this._config.offset;
      }

Mark Otto's avatar
dist  
Mark Otto committed
4086
4087
4088
      var popperConfig = {
        placement: this._getPlacement(),
        modifiers: {
Mark Otto's avatar
dist    
Mark Otto committed
4089
          offset: offsetConf,
Mark Otto's avatar
dist  
Mark Otto committed
4090
4091
          flip: {
            enabled: this._config.flip
Mark Otto's avatar
dist    
Mark Otto committed
4092
4093
4094
          },
          preventOverflow: {
            boundariesElement: this._config.boundary
Mark Otto's avatar
dist  
Mark Otto committed
4095
          }
Mark Otto's avatar
dist    
Mark Otto committed
4096
        }
Mark Otto's avatar
dist    
Mark Otto committed
4097
      };
Mark Otto's avatar
dist  
Mark Otto committed
4098
      return popperConfig;
Mark Otto's avatar
dist    
Mark Otto committed
4099
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
4100
4101
4102
4103


    Dropdown._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
Mark Otto's avatar
dist    
Mark Otto committed
4104
        var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
4105
4106

        var _config = typeof config === 'object' ? config : null;
Mark Otto's avatar
dist  
Mark Otto committed
4107
4108
4109

        if (!data) {
          data = new Dropdown(this, _config);
Mark Otto's avatar
dist    
Mark Otto committed
4110
          $$$1(this).data(DATA_KEY, data);
Mark Otto's avatar
dist  
Mark Otto committed
4111
4112
4113
4114
        }

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

Mark Otto's avatar
dist  
Mark Otto committed
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
          data[config]();
        }
      });
    };

    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
4128
      var toggles = $$$1.makeArray($$$1(Selector.DATA_TOGGLE));
Mark Otto's avatar
dist    
Mark Otto committed
4129

Mark Otto's avatar
dist  
Mark Otto committed
4130
4131
      for (var i = 0; i < toggles.length; i++) {
        var parent = Dropdown._getParentFromElement(toggles[i]);
Mark Otto's avatar
dist    
Mark Otto committed
4132

Mark Otto's avatar
dist    
Mark Otto committed
4133
        var context = $$$1(toggles[i]).data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
4134
4135
4136
4137
4138
4139
4140
4141
4142
        var relatedTarget = {
          relatedTarget: toggles[i]
        };

        if (!context) {
          continue;
        }

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

Mark Otto's avatar
dist    
Mark Otto committed
4144
        if (!$$$1(parent).hasClass(ClassName.SHOW)) {
Mark Otto's avatar
dist  
Mark Otto committed
4145
4146
4147
          continue;
        }

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

Mark Otto's avatar
dist    
Mark Otto committed
4152
4153
        var hideEvent = $$$1.Event(Event.HIDE, relatedTarget);
        $$$1(parent).trigger(hideEvent);
Mark Otto's avatar
dist    
Mark Otto committed
4154

Mark Otto's avatar
dist  
Mark Otto committed
4155
4156
        if (hideEvent.isDefaultPrevented()) {
          continue;
Mark Otto's avatar
dist    
Mark Otto committed
4157
        } // If this is a touch-enabled device we remove the extra
Mark Otto's avatar
dist  
Mark Otto committed
4158
        // empty mouseover listeners we added for iOS support
Mark Otto's avatar
dist    
Mark Otto committed
4159
4160


Mark Otto's avatar
dist  
Mark Otto committed
4161
        if ('ontouchstart' in document.documentElement) {
Mark Otto's avatar
dist    
Mark Otto committed
4162
          $$$1('body').children().off('mouseover', null, $$$1.noop);
Mark Otto's avatar
dist  
Mark Otto committed
4163
4164
4165
        }

        toggles[i].setAttribute('aria-expanded', 'false');
Mark Otto's avatar
dist    
Mark Otto committed
4166
4167
        $$$1(dropdownMenu).removeClass(ClassName.SHOW);
        $$$1(parent).removeClass(ClassName.SHOW).trigger($$$1.Event(Event.HIDDEN, relatedTarget));
Mark Otto's avatar
dist  
Mark Otto committed
4168
4169
4170
4171
      }
    };

    Dropdown._getParentFromElement = function _getParentFromElement(element) {
Mark Otto's avatar
dist    
Mark Otto committed
4172
      var parent;
Mark Otto's avatar
dist  
Mark Otto committed
4173
4174
4175
      var selector = Util.getSelectorFromElement(element);

      if (selector) {
Mark Otto's avatar
dist    
Mark Otto committed
4176
        parent = $$$1(selector)[0];
Mark Otto's avatar
dist  
Mark Otto committed
4177
4178
4179
      }

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

Mark Otto's avatar
dist  
Mark Otto committed
4182
4183

    Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
Mark Otto's avatar
dist    
Mark Otto committed
4184
4185
4186
4187
4188
4189
4190
4191
      // 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)) {
Mark Otto's avatar
dist  
Mark Otto committed
4192
4193
4194
4195
4196
4197
        return;
      }

      event.preventDefault();
      event.stopPropagation();

Mark Otto's avatar
dist    
Mark Otto committed
4198
      if (this.disabled || $$$1(this).hasClass(ClassName.DISABLED)) {
Mark Otto's avatar
dist  
Mark Otto committed
4199
4200
4201
4202
        return;
      }

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

Mark Otto's avatar
dist    
Mark Otto committed
4204
      var isActive = $$$1(parent).hasClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
4205
4206
4207

      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
4208
4209
          var toggle = $$$1(parent).find(Selector.DATA_TOGGLE)[0];
          $$$1(toggle).trigger('focus');
Mark Otto's avatar
dist  
Mark Otto committed
4210
4211
        }

Mark Otto's avatar
dist    
Mark Otto committed
4212
        $$$1(this).trigger('click');
Mark Otto's avatar
dist  
Mark Otto committed
4213
4214
4215
        return;
      }

Mark Otto's avatar
dist    
Mark Otto committed
4216
      var items = $$$1(parent).find(Selector.VISIBLE_ITEMS).get();
Mark Otto's avatar
dist  
Mark Otto committed
4217

Mark Otto's avatar
dist    
Mark Otto committed
4218
      if (items.length === 0) {
Mark Otto's avatar
dist  
Mark Otto committed
4219
4220
4221
4222
4223
4224
        return;
      }

      var index = items.indexOf(event.target);

      if (event.which === ARROW_UP_KEYCODE && index > 0) {
Mark Otto's avatar
dist    
Mark Otto committed
4225
        // Up
Mark Otto's avatar
dist  
Mark Otto committed
4226
4227
4228
4229
        index--;
      }

      if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
Mark Otto's avatar
dist    
Mark Otto committed
4230
        // Down
Mark Otto's avatar
dist  
Mark Otto committed
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
        index++;
      }

      if (index < 0) {
        index = 0;
      }

      items[index].focus();
    };

Mark Otto's avatar
Mark Otto committed
4241
    _createClass(Dropdown, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
4242
      key: "VERSION",
Mark Otto's avatar
dist  
Mark Otto committed
4243
4244
4245
4246
      get: function get() {
        return VERSION;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
4247
      key: "Default",
Mark Otto's avatar
dist  
Mark Otto committed
4248
4249
4250
4251
      get: function get() {
        return Default;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
4252
      key: "DefaultType",
Mark Otto's avatar
dist  
Mark Otto committed
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
      get: function get() {
        return DefaultType;
      }
    }]);
    return Dropdown;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
4265

Mark Otto's avatar
dist    
Mark Otto committed
4266
  $$$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) {
Mark Otto's avatar
dist  
Mark Otto committed
4267
4268
    event.preventDefault();
    event.stopPropagation();
Mark Otto's avatar
dist    
Mark Otto committed
4269

Mark Otto's avatar
dist    
Mark Otto committed
4270
    Dropdown._jQueryInterface.call($$$1(this), 'toggle');
Mark Otto's avatar
dist  
Mark Otto committed
4271
4272
4273
4274
4275
4276
4277
4278
4279
  }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
    e.stopPropagation();
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
4280
4281
  $$$1.fn[NAME] = Dropdown._jQueryInterface;
  $$$1.fn[NAME].Constructor = Dropdown;
Mark Otto's avatar
dist    
Mark Otto committed
4282

Mark Otto's avatar
dist    
Mark Otto committed
4283
4284
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
4285
4286
4287
4288
    return Dropdown._jQueryInterface;
  };

  return Dropdown;
Mark Otto's avatar
dist    
Mark Otto committed
4289
}($, Popper);
Mark Otto's avatar
dist  
Mark Otto committed
4290
4291
4292

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
4293
 * Bootstrap (v4.0.0): modal.js
Mark Otto's avatar
dist  
Mark Otto committed
4294
4295
4296
4297
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
4298
var Modal = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
4299
4300
4301
4302
4303
4304
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'modal';
Mark Otto's avatar
Mark Otto committed
4305
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
4306
  var DATA_KEY = 'bs.modal';
Mark Otto's avatar
dist    
Mark Otto committed
4307
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist  
Mark Otto committed
4308
  var DATA_API_KEY = '.data-api';
Mark Otto's avatar
dist    
Mark Otto committed
4309
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
  var TRANSITION_DURATION = 300;
  var BACKDROP_TRANSITION_DURATION = 150;
  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 = {
Mark Otto's avatar
dist    
Mark Otto committed
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
    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
Mark Otto's avatar
dist  
Mark Otto committed
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
  };
  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',
    STICKY_CONTENT: '.sticky-top',
    NAVBAR_TOGGLER: '.navbar-toggler'
Mark Otto's avatar
dist    
Mark Otto committed
4353
4354
4355
4356
4357
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
4358

Mark Otto's avatar
dist    
Mark Otto committed
4359
  };
Mark Otto's avatar
dist  
Mark Otto committed
4360

Mark Otto's avatar
dist    
Mark Otto committed
4361
4362
4363
4364
  var Modal =
  /*#__PURE__*/
  function () {
    function Modal(element, config) {
Mark Otto's avatar
dist  
Mark Otto committed
4365
4366
      this._config = this._getConfig(config);
      this._element = element;
Mark Otto's avatar
dist    
Mark Otto committed
4367
      this._dialog = $$$1(element).find(Selector.DIALOG)[0];
Mark Otto's avatar
dist  
Mark Otto committed
4368
4369
4370
4371
4372
4373
      this._backdrop = null;
      this._isShown = false;
      this._isBodyOverflowing = false;
      this._ignoreBackdropClick = false;
      this._originalBodyPadding = 0;
      this._scrollbarWidth = 0;
Mark Otto's avatar
dist    
Mark Otto committed
4374
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
4375
4376


Mark Otto's avatar
dist    
Mark Otto committed
4377
    var _proto = Modal.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
4378

Mark Otto's avatar
dist    
Mark Otto committed
4379
    // Public
Mark Otto's avatar
dist    
Mark Otto committed
4380
    _proto.toggle = function toggle(relatedTarget) {
Mark Otto's avatar
dist  
Mark Otto committed
4381
4382
4383
      return this._isShown ? this.hide() : this.show(relatedTarget);
    };

Mark Otto's avatar
dist    
Mark Otto committed
4384
    _proto.show = function show(relatedTarget) {
Mark Otto's avatar
dist  
Mark Otto committed
4385
4386
      var _this = this;

Mark Otto's avatar
dist    
Mark Otto committed
4387
      if (this._isTransitioning || this._isShown) {
Mark Otto's avatar
dist  
Mark Otto committed
4388
4389
4390
        return;
      }

Mark Otto's avatar
dist    
Mark Otto committed
4391
      if (Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE)) {
Mark Otto's avatar
dist  
Mark Otto committed
4392
4393
4394
        this._isTransitioning = true;
      }

Mark Otto's avatar
dist    
Mark Otto committed
4395
      var showEvent = $$$1.Event(Event.SHOW, {
Mark Otto's avatar
dist  
Mark Otto committed
4396
4397
        relatedTarget: relatedTarget
      });
Mark Otto's avatar
dist    
Mark Otto committed
4398
      $$$1(this._element).trigger(showEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4399
4400
4401
4402
4403
4404
4405
4406

      if (this._isShown || showEvent.isDefaultPrevented()) {
        return;
      }

      this._isShown = true;

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

Mark Otto's avatar
dist  
Mark Otto committed
4408
4409
4410
4411
      this._setScrollbar();

      this._adjustDialog();

Mark Otto's avatar
dist    
Mark Otto committed
4412
      $$$1(document.body).addClass(ClassName.OPEN);
Mark Otto's avatar
dist  
Mark Otto committed
4413
4414

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

Mark Otto's avatar
dist  
Mark Otto committed
4416
4417
      this._setResizeEvent();

Mark Otto's avatar
dist    
Mark Otto committed
4418
      $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
4419
4420
        return _this.hide(event);
      });
Mark Otto's avatar
dist    
Mark Otto committed
4421
4422
4423
      $$$1(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
        $$$1(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
          if ($$$1(event.target).is(_this._element)) {
Mark Otto's avatar
dist  
Mark Otto committed
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
            _this._ignoreBackdropClick = true;
          }
        });
      });

      this._showBackdrop(function () {
        return _this._showElement(relatedTarget);
      });
    };

Mark Otto's avatar
dist    
Mark Otto committed
4434
    _proto.hide = function hide(event) {
Mark Otto's avatar
dist  
Mark Otto committed
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
      var _this2 = this;

      if (event) {
        event.preventDefault();
      }

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

Mark Otto's avatar
dist    
Mark Otto committed
4445
4446
      var hideEvent = $$$1.Event(Event.HIDE);
      $$$1(this._element).trigger(hideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4447
4448
4449
4450
4451
4452

      if (!this._isShown || hideEvent.isDefaultPrevented()) {
        return;
      }

      this._isShown = false;
Mark Otto's avatar
dist    
Mark Otto committed
4453
      var transition = Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE);
Mark Otto's avatar
dist    
Mark Otto committed
4454
4455
4456
4457

      if (transition) {
        this._isTransitioning = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4458
4459

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

Mark Otto's avatar
dist  
Mark Otto committed
4461
4462
      this._setResizeEvent();

Mark Otto's avatar
dist    
Mark Otto committed
4463
4464
4465
4466
      $$$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
4467
4468

      if (transition) {
Mark Otto's avatar
dist    
Mark Otto committed
4469
        $$$1(this._element).one(Util.TRANSITION_END, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
4470
4471
4472
4473
4474
4475
4476
          return _this2._hideModal(event);
        }).emulateTransitionEnd(TRANSITION_DURATION);
      } else {
        this._hideModal();
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
4477
    _proto.dispose = function dispose() {
Mark Otto's avatar
dist    
Mark Otto committed
4478
4479
      $$$1.removeData(this._element, DATA_KEY);
      $$$1(window, document, this._element, this._backdrop).off(EVENT_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
      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
4490
    _proto.handleUpdate = function handleUpdate() {
Mark Otto's avatar
dist  
Mark Otto committed
4491
      this._adjustDialog();
Mark Otto's avatar
dist    
Mark Otto committed
4492
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
4493
4494


Mark Otto's avatar
dist    
Mark Otto committed
4495
    _proto._getConfig = function _getConfig(config) {
Mark Otto's avatar
dist    
Mark Otto committed
4496
      config = _extends({}, Default, config);
Mark Otto's avatar
dist  
Mark Otto committed
4497
4498
4499
4500
      Util.typeCheckConfig(NAME, config, DefaultType);
      return config;
    };

Mark Otto's avatar
dist    
Mark Otto committed
4501
    _proto._showElement = function _showElement(relatedTarget) {
Mark Otto's avatar
dist  
Mark Otto committed
4502
4503
      var _this3 = this;

Mark Otto's avatar
dist    
Mark Otto committed
4504
      var transition = Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE);
Mark Otto's avatar
dist  
Mark Otto committed
4505
4506

      if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
Mark Otto's avatar
dist    
Mark Otto committed
4507
        // Don't move modal's DOM position
Mark Otto's avatar
dist  
Mark Otto committed
4508
4509
4510
4511
        document.body.appendChild(this._element);
      }

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

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

Mark Otto's avatar
dist  
Mark Otto committed
4515
4516
4517
4518
4519
4520
      this._element.scrollTop = 0;

      if (transition) {
        Util.reflow(this._element);
      }

Mark Otto's avatar
dist    
Mark Otto committed
4521
      $$$1(this._element).addClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
4522
4523
4524
4525
4526

      if (this._config.focus) {
        this._enforceFocus();
      }

Mark Otto's avatar
dist    
Mark Otto committed
4527
      var shownEvent = $$$1.Event(Event.SHOWN, {
Mark Otto's avatar
dist  
Mark Otto committed
4528
4529
4530
4531
4532
4533
4534
        relatedTarget: relatedTarget
      });

      var transitionComplete = function transitionComplete() {
        if (_this3._config.focus) {
          _this3._element.focus();
        }
Mark Otto's avatar
dist    
Mark Otto committed
4535

Mark Otto's avatar
dist  
Mark Otto committed
4536
        _this3._isTransitioning = false;
Mark Otto's avatar
dist    
Mark Otto committed
4537
        $$$1(_this3._element).trigger(shownEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4538
4539
4540
      };

      if (transition) {
Mark Otto's avatar
dist    
Mark Otto committed
4541
        $$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
Mark Otto's avatar
dist  
Mark Otto committed
4542
4543
4544
4545
4546
      } else {
        transitionComplete();
      }
    };

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

Mark Otto's avatar
dist    
Mark Otto committed
4550
      $$$1(document).off(Event.FOCUSIN) // Guard against infinite focus loop
Mark Otto's avatar
dist  
Mark Otto committed
4551
      .on(Event.FOCUSIN, function (event) {
Mark Otto's avatar
dist    
Mark Otto committed
4552
        if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) {
Mark Otto's avatar
dist  
Mark Otto committed
4553
4554
4555
4556
4557
          _this4._element.focus();
        }
      });
    };

Mark Otto's avatar
dist    
Mark Otto committed
4558
    _proto._setEscapeEvent = function _setEscapeEvent() {
Mark Otto's avatar
dist  
Mark Otto committed
4559
4560
4561
      var _this5 = this;

      if (this._isShown && this._config.keyboard) {
Mark Otto's avatar
dist    
Mark Otto committed
4562
        $$$1(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
4563
4564
          if (event.which === ESCAPE_KEYCODE) {
            event.preventDefault();
Mark Otto's avatar
dist    
Mark Otto committed
4565

Mark Otto's avatar
dist  
Mark Otto committed
4566
4567
4568
4569
            _this5.hide();
          }
        });
      } else if (!this._isShown) {
Mark Otto's avatar
dist    
Mark Otto committed
4570
        $$$1(this._element).off(Event.KEYDOWN_DISMISS);
Mark Otto's avatar
dist  
Mark Otto committed
4571
4572
4573
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
4574
    _proto._setResizeEvent = function _setResizeEvent() {
Mark Otto's avatar
dist  
Mark Otto committed
4575
4576
4577
      var _this6 = this;

      if (this._isShown) {
Mark Otto's avatar
dist    
Mark Otto committed
4578
        $$$1(window).on(Event.RESIZE, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
4579
4580
4581
          return _this6.handleUpdate(event);
        });
      } else {
Mark Otto's avatar
dist    
Mark Otto committed
4582
        $$$1(window).off(Event.RESIZE);
Mark Otto's avatar
dist  
Mark Otto committed
4583
4584
4585
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
4586
    _proto._hideModal = function _hideModal() {
Mark Otto's avatar
dist  
Mark Otto committed
4587
4588
4589
      var _this7 = this;

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

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

Mark Otto's avatar
dist  
Mark Otto committed
4593
      this._isTransitioning = false;
Mark Otto's avatar
dist    
Mark Otto committed
4594

Mark Otto's avatar
dist  
Mark Otto committed
4595
      this._showBackdrop(function () {
Mark Otto's avatar
dist    
Mark Otto committed
4596
        $$$1(document.body).removeClass(ClassName.OPEN);
Mark Otto's avatar
dist    
Mark Otto committed
4597

Mark Otto's avatar
dist  
Mark Otto committed
4598
        _this7._resetAdjustments();
Mark Otto's avatar
dist    
Mark Otto committed
4599

Mark Otto's avatar
dist  
Mark Otto committed
4600
        _this7._resetScrollbar();
Mark Otto's avatar
dist    
Mark Otto committed
4601

Mark Otto's avatar
dist    
Mark Otto committed
4602
        $$$1(_this7._element).trigger(Event.HIDDEN);
Mark Otto's avatar
dist  
Mark Otto committed
4603
4604
4605
      });
    };

Mark Otto's avatar
dist    
Mark Otto committed
4606
    _proto._removeBackdrop = function _removeBackdrop() {
Mark Otto's avatar
dist  
Mark Otto committed
4607
      if (this._backdrop) {
Mark Otto's avatar
dist    
Mark Otto committed
4608
        $$$1(this._backdrop).remove();
Mark Otto's avatar
dist  
Mark Otto committed
4609
4610
4611
4612
        this._backdrop = null;
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
4613
    _proto._showBackdrop = function _showBackdrop(callback) {
Mark Otto's avatar
dist  
Mark Otto committed
4614
4615
      var _this8 = this;

Mark Otto's avatar
dist    
Mark Otto committed
4616
      var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
Mark Otto's avatar
dist  
Mark Otto committed
4617
4618
4619
4620
4621
4622
4623

      if (this._isShown && this._config.backdrop) {
        var doAnimate = Util.supportsTransitionEnd() && animate;
        this._backdrop = document.createElement('div');
        this._backdrop.className = ClassName.BACKDROP;

        if (animate) {
Mark Otto's avatar
dist    
Mark Otto committed
4624
          $$$1(this._backdrop).addClass(animate);
Mark Otto's avatar
dist  
Mark Otto committed
4625
4626
        }

Mark Otto's avatar
dist    
Mark Otto committed
4627
4628
        $$$1(this._backdrop).appendTo(document.body);
        $$$1(this._element).on(Event.CLICK_DISMISS, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
4629
4630
4631
4632
          if (_this8._ignoreBackdropClick) {
            _this8._ignoreBackdropClick = false;
            return;
          }
Mark Otto's avatar
dist    
Mark Otto committed
4633

Mark Otto's avatar
dist  
Mark Otto committed
4634
4635
4636
          if (event.target !== event.currentTarget) {
            return;
          }
Mark Otto's avatar
dist    
Mark Otto committed
4637

Mark Otto's avatar
dist  
Mark Otto committed
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
          if (_this8._config.backdrop === 'static') {
            _this8._element.focus();
          } else {
            _this8.hide();
          }
        });

        if (doAnimate) {
          Util.reflow(this._backdrop);
        }

Mark Otto's avatar
dist    
Mark Otto committed
4649
        $$$1(this._backdrop).addClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659

        if (!callback) {
          return;
        }

        if (!doAnimate) {
          callback();
          return;
        }

Mark Otto's avatar
dist    
Mark Otto committed
4660
        $$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
Mark Otto's avatar
dist  
Mark Otto committed
4661
      } else if (!this._isShown && this._backdrop) {
Mark Otto's avatar
dist    
Mark Otto committed
4662
        $$$1(this._backdrop).removeClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
4663
4664
4665

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

Mark Otto's avatar
dist  
Mark Otto committed
4667
4668
4669
4670
4671
          if (callback) {
            callback();
          }
        };

Mark Otto's avatar
dist    
Mark Otto committed
4672
4673
        if (Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE)) {
          $$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
Mark Otto's avatar
dist  
Mark Otto committed
4674
4675
4676
4677
4678
4679
        } else {
          callbackRemove();
        }
      } else if (callback) {
        callback();
      }
Mark Otto's avatar
dist    
Mark Otto committed
4680
    }; // ----------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
4681
4682
4683
4684
    // 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
4685
4686

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

      if (!this._isBodyOverflowing && isModalOverflowing) {
Mark Otto's avatar
dist    
Mark Otto committed
4690
        this._element.style.paddingLeft = this._scrollbarWidth + "px";
Mark Otto's avatar
dist  
Mark Otto committed
4691
4692
4693
      }

      if (this._isBodyOverflowing && !isModalOverflowing) {
Mark Otto's avatar
dist    
Mark Otto committed
4694
        this._element.style.paddingRight = this._scrollbarWidth + "px";
Mark Otto's avatar
dist  
Mark Otto committed
4695
4696
4697
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
4698
    _proto._resetAdjustments = function _resetAdjustments() {
Mark Otto's avatar
dist  
Mark Otto committed
4699
4700
4701
4702
      this._element.style.paddingLeft = '';
      this._element.style.paddingRight = '';
    };

Mark Otto's avatar
dist    
Mark Otto committed
4703
    _proto._checkScrollbar = function _checkScrollbar() {
Mark Otto's avatar
dist  
Mark Otto committed
4704
4705
4706
4707
4708
      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
4709
    _proto._setScrollbar = function _setScrollbar() {
Mark Otto's avatar
dist  
Mark Otto committed
4710
4711
4712
4713
4714
4715
      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
        // Adjust fixed content padding
Mark Otto's avatar
dist    
Mark Otto committed
4716
4717
4718
4719
        $$$1(Selector.FIXED_CONTENT).each(function (index, element) {
          var actualPadding = $$$1(element)[0].style.paddingRight;
          var calculatedPadding = $$$1(element).css('padding-right');
          $$$1(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
Mark Otto's avatar
dist    
Mark Otto committed
4720
        }); // Adjust sticky content margin
Mark Otto's avatar
dist  
Mark Otto committed
4721

Mark Otto's avatar
dist    
Mark Otto committed
4722
4723
4724
4725
        $$$1(Selector.STICKY_CONTENT).each(function (index, element) {
          var actualMargin = $$$1(element)[0].style.marginRight;
          var calculatedMargin = $$$1(element).css('margin-right');
          $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
Mark Otto's avatar
dist    
Mark Otto committed
4726
        }); // Adjust navbar-toggler margin
Mark Otto's avatar
dist  
Mark Otto committed
4727

Mark Otto's avatar
dist    
Mark Otto committed
4728
4729
4730
4731
        $$$1(Selector.NAVBAR_TOGGLER).each(function (index, element) {
          var actualMargin = $$$1(element)[0].style.marginRight;
          var calculatedMargin = $$$1(element).css('margin-right');
          $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this9._scrollbarWidth + "px");
Mark Otto's avatar
dist    
Mark Otto committed
4732
        }); // Adjust body padding
Mark Otto's avatar
dist  
Mark Otto committed
4733
4734

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

Mark Otto's avatar
dist    
Mark Otto committed
4740
    _proto._resetScrollbar = function _resetScrollbar() {
Mark Otto's avatar
dist  
Mark Otto committed
4741
      // Restore fixed content padding
Mark Otto's avatar
dist    
Mark Otto committed
4742
4743
      $$$1(Selector.FIXED_CONTENT).each(function (index, element) {
        var padding = $$$1(element).data('padding-right');
Mark Otto's avatar
dist    
Mark Otto committed
4744

Mark Otto's avatar
dist  
Mark Otto committed
4745
        if (typeof padding !== 'undefined') {
Mark Otto's avatar
dist    
Mark Otto committed
4746
          $$$1(element).css('padding-right', padding).removeData('padding-right');
Mark Otto's avatar
dist  
Mark Otto committed
4747
        }
Mark Otto's avatar
dist    
Mark Otto committed
4748
      }); // Restore sticky content and navbar-toggler margin
Mark Otto's avatar
dist  
Mark Otto committed
4749

Mark Otto's avatar
dist    
Mark Otto committed
4750
4751
      $$$1(Selector.STICKY_CONTENT + ", " + Selector.NAVBAR_TOGGLER).each(function (index, element) {
        var margin = $$$1(element).data('margin-right');
Mark Otto's avatar
dist    
Mark Otto committed
4752

Mark Otto's avatar
dist  
Mark Otto committed
4753
        if (typeof margin !== 'undefined') {
Mark Otto's avatar
dist    
Mark Otto committed
4754
          $$$1(element).css('margin-right', margin).removeData('margin-right');
Mark Otto's avatar
dist  
Mark Otto committed
4755
        }
Mark Otto's avatar
dist    
Mark Otto committed
4756
      }); // Restore body padding
Mark Otto's avatar
dist  
Mark Otto committed
4757

Mark Otto's avatar
dist    
Mark Otto committed
4758
      var padding = $$$1('body').data('padding-right');
Mark Otto's avatar
dist    
Mark Otto committed
4759

Mark Otto's avatar
dist  
Mark Otto committed
4760
      if (typeof padding !== 'undefined') {
Mark Otto's avatar
dist    
Mark Otto committed
4761
        $$$1('body').css('padding-right', padding).removeData('padding-right');
Mark Otto's avatar
dist  
Mark Otto committed
4762
4763
4764
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
4765
    _proto._getScrollbarWidth = function _getScrollbarWidth() {
Mark Otto's avatar
dist  
Mark Otto committed
4766
4767
4768
4769
4770
4771
4772
      // 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;
Mark Otto's avatar
dist    
Mark Otto committed
4773
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
4774
4775
4776
4777


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

Mark Otto's avatar
dist    
Mark Otto committed
4780
        var _config = _extends({}, Modal.Default, $$$1(this).data(), typeof config === 'object' && config);
Mark Otto's avatar
dist  
Mark Otto committed
4781
4782
4783

        if (!data) {
          data = new Modal(this, _config);
Mark Otto's avatar
dist    
Mark Otto committed
4784
          $$$1(this).data(DATA_KEY, data);
Mark Otto's avatar
dist  
Mark Otto committed
4785
4786
4787
4788
        }

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

Mark Otto's avatar
dist  
Mark Otto committed
4792
4793
4794
4795
4796
4797
4798
          data[config](relatedTarget);
        } else if (_config.show) {
          data.show(relatedTarget);
        }
      });
    };

Mark Otto's avatar
Mark Otto committed
4799
    _createClass(Modal, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
4800
      key: "VERSION",
Mark Otto's avatar
dist  
Mark Otto committed
4801
4802
4803
4804
      get: function get() {
        return VERSION;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
4805
      key: "Default",
Mark Otto's avatar
dist  
Mark Otto committed
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
      get: function get() {
        return Default;
      }
    }]);
    return Modal;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
4818

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

Mark Otto's avatar
dist    
Mark Otto committed
4822
    var target;
Mark Otto's avatar
dist  
Mark Otto committed
4823
4824
4825
    var selector = Util.getSelectorFromElement(this);

    if (selector) {
Mark Otto's avatar
dist    
Mark Otto committed
4826
      target = $$$1(selector)[0];
Mark Otto's avatar
dist  
Mark Otto committed
4827
4828
    }

Mark Otto's avatar
dist    
Mark Otto committed
4829
    var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _extends({}, $$$1(target).data(), $$$1(this).data());
Mark Otto's avatar
dist  
Mark Otto committed
4830
4831
4832
4833
4834

    if (this.tagName === 'A' || this.tagName === 'AREA') {
      event.preventDefault();
    }

Mark Otto's avatar
dist    
Mark Otto committed
4835
    var $target = $$$1(target).one(Event.SHOW, function (showEvent) {
Mark Otto's avatar
dist  
Mark Otto committed
4836
      if (showEvent.isDefaultPrevented()) {
Mark Otto's avatar
dist    
Mark Otto committed
4837
        // Only register focus restorer if modal will actually get shown
Mark Otto's avatar
dist  
Mark Otto committed
4838
4839
4840
4841
        return;
      }

      $target.one(Event.HIDDEN, function () {
Mark Otto's avatar
dist    
Mark Otto committed
4842
        if ($$$1(_this10).is(':visible')) {
Mark Otto's avatar
dist  
Mark Otto committed
4843
4844
4845
4846
4847
          _this10.focus();
        }
      });
    });

Mark Otto's avatar
dist    
Mark Otto committed
4848
    Modal._jQueryInterface.call($$$1(target), config, this);
Mark Otto's avatar
dist  
Mark Otto committed
4849
4850
4851
4852
4853
4854
4855
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
4856
4857
  $$$1.fn[NAME] = Modal._jQueryInterface;
  $$$1.fn[NAME].Constructor = Modal;
Mark Otto's avatar
dist    
Mark Otto committed
4858

Mark Otto's avatar
dist    
Mark Otto committed
4859
4860
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
4861
4862
4863
4864
    return Modal._jQueryInterface;
  };

  return Modal;
Mark Otto's avatar
dist    
Mark Otto committed
4865
}($);
Mark Otto's avatar
dist  
Mark Otto committed
4866
4867
4868

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
4869
 * Bootstrap (v4.0.0): tooltip.js
Mark Otto's avatar
dist  
Mark Otto committed
4870
4871
4872
4873
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
4874
var Tooltip = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
4875
4876
4877
4878
4879
4880
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'tooltip';
Mark Otto's avatar
Mark Otto committed
4881
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
4882
  var DATA_KEY = 'bs.tooltip';
Mark Otto's avatar
dist    
Mark Otto committed
4883
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist    
Mark Otto committed
4884
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
4885
4886
  var TRANSITION_DURATION = 150;
  var CLASS_PREFIX = 'bs-tooltip';
Mark Otto's avatar
dist    
Mark Otto committed
4887
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
Mark Otto's avatar
dist  
Mark Otto committed
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
  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)',
Mark Otto's avatar
dist    
Mark Otto committed
4899
4900
    fallbackPlacement: '(string|array)',
    boundary: '(string|element)'
Mark Otto's avatar
dist  
Mark Otto committed
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
  };
  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,
Mark Otto's avatar
dist    
Mark Otto committed
4920
4921
    fallbackPlacement: 'flip',
    boundary: 'scrollParent'
Mark Otto's avatar
dist  
Mark Otto committed
4922
4923
4924
4925
4926
4927
  };
  var HoverState = {
    SHOW: 'show',
    OUT: 'out'
  };
  var Event = {
Mark Otto's avatar
dist    
Mark Otto committed
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
    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
Mark Otto's avatar
dist  
Mark Otto committed
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
  };
  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
4953
4954
4955
4956
4957
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
4958

Mark Otto's avatar
dist    
Mark Otto committed
4959
  };
Mark Otto's avatar
dist  
Mark Otto committed
4960

Mark Otto's avatar
dist    
Mark Otto committed
4961
4962
4963
4964
  var Tooltip =
  /*#__PURE__*/
  function () {
    function Tooltip(element, config) {
Mark Otto's avatar
dist    
Mark Otto committed
4965
4966
4967
4968
4969
      /**
       * Check for Popper dependency
       * Popper - https://popper.js.org
       */
      if (typeof Popper === 'undefined') {
Mark Otto's avatar
dist    
Mark Otto committed
4970
        throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');
Mark Otto's avatar
dist    
Mark Otto committed
4971
4972
4973
      } // private


Mark Otto's avatar
dist  
Mark Otto committed
4974
4975
4976
4977
      this._isEnabled = true;
      this._timeout = 0;
      this._hoverState = '';
      this._activeTrigger = {};
Mark Otto's avatar
dist    
Mark Otto committed
4978
      this._popper = null; // Protected
Mark Otto's avatar
dist  
Mark Otto committed
4979
4980
4981
4982
4983
4984

      this.element = element;
      this.config = this._getConfig(config);
      this.tip = null;

      this._setListeners();
Mark Otto's avatar
dist    
Mark Otto committed
4985
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
4986
4987


Mark Otto's avatar
dist    
Mark Otto committed
4988
    var _proto = Tooltip.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
4989

Mark Otto's avatar
dist    
Mark Otto committed
4990
    // Public
Mark Otto's avatar
dist    
Mark Otto committed
4991
    _proto.enable = function enable() {
Mark Otto's avatar
dist  
Mark Otto committed
4992
4993
4994
      this._isEnabled = true;
    };

Mark Otto's avatar
dist    
Mark Otto committed
4995
    _proto.disable = function disable() {
Mark Otto's avatar
dist  
Mark Otto committed
4996
4997
4998
      this._isEnabled = false;
    };

Mark Otto's avatar
dist    
Mark Otto committed
4999
    _proto.toggleEnabled = function toggleEnabled() {
Mark Otto's avatar
dist  
Mark Otto committed
5000
5001
5002
      this._isEnabled = !this._isEnabled;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5003
    _proto.toggle = function toggle(event) {
Mark Otto's avatar
dist  
Mark Otto committed
5004
5005
5006
5007
5008
5009
      if (!this._isEnabled) {
        return;
      }

      if (event) {
        var dataKey = this.constructor.DATA_KEY;
Mark Otto's avatar
dist    
Mark Otto committed
5010
        var context = $$$1(event.currentTarget).data(dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
5011
5012
5013

        if (!context) {
          context = new this.constructor(event.currentTarget, this._getDelegateConfig());
Mark Otto's avatar
dist    
Mark Otto committed
5014
          $$$1(event.currentTarget).data(dataKey, context);
Mark Otto's avatar
dist  
Mark Otto committed
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
        }

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

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

Mark Otto's avatar
dist  
Mark Otto committed
5028
5029
5030
5031
5032
5033
5034
          return;
        }

        this._enter(null, this);
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
5035
    _proto.dispose = function dispose() {
Mark Otto's avatar
dist  
Mark Otto committed
5036
      clearTimeout(this._timeout);
Mark Otto's avatar
dist    
Mark Otto committed
5037
5038
5039
      $$$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
5040
5041

      if (this.tip) {
Mark Otto's avatar
dist    
Mark Otto committed
5042
        $$$1(this.tip).remove();
Mark Otto's avatar
dist  
Mark Otto committed
5043
5044
5045
5046
5047
5048
      }

      this._isEnabled = null;
      this._timeout = null;
      this._hoverState = null;
      this._activeTrigger = null;
Mark Otto's avatar
dist    
Mark Otto committed
5049

Mark Otto's avatar
dist  
Mark Otto committed
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
      if (this._popper !== null) {
        this._popper.destroy();
      }

      this._popper = null;
      this.element = null;
      this.config = null;
      this.tip = null;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5060
    _proto.show = function show() {
Mark Otto's avatar
dist  
Mark Otto committed
5061
5062
      var _this = this;

Mark Otto's avatar
dist    
Mark Otto committed
5063
      if ($$$1(this.element).css('display') === 'none') {
Mark Otto's avatar
dist  
Mark Otto committed
5064
5065
5066
        throw new Error('Please use show on visible elements');
      }

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

Mark Otto's avatar
dist  
Mark Otto committed
5069
      if (this.isWithContent() && this._isEnabled) {
Mark Otto's avatar
dist    
Mark Otto committed
5070
5071
        $$$1(this.element).trigger(showEvent);
        var isInTheDom = $$$1.contains(this.element.ownerDocument.documentElement, this.element);
Mark Otto's avatar
dist  
Mark Otto committed
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083

        if (showEvent.isDefaultPrevented() || !isInTheDom) {
          return;
        }

        var tip = this.getTipElement();
        var tipId = Util.getUID(this.constructor.NAME);
        tip.setAttribute('id', tipId);
        this.element.setAttribute('aria-describedby', tipId);
        this.setContent();

        if (this.config.animation) {
Mark Otto's avatar
dist    
Mark Otto committed
5084
          $$$1(tip).addClass(ClassName.FADE);
Mark Otto's avatar
dist  
Mark Otto committed
5085
5086
5087
5088
5089
5090
        }

        var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;

        var attachment = this._getAttachment(placement);

Mark Otto's avatar
dist    
Mark Otto committed
5091
        this.addAttachmentClass(attachment);
Mark Otto's avatar
dist    
Mark Otto committed
5092
5093
        var container = this.config.container === false ? document.body : $$$1(this.config.container);
        $$$1(tip).data(this.constructor.DATA_KEY, this);
Mark Otto's avatar
dist  
Mark Otto committed
5094

Mark Otto's avatar
dist    
Mark Otto committed
5095
5096
        if (!$$$1.contains(this.element.ownerDocument.documentElement, this.tip)) {
          $$$1(tip).appendTo(container);
Mark Otto's avatar
dist  
Mark Otto committed
5097
5098
        }

Mark Otto's avatar
dist    
Mark Otto committed
5099
        $$$1(this.element).trigger(this.constructor.Event.INSERTED);
Mark Otto's avatar
dist  
Mark Otto committed
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
        this._popper = new Popper(this.element, tip, {
          placement: attachment,
          modifiers: {
            offset: {
              offset: this.config.offset
            },
            flip: {
              behavior: this.config.fallbackPlacement
            },
            arrow: {
              element: Selector.ARROW
Mark Otto's avatar
dist    
Mark Otto committed
5111
5112
5113
            },
            preventOverflow: {
              boundariesElement: this.config.boundary
Mark Otto's avatar
dist  
Mark Otto committed
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
            }
          },
          onCreate: function onCreate(data) {
            if (data.originalPlacement !== data.placement) {
              _this._handlePopperPlacementChange(data);
            }
          },
          onUpdate: function onUpdate(data) {
            _this._handlePopperPlacementChange(data);
          }
        });
Mark Otto's avatar
dist    
Mark Otto committed
5125
        $$$1(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
Mark Otto's avatar
dist  
Mark Otto committed
5126
5127
5128
        // 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
5129

Mark Otto's avatar
dist  
Mark Otto committed
5130
        if ('ontouchstart' in document.documentElement) {
Mark Otto's avatar
dist    
Mark Otto committed
5131
          $$$1('body').children().on('mouseover', null, $$$1.noop);
Mark Otto's avatar
dist  
Mark Otto committed
5132
5133
5134
5135
5136
5137
        }

        var complete = function complete() {
          if (_this.config.animation) {
            _this._fixTransition();
          }
Mark Otto's avatar
dist    
Mark Otto committed
5138

Mark Otto's avatar
dist  
Mark Otto committed
5139
5140
          var prevHoverState = _this._hoverState;
          _this._hoverState = null;
Mark Otto's avatar
dist    
Mark Otto committed
5141
          $$$1(_this.element).trigger(_this.constructor.Event.SHOWN);
Mark Otto's avatar
dist  
Mark Otto committed
5142
5143
5144
5145
5146
5147

          if (prevHoverState === HoverState.OUT) {
            _this._leave(null, _this);
          }
        };

Mark Otto's avatar
dist    
Mark Otto committed
5148
5149
        if (Util.supportsTransitionEnd() && $$$1(this.tip).hasClass(ClassName.FADE)) {
          $$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
Mark Otto's avatar
dist  
Mark Otto committed
5150
5151
5152
5153
5154
5155
        } else {
          complete();
        }
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
5156
    _proto.hide = function hide(callback) {
Mark Otto's avatar
dist  
Mark Otto committed
5157
5158
5159
      var _this2 = this;

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

Mark Otto's avatar
dist  
Mark Otto committed
5162
5163
5164
5165
5166
5167
      var complete = function complete() {
        if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
          tip.parentNode.removeChild(tip);
        }

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

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

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

Mark Otto's avatar
dist  
Mark Otto committed
5173
5174
5175
5176
5177
5178
5179
5180
5181
        if (_this2._popper !== null) {
          _this2._popper.destroy();
        }

        if (callback) {
          callback();
        }
      };

Mark Otto's avatar
dist    
Mark Otto committed
5182
      $$$1(this.element).trigger(hideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
5183
5184
5185
5186
5187

      if (hideEvent.isDefaultPrevented()) {
        return;
      }

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

Mark Otto's avatar
dist  
Mark Otto committed
5191
      if ('ontouchstart' in document.documentElement) {
Mark Otto's avatar
dist    
Mark Otto committed
5192
        $$$1('body').children().off('mouseover', null, $$$1.noop);
Mark Otto's avatar
dist  
Mark Otto committed
5193
5194
5195
5196
5197
5198
      }

      this._activeTrigger[Trigger.CLICK] = false;
      this._activeTrigger[Trigger.FOCUS] = false;
      this._activeTrigger[Trigger.HOVER] = false;

Mark Otto's avatar
dist    
Mark Otto committed
5199
5200
      if (Util.supportsTransitionEnd() && $$$1(this.tip).hasClass(ClassName.FADE)) {
        $$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
Mark Otto's avatar
dist  
Mark Otto committed
5201
5202
5203
5204
5205
5206
5207
      } else {
        complete();
      }

      this._hoverState = '';
    };

Mark Otto's avatar
dist    
Mark Otto committed
5208
    _proto.update = function update() {
Mark Otto's avatar
dist  
Mark Otto committed
5209
5210
5211
      if (this._popper !== null) {
        this._popper.scheduleUpdate();
      }
Mark Otto's avatar
dist    
Mark Otto committed
5212
    }; // Protected
Mark Otto's avatar
dist  
Mark Otto committed
5213
5214


Mark Otto's avatar
dist    
Mark Otto committed
5215
    _proto.isWithContent = function isWithContent() {
Mark Otto's avatar
dist  
Mark Otto committed
5216
5217
5218
      return Boolean(this.getTitle());
    };

Mark Otto's avatar
dist    
Mark Otto committed
5219
    _proto.addAttachmentClass = function addAttachmentClass(attachment) {
Mark Otto's avatar
dist    
Mark Otto committed
5220
      $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
Mark Otto's avatar
dist  
Mark Otto committed
5221
5222
    };

Mark Otto's avatar
dist    
Mark Otto committed
5223
    _proto.getTipElement = function getTipElement() {
Mark Otto's avatar
dist    
Mark Otto committed
5224
      this.tip = this.tip || $$$1(this.config.template)[0];
Mark Otto's avatar
dist  
Mark Otto committed
5225
5226
5227
      return this.tip;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5228
    _proto.setContent = function setContent() {
Mark Otto's avatar
dist    
Mark Otto committed
5229
      var $tip = $$$1(this.getTipElement());
Mark Otto's avatar
dist  
Mark Otto committed
5230
      this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
Mark Otto's avatar
dist    
Mark Otto committed
5231
      $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
5232
5233
    };

Mark Otto's avatar
dist    
Mark Otto committed
5234
    _proto.setElementContent = function setElementContent($element, content) {
Mark Otto's avatar
dist  
Mark Otto committed
5235
      var html = this.config.html;
Mark Otto's avatar
dist    
Mark Otto committed
5236
5237

      if (typeof content === 'object' && (content.nodeType || content.jquery)) {
Mark Otto's avatar
dist    
Mark Otto committed
5238
        // Content is a DOM node or a jQuery
Mark Otto's avatar
dist  
Mark Otto committed
5239
        if (html) {
Mark Otto's avatar
dist    
Mark Otto committed
5240
          if (!$$$1(content).parent().is($element)) {
Mark Otto's avatar
dist  
Mark Otto committed
5241
5242
5243
            $element.empty().append(content);
          }
        } else {
Mark Otto's avatar
dist    
Mark Otto committed
5244
          $element.text($$$1(content).text());
Mark Otto's avatar
dist  
Mark Otto committed
5245
5246
5247
5248
5249
5250
        }
      } else {
        $element[html ? 'html' : 'text'](content);
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
5251
    _proto.getTitle = function getTitle() {
Mark Otto's avatar
dist  
Mark Otto committed
5252
5253
5254
5255
5256
5257
5258
      var title = this.element.getAttribute('data-original-title');

      if (!title) {
        title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
      }

      return title;
Mark Otto's avatar
dist    
Mark Otto committed
5259
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
5260
5261


Mark Otto's avatar
dist    
Mark Otto committed
5262
    _proto._getAttachment = function _getAttachment(placement) {
Mark Otto's avatar
dist  
Mark Otto committed
5263
5264
5265
      return AttachmentMap[placement.toUpperCase()];
    };

Mark Otto's avatar
dist    
Mark Otto committed
5266
    _proto._setListeners = function _setListeners() {
Mark Otto's avatar
dist  
Mark Otto committed
5267
5268
5269
5270
5271
      var _this3 = this;

      var triggers = this.config.trigger.split(' ');
      triggers.forEach(function (trigger) {
        if (trigger === 'click') {
Mark Otto's avatar
dist    
Mark Otto committed
5272
          $$$1(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
5273
5274
5275
5276
5277
            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;
Mark Otto's avatar
dist    
Mark Otto committed
5278
          $$$1(_this3.element).on(eventIn, _this3.config.selector, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
5279
5280
5281
5282
5283
5284
            return _this3._enter(event);
          }).on(eventOut, _this3.config.selector, function (event) {
            return _this3._leave(event);
          });
        }

Mark Otto's avatar
dist    
Mark Otto committed
5285
        $$$1(_this3.element).closest('.modal').on('hide.bs.modal', function () {
Mark Otto's avatar
dist  
Mark Otto committed
5286
5287
5288
5289
5290
          return _this3.hide();
        });
      });

      if (this.config.selector) {
Mark Otto's avatar
dist    
Mark Otto committed
5291
        this.config = _extends({}, this.config, {
Mark Otto's avatar
dist  
Mark Otto committed
5292
5293
5294
5295
5296
5297
5298
5299
          trigger: 'manual',
          selector: ''
        });
      } else {
        this._fixTitle();
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
5300
5301
5302
    _proto._fixTitle = function _fixTitle() {
      var titleType = typeof this.element.getAttribute('data-original-title');

Mark Otto's avatar
dist  
Mark Otto committed
5303
5304
5305
5306
5307
5308
      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
5309
    _proto._enter = function _enter(event, context) {
Mark Otto's avatar
dist  
Mark Otto committed
5310
      var dataKey = this.constructor.DATA_KEY;
Mark Otto's avatar
dist    
Mark Otto committed
5311
      context = context || $$$1(event.currentTarget).data(dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
5312
5313
5314

      if (!context) {
        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
Mark Otto's avatar
dist    
Mark Otto committed
5315
        $$$1(event.currentTarget).data(dataKey, context);
Mark Otto's avatar
dist  
Mark Otto committed
5316
5317
5318
5319
5320
5321
      }

      if (event) {
        context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
      }

Mark Otto's avatar
dist    
Mark Otto committed
5322
      if ($$$1(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
Mark Otto's avatar
dist  
Mark Otto committed
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
        context._hoverState = HoverState.SHOW;
        return;
      }

      clearTimeout(context._timeout);
      context._hoverState = HoverState.SHOW;

      if (!context.config.delay || !context.config.delay.show) {
        context.show();
        return;
      }

      context._timeout = setTimeout(function () {
        if (context._hoverState === HoverState.SHOW) {
          context.show();
        }
      }, context.config.delay.show);
    };

Mark Otto's avatar
dist    
Mark Otto committed
5342
    _proto._leave = function _leave(event, context) {
Mark Otto's avatar
dist  
Mark Otto committed
5343
      var dataKey = this.constructor.DATA_KEY;
Mark Otto's avatar
dist    
Mark Otto committed
5344
      context = context || $$$1(event.currentTarget).data(dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
5345
5346
5347

      if (!context) {
        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
Mark Otto's avatar
dist    
Mark Otto committed
5348
        $$$1(event.currentTarget).data(dataKey, context);
Mark Otto's avatar
dist  
Mark Otto committed
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
      }

      if (event) {
        context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
      }

      if (context._isWithActiveTrigger()) {
        return;
      }

      clearTimeout(context._timeout);
      context._hoverState = HoverState.OUT;

      if (!context.config.delay || !context.config.delay.hide) {
        context.hide();
        return;
      }

      context._timeout = setTimeout(function () {
        if (context._hoverState === HoverState.OUT) {
          context.hide();
        }
      }, context.config.delay.hide);
    };

Mark Otto's avatar
dist    
Mark Otto committed
5374
    _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
Mark Otto's avatar
dist  
Mark Otto committed
5375
5376
5377
5378
5379
5380
5381
5382
5383
      for (var trigger in this._activeTrigger) {
        if (this._activeTrigger[trigger]) {
          return true;
        }
      }

      return false;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5384
    _proto._getConfig = function _getConfig(config) {
Mark Otto's avatar
dist    
Mark Otto committed
5385
      config = _extends({}, this.constructor.Default, $$$1(this.element).data(), config);
Mark Otto's avatar
dist  
Mark Otto committed
5386

Mark Otto's avatar
dist    
Mark Otto committed
5387
      if (typeof config.delay === 'number') {
Mark Otto's avatar
dist  
Mark Otto committed
5388
5389
5390
5391
5392
5393
        config.delay = {
          show: config.delay,
          hide: config.delay
        };
      }

Mark Otto's avatar
dist    
Mark Otto committed
5394
      if (typeof config.title === 'number') {
Mark Otto's avatar
dist  
Mark Otto committed
5395
5396
5397
        config.title = config.title.toString();
      }

Mark Otto's avatar
dist    
Mark Otto committed
5398
      if (typeof config.content === 'number') {
Mark Otto's avatar
dist  
Mark Otto committed
5399
5400
5401
5402
5403
5404
5405
        config.content = config.content.toString();
      }

      Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
      return config;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5406
    _proto._getDelegateConfig = function _getDelegateConfig() {
Mark Otto's avatar
dist  
Mark Otto committed
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
      var config = {};

      if (this.config) {
        for (var key in this.config) {
          if (this.constructor.Default[key] !== this.config[key]) {
            config[key] = this.config[key];
          }
        }
      }

      return config;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5420
    _proto._cleanTipClass = function _cleanTipClass() {
Mark Otto's avatar
dist    
Mark Otto committed
5421
      var $tip = $$$1(this.getTipElement());
Mark Otto's avatar
dist  
Mark Otto committed
5422
      var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
Mark Otto's avatar
dist    
Mark Otto committed
5423

Mark Otto's avatar
dist  
Mark Otto committed
5424
5425
5426
5427
5428
      if (tabClass !== null && tabClass.length > 0) {
        $tip.removeClass(tabClass.join(''));
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
5429
    _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(data) {
Mark Otto's avatar
dist  
Mark Otto committed
5430
      this._cleanTipClass();
Mark Otto's avatar
dist    
Mark Otto committed
5431

Mark Otto's avatar
dist  
Mark Otto committed
5432
5433
5434
      this.addAttachmentClass(this._getAttachment(data.placement));
    };

Mark Otto's avatar
dist    
Mark Otto committed
5435
    _proto._fixTransition = function _fixTransition() {
Mark Otto's avatar
dist  
Mark Otto committed
5436
5437
      var tip = this.getTipElement();
      var initConfigAnimation = this.config.animation;
Mark Otto's avatar
dist    
Mark Otto committed
5438

Mark Otto's avatar
dist  
Mark Otto committed
5439
5440
5441
      if (tip.getAttribute('x-placement') !== null) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
5442

Mark Otto's avatar
dist    
Mark Otto committed
5443
      $$$1(tip).removeClass(ClassName.FADE);
Mark Otto's avatar
dist  
Mark Otto committed
5444
5445
5446
5447
      this.config.animation = false;
      this.hide();
      this.show();
      this.config.animation = initConfigAnimation;
Mark Otto's avatar
dist    
Mark Otto committed
5448
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
5449
5450
5451
5452


    Tooltip._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
Mark Otto's avatar
dist    
Mark Otto committed
5453
        var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
5454
5455

        var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist  
Mark Otto committed
5456
5457
5458
5459
5460
5461
5462

        if (!data && /dispose|hide/.test(config)) {
          return;
        }

        if (!data) {
          data = new Tooltip(this, _config);
Mark Otto's avatar
dist    
Mark Otto committed
5463
          $$$1(this).data(DATA_KEY, data);
Mark Otto's avatar
dist  
Mark Otto committed
5464
5465
5466
5467
        }

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

Mark Otto's avatar
dist  
Mark Otto committed
5471
5472
5473
5474
5475
          data[config]();
        }
      });
    };

Mark Otto's avatar
Mark Otto committed
5476
    _createClass(Tooltip, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
5477
      key: "VERSION",
Mark Otto's avatar
dist  
Mark Otto committed
5478
5479
5480
5481
      get: function get() {
        return VERSION;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5482
      key: "Default",
Mark Otto's avatar
dist  
Mark Otto committed
5483
5484
5485
5486
      get: function get() {
        return Default;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5487
      key: "NAME",
Mark Otto's avatar
dist  
Mark Otto committed
5488
5489
5490
5491
      get: function get() {
        return NAME;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5492
      key: "DATA_KEY",
Mark Otto's avatar
dist  
Mark Otto committed
5493
5494
5495
5496
      get: function get() {
        return DATA_KEY;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5497
      key: "Event",
Mark Otto's avatar
dist  
Mark Otto committed
5498
5499
5500
5501
      get: function get() {
        return Event;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5502
      key: "EVENT_KEY",
Mark Otto's avatar
dist  
Mark Otto committed
5503
5504
5505
5506
      get: function get() {
        return EVENT_KEY;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5507
      key: "DefaultType",
Mark Otto's avatar
dist  
Mark Otto committed
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
      get: function get() {
        return DefaultType;
      }
    }]);
    return Tooltip;
  }();
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
5520

Mark Otto's avatar
dist    
Mark Otto committed
5521
5522
  $$$1.fn[NAME] = Tooltip._jQueryInterface;
  $$$1.fn[NAME].Constructor = Tooltip;
Mark Otto's avatar
dist    
Mark Otto committed
5523

Mark Otto's avatar
dist    
Mark Otto committed
5524
5525
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
5526
5527
5528
5529
    return Tooltip._jQueryInterface;
  };

  return Tooltip;
Mark Otto's avatar
dist    
Mark Otto committed
5530
}($, Popper);
Mark Otto's avatar
dist  
Mark Otto committed
5531
5532
5533

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
5534
 * Bootstrap (v4.0.0): popover.js
Mark Otto's avatar
dist  
Mark Otto committed
5535
5536
5537
5538
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
5539
var Popover = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
5540
5541
5542
5543
5544
5545
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'popover';
Mark Otto's avatar
Mark Otto committed
5546
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
5547
  var DATA_KEY = 'bs.popover';
Mark Otto's avatar
dist    
Mark Otto committed
5548
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist    
Mark Otto committed
5549
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
5550
  var CLASS_PREFIX = 'bs-popover';
Mark Otto's avatar
dist    
Mark Otto committed
5551
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
Mark Otto's avatar
dist    
Mark Otto committed
5552
  var Default = _extends({}, Tooltip.Default, {
Mark Otto's avatar
dist  
Mark Otto committed
5553
5554
5555
5556
5557
    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
5558
  var DefaultType = _extends({}, Tooltip.DefaultType, {
Mark Otto's avatar
dist  
Mark Otto committed
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
    content: '(string|element|function)'
  });
  var ClassName = {
    FADE: 'fade',
    SHOW: 'show'
  };
  var Selector = {
    TITLE: '.popover-header',
    CONTENT: '.popover-body'
  };
  var Event = {
Mark Otto's avatar
dist    
Mark Otto committed
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
    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
Mark Otto's avatar
dist    
Mark Otto committed
5580
5581
5582
5583
5584
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
5585

Mark Otto's avatar
dist    
Mark Otto committed
5586
  };
Mark Otto's avatar
dist    
Mark Otto committed
5587
5588
5589
5590

  var Popover =
  /*#__PURE__*/
  function (_Tooltip) {
Mark Otto's avatar
Mark Otto committed
5591
    _inheritsLoose(Popover, _Tooltip);
Mark Otto's avatar
dist  
Mark Otto committed
5592
5593

    function Popover() {
Mark Otto's avatar
dist    
Mark Otto committed
5594
      return _Tooltip.apply(this, arguments) || this;
Mark Otto's avatar
dist  
Mark Otto committed
5595
5596
    }

Mark Otto's avatar
dist    
Mark Otto committed
5597
    var _proto = Popover.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
5598

Mark Otto's avatar
dist    
Mark Otto committed
5599
    // Overrides
Mark Otto's avatar
dist    
Mark Otto committed
5600
    _proto.isWithContent = function isWithContent() {
Mark Otto's avatar
dist  
Mark Otto committed
5601
5602
5603
      return this.getTitle() || this._getContent();
    };

Mark Otto's avatar
dist    
Mark Otto committed
5604
    _proto.addAttachmentClass = function addAttachmentClass(attachment) {
Mark Otto's avatar
dist    
Mark Otto committed
5605
      $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
Mark Otto's avatar
dist  
Mark Otto committed
5606
5607
    };

Mark Otto's avatar
dist    
Mark Otto committed
5608
    _proto.getTipElement = function getTipElement() {
Mark Otto's avatar
dist    
Mark Otto committed
5609
      this.tip = this.tip || $$$1(this.config.template)[0];
Mark Otto's avatar
dist  
Mark Otto committed
5610
5611
5612
      return this.tip;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5613
    _proto.setContent = function setContent() {
Mark Otto's avatar
dist    
Mark Otto committed
5614
      var $tip = $$$1(this.getTipElement()); // We use append for html objects to maintain js events
Mark Otto's avatar
dist  
Mark Otto committed
5615
5616

      this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
Mark Otto's avatar
Mark Otto committed
5617
5618
5619
5620
5621
5622
5623
5624

      var content = this._getContent();

      if (typeof content === 'function') {
        content = content.call(this.element);
      }

      this.setElementContent($tip.find(Selector.CONTENT), content);
Mark Otto's avatar
dist    
Mark Otto committed
5625
      $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
Mark Otto's avatar
dist    
Mark Otto committed
5626
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
5627
5628


Mark Otto's avatar
dist    
Mark Otto committed
5629
    _proto._getContent = function _getContent() {
Mark Otto's avatar
Mark Otto committed
5630
      return this.element.getAttribute('data-content') || this.config.content;
Mark Otto's avatar
dist  
Mark Otto committed
5631
5632
    };

Mark Otto's avatar
dist    
Mark Otto committed
5633
    _proto._cleanTipClass = function _cleanTipClass() {
Mark Otto's avatar
dist    
Mark Otto committed
5634
      var $tip = $$$1(this.getTipElement());
Mark Otto's avatar
dist  
Mark Otto committed
5635
      var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
Mark Otto's avatar
dist    
Mark Otto committed
5636

Mark Otto's avatar
dist  
Mark Otto committed
5637
5638
5639
      if (tabClass !== null && tabClass.length > 0) {
        $tip.removeClass(tabClass.join(''));
      }
Mark Otto's avatar
dist    
Mark Otto committed
5640
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
5641
5642
5643
5644


    Popover._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
Mark Otto's avatar
dist    
Mark Otto committed
5645
        var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
5646
5647

        var _config = typeof config === 'object' ? config : null;
Mark Otto's avatar
dist  
Mark Otto committed
5648
5649
5650
5651
5652
5653
5654

        if (!data && /destroy|hide/.test(config)) {
          return;
        }

        if (!data) {
          data = new Popover(this, _config);
Mark Otto's avatar
dist    
Mark Otto committed
5655
          $$$1(this).data(DATA_KEY, data);
Mark Otto's avatar
dist  
Mark Otto committed
5656
5657
5658
5659
        }

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

Mark Otto's avatar
dist  
Mark Otto committed
5663
5664
5665
5666
5667
          data[config]();
        }
      });
    };

Mark Otto's avatar
Mark Otto committed
5668
    _createClass(Popover, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
5669
      key: "VERSION",
Mark Otto's avatar
dist    
Mark Otto committed
5670
      // Getters
Mark Otto's avatar
dist  
Mark Otto committed
5671
5672
5673
5674
      get: function get() {
        return VERSION;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5675
      key: "Default",
Mark Otto's avatar
dist  
Mark Otto committed
5676
5677
5678
5679
      get: function get() {
        return Default;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5680
      key: "NAME",
Mark Otto's avatar
dist  
Mark Otto committed
5681
5682
5683
5684
      get: function get() {
        return NAME;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5685
      key: "DATA_KEY",
Mark Otto's avatar
dist  
Mark Otto committed
5686
5687
5688
5689
      get: function get() {
        return DATA_KEY;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5690
      key: "Event",
Mark Otto's avatar
dist  
Mark Otto committed
5691
5692
5693
5694
      get: function get() {
        return Event;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5695
      key: "EVENT_KEY",
Mark Otto's avatar
dist  
Mark Otto committed
5696
5697
5698
5699
      get: function get() {
        return EVENT_KEY;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5700
      key: "DefaultType",
Mark Otto's avatar
dist  
Mark Otto committed
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
      get: function get() {
        return DefaultType;
      }
    }]);
    return Popover;
  }(Tooltip);
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
5713

Mark Otto's avatar
dist    
Mark Otto committed
5714
5715
  $$$1.fn[NAME] = Popover._jQueryInterface;
  $$$1.fn[NAME].Constructor = Popover;
Mark Otto's avatar
dist    
Mark Otto committed
5716

Mark Otto's avatar
dist    
Mark Otto committed
5717
5718
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
5719
5720
5721
5722
    return Popover._jQueryInterface;
  };

  return Popover;
Mark Otto's avatar
dist    
Mark Otto committed
5723
}($);
Mark Otto's avatar
dist  
Mark Otto committed
5724
5725
5726

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
5727
 * Bootstrap (v4.0.0): scrollspy.js
Mark Otto's avatar
dist  
Mark Otto committed
5728
5729
5730
5731
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
5732
var ScrollSpy = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
5733
5734
5735
5736
5737
5738
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'scrollspy';
Mark Otto's avatar
Mark Otto committed
5739
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
5740
  var DATA_KEY = 'bs.scrollspy';
Mark Otto's avatar
dist    
Mark Otto committed
5741
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist  
Mark Otto committed
5742
  var DATA_API_KEY = '.data-api';
Mark Otto's avatar
dist    
Mark Otto committed
5743
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
  var Default = {
    offset: 10,
    method: 'auto',
    target: ''
  };
  var DefaultType = {
    offset: 'number',
    method: 'string',
    target: '(string|element)'
  };
  var Event = {
Mark Otto's avatar
dist    
Mark Otto committed
5755
5756
5757
    ACTIVATE: "activate" + EVENT_KEY,
    SCROLL: "scroll" + EVENT_KEY,
    LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY
Mark Otto's avatar
dist  
Mark Otto committed
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
  };
  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',
Mark Otto's avatar
dist    
Mark Otto committed
5769
    NAV_ITEMS: '.nav-item',
Mark Otto's avatar
dist  
Mark Otto committed
5770
5771
5772
5773
5774
5775
5776
5777
    LIST_ITEMS: '.list-group-item',
    DROPDOWN: '.dropdown',
    DROPDOWN_ITEMS: '.dropdown-item',
    DROPDOWN_TOGGLE: '.dropdown-toggle'
  };
  var OffsetMethod = {
    OFFSET: 'offset',
    POSITION: 'position'
Mark Otto's avatar
dist    
Mark Otto committed
5778
5779
5780
5781
5782
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
5783

Mark Otto's avatar
dist    
Mark Otto committed
5784
  };
Mark Otto's avatar
dist    
Mark Otto committed
5785
5786
5787
5788

  var ScrollSpy =
  /*#__PURE__*/
  function () {
Mark Otto's avatar
dist  
Mark Otto committed
5789
5790
5791
5792
5793
5794
    function ScrollSpy(element, config) {
      var _this = this;

      this._element = element;
      this._scrollElement = element.tagName === 'BODY' ? window : element;
      this._config = this._getConfig(config);
Mark Otto's avatar
dist    
Mark Otto committed
5795
      this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS);
Mark Otto's avatar
dist  
Mark Otto committed
5796
5797
5798
5799
      this._offsets = [];
      this._targets = [];
      this._activeTarget = null;
      this._scrollHeight = 0;
Mark Otto's avatar
dist    
Mark Otto committed
5800
      $$$1(this._scrollElement).on(Event.SCROLL, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
5801
5802
5803
        return _this._process(event);
      });
      this.refresh();
Mark Otto's avatar
dist    
Mark Otto committed
5804

Mark Otto's avatar
dist  
Mark Otto committed
5805
      this._process();
Mark Otto's avatar
dist    
Mark Otto committed
5806
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
5807
5808


Mark Otto's avatar
dist    
Mark Otto committed
5809
    var _proto = ScrollSpy.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
5810

Mark Otto's avatar
dist    
Mark Otto committed
5811
    // Public
Mark Otto's avatar
dist    
Mark Otto committed
5812
    _proto.refresh = function refresh() {
Mark Otto's avatar
dist  
Mark Otto committed
5813
5814
      var _this2 = this;

Mark Otto's avatar
dist    
Mark Otto committed
5815
      var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
Mark Otto's avatar
dist  
Mark Otto committed
5816
5817
5818
5819
5820
      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
5821
      var targets = $$$1.makeArray($$$1(this._selector));
Mark Otto's avatar
dist  
Mark Otto committed
5822
      targets.map(function (element) {
Mark Otto's avatar
dist    
Mark Otto committed
5823
        var target;
Mark Otto's avatar
dist  
Mark Otto committed
5824
5825
5826
        var targetSelector = Util.getSelectorFromElement(element);

        if (targetSelector) {
Mark Otto's avatar
dist    
Mark Otto committed
5827
          target = $$$1(targetSelector)[0];
Mark Otto's avatar
dist  
Mark Otto committed
5828
5829
5830
5831
        }

        if (target) {
          var targetBCR = target.getBoundingClientRect();
Mark Otto's avatar
dist    
Mark Otto committed
5832

Mark Otto's avatar
dist  
Mark Otto committed
5833
          if (targetBCR.width || targetBCR.height) {
Mark Otto's avatar
dist    
Mark Otto committed
5834
            // TODO (fat): remove sketch reliance on jQuery position/offset
Mark Otto's avatar
dist    
Mark Otto committed
5835
            return [$$$1(target)[offsetMethod]().top + offsetBase, targetSelector];
Mark Otto's avatar
dist  
Mark Otto committed
5836
5837
          }
        }
Mark Otto's avatar
dist    
Mark Otto committed
5838

Mark Otto's avatar
dist  
Mark Otto committed
5839
5840
5841
5842
5843
5844
5845
        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
5846

Mark Otto's avatar
dist  
Mark Otto committed
5847
5848
5849
5850
        _this2._targets.push(item[1]);
      });
    };

Mark Otto's avatar
dist    
Mark Otto committed
5851
    _proto.dispose = function dispose() {
Mark Otto's avatar
dist    
Mark Otto committed
5852
5853
      $$$1.removeData(this._element, DATA_KEY);
      $$$1(this._scrollElement).off(EVENT_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
5854
5855
5856
5857
5858
5859
5860
5861
      this._element = null;
      this._scrollElement = null;
      this._config = null;
      this._selector = null;
      this._offsets = null;
      this._targets = null;
      this._activeTarget = null;
      this._scrollHeight = null;
Mark Otto's avatar
dist    
Mark Otto committed
5862
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
5863
5864


Mark Otto's avatar
dist    
Mark Otto committed
5865
    _proto._getConfig = function _getConfig(config) {
Mark Otto's avatar
dist    
Mark Otto committed
5866
      config = _extends({}, Default, config);
Mark Otto's avatar
dist  
Mark Otto committed
5867
5868

      if (typeof config.target !== 'string') {
Mark Otto's avatar
dist    
Mark Otto committed
5869
        var id = $$$1(config.target).attr('id');
Mark Otto's avatar
dist    
Mark Otto committed
5870

Mark Otto's avatar
dist  
Mark Otto committed
5871
5872
        if (!id) {
          id = Util.getUID(NAME);
Mark Otto's avatar
dist    
Mark Otto committed
5873
          $$$1(config.target).attr('id', id);
Mark Otto's avatar
dist  
Mark Otto committed
5874
        }
Mark Otto's avatar
dist    
Mark Otto committed
5875
5876

        config.target = "#" + id;
Mark Otto's avatar
dist  
Mark Otto committed
5877
5878
5879
5880
5881
5882
      }

      Util.typeCheckConfig(NAME, config, DefaultType);
      return config;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5883
    _proto._getScrollTop = function _getScrollTop() {
Mark Otto's avatar
dist  
Mark Otto committed
5884
5885
5886
      return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5887
    _proto._getScrollHeight = function _getScrollHeight() {
Mark Otto's avatar
dist  
Mark Otto committed
5888
5889
5890
      return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
    };

Mark Otto's avatar
dist    
Mark Otto committed
5891
    _proto._getOffsetHeight = function _getOffsetHeight() {
Mark Otto's avatar
dist  
Mark Otto committed
5892
5893
5894
      return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
    };

Mark Otto's avatar
dist    
Mark Otto committed
5895
    _proto._process = function _process() {
Mark Otto's avatar
dist  
Mark Otto committed
5896
      var scrollTop = this._getScrollTop() + this._config.offset;
Mark Otto's avatar
dist    
Mark Otto committed
5897

Mark Otto's avatar
dist  
Mark Otto committed
5898
      var scrollHeight = this._getScrollHeight();
Mark Otto's avatar
dist    
Mark Otto committed
5899

Mark Otto's avatar
dist  
Mark Otto committed
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
      var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();

      if (this._scrollHeight !== scrollHeight) {
        this.refresh();
      }

      if (scrollTop >= maxScroll) {
        var target = this._targets[this._targets.length - 1];

        if (this._activeTarget !== target) {
          this._activate(target);
        }
Mark Otto's avatar
dist    
Mark Otto committed
5912

Mark Otto's avatar
dist  
Mark Otto committed
5913
5914
5915
5916
5917
        return;
      }

      if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
        this._activeTarget = null;
Mark Otto's avatar
dist    
Mark Otto committed
5918

Mark Otto's avatar
dist  
Mark Otto committed
5919
        this._clear();
Mark Otto's avatar
dist    
Mark Otto committed
5920

Mark Otto's avatar
dist  
Mark Otto committed
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
        return;
      }

      for (var i = this._offsets.length; i--;) {
        var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);

        if (isActiveTarget) {
          this._activate(this._targets[i]);
        }
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
5933
    _proto._activate = function _activate(target) {
Mark Otto's avatar
dist  
Mark Otto committed
5934
5935
5936
5937
      this._activeTarget = target;

      this._clear();

Mark Otto's avatar
dist    
Mark Otto committed
5938
5939
5940
      var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style


Mark Otto's avatar
dist  
Mark Otto committed
5941
      queries = queries.map(function (selector) {
Mark Otto's avatar
dist    
Mark Otto committed
5942
        return selector + "[data-target=\"" + target + "\"]," + (selector + "[href=\"" + target + "\"]");
Mark Otto's avatar
dist  
Mark Otto committed
5943
      });
Mark Otto's avatar
dist    
Mark Otto committed
5944
      var $link = $$$1(queries.join(','));
Mark Otto's avatar
dist  
Mark Otto committed
5945
5946
5947
5948
5949
5950

      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
Mark Otto's avatar
dist    
Mark Otto committed
5951
        $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active
Mark Otto's avatar
dist  
Mark Otto committed
5952
        // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
Mark Otto's avatar
dist    
Mark Otto committed
5953
5954
5955
5956

        $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

        $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
5957
5958
      }

Mark Otto's avatar
dist    
Mark Otto committed
5959
      $$$1(this._scrollElement).trigger(Event.ACTIVATE, {
Mark Otto's avatar
dist  
Mark Otto committed
5960
5961
5962
5963
        relatedTarget: target
      });
    };

Mark Otto's avatar
dist    
Mark Otto committed
5964
    _proto._clear = function _clear() {
Mark Otto's avatar
dist    
Mark Otto committed
5965
      $$$1(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
5966
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
5967
5968
5969
5970


    ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
Mark Otto's avatar
dist    
Mark Otto committed
5971
        var data = $$$1(this).data(DATA_KEY);
Mark Otto's avatar
dist    
Mark Otto committed
5972
5973

        var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist  
Mark Otto committed
5974
5975
5976

        if (!data) {
          data = new ScrollSpy(this, _config);
Mark Otto's avatar
dist    
Mark Otto committed
5977
          $$$1(this).data(DATA_KEY, data);
Mark Otto's avatar
dist  
Mark Otto committed
5978
5979
5980
5981
        }

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

Mark Otto's avatar
dist  
Mark Otto committed
5985
5986
5987
5988
5989
          data[config]();
        }
      });
    };

Mark Otto's avatar
Mark Otto committed
5990
    _createClass(ScrollSpy, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
5991
      key: "VERSION",
Mark Otto's avatar
dist  
Mark Otto committed
5992
5993
5994
5995
      get: function get() {
        return VERSION;
      }
    }, {
Mark Otto's avatar
dist    
Mark Otto committed
5996
      key: "Default",
Mark Otto's avatar
dist  
Mark Otto committed
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
      get: function get() {
        return Default;
      }
    }]);
    return ScrollSpy;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
6009

Mark Otto's avatar
dist    
Mark Otto committed
6010
6011
  $$$1(window).on(Event.LOAD_DATA_API, function () {
    var scrollSpys = $$$1.makeArray($$$1(Selector.DATA_SPY));
Mark Otto's avatar
dist  
Mark Otto committed
6012
6013

    for (var i = scrollSpys.length; i--;) {
Mark Otto's avatar
dist    
Mark Otto committed
6014
      var $spy = $$$1(scrollSpys[i]);
Mark Otto's avatar
dist    
Mark Otto committed
6015

Mark Otto's avatar
dist  
Mark Otto committed
6016
6017
6018
6019
6020
6021
6022
6023
6024
      ScrollSpy._jQueryInterface.call($spy, $spy.data());
    }
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
6025
6026
  $$$1.fn[NAME] = ScrollSpy._jQueryInterface;
  $$$1.fn[NAME].Constructor = ScrollSpy;
Mark Otto's avatar
dist    
Mark Otto committed
6027

Mark Otto's avatar
dist    
Mark Otto committed
6028
6029
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
6030
6031
6032
6033
    return ScrollSpy._jQueryInterface;
  };

  return ScrollSpy;
Mark Otto's avatar
dist    
Mark Otto committed
6034
}($);
Mark Otto's avatar
dist  
Mark Otto committed
6035
6036
6037

/**
 * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
6038
 * Bootstrap (v4.0.0): tab.js
Mark Otto's avatar
dist  
Mark Otto committed
6039
6040
6041
6042
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
6043
var Tab = function ($$$1) {
Mark Otto's avatar
dist  
Mark Otto committed
6044
6045
6046
6047
6048
6049
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
  var NAME = 'tab';
Mark Otto's avatar
Mark Otto committed
6050
  var VERSION = '4.0.0';
Mark Otto's avatar
dist  
Mark Otto committed
6051
  var DATA_KEY = 'bs.tab';
Mark Otto's avatar
dist    
Mark Otto committed
6052
  var EVENT_KEY = "." + DATA_KEY;
Mark Otto's avatar
dist  
Mark Otto committed
6053
  var DATA_API_KEY = '.data-api';
Mark Otto's avatar
dist    
Mark Otto committed
6054
  var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
Mark Otto's avatar
dist  
Mark Otto committed
6055
6056
  var TRANSITION_DURATION = 150;
  var Event = {
Mark Otto's avatar
dist    
Mark Otto committed
6057
6058
6059
6060
6061
    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
Mark Otto's avatar
dist  
Mark Otto committed
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
  };
  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'
Mark Otto's avatar
dist    
Mark Otto committed
6078
6079
6080
6081
6082
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
6083

Mark Otto's avatar
dist    
Mark Otto committed
6084
  };
Mark Otto's avatar
dist  
Mark Otto committed
6085

Mark Otto's avatar
dist    
Mark Otto committed
6086
6087
6088
6089
  var Tab =
  /*#__PURE__*/
  function () {
    function Tab(element) {
Mark Otto's avatar
dist  
Mark Otto committed
6090
      this._element = element;
Mark Otto's avatar
dist    
Mark Otto committed
6091
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
6092
6093


Mark Otto's avatar
dist    
Mark Otto committed
6094
    var _proto = Tab.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
6095

Mark Otto's avatar
dist    
Mark Otto committed
6096
    // Public
Mark Otto's avatar
dist    
Mark Otto committed
6097
    _proto.show = function show() {
Mark Otto's avatar
dist  
Mark Otto committed
6098
6099
      var _this = this;

Mark Otto's avatar
dist    
Mark Otto committed
6100
      if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) {
Mark Otto's avatar
dist  
Mark Otto committed
6101
6102
6103
        return;
      }

Mark Otto's avatar
dist    
Mark Otto committed
6104
6105
      var target;
      var previous;
Mark Otto's avatar
dist    
Mark Otto committed
6106
      var listElement = $$$1(this._element).closest(Selector.NAV_LIST_GROUP)[0];
Mark Otto's avatar
dist  
Mark Otto committed
6107
6108
6109
6110
      var selector = Util.getSelectorFromElement(this._element);

      if (listElement) {
        var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;
Mark Otto's avatar
dist    
Mark Otto committed
6111
        previous = $$$1.makeArray($$$1(listElement).find(itemSelector));
Mark Otto's avatar
dist  
Mark Otto committed
6112
6113
6114
        previous = previous[previous.length - 1];
      }

Mark Otto's avatar
dist    
Mark Otto committed
6115
      var hideEvent = $$$1.Event(Event.HIDE, {
Mark Otto's avatar
dist  
Mark Otto committed
6116
6117
        relatedTarget: this._element
      });
Mark Otto's avatar
dist    
Mark Otto committed
6118
      var showEvent = $$$1.Event(Event.SHOW, {
Mark Otto's avatar
dist  
Mark Otto committed
6119
6120
6121
6122
        relatedTarget: previous
      });

      if (previous) {
Mark Otto's avatar
dist    
Mark Otto committed
6123
        $$$1(previous).trigger(hideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
6124
6125
      }

Mark Otto's avatar
dist    
Mark Otto committed
6126
      $$$1(this._element).trigger(showEvent);
Mark Otto's avatar
dist  
Mark Otto committed
6127
6128
6129
6130
6131
6132

      if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
        return;
      }

      if (selector) {
Mark Otto's avatar
dist    
Mark Otto committed
6133
        target = $$$1(selector)[0];
Mark Otto's avatar
dist  
Mark Otto committed
6134
6135
6136
6137
6138
      }

      this._activate(this._element, listElement);

      var complete = function complete() {
Mark Otto's avatar
dist    
Mark Otto committed
6139
        var hiddenEvent = $$$1.Event(Event.HIDDEN, {
Mark Otto's avatar
dist  
Mark Otto committed
6140
6141
          relatedTarget: _this._element
        });
Mark Otto's avatar
dist    
Mark Otto committed
6142
        var shownEvent = $$$1.Event(Event.SHOWN, {
Mark Otto's avatar
dist  
Mark Otto committed
6143
6144
          relatedTarget: previous
        });
Mark Otto's avatar
dist    
Mark Otto committed
6145
6146
        $$$1(previous).trigger(hiddenEvent);
        $$$1(_this._element).trigger(shownEvent);
Mark Otto's avatar
dist  
Mark Otto committed
6147
6148
6149
6150
6151
6152
6153
6154
6155
      };

      if (target) {
        this._activate(target, target.parentNode, complete);
      } else {
        complete();
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
6156
    _proto.dispose = function dispose() {
Mark Otto's avatar
dist    
Mark Otto committed
6157
      $$$1.removeData(this._element, DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
6158
      this._element = null;
Mark Otto's avatar
dist    
Mark Otto committed
6159
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
6160
6161


Mark Otto's avatar
dist    
Mark Otto committed
6162
    _proto._activate = function _activate(element, container, callback) {
Mark Otto's avatar
dist  
Mark Otto committed
6163
6164
      var _this2 = this;

Mark Otto's avatar
dist    
Mark Otto committed
6165
6166
      var activeElements;

Mark Otto's avatar
dist  
Mark Otto committed
6167
      if (container.nodeName === 'UL') {
Mark Otto's avatar
dist    
Mark Otto committed
6168
        activeElements = $$$1(container).find(Selector.ACTIVE_UL);
Mark Otto's avatar
dist  
Mark Otto committed
6169
      } else {
Mark Otto's avatar
dist    
Mark Otto committed
6170
        activeElements = $$$1(container).children(Selector.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
6171
6172
6173
      }

      var active = activeElements[0];
Mark Otto's avatar
dist    
Mark Otto committed
6174
      var isTransitioning = callback && Util.supportsTransitionEnd() && active && $$$1(active).hasClass(ClassName.FADE);
Mark Otto's avatar
dist  
Mark Otto committed
6175
6176

      var complete = function complete() {
Mark Otto's avatar
dist    
Mark Otto committed
6177
        return _this2._transitionComplete(element, active, callback);
Mark Otto's avatar
dist  
Mark Otto committed
6178
6179
6180
      };

      if (active && isTransitioning) {
Mark Otto's avatar
dist    
Mark Otto committed
6181
        $$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
Mark Otto's avatar
dist  
Mark Otto committed
6182
6183
6184
6185
6186
      } else {
        complete();
      }
    };

Mark Otto's avatar
dist    
Mark Otto committed
6187
    _proto._transitionComplete = function _transitionComplete(element, active, callback) {
Mark Otto's avatar
dist  
Mark Otto committed
6188
      if (active) {
Mark Otto's avatar
dist    
Mark Otto committed
6189
        $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
6190
        var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
Mark Otto's avatar
dist  
Mark Otto committed
6191
6192

        if (dropdownChild) {
Mark Otto's avatar
dist    
Mark Otto committed
6193
          $$$1(dropdownChild).removeClass(ClassName.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
6194
6195
        }

Mark Otto's avatar
dist    
Mark Otto committed
6196
6197
6198
        if (active.getAttribute('role') === 'tab') {
          active.setAttribute('aria-selected', false);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6199
6200
      }

Mark Otto's avatar
dist    
Mark Otto committed
6201
      $$$1(element).addClass(ClassName.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
6202
6203
6204
6205

      if (element.getAttribute('role') === 'tab') {
        element.setAttribute('aria-selected', true);
      }
Mark Otto's avatar
dist  
Mark Otto committed
6206

Mark Otto's avatar
dist    
Mark Otto committed
6207
6208
      Util.reflow(element);
      $$$1(element).addClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
6209

Mark Otto's avatar
dist    
Mark Otto committed
6210
6211
      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
6212

Mark Otto's avatar
dist  
Mark Otto committed
6213
        if (dropdownElement) {
Mark Otto's avatar
dist    
Mark Otto committed
6214
          $$$1(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
6215
6216
6217
6218
6219
6220
6221
6222
        }

        element.setAttribute('aria-expanded', true);
      }

      if (callback) {
        callback();
      }
Mark Otto's avatar
dist    
Mark Otto committed
6223
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
6224
6225
6226
6227


    Tab._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
Mark Otto's avatar
dist    
Mark Otto committed
6228
        var $this = $$$1(this);
Mark Otto's avatar
dist  
Mark Otto committed
6229
6230
6231
6232
6233
6234
6235
6236
6237
        var data = $this.data(DATA_KEY);

        if (!data) {
          data = new Tab(this);
          $this.data(DATA_KEY, data);
        }

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

Mark Otto's avatar
dist  
Mark Otto committed
6241
6242
6243
6244
6245
          data[config]();
        }
      });
    };

Mark Otto's avatar
Mark Otto committed
6246
    _createClass(Tab, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
6247
      key: "VERSION",
Mark Otto's avatar
dist  
Mark Otto committed
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
      get: function get() {
        return VERSION;
      }
    }]);
    return Tab;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
6260

Mark Otto's avatar
dist    
Mark Otto committed
6261
  $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
Mark Otto's avatar
dist  
Mark Otto committed
6262
    event.preventDefault();
Mark Otto's avatar
dist    
Mark Otto committed
6263

Mark Otto's avatar
dist    
Mark Otto committed
6264
    Tab._jQueryInterface.call($$$1(this), 'show');
Mark Otto's avatar
dist  
Mark Otto committed
6265
6266
6267
6268
6269
6270
6271
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

Mark Otto's avatar
dist    
Mark Otto committed
6272
6273
  $$$1.fn[NAME] = Tab._jQueryInterface;
  $$$1.fn[NAME].Constructor = Tab;
Mark Otto's avatar
dist    
Mark Otto committed
6274

Mark Otto's avatar
dist    
Mark Otto committed
6275
6276
  $$$1.fn[NAME].noConflict = function () {
    $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
Mark Otto's avatar
dist  
Mark Otto committed
6277
6278
6279
6280
    return Tab._jQueryInterface;
  };

  return Tab;
Mark Otto's avatar
dist    
Mark Otto committed
6281
}($);
Mark Otto's avatar
dist  
Mark Otto committed
6282
6283
6284
6285
6286
6287
6288
6289

/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.0.0-alpha.6): index.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

Mark Otto's avatar
dist    
Mark Otto committed
6290
6291
(function ($$$1) {
  if (typeof $$$1 === 'undefined') {
Mark Otto's avatar
dist    
Mark Otto committed
6292
    throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
Mark Otto's avatar
dist  
Mark Otto committed
6293
6294
  }

Mark Otto's avatar
dist    
Mark Otto committed
6295
  var version = $$$1.fn.jquery.split(' ')[0].split('.');
Mark Otto's avatar
dist    
Mark Otto committed
6296
6297
6298
6299
6300
6301
6302
6303
  var minMajor = 1;
  var ltMajor = 2;
  var minMinor = 9;
  var minPatch = 1;
  var maxMajor = 4;

  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');
Mark Otto's avatar
dist  
Mark Otto committed
6304
  }
Mark Otto's avatar
dist    
Mark Otto committed
6305
})($);
Mark Otto's avatar
dist  
Mark Otto committed
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318

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;

Mark Otto's avatar
dist    
Mark Otto committed
6319
Object.defineProperty(exports, '__esModule', { value: true });
Mark Otto's avatar
dist  
Mark Otto committed
6320

Mark Otto's avatar
dist    
Mark Otto committed
6321
})));
Mark Otto's avatar
dist    
Mark Otto committed
6322
//# sourceMappingURL=bootstrap.bundle.js.map