@ryzeup/richtexteditor 1.0.4 → 1.0.6

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.
package/dist/index.es.js CHANGED
@@ -1,447 +1,172 @@
1
- var Ge = Object.defineProperty, Qe = Object.defineProperties;
2
- var et = Object.getOwnPropertyDescriptors;
3
- var ze = Object.getOwnPropertySymbols;
4
- var tt = Object.prototype.hasOwnProperty, nt = Object.prototype.propertyIsEnumerable;
5
- var Ne = (t, s, c) => s in t ? Ge(t, s, { enumerable: !0, configurable: !0, writable: !0, value: c }) : t[s] = c, be = (t, s) => {
6
- for (var c in s || (s = {}))
7
- tt.call(s, c) && Ne(t, c, s[c]);
8
- if (ze)
9
- for (var c of ze(s))
10
- nt.call(s, c) && Ne(t, c, s[c]);
1
+ var qe = Object.defineProperty, We = Object.defineProperties;
2
+ var Ke = Object.getOwnPropertyDescriptors;
3
+ var pe = Object.getOwnPropertySymbols;
4
+ var Xe = Object.prototype.hasOwnProperty, Ye = Object.prototype.propertyIsEnumerable;
5
+ var ve = (t, c, i) => c in t ? qe(t, c, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[c] = i, Q = (t, c) => {
6
+ for (var i in c || (c = {}))
7
+ Xe.call(c, i) && ve(t, i, c[i]);
8
+ if (pe)
9
+ for (var i of pe(c))
10
+ Ye.call(c, i) && ve(t, i, c[i]);
11
11
  return t;
12
- }, ye = (t, s) => Qe(t, et(s));
13
- import W, { useRef as U, useState as F, useEffect as ae } from "react";
14
- var fe = { exports: {} }, re = {};
15
- /**
16
- * @license React
17
- * react-jsx-runtime.production.js
18
- *
19
- * Copyright (c) Meta Platforms, Inc. and affiliates.
20
- *
21
- * This source code is licensed under the MIT license found in the
22
- * LICENSE file in the root directory of this source tree.
23
- */
24
- var Oe;
25
- function rt() {
26
- if (Oe) return re;
27
- Oe = 1;
28
- var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
29
- function c(d, f, w) {
30
- var k = null;
31
- if (w !== void 0 && (k = "" + w), f.key !== void 0 && (k = "" + f.key), "key" in f) {
32
- w = {};
33
- for (var R in f)
34
- R !== "key" && (w[R] = f[R]);
35
- } else w = f;
36
- return f = w.ref, {
37
- $$typeof: t,
38
- type: d,
39
- key: k,
40
- ref: f !== void 0 ? f : null,
41
- props: w
42
- };
43
- }
44
- return re.Fragment = s, re.jsx = c, re.jsxs = c, re;
45
- }
46
- var oe = {};
47
- /**
48
- * @license React
49
- * react-jsx-runtime.development.js
50
- *
51
- * Copyright (c) Meta Platforms, Inc. and affiliates.
52
- *
53
- * This source code is licensed under the MIT license found in the
54
- * LICENSE file in the root directory of this source tree.
55
- */
56
- var Pe;
57
- function ot() {
58
- return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
59
- function t(n) {
60
- if (n == null) return null;
61
- if (typeof n == "function")
62
- return n.$$typeof === se ? null : n.displayName || n.name || null;
63
- if (typeof n == "string") return n;
64
- switch (n) {
65
- case A:
66
- return "Fragment";
67
- case H:
68
- return "Profiler";
69
- case q:
70
- return "StrictMode";
71
- case C:
72
- return "Suspense";
73
- case J:
74
- return "SuspenseList";
75
- case ge:
76
- return "Activity";
77
- }
78
- if (typeof n == "object")
79
- switch (typeof n.tag == "number" && console.error(
80
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
81
- ), n.$$typeof) {
82
- case B:
83
- return "Portal";
84
- case Z:
85
- return n.displayName || "Context";
86
- case V:
87
- return (n._context.displayName || "Context") + ".Consumer";
88
- case h:
89
- var v = n.render;
90
- return n = n.displayName, n || (n = v.displayName || v.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
91
- case le:
92
- return v = n.displayName || null, v !== null ? v : t(n.type) || "Memo";
93
- case G:
94
- v = n._payload, n = n._init;
95
- try {
96
- return t(n(v));
97
- } catch (_) {
98
- }
99
- }
100
- return null;
101
- }
102
- function s(n) {
103
- return "" + n;
104
- }
105
- function c(n) {
106
- try {
107
- s(n);
108
- var v = !1;
109
- } catch (K) {
110
- v = !0;
111
- }
112
- if (v) {
113
- v = console;
114
- var _ = v.error, S = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
115
- return _.call(
116
- v,
117
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
118
- S
119
- ), s(n);
120
- }
121
- }
122
- function d(n) {
123
- if (n === A) return "<>";
124
- if (typeof n == "object" && n !== null && n.$$typeof === G)
125
- return "<...>";
126
- try {
127
- var v = t(n);
128
- return v ? "<" + v + ">" : "<...>";
129
- } catch (_) {
130
- return "<...>";
131
- }
132
- }
133
- function f() {
134
- var n = N.A;
135
- return n === null ? null : n.getOwner();
136
- }
137
- function w() {
138
- return Error("react-stack-top-frame");
139
- }
140
- function k(n) {
141
- if (M.call(n, "key")) {
142
- var v = Object.getOwnPropertyDescriptor(n, "key").get;
143
- if (v && v.isReactWarning) return !1;
144
- }
145
- return n.key !== void 0;
146
- }
147
- function R(n, v) {
148
- function _() {
149
- ce || (ce = !0, console.error(
150
- "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
151
- v
152
- ));
153
- }
154
- _.isReactWarning = !0, Object.defineProperty(n, "key", {
155
- get: _,
156
- configurable: !0
157
- });
158
- }
159
- function b() {
160
- var n = t(this.type);
161
- return Q[n] || (Q[n] = !0, console.error(
162
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
163
- )), n = this.props.ref, n !== void 0 ? n : null;
164
- }
165
- function I(n, v, _, S, K, te) {
166
- var L = _.ref;
167
- return n = {
168
- $$typeof: X,
169
- type: n,
170
- key: v,
171
- props: _,
172
- _owner: S
173
- }, (L !== void 0 ? L : null) !== null ? Object.defineProperty(n, "ref", {
174
- enumerable: !1,
175
- get: b
176
- }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
177
- configurable: !1,
178
- enumerable: !1,
179
- writable: !0,
180
- value: 0
181
- }), Object.defineProperty(n, "_debugInfo", {
182
- configurable: !1,
183
- enumerable: !1,
184
- writable: !0,
185
- value: null
186
- }), Object.defineProperty(n, "_debugStack", {
187
- configurable: !1,
188
- enumerable: !1,
189
- writable: !0,
190
- value: K
191
- }), Object.defineProperty(n, "_debugTask", {
192
- configurable: !1,
193
- enumerable: !1,
194
- writable: !0,
195
- value: te
196
- }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
197
- }
198
- function P(n, v, _, S, K, te) {
199
- var L = v.children;
200
- if (L !== void 0)
201
- if (S)
202
- if (ie(L)) {
203
- for (S = 0; S < L.length; S++)
204
- T(L[S]);
205
- Object.freeze && Object.freeze(L);
206
- } else
207
- console.error(
208
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
209
- );
210
- else T(L);
211
- if (M.call(v, "key")) {
212
- L = t(n);
213
- var Y = Object.keys(v).filter(function(ve) {
214
- return ve !== "key";
215
- });
216
- S = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ee[L + S] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
217
- `A props object containing a "key" prop is being spread into JSX:
218
- let props = %s;
219
- <%s {...props} />
220
- React keys must be passed directly to JSX without using spread:
221
- let props = %s;
222
- <%s key={someKey} {...props} />`,
223
- S,
224
- L,
225
- Y,
226
- L
227
- ), ee[L + S] = !0);
228
- }
229
- if (L = null, _ !== void 0 && (c(_), L = "" + _), k(v) && (c(v.key), L = "" + v.key), "key" in v) {
230
- _ = {};
231
- for (var ne in v)
232
- ne !== "key" && (_[ne] = v[ne]);
233
- } else _ = v;
234
- return L && R(
235
- _,
236
- typeof n == "function" ? n.displayName || n.name || "Unknown" : n
237
- ), I(
238
- n,
239
- L,
240
- _,
241
- f(),
242
- K,
243
- te
244
- );
245
- }
246
- function T(n) {
247
- D(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === G && (n._payload.status === "fulfilled" ? D(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
248
- }
249
- function D(n) {
250
- return typeof n == "object" && n !== null && n.$$typeof === X;
251
- }
252
- var E = W, X = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), H = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), Z = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), le = Symbol.for("react.memo"), G = Symbol.for("react.lazy"), ge = Symbol.for("react.activity"), se = Symbol.for("react.client.reference"), N = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, ie = Array.isArray, $ = console.createTask ? console.createTask : function() {
253
- return null;
254
- };
255
- E = {
256
- react_stack_bottom_frame: function(n) {
257
- return n();
258
- }
259
- };
260
- var ce, Q = {}, ue = E.react_stack_bottom_frame.bind(
261
- E,
262
- w
263
- )(), de = $(d(w)), ee = {};
264
- oe.Fragment = A, oe.jsx = function(n, v, _) {
265
- var S = 1e4 > N.recentlyCreatedOwnerStacks++;
266
- return P(
267
- n,
268
- v,
269
- _,
270
- !1,
271
- S ? Error("react-stack-top-frame") : ue,
272
- S ? $(d(n)) : de
273
- );
274
- }, oe.jsxs = function(n, v, _) {
275
- var S = 1e4 > N.recentlyCreatedOwnerStacks++;
276
- return P(
277
- n,
278
- v,
279
- _,
280
- !0,
281
- S ? Error("react-stack-top-frame") : ue,
282
- S ? $(d(n)) : de
283
- );
284
- };
285
- })()), oe;
286
- }
287
- var De;
288
- function at() {
289
- return De || (De = 1, process.env.NODE_ENV === "production" ? fe.exports = rt() : fe.exports = ot()), fe.exports;
290
- }
291
- var a = at(), Be = {
12
+ }, J = (t, c) => We(t, Ke(c));
13
+ import * as Ze from "react";
14
+ import r, { useRef as _, useState as N, useEffect as B } from "react";
15
+ window.React = Ze;
16
+ var Ce = {
292
17
  color: void 0,
293
18
  size: void 0,
294
19
  className: void 0,
295
20
  style: void 0,
296
21
  attr: void 0
297
- }, He = W.createContext && /* @__PURE__ */ W.createContext(Be), lt = ["attr", "size", "title"];
298
- function st(t, s) {
22
+ }, we = r.createContext && /* @__PURE__ */ r.createContext(Ce), Qe = ["attr", "size", "title"];
23
+ function Je(t, c) {
299
24
  if (t == null) return {};
300
- var c = it(t, s), d, f;
25
+ var i = Ge(t, c), d, v;
301
26
  if (Object.getOwnPropertySymbols) {
302
- var w = Object.getOwnPropertySymbols(t);
303
- for (f = 0; f < w.length; f++)
304
- d = w[f], !(s.indexOf(d) >= 0) && Object.prototype.propertyIsEnumerable.call(t, d) && (c[d] = t[d]);
27
+ var y = Object.getOwnPropertySymbols(t);
28
+ for (v = 0; v < y.length; v++)
29
+ d = y[v], !(c.indexOf(d) >= 0) && Object.prototype.propertyIsEnumerable.call(t, d) && (i[d] = t[d]);
305
30
  }
306
- return c;
31
+ return i;
307
32
  }
