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
  do {
    prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  } while (document.getElementById(prefix));

  return prefix;
};

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

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

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

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

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

  return null;
};

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

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


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

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

  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
156
157
158
159
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
160
161
};

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

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

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

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

XhmikosR's avatar
XhmikosR committed
184
185
186
187
188
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
189
190

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

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

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

XhmikosR's avatar
XhmikosR committed
204
var isVisible = function isVisible(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
205
206
207
208
209
210
211
212
213
214
215
  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
216
var findShadowRoot = function findShadowRoot(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
217
218
219
220
221
222
  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
223
    var root = element.getRootNode();
XhmikosR's avatar
Dist.  
XhmikosR committed
224
225
226
227
228
229
230
231
232
233
234
235
236
    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);
XhmikosR's avatar
XhmikosR committed
237
};
XhmikosR's avatar
Dist.  
XhmikosR committed
238

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

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

XhmikosR's avatar
XhmikosR committed
247
248
249
250
251
252
253
254
255
256
257
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
258
259
260
261
262
263
264
265
266
267
268
269
/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): dom/data.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

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

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

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

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

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

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

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

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

XhmikosR's avatar
XhmikosR committed
325
326
327
328
329
330
331
332
333
334
/* 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
335
336
};

XhmikosR's avatar
XhmikosR committed
337
338
339
340
341
342
343
344
345
346
347
348
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
349

XhmikosR's avatar
XhmikosR committed
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
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
371
    });
XhmikosR's avatar
XhmikosR committed
372
373
  };
} // MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached
XhmikosR's avatar
Dist.  
XhmikosR committed
374
375


XhmikosR's avatar
XhmikosR committed
376
377
378
379
380
381
382
383
384
385
386
387
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
388

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

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

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

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

XhmikosR's avatar
XhmikosR committed
405
406
407
    return null;
  };
}
XhmikosR's avatar
Dist.  
XhmikosR committed
408

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

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

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

XhmikosR's avatar
XhmikosR committed
420
421
422
423
424
425
426
427
428
429
  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
430

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

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

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

XhmikosR's avatar
XhmikosR committed
446
447
    return nodeList;
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
448

XhmikosR's avatar
XhmikosR committed
449
450
451
452
453
454
455
456
457
458
459
460
  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
461
  };
XhmikosR's avatar
XhmikosR committed
462
}
XhmikosR's avatar
Dist.  
XhmikosR committed
463
464
465

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

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

XhmikosR's avatar
XhmikosR committed
483
484
var uidEvent = 1;
var customEvents = {
XhmikosR's avatar
Dist.  
XhmikosR committed
485
486
487
  mouseenter: 'mouseover',
  mouseleave: 'mouseout'
};
XhmikosR's avatar
XhmikosR committed
488
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
489
490
491
492
493
494
495
/**
 * ------------------------------------------------------------------------
 * Private methods
 * ------------------------------------------------------------------------
 */

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

function getEvent(element) {
XhmikosR's avatar
XhmikosR committed
500
  var uid = getUidEvent(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
501
502
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
  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
529
    var domElements = element.querySelectorAll(selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
530

XhmikosR's avatar
XhmikosR committed
531
532
    for (var target = event.target; target && target !== this; target = target.parentNode) {
      for (var i = domElements.length; i--;) {
XhmikosR's avatar
Dist.  
XhmikosR committed
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
        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
555
556
557
558
  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
559
560

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

  return null;
}

function normalizeParams(originalTypeEvent, handler, delegationFn) {
XhmikosR's avatar
XhmikosR committed
569
570
  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
571

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

  if (custom) {
    typeEvent = custom;
  }

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

  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
598
599
600
601
  var _normalizeParams = normalizeParams(originalTypeEvent, handler, delegationFn),
      delegation = _normalizeParams[0],
      originalHandler = _normalizeParams[1],
      typeEvent = _normalizeParams[2];
XhmikosR's avatar
Dist.  
XhmikosR committed
602

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

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

XhmikosR's avatar
XhmikosR committed
612
613
  var uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
  var fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
XhmikosR's avatar
Dist.  
XhmikosR committed
614
615
616
617
618
619
620
621
622
  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
623
  var fn = findHandler(events[typeEvent], handler, delegationSelector);
XhmikosR's avatar
Dist.  
XhmikosR committed
624

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

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

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

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

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

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

    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
675
      Object.keys(events).forEach(function (elementEvent) {
XhmikosR's avatar
XhmikosR committed
676
        removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
XhmikosR's avatar
Dist.  
XhmikosR committed
677
678
679
      });
    }

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

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

XhmikosR's avatar
XhmikosR committed
695
696
697
698
699
700
701
702
    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
703

XhmikosR's avatar
XhmikosR committed
704
705
706
    if (inNamespace && $) {
      jQueryEvent = $.Event(event, args);
      $(element).trigger(jQueryEvent);
XhmikosR's avatar
Dist.  
XhmikosR committed
707
708
709
710
711
712
713
714
715
      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
716
717
      evt = createCustomEvent(event, {
        bubbles: bubbles,
XhmikosR's avatar
Dist.  
XhmikosR committed
718
719
720
721
722
723
        cancelable: true
      });
    } // merge custom informations in our event


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

    if (defaultPrevented) {
      evt.preventDefault();

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

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

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

    return evt;
  }
};

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

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

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

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

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

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

    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
835
836
837
838
839
840
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
841
842
  DISMISS: '[data-dismiss="alert"]'
};
XhmikosR's avatar
XhmikosR committed
843
844
845
846
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
847
};
XhmikosR's avatar
XhmikosR committed
848
var ClassName = {
XhmikosR's avatar
Dist.  
XhmikosR committed
849
850
851
852
  ALERT: 'alert',
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
853
854
855
856
857
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
858

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

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


XhmikosR's avatar
XhmikosR committed
871
  var _proto = Alert.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
872

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

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

XhmikosR's avatar
XhmikosR committed
881
    var customEvent = this._triggerCloseEvent(rootElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
882
883
884
885
886
887

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

    this._removeElement(rootElement);
XhmikosR's avatar
XhmikosR committed
888
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
889

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

XhmikosR's avatar
XhmikosR committed
896
  _proto._getRootElement = function _getRootElement(element) {
XhmikosR's avatar
XhmikosR committed
897
    var parent = getElementFromSelector(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
898
899

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

    return parent;
XhmikosR's avatar
XhmikosR committed
904
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
905

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

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

    element.classList.remove(ClassName.SHOW);

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

      return;
    }

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

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

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

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

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

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

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

      alertInstance.close(this);
    };
XhmikosR's avatar
XhmikosR committed
959
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
960

XhmikosR's avatar
XhmikosR committed
961
  Alert.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
962
    return Data.getData(element, DATA_KEY);
XhmikosR's avatar
XhmikosR committed
963
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
964

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

  return Alert;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
974
975
976
977
978
979
980
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


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

990
991
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
992
993
994
995
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
996

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

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

XhmikosR's avatar
XhmikosR committed
1009
1010
1011
1012
1013
1014
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
1015
1016
1017
1018
  ACTIVE: 'active',
  BUTTON: 'btn',
  FOCUS: 'focus'
};
XhmikosR's avatar
XhmikosR committed
1019
var Selector$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1020
1021
1022
1023
1024
1025
  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
1026
1027
1028
1029
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
1030
};
XhmikosR's avatar
XhmikosR committed
1031
1032
1033
1034
1035
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
1036

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


XhmikosR's avatar
XhmikosR committed
1046
  var _proto = Button.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
1047

XhmikosR's avatar
XhmikosR committed
1048
1049
1050
1051
1052
  // 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
1053
1054

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

XhmikosR's avatar
XhmikosR committed
1057
1058
1059
1060
1061
      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
1062

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

        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
1089
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1090

XhmikosR's avatar
XhmikosR committed
1091
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1092
1093
1094
    Data.removeData(this._element, DATA_KEY$1);
    this._element = null;
  } // Static
XhmikosR's avatar
XhmikosR committed
1095
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
1096

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

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

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

XhmikosR's avatar
XhmikosR committed
1111
  Button.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1112
    return Data.getData(element, DATA_KEY$1);
XhmikosR's avatar
XhmikosR committed
1113
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1114

XhmikosR's avatar
XhmikosR committed
1115
1116
1117
1118
1119
1120
1121
1122
1123
  _createClass(Button, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$1;
    }
  }]);

  return Button;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
1124
1125
1126
1127
1128
1129
1130
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


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

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

XhmikosR's avatar
XhmikosR committed
1139
  var data = Data.getData(button, DATA_KEY$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
1140
1141
1142
1143
1144
1145
1146

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

  data.toggle();
});
XhmikosR's avatar
XhmikosR committed
1147
1148
1149
1150
1151
1152
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
1153
});
XhmikosR's avatar
XhmikosR committed
1154
1155
1156
1157
1158
1159
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
1160
});
XhmikosR's avatar
XhmikosR committed
1161
var $$2 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
1162
1163
1164
1165
1166
1167
1168
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .button to jQuery only if jQuery is present
 */

1169
1170
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
1171
1172
1173
1174
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
1175

XhmikosR's avatar
XhmikosR committed
1176
1177
1178
  $$2.fn[NAME$1].noConflict = function () {
    $$2.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
    return Button.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
1179
1180
1181
1182
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
  };
}

