@sankhyalabs/ezui 7.1.8 → 7.1.10
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/dist/cjs/ApplicationUtils-5cc05979.js.gz +0 -0
- package/dist/cjs/CSSVarsUtils-f20973d1.js.gz +0 -0
- package/dist/cjs/CheckMode-ecb90b87.js.gz +0 -0
- package/dist/cjs/DialogType-2114c337.js.gz +0 -0
- package/dist/cjs/EzScrollDirection-b2c99895.js.gz +0 -0
- package/dist/cjs/FocusResolver-885f2173.js.gz +0 -0
- package/dist/cjs/FormLayout-18853e70.js.gz +0 -0
- package/dist/cjs/RichToolbarHelper-ea12328f.js.gz +0 -0
- package/dist/cjs/_commonjsHelpers-537d719a.js.gz +0 -0
- package/dist/cjs/app-globals-2fbe4b17.js.gz +0 -0
- package/dist/cjs/constants-72b7e05e.js.gz +0 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-alert-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-alert.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-application.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-avatar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-badge.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-breadcrumb.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-calendar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-card-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-chart.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-check.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-chip.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-classic-combo-box.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-classic-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-classic-text-area.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-combo-box-list_4.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box-list_4.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +5 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-date-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-date-time-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-dialog.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-double-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-dropdown.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-empty-card.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-file-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-filter-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-form-view.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-form.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-grid-view.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-grid.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-guide-navigator.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-icon.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-link-builder_6.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-list-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-loading-bar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-modal-container.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-modal.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-number-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-pagination.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popover-core.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popover-plus_3.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popover.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-popup.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-progress-bar.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-radio-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-rich-toolbar-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-scroller_2.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-search-plus.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-search-result-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-search.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-skeleton.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-sortable-list.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-spinner.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-split-button.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-split-item.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-split-panel.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tabselector.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tag-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tag.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-text-area.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-text-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tile-medium.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tile.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-time-input.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-toast.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tooltip.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-tree.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-underface.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-upload.cjs.entry.js.gz +0 -0
- package/dist/cjs/ez-view-stack.cjs.entry.js.gz +0 -0
- package/dist/cjs/ezListHelper-0d3970b4.js.gz +0 -0
- package/dist/cjs/ezui.cjs.js.gz +0 -0
- package/dist/cjs/filter-column.cjs.entry.js +6 -1
- package/dist/cjs/filter-column.cjs.entry.js.gz +0 -0
- package/dist/cjs/floating-ui.dom.esm-f4d87617.js.gz +0 -0
- package/dist/cjs/index-1be40f19.js.gz +0 -0
- package/dist/cjs/index-a7b0c73d.js.gz +0 -0
- package/dist/cjs/index.cjs.js.gz +0 -0
- package/dist/cjs/loader.cjs.js.gz +0 -0
- package/dist/cjs/{purify-29cc6f77.js → purify-db11ac44.js} +856 -228
- package/dist/cjs/purify-db11ac44.js.gz +0 -0
- package/dist/cjs/search-column-316e2c59.js.gz +0 -0
- package/dist/cjs/searchFormatters-b7e1ed1e.js.gz +0 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.css.gz +0 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.js.gz +0 -0
- package/dist/collection/components/ez-alert/ez-alert.css.gz +0 -0
- package/dist/collection/components/ez-alert/ez-alert.js.gz +0 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.css.gz +0 -0
- package/dist/collection/components/ez-alert-list/ez-alert-list.js.gz +0 -0
- package/dist/collection/components/ez-application/ez-application.css.gz +0 -0
- package/dist/collection/components/ez-application/ez-application.js.gz +0 -0
- package/dist/collection/components/ez-avatar/ez-avatar.css.gz +0 -0
- package/dist/collection/components/ez-avatar/ez-avatar.js.gz +0 -0
- package/dist/collection/components/ez-badge/enum/sizes.js.gz +0 -0
- package/dist/collection/components/ez-badge/ez-badge.css.gz +0 -0
- package/dist/collection/components/ez-badge/ez-badge.js.gz +0 -0
- package/dist/collection/components/ez-badge/interfaces/IPosition.js.gz +0 -0
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.css.gz +0 -0
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.js.gz +0 -0
- package/dist/collection/components/ez-breadcrumb/subcomponents/breadcrumb-item.js.gz +0 -0
- package/dist/collection/components/ez-button/ez-button.css.gz +0 -0
- package/dist/collection/components/ez-button/ez-button.js.gz +0 -0
- package/dist/collection/components/ez-calendar/ez-calendar.css.gz +0 -0
- package/dist/collection/components/ez-calendar/ez-calendar.js.gz +0 -0
- package/dist/collection/components/ez-card-item/ez-card-item.css.gz +0 -0
- package/dist/collection/components/ez-card-item/ez-card-item.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/BarChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/ColumnChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/DonutChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/LineChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/PieChart.js.gz +0 -0
- package/dist/collection/components/ez-chart/components/index.js.gz +0 -0
- package/dist/collection/components/ez-chart/ez-chart.css.gz +0 -0
- package/dist/collection/components/ez-chart/ez-chart.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartAxis.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartContext.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartOptions.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartSerie.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartType.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/ChartTypeValue.js.gz +0 -0
- package/dist/collection/components/ez-chart/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-chart/test/mock-chart.js.gz +0 -0
- package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js.gz +0 -0
- package/dist/collection/components/ez-check/CheckMode.js.gz +0 -0
- package/dist/collection/components/ez-check/ez-check.css.gz +0 -0
- package/dist/collection/components/ez-check/ez-check.js.gz +0 -0
- package/dist/collection/components/ez-chip/ez-chip.css.gz +0 -0
- package/dist/collection/components/ez-chip/ez-chip.js.gz +0 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.css.gz +0 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js.gz +0 -0
- package/dist/collection/components/ez-classic-combo-box/interfaces/IOption.js.gz +0 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.css.gz +0 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.js.gz +0 -0
- package/dist/collection/components/ez-classic-input/interfaces/optionsSetFocus.js.gz +0 -0
- package/dist/collection/components/ez-classic-input/utils/maskFormatter.js.gz +0 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.css.gz +0 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.js.gz +0 -0
- package/dist/collection/components/ez-classic-text-area/interfaces/optionsSetFocus.js.gz +0 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css.gz +0 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.css.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-list/ez-combo-box-list.js.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css.gz +0 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +5 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js.gz +0 -0
- package/dist/collection/components/ez-date-input/ez-date-input.css.gz +0 -0
- package/dist/collection/components/ez-date-input/ez-date-input.js.gz +0 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css.gz +0 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js.gz +0 -0
- package/dist/collection/components/ez-dialog/DialogType.js.gz +0 -0
- package/dist/collection/components/ez-dialog/ez-dialog.css.gz +0 -0
- package/dist/collection/components/ez-dialog/ez-dialog.js.gz +0 -0
- package/dist/collection/components/ez-double-list/doubleListHelper.js.gz +0 -0
- package/dist/collection/components/ez-double-list/ez-double-list.css.gz +0 -0
- package/dist/collection/components/ez-double-list/ez-double-list.js.gz +0 -0
- package/dist/collection/components/ez-dropdown/ez-dropdown.css.gz +0 -0
- package/dist/collection/components/ez-dropdown/ez-dropdown.js.gz +0 -0
- package/dist/collection/components/ez-dropdown/structure/DropdownItem.js.gz +0 -0
- package/dist/collection/components/ez-dropdown/structure/SubmenuControl.js.gz +0 -0
- package/dist/collection/components/ez-empty-card/ez-empty-card.css.gz +0 -0
- package/dist/collection/components/ez-empty-card/ez-empty-card.js.gz +0 -0
- package/dist/collection/components/ez-file-item/ez-file-item.css.gz +0 -0
- package/dist/collection/components/ez-file-item/ez-file-item.js.gz +0 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.css.gz +0 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.js.gz +0 -0
- package/dist/collection/components/ez-form/ez-form.css.gz +0 -0
- package/dist/collection/components/ez-form/ez-form.js.gz +0 -0
- package/dist/collection/components/ez-form/store/form.slice.js.gz +0 -0
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js.gz +0 -0
- package/dist/collection/components/ez-form-view/ez-form-view.css.gz +0 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/RichText.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-form-view/interfaces/IFormViewField.js.gz +0 -0
- package/dist/collection/components/ez-form-view/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-form-view/structure/index.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/EzGridController.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSourceInterceptor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRendererStatus.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/selectionHeader.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/GridEditorUtils.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IEditorMetadata.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellEditor.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/SearchPlus.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/mock/Server.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js.gz +0 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/utils/buildLocaleText.js.gz +0 -0
- package/dist/collection/components/ez-grid/ez-grid.css.gz +0 -0
- package/dist/collection/components/ez-grid/ez-grid.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/IColumnFilter.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/IGridMode.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/ISelection.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/ISelectionToastConfig.js.gz +0 -0
- package/dist/collection/components/ez-grid/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.css.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +6 -1
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/selection-counter.js.gz +0 -0
- package/dist/collection/components/ez-grid/subcomponents/utils/selectionCounterUtils.js.gz +0 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js.gz +0 -0
- package/dist/collection/components/ez-grid/utils/ColumnFilterManager.js.gz +0 -0
- package/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource.js.gz +0 -0
- package/dist/collection/components/ez-grid/utils/index.js.gz +0 -0
- package/dist/collection/components/ez-grid-view/ez-grid-view.css.gz +0 -0
- package/dist/collection/components/ez-grid-view/ez-grid-view.js.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.css.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/ez-guide-navigator.js.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/interfaces/IGuideItem.js.gz +0 -0
- package/dist/collection/components/ez-guide-navigator/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-icon/ez-icon.css.gz +0 -0
- package/dist/collection/components/ez-icon/ez-icon.js.gz +0 -0
- package/dist/collection/components/ez-list/ez-list.css.gz +0 -0
- package/dist/collection/components/ez-list/ez-list.js.gz +0 -0
- package/dist/collection/components/ez-list/ezListHelper.js.gz +0 -0
- package/dist/collection/components/ez-list-item/ez-list-item.css.gz +0 -0
- package/dist/collection/components/ez-list-item/ez-list-item.js.gz +0 -0
- package/dist/collection/components/ez-loading-bar/ez-loading-bar.css.gz +0 -0
- package/dist/collection/components/ez-loading-bar/ez-loading-bar.js.gz +0 -0
- package/dist/collection/components/ez-modal/ez-modal.css.gz +0 -0
- package/dist/collection/components/ez-modal/ez-modal.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.css.gz +0 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/index.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/modal-action.js.gz +0 -0
- package/dist/collection/components/ez-modal-container/modal-button-status.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.css.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IMultiSelectionOption.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/interfaces/IStaticOptionsFetchConfig.js.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.css.gz +0 -0
- package/dist/collection/components/ez-multi-selection-list/subcomponents/multi-selection-box-message.js.gz +0 -0
- package/dist/collection/components/ez-number-input/ez-number-input.css.gz +0 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js.gz +0 -0
- package/dist/collection/components/ez-pagination/ez-pagination.css.gz +0 -0
- package/dist/collection/components/ez-pagination/ez-pagination.js.gz +0 -0
- package/dist/collection/components/ez-popover/ez-popover.css.gz +0 -0
- package/dist/collection/components/ez-popover/ez-popover.js.gz +0 -0
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.css.gz +0 -0
- package/dist/collection/components/ez-popover-plus/ez-popover-plus.js.gz +0 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.css.gz +0 -0
- package/dist/collection/components/ez-popover-plus/subcomponent/ez-popover-core.js.gz +0 -0
- package/dist/collection/components/ez-popup/ez-popup.css.gz +0 -0
- package/dist/collection/components/ez-popup/ez-popup.js.gz +0 -0
- package/dist/collection/components/ez-popup/interfaces/EzButtonProps.js.gz +0 -0
- package/dist/collection/components/ez-progress-bar/ez-progress-bar.css.gz +0 -0
- package/dist/collection/components/ez-progress-bar/ez-progress-bar.js.gz +0 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.css.gz +0 -0
- package/dist/collection/components/ez-radio-button/ez-radio-button.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-link-builder/ez-link-builder.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-text.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-text.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/RichToolbarHelper.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-arrows/ez-rich-toolbar-arrows.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-configs/ez-rich-toolbar-configs.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-item/ez-rich-toolbar-item.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar-letters/ez-rich-toolbar-letters.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-rich-toolbar/ez-rich-toolbar.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.css.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/ez-simple-image-uploader.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/test/resource/imageBase64.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/fileToBase64.js.gz +0 -0
- package/dist/collection/components/ez-rich-text/ez-simple-image-uploader/utils/formatBytes.js.gz +0 -0
- package/dist/collection/components/ez-scroller/EzScrollDirection.js.gz +0 -0
- package/dist/collection/components/ez-scroller/ez-scroller.css.gz +0 -0
- package/dist/collection/components/ez-scroller/ez-scroller.js.gz +0 -0
- package/dist/collection/components/ez-search/ez-search.css.gz +0 -0
- package/dist/collection/components/ez-search/ez-search.js.gz +0 -0
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.css.gz +0 -0
- package/dist/collection/components/ez-search/subcomponent/search-list/search-list.js.gz +0 -0
- package/dist/collection/components/ez-search/utils/searchFormatters.js.gz +0 -0
- package/dist/collection/components/ez-search-plus/ez-search-plus.css.gz +0 -0
- package/dist/collection/components/ez-search-plus/ez-search-plus.js.gz +0 -0
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.css.gz +0 -0
- package/dist/collection/components/ez-search-plus/subcomponent/ez-search-result-list/ez-search-result-list.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css.gz +0 -0
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js.gz +0 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js.gz +0 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.constants.js.gz +0 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.css.gz +0 -0
- package/dist/collection/components/ez-skeleton/ez-skeleton.js.gz +0 -0
- package/dist/collection/components/ez-sortable-list/ez-sortable-list.css.gz +0 -0
- package/dist/collection/components/ez-sortable-list/ez-sortable-list.js.gz +0 -0
- package/dist/collection/components/ez-spinner/ez-spinner.css.gz +0 -0
- package/dist/collection/components/ez-spinner/ez-spinner.js.gz +0 -0
- package/dist/collection/components/ez-split-button/ez-split-button.css.gz +0 -0
- package/dist/collection/components/ez-split-button/ez-split-button.js.gz +0 -0
- package/dist/collection/components/ez-split-button/test/dropdownItems.js.gz +0 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.css.gz +0 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.js.gz +0 -0
- package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js.gz +0 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css.gz +0 -0
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js.gz +0 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.css.gz +0 -0
- package/dist/collection/components/ez-tabselector/ez-tabselector.js.gz +0 -0
- package/dist/collection/components/ez-tag/ez-tag.css.gz +0 -0
- package/dist/collection/components/ez-tag/ez-tag.js.gz +0 -0
- package/dist/collection/components/ez-tag-input/ez-tag-input.css.gz +0 -0
- package/dist/collection/components/ez-tag-input/ez-tag-input.js.gz +0 -0
- package/dist/collection/components/ez-tag-input/interfaces/optionsSetFocus.js.gz +0 -0
- package/dist/collection/components/ez-text-area/ez-text-area.css.gz +0 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js.gz +0 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.css.gz +0 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.js.gz +0 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css.gz +0 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js.gz +0 -0
- package/dist/collection/components/ez-tile/ez-tile.css.gz +0 -0
- package/dist/collection/components/ez-tile/ez-tile.js.gz +0 -0
- package/dist/collection/components/ez-tile-medium/ez-tile-medium.css.gz +0 -0
- package/dist/collection/components/ez-tile-medium/ez-tile-medium.js.gz +0 -0
- package/dist/collection/components/ez-time-input/ez-time-input.css.gz +0 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js.gz +0 -0
- package/dist/collection/components/ez-toast/ez-toast.css.gz +0 -0
- package/dist/collection/components/ez-toast/ez-toast.js.gz +0 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.css.gz +0 -0
- package/dist/collection/components/ez-tooltip/ez-tooltip.js.gz +0 -0
- package/dist/collection/components/ez-tree/ez-tree.css.gz +0 -0
- package/dist/collection/components/ez-tree/ez-tree.js.gz +0 -0
- package/dist/collection/components/ez-tree/interfaces/ITree.js.gz +0 -0
- package/dist/collection/components/ez-tree/interfaces/ITreeItem.js.gz +0 -0
- package/dist/collection/components/ez-tree/interfaces/ITreeItemBadge.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/DefaultIconResolver.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/DefaultTooltipResolver.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js.gz +0 -0
- package/dist/collection/components/ez-tree/subcomponents/index.js.gz +0 -0
- package/dist/collection/components/ez-tree/types/Node.js.gz +0 -0
- package/dist/collection/components/ez-tree/types/Tree.js.gz +0 -0
- package/dist/collection/components/ez-tree/types/UpdateItemConfig.js.gz +0 -0
- package/dist/collection/components/ez-underface/ez-underface.css.gz +0 -0
- package/dist/collection/components/ez-underface/ez-underface.js.gz +0 -0
- package/dist/collection/components/ez-upload/RemoteFile.js.gz +0 -0
- package/dist/collection/components/ez-upload/ez-upload.css.gz +0 -0
- package/dist/collection/components/ez-upload/ez-upload.js.gz +0 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.css.gz +0 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.js.gz +0 -0
- package/dist/collection/global/app-init.js.gz +0 -0
- package/dist/collection/index.js.gz +0 -0
- package/dist/collection/servidor.js.gz +0 -0
- package/dist/collection/setupTests.js.gz +0 -0
- package/dist/collection/sw.js.gz +0 -0
- package/dist/collection/utils/ApplicationUtils.js.gz +0 -0
- package/dist/collection/utils/AssetsUtils.js.gz +0 -0
- package/dist/collection/utils/CSSVarsUtils.js.gz +0 -0
- package/dist/collection/utils/FocusResolver.js.gz +0 -0
- package/dist/collection/utils/ag-grid-license.js.gz +0 -0
- package/dist/collection/utils/constants.js.gz +0 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js.gz +0 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js.gz +0 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js.gz +0 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js.gz +0 -0
- package/dist/collection/utils/form/DataBinder.js.gz +0 -0
- package/dist/collection/utils/form/FormMetadata.js.gz +0 -0
- package/dist/collection/utils/form/index.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/FormLayout.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IDefaultConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IFormCardConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IFormConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/IFormSheetMetadata.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/ISummaryField.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/ITabConfig.js.gz +0 -0
- package/dist/collection/utils/form/interfaces/index.js.gz +0 -0
- package/dist/collection/utils/form/test/DataBinder.test.js.gz +0 -0
- package/dist/collection/utils/form/test/resources/metadataTest.js.gz +0 -0
- package/dist/collection/utils/i18n/elanguages.js.gz +0 -0
- package/dist/collection/utils/i18n/index.js.gz +0 -0
- package/dist/collection/utils/i18n/locales/en-us.js.gz +0 -0
- package/dist/collection/utils/i18n/locales/es-es.js.gz +0 -0
- package/dist/collection/utils/i18n/locales/pt-br.js.gz +0 -0
- package/dist/collection/utils/i18n/translations.js.gz +0 -0
- package/dist/collection/utils/index.js.gz +0 -0
- package/dist/collection/utils/interfaces/AbstractFieldMetadata.js.gz +0 -0
- package/dist/collection/utils/interfaces/IAction.js.gz +0 -0
- package/dist/collection/utils/interfaces/IFieldConfig.js.gz +0 -0
- package/dist/collection/utils/mock/ez-upload-mock.js.gz +0 -0
- package/dist/collection/utils/search/types.js.gz +0 -0
- package/dist/collection/utils/searchColumn/search-column.js.gz +0 -0
- package/dist/collection/utils/utils.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IInvalidCells.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IInvalidField.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IRecordValidator.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IValidationResult.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/IValidationSource.js.gz +0 -0
- package/dist/collection/utils/validators/recordvalidator/RecordValidationProcessor.js.gz +0 -0
- package/dist/custom-elements/index.js +867 -229
- package/dist/custom-elements/index.js.gz +0 -0
- package/dist/esm/ApplicationUtils-1569f757.js.gz +0 -0
- package/dist/esm/CSSVarsUtils-acba92d7.js.gz +0 -0
- package/dist/esm/CheckMode-bdb2ec19.js.gz +0 -0
- package/dist/esm/DialogType-54a62731.js.gz +0 -0
- package/dist/esm/EzScrollDirection-2df26c93.js.gz +0 -0
- package/dist/esm/FocusResolver-1ccbf850.js.gz +0 -0
- package/dist/esm/FormLayout-071d324c.js.gz +0 -0
- package/dist/esm/RichToolbarHelper-f3a149c4.js.gz +0 -0
- package/dist/esm/_commonjsHelpers-9943807e.js.gz +0 -0
- package/dist/esm/app-globals-c0ac93c0.js.gz +0 -0
- package/dist/esm/constants-3fabe81e.js.gz +0 -0
- package/dist/esm/ez-actions-button.entry.js.gz +0 -0
- package/dist/esm/ez-alert-list.entry.js.gz +0 -0
- package/dist/esm/ez-alert.entry.js.gz +0 -0
- package/dist/esm/ez-application.entry.js.gz +0 -0
- package/dist/esm/ez-avatar.entry.js.gz +0 -0
- package/dist/esm/ez-badge.entry.js.gz +0 -0
- package/dist/esm/ez-breadcrumb.entry.js.gz +0 -0
- package/dist/esm/ez-button.entry.js.gz +0 -0
- package/dist/esm/ez-calendar.entry.js.gz +0 -0
- package/dist/esm/ez-card-item.entry.js.gz +0 -0
- package/dist/esm/ez-chart.entry.js.gz +0 -0
- package/dist/esm/ez-check.entry.js.gz +0 -0
- package/dist/esm/ez-chip.entry.js.gz +0 -0
- package/dist/esm/ez-classic-combo-box.entry.js.gz +0 -0
- package/dist/esm/ez-classic-input.entry.js.gz +0 -0
- package/dist/esm/ez-classic-text-area.entry.js.gz +0 -0
- package/dist/esm/ez-collapsible-box.entry.js.gz +0 -0
- package/dist/esm/ez-combo-box-list_4.entry.js +1 -1
- package/dist/esm/ez-combo-box-list_4.entry.js.gz +0 -0
- package/dist/esm/ez-combo-box.entry.js +5 -0
- package/dist/esm/ez-combo-box.entry.js.gz +0 -0
- package/dist/esm/ez-date-input.entry.js.gz +0 -0
- package/dist/esm/ez-date-time-input.entry.js.gz +0 -0
- package/dist/esm/ez-dialog.entry.js.gz +0 -0
- package/dist/esm/ez-double-list.entry.js.gz +0 -0
- package/dist/esm/ez-dropdown.entry.js.gz +0 -0
- package/dist/esm/ez-empty-card.entry.js.gz +0 -0
- package/dist/esm/ez-file-item.entry.js.gz +0 -0
- package/dist/esm/ez-filter-input.entry.js.gz +0 -0
- package/dist/esm/ez-form-view.entry.js.gz +0 -0
- package/dist/esm/ez-form.entry.js.gz +0 -0
- package/dist/esm/ez-grid-view.entry.js.gz +0 -0
- package/dist/esm/ez-grid.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js.gz +0 -0
- package/dist/esm/ez-guide-navigator.entry.js.gz +0 -0
- package/dist/esm/ez-icon.entry.js.gz +0 -0
- package/dist/esm/ez-link-builder_6.entry.js.gz +0 -0
- package/dist/esm/ez-list-item.entry.js.gz +0 -0
- package/dist/esm/ez-list.entry.js.gz +0 -0
- package/dist/esm/ez-loading-bar.entry.js.gz +0 -0
- package/dist/esm/ez-modal-container.entry.js.gz +0 -0
- package/dist/esm/ez-modal.entry.js.gz +0 -0
- package/dist/esm/ez-multi-selection-list.entry.js.gz +0 -0
- package/dist/esm/ez-number-input.entry.js.gz +0 -0
- package/dist/esm/ez-pagination.entry.js.gz +0 -0
- package/dist/esm/ez-popover-core.entry.js.gz +0 -0
- package/dist/esm/ez-popover-plus_3.entry.js.gz +0 -0
- package/dist/esm/ez-popover.entry.js.gz +0 -0
- package/dist/esm/ez-popup.entry.js.gz +0 -0
- package/dist/esm/ez-progress-bar.entry.js.gz +0 -0
- package/dist/esm/ez-radio-button.entry.js.gz +0 -0
- package/dist/esm/ez-rich-toolbar-item.entry.js.gz +0 -0
- package/dist/esm/ez-scroller_2.entry.js.gz +0 -0
- package/dist/esm/ez-search-plus.entry.js.gz +0 -0
- package/dist/esm/ez-search-result-list.entry.js.gz +0 -0
- package/dist/esm/ez-search.entry.js.gz +0 -0
- package/dist/esm/ez-sidebar-navigator.entry.js.gz +0 -0
- package/dist/esm/ez-skeleton.entry.js.gz +0 -0
- package/dist/esm/ez-sortable-list.entry.js.gz +0 -0
- package/dist/esm/ez-spinner.entry.js.gz +0 -0
- package/dist/esm/ez-split-button.entry.js.gz +0 -0
- package/dist/esm/ez-split-item.entry.js.gz +0 -0
- package/dist/esm/ez-split-panel.entry.js.gz +0 -0
- package/dist/esm/ez-tabselector.entry.js.gz +0 -0
- package/dist/esm/ez-tag-input.entry.js.gz +0 -0
- package/dist/esm/ez-tag.entry.js.gz +0 -0
- package/dist/esm/ez-text-area.entry.js.gz +0 -0
- package/dist/esm/ez-text-input.entry.js.gz +0 -0
- package/dist/esm/ez-tile-medium.entry.js.gz +0 -0
- package/dist/esm/ez-tile.entry.js.gz +0 -0
- package/dist/esm/ez-time-input.entry.js.gz +0 -0
- package/dist/esm/ez-toast.entry.js.gz +0 -0
- package/dist/esm/ez-tooltip.entry.js.gz +0 -0
- package/dist/esm/ez-tree.entry.js.gz +0 -0
- package/dist/esm/ez-underface.entry.js.gz +0 -0
- package/dist/esm/ez-upload.entry.js.gz +0 -0
- package/dist/esm/ez-view-stack.entry.js.gz +0 -0
- package/dist/esm/ezListHelper-00fb9b8d.js.gz +0 -0
- package/dist/esm/ezui.js.gz +0 -0
- package/dist/esm/filter-column.entry.js +6 -1
- package/dist/esm/filter-column.entry.js.gz +0 -0
- package/dist/esm/floating-ui.dom.esm-ad30f2f0.js.gz +0 -0
- package/dist/esm/index-41363fa6.js.gz +0 -0
- package/dist/esm/index-baa5e267.js.gz +0 -0
- package/dist/esm/index.js.gz +0 -0
- package/dist/esm/loader.js.gz +0 -0
- package/dist/esm/polyfills/core-js.js.gz +0 -0
- package/dist/esm/polyfills/css-shim.js.gz +0 -0
- package/dist/esm/polyfills/dom.js.gz +0 -0
- package/dist/esm/polyfills/es5-html-element.js.gz +0 -0
- package/dist/esm/polyfills/index.js.gz +0 -0
- package/dist/esm/polyfills/system.js.gz +0 -0
- package/dist/esm/{purify-04150ce3.js → purify-d55d1f11.js} +856 -228
- package/dist/esm/purify-d55d1f11.js.gz +0 -0
- package/dist/esm/search-column-c20d2b01.js.gz +0 -0
- package/dist/esm/searchFormatters-8229207e.js.gz +0 -0
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/ezui.esm.js.gz +0 -0
- package/dist/ezui/index.esm.js.gz +0 -0
- package/dist/ezui/p-02d448bb.entry.js.gz +0 -0
- package/dist/ezui/p-04126429.js.gz +0 -0
- package/dist/ezui/p-05c32903.entry.js.gz +0 -0
- package/dist/ezui/p-0f7971cf.entry.js.gz +0 -0
- package/dist/ezui/p-110cfb7d.entry.js.gz +0 -0
- package/dist/ezui/p-112455b1.js.gz +0 -0
- package/dist/ezui/p-18384b91.entry.js.gz +0 -0
- package/dist/ezui/p-1e7a8633.entry.js.gz +0 -0
- package/dist/ezui/p-1f50fa05.entry.js.gz +0 -0
- package/dist/ezui/p-20c024f7.entry.js.gz +0 -0
- package/dist/ezui/p-23a36bb6.js.gz +0 -0
- package/dist/ezui/p-2528e988.entry.js.gz +0 -0
- package/dist/ezui/p-288631d1.entry.js.gz +0 -0
- package/dist/ezui/p-2a806303.js.gz +0 -0
- package/dist/ezui/{p-a9e13b05.entry.js → p-2cc07392.entry.js} +1 -1
- package/dist/ezui/p-2cc07392.entry.js.gz +0 -0
- package/dist/ezui/p-30ffb9ed.js.gz +0 -0
- package/dist/ezui/p-34a476a9.entry.js.gz +0 -0
- package/dist/ezui/p-351fb12f.entry.js.gz +0 -0
- package/dist/ezui/p-39761eca.entry.js.gz +0 -0
- package/dist/ezui/p-3afa1c6e.entry.js.gz +0 -0
- package/dist/ezui/p-3ce867cf.entry.js.gz +0 -0
- package/dist/ezui/p-3e767a74.js.gz +0 -0
- package/dist/ezui/p-40a60148.js.gz +0 -0
- package/dist/ezui/p-411c0222.entry.js.gz +0 -0
- package/dist/ezui/p-4314f87a.entry.js.gz +0 -0
- package/dist/ezui/p-48effc69.entry.js.gz +0 -0
- package/dist/ezui/p-4d30b703.entry.js.gz +0 -0
- package/dist/ezui/p-4fe123b6.entry.js.gz +0 -0
- package/dist/ezui/p-5554704c.js.gz +0 -0
- package/dist/ezui/p-5ed81457.entry.js.gz +0 -0
- package/dist/ezui/p-6020f3d5.entry.js.gz +0 -0
- package/dist/ezui/p-62a362b4.js +3 -0
- package/dist/ezui/p-62a362b4.js.gz +0 -0
- package/dist/ezui/p-6c51ccd1.entry.js.gz +0 -0
- package/dist/ezui/p-6ca0815e.entry.js.gz +0 -0
- package/dist/ezui/p-6cb82d33.entry.js.gz +0 -0
- package/dist/ezui/p-6d596a5a.entry.js.gz +0 -0
- package/dist/ezui/p-6de4cae1.entry.js +1 -0
- package/dist/ezui/p-6de4cae1.entry.js.gz +0 -0
- package/dist/ezui/p-6f77a359.entry.js.gz +0 -0
- package/dist/ezui/p-721fd999.entry.js.gz +0 -0
- package/dist/ezui/p-7995dcb4.entry.js.gz +0 -0
- package/dist/ezui/p-7f37ee99.entry.js.gz +0 -0
- package/dist/ezui/p-7f792043.entry.js.gz +0 -0
- package/dist/ezui/p-7fe97ef5.entry.js.gz +0 -0
- package/dist/ezui/p-80dfc50b.js.gz +0 -0
- package/dist/ezui/p-859e3134.entry.js.gz +0 -0
- package/dist/ezui/p-8df1ca33.entry.js.gz +0 -0
- package/dist/ezui/p-91c9d50e.entry.js.gz +0 -0
- package/dist/ezui/p-93e1c917.entry.js.gz +0 -0
- package/dist/ezui/p-948f0fb2.entry.js.gz +0 -0
- package/dist/ezui/p-94deb71e.entry.js.gz +0 -0
- package/dist/ezui/p-967ed829.entry.js +1 -0
- package/dist/ezui/p-967ed829.entry.js.gz +0 -0
- package/dist/ezui/p-98bb8b16.js.gz +0 -0
- package/dist/ezui/p-9ab2add9.entry.js.gz +0 -0
- package/dist/ezui/p-9b215871.entry.js.gz +0 -0
- package/dist/ezui/p-9b3f3c02.entry.js.gz +0 -0
- package/dist/ezui/p-9f5fa3f9.entry.js.gz +0 -0
- package/dist/ezui/p-a0bf1fc7.entry.js.gz +0 -0
- package/dist/ezui/p-a278f26e.entry.js.gz +0 -0
- package/dist/ezui/p-a3075f52.entry.js.gz +0 -0
- package/dist/ezui/p-a3ada561.entry.js.gz +0 -0
- package/dist/ezui/p-a4083a7a.entry.js.gz +0 -0
- package/dist/ezui/p-a61fdd20.js.gz +0 -0
- package/dist/ezui/p-a63b20a0.entry.js.gz +0 -0
- package/dist/ezui/p-a80b1287.entry.js.gz +0 -0
- package/dist/ezui/p-ab574d59.js.gz +0 -0
- package/dist/ezui/p-b1e45320.js.gz +0 -0
- package/dist/ezui/p-b3d8034b.entry.js.gz +0 -0
- package/dist/ezui/p-b853763b.js.gz +0 -0
- package/dist/ezui/p-b989a33e.entry.js.gz +0 -0
- package/dist/ezui/p-baec56c9.js.gz +0 -0
- package/dist/ezui/p-bc2f844e.entry.js.gz +0 -0
- package/dist/ezui/{p-87a6feba.entry.js → p-c2d1f276.entry.js} +1 -1
- package/dist/ezui/{p-87a6feba.entry.js.gz → p-c2d1f276.entry.js.gz} +0 -0
- package/dist/ezui/p-cde41310.entry.js.gz +0 -0
- package/dist/ezui/p-ce0b36d7.entry.js.gz +0 -0
- package/dist/ezui/p-d2645bdf.entry.js.gz +0 -0
- package/dist/ezui/p-d5eb2fad.entry.js.gz +0 -0
- package/dist/ezui/p-d6742c1e.entry.js.gz +0 -0
- package/dist/ezui/p-d6bb930d.entry.js.gz +0 -0
- package/dist/ezui/p-d6f50207.entry.js.gz +0 -0
- package/dist/ezui/p-d8cc640d.entry.js.gz +0 -0
- package/dist/ezui/p-dc628ed3.js.gz +0 -0
- package/dist/ezui/p-de862af4.entry.js.gz +0 -0
- package/dist/ezui/p-dee18824.entry.js.gz +0 -0
- package/dist/ezui/p-e5de42e7.entry.js.gz +0 -0
- package/dist/ezui/p-e75c7a23.entry.js.gz +0 -0
- package/dist/ezui/p-e7a7c594.entry.js.gz +0 -0
- package/dist/ezui/p-e8c57463.entry.js.gz +0 -0
- package/dist/ezui/p-ec7db713.js.gz +0 -0
- package/dist/ezui/p-ecd6409d.entry.js.gz +0 -0
- package/dist/ezui/p-ef8bd3e8.entry.js.gz +0 -0
- package/dist/ezui/p-f00c9dc2.entry.js.gz +0 -0
- package/dist/ezui/p-f34ec732.entry.js.gz +0 -0
- package/dist/ezui/p-fa6732f2.entry.js.gz +0 -0
- package/dist/index.cjs.js.gz +0 -0
- package/dist/index.js.gz +0 -0
- package/package.json +1 -1
- package/dist/cjs/purify-29cc6f77.js.gz +0 -0
- package/dist/esm/purify-04150ce3.js.gz +0 -0
- package/dist/ezui/p-2b49aa22.entry.js +0 -1
- package/dist/ezui/p-2b49aa22.entry.js.gz +0 -0
- package/dist/ezui/p-30e4a165.js +0 -3
- package/dist/ezui/p-30e4a165.js.gz +0 -0
- package/dist/ezui/p-35bfaa88.entry.js +0 -1
- package/dist/ezui/p-35bfaa88.entry.js.gz +0 -0
- package/dist/ezui/p-a9e13b05.entry.js.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-9943807e.js';
|
|
2
2
|
|
|
3
3
|
var purify = createCommonjsModule(function (module, exports) {
|
|
4
|
-
/*! @license DOMPurify 3.4.
|
|
4
|
+
/*! @license DOMPurify 3.4.10 | (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.10/LICENSE */
|
|
5
5
|
|
|
6
6
|
(function (global, factory) {
|
|
7
7
|
module.exports = factory() ;
|
|
@@ -333,16 +333,32 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
333
333
|
);
|
|
334
334
|
const DOCTYPE_NAME = seal(/^html$/i);
|
|
335
335
|
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
336
|
+
// Markup-significant character probes used by _sanitizeElements.
|
|
337
|
+
// Shared module-level instances are safe despite the sticky /g flags:
|
|
338
|
+
// unapply() resets lastIndex for RegExp receivers before every call.
|
|
339
|
+
const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
|
|
340
|
+
const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
|
|
341
|
+
const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
|
|
342
|
+
const SELF_CLOSING_TAG = seal(/\/>/i);
|
|
336
343
|
|
|
337
344
|
/* eslint-disable @typescript-eslint/indent */
|
|
338
345
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
339
346
|
const NODE_TYPE = {
|
|
340
347
|
element: 1,
|
|
348
|
+
attribute: 2,
|
|
341
349
|
text: 3,
|
|
350
|
+
cdataSection: 4,
|
|
351
|
+
entityReference: 5,
|
|
342
352
|
// Deprecated
|
|
343
|
-
|
|
353
|
+
entityNode: 6,
|
|
354
|
+
// Deprecated
|
|
355
|
+
processingInstruction: 7,
|
|
344
356
|
comment: 8,
|
|
345
|
-
document: 9
|
|
357
|
+
document: 9,
|
|
358
|
+
documentType: 10,
|
|
359
|
+
documentFragment: 11,
|
|
360
|
+
notation: 12 // Deprecated
|
|
361
|
+
};
|
|
346
362
|
const getGlobal = function getGlobal() {
|
|
347
363
|
return typeof window === 'undefined' ? null : window;
|
|
348
364
|
};
|
|
@@ -396,10 +412,25 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
396
412
|
uponSanitizeShadowNode: []
|
|
397
413
|
};
|
|
398
414
|
};
|
|
415
|
+
/**
|
|
416
|
+
* Resolve a set-valued configuration option: a fresh set built from
|
|
417
|
+
* cfg[key] when it is an own array property (seeded with a clone of
|
|
418
|
+
* options.base when given, case-normalized via options.transform),
|
|
419
|
+
* the fallback set otherwise.
|
|
420
|
+
*
|
|
421
|
+
* @param cfg the cloned, prototype-free configuration object
|
|
422
|
+
* @param key the configuration property to read
|
|
423
|
+
* @param fallback the set to use when the option is absent or not an array
|
|
424
|
+
* @param options transform and optional base set to merge into
|
|
425
|
+
* @returns the resolved set
|
|
426
|
+
*/
|
|
427
|
+
const _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
|
|
428
|
+
return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
|
|
429
|
+
};
|
|
399
430
|
function createDOMPurify() {
|
|
400
431
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
401
432
|
const DOMPurify = root => createDOMPurify(root);
|
|
402
|
-
DOMPurify.version = '3.4.
|
|
433
|
+
DOMPurify.version = '3.4.10';
|
|
403
434
|
DOMPurify.removed = [];
|
|
404
435
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
405
436
|
// Not running in a browser, provide a factory function
|
|
@@ -410,15 +441,11 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
410
441
|
let document = window.document;
|
|
411
442
|
const originalDocument = document;
|
|
412
443
|
const currentScript = originalDocument.currentScript;
|
|
413
|
-
|
|
414
|
-
HTMLTemplateElement = window.HTMLTemplateElement,
|
|
444
|
+
const HTMLTemplateElement = window.HTMLTemplateElement,
|
|
415
445
|
Node = window.Node,
|
|
416
446
|
Element = window.Element,
|
|
417
|
-
NodeFilter = window.NodeFilter
|
|
418
|
-
|
|
419
|
-
NamedNodeMap = _window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,
|
|
420
|
-
HTMLFormElement = window.HTMLFormElement,
|
|
421
|
-
DOMParser = window.DOMParser,
|
|
447
|
+
NodeFilter = window.NodeFilter;
|
|
448
|
+
const DOMParser = window.DOMParser,
|
|
422
449
|
trustedTypes = window.trustedTypes;
|
|
423
450
|
const ElementPrototype = Element.prototype;
|
|
424
451
|
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
@@ -426,7 +453,10 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
426
453
|
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
427
454
|
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
428
455
|
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
456
|
+
const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');
|
|
457
|
+
const getAttributes = lookupGetter(ElementPrototype, 'attributes');
|
|
429
458
|
const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;
|
|
459
|
+
const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;
|
|
430
460
|
// As per issue #47, the web-components registry is inherited by a
|
|
431
461
|
// new document created via createHTMLDocument. As per the spec
|
|
432
462
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
@@ -441,6 +471,54 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
441
471
|
}
|
|
442
472
|
let trustedTypesPolicy;
|
|
443
473
|
let emptyHTML = '';
|
|
474
|
+
// The instance's own internal Trusted Types policy. Unlike a caller-supplied
|
|
475
|
+
// `TRUSTED_TYPES_POLICY`, this is created at most once — Trusted Types throws
|
|
476
|
+
// on duplicate policy names — and is the only policy allowed to persist
|
|
477
|
+
// across configurations and survive `clearConfig()`.
|
|
478
|
+
let defaultTrustedTypesPolicy;
|
|
479
|
+
let defaultTrustedTypesPolicyResolved = false;
|
|
480
|
+
// Tracks whether we are already inside a call to the configured Trusted Types
|
|
481
|
+
// policy (`createHTML` or `createScriptURL`). If a supplied policy callback
|
|
482
|
+
// itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would
|
|
483
|
+
// re-enter the policy and recurse until the stack overflows. We detect that
|
|
484
|
+
// re-entry and throw a clear, actionable error instead. The guard is shared
|
|
485
|
+
// across both callbacks, because either one re-entering `sanitize` triggers
|
|
486
|
+
// the same unbounded recursion.
|
|
487
|
+
let IN_TRUSTED_TYPES_POLICY = 0;
|
|
488
|
+
const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
|
|
489
|
+
if (IN_TRUSTED_TYPES_POLICY > 0) {
|
|
490
|
+
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.');
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
const _createTrustedHTML = function _createTrustedHTML(html) {
|
|
494
|
+
_assertNotInTrustedTypesPolicy();
|
|
495
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
496
|
+
try {
|
|
497
|
+
return trustedTypesPolicy.createHTML(html);
|
|
498
|
+
} finally {
|
|
499
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
|
|
503
|
+
_assertNotInTrustedTypesPolicy();
|
|
504
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
505
|
+
try {
|
|
506
|
+
return trustedTypesPolicy.createScriptURL(scriptUrl);
|
|
507
|
+
} finally {
|
|
508
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
// Lazily resolve (and cache) the instance's internal default policy.
|
|
512
|
+
// Resolution is attempted at most once: a successful `createPolicy` cannot be
|
|
513
|
+
// repeated (Trusted Types throws on duplicate names), and a failed or
|
|
514
|
+
// unsupported attempt must not be retried on every parse.
|
|
515
|
+
const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
|
|
516
|
+
if (!defaultTrustedTypesPolicyResolved) {
|
|
517
|
+
defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
518
|
+
defaultTrustedTypesPolicyResolved = true;
|
|
519
|
+
}
|
|
520
|
+
return defaultTrustedTypesPolicy;
|
|
521
|
+
};
|
|
444
522
|
const _document = document,
|
|
445
523
|
implementation = _document.implementation,
|
|
446
524
|
createNodeIterator = _document.createNodeIterator,
|
|
@@ -579,7 +657,17 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
579
657
|
let USE_PROFILES = {};
|
|
580
658
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
581
659
|
let FORBID_CONTENTS = null;
|
|
582
|
-
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
660
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
661
|
+
// <selectedcontent> mirrors the selected <option>'s subtree, cloned by
|
|
662
|
+
// the UA (customizable <select>) — including any on* handlers — and the
|
|
663
|
+
// engine re-mirrors synchronously whenever a removal changes which
|
|
664
|
+
// option/selectedcontent is current, even inside DOMPurify's inert
|
|
665
|
+
// DOMParser document. Hoisting its children on removal re-inserts a fresh
|
|
666
|
+
// mirror target ahead of the walk, which the engine refills, looping
|
|
667
|
+
// forever (DoS) and amplifying output. Dropping its content on removal
|
|
668
|
+
// (rather than hoisting) breaks that cascade; the content is a duplicate
|
|
669
|
+
// of the option, which is sanitized on its own. See campaign-3 F1/F6.
|
|
670
|
+
'selectedcontent', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
583
671
|
/* Tags that are safe for data: URIs */
|
|
584
672
|
let DATA_URI_TAGS = null;
|
|
585
673
|
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
@@ -595,8 +683,10 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
595
683
|
/* Allowed XHTML+XML namespaces */
|
|
596
684
|
let ALLOWED_NAMESPACES = null;
|
|
597
685
|
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
598
|
-
|
|
599
|
-
let
|
|
686
|
+
const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
687
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
|
|
688
|
+
const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);
|
|
689
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
|
|
600
690
|
// Certain elements are allowed in both SVG and HTML
|
|
601
691
|
// namespace. We need to specify them explicitly
|
|
602
692
|
// so that they don't get erroneously deleted from
|
|
@@ -638,14 +728,32 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
638
728
|
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
639
729
|
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
640
730
|
/* Set configuration parameters */
|
|
641
|
-
ALLOWED_TAGS =
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
731
|
+
ALLOWED_TAGS = _resolveSetOption(cfg, 'ALLOWED_TAGS', DEFAULT_ALLOWED_TAGS, {
|
|
732
|
+
transform: transformCaseFunc
|
|
733
|
+
});
|
|
734
|
+
ALLOWED_ATTR = _resolveSetOption(cfg, 'ALLOWED_ATTR', DEFAULT_ALLOWED_ATTR, {
|
|
735
|
+
transform: transformCaseFunc
|
|
736
|
+
});
|
|
737
|
+
ALLOWED_NAMESPACES = _resolveSetOption(cfg, 'ALLOWED_NAMESPACES', DEFAULT_ALLOWED_NAMESPACES, {
|
|
738
|
+
transform: stringToString
|
|
739
|
+
});
|
|
740
|
+
URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, 'ADD_URI_SAFE_ATTR', DEFAULT_URI_SAFE_ATTRIBUTES, {
|
|
741
|
+
transform: transformCaseFunc,
|
|
742
|
+
base: DEFAULT_URI_SAFE_ATTRIBUTES
|
|
743
|
+
});
|
|
744
|
+
DATA_URI_TAGS = _resolveSetOption(cfg, 'ADD_DATA_URI_TAGS', DEFAULT_DATA_URI_TAGS, {
|
|
745
|
+
transform: transformCaseFunc,
|
|
746
|
+
base: DEFAULT_DATA_URI_TAGS
|
|
747
|
+
});
|
|
748
|
+
FORBID_CONTENTS = _resolveSetOption(cfg, 'FORBID_CONTENTS', DEFAULT_FORBID_CONTENTS, {
|
|
749
|
+
transform: transformCaseFunc
|
|
750
|
+
});
|
|
751
|
+
FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {
|
|
752
|
+
transform: transformCaseFunc
|
|
753
|
+
});
|
|
754
|
+
FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {
|
|
755
|
+
transform: transformCaseFunc
|
|
756
|
+
});
|
|
649
757
|
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
|
|
650
758
|
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
|
651
759
|
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
|
@@ -664,8 +772,8 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
664
772
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
665
773
|
IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp
|
|
666
774
|
NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace
|
|
667
|
-
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({},
|
|
668
|
-
HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({},
|
|
775
|
+
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
|
|
776
|
+
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
|
|
669
777
|
const customElementHandling = objectHasOwnProperty(cfg, 'CUSTOM_ELEMENT_HANDLING') && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === 'object' ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
|
|
670
778
|
CUSTOM_ELEMENT_HANDLING = create(null);
|
|
671
779
|
if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) {
|
|
@@ -677,6 +785,7 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
677
785
|
if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') {
|
|
678
786
|
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined
|
|
679
787
|
}
|
|
788
|
+
seal(CUSTOM_ELEMENT_HANDLING);
|
|
680
789
|
if (SAFE_FOR_TEMPLATES) {
|
|
681
790
|
ALLOW_DATA_ATTR = false;
|
|
682
791
|
}
|
|
@@ -760,6 +869,13 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
760
869
|
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
761
870
|
delete FORBID_TAGS.tbody;
|
|
762
871
|
}
|
|
872
|
+
// Re-derive the active Trusted Types policy from this configuration on
|
|
873
|
+
// every parse. The active policy must never be sticky closure state that
|
|
874
|
+
// outlives the config that set it: a caller-supplied policy left in place
|
|
875
|
+
// after `clearConfig()` — or after a later call that supplied none, or
|
|
876
|
+
// `TRUSTED_TYPES_POLICY: null` — could sign a subsequent "default"
|
|
877
|
+
// `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.
|
|
878
|
+
// See GHSA-vxr8-fq34-vvx9.
|
|
763
879
|
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
764
880
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
|
765
881
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
@@ -767,20 +883,62 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
767
883
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
768
884
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
769
885
|
}
|
|
770
|
-
//
|
|
886
|
+
// A caller-supplied policy applies to this configuration only.
|
|
887
|
+
const previousTrustedTypesPolicy = trustedTypesPolicy;
|
|
771
888
|
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
772
|
-
// Sign local variables required by `sanitize`.
|
|
773
|
-
|
|
889
|
+
// Sign local variables required by `sanitize`. If the supplied policy's
|
|
890
|
+
// `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this
|
|
891
|
+
// throws via the re-entrancy guard. Restore the previous policy first so
|
|
892
|
+
// the instance is not left in a poisoned state. See #1422.
|
|
893
|
+
try {
|
|
894
|
+
emptyHTML = _createTrustedHTML('');
|
|
895
|
+
} catch (error) {
|
|
896
|
+
trustedTypesPolicy = previousTrustedTypesPolicy;
|
|
897
|
+
throw error;
|
|
898
|
+
}
|
|
899
|
+
} else if (cfg.TRUSTED_TYPES_POLICY === null) {
|
|
900
|
+
// Explicit opt-out for this call: perform no Trusted Types signing and
|
|
901
|
+
// create nothing (so a strict `trusted-types` CSP that disallows a
|
|
902
|
+
// `dompurify` policy can still call `sanitize` from inside its own
|
|
903
|
+
// policy — see #1422). Resetting to `undefined` rather than a sticky
|
|
904
|
+
// `null` also drops any previously retained caller policy, so it cannot
|
|
905
|
+
// resurface on a later call, while still allowing the next config-less
|
|
906
|
+
// call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.
|
|
907
|
+
trustedTypesPolicy = undefined;
|
|
908
|
+
emptyHTML = '';
|
|
774
909
|
} else {
|
|
775
|
-
//
|
|
910
|
+
// No policy supplied: keep the currently active policy if one is set — a
|
|
911
|
+
// previously supplied policy is intentionally sticky across config-less
|
|
912
|
+
// calls — otherwise fall back to the instance's own internal policy,
|
|
913
|
+
// created at most once. (A policy supplied for a *single* call still
|
|
914
|
+
// lingers by design; what must not linger is a policy whose configuration
|
|
915
|
+
// has been torn down via `clearConfig()`, which restores the default.)
|
|
776
916
|
if (trustedTypesPolicy === undefined) {
|
|
777
|
-
trustedTypesPolicy =
|
|
917
|
+
trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
|
|
778
918
|
}
|
|
779
|
-
//
|
|
780
|
-
|
|
781
|
-
|
|
919
|
+
// Sign internal variables only when a policy is active. A falsy policy
|
|
920
|
+
// (Trusted Types unsupported, creation failed, or an explicit opt-out)
|
|
921
|
+
// leaves `emptyHTML` as a plain string, so we never call `.createHTML` on
|
|
922
|
+
// a non-policy and throw. See #1422.
|
|
923
|
+
if (trustedTypesPolicy && typeof emptyHTML === 'string') {
|
|
924
|
+
emptyHTML = _createTrustedHTML('');
|
|
782
925
|
}
|
|
783
926
|
}
|
|
927
|
+
/*
|
|
928
|
+
* Mirror the clone-before-mutate pattern already applied above for
|
|
929
|
+
* cfg.ADD_TAGS / cfg.ADD_ATTR: if any uponSanitize* hook is
|
|
930
|
+
* registered AND the set still points at the default constant,
|
|
931
|
+
* clone it. The hook then mutates the clone (in-call widening
|
|
932
|
+
* still works exactly as documented) and the next default-cfg
|
|
933
|
+
* call rebinds to the untouched original via the reassignment at
|
|
934
|
+
* the top of this function.
|
|
935
|
+
*/
|
|
936
|
+
if ((hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) && ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
937
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
938
|
+
}
|
|
939
|
+
if (hooks.uponSanitizeAttribute.length > 0 && ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
940
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
941
|
+
}
|
|
784
942
|
// Prevent further manipulation of configuration.
|
|
785
943
|
// Not available in IE8, Safari 5, etc.
|
|
786
944
|
if (freeze) {
|
|
@@ -793,6 +951,77 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
793
951
|
* correctly. */
|
|
794
952
|
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
795
953
|
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
954
|
+
/**
|
|
955
|
+
* Namespace rules for an element in the SVG namespace.
|
|
956
|
+
*
|
|
957
|
+
* @param tagName the element's lowercase tag name
|
|
958
|
+
* @param parent the (possibly simulated) parent node
|
|
959
|
+
* @param parentTagName the parent's lowercase tag name
|
|
960
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
961
|
+
*/
|
|
962
|
+
const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
|
|
963
|
+
// The only way to switch from HTML namespace to SVG
|
|
964
|
+
// is via <svg>. If it happens via any other tag, then
|
|
965
|
+
// it should be killed.
|
|
966
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
967
|
+
return tagName === 'svg';
|
|
968
|
+
}
|
|
969
|
+
// The only way to switch from MathML to SVG is via <svg>
|
|
970
|
+
// if the parent is either <annotation-xml> or a MathML
|
|
971
|
+
// text integration point.
|
|
972
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
973
|
+
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
974
|
+
}
|
|
975
|
+
// We only allow elements that are defined in SVG
|
|
976
|
+
// spec. All others are disallowed in SVG namespace.
|
|
977
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
978
|
+
};
|
|
979
|
+
/**
|
|
980
|
+
* Namespace rules for an element in the MathML namespace.
|
|
981
|
+
*
|
|
982
|
+
* @param tagName the element's lowercase tag name
|
|
983
|
+
* @param parent the (possibly simulated) parent node
|
|
984
|
+
* @param parentTagName the parent's lowercase tag name
|
|
985
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
986
|
+
*/
|
|
987
|
+
const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
|
|
988
|
+
// The only way to switch from HTML namespace to MathML
|
|
989
|
+
// is via <math>. If it happens via any other tag, then
|
|
990
|
+
// it should be killed.
|
|
991
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
992
|
+
return tagName === 'math';
|
|
993
|
+
}
|
|
994
|
+
// The only way to switch from SVG to MathML is via
|
|
995
|
+
// <math> and HTML integration points
|
|
996
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
997
|
+
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
998
|
+
}
|
|
999
|
+
// We only allow elements that are defined in MathML
|
|
1000
|
+
// spec. All others are disallowed in MathML namespace.
|
|
1001
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1002
|
+
};
|
|
1003
|
+
/**
|
|
1004
|
+
* Namespace rules for an element in the HTML namespace.
|
|
1005
|
+
*
|
|
1006
|
+
* @param tagName the element's lowercase tag name
|
|
1007
|
+
* @param parent the (possibly simulated) parent node
|
|
1008
|
+
* @param parentTagName the parent's lowercase tag name
|
|
1009
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
1010
|
+
*/
|
|
1011
|
+
const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
|
|
1012
|
+
// The only way to switch from SVG to HTML is via
|
|
1013
|
+
// HTML integration points, and from MathML to HTML
|
|
1014
|
+
// is via MathML text integration points
|
|
1015
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
1016
|
+
return false;
|
|
1017
|
+
}
|
|
1018
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
1019
|
+
return false;
|
|
1020
|
+
}
|
|
1021
|
+
// We disallow tags that are specific for MathML
|
|
1022
|
+
// or SVG and should never appear in HTML namespace
|
|
1023
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1024
|
+
};
|
|
796
1025
|
/**
|
|
797
1026
|
* @param element a DOM element whose namespace is being checked
|
|
798
1027
|
* @returns Return false if the element has a
|
|
@@ -815,51 +1044,13 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
815
1044
|
return false;
|
|
816
1045
|
}
|
|
817
1046
|
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
818
|
-
|
|
819
|
-
// is via <svg>. If it happens via any other tag, then
|
|
820
|
-
// it should be killed.
|
|
821
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
822
|
-
return tagName === 'svg';
|
|
823
|
-
}
|
|
824
|
-
// The only way to switch from MathML to SVG is via`
|
|
825
|
-
// svg if parent is either <annotation-xml> or MathML
|
|
826
|
-
// text integration points.
|
|
827
|
-
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
828
|
-
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
829
|
-
}
|
|
830
|
-
// We only allow elements that are defined in SVG
|
|
831
|
-
// spec. All others are disallowed in SVG namespace.
|
|
832
|
-
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
1047
|
+
return _checkSvgNamespace(tagName, parent, parentTagName);
|
|
833
1048
|
}
|
|
834
1049
|
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
835
|
-
|
|
836
|
-
// is via <math>. If it happens via any other tag, then
|
|
837
|
-
// it should be killed.
|
|
838
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
839
|
-
return tagName === 'math';
|
|
840
|
-
}
|
|
841
|
-
// The only way to switch from SVG to MathML is via
|
|
842
|
-
// <math> and HTML integration points
|
|
843
|
-
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
844
|
-
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
845
|
-
}
|
|
846
|
-
// We only allow elements that are defined in MathML
|
|
847
|
-
// spec. All others are disallowed in MathML namespace.
|
|
848
|
-
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1050
|
+
return _checkMathMlNamespace(tagName, parent, parentTagName);
|
|
849
1051
|
}
|
|
850
1052
|
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
851
|
-
|
|
852
|
-
// HTML integration points, and from MathML to HTML
|
|
853
|
-
// is via MathML text integration points
|
|
854
|
-
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
855
|
-
return false;
|
|
856
|
-
}
|
|
857
|
-
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
858
|
-
return false;
|
|
859
|
-
}
|
|
860
|
-
// We disallow tags that are specific for MathML
|
|
861
|
-
// or SVG and should never appear in HTML namespace
|
|
862
|
-
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1053
|
+
return _checkHtmlNamespace(tagName, parent, parentTagName);
|
|
863
1054
|
}
|
|
864
1055
|
// For XHTML and XML documents that support custom namespaces
|
|
865
1056
|
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
@@ -884,7 +1075,74 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
884
1075
|
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
885
1076
|
getParentNode(node).removeChild(node);
|
|
886
1077
|
} catch (_) {
|
|
1078
|
+
/* The normal detach failed — this is reached for a parentless node
|
|
1079
|
+
(getParentNode() is null, so .removeChild throws). Element.prototype
|
|
1080
|
+
.remove() is itself a spec no-op on a parentless node, so a recorded
|
|
1081
|
+
"removal" would otherwise hand the caller back an intact,
|
|
1082
|
+
payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or
|
|
1083
|
+
the style-with-element-child rule decided to kill). Fail closed by
|
|
1084
|
+
throwing — exactly as a clobbered root does at the IN_PLACE entry —
|
|
1085
|
+
rather than trying to "neutralize" the node via its own methods.
|
|
1086
|
+
Neutralizing would mean calling getAttributeNames()/removeAttribute()
|
|
1087
|
+
on the node, both of which a <form> root can clobber via a named child
|
|
1088
|
+
(and _isClobbered does not even probe getAttributeNames), so the
|
|
1089
|
+
neutralize step could itself be silently defeated, leaving the payload
|
|
1090
|
+
intact. A throw touches only the cached, clobber-safe remove() and
|
|
1091
|
+
getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)
|
|
1092
|
+
to every root-kill reason. REPORT-3.
|
|
1093
|
+
This lives inside the catch, so it never fires for a normally-removed
|
|
1094
|
+
in-tree node: those have a parent, removeChild() succeeds, and the
|
|
1095
|
+
catch is not entered. Only a kept (parentless) root reaches here. */
|
|
887
1096
|
remove(node);
|
|
1097
|
+
if (!getParentNode(node)) {
|
|
1098
|
+
throw typeErrorCreate('a node selected for removal could not be detached from its tree ' + 'and cannot be safely returned; refusing to sanitize in place');
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
/**
|
|
1103
|
+
* _neutralizeRoot
|
|
1104
|
+
*
|
|
1105
|
+
* Fail-closed teardown of an in-place root after the sanitize walk aborts
|
|
1106
|
+
* (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
|
|
1107
|
+
* custom element's reaction detaches a node so `_forceRemove`'s deliberate
|
|
1108
|
+
* parentless guard throws, or any other re-entrant engine mutation — would
|
|
1109
|
+
* otherwise leave the caller's *live* tree half-sanitized, with everything
|
|
1110
|
+
* after the abort point still carrying its handlers. There is no safe way
|
|
1111
|
+
* to resume the walk (the tree mutated under us), so we strip the root bare:
|
|
1112
|
+
* remove every child and every attribute, then let the caller's catch see
|
|
1113
|
+
* the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
|
|
1114
|
+
* getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
|
|
1115
|
+
*
|
|
1116
|
+
* @param root the in-place root to empty
|
|
1117
|
+
*/
|
|
1118
|
+
const _neutralizeRoot = function _neutralizeRoot(root) {
|
|
1119
|
+
const childNodes = getChildNodes(root);
|
|
1120
|
+
if (childNodes) {
|
|
1121
|
+
const snapshot = [];
|
|
1122
|
+
arrayForEach(childNodes, child => {
|
|
1123
|
+
arrayPush(snapshot, child);
|
|
1124
|
+
});
|
|
1125
|
+
arrayForEach(snapshot, child => {
|
|
1126
|
+
try {
|
|
1127
|
+
remove(child);
|
|
1128
|
+
} catch (_) {
|
|
1129
|
+
/* Best-effort teardown; a still-attached child is handled below */
|
|
1130
|
+
}
|
|
1131
|
+
});
|
|
1132
|
+
}
|
|
1133
|
+
const attributes = getAttributes(root);
|
|
1134
|
+
if (attributes) {
|
|
1135
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
1136
|
+
const attribute = attributes[i];
|
|
1137
|
+
const name = attribute && attribute.name;
|
|
1138
|
+
if (typeof name === 'string') {
|
|
1139
|
+
try {
|
|
1140
|
+
root.removeAttribute(name);
|
|
1141
|
+
} catch (_) {
|
|
1142
|
+
/* Clobbered removeAttribute — ignore (fail-closed best effort) */
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
888
1146
|
}
|
|
889
1147
|
};
|
|
890
1148
|
/**
|
|
@@ -919,6 +1177,72 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
919
1177
|
}
|
|
920
1178
|
}
|
|
921
1179
|
};
|
|
1180
|
+
/**
|
|
1181
|
+
* _stripDisallowedAttributes
|
|
1182
|
+
*
|
|
1183
|
+
* Removes every attribute the active configuration does not allow from a
|
|
1184
|
+
* single element, using the same allowlist as the main attribute pass (so
|
|
1185
|
+
* `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
|
|
1186
|
+
* neutralise nodes that are being discarded from an in-place tree.
|
|
1187
|
+
*
|
|
1188
|
+
* @param element the element to strip
|
|
1189
|
+
*/
|
|
1190
|
+
const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
|
|
1191
|
+
const attributes = getAttributes(element);
|
|
1192
|
+
if (!attributes) {
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
1196
|
+
const attribute = attributes[i];
|
|
1197
|
+
const name = attribute && attribute.name;
|
|
1198
|
+
if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {
|
|
1199
|
+
continue;
|
|
1200
|
+
}
|
|
1201
|
+
try {
|
|
1202
|
+
element.removeAttribute(name);
|
|
1203
|
+
} catch (_) {
|
|
1204
|
+
/* Clobbered removeAttribute on a doomed node — ignore */
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
/**
|
|
1209
|
+
* _neutralizeSubtree
|
|
1210
|
+
*
|
|
1211
|
+
* Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT
|
|
1212
|
+
* move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,
|
|
1213
|
+
* namespace, comment, processing-instruction and KEEP_CONTENT:false removals
|
|
1214
|
+
* all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
|
|
1215
|
+
* those dropped nodes are detached from the caller's LIVE tree but a
|
|
1216
|
+
* handler-bearing original among them (an `<img onerror>`/`<video>` that was
|
|
1217
|
+
* loading) keeps its queued resource event, which fires in page scope after
|
|
1218
|
+
* sanitize returns. This walks a removed subtree and strips every attribute
|
|
1219
|
+
* the active configuration does not allow — so `on*` handlers are cancelled
|
|
1220
|
+
* through the SAME allowlist that governs kept nodes, not a separate `/^on/`
|
|
1221
|
+
* blocklist. Run synchronously before sanitize returns, i.e. before any
|
|
1222
|
+
* queued event can fire. Hook-free by design: these nodes leave the output,
|
|
1223
|
+
* so firing attribute hooks for them would be surprising. Clobber-safe reads;
|
|
1224
|
+
* a doomed clobbered node may shadow `removeAttribute` (its own attributes are
|
|
1225
|
+
* irrelevant — it is discarded — while its non-clobbered descendants, e.g.
|
|
1226
|
+
* the `<img>`, are reached and scrubbed).
|
|
1227
|
+
*
|
|
1228
|
+
* @param root the root of a removed subtree to neutralise
|
|
1229
|
+
*/
|
|
1230
|
+
const _neutralizeSubtree = function _neutralizeSubtree(root) {
|
|
1231
|
+
const stack = [root];
|
|
1232
|
+
while (stack.length > 0) {
|
|
1233
|
+
const node = stack.pop();
|
|
1234
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
1235
|
+
if (nodeType === NODE_TYPE.element) {
|
|
1236
|
+
_stripDisallowedAttributes(node);
|
|
1237
|
+
}
|
|
1238
|
+
const childNodes = getChildNodes(node);
|
|
1239
|
+
if (childNodes) {
|
|
1240
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
1241
|
+
stack.push(childNodes[i]);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
922
1246
|
/**
|
|
923
1247
|
* _initDocument
|
|
924
1248
|
*
|
|
@@ -940,7 +1264,7 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
940
1264
|
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
|
941
1265
|
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
|
942
1266
|
}
|
|
943
|
-
const dirtyPayload = trustedTypesPolicy ?
|
|
1267
|
+
const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
|
|
944
1268
|
/*
|
|
945
1269
|
* Use the DOMParser API by default, fallback later if needs be
|
|
946
1270
|
* DOMParser not work for svg when has multiple root element.
|
|
@@ -980,6 +1304,20 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
980
1304
|
// eslint-disable-next-line no-bitwise
|
|
981
1305
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
982
1306
|
};
|
|
1307
|
+
/**
|
|
1308
|
+
* Replace template expression syntax (mustache, ERB, template
|
|
1309
|
+
* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
|
|
1310
|
+
* sites. Order matters: mustache, then ERB, then template literal.
|
|
1311
|
+
*
|
|
1312
|
+
* @param value the string to scrub
|
|
1313
|
+
* @returns the scrubbed string
|
|
1314
|
+
*/
|
|
1315
|
+
const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
|
|
1316
|
+
value = stringReplace(value, MUSTACHE_EXPR$1, ' ');
|
|
1317
|
+
value = stringReplace(value, ERB_EXPR$1, ' ');
|
|
1318
|
+
value = stringReplace(value, TMPLIT_EXPR$1, ' ');
|
|
1319
|
+
return value;
|
|
1320
|
+
};
|
|
983
1321
|
/**
|
|
984
1322
|
* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
|
|
985
1323
|
* character data of an element subtree. Used as the final safety net for
|
|
@@ -999,29 +1337,100 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
999
1337
|
*
|
|
1000
1338
|
* @param node The root element whose character data should be scrubbed.
|
|
1001
1339
|
*/
|
|
1002
|
-
const
|
|
1340
|
+
const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
|
|
1341
|
+
var _node$querySelectorAl;
|
|
1003
1342
|
node.normalize();
|
|
1004
1343
|
const walker = createNodeIterator.call(node.ownerDocument || node, node,
|
|
1005
1344
|
// eslint-disable-next-line no-bitwise
|
|
1006
1345
|
NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
|
|
1007
1346
|
let currentNode = walker.nextNode();
|
|
1008
1347
|
while (currentNode) {
|
|
1009
|
-
|
|
1010
|
-
arrayForEach([MUSTACHE_EXPR$1, ERB_EXPR$1, TMPLIT_EXPR$1], expr => {
|
|
1011
|
-
data = stringReplace(data, expr, ' ');
|
|
1012
|
-
});
|
|
1013
|
-
currentNode.data = data;
|
|
1348
|
+
currentNode.data = _stripTemplateExpressions(currentNode.data);
|
|
1014
1349
|
currentNode = walker.nextNode();
|
|
1015
1350
|
}
|
|
1351
|
+
// NodeIterator does not descend into <template>.content per the DOM spec,
|
|
1352
|
+
// so we must explicitly recurse into each template's content fragment,
|
|
1353
|
+
// mirroring the approach used by _sanitizeShadowDOM.
|
|
1354
|
+
const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, 'template');
|
|
1355
|
+
if (templates) {
|
|
1356
|
+
arrayForEach(templates, tmpl => {
|
|
1357
|
+
if (_isDocumentFragment(tmpl.content)) {
|
|
1358
|
+
_scrubTemplateExpressions2(tmpl.content);
|
|
1359
|
+
}
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1016
1362
|
};
|
|
1017
1363
|
/**
|
|
1018
1364
|
* _isClobbered
|
|
1019
1365
|
*
|
|
1366
|
+
* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
|
|
1367
|
+
* interface with [LegacyOverrideBuiltIns]; a descendant element with a
|
|
1368
|
+
* `name` attribute matching a prototype property shadows that property
|
|
1369
|
+
* on direct reads. We use this check at the IN_PLACE entry-point and
|
|
1370
|
+
* during attribute sanitization to refuse clobbered forms.
|
|
1371
|
+
*
|
|
1020
1372
|
* @param element element to check for clobbering attacks
|
|
1021
1373
|
* @return true if clobbered, false if safe
|
|
1022
1374
|
*/
|
|
1023
1375
|
const _isClobbered = function _isClobbered(element) {
|
|
1024
|
-
|
|
1376
|
+
// Realm-independent tag-name probe. If we can't determine the tag
|
|
1377
|
+
// name at all, we can't reason about clobbering — return false
|
|
1378
|
+
// (the caller's other defences still apply).
|
|
1379
|
+
const realTagName = getNodeName ? getNodeName(element) : null;
|
|
1380
|
+
if (typeof realTagName !== 'string') {
|
|
1381
|
+
return false;
|
|
1382
|
+
}
|
|
1383
|
+
if (transformCaseFunc(realTagName) !== 'form') {
|
|
1384
|
+
return false;
|
|
1385
|
+
}
|
|
1386
|
+
return typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' ||
|
|
1387
|
+
// Realm-safe NamedNodeMap detection: equality against the cached
|
|
1388
|
+
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
1389
|
+
// makes the direct read diverge from the cached read; a clean form
|
|
1390
|
+
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
1391
|
+
// canonical NamedNodeMap.
|
|
1392
|
+
element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||
|
|
1393
|
+
// NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
1394
|
+
// returns the integer 1 for any Element regardless of realm; direct
|
|
1395
|
+
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
1396
|
+
// the named child element. Cheap addition — nodeType is read from
|
|
1397
|
+
// an internal slot, no serialization cost — and removes a residual
|
|
1398
|
+
// clobbering surface used by several mXSS / PI / comment branches
|
|
1399
|
+
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
1400
|
+
element.nodeType !== getNodeType(element) ||
|
|
1401
|
+
// HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
1402
|
+
// "childNodes" shadows the prototype getter. Direct reads of
|
|
1403
|
+
// form.childNodes from a clobbered form return the named child
|
|
1404
|
+
// instead of the real NodeList, so any walk that reads it directly
|
|
1405
|
+
// skips the form's real children. Compare the direct read to the
|
|
1406
|
+
// cached Node.prototype getter — when the form's named-property
|
|
1407
|
+
// getter intercepts the read, the two values differ and we flag
|
|
1408
|
+
// the form. This catches every clobbering child type (input,
|
|
1409
|
+
// select, etc.) regardless of whether the named child happens to
|
|
1410
|
+
// carry a numeric .length, which a typeof-based probe would miss
|
|
1411
|
+
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
1412
|
+
element.childNodes !== getChildNodes(element);
|
|
1413
|
+
};
|
|
1414
|
+
/**
|
|
1415
|
+
* Checks whether the given value is a DocumentFragment from any realm.
|
|
1416
|
+
*
|
|
1417
|
+
* The realm-independent replacement reads `nodeType` through the cached
|
|
1418
|
+
* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
|
|
1419
|
+
* constant (11). nodeType is a numeric value resolved from the node's
|
|
1420
|
+
* internal slot, identical across realms for the same kind of node.
|
|
1421
|
+
*
|
|
1422
|
+
* @param value object to check
|
|
1423
|
+
* @return true if value is a DocumentFragment-shaped node from any realm
|
|
1424
|
+
*/
|
|
1425
|
+
const _isDocumentFragment = function _isDocumentFragment(value) {
|
|
1426
|
+
if (!getNodeType || typeof value !== 'object' || value === null) {
|
|
1427
|
+
return false;
|
|
1428
|
+
}
|
|
1429
|
+
try {
|
|
1430
|
+
return getNodeType(value) === NODE_TYPE.documentFragment;
|
|
1431
|
+
} catch (_) {
|
|
1432
|
+
return false;
|
|
1433
|
+
}
|
|
1025
1434
|
};
|
|
1026
1435
|
/**
|
|
1027
1436
|
* Checks whether the given object is a DOM node, including nodes that
|
|
@@ -1031,12 +1440,6 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1031
1440
|
* sanitize() to silently stringify them and reset IN_PLACE to false,
|
|
1032
1441
|
* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
|
|
1033
1442
|
*
|
|
1034
|
-
* Implementation: call the cached `nodeType` getter from Node.prototype
|
|
1035
|
-
* directly on the value. This bypasses any clobbered instance property
|
|
1036
|
-
* (e.g. a child element named "nodeType") and works across realms
|
|
1037
|
-
* because the WebIDL `nodeType` getter reads an internal slot that
|
|
1038
|
-
* every real Node has, regardless of which window minted it.
|
|
1039
|
-
*
|
|
1040
1443
|
* @param value object to check whether it's a DOM node
|
|
1041
1444
|
* @return true if value is a DOM node from any realm
|
|
1042
1445
|
*/
|
|
@@ -1051,10 +1454,104 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1051
1454
|
}
|
|
1052
1455
|
};
|
|
1053
1456
|
function _executeHooks(hooks, currentNode, data) {
|
|
1457
|
+
if (hooks.length === 0) {
|
|
1458
|
+
return;
|
|
1459
|
+
}
|
|
1054
1460
|
arrayForEach(hooks, hook => {
|
|
1055
1461
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
1056
1462
|
});
|
|
1057
1463
|
}
|
|
1464
|
+
/**
|
|
1465
|
+
* Structural-threat checks that condemn a node regardless of the
|
|
1466
|
+
* allowlists: mXSS via namespace confusion, risky CSS construction,
|
|
1467
|
+
* processing instructions, markup-bearing comments. Pure predicate;
|
|
1468
|
+
* the caller removes. Check order is load-bearing.
|
|
1469
|
+
*
|
|
1470
|
+
* @param currentNode the node to inspect
|
|
1471
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
1472
|
+
* @return true if the node must be removed
|
|
1473
|
+
*/
|
|
1474
|
+
const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
|
|
1475
|
+
/* Detect mXSS attempts abusing namespace confusion */
|
|
1476
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
|
|
1477
|
+
return true;
|
|
1478
|
+
}
|
|
1479
|
+
/* Remove risky CSS construction leading to mXSS */
|
|
1480
|
+
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {
|
|
1481
|
+
return true;
|
|
1482
|
+
}
|
|
1483
|
+
/* Remove any occurrence of processing instructions */
|
|
1484
|
+
if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
|
|
1485
|
+
return true;
|
|
1486
|
+
}
|
|
1487
|
+
/* Remove any kind of possibly harmful comments */
|
|
1488
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
|
|
1489
|
+
return true;
|
|
1490
|
+
}
|
|
1491
|
+
return false;
|
|
1492
|
+
};
|
|
1493
|
+
/**
|
|
1494
|
+
* Handle a node whose tag is forbidden or not allowlisted: keep
|
|
1495
|
+
* allowed custom elements (false return exits _sanitizeElements
|
|
1496
|
+
* early - namespace/fallback checks and the afterSanitizeElements
|
|
1497
|
+
* hook are intentionally skipped for kept custom elements), else
|
|
1498
|
+
* hoist content per KEEP_CONTENT and remove.
|
|
1499
|
+
*
|
|
1500
|
+
* @param currentNode the disallowed node
|
|
1501
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
1502
|
+
* @return true if the node was removed, false if kept
|
|
1503
|
+
*/
|
|
1504
|
+
const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName) {
|
|
1505
|
+
/* Check if we have a custom element to handle */
|
|
1506
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
1507
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
1508
|
+
return false;
|
|
1509
|
+
}
|
|
1510
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
|
1511
|
+
return false;
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
/* Keep content except for bad-listed elements.
|
|
1515
|
+
Use the cached prototype getters exclusively — the previous code
|
|
1516
|
+
had `|| currentNode.parentNode` / `|| currentNode.childNodes`
|
|
1517
|
+
fallbacks, but the cached getters always return the canonical
|
|
1518
|
+
value (or null for a real parent-less node), so the fallback
|
|
1519
|
+
path was dead in safe cases and a clobbering surface in unsafe
|
|
1520
|
+
ones. Falsy cached results stay falsy; the `if (childNodes &&
|
|
1521
|
+
parentNode)` check already gates correctly. */
|
|
1522
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1523
|
+
const parentNode = getParentNode(currentNode);
|
|
1524
|
+
const childNodes = getChildNodes(currentNode);
|
|
1525
|
+
if (childNodes && parentNode) {
|
|
1526
|
+
const childCount = childNodes.length;
|
|
1527
|
+
/* In-place: hoist the *original* children so the iterator visits
|
|
1528
|
+
and sanitises them through the same allowlist pass as every other
|
|
1529
|
+
node. The caller built the tree in the live document, so the
|
|
1530
|
+
originals carry already-queued resource events (`<img onerror>`,
|
|
1531
|
+
`<video>`/`<audio>` error, lazy/`onload`, …); cloning would leave
|
|
1532
|
+
those originals detached but still armed, firing in page scope
|
|
1533
|
+
while the returned tree looked clean. Moving is safe in-place: the
|
|
1534
|
+
root is pre-validated as an allowed tag and so is never the node
|
|
1535
|
+
being removed, which keeps `parentNode` inside the iterator root
|
|
1536
|
+
and the relocated child inside the serialised tree.
|
|
1537
|
+
Otherwise (string / DOM-copy paths): clone. The iterator is rooted
|
|
1538
|
+
at — and the result serialised from — `body`, so a restrictive
|
|
1539
|
+
ALLOWED_TAGS that removes `body` itself must leave its content in
|
|
1540
|
+
place, which only cloning does; and those paths parse into an
|
|
1541
|
+
inert document, so their discarded originals never had a queued
|
|
1542
|
+
event to neutralise.
|
|
1543
|
+
`childNodes` is live; a tail-to-head walk keeps `childNodes[i]`
|
|
1544
|
+
valid whether we move (drops the trailing entry) or clone (leaves
|
|
1545
|
+
the list intact). */
|
|
1546
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
1547
|
+
const hoisted = IN_PLACE ? childNodes[i] : cloneNode(childNodes[i], true);
|
|
1548
|
+
parentNode.insertBefore(hoisted, getNextSibling(currentNode));
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
_forceRemove(currentNode);
|
|
1553
|
+
return true;
|
|
1554
|
+
};
|
|
1058
1555
|
/**
|
|
1059
1556
|
* _sanitizeElements
|
|
1060
1557
|
*
|
|
@@ -1065,7 +1562,6 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1065
1562
|
* @return true if node was killed, false if left alive
|
|
1066
1563
|
*/
|
|
1067
1564
|
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
1068
|
-
let content = null;
|
|
1069
1565
|
/* Execute a hook if present */
|
|
1070
1566
|
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
1071
1567
|
/* Check if element is clobbered or can clobber */
|
|
@@ -1074,75 +1570,41 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1074
1570
|
return true;
|
|
1075
1571
|
}
|
|
1076
1572
|
/* Now let's check the element's type and name */
|
|
1077
|
-
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
1573
|
+
const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);
|
|
1078
1574
|
/* Execute a hook if present */
|
|
1079
1575
|
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
1080
1576
|
tagName,
|
|
1081
1577
|
allowedTags: ALLOWED_TAGS
|
|
1082
1578
|
});
|
|
1083
|
-
/*
|
|
1084
|
-
if (
|
|
1085
|
-
_forceRemove(currentNode);
|
|
1086
|
-
return true;
|
|
1087
|
-
}
|
|
1088
|
-
/* Remove risky CSS construction leading to mXSS */
|
|
1089
|
-
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {
|
|
1090
|
-
_forceRemove(currentNode);
|
|
1091
|
-
return true;
|
|
1092
|
-
}
|
|
1093
|
-
/* Remove any occurrence of processing instructions */
|
|
1094
|
-
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
1095
|
-
_forceRemove(currentNode);
|
|
1096
|
-
return true;
|
|
1097
|
-
}
|
|
1098
|
-
/* Remove any kind of possibly harmful comments */
|
|
1099
|
-
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
1579
|
+
/* Remove mXSS vectors, processing instructions and risky comments */
|
|
1580
|
+
if (_isUnsafeNode(currentNode, tagName)) {
|
|
1100
1581
|
_forceRemove(currentNode);
|
|
1101
1582
|
return true;
|
|
1102
1583
|
}
|
|
1103
1584
|
/* Remove element if anything forbids its presence */
|
|
1104
1585
|
if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1116
|
-
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
1117
|
-
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
1118
|
-
if (childNodes && parentNode) {
|
|
1119
|
-
const childCount = childNodes.length;
|
|
1120
|
-
for (let i = childCount - 1; i >= 0; --i) {
|
|
1121
|
-
const childClone = cloneNode(childNodes[i], true);
|
|
1122
|
-
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
_forceRemove(currentNode);
|
|
1127
|
-
return true;
|
|
1128
|
-
}
|
|
1129
|
-
/* Check whether element has a valid namespace */
|
|
1130
|
-
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
1586
|
+
return _sanitizeDisallowedNode(currentNode, tagName);
|
|
1587
|
+
}
|
|
1588
|
+
/* Check whether element has a valid namespace.
|
|
1589
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype
|
|
1590
|
+
nodeType getter rather than `instanceof Element`, which is realm-
|
|
1591
|
+
bound and short-circuits to false for any node minted in a different
|
|
1592
|
+
realm — letting a foreign-realm element with a forbidden namespace
|
|
1593
|
+
slip past the namespace check entirely. */
|
|
1594
|
+
const nt = getNodeType ? getNodeType(currentNode) : currentNode.nodeType;
|
|
1595
|
+
if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
|
|
1131
1596
|
_forceRemove(currentNode);
|
|
1132
1597
|
return true;
|
|
1133
1598
|
}
|
|
1134
1599
|
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
1135
|
-
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(
|
|
1600
|
+
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
|
|
1136
1601
|
_forceRemove(currentNode);
|
|
1137
1602
|
return true;
|
|
1138
1603
|
}
|
|
1139
1604
|
/* Sanitize element content to be template-safe */
|
|
1140
1605
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
1141
1606
|
/* Get the element's text content */
|
|
1142
|
-
content = currentNode.textContent;
|
|
1143
|
-
arrayForEach([MUSTACHE_EXPR$1, ERB_EXPR$1, TMPLIT_EXPR$1], expr => {
|
|
1144
|
-
content = stringReplace(content, expr, ' ');
|
|
1145
|
-
});
|
|
1607
|
+
const content = _stripTemplateExpressions(currentNode.textContent);
|
|
1146
1608
|
if (currentNode.textContent !== content) {
|
|
1147
1609
|
arrayPush(DOMPurify.removed, {
|
|
1148
1610
|
element: currentNode.cloneNode()
|
|
@@ -1177,7 +1639,7 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1177
1639
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
1178
1640
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
1179
1641
|
We don't need to check the value; it's always URI safe. */
|
|
1180
|
-
if (ALLOW_DATA_ATTR &&
|
|
1642
|
+
if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; else if (!nameIsPermitted) {
|
|
1181
1643
|
if (
|
|
1182
1644
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1183
1645
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
@@ -1209,6 +1671,63 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1209
1671
|
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
1210
1672
|
return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
|
|
1211
1673
|
};
|
|
1674
|
+
/**
|
|
1675
|
+
* Wrap an attribute value in the matching Trusted Types object when
|
|
1676
|
+
* the active policy requires it. Namespaced attributes pass through
|
|
1677
|
+
* unchanged (no TT support yet, see
|
|
1678
|
+
* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
|
|
1679
|
+
*
|
|
1680
|
+
* @param lcTag lowercase tag name of the containing element
|
|
1681
|
+
* @param lcName lowercase attribute name
|
|
1682
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
1683
|
+
* @param value the attribute value to wrap
|
|
1684
|
+
* @return the value, wrapped when Trusted Types demand it
|
|
1685
|
+
*/
|
|
1686
|
+
const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
|
|
1687
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function' && !namespaceURI) {
|
|
1688
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1689
|
+
case 'TrustedHTML':
|
|
1690
|
+
{
|
|
1691
|
+
return _createTrustedHTML(value);
|
|
1692
|
+
}
|
|
1693
|
+
case 'TrustedScriptURL':
|
|
1694
|
+
{
|
|
1695
|
+
return _createTrustedScriptURL(value);
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
return value;
|
|
1700
|
+
};
|
|
1701
|
+
/**
|
|
1702
|
+
* Write a modified attribute value back onto the element. On
|
|
1703
|
+
* success, re-probe for clobbering introduced by the new value and
|
|
1704
|
+
* remove the element when found; otherwise pop the removal entry
|
|
1705
|
+
* recorded by the earlier _removeAttribute (long-standing pairing
|
|
1706
|
+
* with the SANITIZE_NAMED_PROPS path - do not "fix" casually). On
|
|
1707
|
+
* failure, remove the attribute instead.
|
|
1708
|
+
*
|
|
1709
|
+
* @param currentNode the element carrying the attribute
|
|
1710
|
+
* @param name the attribute name as present on the element
|
|
1711
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
1712
|
+
* @param value the new attribute value
|
|
1713
|
+
*/
|
|
1714
|
+
const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
|
|
1715
|
+
try {
|
|
1716
|
+
if (namespaceURI) {
|
|
1717
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1718
|
+
} else {
|
|
1719
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1720
|
+
currentNode.setAttribute(name, value);
|
|
1721
|
+
}
|
|
1722
|
+
if (_isClobbered(currentNode)) {
|
|
1723
|
+
_forceRemove(currentNode);
|
|
1724
|
+
} else {
|
|
1725
|
+
arrayPop(DOMPurify.removed);
|
|
1726
|
+
}
|
|
1727
|
+
} catch (_) {
|
|
1728
|
+
_removeAttribute(name, currentNode);
|
|
1729
|
+
}
|
|
1730
|
+
};
|
|
1212
1731
|
/**
|
|
1213
1732
|
* _sanitizeAttributes
|
|
1214
1733
|
*
|
|
@@ -1235,6 +1754,7 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1235
1754
|
forceKeepAttr: undefined
|
|
1236
1755
|
};
|
|
1237
1756
|
let l = attributes.length;
|
|
1757
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1238
1758
|
/* Go backwards over all attributes; safely remove bad ones */
|
|
1239
1759
|
while (l--) {
|
|
1240
1760
|
const attr = attributes[l];
|
|
@@ -1272,7 +1792,7 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1272
1792
|
_removeAttribute(name, currentNode);
|
|
1273
1793
|
continue;
|
|
1274
1794
|
}
|
|
1275
|
-
/* Did the hooks
|
|
1795
|
+
/* Did the hooks force-keep the attribute? */
|
|
1276
1796
|
if (hookEvent.forceKeepAttr) {
|
|
1277
1797
|
continue;
|
|
1278
1798
|
}
|
|
@@ -1282,56 +1802,24 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1282
1802
|
continue;
|
|
1283
1803
|
}
|
|
1284
1804
|
/* Work around a security issue in jQuery 3.0 */
|
|
1285
|
-
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(
|
|
1805
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
|
|
1286
1806
|
_removeAttribute(name, currentNode);
|
|
1287
1807
|
continue;
|
|
1288
1808
|
}
|
|
1289
1809
|
/* Sanitize attribute content to be template-safe */
|
|
1290
1810
|
if (SAFE_FOR_TEMPLATES) {
|
|
1291
|
-
|
|
1292
|
-
value = stringReplace(value, expr, ' ');
|
|
1293
|
-
});
|
|
1811
|
+
value = _stripTemplateExpressions(value);
|
|
1294
1812
|
}
|
|
1295
1813
|
/* Is `value` valid for this attribute? */
|
|
1296
|
-
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1297
1814
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1298
1815
|
_removeAttribute(name, currentNode);
|
|
1299
1816
|
continue;
|
|
1300
1817
|
}
|
|
1301
1818
|
/* Handle attributes that require Trusted Types */
|
|
1302
|
-
|
|
1303
|
-
if (namespaceURI) ; else {
|
|
1304
|
-
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1305
|
-
case 'TrustedHTML':
|
|
1306
|
-
{
|
|
1307
|
-
value = trustedTypesPolicy.createHTML(value);
|
|
1308
|
-
break;
|
|
1309
|
-
}
|
|
1310
|
-
case 'TrustedScriptURL':
|
|
1311
|
-
{
|
|
1312
|
-
value = trustedTypesPolicy.createScriptURL(value);
|
|
1313
|
-
break;
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1819
|
+
value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
|
|
1318
1820
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
1319
1821
|
if (value !== initValue) {
|
|
1320
|
-
|
|
1321
|
-
if (namespaceURI) {
|
|
1322
|
-
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1323
|
-
} else {
|
|
1324
|
-
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1325
|
-
currentNode.setAttribute(name, value);
|
|
1326
|
-
}
|
|
1327
|
-
if (_isClobbered(currentNode)) {
|
|
1328
|
-
_forceRemove(currentNode);
|
|
1329
|
-
} else {
|
|
1330
|
-
arrayPop(DOMPurify.removed);
|
|
1331
|
-
}
|
|
1332
|
-
} catch (_) {
|
|
1333
|
-
_removeAttribute(name, currentNode);
|
|
1334
|
-
}
|
|
1822
|
+
_setAttributeValue(currentNode, name, namespaceURI, value);
|
|
1335
1823
|
}
|
|
1336
1824
|
}
|
|
1337
1825
|
/* Execute a hook if present */
|
|
@@ -1354,10 +1842,31 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1354
1842
|
_sanitizeElements(shadowNode);
|
|
1355
1843
|
/* Check attributes next */
|
|
1356
1844
|
_sanitizeAttributes(shadowNode);
|
|
1357
|
-
/* Deep shadow DOM detected
|
|
1358
|
-
|
|
1845
|
+
/* Deep shadow DOM detected.
|
|
1846
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the
|
|
1847
|
+
DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we
|
|
1848
|
+
recurse into <template>.content from foreign realms too. */
|
|
1849
|
+
if (_isDocumentFragment(shadowNode.content)) {
|
|
1359
1850
|
_sanitizeShadowDOM2(shadowNode.content);
|
|
1360
1851
|
}
|
|
1852
|
+
/* An element iterated here may itself host an attached
|
|
1853
|
+
shadow root. The default NodeIterator does not enter shadow
|
|
1854
|
+
trees, so a shadow root nested inside template.content was
|
|
1855
|
+
previously reached by no walk at all (the pre-pass at
|
|
1856
|
+
_sanitizeAttachedShadowRoots descends via childNodes, which
|
|
1857
|
+
doesn't enter template.content; the template-content recursion
|
|
1858
|
+
above iterates the content but never inspected shadowRoot).
|
|
1859
|
+
Walk it explicitly. The nodeType guard avoids reading
|
|
1860
|
+
shadowRoot off text / comment / CDATA / PI nodes that the
|
|
1861
|
+
iterator also surfaces. */
|
|
1862
|
+
const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType;
|
|
1863
|
+
if (shadowNodeType === NODE_TYPE.element) {
|
|
1864
|
+
const innerSr = getShadowRoot(shadowNode);
|
|
1865
|
+
if (_isDocumentFragment(innerSr)) {
|
|
1866
|
+
_sanitizeAttachedShadowRoots(innerSr);
|
|
1867
|
+
_sanitizeShadowDOM2(innerSr);
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1361
1870
|
}
|
|
1362
1871
|
/* Execute a hook if present */
|
|
1363
1872
|
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
@@ -1381,28 +1890,83 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1381
1890
|
*
|
|
1382
1891
|
* @param root the subtree root to walk for attached shadow roots
|
|
1383
1892
|
*/
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1405
|
-
|
|
1893
|
+
const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
|
|
1894
|
+
/* Iterative (explicit stack) rather than per-child recursion. DOM APIs
|
|
1895
|
+
impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data
|
|
1896
|
+
built straight into the DOM — the IN_PLACE surface) deeper than the JS
|
|
1897
|
+
call-stack budget would otherwise overflow native recursion here and
|
|
1898
|
+
throw at the IN_PLACE entry pre-pass, before a single node is
|
|
1899
|
+
sanitized, leaving the caller's live tree untouched (fail-open). See
|
|
1900
|
+
campaign-3 F4. A heap stack keeps depth off the call stack.
|
|
1901
|
+
Each work item is either a node to descend into, or a deferred
|
|
1902
|
+
`_sanitizeShadowDOM` for an already-walked shadow root. The deferred
|
|
1903
|
+
form preserves the original post-order discipline: a shadow root's
|
|
1904
|
+
nested shadow roots are discovered before the outer shadow is
|
|
1905
|
+
sanitized (which may remove hosts). Pushes are in reverse of the
|
|
1906
|
+
desired processing order (LIFO): template content, then children, then
|
|
1907
|
+
the shadow-sanitize, then the shadow walk — so the order matches the
|
|
1908
|
+
previous recursion exactly. */
|
|
1909
|
+
const stack = [{
|
|
1910
|
+
node: root,
|
|
1911
|
+
shadow: null
|
|
1912
|
+
}];
|
|
1913
|
+
while (stack.length > 0) {
|
|
1914
|
+
const item = stack.pop();
|
|
1915
|
+
/* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */
|
|
1916
|
+
if (item.shadow) {
|
|
1917
|
+
_sanitizeShadowDOM2(item.shadow);
|
|
1918
|
+
continue;
|
|
1919
|
+
}
|
|
1920
|
+
const node = item.node;
|
|
1921
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
1922
|
+
const isElement = nodeType === NODE_TYPE.element;
|
|
1923
|
+
/* (pushed last → processed first) Children, snapshotted in reverse so
|
|
1924
|
+
the first child is processed first. Snapshotting matters because a
|
|
1925
|
+
hook may detach siblings mid-walk. */
|
|
1926
|
+
const childNodes = getChildNodes(node);
|
|
1927
|
+
if (childNodes) {
|
|
1928
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
1929
|
+
stack.push({
|
|
1930
|
+
node: childNodes[i],
|
|
1931
|
+
shadow: null
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
/* (pushed before children → processed after them, matching the old
|
|
1936
|
+
"template content last" order) When the node is a <template>,
|
|
1937
|
+
descend into its content. */
|
|
1938
|
+
if (isElement) {
|
|
1939
|
+
const rootName = getNodeName ? getNodeName(node) : null;
|
|
1940
|
+
if (typeof rootName === 'string' && transformCaseFunc(rootName) === 'template') {
|
|
1941
|
+
const content = node.content;
|
|
1942
|
+
if (_isDocumentFragment(content)) {
|
|
1943
|
+
stack.push({
|
|
1944
|
+
node: content,
|
|
1945
|
+
shadow: null
|
|
1946
|
+
});
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
/* Shadow root (processed first): walk its subtree, then sanitise it.
|
|
1951
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
1952
|
+
rather than `instanceof DocumentFragment`, which is realm-bound and
|
|
1953
|
+
silently skipped foreign-realm shadow roots (e.g.
|
|
1954
|
+
iframe.contentDocument attachShadow). */
|
|
1955
|
+
if (isElement) {
|
|
1956
|
+
const sr = getShadowRoot(node);
|
|
1957
|
+
if (_isDocumentFragment(sr)) {
|
|
1958
|
+
/* Push the deferred sanitise first so it pops after the shadow
|
|
1959
|
+
walk we push next, i.e. nested shadow roots are discovered
|
|
1960
|
+
before this one is sanitised. */
|
|
1961
|
+
stack.push({
|
|
1962
|
+
node: null,
|
|
1963
|
+
shadow: sr
|
|
1964
|
+
}, {
|
|
1965
|
+
node: sr,
|
|
1966
|
+
shadow: null
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1406
1970
|
}
|
|
1407
1971
|
};
|
|
1408
1972
|
// eslint-disable-next-line complexity
|
|
@@ -1436,22 +2000,50 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1436
2000
|
}
|
|
1437
2001
|
/* Clean up removed elements */
|
|
1438
2002
|
DOMPurify.removed = [];
|
|
1439
|
-
/*
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
2003
|
+
/* Resolve IN_PLACE for this call without mutating persistent config.
|
|
2004
|
+
Writing the IN_PLACE closure variable here leaks under setConfig(),
|
|
2005
|
+
where _parseConfig is skipped on later calls: a single string call would
|
|
2006
|
+
disable in-place mode for every subsequent node call, returning a
|
|
2007
|
+
sanitized copy while leaving the caller's node — which in-place callers
|
|
2008
|
+
keep using and whose return value they ignore — unsanitized. REPORT-2. */
|
|
2009
|
+
const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);
|
|
2010
|
+
if (inPlace) {
|
|
2011
|
+
/* Do some early pre-sanitization to avoid unsafe root nodes.
|
|
2012
|
+
Read nodeName through the cached prototype getter — a clobbering
|
|
2013
|
+
child named "nodeName" on the form root would otherwise shadow
|
|
2014
|
+
the property and let this check skip the root-allowlist
|
|
2015
|
+
validation entirely. */
|
|
2016
|
+
const nn = getNodeName ? getNodeName(dirty) : dirty.nodeName;
|
|
1446
2017
|
if (typeof nn === 'string') {
|
|
1447
2018
|
const tagName = transformCaseFunc(nn);
|
|
1448
2019
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
1449
2020
|
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
|
1450
2021
|
}
|
|
1451
2022
|
}
|
|
2023
|
+
/* Pre-flight the root through _isClobbered. The iterator-driven
|
|
2024
|
+
removal path can not detach a parent-less root: _forceRemove
|
|
2025
|
+
falls through to Element.prototype.remove(), which per spec
|
|
2026
|
+
is a no-op on a node with no parent. A clobbered root would
|
|
2027
|
+
then survive the main loop with its attributes uninspected,
|
|
2028
|
+
because _sanitizeAttributes early-returns on _isClobbered. The
|
|
2029
|
+
result would be an attacker-controlled form, complete with any
|
|
2030
|
+
event-handler attributes the caller passed in, handed back to
|
|
2031
|
+
the application unsanitized. Refuse to sanitize such a root
|
|
2032
|
+
the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */
|
|
2033
|
+
if (_isClobbered(dirty)) {
|
|
2034
|
+
throw typeErrorCreate('root node is clobbered and cannot be sanitized in-place');
|
|
2035
|
+
}
|
|
1452
2036
|
/* Sanitize attached shadow roots before the main iterator runs.
|
|
1453
|
-
The iterator does not descend into shadow trees.
|
|
1454
|
-
|
|
2037
|
+
The iterator does not descend into shadow trees. Same fail-closed
|
|
2038
|
+
barrier as the main walk (campaign-3 F2): a custom-element reaction
|
|
2039
|
+
inside a shadow root could abort this pre-pass before the walk runs,
|
|
2040
|
+
which would otherwise leave the entire live tree unsanitized. */
|
|
2041
|
+
try {
|
|
2042
|
+
_sanitizeAttachedShadowRoots(dirty);
|
|
2043
|
+
} catch (error) {
|
|
2044
|
+
_neutralizeRoot(dirty);
|
|
2045
|
+
throw error;
|
|
2046
|
+
}
|
|
1455
2047
|
} else if (_isNode(dirty)) {
|
|
1456
2048
|
/* If dirty is a DOM element, append to an empty document to avoid
|
|
1457
2049
|
elements being stripped by the parser */
|
|
@@ -1468,14 +2060,16 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1468
2060
|
}
|
|
1469
2061
|
/* Clonable shadow roots are deep-cloned by importNode(); sanitize
|
|
1470
2062
|
them before the main iterator runs, since the iterator does not
|
|
1471
|
-
descend into shadow trees.
|
|
1472
|
-
|
|
2063
|
+
descend into shadow trees. The walk routes every read through a
|
|
2064
|
+
cached prototype getter so clobbering descendants on a form root
|
|
2065
|
+
cannot hide a shadow host from this pass. */
|
|
2066
|
+
_sanitizeAttachedShadowRoots(importedNode);
|
|
1473
2067
|
} else {
|
|
1474
2068
|
/* Exit directly if we have nothing to do */
|
|
1475
2069
|
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
|
1476
2070
|
// eslint-disable-next-line unicorn/prefer-includes
|
|
1477
2071
|
dirty.indexOf('<') === -1) {
|
|
1478
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
2072
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
|
|
1479
2073
|
}
|
|
1480
2074
|
/* Initialize the document to work on */
|
|
1481
2075
|
body = _initDocument(dirty);
|
|
@@ -1489,29 +2083,59 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1489
2083
|
_forceRemove(body.firstChild);
|
|
1490
2084
|
}
|
|
1491
2085
|
/* Get node iterator */
|
|
1492
|
-
const nodeIterator = _createNodeIterator(
|
|
1493
|
-
/* Now start iterating over the created document
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
2086
|
+
const nodeIterator = _createNodeIterator(inPlace ? dirty : body);
|
|
2087
|
+
/* Now start iterating over the created document.
|
|
2088
|
+
The walk runs inside an exception barrier (campaign-3 F2): a re-entrant
|
|
2089
|
+
engine/custom-element mutation can detach a node mid-walk so
|
|
2090
|
+
`_forceRemove`'s parentless guard throws, aborting the loop. Without the
|
|
2091
|
+
barrier the caller's in-place tree would be left half-sanitized with the
|
|
2092
|
+
unvisited tail still armed. On any throw we fail closed — strip the
|
|
2093
|
+
in-place root bare — then rethrow so the existing throw contract is
|
|
2094
|
+
preserved. (String/DOM-copy paths never return the partial body, so the
|
|
2095
|
+
propagating throw is already fail-closed there.) */
|
|
2096
|
+
try {
|
|
2097
|
+
while (currentNode = nodeIterator.nextNode()) {
|
|
2098
|
+
/* Sanitize tags and elements */
|
|
2099
|
+
_sanitizeElements(currentNode);
|
|
2100
|
+
/* Check attributes next */
|
|
2101
|
+
_sanitizeAttributes(currentNode);
|
|
2102
|
+
/* Shadow DOM detected, sanitize it.
|
|
2103
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
2104
|
+
instead of instanceof, so foreign-realm <template>.content is
|
|
2105
|
+
walked correctly. */
|
|
2106
|
+
if (_isDocumentFragment(currentNode.content)) {
|
|
2107
|
+
_sanitizeShadowDOM2(currentNode.content);
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
} catch (error) {
|
|
2111
|
+
if (inPlace) {
|
|
2112
|
+
_neutralizeRoot(dirty);
|
|
1502
2113
|
}
|
|
2114
|
+
throw error;
|
|
1503
2115
|
}
|
|
1504
2116
|
/* If we sanitized `dirty` in-place, return it. */
|
|
1505
|
-
if (
|
|
2117
|
+
if (inPlace) {
|
|
2118
|
+
/* Fail-closed completion of the audit-5 F1 fix: every node removed from
|
|
2119
|
+
the caller's live tree is detached but may still hold a queued
|
|
2120
|
+
resource-event handler that fires in page scope after we return. The
|
|
2121
|
+
move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the
|
|
2122
|
+
non-allow-listed attributes off every other removed subtree (clobber,
|
|
2123
|
+
mXSS, namespace, comments, KEEP_CONTENT:false, …) so those handlers are
|
|
2124
|
+
cancelled before any event can fire. Runs synchronously, pre-return. */
|
|
2125
|
+
arrayForEach(DOMPurify.removed, entry => {
|
|
2126
|
+
if (entry.element) {
|
|
2127
|
+
_neutralizeSubtree(entry.element);
|
|
2128
|
+
}
|
|
2129
|
+
});
|
|
1506
2130
|
if (SAFE_FOR_TEMPLATES) {
|
|
1507
|
-
|
|
2131
|
+
_scrubTemplateExpressions2(dirty);
|
|
1508
2132
|
}
|
|
1509
2133
|
return dirty;
|
|
1510
2134
|
}
|
|
1511
2135
|
/* Return sanitized string or DOM */
|
|
1512
2136
|
if (RETURN_DOM) {
|
|
1513
2137
|
if (SAFE_FOR_TEMPLATES) {
|
|
1514
|
-
|
|
2138
|
+
_scrubTemplateExpressions2(body);
|
|
1515
2139
|
}
|
|
1516
2140
|
if (RETURN_DOM_FRAGMENT) {
|
|
1517
2141
|
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
@@ -1541,11 +2165,9 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1541
2165
|
}
|
|
1542
2166
|
/* Sanitize final string template-safe */
|
|
1543
2167
|
if (SAFE_FOR_TEMPLATES) {
|
|
1544
|
-
|
|
1545
|
-
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
|
1546
|
-
});
|
|
2168
|
+
serializedHTML = _stripTemplateExpressions(serializedHTML);
|
|
1547
2169
|
}
|
|
1548
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
2170
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
|
|
1549
2171
|
};
|
|
1550
2172
|
DOMPurify.setConfig = function () {
|
|
1551
2173
|
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1555,6 +2177,12 @@ var purify = createCommonjsModule(function (module, exports) {
|
|
|
1555
2177
|
DOMPurify.clearConfig = function () {
|
|
1556
2178
|
CONFIG = null;
|
|
1557
2179
|
SET_CONFIG = false;
|
|
2180
|
+
// Drop any caller-supplied Trusted Types policy so it cannot poison later
|
|
2181
|
+
// `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and
|
|
2182
|
+
// never recreated — Trusted Types throws on duplicate names) is restored by
|
|
2183
|
+
// the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.
|
|
2184
|
+
trustedTypesPolicy = defaultTrustedTypesPolicy;
|
|
2185
|
+
emptyHTML = '';
|
|
1558
2186
|
};
|
|
1559
2187
|
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
1560
2188
|
/* Initialize shared config vars if necessary. */
|