bootstrap.esm.js 143 KB
Newer Older
XhmikosR's avatar
Dist.  
XhmikosR committed
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
    }

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

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

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

    return config;
XhmikosR's avatar
XhmikosR committed
4014
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4015

XhmikosR's avatar
XhmikosR committed
4016
4017
  _proto._getDelegateConfig = function _getDelegateConfig() {
    var config = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
4018
4019

    if (this.config) {
XhmikosR's avatar
XhmikosR committed
4020
      for (var key in this.config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4021
4022
4023
4024
4025
4026
4027
        if (this.constructor.Default[key] !== this.config[key]) {
          config[key] = this.config[key];
        }
      }
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4028
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4029

XhmikosR's avatar
XhmikosR committed
4030
4031
4032
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
XhmikosR's avatar
Dist.  
XhmikosR committed
4033

XhmikosR's avatar
XhmikosR committed
4034
    if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4035
4036
4037
4038
4039
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4040
    }
XhmikosR's avatar
XhmikosR committed
4041
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4042

XhmikosR's avatar
XhmikosR committed
4043
4044
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
    var popperInstance = popperData.instance;
XhmikosR's avatar
Dist.  
XhmikosR committed
4045
4046
4047
4048
    this.tip = popperInstance.popper;

    this._cleanTipClass();

4049
    this._addAttachmentClass(this._getAttachment(popperData.placement));
XhmikosR's avatar
XhmikosR committed
4050
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4051

XhmikosR's avatar
XhmikosR committed
4052
4053
4054
  _proto._fixTransition = function _fixTransition() {
    var tip = this.getTipElement();
    var initConfigAnimation = this.config.animation;
XhmikosR's avatar
Dist.  
XhmikosR committed
4055
4056
4057
4058
4059

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

XhmikosR's avatar
XhmikosR committed
4060
    tip.classList.remove(CLASS_NAME_FADE$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4061
4062
4063
4064
4065
    this.config.animation = false;
    this.hide();
    this.show();
    this.config.animation = initConfigAnimation;
  } // Static
XhmikosR's avatar
XhmikosR committed
4066
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4067

XhmikosR's avatar
XhmikosR committed
4068
  Tooltip.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4069
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4070
      var data = Data.getData(this, DATA_KEY$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
4071

XhmikosR's avatar
XhmikosR committed
4072
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083

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

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

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4084
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4085
4086
4087
4088
4089
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4090
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4091

XhmikosR's avatar
XhmikosR committed
4092
  Tooltip.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4093
    return Data.getData(element, DATA_KEY$6);
XhmikosR's avatar
XhmikosR committed
4094
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4095

XhmikosR's avatar
XhmikosR committed
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
  _createClass(Tooltip, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$6;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$4;
    }
  }, {
    key: "NAME",
    get: function get() {
      return NAME$6;
    }
  }, {
    key: "DATA_KEY",
    get: function get() {
      return DATA_KEY$6;
    }
  }, {
    key: "Event",
    get: function get() {
XhmikosR's avatar
XhmikosR committed
4119
      return Event$1;
XhmikosR's avatar
XhmikosR committed
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$6;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$4;
    }
  }]);

  return Tooltip;
}();
XhmikosR's avatar
XhmikosR committed
4135
4136

var $$7 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4137
4138
4139
4140
4141
4142
4143
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tooltip to jQuery only if jQuery is present
 */

4144
4145
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4146
4147
4148
4149
if ($$7) {
  var JQUERY_NO_CONFLICT$6 = $$7.fn[NAME$6];
  $$7.fn[NAME$6] = Tooltip.jQueryInterface;
  $$7.fn[NAME$6].Constructor = Tooltip;
XhmikosR's avatar
Dist.  
XhmikosR committed
4150

XhmikosR's avatar
XhmikosR committed
4151
4152
4153
  $$7.fn[NAME$6].noConflict = function () {
    $$7.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
    return Tooltip.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4154
4155
4156
4157
4158
4159
4160
4161
4162
  };
}

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

