@opengis/form 0.0.131 → 0.0.133

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,6 +1,6 @@
1
- import { shallowRef as Je, ref as $, computed as P, watch as ue, markRaw as et, nextTick as be, getCurrentInstance as tt, resolveComponent as G, openBlock as g, createElementBlock as w, normalizeClass as T, createVNode as C, createElementVNode as d, unref as k, createBlock as K, Teleport as Oe, Transition as Re, withCtx as V, toDisplayString as W, renderSlot as he, createCommentVNode as R, defineComponent as rt, withDirectives as ie, mergeProps as ot, vModelDynamic as lt, Fragment as re, vModelCheckbox as at, onMounted as fe, onBeforeUnmount as Ue, normalizeStyle as ae, vShow as ye, renderList as le, onUnmounted as ke, resolveDynamicComponent as Fe, vModelText as st, withModifiers as nt, createStaticVNode as it, useModel as ct, isRef as dt, mergeModels as Pe } from "vue";
2
- import { r as Me, _ as X, a as ut, b as ft } from "./index-Bb7h6b7d.js";
3
- import { Quote as pt, List as gt, ListOrdered as ht, CodeXml as vt, Bold as mt, Italic as bt, Underline as yt, Strikethrough as xt, X as Te, Mail as wt, Search as kt, Link2 as _t, ExternalLink as $t, Trash2 as Ct, Table2 as At, AlignJustify as Ft, AlignRight as St, AlignCenter as Tt, AlignLeft as Lt, Type as Bt, Check as ve, Eraser as It, PaintBucket as Et, Highlighter as jt, ChevronDown as Le, ALargeSmall as Pt, Superscript as Mt, Subscript as Ht, RemoveFormatting as zt, Image as Nt, Undo2 as Vt, Redo2 as Dt, CircleHelp as Ot, Minus as Rt, Maximize as Ut, ListIndentIncrease as qt } from "lucide-vue-next";
1
+ import { shallowRef as Je, ref as $, computed as P, watch as ue, markRaw as et, nextTick as be, getCurrentInstance as tt, resolveComponent as G, openBlock as v, createElementBlock as w, normalizeClass as T, createVNode as C, createElementVNode as d, unref as k, createBlock as K, Teleport as Ve, Transition as Re, withCtx as D, toDisplayString as W, renderSlot as he, createCommentVNode as R, defineComponent as rt, withDirectives as ie, mergeProps as ot, vModelDynamic as lt, Fragment as re, vModelCheckbox as at, onMounted as fe, onBeforeUnmount as Ue, normalizeStyle as ae, vShow as ye, renderList as le, onUnmounted as ke, resolveDynamicComponent as Fe, vModelText as st, withModifiers as nt, createStaticVNode as it, useModel as ct, isRef as dt, mergeModels as Pe } from "vue";
2
+ import { r as Me, _ as X, a as ut, b as ft } from "./index-BHNP0KBm.js";
3
+ import { Quote as pt, List as gt, ListOrdered as ht, CodeXml as vt, Bold as mt, Italic as bt, Underline as yt, Strikethrough as xt, X as Te, Mail as wt, Search as kt, Link2 as _t, ExternalLink as $t, Trash2 as Ct, Table2 as At, AlignJustify as Ft, AlignRight as St, AlignCenter as Tt, AlignLeft as Lt, Type as Bt, Check as ve, Eraser as It, PaintBucket as Et, Highlighter as jt, ChevronDown as Le, ALargeSmall as Pt, Superscript as Mt, Subscript as Ht, RemoveFormatting as Nt, Image as zt, Undo2 as Dt, Redo2 as Ot, CircleHelp as Vt, Minus as Rt, Maximize as Ut, ListIndentIncrease as qt } from "lucide-vue-next";
4
4
  import { notify as we } from "@opengis/core";
