@openeuropa/bcl-theme-default 1.9.1 → 1.10.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.
@@ -2,7 +2,55 @@ import * as Popper from '@popperjs/core';
2
2
 
3
3
  /**
4
4
  * --------------------------------------------------------------------------
5
- * Bootstrap (v5.2.3): util/index.js
5
+ * Bootstrap dom/data.js
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
7
+ * --------------------------------------------------------------------------
8
+ */
9
+
10
+ /**
11
+ * Constants
12
+ */
13
+
14
+ const elementMap = new Map();
15
+ var Data = {
16
+ set(element, key, instance) {
17
+ if (!elementMap.has(element)) {
18
+ elementMap.set(element, new Map());
19
+ }
20
+ const instanceMap = elementMap.get(element);
21
+
22
+ // make it clear we only want one instance per element
23
+ // can be removed later when multiple key/instances are fine to be used
24
+ if (!instanceMap.has(key) && instanceMap.size !== 0) {
25
+ // eslint-disable-next-line no-console
26
+ console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
27
+ return;
28
+ }
29
+ instanceMap.set(key, instance);
30
+ },
31
+ get(element, key) {
32
+ if (elementMap.has(element)) {
33
+ return elementMap.get(element).get(key) || null;
34
+ }
35
+ return null;
36
+ },
37
+ remove(element, key) {
38
+ if (!elementMap.has(element)) {
39
+ return;
40
+ }
41
+ const instanceMap = elementMap.get(element);
42
+ instanceMap.delete(key);
43
+
44
+ // free up element references if there are no instances left for an element
45
+ if (instanceMap.size === 0) {
46
+ elementMap.delete(element);
47
+ }
48
+ }
49
+ };
50
+
51
+ /**
52
+ * --------------------------------------------------------------------------
53
+ * Bootstrap util/index.js
6
54
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
7
55
  * --------------------------------------------------------------------------
8
56
  */
@@ -11,6 +59,19 @@ const MAX_UID = 1_000_000;
11
59
  const MILLISECONDS_MULTIPLIER = 1000;
12
60
  const TRANSITION_END = 'transitionend';
13
61
 