XhmikosR's avatar
XhmikosR committed
4163
4164
4165
4166
4167
4168
var NAME$7 = 'popover';
var VERSION$7 = '4.3.1';
var DATA_KEY$7 = 'bs.popover';
var EVENT_KEY$7 = "." + DATA_KEY$7;
var CLASS_PREFIX$1 = 'bs-popover';
var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
XhmikosR's avatar
Dist.  
XhmikosR committed
4169

XhmikosR's avatar
XhmikosR committed
4170
var Default$5 = _objectSpread2(_objectSpread2({}, Tooltip.Default), {}, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4171
4172
4173
4174
4175
4176
  placement: 'right',
  trigger: 'click',
  content: '',
  template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
});

XhmikosR's avatar
XhmikosR committed
4177
var DefaultType$5 = _objectSpread2(_objectSpread2({}, Tooltip.DefaultType), {}, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4178
4179
4180
  content: '(string|element|function)'
});

XhmikosR's avatar
XhmikosR committed
4181
var Event$2 = {
XhmikosR's avatar
XhmikosR committed
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
  HIDE: "hide" + EVENT_KEY$7,
  HIDDEN: "hidden" + EVENT_KEY$7,
  SHOW: "show" + EVENT_KEY$7,
  SHOWN: "shown" + EVENT_KEY$7,
  INSERTED: "inserted" + EVENT_KEY$7,
  CLICK: "click" + EVENT_KEY$7,
  FOCUSIN: "focusin" + EVENT_KEY$7,
  FOCUSOUT: "focusout" + EVENT_KEY$7,
  MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  MOUSELEAVE: "mouseleave" + EVENT_KEY$7
XhmikosR's avatar
Dist.  
XhmikosR committed
4192
};
XhmikosR's avatar
XhmikosR committed
4193
4194
4195
4196
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
4197
4198
4199
4200
4201
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4202

XhmikosR's avatar
XhmikosR committed
4203
var Popover = /*#__PURE__*/function (_Tooltip) {
XhmikosR's avatar
XhmikosR committed
4204
  _inheritsLoose(Popover, _Tooltip);
XhmikosR's avatar
Dist.  
XhmikosR committed
4205

XhmikosR's avatar
XhmikosR committed
4206
4207
  function Popover() {
    return _Tooltip.apply(this, arguments) || this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4208
4209
  }

XhmikosR's avatar
XhmikosR committed
4210
  var _proto = Popover.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4211

XhmikosR's avatar
XhmikosR committed
4212
4213
  // Overrides
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4214
    return this.getTitle() || this._getContent();
XhmikosR's avatar
XhmikosR committed
4215
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4216

XhmikosR's avatar
XhmikosR committed
4217
4218
  _proto.setContent = function setContent() {
    var tip = this.getTipElement(); // we use append for html objects to maintain js events
XhmikosR's avatar
Dist.  
XhmikosR committed
4219

XhmikosR's avatar
XhmikosR committed
4220
    this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
XhmikosR's avatar
Dist.  
XhmikosR committed
4221

XhmikosR's avatar
XhmikosR committed
4222
    var content = this._getContent();
XhmikosR's avatar
Dist.  
XhmikosR committed
4223
4224
4225
4226
4227

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

XhmikosR's avatar
XhmikosR committed
4228
    this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
XhmikosR's avatar
XhmikosR committed
4229
    tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$4);
XhmikosR's avatar
XhmikosR committed
4230
4231
4232
4233
  };

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

XhmikosR's avatar
XhmikosR committed
4237
  _proto._getContent = function _getContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4238
    return this.element.getAttribute('data-content') || this.config.content;
XhmikosR's avatar
XhmikosR committed
4239
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4240

XhmikosR's avatar
XhmikosR committed
4241
4242
4243
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4244
4245

    if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4246
