@ukic/web-components 3.27.0 → 3.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/close-icon.js +1 -2
- package/components/close-icon.js.map +1 -1
- package/components/ic-breadcrumb-group.js +16 -12
- package/components/ic-breadcrumb-group.js.map +1 -1
- package/components/ic-data-list.js +1 -1
- package/components/ic-data-list.js.map +1 -1
- package/components/ic-data-row.js +1 -1
- package/components/ic-data-row.js.map +1 -1
- package/components/ic-menu-item2.js +7 -2
- package/components/ic-menu-item2.js.map +1 -1
- package/components/ic-menu2.js +1153 -306
- package/components/ic-menu2.js.map +1 -1
- package/components/ic-pagination-bar.js.map +1 -1
- package/components/ic-pagination-item2.js +1 -1
- package/components/ic-pagination-item2.js.map +1 -1
- package/components/ic-pagination2.js +12 -8
- package/components/ic-pagination2.js.map +1 -1
- package/components/ic-popover-menu.js +46 -12
- package/components/ic-popover-menu.js.map +1 -1
- package/components/ic-radio-group.js.map +1 -1
- package/components/ic-search-bar.js +2 -6
- package/components/ic-search-bar.js.map +1 -1
- package/components/ic-section-container2.js +2 -2
- package/components/ic-skeleton.js +2 -2
- package/components/ic-skip-link.js +2 -2
- package/components/ic-status-tag.js +2 -2
- package/components/ic-step.js +13 -13
- package/components/ic-stepper.js +2 -2
- package/components/ic-switch.js +4 -4
- package/components/ic-switch.js.map +1 -1
- package/components/ic-tab-context.js +1 -1
- package/components/ic-tab-group.js +2 -2
- package/components/ic-tab-panel.js +2 -2
- package/components/ic-theme.js +1 -1
- package/components/ic-toast-region.js +1 -1
- package/components/ic-toast.js +5 -5
- package/components/ic-toggle-button-group.js +2 -2
- package/components/ic-toggle-button.js +2 -2
- package/dist/cjs/{close-icon-7f6ef8e4.js → close-icon-30d8bb41.js} +2 -3
- package/dist/cjs/close-icon-30d8bb41.js.map +1 -0
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +16 -12
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-list.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-list.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +1153 -306
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +5 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination_3.cjs.entry.js +12 -8
- package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +44 -11
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +2 -6
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +2 -2
- package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ic-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-status-tag.cjs.entry.js +2 -2
- package/dist/cjs/ic-step.cjs.entry.js +13 -13
- package/dist/cjs/ic-stepper.cjs.entry.js +2 -2
- package/dist/cjs/ic-switch.cjs.entry.js +4 -4
- package/dist/cjs/ic-tab-context.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/ic-theme.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +6 -6
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-toggle-button.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/close-icon.svg +1 -2
- package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js +17 -13
- package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js.map +1 -1
- package/dist/collection/components/ic-data-list/ic-data-list.css +4 -0
- package/dist/collection/components/ic-data-row/ic-data-row.css +1 -1
- package/dist/collection/components/ic-menu-item/ic-menu-item.css +9 -14
- package/dist/collection/components/ic-menu-item/ic-menu-item.js +24 -0
- package/dist/collection/components/ic-menu-item/ic-menu-item.js.map +1 -1
- package/dist/collection/components/ic-pagination/ic-pagination.js +12 -8
- package/dist/collection/components/ic-pagination/ic-pagination.js.map +1 -1
- package/dist/collection/components/ic-pagination-item/ic-pagination-item.css +2 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.css +4 -4
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +67 -11
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.stories.js +241 -1
- package/dist/collection/components/ic-search-bar/ic-search-bar.js +1 -1
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-section-container/ic-section-container.js +2 -2
- package/dist/collection/components/ic-skeleton/ic-skeleton.js +2 -2
- package/dist/collection/components/ic-skip-link/ic-skip-link.js +2 -2
- package/dist/collection/components/ic-status-tag/ic-status-tag.js +2 -2
- package/dist/collection/components/ic-step/ic-step.js +13 -13
- package/dist/collection/components/ic-stepper/ic-stepper.js +2 -2
- package/dist/collection/components/ic-switch/ic-switch.js +4 -4
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js +2 -2
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +2 -2
- package/dist/collection/components/ic-theme/ic-theme.js +1 -1
- package/dist/collection/components/ic-toast/ic-toast.js +5 -5
- package/dist/collection/components/ic-toast-region/ic-toast-region.js +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +2 -2
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +2 -2
- package/dist/components/close-icon.js +1 -2
- package/dist/components/close-icon.js.map +1 -1
- package/dist/components/ic-breadcrumb-group.js +16 -12
- package/dist/components/ic-breadcrumb-group.js.map +1 -1
- package/dist/components/ic-data-list.js +1 -1
- package/dist/components/ic-data-list.js.map +1 -1
- package/dist/components/ic-data-row.js +1 -1
- package/dist/components/ic-data-row.js.map +1 -1
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-menu-item2.js +7 -2
- package/dist/components/ic-menu-item2.js.map +1 -1
- package/dist/components/ic-menu2.js +1153 -306
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-pagination-bar.js.map +1 -1
- package/dist/components/ic-pagination-item2.js +1 -1
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination2.js +12 -8
- package/dist/components/ic-pagination2.js.map +1 -1
- package/dist/components/ic-popover-menu.js +46 -12
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-search-bar.js +2 -6
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js +2 -2
- package/dist/components/ic-skeleton.js +2 -2
- package/dist/components/ic-skeleton.js.map +1 -1
- package/dist/components/ic-skip-link.js +2 -2
- package/dist/components/ic-status-tag.js +2 -2
- package/dist/components/ic-step.js +13 -13
- package/dist/components/ic-stepper.js +2 -2
- package/dist/components/ic-switch.js +4 -4
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab-context.js +1 -1
- package/dist/components/ic-tab-group.js +2 -2
- package/dist/components/ic-tab-panel.js +2 -2
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toast-region.js +1 -1
- package/dist/components/ic-toast.js +5 -5
- package/dist/components/ic-toggle-button-group.js +2 -2
- package/dist/components/ic-toggle-button.js +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-23fb87be.entry.js → p-0558baed.entry.js} +2 -2
- package/dist/core/{p-a0c54a50.entry.js → p-0740be66.entry.js} +2 -2
- package/dist/core/{p-d0dd9f2c.entry.js → p-0cd21e04.entry.js} +2 -2
- package/dist/core/p-0cd21e04.entry.js.map +1 -0
- package/dist/core/{p-bb52e752.entry.js → p-1043f3dd.entry.js} +2 -2
- package/dist/core/{p-74a3a450.entry.js → p-1843357b.entry.js} +2 -2
- package/dist/core/{p-b58fb588.entry.js → p-2251df98.entry.js} +2 -2
- package/dist/core/{p-cf87b6db.entry.js → p-2bb815ef.entry.js} +2 -2
- package/dist/core/p-305d9639.entry.js +3 -0
- package/dist/core/p-305d9639.entry.js.map +1 -0
- package/dist/core/p-308be45e.entry.js +2 -0
- package/dist/core/p-308be45e.entry.js.map +1 -0
- package/dist/core/p-4b61e92e.entry.js +2 -0
- package/dist/core/{p-99b20121.entry.js.map → p-4b61e92e.entry.js.map} +1 -1
- package/dist/core/{p-fd9ea62a.entry.js → p-75f91c8c.entry.js} +2 -2
- package/dist/core/p-77f011e7.entry.js +2 -0
- package/dist/core/p-77f011e7.entry.js.map +1 -0
- package/dist/core/{p-70ca7796.entry.js → p-85db7e71.entry.js} +2 -2
- package/dist/core/{p-ab104baa.entry.js → p-987b08f9.entry.js} +2 -2
- package/dist/core/{p-85ac0d78.entry.js → p-9b144bed.entry.js} +2 -2
- package/dist/core/{p-d1220d2a.entry.js → p-a8d98164.entry.js} +2 -2
- package/dist/core/{p-a7c263bd.entry.js → p-ba8799ea.entry.js} +2 -2
- package/dist/core/p-ba8799ea.entry.js.map +1 -0
- package/dist/core/p-be8bbed8.entry.js +2 -0
- package/dist/core/p-be8bbed8.entry.js.map +1 -0
- package/dist/core/{p-85232cec.entry.js → p-bf06d022.entry.js} +2 -2
- package/dist/core/{p-c41fd2cf.entry.js → p-c0f6f568.entry.js} +2 -2
- package/dist/core/p-c391e323.js +2 -0
- package/dist/core/{p-271ee0bc.entry.js → p-c75c316b.entry.js} +2 -2
- package/dist/core/{p-970e190c.entry.js → p-e0b52a71.entry.js} +2 -2
- package/dist/core/p-ef289935.entry.js +2 -0
- package/dist/core/p-ef289935.entry.js.map +1 -0
- package/dist/core/{p-3da9774b.entry.js → p-ef91cf17.entry.js} +2 -2
- package/dist/core/p-f8aa89ff.entry.js +2 -0
- package/dist/core/p-f8aa89ff.entry.js.map +1 -0
- package/dist/core/{p-d7c6fc8d.entry.js → p-f8e5d8f8.entry.js} +2 -2
- package/dist/core/{p-6b5edd6b.entry.js → p-f9daecc7.entry.js} +2 -2
- package/dist/esm/{close-icon-539ec8d1.js → close-icon-0db44bf2.js} +2 -3
- package/dist/esm/close-icon-0db44bf2.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/ic-alert.entry.js +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +16 -12
- package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
- package/dist/esm/ic-data-list.entry.js +1 -1
- package/dist/esm/ic-data-list.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-data-row.entry.js.map +1 -1
- package/dist/esm/ic-dialog.entry.js +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +1153 -306
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-menu-item.entry.js +5 -1
- package/dist/esm/ic-menu-item.entry.js.map +1 -1
- package/dist/esm/ic-pagination-item.entry.js +1 -1
- package/dist/esm/ic-pagination-item.entry.js.map +1 -1
- package/dist/esm/ic-pagination_3.entry.js +12 -8
- package/dist/esm/ic-pagination_3.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +45 -12
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +2 -6
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +2 -2
- package/dist/esm/ic-side-navigation.entry.js +1 -1
- package/dist/esm/ic-skeleton.entry.js +2 -2
- package/dist/esm/ic-skip-link.entry.js +2 -2
- package/dist/esm/ic-status-tag.entry.js +2 -2
- package/dist/esm/ic-step.entry.js +13 -13
- package/dist/esm/ic-stepper.entry.js +2 -2
- package/dist/esm/ic-switch.entry.js +4 -4
- package/dist/esm/ic-tab-context.entry.js +1 -1
- package/dist/esm/ic-tab-group.entry.js +2 -2
- package/dist/esm/ic-tab-panel.entry.js +2 -2
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-toast-region.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +6 -6
- package/dist/esm/ic-toggle-button-group.entry.js +2 -2
- package/dist/esm/ic-toggle-button.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-breadcrumb-group/ic-breadcrumb-group.d.ts +6 -1
- package/dist/types/components/ic-menu-item/ic-menu-item.d.ts +4 -0
- package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +8 -0
- package/dist/types/components.d.ts +18 -2
- package/hydrate/index.js +1284 -393
- package/hydrate/index.mjs +1284 -393
- package/package.json +12 -9
- package/vscode-data.json +20 -1
- package/dist/cjs/close-icon-7f6ef8e4.js.map +0 -1
- package/dist/collection/assets/clear-icon.svg +0 -3
- package/dist/core/p-023cf5d9.entry.js +0 -2
- package/dist/core/p-023cf5d9.entry.js.map +0 -1
- package/dist/core/p-2424f82f.entry.js +0 -2
- package/dist/core/p-2424f82f.entry.js.map +0 -1
- package/dist/core/p-2b1ce5b7.entry.js +0 -2
- package/dist/core/p-2b1ce5b7.entry.js.map +0 -1
- package/dist/core/p-99b20121.entry.js +0 -2
- package/dist/core/p-a7c263bd.entry.js.map +0 -1
- package/dist/core/p-d0dd9f2c.entry.js.map +0 -1
- package/dist/core/p-d5fcd4f9.entry.js +0 -2
- package/dist/core/p-d5fcd4f9.entry.js.map +0 -1
- package/dist/core/p-e0b66371.entry.js +0 -2
- package/dist/core/p-e0b66371.entry.js.map +0 -1
- package/dist/core/p-f074ef5b.js +0 -2
- package/dist/core/p-fdc4376e.entry.js +0 -3
- package/dist/core/p-fdc4376e.entry.js.map +0 -1
- package/dist/esm/close-icon-539ec8d1.js.map +0 -1
- /package/dist/core/{p-23fb87be.entry.js.map → p-0558baed.entry.js.map} +0 -0
- /package/dist/core/{p-a0c54a50.entry.js.map → p-0740be66.entry.js.map} +0 -0
- /package/dist/core/{p-bb52e752.entry.js.map → p-1043f3dd.entry.js.map} +0 -0
- /package/dist/core/{p-74a3a450.entry.js.map → p-1843357b.entry.js.map} +0 -0
- /package/dist/core/{p-b58fb588.entry.js.map → p-2251df98.entry.js.map} +0 -0
- /package/dist/core/{p-cf87b6db.entry.js.map → p-2bb815ef.entry.js.map} +0 -0
- /package/dist/core/{p-fd9ea62a.entry.js.map → p-75f91c8c.entry.js.map} +0 -0
- /package/dist/core/{p-70ca7796.entry.js.map → p-85db7e71.entry.js.map} +0 -0
- /package/dist/core/{p-ab104baa.entry.js.map → p-987b08f9.entry.js.map} +0 -0
- /package/dist/core/{p-85ac0d78.entry.js.map → p-9b144bed.entry.js.map} +0 -0
- /package/dist/core/{p-d1220d2a.entry.js.map → p-a8d98164.entry.js.map} +0 -0
- /package/dist/core/{p-85232cec.entry.js.map → p-bf06d022.entry.js.map} +0 -0
- /package/dist/core/{p-c41fd2cf.entry.js.map → p-c0f6f568.entry.js.map} +0 -0
- /package/dist/core/{p-f074ef5b.js.map → p-c391e323.js.map} +0 -0
- /package/dist/core/{p-271ee0bc.entry.js.map → p-c75c316b.entry.js.map} +0 -0
- /package/dist/core/{p-970e190c.entry.js.map → p-e0b52a71.entry.js.map} +0 -0
- /package/dist/core/{p-3da9774b.entry.js.map → p-ef91cf17.entry.js.map} +0 -0
- /package/dist/core/{p-d7c6fc8d.entry.js.map → p-f8e5d8f8.entry.js.map} +0 -0
- /package/dist/core/{p-6b5edd6b.entry.js.map → p-f9daecc7.entry.js.map} +0 -0
package/hydrate/index.js
CHANGED
|
@@ -4285,8 +4285,7 @@ class ActionChip {
|
|
|
4285
4285
|
}
|
|
4286
4286
|
|
|
4287
4287
|
var closeIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
4288
|
-
<path d="
|
|
4289
|
-
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
|
|
4288
|
+
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" fill="currentColor"/>
|
|
4290
4289
|
<title>close icon</title>
|
|
4291
4290
|
</svg>
|
|
4292
4291
|
`;
|
|
@@ -4959,6 +4958,8 @@ class BreadcrumbGroup {
|
|
|
4959
4958
|
this.deviceSize = DEVICE_SIZES.XL;
|
|
4960
4959
|
/**
|
|
4961
4960
|
* If `true`, display only a single breadcrumb for the parent page with a back icon.
|
|
4961
|
+
* Requires at least two `ic-breadcrumb` children, as the displayed breadcrumb
|
|
4962
|
+
* shows the title of the parent (second-to-last) page.
|
|
4962
4963
|
*/
|
|
4963
4964
|
this.backBreadcrumbOnly = false;
|
|
4964
4965
|
/**
|
|
@@ -4991,12 +4992,10 @@ class BreadcrumbGroup {
|
|
|
4991
4992
|
this.revertLastParentCollapsedBreadcrumb();
|
|
4992
4993
|
}
|
|
4993
4994
|
};
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
}
|
|
4999
|
-
};
|
|
4995
|
+
/**
|
|
4996
|
+
* Returns the second-to-last breadcrumb (the "parent" page), or `null`
|
|
4997
|
+
* if fewer than two breadcrumbs are present.
|
|
4998
|
+
*/
|
|
5000
4999
|
this.getLastParentBreadcrumb = () => {
|
|
5001
5000
|
const allBreadcrumbs = this.el.querySelectorAll(this.IC_BREADCRUMB);
|
|
5002
5001
|
return allBreadcrumbs.length > 1
|
|
@@ -5072,11 +5071,15 @@ class BreadcrumbGroup {
|
|
|
5072
5071
|
};
|
|
5073
5072
|
this.setLastParentCollapsedBackBreadcrumb = () => {
|
|
5074
5073
|
this.lastParentBreadcrumb = this.getLastParentBreadcrumb();
|
|
5075
|
-
this.
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5074
|
+
if (this.lastParentBreadcrumb === null) {
|
|
5075
|
+
console.warn("ic-breadcrumb-group: backBreadcrumbOnly requires at least two " +
|
|
5076
|
+
"ic-breadcrumb children. The back breadcrumb displays the title " +
|
|
5077
|
+
"of the parent page, so a minimum of two breadcrumbs is needed.");
|
|
5078
|
+
return;
|
|
5079
5079
|
}
|
|
5080
|
+
this.lastParentBreadcrumb.classList.add("show");
|
|
5081
|
+
this.lastParentBreadcrumb.classList.remove("hide");
|
|
5082
|
+
this.lastParentBreadcrumb.setAttribute(this.SHOW_BACK_ICON, "true");
|
|
5080
5083
|
};
|
|
5081
5084
|
this.revertLastParentCollapsedBreadcrumb = () => {
|
|
5082
5085
|
if (this.lastParentBreadcrumb) {
|
|
@@ -5159,11 +5162,11 @@ class BreadcrumbGroup {
|
|
|
5159
5162
|
}
|
|
5160
5163
|
render() {
|
|
5161
5164
|
const { backBreadcrumbOnly, collapsed, theme } = this;
|
|
5162
|
-
return (hAsync(Host, { key: '
|
|
5165
|
+
return (hAsync(Host, { key: '6f0f099c548cb049c02a6338d7cdec696e75a82c', class: {
|
|
5163
5166
|
"ic-breadcrumb-group-back": backBreadcrumbOnly,
|
|
5164
5167
|
"ic-breadcrumb-group-collapsed": collapsed,
|
|
5165
5168
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
5166
|
-
} }, hAsync("nav", { key: '
|
|
5169
|
+
} }, hAsync("nav", { key: '86b02604932d3d54d48383f85482f2241102f8c7', "aria-label": "breadcrumbs" }, hAsync("ol", { key: 'ffe25df4eee620a28a3e427e1d65c8cdbe0e2f84' }, hAsync("slot", { key: '818515360bb8783b6151a1651eb6319f4a533242' })))));
|
|
5167
5170
|
}
|
|
5168
5171
|
get el() { return getElement(this); }
|
|
5169
5172
|
static get watchers() { return {
|
|
@@ -6646,7 +6649,7 @@ class ClassificationBanner {
|
|
|
6646
6649
|
}; }
|
|
6647
6650
|
}
|
|
6648
6651
|
|
|
6649
|
-
const icDataListCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block}.heading{--ic-typography-color:var(--ic-data-list-text-heading);color:var(--ic-data-list-text-heading)}.rows{display:flex;flex-direction:column;gap:var(--ic-space-md)}:host(.ic-data-list-small) .rows{gap:var(--ic-space-xs)}.divider{margin-top:var(--ic-space-lg);margin-bottom:var(--ic-space-md);height:var(--ic-border-width);background-color:var(--ic-data-list-keyline-heading)}.divider-no-heading{margin-top:0}:host(.ic-data-list-small) .divider{margin-top:var(--ic-space-sm);margin-bottom:var(--ic-space-xs)}@media (forced-colors: active){.divider{background-color:canvastext}}";
|
|
6652
|
+
const icDataListCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block}.heading{--ic-typography-color:var(--ic-data-list-text-heading);color:var(--ic-data-list-text-heading)}.rows{display:flex;flex-direction:column;gap:var(--ic-space-md)}:host(.ic-data-list-small) .rows{gap:var(--ic-space-xs)}.divider{margin-top:var(--ic-space-lg);margin-bottom:var(--ic-space-md);height:var(--ic-border-width);background-color:var(--ic-data-list-keyline-heading)}.divider-no-heading{margin-top:0}:host(.ic-data-list-small) .divider{margin-top:var(--ic-space-sm);margin-bottom:var(--ic-space-xs)}:host(.ic-data-list-small) .divider.divider-no-heading{margin-top:0}@media (forced-colors: active){.divider{background-color:canvastext}}";
|
|
6650
6653
|
var IcDataListStyle0 = icDataListCss;
|
|
6651
6654
|
|
|
6652
6655
|
/**
|
|
@@ -6691,7 +6694,7 @@ class DataList {
|
|
|
6691
6694
|
}; }
|
|
6692
6695
|
}
|
|
6693
6696
|
|
|
6694
|
-
const icDataRowCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{position:relative;display:block}.data{display:flex;align-items:top}.text-cells{display:flex;flex-grow:1;min-width:0;--ic-typography-color:var(--ic-data-list-text-cell);color:var(--ic-data-list-text-cell)}.label{width:var(--data-row-label-width, 12.5rem);min-width:12.5rem;margin-right:var(--ic-space-md);--ic-typography-color:var(--ic-data-list-text-label);color:var(--ic-data-list-text-label)}.value{flex-grow:1}slot[name=\"value\"]::slotted(ic-text-field[readonly][hide-label]){margin-top:calc(var(--ic-space-xs) * -1)}slot[name=\"value\"]::slotted(ic-text-field[small][readonly][hide-label]){margin-top:calc(var(--ic-space-xxs) * -1)}slot[name=\"value\"]::slotted(ic-text-field[readonly][hide-label][rows]){margin-top:calc(var(--ic-space-xxs) * -1 - var(--ic-space-xxxs))}.end-component{width:-moz-fit-content;width:fit-content;margin-left:3.5rem}.divider{margin-top:var(--ic-space-md);height:var(--ic-border-width);background-color:var(--ic-data-list-keyline-cell)}:host(.ic-data-row-small) .divider{margin-top:var(--ic-space-xs)}:host(.breakpoint-medium) .label{width:10rem;min-width:10rem}:host(.breakpoint-xs) .text-cells{flex-direction:column}:host(.breakpoint-xs) .label{width:8rem;margin-bottom:var(--ic-space-xs)}:host(.breakpoint-xs) .value{max-width:95%}:host(.breakpoint-xs) .end-component{margin-left:0}@media (forced-colors: active){.divider{background-color:canvastext}}";
|
|
6697
|
+
const icDataRowCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{position:relative;display:block}.data{display:flex;align-items:top}.text-cells{display:flex;flex-grow:1;min-width:0;--ic-typography-color:var(--ic-data-list-text-cell);color:var(--ic-data-list-text-cell)}.label{width:var(--data-row-label-width, 12.5rem);min-width:12.5rem;margin-right:var(--ic-space-md);--ic-typography-color:var(--ic-data-list-text-label);color:var(--ic-data-list-text-label)}.value{flex-grow:1}slot[name=\"value\"]::slotted(ic-text-field[readonly][hide-label]){margin-top:calc(var(--ic-space-xs) * -1)}slot[name=\"value\"]::slotted(ic-text-field[size=\"small\"][readonly][hide-label]){margin-top:calc(var(--ic-space-xxs) * -1)}slot[name=\"value\"]::slotted(ic-text-field[readonly][hide-label][rows]){margin-top:calc(var(--ic-space-xxs) * -1 - var(--ic-space-xxxs))}.end-component{width:-moz-fit-content;width:fit-content;margin-left:3.5rem}.divider{margin-top:var(--ic-space-md);height:var(--ic-border-width);background-color:var(--ic-data-list-keyline-cell)}:host(.ic-data-row-small) .divider{margin-top:var(--ic-space-xs)}:host(.breakpoint-medium) .label{width:10rem;min-width:10rem}:host(.breakpoint-xs) .text-cells{flex-direction:column}:host(.breakpoint-xs) .label{width:8rem;margin-bottom:var(--ic-space-xs)}:host(.breakpoint-xs) .value{max-width:95%}:host(.breakpoint-xs) .end-component{margin-left:0}@media (forced-colors: active){.divider{background-color:canvastext}}";
|
|
6695
6698
|
var IcDataRowStyle0 = icDataRowCss;
|
|
6696
6699
|
|
|
6697
6700
|
/**
|
|
@@ -10629,28 +10632,69 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
|
|
|
10629
10632
|
|
|
10630
10633
|
var purify = {exports: {}};
|
|
10631
10634
|
|
|
10632
|
-
/*! @license DOMPurify 3.4.
|
|
10635
|
+
/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */
|
|
10633
10636
|
|
|
10634
10637
|
(function (module, exports) {
|
|
10635
10638
|
(function (global, factory) {
|
|
10636
10639
|
module.exports = factory() ;
|
|
10637
10640
|
})(commonjsGlobal, (function () {
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10641
|
+
function _arrayLikeToArray(r, a) {
|
|
10642
|
+
(null == a || a > r.length) && (a = r.length);
|
|
10643
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
10644
|
+
return n;
|
|
10645
|
+
}
|
|
10646
|
+
function _arrayWithHoles(r) {
|
|
10647
|
+
if (Array.isArray(r)) return r;
|
|
10648
|
+
}
|
|
10649
|
+
function _iterableToArrayLimit(r, l) {
|
|
10650
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
10651
|
+
if (null != t) {
|
|
10652
|
+
var e,
|
|
10653
|
+
n,
|
|
10654
|
+
i,
|
|
10655
|
+
u,
|
|
10656
|
+
a = [],
|
|
10657
|
+
f = true,
|
|
10658
|
+
o = false;
|
|
10659
|
+
try {
|
|
10660
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
10661
|
+
} catch (r) {
|
|
10662
|
+
o = true, n = r;
|
|
10663
|
+
} finally {
|
|
10664
|
+
try {
|
|
10665
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
10666
|
+
} finally {
|
|
10667
|
+
if (o) throw n;
|
|
10668
|
+
}
|
|
10669
|
+
}
|
|
10670
|
+
return a;
|
|
10671
|
+
}
|
|
10672
|
+
}
|
|
10673
|
+
function _nonIterableRest() {
|
|
10674
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
10675
|
+
}
|
|
10676
|
+
function _slicedToArray(r, e) {
|
|
10677
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
10678
|
+
}
|
|
10679
|
+
function _unsupportedIterableToArray(r, a) {
|
|
10680
|
+
if (r) {
|
|
10681
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
10682
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
10683
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
10684
|
+
}
|
|
10685
|
+
}
|
|
10686
|
+
|
|
10687
|
+
const entries = Object.entries,
|
|
10688
|
+
setPrototypeOf = Object.setPrototypeOf,
|
|
10689
|
+
isFrozen = Object.isFrozen,
|
|
10690
|
+
getPrototypeOf = Object.getPrototypeOf,
|
|
10691
|
+
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
10692
|
+
let freeze = Object.freeze,
|
|
10693
|
+
seal = Object.seal,
|
|
10694
|
+
create = Object.create; // eslint-disable-line import/no-mutable-exports
|
|
10695
|
+
let _ref = typeof Reflect !== 'undefined' && Reflect,
|
|
10696
|
+
apply = _ref.apply,
|
|
10697
|
+
construct = _ref.construct;
|
|
10654
10698
|
if (!freeze) {
|
|
10655
10699
|
freeze = function freeze(x) {
|
|
10656
10700
|
return x;
|
|
@@ -10682,13 +10726,19 @@ var purify = {exports: {}};
|
|
|
10682
10726
|
const arrayPop = unapply(Array.prototype.pop);
|
|
10683
10727
|
const arrayPush = unapply(Array.prototype.push);
|
|
10684
10728
|
const arraySplice = unapply(Array.prototype.splice);
|
|
10729
|
+
const arrayIsArray = Array.isArray;
|
|
10685
10730
|
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
10686
10731
|
const stringToString = unapply(String.prototype.toString);
|
|
10687
10732
|
const stringMatch = unapply(String.prototype.match);
|
|
10688
10733
|
const stringReplace = unapply(String.prototype.replace);
|
|
10689
10734
|
const stringIndexOf = unapply(String.prototype.indexOf);
|
|
10690
10735
|
const stringTrim = unapply(String.prototype.trim);
|
|
10736
|
+
const numberToString = unapply(Number.prototype.toString);
|
|
10737
|
+
const booleanToString = unapply(Boolean.prototype.toString);
|
|
10738
|
+
const bigintToString = typeof BigInt === 'undefined' ? null : unapply(BigInt.prototype.toString);
|
|
10739
|
+
const symbolToString = typeof Symbol === 'undefined' ? null : unapply(Symbol.prototype.toString);
|
|
10691
10740
|
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
|
10741
|
+
const objectToString = unapply(Object.prototype.toString);
|
|
10692
10742
|
const regExpTest = unapply(RegExp.prototype.test);
|
|
10693
10743
|
const typeErrorCreate = unconstruct(TypeError);
|
|
10694
10744
|
/**
|
|
@@ -10738,6 +10788,9 @@ var purify = {exports: {}};
|
|
|
10738
10788
|
// Prevent prototype setters from intercepting set as a this value.
|
|
10739
10789
|
setPrototypeOf(set, null);
|
|
10740
10790
|
}
|
|
10791
|
+
if (!arrayIsArray(array)) {
|
|
10792
|
+
return set;
|
|
10793
|
+
}
|
|
10741
10794
|
let l = array.length;
|
|
10742
10795
|
while (l--) {
|
|
10743
10796
|
let element = array[l];
|
|
@@ -10778,10 +10831,13 @@ var purify = {exports: {}};
|
|
|
10778
10831
|
*/
|
|
10779
10832
|
function clone(object) {
|
|
10780
10833
|
const newObject = create(null);
|
|
10781
|
-
for (const
|
|
10834
|
+
for (const _ref2 of entries(object)) {
|
|
10835
|
+
var _ref3 = _slicedToArray(_ref2, 2);
|
|
10836
|
+
const property = _ref3[0];
|
|
10837
|
+
const value = _ref3[1];
|
|
10782
10838
|
const isPropertyExist = objectHasOwnProperty(object, property);
|
|
10783
10839
|
if (isPropertyExist) {
|
|
10784
|
-
if (
|
|
10840
|
+
if (arrayIsArray(value)) {
|
|
10785
10841
|
newObject[property] = cleanArray(value);
|
|
10786
10842
|
} else if (value && typeof value === 'object' && value.constructor === Object) {
|
|
10787
10843
|
newObject[property] = clone(value);
|
|
@@ -10792,6 +10848,58 @@ var purify = {exports: {}};
|
|
|
10792
10848
|
}
|
|
10793
10849
|
return newObject;
|
|
10794
10850
|
}
|
|
10851
|
+
/**
|
|
10852
|
+
* Convert non-node values into strings without depending on direct property access.
|
|
10853
|
+
*
|
|
10854
|
+
* @param value - The value to stringify.
|
|
10855
|
+
* @returns A string representation of the provided value.
|
|
10856
|
+
*/
|
|
10857
|
+
function stringifyValue(value) {
|
|
10858
|
+
switch (typeof value) {
|
|
10859
|
+
case 'string':
|
|
10860
|
+
{
|
|
10861
|
+
return value;
|
|
10862
|
+
}
|
|
10863
|
+
case 'number':
|
|
10864
|
+
{
|
|
10865
|
+
return numberToString(value);
|
|
10866
|
+
}
|
|
10867
|
+
case 'boolean':
|
|
10868
|
+
{
|
|
10869
|
+
return booleanToString(value);
|
|
10870
|
+
}
|
|
10871
|
+
case 'bigint':
|
|
10872
|
+
{
|
|
10873
|
+
return bigintToString ? bigintToString(value) : '0';
|
|
10874
|
+
}
|
|
10875
|
+
case 'symbol':
|
|
10876
|
+
{
|
|
10877
|
+
return symbolToString ? symbolToString(value) : 'Symbol()';
|
|
10878
|
+
}
|
|
10879
|
+
case 'undefined':
|
|
10880
|
+
{
|
|
10881
|
+
return objectToString(value);
|
|
10882
|
+
}
|
|
10883
|
+
case 'function':
|
|
10884
|
+
case 'object':
|
|
10885
|
+
{
|
|
10886
|
+
if (value === null) {
|
|
10887
|
+
return objectToString(value);
|
|
10888
|
+
}
|
|
10889
|
+
const valueAsRecord = value;
|
|
10890
|
+
const valueToString = lookupGetter(valueAsRecord, 'toString');
|
|
10891
|
+
if (typeof valueToString === 'function') {
|
|
10892
|
+
const stringified = valueToString(valueAsRecord);
|
|
10893
|
+
return typeof stringified === 'string' ? stringified : objectToString(stringified);
|
|
10894
|
+
}
|
|
10895
|
+
return objectToString(value);
|
|
10896
|
+
}
|
|
10897
|
+
default:
|
|
10898
|
+
{
|
|
10899
|
+
return objectToString(value);
|
|
10900
|
+
}
|
|
10901
|
+
}
|
|
10902
|
+
}
|
|
10795
10903
|
/**
|
|
10796
10904
|
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
|
10797
10905
|
*
|
|
@@ -10817,6 +10925,14 @@ var purify = {exports: {}};
|
|
|
10817
10925
|
}
|
|
10818
10926
|
return fallbackValue;
|
|
10819
10927
|
}
|
|
10928
|
+
function isRegex(value) {
|
|
10929
|
+
try {
|
|
10930
|
+
regExpTest(value, '');
|
|
10931
|
+
return true;
|
|
10932
|
+
} catch (_unused) {
|
|
10933
|
+
return false;
|
|
10934
|
+
}
|
|
10935
|
+
}
|
|
10820
10936
|
|
|
10821
10937
|
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
10822
10938
|
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
@@ -10832,15 +10948,14 @@ var purify = {exports: {}};
|
|
|
10832
10948
|
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
10833
10949
|
const text = freeze(['#text']);
|
|
10834
10950
|
|
|
10835
|
-
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns'
|
|
10951
|
+
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'command', 'commandfor', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']);
|
|
10836
10952
|
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
10837
10953
|
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lquote', 'lspace', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
10838
10954
|
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
10839
10955
|
|
|
10840
|
-
|
|
10841
|
-
const
|
|
10842
|
-
const
|
|
10843
|
-
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
10956
|
+
const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
|
|
10957
|
+
const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
|
|
10958
|
+
const TMPLIT_EXPR = seal(/\${[\w\W]*/g);
|
|
10844
10959
|
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
10845
10960
|
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
10846
10961
|
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
@@ -10850,30 +10965,31 @@ var purify = {exports: {}};
|
|
|
10850
10965
|
);
|
|
10851
10966
|
const DOCTYPE_NAME = seal(/^html$/i);
|
|
10852
10967
|
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
10968
|
+
// Markup-significant character probes used by _sanitizeElements.
|
|
10969
|
+
// Shared module-level instances are safe despite the sticky /g flags:
|
|
10970
|
+
// unapply() resets lastIndex for RegExp receivers before every call.
|
|
10971
|
+
const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
|
|
10972
|
+
const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
|
|
10973
|
+
const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
|
|
10974
|
+
const SELF_CLOSING_TAG = seal(/\/>/i);
|
|
10853
10975
|
|
|
10854
|
-
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
10855
|
-
__proto__: null,
|
|
10856
|
-
ARIA_ATTR: ARIA_ATTR,
|
|
10857
|
-
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
10858
|
-
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
|
10859
|
-
DATA_ATTR: DATA_ATTR,
|
|
10860
|
-
DOCTYPE_NAME: DOCTYPE_NAME,
|
|
10861
|
-
ERB_EXPR: ERB_EXPR,
|
|
10862
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
10863
|
-
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
10864
|
-
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
10865
|
-
TMPLIT_EXPR: TMPLIT_EXPR
|
|
10866
|
-
});
|
|
10867
|
-
|
|
10868
|
-
/* eslint-disable @typescript-eslint/indent */
|
|
10869
10976
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
10870
10977
|
const NODE_TYPE = {
|
|
10871
10978
|
element: 1,
|
|
10979
|
+
attribute: 2,
|
|
10872
10980
|
text: 3,
|
|
10981
|
+
cdataSection: 4,
|
|
10982
|
+
entityReference: 5,
|
|
10873
10983
|
// Deprecated
|
|
10874
|
-
|
|
10984
|
+
entityNode: 6,
|
|
10985
|
+
// Deprecated
|
|
10986
|
+
processingInstruction: 7,
|
|
10875
10987
|
comment: 8,
|
|
10876
|
-
document: 9
|
|
10988
|
+
document: 9,
|
|
10989
|
+
documentType: 10,
|
|
10990
|
+
documentFragment: 11,
|
|
10991
|
+
notation: 12 // Deprecated
|
|
10992
|
+
};
|
|
10877
10993
|
const getGlobal = function getGlobal() {
|
|
10878
10994
|
return typeof window === 'undefined' ? null : window;
|
|
10879
10995
|
};
|
|
@@ -10928,10 +11044,25 @@ var purify = {exports: {}};
|
|
|
10928
11044
|
uponSanitizeShadowNode: []
|
|
10929
11045
|
};
|
|
10930
11046
|
};
|
|
11047
|
+
/**
|
|
11048
|
+
* Resolve a set-valued configuration option: a fresh set built from
|
|
11049
|
+
* cfg[key] when it is an own array property (seeded with a clone of
|
|
11050
|
+
* options.base when given, case-normalized via options.transform),
|
|
11051
|
+
* the fallback set otherwise.
|
|
11052
|
+
*
|
|
11053
|
+
* @param cfg the cloned, prototype-free configuration object
|
|
11054
|
+
* @param key the configuration property to read
|
|
11055
|
+
* @param fallback the set to use when the option is absent or not an array
|
|
11056
|
+
* @param options transform and optional base set to merge into
|
|
11057
|
+
* @returns the resolved set
|
|
11058
|
+
*/
|
|
11059
|
+
const _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
|
|
11060
|
+
return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
|
|
11061
|
+
};
|
|
10931
11062
|
function createDOMPurify() {
|
|
10932
11063
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
10933
11064
|
const DOMPurify = root => createDOMPurify(root);
|
|
10934
|
-
DOMPurify.version = '3.4.
|
|
11065
|
+
DOMPurify.version = '3.4.11';
|
|
10935
11066
|
DOMPurify.removed = [];
|
|
10936
11067
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
10937
11068
|
// Not running in a browser, provide a factory function
|
|
@@ -10939,28 +11070,25 @@ var purify = {exports: {}};
|
|
|
10939
11070
|
DOMPurify.isSupported = false;
|
|
10940
11071
|
return DOMPurify;
|
|
10941
11072
|
}
|
|
10942
|
-
let
|
|
10943
|
-
document
|
|
10944
|
-
} = window;
|
|
11073
|
+
let document = window.document;
|
|
10945
11074
|
const originalDocument = document;
|
|
10946
11075
|
const currentScript = originalDocument.currentScript;
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
|
|
10954
|
-
HTMLFormElement,
|
|
10955
|
-
DOMParser,
|
|
10956
|
-
trustedTypes
|
|
10957
|
-
} = window;
|
|
11076
|
+
const HTMLTemplateElement = window.HTMLTemplateElement,
|
|
11077
|
+
Node = window.Node,
|
|
11078
|
+
Element = window.Element,
|
|
11079
|
+
NodeFilter = window.NodeFilter;
|
|
11080
|
+
const DOMParser = window.DOMParser,
|
|
11081
|
+
trustedTypes = window.trustedTypes;
|
|
10958
11082
|
const ElementPrototype = Element.prototype;
|
|
10959
11083
|
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
10960
11084
|
const remove = lookupGetter(ElementPrototype, 'remove');
|
|
10961
11085
|
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
10962
11086
|
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
10963
11087
|
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
11088
|
+
const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');
|
|
11089
|
+
const getAttributes = lookupGetter(ElementPrototype, 'attributes');
|
|
11090
|
+
const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;
|
|
11091
|
+
const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;
|
|
10964
11092
|
// As per issue #47, the web-components registry is inherited by a
|
|
10965
11093
|
// new document created via createHTMLDocument. As per the spec
|
|
10966
11094
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
@@ -10975,33 +11103,74 @@ var purify = {exports: {}};
|
|
|
10975
11103
|
}
|
|
10976
11104
|
let trustedTypesPolicy;
|
|
10977
11105
|
let emptyHTML = '';
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
11106
|
+
// The instance's own internal Trusted Types policy. Unlike a caller-supplied
|
|
11107
|
+
// `TRUSTED_TYPES_POLICY`, this is created at most once — Trusted Types throws
|
|
11108
|
+
// on duplicate policy names — and is the only policy allowed to persist
|
|
11109
|
+
// across configurations and survive `clearConfig()`.
|
|
11110
|
+
let defaultTrustedTypesPolicy;
|
|
11111
|
+
let defaultTrustedTypesPolicyResolved = false;
|
|
11112
|
+
// Tracks whether we are already inside a call to the configured Trusted Types
|
|
11113
|
+
// policy (`createHTML` or `createScriptURL`). If a supplied policy callback
|
|
11114
|
+
// itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would
|
|
11115
|
+
// re-enter the policy and recurse until the stack overflows. We detect that
|
|
11116
|
+
// re-entry and throw a clear, actionable error instead. The guard is shared
|
|
11117
|
+
// across both callbacks, because either one re-entering `sanitize` triggers
|
|
11118
|
+
// the same unbounded recursion.
|
|
11119
|
+
let IN_TRUSTED_TYPES_POLICY = 0;
|
|
11120
|
+
const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
|
|
11121
|
+
if (IN_TRUSTED_TYPES_POLICY > 0) {
|
|
11122
|
+
throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or ' + 'createScriptURL) must not call DOMPurify.sanitize, as that causes ' + 'infinite recursion. Do not pass a policy whose callbacks wrap ' + 'DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted ' + 'Types" section of the README.');
|
|
11123
|
+
}
|
|
11124
|
+
};
|
|
11125
|
+
const _createTrustedHTML = function _createTrustedHTML(html) {
|
|
11126
|
+
_assertNotInTrustedTypesPolicy();
|
|
11127
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
11128
|
+
try {
|
|
11129
|
+
return trustedTypesPolicy.createHTML(html);
|
|
11130
|
+
} finally {
|
|
11131
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
11132
|
+
}
|
|
11133
|
+
};
|
|
11134
|
+
const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
|
|
11135
|
+
_assertNotInTrustedTypesPolicy();
|
|
11136
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
11137
|
+
try {
|
|
11138
|
+
return trustedTypesPolicy.createScriptURL(scriptUrl);
|
|
11139
|
+
} finally {
|
|
11140
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
11141
|
+
}
|
|
11142
|
+
};
|
|
11143
|
+
// Lazily resolve (and cache) the instance's internal default policy.
|
|
11144
|
+
// Resolution is attempted at most once: a successful `createPolicy` cannot be
|
|
11145
|
+
// repeated (Trusted Types throws on duplicate names), and a failed or
|
|
11146
|
+
// unsupported attempt must not be retried on every parse.
|
|
11147
|
+
const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
|
|
11148
|
+
if (!defaultTrustedTypesPolicyResolved) {
|
|
11149
|
+
defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
11150
|
+
defaultTrustedTypesPolicyResolved = true;
|
|
11151
|
+
}
|
|
11152
|
+
return defaultTrustedTypesPolicy;
|
|
11153
|
+
};
|
|
11154
|
+
const _document = document,
|
|
11155
|
+
implementation = _document.implementation,
|
|
11156
|
+
createNodeIterator = _document.createNodeIterator,
|
|
11157
|
+
createDocumentFragment = _document.createDocumentFragment,
|
|
11158
|
+
getElementsByTagName = _document.getElementsByTagName;
|
|
11159
|
+
const importNode = originalDocument.importNode;
|
|
10987
11160
|
let hooks = _createHooksMap();
|
|
10988
11161
|
/**
|
|
10989
11162
|
* Expose whether this browser supports running the full DOMPurify.
|
|
10990
11163
|
*/
|
|
10991
11164
|
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
|
|
10992
|
-
const
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
} = EXPRESSIONS;
|
|
11002
|
-
let {
|
|
11003
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
|
11004
|
-
} = EXPRESSIONS;
|
|
11165
|
+
const MUSTACHE_EXPR$1 = MUSTACHE_EXPR,
|
|
11166
|
+
ERB_EXPR$1 = ERB_EXPR,
|
|
11167
|
+
TMPLIT_EXPR$1 = TMPLIT_EXPR,
|
|
11168
|
+
DATA_ATTR$1 = DATA_ATTR,
|
|
11169
|
+
ARIA_ATTR$1 = ARIA_ATTR,
|
|
11170
|
+
IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA,
|
|
11171
|
+
ATTR_WHITESPACE$1 = ATTR_WHITESPACE,
|
|
11172
|
+
CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
|
|
11173
|
+
let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
|
|
11005
11174
|
/**
|
|
11006
11175
|
* We consider the elements and attributes below to be safe. Ideally
|
|
11007
11176
|
* don't add any new ones but feel free to remove unwanted ones.
|
|
@@ -11078,6 +11247,13 @@ var purify = {exports: {}};
|
|
|
11078
11247
|
let WHOLE_DOCUMENT = false;
|
|
11079
11248
|
/* Track whether config is already set on this instance of DOMPurify. */
|
|
11080
11249
|
let SET_CONFIG = false;
|
|
11250
|
+
/* Pristine allowlist bindings captured at setConfig() time. On the
|
|
11251
|
+
* persistent-config path sanitize() restores the sets from these before
|
|
11252
|
+
* the per-walk hook clone-guard, so a hook's in-call widening cannot
|
|
11253
|
+
* carry across calls. Null until setConfig() is called; reset by
|
|
11254
|
+
* clearConfig(). */
|
|
11255
|
+
let SET_CONFIG_ALLOWED_TAGS = null;
|
|
11256
|
+
let SET_CONFIG_ALLOWED_ATTR = null;
|
|
11081
11257
|
/* Decide if all elements (e.g. style, script) must be children of
|
|
11082
11258
|
* document.body. By default, browsers might move them to document.head */
|
|
11083
11259
|
let FORCE_BODY = false;
|
|
@@ -11120,7 +11296,17 @@ var purify = {exports: {}};
|
|
|
11120
11296
|
let USE_PROFILES = {};
|
|
11121
11297
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
11122
11298
|
let FORBID_CONTENTS = null;
|
|
11123
|
-
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
11299
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
11300
|
+
// <selectedcontent> mirrors the selected <option>'s subtree, cloned by
|
|
11301
|
+
// the UA (customizable <select>) — including any on* handlers — and the
|
|
11302
|
+
// engine re-mirrors synchronously whenever a removal changes which
|
|
11303
|
+
// option/selectedcontent is current, even inside DOMPurify's inert
|
|
11304
|
+
// DOMParser document. Hoisting its children on removal re-inserts a fresh
|
|
11305
|
+
// mirror target ahead of the walk, which the engine refills, looping
|
|
11306
|
+
// forever (DoS) and amplifying output. Dropping its content on removal
|
|
11307
|
+
// (rather than hoisting) breaks that cascade; the content is a duplicate
|
|
11308
|
+
// of the option, which is sanitized on its own. See campaign-3 F1/F6.
|
|
11309
|
+
'selectedcontent', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
11124
11310
|
/* Tags that are safe for data: URIs */
|
|
11125
11311
|
let DATA_URI_TAGS = null;
|
|
11126
11312
|
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
@@ -11136,8 +11322,10 @@ var purify = {exports: {}};
|
|
|
11136
11322
|
/* Allowed XHTML+XML namespaces */
|
|
11137
11323
|
let ALLOWED_NAMESPACES = null;
|
|
11138
11324
|
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
11139
|
-
|
|
11140
|
-
let
|
|
11325
|
+
const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
11326
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
|
|
11327
|
+
const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);
|
|
11328
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
|
|
11141
11329
|
// Certain elements are allowed in both SVG and HTML
|
|
11142
11330
|
// namespace. We need to specify them explicitly
|
|
11143
11331
|
// so that they don't get erroneously deleted from
|
|
@@ -11179,15 +11367,33 @@ var purify = {exports: {}};
|
|
|
11179
11367
|
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
11180
11368
|
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
11181
11369
|
/* Set configuration parameters */
|
|
11182
|
-
ALLOWED_TAGS =
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11370
|
+
ALLOWED_TAGS = _resolveSetOption(cfg, 'ALLOWED_TAGS', DEFAULT_ALLOWED_TAGS, {
|
|
11371
|
+
transform: transformCaseFunc
|
|
11372
|
+
});
|
|
11373
|
+
ALLOWED_ATTR = _resolveSetOption(cfg, 'ALLOWED_ATTR', DEFAULT_ALLOWED_ATTR, {
|
|
11374
|
+
transform: transformCaseFunc
|
|
11375
|
+
});
|
|
11376
|
+
ALLOWED_NAMESPACES = _resolveSetOption(cfg, 'ALLOWED_NAMESPACES', DEFAULT_ALLOWED_NAMESPACES, {
|
|
11377
|
+
transform: stringToString
|
|
11378
|
+
});
|
|
11379
|
+
URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, 'ADD_URI_SAFE_ATTR', DEFAULT_URI_SAFE_ATTRIBUTES, {
|
|
11380
|
+
transform: transformCaseFunc,
|
|
11381
|
+
base: DEFAULT_URI_SAFE_ATTRIBUTES
|
|
11382
|
+
});
|
|
11383
|
+
DATA_URI_TAGS = _resolveSetOption(cfg, 'ADD_DATA_URI_TAGS', DEFAULT_DATA_URI_TAGS, {
|
|
11384
|
+
transform: transformCaseFunc,
|
|
11385
|
+
base: DEFAULT_DATA_URI_TAGS
|
|
11386
|
+
});
|
|
11387
|
+
FORBID_CONTENTS = _resolveSetOption(cfg, 'FORBID_CONTENTS', DEFAULT_FORBID_CONTENTS, {
|
|
11388
|
+
transform: transformCaseFunc
|
|
11389
|
+
});
|
|
11390
|
+
FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {
|
|
11391
|
+
transform: transformCaseFunc
|
|
11392
|
+
});
|
|
11393
|
+
FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {
|
|
11394
|
+
transform: transformCaseFunc
|
|
11395
|
+
});
|
|
11396
|
+
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
|
|
11191
11397
|
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
|
11192
11398
|
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
|
11193
11399
|
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
|
@@ -11203,20 +11409,22 @@ var purify = {exports: {}};
|
|
|
11203
11409
|
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
|
|
11204
11410
|
KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
|
|
11205
11411
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
11206
|
-
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP
|
|
11207
|
-
NAMESPACE = cfg.NAMESPACE
|
|
11208
|
-
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS
|
|
11209
|
-
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11412
|
+
IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp
|
|
11413
|
+
NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace
|
|
11414
|
+
MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); // Default built-in map
|
|
11415
|
+
HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); // Default built-in map
|
|
11416
|
+
const customElementHandling = objectHasOwnProperty(cfg, 'CUSTOM_ELEMENT_HANDLING') && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === 'object' ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
|
|
11417
|
+
CUSTOM_ELEMENT_HANDLING = create(null);
|
|
11418
|
+
if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) {
|
|
11419
|
+
CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck; // Default undefined
|
|
11420
|
+
}
|
|
11421
|
+
if (objectHasOwnProperty(customElementHandling, 'attributeNameCheck') && isRegexOrFunction(customElementHandling.attributeNameCheck)) {
|
|
11422
|
+
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck; // Default undefined
|
|
11423
|
+
}
|
|
11424
|
+
if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') {
|
|
11425
|
+
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined
|
|
11426
|
+
}
|
|
11427
|
+
seal(CUSTOM_ELEMENT_HANDLING);
|
|
11220
11428
|
if (SAFE_FOR_TEMPLATES) {
|
|
11221
11429
|
ALLOW_DATA_ATTR = false;
|
|
11222
11430
|
}
|
|
@@ -11252,36 +11460,36 @@ var purify = {exports: {}};
|
|
|
11252
11460
|
EXTRA_ELEMENT_HANDLING.tagCheck = null;
|
|
11253
11461
|
EXTRA_ELEMENT_HANDLING.attributeCheck = null;
|
|
11254
11462
|
/* Merge configuration parameters */
|
|
11255
|
-
if (cfg
|
|
11463
|
+
if (objectHasOwnProperty(cfg, 'ADD_TAGS')) {
|
|
11256
11464
|
if (typeof cfg.ADD_TAGS === 'function') {
|
|
11257
11465
|
EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
|
|
11258
|
-
} else {
|
|
11466
|
+
} else if (arrayIsArray(cfg.ADD_TAGS)) {
|
|
11259
11467
|
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
11260
11468
|
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
11261
11469
|
}
|
|
11262
11470
|
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
11263
11471
|
}
|
|
11264
11472
|
}
|
|
11265
|
-
if (cfg
|
|
11473
|
+
if (objectHasOwnProperty(cfg, 'ADD_ATTR')) {
|
|
11266
11474
|
if (typeof cfg.ADD_ATTR === 'function') {
|
|
11267
11475
|
EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
|
|
11268
|
-
} else {
|
|
11476
|
+
} else if (arrayIsArray(cfg.ADD_ATTR)) {
|
|
11269
11477
|
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
11270
11478
|
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
11271
11479
|
}
|
|
11272
11480
|
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
11273
11481
|
}
|
|
11274
11482
|
}
|
|
11275
|
-
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
11483
|
+
if (objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) {
|
|
11276
11484
|
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
11277
11485
|
}
|
|
11278
|
-
if (cfg.FORBID_CONTENTS) {
|
|
11486
|
+
if (objectHasOwnProperty(cfg, 'FORBID_CONTENTS') && arrayIsArray(cfg.FORBID_CONTENTS)) {
|
|
11279
11487
|
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
|
11280
11488
|
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
11281
11489
|
}
|
|
11282
11490
|
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
11283
11491
|
}
|
|
11284
|
-
if (cfg.ADD_FORBID_CONTENTS) {
|
|
11492
|
+
if (objectHasOwnProperty(cfg, 'ADD_FORBID_CONTENTS') && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
|
|
11285
11493
|
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
|
11286
11494
|
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
11287
11495
|
}
|
|
@@ -11300,6 +11508,13 @@ var purify = {exports: {}};
|
|
|
11300
11508
|
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
11301
11509
|
delete FORBID_TAGS.tbody;
|
|
11302
11510
|
}
|
|
11511
|
+
// Re-derive the active Trusted Types policy from this configuration on
|
|
11512
|
+
// every parse. The active policy must never be sticky closure state that
|
|
11513
|
+
// outlives the config that set it: a caller-supplied policy left in place
|
|
11514
|
+
// after `clearConfig()` — or after a later call that supplied none, or
|
|
11515
|
+
// `TRUSTED_TYPES_POLICY: null` — could sign a subsequent "default"
|
|
11516
|
+
// `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.
|
|
11517
|
+
// See GHSA-vxr8-fq34-vvx9.
|
|
11303
11518
|
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
11304
11519
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
|
11305
11520
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
@@ -11307,18 +11522,45 @@ var purify = {exports: {}};
|
|
|
11307
11522
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
11308
11523
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
11309
11524
|
}
|
|
11310
|
-
//
|
|
11525
|
+
// A caller-supplied policy applies to this configuration only.
|
|
11526
|
+
const previousTrustedTypesPolicy = trustedTypesPolicy;
|
|
11311
11527
|
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
11312
|
-
// Sign local variables required by `sanitize`.
|
|
11313
|
-
|
|
11528
|
+
// Sign local variables required by `sanitize`. If the supplied policy's
|
|
11529
|
+
// `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this
|
|
11530
|
+
// throws via the re-entrancy guard. Restore the previous policy first so
|
|
11531
|
+
// the instance is not left in a poisoned state. See #1422.
|
|
11532
|
+
try {
|
|
11533
|
+
emptyHTML = _createTrustedHTML('');
|
|
11534
|
+
} catch (error) {
|
|
11535
|
+
trustedTypesPolicy = previousTrustedTypesPolicy;
|
|
11536
|
+
throw error;
|
|
11537
|
+
}
|
|
11538
|
+
} else if (cfg.TRUSTED_TYPES_POLICY === null) {
|
|
11539
|
+
// Explicit opt-out for this call: perform no Trusted Types signing and
|
|
11540
|
+
// create nothing (so a strict `trusted-types` CSP that disallows a
|
|
11541
|
+
// `dompurify` policy can still call `sanitize` from inside its own
|
|
11542
|
+
// policy — see #1422). Resetting to `undefined` rather than a sticky
|
|
11543
|
+
// `null` also drops any previously retained caller policy, so it cannot
|
|
11544
|
+
// resurface on a later call, while still allowing the next config-less
|
|
11545
|
+
// call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.
|
|
11546
|
+
trustedTypesPolicy = undefined;
|
|
11547
|
+
emptyHTML = '';
|
|
11314
11548
|
} else {
|
|
11315
|
-
//
|
|
11549
|
+
// No policy supplied: keep the currently active policy if one is set — a
|
|
11550
|
+
// previously supplied policy is intentionally sticky across config-less
|
|
11551
|
+
// calls — otherwise fall back to the instance's own internal policy,
|
|
11552
|
+
// created at most once. (A policy supplied for a *single* call still
|
|
11553
|
+
// lingers by design; what must not linger is a policy whose configuration
|
|
11554
|
+
// has been torn down via `clearConfig()`, which restores the default.)
|
|
11316
11555
|
if (trustedTypesPolicy === undefined) {
|
|
11317
|
-
trustedTypesPolicy =
|
|
11556
|
+
trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
|
|
11318
11557
|
}
|
|
11319
|
-
//
|
|
11320
|
-
|
|
11321
|
-
|
|
11558
|
+
// Sign internal variables only when a policy is active. A falsy policy
|
|
11559
|
+
// (Trusted Types unsupported, creation failed, or an explicit opt-out)
|
|
11560
|
+
// leaves `emptyHTML` as a plain string, so we never call `.createHTML` on
|
|
11561
|
+
// a non-policy and throw. See #1422.
|
|
11562
|
+
if (trustedTypesPolicy && typeof emptyHTML === 'string') {
|
|
11563
|
+
emptyHTML = _createTrustedHTML('');
|
|
11322
11564
|
}
|
|
11323
11565
|
}
|
|
11324
11566
|
// Prevent further manipulation of configuration.
|
|
@@ -11333,6 +11575,77 @@ var purify = {exports: {}};
|
|
|
11333
11575
|
* correctly. */
|
|
11334
11576
|
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
11335
11577
|
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
11578
|
+
/**
|
|
11579
|
+
* Namespace rules for an element in the SVG namespace.
|
|
11580
|
+
*
|
|
11581
|
+
* @param tagName the element's lowercase tag name
|
|
11582
|
+
* @param parent the (possibly simulated) parent node
|
|
11583
|
+
* @param parentTagName the parent's lowercase tag name
|
|
11584
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
11585
|
+
*/
|
|
11586
|
+
const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
|
|
11587
|
+
// The only way to switch from HTML namespace to SVG
|
|
11588
|
+
// is via <svg>. If it happens via any other tag, then
|
|
11589
|
+
// it should be killed.
|
|
11590
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
11591
|
+
return tagName === 'svg';
|
|
11592
|
+
}
|
|
11593
|
+
// The only way to switch from MathML to SVG is via <svg>
|
|
11594
|
+
// if the parent is either <annotation-xml> or a MathML
|
|
11595
|
+
// text integration point.
|
|
11596
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
11597
|
+
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
11598
|
+
}
|
|
11599
|
+
// We only allow elements that are defined in SVG
|
|
11600
|
+
// spec. All others are disallowed in SVG namespace.
|
|
11601
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
11602
|
+
};
|
|
11603
|
+
/**
|
|
11604
|
+
* Namespace rules for an element in the MathML namespace.
|
|
11605
|
+
*
|
|
11606
|
+
* @param tagName the element's lowercase tag name
|
|
11607
|
+
* @param parent the (possibly simulated) parent node
|
|
11608
|
+
* @param parentTagName the parent's lowercase tag name
|
|
11609
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
11610
|
+
*/
|
|
11611
|
+
const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
|
|
11612
|
+
// The only way to switch from HTML namespace to MathML
|
|
11613
|
+
// is via <math>. If it happens via any other tag, then
|
|
11614
|
+
// it should be killed.
|
|
11615
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
11616
|
+
return tagName === 'math';
|
|
11617
|
+
}
|
|
11618
|
+
// The only way to switch from SVG to MathML is via
|
|
11619
|
+
// <math> and HTML integration points
|
|
11620
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
11621
|
+
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
11622
|
+
}
|
|
11623
|
+
// We only allow elements that are defined in MathML
|
|
11624
|
+
// spec. All others are disallowed in MathML namespace.
|
|
11625
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
11626
|
+
};
|
|
11627
|
+
/**
|
|
11628
|
+
* Namespace rules for an element in the HTML namespace.
|
|
11629
|
+
*
|
|
11630
|
+
* @param tagName the element's lowercase tag name
|
|
11631
|
+
* @param parent the (possibly simulated) parent node
|
|
11632
|
+
* @param parentTagName the parent's lowercase tag name
|
|
11633
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
11634
|
+
*/
|
|
11635
|
+
const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
|
|
11636
|
+
// The only way to switch from SVG to HTML is via
|
|
11637
|
+
// HTML integration points, and from MathML to HTML
|
|
11638
|
+
// is via MathML text integration points
|
|
11639
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
11640
|
+
return false;
|
|
11641
|
+
}
|
|
11642
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
11643
|
+
return false;
|
|
11644
|
+
}
|
|
11645
|
+
// We disallow tags that are specific for MathML
|
|
11646
|
+
// or SVG and should never appear in HTML namespace
|
|
11647
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
11648
|
+
};
|
|
11336
11649
|
/**
|
|
11337
11650
|
* @param element a DOM element whose namespace is being checked
|
|
11338
11651
|
* @returns Return false if the element has a
|
|
@@ -11355,51 +11668,13 @@ var purify = {exports: {}};
|
|
|
11355
11668
|
return false;
|
|
11356
11669
|
}
|
|
11357
11670
|
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
11358
|
-
|
|
11359
|
-
// is via <svg>. If it happens via any other tag, then
|
|
11360
|
-
// it should be killed.
|
|
11361
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
11362
|
-
return tagName === 'svg';
|
|
11363
|
-
}
|
|
11364
|
-
// The only way to switch from MathML to SVG is via`
|
|
11365
|
-
// svg if parent is either <annotation-xml> or MathML
|
|
11366
|
-
// text integration points.
|
|
11367
|
-
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
11368
|
-
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
11369
|
-
}
|
|
11370
|
-
// We only allow elements that are defined in SVG
|
|
11371
|
-
// spec. All others are disallowed in SVG namespace.
|
|
11372
|
-
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
11671
|
+
return _checkSvgNamespace(tagName, parent, parentTagName);
|
|
11373
11672
|
}
|
|
11374
11673
|
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
11375
|
-
|
|
11376
|
-
// is via <math>. If it happens via any other tag, then
|
|
11377
|
-
// it should be killed.
|
|
11378
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
11379
|
-
return tagName === 'math';
|
|
11380
|
-
}
|
|
11381
|
-
// The only way to switch from SVG to MathML is via
|
|
11382
|
-
// <math> and HTML integration points
|
|
11383
|
-
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
11384
|
-
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
11385
|
-
}
|
|
11386
|
-
// We only allow elements that are defined in MathML
|
|
11387
|
-
// spec. All others are disallowed in MathML namespace.
|
|
11388
|
-
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
11674
|
+
return _checkMathMlNamespace(tagName, parent, parentTagName);
|
|
11389
11675
|
}
|
|
11390
11676
|
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
11391
|
-
|
|
11392
|
-
// HTML integration points, and from MathML to HTML
|
|
11393
|
-
// is via MathML text integration points
|
|
11394
|
-
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
11395
|
-
return false;
|
|
11396
|
-
}
|
|
11397
|
-
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
11398
|
-
return false;
|
|
11399
|
-
}
|
|
11400
|
-
// We disallow tags that are specific for MathML
|
|
11401
|
-
// or SVG and should never appear in HTML namespace
|
|
11402
|
-
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
11677
|
+
return _checkHtmlNamespace(tagName, parent, parentTagName);
|
|
11403
11678
|
}
|
|
11404
11679
|
// For XHTML and XML documents that support custom namespaces
|
|
11405
11680
|
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
@@ -11424,7 +11699,74 @@ var purify = {exports: {}};
|
|
|
11424
11699
|
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
11425
11700
|
getParentNode(node).removeChild(node);
|
|
11426
11701
|
} catch (_) {
|
|
11702
|
+
/* The normal detach failed — this is reached for a parentless node
|
|
11703
|
+
(getParentNode() is null, so .removeChild throws). Element.prototype
|
|
11704
|
+
.remove() is itself a spec no-op on a parentless node, so a recorded
|
|
11705
|
+
"removal" would otherwise hand the caller back an intact,
|
|
11706
|
+
payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or
|
|
11707
|
+
the style-with-element-child rule decided to kill). Fail closed by
|
|
11708
|
+
throwing — exactly as a clobbered root does at the IN_PLACE entry —
|
|
11709
|
+
rather than trying to "neutralize" the node via its own methods.
|
|
11710
|
+
Neutralizing would mean calling getAttributeNames()/removeAttribute()
|
|
11711
|
+
on the node, both of which a <form> root can clobber via a named child
|
|
11712
|
+
(and _isClobbered does not even probe getAttributeNames), so the
|
|
11713
|
+
neutralize step could itself be silently defeated, leaving the payload
|
|
11714
|
+
intact. A throw touches only the cached, clobber-safe remove() and
|
|
11715
|
+
getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)
|
|
11716
|
+
to every root-kill reason. REPORT-3.
|
|
11717
|
+
This lives inside the catch, so it never fires for a normally-removed
|
|
11718
|
+
in-tree node: those have a parent, removeChild() succeeds, and the
|
|
11719
|
+
catch is not entered. Only a kept (parentless) root reaches here. */
|
|
11427
11720
|
remove(node);
|
|
11721
|
+
if (!getParentNode(node)) {
|
|
11722
|
+
throw typeErrorCreate('a node selected for removal could not be detached from its tree ' + 'and cannot be safely returned; refusing to sanitize in place');
|
|
11723
|
+
}
|
|
11724
|
+
}
|
|
11725
|
+
};
|
|
11726
|
+
/**
|
|
11727
|
+
* _neutralizeRoot
|
|
11728
|
+
*
|
|
11729
|
+
* Fail-closed teardown of an in-place root after the sanitize walk aborts
|
|
11730
|
+
* (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
|
|
11731
|
+
* custom element's reaction detaches a node so `_forceRemove`'s deliberate
|
|
11732
|
+
* parentless guard throws, or any other re-entrant engine mutation — would
|
|
11733
|
+
* otherwise leave the caller's *live* tree half-sanitized, with everything
|
|
11734
|
+
* after the abort point still carrying its handlers. There is no safe way
|
|
11735
|
+
* to resume the walk (the tree mutated under us), so we strip the root bare:
|
|
11736
|
+
* remove every child and every attribute, then let the caller's catch see
|
|
11737
|
+
* the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
|
|
11738
|
+
* getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
|
|
11739
|
+
*
|
|
11740
|
+
* @param root the in-place root to empty
|
|
11741
|
+
*/
|
|
11742
|
+
const _neutralizeRoot = function _neutralizeRoot(root) {
|
|
11743
|
+
const childNodes = getChildNodes(root);
|
|
11744
|
+
if (childNodes) {
|
|
11745
|
+
const snapshot = [];
|
|
11746
|
+
arrayForEach(childNodes, child => {
|
|
11747
|
+
arrayPush(snapshot, child);
|
|
11748
|
+
});
|
|
11749
|
+
arrayForEach(snapshot, child => {
|
|
11750
|
+
try {
|
|
11751
|
+
remove(child);
|
|
11752
|
+
} catch (_) {
|
|
11753
|
+
/* Best-effort teardown; a still-attached child is handled below */
|
|
11754
|
+
}
|
|
11755
|
+
});
|
|
11756
|
+
}
|
|
11757
|
+
const attributes = getAttributes(root);
|
|
11758
|
+
if (attributes) {
|
|
11759
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
11760
|
+
const attribute = attributes[i];
|
|
11761
|
+
const name = attribute && attribute.name;
|
|
11762
|
+
if (typeof name === 'string') {
|
|
11763
|
+
try {
|
|
11764
|
+
root.removeAttribute(name);
|
|
11765
|
+
} catch (_) {
|
|
11766
|
+
/* Clobbered removeAttribute — ignore (fail-closed best effort) */
|
|
11767
|
+
}
|
|
11768
|
+
}
|
|
11769
|
+
}
|
|
11428
11770
|
}
|
|
11429
11771
|
};
|
|
11430
11772
|
/**
|
|
@@ -11459,6 +11801,72 @@ var purify = {exports: {}};
|
|
|
11459
11801
|
}
|
|
11460
11802
|
}
|
|
11461
11803
|
};
|
|
11804
|
+
/**
|
|
11805
|
+
* _stripDisallowedAttributes
|
|
11806
|
+
*
|
|
11807
|
+
* Removes every attribute the active configuration does not allow from a
|
|
11808
|
+
* single element, using the same allowlist as the main attribute pass (so
|
|
11809
|
+
* `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
|
|
11810
|
+
* neutralise nodes that are being discarded from an in-place tree.
|
|
11811
|
+
*
|
|
11812
|
+
* @param element the element to strip
|
|
11813
|
+
*/
|
|
11814
|
+
const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
|
|
11815
|
+
const attributes = getAttributes(element);
|
|
11816
|
+
if (!attributes) {
|
|
11817
|
+
return;
|
|
11818
|
+
}
|
|
11819
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
11820
|
+
const attribute = attributes[i];
|
|
11821
|
+
const name = attribute && attribute.name;
|
|
11822
|
+
if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {
|
|
11823
|
+
continue;
|
|
11824
|
+
}
|
|
11825
|
+
try {
|
|
11826
|
+
element.removeAttribute(name);
|
|
11827
|
+
} catch (_) {
|
|
11828
|
+
/* Clobbered removeAttribute on a doomed node — ignore */
|
|
11829
|
+
}
|
|
11830
|
+
}
|
|
11831
|
+
};
|
|
11832
|
+
/**
|
|
11833
|
+
* _neutralizeSubtree
|
|
11834
|
+
*
|
|
11835
|
+
* Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT
|
|
11836
|
+
* move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,
|
|
11837
|
+
* namespace, comment, processing-instruction and KEEP_CONTENT:false removals
|
|
11838
|
+
* all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
|
|
11839
|
+
* those dropped nodes are detached from the caller's LIVE tree but a
|
|
11840
|
+
* handler-bearing original among them (an `<img onerror>`/`<video>` that was
|
|
11841
|
+
* loading) keeps its queued resource event, which fires in page scope after
|
|
11842
|
+
* sanitize returns. This walks a removed subtree and strips every attribute
|
|
11843
|
+
* the active configuration does not allow — so `on*` handlers are cancelled
|
|
11844
|
+
* through the SAME allowlist that governs kept nodes, not a separate `/^on/`
|
|
11845
|
+
* blocklist. Run synchronously before sanitize returns, i.e. before any
|
|
11846
|
+
* queued event can fire. Hook-free by design: these nodes leave the output,
|
|
11847
|
+
* so firing attribute hooks for them would be surprising. Clobber-safe reads;
|
|
11848
|
+
* a doomed clobbered node may shadow `removeAttribute` (its own attributes are
|
|
11849
|
+
* irrelevant — it is discarded — while its non-clobbered descendants, e.g.
|
|
11850
|
+
* the `<img>`, are reached and scrubbed).
|
|
11851
|
+
*
|
|
11852
|
+
* @param root the root of a removed subtree to neutralise
|
|
11853
|
+
*/
|
|
11854
|
+
const _neutralizeSubtree = function _neutralizeSubtree(root) {
|
|
11855
|
+
const stack = [root];
|
|
11856
|
+
while (stack.length > 0) {
|
|
11857
|
+
const node = stack.pop();
|
|
11858
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
11859
|
+
if (nodeType === NODE_TYPE.element) {
|
|
11860
|
+
_stripDisallowedAttributes(node);
|
|
11861
|
+
}
|
|
11862
|
+
const childNodes = getChildNodes(node);
|
|
11863
|
+
if (childNodes) {
|
|
11864
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
11865
|
+
stack.push(childNodes[i]);
|
|
11866
|
+
}
|
|
11867
|
+
}
|
|
11868
|
+
}
|
|
11869
|
+
};
|
|
11462
11870
|
/**
|
|
11463
11871
|
* _initDocument
|
|
11464
11872
|
*
|
|
@@ -11480,7 +11888,7 @@ var purify = {exports: {}};
|
|
|
11480
11888
|
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
|
11481
11889
|
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
|
11482
11890
|
}
|
|
11483
|
-
const dirtyPayload = trustedTypesPolicy ?
|
|
11891
|
+
const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
|
|
11484
11892
|
/*
|
|
11485
11893
|
* Use the DOMParser API by default, fallback later if needs be
|
|
11486
11894
|
* DOMParser not work for svg when has multiple root element.
|
|
@@ -11520,29 +11928,254 @@ var purify = {exports: {}};
|
|
|
11520
11928
|
// eslint-disable-next-line no-bitwise
|
|
11521
11929
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
11522
11930
|
};
|
|
11931
|
+
/**
|
|
11932
|
+
* Replace template expression syntax (mustache, ERB, template
|
|
11933
|
+
* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
|
|
11934
|
+
* sites. Order matters: mustache, then ERB, then template literal.
|
|
11935
|
+
*
|
|
11936
|
+
* @param value the string to scrub
|
|
11937
|
+
* @returns the scrubbed string
|
|
11938
|
+
*/
|
|
11939
|
+
const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
|
|
11940
|
+
value = stringReplace(value, MUSTACHE_EXPR$1, ' ');
|
|
11941
|
+
value = stringReplace(value, ERB_EXPR$1, ' ');
|
|
11942
|
+
value = stringReplace(value, TMPLIT_EXPR$1, ' ');
|
|
11943
|
+
return value;
|
|
11944
|
+
};
|
|
11945
|
+
/**
|
|
11946
|
+
* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
|
|
11947
|
+
* character data of an element subtree. Used as the final safety net for
|
|
11948
|
+
* SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions
|
|
11949
|
+
* which only form after text-node normalization (e.g. fragments split across
|
|
11950
|
+
* stripped elements) cannot survive into a template-evaluating framework.
|
|
11951
|
+
*
|
|
11952
|
+
* Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`
|
|
11953
|
+
* in place rather than round-tripping through innerHTML. This preserves
|
|
11954
|
+
* descendant node references (important for IN_PLACE callers), avoids a
|
|
11955
|
+
* serialize/reparse cycle, and reads literal character data — which means
|
|
11956
|
+
* `<%...%>` in text content matches the ERB regex against its real bytes
|
|
11957
|
+
* instead of the HTML-entity-escaped form innerHTML would produce.
|
|
11958
|
+
*
|
|
11959
|
+
* Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for
|
|
11960
|
+
* attributes is performed during the per-node `_sanitizeAttributes` pass.
|
|
11961
|
+
*
|
|
11962
|
+
* @param node The root element whose character data should be scrubbed.
|
|
11963
|
+
*/
|
|
11964
|
+
const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
|
|
11965
|
+
var _node$querySelectorAl;
|
|
11966
|
+
node.normalize();
|
|
11967
|
+
const walker = createNodeIterator.call(node.ownerDocument || node, node,
|
|
11968
|
+
// eslint-disable-next-line no-bitwise
|
|
11969
|
+
NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
|
|
11970
|
+
let currentNode = walker.nextNode();
|
|
11971
|
+
while (currentNode) {
|
|
11972
|
+
currentNode.data = _stripTemplateExpressions(currentNode.data);
|
|
11973
|
+
currentNode = walker.nextNode();
|
|
11974
|
+
}
|
|
11975
|
+
// NodeIterator does not descend into <template>.content per the DOM spec,
|
|
11976
|
+
// so we must explicitly recurse into each template's content fragment,
|
|
11977
|
+
// mirroring the approach used by _sanitizeShadowDOM.
|
|
11978
|
+
const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, 'template');
|
|
11979
|
+
if (templates) {
|
|
11980
|
+
arrayForEach(templates, tmpl => {
|
|
11981
|
+
if (_isDocumentFragment(tmpl.content)) {
|
|
11982
|
+
_scrubTemplateExpressions2(tmpl.content);
|
|
11983
|
+
}
|
|
11984
|
+
});
|
|
11985
|
+
}
|
|
11986
|
+
};
|
|
11523
11987
|
/**
|
|
11524
11988
|
* _isClobbered
|
|
11525
11989
|
*
|
|
11990
|
+
* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
|
|
11991
|
+
* interface with [LegacyOverrideBuiltIns]; a descendant element with a
|
|
11992
|
+
* `name` attribute matching a prototype property shadows that property
|
|
11993
|
+
* on direct reads. We use this check at the IN_PLACE entry-point and
|
|
11994
|
+
* during attribute sanitization to refuse clobbered forms.
|
|
11995
|
+
*
|
|
11526
11996
|
* @param element element to check for clobbering attacks
|
|
11527
11997
|
* @return true if clobbered, false if safe
|
|
11528
11998
|
*/
|
|
11529
11999
|
const _isClobbered = function _isClobbered(element) {
|
|
11530
|
-
|
|
12000
|
+
// Realm-independent tag-name probe. If we can't determine the tag
|
|
12001
|
+
// name at all, we can't reason about clobbering — return false
|
|
12002
|
+
// (the caller's other defences still apply).
|
|
12003
|
+
const realTagName = getNodeName ? getNodeName(element) : null;
|
|
12004
|
+
if (typeof realTagName !== 'string') {
|
|
12005
|
+
return false;
|
|
12006
|
+
}
|
|
12007
|
+
if (transformCaseFunc(realTagName) !== 'form') {
|
|
12008
|
+
return false;
|
|
12009
|
+
}
|
|
12010
|
+
return typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' ||
|
|
12011
|
+
// Realm-safe NamedNodeMap detection: equality against the cached
|
|
12012
|
+
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
12013
|
+
// makes the direct read diverge from the cached read; a clean form
|
|
12014
|
+
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
12015
|
+
// canonical NamedNodeMap.
|
|
12016
|
+
element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||
|
|
12017
|
+
// NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
12018
|
+
// returns the integer 1 for any Element regardless of realm; direct
|
|
12019
|
+
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
12020
|
+
// the named child element. Cheap addition — nodeType is read from
|
|
12021
|
+
// an internal slot, no serialization cost — and removes a residual
|
|
12022
|
+
// clobbering surface used by several mXSS / PI / comment branches
|
|
12023
|
+
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
12024
|
+
element.nodeType !== getNodeType(element) ||
|
|
12025
|
+
// HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
12026
|
+
// "childNodes" shadows the prototype getter. Direct reads of
|
|
12027
|
+
// form.childNodes from a clobbered form return the named child
|
|
12028
|
+
// instead of the real NodeList, so any walk that reads it directly
|
|
12029
|
+
// skips the form's real children. Compare the direct read to the
|
|
12030
|
+
// cached Node.prototype getter — when the form's named-property
|
|
12031
|
+
// getter intercepts the read, the two values differ and we flag
|
|
12032
|
+
// the form. This catches every clobbering child type (input,
|
|
12033
|
+
// select, etc.) regardless of whether the named child happens to
|
|
12034
|
+
// carry a numeric .length, which a typeof-based probe would miss
|
|
12035
|
+
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
12036
|
+
element.childNodes !== getChildNodes(element);
|
|
11531
12037
|
};
|
|
11532
12038
|
/**
|
|
11533
|
-
* Checks whether the given
|
|
12039
|
+
* Checks whether the given value is a DocumentFragment from any realm.
|
|
12040
|
+
*
|
|
12041
|
+
* The realm-independent replacement reads `nodeType` through the cached
|
|
12042
|
+
* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
|
|
12043
|
+
* constant (11). nodeType is a numeric value resolved from the node's
|
|
12044
|
+
* internal slot, identical across realms for the same kind of node.
|
|
12045
|
+
*
|
|
12046
|
+
* @param value object to check
|
|
12047
|
+
* @return true if value is a DocumentFragment-shaped node from any realm
|
|
12048
|
+
*/
|
|
12049
|
+
const _isDocumentFragment = function _isDocumentFragment(value) {
|
|
12050
|
+
if (!getNodeType || typeof value !== 'object' || value === null) {
|
|
12051
|
+
return false;
|
|
12052
|
+
}
|
|
12053
|
+
try {
|
|
12054
|
+
return getNodeType(value) === NODE_TYPE.documentFragment;
|
|
12055
|
+
} catch (_) {
|
|
12056
|
+
return false;
|
|
12057
|
+
}
|
|
12058
|
+
};
|
|
12059
|
+
/**
|
|
12060
|
+
* Checks whether the given object is a DOM node, including nodes that
|
|
12061
|
+
* originate from a different window/realm (e.g. an iframe's
|
|
12062
|
+
* contentDocument). The previous `value instanceof Node` check was
|
|
12063
|
+
* realm-bound: nodes from a different window failed it, causing
|
|
12064
|
+
* sanitize() to silently stringify them and reset IN_PLACE to false,
|
|
12065
|
+
* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
|
|
11534
12066
|
*
|
|
11535
12067
|
* @param value object to check whether it's a DOM node
|
|
11536
|
-
* @return true
|
|
12068
|
+
* @return true if value is a DOM node from any realm
|
|
11537
12069
|
*/
|
|
11538
12070
|
const _isNode = function _isNode(value) {
|
|
11539
|
-
|
|
12071
|
+
if (!getNodeType || typeof value !== 'object' || value === null) {
|
|
12072
|
+
return false;
|
|
12073
|
+
}
|
|
12074
|
+
try {
|
|
12075
|
+
return typeof getNodeType(value) === 'number';
|
|
12076
|
+
} catch (_) {
|
|
12077
|
+
return false;
|
|
12078
|
+
}
|
|
11540
12079
|
};
|
|
11541
12080
|
function _executeHooks(hooks, currentNode, data) {
|
|
12081
|
+
if (hooks.length === 0) {
|
|
12082
|
+
return;
|
|
12083
|
+
}
|
|
11542
12084
|
arrayForEach(hooks, hook => {
|
|
11543
12085
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
11544
12086
|
});
|
|
11545
12087
|
}
|
|
12088
|
+
/**
|
|
12089
|
+
* Structural-threat checks that condemn a node regardless of the
|
|
12090
|
+
* allowlists: mXSS via namespace confusion, risky CSS construction,
|
|
12091
|
+
* processing instructions, markup-bearing comments. Pure predicate;
|
|
12092
|
+
* the caller removes. Check order is load-bearing.
|
|
12093
|
+
*
|
|
12094
|
+
* @param currentNode the node to inspect
|
|
12095
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
12096
|
+
* @return true if the node must be removed
|
|
12097
|
+
*/
|
|
12098
|
+
const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
|
|
12099
|
+
/* Detect mXSS attempts abusing namespace confusion */
|
|
12100
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
|
|
12101
|
+
return true;
|
|
12102
|
+
}
|
|
12103
|
+
/* Remove risky CSS construction leading to mXSS */
|
|
12104
|
+
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {
|
|
12105
|
+
return true;
|
|
12106
|
+
}
|
|
12107
|
+
/* Remove any occurrence of processing instructions */
|
|
12108
|
+
if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
|
|
12109
|
+
return true;
|
|
12110
|
+
}
|
|
12111
|
+
/* Remove any kind of possibly harmful comments */
|
|
12112
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
|
|
12113
|
+
return true;
|
|
12114
|
+
}
|
|
12115
|
+
return false;
|
|
12116
|
+
};
|
|
12117
|
+
/**
|
|
12118
|
+
* Handle a node whose tag is forbidden or not allowlisted: keep
|
|
12119
|
+
* allowed custom elements (false return exits _sanitizeElements
|
|
12120
|
+
* early - namespace/fallback checks and the afterSanitizeElements
|
|
12121
|
+
* hook are intentionally skipped for kept custom elements), else
|
|
12122
|
+
* hoist content per KEEP_CONTENT and remove.
|
|
12123
|
+
*
|
|
12124
|
+
* @param currentNode the disallowed node
|
|
12125
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
12126
|
+
* @return true if the node was removed, false if kept
|
|
12127
|
+
*/
|
|
12128
|
+
const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName) {
|
|
12129
|
+
/* Check if we have a custom element to handle */
|
|
12130
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
12131
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
12132
|
+
return false;
|
|
12133
|
+
}
|
|
12134
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
|
12135
|
+
return false;
|
|
12136
|
+
}
|
|
12137
|
+
}
|
|
12138
|
+
/* Keep content except for bad-listed elements.
|
|
12139
|
+
Use the cached prototype getters exclusively — the previous code
|
|
12140
|
+
had `|| currentNode.parentNode` / `|| currentNode.childNodes`
|
|
12141
|
+
fallbacks, but the cached getters always return the canonical
|
|
12142
|
+
value (or null for a real parent-less node), so the fallback
|
|
12143
|
+
path was dead in safe cases and a clobbering surface in unsafe
|
|
12144
|
+
ones. Falsy cached results stay falsy; the `if (childNodes &&
|
|
12145
|
+
parentNode)` check already gates correctly. */
|
|
12146
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
12147
|
+
const parentNode = getParentNode(currentNode);
|
|
12148
|
+
const childNodes = getChildNodes(currentNode);
|
|
12149
|
+
if (childNodes && parentNode) {
|
|
12150
|
+
const childCount = childNodes.length;
|
|
12151
|
+
/* In-place: hoist the *original* children so the iterator visits
|
|
12152
|
+
and sanitises them through the same allowlist pass as every other
|
|
12153
|
+
node. The caller built the tree in the live document, so the
|
|
12154
|
+
originals carry already-queued resource events (`<img onerror>`,
|
|
12155
|
+
`<video>`/`<audio>` error, lazy/`onload`, …); cloning would leave
|
|
12156
|
+
those originals detached but still armed, firing in page scope
|
|
12157
|
+
while the returned tree looked clean. Moving is safe in-place: the
|
|
12158
|
+
root is pre-validated as an allowed tag and so is never the node
|
|
12159
|
+
being removed, which keeps `parentNode` inside the iterator root
|
|
12160
|
+
and the relocated child inside the serialised tree.
|
|
12161
|
+
Otherwise (string / DOM-copy paths): clone. The iterator is rooted
|
|
12162
|
+
at — and the result serialised from — `body`, so a restrictive
|
|
12163
|
+
ALLOWED_TAGS that removes `body` itself must leave its content in
|
|
12164
|
+
place, which only cloning does; and those paths parse into an
|
|
12165
|
+
inert document, so their discarded originals never had a queued
|
|
12166
|
+
event to neutralise.
|
|
12167
|
+
`childNodes` is live; a tail-to-head walk keeps `childNodes[i]`
|
|
12168
|
+
valid whether we move (drops the trailing entry) or clone (leaves
|
|
12169
|
+
the list intact). */
|
|
12170
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
12171
|
+
const hoisted = IN_PLACE ? childNodes[i] : cloneNode(childNodes[i], true);
|
|
12172
|
+
parentNode.insertBefore(hoisted, getNextSibling(currentNode));
|
|
12173
|
+
}
|
|
12174
|
+
}
|
|
12175
|
+
}
|
|
12176
|
+
_forceRemove(currentNode);
|
|
12177
|
+
return true;
|
|
12178
|
+
};
|
|
11546
12179
|
/**
|
|
11547
12180
|
* _sanitizeElements
|
|
11548
12181
|
*
|
|
@@ -11553,7 +12186,6 @@ var purify = {exports: {}};
|
|
|
11553
12186
|
* @return true if node was killed, false if left alive
|
|
11554
12187
|
*/
|
|
11555
12188
|
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
11556
|
-
let content = null;
|
|
11557
12189
|
/* Execute a hook if present */
|
|
11558
12190
|
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
11559
12191
|
/* Check if element is clobbered or can clobber */
|
|
@@ -11562,76 +12194,41 @@ var purify = {exports: {}};
|
|
|
11562
12194
|
return true;
|
|
11563
12195
|
}
|
|
11564
12196
|
/* Now let's check the element's type and name */
|
|
11565
|
-
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
12197
|
+
const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);
|
|
11566
12198
|
/* Execute a hook if present */
|
|
11567
12199
|
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
11568
12200
|
tagName,
|
|
11569
12201
|
allowedTags: ALLOWED_TAGS
|
|
11570
12202
|
});
|
|
11571
|
-
/*
|
|
11572
|
-
if (
|
|
11573
|
-
_forceRemove(currentNode);
|
|
11574
|
-
return true;
|
|
11575
|
-
}
|
|
11576
|
-
/* Remove risky CSS construction leading to mXSS */
|
|
11577
|
-
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {
|
|
11578
|
-
_forceRemove(currentNode);
|
|
11579
|
-
return true;
|
|
11580
|
-
}
|
|
11581
|
-
/* Remove any occurrence of processing instructions */
|
|
11582
|
-
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
11583
|
-
_forceRemove(currentNode);
|
|
11584
|
-
return true;
|
|
11585
|
-
}
|
|
11586
|
-
/* Remove any kind of possibly harmful comments */
|
|
11587
|
-
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
12203
|
+
/* Remove mXSS vectors, processing instructions and risky comments */
|
|
12204
|
+
if (_isUnsafeNode(currentNode, tagName)) {
|
|
11588
12205
|
_forceRemove(currentNode);
|
|
11589
12206
|
return true;
|
|
11590
12207
|
}
|
|
11591
12208
|
/* Remove element if anything forbids its presence */
|
|
11592
12209
|
if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
|
|
11593
|
-
|
|
11594
|
-
|
|
11595
|
-
|
|
11596
|
-
|
|
11597
|
-
|
|
11598
|
-
|
|
11599
|
-
|
|
11600
|
-
|
|
11601
|
-
|
|
11602
|
-
|
|
11603
|
-
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
11604
|
-
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
11605
|
-
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
11606
|
-
if (childNodes && parentNode) {
|
|
11607
|
-
const childCount = childNodes.length;
|
|
11608
|
-
for (let i = childCount - 1; i >= 0; --i) {
|
|
11609
|
-
const childClone = cloneNode(childNodes[i], true);
|
|
11610
|
-
childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
|
|
11611
|
-
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
|
11612
|
-
}
|
|
11613
|
-
}
|
|
11614
|
-
}
|
|
11615
|
-
_forceRemove(currentNode);
|
|
11616
|
-
return true;
|
|
11617
|
-
}
|
|
11618
|
-
/* Check whether element has a valid namespace */
|
|
11619
|
-
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
12210
|
+
return _sanitizeDisallowedNode(currentNode, tagName);
|
|
12211
|
+
}
|
|
12212
|
+
/* Check whether element has a valid namespace.
|
|
12213
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype
|
|
12214
|
+
nodeType getter rather than `instanceof Element`, which is realm-
|
|
12215
|
+
bound and short-circuits to false for any node minted in a different
|
|
12216
|
+
realm — letting a foreign-realm element with a forbidden namespace
|
|
12217
|
+
slip past the namespace check entirely. */
|
|
12218
|
+
const nt = getNodeType ? getNodeType(currentNode) : currentNode.nodeType;
|
|
12219
|
+
if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
|
|
11620
12220
|
_forceRemove(currentNode);
|
|
11621
12221
|
return true;
|
|
11622
12222
|
}
|
|
11623
12223
|
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
11624
|
-
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(
|
|
12224
|
+
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
|
|
11625
12225
|
_forceRemove(currentNode);
|
|
11626
12226
|
return true;
|
|
11627
12227
|
}
|
|
11628
12228
|
/* Sanitize element content to be template-safe */
|
|
11629
12229
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
11630
12230
|
/* Get the element's text content */
|
|
11631
|
-
content = currentNode.textContent;
|
|
11632
|
-
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
11633
|
-
content = stringReplace(content, expr, ' ');
|
|
11634
|
-
});
|
|
12231
|
+
const content = _stripTemplateExpressions(currentNode.textContent);
|
|
11635
12232
|
if (currentNode.textContent !== content) {
|
|
11636
12233
|
arrayPush(DOMPurify.removed, {
|
|
11637
12234
|
element: currentNode.cloneNode()
|
|
@@ -11661,11 +12258,12 @@ var purify = {exports: {}};
|
|
|
11661
12258
|
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
11662
12259
|
return false;
|
|
11663
12260
|
}
|
|
12261
|
+
const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
|
|
11664
12262
|
/* Allow valid data-* attributes: At least one character after "-"
|
|
11665
12263
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
11666
12264
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
11667
12265
|
We don't need to check the value; it's always URI safe. */
|
|
11668
|
-
if (ALLOW_DATA_ATTR &&
|
|
12266
|
+
if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; else if (!nameIsPermitted) {
|
|
11669
12267
|
if (
|
|
11670
12268
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
11671
12269
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
@@ -11677,11 +12275,15 @@ var purify = {exports: {}};
|
|
|
11677
12275
|
return false;
|
|
11678
12276
|
}
|
|
11679
12277
|
/* Check value is safe. First, is attr inert? If so, is safe */
|
|
11680
|
-
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
|
|
12278
|
+
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if (value) {
|
|
11681
12279
|
return false;
|
|
11682
12280
|
} else ;
|
|
11683
12281
|
return true;
|
|
11684
12282
|
};
|
|
12283
|
+
/* Names the HTML spec reserves from valid-custom-element-name; these must
|
|
12284
|
+
* never be treated as basic custom elements even when a permissive
|
|
12285
|
+
* CUSTOM_ELEMENT_HANDLING.tagNameCheck is configured. */
|
|
12286
|
+
const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ['annotation-xml', 'color-profile', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'missing-glyph']);
|
|
11685
12287
|
/**
|
|
11686
12288
|
* _isBasicCustomElement
|
|
11687
12289
|
* checks if at least one dash is included in tagName, and it's not the first char
|
|
@@ -11691,7 +12293,64 @@ var purify = {exports: {}};
|
|
|
11691
12293
|
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
11692
12294
|
*/
|
|
11693
12295
|
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
11694
|
-
return tagName
|
|
12296
|
+
return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
|
|
12297
|
+
};
|
|
12298
|
+
/**
|
|
12299
|
+
* Wrap an attribute value in the matching Trusted Types object when
|
|
12300
|
+
* the active policy requires it. Namespaced attributes pass through
|
|
12301
|
+
* unchanged (no TT support yet, see
|
|
12302
|
+
* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
|
|
12303
|
+
*
|
|
12304
|
+
* @param lcTag lowercase tag name of the containing element
|
|
12305
|
+
* @param lcName lowercase attribute name
|
|
12306
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
12307
|
+
* @param value the attribute value to wrap
|
|
12308
|
+
* @return the value, wrapped when Trusted Types demand it
|
|
12309
|
+
*/
|
|
12310
|
+
const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
|
|
12311
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function' && !namespaceURI) {
|
|
12312
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
12313
|
+
case 'TrustedHTML':
|
|
12314
|
+
{
|
|
12315
|
+
return _createTrustedHTML(value);
|
|
12316
|
+
}
|
|
12317
|
+
case 'TrustedScriptURL':
|
|
12318
|
+
{
|
|
12319
|
+
return _createTrustedScriptURL(value);
|
|
12320
|
+
}
|
|
12321
|
+
}
|
|
12322
|
+
}
|
|
12323
|
+
return value;
|
|
12324
|
+
};
|
|
12325
|
+
/**
|
|
12326
|
+
* Write a modified attribute value back onto the element. On
|
|
12327
|
+
* success, re-probe for clobbering introduced by the new value and
|
|
12328
|
+
* remove the element when found; otherwise pop the removal entry
|
|
12329
|
+
* recorded by the earlier _removeAttribute (long-standing pairing
|
|
12330
|
+
* with the SANITIZE_NAMED_PROPS path - do not "fix" casually). On
|
|
12331
|
+
* failure, remove the attribute instead.
|
|
12332
|
+
*
|
|
12333
|
+
* @param currentNode the element carrying the attribute
|
|
12334
|
+
* @param name the attribute name as present on the element
|
|
12335
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
12336
|
+
* @param value the new attribute value
|
|
12337
|
+
*/
|
|
12338
|
+
const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
|
|
12339
|
+
try {
|
|
12340
|
+
if (namespaceURI) {
|
|
12341
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
12342
|
+
} else {
|
|
12343
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
12344
|
+
currentNode.setAttribute(name, value);
|
|
12345
|
+
}
|
|
12346
|
+
if (_isClobbered(currentNode)) {
|
|
12347
|
+
_forceRemove(currentNode);
|
|
12348
|
+
} else {
|
|
12349
|
+
arrayPop(DOMPurify.removed);
|
|
12350
|
+
}
|
|
12351
|
+
} catch (_) {
|
|
12352
|
+
_removeAttribute(name, currentNode);
|
|
12353
|
+
}
|
|
11695
12354
|
};
|
|
11696
12355
|
/**
|
|
11697
12356
|
* _sanitizeAttributes
|
|
@@ -11706,9 +12365,7 @@ var purify = {exports: {}};
|
|
|
11706
12365
|
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
11707
12366
|
/* Execute a hook if present */
|
|
11708
12367
|
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
11709
|
-
const
|
|
11710
|
-
attributes
|
|
11711
|
-
} = currentNode;
|
|
12368
|
+
const attributes = currentNode.attributes;
|
|
11712
12369
|
/* Check if we have attributes; if not we might have a text node */
|
|
11713
12370
|
if (!attributes || _isClobbered(currentNode)) {
|
|
11714
12371
|
return;
|
|
@@ -11721,14 +12378,13 @@ var purify = {exports: {}};
|
|
|
11721
12378
|
forceKeepAttr: undefined
|
|
11722
12379
|
};
|
|
11723
12380
|
let l = attributes.length;
|
|
12381
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
11724
12382
|
/* Go backwards over all attributes; safely remove bad ones */
|
|
11725
12383
|
while (l--) {
|
|
11726
12384
|
const attr = attributes[l];
|
|
11727
|
-
const
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
value: attrValue
|
|
11731
|
-
} = attr;
|
|
12385
|
+
const name = attr.name,
|
|
12386
|
+
namespaceURI = attr.namespaceURI,
|
|
12387
|
+
attrValue = attr.value;
|
|
11732
12388
|
const lcName = transformCaseFunc(name);
|
|
11733
12389
|
const initValue = attrValue;
|
|
11734
12390
|
let value = name === 'value' ? initValue : stringTrim(initValue);
|
|
@@ -11742,12 +12398,14 @@ var purify = {exports: {}};
|
|
|
11742
12398
|
/* Full DOM Clobbering protection via namespace isolation,
|
|
11743
12399
|
* Prefix id and name attributes with `user-content-`
|
|
11744
12400
|
*/
|
|
11745
|
-
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
|
12401
|
+
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name') && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
|
|
11746
12402
|
// Remove the attribute with this value
|
|
11747
12403
|
_removeAttribute(name, currentNode);
|
|
11748
12404
|
// Prefix the value and later re-create the attribute with the sanitized value
|
|
11749
12405
|
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
11750
12406
|
}
|
|
12407
|
+
// Else: already prefixed, leave the attribute alone — the prefix is
|
|
12408
|
+
// itself the clobbering protection, and re-applying it is incorrect.
|
|
11751
12409
|
/* Work around a security issue with comments inside attributes */
|
|
11752
12410
|
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
|
|
11753
12411
|
_removeAttribute(name, currentNode);
|
|
@@ -11758,7 +12416,7 @@ var purify = {exports: {}};
|
|
|
11758
12416
|
_removeAttribute(name, currentNode);
|
|
11759
12417
|
continue;
|
|
11760
12418
|
}
|
|
11761
|
-
/* Did the hooks
|
|
12419
|
+
/* Did the hooks force-keep the attribute? */
|
|
11762
12420
|
if (hookEvent.forceKeepAttr) {
|
|
11763
12421
|
continue;
|
|
11764
12422
|
}
|
|
@@ -11768,56 +12426,24 @@ var purify = {exports: {}};
|
|
|
11768
12426
|
continue;
|
|
11769
12427
|
}
|
|
11770
12428
|
/* Work around a security issue in jQuery 3.0 */
|
|
11771
|
-
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(
|
|
12429
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
|
|
11772
12430
|
_removeAttribute(name, currentNode);
|
|
11773
12431
|
continue;
|
|
11774
12432
|
}
|
|
11775
12433
|
/* Sanitize attribute content to be template-safe */
|
|
11776
12434
|
if (SAFE_FOR_TEMPLATES) {
|
|
11777
|
-
|
|
11778
|
-
value = stringReplace(value, expr, ' ');
|
|
11779
|
-
});
|
|
12435
|
+
value = _stripTemplateExpressions(value);
|
|
11780
12436
|
}
|
|
11781
12437
|
/* Is `value` valid for this attribute? */
|
|
11782
|
-
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
11783
12438
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
11784
12439
|
_removeAttribute(name, currentNode);
|
|
11785
12440
|
continue;
|
|
11786
12441
|
}
|
|
11787
12442
|
/* Handle attributes that require Trusted Types */
|
|
11788
|
-
|
|
11789
|
-
if (namespaceURI) ; else {
|
|
11790
|
-
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
11791
|
-
case 'TrustedHTML':
|
|
11792
|
-
{
|
|
11793
|
-
value = trustedTypesPolicy.createHTML(value);
|
|
11794
|
-
break;
|
|
11795
|
-
}
|
|
11796
|
-
case 'TrustedScriptURL':
|
|
11797
|
-
{
|
|
11798
|
-
value = trustedTypesPolicy.createScriptURL(value);
|
|
11799
|
-
break;
|
|
11800
|
-
}
|
|
11801
|
-
}
|
|
11802
|
-
}
|
|
11803
|
-
}
|
|
12443
|
+
value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
|
|
11804
12444
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
11805
12445
|
if (value !== initValue) {
|
|
11806
|
-
|
|
11807
|
-
if (namespaceURI) {
|
|
11808
|
-
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
11809
|
-
} else {
|
|
11810
|
-
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
11811
|
-
currentNode.setAttribute(name, value);
|
|
11812
|
-
}
|
|
11813
|
-
if (_isClobbered(currentNode)) {
|
|
11814
|
-
_forceRemove(currentNode);
|
|
11815
|
-
} else {
|
|
11816
|
-
arrayPop(DOMPurify.removed);
|
|
11817
|
-
}
|
|
11818
|
-
} catch (_) {
|
|
11819
|
-
_removeAttribute(name, currentNode);
|
|
11820
|
-
}
|
|
12446
|
+
_setAttributeValue(currentNode, name, namespaceURI, value);
|
|
11821
12447
|
}
|
|
11822
12448
|
}
|
|
11823
12449
|
/* Execute a hook if present */
|
|
@@ -11840,14 +12466,133 @@ var purify = {exports: {}};
|
|
|
11840
12466
|
_sanitizeElements(shadowNode);
|
|
11841
12467
|
/* Check attributes next */
|
|
11842
12468
|
_sanitizeAttributes(shadowNode);
|
|
11843
|
-
/* Deep shadow DOM detected
|
|
11844
|
-
|
|
12469
|
+
/* Deep shadow DOM detected.
|
|
12470
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the
|
|
12471
|
+
DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we
|
|
12472
|
+
recurse into <template>.content from foreign realms too. */
|
|
12473
|
+
if (_isDocumentFragment(shadowNode.content)) {
|
|
11845
12474
|
_sanitizeShadowDOM2(shadowNode.content);
|
|
11846
12475
|
}
|
|
12476
|
+
/* An element iterated here may itself host an attached
|
|
12477
|
+
shadow root. The default NodeIterator does not enter shadow
|
|
12478
|
+
trees, so a shadow root nested inside template.content was
|
|
12479
|
+
previously reached by no walk at all (the pre-pass at
|
|
12480
|
+
_sanitizeAttachedShadowRoots descends via childNodes, which
|
|
12481
|
+
doesn't enter template.content; the template-content recursion
|
|
12482
|
+
above iterates the content but never inspected shadowRoot).
|
|
12483
|
+
Walk it explicitly. The nodeType guard avoids reading
|
|
12484
|
+
shadowRoot off text / comment / CDATA / PI nodes that the
|
|
12485
|
+
iterator also surfaces. */
|
|
12486
|
+
const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType;
|
|
12487
|
+
if (shadowNodeType === NODE_TYPE.element) {
|
|
12488
|
+
const innerSr = getShadowRoot(shadowNode);
|
|
12489
|
+
if (_isDocumentFragment(innerSr)) {
|
|
12490
|
+
_sanitizeAttachedShadowRoots(innerSr);
|
|
12491
|
+
_sanitizeShadowDOM2(innerSr);
|
|
12492
|
+
}
|
|
12493
|
+
}
|
|
11847
12494
|
}
|
|
11848
12495
|
/* Execute a hook if present */
|
|
11849
12496
|
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
11850
12497
|
};
|
|
12498
|
+
/**
|
|
12499
|
+
* _sanitizeAttachedShadowRoots
|
|
12500
|
+
*
|
|
12501
|
+
* Walks `root` and feeds every attached shadow root we encounter into
|
|
12502
|
+
* the existing _sanitizeShadowDOM pipeline. The default node iterator
|
|
12503
|
+
* does not descend into shadow trees, so nodes inside an attached
|
|
12504
|
+
* shadow root would otherwise be skipped entirely.
|
|
12505
|
+
*
|
|
12506
|
+
* Two real input paths put attached shadow roots in front of us:
|
|
12507
|
+
* 1. IN_PLACE on a DOM node that already has shadow roots attached.
|
|
12508
|
+
* 2. DOM-node input where importNode(dirty, true) deep-clones the
|
|
12509
|
+
* shadow root because it was created with `clonable: true`.
|
|
12510
|
+
*
|
|
12511
|
+
* This pass runs once, up front, so the main iteration loop (and the
|
|
12512
|
+
* existing _sanitizeShadowDOM template-content recursion) stay
|
|
12513
|
+
* untouched — string-input paths are not affected.
|
|
12514
|
+
*
|
|
12515
|
+
* @param root the subtree root to walk for attached shadow roots
|
|
12516
|
+
*/
|
|
12517
|
+
const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
|
|
12518
|
+
/* Iterative (explicit stack) rather than per-child recursion. DOM APIs
|
|
12519
|
+
impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data
|
|
12520
|
+
built straight into the DOM — the IN_PLACE surface) deeper than the JS
|
|
12521
|
+
call-stack budget would otherwise overflow native recursion here and
|
|
12522
|
+
throw at the IN_PLACE entry pre-pass, before a single node is
|
|
12523
|
+
sanitized, leaving the caller's live tree untouched (fail-open). See
|
|
12524
|
+
campaign-3 F4. A heap stack keeps depth off the call stack.
|
|
12525
|
+
Each work item is either a node to descend into, or a deferred
|
|
12526
|
+
`_sanitizeShadowDOM` for an already-walked shadow root. The deferred
|
|
12527
|
+
form preserves the original post-order discipline: a shadow root's
|
|
12528
|
+
nested shadow roots are discovered before the outer shadow is
|
|
12529
|
+
sanitized (which may remove hosts). Pushes are in reverse of the
|
|
12530
|
+
desired processing order (LIFO): template content, then children, then
|
|
12531
|
+
the shadow-sanitize, then the shadow walk — so the order matches the
|
|
12532
|
+
previous recursion exactly. */
|
|
12533
|
+
const stack = [{
|
|
12534
|
+
node: root,
|
|
12535
|
+
shadow: null
|
|
12536
|
+
}];
|
|
12537
|
+
while (stack.length > 0) {
|
|
12538
|
+
const item = stack.pop();
|
|
12539
|
+
/* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */
|
|
12540
|
+
if (item.shadow) {
|
|
12541
|
+
_sanitizeShadowDOM2(item.shadow);
|
|
12542
|
+
continue;
|
|
12543
|
+
}
|
|
12544
|
+
const node = item.node;
|
|
12545
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
12546
|
+
const isElement = nodeType === NODE_TYPE.element;
|
|
12547
|
+
/* (pushed last → processed first) Children, snapshotted in reverse so
|
|
12548
|
+
the first child is processed first. Snapshotting matters because a
|
|
12549
|
+
hook may detach siblings mid-walk. */
|
|
12550
|
+
const childNodes = getChildNodes(node);
|
|
12551
|
+
if (childNodes) {
|
|
12552
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
12553
|
+
stack.push({
|
|
12554
|
+
node: childNodes[i],
|
|
12555
|
+
shadow: null
|
|
12556
|
+
});
|
|
12557
|
+
}
|
|
12558
|
+
}
|
|
12559
|
+
/* (pushed before children → processed after them, matching the old
|
|
12560
|
+
"template content last" order) When the node is a <template>,
|
|
12561
|
+
descend into its content. */
|
|
12562
|
+
if (isElement) {
|
|
12563
|
+
const rootName = getNodeName ? getNodeName(node) : null;
|
|
12564
|
+
if (typeof rootName === 'string' && transformCaseFunc(rootName) === 'template') {
|
|
12565
|
+
const content = node.content;
|
|
12566
|
+
if (_isDocumentFragment(content)) {
|
|
12567
|
+
stack.push({
|
|
12568
|
+
node: content,
|
|
12569
|
+
shadow: null
|
|
12570
|
+
});
|
|
12571
|
+
}
|
|
12572
|
+
}
|
|
12573
|
+
}
|
|
12574
|
+
/* Shadow root (processed first): walk its subtree, then sanitise it.
|
|
12575
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
12576
|
+
rather than `instanceof DocumentFragment`, which is realm-bound and
|
|
12577
|
+
silently skipped foreign-realm shadow roots (e.g.
|
|
12578
|
+
iframe.contentDocument attachShadow). */
|
|
12579
|
+
if (isElement) {
|
|
12580
|
+
const sr = getShadowRoot(node);
|
|
12581
|
+
if (_isDocumentFragment(sr)) {
|
|
12582
|
+
/* Push the deferred sanitise first so it pops after the shadow
|
|
12583
|
+
walk we push next, i.e. nested shadow roots are discovered
|
|
12584
|
+
before this one is sanitised. */
|
|
12585
|
+
stack.push({
|
|
12586
|
+
node: null,
|
|
12587
|
+
shadow: sr
|
|
12588
|
+
}, {
|
|
12589
|
+
node: sr,
|
|
12590
|
+
shadow: null
|
|
12591
|
+
});
|
|
12592
|
+
}
|
|
12593
|
+
}
|
|
12594
|
+
}
|
|
12595
|
+
};
|
|
11851
12596
|
// eslint-disable-next-line complexity
|
|
11852
12597
|
DOMPurify.sanitize = function (dirty) {
|
|
11853
12598
|
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -11864,13 +12609,9 @@ var purify = {exports: {}};
|
|
|
11864
12609
|
}
|
|
11865
12610
|
/* Stringify, in case dirty is an object */
|
|
11866
12611
|
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
throw typeErrorCreate('dirty is not a string, aborting');
|
|
11871
|
-
}
|
|
11872
|
-
} else {
|
|
11873
|
-
throw typeErrorCreate('toString is not a function');
|
|
12612
|
+
dirty = stringifyValue(dirty);
|
|
12613
|
+
if (typeof dirty !== 'string') {
|
|
12614
|
+
throw typeErrorCreate('dirty is not a string, aborting');
|
|
11874
12615
|
}
|
|
11875
12616
|
}
|
|
11876
12617
|
/* Return dirty HTML if DOMPurify cannot run */
|
|
@@ -11878,24 +12619,78 @@ var purify = {exports: {}};
|
|
|
11878
12619
|
return dirty;
|
|
11879
12620
|
}
|
|
11880
12621
|
/* Assign config vars */
|
|
11881
|
-
if (
|
|
12622
|
+
if (SET_CONFIG) {
|
|
12623
|
+
/* Persistent setConfig() path: _parseConfig is skipped, so the sets are
|
|
12624
|
+
* not re-derived per call. Restore them from the pristine bindings
|
|
12625
|
+
* captured at setConfig() time so a previous call's hook clone (mutated
|
|
12626
|
+
* below) does not carry over. */
|
|
12627
|
+
ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
|
|
12628
|
+
ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
|
|
12629
|
+
} else {
|
|
11882
12630
|
_parseConfig(cfg);
|
|
11883
12631
|
}
|
|
12632
|
+
/* Clone the hook-mutable allowlists before the walk whenever an
|
|
12633
|
+
* uponSanitize* hook is registered. The hook event exposes ALLOWED_TAGS
|
|
12634
|
+
* and ALLOWED_ATTR by reference (as allowedTags / allowedAttributes), so
|
|
12635
|
+
* a hook that widens them would otherwise mutate the shared set
|
|
12636
|
+
* permanently: across later calls and across every element. Cloning per
|
|
12637
|
+
* walk keeps documented in-call widening working while scoping it to the
|
|
12638
|
+
* call. A single guard for both config paths - the per-call path rebinds
|
|
12639
|
+
* the sets in _parseConfig each call, the persistent path restores them
|
|
12640
|
+
* from the captured bindings just above - so the two cannot diverge. */
|
|
12641
|
+
if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {
|
|
12642
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
12643
|
+
}
|
|
12644
|
+
if (hooks.uponSanitizeAttribute.length > 0) {
|
|
12645
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
12646
|
+
}
|
|
11884
12647
|
/* Clean up removed elements */
|
|
11885
12648
|
DOMPurify.removed = [];
|
|
11886
|
-
/*
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
12649
|
+
/* Resolve IN_PLACE for this call without mutating persistent config.
|
|
12650
|
+
Writing the IN_PLACE closure variable here leaks under setConfig(),
|
|
12651
|
+
where _parseConfig is skipped on later calls: a single string call would
|
|
12652
|
+
disable in-place mode for every subsequent node call, returning a
|
|
12653
|
+
sanitized copy while leaving the caller's node — which in-place callers
|
|
12654
|
+
keep using and whose return value they ignore — unsanitized. REPORT-2. */
|
|
12655
|
+
const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);
|
|
12656
|
+
if (inPlace) {
|
|
12657
|
+
/* Do some early pre-sanitization to avoid unsafe root nodes.
|
|
12658
|
+
Read nodeName through the cached prototype getter — a clobbering
|
|
12659
|
+
child named "nodeName" on the form root would otherwise shadow
|
|
12660
|
+
the property and let this check skip the root-allowlist
|
|
12661
|
+
validation entirely. */
|
|
12662
|
+
const nn = getNodeName ? getNodeName(dirty) : dirty.nodeName;
|
|
12663
|
+
if (typeof nn === 'string') {
|
|
12664
|
+
const tagName = transformCaseFunc(nn);
|
|
11894
12665
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
11895
12666
|
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
|
11896
12667
|
}
|
|
11897
12668
|
}
|
|
11898
|
-
|
|
12669
|
+
/* Pre-flight the root through _isClobbered. The iterator-driven
|
|
12670
|
+
removal path can not detach a parent-less root: _forceRemove
|
|
12671
|
+
falls through to Element.prototype.remove(), which per spec
|
|
12672
|
+
is a no-op on a node with no parent. A clobbered root would
|
|
12673
|
+
then survive the main loop with its attributes uninspected,
|
|
12674
|
+
because _sanitizeAttributes early-returns on _isClobbered. The
|
|
12675
|
+
result would be an attacker-controlled form, complete with any
|
|
12676
|
+
event-handler attributes the caller passed in, handed back to
|
|
12677
|
+
the application unsanitized. Refuse to sanitize such a root
|
|
12678
|
+
the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */
|
|
12679
|
+
if (_isClobbered(dirty)) {
|
|
12680
|
+
throw typeErrorCreate('root node is clobbered and cannot be sanitized in-place');
|
|
12681
|
+
}
|
|
12682
|
+
/* Sanitize attached shadow roots before the main iterator runs.
|
|
12683
|
+
The iterator does not descend into shadow trees. Same fail-closed
|
|
12684
|
+
barrier as the main walk (campaign-3 F2): a custom-element reaction
|
|
12685
|
+
inside a shadow root could abort this pre-pass before the walk runs,
|
|
12686
|
+
which would otherwise leave the entire live tree unsanitized. */
|
|
12687
|
+
try {
|
|
12688
|
+
_sanitizeAttachedShadowRoots(dirty);
|
|
12689
|
+
} catch (error) {
|
|
12690
|
+
_neutralizeRoot(dirty);
|
|
12691
|
+
throw error;
|
|
12692
|
+
}
|
|
12693
|
+
} else if (_isNode(dirty)) {
|
|
11899
12694
|
/* If dirty is a DOM element, append to an empty document to avoid
|
|
11900
12695
|
elements being stripped by the parser */
|
|
11901
12696
|
body = _initDocument('<!---->');
|
|
@@ -11909,12 +12704,18 @@ var purify = {exports: {}};
|
|
|
11909
12704
|
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
|
11910
12705
|
body.appendChild(importedNode);
|
|
11911
12706
|
}
|
|
12707
|
+
/* Clonable shadow roots are deep-cloned by importNode(); sanitize
|
|
12708
|
+
them before the main iterator runs, since the iterator does not
|
|
12709
|
+
descend into shadow trees. The walk routes every read through a
|
|
12710
|
+
cached prototype getter so clobbering descendants on a form root
|
|
12711
|
+
cannot hide a shadow host from this pass. */
|
|
12712
|
+
_sanitizeAttachedShadowRoots(importedNode);
|
|
11912
12713
|
} else {
|
|
11913
12714
|
/* Exit directly if we have nothing to do */
|
|
11914
12715
|
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
|
11915
12716
|
// eslint-disable-next-line unicorn/prefer-includes
|
|
11916
12717
|
dirty.indexOf('<') === -1) {
|
|
11917
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
12718
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
|
|
11918
12719
|
}
|
|
11919
12720
|
/* Initialize the document to work on */
|
|
11920
12721
|
body = _initDocument(dirty);
|
|
@@ -11928,31 +12729,59 @@ var purify = {exports: {}};
|
|
|
11928
12729
|
_forceRemove(body.firstChild);
|
|
11929
12730
|
}
|
|
11930
12731
|
/* Get node iterator */
|
|
11931
|
-
const nodeIterator = _createNodeIterator(
|
|
11932
|
-
/* Now start iterating over the created document
|
|
11933
|
-
|
|
11934
|
-
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
12732
|
+
const nodeIterator = _createNodeIterator(inPlace ? dirty : body);
|
|
12733
|
+
/* Now start iterating over the created document.
|
|
12734
|
+
The walk runs inside an exception barrier (campaign-3 F2): a re-entrant
|
|
12735
|
+
engine/custom-element mutation can detach a node mid-walk so
|
|
12736
|
+
`_forceRemove`'s parentless guard throws, aborting the loop. Without the
|
|
12737
|
+
barrier the caller's in-place tree would be left half-sanitized with the
|
|
12738
|
+
unvisited tail still armed. On any throw we fail closed — strip the
|
|
12739
|
+
in-place root bare — then rethrow so the existing throw contract is
|
|
12740
|
+
preserved. (String/DOM-copy paths never return the partial body, so the
|
|
12741
|
+
propagating throw is already fail-closed there.) */
|
|
12742
|
+
try {
|
|
12743
|
+
while (currentNode = nodeIterator.nextNode()) {
|
|
12744
|
+
/* Sanitize tags and elements */
|
|
12745
|
+
_sanitizeElements(currentNode);
|
|
12746
|
+
/* Check attributes next */
|
|
12747
|
+
_sanitizeAttributes(currentNode);
|
|
12748
|
+
/* Shadow DOM detected, sanitize it.
|
|
12749
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
12750
|
+
instead of instanceof, so foreign-realm <template>.content is
|
|
12751
|
+
walked correctly. */
|
|
12752
|
+
if (_isDocumentFragment(currentNode.content)) {
|
|
12753
|
+
_sanitizeShadowDOM2(currentNode.content);
|
|
12754
|
+
}
|
|
12755
|
+
}
|
|
12756
|
+
} catch (error) {
|
|
12757
|
+
if (inPlace) {
|
|
12758
|
+
_neutralizeRoot(dirty);
|
|
11941
12759
|
}
|
|
12760
|
+
throw error;
|
|
11942
12761
|
}
|
|
11943
12762
|
/* If we sanitized `dirty` in-place, return it. */
|
|
11944
|
-
if (
|
|
12763
|
+
if (inPlace) {
|
|
12764
|
+
/* Fail-closed completion of the audit-5 F1 fix: every node removed from
|
|
12765
|
+
the caller's live tree is detached but may still hold a queued
|
|
12766
|
+
resource-event handler that fires in page scope after we return. The
|
|
12767
|
+
move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the
|
|
12768
|
+
non-allow-listed attributes off every other removed subtree (clobber,
|
|
12769
|
+
mXSS, namespace, comments, KEEP_CONTENT:false, …) so those handlers are
|
|
12770
|
+
cancelled before any event can fire. Runs synchronously, pre-return. */
|
|
12771
|
+
arrayForEach(DOMPurify.removed, entry => {
|
|
12772
|
+
if (entry.element) {
|
|
12773
|
+
_neutralizeSubtree(entry.element);
|
|
12774
|
+
}
|
|
12775
|
+
});
|
|
12776
|
+
if (SAFE_FOR_TEMPLATES) {
|
|
12777
|
+
_scrubTemplateExpressions2(dirty);
|
|
12778
|
+
}
|
|
11945
12779
|
return dirty;
|
|
11946
12780
|
}
|
|
11947
12781
|
/* Return sanitized string or DOM */
|
|
11948
12782
|
if (RETURN_DOM) {
|
|
11949
12783
|
if (SAFE_FOR_TEMPLATES) {
|
|
11950
|
-
body
|
|
11951
|
-
let html = body.innerHTML;
|
|
11952
|
-
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
11953
|
-
html = stringReplace(html, expr, ' ');
|
|
11954
|
-
});
|
|
11955
|
-
body.innerHTML = html;
|
|
12784
|
+
_scrubTemplateExpressions2(body);
|
|
11956
12785
|
}
|
|
11957
12786
|
if (RETURN_DOM_FRAGMENT) {
|
|
11958
12787
|
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
@@ -11982,20 +12811,28 @@ var purify = {exports: {}};
|
|
|
11982
12811
|
}
|
|
11983
12812
|
/* Sanitize final string template-safe */
|
|
11984
12813
|
if (SAFE_FOR_TEMPLATES) {
|
|
11985
|
-
|
|
11986
|
-
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
|
11987
|
-
});
|
|
12814
|
+
serializedHTML = _stripTemplateExpressions(serializedHTML);
|
|
11988
12815
|
}
|
|
11989
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
12816
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
|
|
11990
12817
|
};
|
|
11991
12818
|
DOMPurify.setConfig = function () {
|
|
11992
12819
|
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11993
12820
|
_parseConfig(cfg);
|
|
11994
12821
|
SET_CONFIG = true;
|
|
12822
|
+
SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
|
|
12823
|
+
SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
|
|
11995
12824
|
};
|
|
11996
12825
|
DOMPurify.clearConfig = function () {
|
|
11997
12826
|
CONFIG = null;
|
|
11998
12827
|
SET_CONFIG = false;
|
|
12828
|
+
SET_CONFIG_ALLOWED_TAGS = null;
|
|
12829
|
+
SET_CONFIG_ALLOWED_ATTR = null;
|
|
12830
|
+
// Drop any caller-supplied Trusted Types policy so it cannot poison later
|
|
12831
|
+
// `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and
|
|
12832
|
+
// never recreated — Trusted Types throws on duplicate names) is restored by
|
|
12833
|
+
// the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.
|
|
12834
|
+
trustedTypesPolicy = defaultTrustedTypesPolicy;
|
|
12835
|
+
emptyHTML = '';
|
|
11999
12836
|
};
|
|
12000
12837
|
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
12001
12838
|
/* Initialize shared config vars if necessary. */
|
|
@@ -12010,9 +12847,19 @@ var purify = {exports: {}};
|
|
|
12010
12847
|
if (typeof hookFunction !== 'function') {
|
|
12011
12848
|
return;
|
|
12012
12849
|
}
|
|
12850
|
+
/* Reject unknown entry points. Without this, a non-hook key (e.g.
|
|
12851
|
+
* '__proto__') indexes off the prototype chain rather than a real
|
|
12852
|
+
* hook array, and arrayPush then writes to Object.prototype. Guard
|
|
12853
|
+
* with an own-property check against the known hook names. */
|
|
12854
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) {
|
|
12855
|
+
return;
|
|
12856
|
+
}
|
|
12013
12857
|
arrayPush(hooks[entryPoint], hookFunction);
|
|
12014
12858
|
};
|
|
12015
12859
|
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
|
12860
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) {
|
|
12861
|
+
return undefined;
|
|
12862
|
+
}
|
|
12016
12863
|
if (hookFunction !== undefined) {
|
|
12017
12864
|
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
12018
12865
|
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
@@ -12020,6 +12867,9 @@ var purify = {exports: {}};
|
|
|
12020
12867
|
return arrayPop(hooks[entryPoint]);
|
|
12021
12868
|
};
|
|
12022
12869
|
DOMPurify.removeHooks = function (entryPoint) {
|
|
12870
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) {
|
|
12871
|
+
return;
|
|
12872
|
+
}
|
|
12023
12873
|
hooks[entryPoint] = [];
|
|
12024
12874
|
};
|
|
12025
12875
|
DOMPurify.removeAllHooks = function () {
|
|
@@ -13199,7 +14049,7 @@ class MenuGroup {
|
|
|
13199
14049
|
}; }
|
|
13200
14050
|
}
|
|
13201
14051
|
|
|
13202
|
-
const icMenuItemCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host ::part(button){color:var(--ic-popover-menu-item-check);--ic-typography-color:var(--ic-popover-menu-item-check);padding:calc(var(--ic-space-xxxs) / 2);display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:0;min-height:2.5rem;height:auto}.focus-border{display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:var(--ic-border-radius);margin:calc(var(--ic-space-xxxs) / 2);padding:var(--ic-space-xxs);border:var(--ic-space-xxxs) dashed transparent;--icon-height:auto}:host(.ic-menu-item-disabled) ::part(button){color:var(--ic-popover-menu-item-check-disabled) !important;--ic-typography-color:var(--ic-popover-menu-item-check-disabled) !important;pointer-events:none}:host(.ic-menu-item-disabled) .menu-item-label,:host(.ic-menu-item-disabled) .shortcut,:host(.ic-menu-item-disabled) .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-disabled) !important}:host(.ic-menu-item-variant-destructive) ::part(button){color:var(--ic-popover-menu-destructive-item-icon);--ic-typography-color:var(--ic-popover-menu-destructive-item-label)}:host ::part(button):
|
|
14052
|
+
const icMenuItemCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host ::part(button){color:var(--ic-popover-menu-item-check);--ic-typography-color:var(--ic-popover-menu-item-check);padding:calc(var(--ic-space-xxxs) / 2);display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:0;min-height:2.5rem;height:auto}.focus-border{display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:var(--ic-border-radius);margin:calc(var(--ic-space-xxxs) / 2);padding:var(--ic-space-xxs);border:var(--ic-space-xxxs) dashed transparent;--icon-height:auto}:host(.ic-menu-item-disabled) ::part(button){color:var(--ic-popover-menu-item-check-disabled) !important;--ic-typography-color:var(--ic-popover-menu-item-check-disabled) !important;pointer-events:none}:host(.ic-menu-item-disabled) .menu-item-label,:host(.ic-menu-item-disabled) .shortcut,:host(.ic-menu-item-disabled) .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-disabled) !important}:host(.ic-menu-item-variant-destructive) ::part(button){color:var(--ic-popover-menu-destructive-item-icon);--ic-typography-color:var(--ic-popover-menu-destructive-item-label)}:host(.ic-menu-item-variant-destructive) ::part(button):focus{background-color:var(--ic-popover-destructive-background-focus)}:host ::part(button):hover{background-color:var(--ic-popover-background-hover)}:host ::part(button):focus{box-shadow:none}:host ::part(button):focus,:host ::part(button):focus-visible{color:var(--ic-popover-menu-item-icon-focused);--ic-typography-color:var(--ic-popover-menu-item-label-focused);background-color:var(--ic-popover-background-focus)}ic-button:focus-within .menu-item-label,ic-button:focus-within .shortcut,ic-button:focus-within .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-focused)}:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border{border-color:var(--ic-popover-menu-border)}:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-disabled) !important}:host ::part(button):active{background-color:var(--ic-popover-background-pressed);color:var(--ic-popover-menu-item-label) !important;--ic-typography-color:var(--ic-popover-menu-item-label) !important}:host(.ic-menu-item-variant-destructive) ::part(button):active{background-color:var(--ic-popover-background-pressed);color:var(--ic-popover-menu-destructive-item-label) !important;--ic-typography-color:var(\n --ic-popover-menu-destructive-item-label\n ) !important}.menu-item-info{display:flex;flex-direction:column;flex:1;align-items:baseline;white-space:pre-line;text-align:left}.menu-labels{display:flex;align-items:baseline;gap:var(--ic-space-xs)}.menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-description)}.shortcut{--ic-typography-color:var(--ic-popover-menu-item-shortcut);display:flex;flex:min-content}:host(.ic-menu-item-variant-destructive) .menu-item-label{text-transform:uppercase;font-weight:600;letter-spacing:0.025em}ic-button:active .menu-item-label{--ic-typography-color:var(--ic-popover-menu-item-label)}ic-button:active .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-description)}ic-button:active .shortcut{--ic-typography-color:var(--ic-popover-menu-item-shortcut)}:host(.ic-menu-item-variant-destructive) ic-button:active .menu-item-label{--ic-typography-color:var(\n --ic-popover-menu-destructive-item-label\n ) !important}.icon,.check-icon,.submenu-icon,.icon ::slotted(svg),.check-icon svg,.submenu-icon svg{width:var(--ic-space-lg);height:var(--ic-space-lg)}.check-icon.hide{visibility:hidden}@media (forced-colors: active){:host ::part(button){border:canvas}:host ::part(button):focus-visible{outline:var(--ic-space-xxxs) solid transparent}.focus-border{border-color:canvas}:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border{border-color:GrayText}:host(.ic-menu-item-disabled) .menu-item-info,:host(.ic-menu-item-disabled) .menu-item-label,:host(.ic-menu-item-disabled) .shortcut,:host(.ic-menu-item-disabled) .menu-item-description,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-info,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description{--ic-typography-color:GrayText !important}:host(.ic-menu-item-disabled) ::part(button):focus-visible,:host(.ic-menu-item-disabled) ::part(button):focus{outline-color:GrayText !important}}";
|
|
13203
14053
|
var IcMenuItemStyle0 = icMenuItemCss;
|
|
13204
14054
|
|
|
13205
14055
|
/**
|
|
@@ -13224,6 +14074,10 @@ class MenuItem {
|
|
|
13224
14074
|
* The variant of the menu item.
|
|
13225
14075
|
*/
|
|
13226
14076
|
this.variant = "default";
|
|
14077
|
+
/**
|
|
14078
|
+
* If `true`, the menu will close when this menu item is clicked.
|
|
14079
|
+
*/
|
|
14080
|
+
this.closeMenuOnSelect = true;
|
|
13227
14081
|
this.handleClick = (e) => {
|
|
13228
14082
|
if (isPropDefined(this.submenuTriggerFor)) {
|
|
13229
14083
|
this.triggerPopoverMenuInstance.emit();
|
|
@@ -13324,7 +14178,8 @@ class MenuItem {
|
|
|
13324
14178
|
"rel": [1],
|
|
13325
14179
|
"submenuTriggerFor": [1, "submenu-trigger-for"],
|
|
13326
14180
|
"target": [1],
|
|
13327
|
-
"variant": [1537]
|
|
14181
|
+
"variant": [1537],
|
|
14182
|
+
"closeMenuOnSelect": [4, "close-menu-on-select"]
|
|
13328
14183
|
},
|
|
13329
14184
|
"$listeners$": [[2, "click", "handleHostClick"]],
|
|
13330
14185
|
"$lazyBundleId$": "-",
|
|
@@ -14426,16 +15281,20 @@ class Pagination {
|
|
|
14426
15281
|
};
|
|
14427
15282
|
// button rendering abstracted from component render methods for clarity
|
|
14428
15283
|
this.firstButton = () => {
|
|
14429
|
-
|
|
15284
|
+
var _a;
|
|
15285
|
+
return (hAsync("ic-button", { id: "first-page-button", "aria-label": `Go to first ${(_a = this.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()}`, theme: this.theme, onClick: this.handleClickFirst, class: "page-button first-last", disabled: this.currentPage === 1 || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationFirstLast }));
|
|
14430
15286
|
};
|
|
14431
15287
|
this.previousButton = () => {
|
|
14432
|
-
|
|
15288
|
+
var _a;
|
|
15289
|
+
return (hAsync("ic-button", { id: "previous-page-button", "aria-label": `Go to previous ${(_a = this.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()}`, theme: this.theme, onClick: this.handleClickPrevious, class: "page-button next-previous flip", disabled: this.currentPage === 1 || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationNextPrevious }));
|
|
14433
15290
|
};
|
|
14434
15291
|
this.nextButton = () => {
|
|
14435
|
-
|
|
15292
|
+
var _a;
|
|
15293
|
+
return (hAsync("ic-button", { id: "next-page-button", "aria-label": `Go to next ${(_a = this.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()}`, theme: this.theme, onClick: this.handleClickNext, class: "page-button next-previous", disabled: this.currentPage === this.pages || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationNextPrevious }));
|
|
14436
15294
|
};
|
|
14437
15295
|
this.lastButton = () => {
|
|
14438
|
-
|
|
15296
|
+
var _a;
|
|
15297
|
+
return (hAsync("ic-button", { id: "last-page-button", "aria-label": `Go to last ${(_a = this.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()}`, theme: this.theme, onClick: this.handleClickLast, class: "page-button first-last flip", disabled: this.currentPage === this.pages || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationFirstLast }));
|
|
14439
15298
|
};
|
|
14440
15299
|
this.renderStartEllipsis = () => {
|
|
14441
15300
|
return (hAsync("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, type: "ellipsis", id: "start-ellipsis", disabled: this.disabled }));
|
|
@@ -14619,14 +15478,14 @@ class Pagination {
|
|
|
14619
15478
|
}
|
|
14620
15479
|
render() {
|
|
14621
15480
|
const { type, currentPage, hideCurrentPage, disabled, hideFirstAndLastPageButton, label, theme, monochrome, } = this;
|
|
14622
|
-
return (hAsync(Host, { key: '
|
|
15481
|
+
return (hAsync(Host, { key: '17e45e030ef6620c592d73a21d9b6dded9978565', class: {
|
|
14623
15482
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
14624
15483
|
["ic-pagination-monochrome"]: !!monochrome,
|
|
14625
|
-
} }, type === "simple" && (hAsync("nav", { key: '
|
|
15484
|
+
} }, type === "simple" && (hAsync("nav", { key: 'a42e658ed8d67797390d5d256786f9abaa258ede', class: {
|
|
14626
15485
|
["disabled"]: !!disabled,
|
|
14627
|
-
}, role: "navigation", "aria-label": this.accessibleLabel }, hideFirstAndLastPageButton ? null : this.firstButton(), this.previousButton(), hAsync("ic-pagination-item", { key: '
|
|
15486
|
+
}, role: "navigation", "aria-label": this.accessibleLabel }, hideFirstAndLastPageButton ? null : this.firstButton(), this.previousButton(), hAsync("ic-pagination-item", { key: 'ce42e8e0c6c0227554cb17c83a1b36f688112a01', theme: this.theme, monochrome: this.monochrome, type: "simple-current", page: currentPage, label: label, class: { ["hide-current-page"]: !!hideCurrentPage }, disabled: disabled }), this.nextButton(), hideFirstAndLastPageButton ? null : this.lastButton())), type === "complex" && (hAsync("nav", { key: '5b2c3a6da6dfde3eb51594a47f617bb7cc2fdcdb', class: {
|
|
14628
15487
|
["disabled"]: !!disabled,
|
|
14629
|
-
}, role: "navigation", "aria-label": this.accessibleLabel }, hideFirstAndLastPageButton ? null : this.firstButton(), this.previousButton(), this.renderStartItems(), this.startEllipsis && this.renderStartEllipsis(), this.renderMiddleItems(), this.endEllipsis && this.renderEndEllipsis(), this.renderEndItems(), this.nextButton(), hideFirstAndLastPageButton ? null : this.lastButton())), type === "complex" && (hAsync("span", { key: '
|
|
15488
|
+
}, role: "navigation", "aria-label": this.accessibleLabel }, hideFirstAndLastPageButton ? null : this.firstButton(), this.previousButton(), this.renderStartItems(), this.startEllipsis && this.renderStartEllipsis(), this.renderMiddleItems(), this.endEllipsis && this.renderEndEllipsis(), this.renderEndItems(), this.nextButton(), hideFirstAndLastPageButton ? null : this.lastButton())), type === "complex" && (hAsync("span", { key: 'fe85a33cfa0b3d2e2d556f15e6ade209dd0099eb', class: "sr-only", "aria-live": "polite" }, "Page ", this.currentPage))));
|
|
14630
15489
|
}
|
|
14631
15490
|
get el() { return getElement(this); }
|
|
14632
15491
|
static get watchers() { return {
|
|
@@ -15089,7 +15948,7 @@ class PaginationBar {
|
|
|
15089
15948
|
}; }
|
|
15090
15949
|
}
|
|
15091
15950
|
|
|
15092
|
-
const icPaginationItemCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}a{text-align:center}.item-container{display:flex;justify-content:center;align-items:center;width:calc(var(--ic-space-xl) + var(--ic-space-sm));height:var(--ic-space-xl);margin:var(--ic-space-xxs) var(--ic-space-xxxs);cursor:pointer;text-decoration:none}button{background:none;border:none;outline:inherit;position:relative}.ellipsis{pointer-events:none;--ic-typography-color:var(--ic-pagination-ellipsis)}.monochrome .ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-monochrome)}.item-container:focus{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast)}.page{--ic-typography-color:var(--ic-pagination-page-number)}.monochrome .page{--ic-typography-color:var(--ic-pagination-page-number-monochrome)}.simple-current{min-width:calc(var(--ic-space-xxl)
|
|
15951
|
+
const icPaginationItemCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}a{text-align:center}.item-container{display:flex;justify-content:center;align-items:center;width:calc(var(--ic-space-xl) + var(--ic-space-sm));height:var(--ic-space-xl);margin:var(--ic-space-xxs) var(--ic-space-xxxs);cursor:pointer;text-decoration:none}button{background:none;border:none;outline:inherit;position:relative}.ellipsis{pointer-events:none;--ic-typography-color:var(--ic-pagination-ellipsis)}.monochrome .ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-monochrome)}.item-container:focus{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast)}.page{--ic-typography-color:var(--ic-pagination-page-number)}.monochrome .page{--ic-typography-color:var(--ic-pagination-page-number-monochrome)}.simple-current{min-width:calc(var(--ic-space-xxl));padding:0 var(--ic-space-xs);height:var(--ic-space-lg);cursor:default}.item-container.page:hover:not(.selected):not(:focus){border-radius:var(--ic-border-radius);background-color:var(--ic-pagination-hover)}.item-container.page:active:not(.selected):not(:focus){background-color:var(--ic-pagination-pressed)}.monochrome .item-container.page:hover:not(.selected):not(:focus){background-color:var(--ic-pagination-hover-monochrome)}.monochrome .item-container.page:active:not(.selected):not(:focus){background-color:var(--ic-pagination-pressed-monochrome)}.selected{pointer-events:none;outline:none}.selected::after{content:\"\";height:var(--ic-space-xxs);width:100%;position:absolute;bottom:0;background-color:var(--ic-pagination-selected-banner)}.monochrome .selected::after{background-color:var(--ic-pagination-selected-banner-monochrome)}.page-selected{--ic-typography-color:var(--ic-pagination-text)}.item-container.page.light:hover:not(.selected):not(:focus){background-color:var(--ic-action-light-bg-hover)}.item-container.page.light:active:not(.selected):not(:focus){background-color:var(--ic-action-light-bg-pressed)}ic-typography.light,ic-typography.page-selected.light{--ic-typography-color:var(--ic-architectural-white)}.selected.light::after{content:\"\";height:var(--ic-space-xxs);width:100%;position:absolute;bottom:0;background-color:var(--ic-action-monochrome)}.item-container.page.dark:hover:not(.selected):not(:focus){background-color:var(--ic-action-dark-bg-hover)}.item-container.page.dark:active:not(.selected):not(:focus){background-color:var(--ic-action-dark-bg-pressed)}ic-typography.dark{--ic-typography-color:var(--ic-color-text-primary)}.selected.dark::after{content:\"\";height:var(--ic-space-xxs);width:100%;position:absolute;bottom:0;background-color:var(--ic-action-monochrome-dark)}.disabled{--ic-typography-color:var(--ic-pagination-text-disabled);pointer-events:none;cursor:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.disabled.page ic-typography{--ic-typography-color:var(--ic-pagination-page-number-disabled)}.disabled.ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-disabled)}.monochrome .disabled.page{--ic-typography-color:var(--ic-pagination-page-number-monochrome-disabled)}.monochrome .disabled.ellipsis{--ic-typography-color:var(--ic-pagination-ellipsis-monochrome-disabled)}@media (forced-colors: active){.selected::after{background-color:Highlight}.selected.light::after{background-color:Highlight}.selected.dark::after{background-color:Highlight}.disabled{--ic-typography-color:GrayText}}@media (prefers-reduced-motion: reduce){.item-container:focus{transition:none}}";
|
|
15093
15952
|
var IcPaginationItemStyle0 = icPaginationItemCss;
|
|
15094
15953
|
|
|
15095
15954
|
class PaginationItem {
|
|
@@ -15174,10 +16033,13 @@ class PaginationItem {
|
|
|
15174
16033
|
}; }
|
|
15175
16034
|
}
|
|
15176
16035
|
|
|
15177
|
-
const icPopoverMenuCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}@media (prefers-reduced-motion: no-preference){:host .opening-from-parent{animation:slide-in var(--ic-transition-duration-slow) ease-in-out}:host .opening-from-child{animation:slide-out var(--ic-transition-duration-slow) ease-in-out}}:host{border-radius:var(--ic-border-radius);color:var(--ic-popover-nav-text);--ic-typography-color:var(--ic-popover-nav-text);position:relative;z-index:var(--ic-z-index-popover);box-sizing:border-box;box-shadow:var(--ic-elevation-overlay);display:none}:host(.on-dialog){inset:auto !important}:host(.on-dialog-fix-translate){transform:translate(0, var(--ic-space-xs)) !important}:host(.on-dialog-translate-y){transform:translate(0, calc(-1 * var(--translate-y))) !important}.menu{border:var(--ic-border-default);border-color:var(--ic-popover-border);border-radius:var(--ic-border-radius);background-color:var(--ic-popover-background);visibility:hidden;height:0;display:flex;flex-direction:column}:host
|
|
16036
|
+
const icPopoverMenuCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}@media (prefers-reduced-motion: no-preference){:host .opening-from-parent{animation:slide-in var(--ic-transition-duration-slow) ease-in-out}:host .opening-from-child{animation:slide-out var(--ic-transition-duration-slow) ease-in-out}}:host .ic-popover-menu{border-radius:var(--ic-border-radius);color:var(--ic-popover-nav-text);--ic-typography-color:var(--ic-popover-nav-text);position:relative;z-index:var(--ic-z-index-popover);box-sizing:border-box;box-shadow:var(--ic-elevation-overlay);display:none}:host(.on-dialog){inset:auto !important}:host(.on-dialog-fix-translate){transform:translate(0, var(--ic-space-xs)) !important}:host(.on-dialog-translate-y){transform:translate(0, calc(-1 * var(--translate-y))) !important}.menu{border:var(--ic-border-default);border-color:var(--ic-popover-border);border-radius:var(--ic-border-radius);background-color:var(--ic-popover-background);visibility:hidden;height:0;display:flex;flex-direction:column}:host .ic-popover-menu:focus-within{box-shadow:var(--ic-border-focus)}.menu:focus-visible{outline:none}:host .ic-popover-menu-open{display:block;min-width:calc(20rem - var(--ic-space-xl));width:var(--popover-width, 20rem);max-width:calc(100vw - var(--ic-space-xl))}:host .ic-popover-menu-open .menu{visibility:visible;height:-moz-fit-content;height:fit-content;max-height:var(--max-height, -moz-fit-content);max-height:var(--max-height, fit-content);overflow-y:auto;overflow-x:hidden}.parent-label{--ic-typography-color:var(--ic-popover-parent-label);margin:var(--ic-space-xs) var(--ic-space-xs) 0}@keyframes slide-in{from{opacity:0;transform:translateX(10rem)}to{opacity:1;transform:translateX(0)}}@keyframes slide-out{from{opacity:0;transform:translateX(-10rem)}to{opacity:1;transform:translateX(0)}}";
|
|
15178
16037
|
var IcPopoverMenuStyle0 = icPopoverMenuCss;
|
|
15179
16038
|
|
|
15180
16039
|
const MENU_SELECTOR = "div.menu-body";
|
|
16040
|
+
/**
|
|
16041
|
+
* @slot anchor - The default anchor element for the popover menu. This will take precedence over the `anchor` prop.
|
|
16042
|
+
*/
|
|
15181
16043
|
class PopoverMenu {
|
|
15182
16044
|
constructor(hostRef) {
|
|
15183
16045
|
registerInstance(this, hostRef);
|
|
@@ -15203,6 +16065,10 @@ class PopoverMenu {
|
|
|
15203
16065
|
* If `true`, the popover menu will be displayed.
|
|
15204
16066
|
*/
|
|
15205
16067
|
this.open = undefined;
|
|
16068
|
+
/**
|
|
16069
|
+
* If `always`, the popover menu will close when any menu item is clicked. If `toggle`, the popover menu will close when a non-toggle menu item is clicked. If `never`, the popover menu will not close when any menu item is clicked.
|
|
16070
|
+
*/
|
|
16071
|
+
this.closeOnItemSelect = "always";
|
|
15206
16072
|
this.setButtonFocus = () => {
|
|
15207
16073
|
var _a;
|
|
15208
16074
|
(_a = this.popoverMenuEls[this.currentFocus]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -15223,8 +16089,11 @@ class PopoverMenu {
|
|
|
15223
16089
|
return anchorElement;
|
|
15224
16090
|
};
|
|
15225
16091
|
this.isNotPopoverMenuEl = (ev) => {
|
|
15226
|
-
const
|
|
15227
|
-
|
|
16092
|
+
const target = ev.target;
|
|
16093
|
+
const { id, tagName } = target;
|
|
16094
|
+
const isAnchor = this.anchorEl && target === this.anchorEl;
|
|
16095
|
+
return (!isAnchor &&
|
|
16096
|
+
id !== this.anchor &&
|
|
15228
16097
|
tagName !== "IC-MENU-ITEM" &&
|
|
15229
16098
|
tagName !== "IC-MENU-GROUP" &&
|
|
15230
16099
|
tagName !== "IC-POPOVER-MENU");
|
|
@@ -15261,7 +16130,16 @@ class PopoverMenu {
|
|
|
15261
16130
|
}
|
|
15262
16131
|
};
|
|
15263
16132
|
this.getMenuAriaLabel = () => {
|
|
15264
|
-
|
|
16133
|
+
let ariaLabel = this.el.getAttribute(this.ARIA_LABEL);
|
|
16134
|
+
if (ariaLabel) {
|
|
16135
|
+
this.menuAriaLabel = ariaLabel;
|
|
16136
|
+
this.el.removeAttribute(this.ARIA_LABEL);
|
|
16137
|
+
}
|
|
16138
|
+
else if (this.menuAriaLabel) {
|
|
16139
|
+
ariaLabel = this.menuAriaLabel;
|
|
16140
|
+
}
|
|
16141
|
+
if (!ariaLabel)
|
|
16142
|
+
return null;
|
|
15265
16143
|
if (isPropDefined(this.submenuId)) {
|
|
15266
16144
|
return `${ariaLabel}, within nested level ${this.submenuLevel} ${this.parentLabel} submenu,`;
|
|
15267
16145
|
}
|
|
@@ -15275,8 +16153,10 @@ class PopoverMenu {
|
|
|
15275
16153
|
this.open = false;
|
|
15276
16154
|
};
|
|
15277
16155
|
this.initPopperJS = () => {
|
|
16156
|
+
var _a;
|
|
16157
|
+
const popoverMenu = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".ic-popover-menu");
|
|
15278
16158
|
if (this.anchorEl) {
|
|
15279
|
-
this.popperInstance = createPopper(this.anchorEl,
|
|
16159
|
+
this.popperInstance = createPopper(this.anchorEl, popoverMenu, Object.assign({ strategy: this.fixedPositioning ? "fixed" : "absolute", placement: "bottom-start", modifiers: [
|
|
15280
16160
|
{
|
|
15281
16161
|
name: "offset",
|
|
15282
16162
|
options: {
|
|
@@ -15347,7 +16227,13 @@ class PopoverMenu {
|
|
|
15347
16227
|
this.watchOpenHandler();
|
|
15348
16228
|
}
|
|
15349
16229
|
componentWillRender() {
|
|
15350
|
-
|
|
16230
|
+
const slottedAnchor = this.el.querySelector('[slot="anchor"]');
|
|
16231
|
+
if (slottedAnchor) {
|
|
16232
|
+
this.anchorEl = slottedAnchor;
|
|
16233
|
+
}
|
|
16234
|
+
else {
|
|
16235
|
+
this.anchorEl = this.findAnchorEl(this.anchor);
|
|
16236
|
+
}
|
|
15351
16237
|
}
|
|
15352
16238
|
componentDidRender() {
|
|
15353
16239
|
if (this.open && !this.popperInstance) {
|
|
@@ -15356,6 +16242,13 @@ class PopoverMenu {
|
|
|
15356
16242
|
}
|
|
15357
16243
|
handleMenuItemClick(ev) {
|
|
15358
16244
|
if (!ev.detail.submenuTriggerFor && ev.detail.label !== "Back") {
|
|
16245
|
+
if (this.closeOnItemSelect === "never" ||
|
|
16246
|
+
(ev.detail.variant === "toggle" &&
|
|
16247
|
+
this.closeOnItemSelect === "toggle") ||
|
|
16248
|
+
ev.detail.closeMenuOnSelect === false) {
|
|
16249
|
+
this.currentFocus = this.popoverMenuEls.findIndex((menuItem) => menuItem === ev.detail);
|
|
16250
|
+
return;
|
|
16251
|
+
}
|
|
15359
16252
|
this.closeMenu(false, ev.detail);
|
|
15360
16253
|
}
|
|
15361
16254
|
}
|
|
@@ -15451,17 +16344,19 @@ class PopoverMenu {
|
|
|
15451
16344
|
this.popperProps = props;
|
|
15452
16345
|
}
|
|
15453
16346
|
render() {
|
|
15454
|
-
return (hAsync(Host, { key: '
|
|
15455
|
-
["ic-popover-menu-open"]: !!this.open,
|
|
16347
|
+
return (hAsync(Host, { key: 'b664e4a0944016c88fe19232ea7b1cf2fa65cbd9', class: {
|
|
15456
16348
|
[`ic-theme-${this.theme}`]: this.theme !== "inherit",
|
|
15457
|
-
} }, hAsync("
|
|
16349
|
+
} }, isSlotUsed(this.el, "anchor") && hAsync("slot", { key: '978425aac1a58c1f19ad59e8ebe9869492fe8a5d', name: "anchor" }), hAsync("div", { key: 'c36a21a4f9913deebed1c418ce4c85995fa49054', class: {
|
|
16350
|
+
["ic-popover-menu"]: true,
|
|
16351
|
+
["ic-popover-menu-open"]: !!this.open,
|
|
16352
|
+
} }, hAsync("div", { key: '5e54d43f8699270ea59ee2d408d099e73b51a5e0', id: this.parentPopover === undefined
|
|
15458
16353
|
? `ic-popover-submenu-${this.submenuId}`
|
|
15459
16354
|
: "", class: {
|
|
15460
16355
|
menu: true,
|
|
15461
|
-
} }, hAsync("span", { key: '
|
|
16356
|
+
} }, hAsync("span", { key: '50b901cdd6ce1c6e51839cdacb61034f45972a3a', class: {
|
|
15462
16357
|
"opening-from-parent": this.openingFromParent,
|
|
15463
16358
|
"opening-from-child": this.openingFromChild,
|
|
15464
|
-
} }, isPropDefined(this.submenuId) && (hAsync("span", { key: '
|
|
16359
|
+
} }, isPropDefined(this.submenuId) && (hAsync("span", { key: 'b152354aff6888ea5dd18850fb7ce40f3e7d975c' }, hAsync("span", { key: 'b7f43d96c7980573f740ff5d6495aa5416b6b89c', role: "menu" }, hAsync("ic-menu-item", { key: '62eb52181ef3b9c647573202a90940f3f90b2b1f', class: "ic-popover-submenu-back-button", ref: (el) => (this.backButton = el), label: "Back", onClick: this.handleBackButtonClick, id: `ic-popover-submenu-back-button-${this.submenuLevel}` }, hAsync("svg", { key: 'ea5fe2b6bedb7a97c146e9bf19f0c4538bcd7cc4', slot: "icon", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "submenu-back-icon" }, hAsync("path", { key: '57795916b6c3026915b4b166647512bc7b2571e0', d: "M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z", fill: "currentColor" })))), hAsync("ic-typography", { key: 'c6b1a275a79f431eb9c32b8b811302c2bc7e86a2', variant: "subtitle-small", class: "parent-label" }, this.parentLabel))), hAsync("div", { key: 'a227dd549ab5bc60aad95d62d4ab8a13fdd4e46f', class: "menu-body", "aria-label": this.getMenuAriaLabel(), role: "menu" }, hAsync("slot", { key: '5f991353095b3d406ff76d101be9c72dd1ff26b7' })))))));
|
|
15465
16360
|
}
|
|
15466
16361
|
static get delegatesFocus() { return true; }
|
|
15467
16362
|
get el() { return getElement(this); }
|
|
@@ -15481,6 +16376,7 @@ class PopoverMenu {
|
|
|
15481
16376
|
"submenuLevel": [2, "submenu-level"],
|
|
15482
16377
|
"theme": [1],
|
|
15483
16378
|
"open": [1540],
|
|
16379
|
+
"closeOnItemSelect": [1, "close-on-item-select"],
|
|
15484
16380
|
"openingFromChild": [32],
|
|
15485
16381
|
"openingFromParent": [32],
|
|
15486
16382
|
"popperProps": [32],
|
|
@@ -15967,11 +16863,6 @@ class RadioOption {
|
|
|
15967
16863
|
}; }
|
|
15968
16864
|
}
|
|
15969
16865
|
|
|
15970
|
-
var clearIcon = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
15971
|
-
<path d="M15.8327 5.34199L14.6577 4.16699L9.99935 8.82533L5.34102 4.16699L4.16602 5.34199L8.82435 10.0003L4.16602 14.6587L5.34102 15.8337L9.99935 11.1753L14.6577 15.8337L15.8327 14.6587L11.1743 10.0003L15.8327 5.34199Z" fill="currentColor"/>
|
|
15972
|
-
</svg>
|
|
15973
|
-
`;
|
|
15974
|
-
|
|
15975
16866
|
var searchIcon = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
15976
16867
|
<path d="M13.1292 11.8792H12.4708L12.2375 11.6542C13.0542 10.7042 13.5458 9.47083 13.5458 8.12916C13.5458 5.13749 11.1208 2.71249 8.12916 2.71249C5.13749 2.71249 2.71249 5.13749 2.71249 8.12916C2.71249 11.1208 5.13749 13.5458 8.12916 13.5458C9.47083 13.5458 10.7042 13.0542 11.6542 12.2375L11.8792 12.4708V13.1292L16.0458 17.2875L17.2875 16.0458L13.1292 11.8792ZM8.12916 11.8792C6.05416 11.8792 4.37916 10.2042 4.37916 8.12916C4.37916 6.05416 6.05416 4.37916 8.12916 4.37916C10.2042 4.37916 11.8792 6.05416 11.8792 8.12916C11.8792 10.2042 10.2042 11.8792 8.12916 11.8792Z" fill="currentColor"/>
|
|
15977
16868
|
</svg>`;
|
|
@@ -16533,7 +17424,7 @@ class SearchBar {
|
|
|
16533
17424
|
} }, hAsync("ic-button", { key: 'd0a3c5b6288c249ba8be2a4bcbbd2a33f1a30025', id: "clear-button", class: {
|
|
16534
17425
|
"clear-button": true,
|
|
16535
17426
|
"clear-button-unfocused": !clearButtonFocused,
|
|
16536
|
-
}, "aria-label": "Clear", innerHTML:
|
|
17427
|
+
}, "aria-label": "Clear", innerHTML: closeIcon, onClick: this.handleClear, onMouseDown: this.handleMouseDown, size: size, onFocus: this.handleFocusClearButton, onBlur: this.handleClearBlur, onKeyDown: this.handleClear, type: "button", variant: "icon-tertiary", theme: clearButtonFocused ? "light" : "dark" }), hAsync("div", { key: '3965e828aba0dd8f88051ec717c7fafcb237a271', class: "divider" })), hAsync("div", { key: 'c143dbc227dce558f5f87e1e2f7e3a014b9d250c', class: {
|
|
16537
17428
|
"search-submit-button-container": true,
|
|
16538
17429
|
"search-submit-button-disabled": this.isSubmitDisabled(),
|
|
16539
17430
|
} }, hAsync("ic-button", { key: '98e79886a69703ab39c8d6f5f97c147fb406870d', id: "search-submit-button", "aria-label": "Search", ref: (el) => (this.searchSubmitButton = el), class: {
|
|
@@ -16633,12 +17524,12 @@ class SectionContainer {
|
|
|
16633
17524
|
}
|
|
16634
17525
|
render() {
|
|
16635
17526
|
const { aligned, fullHeight } = this;
|
|
16636
|
-
return (hAsync(Host, { key: '
|
|
17527
|
+
return (hAsync(Host, { key: '0a16e4a8d03980586c8487b21a2933b69d0cdda5', class: {
|
|
16637
17528
|
["aligned-left"]: aligned === "left" || aligned === null,
|
|
16638
17529
|
["aligned-center"]: aligned === "center",
|
|
16639
17530
|
["aligned-full-width"]: aligned === "full-width",
|
|
16640
17531
|
["no-vertical-padding"]: !!fullHeight,
|
|
16641
|
-
} }, hAsync("slot", { key: '
|
|
17532
|
+
} }, hAsync("slot", { key: 'be7133e0e0c321e7998d99d76834e50f15dea0d5' })));
|
|
16642
17533
|
}
|
|
16643
17534
|
static get style() { return IcSectionContainerStyle0; }
|
|
16644
17535
|
static get cmpMeta() { return {
|
|
@@ -17949,11 +18840,11 @@ class Skeleton {
|
|
|
17949
18840
|
width: el.style.width || width || DEFAULT_WIDTHS[variant],
|
|
17950
18841
|
}
|
|
17951
18842
|
: undefined;
|
|
17952
|
-
return (hAsync(Host, { key: '
|
|
18843
|
+
return (hAsync(Host, { key: 'af96b9a43dfb19241c8bbdd5766f9c161060f0ec', class: {
|
|
17953
18844
|
skeleton: true,
|
|
17954
18845
|
"ic-skeleton-circle": variant === "circle",
|
|
17955
18846
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
17956
|
-
}, style: style, "aria-disabled": "true" }, hAsync("slot", { key: '
|
|
18847
|
+
}, style: style, "aria-disabled": "true" }, hAsync("slot", { key: 'b969c0a541cfa1c00543f614220d2eac7e98bc0f' })));
|
|
17957
18848
|
}
|
|
17958
18849
|
get el() { return getElement(this); }
|
|
17959
18850
|
static get style() { return IcSkeletonStyle0; }
|
|
@@ -18012,9 +18903,9 @@ class SkipLink {
|
|
|
18012
18903
|
}
|
|
18013
18904
|
render() {
|
|
18014
18905
|
const { fullWidth, inline, label, monochrome, target, theme, transparentBackground, } = this;
|
|
18015
|
-
return (hAsync(Host, { key: '
|
|
18906
|
+
return (hAsync(Host, { key: 'd892c64907f8bdcc7d793e0f07eab510d5d88921', class: {
|
|
18016
18907
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
18017
|
-
} }, hAsync("ic-link", { key: '
|
|
18908
|
+
} }, hAsync("ic-link", { key: 'af5685af2563e68b9f84db45d39b84ba97fa80e8', class: {
|
|
18018
18909
|
"display-top": !inline,
|
|
18019
18910
|
"full-width": !!fullWidth,
|
|
18020
18911
|
"show-background": !transparentBackground,
|
|
@@ -18079,12 +18970,12 @@ class StatusTag {
|
|
|
18079
18970
|
}
|
|
18080
18971
|
render() {
|
|
18081
18972
|
const { label, status, variant, size, announced, theme, uppercase } = this;
|
|
18082
|
-
return (hAsync(Host, { key: '
|
|
18973
|
+
return (hAsync(Host, { key: 'c8599ea4942bb14073e77f10f4a0a0fbf39e9930', class: { [`ic-theme-${theme}`]: theme !== "inherit" }, role: announced ? "status" : null, "aria-label": "Status" }, hAsync("strong", { key: '7e2ec2e04c901980e1171373a9b671b75b6a7d07', class: {
|
|
18083
18974
|
["tag"]: true,
|
|
18084
18975
|
[`${variant}-${status}`]: true,
|
|
18085
18976
|
["outlined"]: variant === "outlined",
|
|
18086
18977
|
[`${size}`]: true,
|
|
18087
|
-
} }, hAsync("ic-typography", { key: '
|
|
18978
|
+
} }, hAsync("ic-typography", { key: '060d641be483e3f6406ef415931f5cebdb8da2c8', variant: uppercase ? "label-uppercase" : "label", "apply-vertical-margins": false }, hAsync("span", { key: '4e78eb5d8af2fdcb5b4d083ad0cb1adc4b61ec0e' }, label)))));
|
|
18088
18979
|
}
|
|
18089
18980
|
static get style() { return IcStatusTagStyle0; }
|
|
18090
18981
|
static get cmpMeta() { return {
|
|
@@ -18188,27 +19079,27 @@ class Step {
|
|
|
18188
19079
|
// STATUS ICON FOR COMPACT STEP
|
|
18189
19080
|
let statusIcon;
|
|
18190
19081
|
if (type === "completed" || compactStepStyling === "completed") {
|
|
18191
|
-
statusIcon = (hAsync("span", { key: '
|
|
19082
|
+
statusIcon = (hAsync("span", { key: 'b90ba4eba47bd4dda8a547010d3e701f07e96ff1', class: "check-icon step-icon", "aria-hidden": "true", innerHTML: checkIcon }));
|
|
18192
19083
|
}
|
|
18193
19084
|
else if (type === "disabled" || compactStepStyling === "disabled") {
|
|
18194
|
-
statusIcon = (hAsync("span", { key: '
|
|
19085
|
+
statusIcon = (hAsync("span", { key: '46566361dcad0d5a29ad7f28fe2224f5ac813152', class: "warning-icon step-icon", "aria-hidden": "true", innerHTML: warningIcon }));
|
|
18195
19086
|
}
|
|
18196
19087
|
// COMPACT STEP COMPONENT
|
|
18197
|
-
const compactStep = (hAsync("div", { key: '
|
|
19088
|
+
const compactStep = (hAsync("div", { key: 'f5f4f7d6a4923975cb16a023a128e948f6af8d37', class: {
|
|
18198
19089
|
["step"]: true,
|
|
18199
19090
|
["current"]: !!current,
|
|
18200
19091
|
[`compact-step-${compactStepStyling}`]: !!compactStepStyling,
|
|
18201
19092
|
["disabled"]: type === "disabled" || compactStepStyling === "disabled",
|
|
18202
|
-
} }, hAsync("ic-loading-indicator", { key: '
|
|
19093
|
+
} }, hAsync("ic-loading-indicator", { key: '9c68a687dfe74aef9d5402a22b849be5adde9e9e', class: {
|
|
18203
19094
|
"compact-step-progress-indicator": true,
|
|
18204
19095
|
"not-required": type === "disabled" || compactStepStyling === "disabled",
|
|
18205
|
-
}, "aria-hidden": "true", size: "small", "inner-label": stepNum, progress: progress }), hAsync("div", { key: '
|
|
19096
|
+
}, "aria-hidden": "true", size: "small", "inner-label": stepNum, progress: progress }), hAsync("div", { key: 'e084007d227386e58d9f709bc5c2cf7b4a316626', class: "heading-area" }, isSlotUsed(this.el, "heading") ? (hAsync("slot", { name: "heading" })) : (hAsync("ic-typography", { variant: "h4", class: "heading" }, heading)), hAsync("div", { key: '4010df0644f1cffe57f8f34bf165ede6743836b9', class: "info-line" }, hAsync("ic-typography", { key: 'cd19369014430c710590a2e8feba86224022444e', variant: "caption", class: "step-num" }, `${stepNum} ${icI18n.of} ${lastStepNum}`, hAsync("span", { key: '75135b7a00db90e483ad6dcfdd624cc3f8e90202', class: "visually-hidden" }, ` ${icI18n.steps}`)), (this.subheading ||
|
|
18206
19097
|
type === "completed" ||
|
|
18207
19098
|
type === "disabled" ||
|
|
18208
19099
|
(this.variant === "compact" &&
|
|
18209
19100
|
!!compactStepStyling &&
|
|
18210
19101
|
compactStepStyling !== "active") ||
|
|
18211
|
-
!!status) && (hAsync("div", { key: '
|
|
19102
|
+
!!status) && (hAsync("div", { key: 'adeabd1fd1668c0689ccba491b17579d5491dc2d', class: "step-status" }, statusIcon !== undefined && statusIcon, (subheading || stepType) && (hAsync("ic-typography", { key: 'f3454673badfbbdd1b5e15e92902050c51a2b07b', variant: "caption" }, subheading !== null && isPropDefined(subheading)
|
|
18212
19103
|
? subheading
|
|
18213
19104
|
: type === "disabled" ||
|
|
18214
19105
|
(variant === "compact" &&
|
|
@@ -18221,26 +19112,26 @@ class Step {
|
|
|
18221
19112
|
// ICON FOR DEFAULT STEP
|
|
18222
19113
|
let icon;
|
|
18223
19114
|
if (type !== "completed") {
|
|
18224
|
-
icon = (hAsync("ic-typography", { key: '
|
|
19115
|
+
icon = (hAsync("ic-typography", { key: '44128ff95829366b8b12045763fdb2a5aea9e21b', variant: "subtitle-small" }, hAsync("span", { key: 'd3bacdb5ba89356a38cd92470eb84272a3996fde', class: "step-icon-inner", "aria-hidden": "true" }, this.stepNum)));
|
|
18225
19116
|
}
|
|
18226
19117
|
else {
|
|
18227
|
-
icon = (hAsync("div", { key: '
|
|
19118
|
+
icon = (hAsync("div", { key: 'fb984a7273ba46b3fdc088349e9fce02b8f3d586', class: "step-icon-inner", "aria-hidden": "true" }, hAsync("span", { key: '510ba94dc70ec87727f9d2cdc603e032c22922ce', class: "check-icon", innerHTML: checkIcon })));
|
|
18228
19119
|
}
|
|
18229
19120
|
// STEP CONNECT FOR DEFAULT STEP
|
|
18230
|
-
const partialBar = type === "current" && (hAsync("div", { key: '
|
|
18231
|
-
const finalStep = !lastStep && (hAsync("div", { key: '
|
|
19121
|
+
const partialBar = type === "current" && (hAsync("div", { key: '4b5eff7f3e115a8416a0d7b57780e1cab7681058', class: "step-connect-inner" }));
|
|
19122
|
+
const finalStep = !lastStep && (hAsync("div", { key: 'e3550d0d527981b7e455d7f2c36ad925f551bde2', class: {
|
|
18232
19123
|
["step-connect"]: true,
|
|
18233
19124
|
["aligned-full-width"]: !!(((_a = this.el.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains("ic-stepper-default")) &&
|
|
18234
19125
|
!this.el.parentElement.classList.contains("ic-stepper-aligned-left")),
|
|
18235
19126
|
} }, partialBar));
|
|
18236
19127
|
// DEFAULT STEP COMPONENT
|
|
18237
|
-
const defaultStep = (hAsync("div", { key: '
|
|
19128
|
+
const defaultStep = (hAsync("div", { key: '244453c9e732a101832a953a438c93322e2e0e09', class: {
|
|
18238
19129
|
["step"]: true,
|
|
18239
19130
|
[`${type}`]: true,
|
|
18240
|
-
} }, hAsync("div", { key: '
|
|
19131
|
+
} }, hAsync("div", { key: '65bed254efe5970c3c115d18cd60f597670ce6b0', class: "step-top" }, hAsync("div", { key: 'a8e79bfa9ded3a224d634a30062799611ff654ff', class: "step-icon" }, icon), finalStep), (hasHeading || subheading || status) && (hAsync("div", { key: '526d11252e72905887bf6fbfd0a40efdb3a15f60', class: "heading-area" }, isSlotUsed(this.el, "heading") ? (hAsync("slot", { name: "heading" })) : (hAsync("ic-typography", { variant: "subtitle-large", class: "heading" }, heading)), hasHeading && (subheading || status) && (hAsync("ic-typography", { key: '13c8779c38422f01ad9b1b38acf224fcb85a0767', variant: "caption", class: "subheading" }, subheading !== null && isPropDefined(subheading)
|
|
18241
19132
|
? subheading
|
|
18242
19133
|
: stepStatus))))));
|
|
18243
|
-
return (hAsync(Host, { key: '
|
|
19134
|
+
return (hAsync(Host, { key: '92aa3a74f7b073e325a21c446b7d4cce619b9dea', role: "listitem", "aria-label": `${icI18n.step} ${stepNum}${ariaLabel}`, "aria-current": (current || type === "current") && "step", class: {
|
|
18244
19135
|
["aligned-full-width"]: !!(((_b = this.el.parentElement) === null || _b === void 0 ? void 0 : _b.classList.contains("ic-stepper-default")) &&
|
|
18245
19136
|
!this.el.parentElement.classList.contains("ic-stepper-aligned-left")),
|
|
18246
19137
|
[`ic-step-${variant}`]: true,
|
|
@@ -18560,11 +19451,11 @@ class Stepper {
|
|
|
18560
19451
|
checkResizeObserver(this.runResizeObserver);
|
|
18561
19452
|
}
|
|
18562
19453
|
render() {
|
|
18563
|
-
return (hAsync(Host, { key: '
|
|
19454
|
+
return (hAsync(Host, { key: '43ebd8034b0dc4cad15543c27a8c668b9e7326af', class: {
|
|
18564
19455
|
[`ic-stepper-${this.variant}`]: true,
|
|
18565
19456
|
["ic-stepper-aligned-left"]: this.variant === "default" && this.aligned === "left",
|
|
18566
19457
|
[`ic-theme-${this.theme}`]: this.theme !== "inherit",
|
|
18567
|
-
} }, hAsync("ul", { key: '
|
|
19458
|
+
} }, hAsync("ul", { key: '8952857df3eb9fef64eb467ee2c89c78672b9c22', class: "step-item-list" }, hAsync("slot", { key: 'e22c1e35f0679a1caf67c1552ea3534932c76949' }))));
|
|
18568
19459
|
}
|
|
18569
19460
|
get el() { return getElement(this); }
|
|
18570
19461
|
static get watchers() { return {
|
|
@@ -18694,15 +19585,15 @@ class Switch {
|
|
|
18694
19585
|
render() {
|
|
18695
19586
|
const { label, checkedState, size, disabled, name, value, hideLabel, helperText, inputId, theme, } = this;
|
|
18696
19587
|
renderHiddenInput(this.el, checkedState ? value : "", name, disabled);
|
|
18697
|
-
return (hAsync(Host, { key: '
|
|
19588
|
+
return (hAsync(Host, { key: '85b905e7a3d8cb86e6d61ef5b54f330f50c2d3c1', class: {
|
|
18698
19589
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
18699
|
-
} }, hAsync("label", { key: '
|
|
19590
|
+
} }, hAsync("label", { key: '9e22110d5b1de8c730a24ca2149ae7b6e5d74c82', class: {
|
|
18700
19591
|
"ic-switch-container": true,
|
|
18701
19592
|
"ic-switch-disabled": !!disabled,
|
|
18702
19593
|
[`ic-switch-${size}`]: true,
|
|
18703
|
-
}, htmlFor: inputId }, !hideLabel && (hAsync("ic-input-label", { key: '
|
|
19594
|
+
}, htmlFor: inputId }, !hideLabel && (hAsync("ic-input-label", { key: '7bdf109dc8ba30c4112d21ce8f8bdab24712b2cc', for: inputId, label: label, helperText: helperText, readonly: false, disabled: disabled, class: {
|
|
18704
19595
|
"ic-switch-label": true,
|
|
18705
|
-
} }, hAsync("slot", { key: '
|
|
19596
|
+
} }, hAsync("slot", { key: '1f3f4de4efbc6cdd0b5b0306ff27ac8780e1e47f', name: "helper-text", slot: "helper-text" }))), !hideLabel && hAsync("span", { key: '86baca2c69733b230b44b1bdc7e77abbf0cea409', class: "ic-switch-line-break" }), hAsync("input", { key: '001d2c6d58ded2aa77dcb5f6d2a80e2a8cdb3524', checked: checkedState, disabled: disabled, "aria-label": label, "aria-checked": checkedState ? "true" : "false", "aria-describedby": getInputDescribedByText(this.el, inputId, helperText !== "", false), role: "switch", class: "ic-switch-input", type: "checkbox", name: "toggle", id: inputId, onFocus: this.onFocus, onBlur: this.onBlur, onChange: this.handleChange }), hAsync("span", { key: 'bc1e5f01e53597a87540a46caff33e9ffed4ff0f', class: "ic-switch-toggle" }, hAsync("span", { key: 'ba85178e18aae2eb3e194cebb753e7b8897ed82e', class: "ic-switch-icon-line", "aria-hidden": "true" }), hAsync("svg", { key: '8de43ad4d2131a4baca546ff67d5be97e023f7a5', class: "ic-switch-icon", "aria-hidden": "true", focusable: "false", viewBox: "0 0 8 8", xmlns: "http://www.w3.org/2000/svg", fill: "none" }, hAsync("circle", { key: '094881005f0b9d3141fdad8396dac30d6a275f66', class: "ic-switch-icon-circle", fill: "none", cx: "4", cy: "4", r: "3.5", "vector-effect": "non-scaling-stroke" }))), hAsync("slot", { key: '432b56eaca3fb21d04bd97e3faec9241959aee25', name: "right-adornment" }))));
|
|
18706
19597
|
}
|
|
18707
19598
|
static get delegatesFocus() { return true; }
|
|
18708
19599
|
get el() { return getElement(this); }
|
|
@@ -19087,7 +19978,7 @@ class TabContext {
|
|
|
19087
19978
|
}
|
|
19088
19979
|
}
|
|
19089
19980
|
render() {
|
|
19090
|
-
return hAsync("slot", { key: '
|
|
19981
|
+
return hAsync("slot", { key: 'f2db3869afceb11de996c0f653c07951c7305e5d' });
|
|
19091
19982
|
}
|
|
19092
19983
|
get el() { return getElement(this); }
|
|
19093
19984
|
static get watchers() { return {
|
|
@@ -19134,11 +20025,11 @@ class TabGroup {
|
|
|
19134
20025
|
}
|
|
19135
20026
|
render() {
|
|
19136
20027
|
const { inline, theme, label, monochrome } = this;
|
|
19137
|
-
return (hAsync(Host, { key: '
|
|
20028
|
+
return (hAsync(Host, { key: '746c326f525b2691bfb8b9e9f791ed31f8a81294', role: "tablist", "aria-label": label, class: {
|
|
19138
20029
|
["ic-tab-group-inline"]: !!inline,
|
|
19139
20030
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
19140
20031
|
["ic-tab-group-monochrome"]: !!monochrome,
|
|
19141
|
-
} }, hAsync("ic-horizontal-scroll", { key: '
|
|
20032
|
+
} }, hAsync("ic-horizontal-scroll", { key: '1320fc43a99bceeda1f8e96951b5a418223e16f5', theme: theme, "focus-trigger": "tabFocus", monochrome: monochrome }, hAsync("div", { key: '496f3884e5247d4beeabe7bb76e99bd3d00119a5', class: "tabs-container" }, hAsync("slot", { key: '06c43c2548f716780e1f91feace9740ddb87381b' })))));
|
|
19142
20033
|
}
|
|
19143
20034
|
static get delegatesFocus() { return true; }
|
|
19144
20035
|
static get style() { return IcTabGroupStyle0; }
|
|
@@ -19181,10 +20072,10 @@ class TabPanel {
|
|
|
19181
20072
|
}
|
|
19182
20073
|
render() {
|
|
19183
20074
|
const { active, theme } = this;
|
|
19184
|
-
return (hAsync(Host, { key: '
|
|
20075
|
+
return (hAsync(Host, { key: '502d4cbb643330e279c6afde8c450b2dc779c1bd', class: {
|
|
19185
20076
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
19186
20077
|
"ic-tab-panel-hidden": !active,
|
|
19187
|
-
}, role: "tabpanel", "aria-hidden": `${!active}` }, hAsync("div", { key: '
|
|
20078
|
+
}, role: "tabpanel", "aria-hidden": `${!active}` }, hAsync("div", { key: '190467658b87437167436d21350a69f33950666d' }, hAsync("slot", { key: '17420f5488493a8ce0e3ad31dca3f1bb3a78722e' }))));
|
|
19188
20079
|
}
|
|
19189
20080
|
get el() { return getElement(this); }
|
|
19190
20081
|
static get style() { return IcTabPanelStyle0; }
|
|
@@ -19755,7 +20646,7 @@ class Theme {
|
|
|
19755
20646
|
}
|
|
19756
20647
|
render() {
|
|
19757
20648
|
const { themeClass } = this;
|
|
19758
|
-
return (hAsync(Host, { key: '
|
|
20649
|
+
return (hAsync(Host, { key: '5f64aa19e0ea1f3762574949daabfd2ad9f99054', class: themeClass }, hAsync("slot", { key: '3f115261b958d3c4287b95fc80564b7f0788fd04' })));
|
|
19759
20650
|
}
|
|
19760
20651
|
static get watchers() { return {
|
|
19761
20652
|
"brandColor": ["watchBrandColorPropHandler"],
|
|
@@ -19985,20 +20876,20 @@ class Toast {
|
|
|
19985
20876
|
}
|
|
19986
20877
|
render() {
|
|
19987
20878
|
const { variant, heading, message, visible, isManual, dismissButtonAriaLabel, theme, } = this;
|
|
19988
|
-
return (hAsync(Host, { key: '
|
|
20879
|
+
return (hAsync(Host, { key: 'cef80fb621cd0b6201b4b2d5fd851e4a498d5142', class: {
|
|
19989
20880
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
19990
20881
|
["ic-toast-hidden"]: !visible,
|
|
19991
20882
|
[`ic-toast-variant-${variant}`]: variant !== undefined,
|
|
19992
|
-
}, tabindex: "0", onFocus: this.onFocus, onBlur: this.onBlur, role: isManual ? "dialog" : "alert", "aria-live": isManual ? null : "polite" }, hAsync("div", { key: '
|
|
20883
|
+
}, tabindex: "0", onFocus: this.onFocus, onBlur: this.onBlur, role: isManual ? "dialog" : "alert", "aria-live": isManual ? null : "polite" }, hAsync("div", { key: '10abf5970e3c5db7db3045cc056afbcf5e8bbb13', class: {
|
|
19993
20884
|
["container"]: true,
|
|
19994
20885
|
[`container-${variant}`]: variant !== undefined,
|
|
19995
|
-
} }, variant && visible && (hAsync("div", { key: '
|
|
20886
|
+
} }, variant && visible && (hAsync("div", { key: '4924bda7ebc227ed24d396a7f3c4263b28a1a9e4', class: "toast-icon-container" }, hAsync("div", { key: '95c259f5a27fc76ce6e9cc613c06d82dd9042e51', class: {
|
|
19996
20887
|
["divider"]: true,
|
|
19997
20888
|
[`divider-${variant}`]: true,
|
|
19998
|
-
} }), variant === "neutral" ? (hAsync("slot", { name: "neutral-icon" })) : (hAsync("span", { class: "toast-icon", innerHTML: VARIANT_ICONS[variant].icon })))), hAsync("div", { key: '
|
|
20889
|
+
} }), variant === "neutral" ? (hAsync("slot", { name: "neutral-icon" })) : (hAsync("span", { class: "toast-icon", innerHTML: VARIANT_ICONS[variant].icon })))), hAsync("div", { key: '285745e35591ea6e756cd6e454bb85bf53ebe881', class: {
|
|
19999
20890
|
["toast-content"]: true,
|
|
20000
20891
|
["no-icon"]: variant === "neutral" && !isSlotUsed(this.el, "neutral-icon"),
|
|
20001
|
-
} }, hAsync("div", { key: '
|
|
20892
|
+
} }, hAsync("div", { key: 'dc166897b94413e2c3866eb0c0328d62cbf0f0a5', class: "toast-text" }, hAsync("ic-typography", { key: '26ea18b090584efff61a52b0f2f844a9c1cfef60', variant: "subtitle-large", class: "toast-heading" }, visible && (isManual ? hAsync("h5", null, heading) : hAsync("p", null, heading))), message && (hAsync("ic-typography", { key: 'd227ddebf0c720551df72337aeaebb072eb89bea', variant: "body", class: "toast-message" }, visible && hAsync("p", { key: '79847b1d2d0811d36fac74c91b581c4a9a61eb8c' }, message)))), isSlotUsed(this.el, "action") && (hAsync("div", { key: 'b5267c41c27c60988c3db05f7a3259b3df9243fb', class: "toast-action-container" }, hAsync("slot", { key: 'e4c2998404cfc36697eb6e47d981fe229d6941f5', name: "action" })))), !isManual ? (hAsync("ic-loading-indicator", { class: "toast-dismiss-timer", theme: "dark", monochrome: true, size: "icon", progress: this.timerProgress, description: "Dismiss timer" })) : (hAsync("ic-button", { id: "dismiss-button", innerHTML: closeIcon, onClick: this.dismissAction, variant: "icon-tertiary", "aria-label": dismissButtonAriaLabel })))));
|
|
20002
20893
|
}
|
|
20003
20894
|
get el() { return getElement(this); }
|
|
20004
20895
|
static get watchers() { return {
|
|
@@ -20071,7 +20962,7 @@ class ToastRegion {
|
|
|
20071
20962
|
}
|
|
20072
20963
|
}
|
|
20073
20964
|
render() {
|
|
20074
|
-
return hAsync("slot", { key: '
|
|
20965
|
+
return hAsync("slot", { key: 'fbf09e6464725a2f68a81254e49305ba33c88632' });
|
|
20075
20966
|
}
|
|
20076
20967
|
get el() { return getElement(this); }
|
|
20077
20968
|
static get watchers() { return {
|
|
@@ -20244,7 +21135,7 @@ class ToggleButton {
|
|
|
20244
21135
|
render() {
|
|
20245
21136
|
const { accessibleLabel, checked, disabled, fullWidth, iconPlacement, monochrome, label, loading, outline, size, theme, tooltipPlacement, variant, } = this;
|
|
20246
21137
|
const iconVariant = variant === "icon";
|
|
20247
|
-
return (hAsync(Host, { key: '
|
|
21138
|
+
return (hAsync(Host, { key: '51e7ef6d36426ee5d3d5e9d351cdc187ca33073b', class: {
|
|
20248
21139
|
"ic-toggle-button-checked": checked,
|
|
20249
21140
|
"ic-toggle-button-disabled": disabled,
|
|
20250
21141
|
"ic-toggle-button-icon": iconVariant,
|
|
@@ -20254,7 +21145,7 @@ class ToggleButton {
|
|
|
20254
21145
|
"ic-toggle-button-hide-outline": !outline,
|
|
20255
21146
|
[`ic-toggle-button-${size}`]: true,
|
|
20256
21147
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
20257
|
-
}, onFocus: this.handleFocus }, hAsync("ic-button", { key: '
|
|
21148
|
+
}, onFocus: this.handleFocus }, hAsync("ic-button", { key: '5cdffac929f622e9cb9f68223e19790b2d88d88b', "aria-pressed": `${checked}`, variant: iconVariant ? "icon-tertiary" : "secondary", onClick: this.handleClick, title: accessibleLabel, "aria-label": `${accessibleLabel ? accessibleLabel : label}, ${checked ? "ticked" : "unticked"}`, disabled: disabled, size: size, fullWidth: fullWidth, loading: loading, tooltipPlacement: tooltipPlacement }, !iconVariant && label, hAsync("slot", { key: 'a44c32ddde5e25fb5578fbbf401b2748383108c5' }), isSlotUsed(this.el, "icon") && (hAsync("slot", { key: '1c3d1b51c2d982329362451693fede634b3949fc', name: "icon", slot: `${iconPlacement}-icon` })), isSlotUsed(this.el, "badge") && (hAsync("slot", { key: 'bb1f9f00737980b895aee938af606246c2b667c5', name: "badge", slot: "badge" })))));
|
|
20258
21149
|
}
|
|
20259
21150
|
static get delegatesFocus() { return true; }
|
|
20260
21151
|
get el() { return getElement(this); }
|
|
@@ -20534,14 +21425,14 @@ class ToggleButtonGroup {
|
|
|
20534
21425
|
}
|
|
20535
21426
|
render() {
|
|
20536
21427
|
const { accessibleLabel, disabled, fullWidth, loading, monochrome, outline, theme, } = this;
|
|
20537
|
-
return (hAsync(Host, { key: '
|
|
21428
|
+
return (hAsync(Host, { key: 'ab56f2045174be8e5968420734bf6c8b9f5a256b', role: "group", "aria-label": accessibleLabel, tabindex: disabled ? -1 : 0, class: {
|
|
20538
21429
|
"ic-toggle-button-group-disabled": disabled,
|
|
20539
21430
|
"ic-toggle-button-group-full-width": fullWidth,
|
|
20540
21431
|
"ic-toggle-button-group-loading": loading,
|
|
20541
21432
|
"ic-toggle-button-group-monochrome": monochrome,
|
|
20542
21433
|
"ic-toggle-button-group-hide-outline": !outline,
|
|
20543
21434
|
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
20544
|
-
}, onFocus: this.handleHostFocus }, hAsync("slot", { key: '
|
|
21435
|
+
}, onFocus: this.handleHostFocus }, hAsync("slot", { key: 'fcc57106e303e056f7c2160808e174981978a665' })));
|
|
20545
21436
|
}
|
|
20546
21437
|
get el() { return getElement(this); }
|
|
20547
21438
|
static get watchers() { return {
|