bootstrap 4.6.2 → 5.0.0

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