@forgedevstack/ink 1.1.8 → 1.1.9

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 (116) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/components/InkEditor/InkEditor.cjs +1 -1
  3. package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
  4. package/dist/components/InkEditor/InkEditor.js +845 -830
  5. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -1
  6. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -1
  7. package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +96 -82
  8. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.cjs +1 -0
  9. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.cjs +1 -0
  10. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts +7 -0
  11. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts.map +1 -0
  12. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.js +9 -0
  13. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts +4 -0
  14. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts.map +1 -0
  15. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +82 -0
  16. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts +8 -0
  17. package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts.map +1 -0
  18. package/dist/components/InkEditor/components/PresenceStack/index.d.ts +3 -0
  19. package/dist/components/InkEditor/components/PresenceStack/index.d.ts.map +1 -0
  20. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -0
  21. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.cjs +1 -0
  22. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts +7 -0
  23. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts.map +1 -0
  24. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.js +10 -0
  25. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts +4 -0
  26. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts.map +1 -0
  27. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +65 -0
  28. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts +6 -0
  29. package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts.map +1 -0
  30. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts +3 -0
  31. package/dist/components/InkEditor/components/RemoteCursors/index.d.ts.map +1 -0
  32. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -1
  33. package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +35 -34
  34. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -1
  35. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -1
  36. package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +39 -55
  37. package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts +3 -0
  38. package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts.map +1 -0
  39. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.cjs +1 -0
  40. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts +13 -0
  41. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts.map +1 -0
  42. package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.js +39 -0
  43. package/dist/components/InkEditor/components/index.d.ts +4 -0
  44. package/dist/components/InkEditor/components/index.d.ts.map +1 -1
  45. package/dist/components/InkTabs/InkTabs.cjs +1 -0
  46. package/dist/components/InkTabs/InkTabs.d.ts +4 -0
  47. package/dist/components/InkTabs/InkTabs.d.ts.map +1 -0
  48. package/dist/components/InkTabs/InkTabs.js +104 -0
  49. package/dist/components/InkTabs/index.d.ts +2 -0
  50. package/dist/components/InkTabs/index.d.ts.map +1 -0
  51. package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -0
  52. package/dist/components/InkWorkspace/InkWorkspace.d.ts +4 -0
  53. package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -0
  54. package/dist/components/InkWorkspace/InkWorkspace.js +317 -0
  55. package/dist/components/InkWorkspace/components/WorkspaceIcons.cjs +1 -0
  56. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts +11 -0
  57. package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts.map +1 -0
  58. package/dist/components/InkWorkspace/components/WorkspaceIcons.js +39 -0
  59. package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -0
  60. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts +30 -0
  61. package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts.map +1 -0
  62. package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +72 -0
  63. package/dist/components/InkWorkspace/index.d.ts +4 -0
  64. package/dist/components/InkWorkspace/index.d.ts.map +1 -0
  65. package/dist/components/index.d.ts +2 -0
  66. package/dist/components/index.d.ts.map +1 -1
  67. package/dist/constants/collab.const.cjs +1 -0
  68. package/dist/constants/collab.const.d.ts +20 -0
  69. package/dist/constants/collab.const.d.ts.map +1 -0
  70. package/dist/constants/collab.const.js +54 -0
  71. package/dist/constants/index.d.ts +2 -0
  72. package/dist/constants/index.d.ts.map +1 -1
  73. package/dist/constants/numbers.cjs +1 -1
  74. package/dist/constants/numbers.js +42 -37
  75. package/dist/constants/workspace.const.cjs +1 -0
  76. package/dist/constants/workspace.const.d.ts +24 -0
  77. package/dist/constants/workspace.const.d.ts.map +1 -0
  78. package/dist/constants/workspace.const.js +23 -0
  79. package/dist/hooks/index.d.ts +2 -0
  80. package/dist/hooks/index.d.ts.map +1 -1
  81. package/dist/hooks/useInkCollaboration.cjs +1 -0
  82. package/dist/hooks/useInkCollaboration.d.ts +4 -0
  83. package/dist/hooks/useInkCollaboration.d.ts.map +1 -0
  84. package/dist/hooks/useInkCollaboration.js +86 -0
  85. package/dist/index.cjs +1 -1
  86. package/dist/index.d.ts +5 -3
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +150 -135
  89. package/dist/plugins/theme/inkTheme.cjs +1 -1
  90. package/dist/plugins/theme/inkTheme.js +19 -22
  91. package/dist/styles.css +1 -1
  92. package/dist/types/collab.types.d.ts +55 -0
  93. package/dist/types/collab.types.d.ts.map +1 -0
  94. package/dist/types/index.d.ts +2 -0
  95. package/dist/types/index.d.ts.map +1 -1
  96. package/dist/types/ink.types.d.ts +4 -0
  97. package/dist/types/ink.types.d.ts.map +1 -1
  98. package/dist/types/workspace.types.d.ts +54 -0
  99. package/dist/types/workspace.types.d.ts.map +1 -0
  100. package/dist/utils/collab.utils.cjs +1 -0
  101. package/dist/utils/collab.utils.d.ts +5 -0
  102. package/dist/utils/collab.utils.d.ts.map +1 -0
  103. package/dist/utils/collab.utils.js +32 -0
  104. package/dist/utils/collab.utils.test.d.ts +2 -0
  105. package/dist/utils/collab.utils.test.d.ts.map +1 -0
  106. package/dist/utils/index.d.ts +2 -0
  107. package/dist/utils/index.d.ts.map +1 -1
  108. package/dist/utils/ink.brand.test.d.ts +2 -0
  109. package/dist/utils/ink.brand.test.d.ts.map +1 -0
  110. package/dist/utils/workspace.utils.cjs +1 -0
  111. package/dist/utils/workspace.utils.d.ts +5 -0
  112. package/dist/utils/workspace.utils.d.ts.map +1 -0
  113. package/dist/utils/workspace.utils.js +26 -0
  114. package/dist/utils/workspace.utils.test.d.ts +2 -0
  115. package/dist/utils/workspace.utils.test.d.ts.map +1 -0
  116. package/package.json +1 -1
@@ -1,191 +1,196 @@
1
- import { jsxs as S, jsx as r, Fragment as sl } from "react/jsx-runtime";
2
- import { useRef as B, useState as c, useEffect as b } from "react";
3
- import { INK_MIN_HEIGHT as al, NUMBER_ZERO as p, NUMBER_ONE as mn, INK_DEFAULT_TEXT_COLOR as ul, INK_DEFAULT_HIGHLIGHT_COLOR as _l, INK_TABLE_COL_RESIZE_EDGE_PX as pn } from "../../constants/numbers.js";
4
- import { EMPTY_STRING as D, INK_TOOLBAR_MORE_TITLE as Ln, CONTEXT_MENU_LABEL_GRAPH_BAR as dl, CONTEXT_MENU_ID_GRAPH_BAR as Tl, CONTEXT_MENU_LABEL_GRAPH_LINE as El, CONTEXT_MENU_ID_GRAPH_LINE as fl, CONTEXT_MENU_LABEL_GRAPH_PIE as ml, CONTEXT_MENU_ID_GRAPH_PIE as pl, CONTEXT_MENU_LABEL_GRAPH_EDIT as Ll, CONTEXT_MENU_ID_GRAPH_EDIT as Ol, CONTEXT_MENU_LABEL_GRAPH_COLORS as Cl, CONTEXT_MENU_ID_GRAPH_COLORS as Nl, CONTEXT_MENU_LABEL_GRAPH_AI as Il, CONTEXT_MENU_ID_GRAPH_AI as Al, INK_FOOTER_WORDS_LABEL as hl, INK_FOOTER_DOT as gl, INK_FOOTER_CHARS_LABEL as Rl, INK_FOOTER_LINE_LABEL as bl, INK_FOOTER_COL_LABEL as Sl, INK_FOOTER_SYNCED_LABEL as Bl, INK_FULLSCREEN_EXIT_TITLE as Dl, INK_FULLSCREEN_TITLE as Ml, INK_OUTLINE_TOGGLE_TITLE as Hl, INK_HTML_SOURCE_TITLE as kl, INK_HTML_SOURCE_LABEL as Pl, INK_CODE_LABEL as Ul, INK_AI_PILL_LABEL as st, INK_TITLES_DEFAULT_TEXT as On, INK_LINK_PROMPT as vl, INK_LINK_PROMPT_DEFAULT as wl } from "../../constants/generals.const.js";
5
- import { TOOLBAR_OPTION_FONT_DROPDOWN as Cn, TOOLBAR_OPTION_LIST_DROPDOWN as Nn, TOOLBAR_OPTION_CHECKLIST as ge, TOOLBAR_OPTION_TITLES as In, TOOLBAR_OPTION_EXCEL as An, TOOLBAR_OPTION_GRAPH as hn, TOOLBAR_OPTION_THEME as gn, TOOLBAR_OPTION_FULLSCREEN as Rn, TOOLBAR_OPTION_OUTLINE as bn, TOOLBAR_OPTION_HTML_SOURCE as Sn, TOOLBAR_OPTION_SIGNATURE as Bn, TOOLBAR_OPTION_FIND_REPLACE as Dn, TOOLBAR_OPTION_FIND_REPLACE_DROPDOWN as Mn, TOOLBAR_OPTION_HORIZONTAL_RULE as Hn } from "../../constants/toolbar.const.js";
6
- import { TOOLBAR_SHOW_CONTROL_LABEL as Kl, TOOLBAR_SHOW_CONTROL_ARIA_LABEL as Fl, AGENT_BAR_PLACEHOLDER as yl, CONTEXT_MENU_LABEL_SHOW_TOOLBAR as xl, CONTEXT_MENU_ID_SHOW_TOOLBAR as Xl, TOOLBAR_CONTEXT_MENU_LABEL_CUSTOMIZE as Gl, TOOLBAR_CONTEXT_MENU_ID_CUSTOMIZE as Wl, TOOLBAR_CONTEXT_MENU_LABEL_HIDE as Vl, TOOLBAR_CONTEXT_MENU_ID_HIDE as Yl, TOOLBAR_OPTION_HINTS as O, TOOLBAR_OPTION_DIVIDER as kn } from "../../constants/toolbarMenu.const.js";
7
- import { INK_DEFAULT_COLOR_MODE as zl, COLOR_MODE_SYSTEM as $l } from "../../constants/colorMode.const.js";
8
- import { KEY_TAB as ql, KEY_ENTER as jl, KEY_ESCAPE as Zl, KEY_K as Ql, KEY_Z as Jl } from "../../constants/keyboard.const.js";
9
- import { FONT_VALUE_SYSTEM as ei, INK_FONT_OPTIONS as ti, FONT_DROPDOWN_TITLE as ni } from "../../constants/fonts.const.js";
10
- import { LIST_VALUE_BULLET as oi, INK_LIST_OPTIONS as ri, LIST_DROPDOWN_TITLE as li } from "../../constants/lists.const.js";
11
- import { FIND_REPLACE_FOCUS_FIND as Re, INK_FIND_REPLACE_OPTIONS as ii, FIND_REPLACE_DROPDOWN_TITLE as ci, FIND_REPLACE_FOCUS_REPLACE as si, FIND_REPLACE_VALUE_REPLACE as ai } from "../../constants/findReplaceMenu.const.js";
12
- import { BLOCK_DROP_POSITION_BEFORE as ui, DIR_LTR as _i, DIR_RTL as di } from "../../constants/blocks.const.js";
13
- import { INK_PLACEHOLDER_DEFAULT as Ti, INK_DEFAULT_VARIANT as Ei, INK_DEFAULT_CHROME as fi, INK_DEFAULT_AUTHOR as mi, INK_TABLE_DEFAULT_ROWS as pi, INK_TABLE_DEFAULT_COLS as Li, INK_DEFAULT_FEATURES as Oi, INK_CHROME_TOOLBAR as Ci, INK_DEFAULT_TOOLBAR as Ni, INK_VARIANT_DOCUMENT as Pn, INK_CLASS_TOOLBAR_SHOW as Ii, INK_CLASS_TOOLBAR as Ai, INK_CLASS_TOOLBAR_MEASURE as hi, INK_CLASS_TOOLBAR_ROW as gi, INK_ATTR_MORE as Ri, INK_CLASS_TOOLBAR_OVERFLOW as bi, INK_CLASS_TOOLBAR_HINT as Si, INK_CLASS_SHELL as Bi, INK_CLASS_BODY as Di, INK_CLASS_CONTENT as Un, INK_CLASS_CONTENT_HIDDEN as Mi, INK_CLASS_FOOTER as Hi, INK_CLASS_FOOTER_META as ki, INK_CLASS_TABLE_RESIZE as de, INK_CLASS_DIVIDER as Pi, INK_HEADING_OPTIONS as Ui, INK_CLASS_BUTTON_WIDE as vn, INK_CLASS_BUTTON_LABEL as wn, INK_BUTTON_CONFIG as at, INK_CLASS_AI_PILL as Kn, INK_CLASS_AI_PILL_INSTALLED as vi, INK_CLASS_AI_PILL_DOT as wi, INK_ATTR_GRAPH as Ki, INK_CLASS_BLOCK_ACTIVE as Fi, INK_ATTR_GRAPH_POINTS as Fn, INK_ATTR_GRAPH_COLORS as yi, INK_CHECKLIST_HTML as yn, INK_CALLOUT_HTML as xi, INK_FORMAT_BLOCK_PRE as Xi, INK_FORMAT_BLOCK_QUOTE as Gi, INK_FORMAT_BLOCK_P as Wi, INK_FORMAT_BLOCK_H3 as Vi, INK_FORMAT_BLOCK_H2 as Yi, INK_FORMAT_BLOCK_H1 as zi, INK_CLASS_ROOT as $i } from "../../constants/defaults.const.js";
14
- import { INK_AI_DEMO_PROVIDER_ID as qi } from "../../constants/aiModels.const.js";
1
+ import { jsxs as B, jsx as r, Fragment as dl } from "react/jsx-runtime";
2
+ import { useRef as D, useState as c, useEffect as S } from "react";
3
+ import { INK_MIN_HEIGHT as Tl, NUMBER_ZERO as p, NUMBER_ONE as Cn, INK_DEFAULT_TEXT_COLOR as fl, INK_DEFAULT_HIGHLIGHT_COLOR as El, INK_TABLE_COL_RESIZE_EDGE_PX as Nn } from "../../constants/numbers.js";
4
+ import { EMPTY_STRING as M, INK_TOOLBAR_MORE_TITLE as In, CONTEXT_MENU_LABEL_GRAPH_BAR as ml, CONTEXT_MENU_ID_GRAPH_BAR as pl, CONTEXT_MENU_LABEL_GRAPH_LINE as Ll, CONTEXT_MENU_ID_GRAPH_LINE as Ol, CONTEXT_MENU_LABEL_GRAPH_PIE as Cl, CONTEXT_MENU_ID_GRAPH_PIE as Nl, CONTEXT_MENU_LABEL_GRAPH_EDIT as Il, CONTEXT_MENU_ID_GRAPH_EDIT as Al, CONTEXT_MENU_LABEL_GRAPH_COLORS as hl, CONTEXT_MENU_ID_GRAPH_COLORS as gl, CONTEXT_MENU_LABEL_GRAPH_AI as Rl, CONTEXT_MENU_ID_GRAPH_AI as bl, INK_FOOTER_WORDS_LABEL as Sl, INK_FOOTER_DOT as Bl, INK_FOOTER_CHARS_LABEL as Dl, INK_FOOTER_LINE_LABEL as Ml, INK_FOOTER_COL_LABEL as Hl, INK_FOOTER_SYNCED_LABEL as kl, INK_FULLSCREEN_EXIT_TITLE as Pl, INK_FULLSCREEN_TITLE as Ul, INK_OUTLINE_TOGGLE_TITLE as vl, INK_HTML_SOURCE_TITLE as wl, INK_HTML_SOURCE_LABEL as Kl, INK_CODE_LABEL as Fl, INK_AI_PILL_LABEL as ut, INK_TITLES_DEFAULT_TEXT as An, INK_LINK_PROMPT as yl, INK_LINK_PROMPT_DEFAULT as xl } from "../../constants/generals.const.js";
5
+ import { TOOLBAR_OPTION_FONT_DROPDOWN as hn, TOOLBAR_OPTION_LIST_DROPDOWN as gn, TOOLBAR_OPTION_CHECKLIST as Re, TOOLBAR_OPTION_TITLES as Rn, TOOLBAR_OPTION_EXCEL as bn, TOOLBAR_OPTION_GRAPH as Sn, TOOLBAR_OPTION_THEME as Bn, TOOLBAR_OPTION_FULLSCREEN as Dn, TOOLBAR_OPTION_OUTLINE as Mn, TOOLBAR_OPTION_HTML_SOURCE as Hn, TOOLBAR_OPTION_SIGNATURE as kn, TOOLBAR_OPTION_FIND_REPLACE as Pn, TOOLBAR_OPTION_FIND_REPLACE_DROPDOWN as Un, TOOLBAR_OPTION_HORIZONTAL_RULE as vn } from "../../constants/toolbar.const.js";
6
+ import { TOOLBAR_SHOW_CONTROL_LABEL as Xl, TOOLBAR_SHOW_CONTROL_ARIA_LABEL as Gl, AGENT_BAR_PLACEHOLDER as Wl, CONTEXT_MENU_LABEL_SHOW_TOOLBAR as Vl, CONTEXT_MENU_ID_SHOW_TOOLBAR as Yl, TOOLBAR_CONTEXT_MENU_LABEL_CUSTOMIZE as zl, TOOLBAR_CONTEXT_MENU_ID_CUSTOMIZE as $l, TOOLBAR_CONTEXT_MENU_LABEL_HIDE as ql, TOOLBAR_CONTEXT_MENU_ID_HIDE as jl, TOOLBAR_OPTION_HINTS as O, TOOLBAR_OPTION_DIVIDER as wn } from "../../constants/toolbarMenu.const.js";
7
+ import { INK_DEFAULT_COLOR_MODE as Zl, COLOR_MODE_SYSTEM as Ql } from "../../constants/colorMode.const.js";
8
+ import { KEY_TAB as Jl, KEY_ENTER as ei, KEY_ESCAPE as ti, KEY_K as ni, KEY_Z as oi } from "../../constants/keyboard.const.js";
9
+ import { FONT_VALUE_SYSTEM as ri, INK_FONT_OPTIONS as li, FONT_DROPDOWN_TITLE as ii } from "../../constants/fonts.const.js";
10
+ import { LIST_VALUE_BULLET as ci, INK_LIST_OPTIONS as si, LIST_DROPDOWN_TITLE as ai } from "../../constants/lists.const.js";
11
+ import { FIND_REPLACE_FOCUS_FIND as be, INK_FIND_REPLACE_OPTIONS as ui, FIND_REPLACE_DROPDOWN_TITLE as _i, FIND_REPLACE_FOCUS_REPLACE as di, FIND_REPLACE_VALUE_REPLACE as Ti } from "../../constants/findReplaceMenu.const.js";
12
+ import { BLOCK_DROP_POSITION_BEFORE as fi, DIR_LTR as Ei, DIR_RTL as mi } from "../../constants/blocks.const.js";
13
+ import { INK_PLACEHOLDER_DEFAULT as pi, INK_DEFAULT_VARIANT as Li, INK_DEFAULT_CHROME as Oi, INK_DEFAULT_AUTHOR as Ci, INK_TABLE_DEFAULT_ROWS as Ni, INK_TABLE_DEFAULT_COLS as Ii, INK_DEFAULT_FEATURES as Ai, INK_CHROME_TOOLBAR as hi, INK_DEFAULT_TOOLBAR as gi, INK_VARIANT_DOCUMENT as Kn, INK_CLASS_TOOLBAR_SHOW as Ri, INK_CLASS_TOOLBAR as bi, INK_CLASS_TOOLBAR_MEASURE as Si, INK_CLASS_TOOLBAR_ROW as Bi, INK_ATTR_MORE as Di, INK_CLASS_TOOLBAR_OVERFLOW as Mi, INK_CLASS_TOOLBAR_HINT as Hi, INK_CLASS_SHELL as ki, INK_CLASS_BODY as Pi, INK_CLASS_CONTENT as Fn, INK_CLASS_CONTENT_HIDDEN as Ui, INK_CLASS_FOOTER as vi, INK_CLASS_FOOTER_META as wi, INK_CLASS_TABLE_RESIZE as Te, INK_CLASS_DIVIDER as Ki, INK_HEADING_OPTIONS as Fi, INK_CLASS_BUTTON_WIDE as yn, INK_CLASS_BUTTON_LABEL as xn, INK_BUTTON_CONFIG as _t, INK_CLASS_AI_PILL as Xn, INK_CLASS_AI_PILL_INSTALLED as yi, INK_CLASS_AI_PILL_DOT as xi, INK_ATTR_GRAPH as Xi, INK_CLASS_BLOCK_ACTIVE as Gi, INK_ATTR_GRAPH_POINTS as Gn, INK_ATTR_GRAPH_COLORS as Wi, INK_CHECKLIST_HTML as Wn, INK_CALLOUT_HTML as Vi, INK_FORMAT_BLOCK_PRE as Yi, INK_FORMAT_BLOCK_QUOTE as zi, INK_FORMAT_BLOCK_P as $i, INK_FORMAT_BLOCK_H3 as qi, INK_FORMAT_BLOCK_H2 as ji, INK_FORMAT_BLOCK_H1 as Zi, INK_CLASS_ROOT as Qi } from "../../constants/defaults.const.js";
14
+ import { INK_AI_DEMO_PROVIDER_ID as Ji } from "../../constants/aiModels.const.js";
15
15
  import "../../constants/openai.const.js";
