@heyirisai/docx-editor-vue 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +116 -0
  3. package/dist/KeyboardShortcutsDialog-B0fEvXnH.js +2799 -0
  4. package/dist/KeyboardShortcutsDialog-Cmezq6eJ.cjs +1 -0
  5. package/dist/RenderedDomContext-CHc18N_2.js +2 -0
  6. package/dist/TablePropertiesDialog-B6ncvNnv.cjs +1 -0
  7. package/dist/TablePropertiesDialog-P_vyKNTn.js +1145 -0
  8. package/dist/_plugin-vue_export-helper-B52Kst-M.js +8 -0
  9. package/dist/_plugin-vue_export-helper-CX7YVcP6.cjs +1 -0
  10. package/dist/components/DocxEditor/types.d.ts +193 -0
  11. package/dist/components/EditorToolbarContext.d.ts +9 -0
  12. package/dist/components/Toolbar/presets.d.ts +20 -0
  13. package/dist/components/dialogs/index.d.ts +27 -0
  14. package/dist/components/imageContextMenuTypes.d.ts +30 -0
  15. package/dist/components/imageSelectionTypes.d.ts +14 -0
  16. package/dist/components/insertTableState.d.ts +9 -0
  17. package/dist/components/sidebar/cardStyles.d.ts +3 -0
  18. package/dist/components/sidebar/cardUtils.d.ts +1 -0
  19. package/dist/components/sidebar/resolveItemPositions.d.ts +4 -0
  20. package/dist/components/sidebar/sidebarUtils.d.ts +4 -0
  21. package/dist/components/tableStylePresets.d.ts +53 -0
  22. package/dist/components/toolbarUtils.d.ts +1 -0
  23. package/dist/components/ui/Icons.d.ts +1 -0
  24. package/dist/components/ui/fontPickerValue.d.ts +1 -0
  25. package/dist/components/ui/fontPickerValue.test.d.ts +1 -0
  26. package/dist/components/ui/hyperlinkPopupTypes.d.ts +20 -0
  27. package/dist/composables/fileOpen.test.d.ts +1 -0
  28. package/dist/composables/imageOverlayRect.d.ts +44 -0
  29. package/dist/composables/imageOverlayRect.test.d.ts +1 -0
  30. package/dist/composables/index.d.ts +30 -0
  31. package/dist/composables/useAutoSave.d.ts +40 -0
  32. package/dist/composables/useClipboard.d.ts +22 -0
  33. package/dist/composables/useColorMode.d.ts +8 -0
  34. package/dist/composables/useCommentLifecycle.d.ts +62 -0
  35. package/dist/composables/useCommentManagement.d.ts +68 -0
  36. package/dist/composables/useCommentSidebarItems.d.ts +24 -0
  37. package/dist/composables/useCommentSidebarItems.test.d.ts +1 -0
  38. package/dist/composables/useContextMenus.cut.test.d.ts +1 -0
  39. package/dist/composables/useContextMenus.d.ts +39 -0
  40. package/dist/composables/useControllableBoolean.d.ts +16 -0
  41. package/dist/composables/useControllableBoolean.test.d.ts +1 -0
  42. package/dist/composables/useDocumentLifecycle.d.ts +11 -0
  43. package/dist/composables/useDocxEditor.d.ts +96 -0
  44. package/dist/composables/useDocxEditorRefApi.d.ts +53 -0
  45. package/dist/composables/useDragAutoScroll.d.ts +11 -0
  46. package/dist/composables/useFileIO.d.ts +41 -0
  47. package/dist/composables/useFindReplace.d.ts +34 -0
  48. package/dist/composables/useFixedDropdown.d.ts +14 -0
  49. package/dist/composables/useFontLifecycle.d.ts +12 -0
  50. package/dist/composables/useFormattingActions.d.ts +31 -0
  51. package/dist/composables/useHistory.d.ts +9 -0
  52. package/dist/composables/useHostCallbacks.d.ts +7 -0
  53. package/dist/composables/useHyperlinkManagement.d.ts +38 -0
  54. package/dist/composables/useImageActions.d.ts +24 -0
  55. package/dist/composables/useKeyboardShortcuts.d.ts +25 -0
  56. package/dist/composables/useMenuActions.d.ts +26 -0
  57. package/dist/composables/useOutlineSidebar.d.ts +24 -0
  58. package/dist/composables/useOutlineSidebar.test.d.ts +1 -0
  59. package/dist/composables/usePageSetupControls.d.ts +22 -0
  60. package/dist/composables/usePagesPointer.d.ts +86 -0
  61. package/dist/composables/useParagraphStyleOptions.d.ts +18 -0
  62. package/dist/composables/usePortalClass.d.ts +8 -0
  63. package/dist/composables/useSelectionHighlight.d.ts +19 -0
  64. package/dist/composables/useSelectionSync.d.ts +36 -0
  65. package/dist/composables/useTableResize.d.ts +7 -0
  66. package/dist/composables/useTableSelection.d.ts +10 -0
  67. package/dist/composables/useToolbarDropdowns.d.ts +15 -0
  68. package/dist/composables/useToolbarFontSize.d.ts +15 -0
  69. package/dist/composables/useTrackedChanges.d.ts +12 -0
  70. package/dist/composables/useVisualLineNavigation.d.ts +11 -0
  71. package/dist/composables/useWatermarkControls.d.ts +15 -0
  72. package/dist/composables/useWheelZoom.d.ts +10 -0
  73. package/dist/composables/useZoom.d.ts +16 -0
  74. package/dist/composables.cjs +1 -0
  75. package/dist/composables.js +401 -0
  76. package/dist/dialogs.cjs +1 -0
  77. package/dist/dialogs.js +3 -0
  78. package/dist/docx-editor-vue.css +2 -0
  79. package/dist/i18n/LocaleContext.d.ts +1 -0
  80. package/dist/i18n/index.d.ts +26 -0
  81. package/dist/index.cjs +19 -0
  82. package/dist/index.d.ts +24 -0
  83. package/dist/index.js +4449 -0
  84. package/dist/lib/utils.d.ts +10 -0
  85. package/dist/plugin-api/RenderedDomContext.d.ts +1 -0
  86. package/dist/plugin-api/index.d.ts +18 -0
  87. package/dist/plugin-api/types.d.ts +28 -0
  88. package/dist/plugin-api.cjs +1 -0
  89. package/dist/plugin-api.js +62 -0
  90. package/dist/renderAsync.d.ts +31 -0
  91. package/dist/styles/index.d.ts +12 -0
  92. package/dist/styles/zIndex.d.ts +24 -0
  93. package/dist/styles.cjs +1 -0
  94. package/dist/styles.js +5 -0
  95. package/dist/ui.cjs +18 -0
  96. package/dist/ui.d.ts +79 -0
  97. package/dist/ui.js +986 -0
  98. package/dist/useCommentSidebarItems-DBeGKNGA.cjs +1 -0
  99. package/dist/useCommentSidebarItems-DXbF857R.js +45 -0
  100. package/dist/useDragAutoScroll-CVltVfKK.js +520 -0
  101. package/dist/useDragAutoScroll-liP5PRvM.cjs +1 -0
  102. package/dist/usePortalClass-B9gFYxe0.cjs +4 -0
  103. package/dist/usePortalClass-HM-UHRlE.js +3534 -0
  104. package/dist/utils/domQueries.d.ts +39 -0
  105. package/dist/utils/imageClipboard.d.ts +9 -0
  106. package/dist/utils/refApiQueries.d.ts +10 -0
  107. package/dist/zIndex-CH0jZ7U7.cjs +1 -0
  108. package/dist/zIndex-CxELVe_L.js +12 -0
  109. package/package.json +119 -0
