@vonage/vivid 5.12.0 → 5.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/base-color-picker.js +2 -2
- package/bundled/definition19.cjs +63 -44
- package/bundled/definition19.js +322 -246
- package/bundled/definition2.cjs +1 -1
- package/bundled/definition2.js +1 -1
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +17 -13
- package/bundled/slottable-request.cjs +4 -4
- package/bundled/slottable-request.js +71 -70
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/custom-elements.json +2540 -2206
- package/data-grid/definition.cjs +37 -13
- package/data-grid/definition.js +37 -13
- package/data-grid/index.cjs +38 -32
- package/data-grid/index.js +201 -178
- package/icon/definition.cjs +1 -1
- package/icon/definition.js +1 -1
- package/index.cjs +1 -0
- package/index.js +1 -1
- package/lib/accordion/accordion.template.d.ts +2 -2
- package/lib/accordion/index.d.ts +1 -0
- package/lib/accordion-item/accordion-item.d.ts +98 -67
- package/lib/accordion-item/accordion-item.template.d.ts +3 -3
- package/lib/accordion-item/index.d.ts +1 -0
- package/lib/action-group/action-group.d.ts +95 -64
- package/lib/action-group/action-group.template.d.ts +2 -2
- package/lib/action-group/index.d.ts +1 -0
- package/lib/alert/alert.d.ts +192 -130
- package/lib/alert/alert.template.d.ts +3 -3
- package/lib/alert/index.d.ts +1 -0
- package/lib/audio-player/audio-player.d.ts +97 -67
- package/lib/audio-player/audio-player.template.d.ts +2 -2
- package/lib/audio-player/index.d.ts +1 -0
- package/lib/avatar/avatar.d.ts +105 -117
- package/lib/avatar/avatar.template.d.ts +1 -1
- package/lib/avatar/index.d.ts +1 -0
- package/lib/badge/badge.d.ts +98 -67
- package/lib/badge/badge.template.d.ts +3 -3
- package/lib/badge/index.d.ts +1 -0
- package/lib/banner/banner.d.ts +286 -193
- package/lib/banner/banner.template.d.ts +3 -3
- package/lib/banner/index.d.ts +1 -0
- package/lib/breadcrumb/breadcrumb.d.ts +93 -62
- package/lib/breadcrumb/breadcrumb.template.d.ts +2 -2
- package/lib/breadcrumb/index.d.ts +1 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +103 -115
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +3 -3
- package/lib/breadcrumb-item/index.d.ts +1 -0
- package/lib/button/button.d.ts +297 -247
- package/lib/button/button.template.d.ts +3 -3
- package/lib/button/index.d.ts +1 -0
- package/lib/calendar/calendar.d.ts +2 -2
- package/lib/calendar/calendar.template.d.ts +2 -2
- package/lib/calendar/helpers/calendar.event-context.d.ts +1 -1
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +1 -1
- package/lib/calendar/index.d.ts +1 -0
- package/lib/calendar-event/calendar-event.d.ts +95 -64
- package/lib/calendar-event/calendar-event.template.d.ts +2 -2
- package/lib/calendar-event/index.d.ts +1 -0
- package/lib/card/card.d.ts +105 -117
- package/lib/card/card.template.d.ts +2 -2
- package/lib/card/index.d.ts +1 -0
- package/lib/checkbox/checkbox.d.ts +628 -437
- package/lib/checkbox/checkbox.template.d.ts +3 -3
- package/lib/checkbox/index.d.ts +1 -0
- package/lib/color-picker/color-picker.d.ts +726 -506
- package/lib/color-picker/color-picker.template.d.ts +2 -2
- package/lib/color-picker/definition.d.ts +1 -1
- package/lib/color-picker/index.d.ts +1 -0
- package/lib/combobox/combobox.d.ts +741 -520
- package/lib/combobox/combobox.template.d.ts +3 -3
- package/lib/combobox/index.d.ts +1 -0
- package/lib/contextual-help/contextual-help.d.ts +1 -1
- package/lib/contextual-help/contextual-help.template.d.ts +3 -3
- package/lib/contextual-help/index.d.ts +1 -0
- package/lib/country/country-code-to-flag-icon.d.ts +1 -1
- package/lib/country/country.template.d.ts +3 -3
- package/lib/country/index.d.ts +1 -0
- package/lib/data-grid/data-grid-cell.d.ts +190 -128
- package/lib/data-grid/data-grid-cell.template.d.ts +3 -3
- package/lib/data-grid/data-grid-row.d.ts +95 -64
- package/lib/data-grid/data-grid-row.template.d.ts +3 -3
- package/lib/data-grid/data-grid.d.ts +1 -1
- package/lib/data-grid/data-grid.template.d.ts +3 -3
- package/lib/data-grid/index.d.ts +1 -0
- package/lib/data-grid/locale.d.ts +1 -1
- package/lib/date-picker/date-picker.d.ts +1045 -792
- package/lib/date-picker/date-picker.template.d.ts +2 -2
- package/lib/date-picker/index.d.ts +1 -0
- package/lib/date-range-picker/date-range-picker.d.ts +538 -411
- package/lib/date-range-picker/date-range-picker.template.d.ts +2 -2
- package/lib/date-range-picker/index.d.ts +1 -0
- package/lib/date-time-picker/date-time-picker.d.ts +1026 -772
- package/lib/date-time-picker/date-time-picker.template.d.ts +2 -2
- package/lib/date-time-picker/index.d.ts +1 -0
- package/lib/dial-pad/dial-pad.d.ts +95 -64
- package/lib/dial-pad/dial-pad.template.d.ts +2 -2
- package/lib/dial-pad/index.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +189 -127
- package/lib/dialog/dialog.template.d.ts +3 -3
- package/lib/dialog/index.d.ts +1 -0
- package/lib/divider/divider.d.ts +94 -63
- package/lib/divider/divider.template.d.ts +2 -2
- package/lib/divider/index.d.ts +1 -0
- package/lib/elevation/elevation.template.d.ts +2 -2
- package/lib/elevation/index.d.ts +1 -0
- package/lib/empty-state/empty-state.d.ts +2 -2
- package/lib/empty-state/empty-state.template.d.ts +3 -3
- package/lib/empty-state/index.d.ts +1 -0
- package/lib/fab/fab.d.ts +98 -67
- package/lib/fab/fab.template.d.ts +3 -3
- package/lib/fab/index.d.ts +1 -0
- package/lib/file-picker/__mocks__/data-transfer.d.ts +21 -0
- package/lib/file-picker/file-picker.d.ts +736 -515
- package/lib/file-picker/file-picker.template.d.ts +3 -3
- package/lib/file-picker/index.d.ts +1 -0
- package/lib/header/header.d.ts +93 -62
- package/lib/header/header.template.d.ts +3 -3
- package/lib/header/index.d.ts +1 -0
- package/lib/icon/icon.d.ts +2 -2
- package/lib/icon/icon.template.d.ts +3 -3
- package/lib/icon/index.d.ts +1 -0
- package/lib/layout/index.d.ts +1 -0
- package/lib/layout/layout.d.ts +2 -2
- package/lib/layout/layout.template.d.ts +2 -2
- package/lib/menu/index.d.ts +1 -0
- package/lib/menu/menu.d.ts +195 -133
- package/lib/menu/menu.template.d.ts +3 -3
- package/lib/menu-item/index.d.ts +1 -0
- package/lib/menu-item/menu-item.d.ts +191 -129
- package/lib/menu-item/menu-item.template.d.ts +2 -2
- package/lib/nav/index.d.ts +1 -0
- package/lib/nav/nav.d.ts +93 -62
- package/lib/nav/nav.template.d.ts +2 -2
- package/lib/nav-disclosure/index.d.ts +1 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +191 -129
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +3 -3
- package/lib/nav-item/index.d.ts +1 -0
- package/lib/nav-item/nav-item.d.ts +200 -181
- package/lib/nav-item/nav-item.template.d.ts +3 -3
- package/lib/note/index.d.ts +1 -0
- package/lib/note/note.d.ts +97 -66
- package/lib/note/note.template.d.ts +3 -3
- package/lib/number-field/index.d.ts +1 -0
- package/lib/number-field/number-field.d.ts +929 -646
- package/lib/number-field/number-field.template.d.ts +3 -3
- package/lib/option/index.d.ts +1 -0
- package/lib/option/option.d.ts +191 -129
- package/lib/option/option.template.d.ts +3 -3
- package/lib/pagination/index.d.ts +1 -0
- package/lib/pagination/pagination.d.ts +98 -67
- package/lib/pagination/pagination.template.d.ts +3 -3
- package/lib/popover/definition.d.ts +1 -1
- package/lib/popover/index.d.ts +1 -0
- package/lib/popover/popover.d.ts +190 -128
- package/lib/popover/popover.template.d.ts +2 -2
- package/lib/popup/index.d.ts +1 -0
- package/lib/popup/popup.d.ts +1 -1
- package/lib/popup/popup.template.d.ts +3 -3
- package/lib/progress/index.d.ts +1 -0
- package/lib/progress/progress.d.ts +94 -63
- package/lib/progress/progress.template.d.ts +2 -2
- package/lib/progress-ring/index.d.ts +1 -0
- package/lib/progress-ring/progress-ring.d.ts +94 -63
- package/lib/progress-ring/progress-ring.template.d.ts +2 -2
- package/lib/radio/index.d.ts +1 -0
- package/lib/radio/radio.d.ts +340 -242
- package/lib/radio/radio.template.d.ts +2 -2
- package/lib/radio-group/index.d.ts +1 -0
- package/lib/radio-group/radio-group.d.ts +99 -68
- package/lib/radio-group/radio-group.template.d.ts +3 -3
- package/lib/range-slider/index.d.ts +1 -0
- package/lib/range-slider/range-slider.d.ts +313 -218
- package/lib/range-slider/range-slider.template.d.ts +3 -3
- package/lib/rich-text-editor/definition.d.ts +1 -1
- package/lib/rich-text-editor/index.d.ts +1 -0
- package/lib/rich-text-editor/popover.d.ts +1 -1
- package/lib/rich-text-editor/rich-text-editor.d.ts +99 -68
- package/lib/rich-text-editor/rich-text-editor.template.d.ts +2 -2
- package/lib/rich-text-editor/rte/__tests__/async-generator.d.ts +5 -0
- package/lib/rich-text-editor/rte/__tests__/doc-factories.d.ts +106 -0
- package/lib/rich-text-editor/rte/__tests__/font-sizes.d.ts +2 -0
- package/lib/rich-text-editor/rte/__tests__/promise.d.ts +5 -0
- package/lib/rich-text-editor/rte/__tests__/test-utils.d.ts +68 -0
- package/lib/rich-text-editor/rte/config.d.ts +4 -4
- package/lib/rich-text-editor/rte/exports.d.ts +1 -0
- package/lib/rich-text-editor/rte/feature.d.ts +10 -12
- package/lib/rich-text-editor/rte/features/alignment.d.ts +19 -0
- package/lib/rich-text-editor/rte/features/atom.d.ts +9 -0
- package/lib/rich-text-editor/rte/features/base.d.ts +33 -0
- package/lib/rich-text-editor/rte/features/bold.d.ts +17 -0
- package/lib/rich-text-editor/rte/features/drop-handler.d.ts +21 -0
- package/lib/rich-text-editor/rte/features/file-handler.d.ts +25 -0
- package/lib/rich-text-editor/rte/features/font-size-picker.d.ts +46 -0
- package/lib/rich-text-editor/rte/features/hard-break.d.ts +10 -0
- package/lib/rich-text-editor/rte/features/inline-image.d.ts +43 -0
- package/lib/rich-text-editor/rte/features/input-rule.d.ts +10 -0
- package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +6 -6
- package/lib/rich-text-editor/rte/features/internal/core.d.ts +37 -0
- package/lib/rich-text-editor/rte/features/internal/cursor-fix.d.ts +16 -0
- package/lib/rich-text-editor/rte/features/internal/foreign-html.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/internal/history.d.ts +2 -2
- package/lib/rich-text-editor/rte/features/internal/input-rules.d.ts +4 -4
- package/lib/rich-text-editor/rte/features/italic.d.ts +17 -0
- package/lib/rich-text-editor/rte/features/keyboard-shortcuts.d.ts +16 -0
- package/lib/rich-text-editor/rte/features/link.d.ts +33 -0
- package/lib/rich-text-editor/rte/features/list.d.ts +24 -0
- package/lib/rich-text-editor/rte/features/monospace.d.ts +22 -0
- package/lib/rich-text-editor/rte/features/placeholder.d.ts +23 -0
- package/lib/rich-text-editor/rte/features/strikethrough.d.ts +17 -0
- package/lib/rich-text-editor/rte/features/suggest.d.ts +14 -0
- package/lib/rich-text-editor/rte/features/text-block-picker.d.ts +18 -0
- package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +31 -0
- package/lib/rich-text-editor/rte/features/toolbar-button.d.ts +13 -0
- package/lib/rich-text-editor/rte/features/toolbar.d.ts +37 -0
- package/lib/rich-text-editor/rte/features/underline.d.ts +17 -0
- package/lib/rich-text-editor/rte/html-parser.d.ts +3 -3
- package/lib/rich-text-editor/rte/html-serializer.d.ts +3 -3
- package/lib/rich-text-editor/rte/instance.d.ts +10 -8
- package/lib/rich-text-editor/rte/public-interface.d.ts +13 -0
- package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -2
- package/lib/rich-text-editor/rte/utils/feature-state.d.ts +1 -1
- package/lib/rich-text-editor/rte/utils/text-before-cursor.d.ts +1 -1
- package/lib/rich-text-editor/rte/utils/ui.d.ts +8 -8
- package/lib/rich-text-editor/rte/view.d.ts +3 -6
- package/lib/rich-text-view/definition.d.ts +1 -1
- package/lib/rich-text-view/index.d.ts +2 -0
- package/lib/rich-text-view/rich-text-view.d.ts +1 -1
- package/lib/rich-text-view/rich-text-view.template.d.ts +2 -2
- package/lib/searchable-select/index.d.ts +1 -0
- package/lib/searchable-select/option-tag.d.ts +96 -65
- package/lib/searchable-select/option-tag.template.d.ts +3 -3
- package/lib/searchable-select/searchable-select.d.ts +929 -646
- package/lib/searchable-select/searchable-select.template.d.ts +3 -3
- package/lib/select/index.d.ts +1 -0
- package/lib/select/locale.d.ts +3 -0
- package/lib/select/select.d.ts +1240 -579
- package/lib/select/select.template.d.ts +3 -3
- package/lib/selectable-box/index.d.ts +1 -0
- package/lib/selectable-box/selectable-box.d.ts +94 -63
- package/lib/selectable-box/selectable-box.template.d.ts +2 -2
- package/lib/side-drawer/index.d.ts +1 -0
- package/lib/side-drawer/side-drawer.template.d.ts +2 -2
- package/lib/simple-color-picker/definition.d.ts +1 -1
- package/lib/simple-color-picker/index.d.ts +1 -0
- package/lib/simple-color-picker/simple-color-picker.d.ts +216 -153
- package/lib/simple-color-picker/simple-color-picker.template.d.ts +2 -2
- package/lib/slider/index.d.ts +1 -0
- package/lib/slider/slider.d.ts +299 -205
- package/lib/slider/slider.template.d.ts +4 -4
- package/lib/split-button/index.d.ts +1 -0
- package/lib/split-button/split-button.d.ts +288 -195
- package/lib/split-button/split-button.template.d.ts +3 -3
- package/lib/status/index.d.ts +1 -0
- package/lib/status/status.d.ts +98 -67
- package/lib/status/status.template.d.ts +3 -3
- package/lib/switch/index.d.ts +1 -0
- package/lib/switch/switch.d.ts +207 -142
- package/lib/switch/switch.template.d.ts +2 -2
- package/lib/tab/index.d.ts +1 -0
- package/lib/tab/tab.d.ts +288 -195
- package/lib/tab/tab.template.d.ts +3 -3
- package/lib/tab-panel/index.d.ts +1 -0
- package/lib/tab-panel/tab-panel.d.ts +93 -62
- package/lib/tab-panel/tab-panel.template.d.ts +2 -2
- package/lib/table/index.d.ts +1 -0
- package/lib/table/table-body.template.d.ts +3 -3
- package/lib/table/table-cell.d.ts +93 -62
- package/lib/table/table-cell.template.d.ts +3 -3
- package/lib/table/table-head.template.d.ts +3 -3
- package/lib/table/table-header-cell.d.ts +93 -62
- package/lib/table/table-header-cell.template.d.ts +3 -3
- package/lib/table/table-row.d.ts +93 -62
- package/lib/table/table-row.template.d.ts +3 -3
- package/lib/table/table.template.d.ts +3 -3
- package/lib/tabs/index.d.ts +1 -0
- package/lib/tabs/tabs.d.ts +2 -2
- package/lib/tabs/tabs.template.d.ts +2 -2
- package/lib/tag/index.d.ts +1 -0
- package/lib/tag/tag.d.ts +288 -195
- package/lib/tag/tag.template.d.ts +3 -3
- package/lib/tag-group/index.d.ts +1 -0
- package/lib/tag-group/tag-group.d.ts +93 -62
- package/lib/tag-group/tag-group.template.d.ts +2 -2
- package/lib/tag-name-map.d.ts +1 -1
- package/lib/text-area/index.d.ts +1 -0
- package/lib/text-area/text-area.d.ts +832 -581
- package/lib/text-area/text-area.template.d.ts +3 -3
- package/lib/text-field/index.d.ts +1 -0
- package/lib/text-field/text-field.d.ts +931 -649
- package/lib/text-field/text-field.template.d.ts +3 -3
- package/lib/time-picker/index.d.ts +1 -0
- package/lib/time-picker/time-picker.d.ts +486 -359
- package/lib/time-picker/time-picker.template.d.ts +3 -3
- package/lib/toggletip/index.d.ts +1 -0
- package/lib/toggletip/toggletip.d.ts +197 -135
- package/lib/toggletip/toggletip.template.d.ts +3 -3
- package/lib/tooltip/index.d.ts +1 -0
- package/lib/tooltip/tooltip.d.ts +101 -70
- package/lib/tooltip/tooltip.template.d.ts +3 -3
- package/lib/tree-item/index.d.ts +1 -0
- package/lib/tree-item/tree-item.d.ts +190 -128
- package/lib/tree-item/tree-item.template.d.ts +3 -3
- package/lib/tree-view/index.d.ts +1 -0
- package/lib/tree-view/tree-view.d.ts +93 -62
- package/lib/tree-view/tree-view.template.d.ts +2 -2
- package/lib/video-player/index.d.ts +1 -0
- package/lib/video-player/video-player.d.ts +96 -65
- package/lib/video-player/video-player.template.d.ts +1 -1
- package/lib/video-player/vivid-video-svg.d.ts +1 -1
- package/lib/visually-hidden/definition.d.ts +1 -1
- package/lib/visually-hidden/index.d.ts +1 -0
- package/lib/visually-hidden/visually-hidden.template.d.ts +1 -1
- package/locales/de-DE.cjs +3 -0
- package/locales/de-DE.d.ts +1 -1
- package/locales/de-DE.js +3 -0
- package/locales/en-GB.cjs +3 -0
- package/locales/en-GB.d.ts +1 -1
- package/locales/en-GB.js +3 -0
- package/locales/en-US.cjs +3 -0
- package/locales/en-US.d.ts +1 -1
- package/locales/en-US.js +3 -0
- package/locales/ja-JP.cjs +3 -0
- package/locales/ja-JP.d.ts +1 -1
- package/locales/ja-JP.js +3 -0
- package/locales/zh-CN.cjs +3 -0
- package/locales/zh-CN.d.ts +1 -1
- package/locales/zh-CN.js +3 -0
- package/package.json +6 -6
- package/rich-text-editor/definition.cjs +51 -24
- package/rich-text-editor/definition.js +52 -26
- package/rich-text-editor/index.cjs +7 -7
- package/rich-text-editor/index.js +1255 -1237
- package/rich-text-view/index.js +1 -1
- package/select/definition.cjs +104 -5
- package/select/definition.js +104 -5
- package/shared/aria/aria-change-subscription.d.ts +1 -1
- package/shared/aria/aria-mixin.d.ts +94 -63
- package/shared/aria/attribute-removal.d.ts +1 -1
- package/shared/aria/delegate-aria-behavior.d.ts +2 -2
- package/shared/aria/delegates-aria.d.ts +96 -65
- package/shared/aria/host-semantics-behavior.d.ts +2 -2
- package/shared/aria/host-semantics.d.ts +97 -66
- package/shared/color-picker/base-color-picker.d.ts +114 -82
- package/shared/datetime/dateRange.d.ts +1 -1
- package/shared/datetime/dateTimeStr.d.ts +4 -4
- package/shared/datetime/month.d.ts +1 -1
- package/shared/datetime/presentationDate.d.ts +2 -2
- package/shared/datetime/presentationDateRange.d.ts +2 -2
- package/shared/datetime/presentationDateTime.d.ts +2 -2
- package/shared/datetime/presentationTime.d.ts +1 -1
- package/shared/datetime/year.d.ts +1 -1
- package/shared/deprecation/replaced-props.d.ts +95 -60
- package/shared/design-system/createRegisterFunction.d.ts +1 -1
- package/shared/design-system/defineVividComponent.d.ts +1 -1
- package/shared/feedback/feedback-message.d.ts +96 -65
- package/shared/feedback/mixins.d.ts +200 -138
- package/shared/foundation/button/button.d.ts +202 -139
- package/shared/foundation/button/button.template.d.ts +2 -2
- package/shared/foundation/form-associated/form-associated.d.ts +213 -147
- package/shared/foundation/listbox/listbox.d.ts +1 -1
- package/shared/foundation/test-utilities/fixture.d.ts +18 -0
- package/shared/foundation/vivid-element/vivid-element.d.ts +194 -131
- package/shared/localization/Locale.d.ts +31 -29
- package/shared/localization/index.d.ts +1 -1
- package/shared/patterns/affix.d.ts +195 -133
- package/shared/patterns/anchored.d.ts +202 -140
- package/shared/patterns/char-count/char-count.d.ts +99 -68
- package/shared/patterns/chevron.d.ts +2 -2
- package/shared/patterns/form-elements/form-element.d.ts +114 -488
- package/shared/patterns/form-elements/with-contextual-help.d.ts +117 -903
- package/shared/patterns/form-elements/with-error-text.d.ts +120 -906
- package/shared/patterns/form-elements/with-success-text.d.ts +97 -66
- package/shared/patterns/linkable.d.ts +106 -117
- package/shared/patterns/localized.d.ts +197 -135
- package/shared/patterns/trapped-focus.d.ts +95 -64
- package/shared/picker-field/mixins/calendar-picker.d.ts +251 -188
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +271 -208
- package/shared/picker-field/mixins/calendar-segments/calendarGrid.d.ts +3 -3
- package/shared/picker-field/mixins/calendar-segments/monthPickerGrid.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-segments/segment.d.ts +2 -2
- package/shared/picker-field/mixins/inline-time-picker/columns.d.ts +2 -2
- package/shared/picker-field/mixins/inline-time-picker/index.d.ts +1 -0
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +95 -64
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.template.d.ts +3 -3
- package/shared/picker-field/mixins/inline-time-picker/picker-option.d.ts +1 -1
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +277 -1102
- package/shared/picker-field/mixins/single-date-picker.d.ts +274 -1953
- package/shared/picker-field/mixins/single-value-picker.d.ts +236 -173
- package/shared/picker-field/mixins/time-selection-picker.d.ts +257 -1046
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +486 -360
- package/shared/picker-field/picker-field.d.ts +735 -514
- package/shared/picker-field/picker-field.template.d.ts +2 -2
- package/shared/templating/attribute-binding-behaviour.d.ts +1 -1
- package/shared/templating/render-in-light-dom.d.ts +2 -2
- package/shared/utils/closest-of-type.d.ts +2 -0
- package/shared/utils/direct-children-of-type.d.ts +2 -0
- package/shared/utils/dom-traversal-types.d.ts +3 -0
- package/shared/utils/first-of-type.d.ts +2 -0
- package/shared/utils/last-of-type.d.ts +2 -0
- package/shared/utils/nested-children-of-type.d.ts +2 -0
- package/shared/utils/next-of-type.d.ts +2 -0
- package/shared/utils/numberConverter.d.ts +1 -1
- package/shared/utils/prev-of-type.d.ts +2 -0
- package/shared/utils/promise.d.ts +2 -2
- package/shared/utils/siblings-of-type.d.ts +2 -0
- package/styles/core/all.css +2 -2
- package/styles/core/theme.css +2 -2
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/unbundled/base-color-picker.cjs +2 -2
- package/unbundled/base-color-picker.js +2 -2
- package/unbundled/localized.cjs +1 -0
- package/unbundled/localized.js +1 -0
- package/unbundled/slottable-request.cjs +8 -5
- package/unbundled/slottable-request.js +8 -6
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/vivid.api.json +759 -38
package/bundled/definition2.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./vivid-element.cjs"),p=require("./definition14.cjs"),z=require("./class-names.cjs"),h=require("./when.cjs"),y=":host{display:inline-block;vertical-align:sub}.control.connotation-accent{--_connotation-color-primary: var(--vvd-icon-accent-primary, var(--vvd-color-canvas-text))}.control.connotation-announcement{--_connotation-color-primary: var(--vvd-icon-announcement-primary, var(--vvd-color-announcement-500))}.control.connotation-cta{--_connotation-color-primary: var(--vvd-icon-cta-primary, var(--vvd-color-cta-500))}.control.connotation-success{--_connotation-color-primary: var(--vvd-icon-success-primary, var(--vvd-color-success-500))}.control.connotation-warning{--_connotation-color-primary: var(--vvd-icon-warning-primary, var(--vvd-color-warning-300))}.control.connotation-alert{--_connotation-color-primary: var(--vvd-icon-alert-primary, var(--vvd-color-alert-500))}.control.connotation-information{--_connotation-color-primary: var(--vvd-icon-information-primary, var(--vvd-color-information-500))}.control.size--6{--_icon-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) }.control.size--5{--_icon-block-size: calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--4{--_icon-block-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--3{--_icon-block-size: calc(1px*(28 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--2{--_icon-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--1{--_icon-block-size: calc(1px*(36 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-0{--_icon-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-1{--_icon-block-size: calc(1px*(44 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-2{--_icon-block-size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-3{--_icon-block-size: calc(1px*(52 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-4{--_icon-block-size: calc(1px*(56 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-5{--_icon-block-size: calc(1px*(60 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control:not(.size--6,.size--5,.size--4,.size--3,.size--2,.size--1,.size-0,.size-1,.size-2,.size-3,.size-4,.size-5){--_icon-block-size: 1em}.control{display:flex;margin:unset;block-size:var(--_icon-block-size);color:currentColor;contain:strict;inline-size:var(--_icon-block-size)}.control[class*=connotation]{color:var(--_connotation-color-primary)}slot,svg,::slotted(:where(svg,img)){margin:auto;block-size:inherit;inline-size:inherit}",g="https://icon.resources.vonage.com",u="4.
|
|
1
|
+
"use strict";const e=require("./vivid-element.cjs"),p=require("./definition14.cjs"),z=require("./class-names.cjs"),h=require("./when.cjs"),y=":host{display:inline-block;vertical-align:sub}.control.connotation-accent{--_connotation-color-primary: var(--vvd-icon-accent-primary, var(--vvd-color-canvas-text))}.control.connotation-announcement{--_connotation-color-primary: var(--vvd-icon-announcement-primary, var(--vvd-color-announcement-500))}.control.connotation-cta{--_connotation-color-primary: var(--vvd-icon-cta-primary, var(--vvd-color-cta-500))}.control.connotation-success{--_connotation-color-primary: var(--vvd-icon-success-primary, var(--vvd-color-success-500))}.control.connotation-warning{--_connotation-color-primary: var(--vvd-icon-warning-primary, var(--vvd-color-warning-300))}.control.connotation-alert{--_connotation-color-primary: var(--vvd-icon-alert-primary, var(--vvd-color-alert-500))}.control.connotation-information{--_connotation-color-primary: var(--vvd-icon-information-primary, var(--vvd-color-information-500))}.control.size--6{--_icon-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) }.control.size--5{--_icon-block-size: calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--4{--_icon-block-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--3{--_icon-block-size: calc(1px*(28 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--2{--_icon-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--1{--_icon-block-size: calc(1px*(36 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-0{--_icon-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-1{--_icon-block-size: calc(1px*(44 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-2{--_icon-block-size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-3{--_icon-block-size: calc(1px*(52 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-4{--_icon-block-size: calc(1px*(56 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-5{--_icon-block-size: calc(1px*(60 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control:not(.size--6,.size--5,.size--4,.size--3,.size--2,.size--1,.size-0,.size-1,.size-2,.size-3,.size-4,.size-5){--_icon-block-size: 1em}.control{display:flex;margin:unset;block-size:var(--_icon-block-size);color:currentColor;contain:strict;inline-size:var(--_icon-block-size)}.control[class*=connotation]{color:var(--_connotation-color-primary)}slot,svg,::slotted(:where(svg,img)){margin:auto;block-size:inherit;inline-size:inherit}",g="https://icon.resources.vonage.com",u="4.8.0",f={toView(o){return o===void 0?null:o.toString()},fromView(o){if(typeof o=="string"&&(o=parseFloat(o.toString())),typeof o=="number")return isNaN(o)||!isFinite(o)?void 0:o}},d=`<svg width="80%" height="80%" viewBox="0 0 64 64">
|
|
2
2
|
<g>
|
|
3
3
|
<g stroke-width="6" stroke-linecap="round" fill="none">
|
|
4
4
|
<path stroke="currentColor" d="M4,32 c0,15,12,28,28,28c8,0,16-4,21-9">
|
package/bundled/definition2.js
CHANGED
|
@@ -2,7 +2,7 @@ import { V as z, a as v, o as m, h as d, c as h, d as y } from "./vivid-element.
|
|
|
2
2
|
import { V as g, v as f } from "./definition14.js";
|
|
3
3
|
import { c as u } from "./class-names.js";
|
|
4
4
|
import { w as _ } from "./when.js";
|
|
5
|
-
const b = ":host{display:inline-block;vertical-align:sub}.control.connotation-accent{--_connotation-color-primary: var(--vvd-icon-accent-primary, var(--vvd-color-canvas-text))}.control.connotation-announcement{--_connotation-color-primary: var(--vvd-icon-announcement-primary, var(--vvd-color-announcement-500))}.control.connotation-cta{--_connotation-color-primary: var(--vvd-icon-cta-primary, var(--vvd-color-cta-500))}.control.connotation-success{--_connotation-color-primary: var(--vvd-icon-success-primary, var(--vvd-color-success-500))}.control.connotation-warning{--_connotation-color-primary: var(--vvd-icon-warning-primary, var(--vvd-color-warning-300))}.control.connotation-alert{--_connotation-color-primary: var(--vvd-icon-alert-primary, var(--vvd-color-alert-500))}.control.connotation-information{--_connotation-color-primary: var(--vvd-icon-information-primary, var(--vvd-color-information-500))}.control.size--6{--_icon-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) }.control.size--5{--_icon-block-size: calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--4{--_icon-block-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--3{--_icon-block-size: calc(1px*(28 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--2{--_icon-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--1{--_icon-block-size: calc(1px*(36 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-0{--_icon-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-1{--_icon-block-size: calc(1px*(44 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-2{--_icon-block-size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-3{--_icon-block-size: calc(1px*(52 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-4{--_icon-block-size: calc(1px*(56 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-5{--_icon-block-size: calc(1px*(60 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control:not(.size--6,.size--5,.size--4,.size--3,.size--2,.size--1,.size-0,.size-1,.size-2,.size-3,.size-4,.size-5){--_icon-block-size: 1em}.control{display:flex;margin:unset;block-size:var(--_icon-block-size);color:currentColor;contain:strict;inline-size:var(--_icon-block-size)}.control[class*=connotation]{color:var(--_connotation-color-primary)}slot,svg,::slotted(:where(svg,img)){margin:auto;block-size:inherit;inline-size:inherit}", k = "https://icon.resources.vonage.com", w = "4.
|
|
5
|
+
const b = ":host{display:inline-block;vertical-align:sub}.control.connotation-accent{--_connotation-color-primary: var(--vvd-icon-accent-primary, var(--vvd-color-canvas-text))}.control.connotation-announcement{--_connotation-color-primary: var(--vvd-icon-announcement-primary, var(--vvd-color-announcement-500))}.control.connotation-cta{--_connotation-color-primary: var(--vvd-icon-cta-primary, var(--vvd-color-cta-500))}.control.connotation-success{--_connotation-color-primary: var(--vvd-icon-success-primary, var(--vvd-color-success-500))}.control.connotation-warning{--_connotation-color-primary: var(--vvd-icon-warning-primary, var(--vvd-color-warning-300))}.control.connotation-alert{--_connotation-color-primary: var(--vvd-icon-alert-primary, var(--vvd-color-alert-500))}.control.connotation-information{--_connotation-color-primary: var(--vvd-icon-information-primary, var(--vvd-color-information-500))}.control.size--6{--_icon-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))) }.control.size--5{--_icon-block-size: calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--4{--_icon-block-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--3{--_icon-block-size: calc(1px*(28 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--2{--_icon-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size--1{--_icon-block-size: calc(1px*(36 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-0{--_icon-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-1{--_icon-block-size: calc(1px*(44 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-2{--_icon-block-size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-3{--_icon-block-size: calc(1px*(52 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-4{--_icon-block-size: calc(1px*(56 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control.size-5{--_icon-block-size: calc(1px*(60 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.control:not(.size--6,.size--5,.size--4,.size--3,.size--2,.size--1,.size-0,.size-1,.size-2,.size-3,.size-4,.size-5){--_icon-block-size: 1em}.control{display:flex;margin:unset;block-size:var(--_icon-block-size);color:currentColor;contain:strict;inline-size:var(--_icon-block-size)}.control[class*=connotation]{color:var(--_connotation-color-primary)}slot,svg,::slotted(:where(svg,img)){margin:auto;block-size:inherit;inline-size:inherit}", k = "https://icon.resources.vonage.com", w = "4.8.0", x = {
|
|
6
6
|
toView(o) {
|
|
7
7
|
return o === void 0 ? null : o.toString();
|
|
8
8
|
},
|
package/bundled/localized.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./vivid-element.cjs"),r="Play",c="Pause",d="Replay",u="Duration",p="LIVE",b="Loaded",g="Progress",h="Fullscreen",m="Mute",L="Unmute",y="Subtitles",f="Captions",C="Chapters",S="Descriptions",k="Close",v="Text",P="White",T="Black",w="Red",M="Green",B="Blue",D="Yellow",x="Magenta",E="Cyan",A="Background",$="Window",F="Transparent",O="Opaque",R="None",I="Raised",N="Depressed",U="Uniform",W="Casual",Y="Script",z="Reset",V="Done",G="Color",_="Opacity",q={"Audio Player":"Audio Player","Video Player":"Video Player",Play:r,Pause:c,Replay:d,"Current Time":"Current Time",Duration:u,"Remaining Time":"Remaining Time","Stream Type":"Stream Type",LIVE:p,"Seek to live, currently behind live":"Seek to live, currently behind live","Seek to live, currently playing live":"Seek to live, currently playing live",Loaded:b,Progress:g,"Progress Bar":"Progress Bar","progress bar timing: currentTime={1} duration={2}":"{1} of {2}",Fullscreen:h,"Exit Fullscreen":"Exit Fullscreen",Mute:m,Unmute:L,"Playback Rate":"Playback Rate",Subtitles:y,"subtitles off":"subtitles off",Captions:f,"captions off":"captions off",Chapters:C,Descriptions:S,"descriptions off":"descriptions off","Audio Track":"Audio Track","Volume Level":"Volume Level","You aborted the media playback":"You aborted the media playback","A network error caused the media download to fail part-way.":"A network error caused the media download to fail part-way.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"The media could not be loaded, either because the server or network failed or because the format is not supported.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.","No compatible source was found for this media.":"No compatible source was found for this media.","The media is encrypted and we do not have the keys to decrypt it.":"The media is encrypted and we do not have the keys to decrypt it.","Play Video":"Play Video",Close:k,"Close Modal Dialog":"Close Modal Dialog","Modal Window":"Modal Window","This is a modal window":"This is a modal window","This modal can be closed by pressing the Escape key or activating the close button.":"This modal can be closed by pressing the Escape key or activating the close button.",", opens captions settings dialog":", opens captions settings dialog",", opens subtitles settings dialog":", opens subtitles settings dialog",", opens descriptions settings dialog":", opens descriptions settings dialog",", selected":", selected","captions settings":"captions settings","subtitles settings":"subtitles settings","descriptions settings":"descriptions settings",Text:v,White:P,Black:T,Red:w,Green:M,Blue:B,Yellow:D,Magenta:x,Cyan:E,Background:A,Window:$,Transparent:F,"Semi-Transparent":"Semi-Transparent",Opaque:O,"Font Size":"Font Size","Text Edge Style":"Text Edge Style",None:R,Raised:I,Depressed:N,Uniform:U,"Drop shadow":"Drop shadow","Font Family":"Font Family","Proportional Sans-Serif":"Proportional Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportional Serif","Monospace Serif":"Monospace Serif",Casual:W,Script:Y,"Small Caps":"Small Caps",Reset:z,"restore all settings to the default values":"restore all settings to the default values",Done:V,"Caption Settings Dialog":"Caption Settings Dialog","Beginning of dialog window. Escape will cancel and close the window.":"Beginning of dialog window. Escape will cancel and close the window.","End of dialog window.":"End of dialog window.","{1} is loading.":"{1} is loading.","Exit Picture-in-Picture":"Exit Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture","No content":"No content",Color:G,Opacity:_,"Text Background":"Text Background","Caption Area Background":"Caption Area Background","Playing in Picture-in-Picture":"Playing in Picture-in-Picture","Skip backward {1} seconds":"Skip backward {1} seconds","Skip forward {1} seconds":"Skip forward {1} seconds"},j=Object.freeze(Object.defineProperty({__proto__:null,Background:A,Black:T,Blue:B,Captions:f,Casual:W,Chapters:C,Close:k,Color:G,Cyan:E,Depressed:N,Descriptions:S,Done:V,Duration:u,Fullscreen:h,Green:M,LIVE:p,Loaded:b,Magenta:x,Mute:m,None:R,Opacity:_,Opaque:O,Pause:c,Play:r,Progress:g,Raised:I,Red:w,Replay:d,Reset:z,Script:Y,Subtitles:y,Text:v,Transparent:F,Uniform:U,Unmute:L,White:P,Window:$,Yellow:D,default:q},Symbol.toStringTag,{value:"Module"})),K={lang:"en-US",common:{useCommaAsDecimalSeparator:!1},pickerField:{clearLabel:"Clear",okLabel:"OK"},calendarPicker:{months:{name:["January","February","March","April","May","June","July","August","September","October","November","December"],shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},weekdays:{name:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},firstDayOfWeek:0,dateFormat:"MM/dd/yyyy",dateFormatPlaceholder:"MM/DD/YYYY",chooseDateLabel:"Choose date",changeDateLabel:e=>`Change date, ${e}`,chooseDatesLabel:"Choose dates",changeDatesLabel:e=>`Change dates, ${e}`,prevYearLabel:"Previous year",prevMonthLabel:"Previous month",nextMonthLabel:"Next month",nextYearLabel:"Next year",todayLabel:"today",selectedLabel:"selected",currentLabel:"current",changeMonthLabel:e=>`Change month, ${e} selected`,showCalendarForMonthLabel:e=>`Show calendar for ${e}`,invalidDateError:"Please enter a valid date.",invalidDateRangeError:"Please enter a valid date range.",startDateAfterMinDateError:e=>`The start date must be ${e} or later.`,endDateBeforeMaxDateError:e=>`The end date must be ${e} or earlier.`},timePicker:{defaultTo12HourClock:!0,chooseTimeLabel:"Choose time",changeTimeLabel:e=>`Change time, ${e}`,hoursLabel:"hours",minutesLabel:"minutes",secondsLabel:"seconds",meridiesLabel:"AM/PM",invalidTimeError:"Please enter a valid time."},dateTimePicker:{chooseDateTimeLabel:"Choose date and time",changeDateTimeLabel:e=>`Change date and time, ${e}`,invalidDateTimeError:"Please enter a valid date and time.",dateBeforeMinDateError:e=>`Date must be ${e} or later.`,dateAfterMaxDateError:e=>`Date must be ${e} or earlier.`,timeBeforeMinTimeError:e=>`Time must be ${e} or later.`,timeAfterMaxTimeError:e=>`Time must be ${e} or earlier.`},filePicker:{invalidFileTypeError:"You can't select files of this type.",maxFilesExceededError:"You can't select any more files.",fileTooBigError:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",removeFileLabel:"Remove file",invalidFilesError:"One or more selected files are invalid. Please, upload only valid file types under the size limit.",uploadFilesLabel:"Upload files"},audioPlayer:{playButtonLabel:"Play",pauseButtonLabel:"Pause",sliderLabel:"Audio progress bar",skipForwardButton:"Skip Forward",skipBackwardButton:"Skip Backward"},alert:{dismissButtonLabel:"Close"},dialog:{dismissButtonLabel:"Close"},popover:{dismissButtonLabel:"Close"},banner:{dismissButtonLabel:"Close"},numberField:{incrementButtonLabel:e=>e===1?"Increase value":`Increase value by ${e}`,decrementButtonLabel:e=>e===1?"Decrease value":`Decrease value by ${e}`,updatedValueAnnouncement:e=>`Updated value: ${e}`},splitButton:{showMoreActionsLabel:"Show more actions"},videoPlayer:j,rangeSlider:{startThumbLabel:"min",endThumbLabel:"max"},dialPad:{inputLabel:"Phone number",deleteButtonLabel:"Delete last digit",callButtonLabel:"Call",endCallButtonLabel:"End call",digitOneLabel:"1",digitTwoLabel:"2 ABC",digitThreeLabel:"3 DEF",digitFourLabel:"4 GHI",digitFiveLabel:"5 JKL",digitSixLabel:"6 MNO",digitSevenLabel:"7 PQRS",digitEightLabel:"8 TUV",digitNineLabel:"9 WXYZ",digitAsteriskLabel:"*",digitZeroLabel:"0",digitHashtagLabel:"#",errorLabel:"Error:"},tab:{dismissButtonLabel:"Press the DELETE key to close this tab"},searchableSelect:{clearButtonLabel:"Clear selection",noOptionsMessage:"No options",noMatchesMessage:"No options found",selectAllLabel:"Select All",deselectAllLabel:"Deselect All",selectedAllMessage:"All options selected",deselectedAllMessage:"All options deselected",loadingOptionsMessage:"Loading...",removeTagButtonLabel:e=>`Remove ${e}`,optionSelectedMessage:e=>`Option ${e} selected.`,optionDeselectedMessage:e=>`Option ${e} deselected.`,optionFocusedMessage:(e,t,o,n)=>`Option ${e} focused, ${n?"selected, ":""}${t} of ${o}.`,maxSelectedMessage:(e,t)=>`${e} of ${t} selected.`},richTextEditor:{paragraphStyles:"Paragraph styles",textSize:"Text size",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",monospace:"Monospace",textColor:"Text color",undo:"Undo",redo:"Redo",bulletList:"Bullet list",numberedList:"Numbered list",alignment:"Alignment",alignments:{left:"Left",center:"Center",right:"Right"},hyperlink:"Hyperlink",linkText:"Text",linkUrl:"URL",linkTextPlaceholder:"Type text to convert into link",linkUrlPlaceholder:"Insert link URL",cancel:"Cancel",apply:"Apply",close:"Close",edit:"Edit",delete:"Delete",imageSizes:{small:"Small",fit:"Fit",original:"Original size"},suggestLoading:"Loading...",suggestNoResults:"No results"},button:{pendingLabel:"Loading..."},feedbackMessage:{errorIconText:"Error:",successIconText:"Success:"},connotationAnnoncement:{accentIcon:"Accent:",alertIcon:"Alert:",informationIcon:"Information:",successIcon:"Success:",warningIcon:"Warning:",announcementIcon:"Announcement:",ctaIcon:"Call to action:"},charCount:{charactersLimitMessage:e=>`You can enter up to ${e} characters`,charactersRemainingMessage:e=>`You have ${e} characters remaining`},dataGrid:{cell:{selected:"Selected",button:"(button)",sortStatus:{ascending:"Sorted ascending.",descending:"Sorted descending.",none:"Not sorted.",other:"Custom sort applied."},sortInstruction:{ascending:"Click to sort descending.",descending:"Click to un-sort.",none:"Click to sort ascending.",other:"Click to reset sorting."}}},pagination:{previousPageLabel:"Go to previous page",nextPageLabel:"Go to next page",goToPageLabel:e=>`Go to page ${e}`},tag:{remove:e=>`Remove ${e}`},toggletip:{anchorLabel:e=>e?`Show more information about ${e}`:"Show more information"},baseColorPicker:{colorSwatchLabel:(e,t,o)=>{let n=t?`Select ${t}, hex: ${e}`:`Select ${e}`;return o&&(n+=", selected."),n}},simpleColorPicker:{colorPaletteLabel:"Color palette"},colorPicker:{popupLabel:"Color Picker",swatchesLabel:"Saved colors",pickerButtonLabel:"Color Picker",hexInputLabel:"HEX color code",saveButtonLabel:"Save current color",closeButtonLabel:"Close Color Picker",copyButtonLabel:"Copy color to clipboard",copyErrorText:"Copy failed. Clipboard access was blocked. Try again.",copySuccessMessage:e=>`Color ${e} copied to clipboard.`,selectionSuccessMessage:e=>`Color ${e} selected.`,maxSwatchesMessage:(e,t)=>`${e} of ${t} colors saved.`}};var X=Object.defineProperty,Z=(e,t,o,n)=>{for(var a=void 0,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=l(t,o,a)||a);return a&&X(t,o,a),a};class J{constructor(){this.locale=K}}Z([i.observable],J.prototype,"locale");const Q=new J,H=e=>{class t extends e{get locale(){return Q.locale}}return t},ee=e=>{class t extends H(e){localeChanged(){}connectedCallback(){super.connectedCallback(),this.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#a()}#t={handleChange:()=>{this.localeChanged()}};#e;#o(){this.#e=i.Observable.binding(()=>this.locale,this.#t),this.#e.observe(this,i.ExecutionContext.default)}#a(){this.#e.dispose()}}return t};exports.Localized=H;exports.WithObservableLocale=ee;
|
|
1
|
+
"use strict";const i=require("./vivid-element.cjs"),r="Play",c="Pause",d="Replay",u="Duration",p="LIVE",b="Loaded",g="Progress",h="Fullscreen",m="Mute",L="Unmute",y="Subtitles",f="Captions",C="Chapters",S="Descriptions",k="Close",v="Text",P="White",T="Black",w="Red",M="Green",B="Blue",D="Yellow",x="Magenta",E="Cyan",A="Background",$="Window",F="Transparent",O="Opaque",R="None",I="Raised",N="Depressed",U="Uniform",W="Casual",Y="Script",z="Reset",V="Done",G="Color",_="Opacity",q={"Audio Player":"Audio Player","Video Player":"Video Player",Play:r,Pause:c,Replay:d,"Current Time":"Current Time",Duration:u,"Remaining Time":"Remaining Time","Stream Type":"Stream Type",LIVE:p,"Seek to live, currently behind live":"Seek to live, currently behind live","Seek to live, currently playing live":"Seek to live, currently playing live",Loaded:b,Progress:g,"Progress Bar":"Progress Bar","progress bar timing: currentTime={1} duration={2}":"{1} of {2}",Fullscreen:h,"Exit Fullscreen":"Exit Fullscreen",Mute:m,Unmute:L,"Playback Rate":"Playback Rate",Subtitles:y,"subtitles off":"subtitles off",Captions:f,"captions off":"captions off",Chapters:C,Descriptions:S,"descriptions off":"descriptions off","Audio Track":"Audio Track","Volume Level":"Volume Level","You aborted the media playback":"You aborted the media playback","A network error caused the media download to fail part-way.":"A network error caused the media download to fail part-way.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"The media could not be loaded, either because the server or network failed or because the format is not supported.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.","No compatible source was found for this media.":"No compatible source was found for this media.","The media is encrypted and we do not have the keys to decrypt it.":"The media is encrypted and we do not have the keys to decrypt it.","Play Video":"Play Video",Close:k,"Close Modal Dialog":"Close Modal Dialog","Modal Window":"Modal Window","This is a modal window":"This is a modal window","This modal can be closed by pressing the Escape key or activating the close button.":"This modal can be closed by pressing the Escape key or activating the close button.",", opens captions settings dialog":", opens captions settings dialog",", opens subtitles settings dialog":", opens subtitles settings dialog",", opens descriptions settings dialog":", opens descriptions settings dialog",", selected":", selected","captions settings":"captions settings","subtitles settings":"subtitles settings","descriptions settings":"descriptions settings",Text:v,White:P,Black:T,Red:w,Green:M,Blue:B,Yellow:D,Magenta:x,Cyan:E,Background:A,Window:$,Transparent:F,"Semi-Transparent":"Semi-Transparent",Opaque:O,"Font Size":"Font Size","Text Edge Style":"Text Edge Style",None:R,Raised:I,Depressed:N,Uniform:U,"Drop shadow":"Drop shadow","Font Family":"Font Family","Proportional Sans-Serif":"Proportional Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportional Serif","Monospace Serif":"Monospace Serif",Casual:W,Script:Y,"Small Caps":"Small Caps",Reset:z,"restore all settings to the default values":"restore all settings to the default values",Done:V,"Caption Settings Dialog":"Caption Settings Dialog","Beginning of dialog window. Escape will cancel and close the window.":"Beginning of dialog window. Escape will cancel and close the window.","End of dialog window.":"End of dialog window.","{1} is loading.":"{1} is loading.","Exit Picture-in-Picture":"Exit Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture","No content":"No content",Color:G,Opacity:_,"Text Background":"Text Background","Caption Area Background":"Caption Area Background","Playing in Picture-in-Picture":"Playing in Picture-in-Picture","Skip backward {1} seconds":"Skip backward {1} seconds","Skip forward {1} seconds":"Skip forward {1} seconds"},j=Object.freeze(Object.defineProperty({__proto__:null,Background:A,Black:T,Blue:B,Captions:f,Casual:W,Chapters:C,Close:k,Color:G,Cyan:E,Depressed:N,Descriptions:S,Done:V,Duration:u,Fullscreen:h,Green:M,LIVE:p,Loaded:b,Magenta:x,Mute:m,None:R,Opacity:_,Opaque:O,Pause:c,Play:r,Progress:g,Raised:I,Red:w,Replay:d,Reset:z,Script:Y,Subtitles:y,Text:v,Transparent:F,Uniform:U,Unmute:L,White:P,Window:$,Yellow:D,default:q},Symbol.toStringTag,{value:"Module"})),K={lang:"en-US",common:{useCommaAsDecimalSeparator:!1},pickerField:{clearLabel:"Clear",okLabel:"OK"},calendarPicker:{months:{name:["January","February","March","April","May","June","July","August","September","October","November","December"],shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},weekdays:{name:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},firstDayOfWeek:0,dateFormat:"MM/dd/yyyy",dateFormatPlaceholder:"MM/DD/YYYY",chooseDateLabel:"Choose date",changeDateLabel:e=>`Change date, ${e}`,chooseDatesLabel:"Choose dates",changeDatesLabel:e=>`Change dates, ${e}`,prevYearLabel:"Previous year",prevMonthLabel:"Previous month",nextMonthLabel:"Next month",nextYearLabel:"Next year",todayLabel:"today",selectedLabel:"selected",currentLabel:"current",changeMonthLabel:e=>`Change month, ${e} selected`,showCalendarForMonthLabel:e=>`Show calendar for ${e}`,invalidDateError:"Please enter a valid date.",invalidDateRangeError:"Please enter a valid date range.",startDateAfterMinDateError:e=>`The start date must be ${e} or later.`,endDateBeforeMaxDateError:e=>`The end date must be ${e} or earlier.`},timePicker:{defaultTo12HourClock:!0,chooseTimeLabel:"Choose time",changeTimeLabel:e=>`Change time, ${e}`,hoursLabel:"hours",minutesLabel:"minutes",secondsLabel:"seconds",meridiesLabel:"AM/PM",invalidTimeError:"Please enter a valid time."},dateTimePicker:{chooseDateTimeLabel:"Choose date and time",changeDateTimeLabel:e=>`Change date and time, ${e}`,invalidDateTimeError:"Please enter a valid date and time.",dateBeforeMinDateError:e=>`Date must be ${e} or later.`,dateAfterMaxDateError:e=>`Date must be ${e} or earlier.`,timeBeforeMinTimeError:e=>`Time must be ${e} or later.`,timeAfterMaxTimeError:e=>`Time must be ${e} or earlier.`},filePicker:{invalidFileTypeError:"You can't select files of this type.",maxFilesExceededError:"You can't select any more files.",fileTooBigError:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",removeFileLabel:"Remove file",invalidFilesError:"One or more selected files are invalid. Please, upload only valid file types under the size limit.",uploadFilesLabel:"Upload files"},audioPlayer:{playButtonLabel:"Play",pauseButtonLabel:"Pause",sliderLabel:"Audio progress bar",skipForwardButton:"Skip Forward",skipBackwardButton:"Skip Backward"},alert:{dismissButtonLabel:"Close"},dialog:{dismissButtonLabel:"Close"},popover:{dismissButtonLabel:"Close"},banner:{dismissButtonLabel:"Close"},numberField:{incrementButtonLabel:e=>e===1?"Increase value":`Increase value by ${e}`,decrementButtonLabel:e=>e===1?"Decrease value":`Decrease value by ${e}`,updatedValueAnnouncement:e=>`Updated value: ${e}`},splitButton:{showMoreActionsLabel:"Show more actions"},videoPlayer:j,rangeSlider:{startThumbLabel:"min",endThumbLabel:"max"},dialPad:{inputLabel:"Phone number",deleteButtonLabel:"Delete last digit",callButtonLabel:"Call",endCallButtonLabel:"End call",digitOneLabel:"1",digitTwoLabel:"2 ABC",digitThreeLabel:"3 DEF",digitFourLabel:"4 GHI",digitFiveLabel:"5 JKL",digitSixLabel:"6 MNO",digitSevenLabel:"7 PQRS",digitEightLabel:"8 TUV",digitNineLabel:"9 WXYZ",digitAsteriskLabel:"*",digitZeroLabel:"0",digitHashtagLabel:"#",errorLabel:"Error:"},tab:{dismissButtonLabel:"Press the DELETE key to close this tab"},select:{clearButtonLabel:"Clear selection"},searchableSelect:{clearButtonLabel:"Clear selection",noOptionsMessage:"No options",noMatchesMessage:"No options found",selectAllLabel:"Select All",deselectAllLabel:"Deselect All",selectedAllMessage:"All options selected",deselectedAllMessage:"All options deselected",loadingOptionsMessage:"Loading...",removeTagButtonLabel:e=>`Remove ${e}`,optionSelectedMessage:e=>`Option ${e} selected.`,optionDeselectedMessage:e=>`Option ${e} deselected.`,optionFocusedMessage:(e,t,o,n)=>`Option ${e} focused, ${n?"selected, ":""}${t} of ${o}.`,maxSelectedMessage:(e,t)=>`${e} of ${t} selected.`},richTextEditor:{paragraphStyles:"Paragraph styles",textSize:"Text size",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",monospace:"Monospace",textColor:"Text color",undo:"Undo",redo:"Redo",bulletList:"Bullet list",numberedList:"Numbered list",alignment:"Alignment",alignments:{left:"Left",center:"Center",right:"Right"},hyperlink:"Hyperlink",linkText:"Text",linkUrl:"URL",linkTextPlaceholder:"Type text to convert into link",linkUrlPlaceholder:"Insert link URL",cancel:"Cancel",apply:"Apply",close:"Close",edit:"Edit",delete:"Delete",imageSizes:{small:"Small",fit:"Fit",original:"Original size"},suggestLoading:"Loading...",suggestNoResults:"No results"},button:{pendingLabel:"Loading..."},feedbackMessage:{errorIconText:"Error:",successIconText:"Success:"},connotationAnnoncement:{accentIcon:"Accent:",alertIcon:"Alert:",informationIcon:"Information:",successIcon:"Success:",warningIcon:"Warning:",announcementIcon:"Announcement:",ctaIcon:"Call to action:"},charCount:{charactersLimitMessage:e=>`You can enter up to ${e} characters`,charactersRemainingMessage:e=>`You have ${e} characters remaining`},dataGrid:{cell:{selected:"Selected",button:"(button)",sortStatus:{ascending:"Sorted ascending.",descending:"Sorted descending.",none:"Not sorted.",other:"Custom sort applied."},sortInstruction:{ascending:"Click to sort descending.",descending:"Click to un-sort.",none:"Click to sort ascending.",other:"Click to reset sorting."}}},pagination:{previousPageLabel:"Go to previous page",nextPageLabel:"Go to next page",goToPageLabel:e=>`Go to page ${e}`},tag:{remove:e=>`Remove ${e}`},toggletip:{anchorLabel:e=>e?`Show more information about ${e}`:"Show more information"},baseColorPicker:{colorSwatchLabel:(e,t,o)=>{let n=t?`Select ${t}, hex: ${e}`:`Select ${e}`;return o&&(n+=", selected."),n}},simpleColorPicker:{colorPaletteLabel:"Color palette"},colorPicker:{popupLabel:"Color Picker",swatchesLabel:"Saved colors",pickerButtonLabel:"Color Picker",hexInputLabel:"HEX color code",saveButtonLabel:"Save current color",closeButtonLabel:"Close Color Picker",copyButtonLabel:"Copy color to clipboard",copyErrorText:"Copy failed. Clipboard access was blocked. Try again.",copySuccessMessage:e=>`Color ${e} copied to clipboard.`,selectionSuccessMessage:e=>`Color ${e} selected.`,maxSwatchesMessage:(e,t)=>`${e} of ${t} colors saved.`}};var X=Object.defineProperty,Z=(e,t,o,n)=>{for(var a=void 0,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=l(t,o,a)||a);return a&&X(t,o,a),a};class J{constructor(){this.locale=K}}Z([i.observable],J.prototype,"locale");const Q=new J,H=e=>{class t extends e{get locale(){return Q.locale}}return t},ee=e=>{class t extends H(e){localeChanged(){}connectedCallback(){super.connectedCallback(),this.#o()}disconnectedCallback(){super.disconnectedCallback(),this.#a()}#t={handleChange:()=>{this.localeChanged()}};#e;#o(){this.#e=i.Observable.binding(()=>this.locale,this.#t),this.#e.observe(this,i.ExecutionContext.default)}#a(){this.#e.dispose()}}return t};exports.Localized=H;exports.WithObservableLocale=ee;
|
package/bundled/localized.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as J, O as H, E as j } from "./vivid-element.js";
|
|
2
|
-
const
|
|
2
|
+
const l = "Play", r = "Pause", c = "Replay", d = "Duration", u = "LIVE", p = "Loaded", b = "Progress", g = "Fullscreen", h = "Mute", m = "Unmute", L = "Subtitles", y = "Captions", f = "Chapters", C = "Descriptions", S = "Close", k = "Text", P = "White", v = "Black", T = "Red", w = "Green", M = "Blue", B = "Yellow", D = "Magenta", x = "Cyan", E = "Background", A = "Window", $ = "Transparent", F = "Opaque", O = "None", R = "Raised", I = "Depressed", N = "Uniform", U = "Casual", W = "Script", Y = "Reset", z = "Done", V = "Color", G = "Opacity", q = {
|
|
3
3
|
"Audio Player": "Audio Player",
|
|
4
4
|
"Video Player": "Video Player",
|
|
5
|
-
Play:
|
|
6
|
-
Pause:
|
|
5
|
+
Play: l,
|
|
6
|
+
Pause: r,
|
|
7
7
|
Replay: c,
|
|
8
8
|
"Current Time": "Current Time",
|
|
9
9
|
Duration: d,
|
|
@@ -13,17 +13,17 @@ const r = "Play", l = "Pause", c = "Replay", d = "Duration", u = "LIVE", p = "Lo
|
|
|
13
13
|
"Seek to live, currently behind live": "Seek to live, currently behind live",
|
|
14
14
|
"Seek to live, currently playing live": "Seek to live, currently playing live",
|
|
15
15
|
Loaded: p,
|
|
16
|
-
Progress:
|
|
16
|
+
Progress: b,
|
|
17
17
|
"Progress Bar": "Progress Bar",
|
|
18
18
|
"progress bar timing: currentTime={1} duration={2}": "{1} of {2}",
|
|
19
|
-
Fullscreen:
|
|
19
|
+
Fullscreen: g,
|
|
20
20
|
"Exit Fullscreen": "Exit Fullscreen",
|
|
21
21
|
Mute: h,
|
|
22
22
|
Unmute: m,
|
|
23
23
|
"Playback Rate": "Playback Rate",
|
|
24
|
-
Subtitles:
|
|
24
|
+
Subtitles: L,
|
|
25
25
|
"subtitles off": "subtitles off",
|
|
26
|
-
Captions:
|
|
26
|
+
Captions: y,
|
|
27
27
|
"captions off": "captions off",
|
|
28
28
|
Chapters: f,
|
|
29
29
|
Descriptions: C,
|
|
@@ -100,7 +100,7 @@ const r = "Play", l = "Pause", c = "Replay", d = "Duration", u = "LIVE", p = "Lo
|
|
|
100
100
|
Background: E,
|
|
101
101
|
Black: v,
|
|
102
102
|
Blue: M,
|
|
103
|
-
Captions:
|
|
103
|
+
Captions: y,
|
|
104
104
|
Casual: U,
|
|
105
105
|
Chapters: f,
|
|
106
106
|
Close: S,
|
|
@@ -110,7 +110,7 @@ const r = "Play", l = "Pause", c = "Replay", d = "Duration", u = "LIVE", p = "Lo
|
|
|
110
110
|
Descriptions: C,
|
|
111
111
|
Done: z,
|
|
112
112
|
Duration: d,
|
|
113
|
-
Fullscreen:
|
|
113
|
+
Fullscreen: g,
|
|
114
114
|
Green: w,
|
|
115
115
|
LIVE: u,
|
|
116
116
|
Loaded: p,
|
|
@@ -119,15 +119,15 @@ const r = "Play", l = "Pause", c = "Replay", d = "Duration", u = "LIVE", p = "Lo
|
|
|
119
119
|
None: O,
|
|
120
120
|
Opacity: G,
|
|
121
121
|
Opaque: F,
|
|
122
|
-
Pause:
|
|
123
|
-
Play:
|
|
124
|
-
Progress:
|
|
122
|
+
Pause: r,
|
|
123
|
+
Play: l,
|
|
124
|
+
Progress: b,
|
|
125
125
|
Raised: R,
|
|
126
126
|
Red: T,
|
|
127
127
|
Replay: c,
|
|
128
128
|
Reset: Y,
|
|
129
129
|
Script: W,
|
|
130
|
-
Subtitles:
|
|
130
|
+
Subtitles: L,
|
|
131
131
|
Text: k,
|
|
132
132
|
Transparent: $,
|
|
133
133
|
Uniform: N,
|
|
@@ -335,6 +335,9 @@ const r = "Play", l = "Pause", c = "Replay", d = "Duration", u = "LIVE", p = "Lo
|
|
|
335
335
|
tab: {
|
|
336
336
|
dismissButtonLabel: "Press the DELETE key to close this tab"
|
|
337
337
|
},
|
|
338
|
+
select: {
|
|
339
|
+
clearButtonLabel: "Clear selection"
|
|
340
|
+
},
|
|
338
341
|
searchableSelect: {
|
|
339
342
|
clearButtonLabel: "Clear selection",
|
|
340
343
|
noOptionsMessage: "No options",
|
|
@@ -530,6 +533,7 @@ const ee = new _(), te = (e) => {
|
|
|
530
533
|
* Called whenever the locale changes.
|
|
531
534
|
* @internal
|
|
532
535
|
*/
|
|
536
|
+
/* v8 ignore next */
|
|
533
537
|
localeChanged() {
|
|
534
538
|
}
|
|
535
539
|
connectedCallback() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";function d(s){this.content=s}d.prototype={constructor:d,find:function(s){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===s)return t;return-1},get:function(s){var t=this.find(s);return t==-1?void 0:this.content[t+1]},update:function(s,t,e){var n=e&&e!=s?this.remove(e):this,i=n.find(s),r=n.content.slice();return i==-1?r.push(e||s,t):(r[i+1]=t,e&&(r[i]=e)),new d(r)},remove:function(s){var t=this.find(s);if(t==-1)return this;var e=this.content.slice();return e.splice(t,2),new d(e)},addToStart:function(s,t){return new d([s,t].concat(this.remove(s).content))},addToEnd:function(s,t){var e=this.remove(s).content.slice();return e.push(s,t),new d(e)},addBefore:function(s,t,e){var n=this.remove(t),i=n.content.slice(),r=n.find(s);return i.splice(r==-1?i.length:r,0,t,e),new d(i)},forEach:function(s){for(var t=0;t<this.content.length;t+=2)s(this.content[t],this.content[t+1])},prepend:function(s){return s=d.from(s),s.size?new d(s.content.concat(this.subtract(s).content)):this},append:function(s){return s=d.from(s),s.size?new d(this.subtract(s).content.concat(s.content)):this},subtract:function(s){var t=this;s=d.from(s);for(var e=0;e<s.content.length;e+=2)t=t.remove(s.content[e]);return t},toObject:function(){var s={};return this.forEach(function(t,e){s[t]=e}),s},get size(){return this.content.length>>1}};d.from=function(s){if(s instanceof d)return s;var t=[];if(s)for(var e in s)t.push(e,s[e]);return new d(t)};function K(s,t,e){for(let n=0;;n++){if(n==s.childCount||n==t.childCount)return s.childCount==t.childCount?null:e;let i=s.child(n),r=t.child(n);if(i==r){e+=i.nodeSize;continue}if(!i.sameMarkup(r))return e;if(i.isText&&i.text!=r.text){for(let l=0;i.text[l]==r.text[l];l++)e++;return e}if(i.content.size||r.content.size){let l=K(i.content,r.content,e+1);if(l!=null)return l}e+=i.nodeSize}}function _(s,t,e,n){for(let i=s.childCount,r=t.childCount;;){if(i==0||r==0)return i==r?null:{a:e,b:n};let l=s.child(--i),o=t.child(--r),h=l.nodeSize;if(l==o){e-=h,n-=h;continue}if(!l.sameMarkup(o))return{a:e,b:n};if(l.isText&&l.text!=o.text){let a=0,f=Math.min(l.text.length,o.text.length);for(;a<f&&l.text[l.text.length-a-1]==o.text[o.text.length-a-1];)a++,e--,n--;return{a:e,b:n}}if(l.content.size||o.content.size){let a=_(l.content,o.content,e-1,n-1);if(a)return a}e-=h,n-=h}}class c{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let n=0;n<t.length;n++)this.size+=t[n].nodeSize}nodesBetween(t,e,n,i=0,r){for(let l=0,o=0;o<e;l++){let h=this.content[l],a=o+h.nodeSize;if(a>t&&n(h,i+o,r||null,l)!==!1&&h.content.size){let f=o+1;h.nodesBetween(Math.max(0,t-f),Math.min(h.content.size,e-f),n,i+f)}o=a}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,i){let r="",l=!0;return this.nodesBetween(t,e,(o,h)=>{let a=o.isText?o.text.slice(Math.max(t,h)-h,e-h):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&a||o.isTextblock)&&n&&(l?l=!1:r+=n),r+=a},0),r}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,i=this.content.slice(),r=0;for(e.isText&&e.sameMarkup(n)&&(i[i.length-1]=e.withText(e.text+n.text),r=1);r<t.content.length;r++)i.push(t.content[r]);return new c(i,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let n=[],i=0;if(e>t)for(let r=0,l=0;l<e;r++){let o=this.content[r],h=l+o.nodeSize;h>t&&((l<t||h>e)&&(o.isText?o=o.cut(Math.max(0,t-l),Math.min(o.text.length,e-l)):o=o.cut(Math.max(0,t-l-1),Math.min(o.content.size,e-l-1))),n.push(o),i+=o.nodeSize),l=h}return new c(n,i)}cutByIndex(t,e){return t==e?c.empty:t==0&&e==this.content.length?this:new c(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let i=this.content.slice(),r=this.size+e.nodeSize-n.nodeSize;return i[t]=e,new c(i,r)}addToStart(t){return new c([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new c(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let i=this.content[e];t(i,n,e),n+=i.nodeSize}}findDiffStart(t,e=0){return K(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return _(this,t,e,n)}findIndex(t){if(t==0)return O(0,t);if(t==this.size)return O(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,n=0;;e++){let i=this.child(e),r=n+i.nodeSize;if(r>=t)return r==t?O(e+1,r):O(e,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return c.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new c(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return c.empty;let e,n=0;for(let i=0;i<t.length;i++){let r=t[i];n+=r.nodeSize,i&&r.isText&&t[i-1].sameMarkup(r)?(e||(e=t.slice(0,i)),e[e.length-1]=r.withText(e[e.length-1].text+r.text)):e&&e.push(r)}return new c(e||t,n)}static from(t){if(!t)return c.empty;if(t instanceof c)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new c([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}c.empty=new c([],0);const P={index:0,offset:0};function O(s,t){return P.index=s,P.offset=t,P}function M(s,t){if(s===t)return!0;if(!(s&&typeof s=="object")||!(t&&typeof t=="object"))return!1;let e=Array.isArray(s);if(Array.isArray(t)!=e)return!1;if(e){if(s.length!=t.length)return!1;for(let n=0;n<s.length;n++)if(!M(s[n],t[n]))return!1}else{for(let n in s)if(!(n in t)||!M(s[n],t[n]))return!1;for(let n in t)if(!(n in s))return!1}return!0}class u{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let i=0;i<t.length;i++){let r=t[i];if(this.eq(r))return t;if(this.type.excludes(r.type))e||(e=t.slice(0,i));else{if(r.type.excludes(this.type))return t;!n&&r.type.rank>this.type.rank&&(e||(e=t.slice(0,i)),e.push(this),n=!0),e&&e.push(r)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&M(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);let i=n.create(e.attrs);return n.checkAttrs(i.attrs),i}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return u.none;if(t instanceof u)return[t];let e=t.slice();return e.sort((n,i)=>n.type.rank-i.type.rank),e}}u.none=[];class R extends Error{}class g{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=tt(this.content,t+this.openStart,e);return n&&new g(n,this.openStart,this.openEnd)}removeBetween(t,e){return new g($(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return g.empty;let n=e.openStart||0,i=e.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new g(c.fromJSON(t,e.content),n,i)}static maxOpen(t,e=!0){let n=0,i=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let r=t.lastChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.lastChild)i++;return new g(t,n,i)}}g.empty=new g(c.empty,0,0);function $(s,t,e){let{index:n,offset:i}=s.findIndex(t),r=s.maybeChild(n),{index:l,offset:o}=s.findIndex(e);if(i==t||r.isText){if(o!=e&&!s.child(l).isText)throw new RangeError("Removing non-flat range");return s.cut(0,t).append(s.cut(e))}if(n!=l)throw new RangeError("Removing non-flat range");return s.replaceChild(n,r.copy($(r.content,t-i-1,e-i-1)))}function tt(s,t,e,n){let{index:i,offset:r}=s.findIndex(t),l=s.maybeChild(i);if(r==t||l.isText)return n&&!n.canReplace(i,i,e)?null:s.cut(0,t).append(e).append(s.cut(t));let o=tt(l.content,t-r-1,e,l);return o&&s.replaceChild(i,l.copy(o))}function xt(s,t,e){if(e.openStart>s.depth)throw new R("Inserted content deeper than insertion position");if(s.depth-e.openStart!=t.depth-e.openEnd)throw new R("Inconsistent open depths");return et(s,t,e,0)}function et(s,t,e,n){let i=s.index(n),r=s.node(n);if(i==t.index(n)&&n<s.depth-e.openStart){let l=et(s,t,e,n+1);return r.copy(r.content.replaceChild(i,l))}else if(e.content.size)if(!e.openStart&&!e.openEnd&&s.depth==n&&t.depth==n){let l=s.parent,o=l.content;return w(l,o.cut(0,s.parentOffset).append(e.content).append(o.cut(t.parentOffset)))}else{let{start:l,end:o}=mt(e,s);return w(r,it(s,l,o,t,n))}else return w(r,N(s,t,n))}function nt(s,t){if(!t.type.compatibleContent(s.type))throw new R("Cannot join "+t.type.name+" onto "+s.type.name)}function B(s,t,e){let n=s.node(e);return nt(n,t.node(e)),n}function m(s,t){let e=t.length-1;e>=0&&s.isText&&s.sameMarkup(t[e])?t[e]=s.withText(t[e].text+s.text):t.push(s)}function S(s,t,e,n){let i=(t||s).node(e),r=0,l=t?t.index(e):i.childCount;s&&(r=s.index(e),s.depth>e?r++:s.textOffset&&(m(s.nodeAfter,n),r++));for(let o=r;o<l;o++)m(i.child(o),n);t&&t.depth==e&&t.textOffset&&m(t.nodeBefore,n)}function w(s,t){return s.type.checkContent(t),s.copy(t)}function it(s,t,e,n,i){let r=s.depth>i&&B(s,t,i+1),l=n.depth>i&&B(e,n,i+1),o=[];return S(null,s,i,o),r&&l&&t.index(i)==e.index(i)?(nt(r,l),m(w(r,it(s,t,e,n,i+1)),o)):(r&&m(w(r,N(s,t,i+1)),o),S(t,e,i,o),l&&m(w(l,N(e,n,i+1)),o)),S(n,null,i,o),new c(o)}function N(s,t,e){let n=[];if(S(null,s,e,n),s.depth>e){let i=B(s,t,e+1);m(w(i,N(s,t,e+1)),n)}return S(t,null,e,n),new c(n)}function mt(s,t){let e=t.depth-s.openStart,i=t.node(e).copy(s.content);for(let r=e-1;r>=0;r--)i=t.node(r).copy(c.from(i));return{start:i.resolveNoCache(s.openStart+e),end:i.resolveNoCache(i.content.size-s.openEnd-e)}}class E{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=t.child(e);return n?t.child(e).cut(n):i}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):t==0?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[e*3],i=e==0?0:this.path[e*3-1]+1;for(let r=0;r<t;r++)i+=n.child(r).nodeSize;return i}marks(){let t=this.parent,e=this.index();if(t.content.size==0)return u.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),i=t.maybeChild(e);if(!n){let o=n;n=i,i=o}let r=n.marks;for(var l=0;l<r.length;l++)r[l].type.spec.inclusive===!1&&(!i||!r[l].isInSet(i.marks))&&(r=r[l--].removeFromSet(r));return r}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,i=t.parent.maybeChild(t.index());for(var r=0;r<n.length;r++)n[r].type.spec.inclusive===!1&&(!i||!n[r].isInSet(i.marks))&&(n=n[r--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new rt(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],i=0,r=e;for(let l=t;;){let{index:o,offset:h}=l.content.findIndex(r),a=r-h;if(n.push(l,o,i+h),!a||(l=l.child(o),l.isText))break;r=a-1,i+=h+1}return new E(e,n,r)}static resolveCached(t,e){let n=W.get(t);if(n)for(let r=0;r<n.elts.length;r++){let l=n.elts[r];if(l.pos==e)return l}else W.set(t,n=new wt);let i=n.elts[n.i]=E.resolve(t,e);return n.i=(n.i+1)%kt,i}}class wt{constructor(){this.elts=[],this.i=0}}const kt=12,W=new WeakMap;class rt{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const St=Object.create(null);class y{constructor(t,e,n,i=u.none){this.type=t,this.attrs=e,this.marks=i,this.content=n||c.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,i=0){this.content.nodesBetween(t,e,n,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,i){return this.content.textBetween(t,e,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&M(this.attrs,e||t.defaultAttrs||St)&&u.sameSet(this.marks,n||u.none)}copy(t=null){return t==this.content?this:new y(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new y(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return t==0&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return g.empty;let i=this.resolve(t),r=this.resolve(e),l=n?0:i.sharedDepth(e),o=i.start(l),a=i.node(l).content.cut(i.pos-o,r.pos-o);return new g(a,i.depth-l,r.depth-l)}replace(t,e,n){return xt(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:i}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(i==t||e.isText)return e;t-=i+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let i=this.content.child(e-1);return{node:i,index:e-1,offset:n-i.nodeSize}}resolve(t){return E.resolveCached(this,t)}resolveNoCache(t){return E.resolve(this,t)}rangeHasMark(t,e,n){let i=!1;return e>t&&this.nodesBetween(t,e,r=>(n.isInSet(r.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),st(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=c.empty,i=0,r=n.childCount){let l=this.contentMatchAt(t).matchFragment(n,i,r),o=l&&l.matchFragment(this.content,e);if(!o||!o.validEnd)return!1;for(let h=i;h<r;h++)if(!this.type.allowsMarks(n.child(h).marks))return!1;return!0}canReplaceWith(t,e,n,i){if(i&&!this.type.allowsMarks(i))return!1;let r=this.contentMatchAt(t).matchType(n),l=r&&r.matchFragment(this.content,e);return l?l.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=u.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!u.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(e=>e.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if(e.type=="text"){if(typeof e.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let i=c.fromJSON(t,e.content),r=t.nodeType(e.type).create(e.attrs,i,n);return r.type.checkAttrs(r.attrs),r}}y.prototype.text=void 0;class z extends y{constructor(t,e,n,i){if(super(t,e,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):st(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new z(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new z(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return t==0&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function st(s,t){for(let e=s.length-1;e>=0;e--)t=s[e].type.name+"("+t+")";return t}class k{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new bt(t,e);if(n.next==null)return k.empty;let i=lt(n);n.next&&n.err("Unexpected trailing text");let r=Rt(Mt(i));return Nt(r,n),r}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let i=this;for(let r=e;i&&r<n;r++)i=i.matchType(t.child(r).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let i=[this];function r(l,o){let h=l.matchFragment(t,n);if(h&&(!e||h.validEnd))return c.from(o.map(a=>a.createAndFill()));for(let a=0;a<l.next.length;a++){let{type:f,next:p}=l.next[a];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let x=r(p,o.concat(f));if(x)return x}}return null}return r(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),r=i.match;if(r.matchType(t)){let l=[];for(let o=i;o.type;o=o.via)l.push(o.type);return l.reverse()}for(let l=0;l<r.next.length;l++){let{type:o,next:h}=r.next[l];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in e)&&(!i.type||h.validEnd)&&(n.push({match:o.contentMatch,type:o,via:i}),e[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function e(n){t.push(n);for(let i=0;i<n.next.length;i++)t.indexOf(n.next[i].next)==-1&&e(n.next[i].next)}return e(this),t.map((n,i)=>{let r=i+(n.validEnd?"*":" ")+" ";for(let l=0;l<n.next.length;l++)r+=(l?", ":"")+n.next[l].type.name+"->"+t.indexOf(n.next[l].next);return r}).join(`
|
|
2
|
-
`)}}k.empty=new k(!0);class bt{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function lt(s){let t=[];do t.push(Et(s));while(s.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Et(s){let t=[];do t.push(Ct(s));while(s.next&&s.next!=")"&&s.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Ct(s){let t=vt(s);for(;;)if(s.eat("+"))t={type:"plus",expr:t};else if(s.eat("*"))t={type:"star",expr:t};else if(s.eat("?"))t={type:"opt",expr:t};else if(s.eat("{"))t=Ot(s,t);else break;return t}function j(s){/\D/.test(s.next)&&s.err("Expected number, got '"+s.next+"'");let t=Number(s.next);return s.pos++,t}function Ot(s,t){let e=j(s),n=e;return s.eat(",")&&(s.next!="}"?n=j(s):n=-1),s.eat("}")||s.err("Unclosed braced range"),{type:"range",min:e,max:n,expr:t}}function Tt(s,t){let e=s.nodeTypes,n=e[t];if(n)return[n];let i=[];for(let r in e){let l=e[r];l.isInGroup(t)&&i.push(l)}return i.length==0&&s.err("No node type or group '"+t+"' found"),i}function vt(s){if(s.eat("(")){let t=lt(s);return s.eat(")")||s.err("Missing closing paren"),t}else if(/\W/.test(s.next))s.err("Unexpected token '"+s.next+"'");else{let t=Tt(s,s.next).map(e=>(s.inline==null?s.inline=e.isInline:s.inline!=e.isInline&&s.err("Mixing inline and block content"),{type:"name",value:e}));return s.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function Mt(s){let t=[[]];return i(r(s,0),e()),t;function e(){return t.push([])-1}function n(l,o,h){let a={term:h,to:o};return t[l].push(a),a}function i(l,o){l.forEach(h=>h.to=o)}function r(l,o){if(l.type=="choice")return l.exprs.reduce((h,a)=>h.concat(r(a,o)),[]);if(l.type=="seq")for(let h=0;;h++){let a=r(l.exprs[h],o);if(h==l.exprs.length-1)return a;i(a,o=e())}else if(l.type=="star"){let h=e();return n(o,h),i(r(l.expr,h),h),[n(h)]}else if(l.type=="plus"){let h=e();return i(r(l.expr,o),h),i(r(l.expr,h),h),[n(h)]}else{if(l.type=="opt")return[n(o)].concat(r(l.expr,o));if(l.type=="range"){let h=o;for(let a=0;a<l.min;a++){let f=e();i(r(l.expr,h),f),h=f}if(l.max==-1)i(r(l.expr,h),h);else for(let a=l.min;a<l.max;a++){let f=e();n(h,f),i(r(l.expr,h),f),h=f}return[n(h)]}else{if(l.type=="name")return[n(o,void 0,l.value)];throw new Error("Unknown expr type")}}}}function ot(s,t){return t-s}function U(s,t){let e=[];return n(t),e.sort(ot);function n(i){let r=s[i];if(r.length==1&&!r[0].term)return n(r[0].to);e.push(i);for(let l=0;l<r.length;l++){let{term:o,to:h}=r[l];!o&&e.indexOf(h)==-1&&n(h)}}}function Rt(s){let t=Object.create(null);return e(U(s,0));function e(n){let i=[];n.forEach(l=>{s[l].forEach(({term:o,to:h})=>{if(!o)return;let a;for(let f=0;f<i.length;f++)i[f][0]==o&&(a=i[f][1]);U(s,h).forEach(f=>{a||i.push([o,a=[]]),a.indexOf(f)==-1&&a.push(f)})})});let r=t[n.join(",")]=new k(n.indexOf(s.length-1)>-1);for(let l=0;l<i.length;l++){let o=i[l][1].sort(ot);r.next.push({type:i[l][0],next:t[o.join(",")]||e(o)})}return r}}function Nt(s,t){for(let e=0,n=[s];e<n.length;e++){let i=n[e],r=!i.validEnd,l=[];for(let o=0;o<i.next.length;o++){let{type:h,next:a}=i.next[o];l.push(h.name),r&&!(h.isText||h.hasRequiredAttrs())&&(r=!1),n.indexOf(a)==-1&&n.push(a)}r&&t.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ht(s){let t=Object.create(null);for(let e in s){let n=s[e];if(!n.hasDefault)return null;t[e]=n.default}return t}function at(s,t){let e=Object.create(null);for(let n in s){let i=t&&t[n];if(i===void 0){let r=s[n];if(r.hasDefault)i=r.default;else throw new RangeError("No value supplied for attribute "+n)}e[n]=i}return e}function ft(s,t,e,n){for(let i in t)if(!(i in s))throw new RangeError(`Unsupported attribute ${i} for ${e} of type ${i}`);for(let i in s){let r=s[i];r.validate&&r.validate(t[i])}}function ct(s,t){let e=Object.create(null);if(t)for(let n in t)e[n]=new At(s,n,t[n]);return e}class A{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ct(t,n.attrs),this.defaultAttrs=ht(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==k.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:at(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new y(this,this.computeAttrs(t),c.from(e),u.setFrom(n))}createChecked(t=null,e,n){return e=c.from(e),this.checkContent(e),new y(this,this.computeAttrs(t),e,u.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),e=c.from(e),e.size){let l=this.contentMatch.fillBefore(e);if(!l)return null;e=l.append(e)}let i=this.contentMatch.matchFragment(e),r=i&&i.fillBefore(c.empty,!0);return r?new y(this,t,e.append(r),u.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){ft(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:u.none:t}static compile(t,e){let n=Object.create(null);t.forEach((r,l)=>n[r]=new A(r,e,l));let i=e.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let r in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}function zt(s,t,e){let n=e.split("|");return i=>{let r=i===null?"null":typeof i;if(n.indexOf(r)<0)throw new RangeError(`Expected value of type ${n} for attribute ${t} on type ${s}, got ${r}`)}}class At{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?zt(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class D{constructor(t,e,n,i){this.name=t,this.rank=e,this.schema=n,this.spec=i,this.attrs=ct(t,i.attrs),this.excluded=null;let r=ht(this.attrs);this.instance=r?new u(this,r):null}create(t=null){return!t&&this.instance?this.instance:new u(this,at(this.attrs,t))}static compile(t,e){let n=Object.create(null),i=0;return t.forEach((r,l)=>n[r]=new D(r,i++,e,l)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){ft(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class It{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let i in t)e[i]=t[i];e.nodes=d.from(t.nodes),e.marks=d.from(t.marks||{}),this.nodes=A.compile(this.spec.nodes,this),this.marks=D.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let r=this.nodes[i],l=r.spec.content||"",o=r.spec.marks;if(r.contentMatch=n[l]||(n[l]=k.parse(l,this.nodes)),r.inlineContent=r.contentMatch.inlineContent,r.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!r.isInline||!r.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=r}r.markSet=o=="_"?null:o?V(this,o.split(" ")):o==""||!r.inlineContent?[]:null}for(let i in this.marks){let r=this.marks[i],l=r.spec.excludes;r.excluded=l==null?[r]:l==""?[]:V(this,l.split(" "))}this.nodeFromJSON=i=>y.fromJSON(this,i),this.markFromJSON=i=>u.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof A){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(e,n,i)}text(t,e){let n=this.nodes.text;return new z(n,n.defaultAttrs,t,u.setFrom(e))}mark(t,e){return typeof t=="string"&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function V(s,t){let e=[];for(let n=0;n<t.length;n++){let i=t[n],r=s.marks[i],l=r;if(r)e.push(r);else for(let o in s.marks){let h=s.marks[o];(i=="_"||h.spec.group&&h.spec.group.split(" ").indexOf(i)>-1)&&e.push(l=h)}if(!l)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return e}function Dt(s){return s.tag!=null}function Pt(s){return s.style!=null}class I{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(i=>{if(Dt(i))this.tags.push(i);else if(Pt(i)){let r=/[^=]*/.exec(i.style)[0];n.indexOf(r)<0&&n.push(r),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let r=t.nodes[i.node];return r.contentMatch.matchType(r)})}parse(t,e={}){let n=new H(this,e,!1);return n.addAll(t,u.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new H(this,e,!0);return n.addAll(t,u.none,e.from,e.to),g.maxOpen(n.finish())}matchTag(t,e,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let r=this.tags[i];if(qt(t,r.tag)&&(r.namespace===void 0||t.namespaceURI==r.namespace)&&(!r.context||e.matchesContext(r.context))){if(r.getAttrs){let l=r.getAttrs(t);if(l===!1)continue;r.attrs=l||void 0}return r}}}matchStyle(t,e,n,i){for(let r=i?this.styles.indexOf(i)+1:0;r<this.styles.length;r++){let l=this.styles[r],o=l.style;if(!(o.indexOf(t)!=0||l.context&&!n.matchesContext(l.context)||o.length>t.length&&(o.charCodeAt(t.length)!=61||o.slice(t.length+1)!=e))){if(l.getAttrs){let h=l.getAttrs(e);if(h===!1)continue;l.attrs=h||void 0}return l}}}static schemaRules(t){let e=[];function n(i){let r=i.priority==null?50:i.priority,l=0;for(;l<e.length;l++){let o=e[l];if((o.priority==null?50:o.priority)<r)break}e.splice(l,0,i)}for(let i in t.marks){let r=t.marks[i].spec.parseDOM;r&&r.forEach(l=>{n(l=Q(l)),l.mark||l.ignore||l.clearMark||(l.mark=i)})}for(let i in t.nodes){let r=t.nodes[i].spec.parseDOM;r&&r.forEach(l=>{n(l=Q(l)),l.node||l.ignore||l.mark||(l.node=i)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new I(t,I.schemaRules(t)))}}const ut={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ft={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},pt={ol:!0,ul:!0},C=1,q=2,b=4;function G(s,t,e){return t!=null?(t?C:0)|(t==="full"?q:0):s&&s.whitespace=="pre"?C|q:e&~b}class T{constructor(t,e,n,i,r,l){this.type=t,this.attrs=e,this.marks=n,this.solid=i,this.options=l,this.content=[],this.activeMarks=u.none,this.match=r||(l&b?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(c.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(t.type))?(this.match=n,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&C)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let r=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-i[0].length))}}let e=c.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(c.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!ut.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class H{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=e.topNode,r,l=G(null,e.preserveWhitespace,0)|(n?b:0);i?r=new T(i.type,i.attrs,u.none,!0,e.topMatch||i.type.contentMatch,l):n?r=new T(null,null,u.none,!0,null,l):r=new T(t.schema.topNodeType,null,u.none,!0,null,l),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){t.nodeType==3?this.addTextNode(t,e):t.nodeType==1&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,i=this.top,r=i.options&q?"full":this.localPreserveWS||(i.options&C)>0,{schema:l}=this.parser;if(r==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r)if(r==="full")n=n.replace(/\r\n?/g,`
|
|
3
|
-
`);else if(l.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(l.linebreakReplacement.create())){let o=n.split(/\r?\n|\r/);for(let h=0;h<o.length;h++)h&&this.insertNode(l.linebreakReplacement.create(),e,!0),o[h]&&this.insertNode(l.text(o[h]),e,!/\S/.test(o[h]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],h=t.previousSibling;(!o||h&&h.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(l.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let i=this.localPreserveWS,r=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let l=t.nodeName.toLowerCase(),o;pt.hasOwnProperty(l)&&this.parser.normalizeLists&&Bt(t);let h=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,n));t:if(h?h.ignore:Ft.hasOwnProperty(l))this.findInside(t),this.ignoreFallback(t,e);else if(!h||h.skip||h.closeParent){h&&h.closeParent?this.open=Math.max(0,this.open-1):h&&h.skip.nodeType&&(t=h.skip);let a,
|
|
4
|
-
`),e)}ignoreFallback(t,e){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let r=this.parser.matchedStyles[i],l=n.getPropertyValue(r);if(l)for(let o=void 0;;){let h=this.parser.matchStyle(r,l,this,o);if(!h)break;if(h.ignore)return null;if(h.clearMark?e=e.filter(a=>!h.clearMark(a)):e=e.concat(this.parser.schema.marks[h.mark].create(h.attrs)),h.consuming===!1)o=h;else break}}return e}addElementByRule(t,e,n,i){let r,l;if(e.node)if(l=this.parser.schema.nodes[e.node],l.isLeaf)this.insertNode(l.create(e.attrs),n,t.nodeName=="BR")||this.leafFallback(t,n);else{let h=this.enter(l,e.attrs||null,n,e.preserveWhitespace);h&&(r=!0,n=h)}else{let h=this.parser.schema.marks[e.mark];n=n.concat(h.create(e.attrs))}let o=this.top;if(l&&l.isLeaf)this.findInside(t);else if(i)this.addElement(t,n,i);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(h=>this.insertNode(h,n,!1));else{let h=t;typeof e.contentElement=="string"?h=t.querySelector(e.contentElement):typeof e.contentElement=="function"?h=e.contentElement(t):e.contentElement&&(h=e.contentElement),this.findAround(t,h,!0),this.addAll(h,n),this.findAround(t,h,!1)}r&&this.sync(o)&&this.open--}addAll(t,e,n,i){let r=n||0;for(let l=n?t.childNodes[n]:t.firstChild,o=i==null?null:t.childNodes[i];l!=o;l=l.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(l,e);this.findAtPoint(t,r)}findPlace(t,e,n){let i,r;for(let l=this.open,o=0;l>=0;l--){let h=this.nodes[l],a=h.findWrapping(t);if(a&&(!i||i.length>a.length+o)&&(i=a,r=h,!a.length))break;if(h.solid){if(n)break;o+=2}}if(!i)return null;this.sync(r);for(let l=0;l<i.length;l++)e=this.enterInner(i[l],null,e,!1);return e}insertNode(t,e,n){if(t.isInline&&this.needsBlock&&!this.top.type){let r=this.textblockFromContext();r&&(e=this.enterInner(r,null,e))}let i=this.findPlace(t,e,n);if(i){this.closeExtra();let r=this.top;r.match&&(r.match=r.match.matchType(t.type));let l=u.none;for(let o of i.concat(t.marks))(r.type?r.type.allowsMarkType(o.type):X(o.type,t.type))&&(l=o.addToSet(l));return r.content.push(t.mark(l)),!0}return!1}enter(t,e,n,i){let r=this.findPlace(t.create(e),n,!1);return r&&(r=this.enterInner(t,e,n,!0,i)),r}enterInner(t,e,n,i=!1,r){this.closeExtra();let l=this.top;l.match=l.match&&l.match.matchType(t);let o=G(t,r,l.options);l.options&b&&l.content.length==0&&(o|=b);let h=u.none;return n=n.filter(a=>(l.type?l.type.allowsMarkType(a.type):X(a.type,t))?(h=a.addToSet(h),!1):!0),this.nodes.push(new T(t,e,h,i,null,o)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=C)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let i=n.length-1;i>=0;i--)t+=n[i].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].pos==null&&t.nodeType==1&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&e.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),r=-(n?n.depth+1:0)+(i?0:1),l=(o,h)=>{for(;o>=0;o--){let a=e[o];if(a==""){if(o==e.length-1||o==0)continue;for(;h>=r;h--)if(l(o-1,h))return!0;return!1}else{let
|
|
1
|
+
"use strict";function d(s){this.content=s}d.prototype={constructor:d,find:function(s){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===s)return t;return-1},get:function(s){var t=this.find(s);return t==-1?void 0:this.content[t+1]},update:function(s,t,e){var n=e&&e!=s?this.remove(e):this,i=n.find(s),r=n.content.slice();return i==-1?r.push(e||s,t):(r[i+1]=t,e&&(r[i]=e)),new d(r)},remove:function(s){var t=this.find(s);if(t==-1)return this;var e=this.content.slice();return e.splice(t,2),new d(e)},addToStart:function(s,t){return new d([s,t].concat(this.remove(s).content))},addToEnd:function(s,t){var e=this.remove(s).content.slice();return e.push(s,t),new d(e)},addBefore:function(s,t,e){var n=this.remove(t),i=n.content.slice(),r=n.find(s);return i.splice(r==-1?i.length:r,0,t,e),new d(i)},forEach:function(s){for(var t=0;t<this.content.length;t+=2)s(this.content[t],this.content[t+1])},prepend:function(s){return s=d.from(s),s.size?new d(s.content.concat(this.subtract(s).content)):this},append:function(s){return s=d.from(s),s.size?new d(this.subtract(s).content.concat(s.content)):this},subtract:function(s){var t=this;s=d.from(s);for(var e=0;e<s.content.length;e+=2)t=t.remove(s.content[e]);return t},toObject:function(){var s={};return this.forEach(function(t,e){s[t]=e}),s},get size(){return this.content.length>>1}};d.from=function(s){if(s instanceof d)return s;var t=[];if(s)for(var e in s)t.push(e,s[e]);return new d(t)};function K(s,t,e){for(let n=0;;n++){if(n==s.childCount||n==t.childCount)return s.childCount==t.childCount?null:e;let i=s.child(n),r=t.child(n);if(i==r){e+=i.nodeSize;continue}if(!i.sameMarkup(r))return e;if(i.isText&&i.text!=r.text){for(let l=0;i.text[l]==r.text[l];l++)e++;return e}if(i.content.size||r.content.size){let l=K(i.content,r.content,e+1);if(l!=null)return l}e+=i.nodeSize}}function _(s,t,e,n){for(let i=s.childCount,r=t.childCount;;){if(i==0||r==0)return i==r?null:{a:e,b:n};let l=s.child(--i),o=t.child(--r),h=l.nodeSize;if(l==o){e-=h,n-=h;continue}if(!l.sameMarkup(o))return{a:e,b:n};if(l.isText&&l.text!=o.text){let a=0,c=Math.min(l.text.length,o.text.length);for(;a<c&&l.text[l.text.length-a-1]==o.text[o.text.length-a-1];)a++,e--,n--;return{a:e,b:n}}if(l.content.size||o.content.size){let a=_(l.content,o.content,e-1,n-1);if(a)return a}e-=h,n-=h}}class f{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let n=0;n<t.length;n++)this.size+=t[n].nodeSize}nodesBetween(t,e,n,i=0,r){for(let l=0,o=0;o<e;l++){let h=this.content[l],a=o+h.nodeSize;if(a>t&&n(h,i+o,r||null,l)!==!1&&h.content.size){let c=o+1;h.nodesBetween(Math.max(0,t-c),Math.min(h.content.size,e-c),n,i+c)}o=a}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,i){let r="",l=!0;return this.nodesBetween(t,e,(o,h)=>{let a=o.isText?o.text.slice(Math.max(t,h)-h,e-h):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&a||o.isTextblock)&&n&&(l?l=!1:r+=n),r+=a},0),r}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,i=this.content.slice(),r=0;for(e.isText&&e.sameMarkup(n)&&(i[i.length-1]=e.withText(e.text+n.text),r=1);r<t.content.length;r++)i.push(t.content[r]);return new f(i,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let n=[],i=0;if(e>t)for(let r=0,l=0;l<e;r++){let o=this.content[r],h=l+o.nodeSize;h>t&&((l<t||h>e)&&(o.isText?o=o.cut(Math.max(0,t-l),Math.min(o.text.length,e-l)):o=o.cut(Math.max(0,t-l-1),Math.min(o.content.size,e-l-1))),n.push(o),i+=o.nodeSize),l=h}return new f(n,i)}cutByIndex(t,e){return t==e?f.empty:t==0&&e==this.content.length?this:new f(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let i=this.content.slice(),r=this.size+e.nodeSize-n.nodeSize;return i[t]=e,new f(i,r)}addToStart(t){return new f([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new f(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let i=this.content[e];t(i,n,e),n+=i.nodeSize}}findDiffStart(t,e=0){return K(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return _(this,t,e,n)}findIndex(t){if(t==0)return O(0,t);if(t==this.size)return O(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,n=0;;e++){let i=this.child(e),r=n+i.nodeSize;if(r>=t)return r==t?O(e+1,r):O(e,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return f.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new f(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return f.empty;let e,n=0;for(let i=0;i<t.length;i++){let r=t[i];n+=r.nodeSize,i&&r.isText&&t[i-1].sameMarkup(r)?(e||(e=t.slice(0,i)),e[e.length-1]=r.withText(e[e.length-1].text+r.text)):e&&e.push(r)}return new f(e||t,n)}static from(t){if(!t)return f.empty;if(t instanceof f)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new f([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}f.empty=new f([],0);const P={index:0,offset:0};function O(s,t){return P.index=s,P.offset=t,P}function M(s,t){if(s===t)return!0;if(!(s&&typeof s=="object")||!(t&&typeof t=="object"))return!1;let e=Array.isArray(s);if(Array.isArray(t)!=e)return!1;if(e){if(s.length!=t.length)return!1;for(let n=0;n<s.length;n++)if(!M(s[n],t[n]))return!1}else{for(let n in s)if(!(n in t)||!M(s[n],t[n]))return!1;for(let n in t)if(!(n in s))return!1}return!0}class u{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let i=0;i<t.length;i++){let r=t[i];if(this.eq(r))return t;if(this.type.excludes(r.type))e||(e=t.slice(0,i));else{if(r.type.excludes(this.type))return t;!n&&r.type.rank>this.type.rank&&(e||(e=t.slice(0,i)),e.push(this),n=!0),e&&e.push(r)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&M(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);let i=n.create(e.attrs);return n.checkAttrs(i.attrs),i}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return u.none;if(t instanceof u)return[t];let e=t.slice();return e.sort((n,i)=>n.type.rank-i.type.rank),e}}u.none=[];class R extends Error{}class g{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=tt(this.content,t+this.openStart,e);return n&&new g(n,this.openStart,this.openEnd)}removeBetween(t,e){return new g($(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return g.empty;let n=e.openStart||0,i=e.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new g(f.fromJSON(t,e.content),n,i)}static maxOpen(t,e=!0){let n=0,i=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let r=t.lastChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.lastChild)i++;return new g(t,n,i)}}g.empty=new g(f.empty,0,0);function $(s,t,e){let{index:n,offset:i}=s.findIndex(t),r=s.maybeChild(n),{index:l,offset:o}=s.findIndex(e);if(i==t||r.isText){if(o!=e&&!s.child(l).isText)throw new RangeError("Removing non-flat range");return s.cut(0,t).append(s.cut(e))}if(n!=l)throw new RangeError("Removing non-flat range");return s.replaceChild(n,r.copy($(r.content,t-i-1,e-i-1)))}function tt(s,t,e,n){let{index:i,offset:r}=s.findIndex(t),l=s.maybeChild(i);if(r==t||l.isText)return n&&!n.canReplace(i,i,e)?null:s.cut(0,t).append(e).append(s.cut(t));let o=tt(l.content,t-r-1,e,l);return o&&s.replaceChild(i,l.copy(o))}function xt(s,t,e){if(e.openStart>s.depth)throw new R("Inserted content deeper than insertion position");if(s.depth-e.openStart!=t.depth-e.openEnd)throw new R("Inconsistent open depths");return et(s,t,e,0)}function et(s,t,e,n){let i=s.index(n),r=s.node(n);if(i==t.index(n)&&n<s.depth-e.openStart){let l=et(s,t,e,n+1);return r.copy(r.content.replaceChild(i,l))}else if(e.content.size)if(!e.openStart&&!e.openEnd&&s.depth==n&&t.depth==n){let l=s.parent,o=l.content;return w(l,o.cut(0,s.parentOffset).append(e.content).append(o.cut(t.parentOffset)))}else{let{start:l,end:o}=mt(e,s);return w(r,it(s,l,o,t,n))}else return w(r,N(s,t,n))}function nt(s,t){if(!t.type.compatibleContent(s.type))throw new R("Cannot join "+t.type.name+" onto "+s.type.name)}function B(s,t,e){let n=s.node(e);return nt(n,t.node(e)),n}function m(s,t){let e=t.length-1;e>=0&&s.isText&&s.sameMarkup(t[e])?t[e]=s.withText(t[e].text+s.text):t.push(s)}function S(s,t,e,n){let i=(t||s).node(e),r=0,l=t?t.index(e):i.childCount;s&&(r=s.index(e),s.depth>e?r++:s.textOffset&&(m(s.nodeAfter,n),r++));for(let o=r;o<l;o++)m(i.child(o),n);t&&t.depth==e&&t.textOffset&&m(t.nodeBefore,n)}function w(s,t){return s.type.checkContent(t),s.copy(t)}function it(s,t,e,n,i){let r=s.depth>i&&B(s,t,i+1),l=n.depth>i&&B(e,n,i+1),o=[];return S(null,s,i,o),r&&l&&t.index(i)==e.index(i)?(nt(r,l),m(w(r,it(s,t,e,n,i+1)),o)):(r&&m(w(r,N(s,t,i+1)),o),S(t,e,i,o),l&&m(w(l,N(e,n,i+1)),o)),S(n,null,i,o),new f(o)}function N(s,t,e){let n=[];if(S(null,s,e,n),s.depth>e){let i=B(s,t,e+1);m(w(i,N(s,t,e+1)),n)}return S(t,null,e,n),new f(n)}function mt(s,t){let e=t.depth-s.openStart,i=t.node(e).copy(s.content);for(let r=e-1;r>=0;r--)i=t.node(r).copy(f.from(i));return{start:i.resolveNoCache(s.openStart+e),end:i.resolveNoCache(i.content.size-s.openEnd-e)}}class E{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=t.child(e);return n?t.child(e).cut(n):i}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):t==0?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[e*3],i=e==0?0:this.path[e*3-1]+1;for(let r=0;r<t;r++)i+=n.child(r).nodeSize;return i}marks(){let t=this.parent,e=this.index();if(t.content.size==0)return u.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),i=t.maybeChild(e);if(!n){let o=n;n=i,i=o}let r=n.marks;for(var l=0;l<r.length;l++)r[l].type.spec.inclusive===!1&&(!i||!r[l].isInSet(i.marks))&&(r=r[l--].removeFromSet(r));return r}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,i=t.parent.maybeChild(t.index());for(var r=0;r<n.length;r++)n[r].type.spec.inclusive===!1&&(!i||!n[r].isInSet(i.marks))&&(n=n[r--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new rt(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],i=0,r=e;for(let l=t;;){let{index:o,offset:h}=l.content.findIndex(r),a=r-h;if(n.push(l,o,i+h),!a||(l=l.child(o),l.isText))break;r=a-1,i+=h+1}return new E(e,n,r)}static resolveCached(t,e){let n=L.get(t);if(n)for(let r=0;r<n.elts.length;r++){let l=n.elts[r];if(l.pos==e)return l}else L.set(t,n=new wt);let i=n.elts[n.i]=E.resolve(t,e);return n.i=(n.i+1)%kt,i}}class wt{constructor(){this.elts=[],this.i=0}}const kt=12,L=new WeakMap;class rt{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const St=Object.create(null);class y{constructor(t,e,n,i=u.none){this.type=t,this.attrs=e,this.marks=i,this.content=n||f.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,i=0){this.content.nodesBetween(t,e,n,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,i){return this.content.textBetween(t,e,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&M(this.attrs,e||t.defaultAttrs||St)&&u.sameSet(this.marks,n||u.none)}copy(t=null){return t==this.content?this:new y(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new y(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return t==0&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return g.empty;let i=this.resolve(t),r=this.resolve(e),l=n?0:i.sharedDepth(e),o=i.start(l),a=i.node(l).content.cut(i.pos-o,r.pos-o);return new g(a,i.depth-l,r.depth-l)}replace(t,e,n){return xt(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:i}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(i==t||e.isText)return e;t-=i+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let i=this.content.child(e-1);return{node:i,index:e-1,offset:n-i.nodeSize}}resolve(t){return E.resolveCached(this,t)}resolveNoCache(t){return E.resolve(this,t)}rangeHasMark(t,e,n){let i=!1;return e>t&&this.nodesBetween(t,e,r=>(n.isInSet(r.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),st(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=f.empty,i=0,r=n.childCount){let l=this.contentMatchAt(t).matchFragment(n,i,r),o=l&&l.matchFragment(this.content,e);if(!o||!o.validEnd)return!1;for(let h=i;h<r;h++)if(!this.type.allowsMarks(n.child(h).marks))return!1;return!0}canReplaceWith(t,e,n,i){if(i&&!this.type.allowsMarks(i))return!1;let r=this.contentMatchAt(t).matchType(n),l=r&&r.matchFragment(this.content,e);return l?l.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=u.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!u.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(e=>e.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if(e.type=="text"){if(typeof e.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let i=f.fromJSON(t,e.content),r=t.nodeType(e.type).create(e.attrs,i,n);return r.type.checkAttrs(r.attrs),r}}y.prototype.text=void 0;class z extends y{constructor(t,e,n,i){if(super(t,e,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):st(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new z(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new z(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return t==0&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function st(s,t){for(let e=s.length-1;e>=0;e--)t=s[e].type.name+"("+t+")";return t}class k{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new bt(t,e);if(n.next==null)return k.empty;let i=lt(n);n.next&&n.err("Unexpected trailing text");let r=Rt(Mt(i));return Nt(r,n),r}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let i=this;for(let r=e;i&&r<n;r++)i=i.matchType(t.child(r).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let i=[this];function r(l,o){let h=l.matchFragment(t,n);if(h&&(!e||h.validEnd))return f.from(o.map(a=>a.createAndFill()));for(let a=0;a<l.next.length;a++){let{type:c,next:p}=l.next[a];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let x=r(p,o.concat(c));if(x)return x}}return null}return r(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),r=i.match;if(r.matchType(t)){let l=[];for(let o=i;o.type;o=o.via)l.push(o.type);return l.reverse()}for(let l=0;l<r.next.length;l++){let{type:o,next:h}=r.next[l];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in e)&&(!i.type||h.validEnd)&&(n.push({match:o.contentMatch,type:o,via:i}),e[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function e(n){t.push(n);for(let i=0;i<n.next.length;i++)t.indexOf(n.next[i].next)==-1&&e(n.next[i].next)}return e(this),t.map((n,i)=>{let r=i+(n.validEnd?"*":" ")+" ";for(let l=0;l<n.next.length;l++)r+=(l?", ":"")+n.next[l].type.name+"->"+t.indexOf(n.next[l].next);return r}).join(`
|
|
2
|
+
`)}}k.empty=new k(!0);class bt{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function lt(s){let t=[];do t.push(Et(s));while(s.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Et(s){let t=[];do t.push(Ct(s));while(s.next&&s.next!=")"&&s.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Ct(s){let t=vt(s);for(;;)if(s.eat("+"))t={type:"plus",expr:t};else if(s.eat("*"))t={type:"star",expr:t};else if(s.eat("?"))t={type:"opt",expr:t};else if(s.eat("{"))t=Ot(s,t);else break;return t}function j(s){/\D/.test(s.next)&&s.err("Expected number, got '"+s.next+"'");let t=Number(s.next);return s.pos++,t}function Ot(s,t){let e=j(s),n=e;return s.eat(",")&&(s.next!="}"?n=j(s):n=-1),s.eat("}")||s.err("Unclosed braced range"),{type:"range",min:e,max:n,expr:t}}function Tt(s,t){let e=s.nodeTypes,n=e[t];if(n)return[n];let i=[];for(let r in e){let l=e[r];l.isInGroup(t)&&i.push(l)}return i.length==0&&s.err("No node type or group '"+t+"' found"),i}function vt(s){if(s.eat("(")){let t=lt(s);return s.eat(")")||s.err("Missing closing paren"),t}else if(/\W/.test(s.next))s.err("Unexpected token '"+s.next+"'");else{let t=Tt(s,s.next).map(e=>(s.inline==null?s.inline=e.isInline:s.inline!=e.isInline&&s.err("Mixing inline and block content"),{type:"name",value:e}));return s.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function Mt(s){let t=[[]];return i(r(s,0),e()),t;function e(){return t.push([])-1}function n(l,o,h){let a={term:h,to:o};return t[l].push(a),a}function i(l,o){l.forEach(h=>h.to=o)}function r(l,o){if(l.type=="choice")return l.exprs.reduce((h,a)=>h.concat(r(a,o)),[]);if(l.type=="seq")for(let h=0;;h++){let a=r(l.exprs[h],o);if(h==l.exprs.length-1)return a;i(a,o=e())}else if(l.type=="star"){let h=e();return n(o,h),i(r(l.expr,h),h),[n(h)]}else if(l.type=="plus"){let h=e();return i(r(l.expr,o),h),i(r(l.expr,h),h),[n(h)]}else{if(l.type=="opt")return[n(o)].concat(r(l.expr,o));if(l.type=="range"){let h=o;for(let a=0;a<l.min;a++){let c=e();i(r(l.expr,h),c),h=c}if(l.max==-1)i(r(l.expr,h),h);else for(let a=l.min;a<l.max;a++){let c=e();n(h,c),i(r(l.expr,h),c),h=c}return[n(h)]}else{if(l.type=="name")return[n(o,void 0,l.value)];throw new Error("Unknown expr type")}}}}function ot(s,t){return t-s}function U(s,t){let e=[];return n(t),e.sort(ot);function n(i){let r=s[i];if(r.length==1&&!r[0].term)return n(r[0].to);e.push(i);for(let l=0;l<r.length;l++){let{term:o,to:h}=r[l];!o&&e.indexOf(h)==-1&&n(h)}}}function Rt(s){let t=Object.create(null);return e(U(s,0));function e(n){let i=[];n.forEach(l=>{s[l].forEach(({term:o,to:h})=>{if(!o)return;let a;for(let c=0;c<i.length;c++)i[c][0]==o&&(a=i[c][1]);U(s,h).forEach(c=>{a||i.push([o,a=[]]),a.indexOf(c)==-1&&a.push(c)})})});let r=t[n.join(",")]=new k(n.indexOf(s.length-1)>-1);for(let l=0;l<i.length;l++){let o=i[l][1].sort(ot);r.next.push({type:i[l][0],next:t[o.join(",")]||e(o)})}return r}}function Nt(s,t){for(let e=0,n=[s];e<n.length;e++){let i=n[e],r=!i.validEnd,l=[];for(let o=0;o<i.next.length;o++){let{type:h,next:a}=i.next[o];l.push(h.name),r&&!(h.isText||h.hasRequiredAttrs())&&(r=!1),n.indexOf(a)==-1&&n.push(a)}r&&t.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ht(s){let t=Object.create(null);for(let e in s){let n=s[e];if(!n.hasDefault)return null;t[e]=n.default}return t}function at(s,t){let e=Object.create(null);for(let n in s){let i=t&&t[n];if(i===void 0){let r=s[n];if(r.hasDefault)i=r.default;else throw new RangeError("No value supplied for attribute "+n)}e[n]=i}return e}function ct(s,t,e,n){for(let i in t)if(!(i in s))throw new RangeError(`Unsupported attribute ${i} for ${e} of type ${i}`);for(let i in s){let r=s[i];r.validate&&r.validate(t[i])}}function ft(s,t){let e=Object.create(null);if(t)for(let n in t)e[n]=new At(s,n,t[n]);return e}class A{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ft(t,n.attrs),this.defaultAttrs=ht(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==k.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:at(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new y(this,this.computeAttrs(t),f.from(e),u.setFrom(n))}createChecked(t=null,e,n){return e=f.from(e),this.checkContent(e),new y(this,this.computeAttrs(t),e,u.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),e=f.from(e),e.size){let l=this.contentMatch.fillBefore(e);if(!l)return null;e=l.append(e)}let i=this.contentMatch.matchFragment(e),r=i&&i.fillBefore(f.empty,!0);return r?new y(this,t,e.append(r),u.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){ct(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:u.none:t}static compile(t,e){let n=Object.create(null);t.forEach((r,l)=>n[r]=new A(r,e,l));let i=e.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let r in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}function zt(s,t,e){let n=e.split("|");return i=>{let r=i===null?"null":typeof i;if(n.indexOf(r)<0)throw new RangeError(`Expected value of type ${n} for attribute ${t} on type ${s}, got ${r}`)}}class At{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?zt(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class D{constructor(t,e,n,i){this.name=t,this.rank=e,this.schema=n,this.spec=i,this.attrs=ft(t,i.attrs),this.excluded=null;let r=ht(this.attrs);this.instance=r?new u(this,r):null}create(t=null){return!t&&this.instance?this.instance:new u(this,at(this.attrs,t))}static compile(t,e){let n=Object.create(null),i=0;return t.forEach((r,l)=>n[r]=new D(r,i++,e,l)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){ct(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class It{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let i in t)e[i]=t[i];e.nodes=d.from(t.nodes),e.marks=d.from(t.marks||{}),this.nodes=A.compile(this.spec.nodes,this),this.marks=D.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let r=this.nodes[i],l=r.spec.content||"",o=r.spec.marks;if(r.contentMatch=n[l]||(n[l]=k.parse(l,this.nodes)),r.inlineContent=r.contentMatch.inlineContent,r.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!r.isInline||!r.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=r}r.markSet=o=="_"?null:o?V(this,o.split(" ")):o==""||!r.inlineContent?[]:null}for(let i in this.marks){let r=this.marks[i],l=r.spec.excludes;r.excluded=l==null?[r]:l==""?[]:V(this,l.split(" "))}this.nodeFromJSON=i=>y.fromJSON(this,i),this.markFromJSON=i=>u.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof A){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(e,n,i)}text(t,e){let n=this.nodes.text;return new z(n,n.defaultAttrs,t,u.setFrom(e))}mark(t,e){return typeof t=="string"&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function V(s,t){let e=[];for(let n=0;n<t.length;n++){let i=t[n],r=s.marks[i],l=r;if(r)e.push(r);else for(let o in s.marks){let h=s.marks[o];(i=="_"||h.spec.group&&h.spec.group.split(" ").indexOf(i)>-1)&&e.push(l=h)}if(!l)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return e}function Dt(s){return s.tag!=null}function Pt(s){return s.style!=null}class I{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(i=>{if(Dt(i))this.tags.push(i);else if(Pt(i)){let r=/[^=]*/.exec(i.style)[0];n.indexOf(r)<0&&n.push(r),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let r=t.nodes[i.node];return r.contentMatch.matchType(r)})}parse(t,e={}){let n=new H(this,e,!1);return n.addAll(t,u.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new H(this,e,!0);return n.addAll(t,u.none,e.from,e.to),g.maxOpen(n.finish())}matchTag(t,e,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let r=this.tags[i];if(qt(t,r.tag)&&(r.namespace===void 0||t.namespaceURI==r.namespace)&&(!r.context||e.matchesContext(r.context))){if(r.getAttrs){let l=r.getAttrs(t);if(l===!1)continue;r.attrs=l||void 0}return r}}}matchStyle(t,e,n,i){for(let r=i?this.styles.indexOf(i)+1:0;r<this.styles.length;r++){let l=this.styles[r],o=l.style;if(!(o.indexOf(t)!=0||l.context&&!n.matchesContext(l.context)||o.length>t.length&&(o.charCodeAt(t.length)!=61||o.slice(t.length+1)!=e))){if(l.getAttrs){let h=l.getAttrs(e);if(h===!1)continue;l.attrs=h||void 0}return l}}}static schemaRules(t){let e=[];function n(i){let r=i.priority==null?50:i.priority,l=0;for(;l<e.length;l++){let o=e[l];if((o.priority==null?50:o.priority)<r)break}e.splice(l,0,i)}for(let i in t.marks){let r=t.marks[i].spec.parseDOM;r&&r.forEach(l=>{n(l=Q(l)),l.mark||l.ignore||l.clearMark||(l.mark=i)})}for(let i in t.nodes){let r=t.nodes[i].spec.parseDOM;r&&r.forEach(l=>{n(l=Q(l)),l.node||l.ignore||l.mark||(l.node=i)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new I(t,I.schemaRules(t)))}}const ut={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ft={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},pt={ol:!0,ul:!0},C=1,q=2,b=4;function G(s,t,e){return t!=null?(t?C:0)|(t==="full"?q:0):s&&s.whitespace=="pre"?C|q:e&~b}class T{constructor(t,e,n,i,r,l){this.type=t,this.attrs=e,this.marks=n,this.solid=i,this.options=l,this.content=[],this.activeMarks=u.none,this.match=r||(l&b?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(f.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(t.type))?(this.match=n,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&C)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let r=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-i[0].length))}}let e=f.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(f.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!ut.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class H{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=e.topNode,r,l=G(null,e.preserveWhitespace,0)|(n?b:0);i?r=new T(i.type,i.attrs,u.none,!0,e.topMatch||i.type.contentMatch,l):n?r=new T(null,null,u.none,!0,null,l):r=new T(t.schema.topNodeType,null,u.none,!0,null,l),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){t.nodeType==3?this.addTextNode(t,e):t.nodeType==1&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,i=this.top,r=i.options&q?"full":this.localPreserveWS||(i.options&C)>0,{schema:l}=this.parser;if(r==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r)if(r==="full")n=n.replace(/\r\n?/g,`
|
|
3
|
+
`);else if(l.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(l.linebreakReplacement.create())){let o=n.split(/\r?\n|\r/);for(let h=0;h<o.length;h++)h&&this.insertNode(l.linebreakReplacement.create(),e,!0),o[h]&&this.insertNode(l.text(o[h]),e,!/\S/.test(o[h]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],h=t.previousSibling;(!o||h&&h.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(l.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let i=this.localPreserveWS,r=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let l=t.nodeName.toLowerCase(),o;pt.hasOwnProperty(l)&&this.parser.normalizeLists&&Bt(t);let h=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,n));t:if(h?h.ignore:Ft.hasOwnProperty(l))this.findInside(t),this.ignoreFallback(t,e);else if(!h||h.skip||h.closeParent){h&&h.closeParent?this.open=Math.max(0,this.open-1):h&&h.skip.nodeType&&(t=h.skip);let a,c=this.needsBlock;if(ut.hasOwnProperty(l))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),a=!0,r.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}let p=h&&h.skip?e:this.readStyles(t,e);p&&this.addAll(t,p),a&&this.sync(r),this.needsBlock=c}else{let a=this.readStyles(t,e);a&&this.addElementByRule(t,h,a,h.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(t,e){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
4
|
+
`),e)}ignoreFallback(t,e){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let r=this.parser.matchedStyles[i],l=n.getPropertyValue(r);if(l)for(let o=void 0;;){let h=this.parser.matchStyle(r,l,this,o);if(!h)break;if(h.ignore)return null;if(h.clearMark?e=e.filter(a=>!h.clearMark(a)):e=e.concat(this.parser.schema.marks[h.mark].create(h.attrs)),h.consuming===!1)o=h;else break}}return e}addElementByRule(t,e,n,i){let r,l;if(e.node)if(l=this.parser.schema.nodes[e.node],l.isLeaf)this.insertNode(l.create(e.attrs),n,t.nodeName=="BR")||this.leafFallback(t,n);else{let h=this.enter(l,e.attrs||null,n,e.preserveWhitespace);h&&(r=!0,n=h)}else{let h=this.parser.schema.marks[e.mark];n=n.concat(h.create(e.attrs))}let o=this.top;if(l&&l.isLeaf)this.findInside(t);else if(i)this.addElement(t,n,i);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(h=>this.insertNode(h,n,!1));else{let h=t;typeof e.contentElement=="string"?h=t.querySelector(e.contentElement):typeof e.contentElement=="function"?h=e.contentElement(t):e.contentElement&&(h=e.contentElement),this.findAround(t,h,!0),this.addAll(h,n),this.findAround(t,h,!1)}r&&this.sync(o)&&this.open--}addAll(t,e,n,i){let r=n||0;for(let l=n?t.childNodes[n]:t.firstChild,o=i==null?null:t.childNodes[i];l!=o;l=l.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(l,e);this.findAtPoint(t,r)}findPlace(t,e,n){let i,r;for(let l=this.open,o=0;l>=0;l--){let h=this.nodes[l],a=h.findWrapping(t);if(a&&(!i||i.length>a.length+o)&&(i=a,r=h,!a.length))break;if(h.solid){if(n)break;o+=2}}if(!i)return null;this.sync(r);for(let l=0;l<i.length;l++)e=this.enterInner(i[l],null,e,!1);return e}insertNode(t,e,n){if(t.isInline&&this.needsBlock&&!this.top.type){let r=this.textblockFromContext();r&&(e=this.enterInner(r,null,e))}let i=this.findPlace(t,e,n);if(i){this.closeExtra();let r=this.top;r.match&&(r.match=r.match.matchType(t.type));let l=u.none;for(let o of i.concat(t.marks))(r.type?r.type.allowsMarkType(o.type):X(o.type,t.type))&&(l=o.addToSet(l));return r.content.push(t.mark(l)),!0}return!1}enter(t,e,n,i){let r=this.findPlace(t.create(e),n,!1);return r&&(r=this.enterInner(t,e,n,!0,i)),r}enterInner(t,e,n,i=!1,r){this.closeExtra();let l=this.top;l.match=l.match&&l.match.matchType(t);let o=G(t,r,l.options);l.options&b&&l.content.length==0&&(o|=b);let h=u.none;return n=n.filter(a=>(l.type?l.type.allowsMarkType(a.type):X(a.type,t))?(h=a.addToSet(h),!1):!0),this.nodes.push(new T(t,e,h,i,null,o)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=C)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let i=n.length-1;i>=0;i--)t+=n[i].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].pos==null&&t.nodeType==1&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&e.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),r=-(n?n.depth+1:0)+(i?0:1),l=(o,h)=>{for(;o>=0;o--){let a=e[o];if(a==""){if(o==e.length-1||o==0)continue;for(;h>=r;h--)if(l(o-1,h))return!0;return!1}else{let c=h>0||h==0&&i?this.nodes[h].type:n&&h>=r?n.node(h-r).type:null;if(!c||c.name!=a&&!c.isInGroup(a))return!1;h--}}return!0};return l(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let n=this.parser.schema.nodes[e];if(n.isTextblock&&n.defaultAttrs)return n}}}function Bt(s){for(let t=s.firstChild,e=null;t;t=t.nextSibling){let n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&pt.hasOwnProperty(n)&&e?(e.appendChild(t),t=e):n=="li"?e=t:n&&(e=null)}}function qt(s,t){return(s.matches||s.msMatchesSelector||s.webkitMatchesSelector||s.mozMatchesSelector).call(s,t)}function Q(s){let t={};for(let e in s)t[e]=s[e];return t}function X(s,t){let e=t.schema.nodes;for(let n in e){let i=e[n];if(!i.allowsMarkType(s))continue;let r=[],l=o=>{r.push(o);for(let h=0;h<o.edgeCount;h++){let{type:a,next:c}=o.edge(h);if(a==t||r.indexOf(c)<0&&l(c))return!0}};if(l(i.contentMatch))return!0}}class J{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=F(e).createDocumentFragment());let i=n,r=[];return t.forEach(l=>{if(r.length||l.marks.length){let o=0,h=0;for(;o<r.length&&h<l.marks.length;){let a=l.marks[h];if(!this.marks[a.type.name]){h++;continue}if(!a.eq(r[o][0])||a.type.spec.spanning===!1)break;o++,h++}for(;o<r.length;)i=r.pop()[1];for(;h<l.marks.length;){let a=l.marks[h++],c=this.serializeMark(a,l.isInline,e);c&&(r.push([a,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(l,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:i}=v(F(e),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,i)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let i=t.marks.length-1;i>=0;i--){let r=this.serializeMark(t.marks[i],t.isInline,e);r&&((r.contentDOM||r.dom).appendChild(n),n=r.dom)}return n}serializeMark(t,e,n={}){let i=this.marks[t.type.name];return i&&v(F(n),i(t,e),null,t.attrs)}static renderSpec(t,e,n=null,i){return v(t,e,n,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new J(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Y(t.nodes);return e.text||(e.text=n=>n.text),e}static marksFromSchema(t){return Y(t.marks)}}function Y(s){let t={};for(let e in s){let n=s[e].spec.toDOM;n&&(t[e]=n)}return t}function F(s){return s.document||window.document}const Z=new WeakMap;function Jt(s){let t=Z.get(s);return t===void 0&&Z.set(s,t=Wt(s)),t}function Wt(s){let t=null;function e(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")t||(t=[]),t.push(n);else for(let i=0;i<n.length;i++)e(n[i]);else for(let i in n)e(n[i])}return e(s),t}function v(s,t,e,n){if(typeof t=="string")return{dom:s.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],r;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(r=Jt(n))&&r.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let l=i.indexOf(" ");l>0&&(e=i.slice(0,l),i=i.slice(l+1));let o,h=e?s.createElementNS(e,i):s.createElement(i),a=t[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let p in a)if(a[p]!=null){let x=p.indexOf(" ");x>0?h.setAttributeNS(p.slice(0,x),p.slice(x+1),a[p]):p=="style"&&h.style?h.style.cssText=a[p]:h.setAttribute(p,a[p])}}for(let p=c;p<t.length;p++){let x=t[p];if(x===0){if(p<t.length-1||p>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:h,contentDOM:h}}else{let{dom:yt,contentDOM:W}=v(s,x,e,n);if(h.appendChild(yt),W){if(o)throw new RangeError("Multiple content holes");o=W}}}return{dom:h,contentDOM:o}}const Lt=s=>s.sort((t,e)=>{const n=t.priority-e.priority;return n!==0?n:t.featureName===e.featureName?0:t.featureName>e.featureName?1:-1}).map(t=>t.value),dt={highest:-20,high:-10,default:0};class jt{}class Ut{contribution(t,e){return{featureName:this.name,priority:e??dt.default,value:t}}getStyles(){return[]}getSchema(t,e){return[]}getTextblockAttrs(){return[]}getTextblockMarks(){return[]}getPlugins(t){return[]}getToolbarItems(t){return[]}getInputRules(t){return[]}getFeatures(){return[this]}getPublicInterface(t){}}const gt=new WeakMap,Vt=s=>gt.get(s),Gt=s=>{class t extends jt{constructor(...n){super(),gt.set(this,new s(...n))}}return t},Ht=Symbol("rte-internal-impl"),Qt=Symbol.for("slottable-request-remove");function Xt(s,t,e,n){const i=new CustomEvent("slottable-request",{bubbles:!1,composed:!1,detail:{name:t,slotName:e,data:n}});Object.defineProperties(i,{name:{value:t,enumerable:!0},slotName:{value:e,enumerable:!0},data:{value:n,enumerable:!0}}),s.dispatchEvent(i)}exports.DOMParser=I;exports.DOMSerializer=J;exports.Fragment=f;exports.Mark=u;exports.MarkType=D;exports.Node=y;exports.NodeRange=rt;exports.ReplaceError=R;exports.RteFeatureImpl=Ut;exports.Schema=It;exports.Slice=g;exports.contributionPriority=dt;exports.dispatchSlottableRequest=Xt;exports.featureFacade=Gt;exports.getFeatureImpl=Vt;exports.impl=Ht;exports.removeSymbol=Qt;exports.sortedContributions=Lt;
|