5
5
  const Kt = async (t) => {
6
6
  try {
@@ -17,7 +17,7 @@ const Kt = async (t) => {
17
17
  if (s) {
18
18
  const a = e.clipboardData?.getData("text/html"), o = e.clipboardData?.getData("text/plain");
19
19
  if (a) {
20
- const { state: n, dispatch: c } = t, { tr: r } = n, i = l.fromSchema(t.state.schema), y = new DOMParser().parseFromString(a, "text/html").body, p = i.parse(y), h = r.replaceSelectionWith(p);
20
+ const { state: n, dispatch: c } = t, { tr: r } = n, i = l.fromSchema(t.state.schema), b = new DOMParser().parseFromString(a, "text/html").body, u = i.parse(b), h = r.replaceSelectionWith(u);
21
21
  return c(h), e.preventDefault(), !0;
22
22
  }
23
23
  if (o) {
@@ -29,9 +29,9 @@ const Kt = async (t) => {
29
29
  if (c.type.startsWith("image/")) {
30
30
  const r = c.getAsFile();
31
31
  if (r) {
32
- const i = await Kt(r), { schema: y } = t.state, p = y.nodes.image.create({
32
+ const i = await Kt(r), { schema: b } = t.state, u = b.nodes.image.create({
33
33
  src: i?.file_path
34
- }), h = t.state.tr.replaceSelectionWith(p);
34
+ }), h = t.state.tr.replaceSelectionWith(u);
35
35
  return t.dispatch(h), e.preventDefault(), !0;
36
36
  }
37
37
  }
@@ -226,29 +226,29 @@ async function tr() {
226
226
  c,
227
227
  r,
228
228
  i,
229
- y,
230
- p,
229
+ b,
230
+ u,
231
231
  h,
232
- b
232
+ g
233
233
  ]) => {
234
- const S = U(e, "Editor"), j = U(e, "Node"), H = U(e, "Extension"), N = U(l, "StarterKit"), q = U(s, "TextStyle"), L = U(a, "TableKit"), Y = U(a, "Table"), oe = U(a, "TableRow"), se = U(a, "TableCell"), D = U(a, "TableHeader"), f = U(o, "Highlight"), m = U(n, "Subscript"), u = U(c, "Superscript"), _ = U(r, "Link"), x = U(i, "Image"), B = U(y, "TextAlign"), v = U(p, "Heading"), A = U(h, "Paragraph"), I = U(b, "DOMParser");
235
- if (!S || !j || !N || !q || !L || !Y || !oe || !se || !D || !f || !m || !u || !_ || !x || !B || !v || !A || !I)
234
+ const S = U(e, "Editor"), j = U(e, "Node"), H = U(e, "Extension"), z = U(l, "StarterKit"), q = U(s, "TextStyle"), L = U(a, "TableKit"), Y = U(a, "Table"), oe = U(a, "TableRow"), se = U(a, "TableCell"), O = U(a, "TableHeader"), p = U(o, "Highlight"), y = U(n, "Subscript"), f = U(c, "Superscript"), _ = U(r, "Link"), x = U(i, "Image"), B = U(b, "TextAlign"), m = U(u, "Heading"), A = U(h, "Paragraph"), I = U(g, "DOMParser");
235
+ if (!S || !j || !z || !q || !L || !Y || !oe || !se || !O || !p || !y || !f || !_ || !x || !B || !m || !A || !I)
236
236
  throw new Error("Failed to resolve one or more Tiptap modules");
237
237
  return {
238
238
  Editor: S,
239
239
  Extension: H,
240
240
  ProseMirrorDOMParser: I,
241
- StarterKit: N,
241
+ StarterKit: z,
242
242
  ExtendedTextStyle: Jt(q),
243
- Highlight: f,
244
- Subscript: m,
245
- Superscript: u,
243
+ Highlight: p,
244
+ Subscript: y,
245
+ Superscript: f,
246
246
  Link: _,
247
247
  Image: x,
248
248
  TextAlign: B,
249
- CustomHeading: Yt(v),
249
+ CustomHeading: Yt(m),
250
250
  CustomParagraph: Qt(A),
251
- CustomTableKit: Zt(L, Y, oe, se, D),
251
+ CustomTableKit: Zt(L, Y, oe, se, O),
252
252
  Iframe: er(j)
253
253
  };
254
254
  }).catch((e) => {
@@ -257,17 +257,17 @@ async function tr() {
257
257
  }
258
258
  function rr(t) {
259
259
  let e = !1;
260
- const l = Je(null), s = $(!1), a = $(""), o = async (i, y = "") => {
260
+ const l = Je(null), s = $(!1), a = $(""), o = async (i, b = "") => {
261
261
  if (!i) return null;
262
262
  s.value = !0, a.value = "";
263
263
  try {
264
- const p = await tr();
265
- if (!p) return null;
266
- const h = new p.Editor({
264
+ const u = await tr();
265
+ if (!u) return null;
266
+ const h = new u.Editor({
267
267
  element: i,
268
- content: y,
268
+ content: b,
269
269
  extensions: [
270
- p.StarterKit.configure({
270
+ u.StarterKit.configure({
271
271
  history: {
272
272
  depth: 100,
273
273
  newGroupDelay: 500
@@ -286,63 +286,63 @@ function rr(t) {
286
286
  heading: !1,
287
287
  link: !1
288
288
  }),
289
- p.Superscript,
290
- p.Subscript,
291
- p.ExtendedTextStyle,
292
- p.CustomParagraph,
293
- p.CustomHeading,
294
- p.Highlight,
295
- p.Image.configure({
289
+ u.Superscript,
290
+ u.Subscript,
291
+ u.ExtendedTextStyle,
292
+ u.CustomParagraph,
293
+ u.CustomHeading,
294
+ u.Highlight,
295
+ u.Image.configure({
296
296
  inline: !0,
297
297
  allowBase64: !0,
298
298
  HTMLAttributes: {
299
299
  class: "editor-image"
300
300
  }
301
301
  }),
302
- p.TextAlign.configure({
302
+ u.TextAlign.configure({
303
303
  types: ["heading", "paragraph"]
304
304
  }),
305
- p.Link.configure({
305
+ u.Link.configure({
306
306
  HTMLAttributes: {
307
307
  class: "editor-link"
308
308
  },
309
309
  openOnClick: !1,
310
310
  autolink: !0
311
311
  }),
312
- p.CustomTableKit,
313
- p.Iframe
312
+ u.CustomTableKit,
313
+ u.Iframe
314
314
  ],
315
315
  editorProps: {
316
- handlePaste: (b, S) => Wt(b, S, p.ProseMirrorDOMParser),
317
- handleKeyDown: (b, S) => {
316
+ handlePaste: (g, S) => Wt(g, S, u.ProseMirrorDOMParser),
317
+ handleKeyDown: (g, S) => {
318
318
  if (S.key === "Tab") {
319
- const j = b.state, { $anchor: H } = j.selection;
320
- let N = !1;
319
+ const j = g.state, { $anchor: H } = j.selection;
320
+ let z = !1;
321
321
  for (let q = H.depth; q > 0; q--) {
322
322
  const L = H.node(q);
323
323
  if (L && (L.type.name === "bulletList" || L.type.name === "orderedList")) {
324
- N = !0;
324
+ z = !0;
325
325
  break;
326
326
  }
327
327
  }
328
- return N ? !1 : (S.preventDefault(), !0);
328
+ return z ? !1 : (S.preventDefault(), !0);
329
329
  }
330
330
  return !1;
331
331
  }
332
332
  }
333
333
  });
334
334
  return l.value = et(h), h;
335
- } catch (p) {
336
- return a.value = "Failed to load rich text editor dependencies.", console.error("Failed to initialize rich text editor", p), null;
335
+ } catch (u) {
336
+ return a.value = "Failed to load rich text editor dependencies.", console.error("Failed to initialize rich text editor", u), null;
337
337
  } finally {
338
338
  s.value = !1;
339
339
  }
340
340
  }, n = P(() => l.value || null);
341
341
  return ue(l, (i) => {
342
- i && l.value.on("update", (y) => {
342
+ i && l.value.on("update", (b) => {
343
343
  if (!e) {
344
344
  e = !0;
345
- const p = y.editor.getHTML();
345
+ const u = b.editor.getHTML();
346
346
  t.modelValue, setTimeout(() => {
347
347
  e = !1;
348
348
  }, 10);
@@ -371,20 +371,20 @@ function or(t, e, l, {
371
371
  isHtmlMode: o,
372
372
  htmlContent: n,
373
373
  htmlTextarea: c,
374
- toggleHtmlMode: async (y) => {
375
- if (o.value = y, y)
374
+ toggleHtmlMode: async (b) => {
375
+ if (o.value = b, b)
376
376
  t.value && (n.value = a ? await a(t.value.getHTML(), e) : t.value.getHTML()), be(() => {
377
377
  c.value && c.value.focus?.();
378
378
  });
379
379
  else if (t.value) {
380
- const p = s ? await s(n.value, e) : n.value;
381
- t.value.commands.setContent(p, !0), be(() => {
380
+ const u = s ? await s(n.value, e) : n.value;
381
+ t.value.commands.setContent(u, !0), be(() => {
382
382
  t.value?.commands?.focus?.();
383
383
  });
384
384
  }
385
385
  },
386
- onHtmlInput: (y) => {
387
- n.value = y, l && l("update:modelValue", y);
386
+ onHtmlInput: (b) => {
387
+ n.value = b, l && l("update:modelValue", b);
388
388
  }
389
389
  };
390
390
  }
@@ -406,15 +406,15 @@ const ne = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
406
406
  const n = o ? ` title="${ne(o)}"` : "";
407
407
  return `<a href="${ne(a)}"${n} target="_blank" rel="noopener noreferrer">${s}</a>`;
408
408
  }), e = e.replace(/`([^`]+)`/g, "<code>$1</code>"), e = e.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^_]+)__/g, "<strong>$1</strong>"), e = e.replace(/~~([^~]+)~~/g, "<del>$1</del>"), e = e.replace(/\*([^*\n]+)\*/g, "<em>$1</em>"), e = e.replace(/_([^_\n]+)_/g, "<em>$1</em>"), e;
409
- }, me = (t) => /^\s*\d+\.\s+/.test(t), Be = (t) => /^\s*[-*+]\s+/.test(t), Ke = (t) => /^\s*[-*+]\s+\[[ xX]\]\s+/.test(t), Se = (t) => /^\s*>\s?/.test(t), Ie = (t) => /^\s*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?\s*$/.test(t), ze = (t) => t.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((e) => xe(e.trim())), ar = (t, e) => {
409
+ }, me = (t) => /^\s*\d+\.\s+/.test(t), Be = (t) => /^\s*[-*+]\s+/.test(t), Ke = (t) => /^\s*[-*+]\s+\[[ xX]\]\s+/.test(t), Se = (t) => /^\s*>\s?/.test(t), Ie = (t) => /^\s*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?\s*$/.test(t), Ne = (t) => t.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((e) => xe(e.trim())), ar = (t, e) => {
410
410
  const l = t[e], s = t[e + 1];
411
411
  if (!l || !s || !l.includes("|") || !Ie(s))
412
412
  return null;
413
- const a = ze(l), o = [];
413
+ const a = Ne(l), o = [];
414
414
  let n = e + 2;
415
415
  for (; n < t.length && t[n].includes("|") && t[n].trim() !== ""; ) {
416
- const i = ze(t[n]);
417
- o.push(`<tr>${i.map((y) => `<td>${y}</td>`).join("")}</tr>`), n += 1;
416
+ const i = Ne(t[n]);
417
+ o.push(`<tr>${i.map((b) => `<td>${b}</td>`).join("")}</tr>`), n += 1;
418
418
  }
419
419
  const c = `<thead><tr>${a.map((i) => `<th>${i}</th>`).join("")}</tr></thead>`, r = o.length ? `<tbody>${o.join("")}</tbody>` : "";
420
420
  return {
@@ -520,7 +520,7 @@ const ne = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
520
520
  const l = (c) => `| ${Array.from(c.children).map((i) => Xe(i).trim()).join(" | ")} |`, s = e[0], a = s ? Array.from(s.children).length : 0, o = `| ${Array(Math.max(a, 1)).fill("---").join(" | ")} |`, n = e.slice(1).map((c) => l(c));
521
521
  return [l(s), o, ...n].join(`
522
522
  `);
523
- }, Ne = (t, e = !1) => Array.from(t.children).filter((l) => l.nodeType === Node.ELEMENT_NODE).map((l, s) => {
523
+ }, ze = (t, e = !1) => Array.from(t.children).filter((l) => l.nodeType === Node.ELEMENT_NODE).map((l, s) => {
524
524
  const a = l, o = a.querySelector('input[type="checkbox"]'), n = Array.from(a.childNodes).filter((c) => !(c instanceof HTMLInputElement)).map((c) => Ee(c)).join("").trim();
525
525
  return o ? `- [${o.checked ? "x" : " "}] ${n}` : e ? `${s + 1}. ${n}` : `- ${n}`;
526
526
  }).join(`
@@ -576,11 +576,11 @@ ${r}
576
576
  `;
577
577
  }
578
578
  case "ul":
579
- return `${Ne(e, !1)}
579
+ return `${ze(e, !1)}
580
580
 
581
581
  `;
582
582
  case "ol":
583
- return `${Ne(e, !0)}
583
+ return `${ze(e, !0)}
584
584
 
585
585
  `;
586
586
  case "a": {
@@ -611,28 +611,72 @@ const Ge = (t) => {
611
611
  return Array.from(l.body.childNodes).map((s) => Ee(s)).join("").replace(/\n{3,}/g, `
612
612
 
613
613
  `).trim();
614
- }, Ae = async (t, e) => e !== "md" ? t || "" : We(t || ""), dr = async (t, e) => e !== "md" ? t || "" : Ge(t || ""), ur = async (t, e) => e !== "md" ? t || "" : Ge(t || ""), fr = (t) => String(t).trim().toLowerCase().split("-")[0], pr = () => typeof window > "u" ? "uk" : fr(
614
+ }, dr = /* @__PURE__ */ new Set([
615
+ "area",
616
+ "base",
617
+ "br",
618
+ "col",
619
+ "embed",
620
+ "hr",
621
+ "img",
622
+ "input",
623
+ "link",
624
+ "meta",
625
+ "param",
626
+ "source",
627
+ "track",
628
+ "wbr"
629
+ ]), ur = (t) => {
630
+ if (!t) return "";
631
+ if (typeof window > "u" || typeof DOMParser > "u")
632
+ return t;
633
+ const l = new DOMParser().parseFromString(t, "text/html"), s = " ", a = (o, n) => {
634
+ if (o.nodeType === Node.TEXT_NODE) {
635
+ const g = (o.textContent || "").replace(/\s+/g, " ").trim();
636
+ return g ? [`${s.repeat(n)}${g}`] : [];
637
+ }
638
+ if (o.nodeType !== Node.ELEMENT_NODE)
639
+ return [];
640
+ const c = o, r = c.tagName.toLowerCase(), i = Array.from(c.attributes).map((g) => `${g.name}="${g.value}"`).join(" "), b = i ? `<${r} ${i}>` : `<${r}>`, u = `</${r}>`;
641
+ if (dr.has(r))
642
+ return [`${s.repeat(n)}${b}`];
643
+ const h = Array.from(c.childNodes).flatMap((g) => a(g, n + 1));
644
+ if (!h.length)
645
+ return [`${s.repeat(n)}${b}${u}`];
646
+ if (c.childNodes.length === 1 && c.firstChild?.nodeType === Node.TEXT_NODE && h.length === 1) {
647
+ const g = h[0].trim();
648
+ return [`${s.repeat(n)}${b}${g}${u}`];
649
+ }
650
+ return [
651
+ `${s.repeat(n)}${b}`,
652
+ ...h,
653
+ `${s.repeat(n)}${u}`
654
+ ];
655
+ };
656
+ return Array.from(l.body.childNodes).flatMap((o) => a(o, 0)).join(`
657
+ `);
658
+ }, Ae = async (t, e) => e !== "md" ? t || "" : We(t || ""), fr = async (t, e) => e !== "md" ? ur(t || "") : Ge(t || ""), pr = async (t, e) => e !== "md" ? t || "" : Ge(t || ""), gr = (t) => String(t).trim().toLowerCase().split("-")[0], hr = () => typeof window > "u" ? "uk" : gr(
615
659
  localStorage.getItem("language") || localStorage.getItem("locale") || navigator.language || "uk"
616
- ), gr = (t, e) => {
660
+ ), vr = (t, e) => {
617
661
  const l = e.replace(/^form\.richtext\./, "");
618
662
  return Me?.[t]?.form?.richtext?.[l] || Me?.uk?.form?.richtext?.[l] || e;
619
- }, Ve = (t) => t.startsWith("form.richtext.") ? t : `form.richtext.${t}`;
663
+ }, De = (t) => t.startsWith("form.richtext.") ? t : `form.richtext.${t}`;
620
664
  function _e() {
621
665
  const e = tt()?.appContext?.config?.globalProperties, l = e?.$i18n;
622
666
  return { t: (a) => {
623
667
  const o = e?.$t, n = e?.$te, c = typeof l?.te == "function" ? l.te.bind(l) : null;
624
668
  if (typeof o == "function") {
625
- const r = Ve(a);
669
+ const r = De(a);
626
670
  if ((typeof n == "function" ? n(r) : typeof c == "function" ? c(r) : null) !== !1) {
627
- const y = o(r);
628
- if (y && y !== r)
629
- return y;
671
+ const b = o(r);
672
+ if (b && b !== r)
673
+ return b;
630
674
  }
631
675
  }
632
- return gr(pr(), Ve(a));
676
+ return vr(hr(), De(a));
633
677
  } };
634
678
  }
635
- const hr = {
679
+ const mr = {
636
680
  components: { Quote: pt },
637
681
  props: { editor: Object },
638
682
  methods: {
@@ -641,9 +685,9 @@ const hr = {
641
685
  }
642
686
  }
643
687
  };
644
- function vr(t, e, l, s, a, o) {
688
+ function br(t, e, l, s, a, o) {
645
689
  const n = G("Quote");
646
- return g(), w("button", {
690
+ return v(), w("button", {
647
691
  title: "Blockquote",
648
692
  onClick: e[0] || (e[0] = (...c) => o.toggleBlockquote && o.toggleBlockquote(...c)),
649
693
  class: T(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none", { "bg-gray-100 text-gray-900": l.editor?.isActive("blockquote") }])
@@ -651,7 +695,7 @@ function vr(t, e, l, s, a, o) {
651
695
  C(n, { class: "h-4 w-4" })
652
696
  ], 2);
653
697
  }
654
- const mr = /* @__PURE__ */ X(hr, [["render", vr]]), br = {
698
+ const yr = /* @__PURE__ */ X(mr, [["render", br]]), xr = {
655
699
  components: { List: gt },
656
700
  props: { editor: Object },
657
701
  methods: {
@@ -660,9 +704,9 @@ const mr = /* @__PURE__ */ X(hr, [["render", vr]]), br = {
660
704
  }
661
705
  }
662
706
  };
663
- function yr(t, e, l, s, a, o) {
707
+ function wr(t, e, l, s, a, o) {
664
708
  const n = G("List");
665
- return g(), w("button", {
709
+ return v(), w("button", {
666
710
  title: "Bullet List",
667
711
  onClick: e[0] || (e[0] = (...c) => o.toggleBulletList && o.toggleBulletList(...c)),
668
712
  class: T(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": l.editor?.isActive("bulletList") }])
@@ -670,7 +714,7 @@ function yr(t, e, l, s, a, o) {
670
714
  C(n, { class: "h-4 w-4" })
671
715
  ], 2);
672
716
  }
673
- const xr = /* @__PURE__ */ X(br, [["render", yr]]), wr = {
717
+ const kr = /* @__PURE__ */ X(xr, [["render", wr]]), _r = {
674
718
  components: { ListOrdered: ht },
675
719
  props: { editor: Object },
676
720
  methods: {
@@ -679,9 +723,9 @@ const xr = /* @__PURE__ */ X(br, [["render", yr]]), wr = {
679
723
  }
680
724
  }
681
725
  };
682
- function kr(t, e, l, s, a, o) {
726
+ function $r(t, e, l, s, a, o) {
683
727
  const n = G("ListOrdered");
684
- return g(), w("button", {
728
+ return v(), w("button", {
685
729
  title: "Ordered List",
686
730
  onClick: e[0] || (e[0] = (...c) => o.toggleOrderedList && o.toggleOrderedList(...c)),
687
731
  class: T(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": l.editor?.isActive("orderedList") }])
@@ -689,7 +733,7 @@ function kr(t, e, l, s, a, o) {
689
733
  C(n, { class: "h-4 w-4" })
690
734
  ], 2);
691
735
  }
692
- const _r = /* @__PURE__ */ X(wr, [["render", kr]]), $r = {
736
+ const Cr = /* @__PURE__ */ X(_r, [["render", $r]]), Ar = {
693
737
  components: { CodeXml: vt },
694
738
  props: { editor: Object },
695
739
  methods: {
@@ -698,9 +742,9 @@ const _r = /* @__PURE__ */ X(wr, [["render", kr]]), $r = {
698
742
  }
699
743
  }
700
744
  };
701
- function Cr(t, e, l, s, a, o) {
745
+ function Fr(t, e, l, s, a, o) {
702
746
  const n = G("CodeXml");
703
- return g(), w("button", {
747
+ return v(), w("button", {
704
748
  title: "Code Block",
705
749
  onClick: e[0] || (e[0] = (...c) => o.toggleCodeBlock && o.toggleCodeBlock(...c)),
706
750
  class: T(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": l.editor?.isActive("codeBlock") }])
@@ -708,7 +752,7 @@ function Cr(t, e, l, s, a, o) {
708
752
  C(n, { class: "h-4 w-4" })
709
753
  ], 2);
710
754
  }
711
- const Ar = /* @__PURE__ */ X($r, [["render", Cr]]), Fr = {
755
+ const Sr = /* @__PURE__ */ X(Ar, [["render", Fr]]), Tr = {
712
756
  components: { Bold: mt },
713
757
  props: {
714
758
  editor: Object
@@ -719,9 +763,9 @@ const Ar = /* @__PURE__ */ X($r, [["render", Cr]]), Fr = {
719
763
  }
720
764
  }
721
765
  };
722
- function Sr(t, e, l, s, a, o) {
766
+ function Lr(t, e, l, s, a, o) {
723
767
  const n = G("Bold");
724
- return g(), w("button", {
768
+ return v(), w("button", {
725
769
  title: "Bold Text",
726
770
  onClick: e[0] || (e[0] = (...c) => o.toggleBold && o.toggleBold(...c)),
727
771
  class: T(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": l.editor?.isActive("bold") }])
@@ -730,7 +774,7 @@ function Sr(t, e, l, s, a, o) {
730
774
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Bold", -1))
731
775
  ], 2);
732
776
  }
733
- const Tr = /* @__PURE__ */ X(Fr, [["render", Sr]]), Lr = {
777
+ const Br = /* @__PURE__ */ X(Tr, [["render", Lr]]), Ir = {
734
778
  components: { Italic: bt },
735
779
  props: {
736
780
  editor: Object
@@ -741,9 +785,9 @@ const Tr = /* @__PURE__ */ X(Fr, [["render", Sr]]), Lr = {
741
785
  }
742
786
  }
743
787
  };
744
- function Br(t, e, l, s, a, o) {
788
+ function Er(t, e, l, s, a, o) {
745
789
  const n = G("Italic");
746
- return g(), w("button", {
790
+ return v(), w("button", {
747
791
  title: "Italic Text",
748
792
  onClick: e[0] || (e[0] = (...c) => o.toggleItalic && o.toggleItalic(...c)),
749
793
  class: T(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": l.editor?.isActive("italic") }])
@@ -752,14 +796,14 @@ function Br(t, e, l, s, a, o) {
752
796
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Italic", -1))
753
797
  ], 2);
754
798
  }
755
- const Ir = /* @__PURE__ */ X(Lr, [["render", Br]]), Er = {
799
+ const jr = /* @__PURE__ */ X(Ir, [["render", Er]]), Pr = {
756
800
  __name: "vs-editor-underline",
757
801
  props: { editor: Object },
758
802
  setup(t) {
759
803
  const e = t, l = () => {
760
804
  e.editor && e.editor.chain().focus().toggleUnderline().run();
761
805
  };
762
- return (s, a) => (g(), w("button", {
806
+ return (s, a) => (v(), w("button", {
763
807
  title: "Underline",
764
808
  onClick: l,
765
809
  class: T(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", [
@@ -769,14 +813,14 @@ const Ir = /* @__PURE__ */ X(Lr, [["render", Br]]), Er = {
769
813
  C(k(yt), { class: "h-4 w-4" })
770
814
  ], 2));
771
815
  }
772
- }, jr = {
816
+ }, Mr = {
773
817
  __name: "vs-editor-strike",
774
818
  props: { editor: Object },
775
819
  setup(t) {
776
820
  const e = t, l = () => {
777
821
  e.editor && e.editor.chain().focus().toggleStrike().run();
778
822
  };
779
- return (s, a) => (g(), w("button", {
823
+ return (s, a) => (v(), w("button", {
780
824
  title: "Strikethrough",
781
825
  onClick: l,
782
826
  class: T(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", [
@@ -786,7 +830,7 @@ const Ir = /* @__PURE__ */ X(Lr, [["render", Br]]), Er = {
786
830
  C(k(xt), { class: "h-4 w-4" })
787
831
  ], 2));
788
832
  }
789
- }, Pr = {
833
+ }, Hr = {
790
834
  components: { X: Te },
791
835
  props: {
792
836
  visible: { type: Boolean, default: () => !1 },
@@ -829,17 +873,17 @@ const Ir = /* @__PURE__ */ X(Lr, [["render", Br]]), Er = {
829
873
  e && t.target.classList.contains("vs-dialog-overlay") && this.handleClose();
830
874
  }
831
875
  }
832
- }, Mr = {
876
+ }, Nr = {
833
877
  key: 0,
834
878
  class: "vsTailwind ui-dialog__wrapper"
835
- }, Hr = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, zr = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, Nr = { class: "ui-dialog__content p-4" }, Vr = {
879
+ }, zr = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, Dr = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, Or = { class: "ui-dialog__content p-4" }, Vr = {
836
880
  key: 0,
837
881
  class: "flex justify-end gap-x-2"
838
882
  };
839
- function Dr(t, e, l, s, a, o) {
883
+ function Rr(t, e, l, s, a, o) {
840
884
  const n = G("X");
841
- return g(), K(Oe, { to: "body" }, [
842
- l.visible || l.modelValue ? (g(), w("div", Mr, [
885
+ return v(), K(Ve, { to: "body" }, [
886
+ l.visible || l.modelValue ? (v(), w("div", Nr, [
843
887
  d("div", {
844
888
  onMousedown: e[1] || (e[1] = (c) => o.closeByClickBack(c, l.closeClickBack)),
845
889
  class: "vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[100001] bg-black bg-opacity-50"
@@ -848,12 +892,12 @@ function Dr(t, e, l, s, a, o) {
848
892
  name: "content",
849
893
  appear: ""
850
894
  }, {
851
- default: V(() => [
895
+ default: D(() => [
852
896
  d("div", {
853
897
  class: T(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl", [o.checkSize]])
854
898
  }, [
855
- d("div", Hr, [
856
- d("h3", zr, W(l.title), 1),
899
+ d("div", zr, [
900
+ d("h3", Dr, W(l.title), 1),
857
901
  d("button", {
858
902
  type: "button",
859
903
  class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",
@@ -863,10 +907,10 @@ function Dr(t, e, l, s, a, o) {
863
907
  C(n, { class: "h-4 w-4 flex-shrink-0" })
864
908
  ])
865
909
  ]),
866
- d("div", Nr, [
910
+ d("div", Or, [
867
911
  he(t.$slots, "default", {}, void 0, !0)
868
912
  ]),
869
- o.hasSlot ? (g(), w("div", Vr, [
913
+ o.hasSlot ? (v(), w("div", Vr, [
870
914
  he(t.$slots, "footer", {
871
915
  handleClose: o.handleClose,
872
916
  handleConfirm: o.handleConfirm,
@@ -881,7 +925,7 @@ function Dr(t, e, l, s, a, o) {
881
925
  ])) : R("", !0)
882
926
  ]);
883
927
  }
884
- const Ye = /* @__PURE__ */ X(Pr, [["render", Dr], ["__scopeId", "data-v-9395bb47"]]), Or = rt({
928
+ const Ye = /* @__PURE__ */ X(Hr, [["render", Rr], ["__scopeId", "data-v-9395bb47"]]), Ur = rt({
885
929
  components: {
886
930
  IconClose: Te,
887
931
  IconSearch: kt,
@@ -964,32 +1008,32 @@ const Ye = /* @__PURE__ */ X(Pr, [["render", Dr], ["__scopeId", "data-v-9395bb47
964
1008
  await this.$refs.vsText?.focus();
965
1009
  }
966
1010
  }
967
- }), Rr = { class: "vs-form-text relative bg-white rounded-lg" }, Ur = {
1011
+ }), qr = { class: "vs-form-text relative bg-white rounded-lg" }, Kr = {
968
1012
  key: 2,
969
1013
  class: "absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"
970
- }, qr = ["disabled", "type", "placeholder"];
971
- function Kr(t, e, l, s, a, o) {
1014
+ }, Wr = ["disabled", "type", "placeholder"];
1015
+ function Xr(t, e, l, s, a, o) {
972
1016
  const n = G("IconClose"), c = G("IconSearch"), r = G("IconEmail");
973
- return g(), w("div", Rr, [
974
- t.clearable && t.value ? (g(), w("div", {
1017
+ return v(), w("div", qr, [
1018
+ t.clearable && t.value ? (v(), w("div", {
975
1019
  key: 0,
976
1020
  class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",
977
1021
  onClick: e[0] || (e[0] = (...i) => t.clearInput && t.clearInput(...i))
978
1022
  }, [
979
1023
  C(n, { class: "h-4 w-4 stroke-gray-500 transition-all hover:stroke-red-500" })
980
1024
  ])) : R("", !0),
981
- t.icon && t.icon === "search" ? (g(), w("div", {
1025
+ t.icon && t.icon === "search" ? (v(), w("div", {
982
1026
  key: 1,
983
1027
  class: T(["absolute bottom-2/4 translate-y-2/4 cursor-pointer", t.iconStylePosition])
984
1028
  }, [
985
1029
  C(c, { class: "h-4 w-4 stroke-gray-500 transition-all" })
986
- ], 2)) : t.icon && t.icon === "email" ? (g(), w("div", Ur, [
1030
+ ], 2)) : t.icon && t.icon === "email" ? (v(), w("div", Kr, [
987
1031
  C(r, { class: "h-4 w-4 stroke-gray-500 transition-all" })
988
- ])) : (g(), w("i", {
1032
+ ])) : (v(), w("i", {
989
1033
  key: 3,
990
1034
  class: T(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer", ["ti " + t.icon, t.iconStylePosition]])
991
1035
  }, null, 2)),
992
- t.clearable && t.value ? (g(), w("div", {
1036
+ t.clearable && t.value ? (v(), w("div", {
993
1037
  key: 4,
994
1038
  class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",
995
1039
  onClick: e[1] || (e[1] = (...i) => t.clearInput && t.clearInput(...i))
@@ -1007,18 +1051,18 @@ function Kr(t, e, l, s, a, o) {
1007
1051
  onFocus: e[4] || (e[4] = (...i) => t.handleFocus && t.handleFocus(...i)),
1008
1052
  onBlur: e[5] || (e[5] = (...i) => t.handleBlur && t.handleBlur(...i)),
1009
1053
  class: [[t.inputStyle, t.checkSize], "py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]
1010
- }), null, 16, qr), [
1054
+ }), null, 16, Wr), [
1011
1055
  [lt, t.value]
1012
1056
  ])
1013
1057
  ]);
1014
1058
  }
1015
- const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36"]]), Wr = ["title"], Xr = { class: "flex flex-col gap-3 p-[20px]" }, Gr = { class: "relative flex items-center gap-2" }, Yr = { class: "flex-1" }, Qr = {
1059
+ const Qe = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-1e382a36"]]), Gr = ["title"], Yr = { class: "flex flex-col gap-3 p-[20px]" }, Qr = { class: "relative flex items-center gap-2" }, Zr = { class: "flex-1" }, Jr = {
1016
1060
  key: 0,
1017
1061
  class: "flex items-center gap-2 flex-shrink-0"
1018
- }, Zr = ["title"], Jr = ["title"], eo = { class: "flex items-center gap-2" }, to = {
1062
+ }, eo = ["title"], to = ["title"], ro = { class: "flex items-center gap-2" }, oo = {
1019
1063
  for: "openInNewTab",
1020
1064
  class: "text-sm text-gray-700 cursor-pointer"
1021
- }, ro = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, oo = /* @__PURE__ */ Object.assign({
1065
+ }, lo = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, ao = /* @__PURE__ */ Object.assign({
1022
1066
  inheritAttrs: !1
1023
1067
  }, {
1024
1068
  __name: "vs-editor-link",
@@ -1038,29 +1082,29 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1038
1082
  href: h,
1039
1083
  target: n.value ? "_blank" : null
1040
1084
  }).run(), r();
1041
- }, y = () => {
1085
+ }, b = () => {
1042
1086
  l.editor && (l.editor.chain().focus().unsetLink().run(), r());
1043
- }, p = () => {
1087
+ }, u = () => {
1044
1088
  if (!a.value) return;
1045
1089
  let h = a.value.trim();
1046
1090
  h.match(/^https?:\/\//i) || (h = "https://" + h), window.open(h, "_blank", "noopener,noreferrer");
1047
1091
  };
1048
- return (h, b) => (g(), w(re, null, [
1092
+ return (h, g) => (v(), w(re, null, [
1049
1093
  d("button", {
1050
1094
  title: k(e)("form.richtext.link") || "Посилання",
1051
1095
  onClick: c,
1052
1096
  class: T(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none", { "bg-gray-100 text-gray-900": t.editor?.isActive("link") }])
1053
1097
  }, [
1054
1098
  C(k(_t), { class: "h-4 w-4" })
1055
- ], 10, Wr),
1099
+ ], 10, Gr),
1056
1100
  C(Ye, {
1057
1101
  title: o.value ? k(e)("form.richtext.editLink") || "Редагувати посилання" : k(e)("form.richtext.linkTitle") || "Додати посилання",
1058
1102
  visible: s.value,
1059
- "onUpdate:visible": b[2] || (b[2] = (S) => s.value = S),
1103
+ "onUpdate:visible": g[2] || (g[2] = (S) => s.value = S),
1060
1104
  size: "small"
1061
1105
  }, {
1062
- footer: V(() => [
1063
- d("div", ro, [
1106
+ footer: D(() => [
1107
+ d("div", lo, [
1064
1108
  d("button", {
1065
1109
  style: { border: "1px solid #000" },
1066
1110
  onClick: r,
@@ -1072,44 +1116,44 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1072
1116
  }, W(o.value ? k(e)("form.richtext.update") || "Оновити" : k(e)("form.richtext.create") || "Створити"), 1)
1073
1117
  ])
1074
1118
  ]),
1075
- default: V(() => [
1076
- d("div", Xr, [
1077
- d("div", Gr, [
1078
- d("div", Yr, [
1119
+ default: D(() => [
1120
+ d("div", Yr, [
1121
+ d("div", Qr, [
1122
+ d("div", Zr, [
1079
1123
  C(Qe, {
1080
1124
  modelValue: a.value,
1081
- "onUpdate:modelValue": b[0] || (b[0] = (S) => a.value = S),
1125
+ "onUpdate:modelValue": g[0] || (g[0] = (S) => a.value = S),
1082
1126
  placeholder: k(e)("form.richtext.linkUrl") || "Введіть URL",
1083
1127
  class: "w-full"
1084
1128
  }, null, 8, ["modelValue", "placeholder"])
1085
1129
  ]),
1086
- o.value ? (g(), w("div", Qr, [
1130
+ o.value ? (v(), w("div", Jr, [
1087
1131
  d("button", {
1088
- onClick: p,
1132
+ onClick: u,
1089
1133
  class: "text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none transition-colors",
1090
1134
  title: k(e)("form.richtext.openLink") || "Відкрити посилання"
1091
1135
  }, [
1092
1136
  C(k($t), { class: "h-4 w-4" })
1093
- ], 8, Zr),
1137
+ ], 8, eo),
1094
1138
  d("button", {
1095
- onClick: y,
1139
+ onClick: b,
1096
1140
  class: "text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-red-600 hover:bg-red-50 focus:outline-none transition-colors",
1097
1141
  title: k(e)("form.richtext.removeLink") || "Видалити посилання"
1098
1142
  }, [
1099
1143
  C(k(Ct), { class: "h-4 w-4" })
1100
- ], 8, Jr)
1144
+ ], 8, to)
1101
1145
  ])) : R("", !0)
1102
1146
  ]),
1103
- d("div", eo, [
1147
+ d("div", ro, [
1104
1148
  ie(d("input", {
1105
1149
  type: "checkbox",
1106
1150
  id: "openInNewTab",
1107
- "onUpdate:modelValue": b[1] || (b[1] = (S) => n.value = S),
1151
+ "onUpdate:modelValue": g[1] || (g[1] = (S) => n.value = S),
1108
1152
  class: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"
1109
1153
  }, null, 512), [
1110
1154
  [at, n.value]
1111
1155
  ]),
1112
- d("label", to, W(k(e)("form.richtext.openInNewTab") || "Відкривати в новій вкладці"), 1)
1156
+ d("label", oo, W(k(e)("form.richtext.openInNewTab") || "Відкривати в новій вкладці"), 1)
1113
1157
  ])
1114
1158
  ])
1115
1159
  ]),
@@ -1122,43 +1166,43 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1122
1166
  await be();
1123
1167
  const a = await l?.getBoundingClientRect(), o = await e?.getBoundingClientRect();
1124
1168
  if (!o || !a) return;
1125
- const n = await parseInt(e?.getBoundingClientRect()?.height), c = await parseInt(e?.getBoundingClientRect()?.width), r = await parseInt(l?.getBoundingClientRect()?.height), i = await parseInt(l?.getBoundingClientRect()?.width), y = await window.innerHeight, p = await window.innerWidth;
1126
- let h = 0, b = 0;
1169
+ const n = await parseInt(e?.getBoundingClientRect()?.height), c = await parseInt(e?.getBoundingClientRect()?.width), r = await parseInt(l?.getBoundingClientRect()?.height), i = await parseInt(l?.getBoundingClientRect()?.width), b = await window.innerHeight, u = await window.innerWidth;
1170
+ let h = 0, g = 0;
1127
1171
  const S = o.bottom + s + r;
1128
1172
  switch (t) {
1129
1173
  case "top":
1130
- o.top - a.height - s < 0 ? h = o.top - a.height + s + r + n : h = o.top - a.height - s, p > i + o.right + 30 ? b = o.left - a.width / 2 + o.width / 2 : b = p - 30 - i;
1174
+ o.top - a.height - s < 0 ? h = o.top - a.height + s + r + n : h = o.top - a.height - s, u > i + o.right + 30 ? g = o.left - a.width / 2 + o.width / 2 : g = u - 30 - i;
1131
1175
  break;
1132
1176
  case "bottom":
1133
- y > S ? h = o.bottom + s : h = o.bottom - s - r - n, b = o.left - a.width / 2 + o.width / 2;
1177
+ b > S ? h = o.bottom + s : h = o.bottom - s - r - n, g = o.left - a.width / 2 + o.width / 2;
1134
1178
  break;
1135
1179
  case "left":
1136
- h = o.top - a.height / 2 + o.height / 2, o.left - a.width - s > 0 ? b = o.left - a.width - s : b = 10;
1180
+ h = o.top - a.height / 2 + o.height / 2, o.left - a.width - s > 0 ? g = o.left - a.width - s : g = 10;
1137
1181
  break;
1138
1182
  case "right":
1139
- h = o.top - a.height / 2 + o.height / 2, p - c > i ? b = o.right + s : b = p - 30 - i;
1183
+ h = o.top - a.height / 2 + o.height / 2, u - c > i ? g = o.right + s : g = u - 30 - i;
1140
1184
  break;
1141
1185
  case "top-right":
1142
- o.top - a.height - s < 0 ? h = o.top - a.height + s + r + n : h = o.top - a.height - s, p - c > i ? b = o.right + s : b = p - 30 - i;
1186
+ o.top - a.height - s < 0 ? h = o.top - a.height + s + r + n : h = o.top - a.height - s, u - c > i ? g = o.right + s : g = u - 30 - i;
1143
1187
  break;
1144
1188
  case "top-left":
1145
- o.top - a.height - s < 0 ? h = o.top - a.height + s + r + n : h = o.top - a.height - s, o.left - a.width - s > 0 ? b = o.left - a.width - s : b = 10;
1189
+ o.top - a.height - s < 0 ? h = o.top - a.height + s + r + n : h = o.top - a.height - s, o.left - a.width - s > 0 ? g = o.left - a.width - s : g = 10;
1146
1190
  break;
1147
1191
  case "top-start":
1148
- o.top - a.height - s < 0 ? h = o.top - a.height + s + r + n : h = o.top - a.height - s, o.left > 0 ? b = o.left : b = 10;
1192
+ o.top - a.height - s < 0 ? h = o.top - a.height + s + r + n : h = o.top - a.height - s, o.left > 0 ? g = o.left : g = 10;
1149
1193
  break;
1150
1194
  case "bottom-right":
1151
- y > S ? h = o.bottom + s : h = o.bottom - s - r - n, p - c > i ? b = o.left : b = p - 30 - i;
1195
+ b > S ? h = o.bottom + s : h = o.bottom - s - r - n, u - c > i ? g = o.left : g = u - 30 - i;
1152
1196
  break;
1153
1197
  case "bottom-left":
1154
- y > S ? h = o.bottom + s : h = o.bottom - s - r - n, o.left > 0 ? b = o.right - i : b = 10;
1198
+ b > S ? h = o.bottom + s : h = o.bottom - s - r - n, o.left > 0 ? g = o.right - i : g = 10;
1155
1199
  break;
1156
1200
  case "bottom-start":
1157
- y > S ? h = o.bottom + s : h = o.bottom - s - r - n, o.left > 0 ? b = o.left : b = 10;
1201
+ b > S ? h = o.bottom + s : h = o.bottom - s - r - n, o.left > 0 ? g = o.left : g = 10;
1158
1202
  break;
1159
1203
  }
1160
- h + r > y ? h = y - r - s : h < 0 && (h = s), b + i > p ? b = p - i - s : b < 0 && (b = s), l instanceof HTMLElement && (l.style.top = `${h}px`, l.style.left = `${b}px`, l.style.position = "fixed");
1161
- }, lo = { class: "text-center" }, ao = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, ce = /* @__PURE__ */ Object.assign({
1204
+ h + r > b ? h = b - r - s : h < 0 && (h = s), g + i > u ? g = u - i - s : g < 0 && (g = s), l instanceof HTMLElement && (l.style.top = `${h}px`, l.style.left = `${g}px`, l.style.position = "fixed");
1205
+ }, so = { class: "text-center" }, no = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, ce = /* @__PURE__ */ Object.assign({
1162
1206
  inheritAttrs: !1
1163
1207
  }, {
1164
1208
  __name: "vs-popover",
@@ -1175,7 +1219,7 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1175
1219
  setup(t, { expose: e, emit: l }) {
1176
1220
  const s = t, a = l, o = $(!1), n = $([]), c = $(null), r = $(null), i = $(null);
1177
1221
  ue(o, (L) => {
1178
- L ? (y(), window.addEventListener(
1222
+ L ? (b(), window.addEventListener(
1179
1223
  "resize",
1180
1224
  () => ge(s.placement, r.value, i.value)
1181
1225
  ), ge(s.placement, r.value, i.value)) : window.removeEventListener(
@@ -1183,22 +1227,22 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1183
1227
  () => ge(s.placement, r.value, i.value)
1184
1228
  ), a("isvisible", L);
1185
1229
  }), fe(() => {
1186
- window.addEventListener("click", H), window.addEventListener("popstate", N), window.addEventListener("scroll", q, !0), y();
1230
+ window.addEventListener("click", H), window.addEventListener("popstate", z), window.addEventListener("scroll", q, !0), b();
1187
1231
  }), Ue(() => {
1188
- window.removeEventListener("click", H), window.removeEventListener("popstate", N), p();
1232
+ window.removeEventListener("click", H), window.removeEventListener("popstate", z), u();
1189
1233
  });
1190
- const y = () => {
1234
+ const b = () => {
1191
1235
  let L = c.value;
1192
1236
  for (; L && L !== document.body; )
1193
1237
  (L.scrollHeight > L.clientHeight || L.scrollWidth > L.clientWidth) && (L.addEventListener("scroll", j), n.value.push(L)), L = L.parentElement;
1194
1238
  document.body && (document.body.addEventListener("scroll", j), n.value.push(document.body));
1195
- }, p = () => {
1239
+ }, u = () => {
1196
1240
  n.value.forEach((L) => {
1197
1241
  L.removeEventListener("scroll", j);
1198
1242
  }), n.value = [];
1199
1243
  }, h = () => {
1200
1244
  o.value = !0, ge(s.placement, r.value, i.value);
1201
- }, b = () => {
1245
+ }, g = () => {
1202
1246
  o.value = !1;
1203
1247
  }, S = async () => {
1204
1248
  await ge(s.placement, r.value, i.value), o.value = !o.value;
@@ -1210,20 +1254,20 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1210
1254
  return;
1211
1255
  }
1212
1256
  r.value?.contains(L.target) || i.value?.contains(L.target) || (o.value = !1);
1213
- }, N = () => {
1257
+ }, z = () => {
1214
1258
  o.value && (o.value = !1);
1215
1259
  }, q = (L) => {
1216
1260
  o.value && i.value && !i.value.contains(L.target) && (o.value = !1);
1217
1261
  };
1218
1262
  return e({
1219
1263
  togglePopover: S
1220
- }), (L, Y) => (g(), w("div", {
1264
+ }), (L, Y) => (v(), w("div", {
1221
1265
  ref_key: "popover",
1222
1266
  ref: c,
1223
1267
  class: "vs-popover inline-block"
1224
1268
  }, [
1225
- d("div", lo, [
1226
- t.trigger === "click" ? (g(), w("div", {
1269
+ d("div", so, [
1270
+ t.trigger === "click" ? (v(), w("div", {
1227
1271
  key: 0,
1228
1272
  ref_key: "popoverRef",
1229
1273
  ref: r,
@@ -1234,21 +1278,21 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1234
1278
  Y[0] || (Y[0] = d("button", null, "Click me!", -1))
1235
1279
  ])
1236
1280
  ], 2)) : R("", !0),
1237
- t.trigger === "hover" ? (g(), w("div", {
1281
+ t.trigger === "hover" ? (v(), w("div", {
1238
1282
  key: 1,
1239
1283
  ref_key: "popoverRef",
1240
1284
  ref: r,
1241
1285
  onMouseover: h,
1242
- onMouseleave: b,
1286
+ onMouseleave: g,
1243
1287
  class: T({ "pointer-events-none": t.disabled })
1244
1288
  }, [
1245
1289
  he(L.$slots, "reference", {}, () => [
1246
1290
  Y[1] || (Y[1] = d("button", null, "Click me!", -1))
1247
1291
  ])
1248
1292
  ], 34)) : R("", !0),
1249
- (g(), K(Oe, { to: t.teleport }, [
1293
+ (v(), K(Ve, { to: t.teleport }, [
1250
1294
  C(Re, { name: "fade" }, {
1251
- default: V(() => [
1295
+ default: D(() => [
1252
1296
  ie(d("div", {
1253
1297
  class: T(["vsTailwind vs-popover__content", t.placement]),
1254
1298
  ref_key: "contentPop",
@@ -1258,7 +1302,7 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1258
1302
  zIndex: 100001
1259
1303
  })
1260
1304
  }, [
1261
- d("div", ao, [
1305
+ d("div", no, [
1262
1306
  he(L.$slots, "default", {}, () => [
1263
1307
  Y[2] || (Y[2] = d("span", null, "Popover content", -1))
1264
1308
  ])
@@ -1273,7 +1317,7 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1273
1317
  ])
1274
1318
  ], 512));
1275
1319
  }
1276
- }), so = { class: "flex flex-col gap-[2px] p-[2px]" }, no = ["onClick"], io = {
1320
+ }), io = { class: "flex flex-col gap-[2px] p-[2px]" }, co = ["onClick"], uo = {
1277
1321
  __name: "vs-editor-table",
1278
1322
  props: { editor: Object },
1279
1323
  setup(t) {
@@ -1287,29 +1331,29 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1287
1331
  l.editor && (l.editor.chain().focus().deleteColumn().run(), a.value.togglePopover());
1288
1332
  }, i = () => {
1289
1333
  l.editor && (l.editor.chain().focus().deleteRow().run(), a.value.togglePopover());
1290
- }, y = () => {
1334
+ }, b = () => {
1291
1335
  l.editor && (l.editor.chain().focus().deleteTable().run(), a.value.togglePopover());
1292
- }, p = () => {
1336
+ }, u = () => {
1293
1337
  l.editor && (l.editor.chain().focus().mergeCells().run(), a.value.togglePopover());
1294
1338
  }, h = () => {
1295
1339
  l.editor && (l.editor.chain().focus().splitCell().run(), a.value.togglePopover());
1296
- }, b = P(() => [
1340
+ }, g = P(() => [
1297
1341
  { text: e("form.richtext.createTable"), function: o },
1298
1342
  { text: e("form.richtext.addColumn"), function: n },
1299
1343
  { text: e("form.richtext.addRow"), function: c },
1300
1344
  { text: e("form.richtext.deleteColumn"), function: r },
1301
1345
  { text: e("form.richtext.deleteRow"), function: i },
1302
- { text: e("form.richtext.deleteTable"), function: y },
1303
- { text: e("form.richtext.mergeCells"), function: p },
1346
+ { text: e("form.richtext.deleteTable"), function: b },
1347
+ { text: e("form.richtext.mergeCells"), function: u },
1304
1348
  { text: e("form.richtext.splitCells"), function: h }
1305
1349
  ]);
1306
- return (S, j) => (g(), K(ce, {
1350
+ return (S, j) => (v(), K(ce, {
1307
1351
  ref_key: "popover",
1308
1352
  ref: a,
1309
1353
  placement: "bottom",
1310
1354
  onIsvisible: j[0] || (j[0] = (H) => s.value = H)
1311
1355
  }, {
1312
- reference: V(() => [
1356
+ reference: D(() => [
1313
1357
  d("button", {
1314
1358
  title: "Table",
1315
1359
  class: T(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [s.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]])
@@ -1317,19 +1361,19 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1317
1361
  C(k(At), { class: "h-4 w-4" })
1318
1362
  ], 2)
1319
1363
  ]),
1320
- default: V(() => [
1321
- d("div", so, [
1322
- (g(!0), w(re, null, le(b.value, (H, N) => (g(), w("button", {
1323
- key: N,
1364
+ default: D(() => [
1365
+ d("div", io, [
1366
+ (v(!0), w(re, null, le(g.value, (H, z) => (v(), w("button", {
1367
+ key: z,
1324
1368
  onClick: H?.function,
1325
1369
  class: "px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"
1326
- }, W(H.text), 9, no))), 128))
1370
+ }, W(H.text), 9, co))), 128))
1327
1371
  ])
1328
1372
  ]),
1329
1373
  _: 1
1330
1374
  }, 512));
1331
1375
  }
1332
- }, co = { class: "flex gap-[4px] p-1" }, uo = ["title", "onClick"], fo = {
1376
+ }, fo = { class: "flex gap-[4px] p-1" }, po = ["title", "onClick"], go = {
1333
1377
  __name: "vs-editor-align",
1334
1378
  props: { editor: Object },
1335
1379
  setup(t) {
@@ -1338,60 +1382,60 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1338
1382
  center: Tt,
1339
1383
  right: St,
1340
1384
  justify: Ft
1341
- }, s = $(!1), a = $("popover"), o = $("left"), n = P(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "left" }) || e.editor.isActive("heading", { textAlign: "left" }) : !1), c = P(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "right" }) || e.editor.isActive("heading", { textAlign: "right" }) : !1), r = P(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "center" }) || e.editor.isActive("heading", { textAlign: "center" }) : !1), i = P(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "justify" }) || e.editor.isActive("heading", { textAlign: "justify" }) : !1), y = P(() => n.value || c.value || r.value || i.value), p = () => {
1385
+ }, s = $(!1), a = $("popover"), o = $("left"), n = P(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "left" }) || e.editor.isActive("heading", { textAlign: "left" }) : !1), c = P(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "right" }) || e.editor.isActive("heading", { textAlign: "right" }) : !1), r = P(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "center" }) || e.editor.isActive("heading", { textAlign: "center" }) : !1), i = P(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "justify" }) || e.editor.isActive("heading", { textAlign: "justify" }) : !1), b = P(() => n.value || c.value || r.value || i.value), u = () => {
1342
1386
  c.value ? o.value = "right" : r.value ? o.value = "center" : i.value ? o.value = "justify" : o.value = "left";
1343
1387
  };
1344
1388
  ue([n, c, r, i], () => {
1345
- p();
1389
+ u();
1346
1390
  }, { immediate: !0 }), fe(() => {
1347
- e.editor && (e.editor.on("selectionUpdate", p), e.editor.on("update", p));
1391
+ e.editor && (e.editor.on("selectionUpdate", u), e.editor.on("update", u));
1348
1392
  }), ke(() => {
1349
- e.editor && (e.editor.off("selectionUpdate", p), e.editor.off("update", p));
1393
+ e.editor && (e.editor.off("selectionUpdate", u), e.editor.off("update", u));
1350
1394
  });
1351
1395
  const h = (S) => {
1352
1396
  e.editor && (e.editor.chain().focus().setTextAlign(S).run(), o.value = S);
1353
- }, b = $([
1397
+ }, g = $([
1354
1398
  { id: "left", isActive: n },
1355
1399
  { id: "center", isActive: r },
1356
1400
  { id: "right", isActive: c },
1357
1401
  { id: "justify", isActive: i }
1358
1402
  ]);
1359
- return (S, j) => (g(), K(ce, {
1403
+ return (S, j) => (v(), K(ce, {
1360
1404
  ref_key: "popover",
1361
1405
  ref: a,
1362
1406
  placement: "bottom",
1363
1407
  onIsvisible: j[0] || (j[0] = (H) => s.value = H)
1364
1408
  }, {
1365
- reference: V(() => [
1409
+ reference: D(() => [
1366
1410
  d("button", {
1367
1411
  title: "Text Align",
1368
- class: T(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [y.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]])
1412
+ class: T(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [b.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]])
1369
1413
  }, [
1370
- (g(), K(Fe(l[o.value]), {
1414
+ (v(), K(Fe(l[o.value]), {
1371
1415
  height: "16",
1372
1416
  width: "16"
1373
1417
  }))
1374
1418
  ], 2)
1375
1419
  ]),
1376
- default: V(() => [
1377
- d("div", co, [
1378
- (g(!0), w(re, null, le(b.value, (H) => (g(), w("button", {
1420
+ default: D(() => [
1421
+ d("div", fo, [
1422
+ (v(!0), w(re, null, le(g.value, (H) => (v(), w("button", {
1379
1423
  title: "Text align " + H?.id,
1380
1424
  class: T(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": H?.isActive }]),
1381
1425
  key: H?.id,
1382
- onClick: (N) => h(H?.id)
1426
+ onClick: (z) => h(H?.id)
1383
1427
  }, [
1384
- (g(), K(Fe(l[H?.id]), {
1428
+ (v(), K(Fe(l[H?.id]), {
1385
1429
  height: "16",
1386
1430
  width: "16"
1387
1431
  }))
1388
- ], 10, uo))), 128))
1432
+ ], 10, po))), 128))
1389
1433
  ])
1390
1434
  ]),
1391
1435
  _: 1
1392
1436
  }, 512));
1393
1437
  }
1394
- }, po = { class: "flex flex-col gap-[2px] p-[2px]" }, go = ["onClick"], ho = {
1438
+ }, ho = { class: "flex flex-col gap-[2px] p-[2px]" }, vo = ["onClick"], mo = {
1395
1439
  __name: "vs-editor-type-tag",
1396
1440
  props: { editor: Object },
1397
1441
  setup(t) {
@@ -1407,13 +1451,13 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1407
1451
  { text: e("form.richtext.heading5"), id: 5, style: "font-[500] text-[16px]" },
1408
1452
  { text: e("form.richtext.heading6"), id: 6, style: "font-[400] text-[14px]" }
1409
1453
  ]);
1410
- return (r, i) => (g(), K(ce, {
1454
+ return (r, i) => (v(), K(ce, {
1411
1455
  ref_key: "popover",
1412
1456
  ref: a,
1413
1457
  placement: "bottom",
1414
- onIsvisible: i[0] || (i[0] = (y) => s.value = y)
1458
+ onIsvisible: i[0] || (i[0] = (b) => s.value = b)
1415
1459
  }, {
1416
- reference: V(() => [
1460
+ reference: D(() => [
1417
1461
  d("button", {
1418
1462
  title: "Type Tag",
1419
1463
  class: T(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [s.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]])
@@ -1421,26 +1465,26 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1421
1465
  C(k(Bt), { class: "h-4 w-4" })
1422
1466
  ], 2)
1423
1467
  ]),
1424
- default: V(() => [
1425
- d("div", po, [
1468
+ default: D(() => [
1469
+ d("div", ho, [
1426
1470
  d("button", {
1427
1471
  onClick: o,
1428
1472
  class: T(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded", [t.editor?.isActive("paragraph") ? "bg-gray-100" : ""]])
1429
1473
  }, W(k(e)("form.richtext.paragraph")), 3),
1430
- (g(!0), w(re, null, le(c.value, (y, p) => (g(), w("button", {
1431
- key: p,
1432
- onClick: (h) => n(y?.id),
1474
+ (v(!0), w(re, null, le(c.value, (b, u) => (v(), w("button", {
1475
+ key: u,
1476
+ onClick: (h) => n(b?.id),
1433
1477
  class: T(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]", [
1434
- y?.style,
1435
- t.editor?.isActive("heading", { level: y?.id }) ? "bg-gray-100" : ""
1478
+ b?.style,
1479
+ t.editor?.isActive("heading", { level: b?.id }) ? "bg-gray-100" : ""
1436
1480
  ]])
1437
- }, W(k(e)(`form.richtext.heading${y?.id}`)), 11, go))), 128))
1481
+ }, W(k(e)(`form.richtext.heading${b?.id}`)), 11, vo))), 128))
1438
1482
  ])
1439
1483
  ]),
1440
1484
  _: 1
1441
1485
  }, 512));
1442
1486
  }
1443
- }, vo = {
1487
+ }, bo = {
1444
1488
  components: { VsText: Qe },
1445
1489
  inheritAttrs: !1,
1446
1490
  events: ["update:modelValue"],
@@ -1460,19 +1504,19 @@ const Qe = /* @__PURE__ */ X(Or, [["render", Kr], ["__scopeId", "data-v-1e382a36
1460
1504
  }
1461
1505
  }
1462
1506
  }
1463
- }, mo = { class: "flex items-center w-full max-w-[182px]" }, bo = ["disabled"];
1464
- function yo(t, e, l, s, a, o) {
1507
+ }, yo = { class: "flex items-center w-full max-w-[182px]" }, xo = ["disabled"];
1508
+ function wo(t, e, l, s, a, o) {
1465
1509
  const n = G("vs-text");
1466
- return g(), w("div", mo, [
1510
+ return v(), w("div", yo, [
1467
1511
  ie(d("input", {
1468
1512
  "onUpdate:modelValue": e[0] || (e[0] = (c) => o.value = c),
1469
1513
  type: "color",
1470
1514
  class: T(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg", l.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
1471
1515
  disabled: l.disabled
1472
- }, null, 10, bo), [
1516
+ }, null, 10, xo), [
1473
1517
  [st, o.value]
1474
1518
  ]),
1475
- l.isTextInputShown ? (g(), K(n, {
1519
+ l.isTextInputShown ? (v(), K(n, {
1476
1520
  key: 0,
1477
1521
  modelValue: o.value,
1478
1522
  "onUpdate:modelValue": e[1] || (e[1] = (c) => o.value = c),
@@ -1482,7 +1526,7 @@ function yo(t, e, l, s, a, o) {
1482
1526
  }, null, 8, ["modelValue", "disabled", "clearable"])) : R("", !0)
1483
1527
  ]);
1484
1528
  }
1485
- const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px] mb-[8px]" }, wo = { class: "grid grid-rows-3 grid-cols-7" }, ko = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, _o = ["onClick", "title"], $o = {
1529
+ const Ze = /* @__PURE__ */ X(bo, [["render", wo]]), ko = { class: "flex gap-[4px] mb-[8px]" }, _o = { class: "grid grid-rows-3 grid-cols-7" }, $o = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Co = ["onClick", "title"], Ao = {
1486
1530
  __name: "vs-editor-color",
1487
1531
  props: {
1488
1532
  editor: Object
@@ -1518,11 +1562,11 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1518
1562
  "#FFF0B3",
1519
1563
  "#FFBDAD",
1520
1564
  "#EAE6FF"
1521
- ]), r = (p) => {
1522
- e.editor && (e.editor.chain().focus().setColor(p).run(), s.value = p, l.value && l.value.togglePopover());
1565
+ ]), r = (u) => {
1566
+ e.editor && (e.editor.chain().focus().setColor(u).run(), s.value = u, l.value && l.value.togglePopover());
1523
1567
  }, i = () => {
1524
1568
  r(s.value);
1525
- }, y = (p) => ({
1569
+ }, b = (u) => ({
1526
1570
  "#172B4D": "Default",
1527
1571
  "#0747A6": "Bright blue",
1528
1572
  "#008DA6": "Bright blue-green",
@@ -1544,13 +1588,13 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1544
1588
  "#FFF0B3": "Bright yellow",
1545
1589
  "#FFBDAD": "Bright red",
1546
1590
  "#EAE6FF": "Bright purple"
1547
- })[p] || p;
1548
- return (p, h) => (g(), K(ce, {
1591
+ })[u] || u;
1592
+ return (u, h) => (v(), K(ce, {
1549
1593
  ref_key: "popover",
1550
1594
  ref: l,
1551
1595
  placement: "bottom"
1552
1596
  }, {
1553
- reference: V(() => [
1597
+ reference: D(() => [
1554
1598
  d("button", {
1555
1599
  title: "Text Color",
1556
1600
  class: T(["flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100": o.value }])
@@ -1562,12 +1606,12 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1562
1606
  }, null, 4)
1563
1607
  ], 2)
1564
1608
  ]),
1565
- default: V(() => [
1609
+ default: D(() => [
1566
1610
  d("div", null, [
1567
- d("div", xo, [
1611
+ d("div", ko, [
1568
1612
  C(Ze, {
1569
1613
  modelValue: s.value,
1570
- "onUpdate:modelValue": h[0] || (h[0] = (b) => s.value = b)
1614
+ "onUpdate:modelValue": h[0] || (h[0] = (g) => s.value = g)
1571
1615
  }, null, 8, ["modelValue"]),
1572
1616
  d("button", {
1573
1617
  onClick: i,
@@ -1576,23 +1620,23 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1576
1620
  C(k(ve), { class: "h-4 w-4 text-white" })
1577
1621
  ])
1578
1622
  ]),
1579
- d("div", wo, [
1580
- (g(!0), w(re, null, le(c.value, (b) => (g(), w("div", {
1581
- key: b,
1623
+ d("div", _o, [
1624
+ (v(!0), w(re, null, le(c.value, (g) => (v(), w("div", {
1625
+ key: g,
1582
1626
  class: "h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"
1583
1627
  }, [
1584
- d("div", ko, [
1628
+ d("div", $o, [
1585
1629
  d("button", {
1586
1630
  class: "flex items-center justify-center w-full h-full",
1587
- style: ae({ backgroundColor: b }),
1588
- onClick: (S) => r(b),
1589
- title: y(b)
1631
+ style: ae({ backgroundColor: g }),
1632
+ onClick: (S) => r(g),
1633
+ title: b(g)
1590
1634
  }, [
1591
- s.value === b ? (g(), K(k(ve), {
1635
+ s.value === g ? (v(), K(k(ve), {
1592
1636
  key: 0,
1593
1637
  class: "h-4 w-4 text-gray-500"
1594
1638
  })) : R("", !0)
1595
- ], 12, _o)
1639
+ ], 12, Co)
1596
1640
  ])
1597
1641
  ]))), 128))
1598
1642
  ])
@@ -1601,7 +1645,7 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1601
1645
  _: 1
1602
1646
  }, 512));
1603
1647
  }
1604
- }, Co = { class: "flex gap-[4px] mb-[8px]" }, Ao = { class: "grid grid-rows-3 grid-cols-7" }, Fo = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, So = ["onClick", "title"], To = ["onClick", "title"], Lo = {
1648
+ }, Fo = { class: "flex gap-[4px] mb-[8px]" }, So = { class: "grid grid-rows-3 grid-cols-7" }, To = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Lo = ["onClick", "title"], Bo = ["onClick", "title"], Io = {
1605
1649
  __name: "vs-editor-background-color",
1606
1650
  props: {
1607
1651
  editor: Object
@@ -1637,11 +1681,11 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1637
1681
  "#FFF0B3",
1638
1682
  "#FFBDAD",
1639
1683
  "#EAE6FF"
1640
- ]), r = (p) => {
1641
- e.editor && (e.editor.chain().focus().setBackgroundColor(p).run(), s.value = p, l.value && l.value.togglePopover());
1684
+ ]), r = (u) => {
1685
+ e.editor && (e.editor.chain().focus().setBackgroundColor(u).run(), s.value = u, l.value && l.value.togglePopover());
1642
1686
  }, i = () => {
1643
1687
  r(s.value);
1644
- }, y = (p) => ({
1688
+ }, b = (u) => ({
1645
1689
  "#172B4D": "Default",
1646
1690
  "#0747A6": "Bright blue",
1647
1691
  "#008DA6": "Bright blue-green",
@@ -1663,13 +1707,13 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1663
1707
  "#FFF0B3": "Bright yellow",
1664
1708
  "#FFBDAD": "Bright red",
1665
1709
  "#EAE6FF": "Bright purple"
1666
- })[p] || p;
1667
- return (p, h) => (g(), K(ce, {
1710
+ })[u] || u;
1711
+ return (u, h) => (v(), K(ce, {
1668
1712
  ref_key: "popover",
1669
1713
  ref: l,
1670
1714
  placement: "bottom"
1671
1715
  }, {
1672
- reference: V(() => [
1716
+ reference: D(() => [
1673
1717
  d("button", {
1674
1718
  title: "Background Color",
1675
1719
  class: T(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100": o.value }])
@@ -1681,12 +1725,12 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1681
1725
  }, null, 4)
1682
1726
  ], 2)
1683
1727
  ]),
1684
- default: V(() => [
1728
+ default: D(() => [
1685
1729
  d("div", null, [
1686
- d("div", Co, [
1730
+ d("div", Fo, [
1687
1731
  C(Ze, {
1688
1732
  modelValue: s.value,
1689
- "onUpdate:modelValue": h[0] || (h[0] = (b) => s.value = b)
1733
+ "onUpdate:modelValue": h[0] || (h[0] = (g) => s.value = g)
1690
1734
  }, null, 8, ["modelValue"]),
1691
1735
  d("button", {
1692
1736
  onClick: i,
@@ -1695,42 +1739,42 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1695
1739
  C(k(ve), { class: "h-4 w-4 text-white" })
1696
1740
  ])
1697
1741
  ]),
1698
- d("div", Ao, [
1742
+ d("div", So, [
1699
1743
  d("button", {
1700
- onClick: h[1] || (h[1] = (b) => r("transparent")),
1744
+ onClick: h[1] || (h[1] = (g) => r("transparent")),
1701
1745
  class: "col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"
1702
1746
  }, [
1703
1747
  C(k(It), { class: "h-4 w-4" }),
1704
1748
  h[2] || (h[2] = d("p", null, "no color", -1))
1705
1749
  ]),
1706
- (g(!0), w(re, null, le(c.value, (b) => (g(), w("div", {
1707
- key: b,
1750
+ (v(!0), w(re, null, le(c.value, (g) => (v(), w("div", {
1751
+ key: g,
1708
1752
  class: "h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"
1709
1753
  }, [
1710
- d("div", Fo, [
1711
- b !== "transparent" ? (g(), w("button", {
1754
+ d("div", To, [
1755
+ g !== "transparent" ? (v(), w("button", {
1712
1756
  key: 0,
1713
1757
  class: "flex items-center justify-center w-full h-full",
1714
- style: ae({ backgroundColor: b }),
1715
- onClick: (S) => r(b),
1716
- title: y(b)
1758
+ style: ae({ backgroundColor: g }),
1759
+ onClick: (S) => r(g),
1760
+ title: b(g)
1717
1761
  }, [
1718
- s.value === b ? (g(), K(k(ve), {
1762
+ s.value === g ? (v(), K(k(ve), {
1719
1763
  key: 0,
1720
1764
  class: "h-4 w-4 text-gray-500"
1721
1765
  })) : R("", !0)
1722
- ], 12, So)) : R("", !0),
1723
- b === "transparent" ? (g(), w("button", {
1766
+ ], 12, Lo)) : R("", !0),
1767
+ g === "transparent" ? (v(), w("button", {
1724
1768
  key: 1,
1725
1769
  class: "flex items-center justify-center w-full h-full",
1726
- onClick: (S) => r(b),
1727
- title: y(b)
1770
+ onClick: (S) => r(g),
1771
+ title: b(g)
1728
1772
  }, [
1729
- s.value === b ? (g(), K(k(ve), {
1773
+ s.value === g ? (v(), K(k(ve), {
1730
1774
  key: 0,
1731
1775
  class: "h-4 w-4 text-gray-500"
1732
1776
  })) : R("", !0)
1733
- ], 8, To)) : R("", !0)
1777
+ ], 8, Bo)) : R("", !0)
1734
1778
  ])
1735
1779
  ]))), 128))
1736
1780
  ])
@@ -1739,7 +1783,7 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1739
1783
  _: 1
1740
1784
  }, 512));
1741
1785
  }
1742
- }, Bo = {
1786
+ }, Eo = {
1743
1787
  __name: "vs-editor-highlight",
1744
1788
  props: {
1745
1789
  editor: Object
@@ -1748,7 +1792,7 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1748
1792
  const e = t, l = P(() => e.editor?.isActive("highlight")), s = () => {
1749
1793
  e.editor && e.editor.chain().focus().toggleHighlight().run();
1750
1794
  };
1751
- return (a, o) => (g(), w("button", {
1795
+ return (a, o) => (v(), w("button", {
1752
1796
  title: "Highlight",
1753
1797
  onClick: s,
1754
1798
  class: T(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-200": l.value }])
@@ -1756,7 +1800,7 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1756
1800
  C(k(jt), { class: "h-4 w-4" })
1757
1801
  ], 2));
1758
1802
  }
1759
- }, Io = { class: "truncate" }, Eo = { class: "w-[200px]" }, jo = { class: "max-h-[200px] overflow-y-auto" }, Po = ["onClick"], Mo = {
1803
+ }, jo = { class: "truncate" }, Po = { class: "w-[200px]" }, Mo = { class: "max-h-[200px] overflow-y-auto" }, Ho = ["onClick"], No = {
1760
1804
  __name: "vs-editor-font-family",
1761
1805
  props: {
1762
1806
  editor: Object
@@ -1779,41 +1823,41 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1779
1823
  if (e.editor.isActive("textStyle", { fontFamily: i.value }))
1780
1824
  return i.value;
1781
1825
  return "Arial, sans-serif";
1782
- }), n = P(() => a.value.find((y) => y.value === o.value)?.label || "Arial"), c = (i) => e.editor ? e.editor.isActive("textStyle", { fontFamily: i }) : !1, r = (i) => {
1826
+ }), n = P(() => a.value.find((b) => b.value === o.value)?.label || "Arial"), c = (i) => e.editor ? e.editor.isActive("textStyle", { fontFamily: i }) : !1, r = (i) => {
1783
1827
  e.editor && (e.editor.chain().focus().setFontFamily(i).run(), l.value && l.value.togglePopover());
1784
1828
  };
1785
- return (i, y) => (g(), K(ce, {
1829
+ return (i, b) => (v(), K(ce, {
1786
1830
  ref_key: "popover",
1787
1831
  ref: l,
1788
1832
  placement: "bottom",
1789
- onIsvisible: y[0] || (y[0] = (p) => s.value = p)
1833
+ onIsvisible: b[0] || (b[0] = (u) => s.value = u)
1790
1834
  }, {
1791
- reference: V(() => [
1835
+ reference: D(() => [
1792
1836
  d("button", {
1793
1837
  title: "Font Family",
1794
1838
  class: T(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm", [s.value ? "bg-gray-100 text-gray-900" : "text-gray-700"]]),
1795
1839
  style: ae({ fontFamily: o.value })
1796
1840
  }, [
1797
- d("span", Io, W(n.value), 1),
1841
+ d("span", jo, W(n.value), 1),
1798
1842
  C(k(Le), { class: "ml-1 h-3 w-3 text-gray-400" })
1799
1843
  ], 6)
1800
1844
  ]),
1801
- default: V(() => [
1802
- d("div", Eo, [
1803
- d("ul", jo, [
1804
- (g(!0), w(re, null, le(a.value, (p) => (g(), w("li", {
1805
- key: p.value,
1806
- class: T(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", { "bg-gray-100": c(p.value) }]),
1807
- style: ae({ fontFamily: p.value }),
1808
- onClick: (h) => r(p.value)
1809
- }, W(p.label), 15, Po))), 128))
1845
+ default: D(() => [
1846
+ d("div", Po, [
1847
+ d("ul", Mo, [
1848
+ (v(!0), w(re, null, le(a.value, (u) => (v(), w("li", {
1849
+ key: u.value,
1850
+ class: T(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", { "bg-gray-100": c(u.value) }]),
1851
+ style: ae({ fontFamily: u.value }),
1852
+ onClick: (h) => r(u.value)
1853
+ }, W(u.label), 15, Ho))), 128))
1810
1854
  ])
1811
1855
  ])
1812
1856
  ]),
1813
1857
  _: 1
1814
1858
  }, 512));
1815
1859
  }
1816
- }, Ho = { class: "w-[120px]" }, zo = { class: "max-h-[200px] overflow-y-auto" }, No = ["onClick"], Vo = {
1860
+ }, zo = { class: "w-[120px]" }, Do = { class: "max-h-[200px] overflow-y-auto" }, Oo = ["onClick"], Vo = {
1817
1861
  __name: "vs-editor-font-size",
1818
1862
  props: {
1819
1863
  editor: Object
@@ -1846,12 +1890,12 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1846
1890
  ]), r = (i) => {
1847
1891
  e.editor && (e.editor.chain().focus().setFontSize(i).run(), s.value = i, l.value && l.value.togglePopover());
1848
1892
  };
1849
- return (i, y) => (g(), K(ce, {
1893
+ return (i, b) => (v(), K(ce, {
1850
1894
  ref_key: "popover",
1851
1895
  ref: l,
1852
1896
  placement: "bottom"
1853
1897
  }, {
1854
- reference: V(() => [
1898
+ reference: D(() => [
1855
1899
  d("button", {
1856
1900
  title: "Font Size",
1857
1901
  class: T(["h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1", { "bg-gray-100 text-gray-900": o.value }])
@@ -1860,21 +1904,21 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1860
1904
  C(k(Le), { class: "h-3 w-3 text-gray-400" })
1861
1905
  ], 2)
1862
1906
  ]),
1863
- default: V(() => [
1864
- d("div", Ho, [
1865
- d("ul", zo, [
1866
- (g(!0), w(re, null, le(c.value, (p) => (g(), w("li", {
1867
- key: p.value,
1907
+ default: D(() => [
1908
+ d("div", zo, [
1909
+ d("ul", Do, [
1910
+ (v(!0), w(re, null, le(c.value, (u) => (v(), w("li", {
1911
+ key: u.value,
1868
1912
  class: "px-3 py-2 hover:bg-gray-100 cursor-pointer",
1869
- onClick: (h) => r(p.value)
1870
- }, W(p.label), 9, No))), 128))
1913
+ onClick: (h) => r(u.value)
1914
+ }, W(u.label), 9, Oo))), 128))
1871
1915
  ])
1872
1916
  ])
1873
1917
  ]),
1874
1918
  _: 1
1875
1919
  }, 512));
1876
1920
  }
1877
- }, Do = {
1921
+ }, Ro = {
1878
1922
  components: { Superscript: Mt },
1879
1923
  props: {
1880
1924
  editor: Object
@@ -1885,9 +1929,9 @@ const Ze = /* @__PURE__ */ X(vo, [["render", yo]]), xo = { class: "flex gap-[4px
1885
1929
  }
1886
1930
  }
1887
1931
  };
1888
- function Oo(t, e, l, s, a, o) {
1932
+ function Uo(t, e, l, s, a, o) {
1889
1933
  const n = G("Superscript");
1890
- return g(), w("button", {
1934
+ return v(), w("button", {
1891
1935
  title: "Superscript",
1892
1936
  onClick: e[0] || (e[0] = (...c) => o.toggleSuperscript && o.toggleSuperscript(...c)),
1893
1937
  class: T(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": l.editor?.isActive("superscript") }])
@@ -1896,7 +1940,7 @@ function Oo(t, e, l, s, a, o) {
1896
1940
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Superscript", -1))
1897
1941
  ], 2);
1898
1942
  }
1899
- const Ro = /* @__PURE__ */ X(Do, [["render", Oo]]), Uo = {
1943
+ const qo = /* @__PURE__ */ X(Ro, [["render", Uo]]), Ko = {
1900
1944
  components: { Subscript: Ht },
1901
1945
  props: {
1902
1946
  editor: Object
@@ -1907,9 +1951,9 @@ const Ro = /* @__PURE__ */ X(Do, [["render", Oo]]), Uo = {
1907
1951
  }
1908
1952
  }
1909
1953
  };
1910
- function qo(t, e, l, s, a, o) {
1954
+ function Wo(t, e, l, s, a, o) {
1911
1955
  const n = G("Subscript");
1912
- return g(), w("button", {
1956
+ return v(), w("button", {
1913
1957
  title: "Subscript",
1914
1958
  onClick: e[0] || (e[0] = (...c) => o.toggleSubscript && o.toggleSubscript(...c)),
1915
1959
  class: T(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": l.editor?.isActive("subscript") }])
@@ -1918,10 +1962,10 @@ function qo(t, e, l, s, a, o) {
1918
1962
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Subscript", -1))
1919
1963
  ], 2);
1920
1964
  }
1921
- const Ko = /* @__PURE__ */ X(Uo, [["render", qo]]), Wo = {
1965
+ const Xo = /* @__PURE__ */ X(Ko, [["render", Wo]]), Go = {
1922
1966
  title: "Heading",
1923
1967
  class: "h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"
1924
- }, Xo = { class: "truncate" }, Go = { class: "max-h-[200px] overflow-y-auto" }, Yo = ["onClick"], Qo = {
1968
+ }, Yo = { class: "truncate" }, Qo = { class: "max-h-[200px] overflow-y-auto" }, Zo = ["onClick"], Jo = {
1925
1969
  __name: "vs-editor-heading",
1926
1970
  props: {
1927
1971
  editor: Object
@@ -1952,26 +1996,26 @@ const Ko = /* @__PURE__ */ X(Uo, [["render", qo]]), Wo = {
1952
1996
  }, c = () => {
1953
1997
  e.editor && (e.editor.chain().focus().setParagraph().run(), l.value && l.value.togglePopover());
1954
1998
  };
1955
- return (r, i) => (g(), K(ce, {
1999
+ return (r, i) => (v(), K(ce, {
1956
2000
  ref_key: "popover",
1957
2001
  ref: l,
1958
2002
  placement: "bottom"
1959
2003
  }, {
1960
- reference: V(() => [
1961
- d("button", Wo, [
1962
- d("span", Xo, W(a.value), 1),
2004
+ reference: D(() => [
2005
+ d("button", Go, [
2006
+ d("span", Yo, W(a.value), 1),
1963
2007
  C(k(Le), { class: "ml-1 h-3 w-3 text-gray-400" })
1964
2008
  ])
1965
2009
  ]),
1966
- default: V(() => [
2010
+ default: D(() => [
1967
2011
  d("div", null, [
1968
- d("ul", Go, [
1969
- (g(!0), w(re, null, le(s.value, (y) => (g(), w("li", {
1970
- key: y.value,
1971
- class: T(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", `heading-level-${y.value}`]),
1972
- style: ae(o(y.value)),
1973
- onClick: (p) => n(y.value)
1974
- }, W(y.label), 15, Yo))), 128)),
2012
+ d("ul", Qo, [
2013
+ (v(!0), w(re, null, le(s.value, (b) => (v(), w("li", {
2014
+ key: b.value,
2015
+ class: T(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", `heading-level-${b.value}`]),
2016
+ style: ae(o(b.value)),
2017
+ onClick: (u) => n(b.value)
2018
+ }, W(b.label), 15, Zo))), 128)),
1975
2019
  d("li", {
1976
2020
  class: "px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",
1977
2021
  onClick: c
@@ -1982,8 +2026,8 @@ const Ko = /* @__PURE__ */ X(Uo, [["render", qo]]), Wo = {
1982
2026
  _: 1
1983
2027
  }, 512));
1984
2028
  }
1985
- }, Zo = /* @__PURE__ */ X(Qo, [["__scopeId", "data-v-46380488"]]), Jo = {
1986
- components: { RemoveFormatting: zt },
2029
+ }, el = /* @__PURE__ */ X(Jo, [["__scopeId", "data-v-46380488"]]), tl = {
2030
+ components: { RemoveFormatting: Nt },
1987
2031
  props: {
1988
2032
  editor: Object
1989
2033
  },
@@ -1993,9 +2037,9 @@ const Ko = /* @__PURE__ */ X(Uo, [["render", qo]]), Wo = {
1993
2037
  }
1994
2038
  }
1995
2039
  };
1996
- function el(t, e, l, s, a, o) {
2040
+ function rl(t, e, l, s, a, o) {
1997
2041
  const n = G("RemoveFormatting");
1998
- return g(), w("button", {
2042
+ return v(), w("button", {
1999
2043
  title: "Clear Formatting",
2000
2044
  onClick: e[0] || (e[0] = (...c) => o.clearFormatting && o.clearFormatting(...c)),
2001
2045
  class: "h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100"
@@ -2004,16 +2048,16 @@ function el(t, e, l, s, a, o) {
2004
2048
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Clear Formatting", -1))
2005
2049
  ]);
2006
2050
  }
2007
- const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" }, ol = {
2051
+ const ol = /* @__PURE__ */ X(tl, [["render", rl]]), ll = { class: "relative" }, al = {
2008
2052
  key: 0,
2009
2053
  class: "mt-4"
2010
- }, ll = ["src", "alt", "title"], al = {
2054
+ }, sl = ["src", "alt", "title"], nl = {
2011
2055
  key: 0,
2012
2056
  class: "text-sm text-red-500"
2013
- }, sl = {
2057
+ }, il = {
2014
2058
  key: 1,
2015
2059
  class: "mt-4"
2016
- }, nl = { class: "text-sm text-gray-600 mb-2" }, il = { class: "flex flex-wrap gap-2" }, cl = ["src", "alt", "onError"], dl = ["onClick"], ul = { class: "flex justify-end gap-x-2 p-[20px]" }, fl = /* @__PURE__ */ Object.assign({
2060
+ }, cl = { class: "text-sm text-gray-600 mb-2" }, dl = { class: "flex flex-wrap gap-2" }, ul = ["src", "alt", "onError"], fl = ["onClick"], pl = { class: "flex justify-end gap-x-2 p-[20px]" }, gl = /* @__PURE__ */ Object.assign({
2017
2061
  inheritAttrs: !1
2018
2062
  }, {
2019
2063
  __name: "vs-editor-image",
@@ -2036,22 +2080,22 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2036
2080
  openInNewTab: !1
2037
2081
  }), i = P(() => {
2038
2082
  if (Array.isArray(r.value.file)) {
2039
- const f = r.value.file.filter((_) => _ instanceof File), m = r.value.file.filter((_) => typeof _ == "string" && _.trim() !== "");
2040
- return f.length + m.length > 1;
2083
+ const p = r.value.file.filter((_) => _ instanceof File), y = r.value.file.filter((_) => typeof _ == "string" && _.trim() !== "");
2084
+ return p.length + y.length > 1;
2041
2085
  }
2042
2086
  return r.value.file instanceof FileList ? r.value.file.length > 1 : !1;
2043
- }), y = P(() => Array.isArray(r.value.file) ? r.value.file.filter((f) => f instanceof File).length === 1 : r.value.file instanceof FileList ? r.value.file.length === 1 : r.value.file instanceof File), p = P(() => {
2087
+ }), b = P(() => Array.isArray(r.value.file) ? r.value.file.filter((p) => p instanceof File).length === 1 : r.value.file instanceof FileList ? r.value.file.length === 1 : r.value.file instanceof File), u = P(() => {
2044
2088
  if (i.value)
2045
2089
  return "";
2046
2090
  if (r.value.src)
2047
2091
  return r.value.src;
2048
- if (y.value) {
2049
- let f = null;
2050
- if (Array.isArray(r.value.file) || r.value.file instanceof FileList ? f = r.value.file[0] : r.value.file instanceof File && (f = r.value.file), f instanceof File) {
2051
- const m = n.value.find((u) => u.file === f);
2052
- return m ? m.preview : "";
2053
- } else if (typeof f == "string")
2054
- return f;
2092
+ if (b.value) {
2093
+ let p = null;
2094
+ if (Array.isArray(r.value.file) || r.value.file instanceof FileList ? p = r.value.file[0] : r.value.file instanceof File && (p = r.value.file), p instanceof File) {
2095
+ const y = n.value.find((f) => f.file === p);
2096
+ return y ? y.preview : "";
2097
+ } else if (typeof p == "string")
2098
+ return p;
2055
2099
  }
2056
2100
  return "";
2057
2101
  }), h = P(() => [
@@ -2116,20 +2160,20 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2116
2160
  type: "switcher",
2117
2161
  required: !1
2118
2162
  }
2119
- ]), b = () => {
2163
+ ]), g = () => {
2120
2164
  if (!e.editor) return;
2121
2165
  if (e.editor.isActive("image")) {
2122
- const { state: m } = e.editor, { selection: u } = m, { $from: _ } = u;
2166
+ const { state: y } = e.editor, { selection: f } = y, { $from: _ } = f;
2123
2167
  let x = null, B = null;
2124
2168
  if (_.parent.type.name === "image")
2125
2169
  x = _.before(_.depth), B = _.parent;
2126
2170
  else
2127
2171
  for (let M = _.depth; M > 0; M--) {
2128
- const Q = _.node(M), O = _.before(M);
2172
+ const Q = _.node(M), V = _.before(M);
2129
2173
  Q.type.name === "paragraph" && Q.forEach((de, $e) => {
2130
2174
  if (de.type.name === "image") {
2131
- const je = O + $e + 1;
2132
- (x === null || Math.abs(je - u.$from.pos) < Math.abs(x - u.$from.pos)) && (x = je, B = de);
2175
+ const je = V + $e + 1;
2176
+ (x === null || Math.abs(je - f.$from.pos) < Math.abs(x - f.$from.pos)) && (x = je, B = de);
2133
2177
  }
2134
2178
  });
2135
2179
  }
@@ -2145,20 +2189,20 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2145
2189
  const { state: M } = e.editor;
2146
2190
  c.value = M.selection.$from.pos;
2147
2191
  }
2148
- const v = B ? B.attrs : e.editor.getAttributes("image");
2192
+ const m = B ? B.attrs : e.editor.getAttributes("image");
2149
2193
  o.value = !0;
2150
2194
  let A = "", I = !1;
2151
- const z = e.editor.getAttributes("link");
2152
- z && z.href && (A = z.href, I = z.target === "_blank");
2153
- const E = v.src || "", F = E ? [E] : [];
2195
+ const N = e.editor.getAttributes("link");
2196
+ N && N.href && (A = N.href, I = N.target === "_blank");
2197
+ const E = m.src || "", F = E ? [E] : [];
2154
2198
  r.value = {
2155
2199
  src: E,
2156
2200
  file: F,
2157
2201
  // Масив з поточним зображенням
2158
- alt: v.alt || "",
2159
- title: v.title || "",
2160
- width: v.width || "",
2161
- height: v.height || "",
2202
+ alt: m.alt || "",
2203
+ title: m.title || "",
2204
+ width: m.width || "",
2205
+ height: m.height || "",
2162
2206
  link: A,
2163
2207
  openInNewTab: I
2164
2208
  };
@@ -2187,38 +2231,38 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2187
2231
  link: "",
2188
2232
  openInNewTab: !1
2189
2233
  };
2190
- }, j = async (f) => {
2191
- if (!f || f.length === 0)
2234
+ }, j = async (p) => {
2235
+ if (!p || p.length === 0)
2192
2236
  return;
2193
- const m = [];
2194
- for (const u of f)
2195
- if (u && u.type && u.type.startsWith("image/") && !n.value.some((x) => x.file === u)) {
2196
- const x = new Promise((B, v) => {
2237
+ const y = [];
2238
+ for (const f of p)
2239
+ if (f && f.type && f.type.startsWith("image/") && !n.value.some((x) => x.file === f)) {
2240
+ const x = new Promise((B, m) => {
2197
2241
  const A = new FileReader();
2198
2242
  A.onload = (I) => {
2199
2243
  n.value.push({
2200
- file: u,
2244
+ file: f,
2201
2245
  preview: I.target.result,
2202
2246
  error: !1
2203
2247
  }), B();
2204
- }, A.onerror = v, A.readAsDataURL(u);
2248
+ }, A.onerror = m, A.readAsDataURL(f);
2205
2249
  });
2206
- m.push(x);
2250
+ y.push(x);
2207
2251
  }
2208
- await Promise.all(m);
2209
- }, H = (f) => {
2210
- n.value.splice(f, 1), Array.isArray(r.value.file) && r.value.file.splice(f, 1);
2211
- }, N = () => {
2212
- const f = r.value.width !== null && r.value.width !== void 0 && r.value.width !== "" && String(r.value.width).trim() !== "" ? String(r.value.width).trim() : "", m = r.value.height !== null && r.value.height !== void 0 && r.value.height !== "" && String(r.value.height).trim() !== "" ? String(r.value.height).trim() : "", u = {};
2213
- return f && m ? (u.width = f, u.height = m, u.style = `width: ${f}px; height: ${m}px; object-fit: fill;`) : f ? (u.width = f, u.height = void 0) : m ? (u.height = m, u.width = void 0) : (u.width = void 0, u.height = void 0), u;
2214
- }, q = (f, m = null, u = 50) => {
2252
+ await Promise.all(y);
2253
+ }, H = (p) => {
2254
+ n.value.splice(p, 1), Array.isArray(r.value.file) && r.value.file.splice(p, 1);
2255
+ }, z = () => {
2256
+ const p = r.value.width !== null && r.value.width !== void 0 && r.value.width !== "" && String(r.value.width).trim() !== "" ? String(r.value.width).trim() : "", y = r.value.height !== null && r.value.height !== void 0 && r.value.height !== "" && String(r.value.height).trim() !== "" ? String(r.value.height).trim() : "", f = {};
2257
+ return p && y ? (f.width = p, f.height = y, f.style = `width: ${p}px; height: ${y}px; object-fit: fill;`) : p ? (f.width = p, f.height = void 0) : y ? (f.height = y, f.width = void 0) : (f.width = void 0, f.height = void 0), f;
2258
+ }, q = (p, y = null, f = 50) => {
2215
2259
  const _ = () => {
2216
- const { view: v } = f;
2217
- if (!v || !v.dom) return;
2218
- v.dom.querySelectorAll("img.editor-image[width][height]").forEach((z) => {
2219
- if (z instanceof HTMLImageElement) {
2220
- const E = z.getAttribute("width"), F = z.getAttribute("height");
2221
- E && F && E !== "auto" && F !== "auto" && E !== "" && F !== "" && !isNaN(Number(E)) && !isNaN(Number(F)) && (z.style.cssText = `
2260
+ const { view: m } = p;
2261
+ if (!m || !m.dom) return;
2262
+ m.dom.querySelectorAll("img.editor-image[width][height]").forEach((N) => {
2263
+ if (N instanceof HTMLImageElement) {
2264
+ const E = N.getAttribute("width"), F = N.getAttribute("height");
2265
+ E && F && E !== "auto" && F !== "auto" && E !== "" && F !== "" && !isNaN(Number(E)) && !isNaN(Number(F)) && (N.style.cssText = `
2222
2266
  width: ${E}px !important;
2223
2267
  height: ${F}px !important;
2224
2268
  max-width: none !important;
@@ -2230,34 +2274,34 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2230
2274
  }
2231
2275
  });
2232
2276
  }, x = r.value.width, B = r.value.height;
2233
- x && B && x !== "" && B !== "" ? [0, u, u * 2, u * 3, u * 4].forEach((A) => {
2277
+ x && B && x !== "" && B !== "" ? [0, f, f * 2, f * 3, f * 4].forEach((A) => {
2234
2278
  setTimeout(_, A);
2235
- }) : (_(), setTimeout(_, u));
2279
+ }) : (_(), setTimeout(_, f));
2236
2280
  }, L = async () => {
2237
- let f = [], m = [];
2238
- if (Array.isArray(r.value.file) ? (f = r.value.file.filter((v) => v instanceof File), m = r.value.file.filter((v) => typeof v == "string" && v.trim() !== "")) : r.value.file instanceof FileList ? f = Array.from(r.value.file) : r.value.file instanceof File ? f = [r.value.file] : typeof r.value.file == "string" && r.value.file.trim() !== "" && (m = [r.value.file]), f.length === 0 && m.length === 0 && a.value && a.value.file) {
2239
- const v = a.value.file;
2240
- Array.isArray(v) ? (f = v.filter((A) => A instanceof File), m = v.filter((A) => typeof A == "string" && A.trim() !== "")) : v instanceof FileList ? f = Array.from(v) : v instanceof File ? f = [v] : typeof v == "string" && v.trim() !== "" && (m = [v]);
2281
+ let p = [], y = [];
2282
+ if (Array.isArray(r.value.file) ? (p = r.value.file.filter((m) => m instanceof File), y = r.value.file.filter((m) => typeof m == "string" && m.trim() !== "")) : r.value.file instanceof FileList ? p = Array.from(r.value.file) : r.value.file instanceof File ? p = [r.value.file] : typeof r.value.file == "string" && r.value.file.trim() !== "" && (y = [r.value.file]), p.length === 0 && y.length === 0 && a.value && a.value.file) {
2283
+ const m = a.value.file;
2284
+ Array.isArray(m) ? (p = m.filter((A) => A instanceof File), y = m.filter((A) => typeof A == "string" && A.trim() !== "")) : m instanceof FileList ? p = Array.from(m) : m instanceof File ? p = [m] : typeof m == "string" && m.trim() !== "" && (y = [m]);
2241
2285
  }
2242
- if (m.length > 0 && !o.value) {
2243
- for (const v of m)
2244
- n.value.some((A) => A.url === v) || n.value.push({
2245
- url: v,
2246
- preview: v,
2286
+ if (y.length > 0 && !o.value) {
2287
+ for (const m of y)
2288
+ n.value.some((A) => A.url === m) || n.value.push({
2289
+ url: m,
2290
+ preview: m,
2247
2291
  error: !1
2248
2292
  });
2249
- if (f.length === 0 && n.value.length > 0) {
2293
+ if (p.length === 0 && n.value.length > 0) {
2250
2294
  await oe();
2251
2295
  return;
2252
2296
  }
2253
2297
  }
2254
- const u = f.length, _ = u + m.length;
2255
- if (!(o.value && u <= 1)) {
2256
- if (u > 0) {
2257
- const v = f.filter(
2298
+ const f = p.length, _ = f + y.length;
2299
+ if (!(o.value && f <= 1)) {
2300
+ if (f > 0) {
2301
+ const m = p.filter(
2258
2302
  (A) => !n.value.some((I) => I.file === A)
2259
2303
  );
2260
- v.length > 0 && await j(v);
2304
+ m.length > 0 && await j(m);
2261
2305
  }
2262
2306
  }
2263
2307
  if (!o.value) {
@@ -2265,12 +2309,12 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2265
2309
  if (n.value.length > 0) {
2266
2310
  await oe();
2267
2311
  return;
2268
- } else if (u > 0) {
2269
- if (await j(f), n.value.length > 0) {
2312
+ } else if (f > 0) {
2313
+ if (await j(p), n.value.length > 0) {
2270
2314
  await oe();
2271
2315
  return;
2272
2316
  }
2273
- } else if (m.length > 0) {
2317
+ } else if (y.length > 0) {
2274
2318
  await oe();
2275
2319
  return;
2276
2320
  }
@@ -2280,12 +2324,12 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2280
2324
  }
2281
2325
  }
2282
2326
  let x = r.value.src;
2283
- if (y.value) {
2284
- let v = null;
2285
- if (Array.isArray(r.value.file) || r.value.file instanceof FileList ? v = r.value.file[0] : (r.value.file instanceof File || typeof r.value.file == "string") && (v = r.value.file), v instanceof File)
2327
+ if (b.value) {
2328
+ let m = null;
2329
+ if (Array.isArray(r.value.file) || r.value.file instanceof FileList ? m = r.value.file[0] : (r.value.file instanceof File || typeof r.value.file == "string") && (m = r.value.file), m instanceof File)
2286
2330
  try {
2287
- const A = new FileReader(), I = await new Promise((z, E) => {
2288
- A.onload = (F) => z(F.target.result), A.onerror = E, A.readAsDataURL(v);
2331
+ const A = new FileReader(), I = await new Promise((N, E) => {
2332
+ A.onload = (F) => N(F.target.result), A.onerror = E, A.readAsDataURL(m);
2289
2333
  });
2290
2334
  x = I, o.value && (r.value.src = I);
2291
2335
  } catch (A) {
@@ -2296,12 +2340,12 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2296
2340
  });
2297
2341
  return;
2298
2342
  }
2299
- else typeof v == "string" && v.trim() !== "" && (x = v.trim(), o.value && v.trim() !== r.value.src && (r.value.src = v.trim(), x = v.trim()));
2343
+ else typeof m == "string" && m.trim() !== "" && (x = m.trim(), o.value && m.trim() !== r.value.src && (r.value.src = m.trim(), x = m.trim()));
2300
2344
  } else if (Array.isArray(r.value.file) && r.value.file.length === 1) {
2301
- const v = r.value.file[0];
2302
- typeof v == "string" && v.trim() !== "" && (x = v.trim(), (!r.value.src || r.value.src !== v.trim()) && (r.value.src = v.trim()));
2345
+ const m = r.value.file[0];
2346
+ typeof m == "string" && m.trim() !== "" && (x = m.trim(), (!r.value.src || r.value.src !== m.trim()) && (r.value.src = m.trim()));
2303
2347
  } else typeof r.value.file == "string" && r.value.file.trim() !== "" && (x = r.value.file.trim(), (!r.value.src || r.value.src !== r.value.file.trim()) && (r.value.src = r.value.file.trim()));
2304
- const B = x || Array.isArray(r.value.file) && r.value.file.length > 0 && (r.value.file.some((v) => v instanceof File) || r.value.file.some((v) => typeof v == "string" && v.trim() !== "")) || r.value.file instanceof FileList && r.value.file.length > 0 || typeof r.value.file == "string" && r.value.file.trim() !== "";
2348
+ const B = x || Array.isArray(r.value.file) && r.value.file.length > 0 && (r.value.file.some((m) => m instanceof File) || r.value.file.some((m) => typeof m == "string" && m.trim() !== "")) || r.value.file instanceof FileList && r.value.file.length > 0 || typeof r.value.file == "string" && r.value.file.trim() !== "";
2305
2349
  if (!x && !B) {
2306
2350
  we({
2307
2351
  type: "warning",
@@ -2320,25 +2364,25 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2320
2364
  }
2321
2365
  if (e.editor && x)
2322
2366
  if (o.value && c.value !== null) {
2323
- const { state: v } = e.editor;
2367
+ const { state: m } = e.editor;
2324
2368
  try {
2325
2369
  e.editor.chain().focus().setNodeSelection(c.value).run();
2326
2370
  } catch {
2327
2371
  e.editor.chain().focus().setTextSelection(c.value).run();
2328
2372
  }
2329
- const A = e.editor.getAttributes("link"), I = A && A.href, z = N(), E = {
2373
+ const A = e.editor.getAttributes("link"), I = A && A.href, N = z(), E = {
2330
2374
  src: x,
2331
2375
  alt: r.value.alt || "",
2332
2376
  title: r.value.title || "",
2333
- ...z
2377
+ ...N
2334
2378
  };
2335
2379
  if ((!r.value.width || r.value.width === "") && (E.width = void 0), (!r.value.height || r.value.height === "") && (E.height = void 0), e.editor.chain().focus().updateAttributes("image", E).run(), setTimeout(() => {
2336
2380
  const { view: F } = e.editor;
2337
2381
  if (!F || !F.dom) return;
2338
- F.dom.querySelectorAll("img.editor-image").forEach((O) => {
2339
- if (O instanceof HTMLImageElement) {
2340
- const de = O.getAttribute("src") || O.src;
2341
- (de === x || de.includes(x.split("/").pop())) && (r.value.width && r.value.height ? (O.style.setProperty("width", `${r.value.width}px`, "important"), O.style.setProperty("height", `${r.value.height}px`, "important"), O.style.setProperty("object-fit", "fill", "important"), O.style.setProperty("max-width", "none", "important"), O.style.setProperty("max-height", "none", "important")) : (O.style.removeProperty("width"), O.style.removeProperty("height"), O.style.removeProperty("object-fit"), O.style.removeProperty("max-width"), O.style.removeProperty("max-height")));
2382
+ F.dom.querySelectorAll("img.editor-image").forEach((V) => {
2383
+ if (V instanceof HTMLImageElement) {
2384
+ const de = V.getAttribute("src") || V.src;
2385
+ (de === x || de.includes(x.split("/").pop())) && (r.value.width && r.value.height ? (V.style.setProperty("width", `${r.value.width}px`, "important"), V.style.setProperty("height", `${r.value.height}px`, "important"), V.style.setProperty("object-fit", "fill", "important"), V.style.setProperty("max-width", "none", "important"), V.style.setProperty("max-height", "none", "important")) : (V.style.removeProperty("width"), V.style.removeProperty("height"), V.style.removeProperty("object-fit"), V.style.removeProperty("max-width"), V.style.removeProperty("max-height")));
2342
2386
  }
2343
2387
  });
2344
2388
  }, 20), r.value.link && r.value.link.trim() !== "") {
@@ -2352,38 +2396,38 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2352
2396
  }).run();
2353
2397
  } else I && e.editor.chain().focus().extendMarkRange("link").unsetLink().run();
2354
2398
  } else {
2355
- const { state: v } = e.editor, { selection: A } = v, { $anchor: I } = A;
2356
- let z = null;
2399
+ const { state: m } = e.editor, { selection: A } = m, { $anchor: I } = A;
2400
+ let N = null;
2357
2401
  for (let F = I.depth; F > 0; F--) {
2358
2402
  const M = I.node(F);
2359
2403
  if (M && M.type.name === "paragraph") {
2360
- z = M;
2404
+ N = M;
2361
2405
  break;
2362
2406
  }
2363
2407
  }
2364
- if (z && z.content.content.some(
2408
+ if (N && N.content.content.some(
2365
2409
  (F) => F.type.name === "image"
2366
2410
  )) {
2367
- const F = Y(z, I.before(I.depth));
2411
+ const F = Y(N, I.before(I.depth));
2368
2412
  if (F !== null) {
2369
- const M = N(), Q = v.schema.nodes.image.create({
2413
+ const M = z(), Q = m.schema.nodes.image.create({
2370
2414
  src: x,
2371
2415
  alt: r.value.alt || "",
2372
2416
  title: r.value.title || "",
2373
2417
  ...M
2374
2418
  });
2375
2419
  if (r.value.link && r.value.link.trim() !== "") {
2376
- let O = r.value.link.trim();
2377
- O.match(/^https?:\/\//i) || (O = "https://" + O);
2378
- const de = v.schema.marks.link.create({
2379
- href: O,
2420
+ let V = r.value.link.trim();
2421
+ V.match(/^https?:\/\//i) || (V = "https://" + V);
2422
+ const de = m.schema.marks.link.create({
2423
+ href: V,
2380
2424
  target: r.value.openInNewTab ? "_blank" : null
2381
2425
  }), $e = Q.type.create(Q.attrs, Q.content, [de]);
2382
2426
  e.editor.chain().focus().insertContentAt(F + 1, $e).run(), q(e.editor, x);
2383
2427
  } else
2384
2428
  e.editor.chain().focus().insertContentAt(F + 1, Q).run(), q(e.editor, x);
2385
2429
  } else if (r.value.link && r.value.link.trim() !== "") {
2386
- const M = N();
2430
+ const M = z();
2387
2431
  e.editor.chain().focus().setImage({
2388
2432
  src: x,
2389
2433
  alt: r.value.alt || "",
@@ -2397,7 +2441,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2397
2441
  }).run(), q(e.editor, x, 20);
2398
2442
  }, 10);
2399
2443
  } else {
2400
- const M = N();
2444
+ const M = z();
2401
2445
  e.editor.chain().focus().setImage({
2402
2446
  src: x,
2403
2447
  alt: r.value.alt || "",
@@ -2406,7 +2450,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2406
2450
  }).run(), q(e.editor, x);
2407
2451
  }
2408
2452
  } else if (r.value.link && r.value.link.trim() !== "") {
2409
- const F = N();
2453
+ const F = z();
2410
2454
  e.editor.chain().focus().setImage({
2411
2455
  src: x,
2412
2456
  alt: r.value.alt || "",
@@ -2420,7 +2464,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2420
2464
  }).run(), q(e.editor, x, 20);
2421
2465
  }, 10);
2422
2466
  } else {
2423
- const F = N();
2467
+ const F = z();
2424
2468
  e.editor.chain().focus().setImage({
2425
2469
  src: x,
2426
2470
  alt: r.value.alt || "",
@@ -2430,42 +2474,42 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2430
2474
  }
2431
2475
  }
2432
2476
  S();
2433
- }, Y = (f, m) => {
2434
- let u = null;
2435
- return f.forEach((_, x) => {
2436
- _.type.name === "image" && (u = m + x + 1);
2437
- }), u;
2477
+ }, Y = (p, y) => {
2478
+ let f = null;
2479
+ return p.forEach((_, x) => {
2480
+ _.type.name === "image" && (f = y + x + 1);
2481
+ }), f;
2438
2482
  }, oe = async () => {
2439
2483
  if (e.editor) {
2440
2484
  if (n.value.length === 0)
2441
2485
  if (Array.isArray(r.value.file) && r.value.file.length > 0) {
2442
- const f = r.value.file.filter((u) => typeof u == "string" && u.trim() !== ""), m = r.value.file.filter((u) => u instanceof File);
2443
- for (const u of f)
2444
- n.value.some((_) => _.url === u || _.preview === u) || n.value.push({
2445
- url: u,
2446
- preview: u,
2486
+ const p = r.value.file.filter((f) => typeof f == "string" && f.trim() !== ""), y = r.value.file.filter((f) => f instanceof File);
2487
+ for (const f of p)
2488
+ n.value.some((_) => _.url === f || _.preview === f) || n.value.push({
2489
+ url: f,
2490
+ preview: f,
2447
2491
  error: !1
2448
2492
  });
2449
- m.length > 0 && await j(m);
2493
+ y.length > 0 && await j(y);
2450
2494
  } else i.value && await j(r.value.file);
2451
2495
  if (n.value.length !== 0)
2452
2496
  try {
2453
- const f = [], m = N();
2454
- for (const u of n.value) {
2455
- const _ = u.url || u.preview || "";
2497
+ const p = [], y = z();
2498
+ for (const f of n.value) {
2499
+ const _ = f.url || f.preview || "";
2456
2500
  if (!_) continue;
2457
2501
  const x = e.editor.schema.nodes.image.create({
2458
2502
  src: _,
2459
2503
  alt: r.value.alt || "",
2460
2504
  title: r.value.title || "",
2461
- ...m
2505
+ ...y
2462
2506
  });
2463
- f.push(x);
2507
+ p.push(x);
2464
2508
  }
2465
- f.length > 0 && (e.editor.chain().focus().command(({ tr: u, dispatch: _ }) => {
2509
+ p.length > 0 && (e.editor.chain().focus().command(({ tr: f, dispatch: _ }) => {
2466
2510
  if (_) {
2467
- const { selection: x } = u, { $anchor: B } = x;
2468
- let v = x.$anchor.pos, A = null, I = null;
2511
+ const { selection: x } = f, { $anchor: B } = x;
2512
+ let m = x.$anchor.pos, A = null, I = null;
2469
2513
  for (let E = B.depth; E > 0; E--) {
2470
2514
  const F = B.node(E);
2471
2515
  if (F && F.type.name === "paragraph") {
@@ -2477,25 +2521,25 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2477
2521
  let E = null;
2478
2522
  A.forEach((F, M) => {
2479
2523
  F.type.name === "image" && (E = I + M + 1);
2480
- }), E !== null ? v = E + 1 : v = I + A.content.size;
2524
+ }), E !== null ? m = E + 1 : m = I + A.content.size;
2481
2525
  }
2482
- let z = v;
2483
- return f.forEach((E) => {
2484
- u.insert(z, E), z += E.nodeSize;
2526
+ let N = m;
2527
+ return p.forEach((E) => {
2528
+ f.insert(N, E), N += E.nodeSize;
2485
2529
  }), !0;
2486
2530
  }
2487
2531
  return !1;
2488
2532
  }).run(), r.value.width && r.value.height && setTimeout(() => {
2489
- const { view: u } = e.editor;
2490
- u && u.dom && u.dom.querySelectorAll("img.editor-image").forEach((B) => {
2533
+ const { view: f } = e.editor;
2534
+ f && f.dom && f.dom.querySelectorAll("img.editor-image").forEach((B) => {
2491
2535
  B instanceof HTMLImageElement && Array.from(n.value).some((A) => {
2492
- const I = A.url || A.preview || "", z = B.src || B.getAttribute("src") || "";
2493
- return z === I || z.includes(I.split("/").pop());
2536
+ const I = A.url || A.preview || "", N = B.src || B.getAttribute("src") || "";
2537
+ return N === I || N.includes(I.split("/").pop());
2494
2538
  }) && (B.style.setProperty("width", `${r.value.width}px`, "important"), B.style.setProperty("height", `${r.value.height}px`, "important"), B.style.setProperty("object-fit", "fill", "important"), B.style.setProperty("max-width", "none", "important"), B.style.setProperty("max-height", "none", "important"));
2495
2539
  });
2496
2540
  }, 50)), S();
2497
- } catch (f) {
2498
- console.error("Помилка при додаванні зображень:", f), we({
2541
+ } catch (p) {
2542
+ console.error("Помилка при додаванні зображень:", p), we({
2499
2543
  type: "error",
2500
2544
  title: "Помилка",
2501
2545
  message: "Не вдалося додати зображення"
@@ -2504,24 +2548,24 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2504
2548
  }
2505
2549
  }, se = async () => {
2506
2550
  await L();
2507
- }, D = () => {
2551
+ }, O = () => {
2508
2552
  S();
2509
2553
  };
2510
- return ue(() => r.value.file, async (f, m) => {
2511
- if (s.value = !1, !(o.value && Array.isArray(f) && f.length === 1 && typeof f[0] == "string" && !f.some((_) => _ instanceof File)))
2512
- if (Array.isArray(f) && f.length > 0) {
2513
- const u = f.filter((x) => x instanceof File), _ = f.filter((x) => typeof x == "string" && x.trim() !== "");
2514
- if (u.length > 0 && (o.value ? o.value && u.length === 1 && _.length === 0 && (n.value = []) : n.value = [], (!o.value || u.length > 1 || _.length > 0) && await j(u), o.value && u.length === 1 && _.length === 0)) {
2554
+ return ue(() => r.value.file, async (p, y) => {
2555
+ if (s.value = !1, !(o.value && Array.isArray(p) && p.length === 1 && typeof p[0] == "string" && !p.some((_) => _ instanceof File)))
2556
+ if (Array.isArray(p) && p.length > 0) {
2557
+ const f = p.filter((x) => x instanceof File), _ = p.filter((x) => typeof x == "string" && x.trim() !== "");
2558
+ if (f.length > 0 && (o.value ? o.value && f.length === 1 && _.length === 0 && (n.value = []) : n.value = [], (!o.value || f.length > 1 || _.length > 0) && await j(f), o.value && f.length === 1 && _.length === 0)) {
2515
2559
  const x = new FileReader();
2516
2560
  x.onload = (B) => {
2517
2561
  r.value.src = B.target.result;
2518
- }, x.readAsDataURL(u[0]);
2562
+ }, x.readAsDataURL(f[0]);
2519
2563
  }
2520
2564
  if (_.length > 0)
2521
2565
  if (o.value)
2522
- o.value && _.length === 1 && u.length === 0 && (r.value.src = _[0]);
2566
+ o.value && _.length === 1 && f.length === 0 && (r.value.src = _[0]);
2523
2567
  else {
2524
- u.length === 0 && (n.value = []);
2568
+ f.length === 0 && (n.value = []);
2525
2569
  for (const x of _)
2526
2570
  n.value.some((B) => B.url === x || B.preview === x) || n.value.push({
2527
2571
  url: x,
@@ -2529,30 +2573,30 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2529
2573
  error: !1
2530
2574
  });
2531
2575
  }
2532
- } else f && typeof f == "object" && f instanceof FileList ? (o.value || (n.value = []), await j(Array.from(f))) : f && typeof f == "object" && !Array.isArray(f) && f instanceof File ? (o.value || (n.value = []), await j([f])) : o.value || (n.value = []);
2576
+ } else p && typeof p == "object" && p instanceof FileList ? (o.value || (n.value = []), await j(Array.from(p))) : p && typeof p == "object" && !Array.isArray(p) && p instanceof File ? (o.value || (n.value = []), await j([p])) : o.value || (n.value = []);
2533
2577
  }, { immediate: !1 }), ue(() => r.value.src, () => {
2534
2578
  s.value = !1;
2535
- }), (f, m) => (g(), w("div", rl, [
2579
+ }), (p, y) => (v(), w("div", ll, [
2536
2580
  d("button", {
2537
- onClick: b,
2581
+ onClick: g,
2538
2582
  class: T([
2539
2583
  "h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",
2540
2584
  t.editor?.isActive("image") ? "bg-gray-200 text-gray-900" : ""
2541
2585
  ]),
2542
2586
  title: "Додати зображення"
2543
2587
  }, [
2544
- C(k(Nt), { class: "h-4 w-4" }),
2545
- m[4] || (m[4] = d("span", { class: "sr-only" }, "Додати зображення", -1))
2588
+ C(k(zt), { class: "h-4 w-4" }),
2589
+ y[4] || (y[4] = d("span", { class: "sr-only" }, "Додати зображення", -1))
2546
2590
  ], 2),
2547
2591
  C(Ye, {
2548
2592
  modelValue: l.value,
2549
- "onUpdate:modelValue": m[3] || (m[3] = (u) => l.value = u),
2593
+ "onUpdate:modelValue": y[3] || (y[3] = (f) => l.value = f),
2550
2594
  title: o.value ? "Редагувати зображення" : "Додати зображення"
2551
2595
  }, {
2552
- footer: V(() => [
2553
- d("div", ul, [
2596
+ footer: D(() => [
2597
+ d("div", pl, [
2554
2598
  d("button", {
2555
- onClick: D,
2599
+ onClick: O,
2556
2600
  type: "button",
2557
2601
  class: "px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"
2558
2602
  }, " Скасувати "),
@@ -2563,48 +2607,48 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2563
2607
  }, W(o.value ? "Оновити зображення" : "Додати зображення"), 1)
2564
2608
  ])
2565
2609
  ]),
2566
- default: V(() => [
2610
+ default: D(() => [
2567
2611
  C(ut, {
2568
2612
  modelValue: r.value,
2569
- "onUpdate:modelValue": m[0] || (m[0] = (u) => r.value = u),
2613
+ "onUpdate:modelValue": y[0] || (y[0] = (f) => r.value = f),
2570
2614
  schema: h.value,
2571
2615
  form: a.value,
2572
- "onUpdate:form": m[1] || (m[1] = (u) => a.value = u)
2616
+ "onUpdate:form": y[1] || (y[1] = (f) => a.value = f)
2573
2617
  }, null, 8, ["modelValue", "schema", "form"]),
2574
- p.value && !i.value ? (g(), w("div", ol, [
2575
- m[5] || (m[5] = d("p", { class: "text-sm text-gray-600 mb-2" }, "Попередній перегляд:", -1)),
2618
+ u.value && !i.value ? (v(), w("div", al, [
2619
+ y[5] || (y[5] = d("p", { class: "text-sm text-gray-600 mb-2" }, "Попередній перегляд:", -1)),
2576
2620
  ie(d("img", {
2577
- src: p.value,
2621
+ src: u.value,
2578
2622
  alt: r.value.alt || "Попередній перегляд зображення",
2579
2623
  title: r.value.title,
2580
2624
  class: "max-w-full h-auto max-h-32 rounded border",
2581
- onError: m[2] || (m[2] = (u) => s.value = !0)
2582
- }, null, 40, ll), [
2625
+ onError: y[2] || (y[2] = (f) => s.value = !0)
2626
+ }, null, 40, sl), [
2583
2627
  [ye, !s.value]
2584
2628
  ]),
2585
- s.value ? (g(), w("p", al, " Не вдалося завантажити попередній перегляд зображення ")) : R("", !0)
2629
+ s.value ? (v(), w("p", nl, " Не вдалося завантажити попередній перегляд зображення ")) : R("", !0)
2586
2630
  ])) : R("", !0),
2587
- n.value.length > 0 ? (g(), w("div", sl, [
2588
- d("p", nl, "Попередній перегляд (" + W(n.value.length) + " зображень):", 1),
2589
- m[6] || (m[6] = d("p", { class: "text-xs text-gray-500 mb-2" }, " Зображення будуть розміщені в ряд, якщо вони помістяться по ширині ", -1)),
2590
- d("div", il, [
2591
- (g(!0), w(re, null, le(n.value, (u, _) => (g(), w("div", {
2631
+ n.value.length > 0 ? (v(), w("div", il, [
2632
+ d("p", cl, "Попередній перегляд (" + W(n.value.length) + " зображень):", 1),
2633
+ y[6] || (y[6] = d("p", { class: "text-xs text-gray-500 mb-2" }, " Зображення будуть розміщені в ряд, якщо вони помістяться по ширині ", -1)),
2634
+ d("div", dl, [
2635
+ (v(!0), w(re, null, le(n.value, (f, _) => (v(), w("div", {
2592
2636
  key: _,
2593
2637
  class: "relative"
2594
2638
  }, [
2595
2639
  ie(d("img", {
2596
- src: u.preview,
2640
+ src: f.preview,
2597
2641
  alt: `Попередній перегляд ${_ + 1}`,
2598
2642
  class: "max-w-[100px] max-h-[100px] rounded border object-contain",
2599
- onError: (x) => u.error = !0
2600
- }, null, 40, cl), [
2601
- [ye, !u.error]
2643
+ onError: (x) => f.error = !0
2644
+ }, null, 40, ul), [
2645
+ [ye, !f.error]
2602
2646
  ]),
2603
2647
  d("button", {
2604
2648
  onClick: (x) => H(_),
2605
2649
  class: "absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",
2606
2650
  type: "button"
2607
- }, " × ", 8, dl)
2651
+ }, " × ", 8, fl)
2608
2652
  ]))), 128))
2609
2653
  ])
2610
2654
  ])) : R("", !0)
@@ -2613,7 +2657,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2613
2657
  }, 8, ["modelValue", "title"])
2614
2658
  ]));
2615
2659
  }
2616
- }), pl = { class: "flex items-center" }, gl = ["disabled"], hl = ["disabled"], vl = /* @__PURE__ */ Object.assign({
2660
+ }), hl = { class: "flex items-center" }, vl = ["disabled"], ml = ["disabled"], bl = /* @__PURE__ */ Object.assign({
2617
2661
  inheritAttrs: !1
2618
2662
  }, {
2619
2663
  __name: "vs-editor-history",
@@ -2624,7 +2668,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2624
2668
  }, s = () => {
2625
2669
  e.editor?.can().redo() && e.editor.chain().focus().redo().run();
2626
2670
  };
2627
- return (a, o) => (g(), w("div", pl, [
2671
+ return (a, o) => (v(), w("div", hl, [
2628
2672
  d("button", {
2629
2673
  onClick: l,
2630
2674
  class: T(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200", [
@@ -2633,8 +2677,8 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2633
2677
  disabled: !t.editor?.can().undo(),
2634
2678
  title: "Undo (Ctrl+Z)"
2635
2679
  }, [
2636
- C(k(Vt), { class: "h-4 w-4" })
2637
- ], 10, gl),
2680
+ C(k(Dt), { class: "h-4 w-4" })
2681
+ ], 10, vl),
2638
2682
  d("button", {
2639
2683
  onClick: s,
2640
2684
  class: T(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100", [
@@ -2643,11 +2687,11 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2643
2687
  disabled: !t.editor?.can().redo(),
2644
2688
  title: "Redo (Ctrl+Y)"
2645
2689
  }, [
2646
- C(k(Dt), { class: "h-4 w-4" })
2647
- ], 10, hl)
2690
+ C(k(Ot), { class: "h-4 w-4" })
2691
+ ], 10, ml)
2648
2692
  ]));
2649
2693
  }
2650
- }), ml = /* @__PURE__ */ X(vl, [["__scopeId", "data-v-2cd0a908"]]), bl = { class: "relative" }, yl = { class: "p-6" }, xl = { class: "flex justify-between items-center mb-4" }, wl = /* @__PURE__ */ Object.assign({
2694
+ }), yl = /* @__PURE__ */ X(bl, [["__scopeId", "data-v-2cd0a908"]]), xl = { class: "relative" }, wl = { class: "p-6" }, kl = { class: "flex justify-between items-center mb-4" }, _l = /* @__PURE__ */ Object.assign({
2651
2695
  inheritAttrs: !1
2652
2696
  }, {
2653
2697
  __name: "vs-editor-help",
@@ -2658,7 +2702,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2658
2702
  }, a = () => {
2659
2703
  e.value = !1;
2660
2704
  };
2661
- return (o, n) => (g(), w("div", bl, [
2705
+ return (o, n) => (v(), w("div", xl, [
2662
2706
  d("button", {
2663
2707
  ref_key: "helpButton",
2664
2708
  ref: l,
@@ -2666,9 +2710,9 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2666
2710
  class: T(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500", [e.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]]),
2667
2711
  title: "Markdown Shortcuts Help"
2668
2712
  }, [
2669
- C(k(Ot), { class: "h-4 w-4" })
2713
+ C(k(Vt), { class: "h-4 w-4" })
2670
2714
  ], 2),
2671
- e.value ? (g(), w("div", {
2715
+ e.value ? (v(), w("div", {
2672
2716
  key: 0,
2673
2717
  class: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100001]",
2674
2718
  onClick: a
@@ -2678,8 +2722,8 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2678
2722
  onClick: n[0] || (n[0] = nt(() => {
2679
2723
  }, ["stop"]))
2680
2724
  }, [
2681
- d("div", yl, [
2682
- d("div", xl, [
2725
+ d("div", wl, [
2726
+ d("div", kl, [
2683
2727
  n[1] || (n[1] = d("h2", { class: "text-xl font-semibold text-gray-900" }, "Common Markdown Syntax & Shortcuts", -1)),
2684
2728
  d("button", {
2685
2729
  onClick: a,
@@ -2694,7 +2738,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2694
2738
  ])) : R("", !0)
2695
2739
  ]));
2696
2740
  }
2697
- }), kl = /* @__PURE__ */ X(wl, [["__scopeId", "data-v-38077376"]]), _l = {
2741
+ }), $l = /* @__PURE__ */ X(_l, [["__scopeId", "data-v-38077376"]]), Cl = {
2698
2742
  __name: "vs-editor-horizontal-rule",
2699
2743
  props: {
2700
2744
  editor: Object
@@ -2703,7 +2747,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2703
2747
  const e = t, l = () => {
2704
2748
  e.editor && e.editor.chain().focus().setHorizontalRule().run();
2705
2749
  };
2706
- return (s, a) => (g(), w("button", {
2750
+ return (s, a) => (v(), w("button", {
2707
2751
  title: "Horizontal Rule",
2708
2752
  onClick: l,
2709
2753
  class: "flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"
@@ -2711,7 +2755,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2711
2755
  C(k(Rt), { class: "h-4 w-4" })
2712
2756
  ]));
2713
2757
  }
2714
- }, $l = {
2758
+ }, Al = {
2715
2759
  __name: "vs-editor-fullscreen",
2716
2760
  props: {
2717
2761
  editor: Object
@@ -2721,7 +2765,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2721
2765
  const l = e, s = () => {
2722
2766
  l("toggle-fullscreen");
2723
2767
  };
2724
- return (a, o) => (g(), w("button", {
2768
+ return (a, o) => (v(), w("button", {
2725
2769
  title: "Fullscreen",
2726
2770
  onClick: s,
2727
2771
  class: "w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"
@@ -2729,7 +2773,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2729
2773
  C(k(Ut), { class: "h-4 w-4" })
2730
2774
  ]));
2731
2775
  }
2732
- }, Cl = /* @__PURE__ */ Object.assign({
2776
+ }, Fl = /* @__PURE__ */ Object.assign({
2733
2777
  inheritAttrs: !1
2734
2778
  }, {
2735
2779
  __name: "vs-editor-tab",
@@ -2743,7 +2787,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2743
2787
  const e = t, l = () => {
2744
2788
  e.editor && (e.editor.isActive("bulletList") || e.editor.isActive("orderedList")) && e.editor.chain().focus().sinkListItem("listItem").run();
2745
2789
  };
2746
- return (s, a) => (g(), w("button", {
2790
+ return (s, a) => (v(), w("button", {
2747
2791
  title: "Tab (Increase List Indent)",
2748
2792
  onClick: l,
2749
2793
  class: "text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"
@@ -2751,35 +2795,35 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2751
2795
  C(k(qt), { class: "h-4 w-4" })
2752
2796
  ]));
2753
2797
  }
2754
- }), Al = {
2755
- bold: Tr,
2756
- italic: Ir,
2757
- color: $o,
2758
- background_color: Lo,
2759
- highlight: Bo,
2760
- bullet_list: xr,
2761
- ordered_list: _r,
2762
- blockquote: mr,
2763
- codeblock: Ar,
2764
- underline: Er,
2765
- strike: jr,
2766
- link: oo,
2767
- table: io,
2768
- text_align: fo,
2769
- type_tag: ho,
2770
- font_family: Mo,
2798
+ }), Sl = {
2799
+ bold: Br,
2800
+ italic: jr,
2801
+ color: Ao,
2802
+ background_color: Io,
2803
+ highlight: Eo,
2804
+ bullet_list: kr,
2805
+ ordered_list: Cr,
2806
+ blockquote: yr,
2807
+ codeblock: Sr,
2808
+ underline: Pr,
2809
+ strike: Mr,
2810
+ link: ao,
2811
+ table: uo,
2812
+ text_align: go,
2813
+ type_tag: mo,
2814
+ font_family: No,
2771
2815
  font_size: Vo,
2772
- superscript: Ro,
2773
- subscript: Ko,
2774
- heading: Zo,
2775
- clear_formatting: tl,
2776
- image: fl,
2777
- history: ml,
2778
- help: kl,
2779
- horizontal_rule: _l,
2780
- fullscreen: $l,
2781
- tab: Cl
2782
- }, De = {
2816
+ superscript: qo,
2817
+ subscript: Xo,
2818
+ heading: el,
2819
+ clear_formatting: ol,
2820
+ image: gl,
2821
+ history: yl,
2822
+ help: $l,
2823
+ horizontal_rule: Cl,
2824
+ fullscreen: Al,
2825
+ tab: Fl
2826
+ }, Oe = {
2783
2827
  // Базовий набір - мінімальний функціонал
2784
2828
  basic: [
2785
2829
  "history",
@@ -2853,13 +2897,13 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2853
2897
  "fullscreen",
2854
2898
  "help"
2855
2899
  ]
2856
- }, Fl = { class: "flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent" }, Sl = { class: "rich-text-scroll-wrapper" }, Tl = {
2900
+ }, Tl = { class: "flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent" }, Ll = { class: "rich-text-scroll-wrapper" }, Bl = {
2857
2901
  key: 0,
2858
2902
  class: "richtext-loading text-sm text-gray-500"
2859
- }, Ll = {
2903
+ }, Il = {
2860
2904
  key: 1,
2861
2905
  class: "richtext-error text-sm text-red-600"
2862
- }, Bl = { class: "html-source-editor" }, Il = { class: "flex justify-end border-t border-[#e5e7eb] bg-[#f8fafc] px-4 min-h-[38px] items-start overflow-visible" }, El = { class: "inline-flex items-stretch -mt-px" }, zl = /* @__PURE__ */ Object.assign({
2906
+ }, El = { class: "html-source-editor" }, jl = { class: "flex justify-end border-t border-[#e5e7eb] bg-[#f8fafc] px-4 min-h-[38px] items-start overflow-visible" }, Pl = { class: "inline-flex items-stretch -mt-px" }, Dl = /* @__PURE__ */ Object.assign({
2863
2907
  inheritAttrs: !1
2864
2908
  }, {
2865
2909
  __name: "vs-richtext",
@@ -2879,34 +2923,34 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2879
2923
  setup(t) {
2880
2924
  const e = t, l = ct(t, "modelValue"), s = $(null), { t: a } = _e(), o = P(() => e.format === "md" ? "markdown" : "html"), n = P(
2881
2925
  () => e.format === "md" ? a("form.richtext.markdown") : a("form.richtext.html")
2882
- ), { editor: c, editorInstance: r, focusEditor: i, createEditor: y, destroyEditor: p, isLoading: h, loadError: b } = rr(e), { isHtmlMode: S, htmlContent: j, htmlTextarea: H, toggleHtmlMode: N } = or(
2926
+ ), { editor: c, editorInstance: r, focusEditor: i, createEditor: b, destroyEditor: u, isLoading: h, loadError: g } = rr(e), { isHtmlMode: S, htmlContent: j, htmlTextarea: H, toggleHtmlMode: z } = or(
2883
2927
  c,
2884
2928
  e.format,
2885
- (D, f) => {
2886
- D === "update:modelValue" && (l.value = f);
2929
+ (O, p) => {
2930
+ O === "update:modelValue" && (l.value = p);
2887
2931
  },
2888
2932
  {
2889
2933
  toEditorContent: Ae,
2890
- toSourceContent: dr
2934
+ toSourceContent: fr
2891
2935
  }
2892
- ), { isFullscreen: q, toggleFullscreen: L } = lr(), Y = P(() => typeof e.toolbar == "string" ? De[e.toolbar] || De.default : e.toolbar), oe = P(() => Y.value.map((D) => Al[D]).filter(Boolean));
2936
+ ), { isFullscreen: q, toggleFullscreen: L } = lr(), Y = P(() => typeof e.toolbar == "string" ? Oe[e.toolbar] || Oe.default : e.toolbar), oe = P(() => Y.value.map((O) => Sl[O]).filter(Boolean));
2893
2937
  ue(
2894
2938
  () => e.modelValue,
2895
- async (D) => {
2939
+ async (O) => {
2896
2940
  if (c.value) {
2897
- const f = await Ae(D || "", e.format), m = c.value.getHTML();
2898
- f !== m && f !== "<p></p>" && c.value.commands.setContent(f, !1);
2941
+ const p = await Ae(O || "", e.format), y = c.value.getHTML();
2942
+ p !== y && p !== "<p></p>" && c.value.commands.setContent(p, !1);
2899
2943
  }
2900
2944
  },
2901
2945
  { immediate: !0 }
2902
2946
  );
2903
- const se = (D) => {
2904
- if (!D || !D.view || !D.view.dom) return;
2905
- D.view.dom.querySelectorAll("img.editor-image[width][height]").forEach((m) => {
2906
- if (m instanceof HTMLImageElement) {
2907
- const u = m.getAttribute("width"), _ = m.getAttribute("height");
2908
- u && _ && u !== "auto" && _ !== "auto" && u !== "" && _ !== "" && !isNaN(Number(u)) && !isNaN(Number(_)) && (m.style.cssText = `
2909
- width: ${u}px !important;
2947
+ const se = (O) => {
2948
+ if (!O || !O.view || !O.view.dom) return;
2949
+ O.view.dom.querySelectorAll("img.editor-image[width][height]").forEach((y) => {
2950
+ if (y instanceof HTMLImageElement) {
2951
+ const f = y.getAttribute("width"), _ = y.getAttribute("height");
2952
+ f && _ && f !== "auto" && _ !== "auto" && f !== "" && _ !== "" && !isNaN(Number(f)) && !isNaN(Number(_)) && (y.style.cssText = `
2953
+ width: ${f}px !important;
2910
2954
  height: ${_}px !important;
2911
2955
  max-width: none !important;
2912
2956
  max-height: none !important;
@@ -2917,30 +2961,30 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2917
2961
  }
2918
2962
  });
2919
2963
  };
2920
- return ue(c, (D) => {
2921
- D && (be(() => {
2964
+ return ue(c, (O) => {
2965
+ O && (be(() => {
2922
2966
  se(c.value);
2923
- }), c.value.on("update", async (f) => {
2924
- const m = f.editor.getHTML(), u = await ur(m, e.format);
2925
- u !== e.modelValue && m !== "<p></p>" && (l.value = u), setTimeout(() => {
2926
- se(f.editor);
2967
+ }), c.value.on("update", async (p) => {
2968
+ const y = p.editor.getHTML(), f = await pr(y, e.format);
2969
+ f !== e.modelValue && y !== "<p></p>" && (l.value = f), setTimeout(() => {
2970
+ se(p.editor);
2927
2971
  }, 10);
2928
2972
  }));
2929
2973
  }), fe(async () => {
2930
- const D = await Ae(e.modelValue || "", e.format);
2931
- await y(s.value, D), be(() => {
2974
+ const O = await Ae(e.modelValue || "", e.format);
2975
+ await b(s.value, O), be(() => {
2932
2976
  c.value && setTimeout(() => {
2933
2977
  se(c.value);
2934
2978
  }, 100);
2935
2979
  });
2936
2980
  }), Ue(() => {
2937
- p();
2938
- }), (D, f) => (g(), w("div", {
2981
+ u();
2982
+ }), (O, p) => (v(), w("div", {
2939
2983
  class: T(["bg-white rounded-md w-full", { "fixed left-0 right-0 top-0 bottom-0 z-[100000]": k(q) }])
2940
2984
  }, [
2941
- d("div", Fl, [
2942
- (g(!0), w(re, null, le(oe.value, (m) => (g(), w(re, { key: m }, [
2943
- k(c) ? (g(), K(Fe(m), {
2985
+ d("div", Tl, [
2986
+ (v(!0), w(re, null, le(oe.value, (y) => (v(), w(re, { key: y }, [
2987
+ k(c) ? (v(), K(Fe(y), {
2944
2988
  key: 0,
2945
2989
  editor: k(r),
2946
2990
  onToggleFullscreen: k(L)
@@ -2948,27 +2992,27 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2948
2992
  ], 64))), 128))
2949
2993
  ]),
2950
2994
  d("div", {
2951
- onClick: f[1] || (f[1] = (...m) => k(i) && k(i)(...m)),
2995
+ onClick: p[1] || (p[1] = (...y) => k(i) && k(i)(...y)),
2952
2996
  class: "relative w-full px-4 py-2 bg-white rounded-b-lg editor-content",
2953
2997
  style: ae({ height: k(q) ? "calc(95vh - 44px)" : t.height })
2954
2998
  }, [
2955
- ie(d("div", Sl, [
2999
+ ie(d("div", Ll, [
2956
3000
  d("div", {
2957
3001
  ref_key: "editorElement",
2958
3002
  ref: s,
2959
3003
  class: "relative w-full"
2960
3004
  }, null, 512),
2961
- k(h) ? (g(), w("div", Tl, "Loading editor...")) : R("", !0),
2962
- k(b) ? (g(), w("div", Ll, W(k(b)), 1)) : R("", !0)
3005
+ k(h) ? (v(), w("div", Bl, "Loading editor...")) : R("", !0),
3006
+ k(g) ? (v(), w("div", Il, W(k(g)), 1)) : R("", !0)
2963
3007
  ], 512), [
2964
3008
  [ye, !k(S)]
2965
3009
  ]),
2966
- ie(d("div", Bl, [
3010
+ ie(d("div", El, [
2967
3011
  C(ft, {
2968
3012
  ref_key: "htmlTextarea",
2969
3013
  ref: H,
2970
3014
  modelValue: k(j),
2971
- "onUpdate:modelValue": f[0] || (f[0] = (m) => dt(j) ? j.value = m : null),
3015
+ "onUpdate:modelValue": p[0] || (p[0] = (y) => dt(j) ? j.value = y : null),
2972
3016
  height: "100%",
2973
3017
  syntax: o.value,
2974
3018
  theme: "vs-light"
@@ -2977,15 +3021,15 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2977
3021
  [ye, k(S)]
2978
3022
  ])
2979
3023
  ], 4),
2980
- d("div", Il, [
2981
- d("div", El, [
3024
+ d("div", jl, [
3025
+ d("div", Pl, [
2982
3026
  d("button", {
2983
3027
  type: "button",
2984
3028
  class: T([
2985
3029
  "min-w-[96px] h-[30px] px-[14px] border border-[#cfd6e0] bg-[#f3f5f8] text-[8px] font-bold uppercase tracking-[0.06em] leading-none cursor-pointer transition-colors duration-200 border-b-[1px] border-b-[#cfd6e0] rounded-none rounded-bl-[8px] hover:bg-[#eef1f5] hover:text-[#667284]",
2986
3030
  k(S) ? "text-[#8f99aa]" : "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]"
2987
3031
  ]),
2988
- onClick: f[2] || (f[2] = (m) => k(N)(!1))
3032
+ onClick: p[2] || (p[2] = (y) => k(z)(!1))
2989
3033
  }, W(k(a)("form.richtext.editor")), 3),
2990
3034
  d("button", {
2991
3035
  type: "button",
@@ -2993,7 +3037,7 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
2993
3037
  "min-w-[96px] h-[30px] px-[14px] border border-[#cfd6e0] border-l-0 bg-[#f3f5f8] text-[8px] font-bold uppercase tracking-[0.06em] leading-none cursor-pointer transition-colors duration-200 border-b-[1px] border-b-[#cfd6e0] rounded-none rounded-br-[8px] hover:bg-[#eef1f5] hover:text-[#667284]",
2994
3038
  k(S) ? "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]" : "text-[#8f99aa]"
2995
3039
  ]),
2996
- onClick: f[3] || (f[3] = (m) => k(N)(!0))
3040
+ onClick: p[3] || (p[3] = (y) => k(z)(!0))
2997
3041
  }, W(n.value), 3)
2998
3042
  ])
2999
3043
  ])
@@ -3001,5 +3045,5 @@ const tl = /* @__PURE__ */ X(Jo, [["render", el]]), rl = { class: "relative" },
3001
3045
  }
3002
3046
  });
3003
3047
  export {
3004
- zl as default
3048
+ Dl as default
3005
3049
  };