bootstrap 4.6.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/README.md +7 -4
  4. data/assets/javascripts/bootstrap/alert.js +181 -109
  5. data/assets/javascripts/bootstrap/base-component.js +63 -0
  6. data/assets/javascripts/bootstrap/button.js +85 -173
  7. data/assets/javascripts/bootstrap/carousel.js +458 -355
  8. data/assets/javascripts/bootstrap/collapse.js +366 -218
  9. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  10. data/assets/javascripts/bootstrap/dom/event-handler.js +322 -0
  11. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  12. data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
  13. data/assets/javascripts/bootstrap/dropdown.js +459 -351
  14. data/assets/javascripts/bootstrap/modal.js +597 -429
  15. data/assets/javascripts/bootstrap/offcanvas.js +671 -0
  16. data/assets/javascripts/bootstrap/popover.js +130 -154
  17. data/assets/javascripts/bootstrap/scrollspy.js +238 -188
  18. data/assets/javascripts/bootstrap/tab.js +235 -137
  19. data/assets/javascripts/bootstrap/toast.js +210 -148
  20. data/assets/javascripts/bootstrap/tooltip.js +627 -466
  21. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  22. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  23. data/assets/javascripts/bootstrap-sprockets.js +15 -8
  24. data/assets/javascripts/bootstrap.js +3174 -2563
  25. data/assets/javascripts/bootstrap.min.js +2 -2
  26. data/assets/stylesheets/_bootstrap-grid.scss +51 -16
  27. data/assets/stylesheets/_bootstrap-reboot.scss +4 -1
  28. data/assets/stylesheets/_bootstrap.scss +16 -8
  29. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  30. data/assets/stylesheets/bootstrap/_alert.scss +15 -10
  31. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  32. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -17
  33. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  34. data/assets/stylesheets/bootstrap/_buttons.scss +29 -60
  35. data/assets/stylesheets/bootstrap/_card.scss +20 -91
  36. data/assets/stylesheets/bootstrap/_carousel.scss +65 -33
  37. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  38. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  39. data/assets/stylesheets/bootstrap/_dropdown.scss +84 -36
  40. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  41. data/assets/stylesheets/bootstrap/_functions.scss +84 -23
  42. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  43. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  44. data/assets/stylesheets/bootstrap/_list-group.scss +28 -8
  45. data/assets/stylesheets/bootstrap/_mixins.scss +8 -13
  46. data/assets/stylesheets/bootstrap/_modal.scss +43 -55
  47. data/assets/stylesheets/bootstrap/_nav.scss +23 -4
  48. data/assets/stylesheets/bootstrap/_navbar.scss +45 -71
  49. data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
  50. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  51. data/assets/stylesheets/bootstrap/_popover.scss +15 -27
  52. data/assets/stylesheets/bootstrap/_progress.scss +5 -4
  53. data/assets/stylesheets/bootstrap/_reboot.scss +316 -179
  54. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  55. data/assets/stylesheets/bootstrap/_spinners.scss +11 -7
  56. data/assets/stylesheets/bootstrap/_tables.scss +79 -114
  57. data/assets/stylesheets/bootstrap/_toasts.scss +20 -15
  58. data/assets/stylesheets/bootstrap/_tooltip.scss +17 -17
  59. data/assets/stylesheets/bootstrap/_transitions.scss +2 -1
  60. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  61. data/assets/stylesheets/bootstrap/_utilities.scss +594 -18
  62. data/assets/stylesheets/bootstrap/_variables.scss +800 -482
  63. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  64. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  65. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  70. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  71. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  72. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  73. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  74. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  75. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  76. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  77. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  78. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  79. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  80. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
  81. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  82. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  83. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +71 -48
  84. data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
  85. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  86. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  87. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  88. data/assets/stylesheets/bootstrap/mixins/_forms.scss +38 -86
  89. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  90. data/assets/stylesheets/bootstrap/mixins/_grid.scss +89 -33
  91. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  92. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  93. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  94. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
  95. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  96. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  97. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  98. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  99. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  100. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  101. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  102. data/bootstrap.gemspec +1 -3
  103. data/lib/bootstrap/version.rb +2 -2
  104. data/tasks/updater/js.rb +20 -5
  105. data/tasks/updater/network.rb +7 -1
  106. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  107. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  108. data/test/dummy_rails/app/views/pages/root.html +89 -0
  109. data/test/dummy_rails/config/application.rb +0 -3
  110. data/test/gemfiles/rails_6_1.gemfile +7 -0
  111. metadata +45 -73
  112. data/assets/javascripts/bootstrap/util.js +0 -192
  113. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  114. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  115. data/assets/stylesheets/bootstrap/_input-group.scss +0 -208
  116. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  117. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  118. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  119. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  120. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  121. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  122. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  123. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  124. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  125. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  126. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  127. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  128. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  129. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  130. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  131. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  132. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  133. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  134. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  135. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  136. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  137. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  138. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  139. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  140. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  141. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  142. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  143. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  144. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  145. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  146. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  147. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  148. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  149. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -1,63 +1,245 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v4.6.0 (https://getbootstrap.com/)
2
+ * Bootstrap tooltip.js v5.0.0 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
8
- typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
10
- }(this, (function ($, Popper, Util) { 'use strict';
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
8
+ typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
10
+ }(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13
 
14
- var $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
- var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
16
- var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
17
-
18
- function _defineProperties(target, props) {
19
- for (var i = 0; i < props.length; i++) {
20
- var descriptor = props[i];
21
- descriptor.enumerable = descriptor.enumerable || false;
22
- descriptor.configurable = true;
23
- if ("value" in descriptor) descriptor.writable = true;
24
- Object.defineProperty(target, descriptor.key, descriptor);
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () {
24
+ return e[k];
25
+ }
26
+ });
27
+ }
28
+ });
25
29
  }
30
+ n['default'] = e;
31
+ return Object.freeze(n);
26
32
  }
27
33
 
28
- function _createClass(Constructor, protoProps, staticProps) {
29
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
30
- if (staticProps) _defineProperties(Constructor, staticProps);
31
- return Constructor;
32
- }
34
+ var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
35
+ var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
36
+ var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
37
+ var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
38
+ var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
39
+ var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
33
40
 
