@uva-glass/component-library 1.55.1 → 1.57.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 (149) hide show
  1. package/dist/Button.module-FL3-CODh.js +15 -0
  2. package/dist/Button.module-FL3-CODh.js.map +1 -0
  3. package/dist/{Lexical.prod-BiuZHlIm.js → Lexical.prod-CO0gPAfo.js} +583 -607
  4. package/dist/Lexical.prod-CO0gPAfo.js.map +1 -0
  5. package/dist/LexicalComposerContext.prod-Dyvim1tK.js +27 -0
  6. package/dist/LexicalComposerContext.prod-Dyvim1tK.js.map +1 -0
  7. package/dist/LexicalList.prod-BceA-cJD.js +562 -0
  8. package/dist/LexicalList.prod-BceA-cJD.js.map +1 -0
  9. package/dist/{LexicalUtils.prod-BZOm66mY.js → LexicalUtils.prod-PbdOb6JG.js} +6 -6
  10. package/dist/{LexicalUtils.prod-BZOm66mY.js.map → LexicalUtils.prod-PbdOb6JG.js.map} +1 -1
  11. package/dist/RteEditor.module-Dz9a8vaK.js +29 -0
  12. package/dist/RteEditor.module-Dz9a8vaK.js.map +1 -0
  13. package/dist/Sortable.module-uk_YuFs1.js +24 -0
  14. package/dist/{Sortable.module-B-93knlb.js.map → Sortable.module-uk_YuFs1.js.map} +1 -1
  15. package/dist/{SortableProvider-BMm77PpY.js → SortableProvider-i4PDjRS_.js} +2 -2
  16. package/dist/{SortableProvider-BMm77PpY.js.map → SortableProvider-i4PDjRS_.js.map} +1 -1
  17. package/dist/TablePlugin-1L5UZfDH.js +249 -0
  18. package/dist/TablePlugin-1L5UZfDH.js.map +1 -0
  19. package/dist/assets/Button.css +1 -1
  20. package/dist/assets/Container.css +1 -1
  21. package/dist/assets/EditorHeader.css +1 -0
  22. package/dist/assets/Flyout.css +1 -0
  23. package/dist/assets/Periods.css +1 -1
  24. package/dist/assets/RteEditor.css +1 -1
  25. package/dist/assets/Sortable.css +1 -1
  26. package/dist/assets/TableCellContextMenu.css +1 -0
  27. package/dist/assets/TablePlugin.css +1 -0
  28. package/dist/components/Buttons/Button.js +1 -1
  29. package/dist/components/Buttons/LinkButton.js +1 -1
  30. package/dist/components/Buttons/LinkButton.stories.js +13 -5
  31. package/dist/components/Buttons/LinkButton.stories.js.map +1 -1
  32. package/dist/components/Buttons/MenuButton.js +1 -1
  33. package/dist/components/CheckboxTree/CheckboxTree.js +13 -11
  34. package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
  35. package/dist/components/Icon/icons/index.d.ts +21 -18
  36. package/dist/components/Icon/icons/index.js +125 -120
  37. package/dist/components/Icon/icons/index.js.map +1 -1
  38. package/dist/components/InputField/InputField.stories.js +16 -14
  39. package/dist/components/InputField/InputField.stories.js.map +1 -1
  40. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  41. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  42. package/dist/components/MultiSelect/components/MultiSelectHeader.js +5 -3
  43. package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
  44. package/dist/components/MultiSelect/index.js +1 -1
  45. package/dist/components/Periods/Periods.js +12 -12
  46. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +6 -4
  47. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
  48. package/dist/components/RteEditor/EditorHeader/EditorHeader.d.ts +7 -0
  49. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +53 -0
  50. package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -0
  51. package/dist/components/RteEditor/EditorHeader/index.d.ts +1 -0
  52. package/dist/components/RteEditor/EditorHeader/index.js +5 -0
  53. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +11 -10
  54. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js.map +1 -1
  55. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +18 -15
  56. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
  57. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.d.ts +2 -0
  58. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +7 -4
  59. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js.map +1 -1
  60. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +2 -1
  61. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +63 -49
  62. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  63. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +3 -0
  64. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +6 -4
  65. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
  66. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +31 -8
  67. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
  68. package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
  69. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +6 -3
  70. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js.map +1 -1
  71. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts +8 -0
  72. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +44 -0
  73. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -0
  74. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.d.ts +1 -0
  75. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js +5 -0
  76. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js.map +1 -0
  77. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.d.ts +9 -1
  78. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +8 -6
  79. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
  80. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.d.ts +7 -0
  81. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +10 -0
  82. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -0
  83. package/dist/components/RteEditor/Plugins/TablePlugin/index.d.ts +1 -0
  84. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +4 -2
  85. package/dist/components/RteEditor/Plugins/TablePlugin/index.js.map +1 -1
  86. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +4 -0
  87. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +48 -38
  88. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  89. package/dist/components/RteEditor/Plugins/index.js +10 -8
  90. package/dist/components/RteEditor/Plugins/index.js.map +1 -1
  91. package/dist/components/RteEditor/Providers/LanguageProvider.d.ts +10 -0
  92. package/dist/components/RteEditor/Providers/LanguageProvider.js +18 -0
  93. package/dist/components/RteEditor/Providers/LanguageProvider.js.map +1 -0
  94. package/dist/components/RteEditor/RteEditor.d.ts +9 -1
  95. package/dist/components/RteEditor/RteEditor.js +476 -401
  96. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  97. package/dist/components/RteEditor/RteEditor.stories.d.ts +1 -0
  98. package/dist/components/RteEditor/RteEditor.stories.js +106 -15
  99. package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
  100. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
  101. package/dist/components/RteEditor/hooks/components/Flyout.d.ts +7 -0
  102. package/dist/components/RteEditor/hooks/components/Flyout.js +14 -0
  103. package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -0
  104. package/dist/components/RteEditor/hooks/useFlyout.js +16 -20
  105. package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
  106. package/dist/components/RteEditor/hooks/useTranslation.d.ts +61 -0
  107. package/dist/components/RteEditor/hooks/useTranslation.js +10 -0
  108. package/dist/components/RteEditor/hooks/useTranslation.js.map +1 -0
  109. package/dist/components/RteEditor/index.js +3 -2
  110. package/dist/components/RteEditor/mockRteContent.d.ts +1 -0
  111. package/dist/components/RteEditor/mockRteContent.js +98 -0
  112. package/dist/components/RteEditor/mockRteContent.js.map +1 -0
  113. package/dist/components/RteEditor/translations.d.ts +64 -0
  114. package/dist/components/RteEditor/translations.js +68 -0
  115. package/dist/components/RteEditor/translations.js.map +1 -0
  116. package/dist/components/Sortable/Sortable.js +1 -1
  117. package/dist/components/Sortable/SortableProvider.js +1 -1
  118. package/dist/components/Sortable/components/SortableContainer.js +2 -2
  119. package/dist/components/Sortable/components/SortableHandle.js +1 -1
  120. package/dist/components/Sortable/components/SortableItem.js +2 -2
  121. package/dist/components/index.js +20 -19
  122. package/dist/helpers-BewZrn6E.js +1512 -0
  123. package/dist/helpers-BewZrn6E.js.map +1 -0
  124. package/dist/{helpers-CJF7fErD.js → helpers-Ec7CfNnA.js} +72 -59
  125. package/dist/helpers-Ec7CfNnA.js.map +1 -0
  126. package/dist/index.js +20 -19
  127. package/dist/storyComponents/Container/Container.d.ts +1 -1
  128. package/dist/storyComponents/Container/Container.js +18 -16
  129. package/dist/storyComponents/Container/Container.js.map +1 -1
  130. package/dist/types/UserInterface.d.ts +1 -1
  131. package/package.json +12 -12
  132. package/dist/AddTableFrom-u1gSA461.js +0 -162
  133. package/dist/AddTableFrom-u1gSA461.js.map +0 -1
  134. package/dist/Button.module-Gr3KvBvb.js +0 -14
  135. package/dist/Button.module-Gr3KvBvb.js.map +0 -1
  136. package/dist/Lexical.prod-BiuZHlIm.js.map +0 -1
  137. package/dist/ListPlugin-DFFbKLaN.js +0 -588
  138. package/dist/ListPlugin-DFFbKLaN.js.map +0 -1
  139. package/dist/RteEditor.module-BBbfV1rk.js +0 -24
  140. package/dist/RteEditor.module-BBbfV1rk.js.map +0 -1
  141. package/dist/Sortable.module-B-93knlb.js +0 -24
  142. package/dist/TablePlugin-acQeRCt0.js +0 -1506
  143. package/dist/TablePlugin-acQeRCt0.js.map +0 -1
  144. package/dist/assets/AddTableFrom.css +0 -1
  145. package/dist/assets/useFlyout.css +0 -1
  146. package/dist/components/RteEditor/hooks/index.d.ts +0 -1
  147. package/dist/components/RteEditor/hooks/index.js +0 -5
  148. package/dist/helpers-CJF7fErD.js.map +0 -1
  149. /package/dist/components/RteEditor/{hooks → EditorHeader}/index.js.map +0 -0
