UNPKG

208 kBJavaScriptView Raw
1/*!
2 * Bootstrap v5.0.1 (https://getbootstrap.com/)
3 * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 */
6(function (global, factory) {
7 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8 typeof define === 'function' && define.amd ? define(factory) :
9 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory());
10}(this, (function () { 'use strict';
11
12 /**
13 * --------------------------------------------------------------------------
14 * Bootstrap (v5.0.1): dom/selector-engine.js
15 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16 * --------------------------------------------------------------------------
17 */
18
19 /**
20 * ------------------------------------------------------------------------
21 * Constants
22 * ------------------------------------------------------------------------
23 */
24 const NODE_TEXT = 3;
25 const SelectorEngine = {
26 find(selector, element = document.documentElement) {
27 return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
28 },
29
30 findOne(selector, element = document.documentElement) {
31 return Element.prototype.querySelector.call(element, selector);
32 },
33
34 children(element, selector) {
35 return [].concat(...element.children).filter(child => child.matches(selector));
36 },
37
38 parents(element, selector) {
39 const parents = [];
40 let ancestor = element.parentNode;
41
42 while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
43 if (ancestor.matches(selector)) {
44 parents.push(ancestor);
45 }
46
47 ancestor = ancestor.parentNode;
48 }
49
50 return parents;
51 },
52
53 prev(element, selector) {
54 let previous = element.previousElementSibling;
55
56 while (previous) {
57 if (previous.matches(selector)) {
58 return [previous];
59 }
60
61 previous = previous.previousElementSibling;
62 }
63
64 return [];
65 },
66
67 next(element, selector) {
68 let next = element.nextElementSibling;
69
70 while (next) {
71 if (next.matches(selector)) {
72 return [next];
73 }
74
75 next = next.nextElementSibling;
76 }
77
78 return [];
79 }
80
81 };
82
83 /**
84 * --------------------------------------------------------------------------
85 * Bootstrap (v5.0.1): util/index.js
86 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
87 * --------------------------------------------------------------------------
88 */
89
90 const MAX_UID = 1000000;
91 const MILLISECONDS_MULTIPLIER = 1000;
92 const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
93
94 const toType = obj => {
95 if (obj === null || obj === undefined) {
96 return `${obj}`;
97 }
98
99 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
100 };
101 /**
102 * --------------------------------------------------------------------------
103 * Public Util Api
104 * --------------------------------------------------------------------------
105 */
106
107
108 const getUID = prefix => {
109 do {
110 prefix += Math.floor(Math.random() * MAX_UID);
111 } while (document.getElementById(prefix));
112
113 return prefix;
114 };
115
116 const getSelector = element => {
117 let selector = element.getAttribute('data-bs-target');
118
119 if (!selector || selector === '#') {
120 let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
121 // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
122 // `document.querySelector` will rightfully complain it is invalid.
123 // See https://github.com/twbs/bootstrap/issues/32273
124
125 if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
126 return null;
127 } // Just in case some CMS puts out a full URL with the anchor appended
128
129
130 if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
131 hrefAttr = `#${hrefAttr.split('#')[1]}`;
132 }
133
134 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
135 }
136
137 return selector;
138 };
139
140 const getSelectorFromElement = element => {
141 const selector = getSelector(element);
142
143 if (selector) {
144 return document.querySelector(selector) ? selector : null;
145 }
146
147 return null;
148 };
149
150 const getElementFromSelector = element => {
151 const selector = getSelector(element);
152 return selector ? document.querySelector(selector) : null;
153 };
154
155 const getTransitionDurationFromElement = element => {
156 if (!element) {
157 return 0;
158 } // Get transition-duration of the element
159
160
161 let {
162 transitionDuration,
163 transitionDelay
164 } = window.getComputedStyle(element);
165 const floatTransitionDuration = Number.parseFloat(transitionDuration);
166 const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
167
168 if (!floatTransitionDuration && !floatTransitionDelay) {
169 return 0;
170 } // If multiple durations are defined, take the first
171
172
173 transitionDuration = transitionDuration.split(',')[0];
174 transitionDelay = transitionDelay.split(',')[0];
175 return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
176 };
177
178 const triggerTransitionEnd = element => {
179 element.dispatchEvent(new Event(TRANSITION_END));
180 };
181
182 const isElement$1 = obj => {
183 if (!obj || typeof obj !== 'object') {
184 return false;
185 }
186
187 if (typeof obj.jquery !== 'undefined') {
188 obj = obj[0];
189 }
190
191 return typeof obj.nodeType !== 'undefined';
192 };
193
194 const getElement = obj => {
195 if (isElement$1(obj)) {
196 // it's a jQuery object or a node element
197 return obj.jquery ? obj[0] : obj;
198 }
199
200 if (typeof obj === 'string' && obj.length > 0) {
201 return SelectorEngine.findOne(obj);
202 }
203
204 return null;
205 };
206
207 const emulateTransitionEnd = (element, duration) => {
208 let called = false;
209 const durationPadding = 5;
210 const emulatedDuration = duration + durationPadding;
211
212 function listener() {
213 called = true;
214 element.removeEventListener(TRANSITION_END, listener);
215 }
216
217 element.addEventListener(TRANSITION_END, listener);
218 setTimeout(() => {
219 if (!called) {
220 triggerTransitionEnd(element);
221 }
222 }, emulatedDuration);
223 };
224
225 const typeCheckConfig = (componentName, config, configTypes) => {
226 Object.keys(configTypes).forEach(property => {
227 const expectedTypes = configTypes[property];
228 const value = config[property];
229 const valueType = value && isElement$1(value) ? 'element' : toType(value);
230
231 if (!new RegExp(expectedTypes).test(valueType)) {
232 throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
233 }
234 });
235 };
236
237 const isVisible = element => {
238 if (!element) {
239 return false;
240 }
241
242 if (element.style && element.parentNode && element.parentNode.style) {
243 const elementStyle = getComputedStyle(element);
244 const parentNodeStyle = getComputedStyle(element.parentNode);
245 return elementStyle.display !== 'none' && parentNodeStyle.display !== 'none' && elementStyle.visibility !== 'hidden';
246 }
247
248 return false;
249 };
250
251 const isDisabled = element => {
252 if (!element || element.nodeType !== Node.ELEMENT_NODE) {
253 return true;
254 }
255
256 if (element.classList.contains('disabled')) {
257 return true;
258 }
259
260 if (typeof element.disabled !== 'undefined') {
261 return element.disabled;
262 }
263
264 return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
265 };
266
267 const findShadowRoot = element => {
268 if (!document.documentElement.attachShadow) {
269 return null;
270 } // Can find the shadow root otherwise it'll return the document
271
272
273 if (typeof element.getRootNode === 'function') {
274 const root = element.getRootNode();
275 return root instanceof ShadowRoot ? root : null;
276 }
277
278 if (element instanceof ShadowRoot) {
279 return element;
280 } // when we don't find a shadow root
281
282
283 if (!element.parentNode) {
284 return null;
285 }
286
287 return findShadowRoot(element.parentNode);
288 };
289
290 const noop = () => {};
291
292 const reflow = element => element.offsetHeight;
293
294 const getjQuery = () => {
295 const {
296 jQuery
297 } = window;
298
299 if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
300 return jQuery;
301 }
302
303 return null;
304 };
305
306 const onDOMContentLoaded = callback => {
307 if (document.readyState === 'loading') {
308 document.addEventListener('DOMContentLoaded', callback);
309 } else {
310 callback();
311 }
312 };
313
314 const isRTL = () => document.documentElement.dir === 'rtl';
315
316 const defineJQueryPlugin = plugin => {
317 onDOMContentLoaded(() => {
318 const $ = getjQuery();
319 /* istanbul ignore if */
320
321 if ($) {
322 const name = plugin.NAME;
323 const JQUERY_NO_CONFLICT = $.fn[name];
324 $.fn[name] = plugin.jQueryInterface;
325 $.fn[name].Constructor = plugin;
326
327 $.fn[name].noConflict = () => {
328 $.fn[name] = JQUERY_NO_CONFLICT;
329 return plugin.jQueryInterface;
330 };
331 }
332 });
333 };
334
335 const execute = callback => {
336 if (typeof callback === 'function') {
337 callback();
338 }
339 };
340
341 /**
342 * --------------------------------------------------------------------------
343 * Bootstrap (v5.0.1): dom/data.js
344 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
345 * --------------------------------------------------------------------------
346 */
347
348 /**
349 * ------------------------------------------------------------------------
350 * Constants
351 * ------------------------------------------------------------------------
352 */
353 const elementMap = new Map();
354 var Data = {
355 set(element, key, instance) {
356 if (!elementMap.has(element)) {
357 elementMap.set(element, new Map());
358 }
359
360 const instanceMap = elementMap.get(element); // make it clear we only want one instance per element
361 // can be removed later when multiple key/instances are fine to be used
362
363 if (!instanceMap.has(key) && instanceMap.size !== 0) {
364 // eslint-disable-next-line no-console
365 console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
366 return;
367 }
368
369 instanceMap.set(key, instance);
370 },
371
372 get(element, key) {
373 if (elementMap.has(element)) {
374 return elementMap.get(element).get(key) || null;
375 }
376
377 return null;
378 },
379
380 remove(element, key) {
381 if (!elementMap.has(element)) {
382 return;
383 }
384
385 const instanceMap = elementMap.get(element);
386 instanceMap.delete(key); // free up element references if there are no instances left for an element
387
388 if (instanceMap.size === 0) {
389 elementMap.delete(element);
390 }
391 }
392
393 };
394
395 /**
396 * --------------------------------------------------------------------------
397 * Bootstrap (v5.0.1): dom/event-handler.js
398 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
399 * --------------------------------------------------------------------------
400 */
401 /**
402 * ------------------------------------------------------------------------
403 * Constants
404 * ------------------------------------------------------------------------
405 */
406
407 const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
408 const stripNameRegex = /\..*/;
409 const stripUidRegex = /::\d+$/;
410 const eventRegistry = {}; // Events storage
411
412 let uidEvent = 1;
413 const customEvents = {
414 mouseenter: 'mouseover',
415 mouseleave: 'mouseout'
416 };
417 const customEventsRegex = /^(mouseenter|mouseleave)/i;
418 const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);
419 /**
420 * ------------------------------------------------------------------------
421 * Private methods
422 * ------------------------------------------------------------------------
423 */
424
425 function getUidEvent(element, uid) {
426 return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
427 }
428
429 function getEvent(element) {
430 const uid = getUidEvent(element);
431 element.uidEvent = uid;
432 eventRegistry[uid] = eventRegistry[uid] || {};
433 return eventRegistry[uid];
434 }
435
436 function bootstrapHandler(element, fn) {
437 return function handler(event) {
438 event.delegateTarget = element;
439
440 if (handler.oneOff) {
441 EventHandler.off(element, event.type, fn);
442 }
443
444 return fn.apply(element, [event]);
445 };
446 }
447
448 function bootstrapDelegationHandler(element, selector, fn) {
449 return function handler(event) {
450 const domElements = element.querySelectorAll(selector);
451
452 for (let {
453 target
454 } = event; target && target !== this; target = target.parentNode) {
455 for (let i = domElements.length; i--;) {
456 if (domElements[i] === target) {
457 event.delegateTarget = target;
458
459 if (handler.oneOff) {
460 // eslint-disable-next-line unicorn/consistent-destructuring
461 EventHandler.off(element, event.type, selector, fn);
462 }
463
464 return fn.apply(target, [event]);
465 }
466 }
467 } // To please ESLint
468
469
470 return null;
471 };
472 }
473
474 function findHandler(events, handler, delegationSelector = null) {
475 const uidEventList = Object.keys(events);
476
477 for (let i = 0, len = uidEventList.length; i < len; i++) {
478 const event = events[uidEventList[i]];
479
480 if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
481 return event;
482 }
483 }
484
485 return null;
486 }
487
488 function normalizeParams(originalTypeEvent, handler, delegationFn) {
489 const delegation = typeof handler === 'string';
490 const originalHandler = delegation ? delegationFn : handler;
491 let typeEvent = getTypeEvent(originalTypeEvent);
492 const isNative = nativeEvents.has(typeEvent);
493
494 if (!isNative) {
495 typeEvent = originalTypeEvent;
496 }
497
498 return [delegation, originalHandler, typeEvent];
499 }
500
501 function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
502 if (typeof originalTypeEvent !== 'string' || !element) {
503 return;
504 }
505
506 if (!handler) {
507 handler = delegationFn;
508 delegationFn = null;
509 } // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
510 // this prevents the handler from being dispatched the same way as mouseover or mouseout does
511
512
513 if (customEventsRegex.test(originalTypeEvent)) {
514 const wrapFn = fn => {
515 return function (event) {
516 if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
517 return fn.call(this, event);
518 }
519 };
520 };
521
522 if (delegationFn) {
523 delegationFn = wrapFn(delegationFn);
524 } else {
525 handler = wrapFn(handler);
526 }
527 }
528
529 const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
530 const events = getEvent(element);
531 const handlers = events[typeEvent] || (events[typeEvent] = {});
532 const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
533
534 if (previousFn) {
535 previousFn.oneOff = previousFn.oneOff && oneOff;
536 return;
537 }
538
539 const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
540 const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
541 fn.delegationSelector = delegation ? handler : null;
542 fn.originalHandler = originalHandler;
543 fn.oneOff = oneOff;
544 fn.uidEvent = uid;
545 handlers[uid] = fn;
546 element.addEventListener(typeEvent, fn, delegation);
547 }
548
549 function removeHandler(element, events, typeEvent, handler, delegationSelector) {
550 const fn = findHandler(events[typeEvent], handler, delegationSelector);
551
552 if (!fn) {
553 return;
554 }
555
556 element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
557 delete events[typeEvent][fn.uidEvent];
558 }
559
560 function removeNamespacedHandlers(element, events, typeEvent, namespace) {
561 const storeElementEvent = events[typeEvent] || {};
562 Object.keys(storeElementEvent).forEach(handlerKey => {
563 if (handlerKey.includes(namespace)) {
564 const event = storeElementEvent[handlerKey];
565 removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
566 }
567 });
568 }
569
570 function getTypeEvent(event) {
571 // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
572 event = event.replace(stripNameRegex, '');
573 return customEvents[event] || event;
574 }
575
576 const EventHandler = {
577 on(element, event, handler, delegationFn) {
578 addHandler(element, event, handler, delegationFn, false);
579 },
580
581 one(element, event, handler, delegationFn) {
582 addHandler(element, event, handler, delegationFn, true);
583 },
584
585 off(element, originalTypeEvent, handler, delegationFn) {
586 if (typeof originalTypeEvent !== 'string' || !element) {
587 return;
588 }
589
590 const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
591 const inNamespace = typeEvent !== originalTypeEvent;
592 const events = getEvent(element);
593 const isNamespace = originalTypeEvent.startsWith('.');
594
595 if (typeof originalHandler !== 'undefined') {
596 // Simplest case: handler is passed, remove that listener ONLY.
597 if (!events || !events[typeEvent]) {
598 return;
599 }
600
601 removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
602 return;
603 }
604
605 if (isNamespace) {
606 Object.keys(events).forEach(elementEvent => {
607 removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
608 });
609 }
610
611 const storeElementEvent = events[typeEvent] || {};
612 Object.keys(storeElementEvent).forEach(keyHandlers => {
613 const handlerKey = keyHandlers.replace(stripUidRegex, '');
614
615 if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
616 const event = storeElementEvent[keyHandlers];
617 removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
618 }
619 });
620 },
621
622 trigger(element, event, args) {
623 if (typeof event !== 'string' || !element) {
624 return null;
625 }
626
627 const $ = getjQuery();
628 const typeEvent = getTypeEvent(event);
629 const inNamespace = event !== typeEvent;
630 const isNative = nativeEvents.has(typeEvent);
631 let jQueryEvent;
632 let bubbles = true;
633 let nativeDispatch = true;
634 let defaultPrevented = false;
635 let evt = null;
636
637 if (inNamespace && $) {
638 jQueryEvent = $.Event(event, args);
639 $(element).trigger(jQueryEvent);
640 bubbles = !jQueryEvent.isPropagationStopped();
641 nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
642 defaultPrevented = jQueryEvent.isDefaultPrevented();
643 }
644
645 if (isNative) {
646 evt = document.createEvent('HTMLEvents');
647 evt.initEvent(typeEvent, bubbles, true);
648 } else {
649 evt = new CustomEvent(event, {
650 bubbles,
651 cancelable: true
652 });
653 } // merge custom information in our event
654
655
656 if (typeof args !== 'undefined') {
657 Object.keys(args).forEach(key => {
658 Object.defineProperty(evt, key, {
659 get() {
660 return args[key];
661 }
662
663 });
664 });
665 }
666
667 if (defaultPrevented) {
668 evt.preventDefault();
669 }
670
671 if (nativeDispatch) {
672 element.dispatchEvent(evt);
673 }
674
675 if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
676 jQueryEvent.preventDefault();
677 }
678
679 return evt;
680 }
681
682 };
683
684 /**
685 * --------------------------------------------------------------------------
686 * Bootstrap (v5.0.1): base-component.js
687 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
688 * --------------------------------------------------------------------------
689 */
690 /**
691 * ------------------------------------------------------------------------
692 * Constants
693 * ------------------------------------------------------------------------
694 */
695
696 const VERSION = '5.0.1';
697
698 class BaseComponent {
699 constructor(element) {
700 element = getElement(element);
701
702 if (!element) {
703 return;
704 }
705
706 this._element = element;
707 Data.set(this._element, this.constructor.DATA_KEY, this);
708 }
709
710 dispose() {
711 Data.remove(this._element, this.constructor.DATA_KEY);
712 EventHandler.off(this._element, this.constructor.EVENT_KEY);
713 Object.getOwnPropertyNames(this).forEach(propertyName => {
714 this[propertyName] = null;
715 });
716 }
717
718 _queueCallback(callback, element, isAnimated = true) {
719 if (!isAnimated) {
720 execute(callback);
721 return;
722 }
723
724 const transitionDuration = getTransitionDurationFromElement(element);
725 EventHandler.one(element, 'transitionend', () => execute(callback));
726 emulateTransitionEnd(element, transitionDuration);
727 }
728 /** Static */
729
730
731 static getInstance(element) {
732 return Data.get(element, this.DATA_KEY);
733 }
734
735 static get VERSION() {
736 return VERSION;
737 }
738
739 static get NAME() {
740 throw new Error('You have to implement the static method "NAME", for each component!');
741 }
742
743 static get DATA_KEY() {
744 return `bs.${this.NAME}`;
745 }
746
747 static get EVENT_KEY() {
748 return `.${this.DATA_KEY}`;
749 }
750
751 }
752
753 /**
754 * --------------------------------------------------------------------------
755 * Bootstrap (v5.0.1): alert.js
756 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
757 * --------------------------------------------------------------------------
758 */
759 /**
760 * ------------------------------------------------------------------------
761 * Constants
762 * ------------------------------------------------------------------------
763 */
764
765 const NAME$c = 'alert';
766 const DATA_KEY$b = 'bs.alert';
767 const EVENT_KEY$b = `.${DATA_KEY$b}`;
768 const DATA_API_KEY$8 = '.data-api';
769 const SELECTOR_DISMISS = '[data-bs-dismiss="alert"]';
770 const EVENT_CLOSE = `close${EVENT_KEY$b}`;
771 const EVENT_CLOSED = `closed${EVENT_KEY$b}`;
772 const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$b}${DATA_API_KEY$8}`;
773 const CLASS_NAME_ALERT = 'alert';
774 const CLASS_NAME_FADE$6 = 'fade';
775 const CLASS_NAME_SHOW$9 = 'show';
776 /**
777 * ------------------------------------------------------------------------
778 * Class Definition
779 * ------------------------------------------------------------------------
780 */
781
782 class Alert extends BaseComponent {
783 // Getters
784 static get NAME() {
785 return NAME$c;
786 } // Public
787
788
789 close(element) {
790 const rootElement = element ? this._getRootElement(element) : this._element;
791
792 const customEvent = this._triggerCloseEvent(rootElement);
793
794 if (customEvent === null || customEvent.defaultPrevented) {
795 return;
796 }
797
798 this._removeElement(rootElement);
799 } // Private
800
801
802 _getRootElement(element) {
803 return getElementFromSelector(element) || element.closest(`.${CLASS_NAME_ALERT}`);
804 }
805
806 _triggerCloseEvent(element) {
807 return EventHandler.trigger(element, EVENT_CLOSE);
808 }
809
810 _removeElement(element) {
811 element.classList.remove(CLASS_NAME_SHOW$9);
812 const isAnimated = element.classList.contains(CLASS_NAME_FADE$6);
813
814 this._queueCallback(() => this._destroyElement(element), element, isAnimated);
815 }
816
817 _destroyElement(element) {
818 if (element.parentNode) {
819 element.parentNode.removeChild(element);
820 }
821
822 EventHandler.trigger(element, EVENT_CLOSED);
823 } // Static
824
825
826 static jQueryInterface(config) {
827 return this.each(function () {
828 let data = Data.get(this, DATA_KEY$b);
829
830 if (!data) {
831 data = new Alert(this);
832 }
833
834 if (config === 'close') {
835 data[config](this);
836 }
837 });
838 }
839
840 static handleDismiss(alertInstance) {
841 return function (event) {
842 if (event) {
843 event.preventDefault();
844 }
845
846 alertInstance.close(this);
847 };
848 }
849
850 }
851 /**
852 * ------------------------------------------------------------------------
853 * Data Api implementation
854 * ------------------------------------------------------------------------
855 */
856
857
858 EventHandler.on(document, EVENT_CLICK_DATA_API$7, SELECTOR_DISMISS, Alert.handleDismiss(new Alert()));
859 /**
860 * ------------------------------------------------------------------------
861 * jQuery
862 * ------------------------------------------------------------------------
863 * add .Alert to jQuery only if jQuery is present
864 */
865
866 defineJQueryPlugin(Alert);
867
868 /**
869 * --------------------------------------------------------------------------
870 * Bootstrap (v5.0.1): button.js
871 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
872 * --------------------------------------------------------------------------
873 */
874 /**
875 * ------------------------------------------------------------------------
876 * Constants
877 * ------------------------------------------------------------------------
878 */
879
880 const NAME$b = 'button';
881 const DATA_KEY$a = 'bs.button';
882 const EVENT_KEY$a = `.${DATA_KEY$a}`;
883 const DATA_API_KEY$7 = '.data-api';
884 const CLASS_NAME_ACTIVE$3 = 'active';
885 const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]';
886 const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$7}`;
887 /**
888 * ------------------------------------------------------------------------
889 * Class Definition
890 * ------------------------------------------------------------------------
891 */
892
893 class Button extends BaseComponent {
894 // Getters
895 static get NAME() {
896 return NAME$b;
897 } // Public
898
899
900 toggle() {
901 // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
902 this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3));
903 } // Static
904
905
906 static jQueryInterface(config) {
907 return this.each(function () {
908 let data = Data.get(this, DATA_KEY$a);
909
910 if (!data) {
911 data = new Button(this);
912 }
913
914 if (config === 'toggle') {
915 data[config]();
916 }
917 });
918 }
919
920 }
921 /**
922 * ------------------------------------------------------------------------
923 * Data Api implementation
924 * ------------------------------------------------------------------------
925 */
926
927
928 EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {
929 event.preventDefault();
930 const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);
931 let data = Data.get(button, DATA_KEY$a);
932
933 if (!data) {
934 data = new Button(button);
935 }
936
937 data.toggle();
938 });
939 /**
940 * ------------------------------------------------------------------------
941 * jQuery
942 * ------------------------------------------------------------------------
943 * add .Button to jQuery only if jQuery is present
944 */
945
946 defineJQueryPlugin(Button);
947
948 /**
949 * --------------------------------------------------------------------------
950 * Bootstrap (v5.0.1): dom/manipulator.js
951 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
952 * --------------------------------------------------------------------------
953 */
954 function normalizeData(val) {
955 if (val === 'true') {
956 return true;
957 }
958
959 if (val === 'false') {
960 return false;
961 }
962
963 if (val === Number(val).toString()) {
964 return Number(val);
965 }
966
967 if (val === '' || val === 'null') {
968 return null;
969 }
970
971 return val;
972 }
973
974 function normalizeDataKey(key) {
975 return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
976 }
977
978 const Manipulator = {
979 setDataAttribute(element, key, value) {
980 element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
981 },
982
983 removeDataAttribute(element, key) {
984 element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
985 },
986
987 getDataAttributes(element) {
988 if (!element) {
989 return {};
990 }
991
992 const attributes = {};
993 Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {
994 let pureKey = key.replace(/^bs/, '');
995 pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
996 attributes[pureKey] = normalizeData(element.dataset[key]);
997 });
998 return attributes;
999 },
1000
1001 getDataAttribute(element, key) {
1002 return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
1003 },
1004
1005 offset(element) {
1006 const rect = element.getBoundingClientRect();
1007 return {
1008 top: rect.top + document.body.scrollTop,
1009 left: rect.left + document.body.scrollLeft
1010 };
1011 },
1012
1013 position(element) {
1014 return {
1015 top: element.offsetTop,
1016 left: element.offsetLeft
1017 };
1018 }
1019
1020 };
1021
1022 /**
1023 * --------------------------------------------------------------------------
1024 * Bootstrap (v5.0.1): carousel.js
1025 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1026 * --------------------------------------------------------------------------
1027 */
1028 /**
1029 * ------------------------------------------------------------------------
1030 * Constants
1031 * ------------------------------------------------------------------------
1032 */
1033
1034 const NAME$a = 'carousel';
1035 const DATA_KEY$9 = 'bs.carousel';
1036 const EVENT_KEY$9 = `.${DATA_KEY$9}`;
1037 const DATA_API_KEY$6 = '.data-api';
1038 const ARROW_LEFT_KEY = 'ArrowLeft';
1039 const ARROW_RIGHT_KEY = 'ArrowRight';
1040 const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
1041
1042 const SWIPE_THRESHOLD = 40;
1043 const Default$9 = {
1044 interval: 5000,
1045 keyboard: true,
1046 slide: false,
1047 pause: 'hover',
1048 wrap: true,
1049 touch: true
1050 };
1051 const DefaultType$9 = {
1052 interval: '(number|boolean)',
1053 keyboard: 'boolean',
1054 slide: '(boolean|string)',
1055 pause: '(string|boolean)',
1056 wrap: 'boolean',
1057 touch: 'boolean'
1058 };
1059 const ORDER_NEXT = 'next';
1060 const ORDER_PREV = 'prev';
1061 const DIRECTION_LEFT = 'left';
1062 const DIRECTION_RIGHT = 'right';
1063 const EVENT_SLIDE = `slide${EVENT_KEY$9}`;
1064 const EVENT_SLID = `slid${EVENT_KEY$9}`;
1065 const EVENT_KEYDOWN = `keydown${EVENT_KEY$9}`;
1066 const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$9}`;
1067 const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$9}`;
1068 const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`;
1069 const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`;
1070 const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`;
1071 const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`;
1072 const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`;
1073 const EVENT_DRAG_START = `dragstart${EVENT_KEY$9}`;
1074 const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$9}${DATA_API_KEY$6}`;
1075 const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$9}${DATA_API_KEY$6}`;
1076 const CLASS_NAME_CAROUSEL = 'carousel';
1077 const CLASS_NAME_ACTIVE$2 = 'active';
1078 const CLASS_NAME_SLIDE = 'slide';
1079 const CLASS_NAME_END = 'carousel-item-end';
1080 const CLASS_NAME_START = 'carousel-item-start';
1081 const CLASS_NAME_NEXT = 'carousel-item-next';
1082 const CLASS_NAME_PREV = 'carousel-item-prev';
1083 const CLASS_NAME_POINTER_EVENT = 'pointer-event';
1084 const SELECTOR_ACTIVE$1 = '.active';
1085 const SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
1086 const SELECTOR_ITEM = '.carousel-item';
1087 const SELECTOR_ITEM_IMG = '.carousel-item img';
1088 const SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
1089 const SELECTOR_INDICATORS = '.carousel-indicators';
1090 const SELECTOR_INDICATOR = '[data-bs-target]';
1091 const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';
1092 const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]';
1093 const POINTER_TYPE_TOUCH = 'touch';
1094 const POINTER_TYPE_PEN = 'pen';
1095 /**
1096 * ------------------------------------------------------------------------
1097 * Class Definition
1098 * ------------------------------------------------------------------------
1099 */
1100
1101 class Carousel extends BaseComponent {
1102 constructor(element, config) {
1103 super(element);
1104 this._items = null;
1105 this._interval = null;
1106 this._activeElement = null;
1107 this._isPaused = false;
1108 this._isSliding = false;
1109 this.touchTimeout = null;
1110 this.touchStartX = 0;
1111 this.touchDeltaX = 0;
1112 this._config = this._getConfig(config);
1113 this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
1114 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
1115 this._pointerEvent = Boolean(window.PointerEvent);
1116
1117 this._addEventListeners();
1118 } // Getters
1119
1120
1121 static get Default() {
1122 return Default$9;
1123 }
1124
1125 static get NAME() {
1126 return NAME$a;
1127 } // Public
1128
1129
1130 next() {
1131 if (!this._isSliding) {
1132 this._slide(ORDER_NEXT);
1133 }
1134 }
1135
1136 nextWhenVisible() {
1137 // Don't call next when the page isn't visible
1138 // or the carousel or its parent isn't visible
1139 if (!document.hidden && isVisible(this._element)) {
1140 this.next();
1141 }
1142 }
1143
1144 prev() {
1145 if (!this._isSliding) {
1146 this._slide(ORDER_PREV);
1147 }
1148 }
1149
1150 pause(event) {
1151 if (!event) {
1152 this._isPaused = true;
1153 }
1154
1155 if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {
1156 triggerTransitionEnd(this._element);
1157 this.cycle(true);
1158 }
1159
1160 clearInterval(this._interval);
1161 this._interval = null;
1162 }
1163
1164 cycle(event) {
1165 if (!event) {
1166 this._isPaused = false;
1167 }
1168
1169 if (this._interval) {
1170 clearInterval(this._interval);
1171 this._interval = null;
1172 }
1173
1174 if (this._config && this._config.interval && !this._isPaused) {
1175 this._updateInterval();
1176
1177 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
1178 }
1179 }
1180
1181 to(index) {
1182 this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
1183
1184 const activeIndex = this._getItemIndex(this._activeElement);
1185
1186 if (index > this._items.length - 1 || index < 0) {
1187 return;
1188 }
1189
1190 if (this._isSliding) {
1191 EventHandler.one(this._element, EVENT_SLID, () => this.to(index));
1192 return;
1193 }
1194
1195 if (activeIndex === index) {
1196 this.pause();
1197 this.cycle();
1198 return;
1199 }
1200
1201 const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;
1202
1203 this._slide(order, this._items[index]);
1204 } // Private
1205
1206
1207 _getConfig(config) {
1208 config = { ...Default$9,
1209 ...config
1210 };
1211 typeCheckConfig(NAME$a, config, DefaultType$9);
1212 return config;
1213 }
1214
1215 _handleSwipe() {
1216 const absDeltax = Math.abs(this.touchDeltaX);
1217
1218 if (absDeltax <= SWIPE_THRESHOLD) {
1219 return;
1220 }
1221
1222 const direction = absDeltax / this.touchDeltaX;
1223 this.touchDeltaX = 0;
1224
1225 if (!direction) {
1226 return;
1227 }
1228
1229 this._slide(direction > 0 ? DIRECTION_RIGHT : DIRECTION_LEFT);
1230 }
1231
1232 _addEventListeners() {
1233 if (this._config.keyboard) {
1234 EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event));
1235 }
1236
1237 if (this._config.pause === 'hover') {
1238 EventHandler.on(this._element, EVENT_MOUSEENTER, event => this.pause(event));
1239 EventHandler.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event));
1240 }
1241
1242 if (this._config.touch && this._touchSupported) {
1243 this._addTouchEventListeners();
1244 }
1245 }
1246
1247 _addTouchEventListeners() {
1248 const start = event => {
1249 if (this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) {
1250 this.touchStartX = event.clientX;
1251 } else if (!this._pointerEvent) {
1252 this.touchStartX = event.touches[0].clientX;
1253 }
1254 };
1255
1256 const move = event => {
1257 // ensure swiping with one touch and not pinching
1258 this.touchDeltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this.touchStartX;
1259 };
1260
1261 const end = event => {
1262 if (this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) {
1263 this.touchDeltaX = event.clientX - this.touchStartX;
1264 }
1265
1266 this._handleSwipe();
1267
1268 if (this._config.pause === 'hover') {
1269 // If it's a touch-enabled device, mouseenter/leave are fired as
1270 // part of the mouse compatibility events on first tap - the carousel
1271 // would stop cycling until user tapped out of it;
1272 // here, we listen for touchend, explicitly pause the carousel
1273 // (as if it's the second time we tap on it, mouseenter compat event
1274 // is NOT fired) and after a timeout (to allow for mouse compatibility
1275 // events to fire) we explicitly restart cycling
1276 this.pause();
1277
1278 if (this.touchTimeout) {
1279 clearTimeout(this.touchTimeout);
1280 }
1281
1282 this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval);
1283 }
1284 };
1285
1286 SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
1287 EventHandler.on(itemImg, EVENT_DRAG_START, e => e.preventDefault());
1288 });
1289
1290 if (this._pointerEvent) {
1291 EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event));
1292 EventHandler.on(this._element, EVENT_POINTERUP, event => end(event));
1293
1294 this._element.classList.add(CLASS_NAME_POINTER_EVENT);
1295 } else {
1296 EventHandler.on(this._element, EVENT_TOUCHSTART, event => start(event));
1297 EventHandler.on(this._element, EVENT_TOUCHMOVE, event => move(event));
1298 EventHandler.on(this._element, EVENT_TOUCHEND, event => end(event));
1299 }
1300 }
1301
1302 _keydown(event) {
1303 if (/input|textarea/i.test(event.target.tagName)) {
1304 return;
1305 }
1306
1307 if (event.key === ARROW_LEFT_KEY) {
1308 event.preventDefault();
1309
1310 this._slide(DIRECTION_RIGHT);
1311 } else if (event.key === ARROW_RIGHT_KEY) {
1312 event.preventDefault();
1313
1314 this._slide(DIRECTION_LEFT);
1315 }
1316 }
1317
1318 _getItemIndex(element) {
1319 this._items = element && element.parentNode ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : [];
1320 return this._items.indexOf(element);
1321 }
1322
1323 _getItemByOrder(order, activeElement) {
1324 const isNext = order === ORDER_NEXT;
1325 const isPrev = order === ORDER_PREV;
1326
1327 const activeIndex = this._getItemIndex(activeElement);
1328
1329 const lastItemIndex = this._items.length - 1;
1330 const isGoingToWrap = isPrev && activeIndex === 0 || isNext && activeIndex === lastItemIndex;
1331
1332 if (isGoingToWrap && !this._config.wrap) {
1333 return activeElement;
1334 }
1335
1336 const delta = isPrev ? -1 : 1;
1337 const itemIndex = (activeIndex + delta) % this._items.length;
1338 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
1339 }
1340
1341 _triggerSlideEvent(relatedTarget, eventDirectionName) {
1342 const targetIndex = this._getItemIndex(relatedTarget);
1343
1344 const fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element));
1345
1346 return EventHandler.trigger(this._element, EVENT_SLIDE, {
1347 relatedTarget,
1348 direction: eventDirectionName,
1349 from: fromIndex,
1350 to: targetIndex
1351 });
1352 }
1353
1354 _setActiveIndicatorElement(element) {
1355 if (this._indicatorsElement) {
1356 const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE$1, this._indicatorsElement);
1357 activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);
1358 activeIndicator.removeAttribute('aria-current');
1359 const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement);
1360
1361 for (let i = 0; i < indicators.length; i++) {
1362 if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {
1363 indicators[i].classList.add(CLASS_NAME_ACTIVE$2);
1364 indicators[i].setAttribute('aria-current', 'true');
1365 break;
1366 }
1367 }
1368 }
1369 }
1370
1371 _updateInterval() {
1372 const element = this._activeElement || SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
1373
1374 if (!element) {
1375 return;
1376 }
1377
1378 const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);
1379
1380 if (elementInterval) {
1381 this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
1382 this._config.interval = elementInterval;
1383 } else {
1384 this._config.interval = this._config.defaultInterval || this._config.interval;
1385 }
1386 }
1387
1388 _slide(directionOrOrder, element) {
1389 const order = this._directionToOrder(directionOrOrder);
1390
1391 const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
1392
1393 const activeElementIndex = this._getItemIndex(activeElement);
1394
1395 const nextElement = element || this._getItemByOrder(order, activeElement);
1396
1397 const nextElementIndex = this._getItemIndex(nextElement);
1398
1399 const isCycling = Boolean(this._interval);
1400 const isNext = order === ORDER_NEXT;
1401 const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;
1402 const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;
1403
1404 const eventDirectionName = this._orderToDirection(order);
1405
1406 if (nextElement && nextElement.classList.contains(CLASS_NAME_ACTIVE$2)) {
1407 this._isSliding = false;
1408 return;
1409 }
1410
1411 const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
1412
1413 if (slideEvent.defaultPrevented) {
1414 return;
1415 }
1416
1417 if (!activeElement || !nextElement) {
1418 // Some weirdness is happening, so we bail
1419 return;
1420 }
1421
1422 this._isSliding = true;
1423
1424 if (isCycling) {
1425 this.pause();
1426 }
1427
1428 this._setActiveIndicatorElement(nextElement);
1429
1430 this._activeElement = nextElement;
1431
1432 const triggerSlidEvent = () => {
1433 EventHandler.trigger(this._element, EVENT_SLID, {
1434 relatedTarget: nextElement,
1435 direction: eventDirectionName,
1436 from: activeElementIndex,
1437 to: nextElementIndex
1438 });
1439 };
1440
1441 if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
1442 nextElement.classList.add(orderClassName);
1443 reflow(nextElement);
1444 activeElement.classList.add(directionalClassName);
1445 nextElement.classList.add(directionalClassName);
1446
1447 const completeCallBack = () => {
1448 nextElement.classList.remove(directionalClassName, orderClassName);
1449 nextElement.classList.add(CLASS_NAME_ACTIVE$2);
1450 activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);
1451 this._isSliding = false;
1452 setTimeout(triggerSlidEvent, 0);
1453 };
1454
1455 this._queueCallback(completeCallBack, activeElement, true);
1456 } else {
1457 activeElement.classList.remove(CLASS_NAME_ACTIVE$2);
1458 nextElement.classList.add(CLASS_NAME_ACTIVE$2);
1459 this._isSliding = false;
1460 triggerSlidEvent();
1461 }
1462
1463 if (isCycling) {
1464 this.cycle();
1465 }
1466 }
1467
1468 _directionToOrder(direction) {
1469 if (![DIRECTION_RIGHT, DIRECTION_LEFT].includes(direction)) {
1470 return direction;
1471 }
1472
1473 if (isRTL()) {
1474 return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;
1475 }
1476
1477 return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;
1478 }
1479
1480 _orderToDirection(order) {
1481 if (![ORDER_NEXT, ORDER_PREV].includes(order)) {
1482 return order;
1483 }
1484
1485 if (isRTL()) {
1486 return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;
1487 }
1488
1489 return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;
1490 } // Static
1491
1492
1493 static carouselInterface(element, config) {
1494 let data = Data.get(element, DATA_KEY$9);
1495 let _config = { ...Default$9,
1496 ...Manipulator.getDataAttributes(element)
1497 };
1498
1499 if (typeof config === 'object') {
1500 _config = { ..._config,
1501 ...config
1502 };
1503 }
1504
1505 const action = typeof config === 'string' ? config : _config.slide;
1506
1507 if (!data) {
1508 data = new Carousel(element, _config);
1509 }
1510
1511 if (typeof config === 'number') {
1512 data.to(config);
1513 } else if (typeof action === 'string') {
1514 if (typeof data[action] === 'undefined') {
1515 throw new TypeError(`No method named "${action}"`);
1516 }
1517
1518 data[action]();
1519 } else if (_config.interval && _config.ride) {
1520 data.pause();
1521 data.cycle();
1522 }
1523 }
1524
1525 static jQueryInterface(config) {
1526 return this.each(function () {
1527 Carousel.carouselInterface(this, config);
1528 });
1529 }
1530
1531 static dataApiClickHandler(event) {
1532 const target = getElementFromSelector(this);
1533
1534 if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
1535 return;
1536 }
1537
1538 const config = { ...Manipulator.getDataAttributes(target),
1539 ...Manipulator.getDataAttributes(this)
1540 };
1541 const slideIndex = this.getAttribute('data-bs-slide-to');
1542
1543 if (slideIndex) {
1544 config.interval = false;
1545 }
1546
1547 Carousel.carouselInterface(target, config);
1548
1549 if (slideIndex) {
1550 Data.get(target, DATA_KEY$9).to(slideIndex);
1551 }
1552
1553 event.preventDefault();
1554 }
1555
1556 }
1557 /**
1558 * ------------------------------------------------------------------------
1559 * Data Api implementation
1560 * ------------------------------------------------------------------------
1561 */
1562
1563
1564 EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler);
1565 EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {
1566 const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);
1567
1568 for (let i = 0, len = carousels.length; i < len; i++) {
1569 Carousel.carouselInterface(carousels[i], Data.get(carousels[i], DATA_KEY$9));
1570 }
1571 });
1572 /**
1573 * ------------------------------------------------------------------------
1574 * jQuery
1575 * ------------------------------------------------------------------------
1576 * add .Carousel to jQuery only if jQuery is present
1577 */
1578
1579 defineJQueryPlugin(Carousel);
1580
1581 /**
1582 * --------------------------------------------------------------------------
1583 * Bootstrap (v5.0.1): collapse.js
1584 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
1585 * --------------------------------------------------------------------------
1586 */
1587 /**
1588 * ------------------------------------------------------------------------
1589 * Constants
1590 * ------------------------------------------------------------------------
1591 */
1592
1593 const NAME$9 = 'collapse';
1594 const DATA_KEY$8 = 'bs.collapse';
1595 const EVENT_KEY$8 = `.${DATA_KEY$8}`;
1596 const DATA_API_KEY$5 = '.data-api';
1597 const Default$8 = {
1598 toggle: true,
1599 parent: ''
1600 };
1601 const DefaultType$8 = {
1602 toggle: 'boolean',
1603 parent: '(string|element)'
1604 };
1605 const EVENT_SHOW$5 = `show${EVENT_KEY$8}`;
1606 const EVENT_SHOWN$5 = `shown${EVENT_KEY$8}`;
1607 const EVENT_HIDE$5 = `hide${EVENT_KEY$8}`;
1608 const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$8}`;
1609 const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
1610 const CLASS_NAME_SHOW$8 = 'show';
1611 const CLASS_NAME_COLLAPSE = 'collapse';
1612 const CLASS_NAME_COLLAPSING = 'collapsing';
1613 const CLASS_NAME_COLLAPSED = 'collapsed';
1614 const WIDTH = 'width';
1615 const HEIGHT = 'height';
1616 const SELECTOR_ACTIVES = '.show, .collapsing';
1617 const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]';
1618 /**
1619 * ------------------------------------------------------------------------
1620 * Class Definition
1621 * ------------------------------------------------------------------------
1622 */
1623
1624 class Collapse extends BaseComponent {
1625 constructor(element, config) {
1626 super(element);
1627 this._isTransitioning = false;
1628 this._config = this._getConfig(config);
1629 this._triggerArray = SelectorEngine.find(`${SELECTOR_DATA_TOGGLE$4}[href="#${this._element.id}"],` + `${SELECTOR_DATA_TOGGLE$4}[data-bs-target="#${this._element.id}"]`);
1630 const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);
1631
1632 for (let i = 0, len = toggleList.length; i < len; i++) {
1633 const elem = toggleList[i];
1634 const selector = getSelectorFromElement(elem);
1635 const filterElement = SelectorEngine.find(selector).filter(foundElem => foundElem === this._element);
1636
1637 if (selector !== null && filterElement.length) {
1638 this._selector = selector;
1639
1640 this._triggerArray.push(elem);
1641 }
1642 }
1643
1644 this._parent = this._config.parent ? this._getParent() : null;
1645
1646 if (!this._config.parent) {
1647 this._addAriaAndCollapsedClass(this._element, this._triggerArray);
1648 }
1649
1650 if (this._config.toggle) {
1651 this.toggle();
1652 }
1653 } // Getters
1654
1655
1656 static get Default() {
1657 return Default$8;
1658 }
1659
1660 static get NAME() {
1661 return NAME$9;
1662 } // Public
1663
1664
1665 toggle() {
1666 if (this._element.classList.contains(CLASS_NAME_SHOW$8)) {
1667 this.hide();
1668 } else {
1669 this.show();
1670 }
1671 }
1672
1673 show() {
1674 if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW$8)) {
1675 return;
1676 }
1677
1678 let actives;
1679 let activesData;
1680
1681 if (this._parent) {
1682 actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent).filter(elem => {
1683 if (typeof this._config.parent === 'string') {
1684 return elem.getAttribute('data-bs-parent') === this._config.parent;
1685 }
1686
1687 return elem.classList.contains(CLASS_NAME_COLLAPSE);
1688 });
1689
1690 if (actives.length === 0) {
1691 actives = null;
1692 }
1693 }
1694
1695 const container = SelectorEngine.findOne(this._selector);
1696
1697 if (actives) {
1698 const tempActiveData = actives.find(elem => container !== elem);
1699 activesData = tempActiveData ? Data.get(tempActiveData, DATA_KEY$8) : null;
1700
1701 if (activesData && activesData._isTransitioning) {
1702 return;
1703 }
1704 }
1705
1706 const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$5);
1707
1708 if (startEvent.defaultPrevented) {
1709 return;
1710 }
1711
1712 if (actives) {
1713 actives.forEach(elemActive => {
1714 if (container !== elemActive) {
1715 Collapse.collapseInterface(elemActive, 'hide');
1716 }
1717
1718 if (!activesData) {
1719 Data.set(elemActive, DATA_KEY$8, null);
1720 }
1721 });
1722 }
1723
1724 const dimension = this._getDimension();
1725
1726 this._element.classList.remove(CLASS_NAME_COLLAPSE);
1727
1728 this._element.classList.add(CLASS_NAME_COLLAPSING);
1729
1730 this._element.style[dimension] = 0;
1731
1732 if (this._triggerArray.length) {
1733 this._triggerArray.forEach(element => {
1734 element.classList.remove(CLASS_NAME_COLLAPSED);
1735 element.setAttribute('aria-expanded', true);
1736 });
1737 }
1738
1739 this.setTransitioning(true);
1740
1741 const complete = () => {
1742 this._element.classList.remove(CLASS_NAME_COLLAPSING);
1743
1744 this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$8);
1745
1746 this._element.style[dimension] = '';
1747 this.setTransitioning(false);
1748 EventHandler.trigger(this._element, EVENT_SHOWN$5);
1749 };
1750
1751 const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
1752 const scrollSize = `scroll${capitalizedDimension}`;
1753
1754 this._queueCallback(complete, this._element, true);
1755
1756 this._element.style[dimension] = `${this._element[scrollSize]}px`;
1757 }
1758
1759 hide() {
1760 if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW$8)) {
1761 return;
1762 }
1763
1764 const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$5);
1765
1766 if (startEvent.defaultPrevented) {
1767 return;
1768 }
1769
1770 const dimension = this._getDimension();
1771
1772 this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;
1773 reflow(this._element);
1774
1775 this._element.classList.add(CLASS_NAME_COLLAPSING);
1776
1777 this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$8);
1778
1779 const triggerArrayLength = this._triggerArray.length;
1780
1781 if (triggerArrayLength > 0) {
1782 for (let i = 0; i < triggerArrayLength; i++) {
1783 const trigger = this._triggerArray[i];
1784 const elem = getElementFromSelector(trigger);
1785
1786 if (elem && !elem.classList.contains(CLASS_NAME_SHOW$8)) {
1787 trigger.classList.add(CLASS_NAME_COLLAPSED);
1788 trigger.setAttribute('aria-expanded', false);
1789 }
1790 }
1791 }
1792
1793 this.setTransitioning(true);
1794
1795 const complete = () => {
1796 this.setTransitioning(false);
1797
1798 this._element.classList.remove(CLASS_NAME_COLLAPSING);
1799
1800 this._element.classList.add(CLASS_NAME_COLLAPSE);
1801
1802 EventHandler.trigger(this._element, EVENT_HIDDEN$5);
1803 };
1804
1805 this._element.style[dimension] = '';
1806
1807 this._queueCallback(complete, this._element, true);
1808 }
1809
1810 setTransitioning(isTransitioning) {
1811 this._isTransitioning = isTransitioning;
1812 } // Private
1813
1814
1815 _getConfig(config) {
1816 config = { ...Default$8,
1817 ...config
1818 };
1819 config.toggle = Boolean(config.toggle); // Coerce string values
1820
1821 typeCheckConfig(NAME$9, config, DefaultType$8);
1822 return config;
1823 }
1824
1825 _getDimension() {
1826 return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT;
1827 }
1828
1829 _getParent() {
1830 let {
1831 parent
1832 } = this._config;
1833 parent = getElement(parent);
1834 const selector = `${SELECTOR_DATA_TOGGLE$4}[data-bs-parent="${parent}"]`;
1835 SelectorEngine.find(selector, parent).forEach(element => {
1836 const selected = getElementFromSelector(element);
1837
1838 this._addAriaAndCollapsedClass(selected, [element]);
1839 });
1840 return parent;
1841 }
1842
1843 _addAriaAndCollapsedClass(element, triggerArray) {
1844 if (!element || !triggerArray.length) {
1845 return;
1846 }
1847
1848 const isOpen = element.classList.contains(CLASS_NAME_SHOW$8);
1849 triggerArray.forEach(elem => {
1850 if (isOpen) {
1851 elem.classList.remove(CLASS_NAME_COLLAPSED);
1852 } else {
1853 elem.classList.add(CLASS_NAME_COLLAPSED);
1854 }
1855
1856 elem.setAttribute('aria-expanded', isOpen);
1857 });
1858 } // Static
1859
1860
1861 static collapseInterface(element, config) {
1862 let data = Data.get(element, DATA_KEY$8);
1863 const _config = { ...Default$8,
1864 ...Manipulator.getDataAttributes(element),
1865 ...(typeof config === 'object' && config ? config : {})
1866 };
1867
1868 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
1869 _config.toggle = false;
1870 }
1871
1872 if (!data) {
1873 data = new Collapse(element, _config);
1874 }
1875
1876 if (typeof config === 'string') {
1877 if (typeof data[config] === 'undefined') {
1878 throw new TypeError(`No method named "${config}"`);
1879 }
1880
1881 data[config]();
1882 }
1883 }
1884
1885 static jQueryInterface(config) {
1886 return this.each(function () {
1887 Collapse.collapseInterface(this, config);
1888 });
1889 }
1890
1891 }
1892 /**
1893 * ------------------------------------------------------------------------
1894 * Data Api implementation
1895 * ------------------------------------------------------------------------
1896 */
1897
1898
1899 EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) {
1900 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
1901 if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {
1902 event.preventDefault();
1903 }
1904
1905 const triggerData = Manipulator.getDataAttributes(this);
1906 const selector = getSelectorFromElement(this);
1907 const selectorElements = SelectorEngine.find(selector);
1908 selectorElements.forEach(element => {
1909 const data = Data.get(element, DATA_KEY$8);
1910 let config;
1911
1912 if (data) {
1913 // update parent attribute
1914 if (data._parent === null && typeof triggerData.parent === 'string') {
1915 data._config.parent = triggerData.parent;
1916 data._parent = data._getParent();
1917 }
1918
1919 config = 'toggle';
1920 } else {
1921 config = triggerData;
1922 }
1923
1924 Collapse.collapseInterface(element, config);
1925 });
1926 });
1927 /**
1928 * ------------------------------------------------------------------------
1929 * jQuery
1930 * ------------------------------------------------------------------------
1931 * add .Collapse to jQuery only if jQuery is present
1932 */
1933
1934 defineJQueryPlugin(Collapse);
1935
1936 var top = 'top';
1937 var bottom = 'bottom';
1938 var right = 'right';
1939 var left = 'left';
1940 var auto = 'auto';
1941 var basePlacements = [top, bottom, right, left];
1942 var start = 'start';
1943 var end = 'end';
1944 var clippingParents = 'clippingParents';
1945 var viewport = 'viewport';
1946 var popper = 'popper';
1947 var reference = 'reference';
1948 var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
1949 return acc.concat([placement + "-" + start, placement + "-" + end]);
1950 }, []);
1951 var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
1952 return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
1953 }, []); // modifiers that need to read the DOM
1954
1955 var beforeRead = 'beforeRead';
1956 var read = 'read';
1957 var afterRead = 'afterRead'; // pure-logic modifiers
1958
1959 var beforeMain = 'beforeMain';
1960 var main = 'main';
1961 var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
1962
1963 var beforeWrite = 'beforeWrite';
1964 var write = 'write';
1965 var afterWrite = 'afterWrite';
1966 var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
1967
1968 function getNodeName(element) {
1969 return element ? (element.nodeName || '').toLowerCase() : null;
1970 }
1971
1972 function getWindow(node) {
1973 if (node == null) {
1974 return window;
1975 }
1976
1977 if (node.toString() !== '[object Window]') {
1978 var ownerDocument = node.ownerDocument;
1979 return ownerDocument ? ownerDocument.defaultView || window : window;
1980 }
1981
1982 return node;
1983 }
1984
1985 function isElement(node) {
1986 var OwnElement = getWindow(node).Element;
1987 return node instanceof OwnElement || node instanceof Element;
1988 }
1989
1990 function isHTMLElement(node) {
1991 var OwnElement = getWindow(node).HTMLElement;
1992 return node instanceof OwnElement || node instanceof HTMLElement;
1993 }
1994
1995 function isShadowRoot(node) {
1996 // IE 11 has no ShadowRoot
1997 if (typeof ShadowRoot === 'undefined') {
1998 return false;
1999 }
2000
2001 var OwnElement = getWindow(node).ShadowRoot;
2002 return node instanceof OwnElement || node instanceof ShadowRoot;
2003 }
2004
2005 // and applies them to the HTMLElements such as popper and arrow
2006
2007 function applyStyles(_ref) {
2008 var state = _ref.state;
2009 Object.keys(state.elements).forEach(function (name) {
2010 var style = state.styles[name] || {};
2011 var attributes = state.attributes[name] || {};
2012 var element = state.elements[name]; // arrow is optional + virtual elements
2013
2014 if (!isHTMLElement(element) || !getNodeName(element)) {
2015 return;
2016 } // Flow doesn't support to extend this property, but it's the most
2017 // effective way to apply styles to an HTMLElement
2018 // $FlowFixMe[cannot-write]
2019
2020
2021 Object.assign(element.style, style);
2022 Object.keys(attributes).forEach(function (name) {
2023 var value = attributes[name];
2024
2025 if (value === false) {
2026 element.removeAttribute(name);
2027 } else {
2028 element.setAttribute(name, value === true ? '' : value);
2029 }
2030 });
2031 });
2032 }
2033
2034 function effect$2(_ref2) {
2035 var state = _ref2.state;
2036 var initialStyles = {
2037 popper: {
2038 position: state.options.strategy,
2039 left: '0',
2040 top: '0',
2041 margin: '0'
2042 },
2043 arrow: {
2044 position: 'absolute'
2045 },
2046 reference: {}
2047 };
2048 Object.assign(state.elements.popper.style, initialStyles.popper);
2049 state.styles = initialStyles;
2050
2051 if (state.elements.arrow) {
2052 Object.assign(state.elements.arrow.style, initialStyles.arrow);
2053 }
2054
2055 return function () {
2056 Object.keys(state.elements).forEach(function (name) {
2057 var element = state.elements[name];
2058 var attributes = state.attributes[name] || {};
2059 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
2060
2061 var style = styleProperties.reduce(function (style, property) {
2062 style[property] = '';
2063 return style;
2064 }, {}); // arrow is optional + virtual elements
2065
2066 if (!isHTMLElement(element) || !getNodeName(element)) {
2067 return;
2068 }
2069
2070 Object.assign(element.style, style);
2071 Object.keys(attributes).forEach(function (attribute) {
2072 element.removeAttribute(attribute);
2073 });
2074 });
2075 };
2076 } // eslint-disable-next-line import/no-unused-modules
2077
2078
2079 var applyStyles$1 = {
2080 name: 'applyStyles',
2081 enabled: true,
2082 phase: 'write',
2083 fn: applyStyles,
2084 effect: effect$2,
2085 requires: ['computeStyles']
2086 };
2087
2088 function getBasePlacement(placement) {
2089 return placement.split('-')[0];
2090 }
2091
2092 function getBoundingClientRect(element) {
2093 var rect = element.getBoundingClientRect();
2094 return {
2095 width: rect.width,
2096 height: rect.height,
2097 top: rect.top,
2098 right: rect.right,
2099 bottom: rect.bottom,
2100 left: rect.left,
2101 x: rect.left,
2102 y: rect.top
2103 };
2104 }
2105
2106 // means it doesn't take into account transforms.
2107
2108 function getLayoutRect(element) {
2109 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
2110 // Fixes https://github.com/popperjs/popper-core/issues/1223
2111
2112 var width = element.offsetWidth;
2113 var height = element.offsetHeight;
2114
2115 if (Math.abs(clientRect.width - width) <= 1) {
2116 width = clientRect.width;
2117 }
2118
2119 if (Math.abs(clientRect.height - height) <= 1) {
2120 height = clientRect.height;
2121 }
2122
2123 return {
2124 x: element.offsetLeft,
2125 y: element.offsetTop,
2126 width: width,
2127 height: height
2128 };
2129 }
2130
2131 function contains(parent, child) {
2132 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
2133
2134 if (parent.contains(child)) {
2135 return true;
2136 } // then fallback to custom implementation with Shadow DOM support
2137 else if (rootNode && isShadowRoot(rootNode)) {
2138 var next = child;
2139
2140 do {
2141 if (next && parent.isSameNode(next)) {
2142 return true;
2143 } // $FlowFixMe[prop-missing]: need a better way to handle this...
2144
2145
2146 next = next.parentNode || next.host;
2147 } while (next);
2148 } // Give up, the result is false
2149
2150
2151 return false;
2152 }
2153
2154 function getComputedStyle$1(element) {
2155 return getWindow(element).getComputedStyle(element);
2156 }
2157
2158 function isTableElement(element) {
2159 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
2160 }
2161
2162 function getDocumentElement(element) {
2163 // $FlowFixMe[incompatible-return]: assume body is always available
2164 return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
2165 element.document) || window.document).documentElement;
2166 }
2167
2168 function getParentNode(element) {
2169 if (getNodeName(element) === 'html') {
2170 return element;
2171 }
2172
2173 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
2174 // $FlowFixMe[incompatible-return]
2175 // $FlowFixMe[prop-missing]
2176 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
2177 element.parentNode || ( // DOM Element detected
2178 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
2179 // $FlowFixMe[incompatible-call]: HTMLElement is a Node
2180 getDocumentElement(element) // fallback
2181
2182 );
2183 }
2184
2185 function getTrueOffsetParent(element) {
2186 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
2187 getComputedStyle$1(element).position === 'fixed') {
2188 return null;
2189 }
2190
2191 return element.offsetParent;
2192 } // `.offsetParent` reports `null` for fixed elements, while absolute elements
2193 // return the containing block
2194
2195
2196 function getContainingBlock(element) {
2197 var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
2198 var isIE = navigator.userAgent.indexOf('Trident') !== -1;
2199
2200 if (isIE && isHTMLElement(element)) {
2201 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
2202 var elementCss = getComputedStyle$1(element);
2203
2204 if (elementCss.position === 'fixed') {
2205 return null;
2206 }
2207 }
2208
2209 var currentNode = getParentNode(element);
2210
2211 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
2212 var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that
2213 // create a containing block.
2214 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
2215
2216 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
2217 return currentNode;
2218 } else {
2219 currentNode = currentNode.parentNode;
2220 }
2221 }
2222
2223 return null;
2224 } // Gets the closest ancestor positioned element. Handles some edge cases,
2225 // such as table ancestors and cross browser bugs.
2226
2227
2228 function getOffsetParent(element) {
2229 var window = getWindow(element);
2230 var offsetParent = getTrueOffsetParent(element);
2231
2232 while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
2233 offsetParent = getTrueOffsetParent(offsetParent);
2234 }
2235
2236 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static')) {
2237 return window;
2238 }
2239
2240 return offsetParent || getContainingBlock(element) || window;
2241 }
2242
2243 function getMainAxisFromPlacement(placement) {
2244 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
2245 }
2246
2247 var max = Math.max;
2248 var min = Math.min;
2249 var round = Math.round;
2250
2251 function within(min$1, value, max$1) {
2252 return max(min$1, min(value, max$1));
2253 }
2254
2255 function getFreshSideObject() {
2256 return {
2257 top: 0,
2258 right: 0,
2259 bottom: 0,
2260 left: 0
2261 };
2262 }
2263
2264 function mergePaddingObject(paddingObject) {
2265 return Object.assign({}, getFreshSideObject(), paddingObject);
2266 }
2267
2268 function expandToHashMap(value, keys) {
2269 return keys.reduce(function (hashMap, key) {
2270 hashMap[key] = value;
2271 return hashMap;
2272 }, {});
2273 }
2274
2275 var toPaddingObject = function toPaddingObject(padding, state) {
2276 padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
2277 placement: state.placement
2278 })) : padding;
2279 return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
2280 };
2281
2282 function arrow(_ref) {
2283 var _state$modifiersData$;
2284
2285 var state = _ref.state,
2286 name = _ref.name,
2287 options = _ref.options;
2288 var arrowElement = state.elements.arrow;
2289 var popperOffsets = state.modifiersData.popperOffsets;
2290 var basePlacement = getBasePlacement(state.placement);
2291 var axis = getMainAxisFromPlacement(basePlacement);
2292 var isVertical = [left, right].indexOf(basePlacement) >= 0;
2293 var len = isVertical ? 'height' : 'width';
2294
2295 if (!arrowElement || !popperOffsets) {
2296 return;
2297 }
2298
2299 var paddingObject = toPaddingObject(options.padding, state);
2300 var arrowRect = getLayoutRect(arrowElement);
2301 var minProp = axis === 'y' ? top : left;
2302 var maxProp = axis === 'y' ? bottom : right;
2303 var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
2304 var startDiff = popperOffsets[axis] - state.rects.reference[axis];
2305 var arrowOffsetParent = getOffsetParent(arrowElement);
2306 var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
2307 var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
2308 // outside of the popper bounds
2309
2310 var min = paddingObject[minProp];
2311 var max = clientSize - arrowRect[len] - paddingObject[maxProp];
2312 var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
2313 var offset = within(min, center, max); // Prevents breaking syntax highlighting...
2314
2315 var axisProp = axis;
2316 state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
2317 }
2318
2319 function effect$1(_ref2) {
2320 var state = _ref2.state,
2321 options = _ref2.options;
2322 var _options$element = options.element,
2323 arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
2324
2325 if (arrowElement == null) {
2326 return;
2327 } // CSS selector
2328
2329
2330 if (typeof arrowElement === 'string') {
2331 arrowElement = state.elements.popper.querySelector(arrowElement);
2332
2333 if (!arrowElement) {
2334 return;
2335 }
2336 }
2337
2338 if (!contains(state.elements.popper, arrowElement)) {
2339
2340 return;
2341 }
2342
2343 state.elements.arrow = arrowElement;
2344 } // eslint-disable-next-line import/no-unused-modules
2345
2346
2347 var arrow$1 = {
2348 name: 'arrow',
2349 enabled: true,
2350 phase: 'main',
2351 fn: arrow,
2352 effect: effect$1,
2353 requires: ['popperOffsets'],
2354 requiresIfExists: ['preventOverflow']
2355 };
2356
2357 var unsetSides = {
2358 top: 'auto',
2359 right: 'auto',
2360 bottom: 'auto',
2361 left: 'auto'
2362 }; // Round the offsets to the nearest suitable subpixel based on the DPR.
2363 // Zooming can change the DPR, but it seems to report a value that will
2364 // cleanly divide the values into the appropriate subpixels.
2365
2366 function roundOffsetsByDPR(_ref) {
2367 var x = _ref.x,
2368 y = _ref.y;
2369 var win = window;
2370 var dpr = win.devicePixelRatio || 1;
2371 return {
2372 x: round(round(x * dpr) / dpr) || 0,
2373 y: round(round(y * dpr) / dpr) || 0
2374 };
2375 }
2376
2377 function mapToStyles(_ref2) {
2378 var _Object$assign2;
2379
2380 var popper = _ref2.popper,
2381 popperRect = _ref2.popperRect,
2382 placement = _ref2.placement,
2383 offsets = _ref2.offsets,
2384 position = _ref2.position,
2385 gpuAcceleration = _ref2.gpuAcceleration,
2386 adaptive = _ref2.adaptive,
2387 roundOffsets = _ref2.roundOffsets;
2388
2389 var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
2390 _ref3$x = _ref3.x,
2391 x = _ref3$x === void 0 ? 0 : _ref3$x,
2392 _ref3$y = _ref3.y,
2393 y = _ref3$y === void 0 ? 0 : _ref3$y;
2394
2395 var hasX = offsets.hasOwnProperty('x');
2396 var hasY = offsets.hasOwnProperty('y');
2397 var sideX = left;
2398 var sideY = top;
2399 var win = window;
2400
2401 if (adaptive) {
2402 var offsetParent = getOffsetParent(popper);
2403 var heightProp = 'clientHeight';
2404 var widthProp = 'clientWidth';
2405
2406 if (offsetParent === getWindow(popper)) {
2407 offsetParent = getDocumentElement(popper);
2408
2409 if (getComputedStyle$1(offsetParent).position !== 'static') {
2410 heightProp = 'scrollHeight';
2411 widthProp = 'scrollWidth';
2412 }
2413 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
2414
2415
2416 offsetParent = offsetParent;
2417
2418 if (placement === top) {
2419 sideY = bottom; // $FlowFixMe[prop-missing]
2420
2421 y -= offsetParent[heightProp] - popperRect.height;
2422 y *= gpuAcceleration ? 1 : -1;
2423 }
2424
2425 if (placement === left) {
2426 sideX = right; // $FlowFixMe[prop-missing]
2427
2428 x -= offsetParent[widthProp] - popperRect.width;
2429 x *= gpuAcceleration ? 1 : -1;
2430 }
2431 }
2432
2433 var commonStyles = Object.assign({
2434 position: position
2435 }, adaptive && unsetSides);
2436
2437 if (gpuAcceleration) {
2438 var _Object$assign;
2439
2440 return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
2441 }
2442
2443 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
2444 }
2445
2446 function computeStyles(_ref4) {
2447 var state = _ref4.state,
2448 options = _ref4.options;
2449 var _options$gpuAccelerat = options.gpuAcceleration,
2450 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
2451 _options$adaptive = options.adaptive,
2452 adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
2453 _options$roundOffsets = options.roundOffsets,
2454 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
2455
2456 var commonStyles = {
2457 placement: getBasePlacement(state.placement),
2458 popper: state.elements.popper,
2459 popperRect: state.rects.popper,
2460 gpuAcceleration: gpuAcceleration
2461 };
2462
2463 if (state.modifiersData.popperOffsets != null) {
2464 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
2465 offsets: state.modifiersData.popperOffsets,
2466 position: state.options.strategy,
2467 adaptive: adaptive,
2468 roundOffsets: roundOffsets
2469 })));
2470 }
2471
2472 if (state.modifiersData.arrow != null) {
2473 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
2474 offsets: state.modifiersData.arrow,
2475 position: 'absolute',
2476 adaptive: false,
2477 roundOffsets: roundOffsets
2478 })));
2479 }
2480
2481 state.attributes.popper = Object.assign({}, state.attributes.popper, {
2482 'data-popper-placement': state.placement
2483 });
2484 } // eslint-disable-next-line import/no-unused-modules
2485
2486
2487 var computeStyles$1 = {
2488 name: 'computeStyles',
2489 enabled: true,
2490 phase: 'beforeWrite',
2491 fn: computeStyles,
2492 data: {}
2493 };
2494
2495 var passive = {
2496 passive: true
2497 };
2498
2499 function effect(_ref) {
2500 var state = _ref.state,
2501 instance = _ref.instance,
2502 options = _ref.options;
2503 var _options$scroll = options.scroll,
2504 scroll = _options$scroll === void 0 ? true : _options$scroll,
2505 _options$resize = options.resize,
2506 resize = _options$resize === void 0 ? true : _options$resize;
2507 var window = getWindow(state.elements.popper);
2508 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
2509
2510 if (scroll) {
2511 scrollParents.forEach(function (scrollParent) {
2512 scrollParent.addEventListener('scroll', instance.update, passive);
2513 });
2514 }
2515
2516 if (resize) {
2517 window.addEventListener('resize', instance.update, passive);
2518 }
2519
2520 return function () {
2521 if (scroll) {
2522 scrollParents.forEach(function (scrollParent) {
2523 scrollParent.removeEventListener('scroll', instance.update, passive);
2524 });
2525 }
2526
2527 if (resize) {
2528 window.removeEventListener('resize', instance.update, passive);
2529 }
2530 };
2531 } // eslint-disable-next-line import/no-unused-modules
2532
2533
2534 var eventListeners = {
2535 name: 'eventListeners',
2536 enabled: true,
2537 phase: 'write',
2538 fn: function fn() {},
2539 effect: effect,
2540 data: {}
2541 };
2542
2543 var hash$1 = {
2544 left: 'right',
2545 right: 'left',
2546 bottom: 'top',
2547 top: 'bottom'
2548 };
2549 function getOppositePlacement(placement) {
2550 return placement.replace(/left|right|bottom|top/g, function (matched) {
2551 return hash$1[matched];
2552 });
2553 }
2554
2555 var hash = {
2556 start: 'end',
2557 end: 'start'
2558 };
2559 function getOppositeVariationPlacement(placement) {
2560 return placement.replace(/start|end/g, function (matched) {
2561 return hash[matched];
2562 });
2563 }
2564
2565 function getWindowScroll(node) {
2566 var win = getWindow(node);
2567 var scrollLeft = win.pageXOffset;
2568 var scrollTop = win.pageYOffset;
2569 return {
2570 scrollLeft: scrollLeft,
2571 scrollTop: scrollTop
2572 };
2573 }
2574
2575 function getWindowScrollBarX(element) {
2576 // If <html> has a CSS width greater than the viewport, then this will be
2577 // incorrect for RTL.
2578 // Popper 1 is broken in this case and never had a bug report so let's assume
2579 // it's not an issue. I don't think anyone ever specifies width on <html>
2580 // anyway.
2581 // Browsers where the left scrollbar doesn't cause an issue report `0` for
2582 // this (e.g. Edge 2019, IE11, Safari)
2583 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
2584 }
2585
2586 function getViewportRect(element) {
2587 var win = getWindow(element);
2588 var html = getDocumentElement(element);
2589 var visualViewport = win.visualViewport;
2590 var width = html.clientWidth;
2591 var height = html.clientHeight;
2592 var x = 0;
2593 var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
2594 // can be obscured underneath it.
2595 // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
2596 // if it isn't open, so if this isn't available, the popper will be detected
2597 // to overflow the bottom of the screen too early.
2598
2599 if (visualViewport) {
2600 width = visualViewport.width;
2601 height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
2602 // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
2603 // errors due to floating point numbers, so we need to check precision.
2604 // Safari returns a number <= 0, usually < -1 when pinch-zoomed
2605 // Feature detection fails in mobile emulation mode in Chrome.
2606 // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
2607 // 0.001
2608 // Fallback here: "Not Safari" userAgent
2609
2610 if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
2611 x = visualViewport.offsetLeft;
2612 y = visualViewport.offsetTop;
2613 }
2614 }
2615
2616 return {
2617 width: width,
2618 height: height,
2619 x: x + getWindowScrollBarX(element),
2620 y: y
2621 };
2622 }
2623
2624 // of the `<html>` and `<body>` rect bounds if horizontally scrollable
2625
2626 function getDocumentRect(element) {
2627 var _element$ownerDocumen;
2628
2629 var html = getDocumentElement(element);
2630 var winScroll = getWindowScroll(element);
2631 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
2632 var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
2633 var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
2634 var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
2635 var y = -winScroll.scrollTop;
2636
2637 if (getComputedStyle$1(body || html).direction === 'rtl') {
2638 x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
2639 }
2640
2641 return {
2642 width: width,
2643 height: height,
2644 x: x,
2645 y: y
2646 };
2647 }
2648
2649 function isScrollParent(element) {
2650 // Firefox wants us to check `-x` and `-y` variations as well
2651 var _getComputedStyle = getComputedStyle$1(element),
2652 overflow = _getComputedStyle.overflow,
2653 overflowX = _getComputedStyle.overflowX,
2654 overflowY = _getComputedStyle.overflowY;
2655
2656 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
2657 }
2658
2659 function getScrollParent(node) {
2660 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
2661 // $FlowFixMe[incompatible-return]: assume body is always available
2662 return node.ownerDocument.body;
2663 }
2664
2665 if (isHTMLElement(node) && isScrollParent(node)) {
2666 return node;
2667 }
2668
2669 return getScrollParent(getParentNode(node));
2670 }
2671
2672 /*
2673 given a DOM element, return the list of all scroll parents, up the list of ancesors
2674 until we get to the top window object. This list is what we attach scroll listeners
2675 to, because if any of these parent elements scroll, we'll need to re-calculate the
2676 reference element's position.
2677 */
2678
2679 function listScrollParents(element, list) {
2680 var _element$ownerDocumen;
2681
2682 if (list === void 0) {
2683 list = [];
2684 }
2685
2686 var scrollParent = getScrollParent(element);
2687 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
2688 var win = getWindow(scrollParent);
2689 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
2690 var updatedList = list.concat(target);
2691 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
2692 updatedList.concat(listScrollParents(getParentNode(target)));
2693 }
2694
2695 function rectToClientRect(rect) {
2696 return Object.assign({}, rect, {
2697 left: rect.x,
2698 top: rect.y,
2699 right: rect.x + rect.width,
2700 bottom: rect.y + rect.height
2701 });
2702 }
2703
2704 function getInnerBoundingClientRect(element) {
2705 var rect = getBoundingClientRect(element);
2706 rect.top = rect.top + element.clientTop;
2707 rect.left = rect.left + element.clientLeft;
2708 rect.bottom = rect.top + element.clientHeight;
2709 rect.right = rect.left + element.clientWidth;
2710 rect.width = element.clientWidth;
2711 rect.height = element.clientHeight;
2712 rect.x = rect.left;
2713 rect.y = rect.top;
2714 return rect;
2715 }
2716
2717 function getClientRectFromMixedType(element, clippingParent) {
2718 return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
2719 } // A "clipping parent" is an overflowable container with the characteristic of
2720 // clipping (or hiding) overflowing elements with a position different from
2721 // `initial`
2722
2723
2724 function getClippingParents(element) {
2725 var clippingParents = listScrollParents(getParentNode(element));
2726 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0;
2727 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
2728
2729 if (!isElement(clipperElement)) {
2730 return [];
2731 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
2732
2733
2734 return clippingParents.filter(function (clippingParent) {
2735 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
2736 });
2737 } // Gets the maximum area that the element is visible in due to any number of
2738 // clipping parents
2739
2740
2741 function getClippingRect(element, boundary, rootBoundary) {
2742 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
2743 var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
2744 var firstClippingParent = clippingParents[0];
2745 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
2746 var rect = getClientRectFromMixedType(element, clippingParent);
2747 accRect.top = max(rect.top, accRect.top);
2748 accRect.right = min(rect.right, accRect.right);
2749 accRect.bottom = min(rect.bottom, accRect.bottom);
2750 accRect.left = max(rect.left, accRect.left);
2751 return accRect;
2752 }, getClientRectFromMixedType(element, firstClippingParent));
2753 clippingRect.width = clippingRect.right - clippingRect.left;
2754 clippingRect.height = clippingRect.bottom - clippingRect.top;
2755 clippingRect.x = clippingRect.left;
2756 clippingRect.y = clippingRect.top;
2757 return clippingRect;
2758 }
2759
2760 function getVariation(placement) {
2761 return placement.split('-')[1];
2762 }
2763
2764 function computeOffsets(_ref) {
2765 var reference = _ref.reference,
2766 element = _ref.element,
2767 placement = _ref.placement;
2768 var basePlacement = placement ? getBasePlacement(placement) : null;
2769 var variation = placement ? getVariation(placement) : null;
2770 var commonX = reference.x + reference.width / 2 - element.width / 2;
2771 var commonY = reference.y + reference.height / 2 - element.height / 2;
2772 var offsets;
2773
2774 switch (basePlacement) {
2775 case top:
2776 offsets = {
2777 x: commonX,
2778 y: reference.y - element.height
2779 };
2780 break;
2781
2782 case bottom:
2783 offsets = {
2784 x: commonX,
2785 y: reference.y + reference.height
2786 };
2787 break;
2788
2789 case right:
2790 offsets = {
2791 x: reference.x + reference.width,
2792 y: commonY
2793 };
2794 break;
2795
2796 case left:
2797 offsets = {
2798 x: reference.x - element.width,
2799 y: commonY
2800 };
2801 break;
2802
2803 default:
2804 offsets = {
2805 x: reference.x,
2806 y: reference.y
2807 };
2808 }
2809
2810 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
2811
2812 if (mainAxis != null) {
2813 var len = mainAxis === 'y' ? 'height' : 'width';
2814
2815 switch (variation) {
2816 case start:
2817 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
2818 break;
2819
2820 case end:
2821 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
2822 break;
2823 }
2824 }
2825
2826 return offsets;
2827 }
2828
2829 function detectOverflow(state, options) {
2830 if (options === void 0) {
2831 options = {};
2832 }
2833
2834 var _options = options,
2835 _options$placement = _options.placement,
2836 placement = _options$placement === void 0 ? state.placement : _options$placement,
2837 _options$boundary = _options.boundary,
2838 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
2839 _options$rootBoundary = _options.rootBoundary,
2840 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
2841 _options$elementConte = _options.elementContext,
2842 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
2843 _options$altBoundary = _options.altBoundary,
2844 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
2845 _options$padding = _options.padding,
2846 padding = _options$padding === void 0 ? 0 : _options$padding;
2847 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
2848 var altContext = elementContext === popper ? reference : popper;
2849 var referenceElement = state.elements.reference;
2850 var popperRect = state.rects.popper;
2851 var element = state.elements[altBoundary ? altContext : elementContext];
2852 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
2853 var referenceClientRect = getBoundingClientRect(referenceElement);
2854 var popperOffsets = computeOffsets({
2855 reference: referenceClientRect,
2856 element: popperRect,
2857 strategy: 'absolute',
2858 placement: placement
2859 });
2860 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
2861 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
2862 // 0 or negative = within the clipping rect
2863
2864 var overflowOffsets = {
2865 top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
2866 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
2867 left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
2868 right: elementClientRect.right - clippingClientRect.right + paddingObject.right
2869 };
2870 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
2871
2872 if (elementContext === popper && offsetData) {
2873 var offset = offsetData[placement];
2874 Object.keys(overflowOffsets).forEach(function (key) {
2875 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
2876 var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
2877 overflowOffsets[key] += offset[axis] * multiply;
2878 });
2879 }
2880
2881 return overflowOffsets;
2882 }
2883
2884 function computeAutoPlacement(state, options) {
2885 if (options === void 0) {
2886 options = {};
2887 }
2888
2889 var _options = options,
2890 placement = _options.placement,
2891 boundary = _options.boundary,
2892 rootBoundary = _options.rootBoundary,
2893 padding = _options.padding,
2894 flipVariations = _options.flipVariations,
2895 _options$allowedAutoP = _options.allowedAutoPlacements,
2896 allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
2897 var variation = getVariation(placement);
2898 var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
2899 return getVariation(placement) === variation;
2900 }) : basePlacements;
2901 var allowedPlacements = placements$1.filter(function (placement) {
2902 return allowedAutoPlacements.indexOf(placement) >= 0;
2903 });
2904
2905 if (allowedPlacements.length === 0) {
2906 allowedPlacements = placements$1;
2907 } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
2908
2909
2910 var overflows = allowedPlacements.reduce(function (acc, placement) {
2911 acc[placement] = detectOverflow(state, {
2912 placement: placement,
2913 boundary: boundary,
2914 rootBoundary: rootBoundary,
2915 padding: padding
2916 })[getBasePlacement(placement)];
2917 return acc;
2918 }, {});
2919 return Object.keys(overflows).sort(function (a, b) {
2920 return overflows[a] - overflows[b];
2921 });
2922 }
2923
2924 function getExpandedFallbackPlacements(placement) {
2925 if (getBasePlacement(placement) === auto) {
2926 return [];
2927 }
2928
2929 var oppositePlacement = getOppositePlacement(placement);
2930 return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
2931 }
2932
2933 function flip(_ref) {
2934 var state = _ref.state,
2935 options = _ref.options,
2936 name = _ref.name;
2937
2938 if (state.modifiersData[name]._skip) {
2939 return;
2940 }
2941
2942 var _options$mainAxis = options.mainAxis,
2943 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
2944 _options$altAxis = options.altAxis,
2945 checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
2946 specifiedFallbackPlacements = options.fallbackPlacements,
2947 padding = options.padding,
2948 boundary = options.boundary,
2949 rootBoundary = options.rootBoundary,
2950 altBoundary = options.altBoundary,
2951 _options$flipVariatio = options.flipVariations,
2952 flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
2953 allowedAutoPlacements = options.allowedAutoPlacements;
2954 var preferredPlacement = state.options.placement;
2955 var basePlacement = getBasePlacement(preferredPlacement);
2956 var isBasePlacement = basePlacement === preferredPlacement;
2957 var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
2958 var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
2959 return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
2960 placement: placement,
2961 boundary: boundary,
2962 rootBoundary: rootBoundary,
2963 padding: padding,
2964 flipVariations: flipVariations,
2965 allowedAutoPlacements: allowedAutoPlacements
2966 }) : placement);
2967 }, []);
2968 var referenceRect = state.rects.reference;
2969 var popperRect = state.rects.popper;
2970 var checksMap = new Map();
2971 var makeFallbackChecks = true;
2972 var firstFittingPlacement = placements[0];
2973
2974 for (var i = 0; i < placements.length; i++) {
2975 var placement = placements[i];
2976
2977 var _basePlacement = getBasePlacement(placement);
2978
2979 var isStartVariation = getVariation(placement) === start;
2980 var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
2981 var len = isVertical ? 'width' : 'height';
2982 var overflow = detectOverflow(state, {
2983 placement: placement,
2984 boundary: boundary,
2985 rootBoundary: rootBoundary,
2986 altBoundary: altBoundary,
2987 padding: padding
2988 });
2989 var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
2990
2991 if (referenceRect[len] > popperRect[len]) {
2992 mainVariationSide = getOppositePlacement(mainVariationSide);
2993 }
2994
2995 var altVariationSide = getOppositePlacement(mainVariationSide);
2996 var checks = [];
2997
2998 if (checkMainAxis) {
2999 checks.push(overflow[_basePlacement] <= 0);
3000 }
3001
3002 if (checkAltAxis) {
3003 checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
3004 }
3005
3006 if (checks.every(function (check) {
3007 return check;
3008 })) {
3009 firstFittingPlacement = placement;
3010 makeFallbackChecks = false;
3011 break;
3012 }
3013
3014 checksMap.set(placement, checks);
3015 }
3016
3017 if (makeFallbackChecks) {
3018 // `2` may be desired in some cases – research later
3019 var numberOfChecks = flipVariations ? 3 : 1;
3020
3021 var _loop = function _loop(_i) {
3022 var fittingPlacement = placements.find(function (placement) {
3023 var checks = checksMap.get(placement);
3024
3025 if (checks) {
3026 return checks.slice(0, _i).every(function (check) {
3027 return check;
3028 });
3029 }
3030 });
3031
3032 if (fittingPlacement) {
3033 firstFittingPlacement = fittingPlacement;
3034 return "break";
3035 }
3036 };
3037
3038 for (var _i = numberOfChecks; _i > 0; _i--) {
3039 var _ret = _loop(_i);
3040
3041 if (_ret === "break") break;
3042 }
3043 }
3044
3045 if (state.placement !== firstFittingPlacement) {
3046 state.modifiersData[name]._skip = true;
3047 state.placement = firstFittingPlacement;
3048 state.reset = true;
3049 }
3050 } // eslint-disable-next-line import/no-unused-modules
3051
3052
3053 var flip$1 = {
3054 name: 'flip',
3055 enabled: true,
3056 phase: 'main',
3057 fn: flip,
3058 requiresIfExists: ['offset'],
3059 data: {
3060 _skip: false
3061 }
3062 };
3063
3064 function getSideOffsets(overflow, rect, preventedOffsets) {
3065 if (preventedOffsets === void 0) {
3066 preventedOffsets = {
3067 x: 0,
3068 y: 0
3069 };
3070 }
3071
3072 return {
3073 top: overflow.top - rect.height - preventedOffsets.y,
3074 right: overflow.right - rect.width + preventedOffsets.x,
3075 bottom: overflow.bottom - rect.height + preventedOffsets.y,
3076 left: overflow.left - rect.width - preventedOffsets.x
3077 };
3078 }
3079
3080 function isAnySideFullyClipped(overflow) {
3081 return [top, right, bottom, left].some(function (side) {
3082 return overflow[side] >= 0;
3083 });
3084 }
3085
3086 function hide$1(_ref) {
3087 var state = _ref.state,
3088 name = _ref.name;
3089 var referenceRect = state.rects.reference;
3090 var popperRect = state.rects.popper;
3091 var preventedOffsets = state.modifiersData.preventOverflow;
3092 var referenceOverflow = detectOverflow(state, {
3093 elementContext: 'reference'
3094 });
3095 var popperAltOverflow = detectOverflow(state, {
3096 altBoundary: true
3097 });
3098 var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
3099 var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
3100 var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
3101 var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
3102 state.modifiersData[name] = {
3103 referenceClippingOffsets: referenceClippingOffsets,
3104 popperEscapeOffsets: popperEscapeOffsets,
3105 isReferenceHidden: isReferenceHidden,
3106 hasPopperEscaped: hasPopperEscaped
3107 };
3108 state.attributes.popper = Object.assign({}, state.attributes.popper, {
3109 'data-popper-reference-hidden': isReferenceHidden,
3110 'data-popper-escaped': hasPopperEscaped
3111 });
3112 } // eslint-disable-next-line import/no-unused-modules
3113
3114
3115 var hide$2 = {
3116 name: 'hide',
3117 enabled: true,
3118 phase: 'main',
3119 requiresIfExists: ['preventOverflow'],
3120 fn: hide$1
3121 };
3122
3123 function distanceAndSkiddingToXY(placement, rects, offset) {
3124 var basePlacement = getBasePlacement(placement);
3125 var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
3126
3127 var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
3128 placement: placement
3129 })) : offset,
3130 skidding = _ref[0],
3131 distance = _ref[1];
3132
3133 skidding = skidding || 0;
3134 distance = (distance || 0) * invertDistance;
3135 return [left, right].indexOf(basePlacement) >= 0 ? {
3136 x: distance,
3137 y: skidding
3138 } : {
3139 x: skidding,
3140 y: distance
3141 };
3142 }
3143
3144 function offset(_ref2) {
3145 var state = _ref2.state,
3146 options = _ref2.options,
3147 name = _ref2.name;
3148 var _options$offset = options.offset,
3149 offset = _options$offset === void 0 ? [0, 0] : _options$offset;
3150 var data = placements.reduce(function (acc, placement) {
3151 acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
3152 return acc;
3153 }, {});
3154 var _data$state$placement = data[state.placement],
3155 x = _data$state$placement.x,
3156 y = _data$state$placement.y;
3157
3158 if (state.modifiersData.popperOffsets != null) {
3159 state.modifiersData.popperOffsets.x += x;
3160 state.modifiersData.popperOffsets.y += y;
3161 }
3162
3163 state.modifiersData[name] = data;
3164 } // eslint-disable-next-line import/no-unused-modules
3165
3166
3167 var offset$1 = {
3168 name: 'offset',
3169 enabled: true,
3170 phase: 'main',
3171 requires: ['popperOffsets'],
3172 fn: offset
3173 };
3174
3175 function popperOffsets(_ref) {
3176 var state = _ref.state,
3177 name = _ref.name;
3178 // Offsets are the actual position the popper needs to have to be
3179 // properly positioned near its reference element
3180 // This is the most basic placement, and will be adjusted by
3181 // the modifiers in the next step
3182 state.modifiersData[name] = computeOffsets({
3183 reference: state.rects.reference,
3184 element: state.rects.popper,
3185 strategy: 'absolute',
3186 placement: state.placement
3187 });
3188 } // eslint-disable-next-line import/no-unused-modules
3189
3190
3191 var popperOffsets$1 = {
3192 name: 'popperOffsets',
3193 enabled: true,
3194 phase: 'read',
3195 fn: popperOffsets,
3196 data: {}
3197 };
3198
3199 function getAltAxis(axis) {
3200 return axis === 'x' ? 'y' : 'x';
3201 }
3202
3203 function preventOverflow(_ref) {
3204 var state = _ref.state,
3205 options = _ref.options,
3206 name = _ref.name;
3207 var _options$mainAxis = options.mainAxis,
3208 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
3209 _options$altAxis = options.altAxis,
3210 checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
3211 boundary = options.boundary,
3212 rootBoundary = options.rootBoundary,
3213 altBoundary = options.altBoundary,
3214 padding = options.padding,
3215 _options$tether = options.tether,
3216 tether = _options$tether === void 0 ? true : _options$tether,
3217 _options$tetherOffset = options.tetherOffset,
3218 tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
3219 var overflow = detectOverflow(state, {
3220 boundary: boundary,
3221 rootBoundary: rootBoundary,
3222 padding: padding,
3223 altBoundary: altBoundary
3224 });
3225 var basePlacement = getBasePlacement(state.placement);
3226 var variation = getVariation(state.placement);
3227 var isBasePlacement = !variation;
3228 var mainAxis = getMainAxisFromPlacement(basePlacement);
3229 var altAxis = getAltAxis(mainAxis);
3230 var popperOffsets = state.modifiersData.popperOffsets;
3231 var referenceRect = state.rects.reference;
3232 var popperRect = state.rects.popper;
3233 var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
3234 placement: state.placement
3235 })) : tetherOffset;
3236 var data = {
3237 x: 0,
3238 y: 0
3239 };
3240
3241 if (!popperOffsets) {
3242 return;
3243 }
3244
3245 if (checkMainAxis || checkAltAxis) {
3246 var mainSide = mainAxis === 'y' ? top : left;
3247 var altSide = mainAxis === 'y' ? bottom : right;
3248 var len = mainAxis === 'y' ? 'height' : 'width';
3249 var offset = popperOffsets[mainAxis];
3250 var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
3251 var max$1 = popperOffsets[mainAxis] - overflow[altSide];
3252 var additive = tether ? -popperRect[len] / 2 : 0;
3253 var minLen = variation === start ? referenceRect[len] : popperRect[len];
3254 var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
3255 // outside the reference bounds
3256
3257 var arrowElement = state.elements.arrow;
3258 var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
3259 width: 0,
3260 height: 0
3261 };
3262 var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
3263 var arrowPaddingMin = arrowPaddingObject[mainSide];
3264 var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
3265 // to include its full size in the calculation. If the reference is small
3266 // and near the edge of a boundary, the popper can overflow even if the
3267 // reference is not overflowing as well (e.g. virtual elements with no
3268 // width or height)
3269
3270 var arrowLen = within(0, referenceRect[len], arrowRect[len]);
3271 var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
3272 var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
3273 var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
3274 var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
3275 var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
3276 var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
3277 var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
3278
3279 if (checkMainAxis) {
3280 var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
3281 popperOffsets[mainAxis] = preventedOffset;
3282 data[mainAxis] = preventedOffset - offset;
3283 }
3284
3285 if (checkAltAxis) {
3286 var _mainSide = mainAxis === 'x' ? top : left;
3287
3288 var _altSide = mainAxis === 'x' ? bottom : right;
3289
3290 var _offset = popperOffsets[altAxis];
3291
3292 var _min = _offset + overflow[_mainSide];
3293
3294 var _max = _offset - overflow[_altSide];
3295
3296 var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
3297
3298 popperOffsets[altAxis] = _preventedOffset;
3299 data[altAxis] = _preventedOffset - _offset;
3300 }
3301 }
3302
3303 state.modifiersData[name] = data;
3304 } // eslint-disable-next-line import/no-unused-modules
3305
3306
3307 var preventOverflow$1 = {
3308 name: 'preventOverflow',
3309 enabled: true,
3310 phase: 'main',
3311 fn: preventOverflow,
3312 requiresIfExists: ['offset']
3313 };
3314
3315 function getHTMLElementScroll(element) {
3316 return {
3317 scrollLeft: element.scrollLeft,
3318 scrollTop: element.scrollTop
3319 };
3320 }
3321
3322 function getNodeScroll(node) {
3323 if (node === getWindow(node) || !isHTMLElement(node)) {
3324 return getWindowScroll(node);
3325 } else {
3326 return getHTMLElementScroll(node);
3327 }
3328 }
3329
3330 // Composite means it takes into account transforms as well as layout.
3331
3332 function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
3333 if (isFixed === void 0) {
3334 isFixed = false;
3335 }
3336
3337 var documentElement = getDocumentElement(offsetParent);
3338 var rect = getBoundingClientRect(elementOrVirtualElement);
3339 var isOffsetParentAnElement = isHTMLElement(offsetParent);
3340 var scroll = {
3341 scrollLeft: 0,
3342 scrollTop: 0
3343 };
3344 var offsets = {
3345 x: 0,
3346 y: 0
3347 };
3348
3349 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
3350 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
3351 isScrollParent(documentElement)) {
3352 scroll = getNodeScroll(offsetParent);
3353 }
3354
3355 if (isHTMLElement(offsetParent)) {
3356 offsets = getBoundingClientRect(offsetParent);
3357 offsets.x += offsetParent.clientLeft;
3358 offsets.y += offsetParent.clientTop;
3359 } else if (documentElement) {
3360 offsets.x = getWindowScrollBarX(documentElement);
3361 }
3362 }
3363
3364 return {
3365 x: rect.left + scroll.scrollLeft - offsets.x,
3366 y: rect.top + scroll.scrollTop - offsets.y,
3367 width: rect.width,
3368 height: rect.height
3369 };
3370 }
3371
3372 function order(modifiers) {
3373 var map = new Map();
3374 var visited = new Set();
3375 var result = [];
3376 modifiers.forEach(function (modifier) {
3377 map.set(modifier.name, modifier);
3378 }); // On visiting object, check for its dependencies and visit them recursively
3379
3380 function sort(modifier) {
3381 visited.add(modifier.name);
3382 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
3383 requires.forEach(function (dep) {
3384 if (!visited.has(dep)) {
3385 var depModifier = map.get(dep);
3386
3387 if (depModifier) {
3388 sort(depModifier);
3389 }
3390 }
3391 });
3392 result.push(modifier);
3393 }
3394
3395 modifiers.forEach(function (modifier) {
3396 if (!visited.has(modifier.name)) {
3397 // check for visited object
3398 sort(modifier);
3399 }
3400 });
3401 return result;
3402 }
3403
3404 function orderModifiers(modifiers) {
3405 // order based on dependencies
3406 var orderedModifiers = order(modifiers); // order based on phase
3407
3408 return modifierPhases.reduce(function (acc, phase) {
3409 return acc.concat(orderedModifiers.filter(function (modifier) {
3410 return modifier.phase === phase;
3411 }));
3412 }, []);
3413 }
3414
3415 function debounce(fn) {
3416 var pending;
3417 return function () {
3418 if (!pending) {
3419 pending = new Promise(function (resolve) {
3420 Promise.resolve().then(function () {
3421 pending = undefined;
3422 resolve(fn());
3423 });
3424 });
3425 }
3426
3427 return pending;
3428 };
3429 }
3430
3431 function mergeByName(modifiers) {
3432 var merged = modifiers.reduce(function (merged, current) {
3433 var existing = merged[current.name];
3434 merged[current.name] = existing ? Object.assign({}, existing, current, {
3435 options: Object.assign({}, existing.options, current.options),
3436 data: Object.assign({}, existing.data, current.data)
3437 }) : current;
3438 return merged;
3439 }, {}); // IE11 does not support Object.values
3440
3441 return Object.keys(merged).map(function (key) {
3442 return merged[key];
3443 });
3444 }
3445
3446 var DEFAULT_OPTIONS = {
3447 placement: 'bottom',
3448 modifiers: [],
3449 strategy: 'absolute'
3450 };
3451
3452 function areValidElements() {
3453 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3454 args[_key] = arguments[_key];
3455 }
3456
3457 return !args.some(function (element) {
3458 return !(element && typeof element.getBoundingClientRect === 'function');
3459 });
3460 }
3461
3462 function popperGenerator(generatorOptions) {
3463 if (generatorOptions === void 0) {
3464 generatorOptions = {};
3465 }
3466
3467 var _generatorOptions = generatorOptions,
3468 _generatorOptions$def = _generatorOptions.defaultModifiers,
3469 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
3470 _generatorOptions$def2 = _generatorOptions.defaultOptions,
3471 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
3472 return function createPopper(reference, popper, options) {
3473 if (options === void 0) {
3474 options = defaultOptions;
3475 }
3476
3477 var state = {
3478 placement: 'bottom',
3479 orderedModifiers: [],
3480 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
3481 modifiersData: {},
3482 elements: {
3483 reference: reference,
3484 popper: popper
3485 },
3486 attributes: {},
3487 styles: {}
3488 };
3489 var effectCleanupFns = [];
3490 var isDestroyed = false;
3491 var instance = {
3492 state: state,
3493 setOptions: function setOptions(options) {
3494 cleanupModifierEffects();
3495 state.options = Object.assign({}, defaultOptions, state.options, options);
3496 state.scrollParents = {
3497 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
3498 popper: listScrollParents(popper)
3499 }; // Orders the modifiers based on their dependencies and `phase`
3500 // properties
3501
3502 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
3503
3504 state.orderedModifiers = orderedModifiers.filter(function (m) {
3505 return m.enabled;
3506 }); // Validate the provided modifiers so that the consumer will get warned
3507
3508 runModifierEffects();
3509 return instance.update();
3510 },
3511 // Sync update – it will always be executed, even if not necessary. This
3512 // is useful for low frequency updates where sync behavior simplifies the
3513 // logic.
3514 // For high frequency updates (e.g. `resize` and `scroll` events), always
3515 // prefer the async Popper#update method
3516 forceUpdate: function forceUpdate() {
3517 if (isDestroyed) {
3518 return;
3519 }
3520
3521 var _state$elements = state.elements,
3522 reference = _state$elements.reference,
3523 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
3524 // anymore
3525
3526 if (!areValidElements(reference, popper)) {
3527
3528 return;
3529 } // Store the reference and popper rects to be read by modifiers
3530
3531
3532 state.rects = {
3533 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
3534 popper: getLayoutRect(popper)
3535 }; // Modifiers have the ability to reset the current update cycle. The
3536 // most common use case for this is the `flip` modifier changing the
3537 // placement, which then needs to re-run all the modifiers, because the
3538 // logic was previously ran for the previous placement and is therefore
3539 // stale/incorrect
3540
3541 state.reset = false;
3542 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
3543 // is filled with the initial data specified by the modifier. This means
3544 // it doesn't persist and is fresh on each update.
3545 // To ensure persistent data, use `${name}#persistent`
3546
3547 state.orderedModifiers.forEach(function (modifier) {
3548 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
3549 });
3550
3551 for (var index = 0; index < state.orderedModifiers.length; index++) {
3552
3553 if (state.reset === true) {
3554 state.reset = false;
3555 index = -1;
3556 continue;
3557 }
3558
3559 var _state$orderedModifie = state.orderedModifiers[index],
3560 fn = _state$orderedModifie.fn,
3561 _state$orderedModifie2 = _state$orderedModifie.options,
3562 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
3563 name = _state$orderedModifie.name;
3564
3565 if (typeof fn === 'function') {
3566 state = fn({
3567 state: state,
3568 options: _options,
3569 name: name,
3570 instance: instance
3571 }) || state;
3572 }
3573 }
3574 },
3575 // Async and optimistically optimized update – it will not be executed if
3576 // not necessary (debounced to run at most once-per-tick)
3577 update: debounce(function () {
3578 return new Promise(function (resolve) {
3579 instance.forceUpdate();
3580 resolve(state);
3581 });
3582 }),
3583 destroy: function destroy() {
3584 cleanupModifierEffects();
3585 isDestroyed = true;
3586 }
3587 };
3588
3589 if (!areValidElements(reference, popper)) {
3590
3591 return instance;
3592 }
3593
3594 instance.setOptions(options).then(function (state) {
3595 if (!isDestroyed && options.onFirstUpdate) {
3596 options.onFirstUpdate(state);
3597 }
3598 }); // Modifiers have the ability to execute arbitrary code before the first
3599 // update cycle runs. They will be executed in the same order as the update
3600 // cycle. This is useful when a modifier adds some persistent data that
3601 // other modifiers need to use, but the modifier is run after the dependent
3602 // one.
3603
3604 function runModifierEffects() {
3605 state.orderedModifiers.forEach(function (_ref3) {
3606 var name = _ref3.name,
3607 _ref3$options = _ref3.options,
3608 options = _ref3$options === void 0 ? {} : _ref3$options,
3609 effect = _ref3.effect;
3610
3611 if (typeof effect === 'function') {
3612 var cleanupFn = effect({
3613 state: state,
3614 name: name,
3615 instance: instance,
3616 options: options
3617 });
3618
3619 var noopFn = function noopFn() {};
3620
3621 effectCleanupFns.push(cleanupFn || noopFn);
3622 }
3623 });
3624 }
3625
3626 function cleanupModifierEffects() {
3627 effectCleanupFns.forEach(function (fn) {
3628 return fn();
3629 });
3630 effectCleanupFns = [];
3631 }
3632
3633 return instance;
3634 };
3635 }
3636 var createPopper$2 = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
3637
3638 var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
3639 var createPopper$1 = /*#__PURE__*/popperGenerator({
3640 defaultModifiers: defaultModifiers$1
3641 }); // eslint-disable-next-line import/no-unused-modules
3642
3643 var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$2];
3644 var createPopper = /*#__PURE__*/popperGenerator({
3645 defaultModifiers: defaultModifiers
3646 }); // eslint-disable-next-line import/no-unused-modules
3647
3648 var Popper = /*#__PURE__*/Object.freeze({
3649 __proto__: null,
3650 popperGenerator: popperGenerator,
3651 detectOverflow: detectOverflow,
3652 createPopperBase: createPopper$2,
3653 createPopper: createPopper,
3654 createPopperLite: createPopper$1,
3655 top: top,
3656 bottom: bottom,
3657 right: right,
3658 left: left,
3659 auto: auto,
3660 basePlacements: basePlacements,
3661 start: start,
3662 end: end,
3663 clippingParents: clippingParents,
3664 viewport: viewport,
3665 popper: popper,
3666 reference: reference,
3667 variationPlacements: variationPlacements,
3668 placements: placements,
3669 beforeRead: beforeRead,
3670 read: read,
3671 afterRead: afterRead,
3672 beforeMain: beforeMain,
3673 main: main,
3674 afterMain: afterMain,
3675 beforeWrite: beforeWrite,
3676 write: write,
3677 afterWrite: afterWrite,
3678 modifierPhases: modifierPhases,
3679 applyStyles: applyStyles$1,
3680 arrow: arrow$1,
3681 computeStyles: computeStyles$1,
3682 eventListeners: eventListeners,
3683 flip: flip$1,
3684 hide: hide$2,
3685 offset: offset$1,
3686 popperOffsets: popperOffsets$1,
3687 preventOverflow: preventOverflow$1
3688 });
3689
3690 /**
3691 * --------------------------------------------------------------------------
3692 * Bootstrap (v5.0.1): dropdown.js
3693 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
3694 * --------------------------------------------------------------------------
3695 */
3696 /**
3697 * ------------------------------------------------------------------------
3698 * Constants
3699 * ------------------------------------------------------------------------
3700 */
3701
3702 const NAME$8 = 'dropdown';
3703 const DATA_KEY$7 = 'bs.dropdown';
3704 const EVENT_KEY$7 = `.${DATA_KEY$7}`;
3705 const DATA_API_KEY$4 = '.data-api';
3706 const ESCAPE_KEY$2 = 'Escape';
3707 const SPACE_KEY = 'Space';
3708 const TAB_KEY = 'Tab';
3709 const ARROW_UP_KEY = 'ArrowUp';
3710 const ARROW_DOWN_KEY = 'ArrowDown';
3711 const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
3712
3713 const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);
3714 const EVENT_HIDE$4 = `hide${EVENT_KEY$7}`;
3715 const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$7}`;
3716 const EVENT_SHOW$4 = `show${EVENT_KEY$7}`;
3717 const EVENT_SHOWN$4 = `shown${EVENT_KEY$7}`;
3718 const EVENT_CLICK = `click${EVENT_KEY$7}`;
3719 const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
3720 const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$7}${DATA_API_KEY$4}`;
3721 const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$7}${DATA_API_KEY$4}`;
3722 const CLASS_NAME_SHOW$7 = 'show';
3723 const CLASS_NAME_DROPUP = 'dropup';
3724 const CLASS_NAME_DROPEND = 'dropend';
3725 const CLASS_NAME_DROPSTART = 'dropstart';
3726 const CLASS_NAME_NAVBAR = 'navbar';
3727 const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]';
3728 const SELECTOR_MENU = '.dropdown-menu';
3729 const SELECTOR_NAVBAR_NAV = '.navbar-nav';
3730 const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
3731 const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';
3732 const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';
3733 const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';
3734 const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
3735 const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
3736 const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
3737 const Default$7 = {
3738 offset: [0, 2],
3739 boundary: 'clippingParents',
3740 reference: 'toggle',
3741 display: 'dynamic',
3742 popperConfig: null,
3743 autoClose: true
3744 };
3745 const DefaultType$7 = {
3746 offset: '(array|string|function)',
3747 boundary: '(string|element)',
3748 reference: '(string|element|object)',
3749 display: 'string',
3750 popperConfig: '(null|object|function)',
3751 autoClose: '(boolean|string)'
3752 };
3753 /**
3754 * ------------------------------------------------------------------------
3755 * Class Definition
3756 * ------------------------------------------------------------------------
3757 */
3758
3759 class Dropdown extends BaseComponent {
3760 constructor(element, config) {
3761 super(element);
3762 this._popper = null;
3763 this._config = this._getConfig(config);
3764 this._menu = this._getMenuElement();
3765 this._inNavbar = this._detectNavbar();
3766
3767 this._addEventListeners();
3768 } // Getters
3769
3770
3771 static get Default() {
3772 return Default$7;
3773 }
3774
3775 static get DefaultType() {
3776 return DefaultType$7;
3777 }
3778
3779 static get NAME() {
3780 return NAME$8;
3781 } // Public
3782
3783
3784 toggle() {
3785 if (isDisabled(this._element)) {
3786 return;
3787 }
3788
3789 const isActive = this._element.classList.contains(CLASS_NAME_SHOW$7);
3790
3791 if (isActive) {
3792 this.hide();
3793 return;
3794 }
3795
3796 this.show();
3797 }
3798
3799 show() {
3800 if (isDisabled(this._element) || this._menu.classList.contains(CLASS_NAME_SHOW$7)) {
3801 return;
3802 }
3803
3804 const parent = Dropdown.getParentFromElement(this._element);
3805 const relatedTarget = {
3806 relatedTarget: this._element
3807 };
3808 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, relatedTarget);
3809
3810 if (showEvent.defaultPrevented) {
3811 return;
3812 } // Totally disable Popper for Dropdowns in Navbar
3813
3814
3815 if (this._inNavbar) {
3816 Manipulator.setDataAttribute(this._menu, 'popper', 'none');
3817 } else {
3818 if (typeof Popper === 'undefined') {
3819 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
3820 }
3821
3822 let referenceElement = this._element;
3823
3824 if (this._config.reference === 'parent') {
3825 referenceElement = parent;
3826 } else if (isElement$1(this._config.reference)) {
3827 referenceElement = getElement(this._config.reference);
3828 } else if (typeof this._config.reference === 'object') {
3829 referenceElement = this._config.reference;
3830 }
3831
3832 const popperConfig = this._getPopperConfig();
3833
3834 const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
3835 this._popper = createPopper(referenceElement, this._menu, popperConfig);
3836
3837 if (isDisplayStatic) {
3838 Manipulator.setDataAttribute(this._menu, 'popper', 'static');
3839 }
3840 } // If this is a touch-enabled device we add extra
3841 // empty mouseover listeners to the body's immediate children;
3842 // only needed because of broken event delegation on iOS
3843 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
3844
3845
3846 if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) {
3847 [].concat(...document.body.children).forEach(elem => EventHandler.on(elem, 'mouseover', noop));
3848 }
3849
3850 this._element.focus();
3851
3852 this._element.setAttribute('aria-expanded', true);
3853
3854 this._menu.classList.toggle(CLASS_NAME_SHOW$7);
3855
3856 this._element.classList.toggle(CLASS_NAME_SHOW$7);
3857
3858 EventHandler.trigger(this._element, EVENT_SHOWN$4, relatedTarget);
3859 }
3860
3861 hide() {
3862 if (isDisabled(this._element) || !this._menu.classList.contains(CLASS_NAME_SHOW$7)) {
3863 return;
3864 }
3865
3866 const relatedTarget = {
3867 relatedTarget: this._element
3868 };
3869
3870 this._completeHide(relatedTarget);
3871 }
3872
3873 dispose() {
3874 if (this._popper) {
3875 this._popper.destroy();
3876 }
3877
3878 super.dispose();
3879 }
3880
3881 update() {
3882 this._inNavbar = this._detectNavbar();
3883
3884 if (this._popper) {
3885 this._popper.update();
3886 }
3887 } // Private
3888
3889
3890 _addEventListeners() {
3891 EventHandler.on(this._element, EVENT_CLICK, event => {
3892 event.preventDefault();
3893 this.toggle();
3894 });
3895 }
3896
3897 _completeHide(relatedTarget) {
3898 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget);
3899
3900 if (hideEvent.defaultPrevented) {
3901 return;
3902 } // If this is a touch-enabled device we remove the extra
3903 // empty mouseover listeners we added for iOS support
3904
3905
3906 if ('ontouchstart' in document.documentElement) {
3907 [].concat(...document.body.children).forEach(elem => EventHandler.off(elem, 'mouseover', noop));
3908 }
3909
3910 if (this._popper) {
3911 this._popper.destroy();
3912 }
3913
3914 this._menu.classList.remove(CLASS_NAME_SHOW$7);
3915
3916 this._element.classList.remove(CLASS_NAME_SHOW$7);
3917
3918 this._element.setAttribute('aria-expanded', 'false');
3919
3920 Manipulator.removeDataAttribute(this._menu, 'popper');
3921 EventHandler.trigger(this._element, EVENT_HIDDEN$4, relatedTarget);
3922 }
3923
3924 _getConfig(config) {
3925 config = { ...this.constructor.Default,
3926 ...Manipulator.getDataAttributes(this._element),
3927 ...config
3928 };
3929 typeCheckConfig(NAME$8, config, this.constructor.DefaultType);
3930
3931 if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
3932 // Popper virtual elements require a getBoundingClientRect method
3933 throw new TypeError(`${NAME$8.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
3934 }
3935
3936 return config;
3937 }
3938
3939 _getMenuElement() {
3940 return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
3941 }
3942
3943 _getPlacement() {
3944 const parentDropdown = this._element.parentNode;
3945
3946 if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
3947 return PLACEMENT_RIGHT;
3948 }
3949
3950 if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
3951 return PLACEMENT_LEFT;
3952 } // We need to trim the value because custom properties can also include spaces
3953
3954
3955 const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
3956
3957 if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
3958 return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
3959 }
3960
3961 return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
3962 }
3963
3964 _detectNavbar() {
3965 return this._element.closest(`.${CLASS_NAME_NAVBAR}`) !== null;
3966 }
3967
3968 _getOffset() {
3969 const {
3970 offset
3971 } = this._config;
3972
3973 if (typeof offset === 'string') {
3974 return offset.split(',').map(val => Number.parseInt(val, 10));
3975 }
3976
3977 if (typeof offset === 'function') {
3978 return popperData => offset(popperData, this._element);
3979 }
3980
3981 return offset;
3982 }
3983
3984 _getPopperConfig() {
3985 const defaultBsPopperConfig = {
3986 placement: this._getPlacement(),
3987 modifiers: [{
3988 name: 'preventOverflow',
3989 options: {
3990 boundary: this._config.boundary
3991 }
3992 }, {
3993 name: 'offset',
3994 options: {
3995 offset: this._getOffset()
3996 }
3997 }]
3998 }; // Disable Popper if we have a static display
3999
4000 if (this._config.display === 'static') {
4001 defaultBsPopperConfig.modifiers = [{
4002 name: 'applyStyles',
4003 enabled: false
4004 }];
4005 }
4006
4007 return { ...defaultBsPopperConfig,
4008 ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
4009 };
4010 }
4011
4012 _selectMenuItem(event) {
4013 const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible);
4014
4015 if (!items.length) {
4016 return;
4017 }
4018
4019 let index = items.indexOf(event.target); // Up
4020
4021 if (event.key === ARROW_UP_KEY && index > 0) {
4022 index--;
4023 } // Down
4024
4025
4026 if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
4027 index++;
4028 } // index is -1 if the first keydown is an ArrowUp
4029
4030
4031 index = index === -1 ? 0 : index;
4032 items[index].focus();
4033 } // Static
4034
4035
4036 static dropdownInterface(element, config) {
4037 let data = Data.get(element, DATA_KEY$7);
4038
4039 const _config = typeof config === 'object' ? config : null;
4040
4041 if (!data) {
4042 data = new Dropdown(element, _config);
4043 }
4044
4045 if (typeof config === 'string') {
4046 if (typeof data[config] === 'undefined') {
4047 throw new TypeError(`No method named "${config}"`);
4048 }
4049
4050 data[config]();
4051 }
4052 }
4053
4054 static jQueryInterface(config) {
4055 return this.each(function () {
4056 Dropdown.dropdownInterface(this, config);
4057 });
4058 }
4059
4060 static clearMenus(event) {
4061 if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
4062 return;
4063 }
4064
4065 const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$3);
4066
4067 for (let i = 0, len = toggles.length; i < len; i++) {
4068 const context = Data.get(toggles[i], DATA_KEY$7);
4069
4070 if (!context || context._config.autoClose === false) {
4071 continue;
4072 }
4073
4074 if (!context._element.classList.contains(CLASS_NAME_SHOW$7)) {
4075 continue;
4076 }
4077
4078 const relatedTarget = {
4079 relatedTarget: context._element
4080 };
4081
4082 if (event) {
4083 const composedPath = event.composedPath();
4084 const isMenuTarget = composedPath.includes(context._menu);
4085
4086 if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
4087 continue;
4088 } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
4089
4090
4091 if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
4092 continue;
4093 }
4094
4095 if (event.type === 'click') {
4096 relatedTarget.clickEvent = event;
4097 }
4098 }
4099
4100 context._completeHide(relatedTarget);
4101 }
4102 }
4103
4104 static getParentFromElement(element) {
4105 return getElementFromSelector(element) || element.parentNode;
4106 }
4107
4108 static dataApiKeydownHandler(event) {
4109 // If not input/textarea:
4110 // - And not a key in REGEXP_KEYDOWN => not a dropdown command
4111 // If input/textarea:
4112 // - If space key => not a dropdown command
4113 // - If key is other than escape
4114 // - If key is not up or down => not a dropdown command
4115 // - If trigger inside the menu => not a dropdown command
4116 if (/input|textarea/i.test(event.target.tagName) ? event.key === SPACE_KEY || event.key !== ESCAPE_KEY$2 && (event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY || event.target.closest(SELECTOR_MENU)) : !REGEXP_KEYDOWN.test(event.key)) {
4117 return;
4118 }
4119
4120 const isActive = this.classList.contains(CLASS_NAME_SHOW$7);
4121
4122 if (!isActive && event.key === ESCAPE_KEY$2) {
4123 return;
4124 }
4125
4126 event.preventDefault();
4127 event.stopPropagation();
4128
4129 if (isDisabled(this)) {
4130 return;
4131 }
4132
4133 const getToggleButton = () => this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0];
4134
4135 if (event.key === ESCAPE_KEY$2) {
4136 getToggleButton().focus();
4137 Dropdown.clearMenus();
4138 return;
4139 }
4140
4141 if (!isActive && (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY)) {
4142 getToggleButton().click();
4143 return;
4144 }
4145
4146 if (!isActive || event.key === SPACE_KEY) {
4147 Dropdown.clearMenus();
4148 return;
4149 }
4150
4151 Dropdown.getInstance(getToggleButton())._selectMenuItem(event);
4152 }
4153
4154 }
4155 /**
4156 * ------------------------------------------------------------------------
4157 * Data Api implementation
4158 * ------------------------------------------------------------------------
4159 */
4160
4161
4162 EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler);
4163 EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
4164 EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus);
4165 EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
4166 EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {
4167 event.preventDefault();
4168 Dropdown.dropdownInterface(this);
4169 });
4170 /**
4171 * ------------------------------------------------------------------------
4172 * jQuery
4173 * ------------------------------------------------------------------------
4174 * add .Dropdown to jQuery only if jQuery is present
4175 */
4176
4177 defineJQueryPlugin(Dropdown);
4178
4179 /**
4180 * --------------------------------------------------------------------------
4181 * Bootstrap (v5.0.1): util/scrollBar.js
4182 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4183 * --------------------------------------------------------------------------
4184 */
4185 const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
4186 const SELECTOR_STICKY_CONTENT = '.sticky-top';
4187
4188 const getWidth = () => {
4189 // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
4190 const documentWidth = document.documentElement.clientWidth;
4191 return Math.abs(window.innerWidth - documentWidth);
4192 };
4193
4194 const hide = (width = getWidth()) => {
4195 _disableOverFlow(); // give padding to element to balances the hidden scrollbar width
4196
4197
4198 _setElementAttributes('body', 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements, to keep shown fullwidth
4199
4200
4201 _setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);
4202
4203 _setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);
4204 };
4205
4206 const _disableOverFlow = () => {
4207 const actualValue = document.body.style.overflow;
4208
4209 if (actualValue) {
4210 Manipulator.setDataAttribute(document.body, 'overflow', actualValue);
4211 }
4212
4213 document.body.style.overflow = 'hidden';
4214 };
4215
4216 const _setElementAttributes = (selector, styleProp, callback) => {
4217 const scrollbarWidth = getWidth();
4218 SelectorEngine.find(selector).forEach(element => {
4219 if (element !== document.body && window.innerWidth > element.clientWidth + scrollbarWidth) {
4220 return;
4221 }
4222
4223 const actualValue = element.style[styleProp];
4224 const calculatedValue = window.getComputedStyle(element)[styleProp];
4225 Manipulator.setDataAttribute(element, styleProp, actualValue);
4226 element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;
4227 });
4228 };
4229
4230 const reset = () => {
4231 _resetElementAttributes('body', 'overflow');
4232
4233 _resetElementAttributes('body', 'paddingRight');
4234
4235 _resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
4236
4237 _resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
4238 };
4239
4240 const _resetElementAttributes = (selector, styleProp) => {
4241 SelectorEngine.find(selector).forEach(element => {
4242 const value = Manipulator.getDataAttribute(element, styleProp);
4243
4244 if (typeof value === 'undefined') {
4245 element.style.removeProperty(styleProp);
4246 } else {
4247 Manipulator.removeDataAttribute(element, styleProp);
4248 element.style[styleProp] = value;
4249 }
4250 });
4251 };
4252
4253 /**
4254 * --------------------------------------------------------------------------
4255 * Bootstrap (v5.0.1): util/backdrop.js
4256 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4257 * --------------------------------------------------------------------------
4258 */
4259 const Default$6 = {
4260 isVisible: true,
4261 // if false, we use the backdrop helper without adding any element to the dom
4262 isAnimated: false,
4263 rootElement: document.body,
4264 // give the choice to place backdrop under different elements
4265 clickCallback: null
4266 };
4267 const DefaultType$6 = {
4268 isVisible: 'boolean',
4269 isAnimated: 'boolean',
4270 rootElement: 'element',
4271 clickCallback: '(function|null)'
4272 };
4273 const NAME$7 = 'backdrop';
4274 const CLASS_NAME_BACKDROP = 'modal-backdrop';
4275 const CLASS_NAME_FADE$5 = 'fade';
4276 const CLASS_NAME_SHOW$6 = 'show';
4277 const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$7}`;
4278
4279 class Backdrop {
4280 constructor(config) {
4281 this._config = this._getConfig(config);
4282 this._isAppended = false;
4283 this._element = null;
4284 }
4285
4286 show(callback) {
4287 if (!this._config.isVisible) {
4288 execute(callback);
4289 return;
4290 }
4291
4292 this._append();
4293
4294 if (this._config.isAnimated) {
4295 reflow(this._getElement());
4296 }
4297
4298 this._getElement().classList.add(CLASS_NAME_SHOW$6);
4299
4300 this._emulateAnimation(() => {
4301 execute(callback);
4302 });
4303 }
4304
4305 hide(callback) {
4306 if (!this._config.isVisible) {
4307 execute(callback);
4308 return;
4309 }
4310
4311 this._getElement().classList.remove(CLASS_NAME_SHOW$6);
4312
4313 this._emulateAnimation(() => {
4314 this.dispose();
4315 execute(callback);
4316 });
4317 } // Private
4318
4319
4320 _getElement() {
4321 if (!this._element) {
4322 const backdrop = document.createElement('div');
4323 backdrop.className = CLASS_NAME_BACKDROP;
4324
4325 if (this._config.isAnimated) {
4326 backdrop.classList.add(CLASS_NAME_FADE$5);
4327 }
4328
4329 this._element = backdrop;
4330 }
4331
4332 return this._element;
4333 }
4334
4335 _getConfig(config) {
4336 config = { ...Default$6,
4337 ...(typeof config === 'object' ? config : {})
4338 };
4339 config.rootElement = config.rootElement || document.body;
4340 typeCheckConfig(NAME$7, config, DefaultType$6);
4341 return config;
4342 }
4343
4344 _append() {
4345 if (this._isAppended) {
4346 return;
4347 }
4348
4349 this._config.rootElement.appendChild(this._getElement());
4350
4351 EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
4352 execute(this._config.clickCallback);
4353 });
4354 this._isAppended = true;
4355 }
4356
4357 dispose() {
4358 if (!this._isAppended) {
4359 return;
4360 }
4361
4362 EventHandler.off(this._element, EVENT_MOUSEDOWN);
4363
4364 this._getElement().parentNode.removeChild(this._element);
4365
4366 this._isAppended = false;
4367 }
4368
4369 _emulateAnimation(callback) {
4370 if (!this._config.isAnimated) {
4371 execute(callback);
4372 return;
4373 }
4374
4375 const backdropTransitionDuration = getTransitionDurationFromElement(this._getElement());
4376 EventHandler.one(this._getElement(), 'transitionend', () => execute(callback));
4377 emulateTransitionEnd(this._getElement(), backdropTransitionDuration);
4378 }
4379
4380 }
4381
4382 /**
4383 * --------------------------------------------------------------------------
4384 * Bootstrap (v5.0.1): modal.js
4385 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4386 * --------------------------------------------------------------------------
4387 */
4388 /**
4389 * ------------------------------------------------------------------------
4390 * Constants
4391 * ------------------------------------------------------------------------
4392 */
4393
4394 const NAME$6 = 'modal';
4395 const DATA_KEY$6 = 'bs.modal';
4396 const EVENT_KEY$6 = `.${DATA_KEY$6}`;
4397 const DATA_API_KEY$3 = '.data-api';
4398 const ESCAPE_KEY$1 = 'Escape';
4399 const Default$5 = {
4400 backdrop: true,
4401 keyboard: true,
4402 focus: true
4403 };
4404 const DefaultType$5 = {
4405 backdrop: '(boolean|string)',
4406 keyboard: 'boolean',
4407 focus: 'boolean'
4408 };
4409 const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`;
4410 const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$6}`;
4411 const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
4412 const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
4413 const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
4414 const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$6}`;
4415 const EVENT_RESIZE = `resize${EVENT_KEY$6}`;
4416 const EVENT_CLICK_DISMISS$2 = `click.dismiss${EVENT_KEY$6}`;
4417 const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;
4418 const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`;
4419 const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`;
4420 const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
4421 const CLASS_NAME_OPEN = 'modal-open';
4422 const CLASS_NAME_FADE$4 = 'fade';
4423 const CLASS_NAME_SHOW$5 = 'show';
4424 const CLASS_NAME_STATIC = 'modal-static';
4425 const SELECTOR_DIALOG = '.modal-dialog';
4426 const SELECTOR_MODAL_BODY = '.modal-body';
4427 const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
4428 const SELECTOR_DATA_DISMISS$2 = '[data-bs-dismiss="modal"]';
4429 /**
4430 * ------------------------------------------------------------------------
4431 * Class Definition
4432 * ------------------------------------------------------------------------
4433 */
4434
4435 class Modal extends BaseComponent {
4436 constructor(element, config) {
4437 super(element);
4438 this._config = this._getConfig(config);
4439 this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
4440 this._backdrop = this._initializeBackDrop();
4441 this._isShown = false;
4442 this._ignoreBackdropClick = false;
4443 this._isTransitioning = false;
4444 } // Getters
4445
4446
4447 static get Default() {
4448 return Default$5;
4449 }
4450
4451 static get NAME() {
4452 return NAME$6;
4453 } // Public
4454
4455
4456 toggle(relatedTarget) {
4457 return this._isShown ? this.hide() : this.show(relatedTarget);
4458 }
4459
4460 show(relatedTarget) {
4461 if (this._isShown || this._isTransitioning) {
4462 return;
4463 }
4464
4465 if (this._isAnimated()) {
4466 this._isTransitioning = true;
4467 }
4468
4469 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
4470 relatedTarget
4471 });
4472
4473 if (this._isShown || showEvent.defaultPrevented) {
4474 return;
4475 }
4476
4477 this._isShown = true;
4478 hide();
4479 document.body.classList.add(CLASS_NAME_OPEN);
4480
4481 this._adjustDialog();
4482
4483 this._setEscapeEvent();
4484
4485 this._setResizeEvent();
4486
4487 EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, SELECTOR_DATA_DISMISS$2, event => this.hide(event));
4488 EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
4489 EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
4490 if (event.target === this._element) {
4491 this._ignoreBackdropClick = true;
4492 }
4493 });
4494 });
4495
4496 this._showBackdrop(() => this._showElement(relatedTarget));
4497 }
4498
4499 hide(event) {
4500 if (event) {
4501 event.preventDefault();
4502 }
4503
4504 if (!this._isShown || this._isTransitioning) {
4505 return;
4506 }
4507
4508 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);
4509
4510 if (hideEvent.defaultPrevented) {
4511 return;
4512 }
4513
4514 this._isShown = false;
4515
4516 const isAnimated = this._isAnimated();
4517
4518 if (isAnimated) {
4519 this._isTransitioning = true;
4520 }
4521
4522 this._setEscapeEvent();
4523
4524 this._setResizeEvent();
4525
4526 EventHandler.off(document, EVENT_FOCUSIN$2);
4527
4528 this._element.classList.remove(CLASS_NAME_SHOW$5);
4529
4530 EventHandler.off(this._element, EVENT_CLICK_DISMISS$2);
4531 EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
4532
4533 this._queueCallback(() => this._hideModal(), this._element, isAnimated);
4534 }
4535
4536 dispose() {
4537 [window, this._dialog].forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY$6));
4538
4539 this._backdrop.dispose();
4540
4541 super.dispose();
4542 /**
4543 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
4544 * Do not move `document` in `htmlElements` array
4545 * It will remove `EVENT_CLICK_DATA_API` event that should remain
4546 */
4547
4548 EventHandler.off(document, EVENT_FOCUSIN$2);
4549 }
4550
4551 handleUpdate() {
4552 this._adjustDialog();
4553 } // Private
4554
4555
4556 _initializeBackDrop() {
4557 return new Backdrop({
4558 isVisible: Boolean(this._config.backdrop),
4559 // 'static' option will be translated to true, and booleans will keep their value
4560 isAnimated: this._isAnimated()
4561 });
4562 }
4563
4564 _getConfig(config) {
4565 config = { ...Default$5,
4566 ...Manipulator.getDataAttributes(this._element),
4567 ...config
4568 };
4569 typeCheckConfig(NAME$6, config, DefaultType$5);
4570 return config;
4571 }
4572
4573 _showElement(relatedTarget) {
4574 const isAnimated = this._isAnimated();
4575
4576 const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);
4577
4578 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
4579 // Don't move modal's DOM position
4580 document.body.appendChild(this._element);
4581 }
4582
4583 this._element.style.display = 'block';
4584
4585 this._element.removeAttribute('aria-hidden');
4586
4587 this._element.setAttribute('aria-modal', true);
4588
4589 this._element.setAttribute('role', 'dialog');
4590
4591 this._element.scrollTop = 0;
4592
4593 if (modalBody) {
4594 modalBody.scrollTop = 0;
4595 }
4596
4597 if (isAnimated) {
4598 reflow(this._element);
4599 }
4600
4601 this._element.classList.add(CLASS_NAME_SHOW$5);
4602
4603 if (this._config.focus) {
4604 this._enforceFocus();
4605 }
4606
4607 const transitionComplete = () => {
4608 if (this._config.focus) {
4609 this._element.focus();
4610 }
4611
4612 this._isTransitioning = false;
4613 EventHandler.trigger(this._element, EVENT_SHOWN$3, {
4614 relatedTarget
4615 });
4616 };
4617
4618 this._queueCallback(transitionComplete, this._dialog, isAnimated);
4619 }
4620
4621 _enforceFocus() {
4622 EventHandler.off(document, EVENT_FOCUSIN$2); // guard against infinite focus loop
4623
4624 EventHandler.on(document, EVENT_FOCUSIN$2, event => {
4625 if (document !== event.target && this._element !== event.target && !this._element.contains(event.target)) {
4626 this._element.focus();
4627 }
4628 });
4629 }
4630
4631 _setEscapeEvent() {
4632 if (this._isShown) {
4633 EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
4634 if (this._config.keyboard && event.key === ESCAPE_KEY$1) {
4635 event.preventDefault();
4636 this.hide();
4637 } else if (!this._config.keyboard && event.key === ESCAPE_KEY$1) {
4638 this._triggerBackdropTransition();
4639 }
4640 });
4641 } else {
4642 EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS$1);
4643 }
4644 }
4645
4646 _setResizeEvent() {
4647 if (this._isShown) {
4648 EventHandler.on(window, EVENT_RESIZE, () => this._adjustDialog());
4649 } else {
4650 EventHandler.off(window, EVENT_RESIZE);
4651 }
4652 }
4653
4654 _hideModal() {
4655 this._element.style.display = 'none';
4656
4657 this._element.setAttribute('aria-hidden', true);
4658
4659 this._element.removeAttribute('aria-modal');
4660
4661 this._element.removeAttribute('role');
4662
4663 this._isTransitioning = false;
4664
4665 this._backdrop.hide(() => {
4666 document.body.classList.remove(CLASS_NAME_OPEN);
4667
4668 this._resetAdjustments();
4669
4670 reset();
4671 EventHandler.trigger(this._element, EVENT_HIDDEN$3);
4672 });
4673 }
4674
4675 _showBackdrop(callback) {
4676 EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, event => {
4677 if (this._ignoreBackdropClick) {
4678 this._ignoreBackdropClick = false;
4679 return;
4680 }
4681
4682 if (event.target !== event.currentTarget) {
4683 return;
4684 }
4685
4686 if (this._config.backdrop === true) {
4687 this.hide();
4688 } else if (this._config.backdrop === 'static') {
4689 this._triggerBackdropTransition();
4690 }
4691 });
4692
4693 this._backdrop.show(callback);
4694 }
4695
4696 _isAnimated() {
4697 return this._element.classList.contains(CLASS_NAME_FADE$4);
4698 }
4699
4700 _triggerBackdropTransition() {
4701 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
4702
4703 if (hideEvent.defaultPrevented) {
4704 return;
4705 }
4706
4707 const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
4708
4709 if (!isModalOverflowing) {
4710 this._element.style.overflowY = 'hidden';
4711 }
4712
4713 this._element.classList.add(CLASS_NAME_STATIC);
4714
4715 const modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
4716 EventHandler.off(this._element, 'transitionend');
4717 EventHandler.one(this._element, 'transitionend', () => {
4718 this._element.classList.remove(CLASS_NAME_STATIC);
4719
4720 if (!isModalOverflowing) {
4721 EventHandler.one(this._element, 'transitionend', () => {
4722 this._element.style.overflowY = '';
4723 });
4724 emulateTransitionEnd(this._element, modalTransitionDuration);
4725 }
4726 });
4727 emulateTransitionEnd(this._element, modalTransitionDuration);
4728
4729 this._element.focus();
4730 } // ----------------------------------------------------------------------
4731 // the following methods are used to handle overflowing modals
4732 // ----------------------------------------------------------------------
4733
4734
4735 _adjustDialog() {
4736 const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
4737 const scrollbarWidth = getWidth();
4738 const isBodyOverflowing = scrollbarWidth > 0;
4739
4740 if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) {
4741 this._element.style.paddingLeft = `${scrollbarWidth}px`;
4742 }
4743
4744 if (isBodyOverflowing && !isModalOverflowing && !isRTL() || !isBodyOverflowing && isModalOverflowing && isRTL()) {
4745 this._element.style.paddingRight = `${scrollbarWidth}px`;
4746 }
4747 }
4748
4749 _resetAdjustments() {
4750 this._element.style.paddingLeft = '';
4751 this._element.style.paddingRight = '';
4752 } // Static
4753
4754
4755 static jQueryInterface(config, relatedTarget) {
4756 return this.each(function () {
4757 const data = Modal.getInstance(this) || new Modal(this, typeof config === 'object' ? config : {});
4758
4759 if (typeof config !== 'string') {
4760 return;
4761 }
4762
4763 if (typeof data[config] === 'undefined') {
4764 throw new TypeError(`No method named "${config}"`);
4765 }
4766
4767 data[config](relatedTarget);
4768 });
4769 }
4770
4771 }
4772 /**
4773 * ------------------------------------------------------------------------
4774 * Data Api implementation
4775 * ------------------------------------------------------------------------
4776 */
4777
4778
4779 EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {
4780 const target = getElementFromSelector(this);
4781
4782 if (['A', 'AREA'].includes(this.tagName)) {
4783 event.preventDefault();
4784 }
4785
4786 EventHandler.one(target, EVENT_SHOW$3, showEvent => {
4787 if (showEvent.defaultPrevented) {
4788 // only register focus restorer if modal will actually get shown
4789 return;
4790 }
4791
4792 EventHandler.one(target, EVENT_HIDDEN$3, () => {
4793 if (isVisible(this)) {
4794 this.focus();
4795 }
4796 });
4797 });
4798 const data = Modal.getInstance(target) || new Modal(target);
4799 data.toggle(this);
4800 });
4801 /**
4802 * ------------------------------------------------------------------------
4803 * jQuery
4804 * ------------------------------------------------------------------------
4805 * add .Modal to jQuery only if jQuery is present
4806 */
4807
4808 defineJQueryPlugin(Modal);
4809
4810 /**
4811 * --------------------------------------------------------------------------
4812 * Bootstrap (v5.0.1): offcanvas.js
4813 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4814 * --------------------------------------------------------------------------
4815 */
4816 /**
4817 * ------------------------------------------------------------------------
4818 * Constants
4819 * ------------------------------------------------------------------------
4820 */
4821
4822 const NAME$5 = 'offcanvas';
4823 const DATA_KEY$5 = 'bs.offcanvas';
4824 const EVENT_KEY$5 = `.${DATA_KEY$5}`;
4825 const DATA_API_KEY$2 = '.data-api';
4826 const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$5}${DATA_API_KEY$2}`;
4827 const ESCAPE_KEY = 'Escape';
4828 const Default$4 = {
4829 backdrop: true,
4830 keyboard: true,
4831 scroll: false
4832 };
4833 const DefaultType$4 = {
4834 backdrop: 'boolean',
4835 keyboard: 'boolean',
4836 scroll: 'boolean'
4837 };
4838 const CLASS_NAME_SHOW$4 = 'show';
4839 const OPEN_SELECTOR = '.offcanvas.show';
4840 const EVENT_SHOW$2 = `show${EVENT_KEY$5}`;
4841 const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`;
4842 const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`;
4843 const EVENT_HIDDEN$2 = `hidden${EVENT_KEY$5}`;
4844 const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$5}`;
4845 const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`;
4846 const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$5}`;
4847 const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;
4848 const SELECTOR_DATA_DISMISS$1 = '[data-bs-dismiss="offcanvas"]';
4849 const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]';
4850 /**
4851 * ------------------------------------------------------------------------
4852 * Class Definition
4853 * ------------------------------------------------------------------------
4854 */
4855
4856 class Offcanvas extends BaseComponent {
4857 constructor(element, config) {
4858 super(element);
4859 this._config = this._getConfig(config);
4860 this._isShown = false;
4861 this._backdrop = this._initializeBackDrop();
4862
4863 this._addEventListeners();
4864 } // Getters
4865
4866
4867 static get NAME() {
4868 return NAME$5;
4869 }
4870
4871 static get Default() {
4872 return Default$4;
4873 } // Public
4874
4875
4876 toggle(relatedTarget) {
4877 return this._isShown ? this.hide() : this.show(relatedTarget);
4878 }
4879
4880 show(relatedTarget) {
4881 if (this._isShown) {
4882 return;
4883 }
4884
4885 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$2, {
4886 relatedTarget
4887 });
4888
4889 if (showEvent.defaultPrevented) {
4890 return;
4891 }
4892
4893 this._isShown = true;
4894 this._element.style.visibility = 'visible';
4895
4896 this._backdrop.show();
4897
4898 if (!this._config.scroll) {
4899 hide();
4900
4901 this._enforceFocusOnElement(this._element);
4902 }
4903
4904 this._element.removeAttribute('aria-hidden');
4905
4906 this._element.setAttribute('aria-modal', true);
4907
4908 this._element.setAttribute('role', 'dialog');
4909
4910 this._element.classList.add(CLASS_NAME_SHOW$4);
4911
4912 const completeCallBack = () => {
4913 EventHandler.trigger(this._element, EVENT_SHOWN$2, {
4914 relatedTarget
4915 });
4916 };
4917
4918 this._queueCallback(completeCallBack, this._element, true);
4919 }
4920
4921 hide() {
4922 if (!this._isShown) {
4923 return;
4924 }
4925
4926 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$2);
4927
4928 if (hideEvent.defaultPrevented) {
4929 return;
4930 }
4931
4932 EventHandler.off(document, EVENT_FOCUSIN$1);
4933
4934 this._element.blur();
4935
4936 this._isShown = false;
4937
4938 this._element.classList.remove(CLASS_NAME_SHOW$4);
4939
4940 this._backdrop.hide();
4941
4942 const completeCallback = () => {
4943 this._element.setAttribute('aria-hidden', true);
4944
4945 this._element.removeAttribute('aria-modal');
4946
4947 this._element.removeAttribute('role');
4948
4949 this._element.style.visibility = 'hidden';
4950
4951 if (!this._config.scroll) {
4952 reset();
4953 }
4954
4955 EventHandler.trigger(this._element, EVENT_HIDDEN$2);
4956 };
4957
4958 this._queueCallback(completeCallback, this._element, true);
4959 }
4960
4961 dispose() {
4962 this._backdrop.dispose();
4963
4964 super.dispose();
4965 EventHandler.off(document, EVENT_FOCUSIN$1);
4966 } // Private
4967
4968
4969 _getConfig(config) {
4970 config = { ...Default$4,
4971 ...Manipulator.getDataAttributes(this._element),
4972 ...(typeof config === 'object' ? config : {})
4973 };
4974 typeCheckConfig(NAME$5, config, DefaultType$4);
4975 return config;
4976 }
4977
4978 _initializeBackDrop() {
4979 return new Backdrop({
4980 isVisible: this._config.backdrop,
4981 isAnimated: true,
4982 rootElement: this._element.parentNode,
4983 clickCallback: () => this.hide()
4984 });
4985 }
4986
4987 _enforceFocusOnElement(element) {
4988 EventHandler.off(document, EVENT_FOCUSIN$1); // guard against infinite focus loop
4989
4990 EventHandler.on(document, EVENT_FOCUSIN$1, event => {
4991 if (document !== event.target && element !== event.target && !element.contains(event.target)) {
4992 element.focus();
4993 }
4994 });
4995 element.focus();
4996 }
4997
4998 _addEventListeners() {
4999 EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
5000 EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
5001 if (this._config.keyboard && event.key === ESCAPE_KEY) {
5002 this.hide();
5003 }
5004 });
5005 } // Static
5006
5007
5008 static jQueryInterface(config) {
5009 return this.each(function () {
5010 const data = Data.get(this, DATA_KEY$5) || new Offcanvas(this, typeof config === 'object' ? config : {});
5011
5012 if (typeof config !== 'string') {
5013 return;
5014 }
5015
5016 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
5017 throw new TypeError(`No method named "${config}"`);
5018 }
5019
5020 data[config](this);
5021 });
5022 }
5023
5024 }
5025 /**
5026 * ------------------------------------------------------------------------
5027 * Data Api implementation
5028 * ------------------------------------------------------------------------
5029 */
5030
5031
5032 EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {
5033 const target = getElementFromSelector(this);
5034
5035 if (['A', 'AREA'].includes(this.tagName)) {
5036 event.preventDefault();
5037 }
5038
5039 if (isDisabled(this)) {
5040 return;
5041 }
5042
5043 EventHandler.one(target, EVENT_HIDDEN$2, () => {
5044 // focus on trigger when it is closed
5045 if (isVisible(this)) {
5046 this.focus();
5047 }
5048 }); // avoid conflict when clicking a toggler of an offcanvas, while another is open
5049
5050 const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);
5051
5052 if (allReadyOpen && allReadyOpen !== target) {
5053 Offcanvas.getInstance(allReadyOpen).hide();
5054 }
5055
5056 const data = Data.get(target, DATA_KEY$5) || new Offcanvas(target);
5057 data.toggle(this);
5058 });
5059 EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => {
5060 SelectorEngine.find(OPEN_SELECTOR).forEach(el => (Data.get(el, DATA_KEY$5) || new Offcanvas(el)).show());
5061 });
5062 /**
5063 * ------------------------------------------------------------------------
5064 * jQuery
5065 * ------------------------------------------------------------------------
5066 */
5067
5068 defineJQueryPlugin(Offcanvas);
5069
5070 /**
5071 * --------------------------------------------------------------------------
5072 * Bootstrap (v5.0.1): util/sanitizer.js
5073 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5074 * --------------------------------------------------------------------------
5075 */
5076 const uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
5077 const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
5078 /**
5079 * A pattern that recognizes a commonly useful subset of URLs that are safe.
5080 *
5081 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
5082 */
5083
5084 const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
5085 /**
5086 * A pattern that matches safe data URLs. Only matches image, video and audio types.
5087 *
5088 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
5089 */
5090
5091 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;
5092
5093 const allowedAttribute = (attr, allowedAttributeList) => {
5094 const attrName = attr.nodeName.toLowerCase();
5095
5096 if (allowedAttributeList.includes(attrName)) {
5097 if (uriAttrs.has(attrName)) {
5098 return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
5099 }
5100
5101 return true;
5102 }
5103
5104 const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp); // Check if a regular expression validates the attribute.
5105
5106 for (let i = 0, len = regExp.length; i < len; i++) {
5107 if (regExp[i].test(attrName)) {
5108 return true;
5109 }
5110 }
5111
5112 return false;
5113 };
5114
5115 const DefaultAllowlist = {
5116 // Global attributes allowed on any supplied element below.
5117 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
5118 a: ['target', 'href', 'title', 'rel'],
5119 area: [],
5120 b: [],
5121 br: [],
5122 col: [],
5123 code: [],
5124 div: [],
5125 em: [],
5126 hr: [],
5127 h1: [],
5128 h2: [],
5129 h3: [],
5130 h4: [],
5131 h5: [],
5132 h6: [],
5133 i: [],
5134 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
5135 li: [],
5136 ol: [],
5137 p: [],
5138 pre: [],
5139 s: [],
5140 small: [],
5141 span: [],
5142 sub: [],
5143 sup: [],
5144 strong: [],
5145 u: [],
5146 ul: []
5147 };
5148 function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
5149 if (!unsafeHtml.length) {
5150 return unsafeHtml;
5151 }
5152
5153 if (sanitizeFn && typeof sanitizeFn === 'function') {
5154 return sanitizeFn(unsafeHtml);
5155 }
5156
5157 const domParser = new window.DOMParser();
5158 const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
5159 const allowlistKeys = Object.keys(allowList);
5160 const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
5161
5162 for (let i = 0, len = elements.length; i < len; i++) {
5163 const el = elements[i];
5164 const elName = el.nodeName.toLowerCase();
5165
5166 if (!allowlistKeys.includes(elName)) {
5167 el.parentNode.removeChild(el);
5168 continue;
5169 }
5170
5171 const attributeList = [].concat(...el.attributes);
5172 const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
5173 attributeList.forEach(attr => {
5174 if (!allowedAttribute(attr, allowedAttributes)) {
5175 el.removeAttribute(attr.nodeName);
5176 }
5177 });
5178 }
5179
5180 return createdDocument.body.innerHTML;
5181 }
5182
5183 /**
5184 * --------------------------------------------------------------------------
5185 * Bootstrap (v5.0.1): tooltip.js
5186 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5187 * --------------------------------------------------------------------------
5188 */
5189 /**
5190 * ------------------------------------------------------------------------
5191 * Constants
5192 * ------------------------------------------------------------------------
5193 */
5194
5195 const NAME$4 = 'tooltip';
5196 const DATA_KEY$4 = 'bs.tooltip';
5197 const EVENT_KEY$4 = `.${DATA_KEY$4}`;
5198 const CLASS_PREFIX$1 = 'bs-tooltip';
5199 const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g');
5200 const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
5201 const DefaultType$3 = {
5202 animation: 'boolean',
5203 template: 'string',
5204 title: '(string|element|function)',
5205 trigger: 'string',
5206 delay: '(number|object)',
5207 html: 'boolean',
5208 selector: '(string|boolean)',
5209 placement: '(string|function)',
5210 offset: '(array|string|function)',
5211 container: '(string|element|boolean)',
5212 fallbackPlacements: 'array',
5213 boundary: '(string|element)',
5214 customClass: '(string|function)',
5215 sanitize: 'boolean',
5216 sanitizeFn: '(null|function)',
5217 allowList: 'object',
5218 popperConfig: '(null|object|function)'
5219 };
5220 const AttachmentMap = {
5221 AUTO: 'auto',
5222 TOP: 'top',
5223 RIGHT: isRTL() ? 'left' : 'right',
5224 BOTTOM: 'bottom',
5225 LEFT: isRTL() ? 'right' : 'left'
5226 };
5227 const Default$3 = {
5228 animation: true,
5229 template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
5230 trigger: 'hover focus',
5231 title: '',
5232 delay: 0,
5233 html: false,
5234 selector: false,
5235 placement: 'top',
5236 offset: [0, 0],
5237 container: false,
5238 fallbackPlacements: ['top', 'right', 'bottom', 'left'],
5239 boundary: 'clippingParents',
5240 customClass: '',
5241 sanitize: true,
5242 sanitizeFn: null,
5243 allowList: DefaultAllowlist,
5244 popperConfig: null
5245 };
5246 const Event$2 = {
5247 HIDE: `hide${EVENT_KEY$4}`,
5248 HIDDEN: `hidden${EVENT_KEY$4}`,
5249 SHOW: `show${EVENT_KEY$4}`,
5250 SHOWN: `shown${EVENT_KEY$4}`,
5251 INSERTED: `inserted${EVENT_KEY$4}`,
5252 CLICK: `click${EVENT_KEY$4}`,
5253 FOCUSIN: `focusin${EVENT_KEY$4}`,
5254 FOCUSOUT: `focusout${EVENT_KEY$4}`,
5255 MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
5256 MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
5257 };
5258 const CLASS_NAME_FADE$3 = 'fade';
5259 const CLASS_NAME_MODAL = 'modal';
5260 const CLASS_NAME_SHOW$3 = 'show';
5261 const HOVER_STATE_SHOW = 'show';
5262 const HOVER_STATE_OUT = 'out';
5263 const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
5264 const TRIGGER_HOVER = 'hover';
5265 const TRIGGER_FOCUS = 'focus';
5266 const TRIGGER_CLICK = 'click';
5267 const TRIGGER_MANUAL = 'manual';
5268 /**
5269 * ------------------------------------------------------------------------
5270 * Class Definition
5271 * ------------------------------------------------------------------------
5272 */
5273
5274 class Tooltip extends BaseComponent {
5275 constructor(element, config) {
5276 if (typeof Popper === 'undefined') {
5277 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
5278 }
5279
5280 super(element); // private
5281
5282 this._isEnabled = true;
5283 this._timeout = 0;
5284 this._hoverState = '';
5285 this._activeTrigger = {};
5286 this._popper = null; // Protected
5287
5288 this._config = this._getConfig(config);
5289 this.tip = null;
5290
5291 this._setListeners();
5292 } // Getters
5293
5294
5295 static get Default() {
5296 return Default$3;
5297 }
5298
5299 static get NAME() {
5300 return NAME$4;
5301 }
5302
5303 static get Event() {
5304 return Event$2;
5305 }
5306
5307 static get DefaultType() {
5308 return DefaultType$3;
5309 } // Public
5310
5311
5312 enable() {
5313 this._isEnabled = true;
5314 }
5315
5316 disable() {
5317 this._isEnabled = false;
5318 }
5319
5320 toggleEnabled() {
5321 this._isEnabled = !this._isEnabled;
5322 }
5323
5324 toggle(event) {
5325 if (!this._isEnabled) {
5326 return;
5327 }
5328
5329 if (event) {
5330 const context = this._initializeOnDelegatedTarget(event);
5331
5332 context._activeTrigger.click = !context._activeTrigger.click;
5333
5334 if (context._isWithActiveTrigger()) {
5335 context._enter(null, context);
5336 } else {
5337 context._leave(null, context);
5338 }
5339 } else {
5340 if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$3)) {
5341 this._leave(null, this);
5342
5343 return;
5344 }
5345
5346 this._enter(null, this);
5347 }
5348 }
5349
5350 dispose() {
5351 clearTimeout(this._timeout);
5352 EventHandler.off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
5353
5354 if (this.tip && this.tip.parentNode) {
5355 this.tip.parentNode.removeChild(this.tip);
5356 }
5357
5358 if (this._popper) {
5359 this._popper.destroy();
5360 }
5361
5362 super.dispose();
5363 }
5364
5365 show() {
5366 if (this._element.style.display === 'none') {
5367 throw new Error('Please use show on visible elements');
5368 }
5369
5370 if (!(this.isWithContent() && this._isEnabled)) {
5371 return;
5372 }
5373
5374 const showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW);
5375 const shadowRoot = findShadowRoot(this._element);
5376 const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
5377
5378 if (showEvent.defaultPrevented || !isInTheDom) {
5379 return;
5380 }
5381
5382 const tip = this.getTipElement();
5383 const tipId = getUID(this.constructor.NAME);
5384 tip.setAttribute('id', tipId);
5385
5386 this._element.setAttribute('aria-describedby', tipId);
5387
5388 this.setContent();
5389
5390 if (this._config.animation) {
5391 tip.classList.add(CLASS_NAME_FADE$3);
5392 }
5393
5394 const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
5395
5396 const attachment = this._getAttachment(placement);
5397
5398 this._addAttachmentClass(attachment);
5399
5400 const {
5401 container
5402 } = this._config;
5403 Data.set(tip, this.constructor.DATA_KEY, this);
5404
5405 if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
5406 container.appendChild(tip);
5407 EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
5408 }
5409
5410 if (this._popper) {
5411 this._popper.update();
5412 } else {
5413 this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));
5414 }
5415
5416 tip.classList.add(CLASS_NAME_SHOW$3);
5417 const customClass = typeof this._config.customClass === 'function' ? this._config.customClass() : this._config.customClass;
5418
5419 if (customClass) {
5420 tip.classList.add(...customClass.split(' '));
5421 } // If this is a touch-enabled device we add extra
5422 // empty mouseover listeners to the body's immediate children;
5423 // only needed because of broken event delegation on iOS
5424 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
5425
5426
5427 if ('ontouchstart' in document.documentElement) {
5428 [].concat(...document.body.children).forEach(element => {
5429 EventHandler.on(element, 'mouseover', noop);
5430 });
5431 }
5432
5433 const complete = () => {
5434 const prevHoverState = this._hoverState;
5435 this._hoverState = null;
5436 EventHandler.trigger(this._element, this.constructor.Event.SHOWN);
5437
5438 if (prevHoverState === HOVER_STATE_OUT) {
5439 this._leave(null, this);
5440 }
5441 };
5442
5443 const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
5444
5445 this._queueCallback(complete, this.tip, isAnimated);
5446 }
5447
5448 hide() {
5449 if (!this._popper) {
5450 return;
5451 }
5452
5453 const tip = this.getTipElement();
5454
5455 const complete = () => {
5456 if (this._isWithActiveTrigger()) {
5457 return;
5458 }
5459
5460 if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
5461 tip.parentNode.removeChild(tip);
5462 }
5463
5464 this._cleanTipClass();
5465
5466 this._element.removeAttribute('aria-describedby');
5467
5468 EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
5469
5470 if (this._popper) {
5471 this._popper.destroy();
5472
5473 this._popper = null;
5474 }
5475 };
5476
5477 const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
5478
5479 if (hideEvent.defaultPrevented) {
5480 return;
5481 }
5482
5483 tip.classList.remove(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra
5484 // empty mouseover listeners we added for iOS support
5485
5486 if ('ontouchstart' in document.documentElement) {
5487 [].concat(...document.body.children).forEach(element => EventHandler.off(element, 'mouseover', noop));
5488 }
5489
5490 this._activeTrigger[TRIGGER_CLICK] = false;
5491 this._activeTrigger[TRIGGER_FOCUS] = false;
5492 this._activeTrigger[TRIGGER_HOVER] = false;
5493 const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3);
5494
5495 this._queueCallback(complete, this.tip, isAnimated);
5496
5497 this._hoverState = '';
5498 }
5499
5500 update() {
5501 if (this._popper !== null) {
5502 this._popper.update();
5503 }
5504 } // Protected
5505
5506
5507 isWithContent() {
5508 return Boolean(this.getTitle());
5509 }
5510
5511 getTipElement() {
5512 if (this.tip) {
5513 return this.tip;
5514 }
5515
5516 const element = document.createElement('div');
5517 element.innerHTML = this._config.template;
5518 this.tip = element.children[0];
5519 return this.tip;
5520 }
5521
5522 setContent() {
5523 const tip = this.getTipElement();
5524 this.setElementContent(SelectorEngine.findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
5525 tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3);
5526 }
5527
5528 setElementContent(element, content) {
5529 if (element === null) {
5530 return;
5531 }
5532
5533 if (isElement$1(content)) {
5534 content = getElement(content); // content is a DOM node or a jQuery
5535
5536 if (this._config.html) {
5537 if (content.parentNode !== element) {
5538 element.innerHTML = '';
5539 element.appendChild(content);
5540 }
5541 } else {
5542 element.textContent = content.textContent;
5543 }
5544
5545 return;
5546 }
5547
5548 if (this._config.html) {
5549 if (this._config.sanitize) {
5550 content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);
5551 }
5552
5553 element.innerHTML = content;
5554 } else {
5555 element.textContent = content;
5556 }
5557 }
5558
5559 getTitle() {
5560 let title = this._element.getAttribute('data-bs-original-title');
5561
5562 if (!title) {
5563 title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
5564 }
5565
5566 return title;
5567 }
5568
5569 updateAttachment(attachment) {
5570 if (attachment === 'right') {
5571 return 'end';
5572 }
5573
5574 if (attachment === 'left') {
5575 return 'start';
5576 }
5577
5578 return attachment;
5579 } // Private
5580
5581
5582 _initializeOnDelegatedTarget(event, context) {
5583 const dataKey = this.constructor.DATA_KEY;
5584 context = context || Data.get(event.delegateTarget, dataKey);
5585
5586 if (!context) {
5587 context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
5588 Data.set(event.delegateTarget, dataKey, context);
5589 }
5590
5591 return context;
5592 }
5593
5594 _getOffset() {
5595 const {
5596 offset
5597 } = this._config;
5598
5599 if (typeof offset === 'string') {
5600 return offset.split(',').map(val => Number.parseInt(val, 10));
5601 }
5602
5603 if (typeof offset === 'function') {
5604 return popperData => offset(popperData, this._element);
5605 }
5606
5607 return offset;
5608 }
5609
5610 _getPopperConfig(attachment) {
5611 const defaultBsPopperConfig = {
5612 placement: attachment,
5613 modifiers: [{
5614 name: 'flip',
5615 options: {
5616 fallbackPlacements: this._config.fallbackPlacements
5617 }
5618 }, {
5619 name: 'offset',
5620 options: {
5621 offset: this._getOffset()
5622 }
5623 }, {
5624 name: 'preventOverflow',
5625 options: {
5626 boundary: this._config.boundary
5627 }
5628 }, {
5629 name: 'arrow',
5630 options: {
5631 element: `.${this.constructor.NAME}-arrow`
5632 }
5633 }, {
5634 name: 'onChange',
5635 enabled: true,
5636 phase: 'afterWrite',
5637 fn: data => this._handlePopperPlacementChange(data)
5638 }],
5639 onFirstUpdate: data => {
5640 if (data.options.placement !== data.placement) {
5641 this._handlePopperPlacementChange(data);
5642 }
5643 }
5644 };
5645 return { ...defaultBsPopperConfig,
5646 ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
5647 };
5648 }
5649
5650 _addAttachmentClass(attachment) {
5651 this.getTipElement().classList.add(`${CLASS_PREFIX$1}-${this.updateAttachment(attachment)}`);
5652 }
5653
5654 _getAttachment(placement) {
5655 return AttachmentMap[placement.toUpperCase()];
5656 }
5657
5658 _setListeners() {
5659 const triggers = this._config.trigger.split(' ');
5660
5661 triggers.forEach(trigger => {
5662 if (trigger === 'click') {
5663 EventHandler.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event));
5664 } else if (trigger !== TRIGGER_MANUAL) {
5665 const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;
5666 const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;
5667 EventHandler.on(this._element, eventIn, this._config.selector, event => this._enter(event));
5668 EventHandler.on(this._element, eventOut, this._config.selector, event => this._leave(event));
5669 }
5670 });
5671
5672 this._hideModalHandler = () => {
5673 if (this._element) {
5674 this.hide();
5675 }
5676 };
5677
5678 EventHandler.on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
5679
5680 if (this._config.selector) {
5681 this._config = { ...this._config,
5682 trigger: 'manual',
5683 selector: ''
5684 };
5685 } else {
5686 this._fixTitle();
5687 }
5688 }
5689
5690 _fixTitle() {
5691 const title = this._element.getAttribute('title');
5692
5693 const originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
5694
5695 if (title || originalTitleType !== 'string') {
5696 this._element.setAttribute('data-bs-original-title', title || '');
5697
5698 if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
5699 this._element.setAttribute('aria-label', title);
5700 }
5701
5702 this._element.setAttribute('title', '');
5703 }
5704 }
5705
5706 _enter(event, context) {
5707 context = this._initializeOnDelegatedTarget(event, context);
5708
5709 if (event) {
5710 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
5711 }
5712
5713 if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {
5714 context._hoverState = HOVER_STATE_SHOW;
5715 return;
5716 }
5717
5718 clearTimeout(context._timeout);
5719 context._hoverState = HOVER_STATE_SHOW;
5720
5721 if (!context._config.delay || !context._config.delay.show) {
5722 context.show();
5723 return;
5724 }
5725
5726 context._timeout = setTimeout(() => {
5727 if (context._hoverState === HOVER_STATE_SHOW) {
5728 context.show();
5729 }
5730 }, context._config.delay.show);
5731 }
5732
5733 _leave(event, context) {
5734 context = this._initializeOnDelegatedTarget(event, context);
5735
5736 if (event) {
5737 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
5738 }
5739
5740 if (context._isWithActiveTrigger()) {
5741 return;
5742 }
5743
5744 clearTimeout(context._timeout);
5745 context._hoverState = HOVER_STATE_OUT;
5746
5747 if (!context._config.delay || !context._config.delay.hide) {
5748 context.hide();
5749 return;
5750 }
5751
5752 context._timeout = setTimeout(() => {
5753 if (context._hoverState === HOVER_STATE_OUT) {
5754 context.hide();
5755 }
5756 }, context._config.delay.hide);
5757 }
5758
5759 _isWithActiveTrigger() {
5760 for (const trigger in this._activeTrigger) {
5761 if (this._activeTrigger[trigger]) {
5762 return true;
5763 }
5764 }
5765
5766 return false;
5767 }
5768
5769 _getConfig(config) {
5770 const dataAttributes = Manipulator.getDataAttributes(this._element);
5771 Object.keys(dataAttributes).forEach(dataAttr => {
5772 if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
5773 delete dataAttributes[dataAttr];
5774 }
5775 });
5776 config = { ...this.constructor.Default,
5777 ...dataAttributes,
5778 ...(typeof config === 'object' && config ? config : {})
5779 };
5780 config.container = config.container === false ? document.body : getElement(config.container);
5781
5782 if (typeof config.delay === 'number') {
5783 config.delay = {
5784 show: config.delay,
5785 hide: config.delay
5786 };
5787 }
5788
5789 if (typeof config.title === 'number') {
5790 config.title = config.title.toString();
5791 }
5792
5793 if (typeof config.content === 'number') {
5794 config.content = config.content.toString();
5795 }
5796
5797 typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
5798
5799 if (config.sanitize) {
5800 config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
5801 }
5802
5803 return config;
5804 }
5805
5806 _getDelegateConfig() {
5807 const config = {};
5808
5809 if (this._config) {
5810 for (const key in this._config) {
5811 if (this.constructor.Default[key] !== this._config[key]) {
5812 config[key] = this._config[key];
5813 }
5814 }
5815 }
5816
5817 return config;
5818 }
5819
5820 _cleanTipClass() {
5821 const tip = this.getTipElement();
5822 const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
5823
5824 if (tabClass !== null && tabClass.length > 0) {
5825 tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
5826 }
5827 }
5828
5829 _handlePopperPlacementChange(popperData) {
5830 const {
5831 state
5832 } = popperData;
5833
5834 if (!state) {
5835 return;
5836 }
5837
5838 this.tip = state.elements.popper;
5839
5840 this._cleanTipClass();
5841
5842 this._addAttachmentClass(this._getAttachment(state.placement));
5843 } // Static
5844
5845
5846 static jQueryInterface(config) {
5847 return this.each(function () {
5848 let data = Data.get(this, DATA_KEY$4);
5849
5850 const _config = typeof config === 'object' && config;
5851
5852 if (!data && /dispose|hide/.test(config)) {
5853 return;
5854 }
5855
5856 if (!data) {
5857 data = new Tooltip(this, _config);
5858 }
5859
5860 if (typeof config === 'string') {
5861 if (typeof data[config] === 'undefined') {
5862 throw new TypeError(`No method named "${config}"`);
5863 }
5864
5865 data[config]();
5866 }
5867 });
5868 }
5869
5870 }
5871 /**
5872 * ------------------------------------------------------------------------
5873 * jQuery
5874 * ------------------------------------------------------------------------
5875 * add .Tooltip to jQuery only if jQuery is present
5876 */
5877
5878
5879 defineJQueryPlugin(Tooltip);
5880
5881 /**
5882 * --------------------------------------------------------------------------
5883 * Bootstrap (v5.0.1): popover.js
5884 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5885 * --------------------------------------------------------------------------
5886 */
5887 /**
5888 * ------------------------------------------------------------------------
5889 * Constants
5890 * ------------------------------------------------------------------------
5891 */
5892
5893 const NAME$3 = 'popover';
5894 const DATA_KEY$3 = 'bs.popover';
5895 const EVENT_KEY$3 = `.${DATA_KEY$3}`;
5896 const CLASS_PREFIX = 'bs-popover';
5897 const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
5898 const Default$2 = { ...Tooltip.Default,
5899 placement: 'right',
5900 offset: [0, 8],
5901 trigger: 'click',
5902 content: '',
5903 template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>'
5904 };
5905 const DefaultType$2 = { ...Tooltip.DefaultType,
5906 content: '(string|element|function)'
5907 };
5908 const Event$1 = {
5909 HIDE: `hide${EVENT_KEY$3}`,
5910 HIDDEN: `hidden${EVENT_KEY$3}`,
5911 SHOW: `show${EVENT_KEY$3}`,
5912 SHOWN: `shown${EVENT_KEY$3}`,
5913 INSERTED: `inserted${EVENT_KEY$3}`,
5914 CLICK: `click${EVENT_KEY$3}`,
5915 FOCUSIN: `focusin${EVENT_KEY$3}`,
5916 FOCUSOUT: `focusout${EVENT_KEY$3}`,
5917 MOUSEENTER: `mouseenter${EVENT_KEY$3}`,
5918 MOUSELEAVE: `mouseleave${EVENT_KEY$3}`
5919 };
5920 const CLASS_NAME_FADE$2 = 'fade';
5921 const CLASS_NAME_SHOW$2 = 'show';
5922 const SELECTOR_TITLE = '.popover-header';
5923 const SELECTOR_CONTENT = '.popover-body';
5924 /**
5925 * ------------------------------------------------------------------------
5926 * Class Definition
5927 * ------------------------------------------------------------------------
5928 */
5929
5930 class Popover extends Tooltip {
5931 // Getters
5932 static get Default() {
5933 return Default$2;
5934 }
5935
5936 static get NAME() {
5937 return NAME$3;
5938 }
5939
5940 static get Event() {
5941 return Event$1;
5942 }
5943
5944 static get DefaultType() {
5945 return DefaultType$2;
5946 } // Overrides
5947
5948
5949 isWithContent() {
5950 return this.getTitle() || this._getContent();
5951 }
5952
5953 setContent() {
5954 const tip = this.getTipElement(); // we use append for html objects to maintain js events
5955
5956 this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
5957
5958 let content = this._getContent();
5959
5960 if (typeof content === 'function') {
5961 content = content.call(this._element);
5962 }
5963
5964 this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
5965 tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
5966 } // Private
5967
5968
5969 _addAttachmentClass(attachment) {
5970 this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
5971 }
5972
5973 _getContent() {
5974 return this._element.getAttribute('data-bs-content') || this._config.content;
5975 }
5976
5977 _cleanTipClass() {
5978 const tip = this.getTipElement();
5979 const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
5980
5981 if (tabClass !== null && tabClass.length > 0) {
5982 tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
5983 }
5984 } // Static
5985
5986
5987 static jQueryInterface(config) {
5988 return this.each(function () {
5989 let data = Data.get(this, DATA_KEY$3);
5990
5991 const _config = typeof config === 'object' ? config : null;
5992
5993 if (!data && /dispose|hide/.test(config)) {
5994 return;
5995 }
5996
5997 if (!data) {
5998 data = new Popover(this, _config);
5999 Data.set(this, DATA_KEY$3, data);
6000 }
6001
6002 if (typeof config === 'string') {
6003 if (typeof data[config] === 'undefined') {
6004 throw new TypeError(`No method named "${config}"`);
6005 }
6006
6007 data[config]();
6008 }
6009 });
6010 }
6011
6012 }
6013 /**
6014 * ------------------------------------------------------------------------
6015 * jQuery
6016 * ------------------------------------------------------------------------
6017 * add .Popover to jQuery only if jQuery is present
6018 */
6019
6020
6021 defineJQueryPlugin(Popover);
6022
6023 /**
6024 * --------------------------------------------------------------------------
6025 * Bootstrap (v5.0.1): scrollspy.js
6026 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6027 * --------------------------------------------------------------------------
6028 */
6029 /**
6030 * ------------------------------------------------------------------------
6031 * Constants
6032 * ------------------------------------------------------------------------
6033 */
6034
6035 const NAME$2 = 'scrollspy';
6036 const DATA_KEY$2 = 'bs.scrollspy';
6037 const EVENT_KEY$2 = `.${DATA_KEY$2}`;
6038 const DATA_API_KEY$1 = '.data-api';
6039 const Default$1 = {
6040 offset: 10,
6041 method: 'auto',
6042 target: ''
6043 };
6044 const DefaultType$1 = {
6045 offset: 'number',
6046 method: 'string',
6047 target: '(string|element)'
6048 };
6049 const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;
6050 const EVENT_SCROLL = `scroll${EVENT_KEY$2}`;
6051 const EVENT_LOAD_DATA_API = `load${EVENT_KEY$2}${DATA_API_KEY$1}`;
6052 const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
6053 const CLASS_NAME_ACTIVE$1 = 'active';
6054 const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]';
6055 const SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
6056 const SELECTOR_NAV_LINKS = '.nav-link';
6057 const SELECTOR_NAV_ITEMS = '.nav-item';
6058 const SELECTOR_LIST_ITEMS = '.list-group-item';
6059 const SELECTOR_DROPDOWN$1 = '.dropdown';
6060 const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
6061 const METHOD_OFFSET = 'offset';
6062 const METHOD_POSITION = 'position';
6063 /**
6064 * ------------------------------------------------------------------------
6065 * Class Definition
6066 * ------------------------------------------------------------------------
6067 */
6068
6069 class ScrollSpy extends BaseComponent {
6070 constructor(element, config) {
6071 super(element);
6072 this._scrollElement = this._element.tagName === 'BODY' ? window : this._element;
6073 this._config = this._getConfig(config);
6074 this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS}, ${this._config.target} ${SELECTOR_LIST_ITEMS}, ${this._config.target} .${CLASS_NAME_DROPDOWN_ITEM}`;
6075 this._offsets = [];
6076 this._targets = [];
6077 this._activeTarget = null;
6078 this._scrollHeight = 0;
6079 EventHandler.on(this._scrollElement, EVENT_SCROLL, () => this._process());
6080 this.refresh();
6081
6082 this._process();
6083 } // Getters
6084
6085
6086 static get Default() {
6087 return Default$1;
6088 }
6089
6090 static get NAME() {
6091 return NAME$2;
6092 } // Public
6093
6094
6095 refresh() {
6096 const autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
6097 const offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
6098 const offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
6099 this._offsets = [];
6100 this._targets = [];
6101 this._scrollHeight = this._getScrollHeight();
6102 const targets = SelectorEngine.find(this._selector);
6103 targets.map(element => {
6104 const targetSelector = getSelectorFromElement(element);
6105 const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
6106
6107 if (target) {
6108 const targetBCR = target.getBoundingClientRect();
6109
6110 if (targetBCR.width || targetBCR.height) {
6111 return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
6112 }
6113 }
6114
6115 return null;
6116 }).filter(item => item).sort((a, b) => a[0] - b[0]).forEach(item => {
6117 this._offsets.push(item[0]);
6118
6119 this._targets.push(item[1]);
6120 });
6121 }
6122
6123 dispose() {
6124 EventHandler.off(this._scrollElement, EVENT_KEY$2);
6125 super.dispose();
6126 } // Private
6127
6128
6129 _getConfig(config) {
6130 config = { ...Default$1,
6131 ...Manipulator.getDataAttributes(this._element),
6132 ...(typeof config === 'object' && config ? config : {})
6133 };
6134
6135 if (typeof config.target !== 'string' && isElement$1(config.target)) {
6136 let {
6137 id
6138 } = config.target;
6139
6140 if (!id) {
6141 id = getUID(NAME$2);
6142 config.target.id = id;
6143 }
6144
6145 config.target = `#${id}`;
6146 }
6147
6148 typeCheckConfig(NAME$2, config, DefaultType$1);
6149 return config;
6150 }
6151
6152 _getScrollTop() {
6153 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
6154 }
6155
6156 _getScrollHeight() {
6157 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
6158 }
6159
6160 _getOffsetHeight() {
6161 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
6162 }
6163
6164 _process() {
6165 const scrollTop = this._getScrollTop() + this._config.offset;
6166
6167 const scrollHeight = this._getScrollHeight();
6168
6169 const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
6170
6171 if (this._scrollHeight !== scrollHeight) {
6172 this.refresh();
6173 }
6174
6175 if (scrollTop >= maxScroll) {
6176 const target = this._targets[this._targets.length - 1];
6177
6178 if (this._activeTarget !== target) {
6179 this._activate(target);
6180 }
6181
6182 return;
6183 }
6184
6185 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
6186 this._activeTarget = null;
6187
6188 this._clear();
6189
6190 return;
6191 }
6192
6193 for (let i = this._offsets.length; i--;) {
6194 const isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
6195
6196 if (isActiveTarget) {
6197 this._activate(this._targets[i]);
6198 }
6199 }
6200 }
6201
6202 _activate(target) {
6203 this._activeTarget = target;
6204
6205 this._clear();
6206
6207 const queries = this._selector.split(',').map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`);
6208
6209 const link = SelectorEngine.findOne(queries.join(','));
6210
6211 if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
6212 SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, link.closest(SELECTOR_DROPDOWN$1)).classList.add(CLASS_NAME_ACTIVE$1);
6213 link.classList.add(CLASS_NAME_ACTIVE$1);
6214 } else {
6215 // Set triggered link as active
6216 link.classList.add(CLASS_NAME_ACTIVE$1);
6217 SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP$1).forEach(listGroup => {
6218 // Set triggered links parents as active
6219 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
6220 SelectorEngine.prev(listGroup, `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1)); // Handle special case when .nav-link is inside .nav-item
6221
6222 SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS).forEach(navItem => {
6223 SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1));
6224 });
6225 });
6226 }
6227
6228 EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {
6229 relatedTarget: target
6230 });
6231 }
6232
6233 _clear() {
6234 SelectorEngine.find(this._selector).filter(node => node.classList.contains(CLASS_NAME_ACTIVE$1)).forEach(node => node.classList.remove(CLASS_NAME_ACTIVE$1));
6235 } // Static
6236
6237
6238 static jQueryInterface(config) {
6239 return this.each(function () {
6240 const data = ScrollSpy.getInstance(this) || new ScrollSpy(this, typeof config === 'object' ? config : {});
6241
6242 if (typeof config !== 'string') {
6243 return;
6244 }
6245
6246 if (typeof data[config] === 'undefined') {
6247 throw new TypeError(`No method named "${config}"`);
6248 }
6249
6250 data[config]();
6251 });
6252 }
6253
6254 }
6255 /**
6256 * ------------------------------------------------------------------------
6257 * Data Api implementation
6258 * ------------------------------------------------------------------------
6259 */
6260
6261
6262 EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
6263 SelectorEngine.find(SELECTOR_DATA_SPY).forEach(spy => new ScrollSpy(spy));
6264 });
6265 /**
6266 * ------------------------------------------------------------------------
6267 * jQuery
6268 * ------------------------------------------------------------------------
6269 * add .ScrollSpy to jQuery only if jQuery is present
6270 */
6271
6272 defineJQueryPlugin(ScrollSpy);
6273
6274 /**
6275 * --------------------------------------------------------------------------
6276 * Bootstrap (v5.0.1): tab.js
6277 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6278 * --------------------------------------------------------------------------
6279 */
6280 /**
6281 * ------------------------------------------------------------------------
6282 * Constants
6283 * ------------------------------------------------------------------------
6284 */
6285
6286 const NAME$1 = 'tab';
6287 const DATA_KEY$1 = 'bs.tab';
6288 const EVENT_KEY$1 = `.${DATA_KEY$1}`;
6289 const DATA_API_KEY = '.data-api';
6290 const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`;
6291 const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`;
6292 const EVENT_SHOW$1 = `show${EVENT_KEY$1}`;
6293 const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`;
6294 const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}${DATA_API_KEY}`;
6295 const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
6296 const CLASS_NAME_ACTIVE = 'active';
6297 const CLASS_NAME_FADE$1 = 'fade';
6298 const CLASS_NAME_SHOW$1 = 'show';
6299 const SELECTOR_DROPDOWN = '.dropdown';
6300 const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
6301 const SELECTOR_ACTIVE = '.active';
6302 const SELECTOR_ACTIVE_UL = ':scope > li > .active';
6303 const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';
6304 const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
6305 const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
6306 /**
6307 * ------------------------------------------------------------------------
6308 * Class Definition
6309 * ------------------------------------------------------------------------
6310 */
6311
6312 class Tab extends BaseComponent {
6313 // Getters
6314 static get NAME() {
6315 return NAME$1;
6316 } // Public
6317
6318
6319 show() {
6320 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
6321 return;
6322 }
6323
6324 let previous;
6325 const target = getElementFromSelector(this._element);
6326
6327 const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP);
6328
6329 if (listElement) {
6330 const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
6331 previous = SelectorEngine.find(itemSelector, listElement);
6332 previous = previous[previous.length - 1];
6333 }
6334
6335 const hideEvent = previous ? EventHandler.trigger(previous, EVENT_HIDE$1, {
6336 relatedTarget: this._element
6337 }) : null;
6338 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$1, {
6339 relatedTarget: previous
6340 });
6341
6342 if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
6343 return;
6344 }
6345
6346 this._activate(this._element, listElement);
6347
6348 const complete = () => {
6349 EventHandler.trigger(previous, EVENT_HIDDEN$1, {
6350 relatedTarget: this._element
6351 });
6352 EventHandler.trigger(this._element, EVENT_SHOWN$1, {
6353 relatedTarget: previous
6354 });
6355 };
6356
6357 if (target) {
6358 this._activate(target, target.parentNode, complete);
6359 } else {
6360 complete();
6361 }
6362 } // Private
6363
6364
6365 _activate(element, container, callback) {
6366 const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE);
6367 const active = activeElements[0];
6368 const isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE$1);
6369
6370 const complete = () => this._transitionComplete(element, active, callback);
6371
6372 if (active && isTransitioning) {
6373 active.classList.remove(CLASS_NAME_SHOW$1);
6374
6375 this._queueCallback(complete, element, true);
6376 } else {
6377 complete();
6378 }
6379 }
6380
6381 _transitionComplete(element, active, callback) {
6382 if (active) {
6383 active.classList.remove(CLASS_NAME_ACTIVE);
6384 const dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
6385
6386 if (dropdownChild) {
6387 dropdownChild.classList.remove(CLASS_NAME_ACTIVE);
6388 }
6389
6390 if (active.getAttribute('role') === 'tab') {
6391 active.setAttribute('aria-selected', false);
6392 }
6393 }
6394
6395 element.classList.add(CLASS_NAME_ACTIVE);
6396
6397 if (element.getAttribute('role') === 'tab') {
6398 element.setAttribute('aria-selected', true);
6399 }
6400
6401 reflow(element);
6402
6403 if (element.classList.contains(CLASS_NAME_FADE$1)) {
6404 element.classList.add(CLASS_NAME_SHOW$1);
6405 }
6406
6407 let parent = element.parentNode;
6408
6409 if (parent && parent.nodeName === 'LI') {
6410 parent = parent.parentNode;
6411 }
6412
6413 if (parent && parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
6414 const dropdownElement = element.closest(SELECTOR_DROPDOWN);
6415
6416 if (dropdownElement) {
6417 SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE, dropdownElement).forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE));
6418 }
6419
6420 element.setAttribute('aria-expanded', true);
6421 }
6422
6423 if (callback) {
6424 callback();
6425 }
6426 } // Static
6427
6428
6429 static jQueryInterface(config) {
6430 return this.each(function () {
6431 const data = Data.get(this, DATA_KEY$1) || new Tab(this);
6432
6433 if (typeof config === 'string') {
6434 if (typeof data[config] === 'undefined') {
6435 throw new TypeError(`No method named "${config}"`);
6436 }
6437
6438 data[config]();
6439 }
6440 });
6441 }
6442
6443 }
6444 /**
6445 * ------------------------------------------------------------------------
6446 * Data Api implementation
6447 * ------------------------------------------------------------------------
6448 */
6449
6450
6451 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
6452 if (['A', 'AREA'].includes(this.tagName)) {
6453 event.preventDefault();
6454 }
6455
6456 if (isDisabled(this)) {
6457 return;
6458 }
6459
6460 const data = Data.get(this, DATA_KEY$1) || new Tab(this);
6461 data.show();
6462 });
6463 /**
6464 * ------------------------------------------------------------------------
6465 * jQuery
6466 * ------------------------------------------------------------------------
6467 * add .Tab to jQuery only if jQuery is present
6468 */
6469
6470 defineJQueryPlugin(Tab);
6471
6472 /**
6473 * --------------------------------------------------------------------------
6474 * Bootstrap (v5.0.1): toast.js
6475 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6476 * --------------------------------------------------------------------------
6477 */
6478 /**
6479 * ------------------------------------------------------------------------
6480 * Constants
6481 * ------------------------------------------------------------------------
6482 */
6483
6484 const NAME = 'toast';
6485 const DATA_KEY = 'bs.toast';
6486 const EVENT_KEY = `.${DATA_KEY}`;
6487 const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
6488 const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
6489 const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
6490 const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
6491 const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
6492 const EVENT_HIDE = `hide${EVENT_KEY}`;
6493 const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
6494 const EVENT_SHOW = `show${EVENT_KEY}`;
6495 const EVENT_SHOWN = `shown${EVENT_KEY}`;
6496 const CLASS_NAME_FADE = 'fade';
6497 const CLASS_NAME_HIDE = 'hide';
6498 const CLASS_NAME_SHOW = 'show';
6499 const CLASS_NAME_SHOWING = 'showing';
6500 const DefaultType = {
6501 animation: 'boolean',
6502 autohide: 'boolean',
6503 delay: 'number'
6504 };
6505 const Default = {
6506 animation: true,
6507 autohide: true,
6508 delay: 5000
6509 };
6510 const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]';
6511 /**
6512 * ------------------------------------------------------------------------
6513 * Class Definition
6514 * ------------------------------------------------------------------------
6515 */
6516
6517 class Toast extends BaseComponent {
6518 constructor(element, config) {
6519 super(element);
6520 this._config = this._getConfig(config);
6521 this._timeout = null;
6522 this._hasMouseInteraction = false;
6523 this._hasKeyboardInteraction = false;
6524
6525 this._setListeners();
6526 } // Getters
6527
6528
6529 static get DefaultType() {
6530 return DefaultType;
6531 }
6532
6533 static get Default() {
6534 return Default;
6535 }
6536
6537 static get NAME() {
6538 return NAME;
6539 } // Public
6540
6541
6542 show() {
6543 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW);
6544
6545 if (showEvent.defaultPrevented) {
6546 return;
6547 }
6548
6549 this._clearTimeout();
6550
6551 if (this._config.animation) {
6552 this._element.classList.add(CLASS_NAME_FADE);
6553 }
6554
6555 const complete = () => {
6556 this._element.classList.remove(CLASS_NAME_SHOWING);
6557
6558 this._element.classList.add(CLASS_NAME_SHOW);
6559
6560 EventHandler.trigger(this._element, EVENT_SHOWN);
6561
6562 this._maybeScheduleHide();
6563 };
6564
6565 this._element.classList.remove(CLASS_NAME_HIDE);
6566
6567 reflow(this._element);
6568
6569 this._element.classList.add(CLASS_NAME_SHOWING);
6570
6571 this._queueCallback(complete, this._element, this._config.animation);
6572 }
6573
6574 hide() {
6575 if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
6576 return;
6577 }
6578
6579 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);
6580
6581 if (hideEvent.defaultPrevented) {
6582 return;
6583 }
6584
6585 const complete = () => {
6586 this._element.classList.add(CLASS_NAME_HIDE);
6587
6588 EventHandler.trigger(this._element, EVENT_HIDDEN);
6589 };
6590
6591 this._element.classList.remove(CLASS_NAME_SHOW);
6592
6593 this._queueCallback(complete, this._element, this._config.animation);
6594 }
6595
6596 dispose() {
6597 this._clearTimeout();
6598
6599 if (this._element.classList.contains(CLASS_NAME_SHOW)) {
6600 this._element.classList.remove(CLASS_NAME_SHOW);
6601 }
6602
6603 super.dispose();
6604 } // Private
6605
6606
6607 _getConfig(config) {
6608 config = { ...Default,
6609 ...Manipulator.getDataAttributes(this._element),
6610 ...(typeof config === 'object' && config ? config : {})
6611 };
6612 typeCheckConfig(NAME, config, this.constructor.DefaultType);
6613 return config;
6614 }
6615
6616 _maybeScheduleHide() {
6617 if (!this._config.autohide) {
6618 return;
6619 }
6620
6621 if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
6622 return;
6623 }
6624
6625 this._timeout = setTimeout(() => {
6626 this.hide();
6627 }, this._config.delay);
6628 }
6629
6630 _onInteraction(event, isInteracting) {
6631 switch (event.type) {
6632 case 'mouseover':
6633 case 'mouseout':
6634 this._hasMouseInteraction = isInteracting;
6635 break;
6636
6637 case 'focusin':
6638 case 'focusout':
6639 this._hasKeyboardInteraction = isInteracting;
6640 break;
6641 }
6642
6643 if (isInteracting) {
6644 this._clearTimeout();
6645
6646 return;
6647 }
6648
6649 const nextElement = event.relatedTarget;
6650
6651 if (this._element === nextElement || this._element.contains(nextElement)) {
6652 return;
6653 }
6654
6655 this._maybeScheduleHide();
6656 }
6657
6658 _setListeners() {
6659 EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
6660 EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
6661 EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
6662 EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
6663 EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));
6664 }
6665
6666 _clearTimeout() {
6667 clearTimeout(this._timeout);
6668 this._timeout = null;
6669 } // Static
6670
6671
6672 static jQueryInterface(config) {
6673 return this.each(function () {
6674 let data = Data.get(this, DATA_KEY);
6675
6676 const _config = typeof config === 'object' && config;
6677
6678 if (!data) {
6679 data = new Toast(this, _config);
6680 }
6681
6682 if (typeof config === 'string') {
6683 if (typeof data[config] === 'undefined') {
6684 throw new TypeError(`No method named "${config}"`);
6685 }
6686
6687 data[config](this);
6688 }
6689 });
6690 }
6691
6692 }
6693 /**
6694 * ------------------------------------------------------------------------
6695 * jQuery
6696 * ------------------------------------------------------------------------
6697 * add .Toast to jQuery only if jQuery is present
6698 */
6699
6700
6701 defineJQueryPlugin(Toast);
6702
6703 /**
6704 * --------------------------------------------------------------------------
6705 * Bootstrap (v5.0.1): index.umd.js
6706 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6707 * --------------------------------------------------------------------------
6708 */
6709 var index_umd = {
6710 Alert,
6711 Button,
6712 Carousel,
6713 Collapse,
6714 Dropdown,
6715 Modal,
6716 Offcanvas,
6717 Popover,
6718 ScrollSpy,
6719 Tab,
6720 Toast,
6721 Tooltip
6722 };
6723
6724 return index_umd;
6725
6726})));
6727//# sourceMappingURL=bootstrap.bundle.js.map