308
- function it(t, s) {
33
+ function Ge(t, c) {
309
34
  if (t == null) return {};
310
- var c = {};
35
+ var i = {};
311
36
  for (var d in t)
312
37
  if (Object.prototype.hasOwnProperty.call(t, d)) {
313
- if (s.indexOf(d) >= 0) continue;
314
- c[d] = t[d];
38
+ if (c.indexOf(d) >= 0) continue;
39
+ i[d] = t[d];
315
40
  }
316
- return c;
41
+ return i;
317
42
  }
318
- function he() {
319
- return he = Object.assign ? Object.assign.bind() : function(t) {
320
- for (var s = 1; s < arguments.length; s++) {
321
- var c = arguments[s];
322
- for (var d in c)
323
- Object.prototype.hasOwnProperty.call(c, d) && (t[d] = c[d]);
43
+ function W() {
44
+ return W = Object.assign ? Object.assign.bind() : function(t) {
45
+ for (var c = 1; c < arguments.length; c++) {
46
+ var i = arguments[c];
47
+ for (var d in i)
48
+ Object.prototype.hasOwnProperty.call(i, d) && (t[d] = i[d]);
324
49
  }
325
50
  return t;
326
- }, he.apply(this, arguments);
51
+ }, W.apply(this, arguments);
327
52
  }
328
- function Fe(t, s) {
329
- var c = Object.keys(t);
53
+ function Ee(t, c) {
54
+ var i = Object.keys(t);
330
55
  if (Object.getOwnPropertySymbols) {
331
56
  var d = Object.getOwnPropertySymbols(t);
332
- s && (d = d.filter(function(f) {
333
- return Object.getOwnPropertyDescriptor(t, f).enumerable;
334
- })), c.push.apply(c, d);
57
+ c && (d = d.filter(function(v) {
58
+ return Object.getOwnPropertyDescriptor(t, v).enumerable;
59
+ })), i.push.apply(i, d);
335
60
  }
336
- return c;
61
+ return i;
337
62
  }
338
- function pe(t) {
339
- for (var s = 1; s < arguments.length; s++) {
340
- var c = arguments[s] != null ? arguments[s] : {};
341
- s % 2 ? Fe(Object(c), !0).forEach(function(d) {
342
- ct(t, d, c[d]);
343
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(c)) : Fe(Object(c)).forEach(function(d) {
344
- Object.defineProperty(t, d, Object.getOwnPropertyDescriptor(c, d));
63
+ function K(t) {
64
+ for (var c = 1; c < arguments.length; c++) {
65
+ var i = arguments[c] != null ? arguments[c] : {};
66
+ c % 2 ? Ee(Object(i), !0).forEach(function(d) {
67
+ et(t, d, i[d]);
68
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : Ee(Object(i)).forEach(function(d) {
69
+ Object.defineProperty(t, d, Object.getOwnPropertyDescriptor(i, d));
345
70
  });
346
71
  }
347
72
  return t;
348
73
  }
349
- function ct(t, s, c) {
350
- return s = ut(s), s in t ? Object.defineProperty(t, s, { value: c, enumerable: !0, configurable: !0, writable: !0 }) : t[s] = c, t;
74
+ function et(t, c, i) {
75
+ return c = tt(c), c in t ? Object.defineProperty(t, c, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[c] = i, t;
351
76
  }
352
- function ut(t) {
353
- var s = dt(t, "string");
354
- return typeof s == "symbol" ? s : s + "";
77
+ function tt(t) {
78
+ var c = nt(t, "string");
79
+ return typeof c == "symbol" ? c : c + "";
355
80
  }
356
- function dt(t, s) {
81
+ function nt(t, c) {
357
82
  if (typeof t != "object" || !t) return t;
358
- var c = t[Symbol.toPrimitive];
359
- if (c !== void 0) {
360
- var d = c.call(t, s);
83
+ var i = t[Symbol.toPrimitive];
84
+ if (i !== void 0) {
85
+ var d = i.call(t, c);
361
86
  if (typeof d != "object") return d;
362
87
  throw new TypeError("@@toPrimitive must return a primitive value.");
363
88
  }
364
- return (s === "string" ? String : Number)(t);
89
+ return (c === "string" ? String : Number)(t);
365
90
  }
366
- function $e(t) {
367
- return t && t.map((s, c) => /* @__PURE__ */ W.createElement(s.tag, pe({
368
- key: c
369
- }, s.attr), $e(s.child)));
91
+ function be(t) {
92
+ return t && t.map((c, i) => /* @__PURE__ */ r.createElement(c.tag, K({
93
+ key: i
94
+ }, c.attr), be(c.child)));
370
95
  }
371
- function z(t) {
372
- return (s) => /* @__PURE__ */ W.createElement(ft, he({
373
- attr: pe({}, t.attr)
374
- }, s), $e(t.child));
96
+ function M(t) {
97
+ return (c) => /* @__PURE__ */ r.createElement(rt, W({
98
+ attr: K({}, t.attr)
99
+ }, c), be(t.child));
375
100
  }
376
- function ft(t) {
377
- var s = (c) => {
101
+ function rt(t) {
102
+ var c = (i) => {
378
103
  var {
379
104
  attr: d,
380
- size: f,
381
- title: w
382
- } = t, k = st(t, lt), R = f || c.size || "1em", b;
383
- return c.className && (b = c.className), t.className && (b = (b ? b + " " : "") + t.className), /* @__PURE__ */ W.createElement("svg", he({
105
+ size: v,
106
+ title: y
107
+ } = t, R = Je(t, Qe), x = v || i.size || "1em", w;
108
+ return i.className && (w = i.className), t.className && (w = (w ? w + " " : "") + t.className), /* @__PURE__ */ r.createElement("svg", W({
384
109
  stroke: "currentColor",
385
110
  fill: "currentColor",
386
111
  strokeWidth: "0"
387
- }, c.attr, d, k, {
388
- className: b,
389
- style: pe(pe({
390
- color: t.color || c.color
391
- }, c.style), t.style),
392
- height: R,
393
- width: R,
112
+ }, i.attr, d, R, {
113
+ className: w,
114
+ style: K(K({
115
+ color: t.color || i.color
116
+ }, i.style), t.style),
117
+ height: x,
118
+ width: x,
394
119
  xmlns: "http://www.w3.org/2000/svg"
395
- }), w && /* @__PURE__ */ W.createElement("title", null, w), t.children);
120
+ }), y && /* @__PURE__ */ r.createElement("title", null, y), t.children);
396
121
  };
397
- return He !== void 0 ? /* @__PURE__ */ W.createElement(He.Consumer, null, (c) => s(c)) : s(Be);
122
+ return we !== void 0 ? /* @__PURE__ */ r.createElement(we.Consumer, null, (i) => c(i)) : c(Ce);
398
123
  }
399
- function mt(t) {
400
- return z({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z" }, child: [] }] })(t);
124
+ function ot(t) {
125
+ return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z" }, child: [] }] })(t);
401
126
  }
402
- function ht(t) {
403
- return z({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z" }, child: [] }] })(t);
127
+ function at(t) {
128
+ return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z" }, child: [] }] })(t);
404
129
  }
405
- function pt(t) {
406
- return z({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z" }, child: [] }] })(t);
130
+ function lt(t) {
131
+ return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z" }, child: [] }] })(t);
407
132
  }
408
- function gt(t) {
409
- return z({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z" }, child: [] }] })(t);
133
+ function ct(t) {
134
+ return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z" }, child: [] }] })(t);
410
135
  }
411
- function vt(t) {
412
- return z({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
136
+ function it(t) {
137
+ return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
413
138
  }
414
- function xt(t) {
415
- return z({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" }, child: [] }] })(t);
139
+ function st(t) {
140
+ return M({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" }, child: [] }] })(t);
416
141
  }
417
- function wt(t) {
418
- return z({ attr: { viewBox: "0 0 544 512" }, child: [{ tag: "path", attr: { d: "M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z" }, child: [] }] })(t);
142
+ function dt(t) {
143
+ return M({ attr: { viewBox: "0 0 544 512" }, child: [{ tag: "path", attr: { d: "M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z" }, child: [] }] })(t);
419
144
  }
420
- function bt(t) {
421
- return z({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" }, child: [] }] })(t);
145
+ function ut(t) {
146
+ return M({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" }, child: [] }] })(t);
422
147
  }
423
- function yt(t) {
424
- return z({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" }, child: [] }] })(t);
148
+ function mt(t) {
149
+ return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" }, child: [] }] })(t);
425
150
  }
426
- function Ct(t) {
427
- return z({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
151
+ function ht(t) {
152
+ return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
428
153
  }
429
- function Rt(t) {
430
- return z({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" }, child: [] }] })(t);
154
+ function gt(t) {
155
+ return M({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" }, child: [] }] })(t);
431
156
  }
432
- function Et(t) {
433
- return z({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z" }, child: [] }] })(t);
157
+ function ft(t) {
158
+ return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z" }, child: [] }] })(t);
434
159
  }
435
- function jt(t) {
436
- return z({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
160
+ function pt(t) {
161
+ return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
437
162
  }
438
- function _t(t) {
439
- return z({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z" }, child: [] }] })(t);
163
+ function vt(t) {
164
+ return M({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z" }, child: [] }] })(t);
440
165
  }
441
- function kt(t) {
442
- return z({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z" }, child: [] }] })(t);
166
+ function wt(t) {
167
+ return M({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z" }, child: [] }] })(t);
443
168
  }
444
- const Lt = [
169
+ const Et = [
445
170
  "😀",
446
171
  "😁",
447
172
  "😂",
@@ -553,506 +278,414 @@ const Lt = [
553
278
  "👏",
554
279
  "🫶",
555
280
  "👐"
556
- ], St = ({
281
+ ], yt = ({
557
282
  exec: t,
558
- saveSelection: s,
559
- handleFileChange: c,
283
+ saveSelection: c,
284
+ handleFileChange: i,
560
285
  handleFontSizeChange: d,
561
- handleFontFamilyChange: f,
286
+ handleFontFamilyChange: v,
562
287
  // insertListBlock,
563
- insertEmoji: w,
564
- handleLink: k,
565
- removeFormatting: R,
566
- visibleActions: b,
567
- className: I,
568
- style: P
288
+ insertEmoji: y,
289
+ handleLink: R,
290
+ removeFormatting: x,
291
+ visibleActions: w,
292
+ className: H,
293
+ style: T
569
294
  }) => {
570
- var V, Z;
571
- const T = U(null), D = U(null), E = U(null), [X, B] = F(!1);
572
- ae(() => {
573
- const h = (C) => {
574
- !C.target.closest(".rte-emoji-popup") && !C.target.closest("button[title='Emoji']") && B(!1);
295
+ var F, V;
296
+ const L = _(null), D = _(null), b = _(null), [X, j] = N(!1);
297
+ B(() => {
298
+ const m = (E) => {
299
+ !E.target.closest(".rte-emoji-popup") && !E.target.closest("button[title='Emoji']") && j(!1);
575
300
  };
576
- return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
301
+ return document.addEventListener("mousedown", m), () => document.removeEventListener("mousedown", m);
577
302
  }, []);
578
- const A = (h) => {
579
- var J;
580
- h.preventDefault();
581
- const C = h.currentTarget.dataset.command;
582
- if (C)
583
- switch (C) {
303
+ const S = (m) => {
304
+ var $;
305
+ m.preventDefault();
306
+ const E = m.currentTarget.dataset.command;
307
+ if (E)
308
+ switch (E) {
584
309
  case "bold":
585
310
  case "italic":
586
311
  case "underline":
587
312
  case "insertUnorderedList":
588
313
  case "insertOrderedList":
589
314
  case "removeFormat":
590
- t(C);
315
+ t(E);
591
316
  break;
592
317
  case "insertImage": {
593
- (J = T.current) == null || J.click();
318
+ ($ = L.current) == null || $.click();
594
319
  break;
595
320
  }
596
321
  default:
597
- console.warn("Unknown command:", C);
322
+ console.warn("Unknown command:", E);
598
323
  }
599
- }, q = (h) => {
600
- t("foreColor", h.target.value);
601
- }, H = (h) => {
602
- t("backColor", h.target.value);
324
+ }, P = (m) => {
325
+ t("foreColor", m.target.value);
326
+ }, A = (m) => {
327
+ t("backColor", m.target.value);
603
328
  };
604
- return /* @__PURE__ */ a.jsxs("div", { className: `rte-toolbar ${I || ""}`, style: P, children: [
605
- b.bold && /* @__PURE__ */ a.jsx(
606
- "button",
607
- {
608
- "data-command": "bold",
609
- title: "Bold",
610
- onMouseDown: A,
611
- children: /* @__PURE__ */ a.jsx(xt, {})
612
- }
613
- ),
614
- b.italic && /* @__PURE__ */ a.jsx(
615
- "button",
616
- {
617
- "data-command": "italic",
618
- title: "Italic",
619
- onMouseDown: A,
620
- children: /* @__PURE__ */ a.jsx(bt, {})
621
- }
622
- ),
623
- b.underline && /* @__PURE__ */ a.jsx(
624
- "button",
625
- {
626
- "data-command": "underline",
627
- title: "Underline",
628
- onMouseDown: A,
629
- children: /* @__PURE__ */ a.jsx(jt, {})
630
- }
631
- ),
632
- b.unorderedList && /* @__PURE__ */ a.jsx(
633
- "button",
634
- {
635
- "data-command": "insertUnorderedList",
636
- onMouseDown: A,
637
- title: "UnorderedList",
638
- children: /* @__PURE__ */ a.jsx(Ct, {})
639
- }
640
- ),
641
- b.orderedList && /* @__PURE__ */ a.jsx(
642
- "button",
643
- {
644
- "data-command": "insertOrderedList",
645
- title: "OrderedList",
646
- onMouseDown: A,
647
- children: /* @__PURE__ */ a.jsx(gt, {})
648
- }
649
- ),
650
- b.link && /* @__PURE__ */ a.jsx("button", { "data-command": "createLink", title: "Link", onClick: k, children: /* @__PURE__ */ a.jsx(yt, {}) }),
651
- b.removeFormat && /* @__PURE__ */ a.jsx(
652
- "button",
653
- {
654
- "data-command": "Remove format",
655
- title: "removeFormat",
656
- onMouseDown: (h) => {
657
- h.preventDefault(), s(), R();
658
- },
659
- children: /* @__PURE__ */ a.jsx(kt, {})
660
- }
661
- ),
662
- b.image && /* @__PURE__ */ a.jsx(
663
- "button",
664
- {
665
- "data-command": "insertImage",
666
- title: "Image",
667
- onMouseDown: A,
668
- children: /* @__PURE__ */ a.jsx(pt, {})
669
- }
670
- ),
671
- /* @__PURE__ */ a.jsx(
672
- "input",
673
- {
674
- type: "file",
675
- accept: "image/*",
676
- ref: T,
677
- style: { display: "none" },
678
- onChange: c
679
- }
680
- ),
681
- b.emoji && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
682
- /* @__PURE__ */ a.jsx(
683
- "button",
684
- {
685
- title: "Emoji",
686
- onMouseDown: (h) => {
687
- h.preventDefault(), s(), B((C) => !C);
688
- },
689
- children: /* @__PURE__ */ a.jsx(Rt, {})
690
- }
691
- ),
692
- X && /* @__PURE__ */ a.jsx("div", { className: "rte-emoji-popup", children: Lt.map((h) => /* @__PURE__ */ a.jsx(
693
- "span",
694
- {
695
- style: {
696
- fontSize: "20px",
697
- cursor: "pointer",
698
- textAlign: "center"
699
- },
700
- onMouseDown: (C) => {
701
- C.preventDefault(), w(h), B(!1);
702
- },
703
- children: h
704
- },
705
- h
706
- )) })
707
- ] }),
708
- b.color && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
709
- /* @__PURE__ */ a.jsx(
710
- "button",
711
- {
712
- title: "Text Color",
713
- onMouseDown: (h) => {
714
- var C;
715
- h.preventDefault(), s(), (C = D.current) == null || C.click();
716
- },
717
- style: {
718
- display: "flex",
719
- alignItems: "center",
720
- justifyContent: "center",
721
- color: ((V = D.current) == null ? void 0 : V.value) || "#000",
722
- fontSize: "18px"
723
- },
724
- children: /* @__PURE__ */ a.jsx(_t, {})
725
- }
726
- ),
727
- /* @__PURE__ */ a.jsx(
728
- "input",
729
- {
730
- ref: D,
731
- type: "color",
732
- defaultValue: "#000000",
733
- onChange: (h) => {
734
- var C;
735
- q(h), ((C = h.target.parentElement) == null ? void 0 : C.querySelector(
736
- "button"
737
- )).style.color = h.target.value;
738
- },
739
- style: {
740
- position: "absolute",
741
- opacity: 0,
742
- width: 0,
743
- height: 0,
744
- pointerEvents: "none"
745
- }
746
- }
747
- )
748
- ] }),
749
- b.highlight && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
750
- /* @__PURE__ */ a.jsx(
751
- "button",
752
- {
753
- title: "Highlight",
754
- onMouseDown: (h) => {
755
- var C;
756
- h.preventDefault(), s(), (C = E.current) == null || C.click();
757
- },
758
- style: {
759
- display: "flex",
760
- alignItems: "center",
761
- justifyContent: "center",
762
- color: ((Z = E.current) == null ? void 0 : Z.value) || "#000",
763
- fontSize: "18px"
764
- },
765
- children: /* @__PURE__ */ a.jsx(wt, {})
766
- }
767
- ),
768
- /* @__PURE__ */ a.jsx(
769
- "input",
770
- {
771
- ref: E,
772
- type: "color",
773
- onChange: (h) => {
774
- var C;
775
- H(h), ((C = h.target.parentElement) == null ? void 0 : C.querySelector(
776
- "button"
777
- )).style.color = h.target.value;
778
- },
779
- defaultValue: "#000000",
780
- style: {
781
- position: "absolute",
782
- opacity: 0,
783
- width: 0,
784
- height: 0,
785
- pointerEvents: "none"
786
- }
787
- }
788
- )
789
- ] }),
790
- b.align && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
791
- /* @__PURE__ */ a.jsx(
792
- "button",
793
- {
794
- title: "Align Left",
795
- onMouseDown: (h) => h.preventDefault(),
796
- onClick: () => t("justifyLeft"),
797
- children: /* @__PURE__ */ a.jsx(vt, {})
798
- }
799
- ),
800
- /* @__PURE__ */ a.jsx(
801
- "button",
802
- {
803
- title: "Align Center",
804
- onMouseDown: (h) => h.preventDefault(),
805
- onClick: () => t("justifyCenter"),
806
- children: /* @__PURE__ */ a.jsx(mt, {})
807
- }
808
- ),
809
- /* @__PURE__ */ a.jsx(
810
- "button",
811
- {
812
- title: "Align Right",
813
- onMouseDown: (h) => h.preventDefault(),
814
- onClick: () => t("justifyRight"),
815
- children: /* @__PURE__ */ a.jsx(ht, {})
816
- }
817
- )
818
- ] }),
819
- b.table && /* @__PURE__ */ a.jsx(
820
- "button",
821
- {
822
- title: "Insert Table",
823
- onMouseDown: (h) => h.preventDefault(),
824
- onClick: () => t("insertTable"),
825
- children: /* @__PURE__ */ a.jsx(Et, {})
826
- }
827
- ),
828
- b.fontFamily && /* @__PURE__ */ a.jsxs(
829
- "select",
830
- {
831
- className: "rte-dropdown",
832
- defaultValue: "",
833
- onMouseDown: () => s(),
834
- onChange: f,
835
- children: [
836
- /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, children: "Font Family" }),
837
- /* @__PURE__ */ a.jsx("option", { value: "Arial", children: "Arial" }),
838
- /* @__PURE__ */ a.jsx("option", { value: "Georgia", children: "Georgia" }),
839
- /* @__PURE__ */ a.jsx("option", { value: "Times New Roman", children: "Times New Roman" }),
840
- /* @__PURE__ */ a.jsx("option", { value: "Courier New", children: "Courier New" }),
841
- /* @__PURE__ */ a.jsx("option", { value: "Verdana", children: "Verdana" })
842
- ]
843
- }
844
- ),
845
- b.fontSize && /* @__PURE__ */ a.jsxs(
846
- "select",
847
- {
848
- className: "rte-dropdown",
849
- defaultValue: "",
850
- onMouseDown: () => s(),
851
- onChange: d,
852
- children: [
853
- /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, children: "Font Size" }),
854
- /* @__PURE__ */ a.jsx("option", { value: "2", children: "Small " }),
855
- /* @__PURE__ */ a.jsx("option", { value: "3", children: "Normal" }),
856
- /* @__PURE__ */ a.jsx("option", { value: "4", children: "Medium" }),
857
- /* @__PURE__ */ a.jsx("option", { value: "5", children: "Large" })
858
- ]
859
- }
860
- )
861
- ] });
862
- }, Tt = ({
329
+ return /* @__PURE__ */ r.createElement("div", {
330
+ className: `rte-toolbar ${H || ""}`,
331
+ style: T
332
+ }, w.bold && /* @__PURE__ */ r.createElement("button", {
333
+ "data-command": "bold",
334
+ title: "Bold",
335
+ onMouseDown: S
336
+ }, /* @__PURE__ */ r.createElement(st, null)), w.italic && /* @__PURE__ */ r.createElement("button", {
337
+ "data-command": "italic",
338
+ title: "Italic",
339
+ onMouseDown: S
340
+ }, /* @__PURE__ */ r.createElement(ut, null)), w.underline && /* @__PURE__ */ r.createElement("button", {
341
+ "data-command": "underline",
342
+ title: "Underline",
343
+ onMouseDown: S
344
+ }, /* @__PURE__ */ r.createElement(pt, null)), w.unorderedList && /* @__PURE__ */ r.createElement("button", {
345
+ "data-command": "insertUnorderedList",
346
+ onMouseDown: S,
347
+ title: "UnorderedList"
348
+ }, /* @__PURE__ */ r.createElement(ht, null)), w.orderedList && /* @__PURE__ */ r.createElement("button", {
349
+ "data-command": "insertOrderedList",
350
+ title: "OrderedList",
351
+ onMouseDown: S
352
+ }, /* @__PURE__ */ r.createElement(ct, null)), w.link && /* @__PURE__ */ r.createElement("button", {
353
+ "data-command": "createLink",
354
+ title: "Link",
355
+ onClick: R
356
+ }, /* @__PURE__ */ r.createElement(mt, null)), w.removeFormat && /* @__PURE__ */ r.createElement("button", {
357
+ "data-command": "Remove format",
358
+ title: "removeFormat",
359
+ onMouseDown: (m) => {
360
+ m.preventDefault(), c(), x();
361
+ }
362
+ }, /* @__PURE__ */ r.createElement(wt, null)), w.image && /* @__PURE__ */ r.createElement("button", {
363
+ "data-command": "insertImage",
364
+ title: "Image",
365
+ onMouseDown: S
366
+ }, /* @__PURE__ */ r.createElement(lt, null)), /* @__PURE__ */ r.createElement("input", {
367
+ type: "file",
368
+ accept: "image/*",
369
+ ref: L,
370
+ style: {
371
+ display: "none"
372
+ },
373
+ onChange: i
374
+ }), w.emoji && /* @__PURE__ */ r.createElement("div", {
375
+ style: {
376
+ position: "relative"
377
+ }
378
+ }, /* @__PURE__ */ r.createElement("button", {
379
+ title: "Emoji",
380
+ onMouseDown: (m) => {
381
+ m.preventDefault(), c(), j((E) => !E);
382
+ }
383
+ }, /* @__PURE__ */ r.createElement(gt, null)), X && /* @__PURE__ */ r.createElement("div", {
384
+ className: "rte-emoji-popup"
385
+ }, Et.map((m) => /* @__PURE__ */ r.createElement("span", {
386
+ key: m,
387
+ style: {
388
+ fontSize: "20px",
389
+ cursor: "pointer",
390
+ textAlign: "center"
391
+ },
392
+ onMouseDown: (E) => {
393
+ E.preventDefault(), y(m), j(!1);
394
+ }
395
+ }, m)))), w.color && /* @__PURE__ */ r.createElement("div", {
396
+ style: {
397
+ position: "relative"
398
+ }
399
+ }, /* @__PURE__ */ r.createElement("button", {
400
+ title: "Text Color",
401
+ onMouseDown: (m) => {
402
+ var E;
403
+ m.preventDefault(), c(), (E = D.current) == null || E.click();
404
+ },
405
+ style: {
406
+ display: "flex",
407
+ alignItems: "center",
408
+ justifyContent: "center",
409
+ color: ((F = D.current) == null ? void 0 : F.value) || "#000",
410
+ fontSize: "18px"
411
+ }
412
+ }, /* @__PURE__ */ r.createElement(vt, null)), /* @__PURE__ */ r.createElement("input", {
413
+ ref: D,
414
+ type: "color",
415
+ defaultValue: "#000000",
416
+ onChange: (m) => {
417
+ var E;
418
+ P(m), ((E = m.target.parentElement) == null ? void 0 : E.querySelector("button")).style.color = m.target.value;
419
+ },
420
+ style: {
421
+ position: "absolute",
422
+ opacity: 0,
423
+ width: 0,
424
+ height: 0,
425
+ pointerEvents: "none"
426
+ }
427
+ })), w.highlight && /* @__PURE__ */ r.createElement("div", {
428
+ style: {
429
+ position: "relative"
430
+ }
431
+ }, /* @__PURE__ */ r.createElement("button", {
432
+ title: "Highlight",
433
+ onMouseDown: (m) => {
434
+ var E;
435
+ m.preventDefault(), c(), (E = b.current) == null || E.click();
436
+ },
437
+ style: {
438
+ display: "flex",
439
+ alignItems: "center",
440
+ justifyContent: "center",
441
+ color: ((V = b.current) == null ? void 0 : V.value) || "#000",
442
+ fontSize: "18px"
443
+ }
444
+ }, /* @__PURE__ */ r.createElement(dt, null)), /* @__PURE__ */ r.createElement("input", {
445
+ ref: b,
446
+ type: "color",
447
+ onChange: (m) => {
448
+ var E;
449
+ A(m), ((E = m.target.parentElement) == null ? void 0 : E.querySelector("button")).style.color = m.target.value;
450
+ },
451
+ defaultValue: "#000000",
452
+ style: {
453
+ position: "absolute",
454
+ opacity: 0,
455
+ width: 0,
456
+ height: 0,
457
+ pointerEvents: "none"
458
+ }
459
+ })), w.align && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("button", {
460
+ title: "Align Left",
461
+ onMouseDown: (m) => m.preventDefault(),
462
+ onClick: () => t("justifyLeft")
463
+ }, /* @__PURE__ */ r.createElement(it, null)), /* @__PURE__ */ r.createElement("button", {
464
+ title: "Align Center",
465
+ onMouseDown: (m) => m.preventDefault(),
466
+ onClick: () => t("justifyCenter")
467
+ }, /* @__PURE__ */ r.createElement(ot, null)), /* @__PURE__ */ r.createElement("button", {
468
+ title: "Align Right",
469
+ onMouseDown: (m) => m.preventDefault(),
470
+ onClick: () => t("justifyRight")
471
+ }, /* @__PURE__ */ r.createElement(at, null))), w.table && /* @__PURE__ */ r.createElement("button", {
472
+ title: "Insert Table",
473
+ onMouseDown: (m) => m.preventDefault(),
474
+ onClick: () => t("insertTable")
475
+ }, /* @__PURE__ */ r.createElement(ft, null)), w.fontFamily && /* @__PURE__ */ r.createElement("select", {
476
+ className: "rte-dropdown",
477
+ defaultValue: "",
478
+ onMouseDown: () => c(),
479
+ onChange: v
480
+ }, /* @__PURE__ */ r.createElement("option", {
481
+ value: "",
482
+ disabled: !0
483
+ }, "Font Family"), /* @__PURE__ */ r.createElement("option", {
484
+ value: "Arial"
485
+ }, "Arial"), /* @__PURE__ */ r.createElement("option", {
486
+ value: "Georgia"
487
+ }, "Georgia"), /* @__PURE__ */ r.createElement("option", {
488
+ value: "Times New Roman"
489
+ }, "Times New Roman"), /* @__PURE__ */ r.createElement("option", {
490
+ value: "Courier New"
491
+ }, "Courier New"), /* @__PURE__ */ r.createElement("option", {
492
+ value: "Verdana"
493
+ }, "Verdana")), w.fontSize && /* @__PURE__ */ r.createElement("select", {
494
+ className: "rte-dropdown",
495
+ defaultValue: "",
496
+ onMouseDown: () => c(),
497
+ onChange: d
498
+ }, /* @__PURE__ */ r.createElement("option", {
499
+ value: "",
500
+ disabled: !0
501
+ }, "Font Size"), /* @__PURE__ */ r.createElement("option", {
502
+ value: "2"
503
+ }, "Small "), /* @__PURE__ */ r.createElement("option", {
504
+ value: "3"
505
+ }, "Normal"), /* @__PURE__ */ r.createElement("option", {
506
+ value: "4"
507
+ }, "Medium"), /* @__PURE__ */ r.createElement("option", {
508
+ value: "5"
509
+ }, "Large")));
510
+ }, Ct = ({
863
511
  show: t,
864
- position: s,
865
- filtered: c,
512
+ position: c,
513
+ filtered: i,
866
514
  insertMention: d,
867
- onClose: f,
868
- query: w
515
+ onClose: v,
516
+ query: y
869
517
  }) => {
870
- const k = U(null);
871
- return ae(() => {
872
- const R = (b) => {
873
- k.current && !k.current.contains(b.target) && f();
518
+ const R = _(null);
519
+ return B(() => {
520
+ const x = (w) => {
521
+ R.current && !R.current.contains(w.target) && v();
874
522
  };
875
- return t && document.addEventListener("mousedown", R), () => {
876
- document.removeEventListener("mousedown", R);
523
+ return t && document.addEventListener("mousedown", x), () => {
524
+ document.removeEventListener("mousedown", x);
877
525
  };
878
- }, [t, f]), t ? /* @__PURE__ */ a.jsx(
879
- "ul",
880
- {
881
- ref: k,
882
- className: "rte-popup",
526
+ }, [t, v]), t ? /* @__PURE__ */ r.createElement("ul", {
527
+ ref: R,
528
+ className: "rte-popup",
529
+ style: {
530
+ top: c.y,
531
+ left: c.x
532
+ }
533
+ }, i.length > 0 ? i.map(({
534
+ key: x,
535
+ value: w
536
+ }) => {
537
+ const H = x.toLowerCase(), T = y.toLowerCase(), L = H.indexOf(T);
538
+ let D = x;
539
+ if (L !== -1 && y.length > 0) {
540
+ const b = L + y.length;
541
+ D = x.substring(0, L) + `<span class="rte-highlight">${x.substring(L, b)}</span>` + x.substring(b);
542
+ }
543
+ return /* @__PURE__ */ r.createElement("li", {
544
+ key: w,
545
+ onMouseDown: (b) => {
546
+ b.preventDefault(), d({
547
+ key: x,
548
+ value: w
549
+ });
550
+ },
883
551
  style: {
884
- top: s.y,
885
- left: s.x
552
+ padding: "6px 12px",
553
+ cursor: "pointer",
554
+ fontSize: "14px"
886
555
  },
887
- children: c.length > 0 ? c.map(({ key: R, value: b }) => {
888
- const I = R.toLowerCase(), P = w.toLowerCase(), T = I.indexOf(P);
889
- let D = R;
890
- if (T !== -1 && w.length > 0) {
891
- const E = T + w.length;
892
- D = R.substring(0, T) + `<span class="rte-highlight">${R.substring(
893
- T,
894
- E
895
- )}</span>` + R.substring(E);
896
- }
897
- return /* @__PURE__ */ a.jsx(
898
- "li",
899
- {
900
- onMouseDown: (E) => {
901
- E.preventDefault(), d({ key: R, value: b });
902
- },
903
- style: {
904
- padding: "6px 12px",
905
- cursor: "pointer",
906
- fontSize: "14px"
907
- },
908
- dangerouslySetInnerHTML: { __html: D },
909
- onMouseEnter: (E) => E.currentTarget.style.background = "#f0f0f0",
910
- onMouseLeave: (E) => E.currentTarget.style.background = "#fff"
911
- },
912
- b
913
- );
914
- }) : /* @__PURE__ */ a.jsx("li", { style: { padding: "6px 12px", color: "#999" }, children: "No matches" })
556
+ dangerouslySetInnerHTML: {
557
+ __html: D
558
+ },
559
+ onMouseEnter: (b) => b.currentTarget.style.background = "#f0f0f0",
560
+ onMouseLeave: (b) => b.currentTarget.style.background = "#fff"
561
+ });
562
+ }) : /* @__PURE__ */ r.createElement("li", {
563
+ style: {
564
+ padding: "6px 12px",
565
+ color: "#999"
915
566
  }
916
- ) : null;
567
+ }, "No matches")) : null;
917
568
  };
918
- function Ie(t) {
919
- return z({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Minus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,11.5h0a.5.5,0,0,1,0,1H9a.5.5,0,0,1,0-1Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.934A9.933,9.933,0,1,1,21.932,12,9.945,9.945,0,0,1,12,21.934ZM12,3.068A8.933,8.933,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.068Z" }, child: [] }] }] }] })(t);
569
+ function ye(t) {
570
+ return M({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Minus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,11.5h0a.5.5,0,0,1,0,1H9a.5.5,0,0,1,0-1Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.934A9.933,9.933,0,1,1,21.932,12,9.945,9.945,0,0,1,12,21.934ZM12,3.068A8.933,8.933,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.068Z" }, child: [] }] }] }] })(t);
920
571
  }
921
- function me(t) {
922
- return z({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Plus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.932A9.934,9.934,0,1,1,21.932,12,9.944,9.944,0,0,1,12,21.932ZM12,3.065A8.934,8.934,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.065Z" }, child: [] }] }] }] })(t);
572
+ function q(t) {
573
+ return M({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Plus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.932A9.934,9.934,0,1,1,21.932,12,9.944,9.944,0,0,1,12,21.932ZM12,3.065A8.934,8.934,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.065Z" }, child: [] }] }] }] })(t);
923
574
  }
924
- const At = ({
575
+ const bt = ({
925
576
  visible: t,
926
- x: s,
927
- y: c,
577
+ x: c,
578
+ y: i,
928
579
  onAction: d,
929
- onClose: f
580
+ onClose: v
930
581
  }) => {
931
582
  if (!t) return null;
932
- const w = {
933
- top: c,
934
- left: s
583
+ const y = {
584
+ top: i,
585
+ left: c
935
586
  };
936
- return /* @__PURE__ */ a.jsxs("div", { style: w, className: "rte-table-menu", onMouseLeave: f, children: [
937
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertRowAbove"), children: [
938
- /* @__PURE__ */ a.jsx(me, {}),
939
- " Insert row above"
940
- ] }),
941
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertRowBelow"), children: [
942
- /* @__PURE__ */ a.jsx(me, {}),
943
- " Insert row below"
944
- ] }),
945
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertColLeft"), children: [
946
- /* @__PURE__ */ a.jsx(me, {}),
947
- " Insert col left"
948
- ] }),
949
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertColRight"), children: [
950
- /* @__PURE__ */ a.jsx(me, {}),
951
- " Insert col right"
952
- ] }),
953
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("deleteRow"), children: [
954
- /* @__PURE__ */ a.jsx(Ie, {}),
955
- " Delete row"
956
- ] }),
957
- /* @__PURE__ */ a.jsxs("button", { onClick: () => d("deleteCol"), children: [
958
- /* @__PURE__ */ a.jsx(Ie, {}),
959
- " Delete column"
960
- ] })
961
- ] });
962
- }, Mt = ({ html: t, className: s, style: c }) => {
963
- const d = (f) => {
964
- const w = f.target;
965
- if (w.tagName === "A") {
966
- f.preventDefault();
967
- const k = w.href;
968
- k && window.open(k, "_blank", "noopener,noreferrer");
587
+ return /* @__PURE__ */ r.createElement("div", {
588
+ style: y,
589
+ className: "rte-table-menu",
590
+ onMouseLeave: v
591
+ }, /* @__PURE__ */ r.createElement("button", {
592
+ onClick: () => d("insertRowAbove")
593
+ }, /* @__PURE__ */ r.createElement(q, null), " Insert row above"), /* @__PURE__ */ r.createElement("button", {
594
+ onClick: () => d("insertRowBelow")
595
+ }, /* @__PURE__ */ r.createElement(q, null), " Insert row below"), /* @__PURE__ */ r.createElement("button", {
596
+ onClick: () => d("insertColLeft")
597
+ }, /* @__PURE__ */ r.createElement(q, null), " Insert col left"), /* @__PURE__ */ r.createElement("button", {
598
+ onClick: () => d("insertColRight")
599
+ }, /* @__PURE__ */ r.createElement(q, null), " Insert col right"), /* @__PURE__ */ r.createElement("button", {
600
+ onClick: () => d("deleteRow")
601
+ }, /* @__PURE__ */ r.createElement(ye, null), " Delete row"), /* @__PURE__ */ r.createElement("button", {
602
+ onClick: () => d("deleteCol")
603
+ }, /* @__PURE__ */ r.createElement(ye, null), " Delete column"));
604
+ }, xt = ({
605
+ html: t,
606
+ className: c,
607
+ style: i
608
+ }) => {
609
+ const d = (v) => {
610
+ const y = v.target;
611
+ if (y.tagName === "A") {
612
+ v.preventDefault();
613
+ const R = y.href;
614
+ R && window.open(R, "_blank", "noopener,noreferrer");
969
615
  }
970
616
  };
971
- return /* @__PURE__ */ a.jsx(
972
- "div",
973
- {
974
- className: `rte-preview ${s || ""}`,
975
- style: c,
976
- onClick: d,
977
- dangerouslySetInnerHTML: { __html: t }
617
+ return /* @__PURE__ */ React.createElement("div", {
618
+ className: `rte-preview ${c || ""}`,
619
+ style: i,
620
+ onClick: d,
621
+ dangerouslySetInnerHTML: {
622
+ __html: t
978
623
  }
979
- );
980
- }, zt = ({
624
+ });
625
+ }, Rt = ({
981
626
  visible: t,
982
- linkData: s,
983
- onClose: c,
627
+ linkData: c,
628
+ onClose: i,
984
629
  onInsert: d
985
630
  }) => {
986
- const [f, w] = F(""), [k, R] = F(""), [b, I] = F(""), [P, T] = F("_self");
987
- if (ae(() => {
988
- t ? (w(s.url || ""), R(s.text || ""), I(s.title || ""), T(s.target || "_self")) : (w(""), R(""), I(""), T("_self"));
989
- }, [t, s]), !t) return null;
631
+ const [v, y] = N(""), [R, x] = N(""), [w, H] = N(""), [T, L] = N("_self");
632
+ if (B(() => {
633
+ t ? (y(c.url || ""), x(c.text || ""), H(c.title || ""), L(c.target || "_self")) : (y(""), x(""), H(""), L("_self"));
634
+ }, [t, c]), !t) return null;
990
635
  const D = () => {
991
- d({ url: f, text: k, title: b, target: P });
636
+ d({
637
+ url: v,
638
+ text: R,
639
+ title: w,
640
+ target: T
641
+ });
992
642
  };
993
- return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
994
- /* @__PURE__ */ a.jsx("div", { className: "rte-link-modal-overlay", onClick: c }),
995
- /* @__PURE__ */ a.jsxs("div", { className: "rte-link-modal", children: [
996
- /* @__PURE__ */ a.jsx("h4", { className: "rte-link-modal__title", children: f ? "Edit Link" : "Insert Link" }),
997
- /* @__PURE__ */ a.jsx(
998
- "input",
999
- {
1000
- type: "text",
1001
- className: "rte-link-modal__input",
1002
- placeholder: "URL",
1003
- value: f,
1004
- onChange: (E) => w(E.target.value)
1005
- }
1006
- ),
1007
- /* @__PURE__ */ a.jsx(
1008
- "input",
1009
- {
1010
- type: "text",
1011
- className: "rte-link-modal__input",
1012
- placeholder: "Text to Display",
1013
- value: k,
1014
- onChange: (E) => R(E.target.value)
1015
- }
1016
- ),
1017
- /* @__PURE__ */ a.jsx(
1018
- "input",
1019
- {
1020
- type: "text",
1021
- className: "rte-link-modal__input",
1022
- placeholder: "Title",
1023
- value: b,
1024
- onChange: (E) => I(E.target.value)
1025
- }
1026
- ),
1027
- /* @__PURE__ */ a.jsxs(
1028
- "select",
1029
- {
1030
- className: "rte-link-modal__select",
1031
- value: P,
1032
- onChange: (E) => T(E.target.value),
1033
- children: [
1034
- /* @__PURE__ */ a.jsx("option", { value: "_self", children: "Same tab" }),
1035
- /* @__PURE__ */ a.jsx("option", { value: "_blank", children: "New tab" })
1036
- ]
1037
- }
1038
- ),
1039
- /* @__PURE__ */ a.jsxs("div", { className: "rte-link-modal__actions", children: [
1040
- /* @__PURE__ */ a.jsx("button", { className: "rte-link-modal__btn", onClick: c, children: "Cancel" }),
1041
- /* @__PURE__ */ a.jsx(
1042
- "button",
1043
- {
1044
- className: "rte-link-modal__btn rte-link-modal__btn--ok",
1045
- onClick: D,
1046
- children: "OK"
1047
- }
1048
- )
1049
- ] })
1050
- ] })
1051
- ] });
1052
- }, Pt = ({
643
+ return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", {
644
+ className: "rte-link-modal-overlay",
645
+ onClick: i
646
+ }), /* @__PURE__ */ r.createElement("div", {
647
+ className: "rte-link-modal"
648
+ }, /* @__PURE__ */ r.createElement("h4", {
649
+ className: "rte-link-modal__title"
650
+ }, v ? "Edit Link" : "Insert Link"), /* @__PURE__ */ r.createElement("input", {
651
+ type: "text",
652
+ className: "rte-link-modal__input",
653
+ placeholder: "URL",
654
+ value: v,
655
+ onChange: (b) => y(b.target.value)
656
+ }), /* @__PURE__ */ r.createElement("input", {
657
+ type: "text",
658
+ className: "rte-link-modal__input",
659
+ placeholder: "Text to Display",
660
+ value: R,
661
+ onChange: (b) => x(b.target.value)
662
+ }), /* @__PURE__ */ r.createElement("input", {
663
+ type: "text",
664
+ className: "rte-link-modal__input",
665
+ placeholder: "Title",
666
+ value: w,
667
+ onChange: (b) => H(b.target.value)
668
+ }), /* @__PURE__ */ r.createElement("select", {
669
+ className: "rte-link-modal__select",
670
+ value: T,
671
+ onChange: (b) => L(b.target.value)
672
+ }, /* @__PURE__ */ r.createElement("option", {
673
+ value: "_self"
674
+ }, "Same tab"), /* @__PURE__ */ r.createElement("option", {
675
+ value: "_blank"
676
+ }, "New tab")), /* @__PURE__ */ r.createElement("div", {
677
+ className: "rte-link-modal__actions"
678
+ }, /* @__PURE__ */ r.createElement("button", {
679
+ className: "rte-link-modal__btn",
680
+ onClick: i
681
+ }, "Cancel"), /* @__PURE__ */ r.createElement("button", {
682
+ className: "rte-link-modal__btn rte-link-modal__btn--ok",
683
+ onClick: D
684
+ }, "OK"))));
685
+ }, zt = ({
1053
686
  atSuggestions: t = [],
1054
- showOutput: s = !1,
1055
- showPreview: c = !1,
687
+ showOutput: c = !1,
688
+ showPreview: i = !1,
1056
689
  toolbarConfig: d = {
1057
690
  link: !1,
1058
691
  image: !1,
@@ -1063,20 +696,25 @@ const At = ({
1063
696
  fontSize: !1,
1064
697
  highlight: !1
1065
698
  },
1066
- classNames: f = {},
1067
- styles: w = {},
1068
- handleGetHtml: k = () => {
699
+ classNames: v = {},
700
+ styles: y = {},
701
+ handleGetHtml: R = () => {
1069
702
  }
1070
703
  }) => {
1071
- var Ee, je, _e, ke, Le, Se, Te, Ae;
1072
- const R = U(null), [b, I] = F("<p>Always bet on Prime!</p>"), [P, T] = F(!1), [D, E] = F({ x: 0, y: 0 }), [X, B] = F(
1073
- []
1074
- ), A = U(null), q = U(null), [H, V] = F({ visible: !1, x: 0, y: 0 }), [Z, h] = F(!1), C = U(null), [J, le] = F({
704
+ var ce, ie, se, de, ue, me, he, ge;
705
+ const x = _(null), [w, H] = N("<p>Always bet on Prime!</p>"), [T, L] = N(!1), [D, b] = N({
706
+ x: 0,
707
+ y: 0
708
+ }), [X, j] = N([]), S = _(null), P = _(null), [A, F] = N({
709
+ visible: !1,
710
+ x: 0,
711
+ y: 0
712
+ }), [V, m] = N(!1), E = _(null), [$, G] = N({
1075
713
  url: "",
1076
714
  text: "",
1077
715
  title: "",
1078
716
  target: "_self"
1079
- }), G = {
717
+ }), xe = {
1080
718
  bold: !0,
1081
719
  italic: !0,
1082
720
  underline: !0,
@@ -1084,228 +722,227 @@ const At = ({
1084
722
  unorderedList: !0,
1085
723
  orderedList: !0,
1086
724
  align: !0,
1087
- link: (Ee = d.link) != null ? Ee : !1,
1088
- image: (je = d.image) != null ? je : !1,
1089
- emoji: (_e = d.emoji) != null ? _e : !1,
1090
- table: (ke = d.table) != null ? ke : !1,
1091
- color: (Le = d.color) != null ? Le : !1,
1092
- fontFamily: (Se = d.fontFamily) != null ? Se : !1,
1093
- fontSize: (Te = d.fontSize) != null ? Te : !1,
1094
- highlight: (Ae = d.fontSize) != null ? Ae : !1
1095
- }, [ge, se] = F(""), N = () => R.current, M = () => {
1096
- var r, o;
1097
- I((o = (r = N()) == null ? void 0 : r.innerHTML) != null ? o : "");
1098
- const e = Re();
1099
- k == null || k(e);
1100
- }, ie = () => {
725
+ link: (ce = d.link) != null ? ce : !1,
726
+ image: (ie = d.image) != null ? ie : !1,
727
+ emoji: (se = d.emoji) != null ? se : !1,
728
+ table: (de = d.table) != null ? de : !1,
729
+ color: (ue = d.color) != null ? ue : !1,
730
+ fontFamily: (me = d.fontFamily) != null ? me : !1,
731
+ fontSize: (he = d.fontSize) != null ? he : !1,
732
+ highlight: (ge = d.fontSize) != null ? ge : !1
733
+ }, [Re, ee] = N(""), O = () => x.current, z = () => {
734
+ var n, o;
735
+ H((o = (n = O()) == null ? void 0 : n.innerHTML) != null ? o : "");
736
+ const e = le();
737
+ R == null || R(e);
738
+ }, te = () => {
1101
739
  const e = window.getSelection();
1102
- e != null && e.rangeCount && (A.current = e.getRangeAt(0));
1103
- }, $ = () => {
740
+ e != null && e.rangeCount && (S.current = e.getRangeAt(0));
741
+ }, I = () => {
1104
742
  const e = window.getSelection();
1105
- e && A.current && (e.removeAllRanges(), e.addRange(A.current));
1106
- }, ce = (e, r) => {
743
+ e && S.current && (e.removeAllRanges(), e.addRange(S.current));
744
+ }, Le = (e, n) => {
1107
745
  const o = window.getSelection();
1108
- o && o.rangeCount > 0 && (A.current = o.getRangeAt(0)), $(), document.execCommand(e, !1, r), M();
746
+ o && o.rangeCount > 0 && (S.current = o.getRangeAt(0)), I(), document.execCommand(e, !1, n), z();
1109
747
  };
1110
- ae(() => {
1111
- const e = N();
1112
- e && !e.innerHTML && (e.innerHTML = b), M();
1113
- }, []), ae(() => () => {
748
+ B(() => {
749
+ const e = O();
750
+ e && !e.innerHTML && (e.innerHTML = w), z();
751
+ }, []), B(() => () => {
1114
752
  document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
1115
753
  }, []);
1116
- const Q = (e) => {
754
+ const ne = (e) => {
1117
755
  for (; e && e.nodeName !== "LI"; )
1118
756
  e = e.parentNode;
1119
757
  return e;
1120
- }, ue = (e) => {
1121
- let r = 0, o = e.parentElement;
758
+ }, Me = (e) => {
759
+ let n = 0, o = e.parentElement;
1122
760
  for (; o; )
1123
- (o.tagName === "UL" || o.tagName === "OL") && r++, o = o.parentElement;
1124
- return r;
1125
- }, de = (e) => {
1126
- const r = e.querySelector("li"), o = r ? ue(r) : 1;
761
+ (o.tagName === "UL" || o.tagName === "OL") && n++, o = o.parentElement;
762
+ return n;
763
+ }, ze = (e) => {
764
+ const n = e.querySelector("li"), o = n ? Me(n) : 1;
1127
765
  if (e.querySelector("[data-hidden-array-start]")) return;
1128
- const l = `{{#arrayData${o > 1 ? o : ""}}}`, p = `{{/arrayData${o > 1 ? o : ""}}}`, i = document.createElement("span");
1129
- i.textContent = l, i.style.display = "none", i.setAttribute("data-hidden-array-start", "true"), e.insertBefore(i, e.firstChild);
1130
- const u = document.createElement("span");
1131
- u.textContent = p, u.style.display = "none", u.setAttribute("data-hidden-array-end", "true"), e.appendChild(u);
1132
- }, ee = (e) => {
1133
- var x;
1134
- const r = window.getSelection();
1135
- if (!(r != null && r.rangeCount)) return;
1136
- const o = r.getRangeAt(0), l = Q(o.startContainer);
1137
- let p, i;
1138
- if (l) {
1139
- let m = l.querySelector(e);
1140
- m || (m = document.createElement(e), m.style.margin = "0", m.style.paddingLeft = "20px", l.appendChild(m)), i = m, p = document.createElement("li"), p.textContent = "​", i.appendChild(p);
766
+ const a = `{{#arrayData${o > 1 ? o : ""}}}`, h = `{{/arrayData${o > 1 ? o : ""}}}`, l = document.createElement("span");
767
+ l.textContent = a, l.style.display = "none", l.setAttribute("data-hidden-array-start", "true"), e.insertBefore(l, e.firstChild);
768
+ const s = document.createElement("span");
769
+ s.textContent = h, s.style.display = "none", s.setAttribute("data-hidden-array-end", "true"), e.appendChild(s);
770
+ }, re = (e) => {
771
+ var f;
772
+ const n = window.getSelection();
773
+ if (!(n != null && n.rangeCount)) return;
774
+ const o = n.getRangeAt(0), a = ne(o.startContainer);
775
+ let h, l;
776
+ if (a) {
777
+ let u = a.querySelector(e);
778
+ u || (u = document.createElement(e), u.style.margin = "0", u.style.paddingLeft = "20px", a.appendChild(u)), l = u, h = document.createElement("li"), h.textContent = "​", l.appendChild(h);
1141
779
  } else {
1142
- document.execCommand(
1143
- e === "ul" ? "insertUnorderedList" : "insertOrderedList"
1144
- );
1145
- const m = N();
1146
- if (i = m == null ? void 0 : m.querySelector(`${e}:last-child`), !i) return;
1147
- p = i.querySelector("li:last-child");
780
+ document.execCommand(e === "ul" ? "insertUnorderedList" : "insertOrderedList");
781
+ const u = O();
782
+ if (l = u == null ? void 0 : u.querySelector(`${e}:last-child`), !l) return;
783
+ h = l.querySelector("li:last-child");
1148
784
  }
1149
- de(i);
1150
- const u = document.createRange();
1151
- u.setStart(p, 0), u.collapse(!0), r.removeAllRanges(), r.addRange(u), (x = N()) == null || x.focus(), M();
1152
- }, n = (e, r) => {
1153
- e === "insertOrderedList" ? ee("ol") : e === "insertUnorderedList" ? ee("ul") : ce(e, r), e === "insertTable" && ve();
1154
- }, v = (e) => {
1155
- const r = document.createElement("span");
1156
- r.textContent = "​", e.insertNode(r), e.setStartAfter(r), e.collapse(!0);
1157
- const o = r.getBoundingClientRect();
1158
- r.remove(), E({ x: o.left, y: o.bottom + window.scrollY }), B(t || []), T(!0), q.current = e.cloneRange();
1159
- }, _ = () => {
785
+ ze(l);
786
+ const s = document.createRange();
787
+ s.setStart(h, 0), s.collapse(!0), n.removeAllRanges(), n.addRange(s), (f = O()) == null || f.focus(), z();
788
+ }, U = (e, n) => {
789
+ e === "insertOrderedList" ? re("ol") : e === "insertUnorderedList" ? re("ul") : Le(e, n), e === "insertTable" && He();
790
+ }, Se = (e) => {
791
+ const n = document.createElement("span");
792
+ n.textContent = "​", e.insertNode(n), e.setStartAfter(n), e.collapse(!0);
793
+ const o = n.getBoundingClientRect();
794
+ n.remove(), b({
795
+ x: o.left,
796
+ y: o.bottom + window.scrollY
797
+ }), j(t || []), L(!0), P.current = e.cloneRange();
798
+ }, ke = () => {
1160
799
  const e = window.getSelection();
1161
800
  if (!e || e.rangeCount === 0) return null;
1162
- const r = e.anchorNode;
801
+ const n = e.anchorNode;
1163
802
  let o = e.anchorOffset;
1164
- if (!r) return null;
1165
- let l = r;
1166
- for (l.nodeType !== Node.TEXT_NODE && (l.childNodes && l.childNodes[o] ? l = l.childNodes[o] : l = r.previousSibling); l; ) {
1167
- if (l.nodeType === Node.TEXT_NODE) {
1168
- const p = l.textContent || "", i = l === r ? o : p.length, u = p.lastIndexOf("@", i - 1);
1169
- if (u !== -1) {
1170
- const x = document.createRange();
1171
- return x.setStart(l, u), x.setEnd(l, i), x;
803
+ if (!n) return null;
804
+ let a = n;
805
+ for (a.nodeType !== Node.TEXT_NODE && (a.childNodes && a.childNodes[o] ? a = a.childNodes[o] : a = n.previousSibling); a; ) {
806
+ if (a.nodeType === Node.TEXT_NODE) {
807
+ const h = a.textContent || "", l = a === n ? o : h.length, s = h.lastIndexOf("@", l - 1);
808
+ if (s !== -1) {
809
+ const f = document.createRange();
810
+ return f.setStart(a, s), f.setEnd(a, l), f;
1172
811
  }
1173
812
  }
1174
- l = l.previousSibling;
813
+ a = a.previousSibling;
1175
814
  }
1176
815
  return null;
1177
- }, S = (e) => {
1178
- var p;
1179
- const r = window.getSelection();
1180
- if (!r) return;
1181
- const o = _();
1182
- o ? (r.removeAllRanges(), r.addRange(o)) : q.current && (r.removeAllRanges(), r.addRange(q.current));
1183
- const l = document.createElement("span");
1184
- l.textContent = `{{${e.key}}}`, l.style.color = "#007bff", l.style.display = "inline", l.contentEditable = "false", l.setAttribute("data-mention", e.value || e.key || "");
816
+ }, Ne = (e) => {
817
+ var h;
818
+ const n = window.getSelection();
819
+ if (!n) return;
820
+ const o = ke();
821
+ o ? (n.removeAllRanges(), n.addRange(o)) : P.current && (n.removeAllRanges(), n.addRange(P.current));
822
+ const a = document.createElement("span");
823
+ a.textContent = `{{${e.key}}}`, a.style.color = "#007bff", a.style.display = "inline", a.contentEditable = "false", a.setAttribute("data-mention", e.value || e.key || "");
1185
824
  try {
1186
- const i = r.rangeCount ? r.getRangeAt(0) : null;
1187
- if (i)
1188
- i.deleteContents(), i.insertNode(l);
825
+ const l = n.rangeCount ? n.getRangeAt(0) : null;
826
+ if (l)
827
+ l.deleteContents(), l.insertNode(a);
1189
828
  else {
1190
- const m = document.createRange(), y = N();
1191
- m.selectNodeContents(y), m.collapse(!1), m.insertNode(l);
829
+ const u = document.createRange(), p = O();
830
+ u.selectNodeContents(p), u.collapse(!1), u.insertNode(a);
1192
831
  }
1193
- const u = document.createTextNode(" ");
1194
- l.after(u);
1195
- const x = document.createRange();
1196
- x.setStartAfter(u), x.collapse(!0), r.removeAllRanges(), r.addRange(x);
1197
- } catch (i) {
1198
- console.error("insertMention error:", i);
832
+ const s = document.createTextNode(" ");
833
+ a.after(s);
834
+ const f = document.createRange();
835
+ f.setStartAfter(s), f.collapse(!0), n.removeAllRanges(), n.addRange(f);
836
+ } catch (l) {
837
+ console.error("insertMention error:", l);
1199
838
  }
1200
- T(!1), (p = N()) == null || p.focus(), M();
1201
- }, K = (e) => {
1202
- var o, l, p;
1203
- const r = e.key.toLowerCase();
1204
- if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(r) && (e.preventDefault(), n(
1205
- r === "b" ? "bold" : r === "i" ? "italic" : r === "u" ? "underline" : ""
1206
- )), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
1207
- const i = window.getSelection(), u = i != null && i.anchorNode ? Q(i.anchorNode) : null;
1208
- if (!u) return;
1209
- if (((o = u.textContent) == null ? void 0 : o.replace(/\u200B/g, "").trim()) === "") {
839
+ L(!1), (h = O()) == null || h.focus(), z();
840
+ }, Ae = (e) => {
841
+ var o, a, h;
842
+ const n = e.key.toLowerCase();
843
+ if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(n) && (e.preventDefault(), U(n === "b" ? "bold" : n === "i" ? "italic" : n === "u" ? "underline" : "")), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
844
+ const l = window.getSelection(), s = l != null && l.anchorNode ? ne(l.anchorNode) : null;
845
+ if (!s) return;
846
+ if (((o = s.textContent) == null ? void 0 : o.replace(/\u200B/g, "").trim()) === "") {
1210
847
  e.preventDefault();
1211
- const m = u.parentElement, y = m == null ? void 0 : m.closest("li");
1212
- if (y) {
1213
- m == null || m.removeChild(u);
848
+ const u = s.parentElement, p = u == null ? void 0 : u.closest("li");
849
+ if (p) {
850
+ u == null || u.removeChild(s);
1214
851
  const g = document.createElement("p");
1215
- g.innerHTML = "<br />", (l = y.parentElement) == null || l.insertBefore(g, y.nextSibling);
1216
- const j = document.createRange();
1217
- j.setStart(g, 0), j.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(j);
852
+ g.innerHTML = "<br />", (a = p.parentElement) == null || a.insertBefore(g, p.nextSibling);
853
+ const C = document.createRange();
854
+ C.setStart(g, 0), C.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(C);
1218
855
  } else {
1219
- const g = u.closest("ul, ol");
856
+ const g = s.closest("ul, ol");
1220
857
  if (g) {
1221
- const j = document.createElement("p");
1222
- j.innerHTML = "<br />", (p = g.parentElement) == null || p.insertBefore(j, g.nextSibling), g.removeChild(u);
1223
- const O = document.createRange();
1224
- O.setStart(j, 0), O.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(O);
858
+ const C = document.createElement("p");
859
+ C.innerHTML = "<br />", (h = g.parentElement) == null || h.insertBefore(C, g.nextSibling), g.removeChild(s);
860
+ const k = document.createRange();
861
+ k.setStart(C, 0), k.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(k);
1225
862
  }
1226
863
  }
1227
- M();
864
+ z();
1228
865
  }
1229
866
  }
1230
- }, te = (e) => {
867
+ }, Te = (e) => {
1231
868
  if (e.data === "@") {
1232
869
  const o = window.getSelection();
1233
870
  if (!(o != null && o.rangeCount)) return;
1234
871
  setTimeout(() => {
1235
- v(o.getRangeAt(0)), se(""), B(t), T(!0);
872
+ Se(o.getRangeAt(0)), ee(""), j(t), L(!0);
1236
873
  }, 0);
1237
874
  return;
1238
875
  }
1239
- if (P) {
1240
- setTimeout(() => L(), 0);
876
+ if (T) {
877
+ setTimeout(() => oe(), 0);
1241
878
  return;
1242
879
  }
1243
- }, L = () => {
1244
- if (M(), !P) return;
880
+ }, oe = () => {
881
+ if (z(), !T) return;
1245
882
  const e = window.getSelection();
1246
883
  if (!e || !e.anchorNode) return;
1247
884
  const o = (e.anchorNode.textContent || "").match(/@([a-zA-Z0-9_]*)$/);
1248
885
  if (!o) {
1249
- T(!1);
886
+ L(!1);
1250
887
  return;
1251
888
  }
1252
- const l = o[1].toLowerCase();
1253
- se(l);
1254
- const p = t.filter((i) => i.key.toLowerCase().includes(l));
1255
- B(p);
1256
- }, Y = (e) => {
1257
- var l;
1258
- const r = (l = e.target.files) == null ? void 0 : l[0];
1259
- if (!r) return;
889
+ const a = o[1].toLowerCase();
890
+ ee(a);
891
+ const h = t.filter((l) => l.key.toLowerCase().includes(a));
892
+ j(h);
893
+ }, De = (e) => {
894
+ var a;
895
+ const n = (a = e.target.files) == null ? void 0 : a[0];
896
+ if (!n) return;
1260
897
  const o = new FileReader();
1261
- o.onload = (p) => {
1262
- var O;
1263
- const i = (O = p.target) == null ? void 0 : O.result;
1264
- $();
1265
- const u = window.getSelection();
1266
- let x = u && u.rangeCount ? u.getRangeAt(0) : null;
1267
- const m = document.createElement("img");
1268
- m.src = i, m.alt = r.name || "image", m.className = "rte-inserted-image", m.contentEditable = "true";
1269
- const y = N();
1270
- if (!x || !y) {
1271
- y == null || y.appendChild(m);
1272
- const Me = document.createTextNode(" ");
1273
- y == null || y.appendChild(Me);
1274
- const we = document.createRange();
1275
- we.setStartAfter(Me), we.collapse(!0), u == null || u.removeAllRanges(), u == null || u.addRange(we), y == null || y.focus(), M(), e.target.value = "";
898
+ o.onload = (h) => {
899
+ var k;
900
+ const l = (k = h.target) == null ? void 0 : k.result;
901
+ I();
902
+ const s = window.getSelection();
903
+ let f = s && s.rangeCount ? s.getRangeAt(0) : null;
904
+ const u = document.createElement("img");
905
+ u.src = l, u.alt = n.name || "image", u.className = "rte-inserted-image", u.contentEditable = "true";
906
+ const p = O();
907
+ if (!f || !p) {
908
+ p == null || p.appendChild(u);
909
+ const fe = document.createTextNode(" ");
910
+ p == null || p.appendChild(fe);
911
+ const Z = document.createRange();
912
+ Z.setStartAfter(fe), Z.collapse(!0), s == null || s.removeAllRanges(), s == null || s.addRange(Z), p == null || p.focus(), z(), e.target.value = "";
1276
913
  return;
1277
914
  }
1278
- x.deleteContents(), x.insertNode(m);
915
+ f.deleteContents(), f.insertNode(u);
1279
916
  const g = document.createTextNode(" ");
1280
- m.after(g);
1281
- const j = document.createRange();
1282
- j.setStartAfter(g), j.collapse(!0), u.removeAllRanges(), u.addRange(j), y.focus(), M(), e.target.value = "";
1283
- }, o.readAsDataURL(r);
1284
- }, ne = (e) => {
1285
- var p;
1286
- $();
1287
- const r = window.getSelection();
1288
- if (!(r != null && r.rangeCount)) return;
1289
- const o = r.getRangeAt(0), l = document.createTextNode(e);
1290
- o.insertNode(l), o.setStartAfter(l), o.collapse(!0), r.removeAllRanges(), r.addRange(o), (p = N()) == null || p.focus(), M();
1291
- }, ve = () => {
1292
- $();
917
+ u.after(g);
918
+ const C = document.createRange();
919
+ C.setStartAfter(g), C.collapse(!0), s.removeAllRanges(), s.addRange(C), p.focus(), z(), e.target.value = "";
920
+ }, o.readAsDataURL(n);
921
+ }, Oe = (e) => {
922
+ var h;
923
+ I();
924
+ const n = window.getSelection();
925
+ if (!(n != null && n.rangeCount)) return;
926
+ const o = n.getRangeAt(0), a = document.createTextNode(e);
927
+ o.insertNode(a), o.setStartAfter(a), o.collapse(!0), n.removeAllRanges(), n.addRange(o), (h = O()) == null || h.focus(), z();
928
+ }, He = () => {
929
+ I();
1293
930
  const e = document.createElement("table");
1294
931
  e.style.borderCollapse = "collapse", e.style.width = "100%", e.style.border = "1px solid #ccc", e.style.margin = "8px 0", e.style.position = "relative";
1295
- const r = document.createElement("thead"), o = document.createElement("tbody"), l = document.createElement("tr"), p = document.createElement("tr");
1296
- for (let x = 0; x < 2; x++) {
1297
- const m = document.createElement("th");
1298
- m.textContent = `Header ${x + 1}`, m.style.border = "1px solid #999", m.style.padding = "8px", m.style.position = "relative";
1299
- const y = document.createElement("td");
1300
- y.textContent = `Row 1 Col ${x + 1}`, y.style.border = "1px solid #999", y.style.padding = "8px", y.style.position = "relative", xe(m), xe(y), l.appendChild(m), p.appendChild(y);
932
+ const n = document.createElement("thead"), o = document.createElement("tbody"), a = document.createElement("tr"), h = document.createElement("tr");
933
+ for (let f = 0; f < 2; f++) {
934
+ const u = document.createElement("th");
935
+ u.textContent = `Header ${f + 1}`, u.style.border = "1px solid #999", u.style.padding = "8px", u.style.position = "relative";
936
+ const p = document.createElement("td");
937
+ p.textContent = `Row 1 Col ${f + 1}`, p.style.border = "1px solid #999", p.style.padding = "8px", p.style.position = "relative", Y(u), Y(p), a.appendChild(u), h.appendChild(p);
1301
938
  }
1302
- r.appendChild(l), o.appendChild(p), e.appendChild(r), e.appendChild(o), qe(e), Ve(e);
1303
- const i = window.getSelection();
1304
- if (!(i != null && i.rangeCount)) return;
1305
- i.getRangeAt(0).insertNode(e), M();
1306
- }, Ve = (e) => {
1307
- const r = document.createElement("div");
1308
- Object.assign(r.style, {
939
+ n.appendChild(a), o.appendChild(h), e.appendChild(n), e.appendChild(o), Ie(e), _e(e);
940
+ const l = window.getSelection();
941
+ if (!(l != null && l.rangeCount)) return;
942
+ l.getRangeAt(0).insertNode(e), z();
943
+ }, _e = (e) => {
944
+ const n = document.createElement("div");
945
+ Object.assign(n.style, {
1309
946
  position: "absolute",
1310
947
  width: "14px",
1311
948
  height: "14px",
@@ -1316,22 +953,22 @@ const At = ({
1316
953
  zIndex: "20",
1317
954
  borderRadius: "2px"
1318
955
  });
1319
- let o = 0, l = 0, p = 0, i = 0;
1320
- r.addEventListener("mousedown", (u) => {
1321
- u.preventDefault(), o = u.clientX, l = u.clientY;
1322
- const x = e.getBoundingClientRect();
1323
- p = x.width, i = x.height;
1324
- const m = (g) => {
1325
- const j = Math.max(100, p + (g.clientX - o)), O = Math.max(60, i + (g.clientY - l));
1326
- e.style.width = `${j}px`, e.style.height = `${O}px`, M();
1327
- }, y = () => {
1328
- document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", y), M();
956
+ let o = 0, a = 0, h = 0, l = 0;
957
+ n.addEventListener("mousedown", (s) => {
958
+ s.preventDefault(), o = s.clientX, a = s.clientY;
959
+ const f = e.getBoundingClientRect();
960
+ h = f.width, l = f.height;
961
+ const u = (g) => {
962
+ const C = Math.max(100, h + (g.clientX - o)), k = Math.max(60, l + (g.clientY - a));
963
+ e.style.width = `${C}px`, e.style.height = `${k}px`, z();
964
+ }, p = () => {
965
+ document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", p), z();
1329
966
  };
1330
- document.addEventListener("mousemove", m), document.addEventListener("mouseup", y);
1331
- }), e.appendChild(r);
1332
- }, xe = (e) => {
1333
- const r = document.createElement("div"), o = document.createElement("div");
1334
- Object.assign(r.style, {
967
+ document.addEventListener("mousemove", u), document.addEventListener("mouseup", p);
968
+ }), e.appendChild(n);
969
+ }, Y = (e) => {
970
+ const n = document.createElement("div"), o = document.createElement("div");
971
+ Object.assign(n.style, {
1335
972
  position: "absolute",
1336
973
  right: "0",
1337
974
  top: "0",
@@ -1349,257 +986,230 @@ const At = ({
1349
986
  cursor: "row-resize",
1350
987
  background: "rgba(0,0,0,0.15)",
1351
988
  zIndex: "10"
1352
- }), Ye(e, r, o), e.appendChild(r), e.appendChild(o);
1353
- }, Ye = (e, r, o) => {
1354
- let l = 0, p = 0, i = 0, u = 0;
1355
- r.addEventListener("mousedown", (g) => {
1356
- g.preventDefault(), l = g.clientX, i = e.offsetWidth, document.addEventListener("mousemove", x), document.addEventListener("mouseup", y);
989
+ }), je(e, n, o), e.appendChild(n), e.appendChild(o);
990
+ }, je = (e, n, o) => {
991
+ let a = 0, h = 0, l = 0, s = 0;
992
+ n.addEventListener("mousedown", (g) => {
993
+ g.preventDefault(), a = g.clientX, l = e.offsetWidth, document.addEventListener("mousemove", f), document.addEventListener("mouseup", p);
1357
994
  }), o.addEventListener("mousedown", (g) => {
1358
- g.preventDefault(), p = g.clientY, u = e.offsetHeight, document.addEventListener("mousemove", m), document.addEventListener("mouseup", y);
995
+ g.preventDefault(), h = g.clientY, s = e.offsetHeight, document.addEventListener("mousemove", u), document.addEventListener("mouseup", p);
1359
996
  });
1360
- const x = (g) => {
1361
- const j = i + (g.clientX - l);
1362
- e.style.width = `${Math.max(30, j)}px`;
1363
- }, m = (g) => {
1364
- const j = u + (g.clientY - p);
1365
- e.style.height = `${Math.max(20, j)}px`;
1366
- }, y = () => {
1367
- document.removeEventListener("mousemove", x), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", y);
997
+ const f = (g) => {
998
+ const C = l + (g.clientX - a);
999
+ e.style.width = `${Math.max(30, C)}px`;
1000
+ }, u = (g) => {
1001
+ const C = s + (g.clientY - h);
1002
+ e.style.height = `${Math.max(20, C)}px`;
1003
+ }, p = () => {
1004
+ document.removeEventListener("mousemove", f), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", p);
1368
1005
  };
1369
- }, Ue = (e) => {
1006
+ }, Fe = (e) => {
1370
1007
  const o = e.target.closest("td, th");
1371
- o && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight")), o.classList.add("rte-cell-highlight"), V({ visible: !0, x: e.clientX, y: e.clientY, cell: o }));
1372
- }, Ce = () => {
1008
+ o && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight")), o.classList.add("rte-cell-highlight"), F({
1009
+ visible: !0,
1010
+ x: e.clientX,
1011
+ y: e.clientY,
1012
+ cell: o
1013
+ }));
1014
+ }, ae = () => {
1373
1015
  document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
1374
- }, We = (e) => {
1375
- if (!H.cell) return;
1376
- const r = H.cell.closest("table"), o = H.cell.cellIndex, l = H.cell.parentElement.rowIndex, p = (i) => {
1377
- const u = i.tagName.toLowerCase(), x = document.createElement(u);
1378
- return x.textContent = i.textContent || "", x.style.cssText = i.style.cssText, xe(x), x;
1016
+ }, Pe = (e) => {
1017
+ if (!A.cell) return;
1018
+ const n = A.cell.closest("table"), o = A.cell.cellIndex, a = A.cell.parentElement.rowIndex, h = (l) => {
1019
+ const s = l.tagName.toLowerCase(), f = document.createElement(s);
1020
+ return f.textContent = l.textContent || "", f.style.cssText = l.style.cssText, Y(f), f;
1379
1021
  };
1380
1022
  switch (e) {
1381
1023
  case "insertRowAbove": {
1382
- const i = r.rows[l], u = r.insertRow(l);
1383
- Array.from(i.cells).forEach((x) => {
1384
- u.appendChild(p(x));
1024
+ const l = n.rows[a], s = n.insertRow(a);
1025
+ Array.from(l.cells).forEach((f) => {
1026
+ s.appendChild(h(f));
1385
1027
  });
1386
1028
  break;
1387
1029
  }
1388
1030
  case "insertRowBelow": {
1389
- const i = r.rows[l], u = r.insertRow(l + 1);
1390
- Array.from(i.cells).forEach((x) => {
1391
- u.appendChild(p(x));
1031
+ const l = n.rows[a], s = n.insertRow(a + 1);
1032
+ Array.from(l.cells).forEach((f) => {
1033
+ s.appendChild(h(f));
1392
1034
  });
1393
1035
  break;
1394
1036
  }
1395
1037
  case "insertColLeft": {
1396
- Array.from(r.rows).forEach((i) => {
1397
- const u = i.cells[o];
1398
- i.insertBefore(p(u), u);
1038
+ Array.from(n.rows).forEach((l) => {
1039
+ const s = l.cells[o];
1040
+ l.insertBefore(h(s), s);
1399
1041
  });
1400
1042
  break;
1401
1043
  }
1402
1044
  case "insertColRight": {
1403
- Array.from(r.rows).forEach((i) => {
1404
- const u = i.cells[o];
1405
- i.insertBefore(p(u), u.nextSibling);
1045
+ Array.from(n.rows).forEach((l) => {
1046
+ const s = l.cells[o];
1047
+ l.insertBefore(h(s), s.nextSibling);
1406
1048
  });
1407
1049
  break;
1408
1050
  }
1409
1051
  case "deleteRow":
1410
- r.rows.length > 1 && r.deleteRow(l);
1052
+ n.rows.length > 1 && n.deleteRow(a);
1411
1053
  break;
1412
1054
  case "deleteCol":
1413
- Array.from(r.rows).forEach((i) => {
1414
- i.cells[o] && i.deleteCell(o);
1055
+ Array.from(n.rows).forEach((l) => {
1056
+ l.cells[o] && l.deleteCell(o);
1415
1057
  });
1416
1058
  break;
1417
1059
  }
1418
- M(), V(ye(be({}, H), { visible: !1 })), Ce();
1419
- }, qe = (e) => {
1420
- const r = e.querySelector("tbody");
1421
- if (!r || r.querySelector("[data-hidden-table-start]")) return;
1060
+ z(), F(J(Q({}, A), {
1061
+ visible: !1
1062
+ })), ae();
1063
+ }, Ie = (e) => {
1064
+ const n = e.querySelector("tbody");
1065
+ if (!n || n.querySelector("[data-hidden-table-start]")) return;
1422
1066
  const o = document.createElement("span");
1423
- o.textContent = "{{#tableData}}", o.style.display = "none", o.setAttribute("data-hidden-table-start", "true"), r.insertBefore(o, r.firstChild);
1424
- const l = document.createElement("span");
1425
- l.textContent = "{{/tableData}}", l.style.display = "none", l.setAttribute("data-hidden-table-end", "true"), r.appendChild(l);
1426
- }, Re = () => {
1427
- const e = N();
1428
- if (!e) return b;
1429
- const r = e.cloneNode(!0);
1430
- return r.querySelectorAll(".rte-cell-highlight").forEach((o) => {
1067
+ o.textContent = "{{#tableData}}", o.style.display = "none", o.setAttribute("data-hidden-table-start", "true"), n.insertBefore(o, n.firstChild);
1068
+ const a = document.createElement("span");
1069
+ a.textContent = "{{/tableData}}", a.style.display = "none", a.setAttribute("data-hidden-table-end", "true"), n.appendChild(a);
1070
+ }, le = () => {
1071
+ const e = O();
1072
+ if (!e) return w;
1073
+ const n = e.cloneNode(!0);
1074
+ return n.querySelectorAll(".rte-cell-highlight").forEach((o) => {
1431
1075
  o.classList.remove("rte-cell-highlight");
1432
- }), r.querySelectorAll("div").forEach((o) => {
1076
+ }), n.querySelectorAll("div").forEach((o) => {
1433
1077
  (o.style.cursor === "col-resize" || o.style.cursor === "row-resize" || o.style.cursor === "nwse-resize") && o.remove();
1434
- }), r.innerHTML;
1435
- }, Xe = () => {
1436
- ie(), C.current = A.current, le({ url: "", text: "", title: "", target: "_self" }), h(!0);
1437
- }, Ze = (e) => {
1438
- const r = window.getSelection();
1439
- if (!r || !C.current) return;
1440
- r.removeAllRanges(), r.addRange(C.current);
1078
+ }), n.innerHTML;
1079
+ }, Be = () => {
1080
+ te(), E.current = S.current, G({
1081
+ url: "",
1082
+ text: "",
1083
+ title: "",
1084
+ target: "_self"
1085
+ }), m(!0);
1086
+ }, Ve = (e) => {
1087
+ const n = window.getSelection();
1088
+ if (!n || !E.current) return;
1089
+ n.removeAllRanges(), n.addRange(E.current);
1441
1090
  let o = e.url.trim();
1442
1091
  /^https?:\/\//i.test(o) || (o = "https://" + o);
1443
- const l = document.createElement("a");
1444
- l.href = o, l.style.cursor = "pointer", l.style.outline = "none", l.textContent = e.text || o, l.title = e.title, l.target = e.target, l.contentEditable = "true";
1445
- const p = r.getRangeAt(0);
1446
- p.deleteContents(), p.insertNode(l);
1447
- const i = document.createTextNode(" ");
1448
- l.after(i);
1449
- const u = document.createRange();
1450
- u.setStartAfter(i), u.collapse(!0), r.removeAllRanges(), r.addRange(u), h(!1), M();
1451
- }, Je = (e) => {
1452
- const r = e.target;
1453
- if (r.tagName === "A") {
1454
- const o = r;
1092
+ const a = document.createElement("a");
1093
+ a.href = o, a.style.cursor = "pointer", a.style.outline = "none", a.textContent = e.text || o, a.title = e.title, a.target = e.target, a.contentEditable = "true";
1094
+ const h = n.getRangeAt(0);
1095
+ h.deleteContents(), h.insertNode(a);
1096
+ const l = document.createTextNode(" ");
1097
+ a.after(l);
1098
+ const s = document.createRange();
1099
+ s.setStartAfter(l), s.collapse(!0), n.removeAllRanges(), n.addRange(s), m(!1), z();
1100
+ }, $e = (e) => {
1101
+ const n = e.target;
1102
+ if (n.tagName === "A") {
1103
+ const o = n;
1455
1104
  if (e.ctrlKey || e.metaKey) {
1456
1105
  window.open(o.href, "_blank", "noopener,noreferrer");
1457
1106
  return;
1458
1107
  }
1459
1108
  e.preventDefault();
1460
- const l = document.createRange();
1461
- l.selectNode(o), C.current = l, le({
1109
+ const a = document.createRange();
1110
+ a.selectNode(o), E.current = a, G({
1462
1111
  url: o.href,
1463
1112
  text: o.textContent || o.href,
1464
1113
  title: o.title,
1465
1114
  target: o.target
1466
- }), h(!0);
1115
+ }), m(!0);
1467
1116
  }
1468
- }, Ke = () => {
1469
- const e = N();
1117
+ }, Ue = () => {
1118
+ const e = O();
1470
1119
  if (!e) return;
1471
- const r = window.getSelection();
1472
- if ((!r || r.rangeCount === 0) && A.current) {
1120
+ const n = window.getSelection();
1121
+ if ((!n || n.rangeCount === 0) && S.current) {
1473
1122
  const g = window.getSelection();
1474
- g == null || g.removeAllRanges(), g == null || g.addRange(A.current);
1123
+ g == null || g.removeAllRanges(), g == null || g.addRange(S.current);
1475
1124
  }
1476
1125
  const o = window.getSelection();
1477
1126
  if (!o || o.rangeCount === 0) return;
1478
- const l = o.getRangeAt(0);
1479
- $(), document.execCommand("removeFormat", !1);
1480
- const p = l.cloneContents(), i = document.createElement("div");
1481
- i.appendChild(p);
1482
- const u = document.createTreeWalker(
1483
- i,
1484
- NodeFilter.SHOW_ELEMENT,
1485
- null
1486
- ), x = [];
1487
- for (; u.nextNode(); ) {
1488
- const g = u.currentNode, j = g.tagName.toUpperCase(), O = g.getAttribute && g.getAttribute("data-mention") !== null;
1489
- j !== "A" && !O && x.push(g);
1127
+ const a = o.getRangeAt(0);
1128
+ I(), document.execCommand("removeFormat", !1);
1129
+ const h = a.cloneContents(), l = document.createElement("div");
1130
+ l.appendChild(h);
1131
+ const s = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, null), f = [];
1132
+ for (; s.nextNode(); ) {
1133
+ const g = s.currentNode, C = g.tagName.toUpperCase(), k = g.getAttribute && g.getAttribute("data-mention") !== null;
1134
+ C !== "A" && !k && f.push(g);
1490
1135
  }
1491
- for (let g = x.length - 1; g >= 0; g--) {
1492
- const j = x[g], O = j.parentNode;
1493
- if (O) {
1494
- for (; j.firstChild; ) O.insertBefore(j.firstChild, j);
1495
- O.removeChild(j);
1136
+ for (let g = f.length - 1; g >= 0; g--) {
1137
+ const C = f[g], k = C.parentNode;
1138
+ if (k) {
1139
+ for (; C.firstChild; ) k.insertBefore(C.firstChild, C);
1140
+ k.removeChild(C);
1496
1141
  }
1497
1142
  }
1498
- i.querySelectorAll("[style]").forEach((g) => g.removeAttribute("style")), l.deleteContents();
1499
- const m = document.createDocumentFragment();
1500
- for (; i.firstChild; ) m.appendChild(i.firstChild);
1501
- l.insertNode(m);
1502
- const y = document.createRange();
1503
- y.setStartAfter(
1504
- l.endContainer.nodeType === Node.TEXT_NODE ? l.endContainer : l.startContainer
1505
- ), y.collapse(!0), o.removeAllRanges(), o.addRange(y), e.normalize(), M();
1143
+ l.querySelectorAll("[style]").forEach((g) => g.removeAttribute("style")), a.deleteContents();
1144
+ const u = document.createDocumentFragment();
1145
+ for (; l.firstChild; ) u.appendChild(l.firstChild);
1146
+ a.insertNode(u);
1147
+ const p = document.createRange();
1148
+ p.setStartAfter(a.endContainer.nodeType === Node.TEXT_NODE ? a.endContainer : a.startContainer), p.collapse(!0), o.removeAllRanges(), o.addRange(p), e.normalize(), z();
1506
1149
  };
1507
- return /* @__PURE__ */ a.jsxs(
1508
- "div",
1509
- {
1510
- className: `rte-wrapper ${(f == null ? void 0 : f.wrapper) || ""}`,
1511
- style: w.wrapper,
1512
- children: [
1513
- /* @__PURE__ */ a.jsxs("div", { style: { flex: 1 }, children: [
1514
- /* @__PURE__ */ a.jsx(
1515
- St,
1516
- {
1517
- exec: n,
1518
- saveSelection: ie,
1519
- handleFileChange: Y,
1520
- handleFontSizeChange: (e) => n("fontSize", e.target.value),
1521
- handleFontFamilyChange: (e) => n("fontName", e.target.value),
1522
- insertEmoji: ne,
1523
- handleLink: Xe,
1524
- removeFormatting: Ke,
1525
- visibleActions: G,
1526
- className: f.toolbar,
1527
- style: w.toolbar
1528
- }
1529
- ),
1530
- /* @__PURE__ */ a.jsx(
1531
- "div",
1532
- {
1533
- ref: R,
1534
- className: `rte-editor ${(f == null ? void 0 : f.editor) || ""}`,
1535
- style: w.editor,
1536
- contentEditable: !0,
1537
- suppressContentEditableWarning: !0,
1538
- onInput: L,
1539
- onKeyDown: K,
1540
- onBeforeInput: te,
1541
- onContextMenu: Ue,
1542
- onClick: Je
1543
- }
1544
- ),
1545
- /* @__PURE__ */ a.jsx(
1546
- Tt,
1547
- {
1548
- show: P,
1549
- position: D,
1550
- filtered: X,
1551
- insertMention: S,
1552
- onClose: () => T(!1),
1553
- query: ge
1554
- }
1555
- ),
1556
- s && /* @__PURE__ */ a.jsxs(
1557
- "div",
1558
- {
1559
- className: `rte-output ${(f == null ? void 0 : f.output) || ""}`,
1560
- style: w.output,
1561
- children: [
1562
- /* @__PURE__ */ a.jsx("h4", { children: "Output HTML:" }),
1563
- /* @__PURE__ */ a.jsx("p", { children: b })
1564
- ]
1565
- }
1566
- ),
1567
- /* @__PURE__ */ a.jsx(
1568
- At,
1569
- {
1570
- visible: H.visible,
1571
- x: H.x,
1572
- y: H.y,
1573
- onAction: We,
1574
- onClose: () => {
1575
- V(ye(be({}, H), { visible: !1 })), Ce();
1576
- }
1577
- }
1578
- ),
1579
- /* @__PURE__ */ a.jsx(
1580
- zt,
1581
- {
1582
- visible: Z,
1583
- linkData: J,
1584
- onClose: () => h(!1),
1585
- onInsert: Ze
1586
- }
1587
- )
1588
- ] }),
1589
- c ? /* @__PURE__ */ a.jsx(
1590
- Mt,
1591
- {
1592
- className: f.preview,
1593
- style: w.preview,
1594
- html: Re()
1595
- }
1596
- ) : null
1597
- ]
1150
+ return /* @__PURE__ */ r.createElement("div", {
1151
+ className: `rte-wrapper ${(v == null ? void 0 : v.wrapper) || ""}`,
1152
+ style: y.wrapper
1153
+ }, /* @__PURE__ */ r.createElement("div", {
1154
+ style: {
1155
+ flex: 1
1156
+ }
1157
+ }, /* @__PURE__ */ r.createElement(yt, {
1158
+ exec: U,
1159
+ saveSelection: te,
1160
+ handleFileChange: De,
1161
+ handleFontSizeChange: (e) => U("fontSize", e.target.value),
1162
+ handleFontFamilyChange: (e) => U("fontName", e.target.value),
1163
+ insertEmoji: Oe,
1164
+ handleLink: Be,
1165
+ removeFormatting: Ue,
1166
+ visibleActions: xe,
1167
+ className: v.toolbar,
1168
+ style: y.toolbar
1169
+ }), /* @__PURE__ */ r.createElement("div", {
1170
+ ref: x,
1171
+ className: `rte-editor ${(v == null ? void 0 : v.editor) || ""}`,
1172
+ style: y.editor,
1173
+ contentEditable: !0,
1174
+ suppressContentEditableWarning: !0,
1175
+ onInput: oe,
1176
+ onKeyDown: Ae,
1177
+ onBeforeInput: Te,
1178
+ onContextMenu: Fe,
1179
+ onClick: $e
1180
+ }), /* @__PURE__ */ r.createElement(Ct, {
1181
+ show: T,
1182
+ position: D,
1183
+ filtered: X,
1184
+ insertMention: Ne,
1185
+ onClose: () => L(!1),
1186
+ query: Re
1187
+ }), c && /* @__PURE__ */ r.createElement("div", {
1188
+ className: `rte-output ${(v == null ? void 0 : v.output) || ""}`,
1189
+ style: y.output
1190
+ }, /* @__PURE__ */ r.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ r.createElement("p", null, w)), /* @__PURE__ */ r.createElement(bt, {
1191
+ visible: A.visible,
1192
+ x: A.x,
1193
+ y: A.y,
1194
+ onAction: Pe,
1195
+ onClose: () => {
1196
+ F(J(Q({}, A), {
1197
+ visible: !1
1198
+ })), ae();
1598
1199
  }
1599
- );
1200
+ }), /* @__PURE__ */ r.createElement(Rt, {
1201
+ visible: V,
1202
+ linkData: $,
1203
+ onClose: () => m(!1),
1204
+ onInsert: Ve
1205
+ })), i ? /* @__PURE__ */ r.createElement(xt, {
1206
+ className: v.preview,
1207
+ style: y.preview,
1208
+ html: le()
1209
+ }) : null);
1600
1210
  };
1601
1211
  export {
1602
- Pt as RichTextEditor,
1603
- Mt as RtePreview,
1604
- St as RteToolbar
1212
+ zt as RichTextEditor,
1213
+ xt as RtePreview,
1214
+ yt as RteToolbar
1605
1215
  };