4247
4248
4249
4250
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4251
4252
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4253
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4254

XhmikosR's avatar
XhmikosR committed
4255
  Popover.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4256
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4257
      var data = Data.getData(this, DATA_KEY$7);
XhmikosR's avatar
Dist.  
XhmikosR committed
4258

XhmikosR's avatar
XhmikosR committed
4259
      var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271

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

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

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4272
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4273
4274
4275
4276
4277
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4278
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4279

XhmikosR's avatar
XhmikosR committed
4280
  Popover.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4281
    return Data.getData(element, DATA_KEY$7);
XhmikosR's avatar
XhmikosR committed
4282
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4283

XhmikosR's avatar
XhmikosR committed
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
  _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
4308
      return Event$2;
XhmikosR's avatar
XhmikosR committed
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$7;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$5;
    }
  }]);

  return Popover;
}(Tooltip);
XhmikosR's avatar
XhmikosR committed
4324
4325

var $$8 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4326
4327
4328
4329
4330
4331
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4332
4333
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4334
4335
4336
4337
if ($$8) {
  var JQUERY_NO_CONFLICT$7 = $$8.fn[NAME$7];
  $$8.fn[NAME$7] = Popover.jQueryInterface;
  $$8.fn[NAME$7].Constructor = Popover;
XhmikosR's avatar
Dist.  
XhmikosR committed
4338

XhmikosR's avatar
XhmikosR committed
4339
4340
4341
  $$8.fn[NAME$7].noConflict = function () {
    $$8.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
    return Popover.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4342
4343
4344
4345
4346
4347
4348
4349
4350
  };
}

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

XhmikosR's avatar
XhmikosR committed
4351
4352
4353
4354
4355
4356
var NAME$8 = 'scrollspy';
var VERSION$8 = '4.3.1';
var DATA_KEY$8 = 'bs.scrollspy';
var EVENT_KEY$8 = "." + DATA_KEY$8;
var DATA_API_KEY$6 = '.data-api';
var Default$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4357
4358
4359
4360
  offset: 10,
  method: 'auto',
  target: ''
};
XhmikosR's avatar
XhmikosR committed
4361
var DefaultType$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4362
4363
4364
4365
  offset: 'number',
  method: 'string',
  target: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
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';
var SELECTOR_DATA_SPY = '[data-spy="scroll"]';
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
4380
4381
4382
4383
4384
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4385

