@uva-glass/component-library 1.52.1 → 1.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/{Lexical.prod-zUeT_jIr.js → Lexical.prod-DNRTKPfN.js} +72 -66
  2. package/dist/Lexical.prod-DNRTKPfN.js.map +1 -0
  3. package/dist/{LexicalUtils.prod-DtRifALg.js → LexicalUtils.prod-D_BPEjfg.js} +2 -2
  4. package/dist/{LexicalUtils.prod-DtRifALg.js.map → LexicalUtils.prod-D_BPEjfg.js.map} +1 -1
  5. package/dist/{ListPlugin-CxyYg2bv.js → ListPlugin-CgNBzfIl.js} +4 -4
  6. package/dist/{ListPlugin-CxyYg2bv.js.map → ListPlugin-CgNBzfIl.js.map} +1 -1
  7. package/dist/{MultiSelect-D1FnMER4.js → MultiSelect-DQaqItEH.js} +13 -11
  8. package/dist/{MultiSelect-D1FnMER4.js.map → MultiSelect-DQaqItEH.js.map} +1 -1
  9. package/dist/RteEditor.module-BjGyWKhW.js +26 -0
  10. package/dist/RteEditor.module-BjGyWKhW.js.map +1 -0
  11. package/dist/Sortable.module-BrgGu8qp.js +24 -0
  12. package/dist/Sortable.module-BrgGu8qp.js.map +1 -0
  13. package/dist/SortableProvider-Z0e0qeQT.js +152 -0
  14. package/dist/SortableProvider-Z0e0qeQT.js.map +1 -0
  15. package/dist/assets/RteEditor.css +1 -1
  16. package/dist/assets/Sortable.css +1 -0
  17. package/dist/components/CheckboxTree/CheckboxTree.js +11 -9
  18. package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
  19. package/dist/components/Icon/icons/index.d.ts +9 -0
  20. package/dist/components/Icon/icons/index.js +52 -37
  21. package/dist/components/Icon/icons/index.js.map +1 -1
  22. package/dist/components/InputField/InputField.stories.js +13 -11
  23. package/dist/components/InputField/InputField.stories.js.map +1 -1
  24. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  25. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  26. package/dist/components/MultiSelect/components/MultiSelectHeader.js +4 -2
  27. package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
  28. package/dist/components/MultiSelect/index.js +1 -1
  29. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +26 -24
  30. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
  31. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
  32. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.d.ts +1 -0
  33. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +64 -0
  34. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -0
  35. package/dist/components/RteEditor/Plugins/HistoryPlugin/index.d.ts +1 -0
  36. package/dist/components/RteEditor/Plugins/HistoryPlugin/index.js +5 -0
  37. package/dist/components/RteEditor/Plugins/HistoryPlugin/index.js.map +1 -0
  38. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +23 -21
  39. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  40. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  41. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
  42. package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
  43. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +22 -20
  44. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  45. package/dist/components/RteEditor/Plugins/index.d.ts +2 -0
  46. package/dist/components/RteEditor/Plugins/index.js +10 -6
  47. package/dist/components/RteEditor/Plugins/index.js.map +1 -1
  48. package/dist/components/RteEditor/RteEditor.js +569 -462
  49. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  50. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
  51. package/dist/components/RteEditor/hooks/useFlyout.js +9 -7
  52. package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
  53. package/dist/components/Sortable/Sortable.d.ts +16 -0
  54. package/dist/components/Sortable/Sortable.js +27 -0
  55. package/dist/components/Sortable/Sortable.js.map +1 -0
  56. package/dist/components/Sortable/Sortable.stories.d.ts +7 -0
  57. package/dist/components/Sortable/Sortable.stories.js +53 -0
  58. package/dist/components/Sortable/Sortable.stories.js.map +1 -0
  59. package/dist/components/Sortable/SortableProvider.d.ts +23 -0
  60. package/dist/components/Sortable/SortableProvider.js +10 -0
  61. package/dist/components/Sortable/SortableProvider.js.map +1 -0
  62. package/dist/components/Sortable/actions.d.ts +49 -0
  63. package/dist/components/Sortable/actions.js +33 -0
  64. package/dist/components/Sortable/actions.js.map +1 -0
  65. package/dist/components/Sortable/components/SortableContainer.d.ts +7 -0
  66. package/dist/components/Sortable/components/SortableContainer.js +9 -0
  67. package/dist/components/Sortable/components/SortableContainer.js.map +1 -0
  68. package/dist/components/Sortable/components/SortableHandle.d.ts +4 -0
  69. package/dist/components/Sortable/components/SortableHandle.js +11 -0
  70. package/dist/components/Sortable/components/SortableHandle.js.map +1 -0
  71. package/dist/components/Sortable/components/SortableItem.d.ts +9 -0
  72. package/dist/components/Sortable/components/SortableItem.js +113 -0
  73. package/dist/components/Sortable/components/SortableItem.js.map +1 -0
  74. package/dist/components/Sortable/constants.d.ts +10 -0
  75. package/dist/components/Sortable/constants.js +14 -0
  76. package/dist/components/Sortable/constants.js.map +1 -0
  77. package/dist/components/Sortable/index.d.ts +1 -0
  78. package/dist/components/Sortable/index.js +5 -0
  79. package/dist/components/Sortable/index.js.map +1 -0
  80. package/dist/components/Sortable/sortableReducer.d.ts +24 -0
  81. package/dist/components/Sortable/sortableReducer.js +92 -0
  82. package/dist/components/Sortable/sortableReducer.js.map +1 -0
  83. package/dist/components/index.d.ts +1 -0
  84. package/dist/components/index.js +14 -12
  85. package/dist/components/index.js.map +1 -1
  86. package/dist/{helpers-DpGAANJ8.js → helpers-TSjo3aAv.js} +3 -3
  87. package/dist/{helpers-DpGAANJ8.js.map → helpers-TSjo3aAv.js.map} +1 -1
  88. package/dist/index.js +14 -12
  89. package/dist/index.js.map +1 -1
  90. package/package.json +2 -2
  91. package/dist/Lexical.prod-zUeT_jIr.js.map +0 -1
  92. package/dist/RteEditor.module--4R0Ql6Y.js +0 -26
  93. package/dist/RteEditor.module--4R0Ql6Y.js.map +0 -1
@@ -1,163 +1,180 @@
1
- import { jsx as y, jsxs as J, Fragment as Le } from "react/jsx-runtime";
2
- import { W as Ge, w as P, P as ne, I as g, e as Qe, g as et, u as R, h as F, y as b, F as tt, l as _, T as nt, X as G, i as Te, m as h, j as Pe, $ as _e, k as Re, v as rt, S as ae, b as ot, E as Q, C as le, n as ce, q as Oe, r as it, s as st, M as ke, A as at, z as lt, B as ct, D as Fe, G as ut, H as v, K as dt, c as O, N as ft, V as mt, O as pt, Q as V, R as gt, U as ht, Z as vt, a0 as wt, a1 as yt, a2 as Et, a3 as Ct, a4 as ue, a as de, a5 as bt, a6 as X, a7 as xt, a8 as fe, a9 as $t, aa as Nt, ab as Dt, ac as St, ad as Lt, ae as Tt, af as Pt, ag as _t, d as Rt, ah as Ot, ai as kt, aj as Ft, ak as At, al as It, t as Mt, L as me, am as Kt, x as Ut } from "../../Lexical.prod-zUeT_jIr.js";
3
- import * as Y from "react";
4
- import { useMemo as H, useLayoutEffect as I, useEffect as D, useRef as Bt, useState as A, Suspense as jt, forwardRef as Ae, useCallback as zt } from "react";
5
- import { i as T, L as U, e as Wt, t as re } from "../../LexicalUtils.prod-DtRifALg.js";
6
- import { r as pe } from "../../index-DsprzSCj.js";
7
- import { J as Ie, D as Me, Z as Jt } from "../../ListPlugin-CxyYg2bv.js";
8
- import { a as Ke, U as ge, m as Z, g as Vt, b as qt, F as Ht, M as Xt, f as Yt } from "../../helpers-DpGAANJ8.js";
9
- import { s as K } from "../../RteEditor.module--4R0Ql6Y.js";
10
- import { ToolBarPlugin as Zt } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
11
- import { UvaTheme as Gt } from "./UvaTheme/UvaTheme.js";
12
- const Ue = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Qt = Ue ? I : D, j = { tag: "history-merge" };
13
- function en({ initialConfig: t, children: e }) {
14
- const n = H(() => {
15
- const { theme: r, namespace: i, nodes: s, onError: o, editorState: a, html: l } = t, c = et(null, r), u = Ge({ editable: t.editable, html: l, namespace: i, nodes: s, onError: (d) => o(d, u), theme: r });
1
+ import { jsx as E, jsxs as Q, Fragment as Ie } from "react/jsx-runtime";
2
+ import { W as st, w as O, P as de, I as g, e as at, i as lt, u as T, j as I, y as _, F as ct, l as N, T as ut, X as ie, k as fe, m as h, n as Ke, q as ze, r as Ue, v as dt, S as ge, b as ft, E as se, C as he, s as ve, z as Be, A as mt, B as pt, M as je, D as gt, G as ht, H as vt, N as Je, O as yt, Q as y, R as wt, c as F, U as Ct, V as Et, Z as bt, a0 as ee, a1 as xt, a2 as $t, a3 as St, a4 as _t, a5 as Nt, a6 as Dt, a7 as kt, a8 as ye, a as we, a9 as Lt, aa as ne, ab as Tt, ac as Ce, ad as Pt, ae as Rt, af as Ot, ag as Mt, ah as Ft, ai as At, aj as It, ak as Kt, d as zt, al as Ut, am as Bt, an as jt, ao as Jt, ap as Wt, t as Vt, L as Ee, aq as qt, x as Ht, K as q, $ as H, ar as Xt, as as Yt, g as Zt, h as Gt } from "../../Lexical.prod-DNRTKPfN.js";
3
+ import * as re from "react";
4
+ import { useMemo as W, useLayoutEffect as z, useEffect as k, useRef as Qt, useState as K, Suspense as en, forwardRef as We, useCallback as tn } from "react";
5
+ import { i as R, L as U, e as nn, t as me } from "../../LexicalUtils.prod-D_BPEjfg.js";
6
+ import { r as be } from "../../index-DsprzSCj.js";
7
+ import { J as Ve, D as qe, Z as rn } from "../../ListPlugin-CgNBzfIl.js";
8
+ import { a as He, U as xe, m as oe, g as on, b as sn, F as an, M as ln, f as cn } from "../../helpers-TSjo3aAv.js";
9
+ import { s as J } from "../../RteEditor.module-BjGyWKhW.js";
10
+ import { ToolBarPlugin as un } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
11
+ import "../Buttons/Button.js";
12
+ import "../Buttons/LinkButton.js";
13
+ import "@react-aria/button";
14
+ import "@react-aria/dialog";
15
+ import "@react-aria/focus";
16
+ import "@react-aria/overlays";
17
+ import "../OverlayCloseButton/OverlayCloseButton.js";
18
+ import "../GridRow/GridRow.js";
19
+ import "../IconButton/IconButton.js";
20
+ import "../Input/Input.js";
21
+ import "../InputField/InputField.js";
22
+ import "react-router-dom";
23
+ import "../../MultiSelect-DQaqItEH.js";
24
+ import "../SelectListbox/SelectListbox.js";
25
+ import "../SelectListbox/SelectProvider.js";
26
+ import "../Sortable/components/SortableItem.js";
27
+ import "../../SortableProvider-Z0e0qeQT.js";
28
+ import { UvaTheme as dn } from "./UvaTheme/UvaTheme.js";
29
+ const Xe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, fn = Xe ? z : k, X = { tag: "history-merge" };
30
+ function mn({ initialConfig: t, children: e }) {
31
+ const n = W(() => {
32
+ const { theme: r, namespace: s, nodes: i, onError: o, editorState: a, html: l } = t, c = lt(null, r), u = st({ editable: t.editable, html: l, namespace: s, nodes: i, onError: (d) => o(d, u), theme: r });
16
33
  return function(d, f) {
17
34
  if (f !== null) {
18
35
  if (f === void 0) d.update(() => {
19
- const p = P();
36
+ const p = O();
20
37
  if (p.isEmpty()) {
21
- const m = ne();
38
+ const m = de();
22
39
  p.append(m);
23
- const w = Ue ? document.activeElement : null;
24
- (g() !== null || w !== null && w === d.getRootElement()) && m.select();
40
+ const v = Xe ? document.activeElement : null;
41
+ (g() !== null || v !== null && v === d.getRootElement()) && m.select();
25
42
  }
26
- }, j);
43
+ }, X);
27
44
  else if (f !== null) switch (typeof f) {
28
45
  case "string": {
29
46
  const p = d.parseEditorState(f);
30
- d.setEditorState(p, j);
47
+ d.setEditorState(p, X);
31
48
  break;
32
49
  }
33
50
  case "object":
34
- d.setEditorState(f, j);
51
+ d.setEditorState(f, X);
35
52
  break;
36
53
  case "function":
37
54
  d.update(() => {
38
- P().isEmpty() && f(d);
39
- }, j);
55
+ O().isEmpty() && f(d);
56
+ }, X);
40
57
  }
41
58
  }
42
59
  }(u, a), [u, c];
43
60
  }, []);