34
- function _extends() {
35
- _extends = Object.assign || function (target) {
36
- for (var i = 1; i < arguments.length; i++) {
37
- var source = arguments[i];
41
+ /**
42
+ * --------------------------------------------------------------------------
43
+ * Bootstrap (v5.0.0): util/index.js
44
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
45
+ * --------------------------------------------------------------------------
46
+ */
47
+ const MAX_UID = 1000000;
48
+ const MILLISECONDS_MULTIPLIER = 1000;
49
+ const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
38
50
 
39
- for (var key in source) {
40
- if (Object.prototype.hasOwnProperty.call(source, key)) {
41
- target[key] = source[key];
42
- }
43
- }
51
+ const toType = obj => {
52
+ if (obj === null || obj === undefined) {
53
+ return `${obj}`;
54
+ }
55
+
56
+ return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
57
+ };
58
+ /**
59
+ * --------------------------------------------------------------------------
60
+ * Public Util Api
61
+ * --------------------------------------------------------------------------
62
+ */
63
+
64
+
65
+ const getUID = prefix => {
66
+ do {
67
+ prefix += Math.floor(Math.random() * MAX_UID);
68
+ } while (document.getElementById(prefix));
69
+
70
+ return prefix;
71
+ };
72
+
73
+ const getTransitionDurationFromElement = element => {
74
+ if (!element) {
75
+ return 0;
76
+ } // Get transition-duration of the element
77
+
78
+
79
+ let {
80
+ transitionDuration,
81
+ transitionDelay
82
+ } = window.getComputedStyle(element);
83
+ const floatTransitionDuration = Number.parseFloat(transitionDuration);
84
+ const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
85
+
86
+ if (!floatTransitionDuration && !floatTransitionDelay) {
87
+ return 0;
88
+ } // If multiple durations are defined, take the first
89
+
90
+
91
+ transitionDuration = transitionDuration.split(',')[0];
92
+ transitionDelay = transitionDelay.split(',')[0];
93
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
94
+ };
95
+
96
+ const triggerTransitionEnd = element => {
97
+ element.dispatchEvent(new Event(TRANSITION_END));
98
+ };
99
+
100
+ const isElement = obj => (obj[0] || obj).nodeType;
101
+
102
+ const emulateTransitionEnd = (element, duration) => {
103
+ let called = false;
104
+ const durationPadding = 5;
105
+ const emulatedDuration = duration + durationPadding;
106
+
107
+ function listener() {
108
+ called = true;
109
+ element.removeEventListener(TRANSITION_END, listener);
110
+ }
111
+
112
+ element.addEventListener(TRANSITION_END, listener);
113
+ setTimeout(() => {
114
+ if (!called) {
115
+ triggerTransitionEnd(element);
44
116
  }
117
+ }, emulatedDuration);
118
+ };
45
119
 
46
- return target;
47
- };
120
+ const typeCheckConfig = (componentName, config, configTypes) => {
121
+ Object.keys(configTypes).forEach(property => {
122
+ const expectedTypes = configTypes[property];
123
+ const value = config[property];
124
+ const valueType = value && isElement(value) ? 'element' : toType(value);
48
125
 
49
- return _extends.apply(this, arguments);
50
- }
126
+ if (!new RegExp(expectedTypes).test(valueType)) {
127
+ throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
128
+ }
129
+ });
130
+ };
131
+
132
+ const findShadowRoot = element => {
133
+ if (!document.documentElement.attachShadow) {
134
+ return null;
135
+ } // Can find the shadow root otherwise it'll return the document
136
+
137
+
138
+ if (typeof element.getRootNode === 'function') {
139
+ const root = element.getRootNode();
140
+ return root instanceof ShadowRoot ? root : null;
141
+ }
142
+
143
+ if (element instanceof ShadowRoot) {
144
+ return element;
145
+ } // when we don't find a shadow root
146
+
147
+
148
+ if (!element.parentNode) {
149
+ return null;
150
+ }
151
+
152
+ return findShadowRoot(element.parentNode);
153
+ };
154
+
155
+ const noop = () => {};
156
+
157
+ const getjQuery = () => {
158
+ const {
159
+ jQuery
160
+ } = window;
161
+
162
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
163
+ return jQuery;
164
+ }
165
+
166
+ return null;
167
+ };
168
+
169
+ const onDOMContentLoaded = callback => {
170
+ if (document.readyState === 'loading') {
171
+ document.addEventListener('DOMContentLoaded', callback);
172
+ } else {
173
+ callback();
174
+ }
175
+ };
176
+
177
+ const isRTL = () => document.documentElement.dir === 'rtl';
178
+
179
+ const defineJQueryPlugin = (name, plugin) => {
180
+ onDOMContentLoaded(() => {
181
+ const $ = getjQuery();
182
+ /* istanbul ignore if */
183
+
184
+ if ($) {
185
+ const JQUERY_NO_CONFLICT = $.fn[name];
186
+ $.fn[name] = plugin.jQueryInterface;
187
+ $.fn[name].Constructor = plugin;
188
+
189
+ $.fn[name].noConflict = () => {
190
+ $.fn[name] = JQUERY_NO_CONFLICT;
191
+ return plugin.jQueryInterface;
192
+ };
193
+ }
194
+ });
195
+ };
51
196
 
52
197
  /**
53
198
  * --------------------------------------------------------------------------
54
- * Bootstrap (v4.6.0): tools/sanitizer.js
199
+ * Bootstrap (v5.0.0): util/sanitizer.js
55
200
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
56
201
  * --------------------------------------------------------------------------
57
202
  */
58
- var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
59
- var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
60
- var DefaultWhitelist = {
203
+ const uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
204
+ const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
205
+ /**
206
+ * A pattern that recognizes a commonly useful subset of URLs that are safe.
207
+ *
208
+ * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
209
+ */
210
+
211
+ const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
212
+ /**
213
+ * A pattern that matches safe data URLs. Only matches image, video and audio types.
214
+ *
215
+ * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
216
+ */
217
+
218
+ const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
219
+
220
+ const allowedAttribute = (attr, allowedAttributeList) => {
221
+ const attrName = attr.nodeName.toLowerCase();
222
+
223
+ if (allowedAttributeList.includes(attrName)) {
224
+ if (uriAttrs.has(attrName)) {
225
+ return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
226
+ }
227
+
228
+ return true;
229
+ }
230
+
231
+ const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp); // Check if a regular expression validates the attribute.
232
+
233
+ for (let i = 0, len = regExp.length; i < len; i++) {
234
+ if (regExp[i].test(attrName)) {
235
+ return true;
236
+ }
237
+ }
238
+
239
+ return false;
240
+ };
241
+
242
+ const DefaultAllowlist = {
61
243
  // Global attributes allowed on any supplied element below.
62
244
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
63
245
  a: ['target', 'href', 'title', 'rel'],
@@ -90,47 +272,8 @@
90
272
  u: [],
91
273
  ul: []
92
274
  };
