bootstrap.js 149 KB
Newer Older
XhmikosR's avatar
Dist    
XhmikosR committed
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
    }, {
      key: "EVENT_KEY",
      get: function get() {
        return EVENT_KEY$6;
      }
    }, {
      key: "DefaultType",
      get: function get() {
        return DefaultType$4;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
4012

XhmikosR's avatar
Dist    
XhmikosR committed
4013
4014
4015
4016
4017
4018
    return Tooltip;
  }();
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
4019
   * add .Tooltip to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
4020
   */
Mark Otto's avatar
dist    
Mark Otto committed
4021

4022

XhmikosR's avatar
XhmikosR committed
4023
4024
4025
  onDOMContentLoaded(function () {
    var $ = getjQuery();
    /* istanbul ignore if */
Jacob Thornton's avatar
Jacob Thornton committed
4026

XhmikosR's avatar
XhmikosR committed
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
    if ($) {
      var JQUERY_NO_CONFLICT = $.fn[NAME$6];
      $.fn[NAME$6] = Tooltip.jQueryInterface;
      $.fn[NAME$6].Constructor = Tooltip;

      $.fn[NAME$6].noConflict = function () {
        $.fn[NAME$6] = JQUERY_NO_CONFLICT;
        return Tooltip.jQueryInterface;
      };
    }
  });
Jacob Thornton's avatar
Jacob Thornton committed
4038

XhmikosR's avatar
Dist    
XhmikosR committed
4039
4040
4041
4042
4043
4044
4045
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$7 = 'popover';
XhmikosR's avatar
XhmikosR committed
4046
  var VERSION$7 = '5.0.0-alpha3';
XhmikosR's avatar
Dist    
XhmikosR committed
4047
4048
4049
4050
4051
  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
XhmikosR committed
4052
  var Default$5 = _extends({}, Tooltip.Default, {
XhmikosR's avatar
Dist    
XhmikosR committed
4053
4054
4055
    placement: 'right',
    trigger: 'click',
    content: '',
XhmikosR's avatar
XhmikosR committed
4056
    template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
XhmikosR's avatar
Dist    
XhmikosR committed
4057
4058
  });

XhmikosR's avatar
XhmikosR committed
4059
  var DefaultType$5 = _extends({}, Tooltip.DefaultType, {
XhmikosR's avatar
Dist    
XhmikosR committed
4060
4061
4062
    content: '(string|element|function)'
  });

XhmikosR's avatar
XhmikosR committed
4063
  var Event$2 = {
XhmikosR's avatar
Dist    
XhmikosR committed
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
    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
XhmikosR committed
4075
4076
4077
4078
  var CLASS_NAME_FADE$2 = 'fade';
  var CLASS_NAME_SHOW$4 = 'show';
  var SELECTOR_TITLE = '.popover-header';
  var SELECTOR_CONTENT = '.popover-body';
XhmikosR's avatar
XhmikosR committed
4079
4080
4081
4082
4083
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */
Jacob Thornton's avatar
Jacob Thornton committed
4084

XhmikosR's avatar
XhmikosR committed
4085
  var Popover = /*#__PURE__*/function (_Tooltip) {
XhmikosR's avatar
Dist    
XhmikosR committed
4086
    _inheritsLoose(Popover, _Tooltip);
Jacob Thornton's avatar
Jacob Thornton committed
4087

XhmikosR's avatar
Dist    
XhmikosR committed
4088
4089
4090
    function Popover() {
      return _Tooltip.apply(this, arguments) || this;
    }
Mark Otto's avatar
grunt    
Mark Otto committed
4091

XhmikosR's avatar
Dist    
XhmikosR committed
4092
    var _proto = Popover.prototype;
Jacob Thornton's avatar
Jacob Thornton committed
4093

XhmikosR's avatar
Dist    
XhmikosR committed
4094
4095
4096
4097
    // Overrides
    _proto.isWithContent = function isWithContent() {
      return this.getTitle() || this._getContent();
    };
Mark Otto's avatar
Mark Otto committed
4098

XhmikosR's avatar
Dist    
XhmikosR committed
4099
    _proto.setContent = function setContent() {
XhmikosR's avatar
XhmikosR committed
4100
      var tip = this.getTipElement(); // we use append for html objects to maintain js events
Jacob Thornton's avatar
Jacob Thornton committed
4101

XhmikosR's avatar
XhmikosR committed
4102
      this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
Jacob Thornton's avatar
Jacob Thornton committed
4103

XhmikosR's avatar
Dist    
XhmikosR committed
4104
      var content = this._getContent();
Mark Otto's avatar
dist    
Mark Otto committed
4105

XhmikosR's avatar
Dist    
XhmikosR committed
4106
4107
4108
      if (typeof content === 'function') {
        content = content.call(this.element);
      }
Jacob Thornton's avatar
Jacob Thornton committed
4109

XhmikosR's avatar
XhmikosR committed
4110
      this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
XhmikosR's avatar
XhmikosR committed
4111
      tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$4);
XhmikosR's avatar
XhmikosR committed
4112
4113
    } // Private
    ;
XhmikosR's avatar
XhmikosR committed
4114
4115
4116

    _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
      this.getTipElement().classList.add(CLASS_PREFIX$1 + "-" + attachment);
XhmikosR's avatar
XhmikosR committed
4117
    };
Mark Otto's avatar
dist    
Mark Otto committed
4118

XhmikosR's avatar
Dist    
XhmikosR committed
4119
    _proto._getContent = function _getContent() {
XhmikosR's avatar
XhmikosR committed
4120
      return this.element.getAttribute('data-bs-content') || this.config.content;
XhmikosR's avatar
Dist    
XhmikosR committed
4121
    };
Jacob Thornton's avatar
Jacob Thornton committed
4122

XhmikosR's avatar
Dist    
XhmikosR committed
4123
    _proto._cleanTipClass = function _cleanTipClass() {
XhmikosR's avatar
XhmikosR committed
4124
4125
      var tip = this.getTipElement();
      var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
Jacob Thornton's avatar
Jacob Thornton committed
4126

XhmikosR's avatar
Dist    
XhmikosR committed
4127
      if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4128
4129
4130
4131
4132
        tabClass.map(function (token) {
          return token.trim();
        }).forEach(function (tClass) {
          return tip.classList.remove(tClass);
        });
XhmikosR's avatar
Dist    
XhmikosR committed
4133
      }
Mark Otto's avatar
Mark Otto committed
4134
4135
    } // Static
    ;