44
- return Qt(() => {
45
- const r = t.editable, [i] = n;
46
- i.setEditable(r === void 0 || r);
47
- }, []), y(Qe.Provider, { value: n, children: e });
61
+ return fn(() => {
62
+ const r = t.editable, [s] = n;
63
+ s.setEditable(r === void 0 || r);
64
+ }, []), E(at.Provider, { value: n, children: e });
48
65
  }
49
- const tn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? I : D;
50
- function nn(t) {
66
+ const pn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? z : k;
67
+ function gn(t) {
51
68
  return { initialValueFn: () => t.isEditable(), subscribe: (e) => t.registerEditableListener(e) };
52
69
  }
53
- function rn() {
70
+ function hn() {
54
71
  return function(t) {
55
- const [e] = R(), n = H(() => t(e), [e, t]), r = Bt(n.initialValueFn()), [i, s] = A(r.current);
56
- return tn(() => {
72
+ const [e] = T(), n = W(() => t(e), [e, t]), r = Qt(n.initialValueFn()), [s, i] = K(r.current);
73
+ return pn(() => {
57
74
  const { initialValueFn: o, subscribe: a } = n, l = o();
58
- return r.current !== l && (r.current = l, s(l)), a((c) => {
59
- r.current = c, s(c);
75
+ return r.current !== l && (r.current = l, i(l)), a((c) => {
76
+ r.current = c, i(c);
60
77
  });
61
- }, [n, t]), i;
62
- }(nn);
78
+ }, [n, t]), s;
79
+ }(gn);
63
80
  }
64
- function on() {
65
- return P().getTextContent();
81
+ function vn() {
82
+ return O().getTextContent();
66
83
  }
67
- function sn(t, e = !0) {
84
+ function yn(t, e = !0) {
68
85
  if (t) return !1;
69
- let n = on();
86
+ let n = vn();
70
87
  return e && (n = n.trim()), n === "";
71
88
  }
72
- function an(t) {
73
- if (!sn(t, !1)) return !1;
74
- const e = P().getChildren(), n = e.length;
89
+ function wn(t) {
90
+ if (!yn(t, !1)) return !1;
91
+ const e = O().getChildren(), n = e.length;
75
92
  if (n > 1) return !1;
76
93
  for (let r = 0; r < n; r++) {
77
- const i = e[r];
78
- if (F(i)) return !1;
79
- if (b(i)) {
80
- if (!tt(i) || i.__indent !== 0) return !1;
81
- const s = i.getChildren(), o = s.length;
94
+ const s = e[r];
95
+ if (I(s)) return !1;
96
+ if (_(s)) {
97
+ if (!ct(s) || s.__indent !== 0) return !1;
98
+ const i = s.getChildren(), o = i.length;
82
99
  for (let a = 0; a < o; a++) {
83
- const l = s[r];
84
- if (!_(l)) return !1;
100
+ const l = i[r];
101
+ if (!N(l)) return !1;
85
102
  }
86
103
  }
87
104
  }
88
105
  return !0;
89
106
  }
90
- function Be(t) {
91
- return () => an(t);
107
+ function Ye(t) {
108
+ return () => wn(t);
92
109
  }
93
- function ln(t) {
110
+ function Cn(t) {
94
111
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
95
112
  }
96
- ln(function(t) {
113
+ Cn(function(t) {
97
114
  const e = new URLSearchParams();
98
115
  e.append("code", t);
99
116
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
100
117
  throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
101
118
  });
102
- function cn(t) {
119
+ function En(t) {
103
120
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
104
121
  }
105
- cn(function(t) {
122
+ En(function(t) {
106
123
  const e = new URLSearchParams();
107
124
  e.append("code", t);
108
125
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
109
126
  throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
110
127
  });
111
- const un = /* @__PURE__ */ new Map();
112
- function dn(t) {
128
+ const bn = /* @__PURE__ */ new Map();
129
+ function xn(t) {
113
130
  const e = {}, n = t.split(";");
114
131
  for (const r of n) if (r !== "") {
115
- const [i, s] = r.split(/:([^]+)/);
116
- i && s && (e[i.trim()] = s.trim());
132
+ const [s, i] = r.split(/:([^]+)/);
133
+ s && i && (e[s.trim()] = i.trim());
117
134
  }
118
135
  return e;
119
136
  }
120
- function je(t, e) {
137
+ function Ze(t, e) {
121
138
  const n = t.getStartEndPoints();
122
139
  if (e.isSelected(t) && !e.isSegmented() && !e.isToken() && n !== null) {
123
- const [r, i] = n, s = t.isBackward(), o = r.getNode(), a = i.getNode(), l = e.is(o), c = e.is(a);
140
+ const [r, s] = n, i = t.isBackward(), o = r.getNode(), a = s.getNode(), l = e.is(o), c = e.is(a);
124
141
  if (l || c) {
125
- const [u, d] = nt(t), f = o.is(a), p = e.is(s ? a : o), m = e.is(s ? o : a);
126
- let w, x = 0;
127
- return f ? (x = u > d ? d : u, w = u > d ? u : d) : p ? (x = s ? d : u, w = void 0) : m && (x = 0, w = s ? u : d), e.__text = e.__text.slice(x, w), e;
142
+ const [u, d] = ut(t), f = o.is(a), p = e.is(i ? a : o), m = e.is(i ? o : a);
143
+ let v, b = 0;
144
+ return f ? (b = u > d ? d : u, v = u > d ? u : d) : p ? (b = i ? d : u, v = void 0) : m && (b = 0, v = i ? u : d), e.__text = e.__text.slice(b, v), e;
128
145
  }
129
146
  }
130
147
  return e;
131
148
  }
132
- function fn(t) {
133
- const e = t.getStyle(), n = dn(e);
134
- un.set(e, n);
149
+ function $n(t) {
150
+ const e = t.getStyle(), n = xn(e);
151
+ bn.set(e, n);
135
152
  }
136
- function he(t, e) {
137
- const n = G(t.focus, e);
138
- return F(n) && !n.isIsolated() || b(n) && !n.isInline() && !n.canBeEmpty();
153
+ function $e(t, e) {
154
+ const n = ie(t.focus, e);
155
+ return I(n) && !n.isIsolated() || _(n) && !n.isInline() && !n.canBeEmpty();
139
156
  }
140
- function mn(t, e, n, r) {
157
+ function Sn(t, e, n, r) {
141
158
  t.modify(e ? "extend" : "move", n, r);
142
159
  }
143
- function pn(t) {
160
+ function _n(t) {
144
161
  const e = t.anchor.getNode();
145
- return (Te(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
162
+ return (fe(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
146
163
  }
147
- function ve(t, e, n) {
148
- const r = pn(t);
149
- mn(t, e, n ? !r : r, "character");
164
+ function Se(t, e, n) {
165
+ const r = _n(t);
166
+ Sn(t, e, n ? !r : r, "character");
150
167
  }
151
- function gn(t) {
168
+ function Nn(t) {
152
169
  const e = window.location.origin, n = (r) => {
153
170
  if (r.origin !== e) return;
154
- const i = t.getRootElement();
155
- if (document.activeElement !== i) return;
156
- const s = r.data;
157
- if (typeof s == "string") {
171
+ const s = t.getRootElement();
172
+ if (document.activeElement !== s) return;
173
+ const i = r.data;
174
+ if (typeof i == "string") {
158
175
  let o;
159
176
  try {
160
- o = JSON.parse(s);
177
+ o = JSON.parse(i);
161
178
  } catch {
162
179
  return;
163
180
  }
@@ -168,14 +185,14 @@ function gn(t) {
168
185
  if (l) {
169
186
  const [c, u, d, f, p, m] = l;
170
187
  t.update(() => {
171
- const w = g();
172
- if (h(w)) {
173
- const x = w.anchor;
174
- let E = x.getNode(), C = 0, $ = 0;
175
- if (_(E) && c >= 0 && u >= 0 && (C = c, $ = c + u, w.setTextNodeRange(E, C, E, $)), C === $ && d === "" || (w.insertRawText(d), E = x.getNode()), _(E)) {
176
- C = f, $ = f + p;
177
- const N = E.getTextContentSize();
178
- C = C > N ? N : C, $ = $ > N ? N : $, w.setTextNodeRange(E, C, E, $);
188
+ const v = g();
189
+ if (h(v)) {
190
+ const b = v.anchor;
191
+ let w = b.getNode(), C = 0, x = 0;
192
+ if (N(w) && c >= 0 && u >= 0 && (C = c, x = c + u, v.setTextNodeRange(w, C, w, x)), C === x && d === "" || (v.insertRawText(d), w = b.getNode()), N(w)) {
193
+ C = f, x = f + p;
194
+ const $ = w.getTextContentSize();
195
+ C = C > $ ? $ : C, x = x > $ ? $ : x, v.setTextNodeRange(w, C, w, x);
179
196
  }
180
197
  r.stopImmediatePropagation();
181
198
  }
@@ -189,70 +206,70 @@ function gn(t) {
189
206
  window.removeEventListener("message", n, !0);
190
207
  };
191
208
  }
192
- function ze(t, e) {
209
+ function Ge(t, e) {
193
210
  const n = e.body ? e.body.childNodes : [];
194
211
  let r = [];
195
- const i = [];
196
- for (let s = 0; s < n.length; s++) {
197
- const o = n[s];
198
- if (!Ve.has(o.nodeName)) {
199
- const a = qe(o, t, i, !1);
212
+ const s = [];
213
+ for (let i = 0; i < n.length; i++) {
214
+ const o = n[i];
215
+ if (!tt.has(o.nodeName)) {
216
+ const a = nt(o, t, s, !1);
200
217
  a !== null && (r = r.concat(a));
201
218
  }
202
219
  }
203
- return function(s) {
204
- for (const o of s) o.getNextSibling() instanceof Pe && o.insertAfter(_e());
205
- for (const o of s) {
220
+ return function(i) {
221
+ for (const o of i) o.getNextSibling() instanceof Ke && o.insertAfter(ze());
222
+ for (const o of i) {
206
223
  const a = o.getChildren();
207
224
  for (const l of a) o.insertBefore(l);
208
225
  o.remove();
209
226
  }
210
- }(i), r;
227
+ }(s), r;
211
228
  }
212
- function We(t, e) {
229
+ function Qe(t, e) {
213
230
  if (typeof document > "u" || typeof window > "u" && global.window === void 0) throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");
214
- const n = document.createElement("div"), r = P().getChildren();
215
- for (let i = 0; i < r.length; i++)
216
- Je(t, r[i], n, e);
231
+ const n = document.createElement("div"), r = O().getChildren();
232
+ for (let s = 0; s < r.length; s++)
233
+ et(t, r[s], n, e);
217
234
  return n.innerHTML;
218
235
  }
219
- function Je(t, e, n, r = null) {
220
- let i = r === null || e.isSelected(r);
221
- const s = b(e) && e.excludeFromCopy("html");
236
+ function et(t, e, n, r = null) {
237
+ let s = r === null || e.isSelected(r);
238
+ const i = _(e) && e.excludeFromCopy("html");
222
239
  let o = e;
223
240
  if (r !== null) {
224
- let p = Re(e);
225
- p = _(p) && r !== null ? je(r, p) : p, o = p;
241
+ let p = Ue(e);
242
+ p = N(p) && r !== null ? Ze(r, p) : p, o = p;
226
243
  }
227
- const a = b(o) ? o.getChildren() : [], l = t._nodes.get(o.getType());
244
+ const a = _(o) ? o.getChildren() : [], l = t._nodes.get(o.getType());
228
245
  let c;
229
246
  c = l && l.exportDOM !== void 0 ? l.exportDOM(t, o) : o.exportDOM(t);
230
247
  const { element: u, after: d } = c;
231
248
  if (!u) return !1;
232
249
  const f = document.createDocumentFragment();
233
250
  for (let p = 0; p < a.length; p++) {
234
- const m = a[p], w = Je(t, m, f, r);
235
- !i && b(e) && w && e.extractWithChild(m, r, "html") && (i = !0);
251
+ const m = a[p], v = et(t, m, f, r);
252
+ !s && _(e) && v && e.extractWithChild(m, r, "html") && (s = !0);
236
253
  }
237
- if (i && !s) {
238
- if ((rt(u) || ae(u)) && u.append(f), n.append(u), d) {
254
+ if (s && !i) {
255
+ if ((dt(u) || ge(u)) && u.append(f), n.append(u), d) {
239
256
  const p = d.call(o, u);
240
- p && (ae(u) ? u.replaceChildren(p) : u.replaceWith(p));
257
+ p && (ge(u) ? u.replaceChildren(p) : u.replaceWith(p));
241
258
  }
242
259
  } else n.append(f);
243
- return i;
260
+ return s;
244
261
  }
245
- const Ve = /* @__PURE__ */ new Set(["STYLE", "SCRIPT"]);
246
- function qe(t, e, n, r, i = /* @__PURE__ */ new Map(), s) {
262
+ const tt = /* @__PURE__ */ new Set(["STYLE", "SCRIPT"]);
263
+ function nt(t, e, n, r, s = /* @__PURE__ */ new Map(), i) {
247
264
  let o = [];
248
- if (Ve.has(t.nodeName)) return o;
265
+ if (tt.has(t.nodeName)) return o;
249
266
  let a = null;
250
- const l = function(m, w) {
251
- const { nodeName: x } = m, E = w._htmlConversions.get(x.toLowerCase());
267
+ const l = function(m, v) {
268
+ const { nodeName: b } = m, w = v._htmlConversions.get(b.toLowerCase());
252
269
  let C = null;
253
- if (E !== void 0) for (const $ of E) {
254
- const N = $(m);
255
- N !== null && (C === null || (C.priority || 0) < (N.priority || 0)) && (C = N);
270
+ if (w !== void 0) for (const x of w) {
271
+ const $ = x(m);
272
+ $ !== null && (C === null || (C.priority || 0) < ($.priority || 0)) && (C = $);
256
273
  }
257
274
  return C !== null ? C.conversion : null;
258
275
  }(t, e), c = l ? l(t) : null;
@@ -261,68 +278,68 @@ function qe(t, e, n, r, i = /* @__PURE__ */ new Map(), s) {
261
278
  u = c.after;
262
279
  const m = c.node;
263
280
  if (a = Array.isArray(m) ? m[m.length - 1] : m, a !== null) {
264
- for (const [, w] of i) if (a = w(a, s), !a) break;
281
+ for (const [, v] of s) if (a = v(a, i), !a) break;
265
282
  a && o.push(...Array.isArray(m) ? m : [a]);
266
283
  }
267
- c.forChild != null && i.set(t.nodeName, c.forChild);
284
+ c.forChild != null && s.set(t.nodeName, c.forChild);
268
285
  }
269
286
  const d = t.childNodes;
270
287
  let f = [];
271
- const p = (a == null || !ot(a)) && (a != null && Q(a) || r);
272
- for (let m = 0; m < d.length; m++) f.push(...qe(d[m], e, n, p, new Map(i), a));
273
- return u != null && (f = u(f)), le(t) && (f = hn(t, f, p ? () => {
274
- const m = new Pe();
288
+ const p = (a == null || !ft(a)) && (a != null && se(a) || r);
289
+ for (let m = 0; m < d.length; m++) f.push(...nt(d[m], e, n, p, new Map(s), a));
290
+ return u != null && (f = u(f)), he(t) && (f = Dn(t, f, p ? () => {
291
+ const m = new Ke();
275
292
  return n.push(m), m;
276
- } : ne)), a == null ? f.length > 0 ? o = o.concat(f) : le(t) && function(m) {
277
- return m.nextSibling == null || m.previousSibling == null ? !1 : ce(m.nextSibling) && ce(m.previousSibling);
278
- }(t) && (o = o.concat(_e())) : b(a) && a.append(...f), o;
293
+ } : de)), a == null ? f.length > 0 ? o = o.concat(f) : he(t) && function(m) {
294
+ return m.nextSibling == null || m.previousSibling == null ? !1 : ve(m.nextSibling) && ve(m.previousSibling);
295
+ }(t) && (o = o.concat(ze())) : _(a) && a.append(...f), o;
279
296
  }
280
- function hn(t, e, n) {
281
- const r = t.style.textAlign, i = [];
282
- let s = [];
297
+ function Dn(t, e, n) {
298
+ const r = t.style.textAlign, s = [];
299
+ let i = [];
283
300
  for (let o = 0; o < e.length; o++) {
284
301
  const a = e[o];
285
- if (Q(a)) r && !a.getFormat() && a.setFormat(r), i.push(a);
286
- else if (s.push(a), o === e.length - 1 || o < e.length - 1 && Q(e[o + 1])) {
302
+ if (se(a)) r && !a.getFormat() && a.setFormat(r), s.push(a);
303
+ else if (i.push(a), o === e.length - 1 || o < e.length - 1 && se(e[o + 1])) {
287
304
  const l = n();
288
- l.setFormat(r), l.append(...s), i.push(l), s = [];
305
+ l.setFormat(r), l.append(...i), s.push(l), i = [];
289
306
  }
290
307
  }
291
- return i;
308
+ return s;
292
309
  }
293
- function vn(t) {
310
+ function kn(t) {
294
311
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
295
312
  }
296
- var q = vn(function(t) {
313
+ var te = kn(function(t) {
297
314
  const e = new URLSearchParams();
298
315
  e.append("code", t);
299
316
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
300
317
  throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
301
318
  });
302
- const wn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, He = (t) => wn ? (t || window).getSelection() : null;
303
- function yn(t, e = g()) {
304
- return e == null && q(166), h(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : We(t, e);
319
+ const Ln = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, rt = (t) => Ln ? (t || window).getSelection() : null;
320
+ function Tn(t, e = g()) {
321
+ return e == null && te(166), h(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : Qe(t, e);
305
322
  }
306
- function En(t, e = g()) {
307
- return e == null && q(166), h(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(Cn(t, e));
323
+ function Pn(t, e = g()) {
324
+ return e == null && te(166), h(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(Rn(t, e));
308
325
  }
309
- function we(t, e, n) {
326
+ function _e(t, e, n) {
310
327
  const r = t.getData("application/x-lexical-editor");
311
328
  if (r) try {
312
329
  const o = JSON.parse(r);
313
330
  if (o.namespace === n._config.namespace && Array.isArray(o.nodes))
314
- return ye(n, bn(o.nodes), e);
331
+ return Ne(n, On(o.nodes), e);
315
332
  } catch {
316
333
  }
317
- const i = t.getData("text/html");
318
- if (i) try {
319
- const o = new DOMParser().parseFromString(i, "text/html");
320
- return ye(n, ze(n, o), e);
334
+ const s = t.getData("text/html");
335
+ if (s) try {
336
+ const o = new DOMParser().parseFromString(s, "text/html");
337
+ return Ne(n, Ge(n, o), e);
321
338
  } catch {
322
339
  }
323
- const s = t.getData("text/plain") || t.getData("text/uri-list");
324
- if (s != null) if (h(e)) {
325
- const o = s.split(/(\r?\n|\t)/);
340
+ const i = t.getData("text/plain") || t.getData("text/uri-list");
341
+ if (i != null) if (h(e)) {
342
+ const o = i.split(/(\r?\n|\t)/);
326
343
  o[o.length - 1] === "" && o.pop();
327
344
  for (let a = 0; a < o.length; a++) {
328
345
  const l = g();
@@ -330,112 +347,112 @@ function we(t, e, n) {
330
347
  const c = o[a];
331
348
  c === `
332
349
  ` || c === `\r
333
- ` ? l.insertParagraph() : c === " " ? l.insertNodes([Oe()]) : l.insertText(c);
350
+ ` ? l.insertParagraph() : c === " " ? l.insertNodes([Be()]) : l.insertText(c);
334
351
  }
335
352
  }
336
- } else e.insertRawText(s);
353
+ } else e.insertRawText(i);
337
354
  }
338
- function ye(t, e, n) {
339
- t.dispatchCommand(it, { nodes: e, selection: n }) || n.insertNodes(e);
355
+ function Ne(t, e, n) {
356
+ t.dispatchCommand(mt, { nodes: e, selection: n }) || n.insertNodes(e);
340
357
  }
341
- function Xe(t, e, n, r = []) {
342
- let i = e === null || n.isSelected(e);
343
- const s = b(n) && n.excludeFromCopy("html");
358
+ function ot(t, e, n, r = []) {
359
+ let s = e === null || n.isSelected(e);
360
+ const i = _(n) && n.excludeFromCopy("html");
344
361
  let o = n;
345
362
  if (e !== null) {
346
- let c = Re(n);
347
- c = _(c) && e !== null ? je(e, c) : c, o = c;
363
+ let c = Ue(n);
364
+ c = N(c) && e !== null ? Ze(e, c) : c, o = c;
348
365
  }
349
- const a = b(o) ? o.getChildren() : [], l = function(c) {
366
+ const a = _(o) ? o.getChildren() : [], l = function(c) {
350
367
  const u = c.exportJSON(), d = c.constructor;
351
- if (u.type !== d.getType() && q(58, d.name), b(c)) {
368
+ if (u.type !== d.getType() && te(58, d.name), _(c)) {
352
369
  const f = u.children;
353
- Array.isArray(f) || q(59, d.name);
370
+ Array.isArray(f) || te(59, d.name);
354
371
  }
355
372
  return u;
356
373
  }(o);
357
- if (_(o)) {
374
+ if (N(o)) {
358
375
  const c = o.__text;
359
- c.length > 0 ? l.text = c : i = !1;
376
+ c.length > 0 ? l.text = c : s = !1;
360
377
  }
361
378
  for (let c = 0; c < a.length; c++) {
362
- const u = a[c], d = Xe(t, e, u, l.children);
363
- !i && b(n) && d && n.extractWithChild(u, e, "clone") && (i = !0);
379
+ const u = a[c], d = ot(t, e, u, l.children);
380
+ !s && _(n) && d && n.extractWithChild(u, e, "clone") && (s = !0);
364
381
  }
365
- if (i && !s) r.push(l);
382
+ if (s && !i) r.push(l);
366
383
  else if (Array.isArray(l.children)) for (let c = 0; c < l.children.length; c++) {
367
384
  const u = l.children[c];
368
385
  r.push(u);
369
386
  }
370
- return i;
387
+ return s;
371
388
  }
372
- function Cn(t, e) {
373
- const n = [], r = P().getChildren();
374
- for (let i = 0; i < r.length; i++)
375
- Xe(t, e, r[i], n);
389
+ function Rn(t, e) {
390
+ const n = [], r = O().getChildren();
391
+ for (let s = 0; s < r.length; s++)
392
+ ot(t, e, r[s], n);
376
393
  return { namespace: t._config.namespace, nodes: n };
377
394
  }
378
- function bn(t) {
395
+ function On(t) {
379
396
  const e = [];
380
397
  for (let n = 0; n < t.length; n++) {
381
- const r = t[n], i = st(r);
382
- _(i) && fn(i), e.push(i);
398
+ const r = t[n], s = pt(r);
399
+ N(s) && $n(s), e.push(s);
383
400
  }
384
401
  return e;
385
402
  }
386
- let k = null;
387
- async function Ee(t, e, n) {
388
- if (k !== null) return !1;
403
+ let A = null;
404
+ async function De(t, e, n) {
405
+ if (A !== null) return !1;
389
406
  if (e !== null) return new Promise((l, c) => {
390
407
  t.update(() => {
391
- l(Ce(t, e, n));
408
+ l(ke(t, e, n));
392
409
  });
393
410
  });
394
- const r = t.getRootElement(), i = t._window == null ? window.document : t._window.document, s = He(t._window);
395
- if (r === null || s === null) return !1;
396
- const o = i.createElement("span");
397
- o.style.cssText = "position: fixed; top: -1000px;", o.append(i.createTextNode("#")), r.append(o);
411
+ const r = t.getRootElement(), s = t._window == null ? window.document : t._window.document, i = rt(t._window);
412
+ if (r === null || i === null) return !1;
413
+ const o = s.createElement("span");
414
+ o.style.cssText = "position: fixed; top: -1000px;", o.append(s.createTextNode("#")), r.append(o);
398
415
  const a = new Range();
399
- return a.setStart(o, 0), a.setEnd(o, 1), s.removeAllRanges(), s.addRange(a), new Promise((l, c) => {
400
- const u = t.registerCommand(ke, (d) => (T(d, ClipboardEvent) && (u(), k !== null && (window.clearTimeout(k), k = null), l(Ce(t, d, n))), !0), at);
401
- k = window.setTimeout(() => {
402
- u(), k = null, l(!1);
403
- }, 50), i.execCommand("copy"), o.remove();
416
+ return a.setStart(o, 0), a.setEnd(o, 1), i.removeAllRanges(), i.addRange(a), new Promise((l, c) => {
417
+ const u = t.registerCommand(je, (d) => (R(d, ClipboardEvent) && (u(), A !== null && (window.clearTimeout(A), A = null), l(ke(t, d, n))), !0), gt);
418
+ A = window.setTimeout(() => {
419
+ u(), A = null, l(!1);
420
+ }, 50), s.execCommand("copy"), o.remove();
404
421
  });
405
422
  }
406
- function Ce(t, e, n) {
423
+ function ke(t, e, n) {
407
424
  if (n === void 0) {
408
- const i = He(t._window);
409
- if (!i) return !1;
410
- const s = i.anchorNode, o = i.focusNode;
411
- if (s !== null && o !== null && !lt(t, s, o)) return !1;
425
+ const s = rt(t._window);
426
+ if (!s) return !1;
427
+ const i = s.anchorNode, o = s.focusNode;
428
+ if (i !== null && o !== null && !ht(t, i, o)) return !1;
412
429
  const a = g();
413
430
  if (a === null) return !1;
414
- n = $n(a);
431
+ n = Fn(a);
415
432
  }
416
433
  e.preventDefault();
417
434
  const r = e.clipboardData;
418
- return r !== null && (Nn(r, n), !0);
435
+ return r !== null && (An(r, n), !0);
419
436
  }
420
- const xn = [["text/html", yn], ["application/x-lexical-editor", En]];
421
- function $n(t = g()) {
437
+ const Mn = [["text/html", Tn], ["application/x-lexical-editor", Pn]];
438
+ function Fn(t = g()) {
422
439
  const e = { "text/plain": t ? t.getTextContent() : "" };
423
440
  if (t) {
424
- const n = ct();
425
- for (const [r, i] of xn) {
426
- const s = i(n, t);
427
- s !== null && (e[r] = s);
441
+ const n = vt();
442
+ for (const [r, s] of Mn) {
443
+ const i = s(n, t);
444
+ i !== null && (e[r] = i);
428
445
  }
429
446
  }
430
447
  return e;
431
448
  }
432
- function Nn(t, e) {
449
+ function An(t, e) {
433
450
  for (const n in e) {
434
451
  const r = e[n];
435
452
  r !== void 0 && t.setData(n, r);
436
453
  }
437
454
  }
438
- function be(t, e) {
455
+ function Le(t, e) {
439
456
  if (document.caretRangeFromPoint !== void 0) {
440
457
  const n = document.caretRangeFromPoint(t, e);
441
458
  return n === null ? null : { node: n.startContainer, offset: n.startOffset };
@@ -446,273 +463,273 @@ function be(t, e) {
446
463
  }
447
464
  return null;
448
465
  }
449
- const M = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Dn = M && "documentMode" in document ? document.documentMode : null, Sn = !(!M || !("InputEvent" in window) || Dn) && "getTargetRanges" in new window.InputEvent("input"), Ln = M && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Tn = M && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Pn = M && /^(?=.*Chrome).*/i.test(navigator.userAgent), _n = M && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Pn, xe = Mt();
450
- function z(t) {
466
+ const B = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, In = B && "documentMode" in document ? document.documentMode : null, Kn = !(!B || !("InputEvent" in window) || In) && "getTargetRanges" in new window.InputEvent("input"), zn = B && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Un = B && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Bn = B && /^(?=.*Chrome).*/i.test(navigator.userAgent), jn = B && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Bn, Te = Vt();
467
+ function Y(t) {
451
468
  let e = null;
452
- if (T(t, DragEvent) ? e = t.dataTransfer : T(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
453
- const n = e.types, r = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
454
- return [r, Array.from(e.files), i];
469
+ if (R(t, DragEvent) ? e = t.dataTransfer : R(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
470
+ const n = e.types, r = n.includes("Files"), s = n.includes("text/html") || n.includes("text/plain");
471
+ return [r, Array.from(e.files), s];
455
472
  }
456
- function $e(t) {
473
+ function Pe(t) {
457
474
  const e = g();
458
475
  if (!h(e)) return !1;
459
476
  const n = /* @__PURE__ */ new Set(), r = e.getNodes();
460
- for (let i = 0; i < r.length; i++) {
461
- const s = r[i], o = s.getKey();
477
+ for (let s = 0; s < r.length; s++) {
478
+ const i = r[s], o = i.getKey();
462
479
  if (n.has(o)) continue;
463
- const a = re(s, (c) => b(c) && !c.isInline());
480
+ const a = me(i, (c) => _(c) && !c.isInline());
464
481
  if (a === null) continue;
465
482
  const l = a.getKey();
466
483
  a.canIndent() && !n.has(l) && (n.add(l), t(a));
467
484
  }
468
485
  return n.size > 0;
469
486
  }
470
- function W(t) {
471
- const e = V(t);
472
- return F(e);
487
+ function Z(t) {
488
+ const e = ee(t);
489
+ return I(e);
473
490
  }
474
- function Rn(t) {
475
- return U(t.registerCommand(It, (e) => {
491
+ function Jn(t) {
492
+ return U(t.registerCommand(Wt, (e) => {
476
493
  const n = g();
477
- return !!O(n) && (n.clear(), !0);
478
- }, 0), t.registerCommand(X, (e) => {
494
+ return !!F(n) && (n.clear(), !0);
495
+ }, 0), t.registerCommand(ne, (e) => {
479
496
  const n = g();
480
497
  return !!h(n) && (n.deleteCharacter(e), !0);
481
- }, v), t.registerCommand(At, (e) => {
498
+ }, y), t.registerCommand(Jt, (e) => {
482
499
  const n = g();
483
500
  return !!h(n) && (n.deleteWord(e), !0);
484
- }, v), t.registerCommand(Ft, (e) => {
501
+ }, y), t.registerCommand(jt, (e) => {
485
502
  const n = g();
486
503
  return !!h(n) && (n.deleteLine(e), !0);
487
- }, v), t.registerCommand(kt, (e) => {
504
+ }, y), t.registerCommand(Bt, (e) => {
488
505
  const n = g();
489
506
  if (typeof e == "string") n !== null && n.insertText(e);
490
507
  else {
491
508
  if (n === null) return !1;
492
509
  const r = e.dataTransfer;
493
- if (r != null) we(r, n, t);
510
+ if (r != null) _e(r, n, t);
494
511
  else if (h(n)) {
495
- const i = e.data;
496
- return i && n.insertText(i), !0;
512
+ const s = e.data;
513
+ return s && n.insertText(s), !0;
497
514
  }
498
515
  }
499
516
  return !0;
500
- }, v), t.registerCommand(Ot, () => {
517
+ }, y), t.registerCommand(Ut, () => {
501
518
  const e = g();
502
519
  return !!h(e) && (e.removeText(), !0);
503
- }, v), t.registerCommand(Rt, (e) => {
520
+ }, y), t.registerCommand(zt, (e) => {
504
521
  const n = g();
505
522
  return !!h(n) && (n.formatText(e), !0);
506
- }, v), t.registerCommand(_t, (e) => {
523
+ }, y), t.registerCommand(Kt, (e) => {
507
524
  const n = g();
508
- if (!h(n) && !O(n)) return !1;
525
+ if (!h(n) && !F(n)) return !1;
509
526
  const r = n.getNodes();
510
- for (const i of r) {
511
- const s = re(i, (o) => b(o) && !o.isInline());
512
- s !== null && s.setFormat(e);
527
+ for (const s of r) {
528
+ const i = me(s, (o) => _(o) && !o.isInline());
529
+ i !== null && i.setFormat(e);
513
530
  }
514
531
  return !0;
515
- }, v), t.registerCommand(ue, (e) => {
532
+ }, y), t.registerCommand(ye, (e) => {
516
533
  const n = g();
517
534
  return !!h(n) && (n.insertLineBreak(e), !0);
518
- }, v), t.registerCommand(de, () => {
535
+ }, y), t.registerCommand(we, () => {
519
536
  const e = g();
520
537
  return !!h(e) && (e.insertParagraph(), !0);
521
- }, v), t.registerCommand(Tt, () => (Pt([Oe()]), !0), v), t.registerCommand(Lt, () => $e((e) => {
538
+ }, y), t.registerCommand(At, () => (It([Be()]), !0), y), t.registerCommand(Ft, () => Pe((e) => {
522
539
  const n = e.getIndent();
523
540
  e.setIndent(n + 1);
524
- }), v), t.registerCommand(fe, () => $e((e) => {
541
+ }), y), t.registerCommand(Ce, () => Pe((e) => {
525
542
  const n = e.getIndent();
526
543
  n > 0 && e.setIndent(n - 1);
527
- }), v), t.registerCommand(St, (e) => {
544
+ }), y), t.registerCommand(Mt, (e) => {
528
545
  const n = g();
529
- if (O(n) && !W(e.target)) {
546
+ if (F(n) && !Z(e.target)) {
530
547
  const r = n.getNodes();
531
548
  if (r.length > 0) return r[0].selectPrevious(), !0;
532
549
  } else if (h(n)) {
533
- const r = G(n.focus, !0);
534
- if (!e.shiftKey && F(r) && !r.isIsolated() && !r.isInline()) return r.selectPrevious(), e.preventDefault(), !0;
550
+ const r = ie(n.focus, !0);
551
+ if (!e.shiftKey && I(r) && !r.isIsolated() && !r.isInline()) return r.selectPrevious(), e.preventDefault(), !0;
535
552
  }
536
553
  return !1;
537
- }, v), t.registerCommand(Dt, (e) => {
554
+ }, y), t.registerCommand(Ot, (e) => {
538
555
  const n = g();
539
- if (O(n)) {
556
+ if (F(n)) {
540
557
  const r = n.getNodes();
541
558
  if (r.length > 0) return r[0].selectNext(0, 0), !0;
542
559
  } else if (h(n)) {
543
- if (function(i) {
544
- const s = i.focus;
545
- return s.key === "root" && s.offset === P().getChildrenSize();
560
+ if (function(s) {
561
+ const i = s.focus;
562
+ return i.key === "root" && i.offset === O().getChildrenSize();
546
563
  }(n)) return e.preventDefault(), !0;
547
- const r = G(n.focus, !1);
548
- if (!e.shiftKey && F(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), e.preventDefault(), !0;
564
+ const r = ie(n.focus, !1);
565
+ if (!e.shiftKey && I(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), e.preventDefault(), !0;
549
566
  }
550
567
  return !1;
551
- }, v), t.registerCommand(Nt, (e) => {
568
+ }, y), t.registerCommand(Rt, (e) => {
552
569
  const n = g();
553
- if (O(n)) {
570
+ if (F(n)) {
554
571
  const r = n.getNodes();
555
572
  if (r.length > 0) return e.preventDefault(), r[0].selectPrevious(), !0;
556
573
  }
557
574
  if (!h(n)) return !1;
558
- if (he(n, !0)) {
575
+ if ($e(n, !0)) {
559
576
  const r = e.shiftKey;
560
- return e.preventDefault(), ve(n, r, !0), !0;
577
+ return e.preventDefault(), Se(n, r, !0), !0;
561
578
  }
562
579
  return !1;
563
- }, v), t.registerCommand($t, (e) => {
580
+ }, y), t.registerCommand(Pt, (e) => {
564
581
  const n = g();
565
- if (O(n) && !W(e.target)) {
566
- const i = n.getNodes();
567
- if (i.length > 0) return e.preventDefault(), i[0].selectNext(0, 0), !0;
582
+ if (F(n) && !Z(e.target)) {
583
+ const s = n.getNodes();
584
+ if (s.length > 0) return e.preventDefault(), s[0].selectNext(0, 0), !0;
568
585
  }
569
586
  if (!h(n)) return !1;
570
587
  const r = e.shiftKey;
571
- return !!he(n, !1) && (e.preventDefault(), ve(n, r, !1), !0);
572
- }, v), t.registerCommand(xt, (e) => {
573
- if (W(e.target)) return !1;
588
+ return !!$e(n, !1) && (e.preventDefault(), Se(n, r, !1), !0);
589
+ }, y), t.registerCommand(Tt, (e) => {
590
+ if (Z(e.target)) return !1;
574
591
  const n = g();
575
592
  if (!h(n)) return !1;
576
593
  e.preventDefault();
577
- const { anchor: r } = n, i = r.getNode();
578
- return n.isCollapsed() && r.offset === 0 && !Te(i) && Wt(i).getIndent() > 0 ? t.dispatchCommand(fe, void 0) : t.dispatchCommand(X, !0);
579
- }, v), t.registerCommand(bt, (e) => {
580
- if (W(e.target)) return !1;
594
+ const { anchor: r } = n, s = r.getNode();
595
+ return n.isCollapsed() && r.offset === 0 && !fe(s) && nn(s).getIndent() > 0 ? t.dispatchCommand(Ce, void 0) : t.dispatchCommand(ne, !0);
596
+ }, y), t.registerCommand(Lt, (e) => {
597
+ if (Z(e.target)) return !1;
581
598
  const n = g();
582
- return !!h(n) && (e.preventDefault(), t.dispatchCommand(X, !1));
583
- }, v), t.registerCommand(Ct, (e) => {
599
+ return !!h(n) && (e.preventDefault(), t.dispatchCommand(ne, !1));
600
+ }, y), t.registerCommand(kt, (e) => {
584
601
  const n = g();
585
602
  if (!h(n)) return !1;
586
603
  if (e !== null) {
587
- if ((Tn || Ln || _n) && Sn) return !1;
588
- if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(ue, !1);
604
+ if ((Un || zn || jn) && Kn) return !1;
605
+ if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(ye, !1);
589
606
  }
590
- return t.dispatchCommand(de, void 0);
591
- }, v), t.registerCommand(Et, () => {
607
+ return t.dispatchCommand(we, void 0);
608
+ }, y), t.registerCommand(Dt, () => {
592
609
  const e = g();
593
610
  return !!h(e) && (t.blur(), !0);
594
- }, v), t.registerCommand(ht, (e) => {
595
- const [, n] = z(e);
611
+ }, y), t.registerCommand($t, (e) => {
612
+ const [, n] = Y(e);
596
613
  if (n.length > 0) {
597
- const i = be(e.clientX, e.clientY);
598
- if (i !== null) {
599
- const { offset: s, node: o } = i, a = V(o);
614
+ const s = Le(e.clientX, e.clientY);
615
+ if (s !== null) {
616
+ const { offset: i, node: o } = s, a = ee(o);
600
617
  if (a !== null) {
601
- const l = vt();
602
- if (_(a)) l.anchor.set(a.getKey(), s, "text"), l.focus.set(a.getKey(), s, "text");
618
+ const l = St();
619
+ if (N(a)) l.anchor.set(a.getKey(), i, "text"), l.focus.set(a.getKey(), i, "text");
603
620
  else {
604
621
  const u = a.getParentOrThrow().getKey(), d = a.getIndexWithinParent() + 1;
605
622
  l.anchor.set(u, d, "element"), l.focus.set(u, d, "element");
606
623
  }
607
- const c = wt(l);
608
- yt(c);
624
+ const c = _t(l);
625
+ Nt(c);
609
626
  }
610
- t.dispatchCommand(xe, n);
627
+ t.dispatchCommand(Te, n);
611
628
  }
612
629
  return e.preventDefault(), !0;
613
630
  }
614
631
  const r = g();
615
632
  return !!h(r);
616
- }, v), t.registerCommand(gt, (e) => {
617
- const [n] = z(e), r = g();
633
+ }, y), t.registerCommand(xt, (e) => {
634
+ const [n] = Y(e), r = g();
618
635
  return !(n && !h(r));
619
- }, v), t.registerCommand(pt, (e) => {
620
- const [n] = z(e), r = g();
636
+ }, y), t.registerCommand(bt, (e) => {
637
+ const [n] = Y(e), r = g();
621
638
  if (n && !h(r)) return !1;
622
- const i = be(e.clientX, e.clientY);
623
- if (i !== null) {
624
- const s = V(i.node);
625
- F(s) && e.preventDefault();
639
+ const s = Le(e.clientX, e.clientY);
640
+ if (s !== null) {
641
+ const i = ee(s.node);
642
+ I(i) && e.preventDefault();
626
643
  }
627
644
  return !0;
628
- }, v), t.registerCommand(ft, () => (mt(), !0), v), t.registerCommand(ke, (e) => (Ee(t, T(e, ClipboardEvent) ? e : null), !0), v), t.registerCommand(dt, (e) => (async function(n, r) {
629
- await Ee(r, T(n, ClipboardEvent) ? n : null), r.update(() => {
630
- const i = g();
631
- h(i) ? i.removeText() : O(i) && i.getNodes().forEach((s) => s.remove());
645
+ }, y), t.registerCommand(Ct, () => (Et(), !0), y), t.registerCommand(je, (e) => (De(t, R(e, ClipboardEvent) ? e : null), !0), y), t.registerCommand(wt, (e) => (async function(n, r) {
646
+ await De(r, R(n, ClipboardEvent) ? n : null), r.update(() => {
647
+ const s = g();
648
+ h(s) ? s.removeText() : F(s) && s.getNodes().forEach((i) => i.remove());
632
649
  });
633
- }(e, t), !0), v), t.registerCommand(Fe, (e) => {
634
- const [, n, r] = z(e);
635
- return n.length > 0 && !r ? (t.dispatchCommand(xe, n), !0) : ut(e.target) ? !1 : g() !== null && (function(i, s) {
636
- i.preventDefault(), s.update(() => {
637
- const o = g(), a = T(i, InputEvent) || T(i, KeyboardEvent) ? null : i.clipboardData;
638
- a != null && o !== null && we(a, o, s);
650
+ }(e, t), !0), y), t.registerCommand(Je, (e) => {
651
+ const [, n, r] = Y(e);
652
+ return n.length > 0 && !r ? (t.dispatchCommand(Te, n), !0) : yt(e.target) ? !1 : g() !== null && (function(s, i) {
653
+ s.preventDefault(), i.update(() => {
654
+ const o = g(), a = R(s, InputEvent) || R(s, KeyboardEvent) ? null : s.clipboardData;
655
+ a != null && o !== null && _e(a, o, i);
639
656
  }, { tag: "paste" });
640
657
  }(e, t), !0);
641
- }, v));
658
+ }, y));
642
659
  }
643
- const ee = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? I : D;
644
- function Ne(t) {
645
- return t.getEditorState().read(Be(t.isComposing()));
660
+ const ae = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? z : k;
661
+ function Re(t) {
662
+ return t.getEditorState().read(Ye(t.isComposing()));
646
663
  }
647
- function On({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
648
- const [r] = R(), i = function(s, o) {
649
- const [a, l] = A(() => s.getDecorators());
650
- return ee(() => s.registerDecoratorListener((c) => {
651
- pe.flushSync(() => {
664
+ function Wn({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
665
+ const [r] = T(), s = function(i, o) {
666
+ const [a, l] = K(() => i.getDecorators());
667
+ return ae(() => i.registerDecoratorListener((c) => {
668
+ be.flushSync(() => {
652
669
  l(c);
653
670
  });
654
- }), [s]), D(() => {
655
- l(s.getDecorators());
656
- }, [s]), H(() => {
671
+ }), [i]), k(() => {
672
+ l(i.getDecorators());
673
+ }, [i]), W(() => {
657
674
  const c = [], u = Object.keys(a);
658
675
  for (let d = 0; d < u.length; d++) {
659
- const f = u[d], p = y(o, { onError: (w) => s._onError(w), children: y(jt, { fallback: null, children: a[f] }) }), m = s.getElementByKey(f);
660
- m !== null && c.push(pe.createPortal(p, m, f));
676
+ const f = u[d], p = E(o, { onError: (v) => i._onError(v), children: E(en, { fallback: null, children: a[f] }) }), m = i.getElementByKey(f);
677
+ m !== null && c.push(be.createPortal(p, m, f));
661
678
  }
662
679
  return c;
663
- }, [o, a, s]);
680
+ }, [o, a, i]);
664
681
  }(r, n);
665
- return function(s) {
666
- ee(() => U(Rn(s), gn(s)), [s]);
667
- }(r), J(Le, { children: [t, y(kn, { content: e }), i] });
668
- }
669
- function kn({ content: t }) {
670
- const [e] = R(), n = function(i) {
671
- const [s, o] = A(() => Ne(i));
672
- return ee(() => {
682
+ return function(i) {
683
+ ae(() => U(Jn(i), Nn(i)), [i]);
684
+ }(r), Q(Ie, { children: [t, E(Vn, { content: e }), s] });
685
+ }
686
+ function Vn({ content: t }) {
687
+ const [e] = T(), n = function(s) {
688
+ const [i, o] = K(() => Re(s));
689
+ return ae(() => {
673
690
  function a() {
674
- const l = Ne(i);
691
+ const l = Re(s);
675
692
  o(l);
676
693
  }
677
- return a(), U(i.registerUpdateListener(() => {
694
+ return a(), U(s.registerUpdateListener(() => {
678
695
  a();
679
- }), i.registerEditableListener(() => {
696
+ }), s.registerEditableListener(() => {
680
697
  a();
681
698
  }));
682
- }, [i]), s;
683
- }(e), r = rn();
699
+ }, [s]), i;
700
+ }(e), r = hn();
684
701
  return n ? typeof t == "function" ? t(r) : t : null;
685
702
  }
686
- const Ye = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? I : D;
687
- function Fn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaExpanded: s, ariaLabel: o, ariaLabelledBy: a, ariaMultiline: l, ariaOwns: c, ariaRequired: u, autoCapitalize: d, className: f, id: p, role: m = "textbox", spellCheck: w = !0, style: x, tabIndex: E, "data-testid": C, ...$ }, N) {
688
- const [S, oe] = A(t.isEditable()), ie = zt((L) => {
689
- L && L.ownerDocument && L.ownerDocument.defaultView ? t.setRootElement(L) : t.setRootElement(null);
690
- }, [t]), Ze = H(() => /* @__PURE__ */ function(...L) {
691
- return (se) => {
692
- L.forEach((B) => {
693
- typeof B == "function" ? B(se) : B != null && (B.current = se);
703
+ const it = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? z : k;
704
+ function qn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: s, ariaExpanded: i, ariaLabel: o, ariaLabelledBy: a, ariaMultiline: l, ariaOwns: c, ariaRequired: u, autoCapitalize: d, className: f, id: p, role: m = "textbox", spellCheck: v = !0, style: b, tabIndex: w, "data-testid": C, ...x }, $) {
705
+ const [S, L] = K(t.isEditable()), M = tn((P) => {
706
+ P && P.ownerDocument && P.ownerDocument.defaultView ? t.setRootElement(P) : t.setRootElement(null);
707
+ }, [t]), j = W(() => /* @__PURE__ */ function(...P) {
708
+ return (pe) => {
709
+ P.forEach((V) => {
710
+ typeof V == "function" ? V(pe) : V != null && (V.current = pe);
694
711
  });
695
712
  };
696
- }(N, ie), [ie, N]);
697
- return Ye(() => (oe(t.isEditable()), t.registerEditableListener((L) => {
698
- oe(L);
699
- })), [t]), y("div", { ...$, "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? r : void 0, "aria-describedby": i, "aria-expanded": S && m === "combobox" ? !!s : void 0, "aria-label": o, "aria-labelledby": a, "aria-multiline": l, "aria-owns": S ? c : void 0, "aria-readonly": !S || void 0, "aria-required": u, autoCapitalize: d, className: f, contentEditable: S, "data-testid": C, id: p, ref: Ze, role: S ? m : void 0, spellCheck: w, style: x, tabIndex: E });
713
+ }($, M), [M, $]);
714
+ return it(() => (L(t.isEditable()), t.registerEditableListener((P) => {
715
+ L(P);
716
+ })), [t]), E("div", { ...x, "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? r : void 0, "aria-describedby": s, "aria-expanded": S && m === "combobox" ? !!i : void 0, "aria-label": o, "aria-labelledby": a, "aria-multiline": l, "aria-owns": S ? c : void 0, "aria-readonly": !S || void 0, "aria-required": u, autoCapitalize: d, className: f, contentEditable: S, "data-testid": C, id: p, ref: j, role: S ? m : void 0, spellCheck: v, style: b, tabIndex: w });
700
717
  }
701
- const An = Ae(Fn);
702
- function De(t) {
703
- return t.getEditorState().read(Be(t.isComposing()));
718
+ const Hn = We(qn);
719
+ function Oe(t) {
720
+ return t.getEditorState().read(Ye(t.isComposing()));
704
721
  }
705
- const In = Ae(Mn);
706
- function Mn(t, e) {
707
- const { placeholder: n, ...r } = t, [i] = R();
708
- return J(Le, { children: [y(An, { editor: i, ...r, ref: e }), n != null && y(Kn, { editor: i, content: n })] });
722
+ const Xn = We(Yn);
723
+ function Yn(t, e) {
724
+ const { placeholder: n, ...r } = t, [s] = T();
725
+ return Q(Ie, { children: [E(Hn, { editor: s, ...r, ref: e }), n != null && E(Zn, { editor: s, content: n })] });
709
726
  }
710
- function Kn({ content: t, editor: e }) {
727
+ function Zn({ content: t, editor: e }) {
711
728
  const n = function(o) {
712
- const [a, l] = A(() => De(o));
713
- return Ye(() => {
729
+ const [a, l] = K(() => Oe(o));
730
+ return it(() => {
714
731
  function c() {
715
- const u = De(o);
732
+ const u = Oe(o);
716
733
  l(u);
717
734
  }
718
735
  return c(), U(o.registerUpdateListener(() => {
@@ -721,188 +738,278 @@ function Kn({ content: t, editor: e }) {
721
738
  c();
722
739
  }));
723
740
  }, [o]), a;
724
- }(e), [r, i] = A(e.isEditable());
725
- if (I(() => (i(e.isEditable()), e.registerEditableListener((o) => {
726
- i(o);
741
+ }(e), [r, s] = K(e.isEditable());
742
+ if (z(() => (s(e.isEditable()), e.registerEditableListener((o) => {
743
+ s(o);
727
744
  })), [e]), !n) return null;
728
- let s = null;
729
- return typeof t == "function" ? s = t(r) : t !== null && (s = t), s === null ? null : y("div", { "aria-hidden": !0, children: s });
745
+ let i = null;
746
+ return typeof t == "function" ? i = t(r) : t !== null && (i = t), i === null ? null : E("div", { "aria-hidden": !0, children: i });
730
747
  }
731
- function te(t, e) {
732
- return te = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
748
+ function le(t, e) {
749
+ return le = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
733
750
  return n.__proto__ = r, n;
734
- }, te(t, e);
751
+ }, le(t, e);
735
752
  }
736
- var Se = { error: null }, Un = function(t) {
753
+ var Me = { error: null }, Gn = function(t) {
737
754
  var e, n;
738
755
  function r() {
739
- for (var s, o = arguments.length, a = new Array(o), l = 0; l < o; l++) a[l] = arguments[l];
740
- return (s = t.call.apply(t, [this].concat(a)) || this).state = Se, s.resetErrorBoundary = function() {
756
+ for (var i, o = arguments.length, a = new Array(o), l = 0; l < o; l++) a[l] = arguments[l];
757
+ return (i = t.call.apply(t, [this].concat(a)) || this).state = Me, i.resetErrorBoundary = function() {
741
758
  for (var c, u = arguments.length, d = new Array(u), f = 0; f < u; f++) d[f] = arguments[f];
742
- s.props.onReset == null || (c = s.props).onReset.apply(c, d), s.reset();
743
- }, s;
759
+ i.props.onReset == null || (c = i.props).onReset.apply(c, d), i.reset();
760
+ }, i;
744
761
  }
745
- n = t, (e = r).prototype = Object.create(n.prototype), e.prototype.constructor = e, te(e, n), r.getDerivedStateFromError = function(s) {
746
- return { error: s };
762
+ n = t, (e = r).prototype = Object.create(n.prototype), e.prototype.constructor = e, le(e, n), r.getDerivedStateFromError = function(i) {
763
+ return { error: i };
747
764
  };
748
- var i = r.prototype;
749
- return i.reset = function() {
750
- this.setState(Se);
751
- }, i.componentDidCatch = function(s, o) {
765
+ var s = r.prototype;
766
+ return s.reset = function() {
767
+ this.setState(Me);
768
+ }, s.componentDidCatch = function(i, o) {
752
769
  var a, l;
753
- (a = (l = this.props).onError) == null || a.call(l, s, o);
754
- }, i.componentDidUpdate = function(s, o) {
770
+ (a = (l = this.props).onError) == null || a.call(l, i, o);
771
+ }, s.componentDidUpdate = function(i, o) {
755
772
  var a, l, c, u, d = this.state.error, f = this.props.resetKeys;
756
- d !== null && o.error !== null && ((c = s.resetKeys) === void 0 && (c = []), (u = f) === void 0 && (u = []), c.length !== u.length || c.some(function(p, m) {
773
+ d !== null && o.error !== null && ((c = i.resetKeys) === void 0 && (c = []), (u = f) === void 0 && (u = []), c.length !== u.length || c.some(function(p, m) {
757
774
  return !Object.is(p, u[m]);
758
- })) && ((a = (l = this.props).onResetKeysChange) == null || a.call(l, s.resetKeys, f), this.reset());
759
- }, i.render = function() {
760
- var s = this.state.error, o = this.props, a = o.fallbackRender, l = o.FallbackComponent, c = o.fallback;
761
- if (s !== null) {
762
- var u = { error: s, resetErrorBoundary: this.resetErrorBoundary };
763
- if (Y.isValidElement(c)) return c;
775
+ })) && ((a = (l = this.props).onResetKeysChange) == null || a.call(l, i.resetKeys, f), this.reset());
776
+ }, s.render = function() {
777
+ var i = this.state.error, o = this.props, a = o.fallbackRender, l = o.FallbackComponent, c = o.fallback;
778
+ if (i !== null) {
779
+ var u = { error: i, resetErrorBoundary: this.resetErrorBoundary };
780
+ if (re.isValidElement(c)) return c;
764
781
  if (typeof a == "function") return a(u);
765
- if (l) return Y.createElement(l, u);
782
+ if (l) return re.createElement(l, u);
766
783
  throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
767
784
  }
768
785
  return this.props.children;
769
786
  }, r;
770
- }(Y.Component);
771
- function Bn({ children: t, onError: e }) {
772
- return y(Un, { fallback: y("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
773
- }
774
- const jn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? I : D;
775
- function zn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
776
- const [r] = R();
777
- return jn(() => {
778
- if (n) return r.registerUpdateListener(({ editorState: i, dirtyElements: s, dirtyLeaves: o, prevEditorState: a, tags: l }) => {
779
- e && s.size === 0 && o.size === 0 || t && l.has("history-merge") || a.isEmpty() || n(i, r, l);
787
+ }(re.Component);
788
+ function Qn({ children: t, onError: e }) {
789
+ return E(Gn, { fallback: E("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
790
+ }
791
+ const er = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? z : k;
792
+ function tr({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
793
+ const [r] = T();
794
+ return er(() => {
795
+ if (n) return r.registerUpdateListener(({ editorState: s, dirtyElements: i, dirtyLeaves: o, prevEditorState: a, tags: l }) => {
796
+ e && i.size === 0 && o.size === 0 || t && l.has("history-merge") || a.isEmpty() || n(s, r, l);
780
797
  });
781
798
  }, [r, t, e, n]), null;
782
799
  }
783
- function Wn() {
784
- const [t] = R();
785
- return D(() => {
786
- if (!t.hasNodes([Ie, Me])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
800
+ function nr() {
801
+ const [t] = T();
802
+ return k(() => {
803
+ if (!t.hasNodes([Ve, qe])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
787
804
  }, [t]), function(e) {
788
- D(() => Jt(e), [e]);
805
+ k(() => rn(e), [e]);
789
806
  }(t), null;
790
807
  }
791
- function Jn({ validateUrl: t }) {
792
- const [e] = R();
793
- return D(() => {
794
- if (!e.hasNodes([Ke])) throw new Error("LinkPlugin: LinkNode not registered on editor");
795
- return U(e.registerCommand(ge, (n) => {
796
- if (n === null) return Z(n), !0;
797
- if (typeof n == "string") return !(t !== void 0 && !t(n)) && (Z(n), !0);
808
+ function rr({ validateUrl: t }) {
809
+ const [e] = T();
810
+ return k(() => {
811
+ if (!e.hasNodes([He])) throw new Error("LinkPlugin: LinkNode not registered on editor");
812
+ return U(e.registerCommand(xe, (n) => {
813
+ if (n === null) return oe(n), !0;
814
+ if (typeof n == "string") return !(t !== void 0 && !t(n)) && (oe(n), !0);
798
815
  {
799
- const { url: r, target: i, rel: s, title: o } = n;
800
- return Z(r, { rel: s, target: i, title: o }), !0;
816
+ const { url: r, target: s, rel: i, title: o } = n;
817
+ return oe(r, { rel: i, target: s, title: o }), !0;
801
818
  }
802
- }, me), t !== void 0 ? e.registerCommand(Fe, (n) => {
819
+ }, Ee), t !== void 0 ? e.registerCommand(Je, (n) => {
803
820
  const r = g();
804
- if (!h(r) || r.isCollapsed() || !T(n, ClipboardEvent)) return !1;
805
- const i = n;
806
- if (i.clipboardData === null) return !1;
807
- const s = i.clipboardData.getData("text");
808
- return !!t(s) && !r.getNodes().some((o) => b(o)) && (e.dispatchCommand(ge, s), n.preventDefault(), !0);
809
- }, me) : () => {
821
+ if (!h(r) || r.isCollapsed() || !R(n, ClipboardEvent)) return !1;
822
+ const s = n;
823
+ if (s.clipboardData === null) return !1;
824
+ const i = s.clipboardData.getData("text");
825
+ return !!t(i) && !r.getNodes().some((o) => _(o)) && (e.dispatchCommand(xe, i), n.preventDefault(), !0);
826
+ }, Ee) : () => {
810
827
  });
811
828
  }, [e, t]), null;
812
829
  }
813
- function Vn({ newTab: t = !0, disabled: e = !1 }) {
814
- const [n] = R();
815
- return D(() => {
816
- const r = (s) => {
817
- const o = s.target;
830
+ function or({ newTab: t = !0, disabled: e = !1 }) {
831
+ const [n] = T();
832
+ return k(() => {
833
+ const r = (i) => {
834
+ const o = i.target;
818
835
  if (!(o instanceof Node)) return;
819
- const a = Kt(o);
836
+ const a = qt(o);
820
837
  if (a === null) return;
821
838
  let l = null, c = null;
822
839
  if (a.update(() => {
823
- const f = V(o);
840
+ const f = ee(o);
824
841
  if (f !== null) {
825
- const p = re(f, b);
826
- if (!e) if (Vt(p)) l = p.sanitizeUrl(p.getURL()), c = p.getTarget();
842
+ const p = me(f, _);
843
+ if (!e) if (on(p)) l = p.sanitizeUrl(p.getURL()), c = p.getTarget();
827
844
  else {
828
- const m = function(w, x) {
829
- let E = w;
830
- for (; E != null; ) {
831
- if (x(E)) return E;
832
- E = E.parentNode;
845
+ const m = function(v, b) {
846
+ let w = v;
847
+ for (; w != null; ) {
848
+ if (b(w)) return w;
849
+ w = w.parentNode;
833
850
  }
834
851
  return null;
835
- }(o, Ut);
852
+ }(o, Ht);
836
853
  m !== null && (l = m.href, c = m.target);
837
854
  }
838
855
  }
839
856
  }), l === null || l === "") return;
840
857
  const u = n.getEditorState().read(g);
841
- if (h(u) && !u.isCollapsed()) return void s.preventDefault();
842
- const d = s.type === "auxclick" && s.button === 1;
843
- window.open(l, t || d || s.metaKey || s.ctrlKey || c === "_blank" ? "_blank" : "_self"), s.preventDefault();
844
- }, i = (s) => {
845
- s.button === 1 && r(s);
858
+ if (h(u) && !u.isCollapsed()) return void i.preventDefault();
859
+ const d = i.type === "auxclick" && i.button === 1;
860
+ window.open(l, t || d || i.metaKey || i.ctrlKey || c === "_blank" ? "_blank" : "_self"), i.preventDefault();
861
+ }, s = (i) => {
862
+ i.button === 1 && r(i);
846
863
  };
847
- return n.registerRootListener((s, o) => {
848
- o !== null && (o.removeEventListener("click", r), o.removeEventListener("mouseup", i)), s !== null && (s.addEventListener("click", r), s.addEventListener("mouseup", i));
864
+ return n.registerRootListener((i, o) => {
865
+ o !== null && (o.removeEventListener("click", r), o.removeEventListener("mouseup", s)), i !== null && (i.addEventListener("click", r), i.addEventListener("mouseup", s));
849
866
  });
850
867
  }, [n, t, e]), null;
851
868
  }
852
- const rr = ({
869
+ const G = 0, ce = 1, ue = 2, D = 0, ir = 1, Fe = 2, sr = 3, ar = 4;
870
+ function lr(t, e, n, r, s) {
871
+ if (t === null || n.size === 0 && r.size === 0 && !s) return D;
872
+ const i = e._selection, o = t._selection;
873
+ if (s) return ir;
874
+ if (!(h(i) && h(o) && o.isCollapsed() && i.isCollapsed())) return D;
875
+ const a = function(w, C, x) {
876
+ const $ = w._nodeMap, S = [];
877
+ for (const L of C) {
878
+ const M = $.get(L);
879
+ M !== void 0 && S.push(M);
880
+ }
881
+ for (const [L, M] of x) {
882
+ if (!M) continue;
883
+ const j = $.get(L);
884
+ j === void 0 || fe(j) || S.push(j);
885
+ }
886
+ return S;
887
+ }(e, n, r);
888
+ if (a.length === 0) return D;
889
+ if (a.length > 1) {
890
+ const w = e._nodeMap, C = w.get(i.anchor.key), x = w.get(o.anchor.key);
891
+ return C && x && !t._nodeMap.has(C.__key) && N(C) && C.__text.length === 1 && i.anchor.offset === 1 ? Fe : D;
892
+ }
893
+ const l = a[0], c = t._nodeMap.get(l.__key);
894
+ if (!N(c) || !N(l) || c.__mode !== l.__mode) return D;
895
+ const u = c.__text, d = l.__text;
896
+ if (u === d) return D;
897
+ const f = i.anchor, p = o.anchor;
898
+ if (f.key !== p.key || f.type !== "text") return D;
899
+ const m = f.offset, v = p.offset, b = d.length - u.length;
900
+ return b === 1 && v === m - 1 ? Fe : b === -1 && v === m + 1 ? sr : b === -1 && v === m ? ar : D;
901
+ }
902
+ function cr(t, e) {
903
+ let n = Date.now(), r = D;
904
+ return (s, i, o, a, l, c) => {
905
+ const u = Date.now();
906
+ if (c.has("historic")) return r = D, n = u, ue;
907
+ const d = lr(s, i, a, l, t.isComposing()), f = (() => {
908
+ const p = o === null || o.editor === t, m = c.has("history-push");
909
+ if (!m && p && c.has("history-merge")) return G;
910
+ if (s === null) return ce;
911
+ const v = i._selection;
912
+ return a.size > 0 || l.size > 0 ? m === !1 && d !== D && d === r && u < n + e && p || a.size === 1 && function(b, w, C) {
913
+ const x = w._nodeMap.get(b), $ = C._nodeMap.get(b), S = w._selection, L = C._selection;
914
+ return !(h(S) && h(L) && S.anchor.type === "element" && S.focus.type === "element" && L.anchor.type === "text" && L.focus.type === "text" || !N(x) || !N($) || x.__parent !== $.__parent) && JSON.stringify(w.read(() => x.exportJSON())) === JSON.stringify(C.read(() => $.exportJSON()));
915
+ }(Array.from(a)[0], s, i) ? G : ce : v !== null ? G : ue;
916
+ })();
917
+ return n = u, r = d, f;
918
+ };
919
+ }
920
+ function Ae(t) {
921
+ t.undoStack = [], t.redoStack = [], t.current = null;
922
+ }
923
+ function ur(t, e, n) {
924
+ const r = cr(t, n);
925
+ return U(t.registerCommand(Gt, () => (function(i, o) {
926
+ const a = o.redoStack, l = o.undoStack;
927
+ if (l.length !== 0) {
928
+ const c = o.current, u = l.pop();
929
+ c !== null && (a.push(c), i.dispatchCommand(q, !0)), l.length === 0 && i.dispatchCommand(H, !1), o.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
930
+ }
931
+ }(t, e), !0), y), t.registerCommand(Zt, () => (function(i, o) {
932
+ const a = o.redoStack, l = o.undoStack;
933
+ if (a.length !== 0) {
934
+ const c = o.current;
935
+ c !== null && (l.push(c), i.dispatchCommand(H, !0));
936
+ const u = a.pop();
937
+ a.length === 0 && i.dispatchCommand(q, !1), o.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
938
+ }
939
+ }(t, e), !0), y), t.registerCommand(Yt, () => (Ae(e), !1), y), t.registerCommand(Xt, () => (Ae(e), t.dispatchCommand(q, !1), t.dispatchCommand(H, !1), !0), y), t.registerUpdateListener(({ editorState: i, prevEditorState: o, dirtyLeaves: a, dirtyElements: l, tags: c }) => {
940
+ const u = e.current, d = e.redoStack, f = e.undoStack, p = u === null ? null : u.editorState;
941
+ if (u !== null && i === p) return;
942
+ const m = r(o, i, u, a, l, c);
943
+ if (m === ce) d.length !== 0 && (e.redoStack = [], t.dispatchCommand(q, !1)), u !== null && (f.push({ ...u }), t.dispatchCommand(H, !0));
944
+ else if (m === ue) return;
945
+ e.current = { editor: t, editorState: i };
946
+ }));
947
+ }
948
+ function dr() {
949
+ return { current: null, redoStack: [], undoStack: [] };
950
+ }
951
+ function fr({ delay: t, externalHistoryState: e }) {
952
+ const [n] = T();
953
+ return function(r, s, i = 1e3) {
954
+ const o = W(() => s || dr(), [s]);
955
+ k(() => ur(r, o, i), [i, r, o]);
956
+ }(n, e, t), null;
957
+ }
958
+ const zr = ({
853
959
  namespace: t = "UvaEditor",
854
960
  initialValue: e = "",
855
961
  placeholder: n = "",
856
962
  onChange: r
857
963
  }) => {
858
- const i = {
964
+ const s = {
859
965
  namespace: t,
860
- theme: Gt,
966
+ theme: dn,
861
967
  onError(o) {
862
968
  throw o;
863
969
  },
864
- nodes: [Ie, Me, Ke, Yt],
970
+ nodes: [Ve, qe, He, cn],
865
971
  editorState: (o) => {
866
- const l = new DOMParser().parseFromString(e, "text/html"), c = ze(o, l), u = P();
972
+ const l = new DOMParser().parseFromString(e, "text/html"), c = Ge(o, l), u = O();
867
973
  u.clear();
868
- const d = ne();
974
+ const d = de();
869
975
  c.forEach((f) => d.append(f)), u.append(d);
870
976
  }
871
- }, s = (o, a) => {
977
+ }, i = (o, a) => {
872
978
  o.read(() => {
873
- const l = We(a);
979
+ const l = Qe(a);
874
980
  r(l);
875
981
  });
876
982
  };
877
- return /* @__PURE__ */ y("div", { className: K.editor__wrapper, children: /* @__PURE__ */ J(en, { initialConfig: i, children: [
878
- /* @__PURE__ */ y(Zt, {}),
879
- /* @__PURE__ */ J("div", { className: K["editor__field-wrapper"], children: [
880
- /* @__PURE__ */ y(
881
- On,
983
+ return /* @__PURE__ */ E("div", { className: J.editor__wrapper, children: /* @__PURE__ */ Q(mn, { initialConfig: s, children: [
984
+ /* @__PURE__ */ E(un, {}),
985
+ /* @__PURE__ */ Q("div", { className: J["editor__field-wrapper"], children: [
986
+ /* @__PURE__ */ E(
987
+ Wn,
882
988
  {
883
- contentEditable: /* @__PURE__ */ y(
884
- In,
989
+ contentEditable: /* @__PURE__ */ E(
990
+ Xn,
885
991
  {
886
- className: K.editor__field,
992
+ className: J.editor__field,
887
993
  "aria-label": "Rich text editor content",
888
994
  "aria-placeholder": n,
889
995
  title: "Rich text editor content",
890
- placeholder: /* @__PURE__ */ y("div", { className: K.editor__placeholder, children: n })
996
+ placeholder: /* @__PURE__ */ E("div", { className: J.editor__placeholder, children: n })
891
997
  }
892
998
  ),
893
- placeholder: /* @__PURE__ */ y("div", { className: K.editor__placeholder, children: n }),
894
- ErrorBoundary: Bn
999
+ placeholder: /* @__PURE__ */ E("div", { className: J.editor__placeholder, children: n }),
1000
+ ErrorBoundary: Qn
895
1001
  }
896
1002
  ),
897
- /* @__PURE__ */ y(Wn, {}),
898
- /* @__PURE__ */ y(Jn, { validateUrl: qt }),
899
- /* @__PURE__ */ y(Ht, { matchers: Xt }),
900
- /* @__PURE__ */ y(Vn, {}),
901
- /* @__PURE__ */ y(zn, { onChange: s })
1003
+ /* @__PURE__ */ E(fr, {}),
1004
+ /* @__PURE__ */ E(nr, {}),
1005
+ /* @__PURE__ */ E(rr, { validateUrl: sn }),
1006
+ /* @__PURE__ */ E(an, { matchers: ln }),
1007
+ /* @__PURE__ */ E(or, {}),
1008
+ /* @__PURE__ */ E(tr, { onChange: i })
902
1009
  ] })
903
1010
  ] }) });
904
1011
  };
905
1012
  export {
906
- rr as RteEditor
1013
+ zr as RteEditor
907
1014
  };
908
1015
  //# sourceMappingURL=RteEditor.js.map