Rev 637 | Rev 846 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 637 | Rev 679 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /*! |
1 | /*! |
2 | * Bootstrap v5.1.1 (https://getbootstrap.com/) |
2 | * Bootstrap v5.1.3 (https://getbootstrap.com/) |
3 | * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) |
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) |
4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
5 | */ |
5 | */ |
6 | (function (global, factory) { |
6 | (function (global, factory) { |
7 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core')) : |
7 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core')) : |
8 | typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) : |
8 | typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) : |
9 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper)); |
9 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper)); |
10 | }(this, (function (Popper) { 'use strict'; |
10 | })(this, (function (Popper) { 'use strict'; |
11 | 11 | ||
12 | function _interopNamespace(e) { |
12 | function _interopNamespace(e) { |
13 | if (e && e.__esModule) return e; |
13 | if (e && e.__esModule) return e; |
14 | var n = Object.create(null); |
14 | const n = Object.create(null); |
15 | if (e) { |
15 | if (e) { |
16 | Object.keys(e).forEach(function (k) { |
16 | for (const k in e) { |
17 | if (k !== 'default') { |
17 | if (k !== 'default') { |
18 | var d = Object.getOwnPropertyDescriptor(e, k); |
18 | const d = Object.getOwnPropertyDescriptor(e, k); |
19 | Object.defineProperty(n, k, d.get ? d : { |
19 | Object.defineProperty(n, k, d.get ? d : { |
20 | enumerable: true, |
20 | enumerable: true, |
21 | get: function () { |
- | |
22 | return e[k]; |
21 | get: () => e[k] |
23 | } |
- | |
24 | }); |
22 | }); |
25 | } |
23 | } |
26 | }); |
- | |
27 | } |
24 | } |
- | 25 | } |
|
28 | n['default'] = e; |
26 | n.default = e; |
29 | return Object.freeze(n); |
27 | return Object.freeze(n); |
30 | } |
28 | } |
31 | 29 | ||
32 | var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper); |
30 | const Popper__namespace = /*#__PURE__*/_interopNamespace(Popper); |
33 | 31 | ||
34 | /** |
32 | /** |
35 | * -------------------------------------------------------------------------- |
33 | * -------------------------------------------------------------------------- |
36 | * Bootstrap (v5.1.1): util/index.js |
34 | * Bootstrap (v5.1.3): util/index.js |
37 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
35 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
38 | * -------------------------------------------------------------------------- |
36 | * -------------------------------------------------------------------------- |
39 | */ |
37 | */ |
40 | const MAX_UID = 1000000; |
38 | const MAX_UID = 1000000; |
41 | const MILLISECONDS_MULTIPLIER = 1000; |
39 | const MILLISECONDS_MULTIPLIER = 1000; |
Line 342... | Line 340... | ||
342 | return list[Math.max(0, Math.min(index, listLength - 1))]; |
340 | return list[Math.max(0, Math.min(index, listLength - 1))]; |
343 | }; |
341 | }; |
344 | 342 | ||
345 | /** |
343 | /** |
346 | * -------------------------------------------------------------------------- |
344 | * -------------------------------------------------------------------------- |
347 | * Bootstrap (v5.1.1): dom/event-handler.js |
345 | * Bootstrap (v5.1.3): dom/event-handler.js |
348 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
346 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
349 | * -------------------------------------------------------------------------- |
347 | * -------------------------------------------------------------------------- |
350 | */ |
348 | */ |
351 | /** |
349 | /** |
352 | * ------------------------------------------------------------------------ |
350 | * ------------------------------------------------------------------------ |
Line 630... | Line 628... | ||
630 | 628 | ||
631 | }; |
629 | }; |
632 | 630 | ||
633 | /** |
631 | /** |
634 | * -------------------------------------------------------------------------- |
632 | * -------------------------------------------------------------------------- |
635 | * Bootstrap (v5.1.1): dom/data.js |
633 | * Bootstrap (v5.1.3): dom/data.js |
636 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
634 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
637 | * -------------------------------------------------------------------------- |
635 | * -------------------------------------------------------------------------- |
638 | */ |
636 | */ |
639 | 637 | ||
640 | /** |
638 | /** |
641 | * ------------------------------------------------------------------------ |
639 | * ------------------------------------------------------------------------ |
642 | * Constants |
640 | * Constants |
643 | * ------------------------------------------------------------------------ |
641 | * ------------------------------------------------------------------------ |
644 | */ |
642 | */ |
645 | const elementMap = new Map(); |
643 | const elementMap = new Map(); |
646 | var Data = { |
644 | const Data = { |
647 | set(element, key, instance) { |
645 | set(element, key, instance) { |
648 | if (!elementMap.has(element)) { |
646 | if (!elementMap.has(element)) { |
649 | elementMap.set(element, new Map()); |
647 | elementMap.set(element, new Map()); |
650 | } |
648 | } |
651 | 649 | ||
Line 684... | Line 682... | ||
684 | 682 | ||
685 | }; |
683 | }; |
686 | 684 | ||
687 | /** |
685 | /** |
688 | * -------------------------------------------------------------------------- |
686 | * -------------------------------------------------------------------------- |
689 | * Bootstrap (v5.1.1): base-component.js |
687 | * Bootstrap (v5.1.3): base-component.js |
690 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
688 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
691 | * -------------------------------------------------------------------------- |
689 | * -------------------------------------------------------------------------- |
692 | */ |
690 | */ |
693 | /** |
691 | /** |
694 | * ------------------------------------------------------------------------ |
692 | * ------------------------------------------------------------------------ |
695 | * Constants |
693 | * Constants |
696 | * ------------------------------------------------------------------------ |
694 | * ------------------------------------------------------------------------ |
697 | */ |
695 | */ |
698 | 696 | ||
699 | const VERSION = '5.1.1'; |
697 | const VERSION = '5.1.3'; |
700 | 698 | ||
701 | class BaseComponent { |
699 | class BaseComponent { |
702 | constructor(element) { |
700 | constructor(element) { |
703 | element = getElement(element); |
701 | element = getElement(element); |
704 | 702 | ||
Line 750... | Line 748... | ||
750 | 748 | ||
751 | } |
749 | } |
752 | 750 | ||
753 | /** |
751 | /** |
754 | * -------------------------------------------------------------------------- |
752 | * -------------------------------------------------------------------------- |
755 | * Bootstrap (v5.1.1): util/component-functions.js |
753 | * Bootstrap (v5.1.3): util/component-functions.js |
756 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
754 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
757 | * -------------------------------------------------------------------------- |
755 | * -------------------------------------------------------------------------- |
758 | */ |
756 | */ |
759 | 757 | ||
760 | const enableDismissTrigger = (component, method = 'hide') => { |
758 | const enableDismissTrigger = (component, method = 'hide') => { |
Line 776... | Line 774... | ||
776 | }); |
774 | }); |
777 | }; |
775 | }; |
778 | 776 | ||
779 | /** |
777 | /** |
780 | * -------------------------------------------------------------------------- |
778 | * -------------------------------------------------------------------------- |
781 | * Bootstrap (v5.1.1): alert.js |
779 | * Bootstrap (v5.1.3): alert.js |
782 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
780 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
783 | * -------------------------------------------------------------------------- |
781 | * -------------------------------------------------------------------------- |
784 | */ |
782 | */ |
785 | /** |
783 | /** |
786 | * ------------------------------------------------------------------------ |
784 | * ------------------------------------------------------------------------ |
Line 865... | Line 863... | ||
865 | 863 | ||
866 | defineJQueryPlugin(Alert); |
864 | defineJQueryPlugin(Alert); |
867 | 865 | ||
868 | /** |
866 | /** |
869 | * -------------------------------------------------------------------------- |
867 | * -------------------------------------------------------------------------- |
870 | * Bootstrap (v5.1.1): button.js |
868 | * Bootstrap (v5.1.3): button.js |
871 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
869 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
872 | * -------------------------------------------------------------------------- |
870 | * -------------------------------------------------------------------------- |
873 | */ |
871 | */ |
874 | /** |
872 | /** |
875 | * ------------------------------------------------------------------------ |
873 | * ------------------------------------------------------------------------ |
Line 936... | Line 934... | ||
936 | 934 | ||
937 | defineJQueryPlugin(Button); |
935 | defineJQueryPlugin(Button); |
938 | 936 | ||
939 | /** |
937 | /** |
940 | * -------------------------------------------------------------------------- |
938 | * -------------------------------------------------------------------------- |
941 | * Bootstrap (v5.1.1): dom/manipulator.js |
939 | * Bootstrap (v5.1.3): dom/manipulator.js |
942 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
940 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
943 | * -------------------------------------------------------------------------- |
941 | * -------------------------------------------------------------------------- |
944 | */ |
942 | */ |
945 | function normalizeData(val) { |
943 | function normalizeData(val) { |
946 | if (val === 'true') { |
944 | if (val === 'true') { |
Line 1010... | Line 1008... | ||
1010 | 1008 | ||
1011 | }; |
1009 | }; |
1012 | 1010 | ||
1013 | /** |
1011 | /** |
1014 | * -------------------------------------------------------------------------- |
1012 | * -------------------------------------------------------------------------- |
1015 | * Bootstrap (v5.1.1): dom/selector-engine.js |
1013 | * Bootstrap (v5.1.3): dom/selector-engine.js |
1016 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
1014 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
1017 | * -------------------------------------------------------------------------- |
1015 | * -------------------------------------------------------------------------- |
1018 | */ |
1016 | */ |
1019 | const NODE_TEXT = 3; |
1017 | const NODE_TEXT = 3; |
1020 | const SelectorEngine = { |
1018 | const SelectorEngine = { |
Line 1080... | Line 1078... | ||
1080 | 1078 | ||
1081 | }; |
1079 | }; |
1082 | 1080 | ||
1083 | /** |
1081 | /** |
1084 | * -------------------------------------------------------------------------- |
1082 | * -------------------------------------------------------------------------- |
1085 | * Bootstrap (v5.1.1): carousel.js |
1083 | * Bootstrap (v5.1.3): carousel.js |
1086 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
1084 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
1087 | * -------------------------------------------------------------------------- |
1085 | * -------------------------------------------------------------------------- |
1088 | */ |
1086 | */ |
1089 | /** |
1087 | /** |
1090 | * ------------------------------------------------------------------------ |
1088 | * ------------------------------------------------------------------------ |
Line 1348... | Line 1346... | ||
1348 | this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval); |
1346 | this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval); |
1349 | } |
1347 | } |
1350 | }; |
1348 | }; |
1351 | 1349 | ||
1352 | SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => { |
1350 | SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => { |
1353 | EventHandler.on(itemImg, EVENT_DRAG_START, e => e.preventDefault()); |
1351 | EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault()); |
1354 | }); |
1352 | }); |
1355 | 1353 | ||
1356 | if (this._pointerEvent) { |
1354 | if (this._pointerEvent) { |
1357 | EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event)); |
1355 | EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event)); |
1358 | EventHandler.on(this._element, EVENT_POINTERUP, event => end(event)); |
1356 | EventHandler.on(this._element, EVENT_POINTERUP, event => end(event)); |
Line 1629... | Line 1627... | ||
1629 | 1627 | ||
1630 | defineJQueryPlugin(Carousel); |
1628 | defineJQueryPlugin(Carousel); |
1631 | 1629 | ||
1632 | /** |
1630 | /** |
1633 | * -------------------------------------------------------------------------- |
1631 | * -------------------------------------------------------------------------- |
1634 | * Bootstrap (v5.1.1): collapse.js |
1632 | * Bootstrap (v5.1.3): collapse.js |
1635 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
1633 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
1636 | * -------------------------------------------------------------------------- |
1634 | * -------------------------------------------------------------------------- |
1637 | */ |
1635 | */ |
1638 | /** |
1636 | /** |
1639 | * ------------------------------------------------------------------------ |
1637 | * ------------------------------------------------------------------------ |
Line 1660... | Line 1658... | ||
1660 | const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$9}${DATA_API_KEY$5}`; |
1658 | const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$9}${DATA_API_KEY$5}`; |
1661 | const CLASS_NAME_SHOW$7 = 'show'; |
1659 | const CLASS_NAME_SHOW$7 = 'show'; |
1662 | const CLASS_NAME_COLLAPSE = 'collapse'; |
1660 | const CLASS_NAME_COLLAPSE = 'collapse'; |
1663 | const CLASS_NAME_COLLAPSING = 'collapsing'; |
1661 | const CLASS_NAME_COLLAPSING = 'collapsing'; |
1664 | const CLASS_NAME_COLLAPSED = 'collapsed'; |
1662 | const CLASS_NAME_COLLAPSED = 'collapsed'; |
- | 1663 | const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`; |
|
1665 | const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; |
1664 | const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; |
1666 | const WIDTH = 'width'; |
1665 | const WIDTH = 'width'; |
1667 | const HEIGHT = 'height'; |
1666 | const HEIGHT = 'height'; |
1668 | const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; |
1667 | const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; |
1669 | const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; |
1668 | const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; |
Line 1729... | Line 1728... | ||
1729 | 1728 | ||
1730 | let actives = []; |
1729 | let actives = []; |
1731 | let activesData; |
1730 | let activesData; |
1732 | 1731 | ||
1733 | if (this._config.parent) { |
1732 | if (this._config.parent) { |
1734 | const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent); |
1733 | const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); |
1735 | actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth |
1734 | actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth |
1736 | } |
1735 | } |
1737 | 1736 | ||
1738 | const container = SelectorEngine.findOne(this._selector); |
1737 | const container = SelectorEngine.findOne(this._selector); |
1739 | 1738 | ||
Line 1867... | Line 1866... | ||
1867 | _initializeChildren() { |
1866 | _initializeChildren() { |
1868 | if (!this._config.parent) { |
1867 | if (!this._config.parent) { |
1869 | return; |
1868 | return; |
1870 | } |
1869 | } |
1871 | 1870 | ||
1872 | const children = SelectorEngine.find(`.${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`, this._config.parent); |
1871 | const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); |
1873 | SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => { |
1872 | SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => { |
1874 | const selected = getElementFromSelector(element); |
1873 | const selected = getElementFromSelector(element); |
1875 | 1874 | ||
1876 | if (selected) { |
1875 | if (selected) { |
1877 | this._addAriaAndCollapsedClass([element], this._isShown(selected)); |
1876 | this._addAriaAndCollapsedClass([element], this._isShown(selected)); |
Line 1947... | Line 1946... | ||
1947 | 1946 | ||
1948 | defineJQueryPlugin(Collapse); |
1947 | defineJQueryPlugin(Collapse); |
1949 | 1948 | ||
1950 | /** |
1949 | /** |
1951 | * -------------------------------------------------------------------------- |
1950 | * -------------------------------------------------------------------------- |
1952 | * Bootstrap (v5.1.1): dropdown.js |
1951 | * Bootstrap (v5.1.3): dropdown.js |
1953 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
1952 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
1954 | * -------------------------------------------------------------------------- |
1953 | * -------------------------------------------------------------------------- |
1955 | */ |
1954 | */ |
1956 | /** |
1955 | /** |
1957 | * ------------------------------------------------------------------------ |
1956 | * ------------------------------------------------------------------------ |
Line 2409... | Line 2408... | ||
2409 | 2408 | ||
2410 | defineJQueryPlugin(Dropdown); |
2409 | defineJQueryPlugin(Dropdown); |
2411 | 2410 | ||
2412 | /** |
2411 | /** |
2413 | * -------------------------------------------------------------------------- |
2412 | * -------------------------------------------------------------------------- |
2414 | * Bootstrap (v5.1.1): util/scrollBar.js |
2413 | * Bootstrap (v5.1.3): util/scrollBar.js |
2415 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
2414 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
2416 | * -------------------------------------------------------------------------- |
2415 | * -------------------------------------------------------------------------- |
2417 | */ |
2416 | */ |
2418 | const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; |
2417 | const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; |
2419 | const SELECTOR_STICKY_CONTENT = '.sticky-top'; |
2418 | const SELECTOR_STICKY_CONTENT = '.sticky-top'; |
Line 2513... | Line 2512... | ||
2513 | 2512 | ||
2514 | } |
2513 | } |
2515 | 2514 | ||
2516 | /** |
2515 | /** |
2517 | * -------------------------------------------------------------------------- |
2516 | * -------------------------------------------------------------------------- |
2518 | * Bootstrap (v5.1.1): util/backdrop.js |
2517 | * Bootstrap (v5.1.3): util/backdrop.js |
2519 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
2518 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
2520 | * -------------------------------------------------------------------------- |
2519 | * -------------------------------------------------------------------------- |
2521 | */ |
2520 | */ |
2522 | const Default$7 = { |
2521 | const Default$7 = { |
2523 | className: 'modal-backdrop', |
2522 | className: 'modal-backdrop', |
2524 | isVisible: true, |
2523 | isVisible: true, |
Line 2637... | Line 2636... | ||
2637 | 2636 | ||
2638 | } |
2637 | } |
2639 | 2638 | ||
2640 | /** |
2639 | /** |
2641 | * -------------------------------------------------------------------------- |
2640 | * -------------------------------------------------------------------------- |
2642 | * Bootstrap (v5.1.1): util/focustrap.js |
2641 | * Bootstrap (v5.1.3): util/focustrap.js |
2643 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
2642 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
2644 | * -------------------------------------------------------------------------- |
2643 | * -------------------------------------------------------------------------- |
2645 | */ |
2644 | */ |
2646 | const Default$6 = { |
2645 | const Default$6 = { |
2647 | trapElement: null, |
2646 | trapElement: null, |
2648 | // The element to trap focus inside of |
2647 | // The element to trap focus inside of |
Line 2740... | Line 2739... | ||
2740 | 2739 | ||
2741 | } |
2740 | } |
2742 | 2741 | ||
2743 | /** |
2742 | /** |
2744 | * -------------------------------------------------------------------------- |
2743 | * -------------------------------------------------------------------------- |
2745 | * Bootstrap (v5.1.1): modal.js |
2744 | * Bootstrap (v5.1.3): modal.js |
2746 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
2745 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
2747 | * -------------------------------------------------------------------------- |
2746 | * -------------------------------------------------------------------------- |
2748 | */ |
2747 | */ |
2749 | /** |
2748 | /** |
2750 | * ------------------------------------------------------------------------ |
2749 | * ------------------------------------------------------------------------ |
Line 3169... | Line 3168... | ||
3169 | 3168 | ||
3170 | defineJQueryPlugin(Modal); |
3169 | defineJQueryPlugin(Modal); |
3171 | 3170 | ||
3172 | /** |
3171 | /** |
3173 | * -------------------------------------------------------------------------- |
3172 | * -------------------------------------------------------------------------- |
3174 | * Bootstrap (v5.1.1): offcanvas.js |
3173 | * Bootstrap (v5.1.3): offcanvas.js |
3175 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
3174 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
3176 | * -------------------------------------------------------------------------- |
3175 | * -------------------------------------------------------------------------- |
3177 | */ |
3176 | */ |
3178 | /** |
3177 | /** |
3179 | * ------------------------------------------------------------------------ |
3178 | * ------------------------------------------------------------------------ |
3180 | * Constants |
3179 | * Constants |
Line 3425... | Line 3424... | ||
3425 | 3424 | ||
3426 | defineJQueryPlugin(Offcanvas); |
3425 | defineJQueryPlugin(Offcanvas); |
3427 | 3426 | ||
3428 | /** |
3427 | /** |
3429 | * -------------------------------------------------------------------------- |
3428 | * -------------------------------------------------------------------------- |
3430 | * Bootstrap (v5.1.1): util/sanitizer.js |
3429 | * Bootstrap (v5.1.3): util/sanitizer.js |
3431 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
3430 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
3432 | * -------------------------------------------------------------------------- |
3431 | * -------------------------------------------------------------------------- |
3433 | */ |
3432 | */ |
3434 | const uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); |
3433 | const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); |
3435 | const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; |
3434 | const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; |
3436 | /** |
3435 | /** |
3437 | * A pattern that recognizes a commonly useful subset of URLs that are safe. |
3436 | * A pattern that recognizes a commonly useful subset of URLs that are safe. |
3438 | * |
3437 | * |
3439 | * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts |
3438 | * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts |
3440 | */ |
3439 | */ |
3441 | 3440 | ||
3442 | const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i; |
3441 | const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; |
3443 | /** |
3442 | /** |
3444 | * A pattern that matches safe data URLs. Only matches image, video and audio types. |
3443 | * A pattern that matches safe data URLs. Only matches image, video and audio types. |
3445 | * |
3444 | * |
3446 | * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts |
3445 | * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts |
3447 | */ |
3446 | */ |
3448 | 3447 | ||
3449 | 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; |
3448 | 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; |
3450 | 3449 | ||
3451 | const allowedAttribute = (attr, allowedAttributeList) => { |
3450 | const allowedAttribute = (attribute, allowedAttributeList) => { |
3452 | const attrName = attr.nodeName.toLowerCase(); |
3451 | const attributeName = attribute.nodeName.toLowerCase(); |
3453 | 3452 | ||
3454 | if (allowedAttributeList.includes(attrName)) { |
3453 | if (allowedAttributeList.includes(attributeName)) { |
3455 | if (uriAttrs.has(attrName)) { |
3454 | if (uriAttributes.has(attributeName)) { |
3456 | return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)); |
3455 | return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue)); |
3457 | } |
3456 | } |
3458 | 3457 | ||
3459 | return true; |
3458 | return true; |
3460 | } |
3459 | } |
3461 | 3460 | ||
3462 | const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp); // Check if a regular expression validates the attribute. |
3461 | const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute. |
3463 | 3462 | ||
3464 | for (let i = 0, len = regExp.length; i < len; i++) { |
3463 | for (let i = 0, len = regExp.length; i < len; i++) { |
3465 | if (regExp[i].test(attrName)) { |
3464 | if (regExp[i].test(attributeName)) { |
3466 | return true; |
3465 | return true; |
3467 | } |
3466 | } |
3468 | } |
3467 | } |
3469 | 3468 | ||
3470 | return false; |
3469 | return false; |
Line 3512... | Line 3511... | ||
3512 | return sanitizeFn(unsafeHtml); |
3511 | return sanitizeFn(unsafeHtml); |
3513 | } |
3512 | } |
3514 | 3513 | ||
3515 | const domParser = new window.DOMParser(); |
3514 | const domParser = new window.DOMParser(); |
3516 | const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); |
3515 | const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); |
3517 | const allowlistKeys = Object.keys(allowList); |
- | |
3518 | const elements = [].concat(...createdDocument.body.querySelectorAll('*')); |
3516 | const elements = [].concat(...createdDocument.body.querySelectorAll('*')); |
3519 | 3517 | ||
3520 | for (let i = 0, len = elements.length; i < len; i++) { |
3518 | for (let i = 0, len = elements.length; i < len; i++) { |
3521 | const el = elements[i]; |
3519 | const element = elements[i]; |
3522 | const elName = el.nodeName.toLowerCase(); |
3520 | const elementName = element.nodeName.toLowerCase(); |
3523 | 3521 | ||
3524 | if (!allowlistKeys.includes(elName)) { |
3522 | if (!Object.keys(allowList).includes(elementName)) { |
3525 | el.remove(); |
3523 | element.remove(); |
3526 | continue; |
3524 | continue; |
3527 | } |
3525 | } |
3528 | 3526 | ||
3529 | const attributeList = [].concat(...el.attributes); |
3527 | const attributeList = [].concat(...element.attributes); |
3530 | const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []); |
3528 | const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); |
3531 | attributeList.forEach(attr => { |
3529 | attributeList.forEach(attribute => { |
3532 | if (!allowedAttribute(attr, allowedAttributes)) { |
3530 | if (!allowedAttribute(attribute, allowedAttributes)) { |
3533 | el.removeAttribute(attr.nodeName); |
3531 | element.removeAttribute(attribute.nodeName); |
3534 | } |
3532 | } |
3535 | }); |
3533 | }); |
3536 | } |
3534 | } |
3537 | 3535 | ||
3538 | return createdDocument.body.innerHTML; |
3536 | return createdDocument.body.innerHTML; |
3539 | } |
3537 | } |
3540 | 3538 | ||
3541 | /** |
3539 | /** |
3542 | * -------------------------------------------------------------------------- |
3540 | * -------------------------------------------------------------------------- |
3543 | * Bootstrap (v5.1.1): tooltip.js |
3541 | * Bootstrap (v5.1.3): tooltip.js |
3544 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
3542 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
3545 | * -------------------------------------------------------------------------- |
3543 | * -------------------------------------------------------------------------- |
3546 | */ |
3544 | */ |
3547 | /** |
3545 | /** |
3548 | * ------------------------------------------------------------------------ |
3546 | * ------------------------------------------------------------------------ |
Line 4248... | Line 4246... | ||
4248 | 4246 | ||
4249 | defineJQueryPlugin(Tooltip); |
4247 | defineJQueryPlugin(Tooltip); |
4250 | 4248 | ||
4251 | /** |
4249 | /** |
4252 | * -------------------------------------------------------------------------- |
4250 | * -------------------------------------------------------------------------- |
4253 | * Bootstrap (v5.1.1): popover.js |
4251 | * Bootstrap (v5.1.3): popover.js |
4254 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
4252 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
4255 | * -------------------------------------------------------------------------- |
4253 | * -------------------------------------------------------------------------- |
4256 | */ |
4254 | */ |
4257 | /** |
4255 | /** |
4258 | * ------------------------------------------------------------------------ |
4256 | * ------------------------------------------------------------------------ |
Line 4358... | Line 4356... | ||
4358 | 4356 | ||
4359 | defineJQueryPlugin(Popover); |
4357 | defineJQueryPlugin(Popover); |
4360 | 4358 | ||
4361 | /** |
4359 | /** |
4362 | * -------------------------------------------------------------------------- |
4360 | * -------------------------------------------------------------------------- |
4363 | * Bootstrap (v5.1.1): scrollspy.js |
4361 | * Bootstrap (v5.1.3): scrollspy.js |
4364 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
4362 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
4365 | * -------------------------------------------------------------------------- |
4363 | * -------------------------------------------------------------------------- |
4366 | */ |
4364 | */ |
4367 | /** |
4365 | /** |
4368 | * ------------------------------------------------------------------------ |
4366 | * ------------------------------------------------------------------------ |
Line 4593... | Line 4591... | ||
4593 | 4591 | ||
4594 | defineJQueryPlugin(ScrollSpy); |
4592 | defineJQueryPlugin(ScrollSpy); |
4595 | 4593 | ||
4596 | /** |
4594 | /** |
4597 | * -------------------------------------------------------------------------- |
4595 | * -------------------------------------------------------------------------- |
4598 | * Bootstrap (v5.1.1): tab.js |
4596 | * Bootstrap (v5.1.3): tab.js |
4599 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
4597 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
4600 | * -------------------------------------------------------------------------- |
4598 | * -------------------------------------------------------------------------- |
4601 | */ |
4599 | */ |
4602 | /** |
4600 | /** |
4603 | * ------------------------------------------------------------------------ |
4601 | * ------------------------------------------------------------------------ |
Line 4791... | Line 4789... | ||
4791 | 4789 | ||
4792 | defineJQueryPlugin(Tab); |
4790 | defineJQueryPlugin(Tab); |
4793 | 4791 | ||
4794 | /** |
4792 | /** |
4795 | * -------------------------------------------------------------------------- |
4793 | * -------------------------------------------------------------------------- |
4796 | * Bootstrap (v5.1.1): toast.js |
4794 | * Bootstrap (v5.1.3): toast.js |
4797 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
4795 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
4798 | * -------------------------------------------------------------------------- |
4796 | * -------------------------------------------------------------------------- |
4799 | */ |
4797 | */ |
4800 | /** |
4798 | /** |
4801 | * ------------------------------------------------------------------------ |
4799 | * ------------------------------------------------------------------------ |
Line 5021... | Line 5019... | ||
5021 | 5019 | ||
5022 | defineJQueryPlugin(Toast); |
5020 | defineJQueryPlugin(Toast); |
5023 | 5021 | ||
5024 | /** |
5022 | /** |
5025 | * -------------------------------------------------------------------------- |
5023 | * -------------------------------------------------------------------------- |
5026 | * Bootstrap (v5.1.1): index.umd.js |
5024 | * Bootstrap (v5.1.3): index.umd.js |
5027 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
5025 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
5028 | * -------------------------------------------------------------------------- |
5026 | * -------------------------------------------------------------------------- |
5029 | */ |
5027 | */ |
5030 | var index_umd = { |
5028 | const index_umd = { |
5031 | Alert, |
5029 | Alert, |
5032 | Button, |
5030 | Button, |
5033 | Carousel, |
5031 | Carousel, |
5034 | Collapse, |
5032 | Collapse, |
5035 | Dropdown, |
5033 | Dropdown, |
Line 5042... | Line 5040... | ||
5042 | Tooltip |
5040 | Tooltip |
5043 | }; |
5041 | }; |
5044 | 5042 | ||
5045 | return index_umd; |
5043 | return index_umd; |
5046 | 5044 | ||
5047 | }))); |
5045 | })); |
5048 | //# sourceMappingURL=bootstrap.js.map |
5046 | //# sourceMappingURL=bootstrap.js.map |