@globalpayments/vega 2.55.1 → 2.56.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.
Files changed (258) hide show
  1. package/dist/cjs/{app-globals-f1ff47e3.js → app-globals-7e482341.js} +2 -2
  2. package/dist/cjs/{code-block-2d014e17.js → code-block-e56c5216.js} +99 -110
  3. package/dist/cjs/{component-value-history-controller-slimmer.abstract-6bfb9145.js → component-value-history-controller-slimmer.abstract-9a1285a1.js} +5 -5
  4. package/dist/cjs/{content-state-6a5da7ec.js → content-state-e07c843c.js} +90 -84
  5. package/dist/cjs/{design-token-d15e60fa.js → design-token-3e0bd48d.js} +1 -1
  6. package/dist/cjs/{element-appender-slimmer-2f16891f.js → element-appender-slimmer-2b9ca234.js} +1 -1
  7. package/dist/cjs/{image-annotation-action-617bbb13.js → image-annotation-action-76e3c89d.js} +1 -1
  8. package/dist/cjs/index.cjs.js +5 -5
  9. package/dist/cjs/loader.cjs.js +4 -4
  10. package/dist/cjs/{public-rules-a3b7e267.js → public-rules-1ac67099.js} +3 -3
  11. package/dist/cjs/{responsive-format-facade-4a19e115.js → responsive-format-facade-e2e11c24.js} +1 -1
  12. package/dist/cjs/{rich-text-editor-required-rule-e9c7c379.js → rich-text-editor-required-rule-63f50aa4.js} +3 -3
  13. package/dist/cjs/{style-formatter-b8cea5ee.js → style-formatter-0213d3a8.js} +1 -1
  14. package/dist/cjs/vega-accordion.cjs.entry.js +4 -4
  15. package/dist/cjs/vega-app-header-button.cjs.entry.js +4 -4
  16. package/dist/cjs/vega-box.cjs.entry.js +5 -5
  17. package/dist/cjs/vega-button-circle.cjs.entry.js +4 -4
  18. package/dist/cjs/vega-button.cjs.entry.js +3 -3
  19. package/dist/cjs/vega-calendar_3.cjs.entry.js +49 -10
  20. package/dist/cjs/vega-card.cjs.entry.js +4 -4
  21. package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
  22. package/dist/cjs/vega-chip.cjs.entry.js +4 -4
  23. package/dist/cjs/vega-code-block.cjs.entry.js +2 -2
  24. package/dist/cjs/vega-date-picker_2.cjs.entry.js +4 -4
  25. package/dist/cjs/vega-dialog_2.cjs.entry.js +4 -4
  26. package/dist/cjs/vega-divider.cjs.entry.js +4 -4
  27. package/dist/cjs/vega-dropdown_5.cjs.entry.js +7 -6
  28. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  29. package/dist/cjs/vega-flag-icon.cjs.entry.js +4 -4
  30. package/dist/cjs/vega-flex.cjs.entry.js +5 -5
  31. package/dist/cjs/vega-font.cjs.entry.js +4 -4
  32. package/dist/cjs/vega-grid.cjs.entry.js +4 -4
  33. package/dist/cjs/vega-icon.cjs.entry.js +4 -4
  34. package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -3
  35. package/dist/cjs/vega-input-phone-number.cjs.entry.js +2 -2
  36. package/dist/cjs/vega-input-select.cjs.entry.js +3 -3
  37. package/dist/cjs/vega-left-nav_5.cjs.entry.js +4 -4
  38. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
  39. package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
  40. package/dist/cjs/vega-popover_2.cjs.entry.js +4 -4
  41. package/dist/cjs/vega-rich-text-content.cjs.entry.js +13 -13
  42. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +68 -68
  43. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +3 -3
  44. package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
  45. package/dist/cjs/vega-signature-capture.cjs.entry.js +4 -4
  46. package/dist/cjs/vega-table_8.cjs.entry.js +3 -3
  47. package/dist/cjs/vega-time-picker_2.cjs.entry.js +4 -4
  48. package/dist/cjs/vega-tooltip_2.cjs.entry.js +4 -4
  49. package/dist/cjs/vega.cjs.js +4 -4
  50. package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +1 -1
  51. package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.js +24 -7
  52. package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +11 -2
  53. package/dist/collection/components/vega-calendar/vega-calendar.css +6 -0
  54. package/dist/collection/components/vega-calendar/vega-calendar.js +43 -0
  55. package/dist/collection/components/vega-dropdown/vega-dropdown.js +1 -1
  56. package/dist/collection/components/vega-input-select/vega-input-select.js +1 -1
  57. package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +2 -2
  58. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +4 -4
  59. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/block-update-text-style-strategy.js +2 -2
  60. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-split-text-strategy.js +1 -1
  61. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-update-annotation-map-strategy.js +1 -1
  62. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-blocks-strategy.js +3 -3
  63. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-append-nodes-strategy.js +3 -3
  64. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-image-strategy.js +2 -2
  65. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +28 -47
  66. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-content-strategy.js +7 -7
  67. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-blocks-before-strategy.js +3 -3
  68. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-strategy.js +3 -3
  69. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-insert-line-break-with-blocks-strategy.js +2 -2
  70. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-merge-nodes-strategy.js +3 -3
  71. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-child-block-strategy.js +2 -2
  72. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-remove-node-strategy.js +3 -3
  73. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-node-with-nodes-strategy.js +3 -3
  74. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-replace-nodes-strategy.js +1 -1
  75. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-image-node-strategy.js +4 -4
  76. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-split-with-text-node-strategy.js +3 -3
  77. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-transform-to-code-block-strategy.js +1 -1
  78. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.js +3 -3
  79. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-block-insert-image-strategy.js +2 -2
  80. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-strategy.js +1 -1
  81. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/image-insert-line-break-with-blocks-strategy.js +2 -2
  82. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-delete-text-content-strategy.js +1 -1
  83. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-insert-new-paragraph-strategy.js +3 -3
  84. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-nest-list-strategy.js +4 -4
  85. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-remove-node-strategy.js +2 -2
  86. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-item-replace-nest-list-strategy.js +1 -1
  87. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-remove-list-item-strategy.js +1 -1
  88. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-list-strategy.js +3 -3
  89. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/list-transform-to-paragraph-strategy.js +9 -9
  90. package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/switch-out-from-code-block-strategy.js +2 -2
  91. package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +8 -0
  92. package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +5 -5
  93. package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +7 -7
  94. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +6 -6
  95. package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +18 -12
  96. package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +9 -9
  97. package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +14 -14
  98. package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +2 -2
  99. package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +2 -2
  100. package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +4 -4
  101. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/block-text-nodes-renderer.abstract.js +2 -2
  102. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/code-block-renderer.js +1 -1
  103. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/image-block-renderer.js +1 -1
  104. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-block-renderer.js +1 -1
  105. package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/list-item-block-renderer.js +1 -1
  106. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.js +2 -2
  107. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/delete-selected-nodes-controller.js +20 -20
  108. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/focus-controller.js +1 -1
  109. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/li-to-rte-list-item-block-strategy.js +1 -1
  110. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ol-to-rte-list-block-strategy.js +1 -1
  111. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/ul-to-rte-list-block-strategy.js +1 -1
  112. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/delete-content-handler.js +8 -8
  113. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-line-break-handler.js +8 -8
  114. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paragraph-handler.js +4 -4
  115. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +5 -5
  116. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-text-handler.js +6 -6
  117. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-composition-text-controller.js +4 -4
  118. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/insert-image-controller.js +1 -1
  119. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/internal-code-block-selection-controller.js +1 -1
  120. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +4 -4
  121. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +1 -1
  122. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/code-block-toolbar-button-slimmer.js +1 -1
  123. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/block-insert-line-break-with-blocks-strategy.test.js +3 -3
  124. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/list-item-strategy-register.test.js +56 -0
  125. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/node-split-text-strategy.test.js +1 -1
  126. package/dist/collection/components/vega-rich-text-editor/test/dto/action-handle-strategies/text-block-strategy-register.test.js +3 -3
  127. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/code-block.test.js +5 -5
  128. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/image-block.test.js +3 -3
  129. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-block.test.js +7 -7
  130. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/list-item.test.js +3 -3
  131. package/dist/collection/components/vega-rich-text-editor/test/dto/blocks/text-block.test.js +3 -3
  132. package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +18 -18
  133. package/dist/collection/components/vega-rich-text-editor/test/dto/nodes/text-node.test.js +9 -9
  134. package/dist/collection/helpers/validator/rules/rich-text-editor-required-rule.js +2 -2
  135. package/dist/esm/{app-globals-4881974a.js → app-globals-b5881948.js} +2 -2
  136. package/dist/esm/{code-block-ef2f04ca.js → code-block-1cdb0599.js} +99 -110
  137. package/dist/esm/{component-value-history-controller-slimmer.abstract-0a0ef33f.js → component-value-history-controller-slimmer.abstract-c12b2958.js} +5 -5
  138. package/dist/esm/{content-state-69d29a07.js → content-state-cf27d19b.js} +90 -84
  139. package/dist/esm/{design-token-9bbefd23.js → design-token-96e03257.js} +1 -1
  140. package/dist/esm/{element-appender-slimmer-8652e8d7.js → element-appender-slimmer-00dcccb9.js} +1 -1
  141. package/dist/esm/{image-annotation-action-1497f70e.js → image-annotation-action-e76b3396.js} +1 -1
  142. package/dist/esm/index.js +5 -5
  143. package/dist/esm/loader.js +4 -4
  144. package/dist/esm/{public-rules-3436034b.js → public-rules-e8616346.js} +3 -3
  145. package/dist/esm/{responsive-format-facade-bcc2fd21.js → responsive-format-facade-464498b6.js} +1 -1
  146. package/dist/esm/{rich-text-editor-required-rule-cc5b6a2d.js → rich-text-editor-required-rule-69844536.js} +3 -3
  147. package/dist/esm/{style-formatter-00d6c32f.js → style-formatter-670e20f7.js} +1 -1
  148. package/dist/esm/vega-accordion.entry.js +4 -4
  149. package/dist/esm/vega-app-header-button.entry.js +4 -4
  150. package/dist/esm/vega-box.entry.js +5 -5
  151. package/dist/esm/vega-button-circle.entry.js +4 -4
  152. package/dist/esm/vega-button.entry.js +3 -3
  153. package/dist/esm/vega-calendar_3.entry.js +49 -10
  154. package/dist/esm/vega-card.entry.js +4 -4
  155. package/dist/esm/vega-carousel.entry.js +3 -3
  156. package/dist/esm/vega-chip.entry.js +4 -4
  157. package/dist/esm/vega-code-block.entry.js +2 -2
  158. package/dist/esm/vega-date-picker_2.entry.js +4 -4
  159. package/dist/esm/vega-dialog_2.entry.js +4 -4
  160. package/dist/esm/vega-divider.entry.js +4 -4
  161. package/dist/esm/vega-dropdown_5.entry.js +7 -6
  162. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  163. package/dist/esm/vega-flag-icon.entry.js +4 -4
  164. package/dist/esm/vega-flex.entry.js +5 -5
  165. package/dist/esm/vega-font.entry.js +4 -4
  166. package/dist/esm/vega-grid.entry.js +4 -4
  167. package/dist/esm/vega-icon.entry.js +4 -4
  168. package/dist/esm/vega-image-uploader.entry.js +3 -3
  169. package/dist/esm/vega-input-phone-number.entry.js +2 -2
  170. package/dist/esm/vega-input-select.entry.js +3 -3
  171. package/dist/esm/vega-left-nav_5.entry.js +4 -4
  172. package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
  173. package/dist/esm/vega-pagination.entry.js +3 -3
  174. package/dist/esm/vega-popover_2.entry.js +4 -4
  175. package/dist/esm/vega-rich-text-content.entry.js +13 -13
  176. package/dist/esm/vega-rich-text-editor_4.entry.js +68 -68
  177. package/dist/esm/vega-selection-chip_2.entry.js +3 -3
  178. package/dist/esm/vega-sidenav_3.entry.js +3 -3
  179. package/dist/esm/vega-signature-capture.entry.js +4 -4
  180. package/dist/esm/vega-table_8.entry.js +3 -3
  181. package/dist/esm/vega-time-picker_2.entry.js +4 -4
  182. package/dist/esm/vega-tooltip_2.entry.js +4 -4
  183. package/dist/esm/vega.js +4 -4
  184. package/dist/types/components/vega-app-header-button/types.d.ts +2 -0
  185. package/dist/types/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.d.ts +1 -0
  186. package/dist/types/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.d.ts +1 -0
  187. package/dist/types/components/vega-calendar/types.d.ts +2 -0
  188. package/dist/types/components/vega-calendar/vega-calendar.d.ts +14 -1
  189. package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +13 -2
  190. package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +2 -2
  191. package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +2 -2
  192. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +2 -2
  193. package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +8 -2
  194. package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +2 -2
  195. package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +1 -1
  196. package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +2 -2
  197. package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +2 -2
  198. package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +3 -3
  199. package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +2 -2
  200. package/dist/types/components.d.ts +15 -1
  201. package/dist/types/types/components.type.d.ts +1 -0
  202. package/dist/vega/index.esm.js +1 -1
  203. package/dist/vega/{p-0e8324f2.entry.js → p-03c759ae.entry.js} +1 -1
  204. package/dist/vega/p-04c8b83d.entry.js +1 -0
  205. package/dist/vega/{p-c212a1e3.entry.js → p-08a0cbd0.entry.js} +1 -1
  206. package/dist/vega/{p-72e14f49.entry.js → p-0c660956.entry.js} +1 -1
  207. package/dist/vega/{p-1b165fbb.entry.js → p-144d2390.entry.js} +1 -1
  208. package/dist/vega/{p-c48a8510.entry.js → p-1737536e.entry.js} +1 -1
  209. package/dist/vega/{p-ad858290.entry.js → p-1a7d0e21.entry.js} +1 -1
  210. package/dist/vega/{p-9dc9fcf3.js → p-1c3e1134.js} +1 -1
  211. package/dist/vega/{p-ecd9a973.entry.js → p-1ebc1acf.entry.js} +1 -1
  212. package/dist/vega/{p-1d41f551.entry.js → p-2a6517f9.entry.js} +1 -1
  213. package/dist/vega/p-2f6c4f2c.entry.js +1 -0
  214. package/dist/vega/{p-f17c9093.entry.js → p-302e01e9.entry.js} +1 -1
  215. package/dist/vega/{p-f7062473.entry.js → p-3162a3f0.entry.js} +1 -1
  216. package/dist/vega/{p-6681efd5.js → p-397c7199.js} +1 -1
  217. package/dist/vega/{p-8270bb8f.entry.js → p-487c0f17.entry.js} +1 -1
  218. package/dist/vega/{p-ca91268b.entry.js → p-4a12fb0d.entry.js} +1 -1
  219. package/dist/vega/{p-f9cf7e36.js → p-4b2a90b8.js} +1 -1
  220. package/dist/vega/{p-84a31a31.entry.js → p-4c595d8d.entry.js} +1 -1
  221. package/dist/vega/{p-43ba9a8a.entry.js → p-576b812b.entry.js} +1 -1
  222. package/dist/vega/{p-56dc1345.entry.js → p-59f1fd3e.entry.js} +1 -1
  223. package/dist/vega/{p-5a6b8846.entry.js → p-5be150cb.entry.js} +1 -1
  224. package/dist/vega/{p-a63e2fee.entry.js → p-5cb92c51.entry.js} +1 -1
  225. package/dist/vega/p-5f377954.js +1 -1
  226. package/dist/vega/{p-201a78a2.entry.js → p-5f86a286.entry.js} +1 -1
  227. package/dist/vega/{p-4f5079bc.entry.js → p-636142ae.entry.js} +1 -1
  228. package/dist/vega/{p-327be043.js → p-66516ee9.js} +1 -1
  229. package/dist/vega/p-68864531.js +1 -0
  230. package/dist/vega/p-6a7b7214.js +1 -0
  231. package/dist/vega/p-6b8d105e.entry.js +1 -0
  232. package/dist/vega/{p-c7e2a155.entry.js → p-7728041e.entry.js} +1 -1
  233. package/dist/vega/p-778fd499.js +1 -0
  234. package/dist/vega/{p-13ca73c7.entry.js → p-7cc20ed5.entry.js} +1 -1
  235. package/dist/vega/{p-cce253c2.entry.js → p-81e56716.entry.js} +1 -1
  236. package/dist/vega/p-962b40d1.entry.js +1 -0
  237. package/dist/vega/{p-c10b4f47.entry.js → p-9d286c08.entry.js} +1 -1
  238. package/dist/vega/{p-cae183fd.entry.js → p-a42bc438.entry.js} +1 -1
  239. package/dist/vega/{p-b89a9760.js → p-ae74d511.js} +1 -1
  240. package/dist/vega/{p-da95668c.entry.js → p-b3da0b44.entry.js} +1 -1
  241. package/dist/vega/{p-1e4b6f0a.entry.js → p-c0043eed.entry.js} +1 -1
  242. package/dist/vega/p-c685adcd.js +1 -0
  243. package/dist/vega/{p-9c0cda62.js → p-d8e1ed2d.js} +1 -1
  244. package/dist/vega/{p-9a0d3d2d.entry.js → p-dc383362.entry.js} +1 -1
  245. package/dist/vega/{p-822cd8e5.js → p-dc3d93d6.js} +1 -1
  246. package/dist/vega/{p-79370ad4.entry.js → p-e2282f71.entry.js} +1 -1
  247. package/dist/vega/{p-c8a87f06.entry.js → p-e5eda663.entry.js} +1 -1
  248. package/dist/vega/{p-7704a608.entry.js → p-ec7dc51f.entry.js} +1 -1
  249. package/dist/vega/vega.esm.js +1 -1
  250. package/package.json +5 -1
  251. package/dist/vega/p-3eb2d433.js +0 -1
  252. package/dist/vega/p-3fa7d356.js +0 -1
  253. package/dist/vega/p-547692bf.entry.js +0 -1
  254. package/dist/vega/p-57005931.entry.js +0 -1
  255. package/dist/vega/p-5e8e4aba.js +0 -1
  256. package/dist/vega/p-cb36ccf0.entry.js +0 -1
  257. package/dist/vega/p-ec3495de.entry.js +0 -1
  258. package/dist/vega/p-fecb4044.js +0 -1