93
- /**
94
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
95
- *
96
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
97
- */
98
-
99
- var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
100
- /**
101
- * A pattern that matches safe data URLs. Only matches image, video and audio types.
102
- *
103
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
104
- */
105
-
106
- var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
107
-
108
- function allowedAttribute(attr, allowedAttributeList) {
109
- var attrName = attr.nodeName.toLowerCase();
110
-
111
- if (allowedAttributeList.indexOf(attrName) !== -1) {
112
- if (uriAttrs.indexOf(attrName) !== -1) {
113
- return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
114
- }
115
-
116
- return true;
117
- }
118
-
119
- var regExp = allowedAttributeList.filter(function (attrRegex) {
120
- return attrRegex instanceof RegExp;
121
- }); // Check if a regular expression validates the attribute.
122
-
123
- for (var i = 0, len = regExp.length; i < len; i++) {
124
- if (attrName.match(regExp[i])) {
125
- return true;
126
- }
127
- }
128
-
129
- return false;
130
- }
131
-
132
- function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
133
- if (unsafeHtml.length === 0) {
275
+ function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
276
+ if (!unsafeHtml.length) {
134
277
  return unsafeHtml;
135
278
  }
136
279
 
@@ -138,53 +281,51 @@
138
281
  return sanitizeFn(unsafeHtml);
139
282
  }
140
283
 
141
- var domParser = new window.DOMParser();
142
- var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
143
- var whitelistKeys = Object.keys(whiteList);
144
- var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
284
+ const domParser = new window.DOMParser();
285
+ const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
286
+ const allowlistKeys = Object.keys(allowList);
287
+ const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
145
288
 
