bootstrap.esm.js 144 KB
Newer Older
XhmikosR's avatar
Dist.  
XhmikosR committed
1
2
3
4
5
6
7
/*!
  * Bootstrap v4.3.1 (https://getbootstrap.com/)
  * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  */
import Popper from 'popper.js';

XhmikosR's avatar
XhmikosR committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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;
}

function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);

  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly) symbols = symbols.filter(function (sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    });
    keys.push.apply(keys, symbols);
  }

  return keys;
}

function _objectSpread2(target) {
XhmikosR's avatar
XhmikosR committed
54
55
56
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};

57
58
59
60
61
62
63
64
65
66
    if (i % 2) {
      ownKeys(source, true).forEach(function (key) {
        _defineProperty(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys(source).forEach(function (key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
XhmikosR's avatar
XhmikosR committed
67
68
69
70
71
72
73
74
75
76
77
78
    }
  }

  return target;
}

function _inheritsLoose(subClass, superClass) {
  subClass.prototype = Object.create(superClass.prototype);
  subClass.prototype.constructor = subClass;
  subClass.__proto__ = superClass;
}

XhmikosR's avatar
Dist.  
XhmikosR committed
79
80
81
82
83
84
/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): util/index.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
XhmikosR's avatar
XhmikosR committed
85
86
var MAX_UID = 1000000;
var MILLISECONDS_MULTIPLIER = 1000;
XhmikosR's avatar
XhmikosR committed
87
var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
XhmikosR's avatar
XhmikosR committed
88
89
90
91

var toType = function toType(obj) {
  return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
};
XhmikosR's avatar
Dist.  
XhmikosR committed
92
93
94
95
96
97
98
/**
 * --------------------------------------------------------------------------
 * Public Util Api
 * --------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
99
var getUID = function getUID(prefix) {
XhmikosR's avatar
Dist.  
XhmikosR committed
100
101
102
103
104
105
106
107
  do {
    // eslint-disable-next-line no-bitwise
    prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  } while (document.getElementById(prefix));

  return prefix;
};

XhmikosR's avatar
XhmikosR committed
108
var getSelector = function getSelector(element) {
XhmikosR's avatar
XhmikosR committed
109
  var selector = element.getAttribute('data-target');
XhmikosR's avatar
Dist.  
XhmikosR committed
110
111

  if (!selector || selector === '#') {
XhmikosR's avatar
XhmikosR committed
112
    var hrefAttr = element.getAttribute('href');
XhmikosR's avatar
XhmikosR committed
113
    selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
114
115
  }

XhmikosR's avatar
XhmikosR committed
116
117
118
119
120
121
122
  return selector;
};

var getSelectorFromElement = function getSelectorFromElement(element) {
  var selector = getSelector(element);

  if (selector) {
XhmikosR's avatar
Dist.  
XhmikosR committed
123
124
    return document.querySelector(selector) ? selector : null;
  }
XhmikosR's avatar
XhmikosR committed
125
126
127
128
129
130
131

  return null;
};

var getElementFromSelector = function getElementFromSelector(element) {
  var selector = getSelector(element);
  return selector ? document.querySelector(selector) : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
132
133
};

XhmikosR's avatar
XhmikosR committed
134
var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
135
136
137
138
139
  if (!element) {
    return 0;
  } // Get transition-duration of the element


XhmikosR's avatar
XhmikosR committed
140
  var _window$getComputedSt = window.getComputedStyle(element),
XhmikosR's avatar
Dist.  
XhmikosR committed
141
142
143
      transitionDuration = _window$getComputedSt.transitionDuration,
      transitionDelay = _window$getComputedSt.transitionDelay;

XhmikosR's avatar
XhmikosR committed
144
145
  var floatTransitionDuration = parseFloat(transitionDuration);
  var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
XhmikosR's avatar
Dist.  
XhmikosR committed
146
147
148
149
150
151
152
153
154
155
156

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


  transitionDuration = transitionDuration.split(',')[0];
  transitionDelay = transitionDelay.split(',')[0];
  return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
};

XhmikosR's avatar
XhmikosR committed
157
158
159
160
var triggerTransitionEnd = function triggerTransitionEnd(element) {
  var evt = document.createEvent('HTMLEvents');
  evt.initEvent(TRANSITION_END, true, true);
  element.dispatchEvent(evt);
XhmikosR's avatar
Dist.  
XhmikosR committed
161
162
};

XhmikosR's avatar
XhmikosR committed
163
164
165
var isElement = function isElement(obj) {
  return (obj[0] || obj).nodeType;
};
XhmikosR's avatar
Dist.  
XhmikosR committed
166

XhmikosR's avatar
XhmikosR committed
167
168
169
170
var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
  var called = false;
  var durationPadding = 5;
  var emulatedDuration = duration + durationPadding;
XhmikosR's avatar
Dist.  
XhmikosR committed
171
172
173
174
175
176
177

  function listener() {
    called = true;
    element.removeEventListener(TRANSITION_END, listener);
  }

  element.addEventListener(TRANSITION_END, listener);
XhmikosR's avatar
XhmikosR committed
178
  setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
179
180
181
182
183
184
    if (!called) {
      triggerTransitionEnd(element);
    }
  }, emulatedDuration);
};

XhmikosR's avatar
XhmikosR committed
185
186
187
188
189
var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
  Object.keys(configTypes).forEach(function (property) {
    var expectedTypes = configTypes[property];
    var value = config[property];
    var valueType = value && isElement(value) ? 'element' : toType(value);
XhmikosR's avatar
Dist.  
XhmikosR committed
190
191

    if (!new RegExp(expectedTypes).test(valueType)) {
XhmikosR's avatar
XhmikosR committed
192
      throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
XhmikosR's avatar
Dist.  
XhmikosR committed
193
194
195
196
    }
  });
};

XhmikosR's avatar
XhmikosR committed
197
var makeArray = function makeArray(nodeList) {
XhmikosR's avatar
Dist.  
XhmikosR committed
198
199
200
201
202
203
204
  if (!nodeList) {
    return [];
  }

  return [].slice.call(nodeList);
};

XhmikosR's avatar
XhmikosR committed
205
var isVisible = function isVisible(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
206
207
208
209
210
211
212
213
214
215
216
  if (!element) {
    return false;
  }

  if (element.style && element.parentNode && element.parentNode.style) {
    return element.style.display !== 'none' && element.parentNode.style.display !== 'none' && element.style.visibility !== 'hidden';
  }

  return false;
};

XhmikosR's avatar
XhmikosR committed
217
var findShadowRoot = function findShadowRoot(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
218
219
220
221
222
223
  if (!document.documentElement.attachShadow) {
    return null;
  } // Can find the shadow root otherwise it'll return the document


  if (typeof element.getRootNode === 'function') {
XhmikosR's avatar
XhmikosR committed
224
    var root = element.getRootNode();
XhmikosR's avatar
Dist.  
XhmikosR committed
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
    return root instanceof ShadowRoot ? root : null;
  }

  if (element instanceof ShadowRoot) {
    return element;
  } // when we don't find a shadow root


  if (!element.parentNode) {
    return null;
  }

  return findShadowRoot(element.parentNode);
}; // eslint-disable-next-line no-empty-function


XhmikosR's avatar
XhmikosR committed
241
242
243
var noop = function noop() {
  return function () {};
};
XhmikosR's avatar
Dist.  
XhmikosR committed
244

XhmikosR's avatar
XhmikosR committed
245
246
247
var reflow = function reflow(element) {
  return element.offsetHeight;
};
XhmikosR's avatar
Dist.  
XhmikosR committed
248

XhmikosR's avatar
XhmikosR committed
249
250
251
252
253
254
255
256
257
258
259
var getjQuery = function getjQuery() {
  var _window = window,
      jQuery = _window.jQuery;

  if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
    return jQuery;
  }

  return null;
};

XhmikosR's avatar
Dist.  
XhmikosR committed
260
261
262
263
264
265
266
267
268
269
270
271
/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): dom/data.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
XhmikosR committed
272
273
274
var mapData = function () {
  var storeData = {};
  var id = 1;
XhmikosR's avatar
Dist.  
XhmikosR committed
275
  return {
XhmikosR's avatar
XhmikosR committed
276
    set: function set(element, key, data) {
XhmikosR's avatar
Dist.  
XhmikosR committed
277
278
      if (typeof element.key === 'undefined') {
        element.key = {
XhmikosR's avatar
XhmikosR committed
279
280
          key: key,
          id: id
XhmikosR's avatar
Dist.  
XhmikosR committed
281
282
283
284
285
286
        };
        id++;
      }

      storeData[element.key.id] = data;
    },
XhmikosR's avatar
XhmikosR committed
287
    get: function get(element, key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
288
289
290
291
      if (!element || typeof element.key === 'undefined') {
        return null;
      }

XhmikosR's avatar
XhmikosR committed
292
      var keyProperties = element.key;
XhmikosR's avatar
Dist.  
XhmikosR committed
293
294
295
296
297
298
299

      if (keyProperties.key === key) {
        return storeData[keyProperties.id];
      }

      return null;
    },
XhmikosR's avatar
XhmikosR committed
300
    delete: function _delete(element, key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
301
302
303
304
      if (typeof element.key === 'undefined') {
        return;
      }

XhmikosR's avatar
XhmikosR committed
305
      var keyProperties = element.key;
XhmikosR's avatar
Dist.  
XhmikosR committed
306
307
308
309
310
311
312

      if (keyProperties.key === key) {
        delete storeData[keyProperties.id];
        delete element.key;
      }
    }
  };
XhmikosR's avatar
XhmikosR committed
313
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
314

XhmikosR's avatar
XhmikosR committed
315
316
var Data = {
  setData: function setData(instance, key, data) {
XhmikosR's avatar
Dist.  
XhmikosR committed
317
318
    mapData.set(instance, key, data);
  },
XhmikosR's avatar
XhmikosR committed
319
  getData: function getData(instance, key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
320
321
    return mapData.get(instance, key);
  },
XhmikosR's avatar
XhmikosR committed
322
  removeData: function removeData(instance, key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
323
324
    mapData.delete(instance, key);
  }
XhmikosR's avatar
XhmikosR committed
325
};
XhmikosR's avatar
Dist.  
XhmikosR committed
326

XhmikosR's avatar
XhmikosR committed
327
328
329
330
331
332
333
334
335
336
/* istanbul ignore file */
var _Element$prototype = Element.prototype,
    matches = _Element$prototype.matches,
    closest = _Element$prototype.closest;
var find = Element.prototype.querySelectorAll;
var findOne = Element.prototype.querySelector;

var createCustomEvent = function createCustomEvent(eventName, params) {
  var cEvent = new CustomEvent(eventName, params);
  return cEvent;
XhmikosR's avatar
Dist.  
XhmikosR committed
337
338
};

XhmikosR's avatar
XhmikosR committed
339
340
341
342
343
344
345
346
347
348
349
350
if (typeof window.CustomEvent !== 'function') {
  createCustomEvent = function createCustomEvent(eventName, params) {
    params = params || {
      bubbles: false,
      cancelable: false,
      detail: null
    };
    var evt = document.createEvent('CustomEvent');
    evt.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail);
    return evt;
  };
}
XhmikosR's avatar
Dist.  
XhmikosR committed
351

XhmikosR's avatar
XhmikosR committed
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
var workingDefaultPrevented = function () {
  var e = document.createEvent('CustomEvent');
  e.initEvent('Bootstrap', true, true);
  e.preventDefault();
  return e.defaultPrevented;
}();

if (!workingDefaultPrevented) {
  var origPreventDefault = Event.prototype.preventDefault;

  Event.prototype.preventDefault = function () {
    if (!this.cancelable) {
      return;
    }

    origPreventDefault.call(this);
    Object.defineProperty(this, 'defaultPrevented', {
      get: function get() {
        return true;
      },
      configurable: true
XhmikosR's avatar
Dist.  
XhmikosR committed
373
    });
XhmikosR's avatar
XhmikosR committed
374
375
  };
} // MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached
XhmikosR's avatar
Dist.  
XhmikosR committed
376
377


XhmikosR's avatar
XhmikosR committed
378
379
380
381
382
383
384
385
386
387
388
389
var defaultPreventedPreservedOnDispatch = function () {
  var e = createCustomEvent('Bootstrap', {
    cancelable: true
  });
  var element = document.createElement('div');
  element.addEventListener('Bootstrap', function () {
    return null;
  });
  e.preventDefault();
  element.dispatchEvent(e);
  return e.defaultPrevented;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
390

XhmikosR's avatar
XhmikosR committed
391
392
393
if (!matches) {
  matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}
XhmikosR's avatar
Dist.  
XhmikosR committed
394

XhmikosR's avatar
XhmikosR committed
395
396
397
if (!closest) {
  closest = function closest(selector) {
    var element = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
398

XhmikosR's avatar
XhmikosR committed
399
400
401
    do {
      if (matches.call(element, selector)) {
        return element;
XhmikosR's avatar
Dist.  
XhmikosR committed
402
403
      }

XhmikosR's avatar
XhmikosR committed
404
405
      element = element.parentElement || element.parentNode;
    } while (element !== null && element.nodeType === 1);
XhmikosR's avatar
Dist.  
XhmikosR committed
406

XhmikosR's avatar
XhmikosR committed
407
408
409
    return null;
  };
}
XhmikosR's avatar
Dist.  
XhmikosR committed
410

XhmikosR's avatar
XhmikosR committed
411
var scopeSelectorRegex = /:scope\b/;
XhmikosR's avatar
Dist.  
XhmikosR committed
412

XhmikosR's avatar
XhmikosR committed
413
414
var supportScopeQuery = function () {
  var element = document.createElement('div');
XhmikosR's avatar
Dist.  
XhmikosR committed
415

XhmikosR's avatar
XhmikosR committed
416
417
418
419
420
  try {
    element.querySelectorAll(':scope *');
  } catch (error) {
    return false;
  }
XhmikosR's avatar
Dist.  
XhmikosR committed
421

XhmikosR's avatar
XhmikosR committed
422
423
424
425
426
427
428
429
430
431
  return true;
}();

if (!supportScopeQuery) {
  find = function find(selector) {
    if (!scopeSelectorRegex.test(selector)) {
      return this.querySelectorAll(selector);
    }

    var hasId = Boolean(this.id);
XhmikosR's avatar
Dist.  
XhmikosR committed
432

XhmikosR's avatar
XhmikosR committed
433
434
435
436
437
    if (!hasId) {
      this.id = getUID('scope');
    }

    var nodeList = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
438

XhmikosR's avatar
XhmikosR committed
439
440
441
442
443
444
    try {
      selector = selector.replace(scopeSelectorRegex, "#" + this.id);
      nodeList = this.querySelectorAll(selector);
    } finally {
      if (!hasId) {
        this.removeAttribute('id');
XhmikosR's avatar
Dist.  
XhmikosR committed
445
      }
XhmikosR's avatar
XhmikosR committed
446
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
447

XhmikosR's avatar
XhmikosR committed
448
449
    return nodeList;
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
450

XhmikosR's avatar
XhmikosR committed
451
452
453
454
455
456
457
458
459
460
461
462
  findOne = function findOne(selector) {
    if (!scopeSelectorRegex.test(selector)) {
      return this.querySelector(selector);
    }

    var matches = find.call(this, selector);

    if (typeof matches[0] !== 'undefined') {
      return matches[0];
    }

    return null;
XhmikosR's avatar
Dist.  
XhmikosR committed
463
  };
XhmikosR's avatar
XhmikosR committed
464
}
XhmikosR's avatar
Dist.  
XhmikosR committed
465
466
467

/**
 * --------------------------------------------------------------------------
468
 * Bootstrap (v4.3.1): dom/event-handler.js
XhmikosR's avatar
Dist.  
XhmikosR committed
469
470
471
472
473
474
475
476
477
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
478
var $ = getjQuery();
XhmikosR's avatar
XhmikosR committed
479
480
481
482
483
var namespaceRegex = /[^.]*(?=\..*)\.|.*/;
var stripNameRegex = /\..*/;
var keyEventRegex = /^key/;
var stripUidRegex = /::\d+$/;
var eventRegistry = {}; // Events storage
XhmikosR's avatar
Dist.  
XhmikosR committed
484

XhmikosR's avatar
XhmikosR committed
485
486
var uidEvent = 1;
var customEvents = {
XhmikosR's avatar
Dist.  
XhmikosR committed
487
488
489
  mouseenter: 'mouseover',
  mouseleave: 'mouseout'
};
XhmikosR's avatar
XhmikosR committed
490
var nativeEvents = ['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll'];
XhmikosR's avatar
Dist.  
XhmikosR committed
491
492
493
494
495
496
497
/**
 * ------------------------------------------------------------------------
 * Private methods
 * ------------------------------------------------------------------------
 */

function getUidEvent(element, uid) {
XhmikosR's avatar
XhmikosR committed
498
  return uid && uid + "::" + uidEvent++ || element.uidEvent || uidEvent++;
XhmikosR's avatar
Dist.  
XhmikosR committed
499
500
501
}

function getEvent(element) {
XhmikosR's avatar
XhmikosR committed
502
  var uid = getUidEvent(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
  element.uidEvent = uid;
  eventRegistry[uid] = eventRegistry[uid] || {};
  return eventRegistry[uid];
}

function fixEvent(event, element) {
  // Add which for key events
  if (event.which === null && keyEventRegex.test(event.type)) {
    event.which = event.charCode === null ? event.keyCode : event.charCode;
  }

  event.delegateTarget = element;
}

function bootstrapHandler(element, fn) {
  return function handler(event) {
    fixEvent(event, element);

    if (handler.oneOff) {
      EventHandler.off(element, event.type, fn);
    }

    return fn.apply(element, [event]);
  };
}

function bootstrapDelegationHandler(element, selector, fn) {
  return function handler(event) {
XhmikosR's avatar
XhmikosR committed
531
    var domElements = element.querySelectorAll(selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
532

XhmikosR's avatar
XhmikosR committed
533
534
    for (var target = event.target; target && target !== this; target = target.parentNode) {
      for (var i = domElements.length; i--;) {
XhmikosR's avatar
Dist.  
XhmikosR committed
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
        if (domElements[i] === target) {
          fixEvent(event, target);

          if (handler.oneOff) {
            EventHandler.off(element, event.type, fn);
          }

          return fn.apply(target, [event]);
        }
      }
    } // To please ESLint


    return null;
  };
}

function findHandler(events, handler, delegationSelector) {
  if (delegationSelector === void 0) {
    delegationSelector = null;
  }

Mark Otto's avatar
dist v5    
Mark Otto committed
557
558
559
560
  var uidEventList = Object.keys(events);

  for (var i = 0, len = uidEventList.length; i < len; i++) {
    var event = events[uidEventList[i]];
XhmikosR's avatar
Dist.  
XhmikosR committed
561
562

    if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
Mark Otto's avatar
dist v5    
Mark Otto committed
563
      return event;
XhmikosR's avatar
Dist.  
XhmikosR committed
564
565
566
567
568
569
570
    }
  }

  return null;
}

function normalizeParams(originalTypeEvent, handler, delegationFn) {
XhmikosR's avatar
XhmikosR committed
571
572
  var delegation = typeof handler === 'string';
  var originalHandler = delegation ? delegationFn : handler; // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
XhmikosR's avatar
Dist.  
XhmikosR committed
573

XhmikosR's avatar
XhmikosR committed
574
575
  var typeEvent = originalTypeEvent.replace(stripNameRegex, '');
  var custom = customEvents[typeEvent];
XhmikosR's avatar
Dist.  
XhmikosR committed
576
577
578
579
580

  if (custom) {
    typeEvent = custom;
  }

XhmikosR's avatar
XhmikosR committed
581
  var isNative = nativeEvents.indexOf(typeEvent) > -1;
XhmikosR's avatar
Dist.  
XhmikosR committed
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599

  if (!isNative) {
    typeEvent = originalTypeEvent;
  }

  return [delegation, originalHandler, typeEvent];
}

function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
  if (typeof originalTypeEvent !== 'string' || !element) {
    return;
  }

  if (!handler) {
    handler = delegationFn;
    delegationFn = null;
  }

XhmikosR's avatar
XhmikosR committed
600
601
602
603
  var _normalizeParams = normalizeParams(originalTypeEvent, handler, delegationFn),
      delegation = _normalizeParams[0],
      originalHandler = _normalizeParams[1],
      typeEvent = _normalizeParams[2];
XhmikosR's avatar
Dist.  
XhmikosR committed
604

XhmikosR's avatar
XhmikosR committed
605
606
607
  var events = getEvent(element);
  var handlers = events[typeEvent] || (events[typeEvent] = {});
  var previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
XhmikosR's avatar
Dist.  
XhmikosR committed
608
609
610
611
612
613

  if (previousFn) {
    previousFn.oneOff = previousFn.oneOff && oneOff;
    return;
  }

XhmikosR's avatar
XhmikosR committed
614
615
  var uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
  var fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
XhmikosR's avatar
Dist.  
XhmikosR committed
616
617
618
619
620
621
622
623
624
  fn.delegationSelector = delegation ? handler : null;
  fn.originalHandler = originalHandler;
  fn.oneOff = oneOff;
  fn.uidEvent = uid;
  handlers[uid] = fn;
  element.addEventListener(typeEvent, fn, delegation);
}

function removeHandler(element, events, typeEvent, handler, delegationSelector) {
XhmikosR's avatar
XhmikosR committed
625
  var fn = findHandler(events[typeEvent], handler, delegationSelector);
XhmikosR's avatar
Dist.  
XhmikosR committed
626

Mark Otto's avatar
dist v5    
Mark Otto committed
627
  if (!fn) {
XhmikosR's avatar
Dist.  
XhmikosR committed
628
629
630
631
632
633
634
635
    return;
  }

  element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
  delete events[typeEvent][fn.uidEvent];
}

function removeNamespacedHandlers(element, events, typeEvent, namespace) {
XhmikosR's avatar
XhmikosR committed
636
637
  var storeElementEvent = events[typeEvent] || {};
  Object.keys(storeElementEvent).forEach(function (handlerKey) {
XhmikosR's avatar
Dist.  
XhmikosR committed
638
    if (handlerKey.indexOf(namespace) > -1) {
XhmikosR's avatar
XhmikosR committed
639
      var event = storeElementEvent[handlerKey];
XhmikosR's avatar
Dist.  
XhmikosR committed
640
641
642
643
644
      removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
    }
  });
}

XhmikosR's avatar
XhmikosR committed
645
646
var EventHandler = {
  on: function on(element, event, handler, delegationFn) {
XhmikosR's avatar
Dist.  
XhmikosR committed
647
648
    addHandler(element, event, handler, delegationFn, false);
  },
XhmikosR's avatar
XhmikosR committed
649
  one: function one(element, event, handler, delegationFn) {
XhmikosR's avatar
Dist.  
XhmikosR committed
650
651
    addHandler(element, event, handler, delegationFn, true);
  },
XhmikosR's avatar
XhmikosR committed
652
  off: function off(element, originalTypeEvent, handler, delegationFn) {
XhmikosR's avatar
Dist.  
XhmikosR committed
653
654
655
656
    if (typeof originalTypeEvent !== 'string' || !element) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
657
658
659
660
    var _normalizeParams2 = normalizeParams(originalTypeEvent, handler, delegationFn),
        delegation = _normalizeParams2[0],
        originalHandler = _normalizeParams2[1],
        typeEvent = _normalizeParams2[2];
XhmikosR's avatar
Dist.  
XhmikosR committed
661

XhmikosR's avatar
XhmikosR committed
662
663
664
    var inNamespace = typeEvent !== originalTypeEvent;
    var events = getEvent(element);
    var isNamespace = originalTypeEvent.charAt(0) === '.';
XhmikosR's avatar
Dist.  
XhmikosR committed
665
666
667
668
669
670
671
672
673
674
675
676

    if (typeof originalHandler !== 'undefined') {
      // Simplest case: handler is passed, remove that listener ONLY.
      if (!events || !events[typeEvent]) {
        return;
      }

      removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
      return;
    }

    if (isNamespace) {
XhmikosR's avatar
XhmikosR committed
677
      Object.keys(events).forEach(function (elementEvent) {
XhmikosR's avatar
Dist.  
XhmikosR committed
678
679
680
681
        removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.substr(1));
      });
    }

XhmikosR's avatar
XhmikosR committed
682
683
684
    var storeElementEvent = events[typeEvent] || {};
    Object.keys(storeElementEvent).forEach(function (keyHandlers) {
      var handlerKey = keyHandlers.replace(stripUidRegex, '');
XhmikosR's avatar
Dist.  
XhmikosR committed
685
686

      if (!inNamespace || originalTypeEvent.indexOf(handlerKey) > -1) {
XhmikosR's avatar
XhmikosR committed
687
        var event = storeElementEvent[keyHandlers];
XhmikosR's avatar
Dist.  
XhmikosR committed
688
689
690
691
        removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
      }
    });
  },
XhmikosR's avatar
XhmikosR committed
692
  trigger: function trigger(element, event, args) {
XhmikosR's avatar
Dist.  
XhmikosR committed
693
694
695
696
    if (typeof event !== 'string' || !element) {
      return null;
    }

XhmikosR's avatar
XhmikosR committed
697
698
699
700
701
702
703
704
    var typeEvent = event.replace(stripNameRegex, '');
    var inNamespace = event !== typeEvent;
    var isNative = nativeEvents.indexOf(typeEvent) > -1;
    var jQueryEvent;
    var bubbles = true;
    var nativeDispatch = true;
    var defaultPrevented = false;
    var evt = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
705

XhmikosR's avatar
XhmikosR committed
706
707
708
    if (inNamespace && $) {
      jQueryEvent = $.Event(event, args);
      $(element).trigger(jQueryEvent);
XhmikosR's avatar
Dist.  
XhmikosR committed
709
710
711
712
713
714
715
716
717
      bubbles = !jQueryEvent.isPropagationStopped();
      nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
      defaultPrevented = jQueryEvent.isDefaultPrevented();
    }

    if (isNative) {
      evt = document.createEvent('HTMLEvents');
      evt.initEvent(typeEvent, bubbles, true);
    } else {
XhmikosR's avatar
XhmikosR committed
718
719
      evt = createCustomEvent(event, {
        bubbles: bubbles,
XhmikosR's avatar
Dist.  
XhmikosR committed
720
721
722
723
724
725
        cancelable: true
      });
    } // merge custom informations in our event


    if (typeof args !== 'undefined') {
XhmikosR's avatar
XhmikosR committed
726
      Object.keys(args).forEach(function (key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
727
        Object.defineProperty(evt, key, {
XhmikosR's avatar
XhmikosR committed
728
          get: function get() {
XhmikosR's avatar
Dist.  
XhmikosR committed
729
730
731
732
733
734
735
736
737
            return args[key];
          }
        });
      });
    }

    if (defaultPrevented) {
      evt.preventDefault();

XhmikosR's avatar
XhmikosR committed
738
      if (!defaultPreventedPreservedOnDispatch) {
XhmikosR's avatar
Dist.  
XhmikosR committed
739
        Object.defineProperty(evt, 'defaultPrevented', {
XhmikosR's avatar
XhmikosR committed
740
741
742
          get: function get() {
            return true;
          }
XhmikosR's avatar
Dist.  
XhmikosR committed
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
        });
      }
    }

    if (nativeDispatch) {
      element.dispatchEvent(evt);
    }

    if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
      jQueryEvent.preventDefault();
    }

    return evt;
  }
};

/**
 * --------------------------------------------------------------------------
761
 * Bootstrap (v4.3.1): dom/selector-engine.js
XhmikosR's avatar
Dist.  
XhmikosR committed
762
763
764
765
766
767
768
769
770
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
771
772
773
774
var NODE_TEXT = 3;
var SelectorEngine = {
  matches: function matches$1(element, selector) {
    return matches.call(element, selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
775
  },
XhmikosR's avatar
XhmikosR committed
776
  find: function find$1(selector, element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
777
778
779
780
    if (element === void 0) {
      element = document.documentElement;
    }

XhmikosR's avatar
XhmikosR committed
781
    return find.call(element, selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
782
  },
XhmikosR's avatar
XhmikosR committed
783
  findOne: function findOne$1(selector, element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
784
785
786
787
788
789
    if (element === void 0) {
      element = document.documentElement;
    }

    return findOne.call(element, selector);
  },
XhmikosR's avatar
XhmikosR committed
790
791
  children: function children(element, selector) {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
792

XhmikosR's avatar
XhmikosR committed
793
794
795
796
    var children = makeArray(element.children);
    return children.filter(function (child) {
      return _this.matches(child, selector);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
797
  },
XhmikosR's avatar
XhmikosR committed
798
799
800
  parents: function parents(element, selector) {
    var parents = [];
    var ancestor = element.parentNode;
XhmikosR's avatar
Dist.  
XhmikosR committed
801
802
803
804
805
806
807
808
809
810
811

    while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
      if (this.matches(ancestor, selector)) {
        parents.push(ancestor);
      }

      ancestor = ancestor.parentNode;
    }

    return parents;
  },
XhmikosR's avatar
XhmikosR committed
812
813
  closest: function closest$1(element, selector) {
    return closest.call(element, selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
814
  },
XhmikosR's avatar
XhmikosR committed
815
816
817
  prev: function prev(element, selector) {
    var siblings = [];
    var previous = element.previousSibling;
XhmikosR's avatar
Dist.  
XhmikosR committed
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836

    while (previous && previous.nodeType === Node.ELEMENT_NODE && previous.nodeType !== NODE_TEXT) {
      if (this.matches(previous, selector)) {
        siblings.push(previous);
      }

      previous = previous.previousSibling;
    }

    return siblings;
  }
};

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
837
838
839
840
841
842
var NAME = 'alert';
var VERSION = '4.3.1';
var DATA_KEY = 'bs.alert';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var Selector = {
XhmikosR's avatar
Dist.  
XhmikosR committed
843
844
  DISMISS: '[data-dismiss="alert"]'
};
XhmikosR's avatar
XhmikosR committed
845
846
847
848
var Event$1 = {
  CLOSE: "close" + EVENT_KEY,
  CLOSED: "closed" + EVENT_KEY,
  CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
XhmikosR's avatar
Dist.  
XhmikosR committed
849
};
XhmikosR's avatar
XhmikosR committed
850
var ClassName = {
XhmikosR's avatar
Dist.  
XhmikosR committed
851
852
853
854
855
856
857
858
859
860
861
  ALERT: 'alert',
  FADE: 'fade',
  SHOW: 'show'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
862
863
864
865
var Alert =
/*#__PURE__*/
function () {
  function Alert(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
866
867
868
869
870
871
872
873
    this._element = element;

    if (this._element) {
      Data.setData(element, DATA_KEY, this);
    }
  } // Getters


XhmikosR's avatar
XhmikosR committed
874
  var _proto = Alert.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
875

XhmikosR's avatar
XhmikosR committed
876
877
878
  // Public
  _proto.close = function close(element) {
    var rootElement = this._element;
XhmikosR's avatar
Dist.  
XhmikosR committed
879
880
881
882
883

    if (element) {
      rootElement = this._getRootElement(element);
    }

XhmikosR's avatar
XhmikosR committed
884
    var customEvent = this._triggerCloseEvent(rootElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
885
886
887
888
889
890

    if (customEvent === null || customEvent.defaultPrevented) {
      return;
    }

    this._removeElement(rootElement);
XhmikosR's avatar
XhmikosR committed
891
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
892

XhmikosR's avatar
XhmikosR committed
893
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
894
895
896
    Data.removeData(this._element, DATA_KEY);
    this._element = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
897
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
898

XhmikosR's avatar
XhmikosR committed
899
  _proto._getRootElement = function _getRootElement(element) {
XhmikosR's avatar
XhmikosR committed
900
    var parent = getElementFromSelector(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
901
902

    if (!parent) {
XhmikosR's avatar
XhmikosR committed
903
      parent = SelectorEngine.closest(element, "." + ClassName.ALERT);
XhmikosR's avatar
Dist.  
XhmikosR committed
904
905
906
    }

    return parent;
XhmikosR's avatar
XhmikosR committed
907
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
908

XhmikosR's avatar
XhmikosR committed
909
  _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
910
    return EventHandler.trigger(element, Event$1.CLOSE);
XhmikosR's avatar
XhmikosR committed
911
912
913
914
  };

  _proto._removeElement = function _removeElement(element) {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
915
916
917
918
919
920
921
922
923

    element.classList.remove(ClassName.SHOW);

    if (!element.classList.contains(ClassName.FADE)) {
      this._destroyElement(element);

      return;
    }

XhmikosR's avatar
XhmikosR committed
924
    var transitionDuration = getTransitionDurationFromElement(element);
925
926
    EventHandler.one(element, TRANSITION_END, function () {
      return _this._destroyElement(element);
XhmikosR's avatar
XhmikosR committed
927
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
928
    emulateTransitionEnd(element, transitionDuration);
XhmikosR's avatar
XhmikosR committed
929
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
930

XhmikosR's avatar
XhmikosR committed
931
  _proto._destroyElement = function _destroyElement(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
932
933
934
935
936
937
    if (element.parentNode) {
      element.parentNode.removeChild(element);
    }

    EventHandler.trigger(element, Event$1.CLOSED);
  } // Static
XhmikosR's avatar
XhmikosR committed
938
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
939

XhmikosR's avatar
XhmikosR committed
940
  Alert.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
941
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
942
      var data = Data.getData(this, DATA_KEY);
XhmikosR's avatar
Dist.  
XhmikosR committed
943
944
945
946
947
948
949
950
951

      if (!data) {
        data = new Alert(this);
      }

      if (config === 'close') {
        data[config](this);
      }
    });
XhmikosR's avatar
XhmikosR committed
952
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
953

XhmikosR's avatar
XhmikosR committed
954
  Alert.handleDismiss = function handleDismiss(alertInstance) {
XhmikosR's avatar
Dist.  
XhmikosR committed
955
956
957
958
959
960
961
    return function (event) {
      if (event) {
        event.preventDefault();
      }

      alertInstance.close(this);
    };
XhmikosR's avatar
XhmikosR committed
962
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
963

XhmikosR's avatar
XhmikosR committed
964
  Alert.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
965
    return Data.getData(element, DATA_KEY);
XhmikosR's avatar
XhmikosR committed
966
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
967

XhmikosR's avatar
XhmikosR committed
968
969
970
971
972
973
974
975
976
  _createClass(Alert, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION;
    }
  }]);

  return Alert;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
977
978
979
980
981
982
983
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
984
985
EventHandler.on(document, Event$1.CLICK_DATA_API, Selector.DISMISS, Alert.handleDismiss(new Alert()));
var $$1 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
986
987
988
989
990
991
992
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .alert to jQuery only if jQuery is present
 */

993
994
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
995
996
997
998
if ($$1) {
  var JQUERY_NO_CONFLICT = $$1.fn[NAME];
  $$1.fn[NAME] = Alert.jQueryInterface;
  $$1.fn[NAME].Constructor = Alert;
XhmikosR's avatar
Dist.  
XhmikosR committed
999

XhmikosR's avatar
XhmikosR committed
1000
1001
1002
  $$1.fn[NAME].noConflict = function () {
    $$1.fn[NAME] = JQUERY_NO_CONFLICT;
    return Alert.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
1003
1004
1005
1006
1007
1008
1009
1010
1011
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
1012
1013
1014
1015
1016
1017
var NAME$1 = 'button';
var VERSION$1 = '4.3.1';
var DATA_KEY$1 = 'bs.button';
var EVENT_KEY$1 = "." + DATA_KEY$1;
var DATA_API_KEY$1 = '.data-api';
var ClassName$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1018
1019
1020
1021
  ACTIVE: 'active',
  BUTTON: 'btn',
  FOCUS: 'focus'
};
XhmikosR's avatar
XhmikosR committed
1022
var Selector$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1023
1024
1025
1026
1027
1028
  DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  DATA_TOGGLE: '[data-toggle="buttons"]',
  INPUT: 'input:not([type="hidden"])',
  ACTIVE: '.active',
  BUTTON: '.btn'
};
XhmikosR's avatar
XhmikosR committed
1029
1030
1031
1032
var Event$2 = {
  CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
  FOCUS_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1,
  BLUR_DATA_API: "blur" + EVENT_KEY$1 + DATA_API_KEY$1
XhmikosR's avatar
Dist.  
XhmikosR committed
1033
1034
1035
1036
1037
1038
1039
1040
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
1041
1042
1043
1044
var Button =
/*#__PURE__*/
function () {
  function Button(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1045
1046
1047
1048
1049
    this._element = element;
    Data.setData(element, DATA_KEY$1, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
1050
  var _proto = Button.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
1051

XhmikosR's avatar
XhmikosR committed
1052
1053
1054
1055
1056
  // Public
  _proto.toggle = function toggle() {
    var triggerChangeEvent = true;
    var addAriaPressed = true;
    var rootElement = SelectorEngine.closest(this._element, Selector$1.DATA_TOGGLE);
XhmikosR's avatar
Dist.  
XhmikosR committed
1057
1058

    if (rootElement) {
XhmikosR's avatar
XhmikosR committed
1059
      var input = SelectorEngine.findOne(Selector$1.INPUT, this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
1060

XhmikosR's avatar
XhmikosR committed
1061
1062
1063
1064
1065
      if (input && input.type === 'radio') {
        if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
          triggerChangeEvent = false;
        } else {
          var activeElement = SelectorEngine.findOne(Selector$1.ACTIVE, rootElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1066

XhmikosR's avatar
XhmikosR committed
1067
1068
          if (activeElement) {
            activeElement.classList.remove(ClassName$1.ACTIVE);
XhmikosR's avatar
Dist.  
XhmikosR committed
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
          }
        }

        if (triggerChangeEvent) {
          if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
            return;
          }

          input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
          EventHandler.trigger(input, 'change');
        }

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

    if (addAriaPressed) {
      this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
    }

    if (triggerChangeEvent) {
      this._element.classList.toggle(ClassName$1.ACTIVE);
    }
XhmikosR's avatar
XhmikosR committed
1093
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1094

XhmikosR's avatar
XhmikosR committed
1095
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1096
1097
1098
    Data.removeData(this._element, DATA_KEY$1);
    this._element = null;
  } // Static
XhmikosR's avatar
XhmikosR committed
1099
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
1100

XhmikosR's avatar
XhmikosR committed
1101
  Button.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1102
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
1103
      var data = Data.getData(this, DATA_KEY$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
1104
1105
1106
1107
1108
1109
1110
1111
1112

      if (!data) {
        data = new Button(this);
      }

      if (config === 'toggle') {
        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
1113
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1114

XhmikosR's avatar
XhmikosR committed
1115
  Button.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1116
    return Data.getData(element, DATA_KEY$1);
XhmikosR's avatar
XhmikosR committed
1117
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1118

XhmikosR's avatar
XhmikosR committed
1119
1120
1121
1122
1123
1124
1125
1126
1127
  _createClass(Button, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$1;
    }
  }]);

  return Button;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
1128
1129
1130
1131
1132
1133
1134
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
1135
EventHandler.on(document, Event$2.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1136
  event.preventDefault();
XhmikosR's avatar
XhmikosR committed
1137
  var button = event.target;
XhmikosR's avatar
Dist.  
XhmikosR committed
1138
1139
1140
1141
1142

  if (!button.classList.contains(ClassName$1.BUTTON)) {
    button = SelectorEngine.closest(button, Selector$1.BUTTON);
  }

XhmikosR's avatar
XhmikosR committed
1143
  var data = Data.getData(button, DATA_KEY$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
1144
1145
1146
1147
1148
1149
1150

  if (!data) {
    data = new Button(button);
  }

  data.toggle();
});
XhmikosR's avatar
XhmikosR committed
1151
1152
1153
1154
1155
1156
EventHandler.on(document, Event$2.FOCUS_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  var button = SelectorEngine.closest(event.target, Selector$1.BUTTON);

  if (button) {
    button.classList.add(ClassName$1.FOCUS);
  }
XhmikosR's avatar
Dist.  
XhmikosR committed
1157
});
XhmikosR's avatar
XhmikosR committed
1158
1159
1160
1161
1162
1163
EventHandler.on(document, Event$2.BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  var button = SelectorEngine.closest(event.target, Selector$1.BUTTON);

  if (button) {
    button.classList.remove(ClassName$1.FOCUS);
  }
XhmikosR's avatar
Dist.  
XhmikosR committed
1164
});
XhmikosR's avatar
XhmikosR committed
1165
var $$2 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
1166
1167
1168
1169
1170
1171
1172
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .button to jQuery only if jQuery is present
 */

1173
1174
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
1175
1176
1177
1178
if ($$2) {
  var JQUERY_NO_CONFLICT$1 = $$2.fn[NAME$1];
  $$2.fn[NAME$1] = Button.jQueryInterface;
  $$2.fn[NAME$1].Constructor = Button;
XhmikosR's avatar
Dist.  
XhmikosR committed
1179

XhmikosR's avatar
XhmikosR committed
1180
1181
1182
  $$2.fn[NAME$1].noConflict = function () {
    $$2.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
    return Button.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
  };
}

/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): dom/manipulator.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
function normalizeData(val) {
  if (val === 'true') {
    return true;
  }

  if (val === 'false') {
    return false;
  }

  if (val === Number(val).toString()) {
    return Number(val);
  }

  if (val === '' || val === 'null') {
    return null;
  }

  return val;
}

function normalizeDataKey(key) {
XhmikosR's avatar
XhmikosR committed
1213
1214
1215
  return key.replace(/[A-Z]/g, function (chr) {
    return chr.toLowerCase();
  });
XhmikosR's avatar
Dist.  
XhmikosR committed
1216
1217
}

XhmikosR's avatar
XhmikosR committed
1218
1219
1220
var Manipulator = {
  setDataAttribute: function setDataAttribute(element, key, value) {
    element.setAttribute("data-" + normalizeDataKey(key), value);
XhmikosR's avatar
Dist.  
XhmikosR committed
1221
  },
XhmikosR's avatar
XhmikosR committed
1222
1223
  removeDataAttribute: function removeDataAttribute(element, key) {
    element.removeAttribute("data-" + normalizeDataKey(key));
XhmikosR's avatar
Dist.  
XhmikosR committed
1224
  },
XhmikosR's avatar
XhmikosR committed
1225
  getDataAttributes: function getDataAttributes(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1226
1227
1228
1229
    if (!element) {
      return {};
    }

1230
    var attributes = _objectSpread2({}, element.dataset);
XhmikosR's avatar
Dist.  
XhmikosR committed
1231

XhmikosR's avatar
XhmikosR committed
1232
    Object.keys(attributes).forEach(function (key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1233
1234
1235
1236
      attributes[key] = normalizeData(attributes[key]);
    });
    return attributes;
  },
XhmikosR's avatar
XhmikosR committed
1237
1238
  getDataAttribute: function getDataAttribute(element, key) {
    return normalizeData(element.getAttribute("data-" + normalizeDataKey(key)));
XhmikosR's avatar
Dist.  
XhmikosR committed
1239
  },
XhmikosR's avatar
XhmikosR committed
1240
1241
  offset: function offset(element) {
    var rect = element.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
1242
1243
1244
1245
1246
    return {
      top: rect.top + document.body.scrollTop,
      left: rect.left + document.body.scrollLeft
    };
  },
XhmikosR's avatar
XhmikosR committed
1247
  position: function position(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1248
1249
1250
1251
1252
    return {
      top: element.offsetTop,
      left: element.offsetLeft
    };
  },
XhmikosR's avatar
XhmikosR committed
1253
  toggleClass: function toggleClass(element, className) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
    if (!element) {
      return;
    }

    if (element.classList.contains(className)) {
      element.classList.remove(className);
    } else {
      element.classList.add(className);
    }
  }
};

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
1272
1273
1274
1275
1276
1277
var NAME$2 = 'carousel';
var VERSION$2 = '4.3.1';
var DATA_KEY$2 = 'bs.carousel';
var EVENT_KEY$2 = "." + DATA_KEY$2;
var DATA_API_KEY$2 = '.data-api';
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
XhmikosR's avatar
Dist.  
XhmikosR committed
1278

XhmikosR's avatar
XhmikosR committed
1279
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
XhmikosR's avatar
Dist.  
XhmikosR committed
1280

XhmikosR's avatar
XhmikosR committed
1281
var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
XhmikosR's avatar
Dist.  
XhmikosR committed
1282

XhmikosR's avatar
XhmikosR committed
1283
1284
var SWIPE_THRESHOLD = 40;
var Default = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1285
1286
1287
1288
1289
1290
1291
  interval: 5000,
  keyboard: true,
  slide: false,
  pause: 'hover',
  wrap: true,
  touch: true
};
XhmikosR's avatar
XhmikosR committed
1292
var DefaultType = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1293
1294
1295
1296
1297
1298
1299
  interval: '(number|boolean)',
  keyboard: 'boolean',
  slide: '(boolean|string)',
  pause: '(string|boolean)',
  wrap: 'boolean',
  touch: 'boolean'
};
XhmikosR's avatar
XhmikosR committed
1300
var Direction = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1301
1302
1303
1304
1305
  NEXT: 'next',
  PREV: 'prev',
  LEFT: 'left',
  RIGHT: 'right'
};
XhmikosR's avatar
XhmikosR committed
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
var Event$3 = {
  SLIDE: "slide" + EVENT_KEY$2,
  SLID: "slid" + EVENT_KEY$2,
  KEYDOWN: "keydown" + EVENT_KEY$2,
  MOUSEENTER: "mouseenter" + EVENT_KEY$2,
  MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
  TOUCHSTART: "touchstart" + EVENT_KEY$2,
  TOUCHMOVE: "touchmove" + EVENT_KEY$2,
  TOUCHEND: "touchend" + EVENT_KEY$2,
  POINTERDOWN: "pointerdown" + EVENT_KEY$2,
  POINTERUP: "pointerup" + EVENT_KEY$2,
  DRAG_START: "dragstart" + EVENT_KEY$2,
  LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
  CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
XhmikosR's avatar
Dist.  
XhmikosR committed
1320
};
XhmikosR's avatar
XhmikosR committed
1321
var ClassName$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
  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',
  POINTER_EVENT: 'pointer-event'
};
XhmikosR's avatar
XhmikosR committed
1332
var Selector$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1333
1334
1335
1336
1337
1338
1339
1340
1341
  ACTIVE: '.active',
  ACTIVE_ITEM: '.active.carousel-item',
  ITEM: '.carousel-item',
  ITEM_IMG: '.carousel-item img',
  NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  INDICATORS: '.carousel-indicators',
  DATA_SLIDE: '[data-slide], [data-slide-to]',
  DATA_RIDE: '[data-ride="carousel"]'
};
XhmikosR's avatar
XhmikosR committed
1342
var PointerType = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
  TOUCH: 'touch',
  PEN: 'pen'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
1353
1354
1355
1356
var Carousel =
/*#__PURE__*/
function () {
  function Carousel(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
    this._items = null;
    this._interval = null;
    this._activeElement = null;
    this._isPaused = false;
    this._isSliding = false;
    this.touchTimeout = null;
    this.touchStartX = 0;
    this.touchDeltaX = 0;
    this._config = this._getConfig(config);
    this._element = element;
    this._indicatorsElement = SelectorEngine.findOne(Selector$2.INDICATORS, this._element);
    this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
    this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);

    this._addEventListeners();

    Data.setData(element, DATA_KEY$2, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
1377
  var _proto = Carousel.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
1378

XhmikosR's avatar
XhmikosR committed
1379
1380
  // Public
  _proto.next = function next() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1381
1382
1383
    if (!this._isSliding) {
      this._slide(Direction.NEXT);
    }
XhmikosR's avatar
XhmikosR committed
1384
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1385

XhmikosR's avatar
XhmikosR committed
1386
  _proto.nextWhenVisible = function nextWhenVisible() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1387
1388
1389
1390
1391
    // Don't call next when the page isn't visible
    // or the carousel or its parent isn't visible
    if (!document.hidden && isVisible(this._element)) {
      this.next();
    }
XhmikosR's avatar
XhmikosR committed
1392
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1393

XhmikosR's avatar
XhmikosR committed
1394
  _proto.prev = function prev() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1395
1396
1397
    if (!this._isSliding) {
      this._slide(Direction.PREV);
    }
XhmikosR's avatar
XhmikosR committed
1398
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1399

XhmikosR's avatar
XhmikosR committed
1400
  _proto.pause = function pause(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
    if (!event) {
      this._isPaused = true;
    }

    if (SelectorEngine.findOne(Selector$2.NEXT_PREV, this._element)) {
      triggerTransitionEnd(this._element);
      this.cycle(true);
    }

    clearInterval(this._interval);
    this._interval = null;
XhmikosR's avatar
XhmikosR committed
1412
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1413

XhmikosR's avatar
XhmikosR committed
1414
  _proto.cycle = function cycle(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
    if (!event) {
      this._isPaused = false;
    }

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

    if (this._config && this._config.interval && !this._isPaused) {
      this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
    }
XhmikosR's avatar
XhmikosR committed
1427
1428
1429
1430
  };

  _proto.to = function to(index) {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1431
1432
1433

    this._activeElement = SelectorEngine.findOne(Selector$2.ACTIVE_ITEM, this._element);

XhmikosR's avatar
XhmikosR committed
1434
    var activeIndex = this._getItemIndex(this._activeElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1435
1436
1437
1438
1439
1440

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

    if (this._isSliding) {
XhmikosR's avatar
XhmikosR committed
1441
1442
1443
      EventHandler.one(this._element, Event$3.SLID, function () {
        return _this.to(index);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1444
1445
1446
1447
1448
1449
1450
1451
1452
      return;
    }

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

XhmikosR's avatar
XhmikosR committed
1453
    var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
XhmikosR's avatar
Dist.  
XhmikosR committed
1454
1455

    this._slide(direction, this._items[index]);
XhmikosR's avatar
XhmikosR committed
1456
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1457

XhmikosR's avatar
XhmikosR committed
1458
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
    EventHandler.off(this._element, EVENT_KEY$2);
    Data.removeData(this._element, DATA_KEY$2);
    this._items = null;
    this._config = null;
    this._element = null;
    this._interval = null;
    this._isPaused = null;
    this._isSliding = null;
    this._activeElement = null;
    this._indicatorsElement = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
1470
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
1471

XhmikosR's avatar
XhmikosR committed
1472
  _proto._getConfig = function _getConfig(config) {
1473
    config = _objectSpread2({}, Default, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1474
1475
    typeCheckConfig(NAME$2, config, DefaultType);
    return config;
XhmikosR's avatar
XhmikosR committed
1476
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1477

XhmikosR's avatar
XhmikosR committed
1478
1479
  _proto._handleSwipe = function _handleSwipe() {
    var absDeltax = Math.abs(this.touchDeltaX);
XhmikosR's avatar
Dist.  
XhmikosR committed
1480
1481
1482
1483
1484

    if (absDeltax <= SWIPE_THRESHOLD) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
1485
1486
    var direction = absDeltax / this.touchDeltaX;
    this.touchDeltaX = 0; // swipe left
XhmikosR's avatar
Dist.  
XhmikosR committed
1487
1488
1489
1490
1491
1492
1493
1494
1495

    if (direction > 0) {
      this.prev();
    } // swipe right


    if (direction < 0) {
      this.next();
    }
XhmikosR's avatar
XhmikosR committed
1496
1497
1498
1499
  };

  _proto._addEventListeners = function _addEventListeners() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1500
1501

    if (this._config.keyboard) {
XhmikosR's avatar
XhmikosR committed
1502
1503
1504
      EventHandler.on(this._element, Event$3.KEYDOWN, function (event) {
        return _this2._keydown(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1505
1506
1507
    }

    if (this._config.pause === 'hover') {
XhmikosR's avatar
XhmikosR committed
1508
1509
1510
1511
1512
1513
      EventHandler.on(this._element, Event$3.MOUSEENTER, function (event) {
        return _this2.pause(event);
      });
      EventHandler.on(this._element, Event$3.MOUSELEAVE, function (event) {
        return _this2.cycle(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1514
1515
    }

1516
    if (this._config.touch && this._touchSupported) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1517
1518
      this._addTouchEventListeners();
    }
XhmikosR's avatar
XhmikosR committed
1519
1520
1521
1522
  };

  _proto._addTouchEventListeners = function _addTouchEventListeners() {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1523

XhmikosR's avatar
XhmikosR committed
1524
1525
1526
1527
1528
    var start = function start(event) {
      if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
        _this3.touchStartX = event.clientX;
      } else if (!_this3._pointerEvent) {
        _this3.touchStartX = event.touches[0].clientX;
XhmikosR's avatar
Dist.  
XhmikosR committed
1529
1530
1531
      }
    };

XhmikosR's avatar
XhmikosR committed
1532
    var move = function move(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1533
1534
      // ensure swiping with one touch and not pinching
      if (event.touches && event.touches.length > 1) {
XhmikosR's avatar
XhmikosR committed
1535
        _this3.touchDeltaX = 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
1536
      } else {
XhmikosR's avatar
XhmikosR committed
1537
        _this3.touchDeltaX = event.touches[0].clientX - _this3.touchStartX;
XhmikosR's avatar
Dist.  
XhmikosR committed
1538
1539
1540
      }
    };

XhmikosR's avatar
XhmikosR committed
1541
1542
1543
    var end = function end(event) {
      if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
        _this3.touchDeltaX = event.clientX - _this3.touchStartX;
XhmikosR's avatar
Dist.  
XhmikosR committed
1544
1545
      }

XhmikosR's avatar
XhmikosR committed
1546
      _this3._handleSwipe();
XhmikosR's avatar
Dist.  
XhmikosR committed
1547

XhmikosR's avatar
XhmikosR committed
1548
      if (_this3._config.pause === 'hover') {
XhmikosR's avatar
Dist.  
XhmikosR committed
1549
1550
1551
1552
1553
1554
1555
        // If it's a touch-enabled device, mouseenter/leave are fired as
        // part of the mouse compatibility events on first tap - the carousel
        // would stop cycling until user tapped out of it;
        // here, we listen for touchend, explicitly pause the carousel
        // (as if it's the second time we tap on it, mouseenter compat event
        // is NOT fired) and after a timeout (to allow for mouse compatibility
        // events to fire) we explicitly restart cycling
XhmikosR's avatar
XhmikosR committed
1556
        _this3.pause();
XhmikosR's avatar
Dist.  
XhmikosR committed
1557

XhmikosR's avatar
XhmikosR committed
1558
1559
        if (_this3.touchTimeout) {
          clearTimeout(_this3.touchTimeout);
XhmikosR's avatar
Dist.  
XhmikosR committed
1560
1561
        }

XhmikosR's avatar
XhmikosR committed
1562
1563
1564
        _this3.touchTimeout = setTimeout(function (event) {
          return _this3.cycle(event);
        }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
XhmikosR's avatar
Dist.  
XhmikosR committed
1565
1566
1567
      }
    };

XhmikosR's avatar
XhmikosR committed
1568
1569
1570
1571
    makeArray(SelectorEngine.find(Selector$2.ITEM_IMG, this._element)).forEach(function (itemImg) {
      EventHandler.on(itemImg, Event$3.DRAG_START, function (e) {
        return e.preventDefault();
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1572
1573
1574
    });

    if (this._pointerEvent) {
XhmikosR's avatar
XhmikosR committed
1575
1576
1577
1578
1579
1580
      EventHandler.on(this._element, Event$3.POINTERDOWN, function (event) {
        return start(event);
      });
      EventHandler.on(this._element, Event$3.POINTERUP, function (event) {
        return end(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1581
1582
1583

      this._element.classList.add(ClassName$2.POINTER_EVENT);
    } else {
XhmikosR's avatar
XhmikosR committed
1584
1585
1586
1587
1588
1589
1590
1591
1592
      EventHandler.on(this._element, Event$3.TOUCHSTART, function (event) {
        return start(event);
      });
      EventHandler.on(this._element, Event$3.TOUCHMOVE, function (event) {
        return move(event);
      });
      EventHandler.on(this._element, Event$3.TOUCHEND, function (event) {
        return end(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1593
    }
XhmikosR's avatar
XhmikosR committed
1594
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1595

XhmikosR's avatar
XhmikosR committed
1596
  _proto._keydown = function _keydown(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
    if (/input|textarea/i.test(event.target.tagName)) {
      return;
    }

    switch (event.which) {
      case ARROW_LEFT_KEYCODE:
        event.preventDefault();
        this.prev();
        break;

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

      default:
    }
XhmikosR's avatar
XhmikosR committed
1614
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1615

XhmikosR's avatar
XhmikosR committed
1616
  _proto._getItemIndex = function _getItemIndex(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1617
1618
    this._items = element && element.parentNode ? makeArray(SelectorEngine.find(Selector$2.ITEM, element.parentNode)) : [];
    return this._items.indexOf(element);
XhmikosR's avatar
XhmikosR committed
1619
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1620

XhmikosR's avatar
XhmikosR committed
1621
1622
1623
  _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
    var isNextDirection = direction === Direction.NEXT;
    var isPrevDirection = direction === Direction.PREV;
XhmikosR's avatar
Dist.  
XhmikosR committed
1624

XhmikosR's avatar
XhmikosR committed
1625
    var activeIndex = this._getItemIndex(activeElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1626

XhmikosR's avatar
XhmikosR committed
1627
1628
    var lastItemIndex = this._items.length - 1;
    var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
XhmikosR's avatar
Dist.  
XhmikosR committed
1629
1630
1631
1632
1633

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

XhmikosR's avatar
XhmikosR committed
1634
1635
    var delta = direction === Direction.PREV ? -1 : 1;
    var itemIndex = (activeIndex + delta) % this._items.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
1636
    return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
XhmikosR's avatar
XhmikosR committed
1637
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1638

XhmikosR's avatar
XhmikosR committed
1639
1640
  _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
    var targetIndex = this._getItemIndex(relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
1641

XhmikosR's avatar
XhmikosR committed
1642
    var fromIndex = this._getItemIndex(SelectorEngine.findOne(Selector$2.ACTIVE_ITEM, this._element));
XhmikosR's avatar
Dist.  
XhmikosR committed
1643
1644

    return EventHandler.trigger(this._element, Event$3.SLIDE, {
XhmikosR's avatar
XhmikosR committed
1645
      relatedTarget: relatedTarget,
XhmikosR's avatar
Dist.  
XhmikosR committed
1646
1647
1648
1649
      direction: eventDirectionName,
      from: fromIndex,
      to: targetIndex
    });
XhmikosR's avatar
XhmikosR committed
1650
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1651

XhmikosR's avatar
XhmikosR committed
1652
  _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1653
    if (this._indicatorsElement) {
XhmikosR's avatar
XhmikosR committed
1654
      var indicators = SelectorEngine.find(Selector$2.ACTIVE, this._indicatorsElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1655

XhmikosR's avatar
XhmikosR committed
1656
      for (var i = 0; i < indicators.length; i++) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1657
1658
1659
        indicators[i].classList.remove(ClassName$2.ACTIVE);
      }

XhmikosR's avatar
XhmikosR committed
1660
      var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
XhmikosR's avatar
Dist.  
XhmikosR committed
1661
1662
1663
1664
1665

      if (nextIndicator) {
        nextIndicator.classList.add(ClassName$2.ACTIVE);
      }
    }
XhmikosR's avatar
XhmikosR committed
1666
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1667

XhmikosR's avatar
XhmikosR committed
1668
1669
  _proto._slide = function _slide(direction, element) {
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1670

XhmikosR's avatar
XhmikosR committed
1671
    var activeElement = SelectorEngine.findOne(Selector$2.ACTIVE_ITEM, this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
1672

XhmikosR's avatar
XhmikosR committed
1673
    var activeElementIndex = this._getItemIndex(activeElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1674

XhmikosR's avatar
XhmikosR committed
1675
    var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1676

XhmikosR's avatar
XhmikosR committed
1677
1678
1679
1680
1681
1682
    var nextElementIndex = this._getItemIndex(nextElement);

    var isCycling = Boolean(this._interval);
    var directionalClassName;
    var orderClassName;
    var eventDirectionName;
XhmikosR's avatar
Dist.  
XhmikosR committed
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698

    if (direction === Direction.NEXT) {
      directionalClassName = ClassName$2.LEFT;
      orderClassName = ClassName$2.NEXT;
      eventDirectionName = Direction.LEFT;
    } else {
      directionalClassName = ClassName$2.RIGHT;
      orderClassName = ClassName$2.PREV;
      eventDirectionName = Direction.RIGHT;
    }

    if (nextElement && nextElement.classList.contains(ClassName$2.ACTIVE)) {
      this._isSliding = false;
      return;
    }

XhmikosR's avatar
XhmikosR committed
1699
    var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
XhmikosR's avatar
Dist.  
XhmikosR committed
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722

    if (slideEvent.defaultPrevented) {
      return;
    }

    if (!activeElement || !nextElement) {
      // Some weirdness is happening, so we bail
      return;
    }

    this._isSliding = true;

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

    this._setActiveIndicatorElement(nextElement);

    if (this._element.classList.contains(ClassName$2.SLIDE)) {
      nextElement.classList.add(orderClassName);
      reflow(nextElement);
      activeElement.classList.add(directionalClassName);
      nextElement.classList.add(directionalClassName);
XhmikosR's avatar
XhmikosR committed
1723
      var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
XhmikosR's avatar
Dist.  
XhmikosR committed
1724
1725
1726
1727
1728
1729
1730
1731

      if (nextElementInterval) {
        this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
        this._config.interval = nextElementInterval;
      } else {
        this._config.interval = this._config.defaultInterval || this._config.interval;
      }

XhmikosR's avatar
XhmikosR committed
1732
1733
      var transitionDuration = getTransitionDurationFromElement(activeElement);
      EventHandler.one(activeElement, TRANSITION_END, function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
1734
1735
1736
1737
1738
1739
        nextElement.classList.remove(directionalClassName);
        nextElement.classList.remove(orderClassName);
        nextElement.classList.add(ClassName$2.ACTIVE);
        activeElement.classList.remove(ClassName$2.ACTIVE);
        activeElement.classList.remove(orderClassName);
        activeElement.classList.remove(directionalClassName);
XhmikosR's avatar
XhmikosR committed
1740
1741
1742
        _this4._isSliding = false;
        setTimeout(function () {
          EventHandler.trigger(_this4._element, Event$3.SLID, {
XhmikosR's avatar
Dist.  
XhmikosR committed
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
            relatedTarget: nextElement,
            direction: eventDirectionName,
            from: activeElementIndex,
            to: nextElementIndex
          });
        }, 0);
      });
      emulateTransitionEnd(activeElement, transitionDuration);
    } else {
      activeElement.classList.remove(ClassName$2.ACTIVE);
      nextElement.classList.add(ClassName$2.ACTIVE);
      this._isSliding = false;
      EventHandler.trigger(this._element, Event$3.SLID, {
        relatedTarget: nextElement,
        direction: eventDirectionName,
        from: activeElementIndex,
        to: nextElementIndex
      });
    }

    if (isCycling) {
      this.cycle();
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
1767
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
1768

XhmikosR's avatar
XhmikosR committed
1769
  Carousel.carouselInterface = function carouselInterface(element, config) {
XhmikosR's avatar
XhmikosR committed
1770
    var data = Data.getData(element, DATA_KEY$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
1771

1772
    var _config = _objectSpread2({}, Default, {}, Manipulator.getDataAttributes(element));
XhmikosR's avatar
Dist.  
XhmikosR committed
1773
1774

    if (typeof config === 'object') {
1775
      _config = _objectSpread2({}, _config, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1776
1777
    }

XhmikosR's avatar
XhmikosR committed
1778
    var action = typeof config === 'string' ? config : _config.slide;
XhmikosR's avatar
Dist.  
XhmikosR committed
1779
1780
1781
1782
1783
1784
1785
1786
1787

    if (!data) {
      data = new Carousel(element, _config);
    }

    if (typeof config === 'number') {
      data.to(config);
    } else if (typeof action === 'string') {
      if (typeof data[action] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
1788
        throw new TypeError("No method named \"" + action + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
1789
1790
1791
1792
1793
1794
1795
      }

      data[action]();
    } else if (_config.interval && _config.ride) {
      data.pause();
      data.cycle();
    }
XhmikosR's avatar
XhmikosR committed
1796
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1797

XhmikosR's avatar
XhmikosR committed
1798
  Carousel.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1799
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
1800
      Carousel.carouselInterface(this, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1801
    });
XhmikosR's avatar
XhmikosR committed
1802
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1803

XhmikosR's avatar
XhmikosR committed
1804
1805
  Carousel.dataApiClickHandler = function dataApiClickHandler(event) {
    var target = getElementFromSelector(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
1806
1807
1808
1809
1810

    if (!target || !target.classList.contains(ClassName$2.CAROUSEL)) {
      return;
    }

1811
    var config = _objectSpread2({}, Manipulator.getDataAttributes(target), {}, Manipulator.getDataAttributes(this));
XhmikosR's avatar
Dist.  
XhmikosR committed
1812

XhmikosR's avatar
XhmikosR committed
1813
    var slideIndex = this.getAttribute('data-slide-to');
XhmikosR's avatar
Dist.  
XhmikosR committed
1814
1815
1816
1817
1818

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

XhmikosR's avatar
XhmikosR committed
1819
    Carousel.carouselInterface(target, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1820
1821
1822
1823
1824
1825

    if (slideIndex) {
      Data.getData(target, DATA_KEY$2).to(slideIndex);
    }

    event.preventDefault();
XhmikosR's avatar
XhmikosR committed
1826
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1827

XhmikosR's avatar
XhmikosR committed
1828
  Carousel.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1829
    return Data.getData(element, DATA_KEY$2);
XhmikosR's avatar
XhmikosR committed
1830
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1831

XhmikosR's avatar
XhmikosR committed
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
  _createClass(Carousel, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$2;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default;
    }
  }]);

  return Carousel;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
1846
1847
1848
1849
1850
1851
1852
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
1853
EventHandler.on(document, Event$3.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel.dataApiClickHandler);
XhmikosR's avatar
XhmikosR committed
1854
1855
EventHandler.on(window, Event$3.LOAD_DATA_API, function () {
  var carousels = makeArray(SelectorEngine.find(Selector$2.DATA_RIDE));
XhmikosR's avatar
Dist.  
XhmikosR committed
1856

XhmikosR's avatar
XhmikosR committed
1857
  for (var i = 0, len = carousels.length; i < len; i++) {
XhmikosR's avatar
XhmikosR committed
1858
    Carousel.carouselInterface(carousels[i], Data.getData(carousels[i], DATA_KEY$2));
XhmikosR's avatar
Dist.  
XhmikosR committed
1859
1860
  }
});
XhmikosR's avatar
XhmikosR committed
1861
var $$3 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
1862
1863
1864
1865
1866
1867
1868
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .carousel to jQuery only if jQuery is present
 */

1869
1870
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
1871
1872
1873
1874
if ($$3) {
  var JQUERY_NO_CONFLICT$2 = $$3.fn[NAME$2];
  $$3.fn[NAME$2] = Carousel.jQueryInterface;
  $$3.fn[NAME$2].Constructor = Carousel;
XhmikosR's avatar
Dist.  
XhmikosR committed
1875

XhmikosR's avatar
XhmikosR committed
1876
1877
1878
  $$3.fn[NAME$2].noConflict = function () {
    $$3.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
    return Carousel.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
1879
1880
1881
1882
1883
1884
1885
1886
1887
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
1888
1889
1890
1891
1892
1893
var NAME$3 = 'collapse';
var VERSION$3 = '4.3.1';
var DATA_KEY$3 = 'bs.collapse';
var EVENT_KEY$3 = "." + DATA_KEY$3;
var DATA_API_KEY$3 = '.data-api';
var Default$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1894
1895
1896
  toggle: true,
  parent: ''
};
XhmikosR's avatar
XhmikosR committed
1897
var DefaultType$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1898
1899
1900
  toggle: 'boolean',
  parent: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
1901
1902
1903
1904
1905
1906
var Event$4 = {
  SHOW: "show" + EVENT_KEY$3,
  SHOWN: "shown" + EVENT_KEY$3,
  HIDE: "hide" + EVENT_KEY$3,
  HIDDEN: "hidden" + EVENT_KEY$3,
  CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
XhmikosR's avatar
Dist.  
XhmikosR committed
1907
};
XhmikosR's avatar
XhmikosR committed
1908
var ClassName$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1909
1910
1911
1912
1913
  SHOW: 'show',
  COLLAPSE: 'collapse',
  COLLAPSING: 'collapsing',
  COLLAPSED: 'collapsed'
};
XhmikosR's avatar
XhmikosR committed
1914
var Dimension = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1915
1916
1917
  WIDTH: 'width',
  HEIGHT: 'height'
};
XhmikosR's avatar
XhmikosR committed
1918
var Selector$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
  ACTIVES: '.show, .collapsing',
  DATA_TOGGLE: '[data-toggle="collapse"]'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
1929
1930
1931
1932
var Collapse =
/*#__PURE__*/
function () {
  function Collapse(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1933
1934
1935
    this._isTransitioning = false;
    this._element = element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
1936
1937
1938
1939
1940
1941
1942
1943
1944
    this._triggerArray = makeArray(SelectorEngine.find("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
    var toggleList = makeArray(SelectorEngine.find(Selector$3.DATA_TOGGLE));

    for (var i = 0, len = toggleList.length; i < len; i++) {
      var elem = toggleList[i];
      var selector = getSelectorFromElement(elem);
      var filterElement = makeArray(SelectorEngine.find(selector)).filter(function (foundElem) {
        return foundElem === element;
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966

      if (selector !== null && filterElement.length) {
        this._selector = selector;

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

    Data.setData(element, DATA_KEY$3, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
1967
  var _proto = Collapse.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
1968

XhmikosR's avatar
XhmikosR committed
1969
1970
  // Public
  _proto.toggle = function toggle() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1971
1972
1973
1974
1975
    if (this._element.classList.contains(ClassName$3.SHOW)) {
      this.hide();
    } else {
      this.show();
    }
XhmikosR's avatar
XhmikosR committed
1976
1977
1978
1979
  };

  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1980
1981
1982
1983
1984

    if (this._isTransitioning || this._element.classList.contains(ClassName$3.SHOW)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
1985
1986
    var actives;
    var activesData;
XhmikosR's avatar
Dist.  
XhmikosR committed
1987
1988

    if (this._parent) {
XhmikosR's avatar
XhmikosR committed
1989
1990
1991
      actives = makeArray(SelectorEngine.find(Selector$3.ACTIVES, this._parent)).filter(function (elem) {
        if (typeof _this._config.parent === 'string') {
          return elem.getAttribute('data-parent') === _this._config.parent;
XhmikosR's avatar
Dist.  
XhmikosR committed
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
        }

        return elem.classList.contains(ClassName$3.COLLAPSE);
      });

      if (actives.length === 0) {
        actives = null;
      }
    }

XhmikosR's avatar
XhmikosR committed
2002
    var container = SelectorEngine.findOne(this._selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
2003
2004

    if (actives) {
XhmikosR's avatar
XhmikosR committed
2005
2006
2007
      var tempActiveData = actives.filter(function (elem) {
        return container !== elem;
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
2008
2009
2010
2011
2012
2013
2014
      activesData = tempActiveData[0] ? Data.getData(tempActiveData[0], DATA_KEY$3) : null;

      if (activesData && activesData._isTransitioning) {
        return;
      }
    }

XhmikosR's avatar
XhmikosR committed
2015
    var startEvent = EventHandler.trigger(this._element, Event$4.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
2016
2017
2018
2019
2020
2021

    if (startEvent.defaultPrevented) {
      return;
    }

    if (actives) {
XhmikosR's avatar
XhmikosR committed
2022
      actives.forEach(function (elemActive) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2023
        if (container !== elemActive) {
XhmikosR's avatar
XhmikosR committed
2024
          Collapse.collapseInterface(elemActive, 'hide');
XhmikosR's avatar
Dist.  
XhmikosR committed
2025
2026
2027
2028
2029
2030
2031
2032
        }

        if (!activesData) {
          Data.setData(elemActive, DATA_KEY$3, null);
        }
      });
    }

XhmikosR's avatar
XhmikosR committed
2033
    var dimension = this._getDimension();
XhmikosR's avatar
Dist.  
XhmikosR committed
2034
2035
2036
2037
2038
2039
2040
2041

    this._element.classList.remove(ClassName$3.COLLAPSE);

    this._element.classList.add(ClassName$3.COLLAPSING);

    this._element.style[dimension] = 0;

    if (this._triggerArray.length) {
XhmikosR's avatar
XhmikosR committed
2042
      this._triggerArray.forEach(function (element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2043
2044
2045
2046
2047
2048
2049
        element.classList.remove(ClassName$3.COLLAPSED);
        element.setAttribute('aria-expanded', true);
      });
    }

    this.setTransitioning(true);

XhmikosR's avatar
XhmikosR committed
2050
2051
2052
2053
2054
2055
    var complete = function complete() {
      _this._element.classList.remove(ClassName$3.COLLAPSING);

      _this._element.classList.add(ClassName$3.COLLAPSE);

      _this._element.classList.add(ClassName$3.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
2056

XhmikosR's avatar
XhmikosR committed
2057
      _this._element.style[dimension] = '';
XhmikosR's avatar
Dist.  
XhmikosR committed
2058

XhmikosR's avatar
XhmikosR committed
2059
      _this.setTransitioning(false);
XhmikosR's avatar
Dist.  
XhmikosR committed
2060

XhmikosR's avatar
XhmikosR committed
2061
      EventHandler.trigger(_this._element, Event$4.SHOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
2062
2063
    };

XhmikosR's avatar
XhmikosR committed
2064
2065
2066
    var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
    var scrollSize = "scroll" + capitalizedDimension;
    var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
2067
2068
    EventHandler.one(this._element, TRANSITION_END, complete);
    emulateTransitionEnd(this._element, transitionDuration);
XhmikosR's avatar
XhmikosR committed
2069
2070
2071
2072
2073
    this._element.style[dimension] = this._element[scrollSize] + "px";
  };

  _proto.hide = function hide() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2074
2075
2076
2077
2078

    if (this._isTransitioning || !this._element.classList.contains(ClassName$3.SHOW)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2079
    var startEvent = EventHandler.trigger(this._element, Event$4.HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
2080
2081
2082
2083
2084

    if (startEvent.defaultPrevented) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2085
    var dimension = this._getDimension();
XhmikosR's avatar
Dist.  
XhmikosR committed
2086

XhmikosR's avatar
XhmikosR committed
2087
    this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
2088
2089
2090
2091
2092
2093
2094
2095
    reflow(this._element);

    this._element.classList.add(ClassName$3.COLLAPSING);

    this._element.classList.remove(ClassName$3.COLLAPSE);

    this._element.classList.remove(ClassName$3.SHOW);

XhmikosR's avatar
XhmikosR committed
2096
    var triggerArrayLength = this._triggerArray.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
2097
2098

    if (triggerArrayLength > 0) {
XhmikosR's avatar
XhmikosR committed
2099
2100
      for (var i = 0; i < triggerArrayLength; i++) {
        var trigger = this._triggerArray[i];
XhmikosR's avatar
XhmikosR committed
2101
        var elem = getElementFromSelector(trigger);
XhmikosR's avatar
Dist.  
XhmikosR committed
2102

XhmikosR's avatar
XhmikosR committed
2103
2104
2105
        if (elem && !elem.classList.contains(ClassName$3.SHOW)) {
          trigger.classList.add(ClassName$3.COLLAPSED);
          trigger.setAttribute('aria-expanded', false);
XhmikosR's avatar
Dist.  
XhmikosR committed
2106
2107
2108
2109
2110
2111
        }
      }
    }

    this.setTransitioning(true);

XhmikosR's avatar
XhmikosR committed
2112
2113
    var complete = function complete() {
      _this2.setTransitioning(false);
XhmikosR's avatar
Dist.  
XhmikosR committed
2114

XhmikosR's avatar
XhmikosR committed
2115
      _this2._element.classList.remove(ClassName$3.COLLAPSING);
XhmikosR's avatar
Dist.  
XhmikosR committed
2116

XhmikosR's avatar
XhmikosR committed
2117
      _this2._element.classList.add(ClassName$3.COLLAPSE);
XhmikosR's avatar
Dist.  
XhmikosR committed
2118

XhmikosR's avatar
XhmikosR committed
2119
      EventHandler.trigger(_this2._element, Event$4.HIDDEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
2120
2121
2122
    };

    this._element.style[dimension] = '';
XhmikosR's avatar
XhmikosR committed
2123
    var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
2124
2125
    EventHandler.one(this._element, TRANSITION_END, complete);
    emulateTransitionEnd(this._element, transitionDuration);
XhmikosR's avatar
XhmikosR committed
2126
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2127

XhmikosR's avatar
XhmikosR committed
2128
  _proto.setTransitioning = function setTransitioning(isTransitioning) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2129
    this._isTransitioning = isTransitioning;
XhmikosR's avatar
XhmikosR committed
2130
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2131

XhmikosR's avatar
XhmikosR committed
2132
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2133
2134
2135
2136
2137
2138
2139
    Data.removeData(this._element, DATA_KEY$3);
    this._config = null;
    this._parent = null;
    this._element = null;
    this._triggerArray = null;
    this._isTransitioning = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
2140
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2141

XhmikosR's avatar
XhmikosR committed
2142
  _proto._getConfig = function _getConfig(config) {
2143
    config = _objectSpread2({}, Default$1, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2144
2145
2146
2147
    config.toggle = Boolean(config.toggle); // Coerce string values

    typeCheckConfig(NAME$3, config, DefaultType$1);
    return config;
XhmikosR's avatar
XhmikosR committed
2148
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2149

XhmikosR's avatar
XhmikosR committed
2150
2151
  _proto._getDimension = function _getDimension() {
    var hasWidth = this._element.classList.contains(Dimension.WIDTH);
XhmikosR's avatar
Dist.  
XhmikosR committed
2152
2153

    return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
XhmikosR's avatar
XhmikosR committed
2154
2155
2156
2157
  };

  _proto._getParent = function _getParent() {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2158

XhmikosR's avatar
XhmikosR committed
2159
    var parent = this._config.parent;
XhmikosR's avatar
Dist.  
XhmikosR committed
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169

    if (isElement(parent)) {
      // it's a jQuery object
      if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') {
        parent = parent[0];
      }
    } else {
      parent = SelectorEngine.findOne(parent);
    }

XhmikosR's avatar
XhmikosR committed
2170
2171
    var selector = "[data-toggle=\"collapse\"][data-parent=\"" + parent + "\"]";
    makeArray(SelectorEngine.find(selector, parent)).forEach(function (element) {
XhmikosR's avatar
XhmikosR committed
2172
      var selected = getElementFromSelector(element);
2173
2174

      _this3._addAriaAndCollapsedClass(selected, [element]);
XhmikosR's avatar
Dist.  
XhmikosR committed
2175
2176
    });
    return parent;
XhmikosR's avatar
XhmikosR committed
2177
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2178

XhmikosR's avatar
XhmikosR committed
2179
  _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2180
    if (element) {
XhmikosR's avatar
XhmikosR committed
2181
      var isOpen = element.classList.contains(ClassName$3.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
2182
2183

      if (triggerArray.length) {
XhmikosR's avatar
XhmikosR committed
2184
        triggerArray.forEach(function (elem) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
          if (isOpen) {
            elem.classList.remove(ClassName$3.COLLAPSED);
          } else {
            elem.classList.add(ClassName$3.COLLAPSED);
          }

          elem.setAttribute('aria-expanded', isOpen);
        });
      }
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
2196
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2197

XhmikosR's avatar
XhmikosR committed
2198
  Collapse.collapseInterface = function collapseInterface(element, config) {
XhmikosR's avatar
XhmikosR committed
2199
    var data = Data.getData(element, DATA_KEY$3);
XhmikosR's avatar
Dist.  
XhmikosR committed
2200

2201
    var _config = _objectSpread2({}, Default$1, {}, Manipulator.getDataAttributes(element), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212

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

    if (!data) {
      data = new Collapse(element, _config);
    }

    if (typeof config === 'string') {
      if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
2213
        throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
2214
2215
2216
2217
      }

      data[config]();
    }
XhmikosR's avatar
XhmikosR committed
2218
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2219

XhmikosR's avatar
XhmikosR committed
2220
  Collapse.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2221
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
2222
      Collapse.collapseInterface(this, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2223
    });
XhmikosR's avatar
XhmikosR committed
2224
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2225

XhmikosR's avatar
XhmikosR committed
2226
  Collapse.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2227
    return Data.getData(element, DATA_KEY$3);
XhmikosR's avatar
XhmikosR committed
2228
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2229

XhmikosR's avatar
XhmikosR committed
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
  _createClass(Collapse, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$3;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$1;
    }
  }]);

  return Collapse;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


EventHandler.on(document, Event$4.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
  // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  if (event.target.tagName === 'A') {
    event.preventDefault();
  }

XhmikosR's avatar
XhmikosR committed
2257
2258
2259
2260
2261
2262
  var triggerData = Manipulator.getDataAttributes(this);
  var selector = getSelectorFromElement(this);
  var selectorElements = makeArray(SelectorEngine.find(selector));
  selectorElements.forEach(function (element) {
    var data = Data.getData(element, DATA_KEY$3);
    var config;
XhmikosR's avatar
Dist.  
XhmikosR committed
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275

    if (data) {
      // update parent attribute
      if (data._parent === null && typeof triggerData.parent === 'string') {
        data._config.parent = triggerData.parent;
        data._parent = data._getParent();
      }

      config = 'toggle';
    } else {
      config = triggerData;
    }

XhmikosR's avatar
XhmikosR committed
2276
    Collapse.collapseInterface(element, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2277
2278
  });
});
XhmikosR's avatar
XhmikosR committed
2279
var $$4 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
2280
2281
2282
2283
2284
2285
2286
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .collapse to jQuery only if jQuery is present
 */

2287
2288
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
2289
2290
2291
2292
if ($$4) {
  var JQUERY_NO_CONFLICT$3 = $$4.fn[NAME$3];
  $$4.fn[NAME$3] = Collapse.jQueryInterface;
  $$4.fn[NAME$3].Constructor = Collapse;
XhmikosR's avatar
Dist.  
XhmikosR committed
2293

XhmikosR's avatar
XhmikosR committed
2294
2295
2296
  $$4.fn[NAME$3].noConflict = function () {
    $$4.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
    return Collapse.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
2297
2298
2299
2300
2301
2302
2303
2304
2305
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
2306
2307
2308
2309
2310
2311
var NAME$4 = 'dropdown';
var VERSION$4 = '4.3.1';
var DATA_KEY$4 = 'bs.dropdown';
var EVENT_KEY$4 = "." + DATA_KEY$4;
var DATA_API_KEY$4 = '.data-api';
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
XhmikosR's avatar
Dist.  
XhmikosR committed
2312

XhmikosR's avatar
XhmikosR committed
2313
var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
XhmikosR's avatar
Dist.  
XhmikosR committed
2314

XhmikosR's avatar
XhmikosR committed
2315
var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
XhmikosR's avatar
Dist.  
XhmikosR committed
2316

XhmikosR's avatar
XhmikosR committed
2317
var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
XhmikosR's avatar
Dist.  
XhmikosR committed
2318

XhmikosR's avatar
XhmikosR committed
2319
var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
XhmikosR's avatar
Dist.  
XhmikosR committed
2320

XhmikosR's avatar
XhmikosR committed
2321
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
XhmikosR's avatar
Dist.  
XhmikosR committed
2322

XhmikosR's avatar
XhmikosR committed
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
var Event$5 = {
  HIDE: "hide" + EVENT_KEY$4,
  HIDDEN: "hidden" + EVENT_KEY$4,
  SHOW: "show" + EVENT_KEY$4,
  SHOWN: "shown" + EVENT_KEY$4,
  CLICK: "click" + EVENT_KEY$4,
  CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
  KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
  KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
XhmikosR's avatar
Dist.  
XhmikosR committed
2333
};
XhmikosR's avatar
XhmikosR committed
2334
var ClassName$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2335
2336
2337
2338
2339
2340
2341
2342
  DISABLED: 'disabled',
  SHOW: 'show',
  DROPUP: 'dropup',
  DROPRIGHT: 'dropright',
  DROPLEFT: 'dropleft',
  MENURIGHT: 'dropdown-menu-right',
  POSITION_STATIC: 'position-static'
};
XhmikosR's avatar
XhmikosR committed
2343
var Selector$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2344
2345
2346
2347
2348
2349
  DATA_TOGGLE: '[data-toggle="dropdown"]',
  FORM_CHILD: '.dropdown form',
  MENU: '.dropdown-menu',
  NAVBAR_NAV: '.navbar-nav',
  VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
};
XhmikosR's avatar
XhmikosR committed
2350
var AttachmentMap = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2351
2352
2353
2354
2355
2356
2357
2358
2359
  TOP: 'top-start',
  TOPEND: 'top-end',
  BOTTOM: 'bottom-start',
  BOTTOMEND: 'bottom-end',
  RIGHT: 'right-start',
  RIGHTEND: 'right-end',
  LEFT: 'left-start',
  LEFTEND: 'left-end'
};
XhmikosR's avatar
XhmikosR committed
2360
var Default$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2361
2362
2363
2364
  offset: 0,
  flip: true,
  boundary: 'scrollParent',
  reference: 'toggle',
XhmikosR's avatar
XhmikosR committed
2365
2366
  display: 'dynamic',
  popperConfig: null
XhmikosR's avatar
Dist.  
XhmikosR committed
2367
};
XhmikosR's avatar
XhmikosR committed
2368
var DefaultType$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2369
2370
2371
2372
  offset: '(number|string|function)',
  flip: 'boolean',
  boundary: '(string|element)',
  reference: '(string|element)',
XhmikosR's avatar
XhmikosR committed
2373
2374
  display: 'string',
  popperConfig: '(null|object)'
XhmikosR's avatar
Dist.  
XhmikosR committed
2375
2376
2377
2378
2379
2380
2381
2382
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
2383
2384
2385
2386
var Dropdown =
/*#__PURE__*/
function () {
  function Dropdown(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
    this._element = element;
    this._popper = null;
    this._config = this._getConfig(config);
    this._menu = this._getMenuElement();
    this._inNavbar = this._detectNavbar();

    this._addEventListeners();

    Data.setData(element, DATA_KEY$4, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
2399
  var _proto = Dropdown.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
2400

XhmikosR's avatar
XhmikosR committed
2401
2402
  // Public
  _proto.toggle = function toggle() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2403
2404
2405
2406
    if (this._element.disabled || this._element.classList.contains(ClassName$4.DISABLED)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2407
    var isActive = this._menu.classList.contains(ClassName$4.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
2408

XhmikosR's avatar
XhmikosR committed
2409
    Dropdown.clearMenus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2410
2411
2412
2413
2414

    if (isActive) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2415
2416
2417
2418
2419
2420
2421
2422
2423
    this.show();
  };

  _proto.show = function show() {
    if (this._element.disabled || this._element.classList.contains(ClassName$4.DISABLED) || this._menu.classList.contains(ClassName$4.SHOW)) {
      return;
    }

    var parent = Dropdown.getParentFromElement(this._element);
XhmikosR's avatar
XhmikosR committed
2424
    var relatedTarget = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2425
2426
      relatedTarget: this._element
    };
XhmikosR's avatar
XhmikosR committed
2427
    var showEvent = EventHandler.trigger(parent, Event$5.SHOW, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438

    if (showEvent.defaultPrevented) {
      return;
    } // Disable totally Popper.js for Dropdown in Navbar


    if (!this._inNavbar) {
      if (typeof Popper === 'undefined') {
        throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org)');
      }

XhmikosR's avatar
XhmikosR committed
2439
      var referenceElement = this._element;
XhmikosR's avatar
Dist.  
XhmikosR committed
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

      if (this._config.reference === 'parent') {
        referenceElement = parent;
      } else if (isElement(this._config.reference)) {
        referenceElement = this._config.reference; // Check if it's jQuery element

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


      if (this._config.boundary !== 'scrollParent') {
        parent.classList.add(ClassName$4.POSITION_STATIC);
      }

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


    if ('ontouchstart' in document.documentElement && !makeArray(SelectorEngine.closest(parent, Selector$4.NAVBAR_NAV)).length) {
XhmikosR's avatar
XhmikosR committed
2466
2467
2468
      makeArray(document.body.children).forEach(function (elem) {
        return EventHandler.on(elem, 'mouseover', null, noop());
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
2469
2470
2471
2472
2473
2474
2475
2476
2477
    }

    this._element.focus();

    this._element.setAttribute('aria-expanded', true);

    Manipulator.toggleClass(this._menu, ClassName$4.SHOW);
    Manipulator.toggleClass(parent, ClassName$4.SHOW);
    EventHandler.trigger(parent, Event$5.SHOWN, relatedTarget);
XhmikosR's avatar
XhmikosR committed
2478
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2479

XhmikosR's avatar
XhmikosR committed
2480
  _proto.hide = function hide() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2481
2482
2483
2484
    if (this._element.disabled || this._element.classList.contains(ClassName$4.DISABLED) || !this._menu.classList.contains(ClassName$4.SHOW)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2485
    var parent = Dropdown.getParentFromElement(this._element);
XhmikosR's avatar
XhmikosR committed
2486
    var relatedTarget = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2487
2488
      relatedTarget: this._element
    };
XhmikosR's avatar
XhmikosR committed
2489
    var hideEvent = EventHandler.trigger(parent, Event$5.HIDE, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2490
2491
2492
2493
2494

    if (hideEvent.defaultPrevented) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2495
2496
2497
2498
    if (this._popper) {
      this._popper.destroy();
    }

XhmikosR's avatar
Dist.  
XhmikosR committed
2499
2500
2501
    Manipulator.toggleClass(this._menu, ClassName$4.SHOW);
    Manipulator.toggleClass(parent, ClassName$4.SHOW);
    EventHandler.trigger(parent, Event$5.HIDDEN, relatedTarget);
XhmikosR's avatar
XhmikosR committed
2502
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2503

XhmikosR's avatar
XhmikosR committed
2504
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2505
2506
2507
2508
2509
    Data.removeData(this._element, DATA_KEY$4);
    EventHandler.off(this._element, EVENT_KEY$4);
    this._element = null;
    this._menu = null;

XhmikosR's avatar
XhmikosR committed
2510
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2511
2512
2513
2514
      this._popper.destroy();

      this._popper = null;
    }
XhmikosR's avatar
XhmikosR committed
2515
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2516

XhmikosR's avatar
XhmikosR committed
2517
  _proto.update = function update() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2518
2519
    this._inNavbar = this._detectNavbar();

XhmikosR's avatar
XhmikosR committed
2520
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2521
2522
2523
      this._popper.scheduleUpdate();
    }
  } // Private
XhmikosR's avatar
XhmikosR committed
2524
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2525

XhmikosR's avatar
XhmikosR committed
2526
2527
  _proto._addEventListeners = function _addEventListeners() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2528

XhmikosR's avatar
XhmikosR committed
2529
    EventHandler.on(this._element, Event$5.CLICK, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2530
2531
      event.preventDefault();
      event.stopPropagation();
XhmikosR's avatar
XhmikosR committed
2532
2533

      _this.toggle();
XhmikosR's avatar
Dist.  
XhmikosR committed
2534
    });
XhmikosR's avatar
XhmikosR committed
2535
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2536

XhmikosR's avatar
XhmikosR committed
2537
  _proto._getConfig = function _getConfig(config) {
2538
    config = _objectSpread2({}, this.constructor.Default, {}, Manipulator.getDataAttributes(this._element), {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2539
2540
    typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
    return config;
XhmikosR's avatar
XhmikosR committed
2541
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2542

XhmikosR's avatar
XhmikosR committed
2543
  _proto._getMenuElement = function _getMenuElement() {
XhmikosR's avatar
XhmikosR committed
2544
    var parent = Dropdown.getParentFromElement(this._element);
2545
    return SelectorEngine.findOne(Selector$4.MENU, parent);
XhmikosR's avatar
XhmikosR committed
2546
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2547

XhmikosR's avatar
XhmikosR committed
2548
2549
2550
  _proto._getPlacement = function _getPlacement() {
    var parentDropdown = this._element.parentNode;
    var placement = AttachmentMap.BOTTOM; // Handle dropup
XhmikosR's avatar
Dist.  
XhmikosR committed
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566

    if (parentDropdown.classList.contains(ClassName$4.DROPUP)) {
      placement = AttachmentMap.TOP;

      if (this._menu.classList.contains(ClassName$4.MENURIGHT)) {
        placement = AttachmentMap.TOPEND;
      }
    } else if (parentDropdown.classList.contains(ClassName$4.DROPRIGHT)) {
      placement = AttachmentMap.RIGHT;
    } else if (parentDropdown.classList.contains(ClassName$4.DROPLEFT)) {
      placement = AttachmentMap.LEFT;
    } else if (this._menu.classList.contains(ClassName$4.MENURIGHT)) {
      placement = AttachmentMap.BOTTOMEND;
    }

    return placement;
XhmikosR's avatar
XhmikosR committed
2567
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2568

XhmikosR's avatar
XhmikosR committed
2569
  _proto._detectNavbar = function _detectNavbar() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2570
    return Boolean(SelectorEngine.closest(this._element, '.navbar'));
XhmikosR's avatar
XhmikosR committed
2571
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2572

XhmikosR's avatar
XhmikosR committed
2573
2574
2575
2576
  _proto._getOffset = function _getOffset() {
    var _this2 = this;

    var offset = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
2577
2578

    if (typeof this._config.offset === 'function') {
XhmikosR's avatar
XhmikosR committed
2579
      offset.fn = function (data) {
2580
        data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {});
XhmikosR's avatar
Dist.  
XhmikosR committed
2581
2582
2583
2584
2585
2586
2587
        return data;
      };
    } else {
      offset.offset = this._config.offset;
    }

    return offset;
XhmikosR's avatar
XhmikosR committed
2588
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2589

XhmikosR's avatar
XhmikosR committed
2590
2591
  _proto._getPopperConfig = function _getPopperConfig() {
    var popperConfig = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
      placement: this._getPlacement(),
      modifiers: {
        offset: this._getOffset(),
        flip: {
          enabled: this._config.flip
        },
        preventOverflow: {
          boundariesElement: this._config.boundary
        }
      } // Disable Popper.js if we have a static display

    };

    if (this._config.display === 'static') {
      popperConfig.modifiers.applyStyle = {
        enabled: false
      };
    }

XhmikosR's avatar
XhmikosR committed
2611
    return _objectSpread2({}, popperConfig, {}, this._config.popperConfig);
XhmikosR's avatar
Dist.  
XhmikosR committed
2612
  } // Static
XhmikosR's avatar
XhmikosR committed
2613
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2614

XhmikosR's avatar
XhmikosR committed
2615
  Dropdown.dropdownInterface = function dropdownInterface(element, config) {
XhmikosR's avatar
XhmikosR committed
2616
    var data = Data.getData(element, DATA_KEY$4);
XhmikosR's avatar
Dist.  
XhmikosR committed
2617

XhmikosR's avatar
XhmikosR committed
2618
    var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
2619
2620
2621
2622
2623
2624
2625

    if (!data) {
      data = new Dropdown(element, _config);
    }

    if (typeof config === 'string') {
      if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
2626
        throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
2627
2628
2629
2630
      }

      data[config]();
    }
XhmikosR's avatar
XhmikosR committed
2631
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2632

XhmikosR's avatar
XhmikosR committed
2633
  Dropdown.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2634
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
2635
      Dropdown.dropdownInterface(this, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2636
    });
XhmikosR's avatar
XhmikosR committed
2637
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2638

XhmikosR's avatar
XhmikosR committed
2639
  Dropdown.clearMenus = function clearMenus(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2640
2641
2642
2643
    if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2644
    var toggles = makeArray(SelectorEngine.find(Selector$4.DATA_TOGGLE));
XhmikosR's avatar
Dist.  
XhmikosR committed
2645

XhmikosR's avatar
XhmikosR committed
2646
    for (var i = 0, len = toggles.length; i < len; i++) {
XhmikosR's avatar
XhmikosR committed
2647
      var parent = Dropdown.getParentFromElement(toggles[i]);
XhmikosR's avatar
XhmikosR committed
2648
2649
      var context = Data.getData(toggles[i], DATA_KEY$4);
      var relatedTarget = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
        relatedTarget: toggles[i]
      };

      if (event && event.type === 'click') {
        relatedTarget.clickEvent = event;
      }

      if (!context) {
        continue;
      }

XhmikosR's avatar
XhmikosR committed
2661
      var dropdownMenu = context._menu;
XhmikosR's avatar
Dist.  
XhmikosR committed
2662
2663
2664
2665
2666
2667
2668
2669
2670

      if (!parent.classList.contains(ClassName$4.SHOW)) {
        continue;
      }

      if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && parent.contains(event.target)) {
        continue;
      }

XhmikosR's avatar
XhmikosR committed
2671
      var hideEvent = EventHandler.trigger(parent, Event$5.HIDE, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2672
2673
2674
2675
2676
2677
2678
2679

      if (hideEvent.defaultPrevented) {
        continue;
      } // If this is a touch-enabled device we remove the extra
      // empty mouseover listeners we added for iOS support


      if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
2680
2681
2682
        makeArray(document.body.children).forEach(function (elem) {
          return EventHandler.off(elem, 'mouseover', null, noop());
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
2683
2684
2685
      }

      toggles[i].setAttribute('aria-expanded', 'false');
XhmikosR's avatar
XhmikosR committed
2686
2687
2688
2689
2690

      if (context._popper) {
        context._popper.destroy();
      }

XhmikosR's avatar
Dist.  
XhmikosR committed
2691
2692
2693
2694
      dropdownMenu.classList.remove(ClassName$4.SHOW);
      parent.classList.remove(ClassName$4.SHOW);
      EventHandler.trigger(parent, Event$5.HIDDEN, relatedTarget);
    }
XhmikosR's avatar
XhmikosR committed
2695
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2696

XhmikosR's avatar
XhmikosR committed
2697
2698
  Dropdown.getParentFromElement = function getParentFromElement(element) {
    return getElementFromSelector(element) || element.parentNode;
XhmikosR's avatar
XhmikosR committed
2699
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2700

XhmikosR's avatar
XhmikosR committed
2701
  Dropdown.dataApiKeydownHandler = function dataApiKeydownHandler(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
    // 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 || SelectorEngine.closest(event.target, Selector$4.MENU)) : !REGEXP_KEYDOWN.test(event.which)) {
      return;
    }

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

    if (this.disabled || this.classList.contains(ClassName$4.DISABLED)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2720
    var parent = Dropdown.getParentFromElement(this);
XhmikosR's avatar
XhmikosR committed
2721
    var isActive = parent.classList.contains(ClassName$4.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
2722
2723
2724

    if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
      if (event.which === ESCAPE_KEYCODE) {
Mark Otto's avatar
dist v5    
Mark Otto committed
2725
        SelectorEngine.findOne(Selector$4.DATA_TOGGLE, parent).focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2726
2727
      }

XhmikosR's avatar
XhmikosR committed
2728
      Dropdown.clearMenus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2729
2730
2731
      return;
    }

XhmikosR's avatar
XhmikosR committed
2732
    var items = makeArray(SelectorEngine.find(Selector$4.VISIBLE_ITEMS, parent));
XhmikosR's avatar
Dist.  
XhmikosR committed
2733
2734
2735
2736
2737

    if (!items.length) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2738
    var index = items.indexOf(event.target);
XhmikosR's avatar
Dist.  
XhmikosR committed
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754

    if (event.which === ARROW_UP_KEYCODE && index > 0) {
      // Up
      index--;
    }

    if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
      // Down
      index++;
    }

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

    items[index].focus();
XhmikosR's avatar
XhmikosR committed
2755
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2756

XhmikosR's avatar
XhmikosR committed
2757
  Dropdown.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2758
    return Data.getData(element, DATA_KEY$4);
XhmikosR's avatar
XhmikosR committed
2759
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2760

XhmikosR's avatar
XhmikosR committed
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
  _createClass(Dropdown, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$4;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$2;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$2;
    }
  }]);

  return Dropdown;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
2780
2781
2782
2783
2784
2785
2786
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
2787
2788
2789
2790
EventHandler.on(document, Event$5.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown.dataApiKeydownHandler);
EventHandler.on(document, Event$5.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown.dataApiKeydownHandler);
EventHandler.on(document, Event$5.CLICK_DATA_API, Dropdown.clearMenus);
EventHandler.on(document, Event$5.KEYUP_DATA_API, Dropdown.clearMenus);
XhmikosR's avatar
Dist.  
XhmikosR committed
2791
2792
2793
EventHandler.on(document, Event$5.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {
  event.preventDefault();
  event.stopPropagation();
XhmikosR's avatar
XhmikosR committed
2794
  Dropdown.dropdownInterface(this, 'toggle');
XhmikosR's avatar
Dist.  
XhmikosR committed
2795
});
XhmikosR's avatar
XhmikosR committed
2796
2797
2798
EventHandler.on(document, Event$5.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
  return e.stopPropagation();
});
XhmikosR's avatar
XhmikosR committed
2799
var $$5 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
2800
2801
2802
2803
2804
2805
2806
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .dropdown to jQuery only if jQuery is present
 */

2807
2808
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
2809
2810
2811
2812
if ($$5) {
  var JQUERY_NO_CONFLICT$4 = $$5.fn[NAME$4];
  $$5.fn[NAME$4] = Dropdown.jQueryInterface;
  $$5.fn[NAME$4].Constructor = Dropdown;
XhmikosR's avatar
Dist.  
XhmikosR committed
2813

XhmikosR's avatar
XhmikosR committed
2814
2815
2816
  $$5.fn[NAME$4].noConflict = function () {
    $$5.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
    return Dropdown.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
2817
2818
2819
2820
2821
2822
2823
2824
2825
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
2826
2827
2828
2829
2830
2831
var NAME$5 = 'modal';
var VERSION$5 = '4.3.1';
var DATA_KEY$5 = 'bs.modal';
var EVENT_KEY$5 = "." + DATA_KEY$5;
var DATA_API_KEY$5 = '.data-api';
var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
XhmikosR's avatar
Dist.  
XhmikosR committed
2832

XhmikosR's avatar
XhmikosR committed
2833
var Default$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2834
2835
2836
2837
2838
  backdrop: true,
  keyboard: true,
  focus: true,
  show: true
};
XhmikosR's avatar
XhmikosR committed
2839
var DefaultType$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2840
2841
2842
2843
2844
  backdrop: '(boolean|string)',
  keyboard: 'boolean',
  focus: 'boolean',
  show: 'boolean'
};
XhmikosR's avatar
XhmikosR committed
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
var Event$6 = {
  HIDE: "hide" + EVENT_KEY$5,
  HIDDEN: "hidden" + EVENT_KEY$5,
  SHOW: "show" + EVENT_KEY$5,
  SHOWN: "shown" + EVENT_KEY$5,
  FOCUSIN: "focusin" + EVENT_KEY$5,
  RESIZE: "resize" + EVENT_KEY$5,
  CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
  KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
  MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
  MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
  CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
XhmikosR's avatar
Dist.  
XhmikosR committed
2857
};
XhmikosR's avatar
XhmikosR committed
2858
var ClassName$5 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2859
2860
2861
2862
2863
2864
2865
  SCROLLABLE: 'modal-dialog-scrollable',
  SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  BACKDROP: 'modal-backdrop',
  OPEN: 'modal-open',
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
2866
var Selector$5 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
  DIALOG: '.modal-dialog',
  MODAL_BODY: '.modal-body',
  DATA_TOGGLE: '[data-toggle="modal"]',
  DATA_DISMISS: '[data-dismiss="modal"]',
  FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  STICKY_CONTENT: '.sticky-top'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
2881
2882
2883
2884
var Modal =
/*#__PURE__*/
function () {
  function Modal(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
    this._config = this._getConfig(config);
    this._element = element;
    this._dialog = SelectorEngine.findOne(Selector$5.DIALOG, element);
    this._backdrop = null;
    this._isShown = false;
    this._isBodyOverflowing = false;
    this._ignoreBackdropClick = false;
    this._isTransitioning = false;
    this._scrollbarWidth = 0;
    Data.setData(element, DATA_KEY$5, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
2898
  var _proto = Modal.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
2899

XhmikosR's avatar
XhmikosR committed
2900
2901
  // Public
  _proto.toggle = function toggle(relatedTarget) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2902
    return this._isShown ? this.hide() : this.show(relatedTarget);
XhmikosR's avatar
XhmikosR committed
2903
2904
2905
2906
  };

  _proto.show = function show(relatedTarget) {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2907
2908
2909
2910
2911
2912
2913
2914
2915

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

    if (this._element.classList.contains(ClassName$5.FADE)) {
      this._isTransitioning = true;
    }

XhmikosR's avatar
XhmikosR committed
2916
2917
    var showEvent = EventHandler.trigger(this._element, Event$6.SHOW, {
      relatedTarget: relatedTarget
XhmikosR's avatar
Dist.  
XhmikosR committed
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
    });

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

    this._isShown = true;

    this._checkScrollbar();

    this._setScrollbar();

    this._adjustDialog();

    this._setEscapeEvent();

    this._setResizeEvent();

XhmikosR's avatar
XhmikosR committed
2936
2937
2938
2939
2940
2941
2942
    EventHandler.on(this._element, Event$6.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
      return _this.hide(event);
    });
    EventHandler.on(this._dialog, Event$6.MOUSEDOWN_DISMISS, function () {
      EventHandler.one(_this._element, Event$6.MOUSEUP_DISMISS, function (event) {
        if (event.target === _this._element) {
          _this._ignoreBackdropClick = true;
XhmikosR's avatar
Dist.  
XhmikosR committed
2943
2944
2945
2946
        }
      });
    });

XhmikosR's avatar
XhmikosR committed
2947
2948
2949
2950
2951
2952
2953
    this._showBackdrop(function () {
      return _this._showElement(relatedTarget);
    });
  };

  _proto.hide = function hide(event) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2954
2955
2956
2957
2958
2959
2960
2961
2962

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

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

XhmikosR's avatar
XhmikosR committed
2963
    var hideEvent = EventHandler.trigger(this._element, Event$6.HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
2964

2965
    if (hideEvent.defaultPrevented) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2966
2967
2968
2969
2970
      return;
    }

    this._isShown = false;

XhmikosR's avatar
XhmikosR committed
2971
    var transition = this._element.classList.contains(ClassName$5.FADE);
XhmikosR's avatar
Dist.  
XhmikosR committed
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988

    if (transition) {
      this._isTransitioning = true;
    }

    this._setEscapeEvent();

    this._setResizeEvent();

    EventHandler.off(document, Event$6.FOCUSIN);

    this._element.classList.remove(ClassName$5.SHOW);

    EventHandler.off(this._element, Event$6.CLICK_DISMISS);
    EventHandler.off(this._dialog, Event$6.MOUSEDOWN_DISMISS);

    if (transition) {
XhmikosR's avatar
XhmikosR committed
2989
2990
2991
2992
      var transitionDuration = getTransitionDurationFromElement(this._element);
      EventHandler.one(this._element, TRANSITION_END, function (event) {
        return _this2._hideModal(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
2993
2994
2995
2996
      emulateTransitionEnd(this._element, transitionDuration);
    } else {
      this._hideModal();
    }
XhmikosR's avatar
XhmikosR committed
2997
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2998

XhmikosR's avatar
XhmikosR committed
2999
3000
3001
3002
  _proto.dispose = function dispose() {
    [window, this._element, this._dialog].forEach(function (htmlElement) {
      return EventHandler.off(htmlElement, EVENT_KEY$5);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
    /**
     * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
     * Do not move `document` in `htmlElements` array
     * It will remove `Event.CLICK_DATA_API` event that should remain
     */

    EventHandler.off(document, Event$6.FOCUSIN);
    Data.removeData(this._element, DATA_KEY$5);
    this._config = null;
    this._element = null;
    this._dialog = null;
    this._backdrop = null;
    this._isShown = null;
    this._isBodyOverflowing = null;
    this._ignoreBackdropClick = null;
    this._isTransitioning = null;
    this._scrollbarWidth = null;
XhmikosR's avatar
XhmikosR committed
3020
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3021

XhmikosR's avatar
XhmikosR committed
3022
  _proto.handleUpdate = function handleUpdate() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3023
3024
    this._adjustDialog();
  } // Private
XhmikosR's avatar
XhmikosR committed
3025
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3026

XhmikosR's avatar
XhmikosR committed
3027
  _proto._getConfig = function _getConfig(config) {
3028
    config = _objectSpread2({}, Default$3, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
3029
3030
    typeCheckConfig(NAME$5, config, DefaultType$3);
    return config;
XhmikosR's avatar
XhmikosR committed
3031
3032
3033
3034
  };

  _proto._showElement = function _showElement(relatedTarget) {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3035

XhmikosR's avatar
XhmikosR committed
3036
    var transition = this._element.classList.contains(ClassName$5.FADE);
XhmikosR's avatar
Dist.  
XhmikosR committed
3037

XhmikosR's avatar
XhmikosR committed
3038
3039
    var modalBody = SelectorEngine.findOne(Selector$5.MODAL_BODY, this._dialog);

XhmikosR's avatar
Dist.  
XhmikosR committed
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
    if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
      // Don't move modal's DOM position
      document.body.appendChild(this._element);
    }

    this._element.style.display = 'block';

    this._element.removeAttribute('aria-hidden');

    this._element.setAttribute('aria-modal', true);

XhmikosR's avatar
XhmikosR committed
3051
3052
    if (this._dialog.classList.contains(ClassName$5.SCROLLABLE) && modalBody) {
      modalBody.scrollTop = 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
    } else {
      this._element.scrollTop = 0;
    }

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

    this._element.classList.add(ClassName$5.SHOW);

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

XhmikosR's avatar
XhmikosR committed
3067
3068
3069
    var transitionComplete = function transitionComplete() {
      if (_this3._config.focus) {
        _this3._element.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3070
3071
      }

XhmikosR's avatar
XhmikosR committed
3072
3073
3074
      _this3._isTransitioning = false;
      EventHandler.trigger(_this3._element, Event$6.SHOWN, {
        relatedTarget: relatedTarget
XhmikosR's avatar
Dist.  
XhmikosR committed
3075
3076
3077
3078
      });
    };

    if (transition) {
XhmikosR's avatar
XhmikosR committed
3079
      var transitionDuration = getTransitionDurationFromElement(this._dialog);
XhmikosR's avatar
Dist.  
XhmikosR committed
3080
3081
3082
3083
3084
      EventHandler.one(this._dialog, TRANSITION_END, transitionComplete);
      emulateTransitionEnd(this._dialog, transitionDuration);
    } else {
      transitionComplete();
    }
XhmikosR's avatar
XhmikosR committed
3085
3086
3087
3088
  };

  _proto._enforceFocus = function _enforceFocus() {
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3089
3090
3091

    EventHandler.off(document, Event$6.FOCUSIN); // guard against infinite focus loop

XhmikosR's avatar
XhmikosR committed
3092
3093
3094
    EventHandler.on(document, Event$6.FOCUSIN, function (event) {
      if (document !== event.target && _this4._element !== event.target && !_this4._element.contains(event.target)) {
        _this4._element.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3095
3096
      }
    });
XhmikosR's avatar
XhmikosR committed
3097
3098
3099
3100
  };

  _proto._setEscapeEvent = function _setEscapeEvent() {
    var _this5 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3101
3102

    if (this._isShown && this._config.keyboard) {
XhmikosR's avatar
XhmikosR committed
3103
      EventHandler.on(this._element, Event$6.KEYDOWN_DISMISS, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3104
3105
        if (event.which === ESCAPE_KEYCODE$1) {
          event.preventDefault();
XhmikosR's avatar
XhmikosR committed
3106
3107

          _this5.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
3108
3109
        }
      });
3110
    } else {
XhmikosR's avatar
Dist.  
XhmikosR committed
3111
3112
      EventHandler.off(this._element, Event$6.KEYDOWN_DISMISS);
    }
XhmikosR's avatar
XhmikosR committed
3113
3114
3115
3116
  };

  _proto._setResizeEvent = function _setResizeEvent() {
    var _this6 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3117
3118

    if (this._isShown) {
3119
3120
      EventHandler.on(window, Event$6.RESIZE, function () {
        return _this6._adjustDialog();
XhmikosR's avatar
XhmikosR committed
3121
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
3122
3123
3124
    } else {
      EventHandler.off(window, Event$6.RESIZE);
    }
XhmikosR's avatar
XhmikosR committed
3125
3126
3127
3128
  };

  _proto._hideModal = function _hideModal() {
    var _this7 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3129
3130
3131
3132
3133
3134
3135
3136
3137

    this._element.style.display = 'none';

    this._element.setAttribute('aria-hidden', true);

    this._element.removeAttribute('aria-modal');

    this._isTransitioning = false;

XhmikosR's avatar
XhmikosR committed
3138
    this._showBackdrop(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
3139
3140
      document.body.classList.remove(ClassName$5.OPEN);

XhmikosR's avatar
XhmikosR committed
3141
      _this7._resetAdjustments();
XhmikosR's avatar
Dist.  
XhmikosR committed
3142

XhmikosR's avatar
XhmikosR committed
3143
      _this7._resetScrollbar();
XhmikosR's avatar
Dist.  
XhmikosR committed
3144

XhmikosR's avatar
XhmikosR committed
3145
      EventHandler.trigger(_this7._element, Event$6.HIDDEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3146
    });
XhmikosR's avatar
XhmikosR committed
3147
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3148

XhmikosR's avatar
XhmikosR committed
3149
  _proto._removeBackdrop = function _removeBackdrop() {
3150
    this._backdrop.parentNode.removeChild(this._backdrop);
XhmikosR's avatar
Dist.  
XhmikosR committed
3151

3152
    this._backdrop = null;
XhmikosR's avatar
XhmikosR committed
3153
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3154

XhmikosR's avatar
XhmikosR committed
3155
3156
3157
3158
  _proto._showBackdrop = function _showBackdrop(callback) {
    var _this8 = this;

    var animate = this._element.classList.contains(ClassName$5.FADE) ? ClassName$5.FADE : '';
XhmikosR's avatar
Dist.  
XhmikosR committed
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168

    if (this._isShown && this._config.backdrop) {
      this._backdrop = document.createElement('div');
      this._backdrop.className = ClassName$5.BACKDROP;

      if (animate) {
        this._backdrop.classList.add(animate);
      }

      document.body.appendChild(this._backdrop);
XhmikosR's avatar
XhmikosR committed
3169
3170
3171
      EventHandler.on(this._element, Event$6.CLICK_DISMISS, function (event) {
        if (_this8._ignoreBackdropClick) {
          _this8._ignoreBackdropClick = false;
XhmikosR's avatar
Dist.  
XhmikosR committed
3172
3173
3174
3175
3176
3177
3178
          return;
        }

        if (event.target !== event.currentTarget) {
          return;
        }

XhmikosR's avatar
XhmikosR committed
3179
3180
        if (_this8._config.backdrop === 'static') {
          _this8._element.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3181
        } else {
XhmikosR's avatar
XhmikosR committed
3182
          _this8.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
        }
      });

      if (animate) {
        reflow(this._backdrop);
      }

      this._backdrop.classList.add(ClassName$5.SHOW);

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

XhmikosR's avatar
XhmikosR committed
3197
      var backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);
XhmikosR's avatar
Dist.  
XhmikosR committed
3198
3199
3200
3201
3202
      EventHandler.one(this._backdrop, TRANSITION_END, callback);
      emulateTransitionEnd(this._backdrop, backdropTransitionDuration);
    } else if (!this._isShown && this._backdrop) {
      this._backdrop.classList.remove(ClassName$5.SHOW);

XhmikosR's avatar
XhmikosR committed
3203
3204
      var callbackRemove = function callbackRemove() {
        _this8._removeBackdrop();
XhmikosR's avatar
Dist.  
XhmikosR committed
3205

3206
        callback();
XhmikosR's avatar
Dist.  
XhmikosR committed
3207
3208
3209
      };

      if (this._element.classList.contains(ClassName$5.FADE)) {
XhmikosR's avatar
XhmikosR committed
3210
3211
        var _backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);

XhmikosR's avatar
Dist.  
XhmikosR committed
3212
        EventHandler.one(this._backdrop, TRANSITION_END, callbackRemove);
XhmikosR's avatar
XhmikosR committed
3213
        emulateTransitionEnd(this._backdrop, _backdropTransitionDuration);
XhmikosR's avatar
Dist.  
XhmikosR committed
3214
3215
3216
      } else {
        callbackRemove();
      }
3217
    } else {
XhmikosR's avatar
Dist.  
XhmikosR committed
3218
3219
3220
3221
3222
      callback();
    }
  } // ----------------------------------------------------------------------
  // the following methods are used to handle overflowing modals
  // ----------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
3223
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3224

XhmikosR's avatar
XhmikosR committed
3225
3226
  _proto._adjustDialog = function _adjustDialog() {
    var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
XhmikosR's avatar
Dist.  
XhmikosR committed
3227
3228

    if (!this._isBodyOverflowing && isModalOverflowing) {
XhmikosR's avatar
XhmikosR committed
3229
      this._element.style.paddingLeft = this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3230
3231
3232
    }

    if (this._isBodyOverflowing && !isModalOverflowing) {
XhmikosR's avatar
XhmikosR committed
3233
      this._element.style.paddingRight = this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3234
    }
XhmikosR's avatar
XhmikosR committed
3235
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3236

XhmikosR's avatar
XhmikosR committed
3237
  _proto._resetAdjustments = function _resetAdjustments() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3238
3239
    this._element.style.paddingLeft = '';
    this._element.style.paddingRight = '';
XhmikosR's avatar
XhmikosR committed
3240
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3241

XhmikosR's avatar
XhmikosR committed
3242
3243
  _proto._checkScrollbar = function _checkScrollbar() {
    var rect = document.body.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
3244
3245
    this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
    this._scrollbarWidth = this._getScrollbarWidth();
XhmikosR's avatar
XhmikosR committed
3246
3247
3248
3249
  };

  _proto._setScrollbar = function _setScrollbar() {
    var _this9 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3250
3251
3252
3253
3254

    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
XhmikosR's avatar
XhmikosR committed
3255
3256
3257
      makeArray(SelectorEngine.find(Selector$5.FIXED_CONTENT)).forEach(function (element) {
        var actualPadding = element.style.paddingRight;
        var calculatedPadding = window.getComputedStyle(element)['padding-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3258
        Manipulator.setDataAttribute(element, 'padding-right', actualPadding);
XhmikosR's avatar
XhmikosR committed
3259
        element.style.paddingRight = parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3260
3261
      }); // Adjust sticky content margin

XhmikosR's avatar
XhmikosR committed
3262
3263
3264
      makeArray(SelectorEngine.find(Selector$5.STICKY_CONTENT)).forEach(function (element) {
        var actualMargin = element.style.marginRight;
        var calculatedMargin = window.getComputedStyle(element)['margin-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3265
        Manipulator.setDataAttribute(element, 'margin-right', actualMargin);
XhmikosR's avatar
XhmikosR committed
3266
        element.style.marginRight = parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3267
3268
      }); // Adjust body padding

XhmikosR's avatar
XhmikosR committed
3269
3270
      var actualPadding = document.body.style.paddingRight;
      var calculatedPadding = window.getComputedStyle(document.body)['padding-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3271
      Manipulator.setDataAttribute(document.body, 'padding-right', actualPadding);
XhmikosR's avatar
XhmikosR committed
3272
      document.body.style.paddingRight = parseFloat(calculatedPadding) + this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3273
3274
3275
    }

    document.body.classList.add(ClassName$5.OPEN);
XhmikosR's avatar
XhmikosR committed
3276
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3277

XhmikosR's avatar
XhmikosR committed
3278
  _proto._resetScrollbar = function _resetScrollbar() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3279
    // Restore fixed content padding
XhmikosR's avatar
XhmikosR committed
3280
3281
    makeArray(SelectorEngine.find(Selector$5.FIXED_CONTENT)).forEach(function (element) {
      var padding = Manipulator.getDataAttribute(element, 'padding-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3282
3283
3284
3285
3286
3287
3288

      if (typeof padding !== 'undefined') {
        Manipulator.removeDataAttribute(element, 'padding-right');
        element.style.paddingRight = padding;
      }
    }); // Restore sticky content and navbar-toggler margin

XhmikosR's avatar
XhmikosR committed
3289
3290
    makeArray(SelectorEngine.find("" + Selector$5.STICKY_CONTENT)).forEach(function (element) {
      var margin = Manipulator.getDataAttribute(element, 'margin-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3291
3292
3293
3294
3295
3296
3297

      if (typeof margin !== 'undefined') {
        Manipulator.removeDataAttribute(element, 'margin-right');
        element.style.marginRight = margin;
      }
    }); // Restore body padding

XhmikosR's avatar
XhmikosR committed
3298
    var padding = Manipulator.getDataAttribute(document.body, 'padding-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3299
3300
3301
3302
3303
3304
3305

    if (typeof padding === 'undefined') {
      document.body.style.paddingRight = '';
    } else {
      Manipulator.removeDataAttribute(document.body, 'padding-right');
      document.body.style.paddingRight = padding;
    }
XhmikosR's avatar
XhmikosR committed
3306
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3307

XhmikosR's avatar
XhmikosR committed
3308
  _proto._getScrollbarWidth = function _getScrollbarWidth() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3309
    // thx d.walsh
XhmikosR's avatar
XhmikosR committed
3310
    var scrollDiv = document.createElement('div');
XhmikosR's avatar
Dist.  
XhmikosR committed
3311
3312
    scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
    document.body.appendChild(scrollDiv);
XhmikosR's avatar
XhmikosR committed
3313
    var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
XhmikosR's avatar
Dist.  
XhmikosR committed
3314
3315
3316
    document.body.removeChild(scrollDiv);
    return scrollbarWidth;
  } // Static
XhmikosR's avatar
XhmikosR committed
3317
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3318

XhmikosR's avatar
XhmikosR committed
3319
  Modal.jQueryInterface = function jQueryInterface(config, relatedTarget) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3320
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
3321
      var data = Data.getData(this, DATA_KEY$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
3322

3323
      var _config = _objectSpread2({}, Default$3, {}, Manipulator.getDataAttributes(this), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
3324
3325
3326
3327
3328
3329
3330

      if (!data) {
        data = new Modal(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
3331
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
3332
3333
3334
3335
3336
3337
3338
        }

        data[config](relatedTarget);
      } else if (_config.show) {
        data.show(relatedTarget);
      }
    });
XhmikosR's avatar
XhmikosR committed
3339
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3340

XhmikosR's avatar
XhmikosR committed
3341
  Modal.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3342
    return Data.getData(element, DATA_KEY$5);
XhmikosR's avatar
XhmikosR committed
3343
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3344

XhmikosR's avatar
XhmikosR committed
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
  _createClass(Modal, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$5;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$3;
    }
  }]);

  return Modal;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
3359
3360
3361
3362
3363
3364
3365
3366
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


EventHandler.on(document, Event$6.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
XhmikosR's avatar
XhmikosR committed
3367
3368
  var _this10 = this;

XhmikosR's avatar
XhmikosR committed
3369
  var target = getElementFromSelector(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
3370
3371
3372
3373
3374

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

XhmikosR's avatar
XhmikosR committed
3375
  EventHandler.one(target, Event$6.SHOW, function (showEvent) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3376
3377
3378
3379
3380
    if (showEvent.defaultPrevented) {
      // only register focus restorer if modal will actually get shown
      return;
    }

XhmikosR's avatar
XhmikosR committed
3381
3382
3383
    EventHandler.one(target, Event$6.HIDDEN, function () {
      if (isVisible(_this10)) {
        _this10.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3384
3385
3386
      }
    });
  });
XhmikosR's avatar
XhmikosR committed
3387
  var data = Data.getData(target, DATA_KEY$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
3388
3389

  if (!data) {
3390
3391
    var config = _objectSpread2({}, Manipulator.getDataAttributes(target), {}, Manipulator.getDataAttributes(this));

XhmikosR's avatar
Dist.  
XhmikosR committed
3392
3393
3394
3395
3396
    data = new Modal(target, config);
  }

  data.show(this);
});
XhmikosR's avatar
XhmikosR committed
3397
var $$6 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
3398
3399
3400
3401
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
3402
 * add .modal to jQuery only if jQuery is present
XhmikosR's avatar
Dist.  
XhmikosR committed
3403
3404
 */

3405
3406
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
3407
3408
3409
3410
if ($$6) {
  var JQUERY_NO_CONFLICT$5 = $$6.fn[NAME$5];
  $$6.fn[NAME$5] = Modal.jQueryInterface;
  $$6.fn[NAME$5].Constructor = Modal;
XhmikosR's avatar
Dist.  
XhmikosR committed
3411

XhmikosR's avatar
XhmikosR committed
3412
3413
3414
  $$6.fn[NAME$5].noConflict = function () {
    $$6.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
    return Modal.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
3415
3416
3417
3418
3419
3420
3421
3422
3423
  };
}

/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): util/sanitizer.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
XhmikosR's avatar
XhmikosR committed
3424
3425
var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
XhmikosR's avatar
Dist.  
XhmikosR committed
3426
3427
3428
3429
3430
3431
/**
 * A pattern that recognizes a commonly useful subset of URLs that are safe.
 *
 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
 */

XhmikosR's avatar
XhmikosR committed
3432
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
XhmikosR's avatar
Dist.  
XhmikosR committed
3433
3434
3435
3436
3437
3438
/**
 * A pattern that matches safe data URLs. Only matches image, video and audio types.
 *
 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
 */

XhmikosR's avatar
XhmikosR committed
3439
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
XhmikosR's avatar
Dist.  
XhmikosR committed
3440

XhmikosR's avatar
XhmikosR committed
3441
3442
var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
  var attrName = attr.nodeName.toLowerCase();
XhmikosR's avatar
Dist.  
XhmikosR committed
3443
3444
3445
3446
3447
3448
3449
3450
3451

  if (allowedAttributeList.indexOf(attrName) !== -1) {
    if (uriAttrs.indexOf(attrName) !== -1) {
      return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
    }

    return true;
  }

XhmikosR's avatar
XhmikosR committed
3452
3453
3454
  var regExp = allowedAttributeList.filter(function (attrRegex) {
    return attrRegex instanceof RegExp;
  }); // Check if a regular expression validates the attribute.
XhmikosR's avatar
Dist.  
XhmikosR committed
3455

XhmikosR's avatar
XhmikosR committed
3456
  for (var i = 0, l = regExp.length; i < l; i++) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3457
3458
3459
3460
3461
3462
3463
3464
    if (attrName.match(regExp[i])) {
      return true;
    }
  }

  return false;
};

XhmikosR's avatar
XhmikosR committed
3465
var DefaultWhitelist = {
XhmikosR's avatar
Dist.  
XhmikosR committed
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
  // Global attributes allowed on any supplied element below.
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  a: ['target', 'href', 'title', 'rel'],
  area: [],
  b: [],
  br: [],
  col: [],
  code: [],
  div: [],
  em: [],
  hr: [],
  h1: [],
  h2: [],
  h3: [],
  h4: [],
  h5: [],
  h6: [],
  i: [],
  img: ['src', 'alt', 'title', 'width', 'height'],
  li: [],
  ol: [],
  p: [],
  pre: [],
  s: [],
  small: [],
  span: [],
  sub: [],
  sup: [],
  strong: [],
  u: [],
  ul: []
};
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  if (!unsafeHtml.length) {
    return unsafeHtml;
  }

  if (sanitizeFn && typeof sanitizeFn === 'function') {
    return sanitizeFn(unsafeHtml);
  }

XhmikosR's avatar
XhmikosR committed
3507
3508
3509
3510
  var domParser = new window.DOMParser();
  var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  var whitelistKeys = Object.keys(whiteList);
  var elements = makeArray(createdDocument.body.querySelectorAll('*'));
XhmikosR's avatar
Dist.  
XhmikosR committed
3511

XhmikosR's avatar
XhmikosR committed
3512
3513
3514
  var _loop = function _loop(i, len) {
    var el = elements[i];
    var elName = el.nodeName.toLowerCase();
XhmikosR's avatar
Dist.  
XhmikosR committed
3515
3516
3517

    if (whitelistKeys.indexOf(elName) === -1) {
      el.parentNode.removeChild(el);
XhmikosR's avatar
XhmikosR committed
3518
      return "continue";
XhmikosR's avatar
Dist.  
XhmikosR committed
3519
3520
    }

XhmikosR's avatar
XhmikosR committed
3521
3522
3523
    var attributeList = makeArray(el.attributes);
    var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
    attributeList.forEach(function (attr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3524
3525
3526
3527
      if (!allowedAttribute(attr, whitelistedAttributes)) {
        el.removeAttribute(attr.nodeName);
      }
    });
XhmikosR's avatar
XhmikosR committed
3528
3529
3530
  };

  for (var i = 0, len = elements.length; i < len; i++) {
3531
    var _ret = _loop(i);
XhmikosR's avatar
XhmikosR committed
3532
3533

    if (_ret === "continue") continue;
XhmikosR's avatar
Dist.  
XhmikosR committed
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
  }

  return createdDocument.body.innerHTML;
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
3545
3546
3547
3548
3549
3550
3551
3552
var NAME$6 = 'tooltip';
var VERSION$6 = '4.3.1';
var DATA_KEY$6 = 'bs.tooltip';
var EVENT_KEY$6 = "." + DATA_KEY$6;
var CLASS_PREFIX = 'bs-tooltip';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
var DefaultType$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
  animation: 'boolean',
  template: 'string',
  title: '(string|element|function)',
  trigger: 'string',
  delay: '(number|object)',
  html: 'boolean',
  selector: '(string|boolean)',
  placement: '(string|function)',
  offset: '(number|string|function)',
  container: '(string|element|boolean)',
  fallbackPlacement: '(string|array)',
  boundary: '(string|element)',
  sanitize: 'boolean',
  sanitizeFn: '(null|function)',
XhmikosR's avatar
XhmikosR committed
3567
3568
  whiteList: 'object',
  popperConfig: '(null|object)'
XhmikosR's avatar
Dist.  
XhmikosR committed
3569
};
XhmikosR's avatar
XhmikosR committed
3570
var AttachmentMap$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3571
3572
3573
3574
3575
3576
  AUTO: 'auto',
  TOP: 'top',
  RIGHT: 'right',
  BOTTOM: 'bottom',
  LEFT: 'left'
};
XhmikosR's avatar
XhmikosR committed
3577
var Default$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
  animation: true,
  template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  trigger: 'hover focus',
  title: '',
  delay: 0,
  html: false,
  selector: false,
  placement: 'top',
  offset: 0,
  container: false,
  fallbackPlacement: 'flip',
  boundary: 'scrollParent',
  sanitize: true,
  sanitizeFn: null,
XhmikosR's avatar
XhmikosR committed
3592
3593
  whiteList: DefaultWhitelist,
  popperConfig: null
XhmikosR's avatar
Dist.  
XhmikosR committed
3594
};
XhmikosR's avatar
XhmikosR committed
3595
var HoverState = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3596
3597
3598
  SHOW: 'show',
  OUT: 'out'
};
XhmikosR's avatar
XhmikosR committed
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
var Event$7 = {
  HIDE: "hide" + EVENT_KEY$6,
  HIDDEN: "hidden" + EVENT_KEY$6,
  SHOW: "show" + EVENT_KEY$6,
  SHOWN: "shown" + EVENT_KEY$6,
  INSERTED: "inserted" + EVENT_KEY$6,
  CLICK: "click" + EVENT_KEY$6,
  FOCUSIN: "focusin" + EVENT_KEY$6,
  FOCUSOUT: "focusout" + EVENT_KEY$6,
  MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  MOUSELEAVE: "mouseleave" + EVENT_KEY$6
XhmikosR's avatar
Dist.  
XhmikosR committed
3610
};
XhmikosR's avatar
XhmikosR committed
3611
var ClassName$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3612
3613
3614
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
3615
var Selector$6 = {
Mark Otto's avatar
dist v5    
Mark Otto committed
3616
  TOOLTIP_INNER: '.tooltip-inner'
XhmikosR's avatar
Dist.  
XhmikosR committed
3617
};
XhmikosR's avatar
XhmikosR committed
3618
var Trigger = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
  HOVER: 'hover',
  FOCUS: 'focus',
  CLICK: 'click',
  MANUAL: 'manual'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
3631
3632
3633
3634
var Tooltip =
/*#__PURE__*/
function () {
  function Tooltip(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
    if (typeof Popper === 'undefined') {
      throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)');
    } // private


    this._isEnabled = true;
    this._timeout = 0;
    this._hoverState = '';
    this._activeTrigger = {};
    this._popper = null; // Protected

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

    this._setListeners();

    Data.setData(element, this.constructor.DATA_KEY, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
3656
  var _proto = Tooltip.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
3657

XhmikosR's avatar
XhmikosR committed
3658
3659
  // Public
  _proto.enable = function enable() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3660
    this._isEnabled = true;
XhmikosR's avatar
XhmikosR committed
3661
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3662

XhmikosR's avatar
XhmikosR committed
3663
  _proto.disable = function disable() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3664
    this._isEnabled = false;
XhmikosR's avatar
XhmikosR committed
3665
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3666

XhmikosR's avatar
XhmikosR committed
3667
  _proto.toggleEnabled = function toggleEnabled() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3668
    this._isEnabled = !this._isEnabled;
XhmikosR's avatar
XhmikosR committed
3669
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3670

XhmikosR's avatar
XhmikosR committed
3671
  _proto.toggle = function toggle(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3672
3673
3674
3675
3676
    if (!this._isEnabled) {
      return;
    }

    if (event) {
XhmikosR's avatar
XhmikosR committed
3677
3678
      var dataKey = this.constructor.DATA_KEY;
      var context = Data.getData(event.delegateTarget, dataKey);
XhmikosR's avatar
Dist.  
XhmikosR committed
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700

      if (!context) {
        context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
        Data.setData(event.delegateTarget, dataKey, context);
      }

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

      if (context._isWithActiveTrigger()) {
        context._enter(null, context);
      } else {
        context._leave(null, context);
      }
    } else {
      if (this.getTipElement().classList.contains(ClassName$6.SHOW)) {
        this._leave(null, this);

        return;
      }

      this._enter(null, this);
    }
XhmikosR's avatar
XhmikosR committed
3701
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3702

XhmikosR's avatar
XhmikosR committed
3703
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3704
3705
3706
    clearTimeout(this._timeout);
    Data.removeData(this.element, this.constructor.DATA_KEY);
    EventHandler.off(this.element, this.constructor.EVENT_KEY);
Mark Otto's avatar
dist v5    
Mark Otto committed
3707
    EventHandler.off(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler);
XhmikosR's avatar
Dist.  
XhmikosR committed
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717

    if (this.tip) {
      this.tip.parentNode.removeChild(this.tip);
    }

    this._isEnabled = null;
    this._timeout = null;
    this._hoverState = null;
    this._activeTrigger = null;

XhmikosR's avatar
XhmikosR committed
3718
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3719
3720
3721
3722
3723
3724
3725
      this._popper.destroy();
    }

    this._popper = null;
    this.element = null;
    this.config = null;
    this.tip = null;
XhmikosR's avatar
XhmikosR committed
3726
3727
3728
3729
  };

  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3730
3731
3732
3733
3734
3735

    if (this.element.style.display === 'none') {
      throw new Error('Please use show on visible elements');
    }

    if (this.isWithContent() && this._isEnabled) {
XhmikosR's avatar
XhmikosR committed
3736
3737
3738
      var showEvent = EventHandler.trigger(this.element, this.constructor.Event.SHOW);
      var shadowRoot = findShadowRoot(this.element);
      var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
XhmikosR's avatar
Dist.  
XhmikosR committed
3739
3740
3741
3742
3743

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

XhmikosR's avatar
XhmikosR committed
3744
3745
      var tip = this.getTipElement();
      var tipId = getUID(this.constructor.NAME);
XhmikosR's avatar
Dist.  
XhmikosR committed
3746
3747
3748
3749
3750
3751
3752
3753
      tip.setAttribute('id', tipId);
      this.element.setAttribute('aria-describedby', tipId);
      this.setContent();

      if (this.config.animation) {
        tip.classList.add(ClassName$6.FADE);
      }

XhmikosR's avatar
XhmikosR committed
3754
      var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
XhmikosR's avatar
Dist.  
XhmikosR committed
3755

XhmikosR's avatar
XhmikosR committed
3756
      var attachment = this._getAttachment(placement);
XhmikosR's avatar
Dist.  
XhmikosR committed
3757

3758
      this._addAttachmentClass(attachment);
XhmikosR's avatar
Dist.  
XhmikosR committed
3759

XhmikosR's avatar
XhmikosR committed
3760
      var container = this._getContainer();
XhmikosR's avatar
Dist.  
XhmikosR committed
3761
3762
3763
3764
3765
3766
3767
3768

      Data.setData(tip, this.constructor.DATA_KEY, this);

      if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
        container.appendChild(tip);
      }

      EventHandler.trigger(this.element, this.constructor.Event.INSERTED);
XhmikosR's avatar
XhmikosR committed
3769
      this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
XhmikosR's avatar
Dist.  
XhmikosR committed
3770
3771
3772
3773
3774
3775
      tip.classList.add(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
      // empty mouseover listeners to the body's immediate children;
      // only needed because of broken event delegation on iOS
      // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html

      if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
3776
        makeArray(document.body.children).forEach(function (element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3777
3778
3779
3780
          EventHandler.on(element, 'mouseover', noop());
        });
      }

XhmikosR's avatar
XhmikosR committed
3781
3782
3783
      var complete = function complete() {
        if (_this.config.animation) {
          _this._fixTransition();
XhmikosR's avatar
Dist.  
XhmikosR committed
3784
3785
        }

XhmikosR's avatar
XhmikosR committed
3786
3787
3788
        var prevHoverState = _this._hoverState;
        _this._hoverState = null;
        EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3789
3790

        if (prevHoverState === HoverState.OUT) {
XhmikosR's avatar
XhmikosR committed
3791
          _this._leave(null, _this);
XhmikosR's avatar
Dist.  
XhmikosR committed
3792
3793
3794
3795
        }
      };

      if (this.tip.classList.contains(ClassName$6.FADE)) {
XhmikosR's avatar
XhmikosR committed
3796
        var transitionDuration = getTransitionDurationFromElement(this.tip);
XhmikosR's avatar
Dist.  
XhmikosR committed
3797
3798
3799
3800
3801
3802
        EventHandler.one(this.tip, TRANSITION_END, complete);
        emulateTransitionEnd(this.tip, transitionDuration);
      } else {
        complete();
      }
    }
XhmikosR's avatar
XhmikosR committed
3803
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3804

3805
  _proto.hide = function hide() {
XhmikosR's avatar
XhmikosR committed
3806
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3807

XhmikosR's avatar
XhmikosR committed
3808
3809
3810
3811
    var tip = this.getTipElement();

    var complete = function complete() {
      if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3812
3813
3814
        tip.parentNode.removeChild(tip);
      }

XhmikosR's avatar
XhmikosR committed
3815
3816
3817
      _this2._cleanTipClass();

      _this2.element.removeAttribute('aria-describedby');
XhmikosR's avatar
Dist.  
XhmikosR committed
3818

XhmikosR's avatar
XhmikosR committed
3819
      EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3820

3821
      _this2._popper.destroy();
XhmikosR's avatar
Dist.  
XhmikosR committed
3822
3823
    };

XhmikosR's avatar
XhmikosR committed
3824
    var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
3825
3826
3827
3828
3829
3830
3831
3832
3833

    if (hideEvent.defaultPrevented) {
      return;
    }

    tip.classList.remove(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
    // empty mouseover listeners we added for iOS support

    if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
3834
3835
3836
      makeArray(document.body.children).forEach(function (element) {
        return EventHandler.off(element, 'mouseover', noop);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
3837
3838
3839
3840
3841
3842
3843
    }

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

    if (this.tip.classList.contains(ClassName$6.FADE)) {
XhmikosR's avatar
XhmikosR committed
3844
      var transitionDuration = getTransitionDurationFromElement(tip);
XhmikosR's avatar
Dist.  
XhmikosR committed
3845
3846
3847
3848
3849
3850
3851
      EventHandler.one(tip, TRANSITION_END, complete);
      emulateTransitionEnd(tip, transitionDuration);
    } else {
      complete();
    }

    this._hoverState = '';
XhmikosR's avatar
XhmikosR committed
3852
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3853

XhmikosR's avatar
XhmikosR committed
3854
  _proto.update = function update() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3855
3856
3857
3858
    if (this._popper !== null) {
      this._popper.scheduleUpdate();
    }
  } // Protected
XhmikosR's avatar
XhmikosR committed
3859
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3860

XhmikosR's avatar
XhmikosR committed
3861
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3862
    return Boolean(this.getTitle());
XhmikosR's avatar
XhmikosR committed
3863
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3864

XhmikosR's avatar
XhmikosR committed
3865
  _proto.getTipElement = function getTipElement() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3866
3867
3868
3869
    if (this.tip) {
      return this.tip;
    }

XhmikosR's avatar
XhmikosR committed
3870
    var element = document.createElement('div');
XhmikosR's avatar
Dist.  
XhmikosR committed
3871
3872
3873
    element.innerHTML = this.config.template;
    this.tip = element.children[0];
    return this.tip;
XhmikosR's avatar
XhmikosR committed
3874
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3875

XhmikosR's avatar
XhmikosR committed
3876
3877
  _proto.setContent = function setContent() {
    var tip = this.getTipElement();
XhmikosR's avatar
Dist.  
XhmikosR committed
3878
3879
3880
    this.setElementContent(SelectorEngine.findOne(Selector$6.TOOLTIP_INNER, tip), this.getTitle());
    tip.classList.remove(ClassName$6.FADE);
    tip.classList.remove(ClassName$6.SHOW);
XhmikosR's avatar
XhmikosR committed
3881
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3882

XhmikosR's avatar
XhmikosR committed
3883
  _proto.setElementContent = function setElementContent(element, content) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3884
3885
3886
3887
    if (element === null) {
      return;
    }

3888
    if (typeof content === 'object' && isElement(content)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
      if (content.jquery) {
        content = content[0];
      } // content is a DOM node or a jQuery


      if (this.config.html) {
        if (content.parentNode !== element) {
          element.innerHTML = '';
          element.appendChild(content);
        }
      } else {
        element.innerText = content.textContent;
      }

      return;
    }

    if (this.config.html) {
      if (this.config.sanitize) {
        content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
      }

      element.innerHTML = content;
    } else {
      element.innerText = content;
    }
XhmikosR's avatar
XhmikosR committed
3915
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3916

XhmikosR's avatar
XhmikosR committed
3917
3918
  _proto.getTitle = function getTitle() {
    var title = this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
3919
3920
3921
3922
3923
3924
3925

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

    return title;
  } // Private
XhmikosR's avatar
XhmikosR committed
3926
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3927

XhmikosR's avatar
XhmikosR committed
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
  _proto._getPopperConfig = function _getPopperConfig(attachment) {
    var _this3 = this;

    var defaultBsConfig = {
      placement: attachment,
      modifiers: {
        offset: this._getOffset(),
        flip: {
          behavior: this.config.fallbackPlacement
        },
        arrow: {
          element: "." + this.constructor.NAME + "-arrow"
        },
        preventOverflow: {
          boundariesElement: this.config.boundary
        }
      },
      onCreate: function onCreate(data) {
        if (data.originalPlacement !== data.placement) {
          _this3._handlePopperPlacementChange(data);
        }
      },
      onUpdate: function onUpdate(data) {
        return _this3._handlePopperPlacementChange(data);
      }
    };
    return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);
  };

3957
3958
3959
3960
  _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
    this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment);
  };

XhmikosR's avatar
XhmikosR committed
3961
  _proto._getOffset = function _getOffset() {
XhmikosR's avatar
XhmikosR committed
3962
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3963

XhmikosR's avatar
XhmikosR committed
3964
    var offset = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
3965
3966

    if (typeof this.config.offset === 'function') {
XhmikosR's avatar
XhmikosR committed
3967
      offset.fn = function (data) {
XhmikosR's avatar
XhmikosR committed
3968
        data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
XhmikosR's avatar
Dist.  
XhmikosR committed
3969
3970
3971
3972
3973
3974
3975
        return data;
      };
    } else {
      offset.offset = this.config.offset;
    }

    return offset;
XhmikosR's avatar
XhmikosR committed
3976
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3977

XhmikosR's avatar
XhmikosR committed
3978
  _proto._getContainer = function _getContainer() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3979
3980
3981
3982
3983
3984
3985
3986
3987
    if (this.config.container === false) {
      return document.body;
    }

    if (isElement(this.config.container)) {
      return this.config.container;
    }

    return SelectorEngine.findOne(this.config.container);
XhmikosR's avatar
XhmikosR committed
3988
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3989

XhmikosR's avatar
XhmikosR committed
3990
  _proto._getAttachment = function _getAttachment(placement) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3991
    return AttachmentMap$1[placement.toUpperCase()];
XhmikosR's avatar
XhmikosR committed
3992
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3993

XhmikosR's avatar
XhmikosR committed
3994
  _proto._setListeners = function _setListeners() {
XhmikosR's avatar
XhmikosR committed
3995
    var _this5 = this;
XhmikosR's avatar
XhmikosR committed
3996
3997
3998

    var triggers = this.config.trigger.split(' ');
    triggers.forEach(function (trigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3999
      if (trigger === 'click') {
XhmikosR's avatar
XhmikosR committed
4000
4001
        EventHandler.on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
          return _this5.toggle(event);
XhmikosR's avatar
XhmikosR committed
4002
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4003
      } else if (trigger !== Trigger.MANUAL) {
XhmikosR's avatar
XhmikosR committed
4004
4005
4006
4007
        var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
        var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
        EventHandler.on(_this5.element, eventIn, _this5.config.selector, function (event) {
          return _this5._enter(event);
XhmikosR's avatar
XhmikosR committed
4008
        });
XhmikosR's avatar
XhmikosR committed
4009
4010
        EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
          return _this5._leave(event);
XhmikosR's avatar
XhmikosR committed
4011
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4012
4013
      }
    });
Mark Otto's avatar
dist v5    
Mark Otto committed
4014
4015

    this._hideModalHandler = function () {
XhmikosR's avatar
XhmikosR committed
4016
4017
      if (_this5.element) {
        _this5.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
4018
      }
Mark Otto's avatar
dist v5    
Mark Otto committed
4019
4020
4021
    };

    EventHandler.on(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler);
XhmikosR's avatar
Dist.  
XhmikosR committed
4022
4023

    if (this.config.selector) {
4024
      this.config = _objectSpread2({}, this.config, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4025
4026
4027
4028
4029
4030
        trigger: 'manual',
        selector: ''
      });
    } else {
      this._fixTitle();
    }
XhmikosR's avatar
XhmikosR committed
4031
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4032

XhmikosR's avatar
XhmikosR committed
4033
4034
  _proto._fixTitle = function _fixTitle() {
    var titleType = typeof this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
4035
4036
4037
4038
4039

    if (this.element.getAttribute('title') || titleType !== 'string') {
      this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
      this.element.setAttribute('title', '');
    }
XhmikosR's avatar
XhmikosR committed
4040
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4041

XhmikosR's avatar
XhmikosR committed
4042
4043
  _proto._enter = function _enter(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
    context = context || Data.getData(event.delegateTarget, dataKey);

    if (!context) {
      context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
      Data.setData(event.delegateTarget, dataKey, context);
    }

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

    if (context.getTipElement().classList.contains(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
      context._hoverState = HoverState.SHOW;
      return;
    }

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

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

XhmikosR's avatar
XhmikosR committed
4068
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4069
4070
4071
4072
      if (context._hoverState === HoverState.SHOW) {
        context.show();
      }
    }, context.config.delay.show);
XhmikosR's avatar
XhmikosR committed
4073
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4074

XhmikosR's avatar
XhmikosR committed
4075
4076
  _proto._leave = function _leave(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
    context = context || Data.getData(event.delegateTarget, dataKey);

    if (!context) {
      context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
      Data.setData(event.delegateTarget, dataKey, context);
    }

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

XhmikosR's avatar
XhmikosR committed
4100
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4101
4102
4103
4104
      if (context._hoverState === HoverState.OUT) {
        context.hide();
      }
    }, context.config.delay.hide);
XhmikosR's avatar
XhmikosR committed
4105
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4106

XhmikosR's avatar
XhmikosR committed
4107
4108
  _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
    for (var trigger in this._activeTrigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4109
4110
4111
4112
4113
4114
      if (this._activeTrigger[trigger]) {
        return true;
      }
    }

    return false;
XhmikosR's avatar
XhmikosR committed
4115
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4116

XhmikosR's avatar
XhmikosR committed
4117
4118
4119
  _proto._getConfig = function _getConfig(config) {
    var dataAttributes = Manipulator.getDataAttributes(this.element);
    Object.keys(dataAttributes).forEach(function (dataAttr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4120
4121
4122
4123
4124
4125
4126
4127
4128
      if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
        delete dataAttributes[dataAttr];
      }
    });

    if (config && typeof config.container === 'object' && config.container.jquery) {
      config.container = config.container[0];
    }

4129
    config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152

    if (typeof config.delay === 'number') {
      config.delay = {
        show: config.delay,
        hide: config.delay
      };
    }

    if (typeof config.title === 'number') {
      config.title = config.title.toString();
    }

    if (typeof config.content === 'number') {
      config.content = config.content.toString();
    }

    typeCheckConfig(NAME$6, config, this.constructor.DefaultType);

    if (config.sanitize) {
      config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4153
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4154

XhmikosR's avatar
XhmikosR committed
4155
4156
  _proto._getDelegateConfig = function _getDelegateConfig() {
    var config = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
4157
4158

    if (this.config) {
XhmikosR's avatar
XhmikosR committed
4159
      for (var key in this.config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4160
4161
4162
4163
4164
4165
4166
        if (this.constructor.Default[key] !== this.config[key]) {
          config[key] = this.config[key];
        }
      }
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4167
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4168

XhmikosR's avatar
XhmikosR committed
4169
4170
4171
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
XhmikosR's avatar
Dist.  
XhmikosR committed
4172
4173

    if (tabClass !== null && tabClass.length) {
XhmikosR's avatar
XhmikosR committed
4174
4175
4176
4177
4178
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4179
    }
XhmikosR's avatar
XhmikosR committed
4180
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4181

XhmikosR's avatar
XhmikosR committed
4182
4183
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
    var popperInstance = popperData.instance;
XhmikosR's avatar
Dist.  
XhmikosR committed
4184
4185
4186
4187
    this.tip = popperInstance.popper;

    this._cleanTipClass();

4188
    this._addAttachmentClass(this._getAttachment(popperData.placement));
XhmikosR's avatar
XhmikosR committed
4189
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4190

XhmikosR's avatar
XhmikosR committed
4191
4192
4193
  _proto._fixTransition = function _fixTransition() {
    var tip = this.getTipElement();
    var initConfigAnimation = this.config.animation;
XhmikosR's avatar
Dist.  
XhmikosR committed
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204

    if (tip.getAttribute('x-placement') !== null) {
      return;
    }

    tip.classList.remove(ClassName$6.FADE);
    this.config.animation = false;
    this.hide();
    this.show();
    this.config.animation = initConfigAnimation;
  } // Static
XhmikosR's avatar
XhmikosR committed
4205
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4206

XhmikosR's avatar
XhmikosR committed
4207
  Tooltip.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4208
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4209
      var data = Data.getData(this, DATA_KEY$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
4210

XhmikosR's avatar
XhmikosR committed
4211
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222

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

      if (!data) {
        data = new Tooltip(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4223
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4224
4225
4226
4227
4228
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4229
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4230

XhmikosR's avatar
XhmikosR committed
4231
  Tooltip.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4232
    return Data.getData(element, DATA_KEY$6);
XhmikosR's avatar
XhmikosR committed
4233
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4234

XhmikosR's avatar
XhmikosR committed
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
  _createClass(Tooltip, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$6;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$4;
    }
  }, {
    key: "NAME",
    get: function get() {
      return NAME$6;
    }
  }, {
    key: "DATA_KEY",
    get: function get() {
      return DATA_KEY$6;
    }
  }, {
    key: "Event",
    get: function get() {
      return Event$7;
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$6;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$4;
    }
  }]);

  return Tooltip;
}();
XhmikosR's avatar
XhmikosR committed
4274
4275

var $$7 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4276
4277
4278
4279
4280
4281
4282
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tooltip to jQuery only if jQuery is present
 */

4283
4284
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4285
4286
4287
4288
if ($$7) {
  var JQUERY_NO_CONFLICT$6 = $$7.fn[NAME$6];
  $$7.fn[NAME$6] = Tooltip.jQueryInterface;
  $$7.fn[NAME$6].Constructor = Tooltip;
XhmikosR's avatar
Dist.  
XhmikosR committed
4289

XhmikosR's avatar
XhmikosR committed
4290
4291
4292
  $$7.fn[NAME$6].noConflict = function () {
    $$7.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
    return Tooltip.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4293
4294
4295
4296
4297
4298
4299
4300
4301
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4302
4303
4304
4305
4306
4307
var NAME$7 = 'popover';
var VERSION$7 = '4.3.1';
var DATA_KEY$7 = 'bs.popover';
var EVENT_KEY$7 = "." + DATA_KEY$7;
var CLASS_PREFIX$1 = 'bs-popover';
var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
XhmikosR's avatar
Dist.  
XhmikosR committed
4308

4309
var Default$5 = _objectSpread2({}, Tooltip.Default, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4310
4311
4312
4313
4314
4315
  placement: 'right',
  trigger: 'click',
  content: '',
  template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
});

4316
var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4317
4318
4319
  content: '(string|element|function)'
});

XhmikosR's avatar
XhmikosR committed
4320
var ClassName$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4321
4322
4323
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4324
var Selector$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4325
4326
4327
  TITLE: '.popover-header',
  CONTENT: '.popover-body'
};
XhmikosR's avatar
XhmikosR committed
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
var Event$8 = {
  HIDE: "hide" + EVENT_KEY$7,
  HIDDEN: "hidden" + EVENT_KEY$7,
  SHOW: "show" + EVENT_KEY$7,
  SHOWN: "shown" + EVENT_KEY$7,
  INSERTED: "inserted" + EVENT_KEY$7,
  CLICK: "click" + EVENT_KEY$7,
  FOCUSIN: "focusin" + EVENT_KEY$7,
  FOCUSOUT: "focusout" + EVENT_KEY$7,
  MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  MOUSELEAVE: "mouseleave" + EVENT_KEY$7
XhmikosR's avatar
Dist.  
XhmikosR committed
4339
4340
4341
4342
4343
4344
4345
4346
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
4347
4348
4349
4350
var Popover =
/*#__PURE__*/
function (_Tooltip) {
  _inheritsLoose(Popover, _Tooltip);
XhmikosR's avatar
Dist.  
XhmikosR committed
4351

XhmikosR's avatar
XhmikosR committed
4352
4353
  function Popover() {
    return _Tooltip.apply(this, arguments) || this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4354
4355
  }

XhmikosR's avatar
XhmikosR committed
4356
  var _proto = Popover.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4357

XhmikosR's avatar
XhmikosR committed
4358
4359
  // Overrides
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4360
    return this.getTitle() || this._getContent();
XhmikosR's avatar
XhmikosR committed
4361
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4362

XhmikosR's avatar
XhmikosR committed
4363
4364
  _proto.setContent = function setContent() {
    var tip = this.getTipElement(); // we use append for html objects to maintain js events
XhmikosR's avatar
Dist.  
XhmikosR committed
4365
4366
4367

    this.setElementContent(SelectorEngine.findOne(Selector$7.TITLE, tip), this.getTitle());

XhmikosR's avatar
XhmikosR committed
4368
    var content = this._getContent();
XhmikosR's avatar
Dist.  
XhmikosR committed
4369
4370
4371
4372
4373
4374
4375
4376

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

    this.setElementContent(SelectorEngine.findOne(Selector$7.CONTENT, tip), content);
    tip.classList.remove(ClassName$7.FADE);
    tip.classList.remove(ClassName$7.SHOW);
XhmikosR's avatar
XhmikosR committed
4377
4378
4379
4380
  };

  _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
    this.getTipElement().classList.add(CLASS_PREFIX$1 + "-" + attachment);
XhmikosR's avatar
Dist.  
XhmikosR committed
4381
  } // Private
XhmikosR's avatar
XhmikosR committed
4382
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4383

XhmikosR's avatar
XhmikosR committed
4384
  _proto._getContent = function _getContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4385
    return this.element.getAttribute('data-content') || this.config.content;
XhmikosR's avatar
XhmikosR committed
4386
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4387

XhmikosR's avatar
XhmikosR committed
4388
4389
4390
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4391
4392

    if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4393
4394
4395
4396
4397
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4398
4399
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4400
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4401

XhmikosR's avatar
XhmikosR committed
4402
  Popover.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4403
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4404
      var data = Data.getData(this, DATA_KEY$7);
XhmikosR's avatar
Dist.  
XhmikosR committed
4405

XhmikosR's avatar
XhmikosR committed
4406
      var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418

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

      if (!data) {
        data = new Popover(this, _config);
        Data.setData(this, DATA_KEY$7, data);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4419
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4420
4421
4422
4423
4424
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4425
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4426

XhmikosR's avatar
XhmikosR committed
4427
  Popover.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4428
    return Data.getData(element, DATA_KEY$7);
XhmikosR's avatar
XhmikosR committed
4429
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4430

XhmikosR's avatar
XhmikosR committed
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
  _createClass(Popover, null, [{
    key: "VERSION",
    // Getters
    get: function get() {
      return VERSION$7;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$5;
    }
  }, {
    key: "NAME",
    get: function get() {
      return NAME$7;
    }
  }, {
    key: "DATA_KEY",
    get: function get() {
      return DATA_KEY$7;
    }
  }, {
    key: "Event",
    get: function get() {
      return Event$8;
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$7;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$5;
    }
  }]);

  return Popover;
}(Tooltip);
XhmikosR's avatar
XhmikosR committed
4471
4472

var $$8 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4473
4474
4475
4476
4477
4478
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4479
4480
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4481
4482
4483
4484
if ($$8) {
  var JQUERY_NO_CONFLICT$7 = $$8.fn[NAME$7];
  $$8.fn[NAME$7] = Popover.jQueryInterface;
  $$8.fn[NAME$7].Constructor = Popover;
XhmikosR's avatar
Dist.  
XhmikosR committed
4485

XhmikosR's avatar
XhmikosR committed
4486
4487
4488
  $$8.fn[NAME$7].noConflict = function () {
    $$8.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
    return Popover.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4489
4490
4491
4492
4493
4494
4495
4496
4497
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4498
4499
4500
4501
4502
4503
var NAME$8 = 'scrollspy';
var VERSION$8 = '4.3.1';
var DATA_KEY$8 = 'bs.scrollspy';
var EVENT_KEY$8 = "." + DATA_KEY$8;
var DATA_API_KEY$6 = '.data-api';
var Default$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4504
4505
4506
4507
  offset: 10,
  method: 'auto',
  target: ''
};
XhmikosR's avatar
XhmikosR committed
4508
var DefaultType$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4509
4510
4511
4512
  offset: 'number',
  method: 'string',
  target: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
4513
4514
4515
4516
var Event$9 = {
  ACTIVATE: "activate" + EVENT_KEY$8,
  SCROLL: "scroll" + EVENT_KEY$8,
  LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
XhmikosR's avatar
Dist.  
XhmikosR committed
4517
};
XhmikosR's avatar
XhmikosR committed
4518
var ClassName$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4519
4520
4521
  DROPDOWN_ITEM: 'dropdown-item',
  ACTIVE: 'active'
};
XhmikosR's avatar
XhmikosR committed
4522
var Selector$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4523
4524
4525
4526
4527
4528
4529
4530
  DATA_SPY: '[data-spy="scroll"]',
  NAV_LIST_GROUP: '.nav, .list-group',
  NAV_LINKS: '.nav-link',
  NAV_ITEMS: '.nav-item',
  LIST_ITEMS: '.list-group-item',
  DROPDOWN: '.dropdown',
  DROPDOWN_TOGGLE: '.dropdown-toggle'
};
XhmikosR's avatar
XhmikosR committed
4531
var OffsetMethod = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
  OFFSET: 'offset',
  POSITION: 'position'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
4542
4543
4544
4545
4546
4547
var ScrollSpy =
/*#__PURE__*/
function () {
  function ScrollSpy(element, config) {
    var _this = this;

XhmikosR's avatar
Dist.  
XhmikosR committed
4548
4549
4550
    this._element = element;
    this._scrollElement = element.tagName === 'BODY' ? window : element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
4551
    this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " ." + ClassName$8.DROPDOWN_ITEM);
XhmikosR's avatar
Dist.  
XhmikosR committed
4552
4553
4554
4555
    this._offsets = [];
    this._targets = [];
    this._activeTarget = null;
    this._scrollHeight = 0;
XhmikosR's avatar
XhmikosR committed
4556
4557
4558
    EventHandler.on(this._scrollElement, Event$9.SCROLL, function (event) {
      return _this._process(event);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4559
4560
4561
4562
4563
4564
4565
4566
    this.refresh();

    this._process();

    Data.setData(element, DATA_KEY$8, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4567
  var _proto = ScrollSpy.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4568

XhmikosR's avatar
XhmikosR committed
4569
4570
4571
  // Public
  _proto.refresh = function refresh() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4572

XhmikosR's avatar
XhmikosR committed
4573
4574
4575
    var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
    var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
    var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
4576
4577
4578
    this._offsets = [];
    this._targets = [];
    this._scrollHeight = this._getScrollHeight();
XhmikosR's avatar
XhmikosR committed
4579
4580
4581
4582
    var targets = makeArray(SelectorEngine.find(this._selector));
    targets.map(function (element) {
      var target;
      var targetSelector = getSelectorFromElement(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
4583
4584
4585
4586
4587
4588

      if (targetSelector) {
        target = SelectorEngine.findOne(targetSelector);
      }

      if (target) {
XhmikosR's avatar
XhmikosR committed
4589
        var targetBCR = target.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
4590
4591
4592
4593
4594
4595
4596

        if (targetBCR.width || targetBCR.height) {
          return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
        }
      }

      return null;
XhmikosR's avatar
XhmikosR committed
4597
4598
4599
4600
4601
4602
4603
4604
    }).filter(function (item) {
      return item;
    }).sort(function (a, b) {
      return a[0] - b[0];
    }).forEach(function (item) {
      _this2._offsets.push(item[0]);

      _this2._targets.push(item[1]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4605
    });
XhmikosR's avatar
XhmikosR committed
4606
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4607

XhmikosR's avatar
XhmikosR committed
4608
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
    Data.removeData(this._element, DATA_KEY$8);
    EventHandler.off(this._scrollElement, EVENT_KEY$8);
    this._element = null;
    this._scrollElement = null;
    this._config = null;
    this._selector = null;
    this._offsets = null;
    this._targets = null;
    this._activeTarget = null;
    this._scrollHeight = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4620
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4621

XhmikosR's avatar
XhmikosR committed
4622
  _proto._getConfig = function _getConfig(config) {
4623
    config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4624
4625

    if (typeof config.target !== 'string') {
XhmikosR's avatar
XhmikosR committed
4626
      var id = config.target.id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4627
4628
4629
4630
4631
4632

      if (!id) {
        id = getUID(NAME$8);
        config.target.id = id;
      }

XhmikosR's avatar
XhmikosR committed
4633
      config.target = "#" + id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4634
4635
4636
4637
    }

    typeCheckConfig(NAME$8, config, DefaultType$6);
    return config;
XhmikosR's avatar
XhmikosR committed
4638
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4639

XhmikosR's avatar
XhmikosR committed
4640
  _proto._getScrollTop = function _getScrollTop() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4641
    return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
XhmikosR's avatar
XhmikosR committed
4642
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4643

XhmikosR's avatar
XhmikosR committed
4644
  _proto._getScrollHeight = function _getScrollHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4645
    return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
XhmikosR's avatar
XhmikosR committed
4646
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4647

XhmikosR's avatar
XhmikosR committed
4648
  _proto._getOffsetHeight = function _getOffsetHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4649
    return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
XhmikosR's avatar
XhmikosR committed
4650
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4651

XhmikosR's avatar
XhmikosR committed
4652
4653
  _proto._process = function _process() {
    var scrollTop = this._getScrollTop() + this._config.offset;
XhmikosR's avatar
Dist.  
XhmikosR committed
4654

XhmikosR's avatar
XhmikosR committed
4655
    var scrollHeight = this._getScrollHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4656

XhmikosR's avatar
XhmikosR committed
4657
    var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4658
4659
4660
4661
4662
4663

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

    if (scrollTop >= maxScroll) {
XhmikosR's avatar
XhmikosR committed
4664
      var target = this._targets[this._targets.length - 1];
XhmikosR's avatar
Dist.  
XhmikosR committed
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680

      if (this._activeTarget !== target) {
        this._activate(target);
      }

      return;
    }

    if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
      this._activeTarget = null;

      this._clear();

      return;
    }

XhmikosR's avatar
XhmikosR committed
4681
    var offsetLength = this._offsets.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
4682

XhmikosR's avatar
XhmikosR committed
4683
4684
    for (var i = offsetLength; i--;) {
      var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4685
4686
4687
4688
4689

      if (isActiveTarget) {
        this._activate(this._targets[i]);
      }
    }
XhmikosR's avatar
XhmikosR committed
4690
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4691

XhmikosR's avatar
XhmikosR committed
4692
  _proto._activate = function _activate(target) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4693
4694
4695
4696
    this._activeTarget = target;

    this._clear();

XhmikosR's avatar
XhmikosR committed
4697
4698
4699
    var queries = this._selector.split(',').map(function (selector) {
      return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4700

XhmikosR's avatar
XhmikosR committed
4701
    var link = SelectorEngine.findOne(queries.join(','));
XhmikosR's avatar
Dist.  
XhmikosR committed
4702
4703
4704
4705
4706
4707
4708

    if (link.classList.contains(ClassName$8.DROPDOWN_ITEM)) {
      SelectorEngine.findOne(Selector$8.DROPDOWN_TOGGLE, SelectorEngine.closest(link, Selector$8.DROPDOWN)).classList.add(ClassName$8.ACTIVE);
      link.classList.add(ClassName$8.ACTIVE);
    } else {
      // Set triggered link as active
      link.classList.add(ClassName$8.ACTIVE);
XhmikosR's avatar
XhmikosR committed
4709
      SelectorEngine.parents(link, Selector$8.NAV_LIST_GROUP).forEach(function (listGroup) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4710
4711
        // Set triggered links parents as active
        // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
XhmikosR's avatar
XhmikosR committed
4712
4713
4714
        SelectorEngine.prev(listGroup, Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).forEach(function (item) {
          return item.classList.add(ClassName$8.ACTIVE);
        }); // Handle special case when .nav-link is inside .nav-item
XhmikosR's avatar
Dist.  
XhmikosR committed
4715

XhmikosR's avatar
XhmikosR committed
4716
4717
4718
4719
        SelectorEngine.prev(listGroup, Selector$8.NAV_ITEMS).forEach(function (navItem) {
          SelectorEngine.children(navItem, Selector$8.NAV_LINKS).forEach(function (item) {
            return item.classList.add(ClassName$8.ACTIVE);
          });
XhmikosR's avatar
Dist.  
XhmikosR committed
4720
4721
4722
4723
4724
4725
4726
        });
      });
    }

    EventHandler.trigger(this._scrollElement, Event$9.ACTIVATE, {
      relatedTarget: target
    });
XhmikosR's avatar
XhmikosR committed
4727
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4728

XhmikosR's avatar
XhmikosR committed
4729
4730
4731
4732
4733
4734
  _proto._clear = function _clear() {
    makeArray(SelectorEngine.find(this._selector)).filter(function (node) {
      return node.classList.contains(ClassName$8.ACTIVE);
    }).forEach(function (node) {
      return node.classList.remove(ClassName$8.ACTIVE);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4735
  } // Static
XhmikosR's avatar
XhmikosR committed
4736
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4737

XhmikosR's avatar
XhmikosR committed
4738
  ScrollSpy.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4739
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4740
      var data = Data.getData(this, DATA_KEY$8);
XhmikosR's avatar
Dist.  
XhmikosR committed
4741

XhmikosR's avatar
XhmikosR committed
4742
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4743
4744
4745
4746
4747
4748
4749

      if (!data) {
        data = new ScrollSpy(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4750
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4751
4752
4753
4754
4755
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4756
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4757

XhmikosR's avatar
XhmikosR committed
4758
  ScrollSpy.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4759
    return Data.getData(element, DATA_KEY$8);
XhmikosR's avatar
XhmikosR committed
4760
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4761

XhmikosR's avatar
XhmikosR committed
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
  _createClass(ScrollSpy, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$8;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$6;
    }
  }]);

  return ScrollSpy;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
4776
4777
4778
4779
4780
4781
4782
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
4783
4784
4785
4786
EventHandler.on(window, Event$9.LOAD_DATA_API, function () {
  makeArray(SelectorEngine.find(Selector$8.DATA_SPY)).forEach(function (spy) {
    return new ScrollSpy(spy, Manipulator.getDataAttributes(spy));
  });
XhmikosR's avatar
Dist.  
XhmikosR committed
4787
});
XhmikosR's avatar
XhmikosR committed
4788
var $$9 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4789
4790
4791
4792
4793
4794
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4795
4796
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4797
4798
4799
4800
if ($$9) {
  var JQUERY_NO_CONFLICT$8 = $$9.fn[NAME$8];
  $$9.fn[NAME$8] = ScrollSpy.jQueryInterface;
  $$9.fn[NAME$8].Constructor = ScrollSpy;
XhmikosR's avatar
Dist.  
XhmikosR committed
4801

XhmikosR's avatar
XhmikosR committed
4802
4803
4804
  $$9.fn[NAME$8].noConflict = function () {
    $$9.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
    return ScrollSpy.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4805
4806
4807
4808
4809
4810
4811
4812
4813
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
var NAME$9 = 'tab';
var VERSION$9 = '4.3.1';
var DATA_KEY$9 = 'bs.tab';
var EVENT_KEY$9 = "." + DATA_KEY$9;
var DATA_API_KEY$7 = '.data-api';
var Event$a = {
  HIDE: "hide" + EVENT_KEY$9,
  HIDDEN: "hidden" + EVENT_KEY$9,
  SHOW: "show" + EVENT_KEY$9,
  SHOWN: "shown" + EVENT_KEY$9,
  CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
XhmikosR's avatar
Dist.  
XhmikosR committed
4825
};
XhmikosR's avatar
XhmikosR committed
4826
var ClassName$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4827
4828
4829
4830
4831
4832
  DROPDOWN_MENU: 'dropdown-menu',
  ACTIVE: 'active',
  DISABLED: 'disabled',
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4833
var Selector$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
  DROPDOWN: '.dropdown',
  NAV_LIST_GROUP: '.nav, .list-group',
  ACTIVE: '.active',
  ACTIVE_UL: ':scope > li > .active',
  DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  DROPDOWN_TOGGLE: '.dropdown-toggle',
  DROPDOWN_ACTIVE_CHILD: ':scope > .dropdown-menu .active'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
4849
4850
4851
4852
var Tab =
/*#__PURE__*/
function () {
  function Tab(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4853
4854
4855
4856
4857
    this._element = element;
    Data.setData(this._element, DATA_KEY$9, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4858
  var _proto = Tab.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4859

XhmikosR's avatar
XhmikosR committed
4860
4861
4862
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4863
4864
4865
4866
4867

    if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(ClassName$9.ACTIVE) || this._element.classList.contains(ClassName$9.DISABLED)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
4868
    var previous;
XhmikosR's avatar
XhmikosR committed
4869
    var target = getElementFromSelector(this._element);
XhmikosR's avatar
XhmikosR committed
4870
    var listElement = SelectorEngine.closest(this._element, Selector$9.NAV_LIST_GROUP);
XhmikosR's avatar
Dist.  
XhmikosR committed
4871
4872

    if (listElement) {
XhmikosR's avatar
XhmikosR committed
4873
      var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
XhmikosR's avatar
Dist.  
XhmikosR committed
4874
4875
4876
4877
      previous = makeArray(SelectorEngine.find(itemSelector, listElement));
      previous = previous[previous.length - 1];
    }

XhmikosR's avatar
XhmikosR committed
4878
    var hideEvent = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4879
4880
4881
4882
4883
4884
4885

    if (previous) {
      hideEvent = EventHandler.trigger(previous, Event$a.HIDE, {
        relatedTarget: this._element
      });
    }

XhmikosR's avatar
XhmikosR committed
4886
    var showEvent = EventHandler.trigger(this._element, Event$a.SHOW, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4887
4888
4889
4890
4891
4892
4893
4894
4895
      relatedTarget: previous
    });

    if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
      return;
    }

    this._activate(this._element, listElement);

XhmikosR's avatar
XhmikosR committed
4896
    var complete = function complete() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4897
      EventHandler.trigger(previous, Event$a.HIDDEN, {
XhmikosR's avatar
XhmikosR committed
4898
        relatedTarget: _this._element
XhmikosR's avatar
Dist.  
XhmikosR committed
4899
      });
XhmikosR's avatar
XhmikosR committed
4900
      EventHandler.trigger(_this._element, Event$a.SHOWN, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4901
4902
4903
4904
4905
4906
4907
4908
4909
        relatedTarget: previous
      });
    };

    if (target) {
      this._activate(target, target.parentNode, complete);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4910
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4911

XhmikosR's avatar
XhmikosR committed
4912
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4913
4914
4915
    Data.removeData(this._element, DATA_KEY$9);
    this._element = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4916
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4917

XhmikosR's avatar
XhmikosR committed
4918
4919
  _proto._activate = function _activate(element, container, callback) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4920

XhmikosR's avatar
XhmikosR committed
4921
4922
4923
    var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(Selector$9.ACTIVE_UL, container) : SelectorEngine.children(container, Selector$9.ACTIVE);
    var active = activeElements[0];
    var isTransitioning = callback && active && active.classList.contains(ClassName$9.FADE);
XhmikosR's avatar
Dist.  
XhmikosR committed
4924

XhmikosR's avatar
XhmikosR committed
4925
4926
4927
    var complete = function complete() {
      return _this2._transitionComplete(element, active, callback);
    };
XhmikosR's avatar
Dist.  
XhmikosR committed
4928
4929

    if (active && isTransitioning) {
XhmikosR's avatar
XhmikosR committed
4930
      var transitionDuration = getTransitionDurationFromElement(active);
XhmikosR's avatar
Dist.  
XhmikosR committed
4931
4932
4933
4934
4935
4936
      active.classList.remove(ClassName$9.SHOW);
      EventHandler.one(active, TRANSITION_END, complete);
      emulateTransitionEnd(active, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4937
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4938

XhmikosR's avatar
XhmikosR committed
4939
  _proto._transitionComplete = function _transitionComplete(element, active, callback) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4940
4941
    if (active) {
      active.classList.remove(ClassName$9.ACTIVE);
XhmikosR's avatar
XhmikosR committed
4942
      var dropdownChild = SelectorEngine.findOne(Selector$9.DROPDOWN_ACTIVE_CHILD, active.parentNode);
XhmikosR's avatar
Dist.  
XhmikosR committed
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965

      if (dropdownChild) {
        dropdownChild.classList.remove(ClassName$9.ACTIVE);
      }

      if (active.getAttribute('role') === 'tab') {
        active.setAttribute('aria-selected', false);
      }
    }

    element.classList.add(ClassName$9.ACTIVE);

    if (element.getAttribute('role') === 'tab') {
      element.setAttribute('aria-selected', true);
    }

    reflow(element);

    if (element.classList.contains(ClassName$9.FADE)) {
      element.classList.add(ClassName$9.SHOW);
    }

    if (element.parentNode && element.parentNode.classList.contains(ClassName$9.DROPDOWN_MENU)) {
XhmikosR's avatar
XhmikosR committed
4966
      var dropdownElement = SelectorEngine.closest(element, Selector$9.DROPDOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
4967
4968

      if (dropdownElement) {
XhmikosR's avatar
XhmikosR committed
4969
4970
4971
        makeArray(SelectorEngine.find(Selector$9.DROPDOWN_TOGGLE)).forEach(function (dropdown) {
          return dropdown.classList.add(ClassName$9.ACTIVE);
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4972
4973
4974
4975
4976
4977
4978
4979
4980
      }

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

    if (callback) {
      callback();
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4981
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4982

XhmikosR's avatar
XhmikosR committed
4983
  Tab.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4984
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4985
      var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
4986
4987
4988

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4989
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4990
4991
4992
4993
4994
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4995
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4996

XhmikosR's avatar
XhmikosR committed
4997
  Tab.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4998
    return Data.getData(element, DATA_KEY$9);
XhmikosR's avatar
XhmikosR committed
4999
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5000

XhmikosR's avatar
XhmikosR committed
5001
5002
5003
5004
5005
5006
5007
5008
5009
  _createClass(Tab, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$9;
    }
  }]);

  return Tab;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
5010
5011
5012
5013
5014
5015
5016
5017
5018
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


EventHandler.on(document, Event$a.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
  event.preventDefault();
XhmikosR's avatar
XhmikosR committed
5019
  var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
5020
5021
  data.show();
});
XhmikosR's avatar
XhmikosR committed
5022
var $$a = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
5023
5024
5025
5026
5027
5028
5029
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tab to jQuery only if jQuery is present
 */

5030
5031
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
5032
5033
5034
5035
if ($$a) {
  var JQUERY_NO_CONFLICT$9 = $$a.fn[NAME$9];
  $$a.fn[NAME$9] = Tab.jQueryInterface;
  $$a.fn[NAME$9].Constructor = Tab;
XhmikosR's avatar
Dist.  
XhmikosR committed
5036

XhmikosR's avatar
XhmikosR committed
5037
5038
5039
  $$a.fn[NAME$9].noConflict = function () {
    $$a.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
    return Tab.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
5040
5041
5042
5043
5044
5045
5046
5047
5048
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
var NAME$a = 'toast';
var VERSION$a = '4.3.1';
var DATA_KEY$a = 'bs.toast';
var EVENT_KEY$a = "." + DATA_KEY$a;
var Event$b = {
  CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
  HIDE: "hide" + EVENT_KEY$a,
  HIDDEN: "hidden" + EVENT_KEY$a,
  SHOW: "show" + EVENT_KEY$a,
  SHOWN: "shown" + EVENT_KEY$a
XhmikosR's avatar
Dist.  
XhmikosR committed
5059
};
XhmikosR's avatar
XhmikosR committed
5060
var ClassName$a = {
XhmikosR's avatar
Dist.  
XhmikosR committed
5061
5062
5063
5064
5065
  FADE: 'fade',
  HIDE: 'hide',
  SHOW: 'show',
  SHOWING: 'showing'
};
XhmikosR's avatar
XhmikosR committed
5066
var DefaultType$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
5067
5068
5069
5070
  animation: 'boolean',
  autohide: 'boolean',
  delay: 'number'
};
XhmikosR's avatar
XhmikosR committed
5071
var Default$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
5072
5073
5074
5075
  animation: true,
  autohide: true,
  delay: 500
};
XhmikosR's avatar
XhmikosR committed
5076
var Selector$a = {
XhmikosR's avatar
Dist.  
XhmikosR committed
5077
5078
5079
5080
5081
5082
5083
5084
5085
  DATA_DISMISS: '[data-dismiss="toast"]'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
5086
5087
5088
5089
var Toast =
/*#__PURE__*/
function () {
  function Toast(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
    this._element = element;
    this._config = this._getConfig(config);
    this._timeout = null;

    this._setListeners();

    Data.setData(element, DATA_KEY$a, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
5100
  var _proto = Toast.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
5101

XhmikosR's avatar
XhmikosR committed
5102
5103
5104
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
5105

Mark Otto's avatar
dist v5    
Mark Otto committed
5106
5107
5108
5109
5110
    var showEvent = EventHandler.trigger(this._element, Event$b.SHOW);

    if (showEvent.defaultPrevented) {
      return;
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
5111
5112
5113
5114
5115

    if (this._config.animation) {
      this._element.classList.add(ClassName$a.FADE);
    }

XhmikosR's avatar
XhmikosR committed
5116
5117
    var complete = function complete() {
      _this._element.classList.remove(ClassName$a.SHOWING);
XhmikosR's avatar
Dist.  
XhmikosR committed
5118

XhmikosR's avatar
XhmikosR committed
5119
      _this._element.classList.add(ClassName$a.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
5120

XhmikosR's avatar
XhmikosR committed
5121
      EventHandler.trigger(_this._element, Event$b.SHOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
5122

XhmikosR's avatar
XhmikosR committed
5123
5124
5125
5126
      if (_this._config.autohide) {
        _this._timeout = setTimeout(function () {
          _this.hide();
        }, _this._config.delay);
XhmikosR's avatar
Dist.  
XhmikosR committed
5127
5128
5129
5130
5131
      }
    };

    this._element.classList.remove(ClassName$a.HIDE);

5132
5133
    reflow(this._element);

XhmikosR's avatar
Dist.  
XhmikosR committed
5134
5135
5136
    this._element.classList.add(ClassName$a.SHOWING);

    if (this._config.animation) {
XhmikosR's avatar
XhmikosR committed
5137
      var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
5138
5139
5140
5141
5142
      EventHandler.one(this._element, TRANSITION_END, complete);
      emulateTransitionEnd(this._element, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
5143
5144
5145
5146
  };

  _proto.hide = function hide() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
5147
5148
5149
5150
5151

    if (!this._element.classList.contains(ClassName$a.SHOW)) {
      return;
    }

Mark Otto's avatar
dist v5    
Mark Otto committed
5152
5153
5154
5155
5156
    var hideEvent = EventHandler.trigger(this._element, Event$b.HIDE);

    if (hideEvent.defaultPrevented) {
      return;
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
5157

XhmikosR's avatar
XhmikosR committed
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
    var complete = function complete() {
      _this2._element.classList.add(ClassName$a.HIDE);

      EventHandler.trigger(_this2._element, Event$b.HIDDEN);
    };

    this._element.classList.remove(ClassName$a.SHOW);

    if (this._config.animation) {
      var transitionDuration = getTransitionDurationFromElement(this._element);
      EventHandler.one(this._element, TRANSITION_END, complete);
      emulateTransitionEnd(this._element, transitionDuration);
XhmikosR's avatar
Dist.  
XhmikosR committed
5170
    } else {
XhmikosR's avatar
XhmikosR committed
5171
      complete();
XhmikosR's avatar
Dist.  
XhmikosR committed
5172
    }
XhmikosR's avatar
XhmikosR committed
5173
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5174

XhmikosR's avatar
XhmikosR committed
5175
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
    clearTimeout(this._timeout);
    this._timeout = null;

    if (this._element.classList.contains(ClassName$a.SHOW)) {
      this._element.classList.remove(ClassName$a.SHOW);
    }

    EventHandler.off(this._element, Event$b.CLICK_DISMISS);
    Data.removeData(this._element, DATA_KEY$a);
    this._element = null;
    this._config = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
5188
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
5189

XhmikosR's avatar
XhmikosR committed
5190
  _proto._getConfig = function _getConfig(config) {
5191
    config = _objectSpread2({}, Default$7, {}, Manipulator.getDataAttributes(this._element), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
5192
5193
    typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
    return config;
XhmikosR's avatar
XhmikosR committed
5194
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5195

XhmikosR's avatar
XhmikosR committed
5196
5197
  _proto._setListeners = function _setListeners() {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
5198

XhmikosR's avatar
XhmikosR committed
5199
5200
5201
    EventHandler.on(this._element, Event$b.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
      return _this3.hide();
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
5202
  } // Static
XhmikosR's avatar
XhmikosR committed
5203
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
5204

XhmikosR's avatar
XhmikosR committed
5205
  Toast.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
5206
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
5207
      var data = Data.getData(this, DATA_KEY$a);
XhmikosR's avatar
Dist.  
XhmikosR committed
5208

XhmikosR's avatar
XhmikosR committed
5209
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
5210
5211
5212
5213
5214
5215
5216

      if (!data) {
        data = new Toast(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
5217
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
5218
5219
5220
5221
5222
        }

        data[config](this);
      }
    });
XhmikosR's avatar
XhmikosR committed
5223
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5224

XhmikosR's avatar
XhmikosR committed
5225
  Toast.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
5226
    return Data.getData(element, DATA_KEY$a);
XhmikosR's avatar
XhmikosR committed
5227
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5228

XhmikosR's avatar
XhmikosR committed
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
  _createClass(Toast, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$a;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$7;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$7;
    }
  }]);

  return Toast;
}();
XhmikosR's avatar
XhmikosR committed
5248
5249

var $$b = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
5250
5251
5252
5253
5254
5255
5256
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 *  add .toast to jQuery only if jQuery is present
 */

5257
5258
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
5259
5260
5261
5262
if ($$b) {
  var JQUERY_NO_CONFLICT$a = $$b.fn[NAME$a];
  $$b.fn[NAME$a] = Toast.jQueryInterface;
  $$b.fn[NAME$a].Constructor = Toast;
XhmikosR's avatar
Dist.  
XhmikosR committed
5263

XhmikosR's avatar
XhmikosR committed
5264
5265
5266
  $$b.fn[NAME$a].noConflict = function () {
    $$b.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
    return Toast.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
5267
5268
5269
5270
5271
  };
}

export { Alert, Button, Carousel, Collapse, Dropdown, Modal, Popover, ScrollSpy, Tab, Toast, Tooltip };
//# sourceMappingURL=bootstrap.esm.js.map