@@ -1,15 +1,19 @@
1
- import { jsx as w, jsxs as te, Fragment as Me } from "react/jsx-runtime";
2
- import { ah as qe, w as F, P as ue, I as h, ai as Je, aj as We, u as D, i as U, y as j, F as He, l as L, m as v, ak as Te, al as Xe, am as m, a4 as Ze, e as I, M as Ye, an as Ge, ao as Qe, ap as et, N as ne, aq as tt, ar as nt, ad as rt, ae as ot, aa as it, W as st, as as at, at as me, c as pe, a3 as lt, a1 as re, a2 as ct, j as Fe, au as ge, V as ut, U as dt, O as ft, X as he, R as mt, av as pt, aw as gt, ax as ht, s as vt, a5 as yt, d as Ct, ay as wt, a6 as Et, a0 as bt, Z as $t, az as St, t as xt, L as ve, aA as _t, x as kt, K as J, $ as W, aB as Nt, aC as Lt, g as Dt, h as Rt, ac as Pt } from "../../Lexical.prod-BiuZHlIm.js";
1
+ import { jsx as E, jsxs as I, Fragment as Ie } from "react/jsx-runtime";
2
+ import { l as Je, o as Ve, u as T } from "../../LexicalComposerContext.prod-Dyvim1tK.js";
3
+ import { ah as Me, w as K, P as de, I as C, i as j, y as W, F as Xe, l as D, m as y, ai as Fe, aj as Ze, ak as p, a4 as Ye, e as F, M as Ge, al as Qe, am as et, an as tt, N as ne, ao as nt, ap as rt, ad as ot, ae as it, aa as st, W as at, aq as lt, ar as me, a as pe, a3 as ct, a1 as re, a2 as dt, j as Oe, as as ge, V as ut, U as ft, O as mt, X as he, R as pt, at as gt, au as ht, av as vt, u as Ct, a5 as yt, d as Et, aw as wt, a6 as bt, a0 as $t, Z as _t, r as St, t as xt, L as ve, ax as kt, x as Nt, K as J, $ as V, ay as Lt, az as Dt, g as Tt, h as Pt, ac as Rt } from "../../Lexical.prod-CO0gPAfo.js";
3
4
  import * as oe from "react";
4
- import { useMemo as V, useLayoutEffect as O, useEffect as x, useRef as It, useState as K, Suspense as Mt, forwardRef as Ke, useCallback as Tt } from "react";
5
- import { L as T, i as M, e as Ft, t as de, r as Kt, u as Ot } from "../../LexicalUtils.prod-BZOm66mY.js";
6
- import { r as ye } from "../../index-DsprzSCj.js";
7
- import { a as Ce, P as we, L as Ee, $ as be, b as Q, Z as ee, i as Oe, K as zt, t as $e, o as Bt, h as At, g as Ut, F as jt, M as Vt, u as Se, n as qt, I as Jt, c as Wt, m as Ht } from "../../TablePlugin-acQeRCt0.js";
8
- import { J as ze, D as Be, Z as Xt } from "../../ListPlugin-DFFbKLaN.js";
9
- import { a as Ae, U as xe, m as ie, g as Zt, b as Yt, F as Gt, M as Qt, f as en } from "../../helpers-CJF7fErD.js";
10
- import { s as A } from "../../RteEditor.module-BBbfV1rk.js";
11
- import { ToolBarPlugin as tn } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
12
- import "../../AddTableFrom-u1gSA461.js";
5
+ import { useMemo as q, useLayoutEffect as A, useEffect as x, useRef as It, useState as M, Suspense as Mt, forwardRef as Ke, useCallback as Ft } from "react";
6
+ import { L as z, i as O, e as Ot, t as ue, r as Kt, u as zt } from "../../LexicalUtils.prod-PbdOb6JG.js";
7
+ import { r as Ce } from "../../index-DsprzSCj.js";
8
+ import { T as ye, P as Ee, L as we, $ as be, f as ee, Z as te, g as ze, K as At, t as $e, o as Ut, h as Bt, j as jt, F as Wt, M as qt, u as _e, n as Ht, I as Jt, k as Vt, m as Xt } from "../../helpers-BewZrn6E.js";
9
+ import { J as Ae, D as Ue, Z as Zt } from "../../LexicalList.prod-BceA-cJD.js";
10
+ import { a as Be, U as Se, m as ie, b as Yt, c as Gt, F as Qt, M as en, f as tn } from "../../helpers-Ec7CfNnA.js";
11
+ import { c as nn } from "../../clsx-OuTLNxxd.js";
12
+ import { s as L } from "../../RteEditor.module-Dz9a8vaK.js";
13
+ import { ToolBarPlugin as rn } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
14
+ import { Icon as on } from "../Icon/Icon.js";
15
+ import "../../TablePlugin-1L5UZfDH.js";
16
+ import "./hooks/components/Flyout.js";
13
17
  import "../Buttons/Button.js";
14
18
  import "../Buttons/LinkButton.js";
15
19
  import "@react-aria/button";
@@ -25,99 +29,102 @@ import "react-router-dom";
25
29
  import "../SelectListbox/SelectListbox.js";
26
30
  import "../SelectListbox/SelectProvider.js";
27
31
  import "../Sortable/components/SortableItem.js";