XhmikosR's avatar
XhmikosR committed
4386
var ScrollSpy = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
4387
4388
4389
  function ScrollSpy(element, config) {
    var _this = this;

XhmikosR's avatar
Dist.  
XhmikosR committed
4390
4391
4392
    this._element = element;
    this._scrollElement = element.tagName === 'BODY' ? window : element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
4393
    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
4394
4395
4396
4397
    this._offsets = [];
    this._targets = [];
    this._activeTarget = null;
    this._scrollHeight = 0;
XhmikosR's avatar
XhmikosR committed
4398
    EventHandler.on(this._scrollElement, EVENT_SCROLL, function (event) {
XhmikosR's avatar
XhmikosR committed
4399
4400
      return _this._process(event);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4401
4402
4403
4404
4405
4406
4407
4408
    this.refresh();

    this._process();

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


XhmikosR's avatar
XhmikosR committed
4409
  var _proto = ScrollSpy.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4410

XhmikosR's avatar
XhmikosR committed
4411
4412
4413
  // Public
  _proto.refresh = function refresh() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4414

XhmikosR's avatar
XhmikosR committed
4415
    var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
XhmikosR's avatar
XhmikosR committed
4416
    var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
XhmikosR's avatar
XhmikosR committed
4417
    var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
4418
4419
4420
    this._offsets = [];
    this._targets = [];
    this._scrollHeight = this._getScrollHeight();
XhmikosR's avatar
XhmikosR committed
4421
    var targets = SelectorEngine.find(this._selector);
XhmikosR's avatar
XhmikosR committed
4422
4423
4424
    targets.map(function (element) {
      var target;
      var targetSelector = getSelectorFromElement(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
4425
4426
4427
4428
4429
4430

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

      if (target) {
XhmikosR's avatar
XhmikosR committed
4431
        var targetBCR = target.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
4432
4433
4434
4435
4436
4437
4438

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

      return null;
XhmikosR's avatar
XhmikosR committed
4439
4440
4441
4442
4443
4444
4445
4446
    }).filter(function (item) {
      return item;
    }).sort(function (a, b) {
      return a[0] - b[0];
    }).forEach(function (item) {
      _this2._offsets.push(item[0]);

      _this2._targets.push(item[1]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4447
    });
XhmikosR's avatar
XhmikosR committed
4448
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4449

XhmikosR's avatar
XhmikosR committed
4450
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
    Data.removeData(this._element, DATA_KEY$8);
    EventHandler.off(this._scrollElement, EVENT_KEY$8);
    this._element = null;
    this._scrollElement = null;
    this._config = null;
    this._selector = null;
    this._offsets = null;
    this._targets = null;
    this._activeTarget = null;
    this._scrollHeight = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4462
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4463

XhmikosR's avatar
XhmikosR committed
4464
  _proto._getConfig = function _getConfig(config) {
XhmikosR's avatar
XhmikosR committed
4465
    config = _objectSpread2(_objectSpread2({}, Default$6), typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4466

XhmikosR's avatar
XhmikosR committed
4467
    if (typeof config.target !== 'string' && isElement(config.target)) {
XhmikosR's avatar
XhmikosR committed
4468
      var id = config.target.id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4469
4470
4471
4472
4473
4474

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

XhmikosR's avatar
XhmikosR committed
4475
      config.target = "#" + id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4476
4477
4478
4479
    }

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

XhmikosR's avatar
XhmikosR committed
4482
  _proto._getScrollTop = function _getScrollTop() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4483
    return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
XhmikosR's avatar
XhmikosR committed
4484
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4485

XhmikosR's avatar
XhmikosR committed
4486
  _proto._getScrollHeight = function _getScrollHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4487
    return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
XhmikosR's avatar
XhmikosR committed
4488
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4489

XhmikosR's avatar
XhmikosR committed
4490
  _proto._getOffsetHeight = function _getOffsetHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4491
    return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
XhmikosR's avatar
XhmikosR committed
4492
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4493

XhmikosR's avatar
XhmikosR committed
4494
4495
  _proto._process = function _process() {
    var scrollTop = this._getScrollTop() + this._config.offset;
XhmikosR's avatar
Dist.  
XhmikosR committed
4496

XhmikosR's avatar
XhmikosR committed
4497
    var scrollHeight = this._getScrollHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4498

XhmikosR's avatar
XhmikosR committed
4499
    var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4500
4501
4502
4503
4504
4505

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

    if (scrollTop >= maxScroll) {
XhmikosR's avatar
XhmikosR committed
4506
      var target = this._targets[this._targets.length - 1];
XhmikosR's avatar
Dist.  
XhmikosR committed
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522

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

      return;
    }

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

      this._clear();

      return;
    }

XhmikosR's avatar
XhmikosR committed
4523
    for (var i = this._offsets.length; i--;) {
XhmikosR's avatar
XhmikosR committed
4524
      var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4525
4526
4527
4528
4529

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

XhmikosR's avatar
XhmikosR committed
4532
  _proto._activate = function _activate(target) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4533
4534
4535
4536
    this._activeTarget = target;

    this._clear();

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

XhmikosR's avatar
XhmikosR committed
4541
    var link = SelectorEngine.findOne(queries.join(','));
XhmikosR's avatar
Dist.  
XhmikosR committed
4542

XhmikosR's avatar
XhmikosR committed
4543
    if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
XhmikosR's avatar
XhmikosR committed
4544
      SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4545
      link.classList.add(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
4546
4547
    } else {
      // Set triggered link as active
XhmikosR's avatar
XhmikosR committed
4548
4549
      link.classList.add(CLASS_NAME_ACTIVE$2);
      SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP).forEach(function (listGroup) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4550
4551
        // 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
4552
4553
        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
4554
        }); // Handle special case when .nav-link is inside .nav-item
XhmikosR's avatar
Dist.  
XhmikosR committed
4555

XhmikosR's avatar
XhmikosR committed
4556
4557
4558
        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
4559
          });
XhmikosR's avatar
Dist.  
XhmikosR committed
4560
4561
4562
4563
        });
      });
    }

XhmikosR's avatar
XhmikosR committed
4564
    EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4565
4566
      relatedTarget: target
    });