Mark Otto's avatar
dist    
Mark Otto committed
4136

XhmikosR's avatar
XhmikosR committed
4137
    Popover.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist    
XhmikosR committed
4138
      return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4139
        var data = Data.getData(this, DATA_KEY$7);
Mark Otto's avatar
dist    
Mark Otto committed
4140

XhmikosR's avatar
Dist    
XhmikosR committed
4141
        var _config = typeof config === 'object' ? config : null;
Mark Otto's avatar
dist    
Mark Otto committed
4142

XhmikosR's avatar
Dist    
XhmikosR committed
4143
4144
4145
        if (!data && /dispose|hide/.test(config)) {
          return;
        }
Mark Otto's avatar
build    
Mark Otto committed
4146

XhmikosR's avatar
Dist    
XhmikosR committed
4147
4148
        if (!data) {
          data = new Popover(this, _config);
XhmikosR's avatar
XhmikosR committed
4149
          Data.setData(this, DATA_KEY$7, data);
XhmikosR's avatar
Dist    
XhmikosR committed
4150
        }
Mark Otto's avatar
dist    
Mark Otto committed
4151

XhmikosR's avatar
Dist    
XhmikosR committed
4152
4153
4154
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist    
Mark Otto committed
4155
          }
Jacob Thornton's avatar
Jacob Thornton committed
4156

XhmikosR's avatar
Dist    
XhmikosR committed
4157
          data[config]();
Mark Otto's avatar
dist    
Mark Otto committed
4158
        }
XhmikosR's avatar
Dist    
XhmikosR committed
4159
4160
      });
    };
Mark Otto's avatar
dist    
Mark Otto committed
4161

XhmikosR's avatar
XhmikosR committed
4162
    Popover.getInstance = function getInstance(element) {
XhmikosR's avatar
XhmikosR committed
4163
4164
4165
      return Data.getData(element, DATA_KEY$7);
    };

XhmikosR's avatar
Dist    
XhmikosR committed
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
    _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() {
XhmikosR's avatar
XhmikosR committed
4190
        return Event$2;
XhmikosR's avatar
Dist    
XhmikosR committed
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
      }
    }, {
      key: "EVENT_KEY",
      get: function get() {
        return EVENT_KEY$7;
      }
    }, {
      key: "DefaultType",
      get: function get() {
        return DefaultType$5;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
4203

XhmikosR's avatar
Dist    
XhmikosR committed
4204
4205
4206
4207
4208
4209
    return Popover;
  }(Tooltip);
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
4210
   * add .Popover to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
4211
   */
Mark Otto's avatar
dist    
Mark Otto committed
4212

4213

XhmikosR's avatar
XhmikosR committed
4214
4215
4216
  onDOMContentLoaded(function () {
    var $ = getjQuery();
    /* istanbul ignore if */
Jacob Thornton's avatar
Jacob Thornton committed
4217

XhmikosR's avatar
XhmikosR committed
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
    if ($) {
      var JQUERY_NO_CONFLICT = $.fn[NAME$7];
      $.fn[NAME$7] = Popover.jQueryInterface;
      $.fn[NAME$7].Constructor = Popover;

      $.fn[NAME$7].noConflict = function () {
        $.fn[NAME$7] = JQUERY_NO_CONFLICT;
        return Popover.jQueryInterface;
      };
    }
  });
Jacob Thornton's avatar
Jacob Thornton committed
4229

XhmikosR's avatar
Dist    
XhmikosR committed
4230
4231
4232
4233
4234
4235
4236
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$8 = 'scrollspy';
XhmikosR's avatar
XhmikosR committed
4237
  var VERSION$8 = '5.0.0-alpha3';
XhmikosR's avatar
Dist    
XhmikosR committed
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
  var DATA_KEY$8 = 'bs.scrollspy';
  var EVENT_KEY$8 = "." + DATA_KEY$8;
  var DATA_API_KEY$6 = '.data-api';
  var Default$6 = {
    offset: 10,
    method: 'auto',
    target: ''
  };
  var DefaultType$6 = {
    offset: 'number',
    method: 'string',
    target: '(string|element)'
  };
XhmikosR's avatar
XhmikosR committed
4251
4252
4253
4254
4255
  var EVENT_ACTIVATE = "activate" + EVENT_KEY$8;
  var EVENT_SCROLL = "scroll" + EVENT_KEY$8;
  var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$6;
  var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
  var CLASS_NAME_ACTIVE$2 = 'active';
XhmikosR's avatar
XhmikosR committed
4256
  var SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]';
XhmikosR's avatar
XhmikosR committed
4257
4258
4259
4260
4261
4262
4263
4264
  var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
  var SELECTOR_NAV_LINKS = '.nav-link';
  var SELECTOR_NAV_ITEMS = '.nav-item';
  var SELECTOR_LIST_ITEMS = '.list-group-item';
  var SELECTOR_DROPDOWN = '.dropdown';
  var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
  var METHOD_OFFSET = 'offset';
  var METHOD_POSITION = 'position';
XhmikosR's avatar
XhmikosR committed
4265
4266
4267
4268
4269
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */
XhmikosR's avatar
Dist    
XhmikosR committed
4270

