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