@eigenpal/docx-editor-vue 1.4.0 → 1.6.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 (42) hide show
  1. package/dist/KeyboardShortcutsDialog-Dohz9D39.cjs +1 -0
  2. package/dist/{KeyboardShortcutsDialog-BbuDgglK.js → KeyboardShortcutsDialog-OPAV0oVm.js} +351 -506
  3. package/dist/{MenuBar-CbONA9-a.js → MenuBar-BLKoZqG3.js} +813 -692
  4. package/dist/MenuBar-BP-XM0MI.cjs +4 -0
  5. package/dist/{TablePropertiesDialog-JWT68zEO.cjs → TablePropertiesDialog-B-FVOqkH.cjs} +1 -1
  6. package/dist/TablePropertiesDialog-B3oZIIjw.js +1145 -0
  7. package/dist/components/DocxEditor/types.d.ts +26 -0
  8. package/dist/components/Toolbar/presets.d.ts +0 -1
  9. package/dist/components/ui/fontPickerValue.d.ts +1 -0
  10. package/dist/components/ui/fontPickerValue.test.d.ts +1 -0
  11. package/dist/composables/imageOverlayRect.d.ts +44 -0
  12. package/dist/composables/imageOverlayRect.test.d.ts +1 -0
  13. package/dist/composables/useColorMode.d.ts +8 -0
  14. package/dist/composables/useCommentSidebarItems.test.d.ts +1 -0
  15. package/dist/composables/useDocxEditorRefApi.d.ts +4 -0
  16. package/dist/composables/useFileIO.d.ts +5 -0
  17. package/dist/composables/useFormattingActions.d.ts +5 -2
  18. package/dist/composables/useImageActions.d.ts +0 -6
  19. package/dist/composables/useMenuActions.d.ts +3 -1
  20. package/dist/composables/useParagraphStyleOptions.d.ts +18 -0
  21. package/dist/composables/useToolbarDropdowns.d.ts +1 -0
  22. package/dist/composables/useToolbarFontSize.d.ts +15 -0
  23. package/dist/composables.cjs +1 -1
  24. package/dist/composables.js +5 -4
  25. package/dist/dialogs.cjs +1 -1
  26. package/dist/dialogs.js +3 -3
  27. package/dist/docx-editor-vue.css +1 -1
  28. package/dist/index.cjs +4 -4
  29. package/dist/index.js +1375 -1258
  30. package/dist/plugin-api.cjs +1 -1
  31. package/dist/plugin-api.js +1 -1
  32. package/dist/ui.cjs +2 -2
  33. package/dist/ui.js +253 -230
  34. package/dist/{useCommentSidebarItems-CbNvNCd3.cjs → useCommentSidebarItems-DBeGKNGA.cjs} +1 -1
  35. package/dist/{useCommentSidebarItems-BHomCzpj.js → useCommentSidebarItems-DXbF857R.js} +2 -1
  36. package/dist/{useDragAutoScroll-BNPB-6SM.js → useDragAutoScroll-B21Ec-Zy.js} +6 -7
  37. package/dist/useDragAutoScroll-BPnc7LEO.cjs +1 -0
  38. package/package.json +4 -4
  39. package/dist/KeyboardShortcutsDialog-Bct8AJ0i.cjs +0 -1
  40. package/dist/MenuBar-m0JEaF1X.cjs +0 -4
  41. package/dist/TablePropertiesDialog-D5MIF3cj.js +0 -987
  42. package/dist/useDragAutoScroll-DCUotwOX.cjs +0 -1
package/dist/index.js CHANGED
@@ -1,42 +1,45 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./KeyboardShortcutsDialog-BbuDgglK.js";
2
- import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./MenuBar-CbONA9-a.js";
3
- import { t as x } from "./_plugin-vue_export-helper-B52Kst-M.js";
4
- import { n as S } from "./RenderedDomContext-CHc18N_2.js";
5
- import { t as C } from "./zIndex-CxELVe_L.js";
6
- import { i as ee, n as te, r as ne, t as w } from "./useDragAutoScroll-BNPB-6SM.js";
7
- import { Fragment as T, Teleport as E, computed as D, createApp as re, createBlock as ie, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createSlots as ae, createStaticVNode as oe, createTextVNode as j, createVNode as M, defineComponent as N, h as se, isRef as ce, nextTick as le, normalizeClass as P, normalizeStyle as F, onBeforeUnmount as I, onMounted as L, openBlock as R, ref as z, renderList as B, renderSlot as V, resolveDynamicComponent as ue, shallowRef as de, toDisplayString as H, unref as U, vModelCheckbox as W, vModelSelect as fe, vModelText as G, watch as K, withCtx as pe, withDirectives as q, withKeys as me, withModifiers as J } from "vue";
8
- import { NodeSelection as Y, TextSelection as he } from "prosemirror-state";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./KeyboardShortcutsDialog-OPAV0oVm.js";
2
+ import { a as f, c as p, h as m, i as h, o as g, s as _, t as v, x as y } from "./MenuBar-BLKoZqG3.js";
3
+ import { t as b } from "./_plugin-vue_export-helper-B52Kst-M.js";
4
+ import { n as x } from "./RenderedDomContext-CHc18N_2.js";
5
+ import { t as S } from "./zIndex-CxELVe_L.js";
6
+ import { i as C, n as ee, r as te, t as ne } from "./useDragAutoScroll-B21Ec-Zy.js";
7
+ import { Fragment as w, Teleport as T, computed as E, createApp as re, createBlock as D, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createSlots as ie, createStaticVNode as ae, createTextVNode as j, createVNode as M, defineComponent as N, h as P, isRef as oe, nextTick as se, normalizeClass as ce, normalizeStyle as F, onBeforeUnmount as I, onMounted as le, openBlock as L, ref as R, renderList as ue, renderSlot as de, resolveDynamicComponent as fe, shallowRef as pe, toDisplayString as z, unref as B, vModelCheckbox as V, vModelSelect as me, vModelText as H, watch as U, watchEffect as W, withCtx as he, withDirectives as G, withKeys as K, withModifiers as q } from "vue";
8
+ import { NodeSelection as J, TextSelection as Y } from "prosemirror-state";
9
9
  import { applyCellSelectionHighlight as ge, clickToPositionDom as _e, computeHfCaretRectFromView as ve, computeHfSelectionRectsFromView as ye, findBodyPmAnchor as X, findBodyPmSpans as be } from "@eigenpal/docx-editor-core/layout-bridge";