XhmikosR's avatar
XhmikosR committed
4271
  var ScrollSpy = /*#__PURE__*/function () {
XhmikosR's avatar
Dist    
XhmikosR committed
4272
4273
4274
4275
4276
4277
    function ScrollSpy(element, config) {
      var _this = this;

      this._element = element;
      this._scrollElement = element.tagName === 'BODY' ? window : element;
      this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
4278
      this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + ", " + this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
XhmikosR's avatar
Dist    
XhmikosR committed
4279
4280
4281
4282
      this._offsets = [];
      this._targets = [];
      this._activeTarget = null;
      this._scrollHeight = 0;
XhmikosR's avatar
XhmikosR committed
4283
      EventHandler.on(this._scrollElement, EVENT_SCROLL, function (event) {
XhmikosR's avatar
Dist    
XhmikosR committed
4284
4285
4286
4287
4288
        return _this._process(event);
      });
      this.refresh();

      this._process();
XhmikosR's avatar
XhmikosR committed
4289
4290

      Data.setData(element, DATA_KEY$8, this);
XhmikosR's avatar
Dist    
XhmikosR committed
4291
4292
4293
4294
4295
4296
4297
4298
4299
    } // Getters


    var _proto = ScrollSpy.prototype;

    // Public
    _proto.refresh = function refresh() {
      var _this2 = this;

XhmikosR's avatar
XhmikosR committed
4300
      var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
XhmikosR's avatar
Dist    
XhmikosR committed
4301
      var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
XhmikosR's avatar
XhmikosR committed
4302
      var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
XhmikosR's avatar
Dist    
XhmikosR committed
4303
4304
4305
      this._offsets = [];
      this._targets = [];
      this._scrollHeight = this._getScrollHeight();
XhmikosR's avatar
XhmikosR committed
4306
      var targets = SelectorEngine.find(this._selector);
XhmikosR's avatar
Dist    
XhmikosR committed
4307
      targets.map(function (element) {
XhmikosR's avatar
XhmikosR committed
4308
        var targetSelector = getSelectorFromElement(element);
XhmikosR's avatar
XhmikosR committed
4309
        var target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
XhmikosR's avatar
Dist    
XhmikosR committed
4310
4311
4312
4313
4314

        if (target) {
          var targetBCR = target.getBoundingClientRect();

          if (targetBCR.width || targetBCR.height) {
XhmikosR's avatar
XhmikosR committed
4315
            return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
XhmikosR's avatar
Dist    
XhmikosR committed
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
          }
        }

        return null;
      }).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]);
      });
Mark Otto's avatar
dist    
Mark Otto committed
4329
    };
XhmikosR's avatar
Dist    
XhmikosR committed
4330
4331

    _proto.dispose = function dispose() {
XhmikosR's avatar
XhmikosR committed
4332
4333
      Data.removeData(this._element, DATA_KEY$8);
      EventHandler.off(this._scrollElement, EVENT_KEY$8);
XhmikosR's avatar
Dist    
XhmikosR committed
4334
4335
4336
4337
4338
4339
4340
4341
      this._element = null;
      this._scrollElement = null;
      this._config = null;
      this._selector = null;
      this._offsets = null;
      this._targets = null;
      this._activeTarget = null;
      this._scrollHeight = null;
Mark Otto's avatar
Mark Otto committed
4342
4343
    } // Private
    ;
XhmikosR's avatar
Dist    
XhmikosR committed
4344
4345

    _proto._getConfig = function _getConfig(config) {
XhmikosR's avatar
XhmikosR committed
4346
      config = _extends({}, Default$6, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist    
XhmikosR committed
4347

XhmikosR's avatar
XhmikosR committed
4348
      if (typeof config.target !== 'string' && isElement(config.target)) {
XhmikosR's avatar
XhmikosR committed
4349
        var id = config.target.id;
XhmikosR's avatar
Dist    
XhmikosR committed
4350
4351

        if (!id) {
XhmikosR's avatar
XhmikosR committed
4352
4353
          id = getUID(NAME$8);
          config.target.id = id;
XhmikosR's avatar
Dist    
XhmikosR committed
4354
4355
4356
4357
4358
        }

        config.target = "#" + id;
      }

XhmikosR's avatar
XhmikosR committed
4359
      typeCheckConfig(NAME$8, config, DefaultType$6);
XhmikosR's avatar
Dist    
XhmikosR committed
4360
      return config;
Mark Otto's avatar
dist    
Mark Otto committed
4361
    };
XhmikosR's avatar
Dist    
XhmikosR committed
4362
4363
4364

    _proto._getScrollTop = function _getScrollTop() {
      return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
Mark Otto's avatar
dist    
Mark Otto committed
4365
    };
XhmikosR's avatar
Dist    
XhmikosR committed
4366
4367
4368

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

XhmikosR's avatar
Dist    
XhmikosR committed
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
    _proto._getOffsetHeight = function _getOffsetHeight() {
      return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
    };

    _proto._process = function _process() {
      var scrollTop = this._getScrollTop() + this._config.offset;

      var scrollHeight = this._getScrollHeight();

      var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();

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

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

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

        return;
      }

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

        this._clear();

        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4403

XhmikosR's avatar
XhmikosR committed
4404
      for (var i = this._offsets.length; i--;) {
XhmikosR's avatar
Dist    
XhmikosR committed
4405
        var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
Mark Otto's avatar
dist    
Mark Otto committed
4406

XhmikosR's avatar
Dist    
XhmikosR committed
4407
4408
4409
4410
4411
        if (isActiveTarget) {
          this._activate(this._targets[i]);
        }
      }
    };
Jacob Thornton's avatar
Jacob Thornton committed
4412

XhmikosR's avatar
Dist    
XhmikosR committed
4413
4414
    _proto._activate = function _activate(target) {
      this._activeTarget = target;
Jacob Thornton's avatar
Jacob Thornton committed
4415

XhmikosR's avatar
Dist    
XhmikosR committed
4416
      this._clear();
Jacob Thornton's avatar
Jacob Thornton committed
4417

XhmikosR's avatar
Dist    
XhmikosR committed
4418
      var queries = this._selector.split(',').map(function (selector) {
XhmikosR's avatar
XhmikosR committed
4419
        return selector + "[data-bs-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
XhmikosR's avatar
Dist    
XhmikosR committed
4420
      });
XhmikosR's avatar
Dist    
XhmikosR committed
4421

XhmikosR's avatar
XhmikosR committed
4422
      var link = SelectorEngine.findOne(queries.join(','));
Mark Otto's avatar
dist    
Mark Otto committed
4423

XhmikosR's avatar
XhmikosR committed
4424
      if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
XhmikosR's avatar
XhmikosR committed
4425
        SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4426
        link.classList.add(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
Dist    
XhmikosR committed
4427
4428
      } else {
        // Set triggered link as active
XhmikosR's avatar
XhmikosR committed
4429
4430
        link.classList.add(CLASS_NAME_ACTIVE$2);
        SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP).forEach(function (listGroup) {
XhmikosR's avatar
XhmikosR committed
4431
4432
          // 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
4433
4434
          SelectorEngine.prev(listGroup, SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).forEach(function (item) {
            return item.classList.add(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4435
4436
          }); // Handle special case when .nav-link is inside .nav-item

XhmikosR's avatar
XhmikosR committed
4437
4438
4439
          SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS).forEach(function (navItem) {
            SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(function (item) {
              return item.classList.add(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4440
4441
4442
            });
          });
        });
XhmikosR's avatar
Dist    
XhmikosR committed
4443
      }
Mark Otto's avatar
dist    
Mark Otto committed
4444

XhmikosR's avatar
XhmikosR committed
4445
      EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {
XhmikosR's avatar
Dist    
XhmikosR committed
4446
4447
4448
        relatedTarget: target
      });
    };