28
- import "../../SortableProvider-BMm77PpY.js";
29
- import { UvaTheme as nn } from "./UvaTheme/UvaTheme.js";
30
- const Ue = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, rn = Ue ? O : x, H = { tag: "history-merge" };
31
- function on({ initialConfig: t, children: e }) {
32
- const n = V(() => {
33
- const { theme: r, namespace: i, nodes: o, onError: s, editorState: l, html: a } = t, c = We(null, r), u = qe({ editable: t.editable, html: a, namespace: i, nodes: o, onError: (d) => s(d, u), theme: r });
34
- return function(d, f) {
32
+ import "../../SortableProvider-i4PDjRS_.js";
33
+ import { useTranslation as sn } from "./hooks/useTranslation.js";
34
+ import { UvaTheme as an } from "./UvaTheme/UvaTheme.js";
35
+ import { EditorHeader as ln } from "./EditorHeader/EditorHeader.js";
36
+ import { useLanguage as cn, LanguageProvider as dn } from "./Providers/LanguageProvider.js";
37
+ const je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, un = je ? A : x, X = { tag: "history-merge" };
38
+ function fn({ initialConfig: t, children: e }) {
39
+ const n = q(() => {
40
+ const { theme: r, namespace: i, nodes: o, onError: s, editorState: l, html: a } = t, c = Ve(null, r), d = Me({ editable: t.editable, html: a, namespace: i, nodes: o, onError: (u) => s(u, d), theme: r });
41
+ return function(u, f) {
35
42
  if (f !== null) {
36
- if (f === void 0) d.update(() => {
37
- const p = F();
38
- if (p.isEmpty()) {
39
- const g = ue();
40
- p.append(g);
41
- const y = Ue ? document.activeElement : null;
42
- (h() !== null || y !== null && y === d.getRootElement()) && g.select();
43
+ if (f === void 0) u.update(() => {
44
+ const m = K();
45
+ if (m.isEmpty()) {
46
+ const g = de();
47
+ m.append(g);
48
+ const v = je ? document.activeElement : null;
49
+ (C() !== null || v !== null && v === u.getRootElement()) && g.select();
43
50
  }
44
- }, H);
51
+ }, X);
45
52
  else if (f !== null) switch (typeof f) {
46
53
  case "string": {
47
- const p = d.parseEditorState(f);
48
- d.setEditorState(p, H);
54
+ const m = u.parseEditorState(f);
55
+ u.setEditorState(m, X);
49
56
  break;
50
57
  }
51
58
  case "object":
52
- d.setEditorState(f, H);
59
+ u.setEditorState(f, X);
53
60
  break;
54
61
  case "function":
55
- d.update(() => {
56
- F().isEmpty() && f(d);
57
- }, H);
62
+ u.update(() => {
63
+ K().isEmpty() && f(u);
64
+ }, X);
58
65
  }
59
66
  }
60
- }(u, l), [u, c];
67
+ }(d, l), [d, c];
61
68
  }, []);
62
- return rn(() => {
69
+ return un(() => {
63
70
  const r = t.editable, [i] = n;
64
71
  i.setEditable(r === void 0 || r);
65
- }, []), w(Je.Provider, { value: n, children: e });
72
+ }, []), E(Je.Provider, { value: n, children: e });
66
73
  }
67
- const sn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? O : x;
68
- function an(t) {
74
+ const mn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? A : x;
75
+ function pn(t) {
69
76
  return { initialValueFn: () => t.isEditable(), subscribe: (e) => t.registerEditableListener(e) };
70
77
  }
71
- function ln() {
78
+ function gn() {
72
79
  return function(t) {
73
- const [e] = D(), n = V(() => t(e), [e, t]), r = It(n.initialValueFn()), [i, o] = K(r.current);
74
- return sn(() => {
80
+ const [e] = T(), n = q(() => t(e), [e, t]), r = It(n.initialValueFn()), [i, o] = M(r.current);
81
+ return mn(() => {
75
82
  const { initialValueFn: s, subscribe: l } = n, a = s();
76
83
  return r.current !== a && (r.current = a, o(a)), l((c) => {
77
84
  r.current = c, o(c);
78
85
  });
79
86
  }, [n, t]), i;
80
- }(an);
87
+ }(pn);
81
88
  }
82
- function cn() {
83
- return F().getTextContent();
89
+ function hn() {
90
+ return K().getTextContent();
84
91
  }
85
- function un(t, e = !0) {
92
+ function vn(t, e = !0) {
86
93
  if (t) return !1;
87
- let n = cn();
94
+ let n = hn();
88
95
  return e && (n = n.trim()), n === "";
89
96
  }
90
- function dn(t) {
91
- if (!un(t, !1)) return !1;
92
- const e = F().getChildren(), n = e.length;
97
+ function Cn(t) {
98
+ if (!vn(t, !1)) return !1;
99
+ const e = K().getChildren(), n = e.length;
93
100
  if (n > 1) return !1;
94
101
  for (let r = 0; r < n; r++) {
95
102
  const i = e[r];
96
- if (U(i)) return !1;
97
- if (j(i)) {
98
- if (!He(i) || i.__indent !== 0) return !1;
103
+ if (j(i)) return !1;
104
+ if (W(i)) {
105
+ if (!Xe(i) || i.__indent !== 0) return !1;
99
106
  const o = i.getChildren(), s = o.length;
100
107
  for (let l = 0; l < s; l++) {
101
108
  const a = o[r];
102
- if (!L(a)) return !1;
109
+ if (!D(a)) return !1;
103
110
  }
104
111
  }
105
112
  }
106
113
  return !0;
107
114
  }
108
- function je(t) {
109
- return () => dn(t);
115
+ function We(t) {
116
+ return () => Cn(t);
110
117
  }
111
- function fn(t) {
118
+ function yn(t) {
112
119
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
113
120
  }
114
- fn(function(t) {
121
+ yn(function(t) {
115
122
  const e = new URLSearchParams();
116
123
  e.append("code", t);
117
124
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
118
125
  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.`);
119
126
  });
120
- function mn(t) {
127
+ function En(t) {
121
128
  const e = window.location.origin, n = (r) => {
122
129
  if (r.origin !== e) return;
123
130
  const i = t.getRootElement();
@@ -135,16 +142,16 @@ function mn(t) {
135
142
  if (l && l.functionId === "makeChanges") {
136
143
  const a = l.args;
137
144
  if (a) {
138
- const [c, u, d, f, p, g] = a;
145
+ const [c, d, u, f, m, g] = a;
139
146
  t.update(() => {
140
- const y = h();
141
- if (v(y)) {
142
- const $ = y.anchor;
143
- let C = $.getNode(), E = 0, b = 0;
144
- if (L(C) && c >= 0 && u >= 0 && (E = c, b = c + u, y.setTextNodeRange(C, E, C, b)), E === b && d === "" || (y.insertRawText(d), C = $.getNode()), L(C)) {
145
- E = f, b = f + p;
146
- const _ = C.getTextContentSize();
147
- E = E > _ ? _ : E, b = b > _ ? _ : b, y.setTextNodeRange(C, E, C, b);
147
+ const v = C();
148
+ if (y(v)) {
149
+ const S = v.anchor;
150
+ let h = S.getNode(), w = 0, b = 0;
151
+ if (D(h) && c >= 0 && d >= 0 && (w = c, b = c + d, v.setTextNodeRange(h, w, h, b)), w === b && u === "" || (v.insertRawText(u), h = S.getNode()), D(h)) {
152
+ w = f, b = f + m;
153
+ const _ = h.getTextContentSize();
154
+ w = w > _ ? _ : w, b = b > _ ? _ : b, v.setTextNodeRange(h, w, h, b);
148
155
  }
149
156
  r.stopImmediatePropagation();
150
157
  }
@@ -158,7 +165,7 @@ function mn(t) {
158
165
  window.removeEventListener("message", n, !0);
159
166
  };
160
167
  }
161
- function _e(t, e) {
168
+ function xe(t, e) {
162
169
  if (document.caretRangeFromPoint !== void 0) {
163
170
  const n = document.caretRangeFromPoint(t, e);
164
171
  return n === null ? null : { node: n.startContainer, offset: n.startOffset };
@@ -169,300 +176,300 @@ function _e(t, e) {
169
176
  }
170
177
  return null;
171
178
  }
172
- const z = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, pn = z && "documentMode" in document ? document.documentMode : null, gn = !(!z || !("InputEvent" in window) || pn) && "getTargetRanges" in new window.InputEvent("input"), hn = z && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), vn = z && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, yn = z && /^(?=.*Chrome).*/i.test(navigator.userAgent), Cn = z && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !yn, ke = xt();
173
- function X(t) {
179
+ const U = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, wn = U && "documentMode" in document ? document.documentMode : null, bn = !(!U || !("InputEvent" in window) || wn) && "getTargetRanges" in new window.InputEvent("input"), $n = U && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), _n = U && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Sn = U && /^(?=.*Chrome).*/i.test(navigator.userAgent), xn = U && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Sn, ke = xt();
180
+ function Z(t) {
174
181
  let e = null;
175
- if (M(t, DragEvent) ? e = t.dataTransfer : M(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
182
+ if (O(t, DragEvent) ? e = t.dataTransfer : O(t, ClipboardEvent) && (e = t.clipboardData), e === null) return [!1, [], !1];
176
183
  const n = e.types, r = n.includes("Files"), i = n.includes("text/html") || n.includes("text/plain");
177
184
  return [r, Array.from(e.files), i];
178
185
  }
179
186
  function Ne(t) {
180
- const e = h();
181
- if (!v(e)) return !1;
187
+ const e = C();
188
+ if (!y(e)) return !1;
182
189
  const n = /* @__PURE__ */ new Set(), r = e.getNodes();
183
190
  for (let i = 0; i < r.length; i++) {
184
191
  const o = r[i], s = o.getKey();
185
192
  if (n.has(s)) continue;
186
- const l = de(o, (c) => j(c) && !c.isInline());
193
+ const l = ue(o, (c) => W(c) && !c.isInline());
187
194
  if (l === null) continue;
188
195
  const a = l.getKey();
189
196
  l.canIndent() && !n.has(a) && (n.add(a), t(l));
190
197
  }
191
198
  return n.size > 0;
192
199
  }
193
- function Z(t) {
200
+ function Y(t) {
194
201
  const e = ne(t);
195
- return U(e);
202
+ return j(e);
196
203
  }
197
- function wn(t) {
198
- return T(t.registerCommand(St, (e) => {
199
- const n = h();
200
- return !!I(n) && (n.clear(), !0);
204
+ function kn(t) {
205
+ return z(t.registerCommand(St, (e) => {
206
+ const n = C();
207
+ return !!F(n) && (n.clear(), !0);
201
208
  }, 0), t.registerCommand(re, (e) => {
202
- const n = h();
203
- return !!v(n) && (n.deleteCharacter(e), !0);
204
- }, m), t.registerCommand($t, (e) => {
205
- const n = h();
206
- return !!v(n) && (n.deleteWord(e), !0);
207
- }, m), t.registerCommand(bt, (e) => {
208
- const n = h();
209
- return !!v(n) && (n.deleteLine(e), !0);
210
- }, m), t.registerCommand(Et, (e) => {
211
- const n = h();
209
+ const n = C();
210
+ return !!y(n) && (n.deleteCharacter(e), !0);
211
+ }, p), t.registerCommand(_t, (e) => {
212
+ const n = C();
213
+ return !!y(n) && (n.deleteWord(e), !0);
214
+ }, p), t.registerCommand($t, (e) => {
215
+ const n = C();
216
+ return !!y(n) && (n.deleteLine(e), !0);
217
+ }, p), t.registerCommand(bt, (e) => {
218
+ const n = C();
212
219
  if (typeof e == "string") n !== null && n.insertText(e);
213
220
  else {
214
221
  if (n === null) return !1;
215
222
  const r = e.dataTransfer;
216
- if (r != null) Ce(r, n, t);
217
- else if (v(n)) {
223
+ if (r != null) ye(r, n, t);
224
+ else if (y(n)) {
218
225
  const i = e.data;
219
226
  return i && n.insertText(i), !0;
220
227
  }
221
228
  }
222
229
  return !0;
223
- }, m), t.registerCommand(wt, () => {
224
- const e = h();
225
- return !!v(e) && (e.removeText(), !0);
226
- }, m), t.registerCommand(Ct, (e) => {
227
- const n = h();
228
- return !!v(n) && (n.formatText(e), !0);
229
- }, m), t.registerCommand(yt, (e) => {
230
- const n = h();
231
- if (!v(n) && !I(n)) return !1;
230
+ }, p), t.registerCommand(wt, () => {
231
+ const e = C();
232
+ return !!y(e) && (e.removeText(), !0);
233
+ }, p), t.registerCommand(Et, (e) => {
234
+ const n = C();
235
+ return !!y(n) && (n.formatText(e), !0);
236
+ }, p), t.registerCommand(yt, (e) => {
237
+ const n = C();
238
+ if (!y(n) && !F(n)) return !1;
232
239
  const r = n.getNodes();
233
240
  for (const i of r) {
234
- const o = de(i, (s) => j(s) && !s.isInline());
241
+ const o = ue(i, (s) => W(s) && !s.isInline());
235
242
  o !== null && o.setFormat(e);
236
243
  }
237
244
  return !0;
238
- }, m), t.registerCommand(me, (e) => {
239
- const n = h();
240
- return !!v(n) && (n.insertLineBreak(e), !0);
241
- }, m), t.registerCommand(pe, () => {
242
- const e = h();
243
- return !!v(e) && (e.insertParagraph(), !0);
244
- }, m), t.registerCommand(gt, () => (ht([vt()]), !0), m), t.registerCommand(pt, () => Ne((e) => {
245
+ }, p), t.registerCommand(me, (e) => {
246
+ const n = C();
247
+ return !!y(n) && (n.insertLineBreak(e), !0);
248
+ }, p), t.registerCommand(pe, () => {
249
+ const e = C();
250
+ return !!y(e) && (e.insertParagraph(), !0);
251
+ }, p), t.registerCommand(ht, () => (vt([Ct()]), !0), p), t.registerCommand(gt, () => Ne((e) => {
245
252
  const n = e.getIndent();
246
253
  e.setIndent(n + 1);
247
- }), m), t.registerCommand(ge, () => Ne((e) => {
254
+ }), p), t.registerCommand(ge, () => Ne((e) => {
248
255
  const n = e.getIndent();
249
256
  n > 0 && e.setIndent(n - 1);
250
- }), m), t.registerCommand(mt, (e) => {
251
- const n = h();
252
- if (I(n) && !Z(e.target)) {
257
+ }), p), t.registerCommand(pt, (e) => {
258
+ const n = C();
259
+ if (F(n) && !Y(e.target)) {
253
260
  const r = n.getNodes();
254
261
  if (r.length > 0) return r[0].selectPrevious(), !0;
255
- } else if (v(n)) {
262
+ } else if (y(n)) {
256
263
  const r = he(n.focus, !0);
257
- if (!e.shiftKey && U(r) && !r.isIsolated() && !r.isInline()) return r.selectPrevious(), e.preventDefault(), !0;
264
+ if (!e.shiftKey && j(r) && !r.isIsolated() && !r.isInline()) return r.selectPrevious(), e.preventDefault(), !0;
258
265
  }
259
266
  return !1;
260
- }, m), t.registerCommand(ft, (e) => {
261
- const n = h();
262
- if (I(n)) {
267
+ }, p), t.registerCommand(mt, (e) => {
268
+ const n = C();
269
+ if (F(n)) {
263
270
  const r = n.getNodes();
264
271
  if (r.length > 0) return r[0].selectNext(0, 0), !0;
265
- } else if (v(n)) {
272
+ } else if (y(n)) {
266
273
  if (function(i) {
267
274
  const o = i.focus;
268
- return o.key === "root" && o.offset === F().getChildrenSize();
275
+ return o.key === "root" && o.offset === K().getChildrenSize();
269
276
  }(n)) return e.preventDefault(), !0;
270
277
  const r = he(n.focus, !1);
271
- if (!e.shiftKey && U(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), e.preventDefault(), !0;
278
+ if (!e.shiftKey && j(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), e.preventDefault(), !0;
272
279
  }
273
280
  return !1;
274
- }, m), t.registerCommand(dt, (e) => {
275
- const n = h();
276
- if (I(n)) {
281
+ }, p), t.registerCommand(ft, (e) => {
282
+ const n = C();
283
+ if (F(n)) {
277
284
  const r = n.getNodes();
278
285
  if (r.length > 0) return e.preventDefault(), r[0].selectPrevious(), !0;
279
286
  }
280
- if (!v(n)) return !1;
281
- if (Ee(n, !0)) {
287
+ if (!y(n)) return !1;
288
+ if (we(n, !0)) {
282
289
  const r = e.shiftKey;
283
290
  return e.preventDefault(), be(n, r, !0), !0;
284
291
  }
285
292
  return !1;
286
- }, m), t.registerCommand(ut, (e) => {
287
- const n = h();
288
- if (I(n) && !Z(e.target)) {
293
+ }, p), t.registerCommand(ut, (e) => {
294
+ const n = C();
295
+ if (F(n) && !Y(e.target)) {
289
296
  const i = n.getNodes();
290
297
  if (i.length > 0) return e.preventDefault(), i[0].selectNext(0, 0), !0;
291
298
  }
292
- if (!v(n)) return !1;
299
+ if (!y(n)) return !1;
293
300
  const r = e.shiftKey;
294
- return !!Ee(n, !1) && (e.preventDefault(), be(n, r, !1), !0);
295
- }, m), t.registerCommand(ct, (e) => {
296
- if (Z(e.target)) return !1;
297
- const n = h();
298
- if (!v(n)) return !1;
301
+ return !!we(n, !1) && (e.preventDefault(), be(n, r, !1), !0);
302
+ }, p), t.registerCommand(dt, (e) => {
303
+ if (Y(e.target)) return !1;
304
+ const n = C();
305
+ if (!y(n)) return !1;
299
306
  e.preventDefault();
300
307
  const { anchor: r } = n, i = r.getNode();
301
- return n.isCollapsed() && r.offset === 0 && !Fe(i) && Ft(i).getIndent() > 0 ? t.dispatchCommand(ge, void 0) : t.dispatchCommand(re, !0);
302
- }, m), t.registerCommand(lt, (e) => {
303
- if (Z(e.target)) return !1;
304
- const n = h();
305
- return !!v(n) && (e.preventDefault(), t.dispatchCommand(re, !1));
306
- }, m), t.registerCommand(at, (e) => {
307
- const n = h();
308
- if (!v(n)) return !1;
308
+ return n.isCollapsed() && r.offset === 0 && !Oe(i) && Ot(i).getIndent() > 0 ? t.dispatchCommand(ge, void 0) : t.dispatchCommand(re, !0);
309
+ }, p), t.registerCommand(ct, (e) => {
310
+ if (Y(e.target)) return !1;
311
+ const n = C();
312
+ return !!y(n) && (e.preventDefault(), t.dispatchCommand(re, !1));
313
+ }, p), t.registerCommand(lt, (e) => {
314
+ const n = C();
315
+ if (!y(n)) return !1;
309
316
  if (e !== null) {
310
- if ((vn || hn || Cn) && gn) return !1;
317
+ if ((_n || $n || xn) && bn) return !1;
311
318
  if (e.preventDefault(), e.shiftKey) return t.dispatchCommand(me, !1);
312
319
  }
313
320
  return t.dispatchCommand(pe, void 0);
314
- }, m), t.registerCommand(st, () => {
315
- const e = h();
316
- return !!v(e) && (t.blur(), !0);
317
- }, m), t.registerCommand(nt, (e) => {
318
- const [, n] = X(e);
321
+ }, p), t.registerCommand(at, () => {
322
+ const e = C();
323
+ return !!y(e) && (t.blur(), !0);
324
+ }, p), t.registerCommand(rt, (e) => {
325
+ const [, n] = Z(e);
319
326
  if (n.length > 0) {
320
- const i = _e(e.clientX, e.clientY);
327
+ const i = xe(e.clientX, e.clientY);
321
328
  if (i !== null) {
322
329
  const { offset: o, node: s } = i, l = ne(s);
323
330
  if (l !== null) {
324
- const a = rt();
325
- if (L(l)) a.anchor.set(l.getKey(), o, "text"), a.focus.set(l.getKey(), o, "text");
331
+ const a = ot();
332
+ if (D(l)) a.anchor.set(l.getKey(), o, "text"), a.focus.set(l.getKey(), o, "text");
326
333
  else {
327
- const u = l.getParentOrThrow().getKey(), d = l.getIndexWithinParent() + 1;
328
- a.anchor.set(u, d, "element"), a.focus.set(u, d, "element");
334
+ const d = l.getParentOrThrow().getKey(), u = l.getIndexWithinParent() + 1;
335
+ a.anchor.set(d, u, "element"), a.focus.set(d, u, "element");
329
336
  }
330
- const c = ot(a);
331
- it(c);
337
+ const c = it(a);
338
+ st(c);
332
339
  }
333
340
  t.dispatchCommand(ke, n);
334
341
  }
335
342
  return e.preventDefault(), !0;
336
343
  }
337
- const r = h();
338
- return !!v(r);
339
- }, m), t.registerCommand(tt, (e) => {
340
- const [n] = X(e), r = h();
341
- return !(n && !v(r));
342
- }, m), t.registerCommand(et, (e) => {
343
- const [n] = X(e), r = h();
344
- if (n && !v(r)) return !1;
345
- const i = _e(e.clientX, e.clientY);
344
+ const r = C();
345
+ return !!y(r);
346
+ }, p), t.registerCommand(nt, (e) => {
347
+ const [n] = Z(e), r = C();
348
+ return !(n && !y(r));
349
+ }, p), t.registerCommand(tt, (e) => {
350
+ const [n] = Z(e), r = C();
351
+ if (n && !y(r)) return !1;
352
+ const i = xe(e.clientX, e.clientY);
346
353
  if (i !== null) {
347
354
  const o = ne(i.node);
348
- U(o) && e.preventDefault();
355
+ j(o) && e.preventDefault();
349
356
  }
350
357
  return !0;
351
- }, m), t.registerCommand(Ge, () => (Qe(), !0), m), t.registerCommand(Ye, (e) => (we(t, M(e, ClipboardEvent) ? e : null), !0), m), t.registerCommand(Ze, (e) => (async function(n, r) {
352
- await we(r, M(n, ClipboardEvent) ? n : null), r.update(() => {
353
- const i = h();
354
- v(i) ? i.removeText() : I(i) && i.getNodes().forEach((o) => o.remove());
358
+ }, p), t.registerCommand(Qe, () => (et(), !0), p), t.registerCommand(Ge, (e) => (Ee(t, O(e, ClipboardEvent) ? e : null), !0), p), t.registerCommand(Ye, (e) => (async function(n, r) {
359
+ await Ee(r, O(n, ClipboardEvent) ? n : null), r.update(() => {
360
+ const i = C();
361
+ y(i) ? i.removeText() : F(i) && i.getNodes().forEach((o) => o.remove());
355
362
  });
356
- }(e, t), !0), m), t.registerCommand(Te, (e) => {
357
- const [, n, r] = X(e);
358
- return n.length > 0 && !r ? (t.dispatchCommand(ke, n), !0) : Xe(e.target) ? !1 : h() !== null && (function(i, o) {
363
+ }(e, t), !0), p), t.registerCommand(Fe, (e) => {
364
+ const [, n, r] = Z(e);
365
+ return n.length > 0 && !r ? (t.dispatchCommand(ke, n), !0) : Ze(e.target) ? !1 : C() !== null && (function(i, o) {
359
366
  i.preventDefault(), o.update(() => {
360
- const s = h(), l = M(i, InputEvent) || M(i, KeyboardEvent) ? null : i.clipboardData;
361
- l != null && s !== null && Ce(l, s, o);
367
+ const s = C(), l = O(i, InputEvent) || O(i, KeyboardEvent) ? null : i.clipboardData;
368
+ l != null && s !== null && ye(l, s, o);
362
369
  }, { tag: "paste" });
363
370
  }(e, t), !0);
364
- }, m));
371
+ }, p));
365
372
  }
366
- const se = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? O : x;
373
+ const se = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? A : x;
367
374
  function Le(t) {
368
- return t.getEditorState().read(je(t.isComposing()));
375
+ return t.getEditorState().read(We(t.isComposing()));
369
376
  }
370
- function En({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
371
- const [r] = D(), i = function(o, s) {
372
- const [l, a] = K(() => o.getDecorators());
377
+ function Nn({ contentEditable: t, placeholder: e = null, ErrorBoundary: n }) {
378
+ const [r] = T(), i = function(o, s) {
379
+ const [l, a] = M(() => o.getDecorators());
373
380
  return se(() => o.registerDecoratorListener((c) => {
374
- ye.flushSync(() => {
381
+ Ce.flushSync(() => {
375
382
  a(c);
376
383
  });
377
384
  }), [o]), x(() => {
378
385
  a(o.getDecorators());
379
- }, [o]), V(() => {
380
- const c = [], u = Object.keys(l);
381
- for (let d = 0; d < u.length; d++) {
382
- const f = u[d], p = w(s, { onError: (y) => o._onError(y), children: w(Mt, { fallback: null, children: l[f] }) }), g = o.getElementByKey(f);
383
- g !== null && c.push(ye.createPortal(p, g, f));
386
+ }, [o]), q(() => {
387
+ const c = [], d = Object.keys(l);
388
+ for (let u = 0; u < d.length; u++) {
389
+ const f = d[u], m = E(s, { onError: (v) => o._onError(v), children: E(Mt, { fallback: null, children: l[f] }) }), g = o.getElementByKey(f);
390
+ g !== null && c.push(Ce.createPortal(m, g, f));
384
391
  }
385
392
  return c;
386
393
  }, [s, l, o]);
387
394
  }(r, n);
388
395
  return function(o) {
389
- se(() => T(wn(o), mn(o)), [o]);
390
- }(r), te(Me, { children: [t, w(bn, { content: e }), i] });
396
+ se(() => z(kn(o), En(o)), [o]);
397
+ }(r), I(Ie, { children: [t, E(Ln, { content: e }), i] });
391
398
  }
392
- function bn({ content: t }) {
393
- const [e] = D(), n = function(i) {
394
- const [o, s] = K(() => Le(i));
399
+ function Ln({ content: t }) {
400
+ const [e] = T(), n = function(i) {
401
+ const [o, s] = M(() => Le(i));
395
402
  return se(() => {
396
403
  function l() {
397
404
  const a = Le(i);
398
405
  s(a);
399
406
  }
400
- return l(), T(i.registerUpdateListener(() => {
407
+ return l(), z(i.registerUpdateListener(() => {
401
408
  l();
402
409
  }), i.registerEditableListener(() => {
403
410
  l();
404
411
  }));
405
412
  }, [i]), o;
406
- }(e), r = ln();
413
+ }(e), r = gn();
407
414
  return n ? typeof t == "function" ? t(r) : t : null;
408
415
  }
409
- const Ve = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? O : x;
410
- function $n({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaExpanded: o, ariaLabel: s, ariaLabelledBy: l, ariaMultiline: a, ariaOwns: c, ariaRequired: u, autoCapitalize: d, className: f, id: p, role: g = "textbox", spellCheck: y = !0, style: $, tabIndex: C, "data-testid": E, ...b }, _) {
411
- const [S, N] = K(t.isEditable()), P = Tt((R) => {
416
+ const qe = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? A : x;
417
+ function Dn({ editor: t, ariaActiveDescendant: e, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaExpanded: o, ariaLabel: s, ariaLabelledBy: l, ariaMultiline: a, ariaOwns: c, ariaRequired: d, autoCapitalize: u, className: f, id: m, role: g = "textbox", spellCheck: v = !0, style: S, tabIndex: h, "data-testid": w, ...b }, _) {
418
+ const [$, k] = M(t.isEditable()), P = Ft((R) => {
412
419
  R && R.ownerDocument && R.ownerDocument.defaultView ? t.setRootElement(R) : t.setRootElement(null);
413
- }, [t]), B = V(() => /* @__PURE__ */ function(...R) {
420
+ }, [t]), B = q(() => /* @__PURE__ */ function(...R) {
414
421
  return (fe) => {
415
- R.forEach((q) => {
416
- typeof q == "function" ? q(fe) : q != null && (q.current = fe);
422
+ R.forEach((H) => {
423
+ typeof H == "function" ? H(fe) : H != null && (H.current = fe);
417
424
  });
418
425
  };
419
426
  }(_, P), [P, _]);
420
- return Ve(() => (N(t.isEditable()), t.registerEditableListener((R) => {
421
- N(R);
422
- })), [t]), w("div", { ...b, "aria-activedescendant": S ? e : void 0, "aria-autocomplete": S ? n : "none", "aria-controls": S ? r : void 0, "aria-describedby": i, "aria-expanded": S && g === "combobox" ? !!o : void 0, "aria-label": s, "aria-labelledby": l, "aria-multiline": a, "aria-owns": S ? c : void 0, "aria-readonly": !S || void 0, "aria-required": u, autoCapitalize: d, className: f, contentEditable: S, "data-testid": E, id: p, ref: B, role: S ? g : void 0, spellCheck: y, style: $, tabIndex: C });
427
+ return qe(() => (k(t.isEditable()), t.registerEditableListener((R) => {
428
+ k(R);
429
+ })), [t]), E("div", { ...b, "aria-activedescendant": $ ? e : void 0, "aria-autocomplete": $ ? n : "none", "aria-controls": $ ? r : void 0, "aria-describedby": i, "aria-expanded": $ && g === "combobox" ? !!o : void 0, "aria-label": s, "aria-labelledby": l, "aria-multiline": a, "aria-owns": $ ? c : void 0, "aria-readonly": !$ || void 0, "aria-required": d, autoCapitalize: u, className: f, contentEditable: $, "data-testid": w, id: m, ref: B, role: $ ? g : void 0, spellCheck: v, style: S, tabIndex: h });
423
430
  }
424
- const Sn = Ke($n);
431
+ const Tn = Ke(Dn);
425
432
  function De(t) {
426
- return t.getEditorState().read(je(t.isComposing()));
433
+ return t.getEditorState().read(We(t.isComposing()));
427
434
  }
428
- const xn = Ke(_n);
429
- function _n(t, e) {
430
- const { placeholder: n, ...r } = t, [i] = D();
431
- return te(Me, { children: [w(Sn, { editor: i, ...r, ref: e }), n != null && w(kn, { editor: i, content: n })] });
435
+ const Pn = Ke(Rn);
436
+ function Rn(t, e) {
437
+ const { placeholder: n, ...r } = t, [i] = T();
438
+ return I(Ie, { children: [E(Tn, { editor: i, ...r, ref: e }), n != null && E(In, { editor: i, content: n })] });
432
439
  }
433
- function kn({ content: t, editor: e }) {
440
+ function In({ content: t, editor: e }) {
434
441
  const n = function(s) {
435
- const [l, a] = K(() => De(s));
436
- return Ve(() => {
442
+ const [l, a] = M(() => De(s));
443
+ return qe(() => {
437
444
  function c() {
438
- const u = De(s);
439
- a(u);
445
+ const d = De(s);
446
+ a(d);
440
447
  }
441
- return c(), T(s.registerUpdateListener(() => {
448
+ return c(), z(s.registerUpdateListener(() => {
442
449
  c();
443
450
  }), s.registerEditableListener(() => {
444
451
  c();
445
452
  }));
446
453
  }, [s]), l;
447
- }(e), [r, i] = K(e.isEditable());
448
- if (O(() => (i(e.isEditable()), e.registerEditableListener((s) => {
454
+ }(e), [r, i] = M(e.isEditable());
455
+ if (A(() => (i(e.isEditable()), e.registerEditableListener((s) => {
449
456
  i(s);
450
457
  })), [e]), !n) return null;
451
458
  let o = null;
452
- return typeof t == "function" ? o = t(r) : t !== null && (o = t), o === null ? null : w("div", { "aria-hidden": !0, children: o });
459
+ return typeof t == "function" ? o = t(r) : t !== null && (o = t), o === null ? null : E("div", { "aria-hidden": !0, children: o });
453
460
  }
454
461
  function ae(t, e) {
455
462
  return ae = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
456
463
  return n.__proto__ = r, n;
457
464
  }, ae(t, e);
458
465
  }
459
- var Re = { error: null }, Nn = function(t) {
466
+ var Te = { error: null }, Mn = function(t) {
460
467
  var e, n;
461
468
  function r() {
462
469
  for (var o, s = arguments.length, l = new Array(s), a = 0; a < s; a++) l[a] = arguments[a];
463
- return (o = t.call.apply(t, [this].concat(l)) || this).state = Re, o.resetErrorBoundary = function() {
464
- for (var c, u = arguments.length, d = new Array(u), f = 0; f < u; f++) d[f] = arguments[f];
465
- o.props.onReset == null || (c = o.props).onReset.apply(c, d), o.reset();
470
+ return (o = t.call.apply(t, [this].concat(l)) || this).state = Te, o.resetErrorBoundary = function() {
471
+ for (var c, d = arguments.length, u = new Array(d), f = 0; f < d; f++) u[f] = arguments[f];
472
+ o.props.onReset == null || (c = o.props).onReset.apply(c, u), o.reset();
466
473
  }, o;
467
474
  }
468
475
  n = t, (e = r).prototype = Object.create(n.prototype), e.prototype.constructor = e, ae(e, n), r.getDerivedStateFromError = function(o) {
@@ -470,100 +477,100 @@ var Re = { error: null }, Nn = function(t) {
470
477
  };
471
478
  var i = r.prototype;
472
479
  return i.reset = function() {
473
- this.setState(Re);
480
+ this.setState(Te);
474
481
  }, i.componentDidCatch = function(o, s) {
475
482
  var l, a;
476
483
  (l = (a = this.props).onError) == null || l.call(a, o, s);
477
484
  }, i.componentDidUpdate = function(o, s) {
478
- var l, a, c, u, d = this.state.error, f = this.props.resetKeys;
479
- d !== null && s.error !== null && ((c = o.resetKeys) === void 0 && (c = []), (u = f) === void 0 && (u = []), c.length !== u.length || c.some(function(p, g) {
480
- return !Object.is(p, u[g]);
485
+ var l, a, c, d, u = this.state.error, f = this.props.resetKeys;
486
+ u !== null && s.error !== null && ((c = o.resetKeys) === void 0 && (c = []), (d = f) === void 0 && (d = []), c.length !== d.length || c.some(function(m, g) {
487
+ return !Object.is(m, d[g]);
481
488
  })) && ((l = (a = this.props).onResetKeysChange) == null || l.call(a, o.resetKeys, f), this.reset());
482
489
  }, i.render = function() {
483
490
  var o = this.state.error, s = this.props, l = s.fallbackRender, a = s.FallbackComponent, c = s.fallback;
484
491
  if (o !== null) {
485
- var u = { error: o, resetErrorBoundary: this.resetErrorBoundary };
492
+ var d = { error: o, resetErrorBoundary: this.resetErrorBoundary };
486
493
  if (oe.isValidElement(c)) return c;
487
- if (typeof l == "function") return l(u);
488
- if (a) return oe.createElement(a, u);
494
+ if (typeof l == "function") return l(d);
495
+ if (a) return oe.createElement(a, d);
489
496
  throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
490
497
  }
491
498
  return this.props.children;
492
499
  }, r;
493
500
  }(oe.Component);
494
- function Ln({ children: t, onError: e }) {
495
- return w(Nn, { fallback: w("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
501
+ function Fn({ children: t, onError: e }) {
502
+ return E(Mn, { fallback: E("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: t });
496
503
  }
497
- const Dn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? O : x;
498
- function Rn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
499
- const [r] = D();
500
- return Dn(() => {
504
+ const On = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? A : x;
505
+ function Kn({ ignoreHistoryMergeTagChange: t = !0, ignoreSelectionChange: e = !1, onChange: n }) {
506
+ const [r] = T();
507
+ return On(() => {
501
508
  if (n) return r.registerUpdateListener(({ editorState: i, dirtyElements: o, dirtyLeaves: s, prevEditorState: l, tags: a }) => {
502
509
  e && o.size === 0 && s.size === 0 || t && a.has("history-merge") || l.isEmpty() || n(i, r, a);
503
510
  });
504
511
  }, [r, t, e, n]), null;
505
512
  }
506
- function Pn() {
507
- const [t] = D();
513
+ function zn() {
514
+ const [t] = T();
508
515
  return x(() => {
509
- if (!t.hasNodes([ze, Be])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
516
+ if (!t.hasNodes([Ae, Ue])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
510
517
  }, [t]), function(e) {
511
- x(() => Xt(e), [e]);
518
+ x(() => Zt(e), [e]);
512
519
  }(t), null;
513
520
  }
514
- function In({ validateUrl: t }) {
515
- const [e] = D();
521
+ function An({ validateUrl: t }) {
522
+ const [e] = T();
516
523
  return x(() => {
517
- if (!e.hasNodes([Ae])) throw new Error("LinkPlugin: LinkNode not registered on editor");
518
- return T(e.registerCommand(xe, (n) => {
524
+ if (!e.hasNodes([Be])) throw new Error("LinkPlugin: LinkNode not registered on editor");
525
+ return z(e.registerCommand(Se, (n) => {
519
526
  if (n === null) return ie(n), !0;
520
527
  if (typeof n == "string") return !(t !== void 0 && !t(n)) && (ie(n), !0);
521
528
  {
522
529
  const { url: r, target: i, rel: o, title: s } = n;
523
530
  return ie(r, { rel: o, target: i, title: s }), !0;
524
531
  }
525
- }, ve), t !== void 0 ? e.registerCommand(Te, (n) => {
526
- const r = h();
527
- if (!v(r) || r.isCollapsed() || !M(n, ClipboardEvent)) return !1;
532
+ }, ve), t !== void 0 ? e.registerCommand(Fe, (n) => {
533
+ const r = C();
534
+ if (!y(r) || r.isCollapsed() || !O(n, ClipboardEvent)) return !1;
528
535
  const i = n;
529
536
  if (i.clipboardData === null) return !1;
530
537
  const o = i.clipboardData.getData("text");
531
- return !!t(o) && !r.getNodes().some((s) => j(s)) && (e.dispatchCommand(xe, o), n.preventDefault(), !0);
538
+ return !!t(o) && !r.getNodes().some((s) => W(s)) && (e.dispatchCommand(Se, o), n.preventDefault(), !0);
532
539
  }, ve) : () => {
533
540
  });
534
541
  }, [e, t]), null;
535
542
  }
536
- function Mn({ newTab: t = !0, disabled: e = !1 }) {
537
- const [n] = D();
543
+ function Un({ newTab: t = !0, disabled: e = !1 }) {
544
+ const [n] = T();
538
545
  return x(() => {
539
546
  const r = (o) => {
540
547
  const s = o.target;
541
548
  if (!(s instanceof Node)) return;
542
- const l = _t(s);
549
+ const l = kt(s);
543
550
  if (l === null) return;
544
551
  let a = null, c = null;
545
552
  if (l.update(() => {
546
553
  const f = ne(s);
547
554
  if (f !== null) {
548
- const p = de(f, j);
549
- if (!e) if (Zt(p)) a = p.sanitizeUrl(p.getURL()), c = p.getTarget();
555
+ const m = ue(f, W);
556
+ if (!e) if (Yt(m)) a = m.sanitizeUrl(m.getURL()), c = m.getTarget();
550
557
  else {
551
- const g = function(y, $) {
552
- let C = y;
553
- for (; C != null; ) {
554
- if ($(C)) return C;
555
- C = C.parentNode;
558
+ const g = function(v, S) {
559
+ let h = v;
560
+ for (; h != null; ) {
561
+ if (S(h)) return h;
562
+ h = h.parentNode;
556
563
  }
557
564
  return null;
558
- }(s, kt);
565
+ }(s, Nt);
559
566
  g !== null && (a = g.href, c = g.target);
560
567
  }
561
568
  }
562
569
  }), a === null || a === "") return;
563
- const u = n.getEditorState().read(h);
564
- if (v(u) && !u.isCollapsed()) return void o.preventDefault();
565
- const d = o.type === "auxclick" && o.button === 1;
566
- window.open(a, t || d || o.metaKey || o.ctrlKey || c === "_blank" ? "_blank" : "_self"), o.preventDefault();
570
+ const d = n.getEditorState().read(C);
571
+ if (y(d) && !d.isCollapsed()) return void o.preventDefault();
572
+ const u = o.type === "auxclick" && o.button === 1;
573
+ window.open(a, t || u || o.metaKey || o.ctrlKey || c === "_blank" ? "_blank" : "_self"), o.preventDefault();
567
574
  }, i = (o) => {
568
575
  o.button === 1 && r(o);
569
576
  };
@@ -572,136 +579,136 @@ function Mn({ newTab: t = !0, disabled: e = !1 }) {
572
579
  });
573
580
  }, [n, t, e]), null;
574
581
  }
575
- const Y = 0, le = 1, ce = 2, k = 0, Tn = 1, Pe = 2, Fn = 3, Kn = 4;
576
- function On(t, e, n, r, i) {
577
- if (t === null || n.size === 0 && r.size === 0 && !i) return k;
582
+ const G = 0, le = 1, ce = 2, N = 0, Bn = 1, Pe = 2, jn = 3, Wn = 4;
583
+ function qn(t, e, n, r, i) {
584
+ if (t === null || n.size === 0 && r.size === 0 && !i) return N;
578
585
  const o = e._selection, s = t._selection;
579
- if (i) return Tn;
580
- if (!(v(o) && v(s) && s.isCollapsed() && o.isCollapsed())) return k;
581
- const l = function(C, E, b) {
582
- const _ = C._nodeMap, S = [];
583
- for (const N of E) {
584
- const P = _.get(N);
585
- P !== void 0 && S.push(P);
586
+ if (i) return Bn;
587
+ if (!(y(o) && y(s) && s.isCollapsed() && o.isCollapsed())) return N;
588
+ const l = function(h, w, b) {
589
+ const _ = h._nodeMap, $ = [];
590
+ for (const k of w) {
591
+ const P = _.get(k);
592
+ P !== void 0 && $.push(P);
586
593
  }
587
- for (const [N, P] of b) {
594
+ for (const [k, P] of b) {
588
595
  if (!P) continue;
589
- const B = _.get(N);
590
- B === void 0 || Fe(B) || S.push(B);
596
+ const B = _.get(k);
597
+ B === void 0 || Oe(B) || $.push(B);
591
598
  }
592
- return S;
599
+ return $;
593
600
  }(e, n, r);
594
- if (l.length === 0) return k;
601
+ if (l.length === 0) return N;
595
602
  if (l.length > 1) {
596
- const C = e._nodeMap, E = C.get(o.anchor.key), b = C.get(s.anchor.key);
597
- return E && b && !t._nodeMap.has(E.__key) && L(E) && E.__text.length === 1 && o.anchor.offset === 1 ? Pe : k;
603
+ const h = e._nodeMap, w = h.get(o.anchor.key), b = h.get(s.anchor.key);
604
+ return w && b && !t._nodeMap.has(w.__key) && D(w) && w.__text.length === 1 && o.anchor.offset === 1 ? Pe : N;
598
605
  }
599
606
  const a = l[0], c = t._nodeMap.get(a.__key);
600
- if (!L(c) || !L(a) || c.__mode !== a.__mode) return k;
601
- const u = c.__text, d = a.__text;
602
- if (u === d) return k;
603
- const f = o.anchor, p = s.anchor;
604
- if (f.key !== p.key || f.type !== "text") return k;
605
- const g = f.offset, y = p.offset, $ = d.length - u.length;
606
- return $ === 1 && y === g - 1 ? Pe : $ === -1 && y === g + 1 ? Fn : $ === -1 && y === g ? Kn : k;
607
- }
608
- function zn(t, e) {
609
- let n = Date.now(), r = k;
607
+ if (!D(c) || !D(a) || c.__mode !== a.__mode) return N;
608
+ const d = c.__text, u = a.__text;
609
+ if (d === u) return N;
610
+ const f = o.anchor, m = s.anchor;
611
+ if (f.key !== m.key || f.type !== "text") return N;
612
+ const g = f.offset, v = m.offset, S = u.length - d.length;
613
+ return S === 1 && v === g - 1 ? Pe : S === -1 && v === g + 1 ? jn : S === -1 && v === g ? Wn : N;
614
+ }
615
+ function Hn(t, e) {
616
+ let n = Date.now(), r = N;
610
617
  return (i, o, s, l, a, c) => {
611
- const u = Date.now();
612
- if (c.has("historic")) return r = k, n = u, ce;
613
- const d = On(i, o, l, a, t.isComposing()), f = (() => {
614
- const p = s === null || s.editor === t, g = c.has("history-push");
615
- if (!g && p && c.has("history-merge")) return Y;
618
+ const d = Date.now();
619
+ if (c.has("historic")) return r = N, n = d, ce;
620
+ const u = qn(i, o, l, a, t.isComposing()), f = (() => {
621
+ const m = s === null || s.editor === t, g = c.has("history-push");
622
+ if (!g && m && c.has("history-merge")) return G;
616
623
  if (i === null) return le;
617
- const y = o._selection;
618
- return l.size > 0 || a.size > 0 ? g === !1 && d !== k && d === r && u < n + e && p || l.size === 1 && function($, C, E) {
619
- const b = C._nodeMap.get($), _ = E._nodeMap.get($), S = C._selection, N = E._selection;
620
- return !(v(S) && v(N) && S.anchor.type === "element" && S.focus.type === "element" && N.anchor.type === "text" && N.focus.type === "text" || !L(b) || !L(_) || b.__parent !== _.__parent) && JSON.stringify(C.read(() => b.exportJSON())) === JSON.stringify(E.read(() => _.exportJSON()));
621
- }(Array.from(l)[0], i, o) ? Y : le : y !== null ? Y : ce;
624
+ const v = o._selection;
625
+ return l.size > 0 || a.size > 0 ? g === !1 && u !== N && u === r && d < n + e && m || l.size === 1 && function(S, h, w) {
626
+ const b = h._nodeMap.get(S), _ = w._nodeMap.get(S), $ = h._selection, k = w._selection;
627
+ return !(y($) && y(k) && $.anchor.type === "element" && $.focus.type === "element" && k.anchor.type === "text" && k.focus.type === "text" || !D(b) || !D(_) || b.__parent !== _.__parent) && JSON.stringify(h.read(() => b.exportJSON())) === JSON.stringify(w.read(() => _.exportJSON()));
628
+ }(Array.from(l)[0], i, o) ? G : le : v !== null ? G : ce;
622
629
  })();
623
- return n = u, r = d, f;
630
+ return n = d, r = u, f;
624
631
  };
625
632
  }
626
- function Ie(t) {
633
+ function Re(t) {
627
634
  t.undoStack = [], t.redoStack = [], t.current = null;
628
635
  }
629
- function Bn(t, e, n) {
630
- const r = zn(t, n);
631
- return T(t.registerCommand(Rt, () => (function(o, s) {
636
+ function Jn(t, e, n) {
637
+ const r = Hn(t, n);
638
+ return z(t.registerCommand(Pt, () => (function(o, s) {
632
639
  const l = s.redoStack, a = s.undoStack;
633
640
  if (a.length !== 0) {
634
- const c = s.current, u = a.pop();
635
- c !== null && (l.push(c), o.dispatchCommand(J, !0)), a.length === 0 && o.dispatchCommand(W, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
641
+ const c = s.current, d = a.pop();
642
+ c !== null && (l.push(c), o.dispatchCommand(J, !0)), a.length === 0 && o.dispatchCommand(V, !1), s.current = d || null, d && d.editor.setEditorState(d.editorState, { tag: "historic" });
636
643
  }
637
- }(t, e), !0), m), t.registerCommand(Dt, () => (function(o, s) {
644
+ }(t, e), !0), p), t.registerCommand(Tt, () => (function(o, s) {
638
645
  const l = s.redoStack, a = s.undoStack;
639
646
  if (l.length !== 0) {
640
647
  const c = s.current;
641
- c !== null && (a.push(c), o.dispatchCommand(W, !0));
642
- const u = l.pop();
643
- l.length === 0 && o.dispatchCommand(J, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: "historic" });
648
+ c !== null && (a.push(c), o.dispatchCommand(V, !0));
649
+ const d = l.pop();
650
+ l.length === 0 && o.dispatchCommand(J, !1), s.current = d || null, d && d.editor.setEditorState(d.editorState, { tag: "historic" });
644
651
  }
645
- }(t, e), !0), m), t.registerCommand(Lt, () => (Ie(e), !1), m), t.registerCommand(Nt, () => (Ie(e), t.dispatchCommand(J, !1), t.dispatchCommand(W, !1), !0), m), t.registerUpdateListener(({ editorState: o, prevEditorState: s, dirtyLeaves: l, dirtyElements: a, tags: c }) => {
646
- const u = e.current, d = e.redoStack, f = e.undoStack, p = u === null ? null : u.editorState;
647
- if (u !== null && o === p) return;
648
- const g = r(s, o, u, l, a, c);
649
- if (g === le) d.length !== 0 && (e.redoStack = [], t.dispatchCommand(J, !1)), u !== null && (f.push({ ...u }), t.dispatchCommand(W, !0));
652
+ }(t, e), !0), p), t.registerCommand(Dt, () => (Re(e), !1), p), t.registerCommand(Lt, () => (Re(e), t.dispatchCommand(J, !1), t.dispatchCommand(V, !1), !0), p), t.registerUpdateListener(({ editorState: o, prevEditorState: s, dirtyLeaves: l, dirtyElements: a, tags: c }) => {
653
+ const d = e.current, u = e.redoStack, f = e.undoStack, m = d === null ? null : d.editorState;
654
+ if (d !== null && o === m) return;
655
+ const g = r(s, o, d, l, a, c);
656
+ if (g === le) u.length !== 0 && (e.redoStack = [], t.dispatchCommand(J, !1)), d !== null && (f.push({ ...d }), t.dispatchCommand(V, !0));
650
657
  else if (g === ce) return;
651
658
  e.current = { editor: t, editorState: o };
652
659
  }));
653
660
  }
654
- function An() {
661
+ function Vn() {
655
662
  return { current: null, redoStack: [], undoStack: [] };
656
663
  }
657
- function Un({ delay: t, externalHistoryState: e }) {
658
- const [n] = D();
664
+ function Xn({ delay: t, externalHistoryState: e }) {
665
+ const [n] = T();
659
666
  return function(r, i, o = 1e3) {
660
- const s = V(() => i || An(), [i]);
661
- x(() => Bn(r, s, o), [o, r, s]);
667
+ const s = q(() => i || Vn(), [i]);
668
+ x(() => Jn(r, s, o), [o, r, s]);
662
669
  }(n, e, t), null;
663
670
  }
664
- function jn(t) {
671
+ function Zn(t) {
665
672
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
666
673
  }
667
- var G = jn(function(t) {
674
+ var Q = Zn(function(t) {
668
675
  const e = new URLSearchParams();
669
676
  e.append("code", t);
670
677
  for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
671
678
  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.`);
672
679
  });
673
- function Vn({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0 }) {
674
- const [r] = D();
675
- return x(() => (r.hasNodes([Q, ee, Oe]) || G(10), T(r.registerCommand(Bt, ({ columns: i, rows: o, includeHeaders: s }) => {
676
- const l = At(Number(o), Number(i), s);
680
+ function Yn({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandler: n = !0 }) {
681
+ const [r] = T();
682
+ return x(() => (r.hasNodes([ee, te, ze]) || Q(10), z(r.registerCommand(Ut, ({ columns: i, rows: o, includeHeaders: s }) => {
683
+ const l = Bt(Number(o), Number(i), s);
677
684
  Kt(l);
678
685
  const a = l.getFirstDescendant();
679
- return L(a) && a.select(), !0;
680
- }, m), r.registerNodeTransform(Q, (i) => {
681
- const [o] = zt(i, null, null), s = o.reduce((a, c) => Math.max(a, c.length), 0), l = i.getChildren();
686
+ return D(a) && a.select(), !0;
687
+ }, p), r.registerNodeTransform(ee, (i) => {
688
+ const [o] = At(i, null, null), s = o.reduce((a, c) => Math.max(a, c.length), 0), l = i.getChildren();
682
689
  for (let a = 0; a < o.length; ++a) {
683
690
  const c = l[a];
684
691
  if (!c) continue;
685
- const u = o[a].reduce((d, f) => f ? 1 + d : d, 0);
686
- if (u !== s) for (let d = u; d < s; ++d) {
692
+ const d = o[a].reduce((u, f) => f ? 1 + u : u, 0);
693
+ if (d !== s) for (let u = d; u < s; ++u) {
687
694
  const f = $e(0);
688
- f.append(ue()), c.append(f);
695
+ f.append(de()), c.append(f);
689
696
  }
690
697
  }
691
698
  }))), [r]), x(() => {
692
699
  const i = /* @__PURE__ */ new Map(), o = (l, a, c) => {
693
- const u = c, d = Jt(l, u, r, n);
694
- i.set(a, [d, u]);
695
- }, s = r.registerMutationListener(Q, (l) => {
700
+ const d = c, u = Jt(l, d, r, n);
701
+ i.set(a, [u, d]);
702
+ }, s = r.registerMutationListener(ee, (l) => {
696
703
  for (const [a, c] of l) if (c === "created" || c === "updated") {
697
- const u = i.get(a), d = r.getElementByKey(a);
698
- u && d === u[1] || (u && (u[0].removeListeners(), i.delete(a)), d !== null && r.getEditorState().read(() => {
699
- const f = Pt(a);
700
- Ut(f) && o(f, a, d);
704
+ const d = i.get(a), u = r.getElementByKey(a);
705
+ d && u === d[1] || (d && (d[0].removeListeners(), i.delete(a)), u !== null && r.getEditorState().read(() => {
706
+ const f = Rt(a);
707
+ jt(f) && o(f, a, u);
701
708
  }));
702
709
  } else if (c === "destroyed") {
703
- const u = i.get(a);
704
- u !== void 0 && (u[0].removeListeners(), i.delete(a));
710
+ const d = i.get(a);
711
+ d !== void 0 && (d[0].removeListeners(), i.delete(a));
705
712
  }
706
713
  }, { skipInitialization: !1 });
707
714
  return () => {
@@ -709,90 +716,158 @@ function Vn({ hasCellMerge: t = !0, hasCellBackgroundColor: e = !0, hasTabHandle
709
716
  for (const [, [l]] of i) l.removeListeners();
710
717
  };
711
718
  }, [r, n]), x(() => {
712
- if (!t) return r.registerNodeTransform(ee, (i) => {
719
+ if (!t) return r.registerNodeTransform(te, (i) => {
713
720
  if (i.getColSpan() > 1 || i.getRowSpan() > 1) {
714
- const [, , o] = jt(i), [s] = Vt(o, i, i), l = s.length, a = s[0].length;
721
+ const [, , o] = Wt(i), [s] = qt(o, i, i), l = s.length, a = s[0].length;
715
722
  let c = o.getFirstChild();
716
- Se(c) || G(175);
717
- const u = [];
718
- for (let d = 0; d < l; d++) {
719
- d !== 0 && (c = c.getNextSibling(), Se(c) || G(175));
723
+ _e(c) || Q(175);
724
+ const d = [];
725
+ for (let u = 0; u < l; u++) {
726
+ u !== 0 && (c = c.getNextSibling(), _e(c) || Q(175));
720
727
  let f = null;
721
- for (let p = 0; p < a; p++) {
722
- const g = s[d][p], y = g.cell;
723
- if (g.startRow === d && g.startColumn === p) f = y, u.push(y);
724
- else if (y.getColSpan() > 1 || y.getRowSpan() > 1) {
725
- qt(y) || G(176);
726
- const $ = $e(y.__headerState);
727
- f !== null ? f.insertAfter($) : Ot(c, $);
728
+ for (let m = 0; m < a; m++) {
729
+ const g = s[u][m], v = g.cell;
730
+ if (g.startRow === u && g.startColumn === m) f = v, d.push(v);
731
+ else if (v.getColSpan() > 1 || v.getRowSpan() > 1) {
732
+ Ht(v) || Q(176);
733
+ const S = $e(v.__headerState);
734
+ f !== null ? f.insertAfter(S) : zt(c, S);
728
735
  }
729
736
  }
730
737
  }
731
- for (const d of u) d.setColSpan(1), d.setRowSpan(1);
738
+ for (const u of d) u.setColSpan(1), u.setRowSpan(1);
732
739
  }
733
740
  });
734
741
  }, [r, t]), x(() => {
735
- if (!e) return r.registerNodeTransform(ee, (i) => {
742
+ if (!e) return r.registerNodeTransform(te, (i) => {
736
743
  i.getBackgroundColor() !== null && i.setBackgroundColor(null);
737
744
  });
738
745
  }, [r, e, t]), null;
739
746
  }
740
- const Cr = ({
747
+ const He = 200, Gn = (t) => /^<(b|i|u|strong|em|mark|small|del|ins|sub|sup|div|p|span|h[1-6]|a|img|table|tr|td|th|ul|ol|li|blockquote|pre|code|br)(\s+[^>]*)?>/i.test(t.trim()), Qn = ({
741
748
  namespace: t = "UvaEditor",
742
- initialValue: e = "",
743
- placeholder: n = "",
744
- onChange: r
749
+ currentLanguage: e = "NL",
750
+ initialValue: n = "",
751
+ placeholder: r = "",
752
+ label: i = "",
753
+ info: o = "",
754
+ required: s = !1,
755
+ notValidatedText: l = "",
756
+ maxWords: a = He,
757
+ onChange: c
745
758
  }) => {
746
- const i = {
759
+ const { switchLanguage: d } = cn(), u = sn(), [f] = M(() => Me()), [m, g] = M(0), v = {
747
760
  namespace: t,
748
- theme: nn,
749
- onError(s) {
750
- throw s;
761
+ editor: f,
762
+ theme: an,
763
+ onError(h) {
764
+ throw h;
751
765
  },
752
- nodes: [ze, Be, Ae, en, ee, Oe, Q],
753
- editorState: (s) => {
754
- const a = new DOMParser().parseFromString(e, "text/html"), c = Wt(s, a), u = F();
755
- u.clear();
756
- const d = ue();
757
- c.forEach((f) => d.append(f)), u.append(d);
766
+ nodes: [Ae, Ue, Be, tn, te, ze, ee],
767
+ editorState: (h) => {
768
+ const b = new DOMParser().parseFromString(n, "text/html"), _ = Vt(h, b), $ = K();
769
+ if ($.clear(), Gn(n))
770
+ _.forEach((k) => {
771
+ $.append(k);
772
+ });
773
+ else {
774
+ const k = de();
775
+ _.forEach((P) => {
776
+ k.append(P);
777
+ }), $.append(k);
778
+ }
758
779
  }
759
- }, o = (s, l) => {
760
- s.read(() => {
761
- const a = Ht(l);
762
- r(a);
780
+ }, S = (h, w) => {
781
+ h.read(() => {
782
+ const b = K().getTextContent().replace(/\s+/g, " ").trim();
783
+ g(b.split(" ").length);
784
+ const _ = Xt(w);
785
+ c(_);
763
786
  });
764
787
  };
765
- return /* @__PURE__ */ w("div", { className: A.editor__wrapper, children: /* @__PURE__ */ te(on, { initialConfig: i, children: [
766
- /* @__PURE__ */ w(tn, {}),
767
- /* @__PURE__ */ te("div", { className: A["editor__field-wrapper"], children: [
768
- /* @__PURE__ */ w(
769
- En,
788
+ return x(() => {
789
+ d(e.toLocaleLowerCase());
790
+ }, [e, d]), /* @__PURE__ */ I("div", { className: L.editor__container, children: [
791
+ /* @__PURE__ */ I("div", { className: L.editor__header, children: [
792
+ /* @__PURE__ */ E(ln, { label: i, info: o, required: s }),
793
+ m !== 0 && /* @__PURE__ */ I(
794
+ "div",
770
795
  {
771
- contentEditable: /* @__PURE__ */ w(
772
- xn,
773
- {
774
- className: A.editor__field,
775
- "aria-label": "Rich text editor content",
776
- "aria-placeholder": n,
777
- title: "Rich text editor content",
778
- placeholder: /* @__PURE__ */ w("div", { className: A.editor__placeholder, children: n })
779
- }
780
- ),
781
- placeholder: /* @__PURE__ */ w("div", { className: A.editor__placeholder, children: n }),
782
- ErrorBoundary: Ln
796
+ className: nn(L["editor__header-word-count"], {
797
+ [L["editor__header-word-count--alert"]]: m > a
798
+ }),
799
+ children: [
800
+ m,
801
+ " / ",
802
+ a
803
+ ]
783
804
  }
784
- ),
785
- /* @__PURE__ */ w(Vn, {}),
786
- /* @__PURE__ */ w(Un, {}),
787
- /* @__PURE__ */ w(Pn, {}),
788
- /* @__PURE__ */ w(In, { validateUrl: Yt }),
789
- /* @__PURE__ */ w(Gt, { matchers: Qt }),
790
- /* @__PURE__ */ w(Mn, {}),
791
- /* @__PURE__ */ w(Rn, { onChange: o })
805
+ )
806
+ ] }),
807
+ /* @__PURE__ */ E("div", { className: L.editor, children: /* @__PURE__ */ I(fn, { initialConfig: v, children: [
808
+ /* @__PURE__ */ E(rn, {}),
809
+ /* @__PURE__ */ I("div", { className: L["editor__field-wrapper"], children: [
810
+ /* @__PURE__ */ E(
811
+ Nn,
812
+ {
813
+ contentEditable: /* @__PURE__ */ E(
814
+ Pn,
815
+ {
816
+ className: L.editor__field,
817
+ "aria-label": u.common.rteAriaLabel,
818
+ "aria-placeholder": r,
819
+ title: u.common.rteTitle,
820
+ placeholder: /* @__PURE__ */ E("div", { className: L.editor__placeholder, children: r }),
821
+ spellCheck: !1,
822
+ id: "rteEditor"
823
+ }
824
+ ),
825
+ placeholder: /* @__PURE__ */ E("div", { className: L.editor__placeholder, children: r }),
826
+ ErrorBoundary: Fn
827
+ }
828
+ ),
829
+ /* @__PURE__ */ E(Yn, {}),
830
+ /* @__PURE__ */ E(Xn, {}),
831
+ /* @__PURE__ */ E(zn, {}),
832
+ /* @__PURE__ */ E(An, { validateUrl: Gt }),
833
+ /* @__PURE__ */ E(Qt, { matchers: en }),
834
+ /* @__PURE__ */ E(Un, {}),
835
+ /* @__PURE__ */ E(Kn, { onChange: S })
836
+ ] })
837
+ ] }) }),
838
+ l !== "" && /* @__PURE__ */ I("div", { className: L.editor__error, children: [
839
+ /* @__PURE__ */ E(on, { name: "ExclamationTriangleFill", size: 24 }),
840
+ l
792
841
  ] })
793
- ] }) });
794
- };
842
+ ] });
843
+ }, Mr = ({
844
+ namespace: t = "UvaEditor",
845
+ currentLanguage: e = "NL",
846
+ initialValue: n = "",
847
+ placeholder: r = "",
848
+ label: i = "",
849
+ info: o = "",
850
+ required: s = !1,
851
+ notValidatedText: l = "",
852
+ maxWords: a = He,
853
+ onChange: c
854
+ }) => /* @__PURE__ */ E(dn, { children: /* @__PURE__ */ E(
855
+ Qn,
856
+ {
857
+ namespace: t,
858
+ currentLanguage: e,
859
+ initialValue: n,
860
+ placeholder: r,
861
+ label: i,
862
+ info: o,
863
+ required: s,
864
+ notValidatedText: l,
865
+ maxWords: a,
866
+ onChange: c
867
+ }
868
+ ) });
795
869
  export {
796
- Cr as RteEditor
870
+ Qn as Rte,
871
+ Mr as RteEditor
797
872
  };
798
873
  //# sourceMappingURL=RteEditor.js.map