/**
 * --------------------------------------------------------------------------
 * 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
1209
1210
1211
  return key.replace(/[A-Z]/g, function (chr) {
    return chr.toLowerCase();
  });
XhmikosR's avatar
Dist.  
XhmikosR committed
1212
1213
}

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

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

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

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

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

XhmikosR's avatar
XhmikosR committed
1268
1269
1270
1271
1272
1273
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
1274

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

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

XhmikosR's avatar
XhmikosR committed
1279
1280
var SWIPE_THRESHOLD = 40;
var Default = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1281
1282
1283
1284
1285
1286
1287
  interval: 5000,
  keyboard: true,
  slide: false,
  pause: 'hover',
  wrap: true,
  touch: true
};
XhmikosR's avatar
XhmikosR committed
1288
var DefaultType = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1289
1290
1291
1292
1293
1294
1295
  interval: '(number|boolean)',
  keyboard: 'boolean',
  slide: '(boolean|string)',
  pause: '(string|boolean)',
  wrap: 'boolean',
  touch: 'boolean'
};
XhmikosR's avatar
XhmikosR committed
1296
var Direction = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1297
1298
1299
1300
1301
  NEXT: 'next',
  PREV: 'prev',
  LEFT: 'left',
  RIGHT: 'right'
};
XhmikosR's avatar
XhmikosR committed
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
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
1316
};
XhmikosR's avatar
XhmikosR committed
1317
var ClassName$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
  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
1328
var Selector$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1329
1330
1331
1332
1333
1334
1335
1336
1337
  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
1338
var PointerType = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1339
1340
1341
  TOUCH: 'touch',
  PEN: 'pen'
};
XhmikosR's avatar
XhmikosR committed
1342
1343
1344
1345
1346
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
1347

XhmikosR's avatar
XhmikosR committed
1348
1349
1350
1351
var Carousel =
/*#__PURE__*/
function () {
  function Carousel(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
    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
1372
  var _proto = Carousel.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
1373

XhmikosR's avatar
XhmikosR committed
1374
1375
  // Public
  _proto.next = function next() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1376
1377
1378
    if (!this._isSliding) {
      this._slide(Direction.NEXT);
    }
XhmikosR's avatar
XhmikosR committed
1379
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1380

XhmikosR's avatar
XhmikosR committed
1381
  _proto.nextWhenVisible = function nextWhenVisible() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1382
1383
1384
1385
1386
    // 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
1387
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1388

XhmikosR's avatar
XhmikosR committed
1389
  _proto.prev = function prev() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1390
1391
1392
    if (!this._isSliding) {
      this._slide(Direction.PREV);
    }
XhmikosR's avatar
XhmikosR committed
1393
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1394

XhmikosR's avatar
XhmikosR committed
1395
  _proto.pause = function pause(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
    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
1407
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1408

XhmikosR's avatar
XhmikosR committed
1409
  _proto.cycle = function cycle(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
    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
1422
1423
1424
1425
  };

  _proto.to = function to(index) {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1426
1427
1428

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

XhmikosR's avatar
XhmikosR committed
1429
    var activeIndex = this._getItemIndex(this._activeElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1430
1431
1432
1433
1434
1435

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

    if (this._isSliding) {
XhmikosR's avatar
XhmikosR committed
1436
1437
1438
      EventHandler.one(this._element, Event$3.SLID, function () {
        return _this.to(index);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1439
1440
1441
1442
1443
1444
1445
1446
1447
      return;
    }

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

XhmikosR's avatar
XhmikosR committed
1448
    var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
XhmikosR's avatar
Dist.  
XhmikosR committed
1449
1450

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

XhmikosR's avatar
XhmikosR committed
1453
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
    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
1465
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
1466

XhmikosR's avatar
XhmikosR committed
1467
  _proto._getConfig = function _getConfig(config) {
1468
    config = _objectSpread2({}, Default, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1469
1470
    typeCheckConfig(NAME$2, config, DefaultType);
    return config;
XhmikosR's avatar
XhmikosR committed
1471
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1472

XhmikosR's avatar
XhmikosR committed
1473
1474
  _proto._handleSwipe = function _handleSwipe() {
    var absDeltax = Math.abs(this.touchDeltaX);
XhmikosR's avatar
Dist.  
XhmikosR committed
1475
1476
1477
1478
1479

    if (absDeltax <= SWIPE_THRESHOLD) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
1480
1481
    var direction = absDeltax / this.touchDeltaX;
    this.touchDeltaX = 0; // swipe left
XhmikosR's avatar
Dist.  
XhmikosR committed
1482
1483
1484
1485
1486
1487
1488
1489
1490

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


    if (direction < 0) {
      this.next();
    }
XhmikosR's avatar
XhmikosR committed
1491
1492
1493
1494
  };

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

    if (this._config.keyboard) {
XhmikosR's avatar
XhmikosR committed
1497
1498
1499
      EventHandler.on(this._element, Event$3.KEYDOWN, function (event) {
        return _this2._keydown(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1500
1501
1502
    }

    if (this._config.pause === 'hover') {
XhmikosR's avatar
XhmikosR committed
1503
1504
1505
1506
1507
1508
      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
1509
1510
    }

1511
    if (this._config.touch && this._touchSupported) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1512
1513
      this._addTouchEventListeners();
    }
XhmikosR's avatar
XhmikosR committed
1514
1515
1516
1517
  };

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

XhmikosR's avatar
XhmikosR committed
1519
1520
1521
1522
1523
    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
1524
1525
1526
      }
    };

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

XhmikosR's avatar
XhmikosR committed
1536
1537
1538
    var end = function end(event) {
      if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
        _this3.touchDeltaX = event.clientX - _this3.touchStartX;
XhmikosR's avatar
Dist.  
XhmikosR committed
1539
1540
      }

XhmikosR's avatar
XhmikosR committed
1541
      _this3._handleSwipe();
XhmikosR's avatar
Dist.  
XhmikosR committed
1542

XhmikosR's avatar
XhmikosR committed
1543
      if (_this3._config.pause === 'hover') {
XhmikosR's avatar
Dist.  
XhmikosR committed
1544
1545
1546
1547
1548
1549
1550
        // 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
1551
        _this3.pause();
XhmikosR's avatar
Dist.  
XhmikosR committed
1552

XhmikosR's avatar
XhmikosR committed
1553
1554
        if (_this3.touchTimeout) {
          clearTimeout(_this3.touchTimeout);
XhmikosR's avatar
Dist.  
XhmikosR committed
1555
1556
        }

XhmikosR's avatar
XhmikosR committed
1557
1558
1559
        _this3.touchTimeout = setTimeout(function (event) {
          return _this3.cycle(event);
        }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
XhmikosR's avatar
Dist.  
XhmikosR committed
1560
1561
1562
      }
    };

XhmikosR's avatar
XhmikosR committed
1563
1564
1565
1566
    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
1567
1568
1569
    });

    if (this._pointerEvent) {
XhmikosR's avatar
XhmikosR committed
1570
1571
1572
1573
1574
1575
      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
1576
1577
1578

      this._element.classList.add(ClassName$2.POINTER_EVENT);
    } else {
XhmikosR's avatar
XhmikosR committed
1579
1580
1581
1582
1583
1584
1585
1586
1587
      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
1588
    }
XhmikosR's avatar
XhmikosR committed
1589
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1590

XhmikosR's avatar
XhmikosR committed
1591
  _proto._keydown = function _keydown(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
    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
1609
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1610

XhmikosR's avatar
XhmikosR committed
1611
  _proto._getItemIndex = function _getItemIndex(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1612
1613
    this._items = element && element.parentNode ? makeArray(SelectorEngine.find(Selector$2.ITEM, element.parentNode)) : [];
    return this._items.indexOf(element);
XhmikosR's avatar
XhmikosR committed
1614
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1615

XhmikosR's avatar
XhmikosR committed
1616
1617
1618
  _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
    var isNextDirection = direction === Direction.NEXT;
    var isPrevDirection = direction === Direction.PREV;
XhmikosR's avatar
Dist.  
XhmikosR committed
1619

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

XhmikosR's avatar
XhmikosR committed
1622
1623
    var lastItemIndex = this._items.length - 1;
    var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
XhmikosR's avatar
Dist.  
XhmikosR committed
1624
1625
1626
1627
1628

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

XhmikosR's avatar
XhmikosR committed
1629
1630
    var delta = direction === Direction.PREV ? -1 : 1;
    var itemIndex = (activeIndex + delta) % this._items.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
1631
    return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
XhmikosR's avatar
XhmikosR committed
1632
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1633

XhmikosR's avatar
XhmikosR committed
1634
1635
  _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
    var targetIndex = this._getItemIndex(relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
1636

XhmikosR's avatar
XhmikosR committed
1637
    var fromIndex = this._getItemIndex(SelectorEngine.findOne(Selector$2.ACTIVE_ITEM, this._element));
XhmikosR's avatar
Dist.  
XhmikosR committed
1638
1639

    return EventHandler.trigger(this._element, Event$3.SLIDE, {
XhmikosR's avatar
XhmikosR committed
1640
      relatedTarget: relatedTarget,
XhmikosR's avatar
Dist.  
XhmikosR committed
1641
1642
1643
1644
      direction: eventDirectionName,
      from: fromIndex,
      to: targetIndex
    });
XhmikosR's avatar
XhmikosR committed
1645
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1646

XhmikosR's avatar
XhmikosR committed
1647
  _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1648
    if (this._indicatorsElement) {
XhmikosR's avatar
XhmikosR committed
1649
      var indicators = SelectorEngine.find(Selector$2.ACTIVE, this._indicatorsElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1650

XhmikosR's avatar
XhmikosR committed
1651
      for (var i = 0; i < indicators.length; i++) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1652
1653
1654
        indicators[i].classList.remove(ClassName$2.ACTIVE);
      }

XhmikosR's avatar
XhmikosR committed
1655
      var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
XhmikosR's avatar
Dist.  
XhmikosR committed
1656
1657
1658
1659
1660

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

XhmikosR's avatar
XhmikosR committed
1663
1664
  _proto._slide = function _slide(direction, element) {
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1665

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

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

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

XhmikosR's avatar
XhmikosR committed
1672
1673
1674
1675
1676
1677
    var nextElementIndex = this._getItemIndex(nextElement);

    var isCycling = Boolean(this._interval);
    var directionalClassName;
    var orderClassName;
    var eventDirectionName;
XhmikosR's avatar
Dist.  
XhmikosR committed
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693

    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
1694
    var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
XhmikosR's avatar
Dist.  
XhmikosR committed
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717

    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
1718
      var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
XhmikosR's avatar
Dist.  
XhmikosR committed
1719
1720
1721
1722
1723
1724
1725
1726

      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
1727
1728
      var transitionDuration = getTransitionDurationFromElement(activeElement);
      EventHandler.one(activeElement, TRANSITION_END, function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
1729
1730
1731
1732
1733
1734
        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
1735
1736
1737
        _this4._isSliding = false;
        setTimeout(function () {
          EventHandler.trigger(_this4._element, Event$3.SLID, {
XhmikosR's avatar
Dist.  
XhmikosR committed
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
            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
1762
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
1763

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

1767
    var _config = _objectSpread2({}, Default, {}, Manipulator.getDataAttributes(element));
XhmikosR's avatar
Dist.  
XhmikosR committed
1768
1769

    if (typeof config === 'object') {
1770
      _config = _objectSpread2({}, _config, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1771
1772
    }

XhmikosR's avatar
XhmikosR committed
1773
    var action = typeof config === 'string' ? config : _config.slide;
XhmikosR's avatar
Dist.  
XhmikosR committed
1774
1775
1776
1777
1778
1779
1780
1781
1782

    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
1783
        throw new TypeError("No method named \"" + action + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
1784
1785
1786
1787
1788
1789
1790
      }

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

XhmikosR's avatar
XhmikosR committed
1793
  Carousel.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1794
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
1795
      Carousel.carouselInterface(this, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1796
    });
XhmikosR's avatar
XhmikosR committed
1797
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1798

XhmikosR's avatar
XhmikosR committed
1799
1800
  Carousel.dataApiClickHandler = function dataApiClickHandler(event) {
    var target = getElementFromSelector(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
1801
1802
1803
1804
1805

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

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

XhmikosR's avatar
XhmikosR committed
1808
    var slideIndex = this.getAttribute('data-slide-to');
XhmikosR's avatar
Dist.  
XhmikosR committed
1809
1810
1811
1812
1813

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

XhmikosR's avatar
XhmikosR committed
1814
    Carousel.carouselInterface(target, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1815
1816
1817
1818
1819
1820

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

    event.preventDefault();
XhmikosR's avatar
XhmikosR committed
1821
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1822

XhmikosR's avatar
XhmikosR committed
1823
  Carousel.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1824
    return Data.getData(element, DATA_KEY$2);
XhmikosR's avatar
XhmikosR committed
1825
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1826

XhmikosR's avatar
XhmikosR committed
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
  _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
1841
1842
1843
1844
1845
1846
1847
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


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

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

1864
1865
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
1866
1867
1868
1869
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
1870

XhmikosR's avatar
XhmikosR committed
1871
1872
1873
  $$3.fn[NAME$2].noConflict = function () {
    $$3.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
    return Carousel.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
1874
1875
1876
1877
1878
1879
1880
1881
1882
  };
}

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

XhmikosR's avatar
XhmikosR committed
1883
1884
1885
1886
1887
1888
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
1889
1890
1891
  toggle: true,
  parent: ''
};
XhmikosR's avatar
XhmikosR committed
1892
var DefaultType$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1893
1894
1895
  toggle: 'boolean',
  parent: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
1896
1897
1898
1899
1900
1901
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
1902
};
XhmikosR's avatar
XhmikosR committed
1903
var ClassName$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1904
1905
1906
1907
1908
  SHOW: 'show',
  COLLAPSE: 'collapse',
  COLLAPSING: 'collapsing',
  COLLAPSED: 'collapsed'
};
XhmikosR's avatar
XhmikosR committed
1909
var Dimension = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1910
1911
1912
  WIDTH: 'width',
  HEIGHT: 'height'
};
XhmikosR's avatar
XhmikosR committed
1913
var Selector$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1914
1915
1916
  ACTIVES: '.show, .collapsing',
  DATA_TOGGLE: '[data-toggle="collapse"]'
};
XhmikosR's avatar
XhmikosR committed
1917
1918
1919
1920
1921
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
1922

XhmikosR's avatar
XhmikosR committed
1923
1924
1925
1926
var Collapse =
/*#__PURE__*/
function () {
  function Collapse(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1927
1928
1929
    this._isTransitioning = false;
    this._element = element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
1930
1931
1932
1933
1934
1935
1936
1937
1938
    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
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960

      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
1961
  var _proto = Collapse.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
1962

XhmikosR's avatar
XhmikosR committed
1963
1964
  // Public
  _proto.toggle = function toggle() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1965
1966
1967
1968
1969
    if (this._element.classList.contains(ClassName$3.SHOW)) {
      this.hide();
    } else {
      this.show();
    }
XhmikosR's avatar
XhmikosR committed
1970
1971
1972
1973
  };

  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1974
1975
1976
1977
1978

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

XhmikosR's avatar
XhmikosR committed
1979
1980
    var actives;
    var activesData;
XhmikosR's avatar
Dist.  
XhmikosR committed
1981
1982

    if (this._parent) {
XhmikosR's avatar
XhmikosR committed
1983
1984
1985
      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
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
        }

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

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

XhmikosR's avatar
XhmikosR committed
1996
    var container = SelectorEngine.findOne(this._selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
1997
1998

    if (actives) {
XhmikosR's avatar
XhmikosR committed
1999
2000
2001
      var tempActiveData = actives.filter(function (elem) {
        return container !== elem;
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
2002
2003
2004
2005
2006
2007
2008
      activesData = tempActiveData[0] ? Data.getData(tempActiveData[0], DATA_KEY$3) : null;

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

XhmikosR's avatar
XhmikosR committed
2009
    var startEvent = EventHandler.trigger(this._element, Event$4.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
2010
2011
2012
2013
2014
2015

    if (startEvent.defaultPrevented) {
      return;
    }

    if (actives) {
XhmikosR's avatar
XhmikosR committed
2016
      actives.forEach(function (elemActive) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2017
        if (container !== elemActive) {
XhmikosR's avatar
XhmikosR committed
2018
          Collapse.collapseInterface(elemActive, 'hide');
XhmikosR's avatar
Dist.  
XhmikosR committed
2019
2020
2021
2022
2023
2024
2025
2026
        }

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

XhmikosR's avatar
XhmikosR committed
2027
    var dimension = this._getDimension();
XhmikosR's avatar
Dist.  
XhmikosR committed
2028
2029
2030
2031
2032
2033
2034
2035

    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
2036
      this._triggerArray.forEach(function (element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2037
2038
2039
2040
2041
2042
2043
        element.classList.remove(ClassName$3.COLLAPSED);
        element.setAttribute('aria-expanded', true);
      });
    }

    this.setTransitioning(true);

XhmikosR's avatar
XhmikosR committed
2044
2045
2046
2047
2048
2049
    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
2050

XhmikosR's avatar
XhmikosR committed
2051
      _this._element.style[dimension] = '';
XhmikosR's avatar
Dist.  
XhmikosR committed
2052

XhmikosR's avatar
XhmikosR committed
2053
      _this.setTransitioning(false);
XhmikosR's avatar
Dist.  
XhmikosR committed
2054

XhmikosR's avatar
XhmikosR committed
2055
      EventHandler.trigger(_this._element, Event$4.SHOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
2056
2057
    };

XhmikosR's avatar
XhmikosR committed
2058
2059
2060
    var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
    var scrollSize = "scroll" + capitalizedDimension;
    var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
2061
2062
    EventHandler.one(this._element, TRANSITION_END, complete);
    emulateTransitionEnd(this._element, transitionDuration);
XhmikosR's avatar
XhmikosR committed
2063
2064
2065
2066
2067
    this._element.style[dimension] = this._element[scrollSize] + "px";
  };

  _proto.hide = function hide() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2068
2069
2070
2071
2072

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

XhmikosR's avatar
XhmikosR committed
2073
    var startEvent = EventHandler.trigger(this._element, Event$4.HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
2074
2075
2076
2077
2078

    if (startEvent.defaultPrevented) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2079
    var dimension = this._getDimension();
XhmikosR's avatar
Dist.  
XhmikosR committed
2080

XhmikosR's avatar
XhmikosR committed
2081
    this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
2082
2083
2084
2085
2086
2087
2088
2089
    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
2090
    var triggerArrayLength = this._triggerArray.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
2091
2092

    if (triggerArrayLength > 0) {
XhmikosR's avatar
XhmikosR committed
2093
2094
      for (var i = 0; i < triggerArrayLength; i++) {
        var trigger = this._triggerArray[i];
XhmikosR's avatar
XhmikosR committed
2095
        var elem = getElementFromSelector(trigger);
XhmikosR's avatar
Dist.  
XhmikosR committed
2096

XhmikosR's avatar
XhmikosR committed
2097
2098
2099
        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
2100
2101
2102
2103
2104
2105
        }
      }
    }

    this.setTransitioning(true);

XhmikosR's avatar
XhmikosR committed
2106
2107
    var complete = function complete() {
      _this2.setTransitioning(false);
XhmikosR's avatar
Dist.  
XhmikosR committed
2108

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

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

XhmikosR's avatar
XhmikosR committed
2113
      EventHandler.trigger(_this2._element, Event$4.HIDDEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
2114
2115
2116
    };

    this._element.style[dimension] = '';
XhmikosR's avatar
XhmikosR committed
2117
    var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
2118
2119
    EventHandler.one(this._element, TRANSITION_END, complete);
    emulateTransitionEnd(this._element, transitionDuration);
XhmikosR's avatar
XhmikosR committed
2120
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2121

XhmikosR's avatar
XhmikosR committed
2122
  _proto.setTransitioning = function setTransitioning(isTransitioning) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2123
    this._isTransitioning = isTransitioning;
XhmikosR's avatar
XhmikosR committed
2124
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2125

XhmikosR's avatar
XhmikosR committed
2126
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2127
2128
2129
2130
2131
2132
2133
    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
2134
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2135

XhmikosR's avatar
XhmikosR committed
2136
  _proto._getConfig = function _getConfig(config) {
2137
    config = _objectSpread2({}, Default$1, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2138
2139
2140
2141
    config.toggle = Boolean(config.toggle); // Coerce string values

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

XhmikosR's avatar
XhmikosR committed
2144
2145
  _proto._getDimension = function _getDimension() {
    var hasWidth = this._element.classList.contains(Dimension.WIDTH);
XhmikosR's avatar
Dist.  
XhmikosR committed
2146
2147

    return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
XhmikosR's avatar
XhmikosR committed
2148
2149
2150
2151
  };

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

XhmikosR's avatar
XhmikosR committed
2153
    var parent = this._config.parent;
XhmikosR's avatar
Dist.  
XhmikosR committed
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163

    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
2164
2165
    var selector = "[data-toggle=\"collapse\"][data-parent=\"" + parent + "\"]";
    makeArray(SelectorEngine.find(selector, parent)).forEach(function (element) {
XhmikosR's avatar
XhmikosR committed
2166
      var selected = getElementFromSelector(element);
2167
2168

      _this3._addAriaAndCollapsedClass(selected, [element]);
XhmikosR's avatar
Dist.  
XhmikosR committed
2169
2170
    });
    return parent;
XhmikosR's avatar
XhmikosR committed
2171
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2172

XhmikosR's avatar
XhmikosR committed
2173
  _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2174
    if (element) {
XhmikosR's avatar
XhmikosR committed
2175
      var isOpen = element.classList.contains(ClassName$3.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
2176
2177

      if (triggerArray.length) {
XhmikosR's avatar
XhmikosR committed
2178
        triggerArray.forEach(function (elem) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
          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
2190
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2191

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

2195
    var _config = _objectSpread2({}, Default$1, {}, Manipulator.getDataAttributes(element), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206

    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
2207
        throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
2208
2209
2210
2211
      }

      data[config]();
    }
XhmikosR's avatar
XhmikosR committed
2212
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2213

XhmikosR's avatar
XhmikosR committed
2214
  Collapse.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2215
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
2216
      Collapse.collapseInterface(this, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2217
    });
XhmikosR's avatar
XhmikosR committed
2218
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2219

XhmikosR's avatar
XhmikosR committed
2220
  Collapse.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2221
    return Data.getData(element, DATA_KEY$3);
XhmikosR's avatar
XhmikosR committed
2222
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2223

XhmikosR's avatar
XhmikosR committed
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
  _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
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
/**
 * ------------------------------------------------------------------------
 * 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
2251
2252
2253
2254
2255
2256
  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
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269

    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
2270
    Collapse.collapseInterface(element, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2271
2272
  });
});
XhmikosR's avatar
XhmikosR committed
2273
var $$4 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
2274
2275
2276
2277
2278
2279
2280
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .collapse to jQuery only if jQuery is present
 */

2281
2282
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
2283
2284
2285
2286
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
2287

XhmikosR's avatar
XhmikosR committed
2288
2289
2290
  $$4.fn[NAME$3].noConflict = function () {
    $$4.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
    return Collapse.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
2291
2292
2293
2294
2295
2296
2297
2298
2299
  };
}

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

XhmikosR's avatar
XhmikosR committed
2300
2301
2302
2303
2304
2305
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
2306

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

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

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

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

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

XhmikosR's avatar
XhmikosR committed
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
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
2327
};
XhmikosR's avatar
XhmikosR committed
2328
var ClassName$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2329
2330
2331
2332
2333
2334
2335
2336
  DISABLED: 'disabled',
  SHOW: 'show',
  DROPUP: 'dropup',
  DROPRIGHT: 'dropright',
  DROPLEFT: 'dropleft',
  MENURIGHT: 'dropdown-menu-right',
  POSITION_STATIC: 'position-static'
};
XhmikosR's avatar
XhmikosR committed
2337
var Selector$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2338
2339
2340
2341
2342
2343
  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
2344
var AttachmentMap = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2345
2346
2347
2348
2349
2350
2351
2352
2353
  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
2354
var Default$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2355
2356
2357
2358
  offset: 0,
  flip: true,
  boundary: 'scrollParent',
  reference: 'toggle',
XhmikosR's avatar
XhmikosR committed
2359
2360
  display: 'dynamic',
  popperConfig: null
XhmikosR's avatar
Dist.  
XhmikosR committed
2361
};
XhmikosR's avatar
XhmikosR committed
2362
var DefaultType$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2363
2364
2365
2366
  offset: '(number|string|function)',
  flip: 'boolean',
  boundary: '(string|element)',
  reference: '(string|element)',
XhmikosR's avatar
XhmikosR committed
2367
2368
  display: 'string',
  popperConfig: '(null|object)'
XhmikosR's avatar
Dist.  
XhmikosR committed
2369
};
XhmikosR's avatar
XhmikosR committed
2370
2371
2372
2373
2374
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
2375

XhmikosR's avatar
XhmikosR committed
2376
2377
2378
2379
var Dropdown =
/*#__PURE__*/
function () {
  function Dropdown(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
    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
2392
  var _proto = Dropdown.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
2393

XhmikosR's avatar
XhmikosR committed
2394
2395
  // Public
  _proto.toggle = function toggle() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2396
2397
2398
2399
    if (this._element.disabled || this._element.classList.contains(ClassName$4.DISABLED)) {
      return;
    }

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

XhmikosR's avatar
XhmikosR committed
2402
    Dropdown.clearMenus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2403
2404
2405
2406
2407

    if (isActive) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2408
2409
2410
2411
2412
2413
2414
2415
2416
    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
2417
    var relatedTarget = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2418
2419
      relatedTarget: this._element
    };
XhmikosR's avatar
XhmikosR committed
2420
    var showEvent = EventHandler.trigger(parent, Event$5.SHOW, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431

    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
2432
      var referenceElement = this._element;
XhmikosR's avatar
Dist.  
XhmikosR committed
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458

      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
2459
2460
2461
      makeArray(document.body.children).forEach(function (elem) {
        return EventHandler.on(elem, 'mouseover', null, noop());
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
2462
2463
2464
2465
2466
2467
2468
2469
2470
    }

    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
2471
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2472

XhmikosR's avatar
XhmikosR committed
2473
  _proto.hide = function hide() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2474
2475
2476
2477
    if (this._element.disabled || this._element.classList.contains(ClassName$4.DISABLED) || !this._menu.classList.contains(ClassName$4.SHOW)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2478
    var parent = Dropdown.getParentFromElement(this._element);
XhmikosR's avatar
XhmikosR committed
2479
    var relatedTarget = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2480
2481
      relatedTarget: this._element
    };
XhmikosR's avatar
XhmikosR committed
2482
    var hideEvent = EventHandler.trigger(parent, Event$5.HIDE, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2483
2484
2485
2486
2487

    if (hideEvent.defaultPrevented) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2488
2489
2490
2491
    if (this._popper) {
      this._popper.destroy();
    }

XhmikosR's avatar
Dist.  
XhmikosR committed
2492
2493
2494
    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
2495
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2496

XhmikosR's avatar
XhmikosR committed
2497
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2498
2499
2500
2501
2502
    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
2503
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2504
2505
2506
2507
      this._popper.destroy();

      this._popper = null;
    }
XhmikosR's avatar
XhmikosR committed
2508
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2509

XhmikosR's avatar
XhmikosR committed
2510
  _proto.update = function update() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2511
2512
    this._inNavbar = this._detectNavbar();

XhmikosR's avatar
XhmikosR committed
2513
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2514
2515
2516
      this._popper.scheduleUpdate();
    }
  } // Private
XhmikosR's avatar
XhmikosR committed
2517
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2518

XhmikosR's avatar
XhmikosR committed
2519
2520
  _proto._addEventListeners = function _addEventListeners() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2521

XhmikosR's avatar
XhmikosR committed
2522
    EventHandler.on(this._element, Event$5.CLICK, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2523
2524
      event.preventDefault();
      event.stopPropagation();
XhmikosR's avatar
XhmikosR committed
2525
2526

      _this.toggle();
XhmikosR's avatar
Dist.  
XhmikosR committed
2527
    });
XhmikosR's avatar
XhmikosR committed
2528
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2529

XhmikosR's avatar
XhmikosR committed
2530
  _proto._getConfig = function _getConfig(config) {
2531
    config = _objectSpread2({}, this.constructor.Default, {}, Manipulator.getDataAttributes(this._element), {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2532
2533
    typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
    return config;
XhmikosR's avatar
XhmikosR committed
2534
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2535

XhmikosR's avatar
XhmikosR committed
2536
  _proto._getMenuElement = function _getMenuElement() {
XhmikosR's avatar
XhmikosR committed
2537
    var parent = Dropdown.getParentFromElement(this._element);
2538
    return SelectorEngine.findOne(Selector$4.MENU, parent);
XhmikosR's avatar
XhmikosR committed
2539
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2540

XhmikosR's avatar
XhmikosR committed
2541
2542
2543
  _proto._getPlacement = function _getPlacement() {
    var parentDropdown = this._element.parentNode;
    var placement = AttachmentMap.BOTTOM; // Handle dropup
XhmikosR's avatar
Dist.  
XhmikosR committed
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559

    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
2560
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2561

XhmikosR's avatar
XhmikosR committed
2562
  _proto._detectNavbar = function _detectNavbar() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2563
    return Boolean(SelectorEngine.closest(this._element, '.navbar'));
XhmikosR's avatar
XhmikosR committed
2564
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2565

XhmikosR's avatar
XhmikosR committed
2566
2567
2568
2569
  _proto._getOffset = function _getOffset() {
    var _this2 = this;

    var offset = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
2570
2571

    if (typeof this._config.offset === 'function') {
XhmikosR's avatar
XhmikosR committed
2572
      offset.fn = function (data) {
2573
        data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {});
XhmikosR's avatar
Dist.  
XhmikosR committed
2574
2575
2576
2577
2578
2579
2580
        return data;
      };
    } else {
      offset.offset = this._config.offset;
    }

    return offset;
XhmikosR's avatar
XhmikosR committed
2581
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2582

XhmikosR's avatar
XhmikosR committed
2583
2584
  _proto._getPopperConfig = function _getPopperConfig() {
    var popperConfig = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2585
2586
2587
2588
2589
2590
2591
2592
2593
      placement: this._getPlacement(),
      modifiers: {
        offset: this._getOffset(),
        flip: {
          enabled: this._config.flip
        },
        preventOverflow: {
          boundariesElement: this._config.boundary
        }
XhmikosR's avatar
XhmikosR committed
2594
2595
      }
    }; // Disable Popper.js if we have a static display
XhmikosR's avatar
Dist.  
XhmikosR committed
2596
2597
2598
2599
2600
2601
2602

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

XhmikosR's avatar
XhmikosR committed
2603
    return _objectSpread2({}, popperConfig, {}, this._config.popperConfig);
XhmikosR's avatar
Dist.  
XhmikosR committed
2604
  } // Static
XhmikosR's avatar
XhmikosR committed
2605
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2606

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

XhmikosR's avatar
XhmikosR committed
2610
    var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
2611
2612
2613
2614
2615
2616
2617

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

    if (typeof config === 'string') {
      if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
2618
        throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
2619
2620
2621
2622
      }

      data[config]();
    }
XhmikosR's avatar
XhmikosR committed
2623
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2624

XhmikosR's avatar
XhmikosR committed
2625
  Dropdown.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2626
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
2627
      Dropdown.dropdownInterface(this, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2628
    });
XhmikosR's avatar
XhmikosR committed
2629
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2630

XhmikosR's avatar
XhmikosR committed
2631
  Dropdown.clearMenus = function clearMenus(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2632
2633
2634
2635
    if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
      return;
    }

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

XhmikosR's avatar
XhmikosR committed
2638
    for (var i = 0, len = toggles.length; i < len; i++) {
XhmikosR's avatar
XhmikosR committed
2639
      var parent = Dropdown.getParentFromElement(toggles[i]);
XhmikosR's avatar
XhmikosR committed
2640
2641
      var context = Data.getData(toggles[i], DATA_KEY$4);
      var relatedTarget = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
        relatedTarget: toggles[i]
      };

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

      if (!context) {
        continue;
      }

XhmikosR's avatar
XhmikosR committed
2653
      var dropdownMenu = context._menu;
XhmikosR's avatar
Dist.  
XhmikosR committed
2654
2655
2656
2657
2658
2659
2660
2661
2662

      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
2663
      var hideEvent = EventHandler.trigger(parent, Event$5.HIDE, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2664
2665
2666
2667
2668
2669
2670
2671

      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
2672
2673
2674
        makeArray(document.body.children).forEach(function (elem) {
          return EventHandler.off(elem, 'mouseover', null, noop());
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
2675
2676
2677
      }

      toggles[i].setAttribute('aria-expanded', 'false');
XhmikosR's avatar
XhmikosR committed
2678
2679
2680
2681
2682

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

XhmikosR's avatar
Dist.  
XhmikosR committed
2683
2684
2685
2686
      dropdownMenu.classList.remove(ClassName$4.SHOW);
      parent.classList.remove(ClassName$4.SHOW);
      EventHandler.trigger(parent, Event$5.HIDDEN, relatedTarget);
    }
XhmikosR's avatar
XhmikosR committed
2687
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2688

XhmikosR's avatar
XhmikosR committed
2689
2690
  Dropdown.getParentFromElement = function getParentFromElement(element) {
    return getElementFromSelector(element) || element.parentNode;
XhmikosR's avatar
XhmikosR committed
2691
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2692

XhmikosR's avatar
XhmikosR committed
2693
  Dropdown.dataApiKeydownHandler = function dataApiKeydownHandler(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
    // 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
2712
    var parent = Dropdown.getParentFromElement(this);
XhmikosR's avatar
XhmikosR committed
2713
    var isActive = parent.classList.contains(ClassName$4.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
2714
2715
2716

    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
2717
        SelectorEngine.findOne(Selector$4.DATA_TOGGLE, parent).focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2718
2719
      }

XhmikosR's avatar
XhmikosR committed
2720
      Dropdown.clearMenus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2721
2722
2723
      return;
    }

XhmikosR's avatar
XhmikosR committed
2724
    var items = makeArray(SelectorEngine.find(Selector$4.VISIBLE_ITEMS, parent));
XhmikosR's avatar
Dist.  
XhmikosR committed
2725
2726
2727
2728
2729

    if (!items.length) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2730
    var index = items.indexOf(event.target);
XhmikosR's avatar
Dist.  
XhmikosR committed
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746

    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
2747
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2748

XhmikosR's avatar
XhmikosR committed
2749
  Dropdown.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2750
    return Data.getData(element, DATA_KEY$4);
XhmikosR's avatar
XhmikosR committed
2751
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2752

XhmikosR's avatar
XhmikosR committed
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
  _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
2772
2773
2774
2775
2776
2777
2778
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
2779
2780
2781
2782
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
2783
2784
2785
EventHandler.on(document, Event$5.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {
  event.preventDefault();
  event.stopPropagation();
XhmikosR's avatar
XhmikosR committed
2786
  Dropdown.dropdownInterface(this, 'toggle');
XhmikosR's avatar
Dist.  
XhmikosR committed
2787
});
XhmikosR's avatar
XhmikosR committed
2788
2789
2790
EventHandler.on(document, Event$5.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
  return e.stopPropagation();
});
XhmikosR's avatar
XhmikosR committed
2791
var $$5 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
2792
2793
2794
2795
2796
2797
2798
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .dropdown to jQuery only if jQuery is present
 */

2799
2800
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
2801
2802
2803
2804
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
2805

XhmikosR's avatar
XhmikosR committed
2806
2807
2808
  $$5.fn[NAME$4].noConflict = function () {
    $$5.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
    return Dropdown.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
2809
2810
2811
2812
2813
2814
2815
2816
2817
  };
}

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

XhmikosR's avatar
XhmikosR committed
2818
2819
2820
2821
2822
2823
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
2824

XhmikosR's avatar
XhmikosR committed
2825
var Default$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2826
2827
2828
2829
2830
  backdrop: true,
  keyboard: true,
  focus: true,
  show: true
};
XhmikosR's avatar
XhmikosR committed
2831
var DefaultType$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2832
2833
2834
2835
2836
  backdrop: '(boolean|string)',
  keyboard: 'boolean',
  focus: 'boolean',
  show: 'boolean'
};
XhmikosR's avatar
XhmikosR committed
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
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
2849
};
XhmikosR's avatar
XhmikosR committed
2850
var ClassName$5 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2851
2852
2853
2854
2855
2856
2857
  SCROLLABLE: 'modal-dialog-scrollable',
  SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  BACKDROP: 'modal-backdrop',
  OPEN: 'modal-open',
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
2858
var Selector$5 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2859
2860
2861
2862
2863
2864
2865
  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'
};
XhmikosR's avatar
XhmikosR committed
2866
2867
2868
2869
2870
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
2871

XhmikosR's avatar
XhmikosR committed
2872
2873
2874
2875
var Modal =
/*#__PURE__*/
function () {
  function Modal(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
    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
2889
  var _proto = Modal.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
2890

XhmikosR's avatar
XhmikosR committed
2891
2892
  // Public
  _proto.toggle = function toggle(relatedTarget) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2893
    return this._isShown ? this.hide() : this.show(relatedTarget);
XhmikosR's avatar
XhmikosR committed
2894
2895
2896
2897
  };

  _proto.show = function show(relatedTarget) {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2898
2899
2900
2901
2902
2903
2904
2905
2906

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

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

XhmikosR's avatar
XhmikosR committed
2907
2908
    var showEvent = EventHandler.trigger(this._element, Event$6.SHOW, {
      relatedTarget: relatedTarget
XhmikosR's avatar
Dist.  
XhmikosR committed
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
    });

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

    this._isShown = true;

    this._checkScrollbar();

    this._setScrollbar();

    this._adjustDialog();

    this._setEscapeEvent();

    this._setResizeEvent();

XhmikosR's avatar
XhmikosR committed
2927
2928
2929
2930
2931
2932
2933
    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
2934
2935
2936
2937
        }
      });
    });

XhmikosR's avatar
XhmikosR committed
2938
2939
2940
2941
2942
2943
2944
    this._showBackdrop(function () {
      return _this._showElement(relatedTarget);
    });
  };

  _proto.hide = function hide(event) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2945
2946
2947
2948
2949
2950
2951
2952
2953

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

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

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

2956
    if (hideEvent.defaultPrevented) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2957
2958
2959
2960
2961
      return;
    }

    this._isShown = false;

XhmikosR's avatar
XhmikosR committed
2962
    var transition = this._element.classList.contains(ClassName$5.FADE);
XhmikosR's avatar
Dist.  
XhmikosR committed
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979

    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
2980
2981
2982
2983
      var transitionDuration = getTransitionDurationFromElement(this._element);
      EventHandler.one(this._element, TRANSITION_END, function (event) {
        return _this2._hideModal(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
2984
2985
2986
2987
      emulateTransitionEnd(this._element, transitionDuration);
    } else {
      this._hideModal();
    }
XhmikosR's avatar
XhmikosR committed
2988
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2989

XhmikosR's avatar
XhmikosR committed
2990
2991
2992
2993
  _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
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
    /**
     * `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
3011
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3012

XhmikosR's avatar
XhmikosR committed
3013
  _proto.handleUpdate = function handleUpdate() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3014
3015
    this._adjustDialog();
  } // Private
XhmikosR's avatar
XhmikosR committed
3016
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3017

XhmikosR's avatar
XhmikosR committed
3018
  _proto._getConfig = function _getConfig(config) {
3019
    config = _objectSpread2({}, Default$3, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
3020
3021
    typeCheckConfig(NAME$5, config, DefaultType$3);
    return config;
XhmikosR's avatar
XhmikosR committed
3022
3023
3024
3025
  };

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

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

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

XhmikosR's avatar
Dist.  
XhmikosR committed
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
    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
3042
3043
    if (this._dialog.classList.contains(ClassName$5.SCROLLABLE) && modalBody) {
      modalBody.scrollTop = 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
    } 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
3058
3059
3060
    var transitionComplete = function transitionComplete() {
      if (_this3._config.focus) {
        _this3._element.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3061
3062
      }

XhmikosR's avatar
XhmikosR committed
3063
3064
3065
      _this3._isTransitioning = false;
      EventHandler.trigger(_this3._element, Event$6.SHOWN, {
        relatedTarget: relatedTarget
XhmikosR's avatar
Dist.  
XhmikosR committed
3066
3067
3068
3069
      });
    };

    if (transition) {
XhmikosR's avatar
XhmikosR committed
3070
      var transitionDuration = getTransitionDurationFromElement(this._dialog);
XhmikosR's avatar
Dist.  
XhmikosR committed
3071
3072
3073
3074
3075
      EventHandler.one(this._dialog, TRANSITION_END, transitionComplete);
      emulateTransitionEnd(this._dialog, transitionDuration);
    } else {
      transitionComplete();
    }
XhmikosR's avatar
XhmikosR committed
3076
3077
3078
3079
  };

  _proto._enforceFocus = function _enforceFocus() {
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3080
3081
3082

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

XhmikosR's avatar
XhmikosR committed
3083
3084
3085
    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
3086
3087
      }
    });
XhmikosR's avatar
XhmikosR committed
3088
3089
3090
3091
  };

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

    if (this._isShown && this._config.keyboard) {
XhmikosR's avatar
XhmikosR committed
3094
      EventHandler.on(this._element, Event$6.KEYDOWN_DISMISS, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3095
3096
        if (event.which === ESCAPE_KEYCODE$1) {
          event.preventDefault();
XhmikosR's avatar
XhmikosR committed
3097
3098

          _this5.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
3099
3100
        }
      });
3101
    } else {
XhmikosR's avatar
Dist.  
XhmikosR committed
3102
3103
      EventHandler.off(this._element, Event$6.KEYDOWN_DISMISS);
    }
XhmikosR's avatar
XhmikosR committed
3104
3105
3106
3107
  };

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

    if (this._isShown) {
3110
3111
      EventHandler.on(window, Event$6.RESIZE, function () {
        return _this6._adjustDialog();
XhmikosR's avatar
XhmikosR committed
3112
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
3113
3114
3115
    } else {
      EventHandler.off(window, Event$6.RESIZE);
    }
XhmikosR's avatar
XhmikosR committed
3116
3117
3118
3119
  };

  _proto._hideModal = function _hideModal() {
    var _this7 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3120
3121
3122
3123
3124
3125
3126
3127
3128

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

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

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

    this._isTransitioning = false;

XhmikosR's avatar
XhmikosR committed
3129
    this._showBackdrop(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
3130
3131
      document.body.classList.remove(ClassName$5.OPEN);

XhmikosR's avatar
XhmikosR committed
3132
      _this7._resetAdjustments();
XhmikosR's avatar
Dist.  
XhmikosR committed
3133

XhmikosR's avatar
XhmikosR committed
3134
      _this7._resetScrollbar();
XhmikosR's avatar
Dist.  
XhmikosR committed
3135

XhmikosR's avatar
XhmikosR committed
3136
      EventHandler.trigger(_this7._element, Event$6.HIDDEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3137
    });
XhmikosR's avatar
XhmikosR committed
3138
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3139

XhmikosR's avatar
XhmikosR committed
3140
  _proto._removeBackdrop = function _removeBackdrop() {
3141
    this._backdrop.parentNode.removeChild(this._backdrop);
XhmikosR's avatar
Dist.  
XhmikosR committed
3142

3143
    this._backdrop = null;
XhmikosR's avatar
XhmikosR committed
3144
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3145

XhmikosR's avatar
XhmikosR committed
3146
3147
3148
3149
  _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
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159

    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
3160
3161
3162
      EventHandler.on(this._element, Event$6.CLICK_DISMISS, function (event) {
        if (_this8._ignoreBackdropClick) {
          _this8._ignoreBackdropClick = false;
XhmikosR's avatar
Dist.  
XhmikosR committed
3163
3164
3165
3166
3167
3168
3169
          return;
        }

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

XhmikosR's avatar
XhmikosR committed
3170
3171
        if (_this8._config.backdrop === 'static') {
          _this8._element.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3172
        } else {
XhmikosR's avatar
XhmikosR committed
3173
          _this8.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
        }
      });

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

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

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

XhmikosR's avatar
XhmikosR committed
3188
      var backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);
XhmikosR's avatar
Dist.  
XhmikosR committed
3189
3190
3191
3192
3193
      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
3194
3195
      var callbackRemove = function callbackRemove() {
        _this8._removeBackdrop();
XhmikosR's avatar
Dist.  
XhmikosR committed
3196

3197
        callback();
XhmikosR's avatar
Dist.  
XhmikosR committed
3198
3199
3200
      };

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

XhmikosR's avatar
Dist.  
XhmikosR committed
3203
        EventHandler.one(this._backdrop, TRANSITION_END, callbackRemove);
XhmikosR's avatar
XhmikosR committed
3204
        emulateTransitionEnd(this._backdrop, _backdropTransitionDuration);
XhmikosR's avatar
Dist.  
XhmikosR committed
3205
3206
3207
      } else {
        callbackRemove();
      }
3208
    } else {
XhmikosR's avatar
Dist.  
XhmikosR committed
3209
3210
3211
3212
3213
      callback();
    }
  } // ----------------------------------------------------------------------
  // the following methods are used to handle overflowing modals
  // ----------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
3214
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3215

XhmikosR's avatar
XhmikosR committed
3216
3217
  _proto._adjustDialog = function _adjustDialog() {
    var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
XhmikosR's avatar
Dist.  
XhmikosR committed
3218
3219

    if (!this._isBodyOverflowing && isModalOverflowing) {
XhmikosR's avatar
XhmikosR committed
3220
      this._element.style.paddingLeft = this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3221
3222
3223
    }

    if (this._isBodyOverflowing && !isModalOverflowing) {
XhmikosR's avatar
XhmikosR committed
3224
      this._element.style.paddingRight = this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3225
    }
XhmikosR's avatar
XhmikosR committed
3226
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3227

XhmikosR's avatar
XhmikosR committed
3228
  _proto._resetAdjustments = function _resetAdjustments() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3229
3230
    this._element.style.paddingLeft = '';
    this._element.style.paddingRight = '';
XhmikosR's avatar
XhmikosR committed
3231
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3232

XhmikosR's avatar
XhmikosR committed
3233
3234
  _proto._checkScrollbar = function _checkScrollbar() {
    var rect = document.body.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
3235
3236
    this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
    this._scrollbarWidth = this._getScrollbarWidth();
XhmikosR's avatar
XhmikosR committed
3237
3238
3239
3240
  };

  _proto._setScrollbar = function _setScrollbar() {
    var _this9 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3241
3242
3243
3244
3245

    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
3246
3247
3248
      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
3249
        Manipulator.setDataAttribute(element, 'padding-right', actualPadding);
XhmikosR's avatar
XhmikosR committed
3250
        element.style.paddingRight = parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3251
3252
      }); // Adjust sticky content margin

XhmikosR's avatar
XhmikosR committed
3253
3254
3255
      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
3256
        Manipulator.setDataAttribute(element, 'margin-right', actualMargin);
XhmikosR's avatar
XhmikosR committed
3257
        element.style.marginRight = parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3258
3259
      }); // Adjust body padding

XhmikosR's avatar
XhmikosR committed
3260
3261
      var actualPadding = document.body.style.paddingRight;
      var calculatedPadding = window.getComputedStyle(document.body)['padding-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3262
      Manipulator.setDataAttribute(document.body, 'padding-right', actualPadding);
XhmikosR's avatar
XhmikosR committed
3263
      document.body.style.paddingRight = parseFloat(calculatedPadding) + this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3264
3265
3266
    }

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

XhmikosR's avatar
XhmikosR committed
3269
  _proto._resetScrollbar = function _resetScrollbar() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3270
    // Restore fixed content padding
XhmikosR's avatar
XhmikosR committed
3271
3272
    makeArray(SelectorEngine.find(Selector$5.FIXED_CONTENT)).forEach(function (element) {
      var padding = Manipulator.getDataAttribute(element, 'padding-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3273
3274
3275
3276
3277
3278
3279

      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
3280
3281
    makeArray(SelectorEngine.find("" + Selector$5.STICKY_CONTENT)).forEach(function (element) {
      var margin = Manipulator.getDataAttribute(element, 'margin-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3282
3283
3284
3285
3286
3287
3288

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

XhmikosR's avatar
XhmikosR committed
3289
    var padding = Manipulator.getDataAttribute(document.body, 'padding-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3290
3291
3292
3293
3294
3295
3296

    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
3297
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3298

XhmikosR's avatar
XhmikosR committed
3299
  _proto._getScrollbarWidth = function _getScrollbarWidth() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3300
    // thx d.walsh
XhmikosR's avatar
XhmikosR committed
3301
    var scrollDiv = document.createElement('div');
XhmikosR's avatar
Dist.  
XhmikosR committed
3302
3303
    scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
    document.body.appendChild(scrollDiv);
XhmikosR's avatar
XhmikosR committed
3304
    var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
XhmikosR's avatar
Dist.  
XhmikosR committed
3305
3306
3307
    document.body.removeChild(scrollDiv);
    return scrollbarWidth;
  } // Static
XhmikosR's avatar
XhmikosR committed
3308
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3309

XhmikosR's avatar
XhmikosR committed
3310
  Modal.jQueryInterface = function jQueryInterface(config, relatedTarget) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3311
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
3312
      var data = Data.getData(this, DATA_KEY$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
3313

3314
      var _config = _objectSpread2({}, Default$3, {}, Manipulator.getDataAttributes(this), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
3315
3316
3317
3318
3319
3320
3321

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

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
3322
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
3323
3324
3325
3326
3327
3328
3329
        }

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

XhmikosR's avatar
XhmikosR committed
3332
  Modal.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3333
    return Data.getData(element, DATA_KEY$5);
XhmikosR's avatar
XhmikosR committed
3334
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3335

XhmikosR's avatar
XhmikosR committed
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
  _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
3350
3351
3352
3353
3354
3355
3356
3357
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


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

XhmikosR's avatar
XhmikosR committed
3360
  var target = getElementFromSelector(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
3361
3362
3363
3364
3365

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

XhmikosR's avatar
XhmikosR committed
3366
  EventHandler.one(target, Event$6.SHOW, function (showEvent) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3367
3368
3369
3370
3371
    if (showEvent.defaultPrevented) {
      // only register focus restorer if modal will actually get shown
      return;
    }

XhmikosR's avatar
XhmikosR committed
3372
3373
3374
    EventHandler.one(target, Event$6.HIDDEN, function () {
      if (isVisible(_this10)) {
        _this10.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3375
3376
3377
      }
    });
  });
XhmikosR's avatar
XhmikosR committed
3378
  var data = Data.getData(target, DATA_KEY$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
3379
3380

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

XhmikosR's avatar
Dist.  
XhmikosR committed
3383
3384
3385
3386
3387
    data = new Modal(target, config);
  }

  data.show(this);
});
XhmikosR's avatar
XhmikosR committed
3388
var $$6 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
3389
3390
3391
3392
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
3393
 * add .modal to jQuery only if jQuery is present
XhmikosR's avatar
Dist.  
XhmikosR committed
3394
3395
 */

3396
3397
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
3398
3399
3400
3401
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
3402

XhmikosR's avatar
XhmikosR committed
3403
3404
3405
  $$6.fn[NAME$5].noConflict = function () {
    $$6.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
    return Modal.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
3406
3407
3408
3409
3410
3411
3412
3413
3414
  };
}

/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): util/sanitizer.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
XhmikosR's avatar
XhmikosR committed
3415
3416
var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
XhmikosR's avatar
Dist.  
XhmikosR committed
3417
3418
3419
3420
3421
3422
/**
 * 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
3423
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
XhmikosR's avatar
Dist.  
XhmikosR committed
3424
3425
3426
3427
3428
3429
/**
 * 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
3430
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
3431

XhmikosR's avatar
XhmikosR committed
3432
3433
var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
  var attrName = attr.nodeName.toLowerCase();
XhmikosR's avatar
Dist.  
XhmikosR committed
3434
3435
3436
3437
3438
3439
3440
3441
3442

  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
3443
3444
3445
  var regExp = allowedAttributeList.filter(function (attrRegex) {
    return attrRegex instanceof RegExp;
  }); // Check if a regular expression validates the attribute.
XhmikosR's avatar
Dist.  
XhmikosR committed
3446

XhmikosR's avatar
XhmikosR committed
3447
  for (var i = 0, l = regExp.length; i < l; i++) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3448
3449
3450
3451
3452
3453
3454
3455
    if (attrName.match(regExp[i])) {
      return true;
    }
  }

  return false;
};

XhmikosR's avatar
XhmikosR committed
3456
var DefaultWhitelist = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
  // 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
3498
3499
3500
3501
  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
3502

XhmikosR's avatar
XhmikosR committed
3503
3504
3505
  var _loop = function _loop(i, len) {
    var el = elements[i];
    var elName = el.nodeName.toLowerCase();
XhmikosR's avatar
Dist.  
XhmikosR committed
3506
3507
3508

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

XhmikosR's avatar
XhmikosR committed
3512
3513
3514
    var attributeList = makeArray(el.attributes);
    var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
    attributeList.forEach(function (attr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3515
3516
3517
3518
      if (!allowedAttribute(attr, whitelistedAttributes)) {
        el.removeAttribute(attr.nodeName);
      }
    });
XhmikosR's avatar
XhmikosR committed
3519
3520
3521
  };

  for (var i = 0, len = elements.length; i < len; i++) {
3522
    var _ret = _loop(i);
XhmikosR's avatar
XhmikosR committed
3523
3524

    if (_ret === "continue") continue;
XhmikosR's avatar
Dist.  
XhmikosR committed
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
  }

  return createdDocument.body.innerHTML;
}

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

XhmikosR's avatar
XhmikosR committed
3536
3537
3538
3539
3540
3541
3542
3543
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
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
  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
3558
3559
  whiteList: 'object',
  popperConfig: '(null|object)'
XhmikosR's avatar
Dist.  
XhmikosR committed
3560
};
XhmikosR's avatar
XhmikosR committed
3561
var AttachmentMap$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3562
3563
3564
3565
3566
3567
  AUTO: 'auto',
  TOP: 'top',
  RIGHT: 'right',
  BOTTOM: 'bottom',
  LEFT: 'left'
};
XhmikosR's avatar
XhmikosR committed
3568
var Default$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
  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
3583
3584
  whiteList: DefaultWhitelist,
  popperConfig: null
XhmikosR's avatar
Dist.  
XhmikosR committed
3585
};
XhmikosR's avatar
XhmikosR committed
3586
var HoverState = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3587
3588
3589
  SHOW: 'show',
  OUT: 'out'
};
XhmikosR's avatar
XhmikosR committed
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
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
3601
};
XhmikosR's avatar
XhmikosR committed
3602
var ClassName$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3603
3604
3605
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
3606
var Selector$6 = {
Mark Otto's avatar
dist v5    
Mark Otto committed
3607
  TOOLTIP_INNER: '.tooltip-inner'
XhmikosR's avatar
Dist.  
XhmikosR committed
3608
};
XhmikosR's avatar
XhmikosR committed
3609
var Trigger = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3610
3611
3612
3613
3614
  HOVER: 'hover',
  FOCUS: 'focus',
  CLICK: 'click',
  MANUAL: 'manual'
};
XhmikosR's avatar
XhmikosR committed
3615
3616
3617
3618
3619
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
3620

XhmikosR's avatar
XhmikosR committed
3621
3622
3623
3624
var Tooltip =
/*#__PURE__*/
function () {
  function Tooltip(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
    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
3646
  var _proto = Tooltip.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
3647

XhmikosR's avatar
XhmikosR committed
3648
3649
  // Public
  _proto.enable = function enable() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3650
    this._isEnabled = true;
XhmikosR's avatar
XhmikosR committed
3651
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3652

XhmikosR's avatar
XhmikosR committed
3653
  _proto.disable = function disable() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3654
    this._isEnabled = false;
XhmikosR's avatar
XhmikosR committed
3655
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3656

XhmikosR's avatar
XhmikosR committed
3657
  _proto.toggleEnabled = function toggleEnabled() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3658
    this._isEnabled = !this._isEnabled;
XhmikosR's avatar
XhmikosR committed
3659
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3660

XhmikosR's avatar
XhmikosR committed
3661
  _proto.toggle = function toggle(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3662
3663
3664
3665
3666
    if (!this._isEnabled) {
      return;
    }

    if (event) {
XhmikosR's avatar
XhmikosR committed
3667
3668
      var dataKey = this.constructor.DATA_KEY;
      var context = Data.getData(event.delegateTarget, dataKey);
XhmikosR's avatar
Dist.  
XhmikosR committed
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690

      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
3691
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3692

XhmikosR's avatar
XhmikosR committed
3693
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3694
3695
3696
    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
3697
    EventHandler.off(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler);
XhmikosR's avatar
Dist.  
XhmikosR committed
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707

    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
3708
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3709
3710
3711
3712
3713
3714
3715
      this._popper.destroy();
    }

    this._popper = null;
    this.element = null;
    this.config = null;
    this.tip = null;
XhmikosR's avatar
XhmikosR committed
3716
3717
3718
3719
  };

  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3720
3721
3722
3723
3724
3725

    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
3726
3727
3728
      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
3729
3730
3731
3732
3733

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

XhmikosR's avatar
XhmikosR committed
3734
3735
      var tip = this.getTipElement();
      var tipId = getUID(this.constructor.NAME);
XhmikosR's avatar
Dist.  
XhmikosR committed
3736
3737
3738
3739
3740
3741
3742
3743
      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
3744
      var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
XhmikosR's avatar
Dist.  
XhmikosR committed
3745

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

3748
      this._addAttachmentClass(attachment);
XhmikosR's avatar
Dist.  
XhmikosR committed
3749

XhmikosR's avatar
XhmikosR committed
3750
      var container = this._getContainer();
XhmikosR's avatar
Dist.  
XhmikosR committed
3751
3752
3753
3754
3755
3756
3757
3758

      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
3759
      this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
XhmikosR's avatar
Dist.  
XhmikosR committed
3760
3761
3762
3763
3764
3765
      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
3766
        makeArray(document.body.children).forEach(function (element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3767
3768
3769
3770
          EventHandler.on(element, 'mouseover', noop());
        });
      }

XhmikosR's avatar
XhmikosR committed
3771
3772
3773
      var complete = function complete() {
        if (_this.config.animation) {
          _this._fixTransition();
XhmikosR's avatar
Dist.  
XhmikosR committed
3774
3775
        }

XhmikosR's avatar
XhmikosR committed
3776
3777
3778
        var prevHoverState = _this._hoverState;
        _this._hoverState = null;
        EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3779
3780

        if (prevHoverState === HoverState.OUT) {
XhmikosR's avatar
XhmikosR committed
3781
          _this._leave(null, _this);
XhmikosR's avatar
Dist.  
XhmikosR committed
3782
3783
3784
3785
        }
      };

      if (this.tip.classList.contains(ClassName$6.FADE)) {
XhmikosR's avatar
XhmikosR committed
3786
        var transitionDuration = getTransitionDurationFromElement(this.tip);
XhmikosR's avatar
Dist.  
XhmikosR committed
3787
3788
3789
3790
3791
3792
        EventHandler.one(this.tip, TRANSITION_END, complete);
        emulateTransitionEnd(this.tip, transitionDuration);
      } else {
        complete();
      }
    }
XhmikosR's avatar
XhmikosR committed
3793
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3794

3795
  _proto.hide = function hide() {
XhmikosR's avatar
XhmikosR committed
3796
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3797

XhmikosR's avatar
XhmikosR committed
3798
3799
3800
3801
    var tip = this.getTipElement();

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

XhmikosR's avatar
XhmikosR committed
3805
3806
3807
      _this2._cleanTipClass();

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

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

3811
      _this2._popper.destroy();
XhmikosR's avatar
Dist.  
XhmikosR committed
3812
3813
    };

XhmikosR's avatar
XhmikosR committed
3814
    var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
3815
3816
3817
3818
3819
3820
3821
3822
3823

    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
3824
3825
3826
      makeArray(document.body.children).forEach(function (element) {
        return EventHandler.off(element, 'mouseover', noop);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
3827
3828
3829
3830
3831
3832
3833
    }

    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
3834
      var transitionDuration = getTransitionDurationFromElement(tip);
XhmikosR's avatar
Dist.  
XhmikosR committed
3835
3836
3837
3838
3839
3840
3841
      EventHandler.one(tip, TRANSITION_END, complete);
      emulateTransitionEnd(tip, transitionDuration);
    } else {
      complete();
    }

    this._hoverState = '';
XhmikosR's avatar
XhmikosR committed
3842
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3843

XhmikosR's avatar
XhmikosR committed
3844
  _proto.update = function update() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3845
3846
3847
3848
    if (this._popper !== null) {
      this._popper.scheduleUpdate();
    }
  } // Protected
XhmikosR's avatar
XhmikosR committed
3849
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3850

XhmikosR's avatar
XhmikosR committed
3851
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3852
    return Boolean(this.getTitle());
XhmikosR's avatar
XhmikosR committed
3853
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3854

XhmikosR's avatar
XhmikosR committed
3855
  _proto.getTipElement = function getTipElement() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3856
3857
3858
3859
    if (this.tip) {
      return this.tip;
    }

XhmikosR's avatar
XhmikosR committed
3860
    var element = document.createElement('div');
XhmikosR's avatar
Dist.  
XhmikosR committed
3861
3862
3863
    element.innerHTML = this.config.template;
    this.tip = element.children[0];
    return this.tip;
XhmikosR's avatar
XhmikosR committed
3864
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3865

XhmikosR's avatar
XhmikosR committed
3866
3867
  _proto.setContent = function setContent() {
    var tip = this.getTipElement();
XhmikosR's avatar
Dist.  
XhmikosR committed
3868
3869
3870
    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
3871
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3872

XhmikosR's avatar
XhmikosR committed
3873
  _proto.setElementContent = function setElementContent(element, content) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3874
3875
3876
3877
    if (element === null) {
      return;
    }

3878
    if (typeof content === 'object' && isElement(content)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
      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
3905
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3906

XhmikosR's avatar
XhmikosR committed
3907
3908
  _proto.getTitle = function getTitle() {
    var title = this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
3909
3910
3911
3912
3913
3914
3915

    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
3916
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3917

XhmikosR's avatar
XhmikosR committed
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
  _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);
  };

3947
3948
3949
3950
  _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
    this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment);
  };

XhmikosR's avatar
XhmikosR committed
3951
  _proto._getOffset = function _getOffset() {
XhmikosR's avatar
XhmikosR committed
3952
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3953

XhmikosR's avatar
XhmikosR committed
3954
    var offset = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
3955
3956

    if (typeof this.config.offset === 'function') {
XhmikosR's avatar
XhmikosR committed
3957
      offset.fn = function (data) {
XhmikosR's avatar
XhmikosR committed
3958
        data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
XhmikosR's avatar
Dist.  
XhmikosR committed
3959
3960
3961
3962
3963
3964
3965
        return data;
      };
    } else {
      offset.offset = this.config.offset;
    }

    return offset;
XhmikosR's avatar
XhmikosR committed
3966
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3967

XhmikosR's avatar
XhmikosR committed
3968
  _proto._getContainer = function _getContainer() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3969
3970
3971
3972
3973
3974
3975
3976
3977
    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
3978
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3979

XhmikosR's avatar
XhmikosR committed
3980
  _proto._getAttachment = function _getAttachment(placement) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3981
    return AttachmentMap$1[placement.toUpperCase()];
XhmikosR's avatar
XhmikosR committed
3982
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3983

XhmikosR's avatar
XhmikosR committed
3984
  _proto._setListeners = function _setListeners() {
XhmikosR's avatar
XhmikosR committed
3985
    var _this5 = this;
XhmikosR's avatar
XhmikosR committed
3986
3987
3988

    var triggers = this.config.trigger.split(' ');
    triggers.forEach(function (trigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3989
      if (trigger === 'click') {
XhmikosR's avatar
XhmikosR committed
3990
3991
        EventHandler.on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
          return _this5.toggle(event);
XhmikosR's avatar
XhmikosR committed
3992
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
3993
      } else if (trigger !== Trigger.MANUAL) {
XhmikosR's avatar
XhmikosR committed
3994
3995
3996
3997
        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
3998
        });
XhmikosR's avatar
XhmikosR committed
3999
4000
        EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
          return _this5._leave(event);
XhmikosR's avatar
XhmikosR committed
4001
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4002
4003
      }
    });
Mark Otto's avatar
dist v5    
Mark Otto committed
4004
4005

    this._hideModalHandler = function () {
XhmikosR's avatar
XhmikosR committed
4006
4007
      if (_this5.element) {
        _this5.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
4008
      }
Mark Otto's avatar
dist v5    
Mark Otto committed
4009
4010
4011
    };

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

    if (this.config.selector) {
4014
      this.config = _objectSpread2({}, this.config, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4015
4016
4017
4018
4019
4020
        trigger: 'manual',
        selector: ''
      });
    } else {
      this._fixTitle();
    }
XhmikosR's avatar
XhmikosR committed
4021
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4022

XhmikosR's avatar
XhmikosR committed
4023
4024
  _proto._fixTitle = function _fixTitle() {
    var titleType = typeof this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
4025
4026
4027
4028
4029

    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
4030
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4031

XhmikosR's avatar
XhmikosR committed
4032
4033
  _proto._enter = function _enter(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
    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
4058
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4059
4060
4061
4062
      if (context._hoverState === HoverState.SHOW) {
        context.show();
      }
    }, context.config.delay.show);
XhmikosR's avatar
XhmikosR committed
4063
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4064

XhmikosR's avatar
XhmikosR committed
4065
4066
  _proto._leave = function _leave(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
    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
4090
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4091
4092
4093
4094
      if (context._hoverState === HoverState.OUT) {
        context.hide();
      }
    }, context.config.delay.hide);
XhmikosR's avatar
XhmikosR committed
4095
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4096

XhmikosR's avatar
XhmikosR committed
4097
4098
  _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
    for (var trigger in this._activeTrigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4099
4100
4101
4102
4103
4104
      if (this._activeTrigger[trigger]) {
        return true;
      }
    }

    return false;
XhmikosR's avatar
XhmikosR committed
4105
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4106

XhmikosR's avatar
XhmikosR committed
4107
4108
4109
  _proto._getConfig = function _getConfig(config) {
    var dataAttributes = Manipulator.getDataAttributes(this.element);
    Object.keys(dataAttributes).forEach(function (dataAttr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4110
4111
4112
4113
4114
4115
4116
4117
4118
      if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
        delete dataAttributes[dataAttr];
      }
    });

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

4119
    config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142

    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
4143
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4144

XhmikosR's avatar
XhmikosR committed
4145
4146
  _proto._getDelegateConfig = function _getDelegateConfig() {
    var config = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
4147
4148

    if (this.config) {
XhmikosR's avatar
XhmikosR committed
4149
      for (var key in this.config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4150
4151
4152
4153
4154
4155
4156
        if (this.constructor.Default[key] !== this.config[key]) {
          config[key] = this.config[key];
        }
      }
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4157
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4158

XhmikosR's avatar
XhmikosR committed
4159
4160
4161
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
XhmikosR's avatar
Dist.  
XhmikosR committed
4162
4163

    if (tabClass !== null && tabClass.length) {
XhmikosR's avatar
XhmikosR committed
4164
4165
4166
4167
4168
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4169
    }
XhmikosR's avatar
XhmikosR committed
4170
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4171

XhmikosR's avatar
XhmikosR committed
4172
4173
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
    var popperInstance = popperData.instance;
XhmikosR's avatar
Dist.  
XhmikosR committed
4174
4175
4176
4177
    this.tip = popperInstance.popper;

    this._cleanTipClass();

4178
    this._addAttachmentClass(this._getAttachment(popperData.placement));
XhmikosR's avatar
XhmikosR committed
4179
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4180

XhmikosR's avatar
XhmikosR committed
4181
4182
4183
  _proto._fixTransition = function _fixTransition() {
    var tip = this.getTipElement();
    var initConfigAnimation = this.config.animation;
XhmikosR's avatar
Dist.  
XhmikosR committed
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194

    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
4195
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4196

XhmikosR's avatar
XhmikosR committed
4197
  Tooltip.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4198
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4199
      var data = Data.getData(this, DATA_KEY$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
4200

XhmikosR's avatar
XhmikosR committed
4201
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212

      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
4213
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4214
4215
4216
4217
4218
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4219
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4220

XhmikosR's avatar
XhmikosR committed
4221
  Tooltip.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4222
    return Data.getData(element, DATA_KEY$6);
XhmikosR's avatar
XhmikosR committed
4223
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4224

XhmikosR's avatar
XhmikosR committed
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
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
  _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
4264
4265

var $$7 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4266
4267
4268
4269
4270
4271
4272
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tooltip to jQuery only if jQuery is present
 */

4273
4274
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4275
4276
4277
4278
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
4279

XhmikosR's avatar
XhmikosR committed
4280
4281
4282
  $$7.fn[NAME$6].noConflict = function () {
    $$7.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
    return Tooltip.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4283
4284
4285
4286
4287
4288
4289
4290
4291
  };
}

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

XhmikosR's avatar
XhmikosR committed
4292
4293
4294
4295
4296
4297
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
4298

4299
var Default$5 = _objectSpread2({}, Tooltip.Default, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4300
4301
4302
4303
4304
4305
  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>'
});

4306
var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4307
4308
4309
  content: '(string|element|function)'
});

XhmikosR's avatar
XhmikosR committed
4310
var ClassName$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4311
4312
4313
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4314
var Selector$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4315
4316
4317
  TITLE: '.popover-header',
  CONTENT: '.popover-body'
};
XhmikosR's avatar
XhmikosR committed
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
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
4329
};
XhmikosR's avatar
XhmikosR committed
4330
4331
4332
4333
4334
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4335

XhmikosR's avatar
XhmikosR committed
4336
4337
4338
4339
var Popover =
/*#__PURE__*/
function (_Tooltip) {
  _inheritsLoose(Popover, _Tooltip);
XhmikosR's avatar
Dist.  
XhmikosR committed
4340

XhmikosR's avatar
XhmikosR committed
4341
4342
  function Popover() {
    return _Tooltip.apply(this, arguments) || this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4343
4344
  }

XhmikosR's avatar
XhmikosR committed
4345
  var _proto = Popover.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4346

XhmikosR's avatar
XhmikosR committed
4347
4348
  // Overrides
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4349
    return this.getTitle() || this._getContent();
XhmikosR's avatar
XhmikosR committed
4350
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4351

XhmikosR's avatar
XhmikosR committed
4352
4353
  _proto.setContent = function setContent() {
    var tip = this.getTipElement(); // we use append for html objects to maintain js events
XhmikosR's avatar
Dist.  
XhmikosR committed
4354
4355
4356

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

XhmikosR's avatar
XhmikosR committed
4357
    var content = this._getContent();
XhmikosR's avatar
Dist.  
XhmikosR committed
4358
4359
4360
4361
4362
4363
4364
4365

    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
4366
4367
4368
4369
  };

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

XhmikosR's avatar
XhmikosR committed
4373
  _proto._getContent = function _getContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4374
    return this.element.getAttribute('data-content') || this.config.content;
XhmikosR's avatar
XhmikosR committed
4375
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4376

XhmikosR's avatar
XhmikosR committed
4377
4378
4379
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4380
4381

    if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4382
4383
4384
4385
4386
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4387
4388
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4389
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4390

XhmikosR's avatar
XhmikosR committed
4391
  Popover.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4392
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4393
      var data = Data.getData(this, DATA_KEY$7);
XhmikosR's avatar
Dist.  
XhmikosR committed
4394

XhmikosR's avatar
XhmikosR committed
4395
      var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407

      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
4408
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4409
4410
4411
4412
4413
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4414
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4415

XhmikosR's avatar
XhmikosR committed
4416
  Popover.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4417
    return Data.getData(element, DATA_KEY$7);
XhmikosR's avatar
XhmikosR committed
4418
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4419

XhmikosR's avatar
XhmikosR committed
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
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
  _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
4460
4461

var $$8 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4462
4463
4464
4465
4466
4467
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4468
4469
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4470
4471
4472
4473
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
4474

XhmikosR's avatar
XhmikosR committed
4475
4476
4477
  $$8.fn[NAME$7].noConflict = function () {
    $$8.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
    return Popover.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4478
4479
4480
4481
4482
4483
4484
4485
4486
  };
}

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

XhmikosR's avatar
XhmikosR committed
4487
4488
4489
4490
4491
4492
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
4493
4494
4495
4496
  offset: 10,
  method: 'auto',
  target: ''
};
XhmikosR's avatar
XhmikosR committed
4497
var DefaultType$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4498
4499
4500
4501
  offset: 'number',
  method: 'string',
  target: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
4502
4503
4504
4505
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
4506
};
XhmikosR's avatar
XhmikosR committed
4507
var ClassName$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4508
4509
4510
  DROPDOWN_ITEM: 'dropdown-item',
  ACTIVE: 'active'
};
XhmikosR's avatar
XhmikosR committed
4511
var Selector$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4512
4513
4514
4515
4516
4517
4518
4519
  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
4520
var OffsetMethod = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4521
4522
4523
  OFFSET: 'offset',
  POSITION: 'position'
};
XhmikosR's avatar
XhmikosR committed
4524
4525
4526
4527
4528
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4529

XhmikosR's avatar
XhmikosR committed
4530
4531
4532
4533
4534
4535
var ScrollSpy =
/*#__PURE__*/
function () {
  function ScrollSpy(element, config) {
    var _this = this;

XhmikosR's avatar
Dist.  
XhmikosR committed
4536
4537
4538
    this._element = element;
    this._scrollElement = element.tagName === 'BODY' ? window : element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
4539
    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
4540
4541
4542
4543
    this._offsets = [];
    this._targets = [];
    this._activeTarget = null;
    this._scrollHeight = 0;
XhmikosR's avatar
XhmikosR committed
4544
4545
4546
    EventHandler.on(this._scrollElement, Event$9.SCROLL, function (event) {
      return _this._process(event);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4547
4548
4549
4550
4551
4552
4553
4554
    this.refresh();

    this._process();

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


XhmikosR's avatar
XhmikosR committed
4555
  var _proto = ScrollSpy.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4556

XhmikosR's avatar
XhmikosR committed
4557
4558
4559
  // Public
  _proto.refresh = function refresh() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4560

XhmikosR's avatar
XhmikosR committed
4561
4562
4563
    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
4564
4565
4566
    this._offsets = [];
    this._targets = [];
    this._scrollHeight = this._getScrollHeight();
XhmikosR's avatar
XhmikosR committed
4567
4568
4569
4570
    var targets = makeArray(SelectorEngine.find(this._selector));
    targets.map(function (element) {
      var target;
      var targetSelector = getSelectorFromElement(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
4571
4572
4573
4574
4575
4576

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

      if (target) {
XhmikosR's avatar
XhmikosR committed
4577
        var targetBCR = target.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
4578
4579
4580
4581
4582
4583
4584

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

      return null;
XhmikosR's avatar
XhmikosR committed
4585
4586
4587
4588
4589
4590
4591
4592
    }).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
4593
    });
XhmikosR's avatar
XhmikosR committed
4594
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4595

XhmikosR's avatar
XhmikosR committed
4596
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
    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
4608
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4609

XhmikosR's avatar
XhmikosR committed
4610
  _proto._getConfig = function _getConfig(config) {
4611
    config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4612
4613

    if (typeof config.target !== 'string') {
XhmikosR's avatar
XhmikosR committed
4614
      var id = config.target.id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4615
4616
4617
4618
4619
4620

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

XhmikosR's avatar
XhmikosR committed
4621
      config.target = "#" + id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4622
4623
4624
4625
    }

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

XhmikosR's avatar
XhmikosR committed
4628
  _proto._getScrollTop = function _getScrollTop() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4629
    return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
XhmikosR's avatar
XhmikosR committed
4630
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4631

XhmikosR's avatar
XhmikosR committed
4632
  _proto._getScrollHeight = function _getScrollHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4633
    return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
XhmikosR's avatar
XhmikosR committed
4634
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4635

XhmikosR's avatar
XhmikosR committed
4636
  _proto._getOffsetHeight = function _getOffsetHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4637
    return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
XhmikosR's avatar
XhmikosR committed
4638
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4639

XhmikosR's avatar
XhmikosR committed
4640
4641
  _proto._process = function _process() {
    var scrollTop = this._getScrollTop() + this._config.offset;
XhmikosR's avatar
Dist.  
XhmikosR committed
4642

XhmikosR's avatar
XhmikosR committed
4643
    var scrollHeight = this._getScrollHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4644

XhmikosR's avatar
XhmikosR committed
4645
    var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4646
4647
4648
4649
4650
4651

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

    if (scrollTop >= maxScroll) {
XhmikosR's avatar
XhmikosR committed
4652
      var target = this._targets[this._targets.length - 1];
XhmikosR's avatar
Dist.  
XhmikosR committed
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668

      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
4669
    var offsetLength = this._offsets.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
4670

XhmikosR's avatar
XhmikosR committed
4671
4672
    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
4673
4674
4675
4676
4677

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

XhmikosR's avatar
XhmikosR committed
4680
  _proto._activate = function _activate(target) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4681
4682
4683
4684
    this._activeTarget = target;

    this._clear();

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

XhmikosR's avatar
XhmikosR committed
4689
    var link = SelectorEngine.findOne(queries.join(','));
XhmikosR's avatar
Dist.  
XhmikosR committed
4690
4691
4692
4693
4694
4695
4696

    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
4697
      SelectorEngine.parents(link, Selector$8.NAV_LIST_GROUP).forEach(function (listGroup) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4698
4699
        // 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
4700
4701
4702
        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
4703

XhmikosR's avatar
XhmikosR committed
4704
4705
4706
4707
        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
4708
4709
4710
4711
4712
4713
4714
        });
      });
    }

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

XhmikosR's avatar
XhmikosR committed
4717
4718
4719
4720
4721
4722
  _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
4723
  } // Static
XhmikosR's avatar
XhmikosR committed
4724
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4725

XhmikosR's avatar
XhmikosR committed
4726
  ScrollSpy.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4727
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4728
      var data = Data.getData(this, DATA_KEY$8);
XhmikosR's avatar
Dist.  
XhmikosR committed
4729

XhmikosR's avatar
XhmikosR committed
4730
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4731
4732
4733
4734
4735
4736
4737

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

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4738
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4739
4740
4741
4742
4743
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4744
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4745

XhmikosR's avatar
XhmikosR committed
4746
  ScrollSpy.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4747
    return Data.getData(element, DATA_KEY$8);
XhmikosR's avatar
XhmikosR committed
4748
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4749

XhmikosR's avatar
XhmikosR committed
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
  _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
4764
4765
4766
4767
4768
4769
4770
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
4771
4772
4773
4774
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
4775
});
XhmikosR's avatar
XhmikosR committed
4776
var $$9 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4777
4778
4779
4780
4781
4782
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4783
4784
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4785
4786
4787
4788
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
4789

XhmikosR's avatar
XhmikosR committed
4790
4791
4792
  $$9.fn[NAME$8].noConflict = function () {
    $$9.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
    return ScrollSpy.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4793
4794
4795
4796
4797
4798
4799
4800
4801
  };
}

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

XhmikosR's avatar
XhmikosR committed
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
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
4813
};
XhmikosR's avatar
XhmikosR committed
4814
var ClassName$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4815
4816
4817
4818
4819
4820
  DROPDOWN_MENU: 'dropdown-menu',
  ACTIVE: 'active',
  DISABLED: 'disabled',
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4821
var Selector$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4822
4823
4824
4825
4826
4827
4828
4829
  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'
};
XhmikosR's avatar
XhmikosR committed
4830
4831
4832
4833
4834
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4835