16
- import { INK_DEFAULT_ICONS as xn } from "../../constants/defaultIcons.js";
17
- import { CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE as ji, CONTEXT_MENU_ID_TABLE_ROW_ABOVE as Zi, CONTEXT_MENU_LABEL_TABLE_ROW_BELOW as Qi, CONTEXT_MENU_ID_TABLE_ROW_BELOW as Ji, CONTEXT_MENU_LABEL_TABLE_COL_LEFT as ec, CONTEXT_MENU_ID_TABLE_COL_LEFT as tc, CONTEXT_MENU_LABEL_TABLE_COL_RIGHT as nc, CONTEXT_MENU_ID_TABLE_COL_RIGHT as oc, CONTEXT_MENU_LABEL_TABLE_DELETE_ROW as rc, CONTEXT_MENU_ID_TABLE_DELETE_ROW as lc, CONTEXT_MENU_LABEL_TABLE_DELETE_COL as ic, CONTEXT_MENU_ID_TABLE_DELETE_COL as cc, CONTEXT_MENU_LABEL_TABLE_HEADER as sc, CONTEXT_MENU_ID_TABLE_HEADER as ac, CONTEXT_MENU_LABEL_BOLD as uc, CONTEXT_MENU_ID_BOLD as _c, CONTEXT_MENU_LABEL_ITALIC as dc, CONTEXT_MENU_ID_ITALIC as Tc, CONTEXT_MENU_LABEL_UNDERLINE as Ec, CONTEXT_MENU_ID_UNDERLINE as fc, CONTEXT_MENU_LABEL_STRIKE as mc, CONTEXT_MENU_ID_STRIKE as pc, CONTEXT_MENU_LABEL_HEADING as Lc, CONTEXT_MENU_ID_HEADING as Oc, CONTEXT_MENU_LABEL_BULLET as Cc, CONTEXT_MENU_ID_BULLET as Nc, CONTEXT_MENU_LABEL_ORDERED as Ic, CONTEXT_MENU_ID_ORDERED as Ac, CONTEXT_MENU_LABEL_LINK as hc, CONTEXT_MENU_ID_LINK as gc, CONTEXT_MENU_LABEL_CLEAR as Rc, CONTEXT_MENU_ID_CLEAR as bc, CONTEXT_MENU_LABEL_FIND as Sc, CONTEXT_MENU_ID_FIND as Bc, CONTEXT_MENU_LABEL_SIGNATURE as Dc, CONTEXT_MENU_ID_SIGNATURE as Mc, CONTEXT_MENU_LABEL_COMMENT as Hc, CONTEXT_MENU_ID_COMMENT as kc } from "../../constants/contextMenu.const.js";
18
- import { TABLE_CELL_SELECTOR as Xn, TABLE_TAG as ut } from "../../constants/table.const.js";
19
- import { cn as Pc } from "../../utils/cn.utils.js";
20
- import { applyTypoAutoFix as Uc } from "../../utils/typo.utils.js";
21
- import { createInkId as Gn } from "../../utils/id.utils.js";
22
- import { getColumnResizeIndex as Wn, getTableCellFromSelection as Vn, setTableColumnWidth as vc, buildTableHtml as wc, insertTableRow as Yn, insertTableColumn as zn, deleteTableRow as Kc, deleteTableColumn as Fc, toggleTableHeaderRow as yc } from "../../utils/table.utils.js";
23
- import { getBlockElement as Te, clearBlockDragClasses as _t, markActiveBlock as $n, markDraggingBlock as xc, moveBlock as Xc, resolveDropPosition as qn, reorderBlockBefore as Gc, reorderBlockAfter as Wc, markDropTarget as jn } from "../../utils/blocks.utils.js";
24
- import { createTrackChange as dt, rejectTrackChangeInHtml as Vc, acceptTrackChangeInHtml as Yc, wrapInsertHtml as Zn, wrapDeleteHtml as zc } from "../../utils/trackChanges.utils.js";
25
- import { removeCommentMark as $c, wrapSelectionAsComment as qc, createCommentThread as jc } from "../../utils/comments.utils.js";
26
- import { InkHistoryStack as Tt } from "../../utils/history.utils.js";
27
- import { extractSlashQuery as Zc, filterSlashCommands as Qc } from "../../utils/slash.utils.js";
28
- import { countWords as Jc } from "../../utils/words.utils.js";
29
- import { collectOutlineItems as J, scrollOutlineHeading as es, getCaretLineCol as Qn } from "../../utils/outline.utils.js";
30
- import { resolveInkPremium as ts, hasInkPremiumFeature as Ee, themeTokensToStyle as ns } from "../../utils/premium.utils.js";
31
- import { extractClipboardHtml as os, sanitizePastedHtml as rs, extractClipboardText as ls } from "../../utils/paste.utils.js";
32
- import { readInkMemory as is, writeInkMemory as cs } from "../../utils/memory.utils.js";
33
- import { replaceInHtml as ss } from "../../utils/findReplace.utils.js";
34
- import { withPreservedSelection as Et, captureSelectionInRoot as as, restoreSelectionInRoot as us } from "../../utils/selection.utils.js";
35
- import { readToolbarItems as _s, readToolbarHidden as ds, listCustomizableToolbarOptions as Ts, writeToolbarHidden as Es, buildVisibleToolbarItems as fs, writeToolbarItems as ms } from "../../utils/toolbarStorage.utils.js";
36
- import { TITLE_STYLE_DEFAULT as ps } from "../../plugins/titles/titles.const.js";
37
- import { buildTitleHtml as Jn } from "../../plugins/titles/titles.utils.js";
38
- import { excelGridToTableHtml as Ls, createEmptyExcelGrid as Os } from "../../plugins/excel/excel.utils.js";
39
- import { GRAPH_SAMPLE as be, GRAPH_KIND_DEFAULT as eo } from "../../plugins/graph/graph.const.js";
40
- import { parseGraphColors as to, replaceGraphBlock as no, getGraphBlock as Cs, buildGraphHtml as Ns, parseGraphPoints as oo } from "../../plugins/graph/graph.utils.js";
41
- import { THEME_DEFAULT as Is } from "../../plugins/theme/theme.const.js";
42
- import { applyInkTheme as As } from "../../plugins/theme/inkTheme.js";
43
- import { inkPlugins as fe } from "../../plugins/host/inkPlugins.js";
44
- import { useToolbarOverflow as hs } from "../../hooks/useToolbarOverflow.js";
45
- import { Button as gs } from "../../common-components/Button/Button.js";
46
- import { ContextMenu as ro } from "../../common-components/ContextMenu/ContextMenu.js";
47
- import { insertImage as ft, insertHTML as A, setTextColor as Rs, setHighlightColor as bs, getActiveFormats as Ss, queryCommandValue as Bs, detectListType as Ds, tryConvertMarkdownListPrefix as Ms, execCommand as h, insertLink as Hs, applyFontFamily as ks, applyListType as Ps, clearFormatDeep as Us, setBlockDirection as lo, fileToDataUrl as vs } from "./helpers/format.utils.js";
48
- import { inkAi as ws } from "../../plugins/ai/aiPlugin.js";
16
+ import { INK_DEFAULT_ICONS as Vn } from "../../constants/defaultIcons.js";
17
+ import { CONTEXT_MENU_LABEL_TABLE_ROW_ABOVE as ec, CONTEXT_MENU_ID_TABLE_ROW_ABOVE as tc, CONTEXT_MENU_LABEL_TABLE_ROW_BELOW as nc, CONTEXT_MENU_ID_TABLE_ROW_BELOW as oc, CONTEXT_MENU_LABEL_TABLE_COL_LEFT as rc, CONTEXT_MENU_ID_TABLE_COL_LEFT as lc, CONTEXT_MENU_LABEL_TABLE_COL_RIGHT as ic, CONTEXT_MENU_ID_TABLE_COL_RIGHT as cc, CONTEXT_MENU_LABEL_TABLE_DELETE_ROW as sc, CONTEXT_MENU_ID_TABLE_DELETE_ROW as ac, CONTEXT_MENU_LABEL_TABLE_DELETE_COL as uc, CONTEXT_MENU_ID_TABLE_DELETE_COL as _c, CONTEXT_MENU_LABEL_TABLE_HEADER as dc, CONTEXT_MENU_ID_TABLE_HEADER as Tc, CONTEXT_MENU_LABEL_BOLD as fc, CONTEXT_MENU_ID_BOLD as Ec, CONTEXT_MENU_LABEL_ITALIC as mc, CONTEXT_MENU_ID_ITALIC as pc, CONTEXT_MENU_LABEL_UNDERLINE as Lc, CONTEXT_MENU_ID_UNDERLINE as Oc, CONTEXT_MENU_LABEL_STRIKE as Cc, CONTEXT_MENU_ID_STRIKE as Nc, CONTEXT_MENU_LABEL_HEADING as Ic, CONTEXT_MENU_ID_HEADING as Ac, CONTEXT_MENU_LABEL_BULLET as hc, CONTEXT_MENU_ID_BULLET as gc, CONTEXT_MENU_LABEL_ORDERED as Rc, CONTEXT_MENU_ID_ORDERED as bc, CONTEXT_MENU_LABEL_LINK as Sc, CONTEXT_MENU_ID_LINK as Bc, CONTEXT_MENU_LABEL_CLEAR as Dc, CONTEXT_MENU_ID_CLEAR as Mc, CONTEXT_MENU_LABEL_FIND as Hc, CONTEXT_MENU_ID_FIND as kc, CONTEXT_MENU_LABEL_SIGNATURE as Pc, CONTEXT_MENU_ID_SIGNATURE as Uc, CONTEXT_MENU_LABEL_COMMENT as vc, CONTEXT_MENU_ID_COMMENT as wc } from "../../constants/contextMenu.const.js";
18
+ import { TABLE_CELL_SELECTOR as Yn, TABLE_TAG as dt } from "../../constants/table.const.js";
19
+ import { cn as Kc } from "../../utils/cn.utils.js";
20
+ import { applyTypoAutoFix as Fc } from "../../utils/typo.utils.js";
21
+ import { createInkId as zn } from "../../utils/id.utils.js";
22
+ import { getColumnResizeIndex as $n, getTableCellFromSelection as qn, setTableColumnWidth as yc, buildTableHtml as xc, insertTableRow as jn, insertTableColumn as Zn, deleteTableRow as Xc, deleteTableColumn as Gc, toggleTableHeaderRow as Wc } from "../../utils/table.utils.js";
23
+ import { getBlockElement as fe, clearBlockDragClasses as Tt, markActiveBlock as Qn, markDraggingBlock as Vc, moveBlock as Yc, resolveDropPosition as Jn, reorderBlockBefore as zc, reorderBlockAfter as $c, markDropTarget as eo } from "../../utils/blocks.utils.js";
24
+ import { createTrackChange as ft, rejectTrackChangeInHtml as qc, acceptTrackChangeInHtml as jc, wrapInsertHtml as to, wrapDeleteHtml as Zc } from "../../utils/trackChanges.utils.js";
25
+ import { removeCommentMark as Qc, wrapSelectionAsComment as Jc, createCommentThread as es } from "../../utils/comments.utils.js";
26
+ import { InkHistoryStack as Et } from "../../utils/history.utils.js";
27
+ import { extractSlashQuery as ts, filterSlashCommands as ns } from "../../utils/slash.utils.js";
28
+ import { countWords as os } from "../../utils/words.utils.js";
29
+ import { collectOutlineItems as ee, scrollOutlineHeading as rs, getCaretLineCol as no } from "../../utils/outline.utils.js";
30
+ import { resolveInkPremium as ls, hasInkPremiumFeature as Ee, themeTokensToStyle as is } from "../../utils/premium.utils.js";
31
+ import { extractClipboardHtml as cs, sanitizePastedHtml as ss, extractClipboardText as as } from "../../utils/paste.utils.js";
32
+ import { readInkMemory as us, writeInkMemory as _s } from "../../utils/memory.utils.js";
33
+ import { replaceInHtml as ds } from "../../utils/findReplace.utils.js";
34
+ import { withPreservedSelection as mt, captureSelectionInRoot as Ts, restoreSelectionInRoot as fs } from "../../utils/selection.utils.js";
35
+ import { readToolbarItems as Es, readToolbarHidden as ms, listCustomizableToolbarOptions as ps, writeToolbarHidden as Ls, buildVisibleToolbarItems as Os, writeToolbarItems as Cs } from "../../utils/toolbarStorage.utils.js";
36
+ import { TITLE_STYLE_DEFAULT as Ns } from "../../plugins/titles/titles.const.js";
37
+ import { buildTitleHtml as oo } from "../../plugins/titles/titles.utils.js";
38
+ import { excelGridToTableHtml as Is, createEmptyExcelGrid as As } from "../../plugins/excel/excel.utils.js";
39
+ import { GRAPH_SAMPLE as Se, GRAPH_KIND_DEFAULT as ro } from "../../plugins/graph/graph.const.js";
40
+ import { parseGraphColors as lo, replaceGraphBlock as io, getGraphBlock as hs, buildGraphHtml as gs, parseGraphPoints as co } from "../../plugins/graph/graph.utils.js";
41
+ import { THEME_DEFAULT as Rs } from "../../plugins/theme/theme.const.js";
42
+ import { applyInkTheme as bs } from "../../plugins/theme/inkTheme.js";
43
+ import { inkPlugins as me } from "../../plugins/host/inkPlugins.js";
44
+ import { useToolbarOverflow as Ss } from "../../hooks/useToolbarOverflow.js";
45
+ import { Button as Bs } from "../../common-components/Button/Button.js";
46
+ import { ContextMenu as so } from "../../common-components/ContextMenu/ContextMenu.js";
47
+ import { insertImage as pt, insertHTML as A, setTextColor as Ds, setHighlightColor as Ms, getActiveFormats as Hs, queryCommandValue as ks, detectListType as Ps, tryConvertMarkdownListPrefix as Us, execCommand as h, insertLink as vs, applyFontFamily as ws, applyListType as Ks, clearFormatDeep as Fs, setBlockDirection as ao, fileToDataUrl as ys } from "./helpers/format.utils.js";
48
+ import { inkAi as xs } from "../../plugins/ai/aiPlugin.js";
49
49
  import { ToolbarButton as N } from "./components/ToolbarButton/ToolbarButton.js";