XhmikosR's avatar
XhmikosR committed
4567
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4568

XhmikosR's avatar
XhmikosR committed
4569
  _proto._clear = function _clear() {
XhmikosR's avatar
XhmikosR committed
4570
4571
    SelectorEngine.find(this._selector).filter(function (node) {
      return node.classList.contains(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4572
    }).forEach(function (node) {
XhmikosR's avatar
XhmikosR committed
4573
      return node.classList.remove(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4574
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4575
  } // Static
XhmikosR's avatar
XhmikosR committed
4576
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4577

XhmikosR's avatar
XhmikosR committed
4578
  ScrollSpy.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4579
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4580
      var data = Data.getData(this, DATA_KEY$8);
XhmikosR's avatar
Dist.  
XhmikosR committed
4581

XhmikosR's avatar
XhmikosR committed
4582
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4583
4584
4585
4586
4587
4588
4589

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

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4590
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4591
4592
4593
4594
4595
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4596
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4597

XhmikosR's avatar
XhmikosR committed
4598
  ScrollSpy.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4599
    return Data.getData(element, DATA_KEY$8);
XhmikosR's avatar
XhmikosR committed
4600
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4601

XhmikosR's avatar
XhmikosR committed
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
  _createClass(ScrollSpy, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$8;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$6;
    }
  }]);

  return ScrollSpy;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
4616
4617
4618
4619
4620
4621
4622
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
4623
4624
EventHandler.on(window, EVENT_LOAD_DATA_API$1, function () {
  SelectorEngine.find(SELECTOR_DATA_SPY).forEach(function (spy) {
XhmikosR's avatar
XhmikosR committed
4625
4626
    return new ScrollSpy(spy, Manipulator.getDataAttributes(spy));
  });
XhmikosR's avatar
Dist.  
XhmikosR committed
4627
});
XhmikosR's avatar
XhmikosR committed
4628
var $$9 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4629
4630
4631
4632
4633
4634
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4635
4636
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4637
4638
4639
4640
if ($$9) {
  var JQUERY_NO_CONFLICT$8 = $$9.fn[NAME$8];
  $$9.fn[NAME$8] = ScrollSpy.jQueryInterface;
  $$9.fn[NAME$8].Constructor = ScrollSpy;
XhmikosR's avatar
Dist.  
XhmikosR committed
4641

XhmikosR's avatar
XhmikosR committed
4642
4643
4644
  $$9.fn[NAME$8].noConflict = function () {
    $$9.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
    return ScrollSpy.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4645
4646
4647
4648
4649
4650
4651
4652
4653
  };
}

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

XhmikosR's avatar
XhmikosR committed
4654
4655
4656
4657
4658
var NAME$9 = 'tab';
var VERSION$9 = '4.3.1';
var DATA_KEY$9 = 'bs.tab';
var EVENT_KEY$9 = "." + DATA_KEY$9;
var DATA_API_KEY$7 = '.data-api';
XhmikosR's avatar
XhmikosR committed
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
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';
var CLASS_NAME_DISABLED$2 = 'disabled';
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';
var SELECTOR_ACTIVE$2 = '.active';
var SELECTOR_ACTIVE_UL = ':scope > li > .active';
var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
var SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
XhmikosR's avatar
XhmikosR committed
4676
4677
4678
4679
4680
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4681

XhmikosR's avatar
XhmikosR committed
4682
var Tab = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
4683
  function Tab(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4684
4685
4686
4687
4688
    this._element = element;
    Data.setData(this._element, DATA_KEY$9, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4689
  var _proto = Tab.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4690

XhmikosR's avatar
XhmikosR committed
4691
4692
4693
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4694

XhmikosR's avatar
XhmikosR committed
4695
    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$2)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4696
4697
4698
      return;
    }

XhmikosR's avatar
XhmikosR committed
4699
    var previous;
XhmikosR's avatar
XhmikosR committed
4700
    var target = getElementFromSelector(this._element);
XhmikosR's avatar
XhmikosR committed
4701
4702

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

    if (listElement) {
XhmikosR's avatar
XhmikosR committed
4705
4706
      var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2;
      previous = SelectorEngine.find(itemSelector, listElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
4707
4708
4709
      previous = previous[previous.length - 1];
    }

XhmikosR's avatar
XhmikosR committed
4710
    var hideEvent = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4711
4712

    if (previous) {
XhmikosR's avatar
XhmikosR committed
4713
      hideEvent = EventHandler.trigger(previous, EVENT_HIDE$3, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4714
4715
4716
4717
        relatedTarget: this._element
      });
    }

XhmikosR's avatar
XhmikosR committed
4718
    var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4719
4720
4721
4722
4723
4724
4725
4726
4727
      relatedTarget: previous
    });

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

    this._activate(this._element, listElement);