Jacob Thornton's avatar
Jacob Thornton committed
4449

XhmikosR's avatar
Dist    
XhmikosR committed
4450
    _proto._clear = function _clear() {
XhmikosR's avatar
XhmikosR committed
4451
4452
      SelectorEngine.find(this._selector).filter(function (node) {
        return node.classList.contains(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
Dist    
XhmikosR committed
4453
      }).forEach(function (node) {
XhmikosR's avatar
XhmikosR committed
4454
        return node.classList.remove(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
Dist    
XhmikosR committed
4455
      });
Mark Otto's avatar
Mark Otto committed
4456
4457
    } // Static
    ;
Jacob Thornton's avatar
Jacob Thornton committed
4458

XhmikosR's avatar
XhmikosR committed
4459
    ScrollSpy.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist    
XhmikosR committed
4460
      return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4461
        var data = Data.getData(this, DATA_KEY$8);
Jacob Thornton's avatar
Jacob Thornton committed
4462

XhmikosR's avatar
Dist    
XhmikosR committed
4463
        var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist    
Mark Otto committed
4464

XhmikosR's avatar
Dist    
XhmikosR committed
4465
4466
        if (!data) {
          data = new ScrollSpy(this, _config);
Mark Otto's avatar
dist    
Mark Otto committed
4467
        }
Mark Otto's avatar
dist    
Mark Otto committed
4468

XhmikosR's avatar
Dist    
XhmikosR committed
4469
4470
4471
4472
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
          }
Mark Otto's avatar
grunt    
Mark Otto committed
4473

XhmikosR's avatar
Dist    
XhmikosR committed
4474
4475
4476
4477
          data[config]();
        }
      });
    };
Jacob Thornton's avatar
Jacob Thornton committed
4478

XhmikosR's avatar
XhmikosR committed
4479
    ScrollSpy.getInstance = function getInstance(element) {
XhmikosR's avatar
XhmikosR committed
4480
4481
4482
      return Data.getData(element, DATA_KEY$8);
    };

XhmikosR's avatar
Dist    
XhmikosR committed
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
    _createClass(ScrollSpy, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$8;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default$6;
      }
    }]);
Mark Otto's avatar
grunt    
Mark Otto committed
4494

XhmikosR's avatar
Dist    
XhmikosR committed
4495
4496
4497
4498
4499
4500
4501
    return ScrollSpy;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Jacob Thornton's avatar
Jacob Thornton committed
4502
4503


XhmikosR's avatar
XhmikosR committed
4504
4505
  EventHandler.on(window, EVENT_LOAD_DATA_API$1, function () {
    SelectorEngine.find(SELECTOR_DATA_SPY).forEach(function (spy) {
XhmikosR's avatar
XhmikosR committed
4506
4507
      return new ScrollSpy(spy, Manipulator.getDataAttributes(spy));
    });
XhmikosR's avatar
Dist    
XhmikosR committed
4508
4509
4510
4511
4512
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
4513
   * add .ScrollSpy to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
4514
   */
Jacob Thornton's avatar
Jacob Thornton committed
4515

XhmikosR's avatar
XhmikosR committed
4516
4517
4518
  onDOMContentLoaded(function () {
    var $ = getjQuery();
    /* istanbul ignore if */
4519

XhmikosR's avatar
XhmikosR committed
4520
4521
4522
4523
    if ($) {
      var JQUERY_NO_CONFLICT = $.fn[NAME$8];
      $.fn[NAME$8] = ScrollSpy.jQueryInterface;
      $.fn[NAME$8].Constructor = ScrollSpy;
Jacob Thornton's avatar
Jacob Thornton committed
4524

XhmikosR's avatar
XhmikosR committed
4525
4526
4527
4528
4529
4530
      $.fn[NAME$8].noConflict = function () {
        $.fn[NAME$8] = JQUERY_NO_CONFLICT;
        return ScrollSpy.jQueryInterface;
      };
    }
  });
Jacob Thornton's avatar
Jacob Thornton committed
4531

XhmikosR's avatar
Dist    
XhmikosR committed
4532
4533
4534
4535
4536
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
4537

XhmikosR's avatar
Dist    
XhmikosR committed
4538
  var NAME$9 = 'tab';
XhmikosR's avatar
XhmikosR committed
4539
  var VERSION$9 = '5.0.0-alpha3';
XhmikosR's avatar
Dist    
XhmikosR committed
4540
4541
4542
  var DATA_KEY$9 = 'bs.tab';
  var EVENT_KEY$9 = "." + DATA_KEY$9;
  var DATA_API_KEY$7 = '.data-api';
XhmikosR's avatar
XhmikosR committed
4543
4544
4545
4546
4547
4548
4549
  var EVENT_HIDE$3 = "hide" + EVENT_KEY$9;
  var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9;
  var EVENT_SHOW$3 = "show" + EVENT_KEY$9;
  var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9;
  var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7;
  var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
  var CLASS_NAME_ACTIVE$3 = 'active';
XhmikosR's avatar
XhmikosR committed
4550
  var CLASS_NAME_DISABLED$1 = 'disabled';
XhmikosR's avatar
XhmikosR committed
4551
4552
4553
4554
  var CLASS_NAME_FADE$3 = 'fade';
  var CLASS_NAME_SHOW$5 = 'show';
  var SELECTOR_DROPDOWN$1 = '.dropdown';
  var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
XhmikosR's avatar
XhmikosR committed
4555
  var SELECTOR_ACTIVE$1 = '.active';
XhmikosR's avatar
XhmikosR committed
4556
  var SELECTOR_ACTIVE_UL = ':scope > li > .active';
XhmikosR's avatar
XhmikosR committed
4557
  var SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';
XhmikosR's avatar
XhmikosR committed
4558
4559
  var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
  var SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
XhmikosR's avatar
XhmikosR committed
4560
4561
4562
4563
4564
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
4565

XhmikosR's avatar
XhmikosR committed
4566
  var Tab = /*#__PURE__*/function () {
XhmikosR's avatar
Dist    
XhmikosR committed
4567
4568
    function Tab(element) {
      this._element = element;
XhmikosR's avatar
XhmikosR committed
4569
      Data.setData(this._element, DATA_KEY$9, this);
XhmikosR's avatar
Dist    
XhmikosR committed
4570
    } // Getters
Jacob Thornton's avatar
Jacob Thornton committed
4571

Mark Otto's avatar
dist    
Mark Otto committed
4572

XhmikosR's avatar
Dist    
XhmikosR committed
4573
    var _proto = Tab.prototype;
Jacob Thornton's avatar
Jacob Thornton committed
4574

XhmikosR's avatar
Dist    
XhmikosR committed
4575
4576
4577
    // Public
    _proto.show = function show() {
      var _this = this;
Jacob Thornton's avatar
Jacob Thornton committed
4578

XhmikosR's avatar
XhmikosR committed
4579
      if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE$3) || this._element.classList.contains(CLASS_NAME_DISABLED$1)) {
XhmikosR's avatar
Dist    
XhmikosR committed
4580
4581
        return;
      }
Mark Otto's avatar
grunt    
Mark Otto committed
4582

XhmikosR's avatar
Dist    
XhmikosR committed
4583
      var previous;
XhmikosR's avatar
XhmikosR committed
4584
      var target = getElementFromSelector(this._element);
XhmikosR's avatar
XhmikosR committed
4585
4586

      var listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP$1);
XhmikosR's avatar
Dist    
XhmikosR committed
4587
4588

      if (listElement) {
XhmikosR's avatar
XhmikosR committed
4589
        var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$1;
XhmikosR's avatar
XhmikosR committed
4590
        previous = SelectorEngine.find(itemSelector, listElement);
XhmikosR's avatar
Dist    
XhmikosR committed
4591
4592
        previous = previous[previous.length - 1];
      }
Mark Otto's avatar
grunt    
Mark Otto committed
4593

XhmikosR's avatar
XhmikosR committed
4594
      var hideEvent = null;
Mark Otto's avatar
dist    
Mark Otto committed
4595

XhmikosR's avatar
Dist    
XhmikosR committed
4596
      if (previous) {
XhmikosR's avatar
XhmikosR committed
4597
        hideEvent = EventHandler.trigger(previous, EVENT_HIDE$3, {
XhmikosR's avatar
XhmikosR committed
4598
4599
          relatedTarget: this._element
        });
XhmikosR's avatar
Dist    
XhmikosR committed
4600
      }
Mark Otto's avatar
dist    
Mark Otto committed
4601

XhmikosR's avatar
XhmikosR committed
4602
      var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
XhmikosR's avatar
XhmikosR committed
4603
4604
        relatedTarget: previous
      });
