@eigenpal/docx-editor-vue 1.4.0 → 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.
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B52Kst-M.js";
2
- import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, inject as l, nextTick as u, normalizeClass as d, normalizeStyle as f, openBlock as p, provide as m, ref as h, renderList as g, toDisplayString as _, unref as v, vModelCheckbox as y, vModelSelect as b, vModelText as x, watch as S, withDirectives as C, withKeys as w, withModifiers as T } from "vue";
3
- import { TextSelection as E } from "prosemirror-state";
4
- import { TWIPS_PER_INCH as D } from "@eigenpal/docx-editor-core/utils";
5
- var O = {
2
+ import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, inject as c, nextTick as l, normalizeClass as u, normalizeStyle as d, openBlock as f, provide as p, ref as m, renderList as h, toDisplayString as g, unref as _, vModelCheckbox as v, vModelSelect as y, vModelText as b, watch as x, withDirectives as S, withKeys as C, withModifiers as w } from "vue";
3
+ import { TextSelection as T } from "prosemirror-state";
4
+ import { TWIPS_PER_INCH as E } from "@eigenpal/docx-editor-core/utils";
5
+ var D = {
6
6
  undo: ["M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"],
7
7
  redo: ["M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"],
8
8
  print: ["M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"],
@@ -101,7 +101,7 @@ var O = {
101
101
  format_textdirection_l_to_r: ["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"],
102
102
  format_textdirection_r_to_l: ["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"],
103
103
  "agent-sparkle": ["m760-600-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110Zm0 560-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110ZM360-160 260-380 40-480l220-100 100-220 100 220 220 100-220 100-100 220Zm0-194 40-86 86-40-86-40-40-86-40 86-86 40 86 40 40 86Zm0-126Z"]
104
- }, k = ["width", "height"], A = ["d"], j = /* @__PURE__ */ c({
104
+ }, O = ["width", "height"], k = ["d"], A = /* @__PURE__ */ s({
105
105
  __name: "MaterialSymbol",
106
106
  props: {
107
107
  name: {},
@@ -110,37 +110,37 @@ var O = {
110
110
  style: {}
111
111
  },
112
112
  setup(e) {
113
- let r = e, a = n(() => O[r.name] || (typeof console < "u" && console.warn(`Icon not found: ${r.name}`), null));
114
- return (n, r) => a.value ? (p(), i("svg", {
113
+ let r = e, a = n(() => D[r.name] || (typeof console < "u" && console.warn(`Icon not found: ${r.name}`), null));
114
+ return (n, r) => a.value ? (f(), i("svg", {
115
115
  key: 0,
116
116
  xmlns: "http://www.w3.org/2000/svg",
117
117
  width: e.size,
118
118
  height: e.size,
119
119
  viewBox: "0 -960 960 960",
120
120
  fill: "currentColor",
121
- class: d(e.className),
122
- style: f({
121
+ class: u(e.className),
122
+ style: d({
123
123
  display: "inline-flex",
124
124
  flexShrink: 0,
125
125
  ...e.style ?? {}
126
126
  }),
127
127
  "aria-hidden": "true"
128
- }, [(p(!0), i(t, null, g(a.value, (e, t) => (p(), i("path", {
128
+ }, [(f(!0), i(t, null, h(a.value, (e, t) => (f(), i("path", {
129
129
  key: t,
130
130
  d: e
131
- }, null, 8, A))), 128))], 14, k)) : (p(), i("span", {
131
+ }, null, 8, k))), 128))], 14, O)) : (f(), i("span", {
132
132
  key: 1,
133
- class: d(e.className),
134
- style: f({
133
+ class: u(e.className),
134
+ style: d({
135
135
  fontSize: `${e.size}px`,
136
136
  width: `${e.size}px`,
137
137
  height: `${e.size}px`,
138
138
  display: "inline-flex",
139
139
  ...e.style ?? {}
140
140
  })
141
- }, _(e.name), 7));
141
+ }, g(e.name), 7));
142
142
  }
143
- }), M = {
143
+ }), j = {
144
144
  _lang: "en",
145
145
  common: {
146
146
  cancel: "Cancel",
@@ -1001,36 +1001,36 @@ var O = {
1001
1001
  }
1002
1002
  }
1003
1003
  };
1004
- function N(e) {
1004
+ function M(e) {
1005
1005
  return typeof e == "object" && !!e && !Array.isArray(e);
1006
1006
  }
1007
- function P(e, t) {
1007
+ function N(e, t) {
1008
1008
  if (!t) return e;
1009
1009
  let n = { ...e };
1010
1010
  for (let r of Object.keys(t)) {
1011
1011
  let i = t[r];
1012
- i !== null && (N(e[r]) && N(i) ? n[r] = P(e[r], i) : i !== void 0 && (n[r] = i));
1012
+ i !== null && (M(e[r]) && M(i) ? n[r] = N(e[r], i) : i !== void 0 && (n[r] = i));
1013
1013
  }
1014
1014
  return n;
1015
1015
  }
1016
- function F(e, t) {
1016
+ function P(e, t) {
1017
1017
  let n = e;
1018
1018
  for (let e of t.split(".")) {
1019
- if (!N(n)) return;
1019
+ if (!M(n)) return;
1020
1020
  n = n[e];
1021
1021
  }
1022
1022
  return typeof n == "string" ? n : void 0;
1023
1023
  }
1024
- function I(e) {
1024
+ function F(e) {
1025
1025
  let t = {}, n = /(=\d+|\w+)\s*\{([^}]*)\}/g, r;
1026
1026
  for (; (r = n.exec(e)) !== null;) t[r[1]] = r[2];
1027
1027
  return t;
1028
1028
  }
1029
- function L(e, t, n) {
1029
+ function I(e, t, n) {
1030
1030
  return t ? e.replace(/\{(\w+),\s*plural,\s*((?:[^{}]|\{[^{}]*\})*)\}/g, (e, r, i) => {
1031
1031
  let a = Number(t[r]);
1032
1032
  if (isNaN(a)) return e;
1033
- let o = I(i), s = o[`=${a}`];
1033
+ let o = F(i), s = o[`=${a}`];
1034
1034
  if (s !== void 0) return s.replace(/#/g, String(a));
1035
1035
  let c;
1036
1036
  try {
@@ -1044,44 +1044,44 @@ function L(e, t, n) {
1044
1044
  return r === void 0 ? `{${n}}` : String(r);
1045
1045
  }) : e;
1046
1046
  }
1047
- function R(e, t = "en") {
1048
- return (n, r) => L(F(e, n) ?? n, r, t);
1047
+ function L(e, t = "en") {
1048
+ return (n, r) => I(P(e, n) ?? n, r, t);
1049
1049
  }
1050
1050
  //#endregion
1051
1051
  //#region src/i18n/index.ts
1052
- var z = Symbol("docx-locale"), B = Symbol("docx-lang");
1053
- function V(e) {
1052
+ var R = Symbol("docx-locale"), z = Symbol("docx-lang");
1053
+ function B(e) {
1054
1054
  return {
1055
- strings: n(() => P(M, v(e))),
1055
+ strings: n(() => N(j, _(e))),
1056
1056
  lang: n(() => {
1057
- let t = v(e)?._lang;
1057
+ let t = _(e)?._lang;
1058
1058
  return typeof t == "string" ? t : "en";
1059
1059
  })
1060
1060
  };
1061
1061
  }
1062
1062
  function ee(e) {
1063
- let { strings: t, lang: n } = V(e);
1064
- m(z, t), m(B, n);
1063
+ let { strings: t, lang: n } = B(e);
1064
+ p(R, t), p(z, n);
1065
1065
  }
1066
1066
  function te(e) {
1067
- let { strings: t, lang: n } = V(e);
1068
- return { t: (e, r) => R(v(t), v(n))(e, r) };
1067
+ let { strings: t, lang: n } = B(e);
1068
+ return { t: (e, r) => L(_(t), _(n))(e, r) };
1069
1069
  }
1070
- function H() {
1071
- let e = l(z, M), t = l(B, "en");
1072
- return { t: (n, r) => R(v(e), v(t))(n, r) };
1070
+ function V() {
1071
+ let e = c(R, j), t = c(z, "en");
1072
+ return { t: (n, r) => L(_(e), _(t))(n, r) };
1073
1073
  }
1074
1074
  var ne = { install(e, t) {
1075
- let n = typeof t?._lang == "string" ? t._lang : "en", r = P(M, t);
1076
- e.provide(z, r), e.provide(B, n);
1077
- } }, re = { class: "find-replace-dialog__header" }, ie = { class: "find-replace-dialog__title" }, U = ["title"], W = { class: "find-replace-dialog__body" }, G = { class: "find-replace-dialog__row" }, K = ["placeholder", "aria-label"], q = { class: "find-replace-dialog__count" }, J = ["title"], Y = ["title"], ae = { class: "find-replace-dialog__options" }, oe = ["title"], se = {
1075
+ let n = typeof t?._lang == "string" ? t._lang : "en", r = N(j, t);
1076
+ e.provide(R, r), e.provide(z, n);
1077
+ } }, re = { class: "find-replace-dialog__header" }, ie = { class: "find-replace-dialog__title" }, H = ["title"], U = { class: "find-replace-dialog__body" }, W = { class: "find-replace-dialog__row" }, G = ["placeholder", "aria-label"], K = { class: "find-replace-dialog__count" }, q = ["title"], J = ["title"], Y = { class: "find-replace-dialog__options" }, ae = ["title"], oe = {
1078
1078
  key: 0,
1079
1079
  class: "find-replace-dialog__row"
1080
- }, ce = [
1080
+ }, se = [
1081
1081
  "placeholder",
1082
1082
  "aria-label",
1083
1083
  "onKeydown"
1084
- ], le = ["title"], ue = ["title"], de = /* @__PURE__ */ e(/* @__PURE__ */ c({
1084
+ ], ce = ["title"], le = ["title"], ue = /* @__PURE__ */ e(/* @__PURE__ */ s({
1085
1085
  __name: "FindReplaceDialog",
1086
1086
  props: {
1087
1087
  isOpen: { type: Boolean },
@@ -1090,24 +1090,24 @@ var ne = { install(e, t) {
1090
1090
  },
1091
1091
  emits: ["close"],
1092
1092
  setup(e, { emit: t }) {
1093
- let { t: s } = H(), c = e, l = t, f = h(null), m = h(""), g = h(""), b = h(!1), D = h(!1), O = h(!1), k = h([]), A = h(-1), j = n(() => m.value.trim() ? k.value.length === 0 ? s("dialogs.findReplace.noResults") : A.value < 0 ? s("dialogs.findReplace.matchesFound", { total: k.value.length }) : s("dialogs.findReplace.matchCount", {
1093
+ let { t: s } = V(), c = e, d = t, p = m(null), h = m(""), y = m(""), E = m(!1), D = m(!1), O = m(!1), k = m([]), A = m(-1), j = n(() => h.value.trim() ? k.value.length === 0 ? s("dialogs.findReplace.noResults") : A.value < 0 ? s("dialogs.findReplace.matchesFound", { total: k.value.length }) : s("dialogs.findReplace.matchCount", {
1094
1094
  current: A.value + 1,
1095
1095
  total: k.value.length
1096
1096
  }) : "");
1097
- S(() => c.isOpen, async (e) => {
1098
- e ? (await u(), f.value?.focus(), f.value?.select(), N()) : z();
1097
+ x(() => c.isOpen, async (e) => {
1098
+ e ? (await l(), p.value?.focus(), p.value?.select(), N()) : z();
1099
1099
  });
1100
1100
  function M() {
1101
- z(), l("close");
1101
+ z(), d("close");
1102
1102
  }
1103
1103
  function N() {
1104
1104
  k.value = [], A.value = -1;
1105
1105
  let e = c.view;
1106
- if (!e || !m.value.trim()) {
1106
+ if (!e || !h.value.trim()) {
1107
1107
  z();
1108
1108
  return;
1109
1109
  }
1110
- let t = e.state.doc, n = m.value, r = !b.value, i = [];
1110
+ let t = e.state.doc, n = h.value, r = !E.value, i = [];
1111
1111
  t.descendants((e, a) => {
1112
1112
  if (!e.isTextblock) return !0;
1113
1113
  let o = t.textBetween(a + 1, a + e.nodeSize - 1, "", "");
@@ -1139,7 +1139,7 @@ var ne = { install(e, t) {
1139
1139
  A.value = e;
1140
1140
  let { from: r, to: i } = n;
1141
1141
  try {
1142
- let e = t.state.doc.resolve(r), n = t.state.doc.resolve(i), a = E.between(e, n);
1142
+ let e = t.state.doc.resolve(r), n = t.state.doc.resolve(i), a = T.between(e, n);
1143
1143
  t.dispatch(t.state.tr.setSelection(a)), c.scrollVisiblePositionIntoView?.(r);
1144
1144
  } catch {}
1145
1145
  }
@@ -1160,7 +1160,7 @@ var ne = { install(e, t) {
1160
1160
  if (t) {
1161
1161
  try {
1162
1162
  let n;
1163
- n = g.value ? e.state.tr.replaceWith(t.from, t.to, e.state.schema.text(g.value)) : e.state.tr.delete(t.from, t.to), e.dispatch(n);
1163
+ n = y.value ? e.state.tr.replaceWith(t.from, t.to, e.state.schema.text(y.value)) : e.state.tr.delete(t.from, t.to), e.dispatch(n);
1164
1164
  } catch {}
1165
1165
  N();
1166
1166
  }
@@ -1170,7 +1170,7 @@ var ne = { install(e, t) {
1170
1170
  if (!e || k.value.length === 0) return;
1171
1171
  let t = [...k.value].sort((e, t) => t.from - e.from), n = e.state.tr;
1172
1172
  for (let r of t) try {
1173
- n = g.value ? n.replaceWith(r.from, r.to, e.state.schema.text(g.value)) : n.delete(r.from, r.to);
1173
+ n = y.value ? n.replaceWith(r.from, r.to, e.state.schema.text(y.value)) : n.delete(r.from, r.to);
1174
1174
  } catch {}
1175
1175
  e.dispatch(n), N();
1176
1176
  }
@@ -1180,252 +1180,94 @@ var ne = { install(e, t) {
1180
1180
  function B(e) {
1181
1181
  e.key === "Enter" ? (e.preventDefault(), e.shiftKey ? I() : F()) : e.key === "Escape" && M();
1182
1182
  }
1183
- return (t, n) => e.isOpen ? (p(), i("div", {
1183
+ return (t, n) => e.isOpen ? (f(), i("div", {
1184
1184
  key: 0,
1185
1185
  class: "find-replace-dialog",
1186
- onMousedown: n[5] ||= T(() => {}, ["stop"]),
1187
- onKeydown: n[6] ||= T(() => {}, ["stop"])
1188
- }, [a("div", re, [a("span", ie, _(O.value ? v(s)("dialogs.findReplace.titleFindReplace") : v(s)("dialogs.findReplace.titleFind")), 1), a("button", {
1186
+ onMousedown: n[5] ||= w(() => {}, ["stop"]),
1187
+ onKeydown: n[6] ||= w(() => {}, ["stop"])
1188
+ }, [a("div", re, [a("span", ie, g(O.value ? _(s)("dialogs.findReplace.titleFindReplace") : _(s)("dialogs.findReplace.titleFind")), 1), a("button", {
1189
1189
  class: "find-replace-dialog__close",
1190
1190
  onClick: M,
1191
- title: v(s)("common.closeDialog")
1192
- }, " ✕ ", 8, U)]), a("div", W, [
1193
- a("div", G, [
1194
- C(a("input", {
1191
+ title: _(s)("common.closeDialog")
1192
+ }, " ✕ ", 8, H)]), a("div", U, [
1193
+ a("div", W, [
1194
+ S(a("input", {
1195
1195
  ref_key: "searchInputRef",
1196
- ref: f,
1197
- "onUpdate:modelValue": n[0] ||= (e) => m.value = e,
1196
+ ref: p,
1197
+ "onUpdate:modelValue": n[0] ||= (e) => h.value = e,
1198
1198
  class: "find-replace-dialog__input",
1199
- placeholder: v(s)("dialogs.findReplace.findPlaceholder"),
1200
- "aria-label": v(s)("dialogs.findReplace.findAriaLabel"),
1199
+ placeholder: _(s)("dialogs.findReplace.findPlaceholder"),
1200
+ "aria-label": _(s)("dialogs.findReplace.findAriaLabel"),
1201
1201
  onKeydown: B,
1202
1202
  onInput: N
1203
- }, null, 40, K), [[x, m.value]]),
1204
- a("span", q, _(j.value), 1),
1203
+ }, null, 40, G), [[b, h.value]]),
1204
+ a("span", K, g(j.value), 1),
1205
1205
  a("button", {
1206
- title: v(s)("dialogs.findReplace.findPreviousTitle"),
1207
- onMousedown: T(I, ["prevent"])
1208
- }, " ▲ ", 40, J),
1206
+ title: _(s)("dialogs.findReplace.findPreviousTitle"),
1207
+ onMousedown: w(I, ["prevent"])
1208
+ }, " ▲ ", 40, q),
1209
1209
  a("button", {
1210
- title: v(s)("dialogs.findReplace.findNextTitle"),
1211
- onMousedown: T(F, ["prevent"])
1212
- }, " ▼ ", 40, Y)
1210
+ title: _(s)("dialogs.findReplace.findNextTitle"),
1211
+ onMousedown: w(F, ["prevent"])
1212
+ }, " ▼ ", 40, J)
1213
1213
  ]),
1214
- a("div", ae, [
1215
- a("label", null, [C(a("input", {
1214
+ a("div", Y, [
1215
+ a("label", null, [S(a("input", {
1216
1216
  type: "checkbox",
1217
- "onUpdate:modelValue": n[1] ||= (e) => b.value = e,
1217
+ "onUpdate:modelValue": n[1] ||= (e) => E.value = e,
1218
1218
  onChange: N
1219
- }, null, 544), [[y, b.value]]), o(" " + _(v(s)("dialogs.findReplace.matchCase")), 1)]),
1220
- a("label", null, [C(a("input", {
1219
+ }, null, 544), [[v, E.value]]), o(" " + g(_(s)("dialogs.findReplace.matchCase")), 1)]),
1220
+ a("label", null, [S(a("input", {
1221
1221
  type: "checkbox",
1222
1222
  "onUpdate:modelValue": n[2] ||= (e) => D.value = e,
1223
1223
  onChange: N
1224
- }, null, 544), [[y, D.value]]), o(" " + _(v(s)("dialogs.findReplace.wholeWords")), 1)]),
1224
+ }, null, 544), [[v, D.value]]), o(" " + g(_(s)("dialogs.findReplace.wholeWords")), 1)]),
1225
1225
  a("button", {
1226
- class: d(["find-replace-dialog__toggle", { active: O.value }]),
1227
- onMousedown: n[3] ||= T((e) => O.value = !O.value, ["prevent"]),
1228
- title: v(s)("dialogs.findReplace.toggleReplace")
1229
- }, " ↔ " + _(v(s)("dialogs.findReplace.replaceButton")), 43, oe)
1226
+ class: u(["find-replace-dialog__toggle", { active: O.value }]),
1227
+ onMousedown: n[3] ||= w((e) => O.value = !O.value, ["prevent"]),
1228
+ title: _(s)("dialogs.findReplace.toggleReplace")
1229
+ }, " ↔ " + g(_(s)("dialogs.findReplace.replaceButton")), 43, ae)
1230
1230
  ]),
1231
- O.value ? (p(), i("div", se, [
1232
- C(a("input", {
1233
- "onUpdate:modelValue": n[4] ||= (e) => g.value = e,
1231
+ O.value ? (f(), i("div", oe, [
1232
+ S(a("input", {
1233
+ "onUpdate:modelValue": n[4] ||= (e) => y.value = e,
1234
1234
  class: "find-replace-dialog__input",
1235
- placeholder: v(s)("dialogs.findReplace.replacePlaceholder"),
1236
- "aria-label": v(s)("dialogs.findReplace.replaceAriaLabel"),
1237
- onKeydown: w(T(L, ["prevent"]), ["enter"])
1238
- }, null, 40, ce), [[x, g.value]]),
1235
+ placeholder: _(s)("dialogs.findReplace.replacePlaceholder"),
1236
+ "aria-label": _(s)("dialogs.findReplace.replaceAriaLabel"),
1237
+ onKeydown: C(w(L, ["prevent"]), ["enter"])
1238
+ }, null, 40, se), [[b, y.value]]),
1239
1239
  a("button", {
1240
- title: v(s)("dialogs.findReplace.replaceCurrentTitle"),
1241
- onMousedown: T(L, ["prevent"])
1242
- }, _(v(s)("dialogs.findReplace.replaceButton")), 41, le),
1240
+ title: _(s)("dialogs.findReplace.replaceCurrentTitle"),
1241
+ onMousedown: w(L, ["prevent"])
1242
+ }, g(_(s)("dialogs.findReplace.replaceButton")), 41, ce),
1243
1243
  a("button", {
1244
- title: v(s)("dialogs.findReplace.replaceAllTitle"),
1245
- onMousedown: T(R, ["prevent"])
1246
- }, _(v(s)("dialogs.findReplace.replaceAllButton")), 41, ue)
1244
+ title: _(s)("dialogs.findReplace.replaceAllTitle"),
1245
+ onMousedown: w(R, ["prevent"])
1246
+ }, g(_(s)("dialogs.findReplace.replaceAllButton")), 41, le)
1247
1247
  ])) : r("", !0)
1248
1248
  ])], 32)) : r("", !0);
1249
1249
  }
1250
- }), [["__scopeId", "data-v-50723afb"]]), fe = { class: "dialog__header" }, pe = { class: "dialog__title" }, me = ["aria-label"], he = { class: "dialog__body" }, ge = { class: "drop-zone__icon" }, _e = { class: "drop-zone__text" }, ve = { class: "drop-zone__hint" }, ye = ["src", "alt"], be = ["aria-label"], xe = {
1251
- key: 0,
1252
- class: "drop-zone__error"
1253
- }, Se = {
1254
- key: 1,
1255
- class: "image-controls"
1256
- }, Ce = { class: "lock-label" }, we = {
1257
- key: 2,
1258
- class: "image-controls"
1259
- }, Te = { style: { flex: "1" } }, Ee = ["placeholder"], De = {
1260
- key: 3,
1261
- class: "dialog__actions"
1262
- }, Oe = /* @__PURE__ */ e(/* @__PURE__ */ c({
1263
- __name: "InsertImageDialog",
1264
- props: { isOpen: { type: Boolean } },
1265
- emits: ["close", "insert"],
1266
- setup(e, { emit: n }) {
1267
- let { t: c } = H(), l = n, u = h(null), f = h(""), m = h(400), g = h(300), b = h(!0), S = h(""), w = h(""), E = h(!1), D = 1;
1268
- function O() {
1269
- l("close");
1270
- }
1271
- function k() {
1272
- f.value = "", w.value = "", S.value = "", m.value = 400, g.value = 300;
1273
- }
1274
- function A(e) {
1275
- E.value = !1;
1276
- let t = e.dataTransfer?.files?.[0];
1277
- t && N(t);
1278
- }
1279
- function M(e) {
1280
- let t = e.target.files?.[0];
1281
- t && N(t);
1282
- }
1283
- function N(e) {
1284
- if (w.value = "", !e.type.startsWith("image/")) {
1285
- w.value = c("dialogs.insertImage.invalidFile");
1286
- return;
1287
- }
1288
- if (e.size > 10 * 1024 * 1024) {
1289
- w.value = c("dialogs.insertImage.fileTooLarge");
1290
- return;
1291
- }
1292
- S.value = e.name.replace(/\.[^.]+$/, "");
1293
- let t = new FileReader();
1294
- t.onload = () => {
1295
- let e = t.result, n = new Image();
1296
- n.onload = () => {
1297
- let t = n.naturalWidth, r = n.naturalHeight;
1298
- t > 800 && (r = Math.round(800 / t * r), t = 800), r > 600 && (t = Math.round(600 / r * t), r = 600), m.value = t, g.value = r, D = t / r, f.value = e;
1299
- }, n.onerror = () => {
1300
- w.value = c("dialogs.insertImage.loadFailed");
1301
- }, n.src = e;
1302
- }, t.onerror = () => {
1303
- w.value = c("dialogs.insertImage.readFailed");
1304
- }, t.readAsDataURL(e);
1305
- }
1306
- function P() {
1307
- b.value && D && (g.value = Math.round(m.value / D));
1308
- }
1309
- function F() {
1310
- b.value && D && (m.value = Math.round(g.value * D));
1311
- }
1312
- function I() {
1313
- f.value && (l("insert", {
1314
- src: f.value,
1315
- width: m.value,
1316
- height: g.value,
1317
- alt: S.value
1318
- }), k(), O());
1319
- }
1320
- return (n, l) => e.isOpen ? (p(), i("div", {
1321
- key: 0,
1322
- class: "dialog-overlay",
1323
- onMousedown: T(O, ["self"])
1324
- }, [a("div", {
1325
- class: "dialog",
1326
- onMousedown: l[7] ||= T(() => {}, ["stop"]),
1327
- onKeydown: l[8] ||= T(() => {}, ["stop"])
1328
- }, [a("div", fe, [a("span", pe, _(v(c)("dialogs.insertImage.title")), 1), a("button", {
1329
- class: "dialog__close",
1330
- "aria-label": v(c)("common.closeDialog"),
1331
- onClick: O
1332
- }, " ✕ ", 8, me)]), a("div", he, [
1333
- a("div", {
1334
- class: d(["drop-zone", { "drop-zone--active": E.value }]),
1335
- onDragover: l[0] ||= T((e) => E.value = !0, ["prevent"]),
1336
- onDragleave: l[1] ||= (e) => E.value = !1,
1337
- onDrop: T(A, ["prevent"]),
1338
- onClick: l[2] ||= (e) => u.value?.click()
1339
- }, [f.value ? (p(), i("img", {
1340
- key: 1,
1341
- src: f.value,
1342
- class: "drop-zone__preview",
1343
- alt: v(c)("dialogs.insertImage.preview")
1344
- }, null, 8, ye)) : (p(), i(t, { key: 0 }, [
1345
- a("div", ge, [s(j, {
1346
- name: "image",
1347
- size: 48
1348
- })]),
1349
- a("div", _e, _(v(c)("dialogs.insertImage.uploadText")), 1),
1350
- a("div", ve, _(v(c)("dialogs.insertImage.uploadSubtext")), 1)
1351
- ], 64))], 34),
1352
- a("input", {
1353
- ref_key: "fileInput",
1354
- ref: u,
1355
- type: "file",
1356
- accept: "image/*",
1357
- style: { display: "none" },
1358
- "aria-label": v(c)("dialogs.insertImage.uploadAriaLabel"),
1359
- onChange: M
1360
- }, null, 40, be),
1361
- w.value ? (p(), i("div", xe, _(w.value), 1)) : r("", !0),
1362
- f.value ? (p(), i("div", Se, [
1363
- a("label", null, [o(_(v(c)("dialogs.insertImage.widthLabel")) + " ", 1), C(a("input", {
1364
- "onUpdate:modelValue": l[3] ||= (e) => m.value = e,
1365
- type: "number",
1366
- min: "1",
1367
- max: "2000",
1368
- class: "dim-input",
1369
- onInput: P
1370
- }, null, 544), [[
1371
- x,
1372
- m.value,
1373
- void 0,
1374
- { number: !0 }
1375
- ]])]),
1376
- a("label", null, [o(_(v(c)("dialogs.insertImage.heightLabel")) + " ", 1), C(a("input", {
1377
- "onUpdate:modelValue": l[4] ||= (e) => g.value = e,
1378
- type: "number",
1379
- min: "1",
1380
- max: "2000",
1381
- class: "dim-input",
1382
- onInput: F
1383
- }, null, 544), [[
1384
- x,
1385
- g.value,
1386
- void 0,
1387
- { number: !0 }
1388
- ]])]),
1389
- a("label", Ce, [C(a("input", {
1390
- type: "checkbox",
1391
- "onUpdate:modelValue": l[5] ||= (e) => b.value = e
1392
- }, null, 512), [[y, b.value]]), o(" " + _(b.value ? v(c)("dialogs.insertImage.aspectRatioLocked") : v(c)("dialogs.insertImage.aspectRatioUnlocked")), 1)])
1393
- ])) : r("", !0),
1394
- f.value ? (p(), i("div", we, [a("label", Te, [o(_(v(c)("dialogs.insertImage.altTextLabel")) + " ", 1), C(a("input", {
1395
- "onUpdate:modelValue": l[6] ||= (e) => S.value = e,
1396
- class: "alt-input",
1397
- placeholder: v(c)("dialogs.insertImage.altTextPlaceholder")
1398
- }, null, 8, Ee), [[x, S.value]])])])) : r("", !0),
1399
- f.value ? (p(), i("div", De, [a("button", {
1400
- class: "dialog__btn",
1401
- onClick: k
1402
- }, _(v(c)("common.clear")), 1), a("button", {
1403
- class: "dialog__btn dialog__btn--primary",
1404
- onMousedown: T(I, ["prevent"])
1405
- }, _(v(c)("dialogs.insertImage.insertButton")), 33)])) : r("", !0)
1406
- ])], 32)], 32)) : r("", !0);
1407
- }
1408
- }), [["__scopeId", "data-v-8ea71e65"]]), ke = { class: "dialog__header" }, Ae = { class: "dialog__title" }, je = ["aria-label"], Me = { class: "dialog__body" }, Ne = {
1250
+ }), [["__scopeId", "data-v-50723afb"]]), de = { class: "dialog__header" }, fe = { class: "dialog__title" }, pe = ["aria-label"], me = { class: "dialog__body" }, he = {
1409
1251
  key: 0,
1410
1252
  class: "link-tabs",
1411
1253
  role: "tablist"
1412
- }, Pe = ["aria-selected"], Fe = ["aria-selected"], Ie = {
1254
+ }, ge = ["aria-selected"], _e = ["aria-selected"], ve = {
1413
1255
  key: 1,
1414
1256
  class: "field"
1415
- }, Le = { class: "field__label" }, Re = [
1257
+ }, ye = { class: "field__label" }, be = [
1416
1258
  "placeholder",
1417
1259
  "aria-invalid",
1418
1260
  "onKeydown"
1419
- ], ze = {
1261
+ ], xe = {
1420
1262
  key: 0,
1421
1263
  class: "field__error"
1422
- }, Be = {
1264
+ }, Se = {
1423
1265
  key: 1,
1424
1266
  class: "field__hint"
1425
- }, Ve = {
1267
+ }, Ce = {
1426
1268
  key: 2,
1427
1269
  class: "field"
1428
- }, He = { class: "field__label" }, Ue = ["onKeydown"], We = { value: "" }, Ge = ["value"], Ke = { class: "field" }, qe = { class: "field__label" }, Je = ["placeholder"], Ye = { class: "field__hint" }, Xe = { class: "field" }, Ze = { class: "field__label" }, Qe = ["placeholder"], $e = { class: "dialog__actions" }, et = ["disabled"], tt = /* @__PURE__ */ e(/* @__PURE__ */ c({
1270
+ }, we = { class: "field__label" }, Te = ["onKeydown"], Ee = { value: "" }, De = ["value"], Oe = { class: "field" }, ke = { class: "field__label" }, Ae = ["placeholder"], je = { class: "field__hint" }, Me = { class: "field" }, Ne = { class: "field__label" }, Pe = ["placeholder"], Fe = { class: "dialog__actions" }, Ie = ["disabled"], Le = /* @__PURE__ */ e(/* @__PURE__ */ s({
1429
1271
  __name: "HyperlinkDialog",
1430
1272
  props: {
1431
1273
  isOpen: { type: Boolean },
@@ -1438,8 +1280,8 @@ var ne = { install(e, t) {
1438
1280
  "remove"
1439
1281
  ],
1440
1282
  setup(e, { emit: o }) {
1441
- let { t: s } = H(), c = e, l = o, f = h(null), m = h(null), y = h("url"), E = h(""), D = h(""), O = h(""), k = h(""), A = h(!1), j = h(""), M = h(!1), N = n(() => c.bookmarks ?? []), P = n(() => y.value === "bookmark" ? !!D.value : !!E.value.trim() && !j.value);
1442
- S(E, () => {
1283
+ let { t: s } = V(), c = e, d = o, p = m(null), v = m(null), T = m("url"), E = m(""), D = m(""), O = m(""), k = m(""), A = m(!1), j = m(""), M = m(!1), N = n(() => c.bookmarks ?? []), P = n(() => T.value === "bookmark" ? !!D.value : !!E.value.trim() && !j.value);
1284
+ x(E, () => {
1443
1285
  j.value &&= "";
1444
1286
  });
1445
1287
  function F(e) {
@@ -1458,27 +1300,27 @@ var ne = { install(e, t) {
1458
1300
  let t = e.trim();
1459
1301
  return /^(https?:\/\/|mailto:|tel:|ftp:\/\/)/i.test(t) ? t : `https://${t}`;
1460
1302
  }
1461
- S(() => c.isOpen, async (e) => {
1303
+ x(() => c.isOpen, async (e) => {
1462
1304
  if (e) {
1463
1305
  let e = c.view;
1464
1306
  if (e) {
1465
1307
  let { $from: t, empty: n, from: r, to: i } = e.state.selection, a = (e.state.storedMarks || t.marks()).find((e) => e.type.name === "hyperlink");
1466
1308
  if (a) {
1467
1309
  let e = a.attrs.href || "";
1468
- e.startsWith("#") ? (y.value = "bookmark", D.value = e.slice(1), E.value = "") : (y.value = "url", E.value = e, D.value = ""), k.value = a.attrs.tooltip || "", A.value = !0;
1469
- } else y.value = "url", E.value = "", D.value = "", k.value = "", A.value = !1;
1310
+ e.startsWith("#") ? (T.value = "bookmark", D.value = e.slice(1), E.value = "") : (T.value = "url", E.value = e, D.value = ""), k.value = a.attrs.tooltip || "", A.value = !0;
1311
+ } else T.value = "url", E.value = "", D.value = "", k.value = "", A.value = !1;
1470
1312
  n ? O.value = "" : O.value = e.state.doc.textBetween(r, i);
1471
1313
  }
1472
- await u(), y.value === "bookmark" ? m.value?.focus() : f.value?.focus();
1314
+ await l(), T.value === "bookmark" ? v.value?.focus() : p.value?.focus();
1473
1315
  } else M.value = !1, j.value = "";
1474
1316
  });
1475
1317
  function L() {
1476
- l("close");
1318
+ d("close");
1477
1319
  }
1478
1320
  function R() {
1479
- if (y.value === "bookmark") {
1321
+ if (T.value === "bookmark") {
1480
1322
  if (!D.value) return;
1481
- l("submit", {
1323
+ d("submit", {
1482
1324
  bookmark: D.value,
1483
1325
  displayText: O.value,
1484
1326
  tooltip: k.value
@@ -1489,14 +1331,14 @@ var ne = { install(e, t) {
1489
1331
  j.value = E.value.trim() ? s("dialogs.hyperlink.invalidUrl") : s("dialogs.hyperlink.urlRequired");
1490
1332
  return;
1491
1333
  }
1492
- l("submit", {
1334
+ d("submit", {
1493
1335
  url: I(E.value),
1494
1336
  displayText: O.value,
1495
1337
  tooltip: k.value
1496
1338
  }), L();
1497
1339
  }
1498
1340
  function z() {
1499
- if (y.value === "url") {
1341
+ if (T.value === "url") {
1500
1342
  if (M.value = !0, !E.value.trim()) {
1501
1343
  j.value = "";
1502
1344
  return;
@@ -1505,110 +1347,110 @@ var ne = { install(e, t) {
1505
1347
  }
1506
1348
  }
1507
1349
  function B() {
1508
- l("remove"), L();
1350
+ d("remove"), L();
1509
1351
  }
1510
- return (n, o) => e.isOpen ? (p(), i("div", {
1352
+ return (n, o) => e.isOpen ? (f(), i("div", {
1511
1353
  key: 0,
1512
1354
  class: "dialog-overlay",
1513
- onMousedown: T(L, ["self"])
1355
+ onMousedown: w(L, ["self"])
1514
1356
  }, [a("div", {
1515
1357
  class: "dialog",
1516
- onMousedown: o[6] ||= T(() => {}, ["stop"]),
1517
- onKeydown: o[7] ||= T(() => {}, ["stop"])
1518
- }, [a("div", ke, [a("span", Ae, _(A.value ? v(s)("dialogs.hyperlink.titleEdit") : v(s)("dialogs.hyperlink.titleInsert")), 1), a("button", {
1358
+ onMousedown: o[6] ||= w(() => {}, ["stop"]),
1359
+ onKeydown: o[7] ||= w(() => {}, ["stop"])
1360
+ }, [a("div", de, [a("span", fe, g(A.value ? _(s)("dialogs.hyperlink.titleEdit") : _(s)("dialogs.hyperlink.titleInsert")), 1), a("button", {
1519
1361
  class: "dialog__close",
1520
- "aria-label": v(s)("common.closeDialog"),
1362
+ "aria-label": _(s)("common.closeDialog"),
1521
1363
  onClick: L
1522
- }, " ✕ ", 8, je)]), a("div", Me, [
1523
- N.value.length > 0 ? (p(), i("div", Ne, [a("button", {
1524
- class: d(["link-tab", { active: y.value === "url" }]),
1364
+ }, " ✕ ", 8, pe)]), a("div", me, [
1365
+ N.value.length > 0 ? (f(), i("div", he, [a("button", {
1366
+ class: u(["link-tab", { active: T.value === "url" }]),
1525
1367
  role: "tab",
1526
- "aria-selected": y.value === "url",
1527
- onMousedown: o[0] ||= T((e) => y.value = "url", ["prevent"])
1528
- }, _(v(s)("dialogs.hyperlink.tabWebAddress")), 43, Pe), a("button", {
1529
- class: d(["link-tab", { active: y.value === "bookmark" }]),
1368
+ "aria-selected": T.value === "url",
1369
+ onMousedown: o[0] ||= w((e) => T.value = "url", ["prevent"])
1370
+ }, g(_(s)("dialogs.hyperlink.tabWebAddress")), 43, ge), a("button", {
1371
+ class: u(["link-tab", { active: T.value === "bookmark" }]),
1530
1372
  role: "tab",
1531
- "aria-selected": y.value === "bookmark",
1532
- onMousedown: o[1] ||= T((e) => y.value = "bookmark", ["prevent"])
1533
- }, _(v(s)("dialogs.hyperlink.tabBookmark")), 43, Fe)])) : r("", !0),
1534
- y.value === "url" ? (p(), i("div", Ie, [
1535
- a("label", Le, _(v(s)("dialogs.hyperlink.urlLabel")), 1),
1536
- C(a("input", {
1373
+ "aria-selected": T.value === "bookmark",
1374
+ onMousedown: o[1] ||= w((e) => T.value = "bookmark", ["prevent"])
1375
+ }, g(_(s)("dialogs.hyperlink.tabBookmark")), 43, _e)])) : r("", !0),
1376
+ T.value === "url" ? (f(), i("div", ve, [
1377
+ a("label", ye, g(_(s)("dialogs.hyperlink.urlLabel")), 1),
1378
+ S(a("input", {
1537
1379
  ref_key: "urlInputRef",
1538
- ref: f,
1380
+ ref: p,
1539
1381
  "onUpdate:modelValue": o[2] ||= (e) => E.value = e,
1540
- class: d(["field__input", { "field__input--error": M.value && !!j.value }]),
1541
- placeholder: v(s)("dialogs.hyperlink.urlPlaceholder"),
1382
+ class: u(["field__input", { "field__input--error": M.value && !!j.value }]),
1383
+ placeholder: _(s)("dialogs.hyperlink.urlPlaceholder"),
1542
1384
  "aria-invalid": M.value && !!j.value,
1543
- onKeydown: w(T(R, ["prevent"]), ["enter"]),
1385
+ onKeydown: C(w(R, ["prevent"]), ["enter"]),
1544
1386
  onBlur: z
1545
- }, null, 42, Re), [[x, E.value]]),
1546
- M.value && j.value ? (p(), i("div", ze, _(j.value), 1)) : (p(), i("div", Be, _(v(s)("dialogs.hyperlink.urlHint")), 1))
1547
- ])) : (p(), i("div", Ve, [a("label", He, _(v(s)("dialogs.hyperlink.bookmarkLabel")), 1), C(a("select", {
1387
+ }, null, 42, be), [[b, E.value]]),
1388
+ M.value && j.value ? (f(), i("div", xe, g(j.value), 1)) : (f(), i("div", Se, g(_(s)("dialogs.hyperlink.urlHint")), 1))
1389
+ ])) : (f(), i("div", Ce, [a("label", we, g(_(s)("dialogs.hyperlink.bookmarkLabel")), 1), S(a("select", {
1548
1390
  ref_key: "bookmarkSelectRef",
1549
- ref: m,
1391
+ ref: v,
1550
1392
  "onUpdate:modelValue": o[3] ||= (e) => D.value = e,
1551
1393
  class: "field__input",
1552
- onKeydown: w(T(R, ["prevent"]), ["enter"])
1553
- }, [a("option", We, _(v(s)("dialogs.hyperlink.bookmarkPlaceholder")), 1), (p(!0), i(t, null, g(N.value, (e) => (p(), i("option", {
1394
+ onKeydown: C(w(R, ["prevent"]), ["enter"])
1395
+ }, [a("option", Ee, g(_(s)("dialogs.hyperlink.bookmarkPlaceholder")), 1), (f(!0), i(t, null, h(N.value, (e) => (f(), i("option", {
1554
1396
  key: e.name,
1555
1397
  value: e.name
1556
- }, _(e.label || e.name), 9, Ge))), 128))], 40, Ue), [[b, D.value]])])),
1557
- a("div", Ke, [
1558
- a("label", qe, _(v(s)("dialogs.hyperlink.displayTextLabel")), 1),
1559
- C(a("input", {
1398
+ }, g(e.label || e.name), 9, De))), 128))], 40, Te), [[y, D.value]])])),
1399
+ a("div", Oe, [
1400
+ a("label", ke, g(_(s)("dialogs.hyperlink.displayTextLabel")), 1),
1401
+ S(a("input", {
1560
1402
  "onUpdate:modelValue": o[4] ||= (e) => O.value = e,
1561
1403
  class: "field__input",
1562
- placeholder: v(s)("dialogs.hyperlink.displayTextPlaceholder")
1563
- }, null, 8, Je), [[x, O.value]]),
1564
- a("div", Ye, _(v(s)("dialogs.hyperlink.displayTextHint")), 1)
1404
+ placeholder: _(s)("dialogs.hyperlink.displayTextPlaceholder")
1405
+ }, null, 8, Ae), [[b, O.value]]),
1406
+ a("div", je, g(_(s)("dialogs.hyperlink.displayTextHint")), 1)
1565
1407
  ]),
1566
- a("div", Xe, [a("label", Ze, _(v(s)("dialogs.hyperlink.tooltipLabel")), 1), C(a("input", {
1408
+ a("div", Me, [a("label", Ne, g(_(s)("dialogs.hyperlink.tooltipLabel")), 1), S(a("input", {
1567
1409
  "onUpdate:modelValue": o[5] ||= (e) => k.value = e,
1568
1410
  class: "field__input",
1569
- placeholder: v(s)("dialogs.hyperlink.tooltipPlaceholder")
1570
- }, null, 8, Qe), [[x, k.value]])]),
1571
- a("div", $e, [
1572
- A.value ? (p(), i("button", {
1411
+ placeholder: _(s)("dialogs.hyperlink.tooltipPlaceholder")
1412
+ }, null, 8, Pe), [[b, k.value]])]),
1413
+ a("div", Fe, [
1414
+ A.value ? (f(), i("button", {
1573
1415
  key: 0,
1574
1416
  class: "dialog__btn dialog__btn--danger",
1575
- onMousedown: T(B, ["prevent"])
1576
- }, _(v(s)("dialogs.hyperlink.removeLink")), 33)) : r("", !0),
1417
+ onMousedown: w(B, ["prevent"])
1418
+ }, g(_(s)("dialogs.hyperlink.removeLink")), 33)) : r("", !0),
1577
1419
  o[8] ||= a("div", { style: { flex: "1" } }, null, -1),
1578
1420
  a("button", {
1579
1421
  class: "dialog__btn",
1580
1422
  onClick: L
1581
- }, _(v(s)("common.cancel")), 1),
1423
+ }, g(_(s)("common.cancel")), 1),
1582
1424
  a("button", {
1583
1425
  class: "dialog__btn dialog__btn--primary",
1584
- onMousedown: T(R, ["prevent"]),
1426
+ onMousedown: w(R, ["prevent"]),
1585
1427
  disabled: !P.value
1586
- }, _(A.value ? v(s)("common.update") : v(s)("common.insert")), 41, et)
1428
+ }, g(A.value ? _(s)("common.update") : _(s)("common.insert")), 41, Ie)
1587
1429
  ])
1588
1430
  ])], 32)], 32)) : r("", !0);
1589
1431
  }
1590
- }), [["__scopeId", "data-v-4dc1170f"]]), nt = { class: "dialog__header" }, rt = { class: "dialog__title" }, it = ["title"], at = { class: "dialog__body" }, ot = ["placeholder"], st = {
1432
+ }), [["__scopeId", "data-v-4dc1170f"]]), Re = { class: "dialog__header" }, ze = { class: "dialog__title" }, Be = ["title"], Ve = { class: "dialog__body" }, He = ["placeholder"], Ue = {
1591
1433
  key: 0,
1592
1434
  class: "symbol-tabs"
1593
- }, ct = ["onMousedown"], lt = { class: "symbol-grid" }, ut = [
1435
+ }, We = ["onMousedown"], Ge = { class: "symbol-grid" }, Ke = [
1594
1436
  "title",
1595
1437
  "onClick",
1596
1438
  "onDblclick"
1597
- ], dt = {
1439
+ ], qe = {
1598
1440
  key: 0,
1599
1441
  class: "symbol-empty"
1600
- }, ft = {
1442
+ }, Je = {
1601
1443
  key: 1,
1602
1444
  class: "symbol-preview"
1603
- }, pt = { class: "symbol-preview__char" }, mt = { class: "symbol-preview__info" }, ht = {
1445
+ }, Ye = { class: "symbol-preview__char" }, Xe = { class: "symbol-preview__info" }, Ze = {
1604
1446
  key: 2,
1605
1447
  class: "symbol-recent"
1606
- }, gt = { class: "symbol-recent__label" }, _t = ["onDblclick", "onClick"], vt = { class: "dialog__actions" }, yt = ["disabled"], bt = /* @__PURE__ */ e(/* @__PURE__ */ c({
1448
+ }, Qe = { class: "symbol-recent__label" }, $e = ["onDblclick", "onClick"], et = { class: "dialog__actions" }, tt = ["disabled"], nt = /* @__PURE__ */ e(/* @__PURE__ */ s({
1607
1449
  __name: "InsertSymbolDialog",
1608
1450
  props: { isOpen: { type: Boolean } },
1609
1451
  emits: ["close", "insert"],
1610
1452
  setup(e, { emit: o }) {
1611
- let { t: s } = H(), c = e, l = o, f = h(null), m = h(""), y = h("Common"), b = h(""), E = h([]), D = [
1453
+ let { t: s } = V(), c = e, d = o, p = m(null), v = m(""), y = m("Common"), T = m(""), E = m([]), D = [
1612
1454
  {
1613
1455
  name: "Common",
1614
1456
  nameKey: "dialogs.insertSymbol.categories.common",
@@ -2109,8 +1951,8 @@ var ne = { install(e, t) {
2109
1951
  });
2110
1952
  return e;
2111
1953
  }), k = n(() => {
2112
- if (m.value) {
2113
- let e = m.value.toLowerCase();
1954
+ if (v.value) {
1955
+ let e = v.value.toLowerCase();
2114
1956
  return O.value.filter((t) => t.name.toLowerCase().includes(e) || t.char === e);
2115
1957
  }
2116
1958
  let e = D.find((e) => e.name === y.value);
@@ -2119,66 +1961,66 @@ var ne = { install(e, t) {
2119
1961
  category: e.name
2120
1962
  })) : [];
2121
1963
  });
2122
- S(() => c.isOpen, async (e) => {
2123
- e && (await u(), f.value?.focus());
1964
+ x(() => c.isOpen, async (e) => {
1965
+ e && (await l(), p.value?.focus());
2124
1966
  });
2125
1967
  function A() {
2126
- l("close");
1968
+ d("close");
2127
1969
  }
2128
1970
  function j(e) {
2129
- e && (E.value = [e, ...E.value.filter((t) => t !== e)].slice(0, 10), l("insert", e));
1971
+ e && (E.value = [e, ...E.value.filter((t) => t !== e)].slice(0, 10), d("insert", e));
2130
1972
  }
2131
- return (n, o) => e.isOpen ? (p(), i("div", {
1973
+ return (n, o) => e.isOpen ? (f(), i("div", {
2132
1974
  key: 0,
2133
1975
  class: "dialog-overlay",
2134
- onMousedown: T(A, ["self"])
1976
+ onMousedown: w(A, ["self"])
2135
1977
  }, [a("div", {
2136
1978
  class: "dialog symbol-dialog",
2137
- onMousedown: o[2] ||= T(() => {}, ["stop"]),
2138
- onKeydown: o[3] ||= T(() => {}, ["stop"])
2139
- }, [a("div", nt, [a("span", rt, _(v(s)("dialogs.insertSymbol.title")), 1), a("button", {
1979
+ onMousedown: o[2] ||= w(() => {}, ["stop"]),
1980
+ onKeydown: o[3] ||= w(() => {}, ["stop"])
1981
+ }, [a("div", Re, [a("span", ze, g(_(s)("dialogs.insertSymbol.title")), 1), a("button", {
2140
1982
  class: "dialog__close",
2141
- title: v(s)("common.closeDialog"),
1983
+ title: _(s)("common.closeDialog"),
2142
1984
  onClick: A
2143
- }, "✕", 8, it)]), a("div", at, [
2144
- C(a("input", {
1985
+ }, "✕", 8, Be)]), a("div", Ve, [
1986
+ S(a("input", {
2145
1987
  ref_key: "searchRef",
2146
- ref: f,
2147
- "onUpdate:modelValue": o[0] ||= (e) => m.value = e,
1988
+ ref: p,
1989
+ "onUpdate:modelValue": o[0] ||= (e) => v.value = e,
2148
1990
  class: "symbol-search",
2149
- placeholder: v(s)("dialogs.insertSymbol.searchPlaceholder"),
2150
- onKeydown: w(A, ["escape"])
2151
- }, null, 40, ot), [[x, m.value]]),
2152
- m.value ? r("", !0) : (p(), i("div", st, [(p(), i(t, null, g(D, (e) => a("button", {
1991
+ placeholder: _(s)("dialogs.insertSymbol.searchPlaceholder"),
1992
+ onKeydown: C(A, ["escape"])
1993
+ }, null, 40, He), [[b, v.value]]),
1994
+ v.value ? r("", !0) : (f(), i("div", Ue, [(f(), i(t, null, h(D, (e) => a("button", {
2153
1995
  key: e.name,
2154
- class: d(["symbol-tab", { active: y.value === e.name }]),
2155
- onMousedown: T((t) => y.value = e.name, ["prevent"])
2156
- }, _(v(s)(e.nameKey)), 43, ct)), 64))])),
2157
- a("div", lt, [(p(!0), i(t, null, g(k.value, (e) => (p(), i("button", {
1996
+ class: u(["symbol-tab", { active: y.value === e.name }]),
1997
+ onMousedown: w((t) => y.value = e.name, ["prevent"])
1998
+ }, g(_(s)(e.nameKey)), 43, We)), 64))])),
1999
+ a("div", Ge, [(f(!0), i(t, null, h(k.value, (e) => (f(), i("button", {
2158
2000
  key: e.char,
2159
- class: d(["symbol-cell", { selected: b.value === e.char }]),
2001
+ class: u(["symbol-cell", { selected: T.value === e.char }]),
2160
2002
  title: e.name,
2161
- onClick: (t) => b.value = e.char,
2003
+ onClick: (t) => T.value = e.char,
2162
2004
  onDblclick: (t) => j(e.char)
2163
- }, _(e.char), 43, ut))), 128)), k.value.length === 0 ? (p(), i("div", dt, _(m.value ? v(s)("dialogs.insertSymbol.noResults", { query: m.value }) : v(s)("dialogs.insertSymbol.noResultsEmpty")), 1)) : r("", !0)]),
2164
- b.value ? (p(), i("div", ft, [a("span", pt, _(b.value), 1), a("span", mt, "U+" + _(b.value.codePointAt(0)?.toString(16).toUpperCase().padStart(4, "0")), 1)])) : r("", !0),
2165
- E.value.length > 0 && !m.value ? (p(), i("div", ht, [a("div", gt, _(v(s)("dialogs.insertSymbol.recent")), 1), (p(!0), i(t, null, g(E.value, (e) => (p(), i("button", {
2005
+ }, g(e.char), 43, Ke))), 128)), k.value.length === 0 ? (f(), i("div", qe, g(v.value ? _(s)("dialogs.insertSymbol.noResults", { query: v.value }) : _(s)("dialogs.insertSymbol.noResultsEmpty")), 1)) : r("", !0)]),
2006
+ T.value ? (f(), i("div", Je, [a("span", Ye, g(T.value), 1), a("span", Xe, "U+" + g(T.value.codePointAt(0)?.toString(16).toUpperCase().padStart(4, "0")), 1)])) : r("", !0),
2007
+ E.value.length > 0 && !v.value ? (f(), i("div", Ze, [a("div", Qe, g(_(s)("dialogs.insertSymbol.recent")), 1), (f(!0), i(t, null, h(E.value, (e) => (f(), i("button", {
2166
2008
  key: e,
2167
2009
  class: "symbol-cell symbol-cell--small",
2168
2010
  onDblclick: (t) => j(e),
2169
- onClick: (t) => b.value = e
2170
- }, _(e), 41, _t))), 128))])) : r("", !0),
2171
- a("div", vt, [a("button", {
2011
+ onClick: (t) => T.value = e
2012
+ }, g(e), 41, $e))), 128))])) : r("", !0),
2013
+ a("div", et, [a("button", {
2172
2014
  class: "dialog__btn",
2173
2015
  onClick: A
2174
- }, _(v(s)("common.cancel")), 1), a("button", {
2016
+ }, g(_(s)("common.cancel")), 1), a("button", {
2175
2017
  class: "dialog__btn dialog__btn--primary",
2176
- onMousedown: o[1] ||= T((e) => j(b.value), ["prevent"]),
2177
- disabled: !b.value
2178
- }, _(v(s)("common.insert")), 41, yt)])
2018
+ onMousedown: o[1] ||= w((e) => j(T.value), ["prevent"]),
2019
+ disabled: !T.value
2020
+ }, g(_(s)("common.insert")), 41, tt)])
2179
2021
  ])], 32)], 32)) : r("", !0);
2180
2022
  }
2181
- }), [["__scopeId", "data-v-c5817b27"]]), xt = { class: "dialog__header" }, St = { class: "dialog__title" }, Ct = ["aria-label"], wt = { class: "dialog__body" }, Tt = { class: "field" }, Et = { class: "field__label" }, Dt = ["placeholder"], Ot = { class: "field" }, kt = { class: "field__label" }, At = { value: "inline" }, jt = { value: "wrapRight" }, Mt = { value: "wrapLeft" }, Nt = { value: "topAndBottom" }, Pt = { value: "behind" }, Ft = { value: "inFront" }, It = { class: "field" }, Lt = { class: "field__label" }, Rt = { class: "field-row" }, zt = { value: "solid" }, Bt = { value: "dashed" }, Vt = { value: "dotted" }, Ht = { value: "double" }, Ut = { class: "field" }, Wt = { class: "field__label" }, Gt = { class: "field-row" }, Kt = ["value"], qt = ["value"], Jt = { class: "field__checkbox" }, Yt = { class: "dialog__actions" }, Xt = /* @__PURE__ */ e(/* @__PURE__ */ c({
2023
+ }), [["__scopeId", "data-v-c5817b27"]]), rt = { class: "dialog__header" }, it = { class: "dialog__title" }, at = ["aria-label"], ot = { class: "dialog__body" }, st = { class: "field" }, ct = { class: "field__label" }, lt = ["placeholder"], ut = { class: "field" }, dt = { class: "field__label" }, ft = { value: "inline" }, pt = { value: "wrapRight" }, mt = { value: "wrapLeft" }, ht = { value: "topAndBottom" }, gt = { value: "behind" }, _t = { value: "inFront" }, vt = { class: "field" }, yt = { class: "field__label" }, bt = { class: "field-row" }, xt = { value: "solid" }, St = { value: "dashed" }, Ct = { value: "dotted" }, wt = { value: "double" }, Tt = { class: "field" }, Et = { class: "field__label" }, Dt = { class: "field-row" }, Ot = ["value"], kt = ["value"], At = { class: "field__checkbox" }, jt = { class: "dialog__actions" }, Mt = /* @__PURE__ */ e(/* @__PURE__ */ s({
2182
2024
  __name: "ImagePropertiesDialog",
2183
2025
  props: {
2184
2026
  isOpen: { type: Boolean },
@@ -2187,12 +2029,12 @@ var ne = { install(e, t) {
2187
2029
  },
2188
2030
  emits: ["close"],
2189
2031
  setup(e, { emit: t }) {
2190
- let { t: n } = H(), s = e, c = t, l = h(""), u = h("inline"), d = h(0), f = h("solid"), m = h("#000000"), g = h(200), w = h(150), E = h(!0), D = 1;
2191
- S(() => s.isOpen, (e) => {
2032
+ let { t: n } = V(), s = e, c = t, l = m(""), u = m("inline"), d = m(0), p = m("solid"), h = m("#000000"), C = m(200), T = m(150), E = m(!0), D = 1;
2033
+ x(() => s.isOpen, (e) => {
2192
2034
  if (!(!e || !s.view || s.pmPos === null)) try {
2193
2035
  let e = s.view.state.doc.nodeAt(s.pmPos);
2194
2036
  if (e && e.type.name === "image") {
2195
- l.value = e.attrs.alt || "", d.value = e.attrs.borderWidth || 0, f.value = e.attrs.borderStyle || "solid", m.value = e.attrs.borderColor || "#000000", g.value = e.attrs.width || 200, w.value = e.attrs.height || 150, D = g.value / (w.value || 1), E.value = !0;
2037
+ l.value = e.attrs.alt || "", d.value = e.attrs.borderWidth || 0, p.value = e.attrs.borderStyle || "solid", h.value = e.attrs.borderColor || "#000000", C.value = e.attrs.width || 200, T.value = e.attrs.height || 150, D = C.value / (T.value || 1), E.value = !0;
2196
2038
  let t = e.attrs.displayMode, n = e.attrs.cssFloat, r = e.attrs.wrapType;
2197
2039
  t === "float" && n === "left" ? u.value = "wrapRight" : t === "float" && n === "right" ? u.value = "wrapLeft" : t === "block" ? u.value = "topAndBottom" : r === "behind" ? u.value = "behind" : r === "inFront" ? u.value = "inFront" : u.value = "inline";
2198
2040
  }
@@ -2200,11 +2042,11 @@ var ne = { install(e, t) {
2200
2042
  });
2201
2043
  function O(e) {
2202
2044
  let t = Number(e.target.value);
2203
- isNaN(t) || t < 1 || (g.value = t, E.value && D > 0 && (w.value = Math.round(t / D)));
2045
+ isNaN(t) || t < 1 || (C.value = t, E.value && D > 0 && (T.value = Math.round(t / D)));
2204
2046
  }
2205
2047
  function k(e) {
2206
2048
  let t = Number(e.target.value);
2207
- isNaN(t) || t < 1 || (w.value = t, E.value && D > 0 && (g.value = Math.round(t * D)));
2049
+ isNaN(t) || t < 1 || (T.value = t, E.value && D > 0 && (C.value = Math.round(t * D)));
2208
2050
  }
2209
2051
  function A() {
2210
2052
  c("close");
@@ -2239,11 +2081,11 @@ var ne = { install(e, t) {
2239
2081
  let a = e.state.tr.setNodeMarkup(s.pmPos, void 0, {
2240
2082
  ...t.attrs,
2241
2083
  alt: l.value,
2242
- width: g.value,
2243
- height: w.value,
2084
+ width: C.value,
2085
+ height: T.value,
2244
2086
  borderWidth: d.value || void 0,
2245
- borderStyle: d.value > 0 ? f.value : void 0,
2246
- borderColor: d.value > 0 ? m.value : void 0,
2087
+ borderStyle: d.value > 0 ? p.value : void 0,
2088
+ borderColor: d.value > 0 ? h.value : void 0,
2247
2089
  displayMode: n,
2248
2090
  cssFloat: r,
2249
2091
  wrapType: i
@@ -2253,40 +2095,40 @@ var ne = { install(e, t) {
2253
2095
  A();
2254
2096
  }
2255
2097
  }
2256
- return (t, s) => e.isOpen ? (p(), i("div", {
2098
+ return (t, s) => e.isOpen ? (f(), i("div", {
2257
2099
  key: 0,
2258
2100
  class: "dialog-overlay",
2259
- onMousedown: T(A, ["self"])
2101
+ onMousedown: w(A, ["self"])
2260
2102
  }, [a("div", {
2261
2103
  class: "dialog",
2262
- onMousedown: s[6] ||= T(() => {}, ["stop"]),
2263
- onKeydown: s[7] ||= T(() => {}, ["stop"])
2264
- }, [a("div", xt, [a("span", St, _(v(n)("dialogs.imageProperties.title")), 1), a("button", {
2104
+ onMousedown: s[6] ||= w(() => {}, ["stop"]),
2105
+ onKeydown: s[7] ||= w(() => {}, ["stop"])
2106
+ }, [a("div", rt, [a("span", it, g(_(n)("dialogs.imageProperties.title")), 1), a("button", {
2265
2107
  class: "dialog__close",
2266
- "aria-label": v(n)("common.closeDialog"),
2108
+ "aria-label": _(n)("common.closeDialog"),
2267
2109
  onClick: A
2268
- }, " ✕ ", 8, Ct)]), a("div", wt, [
2269
- a("div", Tt, [a("label", Et, _(v(n)("dialogs.imageProperties.altText")), 1), C(a("textarea", {
2110
+ }, " ✕ ", 8, at)]), a("div", ot, [
2111
+ a("div", st, [a("label", ct, g(_(n)("dialogs.imageProperties.altText")), 1), S(a("textarea", {
2270
2112
  "onUpdate:modelValue": s[0] ||= (e) => l.value = e,
2271
2113
  class: "field__textarea",
2272
- placeholder: v(n)("dialogs.imageProperties.altTextPlaceholder"),
2114
+ placeholder: _(n)("dialogs.imageProperties.altTextPlaceholder"),
2273
2115
  rows: "2"
2274
- }, null, 8, Dt), [[x, l.value]])]),
2275
- a("div", Ot, [a("label", kt, _(v(n)("dialogs.imageProperties.textWrapping")), 1), C(a("select", {
2116
+ }, null, 8, lt), [[b, l.value]])]),
2117
+ a("div", ut, [a("label", dt, g(_(n)("dialogs.imageProperties.textWrapping")), 1), S(a("select", {
2276
2118
  "onUpdate:modelValue": s[1] ||= (e) => u.value = e,
2277
2119
  class: "field__select"
2278
2120
  }, [
2279
- a("option", At, _(v(n)("dialogs.imageProperties.wrapOptions.inline")), 1),
2280
- a("option", jt, _(v(n)("dialogs.imageProperties.wrapOptions.wrapRight")), 1),
2281
- a("option", Mt, _(v(n)("dialogs.imageProperties.wrapOptions.wrapLeft")), 1),
2282
- a("option", Nt, _(v(n)("dialogs.imageProperties.wrapOptions.topAndBottom")), 1),
2283
- a("option", Pt, _(v(n)("dialogs.imageProperties.wrapOptions.behind")), 1),
2284
- a("option", Ft, _(v(n)("dialogs.imageProperties.wrapOptions.inFront")), 1)
2285
- ], 512), [[b, u.value]])]),
2286
- a("div", It, [a("label", Lt, _(v(n)("dialogs.imageProperties.border")), 1), a("div", Rt, [
2121
+ a("option", ft, g(_(n)("dialogs.imageProperties.wrapOptions.inline")), 1),
2122
+ a("option", pt, g(_(n)("dialogs.imageProperties.wrapOptions.wrapRight")), 1),
2123
+ a("option", mt, g(_(n)("dialogs.imageProperties.wrapOptions.wrapLeft")), 1),
2124
+ a("option", ht, g(_(n)("dialogs.imageProperties.wrapOptions.topAndBottom")), 1),
2125
+ a("option", gt, g(_(n)("dialogs.imageProperties.wrapOptions.behind")), 1),
2126
+ a("option", _t, g(_(n)("dialogs.imageProperties.wrapOptions.inFront")), 1)
2127
+ ], 512), [[y, u.value]])]),
2128
+ a("div", vt, [a("label", yt, g(_(n)("dialogs.imageProperties.border")), 1), a("div", bt, [
2287
2129
  a("label", null, [
2288
- o(_(v(n)("dialogs.imageProperties.width")) + ": ", 1),
2289
- C(a("input", {
2130
+ o(g(_(n)("dialogs.imageProperties.width")) + ": ", 1),
2131
+ S(a("input", {
2290
2132
  "onUpdate:modelValue": s[2] ||= (e) => d.value = e,
2291
2133
  type: "number",
2292
2134
  min: "0",
@@ -2294,71 +2136,71 @@ var ne = { install(e, t) {
2294
2136
  step: "0.5",
2295
2137
  class: "field__input--small"
2296
2138
  }, null, 512), [[
2297
- x,
2139
+ b,
2298
2140
  d.value,
2299
2141
  void 0,
2300
2142
  { number: !0 }
2301
2143
  ]]),
2302
- o(_(v(n)("common.px")), 1)
2144
+ o(g(_(n)("common.px")), 1)
2303
2145
  ]),
2304
- a("label", null, [o(_(v(n)("dialogs.imageProperties.style")) + ": ", 1), C(a("select", {
2305
- "onUpdate:modelValue": s[3] ||= (e) => f.value = e,
2146
+ a("label", null, [o(g(_(n)("dialogs.imageProperties.style")) + ": ", 1), S(a("select", {
2147
+ "onUpdate:modelValue": s[3] ||= (e) => p.value = e,
2306
2148
  class: "field__select--small"
2307
2149
  }, [
2308
- a("option", zt, _(v(n)("dialogs.imageProperties.borderStyles.solid")), 1),
2309
- a("option", Bt, _(v(n)("dialogs.imageProperties.borderStyles.dashed")), 1),
2310
- a("option", Vt, _(v(n)("dialogs.imageProperties.borderStyles.dotted")), 1),
2311
- a("option", Ht, _(v(n)("dialogs.imageProperties.borderStyles.double")), 1)
2312
- ], 512), [[b, f.value]])]),
2313
- a("label", null, [o(_(v(n)("dialogs.imageProperties.color")) + ": ", 1), C(a("input", {
2314
- "onUpdate:modelValue": s[4] ||= (e) => m.value = e,
2150
+ a("option", xt, g(_(n)("dialogs.imageProperties.borderStyles.solid")), 1),
2151
+ a("option", St, g(_(n)("dialogs.imageProperties.borderStyles.dashed")), 1),
2152
+ a("option", Ct, g(_(n)("dialogs.imageProperties.borderStyles.dotted")), 1),
2153
+ a("option", wt, g(_(n)("dialogs.imageProperties.borderStyles.double")), 1)
2154
+ ], 512), [[y, p.value]])]),
2155
+ a("label", null, [o(g(_(n)("dialogs.imageProperties.color")) + ": ", 1), S(a("input", {
2156
+ "onUpdate:modelValue": s[4] ||= (e) => h.value = e,
2315
2157
  type: "color",
2316
2158
  class: "field__color"
2317
- }, null, 512), [[x, m.value]])])
2159
+ }, null, 512), [[b, h.value]])])
2318
2160
  ])]),
2319
- a("div", Ut, [
2320
- a("label", Wt, _(v(n)("dialogs.imageProperties.dimensions")), 1),
2321
- a("div", Gt, [a("label", null, [
2322
- o(_(v(n)("dialogs.imageProperties.widthLabel")) + " ", 1),
2161
+ a("div", Tt, [
2162
+ a("label", Et, g(_(n)("dialogs.imageProperties.dimensions")), 1),
2163
+ a("div", Dt, [a("label", null, [
2164
+ o(g(_(n)("dialogs.imageProperties.widthLabel")) + " ", 1),
2323
2165
  a("input", {
2324
- value: g.value,
2166
+ value: C.value,
2325
2167
  type: "number",
2326
2168
  min: "1",
2327
2169
  max: "2000",
2328
2170
  class: "field__input--small",
2329
2171
  onInput: O
2330
- }, null, 40, Kt),
2331
- o(_(v(n)("common.px")), 1)
2172
+ }, null, 40, Ot),
2173
+ o(g(_(n)("common.px")), 1)
2332
2174
  ]), a("label", null, [
2333
- o(_(v(n)("dialogs.imageProperties.heightLabel")) + " ", 1),
2175
+ o(g(_(n)("dialogs.imageProperties.heightLabel")) + " ", 1),
2334
2176
  a("input", {
2335
- value: w.value,
2177
+ value: T.value,
2336
2178
  type: "number",
2337
2179
  min: "1",
2338
2180
  max: "2000",
2339
2181
  class: "field__input--small",
2340
2182
  onInput: k
2341
- }, null, 40, qt),
2342
- o(_(v(n)("common.px")), 1)
2183
+ }, null, 40, kt),
2184
+ o(g(_(n)("common.px")), 1)
2343
2185
  ])]),
2344
- a("label", Jt, [C(a("input", {
2186
+ a("label", At, [S(a("input", {
2345
2187
  "onUpdate:modelValue": s[5] ||= (e) => E.value = e,
2346
2188
  type: "checkbox"
2347
- }, null, 512), [[y, E.value]]), o(" " + _(v(n)("dialogs.imageProperties.lockAspectRatio")), 1)])
2189
+ }, null, 512), [[v, E.value]]), o(" " + g(_(n)("dialogs.imageProperties.lockAspectRatio")), 1)])
2348
2190
  ]),
2349
- a("div", Yt, [a("button", {
2191
+ a("div", jt, [a("button", {
2350
2192
  class: "dialog__btn",
2351
2193
  onClick: A
2352
- }, _(v(n)("common.cancel")), 1), a("button", {
2194
+ }, g(_(n)("common.cancel")), 1), a("button", {
2353
2195
  class: "dialog__btn dialog__btn--primary",
2354
- onMousedown: T(j, ["prevent"])
2355
- }, _(v(n)("common.apply")), 33)])
2196
+ onMousedown: w(j, ["prevent"])
2197
+ }, g(_(n)("common.apply")), 33)])
2356
2198
  ])], 32)], 32)) : r("", !0);
2357
2199
  }
2358
- }), [["__scopeId", "data-v-2bc21138"]]), Zt = ["aria-label"], Qt = { class: "ps-header" }, $t = { class: "ps-body" }, en = { class: "ps-section-label" }, tn = { class: "ps-row" }, nn = { class: "ps-label" }, rn = ["value"], an = ["value"], on = {
2200
+ }), [["__scopeId", "data-v-2bc21138"]]), Nt = ["aria-label"], Pt = { class: "ps-header" }, Ft = { class: "ps-body" }, It = { class: "ps-section-label" }, Lt = { class: "ps-row" }, Rt = { class: "ps-label" }, zt = ["value"], Bt = ["value"], Vt = {
2359
2201
  key: 0,
2360
2202
  value: -1
2361
- }, sn = { class: "ps-row" }, cn = { class: "ps-label" }, ln = ["value"], un = { value: "portrait" }, dn = { value: "landscape" }, fn = { class: "ps-section-label ps-section-label--spaced" }, pn = { class: "ps-row" }, mn = { class: "ps-label" }, hn = { class: "ps-row" }, gn = { class: "ps-label" }, _n = { class: "ps-row" }, vn = { class: "ps-label" }, yn = { class: "ps-row" }, bn = { class: "ps-label" }, xn = { class: "ps-footer" }, X = 12240, Z = 15840, Q = 1440, Sn = /* @__PURE__ */ e(/* @__PURE__ */ c({
2203
+ }, Ht = { class: "ps-row" }, Ut = { class: "ps-label" }, Wt = ["value"], Gt = { value: "portrait" }, Kt = { value: "landscape" }, qt = { class: "ps-section-label ps-section-label--spaced" }, Jt = { class: "ps-row" }, Yt = { class: "ps-label" }, Xt = { class: "ps-row" }, Zt = { class: "ps-label" }, Qt = { class: "ps-row" }, $t = { class: "ps-label" }, en = { class: "ps-row" }, tn = { class: "ps-label" }, nn = { class: "ps-footer" }, X = 12240, Z = 15840, Q = 1440, rn = /* @__PURE__ */ e(/* @__PURE__ */ s({
2362
2204
  __name: "PageSetupDialog",
2363
2205
  props: {
2364
2206
  isOpen: { type: Boolean },
@@ -2366,7 +2208,7 @@ var ne = { install(e, t) {
2366
2208
  },
2367
2209
  emits: ["close", "apply"],
2368
2210
  setup(e, { emit: o }) {
2369
- let { t: s } = H(), c = [
2211
+ let { t: s } = V(), c = [
2370
2212
  {
2371
2213
  labelKey: "dialogs.pageSetup.pageSizes.letter",
2372
2214
  width: 12240,
@@ -2402,34 +2244,34 @@ var ne = { install(e, t) {
2402
2244
  width: 10440,
2403
2245
  height: 15120
2404
2246
  }
2405
- ], l = e, u = o, d = h(X), f = h(Z), m = h("portrait"), y = h(1), b = h(1), w = h(1), E = h(1);
2247
+ ], l = e, u = o, d = m(X), p = m(Z), v = m("portrait"), y = m(1), C = m(1), T = m(1), D = m(1);
2406
2248
  function O(e) {
2407
- return Math.round(e / D * 100) / 100;
2249
+ return Math.round(e / E * 100) / 100;
2408
2250
  }
2409
2251
  function k(e) {
2410
- return Math.round((Number(e) || 0) * D);
2252
+ return Math.round((Number(e) || 0) * E);
2411
2253
  }
2412
2254
  let A = n(() => {
2413
- let e = Math.min(d.value, f.value), t = Math.max(d.value, f.value);
2255
+ let e = Math.min(d.value, p.value), t = Math.max(d.value, p.value);
2414
2256
  return c.findIndex((n) => Math.abs(n.width - e) < 20 && Math.abs(n.height - t) < 20);
2415
2257
  });
2416
- S(() => l.isOpen, (e) => {
2258
+ x(() => l.isOpen, (e) => {
2417
2259
  if (!e) return;
2418
2260
  let t = l.sectionProperties, n = t?.pageWidth || X, r = t?.pageHeight || Z;
2419
- d.value = n, f.value = r, m.value = t?.orientation || (n > r ? "landscape" : "portrait"), y.value = O(t?.marginTop ?? Q), b.value = O(t?.marginBottom ?? Q), w.value = O(t?.marginLeft ?? Q), E.value = O(t?.marginRight ?? Q);
2261
+ d.value = n, p.value = r, v.value = t?.orientation || (n > r ? "landscape" : "portrait"), y.value = O(t?.marginTop ?? Q), C.value = O(t?.marginBottom ?? Q), T.value = O(t?.marginLeft ?? Q), D.value = O(t?.marginRight ?? Q);
2420
2262
  }, { immediate: !0 });
2421
2263
  function j(e) {
2422
2264
  let t = Number(e.target.value);
2423
2265
  if (t < 0) return;
2424
2266
  let n = c[t];
2425
- m.value === "landscape" ? (d.value = n.height, f.value = n.width) : (d.value = n.width, f.value = n.height);
2267
+ v.value === "landscape" ? (d.value = n.height, p.value = n.width) : (d.value = n.width, p.value = n.height);
2426
2268
  }
2427
2269
  function M(e) {
2428
2270
  let t = e.target.value;
2429
- if (t === m.value) return;
2430
- m.value = t;
2271
+ if (t === v.value) return;
2272
+ v.value = t;
2431
2273
  let n = d.value;
2432
- d.value = f.value, f.value = n;
2274
+ d.value = p.value, p.value = n;
2433
2275
  }
2434
2276
  function N() {
2435
2277
  u("close");
@@ -2437,48 +2279,48 @@ var ne = { install(e, t) {
2437
2279
  function P() {
2438
2280
  u("apply", {
2439
2281
  pageWidth: d.value,
2440
- pageHeight: f.value,
2441
- orientation: m.value,
2282
+ pageHeight: p.value,
2283
+ orientation: v.value,
2442
2284
  marginTop: k(y.value),
2443
- marginBottom: k(b.value),
2444
- marginLeft: k(w.value),
2445
- marginRight: k(E.value)
2285
+ marginBottom: k(C.value),
2286
+ marginLeft: k(T.value),
2287
+ marginRight: k(D.value)
2446
2288
  }), N();
2447
2289
  }
2448
2290
  function F(e) {
2449
2291
  e.key === "Escape" && N(), e.key === "Enter" && P();
2450
2292
  }
2451
- return (n, o) => e.isOpen ? (p(), i("div", {
2293
+ return (n, o) => e.isOpen ? (f(), i("div", {
2452
2294
  key: 0,
2453
2295
  class: "ps-overlay",
2454
- onMousedown: T(N, ["self"]),
2296
+ onMousedown: w(N, ["self"]),
2455
2297
  onKeydown: F
2456
2298
  }, [a("div", {
2457
2299
  class: "ps-dialog",
2458
2300
  role: "dialog",
2459
- "aria-label": v(s)("dialogs.pageSetup.title"),
2460
- onMousedown: o[4] ||= T(() => {}, ["stop"])
2301
+ "aria-label": _(s)("dialogs.pageSetup.title"),
2302
+ onMousedown: o[4] ||= w(() => {}, ["stop"])
2461
2303
  }, [
2462
- a("div", Qt, _(v(s)("dialogs.pageSetup.title")), 1),
2463
- a("div", $t, [
2464
- a("div", en, _(v(s)("dialogs.pageSetup.pageSize")), 1),
2465
- a("div", tn, [a("label", nn, _(v(s)("dialogs.pageSetup.sizeLabel")), 1), a("select", {
2304
+ a("div", Pt, g(_(s)("dialogs.pageSetup.title")), 1),
2305
+ a("div", Ft, [
2306
+ a("div", It, g(_(s)("dialogs.pageSetup.pageSize")), 1),
2307
+ a("div", Lt, [a("label", Rt, g(_(s)("dialogs.pageSetup.sizeLabel")), 1), a("select", {
2466
2308
  class: "ps-input",
2467
2309
  value: A.value,
2468
2310
  onChange: j
2469
- }, [(p(), i(t, null, g(c, (e, t) => a("option", {
2311
+ }, [(f(), i(t, null, h(c, (e, t) => a("option", {
2470
2312
  key: e.labelKey,
2471
2313
  value: t
2472
- }, _(v(s)(e.labelKey)), 9, an)), 64)), A.value < 0 ? (p(), i("option", on, _(v(s)("dialogs.pageSetup.custom")), 1)) : r("", !0)], 40, rn)]),
2473
- a("div", sn, [a("label", cn, _(v(s)("dialogs.pageSetup.orientation")), 1), a("select", {
2314
+ }, g(_(s)(e.labelKey)), 9, Bt)), 64)), A.value < 0 ? (f(), i("option", Vt, g(_(s)("dialogs.pageSetup.custom")), 1)) : r("", !0)], 40, zt)]),
2315
+ a("div", Ht, [a("label", Ut, g(_(s)("dialogs.pageSetup.orientation")), 1), a("select", {
2474
2316
  class: "ps-input",
2475
- value: m.value,
2317
+ value: v.value,
2476
2318
  onChange: M
2477
- }, [a("option", un, _(v(s)("dialogs.pageSetup.portrait")), 1), a("option", dn, _(v(s)("dialogs.pageSetup.landscape")), 1)], 40, ln)]),
2478
- a("div", fn, _(v(s)("dialogs.pageSetup.margins")), 1),
2479
- a("div", pn, [
2480
- a("label", mn, _(v(s)("dialogs.pageSetup.top")), 1),
2481
- C(a("input", {
2319
+ }, [a("option", Gt, g(_(s)("dialogs.pageSetup.portrait")), 1), a("option", Kt, g(_(s)("dialogs.pageSetup.landscape")), 1)], 40, Wt)]),
2320
+ a("div", qt, g(_(s)("dialogs.pageSetup.margins")), 1),
2321
+ a("div", Jt, [
2322
+ a("label", Yt, g(_(s)("dialogs.pageSetup.top")), 1),
2323
+ S(a("input", {
2482
2324
  class: "ps-input",
2483
2325
  type: "number",
2484
2326
  min: "0",
@@ -2486,86 +2328,86 @@ var ne = { install(e, t) {
2486
2328
  step: "0.1",
2487
2329
  "onUpdate:modelValue": o[0] ||= (e) => y.value = e
2488
2330
  }, null, 512), [[
2489
- x,
2331
+ b,
2490
2332
  y.value,
2491
2333
  void 0,
2492
2334
  { number: !0 }
2493
2335
  ]]),
2494
2336
  o[5] ||= a("span", { class: "ps-unit" }, "in", -1)
2495
2337
  ]),
2496
- a("div", hn, [
2497
- a("label", gn, _(v(s)("dialogs.pageSetup.bottom")), 1),
2498
- C(a("input", {
2338
+ a("div", Xt, [
2339
+ a("label", Zt, g(_(s)("dialogs.pageSetup.bottom")), 1),
2340
+ S(a("input", {
2499
2341
  class: "ps-input",
2500
2342
  type: "number",
2501
2343
  min: "0",
2502
2344
  max: "10",
2503
2345
  step: "0.1",
2504
- "onUpdate:modelValue": o[1] ||= (e) => b.value = e
2346
+ "onUpdate:modelValue": o[1] ||= (e) => C.value = e
2505
2347
  }, null, 512), [[
2506
- x,
2507
- b.value,
2348
+ b,
2349
+ C.value,
2508
2350
  void 0,
2509
2351
  { number: !0 }
2510
2352
  ]]),
2511
2353
  o[6] ||= a("span", { class: "ps-unit" }, "in", -1)
2512
2354
  ]),
2513
- a("div", _n, [
2514
- a("label", vn, _(v(s)("dialogs.pageSetup.left")), 1),
2515
- C(a("input", {
2355
+ a("div", Qt, [
2356
+ a("label", $t, g(_(s)("dialogs.pageSetup.left")), 1),
2357
+ S(a("input", {
2516
2358
  class: "ps-input",
2517
2359
  type: "number",
2518
2360
  min: "0",
2519
2361
  max: "10",
2520
2362
  step: "0.1",
2521
- "onUpdate:modelValue": o[2] ||= (e) => w.value = e
2363
+ "onUpdate:modelValue": o[2] ||= (e) => T.value = e
2522
2364
  }, null, 512), [[
2523
- x,
2524
- w.value,
2365
+ b,
2366
+ T.value,
2525
2367
  void 0,
2526
2368
  { number: !0 }
2527
2369
  ]]),
2528
2370
  o[7] ||= a("span", { class: "ps-unit" }, "in", -1)
2529
2371
  ]),
2530
- a("div", yn, [
2531
- a("label", bn, _(v(s)("dialogs.pageSetup.right")), 1),
2532
- C(a("input", {
2372
+ a("div", en, [
2373
+ a("label", tn, g(_(s)("dialogs.pageSetup.right")), 1),
2374
+ S(a("input", {
2533
2375
  class: "ps-input",
2534
2376
  type: "number",
2535
2377
  min: "0",
2536
2378
  max: "10",
2537
2379
  step: "0.1",
2538
- "onUpdate:modelValue": o[3] ||= (e) => E.value = e
2380
+ "onUpdate:modelValue": o[3] ||= (e) => D.value = e
2539
2381
  }, null, 512), [[
2540
- x,
2541
- E.value,
2382
+ b,
2383
+ D.value,
2542
2384
  void 0,
2543
2385
  { number: !0 }
2544
2386
  ]]),
2545
2387
  o[8] ||= a("span", { class: "ps-unit" }, "in", -1)
2546
2388
  ])
2547
2389
  ]),
2548
- a("div", xn, [a("button", {
2390
+ a("div", nn, [a("button", {
2549
2391
  type: "button",
2550
2392
  class: "ps-btn",
2551
2393
  onClick: N
2552
- }, _(v(s)("common.cancel")), 1), a("button", {
2394
+ }, g(_(s)("common.cancel")), 1), a("button", {
2553
2395
  type: "button",
2554
2396
  class: "ps-btn ps-btn--primary",
2555
2397
  onClick: P
2556
- }, _(v(s)("common.apply")), 1)])
2557
- ], 40, Zt)], 32)) : r("", !0);
2398
+ }, g(_(s)("common.apply")), 1)])
2399
+ ], 40, Nt)], 32)) : r("", !0);
2558
2400
  }
2559
- }), [["__scopeId", "data-v-bd508fe8"]]), Cn = { class: "kbd-dialog__header" }, wn = { class: "kbd-dialog__title" }, Tn = ["aria-label"], En = {
2401
+ }), [["__scopeId", "data-v-bd508fe8"]]), an = { class: "kbd-dialog__header" }, on = { class: "kbd-dialog__title" }, sn = ["aria-label"], $ = {
2560
2402
  key: 0,
2561
2403
  class: "kbd-dialog__search"
2562
- }, $ = ["placeholder"], Dn = { class: "kbd-dialog__body" }, On = { class: "kbd-category" }, kn = { class: "kbd-item__info" }, An = { class: "kbd-item__name" }, jn = { class: "kbd-item__desc" }, Mn = { class: "kbd-item__keys" }, Nn = { class: "kbd-badge" }, Pn = { class: "kbd-or" }, Fn = { class: "kbd-badge" }, In = {
2404
+ }, cn = ["placeholder"], ln = { class: "kbd-dialog__body" }, un = { class: "kbd-category" }, dn = { class: "kbd-item__info" }, fn = { class: "kbd-item__name" }, pn = { class: "kbd-item__desc" }, mn = { class: "kbd-item__keys" }, hn = { class: "kbd-badge" }, gn = { class: "kbd-or" }, _n = { class: "kbd-badge" }, vn = {
2563
2405
  key: 0,
2564
2406
  class: "kbd-dialog__empty"
2565
- }, Ln = { class: "kbd-dialog__footer" }, Rn = {
2407
+ }, yn = { class: "kbd-dialog__footer" }, bn = {
2566
2408
  key: 0,
2567
2409
  class: "kbd-badge kbd-badge--small"
2568
- }, zn = /* @__PURE__ */ e(/* @__PURE__ */ c({
2410
+ }, xn = /* @__PURE__ */ e(/* @__PURE__ */ s({
2569
2411
  __name: "KeyboardShortcutsDialog",
2570
2412
  props: {
2571
2413
  isOpen: { type: Boolean },
@@ -2576,17 +2418,17 @@ var ne = { install(e, t) {
2576
2418
  },
2577
2419
  emits: ["close"],
2578
2420
  setup(e, { emit: o }) {
2579
- let { t: s } = H(), c = e, l = o, d = h(null), f = h(""), m = typeof navigator < "u" && /Mac/.test(navigator.platform);
2421
+ let { t: s } = V(), c = e, u = o, d = m(null), p = m(""), v = typeof navigator < "u" && /Mac/.test(navigator.platform);
2580
2422
  function y(e) {
2581
- return m ? e.replace(/Ctrl/g, "⌘").replace(/Alt/g, "⌥").replace(/Shift/g, "⇧") : e;
2423
+ return v ? e.replace(/Ctrl/g, "⌘").replace(/Alt/g, "⌥").replace(/Shift/g, "⇧") : e;
2582
2424
  }
2583
- function b() {
2584
- f.value = "", l("close");
2425
+ function C() {
2426
+ p.value = "", u("close");
2585
2427
  }
2586
- S(() => c.isOpen, (e) => {
2587
- e && u(() => d.value?.focus());
2428
+ x(() => c.isOpen, (e) => {
2429
+ e && l(() => d.value?.focus());
2588
2430
  });
2589
- let w = n(() => s("dialogs.keyboardShortcuts.pressEscToClose", { key: "Esc" }).split("Esc")), E = [
2431
+ let T = n(() => s("dialogs.keyboardShortcuts.pressEscToClose", { key: "Esc" }).split("Esc")), E = [
2590
2432
  {
2591
2433
  id: "undo",
2592
2434
  nameKey: "dialogs.keyboardShortcuts.shortcuts.undo",
@@ -2903,7 +2745,7 @@ var ne = { install(e, t) {
2903
2745
  "Navigation",
2904
2746
  "View"
2905
2747
  ], k = n(() => {
2906
- let e = f.value.toLowerCase().trim(), t = [];
2748
+ let e = p.value.toLowerCase().trim(), t = [];
2907
2749
  for (let n of O) {
2908
2750
  let r = E.filter((e) => e.category === n);
2909
2751
  e && (r = r.filter((t) => {
@@ -2917,35 +2759,35 @@ var ne = { install(e, t) {
2917
2759
  }
2918
2760
  return t;
2919
2761
  });
2920
- return (n, o) => e.isOpen ? (p(), i("div", {
2762
+ return (n, o) => e.isOpen ? (f(), i("div", {
2921
2763
  key: 0,
2922
2764
  class: "kbd-overlay",
2923
- onMousedown: T(b, ["self"])
2765
+ onMousedown: w(C, ["self"])
2924
2766
  }, [a("div", {
2925
2767
  class: "kbd-dialog",
2926
- onMousedown: o[1] ||= T(() => {}, ["stop"]),
2927
- onKeydown: o[2] ||= T(() => {}, ["stop"])
2768
+ onMousedown: o[1] ||= w(() => {}, ["stop"]),
2769
+ onKeydown: o[2] ||= w(() => {}, ["stop"])
2928
2770
  }, [
2929
- a("div", Cn, [a("span", wn, _(v(s)("dialogs.keyboardShortcuts.ariaLabel")), 1), a("button", {
2771
+ a("div", an, [a("span", on, g(_(s)("dialogs.keyboardShortcuts.ariaLabel")), 1), a("button", {
2930
2772
  class: "kbd-dialog__close",
2931
- "aria-label": v(s)("common.closeDialog"),
2932
- onClick: b
2933
- }, " ✕ ", 8, Tn)]),
2934
- e.showSearch ? (p(), i("div", En, [C(a("input", {
2773
+ "aria-label": _(s)("common.closeDialog"),
2774
+ onClick: C
2775
+ }, " ✕ ", 8, sn)]),
2776
+ e.showSearch ? (f(), i("div", $, [S(a("input", {
2935
2777
  ref_key: "searchInput",
2936
2778
  ref: d,
2937
- "onUpdate:modelValue": o[0] ||= (e) => f.value = e,
2779
+ "onUpdate:modelValue": o[0] ||= (e) => p.value = e,
2938
2780
  class: "kbd-dialog__search-input",
2939
- placeholder: v(s)("dialogs.keyboardShortcuts.searchPlaceholder"),
2781
+ placeholder: _(s)("dialogs.keyboardShortcuts.searchPlaceholder"),
2940
2782
  type: "text"
2941
- }, null, 8, $), [[x, f.value]])])) : r("", !0),
2942
- a("div", Dn, [(p(!0), i(t, null, g(k.value, (e) => (p(), i(t, { key: e.name }, [a("div", On, _(v(s)(e.labelKey).toUpperCase()), 1), (p(!0), i(t, null, g(e.shortcuts, (e) => (p(), i("div", {
2783
+ }, null, 8, cn), [[b, p.value]])])) : r("", !0),
2784
+ a("div", ln, [(f(!0), i(t, null, h(k.value, (e) => (f(), i(t, { key: e.name }, [a("div", un, g(_(s)(e.labelKey).toUpperCase()), 1), (f(!0), i(t, null, h(e.shortcuts, (e) => (f(), i("div", {
2943
2785
  key: e.id,
2944
2786
  class: "kbd-item"
2945
- }, [a("div", kn, [a("span", An, _(e.nameKey ? v(s)(e.nameKey) : e.name), 1), a("span", jn, _(e.descriptionKey ? v(s)(e.descriptionKey) : e.description), 1)]), a("div", Mn, [a("kbd", Nn, _(y(e.keys)), 1), e.altKeys ? (p(), i(t, { key: 0 }, [a("span", Pn, _(v(s)("dialogs.keyboardShortcuts.or")), 1), a("kbd", Fn, _(y(e.altKeys)), 1)], 64)) : r("", !0)])]))), 128))], 64))), 128)), k.value.length === 0 ? (p(), i("div", In, _(v(s)("dialogs.keyboardShortcuts.noResults", { query: f.value })), 1)) : r("", !0)]),
2946
- a("div", Ln, [(p(!0), i(t, null, g(w.value, (e, n) => (p(), i(t, { key: n }, [a("span", null, _(e), 1), n < w.value.length - 1 ? (p(), i("kbd", Rn, "Esc")) : r("", !0)], 64))), 128))])
2787
+ }, [a("div", dn, [a("span", fn, g(e.nameKey ? _(s)(e.nameKey) : e.name), 1), a("span", pn, g(e.descriptionKey ? _(s)(e.descriptionKey) : e.description), 1)]), a("div", mn, [a("kbd", hn, g(y(e.keys)), 1), e.altKeys ? (f(), i(t, { key: 0 }, [a("span", gn, g(_(s)("dialogs.keyboardShortcuts.or")), 1), a("kbd", _n, g(y(e.altKeys)), 1)], 64)) : r("", !0)])]))), 128))], 64))), 128)), k.value.length === 0 ? (f(), i("div", vn, g(_(s)("dialogs.keyboardShortcuts.noResults", { query: p.value })), 1)) : r("", !0)]),
2788
+ a("div", yn, [(f(!0), i(t, null, h(T.value, (e, n) => (f(), i(t, { key: n }, [a("span", null, g(e), 1), n < T.value.length - 1 ? (f(), i("kbd", bn, "Esc")) : r("", !0)], 64))), 128))])
2947
2789
  ], 32)], 32)) : r("", !0);
2948
2790
  }
2949
2791
  }), [["__scopeId", "data-v-77199050"]]);
2950
2792
  //#endregion
2951
- export { tt as a, te as c, H as d, M as f, bt as i, ne as l, Sn as n, Oe as o, j as p, Xt as r, de as s, zn as t, ee as u };
2793
+ export { Le as a, ne as c, j as d, A as f, nt as i, ee as l, rn as n, ue as o, Mt as r, te as s, xn as t, V as u };