XhmikosR's avatar
XhmikosR committed
4728
    var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
4729
      EventHandler.trigger(previous, EVENT_HIDDEN$3, {
XhmikosR's avatar
XhmikosR committed
4730
        relatedTarget: _this._element
XhmikosR's avatar
Dist.  
XhmikosR committed
4731
      });
XhmikosR's avatar
XhmikosR committed
4732
      EventHandler.trigger(_this._element, EVENT_SHOWN$3, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4733
4734
4735
4736
4737
4738
4739
4740
4741
        relatedTarget: previous
      });
    };

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

XhmikosR's avatar
XhmikosR committed
4744
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4745
4746
4747
    Data.removeData(this._element, DATA_KEY$9);
    this._element = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4748
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4749

XhmikosR's avatar
XhmikosR committed
4750
4751
  _proto._activate = function _activate(element, container, callback) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4752

XhmikosR's avatar
XhmikosR committed
4753
    var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4754
    var active = activeElements[0];
XhmikosR's avatar
XhmikosR committed
4755
    var isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE$3);
XhmikosR's avatar
Dist.  
XhmikosR committed
4756

XhmikosR's avatar
XhmikosR committed
4757
4758
4759
    var complete = function complete() {
      return _this2._transitionComplete(element, active, callback);
    };