50
- import { ToolbarDropdown as Se } from "./components/ToolbarDropdown/ToolbarDropdown.js";
51
- import { ToolbarColorPicker as io } from "./components/ToolbarColorPicker/ToolbarColorPicker.js";
52
- import { CommentsPanel as Ks } from "./components/CommentsPanel/CommentsPanel.js";
53
- import { AiPanel as Fs } from "./components/AiPanel/AiPanel.js";
54
- import { AiAutocomplete as ys } from "./components/AiAutocomplete/AiAutocomplete.js";
55
- import { AI_AUTOCOMPLETE_DEBOUNCE_MS as xs, AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT as Xs } from "./components/AiAutocomplete/AiAutocomplete.const.js";
56
- import { getTextBeforeCaret as Gs, getCaretPositionInRoot as co } from "./components/AiAutocomplete/AiAutocomplete.utils.js";
57
- import { BlockHandles as Ws } from "./components/BlockHandles/BlockHandles.js";
58
- import { BLOCK_HANDLES_DRAG_MIME as Vs, BLOCK_HANDLES_DRAG_PAYLOAD as Ys, BLOCK_HANDLES_DRAG_EFFECT_MOVE as so } from "./components/BlockHandles/BlockHandles.const.js";
59
- import { InlineToolbar as zs } from "./components/InlineToolbar/InlineToolbar.js";
60
- import { INLINE_TOOLBAR_EDGE_PADDING_PX as $s, INLINE_TOOLBAR_ESTIMATED_WIDTH_PX as qs, INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX as js, INLINE_TOOLBAR_GAP_PX as Zs } from "./components/InlineToolbar/InlineToolbar.const.js";
61
- import { selectionIsInsideElement as Qs, clampInlineToolbarPosition as Js } from "./components/InlineToolbar/InlineToolbar.utils.js";
62
- import { SlashMenu as ea } from "./components/SlashMenu/SlashMenu.js";
63
- import { OutlineRail as ta } from "./components/OutlineRail/OutlineRail.js";
64
- import { TrackChangesBar as na } from "./components/TrackChangesBar/TrackChangesBar.js";
65
- import { SignPad as oa } from "./components/SignPad/SignPad.js";
66
- import { FindReplace as ra } from "./components/FindReplace/FindReplace.js";
67
- import { ToolbarCustomize as la } from "./components/ToolbarCustomize/ToolbarCustomize.js";
68
- import { HtmlSourcePanel as ia } from "./components/HtmlSourcePanel/HtmlSourcePanel.js";
69
- import { TableSizePicker as ca } from "./components/TableSizePicker/TableSizePicker.js";
70
- import { TitleGallery as sa } from "./components/TitleGallery/TitleGallery.js";
71
- import { ExcelSheetPanel as aa } from "./components/ExcelSheetPanel/ExcelSheetPanel.js";
72
- import { GraphPicker as ua } from "./components/GraphPicker/GraphPicker.js";
73
- import { GraphEditModal as _a } from "./components/GraphEditModal/GraphEditModal.js";
74
- import { ThemePicker as da } from "./components/ThemePicker/ThemePicker.js";
75
- const mt = () => {
76
- const M = window.getSelection();
77
- if (!M || M.rangeCount === p) return "";
78
- const g = M.getRangeAt(p), H = document.createElement("div");
79
- return H.appendChild(g.cloneContents()), H.innerHTML;
80
- }, I = (M) => {
81
- M == null || M.focus({ preventScroll: !0 });
82
- }, Pu = (M) => {
83
- var En;
50
+ import { ToolbarDropdown as Be } from "./components/ToolbarDropdown/ToolbarDropdown.js";
51
+ import { ToolbarColorPicker as uo } from "./components/ToolbarColorPicker/ToolbarColorPicker.js";
52
+ import { CommentsPanel as Xs } from "./components/CommentsPanel/CommentsPanel.js";
53
+ import { AiPanel as Gs } from "./components/AiPanel/AiPanel.js";
54
+ import { AiAutocomplete as Ws } from "./components/AiAutocomplete/AiAutocomplete.js";
55
+ import { AI_AUTOCOMPLETE_DEBOUNCE_MS as Vs, AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT as Ys } from "./components/AiAutocomplete/AiAutocomplete.const.js";
56
+ import { getTextBeforeCaret as zs, getCaretPositionInRoot as _o } from "./components/AiAutocomplete/AiAutocomplete.utils.js";
57
+ import { BlockHandles as $s } from "./components/BlockHandles/BlockHandles.js";
58
+ import { BLOCK_HANDLES_DRAG_MIME as qs, BLOCK_HANDLES_DRAG_PAYLOAD as js, BLOCK_HANDLES_DRAG_EFFECT_MOVE as To } from "./components/BlockHandles/BlockHandles.const.js";
59
+ import { InlineToolbar as Zs } from "./components/InlineToolbar/InlineToolbar.js";
60
+ import { INLINE_TOOLBAR_EDGE_PADDING_PX as Qs, INLINE_TOOLBAR_ESTIMATED_WIDTH_PX as Js, INLINE_TOOLBAR_ESTIMATED_HEIGHT_PX as ea, INLINE_TOOLBAR_GAP_PX as ta } from "./components/InlineToolbar/InlineToolbar.const.js";
61
+ import { selectionIsInsideElement as na, clampInlineToolbarPosition as oa } from "./components/InlineToolbar/InlineToolbar.utils.js";
62
+ import { SlashMenu as ra } from "./components/SlashMenu/SlashMenu.js";
63
+ import { OutlineRail as la } from "./components/OutlineRail/OutlineRail.js";
64
+ import { TrackChangesBar as ia } from "./components/TrackChangesBar/TrackChangesBar.js";
65
+ import { SignPad as ca } from "./components/SignPad/SignPad.js";
66
+ import { FindReplace as sa } from "./components/FindReplace/FindReplace.js";
67
+ import { ToolbarCustomize as aa } from "./components/ToolbarCustomize/ToolbarCustomize.js";
68
+ import { HtmlSourcePanel as ua } from "./components/HtmlSourcePanel/HtmlSourcePanel.js";
69
+ import { TableSizePicker as _a } from "./components/TableSizePicker/TableSizePicker.js";
70
+ import { TitleGallery as da } from "./components/TitleGallery/TitleGallery.js";
71
+ import { ExcelSheetPanel as Ta } from "./components/ExcelSheetPanel/ExcelSheetPanel.js";
72
+ import { GraphPicker as fa } from "./components/GraphPicker/GraphPicker.js";
73
+ import { GraphEditModal as Ea } from "./components/GraphEditModal/GraphEditModal.js";
74
+ import { ThemePicker as ma } from "./components/ThemePicker/ThemePicker.js";
75
+ import { PresenceStack as pa } from "./components/PresenceStack/PresenceStack.js";
76
+ import { RemoteCursors as La } from "./components/RemoteCursors/RemoteCursors.js";
77
+ const Lt = () => {
78
+ const H = window.getSelection();
79
+ if (!H || H.rangeCount === p) return "";
80
+ const g = H.getRangeAt(p), k = document.createElement("div");
81
+ return k.appendChild(g.cloneContents()), k.innerHTML;
82
+ }, I = (H) => {
83
+ H == null || H.focus({ preventScroll: !0 });
84
+ }, Xu = (H) => {
85
+ var Ln;
84
86
  const {
85
87
  value: g,
86
- defaultValue: H = "",
87
- onChange: k,
88
- placeholder: pt = Ti,
88
+ defaultValue: k = "",
89
+ onChange: P,
90
+ placeholder: Ot = pi,
89
91
  disabled: i = !1,
90
92
  readOnly: s = !1,
91
- minHeight: Be = al,
92
- maxHeight: De,
93
- toolbar: ao,
94
- className: uo = "",
95
- testId: _o,
96
- allowImagePaste: Lt = !0,
97
- showCharCount: Ot = !1,
98
- charCountMax: Ct,
99
- typoAutoFix: To = !0,
100
- variant: me = Ei,
101
- chrome: Eo = fi,
102
- colorMode: Nt = zl,
103
- features: fo,
104
- author: x = mi,
105
- trackChanges: ee,
106
- onTrackChangesChange: Me,
107
- trackChangesEnabled: pe,
108
- onTrackChangesEnabledChange: He,
109
- comments: te,
110
- onCommentsChange: ke,
111
- showCommentsPanel: ne,
112
- onShowCommentsPanelChange: Pe,
113
- ai: E,
114
- slashCommands: mo,
115
- tableRows: po = pi,
116
- tableCols: Lo = Li,
117
- premium: Oo,
118
- theme: Co,
119
- icons: It,
120
- pasteMode: No = "plain",
121
- onImageUpload: At,
122
- wysiwyg: Io = !1,
123
- keepInMemory: X = !1,
124
- memoryKey: G,
125
- onToolbarChange: Ue,
126
- toolbarHidden: W,
127
- onToolbarHiddenChange: ve,
128
- showOutline: Ao,
129
- onOutlineChange: we,
130
- style: ho,
131
- ...go
132
- } = M, Le = ao ?? (me === Pn ? Ci : Ni), a = { ...Oi, ...fo }, V = ts(Oo), Ro = Ee(V, "icons"), bo = Ee(V, "theme"), So = Ee(V, "richPaste"), Bo = Ee(V, "imageUpload"), Do = Ee(V, "wysiwyg") && Io, f = Ro && It ? { ...xn, ...It } : xn, Mo = bo ? ns(Co) : {}, Ho = So && No === "rich", o = B(null), Oe = B(null), oe = B(new Tt(g ?? H)), Y = B(null), K = B(null), Ce = B(D), [Ke, ko] = c(/* @__PURE__ */ new Set()), [Po, ht] = c("p"), [Uo, vo] = c(p), [wo, Ko] = c(p), [Fo, gt] = c(mn), [yo, Rt] = c(mn), [xo, z] = c([]), [Xo, Go] = c(p), [Wo, Fe] = c(D), [Vo, Yo] = c(ul), [zo, $o] = c(_l), [$, bt] = c(pe ?? !1), [qo, St] = c(ee ?? []), [jo, Bt] = c(te ?? []), [Zo, Dt] = c(ne ?? !1), [Mt, re] = c(!!(E != null && E.enabled && E.openOnInit)), [Ne, Qo] = c(!1), Ht = B(!1), [U, le] = c({
93
+ minHeight: De = Tl,
94
+ maxHeight: Me,
95
+ toolbar: fo,
96
+ className: Eo = "",
97
+ testId: mo,
98
+ allowImagePaste: Ct = !0,
99
+ showCharCount: Nt = !1,
100
+ charCountMax: It,
101
+ typoAutoFix: po = !0,
102
+ variant: pe = Li,
103
+ chrome: Lo = Oi,
104
+ colorMode: At = Zl,
105
+ features: Oo,
106
+ author: X = Ci,
107
+ trackChanges: te,
108
+ onTrackChangesChange: He,
109
+ trackChangesEnabled: Le,
110
+ onTrackChangesEnabledChange: ke,
111
+ comments: ne,
112
+ onCommentsChange: Pe,
113
+ showCommentsPanel: oe,
114
+ onShowCommentsPanelChange: Ue,
115
+ ai: f,
116
+ slashCommands: Co,
117
+ tableRows: No = Ni,
118
+ tableCols: Io = Ii,
119
+ premium: Ao,
120
+ theme: ho,
121
+ themeId: ht,
122
+ onThemeChange: ve,
123
+ icons: gt,
124
+ pasteMode: go = "plain",
125
+ onImageUpload: Rt,
126
+ wysiwyg: Ro = !1,
127
+ keepInMemory: G = !1,
128
+ memoryKey: W,
129
+ onToolbarChange: we,
130
+ toolbarHidden: V,
131
+ onToolbarHiddenChange: Ke,
132
+ showOutline: bo,
133
+ onOutlineChange: Fe,
134
+ collaboration: R,
135
+ style: So,
136
+ ...Bo
137
+ } = H, Oe = fo ?? (pe === Kn ? hi : gi), a = { ...Ai, ...Oo }, Y = ls(Ao), Do = Ee(Y, "icons"), Mo = Ee(Y, "theme"), Ho = Ee(Y, "richPaste"), ko = Ee(Y, "imageUpload"), Po = Ee(Y, "wysiwyg") && Ro, E = Do && gt ? { ...Vn, ...gt } : Vn, Uo = Mo ? is(ho) : {}, vo = Ho && go === "rich", o = D(null), Ce = D(null), re = D(new Et(g ?? k)), z = D(null), F = D(null), Ne = D(M), [ye, wo] = c(/* @__PURE__ */ new Set()), [Ko, bt] = c("p"), [Fo, yo] = c(p), [xo, Xo] = c(p), [Go, St] = c(Cn), [Wo, Bt] = c(Cn), [Vo, $] = c([]), [Yo, zo] = c(p), [$o, xe] = c(M), [qo, jo] = c(fl), [Zo, Qo] = c(El), [q, Dt] = c(Le ?? !1), [Jo, Mt] = c(te ?? []), [er, Ht] = c(ne ?? []), [tr, kt] = c(oe ?? !1), [Pt, le] = c(!!(f != null && f.enabled && f.openOnInit)), [Ie, nr] = c(!1), Ut = D(!1), [v, ie] = c({
133
138
  visible: !1,
134
139
  suggestion: "",
135
140
  top: p,
136
141
  left: p
137
- }), ie = B(null), q = B(p), [kt, Jo] = c(""), [er, tr] = c(0), [nr, Pt] = c(!1), [or, Ie] = c([]), [Ut, rr] = c({ top: 0, left: 0 }), [vt, ye] = c(!1), [xe, Ae] = c(!1), [ce, wt] = c(!1), [Kt, Ft] = c(D), [lr, ir] = c(Re), [cr, sr] = c(ei), [ar, yt] = c(oi), [ur, _r] = c(Re), [Xe, Ge] = c({ open: !1, x: p, y: p }), [dr, xt] = c(!1), [We, Ve] = c({
142
+ }), ce = D(null), j = D(p), [vt, or] = c(""), [rr, lr] = c(0), [ir, wt] = c(!1), [cr, Ae] = c([]), [Kt, sr] = c({ top: 0, left: 0 }), [Ft, Xe] = c(!1), [Ge, he] = c(!1), [se, yt] = c(!1), [xt, Xt] = c(M), [ar, ur] = c(be), [_r, dr] = c(ri), [Tr, Gt] = c(ci), [fr, Er] = c(be), [We, Ve] = c({ open: !1, x: p, y: p }), [mr, Wt] = c(!1), [Ye, ze] = c({
138
143
  open: !1,
139
144
  x: p,
140
145
  y: p
141
- }), [Ye, j] = c({
146
+ }), [$e, Z] = c({
142
147
  open: !1,
143
148
  top: p,
144
149
  left: p
145
- }), [Z, Xt] = c(
146
- () => _s(X, G) ?? Le
147
- ), [Tr, Gt] = c(() => W !== void 0 ? W : ds(X, G) ?? !1), [Er, Wt] = c(!1), Vt = B(!0), fr = Le.join(","), v = ee ?? qo, se = te ?? jo, ze = ne ?? Zo, Yt = mo ?? a.slash, [$e, mr] = c(
148
- () => Ao ?? me === Pn
149
- ), [zt, m] = c(D), [pr, Lr] = c(!1), Q = B(null), [Or, qe] = c(!1), [Cr, Nr] = c("values"), [Ir, Ar] = c(be), [hr, gr] = c(() => to(null)), [Rr, br] = c(Is), [$t, Sr] = c(!1), Br = !!(a.outline && $e), F = hs(Z.length), qt = W ?? Tr, jt = Le, Dr = Ts(jt), je = Nt === $l ? void 0 : Nt, Ze = !!(a.ai && (E != null && E.enabled) && E.autocomplete !== !1 && !i && !s), Qe = () => {
150
- ie.current !== null && (window.clearTimeout(ie.current), ie.current = null);
151
- }, P = () => {
152
- Qe(), q.current += 1, le(
150
+ }), [Q, Vt] = c(
151
+ () => Es(G, W) ?? Oe
152
+ ), [pr, Yt] = c(() => V !== void 0 ? V : ms(G, W) ?? !1), [Lr, zt] = c(!1), $t = D(!0), Or = Oe.join(","), w = te ?? Jo, ae = ne ?? er, qe = oe ?? tr, qt = Co ?? a.slash, [je, Cr] = c(
153
+ () => bo ?? pe === Kn
154
+ ), [jt, m] = c(M), [Nr, Ir] = c(!1), J = D(null), [Ar, Ze] = c(!1), [hr, gr] = c("values"), [Rr, br] = c(Se), [Sr, Br] = c(() => lo(null)), [Dr, Mr] = c(ht || Rs), Zt = ht ?? Dr, [Qt, Hr] = c(!1), kr = !!(a.outline && je), y = Ss(Q.length), Jt = V ?? pr, en = Oe, Pr = ps(en), Qe = At === Ql ? void 0 : At, Je = !!(a.ai && (f != null && f.enabled) && f.autocomplete !== !1 && !i && !s), et = () => {
155
+ ce.current !== null && (window.clearTimeout(ce.current), ce.current = null);
156
+ }, U = () => {
157
+ et(), j.current += 1, ie(
153
158
  (e) => e.visible || e.suggestion ? { visible: !1, suggestion: "", top: p, left: p } : e
154
159
  );
155
- }, Mr = () => {
156
- if (!Ze || Ne || !o.current) {
157
- P();
160
+ }, Ur = () => {
161
+ if (!Je || Ie || !o.current) {
162
+ U();
158
163
  return;
159
164
  }
160
165
  const e = window.getSelection();
161
166
  if (!e || !e.isCollapsed) {
162
- P();
167
+ U();
163
168
  return;
164
169
  }
165
- Qe(), le(
170
+ et(), ie(
166
171
  (n) => n.visible || n.suggestion ? { ...n, visible: !1, suggestion: "" } : n
167
172
  );
168
- const t = (E == null ? void 0 : E.providerId) || qi;
169
- ie.current = window.setTimeout(() => {
170
- if (ie.current = null, !o.current || Ht.current) return;
173
+ const t = (f == null ? void 0 : f.providerId) || Ji;
174
+ ce.current = window.setTimeout(() => {
175
+ if (ce.current = null, !o.current || Ut.current) return;
171
176
  const n = window.getSelection();
172
177
  if (!n || !n.isCollapsed) return;
173
- const l = Gs(o.current), u = co(o.current);
178
+ const l = zs(o.current), u = _o(o.current);
174
179
  if (!l.trim() || !u) return;
175
- const T = q.current + 1;
176
- q.current = T;
180
+ const T = j.current + 1;
181
+ j.current = T;
177
182
  const L = o.current.innerHTML;
178
- ws.runProvider(t, {
183
+ xs.runProvider(t, {
179
184
  capability: "autocomplete",
180
185
  html: L,
181
186
  prompt: l,
182
- modelId: E == null ? void 0 : E.modelId
183
- }).then((d) => {
184
- var _e;
185
- if (T !== q.current) return;
186
- const C = ((_e = d.text) == null ? void 0 : _e.trim()) || "";
187
+ modelId: f == null ? void 0 : f.modelId
188
+ }).then((_) => {
189
+ var de;
190
+ if (T !== j.current) return;
191
+ const C = ((de = _.text) == null ? void 0 : de.trim()) || "";
187
192
  if (!C) {
188
- le({
193
+ ie({
189
194
  visible: !1,
190
195
  suggestion: "",
191
196
  top: p,
@@ -193,322 +198,322 @@ const mt = () => {
193
198
  });
194
199
  return;
195
200
  }
196
- const he = o.current && co(o.current) || u;
197
- le({
201
+ const ge = o.current && _o(o.current) || u;
202
+ ie({
198
203
  visible: !0,
199
204
  suggestion: C,
200
- top: he.top,
201
- left: he.left
205
+ top: ge.top,
206
+ left: ge.left
202
207
  });
203
208
  }).catch(() => {
204
- T === q.current && le({
209
+ T === j.current && ie({
205
210
  visible: !1,
206
211
  suggestion: "",
207
212
  top: p,
208
213
  left: p
209
214
  });
210
215
  });
211
- }, xs);
216
+ }, Vs);
212
217
  };
213
- b(() => () => {
214
- Qe(), q.current += 1;
215
- }, []), b(() => {
216
- Ht.current = Ne, Ne && P();
217
- }, [Ne]), b(() => {
218
- pe !== void 0 && bt(pe);
219
- }, [pe]), b(() => {
220
- ee && St(ee);
221
- }, [ee]), b(() => {
222
- te && Bt(te);
223
- }, [te]), b(() => {
224
- ne !== void 0 && Dt(ne);
225
- }, [ne]), b(() => {
226
- W !== void 0 && Gt(W);
227
- }, [W]), b(() => {
228
- if (Vt.current) {
229
- Vt.current = !1;
218
+ S(() => () => {
219
+ et(), j.current += 1;
220
+ }, []), S(() => {
221
+ Ut.current = Ie, Ie && U();
222
+ }, [Ie]), S(() => {
223
+ Le !== void 0 && Dt(Le);
224
+ }, [Le]), S(() => {
225
+ te && Mt(te);
226
+ }, [te]), S(() => {
227
+ ne && Ht(ne);
228
+ }, [ne]), S(() => {
229
+ oe !== void 0 && kt(oe);
230
+ }, [oe]), S(() => {
231
+ V !== void 0 && Yt(V);
232
+ }, [V]), S(() => {
233
+ if ($t.current) {
234
+ $t.current = !1;
230
235
  return;
231
236
  }
232
- Xt(Le);
233
- }, [fr]), b(() => {
234
- if (!o.current || g === void 0 || g === Y.current) return;
237
+ Vt(Oe);
238
+ }, [Or]), S(() => {
239
+ if (!o.current || g === void 0 || g === z.current) return;
235
240
  if (o.current.innerHTML === g) {
236
- Y.current = g;
241
+ z.current = g;
237
242
  return;
238
243
  }
239
244
  const e = document.activeElement === o.current;
240
- Et(e ? o.current : null, () => {
245
+ mt(e ? o.current : null, () => {
241
246
  o.current && (o.current.innerHTML = g);
242
- }), Y.current = g;
243
- }, [g]), b(() => {
247
+ }), z.current = g;
248
+ }, [g]), S(() => {
244
249
  if (!o.current) return;
245
- const e = X ? is(G) : "";
250
+ const e = G ? us(W) : "";
246
251
  if (e) {
247
- o.current.innerHTML = e, Y.current = e, oe.current = new Tt(e), k == null || k(e), a.outline && z(J(o.current));
252
+ o.current.innerHTML = e, z.current = e, re.current = new Et(e), P == null || P(e), a.outline && $(ee(o.current));
248
253
  return;
249
254
  }
250
255
  if (g !== void 0) {
251
- a.outline && z(J(o.current));
256
+ a.outline && $(ee(o.current));
252
257
  return;
253
258
  }
254
- H && (o.current.innerHTML = H, Y.current = H, oe.current = new Tt(H), k == null || k(H), a.outline && z(J(o.current)));
255
- }, []), b(() => {
259
+ k && (o.current.innerHTML = k, z.current = k, re.current = new Et(k), P == null || P(k), a.outline && $(ee(o.current)));
260
+ }, []), S(() => {
256
261
  const e = () => {
257
- Sr(document.fullscreenElement === Oe.current);
262
+ Hr(document.fullscreenElement === Ce.current);
258
263
  };
259
264
  return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
260
265
  }, []);
261
- const Je = (e) => {
262
- if (oe.current.push(e), Y.current = e, k == null || k(e), X && cs(e, G), Ot && o.current) {
263
- const n = o.current.textContent ?? D;
264
- vo(n.length), Ko(Jc(n));
266
+ const tt = (e) => {
267
+ if (re.current.push(e), z.current = e, P == null || P(e), G && _s(e, W), Nt && o.current) {
268
+ const n = o.current.textContent ?? M;
269
+ yo(n.length), Xo(os(n));
265
270
  }
266
- a.outline && z(J(o.current));
267
- const t = Qn(o.current);
268
- gt(t.line), Rt(t.col);
269
- }, w = (e) => {
270
- o.current && (Et(o.current, () => {
271
+ a.outline && $(ee(o.current));
272
+ const t = no(o.current);
273
+ St(t.line), Bt(t.col);
274
+ }, K = (e) => {
275
+ o.current && (mt(o.current, () => {
271
276
  o.current && (o.current.innerHTML = e);
272
- }), Je(e));
273
- }, et = (e) => {
274
- Gt(e), ve == null || ve(e), Es(e, X, G);
275
- }, Hr = (e) => {
276
- Xt(e), Ue == null || Ue(e), ms(e, X, G);
277
- }, kr = (e, t) => {
278
- if (e === kn) return;
277
+ }), tt(e));
278
+ }, nt = (e) => {
279
+ Yt(e), Ke == null || Ke(e), Ls(e, G, W);
280
+ }, vr = (e) => {
281
+ Vt(e), we == null || we(e), Cs(e, G, W);
282
+ }, wr = (e, t) => {
283
+ if (e === wn) return;
279
284
  const n = new Set(
280
- Z.filter((l) => l !== kn)
285
+ Q.filter((l) => l !== wn)
281
286
  );
282
- t ? n.add(e) : n.delete(e), Hr(fs(jt, n));
283
- }, ae = (e) => {
284
- St(e), Me == null || Me(e);
285
- }, tt = (e) => {
286
- Bt(e), ke == null || ke(e);
287
- }, nt = (e) => {
288
- Dt(e), Pe == null || Pe(e);
289
- }, Pr = (e) => {
290
- bt(e), He == null || He(e);
291
- }, Ur = () => {
287
+ t ? n.add(e) : n.delete(e), vr(Os(en, n));
288
+ }, ue = (e) => {
289
+ Mt(e), He == null || He(e);
290
+ }, ot = (e) => {
291
+ Ht(e), Pe == null || Pe(e);
292
+ }, rt = (e) => {
293
+ kt(e), Ue == null || Ue(e);
294
+ }, Kr = (e) => {
295
+ Dt(e), ke == null || ke(e);
296
+ }, Fr = () => {
292
297
  if (i || s) {
293
- j((u) => u.open ? { ...u, open: !1 } : u);
298
+ Z((u) => u.open ? { ...u, open: !1 } : u);
294
299
  return;
295
300
  }
296
301
  const e = window.getSelection();
297
- if (!e || e.isCollapsed || e.rangeCount === 0 || !Qs(e, o.current)) {
298
- j((u) => u.open ? { ...u, open: !1 } : u);
302
+ if (!e || e.isCollapsed || e.rangeCount === 0 || !na(e, o.current)) {
303
+ Z((u) => u.open ? { ...u, open: !1 } : u);
299
304
  return;
300
305
  }
301
306
  const n = e.getRangeAt(0).getBoundingClientRect();
302
307
  if (n.width === 0 && n.height === 0) {
303
- j((u) => u.open ? { ...u, open: !1 } : u);
308
+ Z((u) => u.open ? { ...u, open: !1 } : u);
304
309
  return;
305
310
  }
306
- const l = Js({
311
+ const l = oa({
307
312
  selectionRect: n,
308
- toolbarWidth: qs,
309
- toolbarHeight: js,
313
+ toolbarWidth: Js,
314
+ toolbarHeight: ea,
310
315
  viewport: { width: window.innerWidth, height: window.innerHeight },
311
- gap: Zs,
312
- edgePadding: $s
316
+ gap: ta,
317
+ edgePadding: Qs
313
318
  });
314
- j({ open: !0, top: l.top, left: l.left });
315
- }, ue = () => {
319
+ Z({ open: !0, top: l.top, left: l.left });
320
+ }, _e = () => {
316
321
  var L;
317
- ko(Ss());
318
- const e = Bs("formatBlock");
319
- e && ht(e.toLowerCase().replace(/[<>]/g, "")), yt(Ds()), Jo(mt());
322
+ wo(Hs());
323
+ const e = ks("formatBlock");
324
+ e && bt(e.toLowerCase().replace(/[<>]/g, "")), Gt(Ps()), or(Lt());
320
325
  const t = (L = window.getSelection()) == null ? void 0 : L.toString().trim();
321
- t && (Ce.current = t), Ur();
322
- const n = Qn(o.current);
323
- if (gt(n.line), Rt(n.col), a.outline && z(J(o.current)), !o.current || !a.blocks) return;
324
- const l = window.getSelection(), u = (l == null ? void 0 : l.anchorNode) ?? null, T = Te(u, o.current);
325
- if ($n(o.current, T), T) {
326
- const d = o.current.getBoundingClientRect(), C = T.getBoundingClientRect();
327
- tr(C.top - d.top + o.current.scrollTop), Pt(!0);
326
+ t && (Ne.current = t), Fr();
327
+ const n = no(o.current);
328
+ if (St(n.line), Bt(n.col), a.outline && $(ee(o.current)), !o.current || !a.blocks) return;
329
+ const l = window.getSelection(), u = (l == null ? void 0 : l.anchorNode) ?? null, T = fe(u, o.current);
330
+ if (Qn(o.current, T), T) {
331
+ const _ = o.current.getBoundingClientRect(), C = T.getBoundingClientRect();
332
+ lr(C.top - _.top + o.current.scrollTop), wt(!0);
328
333
  } else
329
- Pt(!1);
330
- }, _ = () => {
334
+ wt(!1);
335
+ }, d = () => {
331
336
  var t, n, l;
332
337
  if (!o.current) return;
333
338
  let e = o.current.innerHTML;
334
- if ($ && a.trackChanges) {
339
+ if (q && a.trackChanges) {
335
340
  const u = window.getSelection();
336
341
  if (u && !u.isCollapsed) {
337
- const T = mt();
342
+ const T = Lt();
338
343
  if (T) {
339
- const L = dt("delete", T, x);
340
- ae([...v, L]), vr(L.id), e = o.current.innerHTML;
344
+ const L = ft("delete", T, X);
345
+ ue([...w, L]), yr(L.id), e = o.current.innerHTML;
341
346
  }
342
347
  }
343
348
  }
344
- if (Je(e), ue(), Yt && o.current) {
345
- const u = ((n = (t = window.getSelection()) == null ? void 0 : t.anchorNode) == null ? void 0 : n.textContent) ?? "", T = Zc(u);
349
+ if (tt(e), _e(), qt && o.current) {
350
+ const u = ((n = (t = window.getSelection()) == null ? void 0 : t.anchorNode) == null ? void 0 : n.textContent) ?? "", T = ts(u);
346
351
  if (T !== null) {
347
- Fe(T), Ie(Qc(T));
352
+ xe(T), Ae(ns(T));
348
353
  const L = (l = window.getSelection()) == null ? void 0 : l.getRangeAt(0);
349
354
  if (L && o.current) {
350
- const d = L.getBoundingClientRect(), C = o.current.getBoundingClientRect();
351
- rr({
352
- top: d.bottom - C.top + 8,
353
- left: d.left - C.left
355
+ const _ = L.getBoundingClientRect(), C = o.current.getBoundingClientRect();
356
+ sr({
357
+ top: _.bottom - C.top + 8,
358
+ left: _.left - C.left
354
359
  });
355
360
  }
356
361
  } else
357
- Fe(D), Ie([]);
362
+ xe(M), Ae([]);
358
363
  }
359
- Ze ? Mr() : P();
364
+ Je ? Ur() : U();
360
365
  };
361
- b(() => {
366
+ S(() => {
362
367
  const e = o.current;
363
368
  if (!e || i || s || !a.table) return;
364
369
  const t = (l) => {
365
370
  const u = l.target;
366
371
  if (!(u instanceof Element)) return;
367
- const T = u.closest(Xn);
372
+ const T = u.closest(Yn);
368
373
  if (!T || !e.contains(T)) return;
369
- const L = T.closest(ut);
374
+ const L = T.closest(dt);
370
375
  if (!L) return;
371
- const d = Wn(l.clientX, T, pn);
372
- if (d === null) return;
376
+ const _ = $n(l.clientX, T, Nn);
377
+ if (_ === null) return;
373
378
  l.preventDefault();
374
- const C = l.clientX, he = T.getBoundingClientRect().width;
375
- L.classList.add(de);
376
- const _e = (cl) => {
377
- vc(L, d, he + (cl.clientX - C));
378
- }, fn = () => {
379
- L.classList.remove(de), document.removeEventListener("pointermove", _e), document.removeEventListener("pointerup", fn), _();
379
+ const C = l.clientX, ge = T.getBoundingClientRect().width;
380
+ L.classList.add(Te);
381
+ const de = (_l) => {
382
+ yc(L, _, ge + (_l.clientX - C));
383
+ }, On = () => {
384
+ L.classList.remove(Te), document.removeEventListener("pointermove", de), document.removeEventListener("pointerup", On), d();
380
385
  };
381
- document.addEventListener("pointermove", _e), document.addEventListener("pointerup", fn);
386
+ document.addEventListener("pointermove", de), document.addEventListener("pointerup", On);
382
387
  }, n = (l) => {
383
388
  const u = l.target;
384
389
  if (!(u instanceof Element)) return;
385
- const T = u.closest(Xn);
386
- if (e.querySelectorAll(ut).forEach((C) => {
387
- C.classList.contains(de) || C.classList.remove(de);
390
+ const T = u.closest(Yn);
391
+ if (e.querySelectorAll(dt).forEach((C) => {
392
+ C.classList.contains(Te) || C.classList.remove(Te);
388
393
  }), !T || !e.contains(T)) return;
389
- const d = T.closest(ut);
390
- d && Wn(l.clientX, T, pn) !== null && d.classList.add(de);
394
+ const _ = T.closest(dt);
395
+ _ && $n(l.clientX, T, Nn) !== null && _.classList.add(Te);
391
396
  };
392
397
  return e.addEventListener("pointerdown", t), e.addEventListener("pointermove", n), () => {
393
398
  e.removeEventListener("pointerdown", t), e.removeEventListener("pointermove", n);
394
399
  };
395
400
  }, [i, s, a.table]);
396
- const Zt = () => {
397
- const e = U.suggestion;
401
+ const tn = () => {
402
+ const e = v.suggestion;
398
403
  if (!e) {
399
- P();
404
+ U();
400
405
  return;
401
406
  }
402
- I(o.current), h(Xs, e), P(), _();
403
- }, vr = (e) => {
407
+ I(o.current), h(Ys, e), U(), d();
408
+ }, yr = (e) => {
404
409
  const t = window.getSelection();
405
410
  if (!t || t.rangeCount === 0) return;
406
- const n = mt();
407
- n && A(zc(n, e));
408
- }, wr = () => {
409
- if (!o.current || !To || !a.typoAutoFix || i || s) return;
410
- const e = o.current.innerHTML, t = Uc(e);
411
- t.html !== e && (Et(o.current, () => {
411
+ const n = Lt();
412
+ n && A(Zc(n, e));
413
+ }, xr = () => {
414
+ if (!o.current || !po || !a.typoAutoFix || i || s) return;
415
+ const e = o.current.innerHTML, t = Fc(e);
416
+ t.html !== e && (mt(o.current, () => {
412
417
  o.current && (o.current.innerHTML = t.html);
413
- }), Je(t.html));
414
- }, R = (e) => {
418
+ }), tt(t.html));
419
+ }, b = (e) => {
415
420
  if (i || s) return;
416
421
  if (I(o.current), e === "clearFormat") {
417
- Us(), _();
422
+ Fs(), d();
418
423
  return;
419
424
  }
420
425
  if (e === "directionLtr" && o.current) {
421
- lo(o.current, _i), _();
426
+ ao(o.current, Ei), d();
422
427
  return;
423
428
  }
424
429
  if (e === "directionRtl" && o.current) {
425
- lo(o.current, di), _();
430
+ ao(o.current, mi), d();
426
431
  return;
427
432
  }
428
- if (e === ge) {
429
- A(yn), _();
433
+ if (e === Re) {
434
+ A(Wn), d();
430
435
  return;
431
436
  }
432
- const t = at[e];
433
- t && (t.value ? h(t.command, t.value) : h(t.command), _());
434
- }, Kr = (e) => {
435
- i || s || (I(o.current), h("formatBlock", e), ht(e), _());
436
- }, Fr = (e) => {
437
- i || s || (I(o.current), ks(e), sr(e), _());
438
- }, yr = (e) => {
439
- i || s || (I(o.current), Ps(e), yt(e), _());
440
- }, Qt = (e) => {
441
- ir(e), _r(e), Ae(!0);
442
- }, xr = (e) => {
437
+ const t = _t[e];
438
+ t && (t.value ? h(t.command, t.value) : h(t.command), d());
439
+ }, Xr = (e) => {
440
+ i || s || (I(o.current), h("formatBlock", e), bt(e), d());
441
+ }, Gr = (e) => {
442
+ i || s || (I(o.current), ws(e), dr(e), d());
443
+ }, Wr = (e) => {
444
+ i || s || (I(o.current), Ks(e), Gt(e), d());
445
+ }, nn = (e) => {
446
+ ur(e), Er(e), he(!0);
447
+ }, Vr = (e) => {
443
448
  if (i || s) return;
444
- Qt(e === ai ? si : Re);
445
- }, ot = () => {
449
+ nn(e === Ti ? di : be);
450
+ }, lt = () => {
446
451
  var l;
447
452
  if (i || s) return;
448
- const e = as(o.current), t = ((l = window.getSelection()) == null ? void 0 : l.toString().trim()) || Ce.current, n = window.prompt(vl, wl);
449
- n && (I(o.current), us(o.current, e), Hs(n, t), _());
450
- }, rt = (e) => {
451
- i || s || (I(o.current), A(e), _());
452
- }, Xr = (e) => {
453
+ const e = Ts(o.current), t = ((l = window.getSelection()) == null ? void 0 : l.toString().trim()) || Ne.current, n = window.prompt(yl, xl);
454
+ n && (I(o.current), fs(o.current, e), vs(n, t), d());
455
+ }, it = (e) => {
456
+ i || s || (I(o.current), A(e), d());
457
+ }, Yr = (e) => {
453
458
  var n;
454
- const t = ((n = window.getSelection()) == null ? void 0 : n.toString().trim()) || Ce.current;
455
- rt(Jn(e, t || On));
456
- }, Jt = async (e) => Bo && At ? At(e) : vs(e), en = async () => {
459
+ const t = ((n = window.getSelection()) == null ? void 0 : n.toString().trim()) || Ne.current;
460
+ it(oo(e, t || An));
461
+ }, on = async (e) => ko && Rt ? Rt(e) : ys(e), rn = async () => {
457
462
  if (i || s) return;
458
463
  const e = document.createElement("input");
459
464
  e.type = "file", e.accept = "image/*", e.onchange = async () => {
460
465
  var l;
461
466
  const t = (l = e.files) == null ? void 0 : l[0];
462
467
  if (!t) return;
463
- const n = await Jt(t);
464
- I(o.current), ft(n, t.name), _();
468
+ const n = await on(t);
469
+ I(o.current), pt(n, t.name), d();
465
470
  }, e.click();
466
- }, tn = (e = po, t = Lo) => {
471
+ }, ln = (e = No, t = Io) => {
467
472
  if (i || s || !a.table) return;
468
473
  I(o.current);
469
- const n = wc(e, t);
470
- if ($ && a.trackChanges) {
471
- const l = dt("insert", n, x);
472
- ae([...v, l]), A(Zn(n, l.id));
474
+ const n = xc(e, t);
475
+ if (q && a.trackChanges) {
476
+ const l = ft("insert", n, X);
477
+ ue([...w, l]), A(to(n, l.id));
473
478
  } else
474
479
  A(n);
475
- _();
476
- }, nn = () => {
477
- const e = oe.current.undo();
480
+ d();
481
+ }, cn = () => {
482
+ const e = re.current.undo();
478
483
  if (e === null || !o.current) {
479
- h("undo"), _();
484
+ h("undo"), d();
480
485
  return;
481
486
  }
482
- w(e);
483
- }, on = () => {
484
- const e = oe.current.redo();
487
+ K(e);
488
+ }, sn = () => {
489
+ const e = re.current.redo();
485
490
  if (e === null || !o.current) {
486
- h("redo"), _();
491
+ h("redo"), d();
487
492
  return;
488
493
  }
489
- w(e);
490
- }, Gr = (e) => {
494
+ K(e);
495
+ }, zr = (e) => {
491
496
  if (i || s) return;
492
- e.preventDefault(), Ve((n) => n.open ? { ...n, open: !1 } : n);
493
- const t = a.graph ? Cs(e.target) : null;
494
- Q.current = t, Lr(!!t), xt(!!(a.table && Vn())), Ge({ open: !0, x: e.clientX, y: e.clientY });
495
- }, lt = (e) => {
496
- const t = Q.current;
497
+ e.preventDefault(), ze((n) => n.open ? { ...n, open: !1 } : n);
498
+ const t = a.graph ? hs(e.target) : null;
499
+ J.current = t, Ir(!!t), Wt(!!(a.table && qn())), Ve({ open: !0, x: e.clientX, y: e.clientY });
500
+ }, ct = (e) => {
501
+ const t = J.current;
497
502
  if (!t) return;
498
- const n = oo(t.getAttribute(Fn));
499
- no(t, e, n.length ? n : be), Q.current = null, _();
500
- }, rn = (e) => {
501
- const t = Q.current;
503
+ const n = co(t.getAttribute(Gn));
504
+ io(t, e, n.length ? n : Se), J.current = null, d();
505
+ }, an = (e) => {
506
+ const t = J.current;
502
507
  if (!t) return;
503
- const n = oo(t.getAttribute(Fn));
504
- Ar(n.length ? n : be), gr(to(t.getAttribute(yi))), Nr(e), qe(!0);
505
- }, Wr = (e, t) => {
506
- const n = Q.current;
508
+ const n = co(t.getAttribute(Gn));
509
+ br(n.length ? n : Se), Br(lo(t.getAttribute(Wi))), gr(e), Ze(!0);
510
+ }, $r = (e, t) => {
511
+ const n = J.current;
507
512
  if (!n) return;
508
- const l = n.getAttribute(Ki) ?? eo;
509
- no(n, l, e, t), qe(!1), _();
510
- }, ln = () => {
511
- const e = Oe.current;
513
+ const l = n.getAttribute(Xi) ?? ro;
514
+ io(n, l, e, t), Ze(!1), d();
515
+ }, un = () => {
516
+ const e = Ce.current;
512
517
  if (!(!e || !a.fullscreen)) {
513
518
  if (document.fullscreenElement) {
514
519
  document.exitFullscreen();
@@ -516,264 +521,264 @@ const mt = () => {
516
521
  }
517
522
  e.requestFullscreen();
518
523
  }
519
- }, Vr = () => {
520
- const e = Q.current;
524
+ }, qr = () => {
525
+ const e = J.current;
521
526
  if (e) {
522
527
  const t = document.createRange();
523
528
  t.selectNodeContents(e);
524
529
  const n = window.getSelection();
525
530
  n == null || n.removeAllRanges(), n == null || n.addRange(t);
526
531
  }
527
- re(!0);
528
- }, cn = () => {
529
- const e = !$e;
530
- mr(e), e && o.current && z(J(o.current)), we == null || we(e);
531
- }, Yr = (e) => {
532
- i || s || (e.preventDefault(), Ge((t) => t.open ? { ...t, open: !1 } : t), Ve({ open: !0, x: e.clientX, y: e.clientY }));
533
- }, sn = () => {
532
+ le(!0);
533
+ }, _n = () => {
534
+ const e = !je;
535
+ Cr(e), e && o.current && $(ee(o.current)), Fe == null || Fe(e);
536
+ }, jr = (e) => {
537
+ i || s || (e.preventDefault(), Ve((t) => t.open ? { ...t, open: !1 } : t), ze({ open: !0, x: e.clientX, y: e.clientY }));
538
+ }, dn = () => {
534
539
  if (i || s || !a.comments) return;
535
540
  const e = window.prompt("Comment:");
536
541
  if (!(e != null && e.trim())) return;
537
- const t = Gn("hl");
538
- if (I(o.current), !qc(t)) return;
539
- const l = jc(x, e.trim(), t);
540
- tt([l, ...se]), nt(!0), _();
541
- }, zr = [
542
+ const t = zn("hl");
543
+ if (I(o.current), !Jc(t)) return;
544
+ const l = es(X, e.trim(), t);
545
+ ot([l, ...ae]), rt(!0), d();
546
+ }, Zr = [
542
547
  {
543
- id: Wl,
544
- label: Gl,
545
- onSelect: () => Wt(!0)
548
+ id: $l,
549
+ label: zl,
550
+ onSelect: () => zt(!0)
546
551
  },
547
552
  {
548
- id: Yl,
549
- label: Vl,
550
- onSelect: () => et(!0)
553
+ id: jl,
554
+ label: ql,
555
+ onSelect: () => nt(!0)
551
556
  }
552
- ], y = (e) => {
553
- const t = Vn();
554
- !t || !a.table || e(t) && _();
555
- }, $r = a.table && dr ? [
556
- {
557
- id: Zi,
558
- label: ji,
559
- onSelect: () => y((e) => Yn(e, "before"))
560
- },
561
- {
562
- id: Ji,
563
- label: Qi,
564
- onSelect: () => y((e) => Yn(e, "after"))
565
- },
557
+ ], x = (e) => {
558
+ const t = qn();
559
+ !t || !a.table || e(t) && d();
560
+ }, Qr = a.table && mr ? [
566
561
  {
567
562
  id: tc,
568
563
  label: ec,
569
- onSelect: () => y((e) => zn(e, "before"))
564
+ onSelect: () => x((e) => jn(e, "before"))
570
565
  },
571
566
  {
572
567
  id: oc,
573
568
  label: nc,
574
- onSelect: () => y((e) => zn(e, "after"))
569
+ onSelect: () => x((e) => jn(e, "after"))
575
570
  },
576
571
  {
577
572
  id: lc,
578
573
  label: rc,
579
- onSelect: () => y((e) => Kc(e))
574
+ onSelect: () => x((e) => Zn(e, "before"))
580
575
  },
581
576
  {
582
577
  id: cc,
583
578
  label: ic,
584
- onSelect: () => y((e) => Fc(e))
579
+ onSelect: () => x((e) => Zn(e, "after"))
585
580
  },
586
581
  {
587
582
  id: ac,
588
583
  label: sc,
589
- onSelect: () => y((e) => yc(e))
584
+ onSelect: () => x((e) => Xc(e))
585
+ },
586
+ {
587
+ id: _c,
588
+ label: uc,
589
+ onSelect: () => x((e) => Gc(e))
590
+ },
591
+ {
592
+ id: Tc,
593
+ label: dc,
594
+ onSelect: () => x((e) => Wc(e))
590
595
  }
591
- ] : [], qr = [
592
- ...a.graph && pr ? [
593
- {
594
- id: Tl,
595
- label: dl,
596
- onSelect: () => lt("bar")
597
- },
598
- {
599
- id: fl,
600
- label: El,
601
- onSelect: () => lt("line")
602
- },
596
+ ] : [], Jr = [
597
+ ...a.graph && Nr ? [
603
598
  {
604
599
  id: pl,
605
600
  label: ml,
606
- onSelect: () => lt("pie")
601
+ onSelect: () => ct("bar")
607
602
  },
608
603
  {
609
604
  id: Ol,
610
605
  label: Ll,
611
- onSelect: () => rn("values")
606
+ onSelect: () => ct("line")
612
607
  },
613
608
  {
614
609
  id: Nl,
615
610
  label: Cl,
616
- onSelect: () => rn("colors")
611
+ onSelect: () => ct("pie")
617
612
  },
618
613
  {
619
614
  id: Al,
620
615
  label: Il,
621
- onSelect: Vr
616
+ onSelect: () => an("values")
617
+ },
618
+ {
619
+ id: gl,
620
+ label: hl,
621
+ onSelect: () => an("colors")
622
+ },
623
+ {
624
+ id: bl,
625
+ label: Rl,
626
+ onSelect: qr
622
627
  }
623
628
  ] : [],
624
- ...$r,
629
+ ...Qr,
625
630
  {
626
- id: _c,
627
- label: uc,
628
- onSelect: () => R("bold")
629
- },
630
- {
631
- id: Tc,
632
- label: dc,
633
- onSelect: () => R("italic")
634
- },
635
- {
636
- id: fc,
637
- label: Ec,
638
- onSelect: () => R("underline")
631
+ id: Ec,
632
+ label: fc,
633
+ onSelect: () => b("bold")
639
634
  },
640
635
  {
641
636
  id: pc,
642
637
  label: mc,
643
- onSelect: () => R("strikethrough")
638
+ onSelect: () => b("italic")
644
639
  },
645
640
  {
646
641
  id: Oc,
647
642
  label: Lc,
648
- onSelect: () => R("heading2")
643
+ onSelect: () => b("underline")
649
644
  },
650
645
  {
651
646
  id: Nc,
652
647
  label: Cc,
653
- onSelect: () => R("bulletList")
648
+ onSelect: () => b("strikethrough")
654
649
  },
655
650
  {
656
651
  id: Ac,
657
652
  label: Ic,
658
- onSelect: () => R("orderedList")
653
+ onSelect: () => b("heading2")
659
654
  },
660
655
  {
661
656
  id: gc,
662
657
  label: hc,
663
- onSelect: () => ot()
658
+ onSelect: () => b("bulletList")
664
659
  },
665
660
  {
666
661
  id: bc,
667
662
  label: Rc,
668
- onSelect: () => R("clearFormat")
663
+ onSelect: () => b("orderedList")
669
664
  },
670
665
  {
671
666
  id: Bc,
672
667
  label: Sc,
673
- disabled: !a.findReplace,
674
- onSelect: () => Ae(!0)
668
+ onSelect: () => lt()
675
669
  },
676
670
  {
677
671
  id: Mc,
678
672
  label: Dc,
679
- disabled: !a.signature,
680
- onSelect: () => ye(!0)
673
+ onSelect: () => b("clearFormat")
681
674
  },
682
675
  {
683
676
  id: kc,
684
677
  label: Hc,
678
+ disabled: !a.findReplace,
679
+ onSelect: () => he(!0)
680
+ },
681
+ {
682
+ id: Uc,
683
+ label: Pc,
684
+ disabled: !a.signature,
685
+ onSelect: () => Xe(!0)
686
+ },
687
+ {
688
+ id: wc,
689
+ label: vc,
685
690
  disabled: !a.comments,
686
- onSelect: () => sn()
691
+ onSelect: () => dn()
687
692
  },
688
- ...qt ? [
693
+ ...Jt ? [
689
694
  {
690
- id: Xl,
691
- label: xl,
692
- onSelect: () => et(!1)
695
+ id: Yl,
696
+ label: Vl,
697
+ onSelect: () => nt(!1)
693
698
  }
694
699
  ] : []
695
- ], an = (e) => {
700
+ ], Tn = (e) => {
696
701
  if (!o.current) return;
697
- const t = Yc(o.current.innerHTML, e);
698
- w(t), ae(
699
- v.map((n) => n.id === e ? { ...n, accepted: !0 } : n)
702
+ const t = jc(o.current.innerHTML, e);
703
+ K(t), ue(
704
+ w.map((n) => n.id === e ? { ...n, accepted: !0 } : n)
700
705
  );
701
- }, un = (e) => {
706
+ }, fn = (e) => {
702
707
  if (!o.current) return;
703
- const t = Vc(o.current.innerHTML, e);
704
- w(t), ae(
705
- v.map((n) => n.id === e ? { ...n, rejected: !0 } : n)
708
+ const t = qc(o.current.innerHTML, e);
709
+ K(t), ue(
710
+ w.map((n) => n.id === e ? { ...n, rejected: !0 } : n)
706
711
  );
707
- }, _n = async (e) => {
708
- const t = await Jt(e), n = `<img src="${t}" alt="" style="max-width:100%;height:auto;" />`;
709
- if ($ && a.trackChanges) {
710
- const l = dt("insert", n, x);
711
- ae([...v, l]), A(Zn(n, l.id));
712
+ }, En = async (e) => {
713
+ const t = await on(e), n = `<img src="${t}" alt="" style="max-width:100%;height:auto;" />`;
714
+ if (q && a.trackChanges) {
715
+ const l = ft("insert", n, X);
716
+ ue([...w, l]), A(to(n, l.id));
712
717
  } else
713
- ft(t);
714
- _();
715
- }, jr = async (e) => {
718
+ pt(t);
719
+ d();
720
+ }, el = async (e) => {
716
721
  if (i || s) return;
717
722
  const t = e.clipboardData;
718
723
  if (!t) return;
719
- if (Ho) {
720
- const l = os(t);
724
+ if (vo) {
725
+ const l = cs(t);
721
726
  if (l) {
722
727
  e.preventDefault();
723
- const T = rs(l);
724
- T && (A(T), _());
728
+ const T = ss(l);
729
+ T && (A(T), d());
725
730
  const L = t.items;
726
- if (Lt && L)
727
- for (const d of Array.from(L)) {
728
- if (!d.type.startsWith("image/")) continue;
729
- const C = d.getAsFile();
730
- C && await _n(C);
731
+ if (Ct && L)
732
+ for (const _ of Array.from(L)) {
733
+ if (!_.type.startsWith("image/")) continue;
734
+ const C = _.getAsFile();
735
+ C && await En(C);
731
736
  }
732
737
  return;
733
738
  }
734
- const u = ls(t);
739
+ const u = as(t);
735
740
  if (u) {
736
- e.preventDefault(), A(u.replace(/\n/g, "<br />")), _();
741
+ e.preventDefault(), A(u.replace(/\n/g, "<br />")), d();
737
742
  return;
738
743
  }
739
744
  }
740
- if (!Lt) return;
745
+ if (!Ct) return;
741
746
  const n = t.items;
742
747
  if (n)
743
748
  for (const l of Array.from(n)) {
744
749
  if (!l.type.startsWith("image/")) continue;
745
750
  e.preventDefault();
746
751
  const u = l.getAsFile();
747
- u && await _n(u);
752
+ u && await En(u);
748
753
  }
749
- }, Zr = (e) => {
750
- R(e);
751
- }, Qr = (e) => {
752
- if (e.key === ql && U.visible && U.suggestion) {
753
- e.preventDefault(), Zt();
754
+ }, tl = (e) => {
755
+ b(e);
756
+ }, nl = (e) => {
757
+ if (e.key === Jl && v.visible && v.suggestion) {
758
+ e.preventDefault(), tn();
754
759
  return;
755
760
  }
756
- if (e.key === jl) {
757
- P();
761
+ if (e.key === ei) {
762
+ U();
758
763
  return;
759
764
  }
760
- if (Ms(e.nativeEvent)) {
761
- _();
765
+ if (Us(e.nativeEvent)) {
766
+ d();
762
767
  return;
763
768
  }
764
- if (e.key === Zl) {
765
- if (U.visible) {
766
- e.preventDefault(), P();
769
+ if (e.key === ti) {
770
+ if (v.visible) {
771
+ e.preventDefault(), U();
767
772
  return;
768
773
  }
769
- Ie([]), j((t) => t.open ? { ...t, open: !1 } : t);
774
+ Ae([]), Z((t) => t.open ? { ...t, open: !1 } : t);
770
775
  }
771
- if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === Ql) {
772
- e.preventDefault(), a.ai && (E != null && E.enabled) && re(!0);
776
+ if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === ni) {
777
+ e.preventDefault(), a.ai && (f != null && f.enabled) && le(!0);
773
778
  return;
774
779
  }
775
- (e.metaKey || e.ctrlKey) && e.key === Jl && (e.preventDefault(), e.shiftKey ? on() : nn());
776
- }, Jr = (e) => {
780
+ (e.metaKey || e.ctrlKey) && e.key === oi && (e.preventDefault(), e.shiftKey ? sn() : cn());
781
+ }, ol = (e) => {
777
782
  var n;
778
783
  I(o.current);
779
784
  const t = window.getSelection();
@@ -781,18 +786,18 @@ const mt = () => {
781
786
  const u = t.anchorNode.textContent.replace(/(?:^|\s)\/[^\s]*$/, " ");
782
787
  t.anchorNode.nodeType === Node.TEXT_NODE && (t.anchorNode.textContent = u);
783
788
  }
784
- switch (Fe(D), Ie([]), e.insert) {
789
+ switch (xe(M), Ae([]), e.insert) {
785
790
  case "heading1":
786
- h("formatBlock", zi);
791
+ h("formatBlock", Zi);
787
792
  break;
788
793
  case "heading2":
789
- h("formatBlock", Yi);
794
+ h("formatBlock", ji);
790
795
  break;
791
796
  case "heading3":
792
- h("formatBlock", Vi);
797
+ h("formatBlock", qi);
793
798
  break;
794
799
  case "paragraph":
795
- h("formatBlock", Wi);
800
+ h("formatBlock", $i);
796
801
  break;
797
802
  case "bulletList":
798
803
  h("insertUnorderedList");
@@ -801,130 +806,130 @@ const mt = () => {
801
806
  h("insertOrderedList");
802
807
  break;
803
808
  case "checklist":
804
- A(yn);
809
+ A(Wn);
805
810
  break;
806
811
  case "quote":
807
- h("formatBlock", Gi);
812
+ h("formatBlock", zi);
808
813
  break;
809
814
  case "code":
810
- h("formatBlock", Xi);
815
+ h("formatBlock", Yi);
811
816
  break;
812
817
  case "callout":
813
- A(xi);
818
+ A(Vi);
814
819
  break;
815
820
  case "table":
816
- tn();
821
+ ln();
817
822
  return;
818
823
  case "image":
819
- en();
824
+ rn();
820
825
  return;
821
826
  case "ai":
822
- re(!0);
827
+ le(!0);
823
828
  break;
824
829
  case "titles":
825
- A(Jn(ps, Ce.current || On));
830
+ A(oo(Ns, Ne.current || An));
826
831
  break;
827
832
  case "excel":
828
- A(Ls(Os()));
833
+ A(Is(As()));
829
834
  break;
830
835
  case "graph":
831
- A(Ns(eo, be));
836
+ A(gs(ro, Se));
832
837
  break;
833
838
  }
834
- _();
835
- }, dn = (e) => {
839
+ d();
840
+ }, mn = (e) => {
836
841
  if (!o.current) return;
837
- const t = window.getSelection(), n = Te((t == null ? void 0 : t.anchorNode) ?? null, o.current);
838
- n && Xc(n, e) && (_(), ue());
839
- }, el = (e) => {
842
+ const t = window.getSelection(), n = fe((t == null ? void 0 : t.anchorNode) ?? null, o.current);
843
+ n && Yc(n, e) && (d(), _e());
844
+ }, rl = (e) => {
840
845
  if (!o.current) return;
841
- const t = window.getSelection(), n = Te((t == null ? void 0 : t.anchorNode) ?? null, o.current), l = o.current.querySelector(`.${Fi}`), u = n ?? (l instanceof HTMLElement ? l : null);
846
+ const t = window.getSelection(), n = fe((t == null ? void 0 : t.anchorNode) ?? null, o.current), l = o.current.querySelector(`.${Gi}`), u = n ?? (l instanceof HTMLElement ? l : null);
842
847
  if (!u) {
843
848
  e.preventDefault();
844
849
  return;
845
850
  }
846
- K.current = u, _t(o.current), $n(o.current, u), xc(u), e.dataTransfer.setData(Vs, Ys), e.dataTransfer.effectAllowed = so;
847
- }, tl = (e) => {
848
- if (!o.current || !K.current) return;
849
- e.preventDefault(), e.dataTransfer.dropEffect = so;
850
- const t = Te(e.target, o.current);
851
- if (!t || t === K.current) {
852
- jn(o.current, null, null);
851
+ F.current = u, Tt(o.current), Qn(o.current, u), Vc(u), e.dataTransfer.setData(qs, js), e.dataTransfer.effectAllowed = To;
852
+ }, ll = (e) => {
853
+ if (!o.current || !F.current) return;
854
+ e.preventDefault(), e.dataTransfer.dropEffect = To;
855
+ const t = fe(e.target, o.current);
856
+ if (!t || t === F.current) {
857
+ eo(o.current, null, null);
853
858
  return;
854
859
  }
855
- const n = qn(e.clientY, t);
856
- jn(o.current, t, n);
857
- }, nl = (e) => {
858
- if (!o.current || !K.current) return;
860
+ const n = Jn(e.clientY, t);
861
+ eo(o.current, t, n);
862
+ }, il = (e) => {
863
+ if (!o.current || !F.current) return;
859
864
  e.preventDefault();
860
- const t = Te(e.target, o.current), n = K.current;
861
- t && t !== n && (qn(e.clientY, t) === ui ? Gc(n, t) : Wc(n, t)) && (_(), ue()), _t(o.current), K.current = null;
862
- }, ol = () => {
863
- o.current && _t(o.current), K.current = null;
864
- }, it = (e, t) => {
865
+ const t = fe(e.target, o.current), n = F.current;
866
+ t && t !== n && (Jn(e.clientY, t) === fi ? zc(n, t) : $c(n, t)) && (d(), _e()), Tt(o.current), F.current = null;
867
+ }, cl = () => {
868
+ o.current && Tt(o.current), F.current = null;
869
+ }, st = (e, t) => {
865
870
  var l, u, T, L;
866
871
  if (e === "divider")
867
- return /* @__PURE__ */ r("span", { className: Pi }, `divider-${t}`);
872
+ return /* @__PURE__ */ r("span", { className: Ki }, `divider-${t}`);
868
873
  if (e === "headingDropdown")
869
874
  return /* @__PURE__ */ r(
870
- Se,
875
+ Be,
871
876
  {
872
877
  title: "Heading",
873
- options: Ui,
874
- value: Po || "p",
878
+ options: Fi,
879
+ value: Ko || "p",
875
880
  disabled: i || s,
876
- onChange: Kr
881
+ onChange: Xr
877
882
  },
878
883
  "heading"
879
884
  );
880
- if (e === Cn)
885
+ if (e === hn)
881
886
  return /* @__PURE__ */ r(
882
- Se,
887
+ Be,
883
888
  {
884
- title: ni,
885
- options: ti,
886
- value: cr,
889
+ title: ii,
890
+ options: li,
891
+ value: _r,
887
892
  disabled: i || s,
888
- onChange: Fr
893
+ onChange: Gr
889
894
  },
890
- Cn
895
+ hn
891
896
  );
892
- if (e === Nn)
897
+ if (e === gn)
893
898
  return /* @__PURE__ */ r(
894
- Se,
899
+ Be,
895
900
  {
896
- title: li,
897
- options: ri,
898
- value: ar,
901
+ title: ai,
902
+ options: si,
903
+ value: Tr,
899
904
  disabled: i || s,
900
- onChange: yr
905
+ onChange: Wr
901
906
  },
902
- Nn
907
+ gn
903
908
  );
904
909
  if (e === "textColor")
905
910
  return /* @__PURE__ */ r(
906
- io,
911
+ uo,
907
912
  {
908
913
  title: "Text color",
909
914
  type: "text",
910
- value: Vo,
915
+ value: qo,
911
916
  disabled: i || s,
912
- onChange: (d) => {
913
- I(o.current), Rs(d), Yo(d), _();
917
+ onChange: (_) => {
918
+ I(o.current), Ds(_), jo(_), d();
914
919
  }
915
920
  },
916
921
  "textColor"
917
922
  );
918
923
  if (e === "highlightColor")
919
924
  return /* @__PURE__ */ r(
920
- io,
925
+ uo,
921
926
  {
922
927
  title: "Highlight color",
923
928
  type: "highlight",
924
- value: zo,
929
+ value: Zo,
925
930
  disabled: i || s,
926
- onChange: (d) => {
927
- I(o.current), bs(d), $o(d), _();
931
+ onChange: (_) => {
932
+ I(o.current), Ms(_), Qo(_), d();
928
933
  }
929
934
  },
930
935
  "highlightColor"
@@ -933,12 +938,12 @@ const mt = () => {
933
938
  return /* @__PURE__ */ r(
934
939
  N,
935
940
  {
936
- icon: f.link,
941
+ icon: E.link,
937
942
  title: "Insert link",
938
943
  hint: O.link,
939
944
  onHint: m,
940
945
  disabled: i || s,
941
- onClick: ot
946
+ onClick: lt
942
947
  },
943
948
  "link"
944
949
  );
@@ -948,210 +953,210 @@ const mt = () => {
948
953
  {
949
954
  hint: O.image,
950
955
  onHint: m,
951
- icon: f.image,
956
+ icon: E.image,
952
957
  title: "Insert image",
953
958
  disabled: i || s,
954
959
  onClick: () => {
955
- en();
960
+ rn();
956
961
  }
957
962
  },
958
963
  "image"
959
964
  );
960
- if (e === ge)
965
+ if (e === Re)
961
966
  return /* @__PURE__ */ r(
962
967
  N,
963
968
  {
964
- icon: f.checklist,
969
+ icon: E.checklist,
965
970
  title: "Checklist",
966
971
  hint: O.checklist,
967
972
  onHint: m,
968
973
  disabled: i || s,
969
- onClick: () => R(ge)
974
+ onClick: () => b(Re)
970
975
  },
971
- ge
976
+ Re
972
977
  );
973
978
  if (e === "table")
974
979
  return a.table ? /* @__PURE__ */ r(
975
- ca,
980
+ _a,
976
981
  {
977
- icon: f.table,
982
+ icon: E.table,
978
983
  disabled: i || s,
979
- onSelect: tn
984
+ onSelect: ln
980
985
  },
981
986
  "table"
982
987
  ) : null;
983
- if (e === In)
988
+ if (e === Rn)
984
989
  return a.titles ? /* @__PURE__ */ r(
985
- sa,
990
+ da,
986
991
  {
987
- icon: f.titles,
992
+ icon: E.titles,
988
993
  disabled: i || s,
989
- pluginColor: (l = fe.get("titles")) == null ? void 0 : l.color,
994
+ pluginColor: (l = me.get("titles")) == null ? void 0 : l.color,
990
995
  hint: O.titles,
991
996
  onHint: m,
992
- onSelect: Xr
997
+ onSelect: Yr
993
998
  },
994
- In
999
+ Rn
995
1000
  ) : null;
996
- if (e === An)
1001
+ if (e === bn)
997
1002
  return a.excel ? /* @__PURE__ */ r(
998
- aa,
1003
+ Ta,
999
1004
  {
1000
- icon: f.excel,
1005
+ icon: E.excel,
1001
1006
  disabled: i || s,
1002
- pluginColor: (u = fe.get("excel")) == null ? void 0 : u.color,
1007
+ pluginColor: (u = me.get("excel")) == null ? void 0 : u.color,
1003
1008
  hint: O.excel,
1004
1009
  onHint: m,
1005
- onInsert: rt
1010
+ onInsert: it
1006
1011
  },
1007
- An
1012
+ bn
1008
1013
  ) : null;
1009
- if (e === hn)
1014
+ if (e === Sn)
1010
1015
  return a.graph ? /* @__PURE__ */ r(
1011
- ua,
1016
+ fa,
1012
1017
  {
1013
- icon: f.graph,
1018
+ icon: E.graph,
1014
1019
  disabled: i || s,
1015
- pluginColor: (T = fe.get("graph")) == null ? void 0 : T.color,
1020
+ pluginColor: (T = me.get("graph")) == null ? void 0 : T.color,
1016
1021
  hint: O.graph,
1017
1022
  onHint: m,
1018
- onInsert: rt
1023
+ onInsert: it
1019
1024
  },
1020
- hn
1025
+ Sn
1021
1026
  ) : null;
1022
- if (e === gn)
1027
+ if (e === Bn)
1023
1028
  return a.theme ? /* @__PURE__ */ r(
1024
- da,
1029
+ ma,
1025
1030
  {
1026
- icon: f.theme,
1031
+ icon: E.theme,
1027
1032
  disabled: i,
1028
- pluginColor: (L = fe.get("theme")) == null ? void 0 : L.color,
1033
+ pluginColor: (L = me.get("theme")) == null ? void 0 : L.color,
1029
1034
  hint: O.theme,
1030
1035
  onHint: m,
1031
- value: Rr,
1032
- onChange: (d) => {
1033
- br(d), As(Oe.current, d);
1036
+ value: Zt,
1037
+ onChange: (_) => {
1038
+ Mr(_), ve == null || ve(_), bs(Ce.current, _);
1034
1039
  }
1035
1040
  },
1036
- gn
1041
+ Bn
1037
1042
  ) : null;
1038
- if (e === Rn)
1043
+ if (e === Dn)
1039
1044
  return a.fullscreen ? /* @__PURE__ */ r(
1040
1045
  N,
1041
1046
  {
1042
- icon: f.fullscreen,
1043
- title: $t ? Dl : Ml,
1047
+ icon: E.fullscreen,
1048
+ title: Qt ? Pl : Ul,
1044
1049
  hint: O.fullscreen,
1045
1050
  onHint: m,
1046
- active: $t,
1051
+ active: Qt,
1047
1052
  disabled: i,
1048
- onClick: ln
1053
+ onClick: un
1049
1054
  },
1050
- Rn
1055
+ Dn
1051
1056
  ) : null;
1052
- if (e === bn)
1057
+ if (e === Mn)
1053
1058
  return a.outline ? /* @__PURE__ */ r(
1054
1059
  N,
1055
1060
  {
1056
- icon: f.outline,
1057
- title: Hl,
1061
+ icon: E.outline,
1062
+ title: vl,
1058
1063
  hint: O.outline,
1059
1064
  onHint: m,
1060
- active: $e,
1065
+ active: je,
1061
1066
  disabled: i,
1062
- onClick: cn
1067
+ onClick: _n
1063
1068
  },
1064
- bn
1069
+ Mn
1065
1070
  ) : null;
1066
- if (e === Sn)
1071
+ if (e === Hn)
1067
1072
  return a.htmlSource ? /* @__PURE__ */ r(
1068
1073
  N,
1069
1074
  {
1070
- className: vn,
1071
- icon: /* @__PURE__ */ r("span", { className: wn, children: Pl }),
1072
- title: kl,
1075
+ className: yn,
1076
+ icon: /* @__PURE__ */ r("span", { className: xn, children: Kl }),
1077
+ title: wl,
1073
1078
  hint: O.htmlSource,
1074
1079
  onHint: m,
1075
- active: ce,
1080
+ active: se,
1076
1081
  disabled: i,
1077
1082
  onClick: () => {
1078
- var d;
1079
- if (ce) {
1080
- s || w(Kt), wt(!1);
1083
+ var _;
1084
+ if (se) {
1085
+ s || K(xt), yt(!1);
1081
1086
  return;
1082
1087
  }
1083
- Ft(((d = o.current) == null ? void 0 : d.innerHTML) ?? g ?? D), wt(!0);
1088
+ Xt(((_ = o.current) == null ? void 0 : _.innerHTML) ?? g ?? M), yt(!0);
1084
1089
  }
1085
1090
  },
1086
- Sn
1091
+ Hn
1087
1092
  ) : null;
1088
- if (e === Bn)
1093
+ if (e === kn)
1089
1094
  return a.signature ? /* @__PURE__ */ r(
1090
1095
  N,
1091
1096
  {
1092
- icon: f.signature,
1097
+ icon: E.signature,
1093
1098
  title: "Sign pad",
1094
1099
  hint: O.signature,
1095
1100
  onHint: m,
1096
- active: vt,
1101
+ active: Ft,
1097
1102
  disabled: i || s,
1098
- onClick: () => ye(!0)
1103
+ onClick: () => Xe(!0)
1099
1104
  },
1100
- Bn
1105
+ kn
1101
1106
  ) : null;
1102
- if (e === Dn)
1107
+ if (e === Pn)
1103
1108
  return a.findReplace ? /* @__PURE__ */ r(
1104
1109
  N,
1105
1110
  {
1106
- icon: f.findReplace,
1111
+ icon: E.findReplace,
1107
1112
  title: "Find and replace",
1108
1113
  hint: O.findReplace,
1109
1114
  onHint: m,
1110
- active: xe,
1115
+ active: Ge,
1111
1116
  disabled: i || s,
1112
1117
  onClick: () => {
1113
- xe ? Ae(!1) : Qt(Re);
1118
+ Ge ? he(!1) : nn(be);
1114
1119
  }
1115
1120
  },
1116
- Dn
1121
+ Pn
1117
1122
  ) : null;
1118
- if (e === Mn)
1123
+ if (e === Un)
1119
1124
  return a.findReplace ? /* @__PURE__ */ r(
1120
- Se,
1125
+ Be,
1121
1126
  {
1122
- title: ci,
1123
- options: ii,
1124
- value: ur,
1127
+ title: _i,
1128
+ options: ui,
1129
+ value: fr,
1125
1130
  disabled: i || s,
1126
- onChange: xr
1131
+ onChange: Vr
1127
1132
  },
1128
- Mn
1133
+ Un
1129
1134
  ) : null;
1130
- if (e === Hn)
1135
+ if (e === vn)
1131
1136
  return a.horizontalRule ? /* @__PURE__ */ r(
1132
1137
  N,
1133
1138
  {
1134
- icon: f.horizontalRule,
1139
+ icon: E.horizontalRule,
1135
1140
  title: "Horizontal rule",
1136
1141
  hint: O.horizontalRule,
1137
1142
  onHint: m,
1138
1143
  disabled: i || s,
1139
1144
  onClick: () => {
1140
- I(o.current), A("<hr />"), _();
1145
+ I(o.current), A("<hr />"), d();
1141
1146
  }
1142
1147
  },
1143
- Hn
1148
+ vn
1144
1149
  ) : null;
1145
1150
  if (e === "undo")
1146
1151
  return /* @__PURE__ */ r(
1147
1152
  N,
1148
1153
  {
1149
- icon: f.undo,
1154
+ icon: E.undo,
1150
1155
  title: "Undo",
1151
1156
  hint: O.undo,
1152
1157
  onHint: m,
1153
1158
  disabled: i || s,
1154
- onClick: nn
1159
+ onClick: cn
1155
1160
  },
1156
1161
  "undo"
1157
1162
  );
@@ -1159,12 +1164,12 @@ const mt = () => {
1159
1164
  return /* @__PURE__ */ r(
1160
1165
  N,
1161
1166
  {
1162
- icon: f.redo,
1167
+ icon: E.redo,
1163
1168
  title: "Redo",
1164
1169
  hint: O.redo,
1165
1170
  onHint: m,
1166
1171
  disabled: i || s,
1167
- onClick: on
1172
+ onClick: sn
1168
1173
  },
1169
1174
  "redo"
1170
1175
  );
@@ -1172,13 +1177,13 @@ const mt = () => {
1172
1177
  return a.trackChanges ? /* @__PURE__ */ r(
1173
1178
  N,
1174
1179
  {
1175
- icon: f.trackChanges,
1180
+ icon: E.trackChanges,
1176
1181
  title: "Track changes",
1177
1182
  hint: O.trackChanges,
1178
1183
  onHint: m,
1179
- active: $,
1184
+ active: q,
1180
1185
  disabled: i || s,
1181
- onClick: () => Pr(!$)
1186
+ onClick: () => Kr(!q)
1182
1187
  },
1183
1188
  "trackChanges"
1184
1189
  ) : null;
@@ -1186,343 +1191,353 @@ const mt = () => {
1186
1191
  return a.comments ? /* @__PURE__ */ r(
1187
1192
  N,
1188
1193
  {
1189
- icon: f.comments,
1194
+ icon: E.comments,
1190
1195
  title: "Comments",
1191
1196
  hint: O.comments,
1192
1197
  onHint: m,
1193
- active: ze,
1198
+ active: qe,
1194
1199
  disabled: i || s,
1195
1200
  onClick: () => {
1196
- ze ? nt(!1) : sn();
1201
+ qe ? rt(!1) : dn();
1197
1202
  }
1198
1203
  },
1199
1204
  "comments"
1200
1205
  ) : null;
1201
1206
  if (e === "code") {
1202
- const d = at.code;
1207
+ const _ = _t.code;
1203
1208
  return /* @__PURE__ */ r(
1204
1209
  N,
1205
1210
  {
1206
- className: vn,
1207
- icon: /* @__PURE__ */ S(sl, { children: [
1208
- f.code,
1209
- /* @__PURE__ */ r("span", { className: wn, children: Ul })
1211
+ className: yn,
1212
+ icon: /* @__PURE__ */ B(dl, { children: [
1213
+ E.code,
1214
+ /* @__PURE__ */ r("span", { className: xn, children: Fl })
1210
1215
  ] }),
1211
- title: d.title,
1216
+ title: _.title,
1212
1217
  hint: O.code,
1213
1218
  onHint: m,
1214
- active: Ke.has(e),
1219
+ active: ye.has(e),
1215
1220
  disabled: i || s,
1216
- onClick: () => R(e)
1221
+ onClick: () => b(e)
1217
1222
  },
1218
1223
  "code"
1219
1224
  );
1220
1225
  }
1221
1226
  if (e === "ai") {
1222
- if (!a.ai || !(E != null && E.enabled)) return null;
1223
- const d = fe.get("ai");
1224
- return /* @__PURE__ */ S(
1227
+ if (!a.ai || !(f != null && f.enabled)) return null;
1228
+ const _ = me.get("ai");
1229
+ return /* @__PURE__ */ B(
1225
1230
  "button",
1226
1231
  {
1227
1232
  type: "button",
1228
- className: d ? `${Kn} ${vi}` : Kn,
1229
- title: st,
1230
- style: d ? { "--ink-plugin-color": d.color } : void 0,
1231
- "aria-label": st,
1232
- "aria-pressed": Mt,
1233
+ className: _ ? `${Xn} ${yi}` : Xn,
1234
+ title: ut,
1235
+ style: _ ? { "--ink-plugin-color": _.color } : void 0,
1236
+ "aria-label": ut,
1237
+ "aria-pressed": Pt,
1233
1238
  disabled: i || s,
1234
1239
  onMouseEnter: () => m(O.ai),
1235
- onMouseLeave: () => m(D),
1240
+ onMouseLeave: () => m(M),
1236
1241
  onMouseDown: (C) => {
1237
1242
  C.preventDefault();
1238
1243
  },
1239
- onClick: () => re((C) => !C),
1244
+ onClick: () => le((C) => !C),
1240
1245
  children: [
1241
- /* @__PURE__ */ r("span", { className: wi, "aria-hidden": "true" }),
1242
- st
1246
+ /* @__PURE__ */ r("span", { className: xi, "aria-hidden": "true" }),
1247
+ ut
1243
1248
  ]
1244
1249
  },
1245
1250
  "ai"
1246
1251
  );
1247
1252
  }
1248
- const n = at[e];
1253
+ const n = _t[e];
1249
1254
  return n ? /* @__PURE__ */ r(
1250
1255
  N,
1251
1256
  {
1252
- icon: f[e] ?? e.slice(0, 1).toUpperCase(),
1257
+ icon: E[e] ?? e.slice(0, 1).toUpperCase(),
1253
1258
  title: n.title,
1254
1259
  hint: O[e],
1255
1260
  onHint: m,
1256
- active: Ke.has(e),
1261
+ active: ye.has(e),
1257
1262
  disabled: i || s,
1258
- onClick: () => R(e)
1263
+ onClick: () => b(e)
1259
1264
  },
1260
1265
  e
1261
1266
  ) : null;
1262
- }, Tn = typeof Be == "number" ? `${Be}px` : Be, rl = typeof De == "number" ? `${De}px` : De, ll = !!(E != null && E.enabled && Mt), il = Z.slice(p, F.fitCount), ct = Z.slice(F.fitCount);
1263
- return /* @__PURE__ */ S(
1267
+ }, pn = typeof De == "number" ? `${De}px` : De, sl = typeof Me == "number" ? `${Me}px` : Me, al = !!(f != null && f.enabled && Pt), ul = Q.slice(p, y.fitCount), at = Q.slice(y.fitCount);
1268
+ return /* @__PURE__ */ B(
1264
1269
  "div",
1265
1270
  {
1266
- ref: Oe,
1267
- className: Pc($i, uo),
1268
- "data-testid": _o,
1271
+ ref: Ce,
1272
+ className: Kc(Qi, Eo),
1273
+ "data-testid": mo,
1269
1274
  "data-disabled": i || void 0,
1270
- "data-variant": me,
1271
- "data-chrome": Eo,
1272
- "data-color-mode": je,
1273
- "data-premium": V.active || void 0,
1274
- "data-wysiwyg": Do || void 0,
1275
- style: { ...Mo, ...ho },
1276
- ...go,
1275
+ "data-variant": pe,
1276
+ "data-chrome": Lo,
1277
+ "data-color-mode": Qe,
1278
+ "data-ink-theme": Zt,
1279
+ "data-premium": Y.active || void 0,
1280
+ "data-wysiwyg": Po || void 0,
1281
+ style: { ...Uo, ...So },
1282
+ ...Bo,
1277
1283
  children: [
1278
- qt ? /* @__PURE__ */ r("div", { className: Ii, children: /* @__PURE__ */ r(
1279
- gs,
1284
+ Jt ? /* @__PURE__ */ r("div", { className: Ri, children: /* @__PURE__ */ r(
1285
+ Bs,
1280
1286
  {
1281
1287
  type: "button",
1282
- "aria-label": Fl,
1283
- onClick: () => et(!1),
1284
- children: Kl
1288
+ "aria-label": Gl,
1289
+ onClick: () => nt(!1),
1290
+ children: Xl
1285
1291
  }
1286
- ) }) : /* @__PURE__ */ S(
1292
+ ) }) : /* @__PURE__ */ B(
1287
1293
  "div",
1288
1294
  {
1289
- className: Ai,
1295
+ className: bi,
1290
1296
  role: "toolbar",
1291
1297
  "aria-label": "Ink formatting toolbar",
1292
- onContextMenu: Yr,
1293
- onDoubleClick: ln,
1298
+ onContextMenu: jr,
1299
+ onDoubleClick: un,
1294
1300
  onMouseOver: (e) => {
1295
1301
  const t = e.target.closest("button");
1296
1302
  if (!(t instanceof HTMLElement)) return;
1297
- const n = t.getAttribute("title") || t.getAttribute("aria-label") || D;
1303
+ const n = t.getAttribute("title") || t.getAttribute("aria-label") || M;
1298
1304
  n && m(n);
1299
1305
  },
1300
- onMouseLeave: () => m(D),
1306
+ onMouseLeave: () => m(M),
1301
1307
  children: [
1302
- /* @__PURE__ */ r("div", { className: hi, ref: F.measureRef, "aria-hidden": !0, children: Z.map(it) }),
1303
- /* @__PURE__ */ S("div", { className: gi, ref: F.rowRef, children: [
1304
- il.map(it),
1305
- ct.length > p ? /* @__PURE__ */ r("span", { [Ri]: "", children: /* @__PURE__ */ r(
1308
+ /* @__PURE__ */ r("div", { className: Si, ref: y.measureRef, "aria-hidden": !0, children: Q.map(st) }),
1309
+ /* @__PURE__ */ B("div", { className: Bi, ref: y.rowRef, children: [
1310
+ ul.map(st),
1311
+ R != null && R.collaborators && R.showPresenceStack !== !1 ? /* @__PURE__ */ r(
1312
+ pa,
1313
+ {
1314
+ collaborators: R.collaborators,
1315
+ maxAvatars: R.maxAvatars || 4,
1316
+ onFollow: R.onFollow
1317
+ }
1318
+ ) : null,
1319
+ at.length > p ? /* @__PURE__ */ r("span", { [Di]: "", children: /* @__PURE__ */ r(
1306
1320
  N,
1307
1321
  {
1308
1322
  icon: "⋯",
1309
- title: Ln,
1310
- hint: Ln,
1323
+ title: In,
1324
+ hint: In,
1311
1325
  onHint: m,
1312
- active: F.overflowOpen,
1326
+ active: y.overflowOpen,
1313
1327
  disabled: i,
1314
- onClick: () => F.setOverflowOpen((e) => !e)
1328
+ onClick: () => y.setOverflowOpen((e) => !e)
1315
1329
  }
1316
1330
  ) }) : null
1317
1331
  ] }),
1318
- F.overflowOpen && ct.length > p ? /* @__PURE__ */ r("div", { className: bi, children: ct.map(it) }) : null,
1319
- zt ? /* @__PURE__ */ r("p", { className: Si, children: zt }) : null
1332
+ y.overflowOpen && at.length > p ? /* @__PURE__ */ r("div", { className: Mi, children: at.map(st) }) : null,
1333
+ jt ? /* @__PURE__ */ r("p", { className: Hi, children: jt }) : null
1320
1334
  ]
1321
1335
  }
1322
1336
  ),
1323
1337
  /* @__PURE__ */ r(
1324
- la,
1338
+ aa,
1325
1339
  {
1326
- open: Er,
1327
- options: Dr,
1328
- visibleItems: Z,
1329
- onToggle: kr,
1330
- onClose: () => Wt(!1)
1340
+ open: Lr,
1341
+ options: Pr,
1342
+ visibleItems: Q,
1343
+ onToggle: wr,
1344
+ onClose: () => zt(!1)
1331
1345
  }
1332
1346
  ),
1333
1347
  /* @__PURE__ */ r(
1334
- _a,
1348
+ Ea,
1335
1349
  {
1336
- open: Or,
1337
- mode: Cr,
1338
- points: Ir,
1339
- colors: hr,
1340
- onClose: () => qe(!1),
1341
- onApply: Wr
1350
+ open: Ar,
1351
+ mode: hr,
1352
+ points: Rr,
1353
+ colors: Sr,
1354
+ onClose: () => Ze(!1),
1355
+ onApply: $r
1342
1356
  }
1343
1357
  ),
1344
1358
  /* @__PURE__ */ r(
1345
- oa,
1359
+ ca,
1346
1360
  {
1347
- open: vt,
1348
- onClose: () => ye(!1),
1361
+ open: Ft,
1362
+ onClose: () => Xe(!1),
1349
1363
  onConfirm: (e) => {
1350
- I(o.current), ft(e), _();
1364
+ I(o.current), pt(e), d();
1351
1365
  }
1352
1366
  }
1353
1367
  ),
1354
1368
  /* @__PURE__ */ r(
1355
- ra,
1369
+ sa,
1356
1370
  {
1357
- open: xe,
1358
- focusField: lr,
1359
- onClose: () => Ae(!1),
1371
+ open: Ge,
1372
+ focusField: ar,
1373
+ onClose: () => he(!1),
1360
1374
  onReplace: (e, t, n) => {
1361
1375
  if (!o.current) return;
1362
- const l = ss(o.current.innerHTML, e, t, n);
1363
- w(l);
1376
+ const l = ds(o.current.innerHTML, e, t, n);
1377
+ K(l);
1364
1378
  }
1365
1379
  }
1366
1380
  ),
1367
- $ && a.trackChanges ? /* @__PURE__ */ r(
1368
- na,
1381
+ q && a.trackChanges ? /* @__PURE__ */ r(
1382
+ ia,
1369
1383
  {
1370
- changes: v,
1371
- onAccept: an,
1372
- onReject: un,
1373
- onAcceptAll: () => v.forEach((e) => an(e.id)),
1374
- onRejectAll: () => v.forEach((e) => un(e.id))
1384
+ changes: w,
1385
+ onAccept: Tn,
1386
+ onReject: fn,
1387
+ onAcceptAll: () => w.forEach((e) => Tn(e.id)),
1388
+ onRejectAll: () => w.forEach((e) => fn(e.id))
1375
1389
  }
1376
1390
  ) : null,
1377
- me === "agent" ? /* @__PURE__ */ r("div", { className: "Ink-Editor__agent-bar", role: "status", children: yl }) : null,
1378
- /* @__PURE__ */ S("div", { className: Bi, children: [
1379
- Br ? /* @__PURE__ */ r(
1380
- ta,
1391
+ pe === "agent" ? /* @__PURE__ */ r("div", { className: "Ink-Editor__agent-bar", role: "status", children: Wl }) : null,
1392
+ /* @__PURE__ */ B("div", { className: ki, children: [
1393
+ kr ? /* @__PURE__ */ r(
1394
+ la,
1381
1395
  {
1382
- items: xo,
1383
- activeIndex: Xo,
1384
- onHide: cn,
1396
+ items: Vo,
1397
+ activeIndex: Yo,
1398
+ onHide: _n,
1385
1399
  onSelect: (e) => {
1386
- o.current && (es(o.current, e), Go(e));
1400
+ o.current && (rs(o.current, e), zo(e));
1387
1401
  }
1388
1402
  }
1389
1403
  ) : null,
1390
- /* @__PURE__ */ S("div", { className: Di, children: [
1404
+ /* @__PURE__ */ B("div", { className: Pi, children: [
1391
1405
  a.blocks ? /* @__PURE__ */ r(
1392
- Ws,
1406
+ $s,
1393
1407
  {
1394
- visible: nr && !i && !s,
1395
- top: er,
1396
- onMoveUp: () => dn("up"),
1397
- onMoveDown: () => dn("down"),
1398
- onDragStart: el
1408
+ visible: ir && !i && !s,
1409
+ top: rr,
1410
+ onMoveUp: () => mn("up"),
1411
+ onMoveDown: () => mn("down"),
1412
+ onDragStart: rl
1399
1413
  }
1400
1414
  ) : null,
1415
+ R != null && R.collaborators && R.showRemoteCursors !== !1 ? /* @__PURE__ */ r(La, { collaborators: R.collaborators }) : null,
1401
1416
  /* @__PURE__ */ r(
1402
1417
  "div",
1403
1418
  {
1404
1419
  ref: o,
1405
- className: ce ? `${Un} ${Mi}` : Un,
1406
- contentEditable: !i && !s && !ce,
1420
+ className: se ? `${Fn} ${Ui}` : Fn,
1421
+ contentEditable: !i && !s && !se,
1407
1422
  role: "textbox",
1408
1423
  "aria-multiline": "true",
1409
- "aria-placeholder": pt,
1410
- "data-placeholder": pt,
1424
+ "aria-placeholder": Ot,
1425
+ "data-placeholder": Ot,
1411
1426
  suppressContentEditableWarning: !0,
1412
- style: { minHeight: Tn, maxHeight: rl },
1413
- onInput: _,
1414
- onBlur: wr,
1415
- onKeyUp: ue,
1416
- onKeyDown: Qr,
1417
- onMouseUp: ue,
1418
- onContextMenu: Gr,
1419
- onDragOver: tl,
1420
- onDrop: nl,
1421
- onDragEnd: ol,
1427
+ style: { minHeight: pn, maxHeight: sl },
1428
+ onInput: d,
1429
+ onBlur: xr,
1430
+ onKeyUp: _e,
1431
+ onKeyDown: nl,
1432
+ onMouseUp: _e,
1433
+ onContextMenu: zr,
1434
+ onDragOver: ll,
1435
+ onDrop: il,
1436
+ onDragEnd: cl,
1422
1437
  onPaste: (e) => {
1423
- jr(e);
1438
+ el(e);
1424
1439
  }
1425
1440
  }
1426
1441
  ),
1427
- ce ? /* @__PURE__ */ r(
1428
- ia,
1442
+ se ? /* @__PURE__ */ r(
1443
+ ua,
1429
1444
  {
1430
- value: Kt,
1431
- onChange: Ft,
1445
+ value: xt,
1446
+ onChange: Xt,
1432
1447
  disabled: i || s,
1433
- minHeight: Tn
1448
+ minHeight: pn
1434
1449
  }
1435
1450
  ) : null,
1436
- Yt ? /* @__PURE__ */ r(
1437
- ea,
1451
+ qt ? /* @__PURE__ */ r(
1452
+ ra,
1438
1453
  {
1439
- items: or,
1440
- top: Ut.top,
1441
- left: Ut.left,
1442
- query: Wo,
1443
- onSelect: Jr
1454
+ items: cr,
1455
+ top: Kt.top,
1456
+ left: Kt.left,
1457
+ query: $o,
1458
+ onSelect: ol
1444
1459
  }
1445
1460
  ) : null,
1446
- Ze ? /* @__PURE__ */ r(
1447
- ys,
1461
+ Je ? /* @__PURE__ */ r(
1462
+ Ws,
1448
1463
  {
1449
- suggestion: U.suggestion,
1450
- position: { top: U.top, left: U.left },
1451
- visible: U.visible,
1452
- onAccept: Zt,
1453
- onDismiss: P
1464
+ suggestion: v.suggestion,
1465
+ position: { top: v.top, left: v.left },
1466
+ visible: v.visible,
1467
+ onAccept: tn,
1468
+ onDismiss: U
1454
1469
  }
1455
1470
  ) : null,
1456
1471
  /* @__PURE__ */ r(
1457
- zs,
1472
+ Zs,
1458
1473
  {
1459
- open: Ye.open,
1460
- top: Ye.top,
1461
- left: Ye.left,
1474
+ open: $e.open,
1475
+ top: $e.top,
1476
+ left: $e.left,
1462
1477
  icons: {
1463
- bold: f.bold,
1464
- italic: f.italic,
1465
- underline: f.underline,
1466
- code: f.code,
1467
- link: f.link,
1468
- clearFormat: f.clearFormat
1478
+ bold: E.bold,
1479
+ italic: E.italic,
1480
+ underline: E.underline,
1481
+ code: E.code,
1482
+ link: E.link,
1483
+ clearFormat: E.clearFormat
1469
1484
  },
1470
- activeFormats: Ke,
1485
+ activeFormats: ye,
1471
1486
  disabled: i || s,
1472
- onFormat: Zr,
1473
- onLink: ot,
1474
- onClose: () => j((e) => ({ ...e, open: !1 }))
1487
+ onFormat: tl,
1488
+ onLink: lt,
1489
+ onClose: () => Z((e) => ({ ...e, open: !1 }))
1475
1490
  }
1476
1491
  ),
1477
1492
  /* @__PURE__ */ r(
1478
- ro,
1493
+ so,
1479
1494
  {
1480
- open: Xe.open,
1481
- x: Xe.x,
1482
- y: Xe.y,
1483
- items: qr,
1484
- colorMode: je,
1495
+ open: We.open,
1496
+ x: We.x,
1497
+ y: We.y,
1498
+ items: Jr,
1499
+ colorMode: Qe,
1485
1500
  onClose: () => {
1486
- xt(!1), Ge((e) => ({ ...e, open: !1 }));
1501
+ Wt(!1), Ve((e) => ({ ...e, open: !1 }));
1487
1502
  }
1488
1503
  }
1489
1504
  ),
1490
1505
  /* @__PURE__ */ r(
1491
- ro,
1506
+ so,
1492
1507
  {
1493
- open: We.open,
1494
- x: We.x,
1495
- y: We.y,
1496
- items: zr,
1497
- colorMode: je,
1498
- onClose: () => Ve((e) => ({ ...e, open: !1 }))
1508
+ open: Ye.open,
1509
+ x: Ye.x,
1510
+ y: Ye.y,
1511
+ items: Zr,
1512
+ colorMode: Qe,
1513
+ onClose: () => ze((e) => ({ ...e, open: !1 }))
1499
1514
  }
1500
1515
  )
1501
1516
  ] }),
1502
- ze && a.comments ? /* @__PURE__ */ r(
1503
- Ks,
1517
+ qe && a.comments ? /* @__PURE__ */ r(
1518
+ Xs,
1504
1519
  {
1505
- comments: se,
1506
- author: x,
1507
- onClose: () => nt(!1),
1520
+ comments: ae,
1521
+ author: X,
1522
+ onClose: () => rt(!1),
1508
1523
  onResolve: (e) => {
1509
- const t = se.find((n) => n.id === e);
1510
- tt(
1511
- se.map(
1524
+ const t = ae.find((n) => n.id === e);
1525
+ ot(
1526
+ ae.map(
1512
1527
  (n) => n.id === e ? { ...n, resolved: !0 } : n
1513
1528
  )
1514
- ), t && o.current && w($c(o.current.innerHTML, t.highlightId));
1529
+ ), t && o.current && K(Qc(o.current.innerHTML, t.highlightId));
1515
1530
  },
1516
1531
  onAddReply: (e, t) => {
1517
- tt(
1518
- se.map(
1532
+ ot(
1533
+ ae.map(
1519
1534
  (n) => n.id === e ? {
1520
1535
  ...n,
1521
1536
  replies: [
1522
1537
  ...n.replies,
1523
1538
  {
1524
- id: Gn("reply"),
1525
- author: x,
1539
+ id: zn("reply"),
1540
+ author: X,
1526
1541
  body: t,
1527
1542
  timestamp: Date.now()
1528
1543
  }
@@ -1533,50 +1548,50 @@ const mt = () => {
1533
1548
  }
1534
1549
  }
1535
1550
  ) : null,
1536
- ll && E ? /* @__PURE__ */ r(
1537
- Fs,
1551
+ al && f ? /* @__PURE__ */ r(
1552
+ Gs,
1538
1553
  {
1539
- config: E,
1540
- documentHtml: ((En = o.current) == null ? void 0 : En.innerHTML) ?? g ?? "",
1541
- selectionHtml: kt,
1542
- onBusyChange: Qo,
1543
- onClose: () => re(!1),
1554
+ config: f,
1555
+ documentHtml: ((Ln = o.current) == null ? void 0 : Ln.innerHTML) ?? g ?? "",
1556
+ selectionHtml: vt,
1557
+ onBusyChange: nr,
1558
+ onClose: () => le(!1),
1544
1559
  onApplyHtml: (e) => {
1545
- if (I(o.current), kt)
1560
+ if (I(o.current), vt)
1546
1561
  A(e);
1547
1562
  else {
1548
- w(e);
1563
+ K(e);
1549
1564
  return;
1550
1565
  }
1551
- _();
1566
+ d();
1552
1567
  }
1553
1568
  }
1554
1569
  ) : null
1555
1570
  ] }),
1556
- Ot ? /* @__PURE__ */ S("div", { className: Hi, children: [
1557
- /* @__PURE__ */ S("span", { children: [
1558
- wo,
1571
+ Nt ? /* @__PURE__ */ B("div", { className: vi, children: [
1572
+ /* @__PURE__ */ B("span", { children: [
1573
+ xo,
1559
1574
  " ",
1560
- hl,
1575
+ Sl,
1561
1576
  " ",
1562
- gl,
1577
+ Bl,
1563
1578
  " ",
1564
- Uo,
1565
- Ct ? ` / ${Ct}` : "",
1579
+ Fo,
1580
+ It ? ` / ${It}` : "",
1566
1581
  " ",
1567
- Rl
1582
+ Dl
1568
1583
  ] }),
1569
- /* @__PURE__ */ S("span", { className: ki, children: [
1570
- /* @__PURE__ */ S("span", { children: [
1571
- bl,
1584
+ /* @__PURE__ */ B("span", { className: wi, children: [
1585
+ /* @__PURE__ */ B("span", { children: [
1586
+ Ml,
1572
1587
  " ",
1573
- Fo,
1588
+ Go,
1574
1589
  ", ",
1575
- Sl,
1590
+ Hl,
1576
1591
  " ",
1577
- yo
1592
+ Wo
1578
1593
  ] }),
1579
- /* @__PURE__ */ r("span", { className: "Ink-Editor__footer-sync", children: Bl })
1594
+ /* @__PURE__ */ r("span", { className: "Ink-Editor__footer-sync", children: kl })
1580
1595
  ] })
1581
1596
  ] }) : null
1582
1597
  ]
@@ -1584,5 +1599,5 @@ const mt = () => {
1584
1599
  );
1585
1600
  };
1586
1601
  export {
1587
- Pu as InkEditor
1602
+ Xu as InkEditor
1588
1603
  };