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

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

Mark Otto's avatar
dist    
Mark Otto committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }

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

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

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

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

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

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

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

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

  /**
Mark Otto's avatar
dist    
Mark Otto committed
71
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
72
   * Bootstrap (v4.1.3): util.js
Mark Otto's avatar
dist    
Mark Otto committed
73
74
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
75
   */
XhmikosR's avatar
Dist    
XhmikosR committed
76
77
78
79
80
  /**
   * ------------------------------------------------------------------------
   * Private TransitionEnd Helpers
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
81

XhmikosR's avatar
Dist    
XhmikosR committed
82
83
84
  var TRANSITION_END = 'transitionend';
  var MAX_UID = 1000000;
  var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
Mark Otto's avatar
dist  
Mark Otto committed
85

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

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

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

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

XhmikosR's avatar
Dist    
XhmikosR committed
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
    var called = false;
    $(this).one(Util.TRANSITION_END, function () {
      called = true;
    });
    setTimeout(function () {
      if (!called) {
        Util.triggerTransitionEnd(_this);
      }
    }, duration);
    return this;
  }

  function setTransitionEndSupport() {
    $.fn.emulateTransitionEnd = transitionEndEmulator;
    $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  }
  /**
   * --------------------------------------------------------------------------
   * Public Util Api
   * --------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
128
129


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

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

XhmikosR's avatar
Dist    
XhmikosR committed
143
144
145
146
      if (!selector || selector === '#') {
        var hrefAttr = element.getAttribute('href');
        selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
      }
Mark Otto's avatar
dist    
Mark Otto committed
147

XhmikosR's avatar
Dist    
XhmikosR committed
148
149
150
151
152
153
      return selector && document.querySelector(selector) ? selector : null;
    },
    getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
      if (!element) {
        return 0;
      } // Get transition-duration of the element
Mark Otto's avatar
dist    
Mark Otto committed
154
155


XhmikosR's avatar
Dist    
XhmikosR committed
156
157
158
159
      var transitionDuration = $(element).css('transition-duration');
      var transitionDelay = $(element).css('transition-delay');
      var floatTransitionDuration = parseFloat(transitionDuration);
      var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
Mark Otto's avatar
dist    
Mark Otto committed
160

XhmikosR's avatar
Dist    
XhmikosR committed
161
162
163
      if (!floatTransitionDuration && !floatTransitionDelay) {
        return 0;
      } // If multiple durations are defined, take the first
Mark Otto's avatar
dist    
Mark Otto committed
164
165


XhmikosR's avatar
Dist    
XhmikosR committed
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
      transitionDuration = transitionDuration.split(',')[0];
      transitionDelay = transitionDelay.split(',')[0];
      return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
    },
    reflow: function reflow(element) {
      return element.offsetHeight;
    },
    triggerTransitionEnd: function triggerTransitionEnd(element) {
      $(element).trigger(TRANSITION_END);
    },
    // TODO: Remove in v5
    supportsTransitionEnd: function supportsTransitionEnd() {
      return Boolean(TRANSITION_END);
    },
    isElement: function isElement(obj) {
      return (obj[0] || obj).nodeType;
    },
    typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
      for (var property in configTypes) {
        if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
          var expectedTypes = configTypes[property];
          var value = config[property];
          var valueType = value && Util.isElement(value) ? 'element' : toType(value);

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

XhmikosR's avatar
Dist    
XhmikosR committed
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME = 'alert';
  var VERSION = '4.1.3';
  var DATA_KEY = 'bs.alert';
  var EVENT_KEY = "." + DATA_KEY;
  var DATA_API_KEY = '.data-api';
  var JQUERY_NO_CONFLICT = $.fn[NAME];
  var Selector = {
    DISMISS: '[data-dismiss="alert"]'
  };
  var Event = {
    CLOSE: "close" + EVENT_KEY,
    CLOSED: "closed" + EVENT_KEY,
    CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  };
  var ClassName = {
    ALERT: 'alert',
    FADE: 'fade',
    SHOW: 'show'
Mark Otto's avatar
dist    
Mark Otto committed
223
224
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
225
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
226
227
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
228

XhmikosR's avatar
Dist    
XhmikosR committed
229
  };
Mark Otto's avatar
dist  
Mark Otto committed
230

XhmikosR's avatar
Dist    
XhmikosR committed
231
232
233
234
235
236
  var Alert =
  /*#__PURE__*/
  function () {
    function Alert(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
237
238


XhmikosR's avatar
Dist    
XhmikosR committed
239
    var _proto = Alert.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
240

XhmikosR's avatar
Dist    
XhmikosR committed
241
242
243
    // Public
    _proto.close = function close(element) {
      var rootElement = this._element;
Mark Otto's avatar
dist  
Mark Otto committed
244

XhmikosR's avatar
Dist    
XhmikosR committed
245
246
247
      if (element) {
        rootElement = this._getRootElement(element);
      }
Mark Otto's avatar
dist    
Mark Otto committed
248

XhmikosR's avatar
Dist    
XhmikosR committed
249
      var customEvent = this._triggerCloseEvent(rootElement);
Mark Otto's avatar
dist  
Mark Otto committed
250

XhmikosR's avatar
Dist    
XhmikosR committed
251
252
253
      if (customEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
254

XhmikosR's avatar
Dist    
XhmikosR committed
255
256
      this._removeElement(rootElement);
    };
Mark Otto's avatar
dist  
Mark Otto committed
257

XhmikosR's avatar
Dist    
XhmikosR committed
258
259
260
261
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY);
      this._element = null;
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
262
263


XhmikosR's avatar
Dist    
XhmikosR committed
264
265
266
    _proto._getRootElement = function _getRootElement(element) {
      var selector = Util.getSelectorFromElement(element);
      var parent = false;
Mark Otto's avatar
dist  
Mark Otto committed
267

XhmikosR's avatar
Dist    
XhmikosR committed
268
269
270
      if (selector) {
        parent = document.querySelector(selector);
      }
Mark Otto's avatar
dist  
Mark Otto committed
271

XhmikosR's avatar
Dist    
XhmikosR committed
272
273
274
      if (!parent) {
        parent = $(element).closest("." + ClassName.ALERT)[0];
      }
Mark Otto's avatar
dist  
Mark Otto committed
275

XhmikosR's avatar
Dist    
XhmikosR committed
276
277
      return parent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
278

XhmikosR's avatar
Dist    
XhmikosR committed
279
280
281
282
283
    _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
      var closeEvent = $.Event(Event.CLOSE);
      $(element).trigger(closeEvent);
      return closeEvent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
284

XhmikosR's avatar
Dist    
XhmikosR committed
285
286
    _proto._removeElement = function _removeElement(element) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
287

XhmikosR's avatar
Dist    
XhmikosR committed
288
      $(element).removeClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
289

XhmikosR's avatar
Dist    
XhmikosR committed
290
291
      if (!$(element).hasClass(ClassName.FADE)) {
        this._destroyElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
292

XhmikosR's avatar
Dist    
XhmikosR committed
293
294
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
295

XhmikosR's avatar
Dist    
XhmikosR committed
296
297
298
299
300
      var transitionDuration = Util.getTransitionDurationFromElement(element);
      $(element).one(Util.TRANSITION_END, function (event) {
        return _this._destroyElement(element, event);
      }).emulateTransitionEnd(transitionDuration);
    };
Mark Otto's avatar
dist  
Mark Otto committed
301

XhmikosR's avatar
Dist    
XhmikosR committed
302
303
304
    _proto._destroyElement = function _destroyElement(element) {
      $(element).detach().trigger(Event.CLOSED).remove();
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
305
306


XhmikosR's avatar
Dist    
XhmikosR committed
307
308
309
310
    Alert._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var $element = $(this);
        var data = $element.data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
311

XhmikosR's avatar
Dist    
XhmikosR committed
312
313
314
315
        if (!data) {
          data = new Alert(this);
          $element.data(DATA_KEY, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
316

XhmikosR's avatar
Dist    
XhmikosR committed
317
318
319
320
321
        if (config === 'close') {
          data[config](this);
        }
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
322

XhmikosR's avatar
Dist    
XhmikosR committed
323
324
325
326
327
    Alert._handleDismiss = function _handleDismiss(alertInstance) {
      return function (event) {
        if (event) {
          event.preventDefault();
        }
Mark Otto's avatar
dist  
Mark Otto committed
328

XhmikosR's avatar
Dist    
XhmikosR committed
329
        alertInstance.close(this);
Mark Otto's avatar
dist  
Mark Otto committed
330
      };
XhmikosR's avatar
Dist    
XhmikosR committed
331
    };
Mark Otto's avatar
dist  
Mark Otto committed
332

XhmikosR's avatar
Dist    
XhmikosR committed
333
334
335
336
337
338
    _createClass(Alert, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
339

XhmikosR's avatar
Dist    
XhmikosR committed
340
341
342
343
344
345
346
    return Alert;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
347

Mark Otto's avatar
dist    
Mark Otto committed
348

XhmikosR's avatar
Dist    
XhmikosR committed
349
350
351
352
353
354
  $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
355

XhmikosR's avatar
Dist    
XhmikosR committed
356
357
  $.fn[NAME] = Alert._jQueryInterface;
  $.fn[NAME].Constructor = Alert;
Mark Otto's avatar
dist  
Mark Otto committed
358

XhmikosR's avatar
Dist    
XhmikosR committed
359
360
361
362
  $.fn[NAME].noConflict = function () {
    $.fn[NAME] = JQUERY_NO_CONFLICT;
    return Alert._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
363

XhmikosR's avatar
Dist    
XhmikosR committed
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$1 = 'button';
  var VERSION$1 = '4.1.3';
  var DATA_KEY$1 = 'bs.button';
  var EVENT_KEY$1 = "." + DATA_KEY$1;
  var DATA_API_KEY$1 = '.data-api';
  var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  var ClassName$1 = {
    ACTIVE: 'active',
    BUTTON: 'btn',
    FOCUS: 'focus'
  };
  var Selector$1 = {
    DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
    DATA_TOGGLE: '[data-toggle="buttons"]',
    INPUT: 'input',
    ACTIVE: '.active',
    BUTTON: '.btn'
  };
  var Event$1 = {
    CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
    FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1)
Mark Otto's avatar
dist    
Mark Otto committed
391
392
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
393
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
394
395
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
396

XhmikosR's avatar
Dist    
XhmikosR committed
397
  };
Mark Otto's avatar
dist  
Mark Otto committed
398

XhmikosR's avatar
Dist    
XhmikosR committed
399
400
401
402
403
404
  var Button =
  /*#__PURE__*/
  function () {
    function Button(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
405
406


XhmikosR's avatar
Dist    
XhmikosR committed
407
    var _proto = Button.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
408

XhmikosR's avatar
Dist    
XhmikosR committed
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
    // Public
    _proto.toggle = function toggle() {
      var triggerChangeEvent = true;
      var addAriaPressed = true;
      var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];

      if (rootElement) {
        var input = this._element.querySelector(Selector$1.INPUT);

        if (input) {
          if (input.type === 'radio') {
            if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
              triggerChangeEvent = false;
            } else {
              var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
424

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

XhmikosR's avatar
Dist    
XhmikosR committed
431
432
433
          if (triggerChangeEvent) {
            if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
              return;
Mark Otto's avatar
dist  
Mark Otto committed
434
            }
Mark Otto's avatar
dist    
Mark Otto committed
435

XhmikosR's avatar
Dist    
XhmikosR committed
436
437
            input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
            $(input).trigger('change');
Mark Otto's avatar
dist  
Mark Otto committed
438
439
          }

XhmikosR's avatar
Dist    
XhmikosR committed
440
441
          input.focus();
          addAriaPressed = false;
Mark Otto's avatar
dist  
Mark Otto committed
442
        }
XhmikosR's avatar
Dist    
XhmikosR committed
443
      }
Mark Otto's avatar
dist  
Mark Otto committed
444

XhmikosR's avatar
Dist    
XhmikosR committed
445
446
447
      if (addAriaPressed) {
        this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
      }
Mark Otto's avatar
dist  
Mark Otto committed
448

XhmikosR's avatar
Dist    
XhmikosR committed
449
450
451
452
      if (triggerChangeEvent) {
        $(this._element).toggleClass(ClassName$1.ACTIVE);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
453

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


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

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

XhmikosR's avatar
Dist    
XhmikosR committed
469
470
        if (config === 'toggle') {
          data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
471
        }
XhmikosR's avatar
Dist    
XhmikosR committed
472
473
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
474

XhmikosR's avatar
Dist    
XhmikosR committed
475
476
477
478
479
480
    _createClass(Button, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$1;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
481

XhmikosR's avatar
Dist    
XhmikosR committed
482
483
484
485
486
487
488
    return Button;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
489
490


XhmikosR's avatar
Dist    
XhmikosR committed
491
492
493
  $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
    event.preventDefault();
    var button = event.target;
Mark Otto's avatar
dist  
Mark Otto committed
494

XhmikosR's avatar
Dist    
XhmikosR committed
495
496
497
    if (!$(button).hasClass(ClassName$1.BUTTON)) {
      button = $(button).closest(Selector$1.BUTTON);
    }
Mark Otto's avatar
dist    
Mark Otto committed
498

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

XhmikosR's avatar
Dist    
XhmikosR committed
510
511
  $.fn[NAME$1] = Button._jQueryInterface;
  $.fn[NAME$1].Constructor = Button;
Mark Otto's avatar
dist  
Mark Otto committed
512

XhmikosR's avatar
Dist    
XhmikosR committed
513
514
515
516
  $.fn[NAME$1].noConflict = function () {
    $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
    return Button._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
517
518

  /**
XhmikosR's avatar
Dist    
XhmikosR committed
519
520
521
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
522
   */
Mark Otto's avatar
dist    
Mark Otto committed
523

XhmikosR's avatar
Dist    
XhmikosR committed
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
  var NAME$2 = 'carousel';
  var VERSION$2 = '4.1.3';
  var DATA_KEY$2 = 'bs.carousel';
  var EVENT_KEY$2 = "." + DATA_KEY$2;
  var DATA_API_KEY$2 = '.data-api';
  var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key

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

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

  var SWIPE_THRESHOLD = 40;
  var Default = {
    interval: 5000,
    keyboard: true,
    slide: false,
    pause: 'hover',
    wrap: true,
    touch: true
  };
  var DefaultType = {
    interval: '(number|boolean)',
    keyboard: 'boolean',
    slide: '(boolean|string)',
    pause: '(string|boolean)',
    wrap: 'boolean',
    touch: 'boolean'
  };
  var Direction = {
    NEXT: 'next',
    PREV: 'prev',
    LEFT: 'left',
    RIGHT: 'right'
  };
  var Event$2 = {
    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
  };
  var ClassName$2 = {
    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'
  };
  var Selector$2 = {
    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"]'
  };
  var PointerType = {
    TOUCH: 'touch',
    PEN: 'pen'
    /**
     * ------------------------------------------------------------------------
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
601
602
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
603

XhmikosR's avatar
Dist    
XhmikosR committed
604
  };
Mark Otto's avatar
dist    
Mark Otto committed
605

XhmikosR's avatar
Dist    
XhmikosR committed
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
  var Carousel =
  /*#__PURE__*/
  function () {
    function Carousel(element, config) {
      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 = this._element.querySelector(Selector$2.INDICATORS);
      this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
      this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);

      this._addEventListeners();
    } // Getters


    var _proto = Carousel.prototype;

    // Public
    _proto.next = function next() {
      if (!this._isSliding) {
        this._slide(Direction.NEXT);
      }
Mark Otto's avatar
dist    
Mark Otto committed
635
    };
Mark Otto's avatar
dist  
Mark Otto committed
636

XhmikosR's avatar
Dist    
XhmikosR committed
637
638
639
640
641
642
    _proto.nextWhenVisible = function nextWhenVisible() {
      // Don't call next when the page isn't visible
      // or the carousel or its parent isn't visible
      if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
        this.next();
      }
Mark Otto's avatar
dist  
Mark Otto committed
643
644
    };

XhmikosR's avatar
Dist    
XhmikosR committed
645
646
647
648
649
    _proto.prev = function prev() {
      if (!this._isSliding) {
        this._slide(Direction.PREV);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
650

XhmikosR's avatar
Dist    
XhmikosR committed
651
652
653
654
    _proto.pause = function pause(event) {
      if (!event) {
        this._isPaused = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
655

XhmikosR's avatar
Dist    
XhmikosR committed
656
657
658
659
      if (this._element.querySelector(Selector$2.NEXT_PREV)) {
        Util.triggerTransitionEnd(this._element);
        this.cycle(true);
      }
Mark Otto's avatar
dist  
Mark Otto committed
660

XhmikosR's avatar
Dist    
XhmikosR committed
661
662
663
      clearInterval(this._interval);
      this._interval = null;
    };
Mark Otto's avatar
dist  
Mark Otto committed
664

XhmikosR's avatar
Dist    
XhmikosR committed
665
666
667
668
    _proto.cycle = function cycle(event) {
      if (!event) {
        this._isPaused = false;
      }
Mark Otto's avatar
dist  
Mark Otto committed
669

XhmikosR's avatar
Dist    
XhmikosR committed
670
      if (this._interval) {
Mark Otto's avatar
dist    
Mark Otto committed
671
672
        clearInterval(this._interval);
        this._interval = null;
XhmikosR's avatar
Dist    
XhmikosR committed
673
      }
Mark Otto's avatar
dist  
Mark Otto committed
674

XhmikosR's avatar
Dist    
XhmikosR committed
675
676
677
678
      if (this._config.interval && !this._isPaused) {
        this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
679

XhmikosR's avatar
Dist    
XhmikosR committed
680
681
    _proto.to = function to(index) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
682

XhmikosR's avatar
Dist    
XhmikosR committed
683
      this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
Mark Otto's avatar
dist    
Mark Otto committed
684

XhmikosR's avatar
Dist    
XhmikosR committed
685
      var activeIndex = this._getItemIndex(this._activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
686

XhmikosR's avatar
Dist    
XhmikosR committed
687
688
689
      if (index > this._items.length - 1 || index < 0) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
690

XhmikosR's avatar
Dist    
XhmikosR committed
691
692
693
694
695
696
      if (this._isSliding) {
        $(this._element).one(Event$2.SLID, function () {
          return _this.to(index);
        });
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
697

XhmikosR's avatar
Dist    
XhmikosR committed
698
699
700
701
702
      if (activeIndex === index) {
        this.pause();
        this.cycle();
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
703

XhmikosR's avatar
Dist    
XhmikosR committed
704
      var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
Mark Otto's avatar
dist  
Mark Otto committed
705

XhmikosR's avatar
Dist    
XhmikosR committed
706
707
      this._slide(direction, this._items[index]);
    };
Mark Otto's avatar
dist  
Mark Otto committed
708

XhmikosR's avatar
Dist    
XhmikosR committed
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
    _proto.dispose = function dispose() {
      $(this._element).off(EVENT_KEY$2);
      $.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


    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, Default, config);
      Util.typeCheckConfig(NAME$2, config, DefaultType);
      return config;
    };
Mark Otto's avatar
dist    
Mark Otto committed
728

XhmikosR's avatar
Dist    
XhmikosR committed
729
730
    _proto._handleSwipe = function _handleSwipe() {
      var absDeltax = Math.abs(this.touchDeltaX);
Mark Otto's avatar
dist    
Mark Otto committed
731

XhmikosR's avatar
Dist    
XhmikosR committed
732
733
734
      if (absDeltax <= SWIPE_THRESHOLD) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
735

XhmikosR's avatar
Dist    
XhmikosR committed
736
      var direction = absDeltax / this.touchDeltaX; // swipe left
Mark Otto's avatar
dist    
Mark Otto committed
737

XhmikosR's avatar
Dist    
XhmikosR committed
738
739
740
      if (direction > 0) {
        this.prev();
      } // swipe right
Mark Otto's avatar
dist    
Mark Otto committed
741

Mark Otto's avatar
dist    
Mark Otto committed
742

XhmikosR's avatar
Dist    
XhmikosR committed
743
744
745
746
      if (direction < 0) {
        this.next();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
747

XhmikosR's avatar
Dist    
XhmikosR committed
748
749
    _proto._addEventListeners = function _addEventListeners() {
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
750

XhmikosR's avatar
Dist    
XhmikosR committed
751
752
753
754
755
      if (this._config.keyboard) {
        $(this._element).on(Event$2.KEYDOWN, function (event) {
          return _this2._keydown(event);
        });
      }
Mark Otto's avatar
dist    
Mark Otto committed
756

XhmikosR's avatar
Dist    
XhmikosR committed
757
758
759
760
761
762
763
      if (this._config.pause === 'hover') {
        $(this._element).on(Event$2.MOUSEENTER, function (event) {
          return _this2.pause(event);
        }).on(Event$2.MOUSELEAVE, function (event) {
          return _this2.cycle(event);
        });
      }
Mark Otto's avatar
dist    
Mark Otto committed
764

XhmikosR's avatar
Dist    
XhmikosR committed
765
766
      this._addTouchEventListeners();
    };
Mark Otto's avatar
dist  
Mark Otto committed
767

XhmikosR's avatar
Dist    
XhmikosR committed
768
769
    _proto._addTouchEventListeners = function _addTouchEventListeners() {
      var _this3 = this;
Mark Otto's avatar
dist    
Mark Otto committed
770

XhmikosR's avatar
Dist    
XhmikosR committed
771
772
773
      if (!this._touchSupported) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
774

XhmikosR's avatar
Dist    
XhmikosR committed
775
      var start = function start(event) {
XhmikosR's avatar
Dist    
XhmikosR committed
776
        if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
XhmikosR's avatar
Dist    
XhmikosR committed
777
778
779
          _this3.touchStartX = event.originalEvent.clientX;
        } else if (!_this3._pointerEvent) {
          _this3.touchStartX = event.originalEvent.touches[0].clientX;
Mark Otto's avatar
dist    
Mark Otto committed
780
781
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
782

XhmikosR's avatar
Dist    
XhmikosR committed
783
784
785
786
787
788
789
      var move = function move(event) {
        // ensure swiping with one touch and not pinching
        if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
          _this3.touchDeltaX = 0;
        } else {
          _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
        }
Mark Otto's avatar
dist    
Mark Otto committed
790
      };
Mark Otto's avatar
dist    
Mark Otto committed
791

XhmikosR's avatar
Dist    
XhmikosR committed
792
      var end = function end(event) {
XhmikosR's avatar
Dist    
XhmikosR committed
793
        if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
XhmikosR's avatar
Dist    
XhmikosR committed
794
795
796
797
          _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
        }

        _this3._handleSwipe();
Mark Otto's avatar
dist    
Mark Otto committed
798

XhmikosR's avatar
Dist    
XhmikosR committed
799
800
801
802
803
804
805
806
807
        if (_this3._config.pause === 'hover') {
          // 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
          _this3.pause();
Mark Otto's avatar
dist  
Mark Otto committed
808

XhmikosR's avatar
Dist    
XhmikosR committed
809
810
811
          if (_this3.touchTimeout) {
            clearTimeout(_this3.touchTimeout);
          }
Mark Otto's avatar
dist  
Mark Otto committed
812

XhmikosR's avatar
Dist    
XhmikosR committed
813
814
815
          _this3.touchTimeout = setTimeout(function (event) {
            return _this3.cycle(event);
          }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
Mark Otto's avatar
dist    
Mark Otto committed
816
817
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
818

XhmikosR's avatar
Dist    
XhmikosR committed
819
820
821
      $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
        return e.preventDefault();
      });
Mark Otto's avatar
dist    
Mark Otto committed
822

XhmikosR's avatar
Dist    
XhmikosR committed
823
824
825
826
827
828
829
      if (this._pointerEvent) {
        $(this._element).on(Event$2.POINTERDOWN, function (event) {
          return start(event);
        });
        $(this._element).on(Event$2.POINTERUP, function (event) {
          return end(event);
        });
Mark Otto's avatar
dist    
Mark Otto committed
830

XhmikosR's avatar
Dist    
XhmikosR committed
831
832
833
834
        this._element.classList.add(ClassName$2.POINTER_EVENT);
      } else {
        $(this._element).on(Event$2.TOUCHSTART, function (event) {
          return start(event);
Mark Otto's avatar
dist    
Mark Otto committed
835
        });
XhmikosR's avatar
Dist    
XhmikosR committed
836
837
838
839
840
841
842
843
        $(this._element).on(Event$2.TOUCHMOVE, function (event) {
          return move(event);
        });
        $(this._element).on(Event$2.TOUCHEND, function (event) {
          return end(event);
        });
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
844

XhmikosR's avatar
Dist    
XhmikosR committed
845
846
847
848
    _proto._keydown = function _keydown(event) {
      if (/input|textarea/i.test(event.target.tagName)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
849

XhmikosR's avatar
Dist    
XhmikosR committed
850
851
852
853
854
      switch (event.which) {
        case ARROW_LEFT_KEYCODE:
          event.preventDefault();
          this.prev();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
855

XhmikosR's avatar
Dist    
XhmikosR committed
856
857
858
859
        case ARROW_RIGHT_KEYCODE:
          event.preventDefault();
          this.next();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
860

XhmikosR's avatar
Dist    
XhmikosR committed
861
862
863
        default:
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
864

XhmikosR's avatar
Dist    
XhmikosR committed
865
866
867
868
    _proto._getItemIndex = function _getItemIndex(element) {
      this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
      return this._items.indexOf(element);
    };
Mark Otto's avatar
dist    
Mark Otto committed
869

XhmikosR's avatar
Dist    
XhmikosR committed
870
871
872
    _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
      var isNextDirection = direction === Direction.NEXT;
      var isPrevDirection = direction === Direction.PREV;
Mark Otto's avatar
dist    
Mark Otto committed
873

XhmikosR's avatar
Dist    
XhmikosR committed
874
      var activeIndex = this._getItemIndex(activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
875

XhmikosR's avatar
Dist    
XhmikosR committed
876
877
      var lastItemIndex = this._items.length - 1;
      var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
Mark Otto's avatar
dist  
Mark Otto committed
878

XhmikosR's avatar
Dist    
XhmikosR committed
879
880
881
      if (isGoingToWrap && !this._config.wrap) {
        return activeElement;
      }
Mark Otto's avatar
dist  
Mark Otto committed
882

XhmikosR's avatar
Dist    
XhmikosR committed
883
884
885
886
      var delta = direction === Direction.PREV ? -1 : 1;
      var itemIndex = (activeIndex + delta) % this._items.length;
      return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
    };
Mark Otto's avatar
dist  
Mark Otto committed
887

XhmikosR's avatar
Dist    
XhmikosR committed
888
889
    _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
      var targetIndex = this._getItemIndex(relatedTarget);
Mark Otto's avatar
dist  
Mark Otto committed
890

XhmikosR's avatar
Dist    
XhmikosR committed
891
      var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
Mark Otto's avatar
dist    
Mark Otto committed
892

XhmikosR's avatar
Dist    
XhmikosR committed
893
894
895
896
897
898
899
900
901
      var slideEvent = $.Event(Event$2.SLIDE, {
        relatedTarget: relatedTarget,
        direction: eventDirectionName,
        from: fromIndex,
        to: targetIndex
      });
      $(this._element).trigger(slideEvent);
      return slideEvent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
902

XhmikosR's avatar
Dist    
XhmikosR committed
903
904
905
906
    _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
      if (this._indicatorsElement) {
        var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
        $(indicators).removeClass(ClassName$2.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
907

XhmikosR's avatar
Dist    
XhmikosR committed
908
        var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
Mark Otto's avatar
dist  
Mark Otto committed
909

XhmikosR's avatar
Dist    
XhmikosR committed
910
911
        if (nextIndicator) {
          $(nextIndicator).addClass(ClassName$2.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
912
        }
XhmikosR's avatar
Dist    
XhmikosR committed
913
914
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
915

XhmikosR's avatar
Dist    
XhmikosR committed
916
917
    _proto._slide = function _slide(direction, element) {
      var _this4 = this;
Mark Otto's avatar
dist  
Mark Otto committed
918

XhmikosR's avatar
Dist    
XhmikosR committed
919
      var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
Mark Otto's avatar
dist  
Mark Otto committed
920

XhmikosR's avatar
Dist    
XhmikosR committed
921
      var activeElementIndex = this._getItemIndex(activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
922

XhmikosR's avatar
Dist    
XhmikosR committed
923
      var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
924

XhmikosR's avatar
Dist    
XhmikosR committed
925
      var nextElementIndex = this._getItemIndex(nextElement);
Mark Otto's avatar
dist  
Mark Otto committed
926

XhmikosR's avatar
Dist    
XhmikosR committed
927
928
929
930
      var isCycling = Boolean(this._interval);
      var directionalClassName;
      var orderClassName;
      var eventDirectionName;
Mark Otto's avatar
dist  
Mark Otto committed
931

XhmikosR's avatar
Dist    
XhmikosR committed
932
933
934
935
936
937
938
939
940
      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;
      }
Mark Otto's avatar
dist  
Mark Otto committed
941

XhmikosR's avatar
Dist    
XhmikosR committed
942
943
944
945
      if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
        this._isSliding = false;
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
946

XhmikosR's avatar
Dist    
XhmikosR committed
947
      var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
Mark Otto's avatar
dist  
Mark Otto committed
948

XhmikosR's avatar
Dist    
XhmikosR committed
949
950
951
      if (slideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
952

XhmikosR's avatar
Dist    
XhmikosR committed
953
954
955
956
      if (!activeElement || !nextElement) {
        // Some weirdness is happening, so we bail
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
957

XhmikosR's avatar
Dist    
XhmikosR committed
958
      this._isSliding = true;
Mark Otto's avatar
dist    
Mark Otto committed
959

XhmikosR's avatar
Dist    
XhmikosR committed
960
961
962
      if (isCycling) {
        this.pause();
      }
Mark Otto's avatar
dist  
Mark Otto committed
963

XhmikosR's avatar
Dist    
XhmikosR committed
964
      this._setActiveIndicatorElement(nextElement);
Mark Otto's avatar
dist    
Mark Otto committed
965

XhmikosR's avatar
Dist    
XhmikosR committed
966
967
968
969
970
971
      var slidEvent = $.Event(Event$2.SLID, {
        relatedTarget: nextElement,
        direction: eventDirectionName,
        from: activeElementIndex,
        to: nextElementIndex
      });
Mark Otto's avatar
dist    
Mark Otto committed
972

XhmikosR's avatar
Dist    
XhmikosR committed
973
974
975
976
977
978
979
980
981
982
983
984
      if ($(this._element).hasClass(ClassName$2.SLIDE)) {
        $(nextElement).addClass(orderClassName);
        Util.reflow(nextElement);
        $(activeElement).addClass(directionalClassName);
        $(nextElement).addClass(directionalClassName);
        var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);

        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;
Mark Otto's avatar
dist  
Mark Otto committed
985
986
        }

XhmikosR's avatar
Dist    
XhmikosR committed
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
        var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
        $(activeElement).one(Util.TRANSITION_END, function () {
          $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
          $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
          _this4._isSliding = false;
          setTimeout(function () {
            return $(_this4._element).trigger(slidEvent);
          }, 0);
        }).emulateTransitionEnd(transitionDuration);
      } else {
        $(activeElement).removeClass(ClassName$2.ACTIVE);
        $(nextElement).addClass(ClassName$2.ACTIVE);
        this._isSliding = false;
        $(this._element).trigger(slidEvent);
For faster browsing, not all history is shown. View entire blame