XhmikosR's avatar
XhmikosR committed
4836
4837
4838
4839
var Tab =
/*#__PURE__*/
function () {
  function Tab(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4840
4841
4842
4843
4844
    this._element = element;
    Data.setData(this._element, DATA_KEY$9, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4845
  var _proto = Tab.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4846

XhmikosR's avatar
XhmikosR committed
4847
4848
4849
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4850
4851
4852
4853
4854

    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
4855
    var previous;
XhmikosR's avatar
XhmikosR committed
4856
    var target = getElementFromSelector(this._element);
XhmikosR's avatar
XhmikosR committed
4857
    var listElement = SelectorEngine.closest(this._element, Selector$9.NAV_LIST_GROUP);
XhmikosR's avatar
Dist.  
XhmikosR committed
4858
4859

    if (listElement) {
XhmikosR's avatar
XhmikosR committed
4860
      var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
XhmikosR's avatar
Dist.  
XhmikosR committed
4861
4862
4863
4864
      previous = makeArray(SelectorEngine.find(itemSelector, listElement));
      previous = previous[previous.length - 1];
    }

XhmikosR's avatar
XhmikosR committed
4865
    var hideEvent = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4866
4867
4868
4869
4870
4871
4872

    if (previous) {
      hideEvent = EventHandler.trigger(previous, Event$a.HIDE, {
        relatedTarget: this._element
      });
    }

XhmikosR's avatar
XhmikosR committed
4873
    var showEvent = EventHandler.trigger(this._element, Event$a.SHOW, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4874
4875
4876
4877
4878
4879
4880
4881
4882
      relatedTarget: previous
    });

    if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
      return;
    }

    this._activate(this._element, listElement);

XhmikosR's avatar
XhmikosR committed
4883
    var complete = function complete() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4884
      EventHandler.trigger(previous, Event$a.HIDDEN, {
XhmikosR's avatar
XhmikosR committed
4885
        relatedTarget: _this._element
XhmikosR's avatar
Dist.  
XhmikosR committed
4886
      });
XhmikosR's avatar
XhmikosR committed
4887
      EventHandler.trigger(_this._element, Event$a.SHOWN, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4888
4889
4890
4891
4892
4893
4894
4895
4896
        relatedTarget: previous
      });
    };

    if (target) {
      this._activate(target, target.parentNode, complete);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4897
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4898

XhmikosR's avatar
XhmikosR committed
4899
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4900
4901
4902
    Data.removeData(this._element, DATA_KEY$9);
    this._element = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4903
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4904

XhmikosR's avatar
XhmikosR committed
4905
4906
  _proto._activate = function _activate(element, container, callback) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4907

XhmikosR's avatar
XhmikosR committed
4908
4909
4910
    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
4911

XhmikosR's avatar
XhmikosR committed
4912
4913
4914
    var complete = function complete() {
      return _this2._transitionComplete(element, active, callback);
    };
XhmikosR's avatar
Dist.  
XhmikosR committed
4915
4916

    if (active && isTransitioning) {
XhmikosR's avatar
XhmikosR committed
4917
      var transitionDuration = getTransitionDurationFromElement(active);
XhmikosR's avatar
Dist.  
XhmikosR committed
4918
4919
4920
4921
4922
4923
      active.classList.remove(ClassName$9.SHOW);
      EventHandler.one(active, TRANSITION_END, complete);
      emulateTransitionEnd(active, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4924
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4925

XhmikosR's avatar
XhmikosR committed
4926
  _proto._transitionComplete = function _transitionComplete(element, active, callback) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4927
4928
    if (active) {
      active.classList.remove(ClassName$9.ACTIVE);
XhmikosR's avatar
XhmikosR committed
4929
      var dropdownChild = SelectorEngine.findOne(Selector$9.DROPDOWN_ACTIVE_CHILD, active.parentNode);
XhmikosR's avatar
Dist.  
XhmikosR committed
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952

      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
4953
      var dropdownElement = SelectorEngine.closest(element, Selector$9.DROPDOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
4954
4955

      if (dropdownElement) {
XhmikosR's avatar
XhmikosR committed
4956
4957
4958
        makeArray(SelectorEngine.find(Selector$9.DROPDOWN_TOGGLE)).forEach(function (dropdown) {
          return dropdown.classList.add(ClassName$9.ACTIVE);
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4959
4960
4961
4962
4963
4964
4965
4966
4967
      }

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

    if (callback) {
      callback();
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4968
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4969

XhmikosR's avatar
XhmikosR committed
4970
  Tab.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4971
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4972
      var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
4973
4974
4975

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4976
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4977
4978
4979
4980
4981
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4982
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4983

XhmikosR's avatar
XhmikosR committed
4984
  Tab.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4985
    return Data.getData(element, DATA_KEY$9);
XhmikosR's avatar
XhmikosR committed
4986
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4987

XhmikosR's avatar
XhmikosR committed
4988
4989
4990
4991
4992
4993
4994
4995
4996
  _createClass(Tab, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$9;
    }
  }]);

  return Tab;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
4997
4998
4999
5000
5001
5002
5003
5004
5005
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


EventHandler.on(document, Event$a.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
  event.preventDefault();
XhmikosR's avatar
XhmikosR committed
5006
  var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
5007
5008
  data.show();
});
XhmikosR's avatar
XhmikosR committed
5009
var $$a = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
5010
5011
5012
5013
5014
5015
5016
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tab to jQuery only if jQuery is present
 */

5017
5018
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
5019
5020
5021
5022
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
5023

XhmikosR's avatar
XhmikosR committed
5024
5025
5026
  $$a.fn[NAME$9].noConflict = function () {
    $$a.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
    return Tab.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
5027
5028
5029
5030
5031
5032
5033
5034
5035
  };
}

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

XhmikosR's avatar
XhmikosR committed
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
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
5046
};
XhmikosR's avatar
XhmikosR committed
5047
var ClassName$a = {
XhmikosR's avatar
Dist.  
XhmikosR committed
5048
5049
5050
5051
5052
  FADE: 'fade',
  HIDE: 'hide',
  SHOW: 'show',
  SHOWING: 'showing'
};
XhmikosR's avatar
XhmikosR committed
5053
var DefaultType$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
5054
5055
5056
5057
  animation: 'boolean',
  autohide: 'boolean',
  delay: 'number'
};
XhmikosR's avatar
XhmikosR committed
5058
var Default$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
5059
5060
5061
5062
  animation: true,
  autohide: true,
  delay: 500
};
XhmikosR's avatar
XhmikosR committed
5063
var Selector$a = {
XhmikosR's avatar
Dist.  
XhmikosR committed
5064
5065
  DATA_DISMISS: '[data-dismiss="toast"]'
};
XhmikosR's avatar
XhmikosR committed
5066
5067
5068
5069
5070
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
5071

