@editora/plugins 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +5 -0
  2. package/dist/_commonjsHelpers-6763f629.js +1 -0
  3. package/dist/_commonjsHelpers-c5d32002.mjs +30 -0
  4. package/dist/a11y-checker.cjs.js +12 -12
  5. package/dist/a11y-checker.esm.js +98 -80
  6. package/dist/anchor.cjs.js +12 -12
  7. package/dist/anchor.esm.js +128 -115
  8. package/dist/anchoredPopover-33f1358d.mjs +109 -0
  9. package/dist/anchoredPopover-8151d535.js +1 -0
  10. package/dist/approval-workflow.cjs.js +40 -40
  11. package/dist/approval-workflow.esm.js +249 -208
  12. package/dist/background-color.cjs.js +2 -2
  13. package/dist/background-color.esm.js +68 -55
  14. package/dist/blockquote.esm.js +2 -1
  15. package/dist/blocks-library.cjs.js +45 -45
  16. package/dist/blocks-library.esm.js +245 -178
  17. package/dist/capitalization.esm.js +2 -1
  18. package/dist/checklist.cjs.js +1 -1
  19. package/dist/checklist.esm.js +82 -58
  20. package/dist/citations.cjs.js +37 -37
  21. package/dist/citations.esm.js +512 -439
  22. package/dist/clear-formatting.cjs.js +1 -1
  23. package/dist/clear-formatting.esm.js +33 -27
  24. package/dist/code-sample.cjs.js +14 -14
  25. package/dist/code-sample.esm.js +93 -82
  26. package/dist/code.cjs.js +32 -32
  27. package/dist/code.esm.js +653 -594
  28. package/dist/comments.cjs.js +6 -6
  29. package/dist/comments.esm.js +158 -116
  30. package/dist/conditional-content.cjs.js +90 -90
  31. package/dist/conditional-content.esm.js +432 -371
  32. package/dist/content-rules.cjs.js +7 -7
  33. package/dist/content-rules.esm.js +159 -105
  34. package/dist/data-binding.cjs.js +46 -46
  35. package/dist/data-binding.esm.js +368 -328
  36. package/dist/direction.esm.js +18 -9
  37. package/dist/doc-schema.cjs.js +29 -29
  38. package/dist/doc-schema.esm.js +308 -240
  39. package/dist/document-manager.cjs.js +1 -1
  40. package/dist/document-manager.esm.js +5 -4
  41. package/dist/documentManager-25b6203c.mjs +9122 -0
  42. package/dist/documentManager-b69e7054.js +17 -0
  43. package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +2 -1
  44. package/dist/embed-iframe.cjs.js +4 -4
  45. package/dist/embed-iframe.esm.js +81 -73
  46. package/dist/emojis.cjs.js +8 -8
  47. package/dist/emojis.esm.js +77 -65
  48. package/dist/enterprise.cjs.js +1 -1
  49. package/dist/enterprise.esm.js +56 -54
  50. package/dist/font-family.cjs.js +1 -1
  51. package/dist/font-family.esm.js +47 -39
  52. package/dist/font-size.cjs.js +1 -1
  53. package/dist/font-size.esm.js +53 -37
  54. package/dist/footnote.cjs.js +2 -2
  55. package/dist/footnote.esm.js +117 -76
  56. package/dist/history.cjs.js +1 -1
  57. package/dist/history.esm.js +92 -70
  58. package/dist/html2canvas.esm-09133e29.js +22 -0
  59. package/dist/{html2canvas.esm-BWVIUcAF.mjs → html2canvas.esm-1a1724a1.mjs} +225 -141
  60. package/dist/indent.cjs.js +1 -1
  61. package/dist/indent.esm.js +24 -12
  62. package/dist/index-656d224b.js +231 -0
  63. package/dist/index-6a8c48bb.js +1 -0
  64. package/dist/index-d027b7e2.mjs +16859 -0
  65. package/dist/{index-BFsKNTTj.mjs → index-f04538f2.mjs} +71 -70
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.es-730f2d98.mjs +5775 -0
  68. package/dist/index.es-dd40173b.js +18 -0
  69. package/dist/index.esm.js +128 -125
  70. package/dist/italic.cjs.js +1 -1
  71. package/dist/italic.esm.js +9 -8
  72. package/dist/jspdf.es.min-90db2c97.js +243 -0
  73. package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-c36a4fd8.mjs} +4682 -3658
  74. package/dist/line-height.cjs.js +1 -1
  75. package/dist/line-height.esm.js +24 -11
  76. package/dist/link.cjs.js +5 -5
  77. package/dist/link.esm.js +30 -24
  78. package/dist/list.cjs.js +1 -1
  79. package/dist/list.esm.js +25 -20
  80. package/dist/lite.cjs.js +1 -1
  81. package/dist/lite.esm.js +61 -59
  82. package/dist/math.cjs.js +21 -21
  83. package/dist/math.esm.js +146 -139
  84. package/dist/media-manager.cjs.js +38 -38
  85. package/dist/media-manager.esm.js +325 -308
  86. package/dist/mentions.cjs.js +9 -9
  87. package/dist/mentions.esm.js +286 -238
  88. package/dist/merge-tag.cjs.js +2 -2
  89. package/dist/merge-tag.esm.js +216 -177
  90. package/dist/page-break.cjs.js +2 -2
  91. package/dist/page-break.esm.js +49 -33
  92. package/dist/pii-redaction.cjs.js +19 -19
  93. package/dist/pii-redaction.esm.js +463 -393
  94. package/dist/preview.esm.js +10 -5
  95. package/dist/print.cjs.js +4 -4
  96. package/dist/print.esm.js +20 -17
  97. package/dist/{purify.es-DHhaBdbu.mjs → purify.es-35a15df8.mjs} +19 -9
  98. package/dist/{purify.es-T2a3nLiC.js → purify.es-a8d731c6.js} +1 -1
  99. package/dist/slash-commands.cjs.js +3 -3
  100. package/dist/slash-commands.esm.js +212 -176
  101. package/dist/smart-paste.cjs.js +27 -27
  102. package/dist/smart-paste.esm.js +336 -280
  103. package/dist/special-characters.cjs.js +7 -7
  104. package/dist/special-characters.esm.js +69 -61
  105. package/dist/spell-check.cjs.js +5 -5
  106. package/dist/spell-check.esm.js +123 -97
  107. package/dist/strikethrough.cjs.js +1 -1
  108. package/dist/strikethrough.esm.js +19 -14
  109. package/dist/style.css +1 -0
  110. package/dist/table.cjs.js +4 -4
  111. package/dist/table.esm.js +225 -191
  112. package/dist/template.cjs.js +11 -11
  113. package/dist/template.esm.js +153 -124
  114. package/dist/text-alignment.cjs.js +1 -1
  115. package/dist/text-alignment.esm.js +27 -21
  116. package/dist/text-color.cjs.js +3 -3
  117. package/dist/text-color.esm.js +87 -70
  118. package/dist/track-changes.cjs.js +2 -2
  119. package/dist/track-changes.esm.js +162 -100
  120. package/dist/translation-workflow.cjs.js +74 -74
  121. package/dist/translation-workflow.esm.js +678 -602
  122. package/dist/version-diff.cjs.js +14 -14
  123. package/dist/version-diff.esm.js +157 -128
  124. package/package.json +13 -7
  125. package/LICENSE +0 -21
  126. package/dist/_commonjsHelpers-BH3jXuIh.js +0 -1
  127. package/dist/_commonjsHelpers-ByX85dGu.mjs +0 -33
  128. package/dist/anchoredPopover-BzqGPOAE.js +0 -1
  129. package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
  130. package/dist/documentManager-CTqRftU8.mjs +0 -8369
  131. package/dist/documentManager-Jf0RbSks.js +0 -17
  132. package/dist/html2canvas.esm-B5qzocYs.js +0 -5
  133. package/dist/index-CvJk4DKa.js +0 -221
  134. package/dist/index-D3CycEFU.mjs +0 -16543
  135. package/dist/index-tqLTHcO6.js +0 -1
  136. package/dist/index.es-CE_A4QSm.js +0 -5
  137. package/dist/index.es-DQ78mYYo.mjs +0 -6665
  138. package/dist/jspdf.es.min-BoS80556.js +0 -77
  139. package/dist/plugins.css +0 -1
  140. /package/dist/{editorContainerHelpers-CFbfiOJI.js → editorContainerHelpers-36b8ddf3.js} +0 -0