XhmikosR's avatar
Dist.  
XhmikosR committed
4760
4761

    if (active && isTransitioning) {
XhmikosR's avatar
XhmikosR committed
4762
      var transitionDuration = getTransitionDurationFromElement(active);
XhmikosR's avatar
XhmikosR committed
4763
      active.classList.remove(CLASS_NAME_SHOW$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
4764
4765
4766
4767
4768
      EventHandler.one(active, TRANSITION_END, complete);
      emulateTransitionEnd(active, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4769
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4770

XhmikosR's avatar
XhmikosR committed
4771
  _proto._transitionComplete = function _transitionComplete(element, active, callback) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4772
    if (active) {
XhmikosR's avatar
XhmikosR committed
4773
4774
      active.classList.remove(CLASS_NAME_ACTIVE$3);
      var dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
XhmikosR's avatar
Dist.  
XhmikosR committed
4775
4776

      if (dropdownChild) {
XhmikosR's avatar
XhmikosR committed
4777
        dropdownChild.classList.remove(CLASS_NAME_ACTIVE$3);
XhmikosR's avatar
Dist.  
XhmikosR committed
4778
4779
4780
4781
4782
4783
4784
      }

      if (active.getAttribute('role') === 'tab') {
        active.setAttribute('aria-selected', false);
      }
    }

XhmikosR's avatar
XhmikosR committed
4785
    element.classList.add(CLASS_NAME_ACTIVE$3);
XhmikosR's avatar
Dist.  
XhmikosR committed
4786
4787
4788
4789
4790
4791
4792

    if (element.getAttribute('role') === 'tab') {
      element.setAttribute('aria-selected', true);
    }

    reflow(element);

XhmikosR's avatar
XhmikosR committed
4793
4794
    if (element.classList.contains(CLASS_NAME_FADE$3)) {
      element.classList.add(CLASS_NAME_SHOW$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
4795
4796
    }

XhmikosR's avatar
XhmikosR committed
4797
    if (element.parentNode && element.parentNode.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
XhmikosR's avatar
XhmikosR committed
4798
      var dropdownElement = element.closest(SELECTOR_DROPDOWN$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4799
4800

      if (dropdownElement) {
XhmikosR's avatar
XhmikosR committed
4801
4802
        SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE$1).forEach(function (dropdown) {
          return dropdown.classList.add(CLASS_NAME_ACTIVE$3);
XhmikosR's avatar
XhmikosR committed
4803
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4804
4805
4806
4807
4808
4809
4810
4811
4812
      }

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

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

XhmikosR's avatar
XhmikosR committed
4815
  Tab.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4816
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4817
      var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
4818
4819
4820

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4821
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4822
4823
4824
4825
4826
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4827
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4828

XhmikosR's avatar
XhmikosR committed
4829
  Tab.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4830
    return Data.getData(element, DATA_KEY$9);
XhmikosR's avatar
XhmikosR committed
4831
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4832

XhmikosR's avatar
XhmikosR committed
4833
4834
4835
4836
4837
4838
4839
4840
4841
  _createClass(Tab, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$9;
    }
  }]);

  return Tab;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
4842
4843
4844
4845
4846
4847
4848
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
4849
EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4850
  event.preventDefault();
XhmikosR's avatar
XhmikosR committed
4851
  var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
4852
4853
  data.show();
});
XhmikosR's avatar
XhmikosR committed
4854
var $$a = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4855
4856
4857
4858
4859
4860
4861
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tab to jQuery only if jQuery is present
 */

4862
4863
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4864
4865
4866
4867
if ($$a) {
  var JQUERY_NO_CONFLICT$9 = $$a.fn[NAME$9];
  $$a.fn[NAME$9] = Tab.jQueryInterface;
  $$a.fn[NAME$9].Constructor = Tab;
XhmikosR's avatar
Dist.  
XhmikosR committed
4868

XhmikosR's avatar
XhmikosR committed
4869
4870
4871
  $$a.fn[NAME$9].noConflict = function () {
    $$a.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
    return Tab.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4872
4873
4874
4875
4876
4877
4878
4879
4880
  };
}

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

XhmikosR's avatar
XhmikosR committed
4881
4882
4883
4884
var NAME$a = 'toast';
var VERSION$a = '4.3.1';
var DATA_KEY$a = 'bs.toast';
var EVENT_KEY$a = "." + DATA_KEY$a;
XhmikosR's avatar
XhmikosR committed
4885
4886
4887
4888
4889
4890
4891
4892
4893
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
XhmikosR committed
4894
var DefaultType$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4895
4896
4897
4898
  animation: 'boolean',
  autohide: 'boolean',
  delay: 'number'
};
XhmikosR's avatar
XhmikosR committed
4899
var Default$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4900
4901
4902
4903
  animation: true,
  autohide: true,
  delay: 500
};
XhmikosR's avatar
XhmikosR committed
4904
var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]';
XhmikosR's avatar
XhmikosR committed
4905
4906
4907
4908
4909
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4910