Jacob Thornton's avatar
Jacob Thornton committed
4605

XhmikosR's avatar
XhmikosR committed
4606
      if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
XhmikosR's avatar
Dist    
XhmikosR committed
4607
4608
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4609

XhmikosR's avatar
Dist    
XhmikosR committed
4610
      this._activate(this._element, listElement);
Johann-S's avatar
build    
Johann-S committed
4611

XhmikosR's avatar
Dist    
XhmikosR committed
4612
      var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
4613
        EventHandler.trigger(previous, EVENT_HIDDEN$3, {
XhmikosR's avatar
Dist    
XhmikosR committed
4614
          relatedTarget: _this._element
Mark Otto's avatar
dist    
Mark Otto committed
4615
        });
XhmikosR's avatar
XhmikosR committed
4616
        EventHandler.trigger(_this._element, EVENT_SHOWN$3, {
XhmikosR's avatar
Dist    
XhmikosR committed
4617
4618
          relatedTarget: previous
        });
Mark Otto's avatar
dist    
Mark Otto committed
4619
      };
Johann-S's avatar
build    
Johann-S committed
4620

XhmikosR's avatar
Dist    
XhmikosR committed
4621
4622
4623
4624
4625
4626
      if (target) {
        this._activate(target, target.parentNode, complete);
      } else {
        complete();
      }
    };
Johann-S's avatar
build    
Johann-S committed
4627

XhmikosR's avatar
Dist    
XhmikosR committed
4628
    _proto.dispose = function dispose() {
XhmikosR's avatar
XhmikosR committed
4629
      Data.removeData(this._element, DATA_KEY$9);
XhmikosR's avatar
Dist    
XhmikosR committed
4630
      this._element = null;
Mark Otto's avatar
Mark Otto committed
4631
4632
    } // Private
    ;
Mark Otto's avatar
dist    
Mark Otto committed
4633

XhmikosR's avatar
Dist    
XhmikosR committed
4634
4635
    _proto._activate = function _activate(element, container, callback) {
      var _this2 = this;
Jacob Thornton's avatar
Jacob Thornton committed
4636

XhmikosR's avatar
XhmikosR committed
4637
      var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE$1);
XhmikosR's avatar
Dist    
XhmikosR committed
4638
      var active = activeElements[0];
XhmikosR's avatar
XhmikosR committed
4639
      var isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE$3);
XhmikosR's avatar
Dist    
XhmikosR committed
4640
4641
4642

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