@@ -1 +0,0 @@
1
- import{h as e,F as t,f as n,r as i,c as r,H as a,g as o}from"./p-21d26bb4.js";import{s}from"./p-519a7d55.js";import{c as l,V as d,M as c,L as h,I as v}from"./p-6e1ab235.js";import{V as p,I as f}from"./p-4387d550.js";import{D as m}from"./p-e7b00bf0.js";import{a as w,f as u,b as g,d as x,g as b,h as y,i as k}from"./p-6e01f0a2.js";import{V as C}from"./p-c9b9322b.js";import{p as R}from"./p-08835909.js";import{c as j}from"./p-012cbd8f.js";import{C as D}from"./p-6b7dca3e.js";import{t as E}from"./p-425ba7d6.js";import{c as z}from"./p-86194314.js";import{f as I}from"./p-d27ae9ff.js";import{g as M}from"./p-37b05e0b.js";import{P as S}from"./p-7d9cd9c8.js";import{d as T}from"./p-1bc5b3bc.js";import{C as O}from"./p-2d0d575f.js";import{c as V}from"./p-8e31e7ea.js";import{T as $}from"./p-d64b20c2.js";import{s as P}from"./p-6bd5c49b.js";import{q as B}from"./p-b1f65b13.js";import{s as N}from"./p-2205ee4c.js";import{S as L}from"./p-138fcf6e.js";import{b as A}from"./p-0c667d6a.js";import"./p-331a62d5.js";import"./p-d5776087.js";import"./p-cc63e827.js";import"./p-6a334573.js";import"./p-613ee009.js";import"./p-b75ee3ba.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-262ec334.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-4ab3df00.js";import"./p-5773a9a3.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";var F=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class W extends d{render(){return e(t,null,this.switchPanelRenderer.render(),this.viewRenderer.render())}}F([l()],W.prototype,"switchPanelRenderer",void 0),F([l()],W.prototype,"viewRenderer",void 0);const H=(e=0)=>{const t=[0,1,2,3,4,5,6];return t.concat(t).slice(e,e+7)};class U{constructor(){this.WEEKDAYS_SHORT=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.weekdays=H()}getWeekdayNames(){return this.WEEKDAYS_SHORT}generateDates(e){const t=e.startDate.toDate(),n=[];for(let i=0;i<e.count;i++)n.push(new Date(t)),t.setDate(t.getDate()+1);return n}generateWeekHead(){return this.weekdays.map((e=>this.getWeekdayNames()[e]))}}class Y{constructor(e,t){this._weekdays=e,this._dateItems=t}get weekdays(){return this._weekdays}get dateItems(){return this._dateItems}}class _ extends U{generate(e){return new Y([this.generateWeekHead()[e.current.toDate().getDay()]],[[e.current]])}}class q{constructor(e,t,n){this._date=n,this._month=t,this._year=e}static from(e){return new q(e.getFullYear(),e.getMonth()+1,e.getDate())}get year(){return this._year}set year(e){this._year=e}get month(){return this._month}set month(e){this._month=e}get date(){return this._date}set date(e){this._date=e}isToday(){const e=new Date;return e.getFullYear()===this.year&&e.getMonth()+1===this.month&&e.getDate()===this.date}toDate(){return new Date(this.year,this.month-1,this.date)}compare(e){const{year:t,month:n}=e,i={isPreviousMonth:!1,inMonth:!1,isNextMonth:!1};return this.year===t?this.month<n?i.isPreviousMonth=!0:this.month>n?i.isNextMonth=!0:i.inMonth=!0:this.year>t?i.isNextMonth=!0:i.isPreviousMonth=!0,i}equal(e){const{year:t,month:n,date:i}=e;return this._year===t&&this._month===n&&this._date===i}}class K extends U{generate(e){const t=this.generateDates(e),n=e.showWeekends;let i=this.generateWeekHead(),r=[t.map(q.from)];return!1===n&&(i=i.slice(1,6),r=r.map((e=>e.slice(1,6)))),new Y(i,r)}}class X extends U{generate(e){const t=e.showWeekends;let n=[],i=[];this.generateDates(e).forEach(((e,t)=>{t%7||(n[t/7]=i=[]);const r=q.from(e);i.push(r)}));let r=this.generateWeekHead();return!1===t&&(r=r.slice(1,6),n=n.map((e=>e.slice(1,6)))),new Y(r,n)}}class G{constructor(e,t){this._count=e,this._current=t||q.from(new Date),this.calculatePeriod(this._current)}get current(){return this._current}get startDate(){return this._startDate}get endDate(){return this._endDate}get count(){return this._count}get type(){return this._type}get showWeekends(){return this._showWeekends}goTo(e){return this.createBy(e)}now(){return this.createBy(q.from(new Date))}calculatePeriod(e){const t=e.toDate();this.count>1&&t.setDate(t.getDate()-H().indexOf(t.getDay())),this._startDate=q.from(t),t.setDate(t.getDate()+this.count-1),this._endDate=q.from(t)}}class J extends G{constructor(e,t){super(J.DISPLAY_DATE_COUNT,e),this._type="day",this._showWeekends=!0,this._showWeekends=!1!==t}next(){const e=this.current.toDate();e.setDate(e.getDate()+1);let t=q.from(e);return!1===this._showWeekends&&(t=re(t)),this.createBy(t)}previous(){const e=this.current.toDate();e.setDate(e.getDate()-1);let t=q.from(e);return!1===this._showWeekends&&(t=re(t,ee.PREVIOUS)),this.createBy(t)}now(){let e=q.from(new Date);return!1===this._showWeekends&&(e=re(e)),this.createBy(e)}createBy(e){return new J(e,this._showWeekends)}}J.DISPLAY_DATE_COUNT=1;class Q extends G{constructor(e,t){super(Q.DISPLAY_DATE_COUNT,e),this._type="week",this._showWeekends=!0,this._showWeekends=!1!==t}next(){const e=this.current.toDate();return e.setDate(e.getDate()-H().indexOf(e.getDay())+7),this.createBy(q.from(e))}previous(){const e=this.current.toDate();return e.setDate(e.getDate()-H().indexOf(e.getDay())-7),this.createBy(q.from(e))}createBy(e){return new Q(e,this._showWeekends)}}Q.DISPLAY_DATE_COUNT=7;class Z extends G{constructor(e,t){super(Z.DISPLAY_DATE_COUNT,Z.getMonthFirstDay(e)),this._type="month",this._showWeekends=!0,this._showWeekends=!1!==t}static getMonthFirstDay(e){const t=e||q.from(new Date);return new q(t.year,t.month,1)}next(){const e=this.current.toDate();return e.setMonth(e.getMonth()+1),this.createBy(q.from(e))}previous(){const e=this.current.toDate();return e.setMonth(e.getMonth()-1),this.createBy(q.from(e))}createBy(e){return new Z(e,this._showWeekends)}}var ee;function te(e,t=!1){return e.toLocaleDateString("en-US",{month:t?"short":"long"})}function ne(e,t=15){const[n,i]=e.split(":");return Math.round((60*Number(n)+Number(i))/t)}function ie(e){return"vega-calendar-event-slot-"+e}function re(e,t=ee.NEXT){const n=e.toDate().getDay();if(0===n||6===n){let i=0===n?1:2;return t===ee.PREVIOUS&&(i=0===n?-2:-1),q.from(new Date(e.year,e.month-1,e.date+i))}return e}Z.DISPLAY_DATE_COUNT=42,function(e){e.PREVIOUS="-1",e.NEXT="1"}(ee||(ee={}));var ae=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class oe extends d{constructor(){super(...arguments),this.handleViewChange=e=>{this.currentPeriodController.updateCalendarPeriod(e.detail,this.currentPeriod.current)},this.todayButtonClick=()=>{this.currentPeriodController.setCurrentPeriod(this.currentPeriod.now())},this.nextButtonClick=()=>{this.currentPeriodController.setCurrentPeriod(this.currentPeriod.next())},this.prevButtonClick=()=>{this.currentPeriodController.setCurrentPeriod(this.currentPeriod.previous())},this.moreActionMenuClick=e=>{this.moreActionClickEmitter.emit(e.detail)}}getSwitchPanelRef(){return this.switchPanelRef}render(){return e("vega-flex",{direction:"row",gap:"size-16",justifyContent:"space-between",alignItems:"center",class:"calendar-switch-panel",ref:e=>this.switchPanelRef=e},this.renderDateSwitch(),e("div",{class:"calendar-view-switch-container"},this.renderViewSwitch(),this.renderMoreActionMenu()))}renderDateSwitch(){return e("div",{class:"calendar-date-switch-container"},e("vega-button",{variant:"secondary",size:"small",ref:e=>{m.addUniqueObserverToNode(e,w,this.todayButtonClick)},label:this.translationSlimmer.t("Today")}),e("vega-button-circle",{variant:"secondary",size:"small",icon:C.getIconKey("chevron-left"),label:"previous",showTooltip:!1,ref:e=>{m.addUniqueObserverToNode(e,w,this.prevButtonClick)}}),e("vega-button-circle",{variant:"secondary",size:"small",icon:C.getIconKey("chevron-right"),label:"next",showTooltip:!1,ref:e=>{m.addUniqueObserverToNode(e,w,this.nextButtonClick)}}),this.renderCurrentPeriod())}renderCurrentPeriod(){return e("vega-font",{class:"calendar-current-date",variant:"font-field-label",color:"text-primary"},this.getViewDateSummary())}renderViewSwitch(){return e("vega-segment-control",{segments:oe.views.map((e=>Object.assign(Object.assign({},e),{text:this.translationSlimmer.t(e.text)}))),size:"small",variant:"text-only",selected:this.viewMode,ref:e=>{m.addUniqueObserverToNode(e,u,this.handleViewChange)}})}renderMoreActionMenu(){var t,n;if(null===(n=null===(t=this.moreActionDropdownProps)||void 0===t?void 0:t.source)||void 0===n?void 0:n.length)return e("vega-dropdown",Object.assign({alignment:"end",trigger:"click"},this.moreActionDropdownProps,{ref:e=>{m.addUniqueObserverToNode(e,g,this.moreActionMenuClick)}}),e("vega-button-circle",{size:"small",icon:C.getIconKey("ellipsis-vertical"),variant:"icon-only"}))}getViewDateSummary(){const e=this.currentPeriod.current;let t="";switch(this.viewMode){case"day":{const n=this.translationSlimmer.t(te(e.toDate()));t=`${e.date} ${n}, ${e.year}`;break}case"week":{const e=this.calendarView.dateItems[0],n=e[0],i=e[e.length-1],[r,a]=[n,i].map((e=>this.translationSlimmer.t(te(e.toDate()))));t=`${n.date} ${r}${n.year===i.year?"":", "+n.year} - ${i.date} ${a}, ${i.year}`;break}case"month":t=`${this.translationSlimmer.t(te(e.toDate()))}, ${e.year}`}return t}}C.register({"chevron-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/></svg>'},"chevron-left":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"/></svg>'},"ellipsis-vertical":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M48 464a48 48 0 1 1 0-96 48 48 0 1 1 0 96zm0-160a48 48 0 1 1 0-96 48 48 0 1 1 0 96zM0 96a48 48 0 1 1 96 0A48 48 0 1 1 0 96z"/></svg>'}}),oe.views=[{text:"Day",key:"day"},{text:"Week",key:"week"},{text:"Month",key:"month"}],ae([l()],oe.prototype,"viewMode",void 0),ae([l()],oe.prototype,"calendarView",void 0),ae([l()],oe.prototype,"currentPeriod",void 0),ae([l()],oe.prototype,"moreActionDropdownProps",void 0),ae([l()],oe.prototype,"moreActionClickEmitter",void 0),ae([l()],oe.prototype,"currentPeriodController",void 0),ae([l()],oe.prototype,"calendarViewController",void 0),ae([l()],oe.prototype,"translationSlimmer",void 0);var se=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class le extends d{getCalendarViewElementRef(){return this.calendarViewElementRef}render(){return e("div",{class:`calendar-view calendar-view-${this.viewMode} ${!1===this.showWeekends?"calendar-hide-weekends":""}`,ref:e=>this.calendarViewElementRef=e},"month"===this.viewMode?this.monthViewRenderer.render():this.viewWithTimeRenderer.render())}}se([l()],le.prototype,"viewMode",void 0),se([l()],le.prototype,"showWeekends",void 0),se([l()],le.prototype,"monthViewRenderer",void 0),se([l()],le.prototype,"viewWithTimeRenderer",void 0);var de=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class ce extends d{render(){return e("div",{class:"calendar-view-month-container"},e("div",{class:"calendar-view-row calendar-view-title border-divider-bottom"},this.calendarView.weekdays.map((t=>e("div",{key:t},this.translationSlimmer.t(t))))),this.renderMonthViewContent())}renderMonthViewContent(){const t=this.currentPeriod.current;return this.calendarView.dateItems.map(((n,i)=>{const r=this.monthEventRenderer.getCurrentRowEvents(n),a=this.monthEventRenderer.filterRowDisplayEvents(r);return e("div",{key:i,class:"calendar-view-row border-divider-bottom"},n.map(((n,i)=>e("div",{class:{"row-cell border-divider-right":!0,"current-month-day":n.compare(t).inMonth,active:n.isToday(),disabled:!1},key:`${n.month}-${n.date}`,onDblClick:e=>this.handleDateBlockClick(e,n)},this.renderDateBlock(n),this.monthEventRenderer.render(n,r[i],a[i],i)))))}))}renderDateBlock(t){return e("div",{class:"date"},1===t.date&&e("div",{class:"month-block"},te(t.toDate(),!0)),e("div",{role:"button",tabIndex:0,class:"grid-col",onDblClick:e=>this.goToCurrentDayView(e,t)},t.date))}goToCurrentDayView(e,t){e.stopPropagation(),this.currentPeriodController.updateCalendarPeriod("day",t)}handleDateBlockClick(e,t){const{target:n,clientX:i,clientY:r}=e;if(this.isMonthBlockBlankArea(n)){const{year:e,month:n,date:a}=t;this.dateDblClickEmitter.emit({year:e,month:n,date:a,hour:0,mouseEventInfo:{clientX:i,clientY:r}})}}isMonthBlockBlankArea(e){return!e.classList.contains("more-button")&&"VEGA-CALENDAR-EVENT"!==e.tagName}}de([l()],ce.prototype,"viewMode",void 0),de([l()],ce.prototype,"calendarView",void 0),de([l()],ce.prototype,"currentPeriod",void 0),de([l()],ce.prototype,"currentPeriodController",void 0),de([l()],ce.prototype,"monthEventRenderer",void 0),de([l()],ce.prototype,"dateDblClickEmitter",void 0),de([l()],ce.prototype,"translationSlimmer",void 0);var he=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class ve extends d{render(){return e("div",{class:"calendar-view-container"},this.renderViewTitle(),this.renderViewContent())}renderViewTitle(){const t=this.calendarView.dateItems[0],n=this.calendarView.weekdays;return e("div",{class:"calendar-view-title-container"},e("div",{class:"calendar-view-row"},e("div",{class:"time-line-empty"}),e("div",{class:"calendar-view-title"},t.map(((t,i)=>e("div",{key:t.date,class:{active:t.isToday()}},e("div",null,this.translationSlimmer.t(n[i])),e("div",{class:"week-day"},t.date)))))),e("div",{class:"calendar-view-row calendar-view-event-all-container border-divider-bottom"},e("div",{class:"time-line-all"},this.translationSlimmer.t("All Day")),this.dayViewFullDayEventRenderer.render()))}renderViewContent(){const t=this.calendarView.dateItems[0];return e("div",{class:"calendar-view-row calendar-view-day-container"},this.timeLineRenderer.render(),e("div",{class:"calendar-view-content-container"},e("div",{class:"calendar-view-content"},t.map((t=>e("div",{class:"grid-col border-divider-left",key:t.date},e("div",{class:"hour-empty border-divider-top"}),this.renderHourBlock(t))))),this.dayViewTimedEventRenderer.render(),this.timeMarkerRenderer.render(t)))}renderHourBlock(t){return Array(24).fill("").map(((n,i)=>e("div",{class:"grid-cell border-divider-top",onDblClick:e=>{this.handleDateBlockClick(t,i,e)}})))}handleDateBlockClick(e,t,n){const{year:i,month:r,date:a}=e,{clientX:o,clientY:s}=n;this.dateDblClickEmitter.emit({year:i,month:r,date:a,hour:t,mouseEventInfo:{clientX:o,clientY:s}})}}he([l()],ve.prototype,"viewMode",void 0),he([l()],ve.prototype,"timeLineRenderer",void 0),he([l()],ve.prototype,"timeMarkerRenderer",void 0),he([l()],ve.prototype,"dayViewTimedEventRenderer",void 0),he([l()],ve.prototype,"dayViewFullDayEventRenderer",void 0),he([l()],ve.prototype,"calendarView",void 0),he([l()],ve.prototype,"dateDblClickEmitter",void 0),he([l()],ve.prototype,"translationSlimmer",void 0);class pe extends d{render(){const t=this.getTimeLineTitles();return e("div",{class:"time-line"},e("div",{class:"hour-empty"}),t.map(((t,n)=>e("div",{key:t},e("div",{class:"time-text","data-time":0===n?24:n},t)))))}getTimeLineTitles(){const e=[];if("12-hour"===this.timeFormat){e.push("12 AM");for(let t=1;t<12;t++)e.push(`${t} AM`);e.push("12 PM");for(let t=1;t<12;t++)e.push(`${t} PM`)}else for(let t=0;t<24;t++)e.push(`${R(t)}`);return e}}!function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);a>3&&o&&Object.defineProperty(t,n,o)}([l()],pe.prototype,"timeFormat",void 0);var fe=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class me extends d{constructor(){super(...arguments),this.monthViewGenerator=new X,this.weekViewGenerator=new K,this.dayViewGenerator=new _}initialCalendarView(){this.setCalendarView(this.getCalendarViewByPeriod(this.currentPeriod))}generateCalendarView(e){this.setCalendarView(this.getCalendarViewByPeriod(e))}getCalendarViewByPeriod(e){switch(e.type){case"week":return this.weekViewGenerator.generate(e);case"day":return this.dayViewGenerator.generate(e);default:return this.monthViewGenerator.generate(e)}}setCalendarView(e){this.calendarView=e}}fe([l({writable:!0})],me.prototype,"calendarView",void 0),fe([l()],me.prototype,"currentPeriod",void 0),fe([l()],me.prototype,"showWeekends",void 0),fe([l()],me.prototype,"currentPeriodController",void 0),fe([c("componentWillLoad")],me.prototype,"initialCalendarView",null),fe([c("watchCurrentPeriodChange")],me.prototype,"generateCalendarView",null);var we=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class ue extends d{setCurrentPeriod(e){this.currentPeriod=e}updateCalendarPeriod(e,t){switch(e){case"month":this.setCurrentPeriod(new Z(t,this.showWeekends));break;case"week":this.setCurrentPeriod(new Q(t,this.showWeekends));break;case"day":t=!1===this.showWeekends?re(t):t,this.setCurrentPeriod(new J(t,this.showWeekends))}}initialCurrentPeriod(){this.updateCalendarPeriod(this.viewMode,q.from(new Date))}emitChangeEvent(e,t){e&&t&&e.startDate.equal(t.startDate)&&e.endDate.equal(t.endDate)||(e&&e.type!==this.viewMode&&(this.viewMode=e.type),this.changeEventEmitter.emit({viewMode:e.type,currentPeriod:this.getCurrentPeriodSummary()}))}updateCurrentPeriodByViewMode(e){this.currentPeriod&&e!==this.currentPeriod.type&&this.updateCalendarPeriod(e,this.currentPeriod.current)}updateCurrentPeriodAfterHideWeekEndsChange(){this.updateCalendarPeriod(this.viewMode,this.currentPeriod.current)}getCurrentPeriodSummary(){const{current:e,startDate:t,endDate:n}=this.currentPeriod;return{year:e.year,month:e.month,startDate:{date:t.date,month:t.month,year:t.year},endDate:{date:n.date,month:n.month,year:n.year}}}}we([l({writable:!0})],ue.prototype,"currentPeriod",void 0),we([l()],ue.prototype,"changeEventEmitter",void 0),we([l({writable:!0})],ue.prototype,"viewMode",void 0),we([l()],ue.prototype,"showWeekends",void 0),we([c("componentWillLoad")],ue.prototype,"initialCurrentPeriod",null),we([c("watchCurrentPeriodChange")],ue.prototype,"emitChangeEvent",null),we([c("watchViewModeChange")],ue.prototype,"updateCurrentPeriodByViewMode",null),we([c("watchShowWeekendsChange")],ue.prototype,"updateCurrentPeriodAfterHideWeekEndsChange",null);var ge=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class xe extends d{constructor(){super(...arguments),this.maxMonthDisplayEventsCount=2}getCurrentRowEvents(e){const t=[];return e.forEach((e=>{const n=this.calendarEventController.getCurrentDateEvents(e);t.push(n)})),this.fullDayEventLayoutRenderer.sortLongEvents(t)}filterRowDisplayEvents(e){const t=[];return e.forEach((e=>{const n=e.length>this.maxMonthDisplayEventsCount?e.slice(0,this.maxMonthDisplayEventsCount-1):e;t.push(n)})),this.hideTheCutOffEvents(e,t)}getMonthEventContainerRef(){return this.eventContainerRef}render(t,n,i,r){const a=n.slice(i.length).filter((e=>e)).length;return e("div",{class:"events-container",ref:e=>this.eventContainerRef=e},e("div",{class:"event-list"},this.fullDayEventLayoutRenderer.render(i,r)),this.renderMoreButton(n,a,`${t.date} ${te(t.toDate())} ${t.year}`))}addMaxDisplayCountChange(){m.addUniqueObserverToNode(this.host,E,(e=>{this.maxMonthDisplayEventsCount=e.detail,"month"===this.viewMode&&n(this.host)}))}renderMoreButton(t,n,i){if(n){const r=t.filter((e=>e&&(e.isAllDayEvent||e.isGroupEvent()))),a=t.filter((e=>e&&!e.isAllDayEvent&&!e.isGroupEvent()));return e("div",{class:"month-event-more"},e("vega-popover",{trigger:"click",placement:"right"},e("div",{tabIndex:0,slot:"popover-content",role:"button",class:"more-button",onKeyDown:z()},`${n} More`),e("vega-flex",{slot:"popover",direction:"col",gap:"0"},e("vega-font",{textAlign:"center",variant:"font-field-label",color:"text-primary",style:{padding:"4px 0",marginBottom:"8px"}},i),e("vega-flex",{direction:"col",gap:"size-4",style:{paddingBottom:a.length?"4px":"0px"}},r.map((e=>this.eventItemRenderer.render(e,{"month-event":!0,"calendar-event-large-size":!0,"calendar-event-in-popover":!0})))),a.map((e=>this.eventItemRenderer.render(e,{"month-event":!0,"calendar-event-large-size":!0,"calendar-event-in-popover":!0}))))))}}hideTheCutOffEvents(e,t){const n=[],i=[],r=t.map((e=>e[e.length-1])).filter((e=>e&&e.isGroupEvent()));return r.length&&r.forEach((n=>{e.filter((e=>e.includes(n))).length>t.filter((e=>e.includes(n))).length&&i.push(n)})),i.length?(t.forEach((e=>{e.length&&e[e.length-1]&&i.includes(e[e.length-1])?n.push(e.slice(0,e.length-1)):n.push(e)})),n):t}}ge([l()],xe.prototype,"viewMode",void 0),ge([l()],xe.prototype,"host",void 0),ge([l()],xe.prototype,"calendarEventController",void 0),ge([l()],xe.prototype,"eventItemRenderer",void 0),ge([l()],xe.prototype,"fullDayEventLayoutRenderer",void 0),ge([c("componentWillLoad")],xe.prototype,"addMaxDisplayCountChange",null);class be{constructor(e,t,n,i){this.repeatStartDate=e,this.interval=t,this.count=n,this.until=i}getRepeatSeries(e,t=1){return this.generateRepeatDateCacheUntilEndDate(e.endDate),this.cache.filter((n=>this.isSeriesInPeriod(n,t,e)))}isSeriesInPeriod(e,t,n){const i=e.toDate(),r=new Date(e.year,e.month-1,e.date+t-1),{startDate:a,endDate:o}=n,s=a.toDate(),l=o.toDate();return i>=s&&i<=l||r>=s&&r<=l||i<=s&&r>=l}}be.daySeconds=864e5;class ye extends be{constructor(e,t,n,i){super(e,t,n,i),this.initCache()}generateRepeatDateCacheUntilEndDate(e){const t=this.cache[this.cache.length-1];if(t.toDate()<e.toDate()&&(!this.count||"number"==typeof this.count&&this.cache.length<this.count)){let n=this.getNextRepeatStartDate(t);for(;n&&n.toDate()<e.toDate();){const e=this.getNextRepeatStartDate(n);if(e&&e.toDate()<=n.toDate()){this.cache.pop();break}if(n=e,"number"==typeof this.count&&this.cache.length>=this.count)break}}}initCache(){this.cache=[this.repeatStartDate]}getNextRepeatStartDate(e){const t=new Date(e.year,e.month-1,e.date+this.interval),n=q.from(t);return this.until&&t>this.until.toDate()||"number"==typeof this.count&&this.cache.length>=this.count?null:(this.cache.push(n),n)}}class ke extends be{constructor(e,t,n,i){super(e,t,n,i),this.byMonthDay=this.repeatStartDate.date,this.initCache()}generateRepeatDateCacheUntilEndDate(e){const t=this.cache[this.cache.length-1];if(t.toDate()<e.toDate()&&(!this.count||"number"==typeof this.count&&this.cache.length<this.count)){let n=this.getNextRepeatStartDate(t);for(;n&&n.toDate()<e.toDate();){const e=this.getNextRepeatStartDate(n);if(e&&e.toDate()<=n.toDate()){this.cache.pop();break}if(n=e,"number"==typeof this.count&&this.cache.length>=this.count)break}}}initCache(){this.cache=[this.repeatStartDate]}getNextRepeatStartDate(e){const t=this.getNextStartDate(e.year,e.month-1+this.interval),n=q.from(t);return this.until&&t>this.until.toDate()||"number"==typeof this.count&&this.cache.length>=this.count?null:(this.cache.push(n),n)}getNextStartDate(e,t){const n=new Date(e,t,this.byMonthDay);return n.getDate()===this.byMonthDay?n:this.getNextStartDate(e,t+1)}}class Ce extends be{constructor(e,t,n,i,r){super(e,t,n,i),this.byWeekDay=this.sortWeekDay(r),this.initCache()}getRepeatSeries(e,t=1){return this.generateRepeatDateCacheUntilEndDate(e.endDate),this.getValidCache().filter((n=>this.isSeriesInPeriod(n,t,e)))}generateRepeatDateCacheUntilEndDate(e){const t=this.cache[this.cache.length-1];if(t[0].toDate()<e.toDate()&&(!this.count||"number"==typeof this.count&&this.cache.length<this.count)){let n=this.getNextRepeatStartDate(t);for(;n&&n[0].toDate()<e.toDate();){const e=this.getNextRepeatStartDate(n);if(e&&e[0]&&e[0].toDate()<=n[0].toDate()){this.cache.pop();break}if(n=e,"number"==typeof this.count&&this.getValidCache().length>=this.count)break}}}getNextRepeatStartDate(e){const t=this.getNextStartDates(e);if(0===t.length||"number"==typeof this.count&&this.getValidCache().length>=this.count)return null;{const e=t.map((e=>q.from(e)));return this.cache.push(e),e}}getNextStartDates(e){return e.map((e=>new Date(e.year,e.month-1,e.date+7*this.interval))).filter((e=>!this.until||e<=this.until.toDate()))}initCache(){const e=[],t=this.getCurrentDayIndex(this.repeatStartDate);this.byWeekDay.forEach((n=>{const i=Ce.weekDay.indexOf(n)-t,{year:r,month:a,date:o}=this.repeatStartDate,s=q.from(new Date(r,a-1,o+i));e.push(s)})),this.cache=[e]}sortWeekDay(e){return e&&e.length?e.map((e=>e.toLocaleLowerCase())).sort(((e,t)=>Ce.weekDay.indexOf(e)-Ce.weekDay.indexOf(t))):[Ce.weekDay[this.getCurrentDayIndex(this.repeatStartDate)]]}getCurrentDayIndex(e){return e.toDate().getDay()}getValidCache(){const e=I(this.cache.slice(1));return this.cache[0].filter((e=>e.toDate()>=this.repeatStartDate.toDate())).concat(e).slice(0,"number"==typeof this.count?this.count:void 0)}}Ce.weekDay=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map((e=>e.toLowerCase()));class Re extends be{constructor(e,t,n,i){super(e,t,n,i),this.matchDay=this.repeatStartDate.date,this.matchMonth=this.repeatStartDate.month,this.initCache()}generateRepeatDateCacheUntilEndDate(e){const t=this.cache[this.cache.length-1];if(t.toDate()<e.toDate()&&(!this.count||"number"==typeof this.count&&this.cache.length<this.count)){let n=this.getNextRepeatStartDate(t);for(;n&&n.toDate()<e.toDate();){const e=this.getNextRepeatStartDate(n);if(e&&e.toDate()<=n.toDate()){this.cache.pop();break}if(n=e,"number"==typeof this.count&&this.cache.length>=this.count)break}}}getNextRepeatStartDate(e){const t=this.getNextStartDate(e.year+this.interval),n=q.from(t);return this.until&&t>this.until.toDate()||"number"==typeof this.count&&this.cache.length>=this.count?null:(this.cache.push(n),n)}getNextStartDate(e){const t=new Date(e,this.matchMonth-1,this.matchDay);return t.getDate()===this.matchDay&&t.getMonth()+1===this.matchMonth?t:this.getNextStartDate(e+1)}initCache(){this.cache=[this.repeatStartDate]}}const je=new class{getPattern(e,t){const n=q.from(e),{frequency:i,interval:r=1,byWeekDay:a,until:o,count:s}=t,l=this.initDate(o);return this.initRepeatPattern(i,n,r<1?1:r,s,l,a)}initDate(e){if(e&&"object"==typeof e)return q.from(e);if(e&&"string"==typeof e){const[t,n,i]=e.split("/");return new q(Number(i),Number(t),Number(n))}}initRepeatPattern(e,t,n,i,r,a){switch(e){case"daily":return new ye(t,n,i,r);case"weekly":return new Ce(t,n,i,r,a);case"monthly":return new ke(t,n,i,r);default:return new Re(t,n,i,r)}}},De=/^\d{1,2}\/\d{1,2}\/\d{4}/,Ee=/^\d{1,2}:\d{1,2}/;class ze{constructor(e,t){this._eventSpansDays=1,this.repeatPattern=null,this._event=e,this._eventKey=t||M(),this.checkEventRequireField(e),this.initDate(e),this.initEventSpansDays(),this.initRepeatPattern()}get event(){return this._event}get eventKey(){return this._eventKey}get title(){return this._event.title}get disabled(){return!!this._event.disabled}get variant(){return this._event.variant}get color(){return this._event.color}get isAllDayEvent(){return!!this._event.isAllDay}get isRepeatEvent(){return null!==this.repeatPattern}get startDate(){return this._startDate}get endDate(){return this._endDate}get startTime(){return this._startTime}get endTime(){return this._endTime}get eventSpansDays(){return this._eventSpansDays}copyTo(e,t){const n=this._eventSpansDays>1?new Date(t.year,t.month-1,t.date+(this._eventSpansDays-1)):t.toDate();return new ze(Object.assign(Object.assign({},this._event),{startDate:t.toDate(),endDate:n,startTime:this.startTime,endTime:this.endTime}),e)}isGroupEvent(){return this._eventSpansDays>1}isCurrentDayEvent(e){const{startDate:t,endDate:n}=this,i=q.from(t),r=q.from(new Date(n.getFullYear(),n.getMonth(),n.getDate()+1)),a=e.toDate();return i.toDate()<=a&&r.toDate()>a}getEventDuration(){const[e,t]=this.startTime.split(":"),[n,i]=this.endTime.split(":"),r=q.from(new Date),a=new Date(r.year,r.month,r.date,Number(e),Number(t));return(new Date(r.year,r.month,r.date,0===Number(n)&&0!==Number(e)?24:Number(n),Number(i)).valueOf()-a.valueOf())/6e4}getRepeatSeries(e){return this.repeatPattern?this.repeatPattern.getRepeatSeries(e,this._eventSpansDays):[]}convertTimeTo24Hour(e){if((e=e.toLocaleLowerCase()).indexOf("am")>0||e.indexOf("pm")>0){if(e.indexOf("am")>0){e=e.replace("am","").trim();const[t,n]=e.split(":");return`${"12"===t?"00":t}:${n}`}{e=e.replace("pm","").trim();const[t,n]=e.split(":");return`${"12"===t?"12":Number(t)+12}:${n}`}}return e}checkEventRequireField(e){const{title:t,startDate:n,endDate:i,startTime:r,endTime:a}=e;if(n&&"string"==typeof n&&!De.test(n)||i&&"string"==typeof i&&!De.test(i))throw new Error("Invalid calendar event item, the date format should be MM/DD/YYYY!");if(r&&"string"==typeof r&&!Ee.test(r)||a&&"string"==typeof a&&!Ee.test(a))throw new Error("Invalid calendar event item, the time format should be HH:mm!");if(!t||!n||!i&&!a)throw new Error("Invalid calendar event item, the required field should not empty!")}initDate(e){const{startDate:t,startTime:n,endDate:i,endTime:r}=e;if(t&&"object"==typeof t)this._startDate=t;else if(t&&"string"==typeof t){const[e,n,i]=t.split("/");this._startDate=new Date(Number(i),Number(e)-1,Number(n))}if(this._startTime=n?this.convertTimeTo24Hour(n):`${this._startDate.getHours()}:${this._startDate.getMinutes()}`,i&&"object"==typeof i)this._endDate=i;else if(i&&"string"==typeof i){const[e,t,n]=i.split("/");this._endDate=new Date(Number(n),Number(e)-1,Number(t),23,59,59)}else this._endDate=new Date(this._startDate.getFullYear(),this._startDate.getMonth(),this._startDate.getDate(),23,59,59);this._endTime=r?this.convertTimeTo24Hour(r):`${this._endDate.getHours()}:${this._endDate.getMinutes()}`}initRepeatPattern(){this._event.repeatOptions&&this._event.repeatOptions.frequency&&(this.repeatPattern=je.getPattern(this._startDate,this._event.repeatOptions))}initEventSpansDays(){const e=q.from(this.startDate),t=q.from(this.endDate);this._eventSpansDays=(t.toDate().valueOf()-e.toDate().valueOf())/864e5+1}}var Ie=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class Me extends d{constructor(){super(...arguments),this.repeatEventMap=new Map}getCurrentDateEvents(e){return this.createRepeatEvents().filter((t=>t.isCurrentDayEvent(e)))}updateAfterEventChange(e){this.initCalendarEvents(e),this.repeatEventMap.clear()}updateWhenComponentWillLoad(){this.initCalendarEvents(this.events)}initCalendarEvents(e){const t=[];e&&e.forEach((e=>{try{const n=new ze(e);t.push(n)}catch(t){h.warn("Invalid calendar event item:",e)}})),this.calendarEvents=t}createRepeatEvents(){const e=[],t=[];return this.calendarEvents.forEach((n=>{n.isRepeatEvent?n.getRepeatSeries(this.currentPeriod).forEach((e=>{t.push(this.generateCalendarEventByRepeatSeries(n,e))})):e.push(n)})),t.concat(e)}generateCalendarEventByRepeatSeries(e,t){const n=`${e.eventKey}-${t.year}${t.month}${t.date}`;if(this.repeatEventMap.has(n))return this.repeatEventMap.get(n);{const i=e.copyTo(n,t);return this.repeatEventMap.set(n,i),i}}}Ie([l({writable:!0})],Me.prototype,"calendarEvents",void 0),Ie([l()],Me.prototype,"currentPeriod",void 0),Ie([l()],Me.prototype,"events",void 0),Ie([c("watchEventsChange")],Me.prototype,"updateAfterEventChange",null),Ie([c("componentWillLoad")],Me.prototype,"updateWhenComponentWillLoad",null);var Se=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class Te extends d{render(t,n){return e("vega-calendar-event",{"data-calendar-ref":this.host,key:t.eventKey,calendarEvent:t,class:n,onKeyDown:z(),onClick:()=>this.handleEventClick(t)},!t.isRepeatEvent&&e("slot",{name:ie(t.event.key)}))}handleEventClick(e){this.eventClickEmitter.emit({rawEvent:e.event})}}Te.backgroundColorModeEventHeight=18,Se([l()],Te.prototype,"host",void 0),Se([l()],Te.prototype,"calendarView",void 0),Se([l()],Te.prototype,"eventClickEmitter",void 0);var Oe=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class Ve extends S{constructor(){super({target:()=>this.host,callback:()=>this.updateMaxDisplayCountWithDebounce()}),this.updateMaxDisplayCountWithDebounce=T(this.updateMaxDisplayCount,500,this)}updateMaxDisplayCount(){try{const e=this.monthEventRenderer.getMonthEventContainerRef();if("month"===this.viewMode&&e&&e.parentElement){const t=e.parentElement.getBoundingClientRect().height,n=Math.floor((t-Ve.monthDateTitleHeight)/Te.backgroundColorModeEventHeight);O.notify(x.getSubject(this.host,E),{host:this.host,detail:n})}}catch(e){}}updateMaxDisplayCountAfterSwitchToMonthView(e){"month"===e&&this.updateMaxDisplayCountWithDebounce()}}Ve.monthDateTitleHeight=26,Oe([l()],Ve.prototype,"host",void 0),Oe([l()],Ve.prototype,"monthEventRenderer",void 0),Oe([l()],Ve.prototype,"viewMode",void 0),Oe([c("componentDidLoad")],Ve.prototype,"updateMaxDisplayCount",null),Oe([c("watchViewModeChange")],Ve.prototype,"updateMaxDisplayCountAfterSwitchToMonthView",null);var $e=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class Pe extends d{render(){const t=this.calendarView.dateItems[0],n=t.map((e=>this.calendarEventController.getCurrentDateEvents(e).filter((e=>e.isAllDayEvent||e.isGroupEvent())))),i=this.fullDayEventLayoutRenderer.sortLongEvents(n),r=this.filterDisplayEvents(i);return e("div",{class:"calendar-view-event-all"},t.map(((t,n)=>e("div",{class:"event-all-col border-divider-left",key:t.date},this.renderCurrentFullDayEvents(r[n],n,i[n])))))}renderCurrentFullDayEvents(n,i,r){const a=n.length*Te.backgroundColorModeEventHeight-2,o=r.slice(n.length).filter(Boolean).length;return e(t,null,e("div",{class:"placeholder-block",style:{height:a+"px"}},e("span",null,n.length," events")),this.fullDayEventLayoutRenderer.render(n,i),o>0&&this.dayViewFullDayEventMoreButtonRenderer.render(o))}filterDisplayEvents(e){if(this.showAllEventsInDayOrWeekView)return e;{const t=[],n=Pe.maxDisplayEventLength;return e.forEach((e=>{const i=e.length>n?e.slice(0,n):e;t.push(i)})),t}}}Pe.maxDisplayEventLength=2,$e([l()],Pe.prototype,"calendarView",void 0),$e([l()],Pe.prototype,"calendarEventController",void 0),$e([l()],Pe.prototype,"eventItemRenderer",void 0),$e([l()],Pe.prototype,"fullDayEventLayoutRenderer",void 0),$e([l()],Pe.prototype,"showAllEventsInDayOrWeekView",void 0),$e([l()],Pe.prototype,"dayViewFullDayEventMoreButtonRenderer",void 0);class Be extends d{render(t){const n=[];return t.eventLayoutCells.forEach(((i,r)=>{let a=i.getEventBySlotIndex(0),o=0;for(let s=0;s<Be.totalNumberOfCells;s++){const l=i.getEventBySlotIndex(s);l!==a&&(a&&n.push(e("div",{key:r,class:"time-event-block",style:this.getTimeEventStyle(o,s,r,t.getEventColumnsSpannedCount(a))},this.eventItemRenderer.render(a,{"day-event":!0,"bg-shadow":r>0}))),a=l,o=s)}})),n}getTimeEventStyle(e,t,n,i){const r=n*(1/i);return{position:"absolute",left:100*r+"%",top:100/Be.totalNumberOfCells*e+"%",width:`calc(100% - ${100*r}%)`,height:100/Be.totalNumberOfCells*(t-e)+"%",zIndex:n>0?`${n}`:void 0}}}Be.totalNumberOfCells=96,function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);a>3&&o&&Object.defineProperty(t,n,o)}([l()],Be.prototype,"eventItemRenderer",void 0);class Ne{addCurrentEventToLayout(e,t){let n=e.find((e=>!e.hasOverlapEvent(t)));n?n.updateSlots(t):(n=this.createNewLayoutCell(),n.updateSlots(t),e.push(n))}}class Le{get eventLayoutCells(){return this.cells}}class Ae extends Le{constructor(e){super(),this.cells=e}getEventColumnsSpannedCount(e){const t=this.cells.findIndex((t=>t.getEventStartIndex(e)>=0));let n=t+1;return t<this.cells.length-1&&this.cells.slice(t+1).forEach((t=>{t.hasOverlapEvent(e)&&n++})),n}}class Fe{getEventBySlotIndex(e){return this.slots[e]}getEventStartIndex(e){return this.slots.findIndex((t=>t===e))}getEventEndIndex(e){const t=this.getEventStartIndex(e);let n=t;if(t>=0)for(let i=t+1;i<this.slots.length;i++){if(this.slots[i]!==e){n=i-1;break}i===this.slots.length-1&&(n=i)}return n}}class We extends Fe{constructor(){super(...arguments),this.slots=We.defaultSlots}hasOverlapEvent(e){const[t,n]=this.getIndexRangeFromEvent(e);let i=!1;for(let e=t;e<n;e++)if(this.slots[e]){i=!0;break}return i}updateSlots(e){const[t,n]=this.getIndexRangeFromEvent(e);n>t&&(this.slots=this.slots.slice(0,t).concat(Array(n-t).fill(e),this.slots.slice(n)))}getIndexRangeFromEvent(e){const{startTime:t,endTime:n}=e;return[ne(t),ne(n)]}}We.defaultSlots=Array(96).fill(null);class He extends Ne{generate(e){const t=[new We];return e.forEach((e=>{this.addCurrentEventToLayout(t,e)})),new Ae(t)}createNewLayoutCell(){return new We}}class Ue{sort(e,t,n){const i=[],r=[],a=[];for(let t=0;t<e.length;t++){const n=e[t];n&&(n.isGroupEvent()?r.push(n):n.isAllDayEvent?i.push(n):a.push(n))}let o=i.concat(this.sortCalendarEventByTime(a)),s=n.getEventsByIndex(t);const l=s.filter((e=>e));if(o=r.filter((e=>l.findIndex((t=>t===e))<0)).concat(o),s.length>l.length){const e=o.slice(0,s.length-l.length);o=o.slice(s.length-l.length),s=this.insertEventsToEmptyPosition(s,e)}return o=s.concat(o),o}sortCalendarEventByTime(e){return e.sort(((e,t)=>{const n=ne(e.startTime),i=ne(t.startTime);return n===i?ne(t.endTime)-ne(e.endTime):n-i}))}insertEventsToEmptyPosition(e,t){return e.map((e=>{if(t.length&&!e){const e=t[0];return t=t.slice(1),e}return e}))}}var Ye=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class _e extends d{constructor(){super(...arguments),this.calendarEventSorter=new Ue,this.dayViewTimedEventLayoutGenerator=new He}render(){return e("div",{class:"day-event-container"},this.calendarView.dateItems[0].map((t=>e("div",{key:`${t.month}-${t.date}`,class:"day-event-col"},this.renderTimedEvents(t)))))}renderTimedEvents(e){const t=this.calendarEventController.getCurrentDateEvents(e).filter((e=>!e.isAllDayEvent&&!e.isGroupEvent())),n=this.calendarEventSorter.sortCalendarEventByTime(t),i=this.dayViewTimedEventLayoutGenerator.generate(n);return this.dayViewEventLayoutRenderer.render(i)}}Ye([l()],_e.prototype,"calendarView",void 0),Ye([l()],_e.prototype,"calendarEventController",void 0),Ye([l()],_e.prototype,"dayViewEventLayoutRenderer",void 0);class qe extends Le{constructor(e){super(),this.cells=e}getEventRowsIndex(e){return this.cells.findIndex((t=>t.getEventStartIndex(e)>=0))}getEventsByIndex(e){const t=[];let n=0;return this.cells.forEach(((i,r)=>{const a=i.getEventBySlotIndex(e);t.push(a),a&&(n=r)})),t.slice(0,n+1)}}class Ke extends Fe{constructor(){super(...arguments),this.slots=Ke.defaultSlots}updateSlots(e){const{start:t,end:n}=e;this.slots=this.slots.slice(0,t).concat(Array(n-t+1).fill(e.event),this.slots.slice(n+1))}hasOverlapEvent(e){const{start:t,end:n}=e;let i=!1;for(let e=t;e<n+1;e++)if(this.slots[e]){i=!0;break}return i}}Ke.defaultSlots=Array(7).fill(null);class Xe extends Ne{generate(e){const t=this.collectAllShouldOrderLongEvents(e),n=[this.createNewLayoutCell()];return t.forEach((e=>{this.addCurrentEventToLayout(n,e)})),new qe(n)}createNewLayoutCell(){return new Ke}collectAllShouldOrderLongEvents(e){const t={};e.forEach(((e,n)=>{e.filter((e=>e&&e.isGroupEvent())).forEach((e=>{t[e.eventKey]=t[e.eventKey]?Object.assign(Object.assign({},t[e.eventKey]),{end:n,start:n-t[e.eventKey].end!=1?n:t[e.eventKey].start}):{start:n,end:n,event:e}}))}));const n=Object.values(t);return this.sortLongEventViews(n)}sortLongEventViews(e){return e.sort(((e,t)=>{const{startDate:n,endDate:i}=e.event,{startDate:r,endDate:a}=t.event;n.setHours(0,0,0),r.setHours(0,0,0),i.setHours(23,59,59),a.setHours(23,59,59);const o=a.valueOf()-r.valueOf()-(i.valueOf()-n.valueOf());return n.valueOf()!==r.valueOf()?n.valueOf()-r.valueOf():o}))}}var Ge=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class Je extends d{constructor(){super(...arguments),this.longEventLayoutGenerator=new Xe,this.calendarEventSorter=new Ue}sortLongEvents(e){return this.fullDayEventLayout=this.longEventLayoutGenerator.generate(e),e.map(((e,t)=>this.calendarEventSorter.sort(e,t,this.fullDayEventLayout)))}render(t,n){return t.map(((t,i)=>{if(t)return e("div",{key:t.eventKey,class:"month"===this.viewMode?"month-event-block":"day-event-block",style:this.getEventStyle(t,n,i,"month"===this.viewMode?Je.monthViewEventOffsetTop:0)},this.eventItemRenderer.render(t,{"month-event":"month"===this.viewMode,"day-event":"month"!==this.viewMode}))}))}getEventStyle(e,t,n,i){const r=this.calendarView.weekdays.length,a=t;let o=t+1;const s=n;let l=!0;const d=this.fullDayEventLayout.getEventRowsIndex(e);if(d>=0){const n=this.fullDayEventLayout.eventLayoutCells[d].getEventStartIndex(e),i=this.fullDayEventLayout.eventLayoutCells[d].getEventEndIndex(e);n===t?o=i+1:l=!1}return{position:"absolute",left:100/r*a+"%",top:`${s*Te.backgroundColorModeEventHeight+i}px`,width:100/r*(o-a)+"%",opacity:l?"1":"0"}}}Je.monthViewEventOffsetTop=26,Ge([l()],Je.prototype,"eventItemRenderer",void 0),Ge([l()],Je.prototype,"viewMode",void 0),Ge([l()],Je.prototype,"calendarView",void 0);var Qe=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class Ze extends d{constructor(){super(...arguments),this.updateShowAllFlag=e=>{e.stopPropagation(),this.showAllEventsInDayOrWeekView=!0}}render(t){if(!this.showAllEventsInDayOrWeekView)return e("div",{tabIndex:0,role:"button",class:"more-button",onKeyDown:z(),onClick:this.updateShowAllFlag},`${t} More`)}resetShowAllFlag(){this.showAllEventsInDayOrWeekView=!1}}Qe([l({writable:!0})],Ze.prototype,"showAllEventsInDayOrWeekView",void 0),Qe([c("watchViewModeChange")],Ze.prototype,"resetShowAllFlag",null);var et=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class tt extends d{render(t){const n=t.findIndex((e=>e.isToday()))>=0;return e("div",{class:{"time-marker-container":!0,hidden:!n}},e("div",{class:"time-marker",style:{top:this.getTimeMarkerPosition()},ref:e=>this.timeMarkerRef=e},t.map((t=>e("div",{key:t.date,class:{active:t.isToday()}})))))}updateTimeLine(e){this.scrollToTargetTimeBlock(e),this.syncTimeMarkerPosition(e)}clearTimer(){clearInterval(this.timeMarkerPositionTimer)}updateTimeLineIfComponentAddBack(){this.syncTimeMarkerPosition(this.viewMode)}displayCurrentTimeBlockByDefault(){this.scrollToTargetTimeBlock(this.viewMode)}getTimeMarkerPosition(){const e=new Date;return(60*e.getHours()+e.getMinutes())/1440*100+"%"}syncTimeMarkerPosition(e){clearInterval(this.timeMarkerPositionTimer),"month"!==e&&(this.timeMarkerPositionTimer=setInterval((()=>{this.timeMarkerRef&&(this.timeMarkerRef.style.top=this.getTimeMarkerPosition())}),6e4))}scrollToTargetTimeBlock(e){"month"!==e&&setTimeout((()=>{const e=this.viewRenderer.getCalendarViewElementRef(),t=Math.max(0,this.getViewCenterPosition());e&&t&&e.scrollTo({top:t})}),16)}getViewCenterPosition(){const e=this.viewRenderer.getCalendarViewElementRef();if(e){const t=e.querySelector(".calendar-view-title-container").offsetHeight,n=Math.max(e.offsetHeight-t,0)/2,i=e.scrollHeight,r=16,a=Number(this.getTimeMarkerPosition().replace("%",""))/100*Math.max(i-r-t,0);if(!isNaN(n)&&a&&a>n)return a-n+r}return 0}}et([l()],tt.prototype,"viewMode",void 0),et([l()],tt.prototype,"viewRenderer",void 0),et([c("watchViewModeChange")],tt.prototype,"updateTimeLine",null),et([c("disconnectedCallback")],tt.prototype,"clearTimer",null),et([c("connectedCallback")],tt.prototype,"updateTimeLineIfComponentAddBack",null),et([c("componentDidLoad")],tt.prototype,"displayCurrentTimeBlockByDefault",null);var nt=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};const it=class{constructor(e){i(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.vegaEventClick=r(this,"vegaEventClick",7),this.eventClick=r(this,"eventClick",7),this.vegaDateDblClick=r(this,"vegaDateDblClick",7),this.dateDblClick=r(this,"dateDblClick",7),this.vegaMoreActionClick=r(this,"vegaMoreActionClick",7),this.moreActionClick=r(this,"moreActionClick",7),this.globalSlimmer={},this.translationSlimmer=new $,this.vegaComponentUsageRuntimeMetricsSlimmer=new p,this.renderer=new W,this.switchPanelRenderer=new oe,this.viewRenderer=new le,this.monthViewRenderer=new ce,this.viewWithTimeRenderer=new ve,this.timeLineRenderer=new pe,this.timeMarkerRenderer=new tt,this.monthEventRenderer=new xe,this.currentPeriodController=new ue,this.calendarViewController=new me,this.dayViewFullDayEventRenderer=new Pe,this.dayViewFullDayEventMoreButtonRenderer=new Ze,this.dayViewTimedEventRenderer=new _e,this.eventItemRenderer=new Te,this.dayViewEventLayoutRenderer=new Be,this.fullDayEventLayoutRenderer=new Je,this.calendarEventController=new Me,this.eventResponsiveController=new Ve,this.changeEventEmitter=j(it,u),this.eventClickEmitter=j(it,b),this.dateDblClickEmitter=j(it,y),this.moreActionClickEmitter=j(it,k),this.changeEventPrevent=new D([u],(()=>this.switchPanelRenderer.getSwitchPanelRef())),this.timeFormatNotifySlimmer=V(it,"timeFormat","watchTimeFormat"),this.showEventColorBarNotifySlimmer=V(it,"showEventColorBar","watchShowEventColorBar"),this.showAllEventsInDayOrWeekView=!1,this.calendarEvents=[],this.viewMode="month",this.timeFormat="24-hour",this.showEventColorBar=!0,this.showWeekends=!0}watchCurrentPeriodChange(e,t){}watchViewModeChange(e){}watchEventsChange(e){}watchTimeFormat(e){}watchShowEventColorBar(e){}watchShowWeekendsChange(){}render(){return s(e(a,null,this.renderer.render()),this.host)}get host(){return o(this)}static get watchers(){return{currentPeriod:["watchCurrentPeriodChange"],viewMode:["watchViewModeChange"],events:["watchEventsChange"],timeFormat:["watchTimeFormat"],showEventColorBar:["watchShowEventColorBar"],showWeekends:["watchShowWeekendsChange"]}}};nt([f()],it.prototype,"globalSlimmer",void 0),nt([v()],it.prototype,"translationSlimmer",void 0),nt([v()],it.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),nt([v()],it.prototype,"renderer",void 0),nt([v()],it.prototype,"switchPanelRenderer",void 0),nt([v()],it.prototype,"viewRenderer",void 0),nt([v()],it.prototype,"monthViewRenderer",void 0),nt([v()],it.prototype,"viewWithTimeRenderer",void 0),nt([v()],it.prototype,"timeLineRenderer",void 0),nt([v()],it.prototype,"timeMarkerRenderer",void 0),nt([v()],it.prototype,"monthEventRenderer",void 0),nt([v()],it.prototype,"currentPeriodController",void 0),nt([v()],it.prototype,"calendarViewController",void 0),nt([v()],it.prototype,"dayViewFullDayEventRenderer",void 0),nt([v()],it.prototype,"dayViewFullDayEventMoreButtonRenderer",void 0),nt([v()],it.prototype,"dayViewTimedEventRenderer",void 0),nt([v()],it.prototype,"eventItemRenderer",void 0),nt([v()],it.prototype,"dayViewEventLayoutRenderer",void 0),nt([v()],it.prototype,"fullDayEventLayoutRenderer",void 0),nt([v()],it.prototype,"calendarEventController",void 0),nt([v()],it.prototype,"eventResponsiveController",void 0),nt([v()],it.prototype,"changeEventEmitter",void 0),nt([v()],it.prototype,"eventClickEmitter",void 0),nt([v()],it.prototype,"dateDblClickEmitter",void 0),nt([v()],it.prototype,"moreActionClickEmitter",void 0),nt([v()],it.prototype,"changeEventPrevent",void 0),nt([v()],it.prototype,"timeFormatNotifySlimmer",void 0),nt([v()],it.prototype,"showEventColorBarNotifySlimmer",void 0),it.style='.border-divider-top{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-left-width:0px;border-right-width:0px;border-bottom-width:0px}.border-divider-left{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-right-width:0px;border-bottom-width:0px}.border-divider-right{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-bottom-width:0px}.border-divider-bottom{border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px}:host{display:flex;flex-direction:column;border-radius:12px;border:1px solid rgba(var(--v-border-divider, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));overflow:hidden;width:100%;height:100%;box-sizing:border-box;max-height:1966px}.calendar-switch-panel{padding:24px;border-bottom-width:1px;border-top-width:0px;border-left-width:0px;border-right-width:0px;border-style:solid;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1));flex-shrink:0;width:100%;box-sizing:border-box}.calendar-switch-panel .calendar-date-switch-container{display:flex;gap:8px;align-items:center;flex-direction:row}.calendar-switch-panel .calendar-view-switch-container{display:flex;gap:16px;align-items:center;flex-direction:row}.calendar-switch-panel .calendar-current-date{padding-left:8px}.calendar-view{width:100%;position:relative;flex-grow:1;overflow-y:auto;overflow-x:hidden;--calendar-weekday-columns:7}.calendar-view.calendar-hide-weekends{--calendar-weekday-columns:5}.calendar-view-month .calendar-view-month-container{width:100%;display:grid;min-height:100%;grid-template-rows:43px repeat(6, minmax(64px, 1fr))}.calendar-view-month .calendar-view-title{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));top:0;left:0;z-index:62}.calendar-view-month .calendar-view-title div{padding-top:12px;padding-bottom:12px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px;text-align:center}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-month .calendar-view-title div{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-month .calendar-view-title div{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-month .calendar-view-title div{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.calendar-view-month .calendar-view-row{position:relative;display:grid;grid-template-rows:1fr;grid-template-columns:repeat(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-month .calendar-view-row.calendar-view-title{position:sticky}.calendar-view-month .calendar-view-row:last-child{border-bottom-width:0px}.calendar-view-month .calendar-view-row .row-cell{overflow:hidden;display:flex;flex-direction:column;justify-content:space-between}.calendar-view-month .calendar-view-row .row-cell:last-child{border-right-width:0px}.calendar-view-month .calendar-view-row .row-cell .date{padding-top:4px;padding-bottom:4px;padding-right:12px;padding-left:8px}.calendar-view-month .calendar-view-row .row-cell .date>div{display:inline-block;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-month .calendar-view-row .row-cell .date>div{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-month .calendar-view-row .row-cell .date>div{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-month .calendar-view-row .row-cell .date>div{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.calendar-view-month .calendar-view-row .row-cell .date .month-block{margin-right:2px}.calendar-view-month .calendar-view-row .row-cell .date .grid-col{text-align:center;border-top-left-radius:9999px;border-bottom-left-radius:9999px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;cursor:pointer;width:18px;height:18px;line-height:18px}.calendar-view-month .calendar-view-row .row-cell .date .grid-col:hover{background-color:rgba(var(--v-bg-action-secondary-hover, 4, 112, 236, 0.1))}.calendar-view-month .calendar-view-row .row-cell .date .grid-col:active{background-color:rgba(var(--v-bg-action-secondary-active, 29, 65, 195, 0.1))}.calendar-view-month .calendar-view-row .row-cell .date .grid-col:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.calendar-view-month .calendar-view-row .row-cell.current-month-day .date>div{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}.calendar-view-month .calendar-view-row .row-cell.disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1))}.calendar-view-month .calendar-view-row .row-cell.disabled .date>div{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));border-top-left-radius:9999px;border-bottom-left-radius:9999px;color:rgba(var(--v-text-on-action, 252, 252, 252, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col:hover{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col:active{background-color:rgba(var(--v-bg-action-active, 29, 65, 195, 1))}.calendar-view-month .calendar-view-row .row-cell.active .date .grid-col:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.calendar-view-container{width:100%}.calendar-view-container .calendar-view-title-container{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));position:sticky;top:0;left:0;z-index:62}.calendar-view-container .calendar-view-row{box-sizing:border-box;width:100%;display:flex;flex-direction:row}.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{width:72px;text-align:right;padding-right:8px;box-sizing:border-box;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));flex-shrink:0}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-row .time-line,.calendar-view-container .calendar-view-row .time-line-empty,.calendar-view-container .calendar-view-row .time-line-all{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.calendar-view-container .calendar-view-title{width:100%}.calendar-view-container .calendar-view-title>div{padding:12px;padding-bottom:8px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px;text-align:center;display:flex;flex-direction:column;gap:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-title>div{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-title>div{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-title>div{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.calendar-view-container .calendar-view-title .week-day{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-title .week-day{font-family:"Inter", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-title .week-day{font-family:"Inter", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-title .week-day{font-family:"Inter", sans-serif;font-size:20px;font-weight:500;line-height:24px;letter-spacing:0px}}.calendar-view-container .calendar-view-title .active div{color:rgba(var(--v-text-link, 19, 98, 226, 1))}.calendar-view-container .calendar-view-event-all-container{align-items:center}.calendar-view-container .calendar-view-event-all{display:grid;grid-template-rows:1fr;flex-grow:1;min-height:18px}.calendar-view-container .calendar-view-day-container .time-line{display:grid;grid-template-rows:16px repeat(24, minmax(74px, 1fr))}.calendar-view-container .calendar-view-day-container .time-line .time-text{margin-top:-9px}.calendar-view-container .calendar-view-day-container .calendar-view-content{width:100%}.calendar-view-container .calendar-view-day-container .calendar-view-content .grid-col{display:grid;grid-template-rows:16px repeat(24, minmax(74px, 1fr));grid-template-columns:minmax(64px, 1fr)}.calendar-view-container .calendar-view-day-container .calendar-view-content .grid-col>.border-divider-top:first-child{border-top-width:0px}.calendar-view-container .calendar-view-content-container{width:100%;position:relative}.calendar-view-week .calendar-view-container{min-height:100%}.calendar-view-week .calendar-view-container .calendar-view-title{display:grid;grid-template-rows:1fr;grid-template-columns:repeat(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-week .calendar-view-container .calendar-view-event-all{grid-template-columns:repeat(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-week .calendar-view-container .calendar-view-day-container .calendar-view-content{display:grid;grid-template-columns:repeat(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-week .time-marker-container .time-marker{display:grid;grid-template-columns:repeat(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-week .day-event-container{display:grid;grid-template-columns:repeat(var(--calendar-weekday-columns), minmax(64px, 1fr))}.calendar-view-day .calendar-view-container{min-height:100%}.time-marker-container{position:absolute;min-width:100%;left:0;top:16px;height:calc(100% - 16px);pointer-events:none}.time-marker-container.hidden{display:none}.time-marker-container .time-marker{position:absolute;height:2px;display:grid;min-width:100%;left:0;top:0;z-index:61}.time-marker-container .time-marker div{width:100%;height:2px;background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1));opacity:0.3}.time-marker-container .time-marker div.active{opacity:1;position:relative}.time-marker-container .time-marker div.active::before{content:"";display:block;border-top-left-radius:9999px;border-bottom-left-radius:9999px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;position:absolute;width:8px;height:8px;background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1));top:-3px;left:-4px}.day-event-container{position:absolute;min-width:100%;left:0;top:16px;height:calc(100% - 16px);pointer-events:none}.day-event-container .day-event-col{height:100%;overflow:hidden}.day-event-container vega-calendar-event{pointer-events:auto;height:100%}.calendar-view-month .month-event-row{position:absolute;width:100%;overflow:hidden;height:calc(100% - 26px);left:0;bottom:0}.calendar-view-month .events-container{width:100%;box-sizing:border-box;overflow:hidden;padding:2px;display:flex;flex-direction:column;gap:2px;justify-content:space-between;flex-grow:1}.calendar-view-month .events-container .event-list{display:flex;flex-direction:column;gap:2px;flex-grow:1}.calendar-view-month .events-container .event-list .month-event-block{box-sizing:border-box;padding-left:2px;padding-right:3px}.calendar-view-month .events-container .month-event-more .more-button{display:inline-block;height:16px;font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;border-radius:2px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-month .events-container .month-event-more .more-button{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-month .events-container .month-event-more .more-button{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-month .events-container .month-event-more .more-button{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}.calendar-view-month .events-container .month-event-more .more-button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px}.calendar-view-container .calendar-view-event-all{position:relative}.calendar-view-container .calendar-view-event-all .placeholder-block{padding-top:2px;padding-bottom:2px;box-sizing:content-box}.calendar-view-container .calendar-view-event-all .placeholder-block span{display:none}.calendar-view-container .calendar-view-event-all .day-event-block{padding-top:2px;padding-right:2px;box-sizing:border-box;padding-left:3px}.calendar-view-container .calendar-view-event-all .more-button{display:inline-block;height:16px;font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;border-radius:2px;margin-left:2px;padding:2px}@media screen and (min-width: 768px) and (max-width: 1023px){.calendar-view-container .calendar-view-event-all .more-button{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.calendar-view-container .calendar-view-event-all .more-button{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.calendar-view-container .calendar-view-event-all .more-button{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}.calendar-view-container .calendar-view-event-all .more-button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px}.calendar-view-container .calendar-view-event-all .event-all-col{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start}.calendar-view-container .day-event-col{position:relative}.calendar-view-container .day-event-col .time-event-block{box-sizing:border-box;padding-right:8px;padding-bottom:2px;padding-top:3px}.calendar-view-container .day-event-col .time-event-block vega-calendar-event.bg-shadow::part(event-container):not(:focus){outline:2px solid rgba(var(--v-bg-primary, 252, 252, 252, 1))}.calendar-view-container .day-event-col .time-event-block:focus-within{z-index:60 !important}.calendar-event-slot-container{display:none}';var rt=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class at extends d{getEventTitleContainerRef(){return this.eventTitleContainerRef}getSlotContainerRef(){return this.slotContainerRef}render(){return e(t,null,this.injectBackgroundColorStyle(),this.calendarEventRender())}calendarEventRender(){return this.calendarEvent.isAllDayEvent||this.calendarEvent.isGroupEvent()?this.renderBackgroundModeEvent():this.renderNormalEvent()}renderBackgroundModeEvent(){const t=this.calendarEvent.disabled;return e("div",{role:"button",tabIndex:0,class:{"slot-container":this.slotMode,"background-color-mode":!0,"event-bg-color":!t,"bg-disabled":t},ref:e=>this.slotContainerRef=e},this.slotMode?this.getSlotElement():this.calendarEvent.title)}renderNormalEvent(){const{variant:t,disabled:n}=this.calendarEvent,i=t||"primary",r=!this.host.classList.contains("day-event"),a={"slot-container":this.slotMode,"event-container":!0,disabled:n,[i]:!0};if(r)return e("div",{role:"button",tabIndex:0,class:a,ref:e=>this.slotContainerRef=e},!this.slotMode&&this.renderEventStatus(),this.slotMode?this.getSlotElement():this.defaultNormalMonthEventContentRender());{const t=this.calendarEvent.getEventDuration();return e("div",{part:"event-container",class:Object.assign(Object.assign({},a),{vertical:t>30,"duration-half-an-hour":30===t,"event-bg-color":!n,"bg-disabled":n}),role:"button",tabIndex:0,ref:e=>this.slotContainerRef=e},!this.slotMode&&this.renderEventStatus(),e("div",{class:"cover-block"}),this.slotMode?this.getSlotElement():this.defaultNormalTimedEventContentRender(t))}}renderEventStatus(){if(this.showColorBar){const t=this.calendarEvent.disabled;return e("div",{class:{"event-status":!0,"event-bg-color":!t,"bg-disabled":t}},e("span",{class:{stripe:"secondary"===this.calendarEvent.variant}}))}}defaultNormalMonthEventContentRender(){const{startTime:t,title:n}=this.calendarEvent;return e("div",{class:"event-title"},`${this.formatDisplayTime(t)} ${n}`)}defaultNormalTimedEventContentRender(t){const{startTime:n,endTime:i,title:r}=this.calendarEvent;return e("div",{class:"event-content"},e("div",{class:{"event-title":!0,"title-word-wrap":t>30},ref:e=>this.eventTitleContainerRef=e},r),e("div",{class:"event-time"},e("vega-icon",{size:"size-12",icon:C.getIconKey("clock-three")}),e("span",null,`${this.formatDisplayTime(n)} - ${this.formatDisplayTime(i)}`)))}getSlotElement(){if(!this.calendarEvent.isRepeatEvent)return e("slot",null)}injectBackgroundColorStyle(){return e("style",null,this.colorController.getBackgroundColorStyle())}formatDisplayTime(e){const[t,n]=e.split(":");if("24-hour"===this.timeFormat)return`${t.padStart(2,"0")}:${n.padStart(2,"0")}`;{const e=Number(t),i=e>=12?"pm":"am",r=n.padStart(2,"0");return e>12?`${e-12}:${r} pm`:0===e?`12:${r} am`:`${e}:${r} ${i}`}}}C.register({"clock-three":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120V256c0 13.3 10.7 24 24 24H360c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"/></svg>'}}),rt([l()],at.prototype,"host",void 0),rt([l()],at.prototype,"timeFormat",void 0),rt([l()],at.prototype,"calendarEvent",void 0),rt([l()],at.prototype,"slotMode",void 0),rt([l()],at.prototype,"showColorBar",void 0),rt([l()],at.prototype,"colorController",void 0);class ot extends d{getBackgroundColorStyle(){const e=this.calendarEvent.color||"bg-accent6-primary";return B(e)?`.event-bg-color{${N.formatToken(e)}}`:`.event-bg-color{background-color:${e}}`}}!function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);a>3&&o&&Object.defineProperty(t,n,o)}([l()],ot.prototype,"calendarEvent",void 0);var st=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class lt extends L{constructor(){super({parent:()=>this.host["data-calendar-ref"],subStates:[{subStateName:"timeFormat",parentStateName:"timeFormat"},{subStateName:"showColorBar",parentStateName:"showEventColorBar"}]})}}st([l({writable:!0})],lt.prototype,"timeFormat",void 0),st([l({writable:!0})],lt.prototype,"showColorBar",void 0);class dt extends d{setVerticalTitleMaxHeight(){const e=this.renderer.getEventTitleContainerRef();if(e&&e.classList.contains("title-word-wrap")){const t=window.getComputedStyle(e),n=A(t.height),i=A(t.lineHeight),r=Math.max(Math.floor(n/i),1);e.style.maxHeight=r*i+"px"}}}!function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);a>3&&o&&Object.defineProperty(t,n,o)}([l()],dt.prototype,"renderer",void 0);var ct=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class ht extends d{findTheCalendarEventSlot(){if(this.calendarEvent){const{event:e}=this.calendarEvent,t=this.getParentCalendarElement();if(t){const n=t.querySelector(`vega-calendar-event-slot[event-key='${e.key}']`);n&&(this.slotMode=!0,this.matchSlotElement=n)}}}appendTheRepeatEventSlotToContainer(){const e=this.renderer.getSlotContainerRef();if(this.slotMode&&e&&this.matchSlotElement&&(this.calendarEvent.isRepeatEvent||this.isPopoverContent())){const t=this.matchSlotElement.cloneNode(!0);t.removeAttribute("slot"),e.querySelector("vega-calendar-event-slot")||e.appendChild(t)}}getParentCalendarElement(){return this.host["data-calendar-ref"]}isPopoverContent(){return this.host.classList.contains("calendar-event-in-popover")}}ct([l()],ht.prototype,"host",void 0),ct([l()],ht.prototype,"calendarEvent",void 0),ct([l({writable:!0})],ht.prototype,"slotMode",void 0),ct([l()],ht.prototype,"renderer",void 0),ct([c("componentWillLoad")],ht.prototype,"findTheCalendarEventSlot",null),ct([c("componentDidLoad")],ht.prototype,"appendTheRepeatEventSlotToContainer",null);var vt=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};const pt=class{constructor(e){i(this,e),this.globalSlimmer={},this.pageResizeObserverSlimmer=new S({target:()=>this.host,callback:()=>this.titleMaxHeightController.setVerticalTitleMaxHeight()}),this.vegaComponentUsageRuntimeMetricsSlimmer=new p,this.renderer=new at,this.colorController=new ot,this.slotController=new ht,this.subStateController=new lt,this.titleMaxHeightController=new dt,this.timeFormat="24-hour",this.slotMode=!1,this.showColorBar=!0}render(){return P(e("slot",null)),s(e(a,null,this.calendarEvent?this.renderer.render():null),this.host)}get host(){return o(this)}};vt([f()],pt.prototype,"globalSlimmer",void 0),vt([v()],pt.prototype,"pageResizeObserverSlimmer",void 0),vt([v()],pt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),vt([v()],pt.prototype,"renderer",void 0),vt([v()],pt.prototype,"colorController",void 0),vt([v()],pt.prototype,"slotController",void 0),vt([v()],pt.prototype,"subStateController",void 0),vt([v()],pt.prototype,"titleMaxHeightController",void 0),pt.style='.bg-disabled{background-color:rgba(var(--v-bg-disabled, 176, 180, 181, 1))}:host{display:block;box-sizing:border-box;width:100%}:host .background-color-mode{border-radius:2px;color:rgba(var(--v-text-black, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px;cursor:pointer;overflow:hidden;white-space:nowrap}@media screen and (min-width: 768px) and (max-width: 1023px){:host .background-color-mode{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .background-color-mode{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .background-color-mode{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}:host .background-color-mode:not(.slot-container){padding-left:8px;padding-right:8px}:host .background-color-mode:focus{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px}:host .event-container{display:block;width:100%;border-radius:4px;cursor:pointer;box-sizing:border-box;overflow:hidden}:host .background-color-mode.slot-container{height:16px;line-height:16px}:host ::slotted(vega-calendar-event-slot){position:relative;pointer-events:none}:host(.month-event) .event-container{display:flex;flex-direction:row;gap:4px;align-items:center;min-height:16px}:host(.month-event) .event-container:not(.slot-container){padding-left:2px;padding-right:2px}:host(.month-event) .event-container .event-status{width:8px;height:8px;box-sizing:border-box;border-top-left-radius:9999px;border-bottom-left-radius:9999px;border-top-right-radius:9999px;border-bottom-right-radius:9999px;margin-left:2px;flex-shrink:0}:host(.month-event) .event-container .event-status span{display:none;width:100%;height:100%;border-top-left-radius:9999px;border-bottom-left-radius:9999px;border-top-right-radius:9999px;border-bottom-right-radius:9999px}:host(.month-event) .event-container .event-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));flex-grow:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.month-event) .event-container .event-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.month-event) .event-container .event-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.month-event) .event-container .event-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}}:host(.month-event) .event-container.secondary .event-status span{display:block;background-size:4px 4px;opacity:0.8}:host(.month-event) .event-container.tertiary .event-status{padding:1px}:host(.month-event) .event-container.tertiary .event-status span{display:block;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1))}:host(.month-event) .event-container.disabled .event-status{background-color:rgba(var(--v-bg-disabled, 176, 180, 181, 1))}:host(.month-event) .event-container:hover{background-color:rgba(var(--v-bg-action-secondary-hover, 4, 112, 236, 0.1))}:host(.month-event) .event-container:active{background-color:rgba(var(--v-bg-action-secondary-active, 29, 65, 195, 0.1))}:host(.month-event) .event-container:focus{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px}:host(.day-event) .event-container{position:relative}:host(.day-event) .event-container:not(.slot-container){padding-left:8px;padding-right:8px}:host(.day-event) .event-container .event-status{position:absolute;width:4px;height:100%;left:0;top:0;z-index:1}:host(.day-event) .event-container .event-status span{display:none}:host(.day-event) .event-container .cover-block{position:absolute;height:100%;width:100%;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:4px;left:0;top:0;opacity:0.7}:host(.day-event) .event-container .event-content,:host(.day-event) .event-container .event-time{display:flex;flex-direction:row;align-items:center}:host(.day-event) .event-container .event-content{gap:8px;position:relative;height:100%;box-sizing:border-box}:host(.day-event) .event-container .event-time{gap:4px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.day-event) .event-container .event-time{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.day-event) .event-container .event-time{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.day-event) .event-container .event-time{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}}:host(.day-event) .event-container .event-time vega-icon{flex-shrink:0}:host(.day-event) .event-container .event-time span{white-space:nowrap}:host(.day-event) .event-container .event-title{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host(.day-event) .event-container .event-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host(.day-event) .event-container .event-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host(.day-event) .event-container .event-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:700;line-height:16px;letter-spacing:0px}}:host(.day-event) .event-container .event-title.title-word-wrap{overflow:hidden}:host(.day-event) .event-container .event-title:not(.title-word-wrap){white-space:nowrap}:host(.day-event) .event-container.duration-half-an-hour{padding-top:8px;padding-bottom:8px}:host(.day-event) .event-container.vertical{height:100%}:host(.day-event) .event-container.vertical .event-content{flex-direction:column;align-items:flex-start;gap:4px;padding-top:8px;padding-bottom:8px}:host(.day-event) .event-container.secondary .event-status span,:host(.day-event) .event-container.tertiary .event-status span{display:block;position:absolute;border-top-left-radius:4px;border-bottom-left-radius:4px}:host(.day-event) .event-container.secondary .cover-block,:host(.day-event) .event-container.tertiary .cover-block{width:calc(100% - 2px);height:calc(100% - 2px);top:1px;left:1px}:host(.day-event) .event-container.secondary .event-status span{width:100%;height:100%;top:0px;left:0px;background-size:4px 4px;opacity:0.8}:host(.day-event) .event-container.secondary .cover-block{opacity:0.9}:host(.day-event) .event-container.tertiary .event-status span{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));width:2px;height:calc(100% - 2px);top:1px;left:1px}:host(.day-event) .event-container.tertiary .cover-block{opacity:1}:host(.day-event) .event-container.disabled{background-color:rgba(var(--v-bg-disabled, 176, 180, 181, 1))}:host(.day-event) .event-container.disabled .event-status{background-color:rgba(var(--v-bg-disabled, 176, 180, 181, 1))}:host(.day-event) .event-container:focus{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px}:host(.day-event) .slot-container{min-height:16px}:host(.month-event.calendar-event-large-size) .background-color-mode{border-radius:4px}:host(.month-event.calendar-event-large-size) .background-color-mode:not(.slot-container){padding-top:4px;padding-bottom:4px}:host(.month-event.calendar-event-large-size) .event-container:not(.slot-container){padding-top:4px;padding-bottom:4px}:host(.month-event.calendar-event-large-size) .slot-container{height:24px;display:flex;align-items:center;line-height:24px}.stripe{background-image:linear-gradient(-45deg, transparent 25%, rgba(var(--v-bg-primary, 252, 252, 252, 1)) 25% 50%, transparent 50% 75%, rgba(var(--v-bg-primary, 252, 252, 252, 1)) 75% 100%)}';var ft=function(e,t,n,i){var r,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(a<3?r(o):a>3?r(t,n,o):r(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};const mt=class{constructor(e){i(this,e),this.globalSlimmer={},this.vegaComponentUsageRuntimeMetricsSlimmer=new p}render(){return s(e(a,{slot:ie(this.eventKey)},e("slot",null)),this.host)}get host(){return o(this)}};ft([f()],mt.prototype,"globalSlimmer",void 0),ft([v()],mt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),mt.style=":host{width:100%;height:100%;position:relative}";export{it as vega_calendar,pt as vega_calendar_event,mt as vega_calendar_event_slot}
@@ -1 +0,0 @@
1
- import{i as o}from"./p-b1f65b13.js";import{R as f}from"./p-327be043.js";function i(i,r,e,s){return o(i)?{flex:`${f.formatCustom(i)}`}:{flexGrow:o(r)?`${f.formatCustom(r)}`:void 0,flexShrink:o(e)?`${f.formatCustom(e)}`:void 0,flexBasis:o(s)?`${f.formatCustom(s)}`:void 0}}export{i as f}
@@ -1 +0,0 @@
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 f}from"./p-4387d550.js";import{V as d}from"./p-c9b9322b.js";import{V as j}from"./p-cc63e827.js";import{f as h}from"./p-f9cf7e36.js";import{h as b}from"./p-5773a9a3.js";import{O as u}from"./p-331a62d5.js";import{C as v}from"./p-2d0d575f.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-327be043.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-d5f1794e.js";import"./p-d5776087.js";import"./p-0c8bd757.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-6e01f0a2.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-fa5eb496.js";import"./p-4ab3df00.js";import"./p-fecb4044.js";import"./p-3eb2d433.js";import"./p-425ba7d6.js";import"./p-2205ee4c.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=d.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(b,this.observer),this.observer=null)}registerObserver(){this.observer=new u(this.isAcceptObserver.bind(this),this.listenerCallback.bind(this)),v.register(b,this.observer)}isFlagForCountryCodeLoaded(t){const e=d.getIconKey(t);return d.hasIcon(e)}}!async function(){try{const t=(await import("./p-1e926324.js")).CountryFlags;d.register(t),v.notify(b,{})}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([f()],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 +0,0 @@
1
- import{h as t,H as e,F as i,r as o,c as s,g as n}from"./p-21d26bb4.js";import{c as r,M as c,V as l,I as a}from"./p-6e1ab235.js";import{V as h,I as d}from"./p-4387d550.js";import{s as u}from"./p-519a7d55.js";import{c as p}from"./p-86194314.js";import{C as f}from"./p-2d0d575f.js";import{d as v,b as m,f as b,P as g,a as x,M as w,N as C}from"./p-6e01f0a2.js";import{V as y,a as R,v as j,w as k,x as S,r as O}from"./p-425ba7d6.js";import{b as T,I as H,T as L,a as z}from"./p-6681efd5.js";import{V as E}from"./p-c9b9322b.js";import{g as B,J as I,N as A,G as M,T as D,K as N,O as P,d as F,P as V,Q as U,V as W,W as _,X as K,Y as G,_ as q,D as $,L as J,H as X,$ as Y,a as Z,M as Q,f as tt,a0 as et,c as it,Z as ot,a1 as st,a2 as nt,S as rt,R as ct,b as lt,e as at,F as ht,u as dt,I as ut,w as pt}from"./p-3eb2d433.js";import{D as ft}from"./p-e7b00bf0.js";import{g as vt}from"./p-37b05e0b.js";import{a as mt}from"./p-f4a13f3f.js";import{F as bt}from"./p-da1d0c02.js";import{c as gt}from"./p-012cbd8f.js";import{c as xt}from"./p-8e31e7ea.js";import{a as wt,V as Ct,B as yt,b as Rt,R as jt}from"./p-fecb4044.js";import{R as kt,C as St,A as Ot,a as Tt}from"./p-9dc9fcf3.js";import{b as Ht,D as Lt}from"./p-5773a9a3.js";import{O as zt}from"./p-331a62d5.js";import{d as Et}from"./p-1bc5b3bc.js";import{D as Bt}from"./p-6be16084.js";import{i as It}from"./p-b1f65b13.js";import{r as At,f as Mt}from"./p-d5776087.js";import{R as Dt}from"./p-3fa7d356.js";import{C as Nt}from"./p-6b7dca3e.js";import{T as Pt}from"./p-d64b20c2.js";import{V as Ft}from"./p-0c8bd757.js";import{c as Vt}from"./p-613ddaab.js";import{t as Ut}from"./p-aacf6920.js";import{r as Wt}from"./p-77e64f26.js";import"./p-cc63e827.js";import"./p-6a334573.js";import"./p-fa5eb496.js";import"./p-0bb29d98.js";import"./p-4ab3df00.js";import"./p-7d9cd9c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-b75ee3ba.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-138fcf6e.js";import"./p-613ee009.js";import"./p-1fb56e14.js";import"./p-cc6410e6.js";import"./p-a46ac2eb.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-112455b1.js";var _t=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Kt extends l{constructor(){super(...arguments),this.renderHintMessage=()=>t("vega-text",null,this.hint),this.renderTextContent=()=>t("div",{class:{"rich-text-editor-container":!0,disabled:this.disabled},style:{minHeight:24*this.rows+"px"},onClick:this.richTextContentFocus,role:"textbox",tabIndex:this.disabled?0:-1,onKeyDown:p(),ref:t=>this.richTextContainerRef=t},t("vega-rich-text-content",{ref:t=>this.richTextContentRef=t,content:this.value}),this.renderCharacterCounter()),this.renderCharacterCounter=()=>t("div",{class:{"text-editor-counter":!0,"counter-exceed-max-length":!1},style:{display:"none"}},t("span",null,"0"),t("span",null,"/100")),this.renderErrorMessage=()=>t("div",{class:"vega-error vega-hidden"}),this.richTextContentFocus=()=>{this.richTextContentRef.vegaFocus()}}componentDidRender(){f.notify(v.getSubject(this.host,y),{})}getRichTextContainerRef(){return this.richTextContainerRef}getRichTextContentRef(){return this.richTextContentRef}getRichTextWrapperRef(){return this.richTextWrapperRef}getRTEEditableElementRef(){if(this.richTextContentRef&&this.richTextContentRef.shadowRoot)return this.richTextContentRef.shadowRoot.querySelector(".rich-text-content")}render(){return t(e,null,this.renderRichTextEditor())}renderRichTextEditor(){return t("vega-flex",{direction:"col",gap:"0",ref:t=>this.richTextWrapperRef=t},this.renderLabel(),this.hint&&this.renderHintMessage(),this.toolbarRenderer.render(),this.renderTextContent(),this.renderErrorMessage())}renderLabel(){return this.label&&t("vega-field-label",{onClick:this.richTextContentFocus,isFieldRequired:this.required,disabled:this.disabled,label:this.label})}}_t([r()],Kt.prototype,"host",void 0),_t([r()],Kt.prototype,"toolbarRenderer",void 0),_t([r()],Kt.prototype,"label",void 0),_t([r()],Kt.prototype,"required",void 0),_t([r()],Kt.prototype,"hint",void 0),_t([r()],Kt.prototype,"disabled",void 0),_t([r()],Kt.prototype,"rows",void 0),_t([r()],Kt.prototype,"placeholder",void 0),_t([r()],Kt.prototype,"value",void 0),_t([c("componentDidRender")],Kt.prototype,"componentDidRender",null);var Gt=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class qt extends l{constructor(){super(...arguments),this.getToolbarBtnRenderer=t=>{switch(t){case"clearStyle":return this.clearStyleToolbarButtonSlimmer;case"bold":return this.boldToolbarButtonSlimmer;case"textStyles":return this.textStylesToolbarButtonSlimmer;case"italic":return this.italicToolbarButtonSlimmer;case"underline":return this.underlineToolbarButtonSlimmer;case"textColor":return this.textColorToolbarButtonSlimmer;case"moreIndent":return this.moreIndentToolbarButtonSlimmer;case"lessIndent":return this.lessIndentToolbarButtonSlimmer;case"code":return this.codeToolbarButtonSlimmer;case"strikethrough":return this.strikethroughToolbarButtonSlimmer;case"link":return this.linkToolbarButtonSlimmer;case"image":return this.imageToolbarButtonSlimmer;case"bulletsNumbers":return this.bulletsNumbersToolbarButtonSlimmer;case"horizontalAlignment":return this.horizontalAlignmentToolbarButtonSlimmer;case"codeBlock":return this.codeBlockToolbarButtonSlimmer}}}render(){return t("vega-flex",{gap:"size-8",alignItems:"center",flexWrap:"wrap"},this.toolbarItems.map((e=>t("div",{class:"toolbar-btn-group"},e.map((t=>this.getToolbarBtnRenderer(t).render()))))))}}Gt([r()],qt.prototype,"toolbarItems",void 0),Gt([r()],qt.prototype,"clearStyleToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"boldToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"textStylesToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"italicToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"underlineToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"textColorToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"bulletsNumbersToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"horizontalAlignmentToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"strikethroughToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"imageToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"moreIndentToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"lessIndentToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"codeToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"linkToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"codeBlockToolbarButtonSlimmer",void 0);class $t extends T{constructor(){super({icon:"bold",tooltip:{text:"Bold"}})}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new I(!t))))}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof B));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(A.BOLD))||void 0===e?void 0:e.bold}))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof M||(null===(e=t.getAnnotationByType(A.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(A.IMAGE)}))}}E.register({bold:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 64C0 46.3 14.3 32 32 32H80 96 224c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128H96 80 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48V256 96H32C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64H112V224H224zM112 288V416H256c35.3 0 64-28.7 64-64s-28.7-64-64-64H224 112z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],$t.prototype,"selectionController",void 0);class Jt extends D{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new N(this.italic)}}class Xt extends T{constructor(){super({icon:"italic",tooltip:{text:"Italic"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof B));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(A.ITALIC))||void 0===e?void 0:e.italic}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new Jt(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof M||(null===(e=t.getAnnotationByType(A.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(A.IMAGE)}))}}E.register({italic:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M128 64c0-17.7 14.3-32 32-32H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H293.3L160 416h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H90.7L224 96H160c-17.7 0-32-14.3-32-32z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],Xt.prototype,"selectionController",void 0);class Yt extends D{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new P(this.underline)}}class Zt extends T{constructor(){super({icon:"underline",tooltip:{text:"Underline"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof B));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(A.UNDERLINE))||void 0===e?void 0:e.underline}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new Yt(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof M||(null===(e=t.getAnnotationByType(A.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(A.IMAGE)}))}}E.register({underline:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M16 64c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H128V224c0 53 43 96 96 96s96-43 96-96V96H304c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H384V224c0 88.4-71.6 160-160 160s-160-71.6-160-160V96H48C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],Zt.prototype,"selectionController",void 0);var Qt=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class te extends T{constructor(){super({icon:"text-size",tooltip:{text:"Text Styles"}}),this.handleDropdownItemClick=t=>{const e=t.detail,i=te.items.find((t=>t.key===e)).bold,o=this.selectionController.getSelectedBlocks().filter((t=>t instanceof F));o.length>0?o.forEach((t=>{t.apply(new V(e,i))})):this.focusController.focusOnLastTextNode({newLine:!0}).then((()=>{this.selectionController.getSelectedBlocks().filter((t=>t instanceof F)).forEach((t=>{t.apply(new V(e,i))}))}))}}renderBtnWrapper(e){return t("vega-dropdown",{selectType:"single",trigger:"click",alignment:"center",selectedSourceKey:this.getSelectedSourceKey(),ref:t=>{this.addDropdownObserver(t)}},e({showArrowIcon:!0}),t("div",Object.assign({slot:"items"},super.preventLostFocus()),this.renderDropdownContent()))}renderDropdownContent(){return t(i,null,te.items.map((e=>{const i=new U(e.key),o=new W(e.bold);return t("vega-dropdown-item",{key:e.key,itemKey:e.key},t("vega-box",{padding:{right:"size-20"}},t("div",{style:Object.assign(Object.assign({},i.render()),o.render())},this.translationSlimmer.t(e.label))))})))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof M||t.getAnnotationByType(A.IMAGE)))}addDropdownObserver(t){ft.addUniqueObserverToNode(t,m,this.handleDropdownItemClick)}getSelectedSourceKey(){const t=this.selectionController.getSelectedBlocks().filter((t=>t instanceof F));return t.length>0&&t.every((e=>e.type===t[0].type))?t[0].getAnnotationByType(_.TEXT_STYLE).textStyle:""}}E.register({"text-size":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M64 128V96h96l0 320H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H256c17.7 0 32-14.3 32-32s-14.3-32-32-32H224l0-320h96v32c0 17.7 14.3 32 32 32s32-14.3 32-32V80c0-26.5-21.5-48-48-48H192 48C21.5 32 0 53.5 0 80v48c0 17.7 14.3 32 32 32s32-14.3 32-32zM384 304V288h64l0 128H432c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H512l0-128h64v16c0 17.7 14.3 32 32 32s32-14.3 32-32V272c0-26.5-21.5-48-48-48H368c-26.5 0-48 21.5-48 48v32c0 17.7 14.3 32 32 32s32-14.3 32-32z"/></svg>'}}),te.items=[{key:"title",label:"Title",bold:!0},{key:"subtitle",label:"Subtitle"},{key:"heading-1",label:"Heading 1",bold:!0},{key:"heading-2",label:"Heading 2",bold:!0},{key:"heading-3",label:"Heading 3",bold:!0},{key:"paragraph",label:"Paragraph"}],Qt([r()],te.prototype,"selectionController",void 0),Qt([r()],te.prototype,"focusController",void 0);class ee extends T{constructor(){super({icon:"text-slash",tooltip:{text:"Clear Style"}})}isSelected(){return!1}onClick(){this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((t=>{t.apply(new K)}))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof M||t.getAnnotationByType(A.IMAGE)))}}E.register({"text-slash":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L355.7 253.5 400.2 96H503L497 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C577.6 61.3 554.7 32 523.5 32H376.1h-.3H204.5c-22 0-41.2 15-46.6 36.4l-6.3 25.2L38.8 5.1zm168 131.7c.1-.3 .2-.7 .3-1L217 96H333.7L301.3 210.8l-94.5-74.1zM243.3 416H192c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H309.8l17.6-62.1L272.9 311 243.3 416z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ee.prototype,"selectionController",void 0);class ie extends T{constructor(){super({icon:"code-simple",tooltip:{text:"Code"}})}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new G(!t))))}isSelected(){const t=this.selectionController.getSelectedNodes();return t.length>0&&t.filter((t=>t instanceof B)).map((t=>t.getAnnotationByType(A.CODE))).every((t=>t&&t.code))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof M||t.getAnnotationByType(A.LINK)||t.getAnnotationByType(A.IMAGE)))}}E.register({"code-simple":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 214.6 118.6zm146.7 0L498.7 256 361.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ie.prototype,"selectionController",void 0);class oe extends D{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new q(this.strikethrough)}}class se extends T{constructor(){super({icon:"strikethrough",tooltip:{text:"Strikethrough"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof B));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(A.STRIKETHROUGH))||void 0===e?void 0:e.strikethrough}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new oe(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof M||(null===(e=t.getAnnotationByType(A.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(A.IMAGE)}))}}E.register({strikethrough:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e<path fill="currentColor" d="M332.2 319.9c17.22 12.17 22.33 26.51 18.61 48.21c-3.031 17.59-10.88 29.34-24.72 36.99c-35.44 19.75-108.5 11.96-186-19.68c-16.34-6.686-35.03 1.156-41.72 17.53s1.188 35.05 17.53 41.71c31.75 12.93 95.69 35.37 157.6 35.37c29.62 0 58.81-5.156 83.72-18.96c30.81-17.09 50.44-45.46 56.72-82.11c3.998-23.27 2.168-42.58-3.488-59.05H332.2zM488 239.9l-176.5-.0309c-15.85-5.613-31.83-10.34-46.7-14.62c-85.47-24.62-110.9-39.05-103.7-81.33c2.5-14.53 10.16-25.96 22.72-34.03c20.47-13.15 64.06-23.84 155.4 .3438c17.09 4.531 34.59-5.654 39.13-22.74c4.531-17.09-5.656-34.59-22.75-39.12c-91.31-24.18-160.7-21.62-206.3 7.654C121.8 73.72 103.6 101.1 98.09 133.1C89.26 184.5 107.9 217.3 137.2 239.9L24 239.9c-13.25 0-24 10.75-24 23.1c0 13.25 10.75 23.1 24 23.1h464c13.25 0 24-10.75 24-23.1C512 250.7 501.3 239.9 488 239.9z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],se.prototype,"selectionController",void 0);class ne extends T{constructor(){super({icon:"link",tooltip:{text:"Link"}}),this.handleLinkEditorChange=({detail:t})=>{switch(t.action){case"link":{const{url:e,text:i}=t.payload,o=i!==this.currentSelectedText,s=vt();return void this.currentSelectedNodes.forEach((t=>{t.apply(new $(this.currentRange)).apply(new J({link:{href:e,groupKey:s},newText:o?i:void 0,needMergeNode:o&&this.currentSelectedNodes.length>1}))}))}}}}renderBtnWrapper(e){return t("div",{class:"toolbar-btn-link-wrapper",ref:t=>this.linkBtnWrapperRef=t},e(),t("vega-rich-text-link-editor",{resetStatusAfterHide:!1,status:"linkEdit",ref:t=>{t&&(this.linkEditorRef=t),ft.addUniqueObserverToNode(t,b,this.handleLinkEditorChange)}}))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes(),e=this.selectionController.getSelectedBlocks();return super.isDisabled()||e.length>1||t.some((t=>{var e;return!(t instanceof B)||t.getAnnotationByType(A.LINK)||(null===(e=t.getAnnotationByType(A.CODE))||void 0===e?void 0:e.code)}))}onClick(){this.currentRange=this.selectionController.getCurrentRange().toNativeRange(),this.currentSelectedNodes=this.selectionController.getSelectedNodes(),this.currentRange&&(this.currentSelectedText=this.currentRange.toString(),this.currentSelectedNodes.length>0&&(this.linkEditorRef.record={text:this.currentSelectedText,url:""})),this.linkEditorRef.target||(this.linkEditorRef.target=this.linkBtnWrapperRef,mt(this.linkEditorRef).then((()=>{this.linkEditorRef.show()})))}}E.register({link:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M562.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L405.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C189.5 251.2 196 330 246 380c56.5 56.5 148 56.5 204.5 0L562.8 267.7zM43.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C57 372 57 321 88.5 289.5L200.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C416.5 260.8 410 182 360 132c-56.5-56.5-148-56.5-204.5 0L43.2 244.3z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ne.prototype,"selectionController",void 0);class re extends X{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new Y(this.indent)}}class ce extends T{constructor(){super({icon:"indent",tooltip:{text:"More Indent"}})}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedBlocks(),e=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>"list-item"===t.type||"code-block"===t.type))||e.some((t=>t instanceof Z))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>{var e,i;const o=null!==(i=null===(e=t.getAnnotationByType(_.INDENT))||void 0===e?void 0:e.indent)&&void 0!==i?i:0;t.apply(new re(o+1))}))}}E.register({indent:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 64C0 46.3 14.3 32 32 32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32zm32 96H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3V176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ce.prototype,"selectionController",void 0);class le extends T{constructor(){super({icon:"outdent",tooltip:{text:"Less Indent"}})}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedBlocks(),e=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>"list-item"===t.type||"code-block"===t.type))||e.some((t=>t instanceof Z))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>{var e,i;const o=null!==(i=null===(e=t.getAnnotationByType(_.INDENT))||void 0===e?void 0:e.indent)&&void 0!==i?i:0;t.apply(new re(o>1?o-1:0))}))}}E.register({outdent:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M6 64C6 46.3 20.3 32 38 32H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H38C20.3 96 6 81.7 6 64zM198 192c0-17.7 14.3-32 32-32H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H230c-17.7 0-32-14.3-32-32zm32 96H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H230c-17.7 0-32-14.3-32-32s14.3-32 32-32zM6 448c0-17.7 14.3-32 32-32H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H38c-17.7 0-32-14.3-32-32zm.2-179.4c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6V335.3c0 13.3-15.3 20.8-25.8 12.6L6.2 268.6z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],le.prototype,"selectionController",void 0);class ae extends Q{constructor(t){super(),this.type=tt.UPDATE_IMAGE_NODE_URL,this.url=t}}var he=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class de extends T{constructor(){super({icon:"image",tooltip:{text:"Image"}}),this.onClick=()=>{this.inputElementRef.click()},this.fileInputChange=t=>{t.stopPropagation();const e=t.target;if(!e.files.length)return;const i=this.insertImageController.insertImageToCaretPosition(URL.createObjectURL(e.files[0]));this.updateNodeURLMap||(this.updateNodeURLMap=new Map),this.updateNodeURLMap.set(i,(t=>{i.apply(new ae(t))}));const o={file:e.files[0],sendBackUploadedURLCallback:this.updateNodeURLMap.get(i)};this.imageInsertedEventEmitter.emit(o),e.value=""}}renderBtnWrapper(e){return t("vega-box",null,e({showArrowIcon:!1}),t("input",{type:"file",style:{display:"none"},ref:t=>this.inputElementRef=t,accept:"image/*",onChange:this.fileInputChange}))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t.getAnnotationByType(A.LINK)))}}E.register({image:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6h96 32H424c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>'}}),he([r()],de.prototype,"insertImageController",void 0),he([r()],de.prototype,"imageInsertedEventEmitter",void 0),he([r()],de.prototype,"selectionController",void 0);class ue extends Q{constructor(t,e){super(),this.type=tt.TRANSFORM_LIST_BLOCK,this.isFlushable=!0,this.listType=t,this.selectedBlocks=e}}class pe extends Q{constructor(t){super(),this.type=tt.TRANSFORM_PARAGRAPH_BLOCK,this.isFlushable=!0,this.selectedBlocks=t}}var fe=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ve extends T{constructor(){super({icon:"list-ul",tooltip:{text:"Bullets"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return this.isListType(t)}onClick(){this.isSelected()?this.deselectBulletList():this.selectBulletList(),this.popoverRef.hide()}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof Z||t instanceof M))}isListType(t,e="bullet-list"){return t.length>0&&t.every((t=>t instanceof wt&&t.parent.type===e))}deselectBulletList(){const t=this.selectionController.getSelectedBlocks();t[0]&&t[0].parent.apply(new pe(t))}selectBulletList(){const t=this.selectionController.getSelectedBlocks();t[0]&&("list-item"===t[0].type?t[0].parent:t[0]).apply(new ue("bullet-list",t))}}fe([r()],ve.prototype,"selectionController",void 0),fe([r()],ve.prototype,"popoverRef",void 0);var me=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class be extends T{constructor(){super({icon:"list-ol",tooltip:{text:"Numbers"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return this.isListType(t)}onClick(){this.isSelected()?this.deselectNumberList():this.selectNumberList(),this.popoverRef.hide()}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof Z||t instanceof M))}isListType(t,e="number-list"){return t.length>0&&t.every((t=>t instanceof wt&&t.parent.type===e))}deselectNumberList(){const t=this.selectionController.getSelectedBlocks();t[0]&&t[0].parent.apply(new pe(t))}selectNumberList(){const t=this.selectionController.getSelectedBlocks();t[0]&&("list-item"===t[0].type?t[0].parent:t[0]).apply(new ue("number-list",t))}}me([r()],be.prototype,"selectionController",void 0),me([r()],be.prototype,"popoverRef",void 0);var ge=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class xe extends T{constructor(){super({icon:"list-ul",tooltip:{text:"Bullets"}}),this.bulletsToolbarButtonSlimmer=new ve,this.numbersToolbarButtonSlimmer=new be}componentWillRender(){this.numbersToolbarButtonSlimmer.isSelected()?super.setIcon("list-ol"):super.setIcon("list-ul")}renderBtnWrapper(e){return t("vega-popover",{showArrow:!1,trigger:"click",placement:"bottom",alignment:"center",ref:t=>this.popoverRef=t},t("div",{slot:"popover-content"},e({showArrowIcon:!0})),t("div",{slot:"popover"},this.renderContent()))}renderContent(){return t("vega-flex",{gap:"size-8","justify-content":"center"},t("div",null,this.bulletsToolbarButtonSlimmer.render()),t("div",null,this.numbersToolbarButtonSlimmer.render()))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof Z||t instanceof M))}}E.register({"list-ul":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"/></svg>'},"list-ol":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M24 56c0-13.3 10.7-24 24-24H80c13.3 0 24 10.7 24 24V176h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H40c-13.3 0-24-10.7-24-24s10.7-24 24-24H56V80H48C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432H120c13.3 0 24 10.7 24 24s-10.7 24-24 24H32c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"/></svg>'}}),ge([r()],xe.prototype,"selectionController",void 0),ge([a()],xe.prototype,"bulletsToolbarButtonSlimmer",void 0),ge([a()],xe.prototype,"numbersToolbarButtonSlimmer",void 0),ge([c("componentWillRender")],xe.prototype,"componentWillRender",null);class we extends X{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new et(this.textAlign)}}var Ce=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ye extends T{constructor(){super({icon:"align-left",tooltip:{text:"Left Align"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"left"===(null===(e=t.getAnnotationByType(_.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new we("left")))),this.popoverRef.hide()}}E.register({"align-left":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M288 64c0 17.7-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32H256c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H256c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>'}}),Ce([r()],ye.prototype,"selectionController",void 0),Ce([r()],ye.prototype,"popoverRef",void 0);var Re=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class je extends T{constructor(){super({icon:"align-center",tooltip:{text:"Center Align"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"center"===(null===(e=t.getAnnotationByType(_.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new we("center")))),this.popoverRef.hide()}}E.register({"align-center":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M352 64c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32z"/></svg>'}}),Re([r()],je.prototype,"selectionController",void 0),Re([r()],je.prototype,"popoverRef",void 0);var ke=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Se extends T{constructor(){super({icon:"align-right",tooltip:{text:"Right Align"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"right"===(null===(e=t.getAnnotationByType(_.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new we("right")))),this.popoverRef.hide()}}E.register({"align-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M448 64c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>'}}),ke([r()],Se.prototype,"selectionController",void 0),ke([r()],Se.prototype,"popoverRef",void 0);var Oe=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Te extends T{constructor(){super({icon:"align-justify",tooltip:{text:"Justified"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"justify"===(null===(e=t.getAnnotationByType(_.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new we("justify")))),this.popoverRef.hide()}}E.register({"align-justify":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M448 64c0-17.7-14.3-32-32-32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32z"/></svg>'}}),Oe([r()],Te.prototype,"selectionController",void 0),Oe([r()],Te.prototype,"popoverRef",void 0);var He=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Le extends T{constructor(){super({icon:"align-left",tooltip:{text:"Left Align"}}),this.leftAlignToolbarButtonSlimmer=new ye,this.centerAlignToolbarButtonSlimmer=new je,this.rightAlignToolbarButtonSlimmer=new Se,this.justifiedToolbarButtonSlimmer=new Te}componentWillRender(){this.leftAlignToolbarButtonSlimmer.isSelected()?super.setIcon("align-left"):this.centerAlignToolbarButtonSlimmer.isSelected()?super.setIcon("align-center"):this.rightAlignToolbarButtonSlimmer.isSelected()?super.setIcon("align-right"):this.justifiedToolbarButtonSlimmer.isSelected()?super.setIcon("align-justify"):super.setIcon("align-left")}renderBtnWrapper(e){return t("vega-popover",{trigger:"click",showArrow:!1,alignment:"center",placement:"bottom",ref:t=>this.popoverRef=t},t("div",{slot:"popover-content"},e({showArrowIcon:!0})),t("div",{slot:"popover"},this.renderContent()))}renderContent(){return t("vega-flex",{gap:"size-8","justify-content":"center"},t("div",null,this.leftAlignToolbarButtonSlimmer.render()),t("div",null,this.centerAlignToolbarButtonSlimmer.render()),t("div",null,this.rightAlignToolbarButtonSlimmer.render()),t("div",null,this.justifiedToolbarButtonSlimmer.render()))}isSelected(){return!1}isDisabled(){return super.isDisabled()||this.selectionController.getSelectedBlocks().some((t=>"code-block"===t.type))}}He([r()],Le.prototype,"selectionController",void 0),He([a()],Le.prototype,"leftAlignToolbarButtonSlimmer",void 0),He([a()],Le.prototype,"centerAlignToolbarButtonSlimmer",void 0),He([a()],Le.prototype,"rightAlignToolbarButtonSlimmer",void 0),He([a()],Le.prototype,"justifiedToolbarButtonSlimmer",void 0),He([c("componentWillRender")],Le.prototype,"componentWillRender",null);class ze{constructor(t,e){this.content=t.clone(!0),this.selection=e.clone(),this.refreshSelectionNodes()}clone(){return new ze(this.content,this.selection)}refreshSelectionNodes(){const{startNode:t,endNode:e,startOffset:i,endOffset:o}=this.selection.range;if(t&&e){const s=this.content.findNodeById(t.id),n=this.content.findNodeById(e.id);s&&n&&this.selection.range.updateRTERange({startNode:s,endNode:n,startOffset:i,endOffset:o})}}}var Ee=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Be extends l{connectedCallback(){const t=Et((()=>{this.valueController.flushChanges(this.value)}),Be.VALUE_CHANGE_DEBOUNCE_TIME,this);this.flushChangeObserver=new zt(this.isAcceptableFlushChange.bind(this),t),f.register(v.getSubject(this.host,R),this.flushChangeObserver)}disconnectedCallback(){f.unregister(v.getSubject(this.host,R),this.flushChangeObserver)}componentWillLoad(){!this.value||this.value instanceof Ct||(this.value=Ct.fromJSON(this.value))}watchValueUpdate(){!this.value||this.value instanceof Ct?this.value&&0!==this.value.blocks.length?(this.changeEventEmitter.emit(this.value),f.notify(Ht,{host:this.host,detail:this.value})):this.value=Ct.createEmptyContent():this.value=Ct.fromJSON(this.value)}async flushChanges(t,e=!0){this.value=t.clone(),e&&this.historyController.registerHistory(new ze(this.value,new kt(this.selectionController.getCurrentRange()))),await mt(this.host)}isAcceptableFlushChange(){return!0}}Be.VALUE_CHANGE_DEBOUNCE_TIME=50,Ee([r()],Be.prototype,"host",void 0),Ee([r({writable:!0})],Be.prototype,"value",void 0),Ee([r()],Be.prototype,"changeEventEmitter",void 0),Ee([r()],Be.prototype,"valueController",void 0),Ee([r()],Be.prototype,"historyController",void 0),Ee([r()],Be.prototype,"selectionController",void 0),Ee([c("connectedCallback")],Be.prototype,"connectedCallback",null),Ee([c("disconnectedCallback")],Be.prototype,"disconnectedCallback",null),Ee([c("componentWillLoad")],Be.prototype,"componentWillLoad",null),Ee([c("watchValueUpdate")],Be.prototype,"watchValueUpdate",null);class Ie{constructor(t){this.editor=t}syncRichTextContentEditable(){this.editor.richTextContentEditable=!this.editor.disabled}}class Ae{execute(t,e,i,o){this.initCurrentStateAndSelection(t,e),this.setCurrentRichTextEditor(i),this.handleEvent(o)}isRootContainer(t){return t&&t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("rich-text-content")}isEmptyParagraph(t){return t&&t.childNodes&&0===t.childNodes.length}removeSelectionRange(t=!1){f.notify(v.getSubject(this.richTextEditorRef,j),{host:this.richTextEditorRef,detail:t});const e=this.selectionController.getCurrentRange(),i=this.selectionController.getSelectedNodes();return e.startNode||i[0]}createEmptyParagraph(){const t=new F(vt(),"paragraph"),e=new B(`${t.id}1`,"",t);return t.apply(new it([e])),t}initCurrentStateAndSelection(t,e){this.currentState=t,this.selectionController=e}setCurrentRichTextEditor(t){this.richTextEditorRef=t}}class Me extends Q{constructor(t,...e){super(),this.type=tt.INSERT_NODES_BEFORE,this.referNode=t,this.nodesToBeInserted=e}}class De extends Q{constructor(t,e){super(),this.type=tt.REPLACE_SELECTED_TEXT,this.textToBeInsert="",this.textToBeInsert=t,this.currentRange=e}}class Ne extends Ae{handleEvent(t){const e=t.data,i=this.selectionController.getCurrentRange(),{startContainer:o,startOffset:s}=i,n=this.selectionController.getSelectedNodes();if(n.length<2){if(!n.length&&this.isRootContainer(o)){const t=this.insertTextToRoot(e);this.selectionController.enqueueSelectionRangeFutureState(t,e.length)}else if(n[0]instanceof B){let t=s+e.length,r=!1,c=n[0];"\n"===c.text?(c=this.insertTextToLineBreakNode(c,e),r=!0):(o.nodeValue===ot&&s===ot.length&&c.isEmpty()&&(o.nodeValue="",t-=ot.length),c instanceof B&&(r=!0,c.apply(new De(e,i)))),r&&this.selectionController.enqueueSelectionRangeFutureState(c,Math.min(t,c.text.length))}}else{const t=this.removeSelectionRange(!0);t instanceof B&&(t.apply(new De(e,i)),this.selectionController.enqueueSelectionRangeFutureState(t,Math.min(s+e.length,t.text.length)))}}insertTextToRoot(t){if(this.currentState&&this.currentState.blocks[0]&&this.currentState.blocks[0]instanceof F){const e=this.currentState.blocks[0].nodes[0];return e.apply(new st(t)),e}}insertTextToLineBreakNode(t,e){const{startOffset:i,endOffset:o}=this.selectionController.getCurrentRange(),s=t.parentBlock,n=s.nodes.indexOf(t);if(0===i&&i===o&&s.nodes[n+1]){const i=t.cloneWithText(e);return s.apply(new Me(t,i)),i}return t.apply(new st(e)),t}}class Pe extends Ae{handleEvent(){const t=this.selectionController.getSelectedBlocks();t.length&&(t.length<2?this.breakSingleBlock():this.breakMultipleBlocks())}breakMultipleBlocks(){const t=this.selectionController.getSelectedBlocks(),e=this.selectionController.getCurrentRange(),i=this.removeSelectionRange();if(t.length&&"list-item"===t[0].type||"list-item"===t[t.length-1].type){const o=i.parentBlock,s=t[t.length-1];if(o.type!==s.type&&e.startContainer.nodeType===e.endContainer.nodeType){o.apply(new nt(s));const t=new rt(i,i.text.length);return o.apply(t),void this.switchCaretPositionToNextElement(t.newBlock)}}this.selectionController.enqueueSelectionRangeFutureState(i,e.startOffset)}breakSingleBlock(){const t=this.removeSelectionRange(),e=t.parentBlock,{startOffset:i}=this.selectionController.getCurrentRange();if(e){const o=new yt(t,i);e.apply(o),this.switchCaretPositionToNextElement(o.newBlock)}}switchCaretPositionToNextElement(t){t&&t.nodes&&this.selectionController.enqueueSelectionRangeFutureState(t.nodes[0],0)}}class Fe extends Q{constructor(t,e){super(),this.type=tt.LINE_BREAK_SINGLE_BLOCK,this.startContainerNode=t,this.startOffset=e}}class Ve extends Q{constructor(t){super(),this.type=tt.LINE_BREAK_MULTIPLE_BLOCKS,this.selectedBlocks=t}}class Ue extends Ae{handleEvent(){const t=this.selectionController.getCurrentRange(),e=this.selectionController.getSelectedBlocks();this.isRootContainer(t.startContainer)&&this.breakNewBlock(),e.length&&(e.length<2?this.breakSingleBlock():this.breakMultipleBlocks())}breakNewBlock(){if(this.currentState&&this.currentState.blocks[0]&&this.currentState.blocks[0]instanceof F){const t=new Fe(this.currentState.blocks[0].nodes[0],0);this.currentState.blocks[0].apply(t),this.switchCaretPositionToSpecifiedNode(t.lineBreakNode)}}breakSingleBlock(){const t=this.selectionController.getCurrentRange(),e=this.removeSelectionRange(),i=e.parentBlock;if(i){const o=new Fe(e,t.startOffset);i.apply(o),this.switchCaretPositionToSpecifiedNode(o.lineBreakNode)}}breakMultipleBlocks(){const t=this.selectionController.getSelectedBlocks(),e=this.removeSelectionRange(),i=new Ve(t);e.parentBlock.apply(i),this.switchCaretPositionToSpecifiedNode(i.lineBreakNode)}switchCaretPositionToSpecifiedNode(t){this.selectionController.enqueueSelectionRangeFutureState(this.getNextRTENode(t),0)}getNextRTENode(t){const e=t.parentBlock.nodes.indexOf(t);return t.parentBlock.nodes[e+1]||t}}class We extends Q{constructor(t,e){super(),this.type=tt.DELETE_BLOCK_CONTENT,this.startContainerNode=t,this.startOffset=e}}class _e extends Ae{handleEvent(){this.selectionController.getSelectedBlocks().length<2?this.deleteContentWithSingleBlock():this.deleteContentWithMultipleNodes()}deleteContentWithSingleBlock(){const t=this.selectionController.getCurrentRange(),{startOffset:e,endOffset:i,startContainer:o,endContainer:s}=t,n=this.selectionController.getSelectedBlocks(),r=this.selectionController.getSelectedNodes();if(e!==i||o!==s)this.deleteContentWithMultipleNodes();else if(n[0]){const t=new We(r[0],e);if(n[0].apply(t),t.previousNode){const i=t.previousNode===r[0]?Math.max(0,e-1):this.getNodeEndOffset(t.previousNode);this.selectionController.enqueueSelectionRangeFutureState(t.previousNode,i)}else t.nextNode?this.selectionController.enqueueSelectionRangeFutureState(t.nextNode,0):0===this.currentState.blocks.length&&this.insertDefaultParagraph()}}deleteContentWithMultipleNodes(){const t=this.selectionController.getSelectedNodes(),e=this.removeSelectionRange(!0),i=t[t.length-1];t.length>1&&i instanceof B&&i.isEmpty()&&i.parentBlock.apply(new ct(i)),this.convertFirstBlockToParagraph(e.parentBlock)}convertFirstBlockToParagraph(t){if(this.currentState.blocks[0]===t&&t instanceof F&&1===t.nodes.length&&t.nodes[0].isEmpty()&&"paragraph"!==t.type){const e=this.createEmptyParagraph();e.apply(new lt(t.nodes)),t.parent.apply(new at(t,e)),t.parent.apply(new ct(t))}}insertDefaultParagraph(){const t=this.createEmptyParagraph();this.currentState.apply(new it([t])),this.selectionController.enqueueSelectionRangeFutureState(t.nodes[0],1)}getNodeEndOffset(t){return"IMAGE"===t.type?1:"TEXT"===t.type?"\n"===t.text?0:t.text.length:void 0}}class Ke{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(){const t=this.currentStrategy.handle(this.currentElements);return this.childrenOutput.length>0&&t&&this.currentStrategy.appendChildBlocks(t,this.childrenOutput.map((t=>t.toDto())).filter(It)),t}}class Ge extends class{}{generateChildNodes(t,e={}){const i=[];return t.forEach((t=>{if(t.nodeType===Node.TEXT_NODE){if(this.isInvalidTextNode(t))return;i.push({id:vt(),type:"text",text:String(t.textContent),annotations:e})}else i.push(...this.generateChildNodes(Array.from(t.childNodes),Object.assign({},e,this.generateTextNodeAnnotations(t,e))))})),i}generateBlockAnnotations(t){const e={},i=this.getTextAlign(t),o=this.getIndent(t);return i&&(e.textAlign=i),o&&(e.indent=o),e}generateTextNodeAnnotations(t,e={}){if(this.isCode(t))return{code:!0};const i={bold:this.isBold(t),italic:this.isItalic(t),underline:this.isUnderline(t),strikethrough:this.isStrikethrough(t)};e.bold&&(i.bold=!0),e.underline&&(i.underline=!0),e.italic&&(i.italic=!0),e.strikethrough&&(i.strikethrough=!0);const o=this.getColor(t),s=this.getLink(t);return o&&(i.textColor=o),s&&(i.link=s),i}isInvalidTextNode(t){return!(!t.nodeValue||!t.nodeValue.includes("\t")||0!==t.nodeValue.replace(/\n|\t/gm,"").length)}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"monospace"===t.style.fontFamily}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||"bold"===t.style.fontWeight||"700"===t.style.fontWeight}isItalic(t){return"I"===t.nodeName||"italic"===t.style.fontStyle||"EM"===t.nodeName}isUnderline(t){return t.style.textDecoration.includes("underline")||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}isStrikethrough(t){return t.style.textDecoration.includes("line-through")||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}getColor(t){var e;const i=null===(e=At(t.style.color))||void 0===e?void 0:e.toUpperCase();if(i){const t=ht.find((t=>t.light===i||t.dark===i));return t?t.key:null}for(const e of ht)if(t.style.color.includes(e.key))return e.key;return null}getLink(t){return"A"===t.nodeName?{href:t.href,groupKey:vt()}:null}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}getIndent(t){const e=t.style;let i;if(e.marginLeft)i=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:i=t[3];break;case 2:case 3:i=t[1];break;default:i=t[0]}}}const o=Number(i.replace("px",""));return o&&o>=0?Math.floor(o/16):null}}class qe extends Ge{canHandle(t,e){let i=0;for(let o=e;o<t.length;o++){const e=t[o];if(e.nodeType!==Node.TEXT_NODE&&(!qe.canHandleTags.includes(e.nodeName)||""===e.textContent&&e.querySelector("IMG")))break;i++}return i}handle(t){const e=t[0].parentElement,i=this.generateChildNodes(t,this.generateTextNodeAnnotations(e));return 0===i.length?null:F.from({id:vt(),type:"paragraph",nodes:i,annotations:this.generateBlockAnnotations(e)})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}qe.canHandleTags=["SPAN","STRONG","CODE","I","EM","S","U","A","VEGA-RICH-TEXT-LINK-EDITOR","B","INS","DEL"];class $e extends Ge{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t){return 0===t[0].childNodes.length?null:Rt.from({id:vt(),type:"bullet-list",blocks:[],annotations:this.generateBlockAnnotations(t[0])})}appendChildBlocks(t,e){t.blocks=e,e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}class Je extends Ge{canHandle(t,e){return"LI"===t[e].tagName?1:0}handle(t){return 0===t[0].childNodes.length?null:wt.from({id:vt(),type:"list-item",nodes:this.generateChildNodes(Array.from(t[0].childNodes).filter((t=>!["UL","OL"].includes(t.nodeName))),this.generateTextNodeAnnotations(t[0])),annotations:this.generateBlockAnnotations(t[0])})}appendChildBlocks(t,e){t.children=e.filter((t=>["bullet-list","number-list"].includes(t.type)))}shouldProceedToElementChildren(){return!0}}class Xe extends Ge{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(this.getElementType(t[e]))?1:0}handle(t){const e=this.generateChildNodes(t);return 0===e.length?null:F.from({id:vt(),type:this.getElementType(t[0]),nodes:e,annotations:Object.assign(Object.assign({},this.generateBlockAnnotations(t[0])),{textStyle:this.getElementType(t[0])})})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}getElementType(t){var e;if(t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type"))return t.getAttribute("data-type");switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3"}switch(t.nodeName){case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return""}}}class Ye extends Ge{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t){const e=t[0];return jt.from({id:vt(),type:"image",nodes:[{id:vt(),type:"image",url:e.src,annotations:{size:"md",alt:e.alt}}],annotations:this.generateBlockAnnotations(e)})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class Ze extends Ge{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t){const e=t[0],i=e.querySelector("img");if(It(i))return jt.from({id:vt(),type:"image",nodes:[{id:vt(),type:"image",url:i.src,annotations:{size:e.size||"md",alt:e.alt}}],annotations:this.generateBlockAnnotations(e)})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class Qe extends Ge{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t){return 0===t[0].childNodes.length?null:Rt.from({id:vt(),type:"number-list",blocks:[],annotations:this.generateBlockAnnotations(t[0])})}appendChildBlocks(t,e){t.blocks=e,e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}class ti extends Ge{canHandle(t,e){const i=t[e];return i.nodeType===Node.ELEMENT_NODE&&""===i.textContent&&i.querySelector("img")?1:0}handle(t){const e=t[0].querySelector("img");return jt.from({id:vt(),type:"image",nodes:[{id:vt(),type:"image",url:e.src,annotations:{size:"md",alt:e.alt}}],annotations:this.generateBlockAnnotations(e)})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ei extends Ge{canHandle(t,e){const i=t[e],o=i.parentElement;return"LI"!==i.nodeName&&o&&["UL","OL"].includes(o.nodeName)?1:0}handle(t){const e=this.generateChildNodes(t);return 0===e.length?null:wt.from({id:vt(),type:"list-item",nodes:e,annotations:{}})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ii extends Ge{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,i=e.dataset.language;return dt.from({id:vt(),type:"code-block",content:t,language:i})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class oi extends ii{canHandle(t,e){return"VEGA-CODE-BLOCK"===t[e].tagName&&0==!!t[e].querySelector("vega-code-block")||this.isCodeBlockContainer(t[e])?1:0}handle(t){const e=this.isCodeBlockContainer(t[0])?t[0].querySelector("vega-code-block"):t[0],i=e.querySelector("code");if(i)return super.handle([i]);if(e.hasAttribute("data-content")){const t=document.createElement("code");return t.textContent=e.dataset.content,t.dataset.language=e.dataset.language,super.handle([t])}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isCodeBlockContainer(t){return"PRE"===t.tagName&&t.classList.contains("code-block-container")&&1===t.querySelectorAll("vega-code-block").length}}class si{constructor(){this.elementStrategies=[new $e,new Qe,new ei,new Je,new oi,new ii,new Xe,new Ye,new Ze,new ti,new qe]}process(t){const e=[];for(let i=0;i<t.length;i++){if(this.isInvalidElement(t[i]))continue;let o=0;for(const s of this.elementStrategies)if(o=s.canHandle(t,i),o>0){const n=t.slice(i,i+o),r=new Ke(s,n);1===o&&s.shouldProceedToElementChildren()&&r.setChildrenOutput(this.process(Array.from(n[0].childNodes))),e.push(r),i+=o-1;break}if(0===o&&i<t.length){const o=Array.from(t[i].childNodes),s=this.process(Array.from(o));s.length>0&&e.push(...s)}}return e}isInvalidElement(t){return t.nodeType===Node.COMMENT_NODE||["META","BUTTON","STYLE"].includes(t.nodeName)}}class ni extends Ae{constructor(){super(...arguments),this.elementToDTOProcessor=new si}handleEvent(t){const e=this.parsePastedElements(t),{startContainer:i}=this.selectionController.getCurrentRange();this.isRootContainer(i)?this.insertBlocksToRoot(e):this.isEmptyParagraph(i)?this.insertBlocksBeforeEmptyBlock(e):this.insertBlocksToContent(e)}insertBlocksToRoot(t){this.currentState.apply(new it(t))}insertBlocksToContent(t){const e=this.removeSelectionRange();if(e&&e.parentBlock){const i=e.parentBlock,{startOffset:o}=this.selectionController.getCurrentRange(),s=new rt(e,o);i.apply(s),i.parent.apply(new ut(i,...t)),this.switchCaretPositionToNextElement(s.newBlock)}}insertBlocksBeforeEmptyBlock(t){const e=this.removeSelectionRange(),i=null==e?void 0:e.parentBlock;i&&(i.parent.apply(new at(i,...t)),this.switchCaretPositionToNextElement(i))}parsePastedElements(t){let e=t.dataTransfer.getData("text/html");if(!e){const i=t.dataTransfer.getData("text/plain");e=this.parsePlainText(i)}const i=document.createElement("div");return i.innerHTML=e,this.elementToDTOProcessor.process(Array.from(i.childNodes)).filter(Boolean).map((t=>t.toDto())).filter(Boolean)}switchCaretPositionToNextElement(t){t&&t.nodes&&this.selectionController.enqueueSelectionRangeFutureState(t.nodes[0],0)}parsePlainText(t){return t.split("\n").map((t=>`<span>${t}</span>`)).join("<span>\n</span>")}}var ri=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ci extends l{constructor(){super(...arguments),this.insertTextHandler=new Ne,this.insertParagraphHandler=new Pe,this.insertLineBreakHandler=new Ue,this.deleteContentHandler=new _e,this.insertPasteHandler=new ni,this.handleUserInputAction=t=>{const e=t.inputType;if(t.preventDefault(),this.initValueIfEmpty(),"insertCompositionText"===e||this.isFocusNodeNonEditable())return;this.insertCompositionTextController.removeObserver();let i=!1;switch(e){case"insertParagraph":i=!0,this.insertParagraphHandler.execute(this.value,this.selectionController,this.host,t);break;case"insertText":i=!0,this.insertTextHandler.execute(this.value,this.selectionController,this.host,t);break;case"insertLineBreak":i=!0,this.insertLineBreakHandler.execute(this.value,this.selectionController,this.host,t);break;case"deleteContentBackward":i=!0,this.deleteContentHandler.execute(this.value,this.selectionController,this.host,t);break;case"insertFromPaste":i=!0,this.insertPasteHandler.execute(this.value,this.selectionController,this.host,t)}i&&this.valueController.flushChanges(this.value)}}addActionListener(){const t=this.getEditableElementRef();t&&(t.addEventListener("beforeinput",this.handleUserInputAction),t.addEventListener("drop",this.preventDropEvent))}removeActionListener(){const t=this.getEditableElementRef();t&&(t.removeEventListener("beforeinput",this.handleUserInputAction),t.removeEventListener("drop",this.preventDropEvent))}getEditableElementRef(){return this.editableElementRef||(this.editableElementRef=this.vegaRichTextEditorRenderer.getRTEEditableElementRef()),this.editableElementRef}preventDropEvent(t){t.preventDefault()}initValueIfEmpty(){if(!this.value){const t=vt();this.valueController.flushChanges(Ct.fromJSON([{id:t,type:"paragraph",nodes:[{id:`${t}1`,type:"text",text:""}]}]))}}isFocusNodeNonEditable(){const{startContainer:t,endContainer:e}=this.selectionController.getCurrentRange(),i=this.selectionController.getSelectedNodes();if(t&&t===e&&0===i.length){const e=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;return e&&e.classList.contains(dt.CODE_BLOCK_PLACEHOLDER_CLASS_NAME)}return!1}}ri([r()],ci.prototype,"host",void 0),ri([r()],ci.prototype,"value",void 0),ri([r()],ci.prototype,"valueController",void 0),ri([r()],ci.prototype,"vegaRichTextEditorRenderer",void 0),ri([r()],ci.prototype,"selectionController",void 0),ri([r()],ci.prototype,"insertCompositionTextController",void 0),ri([c("componentDidLoad")],ci.prototype,"addActionListener",null),ri([c("disconnectedCallback")],ci.prototype,"removeActionListener",null);class li extends Q{constructor(t,e,i){super(),this.isFlushable=!0,this.type=tt.INSERT_IMAGE_TO_BLOCK,this.splitPointNode=t,this.startOffsetOfNode=e,this.imageBlockToBeInserted=i}}var ai=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class hi extends l{insertImageToCaretPosition(t){const e=this.selectionController.getSelectedBlocks(),i=new jt(vt()),o=new Z(vt(),t,i);if(o.apply(new H("md","")),i.apply(new it([o])),e.length<1||this.value.blocks.length<1)this.value.apply(new it([i])),this.valueController.flushChanges(this.value);else{const{startOffset:t}=this.selectionController.getCurrentRange(),o=this.selectionController.getSelectedNodes();e[0].apply(new li(o[0],t,i))}return this.updateCaretPosition(o),o}registerObserver(){this.registerImageSelectedObserver()}unRegisterObserver(){this.removeImageSelectedObserver()}updateCaretPosition(t){this.selectionController.enqueueSelectionRangeFutureState(t,1)}registerImageSelectedObserver(){const t=this.vegaRichTextEditorRenderer.getRichTextContentRef();t&&(ft.addUniqueObserverToNode(t,k,(t=>{const e=this.selectionController.getCurrentRange();if(!e||e.startContainer!==t.host||0!==e.startOffset){const e=pt.getEntityByDOM(t.host.querySelector("img"));this.selectionController.enqueueSelectionRangeFutureState(e,0,e,0,!0)}})),ft.addUniqueObserverToNode(t,S,(t=>{const e=this.selectionController.getCurrentRange();e&&e.startContainer===t.host&&1===e.startOffset||this.selectionController.enqueueSelectionRangeFutureState(t.host,1,t.host,1,!0)})))}removeImageSelectedObserver(){const t=this.vegaRichTextEditorRenderer.getRichTextContentRef();t&&(ft.removeUniqueObserverFromNode(t,k),ft.removeUniqueObserverFromNode(t,S))}}ai([r()],hi.prototype,"selectionController",void 0),ai([r()],hi.prototype,"value",void 0),ai([r()],hi.prototype,"valueController",void 0),ai([r()],hi.prototype,"vegaRichTextEditorRenderer",void 0),ai([c("componentDidLoad")],hi.prototype,"registerObserver",null),ai([c("disconnectedCallback")],hi.prototype,"unRegisterObserver",null);var di=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ui extends l{constructor(){super(...arguments),this.doFocusOnLastTextNode=async t=>{this.setCaretRangeToNodeEnd(pt.getDOMByEntity(t.getLastNode()).firstChild),await this.vegaRichTextEditorRenderer.getRichTextContentRef().vegaFocus()}}async focusOnLastTextNode(t){const e=this.value.blocks[this.value.blocks.length-1];if(e instanceof F&&!(null==t?void 0:t.newLine))await this.doFocusOnLastTextNode(e);else{const t=F.from({id:vt(),type:"paragraph",nodes:[{id:vt(),type:"text",text:""}]});e.parent.apply(new ut(e,t)),await this.valueController.flushChanges(this.value),await this.doFocusOnLastTextNode(t)}}setCaretRangeToNodeEnd(t){const e=new Range;e.setStart(t,t.nodeValue.length),this.selectionController.setSelectionRange(e)}}di([r()],ui.prototype,"vegaRichTextEditorRenderer",void 0),di([r()],ui.prototype,"selectionController",void 0),di([r()],ui.prototype,"valueController",void 0),di([r()],ui.prototype,"value",void 0);var pi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class fi extends l{connectedCallback(){this.observer=new zt(this.isAcceptObserver.bind(this),(t=>{L.getTextNodeElements().forEach(((e,i)=>{i.style.color=t?e.textColor.dark:e.textColor.light}))})),f.register(Lt,this.observer)}disconnectResizeObserver(){f.unregister(Lt,this.observer)}isAcceptObserver(){return!0}}pi([c("connectedCallback")],fi.prototype,"connectedCallback",null),pi([c("disconnectedCallback")],fi.prototype,"disconnectResizeObserver",null);var vi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class mi extends l{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.observerOptions={characterData:!0,characterDataOldValue:!0,subtree:!0,childList:!0},this.updateTextFromDom=t=>{let e=!1;!1!==this.insertCompositionTextEndFlag&&t.forEach((t=>{const{target:i,oldValue:o}=t;if(i.nodeType===Node.TEXT_NODE&&i.parentElement){const t=pt.getEntityByDOM(i.parentElement),s=i.textContent;t instanceof B?e=this.updateCurrentNodeText(t,s,o):s&&(i.parentElement.removeChild(i),e=!0)}})),e&&this.valueController.flushChanges(this.value)},this.handleObserver=t=>{t.every((t=>"characterData"===t.type))&&this.updateTextFromDom(t)},this.handleCompositionStart=()=>{this.insertCompositionTextEndFlag=!1,f.notify(v.getSubject(this.host,j),{host:this.host,detail:!0})},this.handleCompositionEnd=t=>{this.insertCompositionTextEndFlag=!0;const e=t.data;e&&this.dispatchInsertTextEvent(e)}}initMutationObserver(){if(this.mutationObserver){const t=this.getEditableElementRef();t&&(this.mutationObserver.disconnect(),this.mutationObserver.observe(t,this.observerOptions))}}removeObserver(){this.mutationObserver&&this.mutationObserver.disconnect()}isComposing(){return!this.insertCompositionTextEndFlag}addCompositionTextEventListener(){const t=this.getEditableElementRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd)),this.mutationObserver=new MutationObserver(this.handleObserver),this.initMutationObserver()}removeCompositionTextEventListener(){const t=this.getEditableElementRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd)),this.removeObserver()}reConnectObserver(){this.initMutationObserver()}appendLineBreakNode(t){const e=t.parentBlock,i=e.nodes.indexOf(t);if(e.nodes[i+1]){const o=t.cloneWithText("\n");e.apply(new Me(e.nodes[i+1],o))}}updateCurrentNodeText(t,e,i){const o=this.removeZeroWidthSpace(e.replace(/(\n)$/,""));if(t.text!==o){const{startOffset:s}=this.selectionController.getCurrentRange(),n="\n"===t.text;t.apply(new st(o)),n&&this.appendLineBreakNode(t);const r=Math.min(o.length,s-(i?i.length-e.length:0));return this.selectionController.enqueueSelectionRangeFutureState(t,Math.max(0,r)),!0}}getEditableElementRef(){return this.editableElementRef||(this.editableElementRef=this.vegaRichTextEditorRenderer.getRTEEditableElementRef()),this.editableElementRef}removeZeroWidthSpace(t){return t.startsWith(ot)?t.slice(ot.length):t.endsWith(ot)?t.slice(0,t.length-ot.length):t}dispatchInsertTextEvent(t){const e=new CustomEvent("beforeinput");e.data=t,e.inputType="insertText",this.editableElementRef.dispatchEvent(e)}}vi([r()],mi.prototype,"selectionController",void 0),vi([r()],mi.prototype,"host",void 0),vi([r()],mi.prototype,"value",void 0),vi([r()],mi.prototype,"valueController",void 0),vi([r()],mi.prototype,"userInputController",void 0),vi([r()],mi.prototype,"vegaRichTextEditorRenderer",void 0),vi([c("componentDidLoad")],mi.prototype,"addCompositionTextEventListener",null),vi([c("disconnectedCallback")],mi.prototype,"removeCompositionTextEventListener",null),vi([c("componentDidRender")],mi.prototype,"reConnectObserver",null);var bi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class gi extends l{constructor(){super(...arguments),this.deleteActionProcess=t=>{const e=this.selectionController.getCurrentRange(),{startContainer:i,endContainer:o,startOffset:s,endOffset:n}=e;if(i!==o||s!==n){const s=this.removeSelectionRange();!(!t||!t.detail)&&t.detail&&this.mergeRangeStartAndEnd(i,o),this.selectionController.enqueueSelectionRangeFutureState(s,e.startOffset)}}}addDeleteObserver(){ft.addUniqueObserverToNode(this.host,j,this.deleteActionProcess)}removeDeleteObserver(){ft.removeUniqueObserverFromNode(this.host,j)}removeSelectionRange(){const t=this.selectionController.getCurrentRange(),e=this.selectionController.getSelectedNodes(),{endOffset:i,startOffset:o}=t,s=e[0],n=e[e.length-1];if(e.length>1&&e.filter((t=>t instanceof M?t!==s:"IMAGE"!==t.type?t!==s&&t!==n:t!==s&&(t!==n||t===n&&0!==i))).forEach((t=>{t.parentBlock.apply(new ct(t))})),this.removeRangeStartAndEndSelectedText(),s instanceof Z&&1!==o&&(n!==s||0!==i)){if(1===s.parentBlock.nodes.length){const t=this.createEmptyParagraph();return s.parentBlock.parent.apply(new at(s.parentBlock,t)),s.parentBlock.apply(new ct(s)),t.nodes[0]}if(s===s.parentBlock.nodes[0])return s.parentBlock.apply(new ct(s)),s.parentBlock.nodes[0]}else if(s instanceof M){const t=this.createEmptyParagraph();return s.parentBlock.parent.apply(new at(s.parentBlock,t)),s.parentBlock.apply(new ct(s)),t.nodes[0]}return s}removeRangeStartAndEndSelectedText(){const t=this.selectionController.getSelectedNodes(),e=this.selectionController.getCurrentRange();t[0]instanceof B&&t[0].apply(new De("",e)),t.length>1&&t[t.length-1]instanceof B&&t[t.length-1].apply(new De("",e))}createEmptyParagraph(){const t=new F(vt(),"paragraph"),e=new B(`${t.id}1`,"",t);return t.apply(new it([e])),t}mergeRangeStartAndEnd(t,e){if(t!==e&&t.nodeType===Node.TEXT_NODE&&e.nodeType===Node.TEXT_NODE){const t=this.selectionController.getSelectedNodes(),e=t[0],i=t[t.length-1];if(e&&e.parentBlock&&i&&i.parentBlock){const t=i.parentBlock;this.shouldMergeTextNode(e,i)&&(e.apply(new st(e.text+i.text)),e.parentBlock===i.parentBlock?e.parentBlock.apply(new ct(i)):i.parentBlock.apply(new ct(i.parentBlock.nodes[0]))),e instanceof B&&i instanceof B&&e.parentBlock!==i.parentBlock&&(e.parentBlock.apply(new it(t.nodes)),t.nodes=[]),t.nodes.length<1&&t.parent.apply(new ct(t))}}}shouldMergeTextNode(t,e){const{annotations:i}=t.toJSON(),{annotations:o}=e.toJSON();return t instanceof B&&e instanceof B&&JSON.stringify(i)===JSON.stringify(o)}}bi([r()],gi.prototype,"host",void 0),bi([r()],gi.prototype,"selectionController",void 0),bi([r()],gi.prototype,"value",void 0),bi([c("connectedCallback")],gi.prototype,"addDeleteObserver",null),bi([c("disconnectedCallback")],gi.prototype,"removeDeleteObserver",null);var xi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class wi extends St{constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.vegaRichTextEditorRenderer.getRTEEditableElementRef()],this.getIneffectiveTargets=()=>{const t=this.vegaRichTextEditorRenderer.getRTEEditableElementRef();let e=[];return t&&(e=Array.from(t.querySelectorAll(".code-block-container"))),e}}registerInitState(){this.value&&this.registerHistory(new ze(this.value,new kt(this.selectionController.getCurrentRange())),!0)}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop().clone();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){if(this.redoStack.length>0){const t=this.redoStack.pop().clone();this.undoStack.push(t),await this.restoreState(t)}}async restoreState(t){const{content:e,selection:i}=t.clone();this.selectionController.setSelectionState(i),await this.valueController.flushChanges(e,!1)}}xi([r()],wi.prototype,"host",void 0),xi([r()],wi.prototype,"vegaRichTextEditorRenderer",void 0),xi([r()],wi.prototype,"valueController",void 0),xi([r()],wi.prototype,"value",void 0),xi([r()],wi.prototype,"selectionController",void 0),xi([c("componentDidLoad")],wi.prototype,"registerInitState",null);class Ci extends Q{constructor(t){super(),this.type=tt.TRANSFORM_TO_CODE_BLOCK,this.selectedBlocks=t}}var yi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ri extends T{constructor(){super({icon:"rectangle-code",tooltip:{text:"Code Block"}})}onClick(){if(!this.isSelected()){const t=this.selectionController.getSelectedBlocks(),e=t[0].parent,i=new Ci(t);e.apply(i),this.valueController.flushChanges(this.value),this.selectionController.enqueueSelectionRangeFutureState(i.newCodeBlock.nodes[0],0)}}isSelected(){const t=this.selectionController.getSelectedBlocks();return!(!t.length||!t.every((t=>"code-block"===t.type)))}isDisabled(){const t=this.selectionController.getSelectedBlocks();return super.isDisabled()||t.some((t=>"image"===t.type||"list-item"===t.type))}}E.register({"rectangle-code":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill=\'currentColor\' d="M320.1 175L384.1 239C394.3 248.4 394.3 263.6 384.1 272.1L320.1 336.1C311.6 346.3 296.4 346.3 287 336.1C277.7 327.6 277.7 312.4 287 303L334.1 256L287 208.1C277.7 199.6 277.7 184.4 287 175C296.4 165.7 311.6 165.7 320.1 175V175zM177.9 256L224.1 303C234.3 312.4 234.3 327.6 224.1 336.1C215.6 346.3 200.4 346.3 191 336.1L127 272.1C117.7 263.6 117.7 248.4 127 239L191 175C200.4 165.7 215.6 165.7 224.1 175C234.3 184.4 234.3 199.6 224.1 208.1L177.9 256zM448 32C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96C0 60.65 28.65 32 64 32H448zM448 80H64C55.16 80 48 87.16 48 96V416C48 424.8 55.16 432 64 432H448C456.8 432 464 424.8 464 416V96C464 87.16 456.8 80 448 80z"/></svg>'}}),yi([r()],Ri.prototype,"selectionController",void 0),yi([r()],Ri.prototype,"valueController",void 0),yi([r()],Ri.prototype,"value",void 0);class ji extends Ot{constructor(){super(1),this.focusNodeOffset=0,this.doTask=async()=>{await this.focusTheCodeBlock(this.shouldFocusNode)}}enqueueSelectionRangeFutureState(t,e,i){this.shouldFocusNode=t,this.focusNodeOffset=e,super.enqueueTheTaskIntoQueue(i)}isCodeBlockSelected(t,e){const i=pt.getDOMByEntity(t.nodes[0]);return t.isSelected()||i&&e.intersectsNode(i.nextSibling)&&e.intersectsNode(i.previousSibling)}async focusTheCodeBlock(t){await Promise.resolve();const e=pt.getDOMByEntity(t);e&&e.doFocus()}}var ki=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Si=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.vegaImageInserted=s(this,"vegaImageInserted",7),this.imageInserted=s(this,"imageInserted",7),this.globalSlimmers={},this.translationSlimmer=new Pt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.formFieldController=new bt({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new Dt:null}],validationRulesName:"validationRules",defaultValue:null,attributeGetter:t=>this[t],inputContainerGetter:()=>this.vegaRichTextEditorRenderer.getRichTextContainerRef(),touchableAreaGetter:()=>[this.vegaRichTextEditorRenderer.getRichTextContentRef()]}),this.changeEventEmitter=gt(Si,b),this.vegaRichTextEditorRenderer=new Kt,this.valueController=new Be,this.selectionController=new Tt,this.focusController=new ui,this.darkModeStateControllerSlimmer=new Bt,this.toolbarRenderer=new qt,this.clearStyleToolbarButtonSlimmer=new ee,this.boldToolbarButtonSlimmer=new $t,this.italicToolbarButtonSlimmer=new Xt,this.underlineToolbarButtonSlimmer=new Zt,this.textColorToolbarButtonSlimmer=new z,this.textStylesToolbarButtonSlimmer=new te,this.codeToolbarButtonSlimmer=new ie,this.strikethroughToolbarButtonSlimmer=new se,this.imageToolbarButtonSlimmer=new de,this.linkToolbarButtonSlimmer=new ne,this.moreIndentToolbarButtonSlimmer=new ce,this.lessIndentToolbarButtonSlimmer=new le,this.bulletsNumbersToolbarButtonSlimmer=new xe,this.horizontalAlignmentToolbarButtonSlimmer=new Le,this.codeBlockToolbarButtonSlimmer=new Ri,this.placeholderNotifySlimmer=xt(Si,"placeholder","watchPlaceholder"),this.disabledNotifySlimmer=xt(Si,"richTextContentEditable","watchRichTextContentEditable"),this.richTextContentController=new Ie(this),this.userInputController=new ci,this.insertImageController=new hi,this.insertCompositionTextController=new mi,this.imageInsertedEventEmitter=gt(Si,g),this.changeEventPreventSlimmer=new Nt([b],(()=>this.vegaRichTextEditorRenderer.getRichTextWrapperRef())),this.textNodeColorController=new fi,this.deleteSelectedNodesController=new gi,this.historyController=new wi,this.internalCodeBlockSelectionController=new ji,this.richTextContentEditable=!0,this.selectionMap=new Map,this.isInDarkMode=Ft.isDarkMode(),this.label="",this.required=!1,this.placeholder="",this.disabled=!1,this.hint="",this.rows=4,this.value=Ct.createEmptyContent(),this.toolbarItems=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]],this.isValid=null,this.autoValidation=!0,this.validationRules=[]}watchRichTextContentEditable(){}watchPlaceholder(){}watchDisabled(){this.richTextContentController.syncRichTextContentEditable()}watchValueUpdate(){}watchValidationRules(){}componentWillLoad(){this.richTextContentController.syncRichTextContentEditable()}render(){return u(this.vegaRichTextEditorRenderer.render(),this.host)}get host(){return n(this)}static get watchers(){return{richTextContentEditable:["watchRichTextContentEditable"],placeholder:["watchPlaceholder"],disabled:["watchDisabled"],value:["watchValueUpdate"],validationRules:["watchValidationRules"]}}};ki([d()],Si.prototype,"globalSlimmers",void 0),ki([a()],Si.prototype,"translationSlimmer",void 0),ki([a()],Si.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ki([a()],Si.prototype,"formFieldController",void 0),ki([a()],Si.prototype,"changeEventEmitter",void 0),ki([a()],Si.prototype,"vegaRichTextEditorRenderer",void 0),ki([a()],Si.prototype,"valueController",void 0),ki([a()],Si.prototype,"selectionController",void 0),ki([a()],Si.prototype,"focusController",void 0),ki([a()],Si.prototype,"darkModeStateControllerSlimmer",void 0),ki([a()],Si.prototype,"toolbarRenderer",void 0),ki([a()],Si.prototype,"clearStyleToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"boldToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"italicToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"underlineToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"textColorToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"textStylesToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"codeToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"strikethroughToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"imageToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"linkToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"moreIndentToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"lessIndentToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"bulletsNumbersToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"horizontalAlignmentToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"codeBlockToolbarButtonSlimmer",void 0),ki([a()],Si.prototype,"placeholderNotifySlimmer",void 0),ki([a()],Si.prototype,"disabledNotifySlimmer",void 0),ki([a()],Si.prototype,"richTextContentController",void 0),ki([a()],Si.prototype,"userInputController",void 0),ki([a()],Si.prototype,"insertImageController",void 0),ki([a()],Si.prototype,"insertCompositionTextController",void 0),ki([a()],Si.prototype,"imageInsertedEventEmitter",void 0),ki([a()],Si.prototype,"changeEventPreventSlimmer",void 0),ki([a()],Si.prototype,"textNodeColorController",void 0),ki([a()],Si.prototype,"deleteSelectedNodesController",void 0),ki([a()],Si.prototype,"historyController",void 0),ki([a()],Si.prototype,"internalCodeBlockSelectionController",void 0),Si.style=':host{display:block}:host vega-field-label{margin-bottom:8px}:host vega-text{margin-bottom:16px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;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-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .rich-text-editor-container{display:flex;box-sizing:content-box;position:relative;box-sizing:content-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));margin-top:12px;overflow:auto;resize:vertical;padding-top:12px;padding-right:16px;padding-bottom:32px;padding-left:16px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .rich-text-editor-container{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 .rich-text-editor-container{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 .rich-text-editor-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .rich-text-editor-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .rich-text-editor-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}:host .rich-text-editor-container.disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));cursor:not-allowed}:host .rich-text-editor-container.disabled:hover,:host .rich-text-editor-container.disabled:focus-within{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host .rich-text-editor-container.disabled:focus-within{outline:none}:host .rich-text-editor-container.disabled vega-rich-text-content{pointer-events:none;opacity:0.35}:host .rich-text-editor-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .rich-text-editor-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .rich-text-editor-container.error:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}:host .rich-text-editor-container .text-editor-counter{position:absolute;bottom:8px;right:8px;display:flex;padding-left:4px;padding-right:4px;padding-top:2px;padding-bottom:2px;border-radius:4px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));background-color:rgba(var(--v-bg-textarea-count, 4, 4, 28, 0.6))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .rich-text-editor-container .text-editor-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .rich-text-editor-container .text-editor-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .rich-text-editor-container .text-editor-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .rich-text-editor-container .text-editor-counter.counter-exceed-max-length{background-color:rgba(var(--v-bg-textarea-counter-exceed-max-length, 214, 46, 81))}.toolbar-btn-group{display:flex;justify-content:center;align-items:center}.toolbar-btn-group>*:not(:first-child):not(:last-child) ::part(rich-text-editor-toolbar-button){border-radius:0px}.toolbar-btn-group>*:first-child:not(:last-child) ::part(rich-text-editor-toolbar-button){border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0px;border-bottom-right-radius:0px}.toolbar-btn-group>*:last-child:not(:first-child) ::part(rich-text-editor-toolbar-button){border-top-left-radius:0px;border-bottom-left-radius:0px;border-top-right-radius:4px;border-bottom-right-radius:4px}.toolbar-btn-group>*:not(:first-child) ::part(rich-text-editor-toolbar-button){margin-left:-1px}.toolbar-btn-group .toolbar-btn-color-preview-box{display:flex;border:1px solid rgba(var(--v-border-chip, 205, 209, 211, 1));box-sizing:border-box;border-radius:4px;width:16px;height:16px;justify-content:center;align-items:center;margin-left:6px}.toolbar-btn-group .toolbar-btn-color-preview-box.disabled{opacity:0.35}.toolbar-btn-group .toolbar-btn-link-wrapper{position:relative}.toolbar-btn-group .toolbar-btn-link-wrapper vega-rich-text-link-editor{position:absolute;bottom:0;left:0;right:0}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;margin-top:12px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';var Oi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ti extends l{constructor(){super(...arguments),this.handleClick=t=>{this.disabled?t.preventDefault():this.clickEventEmitter.emit(void 0,t)}}render(){return t("button",{part:"rich-text-editor-toolbar-button",class:{"rich-text-editor-toolbar-btn":!0,"rich-text-editor-toolbar-button-disabled":this.disabled,"rich-text-editor-toolbar-button-selected":this.selected},onClick:this.handleClick,disabled:this.disabled},t("vega-flex",{gap:"size-8",justifyContent:"center",alignItems:"center"},t("vega-icon",{size:"size-16",color:this.iconColor,icon:E.getIconKey(this.icon)}),this.showArrowIcon&&t("vega-icon",{size:"size-8",color:"text-secondary",icon:E.getIconKey("chevron-down")})),t("slot",null))}}E.register({"chevron-down":Vt}),Oi([r()],Ti.prototype,"disabled",void 0),Oi([r()],Ti.prototype,"selected",void 0),Oi([r()],Ti.prototype,"showArrowIcon",void 0),Oi([r()],Ti.prototype,"icon",void 0),Oi([r()],Ti.prototype,"iconColor",void 0),Oi([r()],Ti.prototype,"clickEventEmitter",void 0);var Hi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Li=class{constructor(t){o(this,t),this.vegaClick=s(this,"vegaClick",7),this.click=s(this,"click",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.clickEventEmitter=gt(Li,x),this.eventPrevent=new Nt([x],(()=>this.host),{useCapture:!0,customPreventHandle:t=>{this.disabled&&t.stopImmediatePropagation()}}),this.renderer=new Ti,this.disabled=!1,this.selected=!1,this.showArrowIcon=!1,this.icon="",this.iconColor="text-primary"}render(){return u(t(e,null,this.renderer.render()),this.host)}get host(){return n(this)}};Hi([d()],Li.prototype,"globalSlimmers",void 0),Hi([a()],Li.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Hi([a()],Li.prototype,"clickEventEmitter",void 0),Hi([a()],Li.prototype,"eventPrevent",void 0),Hi([a()],Li.prototype,"renderer",void 0),Li.style=":host{display:inline-block}.rich-text-editor-toolbar-btn{display:flex;justify-content:center;align-items:center;border-radius:4px;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));padding-top:8px;padding-bottom:8px;padding-left:12px;padding-right:12px;cursor:pointer;position:relative;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1))}.rich-text-editor-toolbar-btn:hover{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));z-index:1}.rich-text-editor-toolbar-btn:active{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));z-index:1}.rich-text-editor-toolbar-btn:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:-1px;z-index:2}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-selected{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));z-index:1}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));cursor:not-allowed}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-disabled vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}";var zi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ei extends l{constructor(){super(...arguments),this.handleKeyDown=t=>{"Enter"===t.key&&(this.formRef.getValue().then((({alt:t})=>{this.changeEventEmitter.emit({action:"edit",payload:{size:this.size,alt:t}})})),this.popoverRef.hide())}}render(){return t("vega-popover",{style:{width:"100%"},trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,ref:t=>{this.popoverRef=t,ft.addUniqueObserverToNode(t,w,(()=>{this.selected=!0,this.notifyImageSelected(),this.formRef.setValue({alt:this.alt})})),ft.addUniqueObserverToNode(t,C,(()=>{this.currentPage=1,this.selected=!1,this.formRef.reset()}))}},t("div",{slot:"popover-content"},t("slot",null)),t("div",{slot:"popover"},this.renderImageEditor(),this.renderAltTextEditor()))}findParentContainerRef(){this.parentContainerRef=Mt(this.host,"vega-rich-text-content")}renderImageEditor(){return t("vega-box",{display:1===this.currentPage?"block":"none"},t("vega-flex",{gap:"size-12",alignItems:"center"},t("vega-font",{variant:"font-field-label-sm",color:"text-primary"},this.translationSlimmer.t("Size"),":"),t("vega-segment-control",{size:"small",segments:[{key:"sm",text:this.translationSlimmer.t("Sm")},{key:"md",text:this.translationSlimmer.t("Md")},{key:"lg",text:this.translationSlimmer.t("Lg")}],selected:this.size,ref:t=>{ft.addUniqueObserverToNode(t,b,(t=>{if(!this.selected)return;const e=t.detail;this.size=e,this.changeEventEmitter.emit({action:"edit",payload:{size:e,alt:this.alt}})}))}}),t("vega-button-group",{variant:"tertiary",size:"small",ref:t=>{ft.addUniqueObserverToNode(t,x,(t=>{"Alt Text"===t.detail?this.currentPage=2:(this.notifyImageDeleteButtonClicked(),this.changeEventEmitter.emit({action:"delete"}),this.popoverRef.hide())}))}},t("vega-button-group-item",{label:this.translationSlimmer.t("Alt Text"),itemKey:"Alt Text"}),t("vega-button-group-item",{label:this.translationSlimmer.t("Delete Image"),icon:E.getIconKey("trash-can"),iconOnly:!0,itemKey:"trash-can"}))))}renderAltTextEditor(){return t("vega-box",{display:2===this.currentPage?"block":"none"},t("vega-form",{ref:t=>this.formRef=t},t("vega-input",{"data-vega-form":"alt",style:{width:"315px"},label:this.translationSlimmer.t("Alt Text"),ref:t=>{t.doFocus()},onKeyDown:this.handleKeyDown})))}notifyImageSelected(){this.parentContainerRef&&f.notify(v.getSubject(this.parentContainerRef,k),{host:this.host})}notifyImageDeleteButtonClicked(){this.parentContainerRef&&f.notify(v.getSubject(this.parentContainerRef,S),{host:this.host})}}E.register({"trash-can":Ut}),zi([r({writable:!0})],Ei.prototype,"currentPage",void 0),zi([r({writable:!0})],Ei.prototype,"selected",void 0),zi([r()],Ei.prototype,"host",void 0),zi([r()],Ei.prototype,"alt",void 0),zi([r({writable:!0})],Ei.prototype,"size",void 0),zi([r()],Ei.prototype,"changeEventEmitter",void 0),zi([r()],Ei.prototype,"translationSlimmer",void 0),zi([c("componentDidLoad")],Ei.prototype,"findParentContainerRef",null);var Bi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ii=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new Pt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.renderer=new Ei,this.changeEventEmitter=gt(Ii,b),this.currentPage=1,this.selected=!1,this.alt="",this.size="md"}render(){return u(t(e,{class:{"rte-image-selected":this.selected}},this.renderer.render()),this.host)}get host(){return n(this)}};Bi([d()],Ii.prototype,"globalSlimmers",void 0),Bi([a()],Ii.prototype,"translationSlimmer",void 0),Bi([a()],Ii.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Bi([a()],Ii.prototype,"renderer",void 0),Bi([a()],Ii.prototype,"changeEventEmitter",void 0),Ii.style=":host{display:inline-block}:host(.rte-image-selected){outline:2px solid rgba(var(--v-border-color-tile-selected, 19, 98, 226, 1));outline-offset:-2px}";var Ai=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Mi extends l{constructor(){super(...arguments),this.handleKeyDown=t=>{"Enter"===t.key&&this.formRef.getValue().then((({text:t,url:e})=>{e.length>0&&(this.changeEventEmitter.emit({action:"link",payload:{text:t||e,url:e}}),this.popoverRef.hide())}))}}componentDidLoad(){this.updatePopoverTarget()}componentDidRender(){f.notify(v.getSubject(this.host,y),{})}watchStatusChange(){"linkEdit"===this.status&&setTimeout((()=>{this.urlInputRef.doFocus()}))}watchTargetChange(){this.updatePopoverTarget()}getPopoverRef(){return this.popoverRef}render(){return t("vega-popover",{trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,ref:t=>{this.popoverRef=t,ft.addUniqueObserverToNode(t,w,(()=>{var t,e;"linkEdit"===this.status&&this.urlInputRef.doFocus(),this.formRef.setValue({text:null===(t=this.record)||void 0===t?void 0:t.text,url:null===(e=this.record)||void 0===e?void 0:e.url})})),ft.addUniqueObserverToNode(t,C,(()=>{this.formRef.reset(),this.resetStatusAfterHide&&(this.status="editOrUnlinkSelection")}))}},t("span",{slot:"popover-content"},t("slot",null)),t("div",{slot:"popover"},this.renderLinkUnlinkContent(),this.renderLinkEditContent()))}renderLinkUnlinkContent(){return t("vega-box",{display:"editOrUnlinkSelection"===this.status?"block":"none"},t("vega-button-group",{size:"small",variant:"tertiary",ref:t=>{ft.addUniqueObserverToNode(t,x,(({detail:t})=>{switch(t){case"edit":return void(this.status="linkEdit");case"unlink":this.changeEventEmitter.emit({action:"unlink"}),this.popoverRef.hide()}}))}},t("vega-button-group-item",{label:this.translationSlimmer.t("Edit"),itemKey:"edit"}),t("vega-button-group-item",{label:this.translationSlimmer.t("Unlink"),itemKey:"unlink"})))}renderLinkEditContent(){return t("vega-box",{display:"linkEdit"===this.status?"block":"none"},t("vega-form",{ref:t=>this.formRef=t},t("vega-flex",{style:{width:"419px"},direction:"col",gap:"size-16"},t("vega-input",{"data-vega-form":"url",ref:t=>{this.urlInputRef=t},size:"small",label:this.translationSlimmer.t("URL"),onKeyDown:this.handleKeyDown}),t("vega-input",{size:"small",label:this.translationSlimmer.t("Text"),"data-vega-form":"text",onKeyDown:this.handleKeyDown}))))}updatePopoverTarget(){Wt.call(v.getSubject(this.popoverRef,O),this.target)}}Ai([r()],Mi.prototype,"host",void 0),Ai([r({writable:!0})],Mi.prototype,"status",void 0),Ai([r({writable:!0})],Mi.prototype,"record",void 0),Ai([r()],Mi.prototype,"changeEventEmitter",void 0),Ai([r()],Mi.prototype,"resetStatusAfterHide",void 0),Ai([r()],Mi.prototype,"translationSlimmer",void 0),Ai([r()],Mi.prototype,"target",void 0),Ai([c("componentDidLoad")],Mi.prototype,"componentDidLoad",null),Ai([c("componentDidRender")],Mi.prototype,"componentDidRender",null),Ai([c("watchStatusChange")],Mi.prototype,"watchStatusChange",null),Ai([c("watchTargetChange")],Mi.prototype,"watchTargetChange",null);var Di=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ni=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new Pt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.renderer=new Mi,this.changeEventEmitter=gt(Ni,b),this.status="editOrUnlinkSelection",this.resetStatusAfterHide=!0}watchStatusChange(){}watchTargetChange(){}async show(){await this.renderer.getPopoverRef().show()}render(){return u(t(e,null,this.renderer.render()),this.host)}get host(){return n(this)}static get watchers(){return{status:["watchStatusChange"],target:["watchTargetChange"]}}};Di([d()],Ni.prototype,"globalSlimmers",void 0),Di([a()],Ni.prototype,"translationSlimmer",void 0),Di([a()],Ni.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Di([a()],Ni.prototype,"renderer",void 0),Di([a()],Ni.prototype,"changeEventEmitter",void 0),Ni.style=":host{display:contents}:host vega-popover{display:inline}";export{Si as vega_rich_text_editor,Li as vega_rich_text_editor_toolbar_button,Ii as vega_rich_text_image_editor,Ni as vega_rich_text_link_editor}
@@ -1 +0,0 @@
1
- import{B as e,R as t,a as n,A as s,b as i,I as r,c as o,d as c,e as a,S as h,M as l,f as w,g as d,h as u,i as p,j as f,k as x,l as m,m as g,n as b,o as A,p as N,N as y,q as k,r as B,s as O,t as j,u as I}from"./p-3eb2d433.js";import{i as S}from"./p-b1f65b13.js";import{g as v}from"./p-37b05e0b.js";class L extends l{constructor(e,t){super(),this.type=w.BREAK_SINGLE_BLOCK,this.startContainerNode=e,this.startOffset=t}}class E extends p{constructor(e){super(e),this.type="image",this.nodes=[]}static from(e){const t=new E(e.id),{annotations:s}=e;return t.nodes=e.nodes.map((e=>n.from(e,t))),s&&Object.entries(s).forEach((([e,n])=>{const s=this.createAnnotationEntity(e,n);S(s)&&t.annotationMap.set(...s)})),t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.nodes.map((e=>e.toJSON()))})}isNotEmpty(){return this.nodes.length>0&&this.nodes.some((e=>e.url.length>0))}getLastNode(){return this.nodes[this.nodes.length-1]}createNewImageBlock(){return new E(v())}clone(){const e=new E(this.id);return e.nodes=this.nodes.map((t=>{const n=t.clone();return n.parentBlock=e,n})),e.annotationMap=super.cloneAnnotations(),e.parent=this.parent,e}}f.register(w.DELETE_BLOCK_CONTENT,E.name,new class extends e{handleAction(e,t){this.deleteNodeContent(e,t)}deleteNodeContent(e,s){const i=e.startContainerNode,r=e.startOffset;let o=this.getPreviousNode(i),c=null;if(1===r){const e=s;this.isContentFirstNode(i)&&(c=this.getNextNode(i)),1===e.nodes.length?e.parent.apply(new t(e)):e.apply(new t(i))}else{const s=o;s&&s instanceof n&&(o=this.getPreviousNode(s),s.parentBlock.apply(new t(s)),o||(e.nextNode=i))}o?e.previousNode=o:c&&(e.nextNode=c)}}),f.register(w.MERGE_TWO_BLOCKS_NODES,E.name,new x),f.register(w.DELETE_CHILD,E.name,new m),f.register(w.APPEND_CHILD_NODES,E.name,new g),f.register(w.REPLACE_CHILD_NODES,E.name,new b),f.register(w.SPLIT_BLOCK_WITH_NODE,E.name,new class extends s{handleAction(e,t){e.newBlock=this.splitImageNodes(e.splitPointNode,e.startOffsetOfNode,t)}splitImageNodes(e,t,n){const s=n.nodes.indexOf(e);if(s>-1){const e=n.nodes.slice(0,s+t),o=n.nodes.slice(s+t);n.apply(new i(e));const c=this.cloneWithNodes(o,n);return n.parent.apply(new r(n,c)),c}}cloneWithNodes(e,t){const n=t.createNewImageBlock();return n.nodes=[],n.apply(new o(e)),n}}),f.register(w.BREAK_SINGLE_BLOCK,E.name,new class extends s{handleAction(e,t){e.newBlock=this.breakSingleBlock(e.startContainerNode,e.startOffset,t)}breakSingleBlock(e,t,n){const s=c.from({id:v(),type:"paragraph",nodes:[{id:v(),type:"text",text:""}]});if(this.isCaretPositionAtImageBlockEnd(n,e,t))n.parent.apply(new r(n,s));else{if(!this.isCaretPositionAtImageBlockStart(n,e,t)){const s=new h(e,t);return n.apply(s),s.newBlock}n.parent.apply(new a(n,s))}return s}}),f.register(w.LINE_BREAK_SINGLE_BLOCK,E.name,new class extends s{handleAction(e,t){const n=new L(e.startContainerNode,e.startOffset);t.apply(n);const s=n.newBlock;s&&(e.lineBreakNode=s.nodes[0])}}),f.register(w.LINE_BREAK_MULTIPLE_BLOCKS,E.name,new class extends s{handleAction(e,t){e.lineBreakNode=this.lineBreakMultipleBlocks(e.selectedBlocks,t)}lineBreakMultipleBlocks(e,t){const n=c.from({id:v(),type:"paragraph",nodes:[{id:v(),type:"text",text:"\n"}]});t.parent.apply(new r(t,n));const s=this.concatBlocksNodes(e.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new d(v(),"\n",n)),n.apply(new o(s)),n.nodes[0]}concatBlocksNodes(e){const n=[];return e.map((e=>{"image"!==e.type&&(n.push(...e.nodes),e.parent.apply(new t(e)))})),n}}),f.register(w.INSERT_IMAGE_TO_BLOCK,E.name,new class extends s{handleAction(e,t){const n=e.splitPointNode,s=e.startOffsetOfNode,i=e.imageBlockToBeInserted;t.nodes.length<1?t.apply(new o(i.nodes)):this.isCaretPositionAtImageBlockEnd(t,n,s)?t.parent.apply(new r(t,i)):this.isCaretPositionAtImageBlockStart(t,n,s)?t.parent.apply(new a(t,i)):(t.apply(new h(n,s)),t.parent.apply(new r(t,i)))}}),f.register(w.INSERT_NODES_BEFORE,E.name,new A),f.register(w.INSERT_NODES_AFTER,E.name,new class extends u{handleAction(e,t){const n=e.referNode,s=[n,...e.nodesToBeInserted];this.replaceNodeWithNodes(t,n,s)}});class J extends c{constructor(e,t){super(e,"list-item"),this.children=[],this.children=t}static from(e){const t=new J(e.id);t.nodes=e.nodes.map((e=>d.from(e,t))),e.children&&(t.children=e.children.map((e=>{const n=V.from(e);return n.parent=t,n})));const{annotations:n}=e;return n&&Object.entries(n).forEach((([e,n])=>{const s=this.createAnnotationEntity(e,n);S(s)&&t.annotationMap.set(...s)})),t}toJSON(){var e;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(e=this.children)||void 0===e?void 0:e.map((e=>e.toJSON()))})}cloneWithNodes(e){const t=new J(v());return t.nodes=[],t.apply(new o(e)),t}getLastNode(){return this.children&&this.children.length>0?this.children[this.children.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new J(v())}clone(){var e;const t=new J(this.id);return t.nodes=this.nodes.map((e=>{const n=e.clone();return n.parentBlock=t,n})),t.annotationMap=super.cloneAnnotations(),t.children=null===(e=this.children)||void 0===e?void 0:e.map((e=>{const n=e.clone();return n.parent=t,n})),t.parent=this.parent,t}}f.register(w.DELETE_BLOCK_CONTENT,J.name,new class extends N{handleAction(e,n){const s=n.parent;this.deleteNodeContent(e,n),0===s.blocks.length&&s.parent.apply(new t(s))}}),f.register(w.LINE_BREAK_SINGLE_BLOCK,J.name,new k),f.register(w.LINE_BREAK_MULTIPLE_BLOCKS,J.name,new B),f.register(w.DELETE_CHILD,J.name,new class extends s{handleAction(e,n){n.nodes=n.nodes.filter((t=>t!==e.entityToBeRemoved)),0!==n.nodes.length||n.children&&n.children.length||n.parent.apply(new t(n))}}),f.register(w.DELETE_NEST_LIST,J.name,new class extends s{handleAction(e,t){t.children&&(t.children=t.children.length>1?t.children.filter((t=>t!==e.nestListBlockToBeRemoved)):void 0)}}),f.register(w.APPEND_CHILD_NODES,J.name,new g),f.register(w.SPLIT_BLOCK_WITH_NODE,J.name,new O),f.register(w.REPLACE_CHILD_NODES,J.name,new b),f.register(w.REPLACE_NEST_LIST,J.name,new class extends s{handleAction(e,t){e.newList.forEach((e=>{e.parent=t})),t.children=e.newList}}),f.register(w.MERGE_TWO_BLOCKS_NODES,J.name,new x),f.register(w.BREAK_SINGLE_BLOCK,J.name,new class extends s{handleAction(e,t){e.newBlock=this.breakSingleListItemBlock(e.startContainerNode,e.startOffset,t)}breakSingleListItemBlock(e,t,n){const s=n.createNewListItem(),i=this.copyInlineStyleToNewNode(e);if(s.apply(new o([i])),this.isCaretPositionAtTextBlockEnd(n,e,t))return this.breakListItemAtEnd(s,n);if(!this.isCaretPositionAtTextBlockStart(n,e,t)){const s=new h(e,t);return n.apply(s),s.newBlock}return n.parent.apply(new a(n,s)),s}breakListItemAtEnd(e,n){const s=n.parent.blocks[n.parent.blocks.length-1],i=1===n.nodes.length&&n.nodes[0].isEmpty();if(n===s&&i){const s=n.parent.parent;if("list-item"!==s.type){const i=c.from({id:v(),type:"paragraph",nodes:[]});return i.apply(new o(e.nodes)),s.apply(new r(n.parent,i)),n.parent.apply(new t(n)),i}s.parent.apply(new r(s,e)),n.parent.apply(new t(n))}else n.parent.apply(new r(n,e));return e}copyInlineStyleToNewNode(e){const t=e.cloneWithText("");return t.annotationMap.delete(y.LINK),t}}),f.register(w.INSERT_IMAGE_TO_BLOCK,J.name,new class extends s{handleAction(e,t){t.parent.apply(e)}}),f.register(w.INSERT_NODES_BEFORE,J.name,new A);class C extends s{handleAction(e,t){this.replaceBlockWithBlocks(t,e.referBlock,[...e.blocksToBeInserted,e.referBlock])}replaceBlockWithBlocks(e,t,n){e.blocks&&(n.forEach((t=>{t.parent=e})),e.blocks=e.blocks.flatMap((e=>e===t?n:e)))}}class W extends C{handleAction(e,t){this.replaceBlockWithBlocks(t,e.referBlock,[e.referBlock,...e.blocksToBeInserted])}}class M extends s{handleAction(e,t){const n=e.entityToBeAppended;t.blocks&&(n.forEach((e=>{e.parent=t})),t.blocks=t.blocks.concat(n))}}class R extends l{constructor(e){super(),this.type=w.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=e}}class T extends s{handleAction(e,t){const n=e.entityToBeRemoved;t.blocks&&(t.blocks=t.blocks.filter((e=>e!==n)))}}class V extends p{constructor(e,t){super(e),this.type="bullet-list",this.blocks=[],this.type=t}static from(e){const t=new V(e.id,e.type);return t.blocks=e.blocks.map((e=>{const n=J.from(e);return n.parent=t,n})),t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.blocks.map((e=>e.toJSON()))})}isNotEmpty(){return this.blocks.length>0}getLastNode(){return this.blocks[this.blocks.length-1].getLastNode()}clone(){const e=new V(this.id,this.type);return e.blocks=this.blocks.map((t=>{const n=t.clone();return n.parent=e,n})),e.annotationMap=super.cloneAnnotations(),e.parent=this.parent,e}}f.register(w.DELETE_CHILD,V.name,new class extends T{handleAction(e,n){super.handleAction(e,n);const s=n.parent;0===n.blocks.length&&s&&s.apply("list-item"===s.type?new R(n):new t(n))}}),f.register(w.INSERT_BLOCKS_BEFORE,V.name,new C),f.register(w.INSERT_BLOCKS_AFTER,V.name,new W),f.register(w.APPEND_CHILD_NODES,V.name,new M),f.register(w.TRANSFORM_LIST_BLOCK,V.name,new class extends s{handleAction(e,n){const s=e.selectedBlocks,i=n.parent.createList(e.listType);if(s.every((e=>e.parent===n)))i.apply(new o(n.blocks)),n.parent.apply(new r(n,i)),n.parent.apply(new t(n)),s.forEach((e=>e.nodes.map((e=>e.apply(new j)))));else{const s=e.selectedBlocks.map((e=>n.parent.toListItem(e)));i.apply(new o(s)),n.parent.apply(new r(n,i)),e.selectedBlocks.forEach((e=>{e.parent.apply(new t(e))})),0===n.blocks.length&&n.parent.apply(new t(n))}}}),f.register(w.TRANSFORM_PARAGRAPH_BLOCK,V.name,new class extends s{handleAction(e,n){let s=!1,i=!1;const c=e.selectedBlocks,h=c.map((e=>(e.nodes.map((e=>e.apply(new j))),e===n.blocks[0]&&(s=!0),e===n.blocks[n.blocks.length-1]&&(i=!0),this.toParagraph(e))));if(s)n.parent.apply(new a(n,...h));else if(i)n.parent.apply(new r(n,...h));else{const e=n.blocks.indexOf(c[0]),s=n.blocks.indexOf(c[c.length-1]),i=n.parent.createList(n.type);i.apply(new o(n.blocks.slice(0,e)));const r=n.parent.createList(n.type);r.apply(new o(n.blocks.slice(s+1))),n.parent.apply(new a(n,i,...h,r)),n.parent.apply(new t(n))}c.map((e=>{n.apply(new t(e))})),0===n.blocks.length&&n.parent.apply(new t(n))}toParagraph(e){const t=new c(v(),"paragraph");return t.apply(new o(e.nodes)),t.annotationMap=e.annotationMap,t}}),f.register(w.INSERT_IMAGE_TO_BLOCK,V.name,new class extends s{handleAction(e,t){t.parent.apply("list-item"!==t.parent.type?new r(t,e.imageBlockToBeInserted):e)}});class q{constructor(e){e.forEach((e=>{e.parent=this})),this.blocks=e}static fromJSON(e){const t=e.map((e=>{switch(e.type){case"paragraph":case"title":case"subtitle":case"heading-1":case"heading-2":case"heading-3":return c.from(e);case"image":return E.from(e);case"bullet-list":case"number-list":return V.from(e);case"code-block":return I.from(e);default:throw new Error(`[Vega] Unknown block type: ${e.type}`)}}));return new q(t)}static createEmptyContent(){return q.fromJSON([{id:v(),type:"paragraph",nodes:[{id:v(),type:"text",text:""}]}])}clone(e=!1){return new q(e?this.blocks.map((e=>e.clone())):[...this.blocks])}toJSON(){return this.blocks.map((e=>e.toJSON()))}apply(e){f.executeTheStrategy(e,this)}toListItem(e){e.nodes.map((e=>e.apply(new j)));const t=new J(v());return t.apply(new o(e.nodes)),t.annotationMap=e.annotationMap,t}createList(e){return new V(v(),e)}findNodeById(e){return this.findNodeInBlocksById(e,this.blocks)}findNodeInBlocksById(e,t){for(const n of t){if("nodes"in n)for(const t of n.nodes)if(t.id===e)return t;if(n instanceof J&&n.children)for(const t of n.children){const n=this.findNodeInBlocksById(e,t.blocks);if(n)return n}if(n instanceof V&&n.blocks){const t=this.findNodeInBlocksById(e,n.blocks);if(t)return t}}return null}}f.register(w.DELETE_CHILD,q.name,new T),f.register(w.APPEND_CHILD_NODES,q.name,new M),f.register(w.INSERT_BLOCKS_BEFORE,q.name,new C),f.register(w.INSERT_BLOCKS_AFTER,q.name,new W),f.register(w.TRANSFORM_TO_CODE_BLOCK,q.name,new class extends s{handleAction(e,t){const n=e.selectedBlocks,s=new I(v(),this.getCodeContent(n),"plainText");t.apply(new a(n[0],s)),e.newCodeBlock=s,this.removeSelectBlocks(n,t)}getCodeContent(e){return e.filter((e=>"image"!==e.type&&"list-item"!==e.type)).map((e=>e.nodes.map((e=>e.text)).join(""))).join("\n")}removeSelectBlocks(e,n){for(let s=0;s<e.length;s++)n.apply(new t(e[s]))}});export{L as B,E as R,q as V,J as a,V as b}