@@ -1,7 +1,8 @@
1
- const g = ".rte-content, .editora-content", Y = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", w = '.rte-mention[data-mention="true"]', b = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', M = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap();
2
- let P = !1, N = !1, T = null, v = 0;
3
- function Q(e, n) {
4
- if (n === e.innerHTML) return;
1
+ const g = ".rte-content, .editora-content", ee = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", x = '.rte-mention[data-mention="true"]', y = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', R = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap();
2
+ let _ = !1, S = !1, w = null, k = 0;
3
+ function U(e, n) {
4
+ if (n === e.innerHTML)
5
+ return;
5
6
  const o = window.execEditorCommand || window.executeEditorCommand;
6
7
  if (typeof o == "function")
7
8
  try {
@@ -9,83 +10,92 @@ function Q(e, n) {
9
10
  } catch {
10
11
  }
11
12
  }
12
- function U(e) {
13
+ function W(e) {
13
14
  e.dispatchEvent(new Event("input", { bubbles: !0 }));
14
15
  }
15
16
  function h(e, n) {
16
17
  const o = window.getSelection();
17
18
  o && (o.removeAllRanges(), o.addRange(n), e.focus({ preventScroll: !0 }));
18
19
  }
19
- function S(e, n) {
20
+ function A(e, n) {
20
21
  return e.startContainer === n.startContainer && e.startOffset === n.startOffset && e.endContainer === n.endContainer && e.endOffset === n.endOffset;
21
22
  }
22
- function E(e) {
23
+ function b(e) {
23
24
  const n = window.getSelection();
24
- if (!n || n.rangeCount === 0) return null;
25
+ if (!n || n.rangeCount === 0)
26
+ return null;
25
27
  const o = n.getRangeAt(0);
26
28
  return e.contains(o.commonAncestorContainer) ? o.cloneRange() : null;
27
29
  }
28
- function C(e) {
29
- Array.from(e.querySelectorAll(w)).forEach((o) => {
30
+ function T(e) {
31
+ Array.from(e.querySelectorAll(x)).forEach((o) => {
30
32
  o.setAttribute("data-mention", "true"), o.setAttribute("contenteditable", "false"), o.setAttribute("spellcheck", "false"), o.setAttribute("draggable", "false"), o.classList.add("rte-mention");
31
33
  });
32
34
  }
33
- function _(e) {
35
+ function $(e) {
34
36
  return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
35
37
  }
36
- function ee(e) {
37
- return e.closest(Y) || e;
38
+ function ne(e) {
39
+ return e.closest(ee) || e;
38
40
  }
39
- function k(e) {
41
+ function L(e) {
40
42
  return e ? (e.getAttribute("data-theme") || e.getAttribute("theme") || "").toLowerCase() === "dark" ? !0 : e.classList.contains("dark") || e.classList.contains("editora-theme-dark") || e.classList.contains("rte-theme-dark") : !1;
41
43
  }
42
- function ne(e) {
43
- const n = ee(e);
44
- if (k(n)) return !0;
44
+ function te(e) {
45
+ const n = ne(e);
46
+ if (L(n))
47
+ return !0;
45
48
  const o = n.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
46
- return k(o) ? !0 : k(document.documentElement) || k(document.body);
49
+ return L(o) ? !0 : L(document.documentElement) || L(document.body);
47
50
  }
48
- function W(e, n) {
49
- e.classList.remove("rte-mention-theme-dark"), ne(n) && e.classList.add("rte-mention-theme-dark");
51
+ function G(e, n) {
52
+ e.classList.remove("rte-mention-theme-dark"), te(n) && e.classList.add("rte-mention-theme-dark");
50
53
  }
51
- function te(e) {
52
- if (e?.contentElement instanceof HTMLElement) return e.contentElement;
53
- if (e?.editorElement instanceof HTMLElement) {
54
+ function re(e) {
55
+ if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement)
56
+ return e.contentElement;
57
+ if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
54
58
  const t = e.editorElement;
55
- if (t.matches(g)) return t;
59
+ if (t.matches(g))
60
+ return t;
56
61
  const r = t.querySelector(g);
57
- if (r instanceof HTMLElement) return r;
62
+ if (r instanceof HTMLElement)
63
+ return r;
58
64
  }
59
65
  const n = window.getSelection();
60
66
  if (n && n.rangeCount > 0) {
61
- const t = n.getRangeAt(0).startContainer, i = (t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement)?.closest(g);
62
- if (i) return i;
67
+ const t = n.getRangeAt(0).startContainer, r = t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement, i = r == null ? void 0 : r.closest(g);
68
+ if (i)
69
+ return i;
63
70
  }
64
71
  const o = document.activeElement;
65
72
  if (o) {
66
- if (o.matches(g)) return o;
73
+ if (o.matches(g))
74
+ return o;
67
75
  const t = o.closest(g);
68
- if (t) return t;
76
+ if (t)
77
+ return t;
69
78
  }
70
79
  return document.querySelector(g);
71
80
  }
72
- function x(e) {
81
+ function E(e) {
73
82
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
74
83
  }
75
- function D(e) {
84
+ function q(e) {
76
85
  return typeof e == "object" && e !== null && !Array.isArray(e);
77
86
  }
78
- function re(e, n) {
87
+ function oe(e, n) {
79
88
  return n ? n.split(".").filter(Boolean).reduce((o, t) => {
80
- if (!(!D(o) && !Array.isArray(o)))
89
+ if (!(!q(o) && !Array.isArray(o)))
81
90
  return o[t];
82
91
  }, e) : e;
83
92
  }
84
- function oe(e) {
93
+ function ie(e) {
85
94
  return e ? /\s|[([{"'`]/.test(e) : !0;
86
95
  }
87
- function ie(e) {
88
- if (!e.collapsed) return null;
96
+ function ae(e) {
97
+ if (!e.collapsed)
98
+ return null;
89
99
  const n = e.startContainer, o = e.startOffset;
90
100
  if (n.nodeType === Node.TEXT_NODE) {
91
101
  const t = n;
@@ -111,12 +121,13 @@ function ie(e) {
111
121
  }
112
122
  return null;
113
123
  }
114
- function ae(e, n, o) {
124
+ function le(e, n, o) {
115
125
  let t = -1, r = "";
116
126
  if (n.forEach((a) => {
117
127
  const l = e.lastIndexOf(a);
118
128
  l > t && (t = l, r = a);
119
- }), t < 0 || !oe(e[t - 1])) return null;
129
+ }), t < 0 || !ie(e[t - 1]))
130
+ return null;
120
131
  const i = e.slice(t + 1);
121
132
  return /\s/.test(i) || i.length > o ? null : {
122
133
  trigger: r,
@@ -124,7 +135,7 @@ function ae(e, n, o) {
124
135
  startOffset: t
125
136
  };
126
137
  }
127
- function le(e, n) {
138
+ function se(e, n) {
128
139
  const o = n.cloneRange();
129
140
  o.collapse(!1);
130
141
  const t = o.getClientRects();
@@ -135,43 +146,50 @@ function le(e, n) {
135
146
  const i = r.getBoundingClientRect();
136
147
  return r.remove(), e.normalize(), i;
137
148
  }
138
- function se(e, n) {
139
- if (e.panel && e.list) return;
149
+ function ce(e, n) {
150
+ if (e.panel && e.list)
151
+ return;
140
152
  const o = document.createElement("div");
141
153
  o.className = "rte-mention-panel", o.style.display = "none";
142
154
  const t = document.createElement("div");
143
- t.className = "rte-mention-list", o.appendChild(t), document.body.appendChild(o), W(o, e.editor), e.panel = o, e.list = t, o.addEventListener("mousedown", (r) => {
155
+ t.className = "rte-mention-list", o.appendChild(t), document.body.appendChild(o), G(o, e.editor), e.panel = o, e.list = t, o.addEventListener("mousedown", (r) => {
144
156
  r.preventDefault();
145
157
  }), o.addEventListener("click", (r) => {
146
158
  const i = r.target;
147
- if (!i) return;
159
+ if (!i)
160
+ return;
148
161
  const a = i.closest(".rte-mention-item");
149
- if (!a) return;
162
+ if (!a)
163
+ return;
150
164
  const l = Number(a.getAttribute("data-index"));
151
- Number.isFinite(l) && K(e, n, l);
165
+ Number.isFinite(l) && V(e, n, l);
152
166
  });
153
167
  }
154
- function m(e) {
168
+ function f(e) {
155
169
  e.panel && (e.debounceHandle !== null && (window.clearTimeout(e.debounceHandle), e.debounceHandle = null), e.abortController && (e.abortController.abort(), e.abortController = null), e.panel.style.display = "none", e.panel.classList.remove("show"), e.isOpen = !1, e.loading = !1, e.items = [], e.activeIndex = 0, e.query = "", e.replaceRange = null);
156
170
  }
157
- function $(e, n) {
158
- if (!e.panel) return;
159
- W(e.panel, e.editor);
160
- const o = le(e.editor, n), t = e.panel;
171
+ function B(e, n) {
172
+ if (!e.panel)
173
+ return;
174
+ G(e.panel, e.editor);
175
+ const o = se(e.editor, n), t = e.panel;
161
176
  t.style.display = "block", t.classList.add("show"), t.style.left = "0px", t.style.top = "0px";
162
177
  const r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight;
163
178
  let l = Math.max(8, Math.min(o.left, i - r.width - 8)), s = o.bottom + 8;
164
179
  s + r.height > a - 8 && (s = Math.max(8, o.top - r.height - 8)), t.style.position = "fixed", t.style.left = `${l}px`, t.style.top = `${s}px`;
165
180
  }
166
- function ce(e, n) {
167
- if (!n) return x(e);
181
+ function ue(e, n) {
182
+ if (!n)
183
+ return E(e);
168
184
  const o = e.toLowerCase(), t = n.toLowerCase(), r = o.indexOf(t);
169
- if (r < 0) return x(e);
170
- const i = x(e.slice(0, r)), a = x(e.slice(r, r + n.length)), l = x(e.slice(r + n.length));
185
+ if (r < 0)
186
+ return E(e);
187
+ const i = E(e.slice(0, r)), a = E(e.slice(r, r + n.length)), l = E(e.slice(r + n.length));
171
188
  return `${i}<mark>${a}</mark>${l}`;
172
189
  }
173
- function B(e, n) {
174
- if (!e.list) return;
190
+ function j(e, n) {
191
+ if (!e.list)
192
+ return;
175
193
  const o = e.list;
176
194
  if (o.innerHTML = "", e.loading) {
177
195
  const t = document.createElement("div");
@@ -186,11 +204,11 @@ function B(e, n) {
186
204
  e.items.forEach((t, r) => {
187
205
  const i = document.createElement("button");
188
206
  i.type = "button", i.className = "rte-mention-item", r === e.activeIndex && i.classList.add("active"), i.setAttribute("data-index", String(r));
189
- const a = n.itemRenderer ? n.itemRenderer(t, e.query) : `<span class="rte-mention-item-label">${ce(t.label, e.query)}</span>${t.meta ? `<span class="rte-mention-item-meta">${x(t.meta)}</span>` : ""}`;
207
+ const a = n.itemRenderer ? n.itemRenderer(t, e.query) : `<span class="rte-mention-item-label">${ue(t.label, e.query)}</span>${t.meta ? `<span class="rte-mention-item-meta">${E(t.meta)}</span>` : ""}`;
190
208
  i.innerHTML = a, o.appendChild(i);
191
209
  });
192
210
  }
193
- function G(e, n) {
211
+ function K(e, n) {
194
212
  const o = /* @__PURE__ */ new Set(), t = [];
195
213
  return e.forEach((r) => {
196
214
  const i = (r.id || "").trim();
@@ -202,7 +220,7 @@ function G(e, n) {
202
220
  }));
203
221
  }), t.slice(0, n);
204
222
  }
205
- function ue(e, n) {
223
+ function de(e, n) {
206
224
  if (e.buildRequest) {
207
225
  const c = e.buildRequest(n);
208
226
  return {
@@ -217,29 +235,31 @@ function ue(e, n) {
217
235
  mode: e.mode,
218
236
  cache: e.cache,
219
237
  signal: n.signal
220
- }, f = new URL(e.url, window.location.origin);
238
+ }, m = new URL(e.url, window.location.origin);
221
239
  if (o === "GET" || o === "HEAD") {
222
- const c = new URLSearchParams(f.search);
223
- Object.entries(l).forEach(([d, p]) => c.set(d, String(p))), c.set(r, n.query), c.set(i, n.trigger), c.set(a, String(n.limit)), f.search = c.toString();
240
+ const c = new URLSearchParams(m.search);
241
+ Object.entries(l).forEach(([p, u]) => c.set(p, String(u))), c.set(r, n.query), c.set(i, n.trigger), c.set(a, String(n.limit)), m.search = c.toString();
224
242
  } else {
225
- const c = typeof e.body == "function" ? e.body(n) : e.body, d = {
243
+ const c = typeof e.body == "function" ? e.body(n) : e.body, p = {
226
244
  [r]: n.query,
227
245
  [i]: n.trigger,
228
246
  [a]: n.limit,
229
247
  ...l
230
- }, p = c ?? d;
231
- if (D(p)) {
232
- s.body = JSON.stringify(p);
233
- const y = s.headers;
234
- !y["Content-Type"] && !y["content-type"] && (y["Content-Type"] = "application/json");
248
+ }, u = c ?? p;
249
+ if (q(u)) {
250
+ s.body = JSON.stringify(u);
251
+ const C = s.headers;
252
+ !C["Content-Type"] && !C["content-type"] && (C["Content-Type"] = "application/json");
235
253
  } else
236
- s.body = p;
254
+ s.body = u;
237
255
  }
238
- return { url: f.toString(), init: s };
256
+ return { url: m.toString(), init: s };
239
257
  }
240
- async function de(e, n, o, t) {
258
+ async function fe(e, n, o, t) {
259
+ var m;
241
260
  const r = n.api;
242
- if (!r) return [];
261
+ if (!r)
262
+ return [];
243
263
  e.abortController && e.abortController.abort();
244
264
  const i = new AbortController();
245
265
  e.abortController = i;
@@ -252,105 +272,113 @@ async function de(e, n, o, t) {
252
272
  let s = null;
253
273
  l > 0 && (s = window.setTimeout(() => i.abort(), l));
254
274
  try {
255
- const { url: f, init: c } = ue(r, a), d = await fetch(f, {
256
- ...c,
275
+ const { url: c, init: p } = de(r, a), u = await fetch(c, {
276
+ ...p,
257
277
  signal: i.signal
258
278
  });
259
- if (!d.ok)
260
- throw new Error(`Mention API request failed: ${d.status}`);
261
- const y = (r.responseType || "json") === "text" ? await d.text() : await d.json();
262
- let O = [];
279
+ if (!u.ok)
280
+ throw new Error(`Mention API request failed: ${u.status}`);
281
+ const v = (r.responseType || "json") === "text" ? await u.text() : await u.json();
282
+ let I = [];
263
283
  if (r.transformResponse)
264
- O = r.transformResponse(y, a) || [];
284
+ I = r.transformResponse(v, a) || [];
265
285
  else {
266
- const q = re(y, r.responsePath);
267
- O = (Array.isArray(q) ? q : Array.isArray(y) ? y : []).map((u, J) => {
286
+ const P = oe(v, r.responsePath);
287
+ I = (Array.isArray(P) ? P : Array.isArray(v) ? v : []).map((d, Z) => {
268
288
  if (r.mapItem)
269
- return r.mapItem(u, J);
270
- if (!D(u)) return null;
271
- const I = String(u.id ?? u.value ?? u.key ?? "").trim();
272
- if (!I) return null;
273
- const Z = String(u.label ?? u.name ?? I).trim();
289
+ return r.mapItem(d, Z);
290
+ if (!q(d))
291
+ return null;
292
+ const H = String(d.id ?? d.value ?? d.key ?? "").trim();
293
+ if (!H)
294
+ return null;
295
+ const Y = String(d.label ?? d.name ?? H).trim();
274
296
  return {
275
- id: I,
276
- label: Z,
277
- value: u.value ? String(u.value) : void 0,
278
- meta: u.meta ? String(u.meta) : void 0
297
+ id: H,
298
+ label: Y,
299
+ value: d.value ? String(d.value) : void 0,
300
+ meta: d.meta ? String(d.meta) : void 0
279
301
  };
280
- }).filter((u) => !!u);
302
+ }).filter((d) => !!d);
281
303
  }
282
- return G(O, n.maxSuggestions);
283
- } catch (f) {
284
- return f?.name !== "AbortError" && r.onError?.(f, a), [];
304
+ return K(I, n.maxSuggestions);
305
+ } catch (c) {
306
+ return (c == null ? void 0 : c.name) !== "AbortError" && ((m = r.onError) == null || m.call(r, c, a)), [];
285
307
  } finally {
286
308
  s !== null && window.clearTimeout(s), e.abortController === i && (e.abortController = null);
287
309
  }
288
310
  }
289
- async function fe(e, n, o, t) {
311
+ async function me(e, n, o, t) {
290
312
  const r = ++e.requestId;
291
313
  let i = [];
292
314
  if (n.search) {
293
315
  const a = await n.search(o, t);
294
316
  i = Array.isArray(a) ? a : [];
295
317
  } else if (n.api)
296
- i = await de(e, n, o, t);
318
+ i = await fe(e, n, o, t);
297
319
  else {
298
320
  const a = o.toLowerCase();
299
321
  i = n.items.filter((l) => a ? l.label.toLowerCase().includes(a) || l.id.toLowerCase().includes(a) : !0);
300
322
  }
301
- return r !== e.requestId ? [] : G(i, n.maxSuggestions);
323
+ return r !== e.requestId ? [] : K(i, n.maxSuggestions);
302
324
  }
303
- function me(e, n, o) {
325
+ function pe(e, n, o) {
304
326
  const t = e.editor;
305
- if (C(t), !window.getSelection()) return !1;
327
+ if (T(t), !window.getSelection())
328
+ return !1;
306
329
  const i = t.innerHTML;
307
- let a = e.replaceRange ? e.replaceRange.cloneRange() : E(t);
308
- if (!a || !t.contains(a.commonAncestorContainer) && (a = E(t), !a))
330
+ let a = e.replaceRange ? e.replaceRange.cloneRange() : b(t);
331
+ if (!a || !t.contains(a.commonAncestorContainer) && (a = b(t), !a))
309
332
  return !1;
310
- const l = A(t, a.cloneRange(), "after");
311
- S(l, a) || (h(t, l), a = l), a.deleteContents();
333
+ const l = O(t, a.cloneRange(), "after");
334
+ A(l, a) || (h(t, l), a = l), a.deleteContents();
312
335
  const s = document.createElement("span");
313
336
  s.className = "rte-mention", s.setAttribute("data-mention", "true"), s.setAttribute("data-mention-id", o.id), s.setAttribute("contenteditable", "false"), s.textContent = o.value || `${e.trigger}${o.label}`, a.insertNode(s);
314
- let f = s, c = 1;
337
+ let m = s, c = 1;
315
338
  if (n.insertSpaceAfterMention) {
316
- const p = document.createTextNode(" ");
317
- s.after(p), f = p, c = 1;
339
+ const u = document.createTextNode(" ");
340
+ s.after(u), m = u, c = 1;
318
341
  }
319
- const d = document.createRange();
320
- return d.setStart(f, c), d.collapse(!0), h(t, d), m(e), C(t), U(t), Q(t, i), !0;
342
+ const p = document.createRange();
343
+ return p.setStart(m, c), p.collapse(!0), h(t, p), f(e), T(t), W(t), U(t, i), !0;
321
344
  }
322
- function K(e, n, o) {
323
- if (o < 0 || o >= e.items.length) return;
345
+ function V(e, n, o) {
346
+ if (o < 0 || o >= e.items.length)
347
+ return;
324
348
  const t = e.items[o];
325
- me(e, n, t);
349
+ pe(e, n, t);
326
350
  }
327
- function pe(e) {
351
+ function ge(e) {
328
352
  return e.startContainer !== e.endContainer || e.startContainer.nodeType !== Node.ELEMENT_NODE || e.endOffset - e.startOffset !== 1 ? null : e.startContainer.childNodes[e.startOffset] || null;
329
353
  }
330
- function ge(e, n) {
331
- const o = pe(e);
332
- return !(o instanceof HTMLElement) || !o.matches(w) || !n.contains(o) ? null : o;
333
- }
334
- function V(e, n) {
335
- const o = ge(e, n);
336
- if (o) return o;
337
- const r = _(e.startContainer)?.closest(w);
338
- if (r && n.contains(r)) return r;
339
- const a = _(e.endContainer)?.closest(w);
354
+ function he(e, n) {
355
+ const o = ge(e);
356
+ return !(o instanceof HTMLElement) || !o.matches(x) || !n.contains(o) ? null : o;
357
+ }
358
+ function X(e, n) {
359
+ const o = he(e, n);
360
+ if (o)
361
+ return o;
362
+ const t = $(e.startContainer), r = t == null ? void 0 : t.closest(x);
363
+ if (r && n.contains(r))
364
+ return r;
365
+ const i = $(e.endContainer), a = i == null ? void 0 : i.closest(x);
340
366
  return a && n.contains(a) ? a : null;
341
367
  }
342
- function A(e, n, o = "after") {
343
- const t = V(n, e);
344
- if (!t) return n;
368
+ function O(e, n, o = "after") {
369
+ const t = X(n, e);
370
+ if (!t)
371
+ return n;
345
372
  const r = document.createRange();
346
373
  return o === "before" ? r.setStartBefore(t) : r.setStartAfter(t), r.collapse(!0), r;
347
374
  }
348
- function j(e, n, o = "after") {
375
+ function z(e, n, o = "after") {
349
376
  const t = document.createRange();
350
377
  o === "before" ? t.setStartBefore(n) : t.setStartAfter(n), t.collapse(!0), h(e, t);
351
378
  }
352
- function he(e, n, o) {
353
- if (!e.collapsed) return null;
379
+ function ye(e, n, o) {
380
+ if (!e.collapsed)
381
+ return null;
354
382
  const t = e.startContainer, r = e.startOffset;
355
383
  let i = null;
356
384
  if (t.nodeType === Node.TEXT_NODE) {
@@ -360,68 +388,76 @@ function he(e, n, o) {
360
388
  const a = t;
361
389
  n === "backward" && r > 0 ? i = a.childNodes[r - 1] || null : n === "forward" && r < a.childNodes.length && (i = a.childNodes[r] || null);
362
390
  }
363
- return !(i instanceof HTMLElement) || !i.matches(w) || !o.contains(i) ? null : i;
391
+ return !(i instanceof HTMLElement) || !i.matches(x) || !o.contains(i) ? null : i;
364
392
  }
365
- function z(e, n) {
366
- const o = E(e);
367
- if (!o) return !1;
368
- const t = he(o, n, e);
369
- if (!t) return !1;
393
+ function F(e, n) {
394
+ const o = b(e);
395
+ if (!o)
396
+ return !1;
397
+ const t = ye(o, n, e);
398
+ if (!t)
399
+ return !1;
370
400
  const r = t.parentNode;
371
- if (!r) return !1;
401
+ if (!r)
402
+ return !1;
372
403
  const i = e.innerHTML, a = Array.prototype.indexOf.call(r.childNodes, t);
373
404
  t.remove();
374
405
  const l = document.createRange();
375
- return l.setStart(r, Math.max(0, a)), l.collapse(!0), h(e, l), U(e), Q(e, i), !0;
406
+ return l.setStart(r, Math.max(0, a)), l.collapse(!0), h(e, l), W(e), U(e, i), !0;
376
407
  }
377
- function X(e, n, o, t, r, i) {
378
- if (se(e, n), e.query = t, e.trigger = r, e.replaceRange = i.cloneRange(), e.loading = !!(n.api && !n.search), e.debounceHandle !== null && (window.clearTimeout(e.debounceHandle), e.debounceHandle = null), !e.panel) return;
379
- e.isOpen || (e.panel.style.display = "block", e.panel.classList.add("show"), e.isOpen = !0), B(e, n), $(e, o);
408
+ function J(e, n, o, t, r, i) {
409
+ if (ce(e, n), e.query = t, e.trigger = r, e.replaceRange = i.cloneRange(), e.loading = !!(n.api && !n.search), e.debounceHandle !== null && (window.clearTimeout(e.debounceHandle), e.debounceHandle = null), !e.panel)
410
+ return;
411
+ e.isOpen || (e.panel.style.display = "block", e.panel.classList.add("show"), e.isOpen = !0), j(e, n), B(e, o);
380
412
  const a = () => {
381
- e.debounceHandle = null, fe(e, n, t, r).then((s) => {
382
- e.loading = !1, e.items = s, e.activeIndex = 0, e.panel && (B(e, n), $(e, o));
413
+ e.debounceHandle = null, me(e, n, t, r).then((s) => {
414
+ e.loading = !1, e.items = s, e.activeIndex = 0, e.panel && (j(e, n), B(e, o));
383
415
  });
384
416
  }, l = n.api && !n.search ? Math.max(0, n.api.debounceMs ?? 180) : 0;
385
417
  l > 0 ? e.debounceHandle = window.setTimeout(a, l) : a();
386
418
  }
387
- function ye(e, n) {
419
+ function be(e, n) {
388
420
  const o = e.editor;
389
- C(o);
390
- let t = E(o);
421
+ T(o);
422
+ let t = b(o);
391
423
  if (!t || !t.collapsed) {
392
- m(e);
424
+ f(e);
393
425
  return;
394
426
  }
395
- const r = A(o, t.cloneRange(), "after");
396
- if (!S(r, t)) {
397
- h(o, r), t = r, m(e);
427
+ const r = O(o, t.cloneRange(), "after");
428
+ if (!A(r, t)) {
429
+ h(o, r), t = r, f(e);
398
430
  return;
399
431
  }
400
- const i = ie(t);
432
+ const i = ae(t);
401
433
  if (!i) {
402
- m(e);
434
+ f(e);
403
435
  return;
404
436
  }
405
- const a = ae(i.textBefore, n.triggerChars, n.maxQueryLength);
437
+ const a = le(i.textBefore, n.triggerChars, n.maxQueryLength);
406
438
  if (!a) {
407
- m(e);
439
+ f(e);
408
440
  return;
409
441
  }
410
442
  if (a.query.length < n.minChars) {
411
- m(e);
443
+ f(e);
412
444
  return;
413
445
  }
414
446
  const l = t.cloneRange();
415
- l.setStart(i.node, a.startOffset), l.setEnd(i.node, i.caretOffset), X(e, n, t, a.query, a.trigger, l);
447
+ l.setStart(i.node, a.startOffset), l.setEnd(i.node, i.caretOffset), J(e, n, t, a.query, a.trigger, l);
416
448
  }
417
- function F(e, n) {
418
- if (e.items.length === 0) return;
449
+ function Q(e, n) {
450
+ if (e.items.length === 0)
451
+ return;
419
452
  const o = e.items.length;
420
- if (e.activeIndex = ((e.activeIndex + n) % o + o) % o, !e.list) return;
453
+ if (e.activeIndex = ((e.activeIndex + n) % o + o) % o, !e.list)
454
+ return;
421
455
  const t = Array.from(e.list.querySelectorAll(".rte-mention-item"));
422
- t.forEach((i, a) => i.classList.toggle("active", a === e.activeIndex)), t[e.activeIndex]?.scrollIntoView({ block: "nearest" });
456
+ t.forEach((i, a) => i.classList.toggle("active", a === e.activeIndex));
457
+ const r = t[e.activeIndex];
458
+ r == null || r.scrollIntoView({ block: "nearest" });
423
459
  }
424
- function be(e) {
460
+ function Ee(e) {
425
461
  return {
426
462
  editor: e,
427
463
  panel: null,
@@ -438,60 +474,65 @@ function be(e) {
438
474
  abortController: null
439
475
  };
440
476
  }
441
- function Ee(e) {
442
- const n = M.get(e);
443
- n && (n.panel?.parentNode && n.panel.parentNode.removeChild(n.panel), M.delete(e));
477
+ function xe(e) {
478
+ var o;
479
+ const n = R.get(e);
480
+ n && ((o = n.panel) != null && o.parentNode && n.panel.parentNode.removeChild(n.panel), R.delete(e));
444
481
  }
445
- function H(e, n, o) {
446
- if (R.has(e)) return;
447
- C(e);
482
+ function D(e, n, o) {
483
+ if (N.has(e))
484
+ return;
485
+ T(e);
448
486
  const t = {
449
487
  beforeInput: (r) => {
450
- C(e);
451
- const i = E(e);
452
- if (!i) return;
453
- const a = V(i, e);
454
- if (!a) return;
488
+ T(e);
489
+ const i = b(e);
490
+ if (!i)
491
+ return;
492
+ const a = X(i, e);
493
+ if (!a)
494
+ return;
455
495
  const l = r.inputType || "";
456
496
  if (l.startsWith("insert")) {
457
- if (r.preventDefault(), j(e, a, "after"), l === "insertParagraph" || l === "insertLineBreak") {
497
+ if (r.preventDefault(), z(e, a, "after"), l === "insertParagraph" || l === "insertLineBreak") {
458
498
  const s = l === "insertLineBreak" ? "insertLineBreak" : "insertParagraph";
459
499
  document.execCommand(s, !1);
460
500
  return;
461
501
  }
462
502
  if (l === "insertText" || l === "insertCompositionText") {
463
503
  const s = r.data || "";
464
- if (!s) return;
504
+ if (!s)
505
+ return;
465
506
  document.execCommand("insertText", !1, s);
466
507
  }
467
508
  }
468
509
  },
469
510
  input: () => {
470
- ye(n, o);
511
+ be(n, o);
471
512
  },
472
513
  keydown: (r) => {
473
514
  if (n.isOpen) {
474
515
  if (r.key === "ArrowDown") {
475
- r.preventDefault(), F(n, 1);
516
+ r.preventDefault(), Q(n, 1);
476
517
  return;
477
518
  }
478
519
  if (r.key === "ArrowUp") {
479
- r.preventDefault(), F(n, -1);
520
+ r.preventDefault(), Q(n, -1);
480
521
  return;
481
522
  }
482
523
  if (r.key === "Enter" || r.key === "Tab") {
483
- r.preventDefault(), K(n, o, n.activeIndex);
524
+ r.preventDefault(), V(n, o, n.activeIndex);
484
525
  return;
485
526
  }
486
527
  if (r.key === "Escape") {
487
- r.preventDefault(), m(n);
528
+ r.preventDefault(), f(n);
488
529
  return;
489
530
  }
490
531
  }
491
- const i = E(e);
532
+ const i = b(e);
492
533
  if (i) {
493
- const a = A(e, i.cloneRange(), "after");
494
- if (!S(a, i)) {
534
+ const a = O(e, i.cloneRange(), "after");
535
+ if (!A(a, i)) {
495
536
  if (r.key === "Enter") {
496
537
  r.preventDefault(), h(e, a), document.execCommand("insertParagraph", !1);
497
538
  return;
@@ -499,42 +540,45 @@ function H(e, n, o) {
499
540
  r.key.length === 1 && !r.metaKey && !r.ctrlKey && !r.altKey && h(e, a);
500
541
  }
501
542
  }
502
- if (r.key === "Backspace" && z(e, "backward")) {
543
+ if (r.key === "Backspace" && F(e, "backward")) {
503
544
  r.preventDefault();
504
545
  return;
505
546
  }
506
- if (r.key === "Delete" && z(e, "forward")) {
547
+ if (r.key === "Delete" && F(e, "forward")) {
507
548
  r.preventDefault();
508
549
  return;
509
550
  }
510
551
  },
511
552
  click: (r) => {
512
553
  const i = r.target;
513
- if (!i) return;
514
- const l = (i.nodeType === Node.ELEMENT_NODE ? i : i.parentElement)?.closest(w);
515
- !l || !e.contains(l) || (r.preventDefault(), r.stopPropagation(), j(e, l, "after"), m(n));
554
+ if (!i)
555
+ return;
556
+ const a = i.nodeType === Node.ELEMENT_NODE ? i : i.parentElement, l = a == null ? void 0 : a.closest(x);
557
+ !l || !e.contains(l) || (r.preventDefault(), r.stopPropagation(), z(e, l, "after"), f(n));
516
558
  },
517
559
  blur: () => {
518
560
  window.setTimeout(() => {
519
561
  const r = document.activeElement;
520
- n.panel && r && n.panel.contains(r) || m(n);
562
+ n.panel && r && n.panel.contains(r) || f(n);
521
563
  }, 0);
522
564
  },
523
565
  mousedown: (r) => {
524
- if (!n.isOpen || !n.panel) return;
566
+ if (!n.isOpen || !n.panel)
567
+ return;
525
568
  const i = r.target;
526
- i && !n.panel.contains(i) && !e.contains(i) && m(n);
569
+ i && !n.panel.contains(i) && !e.contains(i) && f(n);
527
570
  }
528
571
  };
529
- e.addEventListener("beforeinput", t.beforeInput), e.addEventListener("input", t.input), e.addEventListener("keydown", t.keydown), e.addEventListener("click", t.click), e.addEventListener("blur", t.blur), document.addEventListener("mousedown", t.mousedown, !0), R.set(e, t);
572
+ e.addEventListener("beforeinput", t.beforeInput), e.addEventListener("input", t.input), e.addEventListener("keydown", t.keydown), e.addEventListener("click", t.click), e.addEventListener("blur", t.blur), document.addEventListener("mousedown", t.mousedown, !0), N.set(e, t);
530
573
  }
531
- function xe(e) {
532
- const n = R.get(e);
533
- n && (e.removeEventListener("beforeinput", n.beforeInput), e.removeEventListener("input", n.input), e.removeEventListener("keydown", n.keydown), e.removeEventListener("click", n.click), e.removeEventListener("blur", n.blur), document.removeEventListener("mousedown", n.mousedown, !0), R.delete(e));
574
+ function we(e) {
575
+ const n = N.get(e);
576
+ n && (e.removeEventListener("beforeinput", n.beforeInput), e.removeEventListener("input", n.input), e.removeEventListener("keydown", n.keydown), e.removeEventListener("click", n.click), e.removeEventListener("blur", n.blur), document.removeEventListener("mousedown", n.mousedown, !0), N.delete(e));
534
577
  }
535
- function we() {
536
- if (P || typeof document > "u") return;
537
- P = !0;
578
+ function Te() {
579
+ if (_ || typeof document > "u")
580
+ return;
581
+ _ = !0;
538
582
  const e = document.createElement("style");
539
583
  e.id = "rte-mention-plugin-styles", e.textContent = `
540
584
  .rte-mention {
@@ -609,40 +653,40 @@ function we() {
609
653
  text-align: center;
610
654
  }
611
655
 
612
- ${b} .rte-mention {
656
+ ${y} .rte-mention {
613
657
  background: rgba(37, 99, 235, 0.25);
614
658
  color: #bfdbfe;
615
659
  }
616
660
 
617
- ${b} .rte-mention-panel,
661
+ ${y} .rte-mention-panel,
618
662
  .rte-mention-panel.rte-mention-theme-dark {
619
663
  border-color: #364152;
620
664
  background: #1f2937;
621
665
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.48);
622
666
  }
623
667
 
624
- ${b} .rte-mention-item,
668
+ ${y} .rte-mention-item,
625
669
  .rte-mention-panel.rte-mention-theme-dark .rte-mention-item {
626
670
  color: #e5e7eb;
627
671
  }
628
672
 
629
- ${b} .rte-mention-item:hover,
630
- ${b} .rte-mention-item.active,
673
+ ${y} .rte-mention-item:hover,
674
+ ${y} .rte-mention-item.active,
631
675
  .rte-mention-panel.rte-mention-theme-dark .rte-mention-item:hover,
632
676
  .rte-mention-panel.rte-mention-theme-dark .rte-mention-item.active {
633
677
  background: #334155;
634
678
  color: #bfdbfe;
635
679
  }
636
680
 
637
- ${b} .rte-mention-item-meta,
638
- ${b} .rte-mention-empty,
681
+ ${y} .rte-mention-item-meta,
682
+ ${y} .rte-mention-empty,
639
683
  .rte-mention-panel.rte-mention-theme-dark .rte-mention-item-meta,
640
684
  .rte-mention-panel.rte-mention-theme-dark .rte-mention-empty {
641
685
  color: #9ca3af;
642
686
  }
643
687
  `, document.head.appendChild(e);
644
688
  }
645
- function Te(e) {
689
+ function Ce(e) {
646
690
  const n = (e.triggerChars || ["@"]).filter((o) => typeof o == "string" && o.length > 0).map((o) => o[0]);
647
691
  return {
648
692
  triggerChars: n.length > 0 ? n : ["@"],
@@ -663,28 +707,31 @@ function Te(e) {
663
707
  insertSpaceAfterMention: e.insertSpaceAfterMention !== !1
664
708
  };
665
709
  }
666
- function L(e) {
667
- const n = M.get(e);
668
- if (n) return n;
669
- const o = be(e);
670
- return M.set(e, o), o;
710
+ function M(e) {
711
+ const n = R.get(e);
712
+ if (n)
713
+ return n;
714
+ const o = Ee(e);
715
+ return R.set(e, o), o;
671
716
  }
672
- function Ce(e) {
673
- N || (N = !0, T = (n) => {
717
+ function ve(e) {
718
+ S || (S = !0, w = (n) => {
674
719
  const o = n.target;
675
- if (!(o instanceof Node)) return;
676
- const r = (o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement)?.closest(g) || null;
677
- if (!r) return;
678
- const i = L(r);
679
- H(r, i, e);
680
- }, document.addEventListener("focusin", T, !0));
681
- }
682
- function ve() {
683
- !N || !T || (document.removeEventListener("focusin", T, !0), N = !1, T = null);
684
- }
685
- const Le = (e = {}) => {
686
- we();
687
- const n = Te(e);
720
+ if (!(o instanceof Node))
721
+ return;
722
+ const t = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement, r = (t == null ? void 0 : t.closest(g)) || null;
723
+ if (!r)
724
+ return;
725
+ const i = M(r);
726
+ D(r, i, e);
727
+ }, document.addEventListener("focusin", w, !0));
728
+ }
729
+ function ke() {
730
+ !S || !w || (document.removeEventListener("focusin", w, !0), S = !1, w = null);
731
+ }
732
+ const Me = (e = {}) => {
733
+ Te();
734
+ const n = Ce(e);
688
735
  return {
689
736
  name: "mentions",
690
737
  toolbar: [
@@ -696,31 +743,32 @@ const Le = (e = {}) => {
696
743
  ],
697
744
  commands: {
698
745
  insertMention: (o, t) => {
699
- const r = te(t);
700
- if (!r) return !1;
701
- const i = L(r);
702
- H(r, i, n);
703
- let a = E(r);
746
+ const r = re(t);
747
+ if (!r)
748
+ return !1;
749
+ const i = M(r);
750
+ D(r, i, n);
751
+ let a = b(r);
704
752
  a || (a = document.createRange(), a.selectNodeContents(r), a.collapse(!1), h(r, a));
705
- const l = A(r, a.cloneRange(), "after");
706
- S(l, a) || (h(r, l), a = l), i.query = "";
753
+ const l = O(r, a.cloneRange(), "after");
754
+ A(l, a) || (h(r, l), a = l), i.query = "";
707
755
  const s = a.cloneRange();
708
- return i.trigger = n.triggerChars[0], X(i, n, a, "", i.trigger, s), !0;
756
+ return i.trigger = n.triggerChars[0], J(i, n, a, "", i.trigger, s), !0;
709
757
  }
710
758
  },
711
759
  init: () => {
712
- v += 1, Ce(n), Array.from(document.querySelectorAll(g)).forEach((t) => {
713
- const r = L(t);
714
- H(t, r, n);
760
+ k += 1, ve(n), Array.from(document.querySelectorAll(g)).forEach((t) => {
761
+ const r = M(t);
762
+ D(t, r, n);
715
763
  });
716
764
  },
717
765
  destroy: () => {
718
- v = Math.max(0, v - 1), Array.from(document.querySelectorAll(g)).forEach((t) => {
719
- m(L(t)), xe(t), Ee(t);
720
- }), v === 0 && ve();
766
+ k = Math.max(0, k - 1), Array.from(document.querySelectorAll(g)).forEach((t) => {
767
+ f(M(t)), we(t), xe(t);
768
+ }), k === 0 && ke();
721
769
  }
722
770
  };
723
771
  };
724
772
  export {
725
- Le as MentionPlugin
773
+ Me as MentionPlugin
726
774
  };