10
- import { findInDocument as xe, getPageContent as Se, getSelectionInfo as Ce } from "@eigenpal/docx-editor-core/prosemirror/queries";
11
- import { LayoutSelectionGate as we, addRepeatingSectionItemTr as Te, extractSelectionState as Ee, findContentControlPos as De, findContentControlsInPM as Oe, removeContentControlTr as ke, removeRepeatingSectionItemTr as Ae, schema as je, setContentControlContentTr as Me, setContentControlValueTr as Z } from "@eigenpal/docx-editor-core/prosemirror";
12
- import { SIDEBAR_DOCUMENT_SHIFT as Ne, findWordBoundaries as Pe, loadFontDefinitions as Fe, onFontError as Ie, pixelsToEmu as Le, readDocxFileFromInput as Re, toArrayBuffer as ze } from "@eigenpal/docx-editor-core/utils";
13
- import { extractSelectionContext as Be } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
14
- import { clearFormatting as Ve, findHyperlinkRangeAt as He } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
15
- import { getTableContext as Q } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
16
- import { clickToPositionDom as Ue, getCaretPositionFromDom as We, getSelectionRectsFromDom as Ge } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
17
- import { calculateResizedImageDimensions as Ke, commitImageFloatMove as qe, commitImageInlineMove as Je, commitImageResize as Ye, isFloatingImage as Xe } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
18
- import { IMAGE_LAYOUT_OPTIONS as Ze, captureInlinePositionEmu as Qe, deriveLayoutChoice as $e, findImageElement as et, isImageLayoutOptionEnabled as tt, renderAllPagesNow as nt, toolbarValueToLayoutTarget as rt } from "@eigenpal/docx-editor-core/layout-painter";
19
- import { proseDocToBlocks as it } from "@eigenpal/docx-editor-core/prosemirror/conversion";
20
- import { twipsToPixels as at } from "@eigenpal/docx-editor-core/utils/units";
21
- import { pictureWatermarkDisplayEmu as ot } from "@eigenpal/docx-editor-core/types/document";
22
- import { makeRevisionInfo as st } from "@eigenpal/docx-editor-core/prosemirror/plugins";
23
- import { findPageIndexContainingPmPos as ct } from "@eigenpal/docx-editor-core/layout-engine";
24
- import { applyStyle as lt, removeTabStop as ut, setIndentFirstLine as dt, setIndentLeft as ft, setIndentRight as pt } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
25
- import { createStyleResolver as mt } from "@eigenpal/docx-editor-core/prosemirror/styles";
26
- import { insertPageBreak as ht } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
27
- import { applyFormatting as gt, setParagraphStyle as _t } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
28
- import { acceptChange as vt, acceptChangeById as yt, getWatermarkFromState as bt, insertImageNode as xt, rejectChange as St, rejectChangeById as Ct, setWatermark as wt } from "@eigenpal/docx-editor-core/prosemirror/commands";
29
- import { collectHeadings as Tt } from "@eigenpal/docx-editor-core/utils/headingCollector";
30
- import { addCommentToRange as Et, applyProposedChange as Dt, createComment as Ot } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
31
- import { PENDING_COMMENT_ID as kt, createCommentIdAllocator as At, seedCommentAllocator as jt } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
32
- import { extractTrackedChanges as Mt } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
33
- import { TABLE_INSERT_HIDE_DELAY_MS as Nt, detectTableInsertHover as Pt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
34
- import { openReportIssue as Ft } from "@eigenpal/docx-editor-core/utils/reportIssue";
35
- import { ContentControlNotFoundError as It } from "@eigenpal/docx-editor-core/agent";
36
- import { findParaIdRange as Lt } from "@eigenpal/docx-editor-core/prosemirror/paraText";
37
- import { createDocumentWithText as Rt, createEmptyDocument as zt } from "@eigenpal/docx-editor-core";
10
+ import { clampRangeToDoc as xe, findChangeRange as Se, findCommentRange as Ce, findInDocument as we, getPageContent as Te, getSelectionInfo as Ee } from "@eigenpal/docx-editor-core/prosemirror/queries";
11
+ import { LayoutSelectionGate as De, addRepeatingSectionItemTr as Oe, extractSelectionState as ke, findContentControlPos as Ae, findContentControlsInPM as je, removeContentControlTr as Me, removeRepeatingSectionItemTr as Z, schema as Ne, setContentControlContentTr as Pe, setContentControlValueAtPosTr as Fe, setContentControlValueTr as Ie } from "@eigenpal/docx-editor-core/prosemirror";
12
+ import { SIDEBAR_DOCUMENT_SHIFT as Le, findWordBoundaries as Re, loadFontDefinitions as ze, onFontError as Be, pixelsToEmu as Ve, prefersColorSchemeDark as Q, readDocxFileFromInput as He, resolveIsDark as Ue, subscribeSystemDark as We, toArrayBuffer as Ge } from "@eigenpal/docx-editor-core/utils";
13
+ import { extractSelectionContext as Ke } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
14
+ import { clearFormatting as qe, findHyperlinkRangeAt as Je } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
15
+ import { getTableContext as Ye } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
16
+ import { clickToPositionDom as Xe, getCaretPositionFromDom as Ze, getSelectionRectsFromDom as Qe } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
17
+ import { calculateResizedImageDimensions as $e, commitImageFloatMove as et, commitImageInlineMove as tt, commitImageResize as nt, isFloatingImage as rt } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
18
+ import { IMAGE_LAYOUT_OPTIONS as it, captureInlinePositionEmu as at, deriveLayoutChoice as ot, findImageElement as st, isImageLayoutOptionEnabled as ct, renderAllPagesNow as lt, toolbarValueToLayoutTarget as ut } from "@eigenpal/docx-editor-core/layout-painter";
19
+ import { proseDocToBlocks as dt } from "@eigenpal/docx-editor-core/prosemirror/conversion";
20
+ import { twipsToPixels as ft } from "@eigenpal/docx-editor-core/utils/units";
21
+ import { DEFAULT_WATERMARK_PRESETS as pt, pictureWatermarkDisplayEmu as mt } from "@eigenpal/docx-editor-core/types/document";
22
+ import { makeRevisionInfo as ht } from "@eigenpal/docx-editor-core/prosemirror/plugins";
23
+ import { findPageIndexContainingPmPos as gt } from "@eigenpal/docx-editor-core/layout-engine";
24
+ import { acceptChange as _t, acceptChangeById as vt, getWatermarkFromState as yt, insertImageFromFile as bt, rejectChange as xt, rejectChangeById as St, setWatermark as Ct } from "@eigenpal/docx-editor-core/prosemirror/commands";
25
+ import { applyStyle as wt, removeTabStop as Tt, setIndentFirstLine as Et, setIndentLeft as Dt, setIndentRight as Ot } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
26
+ import { createStyleResolver as kt } from "@eigenpal/docx-editor-core/prosemirror/styles";
27
+ import { getCachedNumberingMap as At } from "@eigenpal/docx-editor-core/docx";
28
+ import { insertPageBreak as jt } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
29
+ import { insertSectionBreakContinuous as Mt, insertSectionBreakNextPage as Nt } from "@eigenpal/docx-editor-core/prosemirror/commands/sectionBreak";
30
+ import { applyFormatting as Pt, insertBreak as Ft, setParagraphStyle as It } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
31
+ import { collectHeadings as Lt } from "@eigenpal/docx-editor-core/utils/headingCollector";
32
+ import { addCommentToRange as Rt, applyProposedChange as zt, createComment as Bt } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
33
+ import { PENDING_COMMENT_ID as Vt, createCommentIdAllocator as Ht, seedCommentAllocator as Ut } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
34
+ import { extractTrackedChanges as Wt } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
35
+ import { TABLE_INSERT_HIDE_DELAY_MS as Gt, detectTableInsertHover as Kt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
36
+ import { createCellDragTracker as qt, findCellPosFromPmPos as Jt } from "@eigenpal/docx-editor-core/prosemirror/cellDragSelection";
37
+ import { openReportIssue as Yt } from "@eigenpal/docx-editor-core/utils/reportIssue";
38
+ import { ContentControlNotFoundError as Xt } from "@eigenpal/docx-editor-core/agent";
39
+ import { findParaIdRange as Zt } from "@eigenpal/docx-editor-core/prosemirror/paraText";
40
+ import { createDocumentWithText as Qt, createEmptyDocument as $t } from "@eigenpal/docx-editor-core";
38
41
  //#region src/utils/domQueries.ts
39
- function Bt(e) {
42
+ function en(e) {
40
43
  let t = window.document.querySelectorAll(`.layout-page-${e}`);
41
44
  if (t.length === 0) return null;
42
45
  let n = window.innerHeight / 2, r = t[0], i = Infinity;
@@ -46,7 +49,7 @@ function Bt(e) {
46
49
  }
47
50
  return r;
48
51
  }
49
- function Vt(e, t, n) {
52
+ function tn(e, t, n) {
50
53
  let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : be(e);
51
54
  for (let e of r) {
52
55
  let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
@@ -54,7 +57,7 @@ function Vt(e, t, n) {
54
57
  }
55
58
  return null;
56
59
  }
57
- function Ht(e, t, n) {
60
+ function nn(e, t, n) {
58
61
  if (!e || !t) return;
59
62
  let r = null;
60
63
  for (let t of be(e)) {
@@ -71,21 +74,21 @@ function Ht(e, t, n) {
71
74
  behavior: "smooth"
72
75
  });
73
76
  }
74
- function Ut(e, t, n, r) {
77
+ function rn(e, t, n, r) {
75
78
  if (!e || !t) return null;
76
79
  let i = _e(e, n, r, 1);
77
80
  return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
78
81
  }
79
- function Wt(e, t, n, r) {
82
+ function an(e, t, n, r) {
80
83
  if (!e) return;
81
- let i = Vt(e, t, r);
84
+ let i = tn(e, t, r);
82
85
  if (!i) return;
83
- let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Pe(a, t - o), l = o + s, u = o + c;
86
+ let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Re(a, t - o), l = o + s, u = o + c;
84
87
  l < u && n(l, u);
85
88
  }
86
- function Gt(e, t, n, r) {
89
+ function on(e, t, n, r) {
87
90
  if (!e) return;
88
- let i = Vt(e, t, r);
91
+ let i = tn(e, t, r);
89
92
  if (!i) return;
90
93
  let a = i.closest(".layout-paragraph");
91
94
  if (!a) return;
@@ -94,7 +97,7 @@ function Gt(e, t, n, r) {
94
97
  }
95
98
  //#endregion
96
99
  //#region src/components/DecorationLayer.vue
97
- var Kt = /* @__PURE__ */ N({
100
+ var sn = /* @__PURE__ */ N({
98
101
  __name: "DecorationLayer",
99
102
  props: {
100
103
  getView: { type: Function },
@@ -104,7 +107,7 @@ var Kt = /* @__PURE__ */ N({
104
107
  syncCoordinator: {}
105
108
  },
106
109
  setup(e) {
107
- let t = e, n = z(null), r = z(0), i = null, a = null;
110
+ let t = e, n = R(null), r = R(0), i = null, a = null;
108
111
  function o() {
109
112
  i !== null && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
110
113
  i = null;
@@ -112,13 +115,13 @@ var Kt = /* @__PURE__ */ N({
112
115
  !e || !r || !a || t.syncCoordinator.isSafeToRender() && s(e, r, a, t.zoom);
113
116
  });
114
117
  }
115
- L(() => {
118
+ le(() => {
116
119
  a = t.syncCoordinator.onRender(() => {
117
120
  r.value++;
118
121
  }), o();
119
122
  }), I(() => {
120
123
  i !== null && (cancelAnimationFrame(i), i = null), a?.();
121
- }), K(() => [
124
+ }), U(() => [
122
125
  t.zoom,
123
126
  t.transactionVersion,
124
127
  r.value
@@ -129,7 +132,7 @@ var Kt = /* @__PURE__ */ N({
129
132
  n.firstChild && n.replaceChildren();
130
133
  return;
131
134
  }
132
- let a = S(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
135
+ let a = x(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
133
136
  for (let { decoration: t, from: n, to: r } of i) {
134
137
  if (n === r) {
135
138
  let r = l(t, e);
@@ -179,20 +182,34 @@ var Kt = /* @__PURE__ */ N({
179
182
  function u(e) {
180
183
  return e.type?.attrs ?? null;
181
184
  }
182
- return (e, t) => (R(), k("div", {
185
+ return (e, t) => (L(), k("div", {
183
186
  ref_key: "overlayRef",
184
187
  ref: n,
185
188
  class: "paged-editor__decoration-overlay",
186
189
  "aria-hidden": "true"
187
190
  }, null, 512));
188
191
  }
189
- }), qt = ["data-handle", "onMousedown"], Jt = ["title"], Yt = {
192
+ });
193
+ //#endregion
194
+ //#region src/composables/imageOverlayRect.ts
195
+ function cn(e) {
196
+ let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
197
+ return {
198
+ left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
199
+ top: (e.imageRect.top - e.parentRect.top + e.scrollTop) / n,
200
+ width: e.imageRect.width / n,
201
+ height: e.imageRect.height / n
202
+ };
203
+ }
204
+ //#endregion
205
+ //#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
206
+ var ln = ["data-handle", "onMousedown"], un = ["title"], dn = {
190
207
  key: 0,
191
208
  class: "image-overlay__dim"
192
- }, Xt = {
209
+ }, fn = {
193
210
  key: 1,
194
211
  class: "image-overlay__dim image-overlay__dim--rotate"
195
- }, Zt = 4, Qt = 15, $t = /* @__PURE__ */ x(/* @__PURE__ */ N({
212
+ }, pn = 4, mn = 15, hn = 250, gn = 700, _n = /* @__PURE__ */ b(/* @__PURE__ */ N({
196
213
  __name: "ImageSelectionOverlay",
197
214
  props: {
198
215
  imageInfo: {},
@@ -206,7 +223,7 @@ var Kt = /* @__PURE__ */ N({
206
223
  "context-menu"
207
224
  ],
208
225
  setup(e, { emit: t }) {
209
- let { t: r } = n(), i = e, a = t, o = z(null), s = z(!1), c = z(!1), l = z(!1), u = z(0), d = z(0), f = z(0), p = z(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, S = null;
226
+ let { t: n } = d(), r = e, i = t, a = R(null), o = R(!1), s = R(!1), c = R(!1), l = R(0), u = R(0), f = R(0), p = R(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, C = null;
210
227
  function ee(e, t) {
211
228
  if (!e) return null;
212
229
  try {
@@ -217,56 +234,82 @@ var Kt = /* @__PURE__ */ N({
217
234
  }
218
235
  }
219
236
  function te() {
220
- return o.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
237
+ return a.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
221
238
  }
222
239
  function ne() {
223
- let e = i.imageInfo;
240
+ let e = r.imageInfo;
224
241
  if (!e) return null;
225
242
  if (e.element.isConnected) return e.element;
226
243
  let t = te();
227
244
  if (!t) return null;
228
245
  let n = X(t, e.pmPos);
229
- return n ? et(n) : null;
246
+ return n ? st(n) : null;
230
247
  }
231
- function w() {
248
+ function T() {
232
249
  let e = ne();
233
- if (!e || !o.value) {
250
+ if (!e || !a.value) {
234
251
  p.value = null;
235
252
  return;
236
253
  }
237
- let t = o.value.offsetParent;
254
+ let t = a.value.offsetParent;
238
255
  if (!t) {
239
256
  p.value = null;
240
257
  return;
241
258
  }
242
- let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), a = i.zoom;
243
- p.value = {
244
- left: (r.left - n.left + t.scrollLeft) / a,
245
- top: (r.top - n.top + t.scrollTop) / a,
246
- width: r.width / a,
247
- height: r.height / a
248
- };
259
+ let n = t.getBoundingClientRect();
260
+ p.value = cn({
261
+ imageRect: e.getBoundingClientRect(),
262
+ parentRect: n,
263
+ scrollLeft: t.scrollLeft,
264
+ scrollTop: t.scrollTop,
265
+ parentOffsetWidth: t.offsetWidth,
266
+ parentClientWidth: t.clientWidth,
267
+ zoom: r.zoom
268
+ });
249
269
  }
250
- K(() => i.imageInfo, async () => {
251
- await le(), w();
252
- }, { immediate: !0 }), K(() => i.zoom, (e, t, n) => {
253
- if (!i.imageInfo) return;
254
- let r = 0, a = "", o = 0, s = 0, c = (e) => {
255
- w();
256
- let t = p.value, n = t ? `${t.left}|${t.top}|${t.width}|${t.height}` : "";
257
- o = n === a ? o + 1 : 0, a = n, s += e, o < 2 && s < 500 && (r = requestAnimationFrame(() => c(16)));
270
+ let re = null;
271
+ function D() {
272
+ re?.();
273
+ let e = 0, t = "", n = 0, r = 0, i = (a) => {
274
+ r === 0 && (r = a);
275
+ let o = a - r;
276
+ T();
277
+ let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
278
+ n = c === t ? n + 1 : 0, t = c, !(o >= hn && n >= 2) && o < gn && (e = requestAnimationFrame(i));
258
279
  };
259
- r = requestAnimationFrame(() => c(16)), n(() => cancelAnimationFrame(r));
260
- }), K(() => i.imageInfo, (e, t, n) => {
261
- if (!i.imageInfo) return;
262
- let r = () => {
263
- b && cancelAnimationFrame(b), b = requestAnimationFrame(w);
264
- }, a = o.value?.closest(".docx-editor-vue__pages-viewport");
265
- a?.addEventListener("scroll", r, { passive: !0 }), window.addEventListener("resize", r, { passive: !0 }), n(() => {
266
- a?.removeEventListener("scroll", r), window.removeEventListener("resize", r), b && cancelAnimationFrame(b);
280
+ e = requestAnimationFrame(i);
281
+ let a = setTimeout(T, hn);
282
+ re = () => {
283
+ cancelAnimationFrame(e), clearTimeout(a);
284
+ };
285
+ }
286
+ U(() => r.imageInfo, (e, t, n) => {
287
+ if (!r.imageInfo) {
288
+ p.value = null;
289
+ return;
290
+ }
291
+ D(), n(() => re?.());
292
+ }, { immediate: !0 }), U(() => r.zoom, () => {
293
+ r.imageInfo && D();
294
+ }), U(() => r.imageInfo, (e, t, n) => {
295
+ if (!r.imageInfo) return;
296
+ let i = () => {
297
+ b && cancelAnimationFrame(b), b = requestAnimationFrame(T);
298
+ }, o = a.value?.closest(".docx-editor-vue__pages-viewport");
299
+ o?.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i, { passive: !0 });
300
+ let s = null, c = !1;
301
+ se(() => {
302
+ if (c || !r.imageInfo) return;
303
+ let e = te();
304
+ e && (s = new MutationObserver(() => D()), s.observe(e, {
305
+ attributes: !0,
306
+ attributeFilter: ["style"]
307
+ }));
308
+ }), n(() => {
309
+ c = !0, o?.removeEventListener("scroll", i), window.removeEventListener("resize", i), s?.disconnect(), b && cancelAnimationFrame(b);
267
310
  });
268
311
  }, { immediate: !0 });
269
- let E = D(() => s.value ? u.value : p.value?.width || 0), re = D(() => s.value ? d.value : p.value?.height || 0), ie = D(() => {
312
+ let ie = E(() => o.value ? l.value : p.value?.width || 0), ae = E(() => o.value ? u.value : p.value?.height || 0), j = E(() => {
270
313
  let e = p.value;
271
314
  if (!e) return {
272
315
  position: "absolute",
@@ -275,20 +318,20 @@ var Kt = /* @__PURE__ */ N({
275
318
  visibility: "hidden",
276
319
  pointerEvents: "none"
277
320
  };
278
- let t = s.value ? u.value : e.width, n = s.value ? d.value : e.height, r = i.zoom || 1;
321
+ let t = o.value ? l.value : e.width, n = o.value ? u.value : e.height, i = r.zoom || 1;
279
322
  return {
280
323
  position: "absolute",
281
- left: `${e.left * r}px`,
282
- top: `${e.top * r}px`,
324
+ left: `${e.left * i}px`,
325
+ top: `${e.top * i}px`,
283
326
  width: `${t}px`,
284
327
  height: `${n}px`,
285
- transform: r === 1 ? void 0 : `scale(${r})`,
328
+ transform: i === 1 ? void 0 : `scale(${i})`,
286
329
  transformOrigin: "top left",
287
- zIndex: C.imageOverlay,
330
+ zIndex: S.imageOverlay,
288
331
  pointerEvents: "auto"
289
332
  };
290
- }), ae = D(() => {
291
- let e = E.value, t = re.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
333
+ }), M = E(() => {
334
+ let e = ie.value, t = ae.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
292
335
  return [
293
336
  {
294
337
  pos: "nw",
@@ -356,12 +399,12 @@ var Kt = /* @__PURE__ */ N({
356
399
  }
357
400
  ];
358
401
  });
359
- function oe(e, t) {
360
- !i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove", j), document.addEventListener("mouseup", M));
402
+ function N(e, t) {
403
+ !r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, l.value = Math.round(_), u.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", P), document.addEventListener("mouseup", oe));
361
404
  }
362
- function j(e) {
363
- let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = Ke(m, n, r, _, v, a);
364
- u.value = Math.round(o.width), d.value = Math.round(o.height);
405
+ function P(e) {
406
+ let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = $e(m, n, i, _, v, a);
407
+ l.value = Math.round(o.width), u.value = Math.round(o.height);
365
408
  let s = y;
366
409
  s && (p.value = {
367
410
  left: m.includes("w") ? s.left + (s.width - o.width) : s.left,
@@ -370,151 +413,151 @@ var Kt = /* @__PURE__ */ N({
370
413
  height: s.height
371
414
  });
372
415
  }
373
- function M() {
374
- document.removeEventListener("mousemove", j), document.removeEventListener("mouseup", M), s.value = !1, y = null, a("interact-end");
375
- let e = i.view, t = i.imageInfo;
416
+ function oe() {
417
+ document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", oe), o.value = !1, y = null, i("interact-end");
418
+ let e = r.view, t = r.imageInfo;
376
419
  if (!e || !t) {
377
- w();
420
+ T();
378
421
  return;
379
422
  }
380
- let n = Ye(e, t.pmPos, u.value, d.value);
381
- n !== null && ge(n), le(() => w());
423
+ let n = nt(e, t.pmPos, l.value, u.value);
424
+ n !== null && ve(n), se(() => T());
382
425
  }
383
- let N = 0, se = 0, ce = 0, P = 0, L = null, V = null;
384
- function ue(e) {
426
+ let ce = 0, le = 0, de = 0, fe = 0, pe = null, V = null;
427
+ function me(e) {
385
428
  if (!e) return 0;
386
429
  let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);
387
430
  return t ? parseFloat(t[1]) : 0;
388
431
  }
389
- function de(e, t) {
432
+ function H(e, t) {
390
433
  let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
391
434
  return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
392
435
  }
393
436
  function W(e, t) {
394
- return Math.atan2(e - N, -(t - se)) * 180 / Math.PI;
437
+ return Math.atan2(e - ce, -(t - le)) * 180 / Math.PI;
395
438
  }
396
- function fe(e) {
397
- if (!i.imageInfo) return;
398
- let t = i.imageInfo.element.getBoundingClientRect();
399
- N = t.left + t.width / 2, se = t.top + t.height / 2;
400
- let n = ee(i.view, i.imageInfo.pmPos);
401
- L = n && n.attrs.transform || null, P = ue(L), V = i.imageInfo.element.querySelector("img"), ce = W(e.clientX, e.clientY), f.value = P, l.value = !0, a("interact-start"), document.addEventListener("mousemove", G), document.addEventListener("mouseup", pe);
439
+ function he(e) {
440
+ if (!r.imageInfo) return;
441
+ let t = r.imageInfo.element.getBoundingClientRect();
442
+ ce = t.left + t.width / 2, le = t.top + t.height / 2;
443
+ let n = ee(r.view, r.imageInfo.pmPos);
444
+ pe = n && n.attrs.transform || null, fe = me(pe), V = r.imageInfo.element.querySelector("img"), de = W(e.clientX, e.clientY), f.value = fe, c.value = !0, i("interact-start"), document.addEventListener("mousemove", G), document.addEventListener("mouseup", K);
402
445
  }
403
446
  function G(e) {
404
- let t = W(e.clientX, e.clientY) - ce, n = P + t;
405
- e.shiftKey || (n = Math.round(n / Qt) * Qt), f.value = (n % 360 + 360) % 360, V && (V.style.transform = de(L, f.value) || "");
447
+ let t = W(e.clientX, e.clientY) - de, n = fe + t;
448
+ e.shiftKey || (n = Math.round(n / mn) * mn), f.value = (n % 360 + 360) % 360, V && (V.style.transform = H(pe, f.value) || "");
406
449
  }
407
- function pe() {
408
- document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", pe), l.value = !1, a("interact-end");
409
- let e = i.view, t = i.imageInfo;
450
+ function K() {
451
+ document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", K), c.value = !1, i("interact-end");
452
+ let e = r.view, t = r.imageInfo;
410
453
  try {
411
454
  let n = e && t ? ee(e, t.pmPos) : null;
412
455
  e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
413
456
  ...n.attrs,
414
- transform: de(n.attrs.transform, f.value)
415
- })), ge(t.pmPos));
457
+ transform: H(n.attrs.transform, f.value)
458
+ })), ve(t.pmPos));
416
459
  } catch {} finally {
417
- V && (V.style.transform = ""), V = null, L = null;
460
+ V && (V.style.transform = ""), V = null, pe = null;
418
461
  }
419
- le(() => w());
462
+ se(() => T());
420
463
  }
421
- let q = null;
422
- function me(e) {
423
- if (!i.imageInfo || !p.value) return;
424
- let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
425
- let s = e.clientX - t, l = e.clientY - n;
426
- if (!(!o && Math.sqrt(s * s + l * l) < Zt)) {
464
+ let Y = null;
465
+ function ge(e) {
466
+ if (!r.imageInfo || !p.value) return;
467
+ let t = e.clientX, n = e.clientY, a = p.value, o = !1, c = (e) => {
468
+ let c = e.clientX - t, l = e.clientY - n;
469
+ if (!(!o && Math.sqrt(c * c + l * l) < pn)) {
427
470
  if (!o) {
428
- o = !0, c.value = !0, a("interact-start"), q = document.createElement("div"), q.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
429
- let e = i.zoom;
430
- q.style.width = `${r.width * e}px`, q.style.height = `${r.height * e}px`, document.body.appendChild(q);
471
+ o = !0, s.value = !0, i("interact-start"), Y = document.createElement("div"), Y.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
472
+ let e = r.zoom;
473
+ Y.style.width = `${a.width * e}px`, Y.style.height = `${a.height * e}px`, document.body.appendChild(Y);
431
474
  }
432
- if (q) {
433
- let t = i.zoom;
434
- q.style.left = `${e.clientX - r.width * t / 2}px`, q.style.top = `${e.clientY - r.height * t / 2}px`;
475
+ if (Y) {
476
+ let t = r.zoom;
477
+ Y.style.left = `${e.clientX - a.width * t / 2}px`, Y.style.top = `${e.clientY - a.height * t / 2}px`;
435
478
  }
436
479
  }
437
480
  }, l = (e) => {
438
- document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, S = null, q &&= (q.remove(), null), c.value = !1, o && (a("interact-end"), he(e.clientX, e.clientY));
481
+ document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", l), x = null, C = null, Y &&= (Y.remove(), null), s.value = !1, o && (i("interact-end"), _e(e.clientX, e.clientY));
439
482
  };
440
- x = s, S = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
483
+ x = c, C = l, document.addEventListener("mousemove", c), document.addEventListener("mouseup", l);
441
484
  }
442
- function he(e, t) {
443
- let n = i.view, r = i.imageInfo;
444
- if (!n || !r) return;
445
- let a = ee(n, r.pmPos);
446
- if (a) {
447
- if (Xe(a)) {
448
- let a = (o.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
449
- if (!a || a.length === 0) return;
485
+ function _e(e, t) {
486
+ let n = r.view, i = r.imageInfo;
487
+ if (!n || !i) return;
488
+ let o = ee(n, i.pmPos);
489
+ if (o) {
490
+ if (rt(o)) {
491
+ let o = (a.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
492
+ if (!o || o.length === 0) return;
450
493
  let s = null;
451
- for (let e of a) {
494
+ for (let e of o) {
452
495
  let n = e.getBoundingClientRect();
453
496
  if (t >= n.top && t <= n.bottom) {
454
497
  s = e.querySelector(".layout-page-content");
455
498
  break;
456
499
  }
457
500
  }
458
- if (s ||= a[a.length - 1].querySelector(".layout-page-content"), !s) return;
459
- let c = s.getBoundingClientRect(), l = i.zoom, u = Le((e - c.left) / l), d = Le((t - c.top) / l), f = qe(n, r.pmPos, u, d);
460
- f !== null && ge(f);
501
+ if (s ||= o[o.length - 1].querySelector(".layout-page-content"), !s) return;
502
+ let c = s.getBoundingClientRect(), l = r.zoom, u = Ve((e - c.left) / l), d = Ve((t - c.top) / l), f = et(n, i.pmPos, u, d);
503
+ f !== null && ve(f);
461
504
  } else {
462
- let i = te();
463
- if (!i) return;
464
- let a = Ue(i, e, t, 1);
505
+ let r = te();
506
+ if (!r) return;
507
+ let a = Xe(r, e, t, 1);
465
508
  if (a == null || a < 0) return;
466
- let o = Je(n, r.pmPos, a);
467
- o !== null && ge(o);
509
+ let o = tt(n, i.pmPos, a);
510
+ o !== null && ve(o);
468
511
  }
469
- le(() => w());
512
+ se(() => T());
470
513
  }
471
514
  }
472
- function ge(e) {
473
- let t = i.view;
515
+ function ve(e) {
516
+ let t = r.view;
474
517
  if (t) try {
475
- let n = Y.create(t.state.doc, e);
518
+ let n = J.create(t.state.doc, e);
476
519
  t.dispatch(t.state.tr.setSelection(n));
477
520
  } catch {}
478
521
  }
479
522
  return I(() => {
480
- document.removeEventListener("mousemove", j), document.removeEventListener("mouseup", M), document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", pe), x && document.removeEventListener("mousemove", x), S && document.removeEventListener("mouseup", S), q &&= (q.remove(), null), b && cancelAnimationFrame(b);
481
- }), (t, n) => e.imageInfo ? (R(), k("div", {
523
+ document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", oe), document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", K), x && document.removeEventListener("mousemove", x), C && document.removeEventListener("mouseup", C), Y &&= (Y.remove(), null), b && cancelAnimationFrame(b), re?.();
524
+ }), (t, r) => e.imageInfo ? (L(), k("div", {
482
525
  key: 0,
483
526
  ref_key: "overlayRootRef",
484
- ref: o,
527
+ ref: a,
485
528
  class: "image-overlay",
486
- style: F(ie.value),
487
- onMousedown: n[3] ||= J(() => {}, ["stop"])
529
+ style: F(j.value),
530
+ onMousedown: r[3] ||= q(() => {}, ["stop"])
488
531
  }, [
489
- n[4] ||= A("div", { class: "image-overlay__border" }, null, -1),
532
+ r[4] ||= A("div", { class: "image-overlay__border" }, null, -1),
490
533
  A("div", {
491
534
  class: "image-overlay__body",
492
- style: F({ cursor: c.value ? "grabbing" : "grab" }),
493
- onMousedown: n[0] ||= J((e) => me(e), ["prevent", "stop"]),
494
- onContextmenu: n[1] ||= J((e) => t.$emit("context-menu", e), ["prevent", "stop"])
535
+ style: F({ cursor: s.value ? "grabbing" : "grab" }),
536
+ onMousedown: r[0] ||= q((e) => ge(e), ["prevent", "stop"]),
537
+ onContextmenu: r[1] ||= q((e) => t.$emit("context-menu", e), ["prevent", "stop"])
495
538
  }, null, 36),
496
- (R(!0), k(T, null, B(ae.value, (e) => (R(), k("div", {
539
+ (L(!0), k(w, null, ue(M.value, (e) => (L(), k("div", {
497
540
  key: e.pos,
498
541
  class: "image-overlay__handle",
499
542
  style: F(e.style),
500
543
  "data-handle": e.pos,
501
- onMousedown: J((t) => oe(t, e.pos), ["prevent", "stop"])
502
- }, null, 44, qt))), 128)),
503
- n[5] ||= A("div", { class: "image-overlay__rotate-line" }, null, -1),
544
+ onMousedown: q((t) => N(t, e.pos), ["prevent", "stop"])
545
+ }, null, 44, ln))), 128)),
546
+ r[5] ||= A("div", { class: "image-overlay__rotate-line" }, null, -1),
504
547
  A("div", {
505
548
  class: "image-overlay__rotate-handle",
506
- style: F({ left: `${E.value / 2 - 7}px` }),
507
- title: U(r)("imageOverlay.rotate"),
508
- onMousedown: n[2] ||= J((e) => fe(e), ["prevent", "stop"])
509
- }, null, 44, Jt),
510
- s.value ? (R(), k("div", Yt, H(Math.round(u.value)) + " × " + H(Math.round(d.value)), 1)) : O("", !0),
511
- l.value ? (R(), k("div", Xt, H(Math.round(f.value)) + "° ", 1)) : O("", !0)
549
+ style: F({ left: `${ie.value / 2 - 7}px` }),
550
+ title: B(n)("imageOverlay.rotate"),
551
+ onMousedown: r[2] ||= q((e) => he(e), ["prevent", "stop"])
552
+ }, null, 44, un),
553
+ o.value ? (L(), k("div", dn, z(Math.round(l.value)) + " × " + z(Math.round(u.value)), 1)) : O("", !0),
554
+ c.value ? (L(), k("div", fn, z(Math.round(f.value)) + "° ", 1)) : O("", !0)
512
555
  ], 36)) : O("", !0);
513
556
  }
514
- }), [["__scopeId", "data-v-503209ad"]]), en = { class: "doc-outline__header" }, tn = { class: "doc-outline__body" }, nn = {
557
+ }), [["__scopeId", "data-v-a3e3aca1"]]), vn = { class: "doc-outline__header" }, yn = { class: "doc-outline__body" }, bn = {
515
558
  key: 0,
516
559
  class: "doc-outline__empty"
517
- }, rn = ["onMousedown"], an = /* @__PURE__ */ x(/* @__PURE__ */ N({
560
+ }, xn = ["onMousedown"], Sn = /* @__PURE__ */ b(/* @__PURE__ */ N({
518
561
  __name: "DocumentOutline",
519
562
  props: {
520
563
  isOpen: { type: Boolean },
@@ -522,28 +565,28 @@ var Kt = /* @__PURE__ */ N({
522
565
  },
523
566
  emits: ["close", "navigate"],
524
567
  setup(e) {
525
- return (t, n) => e.isOpen ? (R(), k("nav", {
568
+ return (t, n) => e.isOpen ? (L(), k("nav", {
526
569
  key: 0,
527
570
  class: "doc-outline",
528
571
  role: "navigation",
529
572
  "aria-label": "Document outline",
530
- onMousedown: n[1] ||= J(() => {}, ["stop"])
531
- }, [A("div", en, [A("button", {
573
+ onMousedown: n[1] ||= q(() => {}, ["stop"])
574
+ }, [A("div", vn, [A("button", {
532
575
  class: "doc-outline__back",
533
576
  title: "Close outline",
534
577
  "aria-label": "Close outline",
535
578
  onClick: n[0] ||= (e) => t.$emit("close")
536
- }, [M(c, {
579
+ }, [M(r, {
537
580
  name: "arrow_back",
538
581
  size: 20
539
- })]), n[2] ||= A("span", { class: "doc-outline__title" }, "Document Outline", -1)]), A("div", tn, [e.headings.length === 0 ? (R(), k("div", nn, " No headings found ")) : O("", !0), (R(!0), k(T, null, B(e.headings, (e, n) => (R(), k("button", {
582
+ })]), n[2] ||= A("span", { class: "doc-outline__title" }, "Document Outline", -1)]), A("div", yn, [e.headings.length === 0 ? (L(), k("div", bn, " No headings found ")) : O("", !0), (L(!0), k(w, null, ue(e.headings, (e, n) => (L(), k("button", {
540
583
  key: n,
541
584
  class: "doc-outline__item",
542
585
  style: F({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
543
- onMousedown: J((n) => t.$emit("navigate", e.pmPos), ["prevent"])
544
- }, H(e.text || "(untitled)"), 45, rn))), 128))])], 32)) : O("", !0);
586
+ onMousedown: q((n) => t.$emit("navigate", e.pmPos), ["prevent"])
587
+ }, z(e.text || "(untitled)"), 45, xn))), 128))])], 32)) : O("", !0);
545
588
  }
546
- }), [["__scopeId", "data-v-cb2cdc39"]]), on = /* @__PURE__ */ x(/* @__PURE__ */ N({
589
+ }), [["__scopeId", "data-v-d3dae0f1"]]), Cn = /* @__PURE__ */ b(/* @__PURE__ */ N({
547
590
  __name: "PageIndicator",
548
591
  props: {
549
592
  currentPage: {},
@@ -551,21 +594,21 @@ var Kt = /* @__PURE__ */ N({
551
594
  visible: { type: Boolean }
552
595
  },
553
596
  setup(e) {
554
- let { t } = n();
555
- return (n, r) => (R(), k("div", {
597
+ let { t } = d();
598
+ return (n, r) => (L(), k("div", {
556
599
  class: "docx-editor-vue__page-indicator",
557
600
  style: F({ opacity: +!!e.visible }),
558
601
  "aria-live": "polite",
559
602
  role: "status"
560
- }, H(U(t)("viewer.pageIndicator", {
603
+ }, z(B(t)("viewer.pageIndicator", {
561
604
  current: e.currentPage,
562
605
  total: e.totalPages
563
606
  })), 5));
564
607
  }
565
- }), [["__scopeId", "data-v-d117bf6e"]]), sn = { class: "hf-editor__label" }, cn = {
608
+ }), [["__scopeId", "data-v-877b9ee2"]]), wn = { class: "hf-editor__label" }, Tn = {
566
609
  class: "hf-editor__actions",
567
610
  style: { position: "relative" }
568
- }, ln = /* @__PURE__ */ x(/* @__PURE__ */ N({
611
+ }, En = /* @__PURE__ */ b(/* @__PURE__ */ N({
569
612
  __name: "InlineHeaderFooterEditor",
570
613
  props: {
571
614
  isOpen: { type: Boolean },
@@ -579,11 +622,11 @@ var Kt = /* @__PURE__ */ N({
579
622
  "remove"
580
623
  ],
581
624
  setup(e, { emit: t }) {
582
- let n = e, r = t, i = z({}), a = z(!1);
625
+ let n = e, r = t, i = R({}), a = R(!1);
583
626
  function o(e) {
584
627
  let t = n.view;
585
628
  if (!t) return;
586
- let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = je.nodes.field.create({
629
+ let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = Ne.nodes.field.create({
587
630
  fieldType: e,
588
631
  instruction: ` ${e} \\* MERGEFORMAT `,
589
632
  fieldKind: "simple",
@@ -603,34 +646,34 @@ var Kt = /* @__PURE__ */ N({
603
646
  pointerEvents: "none"
604
647
  });
605
648
  }
606
- K(() => n.isOpen, (e) => {
649
+ U(() => n.isOpen, (e) => {
607
650
  e && (s(), n.view?.focus());
608
- }), K(() => n.targetRect, () => {
651
+ }), U(() => n.targetRect, () => {
609
652
  n.isOpen && s();
610
653
  }, { deep: !0 });
611
654
  function c() {
612
- n.view && (r("save", it(n.view.state.doc)), r("close"));
655
+ n.view && (r("save", dt(n.view.state.doc)), r("close"));
613
656
  }
614
- return (t, n) => e.isOpen ? (R(), k("div", {
657
+ return (t, n) => e.isOpen ? (L(), k("div", {
615
658
  key: 0,
616
659
  class: "hf-editor",
617
660
  style: F(i.value)
618
661
  }, [A("div", {
619
- class: P(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
620
- onMousedown: n[8] ||= J(() => {}, ["stop"]),
621
- onContextmenu: n[9] ||= J(() => {}, ["stop"])
622
- }, [A("span", sn, H(e.position === "header" ? "Header" : "Footer"), 1), A("div", cn, [
662
+ class: ce(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
663
+ onMousedown: n[8] ||= q(() => {}, ["stop"]),
664
+ onContextmenu: n[9] ||= q(() => {}, ["stop"])
665
+ }, [A("span", wn, z(e.position === "header" ? "Header" : "Footer"), 1), A("div", Tn, [
623
666
  A("button", {
624
667
  class: "hf-editor__btn",
625
668
  title: "Options",
626
- onMousedown: n[0] ||= J(() => {}, ["prevent"]),
669
+ onMousedown: n[0] ||= q(() => {}, ["prevent"]),
627
670
  onClick: n[1] ||= (e) => a.value = !a.value
628
671
  }, " Options ▾ ", 32),
629
- a.value ? (R(), k("div", {
672
+ a.value ? (L(), k("div", {
630
673
  key: 0,
631
674
  class: "hf-editor__dropdown",
632
- onMousedown: n[4] ||= J(() => {}, ["stop"]),
633
- onContextmenu: n[5] ||= J(() => {}, ["stop"])
675
+ onMousedown: n[4] ||= q(() => {}, ["stop"]),
676
+ onContextmenu: n[5] ||= q(() => {}, ["stop"])
634
677
  }, [A("button", {
635
678
  type: "button",
636
679
  class: "hf-editor__dropdown-item",
@@ -647,24 +690,24 @@ var Kt = /* @__PURE__ */ N({
647
690
  A("button", {
648
691
  class: "hf-editor__btn",
649
692
  title: "Remove",
650
- onMousedown: n[6] ||= J((e) => t.$emit("remove"), ["prevent"])
693
+ onMousedown: n[6] ||= q((e) => t.$emit("remove"), ["prevent"])
651
694
  }, " Remove ", 32),
652
695
  A("button", {
653
696
  class: "hf-editor__btn hf-editor__btn--primary",
654
697
  title: "Save",
655
- onMousedown: J(c, ["prevent"])
698
+ onMousedown: q(c, ["prevent"])
656
699
  }, " Save ", 32),
657
700
  A("button", {
658
701
  class: "hf-editor__btn",
659
702
  title: "Cancel",
660
- onMousedown: n[7] ||= J((e) => t.$emit("close"), ["prevent"])
703
+ onMousedown: n[7] ||= q((e) => t.$emit("close"), ["prevent"])
661
704
  }, " Cancel ", 32)
662
705
  ])], 34)], 4)) : O("", !0);
663
706
  }
664
- }), [["__scopeId", "data-v-e93a9f94"]]), un = ["role"], dn = {
707
+ }), [["__scopeId", "data-v-81468575"]]), Dn = ["role"], On = {
665
708
  key: 0,
666
709
  class: "layout-sdt-widget-empty"
667
- }, fn = ["aria-selected", "onClick"], pn = ["value"], mn = /* @__PURE__ */ N({
710
+ }, kn = ["aria-selected", "onClick"], An = ["value"], jn = ".layout-sdt-widget, .layout-inline-sdt-widget", Mn = /* @__PURE__ */ N({
668
711
  __name: "ContentControlWidgets",
669
712
  props: {
670
713
  container: {},
@@ -675,130 +718,144 @@ var Kt = /* @__PURE__ */ N({
675
718
  let t = /^sdt@(\d+)$/.exec(e ?? "");
676
719
  return t ? Number(t[1]) : null;
677
720
  }
678
- let n = e, r = z(null), i = z(null);
679
- function a(e, t) {
680
- let i = n.view;
681
- if (i) try {
682
- i.dispatch(Z(i.state, { tag: e }, t)), i.focus();
721
+ function n(e) {
722
+ if (e == null || e === "") return null;
723
+ let t = Number(e);
724
+ return Number.isFinite(t) ? t : null;
725
+ }
726
+ function r(e) {
727
+ let r = t(e.dataset.sdtGroupId) ?? n(e.dataset.sdtPos), i = e.dataset.sdtTag;
728
+ return r == null ? i ? { tag: i } : null : i ? {
729
+ pos: r,
730
+ tag: i
731
+ } : { pos: r };
732
+ }
733
+ let i = e, a = R(null), o = R(null);
734
+ function s(e, t) {
735
+ let n = i.view;
736
+ if (n) try {
737
+ let r = e.pos == null ? e.tag ? Ie(n.state, { tag: e.tag }, t) : null : Fe(n.state, e.pos, t);
738
+ if (!r) return;
739
+ n.dispatch(r), n.focus();
683
740
  } catch {}
684
- r.value = null;
741
+ a.value = null;
685
742
  }
686
- function o(e) {
687
- let r = n.view, i = t(e.dataset.sdtGroupId);
688
- if (!(!r || i == null)) try {
689
- let t = e.dataset.sdtRepeat === "add" ? Te(r.state, i) : Ae(r.state, i);
690
- r.dispatch(t), r.focus();
743
+ function c(e) {
744
+ let n = i.view, r = t(e.dataset.sdtGroupId);
745
+ if (!(!n || r == null)) try {
746
+ let t = e.dataset.sdtRepeat === "add" ? Oe(n.state, r) : Z(n.state, r);
747
+ n.dispatch(t), n.focus();
691
748
  } catch {}
692
749
  }
693
- function s(e) {
750
+ function l(e) {
694
751
  let t = e.target;
695
- (t?.closest?.(".layout-sdt-widget") || t?.closest?.(".layout-sdt-repeat-btn")) && e.preventDefault();
752
+ (t?.closest?.(jn) || t?.closest?.(".layout-sdt-repeat-btn")) && e.preventDefault();
696
753
  }
697
- function c(e) {
698
- let t = n.view, i = e.dataset.sdtTag, o = e.dataset.sdtWidget;
699
- if (!t || !i || !o) return;
700
- let s = Oe(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
701
- o === "checkbox" ? a(i, {
754
+ function u(e) {
755
+ let t = i.view, n = e.dataset.sdtWidget, o = r(e);
756
+ if (!t || !n || !o) return;
757
+ let c = o.pos == null ? o.tag ? je(t.state.doc, { tag: o.tag })[0] : void 0 : je(t.state.doc).find((e) => e.pos === o.pos), l = e.getBoundingClientRect();
758
+ n === "checkbox" ? s(o, {
702
759
  kind: "checkbox",
703
- checked: !s?.checked
704
- }) : o === "dropdown" ? r.value = {
760
+ checked: !c?.checked
761
+ }) : n === "dropdown" ? a.value = {
705
762
  kind: "dropdown",
706
- tag: i,
707
- items: s?.listItems ?? [],
708
- current: s?.text ?? "",
709
- x: c.left,
710
- y: c.bottom + 2
711
- } : o === "date" && (r.value = {
763
+ target: o,
764
+ items: c?.listItems ?? [],
765
+ current: c?.text ?? "",
766
+ x: l.left,
767
+ y: l.bottom + 2
768
+ } : n === "date" && (a.value = {
712
769
  kind: "date",
713
- tag: i,
714
- current: s?.dateValue ?? "",
715
- x: c.left,
716
- y: c.bottom + 2
770
+ target: o,
771
+ current: c?.dateValue ?? "",
772
+ x: l.left,
773
+ y: l.bottom + 2
717
774
  });
718
775
  }
719
- function l(e) {
776
+ function d(e) {
720
777
  let t = e.target?.closest?.(".layout-sdt-repeat-btn");
721
778
  if (t) {
722
- e.preventDefault(), e.stopPropagation(), o(t);
779
+ e.preventDefault(), e.stopPropagation(), c(t);
723
780
  return;
724
781
  }
725
- let n = e.target?.closest?.(".layout-sdt-widget");
726
- n && (e.preventDefault(), e.stopPropagation(), c(n));
782
+ let n = e.target?.closest?.(jn);
783
+ n && (e.preventDefault(), e.stopPropagation(), u(n));
727
784
  }
728
- function u(e) {
785
+ function f(e) {
729
786
  if (e.key !== "Enter" && e.key !== " ") return;
730
- let t = e.target?.closest?.(".layout-sdt-widget");
731
- t && (e.preventDefault(), c(t));
787
+ let t = e.target?.closest?.(jn);
788
+ t && (e.preventDefault(), u(t));
732
789
  }
733
- function d(e) {
734
- r.value && !i.value?.contains(e.target) && (r.value = null);
790
+ function p(e) {
791
+ a.value && !o.value?.contains(e.target) && (a.value = null);
735
792
  }
736
- function f(e) {
737
- e.key === "Escape" && (r.value = null);
793
+ function m(e) {
794
+ e.key === "Escape" && (a.value = null);
738
795
  }
739
- let p = null;
740
- K(() => n.container, (e) => {
741
- p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), p = e ?? null, p && (p.addEventListener("mousedown", s), p.addEventListener("click", l), p.addEventListener("keydown", u));
742
- }, { immediate: !0 }), K(r, (e) => {
743
- e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && le(() => {
744
- let e = i.value?.querySelectorAll(".layout-sdt-widget-option");
796
+ let h = null;
797
+ U(() => i.container, (e) => {
798
+ h && (h.removeEventListener("mousedown", l), h.removeEventListener("click", d), h.removeEventListener("keydown", f)), h = e ?? null, h && (h.addEventListener("mousedown", l), h.addEventListener("click", d), h.addEventListener("keydown", f));
799
+ }, { immediate: !0 }), U(a, (e) => {
800
+ e ? (document.addEventListener("mousedown", p), document.addEventListener("keydown", m), e.kind === "dropdown" && se(() => {
801
+ let e = o.value?.querySelectorAll(".layout-sdt-widget-option");
745
802
  e?.length && ([...e].find((e) => e.getAttribute("aria-selected") === "true") ?? e[0]).focus();
746
- })) : (document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f));
803
+ })) : (document.removeEventListener("mousedown", p), document.removeEventListener("keydown", m));
747
804
  });
748
- function m(e) {
805
+ function g(e) {
749
806
  if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
750
- let t = [...i.value?.querySelectorAll(".layout-sdt-widget-option") ?? []];
807
+ let t = [...o.value?.querySelectorAll(".layout-sdt-widget-option") ?? []];
751
808
  if (!t.length) return;
752
809
  e.preventDefault();
753
810
  let n = t.indexOf(document.activeElement);
754
811
  t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length].focus();
755
812
  }
756
813
  I(() => {
757
- p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f);
814
+ h && (h.removeEventListener("mousedown", l), h.removeEventListener("click", d), h.removeEventListener("keydown", f)), document.removeEventListener("mousedown", p), document.removeEventListener("keydown", m);
758
815
  });
759
- function h(e) {
816
+ function _(e) {
760
817
  let t = e.target.value;
761
- t && r.value && a(r.value.tag, {
818
+ t && a.value && s(a.value.target, {
762
819
  kind: "date",
763
820
  date: t
764
821
  });
765
822
  }
766
- return (e, t) => r.value ? (R(), k("div", {
823
+ return (e, t) => a.value ? (L(), k("div", {
767
824
  key: 0,
768
825
  ref_key: "popupEl",
769
- ref: i,
826
+ ref: o,
770
827
  class: "layout-sdt-widget-popup",
771
- role: r.value.kind === "dropdown" ? "listbox" : void 0,
828
+ role: a.value.kind === "dropdown" ? "listbox" : void 0,
772
829
  style: F({
773
830
  position: "fixed",
774
- top: r.value.y + "px",
775
- left: r.value.x + "px",
831
+ top: a.value.y + "px",
832
+ left: a.value.x + "px",
776
833
  zIndex: 1e3
777
834
  }),
778
- onKeydown: m,
779
- onMousedown: t[0] ||= J(() => {}, ["prevent"])
780
- }, [r.value.kind === "dropdown" ? (R(), k(T, { key: 0 }, [r.value.items.length === 0 ? (R(), k("div", dn, "No options")) : O("", !0), (R(!0), k(T, null, B(r.value.items, (e) => (R(), k("button", {
835
+ onKeydown: g,
836
+ onMousedown: t[0] ||= q(() => {}, ["prevent"])
837
+ }, [a.value.kind === "dropdown" ? (L(), k(w, { key: 0 }, [a.value.items.length === 0 ? (L(), k("div", On, "No options")) : O("", !0), (L(!0), k(w, null, ue(a.value.items, (e) => (L(), k("button", {
781
838
  key: e.value,
782
839
  type: "button",
783
840
  role: "option",
784
- "aria-selected": e.displayText === r.value.current,
785
- class: P(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
786
- onClick: (t) => a(r.value.tag, {
841
+ "aria-selected": e.displayText === a.value.current,
842
+ class: ce(["layout-sdt-widget-option", { "is-selected": e.displayText === a.value.current }]),
843
+ onClick: (t) => s(a.value.target, {
787
844
  kind: "dropdown",
788
845
  value: e.value
789
846
  })
790
- }, H(e.displayText), 11, fn))), 128))], 64)) : (R(), k("input", {
847
+ }, z(e.displayText), 11, kn))), 128))], 64)) : (L(), k("input", {
791
848
  key: 1,
792
849
  type: "date",
793
850
  class: "layout-sdt-widget-date",
794
- value: r.value.current,
795
- onChange: h
796
- }, null, 40, pn))], 44, un)) : O("", !0);
851
+ value: a.value.current,
852
+ onChange: _
853
+ }, null, 40, An))], 44, Dn)) : O("", !0);
797
854
  }
798
- }), hn = {
855
+ }), Nn = {
799
856
  key: 0,
800
857
  class: "docx-editor-vue__title-bar"
801
- }, gn = { class: "docx-editor-vue__title-bar-left" }, _n = { class: "docx-editor-vue__title-bar-center" }, vn = { class: "docx-editor-vue__title-bar-right" }, yn = /* @__PURE__ */ N({
858
+ }, Pn = { class: "docx-editor-vue__title-bar-left" }, Fn = { class: "docx-editor-vue__title-bar-center" }, In = { class: "docx-editor-vue__title-bar-right" }, Ln = /* @__PURE__ */ N({
802
859
  __name: "DocxEditorMenuBar",
803
860
  props: {
804
861
  showMenuBar: { type: Boolean },
@@ -817,72 +874,69 @@ var Kt = /* @__PURE__ */ N({
817
874
  ],
818
875
  setup(e, { emit: t }) {
819
876
  let n = t;
820
- return (t, r) => e.showMenuBar ? (R(), k("div", hn, [
821
- A("div", gn, [e.renderLogo ? (R(), ie(ue(e.renderLogo), { key: 0 })) : O("", !0), V(t.$slots, "title-bar-left")]),
822
- A("div", _n, [M(g, {
877
+ return (t, r) => e.showMenuBar ? (L(), k("div", Nn, [
878
+ A("div", Pn, [e.renderLogo ? (L(), D(fe(e.renderLogo), { key: 0 })) : O("", !0), de(t.$slots, "title-bar-left")]),
879
+ A("div", Fn, [M(h, {
823
880
  "model-value": e.documentName,
824
881
  editable: e.documentNameEditable,
825
882
  "onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
826
- }, null, 8, ["model-value", "editable"]), M(y, {
883
+ }, null, 8, ["model-value", "editable"]), M(v, {
827
884
  onAction: r[1] ||= (e) => n("menu-action", e),
828
885
  onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
829
886
  })]),
830
- A("div", vn, [V(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (R(), ie(ue(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
887
+ A("div", In, [de(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), D(fe(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
831
888
  ])) : O("", !0);
832
889
  }
833
- }), bn = ["aria-label"], xn = { class: "wm-header" }, Sn = { class: "wm-body" }, Cn = { class: "wm-radio-row" }, wn = ["checked"], Tn = {
890
+ }), Rn = ["aria-label"], $ = { class: "wm-header" }, zn = { class: "wm-body" }, Bn = { class: "wm-radio-row" }, Vn = ["checked"], Hn = {
834
891
  for: "wm-none",
835
892
  class: "wm-inline-label"
836
- }, En = { class: "wm-radio-row" }, Dn = ["checked"], On = {
893
+ }, Un = { class: "wm-radio-row" }, Wn = ["checked"], Gn = {
837
894
  for: "wm-picture",
838
895
  class: "wm-inline-label"
839
- }, kn = {
896
+ }, Kn = {
840
897
  key: 0,
841
898
  class: "wm-subform"
842
- }, An = { class: "wm-row" }, jn = {
899
+ }, qn = { class: "wm-row" }, Jn = {
843
900
  key: 0,
844
901
  class: "wm-row"
845
- }, Mn = ["src"], Nn = { class: "wm-row" }, $ = { class: "wm-label" }, Pn = { class: "wm-inline-label" }, Fn = { class: "wm-radio-row" }, In = ["checked"], Ln = {
902
+ }, Yn = ["src"], Xn = { class: "wm-row" }, Zn = { class: "wm-label" }, Qn = { class: "wm-inline-label" }, $n = { class: "wm-radio-row" }, er = ["checked"], tr = {
846
903
  for: "wm-text",
847
904
  class: "wm-inline-label"
848
- }, Rn = {
905
+ }, nr = {
849
906
  key: 1,
850
907
  class: "wm-subform"
851
- }, zn = { class: "wm-row" }, Bn = { class: "wm-label" }, Vn = ["value"], Hn = ["value"], Un = { class: "wm-row" }, Wn = { class: "wm-label" }, Gn = { class: "wm-row" }, Kn = { class: "wm-label" }, qn = ["value"], Jn = { class: "wm-row" }, Yn = { class: "wm-label" }, Xn = { class: "wm-inline-label" }, Zn = { class: "wm-row" }, Qn = { class: "wm-label" }, $n = { class: "wm-row" }, er = { class: "wm-label" }, tr = { class: "wm-inline-label" }, nr = ["checked"], rr = { class: "wm-inline-label" }, ir = ["checked"], ar = { class: "wm-inline-label" }, or = { class: "wm-footer" }, sr = ["disabled"], cr = /* @__PURE__ */ x(/* @__PURE__ */ N({
908
+ }, rr = {
909
+ key: 0,
910
+ class: "wm-row"
911
+ }, ir = { class: "wm-label" }, ar = ["value"], or = ["value"], sr = { class: "wm-row" }, cr = { class: "wm-label" }, lr = { class: "wm-row" }, ur = { class: "wm-label" }, dr = ["value"], fr = { class: "wm-row" }, pr = { class: "wm-label" }, mr = { class: "wm-inline-label" }, hr = { class: "wm-row" }, gr = { class: "wm-label" }, _r = { class: "wm-row" }, vr = { class: "wm-label" }, yr = { class: "wm-inline-label" }, br = ["checked"], xr = { class: "wm-inline-label" }, Sr = ["checked"], Cr = { class: "wm-inline-label" }, wr = { class: "wm-footer" }, Tr = ["disabled"], Er = /* @__PURE__ */ b(/* @__PURE__ */ N({
852
912
  __name: "WatermarkDialog",
853
913
  props: {
854
914
  isOpen: { type: Boolean },
855
- current: {}
915
+ current: {},
916
+ presets: { default: () => pt }
856
917
  },
857
918
  emits: ["close", "apply"],
858
919
  setup(e, { emit: t }) {
859
- let r = [
860
- "CONFIDENTIAL",
861
- "DRAFT",
862
- "DO NOT COPY",
863
- "SAMPLE",
864
- "URGENT",
865
- "ASAP"
866
- ], i = [
920
+ let n = [
867
921
  "Calibri",
868
922
  "Arial",
869
923
  "Times New Roman",
870
924
  "Georgia",
871
925
  "Verdana",
872
926
  "Courier New"
873
- ], { t: a } = n(), o = e, s = t, c = z("none"), l = z("CONFIDENTIAL"), u = z("Calibri"), d = z(!0), f = z(54), p = z("#C0C0C0"), m = z("diagonal"), h = z(!0), g = z(void 0), _ = z(void 0), v = z(100), y = z(!0);
874
- K(() => o.isOpen, (e) => {
927
+ ], { t: r } = d(), i = e, a = E(() => i.presets), o = t, s = R("none"), c = R(i.presets[0] ?? "CONFIDENTIAL"), l = R("Calibri"), u = R(!0), f = R(54), p = R("#C0C0C0"), m = R("diagonal"), h = R(!0), g = R(void 0), _ = R(void 0), v = R(100), y = R(!0);
928
+ U(() => i.isOpen, (e) => {
875
929
  if (!e) return;
876
- let t = o.current;
877
- t?.kind === "text" ? (c.value = "text", l.value = t.text, u.value = t.font || "Calibri", d.value = t.fontSize === void 0, t.fontSize !== void 0 && (f.value = t.fontSize), p.value = t.color || "#C0C0C0", m.value = t.layout, h.value = t.semitransparent) : t?.kind === "picture" ? (c.value = "picture", g.value = t.dataUrl, _.value = t.widthEmu !== void 0 && t.heightEmu !== void 0 ? {
930
+ let t = i.current;
931
+ t?.kind === "text" ? (s.value = "text", c.value = t.text, l.value = t.font || "Calibri", u.value = t.fontSize === void 0, t.fontSize !== void 0 && (f.value = t.fontSize), p.value = t.color || "#C0C0C0", m.value = t.layout, h.value = t.semitransparent) : t?.kind === "picture" ? (s.value = "picture", g.value = t.dataUrl, _.value = t.widthEmu !== void 0 && t.heightEmu !== void 0 ? {
878
932
  widthEmu: t.widthEmu,
879
933
  heightEmu: t.heightEmu
880
- } : void 0, v.value = Math.round((t.scale || 1) * 100), y.value = t.washout) : c.value = "none";
934
+ } : void 0, v.value = Math.round((t.scale || 1) * 100), y.value = t.washout) : s.value = "none";
881
935
  }, { immediate: !0 });
882
- let b = D(() => c.value === "picture" && !g.value);
936
+ let b = E(() => s.value === "picture" && !g.value);
883
937
  function x(e) {
884
938
  let t = e.target.value;
885
- t && (l.value = t);
939
+ t && (c.value = t);
886
940
  }
887
941
  function S(e) {
888
942
  let t = e.target.files?.[0];
@@ -893,27 +947,27 @@ var Kt = /* @__PURE__ */ N({
893
947
  if (g.value = e, _.value = void 0, !e) return;
894
948
  let t = new Image();
895
949
  t.onload = () => {
896
- _.value = ot(t.naturalWidth, t.naturalHeight);
950
+ _.value = mt(t.naturalWidth, t.naturalHeight);
897
951
  }, t.src = e;
898
952
  }, n.readAsDataURL(t);
899
953
  }
900
954
  function C() {
901
- s("close");
955
+ o("close");
902
956
  }
903
957
  function ee() {
904
- if (c.value === "none") s("apply", null);
905
- else if (c.value === "text") s("apply", {
958
+ if (s.value === "none") o("apply", null);
959
+ else if (s.value === "text") o("apply", {
906
960
  kind: "text",
907
- text: l.value,
908
- font: u.value,
961
+ text: c.value,
962
+ font: l.value,
909
963
  color: p.value,
910
964
  semitransparent: h.value,
911
965
  layout: m.value,
912
- fontSize: d.value ? void 0 : f.value
966
+ fontSize: u.value ? void 0 : f.value
913
967
  });
914
968
  else {
915
969
  if (!g.value) return;
916
- s("apply", {
970
+ o("apply", {
917
971
  kind: "picture",
918
972
  dataUrl: g.value,
919
973
  scale: v.value / 100,
@@ -926,147 +980,147 @@ var Kt = /* @__PURE__ */ N({
926
980
  function te(e) {
927
981
  e.key === "Escape" && C();
928
982
  }
929
- return (t, n) => e.isOpen ? (R(), k("div", {
983
+ return (t, i) => e.isOpen ? (L(), k("div", {
930
984
  key: 0,
931
985
  class: "wm-overlay",
932
- onMousedown: J(C, ["self"]),
986
+ onMousedown: q(C, ["self"]),
933
987
  onKeydown: te
934
988
  }, [A("div", {
935
989
  class: "wm-dialog",
936
990
  role: "dialog",
937
- "aria-label": U(a)("dialogs.watermark.title"),
938
- onMousedown: n[13] ||= J(() => {}, ["stop"])
991
+ "aria-label": B(r)("dialogs.watermark.title"),
992
+ onMousedown: i[13] ||= q(() => {}, ["stop"])
939
993
  }, [
940
- A("div", xn, H(U(a)("dialogs.watermark.title")), 1),
941
- A("div", Sn, [
942
- A("div", Cn, [A("input", {
994
+ A("div", $, z(B(r)("dialogs.watermark.title")), 1),
995
+ A("div", zn, [
996
+ A("div", Bn, [A("input", {
943
997
  id: "wm-none",
944
998
  type: "radio",
945
- checked: c.value === "none",
946
- onChange: n[0] ||= (e) => c.value = "none"
947
- }, null, 40, wn), A("label", Tn, H(U(a)("dialogs.watermark.noWatermark")), 1)]),
948
- A("div", En, [A("input", {
999
+ checked: s.value === "none",
1000
+ onChange: i[0] ||= (e) => s.value = "none"
1001
+ }, null, 40, Vn), A("label", Hn, z(B(r)("dialogs.watermark.noWatermark")), 1)]),
1002
+ A("div", Un, [A("input", {
949
1003
  id: "wm-picture",
950
1004
  type: "radio",
951
- checked: c.value === "picture",
952
- onChange: n[1] ||= (e) => c.value = "picture"
953
- }, null, 40, Dn), A("label", On, H(U(a)("dialogs.watermark.picture")), 1)]),
954
- c.value === "picture" ? (R(), k("div", kn, [
955
- A("div", An, [A("input", {
1005
+ checked: s.value === "picture",
1006
+ onChange: i[1] ||= (e) => s.value = "picture"
1007
+ }, null, 40, Wn), A("label", Gn, z(B(r)("dialogs.watermark.picture")), 1)]),
1008
+ s.value === "picture" ? (L(), k("div", Kn, [
1009
+ A("div", qn, [A("input", {
956
1010
  type: "file",
957
1011
  accept: "image/*",
958
1012
  onChange: S
959
1013
  }, null, 32)]),
960
- g.value ? (R(), k("div", jn, [A("img", {
1014
+ g.value ? (L(), k("div", Jn, [A("img", {
961
1015
  src: g.value,
962
1016
  alt: "",
963
1017
  class: "wm-preview"
964
- }, null, 8, Mn)])) : O("", !0),
965
- A("div", Nn, [
966
- A("span", $, H(U(a)("dialogs.watermark.scale")), 1),
967
- q(A("input", {
1018
+ }, null, 8, Yn)])) : O("", !0),
1019
+ A("div", Xn, [
1020
+ A("span", Zn, z(B(r)("dialogs.watermark.scale")), 1),
1021
+ G(A("input", {
968
1022
  class: "wm-input wm-input--narrow",
969
1023
  type: "number",
970
1024
  min: "10",
971
1025
  max: "500",
972
- "onUpdate:modelValue": n[2] ||= (e) => v.value = e
1026
+ "onUpdate:modelValue": i[2] ||= (e) => v.value = e
973
1027
  }, null, 512), [[
974
- G,
1028
+ H,
975
1029
  v.value,
976
1030
  void 0,
977
1031
  { number: !0 }
978
1032
  ]]),
979
- n[14] ||= A("span", { class: "wm-unit" }, "%", -1)
1033
+ i[14] ||= A("span", { class: "wm-unit" }, "%", -1)
980
1034
  ]),
981
- A("label", Pn, [q(A("input", {
1035
+ A("label", Qn, [G(A("input", {
982
1036
  type: "checkbox",
983
- "onUpdate:modelValue": n[3] ||= (e) => y.value = e
984
- }, null, 512), [[W, y.value]]), j(" " + H(U(a)("dialogs.watermark.washout")), 1)])
1037
+ "onUpdate:modelValue": i[3] ||= (e) => y.value = e
1038
+ }, null, 512), [[V, y.value]]), j(" " + z(B(r)("dialogs.watermark.washout")), 1)])
985
1039
  ])) : O("", !0),
986
- A("div", Fn, [A("input", {
1040
+ A("div", $n, [A("input", {
987
1041
  id: "wm-text",
988
1042
  type: "radio",
989
- checked: c.value === "text",
990
- onChange: n[4] ||= (e) => c.value = "text"
991
- }, null, 40, In), A("label", Ln, H(U(a)("dialogs.watermark.text")), 1)]),
992
- c.value === "text" ? (R(), k("div", Rn, [
993
- A("div", zn, [A("span", Bn, H(U(a)("dialogs.watermark.presetLabel")), 1), A("select", {
1043
+ checked: s.value === "text",
1044
+ onChange: i[4] ||= (e) => s.value = "text"
1045
+ }, null, 40, er), A("label", tr, z(B(r)("dialogs.watermark.text")), 1)]),
1046
+ s.value === "text" ? (L(), k("div", nr, [
1047
+ a.value.length > 0 ? (L(), k("div", rr, [A("span", ir, z(B(r)("dialogs.watermark.presetLabel")), 1), A("select", {
994
1048
  class: "wm-input",
995
- value: r.includes(l.value) ? l.value : "",
1049
+ value: a.value.includes(c.value) ? c.value : "",
996
1050
  onChange: x
997
- }, [n[15] ||= A("option", { value: "" }, "—", -1), (R(), k(T, null, B(r, (e) => A("option", {
1051
+ }, [i[15] ||= A("option", { value: "" }, "—", -1), (L(!0), k(w, null, ue(a.value, (e) => (L(), k("option", {
998
1052
  key: e,
999
1053
  value: e
1000
- }, H(e), 9, Hn)), 64))], 40, Vn)]),
1001
- A("div", Un, [A("span", Wn, H(U(a)("dialogs.watermark.textLabel")), 1), q(A("input", {
1054
+ }, z(e), 9, or))), 128))], 40, ar)])) : O("", !0),
1055
+ A("div", sr, [A("span", cr, z(B(r)("dialogs.watermark.textLabel")), 1), G(A("input", {
1002
1056
  class: "wm-input",
1003
- "onUpdate:modelValue": n[5] ||= (e) => l.value = e
1004
- }, null, 512), [[G, l.value]])]),
1005
- A("div", Gn, [A("span", Kn, H(U(a)("dialogs.watermark.fontLabel")), 1), q(A("select", {
1057
+ "onUpdate:modelValue": i[5] ||= (e) => c.value = e
1058
+ }, null, 512), [[H, c.value]])]),
1059
+ A("div", lr, [A("span", ur, z(B(r)("dialogs.watermark.fontLabel")), 1), G(A("select", {
1006
1060
  class: "wm-input",
1007
- "onUpdate:modelValue": n[6] ||= (e) => u.value = e
1008
- }, [(R(), k(T, null, B(i, (e) => A("option", {
1061
+ "onUpdate:modelValue": i[6] ||= (e) => l.value = e
1062
+ }, [(L(), k(w, null, ue(n, (e) => A("option", {
1009
1063
  key: e,
1010
1064
  value: e
1011
- }, H(e), 9, qn)), 64))], 512), [[fe, u.value]])]),
1012
- A("div", Jn, [
1013
- A("span", Yn, H(U(a)("dialogs.watermark.sizeLabel")), 1),
1014
- A("label", Xn, [q(A("input", {
1065
+ }, z(e), 9, dr)), 64))], 512), [[me, l.value]])]),
1066
+ A("div", fr, [
1067
+ A("span", pr, z(B(r)("dialogs.watermark.sizeLabel")), 1),
1068
+ A("label", mr, [G(A("input", {
1015
1069
  type: "checkbox",
1016
- "onUpdate:modelValue": n[7] ||= (e) => d.value = e
1017
- }, null, 512), [[W, d.value]]), j(" " + H(U(a)("dialogs.watermark.sizeAuto")), 1)]),
1018
- d.value ? O("", !0) : q((R(), k("input", {
1070
+ "onUpdate:modelValue": i[7] ||= (e) => u.value = e
1071
+ }, null, 512), [[V, u.value]]), j(" " + z(B(r)("dialogs.watermark.sizeAuto")), 1)]),
1072
+ u.value ? O("", !0) : G((L(), k("input", {
1019
1073
  key: 0,
1020
1074
  class: "wm-input wm-input--narrow",
1021
1075
  type: "number",
1022
1076
  min: "8",
1023
1077
  max: "200",
1024
- "onUpdate:modelValue": n[8] ||= (e) => f.value = e
1078
+ "onUpdate:modelValue": i[8] ||= (e) => f.value = e
1025
1079
  }, null, 512)), [[
1026
- G,
1080
+ H,
1027
1081
  f.value,
1028
1082
  void 0,
1029
1083
  { number: !0 }
1030
1084
  ]])
1031
1085
  ]),
1032
- A("div", Zn, [A("span", Qn, H(U(a)("dialogs.watermark.colorLabel")), 1), q(A("input", {
1086
+ A("div", hr, [A("span", gr, z(B(r)("dialogs.watermark.colorLabel")), 1), G(A("input", {
1033
1087
  type: "color",
1034
- "onUpdate:modelValue": n[9] ||= (e) => p.value = e
1035
- }, null, 512), [[G, p.value]])]),
1036
- A("div", $n, [
1037
- A("span", er, H(U(a)("dialogs.watermark.layoutLabel")), 1),
1038
- A("label", tr, [A("input", {
1088
+ "onUpdate:modelValue": i[9] ||= (e) => p.value = e
1089
+ }, null, 512), [[H, p.value]])]),
1090
+ A("div", _r, [
1091
+ A("span", vr, z(B(r)("dialogs.watermark.layoutLabel")), 1),
1092
+ A("label", yr, [A("input", {
1039
1093
  type: "radio",
1040
1094
  name: "wm-layout",
1041
1095
  checked: m.value === "diagonal",
1042
- onChange: n[10] ||= (e) => m.value = "diagonal"
1043
- }, null, 40, nr), j(" " + H(U(a)("dialogs.watermark.diagonal")), 1)]),
1044
- A("label", rr, [A("input", {
1096
+ onChange: i[10] ||= (e) => m.value = "diagonal"
1097
+ }, null, 40, br), j(" " + z(B(r)("dialogs.watermark.diagonal")), 1)]),
1098
+ A("label", xr, [A("input", {
1045
1099
  type: "radio",
1046
1100
  name: "wm-layout",
1047
1101
  checked: m.value === "horizontal",
1048
- onChange: n[11] ||= (e) => m.value = "horizontal"
1049
- }, null, 40, ir), j(" " + H(U(a)("dialogs.watermark.horizontal")), 1)])
1102
+ onChange: i[11] ||= (e) => m.value = "horizontal"
1103
+ }, null, 40, Sr), j(" " + z(B(r)("dialogs.watermark.horizontal")), 1)])
1050
1104
  ]),
1051
- A("label", ar, [q(A("input", {
1105
+ A("label", Cr, [G(A("input", {
1052
1106
  type: "checkbox",
1053
- "onUpdate:modelValue": n[12] ||= (e) => h.value = e
1054
- }, null, 512), [[W, h.value]]), j(" " + H(U(a)("dialogs.watermark.semitransparent")), 1)])
1107
+ "onUpdate:modelValue": i[12] ||= (e) => h.value = e
1108
+ }, null, 512), [[V, h.value]]), j(" " + z(B(r)("dialogs.watermark.semitransparent")), 1)])
1055
1109
  ])) : O("", !0)
1056
1110
  ]),
1057
- A("div", or, [A("button", {
1111
+ A("div", wr, [A("button", {
1058
1112
  type: "button",
1059
1113
  class: "wm-btn",
1060
1114
  onClick: C
1061
- }, H(U(a)("dialogs.watermark.cancelButton")), 1), A("button", {
1115
+ }, z(B(r)("dialogs.watermark.cancelButton")), 1), A("button", {
1062
1116
  type: "button",
1063
- class: P(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1117
+ class: ce(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
1064
1118
  disabled: b.value,
1065
1119
  onClick: ee
1066
- }, H(U(a)("dialogs.watermark.applyButton")), 11, sr)])
1067
- ], 40, bn)], 32)) : O("", !0);
1120
+ }, z(B(r)("dialogs.watermark.applyButton")), 11, Tr)])
1121
+ ], 40, Rn)], 32)) : O("", !0);
1068
1122
  }
1069
- }), [["__scopeId", "data-v-5edfdc47"]]), lr = /* @__PURE__ */ N({
1123
+ }), [["__scopeId", "data-v-cf7e36c1"]]), Dr = /* @__PURE__ */ N({
1070
1124
  __name: "DocxEditorDialogs",
1071
1125
  props: {
1072
1126
  view: {},
@@ -1075,25 +1129,23 @@ var Kt = /* @__PURE__ */ N({
1075
1129
  sectionProperties: {},
1076
1130
  scrollVisiblePositionIntoView: { type: Function },
1077
1131
  showFindReplace: { type: Boolean },
1078
- showInsertImage: { type: Boolean },
1079
1132
  showHyperlink: { type: Boolean },
1080
1133
  showInsertSymbol: { type: Boolean },
1081
1134
  showImageProperties: { type: Boolean },
1082
1135
  showPageSetup: { type: Boolean },
1083
1136
  showWatermark: { type: Boolean },
1084
1137
  currentWatermark: {},
1138
+ watermarkPresets: {},
1085
1139
  showKeyboardShortcuts: { type: Boolean }
1086
1140
  },
1087
1141
  emits: [
1088
1142
  "update:showFindReplace",
1089
- "update:showInsertImage",
1090
1143
  "update:showHyperlink",
1091
1144
  "update:showInsertSymbol",
1092
1145
  "update:showImageProperties",
1093
1146
  "update:showPageSetup",
1094
1147
  "update:showWatermark",
1095
1148
  "update:showKeyboardShortcuts",
1096
- "insert-image",
1097
1149
  "insert-symbol",
1098
1150
  "hyperlink-submit",
1099
1151
  "hyperlink-remove",
@@ -1102,8 +1154,8 @@ var Kt = /* @__PURE__ */ N({
1102
1154
  ],
1103
1155
  setup(t, { emit: n }) {
1104
1156
  let r = n;
1105
- return (n, a) => (R(), k(T, null, [
1106
- M(u, {
1157
+ return (n, a) => (L(), k(w, null, [
1158
+ M(s, {
1107
1159
  "is-open": t.showFindReplace,
1108
1160
  view: t.view,
1109
1161
  "scroll-visible-position-into-view": t.scrollVisiblePositionIntoView,
@@ -1113,18 +1165,13 @@ var Kt = /* @__PURE__ */ N({
1113
1165
  "view",
1114
1166
  "scroll-visible-position-into-view"
1115
1167
  ]),
1116
- M(s, {
1117
- "is-open": t.showInsertImage,
1118
- onClose: a[1] ||= (e) => r("update:showInsertImage", !1),
1119
- onInsert: a[2] ||= (e) => r("insert-image", e)
1120
- }, null, 8, ["is-open"]),
1121
1168
  M(e, {
1122
1169
  "is-open": t.showHyperlink,
1123
1170
  view: t.view,
1124
1171
  bookmarks: t.bookmarks,
1125
- onClose: a[3] ||= (e) => r("update:showHyperlink", !1),
1126
- onSubmit: a[4] ||= (e) => r("hyperlink-submit", e),
1127
- onRemove: a[5] ||= (e) => r("hyperlink-remove")
1172
+ onClose: a[1] ||= (e) => r("update:showHyperlink", !1),
1173
+ onSubmit: a[2] ||= (e) => r("hyperlink-submit", e),
1174
+ onRemove: a[3] ||= (e) => r("hyperlink-remove")
1128
1175
  }, null, 8, [
1129
1176
  "is-open",
1130
1177
  "view",
@@ -1132,14 +1179,14 @@ var Kt = /* @__PURE__ */ N({
1132
1179
  ]),
1133
1180
  M(i, {
1134
1181
  "is-open": t.showInsertSymbol,
1135
- onClose: a[6] ||= (e) => r("update:showInsertSymbol", !1),
1136
- onInsert: a[7] ||= (e) => r("insert-symbol", e)
1182
+ onClose: a[4] ||= (e) => r("update:showInsertSymbol", !1),
1183
+ onInsert: a[5] ||= (e) => r("insert-symbol", e)
1137
1184
  }, null, 8, ["is-open"]),
1138
- M(l, {
1185
+ M(c, {
1139
1186
  "is-open": t.showImageProperties,
1140
1187
  view: t.view,
1141
1188
  "pm-pos": t.selectedImagePmPos,
1142
- onClose: a[8] ||= (e) => r("update:showImageProperties", !1)
1189
+ onClose: a[6] ||= (e) => r("update:showImageProperties", !1)
1143
1190
  }, null, 8, [
1144
1191
  "is-open",
1145
1192
  "view",
@@ -1148,25 +1195,30 @@ var Kt = /* @__PURE__ */ N({
1148
1195
  M(o, {
1149
1196
  "is-open": t.showPageSetup,
1150
1197
  "section-properties": t.sectionProperties,
1151
- onClose: a[9] ||= (e) => r("update:showPageSetup", !1),
1152
- onApply: a[10] ||= (e) => r("page-setup-apply", e)
1198
+ onClose: a[7] ||= (e) => r("update:showPageSetup", !1),
1199
+ onApply: a[8] ||= (e) => r("page-setup-apply", e)
1153
1200
  }, null, 8, ["is-open", "section-properties"]),
1154
- M(cr, {
1201
+ M(Er, {
1155
1202
  "is-open": t.showWatermark,
1156
1203
  current: t.currentWatermark,
1157
- onClose: a[11] ||= (e) => r("update:showWatermark", !1),
1158
- onApply: a[12] ||= (e) => r("watermark-apply", e)
1159
- }, null, 8, ["is-open", "current"]),
1160
- M(d, {
1204
+ presets: t.watermarkPresets,
1205
+ onClose: a[9] ||= (e) => r("update:showWatermark", !1),
1206
+ onApply: a[10] ||= (e) => r("watermark-apply", e)
1207
+ }, null, 8, [
1208
+ "is-open",
1209
+ "current",
1210
+ "presets"
1211
+ ]),
1212
+ M(u, {
1161
1213
  "is-open": t.showKeyboardShortcuts,
1162
- onClose: a[13] ||= (e) => r("update:showKeyboardShortcuts", !1)
1214
+ onClose: a[11] ||= (e) => r("update:showKeyboardShortcuts", !1)
1163
1215
  }, null, 8, ["is-open"])
1164
1216
  ], 64));
1165
1217
  }
1166
- }), ur = ["disabled", "onMousedown"], dr = { class: "ctx-menu__label" }, fr = {
1218
+ }), Or = ["disabled", "onMousedown"], kr = { class: "ctx-menu__label" }, Ar = {
1167
1219
  key: 0,
1168
1220
  class: "ctx-menu__shortcut"
1169
- }, pr = 220, mr = 32, hr = 10, gr = /* @__PURE__ */ x(/* @__PURE__ */ N({
1221
+ }, jr = 220, Mr = 32, Nr = 10, Pr = /* @__PURE__ */ b(/* @__PURE__ */ N({
1170
1222
  __name: "TextContextMenu",
1171
1223
  props: {
1172
1224
  isOpen: { type: Boolean },
@@ -1180,35 +1232,35 @@ var Kt = /* @__PURE__ */ N({
1180
1232
  },
1181
1233
  emits: ["close", "action"],
1182
1234
  setup(e, { emit: t }) {
1183
- let r = e, i = t, { t: a } = n(), o = z(null), s = D(() => {
1235
+ let n = e, r = t, { t: i } = d(), a = R(null), o = E(() => {
1184
1236
  let e = [
1185
1237
  {
1186
1238
  id: "cut",
1187
- label: a("contextMenu.cut"),
1239
+ label: i("contextMenu.cut"),
1188
1240
  action: "cut",
1189
- shortcut: a("contextMenu.cutShortcut"),
1190
- disabled: !r.hasSelection || !r.isEditable
1241
+ shortcut: i("contextMenu.cutShortcut"),
1242
+ disabled: !n.hasSelection || !n.isEditable
1191
1243
  },
1192
1244
  {
1193
1245
  id: "copy",
1194
- label: a("contextMenu.copy"),
1246
+ label: i("contextMenu.copy"),
1195
1247
  action: "copy",
1196
- shortcut: a("contextMenu.copyShortcut"),
1197
- disabled: !r.hasSelection
1248
+ shortcut: i("contextMenu.copyShortcut"),
1249
+ disabled: !n.hasSelection
1198
1250
  },
1199
1251
  {
1200
1252
  id: "paste",
1201
- label: a("contextMenu.paste"),
1253
+ label: i("contextMenu.paste"),
1202
1254
  action: "paste",
1203
- shortcut: a("contextMenu.pasteShortcut"),
1204
- disabled: !r.isEditable
1255
+ shortcut: i("contextMenu.pasteShortcut"),
1256
+ disabled: !n.isEditable
1205
1257
  },
1206
1258
  {
1207
1259
  id: "pasteAsPlainText",
1208
- label: a("contextMenu.pastePlainText"),
1260
+ label: i("contextMenu.pastePlainText"),
1209
1261
  action: "pasteAsPlainText",
1210
- shortcut: a("contextMenu.pastePlainTextShortcut"),
1211
- disabled: !r.isEditable
1262
+ shortcut: i("contextMenu.pastePlainTextShortcut"),
1263
+ disabled: !n.isEditable
1212
1264
  },
1213
1265
  {
1214
1266
  id: "div1",
@@ -1218,52 +1270,52 @@ var Kt = /* @__PURE__ */ N({
1218
1270
  },
1219
1271
  {
1220
1272
  id: "delete",
1221
- label: a("contextMenu.delete"),
1273
+ label: i("contextMenu.delete"),
1222
1274
  action: "delete",
1223
- shortcut: a("contextMenu.deleteShortcut"),
1224
- disabled: !r.hasSelection || !r.isEditable
1275
+ shortcut: i("contextMenu.deleteShortcut"),
1276
+ disabled: !n.hasSelection || !n.isEditable
1225
1277
  },
1226
1278
  {
1227
1279
  id: "selectAll",
1228
- label: a("contextMenu.selectAll"),
1280
+ label: i("contextMenu.selectAll"),
1229
1281
  action: "selectAll",
1230
- shortcut: a("contextMenu.selectAllShortcut")
1282
+ shortcut: i("contextMenu.selectAllShortcut")
1231
1283
  }
1232
1284
  ];
1233
- return r.onImage && r.isEditable && e.push({
1285
+ return n.onImage && n.isEditable && e.push({
1234
1286
  id: "div-img",
1235
1287
  label: "",
1236
1288
  action: "",
1237
1289
  divider: !0
1238
1290
  }, {
1239
1291
  id: "replaceImage",
1240
- label: a("imageOverlay.replaceImage"),
1292
+ label: i("imageOverlay.replaceImage"),
1241
1293
  action: "replaceImage"
1242
1294
  }, {
1243
1295
  id: "imageProperties",
1244
- label: a("imageWrap.menu.imageProperties"),
1296
+ label: i("imageWrap.menu.imageProperties"),
1245
1297
  action: "imageProperties"
1246
1298
  }, {
1247
1299
  id: "deleteImage",
1248
- label: a("imageOverlay.deleteImage"),
1300
+ label: i("imageOverlay.deleteImage"),
1249
1301
  action: "deleteImage",
1250
- shortcut: a("contextMenu.deleteShortcut")
1251
- }), r.inTable && r.isEditable && e.push({
1302
+ shortcut: i("contextMenu.deleteShortcut")
1303
+ }), n.inTable && n.isEditable && e.push({
1252
1304
  id: "div2",
1253
1305
  label: "",
1254
1306
  action: "",
1255
1307
  divider: !0
1256
1308
  }, {
1257
1309
  id: "addRowAbove",
1258
- label: a("table.insertRowAbove"),
1310
+ label: i("table.insertRowAbove"),
1259
1311
  action: "addRowAbove"
1260
1312
  }, {
1261
1313
  id: "addRowBelow",
1262
- label: a("table.insertRowBelow"),
1314
+ label: i("table.insertRowBelow"),
1263
1315
  action: "addRowBelow"
1264
1316
  }, {
1265
1317
  id: "deleteRow",
1266
- label: a("table.deleteRow"),
1318
+ label: i("table.deleteRow"),
1267
1319
  action: "deleteRow"
1268
1320
  }, {
1269
1321
  id: "div3",
@@ -1272,15 +1324,15 @@ var Kt = /* @__PURE__ */ N({
1272
1324
  divider: !0
1273
1325
  }, {
1274
1326
  id: "addColLeft",
1275
- label: a("table.insertColumnLeft"),
1327
+ label: i("table.insertColumnLeft"),
1276
1328
  action: "addColumnLeft"
1277
1329
  }, {
1278
1330
  id: "addColRight",
1279
- label: a("table.insertColumnRight"),
1331
+ label: i("table.insertColumnRight"),
1280
1332
  action: "addColumnRight"
1281
1333
  }, {
1282
1334
  id: "deleteCol",
1283
- label: a("table.deleteColumn"),
1335
+ label: i("table.deleteColumn"),
1284
1336
  action: "deleteColumn"
1285
1337
  }, {
1286
1338
  id: "div4",
@@ -1289,74 +1341,74 @@ var Kt = /* @__PURE__ */ N({
1289
1341
  divider: !0
1290
1342
  }, {
1291
1343
  id: "mergeCells",
1292
- label: a("table.mergeCells"),
1344
+ label: i("table.mergeCells"),
1293
1345
  action: "mergeCells",
1294
- disabled: !r.canMergeCells
1346
+ disabled: !n.canMergeCells
1295
1347
  }, {
1296
1348
  id: "splitCell",
1297
- label: a("table.splitCell"),
1349
+ label: i("table.splitCell"),
1298
1350
  action: "splitCell",
1299
- disabled: !r.canSplitCell
1351
+ disabled: !n.canSplitCell
1300
1352
  }), e;
1301
- }), c = D(() => {
1302
- let e = r.position.x, t = r.position.y, n = s.value.filter((e) => !e.divider).length, i = s.value.filter((e) => e.divider).length, a = n * mr + i * 9;
1303
- return typeof window < "u" && (e + pr + hr > window.innerWidth && (e = window.innerWidth - pr - hr), t + a + hr > window.innerHeight && (t = window.innerHeight - a - hr)), {
1353
+ }), s = E(() => {
1354
+ let e = n.position.x, t = n.position.y, r = o.value.filter((e) => !e.divider).length, i = o.value.filter((e) => e.divider).length, a = r * Mr + i * 9;
1355
+ return typeof window < "u" && (e + jr + Nr > window.innerWidth && (e = window.innerWidth - jr - Nr), t + a + Nr > window.innerHeight && (t = window.innerHeight - a - Nr)), {
1304
1356
  position: "fixed",
1305
1357
  left: `${e}px`,
1306
1358
  top: `${t}px`,
1307
1359
  zIndex: 400
1308
1360
  };
1309
1361
  });
1310
- function l(e) {
1311
- e && (i("action", e), i("close"));
1362
+ function c(e) {
1363
+ e && (r("action", e), r("close"));
1312
1364
  }
1313
- function u(e) {
1314
- e.key === "Escape" && i("close");
1365
+ function l(e) {
1366
+ e.key === "Escape" && r("close");
1315
1367
  }
1316
- return K(() => r.isOpen, (e) => {
1317
- e && le(() => o.value?.focus());
1318
- }), (t, n) => (R(), ie(E, { to: "body" }, [e.isOpen ? (R(), k("div", {
1368
+ return U(() => n.isOpen, (e) => {
1369
+ e && se(() => a.value?.focus());
1370
+ }), (t, n) => (L(), D(T, { to: "body" }, [e.isOpen ? (L(), k("div", {
1319
1371
  key: 0,
1320
1372
  class: "ctx-menu-backdrop",
1321
1373
  onMousedown: n[0] ||= (e) => t.$emit("close"),
1322
- onContextmenu: n[1] ||= J((e) => t.$emit("close"), ["prevent"])
1323
- }, null, 32)) : O("", !0), e.isOpen ? (R(), k("div", {
1374
+ onContextmenu: n[1] ||= q((e) => t.$emit("close"), ["prevent"])
1375
+ }, null, 32)) : O("", !0), e.isOpen ? (L(), k("div", {
1324
1376
  key: 1,
1325
1377
  ref_key: "menuRef",
1326
- ref: o,
1378
+ ref: a,
1327
1379
  class: "ctx-menu",
1328
- style: F(c.value),
1329
- onContextmenu: n[2] ||= J(() => {}, ["prevent"]),
1330
- onKeydown: u
1331
- }, [(R(!0), k(T, null, B(s.value, (e, t) => (R(), k("button", {
1380
+ style: F(s.value),
1381
+ onContextmenu: n[2] ||= q(() => {}, ["prevent"]),
1382
+ onKeydown: l
1383
+ }, [(L(!0), k(w, null, ue(o.value, (e, t) => (L(), k("button", {
1332
1384
  key: e.id || t,
1333
- class: P(["ctx-menu__item", {
1385
+ class: ce(["ctx-menu__item", {
1334
1386
  "ctx-menu__item--disabled": e.disabled,
1335
1387
  "ctx-menu__item--divider": e.divider
1336
1388
  }]),
1337
1389
  disabled: e.disabled,
1338
- onMousedown: J((t) => l(e.action), ["prevent"])
1339
- }, [A("span", dr, H(e.label), 1), e.shortcut ? (R(), k("span", fr, H(e.shortcut), 1)) : O("", !0)], 42, ur))), 128))], 36)) : O("", !0)]));
1390
+ onMousedown: q((t) => c(e.action), ["prevent"])
1391
+ }, [A("span", kr, z(e.label), 1), e.shortcut ? (L(), k("span", Ar, z(e.shortcut), 1)) : O("", !0)], 42, Or))), 128))], 36)) : O("", !0)]));
1340
1392
  }
1341
- }), [["__scopeId", "data-v-b2122da6"]]), _r = ["aria-label"], vr = { class: "image-ctx-menu__icon" }, yr = { class: "image-ctx-menu__label" }, br = {
1393
+ }), [["__scopeId", "data-v-852b8986"]]), Fr = ["aria-label"], Ir = { class: "image-ctx-menu__icon" }, Lr = { class: "image-ctx-menu__label" }, Rr = {
1342
1394
  key: 1,
1343
1395
  class: "image-ctx-menu__divider",
1344
1396
  role: "separator"
1345
- }, xr = [
1397
+ }, zr = [
1346
1398
  "data-wrap-type",
1347
1399
  "data-current",
1348
1400
  "data-disabled",
1349
1401
  "disabled",
1350
1402
  "title",
1351
1403
  "onClick"
1352
- ], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "image-ctx-menu__label" }, wr = ["aria-label"], Tr = ["disabled", "onClick"], Er = { class: "image-ctx-menu__label" }, Dr = {
1404
+ ], Br = { class: "image-ctx-menu__icon" }, Vr = { class: "image-ctx-menu__label" }, Hr = ["aria-label"], Ur = ["disabled", "onClick"], Wr = { class: "image-ctx-menu__label" }, Gr = {
1353
1405
  key: 0,
1354
1406
  class: "image-ctx-menu__shortcut"
1355
- }, Or = {
1407
+ }, Kr = {
1356
1408
  key: 0,
1357
1409
  class: "image-ctx-menu__divider",
1358
1410
  role: "separator"
1359
- }, kr = 18, Ar = 260, jr = 10, Mr = /* @__PURE__ */ x(/* @__PURE__ */ N({
1411
+ }, qr = 18, Jr = 260, Yr = 10, Xr = /* @__PURE__ */ b(/* @__PURE__ */ N({
1360
1412
  __name: "ImageContextMenu",
1361
1413
  props: {
1362
1414
  state: {},
@@ -1373,11 +1425,11 @@ var Kt = /* @__PURE__ */ N({
1373
1425
  "open-properties"
1374
1426
  ],
1375
1427
  setup(e, { emit: t }) {
1376
- let r = e, i = t;
1428
+ let n = e, i = t;
1377
1429
  function a() {
1378
1430
  i("open-properties"), i("close");
1379
1431
  }
1380
- let { t: o } = n(), s = z(null), l = Ze, u = D(() => r.state ? $e(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
1432
+ let { t: o } = d(), s = R(null), c = it, l = E(() => n.state ? ot(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), u = {
1381
1433
  inline: "wrap_text",
1382
1434
  squareLeft: "format_image_left",
1383
1435
  squareRight: "format_image_right",
@@ -1385,21 +1437,21 @@ var Kt = /* @__PURE__ */ N({
1385
1437
  inFront: "flip_to_front"
1386
1438
  };
1387
1439
  function f(e) {
1388
- return d[e];
1440
+ return u[e];
1389
1441
  }
1390
- let p = D(() => {
1391
- if (!r.state) return {};
1392
- let e = Ze.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
1393
- return typeof window < "u" && (t + Ar > window.innerWidth && (t = window.innerWidth - Ar - jr), n + e > window.innerHeight && (n = window.innerHeight - e - jr), t < jr && (t = jr), n < jr && (n = jr)), {
1442
+ let p = E(() => {
1443
+ if (!n.state) return {};
1444
+ let e = it.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
1445
+ return typeof window < "u" && (t + Jr > window.innerWidth && (t = window.innerWidth - Jr - Yr), r + e > window.innerHeight && (r = window.innerHeight - e - Yr), t < Yr && (t = Yr), r < Yr && (r = Yr)), {
1394
1446
  position: "fixed",
1395
1447
  left: `${t}px`,
1396
- top: `${n}px`,
1397
- minWidth: `${Ar}px`,
1448
+ top: `${r}px`,
1449
+ minWidth: `${Jr}px`,
1398
1450
  zIndex: 400
1399
1451
  };
1400
1452
  });
1401
1453
  function m(e) {
1402
- return r.state ? tt(e, r.state.currentWrapType) : !1;
1454
+ return n.state ? ct(e, n.state.currentWrapType) : !1;
1403
1455
  }
1404
1456
  function h(e) {
1405
1457
  m(e) && (i("select", e.choice), i("close"));
@@ -1413,74 +1465,74 @@ var Kt = /* @__PURE__ */ N({
1413
1465
  function v(e) {
1414
1466
  e.key === "Escape" && (e.preventDefault(), i("close"));
1415
1467
  }
1416
- return (t, n) => (R(), ie(E, { to: "body" }, [e.state && e.state.open ? (R(), k("div", {
1468
+ return (t, n) => (L(), D(T, { to: "body" }, [e.state && e.state.open ? (L(), k("div", {
1417
1469
  key: 0,
1418
1470
  class: "image-ctx-menu-backdrop",
1419
1471
  onMousedown: _,
1420
- onContextmenu: n[0] ||= J((e) => t.$emit("close"), ["prevent"])
1421
- }, null, 32)) : O("", !0), e.state && e.state.open ? (R(), k("div", {
1472
+ onContextmenu: n[0] ||= q((e) => t.$emit("close"), ["prevent"])
1473
+ }, null, 32)) : O("", !0), e.state && e.state.open ? (L(), k("div", {
1422
1474
  key: 1,
1423
1475
  ref_key: "menuRef",
1424
1476
  ref: s,
1425
1477
  class: "image-ctx-menu",
1426
1478
  role: "menu",
1427
- "aria-label": U(o)("imageWrap.menu.ariaLabel"),
1479
+ "aria-label": B(o)("imageWrap.menu.ariaLabel"),
1428
1480
  "data-testid": "image-context-menu",
1429
1481
  style: F(p.value),
1430
- onContextmenu: n[4] ||= J(() => {}, ["prevent"]),
1482
+ onContextmenu: n[4] ||= q(() => {}, ["prevent"]),
1431
1483
  onKeydown: v
1432
1484
  }, [
1433
- e.canOpenProperties ? (R(), k("button", {
1485
+ e.canOpenProperties ? (L(), k("button", {
1434
1486
  key: 0,
1435
1487
  type: "button",
1436
1488
  role: "menuitem",
1437
1489
  class: "image-ctx-menu__item",
1438
1490
  "data-action": "open-properties",
1439
- onMousedown: n[1] ||= J(() => {}, ["prevent"]),
1491
+ onMousedown: n[1] ||= q(() => {}, ["prevent"]),
1440
1492
  onClick: a
1441
- }, [A("span", vr, [M(c, {
1493
+ }, [A("span", Ir, [M(r, {
1442
1494
  name: "settings",
1443
- size: kr
1444
- })]), A("span", yr, H(U(o)("imageWrap.menu.imageProperties")), 1)], 32)) : O("", !0),
1445
- e.canOpenProperties ? (R(), k("div", br)) : O("", !0),
1446
- (R(!0), k(T, null, B(U(l), (e) => (R(), k("button", {
1495
+ size: qr
1496
+ })]), A("span", Lr, z(B(o)("imageWrap.menu.imageProperties")), 1)], 32)) : O("", !0),
1497
+ e.canOpenProperties ? (L(), k("div", Rr)) : O("", !0),
1498
+ (L(!0), k(w, null, ue(B(c), (e) => (L(), k("button", {
1447
1499
  key: e.choice,
1448
1500
  type: "button",
1449
1501
  role: "menuitem",
1450
- class: P(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
1502
+ class: ce(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === l.value }]),
1451
1503
  "data-wrap-type": e.choice,
1452
- "data-current": e.choice === u.value ? "true" : "false",
1504
+ "data-current": e.choice === l.value ? "true" : "false",
1453
1505
  "data-disabled": m(e) ? "false" : "true",
1454
1506
  disabled: !m(e),
1455
- title: U(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1456
- onMousedown: n[2] ||= J(() => {}, ["prevent"]),
1507
+ title: B(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
1508
+ onMousedown: n[2] ||= q(() => {}, ["prevent"]),
1457
1509
  onClick: (t) => h(e)
1458
1510
  }, [
1459
- A("span", Sr, [M(c, {
1511
+ A("span", Br, [M(r, {
1460
1512
  name: f(e.iconHint),
1461
- size: kr
1513
+ size: qr
1462
1514
  }, null, 8, ["name"])]),
1463
- A("span", Cr, H(U(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1464
- e.choice === u.value ? (R(), k("span", {
1515
+ A("span", Vr, z(B(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
1516
+ e.choice === l.value ? (L(), k("span", {
1465
1517
  key: 0,
1466
1518
  class: "image-ctx-menu__current-dot",
1467
- "aria-label": U(o)("imageWrap.menu.ariaLabel")
1468
- }, "●", 8, wr)) : O("", !0)
1469
- ], 42, xr))), 128)),
1470
- e.textActions && e.textActions.length > 0 ? (R(), k(T, { key: 2 }, [n[5] ||= A("div", {
1519
+ "aria-label": B(o)("imageWrap.menu.ariaLabel")
1520
+ }, "●", 8, Hr)) : O("", !0)
1521
+ ], 42, zr))), 128)),
1522
+ e.textActions && e.textActions.length > 0 ? (L(), k(w, { key: 2 }, [n[5] ||= A("div", {
1471
1523
  class: "image-ctx-menu__divider",
1472
1524
  role: "separator"
1473
- }, null, -1), (R(!0), k(T, null, B(e.textActions, (e, t) => (R(), k(T, { key: `${e.action}-${t}` }, [A("button", {
1525
+ }, null, -1), (L(!0), k(w, null, ue(e.textActions, (e, t) => (L(), k(w, { key: `${e.action}-${t}` }, [A("button", {
1474
1526
  type: "button",
1475
1527
  role: "menuitem",
1476
1528
  class: "image-ctx-menu__item image-ctx-menu__item--text",
1477
1529
  disabled: e.disabled,
1478
- onMousedown: n[3] ||= J(() => {}, ["prevent"]),
1530
+ onMousedown: n[3] ||= q(() => {}, ["prevent"]),
1479
1531
  onClick: (t) => g(e)
1480
- }, [A("span", Er, H(e.label), 1), e.shortcut ? (R(), k("span", Dr, H(e.shortcut), 1)) : O("", !0)], 40, Tr), e.dividerAfter ? (R(), k("div", Or)) : O("", !0)], 64))), 128))], 64)) : O("", !0)
1481
- ], 44, _r)) : O("", !0)]));
1532
+ }, [A("span", Wr, z(e.label), 1), e.shortcut ? (L(), k("span", Gr, z(e.shortcut), 1)) : O("", !0)], 40, Ur), e.dividerAfter ? (L(), k("div", Kr)) : O("", !0)], 64))), 128))], 64)) : O("", !0)
1533
+ ], 44, Fr)) : O("", !0)]));
1482
1534
  }
1483
- }), [["__scopeId", "data-v-5c21ca8c"]]), Nr = /* @__PURE__ */ N({
1535
+ }), [["__scopeId", "data-v-de904a04"]]), Zr = /* @__PURE__ */ N({
1484
1536
  __name: "DocxEditorOverlays",
1485
1537
  props: {
1486
1538
  readOnly: { type: Boolean },
@@ -1498,7 +1550,7 @@ var Kt = /* @__PURE__ */ N({
1498
1550
  ],
1499
1551
  setup(e, { emit: t }) {
1500
1552
  let n = t;
1501
- return (t, r) => (R(), k(T, null, [M(gr, {
1553
+ return (t, r) => (L(), k(w, null, [M(Pr, {
1502
1554
  "is-open": e.contextMenu.isOpen,
1503
1555
  position: e.contextMenu.position,
1504
1556
  "has-selection": e.contextMenu.hasSelection,
@@ -1518,7 +1570,7 @@ var Kt = /* @__PURE__ */ N({
1518
1570
  "on-image",
1519
1571
  "can-merge-cells",
1520
1572
  "can-split-cell"
1521
- ]), M(Mr, {
1573
+ ]), M(Xr, {
1522
1574
  state: e.imageContextMenu,
1523
1575
  "text-actions": e.imageContextMenuTextActions,
1524
1576
  "can-open-properties": e.canOpenImageProperties,
@@ -1532,7 +1584,7 @@ var Kt = /* @__PURE__ */ N({
1532
1584
  "can-open-properties"
1533
1585
  ])], 64));
1534
1586
  }
1535
- }), Pr = ["href", "title"], Fr = ["title"], Ir = ["title"], Lr = ["title"], Rr = { class: "docx-hyperlink-popup__edit-row" }, zr = ["placeholder", "onKeydown"], Br = { class: "docx-hyperlink-popup__edit-row" }, Vr = ["onKeydown"], Hr = ["disabled"], Ur = /* @__PURE__ */ x(/* @__PURE__ */ N({
1587
+ }), Qr = ["href", "title"], $r = ["title"], ei = ["title"], ti = ["title"], ni = { class: "docx-hyperlink-popup__edit-row" }, ri = ["placeholder", "onKeydown"], ii = { class: "docx-hyperlink-popup__edit-row" }, ai = ["onKeydown"], oi = ["disabled"], si = /* @__PURE__ */ b(/* @__PURE__ */ N({
1536
1588
  __name: "HyperlinkPopup",
1537
1589
  props: {
1538
1590
  data: {},
@@ -1546,69 +1598,69 @@ var Kt = /* @__PURE__ */ N({
1546
1598
  "close"
1547
1599
  ],
1548
1600
  setup(e, { emit: t }) {
1549
- let { t: r } = n(), i = e, a = t, o = z(!1), s = z(""), c = z(""), l = z(null), u = D(() => ({
1550
- left: (i.data?.position.left ?? 0) + "px",
1551
- top: (i.data?.position.top ?? 0) + "px"
1601
+ let { t: n } = d(), r = e, i = t, a = R(!1), o = R(""), s = R(""), c = R(null), l = E(() => ({
1602
+ left: (r.data?.position.left ?? 0) + "px",
1603
+ top: (r.data?.position.top ?? 0) + "px"
1552
1604
  }));
1553
- K(() => i.data?.href, () => {
1554
- o.value = !1;
1605
+ U(() => r.data?.href, () => {
1606
+ a.value = !1;
1555
1607
  });
1556
- let d = null, f = null;
1608
+ let u = null, f = null;
1557
1609
  function p() {
1558
- f &&= (clearTimeout(f), null), d &&= (document.removeEventListener("mousedown", d), null);
1610
+ f &&= (clearTimeout(f), null), u &&= (document.removeEventListener("mousedown", u), null);
1559
1611
  }
1560
- K(() => i.data, (e) => {
1561
- p(), e && (d = (e) => {
1562
- let t = l.value;
1563
- t && !t.contains(e.target) && a("close");
1612
+ U(() => r.data, (e) => {
1613
+ p(), e && (u = (e) => {
1614
+ let t = c.value;
1615
+ t && !t.contains(e.target) && i("close");
1564
1616
  }, f = setTimeout(() => {
1565
- d && document.addEventListener("mousedown", d);
1617
+ u && document.addEventListener("mousedown", u);
1566
1618
  }, 0));
1567
1619
  }, { immediate: !0 }), I(p);
1568
1620
  function m() {
1569
- i.data && (s.value = i.data.displayText, c.value = i.data.href, o.value = !0);
1621
+ r.data && (o.value = r.data.displayText, s.value = r.data.href, a.value = !0);
1570
1622
  }
1571
1623
  function h() {
1572
- c.value.trim() && (a("edit", s.value, c.value), o.value = !1);
1624
+ s.value.trim() && (i("edit", o.value, s.value), a.value = !1);
1573
1625
  }
1574
1626
  function g() {
1575
- i.data && (a("copy", i.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(i.data.href).catch(() => {}));
1627
+ r.data && (i("copy", r.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(r.data.href).catch(() => {}));
1576
1628
  }
1577
- return (t, n) => e.data ? (R(), k("div", {
1629
+ return (t, r) => e.data ? (L(), k("div", {
1578
1630
  key: 0,
1579
1631
  ref_key: "popupRef",
1580
- ref: l,
1581
- class: P(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
1582
- style: F(u.value),
1583
- onMousedown: n[6] ||= J(() => {}, ["stop"])
1584
- }, [o.value ? (R(), k(T, { key: 1 }, [A("div", Rr, [q(A("input", {
1632
+ ref: c,
1633
+ class: ce(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
1634
+ style: F(l.value),
1635
+ onMousedown: r[6] ||= q(() => {}, ["stop"])
1636
+ }, [a.value ? (L(), k(w, { key: 1 }, [A("div", ni, [G(A("input", {
1585
1637
  class: "docx-hyperlink-popup__input",
1586
- placeholder: U(r)("hyperlinkPopup.displayTextPlaceholder"),
1587
- "onUpdate:modelValue": n[2] ||= (e) => s.value = e,
1588
- onKeydown: [me(J(h, ["prevent"]), ["enter"]), n[3] ||= me((e) => t.$emit("close"), ["esc"])]
1589
- }, null, 40, zr), [[G, s.value]])]), A("div", Br, [q(A("input", {
1638
+ placeholder: B(n)("hyperlinkPopup.displayTextPlaceholder"),
1639
+ "onUpdate:modelValue": r[2] ||= (e) => o.value = e,
1640
+ onKeydown: [K(q(h, ["prevent"]), ["enter"]), r[3] ||= K((e) => t.$emit("close"), ["esc"])]
1641
+ }, null, 40, ri), [[H, o.value]])]), A("div", ii, [G(A("input", {
1590
1642
  class: "docx-hyperlink-popup__input",
1591
1643
  placeholder: "https://...",
1592
- "onUpdate:modelValue": n[4] ||= (e) => c.value = e,
1593
- onKeydown: [me(J(h, ["prevent"]), ["enter"]), n[5] ||= me((e) => t.$emit("close"), ["esc"])]
1594
- }, null, 40, Vr), [[G, c.value]]), A("button", {
1644
+ "onUpdate:modelValue": r[4] ||= (e) => s.value = e,
1645
+ onKeydown: [K(q(h, ["prevent"]), ["enter"]), r[5] ||= K((e) => t.$emit("close"), ["esc"])]
1646
+ }, null, 40, ai), [[H, s.value]]), A("button", {
1595
1647
  class: "docx-hyperlink-popup__apply",
1596
- disabled: !c.value.trim(),
1597
- onClick: J(h, ["prevent"])
1598
- }, H(U(r)("common.apply")), 9, Hr)])], 64)) : (R(), k(T, { key: 0 }, [
1599
- n[10] ||= oe("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-9d23bb12><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-9d23bb12></circle><path d=\"M2 12h20\" data-v-9d23bb12></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-9d23bb12></path></svg></span>", 1),
1648
+ disabled: !s.value.trim(),
1649
+ onClick: q(h, ["prevent"])
1650
+ }, z(B(n)("common.apply")), 9, oi)])], 64)) : (L(), k(w, { key: 0 }, [
1651
+ r[10] ||= ae("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-084b4288><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-084b4288><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-084b4288></circle><path d=\"M2 12h20\" data-v-084b4288></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-084b4288></path></svg></span>", 1),
1600
1652
  A("a", {
1601
1653
  class: "docx-hyperlink-popup__url",
1602
1654
  href: e.data.href,
1603
1655
  title: e.data.href,
1604
- onClick: n[0] ||= J((n) => t.$emit("navigate", e.data.href), ["prevent"])
1605
- }, H(e.data.href), 9, Pr),
1606
- n[11] ||= A("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1656
+ onClick: r[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
1657
+ }, z(e.data.href), 9, Qr),
1658
+ r[11] ||= A("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
1607
1659
  A("button", {
1608
1660
  class: "docx-hyperlink-popup__btn",
1609
- title: U(r)("hyperlinkPopup.copyLink"),
1610
- onClick: J(g, ["prevent"])
1611
- }, [...n[7] ||= [A("svg", {
1661
+ title: B(n)("hyperlinkPopup.copyLink"),
1662
+ onClick: q(g, ["prevent"])
1663
+ }, [...r[7] ||= [A("svg", {
1612
1664
  width: "18",
1613
1665
  height: "18",
1614
1666
  viewBox: "0 0 24 24",
@@ -1624,13 +1676,13 @@ var Kt = /* @__PURE__ */ N({
1624
1676
  height: "13",
1625
1677
  rx: "2",
1626
1678
  ry: "2"
1627
- }), A("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Fr),
1628
- e.readOnly ? O("", !0) : (R(), k("button", {
1679
+ }), A("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, $r),
1680
+ e.readOnly ? O("", !0) : (L(), k("button", {
1629
1681
  key: 0,
1630
1682
  class: "docx-hyperlink-popup__btn",
1631
- title: U(r)("hyperlinkPopup.editLink"),
1632
- onClick: J(m, ["prevent"])
1633
- }, [...n[8] ||= [A("svg", {
1683
+ title: B(n)("hyperlinkPopup.editLink"),
1684
+ onClick: q(m, ["prevent"])
1685
+ }, [...r[8] ||= [A("svg", {
1634
1686
  width: "18",
1635
1687
  height: "18",
1636
1688
  viewBox: "0 0 24 24",
@@ -1639,66 +1691,72 @@ var Kt = /* @__PURE__ */ N({
1639
1691
  "stroke-width": "2",
1640
1692
  "stroke-linecap": "round",
1641
1693
  "stroke-linejoin": "round"
1642
- }, [A("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), A("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, Ir)),
1643
- e.readOnly ? O("", !0) : (R(), k("button", {
1694
+ }, [A("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), A("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, ei)),
1695
+ e.readOnly ? O("", !0) : (L(), k("button", {
1644
1696
  key: 1,
1645
1697
  class: "docx-hyperlink-popup__btn",
1646
- title: U(r)("hyperlinkPopup.removeLink"),
1647
- onClick: n[1] ||= J((e) => t.$emit("remove"), ["prevent"])
1648
- }, [...n[9] ||= [oe("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-9d23bb12></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-9d23bb12></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-9d23bb12></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-9d23bb12></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-9d23bb12></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-9d23bb12></line></svg>", 1)]], 8, Lr))
1698
+ title: B(n)("hyperlinkPopup.removeLink"),
1699
+ onClick: r[1] ||= q((e) => t.$emit("remove"), ["prevent"])
1700
+ }, [...r[9] ||= [ae("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-084b4288><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-084b4288></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-084b4288></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-084b4288></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-084b4288></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-084b4288></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-084b4288></line></svg>", 1)]], 8, ti))
1649
1701
  ], 64))], 38)) : O("", !0);
1650
1702
  }
1651
- }), [["__scopeId", "data-v-9d23bb12"]]);
1703
+ }), [["__scopeId", "data-v-084b4288"]]);
1652
1704
  //#endregion
1653
1705
  //#region src/composables/useFileIO.ts
1654
- function Wr(e) {
1655
- let t = z(null);
1656
- async function n() {
1706
+ function ci(e) {
1707
+ let t = R(null), n = R(null);
1708
+ function r(t) {
1709
+ let n = t.target, r = n.files?.[0], i = e.getActiveView();
1710
+ r && i && bt(i, r, { onError: (t) => e.emit("error", t instanceof Error ? t : /* @__PURE__ */ Error("Failed to insert image")) }), n.value = "";
1711
+ }
1712
+ async function i() {
1657
1713
  await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
1658
1714
  }
1659
- async function r(t) {
1715
+ async function a(t) {
1660
1716
  try {
1661
- let r = await Re(t);
1662
- if (!r) return;
1663
- await e.loadBuffer(r.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", r.name), await n();
1717
+ let n = await He(t);
1718
+ if (!n) return;
1719
+ await e.loadBuffer(n.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", n.name), await i();
1664
1720
  } catch (t) {
1665
1721
  e.emit("error", t instanceof Error ? t : /* @__PURE__ */ Error("Failed to open document"));
1666
1722
  }
1667
1723
  }
1668
- function i(t) {
1724
+ function o(t) {
1669
1725
  e.onDocumentNameChange?.(t), e.emit("rename", t);
1670
1726
  }
1671
- async function a() {
1727
+ async function s() {
1672
1728
  let t = await e.saveBlob();
1673
1729
  if (!t) return;
1674
1730
  let n = (e.documentName() ?? "").trim() || "document", r = URL.createObjectURL(t), i = window.document.createElement("a");
1675
1731
  i.href = r, i.download = `${n.replace(/\.docx$/i, "")}.docx`, i.click(), setTimeout(() => URL.revokeObjectURL(r), 0);
1676
1732
  }
1677
- async function o(t) {
1678
- await e.loadBuffer(t), e.emit("update:document", e.getDocument()), await n();
1733
+ async function c(t) {
1734
+ await e.loadBuffer(t), e.emit("update:document", e.getDocument()), await i();
1679
1735
  }
1680
- function s(t) {
1681
- e.loadParsedDocument(t), e.emit("update:document", t), n();
1736
+ function l(t) {
1737
+ e.loadParsedDocument(t), e.emit("update:document", t), i();
1682
1738
  }
1683
- async function c() {
1739
+ async function u() {
1684
1740
  let t = await e.saveBlob();
1685
1741
  return t ? t.arrayBuffer() : null;
1686
1742
  }
1687
1743
  return {
1688
1744
  docxInputRef: t,
1689
- handleDocxFileChange: r,
1690
- handleDocumentNameChange: i,
1691
- downloadCurrentDocument: a,
1692
- emitReadyAfterSidebarStateRefresh: n,
1693
- loadDocumentBuffer: o,
1694
- loadDocument: s,
1695
- save: c
1745
+ imageInputRef: n,
1746
+ handleImageFileChange: r,
1747
+ handleDocxFileChange: a,
1748
+ handleDocumentNameChange: o,
1749
+ downloadCurrentDocument: s,
1750
+ emitReadyAfterSidebarStateRefresh: i,
1751
+ loadDocumentBuffer: c,
1752
+ loadDocument: l,
1753
+ save: u
1696
1754
  };
1697
1755
  }
1698
1756
  //#endregion
1699
1757
  //#region src/composables/useHyperlinkManagement.ts
1700
- function Gr(e) {
1701
- let t = z(null);
1758
+ function li(e) {
1759
+ let t = R(null);
1702
1760
  function n(t) {
1703
1761
  let n = e.editorView.value;
1704
1762
  if (!n) return;
@@ -1726,7 +1784,7 @@ function Gr(e) {
1726
1784
  function a(n, r) {
1727
1785
  let i = e.editorView.value;
1728
1786
  if (!i) return;
1729
- let a = He(i.state);
1787
+ let a = Je(i.state);
1730
1788
  if (!a) {
1731
1789
  t.value = null;
1732
1790
  return;
@@ -1740,7 +1798,7 @@ function Gr(e) {
1740
1798
  function o() {
1741
1799
  let n = e.editorView.value;
1742
1800
  if (!n) return;
1743
- let r = He(n.state, t.value?.href);
1801
+ let r = Je(n.state, t.value?.href);
1744
1802
  if (!r) {
1745
1803
  t.value = null;
1746
1804
  return;
@@ -1759,57 +1817,76 @@ function Gr(e) {
1759
1817
  }
1760
1818
  //#endregion
1761
1819
  //#region src/composables/useFormattingActions.ts
1762
- function Kr(e) {
1820
+ function ui(e) {
1763
1821
  let t = () => e.activeView?.value ?? e.editorView.value;
1764
1822
  function n() {
1765
1823
  let e = t();
1766
- e && (Ve(e.state, e.dispatch, e), e.focus());
1824
+ e && (qe(e.state, e.dispatch, e), e.focus());
1767
1825
  }
1768
1826
  function r(n) {
1769
1827
  let r = t();
1770
1828
  if (!r) return;
1771
- let i = e.getDocument()?.package?.styles;
1772
- if (i) {
1773
- let e = mt(i).resolveParagraphStyle(n);
1774
- lt(n, {
1829
+ let i = e.getDocument(), a = i?.package?.styles;
1830
+ if (a) {
1831
+ let e = kt(a).resolveParagraphStyle(n);
1832
+ wt(n, {
1775
1833
  paragraphFormatting: e.paragraphFormatting,
1776
- runFormatting: e.runFormatting
1834
+ runFormatting: e.runFormatting,
1835
+ numbering: i?.package?.numbering ? At(i.package.numbering) : null
1777
1836
  })(r.state, (e) => r.dispatch(e));
1778
- } else lt(n)(r.state, (e) => r.dispatch(e));
1837
+ } else wt(n)(r.state, (e) => r.dispatch(e));
1779
1838
  r.focus();
1780
1839
  }
1781
1840
  function i() {
1782
1841
  let t = e.editorView.value;
1783
- t && (ht(t.state, (e) => t.dispatch(e), t), t.focus());
1842
+ t && (jt(t.state, (e) => t.dispatch(e), t), t.focus());
1784
1843
  }
1785
- function a(e) {
1844
+ function a() {
1845
+ let t = e.editorView.value;
1846
+ t && (Nt(t.state, (e) => t.dispatch(e), t), t.focus());
1847
+ }
1848
+ function o() {
1849
+ let t = e.editorView.value;
1850
+ t && (Mt(t.state, (e) => t.dispatch(e), t), t.focus());
1851
+ }
1852
+ function s(e) {
1786
1853
  let n = t();
1787
1854
  if (!n) return;
1788
1855
  let { from: r } = n.state.selection, i = n.state.tr.insertText(e, r);
1789
1856
  n.dispatch(i.scrollIntoView()), n.focus();
1790
1857
  }
1791
- function o(t) {
1858
+ function c(t) {
1792
1859
  let n = e.editorView.value;
1793
- return n ? gt(n, t) : !1;
1860
+ return n ? Pt(n, t) : !1;
1794
1861
  }
1795
- function s(t) {
1862
+ function l(t) {
1796
1863
  let n = e.editorView.value;
1797
1864
  if (!n) return !1;
1798
1865
  let r = e.getDocument();
1799
- return _t(n, t, { styleResolver: r?.package?.styles ? mt(r.package.styles) : null });
1866
+ return It(n, t, {
1867
+ styleResolver: r?.package?.styles ? kt(r.package.styles) : null,
1868
+ numbering: r?.package?.numbering ? At(r.package.numbering) : null
1869
+ });
1870
+ }
1871
+ function u(t) {
1872
+ let n = e.editorView.value;
1873
+ return n ? Ft(n, t) : !1;
1800
1874
  }
1801
1875
  return {
1802
1876
  handleClearFormatting: n,
1803
1877
  handleApplyStyle: r,
1804
1878
  handleInsertPageBreak: i,
1805
- handleInsertSymbol: a,
1806
- applyFormatting: o,
1807
- setParagraphStyle: s
1879
+ handleInsertSectionBreakNextPage: a,
1880
+ handleInsertSectionBreakContinuous: o,
1881
+ handleInsertSymbol: s,
1882
+ applyFormatting: c,
1883
+ setParagraphStyle: l,
1884
+ insertBreak: u
1808
1885
  };
1809
1886
  }
1810
1887
  //#endregion
1811
1888
  //#region src/composables/usePageSetupControls.ts
1812
- function qr(e) {
1889
+ function di(e) {
1813
1890
  function t(t) {
1814
1891
  let n = e.getDocument();
1815
1892
  if (!n?.package?.document) return;
@@ -1836,19 +1913,19 @@ function qr(e) {
1836
1913
  }
1837
1914
  function s(t) {
1838
1915
  let n = e.editorView.value;
1839
- n && ft(t)(n.state, n.dispatch);
1916
+ n && Dt(t)(n.state, n.dispatch);
1840
1917
  }
1841
1918
  function c(t) {
1842
1919
  let n = e.editorView.value;
1843
- n && pt(t)(n.state, n.dispatch);
1920
+ n && Ot(t)(n.state, n.dispatch);
1844
1921
  }
1845
1922
  function l(t) {
1846
1923
  let n = e.editorView.value;
1847
- n && (t < 0 ? dt(-t, !0)(n.state, n.dispatch) : dt(t, !1)(n.state, n.dispatch));
1924
+ n && (t < 0 ? Et(-t, !0)(n.state, n.dispatch) : Et(t, !1)(n.state, n.dispatch));
1848
1925
  }
1849
1926
  function u(t) {
1850
1927
  let n = e.editorView.value;
1851
- n && ut(t)(n.state, n.dispatch);
1928
+ n && Tt(t)(n.state, n.dispatch);
1852
1929
  }
1853
1930
  return {
1854
1931
  handlePageSetupApply: t,
@@ -1864,16 +1941,16 @@ function qr(e) {
1864
1941
  }
1865
1942
  //#endregion
1866
1943
  //#region src/composables/useWatermarkControls.ts
1867
- function Jr(e) {
1868
- let t = z(!1), n = D(() => {
1944
+ function fi(e) {
1945
+ let t = R(!1), n = E(() => {
1869
1946
  e.stateTick.value;
1870
1947
  let t = e.editorView.value;
1871
- return t ? bt(t.state) ?? void 0 : void 0;
1948
+ return t ? yt(t.state) ?? void 0 : void 0;
1872
1949
  });
1873
1950
  function r(t) {
1874
1951
  if (e.readOnly.value) return;
1875
1952
  let n = e.editorView.value;
1876
- n && (wt(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1953
+ n && (Ct(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
1877
1954
  }
1878
1955
  return {
1879
1956
  showWatermark: t,
@@ -1883,18 +1960,18 @@ function Jr(e) {
1883
1960
  }
1884
1961
  //#endregion
1885
1962
  //#region src/composables/useOutlineSidebar.ts
1886
- function Yr(e) {
1963
+ function pi(e) {
1887
1964
  function t() {
1888
1965
  if (!e.showOutline.value) {
1889
1966
  let t = e.editorView.value;
1890
- t && (e.outlineHeadings.value = Tt(t.state.doc));
1967
+ t && (e.outlineHeadings.value = Lt(t.state.doc));
1891
1968
  }
1892
1969
  e.showOutline.value = !e.showOutline.value;
1893
1970
  }
1894
1971
  function n(t) {
1895
1972
  let n = e.editorView.value;
1896
1973
  if (!n) return;
1897
- let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = he.near(r);
1974
+ let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = Y.near(r);
1898
1975
  n.dispatch(n.state.tr.setSelection(i).scrollIntoView()), n.focus();
1899
1976
  }
1900
1977
  function r() {
@@ -1913,7 +1990,7 @@ function Yr(e) {
1913
1990
  }
1914
1991
  //#endregion
1915
1992
  //#region src/composables/useKeyboardShortcuts.ts
1916
- function Xr(e) {
1993
+ function mi(e) {
1917
1994
  function t(t) {
1918
1995
  if (t.key === "F1") {
1919
1996
  t.preventDefault(), e.showKeyboardShortcuts.value = !0;
@@ -1921,26 +1998,26 @@ function Xr(e) {
1921
1998
  }
1922
1999
  e.handleZoomKeyDown(t), (t.ctrlKey || t.metaKey) && (e.disableFindReplaceShortcuts?.() && (t.key === "f" || t.key === "h") || (t.key === "f" || t.key === "h" ? (t.preventDefault(), e.showFindReplace.value = !0) : t.key === "k" ? (t.preventDefault(), e.showHyperlink.value = !0) : t.key === "/" && (t.preventDefault(), e.showKeyboardShortcuts.value = !e.showKeyboardShortcuts.value)));
1923
2000
  }
1924
- return L(() => window.addEventListener("keydown", t)), I(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
2001
+ return le(() => window.addEventListener("keydown", t)), I(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
1925
2002
  }
1926
2003
  //#endregion
1927
2004
  //#region src/composables/useCommentManagement.ts
1928
- function Zr(e) {
1929
- let t = () => U(e.author) ?? "User";
2005
+ function hi(e) {
2006
+ let t = () => B(e.author) ?? "User";
1930
2007
  function n(t) {
1931
2008
  e.comments.value = t, e.commentCallbacks?.onCommentsChange?.(t);
1932
2009
  }
1933
2010
  function r() {
1934
- jt(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
2011
+ Ut(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
1935
2012
  }
1936
2013
  function i(t, n, i) {
1937
- return r(), Ot(e.commentIdAllocator, t, n, i);
2014
+ return r(), Bt(e.commentIdAllocator, t, n, i);
1938
2015
  }
1939
2016
  function a(t) {
1940
2017
  let i = e.getDocument(), a = e.editorView.value;
1941
2018
  if (!i?.package?.document || !a) return null;
1942
2019
  i.package.document.comments || (i.package.document.comments = []), r();
1943
- let o = Et(a, t, e.commentIdAllocator);
2020
+ let o = Rt(a, t, e.commentIdAllocator);
1944
2021
  return o ? (i.package.document.comments.push(o), n([...i.package.document.comments]), e.showSidebar.value = !0, e.emit("change", i), e.contentChangeSubscribers.forEach((e) => e(i)), o.id) : null;
1945
2022
  }
1946
2023
  function o(t, r, a) {
@@ -1959,7 +2036,7 @@ function Zr(e) {
1959
2036
  let n = e.editorView.value;
1960
2037
  if (!n) return !1;
1961
2038
  r();
1962
- let i = Dt(n, t, e.commentIdAllocator);
2039
+ let i = zt(n, t, e.commentIdAllocator);
1963
2040
  return i && (e.extractCommentsAndChanges(), e.showSidebar.value = !0), i;
1964
2041
  }
1965
2042
  function l(n, r) {
@@ -1986,36 +2063,26 @@ function Zr(e) {
1986
2063
  }
1987
2064
  function p(t, n) {
1988
2065
  let r = e.editorView.value;
1989
- r && (vt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2066
+ r && (_t(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1990
2067
  }
1991
2068
  function m(t, n) {
1992
2069
  let r = e.editorView.value;
1993
- r && (St(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
2070
+ r && (xt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
1994
2071
  }
1995
2072
  function h(t) {
1996
2073
  let n = e.editorView.value;
1997
- n && (yt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2074
+ n && (vt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
1998
2075
  }
1999
2076
  function g(t) {
2000
2077
  let n = e.editorView.value;
2001
- n && (Ct(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2078
+ n && (St(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
2002
2079
  }
2003
2080
  function _(r, a) {
2004
- let o = e.getDocument(), s = e.editorView.value;
2005
- if (!o?.package?.document || !s) return;
2081
+ let o = e.getDocument();
2082
+ if (!o?.package?.document) return;
2006
2083
  o.package.document.comments || (o.package.document.comments = []);
2007
- let c = s.state.schema.marks.comment;
2008
- if (!c) return;
2009
- let l = null, u = s.state.schema.marks.insertion, d = s.state.schema.marks.deletion;
2010
- if (s.state.doc.descendants((e, t) => {
2011
- if (l !== null) return !1;
2012
- for (let n of e.marks) if ((n.type === u || n.type === d) && n.attrs.revisionId === r) return l = t, !1;
2013
- return !0;
2014
- }), l === null) return;
2015
- let f = i(a, t());
2016
- o.package.document.comments.push(f), n([...o.package.document.comments]);
2017
- let p = l, m = Math.min(p + 1, s.state.doc.content.size);
2018
- s.dispatch(s.state.tr.addMark(p, m, c.create({ commentId: f.id }))), e.emit("change", o);
2084
+ let s = i(a, t(), r);
2085
+ o.package.document.comments.push(s), n([...o.package.document.comments]), e.emit("change", o);
2019
2086
  }
2020
2087
  return {
2021
2088
  addComment: a,
@@ -2035,8 +2102,8 @@ function Zr(e) {
2035
2102
  }
2036
2103
  //#endregion
2037
2104
  //#region src/composables/useHostCallbacks.ts
2038
- function Qr(e, t) {
2039
- return K(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2105
+ function gi(e, t) {
2106
+ return U(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
2040
2107
  onCommentAdd: (t) => e.onCommentAdd?.(t),
2041
2108
  onCommentResolve: (t) => e.onCommentResolve?.(t),
2042
2109
  onCommentDelete: (t) => e.onCommentDelete?.(t),
@@ -2046,11 +2113,11 @@ function Qr(e, t) {
2046
2113
  }
2047
2114
  //#endregion
2048
2115
  //#region src/composables/useCommentLifecycle.ts
2049
- function $r(e) {
2050
- let t = z(null), n = z(null), r = z(null), i = z(!1);
2116
+ function _i(e) {
2117
+ let t = R(null), n = R(null), r = R(null), i = R(!1);
2051
2118
  function a() {
2052
2119
  let t = e.getDocument(), n = e.editorView.value;
2053
- !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = Mt(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
2120
+ !t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = Wt(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
2054
2121
  }
2055
2122
  function o() {
2056
2123
  e.stateTick.value;
@@ -2069,7 +2136,7 @@ function $r(e) {
2069
2136
  t.value = null;
2070
2137
  return;
2071
2138
  }
2072
- let s = o.getBoundingClientRect(), c = Vt(a, r);
2139
+ let s = o.getBoundingClientRect(), c = tn(a, r);
2073
2140
  if (!c) {
2074
2141
  t.value = null;
2075
2142
  return;
@@ -2097,7 +2164,7 @@ function $r(e) {
2097
2164
  for (let t of r) {
2098
2165
  if (t.type.name === "comment" && t.attrs.commentId != null) {
2099
2166
  let n = t.attrs.commentId;
2100
- if (n === kt || e.resolvedCommentIds.value.has(n)) continue;
2167
+ if (n === Vt || e.resolvedCommentIds.value.has(n)) continue;
2101
2168
  i = `comment-${n}`;
2102
2169
  break;
2103
2170
  }
@@ -2122,7 +2189,7 @@ function $r(e) {
2122
2189
  }, r.value = t.value?.top ?? null;
2123
2190
  let s = i.state.schema.marks.comment;
2124
2191
  if (s) {
2125
- let e = i.state.tr.addMark(a, o, s.create({ commentId: kt }));
2192
+ let e = i.state.tr.addMark(a, o, s.create({ commentId: Vt }));
2126
2193
  i.dispatch(e);
2127
2194
  }
2128
2195
  e.showSidebar.value = !0, e.isAddingComment.value = !0, t.value = null;
@@ -2130,8 +2197,8 @@ function $r(e) {
2130
2197
  function l(t) {
2131
2198
  let i = e.getDocument(), a = e.editorView.value;
2132
2199
  if (!i?.package) return;
2133
- i.package.document.comments || (i.package.document.comments = []), jt(e.commentIdAllocator, i.package.document.comments, a);
2134
- let o = Ot(e.commentIdAllocator, t, U(e.author) ?? "User");
2200
+ i.package.document.comments || (i.package.document.comments = []), Ut(e.commentIdAllocator, i.package.document.comments, a);
2201
+ let o = Bt(e.commentIdAllocator, t, B(e.author) ?? "User");
2135
2202
  i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments], e.commentCallbacks?.onCommentsChange?.(e.comments.value), e.commentCallbacks?.onCommentAdd?.(o);
2136
2203
  let s = n.value;
2137
2204
  if (a && s && s.from !== s.to) {
@@ -2154,13 +2221,13 @@ function $r(e) {
2154
2221
  function d(t) {
2155
2222
  e.showSidebar.value = !0;
2156
2223
  }
2157
- K([
2224
+ U([
2158
2225
  e.stateTick,
2159
2226
  e.isAddingComment,
2160
2227
  e.zoom
2161
- ], () => o()), K(e.stateTick, () => s()), K(e.stateTick, () => a());
2228
+ ], () => o()), U(e.stateTick, () => s()), U(e.stateTick, () => a());
2162
2229
  let f = null;
2163
- return L(() => {
2230
+ return le(() => {
2164
2231
  f = new ResizeObserver(() => o()), e.pagesRef.value && f.observe(e.pagesRef.value), window.addEventListener("resize", o);
2165
2232
  }), I(() => {
2166
2233
  f?.disconnect(), window.removeEventListener("resize", o);
@@ -2180,8 +2247,8 @@ function $r(e) {
2180
2247
  }
2181
2248
  //#endregion
2182
2249
  //#region src/composables/useImageActions.ts
2183
- function ei(e) {
2184
- let t = de(null), n = z(!1), r = D(() => {
2250
+ function vi(e) {
2251
+ let t = pe(null), n = R(!1), r = E(() => {
2185
2252
  e.stateTick.value;
2186
2253
  let n = e.editorView.value, r = t.value;
2187
2254
  if (!n || !r) return null;
@@ -2192,28 +2259,15 @@ function ei(e) {
2192
2259
  cssFloat: i.attrs.cssFloat ?? null
2193
2260
  };
2194
2261
  });
2195
- function i(t) {
2196
- let n = e.editorView.value;
2197
- if (!n) return;
2198
- let r = n.state.schema.nodes.image;
2199
- if (!r) return;
2200
- let i = r.create({
2201
- src: t.src,
2202
- alt: t.alt,
2203
- width: t.width,
2204
- height: t.height
2205
- });
2206
- xt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
2207
- }
2208
- function a(n) {
2262
+ function i(n) {
2209
2263
  let r = e.editorView.value, i = t.value;
2210
2264
  if (!r || !i) return;
2211
- let a = rt(n);
2265
+ let a = ut(n);
2212
2266
  if (!a) return;
2213
- let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: Qe(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2267
+ let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: at(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
2214
2268
  l && (l(r.state, (e) => r.dispatch(e), r), r.focus());
2215
2269
  }
2216
- function o(n) {
2270
+ function a(n) {
2217
2271
  let r = e.editorView.value, i = t.value;
2218
2272
  if (!r || !i) return;
2219
2273
  let a = r.state.doc.nodeAt(i.pmPos);
@@ -2232,15 +2286,14 @@ function ei(e) {
2232
2286
  selectedImage: t,
2233
2287
  imageInteracting: n,
2234
2288
  imageToolbarContext: r,
2235
- handleInsertImage: i,
2236
- handleToolbarImageWrap: a,
2237
- handleImageTransform: o
2289
+ handleToolbarImageWrap: i,
2290
+ handleImageTransform: a
2238
2291
  };
2239
2292
  }
2240
2293
  //#endregion
2241
2294
  //#region src/utils/imageClipboard.ts
2242
- function ti(e, t, n) {
2243
- let r = st(e.state), i = e.state.schema.marks.insertion;
2295
+ function yi(e, t, n) {
2296
+ let r = ht(e.state), i = e.state.schema.marks.insertion;
2244
2297
  if (!r || !i) return;
2245
2298
  let a = t.selection.from, o = a - n.nodeSize;
2246
2299
  o < 0 || t.addMark(o, a, i.create({
@@ -2249,10 +2302,10 @@ function ti(e, t, n) {
2249
2302
  date: r.date
2250
2303
  }));
2251
2304
  }
2252
- function ni(e, t) {
2305
+ function bi(e, t) {
2253
2306
  return e.getBlob(t);
2254
2307
  }
2255
- function ri(e, t) {
2308
+ function xi(e, t) {
2256
2309
  let n = e.state.doc.nodeAt(t);
2257
2310
  if (!n || n.type.name !== "image") return;
2258
2311
  let r = `<img src="${n.attrs.src}" data-pm-image="true" data-width="${n.attrs.width ?? ""}" data-height="${n.attrs.height ?? ""}" data-wrap-type="${n.attrs.wrapType ?? ""}" data-display-mode="${n.attrs.displayMode ?? ""}" data-rid="${n.attrs.rId ?? ""}" />`, i = new ClipboardItem({
@@ -2264,13 +2317,13 @@ function ri(e, t) {
2264
2317
  e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
2265
2318
  });
2266
2319
  }
2267
- function ii(e) {
2320
+ function Si(e) {
2268
2321
  return new Promise((t, n) => {
2269
2322
  let r = new FileReader();
2270
2323
  r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
2271
2324
  });
2272
2325
  }
2273
- function ai(e) {
2326
+ function Ci(e) {
2274
2327
  return new Promise((t) => {
2275
2328
  let n = new Image();
2276
2329
  n.onload = () => t({
@@ -2282,13 +2335,13 @@ function ai(e) {
2282
2335
  }), n.src = e;
2283
2336
  });
2284
2337
  }
2285
- async function oi(e) {
2338
+ async function wi(e) {
2286
2339
  try {
2287
2340
  let t = await navigator.clipboard.read();
2288
2341
  for (let n of t) {
2289
2342
  let t = n.types.find((e) => e.startsWith("image/"));
2290
2343
  if (t) {
2291
- let r = await ii(await ni(n, t)), i = await ai(r), a = i.width, o = i.height;
2344
+ let r = await Si(await bi(n, t)), i = await Ci(r), a = i.width, o = i.height;
2292
2345
  a > 612 && (o = Math.round(612 / a * o), a = 612);
2293
2346
  let s = e.state.schema.nodes.image.create({
2294
2347
  src: r,
@@ -2298,11 +2351,11 @@ async function oi(e) {
2298
2351
  wrapType: "inline",
2299
2352
  displayMode: "inline"
2300
2353
  }), c = e.state.tr.replaceSelectionWith(s);
2301
- ti(e, c, s), e.dispatch(c);
2354
+ yi(e, c, s), e.dispatch(c);
2302
2355
  return;
2303
2356
  }
2304
2357
  if (n.types.includes("text/html")) {
2305
- let t = await (await ni(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2358
+ let t = await (await bi(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
2306
2359
  if (r && r[1]) {
2307
2360
  let n = r[1], i = t.match(/data-width="(\d+)"/), a = t.match(/data-height="(\d+)"/), o = i ? Number(i[1]) : 200, s = a ? Number(a[1]) : 200, c = e.state.schema.nodes.image.create({
2308
2361
  src: n,
@@ -2312,12 +2365,12 @@ async function oi(e) {
2312
2365
  wrapType: "inline",
2313
2366
  displayMode: "inline"
2314
2367
  }), l = e.state.tr.replaceSelectionWith(c);
2315
- ti(e, l, c), e.dispatch(l);
2368
+ yi(e, l, c), e.dispatch(l);
2316
2369
  return;
2317
2370
  }
2318
2371
  }
2319
2372
  if (n.types.includes("text/plain")) {
2320
- let t = await (await ni(n, "text/plain")).text();
2373
+ let t = await (await bi(n, "text/plain")).text();
2321
2374
  if (t && t !== "[image]") {
2322
2375
  let { from: n } = e.state.selection;
2323
2376
  e.dispatch(e.state.tr.insertText(t, n));
@@ -2333,14 +2386,14 @@ async function oi(e) {
2333
2386
  }
2334
2387
  }
2335
2388
  }
2336
- function si(e, t) {
2389
+ function Ti(e, t) {
2337
2390
  let n = e.state.doc.nodeAt(t);
2338
2391
  if (!n || n.type.name !== "image") return;
2339
2392
  let r = document.createElement("input");
2340
2393
  r.type = "file", r.accept = "image/*", r.onchange = async () => {
2341
2394
  let i = r.files?.[0];
2342
2395
  if (!i) return;
2343
- let a = await ii(i), o = await ai(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
2396
+ let a = await Si(i), o = await Ci(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
2344
2397
  try {
2345
2398
  let r = e.state.tr.setNodeMarkup(t, void 0, {
2346
2399
  ...n.attrs,
@@ -2355,8 +2408,8 @@ function si(e, t) {
2355
2408
  }
2356
2409
  //#endregion
2357
2410
  //#region src/composables/useContextMenus.ts
2358
- function ci(e) {
2359
- let { t } = n(), r = z({
2411
+ function Ei(e) {
2412
+ let { t } = d(), n = R({
2360
2413
  isOpen: !1,
2361
2414
  position: {
2362
2415
  x: 0,
@@ -2367,7 +2420,7 @@ function ci(e) {
2367
2420
  onImage: !1,
2368
2421
  canMergeCells: !1,
2369
2422
  canSplitCell: !1
2370
- }), i = z(null), a = D(() => [
2423
+ }), r = R(null), i = E(() => [
2371
2424
  {
2372
2425
  action: "cut",
2373
2426
  label: t("contextMenu.cut"),
@@ -2390,16 +2443,16 @@ function ci(e) {
2390
2443
  shortcut: t("contextMenu.deleteShortcut")
2391
2444
  }
2392
2445
  ]);
2393
- function o(t) {
2394
- let n = e.editorView.value;
2395
- if (!n) return;
2396
- let a = t.target, o = et(a);
2446
+ function a(t) {
2447
+ let i = e.editorView.value;
2448
+ if (!i) return;
2449
+ let a = t.target, o = st(a);
2397
2450
  if (o) {
2398
2451
  let a = Number(o.dataset.pmStart);
2399
2452
  if (!isNaN(a)) {
2400
2453
  try {
2401
- let e = Y.create(n.state.doc, a);
2402
- n.dispatch(n.state.tr.setSelection(e));
2454
+ let e = J.create(i.state.doc, a);
2455
+ i.dispatch(i.state.tr.setSelection(e));
2403
2456
  } catch {}
2404
2457
  e.selectedImage.value = {
2405
2458
  element: o,
@@ -2407,32 +2460,32 @@ function ci(e) {
2407
2460
  width: o.offsetWidth,
2408
2461
  height: o.offsetHeight
2409
2462
  }, e.clearOverlay();
2410
- let s = n.state.doc.nodeAt(a);
2463
+ let s = i.state.doc.nodeAt(a);
2411
2464
  if (s && s.type.name === "image") {
2412
- let n = s.attrs.wrapType ?? "inline", c = s.attrs.cssFloat;
2413
- i.value = {
2465
+ let i = s.attrs.wrapType ?? "inline", c = s.attrs.cssFloat;
2466
+ r.value = {
2414
2467
  open: !0,
2415
2468
  position: {
2416
2469
  x: t.clientX,
2417
2470
  y: t.clientY
2418
2471
  },
2419
2472
  pmPos: a,
2420
- currentWrapType: n,
2473
+ currentWrapType: i,
2421
2474
  currentCssFloat: c ?? null,
2422
- inlinePositionEmu: n === "inline" ? Qe(o, e.zoom.value) : void 0
2423
- }, r.value.isOpen = !1;
2475
+ inlinePositionEmu: i === "inline" ? at(o, e.zoom.value) : void 0
2476
+ }, n.value.isOpen = !1;
2424
2477
  return;
2425
2478
  }
2426
2479
  }
2427
2480
  }
2428
2481
  {
2429
- let { from: r, to: i } = n.state.selection, a = e.resolvePos(t.clientX, t.clientY);
2430
- if (a !== null && (a < r || a > i)) try {
2482
+ let { from: n, to: r } = i.state.selection, a = e.resolvePos(t.clientX, t.clientY);
2483
+ if (a !== null && (a < n || a > r)) try {
2431
2484
  e.setPmSelection(a);
2432
2485
  } catch {}
2433
2486
  }
2434
- let s = Q(n.state), { empty: c } = n.state.selection;
2435
- i.value &&= null, r.value = {
2487
+ let s = Ye(i.state), { empty: c } = i.state.selection;
2488
+ r.value &&= null, n.value = {
2436
2489
  isOpen: !0,
2437
2490
  position: {
2438
2491
  x: t.clientX,
@@ -2445,13 +2498,13 @@ function ci(e) {
2445
2498
  canSplitCell: !!s.canSplitCell
2446
2499
  };
2447
2500
  }
2448
- function s(t) {
2449
- let n = e.editorView.value, a = e.selectedImage.value;
2450
- if (!n || !a) return;
2451
- let o = n.state.doc.nodeAt(a.pmPos);
2501
+ function o(t) {
2502
+ let i = e.editorView.value, a = e.selectedImage.value;
2503
+ if (!i || !a) return;
2504
+ let o = i.state.doc.nodeAt(a.pmPos);
2452
2505
  if (!o || o.type.name !== "image") return;
2453
2506
  let s = o.attrs.wrapType ?? "inline", c = o.attrs.cssFloat;
2454
- i.value = {
2507
+ r.value = {
2455
2508
  open: !0,
2456
2509
  position: {
2457
2510
  x: t.clientX,
@@ -2460,32 +2513,32 @@ function ci(e) {
2460
2513
  pmPos: a.pmPos,
2461
2514
  currentWrapType: s,
2462
2515
  currentCssFloat: c ?? null,
2463
- inlinePositionEmu: s === "inline" ? Qe(a.element, e.zoom.value) : void 0
2464
- }, r.value.isOpen = !1;
2516
+ inlinePositionEmu: s === "inline" ? at(a.element, e.zoom.value) : void 0
2517
+ }, n.value.isOpen = !1;
2465
2518
  }
2466
- function c(t) {
2467
- let n = e.editorView.value, r = i.value;
2468
- if (!n || !r) return;
2469
- let a = e.getCommands(), o = r.inlinePositionEmu && t !== "inline" ? { initialPositionEmu: r.inlinePositionEmu } : void 0, s = a.setImageWrapType?.(r.pmPos, t, o);
2519
+ function s(t) {
2520
+ let n = e.editorView.value, i = r.value;
2521
+ if (!n || !i) return;
2522
+ let a = e.getCommands(), o = i.inlinePositionEmu && t !== "inline" ? { initialPositionEmu: i.inlinePositionEmu } : void 0, s = a.setImageWrapType?.(i.pmPos, t, o);
2470
2523
  s && (s(n.state, (e) => n.dispatch(e), n), n.focus());
2471
2524
  }
2472
- function l(t) {
2525
+ function c(t) {
2473
2526
  let n = e.editorView.value;
2474
2527
  if (!n) return;
2475
2528
  let r = e.getCommands();
2476
2529
  switch (t) {
2477
2530
  case "cut":
2478
2531
  if (e.selectedImage.value) {
2479
- ri(n, e.selectedImage.value.pmPos);
2532
+ xi(n, e.selectedImage.value.pmPos);
2480
2533
  let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
2481
2534
  r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
2482
2535
  } else document.execCommand("cut");
2483
2536
  break;
2484
2537
  case "copy":
2485
- e.selectedImage.value ? ri(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2538
+ e.selectedImage.value ? xi(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
2486
2539
  break;
2487
2540
  case "paste":
2488
- oi(n);
2541
+ wi(n);
2489
2542
  break;
2490
2543
  case "pasteAsPlainText":
2491
2544
  navigator.clipboard.readText().then((e) => {
@@ -2498,7 +2551,7 @@ function ci(e) {
2498
2551
  break;
2499
2552
  }
2500
2553
  case "selectAll": {
2501
- let e = he.create(n.state.doc, 0, n.state.doc.content.size);
2554
+ let e = Y.create(n.state.doc, 0, n.state.doc.content.size);
2502
2555
  n.dispatch(n.state.tr.setSelection(e));
2503
2556
  break;
2504
2557
  }
@@ -2506,7 +2559,7 @@ function ci(e) {
2506
2559
  e.selectedImage.value && (e.showImageProperties.value = !0);
2507
2560
  break;
2508
2561
  case "replaceImage":
2509
- e.selectedImage.value && si(n, e.selectedImage.value.pmPos);
2562
+ e.selectedImage.value && Ti(n, e.selectedImage.value.pmPos);
2510
2563
  break;
2511
2564
  case "deleteImage":
2512
2565
  if (e.selectedImage.value) {
@@ -2530,39 +2583,39 @@ function ci(e) {
2530
2583
  n.focus();
2531
2584
  }
2532
2585
  return {
2533
- contextMenu: r,
2534
- imageContextMenu: i,
2535
- imageContextMenuTextActions: a,
2536
- handleContextMenu: o,
2537
- handleSelectedImageContextMenu: s,
2538
- handleImageWrapSelect: c,
2539
- handleContextMenuAction: l
2586
+ contextMenu: n,
2587
+ imageContextMenu: r,
2588
+ imageContextMenuTextActions: i,
2589
+ handleContextMenu: a,
2590
+ handleSelectedImageContextMenu: o,
2591
+ handleImageWrapSelect: s,
2592
+ handleContextMenuAction: c
2540
2593
  };
2541
2594
  }
2542
2595
  //#endregion
2543
2596
  //#region src/composables/usePagesPointer.ts
2544
- var li = 500;
2545
- function ui(e) {
2546
- let t = z(null), n = null;
2597
+ var Di = 500;
2598
+ function Oi(e) {
2599
+ let t = R(null), n = null;
2547
2600
  function r() {
2548
2601
  n !== null && (clearTimeout(n), n = null);
2549
2602
  }
2550
- let i = de(null), a = 0, o = null, s = 0, c = !1, l = null, u = w({
2603
+ let i = pe(null), a = 0, o = null, s = 0, c = !1, l = null, u = qt(), d = ne({
2551
2604
  pagesContainer: e.pagesRef,
2552
2605
  onScrollExtendSelection: (e, t) => {
2553
2606
  if (!c || l === null) return;
2554
- let n = p(e, t);
2555
- n !== null && n !== l && h(l, n);
2607
+ let n = m(e, t);
2608
+ n !== null && n !== l && g(l, n);
2556
2609
  }
2557
- }), d = z({
2610
+ }), f = R({
2558
2611
  currentPage: 1,
2559
2612
  totalPages: 1,
2560
2613
  visible: !1
2561
- }), f = null;
2562
- function p(t, n) {
2563
- return Ut(e.pagesRef.value, e.editorView.value, t, n);
2614
+ }), p = null;
2615
+ function m(t, n) {
2616
+ return rn(e.pagesRef.value, e.editorView.value, t, n);
2564
2617
  }
2565
- function m() {
2618
+ function h() {
2566
2619
  let t = i.value;
2567
2620
  if (t?.headerFooter && e.getHfPmView) {
2568
2621
  let n = e.getHfPmView(t.headerFooter);
@@ -2570,42 +2623,42 @@ function ui(e) {
2570
2623
  }
2571
2624
  return e.editorView.value;
2572
2625
  }
2573
- function h(e, t) {
2574
- let n = m();
2626
+ function g(e, t) {
2627
+ let n = h();
2575
2628
  if (n) try {
2576
- let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = he.between(r, i);
2629
+ let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = Y.between(r, i);
2577
2630
  n.dispatch(n.state.tr.setSelection(a));
2578
2631
  } catch {}
2579
2632
  }
2580
- function g(t) {
2581
- Ht(e.pagesRef.value, e.pagesViewportRef.value, t);
2582
- }
2583
2633
  function _(t) {
2584
- Wt(e.pagesRef.value, t, h, i.value?.position);
2634
+ nn(e.pagesRef.value, e.pagesViewportRef.value, t);
2585
2635
  }
2586
2636
  function v(t) {
2587
- Gt(e.pagesRef.value, t, h, i.value?.position);
2637
+ an(e.pagesRef.value, t, g, i.value?.position);
2588
2638
  }
2589
2639
  function y(t) {
2640
+ on(e.pagesRef.value, t, g, i.value?.position);
2641
+ }
2642
+ function b(t) {
2590
2643
  let n = e.editorView.value;
2591
2644
  if (!n) return;
2592
2645
  let r = null;
2593
2646
  if (n.state.doc.descendants((e, n) => r === null ? (e.attrs?.bookmarks)?.some((e) => e.name === t) ? (r = n, !1) : !0 : !1), r !== null) {
2594
- g(r);
2647
+ _(r);
2595
2648
  try {
2596
- h(Math.min(r + 1, n.state.doc.content.size));
2649
+ g(Math.min(r + 1, n.state.doc.content.size));
2597
2650
  } catch {
2598
- h(r);
2651
+ g(r);
2599
2652
  }
2600
2653
  }
2601
2654
  }
2602
- function b(a) {
2655
+ function x(a) {
2603
2656
  if (e.readOnly.value || c) return;
2604
2657
  let o = e.pagesRef.value;
2605
2658
  if (!o) return;
2606
2659
  let s = e.pagesViewportRef.value;
2607
2660
  if (!s) return;
2608
- let l = Pt({
2661
+ let l = Kt({
2609
2662
  mouseX: a.clientX,
2610
2663
  mouseY: a.clientY,
2611
2664
  pagesContainer: o,
@@ -2615,7 +2668,7 @@ function ui(e) {
2615
2668
  if (!l) {
2616
2669
  n === null && (n = setTimeout(() => {
2617
2670
  t.value = null, n = null;
2618
- }, Nt));
2671
+ }, Gt));
2619
2672
  return;
2620
2673
  }
2621
2674
  let u = s.getBoundingClientRect();
@@ -2626,26 +2679,26 @@ function ui(e) {
2626
2679
  cellPmPos: l.cellPmPos
2627
2680
  }, r();
2628
2681
  }
2629
- function x(n) {
2682
+ function S(n) {
2630
2683
  n.preventDefault(), n.stopPropagation();
2631
2684
  let r = t.value, i = e.editorView.value;
2632
2685
  if (!r || !i) return;
2633
- let a = i.state.tr.setSelection(he.create(i.state.doc, r.cellPmPos + 1));
2686
+ let a = i.state.tr.setSelection(Y.create(i.state.doc, r.cellPmPos + 1));
2634
2687
  i.dispatch(a);
2635
2688
  let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow?.() : o.addColumnRight?.();
2636
2689
  s && (s(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
2637
2690
  }
2638
- function S(t) {
2691
+ function C(t) {
2639
2692
  let n = t.target?.closest("a[href]");
2640
2693
  if (!n) return;
2641
2694
  t.preventDefault();
2642
2695
  let r = n.getAttribute("href") || "";
2643
2696
  if (r.startsWith("#")) {
2644
2697
  let e = r.slice(1);
2645
- e && y(e);
2698
+ e && b(e);
2646
2699
  return;
2647
2700
  }
2648
- let i = m();
2701
+ let i = h();
2649
2702
  if (i && i.state.selection.from !== i.state.selection.to) return;
2650
2703
  let a = e.pagesViewportRef.value;
2651
2704
  if (!a) return;
@@ -2660,7 +2713,7 @@ function ui(e) {
2660
2713
  }
2661
2714
  };
2662
2715
  }
2663
- function C(t) {
2716
+ function ee(t) {
2664
2717
  let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
2665
2718
  if (!o) return;
2666
2719
  let s = r ? "header" : "footer", c = e.getDocument();
@@ -2726,7 +2779,7 @@ function ui(e) {
2726
2779
  }
2727
2780
  };
2728
2781
  }
2729
- function ee(t) {
2782
+ function te(t) {
2730
2783
  let n = e.getDocument(), r = i.value;
2731
2784
  if (!n?.package || !r) return;
2732
2785
  let a = r.position === "header" ? n.package.headers : n.package.footers;
@@ -2734,7 +2787,7 @@ function ui(e) {
2734
2787
  let o = a.get(r.rId);
2735
2788
  o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
2736
2789
  }
2737
- function te() {
2790
+ function w() {
2738
2791
  let t = e.getDocument(), n = i.value;
2739
2792
  if (!t?.package || !n || !n.rId) {
2740
2793
  i.value = null;
@@ -2766,57 +2819,65 @@ function ui(e) {
2766
2819
  };
2767
2820
  i.value = null, e.setDocument?.(d), e.syncHfPMs?.(), e.reLayout(), e.emit("change", d);
2768
2821
  }
2769
- function ne(t) {
2822
+ function T(t) {
2770
2823
  if (t.button !== 0 || e.imageInteracting.value) return;
2771
2824
  let n = e.editorView.value;
2772
2825
  if (!n) return;
2773
2826
  let r = t.target;
2774
2827
  i.value && (r.closest(".layout-page-header") || r.closest(".layout-page-footer") || r.closest(".hf-editor") || (i.value = null, n.focus()));
2775
- let u = m() ?? n;
2776
- if (!e.readOnly.value && e.tableResize.tryStartResize(t, u)) return;
2777
- let d = et(r);
2778
- if (d) {
2828
+ let d = h() ?? n;
2829
+ if (!e.readOnly.value && e.tableResize.tryStartResize(t, d)) return;
2830
+ let f = st(r);
2831
+ if (f) {
2779
2832
  t.preventDefault(), t.stopPropagation();
2780
- let n = Number(d.dataset.pmStart);
2833
+ let n = Number(f.dataset.pmStart);
2781
2834
  if (!isNaN(n)) {
2782
2835
  try {
2783
- u.dispatch(u.state.tr.setSelection(Y.create(u.state.doc, n)));
2836
+ d.dispatch(d.state.tr.setSelection(J.create(d.state.doc, n)));
2784
2837
  } catch {}
2785
2838
  e.selectedImage.value = {
2786
- element: d,
2839
+ element: f,
2787
2840
  pmPos: n,
2788
- width: d.offsetWidth,
2789
- height: d.offsetHeight
2841
+ width: f.offsetWidth,
2842
+ height: f.offsetHeight
2790
2843
  }, e.clearOverlay();
2791
2844
  }
2792
- u.focus();
2845
+ d.focus();
2793
2846
  return;
2794
2847
  }
2795
2848
  e.selectedImage.value = null, t.preventDefault();
2796
- let f = p(t.clientX, t.clientY);
2797
- if (f === null) {
2798
- u.focus();
2849
+ let p = m(t.clientX, t.clientY);
2850
+ if (p === null) {
2851
+ d.focus();
2799
2852
  return;
2800
2853
  }
2801
- let g = Date.now();
2802
- if (g - a < li && o === f ? s++ : s = 1, a = g, o = f, s === 2) _(f);
2803
- else if (s >= 3) v(f), s = 0;
2854
+ let _ = Date.now();
2855
+ if (_ - a < Di && o === p ? s++ : s = 1, a = _, o = p, s === 2) v(p);
2856
+ else if (s >= 3) y(p), s = 0;
2804
2857
  else {
2805
2858
  if (t.shiftKey) {
2806
- let { from: e } = u.state.selection;
2807
- h(e, f);
2808
- } else h(f);
2809
- l = f, c = !0;
2859
+ let { from: e } = d.state.selection;
2860
+ g(e, p);
2861
+ } else g(p);
2862
+ l = p, c = !0, u.begin(Jt(d, p));
2810
2863
  }
2811
- u.focus();
2864
+ d.focus();
2812
2865
  }
2813
- function T(e) {
2866
+ function E(e) {
2814
2867
  if (!c || l === null) return;
2815
- let t = p(e.clientX, e.clientY);
2816
- t !== null && t !== l && h(l, t), u.updateMousePosition(e.clientX, e.clientY);
2868
+ let t = m(e.clientX, e.clientY);
2869
+ if (t !== null) {
2870
+ let n = h();
2871
+ if (n && u.update(n, t, e.clientX)) {
2872
+ d.updateMousePosition(e.clientX, e.clientY);
2873
+ return;
2874
+ }
2875
+ t !== l && g(l, t);
2876
+ }
2877
+ d.updateMousePosition(e.clientX, e.clientY);
2817
2878
  }
2818
- function E() {
2819
- c = !1, u.stopAutoScroll();
2879
+ function re() {
2880
+ c = !1, u.end(), d.stopAutoScroll();
2820
2881
  }
2821
2882
  function D() {
2822
2883
  let t = e.pagesViewportRef.value, n = e.layout.value;
@@ -2830,42 +2891,42 @@ function ui(e) {
2830
2891
  }
2831
2892
  o = r + 24, s = e + 2;
2832
2893
  }
2833
- s = Math.min(s, i), d.value = {
2894
+ s = Math.min(s, i), f.value = {
2834
2895
  currentPage: s,
2835
2896
  totalPages: i,
2836
2897
  visible: !0
2837
- }, f && clearTimeout(f), f = setTimeout(() => {
2838
- d.value = {
2839
- ...d.value,
2898
+ }, p && clearTimeout(p), p = setTimeout(() => {
2899
+ f.value = {
2900
+ ...f.value,
2840
2901
  visible: !1
2841
2902
  };
2842
2903
  }, 600);
2843
2904
  }
2844
- return L(() => {
2845
- window.addEventListener("mousemove", T), window.addEventListener("mouseup", E), e.pagesViewportRef.value?.addEventListener("scroll", D, { passive: !0 });
2905
+ return le(() => {
2906
+ window.addEventListener("mousemove", E), window.addEventListener("mouseup", re), e.pagesViewportRef.value?.addEventListener("scroll", D, { passive: !0 });
2846
2907
  }), I(() => {
2847
- r(), window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", E), e.pagesViewportRef.value?.removeEventListener("scroll", D), f && clearTimeout(f);
2908
+ r(), window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", re), e.pagesViewportRef.value?.removeEventListener("scroll", D), p && clearTimeout(p);
2848
2909
  }), {
2849
2910
  tableInsertButton: t,
2850
2911
  hfEdit: i,
2851
- scrollPageInfo: d,
2852
- resolvePos: p,
2853
- setPmSelection: h,
2854
- scrollVisiblePositionIntoView: g,
2855
- navigateToBookmark: y,
2856
- handlePagesMouseDown: ne,
2857
- handlePagesMouseMove: b,
2858
- handlePagesClick: S,
2859
- handlePagesDoubleClick: C,
2860
- handleTableInsertClick: x,
2912
+ scrollPageInfo: f,
2913
+ resolvePos: m,
2914
+ setPmSelection: g,
2915
+ scrollVisiblePositionIntoView: _,
2916
+ navigateToBookmark: b,
2917
+ handlePagesMouseDown: T,
2918
+ handlePagesMouseMove: x,
2919
+ handlePagesClick: C,
2920
+ handlePagesDoubleClick: ee,
2921
+ handleTableInsertClick: S,
2861
2922
  clearTableInsertTimer: r,
2862
- handleHfSave: ee,
2863
- handleHfRemove: te
2923
+ handleHfSave: te,
2924
+ handleHfRemove: w
2864
2925
  };
2865
2926
  }
2866
2927
  //#endregion
2867
2928
  //#region src/composables/useSelectionSync.ts
2868
- function di(e) {
2929
+ function ki(e) {
2869
2930
  let t = null, n = null, r = null;
2870
2931
  function i() {
2871
2932
  let r = e.pagesRef.value;
@@ -2877,8 +2938,8 @@ function di(e) {
2877
2938
  let t = e.pagesRef.value, n = e.editorView.value;
2878
2939
  if (!t || !n || e.isHfEditing?.value) return;
2879
2940
  let i = n.state.selection;
2880
- if (i instanceof Y && i.node.type.name === "image") {
2881
- let n = X(t, i.from), r = n ? et(n) : null;
2941
+ if (i instanceof J && i.node.type.name === "image") {
2942
+ let n = X(t, i.from), r = n ? st(n) : null;
2882
2943
  if (r) {
2883
2944
  let t = e.selectedImage.value;
2884
2945
  (!t || t.element !== r || t.pmPos !== i.from || t.width !== r.offsetWidth || t.height !== r.offsetHeight) && (e.selectedImage.value = {
@@ -2898,10 +2959,10 @@ function di(e) {
2898
2959
  if (!r || !o || (i(), e.isHfEditing?.value)) return;
2899
2960
  a(), ge(r, o.state);
2900
2961
  let s = o.state.selection;
2901
- if (s instanceof Y && s.node.type.name === "image") return;
2962
+ if (s instanceof J && s.node.type.name === "image") return;
2902
2963
  let { from: c, to: l, empty: u } = s, d = r.scrollTop, f = r.scrollLeft, p = e.zoom.value || 1;
2903
2964
  if (u) {
2904
- let e = We(r, c, r.getBoundingClientRect());
2965
+ let e = Ze(r, c, r.getBoundingClientRect());
2905
2966
  if (e) {
2906
2967
  let i = document.createElement("div");
2907
2968
  i.className = "vue-caret", i.style.cssText = `
@@ -2910,9 +2971,9 @@ function di(e) {
2910
2971
  top: ${e.y / p + d}px;
2911
2972
  width: 2px;
2912
2973
  height: ${e.height}px;
2913
- background: #000;
2974
+ background: var(--doc-caret, #000);
2914
2975
  pointer-events: none;
2915
- z-index: ${C.selectionOverlay};
2976
+ z-index: ${S.selectionOverlay};
2916
2977
  `, r.appendChild(i), n = i;
2917
2978
  let a = !0;
2918
2979
  t = setInterval(() => {
@@ -2921,7 +2982,7 @@ function di(e) {
2921
2982
  }
2922
2983
  return;
2923
2984
  }
2924
- let m = Ge(r, c, l, r.getBoundingClientRect());
2985
+ let m = Qe(r, c, l, r.getBoundingClientRect());
2925
2986
  for (let e of m) {
2926
2987
  let t = document.createElement("div");
2927
2988
  t.className = "vue-sel-rect", t.style.cssText = `
@@ -2932,7 +2993,7 @@ function di(e) {
2932
2993
  height: ${e.height / p}px;
2933
2994
  background: rgba(66, 133, 244, 0.3);
2934
2995
  pointer-events: none;
2935
- z-index: ${C.selectionOverlay};
2996
+ z-index: ${S.selectionOverlay};
2936
2997
  `, r.appendChild(t);
2937
2998
  }
2938
2999
  }
@@ -2945,7 +3006,7 @@ function di(e) {
2945
3006
  }
2946
3007
  //#endregion
2947
3008
  //#region src/composables/useMenuActions.ts
2948
- function fi(e) {
3009
+ function Ai(e) {
2949
3010
  function t(t) {
2950
3011
  let n = e.editorView.value;
2951
3012
  if (!n) return;
@@ -2976,7 +3037,7 @@ function fi(e) {
2976
3037
  e.handleClearFormatting();
2977
3038
  break;
2978
3039
  case "insertImage":
2979
- e.showInsertImage.value = !0;
3040
+ e.imageInputRef.value?.click();
2980
3041
  break;
2981
3042
  case "insertLink":
2982
3043
  e.showHyperlink.value = !0;
@@ -2987,6 +3048,12 @@ function fi(e) {
2987
3048
  case "insertPageBreak":
2988
3049
  e.handleInsertPageBreak();
2989
3050
  break;
3051
+ case "insertSectionBreakNextPage":
3052
+ e.handleInsertSectionBreakNextPage();
3053
+ break;
3054
+ case "insertSectionBreakContinuous":
3055
+ e.handleInsertSectionBreakContinuous();
3056
+ break;
2990
3057
  case "insertTOC":
2991
3058
  t("generateTOC");
2992
3059
  break;
@@ -3000,7 +3067,7 @@ function fi(e) {
3000
3067
  e.showKeyboardShortcuts.value = !0;
3001
3068
  break;
3002
3069
  case "reportIssue":
3003
- Ft();
3070
+ Yt();
3004
3071
  break;
3005
3072
  case "dirLTR":
3006
3073
  t("setLtr");
@@ -3018,29 +3085,29 @@ function fi(e) {
3018
3085
  }
3019
3086
  //#endregion
3020
3087
  //#region src/composables/useDocumentLifecycle.ts
3021
- function pi(e) {
3088
+ function ji(e) {
3022
3089
  async function t(t) {
3023
3090
  e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
3024
3091
  }
3025
3092
  function n(t) {
3026
3093
  e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
3027
3094
  }
3028
- K(e.documentBuffer, (e) => {
3095
+ U(e.documentBuffer, (e) => {
3029
3096
  e && t(e);
3030
- }), K(e.document, (e) => {
3097
+ }), U(e.document, (e) => {
3031
3098
  e && n(e);
3032
- }), L(async () => {
3033
- await le();
3099
+ }), le(async () => {
3100
+ await se();
3034
3101
  let r = e.documentBuffer(), i = e.document();
3035
3102
  r ? await t(r) : i && n(i);
3036
3103
  });
3037
3104
  }
3038
3105
  //#endregion
3039
3106
  //#region src/composables/useDocxEditorRefApi.ts
3040
- function mi(e) {
3107
+ function Mi(e) {
3041
3108
  function t() {
3042
3109
  let t = e.pagesRef.value;
3043
- t && nt(t), e.onPrint?.(), window.print();
3110
+ t && lt(t), e.onPrint?.(), window.print();
3044
3111
  }
3045
3112
  function n() {
3046
3113
  t();
@@ -3074,71 +3141,93 @@ function mi(e) {
3074
3141
  function c() {
3075
3142
  let t = e.layout.value, n = e.editorView.value;
3076
3143
  if (!t || !n) return 0;
3077
- let r = ct(t, n.state.selection.from);
3144
+ let r = gt(t, n.state.selection.from);
3078
3145
  return r == null ? 0 : r + 1;
3079
3146
  }
3080
3147
  function l(t) {
3081
3148
  let n = e.editorView.value;
3082
3149
  if (!n) return !1;
3083
- let r = Lt(n.state.doc, t);
3150
+ let r = Zt(n.state.doc, t);
3084
3151
  return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
3085
3152
  }
3086
3153
  function u(t, n) {
3087
- return xe(e.editorView.value, t, n);
3154
+ return we(e.editorView.value, t, n);
3088
3155
  }
3089
3156
  function d() {
3090
- return Ce(e.editorView.value);
3157
+ return Ee(e.editorView.value);
3091
3158
  }
3092
3159
  function f() {
3093
3160
  return e.comments.value;
3094
3161
  }
3095
3162
  function p(t) {
3096
3163
  let n = e.editorView.value;
3097
- return n ? Oe(n.state.doc, t ?? {}) : [];
3164
+ return n ? je(n.state.doc, t ?? {}) : [];
3098
3165
  }
3099
3166
  function m(t) {
3100
3167
  let n = e.editorView.value;
3101
3168
  if (!n) return !1;
3102
- let r = De(n.state.doc, t);
3169
+ let r = Ae(n.state.doc, t);
3103
3170
  return r == null ? !1 : (a(r), !0);
3104
3171
  }
3105
3172
  function h(t, n, r) {
3173
+ let i = Y.between(t.state.doc.resolve(n), t.state.doc.resolve(r));
3174
+ t.dispatch(t.state.tr.setSelection(i)), e.scrollVisiblePositionIntoView(n);
3175
+ }
3176
+ function g(t, n) {
3177
+ let r = e.editorView.value;
3178
+ if (!r) return;
3179
+ let i = xe(r.state.doc, t, n);
3180
+ i && h(r, i.from, i.to);
3181
+ }
3182
+ function _(t) {
3183
+ let n = e.editorView.value;
3184
+ if (!n) return !1;
3185
+ let r = Ce(n, t);
3186
+ return r ? (h(n, r.from, r.to), !0) : !1;
3187
+ }
3188
+ function v(t) {
3189
+ let n = e.editorView.value;
3190
+ if (!n) return !1;
3191
+ let r = Se(n, t);
3192
+ return r ? (h(n, r.from, r.to), !0) : !1;
3193
+ }
3194
+ function y(t, n, r) {
3106
3195
  let i = e.editorView.value;
3107
3196
  if (!i) return !1;
3108
3197
  try {
3109
- return i.dispatch(Me(i.state, t, n, r)), !0;
3198
+ return i.dispatch(Pe(i.state, t, n, r)), !0;
3110
3199
  } catch (e) {
3111
- if (e instanceof It) return !1;
3200
+ if (e instanceof Xt) return !1;
3112
3201
  throw e;
3113
3202
  }
3114
3203
  }
3115
- function g(t, n) {
3204
+ function b(t, n) {
3116
3205
  let r = e.editorView.value;
3117
3206
  if (!r) return !1;
3118
3207
  try {
3119
- return r.dispatch(ke(r.state, t, n)), !0;
3208
+ return r.dispatch(Me(r.state, t, n)), !0;
3120
3209
  } catch (e) {
3121
- if (e instanceof It) return !1;
3210
+ if (e instanceof Xt) return !1;
3122
3211
  throw e;
3123
3212
  }
3124
3213
  }
3125
- function _(t, n, r) {
3214
+ function x(t, n, r) {
3126
3215
  let i = e.editorView.value;
3127
3216
  if (!i) return !1;
3128
3217
  try {
3129
- return i.dispatch(Z(i.state, t, n, r)), !0;
3218
+ return i.dispatch(Ie(i.state, t, n, r)), !0;
3130
3219
  } catch (e) {
3131
- if (e instanceof It) return !1;
3220
+ if (e instanceof Xt) return !1;
3132
3221
  throw e;
3133
3222
  }
3134
3223
  }
3135
- function v(t) {
3136
- return Se(e.editorView.value, e.layout.value, t);
3224
+ function S(t) {
3225
+ return Te(e.editorView.value, e.layout.value, t);
3137
3226
  }
3138
- function y(t) {
3227
+ function C(t) {
3139
3228
  return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
3140
3229
  }
3141
- function b(t) {
3230
+ function ee(t) {
3142
3231
  return e.selectionChangeSubscribers.add(t), () => e.selectionChangeSubscribers.delete(t);
3143
3232
  }
3144
3233
  return { exposed: {
@@ -3161,44 +3250,58 @@ function mi(e) {
3161
3250
  resolveComment: e.resolveComment,
3162
3251
  proposeChange: e.proposeChange,
3163
3252
  scrollToParaId: l,
3253
+ scrollToCommentId: _,
3254
+ scrollToChangeId: v,
3255
+ highlightRange: g,
3164
3256
  findInDocument: u,
3165
3257
  getSelectionInfo: d,
3166
3258
  getComments: f,
3167
3259
  getContentControls: p,
3168
3260
  scrollToContentControl: m,
3169
- setContentControlContent: h,
3170
- removeContentControl: g,
3171
- setContentControlValue: _,
3261
+ setContentControlContent: y,
3262
+ removeContentControl: b,
3263
+ setContentControlValue: x,
3172
3264
  applyFormatting: e.applyFormatting,
3173
3265
  setParagraphStyle: e.setParagraphStyle,
3174
- getPageContent: v,
3266
+ insertBreak: e.insertBreak,
3267
+ getPageContent: S,
3175
3268
  getTotalPages: s,
3176
3269
  getCurrentPage: c,
3177
- onContentChange: y,
3178
- onSelectionChange: b
3270
+ onContentChange: C,
3271
+ onSelectionChange: ee
3179
3272
  } };
3180
3273
  }
3181
3274
  //#endregion
3275
+ //#region src/composables/useColorMode.ts
3276
+ function Ni(e) {
3277
+ let t = R(Q());
3278
+ return W((n) => {
3279
+ e() === "system" && n(We((e) => {
3280
+ t.value = e;
3281
+ }));
3282
+ }), E(() => Ue(e(), t.value));
3283
+ }
3284
+ //#endregion
3182
3285
  //#region src/composables/useFontLifecycle.ts
3183
- function hi(e, t) {
3184
- K(e, (e) => {
3185
- Fe(e);
3286
+ function Pi(e, t) {
3287
+ U(e, (e) => {
3288
+ ze(e);
3186
3289
  }, { immediate: !0 });
3187
- let n = Ie(t);
3290
+ let n = Be(t);
3188
3291
  I(() => n());
3189
3292
  }
3190
3293
  //#endregion
3191
3294
  //#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
3192
- var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3295
+ var Fi = { class: "docx-editor-vue__toolbar-shell" }, Ii = {
3193
3296
  key: 0,
3194
3297
  class: "docx-editor-vue__error"
3195
- }, vi = {
3298
+ }, Li = {
3196
3299
  key: 1,
3197
3300
  class: "docx-editor-vue__loading"
3198
- }, yi = { class: "docx-editor-vue__editor-area" }, bi = {
3301
+ }, Ri = { class: "docx-editor-vue__editor-area" }, zi = {
3199
3302
  key: 0,
3200
3303
  class: "docx-editor-vue__vertical-ruler"
3201
- }, xi = ["title"], Si = ["title", "aria-label"], Ci = /* @__PURE__ */ N({
3304
+ }, Bi = ["title"], Vi = ["title", "aria-label"], Hi = /* @__PURE__ */ N({
3202
3305
  __name: "DocxEditor",
3203
3306
  props: {
3204
3307
  documentBuffer: { default: null },
@@ -3225,6 +3328,7 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3225
3328
  onModeChange: {},
3226
3329
  i18n: { default: void 0 },
3227
3330
  theme: { default: null },
3331
+ colorMode: { default: "light" },
3228
3332
  externalPlugins: { default: () => [] },
3229
3333
  showZoomControl: {
3230
3334
  type: Boolean,
@@ -3256,6 +3360,7 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3256
3360
  },
3257
3361
  fontFamilies: { default: void 0 },
3258
3362
  fonts: {},
3363
+ watermarkPresets: { default: void 0 },
3259
3364
  onPrint: {
3260
3365
  type: Function,
3261
3366
  default: void 0
@@ -3299,41 +3404,41 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3299
3404
  "menu-action",
3300
3405
  "mode-change"
3301
3406
  ],
3302
- setup(e, { expose: n, emit: r }) {
3303
- let i = e, a = r, o = z(i.mode), s = D(() => i.readOnly || o.value === "viewing"), l = D(() => i.author);
3304
- f(D(() => i.i18n));
3305
- let { t: u } = t(D(() => i.i18n)), d = z(null), g = z(null), y = z(null), x = z(0), S = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set(), w = new we(), E = z(!1), re = z(!1), oe = z(!1), j = z(!1), N = z(!1), se = z(!1), W = z(i.showOutline), fe = z(!1), G = z(!1), q = z(!1), me = z(null), Y = de([]), ge = de([]), _e = de([]), { zoom: X, zoomPercent: be, isMinZoom: xe, isMaxZoom: Se, setZoom: Te, zoomIn: De, zoomOut: Oe, handleWheel: ke, handleKeyDown: Ae, installShortcuts: je, ZOOM_PRESETS: Me } = ne(i.initialZoom);
3407
+ setup(e, { expose: t, emit: n }) {
3408
+ let i = e, o = n, s = Ni(() => i.colorMode), c = R(i.mode), u = E(() => i.readOnly || c.value === "viewing"), d = E(() => i.author);
3409
+ a(E(() => i.i18n));
3410
+ let { t: h } = l(E(() => i.i18n)), v = R(null), b = R(null), x = R(null), S = R(0), ne = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set(), re = new De(), ae = R(!1), j = R(!1), N = R(!1), P = R(!1), V = R(!1), me = R(i.showOutline), H = R(!1), W = R(!1), G = R(!1), K = R(null), J = pe([]), ge = pe([]), _e = pe([]), { zoom: X, zoomPercent: be, isMinZoom: xe, isMaxZoom: Se, setZoom: Ce, zoomIn: we, zoomOut: Te, handleWheel: Oe, handleKeyDown: Ae, installShortcuts: je, ZOOM_PRESETS: Me } = te(i.initialZoom);
3306
3411
  je();
3307
- let { editorView: Z, isReady: Pe, parseError: Fe, layout: Ie, loadBuffer: Le, loadDocument: Re, save: ze, focus: Ve, destroy: He, getDocument: Q, getCommands: Ue, reLayout: We, getHfPmView: Ge, syncHfPMs: Ke, setHfTransactionListener: qe, setDocument: Je } = ee({
3308
- hiddenContainer: d,
3309
- pagesContainer: g,
3310
- readOnly: s,
3412
+ let { editorView: Z, isReady: Ne, parseError: Pe, layout: Fe, loadBuffer: Ie, loadDocument: Re, save: ze, focus: Be, destroy: Ve, getDocument: Q, getCommands: He, reLayout: Ue, getHfPmView: We, syncHfPMs: Ge, setHfTransactionListener: qe, setDocument: Je } = C({
3413
+ hiddenContainer: v,
3414
+ pagesContainer: b,
3415
+ readOnly: u,
3311
3416
  externalPlugins: i.externalPlugins,
3312
- syncCoordinator: w,
3313
- editorMode: o,
3314
- author: l,
3417
+ syncCoordinator: re,
3418
+ editorMode: c,
3419
+ author: d,
3315
3420
  onChange: (e) => {
3316
- a("change", e), a("update:document", e), i.onChange?.(e), S.forEach((t) => t(e));
3421
+ o("change", e), o("update:document", e), i.onChange?.(e), ne.forEach((t) => t(e));
3317
3422
  },
3318
3423
  onError: (e) => {
3319
- a("error", e), i.onError?.(e);
3424
+ o("error", e), i.onError?.(e);
3320
3425
  },
3321
3426
  onSelectionUpdate: () => {
3322
- x.value++;
3427
+ S.value++;
3323
3428
  let e = Z.value;
3324
- i.onSelectionChange?.(e ? Ee(e.state) : null);
3325
- let t = Ce(e);
3326
- C.forEach((e) => e(t));
3429
+ i.onSelectionChange?.(e ? ke(e.state) : null);
3430
+ let t = Ee(e);
3431
+ T.forEach((e) => e(t));
3327
3432
  }
3328
- }), { commentCallbacks: Ye } = Qr(i, Z), Xe = D(() => {
3329
- x.value;
3433
+ }), { commentCallbacks: Ye } = gi(i, Z), Xe = E(() => {
3434
+ S.value;
3330
3435
  let e = Q();
3331
3436
  if (!e?.package?.document) return null;
3332
3437
  let t = e.package.document;
3333
3438
  return t.finalSectionProperties ?? t.sections?.[0]?.properties ?? null;
3334
- }), Ze = D(() => {
3335
- x.value;
3336
- let e = Z.value, t = e ? Be(e.state).paragraphFormatting : {};
3439
+ }), Ze = E(() => {
3440
+ S.value;
3441
+ let e = Z.value, t = e ? Ke(e.state).paragraphFormatting : {};
3337
3442
  return {
3338
3443
  indentLeft: t.indentLeft ?? 0,
3339
3444
  indentRight: t.indentRight ?? 0,
@@ -3341,24 +3446,24 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3341
3446
  hangingIndent: t.hangingIndent ?? !1,
3342
3447
  tabStops: t.tabs ?? null
3343
3448
  };
3344
- }), Qe = D(() => (x.value, Q()?.package?.theme ?? i.theme ?? null)), $e = z(null), et = z([]);
3345
- function tt(e, t) {
3346
- $e.value = ve(e, t), et.value = ye(e, t);
3449
+ }), Qe = E(() => (S.value, Q()?.package?.theme ?? i.theme ?? null)), $e = E(() => (S.value, Q()?.package?.styles?.styles ?? void 0)), et = R(null), tt = R([]);
3450
+ function nt(e, t) {
3451
+ et.value = ve(e, t), tt.value = ye(e, t);
3347
3452
  }
3348
- function nt() {
3349
- $e.value = null, et.value = [];
3453
+ function rt() {
3454
+ et.value = null, tt.value = [];
3350
3455
  }
3351
- hi(() => i.fonts, (e) => {
3352
- a("error", e), i.onError?.(e);
3456
+ Pi(() => i.fonts, (e) => {
3457
+ o("error", e), i.onError?.(e);
3353
3458
  });
3354
- let rt = D(() => $.value?.headerFooter ? Ge($.value.headerFooter) ?? null : null), it = D(() => rt.value ?? Z.value);
3355
- L(() => {
3459
+ let it = E(() => $.value?.headerFooter ? We($.value.headerFooter) ?? null : null), at = E(() => it.value ?? Z.value);
3460
+ le(() => {
3356
3461
  qe((e, t) => {
3357
- x.value++, requestAnimationFrame(() => {
3462
+ S.value++, requestAnimationFrame(() => {
3358
3463
  let e = $.value;
3359
3464
  if (!e) return;
3360
- tt(t, e.position);
3361
- let n = Bt(e.position), r = y.value;
3465
+ nt(t, e.position);
3466
+ let n = en(e.position), r = x.value;
3362
3467
  if (!n || !r) return;
3363
3468
  let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = X.value || 1;
3364
3469
  $.value = {
@@ -3371,20 +3476,20 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3371
3476
  }
3372
3477
  };
3373
3478
  });
3374
- }), K(() => $.value, (e) => {
3479
+ }), U(() => $.value, (e) => {
3375
3480
  if (!e) {
3376
- nt();
3481
+ rt();
3377
3482
  return;
3378
3483
  }
3379
3484
  let t = Z.value;
3380
3485
  if (t) {
3381
3486
  try {
3382
- let e = t.state.tr.setSelection(he.create(t.state.doc, 0));
3487
+ let e = t.state.tr.setSelection(Y.create(t.state.doc, 0));
3383
3488
  t.dispatch(e);
3384
3489
  } catch {}
3385
3490
  t.dom.blur?.();
3386
3491
  }
3387
- or.updateSelectionOverlay();
3492
+ dr.updateSelectionOverlay();
3388
3493
  });
3389
3494
  let e = 0;
3390
3495
  function t() {
@@ -3392,34 +3497,34 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3392
3497
  e = 0;
3393
3498
  let t = $.value;
3394
3499
  if (!t?.headerFooter) return;
3395
- let n = Ge(t.headerFooter);
3396
- n && tt(n, t.position);
3500
+ let n = We(t.headerFooter);
3501
+ n && nt(n, t.position);
3397
3502
  }));
3398
3503
  }
3399
3504
  window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), I(() => {
3400
3505
  e && cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
3401
3506
  });
3402
3507
  });
3403
- let ot = D(() => {
3508
+ let ot = E(() => {
3404
3509
  let e = [];
3405
- return G.value && e.push(`translateX(-${Ne}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
3510
+ return W.value && e.push(`translateX(-${Le}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
3406
3511
  transform: e.length > 0 ? e.join(" ") : void 0,
3407
3512
  transformOrigin: "top center",
3408
3513
  transition: "transform 0.2s ease"
3409
3514
  };
3410
- }), st = D(() => ({
3515
+ }), st = E(() => ({
3411
3516
  paddingLeft: "20px",
3412
- paddingRight: 20 + (G.value ? Ne * 2 : 0) + "px",
3517
+ paddingRight: 20 + (W.value ? Le * 2 : 0) + "px",
3413
3518
  transition: "padding 0.2s ease"
3414
- })), ct = D(() => {
3519
+ })), ct = E(() => {
3415
3520
  let e = Xe.value;
3416
- return at(e?.pageWidth ?? 12240) * X.value;
3417
- }), lt = D(() => {
3521
+ return ft(e?.pageWidth ?? 12240) * X.value;
3522
+ }), lt = E(() => {
3418
3523
  let e = /* @__PURE__ */ new Set();
3419
- for (let t of Y.value) t.parentId == null && t.done && e.add(t.id);
3524
+ for (let t of J.value) t.parentId == null && t.done && e.add(t.id);
3420
3525
  return e;
3421
- }), ut = D(() => {
3422
- x.value;
3526
+ }), ut = E(() => {
3527
+ S.value;
3423
3528
  let e = Z.value;
3424
3529
  if (!e) return [];
3425
3530
  let t = /* @__PURE__ */ new Set(), n = [];
@@ -3435,219 +3540,224 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3435
3540
  }
3436
3541
  return !0;
3437
3542
  }), n.sort((e, t) => e.name.localeCompare(t.name));
3438
- }), dt = At(), { floatingCommentBtn: ft, pendingCommentRange: pt, addCommentYPosition: mt, sidebarAutoOpenedRef: ht, extractCommentsAndChanges: gt, handleAddComment: _t, handleCancelAddComment: vt, handleStartAddComment: yt, handleMarkerClick: bt } = $r({
3543
+ }), dt = Ht(), { floatingCommentBtn: pt, pendingCommentRange: mt, addCommentYPosition: ht, sidebarAutoOpenedRef: gt, extractCommentsAndChanges: _t, handleAddComment: vt, handleCancelAddComment: yt, handleStartAddComment: bt, handleMarkerClick: xt } = _i({
3439
3544
  editorView: Z,
3440
3545
  getDocument: Q,
3441
- comments: Y,
3546
+ comments: J,
3442
3547
  trackedChanges: ge,
3443
3548
  resolvedCommentIds: lt,
3444
- activeSidebarItem: me,
3445
- showSidebar: G,
3446
- isAddingComment: q,
3447
- readOnly: s,
3549
+ activeSidebarItem: K,
3550
+ showSidebar: W,
3551
+ isAddingComment: G,
3552
+ readOnly: u,
3448
3553
  zoom: X,
3449
- stateTick: x,
3450
- pagesRef: g,
3451
- pagesViewportRef: y,
3452
- emit: a,
3554
+ stateTick: S,
3555
+ pagesRef: b,
3556
+ pagesViewportRef: x,
3557
+ emit: o,
3453
3558
  commentIdAllocator: dt,
3454
- author: l,
3559
+ author: d,
3455
3560
  commentCallbacks: Ye
3456
- }), { docxInputRef: xt, handleDocxFileChange: St, handleDocumentNameChange: Ct, downloadCurrentDocument: wt, loadDocumentBuffer: Tt, loadDocument: Et, save: Dt } = Wr({
3457
- loadBuffer: Le,
3561
+ }), { docxInputRef: St, imageInputRef: Ct, handleImageFileChange: wt, handleDocxFileChange: Tt, handleDocumentNameChange: Et, downloadCurrentDocument: Dt, loadDocumentBuffer: Ot, loadDocument: kt, save: At } = ci({
3562
+ loadBuffer: Ie,
3458
3563
  loadParsedDocument: Re,
3459
3564
  getDocument: Q,
3460
3565
  saveBlob: ze,
3461
- extractCommentsAndChanges: gt,
3462
- emit: a,
3566
+ extractCommentsAndChanges: _t,
3567
+ emit: o,
3463
3568
  documentName: () => i.documentName,
3464
3569
  onDocumentNameChange: i.onDocumentNameChange,
3465
- nextTick: le
3466
- }), { hyperlinkPopupData: Ot, handleHyperlinkSubmit: kt, handleHyperlinkRemove: jt, handleHyperlinkPopupNavigate: Mt, handleHyperlinkPopupEdit: Nt, handleHyperlinkPopupRemove: Pt } = Gr({
3570
+ getActiveView: () => at.value,
3571
+ nextTick: se
3572
+ }), { hyperlinkPopupData: jt, handleHyperlinkSubmit: Mt, handleHyperlinkRemove: Nt, handleHyperlinkPopupNavigate: Pt, handleHyperlinkPopupEdit: Ft, handleHyperlinkPopupRemove: It } = li({
3467
3573
  editorView: Z,
3468
- getCommands: Ue
3469
- }), { handleClearFormatting: Ft, handleApplyStyle: It, handleInsertPageBreak: Lt, handleInsertSymbol: Rt, applyFormatting: zt, setParagraphStyle: Vt } = Kr({
3574
+ getCommands: He
3575
+ }), { handleClearFormatting: Lt, handleApplyStyle: Rt, handleInsertPageBreak: zt, handleInsertSectionBreakNextPage: Bt, handleInsertSectionBreakContinuous: Vt, handleInsertSymbol: Ut, applyFormatting: Wt, setParagraphStyle: Gt, insertBreak: Kt } = ui({
3470
3576
  editorView: Z,
3471
- activeView: it,
3577
+ activeView: at,
3472
3578
  getDocument: Q
3473
- }), { handlePageSetupApply: Ht, handleLeftMarginChange: Ut, handleRightMarginChange: Wt, handleTopMarginChange: Gt, handleBottomMarginChange: qt, handleIndentLeftChange: Jt, handleIndentRightChange: Yt, handleFirstLineIndentChange: Xt, handleTabStopRemove: Zt } = qr({
3579
+ }), { handlePageSetupApply: qt, handleLeftMarginChange: Jt, handleRightMarginChange: Yt, handleTopMarginChange: Xt, handleBottomMarginChange: Zt, handleIndentLeftChange: Qt, handleIndentRightChange: $t, handleFirstLineIndentChange: tn, handleTabStopRemove: nn } = di({
3474
3580
  editorView: Z,
3475
3581
  getDocument: Q,
3476
- readOnly: s,
3477
- stateTick: x,
3478
- reLayout: We,
3479
- emit: a
3480
- }), { showWatermark: Qt, currentWatermark: en, handleWatermarkApply: tn } = Jr({
3582
+ readOnly: u,
3583
+ stateTick: S,
3584
+ reLayout: Ue,
3585
+ emit: o
3586
+ }), { showWatermark: rn, currentWatermark: an, handleWatermarkApply: on } = fi({
3481
3587
  editorView: Z,
3482
- readOnly: s,
3483
- stateTick: x
3484
- }), { handleToggleOutline: nn, handleOutlineNavigate: rn, handleToggleSidebar: sn, handleEditorScrollMouseDown: cn } = Yr({
3588
+ readOnly: u,
3589
+ stateTick: S
3590
+ }), { handleToggleOutline: cn, handleOutlineNavigate: ln, handleToggleSidebar: un, handleEditorScrollMouseDown: dn } = pi({
3485
3591
  editorView: Z,
3486
- showOutline: W,
3487
- showSidebar: G,
3592
+ showOutline: me,
3593
+ showSidebar: W,
3488
3594
  outlineHeadings: _e,
3489
- activeSidebarItem: me,
3490
- extractCommentsAndChanges: gt
3595
+ activeSidebarItem: K,
3596
+ extractCommentsAndChanges: _t
3491
3597
  });
3492
- Xr({
3493
- showKeyboardShortcuts: fe,
3494
- showFindReplace: E,
3495
- showHyperlink: oe,
3598
+ mi({
3599
+ showKeyboardShortcuts: H,
3600
+ showFindReplace: ae,
3601
+ showHyperlink: j,
3496
3602
  handleZoomKeyDown: Ae,
3497
3603
  disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
3498
3604
  });
3499
- let { addComment: un, replyToComment: dn, resolveComment: fn, proposeChange: pn, handleCommentReply: hn, handleCommentResolve: gn, handleCommentUnresolve: _n, handleCommentDelete: vn, handleAcceptChange: bn, handleRejectChange: xn, handleAcceptChangeById: Sn, handleRejectChangeById: Cn, handleTrackedChangeReply: wn } = Zr({
3605
+ let { addComment: fn, replyToComment: pn, resolveComment: mn, proposeChange: hn, handleCommentReply: gn, handleCommentResolve: vn, handleCommentUnresolve: yn, handleCommentDelete: bn, handleAcceptChange: xn, handleRejectChange: wn, handleAcceptChangeById: Tn, handleRejectChangeById: Dn, handleTrackedChangeReply: On } = hi({
3500
3606
  editorView: Z,
3501
3607
  getDocument: Q,
3502
- comments: Y,
3608
+ comments: J,
3503
3609
  trackedChanges: ge,
3504
- showSidebar: G,
3505
- isAddingComment: q,
3506
- pendingCommentRange: pt,
3507
- contentChangeSubscribers: S,
3508
- extractCommentsAndChanges: gt,
3509
- emit: a,
3610
+ showSidebar: W,
3611
+ isAddingComment: G,
3612
+ pendingCommentRange: mt,
3613
+ contentChangeSubscribers: ne,
3614
+ extractCommentsAndChanges: _t,
3615
+ emit: o,
3510
3616
  commentIdAllocator: dt,
3511
- author: l,
3617
+ author: d,
3512
3618
  commentCallbacks: Ye
3513
- }), { selectedImage: Tn, imageInteracting: En, imageToolbarContext: Dn, handleInsertImage: On, handleToolbarImageWrap: kn, handleImageTransform: An } = ei({
3619
+ }), { selectedImage: kn, imageInteracting: An, imageToolbarContext: jn, handleToolbarImageWrap: Nn, handleImageTransform: Pn } = vi({
3514
3620
  editorView: Z,
3515
3621
  zoom: X,
3516
- stateTick: x,
3517
- getCommands: Ue
3518
- }), jn = te(), Mn = null, { tableInsertButton: Nn, hfEdit: $, scrollPageInfo: Pn, resolvePos: Fn, setPmSelection: In, scrollVisiblePositionIntoView: Ln, handlePagesMouseDown: Rn, handlePagesMouseMove: zn, handlePagesClick: Bn, handlePagesDoubleClick: Vn, handleTableInsertClick: Hn, clearTableInsertTimer: Un, handleHfSave: Wn, handleHfRemove: Gn } = ui({
3622
+ stateTick: S,
3623
+ getCommands: He
3624
+ }), Fn = ee(), In = null, { tableInsertButton: Rn, hfEdit: $, scrollPageInfo: zn, resolvePos: Bn, setPmSelection: Vn, scrollVisiblePositionIntoView: Hn, handlePagesMouseDown: Un, handlePagesMouseMove: Wn, handlePagesClick: Gn, handlePagesDoubleClick: Kn, handleTableInsertClick: qn, clearTableInsertTimer: Jn, handleHfSave: Yn, handleHfRemove: Xn } = Oi({
3519
3625
  editorView: Z,
3520
- pagesRef: g,
3521
- pagesViewportRef: y,
3522
- selectedImage: Tn,
3523
- imageInteracting: En,
3524
- hyperlinkPopupData: Ot,
3525
- readOnly: s,
3626
+ pagesRef: b,
3627
+ pagesViewportRef: x,
3628
+ selectedImage: kn,
3629
+ imageInteracting: An,
3630
+ hyperlinkPopupData: jt,
3631
+ readOnly: u,
3526
3632
  zoom: X,
3527
- layout: Ie,
3528
- tableResize: jn,
3529
- getCommands: Ue,
3633
+ layout: Fe,
3634
+ tableResize: Fn,
3635
+ getCommands: He,
3530
3636
  getDocument: Q,
3531
- reLayout: We,
3532
- emit: a,
3533
- clearOverlay: ir,
3534
- syncHfPMs: Ke,
3535
- getHfPmView: Ge,
3637
+ reLayout: Ue,
3638
+ emit: o,
3639
+ clearOverlay: lr,
3640
+ syncHfPMs: Ge,
3641
+ getHfPmView: We,
3536
3642
  setDocument: Je
3537
- }), { contextMenu: Kn, imageContextMenu: qn, imageContextMenuTextActions: Jn, handleContextMenu: Yn, handleSelectedImageContextMenu: Xn, handleImageWrapSelect: Zn, handleContextMenuAction: Qn } = ci({
3643
+ }), { contextMenu: Zn, imageContextMenu: Qn, imageContextMenuTextActions: $n, handleContextMenu: er, handleSelectedImageContextMenu: tr, handleImageWrapSelect: nr, handleContextMenuAction: rr } = Ei({
3538
3644
  editorView: Z,
3539
- selectedImage: Tn,
3645
+ selectedImage: kn,
3540
3646
  zoom: X,
3541
- showImageProperties: N,
3542
- getCommands: Ue,
3543
- clearOverlay: ir,
3544
- setPmSelection: In,
3545
- resolvePos: Fn
3546
- }), { handleMenuAction: $n, handleMenuTableInsert: er } = fi({
3647
+ showImageProperties: P,
3648
+ getCommands: He,
3649
+ clearOverlay: lr,
3650
+ setPmSelection: Vn,
3651
+ resolvePos: Bn
3652
+ }), { handleMenuAction: ir, handleMenuTableInsert: ar } = Ai({
3547
3653
  editorView: Z,
3548
- getCommands: Ue,
3549
- docxInputRef: xt,
3550
- showPageSetup: se,
3551
- showWatermark: Qt,
3552
- showInsertImage: re,
3553
- showHyperlink: oe,
3554
- showInsertSymbol: j,
3555
- showKeyboardShortcuts: fe,
3556
- handleClearFormatting: Ft,
3557
- handleInsertPageBreak: Lt,
3558
- handleToggleOutline: nn,
3559
- handleToggleSidebar: sn,
3560
- downloadCurrentDocument: wt,
3561
- emit: a
3654
+ getCommands: He,
3655
+ docxInputRef: St,
3656
+ imageInputRef: Ct,
3657
+ showPageSetup: V,
3658
+ showWatermark: rn,
3659
+ showHyperlink: j,
3660
+ showInsertSymbol: N,
3661
+ showKeyboardShortcuts: H,
3662
+ handleClearFormatting: Lt,
3663
+ handleInsertPageBreak: zt,
3664
+ handleInsertSectionBreakNextPage: Bt,
3665
+ handleInsertSectionBreakContinuous: Vt,
3666
+ handleToggleOutline: cn,
3667
+ handleToggleSidebar: un,
3668
+ downloadCurrentDocument: Dt,
3669
+ emit: o
3562
3670
  });
3563
- pi({
3671
+ ji({
3564
3672
  documentBuffer: () => i.documentBuffer,
3565
3673
  document: () => i.document,
3566
- loadDocumentBuffer: Tt,
3567
- loadDocument: Et,
3568
- sidebarAutoOpenedRef: ht
3674
+ loadDocumentBuffer: Ot,
3675
+ loadDocument: kt,
3676
+ sidebarAutoOpenedRef: gt
3569
3677
  });
3570
- let tr = () => Z.value, nr = () => g.value;
3571
- K(() => i.mode, (e) => {
3572
- e && e !== o.value && (o.value = e);
3573
- }), K(() => i.showOutline, (e) => {
3574
- W.value = !!e;
3678
+ let or = () => Z.value, sr = () => b.value;
3679
+ U(() => i.mode, (e) => {
3680
+ e && e !== c.value && (c.value = e);
3681
+ }), U(() => i.showOutline, (e) => {
3682
+ me.value = !!e;
3575
3683
  });
3576
- function rr(e) {
3577
- o.value !== e && (o.value = e, a("mode-change", e));
3684
+ function cr(e) {
3685
+ c.value !== e && (c.value = e, o("mode-change", e));
3578
3686
  }
3579
- L(() => {
3580
- Mn = jn.install();
3687
+ le(() => {
3688
+ In = Fn.install();
3581
3689
  }), I(() => {
3582
- Mn?.();
3690
+ In?.();
3583
3691
  });
3584
- function ir() {
3585
- or.clearOverlay();
3692
+ function lr() {
3693
+ dr.clearOverlay();
3586
3694
  }
3587
- function ar() {
3588
- or.updateSelectionOverlay();
3695
+ function ur() {
3696
+ dr.updateSelectionOverlay();
3589
3697
  }
3590
- let or = di({
3698
+ let dr = ki({
3591
3699
  editorView: Z,
3592
- pagesRef: g,
3700
+ pagesRef: b,
3593
3701
  zoom: X,
3594
- selectedImage: Tn,
3595
- isHfEditing: D(() => $.value !== null),
3596
- imageInteracting: En
3597
- }), sr = w.onRender(() => ar());
3598
- ar(), I(() => {
3599
- sr(), ir();
3702
+ selectedImage: kn,
3703
+ isHfEditing: E(() => $.value !== null),
3704
+ imageInteracting: An
3705
+ }), fr = re.onRender(() => ur());
3706
+ ur(), I(() => {
3707
+ fr(), lr();
3600
3708
  });
3601
- let { exposed: cr } = mi({
3709
+ let { exposed: pr } = Mi({
3602
3710
  editorView: Z,
3603
- layout: Ie,
3604
- pagesRef: g,
3605
- pagesViewportRef: y,
3711
+ layout: Fe,
3712
+ pagesRef: b,
3713
+ pagesViewportRef: x,
3606
3714
  zoom: X,
3607
- comments: Y,
3608
- focus: Ve,
3609
- destroy: He,
3715
+ comments: J,
3716
+ focus: Be,
3717
+ destroy: Ve,
3610
3718
  getDocument: Q,
3611
- setZoom: Te,
3612
- save: Dt,
3613
- loadDocument: Et,
3614
- loadDocumentBuffer: Tt,
3615
- addComment: un,
3616
- replyToComment: dn,
3617
- resolveComment: fn,
3618
- proposeChange: pn,
3619
- applyFormatting: zt,
3620
- setParagraphStyle: Vt,
3621
- scrollVisiblePositionIntoView: Ln,
3622
- contentChangeSubscribers: S,
3623
- selectionChangeSubscribers: C,
3719
+ setZoom: Ce,
3720
+ save: At,
3721
+ loadDocument: kt,
3722
+ loadDocumentBuffer: Ot,
3723
+ addComment: fn,
3724
+ replyToComment: pn,
3725
+ resolveComment: mn,
3726
+ proposeChange: hn,
3727
+ applyFormatting: Wt,
3728
+ setParagraphStyle: Gt,
3729
+ insertBreak: Kt,
3730
+ scrollVisiblePositionIntoView: Hn,
3731
+ contentChangeSubscribers: ne,
3732
+ selectionChangeSubscribers: T,
3624
3733
  onPrint: i.onPrint
3625
3734
  });
3626
- return n(cr), (t, n) => (R(), k("div", {
3627
- class: P([
3735
+ return t(pr), (t, n) => (L(), k("div", {
3736
+ class: ce([
3628
3737
  "docx-editor-vue ep-root paged-editor",
3738
+ B(s) ? "dark" : "",
3629
3739
  e.className,
3630
3740
  {
3631
- "paged-editor--readonly": s.value,
3632
- "paged-editor--hf-editing": U($) !== null,
3633
- "paged-editor--editing-header": U($)?.position === "header",
3634
- "paged-editor--editing-footer": U($)?.position === "footer"
3741
+ "paged-editor--readonly": u.value,
3742
+ "paged-editor--hf-editing": B($) !== null,
3743
+ "paged-editor--editing-header": B($)?.position === "header",
3744
+ "paged-editor--editing-footer": B($)?.position === "footer"
3635
3745
  }
3636
3746
  ]),
3637
3747
  style: F(e.style)
3638
3748
  }, [
3639
- A("div", gi, [M(yn, {
3749
+ A("div", Fi, [M(Ln, {
3640
3750
  "show-menu-bar": e.showMenuBar,
3641
3751
  "document-name": e.documentName,
3642
3752
  "document-name-editable": e.documentNameEditable,
3643
3753
  "render-logo": e.renderLogo,
3644
3754
  "render-title-bar-right": e.renderTitleBarRight,
3645
- onRename: U(Ct),
3646
- onMenuAction: U($n),
3647
- onInsertTable: U(er)
3755
+ onRename: B(Et),
3756
+ onMenuAction: B(ir),
3757
+ onInsertTable: B(ar)
3648
3758
  }, {
3649
- "title-bar-left": pe(() => [V(t.$slots, "title-bar-left")]),
3650
- "title-bar-right": pe(() => [V(t.$slots, "title-bar-right")]),
3759
+ "title-bar-left": he(() => [de(t.$slots, "title-bar-left")]),
3760
+ "title-bar-right": he(() => [de(t.$slots, "title-bar-right")]),
3651
3761
  _: 3
3652
3762
  }, 8, [
3653
3763
  "show-menu-bar",
@@ -3658,36 +3768,37 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3658
3768
  "onRename",
3659
3769
  "onMenuAction",
3660
3770
  "onInsertTable"
3661
- ]), e.showToolbar ? (R(), ie(b, {
3771
+ ]), e.showToolbar ? (L(), D(y, {
3662
3772
  key: 0,
3663
- view: it.value,
3664
- "get-commands": U(Ue),
3665
- "state-tick": x.value,
3666
- "zoom-percent": U(be),
3667
- "is-min-zoom": U(xe),
3668
- "is-max-zoom": U(Se),
3669
- "zoom-presets": U(Me),
3773
+ view: at.value,
3774
+ "get-commands": B(He),
3775
+ "state-tick": S.value,
3776
+ "zoom-percent": B(be),
3777
+ "is-min-zoom": B(xe),
3778
+ "is-max-zoom": B(Se),
3779
+ "zoom-presets": B(Me),
3670
3780
  "show-zoom-control": e.showZoomControl,
3671
- "editor-mode": o.value,
3672
- "comments-sidebar-open": G.value,
3673
- "image-context": U(Dn),
3781
+ "editor-mode": c.value,
3782
+ "comments-sidebar-open": W.value,
3783
+ "image-context": B(jn),
3674
3784
  theme: Qe.value,
3675
3785
  "font-families": e.fontFamilies,
3676
- onInsertLink: n[0] ||= (e) => oe.value = !0,
3677
- onApplyStyle: U(It),
3678
- onZoomIn: U(De),
3679
- onZoomOut: U(Oe),
3680
- onZoomSet: U(Te),
3681
- onToggleSidebar: U(sn),
3682
- onModeChange: rr,
3683
- onImageWrapType: U(kn),
3684
- onImageProperties: n[1] ||= (e) => N.value = !0,
3685
- onImageTransform: U(An)
3686
- }, ae({
3687
- "table-context": pe(() => [M(h, {
3688
- view: it.value,
3689
- "get-commands": U(Ue),
3690
- "state-tick": x.value,
3786
+ "document-styles": $e.value,
3787
+ onInsertLink: n[0] ||= (e) => j.value = !0,
3788
+ onApplyStyle: B(Rt),
3789
+ onZoomIn: B(we),
3790
+ onZoomOut: B(Te),
3791
+ onZoomSet: B(Ce),
3792
+ onToggleSidebar: B(un),
3793
+ onModeChange: cr,
3794
+ onImageWrapType: B(Nn),
3795
+ onImageProperties: n[1] ||= (e) => P.value = !0,
3796
+ onImageTransform: B(Pn)
3797
+ }, ie({
3798
+ "table-context": he(() => [M(m, {
3799
+ view: at.value,
3800
+ "get-commands": B(He),
3801
+ "state-tick": S.value,
3691
3802
  theme: Qe.value
3692
3803
  }, null, 8, [
3693
3804
  "view",
@@ -3698,11 +3809,11 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3698
3809
  _: 2
3699
3810
  }, [e.toolbarExtra ? {
3700
3811
  name: "toolbar-extra",
3701
- fn: pe(() => [(R(), ie(ue(e.toolbarExtra)))]),
3812
+ fn: he(() => [(L(), D(fe(e.toolbarExtra)))]),
3702
3813
  key: "0"
3703
3814
  } : {
3704
3815
  name: "toolbar-extra",
3705
- fn: pe(() => [V(t.$slots, "toolbar-extra")]),
3816
+ fn: he(() => [de(t.$slots, "toolbar-extra")]),
3706
3817
  key: "1"
3707
3818
  }]), 1032, [
3708
3819
  "view",
@@ -3718,6 +3829,7 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3718
3829
  "image-context",
3719
3830
  "theme",
3720
3831
  "font-families",
3832
+ "document-styles",
3721
3833
  "onApplyStyle",
3722
3834
  "onZoomIn",
3723
3835
  "onZoomOut",
@@ -3726,38 +3838,35 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3726
3838
  "onImageWrapType",
3727
3839
  "onImageTransform"
3728
3840
  ])) : O("", !0)]),
3729
- M(lr, {
3730
- "show-find-replace": E.value,
3731
- "onUpdate:showFindReplace": n[2] ||= (e) => E.value = e,
3732
- "show-insert-image": re.value,
3733
- "onUpdate:showInsertImage": n[3] ||= (e) => re.value = e,
3734
- "show-hyperlink": oe.value,
3735
- "onUpdate:showHyperlink": n[4] ||= (e) => oe.value = e,
3736
- "show-insert-symbol": j.value,
3737
- "onUpdate:showInsertSymbol": n[5] ||= (e) => j.value = e,
3738
- "show-image-properties": N.value,
3739
- "onUpdate:showImageProperties": n[6] ||= (e) => N.value = e,
3740
- "show-page-setup": se.value,
3741
- "onUpdate:showPageSetup": n[7] ||= (e) => se.value = e,
3742
- "show-watermark": U(Qt),
3743
- "onUpdate:showWatermark": n[8] ||= (e) => ce(Qt) ? Qt.value = e : null,
3744
- "show-keyboard-shortcuts": fe.value,
3745
- "onUpdate:showKeyboardShortcuts": n[9] ||= (e) => fe.value = e,
3746
- view: U(Z),
3841
+ M(Dr, {
3842
+ "show-find-replace": ae.value,
3843
+ "onUpdate:showFindReplace": n[2] ||= (e) => ae.value = e,
3844
+ "show-hyperlink": j.value,
3845
+ "onUpdate:showHyperlink": n[3] ||= (e) => j.value = e,
3846
+ "show-insert-symbol": N.value,
3847
+ "onUpdate:showInsertSymbol": n[4] ||= (e) => N.value = e,
3848
+ "show-image-properties": P.value,
3849
+ "onUpdate:showImageProperties": n[5] ||= (e) => P.value = e,
3850
+ "show-page-setup": V.value,
3851
+ "onUpdate:showPageSetup": n[6] ||= (e) => V.value = e,
3852
+ "show-watermark": B(rn),
3853
+ "onUpdate:showWatermark": n[7] ||= (e) => oe(rn) ? rn.value = e : null,
3854
+ "show-keyboard-shortcuts": H.value,
3855
+ "onUpdate:showKeyboardShortcuts": n[8] ||= (e) => H.value = e,
3856
+ view: B(Z),
3747
3857
  bookmarks: ut.value,
3748
- "selected-image-pm-pos": U(Tn)?.pmPos ?? null,
3858
+ "selected-image-pm-pos": B(kn)?.pmPos ?? null,
3749
3859
  "section-properties": Xe.value,
3750
- "current-watermark": U(en),
3751
- "scroll-visible-position-into-view": U(Ln),
3752
- onInsertImage: U(On),
3753
- onInsertSymbol: U(Rt),
3754
- onHyperlinkSubmit: U(kt),
3755
- onHyperlinkRemove: U(jt),
3756
- onPageSetupApply: U(Ht),
3757
- onWatermarkApply: U(tn)
3860
+ "current-watermark": B(an),
3861
+ "watermark-presets": e.watermarkPresets,
3862
+ "scroll-visible-position-into-view": B(Hn),
3863
+ onInsertSymbol: B(Ut),
3864
+ onHyperlinkSubmit: B(Mt),
3865
+ onHyperlinkRemove: B(Nt),
3866
+ onPageSetupApply: B(qt),
3867
+ onWatermarkApply: B(on)
3758
3868
  }, null, 8, [
3759
3869
  "show-find-replace",
3760
- "show-insert-image",
3761
3870
  "show-hyperlink",
3762
3871
  "show-insert-symbol",
3763
3872
  "show-image-properties",
@@ -3769,43 +3878,43 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3769
3878
  "selected-image-pm-pos",
3770
3879
  "section-properties",
3771
3880
  "current-watermark",
3881
+ "watermark-presets",
3772
3882
  "scroll-visible-position-into-view",
3773
- "onInsertImage",
3774
3883
  "onInsertSymbol",
3775
3884
  "onHyperlinkSubmit",
3776
3885
  "onHyperlinkRemove",
3777
3886
  "onPageSetupApply",
3778
3887
  "onWatermarkApply"
3779
3888
  ]),
3780
- U(Fe) ? (R(), k("div", _i, H(U(Fe)), 1)) : O("", !0),
3781
- !U(Pe) && !U(Fe) ? (R(), k("div", vi, "Loading...")) : O("", !0),
3889
+ B(Pe) ? (L(), k("div", Ii, z(B(Pe)), 1)) : O("", !0),
3890
+ !B(Ne) && !B(Pe) ? (L(), k("div", Li, "Loading...")) : O("", !0),
3782
3891
  A("div", {
3783
3892
  ref_key: "hiddenPmRef",
3784
- ref: d,
3893
+ ref: v,
3785
3894
  class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
3786
3895
  }, null, 512),
3787
3896
  A("div", {
3788
3897
  class: "docx-editor-vue__editor-scroll",
3789
- onMousedown: n[32] ||= (...e) => U(cn) && U(cn)(...e)
3790
- }, [e.showRuler && Xe.value ? (R(), k("div", {
3898
+ onMousedown: n[31] ||= (...e) => B(dn) && B(dn)(...e)
3899
+ }, [e.showRuler && Xe.value ? (L(), k("div", {
3791
3900
  key: 0,
3792
3901
  class: "docx-editor-vue__ruler-row",
3793
3902
  style: F(st.value)
3794
- }, [M(_, {
3903
+ }, [M(g, {
3795
3904
  "section-props": Xe.value,
3796
- zoom: U(X),
3797
- editable: !s.value,
3905
+ zoom: B(X),
3906
+ editable: !u.value,
3798
3907
  "indent-left": Ze.value.indentLeft,
3799
3908
  "indent-right": Ze.value.indentRight,
3800
3909
  "first-line-indent": Ze.value.firstLineIndent,
3801
3910
  "hanging-indent": Ze.value.hangingIndent,
3802
3911
  "tab-stops": Ze.value.tabStops,
3803
- onLeftMarginChange: U(Ut),
3804
- onRightMarginChange: U(Wt),
3805
- onIndentLeftChange: U(Jt),
3806
- onIndentRightChange: U(Yt),
3807
- onFirstLineIndentChange: U(Xt),
3808
- onTabStopRemove: U(Zt)
3912
+ onLeftMarginChange: B(Jt),
3913
+ onRightMarginChange: B(Yt),
3914
+ onIndentLeftChange: B(Qt),
3915
+ onIndentRightChange: B($t),
3916
+ onFirstLineIndentChange: B(tn),
3917
+ onTabStopRemove: B(nn)
3809
3918
  }, null, 8, [
3810
3919
  "section-props",
3811
3920
  "zoom",
@@ -3821,24 +3930,24 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3821
3930
  "onIndentRightChange",
3822
3931
  "onFirstLineIndentChange",
3823
3932
  "onTabStopRemove"
3824
- ])], 4)) : O("", !0), A("div", yi, [
3933
+ ])], 4)) : O("", !0), A("div", Ri, [
3825
3934
  A("div", {
3826
3935
  ref_key: "pagesViewportRef",
3827
- ref: y,
3936
+ ref: x,
3828
3937
  class: "docx-editor-vue__pages-viewport",
3829
- onMousedown: n[23] ||= (...e) => U(Rn) && U(Rn)(...e),
3830
- onMousemove: n[24] ||= (...e) => U(zn) && U(zn)(...e),
3831
- onClick: n[25] ||= (...e) => U(Bn) && U(Bn)(...e),
3832
- onDblclick: n[26] ||= (...e) => U(Vn) && U(Vn)(...e),
3833
- onContextmenu: n[27] ||= J((...e) => U(Yn) && U(Yn)(...e), ["prevent"]),
3834
- onWheel: n[28] ||= (...e) => U(ke) && U(ke)(...e)
3938
+ onMousedown: n[22] ||= (...e) => B(Un) && B(Un)(...e),
3939
+ onMousemove: n[23] ||= (...e) => B(Wn) && B(Wn)(...e),
3940
+ onClick: n[24] ||= (...e) => B(Gn) && B(Gn)(...e),
3941
+ onDblclick: n[25] ||= (...e) => B(Kn) && B(Kn)(...e),
3942
+ onContextmenu: n[26] ||= q((...e) => B(er) && B(er)(...e), ["prevent"]),
3943
+ onWheel: n[27] ||= (...e) => B(Oe) && B(Oe)(...e)
3835
3944
  }, [
3836
- e.showRuler && Xe.value ? (R(), k("div", bi, [M(p, {
3945
+ e.showRuler && Xe.value ? (L(), k("div", zi, [M(f, {
3837
3946
  "section-props": Xe.value,
3838
- zoom: U(X),
3839
- editable: !s.value,
3840
- onTopMarginChange: U(Gt),
3841
- onBottomMarginChange: U(qt)
3947
+ zoom: B(X),
3948
+ editable: !u.value,
3949
+ onTopMarginChange: B(Xt),
3950
+ onBottomMarginChange: B(Zt)
3842
3951
  }, null, 8, [
3843
3952
  "section-props",
3844
3953
  "zoom",
@@ -3848,23 +3957,23 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3848
3957
  ])])) : O("", !0),
3849
3958
  A("div", {
3850
3959
  ref_key: "pagesRef",
3851
- ref: g,
3960
+ ref: b,
3852
3961
  class: "docx-editor-vue__pages paged-editor__pages",
3853
3962
  style: F(ot.value)
3854
3963
  }, null, 4),
3855
- s.value ? O("", !0) : (R(), ie(mn, {
3964
+ u.value ? O("", !0) : (L(), D(Mn, {
3856
3965
  key: 1,
3857
- container: g.value,
3858
- view: U(Z)
3966
+ container: b.value,
3967
+ view: B(Z)
3859
3968
  }, null, 8, ["container", "view"])),
3860
- M(ln, {
3861
- "is-open": U($) !== null,
3862
- position: U($)?.position ?? "header",
3863
- view: rt.value,
3864
- "target-rect": U($)?.targetRect ?? null,
3865
- onSave: U(Wn),
3866
- onClose: n[10] ||= (e) => $.value = null,
3867
- onRemove: U(Gn)
3969
+ M(En, {
3970
+ "is-open": B($) !== null,
3971
+ position: B($)?.position ?? "header",
3972
+ view: it.value,
3973
+ "target-rect": B($)?.targetRect ?? null,
3974
+ onSave: B(Yn),
3975
+ onClose: n[9] ||= (e) => $.value = null,
3976
+ onRemove: B(Xn)
3868
3977
  }, null, 8, [
3869
3978
  "is-open",
3870
3979
  "position",
@@ -3873,7 +3982,7 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3873
3982
  "onSave",
3874
3983
  "onRemove"
3875
3984
  ]),
3876
- (R(!0), k(T, null, B(U($) ? et.value : [], (e, t) => (R(), k("div", {
3985
+ (L(!0), k(w, null, ue(B($) ? tt.value : [], (e, t) => (L(), k("div", {
3877
3986
  key: `hf-sel-${t}-${e.top}-${e.left}`,
3878
3987
  class: "vue-hf-sel-rect",
3879
3988
  "aria-hidden": "true",
@@ -3883,79 +3992,79 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3883
3992
  left: `${e.left}px`,
3884
3993
  width: `${e.width}px`,
3885
3994
  height: `${e.height}px`,
3886
- background: "rgba(66, 133, 244, 0.25)",
3995
+ background: "var(--doc-selection)",
3887
3996
  pointerEvents: "none",
3888
3997
  zIndex: 9998
3889
3998
  })
3890
3999
  }, null, 4))), 128)),
3891
- U($) && $e.value ? (R(), k("div", {
4000
+ B($) && et.value ? (L(), k("div", {
3892
4001
  key: 2,
3893
4002
  "aria-hidden": "true",
3894
4003
  style: F({
3895
4004
  position: "fixed",
3896
- top: `${$e.value.top}px`,
3897
- left: `${$e.value.left}px`,
4005
+ top: `${et.value.top}px`,
4006
+ left: `${et.value.left}px`,
3898
4007
  width: "2px",
3899
- height: `${$e.value.height}px`,
4008
+ height: `${et.value.height}px`,
3900
4009
  background: "#4285f4",
3901
4010
  pointerEvents: "none",
3902
4011
  zIndex: 9999,
3903
4012
  animation: "hf-caret-blink 1.06s steps(1) infinite"
3904
4013
  })
3905
4014
  }, null, 4)) : O("", !0),
3906
- M($t, {
3907
- "image-info": U(Tn),
3908
- zoom: U(X),
3909
- view: U(Z),
3910
- onOpenProperties: n[11] ||= (e) => N.value = !0,
3911
- onDeselect: n[12] ||= (e) => Tn.value = null,
3912
- onInteractStart: n[13] ||= (e) => En.value = !0,
3913
- onInteractEnd: n[14] ||= (e) => En.value = !1,
3914
- onContextMenu: U(Xn)
4015
+ M(_n, {
4016
+ "image-info": B(kn),
4017
+ zoom: B(X),
4018
+ view: B(Z),
4019
+ onOpenProperties: n[10] ||= (e) => P.value = !0,
4020
+ onDeselect: n[11] ||= (e) => kn.value = null,
4021
+ onInteractStart: n[12] ||= (e) => An.value = !0,
4022
+ onInteractEnd: n[13] ||= (e) => An.value = !1,
4023
+ onContextMenu: B(tr)
3915
4024
  }, null, 8, [
3916
4025
  "image-info",
3917
4026
  "zoom",
3918
4027
  "view",
3919
4028
  "onContextMenu"
3920
4029
  ]),
3921
- M(Kt, {
3922
- "get-view": tr,
3923
- "get-pages-container": nr,
3924
- zoom: U(X),
3925
- "transaction-version": x.value,
3926
- "sync-coordinator": U(w)
4030
+ M(sn, {
4031
+ "get-view": or,
4032
+ "get-pages-container": sr,
4033
+ zoom: B(X),
4034
+ "transaction-version": S.value,
4035
+ "sync-coordinator": B(re)
3927
4036
  }, null, 8, [
3928
4037
  "zoom",
3929
4038
  "transaction-version",
3930
4039
  "sync-coordinator"
3931
4040
  ]),
3932
- U(ft) && !q.value && !s.value ? (R(), k("button", {
4041
+ B(pt) && !G.value && !u.value ? (L(), k("button", {
3933
4042
  key: 3,
3934
4043
  type: "button",
3935
4044
  class: "docx-editor-vue__floating-comment",
3936
4045
  style: F({
3937
- top: U(ft).top + "px",
3938
- left: U(ft).left + "px"
4046
+ top: B(pt).top + "px",
4047
+ left: B(pt).left + "px"
3939
4048
  }),
3940
- title: U(u)("comments.addComment"),
3941
- onMousedown: n[15] ||= J((...e) => U(yt) && U(yt)(...e), ["prevent", "stop"])
3942
- }, [M(c, {
4049
+ title: B(h)("comments.addComment"),
4050
+ onMousedown: n[14] ||= q((...e) => B(bt) && B(bt)(...e), ["prevent", "stop"])
4051
+ }, [M(r, {
3943
4052
  name: "add_comment",
3944
4053
  size: 16
3945
- })], 44, xi)) : O("", !0),
3946
- U(Nn) && !s.value ? (R(), k("button", {
4054
+ })], 44, Bi)) : O("", !0),
4055
+ B(Rn) && !u.value ? (L(), k("button", {
3947
4056
  key: 4,
3948
4057
  type: "button",
3949
4058
  class: "docx-editor-vue__table-insert-btn",
3950
4059
  style: F({
3951
- left: U(Nn).x + "px",
3952
- top: U(Nn).y + "px"
4060
+ left: B(Rn).x + "px",
4061
+ top: B(Rn).y + "px"
3953
4062
  }),
3954
- title: U(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
3955
- "aria-label": U(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
3956
- onMousedown: n[16] ||= (...e) => U(Hn) && U(Hn)(...e),
3957
- onMouseenter: n[17] ||= (...e) => U(Un) && U(Un)(...e),
3958
- onMouseleave: n[18] ||= (e) => Nn.value = null
4063
+ title: B(Rn).type === "row" ? "Insert row below" : "Insert column to the right",
4064
+ "aria-label": B(Rn).type === "row" ? "Insert row below" : "Insert column to the right",
4065
+ onMousedown: n[15] ||= (...e) => B(qn) && B(qn)(...e),
4066
+ onMouseenter: n[16] ||= (...e) => B(Jn) && B(Jn)(...e),
4067
+ onMouseleave: n[17] ||= (e) => Rn.value = null
3959
4068
  }, [...n[37] ||= [A("svg", {
3960
4069
  width: "12",
3961
4070
  height: "12",
@@ -3966,15 +4075,15 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3966
4075
  stroke: "currentColor",
3967
4076
  "stroke-width": "1.5",
3968
4077
  "stroke-linecap": "round"
3969
- })], -1)]], 44, Si)) : O("", !0),
3970
- M(v, {
3971
- comments: Y.value,
3972
- "pages-container": g.value,
3973
- zoom: U(X),
4078
+ })], -1)]], 44, Vi)) : O("", !0),
4079
+ M(_, {
4080
+ comments: J.value,
4081
+ "pages-container": b.value,
4082
+ zoom: B(X),
3974
4083
  "page-width-px": ct.value,
3975
- "sidebar-open": G.value,
4084
+ "sidebar-open": W.value,
3976
4085
  "resolved-comment-ids": lt.value,
3977
- onMarkerClick: U(bt)
4086
+ onMarkerClick: B(xt)
3978
4087
  }, null, 8, [
3979
4088
  "comments",
3980
4089
  "pages-container",
@@ -3984,30 +4093,30 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
3984
4093
  "resolved-comment-ids",
3985
4094
  "onMarkerClick"
3986
4095
  ]),
3987
- M(m, {
3988
- "is-open": G.value,
3989
- comments: Y.value,
4096
+ M(p, {
4097
+ "is-open": W.value,
4098
+ comments: J.value,
3990
4099
  "tracked-changes": ge.value,
3991
- "is-adding-comment": q.value,
3992
- "add-comment-y-position": U(mt),
4100
+ "is-adding-comment": G.value,
4101
+ "add-comment-y-position": B(ht),
3993
4102
  "show-resolved": !0,
3994
- "pages-container": g.value,
4103
+ "pages-container": b.value,
3995
4104
  "page-width-px": ct.value,
3996
- zoom: U(X),
3997
- "active-item-id": me.value,
3998
- onClose: n[19] ||= (e) => G.value = !1,
3999
- onAddComment: U(_t),
4000
- onCancelAddComment: U(vt),
4001
- onCommentReply: U(hn),
4002
- onCommentResolve: U(gn),
4003
- onCommentUnresolve: U(_n),
4004
- onCommentDelete: U(vn),
4005
- onAcceptChange: U(bn),
4006
- onRejectChange: U(xn),
4007
- onAcceptChangeById: U(Sn),
4008
- onRejectChangeById: U(Cn),
4009
- onTrackedChangeReply: U(wn),
4010
- "onUpdate:activeItemId": n[20] ||= (e) => me.value = e
4105
+ zoom: B(X),
4106
+ "active-item-id": K.value,
4107
+ onClose: n[18] ||= (e) => W.value = !1,
4108
+ onAddComment: B(vt),
4109
+ onCancelAddComment: B(yt),
4110
+ onCommentReply: B(gn),
4111
+ onCommentResolve: B(vn),
4112
+ onCommentUnresolve: B(yn),
4113
+ onCommentDelete: B(bn),
4114
+ onAcceptChange: B(xn),
4115
+ onRejectChange: B(wn),
4116
+ onAcceptChangeById: B(Tn),
4117
+ onRejectChangeById: B(Dn),
4118
+ onTrackedChangeReply: B(On),
4119
+ "onUpdate:activeItemId": n[19] ||= (e) => K.value = e
4011
4120
  }, null, 8, [
4012
4121
  "is-open",
4013
4122
  "comments",
@@ -4030,14 +4139,14 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
4030
4139
  "onRejectChangeById",
4031
4140
  "onTrackedChangeReply"
4032
4141
  ]),
4033
- M(Ur, {
4034
- data: U(Ot),
4035
- "read-only": s.value,
4036
- onNavigate: U(Mt),
4037
- onCopy: n[21] ||= (e) => Ot.value = null,
4038
- onEdit: U(Nt),
4039
- onRemove: U(Pt),
4040
- onClose: n[22] ||= (e) => Ot.value = null
4142
+ M(si, {
4143
+ data: B(jt),
4144
+ "read-only": u.value,
4145
+ onNavigate: B(Pt),
4146
+ onCopy: n[20] ||= (e) => jt.value = null,
4147
+ onEdit: B(Ft),
4148
+ onRemove: B(It),
4149
+ onClose: n[21] ||= (e) => jt.value = null
4041
4150
  }, null, 8, [
4042
4151
  "data",
4043
4152
  "read-only",
@@ -4046,32 +4155,32 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
4046
4155
  "onRemove"
4047
4156
  ])
4048
4157
  ], 544),
4049
- !W.value && e.showOutlineButton ? (R(), k("button", {
4158
+ !me.value && e.showOutlineButton ? (L(), k("button", {
4050
4159
  key: 0,
4051
4160
  type: "button",
4052
4161
  class: "docx-editor-vue__outline-toggle",
4053
4162
  title: "Show document outline",
4054
- onClick: n[29] ||= (...e) => U(nn) && U(nn)(...e),
4055
- onMousedown: n[30] ||= J(() => {}, ["stop"])
4056
- }, [M(c, {
4163
+ onClick: n[28] ||= (...e) => B(cn) && B(cn)(...e),
4164
+ onMousedown: n[29] ||= q(() => {}, ["stop"])
4165
+ }, [M(r, {
4057
4166
  name: "format_list_bulleted",
4058
4167
  size: 20
4059
4168
  })], 32)) : O("", !0),
4060
- U(Pn).totalPages > 1 ? (R(), ie(on, {
4169
+ B(zn).totalPages > 1 ? (L(), D(Cn, {
4061
4170
  key: 1,
4062
- "current-page": U(Pn).currentPage,
4063
- "total-pages": U(Pn).totalPages,
4064
- visible: U(Pn).visible
4171
+ "current-page": B(zn).currentPage,
4172
+ "total-pages": B(zn).totalPages,
4173
+ visible: B(zn).visible
4065
4174
  }, null, 8, [
4066
4175
  "current-page",
4067
4176
  "total-pages",
4068
4177
  "visible"
4069
4178
  ])) : O("", !0),
4070
- M(an, {
4071
- "is-open": W.value,
4179
+ M(Sn, {
4180
+ "is-open": me.value,
4072
4181
  headings: _e.value,
4073
- onClose: n[31] ||= (e) => W.value = !1,
4074
- onNavigate: U(rn)
4182
+ onClose: n[30] ||= (e) => me.value = !1,
4183
+ onNavigate: B(ln)
4075
4184
  }, null, 8, [
4076
4185
  "is-open",
4077
4186
  "headings",
@@ -4080,23 +4189,31 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
4080
4189
  ])], 32),
4081
4190
  A("input", {
4082
4191
  ref_key: "docxInputRef",
4083
- ref: xt,
4192
+ ref: St,
4084
4193
  type: "file",
4085
4194
  accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
4086
4195
  style: { display: "none" },
4087
- onChange: n[33] ||= (...e) => U(St) && U(St)(...e)
4196
+ onChange: n[32] ||= (...e) => B(Tt) && B(Tt)(...e)
4197
+ }, null, 544),
4198
+ A("input", {
4199
+ ref_key: "imageInputRef",
4200
+ ref: Ct,
4201
+ type: "file",
4202
+ accept: "image/*",
4203
+ style: { display: "none" },
4204
+ onChange: n[33] ||= (...e) => B(wt) && B(wt)(...e)
4088
4205
  }, null, 544),
4089
- M(Nr, {
4090
- "read-only": s.value,
4091
- "context-menu": U(Kn),
4092
- "image-context-menu": U(qn),
4093
- "image-context-menu-text-actions": U(Jn),
4094
- "can-open-image-properties": !!U(Tn),
4095
- onContextMenuAction: U(Qn),
4096
- onCloseContextMenu: n[34] ||= (e) => U(Kn).isOpen = !1,
4097
- onImageWrapSelect: U(Zn),
4098
- onCloseImageContextMenu: n[35] ||= (e) => qn.value = null,
4099
- onOpenImageProperties: n[36] ||= (e) => N.value = !0
4206
+ M(Zr, {
4207
+ "read-only": u.value,
4208
+ "context-menu": B(Zn),
4209
+ "image-context-menu": B(Qn),
4210
+ "image-context-menu-text-actions": B($n),
4211
+ "can-open-image-properties": !!B(kn),
4212
+ onContextMenuAction: B(rr),
4213
+ onCloseContextMenu: n[34] ||= (e) => B(Zn).isOpen = !1,
4214
+ onImageWrapSelect: B(nr),
4215
+ onCloseImageContextMenu: n[35] ||= (e) => Qn.value = null,
4216
+ onOpenImageProperties: n[36] ||= (e) => P.value = !0
4100
4217
  }, null, 8, [
4101
4218
  "read-only",
4102
4219
  "context-menu",
@@ -4111,8 +4228,8 @@ var gi = { class: "docx-editor-vue__toolbar-shell" }, _i = {
4111
4228
  });
4112
4229
  //#endregion
4113
4230
  //#region src/renderAsync.ts
4114
- async function wi(e, t, n = {}) {
4115
- let r = e instanceof ArrayBuffer ? e : await ze(e), i = null, a = null, o = !1, s = {
4231
+ async function Ui(e, t, n = {}) {
4232
+ let r = e instanceof ArrayBuffer ? e : await Ge(e), i = null, a = null, o = !1, s = {
4116
4233
  save: async () => {
4117
4234
  let e = await (i?.save() ?? Promise.resolve(null));
4118
4235
  return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
@@ -4134,7 +4251,7 @@ async function wi(e, t, n = {}) {
4134
4251
  };
4135
4252
  return new Promise((e, c) => {
4136
4253
  a = re({ setup() {
4137
- return () => se(Ci, {
4254
+ return () => P(Hi, {
4138
4255
  ...n,
4139
4256
  documentBuffer: r,
4140
4257
  showToolbar: n.showToolbar ?? !0,
@@ -4158,6 +4275,6 @@ async function wi(e, t, n = {}) {
4158
4275
  }
4159
4276
  //#endregion
4160
4277
  //#region src/index.ts
4161
- var Ti = "0.0.2";
4278
+ var Wi = "0.0.2";
4162
4279
  //#endregion
4163
- export { Ci as DocxEditor, Ti as VERSION, Rt as createDocumentWithText, zt as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, wi as renderAsync, n as useTranslation };
4280
+ export { Hi as DocxEditor, Wi as VERSION, Qt as createDocumentWithText, $t as createEmptyDocument, n as defaultLocale, t as i18nPlugin, a as provideLocale, Ui as renderAsync, d as useTranslation };