XhmikosR's avatar
XhmikosR committed
4911
var Toast = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
4912
  function Toast(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
    this._element = element;
    this._config = this._getConfig(config);
    this._timeout = null;

    this._setListeners();

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


XhmikosR's avatar
XhmikosR committed
4923
  var _proto = Toast.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4924

XhmikosR's avatar
XhmikosR committed
4925
4926
4927
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4928

XhmikosR's avatar
XhmikosR committed
4929
    var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4);
Mark Otto's avatar
dist v5    
Mark Otto committed
4930
4931
4932
4933

    if (showEvent.defaultPrevented) {
      return;
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
4934
4935

    if (this._config.animation) {
XhmikosR's avatar
XhmikosR committed
4936
      this._element.classList.add(CLASS_NAME_FADE$4);
XhmikosR's avatar
Dist.  
XhmikosR committed
4937
4938
    }

XhmikosR's avatar
XhmikosR committed
4939
    var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
4940
      _this._element.classList.remove(CLASS_NAME_SHOWING);
XhmikosR's avatar
Dist.  
XhmikosR committed
4941

XhmikosR's avatar
XhmikosR committed
4942
      _this._element.classList.add(CLASS_NAME_SHOW$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
4943

XhmikosR's avatar
XhmikosR committed
4944
      EventHandler.trigger(_this._element, EVENT_SHOWN$4);
XhmikosR's avatar
Dist.  
XhmikosR committed
4945

XhmikosR's avatar
XhmikosR committed
4946
4947
4948
4949
      if (_this._config.autohide) {
        _this._timeout = setTimeout(function () {
          _this.hide();
        }, _this._config.delay);
XhmikosR's avatar
Dist.  
XhmikosR committed
4950
4951
4952
      }
    };

XhmikosR's avatar
XhmikosR committed
4953
    this._element.classList.remove(CLASS_NAME_HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
4954

4955
4956
    reflow(this._element);

XhmikosR's avatar
XhmikosR committed
4957
    this._element.classList.add(CLASS_NAME_SHOWING);
XhmikosR's avatar
Dist.  
XhmikosR committed
4958
4959

    if (this._config.animation) {
XhmikosR's avatar
XhmikosR committed
4960
      var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
4961
4962
4963
4964
4965
      EventHandler.one(this._element, TRANSITION_END, complete);
      emulateTransitionEnd(this._element, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4966
4967
4968
4969
  };

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

XhmikosR's avatar
XhmikosR committed
4971
    if (!this._element.classList.contains(CLASS_NAME_SHOW$6)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4972
4973
4974
      return;
    }

XhmikosR's avatar
XhmikosR committed
4975
    var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);
Mark Otto's avatar
dist v5    
Mark Otto committed
4976
4977
4978
4979

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

XhmikosR's avatar
XhmikosR committed
4981
    var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
4982
      _this2._element.classList.add(CLASS_NAME_HIDE);
XhmikosR's avatar
XhmikosR committed
4983

XhmikosR's avatar
XhmikosR committed
4984
      EventHandler.trigger(_this2._element, EVENT_HIDDEN$4);
XhmikosR's avatar
XhmikosR committed
4985
4986
    };

XhmikosR's avatar
XhmikosR committed
4987
    this._element.classList.remove(CLASS_NAME_SHOW$6);
XhmikosR's avatar
XhmikosR committed
4988
4989
4990
4991
4992

    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
4993
    } else {
XhmikosR's avatar
XhmikosR committed
4994
      complete();
XhmikosR's avatar
Dist.  
XhmikosR committed
4995
    }
XhmikosR's avatar
XhmikosR committed
4996
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4997

XhmikosR's avatar
XhmikosR committed
4998
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4999
5000
    clearTimeout(this._timeout);
    this._timeout = null;
For faster browsing, not all history is shown. View entire blame