XhmikosR's avatar
Dist    
XhmikosR committed
4645
      if (active && isTransitioning) {
XhmikosR's avatar
XhmikosR committed
4646
        var transitionDuration = getTransitionDurationFromElement(active);
XhmikosR's avatar
XhmikosR committed
4647
        active.classList.remove(CLASS_NAME_SHOW$5);
XhmikosR's avatar
XhmikosR committed
4648
4649
        EventHandler.one(active, TRANSITION_END, complete);
        emulateTransitionEnd(active, transitionDuration);
XhmikosR's avatar
Dist    
XhmikosR committed
4650
4651
4652
4653
4654
4655
4656
      } else {
        complete();
      }
    };

    _proto._transitionComplete = function _transitionComplete(element, active, callback) {
      if (active) {
XhmikosR's avatar
XhmikosR committed
4657
4658
        active.classList.remove(CLASS_NAME_ACTIVE$3);
        var dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
XhmikosR's avatar
Dist    
XhmikosR committed
4659
4660

        if (dropdownChild) {
XhmikosR's avatar
XhmikosR committed
4661
          dropdownChild.classList.remove(CLASS_NAME_ACTIVE$3);
Mark Otto's avatar
grunt    
Mark Otto committed
4662
        }
XhmikosR's avatar
Dist    
XhmikosR committed
4663
4664
4665

        if (active.getAttribute('role') === 'tab') {
          active.setAttribute('aria-selected', false);
Mark Otto's avatar
dist    
Mark Otto committed
4666
        }
XhmikosR's avatar
Dist    
XhmikosR committed
4667
      }
Mark Otto's avatar
dist    
Mark Otto committed
4668

XhmikosR's avatar
XhmikosR committed
4669
      element.classList.add(CLASS_NAME_ACTIVE$3);
XhmikosR's avatar
Dist    
XhmikosR committed
4670
4671
4672
4673

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

XhmikosR's avatar
XhmikosR committed
4675
      reflow(element);
Mark Otto's avatar
Mark Otto committed
4676

XhmikosR's avatar
XhmikosR committed
4677
4678
      if (element.classList.contains(CLASS_NAME_FADE$3)) {
        element.classList.add(CLASS_NAME_SHOW$5);
Mark Otto's avatar
Mark Otto committed
4679
      }
Mark Otto's avatar
dist    
Mark Otto committed
4680

XhmikosR's avatar
XhmikosR committed
4681
      if (element.parentNode && element.parentNode.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
XhmikosR's avatar
XhmikosR committed
4682
        var dropdownElement = element.closest(SELECTOR_DROPDOWN$1);
Mark Otto's avatar
dist    
Mark Otto committed
4683

XhmikosR's avatar
Dist    
XhmikosR committed
4684
        if (dropdownElement) {
XhmikosR's avatar
XhmikosR committed
4685
4686
          SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE$1).forEach(function (dropdown) {
            return dropdown.classList.add(CLASS_NAME_ACTIVE$3);
XhmikosR's avatar
XhmikosR committed
4687
          });
XhmikosR's avatar
Dist    
XhmikosR committed
4688
        }
Jacob Thornton's avatar
Jacob Thornton committed
4689

XhmikosR's avatar
Dist    
XhmikosR committed
4690
        element.setAttribute('aria-expanded', true);
Mark Otto's avatar
dist    
Mark Otto committed
4691
      }
Mark Otto's avatar
dist    
Mark Otto committed
4692

XhmikosR's avatar
Dist    
XhmikosR committed
4693
4694
4695
      if (callback) {
        callback();
      }
Mark Otto's avatar
Mark Otto committed
4696
4697
    } // Static
    ;
Jacob Thornton's avatar
Jacob Thornton committed
4698

XhmikosR's avatar
XhmikosR committed
4699
    Tab.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist    
XhmikosR committed
4700
      return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4701
        var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist    
XhmikosR committed
4702
4703
4704
4705
4706
4707
4708
4709
4710

        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
          }

          data[config]();
        }
      });
Mark Otto's avatar
dist    
Mark Otto committed
4711
    };
Jacob Thornton's avatar
Jacob Thornton committed
4712

XhmikosR's avatar
XhmikosR committed
4713
    Tab.getInstance = function getInstance(element) {
XhmikosR's avatar
XhmikosR committed
4714
4715
4716
      return Data.getData(element, DATA_KEY$9);
    };

XhmikosR's avatar
Dist    
XhmikosR committed
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
    _createClass(Tab, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$9;
      }
    }]);

    return Tab;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */


XhmikosR's avatar
XhmikosR committed
4733
  EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) {
XhmikosR's avatar
Dist    
XhmikosR committed
4734
    event.preventDefault();
XhmikosR's avatar
XhmikosR committed
4735
4736
    var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
    data.show();
XhmikosR's avatar
Dist    
XhmikosR committed
4737
4738
4739
4740
4741
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
4742
   * add .Tab to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
4743
4744
   */

XhmikosR's avatar
XhmikosR committed
4745
4746
4747
  onDOMContentLoaded(function () {
    var $ = getjQuery();
    /* istanbul ignore if */
4748

XhmikosR's avatar
XhmikosR committed
4749
4750
4751
4752
    if ($) {
      var JQUERY_NO_CONFLICT = $.fn[NAME$9];
      $.fn[NAME$9] = Tab.jQueryInterface;
      $.fn[NAME$9].Constructor = Tab;
XhmikosR's avatar
Dist    
XhmikosR committed
4753

XhmikosR's avatar
XhmikosR committed
4754
4755
4756
4757
4758
4759
      $.fn[NAME$9].noConflict = function () {
        $.fn[NAME$9] = JQUERY_NO_CONFLICT;
        return Tab.jQueryInterface;
      };
    }
  });
Jacob Thornton's avatar
Jacob Thornton committed
4760
4761

  /**
XhmikosR's avatar
Dist    
XhmikosR committed
4762
4763
4764
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
Jacob Thornton's avatar
Jacob Thornton committed
4765
   */
Mark Otto's avatar
dist    
Mark Otto committed
4766

XhmikosR's avatar
Dist    
XhmikosR committed
4767
  var NAME$a = 'toast';
XhmikosR's avatar
XhmikosR committed
4768
  var VERSION$a = '5.0.0-alpha3';
XhmikosR's avatar
Dist    
XhmikosR committed
4769
4770
  var DATA_KEY$a = 'bs.toast';
  var EVENT_KEY$a = "." + DATA_KEY$a;
XhmikosR's avatar
XhmikosR committed
4771
4772
4773
4774
4775
4776
4777
4778
4779
  var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
  var EVENT_HIDE$4 = "hide" + EVENT_KEY$a;
  var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a;
  var EVENT_SHOW$4 = "show" + EVENT_KEY$a;
  var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a;
  var CLASS_NAME_FADE$4 = 'fade';
  var CLASS_NAME_HIDE = 'hide';
  var CLASS_NAME_SHOW$6 = 'show';
  var CLASS_NAME_SHOWING = 'showing';
XhmikosR's avatar
Dist    
XhmikosR committed
4780
4781
4782
4783
4784
4785
4786
4787
  var DefaultType$7 = {
    animation: 'boolean',
    autohide: 'boolean',
    delay: 'number'
  };
  var Default$7 = {
    animation: true,
    autohide: true,
XhmikosR's avatar
XhmikosR committed
4788
    delay: 5000
XhmikosR's avatar
Dist    
XhmikosR committed
4789
  };
XhmikosR's avatar
XhmikosR committed
4790
  var SELECTOR_DATA_DISMISS$1 = '[data-bs-dismiss="toast"]';
XhmikosR's avatar
XhmikosR committed
4791
4792
4793
4794
4795
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */
Jacob Thornton's avatar
Jacob Thornton committed
4796

XhmikosR's avatar
XhmikosR committed
4797
  var Toast = /*#__PURE__*/function () {
XhmikosR's avatar
Dist    
XhmikosR committed
4798
4799
4800
4801
    function Toast(element, config) {
      this._element = element;
      this._config = this._getConfig(config);
      this._timeout = null;
Jacob Thornton's avatar
Jacob Thornton committed
4802

XhmikosR's avatar
Dist    
XhmikosR committed
4803
      this._setListeners();
XhmikosR's avatar
XhmikosR committed
4804
4805

      Data.setData(element, DATA_KEY$a, this);
XhmikosR's avatar
Dist    
XhmikosR committed
4806
    } // Getters
Jacob Thornton's avatar
Jacob Thornton committed
4807

Johann-S's avatar
build    
Johann-S committed
4808

XhmikosR's avatar
Dist    
XhmikosR committed
4809
    var _proto = Toast.prototype;
XhmikosR's avatar
Dist    
XhmikosR committed
4810

XhmikosR's avatar
Dist    
XhmikosR committed
4811
4812
4813
    // Public
    _proto.show = function show() {
      var _this = this;
Jacob Thornton's avatar
Jacob Thornton committed
4814

XhmikosR's avatar
XhmikosR committed
4815
      var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4);
Mark Otto's avatar
dist v5    
Mark Otto committed
4816
4817
4818
4819

      if (showEvent.defaultPrevented) {
        return;
      }
Jacob Thornton's avatar
Jacob Thornton committed
4820

XhmikosR's avatar
XhmikosR committed
4821
4822
      this._clearTimeout();

XhmikosR's avatar
Dist    
XhmikosR committed
4823
      if (this._config.animation) {
XhmikosR's avatar
XhmikosR committed
4824
        this._element.classList.add(CLASS_NAME_FADE$4);
XhmikosR's avatar
Dist    
XhmikosR committed
4825
      }
Mark Otto's avatar
dist    
Mark Otto committed
4826

XhmikosR's avatar
Dist    
XhmikosR committed
4827
      var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
4828
        _this._element.classList.remove(CLASS_NAME_SHOWING);
Mark Otto's avatar
dist    
Mark Otto committed
4829

XhmikosR's avatar
XhmikosR committed
4830
        _this._element.classList.add(CLASS_NAME_SHOW$6);
Mark Otto's avatar
dist    
Mark Otto committed
4831

XhmikosR's avatar
XhmikosR committed
4832
        EventHandler.trigger(_this._element, EVENT_SHOWN$4);
Mark Otto's avatar
dist    
Mark Otto committed
4833

XhmikosR's avatar
Dist    
XhmikosR committed
4834
        if (_this._config.autohide) {
XhmikosR's avatar
XhmikosR committed
4835
4836
4837
          _this._timeout = setTimeout(function () {
            _this.hide();
          }, _this._config.delay);
Mark Otto's avatar
dist    
Mark Otto committed
4838
        }
XhmikosR's avatar
Dist    
XhmikosR committed
4839
      };
Mark Otto's avatar
dist    
Mark Otto committed
4840

XhmikosR's avatar
XhmikosR committed
4841
      this._element.classList.remove(CLASS_NAME_HIDE);
Mark Otto's avatar
dist    
Mark Otto committed
4842

4843
4844
      reflow(this._element);

XhmikosR's avatar
XhmikosR committed
4845
      this._element.classList.add(CLASS_NAME_SHOWING);
Mark Otto's avatar
dist    
Mark Otto committed
4846

XhmikosR's avatar
Dist    
XhmikosR committed
4847
      if (this._config.animation) {
XhmikosR's avatar
XhmikosR committed
4848
4849
4850
        var transitionDuration = getTransitionDurationFromElement(this._element);
        EventHandler.one(this._element, TRANSITION_END, complete);
        emulateTransitionEnd(this._element, transitionDuration);
XhmikosR's avatar
Dist    
XhmikosR committed
4851
4852
4853
4854
      } else {
        complete();
      }
    };
Mark Otto's avatar
dist    
Mark Otto committed
4855

XhmikosR's avatar
XhmikosR committed
4856
    _proto.hide = function hide() {
XhmikosR's avatar
Dist    
XhmikosR committed
4857
      var _this2 = this;
Mark Otto's avatar
dist    
Mark Otto committed
4858

XhmikosR's avatar
XhmikosR committed
4859
      if (!this._element.classList.contains(CLASS_NAME_SHOW$6)) {
XhmikosR's avatar
Dist    
XhmikosR committed
4860
4861
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4862

XhmikosR's avatar
XhmikosR committed
4863
      var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);
Mark Otto's avatar
dist v5    
Mark Otto committed
4864
4865
4866
4867

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

XhmikosR's avatar
XhmikosR committed
4869
      var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
4870
        _this2._element.classList.add(CLASS_NAME_HIDE);
XhmikosR's avatar
XhmikosR committed
4871

XhmikosR's avatar
XhmikosR committed
4872
        EventHandler.trigger(_this2._element, EVENT_HIDDEN$4);
XhmikosR's avatar
XhmikosR committed
4873
4874
      };

XhmikosR's avatar
XhmikosR committed
4875
      this._element.classList.remove(CLASS_NAME_SHOW$6);
XhmikosR's avatar
XhmikosR committed
4876
4877
4878
4879
4880

      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
4881
      } else {
XhmikosR's avatar
XhmikosR committed
4882
        complete();
XhmikosR's avatar
Dist    
XhmikosR committed
4883
4884
      }
    };
