@globalpayments/vega 2.57.0 → 2.58.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/card-config-2ee5505e.js +65 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-92ab034f.js → string-input-formatter-slimmer-dc1747ad.js} +20 -1
- package/dist/cjs/vega-calendar_3.cjs.entry.js +197 -114
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +28 -4
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +20 -116
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +1 -1
- package/dist/cjs/vega-input-select.cjs.entry.js +6 -3
- package/dist/cjs/vega-input.cjs.entry.js +194 -2
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +26 -2
- package/dist/cjs/vega.cjs.js +1 -1
- package/dist/collection/components/vega-calendar/slimmers/common/controllers/vega-calendar-post-operation-date-controller.js +48 -0
- package/dist/collection/components/vega-calendar/slimmers/common/renderers/vega-calendar-switch-panel.js +8 -2
- package/dist/collection/components/vega-calendar/vega-calendar.js +42 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +27 -3
- package/dist/collection/components/vega-dropdown/vega-dropdown-item/vega-dropdown-item.css +6 -0
- package/dist/collection/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.js +25 -2
- package/dist/collection/components/vega-input/vega-input.js +1 -1
- package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +13 -52
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.css +4 -0
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +5 -2
- package/dist/collection/components/vega-input-select/vega-input-select.css +0 -3
- package/dist/collection/components/vega-selection-tile/slimmers/controllers/vega-selection-tile-state-controller.js +7 -0
- package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.js +37 -0
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.css +12 -0
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.js +7 -2
- package/dist/collection/components/vega-table/vega-table-head-cell/vega-table-head-cell.js +1 -1
- package/dist/collection/components/vega-table/vega-table.js +1 -1
- package/dist/collection/constants/card-config.js +4 -4
- package/dist/collection/helpers/calendar/calendar-period/month-period.js +15 -1
- package/dist/collection/helpers/calendar/calendar-period/week-period.js +6 -7
- package/dist/collection/helpers/calendar/test/calendar-period/month-period.test.js +12 -4
- package/dist/collection/helpers/calendar/test/calendar-period/week-period.test.js +2 -2
- package/dist/collection/helpers/formatter/string-formatter/credit-card-blur-mask-strategy.js +74 -0
- package/dist/collection/helpers/formatter/string-formatter/credit-card-input-mask-strategy.js +34 -0
- package/dist/collection/helpers/formatter/string-formatter/credit-card-mask-strategy.abstract.js +63 -0
- package/dist/collection/helpers/formatter/string-formatter/string-format-strategy.abstract.js +4 -1
- package/dist/collection/helpers/formatter/string-formatter/string-mask-strategy.js +8 -0
- package/dist/collection/helpers/slimmers/string-input-formatter-slimmer.js +8 -0
- package/dist/esm/{app-globals-366415b3.js → app-globals-ee6a1250.js} +3 -3
- package/dist/esm/card-config-d2ad484e.js +63 -0
- package/dist/esm/{code-block-73869a3c.js → code-block-7bd4cb87.js} +1 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-dfe89c93.js → component-value-history-controller-slimmer.abstract-41c58caf.js} +2 -2
- package/dist/esm/{content-state-953906e8.js → content-state-a43e703e.js} +1 -1
- package/dist/esm/{design-token-28a0a2e6.js → design-token-23522f5c.js} +1 -1
- package/dist/esm/{element-appender-slimmer-7b9f4a8e.js → element-appender-slimmer-042df95a.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-707a6da2.js → form-field-controller-slimmer-f0982f11.js} +2 -2
- package/dist/esm/{image-annotation-action-5bfda07c.js → image-annotation-action-1e88f5a0.js} +1 -1
- package/dist/esm/{index-3e551cbe.js → index-fb3b74bd.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/loader.js +6 -6
- package/dist/esm/{public-rules-c5d2c1e1.js → public-rules-287d4d77.js} +4 -4
- package/dist/esm/{responsive-format-facade-60731164.js → responsive-format-facade-d2632288.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-4429066e.js → rich-text-editor-required-rule-69d5f035.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-6ab5cad6.js → string-input-formatter-slimmer-09478e0d.js} +23 -4
- package/dist/esm/{style-formatter-57fc600a.js → style-formatter-f7951677.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-1c4d1e78.js → sub-state-notify-slimmer-0a6c3cbb.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-1e9af9ec.js → sub-state-observer-slimmer-53eec5fb.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +5 -5
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button-group_2.entry.js +3 -3
- package/dist/esm/vega-button.entry.js +4 -4
- package/dist/esm/vega-calendar_3.entry.js +200 -117
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +4 -4
- package/dist/esm/vega-checkbox_2.entry.js +3 -3
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +3 -3
- package/dist/esm/vega-color-picker.entry.js +3 -3
- package/dist/esm/vega-combo-box.entry.js +3 -3
- package/dist/esm/vega-date-picker_2.entry.js +9 -9
- package/dist/esm/vega-dialog_2.entry.js +5 -5
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +35 -11
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +4 -4
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +6 -6
- package/dist/esm/vega-input-credit-card.entry.js +21 -117
- package/dist/esm/vega-input-numeric.entry.js +4 -4
- package/dist/esm/vega-input-phone-number.entry.js +6 -6
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +12 -9
- package/dist/esm/vega-input.entry.js +198 -6
- package/dist/esm/{vega-internal-event-id-f0ea2bab.js → vega-internal-event-id-4072659b.js} +1 -1
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-loader-wrapper_2.entry.js +4 -4
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -1
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-popover_2.entry.js +5 -5
- package/dist/esm/vega-radio_2.entry.js +3 -3
- package/dist/esm/vega-rich-text-content.entry.js +6 -6
- package/dist/esm/vega-rich-text-editor_4.entry.js +10 -10
- package/dist/esm/vega-selection-chip_2.entry.js +7 -7
- package/dist/esm/vega-selection-tile_2.entry.js +30 -6
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +7 -7
- package/dist/esm/vega-stepper.entry.js +3 -3
- package/dist/esm/vega-table_8.entry.js +6 -6
- package/dist/esm/vega-textarea.entry.js +3 -3
- package/dist/esm/vega-time-picker_2.entry.js +7 -7
- package/dist/esm/vega-toggle-switch.entry.js +3 -3
- package/dist/esm/vega-tooltip_2.entry.js +5 -5
- package/dist/esm/vega.js +6 -6
- package/dist/types/components/vega-calendar/slimmers/common/controllers/vega-calendar-post-operation-date-controller.d.ts +23 -0
- package/dist/types/components/vega-calendar/slimmers/common/renderers/vega-calendar-switch-panel.d.ts +2 -0
- package/dist/types/components/vega-calendar/vega-calendar.d.ts +15 -1
- package/dist/types/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.d.ts +4 -0
- package/dist/types/components/vega-input/slimmers/controllers/vega-input-mask-config-controller.d.ts +7 -0
- package/dist/types/components/vega-input/types.d.ts +10 -1
- package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +1 -13
- package/dist/types/components/vega-selection-tile/slimmers/controllers/vega-selection-tile-state-controller.d.ts +1 -0
- package/dist/types/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.d.ts +8 -0
- package/dist/types/components/vega-selection-tile/vega-selection-tile.d.ts +4 -0
- package/dist/types/components/vega-table/interface.d.ts +18 -11
- package/dist/types/components/vega-table/vega-table-head-cell/vega-table-head-cell.d.ts +1 -1
- package/dist/types/components/vega-table/vega-table.d.ts +1 -1
- package/dist/types/components.d.ts +24 -4
- package/dist/types/helpers/calendar/calendar-period/calendar-period.abstract.d.ts +3 -3
- package/dist/types/helpers/calendar/calendar-period/month-period.d.ts +7 -1
- package/dist/types/helpers/formatter/string-formatter/credit-card-blur-mask-strategy.d.ts +28 -0
- package/dist/types/helpers/formatter/string-formatter/credit-card-input-mask-strategy.d.ts +21 -0
- package/dist/types/helpers/formatter/string-formatter/credit-card-mask-strategy.abstract.d.ts +36 -0
- package/dist/types/helpers/formatter/string-formatter/string-format-strategy.abstract.d.ts +1 -1
- package/dist/types/helpers/formatter/string-formatter/string-mask-strategy.d.ts +9 -3
- package/dist/types/helpers/slimmers/string-input-formatter-slimmer.d.ts +4 -0
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-6acf0a51.entry.js → p-083af15f.entry.js} +1 -1
- package/dist/vega/{p-75ff12da.entry.js → p-091ab617.entry.js} +1 -1
- package/dist/vega/{p-47e89c0e.entry.js → p-0b5330e1.entry.js} +1 -1
- package/dist/vega/{p-f4a7acff.entry.js → p-1a4f77de.entry.js} +1 -1
- package/dist/vega/{p-21a7530c.entry.js → p-1a6dacc7.entry.js} +1 -1
- package/dist/vega/{p-2ebef70f.entry.js → p-1db2ba98.entry.js} +1 -1
- package/dist/vega/{p-e277ea73.entry.js → p-1f9a735a.entry.js} +1 -1
- package/dist/vega/{p-44880bdf.entry.js → p-24042f0c.entry.js} +1 -1
- package/dist/vega/{p-e28fcf04.entry.js → p-27a9ad35.entry.js} +1 -1
- package/dist/vega/{p-0496f1cb.entry.js → p-27ec0c07.entry.js} +1 -1
- package/dist/vega/{p-27dca371.entry.js → p-317920e6.entry.js} +1 -1
- package/dist/vega/{p-a2ef3429.entry.js → p-376b3ec7.entry.js} +1 -1
- package/dist/vega/{p-dc16e6ba.entry.js → p-394594e9.entry.js} +1 -1
- package/dist/vega/{p-8fb5bcb0.entry.js → p-42ec43ef.entry.js} +1 -1
- package/dist/vega/{p-6e1b5949.js → p-43263510.js} +1 -1
- package/dist/vega/{p-29f4cbed.entry.js → p-435451be.entry.js} +1 -1
- package/dist/vega/p-472108bd.entry.js +1 -0
- package/dist/vega/{p-6131f229.entry.js → p-48ae6f02.entry.js} +1 -1
- package/dist/vega/{p-1c4d05de.entry.js → p-48b24fd3.entry.js} +1 -1
- package/dist/vega/{p-fb8c99c5.js → p-4a237308.js} +1 -1
- package/dist/vega/{p-5dec9bd9.entry.js → p-4ab67150.entry.js} +1 -1
- package/dist/vega/{p-d82ceacf.entry.js → p-4c4ac1a5.entry.js} +1 -1
- package/dist/vega/p-4fb159d5.js +1 -0
- package/dist/vega/p-5bd3487e.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-39049341.entry.js → p-5fe47fe8.entry.js} +1 -1
- package/dist/vega/{p-d5ab867e.entry.js → p-61ea2d75.entry.js} +1 -1
- package/dist/vega/{p-e32efc2e.entry.js → p-63adca7b.entry.js} +1 -1
- package/dist/vega/{p-7c0004dc.entry.js → p-699032fc.entry.js} +1 -1
- package/dist/vega/{p-0b77c6c9.entry.js → p-710da484.entry.js} +1 -1
- package/dist/vega/{p-007bf7df.js → p-71c65f7e.js} +1 -1
- package/dist/vega/{p-a92a8172.entry.js → p-81279fea.entry.js} +1 -1
- package/dist/vega/{p-ecd032fc.js → p-8782abeb.js} +1 -1
- package/dist/vega/p-88e08a33.js +1 -0
- package/dist/vega/{p-4f5eb8d5.js → p-8c4f893b.js} +1 -1
- package/dist/vega/p-8e2b1dae.entry.js +1 -0
- package/dist/vega/{p-2873b600.entry.js → p-8f8de5ab.entry.js} +1 -1
- package/dist/vega/p-92355996.entry.js +1 -0
- package/dist/vega/p-9540e3ed.entry.js +1 -0
- package/dist/vega/p-997a2064.entry.js +1 -0
- package/dist/vega/{p-ce14af16.js → p-9a956a00.js} +1 -1
- package/dist/vega/{p-fcb04960.js → p-9afdcf65.js} +1 -1
- package/dist/vega/p-9b08ed46.entry.js +1 -0
- package/dist/vega/{p-b44ebc84.entry.js → p-9ce0bd82.entry.js} +1 -1
- package/dist/vega/{p-f8f8e7d2.entry.js → p-a04491cc.entry.js} +1 -1
- package/dist/vega/{p-99c4559e.entry.js → p-a1056063.entry.js} +1 -1
- package/dist/vega/{p-b449fe9a.entry.js → p-a4a0fcfd.entry.js} +1 -1
- package/dist/vega/{p-f79c82c7.entry.js → p-a7042a5a.entry.js} +1 -1
- package/dist/vega/p-acf7667e.entry.js +1 -0
- package/dist/vega/{p-8ba8a7cc.entry.js → p-b21b128c.entry.js} +1 -1
- package/dist/vega/{p-766ed063.entry.js → p-b75a8edb.entry.js} +1 -1
- package/dist/vega/{p-1e3f4007.entry.js → p-c21295cf.entry.js} +1 -1
- package/dist/vega/{p-5130bb06.entry.js → p-c69a6547.entry.js} +1 -1
- package/dist/vega/{p-79c2282c.entry.js → p-c9740710.entry.js} +1 -1
- package/dist/vega/{p-f4546425.entry.js → p-ce5a3589.entry.js} +1 -1
- package/dist/vega/{p-cd3d468c.js → p-d1355307.js} +1 -1
- package/dist/vega/{p-07927476.entry.js → p-d661a5aa.entry.js} +1 -1
- package/dist/vega/{p-8246f8ae.js → p-d7e0c57a.js} +1 -1
- package/dist/vega/p-e1ed78db.js +1 -0
- package/dist/vega/{p-34643550.entry.js → p-ef84dc90.entry.js} +1 -1
- package/dist/vega/{p-2458ad97.js → p-f229d6d1.js} +1 -1
- package/dist/vega/{p-fd2f699b.js → p-f25570f5.js} +1 -1
- package/dist/vega/{p-888dc143.entry.js → p-f27fcc7c.entry.js} +1 -1
- package/dist/vega/{p-f3f7d059.entry.js → p-f543e911.entry.js} +1 -1
- package/dist/vega/{p-65d8c2bc.js → p-f5ac60f5.js} +1 -1
- package/dist/vega/{p-bdaf1143.entry.js → p-f7b5833d.entry.js} +1 -1
- package/dist/vega/p-fc02a67a.js +1 -0
- package/dist/vega/{p-a33c6652.entry.js → p-fcb5b40f.entry.js} +1 -1
- package/dist/vega/{p-aed3320d.js → p-fda6f8bc.js} +1 -1
- package/dist/vega/{p-e5196440.entry.js → p-fe1512f9.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-0604563a.entry.js +0 -1
- package/dist/vega/p-3a7e897b.entry.js +0 -1
- package/dist/vega/p-51297b96.js +0 -1
- package/dist/vega/p-51a4dc20.entry.js +0 -1
- package/dist/vega/p-53e9595f.js +0 -1
- package/dist/vega/p-6ec338b0.entry.js +0 -1
- package/dist/vega/p-76818196.entry.js +0 -1
- package/dist/vega/p-79a0a06c.js +0 -1
- package/dist/vega/p-9481c073.entry.js +0 -1
- package/dist/vega/p-b8d7d4a9.js +0 -1
- package/dist/vega/p-f8e0e4f0.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as t}from"./p-5e2c9e69.js";import{C as e}from"./p-2d0d575f.js";import{d as s}from"./p-6e01f0a2.js";import{a as n,b as i}from"./p-65d8c2bc.js";import{L as r}from"./p-6e1ab235.js";import{g as o}from"./p-a4670e23.js";import{V as c}from"./p-0c8bd757.js";var a,h;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(a||(a={}));class l{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT"}(h||(h={}));class u extends l{}const d=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap}register(t,e){this.domToEntity.set(t,e),this.entityToDOM.set(e,t)}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}};var p,f,w;!function(t){t.DELETE_CHILD="DELETE_CHILD",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILD_NODES="APPEND_CHILD_NODES",t.INSERT_BLOCKS_AFTER="INSERT_BLOCKS_AFTER",t.INSERT_BLOCKS_BEFORE="INSERT_BLOCKS_BEFORE",t.INSERT_NODES_AFTER="INSERT_NODES_AFTER",t.INSERT_NODES_BEFORE="INSERT_NODES_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.BREAK_SINGLE_BLOCK="BREAK_SINGLE_BLOCK",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK"}(p||(p={}));class x{constructor(){this.isFlushable=!1}}class A extends u{constructor(t){super(),this.type=h.ALIGNMENT,this.textAlign=t}static from(t){return[h.ALIGNMENT,new A(t)]}toJSON(){return{textAlign:this.textAlign}}renderClass(){return`v-rte--horizontal-alignment-${this.textAlign}`}clone(){return new A(this.textAlign)}render(){return null}}class E extends u{constructor(t){super(),this.type=h.INDENT,this.indent=Math.max(0,t)}static from(t){return[h.INDENT,new E(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new E(this.indent)}render(){return this.indent>0?{"margin-left":16*this.indent+"px"}:null}}class g{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,s)}static get(t,e){const s=this.registry.get(e);if(s)return s.get(t)}static executeTheStrategy(t,e){const s=t instanceof x?t.type:t.constructor.name,n=g.get(s,e.constructor.name);if(n)return n.execute(t,e);r.error(`Type ${s} action handle strategy is not registered in class ${e.constructor.name}`)}}g.registry=new Map;class O{constructor(t){this.annotationMap=new Map,this.id=t}static createAnnotationEntity(t,e){switch(t){case"textAlign":return A.from(e);case"indent":return E.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof u)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(t){if(this.doApply(t),t.isFlushable){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}}isListItemBlock(){return"list-item"===this.type}doApply(t){t instanceof x?g.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(f||(f={}));class N{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}getAnnotationByType(t){return this.annotationMap.get(t)}deleteAnnotationByType(t){this.annotationMap.delete(t),this.flushChange()}apply(t){return this.doApply(t),t.isFlushable&&this.flushChange(),this}doApply(t){t instanceof x?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.BOLD="BOLD",t.ITALIC="ITALIC",t.UNDERLINE="UNDERLINE",t.STRIKETHROUGH="STRIKETHROUGH",t.SELECTION_RANGE="SELECTION_RANGE",t.IMAGE="IMAGE",t.CODE="CODE",t.TEXT_COLOR="TEXT_COLOR",t.LINK="LINK"}(w||(w={}));class y extends l{}class S extends y{constructor(t="md",e){super(),this.type=w.IMAGE,this.size=t,this.alt=e}static from(t,e){return[w.IMAGE,new S(t,e)]}toJSON(){return t(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new S(this.size,this.alt)}render(){switch(this.size){case"sm":return{width:"25%"};case"md":return{width:"50%"};case"lg":return{width:"100%"}}}}class T{execute(t,e){return r.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}isCaretPositionAtTextBlockEnd(t,e,s){const n=t.children[t.children.length-1];return e===n&&(e.isEmpty()||s===n.text.length)}isCaretPositionAtTextBlockStart(t,e,s){return e===t.children[0]&&0===s}isCaretPositionAtImageBlockStart(t,e,s){return e===t.children[0]&&0===s}isCaretPositionAtImageBlockEnd(t,e,s){return e===t.children[t.children.length-1]&&1===s}}class m{}class _ extends N{constructor(t,e,s,n){super(t,n),this.type=f.IMAGE,this.url=e,this.parent=s}static from(e,s){const n=new _(e.id,e.url,s);let i;return i=e.annotations&&0!==Object.keys(e.annotations).length?e.annotations:{size:"md"},n.annotationMap=new Map(Object.keys(i).map((()=>S.from(i.size,i.alt))).filter(t)),n}toJSON(){const t=this.annotationMap.get(w.IMAGE),e={};return(null==t?void 0:t.size)&&(e.size=t.size),(null==t?void 0:t.alt)&&(e.alt=t.alt),Object.assign(Object.assign({id:this.id},Object.keys(e).length>0?{annotations:e}:{}),{type:"image",url:this.url})}clone(){return new _(this.id,this.url,this.parent,super.cloneAnnotations())}doAnnotationActionApply(t){const e=g.get(m.name,_.name);e&&e.execute(t,this)}doModifyActionApply(t){g.executeTheStrategy(t,this)}}g.register(p.UPDATE_IMAGE_NODE_URL,_.name,new class extends T{handleAction(t,e){e.url=t.url}}),g.register(m.name,_.name,new class extends T{handleAction(t,e){const s=t.toAnnotation();e.annotationMap.set(s.type,s)}});class C extends x{constructor(t){super(),this.type=p.DELETE_CHILD,this.entityToBeRemoved=t}}class L extends T{getPreviousNode(t){const e=t.parent,s=e.children.indexOf(t);if(s>0)return e.children[s-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parent,s=e.children.indexOf(t);if(e.children[s+1])return e.children[s+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parent,s=e.children.indexOf(t),n=e.parent;if(e.isListItemBlock()){const t=n.parent;return 0===s&&Array.isArray(n.children)&&n.children[0]===e&&"list-item"!==t.type&&Array.isArray(t.children)&&t.children[0]===n}return 0===s&&Array.isArray(n.children)&&n.children[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(e>0)return t.parent.children[e-1];if(("number-list"===t.parent.type||"bullet-list"===t.parent.type)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){return t.getLastNode()}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.children)return this.getBlockFirstNode(t.children[0])}else if(t.children)return t.children[0]}getNextBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(t.parent.children[e+1])return t.parent.children[e+1];if("list-item"===t.type&&t.parent.children.length===e+1)return this.getNextBlock(t.parent)}}}class B extends x{constructor(t){super(),this.type=p.APPEND_CHILD_NODES,this.entityToBeAppended=t}}class I extends T{handleAction(t,e){const s=t.blockNeedToBeMerged;if(e.type===s.type||"image"!==e.type&&"image"!==s.type){let t=s.children;"image"!==s.type&&(t=s.children.filter((t=>t.text))),e.apply(new B(t)),s.parent.apply(new C(s))}}}class k extends T{handleAction(t,e){e.children=e.children.filter((e=>e!==t.entityToBeRemoved)),0===e.children.length&&e.parent&&e.parent.apply(new C(e))}}class D extends T{handleAction(t,e){const s=t.entityToBeAppended;s.forEach((t=>{t.parent=e})),e.children=e.children.concat(s)}}class R extends T{handleAction(t,e){e.children=[],e.apply(new B(t.newChildNodes))}}class b extends x{constructor(t,...e){super(),this.type=p.INSERT_BLOCKS_AFTER,this.referBlock=t,this.blocksToBeInserted=e}}class M extends x{constructor(t){super(),this.type=p.REPLACE_CHILD_NODES,this.newChildNodes=t}}class F extends x{constructor(t,...e){super(),this.type=p.INSERT_BLOCKS_BEFORE,this.referBlock=t,this.blocksToBeInserted=e}}class K extends x{constructor(t,e){super(),this.type=p.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class j extends m{constructor(){super(...arguments),this.doSplit=!0}}class P extends l{constructor(t){super(),this.type=a.SELECTION_RANGE,this.range=t}clone(){return new P(this.range)}}class v extends y{constructor(t){super(),this.type=w.STRIKETHROUGH,this.strikethrough=t}static from(t){return[w.STRIKETHROUGH,new v(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new v(this.strikethrough)}renderClass(){return this.strikethrough?"v-rte--strikethrough":null}render(){return null}}class H extends y{constructor(t){super(),this.type=w.UNDERLINE,this.underline=t}static from(t){return[w.UNDERLINE,new H(t)]}toJSON(){return{underline:this.underline}}clone(){return new H(this.underline)}renderClass(){return this.underline?"v-rte--underline":null}render(){return null}}class J extends y{constructor(t){super(),this.type=w.ITALIC,this.italic=t}static from(t){return[w.ITALIC,new J(t)]}toJSON(){return{italic:this.italic}}clone(){return new J(this.italic)}render(){return this.italic?{"font-style":"italic"}:null}}class W extends y{constructor(t){super(),this.type=w.BOLD,this.bold=t}static from(t){return[w.BOLD,new W(t)]}toJSON(){return{bold:this.bold}}clone(){return new W(this.bold)}render(){return this.bold?{"font-weight":"700"}:null}}class G extends y{constructor(t){super(),this.type=w.CODE,this.code=t}static from(t){return[w.CODE,new G(t)]}toJSON(){return{code:this.code}}clone(){return new G(this.code)}renderClass(){return this.code?"v-rte--code":null}render(){return null}}const z=[{key:"black",light:"#111128",dark:"#E3E3E8"},{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],U="";class $ extends y{constructor(t){super(),this.type=w.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[w.TEXT_COLOR,new $(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new $(this.textColor.key)}renderClass(){return null}render(){return{color:c.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return z.find((e=>e.key===t))||z[0]}}class X extends y{constructor(t){super(),this.type=w.LINK,this.link=t}static from(t){return[w.LINK,new X({href:t.href,groupKey:t.groupKey})]}toJSON(){return{link:{href:this.link.href,groupKey:this.link.groupKey}}}clone(){return new X(this.link)}toEqual(t){return this.link.groupKey===t.link.groupKey}render(){return null}}class q extends l{constructor(t){super(),this.type=a.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}clone(){const t=new q("");return this.linkGroups.forEach(((e,s)=>{t.linkGroups.set(s,e.map((t=>t.clone())))})),t}}class V extends m{constructor(t,e){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e}toAnnotation(){return new q(this.groupKey)}}class Y extends m{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class Q extends x{constructor(t){super(),this.type=p.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class Z extends l{constructor(){super(...arguments),this.type=a.CLEAR_FORMATTING,this.items=[w.BOLD,w.ITALIC,w.UNDERLINE,w.STRIKETHROUGH,w.TEXT_COLOR,w.CODE]}}class tt extends j{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new Z}}class et extends j{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new G(this.code)}}class st extends m{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class nt extends j{constructor({link:e,newText:s,needMergeNode:n,doSplit:i}){super(),this.isFlushable=!0,this.link=e,this.needMergeNode=n,this.newText=s,t(i)&&(this.doSplit=i)}toAnnotation(){return new X(this.link)}}class it extends N{constructor(t,e,s,n){super(t,n),this.type=f.TEXT,this.parent=s,this.text=e}static from(e,s){const n=new it(e.id,e.text,s),{annotations:i}=e;return i&&(n.annotationMap=new Map(Object.keys(i).map((t=>(i.link&&s.apply(new V(i.link.groupKey,[n])),this.createAnnotationEntity(t,i[t])))).filter(t))),n}static createAnnotationEntity(t,e){switch(t){case"bold":return W.from(e);case"italic":return J.from(e);case"underline":return H.from(e);case"strikethrough":return v.from(e);case"code":return G.from(e);case"textColor":return $.from(e);case"link":return X.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof y)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}cloneWithText(t){return new it(o(),t,this.parent,super.cloneAnnotations())}clone(){return new it(this.id,this.text,this.parent,super.cloneAnnotations())}isEmpty(){return!this.text||""===this.text||"\n"===this.text}doAnnotationActionApply(t){const e=this.getAnnotationByType(a.SELECTION_RANGE);if(t instanceof j&&t.doSplit&&e){const e=g.get(j.name,it.name);if(e){const s=e.execute(t,this);s&&this.applyActionToNode(s,t)}}else this.applyActionToNode(this,t);this.parent.mergeNodes(t)}doModifyActionApply(t){g.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof Y)return void this.syncUpSelectedNodes(t);s instanceof P||this.syncUpSelectedNodes(t);const n=g.get(m.name,it.name);n&&n.execute(e,t)}syncUpSelectedNodes(t){const n=d.getDOMByEntity(this);if(n){const r=s.getSubjectFromParentNodeByEventId(n,i);r&&e.notify(r,{node:t})}}}g.register(p.UPDATE_TEXT,it.name,new class extends T{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.annotationMap.delete(w.LINK)}}),g.register(p.REPLACE_SELECTED_TEXT,it.name,new class extends T{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,s){if(e&&e.startContainer&&e.endContainer){const{startContainer:n,endContainer:i,startOffset:r,endOffset:o}=e;let c=s.text;if(n===i&&r===o&&t)c=s.text.slice(0,r)+t+s.text.slice(r);else{const e=n.parentElement,a=i.parentElement,h=e&&d.getEntityByDOM(e),l=a&&d.getEntityByDOM(a);let u=0,p=s.text.length;h&&h===s?(u=r,p=n===i?o:p):l&&l===s&&(p=o),c=s.text.slice(0,u)+t+s.text.slice(p)}s.apply(new Q(c))}}}),g.register(j.name,it.name,new class extends T{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(a.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof j&&t.doSplit&&s){const{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=s.range,o=t===n&&i===r;e.parent.children=e.parent.children.flatMap((t=>t.id===e.id?o?this.insertNewNode(i,e):this.shouldSplitSelection(s.range)?this.splitTextNode(s.range,e):(this.setApplyTargetNode(e),e):t))}return this.applyTargetNode}insertNewNode(t,e){const s=e.cloneWithText("");return this.setApplyTargetNode(s),0===t?[s,e]:t===e.text.length?[e,s]:[e.cloneWithText(e.text.substring(0,t)),s,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:s,startOffset:n,endOffset:i}=t;return e!==s||n>0||i<(s.textContent?s.textContent.length:0)}splitTextNode(t,e){const{startContainer:s,endContainer:n,startOffset:i}=t,r=s.parentElement,o=n.parentElement,c=(t,s,n)=>{const i=t.substring(0,s),r=t.substring(s,n),o=t.substring(n);return[e.cloneWithText(i),e.cloneWithText(r),e.cloneWithText(o)]},a=r&&d.getEntityByDOM(r),h=o&&d.getEntityByDOM(o);if(a&&a.id===e.id){const r=s===n?t.endOffset:e.text.length,[o,a,h]=c(e.text,i,r);return this.setApplyTargetNode(a),[o,a,h].filter((t=>!!t.text))}if(h&&h.id===e.id){const[s,n,i]=c(e.text,0,t.endOffset);return this.setApplyTargetNode(n),[s,n,i].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}),g.register(m.name,it.name,new class extends T{handleAction(e,s){const n=e.toAnnotation();if(e instanceof st)s.annotationMap.delete(e.annotationType);else{if(!(n instanceof Z))return n instanceof y||n instanceof P?(e instanceof nt&&(t(e.newText)&&(s.text=e.newText),s.parent.apply(new V(e.link.groupKey,[s]))),e instanceof et&&this.handleAction(new tt,s),void s.annotationMap.set(n.type,n)):void 0;n.items.forEach((t=>{s.deleteAnnotationByType(t)}))}}});class rt extends u{constructor(t){super(),this.type=h.TEXT_STYLE,this.textStyle=t}static from(t){return[h.TEXT_STYLE,new rt(t)]}toJSON(){return{textStyle:this.textStyle}}clone(){return new rt(this.textStyle)}render(){const t={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500"};switch(this.textStyle){case"paragraph":return t;case"title":return{fontFamily:"Inter",fontSize:"36px",lineHeight:"40px",fontWeight:"500"};case"subtitle":return{fontFamily:"Inter",fontSize:"28px",lineHeight:"32px",fontWeight:"500"};case"heading-1":return{fontFamily:"Inter",fontSize:"22px",lineHeight:"24px",fontWeight:"500"};case"heading-2":return{fontFamily:"Inter",fontSize:"20px",lineHeight:"24px",fontWeight:"500"};case"heading-3":return{fontFamily:"Inter",fontSize:"18px",lineHeight:"22px",fontWeight:"500"};case"heading-4":return{fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500"};case"heading-5":return{fontFamily:"Inter",fontSize:"14px",lineHeight:"22px",fontWeight:"500"};case"heading-6":return{fontFamily:"Inter",fontSize:"12px",lineHeight:"22px",fontWeight:"500"}}}}class ot extends m{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new rt(this.textStyle)}}class ct extends j{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new W(this.bold)}}class at extends T{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,s){if(t){const n=t.text.slice(0,e),i=t.text.slice(e),r=s.children.indexOf(t);if(r>-1){const e=s.children.slice(0,r),o=s.children.slice(r+1);n&&e.push(t.cloneWithText(n)),i&&o.unshift(t.cloneWithText(i)),s.apply(new M(e));const c=s.cloneWithNodes(o);return s.parent.apply(new b(s,c)),c}}}}class ht extends T{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new it(o(),"\n",s),i=t.text.slice(0,e),r=t.text.slice(e),c=s.children.indexOf(t);if(c>-1){const e=s.children.slice(0,c),o=s.children.slice(c+1);i&&e.push(t.cloneWithText(i)),r&&o.unshift(t.cloneWithText(r)),this.mergeLineBreakNodes(e,n,o,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new it(o(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new M([...t,e,...s]))}}class lt extends T{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.children,n=new it(o(),"\n",e),i=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(s,n,i,e),n}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new C(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new it(o(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new M([...t,e,...s]))}}class ut extends x{constructor(t){super(),this.type=p.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class dt extends L{handleAction(t,e){this.deleteNodeContent(t,e)}deleteNodeContent(t,e){const s=t.startContainerNode,n=t.startOffset;if(0!==n&&!s.isEmpty()){const i=s.text.slice(0,n-1)+s.text.slice(n);if(s.apply(new Q(i)),i)return void(t.previousNode=s);{const n=this.getPreviousNode(s);return n&&n.parent===e&&"\n"===n.text||1===e.children.length?void(t.previousNode=s):(e.apply(new C(s)),void(t.previousNode=n))}}{let n=this.getPreviousNode(s),i=null;if(e.children.length&&n&&n.parent!==e)s.isEmpty()&&e.apply(new C(s)),e.type===n.parent.type&&n.parent.apply(new ut(e));else if(this.isContentFirstNode(s)&&s.isEmpty()&&(i=this.getNextNode(s)),s.isEmpty()&&e.apply(new C(s)),n instanceof it&&n.isEmpty()){const t=n;n=this.getPreviousNode(n),t.parent.apply(new C(t)),n||(i=s)}0===e.children.length&&e.parent.apply(new C(e)),n?t.previousNode=n:i&&(t.nextNode=i)}}}class pt extends T{replaceNodeWithNodes(t,e,s){t.children&&(s.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?s:t)))}}class ft extends pt{handleAction(t,e){const s=t.referNode,n=[...t.nodesToBeInserted,s];this.replaceNodeWithNodes(e,s,n)}}class wt extends O{constructor(t,e){super(t),this.children=[],this.type=e,this.annotationMap=wt.isAcceptableTextStyle(e)?new Map([rt.from(e)]):new Map([rt.from("paragraph")])}static from(e){const s=new wt(e.id,e.type),{annotations:n}=e;return s.children=e.nodes.map((t=>it.from(t,s))),n&&Object.entries(n).forEach((([e,n])=>{const i=this.createAnnotationEntity(e,n);t(i)&&s.annotationMap.set(...i)})),s}static createAnnotationEntity(t,e){return"textStyle"===t?rt.from(e):super.createAnnotationEntity(t,e)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(t)}mergeNodes(t){this.children=this.children.reduce(((e,s)=>{const n=e.at(-1);if(t instanceof nt&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(w.LINK),i=s.getAnnotationByType(w.LINK);if(t&&i&&t.toEqual(i))return e}return[...e,s]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.children.map((t=>t.toJSON()))})}cloneWithNodes(t){const e=new wt(o(),this.type);return e.children=[],e.apply(new B(t)),e}clone(){const t=new wt(this.id,this.type);return t.children=this.children.map((e=>{const s=e.clone();return s.parent=t,s})),t.annotationMap=super.cloneAnnotations(),t.parent=this.parent,t}isNotEmpty(){return this.children.length>0&&this.children.some((t=>!t.isEmpty()))}getLastNode(){return this.children[this.children.length-1]}createNewParagraph(){return new wt(o(),"paragraph")}doAnnotationActionApply(t){const e=g.get(t.constructor.name,wt.name);e&&e.execute(t,this)}}g.register(ot.name,wt.name,new class extends T{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new ct(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new st(w.BOLD))})}}),g.register(V.name,wt.name,new class extends T{handleAction(t,e){const s=e.getAnnotationByType(a.LINK_GROUP);if(s){const n=s.linkGroups.get(t.groupKey);s.linkGroups.set(t.groupKey,[...n,...t.nodes]),e.annotationMap.set(a.LINK_GROUP,s)}}}),g.register(p.DELETE_CHILD,wt.name,new k),g.register(p.APPEND_CHILD_NODES,wt.name,new D),g.register(p.SPLIT_BLOCK_WITH_NODE,wt.name,new at),g.register(p.REPLACE_CHILD_NODES,wt.name,new R),g.register(p.MERGE_TWO_BLOCKS_NODES,wt.name,new I),g.register(p.BREAK_SINGLE_BLOCK,wt.name,new class extends T{handleAction(t,e){t.newBlock=this.breakSingleTextBlock(t.startContainerNode,t.startOffset,e)}breakSingleTextBlock(t,e,s){const n=this.copyInlineStyleToNewParagraph(t,s);if(this.isCaretPositionAtTextBlockEnd(s,t,e))s.parent.apply(new b(s,n));else{if(!this.isCaretPositionAtTextBlockStart(s,t,e)){const n=new K(t,e);return s.apply(n),n.newBlock}s.parent.apply(new F(s,n))}return n}copyInlineStyleToNewParagraph(t,e){const s=t.cloneWithText("");s.annotationMap.delete(w.LINK);const n=e.createNewParagraph();return n.apply(new B([s])),n}}),g.register(p.LINE_BREAK_SINGLE_BLOCK,wt.name,new ht),g.register(p.LINE_BREAK_MULTIPLE_BLOCKS,wt.name,new lt),g.register(p.DELETE_BLOCK_CONTENT,wt.name,new dt),g.register(p.INSERT_IMAGE_TO_BLOCK,wt.name,new class extends T{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,i=t.imageBlockToBeInserted;if(this.isCaretPositionAtTextBlockEnd(e,s,n))e.parent.apply(new b(e,i));else if(this.isCaretPositionAtTextBlockStart(e,s,n))e.parent.apply(new F(e,i));else{const t=new K(s,n);e.apply(t),e.parent.apply(new b(e,i))}}}),g.register(p.INSERT_NODES_BEFORE,wt.name,new ft),g.register(p.TRANSFORM_LIST_BLOCK,wt.name,new class extends T{handleAction(t,e){const s=e.parent,n=s.createList(t.listType),i=t.selectedBlocks,r=i.map((t=>s.toListItem(t)));n.apply(new B(r)),s.apply(new b(t.selectedBlocks[0],n)),i.forEach((t=>{t.parent.apply(new C(t))}))}});class xt extends x{constructor(t,e){super(),this.isFlushable=!0,this.type=p.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class At extends m{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new P(this.range)}}class Et extends N{constructor(t,e,s,n){super(t),this.type=f.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=n,this.language=s}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}clone(){return new Et(this.id,this.text,this.language,this.parent)}doAnnotationActionApply(t){g.executeTheStrategy(t,this)}doModifyActionApply(t){g.executeTheStrategy(t,this)}}g.register(p.UPDATE_CODE_BLOCK,Et.name,new class extends T{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),g.register(At.name,Et.name,new class extends T{handleAction(t,e){e.annotationMap.set(a.SELECTION_RANGE,t.toAnnotation())}});class gt extends O{constructor(t,e,s){super(t),this.type="code-block",this.children=[new Et(`${t}-1`,e,s,this)]}static from(t){return new gt(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.children[0];return{id:this.id,type:"code-block",content:e,language:t}}clone(){const t=gt.from(this.toJSON());return t.parent=this.parent,t}apply(t){if(t instanceof x&&g.executeTheStrategy(t,this),t.isFlushable){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}}isNotEmpty(){return!!this.children.length}getLastNode(){return this.children[0]}isSelected(){return this.children[0].annotationMap.has(a.SELECTION_RANGE)}}g.register(p.DELETE_CODE_BLOCK,gt.name,new class extends L{handleAction(t,e){const s=e.children[0],n=e.parent;if(n){let t=this.getPreviousNode(s),i=this.getRTENodeEndOffset(t);t||(t=this.getNextNode(s),i=0),n.apply(new C(e));const r=t?d.getDOMByEntity(t):null;if(0===n.children.length){const s=wt.from({id:o(),type:"paragraph",nodes:[{id:o(),type:"text",text:""}]});e.parent.apply(new B([s])),t=s.children[0],i=0}this.notifyUpdateSelection(t,r,i,e)}}notifyUpdateSelection(t,n,r,o){const c=d.getDOMByEntity(o);if(c){const o=s.getSubjectFromParentNodeByEventId(c,i);o&&e.notify(o,{node:t,updateDirectly:!!n,offset:r})}}getRTENodeEndOffset(t){return t&&"CODE_BLOCK_NODE"!==t.type?"IMAGE"!==t.type?t.text.length:1:0}}),g.register(p.DELETE_CHILD,gt.name,new k),g.register(p.SWITCH_OUT_FROM_CODE_BLOCK,gt.name,new class extends T{handleAction(t,n){const{content:r,language:c}=t,a=r.split("\n"),h=new xt(a.slice(0,a.length-2).join("\n"),c);h.isFlushable=!1,n.children[0].apply(h);const l=wt.from({id:o(),type:"paragraph",nodes:[{id:o(),text:"",type:"text"}]});n.parent.apply(new b(n,l));const u=d.getDOMByEntity(n);if(u){const t=s.getSubjectFromParentNodeByEventId(u,i);t&&e.notify(t,{node:l.children[0]})}}}),g.register(p.INSERT_IMAGE_TO_BLOCK,gt.name,new class extends T{handleAction(t,e){e.parent.apply(new b(e,t.imageBlockToBeInserted))}}),gt.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{E as $,T as A,L as B,S as C,At as D,$ as E,z as F,Et as G,m as H,b as I,ct as J,J as K,nt as L,x as M,w as N,H as O,ot as P,rt as Q,C as R,K as S,j as T,xt as U,W as V,h as W,tt as X,et as Y,U as Z,v as _,_ as a,A as a0,Q as a1,ut as a2,M as b,B as c,wt as d,F as e,p as f,it as g,pt as h,O as i,g as j,I as k,k as l,D as m,R as n,ft as o,dt as p,ht as q,lt as r,at as s,Y as t,gt as u,N as v,d as w,u as x,y,a as z}
|
|
1
|
+
import{i as t}from"./p-5e2c9e69.js";import{C as e}from"./p-2d0d575f.js";import{d as s}from"./p-6e01f0a2.js";import{a as n,b as i}from"./p-f5ac60f5.js";import{L as r}from"./p-6e1ab235.js";import{g as o}from"./p-a4670e23.js";import{V as c}from"./p-0c8bd757.js";var a,h;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(a||(a={}));class l{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT"}(h||(h={}));class u extends l{}const d=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap}register(t,e){this.domToEntity.set(t,e),this.entityToDOM.set(e,t)}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}};var p,f,w;!function(t){t.DELETE_CHILD="DELETE_CHILD",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILD_NODES="APPEND_CHILD_NODES",t.INSERT_BLOCKS_AFTER="INSERT_BLOCKS_AFTER",t.INSERT_BLOCKS_BEFORE="INSERT_BLOCKS_BEFORE",t.INSERT_NODES_AFTER="INSERT_NODES_AFTER",t.INSERT_NODES_BEFORE="INSERT_NODES_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.BREAK_SINGLE_BLOCK="BREAK_SINGLE_BLOCK",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK"}(p||(p={}));class x{constructor(){this.isFlushable=!1}}class A extends u{constructor(t){super(),this.type=h.ALIGNMENT,this.textAlign=t}static from(t){return[h.ALIGNMENT,new A(t)]}toJSON(){return{textAlign:this.textAlign}}renderClass(){return`v-rte--horizontal-alignment-${this.textAlign}`}clone(){return new A(this.textAlign)}render(){return null}}class E extends u{constructor(t){super(),this.type=h.INDENT,this.indent=Math.max(0,t)}static from(t){return[h.INDENT,new E(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new E(this.indent)}render(){return this.indent>0?{"margin-left":16*this.indent+"px"}:null}}class g{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,s)}static get(t,e){const s=this.registry.get(e);if(s)return s.get(t)}static executeTheStrategy(t,e){const s=t instanceof x?t.type:t.constructor.name,n=g.get(s,e.constructor.name);if(n)return n.execute(t,e);r.error(`Type ${s} action handle strategy is not registered in class ${e.constructor.name}`)}}g.registry=new Map;class O{constructor(t){this.annotationMap=new Map,this.id=t}static createAnnotationEntity(t,e){switch(t){case"textAlign":return A.from(e);case"indent":return E.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof u)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(t){if(this.doApply(t),t.isFlushable){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}}isListItemBlock(){return"list-item"===this.type}doApply(t){t instanceof x?g.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(f||(f={}));class N{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}getAnnotationByType(t){return this.annotationMap.get(t)}deleteAnnotationByType(t){this.annotationMap.delete(t),this.flushChange()}apply(t){return this.doApply(t),t.isFlushable&&this.flushChange(),this}doApply(t){t instanceof x?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.BOLD="BOLD",t.ITALIC="ITALIC",t.UNDERLINE="UNDERLINE",t.STRIKETHROUGH="STRIKETHROUGH",t.SELECTION_RANGE="SELECTION_RANGE",t.IMAGE="IMAGE",t.CODE="CODE",t.TEXT_COLOR="TEXT_COLOR",t.LINK="LINK"}(w||(w={}));class y extends l{}class S extends y{constructor(t="md",e){super(),this.type=w.IMAGE,this.size=t,this.alt=e}static from(t,e){return[w.IMAGE,new S(t,e)]}toJSON(){return t(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new S(this.size,this.alt)}render(){switch(this.size){case"sm":return{width:"25%"};case"md":return{width:"50%"};case"lg":return{width:"100%"}}}}class T{execute(t,e){return r.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}isCaretPositionAtTextBlockEnd(t,e,s){const n=t.children[t.children.length-1];return e===n&&(e.isEmpty()||s===n.text.length)}isCaretPositionAtTextBlockStart(t,e,s){return e===t.children[0]&&0===s}isCaretPositionAtImageBlockStart(t,e,s){return e===t.children[0]&&0===s}isCaretPositionAtImageBlockEnd(t,e,s){return e===t.children[t.children.length-1]&&1===s}}class m{}class _ extends N{constructor(t,e,s,n){super(t,n),this.type=f.IMAGE,this.url=e,this.parent=s}static from(e,s){const n=new _(e.id,e.url,s);let i;return i=e.annotations&&0!==Object.keys(e.annotations).length?e.annotations:{size:"md"},n.annotationMap=new Map(Object.keys(i).map((()=>S.from(i.size,i.alt))).filter(t)),n}toJSON(){const t=this.annotationMap.get(w.IMAGE),e={};return(null==t?void 0:t.size)&&(e.size=t.size),(null==t?void 0:t.alt)&&(e.alt=t.alt),Object.assign(Object.assign({id:this.id},Object.keys(e).length>0?{annotations:e}:{}),{type:"image",url:this.url})}clone(){return new _(this.id,this.url,this.parent,super.cloneAnnotations())}doAnnotationActionApply(t){const e=g.get(m.name,_.name);e&&e.execute(t,this)}doModifyActionApply(t){g.executeTheStrategy(t,this)}}g.register(p.UPDATE_IMAGE_NODE_URL,_.name,new class extends T{handleAction(t,e){e.url=t.url}}),g.register(m.name,_.name,new class extends T{handleAction(t,e){const s=t.toAnnotation();e.annotationMap.set(s.type,s)}});class C extends x{constructor(t){super(),this.type=p.DELETE_CHILD,this.entityToBeRemoved=t}}class L extends T{getPreviousNode(t){const e=t.parent,s=e.children.indexOf(t);if(s>0)return e.children[s-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parent,s=e.children.indexOf(t);if(e.children[s+1])return e.children[s+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parent,s=e.children.indexOf(t),n=e.parent;if(e.isListItemBlock()){const t=n.parent;return 0===s&&Array.isArray(n.children)&&n.children[0]===e&&"list-item"!==t.type&&Array.isArray(t.children)&&t.children[0]===n}return 0===s&&Array.isArray(n.children)&&n.children[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(e>0)return t.parent.children[e-1];if(("number-list"===t.parent.type||"bullet-list"===t.parent.type)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){return t.getLastNode()}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.children)return this.getBlockFirstNode(t.children[0])}else if(t.children)return t.children[0]}getNextBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(t.parent.children[e+1])return t.parent.children[e+1];if("list-item"===t.type&&t.parent.children.length===e+1)return this.getNextBlock(t.parent)}}}class B extends x{constructor(t){super(),this.type=p.APPEND_CHILD_NODES,this.entityToBeAppended=t}}class I extends T{handleAction(t,e){const s=t.blockNeedToBeMerged;if(e.type===s.type||"image"!==e.type&&"image"!==s.type){let t=s.children;"image"!==s.type&&(t=s.children.filter((t=>t.text))),e.apply(new B(t)),s.parent.apply(new C(s))}}}class k extends T{handleAction(t,e){e.children=e.children.filter((e=>e!==t.entityToBeRemoved)),0===e.children.length&&e.parent&&e.parent.apply(new C(e))}}class D extends T{handleAction(t,e){const s=t.entityToBeAppended;s.forEach((t=>{t.parent=e})),e.children=e.children.concat(s)}}class R extends T{handleAction(t,e){e.children=[],e.apply(new B(t.newChildNodes))}}class M extends x{constructor(t,...e){super(),this.type=p.INSERT_BLOCKS_AFTER,this.referBlock=t,this.blocksToBeInserted=e}}class b extends x{constructor(t){super(),this.type=p.REPLACE_CHILD_NODES,this.newChildNodes=t}}class F extends x{constructor(t,...e){super(),this.type=p.INSERT_BLOCKS_BEFORE,this.referBlock=t,this.blocksToBeInserted=e}}class K extends x{constructor(t,e){super(),this.type=p.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class j extends m{constructor(){super(...arguments),this.doSplit=!0}}class P extends l{constructor(t){super(),this.type=a.SELECTION_RANGE,this.range=t}clone(){return new P(this.range)}}class v extends y{constructor(t){super(),this.type=w.STRIKETHROUGH,this.strikethrough=t}static from(t){return[w.STRIKETHROUGH,new v(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new v(this.strikethrough)}renderClass(){return this.strikethrough?"v-rte--strikethrough":null}render(){return null}}class H extends y{constructor(t){super(),this.type=w.UNDERLINE,this.underline=t}static from(t){return[w.UNDERLINE,new H(t)]}toJSON(){return{underline:this.underline}}clone(){return new H(this.underline)}renderClass(){return this.underline?"v-rte--underline":null}render(){return null}}class J extends y{constructor(t){super(),this.type=w.ITALIC,this.italic=t}static from(t){return[w.ITALIC,new J(t)]}toJSON(){return{italic:this.italic}}clone(){return new J(this.italic)}render(){return this.italic?{"font-style":"italic"}:null}}class W extends y{constructor(t){super(),this.type=w.BOLD,this.bold=t}static from(t){return[w.BOLD,new W(t)]}toJSON(){return{bold:this.bold}}clone(){return new W(this.bold)}render(){return this.bold?{"font-weight":"700"}:null}}class G extends y{constructor(t){super(),this.type=w.CODE,this.code=t}static from(t){return[w.CODE,new G(t)]}toJSON(){return{code:this.code}}clone(){return new G(this.code)}renderClass(){return this.code?"v-rte--code":null}render(){return null}}const z=[{key:"black",light:"#111128",dark:"#E3E3E8"},{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],U="";class $ extends y{constructor(t){super(),this.type=w.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[w.TEXT_COLOR,new $(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new $(this.textColor.key)}renderClass(){return null}render(){return{color:c.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return z.find((e=>e.key===t))||z[0]}}class X extends y{constructor(t){super(),this.type=w.LINK,this.link=t}static from(t){return[w.LINK,new X({href:t.href,groupKey:t.groupKey})]}toJSON(){return{link:{href:this.link.href,groupKey:this.link.groupKey}}}clone(){return new X(this.link)}toEqual(t){return this.link.groupKey===t.link.groupKey}render(){return null}}class q extends l{constructor(t){super(),this.type=a.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}clone(){const t=new q("");return this.linkGroups.forEach(((e,s)=>{t.linkGroups.set(s,e.map((t=>t.clone())))})),t}}class V extends m{constructor(t,e){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e}toAnnotation(){return new q(this.groupKey)}}class Y extends m{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class Q extends x{constructor(t){super(),this.type=p.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class Z extends l{constructor(){super(...arguments),this.type=a.CLEAR_FORMATTING,this.items=[w.BOLD,w.ITALIC,w.UNDERLINE,w.STRIKETHROUGH,w.TEXT_COLOR,w.CODE]}}class tt extends j{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new Z}}class et extends j{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new G(this.code)}}class st extends m{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class nt extends j{constructor({link:e,newText:s,needMergeNode:n,doSplit:i}){super(),this.isFlushable=!0,this.link=e,this.needMergeNode=n,this.newText=s,t(i)&&(this.doSplit=i)}toAnnotation(){return new X(this.link)}}class it extends N{constructor(t,e,s,n){super(t,n),this.type=f.TEXT,this.parent=s,this.text=e}static from(e,s){const n=new it(e.id,e.text,s),{annotations:i}=e;return i&&(n.annotationMap=new Map(Object.keys(i).map((t=>(i.link&&s.apply(new V(i.link.groupKey,[n])),this.createAnnotationEntity(t,i[t])))).filter(t))),n}static createAnnotationEntity(t,e){switch(t){case"bold":return W.from(e);case"italic":return J.from(e);case"underline":return H.from(e);case"strikethrough":return v.from(e);case"code":return G.from(e);case"textColor":return $.from(e);case"link":return X.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof y)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}cloneWithText(t){return new it(o(),t,this.parent,super.cloneAnnotations())}clone(){return new it(this.id,this.text,this.parent,super.cloneAnnotations())}isEmpty(){return!this.text||""===this.text||"\n"===this.text}doAnnotationActionApply(t){const e=this.getAnnotationByType(a.SELECTION_RANGE);if(t instanceof j&&t.doSplit&&e){const e=g.get(j.name,it.name);if(e){const s=e.execute(t,this);s&&this.applyActionToNode(s,t)}}else this.applyActionToNode(this,t);this.parent.mergeNodes(t)}doModifyActionApply(t){g.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof Y)return void this.syncUpSelectedNodes(t);s instanceof P||this.syncUpSelectedNodes(t);const n=g.get(m.name,it.name);n&&n.execute(e,t)}syncUpSelectedNodes(t){const n=d.getDOMByEntity(this);if(n){const r=s.getSubjectFromParentNodeByEventId(n,i);r&&e.notify(r,{node:t})}}}g.register(p.UPDATE_TEXT,it.name,new class extends T{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.annotationMap.delete(w.LINK)}}),g.register(p.REPLACE_SELECTED_TEXT,it.name,new class extends T{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,s){if(e&&e.startContainer&&e.endContainer){const{startContainer:n,endContainer:i,startOffset:r,endOffset:o}=e;let c=s.text;if(n===i&&r===o&&t)c=s.text.slice(0,r)+t+s.text.slice(r);else{const e=n.parentElement,a=i.parentElement,h=e&&d.getEntityByDOM(e),l=a&&d.getEntityByDOM(a);let u=0,p=s.text.length;h&&h===s?(u=r,p=n===i?o:p):l&&l===s&&(p=o),c=s.text.slice(0,u)+t+s.text.slice(p)}s.apply(new Q(c))}}}),g.register(j.name,it.name,new class extends T{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(a.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof j&&t.doSplit&&s){const{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=s.range,o=t===n&&i===r;e.parent.children=e.parent.children.flatMap((t=>t.id===e.id?o?this.insertNewNode(i,e):this.shouldSplitSelection(s.range)?this.splitTextNode(s.range,e):(this.setApplyTargetNode(e),e):t))}return this.applyTargetNode}insertNewNode(t,e){const s=e.cloneWithText("");return this.setApplyTargetNode(s),0===t?[s,e]:t===e.text.length?[e,s]:[e.cloneWithText(e.text.substring(0,t)),s,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:s,startOffset:n,endOffset:i}=t;return e!==s||n>0||i<(s.textContent?s.textContent.length:0)}splitTextNode(t,e){const{startContainer:s,endContainer:n,startOffset:i}=t,r=s.parentElement,o=n.parentElement,c=(t,s,n)=>{const i=t.substring(0,s),r=t.substring(s,n),o=t.substring(n);return[e.cloneWithText(i),e.cloneWithText(r),e.cloneWithText(o)]},a=r&&d.getEntityByDOM(r),h=o&&d.getEntityByDOM(o);if(a&&a.id===e.id){const r=s===n?t.endOffset:e.text.length,[o,a,h]=c(e.text,i,r);return this.setApplyTargetNode(a),[o,a,h].filter((t=>!!t.text))}if(h&&h.id===e.id){const[s,n,i]=c(e.text,0,t.endOffset);return this.setApplyTargetNode(n),[s,n,i].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}),g.register(m.name,it.name,new class extends T{handleAction(e,s){const n=e.toAnnotation();if(e instanceof st)s.annotationMap.delete(e.annotationType);else{if(!(n instanceof Z))return n instanceof y||n instanceof P?(e instanceof nt&&(t(e.newText)&&(s.text=e.newText),s.parent.apply(new V(e.link.groupKey,[s]))),e instanceof et&&this.handleAction(new tt,s),void s.annotationMap.set(n.type,n)):void 0;n.items.forEach((t=>{s.deleteAnnotationByType(t)}))}}});class rt extends u{constructor(t){super(),this.type=h.TEXT_STYLE,this.textStyle=t}static from(t){return[h.TEXT_STYLE,new rt(t)]}toJSON(){return{textStyle:this.textStyle}}clone(){return new rt(this.textStyle)}render(){const t={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500"};switch(this.textStyle){case"paragraph":return t;case"title":return{fontFamily:"Inter",fontSize:"36px",lineHeight:"40px",fontWeight:"500"};case"subtitle":return{fontFamily:"Inter",fontSize:"28px",lineHeight:"32px",fontWeight:"500"};case"heading-1":return{fontFamily:"Inter",fontSize:"22px",lineHeight:"24px",fontWeight:"500"};case"heading-2":return{fontFamily:"Inter",fontSize:"20px",lineHeight:"24px",fontWeight:"500"};case"heading-3":return{fontFamily:"Inter",fontSize:"18px",lineHeight:"22px",fontWeight:"500"};case"heading-4":return{fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500"};case"heading-5":return{fontFamily:"Inter",fontSize:"14px",lineHeight:"22px",fontWeight:"500"};case"heading-6":return{fontFamily:"Inter",fontSize:"12px",lineHeight:"22px",fontWeight:"500"}}}}class ot extends m{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new rt(this.textStyle)}}class ct extends j{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new W(this.bold)}}class at extends T{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,s){if(t){const n=t.text.slice(0,e),i=t.text.slice(e),r=s.children.indexOf(t);if(r>-1){const e=s.children.slice(0,r),o=s.children.slice(r+1);n&&e.push(t.cloneWithText(n)),i&&o.unshift(t.cloneWithText(i)),s.apply(new b(e));const c=s.cloneWithNodes(o);return s.parent.apply(new M(s,c)),c}}}}class ht extends T{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new it(o(),"\n",s),i=t.text.slice(0,e),r=t.text.slice(e),c=s.children.indexOf(t);if(c>-1){const e=s.children.slice(0,c),o=s.children.slice(c+1);i&&e.push(t.cloneWithText(i)),r&&o.unshift(t.cloneWithText(r)),this.mergeLineBreakNodes(e,n,o,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new it(o(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new b([...t,e,...s]))}}class lt extends T{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.children,n=new it(o(),"\n",e),i=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(s,n,i,e),n}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new C(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new it(o(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new b([...t,e,...s]))}}class ut extends x{constructor(t){super(),this.type=p.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class dt extends L{handleAction(t,e){this.deleteNodeContent(t,e)}deleteNodeContent(t,e){const s=t.startContainerNode,n=t.startOffset;if(0!==n&&!s.isEmpty()){const i=s.text.slice(0,n-1)+s.text.slice(n);if(s.apply(new Q(i)),i)return void(t.previousNode=s);{const n=this.getPreviousNode(s);return n&&n.parent===e&&"\n"===n.text||1===e.children.length?void(t.previousNode=s):(e.apply(new C(s)),void(t.previousNode=n))}}{let n=this.getPreviousNode(s),i=null;if(e.children.length&&n&&n.parent!==e)s.isEmpty()&&e.apply(new C(s)),e.type===n.parent.type&&n.parent.apply(new ut(e));else if(this.isContentFirstNode(s)&&s.isEmpty()&&(i=this.getNextNode(s)),s.isEmpty()&&e.apply(new C(s)),n instanceof it&&n.isEmpty()){const t=n;n=this.getPreviousNode(n),t.parent.apply(new C(t)),n||(i=s)}0===e.children.length&&e.parent.apply(new C(e)),n?t.previousNode=n:i&&(t.nextNode=i)}}}class pt extends T{replaceNodeWithNodes(t,e,s){t.children&&(s.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?s:t)))}}class ft extends pt{handleAction(t,e){const s=t.referNode,n=[...t.nodesToBeInserted,s];this.replaceNodeWithNodes(e,s,n)}}class wt extends O{constructor(t,e){super(t),this.children=[],this.type=e,this.annotationMap=wt.isAcceptableTextStyle(e)?new Map([rt.from(e)]):new Map([rt.from("paragraph")])}static from(e){const s=new wt(e.id,e.type),{annotations:n}=e;return s.children=e.nodes.map((t=>it.from(t,s))),n&&Object.entries(n).forEach((([e,n])=>{const i=this.createAnnotationEntity(e,n);t(i)&&s.annotationMap.set(...i)})),s}static createAnnotationEntity(t,e){return"textStyle"===t?rt.from(e):super.createAnnotationEntity(t,e)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(t)}mergeNodes(t){this.children=this.children.reduce(((e,s)=>{const n=e.at(-1);if(t instanceof nt&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(w.LINK),i=s.getAnnotationByType(w.LINK);if(t&&i&&t.toEqual(i))return e}return[...e,s]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.children.map((t=>t.toJSON()))})}cloneWithNodes(t){const e=new wt(o(),this.type);return e.children=[],e.apply(new B(t)),e}clone(){const t=new wt(this.id,this.type);return t.children=this.children.map((e=>{const s=e.clone();return s.parent=t,s})),t.annotationMap=super.cloneAnnotations(),t.parent=this.parent,t}isNotEmpty(){return this.children.length>0&&this.children.some((t=>!t.isEmpty()))}getLastNode(){return this.children[this.children.length-1]}createNewParagraph(){return new wt(o(),"paragraph")}doAnnotationActionApply(t){const e=g.get(t.constructor.name,wt.name);e&&e.execute(t,this)}}g.register(ot.name,wt.name,new class extends T{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new ct(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new st(w.BOLD))})}}),g.register(V.name,wt.name,new class extends T{handleAction(t,e){const s=e.getAnnotationByType(a.LINK_GROUP);if(s){const n=s.linkGroups.get(t.groupKey);s.linkGroups.set(t.groupKey,[...n,...t.nodes]),e.annotationMap.set(a.LINK_GROUP,s)}}}),g.register(p.DELETE_CHILD,wt.name,new k),g.register(p.APPEND_CHILD_NODES,wt.name,new D),g.register(p.SPLIT_BLOCK_WITH_NODE,wt.name,new at),g.register(p.REPLACE_CHILD_NODES,wt.name,new R),g.register(p.MERGE_TWO_BLOCKS_NODES,wt.name,new I),g.register(p.BREAK_SINGLE_BLOCK,wt.name,new class extends T{handleAction(t,e){t.newBlock=this.breakSingleTextBlock(t.startContainerNode,t.startOffset,e)}breakSingleTextBlock(t,e,s){const n=this.copyInlineStyleToNewParagraph(t,s);if(this.isCaretPositionAtTextBlockEnd(s,t,e))s.parent.apply(new M(s,n));else{if(!this.isCaretPositionAtTextBlockStart(s,t,e)){const n=new K(t,e);return s.apply(n),n.newBlock}s.parent.apply(new F(s,n))}return n}copyInlineStyleToNewParagraph(t,e){const s=t.cloneWithText("");s.annotationMap.delete(w.LINK);const n=e.createNewParagraph();return n.apply(new B([s])),n}}),g.register(p.LINE_BREAK_SINGLE_BLOCK,wt.name,new ht),g.register(p.LINE_BREAK_MULTIPLE_BLOCKS,wt.name,new lt),g.register(p.DELETE_BLOCK_CONTENT,wt.name,new dt),g.register(p.INSERT_IMAGE_TO_BLOCK,wt.name,new class extends T{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,i=t.imageBlockToBeInserted;if(this.isCaretPositionAtTextBlockEnd(e,s,n))e.parent.apply(new M(e,i));else if(this.isCaretPositionAtTextBlockStart(e,s,n))e.parent.apply(new F(e,i));else{const t=new K(s,n);e.apply(t),e.parent.apply(new M(e,i))}}}),g.register(p.INSERT_NODES_BEFORE,wt.name,new ft),g.register(p.TRANSFORM_LIST_BLOCK,wt.name,new class extends T{handleAction(t,e){const s=e.parent,n=s.createList(t.listType),i=t.selectedBlocks,r=i.map((t=>s.toListItem(t)));n.apply(new B(r)),s.apply(new M(t.selectedBlocks[0],n)),i.forEach((t=>{t.parent.apply(new C(t))}))}});class xt extends x{constructor(t,e){super(),this.isFlushable=!0,this.type=p.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class At extends m{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new P(this.range)}}class Et extends N{constructor(t,e,s,n){super(t),this.type=f.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=n,this.language=s}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}clone(){return new Et(this.id,this.text,this.language,this.parent)}doAnnotationActionApply(t){g.executeTheStrategy(t,this)}doModifyActionApply(t){g.executeTheStrategy(t,this)}}g.register(p.UPDATE_CODE_BLOCK,Et.name,new class extends T{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),g.register(At.name,Et.name,new class extends T{handleAction(t,e){e.annotationMap.set(a.SELECTION_RANGE,t.toAnnotation())}});class gt extends O{constructor(t,e,s){super(t),this.type="code-block",this.children=[new Et(`${t}-1`,e,s,this)]}static from(t){return new gt(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.children[0];return{id:this.id,type:"code-block",content:e,language:t}}clone(){const t=gt.from(this.toJSON());return t.parent=this.parent,t}apply(t){if(t instanceof x&&g.executeTheStrategy(t,this),t.isFlushable){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}}isNotEmpty(){return!!this.children.length}getLastNode(){return this.children[0]}isSelected(){return this.children[0].annotationMap.has(a.SELECTION_RANGE)}}g.register(p.DELETE_CODE_BLOCK,gt.name,new class extends L{handleAction(t,e){const s=e.children[0],n=e.parent;if(n){let t=this.getPreviousNode(s),i=this.getRTENodeEndOffset(t);t||(t=this.getNextNode(s),i=0),n.apply(new C(e));const r=t?d.getDOMByEntity(t):null;if(0===n.children.length){const s=wt.from({id:o(),type:"paragraph",nodes:[{id:o(),type:"text",text:""}]});e.parent.apply(new B([s])),t=s.children[0],i=0}this.notifyUpdateSelection(t,r,i,e)}}notifyUpdateSelection(t,n,r,o){const c=d.getDOMByEntity(o);if(c){const o=s.getSubjectFromParentNodeByEventId(c,i);o&&e.notify(o,{node:t,updateDirectly:!!n,offset:r})}}getRTENodeEndOffset(t){return t&&"CODE_BLOCK_NODE"!==t.type?"IMAGE"!==t.type?t.text.length:1:0}}),g.register(p.DELETE_CHILD,gt.name,new k),g.register(p.SWITCH_OUT_FROM_CODE_BLOCK,gt.name,new class extends T{handleAction(t,n){const{content:r,language:c}=t,a=r.split("\n"),h=new xt(a.slice(0,a.length-2).join("\n"),c);h.isFlushable=!1,n.children[0].apply(h);const l=wt.from({id:o(),type:"paragraph",nodes:[{id:o(),text:"",type:"text"}]});n.parent.apply(new M(n,l));const u=d.getDOMByEntity(n);if(u){const t=s.getSubjectFromParentNodeByEventId(u,i);t&&e.notify(t,{node:l.children[0]})}}}),g.register(p.INSERT_IMAGE_TO_BLOCK,gt.name,new class extends T{handleAction(t,e){e.parent.apply(new M(e,t.imageBlockToBeInserted))}}),gt.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{E as $,T as A,L as B,S as C,At as D,$ as E,z as F,Et as G,m as H,M as I,ct as J,J as K,nt as L,x as M,w as N,H as O,ot as P,rt as Q,C as R,K as S,j as T,xt as U,W as V,h as W,tt as X,et as Y,U as Z,v as _,_ as a,A as a0,Q as a1,ut as a2,b,B as c,wt as d,F as e,p as f,it as g,pt as h,O as i,g as j,I as k,k as l,D as m,R as n,ft as o,dt as p,ht as q,lt as r,at as s,Y as t,gt as u,N as v,d as w,u as x,y,a as z}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{W as s}from"./p-5d676a94.js";import{O as a}from"./p-331a62d5.js";import{C as o}from"./p-2d0d575f.js";import{d as r}from"./p-6e01f0a2.js";import{V as m}from"./p-f5ac60f5.js";const p=async()=>s.handle(),f=async s=>new Promise((p=>{const f=new a(n.bind(null),(()=>{o.unregister(r.getSubject(s,m),f),p(null)}));o.register(r.getSubject(s,m),f)})),n=()=>!0;export{f as a,p as w}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,f as e,r as s,H as o,g as i}from"./p-21d26bb4.js";import{s as r}from"./p-519a7d55.js";import{c as p,V as a,M as n,L as c,I as m}from"./p-6e1ab235.js";import{V as l,I as d}from"./p-d849e0f5.js";import{V as f}from"./p-f08a4adf.js";import{V as j}from"./p-8c46e116.js";import{f as h}from"./p-
|
|
1
|
+
import{h as t,f as e,r as s,H as o,g as i}from"./p-21d26bb4.js";import{s as r}from"./p-519a7d55.js";import{c as p,V as a,M as n,L as c,I as m}from"./p-6e1ab235.js";import{V as l,I as d}from"./p-d849e0f5.js";import{V as f}from"./p-f08a4adf.js";import{V as j}from"./p-8c46e116.js";import{f as h}from"./p-fda6f8bc.js";import{h as u}from"./p-5773a9a3.js";import{O as b}from"./p-331a62d5.js";import{C as v}from"./p-2d0d575f.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-5e2c9e69.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-4a237308.js";import"./p-7d9cd9c8.js";import"./p-b75ee3ba.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-5f377954.js";import"./p-bcdb235d.js";import"./p-d5776087.js";import"./p-0c8bd757.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-6e01f0a2.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-5d676a94.js";import"./p-9d6003ef.js";import"./p-88e08a33.js";import"./p-d7e0c57a.js";import"./p-f5ac60f5.js";import"./p-49fd1009.js";var g=function(t,e,s,o){var i,r=arguments.length,p=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(p=(r<3?i(p):r>3?i(e,s,p):i(e,s))||p);return r>3&&p&&Object.defineProperty(e,s,p),p};class y extends a{render(){const e=f.getIconKey(this.country),s=j.hasIcon(e),o=h(this.size,"widthAndHeight"),i=`calc(${o} * 4 / 3)`;return s?t("vega-icon",{icon:e,size:this.size,style:{width:i}}):t("vega-skeleton",{type:"image",corners:"rounded-2",height:o,width:i})}}g([p()],y.prototype,"size",void 0),g([p()],y.prototype,"country",void 0);var R=function(t,e,s,o){var i,r=arguments.length,p=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(p=(r<3?i(p):r>3?i(e,s,p):i(e,s))||p);return r>3&&p&&Object.defineProperty(e,s,p),p};class O extends a{constructor(){super(...arguments),this.isAcceptObserver=()=>!0,this.listenerCallback=()=>{e(this.host)}}componentWillLoad(){this.country&&(this.isFlagForCountryCodeLoaded(this.country)||this.registerObserver())}unRegisterObserver(){this.observer&&(v.unregister(u,this.observer),this.observer=null)}registerObserver(){this.observer=new b(this.isAcceptObserver.bind(this),this.listenerCallback.bind(this)),v.register(u,this.observer)}isFlagForCountryCodeLoaded(t){const e=f.getIconKey(t);return f.hasIcon(e)}}!async function(){try{const t=(await import("./p-1e926324.js")).CountryFlags;f.register(t),v.notify(u,{})}catch(t){c.error("Error loading flag module:",t)}}(),R([p()],O.prototype,"host",void 0),R([p()],O.prototype,"country",void 0),R([n("componentWillLoad")],O.prototype,"componentWillLoad",null),R([n("disconnectedCallback")],O.prototype,"unRegisterObserver",null);var w=function(t,e,s,o){var i,r=arguments.length,p=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(p=(r<3?i(p):r>3?i(e,s,p):i(e,s))||p);return r>3&&p&&Object.defineProperty(e,s,p),p};const C=class{constructor(t){s(this,t),this.globalSlimmers={},this.renderer=new y,this.vegaFlagIconController=new O,this.vegaComponentUsageRuntimeMetricsSlimmer=new l,this.size="size-16"}render(){return r(t(o,null,this.renderer.render()),this.host)}get host(){return i(this)}};w([d()],C.prototype,"globalSlimmers",void 0),w([m()],C.prototype,"renderer",void 0),w([m()],C.prototype,"vegaFlagIconController",void 0),w([m()],C.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),C.style=":host{display:inline-block}:host vega-icon,:host vega-skeleton,:host svg{display:block}";export{C as vega_flag_icon}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as s}from"./p-e77a83e4.js";import{V as o,a as t,b as a,c as l,d as i,e,f as c}from"./p-bcdb235d.js";import{M as n,V as r,s as p,G as b}from"./p-6e1ab235.js";import{v as
|
|
1
|
+
import{F as s}from"./p-e77a83e4.js";import{V as o,a as t,b as a,c as l,d as i,e,f as c}from"./p-bcdb235d.js";import{M as n,V as r,s as p,G as b}from"./p-6e1ab235.js";import{v as h}from"./p-5f377954.js";import{V as f}from"./p-8c46e116.js";import"./p-5d676a94.js";import"./p-d5776087.js";import{V as d,a as m,s as T}from"./p-9d6003ef.js";import{V as u}from"./p-88e08a33.js";import{T as j}from"./p-d884c644.js";import{V as g}from"./p-6f90d444.js";import{w as O}from"./p-e1ed78db.js";import{U as C}from"./p-5773a9a3.js";import{C as E}from"./p-2d0d575f.js";import{O as _}from"./p-331a62d5.js";import{f as R}from"./p-21d26bb4.js";var A=function(s,o,t,a){var l,i=arguments.length,e=i<3?o:null===a?a=Object.getOwnPropertyDescriptor(o,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)e=Reflect.decorate(s,o,t,a);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(e=(i<3?l(e):i>3?l(o,t,e):l(o,t))||e);return i>3&&e&&Object.defineProperty(o,t,e),e};class k extends r{constructor(o){super(),this.originalWatchers=new Map,this.hasDisconnected=!1,this.isEnabled=s.isEnabled("VEGA_REACT.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD")&&s.isEnabled("VEGA_FRAMEWORK.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD"),this.component=o.component}connectedCallback(){if(!this.isEnabled)return;if(this.hasDisconnected)return;const s=this.component.constructor.watchers;for(const o in s)s[o].forEach((s=>{this.originalWatchers.has(s)||(this.originalWatchers.set(s,this.component[s]),this.component[s]=function(){})}))}disconnectedCallback(){this.isEnabled&&(this.hasDisconnected=!0)}componentDidLoad(){this.isEnabled&&this.originalWatchers.forEach(((s,o)=>{const t=s;this.component[o]=function(...s){return t.apply(this,s)}}))}}A([n("connectedCallback")],k.prototype,"connectedCallback",null),A([n("disconnectedCallback")],k.prototype,"disconnectedCallback",null),A([n("componentDidLoad")],k.prototype,"componentDidLoad",null);class v extends r{constructor(s){super(),this.component=s.component}connectedCallback(){const s=new _(this.isAcceptable.bind(this),(()=>{R(this.component)}));E.register(C,s)}isAcceptable(){var s;const o=this.component.host;return null===(s=d.getConnectedComponents().get(o.tagName))||void 0===s?void 0:s.has(o)}}!function(s,o,t,a){var l,i=arguments.length,e=i<3?o:null===a?a=Object.getOwnPropertyDescriptor(o,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)e=Reflect.decorate(s,o,t,a);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(e=(i<3?l(e):i>3?l(o,t,e):l(o,t))||e);i>3&&e&&Object.defineProperty(o,t,e)}([n("connectedCallback")],v.prototype,"connectedCallback",null);const V=function(){globalThis.VegaDisabledFeatureKeys&&s.disable(...globalThis.VegaDisabledFeatureKeys),globalThis.VegaEnabledFeatureKeys&&s.enable(...globalThis.VegaEnabledFeatureKeys),globalThis.VegaLoader=o,globalThis.VegaNotify=t,globalThis.VegaThemeManager=a,globalThis.setVegaLogLevel=p,globalThis.VegaDialog=l,b.register([k,v]),globalThis.VegaEventManager=i,Object.keys(j).forEach((s=>{const{url:o}=j[s],t="vega-typography-"+s;if(!document.querySelector("#"+t)){const s=document.createElement("link");s.id=t,s.href=o,s.rel="stylesheet",document.head.append(s)}})),globalThis.VegaIconManager=f,globalThis.VegaZIndexManager=e,globalThis.ValidCreditCardNumberRule=g,globalThis.VegaEnvInfo=h.getVegaEnv(),import("./p-db8cdba6.js").then((o=>{o.default.init(s)})),globalThis.waitForVega=O,globalThis.VegaSkeletonLoader=c,globalThis.VegaTranslation=m,globalThis.VegaTranslationResourceEN=T,globalThis.VegaRTEContent=u,import("./p-9a956a00.js").then((s=>{Object.entries(s).forEach((([s,o])=>{globalThis[s]=o}))})),globalThis.VegaThemeManagerApplyBranding&&a.applyBranding(globalThis.VegaThemeManagerApplyBranding)};export{V as g}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,I as e,V as i,L as s,M as o}from"./p-6e1ab235.js";import{f as n,c as h,i as r}from"./p-d5776087.js";import{I as c}from"./p-bcdb235d.js";import{c as l}from"./p-6a334573.js";import{P as a}from"./p-7d9cd9c8.js";import{P as d,A as u}from"./p-74168615.js";import{A as f}from"./p-5e2c9e69.js";import{R as p}from"./p-fb8c99c5.js";import{C as v}from"./p-2d0d575f.js";import{S as m}from"./p-5773a9a3.js";import{O as g}from"./p-331a62d5.js";import{d as b}from"./p-6e01f0a2.js";import{q as w}from"./p-65d8c2bc.js";import{D as j}from"./p-e7b00bf0.js";class R{canRetrieve(){return!0}retrieve(){const t=document.body;return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],R.prototype,"showConfig",void 0);class y{canRetrieve(){return!this.showConfig.isScreenPosition}}class C extends y{canRetrieve(){return super.canRetrieve()&&!!this.showConfig.positionRelativeTo&&!!document.querySelector(this.showConfig.positionRelativeTo)}retrieve(){const t=document.querySelector(this.showConfig.positionRelativeTo);return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],C.prototype,"showConfig",void 0);class x extends y{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,"vega-modal")}retrieve(){return this.getVegaModalShowConfigContainer()}setElementSlot(t,e){var i;const s=null===(i=Array.from(t.children).find((t=>{const e=t.getAttribute("slot");return e&&["content","modal-content"].includes(e)})))||void 0===i?void 0:i.getAttribute("slot");s&&e.setAttribute("slot",s)}getVegaModalShowConfigContainer(){const t=n(this.showConfig.target,"vega-modal"),e=t.shadowRoot.querySelector(".vega-modal-content-with-scroll"),i=t.shadowRoot.querySelector(".modal-dialog");return this.setElementSlot(t,this.showConfig.appendableElement),t.append(this.showConfig.appendableElement),e||i}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t({writable:!0})],x.prototype,"showConfig",void 0);class O extends y{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,".vega-popover")}retrieve(){const t=n(this.showConfig.target,".vega-popover");return t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],O.prototype,"showConfig",void 0);var S=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class E extends i{constructor(){super(...arguments),this.positionRelativeToWrapper=new C,this.vegaPopoverWrapper=new O,this.vegaModalWrapper=new x,this.defaultWrapper=new R}setContainer(){this.setContainerRetrievers();for(const t of this.containerRetrievers)if(t.canRetrieve())return void(this.container=t.retrieve())}setContainerRetrievers(){this.containerRetrievers=[this.positionRelativeToWrapper,this.vegaPopoverWrapper,this.vegaModalWrapper,this.defaultWrapper]}}S([t({writable:!0})],E.prototype,"container",void 0),S([t({writable:!0})],E.prototype,"showConfig",void 0),S([e()],E.prototype,"positionRelativeToWrapper",void 0),S([e()],E.prototype,"vegaPopoverWrapper",void 0),S([e()],E.prototype,"vegaModalWrapper",void 0),S([e()],E.prototype,"defaultWrapper",void 0);class A extends i{getPositionBox(t,e){const i=t||this.getPlacements(),s=e||this.getAlignments(),o=this.getTargetBoundBox(),n=this.getElementBoundBox(),h=this.getElementScrollDimension(),r=this.getSuitablePlacement(h,n,o,i),c=this.getSuitableAlignment(h,n,o,r,s),l=this.calculatePosition(n,o,r,c),a=this.getTranslocationBox(r);return l.placement=r,l.alignment=c,l.left+=a.X,l.top+=a.Y,l}getElementBoundBox(){const t=this.showConfig.appendableElement,e=t.classList.contains("vega-force-hidden");e&&t.classList.remove("vega-force-hidden");const i=t.getBoundingClientRect();return e&&t.classList.add("vega-force-hidden"),{width:i.width,height:i.height,left:i.left,top:i.top}}getPlacements(){const t=this.showConfig.placement;if("string"==typeof t){const e=d.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...d]}getAlignments(){const t=this.showConfig.alignment;if("string"==typeof t){const e=u.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...u]}calculatePosition(t,e,i,s){return{top:this.calculateTop(t,e,i,s),left:this.calculateLeft(t,e,i,s)}}getTranslocationBox(t){const e=Array.isArray(this.showConfig.placement)?this.showConfig.placement[0]:this.showConfig.placement,i=this.getTranslocation(),s={X:0,Y:0};if(f(i)){let o=i.X,n=i.Y;(e&&["left","right"].includes(e)&&["top","bottom"].includes(t)||e&&["top","bottom"].includes(e)&&["left","right"].includes(t))&&(o=i.Y,n=i.X),["bottom","top"].includes(t)&&(s.Y="top"===t?-n:n,s.X=o),["left","right"].includes(t)&&(s.X="left"===t?-o:o,s.Y=n)}return s}calculateLeft(t,e,i,s){switch(i){case"top":case"bottom":return"end"===s?e.left+e.width-t.width:"center"===s?e.left-(t.width-e.width)/2:e.left;case"left":return e.left-t.width;case"right":return e.left+e.width;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}calculateTop(t,e,i,s){switch(i){case"left":case"right":return"end"===s?e.top+e.height-t.height:"center"===s?e.top-(t.height-e.height)/2:e.top;case"top":return e.top-t.height;case"bottom":return e.top+e.height;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}getSuitablePlacement(t,e,i,o){const n=o[0];return o.find((s=>this.hasEnoughSpace(t,s,i,e)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined placement:\n ${n}\n `),n)}getSuitableAlignment(t,e,i,o,n){const h=n[0];return n.find((s=>this.hasEnoughAlignmentSpace(t,i,e,o,s)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined alignment:\n ${h}\n `),h)}hasEnoughAlignmentSpace(t,e,i,s,o){if(["top","bottom"].includes(s))switch(o){case"start":return e.left+i.width<=t.width;case"center":return e.left>=(i.width-e.width)/2&&e.left+e.width/2+i.width/2<=t.width;case"end":return e.left+e.width>=i.width}if(["right","left"].includes(s))switch(o){case"start":return e.top+i.height<=t.height;case"center":return e.top>=(i.height-e.height)/2&&e.top+e.height/2+i.height/2<=t.height;case"end":return e.top+e.height>=i.height}return!1}hasEnoughSpace(t,e,i,s){switch(e){case"top":return i.top>=s.height;case"bottom":return t.height-i.top-i.height>=s.height;case"left":return i.left>=s.width;case"right":return t.width-i.left-i.width>=s.width;default:return!1}}getTranslocation(){const t=this.showConfig.translocation;return t&&p.format(t,"translocation")}}var P=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class k extends A{getPosition(){return"relative"!==window.getComputedStyle(this.container).position&&s.warn("Calculate position should make container as 'position: relative', otherwise the result might not be accurate."),this.getPositionBox()}getTargetBoundBox(){const t=this.container.getBoundingClientRect(),e=this.showConfig.target.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top-t.top+this.container.scrollTop,left:e.left-t.left+this.container.scrollLeft}}getElementScrollDimension(){return{width:this.container.scrollWidth,height:this.container.scrollHeight}}}P([t()],k.prototype,"container",void 0),P([t()],k.prototype,"showConfig",void 0);class T extends A{getPosition(t){const e=t?this.getPositionBox([this.previousPositionBox.placement],[this.previousPositionBox.alignment]):this.getPositionBox();return this.previousPositionBox=e,e}getTargetBoundBox(){const t=this.showConfig.target.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,left:t.left}}getElementScrollDimension(){return{width:window.innerWidth,height:window.innerHeight}}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],T.prototype,"showConfig",void 0);var $=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class D extends i{constructor(){super(...arguments),this.bodyPositionStrategy=new k,this.screenPositionStrategy=new T}setCalculationStrategy(){this.positionStrategy=this.showConfig.isScreenPosition?this.screenPositionStrategy:this.bodyPositionStrategy}adjustPosition(t){this.adjustWidth(),this.adjustHeight(),this.applyPosition(this.positionStrategy.getPosition(t))}applyPosition(t){const e=this.showConfig.appendableElement;this.showConfig.isScreenPosition&&(e.style.position="fixed"),e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.classList.remove("vega-placement-left","vega-placement-right","vega-placement-top","vega-placement-bottom"),e.classList.remove("vega-alignment-start","vega-alignment-center","vega-alignment-end"),e.classList.add(`vega-placement-${t.placement}`),e.classList.add(`vega-alignment-${t.alignment}`)}adjustWidth(){if(this.showConfig.matchTargetWidth){const{width:t}=this.showConfig.target.getBoundingClientRect();this.setRelatedWidth("width",t)}else this.setRelatedWidth("width",this.showConfig.size),this.setRelatedWidth("minWidth",this.showConfig.minWidth),this.setRelatedWidth("maxWidth",this.showConfig.maxWidth)}setRelatedWidth(t,e){if(!e)return;const i=p.format(e,"size");i&&(this.showConfig.appendableElement.style[t]="number"==typeof i?`${i}px`:i)}adjustHeight(){if(this.showConfig.matchContainerHeight&&!this.showConfig.isScreenPosition){const{height:t}=this.showConfig.target.getBoundingClientRect();let e=this.container.scrollHeight-this.showConfig.target.offsetTop-t;this.showConfig.maxHeight&&(e=Math.min(e,this.showConfig.maxHeight)),this.showConfig.appendableElement.style.maxHeight=`${e}px`}else this.showConfig.maxHeight&&(this.showConfig.appendableElement.style.maxHeight=`${this.showConfig.maxHeight}px`)}}$([t()],D.prototype,"container",void 0),$([t()],D.prototype,"showConfig",void 0),$([e()],D.prototype,"bodyPositionStrategy",void 0),$([e()],D.prototype,"screenPositionStrategy",void 0);var B=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class L{constructor(t,e){var i,s;this.resizeObserverSlimmer=l(L,a,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"},{mapFrom:"disconnectResizeObserver",mapTo:"disconnectResizeObserver"}],[{callback:()=>{h(this.showConfig.target)&&h(this.showConfig.appendableElement)&&this.adjustPosition()},target:()=>[document.body,this.showConfig.appendableElement,this.showConfig.target]}]),this.elementAppenderContainerController=new E,this.positionCalculationController=new D,this.showConfigCallback=t,this.showConfigCallbackTarget=e;const o=this.getShowConfig();null===(i=o.appendableElement)||void 0===i||i.classList.add("vega-force-hidden"),null===(s=o.appendableElement)||void 0===s||s.classList.add("vega-element-appender-appendable")}show(){this.setShowConfig(),this.showConfig.target?this.showConfig.appendableElement?(this.prepareShow(),this.adjustPosition(),this.setZIndex(),this.toggleShow(!0),this.connectResizeObserver()):s.error("No appendable element found, please add it at new elementAppender."):s.error("No target element found, please add it at new elementAppender.")}hide(){this.showConfig&&(this.toggleShow(!1),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"))}onScroll(){var t;const e=this.showConfig.target.getBoundingClientRect();!this.showConfig.isScreenPosition||e.left===(null===(t=this.previousTargetRect)||void 0===t?void 0:t.left)&&e.top===this.previousTargetRect.top||this.adjustPosition(!0)}destroy(){this.showConfig&&(this.removeVisibleAppendElement(this.showConfig.appendableElement),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"),this.showConfig.appendableElement.remove(),this.disconnectResizeObserver())}connectResizeObserver(){}disconnectResizeObserver(){}toggleShow(t){t?(this.showConfig.appendableElement.classList.remove("vega-force-hidden"),this.saveVisibleAppendElement(this.showConfig.appendableElement)):(this.showConfig.appendableElement.classList.add("vega-force-hidden"),this.removeVisibleAppendElement(this.showConfig.appendableElement))}saveVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.add(t)}removeVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.delete(t)}resetContainerPosition(){const t=L.containerMap.get(this.container);if(t){const{visibleAppendElements:e,originPosition:i="static"}=t;0===e.size&&(this.container.style.position=i,L.containerMap.delete(this.container))}}setShowConfig(){this.showConfig=this.getShowConfig(),this.showConfig=Object.assign({matchTargetWidth:!1,matchContainerHeight:!1},this.showConfig),this.showConfig.target&&this.showConfig.appendableElement&&this.elementAppenderContainerController.setContainer()}prepareShow(){this.showConfig.isScreenPosition||this.initVisibleAppendElement(),this.showConfig.appendableElement.style.boxSizing="border-box",this.positionCalculationController.setCalculationStrategy()}initVisibleAppendElement(){const t=window.getComputedStyle(this.container).position;L.containerMap.has(this.container)||L.containerMap.set(this.container,{visibleAppendElements:new Set,originPosition:t}),"static"===t&&(this.container.style.position="relative")}adjustPosition(t){this.positionCalculationController.adjustPosition(t)}setZIndex(){c.setZIndex(this.showConfig.appendableElement,"base")}getShowConfig(){return this.showConfigCallback instanceof Function?this.showConfigCallback(this.showConfigCallbackTarget):this.showConfigCallback}}L.containerMap=new Map,B([e()],L.prototype,"resizeObserverSlimmer",void 0),B([e()],L.prototype,"elementAppenderContainerController",void 0),B([e()],L.prototype,"positionCalculationController",void 0);var W,z=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};!function(t){t.SHOW="show",t.HIDE="hide"}(W||(W={}));class M extends i{constructor(t){super(),this.childrenEA=[],this.currentEA=t}componentDidLoad(){this.register()}onShow(){this.notify(W.SHOW)}onHide(){this.notify(W.HIDE)}getParent(){return this.parentEA}getChildren(){return this.childrenEA}notify(t){const e=n(this.showConfig.target,".vega-element-appender-appendable");e&&v.notify(b.getSubject(e,w),{type:t,child:this.currentEA,callback:t=>{this.parentEA=t}})}register(){this.showConfig&&j.addUniqueObserverToNode(this.showConfig.appendableElement,w,(t=>{t.type===W.SHOW?this.childrenEA.push(t.child):t.type===W.HIDE&&(this.childrenEA=this.childrenEA.filter((e=>e!==t.child))),t.callback(this.currentEA)}))}}z([t()],M.prototype,"showConfig",void 0),z([o("componentDidLoad")],M.prototype,"componentDidLoad",null),z([o("show")],M.prototype,"onShow",null),z([o("hide")],M.prototype,"onHide",null);var V=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class F extends i{constructor(t,e,i="isDropdownShow",s=(()=>!1)){super(),this.hierarchyTreeManager=new M(this),this.registerElementAppenderListener=()=>{var t,e,i,s,o,n;this.unRegisterElementAppenderListener(),this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.addEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.addEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.addEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.addEventListener("focusout",this.targetFocusoutHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.addEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.addEventListener("mouseleave",this.elementMouseLeaveHandler)),window.addEventListener("mousedown",this.globalMouseDownHandler),document.addEventListener("scroll",this.globalScrollHandler,{capture:!0}),this.listenShadowRootElementScrolling()},this.targetClickHandler=()=>{this.shouldListenerWork("click")&&(this.isShowing()?this.hide():this.show())},this.targetMouseEnterHandler=()=>{this.shouldListenerWork("hover")&&(!1===this.isShowing()&&this.show(),this.clearDelayHideTimer())},this.targetMouseLeaveHandler=()=>{this.shouldListenerWork("hover")&&this.createDelayHideTimer()},this.targetFocusoutHandler=t=>{var e;r(t.relatedTarget,null===(e=this.showConfig)||void 0===e?void 0:e.appendableElement)||this.targetMouseLeaveHandler()},this.elementMouseEnterHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseEnterHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.clearDelayHideTimer()},this.elementMouseLeaveHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseLeaveHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.createDelayHideTimer()},this.globalMouseDownHandler=t=>{const e=t.composedPath()[0];!this.hierarchyTreeManager.getChildren().some((t=>t.isShowing()))&&this.shouldListenerWork("custom")&&this.isShowing()&&this.showConfig&&!r(e,this.showConfig.appendableElement)&&!r(e,this.showConfig.target)&&n(e,"vega-modal")===n(this.showConfig.target,"vega-modal")&&this.hide()},this.globalScrollHandler=()=>{var t;this.showConfig&&this.showConfig.isScreenPosition&&this.isShowing()&&(null===(t=this.elementAppender)||void 0===t||t.onScroll())},this.createDelayHideTimer=()=>{this.delayHideTimer=setTimeout((()=>{this.hide(),clearTimeout(this.delayHideTimer)}),F.DELAY_HIDE_TIME)},this.clearDelayHideTimer=()=>{this.delayHideTimer&&clearTimeout(this.delayHideTimer)},this.shouldListenerWork=t=>{const e=this.getTrigger();switch(t){case"custom":return"none"!==e;case"click":return"click"===e;case"hover":return"hover"===e}throw new Error(`Unexpected trigger: ${t}. Expected values are custom, click, or hover.`)},this.showConfigFactory=t,this.getTrigger=e,this.isDropdownShowName=i,this.disableInteractiveGetter=s}connectedCallback(){null===this.elementAppender&&(this.setElementAppender(),this.registerElementAppenderListener())}disconnectedCallback(){this.unRegisterElementAppenderListener(),this.destroyElementAppender()}componentDidLoad(){this.initElementAppender()}getElementAppender(){return this.elementAppender}show(){this.elementAppender&&this.elementAppender.show(),this[this.isDropdownShowName]=!0}hide(){this.elementAppender&&this.elementAppender.hide(),this[this.isDropdownShowName]=!1,this.hierarchyTreeManager.getChildren().map((t=>{t.hide()}))}destroy(){this.destroyElementAppender(),this[this.isDropdownShowName]=!1}updateShowConfigFactory(t){this.showConfigFactory=t,this.initElementAppender()}destroyElementAppender(){this.elementAppender&&(this.elementAppender.destroy(),this.elementAppender=null)}initElementAppender(){this.setShowConfig(),this.setElementAppender(),this.registerElementAppenderListener()}setElementAppender(){this.elementAppender=new L(this.showConfigFactory,this)}isShowing(){return this[this.isDropdownShowName]}setShowConfig(){this.showConfig=this.showConfigFactory()}unRegisterElementAppenderListener(){var t,e,i,s,o,n;this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.removeEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.removeEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.removeEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.removeEventListener("focusout",this.targetMouseLeaveHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.removeEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.removeEventListener("mouseleave",this.elementMouseLeaveHandler)),window.removeEventListener("mousedown",this.globalMouseDownHandler),document.removeEventListener("scroll",this.globalScrollHandler),this.removeShadowRootElementScrolling()}listenShadowRootElementScrolling(){this.shadowRootElementScrollingObserver=new g(this.canAcceptShadowRootScrollEvent.bind(this),this.globalScrollHandler.bind(this)),v.register(m,this.shadowRootElementScrollingObserver)}canAcceptShadowRootScrollEvent(t){return Boolean(this.showConfig&&r(this.showConfig.target,t.host))}removeShadowRootElementScrolling(){v.unregister(m,this.shadowRootElementScrollingObserver)}}F.DELAY_HIDE_TIME=100,V([e()],F.prototype,"hierarchyTreeManager",void 0),V([o("connectedCallback")],F.prototype,"connectedCallback",null),V([o("disconnectedCallback")],F.prototype,"disconnectedCallback",null),V([o("componentDidLoad")],F.prototype,"componentDidLoad",null);export{F as E}
|
|
1
|
+
import{c as t,I as e,V as i,L as s,M as o}from"./p-6e1ab235.js";import{f as n,c as h,i as r}from"./p-d5776087.js";import{I as c}from"./p-bcdb235d.js";import{c as l}from"./p-6a334573.js";import{P as a}from"./p-7d9cd9c8.js";import{P as d,A as u}from"./p-74168615.js";import{A as f}from"./p-5e2c9e69.js";import{R as p}from"./p-4a237308.js";import{C as v}from"./p-2d0d575f.js";import{S as m}from"./p-5773a9a3.js";import{O as g}from"./p-331a62d5.js";import{d as w}from"./p-6e01f0a2.js";import{q as b}from"./p-f5ac60f5.js";import{D as j}from"./p-e7b00bf0.js";class R{canRetrieve(){return!0}retrieve(){const t=document.body;return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],R.prototype,"showConfig",void 0);class y{canRetrieve(){return!this.showConfig.isScreenPosition}}class C extends y{canRetrieve(){return super.canRetrieve()&&!!this.showConfig.positionRelativeTo&&!!document.querySelector(this.showConfig.positionRelativeTo)}retrieve(){const t=document.querySelector(this.showConfig.positionRelativeTo);return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],C.prototype,"showConfig",void 0);class x extends y{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,"vega-modal")}retrieve(){return this.getVegaModalShowConfigContainer()}setElementSlot(t,e){var i;const s=null===(i=Array.from(t.children).find((t=>{const e=t.getAttribute("slot");return e&&["content","modal-content"].includes(e)})))||void 0===i?void 0:i.getAttribute("slot");s&&e.setAttribute("slot",s)}getVegaModalShowConfigContainer(){const t=n(this.showConfig.target,"vega-modal"),e=t.shadowRoot.querySelector(".vega-modal-content-with-scroll"),i=t.shadowRoot.querySelector(".modal-dialog");return this.setElementSlot(t,this.showConfig.appendableElement),t.append(this.showConfig.appendableElement),e||i}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t({writable:!0})],x.prototype,"showConfig",void 0);class O extends y{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,".vega-popover")}retrieve(){const t=n(this.showConfig.target,".vega-popover");return t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],O.prototype,"showConfig",void 0);var S=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class E extends i{constructor(){super(...arguments),this.positionRelativeToWrapper=new C,this.vegaPopoverWrapper=new O,this.vegaModalWrapper=new x,this.defaultWrapper=new R}setContainer(){this.setContainerRetrievers();for(const t of this.containerRetrievers)if(t.canRetrieve())return void(this.container=t.retrieve())}setContainerRetrievers(){this.containerRetrievers=[this.positionRelativeToWrapper,this.vegaPopoverWrapper,this.vegaModalWrapper,this.defaultWrapper]}}S([t({writable:!0})],E.prototype,"container",void 0),S([t({writable:!0})],E.prototype,"showConfig",void 0),S([e()],E.prototype,"positionRelativeToWrapper",void 0),S([e()],E.prototype,"vegaPopoverWrapper",void 0),S([e()],E.prototype,"vegaModalWrapper",void 0),S([e()],E.prototype,"defaultWrapper",void 0);class A extends i{getPositionBox(t,e){const i=t||this.getPlacements(),s=e||this.getAlignments(),o=this.getTargetBoundBox(),n=this.getElementBoundBox(),h=this.getElementScrollDimension(),r=this.getSuitablePlacement(h,n,o,i),c=this.getSuitableAlignment(h,n,o,r,s),l=this.calculatePosition(n,o,r,c),a=this.getTranslocationBox(r);return l.placement=r,l.alignment=c,l.left+=a.X,l.top+=a.Y,l}getElementBoundBox(){const t=this.showConfig.appendableElement,e=t.classList.contains("vega-force-hidden");e&&t.classList.remove("vega-force-hidden");const i=t.getBoundingClientRect();return e&&t.classList.add("vega-force-hidden"),{width:i.width,height:i.height,left:i.left,top:i.top}}getPlacements(){const t=this.showConfig.placement;if("string"==typeof t){const e=d.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...d]}getAlignments(){const t=this.showConfig.alignment;if("string"==typeof t){const e=u.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...u]}calculatePosition(t,e,i,s){return{top:this.calculateTop(t,e,i,s),left:this.calculateLeft(t,e,i,s)}}getTranslocationBox(t){const e=Array.isArray(this.showConfig.placement)?this.showConfig.placement[0]:this.showConfig.placement,i=this.getTranslocation(),s={X:0,Y:0};if(f(i)){let o=i.X,n=i.Y;(e&&["left","right"].includes(e)&&["top","bottom"].includes(t)||e&&["top","bottom"].includes(e)&&["left","right"].includes(t))&&(o=i.Y,n=i.X),["bottom","top"].includes(t)&&(s.Y="top"===t?-n:n,s.X=o),["left","right"].includes(t)&&(s.X="left"===t?-o:o,s.Y=n)}return s}calculateLeft(t,e,i,s){switch(i){case"top":case"bottom":return"end"===s?e.left+e.width-t.width:"center"===s?e.left-(t.width-e.width)/2:e.left;case"left":return e.left-t.width;case"right":return e.left+e.width;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}calculateTop(t,e,i,s){switch(i){case"left":case"right":return"end"===s?e.top+e.height-t.height:"center"===s?e.top-(t.height-e.height)/2:e.top;case"top":return e.top-t.height;case"bottom":return e.top+e.height;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}getSuitablePlacement(t,e,i,o){const n=o[0];return o.find((s=>this.hasEnoughSpace(t,s,i,e)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined placement:\n ${n}\n `),n)}getSuitableAlignment(t,e,i,o,n){const h=n[0];return n.find((s=>this.hasEnoughAlignmentSpace(t,i,e,o,s)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined alignment:\n ${h}\n `),h)}hasEnoughAlignmentSpace(t,e,i,s,o){if(["top","bottom"].includes(s))switch(o){case"start":return e.left+i.width<=t.width;case"center":return e.left>=(i.width-e.width)/2&&e.left+e.width/2+i.width/2<=t.width;case"end":return e.left+e.width>=i.width}if(["right","left"].includes(s))switch(o){case"start":return e.top+i.height<=t.height;case"center":return e.top>=(i.height-e.height)/2&&e.top+e.height/2+i.height/2<=t.height;case"end":return e.top+e.height>=i.height}return!1}hasEnoughSpace(t,e,i,s){switch(e){case"top":return i.top>=s.height;case"bottom":return t.height-i.top-i.height>=s.height;case"left":return i.left>=s.width;case"right":return t.width-i.left-i.width>=s.width;default:return!1}}getTranslocation(){const t=this.showConfig.translocation;return t&&p.format(t,"translocation")}}var P=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class k extends A{getPosition(){return"relative"!==window.getComputedStyle(this.container).position&&s.warn("Calculate position should make container as 'position: relative', otherwise the result might not be accurate."),this.getPositionBox()}getTargetBoundBox(){const t=this.container.getBoundingClientRect(),e=this.showConfig.target.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top-t.top+this.container.scrollTop,left:e.left-t.left+this.container.scrollLeft}}getElementScrollDimension(){return{width:this.container.scrollWidth,height:this.container.scrollHeight}}}P([t()],k.prototype,"container",void 0),P([t()],k.prototype,"showConfig",void 0);class T extends A{getPosition(t){const e=t?this.getPositionBox([this.previousPositionBox.placement],[this.previousPositionBox.alignment]):this.getPositionBox();return this.previousPositionBox=e,e}getTargetBoundBox(){const t=this.showConfig.target.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,left:t.left}}getElementScrollDimension(){return{width:window.innerWidth,height:window.innerHeight}}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],T.prototype,"showConfig",void 0);var $=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class D extends i{constructor(){super(...arguments),this.bodyPositionStrategy=new k,this.screenPositionStrategy=new T}setCalculationStrategy(){this.positionStrategy=this.showConfig.isScreenPosition?this.screenPositionStrategy:this.bodyPositionStrategy}adjustPosition(t){this.adjustWidth(),this.adjustHeight(),this.applyPosition(this.positionStrategy.getPosition(t))}applyPosition(t){const e=this.showConfig.appendableElement;this.showConfig.isScreenPosition&&(e.style.position="fixed"),e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.classList.remove("vega-placement-left","vega-placement-right","vega-placement-top","vega-placement-bottom"),e.classList.remove("vega-alignment-start","vega-alignment-center","vega-alignment-end"),e.classList.add(`vega-placement-${t.placement}`),e.classList.add(`vega-alignment-${t.alignment}`)}adjustWidth(){if(this.showConfig.matchTargetWidth){const{width:t}=this.showConfig.target.getBoundingClientRect();this.setRelatedWidth("width",t)}else this.setRelatedWidth("width",this.showConfig.size),this.setRelatedWidth("minWidth",this.showConfig.minWidth),this.setRelatedWidth("maxWidth",this.showConfig.maxWidth)}setRelatedWidth(t,e){if(!e)return;const i=p.format(e,"size");i&&(this.showConfig.appendableElement.style[t]="number"==typeof i?`${i}px`:i)}adjustHeight(){if(this.showConfig.matchContainerHeight&&!this.showConfig.isScreenPosition){const{height:t}=this.showConfig.target.getBoundingClientRect();let e=this.container.scrollHeight-this.showConfig.target.offsetTop-t;this.showConfig.maxHeight&&(e=Math.min(e,this.showConfig.maxHeight)),this.showConfig.appendableElement.style.maxHeight=`${e}px`}else this.showConfig.maxHeight&&(this.showConfig.appendableElement.style.maxHeight=`${this.showConfig.maxHeight}px`)}}$([t()],D.prototype,"container",void 0),$([t()],D.prototype,"showConfig",void 0),$([e()],D.prototype,"bodyPositionStrategy",void 0),$([e()],D.prototype,"screenPositionStrategy",void 0);var B=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class L{constructor(t,e){var i,s;this.resizeObserverSlimmer=l(L,a,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"},{mapFrom:"disconnectResizeObserver",mapTo:"disconnectResizeObserver"}],[{callback:()=>{h(this.showConfig.target)&&h(this.showConfig.appendableElement)&&this.adjustPosition()},target:()=>[document.body,this.showConfig.appendableElement,this.showConfig.target]}]),this.elementAppenderContainerController=new E,this.positionCalculationController=new D,this.showConfigCallback=t,this.showConfigCallbackTarget=e;const o=this.getShowConfig();null===(i=o.appendableElement)||void 0===i||i.classList.add("vega-force-hidden"),null===(s=o.appendableElement)||void 0===s||s.classList.add("vega-element-appender-appendable")}show(){this.setShowConfig(),this.showConfig.target?this.showConfig.appendableElement?(this.prepareShow(),this.adjustPosition(),this.setZIndex(),this.toggleShow(!0),this.connectResizeObserver()):s.error("No appendable element found, please add it at new elementAppender."):s.error("No target element found, please add it at new elementAppender.")}hide(){this.showConfig&&(this.toggleShow(!1),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"))}onScroll(){var t;const e=this.showConfig.target.getBoundingClientRect();!this.showConfig.isScreenPosition||e.left===(null===(t=this.previousTargetRect)||void 0===t?void 0:t.left)&&e.top===this.previousTargetRect.top||this.adjustPosition(!0)}destroy(){this.showConfig&&(this.removeVisibleAppendElement(this.showConfig.appendableElement),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"),this.showConfig.appendableElement.remove(),this.disconnectResizeObserver())}connectResizeObserver(){}disconnectResizeObserver(){}toggleShow(t){t?(this.showConfig.appendableElement.classList.remove("vega-force-hidden"),this.saveVisibleAppendElement(this.showConfig.appendableElement)):(this.showConfig.appendableElement.classList.add("vega-force-hidden"),this.removeVisibleAppendElement(this.showConfig.appendableElement))}saveVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.add(t)}removeVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.delete(t)}resetContainerPosition(){const t=L.containerMap.get(this.container);if(t){const{visibleAppendElements:e,originPosition:i="static"}=t;0===e.size&&(this.container.style.position=i,L.containerMap.delete(this.container))}}setShowConfig(){this.showConfig=this.getShowConfig(),this.showConfig=Object.assign({matchTargetWidth:!1,matchContainerHeight:!1},this.showConfig),this.showConfig.target&&this.showConfig.appendableElement&&this.elementAppenderContainerController.setContainer()}prepareShow(){this.showConfig.isScreenPosition||this.initVisibleAppendElement(),this.showConfig.appendableElement.style.boxSizing="border-box",this.positionCalculationController.setCalculationStrategy()}initVisibleAppendElement(){const t=window.getComputedStyle(this.container).position;L.containerMap.has(this.container)||L.containerMap.set(this.container,{visibleAppendElements:new Set,originPosition:t}),"static"===t&&(this.container.style.position="relative")}adjustPosition(t){this.positionCalculationController.adjustPosition(t)}setZIndex(){c.setZIndex(this.showConfig.appendableElement,"base")}getShowConfig(){return this.showConfigCallback instanceof Function?this.showConfigCallback(this.showConfigCallbackTarget):this.showConfigCallback}}L.containerMap=new Map,B([e()],L.prototype,"resizeObserverSlimmer",void 0),B([e()],L.prototype,"elementAppenderContainerController",void 0),B([e()],L.prototype,"positionCalculationController",void 0);var W,z=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};!function(t){t.SHOW="show",t.HIDE="hide"}(W||(W={}));class M extends i{constructor(t){super(),this.childrenEA=[],this.currentEA=t}componentDidLoad(){this.register()}onShow(){this.notify(W.SHOW)}onHide(){this.notify(W.HIDE)}getParent(){return this.parentEA}getChildren(){return this.childrenEA}notify(t){const e=n(this.showConfig.target,".vega-element-appender-appendable");e&&v.notify(w.getSubject(e,b),{type:t,child:this.currentEA,callback:t=>{this.parentEA=t}})}register(){this.showConfig&&j.addUniqueObserverToNode(this.showConfig.appendableElement,b,(t=>{t.type===W.SHOW?this.childrenEA.push(t.child):t.type===W.HIDE&&(this.childrenEA=this.childrenEA.filter((e=>e!==t.child))),t.callback(this.currentEA)}))}}z([t()],M.prototype,"showConfig",void 0),z([o("componentDidLoad")],M.prototype,"componentDidLoad",null),z([o("show")],M.prototype,"onShow",null),z([o("hide")],M.prototype,"onHide",null);var V=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class F extends i{constructor(t,e,i="isDropdownShow",s=(()=>!1)){super(),this.hierarchyTreeManager=new M(this),this.registerElementAppenderListener=()=>{var t,e,i,s,o,n;this.unRegisterElementAppenderListener(),this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.addEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.addEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.addEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.addEventListener("focusout",this.targetFocusoutHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.addEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.addEventListener("mouseleave",this.elementMouseLeaveHandler)),window.addEventListener("mousedown",this.globalMouseDownHandler),document.addEventListener("scroll",this.globalScrollHandler,{capture:!0}),this.listenShadowRootElementScrolling()},this.targetClickHandler=()=>{this.shouldListenerWork("click")&&(this.isShowing()?this.hide():this.show())},this.targetMouseEnterHandler=()=>{this.shouldListenerWork("hover")&&(!1===this.isShowing()&&this.show(),this.clearDelayHideTimer())},this.targetMouseLeaveHandler=()=>{this.shouldListenerWork("hover")&&this.createDelayHideTimer()},this.targetFocusoutHandler=t=>{var e;r(t.relatedTarget,null===(e=this.showConfig)||void 0===e?void 0:e.appendableElement)||this.targetMouseLeaveHandler()},this.elementMouseEnterHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseEnterHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.clearDelayHideTimer()},this.elementMouseLeaveHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseLeaveHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.createDelayHideTimer()},this.globalMouseDownHandler=t=>{const e=t.composedPath()[0];!this.hierarchyTreeManager.getChildren().some((t=>t.isShowing()))&&this.shouldListenerWork("custom")&&this.isShowing()&&this.showConfig&&!r(e,this.showConfig.appendableElement)&&!r(e,this.showConfig.target)&&n(e,"vega-modal")===n(this.showConfig.target,"vega-modal")&&this.hide()},this.globalScrollHandler=()=>{var t;this.showConfig&&this.showConfig.isScreenPosition&&this.isShowing()&&(null===(t=this.elementAppender)||void 0===t||t.onScroll())},this.createDelayHideTimer=()=>{this.delayHideTimer=setTimeout((()=>{this.hide(),clearTimeout(this.delayHideTimer)}),F.DELAY_HIDE_TIME)},this.clearDelayHideTimer=()=>{this.delayHideTimer&&clearTimeout(this.delayHideTimer)},this.shouldListenerWork=t=>{const e=this.getTrigger();switch(t){case"custom":return"none"!==e;case"click":return"click"===e;case"hover":return"hover"===e}throw new Error(`Unexpected trigger: ${t}. Expected values are custom, click, or hover.`)},this.showConfigFactory=t,this.getTrigger=e,this.isDropdownShowName=i,this.disableInteractiveGetter=s}connectedCallback(){null===this.elementAppender&&(this.setElementAppender(),this.registerElementAppenderListener())}disconnectedCallback(){this.unRegisterElementAppenderListener(),this.destroyElementAppender()}componentDidLoad(){this.initElementAppender()}getElementAppender(){return this.elementAppender}show(){this.elementAppender&&this.elementAppender.show(),this[this.isDropdownShowName]=!0}hide(){this.elementAppender&&this.elementAppender.hide(),this[this.isDropdownShowName]=!1,this.hierarchyTreeManager.getChildren().map((t=>{t.hide()}))}destroy(){this.destroyElementAppender(),this[this.isDropdownShowName]=!1}updateShowConfigFactory(t){this.showConfigFactory=t,this.initElementAppender()}destroyElementAppender(){this.elementAppender&&(this.elementAppender.destroy(),this.elementAppender=null)}initElementAppender(){this.setShowConfig(),this.setElementAppender(),this.registerElementAppenderListener()}setElementAppender(){this.elementAppender=new L(this.showConfigFactory,this)}isShowing(){return this[this.isDropdownShowName]}setShowConfig(){this.showConfig=this.showConfigFactory()}unRegisterElementAppenderListener(){var t,e,i,s,o,n;this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.removeEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.removeEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.removeEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.removeEventListener("focusout",this.targetMouseLeaveHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.removeEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.removeEventListener("mouseleave",this.elementMouseLeaveHandler)),window.removeEventListener("mousedown",this.globalMouseDownHandler),document.removeEventListener("scroll",this.globalScrollHandler),this.removeShadowRootElementScrolling()}listenShadowRootElementScrolling(){this.shadowRootElementScrollingObserver=new g(this.canAcceptShadowRootScrollEvent.bind(this),this.globalScrollHandler.bind(this)),v.register(m,this.shadowRootElementScrollingObserver)}canAcceptShadowRootScrollEvent(t){return Boolean(this.showConfig&&r(this.showConfig.target,t.host))}removeShadowRootElementScrolling(){v.unregister(m,this.shadowRootElementScrollingObserver)}}F.DELAY_HIDE_TIME=100,V([e()],F.prototype,"hierarchyTreeManager",void 0),V([o("connectedCallback")],F.prototype,"connectedCallback",null),V([o("disconnectedCallback")],F.prototype,"disconnectedCallback",null),V([o("componentDidLoad")],F.prototype,"componentDidLoad",null);export{F as E}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as i,g as a}from"./p-21d26bb4.js";import{c as r,M as o,V as s,I as n}from"./p-6e1ab235.js";import{V as l,I as d}from"./p-d849e0f5.js";import{I as c}from"./p-bcdb235d.js";import{s as p}from"./p-519a7d55.js";import{a as g}from"./p-d5776087.js";import{R as h}from"./p-fb8c99c5.js";import{P as m,g as f}from"./p-7d9cd9c8.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-0c8bd757.js";import"./p-5773a9a3.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-6e01f0a2.js";import"./p-262ec334.js";import"./p-5e2c9e69.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-8c46e116.js";import"./p-5d676a94.js";import"./p-9d6003ef.js";import"./p-53e9595f.js";import"./p-8246f8ae.js";import"./p-65d8c2bc.js";import"./p-b75ee3ba.js";var b=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class v extends s{connectedCallback(){this.setIndex()}disconnectedCallback(){this.removeIndex()}setIndex(){const e=document.querySelector(this.host.dataset.container);e&&"BODY"===e.tagName&&c.setZIndex(this.host,"base")}removeIndex(){c.removeZIndex(this.host,"base")}}b([r()],v.prototype,"host",void 0),b([o("connectedCallback")],v.prototype,"connectedCallback",null),b([o("disconnectedCallback")],v.prototype,"disconnectedCallback",null);var x=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const u=class{constructor(t){e(this,t),this.globalSlimmers={},this.manageVegaLoaderWrapperZIndexController=new v,this.vegaComponentUsageRuntimeMetricsSlimmer=new l}render(){return t(i,{class:"vega-loader-wrapper"},t("slot",null))}get host(){return a(this)}};x([d()],u.prototype,"globalSlimmers",void 0),x([n()],u.prototype,"manageVegaLoaderWrapperZIndexController",void 0),x([n()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u.style=":host{display:block;display:inline-flex;align-items:center;justify-content:center;top:0px;right:0px;bottom:0px;left:0px;background-color:rgba(var(--v-bg-backdrop-loading, 255, 255, 255, 0.5))}:host(.absolute-wrapper){position:absolute}:host(.fixed-wrapper){width:100%;height:100%;position:fixed}";const j=[{payloadKey:"MODE_IS_INDETERMINATE",payloadDescription:"Specifies the mode of the loading indicator",payloadValue:e=>"indeterminate"===e.mode},{payloadKey:"MODE_IS_DETERMINATE",payloadDescription:"Specifies the mode of the loading indicator",payloadValue:e=>"determinate"===e.mode}];var k=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const w=class{constructor(i){e(this,i),this.globalSlimmers={},this.pageResizeObserverSlimmer=new m,this.vegaComponentUsageRuntimeMetricsSlimmer=new l(j),this.currentBreakpoint=f(),this.shape="circle",this.size="default",this.mode="indeterminate",this.percent=0,this.label="",this.hint="",this.status="default",this.renderCircleLoader=()=>{const e=this.getCircleLoaderRadius(this.getResponsiveSize()),i="indeterminate"===this.mode?.75:this.percent/100,a=2*Math.PI*e,r="error"===this.status?a:a*i;return t("svg",{class:"circle-loader"},t("circle",{r:e,class:"circle-loader-track",part:"circle-loader-track"}),t("circle",{r:e,class:"circle-loader-progress",part:"circle-loader-progress","stroke-linecap":"indeterminate"===this.mode?"round":"butt","stroke-dasharray":[r,a].join(" ")}),"determinate"===this.mode&&t("circle",{r:e,class:g(["circle-loader-progress-pointer",0===i&&"v-hidden"].filter(Boolean)),"stroke-dashoffset":-r,"stroke-dasharray":[0,a].join(" ")}))},this.renderBarLoader=()=>{let e=75;return"determinate"===this.mode&&(e="error"===this.status?100:this.percent),t("div",{class:"bar-loader-track"},t("div",{class:g(["bar-loader",this.getResponsiveSize()]),style:{width:`${e}%`}}))},this.renderLabelAndHint=()=>{if(this.label||this.hint)return t("vega-flex",{direction:"col",gap:"size-4",alignItems:"center"},this.label&&t("span",{class:"vega-loading-indicator-label"},this.label),this.hint&&t("span",{class:"vega-loading-indicator-hint"},this.hint))},this.getResponsiveSize=()=>h.formatCustom(this.size),this.getCircleLoaderRadius=e=>{switch(e){case"micro":return 6.5;case"small":return 10;case"large":return 52;default:return 20}}}render(){const e=g([this.getResponsiveSize(),this.mode,`status-${this.status}`,this.shape].map((e=>`vega-loading-indicator-${e}`)));return p(t(i,{class:e},t("vega-flex",{direction:"col",gap:"size-16",alignItems:"center"},"circle"===this.shape?this.renderCircleLoader():this.renderBarLoader(),this.renderLabelAndHint())),this.host)}get host(){return a(this)}};k([d()],w.prototype,"globalSlimmers",void 0),k([n()],w.prototype,"pageResizeObserverSlimmer",void 0),k([n()],w.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),w.style=':host{display:inline-block}:host(.vega-loading-indicator-bar){width:100%}:host(.vega-loading-indicator-indeterminate) .circle-loader{animation:circle-loader-animation 2000ms linear infinite;transform:rotate(-90deg)}:host(.vega-loading-indicator-determinate) .circle-loader{transform:rotate(-180deg)}:host(.vega-loading-indicator-default) .circle-loader{width:48px;height:48px}:host(.vega-loading-indicator-micro) .circle-loader{width:16px;height:16px}:host(.vega-loading-indicator-small) .circle-loader{width:24px;height:24px}:host(.vega-loading-indicator-large) .circle-loader{width:120px;height:120px}:host .circle-loader-track{stroke:rgba(var(--v-bg-loading-track, 229, 239, 255, 1));fill:none;cy:50%;cx:50%}:host .circle-loader-progress-pointer.v-hidden{display:none}:host .circle-loader-progress-pointer,:host .circle-loader-progress{stroke:rgba(var(--v-bg-loading-progress, 153, 192, 255, 1));fill:none;cy:50%;cx:50%}:host(.vega-loading-indicator-status-success) .circle-loader-progress-pointer,:host(.vega-loading-indicator-status-success) .circle-loader-progress{stroke:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.vega-loading-indicator-status-error) .circle-loader-progress-pointer,:host(.vega-loading-indicator-status-error) .circle-loader-progress{stroke:rgba(var(--v-bg-status-error, 255, 110, 139, 1))}:host(.vega-loading-indicator-default) .circle-loader-progress-pointer,:host(.vega-loading-indicator-default) .circle-loader-track,:host(.vega-loading-indicator-default) .circle-loader-progress{stroke-width:8px}:host .circle-loader-progress-pointer{stroke-linecap:round}:host(.vega-loading-indicator-micro) .circle-loader-progress-pointer,:host(.vega-loading-indicator-micro) .circle-loader-track,:host(.vega-loading-indicator-micro) .circle-loader-progress{stroke-width:3px}:host(.vega-loading-indicator-small) .circle-loader-progress-pointer,:host(.vega-loading-indicator-small) .circle-loader-track,:host(.vega-loading-indicator-small) .circle-loader-progress{stroke-width:4px}:host(.vega-loading-indicator-large) .circle-loader-progress-pointer,:host(.vega-loading-indicator-large) .circle-loader-track,:host(.vega-loading-indicator-large) .circle-loader-progress{stroke-width:16px}@keyframes circle-loader-animation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host .bar-loader{border-radius:9999px;position:absolute;box-sizing:border-box;height:8px;background-color:rgba(var(--v-bg-loading-progress, 153, 192, 255, 1));content:"";width:75%;top:0;left:0}:host(.vega-loading-indicator-status-success) .bar-loader{background-color:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.vega-loading-indicator-status-error) .bar-loader{background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1))}:host(.vega-loading-indicator-micro) .bar-loader,:host(.vega-loading-indicator-micro) .bar-loader-track{height:3px}:host(.vega-loading-indicator-small) .bar-loader,:host(.vega-loading-indicator-small) .bar-loader-track{height:4px}:host(.vega-loading-indicator-large) .bar-loader,:host(.vega-loading-indicator-large) .bar-loader-track{height:16px}:host(.vega-loading-indicator-indeterminate) .bar-loader{animation:bar-loader-animation 1250ms cubic-bezier(0.75, 0, 0.5, 1) infinite;animation-delay:50ms}@keyframes bar-loader-animation{0%{left:0;transform:translateX(-100%)}100%{left:100%;transform:translateX(0%)}}:host .bar-loader-track{display:inline-block;border-radius:9999px;position:relative;overflow:hidden;height:8px;width:100%;background-color:rgba(var(--v-bg-loading-track, 229, 239, 255, 1))}:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}';export{u as vega_loader_wrapper,w as vega_loading_indicator}
|
|
1
|
+
import{r as e,h as t,H as i,g as a}from"./p-21d26bb4.js";import{c as r,M as o,V as s,I as n}from"./p-6e1ab235.js";import{V as l,I as d}from"./p-d849e0f5.js";import{I as c}from"./p-bcdb235d.js";import{s as p}from"./p-519a7d55.js";import{a as g}from"./p-d5776087.js";import{R as h}from"./p-4a237308.js";import{P as m,g as f}from"./p-7d9cd9c8.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-0c8bd757.js";import"./p-5773a9a3.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-6e01f0a2.js";import"./p-262ec334.js";import"./p-5e2c9e69.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-8c46e116.js";import"./p-5d676a94.js";import"./p-9d6003ef.js";import"./p-88e08a33.js";import"./p-d7e0c57a.js";import"./p-f5ac60f5.js";import"./p-b75ee3ba.js";var v=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class b extends s{connectedCallback(){this.setIndex()}disconnectedCallback(){this.removeIndex()}setIndex(){const e=document.querySelector(this.host.dataset.container);e&&"BODY"===e.tagName&&c.setZIndex(this.host,"base")}removeIndex(){c.removeZIndex(this.host,"base")}}v([r()],b.prototype,"host",void 0),v([o("connectedCallback")],b.prototype,"connectedCallback",null),v([o("disconnectedCallback")],b.prototype,"disconnectedCallback",null);var x=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const u=class{constructor(t){e(this,t),this.globalSlimmers={},this.manageVegaLoaderWrapperZIndexController=new b,this.vegaComponentUsageRuntimeMetricsSlimmer=new l}render(){return t(i,{class:"vega-loader-wrapper"},t("slot",null))}get host(){return a(this)}};x([d()],u.prototype,"globalSlimmers",void 0),x([n()],u.prototype,"manageVegaLoaderWrapperZIndexController",void 0),x([n()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u.style=":host{display:block;display:inline-flex;align-items:center;justify-content:center;top:0px;right:0px;bottom:0px;left:0px;background-color:rgba(var(--v-bg-backdrop-loading, 255, 255, 255, 0.5))}:host(.absolute-wrapper){position:absolute}:host(.fixed-wrapper){width:100%;height:100%;position:fixed}";const j=[{payloadKey:"MODE_IS_INDETERMINATE",payloadDescription:"Specifies the mode of the loading indicator",payloadValue:e=>"indeterminate"===e.mode},{payloadKey:"MODE_IS_DETERMINATE",payloadDescription:"Specifies the mode of the loading indicator",payloadValue:e=>"determinate"===e.mode}];var k=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const w=class{constructor(i){e(this,i),this.globalSlimmers={},this.pageResizeObserverSlimmer=new m,this.vegaComponentUsageRuntimeMetricsSlimmer=new l(j),this.currentBreakpoint=f(),this.shape="circle",this.size="default",this.mode="indeterminate",this.percent=0,this.label="",this.hint="",this.status="default",this.renderCircleLoader=()=>{const e=this.getCircleLoaderRadius(this.getResponsiveSize()),i="indeterminate"===this.mode?.75:this.percent/100,a=2*Math.PI*e,r="error"===this.status?a:a*i;return t("svg",{class:"circle-loader"},t("circle",{r:e,class:"circle-loader-track",part:"circle-loader-track"}),t("circle",{r:e,class:"circle-loader-progress",part:"circle-loader-progress","stroke-linecap":"indeterminate"===this.mode?"round":"butt","stroke-dasharray":[r,a].join(" ")}),"determinate"===this.mode&&t("circle",{r:e,class:g(["circle-loader-progress-pointer",0===i&&"v-hidden"].filter(Boolean)),"stroke-dashoffset":-r,"stroke-dasharray":[0,a].join(" ")}))},this.renderBarLoader=()=>{let e=75;return"determinate"===this.mode&&(e="error"===this.status?100:this.percent),t("div",{class:"bar-loader-track"},t("div",{class:g(["bar-loader",this.getResponsiveSize()]),style:{width:`${e}%`}}))},this.renderLabelAndHint=()=>{if(this.label||this.hint)return t("vega-flex",{direction:"col",gap:"size-4",alignItems:"center"},this.label&&t("span",{class:"vega-loading-indicator-label"},this.label),this.hint&&t("span",{class:"vega-loading-indicator-hint"},this.hint))},this.getResponsiveSize=()=>h.formatCustom(this.size),this.getCircleLoaderRadius=e=>{switch(e){case"micro":return 6.5;case"small":return 10;case"large":return 52;default:return 20}}}render(){const e=g([this.getResponsiveSize(),this.mode,`status-${this.status}`,this.shape].map((e=>`vega-loading-indicator-${e}`)));return p(t(i,{class:e},t("vega-flex",{direction:"col",gap:"size-16",alignItems:"center"},"circle"===this.shape?this.renderCircleLoader():this.renderBarLoader(),this.renderLabelAndHint())),this.host)}get host(){return a(this)}};k([d()],w.prototype,"globalSlimmers",void 0),k([n()],w.prototype,"pageResizeObserverSlimmer",void 0),k([n()],w.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),w.style=':host{display:inline-block}:host(.vega-loading-indicator-bar){width:100%}:host(.vega-loading-indicator-indeterminate) .circle-loader{animation:circle-loader-animation 2000ms linear infinite;transform:rotate(-90deg)}:host(.vega-loading-indicator-determinate) .circle-loader{transform:rotate(-180deg)}:host(.vega-loading-indicator-default) .circle-loader{width:48px;height:48px}:host(.vega-loading-indicator-micro) .circle-loader{width:16px;height:16px}:host(.vega-loading-indicator-small) .circle-loader{width:24px;height:24px}:host(.vega-loading-indicator-large) .circle-loader{width:120px;height:120px}:host .circle-loader-track{stroke:rgba(var(--v-bg-loading-track, 229, 239, 255, 1));fill:none;cy:50%;cx:50%}:host .circle-loader-progress-pointer.v-hidden{display:none}:host .circle-loader-progress-pointer,:host .circle-loader-progress{stroke:rgba(var(--v-bg-loading-progress, 153, 192, 255, 1));fill:none;cy:50%;cx:50%}:host(.vega-loading-indicator-status-success) .circle-loader-progress-pointer,:host(.vega-loading-indicator-status-success) .circle-loader-progress{stroke:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.vega-loading-indicator-status-error) .circle-loader-progress-pointer,:host(.vega-loading-indicator-status-error) .circle-loader-progress{stroke:rgba(var(--v-bg-status-error, 255, 110, 139, 1))}:host(.vega-loading-indicator-default) .circle-loader-progress-pointer,:host(.vega-loading-indicator-default) .circle-loader-track,:host(.vega-loading-indicator-default) .circle-loader-progress{stroke-width:8px}:host .circle-loader-progress-pointer{stroke-linecap:round}:host(.vega-loading-indicator-micro) .circle-loader-progress-pointer,:host(.vega-loading-indicator-micro) .circle-loader-track,:host(.vega-loading-indicator-micro) .circle-loader-progress{stroke-width:3px}:host(.vega-loading-indicator-small) .circle-loader-progress-pointer,:host(.vega-loading-indicator-small) .circle-loader-track,:host(.vega-loading-indicator-small) .circle-loader-progress{stroke-width:4px}:host(.vega-loading-indicator-large) .circle-loader-progress-pointer,:host(.vega-loading-indicator-large) .circle-loader-track,:host(.vega-loading-indicator-large) .circle-loader-progress{stroke-width:16px}@keyframes circle-loader-animation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host .bar-loader{border-radius:9999px;position:absolute;box-sizing:border-box;height:8px;background-color:rgba(var(--v-bg-loading-progress, 153, 192, 255, 1));content:"";width:75%;top:0;left:0}:host(.vega-loading-indicator-status-success) .bar-loader{background-color:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.vega-loading-indicator-status-error) .bar-loader{background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1))}:host(.vega-loading-indicator-micro) .bar-loader,:host(.vega-loading-indicator-micro) .bar-loader-track{height:3px}:host(.vega-loading-indicator-small) .bar-loader,:host(.vega-loading-indicator-small) .bar-loader-track{height:4px}:host(.vega-loading-indicator-large) .bar-loader,:host(.vega-loading-indicator-large) .bar-loader-track{height:16px}:host(.vega-loading-indicator-indeterminate) .bar-loader{animation:bar-loader-animation 1250ms cubic-bezier(0.75, 0, 0.5, 1) infinite;animation-delay:50ms}@keyframes bar-loader-animation{0%{left:0;transform:translateX(-100%)}100%{left:100%;transform:translateX(0%)}}:host .bar-loader-track{display:inline-block;border-radius:9999px;position:relative;overflow:hidden;height:8px;width:100%;background-color:rgba(var(--v-bg-loading-track, 229, 239, 255, 1))}:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}';export{u as vega_loader_wrapper,w as vega_loading_indicator}
|