@heartlandone/vega 2.84.0 → 2.85.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/dist/cjs/{app-globals-ea063074.js → app-globals-54327b0a.js} +1 -1
- package/dist/cjs/{child-nodes-event-prevent-slimmer-58bbc5fc.js → child-nodes-event-prevent-slimmer-f3979a03.js} +1 -1
- package/dist/cjs/{event-emit-slimmer-ecca412d.js → event-emit-slimmer-80e1c8ca.js} +1 -1
- package/dist/cjs/{image-annotation-action-a6e1e9ed.js → image-annotation-action-025389a7.js} +1 -1
- package/dist/cjs/{immutable-map-edf24b54.js → immutable-map-d711339d.js} +16 -4
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{internal-vega-event-manager-6b74b3af.js → internal-vega-event-manager-7e0d966d.js} +2 -1
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/{token-extension-39f2b886.js → token-extension-4f6ed976.js} +263 -218
- package/dist/cjs/vega-accordion.cjs.entry.js +3 -3
- package/dist/cjs/vega-app-header-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
- package/dist/cjs/vega-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-calendar_4.cjs.entry.js +4 -4
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-chip.cjs.entry.js +4 -4
- package/dist/cjs/vega-code-block.cjs.entry.js +4 -4
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +188 -46
- package/dist/cjs/vega-color-swatch.cjs.entry.js +7 -7
- package/dist/cjs/vega-combo-box.cjs.entry.js +4 -4
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-dialog_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +4 -4
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{vega-event-id-c08ce3d3.js → vega-event-id-d9994eb3.js} +2 -0
- package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-form.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-numeric.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-passcode.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-range.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-select.cjs.entry.js +4 -4
- package/dist/cjs/vega-input.cjs.entry.js +3 -3
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +3 -3
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- package/dist/cjs/vega-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +3 -3
- package/dist/cjs/vega-stepper.cjs.entry.js +4 -4
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +1172 -282
- package/dist/cjs/vega-textarea.cjs.entry.js +4 -4
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/vega.cjs.js +5 -5
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-picker-renderer.js +24 -5
- package/dist/collection/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.js +15 -0
- package/dist/collection/components/vega-color-swatch/vega-color-swatch.js +6 -6
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.js +53 -51
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.js +40 -10
- package/dist/collection/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.js +75 -62
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +1 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-expand-row-controller.js +88 -4
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-row-draggable-controller.js +132 -0
- package/dist/collection/components/vega-table/slimmers/controllers/vega-table-sort-controller.js +14 -0
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-body-renderer.js +8 -5
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-col-group-renderer.js +6 -2
- package/dist/collection/components/vega-table/slimmers/renderers/vega-table-pinned-renderer.js +8 -2
- package/dist/collection/components/vega-table/utils.js +4 -3
- package/dist/collection/components/vega-table/vega-table-expand-row/slimmers/controllers/vega-table-expand-row-col-span-controller.js +13 -1
- package/dist/collection/components/vega-table/vega-table-expand-row/slimmers/controllers/vega-table-expand-row-state-controller.js +7 -0
- package/dist/collection/components/vega-table/vega-table-expand-row/vega-table-expand-row.js +7 -0
- package/dist/collection/components/vega-table/vega-table-foot-row/slimmers/controllers/vega-table-foot-row-state-controller.js +10 -3
- package/dist/collection/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.js +9 -2
- package/dist/collection/components/vega-table/vega-table-foot-row/vega-table-foot-row.js +4 -3
- package/dist/collection/components/vega-table/vega-table-head/vega-table-head.js +5 -0
- package/dist/collection/components/vega-table/vega-table-head-row/slimmers/controllers/vega-table-head-row-state-controller.js +10 -3
- package/dist/collection/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.js +12 -2
- package/dist/collection/components/vega-table/vega-table-head-row/vega-table-head-row.js +5 -4
- package/dist/collection/components/vega-table/vega-table-row/slimmers/controllers/vega-table-row-state-controller.js +22 -1
- package/dist/collection/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.js +19 -4
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.css +6 -0
- package/dist/collection/components/vega-table/vega-table-row/vega-table-row.js +11 -1
- package/dist/collection/components/vega-table/vega-table.css +5 -0
- package/dist/collection/components/vega-table/vega-table.js +135 -11
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/icons/grip-dots-vertical.js +3 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -1
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
- package/dist/collection/helpers/immutable/immutable-map.js +16 -4
- package/dist/collection/helpers/slimmers/draggable-element-slimmer.js +508 -0
- package/dist/collection/helpers/slimmers/popover-nested-slot-projection-slimmer.js +118 -0
- package/dist/esm/{app-globals-d06de2a5.js → app-globals-b1999c09.js} +5 -5
- package/dist/esm/{aria-dialog-focusable-trap-slimmer-853a91de.js → aria-dialog-focusable-trap-slimmer-6eb79723.js} +1 -1
- package/dist/esm/{child-nodes-event-prevent-slimmer-f65e2452.js → child-nodes-event-prevent-slimmer-75f93d85.js} +1 -1
- package/dist/esm/{code-block-65c8804b.js → code-block-e43c8120.js} +1 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-26c154f6.js → component-value-history-controller-slimmer.abstract-60c1910e.js} +3 -3
- package/dist/esm/{content-state-e676bdf0.js → content-state-d363f2ca.js} +2 -2
- package/dist/esm/{element-appender-slimmer-d4a82dc3.js → element-appender-slimmer-05f487d7.js} +1 -1
- package/dist/esm/{event-emit-slimmer-18711776.js → event-emit-slimmer-1c57093d.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-9a0f8c54.js → form-field-controller-slimmer-ae8478b5.js} +2 -2
- package/dist/esm/{image-annotation-action-2d87b66a.js → image-annotation-action-008ca25b.js} +3 -3
- package/dist/esm/{immutable-map-612922a2.js → immutable-map-4fe22b11.js} +16 -4
- package/dist/esm/index.js +9 -9
- package/dist/esm/{internal-vega-event-manager-bed71930.js → internal-vega-event-manager-7cdf3c28.js} +2 -1
- package/dist/esm/loader.js +9 -9
- package/dist/esm/{public-rules-a61ff09f.js → public-rules-1561e357.js} +4 -4
- package/dist/esm/{range-d9e55d00.js → range-784d5ec8.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-6a4c853a.js → rich-text-editor-required-rule-8768bc8d.js} +1 -1
- package/dist/esm/{split-cell-operation-2e700c5c.js → split-cell-operation-35ce149b.js} +3 -3
- package/dist/esm/{string-input-formatter-slimmer-ad234bec.js → string-input-formatter-slimmer-4059080b.js} +2 -2
- package/dist/esm/{sub-state-notify-slimmer-1f907173.js → sub-state-notify-slimmer-63ecb465.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-090c500a.js → sub-state-observer-slimmer-2adbbe00.js} +1 -1
- package/dist/esm/{token-extension-d3a46c04.js → token-extension-23b5ab65.js} +266 -221
- package/dist/esm/vega-accordion.entry.js +3 -3
- package/dist/esm/vega-app-header-button.entry.js +4 -4
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button-group_2.entry.js +7 -7
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +5 -5
- package/dist/esm/vega-calendar_4.entry.js +7 -7
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +7 -7
- package/dist/esm/vega-chip.entry.js +4 -4
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +6 -6
- package/dist/esm/vega-color-swatch-picker.entry.js +192 -50
- package/dist/esm/vega-color-swatch.entry.js +7 -7
- package/dist/esm/vega-combo-box.entry.js +7 -7
- package/dist/esm/vega-date-picker_2.entry.js +11 -11
- package/dist/esm/vega-dialog_2.entry.js +6 -6
- package/dist/esm/vega-dropdown_5.entry.js +9 -9
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-5841d1d3.js → vega-event-id-a6ccca66.js} +2 -1
- package/dist/esm/vega-field-label.entry.js +3 -3
- package/dist/esm/vega-file-uploader.entry.js +6 -6
- package/dist/esm/vega-form.entry.js +9 -9
- package/dist/esm/vega-image-uploader.entry.js +7 -7
- package/dist/esm/vega-input-credit-card.entry.js +7 -7
- package/dist/esm/vega-input-numeric.entry.js +8 -8
- package/dist/esm/vega-input-passcode.entry.js +7 -7
- package/dist/esm/vega-input-phone-number.entry.js +7 -7
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +7 -7
- package/dist/esm/vega-input.entry.js +8 -8
- package/dist/esm/{vega-internal-event-id-194bac82.js → vega-internal-event-id-db974a0d.js} +1 -1
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +6 -6
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +4 -4
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +5 -5
- package/dist/esm/vega-popover_2.entry.js +6 -6
- package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
- package/dist/esm/vega-radio_2.entry.js +7 -7
- package/dist/esm/vega-rich-text-content.entry.js +7 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +15 -15
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +7 -7
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +8 -8
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +6 -6
- package/dist/esm/vega-stepper.entry.js +7 -7
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +1175 -285
- package/dist/esm/vega-textarea.entry.js +7 -7
- package/dist/esm/vega-time-picker_2.entry.js +8 -8
- package/dist/esm/vega-toggle-switch.entry.js +6 -6
- package/dist/esm/vega-tooltip_2.entry.js +2 -2
- package/dist/esm/vega.js +9 -9
- package/dist/esm/{wait-for-component-did-render-30cde59c.js → wait-for-component-did-render-9a83d343.js} +1 -1
- package/dist/sri/vega-sri-manifest.json +275 -275
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/slimmers/renderers/color-swatch-picker-renderer.d.ts +9 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch-picker/vega-color-swatch-picker.d.ts +6 -0
- package/dist/types/components/vega-color-swatch/vega-color-swatch.d.ts +4 -4
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-dynamic-popover-renderer.d.ts +15 -11
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-renderer.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/renderers/table-setting-popover-renderer.d.ts +25 -22
- package/dist/types/components/vega-table/interface.d.ts +2 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-expand-row-controller.d.ts +35 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-row-draggable-controller.d.ts +52 -0
- package/dist/types/components/vega-table/slimmers/controllers/vega-table-sort-controller.d.ts +4 -0
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-body-renderer.d.ts +3 -1
- package/dist/types/components/vega-table/slimmers/renderers/vega-table-col-group-renderer.d.ts +2 -1
- package/dist/types/components/vega-table/utils.d.ts +3 -2
- package/dist/types/components/vega-table/vega-table-expand-row/slimmers/controllers/vega-table-expand-row-col-span-controller.d.ts +5 -0
- package/dist/types/components/vega-table/vega-table-expand-row/slimmers/controllers/vega-table-expand-row-state-controller.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-expand-row/vega-table-expand-row.d.ts +2 -0
- package/dist/types/components/vega-table/vega-table-foot-row/slimmers/controllers/vega-table-foot-row-state-controller.d.ts +2 -1
- package/dist/types/components/vega-table/vega-table-foot-row/slimmers/renderers/vega-table-foot-row-renderer.d.ts +3 -1
- package/dist/types/components/vega-table/vega-table-foot-row/vega-table-foot-row.d.ts +6 -2
- package/dist/types/components/vega-table/vega-table-head/vega-table-head.d.ts +1 -0
- package/dist/types/components/vega-table/vega-table-head-row/slimmers/controllers/vega-table-head-row-state-controller.d.ts +2 -1
- package/dist/types/components/vega-table/vega-table-head-row/slimmers/renderers/vega-table-head-row-renderer.d.ts +3 -1
- package/dist/types/components/vega-table/vega-table-head-row/vega-table-head-row.d.ts +6 -2
- package/dist/types/components/vega-table/vega-table-row/slimmers/controllers/vega-table-row-state-controller.d.ts +3 -0
- package/dist/types/components/vega-table/vega-table-row/slimmers/renderers/vega-table-row-renderer.d.ts +3 -0
- package/dist/types/components/vega-table/vega-table-row/vega-table-row.d.ts +8 -0
- package/dist/types/components/vega-table/vega-table.d.ts +40 -5
- package/dist/types/components.d.ts +33 -8
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/global/icons/grip-dots-vertical.d.ts +3 -0
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
- package/dist/types/helpers/immutable/immutable-map.d.ts +4 -1
- package/dist/types/helpers/slimmers/draggable-element-slimmer.d.ts +260 -0
- package/dist/types/helpers/slimmers/popover-nested-slot-projection-slimmer.d.ts +65 -0
- package/dist/types/types/components.type.d.ts +2 -0
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/types/types/ui.type.d.ts +40 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-d3ed7c27.entry.js → p-0b5b0fd2.entry.js} +1 -1
- package/dist/vega/p-13e7f906.entry.js +1 -0
- package/dist/vega/{p-7595ad55.js → p-1d30cab2.js} +1 -1
- package/dist/vega/{p-39b71df9.entry.js → p-23b38467.entry.js} +1 -1
- package/dist/vega/{p-8d833b44.entry.js → p-25572ea7.entry.js} +1 -1
- package/dist/vega/{p-03cf2df1.entry.js → p-2ae5acfc.entry.js} +1 -1
- package/dist/vega/{p-5bbb3e68.entry.js → p-2fb26f4f.entry.js} +1 -1
- package/dist/vega/{p-c0323a55.entry.js → p-35d77c9c.entry.js} +1 -1
- package/dist/vega/{p-032183c1.js → p-386895e9.js} +1 -1
- package/dist/vega/{p-5ac4649a.entry.js → p-3c456e91.entry.js} +1 -1
- package/dist/vega/{p-20f0060f.entry.js → p-3d92d2af.entry.js} +1 -1
- package/dist/vega/{p-4123559f.entry.js → p-3e64fa38.entry.js} +1 -1
- package/dist/vega/{p-f986f875.entry.js → p-411ea209.entry.js} +1 -1
- package/dist/vega/{p-7cf1e1f7.entry.js → p-423762ae.entry.js} +1 -1
- package/dist/vega/{p-0f31b00b.entry.js → p-4530f0e1.entry.js} +1 -1
- package/dist/vega/{p-27b1dc0f.entry.js → p-487ecdb0.entry.js} +1 -1
- package/dist/vega/{p-b28d4f7d.js → p-48e3be6a.js} +1 -1
- package/dist/vega/{p-753a7832.entry.js → p-4afafeb3.entry.js} +1 -1
- package/dist/vega/{p-5409275a.entry.js → p-56c1a8ac.entry.js} +1 -1
- package/dist/vega/{p-56c28943.js → p-5904616e.js} +1 -1
- package/dist/vega/{p-bc2786f9.entry.js → p-59c6dcf7.entry.js} +1 -1
- package/dist/vega/p-5e50dbb9.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-e5546af5.entry.js → p-606d7113.entry.js} +1 -1
- package/dist/vega/{p-5215e1d8.entry.js → p-64b566be.entry.js} +1 -1
- package/dist/vega/{p-84030271.entry.js → p-69c11b7b.entry.js} +1 -1
- package/dist/vega/{p-effa6495.js → p-6b5cb920.js} +1 -1
- package/dist/vega/{p-aa985d73.js → p-6c43d54a.js} +1 -1
- package/dist/vega/{p-0e15fa94.entry.js → p-6fadee27.entry.js} +1 -1
- package/dist/vega/{p-549bea2c.entry.js → p-73c6669e.entry.js} +1 -1
- package/dist/vega/{p-a5e6a3be.js → p-77300901.js} +1 -1
- package/dist/vega/{p-7dca19d3.entry.js → p-77754d62.entry.js} +1 -1
- package/dist/vega/{p-88f57353.entry.js → p-79c12a64.entry.js} +1 -1
- package/dist/vega/{p-f8c700dd.entry.js → p-7f74cd41.entry.js} +1 -1
- package/dist/vega/{p-80cb302f.entry.js → p-887b3e2d.entry.js} +1 -1
- package/dist/vega/{p-b48b3264.js → p-8d48940d.js} +1 -1
- package/dist/vega/{p-5f23c52d.entry.js → p-9763fbbe.entry.js} +1 -1
- package/dist/vega/{p-865fc90b.entry.js → p-98a6cd8e.entry.js} +1 -1
- package/dist/vega/p-9af0e2e7.js +1 -0
- package/dist/vega/{p-f6414a24.entry.js → p-9e2b7718.entry.js} +1 -1
- package/dist/vega/{p-e1b1f5f9.entry.js → p-9eb00537.entry.js} +1 -1
- package/dist/vega/{p-f0e855b2.entry.js → p-9f36abf9.entry.js} +1 -1
- package/dist/vega/{p-b88eab9a.entry.js → p-9fc8bd1f.entry.js} +1 -1
- package/dist/vega/{p-9308f874.entry.js → p-a050c24d.entry.js} +1 -1
- package/dist/vega/{p-6f790577.js → p-a07c5dae.js} +1 -1
- package/dist/vega/{p-aa4d419c.entry.js → p-a49c25c2.entry.js} +1 -1
- package/dist/vega/{p-1df2c29b.entry.js → p-a9528dbd.entry.js} +1 -1
- package/dist/vega/{p-0caf52e0.js → p-a9e10a64.js} +1 -1
- package/dist/vega/{p-6cada843.js → p-ae1aa4df.js} +1 -1
- package/dist/vega/{p-a0c3968b.js → p-af5cb9bc.js} +1 -1
- package/dist/vega/{p-d6c9ef6c.entry.js → p-afd1b519.entry.js} +1 -1
- package/dist/vega/{p-5490d499.entry.js → p-bc74d7e7.entry.js} +1 -1
- package/dist/vega/{p-a2d6d695.entry.js → p-bceee942.entry.js} +1 -1
- package/dist/vega/{p-c6837173.entry.js → p-c15a58b5.entry.js} +1 -1
- package/dist/vega/{p-6ba71ec4.entry.js → p-c2388937.entry.js} +1 -1
- package/dist/vega/{p-3ae5f50e.entry.js → p-c2e1f33d.entry.js} +1 -1
- package/dist/vega/p-c31a32f4.js +1 -0
- package/dist/vega/{p-11a2f834.js → p-c347e08a.js} +1 -1
- package/dist/vega/{p-91739ed3.entry.js → p-c51ebb14.entry.js} +1 -1
- package/dist/vega/{p-b80217fa.entry.js → p-c601b331.entry.js} +1 -1
- package/dist/vega/p-c74060a7.js +1 -0
- package/dist/vega/{p-d3864b94.entry.js → p-c8fe46fd.entry.js} +1 -1
- package/dist/vega/{p-d76e3b3c.entry.js → p-cf2838c7.entry.js} +1 -1
- package/dist/vega/{p-e4c5b8d1.entry.js → p-d37636a5.entry.js} +1 -1
- package/dist/vega/{p-19e10a87.entry.js → p-d402eb7b.entry.js} +1 -1
- package/dist/vega/{p-ce975c69.entry.js → p-da8bb883.entry.js} +1 -1
- package/dist/vega/{p-68a96fbb.entry.js → p-dffbbc3d.entry.js} +1 -1
- package/dist/vega/{p-c47c37f2.js → p-e27626f6.js} +1 -1
- package/dist/vega/{p-6236f592.entry.js → p-e47b2c4c.entry.js} +1 -1
- package/dist/vega/{p-74136508.entry.js → p-ecbb63a5.entry.js} +1 -1
- package/dist/vega/p-ed26f4c8.entry.js +1 -0
- package/dist/vega/{p-43aaeb30.entry.js → p-effb285f.entry.js} +1 -1
- package/dist/vega/p-f1c672e4.js +1 -0
- package/dist/vega/p-f54fb4e5.js +1 -0
- package/dist/vega/{p-748268e6.entry.js → p-f604f2c9.entry.js} +1 -1
- package/dist/vega/{p-e5cc839a.entry.js → p-fa91805b.entry.js} +1 -1
- package/dist/vega/{p-aa040383.js → p-fb05335d.js} +1 -1
- package/dist/vega/{p-9375fbce.js → p-fcb0d4d8.js} +1 -1
- package/dist/vega/{p-bdddddb7.js → p-fcce494e.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-220f8ee7.js +0 -1
- package/dist/vega/p-38af89b9.js +0 -1
- package/dist/vega/p-7dbaed6c.entry.js +0 -1
- package/dist/vega/p-874bf8b2.js +0 -1
- package/dist/vega/p-99670c56.entry.js +0 -1
- package/dist/vega/p-9de25451.js +0 -1
- package/dist/vega/p-b78eaec4.js +0 -1
- package/dist/vega/p-dec5b448.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as t,I as e,c as s,M as i}from"./p-6e1ab235.js";import{c as r}from"./p-02841589.js";import{C as o}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{U as a,a as l,b as h,F as c,c as d,d as u,e as f}from"./p-a528714c.js";import{f as m,d as p}from"./p-6e70d3cc.js";import{a as v,g as b}from"./p-8b5d3a52.js";import{c as R}from"./p-6a334573.js";import{d as g,D as j}from"./p-f28a6074.js";import{h as y,f as w,i as O}from"./p-aa985d73.js";import{V as E}from"./p-3b791b5d.js";import{h as V,l as F}from"./p-f0e828d8.js";import{P as I}from"./p-81dd00d0.js";import{I as C}from"./p-abd7aeaa.js";import{M as S}from"./p-78a57a17.js";import{A}from"./p-52b8f2d2.js";import{i as k}from"./p-d27ae9ff.js";import{S as T}from"./p-a0c3968b.js";class L{constructor(t){this.rule=t}getStatus(t,e,s){return{canEvaluate:this.rule.canEvaluate(t,e,s),isAsync:v(this.rule.evaluate)}}shouldShowError(t,e){try{return this.rule.shouldShowError?this.rule.shouldShowError(t,e):this.defaultShouldShowError(t)}catch(t){return!1}}handle(t){try{return this.rule.evaluate(t)}catch(t){return{isValid:!0,message:""}}}defaultShouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}}class M{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(t,e,s){return!!this.handlers.find((i=>{const r=i.getStatus(t,e,s);return r.canEvaluate&&r.isAsync}))}setHandlersByRules(t){this.handlers=t&&t.length?t.map((t=>new L(t))):[]}async process(t,e,s,i,r){const o=this.preProcess();let n;for(const i of this.handlers){if(o!==this.processId)break;const r=i.getStatus(t,e,s);if(!r.canEvaluate)continue;let a;if(r.isAsync)try{a=await i.handle(t)}catch(t){}else a=i.handle(t);if(a&&!a.isValid){const t=i.shouldShowError(e,s);n=Object.assign(Object.assign({},a),{shouldShowError:t});break}}return this.postProcess(o,i,n,r),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const t=b();return this.processId=t,t}postProcess(t,e,s,i){this.processId===t&&i(e,s)}}class D{run(t){const e=t.nextElementSibling;return e&&e.querySelector(".vega-error")?e.querySelector(".vega-error"):null}}class B{run(t){let e=t.nextElementSibling;return e&&!e.classList.contains("vega-error")&&(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class H{run(t){let e=t.nextElementSibling;return e||(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class U extends t{getTranslatedMessage(t){return"string"==typeof t?E.t(t):E.t(t.key,...t.args||[])}}var x=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class G extends t{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUiControllerStrategies=[new D,new B,new H],this.initTranslationObserver()}applyInputInvalidUI(t){const e=this.getInputElementContainer();if(o.notify(g.getSubject(this.host,y),{host:this.host,showError:!0}),e&&(e.classList.add("error"),t)){this.errorMessage=t;const s=this.getErrorContainer(e);s.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(t),F),s.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const t=this.getInputElementContainer();t&&(this.getErrorContainer(t).classList.add("vega-hidden"),t.classList.remove("error"),o.notify(g.getSubject(this.host,y),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(t){for(const e of this.fieldErrorUiControllerStrategies){const s=e.run(t);if(s)return s}}initTranslationObserver(){const t=new n(this.isAcceptableTranslationObserver.bind(this),(()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const e=this.getErrorContainer(t);e&&(e.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage),F))}}));o.register(a,t)}isAcceptableTranslationObserver(){return!0}}x([e()],G.prototype,"formFieldMessageTranslatorSlimmer",void 0),x([s()],G.prototype,"host",void 0),x([s()],G.prototype,"options",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class W{constructor(t,e,s,i){var r,n;this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUIController=new G,this.resizeObserverSlimmer=R(W,I,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{const e=this.isVisible,s=t[0].contentRect.height>0;this.isVisible=s,this.isAutoValidationEnabled()&&m(this.host,"vega-form")&&e!==s&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new M,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(t,e)=>{let s=!0;return e?("rule"===t?e.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI():t?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI(),s=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(s),o.notify(l,{host:this.host,detail:s}),s},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter((t=>t&&!0!==this.hostChildAddedBlurEventMap.get(t))).forEach((t=>{t.addEventListener("blur",(()=>{this.updateIsTouched(!0)})),this.hostChildAddedBlurEventMap.set(t,!0)}))},this.defaultRules=t||[],this.host=e,this.defaultValue=s,this.options=i,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),null===(n=(r=this.host).componentOnReady)||void 0===n||n.call(r).then((()=>{this.didRender()})),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(t){return await this.valid([],t)}addListener(t){this.listeners.push(t)}getRules(){const t=[...this.additionalRules];return[...this.defaultRules.map((e=>this.overrideDefaultRuleByAdditionalRule(e,t))),...t]}setDefaultRules(t){this.defaultRules=t,this.updateValidationHandlers()}setAdditionalRules(t){this.additionalRules=t,this.updateValidationHandlers()}destroy(){o.notify(h,{host:this.host}),this.unregisterFormResetObserver(),o.unregister(c,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(t){this.disableBlurValidation=t}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(t,e="rule"){const s=this.getStatus(),i=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(i,s,t)&&o.notify(l,{host:this.host,detail:null});const{isValid:r,message:n}=await this.formFieldValidationRuleHandlerChain.process(i,s,t,e,this.handleValidationResult);return{isValid:r,message:this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n)}}invokeListeners(t){this.listeners.forEach((e=>e.callback(t)))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(t){const e=this.isTouched;this.isTouched=t,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(e===t?[]:["touched"])}updateIsModified(t){const e=this.isModified;this.isModified=t,this.isAutoValidationEnabled()&&this.valid(e===t?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver((()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])})),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(t){return m(this.host,"vega-form")===t.host}unregisterFormResetObserver(){o.unregister(d,this.formResetTriggeredObserver)}monitorTouchedListener(){const t=this.getInputContainerElements();t&&(this.hostChildrenObserver=new MutationObserver((()=>{this.setupTouchedListener()})),this.hostChildrenObserver.observe(t,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new n(this.isCurrentTarget.bind(this),(()=>this.updateIsModified(!0))),o.register(c,this.hostValueChangeObserver)}isCurrentTarget(t){return this.host===t.host}async reset(t){var e,s;if(this.shouldVisitElement(this.host,null===(e=t.option)||void 0===e?void 0:e.skipDisabled,null===(s=t.option)||void 0===s?void 0:s.skipInvisible)){const e=t.defaultValueMap,s=this.host.dataset.vegaForm,i=null==e[s]?this.getDefaultValue():e[s];"function"==typeof this.host.setValue?await this.host.setValue(i):this.host.value=i,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new n(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),o.register(d,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return!1!==this.host.autoValidation}shouldVisitElement(t,e,s){return!(!t.dataset.vegaForm||e&&t.disabled||s&&!p(t))}listenHostElementKeydown(){this.host.addEventListener("keydown",(t=>{if(this.canSubmitFormByEvent(t)){const t=m(this.host,"vega-form",{outerMost:!0});t&&o.notify(g.getSubject(t,w),{host:this.host})}}))}canSubmitFormByEvent(t){const e="Enter"===t.key||13===t.keyCode,s=e&&t.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return s&&t.preventDefault(),s;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return e}}overrideDefaultRuleByAdditionalRule(t,e){if(t&&e){const s=e.findIndex((e=>e instanceof C&&e instanceof t.constructor&&e.overrideDefault));if(s>-1)return e.splice(s,1)[0]}return t}}P([e()],W.prototype,"formFieldMessageTranslatorSlimmer",void 0),P([e()],W.prototype,"fieldErrorUIController",void 0),P([e()],W.prototype,"resizeObserverSlimmer",void 0);var z=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class K extends t{constructor(){super(...arguments),this.fieldErrorUIController=new G,this.handleFieldErrorMessageUpdate=t=>{const{message:e,isValid:s}=t;s?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(e)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new n(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),o.register(u,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){o.unregister(u,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(t){const{host:e}=t,s=this.host.parentElement;return s&&s===e&&"VEGA-FIELD-ERROR"===s.tagName||this.host===e}}z([s()],K.prototype,"host",void 0),z([s()],K.prototype,"options",void 0),z([e()],K.prototype,"fieldErrorUIController",void 0),z([i("setInjectFormFieldHelper")],K.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null),z([i("disconnectedCallback")],K.prototype,"handleUnregisterObserver",null);var N=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class X extends t{constructor(){super(...arguments),this.handleValidInvocation=async t=>{if(this.validator){void 0!==t.timerId&&clearTimeout(t.timerId);const e=await this.validator.validate(t.message);if(e){const{isValid:s,message:i}=e;"function"==typeof t.promiseResolve&&t.promiseResolve({isValid:s,message:i})}}}}registerValidInvocationObserver(){j.addUniqueObserverToNode(this.host,O,this.handleValidInvocation)}handleUnregisterObserver(){j.removeUniqueObserverFromNode(this.host,O)}}N([s()],X.prototype,"host",void 0),N([s()],X.prototype,"validator",void 0),N([i("setInjectFormFieldHelper")],X.prototype,"registerValidInvocationObserver",null),N([i("disconnectedCallback")],X.prototype,"handleUnregisterObserver",null);var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class J extends T{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:t=>{var e;null===(e=this.validator)||void 0===e||e.updateDisableBlurValidation(t)}}]})}componentWillLoad(){super.componentWillLoad()}}q([s()],J.prototype,"host",void 0),q([s()],J.prototype,"validator",void 0),q([i("setInjectFormFieldHelper")],J.prototype,"componentWillLoad",null);var Q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class Y extends t{constructor(t){super(),this.fieldErrorSlimmer=new K,this.formFieldValidInvokeSlimmer=new X,this.formFormStateController=new J,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=t,this.setMutationObserverSlimmer()}connectedCallback(){null===this.validator&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(t){return t&&Boolean(t.getAttribute("data-vega-form"))}watchValidationRulesByFormControllerSlimmer(t,e){k(t,e,!1,((t,e)=>t===e?0:-1))||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(Y.isValidFormField(this.host)){const{defaultValue:t}=this.options,e=new W(this.getPropertyRules(),this.host,t,this.options);e.addListener({callback:t=>{this.isValid!=t&&(this.isValid=t,o.notify(f,{host:this.host,detail:t}))}}),this.validator=e,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&"validationRules"===this.options.validationRulesName&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:t,attributeGetter:e}=this.options;return t.map((t=>{const s=t.dependence&&"string"==typeof t.dependence?[e(t.dependence)]:Array.isArray(t.dependence)?t.dependence.map((t=>e(t))):[null];return t.ruleFactory(e(t.propertyName),...s)})).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new S({options:{attributeFilter:this.options.propertyRules.map((t=>r(t.propertyName))),attributeOldValue:!0},mutationFilter:A(),callback:this.mutationObserverCallBack})}}Q([s()],Y.prototype,"host",void 0),Q([s({writable:!0})],Y.prototype,"validationRules",void 0),Q([s()],Y.prototype,"disabled",void 0),Q([s()],Y.prototype,"autoValidation",void 0),Q([s({writable:!0})],Y.prototype,"isValid",void 0),Q([e()],Y.prototype,"fieldErrorSlimmer",void 0),Q([e()],Y.prototype,"formFieldValidInvokeSlimmer",void 0),Q([e()],Y.prototype,"mutationObserverSlimmer",void 0),Q([e()],Y.prototype,"formFormStateController",void 0),Q([i("connectedCallback")],Y.prototype,"connectedCallback",null),Q([i("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),Q([i("componentDidLoad")],Y.prototype,"componentDidLoad",null),Q([i("watchValidationRules")],Y.prototype,"watchValidationRulesByFormControllerSlimmer",null),Q([i("componentWillLoad")],Y.prototype,"setInjectFormFieldHelper",null);export{Y as F}
|
|
1
|
+
import{V as t,I as e,c as s,M as i}from"./p-6e1ab235.js";import{c as r}from"./p-02841589.js";import{C as o}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{U as a,a as l,b as h,F as c,c as d,d as u,e as f}from"./p-a528714c.js";import{f as m,d as p}from"./p-6e70d3cc.js";import{a as v,g as b}from"./p-8b5d3a52.js";import{c as R}from"./p-6a334573.js";import{d as g,D as j}from"./p-f28a6074.js";import{h as y,f as w,i as O}from"./p-6c43d54a.js";import{V as E}from"./p-3b791b5d.js";import{h as V,l as F}from"./p-f0e828d8.js";import{P as I}from"./p-81dd00d0.js";import{I as C}from"./p-abd7aeaa.js";import{M as S}from"./p-78a57a17.js";import{A}from"./p-52b8f2d2.js";import{i as k}from"./p-d27ae9ff.js";import{S as T}from"./p-af5cb9bc.js";class L{constructor(t){this.rule=t}getStatus(t,e,s){return{canEvaluate:this.rule.canEvaluate(t,e,s),isAsync:v(this.rule.evaluate)}}shouldShowError(t,e){try{return this.rule.shouldShowError?this.rule.shouldShowError(t,e):this.defaultShouldShowError(t)}catch(t){return!1}}handle(t){try{return this.rule.evaluate(t)}catch(t){return{isValid:!0,message:""}}}defaultShouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}}class M{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(t,e,s){return!!this.handlers.find((i=>{const r=i.getStatus(t,e,s);return r.canEvaluate&&r.isAsync}))}setHandlersByRules(t){this.handlers=t&&t.length?t.map((t=>new L(t))):[]}async process(t,e,s,i,r){const o=this.preProcess();let n;for(const i of this.handlers){if(o!==this.processId)break;const r=i.getStatus(t,e,s);if(!r.canEvaluate)continue;let a;if(r.isAsync)try{a=await i.handle(t)}catch(t){}else a=i.handle(t);if(a&&!a.isValid){const t=i.shouldShowError(e,s);n=Object.assign(Object.assign({},a),{shouldShowError:t});break}}return this.postProcess(o,i,n,r),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const t=b();return this.processId=t,t}postProcess(t,e,s,i){this.processId===t&&i(e,s)}}class D{run(t){const e=t.nextElementSibling;return e&&e.querySelector(".vega-error")?e.querySelector(".vega-error"):null}}class B{run(t){let e=t.nextElementSibling;return e&&!e.classList.contains("vega-error")&&(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class H{run(t){let e=t.nextElementSibling;return e||(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class U extends t{getTranslatedMessage(t){return"string"==typeof t?E.t(t):E.t(t.key,...t.args||[])}}var x=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class G extends t{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUiControllerStrategies=[new D,new B,new H],this.initTranslationObserver()}applyInputInvalidUI(t){const e=this.getInputElementContainer();if(o.notify(g.getSubject(this.host,y),{host:this.host,showError:!0}),e&&(e.classList.add("error"),t)){this.errorMessage=t;const s=this.getErrorContainer(e);s.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(t),F),s.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const t=this.getInputElementContainer();t&&(this.getErrorContainer(t).classList.add("vega-hidden"),t.classList.remove("error"),o.notify(g.getSubject(this.host,y),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(t){for(const e of this.fieldErrorUiControllerStrategies){const s=e.run(t);if(s)return s}}initTranslationObserver(){const t=new n(this.isAcceptableTranslationObserver.bind(this),(()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const e=this.getErrorContainer(t);e&&(e.innerHTML=V.sanitize(this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage),F))}}));o.register(a,t)}isAcceptableTranslationObserver(){return!0}}x([e()],G.prototype,"formFieldMessageTranslatorSlimmer",void 0),x([s()],G.prototype,"host",void 0),x([s()],G.prototype,"options",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class W{constructor(t,e,s,i){var r,n;this.formFieldMessageTranslatorSlimmer=new U,this.fieldErrorUIController=new G,this.resizeObserverSlimmer=R(W,I,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{const e=this.isVisible,s=t[0].contentRect.height>0;this.isVisible=s,this.isAutoValidationEnabled()&&m(this.host,"vega-form")&&e!==s&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new M,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(t,e)=>{let s=!0;return e?("rule"===t?e.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI():t?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI(),s=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(s),o.notify(l,{host:this.host,detail:s}),s},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter((t=>t&&!0!==this.hostChildAddedBlurEventMap.get(t))).forEach((t=>{t.addEventListener("blur",(()=>{this.updateIsTouched(!0)})),this.hostChildAddedBlurEventMap.set(t,!0)}))},this.defaultRules=t||[],this.host=e,this.defaultValue=s,this.options=i,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),null===(n=(r=this.host).componentOnReady)||void 0===n||n.call(r).then((()=>{this.didRender()})),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(t){return await this.valid([],t)}addListener(t){this.listeners.push(t)}getRules(){const t=[...this.additionalRules];return[...this.defaultRules.map((e=>this.overrideDefaultRuleByAdditionalRule(e,t))),...t]}setDefaultRules(t){this.defaultRules=t,this.updateValidationHandlers()}setAdditionalRules(t){this.additionalRules=t,this.updateValidationHandlers()}destroy(){o.notify(h,{host:this.host}),this.unregisterFormResetObserver(),o.unregister(c,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(t){this.disableBlurValidation=t}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(t,e="rule"){const s=this.getStatus(),i=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(i,s,t)&&o.notify(l,{host:this.host,detail:null});const{isValid:r,message:n}=await this.formFieldValidationRuleHandlerChain.process(i,s,t,e,this.handleValidationResult);return{isValid:r,message:this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n)}}invokeListeners(t){this.listeners.forEach((e=>e.callback(t)))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(t){const e=this.isTouched;this.isTouched=t,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(e===t?[]:["touched"])}updateIsModified(t){const e=this.isModified;this.isModified=t,this.isAutoValidationEnabled()&&this.valid(e===t?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver((()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])})),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(t){return m(this.host,"vega-form")===t.host}unregisterFormResetObserver(){o.unregister(d,this.formResetTriggeredObserver)}monitorTouchedListener(){const t=this.getInputContainerElements();t&&(this.hostChildrenObserver=new MutationObserver((()=>{this.setupTouchedListener()})),this.hostChildrenObserver.observe(t,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new n(this.isCurrentTarget.bind(this),(()=>this.updateIsModified(!0))),o.register(c,this.hostValueChangeObserver)}isCurrentTarget(t){return this.host===t.host}async reset(t){var e,s;if(this.shouldVisitElement(this.host,null===(e=t.option)||void 0===e?void 0:e.skipDisabled,null===(s=t.option)||void 0===s?void 0:s.skipInvisible)){const e=t.defaultValueMap,s=this.host.dataset.vegaForm,i=null==e[s]?this.getDefaultValue():e[s];"function"==typeof this.host.setValue?await this.host.setValue(i):this.host.value=i,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new n(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),o.register(d,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return!1!==this.host.autoValidation}shouldVisitElement(t,e,s){return!(!t.dataset.vegaForm||e&&t.disabled||s&&!p(t))}listenHostElementKeydown(){this.host.addEventListener("keydown",(t=>{if(this.canSubmitFormByEvent(t)){const t=m(this.host,"vega-form",{outerMost:!0});t&&o.notify(g.getSubject(t,w),{host:this.host})}}))}canSubmitFormByEvent(t){const e="Enter"===t.key||13===t.keyCode,s=e&&t.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return s&&t.preventDefault(),s;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return e}}overrideDefaultRuleByAdditionalRule(t,e){if(t&&e){const s=e.findIndex((e=>e instanceof C&&e instanceof t.constructor&&e.overrideDefault));if(s>-1)return e.splice(s,1)[0]}return t}}P([e()],W.prototype,"formFieldMessageTranslatorSlimmer",void 0),P([e()],W.prototype,"fieldErrorUIController",void 0),P([e()],W.prototype,"resizeObserverSlimmer",void 0);var z=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class K extends t{constructor(){super(...arguments),this.fieldErrorUIController=new G,this.handleFieldErrorMessageUpdate=t=>{const{message:e,isValid:s}=t;s?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(e)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new n(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),o.register(u,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){o.unregister(u,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(t){const{host:e}=t,s=this.host.parentElement;return s&&s===e&&"VEGA-FIELD-ERROR"===s.tagName||this.host===e}}z([s()],K.prototype,"host",void 0),z([s()],K.prototype,"options",void 0),z([e()],K.prototype,"fieldErrorUIController",void 0),z([i("setInjectFormFieldHelper")],K.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null),z([i("disconnectedCallback")],K.prototype,"handleUnregisterObserver",null);var N=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class X extends t{constructor(){super(...arguments),this.handleValidInvocation=async t=>{if(this.validator){void 0!==t.timerId&&clearTimeout(t.timerId);const e=await this.validator.validate(t.message);if(e){const{isValid:s,message:i}=e;"function"==typeof t.promiseResolve&&t.promiseResolve({isValid:s,message:i})}}}}registerValidInvocationObserver(){j.addUniqueObserverToNode(this.host,O,this.handleValidInvocation)}handleUnregisterObserver(){j.removeUniqueObserverFromNode(this.host,O)}}N([s()],X.prototype,"host",void 0),N([s()],X.prototype,"validator",void 0),N([i("setInjectFormFieldHelper")],X.prototype,"registerValidInvocationObserver",null),N([i("disconnectedCallback")],X.prototype,"handleUnregisterObserver",null);var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class J extends T{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:t=>{var e;null===(e=this.validator)||void 0===e||e.updateDisableBlurValidation(t)}}]})}componentWillLoad(){super.componentWillLoad()}}q([s()],J.prototype,"host",void 0),q([s()],J.prototype,"validator",void 0),q([i("setInjectFormFieldHelper")],J.prototype,"componentWillLoad",null);var Q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class Y extends t{constructor(t){super(),this.fieldErrorSlimmer=new K,this.formFieldValidInvokeSlimmer=new X,this.formFormStateController=new J,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=t,this.setMutationObserverSlimmer()}connectedCallback(){null===this.validator&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(t){return t&&Boolean(t.getAttribute("data-vega-form"))}watchValidationRulesByFormControllerSlimmer(t,e){k(t,e,!1,((t,e)=>t===e?0:-1))||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(Y.isValidFormField(this.host)){const{defaultValue:t}=this.options,e=new W(this.getPropertyRules(),this.host,t,this.options);e.addListener({callback:t=>{this.isValid!=t&&(this.isValid=t,o.notify(f,{host:this.host,detail:t}))}}),this.validator=e,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&"validationRules"===this.options.validationRulesName&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:t,attributeGetter:e}=this.options;return t.map((t=>{const s=t.dependence&&"string"==typeof t.dependence?[e(t.dependence)]:Array.isArray(t.dependence)?t.dependence.map((t=>e(t))):[null];return t.ruleFactory(e(t.propertyName),...s)})).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new S({options:{attributeFilter:this.options.propertyRules.map((t=>r(t.propertyName))),attributeOldValue:!0},mutationFilter:A(),callback:this.mutationObserverCallBack})}}Q([s()],Y.prototype,"host",void 0),Q([s({writable:!0})],Y.prototype,"validationRules",void 0),Q([s()],Y.prototype,"disabled",void 0),Q([s()],Y.prototype,"autoValidation",void 0),Q([s({writable:!0})],Y.prototype,"isValid",void 0),Q([e()],Y.prototype,"fieldErrorSlimmer",void 0),Q([e()],Y.prototype,"formFieldValidInvokeSlimmer",void 0),Q([e()],Y.prototype,"mutationObserverSlimmer",void 0),Q([e()],Y.prototype,"formFormStateController",void 0),Q([i("connectedCallback")],Y.prototype,"connectedCallback",null),Q([i("disconnectedCallback")],Y.prototype,"disconnectedCallback",null),Q([i("componentDidLoad")],Y.prototype,"componentDidLoad",null),Q([i("watchValidationRules")],Y.prototype,"watchValidationRulesByFormControllerSlimmer",null),Q([i("componentWillLoad")],Y.prototype,"setInjectFormFieldHelper",null);export{Y as F}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,F as t,r as o,c as r,H as i,g as a}from"./p-6b2342e0.js";import{s as l}from"./p-519a7d55.js";import{c as s,V as n,M as d,I as c}from"./p-6e1ab235.js";import{V as v,I as p}from"./p-4415ad28.js";import{V as h}from"./p-e1fbfd20.js";import{D as f}from"./p-f28a6074.js";import{a as g,i as u,y as b,o as m,z as x,A as w}from"./p-b78eaec4.js";import{g as C}from"./p-8b5d3a52.js";import{c as y}from"./p-6ac8e655.js";import{t as j}from"./p-aacf6920.js";import{c as F}from"./p-effa6495.js";import{C as R}from"./p-2d0d575f.js";import{F as L}from"./p-a528714c.js";import{F as k}from"./p-11a2f834.js";import{F as z}from"./p-0bb860cc.js";import{D as E}from"./p-b19b1c08.js";import{T as M}from"./p-57f220b5.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-9de25451.js";import"./p-b75ee3ba.js";import"./p-02841589.js";import"./p-aa985d73.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-a0c3968b.js";import"./p-280cbcdb.js";var V=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class I extends n{render(){return e(t,null,e("vega-field-label",{isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.vegaFileUploaderContainerRenderer.render(),this.hint?e("vega-hint",null,this.hint):null,this.vegaFileUploaderFileListRenderer.render())}}V([s()],I.prototype,"required",void 0),V([s()],I.prototype,"disabled",void 0),V([s()],I.prototype,"label",void 0),V([s()],I.prototype,"hint",void 0),V([s()],I.prototype,"vegaFileUploaderContainerRenderer",void 0),V([s()],I.prototype,"vegaFileUploaderFileListRenderer",void 0);var U=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class O extends n{constructor(){super(...arguments),this.handleDropAreaClick=e=>{e.stopPropagation(),this.shouldDisableUploadButton()||this.triggerFileInputClick()},this.triggerFileInputClick=()=>{this.inputElementRef.click()},this.inputChangeHandler=e=>{e.stopPropagation();const t=this.getVegaFilesFromFileList(e.target.files);this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(t)),this.inputElementRef.value=""},this.dropHandler=e=>{var t;if(e.preventDefault(),!this.shouldDisableUploadButton()){const o=this.getVegaFilesFromFileList(this.dropFileFilterController.process(null===(t=e.dataTransfer)||void 0===t?void 0:t.files));this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(o))}}}getUploaderContainerRef(){return this.uploaderContainerRef}render(){return e("div",{class:"vega-file-uploader-container",ref:e=>this.uploaderContainerRef=e},e("input",{onChange:this.inputChangeHandler,type:"file",multiple:!this.fileLimitController.isSingleMode(),accept:this.accept,style:{display:"none"},ref:e=>this.inputElementRef=e}),"uploadButton"===this.variant?this.renderUploadButton():this.renderUploadDropArea())}renderUploadButton(){return e("vega-button",{label:"Upload Document",icon:h.getIconKey("arrow-up-from-line"),variant:"secondary",size:"small",disabled:this.shouldDisableUploadButton(),ref:e=>{f.addUniqueObserverToNode(e,g,this.triggerFileInputClick)}})}renderUploadDropArea(){return e("vega-box",{class:{"vega-file-upload-area":!0,disabled:this.shouldDisableUploadButton()},padding:"size-24",border:"border-input-field",borderStyle:"dashed",backgroundColor:"bg-tertiary",corners:"rounded-8",tabIndex:0,onDrop:this.dropHandler,onDragEnter:this.preventDefaultBehavior,onDragOver:this.preventDefaultBehavior,onClick:this.handleDropAreaClick,onKeyDown:y()},e("vega-flex",{gap:"size-8",alignItems:"center",justifyContent:"center"},e("vega-icon",{color:"text-link",icon:h.getIconKey("arrow-up-from-line")}),e("vega-font",{color:"text-link",variant:"font-btn-label"},this.translationSlimmer.t("Select or drop your file here"))))}preventDefaultBehavior(e){e.preventDefault()}selectFileChangeEventEmitHandler(e){e&&e.length&&(this.selectFileChangeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value&&this.value.length?(new Array).concat(this.value,e):e))}getVegaFilesFromFileList(e){const t=[];return e&&e.length&&Array.from(e).map((e=>{t.push({key:C(),name:e.name,url:e})})),t}shouldDisableUploadButton(){return this.disabled||!!(this.value&&this.maxCount&&this.value.length>=this.maxCount)}filterExceedLimitFiles(e){const t=Number(this.maxCount);if(!isNaN(t)&&t&&e.length){const o=Math.max(0,t-(this.value?this.value.length:0));return e.slice(0,o)}return e}}h.register({"arrow-up-from-line":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.3V208 320c0 17.7 14.3 32 32 32s32-14.3 32-32V208 141.3l73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"/></svg>'}}),U([s()],O.prototype,"variant",void 0),U([s()],O.prototype,"accept",void 0),U([s()],O.prototype,"disabled",void 0),U([s()],O.prototype,"value",void 0),U([s()],O.prototype,"selectFileChangeEventEmitter",void 0),U([s()],O.prototype,"vegaFileUploaderValueController",void 0),U([s()],O.prototype,"dropFileFilterController",void 0),U([s()],O.prototype,"translationSlimmer",void 0),U([s()],O.prototype,"fileLimitController",void 0),U([s()],O.prototype,"maxCount",void 0);var A=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class D extends n{constructor(){super(...arguments),this.fileRemoveHandler=e=>{this.removeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value.filter((t=>t!==e)))},this.fileReUploadHandler=e=>{this.retryEventEmitter.emit(e)},this.filePreviewHandler=e=>{this.previewEventEmitter.emit(e)}}render(){const t=!this.value||this.value.length<1;return e("div",{class:{"vega-file-uploader-file-list":!0,"vega-file-list-hidden":t}},!t&&this.value.map((t=>e("vega-box",{key:t.key,class:"vega-file-uploader-file",padding:"size-8",corners:"rounded-8"},e("vega-flex",{alignItems:"start",justifyContent:"space-between"},e("vega-flex",{class:"vega-file-status-and-name",gap:"size-8",alignItems:"start"},e("div",{style:{paddingTop:"3px"}},this.vegaFileUploaderFileStatusRenderer.render(t.status,t.uploadingPercent)),e("vega-flex",{gap:"size-4",direction:"col"},e("vega-font",{color:"done"===t.status||"error"===t.status?"text-primary":"text-secondary",variant:"font-field-label"},t.name),"error"===t.status&&t.errorMessage&&e("vega-font",{color:"text-error",variant:"font-footnote1-short"},t.errorMessage))),e("vega-flex",{gap:"size-4",class:"vega-file-list-buttons",justifyContent:"end"},t.previewable&&e("vega-button-circle",{class:"vega-file-preview-button",variant:"icon-only",size:"small",icon:"zoom-in",iconColor:"text-secondary",label:"Preview",tooltip:{disableInteractive:!0},ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.filePreviewHandler(t)}))}}),"error"===t.status&&e("vega-button-circle",{variant:"icon-only",size:"small",icon:h.getIconKey("arrow-rotate-right"),iconColor:"text-secondary",label:"Retry",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileReUploadHandler(t)}))}}),e("vega-button-circle",{variant:"icon-only",size:"small",icon:h.getIconKey("trash-can"),iconColor:"text-secondary",label:"Delete",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileRemoveHandler(t)}))}})))))))}}h.register({"trash-can":j,"arrow-rotate-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M456 224c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24s-24 10.7-24 24v80.1l-20-23.5C371 63.4 309.1 32 240 32C116.3 32 16 132.3 16 256s100.3 224 224 224c50.4 0 97-16.7 134.4-44.8c10.6-8 12.7-23 4.8-33.6s-23-12.7-33.6-4.8C316.2 418.9 279.7 432 240 432c-97.2 0-176-78.8-176-176s78.8-176 176-176c54.3 0 102.9 24.6 135.2 63.4l.1 .2 0 0L402.9 176H312c-13.3 0-24 10.7-24 24s10.7 24 24 24H456z"/></svg>'}}),A([s()],D.prototype,"value",void 0),A([s()],D.prototype,"disabled",void 0),A([s()],D.prototype,"vegaFileUploaderFileStatusRenderer",void 0),A([s()],D.prototype,"removeEventEmitter",void 0),A([s()],D.prototype,"vegaFileUploaderValueController",void 0),A([s()],D.prototype,"retryEventEmitter",void 0),A([s()],D.prototype,"previewEventEmitter",void 0);class S extends n{render(t,o){switch(t){case"uploading":return e("vega-loading-indicator",Object.assign({class:"vega-file-list-status",mode:o?"determinate":"indeterminate",size:"micro"},o?{percent:o}:{}));case"done":return e("vega-icon",{class:"vega-file-list-status",color:"text-success",icon:h.getIconKey("circle-check-regular")});case"error":return e("vega-icon",{class:"vega-file-list-status",color:"text-error",icon:h.getIconKey("circle-xmark")});default:return e("vega-loading-indicator",{class:"vega-file-list-status",mode:"determinate",size:"micro"})}}}h.register({"circle-check-regular":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M243.8 339.8C232.9 350.7 215.1 350.7 204.2 339.8L140.2 275.8C129.3 264.9 129.3 247.1 140.2 236.2C151.1 225.3 168.9 225.3 179.8 236.2L224 280.4L332.2 172.2C343.1 161.3 360.9 161.3 371.8 172.2C382.7 183.1 382.7 200.9 371.8 211.8L243.8 339.8zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'},"circle-xmark":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M175 175C184.4 165.7 199.6 165.7 208.1 175L255.1 222.1L303 175C312.4 165.7 327.6 165.7 336.1 175C346.3 184.4 346.3 199.6 336.1 208.1L289.9 255.1L336.1 303C346.3 312.4 346.3 327.6 336.1 336.1C327.6 346.3 312.4 346.3 303 336.1L255.1 289.9L208.1 336.1C199.6 346.3 184.4 346.3 175 336.1C165.7 327.6 165.7 312.4 175 303L222.1 255.1L175 208.1C165.7 199.6 165.7 184.4 175 175V175zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'}});var B=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class H extends n{valueChangeHandler(e){!e||Array.isArray(e)?(this.changeEventEmitter.emit(e),R.notify(L,{host:this.host,detail:this.value})):e&&!Array.isArray(e)&&this.setValue(null)}setValue(e){this.value=e}}B([s()],H.prototype,"host",void 0),B([s({writable:!0})],H.prototype,"value",void 0),B([s()],H.prototype,"changeEventEmitter",void 0),B([d("watchValue")],H.prototype,"valueChangeHandler",null);var N=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class P extends n{isSingleMode(){return 1===Number(this.maxCount)}checkMaxCount(){null!==this.maxCount&&this.maxCount<1&&(this.maxCount=null)}}N([s({writable:!0})],P.prototype,"maxCount",void 0),N([d("componentDidLoad"),d("watchMaxCount")],P.prototype,"checkMaxCount",null);var q=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};const G=class{constructor(e){o(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.vegaSelectedFileChange=r(this,"vegaSelectedFileChange",7),this.selectedFileChange=r(this,"selectedFileChange",7),this.vegaRemove=r(this,"vegaRemove",7),this.remove=r(this,"remove",7),this.vegaRetry=r(this,"vegaRetry",7),this.retry=r(this,"retry",7),this.vegaPreview=r(this,"vegaPreview",7),this.preview=r(this,"preview",7),this.globalSlimmers={},this.translationSlimmer=new M,this.vegaComponentUsageRuntimeMetricsSlimmer=new v,this.formFieldController=new k({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new z:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaFileUploaderContainerRenderer.getUploaderContainerRef(),touchableAreaGetter:()=>[this.vegaFileUploaderContainerRenderer.getUploaderContainerRef()]}),this.vegaFileUploaderRenderer=new I,this.vegaFileUploaderContainerRenderer=new O,this.vegaFileUploaderFileListRenderer=new D,this.vegaFileUploaderFileStatusRenderer=new S,this.vegaFileUploaderValueController=new H,this.dropFileFilterController=new E,this.fileLimitController=new P,this.changeEventEmitter=F(G,u),this.selectFileChangeEventEmitter=F(G,b),this.removeEventEmitter=F(G,m),this.retryEventEmitter=F(G,x),this.previewEventEmitter=F(G,w),this.label="",this.variant="uploadArea",this.hint="",this.value=[],this.disabled=!1,this.maxCount=null,this.required=!1,this.validationRules=[],this.autoValidation=!0,this.isValid=null}watchValue(e){}watchMaxCount(){}watchValidationRules(){}render(){return l(e(i,null,this.vegaFileUploaderRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],maxCount:["watchMaxCount"],validationRules:["watchValidationRules"]}}};q([p()],G.prototype,"globalSlimmers",void 0),q([c()],G.prototype,"translationSlimmer",void 0),q([c()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),q([c()],G.prototype,"formFieldController",void 0),q([c()],G.prototype,"vegaFileUploaderRenderer",void 0),q([c()],G.prototype,"vegaFileUploaderContainerRenderer",void 0),q([c()],G.prototype,"vegaFileUploaderFileListRenderer",void 0),q([c()],G.prototype,"vegaFileUploaderFileStatusRenderer",void 0),q([c()],G.prototype,"vegaFileUploaderValueController",void 0),q([c()],G.prototype,"dropFileFilterController",void 0),q([c()],G.prototype,"fileLimitController",void 0),q([c()],G.prototype,"changeEventEmitter",void 0),q([c()],G.prototype,"selectFileChangeEventEmitter",void 0),q([c()],G.prototype,"removeEventEmitter",void 0),q([c()],G.prototype,"retryEventEmitter",void 0),q([c()],G.prototype,"previewEventEmitter",void 0),G.style=':host{display:inline-block;text-align:left;width:100%;line-height:normal}:host .vega-file-uploader-container .vega-file-upload-area{text-align:center}:host .vega-file-uploader-container .vega-file-upload-area:hover{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-input-field-hover, 115, 160, 190, 1))}:host .vega-file-uploader-container .vega-file-upload-area:hover vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:hover vega-font{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .vega-file-uploader-container .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-file-uploader-container .vega-file-upload-area:active{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area:active vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:active vega-font{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area.disabled{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-tertiary, 240, 243, 247, 1));outline:none}:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-icon,:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-file-uploader-container vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error .vega-file-upload-area{border-color:rgba(var(--v-border-color-input-field-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:hover{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host .vega-file-uploader-container.error .vega-file-upload-area:active{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error vega-button::part(button),:host .vega-file-uploader-container.error vega-button::part(button):hover{color:rgba(var(--v-text-danger-link, 230, 50, 87, 1));border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error vega-button::part(button):hover{background-color:rgba(var(--v-bg-danger-tertiary-hover, 255, 87, 114, 0.2));border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1));color:rgba(var(--v-text-danger-link-hover, 233, 71, 104, 1))}:host .vega-file-uploader-container.error vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error vega-button::part(button):active{color:rgba(var(--v-text-danger-link-active, 189, 41, 71, 1));border-color:rgba(var(--v-border-color-danger-active, 189, 41, 71, 1));background-color:rgba(var(--v-bg-danger-tertiary-active, 189, 41, 71, 0.2))}:host .vega-file-uploader-file-list .vega-file-uploader-file .vega-file-preview-button{visibility:hidden}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover{background-color:rgba(var(--v-bg-action-tertiary-hover, 4, 4, 28, 0.05))}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover .vega-file-preview-button{visibility:visible}:host .vega-file-uploader-file-list .vega-file-list-buttons{margin-left:8px;flex-shrink:0}:host .vega-file-uploader-file-list .vega-file-list-status svg{width:16px;height:16px}:host .vega-file-uploader-file-list .vega-file-status-and-name{padding-top:5px}:host .vega-file-uploader-file-list .vega-file-status-and-name vega-font{word-break:break-word}:host vega-field-label{margin-bottom:8px}:host .vega-file-uploader-file-list{margin-top:8px}:host .vega-file-uploader-file-list.vega-file-list-hidden{display:none}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{G as vega_file_uploader}
|
|
1
|
+
import{h as e,F as t,r as o,c as r,H as i,g as a}from"./p-6b2342e0.js";import{s as l}from"./p-519a7d55.js";import{c as s,V as n,M as c,I as d}from"./p-6e1ab235.js";import{V as v,I as p}from"./p-4415ad28.js";import{V as h}from"./p-e1fbfd20.js";import{D as f}from"./p-f28a6074.js";import{a as g,i as u,y as b,o as m,z as x,A as w}from"./p-9af0e2e7.js";import{g as C}from"./p-8b5d3a52.js";import{c as y}from"./p-6ac8e655.js";import{t as j}from"./p-aacf6920.js";import{c as F}from"./p-6b5cb920.js";import{C as R}from"./p-2d0d575f.js";import{F as L}from"./p-a528714c.js";import{F as k}from"./p-c347e08a.js";import{F as z}from"./p-0bb860cc.js";import{D as E}from"./p-b19b1c08.js";import{T as M}from"./p-57f220b5.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";import"./p-02841589.js";import"./p-6c43d54a.js";import"./p-3b791b5d.js";import"./p-f0e828d8.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-af5cb9bc.js";import"./p-280cbcdb.js";var V=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class I extends n{render(){return e(t,null,e("vega-field-label",{isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.vegaFileUploaderContainerRenderer.render(),this.hint?e("vega-hint",null,this.hint):null,this.vegaFileUploaderFileListRenderer.render())}}V([s()],I.prototype,"required",void 0),V([s()],I.prototype,"disabled",void 0),V([s()],I.prototype,"label",void 0),V([s()],I.prototype,"hint",void 0),V([s()],I.prototype,"vegaFileUploaderContainerRenderer",void 0),V([s()],I.prototype,"vegaFileUploaderFileListRenderer",void 0);var U=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class O extends n{constructor(){super(...arguments),this.handleDropAreaClick=e=>{e.stopPropagation(),this.shouldDisableUploadButton()||this.triggerFileInputClick()},this.triggerFileInputClick=()=>{this.inputElementRef.click()},this.inputChangeHandler=e=>{e.stopPropagation();const t=this.getVegaFilesFromFileList(e.target.files);this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(t)),this.inputElementRef.value=""},this.dropHandler=e=>{var t;if(e.preventDefault(),!this.shouldDisableUploadButton()){const o=this.getVegaFilesFromFileList(this.dropFileFilterController.process(null===(t=e.dataTransfer)||void 0===t?void 0:t.files));this.selectFileChangeEventEmitHandler(this.filterExceedLimitFiles(o))}}}getUploaderContainerRef(){return this.uploaderContainerRef}render(){return e("div",{class:"vega-file-uploader-container",ref:e=>this.uploaderContainerRef=e},e("input",{onChange:this.inputChangeHandler,type:"file",multiple:!this.fileLimitController.isSingleMode(),accept:this.accept,style:{display:"none"},ref:e=>this.inputElementRef=e}),"uploadButton"===this.variant?this.renderUploadButton():this.renderUploadDropArea())}renderUploadButton(){return e("vega-button",{label:"Upload Document",icon:h.getIconKey("arrow-up-from-line"),variant:"secondary",size:"small",disabled:this.shouldDisableUploadButton(),ref:e=>{f.addUniqueObserverToNode(e,g,this.triggerFileInputClick)}})}renderUploadDropArea(){return e("vega-box",{class:{"vega-file-upload-area":!0,disabled:this.shouldDisableUploadButton()},padding:"size-24",border:"border-input-field",borderStyle:"dashed",backgroundColor:"bg-tertiary",corners:"rounded-8",tabIndex:0,onDrop:this.dropHandler,onDragEnter:this.preventDefaultBehavior,onDragOver:this.preventDefaultBehavior,onClick:this.handleDropAreaClick,onKeyDown:y()},e("vega-flex",{gap:"size-8",alignItems:"center",justifyContent:"center"},e("vega-icon",{color:"text-link",icon:h.getIconKey("arrow-up-from-line")}),e("vega-font",{color:"text-link",variant:"font-btn-label"},this.translationSlimmer.t("Select or drop your file here"))))}preventDefaultBehavior(e){e.preventDefault()}selectFileChangeEventEmitHandler(e){e&&e.length&&(this.selectFileChangeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value&&this.value.length?(new Array).concat(this.value,e):e))}getVegaFilesFromFileList(e){const t=[];return e&&e.length&&Array.from(e).map((e=>{t.push({key:C(),name:e.name,url:e})})),t}shouldDisableUploadButton(){return this.disabled||!!(this.value&&this.maxCount&&this.value.length>=this.maxCount)}filterExceedLimitFiles(e){const t=Number(this.maxCount);if(!isNaN(t)&&t&&e.length){const o=Math.max(0,t-(this.value?this.value.length:0));return e.slice(0,o)}return e}}h.register({"arrow-up-from-line":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.3V208 320c0 17.7 14.3 32 32 32s32-14.3 32-32V208 141.3l73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"/></svg>'}}),U([s()],O.prototype,"variant",void 0),U([s()],O.prototype,"accept",void 0),U([s()],O.prototype,"disabled",void 0),U([s()],O.prototype,"value",void 0),U([s()],O.prototype,"selectFileChangeEventEmitter",void 0),U([s()],O.prototype,"vegaFileUploaderValueController",void 0),U([s()],O.prototype,"dropFileFilterController",void 0),U([s()],O.prototype,"translationSlimmer",void 0),U([s()],O.prototype,"fileLimitController",void 0),U([s()],O.prototype,"maxCount",void 0);var A=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class D extends n{constructor(){super(...arguments),this.fileRemoveHandler=e=>{this.removeEventEmitter.emit(e).defaultPrevented||this.vegaFileUploaderValueController.setValue(this.value.filter((t=>t!==e)))},this.fileReUploadHandler=e=>{this.retryEventEmitter.emit(e)},this.filePreviewHandler=e=>{this.previewEventEmitter.emit(e)}}render(){const t=!this.value||this.value.length<1;return e("div",{class:{"vega-file-uploader-file-list":!0,"vega-file-list-hidden":t}},!t&&this.value.map((t=>e("vega-box",{key:t.key,class:"vega-file-uploader-file",padding:"size-8",corners:"rounded-8"},e("vega-flex",{alignItems:"start",justifyContent:"space-between"},e("vega-flex",{class:"vega-file-status-and-name",gap:"size-8",alignItems:"start"},e("div",{style:{paddingTop:"3px"}},this.vegaFileUploaderFileStatusRenderer.render(t.status,t.uploadingPercent)),e("vega-flex",{gap:"size-4",direction:"col"},e("vega-font",{color:"done"===t.status||"error"===t.status?"text-primary":"text-secondary",variant:"font-field-label"},t.name),"error"===t.status&&t.errorMessage&&e("vega-font",{color:"text-error",variant:"font-footnote1-short"},t.errorMessage))),e("vega-flex",{gap:"size-4",class:"vega-file-list-buttons",justifyContent:"end"},t.previewable&&e("vega-button-circle",{class:"vega-file-preview-button",variant:"icon-only",size:"small",icon:"zoom-in",iconColor:"text-secondary",label:"Preview",tooltip:{disableInteractive:!0},ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.filePreviewHandler(t)}))}}),"error"===t.status&&e("vega-button-circle",{variant:"icon-only",size:"small",icon:h.getIconKey("arrow-rotate-right"),iconColor:"text-secondary",label:"Retry",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileReUploadHandler(t)}))}}),e("vega-button-circle",{variant:"icon-only",size:"small",icon:h.getIconKey("trash-can"),iconColor:"text-secondary",label:"Delete",tooltip:{disableInteractive:!0},disabled:this.disabled,ref:e=>{f.addUniqueObserverToNode(e,g,(()=>{this.fileRemoveHandler(t)}))}})))))))}}h.register({"trash-can":j,"arrow-rotate-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M456 224c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24s-24 10.7-24 24v80.1l-20-23.5C371 63.4 309.1 32 240 32C116.3 32 16 132.3 16 256s100.3 224 224 224c50.4 0 97-16.7 134.4-44.8c10.6-8 12.7-23 4.8-33.6s-23-12.7-33.6-4.8C316.2 418.9 279.7 432 240 432c-97.2 0-176-78.8-176-176s78.8-176 176-176c54.3 0 102.9 24.6 135.2 63.4l.1 .2 0 0L402.9 176H312c-13.3 0-24 10.7-24 24s10.7 24 24 24H456z"/></svg>'}}),A([s()],D.prototype,"value",void 0),A([s()],D.prototype,"disabled",void 0),A([s()],D.prototype,"vegaFileUploaderFileStatusRenderer",void 0),A([s()],D.prototype,"removeEventEmitter",void 0),A([s()],D.prototype,"vegaFileUploaderValueController",void 0),A([s()],D.prototype,"retryEventEmitter",void 0),A([s()],D.prototype,"previewEventEmitter",void 0);class S extends n{render(t,o){switch(t){case"uploading":return e("vega-loading-indicator",Object.assign({class:"vega-file-list-status",mode:o?"determinate":"indeterminate",size:"micro"},o?{percent:o}:{}));case"done":return e("vega-icon",{class:"vega-file-list-status",color:"text-success",icon:h.getIconKey("circle-check-regular")});case"error":return e("vega-icon",{class:"vega-file-list-status",color:"text-error",icon:h.getIconKey("circle-xmark")});default:return e("vega-loading-indicator",{class:"vega-file-list-status",mode:"determinate",size:"micro"})}}}h.register({"circle-check-regular":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M243.8 339.8C232.9 350.7 215.1 350.7 204.2 339.8L140.2 275.8C129.3 264.9 129.3 247.1 140.2 236.2C151.1 225.3 168.9 225.3 179.8 236.2L224 280.4L332.2 172.2C343.1 161.3 360.9 161.3 371.8 172.2C382.7 183.1 382.7 200.9 371.8 211.8L243.8 339.8zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'},"circle-xmark":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M175 175C184.4 165.7 199.6 165.7 208.1 175L255.1 222.1L303 175C312.4 165.7 327.6 165.7 336.1 175C346.3 184.4 346.3 199.6 336.1 208.1L289.9 255.1L336.1 303C346.3 312.4 346.3 327.6 336.1 336.1C327.6 346.3 312.4 346.3 303 336.1L255.1 289.9L208.1 336.1C199.6 346.3 184.4 346.3 175 336.1C165.7 327.6 165.7 312.4 175 303L222.1 255.1L175 208.1C165.7 199.6 165.7 184.4 175 175V175zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"/></svg>'}});var B=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class H extends n{valueChangeHandler(e){!e||Array.isArray(e)?(this.changeEventEmitter.emit(e),R.notify(L,{host:this.host,detail:this.value})):e&&!Array.isArray(e)&&this.setValue(null)}setValue(e){this.value=e}}B([s()],H.prototype,"host",void 0),B([s({writable:!0})],H.prototype,"value",void 0),B([s()],H.prototype,"changeEventEmitter",void 0),B([c("watchValue")],H.prototype,"valueChangeHandler",null);var N=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};class P extends n{isSingleMode(){return 1===Number(this.maxCount)}checkMaxCount(){null!==this.maxCount&&this.maxCount<1&&(this.maxCount=null)}}N([s({writable:!0})],P.prototype,"maxCount",void 0),N([c("componentDidLoad"),c("watchMaxCount")],P.prototype,"checkMaxCount",null);var q=function(e,t,o,r){var i,a=arguments.length,l=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(a<3?i(l):a>3?i(t,o,l):i(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};const G=class{constructor(e){o(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.vegaSelectedFileChange=r(this,"vegaSelectedFileChange",7),this.selectedFileChange=r(this,"selectedFileChange",7),this.vegaRemove=r(this,"vegaRemove",7),this.remove=r(this,"remove",7),this.vegaRetry=r(this,"vegaRetry",7),this.retry=r(this,"retry",7),this.vegaPreview=r(this,"vegaPreview",7),this.preview=r(this,"preview",7),this.globalSlimmers={},this.translationSlimmer=new M,this.vegaComponentUsageRuntimeMetricsSlimmer=new v,this.formFieldController=new k({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new z:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaFileUploaderContainerRenderer.getUploaderContainerRef(),touchableAreaGetter:()=>[this.vegaFileUploaderContainerRenderer.getUploaderContainerRef()]}),this.vegaFileUploaderRenderer=new I,this.vegaFileUploaderContainerRenderer=new O,this.vegaFileUploaderFileListRenderer=new D,this.vegaFileUploaderFileStatusRenderer=new S,this.vegaFileUploaderValueController=new H,this.dropFileFilterController=new E,this.fileLimitController=new P,this.changeEventEmitter=F(G,u),this.selectFileChangeEventEmitter=F(G,b),this.removeEventEmitter=F(G,m),this.retryEventEmitter=F(G,x),this.previewEventEmitter=F(G,w),this.label="",this.variant="uploadArea",this.hint="",this.value=[],this.disabled=!1,this.maxCount=null,this.required=!1,this.validationRules=[],this.autoValidation=!0,this.isValid=null}watchValue(e){}watchMaxCount(){}watchValidationRules(){}render(){return l(e(i,null,this.vegaFileUploaderRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],maxCount:["watchMaxCount"],validationRules:["watchValidationRules"]}}};q([p()],G.prototype,"globalSlimmers",void 0),q([d()],G.prototype,"translationSlimmer",void 0),q([d()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),q([d()],G.prototype,"formFieldController",void 0),q([d()],G.prototype,"vegaFileUploaderRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderContainerRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderFileListRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderFileStatusRenderer",void 0),q([d()],G.prototype,"vegaFileUploaderValueController",void 0),q([d()],G.prototype,"dropFileFilterController",void 0),q([d()],G.prototype,"fileLimitController",void 0),q([d()],G.prototype,"changeEventEmitter",void 0),q([d()],G.prototype,"selectFileChangeEventEmitter",void 0),q([d()],G.prototype,"removeEventEmitter",void 0),q([d()],G.prototype,"retryEventEmitter",void 0),q([d()],G.prototype,"previewEventEmitter",void 0),G.style=':host{display:inline-block;text-align:left;width:100%;line-height:normal}:host .vega-file-uploader-container .vega-file-upload-area{text-align:center}:host .vega-file-uploader-container .vega-file-upload-area:hover{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-input-field-hover, 115, 160, 190, 1))}:host .vega-file-uploader-container .vega-file-upload-area:hover vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:hover vega-font{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .vega-file-uploader-container .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-file-uploader-container .vega-file-upload-area:active{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area:active vega-icon,:host .vega-file-uploader-container .vega-file-upload-area:active vega-font{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .vega-file-uploader-container .vega-file-upload-area.disabled{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-tertiary, 240, 243, 247, 1));outline:none}:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-icon,:host .vega-file-uploader-container .vega-file-upload-area.disabled vega-font{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-file-uploader-container vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error .vega-file-upload-area{border-color:rgba(var(--v-border-color-input-field-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:hover{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error .vega-file-upload-area:focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host .vega-file-uploader-container.error .vega-file-upload-area:active{border-color:rgba(var(--v-border-color-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-file-uploader-container.error vega-button::part(button),:host .vega-file-uploader-container.error vega-button::part(button):hover{color:rgba(var(--v-text-danger-link, 230, 50, 87, 1));border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}:host .vega-file-uploader-container.error vega-button::part(button):hover{background-color:rgba(var(--v-bg-danger-tertiary-hover, 255, 87, 114, 0.2));border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1));color:rgba(var(--v-text-danger-link-hover, 233, 71, 104, 1))}:host .vega-file-uploader-container.error vega-button::part(button):focus-visible{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px;box-shadow:0 0 0}:host .vega-file-uploader-container.error vega-button::part(button):active{color:rgba(var(--v-text-danger-link-active, 189, 41, 71, 1));border-color:rgba(var(--v-border-color-danger-active, 189, 41, 71, 1));background-color:rgba(var(--v-bg-danger-tertiary-active, 189, 41, 71, 0.2))}:host .vega-file-uploader-file-list .vega-file-uploader-file .vega-file-preview-button{visibility:hidden}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover{background-color:rgba(var(--v-bg-action-tertiary-hover, 4, 4, 28, 0.05))}:host .vega-file-uploader-file-list .vega-file-uploader-file:hover .vega-file-preview-button{visibility:visible}:host .vega-file-uploader-file-list .vega-file-list-buttons{margin-left:8px;flex-shrink:0}:host .vega-file-uploader-file-list .vega-file-list-status svg{width:16px;height:16px}:host .vega-file-uploader-file-list .vega-file-status-and-name{padding-top:5px}:host .vega-file-uploader-file-list .vega-file-status-and-name vega-font{word-break:break-word}:host vega-field-label{margin-bottom:8px}:host .vega-file-uploader-file-list{margin-top:8px}:host .vega-file-uploader-file-list.vega-file-list-hidden{display:none}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}';export{G as vega_file_uploader}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as i,H as s,g as n}from"./p-6b2342e0.js";import{s as a}from"./p-519a7d55.js";import{c as o,V as r,I as l}from"./p-6e1ab235.js";import{V as f,I as p}from"./p-4415ad28.js";import{c as h}from"./p-
|
|
1
|
+
import{h as t,r as e,c as i,H as s,g as n}from"./p-6b2342e0.js";import{s as a}from"./p-519a7d55.js";import{c as o,V as r,I as l}from"./p-6e1ab235.js";import{V as f,I as p}from"./p-4415ad28.js";import{c as h}from"./p-6b5cb920.js";import{a as d,x as c}from"./p-9af0e2e7.js";import{c as m}from"./p-6ac8e655.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-f28a6074.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";var x=function(t,e,i,s){var n,a=arguments.length,o=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class b extends r{constructor(){super(...arguments),this.handleSuffixButtonClick=t=>{t.stopPropagation(),this.suffixButtonClickEventEmitter.emit()}}render(){if(this.suffixButtonConfig||this.suffixButtonProps){const{icon:e,text:i,size:s,minWidth:n,maxWidth:a,placement:o="right",alignment:r="start",trigger:l="hover"}=this.suffixButtonConfig||this.suffixButtonProps&&{icon:this.suffixButtonProps.icon,text:this.suffixButtonProps.tooltipText,trigger:this.suffixButtonProps.trigger};return t("div",{class:"label-suffix-button",role:"button",tabIndex:0,onClick:this.handleSuffixButtonClick,onKeyDown:m()},i?t("vega-tooltip",{trigger:l,text:i,size:s,minWidth:n,maxWidth:a,alignment:r,placement:o},this.renderSuffixButton(e)):this.renderSuffixButton(e))}}renderSuffixButton(e){return t("vega-button-circle",{size:"extra-small",variant:"icon-only",iconColor:"text-link",showTooltip:!1,icon:e})}}x([o()],b.prototype,"suffixButtonProps",void 0),x([o()],b.prototype,"suffixButtonConfig",void 0),x([o()],b.prototype,"suffixButtonClickEventEmitter",void 0);var g=function(t,e,i,s){var n,a=arguments.length,o=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};const u=class{constructor(t){e(this,t),this.vegaClick=i(this,"vegaClick",7),this.vegaLabelButtonClick=i(this,"vegaLabelButtonClick",1),this.labelButtonClick=i(this,"labelButtonClick",1),this.globalSlimmers={},this.clickEventEmitter=h(u,d),this.suffixButtonClickEventEmitter=h(u,c),this.vegaComponentUsageRuntimeMetricsSlimmer=new f,this.suffixElementRenderer=new b,this.suffixButtonProps=null,this.suffixButtonConfig=null,this.label="",this.isFieldRequired=!1,this.disabled=!1,this.handleClick=t=>{this.clickEventEmitter.emit(void 0,t)}}componentWillLoad(){""===this.label&&(this.label=this.host.textContent,this.host.textContent="")}render(){return a(t(s,{class:{hidden:""===this.label,disabled:this.disabled},onClick:this.handleClick},t("label",null,t("span",{class:"vega-field-label"},this.label),t("span",{class:{"vega-field-label-required":!0,hidden:!this.isFieldRequired}},"*")),this.suffixElementRenderer.render()),this.host)}get host(){return n(this)}};g([p()],u.prototype,"globalSlimmers",void 0),g([l()],u.prototype,"clickEventEmitter",void 0),g([l()],u.prototype,"suffixButtonClickEventEmitter",void 0),g([l()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),g([l()],u.prototype,"suffixElementRenderer",void 0),u.style=':host{display:inline-block}:host(.disabled){pointer-events:none}:host(.hidden){display:none}label:first-of-type{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;word-break:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host(.disabled)>label>span.vega-field-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-field-label-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}.vega-field-label-required.hidden{display:none}.label-suffix-button{display:inline-block;margin-left:4px;vertical-align:top}';export{u as vega_field_label}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t}from"./p-8b5d3a52.js";import{a as e,g as n,D as s,f as o,r as i}from"./p-6e70d3cc.js";import{L as r,I as a}from"./p-6e1ab235.js";import{I as l,c}from"./p-593e0f80.js";import{I as h}from"./p-781fd6e0.js";import{c as d}from"./p-6a334573.js";import{P as u}from"./p-81dd00d0.js";import{i as p}from"./p-f1c672e4.js";import{V as f}from"./p-3b791b5d.js";import{R as b,E as g,h as w,U as y,V as v,B as m,a as C,I as x,b as T,c as E,P as S,A as k,d as A}from"./p-5904616e.js";import{s as R,A as O,a as I,R as L,b as B,M as j,c as N,d as _,e as M,f as D,g as V,I as P,h as H,i as F,j as K,k as $,l as z,B as G,m as W,n as U,C as Z,o as J,p as X}from"./p-fb05335d.js";import{i as q}from"./p-e4c4ea35.js";import{R as Q}from"./p-b6c3ce6d.js";import{V as Y}from"./p-a7b5f497.js";import{V as tt}from"./p-e1fbfd20.js";import{v as et}from"./p-4866e390.js";import{D as nt,d as st}from"./p-f28a6074.js";import{V as ot,a as it,b as rt,c as at}from"./p-9af0e2e7.js";import{R as lt,a as ct,S as ht,T as dt,b as ut,c as pt,d as ft,e as bt,C as gt,M as wt,f as yt,g as vt,h as mt,i as Ct,j as xt,k as Tt,l as Et,m as St,n as kt,o as At,p as Rt,q as Ot,s as It,r as Lt,t as Bt,I as jt,u as Nt,v as _t,w as Mt,x as Dt,y as Vt,z as Pt,A as Ht,B as Ft,D as Kt,E as $t,F as zt,G as Gt,H as Wt,J as Ut,K as Zt,L as Jt,N as Xt,O as qt,P as Qt,Q as Yt,U as te,W as ee,X as ne,Y as se}from"./p-1d30cab2.js";import{C as oe}from"./p-2d0d575f.js";import{V as ie,a as re,b as ae}from"./p-6c43d54a.js";import{r as le}from"./p-77e64f26.js";import{V as ce}from"./p-8aee6b74.js";import{t as he}from"./p-b75ee3ba.js";import{p as de}from"./p-0c667d6a.js";import{c as ue}from"./p-a841cf13.js";import{d as pe}from"./p-1bc5b3bc.js";const fe=[{payloadKey:"IS_LOAD_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaLoaderController is called",canAccept:(t,e)=>"VegaLoaderController"===t&&"load"===e,payloadValue:()=>!0},{payloadKey:"IS_CLOSE_METHOD_CALLED",payloadDescription:"Indicate if the method close of public API VegaLoaderController is called",canAccept:(t,e)=>"VegaLoaderController"===t&&"close"===e,payloadValue:()=>!0}];class be{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(be,["load","close"],fe)}load(t={}){let e=t.containerSelector||"body",n=document.querySelector(e);if(n&&be.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY.includes(n.tagName)&&(e="body",n=document.querySelector("body")),!n)return r.error("Container is not found by selector: ",e),null;const s=this.createLoadingIndicator(t.indicatorOptions),o=this.createLoader(e);return o.append(s),this.appendLoader(o,n)}close(t){const e=this.findLoader(t);if(e){if(e.dataset.container){const t=document.querySelector(e.dataset.container);t&&t.dataset.vegaLoaderOriginPosition&&(t.style.position=t.dataset.vegaLoaderOriginPosition)}e.remove()}}findLoader(t){var e,n;let s;if(t.includes(">>>")){const[o,i]=t.split(">>>");s=null===(n=null===(e=document.querySelector(o))||void 0===e?void 0:e.shadowRoot)||void 0===n?void 0:n.getElementById(i)}else s=document.getElementById(t);return s}createLoader(n){const s=document.createElement("vega-loader-wrapper");return s.className=e(["body"===n?"fixed-wrapper":"absolute-wrapper"]),s.dataset.container=n,s.id=`vega-loader-${t()}`,s}createLoadingIndicator(t={}){const e=document.createElement("vega-loading-indicator");return Object.assign(e,t),e}appendLoader(t,e){return e.dataset.vegaLoaderOriginPosition=e.style.position,e.style.position="relative",e.shadowRoot?(e.shadowRoot.append(t),`${t.dataset.container}>>>${t.id}`):(e.append(t),t.id)}}be.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY=["VEGA-MODAL"],function(t,e,n,s){var o,i=arguments.length,r=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);i>3&&r&&Object.defineProperty(e,n,r)}([l()],be.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const ge=new be,we=[{payloadKey:"IS_OPEN_METHOD_CALLED",payloadDescription:"Indicate if the method open of public API VegaNotifyController is called",canAccept:(t,e)=>"VegaNotifyController"===t&&"open"===e,payloadValue:()=>!0},{payloadKey:"IS_CLOSE_METHOD_CALLED",payloadDescription:"Indicate if the method close of public API VegaNotifyController is called",canAccept:(t,e)=>"VegaNotifyController"===t&&"close"===e,payloadValue:()=>!0},{payloadKey:"IS_CLOSEALL_METHOD_CALLED",payloadDescription:"Indicate if the method closeAll of public API VegaNotifyController is called",canAccept:(t,e)=>"VegaNotifyController"===t&&"closeAll"===e,payloadValue:()=>!0}];var ye=function(t,e,n,s){var o,i=arguments.length,r=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);return i>3&&r&&Object.defineProperty(e,n,r),r};class ve{constructor(){this.resizeObserverSlimmer=d(ve,u,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{var e;!(t[0].contentRect.height>0)&&(null===(e=this.container)||void 0===e?void 0:e.classList.contains("hydrated"))&&(h.removeZIndex(this.container,"top"),this.container.remove(),this.container=null)},target:()=>this.container}]),this.vegaPublicAPIRuntimeMetricsSlimmer=c(ve,["open","close","closeAll"],we)}async open(t){const e=this.createPageNotification(t);return this.getContainer().append(e),e.id}async closeAll(){this.container&&Array.from(this.container.children).forEach((t=>{t.close()}))}async close(t){await document.getElementById(t).close()}connectResizeObserver(){}createPageNotification(e){const o=document.createElement("vega-page-notification");return Object.keys(e).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o.style.marginBottom=n()===s.MOBILE?"12px":"16px",o.id=`vega-page-notification-${t()}`,o}getContainer(){return this.container||(this.container=document.createElement("vega-page-notification-list"),h.setZIndex(this.container,"top"),n()===s.MOBILE?this.container.classList.add("vega-page-notification-list-bottom"):this.container.classList.add("vega-page-notification-list-topRight"),document.body.append(this.container),this.connectResizeObserver()),this.container}}ye([a()],ve.prototype,"resizeObserverSlimmer",void 0),ye([l()],ve.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const me=new ve,Ce=[{payloadKey:"IS_SETSEMANTICS_METHOD_CALLED",payloadDescription:"Indicate if the method setSemantics of public API VegaEventManager is called",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:()=>!0},{payloadKey:"IS_GETSEMANTICS_METHOD_CALLED",payloadDescription:"Indicate if the method getSemantics of public API VegaEventManager is called",canAccept:(t,e)=>"VegaEventManager"===t&&"getSemantics"===e,payloadValue:()=>!0},{payloadKey:"IS_GETENABLEDEVENTIDSBYCOMPONENT_METHOD_CALLED",payloadDescription:"Indicate if the method getEnabledEventIdsByComponent of public API VegaEventManager is called",canAccept:(t,e)=>"VegaEventManager"===t&&"getEnabledEventIdsByComponent"===e,payloadValue:()=>!0},{payloadKey:"globalEventIsNative",payloadDescription:"Indicate if the vega components will emit events without the vega prefix",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>!(!t.global||"native"!==t.global.namespace)},{payloadKey:"eventOfSpecificComponentsIsNative",payloadDescription:"Indicate if the vega components will emit events with the vega prefix, but special components will emit events without vega prefix",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>{const e=t;if(e.components){const t=Object.keys(e.components);return!!(t.length>0&&"native"===e.components[t[0]].namespace)}return!1}},{payloadKey:"eventOfSpecificComponentsIsVega",payloadDescription:"Indicate if the vega components will emit events without the vega prefix, but special components will emit events with vega prefix",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>{const e=t;if(e.global&&e.components){const t=Object.keys(e.components);return!!("native"===e.global.namespace&&t.length>0&&"vega"===e.components[t[0]].namespace)}return!1}},{payloadKey:"globalJqueryDelegatedEventIsTrue",payloadDescription:"Indicate if the use jQuery with event delegation",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>!(!t.global||!0!==t.global.jqueryDelegatedEvent)},{payloadKey:"jqueryDelegatedEventIsCustomStrategy",payloadDescription:"Indicate if the use jQuery with event delegation",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>{const e=t;return!!(e.global&&Array.isArray(e.global.jqueryDelegatedEvent)&&e.global.jqueryDelegatedEvent.length>0)}},{payloadKey:"jqueryDelegatedEventOfSpecialComponentsIsTrue",payloadDescription:"Indicate if the use jQuery with event delegation",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>{const e=t;if(e.components){const t=Object.keys(e.components);return!!(t.length>0&&!0===e.components[t[0]].jqueryDelegatedEvent)}return!1}}];class xe{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(xe,["setSemantics","getSemantics","getEnabledEventIdsByComponent"],Ce)}setSemantics(t){p.setSemantics(t)}getSemantics(t){return p.getSemantics(t)}getEnabledEventIdsByComponent(t){return p.getEnabledEventIdsByComponent(t)}}!function(t,e,n,s){var o,i=arguments.length,r=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);i>3&&r&&Object.defineProperty(e,n,r)}([l()],xe.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const Te=new xe,Ee=[{payloadKey:"IS_OVERRIDEZINDEXBASICVALUES_METHOD_CALLED",payloadDescription:"Indicate if the method overrideZIndexBasicValues of public API ZIndexManager is called",canAccept:(t,e)=>"VegaZIndexManager"===t&&"overrideZIndexBasicValues"===e,payloadValue:()=>!0},{payloadKey:"zIndexBasicValuesGreatThanTenThousand",payloadDescription:"Indicate if the basic z-index value is great than ten thousand",canAccept:(t,e)=>"VegaZIndexManager"===t&&"overrideZIndexBasicValues"===e,payloadValue:t=>t.base>1e4}];class Se{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(Se,["overrideZIndexBasicValues"],Ee)}overrideZIndexBasicValues(t){h.overrideZIndexBasicValues(t)}}!function(t,e,n,s){var o,i=arguments.length,r=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);i>3&&r&&Object.defineProperty(e,n,r)}([l()],Se.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const ke=new Se,Ae=[{payloadKey:"IS_WAITFORVEGA_METHOD_CALLED",payloadDescription:"Indicate if the method waitForVega of public API WaitForVegaHandler is called",canAccept:(t,e)=>"WaitForVegaHandler"===t&&"handle"===e,payloadValue:()=>!0}];class Re{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(Re,["handle"],Ae)}async handle(){return await Promise.all(Array.from(document.querySelectorAll("*:not(.hydrated)")).filter((t=>t.tagName.startsWith("VEGA"))).map((t=>{var e;return null===(e=t.componentOnReady)||void 0===e?void 0:e.call(t)})))}}!function(t,e,n,s){var o,i=arguments.length,r=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);i>3&&r&&Object.defineProperty(e,n,r)}([l()],Re.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const Oe=new Re,Ie=async()=>Oe.handle(),Le=[{payloadKey:"IS_LOAD_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaSkeletonLoaderController is called",canAccept:(t,e)=>"VegaSkeletonLoaderController"===t&&"load"===e,payloadValue:()=>!0},{payloadKey:"IS_UNLOAD_METHOD_CALLED",payloadDescription:"Indicate if the method unLoad of public API VegaSkeletonLoaderController is called",canAccept:(t,e)=>"VegaSkeletonLoaderController"===t&&"unLoad"===e,payloadValue:()=>!0},{payloadKey:"IS_UNLOADALL_METHOD_CALLED",payloadDescription:"Indicate if the method unLoadAll of public API VegaSkeletonLoaderController is called",canAccept:(t,e)=>"VegaSkeletonLoaderController"===t&&"unLoadAll"===e,payloadValue:()=>!0}];class Be{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(Be,["load","unLoad","unLoadAll"],Le),this.loaderMap=new Map}load({target:e,type:n="text",width:s,height:o,items:i,layout:r}){const a=Array.from(document.body.querySelectorAll(e)),l=`vega-skeleton-loader-${t()}`,c=[];return a.forEach((t=>{const e=i?i.map(this.createSkeleton):[this.createSkeleton({type:n,width:s,height:o})],a=(r?[this.wrapLayout(e,r)]:e).map((t=>(t.dataset[Be.LOADER_DATA_SET_KEY]=l,t)));c.push(...a),t.append(...a)})),this.loaderMap.set(l,c),l}unLoad(t){this.loaderMap.has(t)&&(this.loaderMap.get(t).forEach((t=>t.remove())),this.loaderMap.delete(t))}unLoadAll(){for(const t of this.loaderMap.values())t.forEach((t=>t.remove()));this.loaderMap.clear()}createSkeleton(t){const{type:e,width:n,height:s}=t,o=document.createElement("vega-skeleton");return Object.assign(o,{animated:!0,type:e,width:n,height:s}),o}wrapLayout(t,e){const n=document.createElement("vega-flex");return Object.assign(n,Object.assign({className:"vega-skeleton-loader-template-container"},e.props)),Object.assign(n.style,e.style),n.append(...t),n}}Be.LOADER_DATA_SET_KEY="vegaSkeletonLoaderKey",function(t,e,n,s){var o,i=arguments.length,r=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);i>3&&r&&Object.defineProperty(e,n,r)}([l()],Be.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const je=new Be,Ne=[{payloadKey:"IS_INIT_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaTranslation.init is called",canAccept:(t,e)=>"TranslationController"===t&&"init"===e,payloadValue:()=>!0},{payloadKey:"IS_CHANGE_LANGUAGE_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaTranslation.changeLanguage is called",canAccept:(t,e)=>"TranslationController"===t&&"changeLanguage"===e,payloadValue:()=>!0}];class _e{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(_e,["init","changeLanguage"],Ne)}get currentLanguage(){return f.currentLanguage}init(t){f.init(t)}changeLanguage(t){f.changeLanguage(t)}}!function(t,e,n,s){var o,i=arguments.length,r=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(i<3?o(r):i>3?o(e,n,r):o(e,n))||r);i>3&&r&&Object.defineProperty(e,n,r)}([l()],_e.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const Me=new _e,De=new class{constructor(){this.extensionContextMap=new WeakMap}setExtensionContext(t){t&&t.host&&this.extensionContextMap.set(t.host,t)}getExtensionContext(t){return t?this.extensionContextMap.get(t):null}};class Ve extends Y{injectRTEScopeStyles(){return""}render(t,e,n){var s;const o=this.doRender(n,t,e);return this.fallbackRegisterRef(o,t),this.appendChildren((null===(s=o.childrenContainerGetter)||void 0===s?void 0:s.call(o))||o,t,e,n),o}useRef(t){return t[Ve.REGISTER_REF_FLAG]=!0,function(e){e&&R.register(e,t)}}getDTORenderer(t){return Q.getRTERenderer(t)}getExtensionContext(t){return De.getExtensionContext(t)}appendChildren(t,e,n,s){Array.isArray(e.children)&&e.children.length&&!t.t&&(t.t=e.children.map((t=>this.renderChildren(t,n,s))).filter(q))}renderChildren(t,e,n){const s=this.getDTORenderer(t.type);if(s)return s.render(t,e,n)}fallbackRegisterRef(t,e){e[Ve.REGISTER_REF_FLAG]||!t.o||t.o.ref||(t.o.ref=this.useRef(e))}}Ve.REGISTER_REF_FLAG="__registeredRef__";class Pe{constructor(){this.extensionContext=null,this.hasCustomStylesRenderers=new Set}static registerActionHandleStrategy(t,e,n){O.register(e,t,n)}static registerActionHandlerInterceptor(t,e,n){I.register(e,t,n)}static registerFilterStylesStrategy(t,e){L.register(t,e)}prepareBeforeLoad(t){}initialExtensionAfterLoad(t){this.extensionContext=t,De.setExtensionContext(t)}destroyExtension(){}collectExtensionRendererStyles(){let t="";return this.hasCustomStylesRenderers.size>0&&this.hasCustomStylesRenderers.forEach((e=>{t+=`${e.injectRTEScopeStyles()}\n`})),t}registerNode(t,e){B.registerRTEDTOClass(t,e)}registerRenderer(t,e){Q.registerRTEDTORenderer(t,e),e instanceof Ve&&e.injectRTEScopeStyles()&&this.hasCustomStylesRenderers.add(e)}registerToolbarButtonRenderer(t,e,n){n?Q.registerRTEToolbarButtonRendererForHost(n,t,e):Q.registerRTEToolbarButtonRenderer(t,e)}registerBlockBasicStrategies(t){b.registerBlockBasicStrategies(t)}unRegisterStrategy(t,e){O.unregister(t,e)}unRegisterInterceptor(t,e,n){I.unregister(t,e,n)}registerElementToBlockDTOClassStrategy(t){g.registerElementToBlockStrategy(t)}registerElementToNodeDTOClassStrategy(t){g.registerElementToNodeStrategy(t)}getElementToNodeDTOClassStrategies(){return g.getElementToNodeStrategies()}registerAnnotationHandler(t){w.registerHandler(t)}}class He{isHidden(t){return t.sourceEditMode}getExtensionContext(t){return De.getExtensionContext(t)}renderDropdown(t,e,n,s){return t("vega-dropdown",Object.assign({trigger:"click",searchable:!1,maxWidth:"200",itemDisplayRule:"ellipsis",ref:t=>{nt.addUniqueObserverToNode(t,ot,(t=>{this.handleDropdownClick(t.detail,e)}))}},n),s)}renderDropdownListTemplate(t,e){return t("div",{slot:"items",onMouseDown:this.preventDefault,class:"rte-dropdown-list"},[t("style",{nonce:et.nonce},".rte-dropdown-list vega-dropdown-group vega-dropdown-group { padding-left: 4px }"),...e.map((e=>"children"in e?this.renderDropdownGroup(t,e):this.renderDropdownItem(t,e)))])}renderDropdownItem(t,e){return t("vega-dropdown-item",{key:e.key,itemKey:e.key,label:e.label,prefixIcon:e.icon})}renderDropdownGroup(t,e){return t("vega-dropdown-group",{key:e.key,label:e.label,divide:!1},e.children.map((e=>"children"in e?this.renderDropdownGroup(t,e):this.renderDropdownItem(t,e))))}renderButton(t,e,n){const{icon:s,label:o,showArrowIcon:i}=n,r=this.isDisabled(e);return t("vega-rich-text-editor-toolbar-button",{disabled:r,icon:s,hidden:this.isHidden(e),selected:this.isSelected(e),ref:t=>{nt.addUniqueObserverToNode(t,it,(()=>this.handleButtonClick(e)))},onMouseDown:this.preventDefault},[this.renderButtonLabel(t,e,o),i?t("vega-icon",{size:"size-8",color:r?"text-disabled":"text-secondary",style:{marginLeft:"8px"},icon:tt.getIconKey("chevron-down")}):null].filter(q))}renderButtonLabel(t,e,n){return n?t("vega-font",{variant:"font-field-label-sm",color:this.isDisabled(e)?"text-disabled":"text-primary"},n):null}isDisabled(t){return t.host.disabled}isSelected(t){return!1}preventDefault(t){t.preventDefault()}getListItemByKey(t,e){for(const n of t)if("children"in n){const t=this.getListItemByKey(n.children,e);if(t)return t}else if(n.key===e)return n;return null}}class Fe extends j{constructor(t,e){super(),this.type="INSERT_TOKEN_NODE",this.rteRange=null,this.actionHandleResult=!1,this.rteRange=t,this.token=e}}class Ke extends He{constructor(t){super(),this.tokenList=[],this.tokenList=t}render(t,e){return this.renderDropdown(t,e,{},[this.renderButton(t,e,{label:"Tokens",showArrowIcon:!0}),this.renderDropdownListTemplate(t,this.tokenList)])}isDisabled(t){const e=this.getExtensionContext(t.host);if(e){const{host:t,getSelectedNodes:n}=e,[s]=n();return s?t.disabled||!O.canHandle("INSERT_TOKEN_NODE",s.parent):t.disabled}return!1}handleButtonClick(t){}handleDropdownClick(t,e){const n=this.getListItemByKey(this.tokenList,t),{rteRange:s}=e,{startNode:o}=s;if(o&&o.parent){const t=new Fe(s,n);o.parent.apply(t),t.actionHandleResult&&this.flushEditorUI(e)}}flushEditorUI(t){const e=this.getExtensionContext(t.host);if(e){const{host:t,flushValue:n}=e;n(t.value)}}}class RTETokenNode extends N{constructor(t,e,n,s,o){super(t,n,s,o),this.type="token",this.token=e,this.text=n}static from(t,e){const n=new RTETokenNode(t.id,t.token,t.text,e);return t.annotations&&(n.annotationMap=this.generateTextAnnotationMap(t.annotations)),n}toJSON(){const t=super.toJSON();return Object.assign({id:this.id,type:this.type,text:this.text,token:this.token},t.annotations?{annotations:t.annotations}:{})}isContentEditable(){return!1}clone(t){return new RTETokenNode(this.id,this.token,this.text,t,this.annotationMap)}toHtml(){return`<span class="token" contenteditable="false" template-token-key="${this.token}" token-key="${this.token}"${super.generateAttributeString()}>${this.text}</span>`}}class $e extends Ve{doRender(t,e,n){const{id:s,token:o}=e;return t("span",Object.assign(Object.assign({key:s,"template-token-key":o,"token-key":o,contenteditable:"false",style:e.getStyles(),class:`token ${e.getClasses()}`},this.additionalAttributes(e)),{ref:this.useRef(e),onClick:t=>{t.preventDefault(),n&&!1!==n.editable&&this.handleTokenElementClick(t,e,n.host)}}),e.text)}injectRTEScopeStyles(){return"span[token-key]{padding: 0 2px; margin: 0 1px; background-color: rgba(var(--v-bg-status-info, 205,209,211))}"}handleTokenElementClick(t,e,n){t.preventDefault(),n&&n.value.apply(new y(e,void 0,!0))}additionalAttributes(t){const e=t.getCustomAttributesAnnotation();let n={wrapped:"true"};return e&&(n=Object.assign(Object.assign({},n),e.render())),n}}class ze extends He{constructor(t,e,n=""){super(),this.languageList=[],this.languageChangeCallback=null,this.selectedLanguage="",this.labelRef=null,this.handleDropdownClick=t=>{this.setSelectedLanguage(t),"function"==typeof this.languageChangeCallback&&this.languageChangeCallback(t)},this.languageList=t,this.languageChangeCallback=e,this.selectedLanguage=n}setSelectedLanguage(t){this.selectedLanguage=t,this.labelRef&&(this.labelRef.textContent=this.getLanguageLabelByKey(t))}isHidden(){return!1}render(t,e){return this.renderDropdown(t,e,{source:this.languageList},[this.renderButton(t,e,{label:this.getLanguageLabelByKey(this.selectedLanguage),showArrowIcon:!0})])}renderButtonLabel(t,e,n){return t("vega-font",{variant:"font-field-label-sm",color:this.isDisabled(e)?"text-disabled":"text-primary",ref:t=>{this.labelRef=t}},n)}handleButtonClick(t){}getLanguageLabelByKey(t){var e;const n=this.getListItemByKey(this.languageList,t);return null!==(e=null==n?void 0:n.label)&&void 0!==e?e:"Select Language"}}class Ge extends Pe{constructor(t,e){super(),this.languageToolbarButtonRenderer=null,this.languageState={selectedLanguage:"",contentMap:{}},this.languageChangeCallBack=t=>{const e=this.languageState.selectedLanguage;this.extensionContext&&e&&(this.languageState.contentMap[e]=this.getRTELatestValue(this.extensionContext.host)),this.languageState.selectedLanguage=t,this.applyLanguageContent(t,this.languageState.contentMap)},this.languageList=t,e&&(this.languageState=Object.assign(Object.assign({},this.languageState),e)),!this.languageState.selectedLanguage&&t.length>0&&(this.languageState.selectedLanguage=t[0].key)}prepareBeforeLoad(t){this.languageToolbarButtonRenderer=new ze(this.languageList,this.languageChangeCallBack,this.languageState.selectedLanguage),this.registerToolbarButtonRenderer("languages",this.languageToolbarButtonRenderer,t)}initialExtensionAfterLoad(t){super.initialExtensionAfterLoad(t);const{selectedLanguage:e,contentMap:n}=this.languageState;this.languageToolbarButtonRenderer&&this.languageToolbarButtonRenderer.setSelectedLanguage(e),n&&n[e]&&this.applyLanguageContent(this.languageState.selectedLanguage,this.languageState.contentMap)}setState(t){const{selectedLanguage:e,contentMap:n}=t;this.languageToolbarButtonRenderer&&this.languageToolbarButtonRenderer.setSelectedLanguage(e),this.languageState.selectedLanguage=e,this.languageState.contentMap=Object.assign({},n),this.applyLanguageContent(e,n)}getState(){const{selectedLanguage:t,contentMap:e}=this.languageState;return this.extensionContext&&(e[t]=this.getRTELatestValue(this.extensionContext.host)),this.languageState}applyLanguageContent(t,e){if(this.extensionContext&&e){let n=e[t];const{host:s,flushValue:o}=this.extensionContext;n=n?n instanceof v?n:v.fromJSON(n,s.sourceEditConfig):v.createEmptyContent(),s.value!==n&&o(n,!0)}}getRTELatestValue(t){var e;let n=t.value;if(this.extensionContext&&this.extensionContext.isSourceEditMode()&&t.shadowRoot){const s=t.shadowRoot.querySelector(".source-view-container vega-code-block");if(s){let o;t.sourceEditConfig&&(o={autoMatchFormat:null===(e=t.sourceEditConfig.autoMatchFormat)||void 0===e||e,filterInlineStyles:t.sourceEditConfig.filterInlineStyles}),n=v.fromHtml(s.value.code,o)}}return n}}class We extends j{constructor(t){super(),this.type="INSERT_FUNCTION_BLOCK",this.functionType=t}}class RTEFunctionBlock extends _{constructor(t){super(t),this.type="function-block",this.children=[]}static from(t,e){const n=new RTEFunctionBlock(t.id),s={customClass:["statement"]};let{annotations:o}=t;return o=o?Object.assign(Object.assign({},o),s):s,super.convertAnnotationsToMap(n.annotationMap,o),n.children=this.generateBlockChildren(t.children,e,n),n}toHtml(){return`<div class="statement">${this.children.map((t=>t instanceof M?`<div class="statementelement"${this.getFunctionContentStyle(t)}>${t.getChildrenHtml()}</div>`:t.toHtml())).join("")}</div>`}clone(e){const n=new RTEFunctionBlock(t());return n.parent=e,n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,children:this.children.map((t=>t.toJSON()))})}getFunctionContentStyle(t){const e=new D(t);let n=e.toCssText({standalone:!0});const s=t.getAnnotationByType("TEXT_STYLE");if(s&&"paragraph"===s.textStyle){const t=e.toCssText(void 0,void 0,s.renderStyle({standalone:!0}));n=n.replace(t,"").trim()}return n?` style="${n}"`:""}}class Ue extends V{handleAction(t,e){const{functionType:n}=t,s=this.getFunctionBlock(n),o=this.createNewParagraph(""),i=this.getReferenceBlock(e);i?i.parent.apply(new P(i,s,o)):e.apply(new H([s,o])),o&&(t.nextFocusNode=o.children[0])}getFunctionBlock(e){const n=t();return RTEFunctionBlock.from({id:n,type:"function-block",children:[{id:`${n}-1`,type:"logic-control-block",statementText:e.toUpperCase()},{id:`${n}-2`,annotations:{customClass:["statementelement"]},type:"paragraph",nodes:[{id:`${n}-2-1`,type:"text",text:" "}]},{id:`${n}-3`,type:"logic-control-block",statementText:"SHOW"},{id:`${n}-4`,annotations:{customClass:["statementelement"]},type:"paragraph",nodes:[{id:`${n}-4-1`,type:"text",text:" "}]}]})}getReferenceBlock(t){if(!(t instanceof v)){const e=t.parent;return e instanceof RTEFunctionBlock?e:t}}}class RTELogicControlNode extends F{constructor(t,e,n){super(t),this.type="logic-control-node",this.text="",this.text=e,this.parent=n}clone(){return new RTELogicControlNode(this.id,this.text,this.parent)}toHtml(){return this.text}toJSON(){return{id:this.id,type:this.type,text:this.text}}getRangeEndOffset(){return 1}getRangeContainer(){const t=R.getDOMByEntity(this);if(t)return t.parentElement}isContentEditable(){return!1}}class RTELogicControlBlock extends _{constructor(t,e,n){super(t),this.type="logic-control-block",this.children=[],this.statementText="",this.statementText=e,this.children=[new RTELogicControlNode(`${t}-node-1`,e,this)],n&&(this.parent=n)}static from(t){return new RTELogicControlBlock(t.id,t.statementText)}isNotEmpty(){return!0}getLastNode(){return this.children[this.children.length-1]}toHtml(){return`<div class='statementsyntax' contenteditable='false'>${this.statementText}</div>`}clone(t){return new RTELogicControlBlock(this.id,this.statementText,t)}toJSON(){return{id:this.id,type:this.type,statementText:this.statementText}}}class Ze extends He{render(t,e){return this.renderDropdown(t,e,{},[this.renderButton(t,e,{label:"Functions",showArrowIcon:!0}),this.renderDropdownListTemplate(t,Ze.FUNCTION_LIST)])}isDisabled(t){const e=this.getExtensionContext(t.host);if(e){const{host:t,getSelectedNodes:n}=e,s=n()[0];let o=!0;return s&&(o=O.canHandle("INSERT_FUNCTION_BLOCK",s.parent)),t.disabled||!o}return!1}handleButtonClick(){throw new Error("Method not implemented.")}handleDropdownClick(t,e){if(e){const n=this.getExtensionContext(e.host);if(n){const{host:e,getSelectedNodes:s}=n,o=s()[0],i=new We(t);o?o.parent&&o.parent.apply(i):e.value.apply(i),i.nextFocusNode&&e.value.apply(new y(i.nextFocusNode,1))}}}}Ze.FUNCTION_LIST=[{key:"IF",label:"Conditional"},{key:"FOREACH",label:"Foreach"}];class Je extends Ve{doRender(t,e){return t("div",{key:e.id,class:"statementsyntax",ref:this.useRef(e)},t("span",{key:`${e.id}-1`,contenteditable:"false",ref:this.useRef(e.children[0])},e.statementText))}}class Xe extends m{constructor(){super(...arguments),this.blockClassName="statementsyntax"}canHandle(t,e){const n=t[e];return n&&n.nodeType===Node.ELEMENT_NODE&&n.classList.contains(this.blockClassName)&&this.isFunctionBlockChild(n)?1:0}handle(e){const n=e[0];return RTELogicControlBlock.from({id:t(),type:"logic-control-block",statementText:n.innerText})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isFunctionBlockChild(t){return!(!t.parentElement||!t.parentElement.classList.contains("statement"))}}class qe extends Ve{doRender(t,e){return t("div",{key:e.id,class:this.getElementClassName(e),ref:this.useRef(e)})}injectRTEScopeStyles(){return"div.statement{padding:2px 4px;background:rgba(var(--v-bg-accent3-secondary, 255, 239, 200));border:1px solid rgba(var(--v-bg-accent3-primary, 255, 220, 131));border-radius:4px;display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;gap:4px}div.statement .statementsyntax{padding:3px 0;line-height:22px}.rich-text-content div.statement .statementsyntax,.rich-text-content div.statement .statementelement{display:inline-block}div.statement+div.statement{margin-top:2px}div.statement .statementsyntax span{color:rgb(38, 42, 255);font-weight:bold}div.statement .statementelement{padding:2px 4px;background:rgba(var(--v-bg-secondary, 245, 247, 247));border:1px solid rgba(var(--v-border-color-input-field, 171, 198, 216));border-radius:4px;margin:0;min-width:8px}"}getElementClassName(t){let e=t.getClasses();return e.indexOf("statement")<0&&(e="statement "+e),e.trim()}}class Qe{}class Ye extends Qe{canIntercept(t,e){return e.parent&&e.parent instanceof RTEFunctionBlock}intercept(t,e,n){const s=new x(n.children[0],0);s.isFlushable=!0,n.parent.apply(s)}}class tn extends V{handleAction(t,e){const n=this.createNewParagraph("");n&&(e.parent.apply(new P(e,n)),t.newBlock=n,this.focusToNextLine(n))}focusToNextLine(t){const e=this.getRootContent(t);e&&e.apply(new y(t.children[0],1))}}class en extends j{constructor(t,e,n){super(),this.type="PASTE_PLAIN_TEXT",this.blocksToBeInserted=t,this.startNode=e,this.startOffset=n}}class nn extends Ye{intercept(t,e,n){const{blocksToBeInserted:s,rteRange:o}=e;let{startNode:i,startOffset:r}=e;o&&(i=o.startNode,r=o.startOffset);const a=new en(s,i,r);n.apply(a)}}class sn extends V{handleAction(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:o}=t;if(s instanceof N){const t=n.flatMap((t=>t instanceof M?(this.copyLinkGroupAnnotations(e.annotationMap,t.annotationMap),t.children):[]));t.length>0&&(e.apply(o>0?new P(s,...t):new K(s,...t)),this.focusToNextLine(t[t.length-1],t[t.length-1].getRangeEndOffset()))}}focusToNextLine(t,e){const n=this.getRootContent(t);n&&n.apply(new y(t,e))}copyLinkGroupAnnotations(t,e){if(e&&e.has($.LINK_GROUP)){const n=e.get($.LINK_GROUP);t.has($.LINK_GROUP)?n.linkGroups.forEach(((e,n)=>{t.get($.LINK_GROUP).linkGroups.set(n,e)})):t.set($.LINK_GROUP,e.get($.LINK_GROUP))}}}const on=new Xe,rn=new class extends Xe{constructor(){super(...arguments),this.blockClassName="statementelement"}handle(e,n){const s=w.generate(M,e[0]),o=Array.from(e[0].childNodes);return M.from({id:t(),type:"paragraph",annotations:Object.assign({customClass:[this.blockClassName]},s),nodes:this.generateChildNodes(o,void 0,n)})}},an=new class extends C{canHandle(t,e){const n=t[e];return n&&"DIV"===n.tagName&&n.classList.contains("statement")&&n.childNodes.length&&n.querySelector(".statementsyntax")?1:0}handle(){return RTEFunctionBlock.from({id:t(),type:"function-block",annotations:{customClass:["statement"]},children:[]})}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}};class ln extends Pe{constructor(){super(),this.toolbarButtonRenderer=new Ze,this.registerBlockBasicStrategies(RTELogicControlBlock.name),this.registerBlockBasicStrategies(RTEFunctionBlock.name),this.preventFunctionBlockDefaultInsertNewParagraph(),this.registerNode("logic-control-block",RTELogicControlBlock),this.registerRenderer("logic-control-block",new Je),this.registerNode("function-block",RTEFunctionBlock),this.registerRenderer("function-block",new qe),this.registerToolbarButtonRenderer("functions",this.toolbarButtonRenderer),this.registerElementToBlockDTOClassStrategy(on),this.registerElementToBlockDTOClassStrategy(rn),this.registerElementToBlockDTOClassStrategy(an)}preventFunctionBlockDefaultInsertNewParagraph(){this.unRegisterStrategy(z.INSERT_NEW_PARAGRAPH,RTELogicControlBlock.name),this.unRegisterStrategy(z.APPEND_CHILDREN,RTEFunctionBlock.name),this.unRegisterStrategy(z.INSERT_CHILDREN_AFTER,RTEFunctionBlock.name),this.unRegisterStrategy(z.INSERT_CHILDREN_BEFORE,RTEFunctionBlock.name),this.unRegisterStrategy(z.PASTE_CONTENT,RTELogicControlBlock.name),Pe.registerActionHandleStrategy(RTEFunctionBlock.name,z.INSERT_NEW_PARAGRAPH,new tn)}}(()=>{const t=new Ue;Pe.registerActionHandleStrategy(v.name,"INSERT_FUNCTION_BLOCK",t),Pe.registerActionHandleStrategy(M.name,"INSERT_FUNCTION_BLOCK",t),Pe.registerActionHandleStrategy(T.name,"INSERT_FUNCTION_BLOCK",t),Pe.registerActionHandleStrategy(RTELogicControlBlock.name,"INSERT_FUNCTION_BLOCK",t),Pe.registerActionHandleStrategy(M.name,"PASTE_PLAIN_TEXT",new sn),Pe.registerActionHandlerInterceptor(M.name,z.INSERT_NEW_PARAGRAPH,new Ye),Pe.registerActionHandlerInterceptor(M.name,z.PASTE_CONTENT,new nn)})();class cn extends j{constructor(t){super(),this.isFlushable=!0,this.type="DELETE_TABLE_BLOCK",this.tableBlock=t}}class hn extends G{constructor(){super(...arguments),this.type=lt.CAPTION}static getDefaultStyles(){return{padding:"8px",border:"1px solid #ddd",borderBottom:"none",position:"relative",textAlign:"center",minHeight:"22px"}}clone(){return new hn}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--extension-table-caption"}renderStyle(t){return(null==t?void 0:t.standalone)?Object.assign(Object.assign({},hn.getDefaultStyles()),{backgroundColor:this.getCaptionBackgroundColor()}):null}toJSON(){return{caption:!0}}getCaptionBackgroundColor(){return ce.isDarkMode()?ct.dark:ct.light}}class RTETableCaptionBlock extends _{constructor(t,e){super(t),this.type="table-caption";const{autoMatchFormat:n}=e||{autoMatchFormat:!0};n&&this.annotationMap.set(lt.CAPTION,new hn)}static from(t,e){const n=new RTETableCaptionBlock(t.id,e),s=t.annotations||{},{caption:o}=s,i=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]])}return n}(s,["caption"]);return o&&n.annotationMap.set(lt.CAPTION,new hn),super.convertAnnotationsToMap(n.annotationMap,Object.assign({},i)),n.children=super.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTETableCaptionBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.isNotEmpty()))}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<caption${super.generateAttributeString(t)}>${e}</caption>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}O.register(z.INSERT_CHILDREN_BEFORE,RTETableCaptionBlock.name,new E),O.register(z.PASTE_CONTENT,RTETableCaptionBlock.name,new S);class dn extends j{constructor(t){super(),this.type="TOGGLE_TABLE_CAPTION",this.isFlushable=!0,this.shouldEnable=t}}class un extends ht{canHandle(t){return t[0]===dt.CAPTION}execute(t,e,n){const s="rte-table-caption"===t[1],o=new dn(s),i=n.getCaption();if(s){const t=i&&i.isNotEmpty()?i:this.createCaptionBlock(null==i?void 0:i.id);i&&t===i||n.setCaption(t),o.nextFocusNode=t.getLastNode()}else i&&(n.setCaption(null),o.nextFocusNode=n.getFirstNode());this.syncCursorPosition(n,o.nextFocusNode)}syncCursorPosition(t,e){super.syncCursorPosition(t,e)}createCaptionBlock(e){const n={id:null!=e?e:t(),type:"table-caption",children:[{id:t(),type:"paragraph",nodes:[{id:t(),type:"text",text:""}]}]};return RTETableCaptionBlock.from(n)}}class pn{static generateTablePropertiesForm(t){const e=t.annotationMap.get(lt.TABLE);let n={borderStyle:"none",borderColor:"",borderWidth:"",backgroundColor:"",width:"",height:"",textAlign:"center"};if(e){const t=e.toJSON().table,{style:s="none",color:o="",width:i=""}=t.border||{style:"none",color:"",width:""};n={backgroundColor:t.backgroundColor||"",width:t.width||"",height:t.height||"",textAlign:t.alignment,borderStyle:s,borderColor:o,borderWidth:i}}return n}updateCursorPosition(t,e){t&&e&&t.host.value.apply(new y(e,0))}}class fn extends W{constructor(t){super(),this.isFlushable=!0;const{textAlign:e,width:n,borderWidth:s,borderColor:o,borderStyle:i,height:r}=t,a=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]])}return n}(t,["textAlign","width","borderWidth","borderColor","borderStyle","height"]);this.tableProperties=Object.assign(Object.assign({},a),{alignment:e,border:{style:i,color:o,width:s?de(s):""},width:n?de(n):"",height:r?de(r):""})}toAnnotation(){return new ut(this.tableProperties)}}class bn extends pn{handle(t,e,n,s){e.apply(new fn(n)),this.updateCursorPosition(t,s)}}class gn extends pn{handle(t,e,n,s){t&&t.host&&(t.flushValue(t.host.value),this.updateCursorPosition(t,s))}}class wn extends pn{handle(t,e,n){const s=new fn(n);s.isFlushable=!1,e.apply(s)}}class yn extends W{constructor(t,e){super(),this.isFlushable=!0,this.cellAnnotation=t,this.originAnnotation=e}toAnnotation(){return this.updateOriginAnnotation(),this.originAnnotation}updateOriginAnnotation(){Object.keys(this.cellAnnotation).forEach((t=>{this.originAnnotation[t]=this.cellAnnotation[t]}))}}class vn extends yn{constructor(t,e){super(t,e),this.isFlushable=!0}toAnnotation(){return this.updateOriginAnnotation(),this.originAnnotation}}var mn=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]])}return n};class Cn{static getStyleCollectionFromCell(t){return t.reduce(((t,e)=>{const n=e.getAnnotationByType(lt.CELL);if(t[e.id]={},n){const s=n.toJSON().tableCell,{border:o}=s,i=mn(s,["border"]),r={};o&&(r.borderStyle=o.style,r.borderColor=o.color,r.borderWidth=o.width),t[e.id]=ue(Object.assign(Object.assign({},i),r))}return t}),{})}static convertStyleMapToFormField(t){const e={};for(const n in t){const s=t[n];for(const t in s)e[t]?e[t].push(s[t]):e[t]=[s[t]]}const n=Object.keys(t).length,s={};for(const t in e){const o=e[t],i=new Set(o);o.length===n&&1===i.size&&(s[t]=o[0])}return s}applyProperties(t,e,n){t.tableSelection.getSelectedCells().forEach((t=>{const s=e[t.id];if(s){const e=this.convertToVegaTableCellAnnotation(Object.assign({},s));this.applyAnnotation(t,e,n)}}))}updateCursorPosition(t,e){t&&e&&t.host.value.apply(new y(e,0))}convertToVegaTableCellAnnotation(t){const{borderStyle:e,borderWidth:n,borderColor:s}=t,o=mn(t,["borderStyle","borderWidth","borderColor"]),i=ue({style:e,width:n?de(n):"",color:s});return ue(Object.assign(Object.assign({},o),{backgroundColor:o.backgroundColor||"",padding:o.padding?de(o.padding):"",width:o.width?de(o.width):"",height:o.height?de(o.height):"",verticalAlign:o.verticalAlign||"",textAlign:o.textAlign||"",border:i}))}applyAnnotation(t,e,n){const s=t.getAnnotationByType(lt.CELL)||new pt({},!1),o=t instanceof ft?new vn(e,s):new yn(e,s);o.isFlushable=n,t.apply(o)}}class xn extends Cn{handle(t,e,n){t&&t.host&&(t.flushValue(t.host.value),this.updateCursorPosition(t,n))}}class Tn extends Cn{handle(t,e){this.applyProperties(t,e,!1)}}class En extends Cn{handle(t,e,n){this.applyProperties(t,e,!0),this.updateCursorPosition(t,n)}}class Sn{constructor(t){this.renderContext=t}getTableExtensionContext(){return this.renderContext?De.getExtensionContext(this.renderContext.host):null}}class kn extends Sn{constructor(t,e){super(e),this.popoverCloseType="none",this.tablePropertiesHandlerMap={save:new gn,cancel:new bn,change:new wn},this.cellPropertiesHandlerMap={save:new xn,cancel:new En,change:new Tn},this.handleTablePropertiesUpdate=t=>{const e=t.type.replace("vega","").toLowerCase();this.popoverCloseType=e,"change"!==e&&this.hide();const n=this.getTableExtensionContext();n&&this.tablePropertiesHandlerMap[e].handle(n,this.currentTableBlock,t.detail,this.currentFocusNode),"change"===e&&this.popoverRef.show(!0)},this.handleCellPropertiesUpdate=t=>{const e=t.type.replace("vega","").toLowerCase();this.popoverCloseType=e,"change"!==e&&this.hide();const n=this.getTableExtensionContext();n&&this.cellPropertiesHandlerMap[e].handle(n,t.detail,this.currentFocusNode),"change"===e&&this.popoverRef.show(!0)},this.tableColorSchema=t}destroy(){this.selectionAnchorRef&&this.selectionAnchorRef.parentNode&&(nt.removeUniqueObserverFromNode(this.selectionAnchorRef,ie),this.selectionAnchorRef.parentNode.removeChild(this.selectionAnchorRef),this.selectionAnchorRef=null)}async show(t){let e=this.getTableRef();const n=this.getTableExtensionContext();let s=[];if(n&&(s=n.tableSelection.getSelectedCells()),t===dt.CELL&&s.length>1){const t=this.getOrCreateSelectionAnchor(s,e);t&&(e=t)}else t===dt.CELL&&1===s.length&&(e=R.getDOMByEntity(s[0]));this.updateContent(t),this.storeCurrentFocusNode(),le.call(st.getSubject(this.popoverRef,re),e),await this.popoverRef.show()}async hide(){await this.popoverRef.hide()}reTarget(t,e){this.getTableRef=e,this.currentTableBlock=t}render(){const t=he();if(t){const e=t.createElement("vega-popover");e.trigger="click",e.isScreenPosition=!0,e.className="rte-table-dynamic-popover",nt.addUniqueObserverToNode(e,rt,(()=>{const t=this.getTableExtensionContext();"change"===this.popoverCloseType&&t&&t.flushValue(t.host.value)}));const n=t.createElement("div");n.setAttribute("slot","popover"),n.className="rte-table-dynamic-popover-content";const s=t.createElement("vega-rich-text-table-properties");s.colors=this.tableColorSchema,s.type=dt.TABLE,s.setAttribute("type",dt.TABLE),s.addEventListener("vegaCancel",this.handleTablePropertiesUpdate),s.addEventListener("vegaChange",this.handleTablePropertiesUpdate),s.addEventListener("vegaSave",this.handleTablePropertiesUpdate);const o=t.createElement("vega-rich-text-table-properties");return o.colors=this.tableColorSchema,o.type=dt.CELL,o.setAttribute("type",dt.CELL),o.addEventListener("vegaCancel",this.handleCellPropertiesUpdate),o.addEventListener("vegaChange",this.handleCellPropertiesUpdate),o.addEventListener("vegaSave",this.handleCellPropertiesUpdate),n.appendChild(s),n.appendChild(o),e.appendChild(n),this.popoverRef=e,this.tablePropertiesFormRef=s,this.cellPropertiesFormRef=o,e}}updateContent(t){this.popoverCloseType="none";const e=this.getTableExtensionContext();"TABLE"===t?(this.tablePropertiesFormRef.classList.remove("vega-hidden"),this.cellPropertiesFormRef.classList.add("vega-hidden"),this.tablePropertiesFormRef.defaultValue=pn.generateTablePropertiesForm(this.currentTableBlock)):"CELL"===t&&(this.cellPropertiesFormRef.classList.remove("vega-hidden"),this.tablePropertiesFormRef.classList.add("vega-hidden"),e&&(this.cellPropertiesFormRef.styleMap=Cn.getStyleCollectionFromCell(e.tableSelection.getSelectedCells())),this.cellPropertiesFormRef.defaultValue=Cn.convertStyleMapToFormField(this.cellPropertiesFormRef.styleMap)),e&&e.getSelection().removeAllRanges()}storeCurrentFocusNode(){const t=this.getTableExtensionContext();t&&(this.currentFocusNode=t.getSelectedNodes()[0])}getOrCreateSelectionAnchor(t,e){const n=he();if(n&&e){const s=e.closest(".rich-text-content"),o=s.getBoundingClientRect();let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;t.map((t=>R.getDOMByEntity(t))).filter(q).forEach((t=>{const e=t.getBoundingClientRect();i=Math.min(i,e.left-o.left),r=Math.max(r,e.right-o.left),a=Math.min(a,e.top-o.top),l=Math.max(l,e.bottom-o.top)}));const c=r-i,h=l-a;return this.selectionAnchorRef=s.querySelector(".rte-table-selection-popover-anchor"),this.selectionAnchorRef||(this.selectionAnchorRef=n.createElement("div"),this.selectionAnchorRef.className="rte-table-selection-popover-anchor",this.selectionAnchorRef.style.position="absolute",this.selectionAnchorRef.style.pointerEvents="none",s.appendChild(this.selectionAnchorRef),nt.addUniqueObserverToNode(this.selectionAnchorRef,ie,(()=>{this.destroy()}))),this.selectionAnchorRef.style.left=`${i}px`,this.selectionAnchorRef.style.top=`${a}px`,this.selectionAnchorRef.style.width=`${c}px`,this.selectionAnchorRef.style.height=`${h}px`,this.selectionAnchorRef}}}class An extends Sn{constructor(t){super(t),this.settingHandlers=[new bt,new un,new gt,new wt,new yt],this.handleTableClick=(t,e,n)=>{const s=t.target.closest("table");s===n()&&(t.stopPropagation(),this.reTarget(e,n),this.tableDynamicPopover.hide(),le.call(st.getSubject(this.popoverRef,re),s),this.popoverRef.show(!0))},this.syncSelectedCells=()=>{this.tableSettingRef&&(this.tableSettingRef.selectedCells=this.getTableSelectedCells())},this.handleSettingMenuClick=t=>{const e=this.settingHandlers.find((e=>e.canHandle(t.detail)));if(e){const n=this.getTableExtensionContext();n&&e.execute(t.detail,n,this.tableBlock),t.detail[0]===dt.CAPTION&&this.updateTableSettingCaption()}t.detail[0]!==dt.TABLE&&t.detail[0]!==dt.CELL||(this.popoverRef.hide(),this.tableDynamicPopover.show(t.detail[0]))},this.handleTableSettingPopoverShow=()=>{this.syncSelectedCells()},this.tableDynamicPopover=new kn(vt.getTableColors(),t)}destroy(){this.tableDynamicPopover.destroy(),this.popoverContainer&&this.popoverContainer.remove()}render(){const t=he();if(t&&this.renderContext){this.popoverContainer=t.createElement("div"),this.renderContext.host.appendChild(this.popoverContainer);const e=this.tableDynamicPopover.render(),n=t.createElement("vega-popover");n.trigger="click",n.isScreenPosition=!0,n.className="rte-table-setting-popover",nt.addUniqueObserverToNode(n,at,this.handleTableSettingPopoverShow);const s=t.createElement("div");s.setAttribute("slot","popover");const o=t.createElement("vega-rich-text-table-setting");o.addEventListener("vegaClick",this.handleSettingMenuClick),s.appendChild(o),n.appendChild(s),this.popoverContainer.appendChild(n),this.popoverContainer.appendChild(e),this.popoverRef=n,this.tableSettingRef=o}}updateTableSettingCaption(){const t=this.tableBlock.hasCaption();this.tableSettingRef&&this.tableSettingRef.hasCaption!==t&&(this.tableSettingRef.hasCaption=t)}reTarget(t,e){this.tableSettingRef&&(this.tableBlock=t,this.tableSettingRef.target=e(),this.tableSettingRef.selectedCells=this.getTableSelectedCells(),this.tableDynamicPopover.reTarget(t,e))}getTableSelectedCells(){let t=[];const e=this.getTableExtensionContext();if(e&&e.tableSelection){const{tableSelection:n}=e;t=n.getSelectedCells()}return t}}class Rn extends Ve{doRender(t,e,n){let s;const o=this.renderTable(t,e,(t=>s=t));this.renderTableToolbar(n);const i=e.getAnnotationByType(lt.TABLE),r=n.editable?[t("vega-rich-text-table-selection-widget",{onVegaRemove:t=>{t.stopPropagation(),this.handleTableRemove(e,s)},onClick:t=>{this.tableToolbar&&this.tableToolbar.handleTableClick(t,e,(()=>s))},onMouseLeave:()=>{this.tableToolbar&&this.tableToolbar.syncSelectedCells()}},[t("div",{contentEditable:!0,ref:this.useRef(e)},[o])])]:[o],a={};if(i){const t=i.renderStyle();a.width=t.width,a.margin=t.margin}const l=t("div",{class:"v-rte--extension-table-container",style:Object.assign({},a)},r);return l.childrenContainerGetter=()=>o,l}destroy(){this.destroyTableToolbar()}injectRTEScopeStyles(){return".v-rte--extension-table-container{display:table}table.v-rte--extension-table{border-collapse:collapse}table.v-rte--extension-table th,table.v-rte--extension-table td{border:1px solid #ddd;padding:12px;text-align:left;vertical-align:middle;min-width:55px;box-sizing:border-box;position:relative}table.v-rte--extension-table th{background-color:#f2f2f2}.rte-table-setting-popover,.rte-table-dynamic-popover{display:block}table.v-rte--extension-table .v-rte-table-cell-focused::after,table.v-rte--extension-table .v-rte-table-cell-selected::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;background-color:rgba(158, 207, 250, 0.3)}table.v-rte--extension-table:has(.v-rte-table-cell-selected){caret-color:transparent}table.v-rte--extension-table:has(.v-rte-table-cell-selected) ::selection{background-color:transparent}table.v-rte--extension-table:has(.v-rte-table-cell-selected) ::-moz-selection{background-color:transparent}.v-rte--extension-table-caption{padding:8px;border:1px solid #ddd;border-bottom:none;background-color:rgba(var(--v-bg-table-header, 24, 24, 48));position:relative;display:table-caption;caption-side:top;min-height:22px;text-align:center;word-break:break-word;overflow-wrap:break-word}.v-rte--extension-table-caption.showPlaceholder::before{position:absolute;left:0;right:0;content:attr(data-placeholder);font-family:'Inter', sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1));text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"}renderTable(t,e,n){var s;return t("table",Object.assign(Object.assign({key:e.id},null===(s=e.getCustomAttributesAnnotation())||void 0===s?void 0:s.render()),{style:e.getStyles(),class:e.getClasses(),ref:t=>{this.useRef(e)(t),n(t)}}))}handleTableRemove(t,e){t.parent.apply(new cn(t)),this.destroySelectionAnchor(e)}destroySelectionAnchor(t){const e=t.closest(".rich-text-content");if(e){const t=e.querySelector(".rte-table-selection-popover-anchor");t&&oe.notify(st.getSubject(t,ie),{host:t})}}renderTableToolbar(t){t.editable?this.tableToolbar||(this.tableToolbar=new An(t),this.tableToolbar.render()):this.destroyTableToolbar()}destroyTableToolbar(){var t;null===(t=this.tableToolbar)||void 0===t||t.destroy(),this.tableToolbar=null}}class On extends Ve{doRender(t,e){return t("thead",{key:e.id,ref:this.useRef(e)})}}class In extends Ve{doRender(t,e){return t("tr",{key:e.id,ref:this.useRef(e)})}}class Ln extends Ve{doRender(t,e,n){return this.renderByCellType(t,e,n,"td")}renderByCellType(t,e,n,s){var o;return t(s,Object.assign(Object.assign(Object.assign({key:`${e.id}-${s}`,ref:this.useRef(e)},null===(o=e.getCustomAttributesAnnotation())||void 0===o?void 0:o.render()),{style:e.getStyles(n),class:e.getClasses()}),n.editable?this.onSelectionListeners(e,n):void 0))}onSelectionListeners(t,e){return{onMouseDown:t=>{const n=o(t.target,"table"),s=o(t.currentTarget,"table")===n,i=t.target.closest("td, th");if(s&&i){const t=this.getExtensionContext(e.host);t&&t.tableSelection.focusCell(i)}},onMouseMove:n=>{n.stopPropagation(),n.preventDefault();const s=this.getExtensionContext(e.host);s&&s.tableSelection.dragOver(t)},onMouseUp:()=>{const t=this.getExtensionContext(e.host);t&&t.tableSelection.endDrag()}}}}class Bn extends Ve{doRender(t,e){return t("tbody",{key:e.id,ref:this.useRef(e)})}}class jn extends Ln{doRender(t,e,n){return super.renderByCellType(t,e,n,"th")}}class Nn extends j{constructor(t,e){super(),this.type="INSERT_TABLE_BLOCK",this.rowCount=t,this.columnCount=e}}class _n extends Sn{constructor(){super(...arguments),this.hoveredRows=1,this.hoveredCols=1}render(t,e){return t("vega-popover",{trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,ref:t=>{t&&(this.tablePickerPopoverRef=t,nt.addUniqueObserverToNode(t,at,(()=>{this.resetPicker()})))}},[t("div",{slot:"popover"},[this.generatePickerStyles(t),this.generateTableSizeGrid(t)]),t("div",{slot:"popover-content"},e)])}generateTableSizeGrid(t){const e=[];for(let n=1;n<=10;n++)for(let s=1;s<=10;s++)e.push(t("button",{class:"rte-table-picker__cell","data-row":n,"data-col":s,onMouseenter:this.handlePickerCellHover.bind(this,n,s),onClick:this.handlePickerClick.bind(this,n,s)},[]));return t("div",{class:"rte-table-picker"},[t("div",{class:"rte-table-picker__grid",ref:t=>{t&&(this.tablePickerGridRef=t)},style:{gridTemplateColumns:"repeat(10, 16px)",gridTemplateRows:"repeat(10, 16px)"}},e),t("div",{class:"rte-table-picker__hint"},t("vega-hint",{ref:t=>{t&&(this.selectedHintRef=t)}},[`${this.hoveredRows} × ${this.hoveredCols}`]))])}generatePickerStyles(t){return t("style",{},["\n.rte-table-picker__grid { display: grid; gap: 2px; }\n.rte-table-picker__cell {\n box-sizing: border-box;\n border: 1px solid #ccc;\n background-color: transparent;\n cursor: pointer;\n}\n.rte-table-picker__cell:hover {\n background-color: #cae1fc;\n}\n.rte-table-picker__cell.active {\n background-color: #cae1fc;\n}\n.rte-table-picker__hint {\n text-align: center;\n}\n "])}createTable(t,e){const n=this.getTableExtensionContext();if(n){const{host:s,getSelectedNodes:o}=n,i=o()[0],r=new Nn(t,e);i?i.parent&&i.parent.apply(r):s.value.apply(r),r.nextFocusNode&&s.value.apply(new y(r.nextFocusNode,1))}}handlePickerClick(t,e){this.createTable(t,e),this.tablePickerPopoverRef.hide()}handlePickerCellHover(t,e){this.hoveredRows=t,this.hoveredCols=e,Array.from(this.tablePickerGridRef.children).forEach((t=>{const e=Number(t.dataset.row),n=Number(t.dataset.col);e<=this.hoveredRows&&n<=this.hoveredCols?t.classList.add("active"):t.classList.remove("active")})),this.selectedHintRef.textContent=`${this.hoveredRows} × ${this.hoveredCols}`}resetPicker(){this.handlePickerCellHover(1,1)}}class Mn extends He{render(t,e){return new _n(e).render(t,super.renderButton(t,e,{showArrowIcon:!0,icon:"rte-table"}))}isDisabled(t){let e=super.isDisabled(t);const n=this.getExtensionContext(t.host);if(n){const{host:t,getSelectedNodes:s}=n,o=s()[0];let i=!0;o&&(i=O.canHandle("INSERT_TABLE_BLOCK",o.parent)&&O.canHandle(z.INSERT_CHILDREN_AFTER,o.parent.parent)),e=t.disabled||!i}return e}handleButtonClick(){}handleDropdownClick(){}}tt.register({"rte-table":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M48 264V160H232V264H48zm0 48H232V432H64c-8.8 0-16-7.2-16-16V312zM280 432V312H464V416c0 8.8-7.2 16-16 16H280zM464 264H280V160H464V264zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"/></svg>'}});class Dn extends V{handleAction(t,e){const n=this.createTableBlock(t.rowCount,t.columnCount),s=super.createNewParagraph(""),o=this.getReferenceBlock(e);o?o.parent.apply(new P(o,n,s)):e.apply(new H([n,s])),t.nextFocusNode=n.getFirstNode()}createTableBlock(e,n){const s=Math.max(e,1),o=Math.max(n,1);return mt.from({id:t(),type:"table-block",children:[Ct(s,o)]})}getReferenceBlock(t){if(!(t instanceof v))return t}}class Vn extends Qe{canIntercept(t,e){const n=e.parent;return n instanceof xt&&1===n.children.length&&0===t.startOffset}intercept(){}}class Pn extends V{handleAction(t){const e=t.tableBlock,n=e.parent,s=super.getRootContent(e),o=super.createNewParagraph("");n.apply(new P(e,o)),n.apply(new U(e)),s&&s.apply(new y(o.getLastNode()))}}class Hn extends Qe{canIntercept(t,e){return t.entityToBeRemoved&&1===e.children.length}intercept(e,n,s){if(!(n.entityToBeRemoved instanceof M)){const e=M.from({id:t(),type:"paragraph",nodes:[{id:t(),type:"text",text:""}]});return s.children=[],void s.apply(new H([e]))}n.entityToBeRemoved.apply(new H([new N(t(),"",n.entityToBeRemoved)]))}}class Fn extends Ve{doRender(t,e){return t("caption",{key:e.id,ref:this.useRef(e),style:e.getStyles(),class:[e.getClasses(),e.isNotEmpty()?null:"showPlaceholder"].filter(q).join(" "),"data-placeholder":"Enter table caption"})}}class Kn extends V{getRowsMaxCellCount(t){let e=0;for(const n of t){let t=0;for(const e of n.children)t+=e.colSpan;e=Math.max(e,t)}return e}getRowCellStartCols(t){const e=this.getRowsMaxCellCount(t),n=new Array(t.length),s=new Array(e).fill(0);for(let e=0;e<t.length;e++){const o=t[e].children,i=new Array(o.length);let r=0;for(let t=0;t<o.length;t++){const e=o[t];for(;r<s.length&&s[r]>0;)r++;i[t]=r;const n=Math.max(e.colSpan,Kn.DEFAULT_CELLSPAN);if(e.rowSpan>Kn.DEFAULT_CELLSPAN)for(let t=0;t<n;t++){const n=r+t;n<s.length&&(s[n]=Math.max(s[n],e.rowSpan))}r+=n}n[e]=i;for(let t=0;t<s.length;t++)s[t]>0&&s[t]--}return n}updateCellSpan(t,e,n){const s=t.getCustomAttributesAnnotation();if(n<=Kn.DEFAULT_CELLSPAN){if(s){const n=s.render();delete n[e],t.annotationMap.set(Z.CUSTOM_ATTRIBUTE,new J(n))}}else{const o=s?s.render():{};o[e]=n.toString(),t.annotationMap.set(Z.CUSTOM_ATTRIBUTE,new J(o))}}insertMovedCells(t,e,n){t.forEach(((t,s)=>{const o=e[s];if(o){const e=n[s]||[];t.sort(((t,e)=>t.logicalStartCol===e.logicalStartCol?e.cellIndex-t.cellIndex:e.logicalStartCol-t.logicalStartCol)),t.forEach((t=>{const{cell:n,logicalStartCol:s}=t;if(0===o.children.length)return o.apply(new H([n])),void(e[0]=s);const i=e.findIndex((t=>t>=s));-1===i?(o.apply(new P(o.children[o.children.length-1],n)),e.push(s)):0===i?(o.apply(new K(o.children[0],n)),e.unshift(s)):(o.apply(new K(o.children[i],n)),e.splice(i,0,s))}))}}))}splitRowsBySection(t){const e=[],n=[];return t.forEach((t=>{t.parent instanceof Tt?e.push(t):n.push(t)})),[e,n]}buildSelectedIndices(t,e){return new Set(t.map((t=>e.indexOf(t))).filter((t=>t>=0)))}intersectsRemovalRange(t,e,n,s){return t<=s&&e>=n}countRemovedRows(t,e,n){let s=0;for(let o=t;o<=e;o++)n.has(o)&&s++;return s}getHeadCellLength(t){let e=0;for(let n=0;n<t.children.length;n++){const s=t.children[n];if(!(s instanceof ft))break;e+=s.colSpan}return e}getTheStartSpanCell(t,e,n,s){const o={rowIndex:n};for(let i=n;i>=0;i--){const n=e[i];if(n.includes(s)){o.cell=t[i].children[n.indexOf(s)],o.rowIndex=i;break}}return o}getDefaultCellBlockTemplate(e,n,s=1){const o=ue({colspan:n>1?n.toString():null,rowspan:s>1?s.toString():null}),i=t(),r={id:i,type:e,children:[{id:`${i}-p`,type:"paragraph",nodes:[{id:`${i}-p-t`,type:"text",text:""}]}]};return Object.keys(o).length>0&&(r.annotations={customAttribute:o}),r}getSortedValuesByNumericKey(t){return Array.from(t.entries()).sort((([t],[e])=>t-e)).map((([,t])=>t))}}Kn.DEFAULT_CELLSPAN=1;class $n extends Kn{handleAction(t,e){const{rowsToBeRemoved:n}=t,s=this.getFutureFocusRow(n[0],n[n.length-1],e),o=this.splitRowsBySection(n);if(this.removeRows(o[0]),this.removeRows(o[1]),s){const t=this.getRootContent(e);if(t){const e=s.getLastNode();t.apply(new y(e,e.getRangeEndOffset()))}}}removeRows(t){if(0===t.length)return;const e=t[0].parent,n=e.children,s=this.buildSelectedIndices(t,n);if(s.size>0){if(n.length===t.length)return void e.parent.apply(new U(e));const o=Math.min(...s),i=Math.max(...s),r=this.getRowCellStartCols(n),a=this.collectCellsToMove(n,r,s,o,i);this.insertMovedCells(a,n,r),t.forEach((t=>{t.parent.apply(new U(t))}))}}collectCellsToMove(t,e,n,s,o){const i=new Map,r=t.length;for(let a=0;a<r;a++){const l=t[a],c=l.children.length;for(let t=0;t<c;t++){const c=l.children[t],h=c.rowSpan;if(h<=Kn.DEFAULT_CELLSPAN)continue;const d=a+h-1;if(!this.intersectsRemovalRange(a,d,s,o))continue;const u=h-this.countRemovedRows(a,d,n);if(a<s&&d>=s)this.updateCellSpan(c,"rowspan",u);else if(a>=s&&d>o){const s=o+1;if(s<r&&!n.has(s)){const n=e[a][t];i.has(s)||i.set(s,[]),i.get(s).push({cell:this.cloneCellWithRowSpan(c,u),newRowSpan:u,cellIndex:t,logicalStartCol:n})}}}}return i}cloneCellWithRowSpan(t,e){const n=t.clone(t.parent);return this.updateCellSpan(n,"rowspan",e),n}getFutureFocusRow(t,e,n){const s=n.children.filter((t=>t instanceof Tt||t instanceof Et)).flatMap((t=>t.children)),o=s.indexOf(t),i=s.indexOf(e);return s[o-1]?s[o-1]:s[i+1]?s[i+1]:void 0}}class zn{constructor(){this.dragging=!1,this.anchorCell=null,this.selectedCells=new Set,this.syncRTESelectionWithDebounce=pe(this.syncRTESelection,100,this),this.handleSelectionChangeWithDebounce=pe(this.handleSelectionChange,10,this),this.filterSelectedCell=(t,e)=>{const n=new Set;if(t.intersectsNode(e)){if(e.nodeType===Node.TEXT_NODE){const t=R.getEntityByDOM(e.parentElement);if(t){const e=St(t.parent,xt);if(e)return n.add(e),Array.from(n)}}e.childNodes.forEach((e=>this.filterSelectedCell(t,e).forEach((t=>{n.add(t)}))))}return Array.from(n)},this.updateSelectedStyles=(t,e)=>{const n=1===e?"v-rte-table-cell-focused":"v-rte-table-cell-selected",s=R.getDOMByEntity(t);s&&s.classList.add(n)},this.handleDocMouseUp=()=>{this.endDrag();const t=he();t&&t.removeEventListener("mouseup",this.handleDocMouseUp)},this.handleContentClick=()=>{this.clearSelection();const t=this.context.host.shadowRoot.querySelector(".rich-text-editor-container");t&&t.removeEventListener("mousedown",this.handleContentClick,!0)}}static computeRectRange(t,e){const n=t.parent.parent.parent;if(n!==e.parent.parent.parent)return[];const s=[];n.children.forEach((t=>{t.children.forEach((t=>s.push(t)))}));const{grid:o,cellMeta:i}=zn.buildCellGrid(s),r=i.get(t),a=i.get(e);if(!r||!a)return[];const l=r.row+r.rowSpan-1,c=r.col,h=r.col+r.colSpan-1,d=a.row+a.rowSpan-1,u=a.col,p=a.col+a.colSpan-1,f=Math.min(r.row,a.row),b=Math.max(l,d),g=Math.min(c,u),w=Math.max(h,p),y=new Set;for(let t=f;t<=b;t++){const e=o[t];for(let t=g;t<=w;t++){const n=e[t];n&&y.add(n)}}return Array.from(y)}static getCellSpan(t){let e=1,n=1;const s=t.getAnnotationByType(Z.CUSTOM_ATTRIBUTE);if(s&&s.customAttribute){const t=s.customAttribute;t.rowSpan&&(e=parseInt(t.rowSpan,10)),t.colSpan&&(n=parseInt(t.colSpan,10))}if(1===e&&1===n){const s=R.getDOMByEntity(t);if(s){const t=s.getAttribute("rowSpan"),o=s.getAttribute("colSpan");t&&(e=parseInt(t,10)),o&&(n=parseInt(o,10))}}return{rowSpan:Number.isFinite(e)&&e>0?e:1,colSpan:Number.isFinite(n)&&n>0?n:1}}static buildCellGrid(t){const e=[],n=new Map;for(let s=0;s<t.length;s++){const o=t[s];e[s]||(e[s]=[]);let i=0;for(let t=0;t<o.children.length;t++){const r=o.children[t];for(;e[s][i];)i+=1;const{rowSpan:a,colSpan:l}=zn.getCellSpan(r);n.set(r,{row:s,col:i,rowSpan:a,colSpan:l});for(let t=0;t<a;t++){const n=s+t;e[n]||(e[n]=[]);for(let t=0;t<l;t++)e[n][i+t]=r}i+=l}}return{grid:e,cellMeta:n}}destroy(){this.removeSelectionChangeListener()}init(t){this.context=t,this.addSelectionChangeListener()}setSelectedCells(t){const e=Array.from(this.selectedCells)[0]||t[0];this.updateSelectedCells(t),this.emitCellSelectionChange(e,t)}getSelectedCells(){return Array.from(this.selectedCells)}focusCell(t){const e=R.getEntityByDOM(t);e&&(this.anchorCell=e,this.setSelectedCells([e]),this.addListeners())}dragOver(t){if(!this.anchorCell)return;const e=zn.computeRectRange(this.anchorCell,t);e.length>1&&this.startDrag(),this.dragging&&(this.preventTextSelection(e),this.updateSelectedCells(e,{debounceSync:!0}))}endDrag(){this.dragging=!1,this.anchorCell=null}emitCellSelectionChange(t,e){const n=St(t,mt);if(n){const t=R.getDOMByEntity(n);t&&oe.notify(st.getSubject(t,ae),{host:t,detail:e})}}clearSelection(){this.selectedCells.forEach((t=>{const e=R.getDOMByEntity(t);e&&e.classList.remove("v-rte-table-cell-selected","v-rte-table-cell-focused")})),this.selectedCells.clear()}addSelectionChangeListener(){const t=he();t&&t.addEventListener("selectionchange",this.handleSelectionChangeWithDebounce)}removeSelectionChangeListener(){const t=he();t&&t.removeEventListener("selectionchange",this.handleSelectionChangeWithDebounce)}handleSelectionChange(){if(this.dragging)return void this.syncRTESelectionWithDebounce();const t=this.context.getSelection();if(t.rangeCount>0){const e=t.getRangeAt(0),n=e.commonAncestorContainer;if(o(n,"table")){const t=this.filterSelectedCell(e,n);this.setSelectedCells(t)}}}startDrag(){this.dragging=!0}updateSelectedCells(t,{debounceSync:e}={}){this.clearSelection(),t.forEach((e=>{this.selectedCells.add(e),this.updateSelectedStyles(e,t.length)})),e?this.syncRTESelectionWithDebounce():this.syncRTESelection()}syncRTESelection(){const t=Array.from(this.selectedCells),e=t.flatMap((t=>t.children.flatMap((t=>t.children.flatMap((t=>{if(t instanceof F)return t})))))).filter(q);t.length>1&&this.context.setSelectedNodes(e,{startNode:e[0],endNode:e[e.length-1],startOffset:0,endOffset:e[e.length-1].getRangeEndOffset()})}preventTextSelection(t){const e=this.context.getSelection();if(e.removeAllRanges(),t.length>0){const n=R.getDOMByEntity(t[0]);if(n){const t=new Range;t.setStart(n,0),t.setEnd(n,0),e.addRange(t)}}}addListeners(){const t=he();t&&t.addEventListener("mouseup",this.handleDocMouseUp);const e=this.context.host.shadowRoot.querySelector(".rich-text-editor-container");e&&e.addEventListener("mousedown",this.handleContentClick,!0)}}class Gn extends Kn{handleAction(t,e){const{selectedRows:n}=t,[s,o]=this.splitRowsBySection(n);o.length>0?this.convertToHeaderRows(o,e):this.revertToBodyRows(s,e);const i=this.getRootContent(e);if(i){const t=n[0].getFirstNode();t&&i.apply(new y(t,0))}}convertToHeaderRows(e,n){let s=n.children.find((t=>t instanceof Tt));const o=e[0].parent;s||(s=Tt.from({id:t(),type:"table-head",children:[]}),n.apply(new K(o,s)));const i=o.children.indexOf(e[e.length-1]),r=o.children.slice(0,i+1),a=this.buildSelectedIndices(r,o.children),l=Math.min(...a),c=Math.max(...a);if(a.size>0){if(a.size<o.children.length){const t=this.getRowCellStartCols(o.children),e=this.collectCellsToMove(o.children,t,a,l,c);this.insertMovedCells(e,o.children,t)}this.convertBodyRowsToHeaderRows(o,s,r)}}convertBodyRowsToHeaderRows(t,e,n){for(let e=0;e<n.length;e++){const s=n[e];s.children=s.children.map((t=>this.convertTdToTh(t))),t.apply(new U(s))}e.apply(new H(n))}revertToBodyRows(e,n){let s=n.children.find((t=>t instanceof Et));const o=e[0].parent;s||(s=Et.from({id:t(),type:"table-body",children:[]}),n.apply(new P(o,s)));const i=o.children.indexOf(e[0]),r=o.children.slice(i),a=this.buildSelectedIndices(r,o.children);if(a.size>0){const t=this.getRowCellStartCols(o.children),e=this.collectCellsToMove(o.children,t,a,Math.min(...a),Math.max(...a));this.insertMovedCells(e,o.children,t),this.convertHeadRowsToBodyRows(o,s,r)}}convertHeadRowsToBodyRows(t,e,n){const s=e.children[0],o=this.getRowCellStartCols(n);for(let i=0;i<n.length;i++){const r=n[i];t.apply(new U(r));const a=s?this.getHeadCellLength(s):0;r.children=this.convertThToTd(r,o[i],a),s&&e.apply(new K(s,r))}s||e.apply(new H(n))}collectCellsToMove(t,e,n,s,o){const i=new Map,r=t.length;for(let a=0;a<r;a++){const l=t[a],c=l.children.length;for(let t=0;t<c;t++){const c=l.children[t],h=c.rowSpan;if(h<=Kn.DEFAULT_CELLSPAN)continue;const d=a+h-1;if(!this.intersectsRemovalRange(a,d,s,o))continue;const u=this.countRemovedRows(a,d,n),p=h-u;if(a<s&&d>=s){this.updateCellSpan(c,"rowspan",p);const o=s;if(o<r&&n.has(o)){const n=e[a][t];i.has(o)||i.set(o,[]),i.get(o).push({cell:this.cloneCellWithRowSpan(c,u),newRowSpan:u,cellIndex:t,logicalStartCol:n})}}else if(a>=s&&d>o){this.updateCellSpan(c,"rowspan",u);const s=o+1;if(s<r&&!n.has(s)){const n=e[a][t];i.has(s)||i.set(s,[]),i.get(s).push({cell:this.cloneCellWithRowSpan(c,p),newRowSpan:p,cellIndex:t,logicalStartCol:n})}}}}return i}convertTdToTh(t){if(t instanceof ft)return t;const e=ft.from(t.toJSON());return e.parent=t.parent,e}convertThToTd(t,e,n){return t.children.map(((s,o)=>{let i=s;const r=e[o]<n,a=s.toJSON();return i=r?s:xt.from(this.deleteHeadCellDefaultBackground(a)),i.parent=t,i}))}cloneCellWithRowSpan(e,n){const s=e.clone(e.parent);s.id=t(),s.children=[];const o=this.createNewParagraph("");return o&&s.apply(new H([o])),this.updateCellSpan(s,"rowspan",n),s}deleteHeadCellDefaultBackground(t){var e;if(t&&t.annotations&&t.annotations.customStyle){delete t.annotations.tableCell;const n=t.annotations.customStyle.backgroundColor,s=kt.getDefaultBackgroundColor();!n||n!==s&&(null===(e=i(n))||void 0===e?void 0:e.toUpperCase())!==s||delete t.annotations.customStyle.backgroundColor}return t}}class Wn extends At{handleAction(t,e){const{insertDirection:n,tableCellInsertRange:s}=t,o=new Set(s.map((t=>t.id))),i=Rt(e),r=Ot(i),[a,l]=this.getBoundaryCellColumnRange(s,i,r),c=n===jt.LEFT?a:l+1,h=this.hasSelectedCellInsideTargetColumn(i,r,c,o),d=new Set;i.forEach(((t,s)=>{if(d.has(s))return;const a=this.findExpandableCell(t,s,c,r,n,o,h);if(a){const t=a.rowSpan;if(It(a,a.colSpan+1,a.rowSpan,e,!0),t>1)for(let e=1;e<t;e++)d.add(s+e);return}const l=this.findInsertPosition(t,s,c,r,i);if(l){const e=this.generateTableCell(l.templateCell);t.apply(l.before?new K(l.anchorCell,e):new P(l.anchorCell,e))}}))}findExpandableCell(t,e,n,s,o,i,r){const a=s[e],l=t.children.reduce(((t,e)=>t+(i.has(e.id)?1:0)),0);for(const c of t.children){const t=a.indexOf(c.id),h=t+c.colSpan,d=n===h,u=e+c.rowSpan>=s.length,p=i.has(c.id),f=n>t&&n<h;if(o===jt.LEFT?f:f&&(!p||!u)||d&&c.colSpan>1&&p&&!u&&1===l&&!r)return c}return null}hasSelectedCellInsideTargetColumn(t,e,n,s){for(let o=0;o<t.length;o++){const i=t[o],r=e[o];for(const t of i.children){if(!s.has(t.id))continue;const e=r.indexOf(t.id),o=e+t.colSpan;if(n>e&&n<o)return!0}}return!1}findInsertPosition(t,e,n,s,o){const i=s[e];let r=t.children[0];if(n>=0&&n<i.length){const t=Lt(o,i[n]);t&&(r=t)}let a=0;for(let e=0;e<t.children.length;e++){const s=t.children[e];for(;a<i.length&&i[a]!==s.id;)a++;if(a>=n)return{anchorCell:s,templateCell:r,before:!0};const o=a+s.colSpan;if(o>n||e===t.children.length-1)return{anchorCell:s,templateCell:r,before:!1};a=o}return null}generateTableCell(t){return t instanceof ft?ft.from(Bt(t.type)):xt.from(Bt(t.type))}}class Un extends At{handleAction(t,e){const n=Rt(e),s=Ot(n),[o,i]=this.getBoundaryCellColumnRange(t.tableCellDeleteRange,n,s),r=Math.max(n.indexOf(t.tableCellDeleteRange[t.tableCellDeleteRange.length-1].parent),0),{coveredCellIds:a,coveredCells:l,adjustmentCellInfo:c}=this.getDeleteCellsInfo(n,o,i,s),h=this.findNextFocusableCell(n,s,o,i,a,r);this.deleteCells(l,c,e);const d=this.getRootContent(e),u=Mt(h);d&&u&&d.apply(new y(u))}getDeleteCellsInfo(t,e,n,s){const o=[],i=new Set,r=[],a=Nt(s);return t.forEach((t=>{t.children.forEach((t=>{const s=a.get(t.id);if(void 0===s)return;const{colSpan:l,rowSpan:c}=Dt(t),h=this.getColumnOverlapCount(s,l,e,n);if(h<=0)return;if(h===l)return o.push(t),void i.add(t.id);const d=Math.max(1,l-h);r.push({cell:t,nextColSpan:d,rowSpan:c})}))})),{coveredCells:o,coveredCellIds:i,adjustmentCellInfo:r}}findNextFocusableCell(t,e,n,s,o,i){for(let r=0;r<t.length;r++){const a=this.findFocusableCellIdInGridRow(e[(i+r)%t.length],n,s,o);if(!a)continue;const l=Lt(t,a);if(l)return l}return null}findFocusableCellIdInGridRow(t,e,n,s){for(let e=n+1;e<t.length;e++){const n=t[e];if(n&&!s.has(n))return n}for(let n=e-1;n>=0;n--){const e=t[n];if(e&&!s.has(e))return e}return null}deleteCells(t,e,n){t.forEach((t=>{t.parent.apply(new U(t))}));const s=new Set;e.forEach((({cell:t,nextColSpan:e,rowSpan:o})=>{s.add(t.id),It(t,e,o,n)})),this.normalizeRemainingCellSpans(n,s)}normalizeRemainingCellSpans(t,e){Rt(t).forEach((n=>{n.children.forEach((n=>{const{colSpan:s,rowSpan:o}=Dt(n);if(e.has(n.id)){const e=_t(t);if(!(o>1&&s===e))return}It(n,s,o,t)}))}))}getColumnOverlapCount(t,e,n,s){const o=t+e-1,i=Math.max(t,n),r=Math.min(o,s);return i<=r?r-i+1:0}}class Zn extends j{constructor(t){super(),this.isFlushable=!0,this.type="CREATE_SEGMENT_TABLE_CELL",this.payload=t}}class Jn extends V{handleAction(t,e){const{table:n,sourceCell:s,colSpan:o,cellType:i,keepSourceContent:r}=t.payload,a=r?this.convertCellType(s,i):Vt(i);It(a,o,s.rowSpan,n),e.apply(new K(s,a))}convertCellType(t,e){return"table-head-cell"===e?ft.from(t.toJSON()):xt.from(t.toJSON())}}class Xn extends V{handleAction(t,e){const{cell:n,targetCellType:s}=t.payload,o="table-head-cell"===s?ft.from(n.toJSON()):xt.from(n.toJSON());e.apply(new K(n,o)),e.apply(new U(n))}}class qn extends V{handleAction(t,e){const{table:n,cell:s,col:o,cellStartCol:i,endCol:r,targetCellType:a}=t.payload,l=i+s.colSpan-1,c=o>i?o-i:0,h=Math.min(r,l),d=h-o+1,u=l-h;c>0&&e.apply(new Zn({table:n,sourceCell:s,colSpan:c,cellType:s.type,keepSourceContent:!0})),e.apply(new Zn({table:n,sourceCell:s,colSpan:d,cellType:a,keepSourceContent:0===c})),u>0&&e.apply(new Zn({table:n,sourceCell:s,colSpan:u,cellType:s.type,keepSourceContent:0===c&&d===s.colSpan})),e.apply(new U(s))}}class Qn extends At{handleAction(t,e){const n=Rt(e),s=Ot(n),o=Nt(s),[i,r]=this.getBoundaryCellColumnRange(t.tableCellSelectRange,n,s),a=[],l=new Set;n.forEach((t=>{t.children.forEach((t=>{const e=o.get(t.id);void 0!==e&&e>=i&&e<=r&&!l.has(t.id)&&(l.add(t.id),a.push(t))}))})),t.selectCellCallback(a)}}class Yn extends Qe{canIntercept(t){return t.childrenToBeInserted.some((t=>!(t instanceof xt)))}intercept(){}}class ts extends V{handleAction(t,e){const{targetCell:n,mergeCells:s,colSpan:o,rowSpan:i,direction:r}=t;this.mergeContentToTargetCell(n,s),It(n,o,i,e),this.deleteOtherSelectedCells(s,n),r!==Pt.MERGE_CELL_LEFT&&r!==Pt.MERGE_CELL_RIGHT&&i>1&&this.clearRowSpanIfUniformAcrossRow(n,e,i);const a=this.getRootContent(e),l=Mt(n);a&&l&&a.apply(new y(l))}mergeContentToTargetCell(t,e){const n=e.flatMap((t=>t.children)),s=n.filter((t=>t.isNotEmpty()));t.children=(s.length>0?s:[n[0]]).map((e=>e.clone(t)))}deleteOtherSelectedCells(t,e){t.forEach((t=>{t!==e&&t.parent.apply(new U(t))}))}clearRowSpanIfUniformAcrossRow(t,e,n){const s=t.parent.parent.children,o=Ot(s),i=[];for(let e=0;e<o.length;e++)o[e].includes(t.id)&&i.push(e);if(i.length>1){const t=i[0],r=t+n-1,a=new Set;let l=Number.POSITIVE_INFINITY;for(let e=0;e<o[0].length;e++){let n=o[t][e],s=1,i=!1;for(let c=t+1;c<=r;c++)o[c][e]!==n?(s>1&&(i=!0,l=Math.min(l,s),a.add(n)),s=1,n=o[c][e]):s++;if(s<2&&!i){a.clear();break}s>1&&(l=Math.min(l,s),a.add(n))}a.size>0&&s.forEach((t=>{t.children.forEach((t=>{if(a.has(t.id)){const{rowSpan:n,colSpan:s}=Dt(t);It(t,s,n-l+1,e)}}))}))}}}class es extends C{canHandle(t,e){const n=t[e];return n&&"TABLE"===n.tagName?1:0}handle(e,n){return mt.from({id:t(),type:"table-block",annotations:w.generate(mt,e[0],n),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}}class ns extends m{canHandle(t,e){const n=t[e];return n&&"THEAD"===n.tagName?1:0}handle(e,n){return Tt.from({id:t(),type:"table-head",annotations:w.generate(Tt,e[0],n),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}}class ss extends m{canHandle(t,e){const n=t[e];return n&&"TBODY"===n.tagName?1:0}handle(e,n){return Et.from({id:t(),type:"table-body",annotations:w.generate(Et,e[0],n),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}}class os extends m{canHandle(t,e){const n=t[e];return n&&"TR"===n.tagName?1:0}handle(e,n){return Ht.from({id:t(),type:"table-row",annotations:w.generate(Ht,e[0],n),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}}class is extends m{canHandle(t,e){const n=t[e];return!n||"TD"!==n.tagName&&"TH"!==n.tagName?0:1}handle(e,n){const s=e[0],o=[{id:t(),type:"paragraph",annotations:{internalWrapper:n&&!n.autoMatchFormat},nodes:[{id:t(),type:"text",annotations:{plainText:n&&!n.autoMatchFormat},text:""}]}];return"TH"===s.tagName?ft.from({id:t(),type:"table-head-cell",annotations:this.getTableHeadCellAnnotations(s,n),children:o},n):xt.from({id:t(),type:"table-cell",annotations:w.generate(xt,s,n),children:o},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}getTableHeadCellAnnotations(t,e){const n=w.generate(ft,t,e);return n&&n.tableCell&&vt.getColorKey(n.tableCell.backgroundColor,!0)===ct.key&&(delete n.tableCell.backgroundColor,n.customStyle&&delete n.customStyle.backgroundColor),n}}class rs extends C{canHandle(t,e){const n=t[e];return n&&n.parentElement&&"TABLE"===n.parentElement.tagName&&"CAPTION"===n.tagName?1:0}handle(e,n){const s=this.getTableCaptionAnnotations(e[0],n);return RTETableCaptionBlock.from({id:t(),type:"table-caption",annotations:Object.assign(Object.assign({},s),{caption:!0}),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}getTableCaptionAnnotations(t,e){const n=w.generate(RTETableCaptionBlock,t,e);return n&&n.customStyle&&n.customStyle.backgroundColor&&vt.getColorKey(n.customStyle.backgroundColor,!0)===ct.key&&delete n.customStyle.backgroundColor,n}}class as extends k{getBackgroundColor(t){return t.style.backgroundColor?vt.getColorKey(t.style.backgroundColor)||t.style.backgroundColor:null}getBorder(t){const e=t.style,n=e.borderStyle,s=e.borderWidth,o=e.borderColor;if(o||n||s){const t="initial"===o?"":o;return{style:"initial"===n?"":n,width:"initial"===s?"":s,color:vt.getColorKey(t)||t}}return null}getWidth(t){if(t.style.width)return t.style.width;const e=t.getAttribute("width");return e?/^\d+$/.test(e)?`${e}px`:e:null}getHeight(t){if(t.style.height)return t.style.height;const e=t.getAttribute("height");return e?/^\d+$/.test(e)?`${e}px`:e:null}}class ls extends as{canHandle(t){return"RTETableBlock"===t.name}handle(t){const e=ue({backgroundColor:this.getBackgroundColor(t),border:this.getBorder(t),width:this.getWidth(t),height:this.getHeight(t),alignment:this.getAlignment(t)});return Object.keys(e).length>0?{table:e}:{}}getAlignment(t){const e=t.classList;if(e.contains("v-rte--extension-table-align-left"))return"left";if(e.contains("v-rte--extension-table-align-center"))return"center";if(e.contains("v-rte--extension-table-align-right"))return"right";const n=t.style,s=n.marginLeft,o=n.marginRight;if("auto"===s&&"auto"===o)return"center";if("0"===s||"0px"===s)return"left";if("0"===o||"0px"===o)return"right";const i=t.getAttribute("align");return i&&["left","center","right"].includes(i)?i:null}}class cs extends as{canHandle(t){return"RTETableCellBlock"===t.name}handle(t){const e=ue({backgroundColor:this.getBackgroundColor(t),padding:this.getPadding(t),border:this.getBorder(t),width:this.getWidth(t),height:this.getHeight(t),textAlign:this.getTextAlign(t),verticalAlign:this.getVerticalAlign(t),minWidth:this.getMinWidth(t),boxSizing:this.getBoxSizing(t)});return Object.keys(e).length>0?{tableCell:e}:{}}getMinWidth(t){return t.style.minWidth?t.style.minWidth:null}getBoxSizing(t){return t.style.boxSizing?t.style.boxSizing:null}getPadding(t){return t.style.padding?t.style.padding:null}getTextAlign(t){if(t.style.textAlign){const e=t.style.textAlign;if(["left","center","right","justify"].includes(e))return e}const e=t.getAttribute("align");return e&&["left","center","right","justify"].includes(e)?e:null}getVerticalAlign(t){if(t.style.verticalAlign){const e=t.style.verticalAlign;if(["top","middle","bottom"].includes(e))return e}return null}}class hs extends cs{canHandle(t){return"RTETableHeadCellBlock"===t.name}}class ds extends V{handleAction(t,e){const n=t.toAnnotation(),s=this.getDOMByEntity(e);if(s){const t=s.closest(".v-rte--extension-table-container"),{backgroundColorAnnotation:o,width:i,height:r}=n;s.style.backgroundColor=o.renderStyle().color,s.style.border=n.borderStr,s.style.width=i,s.style.height=r;const a=n.renderAlignmentStyle().margin;s.style.margin=a,t&&(t.style.width=i,t.style.height=r,t.style.margin=a),this.updateCustomStyleAnnotation(e,["backgroundColor","border","width","height","margin"])}}}class us extends V{handleAction(t,e){const n=t.toAnnotation(),s=this.getDOMByEntity(e);if(s){const{width:t,height:o,borderStr:i,padding:r,textAlign:a,verticalAlign:l}=n,c=n.renderStyle().backgroundColor||"";s.style.backgroundColor=c,s.style.border=i,s.style.width=t,s.style.height=o,s.style.padding=r,s.style.textAlign=a,s.style.verticalAlign=l,this.updateCustomStyleAnnotation(e,["backgroundColor","border","width","height","padding","textAlign","verticalAlign"])}}}class ps extends V{handleAction(t,e){const n=e.parent,s=n.parent,o=St(n,mt),i=Rt(o),r=i.indexOf(n),{colSpan:a,rowSpan:l}=Dt(e),c=Ft(e,i),h=Math.ceil(l/2),d=Math.max(1,l-h),u=1===l;It(e,a,h,o);const p=r+h,f=Vt(e.type);if(It(f,a,d,o),u){const t=this.createNewRowWithCell(s,f),r=s.children.indexOf(n);s.apply(new P(s.children[r],t)),i.splice(p,0,t),this.updateCellsSpanningThroughInsertionPoint(i,p,e,o)}else{const t=i[p],e=this.findInsertPosition(t,c,i,p);t.children.splice(e,0,f),f.parent=t}}findInsertPosition(t,e,n,s){let o=0;for(let t=0;t<s;t++){const i=n[t];for(const r of i.children){const{colSpan:i,rowSpan:a}=Dt(r);t+a>s&&Ft(r,n)<e&&(o+=i)}}let i=o;for(let n=0;n<t.children.length;n++){if(i>=e)return n;const s=t.children[n],{colSpan:o}=Dt(s);i+=o}return t.children.length}createNewRowWithCell(e,n){const s={id:t(),type:"table-row",children:[]},o=Ht.from(s);return o.parent=e,o.children.push(n),n.parent=o,o}updateCellsSpanningThroughInsertionPoint(t,e,n,s){for(let o=0;o<e;o++){const i=t[o];for(const t of i.children){if(t===n)continue;const{colSpan:i,rowSpan:r}=Dt(t);o+r>=e&&It(t,i,r+1,s)}}}}class fs extends V{handleAction(t,e){const n=e.parent,s=St(n,mt),o=Rt(s),i=o.indexOf(n),{colSpan:r,rowSpan:a}=Dt(e),l=Ft(e,o),c=l+r-1,h=Math.ceil(r/2),d=Math.floor(r/2);It(e,h,a,s);const u=Vt(e.type);It(u,d,a,s),n.apply(new P(e,u));const p=1===r?1:0;p>0&&this.updateOtherRowsCells(o,i,l,c,a,p,s)}updateOtherRowsCells(t,e,n,s,o,i,r){for(let a=0;a<t.length;a++){const l=t[a];if(!(a>=e&&a<e+o))for(const e of l.children){const o=Ft(e,t),{colSpan:a,rowSpan:l}=Dt(e);if(o+a-1>=n&&o<=s){It(e,a+i,l,r);break}}}}}class bs extends Kn{handleAction(e,n){const{selectedRows:s}=e,o=s[s.length-1];let i=n.children.find((t=>t instanceof Et));const r={id:t(),type:"table-row",children:[]};let a=0,l=null;i?(l=i.children[0],a=this.getHeadCellLength(l)):(i=Et.from({id:t(),type:"table-body",children:[]}),n.apply(new H([i])));const c=o.parent.children,h=this.getRowsMaxCellCount(c);if(this.getRowsMaxCellCount([o])<h){const t=c.indexOf(o),e=this.getRowCellStartCols(c),n=new Map;for(let s=0;s<h;s++){const o=s<a?"table-head-cell":"table-cell",{cell:i}=this.getTheStartSpanCell(c,e,t,s);if(i){const t=i.colSpan;n.set(s,this.getDefaultCellBlockTemplate(o,t)),s+=t-1}}r.children=this.getSortedValuesByNumericKey(n)}else r.children=this.createTableCells(o,a);const d=l?new K(l,Ht.from(r)):new H([Ht.from(r)]);i.apply(d)}createTableCells(t,e){const n=[];let s=0;for(const o of t.children)n.push(this.getDefaultCellBlockTemplate(s<e?"table-head-cell":"table-cell",o.colSpan)),s+=o.colSpan;return n}}class gs extends Kn{handleAction(e){const{insertDirection:n,selectedRows:s}=e,o=n===Kt.ABOVE?s[0]:s[s.length-1],i={id:t(),type:"table-row",children:[]},r=o.parent.children,a=this.getRowsMaxCellCount(r),l=r.indexOf(o),c=this.getRowCellStartCols(r),h=new Map;for(let t=0;t<a;t++){const{cell:e,rowIndex:s}=this.getTheStartSpanCell(r,c,l,t);if(e){const{colSpan:o,rowSpan:i}=e;if(n===Kt.ABOVE?s!==l:s+i>l+1){this.updateCellSpan(e,"rowspan",i+1),t+=o-1;continue}h.set(t,this.getDefaultCellBlockTemplate(e.type,o)),t+=o-1}}i.children=this.getSortedValuesByNumericKey(h);const d=Ht.from(i),u=n===Kt.ABOVE?new K(o,d):new P(o,d);o.parent.apply(u)}}class ws extends Qe{canIntercept(t,e){return Boolean(e.parent)}intercept(t,e,n){const s=this.createNewParagraph("");s&&(n.parent.apply(0===e.startOffset?new K(n,s):new P(n,s)),e.newBlock=s)}createNewParagraph(e){const n=B.getRTEBlockClass("paragraph");if(n)return n.from({id:t(),type:"paragraph",nodes:[{id:t(),type:"text",text:e}]})}}class ys extends X{constructor(){super(...arguments),this.stylesToBeFiltered=ut.getDefaultStyles(),this.elementTagName="table"}canFilter(t){return this.isTableBlock(t.constructor.name)}canRefill(t,e){return this.isTableBlock(t)&&e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}isTableBlock(t){return"RTETableBlock"===t}}class vs extends X{constructor(){super(...arguments),this.stylesToBeFiltered=hn.getDefaultStyles(),this.elementTagName="table caption"}canFilter(t){return this.isTableCaption(t.constructor.name)}canRefill(t,e){return this.isTableCaption(t)&&"CAPTION"===e.nodeName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}isTableCaption(t){return"RTETableCaptionBlock"===t}}class ms extends X{constructor(t="td"){super(),this.stylesToBeFiltered=pt.getDefaultStyles(),this.elementTagName="",this.stylesWithRGBColor=pt.getDefaultStyles(!1),this.cellBlockClassName="",this.elementTagName=t,this.cellBlockClassName="td"===t?"RTETableCellBlock":"RTETableHeadCellBlock"}canFilter(t){return this.isTableCell(t.constructor.name)}filterAndDeleteStyles(t,e){return this.convertDefaultBorderColorFromRGBToHex(t),super.filterAndDeleteStyles(t,e)}canRefill(t,e){return this.isTableCell(t)&&e.nodeName===this.elementTagName.toUpperCase()}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}isTableCell(t){return t===this.cellBlockClassName}convertDefaultBorderColorFromRGBToHex(t){t&&t.border&&t.border===this.stylesWithRGBColor.border&&(t.border=this.stylesToBeFiltered.border)}}class Cs extends Pe{constructor(t=$t){super(),this.toolbarButtonRenderer=new Mn,this.tableBlockRenderer=new Rn,this.tableRowBlockRenderer=new In,this.tableCellRenderer=new Ln,this.tableHeadCellRenderer=new jn,this.tableSelection=new zn,vt.setTableColors(t),this.registerToolbarButtonRenderer("table",this.toolbarButtonRenderer),this.registerBlockBasicStrategies(mt.name),this.registerBlockBasicStrategies(Tt.name),this.registerBlockBasicStrategies(ft.name),this.registerBlockBasicStrategies(Ht.name),this.registerBlockBasicStrategies(xt.name),this.registerBlockBasicStrategies(Et.name),this.registerRenderer("table-block",this.tableBlockRenderer),this.registerRenderer("table-head",new On),this.registerRenderer("table-head-cell",this.tableHeadCellRenderer),this.registerRenderer("table-row",this.tableRowBlockRenderer),this.registerRenderer("table-cell",this.tableCellRenderer),this.registerRenderer("table-body",new Bn),this.registerRenderer("table-caption",new Fn),this.registerNode("table-block",mt),this.registerNode("table-head",Tt),this.registerNode("table-head-cell",ft),this.registerNode("table-row",Ht),this.registerNode("table-cell",xt),this.registerNode("table-body",Et),this.registerNode("table-caption",RTETableCaptionBlock),this.registerElementToBlockDTOClassStrategy(new es),this.registerElementToBlockDTOClassStrategy(new ns),this.registerElementToBlockDTOClassStrategy(new ss),this.registerElementToBlockDTOClassStrategy(new os),this.registerElementToBlockDTOClassStrategy(new is),this.registerElementToBlockDTOClassStrategy(new rs),this.registerAnnotationHandler(new ls),this.registerAnnotationHandler(new cs),this.registerAnnotationHandler(new hs)}initialExtensionAfterLoad(t){this.tableSelection.init(t);const e=Object.assign(Object.assign({},t),{tableSelection:this.tableSelection});super.initialExtensionAfterLoad(e)}destroyExtension(){this.tableBlockRenderer.destroy(),this.tableSelection.destroy()}}(()=>{const t=new Dn,e=new Pn;Pe.registerActionHandleStrategy(v.name,"INSERT_TABLE_BLOCK",t),Pe.registerActionHandleStrategy(v.name,"DELETE_TABLE_BLOCK",e),Pe.registerActionHandleStrategy(xt.name,"DELETE_TABLE_BLOCK",e),Pe.registerActionHandleStrategy(ft.name,"DELETE_TABLE_BLOCK",e),Pe.registerActionHandleStrategy(M.name,"INSERT_TABLE_BLOCK",t),Pe.registerActionHandleStrategy(T.name,"INSERT_TABLE_BLOCK",t),Pe.registerActionHandleStrategy(mt.name,zt,new bs),Pe.registerActionHandleStrategy(mt.name,Gt,new gs),Pe.registerActionHandleStrategy(mt.name,Wt,new $n),Pe.registerActionHandleStrategy(mt.name,Ut,new Gn),Pe.registerActionHandleStrategy(mt.name,Zt,new Wn),Pe.registerActionHandleStrategy(mt.name,Jt,new Un),Pe.registerActionHandleStrategy(mt.name,Xt,new qt),Pe.registerActionHandleStrategy(Ht.name,Qt,new qn),Pe.registerActionHandleStrategy(Ht.name,"CREATE_SEGMENT_TABLE_CELL",new Jn),Pe.registerActionHandleStrategy(Ht.name,Yt,new Xn),Pe.registerActionHandleStrategy(xt.name,te,new ps),Pe.registerActionHandleStrategy(xt.name,ee,new fs),Pe.registerActionHandleStrategy(ft.name,te,new ps),Pe.registerActionHandleStrategy(ft.name,ee,new fs),Pe.registerActionHandleStrategy(mt.name,ne,new Qn),Pe.registerActionHandleStrategy(mt.name,se,new ts),Pe.registerActionHandleStrategy(mt.name,fn.name,new ds),Pe.registerActionHandleStrategy(xt.name,yn.name,new us),Pe.registerActionHandleStrategy(ft.name,vn.name,new us),Pe.registerActionHandlerInterceptor(M.name,z.DELETE_BLOCK_CONTENT,new Vn),Pe.registerActionHandlerInterceptor(Ht.name,z.INSERT_CHILDREN_BEFORE,new Yn),Pe.registerActionHandlerInterceptor(xt.name,z.DELETE_CHILDREN,new Hn),Pe.registerActionHandlerInterceptor(ft.name,z.DELETE_CHILDREN,new Hn),Pe.registerActionHandlerInterceptor(mt.name,z.INSERT_NEW_PARAGRAPH,new ws),Pe.registerFilterStylesStrategy(mt.name,new ys),Pe.registerFilterStylesStrategy(RTETableCaptionBlock.name,new vs),Pe.registerFilterStylesStrategy(xt.name,new ms),Pe.registerFilterStylesStrategy(ft.name,new ms("th"))})();class xs extends j{constructor(t,e){super(),this.type=z.INSERT_NODE_TO_NEAREST_ROOT,this.rteRange=t,this.nodeToBeInserted=e}}class Ts extends V{handleAction(e,n){const{rteRange:s,token:o}=e;if(s&&s.startNode){const{key:i,label:r,customAttrs:a={wrapped:"true"}}=o,l=new RTETokenNode(t(),i,r,n);l.annotationMap.set("CUSTOM_ATTRIBUTE",new J(a)),n.apply(new xs(s,l)),e.actionHandleResult=!0}}}const Es=new class extends C{canHandle(t,e){const n=t[e];return"SPAN"===n.nodeName&&n.classList.contains("token")&&n.hasAttribute("token-key")?1:0}handle(e){const n=e[0],s=n.getAttribute("token-key"),o=n.textContent,i=w.generate(N,n),{customAttribute:r}=i,a=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]])}return n}(i,["customAttribute","customClass"]);return{id:t(),type:"token",token:s,text:o,annotations:Object.assign(Object.assign({},a),{customAttribute:this.createCustomAttrs(r)})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}createCustomAttrs(t){const e=Object.assign(Object.assign({},t),{contenteditable:null,"template-token-key":null,"token-key":null,wrapped:"false"===t.wrapped?"false":"true"});return ue(e)}};class Ss extends Pe{constructor(t=[]){super(),this.tokenRenderer=new $e,this.registerNode("token",RTETokenNode),this.registerRenderer("token",this.tokenRenderer),this.tokenToolbarButtonRenderer=new Ke(t),this.registerToolbarButtonRenderer("token",this.tokenToolbarButtonRenderer),this.registerElementToNodeDTOClassStrategy(Es)}}(()=>{const t=new Ts;Pe.registerActionHandleStrategy(M.name,"INSERT_TOKEN_NODE",t),Pe.registerActionHandleStrategy(A.name,"INSERT_TOKEN_NODE",t)})();export{Qe as A,xs as I,Ke as R,ge as V,me as a,Te as b,ke as c,je as d,Me as e,Ss as f,Ge as g,ln as h,Cs as i,Pe as j,Ve as k,He as l,RTETokenNode as m,$e as n,ze as o,Ie as w}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as r,r as e,c as t,H as o,g as s}from"./p-6b2342e0.js";import{V as
|
|
1
|
+
import{h as r,r as e,c as t,H as o,g as s}from"./p-6b2342e0.js";import{V as i,I as a}from"./p-4415ad28.js";import{c as l,V as c,I as h}from"./p-6e1ab235.js";import{s as d}from"./p-519a7d55.js";import{T as n}from"./p-fb5ea4b2.js";import{c as b}from"./p-6ac8e655.js";import{i as p}from"./p-f1c672e4.js";import{c as v}from"./p-6b5cb920.js";import{a as w}from"./p-9af0e2e7.js";import{T as f}from"./p-57f220b5.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-f28a6074.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-b75ee3ba.js";import"./p-3b791b5d.js";import"./p-a528714c.js";var m=function(r,e,t,o){var s,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a};class g extends c{constructor(){super(...arguments),this.handleClick=r=>{this.disabled?r.stopPropagation():("vega"!==p.getSemantics(this.host).namespace&&r.stopPropagation(),this.clickEventEmitter.emit())}}render(){const e="clear"===this.variant,t=!e&&!!this.color;return r("div",{class:{"vega-color-swatch-container":!0,[`size-${this.size}`]:!0,[`shape-${this.shape}`]:!0,"swatch-clear":e},role:"button",part:"swatch-container","aria-label":this.getAriaLabel(),"aria-disabled":this.disabled?"true":"false",tabIndex:this.disabled?-1:0,onClick:this.handleClick,onKeyDown:b({composed:!0})},r("div",{class:"swatch",part:"swatch"},t&&r("span",{class:"color-fill",style:this.getFillColorStyles()}),e&&r("span",{class:"clear-line"}),this.selected&&!e&&r("vega-icon",{class:"check-icon",icon:"checkmark",size:"size-16",color:this.getCheckMarkColor()})),this.label&&this.renderLabel())}renderLabel(){return r("vega-font",{class:"swatch-label",variant:"font-field-value",color:this.disabled?"text-disabled":"text-primary"},this.label)}getAriaLabel(){return this.label?this.label:"clear"===this.variant?this.translationSlimmer.t("Clear color"):this.color?this.translationSlimmer.t("Color {0}",this.color):this.translationSlimmer.t("Color swatch")}getFillColorStyles(){const r={};return this.color&&(r.backgroundColor=this.color),r}getCheckMarkColor(){return this.color?new n(this.color).isDark()?"text-white":"text-black":"text-primary"}}m([l()],g.prototype,"host",void 0),m([l()],g.prototype,"variant",void 0),m([l()],g.prototype,"label",void 0),m([l()],g.prototype,"color",void 0),m([l()],g.prototype,"selected",void 0),m([l()],g.prototype,"size",void 0),m([l()],g.prototype,"disabled",void 0),m([l()],g.prototype,"shape",void 0),m([l()],g.prototype,"clickEventEmitter",void 0),m([l()],g.prototype,"translationSlimmer",void 0);var u=function(r,e,t,o){var s,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a};const x=class{constructor(r){e(this,r),this.vegaClick=t(this,"vegaClick",7),this.click=t(this,"click",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new i,this.translationSlimmer=new f,this.vegaColorSwatchRenderer=new g,this.clickEventEmitter=v(x,w),this.color="",this.selected=!1,this.label="",this.size="small",this.disabled=!1,this.variant="swatch",this.shape="basket"}render(){return d(r(o,{class:{disabled:this.disabled}},this.vegaColorSwatchRenderer.render()),this.host)}get host(){return s(this)}};u([a()],x.prototype,"globalSlimmers",void 0),u([h()],x.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u([h()],x.prototype,"translationSlimmer",void 0),u([h()],x.prototype,"vegaColorSwatchRenderer",void 0),u([h()],x.prototype,"clickEventEmitter",void 0),x.style=":host{display:inline-block;vertical-align:middle}.vega-color-swatch-container{display:flex;flex-direction:row;align-items:center;border-radius:4px}.swatch{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));position:relative;flex-shrink:0;overflow:hidden}.shape-basket .swatch{border-radius:8px}.shape-block .swatch{border-radius:0px}.check-icon{position:relative;z-index:1}.swatch-clear .swatch{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}.swatch-clear .swatch .clear-line{position:absolute;width:141%;height:0;border-top-width:1px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1));transform:rotate(-45deg);transform-origin:center}.color-fill{position:absolute;display:block;top:0;left:0;width:100%;height:100%}.size-extra-small .swatch{width:24px;height:24px;min-width:24px}.size-extra-small.shape-basket .swatch{border-radius:4px}.size-small .swatch{width:40px;height:40px;min-width:40px}.size-small.shape-basket{border-radius:8px}.size-medium .swatch{width:48px;height:48px;min-width:48px}.size-medium.shape-basket{border-radius:8px}@media (hover: hover){:host(:not(.disabled)) .swatch:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}}.vega-color-swatch-container:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible .swatch{border-width:1px;border-style:solid;border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-color-swatch-container:focus-visible.swatch-clear{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible.swatch-clear .swatch{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}.vega-color-swatch-container:focus-visible.swatch-clear .swatch .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .vega-color-swatch-container{cursor:pointer}:host(.disabled) .vega-color-swatch-container{cursor:not-allowed}:host(.disabled) .swatch{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));pointer-events:none}:host(.disabled) .swatch .color-fill,:host(.disabled) .swatch .check-icon{opacity:0.5}:host(.disabled) .swatch .label-container{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host(.disabled) .swatch .clear-line{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1))}.swatch-label{margin-left:8px}";export{x as vega_color_swatch}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,H as o,g as a}from"./p-6b2342e0.js";import{s as r}from"./p-519a7d55.js";import{I as i}from"./p-5657f768.js";import{c as n,M as p,I as l}from"./p-6e1ab235.js";import{V as s,I as c}from"./p-4415ad28.js";import{E as g}from"./p-
|
|
1
|
+
import{h as t,r as e,H as o,g as a}from"./p-6b2342e0.js";import{s as r}from"./p-519a7d55.js";import{I as i}from"./p-5657f768.js";import{c as n,M as p,I as l}from"./p-6e1ab235.js";import{V as s,I as c}from"./p-4415ad28.js";import{E as g}from"./p-8d48940d.js";import{c as h}from"./p-2a9960c9.js";import"./p-4cefd7fe.js";import"./p-6e70d3cc.js";import"./p-e4c4ea35.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-3b791b5d.js";import"./p-2d0d575f.js";import"./p-a528714c.js";import"./p-781fd6e0.js";import"./p-262ec334.js";import"./p-6a334573.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-b75ee3ba.js";import"./p-031c0cf7.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-18e8d9b7.js";import"./p-5a25014f.js";import"./p-331a62d5.js";import"./p-f28a6074.js";import"./p-6c43d54a.js";import"./p-a841cf13.js";var d=function(t,e,o,a){var r,i=arguments.length,n=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,a);else for(var p=t.length-1;p>=0;p--)(r=t[p])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n};class m extends g{constructor(){super((()=>this.getShowConfig()),(()=>this.trigger),"isTooltipShow",(()=>this.disableInteractive)),this.getShowConfig=()=>({target:this.host,appendableElement:this.vegaTooltipContentBoxRenderer.getTooltipContentBoxRef(),positionRelativeTo:this.positionRelativeTo,isScreenPosition:!0,matchTargetWidth:!1,size:this.size,minWidth:this.minWidth,maxWidth:this.maxWidth,placement:this.placement,alignment:this.alignment})}watchTrigger(){"none"===this.trigger&&this.hide()}watchToShowTooltip(){this.isTooltipShow&&this.show()}watchTextChange(t,e){!t&&e&&this.isTooltipShow&&this.hide()}show(){this.deprecatedPropertySlimmer.getValue()&&super.show()}}d([n()],m.prototype,"host",void 0),d([n()],m.prototype,"positionRelativeTo",void 0),d([n()],m.prototype,"size",void 0),d([n()],m.prototype,"minWidth",void 0),d([n()],m.prototype,"maxWidth",void 0),d([n()],m.prototype,"placement",void 0),d([n()],m.prototype,"alignment",void 0),d([n()],m.prototype,"trigger",void 0),d([n()],m.prototype,"disableInteractive",void 0),d([n()],m.prototype,"deprecatedPropertySlimmer",void 0),d([n({writable:!0})],m.prototype,"isTooltipShow",void 0),d([n()],m.prototype,"vegaTooltipContentBoxRenderer",void 0),d([p("watchTrigger")],m.prototype,"watchTrigger",null),d([p("watchToShowTooltip")],m.prototype,"watchToShowTooltip",null),d([p("watchTextChange")],m.prototype,"watchTextChange",null);class v{getTooltipContentBoxRef(){return this.tooltip}render(){return t("vega-tooltip-content-box",{ref:t=>this.tooltip=t,text:this.deprecatedPropertySlimmer.getValue()})}}!function(t,e,o,a){var r,i=arguments.length,n=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,a);else for(var p=t.length-1;p>=0;p--)(r=t[p])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);i>3&&n&&Object.defineProperty(e,o,n)}([n()],v.prototype,"deprecatedPropertySlimmer",void 0);const f=[{payloadKey:"CONTENT_IS_EMPTY",payloadDescription:"@deprecated Specifies the content that is displayed inside the tooltip.",payloadValue:t=>void 0===t.content||""===t.content},{payloadKey:"CONTENT_IS_NOT_EMPTY",payloadDescription:"@deprecated Specifies the content that is displayed inside the tooltip.",payloadValue:t=>void 0!==t.content&&""!==t.content}];var b=function(t,e,o,a){var r,i=arguments.length,n=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,a);else for(var p=t.length-1;p>=0;p--)(r=t[p])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n};const x=class{constructor(t){e(this,t),this.globalSlimmers={},this.vegaTooltipElementAppenderController=new m,this.vegaTooltipContentBoxRenderer=new v,this.deprecatedPropertySlimmer=h(x,"text","content",void 0),this.vegaComponentUsageRuntimeMetricsSlimmer=new s(f),this.isTooltipShow=!1,this.trigger="hover",this.placement="top",this.alignment="center",this.disableInteractive=!1}watchTrigger(){}watchTextChange(){}watchToShowTooltip(){}render(){return r(t(o,null,t("slot",null),this.vegaTooltipContentBoxRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{trigger:["watchTrigger"],content:["watchTextChange"],text:["watchTextChange"],size:["watchToShowTooltip"],placement:["watchToShowTooltip"],alignment:["watchToShowTooltip"]}}};b([c()],x.prototype,"globalSlimmers",void 0),b([l()],x.prototype,"vegaTooltipElementAppenderController",void 0),b([l()],x.prototype,"vegaTooltipContentBoxRenderer",void 0),b([i((t=>[{keyCode:"Tab",activeElementInScope:[t.host],callback:()=>"hover"===t.trigger&&t.vegaTooltipElementAppenderController.show()},{keyCode:"Escape",activeElementInScope:[t.host,t.vegaTooltipContentBoxRenderer.getTooltipContentBoxRef()],callback:()=>t.vegaTooltipElementAppenderController.hide()},{keyCode:"Tab",activeElementOutScope:[t.host,t.vegaTooltipContentBoxRenderer.getTooltipContentBoxRef()],callback:()=>t.isTooltipShow&&t.vegaTooltipElementAppenderController.hide()}])),l()],x.prototype,"deprecatedPropertySlimmer",void 0),b([l()],x.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),x.style=":host{display:inline-block}";var w=function(t,e,o,a){var r,i=arguments.length,n=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,a);else for(var p=t.length-1;p>=0;p--)(r=t[p])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n};const j=class{constructor(t){e(this,t),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new s}render(){return r(t(o,{class:"vega-tooltip",role:"tooltip"},t("div",{class:"vega-tooltip-content"},this.text)),this.host)}get host(){return a(this)}};w([c()],j.prototype,"globalSlimmers",void 0),w([l()],j.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),j.style=':host{position:absolute}:host(.vega-force-hidden){display:none !important}:host(.vega-placement-bottom){margin-top:8px}:host(.vega-placement-left){margin-left:-8px}:host(.vega-placement-right){margin-left:8px}:host(.vega-placement-top){margin-top:-8px}.vega-tooltip-content{border-radius:4px;padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;overflow-wrap:break-word;background-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;white-space:pre-line}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-tooltip-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-tooltip-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-tooltip-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}:host(.vega-no-suitable-placement) .vega-tooltip-content::after,:host(.vega-no-suitable-alignment) .vega-tooltip-content::after{display:none}.vega-tooltip-content::after{content:"";position:absolute;border-style:solid}:host(.vega-placement-bottom) .vega-tooltip-content::after{top:-4px;border-width:0 5px 4px 5px;border-bottom-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));border-top-color:transparent;border-left-color:transparent;border-right-color:transparent}:host(.vega-placement-left) .vega-tooltip-content::after{left:100%;border-width:5px 0 5px 4px;border-left-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));border-top-color:transparent;border-bottom-color:transparent;border-right-color:transparent}:host(.vega-placement-right) .vega-tooltip-content::after{left:-4px;border-width:5px 4px 5px 0;border-right-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent}:host(.vega-placement-top) .vega-tooltip-content::after{bottom:-4px;border-width:4px 5px 0px 5px;border-top-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1));border-bottom-color:transparent;border-left-color:transparent;border-right-color:transparent}:host(.vega-placement-bottom.vega-alignment-start) .vega-tooltip-content::after,:host(.vega-placement-top.vega-alignment-start) .vega-tooltip-content::after{left:8px}:host(.vega-placement-bottom.vega-alignment-center) .vega-tooltip-content::after,:host(.vega-placement-top.vega-alignment-center) .vega-tooltip-content::after{left:calc(50% - 5px)}:host(.vega-placement-bottom.vega-alignment-end) .vega-tooltip-content::after,:host(.vega-placement-top.vega-alignment-end) .vega-tooltip-content::after{right:8px}:host(.vega-placement-left.vega-alignment-start) .vega-tooltip-content::after,:host(.vega-placement-right.vega-alignment-start) .vega-tooltip-content::after{top:8px}:host(.vega-placement-left.vega-alignment-center) .vega-tooltip-content::after,:host(.vega-placement-right.vega-alignment-center) .vega-tooltip-content::after{top:calc(50% - 5px)}:host(.vega-placement-left.vega-alignment-end) .vega-tooltip-content::after,:host(.vega-placement-right.vega-alignment-end) .vega-tooltip-content::after{bottom:8px}';export{x as vega_tooltip,j as vega_tooltip_content_box}
|