146
- var _loop = function _loop(i, len) {
147
- var el = elements[i];
148
- var elName = el.nodeName.toLowerCase();
289
+ for (let i = 0, len = elements.length; i < len; i++) {
290
+ const el = elements[i];
291
+ const elName = el.nodeName.toLowerCase();
149
292
 
150
- if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
293
+ if (!allowlistKeys.includes(elName)) {
151
294
  el.parentNode.removeChild(el);
152
- return "continue";
295
+ continue;
153
296
  }
154
297
 
155
- var attributeList = [].slice.call(el.attributes);
156
- var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
157
- attributeList.forEach(function (attr) {
158
- if (!allowedAttribute(attr, whitelistedAttributes)) {
298
+ const attributeList = [].concat(...el.attributes);
299
+ const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
300
+ attributeList.forEach(attr => {
301
+ if (!allowedAttribute(attr, allowedAttributes)) {
159
302
  el.removeAttribute(attr.nodeName);
160
303
  }
161
304
  });
162
- };
163
-
164
- for (var i = 0, len = elements.length; i < len; i++) {
165
- var _ret = _loop(i);
166
-
167
- if (_ret === "continue") continue;
168
305
  }
169
306
 
170
307
  return createdDocument.body.innerHTML;
171
308
  }
172
309
 
310
+ /**
311
+ * --------------------------------------------------------------------------
312
+ * Bootstrap (v5.0.0): tooltip.js
313
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
314
+ * --------------------------------------------------------------------------
315
+ */
173
316
  /**
174
317
  * ------------------------------------------------------------------------
175
318
  * Constants
176
319
  * ------------------------------------------------------------------------
177
320
  */
178
321
 
179
- var NAME = 'tooltip';
180
- var VERSION = '4.6.0';
181
- var DATA_KEY = 'bs.tooltip';
182
- var EVENT_KEY = "." + DATA_KEY;
183
- var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
184
- var CLASS_PREFIX = 'bs-tooltip';
185
- var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
186
- var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
187
- var DefaultType = {
322
+ const NAME = 'tooltip';
323
+ const DATA_KEY = 'bs.tooltip';
324
+ const EVENT_KEY = `.${DATA_KEY}`;
325
+ const CLASS_PREFIX = 'bs-tooltip';
326
+ const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
327
+ const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
328
+ const DefaultType = {
188
329
  animation: 'boolean',
189
330
  template: 'string',
190
331
  title: '(string|element|function)',
@@ -193,76 +334,77 @@
193
334
  html: 'boolean',
194
335
  selector: '(string|boolean)',
195
336
  placement: '(string|function)',
196
- offset: '(number|string|function)',
337
+ offset: '(array|string|function)',
197
338
  container: '(string|element|boolean)',
198
- fallbackPlacement: '(string|array)',
339
+ fallbackPlacements: 'array',
199
340
  boundary: '(string|element)',
200
341
  customClass: '(string|function)',
201
342
  sanitize: 'boolean',
202
343
  sanitizeFn: '(null|function)',
203
- whiteList: 'object',
204
- popperConfig: '(null|object)'
344
+ allowList: 'object',
345
+ popperConfig: '(null|object|function)'
205
346
  };
206
- var AttachmentMap = {
347
+ const AttachmentMap = {
207
348
  AUTO: 'auto',
208
349
  TOP: 'top',
209
- RIGHT: 'right',
350
+ RIGHT: isRTL() ? 'left' : 'right',
210
351
  BOTTOM: 'bottom',
211
- LEFT: 'left'
352
+ LEFT: isRTL() ? 'right' : 'left'
212
353
  };
213
- var Default = {
354
+ const Default = {
214
355
  animation: true,
215
- template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
356
+ template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
216
357
  trigger: 'hover focus',
217
358
  title: '',
218
359
  delay: 0,
219
360
  html: false,
220
361
  selector: false,
221
362
  placement: 'top',
222
- offset: 0,
363
+ offset: [0, 0],
223
364
  container: false,
224
- fallbackPlacement: 'flip',
225
- boundary: 'scrollParent',
365
+ fallbackPlacements: ['top', 'right', 'bottom', 'left'],
366
+ boundary: 'clippingParents',
226
367
  customClass: '',
227
368
  sanitize: true,
228
369
  sanitizeFn: null,
229
- whiteList: DefaultWhitelist,
370
+ allowList: DefaultAllowlist,
230
371
  popperConfig: null
231
372
  };
232
- var HOVER_STATE_SHOW = 'show';
233
- var HOVER_STATE_OUT = 'out';
234
- var Event = {
235
- HIDE: "hide" + EVENT_KEY,
236
- HIDDEN: "hidden" + EVENT_KEY,
237
- SHOW: "show" + EVENT_KEY,
238
- SHOWN: "shown" + EVENT_KEY,
239
- INSERTED: "inserted" + EVENT_KEY,
240
- CLICK: "click" + EVENT_KEY,
241
- FOCUSIN: "focusin" + EVENT_KEY,
242
- FOCUSOUT: "focusout" + EVENT_KEY,
243
- MOUSEENTER: "mouseenter" + EVENT_KEY,
244
- MOUSELEAVE: "mouseleave" + EVENT_KEY
373
+ const Event$1 = {
374
+ HIDE: `hide${EVENT_KEY}`,
375
+ HIDDEN: `hidden${EVENT_KEY}`,
376
+ SHOW: `show${EVENT_KEY}`,
377
+ SHOWN: `shown${EVENT_KEY}`,
378
+ INSERTED: `inserted${EVENT_KEY}`,
379
+ CLICK: `click${EVENT_KEY}`,
380
+ FOCUSIN: `focusin${EVENT_KEY}`,
381
+ FOCUSOUT: `focusout${EVENT_KEY}`,
382
+ MOUSEENTER: `mouseenter${EVENT_KEY}`,
383
+ MOUSELEAVE: `mouseleave${EVENT_KEY}`
245
384
  };
246
- var CLASS_NAME_FADE = 'fade';
247
- var CLASS_NAME_SHOW = 'show';
248
- var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
249
- var SELECTOR_ARROW = '.arrow';
250
- var TRIGGER_HOVER = 'hover';
251
- var TRIGGER_FOCUS = 'focus';
252
- var TRIGGER_CLICK = 'click';
253
- var TRIGGER_MANUAL = 'manual';
385
+ const CLASS_NAME_FADE = 'fade';
386
+ const CLASS_NAME_MODAL = 'modal';
387
+ const CLASS_NAME_SHOW = 'show';
388
+ const HOVER_STATE_SHOW = 'show';
389
+ const HOVER_STATE_OUT = 'out';
390
+ const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
391
+ const TRIGGER_HOVER = 'hover';
392
+ const TRIGGER_FOCUS = 'focus';
393
+ const TRIGGER_CLICK = 'click';
394
+ const TRIGGER_MANUAL = 'manual';
254
395
  /**
255
396
  * ------------------------------------------------------------------------
256
397
  * Class Definition
257
398
  * ------------------------------------------------------------------------
258
399
  */
259
400
 
260
- var Tooltip = /*#__PURE__*/function () {
261
- function Tooltip(element, config) {
262
- if (typeof Popper__default['default'] === 'undefined') {
401
+ class Tooltip extends BaseComponent__default['default'] {
402
+ constructor(element, config) {
403
+ if (typeof Popper__namespace === 'undefined') {
263
404
  throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
264
- } // private
405
+ }
265
406
 
407
+ super(element); // private
266
408
 
267
409
  this._isEnabled = true;
268
410
  this._timeout = 0;
@@ -270,7 +412,6 @@
270
412
  this._activeTrigger = {};
271
413
  this._popper = null; // Protected
272
414
 
273
- this.element = element;
274
415
  this.config = this._getConfig(config);
275
416
  this.tip = null;
276
417
 
@@ -278,34 +419,50 @@
278
419
  } // Getters
279
420
 
280
421
 
281
- var _proto = Tooltip.prototype;
422
+ static get Default() {
423
+ return Default;
424
+ }
425
+
426
+ static get NAME() {
427
+ return NAME;
428
+ }
429
+
430
+ static get DATA_KEY() {
431
+ return DATA_KEY;
432
+ }
433
+
434
+ static get Event() {
435
+ return Event$1;
436
+ }
282
437
 
283
- // Public
284
- _proto.enable = function enable() {
438
+ static get EVENT_KEY() {
439
+ return EVENT_KEY;
440
+ }
441
+
442
+ static get DefaultType() {
443
+ return DefaultType;
444
+ } // Public
445
+
446
+
447
+ enable() {
285
448
  this._isEnabled = true;
286
- };
449
+ }
287
450
 
288
- _proto.disable = function disable() {
451
+ disable() {
289
452
  this._isEnabled = false;
290
- };
453
+ }
291
454
 
292
- _proto.toggleEnabled = function toggleEnabled() {
455
+ toggleEnabled() {
293
456
  this._isEnabled = !this._isEnabled;
294
- };
457
+ }
295
458
 
296
- _proto.toggle = function toggle(event) {
459
+ toggle(event) {
297
460
  if (!this._isEnabled) {
298
461
  return;
299
462
  }
300
463
 
301
464
  if (event) {
302
- var dataKey = this.constructor.DATA_KEY;
303
- var context = $__default['default'](event.currentTarget).data(dataKey);
304
-
305
- if (!context) {
306
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
307
- $__default['default'](event.currentTarget).data(dataKey, context);
308
- }
465
+ const context = this._initializeOnDelegatedTarget(event);
309
466
 
310
467
  context._activeTrigger.click = !context._activeTrigger.click;
311
468
 
@@ -315,7 +472,7 @@
315
472
  context._leave(null, context);
316
473
  }
317
474
  } else {
318
- if ($__default['default'](this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
475
+ if (this.getTipElement().classList.contains(CLASS_NAME_SHOW)) {
319
476
  this._leave(null, this);
320
477
 
321
478
  return;
@@ -323,16 +480,14 @@
323
480
 
324
481
  this._enter(null, this);
325
482
  }
326
- };
483
+ }
327
484
 
328
- _proto.dispose = function dispose() {
485
+ dispose() {
329
486
  clearTimeout(this._timeout);
330
- $__default['default'].removeData(this.element, this.constructor.DATA_KEY);
331
- $__default['default'](this.element).off(this.constructor.EVENT_KEY);
332
- $__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
487
+ EventHandler__default['default'].off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
333
488
 
334
- if (this.tip) {
335
- $__default['default'](this.tip).remove();
489
+ if (this.tip && this.tip.parentNode) {
490
+ this.tip.parentNode.removeChild(this.tip);
336
491
  }
337
492
 
338
493
  this._isEnabled = null;
@@ -345,176 +500,200 @@
345
500
  }
346
501
 
347
502
  this._popper = null;
348
- this.element = null;
349
503
  this.config = null;
350
504
  this.tip = null;
351
- };
352
-
353
- _proto.show = function show() {
354
- var _this = this;
505
+ super.dispose();
506
+ }
355
507
 
356
- if ($__default['default'](this.element).css('display') === 'none') {
508
+ show() {
509
+ if (this._element.style.display === 'none') {
357
510
  throw new Error('Please use show on visible elements');
358
511
  }
359
512
 
360
- var showEvent = $__default['default'].Event(this.constructor.Event.SHOW);
513
+ if (!(this.isWithContent() && this._isEnabled)) {
514
+ return;
515
+ }
361
516
 
362
- if (this.isWithContent() && this._isEnabled) {
363
- $__default['default'](this.element).trigger(showEvent);
364
- var shadowRoot = Util__default['default'].findShadowRoot(this.element);
365
- var isInTheDom = $__default['default'].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
517
+ const showEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOW);
518
+ const shadowRoot = findShadowRoot(this._element);
519
+ const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
366
520
 
367
- if (showEvent.isDefaultPrevented() || !isInTheDom) {
368
- return;
369
- }
521
+ if (showEvent.defaultPrevented || !isInTheDom) {
522
+ return;
523
+ }
370
524
 
371
- var tip = this.getTipElement();
372
- var tipId = Util__default['default'].getUID(this.constructor.NAME);
373
- tip.setAttribute('id', tipId);
374
- this.element.setAttribute('aria-describedby', tipId);
375
- this.setContent();
525
+ const tip = this.getTipElement();
526
+ const tipId = getUID(this.constructor.NAME);
527
+ tip.setAttribute('id', tipId);
376
528
 
377
- if (this.config.animation) {
378
- $__default['default'](tip).addClass(CLASS_NAME_FADE);
379
- }
529
+ this._element.setAttribute('aria-describedby', tipId);
380
530
 
381
- var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
531
+ this.setContent();
382
532
 
383
- var attachment = this._getAttachment(placement);
533
+ if (this.config.animation) {
534
+ tip.classList.add(CLASS_NAME_FADE);
535
+ }
384
536
 
385
- this.addAttachmentClass(attachment);
537
+ const placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
386
538
 
387
- var container = this._getContainer();
539
+ const attachment = this._getAttachment(placement);
388
540
 
389
- $__default['default'](tip).data(this.constructor.DATA_KEY, this);
541
+ this._addAttachmentClass(attachment);
390
542
 
391
- if (!$__default['default'].contains(this.element.ownerDocument.documentElement, this.tip)) {
392
- $__default['default'](tip).appendTo(container);
393
- }
543
+ const container = this._getContainer();
394
544
 
395
- $__default['default'](this.element).trigger(this.constructor.Event.INSERTED);
396
- this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
397
- $__default['default'](tip).addClass(CLASS_NAME_SHOW);
398
- $__default['default'](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra
399
- // empty mouseover listeners to the body's immediate children;
400
- // only needed because of broken event delegation on iOS
401
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
545
+ Data__default['default'].set(tip, this.constructor.DATA_KEY, this);
402
546
 
403
- if ('ontouchstart' in document.documentElement) {
404
- $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
405
- }
547
+ if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
548
+ container.appendChild(tip);
549
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.INSERTED);
550
+ }
406
551
 
407
- var complete = function complete() {
408
- if (_this.config.animation) {
409
- _this._fixTransition();
410
- }
552
+ if (this._popper) {
553
+ this._popper.update();
554
+ } else {
555
+ this._popper = Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment));
556
+ }
411
557
 
412
- var prevHoverState = _this._hoverState;
413
- _this._hoverState = null;
414
- $__default['default'](_this.element).trigger(_this.constructor.Event.SHOWN);
558
+ tip.classList.add(CLASS_NAME_SHOW);
559
+ const customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
415
560
 
416
- if (prevHoverState === HOVER_STATE_OUT) {
417
- _this._leave(null, _this);
418
- }
419
- };
561
+ if (customClass) {
562
+ tip.classList.add(...customClass.split(' '));
563
+ } // If this is a touch-enabled device we add extra
564
+ // empty mouseover listeners to the body's immediate children;
565
+ // only needed because of broken event delegation on iOS
566
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
420
567
 
421
- if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE)) {
422
- var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this.tip);
423
- $__default['default'](this.tip).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
424
- } else {
425
- complete();
568
+
569
+ if ('ontouchstart' in document.documentElement) {
570
+ [].concat(...document.body.children).forEach(element => {
571
+ EventHandler__default['default'].on(element, 'mouseover', noop);
572
+ });
573
+ }
574
+
575
+ const complete = () => {
576
+ const prevHoverState = this._hoverState;
577
+ this._hoverState = null;
578
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOWN);
579
+
580
+ if (prevHoverState === HOVER_STATE_OUT) {
581
+ this._leave(null, this);
426
582
  }
583
+ };
584
+
585
+ if (this.tip.classList.contains(CLASS_NAME_FADE)) {
586
+ const transitionDuration = getTransitionDurationFromElement(this.tip);
587
+ EventHandler__default['default'].one(this.tip, 'transitionend', complete);
588
+ emulateTransitionEnd(this.tip, transitionDuration);
589
+ } else {
590
+ complete();
427
591
  }
428
- };
592
+ }
429
593
 
430
- _proto.hide = function hide(callback) {
431
- var _this2 = this;
594
+ hide() {
595
+ if (!this._popper) {
596
+ return;
597
+ }
432
598
 
433
- var tip = this.getTipElement();
434
- var hideEvent = $__default['default'].Event(this.constructor.Event.HIDE);
599
+ const tip = this.getTipElement();
600
+
601
+ const complete = () => {
602
+ if (this._isWithActiveTrigger()) {
603
+ return;
604
+ }
435
605
 
436
- var complete = function complete() {
437
- if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
606
+ if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
438
607
  tip.parentNode.removeChild(tip);
439
608
  }
440
609
 
441
- _this2._cleanTipClass();
610
+ this._cleanTipClass();
442
611
 
443
- _this2.element.removeAttribute('aria-describedby');
612
+ this._element.removeAttribute('aria-describedby');
444
613
 
445
- $__default['default'](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
614
+ EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDDEN);
446
615
 
447
- if (_this2._popper !== null) {
448
- _this2._popper.destroy();
449
- }
616
+ if (this._popper) {
617
+ this._popper.destroy();
450
618
 
451
- if (callback) {
452
- callback();
619
+ this._popper = null;
453
620
  }
454
621
  };
455
622
 
456
- $__default['default'](this.element).trigger(hideEvent);
623
+ const hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
457
624
 
458
- if (hideEvent.isDefaultPrevented()) {
625
+ if (hideEvent.defaultPrevented) {
459
626
  return;
460
627
  }
461
628
 
462
- $__default['default'](tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
629
+ tip.classList.remove(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
463
630
  // empty mouseover listeners we added for iOS support
464
631
 
465
632
  if ('ontouchstart' in document.documentElement) {
466
- $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
633
+ [].concat(...document.body.children).forEach(element => EventHandler__default['default'].off(element, 'mouseover', noop));
467
634
  }
468
635
 
469
636
  this._activeTrigger[TRIGGER_CLICK] = false;
470
637
  this._activeTrigger[TRIGGER_FOCUS] = false;
471
638
  this._activeTrigger[TRIGGER_HOVER] = false;
472
639
 
473
- if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE)) {
474
- var transitionDuration = Util__default['default'].getTransitionDurationFromElement(tip);
475
- $__default['default'](tip).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
640
+ if (this.tip.classList.contains(CLASS_NAME_FADE)) {
641
+ const transitionDuration = getTransitionDurationFromElement(tip);
642
+ EventHandler__default['default'].one(tip, 'transitionend', complete);
643
+ emulateTransitionEnd(tip, transitionDuration);
476
644
  } else {
477
645
  complete();
478
646
  }
479
647
 
480
648
  this._hoverState = '';
481
- };
649
+ }
482
650
 
483
- _proto.update = function update() {
651
+ update() {
484
652
  if (this._popper !== null) {
485
- this._popper.scheduleUpdate();
653
+ this._popper.update();
486
654
  }
487
655
  } // Protected
488
- ;
489
656
 
490
- _proto.isWithContent = function isWithContent() {
657
+
658
+ isWithContent() {
491
659
  return Boolean(this.getTitle());
492
- };
660
+ }
493
661
 
494
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
495
- $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
496
- };
662
+ getTipElement() {
663
+ if (this.tip) {
664
+ return this.tip;
665
+ }
497
666
 
498
- _proto.getTipElement = function getTipElement() {
499
- this.tip = this.tip || $__default['default'](this.config.template)[0];
667
+ const element = document.createElement('div');
668
+ element.innerHTML = this.config.template;
669
+ this.tip = element.children[0];
500
670
  return this.tip;
501
- };
671
+ }
672
+
673
+ setContent() {
674
+ const tip = this.getTipElement();
675
+ this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
676
+ tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
677
+ }
678
+
679
+ setElementContent(element, content) {
680
+ if (element === null) {
681
+ return;
682
+ }
683
+
684
+ if (typeof content === 'object' && isElement(content)) {
685
+ if (content.jquery) {
686
+ content = content[0];
687
+ } // content is a DOM node or a jQuery
502
688
 
503
- _proto.setContent = function setContent() {
504
- var tip = this.getTipElement();
505
- this.setElementContent($__default['default'](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
506
- $__default['default'](tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
507
- };
508
689
 
509
- _proto.setElementContent = function setElementContent($element, content) {
510
- if (typeof content === 'object' && (content.nodeType || content.jquery)) {
511
- // Content is a DOM node or a jQuery
512
690
  if (this.config.html) {
513
- if (!$__default['default'](content).parent().is($element)) {
514
- $element.empty().append(content);
691
+ if (content.parentNode !== element) {
692
+ element.innerHTML = '';
693
+ element.appendChild(content);
515
694
  }
516
695
  } else {
517
- $element.text($__default['default'](content).text());
696
+ element.textContent = content.textContent;
518
697
  }
519
698
 
520
699
  return;
@@ -522,149 +701,181 @@
522
701
 
523
702
  if (this.config.html) {
524
703
  if (this.config.sanitize) {
525
- content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
704
+ content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
526
705
  }
527
706
 
528
- $element.html(content);
707
+ element.innerHTML = content;
529
708
  } else {
530
- $element.text(content);
709
+ element.textContent = content;
531
710
  }
532
- };
711
+ }
533
712
 
534
- _proto.getTitle = function getTitle() {
535
- var title = this.element.getAttribute('data-original-title');
713
+ getTitle() {
714
+ let title = this._element.getAttribute('data-bs-original-title');
536
715
 
537
716
  if (!title) {
538
- title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
717
+ title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
539
718
  }
540
719
 
541
720
  return title;
721
+ }
722
+
723
+ updateAttachment(attachment) {
724
+ if (attachment === 'right') {
725
+ return 'end';
726
+ }
727
+
728
+ if (attachment === 'left') {
729
+ return 'start';
730
+ }
731
+
732
+ return attachment;
542
733
  } // Private
543
- ;
544
734
 
545
- _proto._getPopperConfig = function _getPopperConfig(attachment) {
546
- var _this3 = this;
547
735
 
548
- var defaultBsConfig = {
549
- placement: attachment,
550
- modifiers: {
551
- offset: this._getOffset(),
552
- flip: {
553
- behavior: this.config.fallbackPlacement
554
- },
555
- arrow: {
556
- element: SELECTOR_ARROW
557
- },
558
- preventOverflow: {
559
- boundariesElement: this.config.boundary
560
- }
561
- },
562
- onCreate: function onCreate(data) {
563
- if (data.originalPlacement !== data.placement) {
564
- _this3._handlePopperPlacementChange(data);
565
- }
566
- },
567
- onUpdate: function onUpdate(data) {
568
- return _this3._handlePopperPlacementChange(data);
569
- }
570
- };
571
- return _extends({}, defaultBsConfig, this.config.popperConfig);
572
- };
736
+ _initializeOnDelegatedTarget(event, context) {
737
+ const dataKey = this.constructor.DATA_KEY;
738
+ context = context || Data__default['default'].get(event.delegateTarget, dataKey);
573
739
 
574
- _proto._getOffset = function _getOffset() {
575
- var _this4 = this;
740
+ if (!context) {
741
+ context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
742
+ Data__default['default'].set(event.delegateTarget, dataKey, context);
743
+ }
576
744
 
577
- var offset = {};
745
+ return context;
746
+ }
578
747
 
579
- if (typeof this.config.offset === 'function') {
580
- offset.fn = function (data) {
581
- data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
582
- return data;
583
- };
584
- } else {
585
- offset.offset = this.config.offset;
748
+ _getOffset() {
749
+ const {
750
+ offset
751
+ } = this.config;
752
+
753
+ if (typeof offset === 'string') {
754
+ return offset.split(',').map(val => Number.parseInt(val, 10));
755
+ }
756
+
757
+ if (typeof offset === 'function') {
758
+ return popperData => offset(popperData, this._element);
586
759
  }
587
760
 
588
761
  return offset;
589
- };
762
+ }
763
+
764
+ _getPopperConfig(attachment) {
765
+ const defaultBsPopperConfig = {
766
+ placement: attachment,
767
+ modifiers: [{
768
+ name: 'flip',
769
+ options: {
770
+ fallbackPlacements: this.config.fallbackPlacements
771
+ }
772
+ }, {
773
+ name: 'offset',
774
+ options: {
775
+ offset: this._getOffset()
776
+ }
777
+ }, {
778
+ name: 'preventOverflow',
779
+ options: {
780
+ boundary: this.config.boundary
781
+ }
782
+ }, {
783
+ name: 'arrow',
784
+ options: {
785
+ element: `.${this.constructor.NAME}-arrow`
786
+ }
787
+ }, {
788
+ name: 'onChange',
789
+ enabled: true,
790
+ phase: 'afterWrite',
791
+ fn: data => this._handlePopperPlacementChange(data)
792
+ }],
793
+ onFirstUpdate: data => {
794
+ if (data.options.placement !== data.placement) {
795
+ this._handlePopperPlacementChange(data);
796
+ }
797
+ }
798
+ };
799
+ return { ...defaultBsPopperConfig,
800
+ ...(typeof this.config.popperConfig === 'function' ? this.config.popperConfig(defaultBsPopperConfig) : this.config.popperConfig)
801
+ };
802
+ }
590
803
 
591
- _proto._getContainer = function _getContainer() {
804
+ _addAttachmentClass(attachment) {
805
+ this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
806
+ }
807
+
808
+ _getContainer() {
592
809
  if (this.config.container === false) {
593
810
  return document.body;
594
811
  }
595
812
 
596
- if (Util__default['default'].isElement(this.config.container)) {
597
- return $__default['default'](this.config.container);
813
+ if (isElement(this.config.container)) {
814
+ return this.config.container;
598
815
  }
599
816
 
600
- return $__default['default'](document).find(this.config.container);
601
- };
817
+ return SelectorEngine__default['default'].findOne(this.config.container);
818
+ }
602
819
 
603
- _proto._getAttachment = function _getAttachment(placement) {
820
+ _getAttachment(placement) {
604
821
  return AttachmentMap[placement.toUpperCase()];
605
- };
606
-
607
- _proto._setListeners = function _setListeners() {
608
- var _this5 = this;
822
+ }
609
823
 
610
- var triggers = this.config.trigger.split(' ');
611
- triggers.forEach(function (trigger) {
824
+ _setListeners() {
825
+ const triggers = this.config.trigger.split(' ');
826
+ triggers.forEach(trigger => {
612
827
  if (trigger === 'click') {
613
- $__default['default'](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
614
- return _this5.toggle(event);
615
- });
828
+ EventHandler__default['default'].on(this._element, this.constructor.Event.CLICK, this.config.selector, event => this.toggle(event));
616
829
  } else if (trigger !== TRIGGER_MANUAL) {
617
- var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
618
- var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
619
- $__default['default'](_this5.element).on(eventIn, _this5.config.selector, function (event) {
620
- return _this5._enter(event);
621
- }).on(eventOut, _this5.config.selector, function (event) {
622
- return _this5._leave(event);
623
- });
830
+ const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;
831
+ const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;
832
+ EventHandler__default['default'].on(this._element, eventIn, this.config.selector, event => this._enter(event));
833
+ EventHandler__default['default'].on(this._element, eventOut, this.config.selector, event => this._leave(event));
624
834
  }
625
835
  });
626
836
 
627
- this._hideModalHandler = function () {
628
- if (_this5.element) {
629
- _this5.hide();
837
+ this._hideModalHandler = () => {
838
+ if (this._element) {
839
+ this.hide();
630
840
  }
631
841
  };
632
842
 
633
- $__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
843
+ EventHandler__default['default'].on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
634
844
 
635
845
  if (this.config.selector) {
636
- this.config = _extends({}, this.config, {
846
+ this.config = { ...this.config,
637
847
  trigger: 'manual',
638
848
  selector: ''
639
- });
849
+ };
640
850
  } else {
641
851
  this._fixTitle();
642
852
  }
643
- };
853
+ }
644
854
 
645
- _proto._fixTitle = function _fixTitle() {
646
- var titleType = typeof this.element.getAttribute('data-original-title');
855
+ _fixTitle() {
856
+ const title = this._element.getAttribute('title');
647
857
 
648
- if (this.element.getAttribute('title') || titleType !== 'string') {
649
- this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
650
- this.element.setAttribute('title', '');
651
- }
652
- };
858
+ const originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
653
859
 
654
- _proto._enter = function _enter(event, context) {
655
- var dataKey = this.constructor.DATA_KEY;
656
- context = context || $__default['default'](event.currentTarget).data(dataKey);
860
+ if (title || originalTitleType !== 'string') {
861
+ this._element.setAttribute('data-bs-original-title', title || '');
657
862
 
658
- if (!context) {
659
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
660
- $__default['default'](event.currentTarget).data(dataKey, context);
863
+ if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
864
+ this._element.setAttribute('aria-label', title);
865
+ }
866
+
867
+ this._element.setAttribute('title', '');
661
868
  }
869
+ }
870
+
871
+ _enter(event, context) {
872
+ context = this._initializeOnDelegatedTarget(event, context);
662
873
 
663
874
  if (event) {
664
875
  context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
665
876
  }
666
877
 
667
- if ($__default['default'](context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
878
+ if (context.getTipElement().classList.contains(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
668
879
  context._hoverState = HOVER_STATE_SHOW;
669
880
  return;
670
881
  }
@@ -677,24 +888,18 @@
677
888
  return;
678
889
  }
679
890
 
680
- context._timeout = setTimeout(function () {
891
+ context._timeout = setTimeout(() => {
681
892
  if (context._hoverState === HOVER_STATE_SHOW) {
682
893
  context.show();
683
894
  }
684
895
  }, context.config.delay.show);
685
- };
896
+ }
686
897
 
687
- _proto._leave = function _leave(event, context) {
688
- var dataKey = this.constructor.DATA_KEY;
689
- context = context || $__default['default'](event.currentTarget).data(dataKey);
690
-
691
- if (!context) {
692
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
693
- $__default['default'](event.currentTarget).data(dataKey, context);
694
- }
898
+ _leave(event, context) {
899
+ context = this._initializeOnDelegatedTarget(event, context);
695
900
 
696
901
  if (event) {
697
- context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
902
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
698
903
  }
699
904
 
700
905
  if (context._isWithActiveTrigger()) {
@@ -709,31 +914,39 @@
709
914
  return;
710
915
  }
711
916
 
712
- context._timeout = setTimeout(function () {
917
+ context._timeout = setTimeout(() => {
713
918
  if (context._hoverState === HOVER_STATE_OUT) {
714
919
  context.hide();
715
920
  }
716
921
  }, context.config.delay.hide);
717
- };
922
+ }
718
923
 
719
- _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
720
- for (var trigger in this._activeTrigger) {
924
+ _isWithActiveTrigger() {
925
+ for (const trigger in this._activeTrigger) {
721
926
  if (this._activeTrigger[trigger]) {
722
927
  return true;
723
928
  }
724
929
  }
725
930
 
726
931
  return false;
727
- };
932
+ }
728
933
 
729
- _proto._getConfig = function _getConfig(config) {
730
- var dataAttributes = $__default['default'](this.element).data();
731
- Object.keys(dataAttributes).forEach(function (dataAttr) {
732
- if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
934
+ _getConfig(config) {
935
+ const dataAttributes = Manipulator__default['default'].getDataAttributes(this._element);
936
+ Object.keys(dataAttributes).forEach(dataAttr => {
937
+ if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
733
938
  delete dataAttributes[dataAttr];
734
939
  }
735
940
  });
736
- config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
941
+
942
+ if (config && typeof config.container === 'object' && config.container.jquery) {
943
+ config.container = config.container[0];
944
+ }
945
+
946
+ config = { ...this.constructor.Default,
947
+ ...dataAttributes,
948
+ ...(typeof config === 'object' && config ? config : {})
949
+ };
737
950
 
738
951
  if (typeof config.delay === 'number') {
739
952
  config.delay = {
@@ -750,20 +963,20 @@
750
963
  config.content = config.content.toString();
751
964
  }
752
965
 
753
- Util__default['default'].typeCheckConfig(NAME, config, this.constructor.DefaultType);
966
+ typeCheckConfig(NAME, config, this.constructor.DefaultType);
754
967
 
755
968
  if (config.sanitize) {
756
- config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
969
+ config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
757
970
  }
758
971
 
759
972
  return config;
760
- };
973
+ }
761
974
 
762
- _proto._getDelegateConfig = function _getDelegateConfig() {
763
- var config = {};
975
+ _getDelegateConfig() {
976
+ const config = {};
764
977
 
765
978
  if (this.config) {
766
- for (var key in this.config) {
979
+ for (const key in this.config) {
767
980
  if (this.constructor.Default[key] !== this.config[key]) {
768
981
  config[key] = this.config[key];
769
982
  }
@@ -771,47 +984,39 @@
771
984
  }
772
985
 
773
986
  return config;
774
- };
987
+ }
775
988
 
776
- _proto._cleanTipClass = function _cleanTipClass() {
777
- var $tip = $__default['default'](this.getTipElement());
778
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
989
+ _cleanTipClass() {
990
+ const tip = this.getTipElement();
991
+ const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
779
992
 
780
- if (tabClass !== null && tabClass.length) {
781
- $tip.removeClass(tabClass.join(''));
993
+ if (tabClass !== null && tabClass.length > 0) {
994
+ tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
782
995
  }
783
- };
784
-
785
- _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
786
- this.tip = popperData.instance.popper;
787
-
788
- this._cleanTipClass();
789
-
790
- this.addAttachmentClass(this._getAttachment(popperData.placement));
791
- };
996
+ }
792
997
 
793
- _proto._fixTransition = function _fixTransition() {
794
- var tip = this.getTipElement();
795
- var initConfigAnimation = this.config.animation;
998
+ _handlePopperPlacementChange(popperData) {
999
+ const {
1000
+ state
1001
+ } = popperData;
796
1002
 
797
- if (tip.getAttribute('x-placement') !== null) {
1003
+ if (!state) {
798
1004
  return;
799
1005
  }
800
1006
 
801
- $__default['default'](tip).removeClass(CLASS_NAME_FADE);
802
- this.config.animation = false;
803
- this.hide();
804
- this.show();
805
- this.config.animation = initConfigAnimation;
1007
+ this.tip = state.elements.popper;
1008
+
1009
+ this._cleanTipClass();
1010
+
1011
+ this._addAttachmentClass(this._getAttachment(state.placement));
806
1012
  } // Static
807
- ;
808
1013
 
809
- Tooltip._jQueryInterface = function _jQueryInterface(config) {
1014
+
1015
+ static jQueryInterface(config) {
810
1016
  return this.each(function () {
811
- var $element = $__default['default'](this);
812
- var data = $element.data(DATA_KEY);
1017
+ let data = Data__default['default'].get(this, DATA_KEY);
813
1018
 
814
- var _config = typeof config === 'object' && config;
1019
+ const _config = typeof config === 'object' && config;
815
1020
 
816
1021
  if (!data && /dispose|hide/.test(config)) {
817
1022
  return;
@@ -819,72 +1024,28 @@
819
1024
 
820
1025
  if (!data) {
821
1026
  data = new Tooltip(this, _config);
822
- $element.data(DATA_KEY, data);
823
1027
  }
824
1028
 
825
1029
  if (typeof config === 'string') {
826
1030
  if (typeof data[config] === 'undefined') {
827
- throw new TypeError("No method named \"" + config + "\"");
1031
+ throw new TypeError(`No method named "${config}"`);
828
1032
  }
829
1033
 
830
1034
  data[config]();
831
1035
  }
832
1036
  });
833
- };
834
-
835
- _createClass(Tooltip, null, [{
836
- key: "VERSION",
837
- get: function get() {
838
- return VERSION;
839
- }
840
- }, {
841
- key: "Default",
842
- get: function get() {
843
- return Default;
844
- }
845
- }, {
846
- key: "NAME",
847
- get: function get() {
848
- return NAME;
849
- }
850
- }, {
851
- key: "DATA_KEY",
852
- get: function get() {
853
- return DATA_KEY;
854
- }
855
- }, {
856
- key: "Event",
857
- get: function get() {
858
- return Event;
859
- }
860
- }, {
861
- key: "EVENT_KEY",
862
- get: function get() {
863
- return EVENT_KEY;
864
- }
865
- }, {
866
- key: "DefaultType",
867
- get: function get() {
868
- return DefaultType;
869
- }
870
- }]);
871
-
872
- return Tooltip;
873
- }();
1037
+ }
1038
+
1039
+ }
874
1040
  /**
875
1041
  * ------------------------------------------------------------------------
876
1042
  * jQuery
877
1043
  * ------------------------------------------------------------------------
1044
+ * add .Tooltip to jQuery only if jQuery is present
878
1045
  */
879
1046
 
880
1047
 
881
- $__default['default'].fn[NAME] = Tooltip._jQueryInterface;
882
- $__default['default'].fn[NAME].Constructor = Tooltip;
883
-
884
- $__default['default'].fn[NAME].noConflict = function () {
885
- $__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
886
- return Tooltip._jQueryInterface;
887
- };
1048
+ defineJQueryPlugin(NAME, Tooltip);
888
1049
 
889
1050
  return Tooltip;
890
1051