@@ -0,0 +1,3534 @@
1
+ import { f as e, u as t } from "./KeyboardShortcutsDialog-B0fEvXnH.js";
2
+ import { t as n } from "./_plugin-vue_export-helper-B52Kst-M.js";
3
+ import { t as r } from "./useCommentSidebarItems-DXbF857R.js";
4
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, inject as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as _, onMounted as v, openBlock as y, provide as b, reactive as x, ref as S, renderList as C, renderSlot as w, resolveDynamicComponent as T, toDisplayString as E, unref as D, vModelSelect as O, vModelText as k, watch as A, withCtx as j, withDirectives as M, withKeys as N, withModifiers as P } from "vue";
5
+ import { excludeFontsByName as F, generateThemeTintShadeMatrix as ee, resolveColor as I, resolveColorToHex as L, resolveHighlightColor as R } from "@heyirisai/docx-editor-core/utils";
6
+ import { redoDepth as z, undoDepth as B } from "prosemirror-history";
7
+ import { extractSelectionContext as te } from "@heyirisai/docx-editor-core/prosemirror/plugins/selectionTracker";
8
+ import { clearFormatting as V } from "@heyirisai/docx-editor-core/prosemirror/commands/formatting";
9
+ import { normalizeFontFamilies as H } from "@heyirisai/docx-editor-core/utils/fontOptions";
10
+ import { getStylePreviewProps as U, resolveParagraphStyleOptions as W } from "@heyirisai/docx-editor-core/utils/stylePreview";
11
+ import { getTableContext as G } from "@heyirisai/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
12
+ import { formatDate as K, getAvatarColor as q, getCommentText as J, getInitials as Y, truncateText as X } from "@heyirisai/docx-editor-core/utils/comments";
13
+ import { resolveItemPositions as ne } from "@heyirisai/docx-editor-core/plugin-api/resolveItemPositions";
14
+ import { SIDEBAR_DOCUMENT_SHIFT as re, SIDEBAR_WIDTH as ie } from "@heyirisai/docx-editor-core/utils/sidebarConstants";
15
+ import { pixelsToTwips as ae, twipsToPixels as oe } from "@heyirisai/docx-editor-core/utils/units";
16
+ //#region src/components/ui/ColorPicker.vue?vue&type=script&setup=true&lang.ts
17
+ var se = [
18
+ "disabled",
19
+ "title",
20
+ "aria-label"
21
+ ], ce = [
22
+ "disabled",
23
+ "title",
24
+ "aria-label",
25
+ "aria-expanded"
26
+ ], le = [
27
+ "disabled",
28
+ "title",
29
+ "aria-label",
30
+ "aria-expanded"
31
+ ], Z = { class: "docx-color-picker__button-stack" }, ue = ["aria-label"], de = {
32
+ key: 0,
33
+ class: "docx-color-picker__auto-icon docx-color-picker__auto-icon--none"
34
+ }, fe = {
35
+ key: 1,
36
+ class: "docx-color-picker__auto-icon docx-color-picker__auto-icon--auto"
37
+ }, pe = { class: "docx-color-picker__section-label" }, me = { class: "docx-color-picker__grid" }, he = [
38
+ "title",
39
+ "aria-label",
40
+ "aria-selected",
41
+ "onClick"
42
+ ], ge = { class: "docx-color-picker__section-label" }, _e = { class: "docx-color-picker__grid" }, ve = [
43
+ "title",
44
+ "aria-label",
45
+ "aria-selected",
46
+ "onClick"
47
+ ], ye = { class: "docx-color-picker__section-label" }, be = { class: "docx-color-picker__custom" }, xe = ["onKeydown"], Se = ["disabled"], Q = /* @__PURE__ */ n(/* @__PURE__ */ f({
48
+ __name: "ColorPicker",
49
+ props: {
50
+ mode: {},
51
+ value: {},
52
+ theme: {},
53
+ disabled: {
54
+ type: Boolean,
55
+ default: !1
56
+ },
57
+ className: {},
58
+ style: {},
59
+ title: {},
60
+ icon: {},
61
+ autoLabel: {},
62
+ splitButton: {
63
+ type: Boolean,
64
+ default: !0
65
+ },
66
+ defaultColor: {}
67
+ },
68
+ emits: ["change"],
69
+ setup(n, { emit: r }) {
70
+ let o = n, f = r, { t: p } = t(), m = [
71
+ {
72
+ nameKey: "colorPicker.colors.darkRed",
73
+ hex: "C00000"
74
+ },
75
+ {
76
+ nameKey: "colorPicker.colors.red",
77
+ hex: "FF0000"
78
+ },
79
+ {
80
+ nameKey: "colorPicker.colors.orange",
81
+ hex: "FFC000"
82
+ },
83
+ {
84
+ nameKey: "colorPicker.colors.yellow",
85
+ hex: "FFFF00"
86
+ },
87
+ {
88
+ nameKey: "colorPicker.colors.lightGreen",
89
+ hex: "92D050"
90
+ },
91
+ {
92
+ nameKey: "colorPicker.colors.green",
93
+ hex: "00B050"
94
+ },
95
+ {
96
+ nameKey: "colorPicker.colors.lightBlue",
97
+ hex: "00B0F0"
98
+ },
99
+ {
100
+ nameKey: "colorPicker.colors.blue",
101
+ hex: "0070C0"
102
+ },
103
+ {
104
+ nameKey: "colorPicker.colors.darkBlue",
105
+ hex: "002060"
106
+ },
107
+ {
108
+ nameKey: "colorPicker.colors.purple",
109
+ hex: "7030A0"
110
+ }
111
+ ];
112
+ function b(e) {
113
+ return e ? typeof e == "string" ? o.mode === "highlight" ? R(e) || (e === "none" ? "transparent" : e.startsWith("#") ? e : `#${e}`) : e.startsWith("#") ? e : `#${e}` : I(e, o.theme) : o.mode === "text" || o.mode === "border" ? "#000000" : "transparent";
114
+ }
115
+ function x(e) {
116
+ return /^[0-9A-Fa-f]{6}$/.test(e.replace(/^#/, ""));
117
+ }
118
+ function w(e) {
119
+ let t = e.replace(/^#/, "");
120
+ if (t.length !== 6) return !1;
121
+ let n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16);
122
+ return (n * 299 + r * 587 + i * 114) / 1e3 > 230;
123
+ }
124
+ function T(e, t) {
125
+ return e ? (typeof e == "string" ? e.replace(/^#/, "").toUpperCase() : L(e, o.theme)) === t.toUpperCase() : !1;
126
+ }
127
+ let O = S(!1), j = S(""), F = S(null), z = S(null), B = S(o.defaultColor ?? (o.mode === "highlight" ? "FFFF00" : o.mode === "border" ? { rgb: "000000" } : { rgb: "FF0000" })), te = a(() => ee(o.theme?.colorScheme ?? null)), V = a(() => te.value.flatMap((e, t) => e.map((e, n) => ({
128
+ ...e,
129
+ key: `${t}-${n}`
130
+ })))), H = a(() => b(o.value)), U = a(() => b(B.value)), W = a(() => o.mode === "text" ? p("formattingBar.fontColor") : o.mode === "highlight" ? p("formattingBar.highlightColor") : p("table.borderColor")), G = a(() => o.icon ?? (o.mode === "text" ? "format_color_text" : o.mode === "highlight" ? "ink_highlighter" : "border_color"));
131
+ A(() => [
132
+ o.value,
133
+ o.mode,
134
+ o.theme
135
+ ], () => {
136
+ let e = b(o.value).replace(/^#/, "");
137
+ /^[0-9A-Fa-f]{6}$/.test(e) && (j.value = e.toUpperCase());
138
+ }, { immediate: !0 });
139
+ let K = S({});
140
+ function q() {
141
+ let e = F.value;
142
+ if (!e) return;
143
+ let t = e.getBoundingClientRect();
144
+ K.value = {
145
+ top: `${t.bottom + 4}px`,
146
+ left: `${t.left}px`
147
+ };
148
+ }
149
+ function J() {
150
+ o.disabled || (O.value || q(), O.value = !O.value);
151
+ }
152
+ function Y(e, t = !0) {
153
+ t && (B.value = e), f("change", e), O.value = !1;
154
+ }
155
+ function X() {
156
+ o.disabled || f("change", B.value);
157
+ }
158
+ function ne(e) {
159
+ if (o.mode === "highlight") {
160
+ Y(e.hex);
161
+ return;
162
+ }
163
+ let t = {
164
+ themeColor: e.themeSlot,
165
+ rgb: e.hex
166
+ };
167
+ e.tint && (t.themeTint = e.tint), e.shade && (t.themeShade = e.shade), Y(t);
168
+ }
169
+ function re(e) {
170
+ Y(o.mode === "highlight" ? e : { rgb: e });
171
+ }
172
+ function ie() {
173
+ Y(o.mode === "highlight" ? "none" : { auto: !0 }, !1);
174
+ }
175
+ function ae() {
176
+ let e = j.value.replace(/^#/, "").toUpperCase();
177
+ x(e) && (Y(o.mode === "highlight" ? e : { rgb: e }), j.value = "");
178
+ }
179
+ function oe(e) {
180
+ e.target.tagName !== "INPUT" && e.preventDefault();
181
+ }
182
+ function Q(e) {
183
+ if (!O.value) return;
184
+ let t = e.target;
185
+ F.value?.contains(t) || z.value?.contains(t) || (O.value = !1);
186
+ }
187
+ return v(() => document.addEventListener("mousedown", Q)), _(() => document.removeEventListener("mousedown", Q)), (t, r) => (y(), c("div", {
188
+ ref_key: "containerRef",
189
+ ref: F,
190
+ class: h(["docx-color-picker", n.className]),
191
+ style: g(n.style)
192
+ }, [n.splitButton ? (y(), c("div", {
193
+ key: 0,
194
+ class: h(["docx-color-picker__split", { "is-disabled": n.disabled }])
195
+ }, [l("button", {
196
+ type: "button",
197
+ class: "docx-color-picker__apply",
198
+ disabled: n.disabled,
199
+ title: n.title ?? W.value,
200
+ "aria-label": n.title ?? W.value,
201
+ onMousedown: r[0] ||= P(() => {}, ["prevent"]),
202
+ onClick: X
203
+ }, [d(e, {
204
+ name: G.value,
205
+ size: 18
206
+ }, null, 8, ["name"]), l("span", {
207
+ class: h(["docx-color-picker__bar", { "is-light": U.value === "transparent" || w(U.value) }]),
208
+ style: g({ background: U.value === "transparent" ? "#fff" : U.value })
209
+ }, null, 6)], 40, se), l("button", {
210
+ type: "button",
211
+ class: h(["docx-color-picker__arrow", { "is-open": O.value }]),
212
+ disabled: n.disabled,
213
+ title: n.title ?? W.value,
214
+ "aria-label": n.title ?? W.value,
215
+ "aria-haspopup": "true",
216
+ "aria-expanded": O.value,
217
+ onMousedown: r[1] ||= P(() => {}, ["prevent"]),
218
+ onClick: J
219
+ }, [d(e, {
220
+ name: "arrow_drop_down",
221
+ size: 18
222
+ })], 42, ce)], 2)) : (y(), c("button", {
223
+ key: 1,
224
+ type: "button",
225
+ class: h(["docx-color-picker__button", { "is-open": O.value }]),
226
+ disabled: n.disabled,
227
+ title: n.title ?? W.value,
228
+ "aria-label": n.title ?? W.value,
229
+ "aria-haspopup": "true",
230
+ "aria-expanded": O.value,
231
+ onMousedown: r[2] ||= P(() => {}, ["prevent"]),
232
+ onClick: J
233
+ }, [l("span", Z, [d(e, {
234
+ name: G.value,
235
+ size: 18
236
+ }, null, 8, ["name"]), l("span", {
237
+ class: h(["docx-color-picker__bar", { "is-light": H.value === "transparent" || w(H.value) }]),
238
+ style: g({ background: H.value === "transparent" ? "#fff" : H.value })
239
+ }, null, 6)]), d(e, {
240
+ name: "arrow_drop_down",
241
+ size: 14
242
+ })], 42, le)), O.value && !n.disabled ? (y(), c("div", {
243
+ key: 2,
244
+ ref_key: "panelRef",
245
+ ref: z,
246
+ class: "docx-color-picker__panel",
247
+ style: g(K.value),
248
+ role: "dialog",
249
+ "aria-label": D(p)("colorPicker.ariaLabel", { type: W.value }),
250
+ onMousedown: oe
251
+ }, [
252
+ l("button", {
253
+ type: "button",
254
+ class: "docx-color-picker__auto",
255
+ onMousedown: r[3] ||= P(() => {}, ["prevent"]),
256
+ onClick: ie
257
+ }, [n.mode === "highlight" ? (y(), c("span", de, [...r[10] ||= [l("span", { class: "docx-color-picker__auto-slash" }, null, -1)]])) : (y(), c("span", fe)), u(" " + E(n.autoLabel ?? (n.mode === "highlight" ? D(p)("colorPicker.noColor") : D(p)("colorPicker.automatic"))), 1)], 32),
258
+ r[12] ||= l("div", { class: "docx-color-picker__divider" }, null, -1),
259
+ l("div", pe, E(D(p)("colorPicker.themeColors")), 1),
260
+ l("div", me, [(y(!0), c(i, null, C(V.value, (e) => (y(), c("button", {
261
+ key: e.key,
262
+ type: "button",
263
+ class: h(["docx-color-picker__cell", { "is-selected": T(n.value, e.hex) }]),
264
+ style: g({ background: "#" + e.hex }),
265
+ title: e.label,
266
+ "aria-label": e.label,
267
+ "aria-selected": T(n.value, e.hex),
268
+ onMousedown: r[4] ||= P(() => {}, ["prevent"]),
269
+ onClick: (t) => ne(e)
270
+ }, null, 46, he))), 128))]),
271
+ r[13] ||= l("div", { class: "docx-color-picker__divider" }, null, -1),
272
+ l("div", ge, E(D(p)("colorPicker.standardColors")), 1),
273
+ l("div", _e, [(y(), c(i, null, C(m, (e) => l("button", {
274
+ key: e.hex,
275
+ type: "button",
276
+ class: h(["docx-color-picker__cell", { "is-selected": T(n.value, e.hex) }]),
277
+ style: g({ background: "#" + e.hex }),
278
+ title: D(p)(e.nameKey),
279
+ "aria-label": D(p)(e.nameKey),
280
+ "aria-selected": T(n.value, e.hex),
281
+ onMousedown: r[5] ||= P(() => {}, ["prevent"]),
282
+ onClick: (t) => re(e.hex)
283
+ }, null, 46, ve)), 64))]),
284
+ r[14] ||= l("div", { class: "docx-color-picker__divider" }, null, -1),
285
+ l("div", ye, E(D(p)("colorPicker.customColor")), 1),
286
+ l("div", be, [
287
+ r[11] ||= l("span", { class: "docx-color-picker__hash" }, "#", -1),
288
+ M(l("input", {
289
+ "onUpdate:modelValue": r[6] ||= (e) => j.value = e,
290
+ type: "text",
291
+ class: "docx-color-picker__hex",
292
+ placeholder: "FF0000",
293
+ maxlength: "6",
294
+ "aria-label": "Custom hex color",
295
+ onInput: r[7] ||= (e) => j.value = j.value.replace(/[^0-9A-Fa-f]/g, "").slice(0, 6),
296
+ onKeydown: N(P(ae, ["prevent"]), ["enter"]),
297
+ onMousedown: r[8] ||= P(() => {}, ["stop"])
298
+ }, null, 40, xe), [[k, j.value]]),
299
+ l("button", {
300
+ type: "button",
301
+ class: "docx-color-picker__apply-btn",
302
+ disabled: !x(j.value),
303
+ onMousedown: r[9] ||= P(() => {}, ["prevent"]),
304
+ onClick: ae
305
+ }, E(D(p)("common.apply")), 41, Se)
306
+ ])
307
+ ], 44, ue)) : s("", !0)], 6));
308
+ }
309
+ }), [["__scopeId", "data-v-e2472617"]]), Ce = 4, $ = /* @__PURE__ */ n(/* @__PURE__ */ f({
310
+ __name: "Popover",
311
+ props: {
312
+ open: { type: Boolean },
313
+ placement: { default: "bottom-left" },
314
+ panelClass: {},
315
+ panelStyle: {},
316
+ closeOnScroll: {
317
+ type: Boolean,
318
+ default: !0
319
+ }
320
+ },
321
+ emits: ["close", "update:open"],
322
+ setup(e, { emit: t }) {
323
+ let n = e, r = t, i = S(null), a = S(null), o = S({ position: "fixed" });
324
+ function l() {
325
+ let e = i.value;
326
+ if (!e) return;
327
+ let t = e.getBoundingClientRect(), r = { position: "fixed" };
328
+ n.placement.startsWith("top") ? (r.bottom = `${Math.round(window.innerHeight - t.top + Ce)}px`, r.top = "auto") : (r.top = `${Math.round(t.bottom + Ce)}px`, r.bottom = "auto"), n.placement.endsWith("right") ? (r.right = `${Math.round(window.innerWidth - t.right)}px`, r.left = "auto") : (r.left = `${Math.round(t.left)}px`, r.right = "auto"), o.value = r;
329
+ }
330
+ function u() {
331
+ r("update:open", !n.open), n.open && r("close");
332
+ }
333
+ function d() {
334
+ r("update:open", !1), r("close");
335
+ }
336
+ function f(e) {
337
+ if (!n.open) return;
338
+ let t = e.target;
339
+ i.value?.contains(t) || a.value?.contains(t) || d();
340
+ }
341
+ function p(e) {
342
+ e.key === "Escape" && n.open && d();
343
+ }
344
+ function m(e) {
345
+ !n.closeOnScroll || !n.open || a.value?.contains(e.target) || d();
346
+ }
347
+ function b() {
348
+ n.open && l();
349
+ }
350
+ function x() {
351
+ document.addEventListener("mousedown", f), document.addEventListener("keydown", p), window.addEventListener("scroll", m, !0), window.addEventListener("resize", b);
352
+ }
353
+ function C() {
354
+ document.removeEventListener("mousedown", f), document.removeEventListener("keydown", p), window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", b);
355
+ }
356
+ return A(() => n.open, (e) => {
357
+ e ? (l(), x()) : C();
358
+ }), A(() => n.placement, () => n.open && l()), v(() => {
359
+ n.open && (l(), x());
360
+ }), _(C), (t, n) => (y(), c("span", {
361
+ ref_key: "rootRef",
362
+ ref: i,
363
+ class: "docx-popover"
364
+ }, [w(t.$slots, "trigger", {
365
+ toggle: u,
366
+ open: e.open
367
+ }, void 0, !0), e.open ? (y(), c("div", {
368
+ key: 0,
369
+ ref_key: "panelRef",
370
+ ref: a,
371
+ class: h(["docx-popover__panel", e.panelClass]),
372
+ style: g([o.value, e.panelStyle ?? {}]),
373
+ onMousedown: n[0] ||= P(() => {}, ["stop"])
374
+ }, [w(t.$slots, "panel", {}, void 0, !0)], 38)) : s("", !0)], 512));
375
+ }
376
+ }), [["__scopeId", "data-v-5878ce2a"]]), we = ["title", "onClick"], Te = {
377
+ key: 0,
378
+ class: "editing-mode__label"
379
+ }, Ee = { class: "editing-mode__panel" }, De = ["onClick"], Oe = { class: "editing-mode__option-text" }, ke = { class: "editing-mode__option-label" }, Ae = { class: "editing-mode__option-desc" }, je = /* @__PURE__ */ n(/* @__PURE__ */ f({
380
+ __name: "EditingModeDropdown",
381
+ props: { modelValue: {} },
382
+ emits: ["update:modelValue"],
383
+ setup(n, { emit: r }) {
384
+ let { t: u } = t(), f = n, p = r, m = [
385
+ {
386
+ value: "editing",
387
+ labelKey: "editor.editing",
388
+ icon: "edit_note",
389
+ descKey: "editor.editingDescription"
390
+ },
391
+ {
392
+ value: "suggesting",
393
+ labelKey: "editor.suggesting",
394
+ icon: "rate_review",
395
+ descKey: "editor.suggestingDescription"
396
+ },
397
+ {
398
+ value: "viewing",
399
+ labelKey: "editor.viewing",
400
+ icon: "visibility",
401
+ descKey: "editor.viewingDescription"
402
+ }
403
+ ], g = S(!1), b = S(!1), x = a(() => m.find((e) => e.value === f.modelValue) ?? m[0]);
404
+ function w(e) {
405
+ p("update:modelValue", e), g.value = !1;
406
+ }
407
+ let T = null;
408
+ function O(e) {
409
+ b.value = e.matches;
410
+ }
411
+ return v(() => {
412
+ T = window.matchMedia("(max-width: 1400px)"), b.value = T.matches, T.addEventListener("change", O);
413
+ }), _(() => T?.removeEventListener("change", O)), (t, r) => (y(), o($, {
414
+ open: g.value,
415
+ placement: "bottom-right",
416
+ "onUpdate:open": r[0] ||= (e) => g.value = e,
417
+ onClose: r[1] ||= (e) => g.value = !1
418
+ }, {
419
+ trigger: j(({ toggle: t }) => [l("button", {
420
+ type: "button",
421
+ class: h(["editing-mode__trigger", {
422
+ "editing-mode__trigger--open": g.value,
423
+ "editing-mode__trigger--compact": b.value
424
+ }]),
425
+ title: `${D(u)(x.value.labelKey)} (Ctrl+Shift+E)`,
426
+ onClick: P(t, ["prevent"])
427
+ }, [
428
+ d(e, {
429
+ name: x.value.icon,
430
+ size: 18
431
+ }, null, 8, ["name"]),
432
+ b.value ? s("", !0) : (y(), c("span", Te, E(D(u)(x.value.labelKey)), 1)),
433
+ d(e, {
434
+ name: "arrow_drop_down",
435
+ size: 16
436
+ })
437
+ ], 10, we)]),
438
+ panel: j(() => [l("div", Ee, [(y(), c(i, null, C(m, (t) => l("button", {
439
+ key: t.value,
440
+ type: "button",
441
+ class: "editing-mode__option",
442
+ onClick: P((e) => w(t.value), ["prevent"])
443
+ }, [
444
+ d(e, {
445
+ name: t.icon,
446
+ size: 20
447
+ }, null, 8, ["name"]),
448
+ l("span", Oe, [l("span", ke, E(D(u)(t.labelKey)), 1), l("span", Ae, E(D(u)(t.descKey)), 1)]),
449
+ t.value === n.modelValue ? (y(), o(e, {
450
+ key: 0,
451
+ name: "check",
452
+ size: 18,
453
+ class: "editing-mode__check"
454
+ })) : s("", !0)
455
+ ], 8, De)), 64))])]),
456
+ _: 1
457
+ }, 8, ["open"]));
458
+ }
459
+ }), [["__scopeId", "data-v-00df78da"]]), Me = [
460
+ "disabled",
461
+ "aria-label",
462
+ "title",
463
+ "aria-expanded",
464
+ "onClick"
465
+ ], Ne = { class: "docx-icon-grid__panel" }, Pe = ["title", "onClick"], Fe = /* @__PURE__ */ n(/* @__PURE__ */ f({
466
+ __name: "IconGridDropdown",
467
+ props: {
468
+ options: {},
469
+ activeValue: {},
470
+ triggerIcon: {},
471
+ tooltipContent: {},
472
+ disabled: { type: Boolean },
473
+ ariaLabel: {}
474
+ },
475
+ emits: ["select"],
476
+ setup(t, { emit: n }) {
477
+ let r = n, a = S(!1);
478
+ function s(e) {
479
+ r("select", e), a.value = !1;
480
+ }
481
+ return (n, r) => (y(), o($, {
482
+ open: a.value,
483
+ "onUpdate:open": r[0] ||= (e) => a.value = e,
484
+ onClose: r[1] ||= (e) => a.value = !1
485
+ }, {
486
+ trigger: j(({ toggle: n }) => [l("button", {
487
+ type: "button",
488
+ class: h(["docx-icon-grid__btn", { "docx-icon-grid__btn--open": a.value }]),
489
+ disabled: t.disabled,
490
+ "aria-label": t.ariaLabel ?? t.tooltipContent,
491
+ title: t.tooltipContent,
492
+ "aria-expanded": a.value,
493
+ "aria-haspopup": "true",
494
+ onClick: P(n, ["prevent"])
495
+ }, [d(e, {
496
+ name: t.triggerIcon,
497
+ size: 20
498
+ }, null, 8, ["name"]), d(e, {
499
+ name: "arrow_drop_down",
500
+ size: 14
501
+ })], 10, Me)]),
502
+ panel: j(() => [l("div", Ne, [(y(!0), c(i, null, C(t.options, (n) => (y(), c("button", {
503
+ key: n.value,
504
+ type: "button",
505
+ class: h(["docx-icon-grid__option", { "docx-icon-grid__option--active": t.activeValue === n.value }]),
506
+ title: n.label,
507
+ onClick: P((e) => s(n.value), ["prevent"])
508
+ }, [d(e, {
509
+ name: n.iconName,
510
+ size: 18
511
+ }, null, 8, ["name"])], 10, Pe))), 128))])]),
512
+ _: 1
513
+ }, 8, ["open"]));
514
+ }
515
+ }), [["__scopeId", "data-v-28013428"]]), Ie = /* @__PURE__ */ f({
516
+ __name: "ImageWrapDropdown",
517
+ props: {
518
+ imageContext: {},
519
+ disabled: { type: Boolean }
520
+ },
521
+ emits: ["change"],
522
+ setup(e) {
523
+ let n = e, { t: r } = t(), i = [
524
+ {
525
+ value: "inline",
526
+ labelKey: "imageWrap.inline",
527
+ iconName: "format_image_left"
528
+ },
529
+ {
530
+ value: "wrapRight",
531
+ labelKey: "imageWrap.floatLeft",
532
+ iconName: "format_image_right"
533
+ },
534
+ {
535
+ value: "wrapLeft",
536
+ labelKey: "imageWrap.floatRight",
537
+ iconName: "format_image_left"
538
+ },
539
+ {
540
+ value: "topAndBottom",
541
+ labelKey: "imageWrap.topAndBottom",
542
+ iconName: "horizontal_rule"
543
+ },
544
+ {
545
+ value: "behind",
546
+ labelKey: "imageWrap.behindText",
547
+ iconName: "flip_to_back"
548
+ },
549
+ {
550
+ value: "inFront",
551
+ labelKey: "imageWrap.inFrontOfText",
552
+ iconName: "flip_to_front"
553
+ }
554
+ ], s = a(() => i.map((e) => ({
555
+ value: e.value,
556
+ label: r(e.labelKey),
557
+ iconName: e.iconName
558
+ }))), c = a(() => {
559
+ let e = n.imageContext;
560
+ return e.displayMode === "float" && e.cssFloat === "left" ? "wrapRight" : e.displayMode === "float" && e.cssFloat === "right" ? "wrapLeft" : e.wrapType;
561
+ }), l = a(() => s.value.find((e) => e.value === c.value) ?? s.value[0]);
562
+ return (t, n) => (y(), o(Fe, {
563
+ options: s.value,
564
+ "active-value": c.value,
565
+ "trigger-icon": l.value.iconName,
566
+ "tooltip-content": D(r)("imageWrap.tooltipPrefix", { label: l.value.label }),
567
+ disabled: e.disabled,
568
+ onSelect: n[0] ||= (e) => t.$emit("change", e)
569
+ }, null, 8, [
570
+ "options",
571
+ "active-value",
572
+ "trigger-icon",
573
+ "tooltip-content",
574
+ "disabled"
575
+ ]));
576
+ }
577
+ }), Le = /* @__PURE__ */ f({
578
+ __name: "ImageTransformDropdown",
579
+ props: { disabled: { type: Boolean } },
580
+ emits: ["transform"],
581
+ setup(e) {
582
+ let { t: n } = t(), r = [
583
+ {
584
+ value: "rotateCW",
585
+ labelKey: "imageTransform.rotateClockwise",
586
+ iconName: "rotate_right"
587
+ },
588
+ {
589
+ value: "rotateCCW",
590
+ labelKey: "imageTransform.rotateCounterClockwise",
591
+ iconName: "rotate_left"
592
+ },
593
+ {
594
+ value: "flipH",
595
+ labelKey: "imageTransform.flipHorizontal",
596
+ iconName: "swap_horiz"
597
+ },
598
+ {
599
+ value: "flipV",
600
+ labelKey: "imageTransform.flipVertical",
601
+ iconName: "swap_vert"
602
+ }
603
+ ], i = a(() => r.map((e) => ({
604
+ value: e.value,
605
+ label: n(e.labelKey),
606
+ iconName: e.iconName
607
+ })));
608
+ return (t, r) => (y(), o(Fe, {
609
+ options: i.value,
610
+ "trigger-icon": "rotate_right",
611
+ "tooltip-content": D(n)("imageTransform.tooltip"),
612
+ disabled: e.disabled,
613
+ onSelect: r[0] ||= (e) => t.$emit("transform", e)
614
+ }, null, 8, [
615
+ "options",
616
+ "tooltip-content",
617
+ "disabled"
618
+ ]));
619
+ }
620
+ }), Re = [
621
+ {
622
+ name: "Arial",
623
+ fontFamily: "Arial",
624
+ category: "sans-serif"
625
+ },
626
+ {
627
+ name: "Calibri",
628
+ fontFamily: "Calibri",
629
+ category: "sans-serif"
630
+ },
631
+ {
632
+ name: "Helvetica",
633
+ fontFamily: "Helvetica",
634
+ category: "sans-serif"
635
+ },
636
+ {
637
+ name: "Verdana",
638
+ fontFamily: "Verdana",
639
+ category: "sans-serif"
640
+ },
641
+ {
642
+ name: "Open Sans",
643
+ fontFamily: "Open Sans",
644
+ category: "sans-serif"
645
+ },
646
+ {
647
+ name: "Roboto",
648
+ fontFamily: "Roboto",
649
+ category: "sans-serif"
650
+ },
651
+ {
652
+ name: "Times New Roman",
653
+ fontFamily: "Times New Roman",
654
+ category: "serif"
655
+ },
656
+ {
657
+ name: "Georgia",
658
+ fontFamily: "Georgia",
659
+ category: "serif"
660
+ },
661
+ {
662
+ name: "Cambria",
663
+ fontFamily: "Cambria",
664
+ category: "serif"
665
+ },
666
+ {
667
+ name: "Garamond",
668
+ fontFamily: "Garamond",
669
+ category: "serif"
670
+ },
671
+ {
672
+ name: "Courier New",
673
+ fontFamily: "Courier New",
674
+ category: "monospace"
675
+ },
676
+ {
677
+ name: "Consolas",
678
+ fontFamily: "Consolas",
679
+ category: "monospace"
680
+ }
681
+ ], ze = [
682
+ 8,
683
+ 9,
684
+ 10,
685
+ 11,
686
+ 12,
687
+ 14,
688
+ 16,
689
+ 18,
690
+ 20,
691
+ 24,
692
+ 28,
693
+ 36,
694
+ 48,
695
+ 72
696
+ ], Be = [
697
+ {
698
+ id: "Normal",
699
+ label: "Normal",
700
+ nameKey: "styles.normalText"
701
+ },
702
+ {
703
+ id: "Title",
704
+ label: "Title",
705
+ nameKey: "styles.title"
706
+ },
707
+ {
708
+ id: "Subtitle",
709
+ label: "Subtitle",
710
+ nameKey: "styles.subtitle"
711
+ },
712
+ {
713
+ id: "Heading1",
714
+ label: "Heading 1",
715
+ nameKey: "styles.heading1"
716
+ },
717
+ {
718
+ id: "Heading2",
719
+ label: "Heading 2",
720
+ nameKey: "styles.heading2"
721
+ },
722
+ {
723
+ id: "Heading3",
724
+ label: "Heading 3",
725
+ nameKey: "styles.heading3"
726
+ }
727
+ ], Ve = [
728
+ {
729
+ label: "Single",
730
+ labelKey: "lineSpacing.single",
731
+ value: 240
732
+ },
733
+ {
734
+ label: "1.15",
735
+ value: 276
736
+ },
737
+ {
738
+ label: "1.5",
739
+ value: 360
740
+ },
741
+ {
742
+ label: "Double",
743
+ labelKey: "lineSpacing.double",
744
+ value: 480
745
+ }
746
+ ], He = [
747
+ .5,
748
+ .75,
749
+ 1,
750
+ 1.25,
751
+ 1.5,
752
+ 2
753
+ ];
754
+ //#endregion
755
+ //#region src/composables/useToolbarDropdowns.ts
756
+ function Ue(e) {
757
+ let t = S(null), n = S({
758
+ top: 0,
759
+ left: 0
760
+ });
761
+ function r(t) {
762
+ switch (t) {
763
+ case "zoom": return e.zoom.value;
764
+ case "style": return e.style.value;
765
+ case "font": return e.font.value;
766
+ case "size": return e.size.value;
767
+ case "align": return e.align.value;
768
+ case "spacing": return e.spacing.value;
769
+ default: return null;
770
+ }
771
+ }
772
+ function i(e) {
773
+ let t = r(e);
774
+ if (!t) return;
775
+ let i = t.getBoundingClientRect();
776
+ n.value = {
777
+ top: i.bottom,
778
+ left: i.left
779
+ };
780
+ }
781
+ let o = a(() => ({
782
+ top: n.value.top + "px",
783
+ left: n.value.left + "px"
784
+ }));
785
+ function s(e) {
786
+ t.value !== e && i(e), t.value = t.value === e ? null : e;
787
+ }
788
+ function c(n) {
789
+ let r = [
790
+ e.zoom,
791
+ e.style,
792
+ e.font,
793
+ e.size,
794
+ e.align,
795
+ e.spacing
796
+ ], i = n.target;
797
+ r.some((e) => e.value?.contains(i)) || (t.value = null);
798
+ }
799
+ return v(() => document.addEventListener("mousedown", c)), _(() => document.removeEventListener("mousedown", c)), {
800
+ openDropdown: t,
801
+ dropdownMenuStyle: o,
802
+ toggleDropdown: s,
803
+ recomputeDropdownPos: i
804
+ };
805
+ }
806
+ //#endregion
807
+ //#region src/composables/useToolbarFontSize.ts
808
+ function We(e) {
809
+ let t = S(!1), n = (t) => e.execCommand("setFontSize", t * 2);
810
+ function r() {
811
+ t.value = !1, e.openDropdown.value = "size", e.recomputeDropdownPos("size");
812
+ }
813
+ function i() {
814
+ t.value = !0;
815
+ }
816
+ function a(r) {
817
+ if (t.value) {
818
+ let e = parseFloat(r.target.value);
819
+ isNaN(e) || n(Math.round(Math.min(Math.max(e, 1), 1638) * 2) / 2);
820
+ }
821
+ t.value = !1, e.openDropdown.value = null;
822
+ }
823
+ function o(r) {
824
+ t.value = !1, n(r), e.openDropdown.value = null;
825
+ }
826
+ function s() {
827
+ let t = e.currentFontSize.value;
828
+ n(ze.find((e) => e > t) || t + 1);
829
+ }
830
+ function c() {
831
+ let t = e.currentFontSize.value;
832
+ n([...ze].reverse().find((e) => e < t) || Math.max(1, t - 1));
833
+ }
834
+ return {
835
+ onSizeFocus: r,
836
+ onSizeInput: i,
837
+ commitFontSize: a,
838
+ pickFontSize: o,
839
+ increaseFontSize: s,
840
+ decreaseFontSize: c
841
+ };
842
+ }
843
+ //#endregion
844
+ //#region src/composables/useParagraphStyleOptions.ts
845
+ function Ge(e) {
846
+ let t = a(() => {
847
+ let t = W(e.documentStyles());
848
+ return t.length > 0 ? t.map((t) => {
849
+ let n = Be.find((e) => e.id === t.styleId);
850
+ return {
851
+ id: t.styleId,
852
+ label: n ? e.t(n.nameKey) : t.name,
853
+ previewStyle: U(t)
854
+ };
855
+ }) : Be.map((t) => ({
856
+ id: t.id,
857
+ label: e.t(t.nameKey),
858
+ previewStyle: U({ styleId: t.id })
859
+ }));
860
+ });
861
+ return {
862
+ resolvedParagraphStyles: t,
863
+ currentStyleLabel: a(() => {
864
+ let n = e.currentStyleId() || "Normal", r = t.value.find((e) => e.id === n);
865
+ return r ? r.label : n;
866
+ })
867
+ };
868
+ }
869
+ //#endregion
870
+ //#region src/components/Toolbar.vue?vue&type=script&setup=true&lang.ts
871
+ var Ke = {
872
+ key: 0,
873
+ class: "basic-toolbar"
874
+ }, qe = [
875
+ "title",
876
+ "aria-label",
877
+ "disabled"
878
+ ], Je = [
879
+ "title",
880
+ "aria-label",
881
+ "disabled"
882
+ ], Ye = ["disabled", "title"], Xe = ["aria-expanded", "title"], Ze = ["disabled", "title"], Qe = ["onMousedown"], $e = ["aria-expanded", "title"], et = ["onMousedown"], tt = ["aria-expanded", "title"], nt = {
883
+ key: 0,
884
+ class: "toolbar-dropdown__group-label"
885
+ }, rt = ["onMousedown"], it = ["title"], at = [
886
+ "value",
887
+ "title",
888
+ "aria-expanded"
889
+ ], ot = ["title"], st = ["onMousedown"], ct = ["title", "aria-label"], lt = ["title", "aria-label"], ut = ["title", "aria-label"], dt = ["title", "aria-label"], ft = ["title", "aria-label"], pt = ["title", "aria-label"], mt = ["title", "aria-label"], ht = ["aria-expanded", "title"], gt = ["title"], _t = ["title"], vt = ["title"], yt = ["title"], bt = ["title", "aria-label"], xt = ["title", "aria-label"], St = [
890
+ "title",
891
+ "aria-label",
892
+ "disabled"
893
+ ], Ct = ["title", "aria-label"], wt = ["aria-expanded", "title"], Tt = ["onMousedown"], Et = ["title", "aria-label"], Dt = ["title", "aria-label"], Ot = ["title", "aria-label"], kt = /* @__PURE__ */ n(/* @__PURE__ */ f({
894
+ __name: "Toolbar",
895
+ props: {
896
+ view: {},
897
+ getCommands: { type: Function },
898
+ stateTick: {},
899
+ zoomPercent: {},
900
+ isMinZoom: { type: Boolean },
901
+ isMaxZoom: { type: Boolean },
902
+ zoomPresets: {},
903
+ showZoomControl: { type: Boolean },
904
+ editorMode: {},
905
+ commentsSidebarOpen: { type: Boolean },
906
+ imageContext: {},
907
+ theme: {},
908
+ fontFamilies: {},
909
+ documentFonts: {},
910
+ documentStyles: {}
911
+ },
912
+ emits: [
913
+ "find-replace",
914
+ "insert-table",
915
+ "insert-image",
916
+ "insert-link",
917
+ "insert-symbol",
918
+ "insert-page-break",
919
+ "insert-toc",
920
+ "page-setup",
921
+ "toggle-outline",
922
+ "zoom-in",
923
+ "zoom-out",
924
+ "zoom-set",
925
+ "toggle-sidebar",
926
+ "apply-style",
927
+ "mode-change",
928
+ "image-wrap-type",
929
+ "image-properties",
930
+ "image-transform"
931
+ ],
932
+ setup(n, { emit: r }) {
933
+ let f = n, { t: p } = t(), m = r, _ = a(() => f.zoomPercent ?? 100), v = a(() => f.isMinZoom ?? !1), b = a(() => f.isMaxZoom ?? !1), x = a(() => f.zoomPresets ?? He), T = a(() => f.showZoomControl ?? !0), O = S(null), k = S(null), A = S(null), j = S(null), M = S(null), ee = S(null), { openDropdown: I, dropdownMenuStyle: L, toggleDropdown: R, recomputeDropdownPos: U } = Ue({
934
+ zoom: ee,
935
+ style: O,
936
+ font: k,
937
+ size: A,
938
+ align: j,
939
+ spacing: M
940
+ }), W = a(() => {
941
+ f.stateTick;
942
+ let e = f.view;
943
+ return e ? te(e.state) : {
944
+ hasSelection: !1,
945
+ isMultiParagraph: !1,
946
+ textFormatting: {},
947
+ paragraphFormatting: {},
948
+ startParagraphIndex: 0,
949
+ endParagraphIndex: 0,
950
+ inList: !1,
951
+ activeCommentIds: [],
952
+ inInsertion: !1,
953
+ inDeletion: !1
954
+ };
955
+ }), G = a(() => {
956
+ let e = W.value.textFormatting.fontFamily;
957
+ return e?.ascii || e?.hAnsi || "Arial";
958
+ }), K = a(() => {
959
+ let e = W.value.textFormatting.fontSize;
960
+ return e ? e / 2 : 11;
961
+ }), q = a(() => W.value.paragraphFormatting.alignment || "left"), J = a(() => {
962
+ switch (q.value) {
963
+ case "center": return "format_align_center";
964
+ case "right": return "format_align_right";
965
+ case "both": return "format_align_justify";
966
+ default: return "format_align_left";
967
+ }
968
+ }), { resolvedParagraphStyles: Y, currentStyleLabel: X } = Ge({
969
+ documentStyles: () => f.documentStyles,
970
+ currentStyleId: () => W.value.paragraphFormatting.styleId || "Normal",
971
+ t: p
972
+ }), ne = a(() => {
973
+ f.stateTick;
974
+ let e = f.view;
975
+ return e ? B(e.state) > 0 : !1;
976
+ }), re = a(() => {
977
+ f.stateTick;
978
+ let e = f.view;
979
+ return e ? z(e.state) > 0 : !1;
980
+ }), ie = a(() => {
981
+ let e = W.value, t = e.inList && (e.listLevel ?? 0) > 0, n = (e.paragraphFormatting.indentLeft ?? 0) > 0;
982
+ return t || n;
983
+ }), ae = a(() => {
984
+ let e = W.value.textFormatting.color?.rgb;
985
+ return e ? e.replace(/^#/, "").toUpperCase() : void 0;
986
+ }), oe = a(() => {
987
+ let e = W.value.textFormatting.highlight;
988
+ if (!(!e || e === "none")) return e.replace(/^#/, "").toUpperCase();
989
+ }), se = a(() => H(f.fontFamilies) ?? Re), ce = a(() => F(f.documentFonts, se.value.map((e) => e.name))), le = a(() => [
990
+ {
991
+ label: p("font.documentFonts"),
992
+ fonts: ce.value
993
+ },
994
+ {
995
+ label: p("font.sansSerif"),
996
+ fonts: se.value.filter((e) => e.category === "sans-serif")
997
+ },
998
+ {
999
+ label: p("font.serif"),
1000
+ fonts: se.value.filter((e) => e.category === "serif")
1001
+ },
1002
+ {
1003
+ label: p("font.monospace"),
1004
+ fonts: se.value.filter((e) => e.category === "monospace")
1005
+ },
1006
+ {
1007
+ label: p("font.other"),
1008
+ fonts: se.value.filter((e) => !e.category || e.category === "other")
1009
+ }
1010
+ ]);
1011
+ function Z(e, ...t) {
1012
+ let n = f.view;
1013
+ if (!n) return;
1014
+ let r = f.getCommands()[e];
1015
+ if (!r) {
1016
+ console.warn("[Toolbar] command not found:", e);
1017
+ return;
1018
+ }
1019
+ r(...t)(n.state, (e) => n.dispatch(e), n), n.hasFocus() || n.focus(), I.value = null;
1020
+ }
1021
+ function ue(e) {
1022
+ Z("setFontFamily", e);
1023
+ }
1024
+ let { onSizeFocus: de, onSizeInput: fe, commitFontSize: pe, pickFontSize: me, increaseFontSize: he, decreaseFontSize: ge } = We({
1025
+ currentFontSize: K,
1026
+ openDropdown: I,
1027
+ recomputeDropdownPos: U,
1028
+ execCommand: Z
1029
+ });
1030
+ function _e(e) {
1031
+ if (typeof e == "object" && e.auto) {
1032
+ Z("clearTextColor");
1033
+ return;
1034
+ }
1035
+ Z("setTextColor", typeof e == "string" ? { rgb: e } : e);
1036
+ }
1037
+ function ve() {
1038
+ let e = f.view;
1039
+ e && (V(e.state, (t) => e.dispatch(t), e), e.hasFocus() || e.focus());
1040
+ }
1041
+ function ye(e) {
1042
+ Z("setHighlight", typeof e == "string" ? e : e.rgb ?? "none");
1043
+ }
1044
+ function be(e) {
1045
+ m("apply-style", e), I.value = null;
1046
+ }
1047
+ function xe(e) {
1048
+ Z("setLineSpacing", e);
1049
+ }
1050
+ function Se(e) {
1051
+ let t = W.value.paragraphFormatting.lineSpacing;
1052
+ return t ? Math.abs(t - e) < 10 : e === 240;
1053
+ }
1054
+ return (t, r) => n.view ? (y(), c("div", Ke, [
1055
+ l("button", {
1056
+ title: D(p)("formattingBar.undoShortcut"),
1057
+ "aria-label": D(p)("formattingBar.undo"),
1058
+ disabled: !ne.value,
1059
+ onMousedown: r[0] ||= P((e) => Z("undo"), ["prevent"])
1060
+ }, [d(e, { name: "undo" })], 40, qe),
1061
+ l("button", {
1062
+ title: D(p)("formattingBar.redoShortcut"),
1063
+ "aria-label": D(p)("formattingBar.redo"),
1064
+ disabled: !re.value,
1065
+ onMousedown: r[1] ||= P((e) => Z("redo"), ["prevent"])
1066
+ }, [d(e, { name: "redo" })], 40, Je),
1067
+ r[39] ||= l("span", { class: "divider" }, null, -1),
1068
+ T.value ? (y(), c("div", {
1069
+ key: 0,
1070
+ class: "toolbar-dropdown zoom-group",
1071
+ ref_key: "zoomDropdownRef",
1072
+ ref: ee
1073
+ }, [
1074
+ l("button", {
1075
+ class: "size-btn",
1076
+ onMousedown: r[2] ||= P((e) => t.$emit("zoom-out"), ["prevent"]),
1077
+ disabled: v.value,
1078
+ title: D(p)("zoom.zoomOut")
1079
+ }, " − ", 40, Ye),
1080
+ l("button", {
1081
+ class: "toolbar-dropdown__trigger zoom-trigger",
1082
+ onMousedown: r[3] ||= P((e) => D(R)("zoom"), ["prevent"]),
1083
+ "aria-expanded": D(I) === "zoom",
1084
+ "aria-haspopup": "listbox",
1085
+ title: D(p)("zoom.zoomLevel")
1086
+ }, [u(E(_.value) + "% ", 1), d(e, {
1087
+ class: "chevron",
1088
+ name: "arrow_drop_down",
1089
+ size: 16
1090
+ })], 40, Xe),
1091
+ l("button", {
1092
+ class: "size-btn",
1093
+ onMousedown: r[4] ||= P((e) => t.$emit("zoom-in"), ["prevent"]),
1094
+ disabled: b.value,
1095
+ title: D(p)("zoom.zoomIn")
1096
+ }, " + ", 40, Ze),
1097
+ D(I) === "zoom" ? (y(), c("div", {
1098
+ key: 0,
1099
+ style: g(D(L)),
1100
+ class: "toolbar-dropdown__menu zoom-menu"
1101
+ }, [(y(!0), c(i, null, C(x.value, (e) => (y(), c("button", {
1102
+ key: e,
1103
+ class: h(["toolbar-dropdown__item", { active: _.value === Math.round(e * 100) }]),
1104
+ onMousedown: P((n) => t.$emit("zoom-set", e), ["prevent"])
1105
+ }, E(Math.round(e * 100)) + "% ", 43, Qe))), 128))], 4)) : s("", !0)
1106
+ ], 512)) : s("", !0),
1107
+ r[40] ||= l("span", { class: "divider" }, null, -1),
1108
+ l("div", {
1109
+ class: "toolbar-dropdown",
1110
+ ref_key: "styleDropdownRef",
1111
+ ref: O
1112
+ }, [l("button", {
1113
+ class: "toolbar-dropdown__trigger style-trigger",
1114
+ onMousedown: r[5] ||= P((e) => D(R)("style"), ["prevent"]),
1115
+ "aria-expanded": D(I) === "style",
1116
+ "aria-haspopup": "listbox",
1117
+ title: D(p)("styles.selectAriaLabel")
1118
+ }, [u(E(D(X)) + " ", 1), d(e, {
1119
+ class: "chevron",
1120
+ name: "arrow_drop_down",
1121
+ size: 16
1122
+ })], 40, $e), D(I) === "style" ? (y(), c("div", {
1123
+ key: 0,
1124
+ style: g(D(L)),
1125
+ class: "toolbar-dropdown__menu style-menu"
1126
+ }, [(y(!0), c(i, null, C(D(Y), (e) => (y(), c("button", {
1127
+ key: e.id,
1128
+ class: h(["toolbar-dropdown__item", { active: (W.value.paragraphFormatting.styleId || "Normal") === e.id }]),
1129
+ onMousedown: P((t) => be(e.id), ["prevent"])
1130
+ }, [l("span", { style: g(e.previewStyle) }, E(e.label), 5)], 42, et))), 128))], 4)) : s("", !0)], 512),
1131
+ r[41] ||= l("span", { class: "divider" }, null, -1),
1132
+ l("div", {
1133
+ class: "toolbar-dropdown",
1134
+ ref_key: "fontDropdownRef",
1135
+ ref: k
1136
+ }, [l("button", {
1137
+ class: "toolbar-dropdown__trigger font-trigger",
1138
+ onMousedown: r[6] ||= P((e) => D(R)("font"), ["prevent"]),
1139
+ "aria-expanded": D(I) === "font",
1140
+ "aria-haspopup": "listbox",
1141
+ title: D(p)("font.selectAriaLabel")
1142
+ }, [u(E(G.value) + " ", 1), d(e, {
1143
+ class: "chevron",
1144
+ name: "arrow_drop_down",
1145
+ size: 16
1146
+ })], 40, tt), D(I) === "font" ? (y(), c("div", {
1147
+ key: 0,
1148
+ style: g(D(L)),
1149
+ class: "toolbar-dropdown__menu font-menu"
1150
+ }, [(y(!0), c(i, null, C(le.value, (e) => (y(), c(i, { key: e.label }, [e.fonts.length > 0 ? (y(), c("div", nt, E(e.label), 1)) : s("", !0), (y(!0), c(i, null, C(e.fonts, (e) => (y(), c("button", {
1151
+ key: e.name,
1152
+ class: h(["toolbar-dropdown__item", { active: G.value === e.name }]),
1153
+ style: g({ fontFamily: e.fontFamily }),
1154
+ onMousedown: P((t) => ue(e.name), ["prevent"])
1155
+ }, E(e.name), 47, rt))), 128))], 64))), 128))], 4)) : s("", !0)], 512),
1156
+ l("div", {
1157
+ class: "toolbar-dropdown font-size-group",
1158
+ ref_key: "sizeDropdownRef",
1159
+ ref: A
1160
+ }, [
1161
+ l("button", {
1162
+ class: "size-btn",
1163
+ onMousedown: r[7] ||= P((...e) => D(ge) && D(ge)(...e), ["prevent"]),
1164
+ title: D(p)("fontSize.decrease")
1165
+ }, " − ", 40, it),
1166
+ l("input", {
1167
+ class: "size-trigger size-input",
1168
+ type: "text",
1169
+ value: K.value,
1170
+ title: D(p)("fontSize.label"),
1171
+ onMousedown: r[8] ||= P(() => {}, ["stop"]),
1172
+ onFocus: r[9] ||= (...e) => D(de) && D(de)(...e),
1173
+ "aria-expanded": D(I) === "size",
1174
+ "aria-haspopup": "listbox",
1175
+ onInput: r[10] ||= (...e) => D(fe) && D(fe)(...e),
1176
+ onKeydown: [
1177
+ r[11] ||= N(P((e) => D(he)(), ["prevent", "stop"]), ["up"]),
1178
+ r[12] ||= N(P((e) => D(ge)(), ["prevent", "stop"]), ["down"]),
1179
+ r[13] ||= N(P((e) => D(pe)(e), ["prevent"]), ["enter"])
1180
+ ],
1181
+ onBlur: r[14] ||= (e) => D(pe)(e)
1182
+ }, null, 40, at),
1183
+ l("button", {
1184
+ class: "size-btn",
1185
+ onMousedown: r[15] ||= P((...e) => D(he) && D(he)(...e), ["prevent"]),
1186
+ title: D(p)("fontSize.increase")
1187
+ }, " + ", 40, ot),
1188
+ D(I) === "size" ? (y(), c("div", {
1189
+ key: 0,
1190
+ style: g(D(L)),
1191
+ class: "toolbar-dropdown__menu size-menu"
1192
+ }, [(y(!0), c(i, null, C(D(ze), (e) => (y(), c("button", {
1193
+ key: e,
1194
+ class: h(["toolbar-dropdown__item", { active: K.value === e }]),
1195
+ onMousedown: P((t) => D(me)(e), ["prevent"])
1196
+ }, E(e), 43, st))), 128))], 4)) : s("", !0)
1197
+ ], 512),
1198
+ r[42] ||= l("span", { class: "divider" }, null, -1),
1199
+ l("button", {
1200
+ title: D(p)("formattingBar.boldShortcut"),
1201
+ "aria-label": D(p)("formattingBar.bold"),
1202
+ class: h({ active: W.value.textFormatting.bold }),
1203
+ onMousedown: r[16] ||= P((e) => Z("toggleBold"), ["prevent"])
1204
+ }, [d(e, { name: "format_bold" })], 42, ct),
1205
+ l("button", {
1206
+ title: D(p)("formattingBar.italicShortcut"),
1207
+ "aria-label": D(p)("formattingBar.italic"),
1208
+ class: h({ active: W.value.textFormatting.italic }),
1209
+ onMousedown: r[17] ||= P((e) => Z("toggleItalic"), ["prevent"])
1210
+ }, [d(e, { name: "format_italic" })], 42, lt),
1211
+ l("button", {
1212
+ title: D(p)("formattingBar.underlineShortcut"),
1213
+ "aria-label": D(p)("formattingBar.underline"),
1214
+ class: h({ active: !!W.value.textFormatting.underline }),
1215
+ onMousedown: r[18] ||= P((e) => Z("toggleUnderline"), ["prevent"])
1216
+ }, [d(e, { name: "format_underlined" })], 42, ut),
1217
+ l("button", {
1218
+ title: D(p)("formattingBar.strikethrough"),
1219
+ "aria-label": D(p)("formattingBar.strikethrough"),
1220
+ class: h({ active: W.value.textFormatting.strike }),
1221
+ onMousedown: r[19] ||= P((e) => Z("toggleStrike"), ["prevent"])
1222
+ }, [d(e, { name: "strikethrough_s" })], 42, dt),
1223
+ d(Q, {
1224
+ mode: "text",
1225
+ value: ae.value,
1226
+ theme: n.theme ?? null,
1227
+ onChange: _e
1228
+ }, null, 8, ["value", "theme"]),
1229
+ d(Q, {
1230
+ mode: "highlight",
1231
+ value: oe.value,
1232
+ theme: n.theme ?? null,
1233
+ onChange: ye
1234
+ }, null, 8, ["value", "theme"]),
1235
+ l("button", {
1236
+ title: D(p)("formattingBar.insertLinkShortcut"),
1237
+ "aria-label": D(p)("formattingBar.insertLink"),
1238
+ onMousedown: r[20] ||= P((e) => t.$emit("insert-link"), ["prevent"])
1239
+ }, [d(e, { name: "link" })], 40, ft),
1240
+ l("button", {
1241
+ title: D(p)("formattingBar.superscriptShortcut"),
1242
+ "aria-label": D(p)("formattingBar.superscript"),
1243
+ class: h({ active: W.value.textFormatting.vertAlign === "superscript" }),
1244
+ onMousedown: r[21] ||= P((e) => Z("toggleSuperscript"), ["prevent"])
1245
+ }, [d(e, { name: "superscript" })], 42, pt),
1246
+ l("button", {
1247
+ title: D(p)("formattingBar.subscriptShortcut"),
1248
+ "aria-label": D(p)("formattingBar.subscript"),
1249
+ class: h({ active: W.value.textFormatting.vertAlign === "subscript" }),
1250
+ onMousedown: r[22] ||= P((e) => Z("toggleSubscript"), ["prevent"])
1251
+ }, [d(e, { name: "subscript" })], 42, mt),
1252
+ r[43] ||= l("span", { class: "divider" }, null, -1),
1253
+ l("div", {
1254
+ class: "toolbar-dropdown",
1255
+ ref_key: "alignDropdownRef",
1256
+ ref: j
1257
+ }, [l("button", {
1258
+ class: "toolbar-dropdown__trigger align-trigger",
1259
+ onMousedown: r[23] ||= P((e) => D(R)("align"), ["prevent"]),
1260
+ "aria-expanded": D(I) === "align",
1261
+ "aria-haspopup": "listbox",
1262
+ title: D(p)("formattingBar.groups.alignment")
1263
+ }, [d(e, { name: J.value }, null, 8, ["name"]), d(e, {
1264
+ class: "chevron",
1265
+ name: "arrow_drop_down",
1266
+ size: 16
1267
+ })], 40, ht), D(I) === "align" ? (y(), c("div", {
1268
+ key: 0,
1269
+ style: g(D(L)),
1270
+ class: "toolbar-dropdown__menu align-strip"
1271
+ }, [
1272
+ l("button", {
1273
+ class: h(["align-strip__btn", { active: q.value === "left" }]),
1274
+ title: `${D(p)("alignment.alignLeft")} (${D(p)("alignment.alignLeftShortcut")})`,
1275
+ onMousedown: r[24] ||= P((e) => {
1276
+ Z("alignLeft"), I.value = null;
1277
+ }, ["prevent"])
1278
+ }, [d(e, {
1279
+ name: "format_align_left",
1280
+ size: 18
1281
+ })], 42, gt),
1282
+ l("button", {
1283
+ class: h(["align-strip__btn", { active: q.value === "center" }]),
1284
+ title: `${D(p)("alignment.center")} (${D(p)("alignment.centerShortcut")})`,
1285
+ onMousedown: r[25] ||= P((e) => {
1286
+ Z("alignCenter"), I.value = null;
1287
+ }, ["prevent"])
1288
+ }, [d(e, {
1289
+ name: "format_align_center",
1290
+ size: 18
1291
+ })], 42, _t),
1292
+ l("button", {
1293
+ class: h(["align-strip__btn", { active: q.value === "right" }]),
1294
+ title: `${D(p)("alignment.alignRight")} (${D(p)("alignment.alignRightShortcut")})`,
1295
+ onMousedown: r[26] ||= P((e) => {
1296
+ Z("alignRight"), I.value = null;
1297
+ }, ["prevent"])
1298
+ }, [d(e, {
1299
+ name: "format_align_right",
1300
+ size: 18
1301
+ })], 42, vt),
1302
+ l("button", {
1303
+ class: h(["align-strip__btn", { active: q.value === "both" }]),
1304
+ title: `${D(p)("alignment.justify")} (${D(p)("alignment.justifyShortcut")})`,
1305
+ onMousedown: r[27] ||= P((e) => {
1306
+ Z("alignJustify"), I.value = null;
1307
+ }, ["prevent"])
1308
+ }, [d(e, {
1309
+ name: "format_align_justify",
1310
+ size: 18
1311
+ })], 42, yt)
1312
+ ], 4)) : s("", !0)], 512),
1313
+ l("button", {
1314
+ title: D(p)("lists.bulletList"),
1315
+ "aria-label": D(p)("lists.bulletList"),
1316
+ class: h({ active: W.value.inList && W.value.listType === "bullet" }),
1317
+ onMousedown: r[28] ||= P((e) => Z("toggleBulletList"), ["prevent"])
1318
+ }, [d(e, { name: "format_list_bulleted" })], 42, bt),
1319
+ l("button", {
1320
+ title: D(p)("lists.numberedList"),
1321
+ "aria-label": D(p)("lists.numberedList"),
1322
+ class: h({ active: W.value.inList && W.value.listType === "numbered" }),
1323
+ onMousedown: r[29] ||= P((e) => Z("toggleNumberedList"), ["prevent"])
1324
+ }, [d(e, { name: "format_list_numbered" })], 42, xt),
1325
+ l("button", {
1326
+ title: D(p)("lists.decreaseIndent"),
1327
+ "aria-label": D(p)("lists.decreaseIndent"),
1328
+ disabled: !ie.value,
1329
+ onMousedown: r[30] ||= P((e) => Z("outdent"), ["prevent"])
1330
+ }, [d(e, { name: "format_indent_decrease" })], 40, St),
1331
+ l("button", {
1332
+ title: D(p)("lists.increaseIndent"),
1333
+ "aria-label": D(p)("lists.increaseIndent"),
1334
+ onMousedown: r[31] ||= P((e) => Z("indent"), ["prevent"])
1335
+ }, [d(e, { name: "format_indent_increase" })], 40, Ct),
1336
+ l("div", {
1337
+ class: "toolbar-dropdown",
1338
+ ref_key: "spacingDropdownRef",
1339
+ ref: M
1340
+ }, [l("button", {
1341
+ class: "toolbar-dropdown__trigger",
1342
+ onMousedown: r[32] ||= P((e) => D(R)("spacing"), ["prevent"]),
1343
+ "aria-expanded": D(I) === "spacing",
1344
+ "aria-haspopup": "listbox",
1345
+ title: D(p)("lineSpacing.label")
1346
+ }, [d(e, { name: "format_line_spacing" }), d(e, {
1347
+ class: "chevron",
1348
+ name: "arrow_drop_down",
1349
+ size: 16
1350
+ })], 40, wt), D(I) === "spacing" ? (y(), c("div", {
1351
+ key: 0,
1352
+ style: g(D(L)),
1353
+ class: "toolbar-dropdown__menu"
1354
+ }, [(y(!0), c(i, null, C(D(Ve), (e) => (y(), c("button", {
1355
+ key: e.value,
1356
+ class: h(["toolbar-dropdown__item", { active: Se(e.value) }]),
1357
+ onMousedown: P((t) => xe(e.value), ["prevent"])
1358
+ }, E(e.labelKey ? D(p)(e.labelKey) : e.label), 43, Tt))), 128))], 4)) : s("", !0)], 512),
1359
+ l("button", {
1360
+ title: D(p)("formattingBar.clearFormatting"),
1361
+ "aria-label": D(p)("formattingBar.clearFormatting"),
1362
+ onMousedown: P(ve, ["prevent"])
1363
+ }, [d(e, { name: "format_clear" })], 40, Et),
1364
+ r[44] ||= l("span", { class: "divider" }, null, -1),
1365
+ l("button", {
1366
+ title: D(p)("formattingBar.commentsAndChanges"),
1367
+ "aria-label": D(p)("formattingBar.commentsAndChanges"),
1368
+ class: h({ active: n.commentsSidebarOpen }),
1369
+ onMousedown: r[33] ||= P((e) => t.$emit("toggle-sidebar"), ["prevent"])
1370
+ }, [d(e, { name: "comment" })], 42, Dt),
1371
+ n.imageContext ? (y(), c(i, { key: 1 }, [
1372
+ r[38] ||= l("span", { class: "divider" }, null, -1),
1373
+ d(Ie, {
1374
+ "image-context": n.imageContext,
1375
+ onChange: r[34] ||= (e) => t.$emit("image-wrap-type", e)
1376
+ }, null, 8, ["image-context"]),
1377
+ d(Le, { onTransform: r[35] ||= (e) => t.$emit("image-transform", e) }),
1378
+ l("button", {
1379
+ title: D(p)("formattingBar.imagePropertiesShortcut"),
1380
+ "aria-label": D(p)("formattingBar.imageProperties"),
1381
+ onMousedown: r[36] ||= P((e) => t.$emit("image-properties"), ["prevent"])
1382
+ }, [d(e, { name: "tune" })], 40, Ot)
1383
+ ], 64)) : s("", !0),
1384
+ w(t.$slots, "table-context", {}, void 0, !0),
1385
+ r[45] ||= l("span", { class: "divider" }, null, -1),
1386
+ n.editorMode ? (y(), o(je, {
1387
+ key: 2,
1388
+ "model-value": n.editorMode,
1389
+ "onUpdate:modelValue": r[37] ||= (e) => t.$emit("mode-change", e)
1390
+ }, null, 8, ["model-value"])) : s("", !0),
1391
+ w(t.$slots, "toolbar-extra", {}, void 0, !0)
1392
+ ])) : s("", !0);
1393
+ }
1394
+ }), [["__scopeId", "data-v-778afc31"]]), At = /* @__PURE__ */ f({
1395
+ __name: "TableCellFillPicker",
1396
+ props: {
1397
+ disabled: { type: Boolean },
1398
+ theme: {},
1399
+ value: {}
1400
+ },
1401
+ emits: ["change"],
1402
+ setup(e, { emit: n }) {
1403
+ let r = n, { t: i } = t();
1404
+ function a(e) {
1405
+ typeof e == "string" && r("change", e === "none" ? "" : e.replace(/^#/, ""));
1406
+ }
1407
+ return (t, n) => (y(), o(Q, {
1408
+ mode: "highlight",
1409
+ value: e.value,
1410
+ theme: e.theme ?? null,
1411
+ disabled: e.disabled,
1412
+ title: D(i)("table.cellFillColor"),
1413
+ icon: "format_color_fill",
1414
+ "auto-label": D(i)("colorPicker.noColor"),
1415
+ onChange: a
1416
+ }, null, 8, [
1417
+ "value",
1418
+ "theme",
1419
+ "disabled",
1420
+ "title",
1421
+ "auto-label"
1422
+ ]));
1423
+ }
1424
+ }), jt = ["disabled", "onClick"], Mt = { class: "docx-tbp__panel" }, Nt = ["title", "onClick"], Pt = /* @__PURE__ */ n(/* @__PURE__ */ f({
1425
+ __name: "TableBorderPicker",
1426
+ props: { disabled: { type: Boolean } },
1427
+ emits: ["change"],
1428
+ setup(t, { emit: n }) {
1429
+ let r = n, a = S(!1), s = [
1430
+ {
1431
+ value: "all",
1432
+ icon: "border_all",
1433
+ label: "All borders"
1434
+ },
1435
+ {
1436
+ value: "none",
1437
+ icon: "border_clear",
1438
+ label: "No borders"
1439
+ },
1440
+ {
1441
+ value: "box",
1442
+ icon: "border_outer",
1443
+ label: "Outside borders"
1444
+ },
1445
+ {
1446
+ value: "inside",
1447
+ icon: "border_inner",
1448
+ label: "Inside borders"
1449
+ },
1450
+ {
1451
+ value: "top",
1452
+ icon: "border_top",
1453
+ label: "Top border"
1454
+ },
1455
+ {
1456
+ value: "bottom",
1457
+ icon: "border_bottom",
1458
+ label: "Bottom border"
1459
+ },
1460
+ {
1461
+ value: "left",
1462
+ icon: "border_left",
1463
+ label: "Left border"
1464
+ },
1465
+ {
1466
+ value: "right",
1467
+ icon: "border_right",
1468
+ label: "Right border"
1469
+ },
1470
+ {
1471
+ value: "insideH",
1472
+ icon: "border_horizontal",
1473
+ label: "Inside horizontal"
1474
+ },
1475
+ {
1476
+ value: "insideV",
1477
+ icon: "border_vertical",
1478
+ label: "Inside vertical"
1479
+ }
1480
+ ];
1481
+ function u(e) {
1482
+ r("change", e), a.value = !1;
1483
+ }
1484
+ return (n, r) => (y(), o($, {
1485
+ open: a.value,
1486
+ "onUpdate:open": r[0] ||= (e) => a.value = e,
1487
+ onClose: r[1] ||= (e) => a.value = !1
1488
+ }, {
1489
+ trigger: j(({ toggle: n }) => [l("button", {
1490
+ type: "button",
1491
+ class: "docx-tbp__btn",
1492
+ disabled: t.disabled,
1493
+ title: "Borders",
1494
+ onClick: P(n, ["prevent"])
1495
+ }, [d(e, {
1496
+ name: "border_all",
1497
+ size: 20
1498
+ })], 8, jt)]),
1499
+ panel: j(() => [l("div", Mt, [(y(), c(i, null, C(s, (t) => l("button", {
1500
+ key: t.value,
1501
+ type: "button",
1502
+ class: "docx-tbp__option",
1503
+ title: t.label,
1504
+ onClick: P((e) => u(t.value), ["prevent"])
1505
+ }, [d(e, {
1506
+ name: t.icon,
1507
+ size: 20
1508
+ }, null, 8, ["name"])], 8, Nt)), 64))])]),
1509
+ _: 1
1510
+ }, 8, ["open"]));
1511
+ }
1512
+ }), [["__scopeId", "data-v-47032801"]]), Ft = /* @__PURE__ */ f({
1513
+ __name: "TableBorderColorPicker",
1514
+ props: {
1515
+ disabled: { type: Boolean },
1516
+ theme: {},
1517
+ value: {}
1518
+ },
1519
+ emits: ["change"],
1520
+ setup(e, { emit: n }) {
1521
+ let r = n, { t: i } = t();
1522
+ function a(e) {
1523
+ typeof e == "string" ? r("change", e.replace(/^#/, "")) : e.rgb ? r("change", e.rgb.replace(/^#/, "")) : e.auto && r("change", "000000");
1524
+ }
1525
+ return (t, n) => (y(), o(Q, {
1526
+ mode: "border",
1527
+ value: e.value,
1528
+ theme: e.theme ?? null,
1529
+ disabled: e.disabled,
1530
+ title: D(i)("table.borderColor"),
1531
+ onChange: a
1532
+ }, null, 8, [
1533
+ "value",
1534
+ "theme",
1535
+ "disabled",
1536
+ "title"
1537
+ ]));
1538
+ }
1539
+ }), It = ["disabled", "onClick"], Lt = { class: "docx-tbwidth__panel" }, Rt = ["onClick"], zt = { class: "docx-tbwidth__label" }, Bt = /* @__PURE__ */ n(/* @__PURE__ */ f({
1540
+ __name: "TableBorderWidthPicker",
1541
+ props: { disabled: { type: Boolean } },
1542
+ emits: ["change"],
1543
+ setup(t, { emit: n }) {
1544
+ let r = n, a = S(!1), s = [
1545
+ {
1546
+ label: "0.5pt",
1547
+ eighths: 4,
1548
+ previewPx: 1
1549
+ },
1550
+ {
1551
+ label: "0.75pt",
1552
+ eighths: 6,
1553
+ previewPx: 1
1554
+ },
1555
+ {
1556
+ label: "1pt",
1557
+ eighths: 8,
1558
+ previewPx: 2
1559
+ },
1560
+ {
1561
+ label: "1.5pt",
1562
+ eighths: 12,
1563
+ previewPx: 2
1564
+ },
1565
+ {
1566
+ label: "2.25pt",
1567
+ eighths: 18,
1568
+ previewPx: 3
1569
+ },
1570
+ {
1571
+ label: "3pt",
1572
+ eighths: 24,
1573
+ previewPx: 4
1574
+ },
1575
+ {
1576
+ label: "4.5pt",
1577
+ eighths: 36,
1578
+ previewPx: 6
1579
+ },
1580
+ {
1581
+ label: "6pt",
1582
+ eighths: 48,
1583
+ previewPx: 8
1584
+ }
1585
+ ];
1586
+ function u(e) {
1587
+ r("change", e), a.value = !1;
1588
+ }
1589
+ return (n, r) => (y(), o($, {
1590
+ open: a.value,
1591
+ "onUpdate:open": r[0] ||= (e) => a.value = e,
1592
+ onClose: r[1] ||= (e) => a.value = !1
1593
+ }, {
1594
+ trigger: j(({ toggle: n }) => [l("button", {
1595
+ type: "button",
1596
+ class: "docx-tbwidth__btn",
1597
+ disabled: t.disabled,
1598
+ title: "Border width",
1599
+ onClick: P(n, ["prevent"])
1600
+ }, [d(e, {
1601
+ name: "line_weight",
1602
+ size: 20
1603
+ })], 8, It)]),
1604
+ panel: j(() => [l("div", Lt, [(y(), c(i, null, C(s, (e) => l("button", {
1605
+ key: e.eighths,
1606
+ type: "button",
1607
+ class: "docx-tbwidth__option",
1608
+ onClick: P((t) => u(e.eighths), ["prevent"])
1609
+ }, [l("span", {
1610
+ class: "docx-tbwidth__preview",
1611
+ style: g({ borderTopWidth: e.previewPx + "px" })
1612
+ }, null, 4), l("span", zt, E(e.label), 1)], 8, Rt)), 64))])]),
1613
+ _: 1
1614
+ }, 8, ["open"]));
1615
+ }
1616
+ }), [["__scopeId", "data-v-f11ca0b1"]]), Vt = [
1617
+ "disabled",
1618
+ "title",
1619
+ "onClick"
1620
+ ], Ht = ["aria-label"], Ut = ["disabled"], Wt = ["disabled"], Gt = ["disabled"], Kt = ["disabled"], qt = { class: "docx-tmore__section-label" }, Jt = { class: "docx-tmore__icon-row" }, Yt = ["title"], Xt = ["title"], Zt = ["title"], Qt = { class: "docx-tmore__section-label" }, $t = { class: "docx-tmore__icon-row" }, en = ["title"], tn = ["title"], nn = ["title"], rn = { class: "docx-tmore__grow" }, an = {
1621
+ key: 0,
1622
+ class: "docx-tmore__sub"
1623
+ }, on = { class: "docx-tmore__margin-grid" }, sn = { class: "docx-tmore__field-label" }, cn = ["onUpdate:modelValue"], ln = { class: "docx-tmore__grow" }, un = {
1624
+ key: 1,
1625
+ class: "docx-tmore__sub"
1626
+ }, dn = { class: "docx-tmore__row-field" }, fn = { class: "docx-tmore__field-label" }, pn = { value: "auto" }, mn = { value: "atLeast" }, hn = { value: "exact" }, gn = {
1627
+ key: 0,
1628
+ class: "docx-tmore__row-field"
1629
+ }, _n = { class: "docx-tmore__field-label" }, vn = { class: "docx-tmore__grow" }, yn = {
1630
+ key: 2,
1631
+ class: "docx-tmore__sub docx-tmore__sub--list"
1632
+ }, bn = /* @__PURE__ */ n(/* @__PURE__ */ f({
1633
+ __name: "TableMoreDropdown",
1634
+ props: {
1635
+ disabled: {
1636
+ type: Boolean,
1637
+ default: !1
1638
+ },
1639
+ canSplit: {
1640
+ type: Boolean,
1641
+ default: !1
1642
+ },
1643
+ canMerge: {
1644
+ type: Boolean,
1645
+ default: !1
1646
+ },
1647
+ rowCount: { default: 0 },
1648
+ columnCount: { default: 0 },
1649
+ currentJustification: { default: "left" }
1650
+ },
1651
+ emits: [
1652
+ "action",
1653
+ "cell-margins",
1654
+ "cell-text-direction",
1655
+ "row-height"
1656
+ ],
1657
+ setup(n, { emit: r }) {
1658
+ let a = n, u = r, { t: f } = t(), p = S(!1), m = S(!1), g = S(!1), _ = S(!1), v = x({
1659
+ top: 0,
1660
+ bottom: 0,
1661
+ left: 108,
1662
+ right: 108
1663
+ }), b = S(0), w = S("atLeast");
1664
+ A(p, (e) => {
1665
+ e || (m.value = !1, g.value = !1, _.value = !1);
1666
+ });
1667
+ function T(e) {
1668
+ return a.disabled ? !0 : e === "splitCell" ? !a.canSplit : e === "mergeCells" ? !a.canMerge : e === "deleteRow" ? (a.rowCount ?? 0) <= 1 : e === "deleteColumn" ? (a.columnCount ?? 0) <= 1 : !1;
1669
+ }
1670
+ function N(e) {
1671
+ T(e) || (u("action", e), p.value = !1);
1672
+ }
1673
+ let F = (e) => {
1674
+ let t = Number(e);
1675
+ return Number.isFinite(t) && t > 0 ? t : 0;
1676
+ };
1677
+ function ee() {
1678
+ u("cell-margins", {
1679
+ top: F(v.top),
1680
+ bottom: F(v.bottom),
1681
+ left: F(v.left),
1682
+ right: F(v.right)
1683
+ }), p.value = !1;
1684
+ }
1685
+ function I() {
1686
+ let e = F(b.value);
1687
+ w.value === "auto" || e <= 0 ? u("row-height", { height: null }) : u("row-height", {
1688
+ height: e,
1689
+ rule: w.value
1690
+ }), p.value = !1;
1691
+ }
1692
+ function L(e) {
1693
+ u("cell-text-direction", e), p.value = !1;
1694
+ }
1695
+ return (t, r) => (y(), o($, {
1696
+ open: p.value,
1697
+ placement: "bottom-right",
1698
+ "onUpdate:open": r[35] ||= (e) => p.value = e,
1699
+ onClose: r[36] ||= (e) => p.value = !1
1700
+ }, {
1701
+ trigger: j(({ toggle: t }) => [l("button", {
1702
+ type: "button",
1703
+ class: h(["docx-tmore__btn", { "docx-tmore__btn--open": p.value }]),
1704
+ disabled: n.disabled,
1705
+ title: D(f)("tableAdvanced.tableOptions"),
1706
+ onClick: P(t, ["prevent"])
1707
+ }, [d(e, {
1708
+ name: "more_vert",
1709
+ size: 20
1710
+ })], 10, Vt)]),
1711
+ panel: j(() => [l("div", {
1712
+ class: "docx-tmore__panel",
1713
+ role: "menu",
1714
+ "aria-label": D(f)("tableAdvanced.tableOptionsMenu")
1715
+ }, [
1716
+ l("button", {
1717
+ type: "button",
1718
+ class: "docx-tmore__item",
1719
+ onClick: r[0] ||= P((e) => N("addRowAbove"), ["prevent"])
1720
+ }, [d(e, {
1721
+ name: "add",
1722
+ size: 18
1723
+ }), l("span", null, E(D(f)("table.insertRowAbove")), 1)]),
1724
+ l("button", {
1725
+ type: "button",
1726
+ class: "docx-tmore__item",
1727
+ onClick: r[1] ||= P((e) => N("addRowBelow"), ["prevent"])
1728
+ }, [d(e, {
1729
+ name: "add",
1730
+ size: 18
1731
+ }), l("span", null, E(D(f)("table.insertRowBelow")), 1)]),
1732
+ l("button", {
1733
+ type: "button",
1734
+ class: "docx-tmore__item",
1735
+ onClick: r[2] ||= P((e) => N("addColumnLeft"), ["prevent"])
1736
+ }, [d(e, {
1737
+ name: "add",
1738
+ size: 18
1739
+ }), l("span", null, E(D(f)("table.insertColumnLeft")), 1)]),
1740
+ l("button", {
1741
+ type: "button",
1742
+ class: "docx-tmore__item",
1743
+ onClick: r[3] ||= P((e) => N("addColumnRight"), ["prevent"])
1744
+ }, [d(e, {
1745
+ name: "add",
1746
+ size: 18
1747
+ }), l("span", null, E(D(f)("table.insertColumnRight")), 1)]),
1748
+ r[39] ||= l("div", { class: "docx-tmore__separator" }, null, -1),
1749
+ l("button", {
1750
+ type: "button",
1751
+ class: "docx-tmore__item",
1752
+ disabled: T("mergeCells"),
1753
+ onClick: r[4] ||= P((e) => N("mergeCells"), ["prevent"])
1754
+ }, [d(e, {
1755
+ name: "call_merge",
1756
+ size: 18
1757
+ }), l("span", null, E(D(f)("table.mergeCells")), 1)], 8, Ut),
1758
+ l("button", {
1759
+ type: "button",
1760
+ class: "docx-tmore__item",
1761
+ disabled: T("splitCell"),
1762
+ onClick: r[5] ||= P((e) => N("splitCell"), ["prevent"])
1763
+ }, [d(e, {
1764
+ name: "call_split",
1765
+ size: 18
1766
+ }), l("span", null, E(D(f)("table.splitCell")), 1)], 8, Wt),
1767
+ r[40] ||= l("div", { class: "docx-tmore__separator" }, null, -1),
1768
+ l("button", {
1769
+ type: "button",
1770
+ class: "docx-tmore__item",
1771
+ onClick: r[6] ||= P((e) => N("selectTable"), ["prevent"])
1772
+ }, [d(e, {
1773
+ name: "select_all",
1774
+ size: 18
1775
+ }), l("span", null, E(D(f)("table.selectTable")), 1)]),
1776
+ r[41] ||= l("div", { class: "docx-tmore__separator" }, null, -1),
1777
+ l("button", {
1778
+ type: "button",
1779
+ class: "docx-tmore__item docx-tmore__item--danger",
1780
+ disabled: T("deleteRow"),
1781
+ onClick: r[7] ||= P((e) => N("deleteRow"), ["prevent"])
1782
+ }, [d(e, {
1783
+ name: "delete",
1784
+ size: 18
1785
+ }), l("span", null, E(D(f)("table.deleteRow")), 1)], 8, Gt),
1786
+ l("button", {
1787
+ type: "button",
1788
+ class: "docx-tmore__item docx-tmore__item--danger",
1789
+ disabled: T("deleteColumn"),
1790
+ onClick: r[8] ||= P((e) => N("deleteColumn"), ["prevent"])
1791
+ }, [d(e, {
1792
+ name: "delete",
1793
+ size: 18
1794
+ }), l("span", null, E(D(f)("table.deleteColumn")), 1)], 8, Kt),
1795
+ l("button", {
1796
+ type: "button",
1797
+ class: "docx-tmore__item docx-tmore__item--danger",
1798
+ onClick: r[9] ||= P((e) => N("deleteTable"), ["prevent"])
1799
+ }, [d(e, {
1800
+ name: "delete",
1801
+ size: 18
1802
+ }), l("span", null, E(D(f)("table.deleteTable")), 1)]),
1803
+ r[42] ||= l("div", { class: "docx-tmore__separator" }, null, -1),
1804
+ l("div", qt, E(D(f)("tableAdvanced.verticalAlignment")), 1),
1805
+ l("div", Jt, [
1806
+ l("button", {
1807
+ type: "button",
1808
+ class: "docx-tmore__icon-btn",
1809
+ title: D(f)("tableAdvanced.top"),
1810
+ onMousedown: r[10] ||= P(() => {}, ["prevent"]),
1811
+ onClick: r[11] ||= P((e) => N("verticalAlignTop"), ["prevent"])
1812
+ }, [d(e, {
1813
+ name: "vertical_align_top",
1814
+ size: 16
1815
+ })], 40, Yt),
1816
+ l("button", {
1817
+ type: "button",
1818
+ class: "docx-tmore__icon-btn",
1819
+ title: D(f)("tableAdvanced.middle"),
1820
+ onMousedown: r[12] ||= P(() => {}, ["prevent"]),
1821
+ onClick: r[13] ||= P((e) => N("verticalAlignMiddle"), ["prevent"])
1822
+ }, [d(e, {
1823
+ name: "vertical_align_center",
1824
+ size: 16
1825
+ })], 40, Xt),
1826
+ l("button", {
1827
+ type: "button",
1828
+ class: "docx-tmore__icon-btn",
1829
+ title: D(f)("tableAdvanced.bottom"),
1830
+ onMousedown: r[14] ||= P(() => {}, ["prevent"]),
1831
+ onClick: r[15] ||= P((e) => N("verticalAlignBottom"), ["prevent"])
1832
+ }, [d(e, {
1833
+ name: "vertical_align_bottom",
1834
+ size: 16
1835
+ })], 40, Zt)
1836
+ ]),
1837
+ r[43] ||= l("div", { class: "docx-tmore__separator" }, null, -1),
1838
+ l("div", Qt, E(D(f)("tableAdvanced.tableAlignment")), 1),
1839
+ l("div", $t, [
1840
+ l("button", {
1841
+ type: "button",
1842
+ class: h(["docx-tmore__icon-btn", { "docx-tmore__icon-btn--active": n.currentJustification === "left" }]),
1843
+ title: D(f)("tableAdvanced.alignTableLeft"),
1844
+ onMousedown: r[16] ||= P(() => {}, ["prevent"]),
1845
+ onClick: r[17] ||= P((e) => N("alignTableLeft"), ["prevent"])
1846
+ }, [d(e, {
1847
+ name: "format_align_left",
1848
+ size: 16
1849
+ })], 42, en),
1850
+ l("button", {
1851
+ type: "button",
1852
+ class: h(["docx-tmore__icon-btn", { "docx-tmore__icon-btn--active": n.currentJustification === "center" }]),
1853
+ title: D(f)("tableAdvanced.alignTableCenter"),
1854
+ onMousedown: r[18] ||= P(() => {}, ["prevent"]),
1855
+ onClick: r[19] ||= P((e) => N("alignTableCenter"), ["prevent"])
1856
+ }, [d(e, {
1857
+ name: "format_align_center",
1858
+ size: 16
1859
+ })], 42, tn),
1860
+ l("button", {
1861
+ type: "button",
1862
+ class: h(["docx-tmore__icon-btn", { "docx-tmore__icon-btn--active": n.currentJustification === "right" }]),
1863
+ title: D(f)("tableAdvanced.alignTableRight"),
1864
+ onMousedown: r[20] ||= P(() => {}, ["prevent"]),
1865
+ onClick: r[21] ||= P((e) => N("alignTableRight"), ["prevent"])
1866
+ }, [d(e, {
1867
+ name: "format_align_right",
1868
+ size: 16
1869
+ })], 42, nn)
1870
+ ]),
1871
+ r[44] ||= l("div", { class: "docx-tmore__separator" }, null, -1),
1872
+ l("button", {
1873
+ type: "button",
1874
+ class: "docx-tmore__item",
1875
+ onClick: r[22] ||= P((e) => m.value = !m.value, ["prevent"])
1876
+ }, [
1877
+ d(e, {
1878
+ name: "padding",
1879
+ size: 18
1880
+ }),
1881
+ l("span", rn, E(D(f)("tableAdvanced.cellMargins")), 1),
1882
+ d(e, {
1883
+ name: m.value ? "expand_less" : "expand_more",
1884
+ size: 18
1885
+ }, null, 8, ["name"])
1886
+ ]),
1887
+ m.value ? (y(), c("div", an, [l("div", on, [(y(), c(i, null, C([
1888
+ "top",
1889
+ "bottom",
1890
+ "left",
1891
+ "right"
1892
+ ], (e) => l("label", {
1893
+ key: e,
1894
+ class: "docx-tmore__field"
1895
+ }, [
1896
+ l("span", sn, E(e), 1),
1897
+ M(l("input", {
1898
+ type: "number",
1899
+ min: "0",
1900
+ step: "20",
1901
+ "onUpdate:modelValue": (t) => v[e] = t,
1902
+ class: "docx-tmore__input"
1903
+ }, null, 8, cn), [[
1904
+ k,
1905
+ v[e],
1906
+ void 0,
1907
+ { number: !0 }
1908
+ ]]),
1909
+ r[37] ||= l("span", { class: "docx-tmore__unit" }, "tw", -1)
1910
+ ])), 64))]), l("button", {
1911
+ type: "button",
1912
+ class: "docx-tmore__apply",
1913
+ onClick: P(ee, ["prevent"])
1914
+ }, E(D(f)("common.apply")), 1)])) : s("", !0),
1915
+ l("button", {
1916
+ type: "button",
1917
+ class: "docx-tmore__item",
1918
+ onClick: r[23] ||= P((e) => g.value = !g.value, ["prevent"])
1919
+ }, [
1920
+ d(e, {
1921
+ name: "height",
1922
+ size: 18
1923
+ }),
1924
+ l("span", ln, E(D(f)("tableAdvanced.rowHeight")), 1),
1925
+ d(e, {
1926
+ name: g.value ? "expand_less" : "expand_more",
1927
+ size: 18
1928
+ }, null, 8, ["name"])
1929
+ ]),
1930
+ g.value ? (y(), c("div", un, [
1931
+ l("label", dn, [l("span", fn, E(D(f)("tableAdvanced.rule")), 1), M(l("select", {
1932
+ "onUpdate:modelValue": r[24] ||= (e) => w.value = e,
1933
+ class: "docx-tmore__select"
1934
+ }, [
1935
+ l("option", pn, E(D(f)("tableAdvanced.heightRules.auto")), 1),
1936
+ l("option", mn, E(D(f)("tableAdvanced.heightRules.atLeast")), 1),
1937
+ l("option", hn, E(D(f)("tableAdvanced.heightRules.exact")), 1)
1938
+ ], 512), [[O, w.value]])]),
1939
+ w.value === "auto" ? s("", !0) : (y(), c("label", gn, [
1940
+ l("span", _n, E(D(f)("tableAdvanced.height")), 1),
1941
+ M(l("input", {
1942
+ type: "number",
1943
+ min: "0",
1944
+ step: "20",
1945
+ "onUpdate:modelValue": r[25] ||= (e) => b.value = e,
1946
+ class: "docx-tmore__input"
1947
+ }, null, 512), [[
1948
+ k,
1949
+ b.value,
1950
+ void 0,
1951
+ { number: !0 }
1952
+ ]]),
1953
+ r[38] ||= l("span", { class: "docx-tmore__unit" }, "tw", -1)
1954
+ ])),
1955
+ l("button", {
1956
+ type: "button",
1957
+ class: "docx-tmore__apply",
1958
+ onClick: P(I, ["prevent"])
1959
+ }, E(D(f)("common.apply")), 1)
1960
+ ])) : s("", !0),
1961
+ l("button", {
1962
+ type: "button",
1963
+ class: "docx-tmore__item",
1964
+ onClick: r[26] ||= P((e) => _.value = !_.value, ["prevent"])
1965
+ }, [
1966
+ d(e, {
1967
+ name: "text_rotation_none",
1968
+ size: 18
1969
+ }),
1970
+ l("span", vn, E(D(f)("tableAdvanced.textDirection")), 1),
1971
+ d(e, {
1972
+ name: _.value ? "expand_less" : "expand_more",
1973
+ size: 18
1974
+ }, null, 8, ["name"])
1975
+ ]),
1976
+ _.value ? (y(), c("div", yn, [
1977
+ l("button", {
1978
+ type: "button",
1979
+ class: "docx-tmore__sub-item",
1980
+ onClick: r[27] ||= P((e) => L(null), ["prevent"])
1981
+ }, E(D(f)("tableAdvanced.textDirections.horizontal")), 1),
1982
+ l("button", {
1983
+ type: "button",
1984
+ class: "docx-tmore__sub-item",
1985
+ onClick: r[28] ||= P((e) => L("tbRl"), ["prevent"])
1986
+ }, E(D(f)("tableAdvanced.textDirections.verticalRL")), 1),
1987
+ l("button", {
1988
+ type: "button",
1989
+ class: "docx-tmore__sub-item",
1990
+ onClick: r[29] ||= P((e) => L("btLr"), ["prevent"])
1991
+ }, E(D(f)("tableAdvanced.textDirections.verticalLR")), 1)
1992
+ ])) : s("", !0),
1993
+ r[45] ||= l("div", { class: "docx-tmore__separator" }, null, -1),
1994
+ l("button", {
1995
+ type: "button",
1996
+ class: "docx-tmore__item",
1997
+ onClick: r[30] ||= P((e) => N("toggleHeaderRow"), ["prevent"])
1998
+ }, [d(e, {
1999
+ name: "table_rows",
2000
+ size: 18
2001
+ }), l("span", null, E(D(f)("tableAdvanced.toggleHeaderRow")), 1)]),
2002
+ l("button", {
2003
+ type: "button",
2004
+ class: "docx-tmore__item",
2005
+ onClick: r[31] ||= P((e) => N("distributeColumns"), ["prevent"])
2006
+ }, [d(e, {
2007
+ name: "view_column",
2008
+ size: 18
2009
+ }), l("span", null, E(D(f)("tableAdvanced.distributeColumns")), 1)]),
2010
+ l("button", {
2011
+ type: "button",
2012
+ class: "docx-tmore__item",
2013
+ onClick: r[32] ||= P((e) => N("autoFit"), ["prevent"])
2014
+ }, [d(e, {
2015
+ name: "fit_width",
2016
+ size: 18
2017
+ }), l("span", null, E(D(f)("tableAdvanced.autoFit")), 1)]),
2018
+ l("button", {
2019
+ type: "button",
2020
+ class: "docx-tmore__item",
2021
+ onClick: r[33] ||= P((e) => N("toggleNoWrap"), ["prevent"])
2022
+ }, [d(e, {
2023
+ name: "wrap_text",
2024
+ size: 18
2025
+ }), l("span", null, E(D(f)("tableAdvanced.toggleNoWrap")), 1)]),
2026
+ r[46] ||= l("div", { class: "docx-tmore__separator" }, null, -1),
2027
+ l("button", {
2028
+ type: "button",
2029
+ class: "docx-tmore__item",
2030
+ onClick: r[34] ||= P((e) => N("tableProperties"), ["prevent"])
2031
+ }, [d(e, {
2032
+ name: "settings",
2033
+ size: 18
2034
+ }), l("span", null, E(D(f)("tableAdvanced.tableProperties")), 1)])
2035
+ ], 8, Ht)]),
2036
+ _: 1
2037
+ }, 8, ["open"]));
2038
+ }
2039
+ }), [["__scopeId", "data-v-8aa2b457"]]), xn = /* @__PURE__ */ n(/* @__PURE__ */ f({
2040
+ __name: "TableToolbar",
2041
+ props: {
2042
+ view: {},
2043
+ getCommands: { type: Function },
2044
+ stateTick: {},
2045
+ theme: {}
2046
+ },
2047
+ setup(e) {
2048
+ let t = e, n = a(() => {
2049
+ t.stateTick;
2050
+ let e = t.view;
2051
+ return e ? G(e.state) : null;
2052
+ }), r = a(() => !!n.value?.isInTable), o = a(() => {
2053
+ t.stateTick;
2054
+ let e = t.view;
2055
+ if (!e) return !1;
2056
+ let { $from: n } = e.state.selection;
2057
+ for (let e = n.depth; e > 0; e--) if (n.node(e).type.name === "tableCell") {
2058
+ let t = n.node(e), r = t.attrs.colspan || 1, i = t.attrs.rowspan || 1;
2059
+ return r > 1 || i > 1;
2060
+ }
2061
+ return !1;
2062
+ }), u = a(() => !!n.value?.hasMultiCellSelection), f = a(() => n.value?.rowCount ?? 0), p = a(() => n.value?.columnCount ?? 0), m = a(() => {
2063
+ let e = n.value?.table?.attrs?.justification;
2064
+ return e === "center" || e === "right" ? e : "left";
2065
+ }), h = {
2066
+ style: "single",
2067
+ size: 4,
2068
+ color: { rgb: "000000" }
2069
+ };
2070
+ A([() => t.view, () => t.stateTick], () => {
2071
+ let e = t.view;
2072
+ if (!e) return;
2073
+ let n = G(e.state), r = n.cellBorderColor;
2074
+ !r || !n.isInTable || typeof r == "object" && "rgb" in r && typeof r.rgb == "string" && (h.color = { rgb: r.rgb });
2075
+ }, { immediate: !0 });
2076
+ function g(e, ...n) {
2077
+ let r = t.view;
2078
+ if (!r) return !1;
2079
+ let i = t.getCommands()[e];
2080
+ if (typeof i != "function") return !1;
2081
+ let a = i(...n);
2082
+ return typeof a == "function" ? (a(r.state, (e) => r.dispatch(e), r), r.focus(), !0) : !1;
2083
+ }
2084
+ function _(e) {
2085
+ let t = {
2086
+ ...h,
2087
+ color: { ...h.color }
2088
+ };
2089
+ switch (e) {
2090
+ case "all":
2091
+ g("setAllTableBorders", t);
2092
+ return;
2093
+ case "none":
2094
+ g("removeTableBorders");
2095
+ return;
2096
+ case "box":
2097
+ g("setOutsideTableBorders", t);
2098
+ return;
2099
+ case "inside":
2100
+ case "insideH":
2101
+ case "insideV":
2102
+ g("setInsideTableBorders", t);
2103
+ return;
2104
+ case "top":
2105
+ case "bottom":
2106
+ case "left":
2107
+ case "right":
2108
+ g("setCellBorder", e, t, !0);
2109
+ return;
2110
+ }
2111
+ }
2112
+ function v(e) {
2113
+ h.color = { rgb: e.replace(/^#/, "") }, g("setTableBorderColor", e);
2114
+ }
2115
+ function b(e) {
2116
+ h.size = e, g("setTableBorderWidth", e);
2117
+ }
2118
+ function x(e) {
2119
+ g("setCellFillColor", e);
2120
+ }
2121
+ let S = {
2122
+ autoFit: ["autoFitContents"],
2123
+ alignTableLeft: ["setTableProperties", { justification: "left" }],
2124
+ alignTableCenter: ["setTableProperties", { justification: "center" }],
2125
+ alignTableRight: ["setTableProperties", { justification: "right" }],
2126
+ verticalAlignTop: ["setCellVerticalAlign", "top"],
2127
+ verticalAlignMiddle: ["setCellVerticalAlign", "center"],
2128
+ verticalAlignBottom: ["setCellVerticalAlign", "bottom"]
2129
+ };
2130
+ function C(e) {
2131
+ if (e === "tableProperties") return;
2132
+ let t = S[e];
2133
+ t ? g(...t) : g(e);
2134
+ }
2135
+ function w(e) {
2136
+ g("setCellMargins", e);
2137
+ }
2138
+ function T(e) {
2139
+ g("setCellTextDirection", e);
2140
+ }
2141
+ function E(e) {
2142
+ g("setRowHeight", e.height, e.rule);
2143
+ }
2144
+ return (t, n) => r.value ? (y(), c(i, { key: 0 }, [
2145
+ n[0] ||= l("span", { class: "divider" }, null, -1),
2146
+ d(Pt, { onChange: _ }),
2147
+ d(Ft, {
2148
+ theme: e.theme ?? null,
2149
+ onChange: v
2150
+ }, null, 8, ["theme"]),
2151
+ d(Bt, { onChange: b }),
2152
+ d(At, {
2153
+ theme: e.theme ?? null,
2154
+ onChange: x
2155
+ }, null, 8, ["theme"]),
2156
+ d(bn, {
2157
+ "can-split": o.value,
2158
+ "can-merge": u.value,
2159
+ "row-count": f.value,
2160
+ "column-count": p.value,
2161
+ "current-justification": m.value,
2162
+ onAction: C,
2163
+ onCellMargins: w,
2164
+ onCellTextDirection: T,
2165
+ onRowHeight: E
2166
+ }, null, 8, [
2167
+ "can-split",
2168
+ "can-merge",
2169
+ "row-count",
2170
+ "column-count",
2171
+ "current-justification"
2172
+ ])
2173
+ ], 64)) : s("", !0);
2174
+ }
2175
+ }), [["__scopeId", "data-v-b9fbce78"]]), Sn = /* @__PURE__ */ f({
2176
+ __name: "Avatar",
2177
+ props: {
2178
+ name: { default: "U" },
2179
+ size: { default: 32 }
2180
+ },
2181
+ setup(e) {
2182
+ let t = e, n = a(() => Y(t.name || "U")), r = a(() => ({
2183
+ width: t.size + "px",
2184
+ height: t.size + "px",
2185
+ borderRadius: "50%",
2186
+ backgroundColor: q(t.name || "U"),
2187
+ color: "#fff",
2188
+ display: "flex",
2189
+ alignItems: "center",
2190
+ justifyContent: "center",
2191
+ fontSize: t.size === 32 ? "13px" : "11px",
2192
+ fontWeight: 500,
2193
+ flexShrink: 0
2194
+ }));
2195
+ return (e, t) => (y(), c("div", {
2196
+ class: "docx-avatar",
2197
+ style: g(r.value)
2198
+ }, E(n.value), 5));
2199
+ }
2200
+ }), Cn = {
2201
+ key: 0,
2202
+ class: "reply-thread"
2203
+ }, wn = {
2204
+ key: 0,
2205
+ class: "reply-thread__more"
2206
+ }, Tn = { class: "reply-thread__header" }, En = { class: "reply-thread__author-block" }, Dn = { class: "reply-thread__author" }, On = { class: "reply-thread__date" }, kn = /* @__PURE__ */ n(/* @__PURE__ */ f({
2207
+ __name: "ReplyThread",
2208
+ props: {
2209
+ replies: {},
2210
+ isExpanded: { type: Boolean }
2211
+ },
2212
+ setup(e) {
2213
+ let t = e, n = a(() => t.isExpanded ? t.replies : t.replies.slice(-1)), r = a(() => t.isExpanded ? 0 : Math.max(0, t.replies.length - 1));
2214
+ return (t, a) => e.replies.length > 0 ? (y(), c("div", Cn, [r.value > 0 ? (y(), c("div", wn, E(r.value) + " " + E(r.value === 1 ? "reply" : "replies"), 1)) : s("", !0), (y(!0), c(i, null, C(n.value, (t) => (y(), c("div", {
2215
+ key: t.id,
2216
+ class: h(["reply-thread__item", { "reply-thread__item--expanded": e.isExpanded }])
2217
+ }, [l("div", Tn, [d(Sn, {
2218
+ name: t.author,
2219
+ size: 28
2220
+ }, null, 8, ["name"]), l("div", En, [l("div", Dn, E(t.author || "Unknown"), 1), l("div", On, E(D(K)(t.date)), 1)])]), l("div", { class: h(["reply-thread__body", { "reply-thread__body--clamp": !e.isExpanded }]) }, E(D(J)(t.content)), 3)], 2))), 128))])) : s("", !0);
2221
+ }
2222
+ }), [["__scopeId", "data-v-9634d553"]]), An = ["onKeydown"], jn = { class: "reply-input__actions" }, Mn = ["disabled"], Nn = /* @__PURE__ */ n(/* @__PURE__ */ f({
2223
+ __name: "ReplyInput",
2224
+ emits: ["submit"],
2225
+ setup(e, { emit: t }) {
2226
+ let n = t, r = S(!1), o = S(""), s = S(null), u = a(() => o.value.trim());
2227
+ function d() {
2228
+ r.value = !0, m(() => s.value?.focus({ preventScroll: !0 }));
2229
+ }
2230
+ function f() {
2231
+ r.value = !1, o.value = "";
2232
+ }
2233
+ function p() {
2234
+ let e = u.value;
2235
+ e && n("submit", e), o.value = "", r.value = !1;
2236
+ }
2237
+ return (e, t) => (y(), c("div", {
2238
+ onClick: t[4] ||= P(() => {}, ["stop"]),
2239
+ onMousedown: t[5] ||= P(() => {}, ["stop"]),
2240
+ class: "reply-input"
2241
+ }, [r.value ? (y(), c(i, { key: 1 }, [M(l("input", {
2242
+ ref_key: "inputRef",
2243
+ ref: s,
2244
+ "onUpdate:modelValue": t[1] ||= (e) => o.value = e,
2245
+ type: "text",
2246
+ placeholder: "Reply",
2247
+ class: "reply-input__field reply-input__field--active",
2248
+ onMousedown: t[2] ||= P(() => {}, ["stop"]),
2249
+ onKeydown: [
2250
+ t[3] ||= P(() => {}, ["stop"]),
2251
+ N(P(p, ["prevent"]), ["enter"]),
2252
+ N(f, ["esc"])
2253
+ ]
2254
+ }, null, 40, An), [[k, o.value]]), l("div", jn, [l("button", {
2255
+ class: "reply-input__cancel",
2256
+ onClick: P(f, ["stop"])
2257
+ }, "Cancel"), l("button", {
2258
+ class: h(["reply-input__submit", { "reply-input__submit--active": u.value }]),
2259
+ disabled: !u.value,
2260
+ onClick: P(p, ["stop"])
2261
+ }, "Reply", 10, Mn)])], 64)) : (y(), c("input", {
2262
+ key: 0,
2263
+ readonly: "",
2264
+ placeholder: "Reply",
2265
+ class: "reply-input__field reply-input__field--inactive",
2266
+ onMousedown: t[0] ||= P(() => {}, ["stop"]),
2267
+ onClick: P(d, ["stop"])
2268
+ }, null, 32))], 32));
2269
+ }
2270
+ }), [["__scopeId", "data-v-1cfd229c"]]), Pn = ["data-comment-id"], Fn = {
2271
+ key: 0,
2272
+ class: "comment-card__resolved"
2273
+ }, In = { class: "comment-card__head" }, Ln = { class: "comment-card__author-block" }, Rn = { class: "comment-card__author" }, zn = { class: "comment-card__date" }, Bn = {
2274
+ key: 0,
2275
+ class: "comment-card__actions"
2276
+ }, Vn = ["title"], Hn = { class: "comment-card__body" }, Un = /* @__PURE__ */ n(/* @__PURE__ */ f({
2277
+ __name: "CommentCard",
2278
+ props: {
2279
+ comment: {},
2280
+ replies: {},
2281
+ expanded: { type: Boolean }
2282
+ },
2283
+ emits: [
2284
+ "click",
2285
+ "reply",
2286
+ "resolve",
2287
+ "unresolve",
2288
+ "delete"
2289
+ ],
2290
+ setup(t, { emit: n }) {
2291
+ let r = t, i = n, a = S(!1);
2292
+ function u() {
2293
+ a.value = !1, i("delete", r.comment.id);
2294
+ }
2295
+ return (n, r) => (y(), c("div", {
2296
+ class: h(["comment-card", { "comment-card--expanded": t.expanded }]),
2297
+ "data-comment-id": t.comment.id,
2298
+ onClick: r[5] ||= (e) => n.$emit("click"),
2299
+ onMousedown: r[6] ||= P(() => {}, ["stop"])
2300
+ }, [
2301
+ t.comment.done ? (y(), c("div", Fn, [d(e, {
2302
+ name: "check",
2303
+ size: 12
2304
+ }), r[7] ||= l("span", null, "Resolved", -1)])) : s("", !0),
2305
+ l("div", In, [
2306
+ d(Sn, {
2307
+ name: t.comment.author,
2308
+ size: 32
2309
+ }, null, 8, ["name"]),
2310
+ l("div", Ln, [l("div", Rn, E(t.comment.author || "Unknown"), 1), l("div", zn, E(D(K)(t.comment.date)), 1)]),
2311
+ t.expanded ? (y(), c("div", Bn, [
2312
+ l("button", {
2313
+ class: "comment-card__icon-btn",
2314
+ title: t.comment.done ? "Reopen" : "Resolve",
2315
+ onClick: r[0] ||= P((e) => t.comment.done ? n.$emit("unresolve", t.comment.id) : n.$emit("resolve", t.comment.id), ["stop"])
2316
+ }, [d(e, {
2317
+ name: t.comment.done ? "undo" : "check",
2318
+ size: 20
2319
+ }, null, 8, ["name"])], 8, Vn),
2320
+ l("button", {
2321
+ class: "comment-card__icon-btn",
2322
+ title: "More options",
2323
+ onClick: r[1] ||= P((e) => a.value = !a.value, ["stop"])
2324
+ }, [d(e, {
2325
+ name: "more_vert",
2326
+ size: 20
2327
+ })]),
2328
+ a.value ? (y(), c("div", {
2329
+ key: 0,
2330
+ class: "comment-card__menu",
2331
+ onClick: r[2] ||= P(() => {}, ["stop"]),
2332
+ onMousedown: r[3] ||= P(() => {}, ["stop"])
2333
+ }, [l("button", {
2334
+ class: "comment-card__menu-item",
2335
+ onClick: u
2336
+ }, "Delete")], 32)) : s("", !0)
2337
+ ])) : s("", !0)
2338
+ ]),
2339
+ l("div", Hn, E(D(J)(t.comment.content)), 1),
2340
+ d(kn, {
2341
+ replies: t.replies,
2342
+ "is-expanded": t.expanded
2343
+ }, null, 8, ["replies", "is-expanded"]),
2344
+ t.expanded && !t.comment.done ? (y(), o(Nn, {
2345
+ key: 1,
2346
+ onSubmit: r[4] ||= (e) => n.$emit("reply", t.comment.id, e)
2347
+ })) : s("", !0)
2348
+ ], 42, Pn));
2349
+ }
2350
+ }), [["__scopeId", "data-v-fc5f60de"]]), Wn = ["data-comment-id"], Gn = /* @__PURE__ */ n(/* @__PURE__ */ f({
2351
+ __name: "ResolvedCommentMarker",
2352
+ props: { comment: {} },
2353
+ emits: ["toggle-expand"],
2354
+ setup(t) {
2355
+ return (n, r) => (y(), c("div", {
2356
+ class: "resolved-comment-marker",
2357
+ "data-comment-id": t.comment.id,
2358
+ "data-comment-resolved": "true",
2359
+ onClick: r[0] ||= (e) => n.$emit("toggle-expand"),
2360
+ onMousedown: r[1] ||= P(() => {}, ["stop"])
2361
+ }, [d(e, {
2362
+ name: "chat_bubble_check",
2363
+ size: 20
2364
+ })], 40, Wn));
2365
+ }
2366
+ }), [["__scopeId", "data-v-c4b9639d"]]), Kn = { class: "tc-card__head" }, qn = { class: "tc-card__author-block" }, Jn = { class: "tc-card__author" }, Yn = {
2367
+ key: 0,
2368
+ class: "tc-card__date"
2369
+ }, Xn = {
2370
+ key: 0,
2371
+ class: "tc-card__actions"
2372
+ }, Zn = ["title"], Qn = ["title"], $n = { class: "tc-card__body" }, er = { class: "tc-card__deleted" }, tr = { class: "tc-card__inserted" }, nr = { class: "tc-card__inserted" }, rr = { class: "tc-card__deleted" }, ir = { class: "tc-card__changed" }, ar = {
2373
+ key: 4,
2374
+ class: "tc-card__inserted"
2375
+ }, or = {
2376
+ key: 5,
2377
+ class: "tc-card__deleted"
2378
+ }, sr = {
2379
+ key: 6,
2380
+ class: "tc-card__inserted"
2381
+ }, cr = {
2382
+ key: 7,
2383
+ class: "tc-card__deleted"
2384
+ }, lr = {
2385
+ key: 8,
2386
+ class: "tc-card__changed"
2387
+ }, ur = {
2388
+ key: 9,
2389
+ class: "tc-card__changed"
2390
+ }, dr = {
2391
+ key: 10,
2392
+ class: "tc-card__changed"
2393
+ }, fr = {
2394
+ key: 11,
2395
+ class: "tc-card__changed"
2396
+ }, pr = {
2397
+ key: 12,
2398
+ class: "tc-card__inserted"
2399
+ }, mr = {
2400
+ key: 13,
2401
+ class: "tc-card__deleted"
2402
+ }, hr = /* @__PURE__ */ n(/* @__PURE__ */ f({
2403
+ __name: "TrackedChangeCard",
2404
+ props: {
2405
+ change: {},
2406
+ expanded: { type: Boolean },
2407
+ replies: {}
2408
+ },
2409
+ emits: [
2410
+ "click",
2411
+ "accept-by-id",
2412
+ "reject-by-id",
2413
+ "reply"
2414
+ ],
2415
+ setup(n, { emit: r }) {
2416
+ let { t: f } = t(), p = n, m = r, g = a(() => p.change.author || f("trackedChanges.unknown"));
2417
+ function _() {
2418
+ let e = new Set([p.change.revisionId]);
2419
+ p.change.type === "replacement" && p.change.insertionRevisionId != null && e.add(p.change.insertionRevisionId);
2420
+ for (let t of p.change.coalescedRevisionIds ?? []) e.add(t);
2421
+ return [...e];
2422
+ }
2423
+ function v() {
2424
+ for (let e of _()) m("accept-by-id", e);
2425
+ }
2426
+ function b() {
2427
+ for (let e of _()) m("reject-by-id", e);
2428
+ }
2429
+ return (t, r) => (y(), c("div", {
2430
+ class: h(["tc-card", { "tc-card--expanded": n.expanded }]),
2431
+ onClick: r[1] ||= (e) => t.$emit("click"),
2432
+ onMousedown: r[2] ||= P(() => {}, ["stop"])
2433
+ }, [
2434
+ l("div", Kn, [
2435
+ d(Sn, {
2436
+ name: g.value,
2437
+ size: 32
2438
+ }, null, 8, ["name"]),
2439
+ l("div", qn, [l("div", Jn, E(g.value), 1), n.change.date ? (y(), c("div", Yn, E(D(K)(n.change.date)), 1)) : s("", !0)]),
2440
+ n.expanded ? (y(), c("div", Xn, [l("button", {
2441
+ class: "tc-card__icon-btn",
2442
+ title: D(f)("common.accept"),
2443
+ onClick: P(v, ["stop"])
2444
+ }, [d(e, {
2445
+ name: "check",
2446
+ size: 20
2447
+ })], 8, Zn), l("button", {
2448
+ class: "tc-card__icon-btn",
2449
+ title: D(f)("common.reject"),
2450
+ onClick: P(b, ["stop"])
2451
+ }, [d(e, {
2452
+ name: "close",
2453
+ size: 20
2454
+ })], 8, Qn)])) : s("", !0)
2455
+ ]),
2456
+ l("div", $n, [n.change.type === "replacement" ? (y(), c(i, { key: 0 }, [
2457
+ u(E(D(f)("trackedChanges.replaced")) + " ", 1),
2458
+ l("span", er, "\"" + E(D(X)(n.change.deletedText || "")) + "\"", 1),
2459
+ u(" " + E(D(f)("trackedChanges.with")) + " ", 1),
2460
+ l("span", tr, "\"" + E(D(X)(n.change.text)) + "\"", 1)
2461
+ ], 64)) : n.change.type === "paragraphMarkInsertion" ? (y(), c(i, { key: 1 }, [u(E(D(f)("revisions.paragraphMarkInserted")), 1), n.change.text ? (y(), c(i, { key: 0 }, [r[3] ||= u(": ", -1), l("span", nr, "\"" + E(D(X)(n.change.text)) + "\"", 1)], 64)) : s("", !0)], 64)) : n.change.type === "paragraphMarkDeletion" ? (y(), c(i, { key: 2 }, [u(E(D(f)("revisions.paragraphMarkDeleted")), 1), n.change.text ? (y(), c(i, { key: 0 }, [r[4] ||= u(": ", -1), l("span", rr, "\"" + E(D(X)(n.change.text)) + "\"", 1)], 64)) : s("", !0)], 64)) : n.change.type === "paragraphPropertiesChanged" ? (y(), c(i, { key: 3 }, [u(E(D(f)("revisions.paragraphPropertiesChanged")), 1), n.change.text ? (y(), c(i, { key: 0 }, [r[5] ||= u(": ", -1), l("span", ir, "\"" + E(D(X)(n.change.text)) + "\"", 1)], 64)) : s("", !0)], 64)) : n.change.type === "rowInserted" ? (y(), c("span", ar, E(D(f)("revisions.rowInserted")), 1)) : n.change.type === "rowDeleted" ? (y(), c("span", or, E(D(f)("revisions.rowDeleted")), 1)) : n.change.type === "cellInserted" ? (y(), c("span", sr, E(D(f)("revisions.cellInserted")), 1)) : n.change.type === "cellDeleted" ? (y(), c("span", cr, E(D(f)("revisions.cellDeleted")), 1)) : n.change.type === "cellMerged" ? (y(), c("span", lr, E(D(f)("revisions.cellMerged")), 1)) : n.change.type === "rowPropertiesChanged" ? (y(), c("span", ur, E(D(f)("revisions.rowPropertiesChanged")), 1)) : n.change.type === "cellPropertiesChanged" ? (y(), c("span", dr, E(D(f)("revisions.cellPropertiesChanged")), 1)) : n.change.type === "tablePropertiesChanged" ? (y(), c("span", fr, E(D(f)("revisions.tablePropertiesChanged")), 1)) : n.change.type === "tableInserted" ? (y(), c("span", pr, E(D(f)("revisions.tableInserted")), 1)) : n.change.type === "tableDeleted" ? (y(), c("span", mr, E(D(f)("revisions.tableDeleted")), 1)) : (y(), c(i, { key: 14 }, [u(E(n.change.type === "insertion" ? D(f)("trackedChanges.added") : D(f)("trackedChanges.deleted")) + " ", 1), l("span", { class: h(n.change.type === "insertion" ? "tc-card__inserted" : "tc-card__deleted") }, " \"" + E(D(X)(n.change.text)) + "\" ", 3)], 64))]),
2462
+ d(kn, {
2463
+ replies: n.replies,
2464
+ "is-expanded": n.expanded
2465
+ }, null, 8, ["replies", "is-expanded"]),
2466
+ n.expanded ? (y(), o(Nn, {
2467
+ key: 0,
2468
+ onSubmit: r[0] ||= (e) => t.$emit("reply", n.change.revisionId, e)
2469
+ })) : s("", !0)
2470
+ ], 34));
2471
+ }
2472
+ }), [["__scopeId", "data-v-aba5ffb2"]]), gr = ["onKeydown"], _r = { class: "add-comment-card__actions" }, vr = ["disabled"], yr = /* @__PURE__ */ n(/* @__PURE__ */ f({
2473
+ __name: "AddCommentCard",
2474
+ emits: ["submit", "cancel"],
2475
+ setup(e, { emit: t }) {
2476
+ let n = t, r = S(""), i = S(null), o = a(() => r.value.trim());
2477
+ v(() => {
2478
+ i.value?.focus({ preventScroll: !0 });
2479
+ });
2480
+ function s() {
2481
+ o.value && (n("submit", o.value), r.value = "");
2482
+ }
2483
+ function u() {
2484
+ n("cancel"), r.value = "";
2485
+ }
2486
+ return (e, t) => (y(), c("div", {
2487
+ class: "add-comment-card",
2488
+ onMousedown: t[3] ||= P(() => {}, ["stop"])
2489
+ }, [M(l("textarea", {
2490
+ ref_key: "inputRef",
2491
+ ref: i,
2492
+ "onUpdate:modelValue": t[0] ||= (e) => r.value = e,
2493
+ class: "add-comment-card__field",
2494
+ placeholder: "Add a comment",
2495
+ onMousedown: t[1] ||= P(() => {}, ["stop"]),
2496
+ onKeydown: [
2497
+ t[2] ||= P(() => {}, ["stop"]),
2498
+ N(P(s, ["exact", "prevent"]), ["enter"]),
2499
+ N(u, ["esc"])
2500
+ ]
2501
+ }, null, 40, gr), [[k, r.value]]), l("div", _r, [l("button", {
2502
+ class: "add-comment-card__cancel",
2503
+ onClick: u
2504
+ }, "Cancel"), l("button", {
2505
+ class: h(["add-comment-card__submit", { "add-comment-card__submit--active": o.value }]),
2506
+ disabled: !o.value,
2507
+ onClick: s
2508
+ }, "Comment", 10, vr)])], 32));
2509
+ }
2510
+ }), [["__scopeId", "data-v-ddb8719d"]]), br = ne, xr = ["data-card-id"], Sr = 16, Cr = /* @__PURE__ */ n(/* @__PURE__ */ f({
2511
+ __name: "UnifiedSidebar",
2512
+ props: {
2513
+ isOpen: { type: Boolean },
2514
+ comments: {},
2515
+ trackedChanges: {},
2516
+ isAddingComment: { type: Boolean },
2517
+ showResolved: { type: Boolean },
2518
+ pagesContainer: {},
2519
+ pageWidthPx: {},
2520
+ zoom: {},
2521
+ activeItemId: {},
2522
+ addCommentYPosition: {}
2523
+ },
2524
+ emits: [
2525
+ "close",
2526
+ "add-comment",
2527
+ "cancel-add-comment",
2528
+ "comment-reply",
2529
+ "comment-resolve",
2530
+ "comment-unresolve",
2531
+ "comment-delete",
2532
+ "accept-change",
2533
+ "reject-change",
2534
+ "accept-change-by-id",
2535
+ "reject-change-by-id",
2536
+ "tracked-change-reply",
2537
+ "update:activeItemId"
2538
+ ],
2539
+ setup(e, { emit: t }) {
2540
+ let n = e, d = t, f = S(null), p = a(() => n.activeItemId === void 0 ? f.value : n.activeItemId);
2541
+ function m(e) {
2542
+ let t = p.value === e ? null : e;
2543
+ f.value = t, d("update:activeItemId", t);
2544
+ }
2545
+ function h(e) {
2546
+ e.stopPropagation(), !e.target.closest(".unified-sidebar__card-slot") && p.value !== null && (f.value = null, d("update:activeItemId", null));
2547
+ }
2548
+ let b = r({
2549
+ comments: a(() => n.comments),
2550
+ trackedChanges: a(() => n.trackedChanges),
2551
+ showResolved: a(() => n.showResolved ?? !1),
2552
+ isAddingComment: a(() => n.isAddingComment ?? !1),
2553
+ addCommentYPosition: a(() => n.addCommentYPosition ?? null)
2554
+ }), x = S(null), w = S(/* @__PURE__ */ new Map()), O = /* @__PURE__ */ new Map(), k = null, M = null, N = /* @__PURE__ */ new Set();
2555
+ function P() {
2556
+ let e = x.value;
2557
+ if (!e || !M) return;
2558
+ let t = new Set(e.querySelectorAll("[data-card-id]"));
2559
+ if (!(t.size === N.size && [...t].every((e) => N.has(e)))) {
2560
+ M.disconnect();
2561
+ for (let e of t) M.observe(e);
2562
+ N = t;
2563
+ }
2564
+ }
2565
+ function F() {
2566
+ let e = n.pagesContainer, t = b.value;
2567
+ if (!e || t.length === 0) {
2568
+ w.value = /* @__PURE__ */ new Map();
2569
+ return;
2570
+ }
2571
+ let r = e.getBoundingClientRect(), i = /* @__PURE__ */ new Map();
2572
+ for (let t of e.querySelectorAll("[data-comment-id]")) {
2573
+ let e = t.dataset.commentId;
2574
+ e && !i.has(e) && i.set(e, t);
2575
+ }
2576
+ let a = /* @__PURE__ */ new Map();
2577
+ for (let t of e.querySelectorAll(".docx-insertion[data-revision-id]")) {
2578
+ let e = t.dataset.revisionId;
2579
+ e && !a.has(e) && a.set(e, t);
2580
+ }
2581
+ let o = /* @__PURE__ */ new Map();
2582
+ for (let t of e.querySelectorAll(".docx-deletion[data-revision-id]")) {
2583
+ let e = t.dataset.revisionId;
2584
+ e && !o.has(e) && o.set(e, t);
2585
+ }
2586
+ for (let t of e.querySelectorAll(".ep-revision-table[data-revision-id], .ep-revision-row[data-revision-id], .ep-revision-cell[data-revision-id], .layout-revision-pmark[data-revision-id]")) {
2587
+ let e = t.dataset.revisionId;
2588
+ if (!e) continue;
2589
+ let n = t.classList.contains("ep-revision-ins") || t.classList.contains("layout-revision-ins") ? a : o;
2590
+ n.has(e) || n.set(e, t);
2591
+ }
2592
+ let s = /* @__PURE__ */ new Map(), c = (t) => t.getBoundingClientRect().top - r.top + e.scrollTop;
2593
+ for (let e of t) {
2594
+ if (!e.anchorKey) continue;
2595
+ let t;
2596
+ if (e.kind === "comment") t = i.get(String(e.comment.id));
2597
+ else if (e.kind === "tracked-change") {
2598
+ let n = e.change;
2599
+ t = n.type === "deletion" ? o.get(String(n.revisionId)) : a.get(String(n.insertionRevisionId ?? n.revisionId));
2600
+ }
2601
+ t && s.set(e.anchorKey, c(t));
2602
+ }
2603
+ let l = /* @__PURE__ */ new Map(), u = x.value;
2604
+ if (u) for (let e of u.querySelectorAll("[data-card-id]")) {
2605
+ let t = e.dataset.cardId;
2606
+ t && l.set(t, e.offsetHeight);
2607
+ }
2608
+ let d = /* @__PURE__ */ new Map();
2609
+ for (let { item: e, y: n } of br(t, s, null, 1, l, O)) d.set(e.id, n);
2610
+ w.value = d, P();
2611
+ }
2612
+ let ee = a(() => {
2613
+ let e = 0;
2614
+ for (let t of w.value.values()) e = Math.max(e, t);
2615
+ return e + 200;
2616
+ }), I = a(() => {
2617
+ let e = p.value;
2618
+ if (!e) return "";
2619
+ if (e.startsWith("comment-")) return `.paged-editor__pages [data-comment-id="${e.slice(8)}"] { background-color: rgba(255, 212, 0, 0.35) !important; border-bottom: 2px solid rgba(255, 212, 0, 0.7) !important; }`;
2620
+ if (e.startsWith("tc-")) {
2621
+ let t = e.split("-")[1];
2622
+ return `
2623
+ .paged-editor__pages .docx-insertion[data-revision-id="${b.value.find((t) => t.id === e)?.change?.insertionRevisionId ?? Number(t)}"] { background-color: rgba(52, 168, 83, 0.2) !important; border-bottom: 2px solid #2e7d32 !important; }
2624
+ .paged-editor__pages .docx-deletion[data-revision-id="${t}"] { background-color: rgba(211, 47, 47, 0.2) !important; text-decoration-thickness: 2px !important; }
2625
+ `;
2626
+ }
2627
+ return "";
2628
+ }), L = a(() => {
2629
+ let e = n.pageWidthPx / 2 + Sr - re, t = w.value.size > 0 || b.value.length === 0;
2630
+ return {
2631
+ position: "absolute",
2632
+ top: "0",
2633
+ left: `calc(50% + ${e}px)`,
2634
+ width: ie + "px",
2635
+ opacity: +!!t
2636
+ };
2637
+ });
2638
+ function R(e) {
2639
+ let t = w.value.get(e);
2640
+ return t == null ? {
2641
+ position: "static",
2642
+ marginBottom: "8px"
2643
+ } : {
2644
+ position: "absolute",
2645
+ top: t + "px",
2646
+ left: 0,
2647
+ right: 0,
2648
+ transition: "top 0.15s ease"
2649
+ };
2650
+ }
2651
+ let z = !1;
2652
+ function B() {
2653
+ z || (z = !0, requestAnimationFrame(() => {
2654
+ z = !1, F();
2655
+ }));
2656
+ }
2657
+ A(() => [
2658
+ b.value,
2659
+ p.value,
2660
+ n.pagesContainer,
2661
+ n.pageWidthPx,
2662
+ n.zoom,
2663
+ n.isAddingComment,
2664
+ n.addCommentYPosition
2665
+ ], () => B(), { immediate: !0 });
2666
+ function te(e) {
2667
+ let t = e?.parentElement ?? null;
2668
+ for (; t;) {
2669
+ let e = getComputedStyle(t).overflowY;
2670
+ if (e === "auto" || e === "scroll") return t;
2671
+ t = t.parentElement;
2672
+ }
2673
+ return null;
2674
+ }
2675
+ let V = null;
2676
+ function H() {
2677
+ V && V.removeEventListener("scroll", B), V = te(n.pagesContainer), V && V.addEventListener("scroll", B, { passive: !0 });
2678
+ }
2679
+ return v(() => {
2680
+ M = new ResizeObserver(() => B()), B(), n.pagesContainer && (k = new ResizeObserver(() => B()), k.observe(n.pagesContainer), H());
2681
+ }), A(() => n.pagesContainer, (e) => {
2682
+ k?.disconnect(), k = null, e && (k = new ResizeObserver(() => B()), k.observe(e), H());
2683
+ }), _(() => {
2684
+ k?.disconnect(), M?.disconnect(), V && V.removeEventListener("scroll", B);
2685
+ }), (t, n) => (y(), c(i, null, [I.value ? (y(), o(T("style"), { key: 0 }, {
2686
+ default: j(() => [u(E(I.value), 1)]),
2687
+ _: 1
2688
+ })) : s("", !0), e.isOpen ? (y(), c("aside", {
2689
+ key: 1,
2690
+ ref_key: "rootRef",
2691
+ ref: x,
2692
+ class: "unified-sidebar",
2693
+ style: g(L.value),
2694
+ onMousedown: h
2695
+ }, [l("div", {
2696
+ class: "unified-sidebar__inner",
2697
+ style: g({ minHeight: ee.value + "px" })
2698
+ }, [(y(!0), c(i, null, C(D(b), (e) => (y(), c("div", {
2699
+ key: e.id,
2700
+ class: "unified-sidebar__card-slot",
2701
+ "data-card-id": e.id,
2702
+ style: g(R(e.id))
2703
+ }, [e.kind === "add-comment" ? (y(), o(yr, {
2704
+ key: 0,
2705
+ onSubmit: n[0] ||= (e) => t.$emit("add-comment", e),
2706
+ onCancel: n[1] ||= (e) => t.$emit("cancel-add-comment")
2707
+ })) : e.kind === "comment" && e.comment.done && p.value !== e.id ? (y(), o(Gn, {
2708
+ key: 1,
2709
+ comment: e.comment,
2710
+ onToggleExpand: (t) => m(e.id)
2711
+ }, null, 8, ["comment", "onToggleExpand"])) : e.kind === "comment" ? (y(), o(Un, {
2712
+ key: 2,
2713
+ comment: e.comment,
2714
+ replies: e.replies,
2715
+ expanded: p.value === e.id,
2716
+ onClick: (t) => m(e.id),
2717
+ onReply: n[2] ||= (e, n) => t.$emit("comment-reply", e, n),
2718
+ onResolve: n[3] ||= (e) => t.$emit("comment-resolve", e),
2719
+ onUnresolve: n[4] ||= (e) => t.$emit("comment-unresolve", e),
2720
+ onDelete: n[5] ||= (e) => t.$emit("comment-delete", e)
2721
+ }, null, 8, [
2722
+ "comment",
2723
+ "replies",
2724
+ "expanded",
2725
+ "onClick"
2726
+ ])) : e.kind === "tracked-change" ? (y(), o(hr, {
2727
+ key: 3,
2728
+ change: e.change,
2729
+ replies: e.replies ?? [],
2730
+ expanded: p.value === e.id,
2731
+ onClick: (t) => m(e.id),
2732
+ onAccept: n[6] ||= (e, n) => t.$emit("accept-change", e, n),
2733
+ onReject: n[7] ||= (e, n) => t.$emit("reject-change", e, n),
2734
+ onAcceptById: n[8] ||= (e) => t.$emit("accept-change-by-id", e),
2735
+ onRejectById: n[9] ||= (e) => t.$emit("reject-change-by-id", e),
2736
+ onReply: n[10] ||= (e, n) => t.$emit("tracked-change-reply", e, n)
2737
+ }, null, 8, [
2738
+ "change",
2739
+ "replies",
2740
+ "expanded",
2741
+ "onClick"
2742
+ ])) : s("", !0)], 12, xr))), 128))], 4)], 36)) : s("", !0)], 64));
2743
+ }
2744
+ }), [["__scopeId", "data-v-d8ea5591"]]), wr = ["title", "onClick"], Tr = /* @__PURE__ */ n(/* @__PURE__ */ f({
2745
+ __name: "CommentMarginMarkers",
2746
+ props: {
2747
+ comments: {},
2748
+ pagesContainer: {},
2749
+ zoom: {},
2750
+ pageWidthPx: {},
2751
+ sidebarOpen: { type: Boolean },
2752
+ resolvedCommentIds: {}
2753
+ },
2754
+ emits: ["marker-click"],
2755
+ setup(t) {
2756
+ let n = t, r = a(() => {
2757
+ if (n.sidebarOpen) return [];
2758
+ let e = n.pagesContainer;
2759
+ if (!e) return [];
2760
+ let t = e.getBoundingClientRect(), r = /* @__PURE__ */ new Map();
2761
+ for (let t of e.querySelectorAll("[data-comment-id]")) {
2762
+ let e = t.dataset.commentId;
2763
+ e && !r.has(e) && r.set(e, t);
2764
+ }
2765
+ let i = [];
2766
+ for (let a of n.comments) {
2767
+ if (a.parentId != null) continue;
2768
+ let o = r.get(String(a.id));
2769
+ if (!o) continue;
2770
+ let s = o.getBoundingClientRect();
2771
+ i.push({
2772
+ comment: a,
2773
+ isResolved: n.resolvedCommentIds.has(a.id),
2774
+ y: (s.top - t.top + e.scrollTop) / n.zoom
2775
+ });
2776
+ }
2777
+ return i;
2778
+ }), o = a(() => ({
2779
+ position: "absolute",
2780
+ top: 0,
2781
+ left: `calc(50% + ${n.pageWidthPx / n.zoom / 2 + 6}px)`,
2782
+ zIndex: 30,
2783
+ pointerEvents: "none"
2784
+ }));
2785
+ return (n, a) => r.value.length > 0 ? (y(), c("div", {
2786
+ key: 0,
2787
+ class: "docx-comment-margin-markers",
2788
+ style: g(o.value),
2789
+ onMousedown: a[0] ||= P(() => {}, ["stop"])
2790
+ }, [(y(!0), c(i, null, C(r.value, (r) => (y(), c("button", {
2791
+ key: r.comment.id,
2792
+ class: "docx-comment-margin-markers__btn",
2793
+ title: r.isResolved ? "Resolved comment" : "Comment",
2794
+ style: g({ top: r.y * t.zoom + "px" }),
2795
+ onClick: (e) => n.$emit("marker-click", r.comment.id)
2796
+ }, [d(e, {
2797
+ name: r.isResolved ? "chat_bubble_check" : "chat_bubble_outline",
2798
+ size: 18
2799
+ }, null, 8, ["name"])], 12, wr))), 128))], 36)) : s("", !0);
2800
+ }
2801
+ }), [["__scopeId", "data-v-b6c7e425"]]), Er = ["aria-valuemax"], Dr = { class: "docx-horizontal-ruler__ticks" }, Or = ["title", "onDblclick"], kr = 12240, Ar = 1440, jr = 1440, Mr = 567, Nr = 22, Pr = "var(--doc-primary)", Fr = "var(--doc-primary)", Ir = "var(--doc-primary-hover)", Lr = 5, Rr = /* @__PURE__ */ n(/* @__PURE__ */ f({
2802
+ __name: "HorizontalRuler",
2803
+ props: {
2804
+ sectionProps: {},
2805
+ zoom: { default: 1 },
2806
+ editable: {
2807
+ type: Boolean,
2808
+ default: !0
2809
+ },
2810
+ showFirstLineIndent: {
2811
+ type: Boolean,
2812
+ default: !1
2813
+ },
2814
+ firstLineIndent: { default: 0 },
2815
+ hangingIndent: {
2816
+ type: Boolean,
2817
+ default: !1
2818
+ },
2819
+ indentLeft: { default: 0 },
2820
+ indentRight: { default: 0 },
2821
+ unit: { default: "inch" },
2822
+ tabStops: {}
2823
+ },
2824
+ emits: [
2825
+ "left-margin-change",
2826
+ "right-margin-change",
2827
+ "first-line-indent-change",
2828
+ "indent-left-change",
2829
+ "indent-right-change",
2830
+ "tab-stop-remove"
2831
+ ],
2832
+ setup(e, { emit: t }) {
2833
+ let n = e, r = t, o = Math.round(Lr * 1.6), u = S(null), d = S(null), f = S(null), p = S(0), m = S("");
2834
+ function h(e) {
2835
+ return oe(e) * n.zoom;
2836
+ }
2837
+ function v(e) {
2838
+ return Math.round(ae(e / n.zoom));
2839
+ }
2840
+ let b = a(() => n.sectionProps?.pageWidth ?? kr), x = a(() => n.sectionProps?.marginLeft ?? Ar), w = a(() => n.sectionProps?.marginRight ?? Ar), T = a(() => b.value - x.value - w.value), D = a(() => h(b.value)), O = a(() => h(x.value)), k = a(() => h(w.value)), A = a(() => h(n.indentLeft)), j = a(() => h(n.indentRight)), M = a(() => n.hangingIndent ? -n.firstLineIndent : n.firstLineIndent), N = a(() => h(M.value)), F = a(() => O.value + A.value), ee = a(() => D.value - k.value - j.value), I = a(() => O.value + A.value + N.value), L = a(() => ({
2841
+ position: "relative",
2842
+ width: D.value + "px",
2843
+ height: Nr + "px",
2844
+ backgroundColor: "transparent",
2845
+ overflow: "visible",
2846
+ userSelect: "none",
2847
+ cursor: d.value ? "ew-resize" : "default"
2848
+ })), R = a(() => ({
2849
+ position: "absolute",
2850
+ top: 0,
2851
+ left: 0,
2852
+ width: O.value + "px",
2853
+ height: Nr + "px",
2854
+ backgroundColor: "var(--doc-shadow-subtle)",
2855
+ borderRight: "1px solid var(--doc-shadow-subtle)",
2856
+ cursor: n.editable ? "ew-resize" : "default",
2857
+ zIndex: 1
2858
+ })), z = a(() => ({
2859
+ position: "absolute",
2860
+ top: 0,
2861
+ right: 0,
2862
+ width: k.value + "px",
2863
+ height: Nr + "px",
2864
+ backgroundColor: "var(--doc-shadow-subtle)",
2865
+ borderLeft: "1px solid var(--doc-shadow-subtle)",
2866
+ cursor: n.editable ? "ew-resize" : "default",
2867
+ zIndex: 1
2868
+ })), B = a(() => {
2869
+ let e = [];
2870
+ if (n.unit === "inch") {
2871
+ let t = jr / 8, n = Math.ceil(b.value / t);
2872
+ for (let r = 0; r <= n; r++) {
2873
+ let n = r * t;
2874
+ if (n > b.value) break;
2875
+ let i = h(n);
2876
+ r % 8 == 0 ? e.push({
2877
+ position: i,
2878
+ height: 10,
2879
+ label: r / 8 > 0 ? String(r / 8) : void 0
2880
+ }) : r % 4 == 0 ? e.push({
2881
+ position: i,
2882
+ height: 6
2883
+ }) : r % 2 == 0 ? e.push({
2884
+ position: i,
2885
+ height: 4
2886
+ }) : e.push({
2887
+ position: i,
2888
+ height: 2
2889
+ });
2890
+ }
2891
+ } else {
2892
+ let t = Mr / 10, n = Math.ceil(b.value / t);
2893
+ for (let r = 0; r <= n; r++) {
2894
+ let n = r * t;
2895
+ if (n > b.value) break;
2896
+ let i = h(n);
2897
+ r % 10 == 0 ? e.push({
2898
+ position: i,
2899
+ height: 10,
2900
+ label: r / 10 > 0 ? String(r / 10) : void 0
2901
+ }) : r % 5 == 0 ? e.push({
2902
+ position: i,
2903
+ height: 6
2904
+ }) : e.push({
2905
+ position: i,
2906
+ height: 3
2907
+ });
2908
+ }
2909
+ }
2910
+ return e;
2911
+ }), te = a(() => n.tabStops?.length ? n.tabStops.map((e) => {
2912
+ let t = e.position ?? e.pos ?? 0;
2913
+ return {
2914
+ px: h(t),
2915
+ twips: t,
2916
+ label: V(t)
2917
+ };
2918
+ }) : []);
2919
+ function V(e) {
2920
+ return n.unit === "cm" ? (e / Mr).toFixed(1) + " cm" : (e / jr).toFixed(2) + "\"";
2921
+ }
2922
+ function H(e) {
2923
+ return d.value === e ? Ir : f.value === e ? Fr : Pr;
2924
+ }
2925
+ function U(e, t, r) {
2926
+ return {
2927
+ position: "absolute",
2928
+ left: t - Lr + "px",
2929
+ width: Lr * 2 + "px",
2930
+ height: o + 2 + "px",
2931
+ cursor: n.editable ? "ew-resize" : "default",
2932
+ zIndex: r ? 10 : 4,
2933
+ ...e === "down" ? { top: 0 } : { bottom: 0 }
2934
+ };
2935
+ }
2936
+ function W(e, t) {
2937
+ return e === "down" ? {
2938
+ position: "absolute",
2939
+ top: "1px",
2940
+ left: 0,
2941
+ width: 0,
2942
+ height: 0,
2943
+ borderLeft: `${Lr}px solid transparent`,
2944
+ borderRight: `${Lr}px solid transparent`,
2945
+ borderTop: `${o}px solid ${t}`,
2946
+ transition: "border-top-color 0.1s"
2947
+ } : {
2948
+ position: "absolute",
2949
+ bottom: "1px",
2950
+ left: 0,
2951
+ width: 0,
2952
+ height: 0,
2953
+ borderLeft: `${Lr}px solid transparent`,
2954
+ borderRight: `${Lr}px solid transparent`,
2955
+ borderBottom: `${o}px solid ${t}`,
2956
+ transition: "border-bottom-color 0.1s"
2957
+ };
2958
+ }
2959
+ let G = 0;
2960
+ function K(e, t) {
2961
+ n.editable && (d.value = e, t.clientX, e === "leftMargin" ? G = x.value : e === "rightMargin" ? G = w.value : e === "leftIndent" ? G = n.indentLeft : e === "rightIndent" ? G = n.indentRight : e === "firstLineIndent" && (G = n.firstLineIndent), p.value = t.clientX - (u.value?.getBoundingClientRect().left ?? 0), m.value = V(G), document.addEventListener("mousemove", q), document.addEventListener("mouseup", J));
2962
+ }
2963
+ function q(e) {
2964
+ if (!d.value || !u.value) return;
2965
+ let t = u.value.getBoundingClientRect();
2966
+ if (!t) return;
2967
+ let n = e.clientX - t.left;
2968
+ p.value = n;
2969
+ let r = v(n), i = Y(d.value, r);
2970
+ m.value = V(i), X(d.value, i);
2971
+ }
2972
+ function J(e) {
2973
+ d.value = null, document.removeEventListener("mousemove", q), document.removeEventListener("mouseup", J);
2974
+ }
2975
+ function Y(e, t) {
2976
+ if (e === "leftMargin") {
2977
+ let e = b.value - w.value - 720;
2978
+ return Math.round(Math.max(0, Math.min(t, e)));
2979
+ }
2980
+ if (e === "rightMargin") {
2981
+ let e = b.value - t, n = b.value - x.value - 720;
2982
+ return Math.round(Math.max(0, Math.min(e, n)));
2983
+ }
2984
+ if (e === "firstLineIndent") {
2985
+ let e = t - (x.value + n.indentLeft), r = T.value - n.indentLeft - n.indentRight - 720;
2986
+ return Math.round(Math.max(-n.indentLeft, Math.min(e, r)));
2987
+ }
2988
+ if (e === "leftIndent") {
2989
+ let e = t - x.value, r = T.value - n.indentRight - 720;
2990
+ return Math.round(Math.max(0, Math.min(e, r)));
2991
+ }
2992
+ let r = b.value - w.value - t, i = T.value - n.indentLeft - 720;
2993
+ return Math.round(Math.max(0, Math.min(r, i)));
2994
+ }
2995
+ function X(e, t) {
2996
+ switch (e) {
2997
+ case "leftMargin":
2998
+ r("left-margin-change", t);
2999
+ break;
3000
+ case "rightMargin":
3001
+ r("right-margin-change", t);
3002
+ break;
3003
+ case "firstLineIndent":
3004
+ r("first-line-indent-change", t);
3005
+ break;
3006
+ case "leftIndent":
3007
+ r("indent-left-change", t);
3008
+ break;
3009
+ case "rightIndent":
3010
+ r("indent-right-change", t);
3011
+ break;
3012
+ }
3013
+ }
3014
+ return _(() => {
3015
+ document.removeEventListener("mousemove", q), document.removeEventListener("mouseup", J);
3016
+ }), (t, n) => (y(), c("div", {
3017
+ ref_key: "rulerRef",
3018
+ ref: u,
3019
+ class: "docx-horizontal-ruler",
3020
+ style: g(L.value),
3021
+ role: "slider",
3022
+ "aria-label": "Horizontal ruler",
3023
+ "aria-valuemin": 0,
3024
+ "aria-valuemax": b.value
3025
+ }, [
3026
+ l("div", {
3027
+ class: "docx-horizontal-ruler__margin",
3028
+ style: g(R.value),
3029
+ onMousedown: n[0] ||= P((t) => e.editable ? K("leftMargin", t) : null, ["prevent", "stop"])
3030
+ }, null, 36),
3031
+ l("div", {
3032
+ class: "docx-horizontal-ruler__margin",
3033
+ style: g(z.value),
3034
+ onMousedown: n[1] ||= P((t) => e.editable ? K("rightMargin", t) : null, ["prevent", "stop"])
3035
+ }, null, 36),
3036
+ l("div", Dr, [(y(!0), c(i, null, C(B.value, (e, t) => (y(), c(i, { key: t }, [l("div", {
3037
+ class: "docx-horizontal-ruler__tick-line",
3038
+ style: g({
3039
+ left: e.position + "px",
3040
+ height: e.height + "px"
3041
+ })
3042
+ }, null, 4), e.label ? (y(), c("div", {
3043
+ key: 0,
3044
+ class: "docx-horizontal-ruler__tick-label",
3045
+ style: g({ left: e.position + "px" })
3046
+ }, E(e.label), 5)) : s("", !0)], 64))), 128))]),
3047
+ e.showFirstLineIndent ? (y(), c("div", {
3048
+ key: 0,
3049
+ class: "docx-ruler-indent",
3050
+ style: g(U("down", I.value, d.value === "firstLineIndent")),
3051
+ onMousedown: n[2] ||= P((t) => e.editable ? K("firstLineIndent", t) : null, ["prevent", "stop"]),
3052
+ onMouseenter: n[3] ||= (e) => f.value = "firstLineIndent",
3053
+ onMouseleave: n[4] ||= (e) => f.value = null
3054
+ }, [l("div", { style: g(W("down", H("firstLineIndent"))) }, null, 4)], 36)) : s("", !0),
3055
+ e.editable ? (y(), c("div", {
3056
+ key: 1,
3057
+ class: "docx-ruler-indent",
3058
+ style: g(U("up", F.value, d.value === "leftIndent")),
3059
+ onMousedown: n[5] ||= P((e) => K("leftIndent", e), ["prevent", "stop"]),
3060
+ onMouseenter: n[6] ||= (e) => f.value = "leftIndent",
3061
+ onMouseleave: n[7] ||= (e) => f.value = null
3062
+ }, [l("div", { style: g(W("up", H("leftIndent"))) }, null, 4)], 36)) : s("", !0),
3063
+ e.editable ? (y(), c("div", {
3064
+ key: 2,
3065
+ class: "docx-ruler-indent",
3066
+ style: g(U("down", ee.value, d.value === "rightIndent")),
3067
+ onMousedown: n[8] ||= P((e) => K("rightIndent", e), ["prevent", "stop"]),
3068
+ onMouseenter: n[9] ||= (e) => f.value = "rightIndent",
3069
+ onMouseleave: n[10] ||= (e) => f.value = null
3070
+ }, [l("div", { style: g(W("down", H("rightIndent"))) }, null, 4)], 36)) : s("", !0),
3071
+ (y(!0), c(i, null, C(te.value, (e, n) => (y(), c("div", {
3072
+ key: n,
3073
+ class: "docx-horizontal-ruler__tab",
3074
+ style: g({ left: e.px + "px" }),
3075
+ title: `${e.label}`,
3076
+ onDblclick: P((n) => t.$emit("tab-stop-remove", e.twips), ["prevent"])
3077
+ }, "L", 44, Or))), 128)),
3078
+ d.value && m.value ? (y(), c("div", {
3079
+ key: 3,
3080
+ class: "docx-horizontal-ruler__tooltip",
3081
+ style: g({ left: p.value + "px" })
3082
+ }, E(m.value), 5)) : s("", !0)
3083
+ ], 12, Er));
3084
+ }
3085
+ }), [["__scopeId", "data-v-e917c826"]]), zr = { class: "docx-vertical-ruler__ticks" }, Br = 15840, Vr = 1440, Hr = 1440, Ur = 567, Wr = 20, Gr = /* @__PURE__ */ n(/* @__PURE__ */ f({
3086
+ __name: "VerticalRuler",
3087
+ props: {
3088
+ sectionProps: {},
3089
+ zoom: { default: 1 },
3090
+ editable: {
3091
+ type: Boolean,
3092
+ default: !0
3093
+ },
3094
+ unit: { default: "inch" }
3095
+ },
3096
+ emits: ["top-margin-change", "bottom-margin-change"],
3097
+ setup(e, { emit: t }) {
3098
+ let n = e, r = t, o = S(null), u = S(null), d = S(null);
3099
+ function f(e) {
3100
+ return oe(e) * n.zoom;
3101
+ }
3102
+ function p(e) {
3103
+ return Math.round(ae(e / n.zoom));
3104
+ }
3105
+ let m = a(() => n.sectionProps?.pageHeight ?? Br), h = a(() => n.sectionProps?.marginTop ?? Vr), v = a(() => n.sectionProps?.marginBottom ?? Vr), b = a(() => f(m.value)), x = a(() => f(h.value)), w = a(() => f(v.value)), T = a(() => ({
3106
+ position: "relative",
3107
+ width: Wr + "px",
3108
+ height: b.value + "px",
3109
+ backgroundColor: "transparent",
3110
+ overflow: "visible",
3111
+ userSelect: "none",
3112
+ cursor: u.value ? "ns-resize" : "default"
3113
+ })), D = a(() => {
3114
+ let e = [];
3115
+ if (n.unit === "inch") {
3116
+ let t = Hr / 8, n = Math.ceil(m.value / t);
3117
+ for (let r = 0; r <= n; r++) {
3118
+ let n = r * t;
3119
+ if (n > m.value) break;
3120
+ let i = f(n);
3121
+ r % 8 == 0 ? e.push({
3122
+ position: i,
3123
+ width: 10,
3124
+ label: r / 8 > 0 ? String(r / 8) : void 0
3125
+ }) : r % 4 == 0 ? e.push({
3126
+ position: i,
3127
+ width: 6
3128
+ }) : r % 2 == 0 ? e.push({
3129
+ position: i,
3130
+ width: 4
3131
+ }) : e.push({
3132
+ position: i,
3133
+ width: 2
3134
+ });
3135
+ }
3136
+ } else {
3137
+ let t = Ur / 10, n = Math.ceil(m.value / t);
3138
+ for (let r = 0; r <= n; r++) {
3139
+ let n = r * t;
3140
+ if (n > m.value) break;
3141
+ let i = f(n);
3142
+ r % 10 == 0 ? e.push({
3143
+ position: i,
3144
+ width: 10,
3145
+ label: r / 10 > 0 ? String(r / 10) : void 0
3146
+ }) : r % 5 == 0 ? e.push({
3147
+ position: i,
3148
+ width: 6
3149
+ }) : e.push({
3150
+ position: i,
3151
+ width: 3
3152
+ });
3153
+ }
3154
+ }
3155
+ return e;
3156
+ });
3157
+ function O(e) {
3158
+ return {
3159
+ position: "absolute",
3160
+ top: e - 5 + "px",
3161
+ right: 0,
3162
+ width: Wr + "px",
3163
+ height: "10px",
3164
+ cursor: n.editable ? "ns-resize" : "default",
3165
+ zIndex: u.value === null ? 1 : 10
3166
+ };
3167
+ }
3168
+ function k(e) {
3169
+ let t = u.value === e;
3170
+ return d.value, {
3171
+ position: "absolute",
3172
+ top: "0px",
3173
+ right: "2px",
3174
+ width: "0",
3175
+ height: "0",
3176
+ borderTop: "5px solid transparent",
3177
+ borderBottom: "5px solid transparent",
3178
+ borderRight: `8px solid ${t ? "var(--doc-primary-hover)" : "var(--doc-primary)"}`,
3179
+ transition: "border-right-color 0.1s"
3180
+ };
3181
+ }
3182
+ let A = 0, j = 0;
3183
+ function M(e, t) {
3184
+ n.editable && (u.value = e, A = t.clientY, j = e === "topMargin" ? h.value : v.value, document.addEventListener("mousemove", N), document.addEventListener("mouseup", F));
3185
+ }
3186
+ function N(e) {
3187
+ if (!u.value) return;
3188
+ let t = e.clientY - A, n = p(u.value === "topMargin" ? t : -t), i = m.value - (u.value === "topMargin" ? v.value : h.value) - 720, a = Math.round(Math.max(0, Math.min(j + n, i)));
3189
+ u.value === "topMargin" ? r("top-margin-change", a) : r("bottom-margin-change", a);
3190
+ }
3191
+ function F() {
3192
+ u.value = null, document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", F);
3193
+ }
3194
+ return _(() => {
3195
+ document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", F);
3196
+ }), (t, n) => (y(), c("div", {
3197
+ ref_key: "rulerRef",
3198
+ ref: o,
3199
+ class: "docx-vertical-ruler",
3200
+ style: g(T.value),
3201
+ role: "slider",
3202
+ "aria-label": "Vertical ruler",
3203
+ "aria-orientation": "vertical"
3204
+ }, [
3205
+ l("div", zr, [(y(!0), c(i, null, C(D.value, (e, t) => (y(), c(i, { key: t }, [l("div", {
3206
+ class: "docx-vertical-ruler__tick-line",
3207
+ style: g({
3208
+ top: e.position + "px",
3209
+ width: e.width + "px"
3210
+ })
3211
+ }, null, 4), e.label ? (y(), c("div", {
3212
+ key: 0,
3213
+ class: "docx-vertical-ruler__tick-label",
3214
+ style: g({ top: e.position + "px" })
3215
+ }, E(e.label), 5)) : s("", !0)], 64))), 128))]),
3216
+ e.editable ? (y(), c("div", {
3217
+ key: 0,
3218
+ class: "docx-vertical-ruler__marker",
3219
+ style: g(O(x.value)),
3220
+ onMousedown: n[0] ||= P((e) => M("topMargin", e), ["prevent"]),
3221
+ onMouseenter: n[1] ||= (e) => d.value = "topMargin",
3222
+ onMouseleave: n[2] ||= (e) => d.value = null
3223
+ }, [l("div", { style: g(k("topMargin")) }, null, 4)], 36)) : s("", !0),
3224
+ e.editable ? (y(), c("div", {
3225
+ key: 1,
3226
+ class: "docx-vertical-ruler__marker",
3227
+ style: g(O(b.value - w.value)),
3228
+ onMousedown: n[3] ||= P((e) => M("bottomMargin", e), ["prevent"]),
3229
+ onMouseenter: n[4] ||= (e) => d.value = "bottomMargin",
3230
+ onMouseleave: n[5] ||= (e) => d.value = null
3231
+ }, [l("div", { style: g(k("bottomMargin")) }, null, 4)], 36)) : s("", !0)
3232
+ ], 4));
3233
+ }
3234
+ }), [["__scopeId", "data-v-42fc6ef7"]]), Kr = { class: "doc-name" }, qr = ["value"], Jr = {
3235
+ key: 1,
3236
+ class: "doc-name__text"
3237
+ }, Yr = /* @__PURE__ */ n(/* @__PURE__ */ f({
3238
+ __name: "DocumentName",
3239
+ props: {
3240
+ modelValue: {},
3241
+ editable: {
3242
+ type: Boolean,
3243
+ default: !0
3244
+ }
3245
+ },
3246
+ emits: ["update:modelValue"],
3247
+ setup(e, { emit: t }) {
3248
+ let n = e, r = t, i = a(() => (n.modelValue || "").replace(/\.docx$/i, ""));
3249
+ function o(e) {
3250
+ let t = e.target.value;
3251
+ r("update:modelValue", t.endsWith(".docx") ? t : t + ".docx");
3252
+ }
3253
+ function s(e) {
3254
+ e.target.value.trim() || r("update:modelValue", "Untitled document.docx");
3255
+ }
3256
+ return (t, n) => (y(), c("div", Kr, [e.editable ? (y(), c("input", {
3257
+ key: 0,
3258
+ class: "doc-name__input",
3259
+ value: i.value,
3260
+ onInput: o,
3261
+ onBlur: s,
3262
+ placeholder: "Untitled document"
3263
+ }, null, 40, qr)) : (y(), c("span", Jr, E(i.value || "Untitled document"), 1))]));
3264
+ }
3265
+ }), [["__scopeId", "data-v-3f4b57cc"]]), Xr = ["disabled", "onClick"], Zr = {
3266
+ key: 0,
3267
+ class: "docx-menu-dropdown__separator"
3268
+ }, Qr = ["onMouseenter", "onMouseleave"], $r = ["disabled", "onClick"], ei = { class: "docx-menu-dropdown__label" }, ti = {
3269
+ key: 1,
3270
+ class: "docx-menu-dropdown__shortcut"
3271
+ }, ni = {
3272
+ key: 2,
3273
+ class: "docx-menu-dropdown__chevron"
3274
+ }, ri = {
3275
+ key: 0,
3276
+ class: "docx-menu-dropdown__submenu"
3277
+ }, ii = /* @__PURE__ */ n(/* @__PURE__ */ f({
3278
+ __name: "MenuDropdown",
3279
+ props: {
3280
+ label: {},
3281
+ items: {},
3282
+ disabled: { type: Boolean },
3283
+ showChevron: {
3284
+ type: Boolean,
3285
+ default: !1
3286
+ }
3287
+ },
3288
+ setup(t) {
3289
+ function n(e) {
3290
+ return "type" in e && e.type === "separator";
3291
+ }
3292
+ let r = S(!1), a = S(null);
3293
+ function f() {
3294
+ r.value = !1, a.value = null;
3295
+ }
3296
+ function p(e) {
3297
+ e.disabled || e.submenu || (e.onClick?.(), f());
3298
+ }
3299
+ return (m, g) => (y(), o($, {
3300
+ open: r.value,
3301
+ "onUpdate:open": g[2] ||= (e) => r.value = e,
3302
+ onClose: f
3303
+ }, {
3304
+ trigger: j(({ toggle: n }) => [l("button", {
3305
+ type: "button",
3306
+ class: h(["docx-menu-dropdown__trigger", { "docx-menu-dropdown__trigger--open": r.value }]),
3307
+ disabled: t.disabled,
3308
+ onMousedown: g[0] ||= P(() => {}, ["prevent"]),
3309
+ onClick: P(n, ["prevent"])
3310
+ }, [u(E(t.label) + " ", 1), t.showChevron ? (y(), o(e, {
3311
+ key: 0,
3312
+ name: "arrow_drop_down",
3313
+ size: 16
3314
+ })) : s("", !0)], 42, Xr)]),
3315
+ panel: j(() => [l("div", {
3316
+ class: "docx-menu-dropdown__menu",
3317
+ onMousedown: g[1] ||= P(() => {}, ["prevent"])
3318
+ }, [(y(!0), c(i, null, C(t.items, (t, r) => (y(), c(i, { key: r }, [n(t) ? (y(), c("div", Zr)) : (y(), c("div", {
3319
+ key: 1,
3320
+ class: "docx-menu-dropdown__wrap",
3321
+ onMouseenter: (e) => t.submenu ? a.value = r : void 0,
3322
+ onMouseleave: (e) => t.submenu ? a.value = null : void 0
3323
+ }, [l("button", {
3324
+ type: "button",
3325
+ class: h(["docx-menu-dropdown__item", { "docx-menu-dropdown__item--disabled": t.disabled }]),
3326
+ disabled: t.disabled,
3327
+ onClick: P((e) => p(t), ["prevent"])
3328
+ }, [
3329
+ t.icon ? (y(), o(e, {
3330
+ key: 0,
3331
+ name: t.icon,
3332
+ size: 18
3333
+ }, null, 8, ["name"])) : s("", !0),
3334
+ l("span", ei, E(t.label), 1),
3335
+ t.shortcut ? (y(), c("span", ti, E(t.shortcut), 1)) : s("", !0),
3336
+ t.submenu ? (y(), c("span", ni, [d(e, {
3337
+ name: "keyboard_arrow_right",
3338
+ size: 16
3339
+ })])) : s("", !0)
3340
+ ], 10, $r), t.submenu && a.value === r ? (y(), c("div", ri, [w(m.$slots, "submenu", {
3341
+ item: t,
3342
+ closeMenu: f
3343
+ }, void 0, !0)])) : s("", !0)], 40, Qr))], 64))), 128))], 32)]),
3344
+ _: 3
3345
+ }, 8, ["open"]));
3346
+ }
3347
+ }), [["__scopeId", "data-v-f87b9133"]]), ai = ["aria-selected", "onMouseenter"], oi = { class: "docx-table-grid-inline__label" }, si = /* @__PURE__ */ n(/* @__PURE__ */ f({
3348
+ __name: "TableGridInline",
3349
+ props: {
3350
+ gridRows: { default: 6 },
3351
+ gridColumns: { default: 6 }
3352
+ },
3353
+ emits: ["insert"],
3354
+ setup(e, { emit: t }) {
3355
+ let n = e, r = t, o = S(0), s = S(0), u = a(() => {
3356
+ let e = [];
3357
+ for (let t = 1; t <= n.gridRows; t++) for (let r = 1; r <= n.gridColumns; r++) e.push({
3358
+ r: t,
3359
+ c: r
3360
+ });
3361
+ return e;
3362
+ });
3363
+ function d() {
3364
+ o.value > 0 && s.value > 0 && r("insert", o.value, s.value);
3365
+ }
3366
+ return (t, n) => (y(), c("div", null, [l("div", {
3367
+ class: "docx-table-grid-inline__grid",
3368
+ style: g({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` }),
3369
+ role: "grid",
3370
+ "aria-label": "Table size selector",
3371
+ onMouseleave: n[0] ||= (e) => {
3372
+ o.value = 0, s.value = 0;
3373
+ }
3374
+ }, [(y(!0), c(i, null, C(u.value, (e) => (y(), c("div", {
3375
+ key: `${e.r}-${e.c}`,
3376
+ class: h(["docx-table-grid-inline__cell", { "docx-table-grid-inline__cell--active": e.r <= o.value && e.c <= s.value }]),
3377
+ role: "gridcell",
3378
+ "aria-selected": e.r <= o.value && e.c <= s.value,
3379
+ onMouseenter: (t) => {
3380
+ o.value = e.r, s.value = e.c;
3381
+ },
3382
+ onClick: P(d, ["prevent"])
3383
+ }, null, 42, ai))), 128))], 36), l("div", oi, E(o.value > 0 && s.value > 0 ? `${s.value} × ${o.value}` : "Select size"), 1)]));
3384
+ }
3385
+ }), [["__scopeId", "data-v-62b10375"]]), ci = {
3386
+ class: "menu-bar",
3387
+ role: "menubar"
3388
+ }, li = {
3389
+ key: 1,
3390
+ class: "menu-bar__break-submenu"
3391
+ }, ui = ["onClick"], di = /* @__PURE__ */ n(/* @__PURE__ */ f({
3392
+ __name: "MenuBar",
3393
+ props: {
3394
+ showFileOpen: {
3395
+ type: Boolean,
3396
+ default: !0
3397
+ },
3398
+ showHelpMenu: {
3399
+ type: Boolean,
3400
+ default: !0
3401
+ }
3402
+ },
3403
+ emits: ["action", "insert-table"],
3404
+ setup(n, { emit: r }) {
3405
+ let u = n, f = r, { t: p } = t();
3406
+ function m(e) {
3407
+ return () => f("action", e);
3408
+ }
3409
+ let h = a(() => [
3410
+ ...u.showFileOpen ? [{
3411
+ icon: "file_upload",
3412
+ label: p("toolbar.open"),
3413
+ shortcut: p("toolbar.openShortcut"),
3414
+ onClick: m("open")
3415
+ }] : [],
3416
+ {
3417
+ icon: "file_download",
3418
+ label: p("toolbar.save"),
3419
+ shortcut: p("toolbar.saveShortcut"),
3420
+ onClick: m("save")
3421
+ },
3422
+ { type: "separator" },
3423
+ {
3424
+ icon: "settings",
3425
+ label: p("toolbar.pageSetup"),
3426
+ onClick: m("pageSetup")
3427
+ }
3428
+ ]), g = a(() => [{
3429
+ icon: "format_textdirection_l_to_r",
3430
+ label: p("toolbar.leftToRight"),
3431
+ onClick: m("dirLTR")
3432
+ }, {
3433
+ icon: "format_textdirection_r_to_l",
3434
+ label: p("toolbar.rightToLeft"),
3435
+ onClick: m("dirRTL")
3436
+ }]), _ = a(() => [
3437
+ {
3438
+ icon: "image",
3439
+ label: p("toolbar.image"),
3440
+ onClick: m("insertImage")
3441
+ },
3442
+ {
3443
+ icon: "grid_on",
3444
+ label: p("toolbar.table"),
3445
+ key: "table",
3446
+ submenu: !0
3447
+ },
3448
+ { type: "separator" },
3449
+ {
3450
+ icon: "page_break",
3451
+ label: p("toolbar.break"),
3452
+ key: "break",
3453
+ submenu: !0
3454
+ },
3455
+ {
3456
+ icon: "format_list_numbered",
3457
+ label: p("toolbar.tableOfContents"),
3458
+ onClick: m("insertTOC")
3459
+ },
3460
+ {
3461
+ icon: "branding_watermark",
3462
+ label: p("toolbar.watermark"),
3463
+ onClick: m("watermark")
3464
+ }
3465
+ ]), v = a(() => [
3466
+ {
3467
+ icon: "page_break",
3468
+ label: p("toolbar.pageBreak"),
3469
+ action: "insertPageBreak"
3470
+ },
3471
+ {
3472
+ icon: "horizontal_rule",
3473
+ label: p("toolbar.sectionBreakNextPage"),
3474
+ action: "insertSectionBreakNextPage"
3475
+ },
3476
+ {
3477
+ icon: "border_horizontal",
3478
+ label: p("toolbar.sectionBreakContinuous"),
3479
+ action: "insertSectionBreakContinuous"
3480
+ }
3481
+ ]), b = a(() => [{
3482
+ label: p("toolbar.reportIssue"),
3483
+ onClick: m("reportIssue")
3484
+ }]);
3485
+ return (t, r) => (y(), c("div", ci, [
3486
+ d(ii, {
3487
+ label: D(p)("toolbar.file"),
3488
+ items: h.value
3489
+ }, null, 8, ["label", "items"]),
3490
+ d(ii, {
3491
+ label: D(p)("toolbar.format"),
3492
+ items: g.value
3493
+ }, null, 8, ["label", "items"]),
3494
+ d(ii, {
3495
+ label: D(p)("toolbar.insert"),
3496
+ items: _.value
3497
+ }, {
3498
+ submenu: j(({ item: t, closeMenu: n }) => [t.key === "table" ? (y(), o(si, {
3499
+ key: 0,
3500
+ onInsert: (e, t) => {
3501
+ f("insert-table", e, t), n();
3502
+ }
3503
+ }, null, 8, ["onInsert"])) : t.key === "break" ? (y(), c("div", li, [(y(!0), c(i, null, C(v.value, (t) => (y(), c("button", {
3504
+ key: t.action,
3505
+ type: "button",
3506
+ class: "menu-bar__break-item",
3507
+ onClick: P(() => {
3508
+ f("action", t.action), n();
3509
+ }, ["prevent"])
3510
+ }, [d(e, {
3511
+ name: t.icon,
3512
+ size: 18
3513
+ }, null, 8, ["name"]), l("span", null, E(t.label), 1)], 8, ui))), 128))])) : s("", !0)]),
3514
+ _: 1
3515
+ }, 8, ["label", "items"]),
3516
+ n.showHelpMenu ? (y(), o(ii, {
3517
+ key: 0,
3518
+ label: D(p)("toolbar.help"),
3519
+ items: b.value
3520
+ }, null, 8, ["label", "items"])) : s("", !0)
3521
+ ]));
3522
+ }
3523
+ }), [["__scopeId", "data-v-9d797fc9"]]), fi = Symbol("docx-portal-class");
3524
+ function pi(e) {
3525
+ b(fi, a(() => ({
3526
+ "ep-root": !0,
3527
+ dark: !!D(e)
3528
+ })));
3529
+ }
3530
+ function mi() {
3531
+ return p(fi, a(() => ({ "ep-root": !0 })));
3532
+ }
3533
+ //#endregion
3534
+ export { kt as C, je as D, Fe as E, $ as O, At as S, Ie as T, xn as _, ii as a, Ft as b, Rr as c, yr as d, hr as f, kn as g, Nn as h, si as i, Q as k, Tr as l, Un as m, mi as n, Yr as o, Gn as p, di as r, Gr as s, pi as t, Cr as u, bn as v, Le as w, Pt as x, Bt as y };