XhmikosR's avatar
Dist    
XhmikosR committed
4885

XhmikosR's avatar
Dist    
XhmikosR committed
4886
    _proto.dispose = function dispose() {
XhmikosR's avatar
XhmikosR committed
4887
      this._clearTimeout();
Mark Otto's avatar
dist    
Mark Otto committed
4888

XhmikosR's avatar
XhmikosR committed
4889
4890
      if (this._element.classList.contains(CLASS_NAME_SHOW$6)) {
        this._element.classList.remove(CLASS_NAME_SHOW$6);
XhmikosR's avatar
Dist    
XhmikosR committed
4891
      }
Jacob Thornton's avatar
Jacob Thornton committed
4892

XhmikosR's avatar
XhmikosR committed
4893
      EventHandler.off(this._element, EVENT_CLICK_DISMISS$1);
XhmikosR's avatar
XhmikosR committed
4894
      Data.removeData(this._element, DATA_KEY$a);
XhmikosR's avatar
Dist    
XhmikosR committed
4895
4896
      this._element = null;
      this._config = null;
Mark Otto's avatar
Mark Otto committed
4897
4898
    } // Private
    ;
Mark Otto's avatar
dist    
Mark Otto committed
4899

XhmikosR's avatar
Dist    
XhmikosR committed
4900
    _proto._getConfig = function _getConfig(config) {
XhmikosR's avatar
XhmikosR committed
4901
      config = _extends({}, Default$7, Manipulator.getDataAttributes(this._element), typeof config === 'object' && config ? config : {});
XhmikosR's avatar
XhmikosR committed
4902
      typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
XhmikosR's avatar
Dist    
XhmikosR committed
4903
4904
      return config;
    };
Mark Otto's avatar
dist    
Mark Otto committed
4905

XhmikosR's avatar
Dist    
XhmikosR committed
4906
4907
    _proto._setListeners = function _setListeners() {
      var _this3 = this;
Mark Otto's avatar
dist    
Mark Otto committed
4908

XhmikosR's avatar
XhmikosR committed
4909
      EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
XhmikosR's avatar
XhmikosR committed
4910
        return _this3.hide();
XhmikosR's avatar
Dist    
XhmikosR committed
4911
      });
XhmikosR's avatar
XhmikosR committed
4912
4913
4914
4915
4916
    };

    _proto._clearTimeout = function _clearTimeout() {
      clearTimeout(this._timeout);
      this._timeout = null;
Mark Otto's avatar
Mark Otto committed
4917
4918
    } // Static
    ;
Jacob Thornton's avatar
Jacob Thornton committed
4919

XhmikosR's avatar
XhmikosR committed
4920
    Toast.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist    
XhmikosR committed
4921
      return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4922
        var data = Data.getData(this, DATA_KEY$a);
Jacob Thornton's avatar
Jacob Thornton committed
4923

XhmikosR's avatar
Dist    
XhmikosR committed
4924
4925
4926
4927
4928
        var _config = typeof config === 'object' && config;

        if (!data) {
          data = new Toast(this, _config);
        }
Jacob Thornton's avatar
Jacob Thornton committed
4929

XhmikosR's avatar
Dist    
XhmikosR committed
4930
4931
4932
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
grunt    
Mark Otto committed
4933
          }
Mark Otto's avatar
dist    
Mark Otto committed
4934

XhmikosR's avatar
Dist    
XhmikosR committed
4935
          data[config](this);
XhmikosR's avatar
Dist    
XhmikosR committed
4936
        }
XhmikosR's avatar
Dist    
XhmikosR committed
4937
4938
      });
    };
Mark Otto's avatar
grunt    
Mark Otto committed
4939

XhmikosR's avatar
XhmikosR committed
4940
    Toast.getInstance = function getInstance(element) {
XhmikosR's avatar
XhmikosR committed
4941
4942
4943
      return Data.getData(element, DATA_KEY$a);
    };

XhmikosR's avatar
Dist    
XhmikosR committed
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
    _createClass(Toast, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$a;
      }
    }, {
      key: "DefaultType",
      get: function get() {
        return DefaultType$7;
      }
Mark Otto's avatar
Mark Otto committed
4954
4955
4956
4957
4958
    }, {
      key: "Default",
      get: function get() {
        return Default$7;
      }
XhmikosR's avatar
Dist    
XhmikosR committed
4959
    }]);
Jacob Thornton's avatar
Jacob Thornton committed
4960

XhmikosR's avatar
Dist    
XhmikosR committed
4961
4962
4963
4964
4965
4966
    return Toast;
  }();
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
4967
   * add .Toast to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
4968
   */
XhmikosR's avatar
Dist    
XhmikosR committed
4969

4970

XhmikosR's avatar
XhmikosR committed
4971
4972
4973
  onDOMContentLoaded(function () {
    var $ = getjQuery();
    /* istanbul ignore if */
Mark Otto's avatar
dist    
Mark Otto committed
4974

XhmikosR's avatar
XhmikosR committed
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
    if ($) {
      var JQUERY_NO_CONFLICT = $.fn[NAME$a];
      $.fn[NAME$a] = Toast.jQueryInterface;
      $.fn[NAME$a].Constructor = Toast;

      $.fn[NAME$a].noConflict = function () {
        $.fn[NAME$a] = JQUERY_NO_CONFLICT;
        return Toast.jQueryInterface;
      };
    }
  });
Mark Otto's avatar
grunt    
Mark Otto committed
4986

Mark Otto's avatar
dist    
Mark Otto committed
4987
4988
  /**
   * --------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
4989
   * Bootstrap (v5.0.0-alpha3): index.umd.js
XhmikosR's avatar
XhmikosR committed
4990
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
Mark Otto's avatar
dist    
Mark Otto committed
4991
4992
   * --------------------------------------------------------------------------
   */
XhmikosR's avatar
Dist.    
XhmikosR committed
4993
4994
4995
4996
4997
4998
4999
5000
  var index_umd = {
    Alert: Alert,
    Button: Button,
    Carousel: Carousel,
    Collapse: Collapse,
    Dropdown: Dropdown,
    Modal: Modal,
    Popover: Popover,
For faster browsing, not all history is shown. View entire blame