62
+ /**
63
+ * Properly escape IDs selectors to handle weird IDs
64
+ * @param {string} selector
65
+ * @returns {string}
66
+ */
67
+ const parseSelector = selector => {
68
+ if (selector && window.CSS && window.CSS.escape) {
69
+ // document.querySelector needs escaping to handle IDs (html5+) containing for instance /
70
+ selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`);
71
+ }
72
+ return selector;
73
+ };
74
+
14
75
  // Shout-out Angus Croll (https://goo.gl/pxwQGp)
15
76
  const toType = object => {
16
77
  if (object === null || object === undefined) {
@@ -29,38 +90,6 @@ const getUID = prefix => {
29
90
  } while (document.getElementById(prefix));
30
91
  return prefix;
31
92
  };
32
- const getSelector = element => {
33
- let selector = element.getAttribute('data-bs-target');
34
- if (!selector || selector === '#') {
35
- let hrefAttribute = element.getAttribute('href');
36
-
37
- // The only valid content that could double as a selector are IDs or classes,
38
- // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
39
- // `document.querySelector` will rightfully complain it is invalid.
40
- // See https://github.com/twbs/bootstrap/issues/32273
41
- if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
42
- return null;
43
- }
44
-
45
- // Just in case some CMS puts out a full URL with the anchor appended
46
- if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
47
- hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
48
- }
49
- selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
50
- }
51
- return selector;
52
- };
53
- const getSelectorFromElement = element => {
54
- const selector = getSelector(element);
55
- if (selector) {
56
- return document.querySelector(selector) ? selector : null;
57
- }
58
- return null;
59
- };
60
- const getElementFromSelector = element => {
61
- const selector = getSelector(element);
62
- return selector ? document.querySelector(selector) : null;
63
- };
64
93
  const getTransitionDurationFromElement = element => {
65
94
  if (!element) {
66
95
  return 0;
@@ -87,7 +116,7 @@ const getTransitionDurationFromElement = element => {
87
116
  const triggerTransitionEnd = element => {
88
117
  element.dispatchEvent(new Event(TRANSITION_END));
89
118
  };
90
- const isElement = object => {
119
+ const isElement$1 = object => {
91
120
  if (!object || typeof object !== 'object') {
92
121
  return false;
93
122
  }
@@ -96,18 +125,18 @@ const isElement = object => {
96
125
  }
97
126
  return typeof object.nodeType !== 'undefined';
98
127
  };
99
- const getElement = object => {
128
+ const getElement$1 = object => {
100
129
  // it's a jQuery object or a node element
101
- if (isElement(object)) {
130
+ if (isElement$1(object)) {
102
131
  return object.jquery ? object[0] : object;
103
132
  }
104
133
  if (typeof object === 'string' && object.length > 0) {
105
- return document.querySelector(object);
134
+ return document.querySelector(parseSelector(object));
106
135
  }
107
136
  return null;
108
137
  };
109
138
  const isVisible = element => {
110
- if (!isElement(element) || element.getClientRects().length === 0) {
139
+ if (!isElement$1(element) || element.getClientRects().length === 0) {
111
140
  return false;
112
141
  }
113
142
  const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';
@@ -172,32 +201,32 @@ const noop = () => {};
172
201
  const reflow = element => {
173
202
  element.offsetHeight; // eslint-disable-line no-unused-expressions
174
203
  };
175
- const getjQuery = () => {
204
+ const getjQuery$1 = () => {
176
205
  if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
177
206
  return window.jQuery;
178
207
  }
179
208
  return null;
180
209
  };
181
- const DOMContentLoadedCallbacks = [];
182
- const onDOMContentLoaded = callback => {
210
+ const DOMContentLoadedCallbacks$1 = [];
211
+ const onDOMContentLoaded$1 = callback => {
183
212
  if (document.readyState === 'loading') {
184
213
  // add listener on the first call when the document is in loading state
185
- if (!DOMContentLoadedCallbacks.length) {
214
+ if (!DOMContentLoadedCallbacks$1.length) {
186
215
  document.addEventListener('DOMContentLoaded', () => {
187
- for (const callback of DOMContentLoadedCallbacks) {
216
+ for (const callback of DOMContentLoadedCallbacks$1) {
188
217
  callback();
189
218
  }
190
219
  });
191
220
  }
192
- DOMContentLoadedCallbacks.push(callback);
221
+ DOMContentLoadedCallbacks$1.push(callback);
193
222
  } else {
194
223
  callback();
195
224
  }
196
225
  };
197
226
  const isRTL = () => document.documentElement.dir === 'rtl';
198
- const defineJQueryPlugin = plugin => {
199
- onDOMContentLoaded(() => {
200
- const $ = getjQuery();
227
+ const defineJQueryPlugin$1 = plugin => {
228
+ onDOMContentLoaded$1(() => {
229
+ const $ = getjQuery$1();
201
230
  /* istanbul ignore if */
202
231
  if ($) {
203
232
  const name = plugin.NAME;
@@ -211,10 +240,8 @@ const defineJQueryPlugin = plugin => {
211
240
  }
212
241
  });
213
242
  };
214
- const execute = callback => {
215
- if (typeof callback === 'function') {
216
- callback();
217
- }
243
+ const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {
244
+ return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue;
218
245
  };
219
246
  const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
220
247
  if (!waitForTransition) {
@@ -269,7 +296,7 @@ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed
269
296
 
270
297
  /**
271
298
  * --------------------------------------------------------------------------
272
- * Bootstrap (v5.2.3): dom/event-handler.js
299
+ * Bootstrap dom/event-handler.js
273
300
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
274
301
  * --------------------------------------------------------------------------
275
302
  */
@@ -340,7 +367,7 @@ function findHandler(events, callable, delegationSelector = null) {
340
367
  }
341
368
  function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
342
369
  const isDelegated = typeof handler === 'string';
343
- // todo: tooltip passes `false` instead of selector, so we need to check
370
+ // TODO: tooltip passes `false` instead of selector, so we need to check
344
371
  const callable = isDelegated ? delegationFunction : handler || delegationFunction;
345
372
  let typeEvent = getTypeEvent(originalTypeEvent);
346
373
  if (!nativeEvents.has(typeEvent)) {
@@ -392,9 +419,8 @@ function removeHandler(element, events, typeEvent, handler, delegationSelector)
392
419
  }
393
420
  function removeNamespacedHandlers(element, events, typeEvent, namespace) {
394
421
  const storeElementEvent = events[typeEvent] || {};
395
- for (const handlerKey of Object.keys(storeElementEvent)) {
422
+ for (const [handlerKey, event] of Object.entries(storeElementEvent)) {
396
423
  if (handlerKey.includes(namespace)) {
397
- const event = storeElementEvent[handlerKey];
398
424
  removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
399
425
  }
400
426
  }
@@ -433,10 +459,9 @@ const EventHandler = {
433
459
  removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
434
460
  }
435
461
  }
436
- for (const keyHandlers of Object.keys(storeElementEvent)) {
462
+ for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {
437
463
  const handlerKey = keyHandlers.replace(stripUidRegex, '');
438
464
  if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
439
- const event = storeElementEvent[keyHandlers];
440
465
  removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
441
466
  }
442
467
  }
@@ -445,7 +470,7 @@ const EventHandler = {
445
470
  if (typeof event !== 'string' || !element) {
446
471
  return null;
447
472
  }
448
- const $ = getjQuery();
473
+ const $ = getjQuery$1();
449
474
  const typeEvent = getTypeEvent(event);
450
475
  const inNamespace = event !== typeEvent;
451
476
  let jQueryEvent = null;
@@ -459,11 +484,10 @@ const EventHandler = {
459
484
  nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
460
485
  defaultPrevented = jQueryEvent.isDefaultPrevented();
461
486
  }
462
- let evt = new Event(event, {
487
+ const evt = hydrateObj(new Event(event, {
463
488
  bubbles,
464
489
  cancelable: true
465
- });
466
- evt = hydrateObj(evt, args);
490
+ }), args);
467
491
  if (defaultPrevented) {
468
492
  evt.preventDefault();
469
493
  }
@@ -476,8 +500,8 @@ const EventHandler = {
476
500
  return evt;
477
501
  }
478
502
  };
479
- function hydrateObj(obj, meta) {
480
- for (const [key, value] of Object.entries(meta || {})) {
503
+ function hydrateObj(obj, meta = {}) {
504
+ for (const [key, value] of Object.entries(meta)) {
481
505
  try {
482
506
  obj[key] = value;
483
507
  } catch {
@@ -494,55 +518,7 @@ function hydrateObj(obj, meta) {
494
518
 
495
519
  /**
496
520
  * --------------------------------------------------------------------------
497
- * Bootstrap (v5.2.3): dom/data.js
498
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
499
- * --------------------------------------------------------------------------
500
- */
501
-
502
- /**
503
- * Constants
504
- */
505
-
506
- const elementMap = new Map();
507
- var Data = {
508
- set(element, key, instance) {
509
- if (!elementMap.has(element)) {
510
- elementMap.set(element, new Map());
511
- }
512
- const instanceMap = elementMap.get(element);
513
-
514
- // make it clear we only want one instance per element
515
- // can be removed later when multiple key/instances are fine to be used
516
- if (!instanceMap.has(key) && instanceMap.size !== 0) {
517
- // eslint-disable-next-line no-console
518
- console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
519
- return;
520
- }
521
- instanceMap.set(key, instance);
522
- },
523
- get(element, key) {
524
- if (elementMap.has(element)) {
525
- return elementMap.get(element).get(key) || null;
526
- }
527
- return null;
528
- },
529
- remove(element, key) {
530
- if (!elementMap.has(element)) {
531
- return;
532
- }
533
- const instanceMap = elementMap.get(element);
534
- instanceMap.delete(key);
535
-
536
- // free up element references if there are no instances left for an element
537
- if (instanceMap.size === 0) {
538
- elementMap.delete(element);
539
- }
540
- }
541
- };
542
-
543
- /**
544
- * --------------------------------------------------------------------------
545
- * Bootstrap (v5.2.3): dom/manipulator.js
521
+ * Bootstrap dom/manipulator.js
546
522
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
547
523
  * --------------------------------------------------------------------------
548
524
  */
@@ -599,7 +575,7 @@ const Manipulator$1 = {
599
575
 
600
576
  /**
601
577
  * --------------------------------------------------------------------------
602
- * Bootstrap (v5.2.3): util/config.js
578
+ * Bootstrap util/config.js
603
579
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
604
580
  * --------------------------------------------------------------------------
605
581
  */
@@ -630,20 +606,19 @@ class Config {
630
606
  return config;
631
607
  }
632
608
  _mergeConfigObj(config, element) {
633
- const jsonConfig = isElement(element) ? Manipulator$1.getDataAttribute(element, 'config') : {}; // try to parse
609
+ const jsonConfig = isElement$1(element) ? Manipulator$1.getDataAttribute(element, 'config') : {}; // try to parse
634
610
 
635
611
  return {
636
612
  ...this.constructor.Default,
637
613
  ...(typeof jsonConfig === 'object' ? jsonConfig : {}),
638
- ...(isElement(element) ? Manipulator$1.getDataAttributes(element) : {}),
614
+ ...(isElement$1(element) ? Manipulator$1.getDataAttributes(element) : {}),
639
615
  ...(typeof config === 'object' ? config : {})
640
616
  };
641
617
  }
642
618
  _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {
643
- for (const property of Object.keys(configTypes)) {
644
- const expectedTypes = configTypes[property];
619
+ for (const [property, expectedTypes] of Object.entries(configTypes)) {
645
620
  const value = config[property];
646
- const valueType = isElement(value) ? 'element' : toType(value);
621
+ const valueType = isElement$1(value) ? 'element' : toType(value);
647
622
  if (!new RegExp(expectedTypes).test(valueType)) {
648
623
  throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
649
624
  }
@@ -653,7 +628,7 @@ class Config {
653
628
 
654
629
  /**
655
630
  * --------------------------------------------------------------------------
656
- * Bootstrap (v5.2.3): base-component.js
631
+ * Bootstrap base-component.js
657
632
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
658
633
  * --------------------------------------------------------------------------
659
634
  */
@@ -663,7 +638,7 @@ class Config {
663
638
  * Constants
664
639
  */
665
640
 
666
- const VERSION = '5.2.3';
641
+ const VERSION = '5.3.3';
667
642
 
668
643
  /**
669
644
  * Class definition
@@ -672,7 +647,7 @@ const VERSION = '5.2.3';
672
647
  class BaseComponent extends Config {
673
648
  constructor(element, config) {
674
649
  super();
675
- element = getElement(element);
650
+ element = getElement$1(element);
676
651
  if (!element) {
677
652
  return;
678
653
  }
@@ -701,7 +676,7 @@ class BaseComponent extends Config {
701
676
 
702
677
  // Static
703
678
  static getInstance(element) {
704
- return Data.get(getElement(element), this.DATA_KEY);
679
+ return Data.get(getElement$1(element), this.DATA_KEY);
705
680
  }
706
681
  static getOrCreateInstance(element, config = {}) {
707
682
  return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
@@ -722,7 +697,96 @@ class BaseComponent extends Config {
722
697
 
723
698
  /**
724
699
  * --------------------------------------------------------------------------
725
- * Bootstrap (v5.2.3): util/component-functions.js
700
+ * Bootstrap dom/selector-engine.js
701
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
702
+ * --------------------------------------------------------------------------
703
+ */
704
+
705
+ const getSelector$1 = element => {
706
+ let selector = element.getAttribute('data-bs-target');
707
+ if (!selector || selector === '#') {
708
+ let hrefAttribute = element.getAttribute('href');
709
+
710
+ // The only valid content that could double as a selector are IDs or classes,
711
+ // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
712
+ // `document.querySelector` will rightfully complain it is invalid.
713
+ // See https://github.com/twbs/bootstrap/issues/32273
714
+ if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
715
+ return null;
716
+ }
717
+
718
+ // Just in case some CMS puts out a full URL with the anchor appended
719
+ if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
720
+ hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
721
+ }
722
+ selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
723
+ }
724
+ return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null;
725
+ };
726
+ const SelectorEngine = {
727
+ find(selector, element = document.documentElement) {
728
+ return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
729
+ },
730
+ findOne(selector, element = document.documentElement) {
731
+ return Element.prototype.querySelector.call(element, selector);
732
+ },
733
+ children(element, selector) {
734
+ return [].concat(...element.children).filter(child => child.matches(selector));
735
+ },
736
+ parents(element, selector) {
737
+ const parents = [];
738
+ let ancestor = element.parentNode.closest(selector);
739
+ while (ancestor) {
740
+ parents.push(ancestor);
741
+ ancestor = ancestor.parentNode.closest(selector);
742
+ }
743
+ return parents;
744
+ },
745
+ prev(element, selector) {
746
+ let previous = element.previousElementSibling;
747
+ while (previous) {
748
+ if (previous.matches(selector)) {
749
+ return [previous];
750
+ }
751
+ previous = previous.previousElementSibling;
752
+ }
753
+ return [];
754
+ },
755
+ // TODO: this is now unused; remove later along with prev()
756
+ next(element, selector) {
757
+ let next = element.nextElementSibling;
758
+ while (next) {
759
+ if (next.matches(selector)) {
760
+ return [next];
761
+ }
762
+ next = next.nextElementSibling;
763
+ }
764
+ return [];
765
+ },
766
+ focusableChildren(element) {
767
+ const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
768
+ return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
769
+ },
770
+ getSelectorFromElement(element) {
771
+ const selector = getSelector$1(element);
772
+ if (selector) {
773
+ return SelectorEngine.findOne(selector) ? selector : null;
774
+ }
775
+ return null;
776
+ },
777
+ getElementFromSelector(element) {
778
+ const selector = getSelector$1(element);
779
+ return selector ? SelectorEngine.findOne(selector) : null;
780
+ },
781
+ getMultipleElementsFromSelector(element) {
782
+ const selector = getSelector$1(element);
783
+ return selector ? SelectorEngine.find(selector) : [];
784
+ }
785
+ };
786
+
787
+ /**
788
+ * --------------------------------------------------------------------------
789
+ * Bootstrap util/component-functions.js
726
790
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
727
791
  * --------------------------------------------------------------------------
728
792
  */
@@ -737,7 +801,7 @@ const enableDismissTrigger = (component, method = 'hide') => {
737
801
  if (isDisabled(this)) {
738
802
  return;
739
803
  }
740
- const target = getElementFromSelector(this) || this.closest(`.${name}`);
804
+ const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`);
741
805
  const instance = component.getOrCreateInstance(target);
742
806
 
743
807
  // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
@@ -747,7 +811,7 @@ const enableDismissTrigger = (component, method = 'hide') => {
747
811
 
748
812
  /**
749
813
  * --------------------------------------------------------------------------
750
- * Bootstrap (v5.2.3): alert.js
814
+ * Bootstrap alert.js
751
815
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
752
816
  * --------------------------------------------------------------------------
753
817
  */
@@ -818,11 +882,11 @@ enableDismissTrigger(Alert, 'close');
818
882
  * jQuery
819
883
  */
820
884
 
821
- defineJQueryPlugin(Alert);
885
+ defineJQueryPlugin$1(Alert);
822
886
 
823
887
  /**
824
888
  * --------------------------------------------------------------------------
825
- * Bootstrap (v5.2.3): button.js
889
+ * Bootstrap button.js
826
890
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
827
891
  * --------------------------------------------------------------------------
828
892
  */
@@ -882,69 +946,11 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$7, SELECTOR_DATA_TOGGLE$5, event
882
946
  * jQuery
883
947
  */
884
948
 
885
- defineJQueryPlugin(Button);
949
+ defineJQueryPlugin$1(Button);
886
950
 
887
951
  /**
888
952
  * --------------------------------------------------------------------------
889
- * Bootstrap (v5.2.3): dom/selector-engine.js
890
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
891
- * --------------------------------------------------------------------------
892
- */
893
-
894
-
895
- /**
896
- * Constants
897
- */
898
-
899
- const SelectorEngine = {
900
- find(selector, element = document.documentElement) {
901
- return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
902
- },
903
- findOne(selector, element = document.documentElement) {
904
- return Element.prototype.querySelector.call(element, selector);
905
- },
906
- children(element, selector) {
907
- return [].concat(...element.children).filter(child => child.matches(selector));
908
- },
909
- parents(element, selector) {
910
- const parents = [];
911
- let ancestor = element.parentNode.closest(selector);
912
- while (ancestor) {
913
- parents.push(ancestor);
914
- ancestor = ancestor.parentNode.closest(selector);
915
- }
916
- return parents;
917
- },
918
- prev(element, selector) {
919
- let previous = element.previousElementSibling;
920
- while (previous) {
921
- if (previous.matches(selector)) {
922
- return [previous];
923
- }
924
- previous = previous.previousElementSibling;
925
- }
926
- return [];
927
- },
928
- // TODO: this is now unused; remove later along with prev()
929
- next(element, selector) {
930
- let next = element.nextElementSibling;
931
- while (next) {
932
- if (next.matches(selector)) {
933
- return [next];
934
- }
935
- next = next.nextElementSibling;
936
- }
937
- return [];
938
- },
939
- focusableChildren(element) {
940
- const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
941
- return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
942
- }
943
- };
944
-
945
- /**
946
- * --------------------------------------------------------------------------
947
- * Bootstrap (v5.2.3): util/swipe.js
953
+ * Bootstrap util/swipe.js
948
954
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
949
955
  * --------------------------------------------------------------------------
950
956
  */
@@ -1064,7 +1070,7 @@ class Swipe extends Config {
1064
1070
 
1065
1071
  /**
1066
1072
  * --------------------------------------------------------------------------
1067
- * Bootstrap (v5.2.3): carousel.js
1073
+ * Bootstrap carousel.js
1068
1074
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1069
1075
  * --------------------------------------------------------------------------
1070
1076
  */
@@ -1325,7 +1331,7 @@ class Carousel extends BaseComponent {
1325
1331
  }
1326
1332
  if (!activeElement || !nextElement) {
1327
1333
  // Some weirdness is happening, so we bail
1328
- // todo: change tests that use empty divs to avoid this check
1334
+ // TODO: change tests that use empty divs to avoid this check
1329
1335
  return;
1330
1336
  }
1331
1337
  const isCycling = Boolean(this._interval);
@@ -1402,7 +1408,7 @@ class Carousel extends BaseComponent {
1402
1408
  */
1403
1409
 
1404
1410
  EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_SLIDE, function (event) {
1405
- const target = getElementFromSelector(this);
1411
+ const target = SelectorEngine.getElementFromSelector(this);
1406
1412
  if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
1407
1413
  return;
1408
1414
  }
@@ -1433,11 +1439,11 @@ EventHandler.on(window, EVENT_LOAD_DATA_API$4, () => {
1433
1439
  * jQuery
1434
1440
  */
1435
1441
 
1436
- defineJQueryPlugin(Carousel);
1442
+ defineJQueryPlugin$1(Carousel);
1437
1443
 
1438
1444
  /**
1439
1445
  * --------------------------------------------------------------------------
1440
- * Bootstrap (v5.2.3): collapse.js
1446
+ * Bootstrap collapse.js
1441
1447
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1442
1448
  * --------------------------------------------------------------------------
1443
1449
  */
@@ -1486,7 +1492,7 @@ class Collapse extends BaseComponent {
1486
1492
  this._triggerArray = [];
1487
1493
  const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);
1488
1494
  for (const elem of toggleList) {
1489
- const selector = getSelectorFromElement(elem);
1495
+ const selector = SelectorEngine.getSelectorFromElement(elem);
1490
1496
  const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);
1491
1497
  if (selector !== null && filterElement.length) {
1492
1498
  this._triggerArray.push(elem);
@@ -1574,7 +1580,7 @@ class Collapse extends BaseComponent {
1574
1580
  this._element.classList.add(CLASS_NAME_COLLAPSING);
1575
1581
  this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
1576
1582
  for (const trigger of this._triggerArray) {
1577
- const element = getElementFromSelector(trigger);
1583
+ const element = SelectorEngine.getElementFromSelector(trigger);
1578
1584
  if (element && !this._isShown(element)) {
1579
1585
  this._addAriaAndCollapsedClass([trigger], false);
1580
1586
  }
@@ -1596,7 +1602,7 @@ class Collapse extends BaseComponent {
1596
1602
  // Private
1597
1603
  _configAfterMerge(config) {
1598
1604
  config.toggle = Boolean(config.toggle); // Coerce string values
1599
- config.parent = getElement(config.parent);
1605
+ config.parent = getElement$1(config.parent);
1600
1606
  return config;
1601
1607
  }
1602
1608
  _getDimension() {
@@ -1608,7 +1614,7 @@ class Collapse extends BaseComponent {
1608
1614
  }
1609
1615
  const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);
1610
1616
  for (const element of children) {
1611
- const selected = getElementFromSelector(element);
1617
+ const selected = SelectorEngine.getElementFromSelector(element);
1612
1618
  if (selected) {
1613
1619
  this._addAriaAndCollapsedClass([element], this._isShown(selected));
1614
1620
  }
@@ -1656,9 +1662,7 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$4, functi
1656
1662
  if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {
1657
1663
  event.preventDefault();
1658
1664
  }
1659
- const selector = getSelectorFromElement(this);
1660
- const selectorElements = SelectorEngine.find(selector);
1661
- for (const element of selectorElements) {
1665
+ for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {
1662
1666
  Collapse.getOrCreateInstance(element, {
1663
1667
  toggle: false
1664
1668
  }).toggle();
@@ -1669,11 +1673,11 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$4, functi
1669
1673
  * jQuery
1670
1674
  */
1671
1675
 
1672
- defineJQueryPlugin(Collapse);
1676
+ defineJQueryPlugin$1(Collapse);
1673
1677
 
1674
1678
  /**
1675
1679
  * --------------------------------------------------------------------------
1676
- * Bootstrap (v5.2.3): dropdown.js
1680
+ * Bootstrap dropdown.js
1677
1681
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1678
1682
  * --------------------------------------------------------------------------
1679
1683
  */
@@ -1746,7 +1750,7 @@ class Dropdown extends BaseComponent {
1746
1750
  super(element, config);
1747
1751
  this._popper = null;
1748
1752
  this._parent = this._element.parentNode; // dropdown wrapper
1749
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.2/forms/input-group/
1753
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
1750
1754
  this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
1751
1755
  this._inNavbar = this._detectNavbar();
1752
1756
  }
@@ -1841,7 +1845,7 @@ class Dropdown extends BaseComponent {
1841
1845
  }
1842
1846
  _getConfig(config) {
1843
1847
  config = super._getConfig(config);
1844
- if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
1848
+ if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
1845
1849
  // Popper virtual elements require a getBoundingClientRect method
1846
1850
  throw new TypeError(`${NAME$c.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
1847
1851
  }
@@ -1854,8 +1858,8 @@ class Dropdown extends BaseComponent {
1854
1858
  let referenceElement = this._element;
1855
1859
  if (this._config.reference === 'parent') {
1856
1860
  referenceElement = this._parent;
1857
- } else if (isElement(this._config.reference)) {
1858
- referenceElement = getElement(this._config.reference);
1861
+ } else if (isElement$1(this._config.reference)) {
1862
+ referenceElement = getElement$1(this._config.reference);
1859
1863
  } else if (typeof this._config.reference === 'object') {
1860
1864
  referenceElement = this._config.reference;
1861
1865
  }
@@ -1920,7 +1924,7 @@ class Dropdown extends BaseComponent {
1920
1924
 
1921
1925
  // Disable Popper if we have a static display or Dropdown is in Navbar
1922
1926
  if (this._inNavbar || this._config.display === 'static') {
1923
- Manipulator$1.setDataAttribute(this._menu, 'popper', 'static'); // todo:v6 remove
1927
+ Manipulator$1.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
1924
1928
  defaultBsPopperConfig.modifiers = [{
1925
1929
  name: 'applyStyles',
1926
1930
  enabled: false
@@ -1928,7 +1932,7 @@ class Dropdown extends BaseComponent {
1928
1932
  }
1929
1933
  return {
1930
1934
  ...defaultBsPopperConfig,
1931
- ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
1935
+ ...execute(this._config.popperConfig, [defaultBsPopperConfig])
1932
1936
  };
1933
1937
  }
1934
1938
  _selectMenuItem({
@@ -2002,7 +2006,7 @@ class Dropdown extends BaseComponent {
2002
2006
  }
2003
2007
  event.preventDefault();
2004
2008
 
2005
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.2/forms/input-group/
2009
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
2006
2010
  const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);
2007
2011
  const instance = Dropdown.getOrCreateInstance(getToggleButton);
2008
2012
  if (isUpOrDownEvent) {
@@ -2037,237 +2041,11 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$3, functi
2037
2041
  * jQuery
2038
2042
  */
2039
2043
 
2040
- defineJQueryPlugin(Dropdown);
2041
-
2042
- /**
2043
- * --------------------------------------------------------------------------
2044
- * Bootstrap (v5.1.3): gallery.js
2045
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2046
- * --------------------------------------------------------------------------
2047
- */
2048
-
2049
-
2050
- /**
2051
- * ------------------------------------------------------------------------
2052
- * Constants
2053
- * ------------------------------------------------------------------------
2054
- */
2055
-
2056
- const Default$a = {};
2057
- const NAME$b = 'gallery';
2058
- const DATA_KEY$7 = 'bs.gallery';
2059
- const EVENT_KEY$7 = `.${DATA_KEY$7}`;
2060
- const DATA_API_KEY$4 = '.data-api';
2061
- const CAROUSEL_SELECTOR = '.carousel';
2062
- const CAROUSEL_PAGER_SELECTOR = '.carousel-pager span';
2063
- const CAROUSEL_ACTIVE_SELECTOR = '.carousel-item.active';
2064
- const CAROUSEL_ITEM_SELECTOR = '.carousel-item';
2065
- const THUMBNAIL_SELECTOR = '.bcl-gallery__grid a, .bcl-gallery__mobile-view-more';
2066
- const MODAL_SELECTOR = '.modal';
2067
- const EVENT_MODAL_HIDE$1 = 'hide.bs.modal';
2068
- const CAROUSEL_EVENT = 'slide.bs.carousel';
2069
- const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
2070
-
2071
- /**
2072
- * ------------------------------------------------------------------------
2073
- * Class Definition
2074
- * ------------------------------------------------------------------------
2075
- */
2076
-
2077
- class Gallery extends BaseComponent {
2078
- constructor(element, config) {
2079
- super(element, config);
2080
- /* eslint no-underscore-dangle: ["error", { "allow": ["_element"] }] */
2081
- this.carousel = SelectorEngine.findOne(CAROUSEL_SELECTOR, this._element);
2082
- this.carouselPager = SelectorEngine.findOne(CAROUSEL_PAGER_SELECTOR, this._element);
2083
- this.carouselStartIndex = element.getAttribute('data-gallery-start');
2084
- this.carouselActiveItem = SelectorEngine.find(CAROUSEL_ITEM_SELECTOR, this.carousel)[this.carouselStartIndex];
2085
- this.carouselPager.textContent = Number(this.carouselStartIndex) + 1;
2086
- this.modal = SelectorEngine.findOne(MODAL_SELECTOR, this._element);
2087
- this.addEventListeners();
2088
- this.carouselLazyLoad(this.carouselActiveItem);
2089
- }
2090
-
2091
- // Getters
2092
- static get NAME() {
2093
- return NAME$b;
2094
- }
2095
-
2096
- // Public
2097
- setSlide(event) {
2098
- const slideFrom = SelectorEngine.findOne(CAROUSEL_ACTIVE_SELECTOR, this.carousel);
2099
- const slideTo = event.relatedTarget;
2100
- this.carouselLazyLoad(slideTo);
2101
- this.carouselPager.textContent = event.to + 1;
2102
- this.stopVideo(slideFrom);
2103
- }
2104
- stopSlide() {
2105
- const currentSlide = SelectorEngine.findOne(CAROUSEL_ACTIVE_SELECTOR, this.carousel);
2106
- this.stopVideo(currentSlide);
2107
- }
2108
- stopVideo(slide) {
2109
- const iframe = SelectorEngine.findOne('iframe', slide);
2110
- const video = SelectorEngine.findOne('video', slide);
2111
- if (iframe) {
2112
- iframe.src = iframe.dataset.src;
2113
- } else if (video) {
2114
- video.pause();
2115
- }
2116
- }
2117
-
2118
- // Private
2119
- carouselLazyLoad(slide) {
2120
- const media = SelectorEngine.findOne('[data-src]', slide);
2121
- if (media && !media.src) {
2122
- media.src = media.dataset.src;
2123
- }
2124
- }
2125
- addEventListeners() {
2126
- EventHandler.on(this.carousel, CAROUSEL_EVENT, event => this.setSlide(event));
2127
- EventHandler.on(this.modal, EVENT_MODAL_HIDE$1, event => this.stopSlide(event));
2128
- }
2129
-
2130
- // Static
2131
- static get Default() {
2132
- return Default$a;
2133
- }
2134
- static jQueryInterface(config) {
2135
- return this.each(function jInterface() {
2136
- const data = Gallery.getOrCreateInstance(this);
2137
- if (typeof config !== 'string') {
2138
- return;
2139
- }
2140
- if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
2141
- throw new TypeError(`No method named "${config}"`);
2142
- }
2143
- data[config](this);
2144
- });
2145
- }
2146
- }
2147
-
2148
- /**
2149
- * ------------------------------------------------------------------------
2150
- * Data Api implementation
2151
- * ------------------------------------------------------------------------
2152
- */
2153
-
2154
- EventHandler.on(document, EVENT_CLICK_DATA_API$3, THUMBNAIL_SELECTOR, event => {
2155
- const gallery = event.target.closest('div.bcl-gallery');
2156
- const firstSlide = event.target.parentNode.getAttribute('data-bs-slide-to');
2157
- gallery.dataset.galleryStart = firstSlide;
2158
- Gallery.getOrCreateInstance(gallery);
2159
- });
2160
-
2161
- /**
2162
- * ------------------------------------------------------------------------
2163
- * jQuery
2164
- * ------------------------------------------------------------------------
2165
- * add .gallery to jQuery only if jQuery is present
2166
- */
2167
-
2168
- defineJQueryPlugin(Gallery);
2169
-
2170
- /**
2171
- * --------------------------------------------------------------------------
2172
- * Bootstrap (v5.2.3): util/scrollBar.js
2173
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2174
- * --------------------------------------------------------------------------
2175
- */
2176
-
2177
-
2178
- /**
2179
- * Constants
2180
- */
2181
-
2182
- const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
2183
- const SELECTOR_STICKY_CONTENT = '.sticky-top';
2184
- const PROPERTY_PADDING = 'padding-right';
2185
- const PROPERTY_MARGIN = 'margin-right';
2186
-
2187
- /**
2188
- * Class definition
2189
- */
2190
-
2191
- class ScrollBarHelper {
2192
- constructor() {
2193
- this._element = document.body;
2194
- }
2195
-
2196
- // Public
2197
- getWidth() {
2198
- // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
2199
- const documentWidth = document.documentElement.clientWidth;
2200
- return Math.abs(window.innerWidth - documentWidth);
2201
- }
2202
- hide() {
2203
- const width = this.getWidth();
2204
- this._disableOverFlow();
2205
- // give padding to element to balance the hidden scrollbar width
2206
- this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2207
- // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
2208
- this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2209
- this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
2210
- }
2211
- reset() {
2212
- this._resetElementAttributes(this._element, 'overflow');
2213
- this._resetElementAttributes(this._element, PROPERTY_PADDING);
2214
- this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
2215
- this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
2216
- }
2217
- isOverflowing() {
2218
- return this.getWidth() > 0;
2219
- }
2220
-
2221
- // Private
2222
- _disableOverFlow() {
2223
- this._saveInitialAttribute(this._element, 'overflow');
2224
- this._element.style.overflow = 'hidden';
2225
- }
2226
- _setElementAttributes(selector, styleProperty, callback) {
2227
- const scrollbarWidth = this.getWidth();
2228
- const manipulationCallBack = element => {
2229
- if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
2230
- return;
2231
- }
2232
- this._saveInitialAttribute(element, styleProperty);
2233
- const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
2234
- element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
2235
- };
2236
- this._applyManipulationCallback(selector, manipulationCallBack);
2237
- }
2238
- _saveInitialAttribute(element, styleProperty) {
2239
- const actualValue = element.style.getPropertyValue(styleProperty);
2240
- if (actualValue) {
2241
- Manipulator$1.setDataAttribute(element, styleProperty, actualValue);
2242
- }
2243
- }
2244
- _resetElementAttributes(selector, styleProperty) {
2245
- const manipulationCallBack = element => {
2246
- const value = Manipulator$1.getDataAttribute(element, styleProperty);
2247
- // We only want to remove the property if the value is `null`; the value can also be zero
2248
- if (value === null) {
2249
- element.style.removeProperty(styleProperty);
2250
- return;
2251
- }
2252
- Manipulator$1.removeDataAttribute(element, styleProperty);
2253
- element.style.setProperty(styleProperty, value);
2254
- };
2255
- this._applyManipulationCallback(selector, manipulationCallBack);
2256
- }
2257
- _applyManipulationCallback(selector, callBack) {
2258
- if (isElement(selector)) {
2259
- callBack(selector);
2260
- return;
2261
- }
2262
- for (const sel of SelectorEngine.find(selector, this._element)) {
2263
- callBack(sel);
2264
- }
2265
- }
2266
- }
2044
+ defineJQueryPlugin$1(Dropdown);
2267
2045
 
2268
2046
  /**
2269
2047
  * --------------------------------------------------------------------------
2270
- * Bootstrap (v5.2.3): util/backdrop.js
2048
+ * Bootstrap util/backdrop.js
2271
2049
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2272
2050
  * --------------------------------------------------------------------------
2273
2051
  */
@@ -2277,11 +2055,11 @@ class ScrollBarHelper {
2277
2055
  * Constants
2278
2056
  */
2279
2057
 
2280
- const NAME$a = 'backdrop';
2058
+ const NAME$b = 'backdrop';
2281
2059
  const CLASS_NAME_FADE$4 = 'fade';
2282
2060
  const CLASS_NAME_SHOW$5 = 'show';
2283
- const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$a}`;
2284
- const Default$9 = {
2061
+ const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$b}`;
2062
+ const Default$a = {
2285
2063
  className: 'modal-backdrop',
2286
2064
  clickCallback: null,
2287
2065
  isAnimated: false,
@@ -2311,13 +2089,13 @@ class Backdrop extends Config {
2311
2089
 
2312
2090
  // Getters
2313
2091
  static get Default() {
2314
- return Default$9;
2092
+ return Default$a;
2315
2093
  }
2316
2094
  static get DefaultType() {
2317
2095
  return DefaultType$8;
2318
2096
  }
2319
2097
  static get NAME() {
2320
- return NAME$a;
2098
+ return NAME$b;
2321
2099
  }
2322
2100
 
2323
2101
  // Public
@@ -2370,7 +2148,7 @@ class Backdrop extends Config {
2370
2148
  }
2371
2149
  _configAfterMerge(config) {
2372
2150
  // use getElement() with the default "body" to get a fresh Element on each instantiation
2373
- config.rootElement = getElement(config.rootElement);
2151
+ config.rootElement = getElement$1(config.rootElement);
2374
2152
  return config;
2375
2153
  }
2376
2154
  _append() {
@@ -2391,7 +2169,7 @@ class Backdrop extends Config {
2391
2169
 
2392
2170
  /**
2393
2171
  * --------------------------------------------------------------------------
2394
- * Bootstrap (v5.2.3): util/focustrap.js
2172
+ * Bootstrap util/focustrap.js
2395
2173
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2396
2174
  * --------------------------------------------------------------------------
2397
2175
  */
@@ -2401,15 +2179,15 @@ class Backdrop extends Config {
2401
2179
  * Constants
2402
2180
  */
2403
2181
 
2404
- const NAME$9 = 'focustrap';
2405
- const DATA_KEY$6 = 'bs.focustrap';
2406
- const EVENT_KEY$6 = `.${DATA_KEY$6}`;
2407
- const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$6}`;
2408
- const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$6}`;
2182
+ const NAME$a = 'focustrap';
2183
+ const DATA_KEY$7 = 'bs.focustrap';
2184
+ const EVENT_KEY$7 = `.${DATA_KEY$7}`;
2185
+ const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$7}`;
2186
+ const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$7}`;
2409
2187
  const TAB_KEY = 'Tab';
2410
2188
  const TAB_NAV_FORWARD = 'forward';
2411
2189
  const TAB_NAV_BACKWARD = 'backward';
2412
- const Default$8 = {
2190
+ const Default$9 = {
2413
2191
  autofocus: true,
2414
2192
  trapElement: null // The element to trap focus inside of
2415
2193
  };
@@ -2432,13 +2210,13 @@ class FocusTrap extends Config {
2432
2210
 
2433
2211
  // Getters
2434
2212
  static get Default() {
2435
- return Default$8;
2213
+ return Default$9;
2436
2214
  }
2437
2215
  static get DefaultType() {
2438
2216
  return DefaultType$7;
2439
2217
  }
2440
2218
  static get NAME() {
2441
- return NAME$9;
2219
+ return NAME$a;
2442
2220
  }
2443
2221
 
2444
2222
  // Public
@@ -2449,7 +2227,7 @@ class FocusTrap extends Config {
2449
2227
  if (this._config.autofocus) {
2450
2228
  this._config.trapElement.focus();
2451
2229
  }
2452
- EventHandler.off(document, EVENT_KEY$6); // guard against infinite focus loop
2230
+ EventHandler.off(document, EVENT_KEY$7); // guard against infinite focus loop
2453
2231
  EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event));
2454
2232
  EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
2455
2233
  this._isActive = true;
@@ -2459,7 +2237,7 @@ class FocusTrap extends Config {
2459
2237
  return;
2460
2238
  }
2461
2239
  this._isActive = false;
2462
- EventHandler.off(document, EVENT_KEY$6);
2240
+ EventHandler.off(document, EVENT_KEY$7);
2463
2241
  }
2464
2242
 
2465
2243
  // Private
@@ -2489,7 +2267,7 @@ class FocusTrap extends Config {
2489
2267
 
2490
2268
  /**
2491
2269
  * --------------------------------------------------------------------------
2492
- * Bootstrap (v5.2.3): modal.js
2270
+ * Bootstrap util/scrollBar.js
2493
2271
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2494
2272
  * --------------------------------------------------------------------------
2495
2273
  */
@@ -2499,21 +2277,119 @@ class FocusTrap extends Config {
2499
2277
  * Constants
2500
2278
  */
2501
2279
 
2502
- const NAME$8 = 'modal';
2503
- const DATA_KEY$5 = 'bs.modal';
2504
- const EVENT_KEY$5 = `.${DATA_KEY$5}`;
2505
- const DATA_API_KEY$3 = '.data-api';
2280
+ const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
2281
+ const SELECTOR_STICKY_CONTENT = '.sticky-top';
2282
+ const PROPERTY_PADDING = 'padding-right';
2283
+ const PROPERTY_MARGIN = 'margin-right';
2284
+
2285
+ /**
2286
+ * Class definition
2287
+ */
2288
+
2289
+ class ScrollBarHelper {
2290
+ constructor() {
2291
+ this._element = document.body;
2292
+ }
2293
+
2294
+ // Public
2295
+ getWidth() {
2296
+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
2297
+ const documentWidth = document.documentElement.clientWidth;
2298
+ return Math.abs(window.innerWidth - documentWidth);
2299
+ }
2300
+ hide() {
2301
+ const width = this.getWidth();
2302
+ this._disableOverFlow();
2303
+ // give padding to element to balance the hidden scrollbar width
2304
+ this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2305
+ // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
2306
+ this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
2307
+ this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
2308
+ }
2309
+ reset() {
2310
+ this._resetElementAttributes(this._element, 'overflow');
2311
+ this._resetElementAttributes(this._element, PROPERTY_PADDING);
2312
+ this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
2313
+ this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
2314
+ }
2315
+ isOverflowing() {
2316
+ return this.getWidth() > 0;
2317
+ }
2318
+
2319
+ // Private
2320
+ _disableOverFlow() {
2321
+ this._saveInitialAttribute(this._element, 'overflow');
2322
+ this._element.style.overflow = 'hidden';
2323
+ }
2324
+ _setElementAttributes(selector, styleProperty, callback) {
2325
+ const scrollbarWidth = this.getWidth();
2326
+ const manipulationCallBack = element => {
2327
+ if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
2328
+ return;
2329
+ }
2330
+ this._saveInitialAttribute(element, styleProperty);
2331
+ const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
2332
+ element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
2333
+ };
2334
+ this._applyManipulationCallback(selector, manipulationCallBack);
2335
+ }
2336
+ _saveInitialAttribute(element, styleProperty) {
2337
+ const actualValue = element.style.getPropertyValue(styleProperty);
2338
+ if (actualValue) {
2339
+ Manipulator$1.setDataAttribute(element, styleProperty, actualValue);
2340
+ }
2341
+ }
2342
+ _resetElementAttributes(selector, styleProperty) {
2343
+ const manipulationCallBack = element => {
2344
+ const value = Manipulator$1.getDataAttribute(element, styleProperty);
2345
+ // We only want to remove the property if the value is `null`; the value can also be zero
2346
+ if (value === null) {
2347
+ element.style.removeProperty(styleProperty);
2348
+ return;
2349
+ }
2350
+ Manipulator$1.removeDataAttribute(element, styleProperty);
2351
+ element.style.setProperty(styleProperty, value);
2352
+ };
2353
+ this._applyManipulationCallback(selector, manipulationCallBack);
2354
+ }
2355
+ _applyManipulationCallback(selector, callBack) {
2356
+ if (isElement$1(selector)) {
2357
+ callBack(selector);
2358
+ return;
2359
+ }
2360
+ for (const sel of SelectorEngine.find(selector, this._element)) {
2361
+ callBack(sel);
2362
+ }
2363
+ }
2364
+ }
2365
+
2366
+ /**
2367
+ * --------------------------------------------------------------------------
2368
+ * Bootstrap modal.js
2369
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2370
+ * --------------------------------------------------------------------------
2371
+ */
2372
+
2373
+
2374
+ /**
2375
+ * Constants
2376
+ */
2377
+
2378
+ const NAME$9 = 'modal';
2379
+ const DATA_KEY$6 = 'bs.modal';
2380
+ const EVENT_KEY$6 = `.${DATA_KEY$6}`;
2381
+ const DATA_API_KEY$4 = '.data-api';
2506
2382
  const ESCAPE_KEY$1 = 'Escape';
2507
- const EVENT_HIDE$4 = `hide${EVENT_KEY$5}`;
2508
- const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$5}`;
2509
- const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$5}`;
2510
- const EVENT_SHOW$4 = `show${EVENT_KEY$5}`;
2511
- const EVENT_SHOWN$4 = `shown${EVENT_KEY$5}`;
2512
- const EVENT_RESIZE$1 = `resize${EVENT_KEY$5}`;
2513
- const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$5}`;
2514
- const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$5}`;
2515
- const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$5}`;
2516
- const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$5}${DATA_API_KEY$3}`;
2383
+ const EVENT_HIDE$4 = `hide${EVENT_KEY$6}`;
2384
+ const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$6}`;
2385
+ const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$6}`;
2386
+ const EVENT_SHOW$4 = `show${EVENT_KEY$6}`;
2387
+ const EVENT_SHOWN$4 = `shown${EVENT_KEY$6}`;
2388
+ const EVENT_RESIZE$1 = `resize${EVENT_KEY$6}`;
2389
+ const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$6}`;
2390
+ const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`;
2391
+ const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;
2392
+ const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$4}`;
2517
2393
  const CLASS_NAME_OPEN = 'modal-open';
2518
2394
  const CLASS_NAME_FADE$3 = 'fade';
2519
2395
  const CLASS_NAME_SHOW$4 = 'show';
@@ -2522,7 +2398,7 @@ const OPEN_SELECTOR$1 = '.modal.show';
2522
2398
  const SELECTOR_DIALOG = '.modal-dialog';
2523
2399
  const SELECTOR_MODAL_BODY = '.modal-body';
2524
2400
  const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
2525
- const Default$7 = {
2401
+ const Default$8 = {
2526
2402
  backdrop: true,
2527
2403
  focus: true,
2528
2404
  keyboard: true
@@ -2551,13 +2427,13 @@ class Modal extends BaseComponent {
2551
2427
 
2552
2428
  // Getters
2553
2429
  static get Default() {
2554
- return Default$7;
2430
+ return Default$8;
2555
2431
  }
2556
2432
  static get DefaultType() {
2557
2433
  return DefaultType$6;
2558
2434
  }
2559
2435
  static get NAME() {
2560
- return NAME$8;
2436
+ return NAME$9;
2561
2437
  }
2562
2438
 
2563
2439
  // Public
@@ -2596,9 +2472,8 @@ class Modal extends BaseComponent {
2596
2472
  this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
2597
2473
  }
2598
2474
  dispose() {
2599
- for (const htmlElement of [window, this._dialog]) {
2600
- EventHandler.off(htmlElement, EVENT_KEY$5);
2601
- }
2475
+ EventHandler.off(window, EVENT_KEY$6);
2476
+ EventHandler.off(this._dialog, EVENT_KEY$6);
2602
2477
  this._backdrop.dispose();
2603
2478
  this._focustrap.deactivate();
2604
2479
  super.dispose();
@@ -2653,7 +2528,6 @@ class Modal extends BaseComponent {
2653
2528
  return;
2654
2529
  }
2655
2530
  if (this._config.keyboard) {
2656
- event.preventDefault();
2657
2531
  this.hide();
2658
2532
  return;
2659
2533
  }
@@ -2761,8 +2635,8 @@ class Modal extends BaseComponent {
2761
2635
  * Data API implementation
2762
2636
  */
2763
2637
 
2764
- EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {
2765
- const target = getElementFromSelector(this);
2638
+ EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$2, function (event) {
2639
+ const target = SelectorEngine.getElementFromSelector(this);
2766
2640
  if (['A', 'AREA'].includes(this.tagName)) {
2767
2641
  event.preventDefault();
2768
2642
  }
@@ -2792,11 +2666,11 @@ enableDismissTrigger(Modal);
2792
2666
  * jQuery
2793
2667
  */
2794
2668
 
2795
- defineJQueryPlugin(Modal);
2669
+ defineJQueryPlugin$1(Modal);
2796
2670
 
2797
2671
  /**
2798
2672
  * --------------------------------------------------------------------------
2799
- * Bootstrap (v5.2.3): offcanvas.js
2673
+ * Bootstrap offcanvas.js
2800
2674
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2801
2675
  * --------------------------------------------------------------------------
2802
2676
  */
@@ -2806,27 +2680,27 @@ defineJQueryPlugin(Modal);
2806
2680
  * Constants
2807
2681
  */
2808
2682
 
2809
- const NAME$7 = 'offcanvas';
2810
- const DATA_KEY$4 = 'bs.offcanvas';
2811
- const EVENT_KEY$4 = `.${DATA_KEY$4}`;
2812
- const DATA_API_KEY$2 = '.data-api';
2813
- const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$4}${DATA_API_KEY$2}`;
2683
+ const NAME$8 = 'offcanvas';
2684
+ const DATA_KEY$5 = 'bs.offcanvas';
2685
+ const EVENT_KEY$5 = `.${DATA_KEY$5}`;
2686
+ const DATA_API_KEY$3 = '.data-api';
2687
+ const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$5}${DATA_API_KEY$3}`;
2814
2688
  const ESCAPE_KEY = 'Escape';
2815
2689
  const CLASS_NAME_SHOW$3 = 'show';
2816
2690
  const CLASS_NAME_SHOWING$1 = 'showing';
2817
2691
  const CLASS_NAME_HIDING = 'hiding';
2818
2692
  const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';
2819
2693
  const OPEN_SELECTOR = '.offcanvas.show';
2820
- const EVENT_SHOW$3 = `show${EVENT_KEY$4}`;
2821
- const EVENT_SHOWN$3 = `shown${EVENT_KEY$4}`;
2822
- const EVENT_HIDE$3 = `hide${EVENT_KEY$4}`;
2823
- const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$4}`;
2824
- const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$4}`;
2825
- const EVENT_RESIZE = `resize${EVENT_KEY$4}`;
2826
- const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`;
2827
- const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$4}`;
2694
+ const EVENT_SHOW$3 = `show${EVENT_KEY$5}`;
2695
+ const EVENT_SHOWN$3 = `shown${EVENT_KEY$5}`;
2696
+ const EVENT_HIDE$3 = `hide${EVENT_KEY$5}`;
2697
+ const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$5}`;
2698
+ const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$5}`;
2699
+ const EVENT_RESIZE = `resize${EVENT_KEY$5}`;
2700
+ const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$5}${DATA_API_KEY$3}`;
2701
+ const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;
2828
2702
  const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]';
2829
- const Default$6 = {
2703
+ const Default$7 = {
2830
2704
  backdrop: true,
2831
2705
  keyboard: true,
2832
2706
  scroll: false
@@ -2852,13 +2726,13 @@ class Offcanvas extends BaseComponent {
2852
2726
 
2853
2727
  // Getters
2854
2728
  static get Default() {
2855
- return Default$6;
2729
+ return Default$7;
2856
2730
  }
2857
2731
  static get DefaultType() {
2858
2732
  return DefaultType$5;
2859
2733
  }
2860
2734
  static get NAME() {
2861
- return NAME$7;
2735
+ return NAME$8;
2862
2736
  }
2863
2737
 
2864
2738
  // Public
@@ -2955,11 +2829,11 @@ class Offcanvas extends BaseComponent {
2955
2829
  if (event.key !== ESCAPE_KEY) {
2956
2830
  return;
2957
2831
  }
2958
- if (!this._config.keyboard) {
2959
- EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
2832
+ if (this._config.keyboard) {
2833
+ this.hide();
2960
2834
  return;
2961
2835
  }
2962
- this.hide();
2836
+ EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
2963
2837
  });
2964
2838
  }
2965
2839
 
@@ -2982,8 +2856,8 @@ class Offcanvas extends BaseComponent {
2982
2856
  * Data API implementation
2983
2857
  */
2984
2858
 
2985
- EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {
2986
- const target = getElementFromSelector(this);
2859
+ EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$1, function (event) {
2860
+ const target = SelectorEngine.getElementFromSelector(this);
2987
2861
  if (['A', 'AREA'].includes(this.tagName)) {
2988
2862
  event.preventDefault();
2989
2863
  }
@@ -3023,132 +2897,17 @@ enableDismissTrigger(Offcanvas);
3023
2897
  * jQuery
3024
2898
  */
3025
2899
 
3026
- defineJQueryPlugin(Offcanvas);
3027
-
3028
- /**
3029
- * AccessibleToggle enhances Bootstrap Modal and Offcanvas components by:
3030
- * - Adding ARIA attributes for improved accessibility.
3031
- * - Updating `aria-expanded` on trigger elements based on visibility.
3032
- * Automatically initializes all modal and offcanvas triggers on the page.
3033
- */
3034
- class AccessibleToggle {
3035
- constructor(triggerElement, type) {
3036
- this.triggerElement = triggerElement;
3037
- this.type = type;
3038
- const target = triggerElement.getAttribute("data-bs-target") || triggerElement.getAttribute("href");
3039
- if (!target || target === "#") {
3040
- return;
3041
- }
3042
- this.targetElement = SelectorEngine.findOne(target);
3043
- if (!this.targetElement) {
3044
- return;
3045
- }
3046
- if (this.type === "modal") {
3047
- this.instance = Modal.getOrCreateInstance(this.targetElement);
3048
- } else if (this.type === "offcanvas") {
3049
- this.instance = Offcanvas.getOrCreateInstance(this.targetElement);
3050
- }
3051
- this.addAriaAttributes();
3052
- this.addEventListeners();
3053
- }
3054
- addAriaAttributes() {
3055
- if (this.triggerElement) {
3056
- this.triggerElement.setAttribute("aria-haspopup", "true");
3057
- this.triggerElement.setAttribute("aria-expanded", "false");
3058
- }
3059
- }
3060
- addEventListeners() {
3061
- const showEvent = this.type === "modal" ? "show.bs.modal" : "show.bs.offcanvas";
3062
- const hideEvent = this.type === "modal" ? "hide.bs.modal" : "hide.bs.offcanvas";
3063
- EventHandler.on(this.targetElement, showEvent, () => {
3064
- this.triggerElement.setAttribute("aria-expanded", "true");
3065
- });
3066
- EventHandler.on(this.targetElement, hideEvent, () => {
3067
- this.triggerElement.setAttribute("aria-expanded", "false");
3068
- });
3069
- }
3070
- static init(toggles) {
3071
- toggles.forEach(toggle => {
3072
- const triggerElements = SelectorEngine.find(toggle.selector);
3073
- triggerElements.forEach(triggerElement => new AccessibleToggle(triggerElement, toggle.type));
3074
- });
3075
- }
3076
- }
3077
-
3078
- /* eslint-disable prefer-destructuring */
3079
- class AccordionToggle {
3080
- static isInitialized = false;
3081
- constructor(buttonElement) {
3082
- this.buttonElement = buttonElement;
3083
- this.targetAccordionId = buttonElement.getAttribute("data-target");
3084
- this.action = buttonElement.getAttribute("data-action");
3085
- this.accordionElement = SelectorEngine.findOne(`#${this.targetAccordionId}`);
3086
- this.accordionItems = SelectorEngine.find(".accordion-collapse", this.accordionElement);
3087
- this.addEventListeners();
3088
- }
3089
- addEventListeners() {
3090
- EventHandler.on(this.buttonElement, "click", event => this.handleAccordionAction(event));
3091
- }
3092
- handleAccordionAction(event) {
3093
- const item = event.target;
3094
- const action = item.getAttribute('data-action');
3095
- const accordionItems = this.accordionItems;
3096
- accordionItems.forEach(accordionItem => {
3097
- const collapseInstance = Collapse.getOrCreateInstance(accordionItem, {
3098
- toggle: false
3099
- });
3100
- if (action === 'expand') {
3101
- collapseInstance.show();
3102
- } else if (action === 'collapse') {
3103
- collapseInstance.hide();
3104
- }
3105
- });
3106
- }
3107
- static init() {
3108
- if (AccordionToggle.isInitialized) {
3109
- return;
3110
- }
3111
- const toggleButtons = SelectorEngine.find('[data-action][data-target]');
3112
- toggleButtons.forEach(buttonElement => new AccordionToggle(buttonElement));
3113
- AccordionToggle.isInitialized = true;
3114
- }
3115
- }
2900
+ defineJQueryPlugin$1(Offcanvas);
3116
2901
 
3117
2902
  /**
3118
2903
  * --------------------------------------------------------------------------
3119
- * Bootstrap (v5.2.3): util/sanitizer.js
2904
+ * Bootstrap util/sanitizer.js
3120
2905
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3121
2906
  * --------------------------------------------------------------------------
3122
2907
  */
3123
2908
 
3124
- const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
2909
+ // js-docs-start allow-list
3125
2910
  const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
3126
-
3127
- /**
3128
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
3129
- *
3130
- * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
3131
- */
3132
- const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
3133
-
3134
- /**
3135
- * A pattern that matches safe data URLs. Only matches image, video and audio types.
3136
- *
3137
- * Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
3138
- */
3139
- 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;
3140
- const allowedAttribute = (attribute, allowedAttributeList) => {
3141
- const attributeName = attribute.nodeName.toLowerCase();
3142
- if (allowedAttributeList.includes(attributeName)) {
3143
- if (uriAttributes.has(attributeName)) {
3144
- return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
3145
- }
3146
- return true;
3147
- }
3148
-
3149
- // Check if a regular expression validates the attribute.
3150
- return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
3151
- };
3152
2911
  const DefaultAllowlist = {
3153
2912
  // Global attributes allowed on any supplied element below.
3154
2913
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
@@ -3158,7 +2917,10 @@ const DefaultAllowlist = {
3158
2917
  br: [],
3159
2918
  col: [],
3160
2919
  code: [],
2920
+ dd: [],
3161
2921
  div: [],
2922
+ dl: [],
2923
+ dt: [],
3162
2924
  em: [],
3163
2925
  hr: [],
3164
2926
  h1: [],
@@ -3182,6 +2944,30 @@ const DefaultAllowlist = {
3182
2944
  u: [],
3183
2945
  ul: []
3184
2946
  };
2947
+ // js-docs-end allow-list
2948
+
2949
+ const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
2950
+
2951
+ /**
2952
+ * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
2953
+ * contexts.
2954
+ *
2955
+ * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
2956
+ */
2957
+ // eslint-disable-next-line unicorn/better-regex
2958
+ const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;
2959
+ const allowedAttribute = (attribute, allowedAttributeList) => {
2960
+ const attributeName = attribute.nodeName.toLowerCase();
2961
+ if (allowedAttributeList.includes(attributeName)) {
2962
+ if (uriAttributes.has(attributeName)) {
2963
+ return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));
2964
+ }
2965
+ return true;
2966
+ }
2967
+
2968
+ // Check if a regular expression validates the attribute.
2969
+ return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
2970
+ };
3185
2971
  function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
3186
2972
  if (!unsafeHtml.length) {
3187
2973
  return unsafeHtml;
@@ -3211,7 +2997,7 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
3211
2997
 
3212
2998
  /**
3213
2999
  * --------------------------------------------------------------------------
3214
- * Bootstrap (v5.2.3): util/template-factory.js
3000
+ * Bootstrap util/template-factory.js
3215
3001
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3216
3002
  * --------------------------------------------------------------------------
3217
3003
  */
@@ -3221,8 +3007,8 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
3221
3007
  * Constants
3222
3008
  */
3223
3009
 
3224
- const NAME$6 = 'TemplateFactory';
3225
- const Default$5 = {
3010
+ const NAME$7 = 'TemplateFactory';
3011
+ const Default$6 = {
3226
3012
  allowList: DefaultAllowlist,
3227
3013
  content: {},
3228
3014
  // { selector : text , selector2 : text2 , }
@@ -3258,13 +3044,13 @@ class TemplateFactory extends Config {
3258
3044
 
3259
3045
  // Getters
3260
3046
  static get Default() {
3261
- return Default$5;
3047
+ return Default$6;
3262
3048
  }
3263
3049
  static get DefaultType() {
3264
3050
  return DefaultType$4;
3265
3051
  }
3266
3052
  static get NAME() {
3267
- return NAME$6;
3053
+ return NAME$7;
3268
3054
  }
3269
3055
 
3270
3056
  // Public
@@ -3319,8 +3105,8 @@ class TemplateFactory extends Config {
3319
3105
  templateElement.remove();
3320
3106
  return;
3321
3107
  }
3322
- if (isElement(content)) {
3323
- this._putElementInTemplate(getElement(content), templateElement);
3108
+ if (isElement$1(content)) {
3109
+ this._putElementInTemplate(getElement$1(content), templateElement);
3324
3110
  return;
3325
3111
  }
3326
3112
  if (this._config.html) {
@@ -3333,7 +3119,7 @@ class TemplateFactory extends Config {
3333
3119
  return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;
3334
3120
  }
3335
3121
  _resolvePossibleFunction(arg) {
3336
- return typeof arg === 'function' ? arg(this) : arg;
3122
+ return execute(arg, [this]);
3337
3123
  }
3338
3124
  _putElementInTemplate(element, templateElement) {
3339
3125
  if (this._config.html) {
@@ -3347,7 +3133,7 @@ class TemplateFactory extends Config {
3347
3133
 
3348
3134
  /**
3349
3135
  * --------------------------------------------------------------------------
3350
- * Bootstrap (v5.2.3): tooltip.js
3136
+ * Bootstrap tooltip.js
3351
3137
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3352
3138
  * --------------------------------------------------------------------------
3353
3139
  */
@@ -3357,14 +3143,14 @@ class TemplateFactory extends Config {
3357
3143
  * Constants
3358
3144
  */
3359
3145
 
3360
- const NAME$5 = 'tooltip';
3146
+ const NAME$6 = 'tooltip';
3361
3147
  const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
3362
3148
  const CLASS_NAME_FADE$2 = 'fade';
3363
3149
  const CLASS_NAME_MODAL = 'modal';
3364
3150
  const CLASS_NAME_SHOW$2 = 'show';
3365
3151
  const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
3366
3152
  const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
3367
- const EVENT_MODAL_HIDE = 'hide.bs.modal';
3153
+ const EVENT_MODAL_HIDE$1 = 'hide.bs.modal';
3368
3154
  const TRIGGER_HOVER = 'hover';
3369
3155
  const TRIGGER_FOCUS = 'focus';
3370
3156
  const TRIGGER_CLICK = 'click';
@@ -3386,7 +3172,7 @@ const AttachmentMap = {
3386
3172
  BOTTOM: 'bottom',
3387
3173
  LEFT: isRTL() ? 'right' : 'left'
3388
3174
  };
3389
- const Default$4 = {
3175
+ const Default$5 = {
3390
3176
  allowList: DefaultAllowlist,
3391
3177
  animation: true,
3392
3178
  boundary: 'clippingParents',
@@ -3395,7 +3181,7 @@ const Default$4 = {
3395
3181
  delay: 0,
3396
3182
  fallbackPlacements: ['top', 'right', 'bottom', 'left'],
3397
3183
  html: false,
3398
- offset: [0, 0],
3184
+ offset: [0, 6],
3399
3185
  placement: 'top',
3400
3186
  popperConfig: null,
3401
3187
  sanitize: true,
@@ -3455,13 +3241,13 @@ class Tooltip extends BaseComponent {
3455
3241
 
3456
3242
  // Getters
3457
3243
  static get Default() {
3458
- return Default$4;
3244
+ return Default$5;
3459
3245
  }
3460
3246
  static get DefaultType() {
3461
3247
  return DefaultType$3;
3462
3248
  }
3463
3249
  static get NAME() {
3464
- return NAME$5;
3250
+ return NAME$6;
3465
3251
  }
3466
3252
 
3467
3253
  // Public
@@ -3487,7 +3273,7 @@ class Tooltip extends BaseComponent {
3487
3273
  }
3488
3274
  dispose() {
3489
3275
  clearTimeout(this._timeout);
3490
- EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
3276
+ EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE$1, this._hideModalHandler);
3491
3277
  if (this._element.getAttribute('data-bs-original-title')) {
3492
3278
  this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));
3493
3279
  }
@@ -3508,7 +3294,7 @@ class Tooltip extends BaseComponent {
3508
3294
  return;
3509
3295
  }
3510
3296
 
3511
- // todo v6 remove this OR make it optional
3297
+ // TODO: v6 remove this or make it optional
3512
3298
  this._disposePopper();
3513
3299
  const tip = this._getTipElement();
3514
3300
  this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
@@ -3594,12 +3380,12 @@ class Tooltip extends BaseComponent {
3594
3380
  _createTipElement(content) {
3595
3381
  const tip = this._getTemplateFactory(content).toHtml();
3596
3382
 
3597
- // todo: remove this check on v6
3383
+ // TODO: remove this check in v6
3598
3384
  if (!tip) {
3599
3385
  return null;
3600
3386
  }
3601
3387
  tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
3602
- // todo: on v6 the following can be achieved with CSS only
3388
+ // TODO: v6 the following can be achieved with CSS only
3603
3389
  tip.classList.add(`bs-${this.constructor.NAME}-auto`);
3604
3390
  const tipId = getUID(this.constructor.NAME).toString();
3605
3391
  tip.setAttribute('id', tipId);
@@ -3649,7 +3435,7 @@ class Tooltip extends BaseComponent {
3649
3435
  return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2);
3650
3436
  }
3651
3437
  _createPopper(tip) {
3652
- const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
3438
+ const placement = execute(this._config.placement, [this, tip, this._element]);
3653
3439
  const attachment = AttachmentMap[placement.toUpperCase()];
3654
3440
  return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));
3655
3441
  }
@@ -3666,7 +3452,7 @@ class Tooltip extends BaseComponent {
3666
3452
  return offset;
3667
3453
  }
3668
3454
  _resolvePossibleFunction(arg) {
3669
- return typeof arg === 'function' ? arg.call(this._element) : arg;
3455
+ return execute(arg, [this._element]);
3670
3456
  }
3671
3457
  _getPopperConfig(attachment) {
3672
3458
  const defaultBsPopperConfig = {
@@ -3704,7 +3490,7 @@ class Tooltip extends BaseComponent {
3704
3490
  };
3705
3491
  return {
3706
3492
  ...defaultBsPopperConfig,
3707
- ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
3493
+ ...execute(this._config.popperConfig, [defaultBsPopperConfig])
3708
3494
  };
3709
3495
  }
3710
3496
  _setListeners() {
@@ -3735,7 +3521,7 @@ class Tooltip extends BaseComponent {
3735
3521
  this.hide();
3736
3522
  }
3737
3523
  };
3738
- EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
3524
+ EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE$1, this._hideModalHandler);
3739
3525
  }
3740
3526
  _fixTitle() {
3741
3527
  const title = this._element.getAttribute('title');
@@ -3795,7 +3581,7 @@ class Tooltip extends BaseComponent {
3795
3581
  return config;
3796
3582
  }
3797
3583
  _configAfterMerge(config) {
3798
- config.container = config.container === false ? document.body : getElement(config.container);
3584
+ config.container = config.container === false ? document.body : getElement$1(config.container);
3799
3585
  if (typeof config.delay === 'number') {
3800
3586
  config.delay = {
3801
3587
  show: config.delay,
@@ -3812,9 +3598,9 @@ class Tooltip extends BaseComponent {
3812
3598
  }
3813
3599
  _getDelegateConfig() {
3814
3600
  const config = {};
3815
- for (const key in this._config) {
3816
- if (this.constructor.Default[key] !== this._config[key]) {
3817
- config[key] = this._config[key];
3601
+ for (const [key, value] of Object.entries(this._config)) {
3602
+ if (this.constructor.Default[key] !== value) {
3603
+ config[key] = value;
3818
3604
  }
3819
3605
  }
3820
3606
  config.selector = false;
@@ -3855,11 +3641,11 @@ class Tooltip extends BaseComponent {
3855
3641
  * jQuery
3856
3642
  */
3857
3643
 
3858
- defineJQueryPlugin(Tooltip);
3644
+ defineJQueryPlugin$1(Tooltip);
3859
3645
 
3860
3646
  /**
3861
3647
  * --------------------------------------------------------------------------
3862
- * Bootstrap (v5.2.3): popover.js
3648
+ * Bootstrap popover.js
3863
3649
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3864
3650
  * --------------------------------------------------------------------------
3865
3651
  */
@@ -3869,10 +3655,10 @@ defineJQueryPlugin(Tooltip);
3869
3655
  * Constants
3870
3656
  */
3871
3657
 
3872
- const NAME$4 = 'popover';
3658
+ const NAME$5 = 'popover';
3873
3659
  const SELECTOR_TITLE = '.popover-header';
3874
3660
  const SELECTOR_CONTENT = '.popover-body';
3875
- const Default$3 = {
3661
+ const Default$4 = {
3876
3662
  ...Tooltip.Default,
3877
3663
  content: '',
3878
3664
  offset: [0, 8],
@@ -3892,13 +3678,13 @@ const DefaultType$2 = {
3892
3678
  class Popover extends Tooltip {
3893
3679
  // Getters
3894
3680
  static get Default() {
3895
- return Default$3;
3681
+ return Default$4;
3896
3682
  }
3897
3683
  static get DefaultType() {
3898
3684
  return DefaultType$2;
3899
3685
  }
3900
3686
  static get NAME() {
3901
- return NAME$4;
3687
+ return NAME$5;
3902
3688
  }
3903
3689
 
3904
3690
  // Overrides
@@ -3936,11 +3722,11 @@ class Popover extends Tooltip {
3936
3722
  * jQuery
3937
3723
  */
3938
3724
 
3939
- defineJQueryPlugin(Popover);
3725
+ defineJQueryPlugin$1(Popover);
3940
3726
 
3941
3727
  /**
3942
3728
  * --------------------------------------------------------------------------
3943
- * Bootstrap (v5.2.3): scrollspy.js
3729
+ * Bootstrap scrollspy.js
3944
3730
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3945
3731
  * --------------------------------------------------------------------------
3946
3732
  */
@@ -3950,13 +3736,13 @@ defineJQueryPlugin(Popover);
3950
3736
  * Constants
3951
3737
  */
3952
3738
 
3953
- const NAME$3 = 'scrollspy';
3954
- const DATA_KEY$3 = 'bs.scrollspy';
3955
- const EVENT_KEY$3 = `.${DATA_KEY$3}`;
3956
- const DATA_API_KEY$1 = '.data-api';
3957
- const EVENT_ACTIVATE$1 = `activate${EVENT_KEY$3}`;
3958
- const EVENT_CLICK = `click${EVENT_KEY$3}`;
3959
- const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`;
3739
+ const NAME$4 = 'scrollspy';
3740
+ const DATA_KEY$4 = 'bs.scrollspy';
3741
+ const EVENT_KEY$4 = `.${DATA_KEY$4}`;
3742
+ const DATA_API_KEY$2 = '.data-api';
3743
+ const EVENT_ACTIVATE$1 = `activate${EVENT_KEY$4}`;
3744
+ const EVENT_CLICK = `click${EVENT_KEY$4}`;
3745
+ const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$4}${DATA_API_KEY$2}`;
3960
3746
  const CLASS_NAME_DROPDOWN_ITEM$1 = 'dropdown-item';
3961
3747
  const CLASS_NAME_ACTIVE$2 = 'active';
3962
3748
  const SELECTOR_DATA_SPY$1 = '[data-bs-spy="scroll"]';
@@ -3968,7 +3754,7 @@ const SELECTOR_LIST_ITEMS$1 = '.list-group-item';
3968
3754
  const SELECTOR_LINK_ITEMS$1 = `${SELECTOR_NAV_LINKS$1}, ${SELECTOR_NAV_ITEMS$1} > ${SELECTOR_NAV_LINKS$1}, ${SELECTOR_LIST_ITEMS$1}`;
3969
3755
  const SELECTOR_DROPDOWN$1 = '.dropdown';
3970
3756
  const SELECTOR_DROPDOWN_TOGGLE$2 = '.dropdown-toggle';
3971
- const Default$2 = {
3757
+ const Default$3 = {
3972
3758
  offset: null,
3973
3759
  // TODO: v6 @deprecated, keep it for backwards compatibility reasons
3974
3760
  rootMargin: '0px 0px -25%',
@@ -4008,13 +3794,13 @@ let ScrollSpy$1 = class ScrollSpy extends BaseComponent {
4008
3794
 
4009
3795
  // Getters
4010
3796
  static get Default() {
4011
- return Default$2;
3797
+ return Default$3;
4012
3798
  }
4013
3799
  static get DefaultType() {
4014
3800
  return DefaultType$1;
4015
3801
  }
4016
3802
  static get NAME() {
4017
- return NAME$3;
3803
+ return NAME$4;
4018
3804
  }
4019
3805
 
4020
3806
  // Public
@@ -4038,7 +3824,7 @@ let ScrollSpy$1 = class ScrollSpy extends BaseComponent {
4038
3824
  // Private
4039
3825
  _configAfterMerge(config) {
4040
3826
  // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case
4041
- config.target = getElement(config.target) || document.body;
3827
+ config.target = getElement$1(config.target) || document.body;
4042
3828
 
4043
3829
  // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only
4044
3830
  config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;
@@ -4124,11 +3910,11 @@ let ScrollSpy$1 = class ScrollSpy extends BaseComponent {
4124
3910
  if (!anchor.hash || isDisabled(anchor)) {
4125
3911
  continue;
4126
3912
  }
4127
- const observableSection = SelectorEngine.findOne(anchor.hash, this._element);
3913
+ const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);
4128
3914
 
4129
3915
  // ensure that the observableSection exists & is visible
4130
3916
  if (isVisible(observableSection)) {
4131
- this._targetLinks.set(anchor.hash, anchor);
3917
+ this._targetLinks.set(decodeURI(anchor.hash), anchor);
4132
3918
  this._observableSections.set(anchor.hash, observableSection);
4133
3919
  }
4134
3920
  }
@@ -4196,7 +3982,7 @@ EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {
4196
3982
  * jQuery
4197
3983
  */
4198
3984
 
4199
- defineJQueryPlugin(ScrollSpy$1);
3985
+ defineJQueryPlugin$1(ScrollSpy$1);
4200
3986
 
4201
3987
  /**
4202
3988
  * --------------------------------------------------------------------------
@@ -4260,6 +4046,99 @@ const Manipulator = {
4260
4046
  }
4261
4047
  };
4262
4048
 
4049
+ /**
4050
+ * --------------------------------------------------------------------------
4051
+ * Bootstrap (v5.2.3): util/index.js
4052
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4053
+ * --------------------------------------------------------------------------
4054
+ */
4055
+
4056
+ const getSelector = element => {
4057
+ let selector = element.getAttribute('data-bs-target');
4058
+ if (!selector || selector === '#') {
4059
+ let hrefAttribute = element.getAttribute('href');
4060
+
4061
+ // The only valid content that could double as a selector are IDs or classes,
4062
+ // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
4063
+ // `document.querySelector` will rightfully complain it is invalid.
4064
+ // See https://github.com/twbs/bootstrap/issues/32273
4065
+ if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
4066
+ return null;
4067
+ }
4068
+
4069
+ // Just in case some CMS puts out a full URL with the anchor appended
4070
+ if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
4071
+ hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
4072
+ }
4073
+ selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
4074
+ }
4075
+ return selector;
4076
+ };
4077
+ const getSelectorFromElement = element => {
4078
+ const selector = getSelector(element);
4079
+ if (selector) {
4080
+ return document.querySelector(selector) ? selector : null;
4081
+ }
4082
+ return null;
4083
+ };
4084
+ const isElement = object => {
4085
+ if (!object || typeof object !== 'object') {
4086
+ return false;
4087
+ }
4088
+ if (typeof object.jquery !== 'undefined') {
4089
+ object = object[0];
4090
+ }
4091
+ return typeof object.nodeType !== 'undefined';
4092
+ };
4093
+ const getElement = object => {
4094
+ // it's a jQuery object or a node element
4095
+ if (isElement(object)) {
4096
+ return object.jquery ? object[0] : object;
4097
+ }
4098
+ if (typeof object === 'string' && object.length > 0) {
4099
+ return document.querySelector(object);
4100
+ }
4101
+ return null;
4102
+ };
4103
+ const getjQuery = () => {
4104
+ if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
4105
+ return window.jQuery;
4106
+ }
4107
+ return null;
4108
+ };
4109
+ const DOMContentLoadedCallbacks = [];
4110
+ const onDOMContentLoaded = callback => {
4111
+ if (document.readyState === 'loading') {
4112
+ // add listener on the first call when the document is in loading state
4113
+ if (!DOMContentLoadedCallbacks.length) {
4114
+ document.addEventListener('DOMContentLoaded', () => {
4115
+ for (const callback of DOMContentLoadedCallbacks) {
4116
+ callback();
4117
+ }
4118
+ });
4119
+ }
4120
+ DOMContentLoadedCallbacks.push(callback);
4121
+ } else {
4122
+ callback();
4123
+ }
4124
+ };
4125
+ const defineJQueryPlugin = plugin => {
4126
+ onDOMContentLoaded(() => {
4127
+ const $ = getjQuery();
4128
+ /* istanbul ignore if */
4129
+ if ($) {
4130
+ const name = plugin.NAME;
4131
+ const JQUERY_NO_CONFLICT = $.fn[name];
4132
+ $.fn[name] = plugin.jQueryInterface;
4133
+ $.fn[name].Constructor = plugin;
4134
+ $.fn[name].noConflict = () => {
4135
+ $.fn[name] = JQUERY_NO_CONFLICT;
4136
+ return plugin.jQueryInterface;
4137
+ };
4138
+ }
4139
+ });
4140
+ };
4141
+
4263
4142
  /**
4264
4143
  * --------------------------------------------------------------------------
4265
4144
  * Bootstrap (v5.1.3): scrollspy.js
@@ -4274,18 +4153,18 @@ const Manipulator = {
4274
4153
  * ------------------------------------------------------------------------
4275
4154
  */
4276
4155
 
4277
- const NAME$2 = 'scrollspy';
4278
- const DATA_KEY$2 = 'bs.scrollspy';
4279
- const EVENT_KEY$2 = `.${DATA_KEY$2}`;
4280
- const DATA_API_KEY = '.data-api';
4281
- const Default$1 = {
4156
+ const NAME$3 = 'scrollspy';
4157
+ const DATA_KEY$3 = 'bs.scrollspy';
4158
+ const EVENT_KEY$3 = `.${DATA_KEY$3}`;
4159
+ const DATA_API_KEY$1 = '.data-api';
4160
+ const Default$2 = {
4282
4161
  offset: 10,
4283
4162
  method: 'auto',
4284
4163
  target: ''
4285
4164
  };
4286
- const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;
4287
- const EVENT_SCROLL = `scroll${EVENT_KEY$2}`;
4288
- const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`;
4165
+ const EVENT_ACTIVATE = `activate${EVENT_KEY$3}`;
4166
+ const EVENT_SCROLL = `scroll${EVENT_KEY$3}`;
4167
+ const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`;
4289
4168
  const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
4290
4169
  const CLASS_NAME_ACTIVE$1 = 'active';
4291
4170
  const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]';
@@ -4322,10 +4201,10 @@ class ScrollSpy extends BaseComponent {
4322
4201
  // Getters
4323
4202
 
4324
4203
  static get Default() {
4325
- return Default$1;
4204
+ return Default$2;
4326
4205
  }
4327
4206
  static get NAME() {
4328
- return NAME$2;
4207
+ return NAME$3;
4329
4208
  }
4330
4209
 
4331
4210
  // Public
@@ -4354,7 +4233,7 @@ class ScrollSpy extends BaseComponent {
4354
4233
  });
4355
4234
  }
4356
4235
  dispose() {
4357
- EventHandler.off(this._scrollElement, EVENT_KEY$2);
4236
+ EventHandler.off(this._scrollElement, EVENT_KEY$3);
4358
4237
  super.dispose();
4359
4238
  }
4360
4239
 
@@ -4362,7 +4241,7 @@ class ScrollSpy extends BaseComponent {
4362
4241
 
4363
4242
  _getConfig(config) {
4364
4243
  config = {
4365
- ...Default$1,
4244
+ ...Default$2,
4366
4245
  ...Manipulator.getDataAttributes(this._element),
4367
4246
  ...(typeof config === 'object' && config ? config : {})
4368
4247
  };
@@ -4469,7 +4348,7 @@ defineJQueryPlugin(ScrollSpy);
4469
4348
 
4470
4349
  /**
4471
4350
  * --------------------------------------------------------------------------
4472
- * Bootstrap (v5.2.3): tab.js
4351
+ * Bootstrap tab.js
4473
4352
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4474
4353
  * --------------------------------------------------------------------------
4475
4354
  */
@@ -4479,31 +4358,33 @@ defineJQueryPlugin(ScrollSpy);
4479
4358
  * Constants
4480
4359
  */
4481
4360
 
4482
- const NAME$1 = 'tab';
4483
- const DATA_KEY$1 = 'bs.tab';
4484
- const EVENT_KEY$1 = `.${DATA_KEY$1}`;
4485
- const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`;
4486
- const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`;
4487
- const EVENT_SHOW$1 = `show${EVENT_KEY$1}`;
4488
- const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`;
4489
- const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}`;
4490
- const EVENT_KEYDOWN = `keydown${EVENT_KEY$1}`;
4491
- const EVENT_LOAD_DATA_API = `load${EVENT_KEY$1}`;
4361
+ const NAME$2 = 'tab';
4362
+ const DATA_KEY$2 = 'bs.tab';
4363
+ const EVENT_KEY$2 = `.${DATA_KEY$2}`;
4364
+ const EVENT_HIDE$1 = `hide${EVENT_KEY$2}`;
4365
+ const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$2}`;
4366
+ const EVENT_SHOW$1 = `show${EVENT_KEY$2}`;
4367
+ const EVENT_SHOWN$1 = `shown${EVENT_KEY$2}`;
4368
+ const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$2}`;
4369
+ const EVENT_KEYDOWN = `keydown${EVENT_KEY$2}`;
4370
+ const EVENT_LOAD_DATA_API = `load${EVENT_KEY$2}`;
4492
4371
  const ARROW_LEFT_KEY = 'ArrowLeft';
4493
4372
  const ARROW_RIGHT_KEY = 'ArrowRight';
4494
4373
  const ARROW_UP_KEY = 'ArrowUp';
4495
4374
  const ARROW_DOWN_KEY = 'ArrowDown';
4375
+ const HOME_KEY = 'Home';
4376
+ const END_KEY = 'End';
4496
4377
  const CLASS_NAME_ACTIVE = 'active';
4497
4378
  const CLASS_NAME_FADE$1 = 'fade';
4498
4379
  const CLASS_NAME_SHOW$1 = 'show';
4499
4380
  const CLASS_DROPDOWN = 'dropdown';
4500
4381
  const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
4501
4382
  const SELECTOR_DROPDOWN_MENU = '.dropdown-menu';
4502
- const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)';
4383
+ const NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`;
4503
4384
  const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
4504
4385
  const SELECTOR_OUTER = '.nav-item, .list-group-item';
4505
4386
  const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
4506
- const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // todo:v6: could be only `tab`
4387
+ const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6
4507
4388
  const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
4508
4389
  const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;
4509
4390
 
@@ -4517,7 +4398,7 @@ class Tab extends BaseComponent {
4517
4398
  this._parent = this._element.closest(SELECTOR_TAB_PANEL);
4518
4399
  if (!this._parent) {
4519
4400
  return;
4520
- // todo: should Throw exception on v6
4401
+ // TODO: should throw exception in v6
4521
4402
  // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
4522
4403
  }
4523
4404
 
@@ -4528,7 +4409,7 @@ class Tab extends BaseComponent {
4528
4409
 
4529
4410
  // Getters
4530
4411
  static get NAME() {
4531
- return NAME$1;
4412
+ return NAME$2;
4532
4413
  }
4533
4414
 
4534
4415
  // Public
@@ -4560,7 +4441,7 @@ class Tab extends BaseComponent {
4560
4441
  return;
4561
4442
  }
4562
4443
  element.classList.add(CLASS_NAME_ACTIVE);
4563
- this._activate(getElementFromSelector(element)); // Search and activate/show the proper section
4444
+ this._activate(SelectorEngine.getElementFromSelector(element)); // Search and activate/show the proper section
4564
4445
 
4565
4446
  const complete = () => {
4566
4447
  if (element.getAttribute('role') !== 'tab') {
@@ -4582,7 +4463,7 @@ class Tab extends BaseComponent {
4582
4463
  }
4583
4464
  element.classList.remove(CLASS_NAME_ACTIVE);
4584
4465
  element.blur();
4585
- this._deactivate(getElementFromSelector(element)); // Search and deactivate the shown section too
4466
+ this._deactivate(SelectorEngine.getElementFromSelector(element)); // Search and deactivate the shown section too
4586
4467
 
4587
4468
  const complete = () => {
4588
4469
  if (element.getAttribute('role') !== 'tab') {
@@ -4599,13 +4480,19 @@ class Tab extends BaseComponent {
4599
4480
  this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));
4600
4481
  }
4601
4482
  _keydown(event) {
4602
- if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)) {
4483
+ if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) {
4603
4484
  return;
4604
4485
  }
4605
4486
  event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page
4606
4487
  event.preventDefault();
4607
- const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
4608
- const nextActiveElement = getNextActiveElement(this._getChildren().filter(element => !isDisabled(element)), event.target, isNext, true);
4488
+ const children = this._getChildren().filter(element => !isDisabled(element));
4489
+ let nextActiveElement;
4490
+ if ([HOME_KEY, END_KEY].includes(event.key)) {
4491
+ nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1];
4492
+ } else {
4493
+ const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
4494
+ nextActiveElement = getNextActiveElement(children, event.target, isNext, true);
4495
+ }
4609
4496
  if (nextActiveElement) {
4610
4497
  nextActiveElement.focus({
4611
4498
  preventScroll: true
@@ -4643,13 +4530,13 @@ class Tab extends BaseComponent {
4643
4530
  this._setInitialAttributesOnTargetPanel(child);
4644
4531
  }
4645
4532
  _setInitialAttributesOnTargetPanel(child) {
4646
- const target = getElementFromSelector(child);
4533
+ const target = SelectorEngine.getElementFromSelector(child);
4647
4534
  if (!target) {
4648
4535
  return;
4649
4536
  }
4650
4537
  this._setAttributeIfNotExists(target, 'role', 'tabpanel');
4651
4538
  if (child.id) {
4652
- this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`);
4539
+ this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
4653
4540
  }
4654
4541
  }
4655
4542
  _toggleDropDown(element, open) {
@@ -4705,7 +4592,7 @@ class Tab extends BaseComponent {
4705
4592
  * Data API implementation
4706
4593
  */
4707
4594
 
4708
- EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
4595
+ EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE, function (event) {
4709
4596
  if (['A', 'AREA'].includes(this.tagName)) {
4710
4597
  event.preventDefault();
4711
4598
  }
@@ -4727,11 +4614,11 @@ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
4727
4614
  * jQuery
4728
4615
  */
4729
4616
 
4730
- defineJQueryPlugin(Tab);
4617
+ defineJQueryPlugin$1(Tab);
4731
4618
 
4732
4619
  /**
4733
4620
  * --------------------------------------------------------------------------
4734
- * Bootstrap (v5.2.3): toast.js
4621
+ * Bootstrap toast.js
4735
4622
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4736
4623
  * --------------------------------------------------------------------------
4737
4624
  */
@@ -4741,17 +4628,17 @@ defineJQueryPlugin(Tab);
4741
4628
  * Constants
4742
4629
  */
4743
4630
 
4744
- const NAME = 'toast';
4745
- const DATA_KEY = 'bs.toast';
4746
- const EVENT_KEY = `.${DATA_KEY}`;
4747
- const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
4748
- const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
4749
- const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
4750
- const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
4751
- const EVENT_HIDE = `hide${EVENT_KEY}`;
4752
- const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
4753
- const EVENT_SHOW = `show${EVENT_KEY}`;
4754
- const EVENT_SHOWN = `shown${EVENT_KEY}`;
4631
+ const NAME$1 = 'toast';
4632
+ const DATA_KEY$1 = 'bs.toast';
4633
+ const EVENT_KEY$1 = `.${DATA_KEY$1}`;
4634
+ const EVENT_MOUSEOVER = `mouseover${EVENT_KEY$1}`;
4635
+ const EVENT_MOUSEOUT = `mouseout${EVENT_KEY$1}`;
4636
+ const EVENT_FOCUSIN = `focusin${EVENT_KEY$1}`;
4637
+ const EVENT_FOCUSOUT = `focusout${EVENT_KEY$1}`;
4638
+ const EVENT_HIDE = `hide${EVENT_KEY$1}`;
4639
+ const EVENT_HIDDEN = `hidden${EVENT_KEY$1}`;
4640
+ const EVENT_SHOW = `show${EVENT_KEY$1}`;
4641
+ const EVENT_SHOWN = `shown${EVENT_KEY$1}`;
4755
4642
  const CLASS_NAME_FADE = 'fade';
4756
4643
  const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
4757
4644
  const CLASS_NAME_SHOW = 'show';
@@ -4761,7 +4648,7 @@ const DefaultType = {
4761
4648
  autohide: 'boolean',
4762
4649
  delay: 'number'
4763
4650
  };
4764
- const Default = {
4651
+ const Default$1 = {
4765
4652
  animation: true,
4766
4653
  autohide: true,
4767
4654
  delay: 5000
@@ -4782,13 +4669,13 @@ class Toast extends BaseComponent {
4782
4669
 
4783
4670
  // Getters
4784
4671
  static get Default() {
4785
- return Default;
4672
+ return Default$1;
4786
4673
  }
4787
4674
  static get DefaultType() {
4788
4675
  return DefaultType;
4789
4676
  }
4790
4677
  static get NAME() {
4791
- return NAME;
4678
+ return NAME$1;
4792
4679
  }
4793
4680
 
4794
4681
  // Public
@@ -4911,7 +4798,223 @@ enableDismissTrigger(Toast);
4911
4798
  * jQuery
4912
4799
  */
4913
4800
 
4914
- defineJQueryPlugin(Toast);
4801
+ defineJQueryPlugin$1(Toast);
4802
+
4803
+ /**
4804
+ * --------------------------------------------------------------------------
4805
+ * Bootstrap (v5.1.3): gallery.js
4806
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4807
+ * --------------------------------------------------------------------------
4808
+ */
4809
+
4810
+
4811
+ /**
4812
+ * ------------------------------------------------------------------------
4813
+ * Constants
4814
+ * ------------------------------------------------------------------------
4815
+ */
4816
+
4817
+ const Default = {};
4818
+ const NAME = 'gallery';
4819
+ const DATA_KEY = 'bs.gallery';
4820
+ const EVENT_KEY = `.${DATA_KEY}`;
4821
+ const DATA_API_KEY = '.data-api';
4822
+ const CAROUSEL_SELECTOR = '.carousel';
4823
+ const CAROUSEL_PAGER_SELECTOR = '.carousel-pager span';
4824
+ const CAROUSEL_ACTIVE_SELECTOR = '.carousel-item.active';
4825
+ const CAROUSEL_ITEM_SELECTOR = '.carousel-item';
4826
+ const THUMBNAIL_SELECTOR = '.bcl-gallery__grid a, .bcl-gallery__mobile-view-more';
4827
+ const MODAL_SELECTOR = '.modal';
4828
+ const EVENT_MODAL_HIDE = 'hide.bs.modal';
4829
+ const CAROUSEL_EVENT = 'slide.bs.carousel';
4830
+ const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
4831
+
4832
+ /**
4833
+ * ------------------------------------------------------------------------
4834
+ * Class Definition
4835
+ * ------------------------------------------------------------------------
4836
+ */
4837
+
4838
+ class Gallery extends BaseComponent {
4839
+ constructor(element, config) {
4840
+ super(element, config);
4841
+ /* eslint no-underscore-dangle: ["error", { "allow": ["_element"] }] */
4842
+ this.carousel = SelectorEngine.findOne(CAROUSEL_SELECTOR, this._element);
4843
+ this.carouselPager = SelectorEngine.findOne(CAROUSEL_PAGER_SELECTOR, this._element);
4844
+ this.carouselStartIndex = element.getAttribute('data-gallery-start');
4845
+ this.carouselActiveItem = SelectorEngine.find(CAROUSEL_ITEM_SELECTOR, this.carousel)[this.carouselStartIndex];
4846
+ this.carouselPager.textContent = Number(this.carouselStartIndex) + 1;
4847
+ this.modal = SelectorEngine.findOne(MODAL_SELECTOR, this._element);
4848
+ this.addEventListeners();
4849
+ this.carouselLazyLoad(this.carouselActiveItem);
4850
+ }
4851
+
4852
+ // Getters
4853
+ static get NAME() {
4854
+ return NAME;
4855
+ }
4856
+
4857
+ // Public
4858
+ setSlide(event) {
4859
+ const slideFrom = SelectorEngine.findOne(CAROUSEL_ACTIVE_SELECTOR, this.carousel);
4860
+ const slideTo = event.relatedTarget;
4861
+ this.carouselLazyLoad(slideTo);
4862
+ this.carouselPager.textContent = event.to + 1;
4863
+ this.stopVideo(slideFrom);
4864
+ }
4865
+ stopSlide() {
4866
+ const currentSlide = SelectorEngine.findOne(CAROUSEL_ACTIVE_SELECTOR, this.carousel);
4867
+ this.stopVideo(currentSlide);
4868
+ }
4869
+ stopVideo(slide) {
4870
+ const iframe = SelectorEngine.findOne('iframe', slide);
4871
+ const video = SelectorEngine.findOne('video', slide);
4872
+ if (iframe) {
4873
+ iframe.src = iframe.dataset.src;
4874
+ } else if (video) {
4875
+ video.pause();
4876
+ }
4877
+ }
4878
+
4879
+ // Private
4880
+ carouselLazyLoad(slide) {
4881
+ const media = SelectorEngine.findOne('[data-src]', slide);
4882
+ if (media && !media.src) {
4883
+ media.src = media.dataset.src;
4884
+ }
4885
+ }
4886
+ addEventListeners() {
4887
+ EventHandler.on(this.carousel, CAROUSEL_EVENT, event => this.setSlide(event));
4888
+ EventHandler.on(this.modal, EVENT_MODAL_HIDE, event => this.stopSlide(event));
4889
+ }
4890
+
4891
+ // Static
4892
+ static get Default() {
4893
+ return Default;
4894
+ }
4895
+ static jQueryInterface(config) {
4896
+ return this.each(function jInterface() {
4897
+ const data = Gallery.getOrCreateInstance(this);
4898
+ if (typeof config !== 'string') {
4899
+ return;
4900
+ }
4901
+ if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
4902
+ throw new TypeError(`No method named "${config}"`);
4903
+ }
4904
+ data[config](this);
4905
+ });
4906
+ }
4907
+ }
4908
+
4909
+ /**
4910
+ * ------------------------------------------------------------------------
4911
+ * Data Api implementation
4912
+ * ------------------------------------------------------------------------
4913
+ */
4914
+
4915
+ EventHandler.on(document, EVENT_CLICK_DATA_API, THUMBNAIL_SELECTOR, event => {
4916
+ const gallery = event.target.closest('div.bcl-gallery');
4917
+ const firstSlide = event.target.parentNode.getAttribute('data-bs-slide-to');
4918
+ gallery.dataset.galleryStart = firstSlide;
4919
+ Gallery.getOrCreateInstance(gallery);
4920
+ });
4921
+
4922
+ /**
4923
+ * ------------------------------------------------------------------------
4924
+ * jQuery
4925
+ * ------------------------------------------------------------------------
4926
+ * add .gallery to jQuery only if jQuery is present
4927
+ */
4928
+
4929
+ defineJQueryPlugin$1(Gallery);
4930
+
4931
+ class AccordionToggle {
4932
+ static isInitialized = false;
4933
+ constructor(buttonElement) {
4934
+ this.buttonElement = buttonElement;
4935
+ this.targetAccordionId = buttonElement.getAttribute("data-target");
4936
+ this.action = buttonElement.getAttribute("data-action");
4937
+ this.accordionElement = SelectorEngine.findOne(`#${this.targetAccordionId}`);
4938
+ this.accordionItems = SelectorEngine.find(".accordion-collapse", this.accordionElement);
4939
+ this.addEventListeners();
4940
+ }
4941
+ addEventListeners() {
4942
+ EventHandler.on(this.buttonElement, "click", event => this.handleAccordionAction(event));
4943
+ }
4944
+ handleAccordionAction(event) {
4945
+ const item = event.target;
4946
+ const action = item.getAttribute('data-action');
4947
+ const accordionItems = this.accordionItems;
4948
+ accordionItems.forEach(accordionItem => {
4949
+ const collapseInstance = Collapse.getOrCreateInstance(accordionItem, {
4950
+ toggle: false
4951
+ });
4952
+ if (action === 'expand') {
4953
+ collapseInstance.show();
4954
+ } else if (action === 'collapse') {
4955
+ collapseInstance.hide();
4956
+ }
4957
+ });
4958
+ }
4959
+ static init() {
4960
+ if (AccordionToggle.isInitialized) {
4961
+ return;
4962
+ }
4963
+ const toggleButtons = SelectorEngine.find('[data-action][data-target]');
4964
+ toggleButtons.forEach(buttonElement => new AccordionToggle(buttonElement));
4965
+ AccordionToggle.isInitialized = true;
4966
+ }
4967
+ }
4968
+
4969
+ /**
4970
+ * AccessibleToggle enhances Bootstrap Modal and Offcanvas components by:
4971
+ * - Adding ARIA attributes for improved accessibility.
4972
+ * - Updating `aria-expanded` on trigger elements based on visibility.
4973
+ * Automatically initializes all modal and offcanvas triggers on the page.
4974
+ */
4975
+ class AccessibleToggle {
4976
+ constructor(triggerElement, type) {
4977
+ this.triggerElement = triggerElement;
4978
+ this.type = type;
4979
+ const target = triggerElement.getAttribute("data-bs-target") || triggerElement.getAttribute("href");
4980
+ if (!target || target === "#") {
4981
+ return;
4982
+ }
4983
+ this.targetElement = SelectorEngine.findOne(target);
4984
+ if (!this.targetElement) {
4985
+ return;
4986
+ }
4987
+ if (this.type === "modal") {
4988
+ this.instance = Modal.getOrCreateInstance(this.targetElement);
4989
+ } else if (this.type === "offcanvas") {
4990
+ this.instance = Offcanvas.getOrCreateInstance(this.targetElement);
4991
+ }
4992
+ this.addAriaAttributes();
4993
+ this.addEventListeners();
4994
+ }
4995
+ addAriaAttributes() {
4996
+ if (this.triggerElement) {
4997
+ this.triggerElement.setAttribute("aria-haspopup", "true");
4998
+ this.triggerElement.setAttribute("aria-expanded", "false");
4999
+ }
5000
+ }
5001
+ addEventListeners() {
5002
+ const showEvent = this.type === "modal" ? "show.bs.modal" : "show.bs.offcanvas";
5003
+ const hideEvent = this.type === "modal" ? "hide.bs.modal" : "hide.bs.offcanvas";
5004
+ EventHandler.on(this.targetElement, showEvent, () => {
5005
+ this.triggerElement.setAttribute("aria-expanded", "true");
5006
+ });
5007
+ EventHandler.on(this.targetElement, hideEvent, () => {
5008
+ this.triggerElement.setAttribute("aria-expanded", "false");
5009
+ });
5010
+ }
5011
+ static init(toggles) {
5012
+ toggles.forEach(toggle => {
5013
+ const triggerElements = SelectorEngine.find(toggle.selector);
5014
+ triggerElements.forEach(triggerElement => new AccessibleToggle(triggerElement, toggle.type));
5015
+ });
5016
+ }
5017
+ }
4915
5018
 
4916
5019
  export { AccessibleToggle, AccordionToggle, Alert, Button, Carousel, Collapse, Dropdown, Gallery, Modal, Offcanvas, Popover, ScrollSpy, ScrollSpy$1 as ScrollSpyV2, Tab, Toast, Tooltip };
4917
5020
  //# sourceMappingURL=oe-bcl-default.esm.js.map