XhmikosR's avatar
XhmikosR committed
5072
5073
5074
5075
var Toast =
/*#__PURE__*/
function () {
  function Toast(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
    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
5086
  var _proto = Toast.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
5087

XhmikosR's avatar
XhmikosR committed
5088
5089
5090
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
5091

Mark Otto's avatar
dist v5    
Mark Otto committed
5092
5093
5094
5095
5096
    var showEvent = EventHandler.trigger(this._element, Event$b.SHOW);

    if (showEvent.defaultPrevented) {
      return;
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
5097
5098
5099
5100
5101

    if (this._config.animation) {
      this._element.classList.add(ClassName$a.FADE);
    }

XhmikosR's avatar
XhmikosR committed
5102
5103
    var complete = function complete() {
      _this._element.classList.remove(ClassName$a.SHOWING);
XhmikosR's avatar
Dist.  
XhmikosR committed
5104

XhmikosR's avatar
XhmikosR committed
5105
      _this._element.classList.add(ClassName$a.SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
5106

XhmikosR's avatar
XhmikosR committed
5107
      EventHandler.trigger(_this._element, Event$b.SHOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
5108

XhmikosR's avatar
XhmikosR committed
5109
5110
5111
5112
      if (_this._config.autohide) {
        _this._timeout = setTimeout(function () {
          _this.hide();
        }, _this._config.delay);
XhmikosR's avatar
Dist.  
XhmikosR committed
5113
5114
5115
5116
5117
      }
    };

    this._element.classList.remove(ClassName$a.HIDE);

5118
5119
    reflow(this._element);

XhmikosR's avatar
Dist.  
XhmikosR committed
5120
5121
5122
    this._element.classList.add(ClassName$a.SHOWING);

    if (this._config.animation) {
XhmikosR's avatar
XhmikosR committed
5123
      var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
5124
5125
5126
5127
5128
      EventHandler.one(this._element, TRANSITION_END, complete);
      emulateTransitionEnd(this._element, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
5129
5130
5131
5132
  };

  _proto.hide = function hide() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
5133
5134
5135
5136
5137

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

Mark Otto's avatar
dist v5    
Mark Otto committed
5138
5139
5140
5141
5142
    var hideEvent = EventHandler.trigger(this._element, Event$b.HIDE);

    if (hideEvent.defaultPrevented) {
      return;
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
5143

XhmikosR's avatar
XhmikosR committed
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
    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
5156
    } else {
XhmikosR's avatar
XhmikosR committed
5157
      complete();
XhmikosR's avatar
Dist.  
XhmikosR committed
5158
    }
XhmikosR's avatar
XhmikosR committed
5159
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5160

XhmikosR's avatar
XhmikosR committed
5161
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
    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
5174
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
5175

XhmikosR's avatar
XhmikosR committed
5176
  _proto._getConfig = function _getConfig(config) {
5177
    config = _objectSpread2({}, Default$7, {}, Manipulator.getDataAttributes(this._element), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
5178
5179
    typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
    return config;
XhmikosR's avatar
XhmikosR committed
5180
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5181

XhmikosR's avatar
XhmikosR committed
5182
5183
  _proto._setListeners = function _setListeners() {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
5184

XhmikosR's avatar
XhmikosR committed
5185
5186
5187
    EventHandler.on(this._element, Event$b.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
      return _this3.hide();
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
5188
  } // Static
XhmikosR's avatar
XhmikosR committed
5189
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
5190

XhmikosR's avatar
XhmikosR committed
5191
  Toast.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
5192
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
5193
      var data = Data.getData(this, DATA_KEY$a);
XhmikosR's avatar
Dist.  
XhmikosR committed
5194

XhmikosR's avatar
XhmikosR committed
5195
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
5196
5197
5198
5199
5200
5201
5202

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

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
5203
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
5204
5205
5206
5207
5208
        }

        data[config](this);
      }
    });
XhmikosR's avatar
XhmikosR committed
5209
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5210

XhmikosR's avatar
XhmikosR committed
5211
  Toast.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
5212
    return Data.getData(element, DATA_KEY$a);
XhmikosR's avatar
XhmikosR committed
5213
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5214

XhmikosR's avatar
XhmikosR committed
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
  _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
5234
5235

var $$b = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
5236
5237
5238
5239
5240
5241
5242
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 *  add .toast to jQuery only if jQuery is present
 */

5243
5244
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
5245
5246
5247
5248
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
5249

XhmikosR's avatar
XhmikosR committed
5250
5251
5252
  $$b.fn[NAME$a].noConflict = function () {
    $$b.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
    return Toast.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
5253
5254
5255
5256
5257
  };
}

export { Alert, Button, Carousel, Collapse, Dropdown, Modal, Popover, ScrollSpy, Tab, Toast, Tooltip };
//# sourceMappingURL=bootstrap.esm.js.map