@ryzeup/richtexteditor 1.0.3 → 1.0.5

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