@uva-glass/component-library 3.2.1 → 3.2.2

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 (52) hide show
  1. package/dist/{Lexical.prod-Bu-Iw9VX.js → Lexical.prod-CniF7zEE.js} +670 -666
  2. package/dist/Lexical.prod-CniF7zEE.js.map +1 -0
  3. package/dist/{LexicalClipboard.prod-C5dHfEke.js → LexicalClipboard.prod-BXVNkwwS.js} +42 -42
  4. package/dist/{LexicalClipboard.prod-C5dHfEke.js.map → LexicalClipboard.prod-BXVNkwwS.js.map} +1 -1
  5. package/dist/{LexicalLink.prod-DdERpPPj.js → LexicalLink.prod-Du8ZoNsh.js} +3 -3
  6. package/dist/{LexicalLink.prod-DdERpPPj.js.map → LexicalLink.prod-Du8ZoNsh.js.map} +1 -1
  7. package/dist/{LexicalList.prod-CzJqqstH.js → LexicalList.prod-BUcoZhe4.js} +35 -35
  8. package/dist/{LexicalList.prod-CzJqqstH.js.map → LexicalList.prod-BUcoZhe4.js.map} +1 -1
  9. package/dist/{LexicalSelection.prod-CkM-3E0b.js → LexicalSelection.prod-BfAlhGGm.js} +25 -25
  10. package/dist/{LexicalSelection.prod-CkM-3E0b.js.map → LexicalSelection.prod-BfAlhGGm.js.map} +1 -1
  11. package/dist/{LexicalTable.prod-BsmIydKv.js → LexicalTable.prod-CYafu_j9.js} +458 -453
  12. package/dist/LexicalTable.prod-CYafu_j9.js.map +1 -0
  13. package/dist/{LexicalUtils.prod-BVZbsLIa.js → LexicalUtils.prod-DVr8VsHc.js} +36 -36
  14. package/dist/{LexicalUtils.prod-BVZbsLIa.js.map → LexicalUtils.prod-DVr8VsHc.js.map} +1 -1
  15. package/dist/{TablePlugin-DKzssVbg.js → TablePlugin-MjKuocl4.js} +53 -53
  16. package/dist/{TablePlugin-DKzssVbg.js.map → TablePlugin-MjKuocl4.js.map} +1 -1
  17. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  18. package/dist/components/FormInput/FormInput.js +1 -1
  19. package/dist/components/InputField/InputField.stories.js +1 -1
  20. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  21. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  22. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  23. package/dist/components/MultiSelect/index.js +1 -1
  24. package/dist/components/OverlayStepBar/OverlayStepBar.js +1 -1
  25. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  26. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  27. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  28. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +11 -11
  29. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
  30. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
  31. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
  32. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +29 -29
  33. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  34. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +26 -26
  35. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
  36. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  37. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +3 -3
  38. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +14 -14
  39. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  40. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +22 -22
  41. package/dist/components/RteEditor/Plugins/index.js +1 -1
  42. package/dist/components/RteEditor/RteEditor.js +116 -116
  43. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  44. package/dist/components/RteEditor/helpers.js +4 -4
  45. package/dist/components/Timeline/Timeline.test.js +1 -1
  46. package/dist/components/index.js +1 -1
  47. package/dist/{helpers-D13uK95u.js → helpers-ChM6xtQG.js} +63 -63
  48. package/dist/{helpers-D13uK95u.js.map → helpers-ChM6xtQG.js.map} +1 -1
  49. package/dist/index.js +1 -1
  50. package/package.json +5 -5
  51. package/dist/Lexical.prod-Bu-Iw9VX.js.map +0 -1
  52. package/dist/LexicalTable.prod-BsmIydKv.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { w as N, r as X, i as se, _ as mt, j as Et, N as $t, T as pt, S as Mt, L as zt } from "./LexicalUtils.prod-BVZbsLIa.js";
2
- import { f as Pe, e as ye, U as He, J as Lt, X as ce, O as Ze, T as j, Q as We, _ as Pt, h as Ct, r as V, i as Ht, N as Oe, j as _t, l as z, o as Wt, n as de, d as H, a as L, k as be, m as Bt, p as Dt, q as It, s as Jt, F as Ae, A as Xt, u as Yt, v as St, x as qt, y as I, z as Ut, L as jt, B as Vt, G as Qt, I as Gt, M as Zt, P as en, R as tn, S as re, V as et, g as q, W as Te, Z as nn, b as wt, a0 as on, w as bt, a1 as rn, $ as ln, a2 as Ne, a3 as sn, a4 as an, a5 as tt, a6 as cn, a7 as nt, D as un, a8 as ot, c as rt, Y as Ce, a9 as hn, C as dn, aa as fn, ab as gn } from "./Lexical.prod-Bu-Iw9VX.js";
3
- import { _ as mn, M as pn } from "./LexicalClipboard.prod-C5dHfEke.js";
4
- const Be = /^(\d+(?:\.\d+)?)px$/, D = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
1
+ import { w as N, r as Y, i as se, _ as mt, j as kt, N as $t, T as pt, S as Mt, L as zt } from "./LexicalUtils.prod-DVr8VsHc.js";
2
+ import { d as Pe, r as fe, H as We, $ as Lt, Y as ce, M as et, w as j, X as De, m as Ht, f as Ct, s as V, g as Pt, E as Oe, i as _t, c as z, o as Wt, j as de, h as P, a as L, k as ke, l as ye, p as Dt, q as Bt, v as It, x as Jt, A as Ae, y as Yt, z as Xt, D as St, F as qt, L as I, G as Ut, I as jt, K as Vt, O as Zt, R as Gt, S as Qt, T as en, V as tn, W as re, u as q, Z as Te, _ as nn, b as wt, a0 as on, N as bt, a1 as rn, U as ln, a2 as Ne, a3 as sn, a4 as an, a5 as tt, a6 as cn, a7 as nt, B as un, a8 as ot, e as rt, t as _e, a9 as hn, C as dn, aa as fn, ab as gn } from "./Lexical.prod-CniF7zEE.js";
3
+ import { _ as mn, M as pn } from "./LexicalClipboard.prod-BXVNkwwS.js";
4
+ const Be = /^(\d+(?:\.\d+)?)px$/, B = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
5
5
  class ee extends Pe {
6
6
  static getType() {
7
7
  return "tablecell";
@@ -16,28 +16,28 @@ class ee extends Pe {
16
16
  return { td: (e) => ({ conversion: lt, priority: 0 }), th: (e) => ({ conversion: lt, priority: 0 }) };
17
17
  }
18
18
  static importJSON(e) {
19
- return ge().updateFromJSON(e);
19
+ return me().updateFromJSON(e);
20
20
  }
21
21
  updateFromJSON(e) {
22
22
  return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan || 1).setRowSpan(e.rowSpan || 1).setWidth(e.width || void 0).setBackgroundColor(e.backgroundColor || null).setVerticalAlign(e.verticalAlign || void 0);
23
23
  }
24
- constructor(e = D.NO_STATUS, t = 1, o, r) {
25
- super(r), this.__colSpan = t, this.__rowSpan = 1, this.__headerState = e, this.__width = o, this.__backgroundColor = null, this.__verticalAlign = void 0;
24
+ constructor(e = B.NO_STATUS, t = 1, o, l) {
25
+ super(l), this.__colSpan = t, this.__rowSpan = 1, this.__headerState = e, this.__width = o, this.__backgroundColor = null, this.__verticalAlign = void 0;
26
26
  }
27
27
  createDOM(e) {
28
28
  const t = document.createElement(this.getTag());
29
- return this.__width && (t.style.width = `${this.__width}px`), this.__colSpan > 1 && (t.colSpan = this.__colSpan), this.__rowSpan > 1 && (t.rowSpan = this.__rowSpan), this.__backgroundColor !== null && (t.style.backgroundColor = this.__backgroundColor), Ee(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), X(t, e.theme.tableCell, this.hasHeader() && e.theme.tableCellHeader), t;
29
+ return this.__width && (t.style.width = `${this.__width}px`), this.__colSpan > 1 && (t.colSpan = this.__colSpan), this.__rowSpan > 1 && (t.rowSpan = this.__rowSpan), this.__backgroundColor !== null && (t.style.backgroundColor = this.__backgroundColor), $e(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), Y(t, e.theme.tableCell, this.hasHeader() && e.theme.tableCellHeader), t;
30
30
  }
31
31
  exportDOM(e) {
32
32
  const t = super.exportDOM(e);
33
- if (ye(t.element)) {
33
+ if (fe(t.element)) {
34
34
  const o = t.element;
35
35
  o.setAttribute("data-temporary-table-cell-lexical-key", this.getKey()), o.style.border = "1px solid black", this.__colSpan > 1 && (o.colSpan = this.__colSpan), this.__rowSpan > 1 && (o.rowSpan = this.__rowSpan), o.style.width = `${this.getWidth() || 75}px`, o.style.verticalAlign = this.getVerticalAlign() || "top", o.style.textAlign = "start", this.__backgroundColor === null && this.hasHeader() && (o.style.backgroundColor = "#f2f3f5");
36
36
  }
37
37
  return t;
38
38
  }
39
39
  exportJSON() {
40
- return { ...super.exportJSON(), ...Ee(this.__verticalAlign) && { verticalAlign: this.__verticalAlign }, backgroundColor: this.getBackgroundColor(), colSpan: this.__colSpan, headerState: this.__headerState, rowSpan: this.__rowSpan, width: this.getWidth() };
40
+ return { ...super.exportJSON(), ...$e(this.__verticalAlign) && { verticalAlign: this.__verticalAlign }, backgroundColor: this.getBackgroundColor(), colSpan: this.__colSpan, headerState: this.__headerState, rowSpan: this.__rowSpan, width: this.getWidth() };
41
41
  }
42
42
  getColSpan() {
43
43
  return this.getLatest().__colSpan;
@@ -56,7 +56,7 @@ class ee extends Pe {
56
56
  getTag() {
57
57
  return this.hasHeader() ? "th" : "td";
58
58
  }
59
- setHeaderStyles(e, t = D.BOTH) {
59
+ setHeaderStyles(e, t = B.BOTH) {
60
60
  const o = this.getWritable();
61
61
  return o.__headerState = e & t | o.__headerState & ~t, o;
62
62
  }
@@ -92,7 +92,7 @@ class ee extends Pe {
92
92
  return (this.getHeaderStyles() & e) === e;
93
93
  }
94
94
  hasHeader() {
95
- return this.getLatest().__headerState !== D.NO_STATUS;
95
+ return this.getLatest().__headerState !== B.NO_STATUS;
96
96
  }
97
97
  updateDOM(e) {
98
98
  return e.__headerState !== this.__headerState || e.__width !== this.__width || e.__colSpan !== this.__colSpan || e.__rowSpan !== this.__rowSpan || e.__backgroundColor !== this.__backgroundColor || e.__verticalAlign !== this.__verticalAlign;
@@ -110,19 +110,19 @@ class ee extends Pe {
110
110
  return !1;
111
111
  }
112
112
  }
113
- function Ee(n) {
113
+ function $e(n) {
114
114
  return n === "middle" || n === "bottom";
115
115
  }
116
116
  function lt(n) {
117
117
  const e = n, t = n.nodeName.toLowerCase();
118
118
  let o;
119
119
  Be.test(e.style.width) && (o = parseFloat(e.style.width));
120
- const r = ge(t === "th" ? D.ROW : D.NO_STATUS, e.colSpan, o);
121
- r.__rowSpan = e.rowSpan;
120
+ const l = me(t === "th" ? B.ROW : B.NO_STATUS, e.colSpan, o);
121
+ l.__rowSpan = e.rowSpan;
122
122
  const s = e.style.backgroundColor;
123
- s !== "" && (r.__backgroundColor = s);
124
- const l = e.style.verticalAlign;
125
- Ee(l) && (r.__verticalAlign = l);
123
+ s !== "" && (l.__backgroundColor = s);
124
+ const r = e.style.verticalAlign;
125
+ $e(r) && (l.__verticalAlign = r);
126
126
  const i = e.style, c = (i && i.textDecoration || "").split(" "), f = i.fontWeight === "700" || i.fontWeight === "bold", h = c.includes("line-through"), p = i.fontStyle === "italic", C = c.includes("underline");
127
127
  return { after: (a) => {
128
128
  const u = [];
@@ -130,15 +130,15 @@ function lt(n) {
130
130
  const d = () => {
131
131
  if (g) {
132
132
  const m = g.getFirstChild();
133
- Ze(m) && g.getChildrenSize() === 1 && m.remove();
133
+ et(m) && g.getChildrenSize() === 1 && m.remove();
134
134
  }
135
135
  };
136
- for (const m of a) Lt(m) || ce(m) || Ze(m) ? (ce(m) && (f && m.toggleFormat("bold"), h && m.toggleFormat("strikethrough"), p && m.toggleFormat("italic"), C && m.toggleFormat("underline")), g ? g.append(m) : (g = j().append(m), u.push(g))) : (u.push(m), d(), g = null);
136
+ for (const m of a) Lt(m) || ce(m) || et(m) ? (ce(m) && (f && m.toggleFormat("bold"), h && m.toggleFormat("strikethrough"), p && m.toggleFormat("italic"), C && m.toggleFormat("underline")), g ? g.append(m) : (g = j().append(m), u.push(g))) : (u.push(m), d(), g = null);
137
137
  return d(), u.length === 0 && u.push(j()), u;
138
- }, node: r };
138
+ }, node: l };
139
139
  }
140
- function ge(n = D.NO_STATUS, e = 1, t) {
141
- return He(new ee(n, e, t));
140
+ function me(n = B.NO_STATUS, e = 1, t) {
141
+ return We(new ee(n, e, t));
142
142
  }
143
143
  function S(n) {
144
144
  return n instanceof ee;
@@ -147,21 +147,21 @@ const Cn = Wt();
147
147
  function w(n, ...e) {
148
148
  const t = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
149
149
  o.append("code", n);
150
- for (const r of e) o.append("v", r);
150
+ for (const l of e) o.append("v", l);
151
151
  throw t.search = o.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
152
152
  }
153
- class me extends Pe {
153
+ class pe extends Pe {
154
154
  static getType() {
155
155
  return "tablerow";
156
156
  }
157
157
  static clone(e) {
158
- return new me(e.__height, e.__key);
158
+ return new pe(e.__height, e.__key);
159
159
  }
160
160
  static importDOM() {
161
161
  return { tr: (e) => ({ conversion: _n, priority: 0 }) };
162
162
  }
163
163
  static importJSON(e) {
164
- return De().updateFromJSON(e);
164
+ return Ie().updateFromJSON(e);
165
165
  }
166
166
  updateFromJSON(e) {
167
167
  return super.updateFromJSON(e).setHeight(e.height);
@@ -175,7 +175,7 @@ class me extends Pe {
175
175
  }
176
176
  createDOM(e) {
177
177
  const t = document.createElement("tr");
178
- return this.__height && (t.style.height = `${this.__height}px`), X(t, e.theme.tableRow), t;
178
+ return this.__height && (t.style.height = `${this.__height}px`), Y(t, e.theme.tableRow), t;
179
179
  }
180
180
  extractWithChild(e, t, o) {
181
181
  return o === "html";
@@ -203,24 +203,24 @@ class me extends Pe {
203
203
  function _n(n) {
204
204
  const e = n;
205
205
  let t;
206
- return Be.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => mt(o, S), node: De(t) };
206
+ return Be.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => mt(o, S), node: Ie(t) };
207
207
  }
208
- function De(n) {
209
- return He(new me(n));
208
+ function Ie(n) {
209
+ return We(new pe(n));
210
210
  }
211
- function E(n) {
212
- return n instanceof me;
211
+ function k(n) {
212
+ return n instanceof pe;
213
213
  }
214
- const Ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Sn = Ie && "documentMode" in document ? document.documentMode : null, st = Ie && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
214
+ const Je = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Sn = Je && "documentMode" in document ? document.documentMode : null, st = Je && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
215
215
  function wn(n, e, t = !0) {
216
- const o = qe();
217
- for (let r = 0; r < n; r++) {
218
- const s = De();
219
- for (let l = 0; l < e; l++) {
220
- let i = D.NO_STATUS;
221
- typeof t == "object" ? (r === 0 && t.rows && (i |= D.ROW), l === 0 && t.columns && (i |= D.COLUMN)) : t && (r === 0 && (i |= D.ROW), l === 0 && (i |= D.COLUMN));
222
- const c = ge(i), f = j();
223
- f.append(We()), c.append(f), s.append(c);
216
+ const o = Ue();
217
+ for (let l = 0; l < n; l++) {
218
+ const s = Ie();
219
+ for (let r = 0; r < e; r++) {
220
+ let i = B.NO_STATUS;
221
+ typeof t == "object" ? (l === 0 && t.rows && (i |= B.ROW), r === 0 && t.columns && (i |= B.COLUMN)) : t && (l === 0 && (i |= B.ROW), r === 0 && (i |= B.COLUMN));
222
+ const c = me(i), f = j();
223
+ f.append(De()), c.append(f), s.append(c);
224
224
  }
225
225
  o.append(s);
226
226
  }
@@ -231,8 +231,8 @@ function In(n) {
231
231
  return S(e) ? e : null;
232
232
  }
233
233
  function yt(n) {
234
- const e = N(n, (t) => E(t));
235
- if (E(e)) return e;
234
+ const e = N(n, (t) => k(t));
235
+ if (k(e)) return e;
236
236
  throw new Error("Expected table cell to be inside of table row.");
237
237
  }
238
238
  function bn(n) {
@@ -244,16 +244,16 @@ function Jn(n) {
244
244
  const e = yt(n);
245
245
  return bn(e).getChildren().findIndex((t) => t.is(e));
246
246
  }
247
- function Xn(n) {
247
+ function Yn(n) {
248
248
  return yt(n).getChildren().findIndex((e) => e.is(n));
249
249
  }
250
- Ie && "InputEvent" in window && !Sn && new window.InputEvent("input");
251
- function Yn(n, e) {
250
+ Je && "InputEvent" in window && !Sn && new window.InputEvent("input");
251
+ function Xn(n, e) {
252
252
  const t = n.getChildren();
253
253
  for (let o = 0; o < t.length; o++) {
254
- const r = t[o];
255
- if (E(r)) {
256
- const s = r.getChildren();
254
+ const l = t[o];
255
+ if (k(l)) {
256
+ const s = l.getChildren();
257
257
  if (e >= s.length || e < 0) throw new Error("Table column target index out of range");
258
258
  s[e].remove();
259
259
  }
@@ -261,74 +261,74 @@ function Yn(n, e) {
261
261
  return n;
262
262
  }
263
263
  function U(n, e, t) {
264
- const [o, r, s] = Je(n, e, t);
265
- return r === null && w(207), s === null && w(208), [o, r, s];
264
+ const [o, l, s] = Ye(n, e, t);
265
+ return l === null && w(207), s === null && w(208), [o, l, s];
266
266
  }
267
- function Je(n, e, t) {
267
+ function Ye(n, e, t) {
268
268
  const o = [];
269
- let r = null, s = null;
270
- function l(c) {
269
+ let l = null, s = null;
270
+ function r(c) {
271
271
  let f = o[c];
272
272
  return f === void 0 && (o[c] = f = []), f;
273
273
  }
274
274
  const i = n.getChildren();
275
275
  for (let c = 0; c < i.length; c++) {
276
276
  const f = i[c];
277
- E(f) || w(209);
278
- const h = l(c);
277
+ k(f) || w(209);
278
+ const h = r(c);
279
279
  for (let p = f.getFirstChild(), C = 0; p != null; p = p.getNextSibling()) {
280
280
  for (S(p) || w(147); h[C] !== void 0; ) C++;
281
281
  const a = { cell: p, startColumn: C, startRow: c }, { __rowSpan: u, __colSpan: g } = p;
282
282
  for (let d = 0; d < u && !(c + d >= i.length); d++) {
283
- const m = l(c + d);
283
+ const m = r(c + d);
284
284
  for (let _ = 0; _ < g; _++) m[C + _] = a;
285
285
  }
286
- e !== null && r === null && e.is(p) && (r = a), t !== null && s === null && t.is(p) && (s = a);
286
+ e !== null && l === null && e.is(p) && (l = a), t !== null && s === null && t.is(p) && (s = a);
287
287
  }
288
288
  }
289
- return [o, r, s];
289
+ return [o, l, s];
290
290
  }
291
291
  function le(n) {
292
292
  let e;
293
293
  if (n instanceof ee) e = n;
294
294
  else if ("__type" in n) {
295
- const r = N(n, S);
296
- S(r) || w(148), e = r;
295
+ const l = N(n, S);
296
+ S(l) || w(148), e = l;
297
297
  } else {
298
- const r = N(n.getNode(), S);
299
- S(r) || w(148), e = r;
298
+ const l = N(n.getNode(), S);
299
+ S(l) || w(148), e = l;
300
300
  }
301
301
  const t = e.getParent();
302
- E(t) || w(149);
302
+ k(t) || w(149);
303
303
  const o = t.getParent();
304
304
  return O(o) || w(210), [e, t, o];
305
305
  }
306
- function $e(n, e, t) {
307
- let o, r = Math.min(e.startColumn, t.startColumn), s = Math.min(e.startRow, t.startRow), l = Math.max(e.startColumn + e.cell.__colSpan - 1, t.startColumn + t.cell.__colSpan - 1), i = Math.max(e.startRow + e.cell.__rowSpan - 1, t.startRow + t.cell.__rowSpan - 1);
306
+ function Me(n, e, t) {
307
+ let o, l = Math.min(e.startColumn, t.startColumn), s = Math.min(e.startRow, t.startRow), r = Math.max(e.startColumn + e.cell.__colSpan - 1, t.startColumn + t.cell.__colSpan - 1), i = Math.max(e.startRow + e.cell.__rowSpan - 1, t.startRow + t.cell.__rowSpan - 1);
308
308
  do {
309
309
  o = !1;
310
310
  for (let c = 0; c < n.length; c++) for (let f = 0; f < n[0].length; f++) {
311
311
  const h = n[c][f];
312
312
  if (!h) continue;
313
- const p = h.startColumn + h.cell.__colSpan - 1, C = h.startRow + h.cell.__rowSpan - 1, a = h.startColumn <= l && p >= r, u = h.startRow <= i && C >= s;
313
+ const p = h.startColumn + h.cell.__colSpan - 1, C = h.startRow + h.cell.__rowSpan - 1, a = h.startColumn <= r && p >= l, u = h.startRow <= i && C >= s;
314
314
  if (a && u) {
315
- const g = Math.min(r, h.startColumn), d = Math.max(l, p), m = Math.min(s, h.startRow), _ = Math.max(i, C);
316
- g === r && d === l && m === s && _ === i || (r = g, l = d, s = m, i = _, o = !0);
315
+ const g = Math.min(l, h.startColumn), d = Math.max(r, p), m = Math.min(s, h.startRow), _ = Math.max(i, C);
316
+ g === l && d === r && m === s && _ === i || (l = g, r = d, s = m, i = _, o = !0);
317
317
  }
318
318
  }
319
319
  } while (o);
320
- return { maxColumn: l, maxRow: i, minColumn: r, minRow: s };
320
+ return { maxColumn: r, maxRow: i, minColumn: l, minRow: s };
321
321
  }
322
322
  function it(n) {
323
- const [e, , t] = le(n), o = t.getChildren(), r = o.length, s = o[0].getChildren().length, l = new Array(r);
324
- for (let i = 0; i < r; i++) l[i] = new Array(s);
325
- for (let i = 0; i < r; i++) {
323
+ const [e, , t] = le(n), o = t.getChildren(), l = o.length, s = o[0].getChildren().length, r = new Array(l);
324
+ for (let i = 0; i < l; i++) r[i] = new Array(s);
325
+ for (let i = 0; i < l; i++) {
326
326
  const c = o[i].getChildren();
327
327
  let f = 0;
328
328
  for (let h = 0; h < c.length; h++) {
329
- for (; l[i][f]; ) f++;
329
+ for (; r[i][f]; ) f++;
330
330
  const p = c[h], C = p.__rowSpan || 1, a = p.__colSpan || 1;
331
- for (let u = 0; u < C; u++) for (let g = 0; g < a; g++) l[i + u][f + g] = p;
331
+ for (let u = 0; u < C; u++) for (let g = 0; g < a; g++) r[i + u][f + g] = p;
332
332
  if (e === p) return { colSpan: a, columnIndex: f, rowIndex: i, rowSpan: C };
333
333
  f += a;
334
334
  }
@@ -336,15 +336,15 @@ function it(n) {
336
336
  return null;
337
337
  }
338
338
  function at(n) {
339
- const [[e, t, o, r], [s, l, i, c]] = ["anchor", "focus"].map((f) => {
339
+ const [[e, t, o, l], [s, r, i, c]] = ["anchor", "focus"].map((f) => {
340
340
  const h = n[f].getNode(), p = N(h, S);
341
341
  S(p) || w(238, f, h.getKey(), h.getType());
342
342
  const C = p.getParent();
343
- E(C) || w(239, f);
343
+ k(C) || w(239, f);
344
344
  const a = C.getParent();
345
345
  return O(a) || w(240, f), [h, p, C, a];
346
346
  });
347
- return r.is(c) || w(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: r, focusCell: l, focusNode: s, focusRow: i, focusTable: c };
347
+ return l.is(c) || w(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: l, focusCell: r, focusNode: s, focusRow: i, focusTable: c };
348
348
  }
349
349
  class Fe {
350
350
  constructor(e, t, o) {
@@ -386,8 +386,8 @@ class Fe {
386
386
  }
387
387
  hasFormat(e) {
388
388
  let t = 0;
389
- this.getNodes().filter(S).forEach((r) => {
390
- const s = r.getFirstChild();
389
+ this.getNodes().filter(S).forEach((l) => {
390
+ const s = l.getFirstChild();
391
391
  bt(s) && (t |= s.getTextFormat());
392
392
  });
393
393
  const o = gn[e];
@@ -395,36 +395,36 @@ class Fe {
395
395
  }
396
396
  insertNodes(e) {
397
397
  const t = this.focus.getNode();
398
- H(t) || w(151), dn(t.select(0, t.getChildrenSize())).insertNodes(e);
398
+ P(t) || w(151), dn(t.select(0, t.getChildrenSize())).insertNodes(e);
399
399
  }
400
400
  getShape() {
401
401
  const { anchorCell: e, focusCell: t } = at(this), o = it(e);
402
402
  o === null && w(153);
403
- const r = it(t);
404
- r === null && w(155);
405
- const s = Math.min(o.columnIndex, r.columnIndex), l = Math.max(o.columnIndex + o.colSpan - 1, r.columnIndex + r.colSpan - 1), i = Math.min(o.rowIndex, r.rowIndex), c = Math.max(o.rowIndex + o.rowSpan - 1, r.rowIndex + r.rowSpan - 1);
406
- return { fromX: Math.min(s, l), fromY: Math.min(i, c), toX: Math.max(s, l), toY: Math.max(i, c) };
403
+ const l = it(t);
404
+ l === null && w(155);
405
+ const s = Math.min(o.columnIndex, l.columnIndex), r = Math.max(o.columnIndex + o.colSpan - 1, l.columnIndex + l.colSpan - 1), i = Math.min(o.rowIndex, l.rowIndex), c = Math.max(o.rowIndex + o.rowSpan - 1, l.rowIndex + l.rowSpan - 1);
406
+ return { fromX: Math.min(s, r), fromY: Math.min(i, c), toX: Math.max(s, r), toY: Math.max(i, c) };
407
407
  }
408
408
  getNodes() {
409
409
  if (!this.isValid()) return [];
410
410
  const e = this._cachedNodes;
411
411
  if (e !== null) return e;
412
- const { anchorTable: t, anchorCell: o, focusCell: r } = at(this), s = r.getParents()[1];
412
+ const { anchorTable: t, anchorCell: o, focusCell: l } = at(this), s = l.getParents()[1];
413
413
  if (s !== t) {
414
- if (t.isParentOf(r)) {
414
+ if (t.isParentOf(l)) {
415
415
  const d = s.getParent();
416
- d == null && w(159), this.set(this.tableKey, r.getKey(), d.getKey());
416
+ d == null && w(159), this.set(this.tableKey, l.getKey(), d.getKey());
417
417
  } else {
418
418
  const d = t.getParent();
419
- d == null && w(158), this.set(this.tableKey, d.getKey(), r.getKey());
419
+ d == null && w(158), this.set(this.tableKey, d.getKey(), l.getKey());
420
420
  }
421
421
  return this.getNodes();
422
422
  }
423
- const [l, i, c] = U(t, o, r), { minColumn: f, maxColumn: h, minRow: p, maxRow: C } = $e(l, i, c), a = /* @__PURE__ */ new Map([[t.getKey(), t]]);
423
+ const [r, i, c] = U(t, o, l), { minColumn: f, maxColumn: h, minRow: p, maxRow: C } = Me(r, i, c), a = /* @__PURE__ */ new Map([[t.getKey(), t]]);
424
424
  let u = null;
425
425
  for (let d = p; d <= C; d++) for (let m = f; m <= h; m++) {
426
- const { cell: _ } = l[d][m], b = _.getParent();
427
- E(b) || w(160), b !== u && (a.set(b.getKey(), b), u = b), a.has(_.getKey()) || Nn(_, (y) => {
426
+ const { cell: _ } = r[d][m], b = _.getParent();
427
+ k(b) || w(160), b !== u && (a.set(b.getKey(), b), u = b), a.has(_.getKey()) || Nn(_, (y) => {
428
428
  a.set(y.getKey(), y);
429
429
  });
430
430
  }
@@ -435,8 +435,8 @@ class Fe {
435
435
  const e = this.getNodes().filter((o) => S(o));
436
436
  let t = "";
437
437
  for (let o = 0; o < e.length; o++) {
438
- const r = e[o], s = r.__parent, l = (e[o + 1] || {}).__parent;
439
- t += r.getTextContent() + (l !== s ? `
438
+ const l = e[o], s = l.__parent, r = (e[o + 1] || {}).__parent;
439
+ t += l.getTextContent() + (r !== s ? `
440
440
  ` : " ");
441
441
  }
442
442
  return t;
@@ -451,18 +451,18 @@ function Nt() {
451
451
  }
452
452
  function yn(n, e, t) {
453
453
  n.getKey(), e.getKey(), t.getKey();
454
- const o = L(), r = R(o) ? o.clone() : Nt();
455
- return r.set(n.getKey(), e.getKey(), t.getKey()), r;
454
+ const o = L(), l = R(o) ? o.clone() : Nt();
455
+ return l.set(n.getKey(), e.getKey(), t.getKey()), l;
456
456
  }
457
457
  function Nn(n, e) {
458
458
  const t = [[n]];
459
459
  for (let o = t.at(-1); o !== void 0 && t.length > 0; o = t.at(-1)) {
460
- const r = o.pop();
461
- r === void 0 ? t.pop() : e(r) !== !1 && H(r) && t.push(r.getChildren());
460
+ const l = o.pop();
461
+ l === void 0 ? t.pop() : e(l) !== !1 && P(l) && t.push(l.getChildren());
462
462
  }
463
463
  }
464
464
  function xt(n, e = Ct()) {
465
- const t = be(n);
465
+ const t = ye(n);
466
466
  O(t) || w(231, n);
467
467
  const o = G(t, e.getElementByKey(n));
468
468
  return o === null && w(232, n), { tableElement: o, tableNode: t };
@@ -484,16 +484,16 @@ class xn {
484
484
  const e = new MutationObserver((t) => {
485
485
  this.editor.getEditorState().read(() => {
486
486
  let o = !1;
487
- for (let l = 0; l < t.length; l++) {
488
- const i = t[l].target.nodeName;
487
+ for (let r = 0; r < t.length; r++) {
488
+ const i = t[r].target.nodeName;
489
489
  if (i === "TABLE" || i === "TBODY" || i === "THEAD" || i === "TR") {
490
490
  o = !0;
491
491
  break;
492
492
  }
493
493
  }
494
494
  if (!o) return;
495
- const { tableNode: r, tableElement: s } = this.$lookup();
496
- this.table = ie(r, s);
495
+ const { tableNode: l, tableElement: s } = this.$lookup();
496
+ this.table = ie(l, s);
497
497
  }, { editor: this.editor });
498
498
  });
499
499
  this.editor.getEditorState().read(() => {
@@ -505,7 +505,7 @@ class xn {
505
505
  const e = this.editor;
506
506
  this.isHighlightingCells = !1, this.anchorX = -1, this.anchorY = -1, this.focusX = -1, this.focusY = -1, this.tableSelection = null, this.anchorCellNodeKey = null, this.focusCellNodeKey = null, this.anchorCell = null, this.focusCell = null, this.hasHijackedSelectionStyles = !1, this.$enableHighlightStyle();
507
507
  const { tableNode: t, tableElement: o } = this.$lookup();
508
- _e(e, ie(t, o), null), L() !== null && (q(null), e.dispatchCommand(re, void 0));
508
+ Se(e, ie(t, o), null), L() !== null && (q(null), e.dispatchCommand(re, void 0));
509
509
  }
510
510
  $enableHighlightStyle() {
511
511
  const e = this.editor, { tableElement: t } = this.$lookup();
@@ -513,13 +513,13 @@ class xn {
513
513
  }
514
514
  $disableHighlightStyle() {
515
515
  const { tableElement: e } = this.$lookup();
516
- X(e, this.editor._config.theme.tableSelection), this.hasHijackedSelectionStyles = !0;
516
+ Y(e, this.editor._config.theme.tableSelection), this.hasHijackedSelectionStyles = !0;
517
517
  }
518
518
  $updateTableTableSelection(e) {
519
519
  if (e !== null) {
520
520
  e.tableKey !== this.tableNodeKey && w(233, e.tableKey, this.tableNodeKey);
521
521
  const t = this.editor;
522
- this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(), _e(t, this.table, this.tableSelection);
522
+ this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(), Se(t, this.table, this.tableSelection);
523
523
  } else this.$clearHighlight();
524
524
  }
525
525
  setShouldCheckSelection() {
@@ -542,25 +542,25 @@ class xn {
542
542
  }
543
543
  }
544
544
  $setFocusCellForSelection(e, t = !1) {
545
- const o = this.editor, { tableNode: r } = this.$lookup(), s = e.x, l = e.y;
546
- if (this.focusCell = e, this.isHighlightingCells || this.anchorX === s && this.anchorY === l && !t) {
547
- if (s === this.focusX && l === this.focusY) return !1;
545
+ const o = this.editor, { tableNode: l } = this.$lookup(), s = e.x, r = e.y;
546
+ if (this.focusCell = e, this.isHighlightingCells || this.anchorX === s && this.anchorY === r && !t) {
547
+ if (s === this.focusX && r === this.focusY) return !1;
548
548
  } else this.isHighlightingCells = !0, this.$disableHighlightStyle();
549
- if (this.focusX = s, this.focusY = l, this.isHighlightingCells) {
550
- const i = ze(r, e.elem);
551
- if (this.tableSelection != null && this.anchorCellNodeKey != null && i !== null) return this.focusCellNodeKey = i.getKey(), this.tableSelection = yn(r, this.$getAnchorTableCellOrThrow(), i), q(this.tableSelection), o.dispatchCommand(re, void 0), _e(o, this.table, this.tableSelection), !0;
549
+ if (this.focusX = s, this.focusY = r, this.isHighlightingCells) {
550
+ const i = Le(l, e.elem);
551
+ if (this.tableSelection != null && this.anchorCellNodeKey != null && i !== null) return this.focusCellNodeKey = i.getKey(), this.tableSelection = yn(l, this.$getAnchorTableCellOrThrow(), i), q(this.tableSelection), o.dispatchCommand(re, void 0), Se(o, this.table, this.tableSelection), !0;
552
552
  }
553
553
  return !1;
554
554
  }
555
555
  $getAnchorTableCell() {
556
- return this.anchorCellNodeKey ? be(this.anchorCellNodeKey) : null;
556
+ return this.anchorCellNodeKey ? ye(this.anchorCellNodeKey) : null;
557
557
  }
558
558
  $getAnchorTableCellOrThrow() {
559
559
  const e = this.$getAnchorTableCell();
560
560
  return e === null && w(234), e;
561
561
  }
562
562
  $getFocusTableCell() {
563
- return this.focusCellNodeKey ? be(this.focusCellNodeKey) : null;
563
+ return this.focusCellNodeKey ? ye(this.focusCellNodeKey) : null;
564
564
  }
565
565
  $getFocusTableCellOrThrow() {
566
566
  const e = this.$getFocusTableCell();
@@ -568,46 +568,46 @@ class xn {
568
568
  }
569
569
  $setAnchorCellForSelection(e) {
570
570
  this.isHighlightingCells = !1, this.anchorCell = e, this.anchorX = e.x, this.anchorY = e.y;
571
- const { tableNode: t } = this.$lookup(), o = ze(t, e.elem);
571
+ const { tableNode: t } = this.$lookup(), o = Le(t, e.elem);
572
572
  if (o !== null) {
573
- const r = o.getKey();
574
- this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Nt(), this.anchorCellNodeKey = r;
573
+ const l = o.getKey();
574
+ this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Nt(), this.anchorCellNodeKey = l;
575
575
  }
576
576
  }
577
577
  $formatCells(e) {
578
578
  const t = L();
579
579
  R(t) || w(236);
580
- const o = on(), r = o.anchor, s = o.focus, l = t.getNodes().filter(S);
581
- l.length > 0 || w(237);
582
- const i = l[0].getFirstChild(), c = bt(i) ? i.getFormatFlags(e, null) : null;
583
- l.forEach((f) => {
584
- r.set(f.getKey(), 0, "element"), s.set(f.getKey(), f.getChildrenSize(), "element"), o.formatText(e, c);
580
+ const o = on(), l = o.anchor, s = o.focus, r = t.getNodes().filter(S);
581
+ r.length > 0 || w(237);
582
+ const i = r[0].getFirstChild(), c = bt(i) ? i.getFormatFlags(e, null) : null;
583
+ r.forEach((f) => {
584
+ l.set(f.getKey(), 0, "element"), s.set(f.getKey(), f.getChildrenSize(), "element"), o.formatText(e, c);
585
585
  }), q(t), this.editor.dispatchCommand(re, void 0);
586
586
  }
587
587
  $clearText() {
588
- const { editor: e } = this, t = be(this.tableNodeKey);
588
+ const { editor: e } = this, t = ye(this.tableNodeKey);
589
589
  if (!O(t)) throw new Error("Expected TableNode.");
590
590
  const o = L();
591
591
  R(o) || w(253);
592
- const r = o.getNodes().filter(S);
593
- if (r.length === this.table.columns * this.table.rows) {
592
+ const l = o.getNodes().filter(S);
593
+ if (l.length === this.table.columns * this.table.rows) {
594
594
  t.selectPrevious();
595
595
  const s = t.getParent();
596
596
  return t.remove(), void (rn(s) && s.isEmpty() && e.dispatchCommand(wt, void 0));
597
597
  }
598
- r.forEach((s) => {
599
- if (H(s)) {
600
- const l = j(), i = We();
601
- l.append(i), s.append(l), s.getChildren().forEach((c) => {
602
- c !== l && c.remove();
598
+ l.forEach((s) => {
599
+ if (P(s)) {
600
+ const r = j(), i = De();
601
+ r.append(i), s.append(r), s.getChildren().forEach((c) => {
602
+ c !== r && c.remove();
603
603
  });
604
604
  }
605
- }), _e(e, this.table, null), q(null), e.dispatchCommand(re, void 0);
605
+ }), Se(e, this.table, null), q(null), e.dispatchCommand(re, void 0);
606
606
  }
607
607
  }
608
- const Me = "__lexicalTableSelection", Tn = (n) => !(1 & ~n.buttons);
608
+ const ze = "__lexicalTableSelection", Tn = (n) => !(1 & ~n.buttons);
609
609
  function oe(n) {
610
- return ye(n) && n.nodeName === "TABLE";
610
+ return fe(n) && n.nodeName === "TABLE";
611
611
  }
612
612
  function G(n, e) {
613
613
  if (!e) return e;
@@ -617,91 +617,91 @@ function G(n, e) {
617
617
  function Xe(n) {
618
618
  return n._window;
619
619
  }
620
- function fe(n, e) {
620
+ function ge(n, e) {
621
621
  for (let t = e, o = null; t !== null; t = t.getParent()) {
622
622
  if (n.is(t)) return o;
623
623
  S(t) && (o = t);
624
624
  }
625
625
  return null;
626
626
  }
627
- const Fn = [[Bt, "down"], [Dt, "up"], [It, "backward"], [Jt, "forward"]], vn = [Yt, St, qt], Rn = [Ut, jt];
627
+ const Fn = [[Dt, "down"], [Bt, "up"], [It, "backward"], [Jt, "forward"]], vn = [Xt, St, qt], Rn = [Ut, jt];
628
628
  function Kn(n, e, t, o) {
629
- const r = t.getRootElement(), s = Xe(t);
630
- r !== null && s !== null || w(246);
631
- const l = new xn(t, n.getKey()), i = G(n, e);
629
+ const l = t.getRootElement(), s = Xe(t);
630
+ l !== null && s !== null || w(246);
631
+ const r = new xn(t, n.getKey()), i = G(n, e);
632
632
  (function(a, u) {
633
- ct(a) !== null && w(205), a[Me] = u;
634
- })(i, l), l.listenersToRemove.add(() => function(a, u) {
635
- ct(a) === u && delete a[Me];
636
- }(i, l));
633
+ ct(a) !== null && w(205), a[ze] = u;
634
+ })(i, r), r.listenersToRemove.add(() => function(a, u) {
635
+ ct(a) === u && delete a[ze];
636
+ }(i, r));
637
637
  const c = (a) => {
638
- if (l.pointerType = a.pointerType, a.button !== 0 || !de(a.target) || !s) return;
638
+ if (r.pointerType = a.pointerType, a.button !== 0 || !de(a.target) || !s) return;
639
639
  const u = xe(a.target);
640
640
  u !== null && t.update(() => {
641
- const g = et();
641
+ const g = ke();
642
642
  if (st && a.shiftKey && J(g, n) && (z(g) || R(g))) {
643
- const d = g.anchor.getNode(), m = fe(n, g.anchor.getNode());
644
- m ? (l.$setAnchorCellForSelection(Q(l, m)), l.$setFocusCellForSelection(u), Y(a)) : (n.isBefore(d) ? n.selectStart() : n.selectEnd()).anchor.set(g.anchor.key, g.anchor.offset, g.anchor.type);
645
- } else l.$setAnchorCellForSelection(u);
643
+ const d = g.anchor.getNode(), m = ge(n, g.anchor.getNode());
644
+ m ? (r.$setAnchorCellForSelection(Z(r, m)), r.$setFocusCellForSelection(u), X(a)) : (n.isBefore(d) ? n.selectStart() : n.selectEnd()).anchor.set(g.anchor.key, g.anchor.offset, g.anchor.type);
645
+ } else r.$setAnchorCellForSelection(u);
646
646
  }), (() => {
647
- if (l.isSelecting) return;
647
+ if (r.isSelecting) return;
648
648
  const g = () => {
649
- l.isSelecting = !1, s.removeEventListener("pointerup", g), s.removeEventListener("pointermove", d);
649
+ r.isSelecting = !1, s.removeEventListener("pointerup", g), s.removeEventListener("pointermove", d);
650
650
  }, d = (m) => {
651
- if (!Tn(m) && l.isSelecting) return l.isSelecting = !1, s.removeEventListener("pointerup", g), void s.removeEventListener("pointermove", d);
651
+ if (!Tn(m) && r.isSelecting) return r.isSelecting = !1, s.removeEventListener("pointerup", g), void s.removeEventListener("pointermove", d);
652
652
  if (!de(m.target)) return;
653
653
  let _ = null;
654
654
  const b = !(st || i.contains(m.target));
655
655
  if (b) _ = ut(i, m.target);
656
656
  else for (const y of document.elementsFromPoint(m.clientX, m.clientY)) if (_ = ut(i, y), _) break;
657
- !_ || l.focusCell !== null && _.elem === l.focusCell.elem || (l.setNextFocus({ focusCell: _, override: b }), t.dispatchCommand(re, void 0));
657
+ !_ || r.focusCell !== null && _.elem === r.focusCell.elem || (r.setNextFocus({ focusCell: _, override: b }), t.dispatchCommand(re, void 0));
658
658
  };
659
- l.isSelecting = !0, s.addEventListener("pointerup", g, l.listenerOptions), s.addEventListener("pointermove", d, l.listenerOptions);
659
+ r.isSelecting = !0, s.addEventListener("pointerup", g, r.listenerOptions), s.addEventListener("pointermove", d, r.listenerOptions);
660
660
  })();
661
661
  };
662
- i.addEventListener("pointerdown", c, l.listenerOptions), l.listenersToRemove.add(() => {
662
+ i.addEventListener("pointerdown", c, r.listenerOptions), r.listenersToRemove.add(() => {
663
663
  i.removeEventListener("pointerdown", c);
664
664
  });
665
665
  const f = (a) => {
666
666
  a.detail >= 3 && de(a.target) && xe(a.target) !== null && a.preventDefault();
667
667
  };
668
- i.addEventListener("mousedown", f, l.listenerOptions), l.listenersToRemove.add(() => {
668
+ i.addEventListener("mousedown", f, r.listenerOptions), r.listenersToRemove.add(() => {
669
669
  i.removeEventListener("mousedown", f);
670
670
  });
671
671
  const h = (a) => {
672
672
  const u = a.target;
673
673
  a.button === 0 && de(u) && t.update(() => {
674
674
  const g = L();
675
- R(g) && g.tableKey === l.tableNodeKey && r.contains(u) && l.$clearHighlight();
675
+ R(g) && g.tableKey === r.tableNodeKey && l.contains(u) && r.$clearHighlight();
676
676
  });
677
677
  };
678
- s.addEventListener("pointerdown", h, l.listenerOptions), l.listenersToRemove.add(() => {
678
+ s.addEventListener("pointerdown", h, r.listenerOptions), r.listenersToRemove.add(() => {
679
679
  s.removeEventListener("pointerdown", h);
680
680
  });
681
- for (const [a, u] of Fn) l.listenersToRemove.add(t.registerCommand(a, (g) => vt(t, g, u, n, l), Ae));
682
- l.listenersToRemove.add(t.registerCommand(Xt, (a) => {
681
+ for (const [a, u] of Fn) r.listenersToRemove.add(t.registerCommand(a, (g) => vt(t, g, u, n, r), Ae));
682
+ r.listenersToRemove.add(t.registerCommand(Yt, (a) => {
683
683
  const u = L();
684
684
  if (R(u)) {
685
- const g = fe(n, u.focus.getNode());
686
- if (g !== null) return Y(a), g.selectEnd(), !0;
685
+ const g = ge(n, u.focus.getNode());
686
+ if (g !== null) return X(a), g.selectEnd(), !0;
687
687
  }
688
688
  return !1;
689
689
  }, Ae));
690
690
  const p = (a) => () => {
691
691
  const u = L();
692
692
  if (!J(u, n)) return !1;
693
- if (R(u)) return l.$clearText(), !0;
693
+ if (R(u)) return r.$clearText(), !0;
694
694
  if (z(u)) {
695
- if (!S(fe(n, u.anchor.getNode()))) return !1;
695
+ if (!S(ge(n, u.anchor.getNode()))) return !1;
696
696
  const g = u.anchor.getNode(), d = u.focus.getNode(), m = n.isParentOf(g), _ = n.isParentOf(d);
697
- if (m && !_ || _ && !m) return l.$clearText(), !0;
698
- const b = N(u.anchor.getNode(), (x) => H(x)), y = b && N(b, (x) => H(x) && S(x.getParent()));
699
- if (!H(y) || !H(b)) return !1;
697
+ if (m && !_ || _ && !m) return r.$clearText(), !0;
698
+ const b = N(u.anchor.getNode(), (x) => P(x)), y = b && N(b, (x) => P(x) && S(x.getParent()));
699
+ if (!P(y) || !P(b)) return !1;
700
700
  if (a === St && y.getPreviousSibling() === null) return !0;
701
701
  }
702
702
  return !1;
703
703
  };
704
- for (const a of vn) l.listenersToRemove.add(t.registerCommand(a, p(a), I));
704
+ for (const a of vn) r.listenersToRemove.add(t.registerCommand(a, p(a), I));
705
705
  const C = (a) => {
706
706
  const u = L();
707
707
  if (!R(u) && !z(u)) return !1;
@@ -710,10 +710,10 @@ function Kn(n, e, t, o) {
710
710
  const d = g ? "anchor" : "focus", m = g ? "focus" : "anchor", { key: _, offset: b, type: y } = u[m];
711
711
  return n[u[d].isBefore(u[m]) ? "selectPrevious" : "selectNext"]()[m].set(_, b, y), !1;
712
712
  }
713
- return !!J(u, n) && !!R(u) && (a && (a.preventDefault(), a.stopPropagation()), l.$clearText(), !0);
713
+ return !!J(u, n) && !!R(u) && (a && (a.preventDefault(), a.stopPropagation()), r.$clearText(), !0);
714
714
  };
715
- for (const a of Rn) l.listenersToRemove.add(t.registerCommand(a, C, I));
716
- return l.listenersToRemove.add(t.registerCommand(Vt, (a) => {
715
+ for (const a of Rn) r.listenersToRemove.add(t.registerCommand(a, C, I));
716
+ return r.listenersToRemove.add(t.registerCommand(Vt, (a) => {
717
717
  const u = L();
718
718
  if (u) {
719
719
  if (!R(u) && !z(u)) return !1;
@@ -722,16 +722,16 @@ function Kn(n, e, t, o) {
722
722
  return z(u) ? (u.removeText(), !0) : g;
723
723
  }
724
724
  return !1;
725
- }, I)), l.listenersToRemove.add(t.registerCommand(Qt, (a) => {
725
+ }, I)), r.listenersToRemove.add(t.registerCommand(Zt, (a) => {
726
726
  const u = L();
727
727
  if (!J(u, n)) return !1;
728
- if (R(u)) return l.$formatCells(a), !0;
728
+ if (R(u)) return r.$formatCells(a), !0;
729
729
  if (z(u)) {
730
730
  const g = N(u.anchor.getNode(), (d) => S(d));
731
731
  if (!S(g)) return !1;
732
732
  }
733
733
  return !1;
734
- }, I)), l.listenersToRemove.add(t.registerCommand(Gt, (a) => {
734
+ }, I)), r.listenersToRemove.add(t.registerCommand(Gt, (a) => {
735
735
  const u = L();
736
736
  if (!R(u) || !J(u, n)) return !1;
737
737
  const g = u.anchor.getNode(), d = u.focus.getNode();
@@ -746,103 +746,103 @@ function Kn(n, e, t, o) {
746
746
  }
747
747
  return !1;
748
748
  }(u, n)) return n.setFormat(a), !0;
749
- const [m, _, b] = U(n, g, d), y = Math.max(_.startRow + _.cell.__rowSpan - 1, b.startRow + b.cell.__rowSpan - 1), x = Math.max(_.startColumn + _.cell.__colSpan - 1, b.startColumn + b.cell.__colSpan - 1), v = Math.min(_.startRow, b.startRow), $ = Math.min(_.startColumn, b.startColumn), k = /* @__PURE__ */ new Set();
749
+ const [m, _, b] = U(n, g, d), y = Math.max(_.startRow + _.cell.__rowSpan - 1, b.startRow + b.cell.__rowSpan - 1), x = Math.max(_.startColumn + _.cell.__colSpan - 1, b.startColumn + b.cell.__colSpan - 1), v = Math.min(_.startRow, b.startRow), $ = Math.min(_.startColumn, b.startColumn), E = /* @__PURE__ */ new Set();
750
750
  for (let T = v; T <= y; T++) for (let A = $; A <= x; A++) {
751
751
  const F = m[T][A].cell;
752
- if (k.has(F)) continue;
753
- k.add(F), F.setFormat(a);
752
+ if (E.has(F)) continue;
753
+ E.add(F), F.setFormat(a);
754
754
  const K = F.getChildren();
755
755
  for (let M = 0; M < K.length; M++) {
756
- const P = K[M];
757
- H(P) && !P.isInline() && P.setFormat(a);
756
+ const H = K[M];
757
+ P(H) && !H.isInline() && H.setFormat(a);
758
758
  }
759
759
  }
760
760
  return !0;
761
- }, I)), l.listenersToRemove.add(t.registerCommand(Zt, (a) => {
761
+ }, I)), r.listenersToRemove.add(t.registerCommand(Qt, (a) => {
762
762
  const u = L();
763
763
  if (!J(u, n)) return !1;
764
- if (R(u)) return l.$clearHighlight(), !1;
764
+ if (R(u)) return r.$clearHighlight(), !1;
765
765
  if (z(u)) {
766
766
  const g = N(u.anchor.getNode(), (d) => S(d));
767
767
  if (!S(g)) return !1;
768
768
  if (typeof a == "string") {
769
769
  const d = ft(t, u, n);
770
- if (d) return dt(d, n, [We(a)]), !0;
770
+ if (d) return dt(d, n, [De(a)]), !0;
771
771
  }
772
772
  }
773
773
  return !1;
774
- }, I)), o && l.listenersToRemove.add(t.registerCommand(en, (a) => {
774
+ }, I)), o && r.listenersToRemove.add(t.registerCommand(en, (a) => {
775
775
  const u = L();
776
776
  if (!z(u) || !u.isCollapsed() || !J(u, n)) return !1;
777
777
  const g = he(u.anchor.getNode());
778
- return !(g === null || !n.is(ae(g))) && (Y(a), function(d, m) {
778
+ return !(g === null || !n.is(ae(g))) && (X(a), function(d, m) {
779
779
  const _ = m === "next" ? "getNextSibling" : "getPreviousSibling", b = m === "next" ? "getFirstChild" : "getLastChild", y = d[_]();
780
- if (H(y)) return y.selectEnd();
781
- const x = N(d, E);
780
+ if (P(y)) return y.selectEnd();
781
+ const x = N(d, k);
782
782
  x === null && w(247);
783
- for (let $ = x[_](); E($); $ = $[_]()) {
784
- const k = $[b]();
785
- if (H(k)) return k.selectEnd();
783
+ for (let $ = x[_](); k($); $ = $[_]()) {
784
+ const E = $[b]();
785
+ if (P(E)) return E.selectEnd();
786
786
  }
787
787
  const v = N(x, O);
788
788
  v === null && w(248), m === "next" ? v.selectNext() : v.selectPrevious();
789
789
  }(g, a.shiftKey ? "previous" : "next"), !0);
790
- }, I)), l.listenersToRemove.add(t.registerCommand(tn, (a) => n.isSelected(), Ae)), l.listenersToRemove.add(t.registerCommand(_t, (a) => {
790
+ }, I)), r.listenersToRemove.add(t.registerCommand(tn, (a) => n.isSelected(), Ae)), r.listenersToRemove.add(t.registerCommand(_t, (a) => {
791
791
  const { nodes: u, selection: g } = a, d = g.getStartEndPoints(), m = R(g), _ = z(g) && N(g.anchor.getNode(), (W) => S(W)) !== null && N(g.focus.getNode(), (W) => S(W)) !== null || m;
792
792
  if (u.length !== 1 || !O(u[0]) || !_ || d === null) return !1;
793
- const [b] = d, y = u[0], x = y.getChildren(), v = y.getFirstChildOrThrow().getChildrenSize(), $ = y.getChildrenSize(), k = N(b.getNode(), (W) => S(W)), T = k && N(k, (W) => E(W)), A = T && N(T, (W) => O(W));
794
- if (!S(k) || !E(T) || !O(A)) return !1;
795
- const F = T.getIndexWithinParent(), K = Math.min(A.getChildrenSize() - 1, F + $ - 1), M = k.getIndexWithinParent(), P = Math.min(T.getChildrenSize() - 1, M + v - 1), ue = Math.min(M, P), ve = Math.min(F, K), Re = Math.max(M, P), B = Math.max(F, K), Kt = A.getChildren();
796
- let Ue = 0;
797
- for (let W = ve; W <= B; W++) {
798
- const je = Kt[W];
799
- if (!E(je)) return !1;
800
- const Ve = x[Ue];
801
- if (!E(Ve)) return !1;
802
- const Ot = je.getChildren(), At = Ve.getChildren();
803
- let Qe = 0;
793
+ const [b] = d, y = u[0], x = y.getChildren(), v = y.getFirstChildOrThrow().getChildrenSize(), $ = y.getChildrenSize(), E = N(b.getNode(), (W) => S(W)), T = E && N(E, (W) => k(W)), A = T && N(T, (W) => O(W));
794
+ if (!S(E) || !k(T) || !O(A)) return !1;
795
+ const F = T.getIndexWithinParent(), K = Math.min(A.getChildrenSize() - 1, F + $ - 1), M = E.getIndexWithinParent(), H = Math.min(T.getChildrenSize() - 1, M + v - 1), ue = Math.min(M, H), ve = Math.min(F, K), Re = Math.max(M, H), D = Math.max(F, K), Kt = A.getChildren();
796
+ let je = 0;
797
+ for (let W = ve; W <= D; W++) {
798
+ const Ve = Kt[W];
799
+ if (!k(Ve)) return !1;
800
+ const Ze = x[je];
801
+ if (!k(Ze)) return !1;
802
+ const Ot = Ve.getChildren(), At = Ze.getChildren();
803
+ let Ge = 0;
804
804
  for (let Ke = ue; Ke <= Re; Ke++) {
805
- const pe = Ot[Ke];
806
- if (!S(pe)) return !1;
807
- const Ge = At[Qe];
808
- if (!S(Ge)) return !1;
809
- const kt = pe.getChildren();
810
- Ge.getChildren().forEach((te) => {
811
- ce(te) && j().append(te), pe.append(te);
812
- }), kt.forEach((te) => te.remove()), Qe++;
805
+ const Ce = Ot[Ke];
806
+ if (!S(Ce)) return !1;
807
+ const Qe = At[Ge];
808
+ if (!S(Qe)) return !1;
809
+ const Et = Ce.getChildren();
810
+ Qe.getChildren().forEach((te) => {
811
+ ce(te) && j().append(te), Ce.append(te);
812
+ }), Et.forEach((te) => te.remove()), Ge++;
813
813
  }
814
- Ue++;
814
+ je++;
815
815
  }
816
816
  return !0;
817
- }, I)), l.listenersToRemove.add(t.registerCommand(re, () => {
818
- const a = L(), u = et(), g = l.getAndClearNextFocus();
817
+ }, I)), r.listenersToRemove.add(t.registerCommand(re, () => {
818
+ const a = L(), u = ke(), g = r.getAndClearNextFocus();
819
819
  if (g !== null) {
820
820
  const { focusCell: d } = g;
821
- if (R(a) && a.tableKey === l.tableNodeKey) return (d.x !== l.focusX || d.y !== l.focusY) && (l.$setFocusCellForSelection(d), !0);
822
- if (d !== l.anchorCell && J(a, n)) return l.$setFocusCellForSelection(d), !0;
821
+ if (R(a) && a.tableKey === r.tableNodeKey) return (d.x !== r.focusX || d.y !== r.focusY) && (r.$setFocusCellForSelection(d), !0);
822
+ if (d !== r.anchorCell && J(a, n)) return r.$setFocusCellForSelection(d), !0;
823
823
  }
824
- if (l.getAndClearShouldCheckSelection() && z(u) && z(a) && a.isCollapsed()) {
824
+ if (r.getAndClearShouldCheckSelection() && z(u) && z(a) && a.isCollapsed()) {
825
825
  const d = a.anchor.getNode(), m = n.getFirstChild(), _ = he(d);
826
- if (_ !== null && E(m)) {
826
+ if (_ !== null && k(m)) {
827
827
  const b = m.getFirstChild();
828
828
  if (S(b) && n.is(N(_, (y) => y.is(n) || y.is(b)))) return b.selectStart(), !0;
829
829
  }
830
830
  }
831
831
  if (z(a)) {
832
- const { anchor: d, focus: m } = a, _ = d.getNode(), b = m.getNode(), y = he(_), x = he(b), v = !(!y || !n.is(ae(y))), $ = !(!x || !n.is(ae(x))), k = v !== $, T = v && $, A = a.isBackward();
833
- if (k) {
832
+ const { anchor: d, focus: m } = a, _ = d.getNode(), b = m.getNode(), y = he(_), x = he(b), v = !(!y || !n.is(ae(y))), $ = !(!x || !n.is(ae(x))), E = v !== $, T = v && $, A = a.isBackward();
833
+ if (E) {
834
834
  const F = a.clone();
835
835
  if ($) {
836
- const [K] = U(n, x, x), M = K[0][0].cell, P = K[K.length - 1].at(-1).cell;
837
- F.focus.set(A ? M.getKey() : P.getKey(), A ? M.getChildrenSize() : P.getChildrenSize(), "element");
836
+ const [K] = U(n, x, x), M = K[0][0].cell, H = K[K.length - 1].at(-1).cell;
837
+ F.focus.set(A ? M.getKey() : H.getKey(), A ? M.getChildrenSize() : H.getChildrenSize(), "element");
838
838
  } else if (v) {
839
- const [K] = U(n, y, y), M = K[0][0].cell, P = K[K.length - 1].at(-1).cell;
840
- F.anchor.set(A ? P.getKey() : M.getKey(), A ? P.getChildrenSize() : 0, "element");
839
+ const [K] = U(n, y, y), M = K[0][0].cell, H = K[K.length - 1].at(-1).cell;
840
+ F.anchor.set(A ? H.getKey() : M.getKey(), A ? H.getChildrenSize() : 0, "element");
841
841
  }
842
- q(F), ht(t, l);
843
- } else if (T && (y.is(x) || (l.$setAnchorCellForSelection(Q(l, y)), l.$setFocusCellForSelection(Q(l, x), !0)), l.pointerType === "touch" && a.isCollapsed() && z(u) && u.isCollapsed())) {
842
+ q(F), ht(t, r);
843
+ } else if (T && (y.is(x) || (r.$setAnchorCellForSelection(Z(r, y)), r.$setFocusCellForSelection(Z(r, x), !0)), r.pointerType === "touch" && a.isCollapsed() && z(u) && u.isCollapsed())) {
844
844
  const F = he(u.anchor.getNode());
845
- F && !F.is(x) && (l.$setAnchorCellForSelection(Q(l, F)), l.$setFocusCellForSelection(Q(l, x), !0), l.pointerType = null);
845
+ F && !F.is(x) && (r.$setAnchorCellForSelection(Z(r, F)), r.$setFocusCellForSelection(Z(r, x), !0), r.pointerType = null);
846
846
  }
847
847
  } else if (a && R(a) && a.is(u) && a.tableKey === n.getKey()) {
848
848
  const d = Te(s);
@@ -854,21 +854,21 @@ function Kn(n, e, t, o) {
854
854
  }
855
855
  }
856
856
  }
857
- return a && !a.is(u) && (R(a) || R(u)) && l.tableSelection && !l.tableSelection.is(u) ? (R(a) && a.tableKey === l.tableNodeKey ? l.$updateTableTableSelection(a) : !R(a) && R(u) && u.tableKey === l.tableNodeKey && l.$updateTableTableSelection(null), !1) : (l.hasHijackedSelectionStyles && !n.isSelected() ? function(d, m) {
858
- m.$enableHighlightStyle(), Ye(m.table, (_) => {
857
+ return a && !a.is(u) && (R(a) || R(u)) && r.tableSelection && !r.tableSelection.is(u) ? (R(a) && a.tableKey === r.tableNodeKey ? r.$updateTableTableSelection(a) : !R(a) && R(u) && u.tableKey === r.tableNodeKey && r.$updateTableTableSelection(null), !1) : (r.hasHijackedSelectionStyles && !n.isSelected() ? function(d, m) {
858
+ m.$enableHighlightStyle(), qe(m.table, (_) => {
859
859
  const b = _.elem;
860
860
  _.highlighted = !1, Ft(d, _), b.getAttribute("style") || b.removeAttribute("style");
861
861
  });
862
- }(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() && ht(t, l), !1);
863
- }, I)), l.listenersToRemove.add(t.registerCommand(wt, () => {
862
+ }(t, r) : !r.hasHijackedSelectionStyles && n.isSelected() && ht(t, r), !1);
863
+ }, I)), r.listenersToRemove.add(t.registerCommand(wt, () => {
864
864
  const a = L();
865
865
  if (!z(a) || !a.isCollapsed() || !J(a, n)) return !1;
866
866
  const u = ft(t, a, n);
867
867
  return !!u && (dt(u, n), !0);
868
- }, I)), l;
868
+ }, I)), r;
869
869
  }
870
870
  function ct(n) {
871
- return n[Me] || null;
871
+ return n[ze] || null;
872
872
  }
873
873
  function xe(n) {
874
874
  let e = n;
@@ -887,81 +887,81 @@ function ut(n, e) {
887
887
  let t = null;
888
888
  for (let o = e; o != null; o = o.parentNode) {
889
889
  if (o === n) return t;
890
- const r = o.nodeName;
891
- r !== "TD" && r !== "TH" || (t = o._cell || null);
890
+ const l = o.nodeName;
891
+ l !== "TD" && l !== "TH" || (t = o._cell || null);
892
892
  }
893
893
  return null;
894
894
  }
895
895
  function ie(n, e) {
896
896
  const t = [], o = { columns: 0, domRows: t, rows: 0 };
897
- let r = G(n, e).querySelector("tr"), s = 0, l = 0;
898
- for (t.length = 0; r != null; ) {
899
- const i = r.nodeName;
897
+ let l = G(n, e).querySelector("tr"), s = 0, r = 0;
898
+ for (t.length = 0; l != null; ) {
899
+ const i = l.nodeName;
900
900
  if (i === "TD" || i === "TH") {
901
- const h = { elem: r, hasBackgroundColor: r.style.backgroundColor !== "", highlighted: !1, x: s, y: l };
902
- r._cell = h;
903
- let p = t[l];
904
- p === void 0 && (p = t[l] = []), p[s] = h;
901
+ const h = { elem: l, hasBackgroundColor: l.style.backgroundColor !== "", highlighted: !1, x: s, y: r };
902
+ l._cell = h;
903
+ let p = t[r];
904
+ p === void 0 && (p = t[r] = []), p[s] = h;
905
905
  } else {
906
- const h = r.firstChild;
906
+ const h = l.firstChild;
907
907
  if (h != null) {
908
- r = h;
908
+ l = h;
909
909
  continue;
910
910
  }
911
911
  }
912
- const c = r.nextSibling;
912
+ const c = l.nextSibling;
913
913
  if (c != null) {
914
- s++, r = c;
914
+ s++, l = c;
915
915
  continue;
916
916
  }
917
- const f = r.parentNode;
917
+ const f = l.parentNode;
918
918
  if (f != null) {
919
919
  const h = f.nextSibling;
920
920
  if (h == null) break;
921
- l++, s = 0, r = h;
921
+ r++, s = 0, l = h;
922
922
  }
923
923
  }
924
- return o.columns = s + 1, o.rows = l + 1, o;
924
+ return o.columns = s + 1, o.rows = r + 1, o;
925
925
  }
926
- function _e(n, e, t) {
926
+ function Se(n, e, t) {
927
927
  const o = new Set(t ? t.getNodes() : []);
928
- Ye(e, (r, s) => {
929
- const l = r.elem;
930
- o.has(s) ? (r.highlighted = !0, Tt(n, r)) : (r.highlighted = !1, Ft(n, r), l.getAttribute("style") || l.removeAttribute("style"));
928
+ qe(e, (l, s) => {
929
+ const r = l.elem;
930
+ o.has(s) ? (l.highlighted = !0, Tt(n, l)) : (l.highlighted = !1, Ft(n, l), r.getAttribute("style") || r.removeAttribute("style"));
931
931
  });
932
932
  }
933
- function Ye(n, e) {
933
+ function qe(n, e) {
934
934
  const { domRows: t } = n;
935
935
  for (let o = 0; o < t.length; o++) {
936
- const r = t[o];
937
- if (r) for (let s = 0; s < r.length; s++) {
938
- const l = r[s];
939
- if (!l) continue;
940
- const i = V(l.elem);
941
- i !== null && e(l, i, { x: s, y: o });
936
+ const l = t[o];
937
+ if (l) for (let s = 0; s < l.length; s++) {
938
+ const r = l[s];
939
+ if (!r) continue;
940
+ const i = V(r.elem);
941
+ i !== null && e(r, i, { x: s, y: o });
942
942
  }
943
943
  }
944
944
  }
945
945
  function ht(n, e) {
946
- e.$disableHighlightStyle(), Ye(e.table, (t) => {
946
+ e.$disableHighlightStyle(), qe(e.table, (t) => {
947
947
  t.highlighted = !0, Tt(n, t);
948
948
  });
949
949
  }
950
- const On = (n, e, t, o, r) => {
951
- const s = r === "forward";
952
- switch (r) {
950
+ const On = (n, e, t, o, l) => {
951
+ const s = l === "forward";
952
+ switch (l) {
953
953
  case "backward":
954
954
  case "forward":
955
- return t !== (s ? n.table.columns - 1 : 0) ? we(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? we(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
955
+ return t !== (s ? n.table.columns - 1 : 0) ? be(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? be(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
956
956
  case "up":
957
- return o !== 0 ? we(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
957
+ return o !== 0 ? be(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
958
958
  case "down":
959
- return o !== n.table.rows - 1 ? we(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
959
+ return o !== n.table.rows - 1 ? be(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
960
960
  default:
961
961
  return !1;
962
962
  }
963
963
  };
964
- function ke(n, e) {
964
+ function Ee(n, e) {
965
965
  let t, o;
966
966
  if (e.startColumn === n.minColumn) t = "minColumn";
967
967
  else {
@@ -975,41 +975,41 @@ function ke(n, e) {
975
975
  }
976
976
  return [t, o];
977
977
  }
978
- function Se([n, e]) {
978
+ function we([n, e]) {
979
979
  return [n === "minColumn" ? "maxColumn" : "minColumn", e === "minRow" ? "maxRow" : "minRow"];
980
980
  }
981
981
  function ne(n, e, [t, o]) {
982
- const r = e[o], s = n[r];
983
- s === void 0 && w(250, o, String(r));
984
- const l = e[t], i = s[l];
985
- return i === void 0 && w(250, t, String(l)), i;
986
- }
987
- function An(n, e, t, o, r) {
988
- const s = $e(e, t, o), l = function(v, $) {
989
- const { minColumn: k, maxColumn: T, minRow: A, maxRow: F } = $;
990
- let K = 1, M = 1, P = 1, ue = 1;
982
+ const l = e[o], s = n[l];
983
+ s === void 0 && w(250, o, String(l));
984
+ const r = e[t], i = s[r];
985
+ return i === void 0 && w(250, t, String(r)), i;
986
+ }
987
+ function An(n, e, t, o, l) {
988
+ const s = Me(e, t, o), r = function(v, $) {
989
+ const { minColumn: E, maxColumn: T, minRow: A, maxRow: F } = $;
990
+ let K = 1, M = 1, H = 1, ue = 1;
991
991
  const ve = v[A], Re = v[F];
992
- for (let B = k; B <= T; B++) K = Math.max(K, ve[B].cell.__rowSpan), ue = Math.max(ue, Re[B].cell.__rowSpan);
993
- for (let B = A; B <= F; B++) M = Math.max(M, v[B][k].cell.__colSpan), P = Math.max(P, v[B][T].cell.__colSpan);
994
- return { bottomSpan: ue, leftSpan: M, rightSpan: P, topSpan: K };
995
- }(e, s), { topSpan: i, leftSpan: c, bottomSpan: f, rightSpan: h } = l, p = function(v, $) {
996
- const k = ke(v, $);
997
- return k === null && w(249, $.cell.getKey()), k;
998
- }(s, t), [C, a] = Se(p);
992
+ for (let D = E; D <= T; D++) K = Math.max(K, ve[D].cell.__rowSpan), ue = Math.max(ue, Re[D].cell.__rowSpan);
993
+ for (let D = A; D <= F; D++) M = Math.max(M, v[D][E].cell.__colSpan), H = Math.max(H, v[D][T].cell.__colSpan);
994
+ return { bottomSpan: ue, leftSpan: M, rightSpan: H, topSpan: K };
995
+ }(e, s), { topSpan: i, leftSpan: c, bottomSpan: f, rightSpan: h } = r, p = function(v, $) {
996
+ const E = Ee(v, $);
997
+ return E === null && w(249, $.cell.getKey()), E;
998
+ }(s, t), [C, a] = we(p);
999
999
  let u = s[C], g = s[a];
1000
- r === "forward" ? u += C === "maxColumn" ? 1 : c : r === "backward" ? u -= C === "minColumn" ? 1 : h : r === "down" ? g += a === "maxRow" ? 1 : i : r === "up" && (g -= a === "minRow" ? 1 : f);
1000
+ l === "forward" ? u += C === "maxColumn" ? 1 : c : l === "backward" ? u -= C === "minColumn" ? 1 : h : l === "down" ? g += a === "maxRow" ? 1 : i : l === "up" && (g -= a === "minRow" ? 1 : f);
1001
1001
  const d = e[g];
1002
1002
  if (d === void 0) return !1;
1003
1003
  const m = d[u];
1004
1004
  if (m === void 0) return !1;
1005
- const [_, b] = function(v, $, k) {
1006
- const T = $e(v, $, k), A = ke(T, $);
1007
- if (A) return [ne(v, T, A), ne(v, T, Se(A))];
1008
- const F = ke(T, k);
1009
- if (F) return [ne(v, T, Se(F)), ne(v, T, F)];
1005
+ const [_, b] = function(v, $, E) {
1006
+ const T = Me(v, $, E), A = Ee(T, $);
1007
+ if (A) return [ne(v, T, A), ne(v, T, we(A))];
1008
+ const F = Ee(T, E);
1009
+ if (F) return [ne(v, T, we(F)), ne(v, T, F)];
1010
1010
  const K = ["minColumn", "minRow"];
1011
- return [ne(v, T, K), ne(v, T, Se(K))];
1012
- }(e, t, m), y = Q(n, _.cell), x = Q(n, b.cell);
1011
+ return [ne(v, T, K), ne(v, T, we(K))];
1012
+ }(e, t, m), y = Z(n, _.cell), x = Z(n, b.cell);
1013
1013
  return n.$setAnchorCellForSelection(y), n.$setFocusCellForSelection(x, !0), !0;
1014
1014
  }
1015
1015
  function J(n, e) {
@@ -1019,12 +1019,12 @@ function J(n, e) {
1019
1019
  }
1020
1020
  return !1;
1021
1021
  }
1022
- function we(n, e) {
1022
+ function be(n, e) {
1023
1023
  e ? n.selectStart() : n.selectEnd();
1024
1024
  }
1025
1025
  function Tt(n, e) {
1026
1026
  const t = e.elem, o = n._config.theme;
1027
- S(V(t)) || w(131), X(t, o.tableCellSelected);
1027
+ S(V(t)) || w(131), Y(t, o.tableCellSelected);
1028
1028
  }
1029
1029
  function Ft(n, e) {
1030
1030
  const t = e.elem;
@@ -1040,12 +1040,12 @@ function ae(n) {
1040
1040
  const e = N(n, O);
1041
1041
  return O(e) ? e : null;
1042
1042
  }
1043
- function kn(n, e, t, o, r, s, l) {
1044
- const i = sn(t.focus, r ? "previous" : "next");
1043
+ function En(n, e, t, o, l, s, r) {
1044
+ const i = sn(t.focus, l ? "previous" : "next");
1045
1045
  if (an(i)) return !1;
1046
1046
  let c = i;
1047
1047
  for (const d of tt(i).iterNodeCarets("shadowRoot")) {
1048
- if (!cn(d) || !H(d.origin)) return !1;
1048
+ if (!cn(d) || !P(d.origin)) return !1;
1049
1049
  c = d;
1050
1050
  }
1051
1051
  const f = c.getParentAtCaret();
@@ -1055,35 +1055,35 @@ function kn(n, e, t, o, r, s, l) {
1055
1055
  const { origin: _ } = m;
1056
1056
  if (S(_)) {
1057
1057
  if (nt(m)) return un(_, d.direction);
1058
- } else if (!E(_)) break;
1058
+ } else if (!k(_)) break;
1059
1059
  }
1060
1060
  return null;
1061
1061
  }(ot(h, c.direction)), C = N(h, O);
1062
1062
  if (!C || !C.is(s)) return !1;
1063
1063
  const a = n.getElementByKey(h.getKey()), u = xe(a);
1064
1064
  if (!a || !u) return !1;
1065
- const g = En(n, C);
1066
- if (l.table = g, p) if (o === "extend") {
1065
+ const g = kn(n, C);
1066
+ if (r.table = g, p) if (o === "extend") {
1067
1067
  const d = xe(n.getElementByKey(p.origin.getKey()));
1068
1068
  if (!d) return !1;
1069
- l.$setAnchorCellForSelection(u), l.$setFocusCellForSelection(d, !0);
1069
+ r.$setAnchorCellForSelection(u), r.$setFocusCellForSelection(d, !0);
1070
1070
  } else {
1071
1071
  const d = rt(p);
1072
- Ce(t.anchor, d), Ce(t.focus, d);
1072
+ _e(t.anchor, d), _e(t.focus, d);
1073
1073
  }
1074
- else if (o === "extend") l.$setAnchorCellForSelection(u), l.$setFocusCellForSelection(u, !0);
1074
+ else if (o === "extend") r.$setAnchorCellForSelection(u), r.$setFocusCellForSelection(u, !0);
1075
1075
  else {
1076
1076
  const d = function(m) {
1077
1077
  const _ = hn(m);
1078
1078
  return nt(_) ? rt(_) : m;
1079
1079
  }(ot(C, i.direction));
1080
- Ce(t.anchor, d), Ce(t.focus, d);
1080
+ _e(t.anchor, d), _e(t.focus, d);
1081
1081
  }
1082
- return Y(e), !0;
1082
+ return X(e), !0;
1083
1083
  }
1084
- function vt(n, e, t, o, r) {
1085
- if ((t === "up" || t === "down") && function(l) {
1086
- const i = l.getRootElement();
1084
+ function vt(n, e, t, o, l) {
1085
+ if ((t === "up" || t === "down") && function(r) {
1086
+ const i = r.getRootElement();
1087
1087
  return i ? i.hasAttribute("aria-controls") && i.getAttribute("aria-controls") === "typeahead-menu" : !1;
1088
1088
  }(n)) return !1;
1089
1089
  const s = L();
@@ -1091,71 +1091,71 @@ function vt(n, e, t, o, r) {
1091
1091
  if (z(s)) {
1092
1092
  if (t === "backward") {
1093
1093
  if (s.focus.offset > 0) return !1;
1094
- const l = function(c) {
1095
- for (let f = c, h = c; h !== null; f = h, h = h.getParent()) if (H(h)) {
1094
+ const r = function(c) {
1095
+ for (let f = c, h = c; h !== null; f = h, h = h.getParent()) if (P(h)) {
1096
1096
  if (h !== f && h.getFirstChild() !== f) return null;
1097
1097
  if (!h.isInline()) return h;
1098
1098
  }
1099
1099
  return null;
1100
1100
  }(s.focus.getNode());
1101
- if (!l) return !1;
1102
- const i = l.getPreviousSibling();
1103
- return !!O(i) && (Y(e), e.shiftKey ? s.focus.set(i.getParentOrThrow().getKey(), i.getIndexWithinParent(), "element") : i.selectEnd(), !0);
1101
+ if (!r) return !1;
1102
+ const i = r.getPreviousSibling();
1103
+ return !!O(i) && (X(e), e.shiftKey ? s.focus.set(i.getParentOrThrow().getKey(), i.getIndexWithinParent(), "element") : i.selectEnd(), !0);
1104
1104
  }
1105
1105
  if (e.shiftKey && (t === "up" || t === "down")) {
1106
- const l = s.focus.getNode();
1106
+ const r = s.focus.getNode();
1107
1107
  if (!s.isCollapsed() && (t === "up" && !s.isBackward() || t === "down" && s.isBackward())) {
1108
- let i = N(l, (C) => O(C));
1108
+ let i = N(r, (C) => O(C));
1109
1109
  if (S(i) && (i = N(i, O)), i !== o || !i) return !1;
1110
1110
  const c = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
1111
1111
  if (!c) return !1;
1112
1112
  let f = 0;
1113
- t === "up" && H(c) && (f = c.getChildrenSize());
1113
+ t === "up" && P(c) && (f = c.getChildrenSize());
1114
1114
  let h = c;
1115
- t === "up" && H(c) && (h = c.getLastChild() || c, f = ce(h) ? h.getTextContentSize() : 0);
1115
+ t === "up" && P(c) && (h = c.getLastChild() || c, f = ce(h) ? h.getTextContentSize() : 0);
1116
1116
  const p = s.clone();
1117
- return p.focus.set(h.getKey(), f, ce(h) ? "text" : "element"), q(p), Y(e), !0;
1117
+ return p.focus.set(h.getKey(), f, ce(h) ? "text" : "element"), q(p), X(e), !0;
1118
1118
  }
1119
- if (ln(l)) {
1119
+ if (ln(r)) {
1120
1120
  const i = t === "up" ? s.getNodes()[s.getNodes().length - 1] : s.getNodes()[0];
1121
- if (i && fe(o, i) !== null) {
1121
+ if (i && ge(o, i) !== null) {
1122
1122
  const c = o.getFirstDescendant(), f = o.getLastDescendant();
1123
1123
  if (!c || !f) return !1;
1124
- const [h] = le(c), [p] = le(f), C = o.getCordsFromCellNode(h, r.table), a = o.getCordsFromCellNode(p, r.table), u = o.getDOMCellFromCordsOrThrow(C.x, C.y, r.table), g = o.getDOMCellFromCordsOrThrow(a.x, a.y, r.table);
1125
- return r.$setAnchorCellForSelection(u), r.$setFocusCellForSelection(g, !0), !0;
1124
+ const [h] = le(c), [p] = le(f), C = o.getCordsFromCellNode(h, l.table), a = o.getCordsFromCellNode(p, l.table), u = o.getDOMCellFromCordsOrThrow(C.x, C.y, l.table), g = o.getDOMCellFromCordsOrThrow(a.x, a.y, l.table);
1125
+ return l.$setAnchorCellForSelection(u), l.$setFocusCellForSelection(g, !0), !0;
1126
1126
  }
1127
1127
  return !1;
1128
1128
  }
1129
1129
  {
1130
- let i = N(l, (f) => H(f) && !f.isInline());
1130
+ let i = N(r, (f) => P(f) && !f.isInline());
1131
1131
  if (S(i) && (i = N(i, O)), !i) return !1;
1132
1132
  const c = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
1133
- if (O(c) && r.tableNodeKey === c.getKey()) {
1133
+ if (O(c) && l.tableNodeKey === c.getKey()) {
1134
1134
  const f = c.getFirstDescendant(), h = c.getLastDescendant();
1135
1135
  if (!f || !h) return !1;
1136
1136
  const [p] = le(f), [C] = le(h), a = s.clone();
1137
- return a.focus.set((t === "up" ? p : C).getKey(), t === "up" ? 0 : C.getChildrenSize(), "element"), Y(e), q(a), !0;
1137
+ return a.focus.set((t === "up" ? p : C).getKey(), t === "up" ? 0 : C.getChildrenSize(), "element"), X(e), q(a), !0;
1138
1138
  }
1139
1139
  }
1140
1140
  }
1141
1141
  }
1142
- return t === "down" && Rt(n) && r.setShouldCheckSelection(), !1;
1142
+ return t === "down" && Rt(n) && l.setShouldCheckSelection(), !1;
1143
1143
  }
1144
1144
  if (z(s)) {
1145
1145
  if (t === "backward" || t === "forward")
1146
- return kn(n, e, s, e.shiftKey ? "extend" : "move", t === "backward", o, r);
1146
+ return En(n, e, s, e.shiftKey ? "extend" : "move", t === "backward", o, l);
1147
1147
  if (s.isCollapsed()) {
1148
- const { anchor: l, focus: i } = s, c = N(l.getNode(), S), f = N(i.getNode(), S);
1148
+ const { anchor: r, focus: i } = s, c = N(r.getNode(), S), f = N(i.getNode(), S);
1149
1149
  if (!S(c) || !c.is(f)) return !1;
1150
1150
  const h = ae(c);
1151
1151
  if (h !== o && h != null) {
1152
1152
  const m = G(h, n.getElementByKey(h.getKey()));
1153
- if (m != null) return r.table = ie(h, m), vt(n, e, t, h, r);
1153
+ if (m != null) return l.table = ie(h, m), vt(n, e, t, h, l);
1154
1154
  }
1155
- const p = n.getElementByKey(c.__key), C = n.getElementByKey(l.key);
1155
+ const p = n.getElementByKey(c.__key), C = n.getElementByKey(r.key);
1156
1156
  if (C == null || p == null) return !1;
1157
1157
  let a;
1158
- if (l.type === "element") a = C.getBoundingClientRect();
1158
+ if (r.type === "element") a = C.getBoundingClientRect();
1159
1159
  else {
1160
1160
  const m = Te(Xe(n));
1161
1161
  if (m === null || m.rangeCount === 0) return !1;
@@ -1167,32 +1167,32 @@ function vt(n, e, t, o, r) {
1167
1167
  if (g == null) return !1;
1168
1168
  const d = g.getBoundingClientRect();
1169
1169
  if (t === "up" ? d.top > a.top - a.height : a.bottom + a.height > d.bottom) {
1170
- Y(e);
1171
- const m = o.getCordsFromCellNode(c, r.table);
1172
- if (!e.shiftKey) return On(r, o, m.x, m.y, t);
1170
+ X(e);
1171
+ const m = o.getCordsFromCellNode(c, l.table);
1172
+ if (!e.shiftKey) return On(l, o, m.x, m.y, t);
1173
1173
  {
1174
- const _ = o.getDOMCellFromCordsOrThrow(m.x, m.y, r.table);
1175
- r.$setAnchorCellForSelection(_), r.$setFocusCellForSelection(_, !0);
1174
+ const _ = o.getDOMCellFromCordsOrThrow(m.x, m.y, l.table);
1175
+ l.$setAnchorCellForSelection(_), l.$setFocusCellForSelection(_, !0);
1176
1176
  }
1177
1177
  return !0;
1178
1178
  }
1179
1179
  }
1180
1180
  } else if (R(s)) {
1181
- const { anchor: l, focus: i } = s, c = N(l.getNode(), S), f = N(i.getNode(), S), [h] = s.getNodes();
1181
+ const { anchor: r, focus: i } = s, c = N(r.getNode(), S), f = N(i.getNode(), S), [h] = s.getNodes();
1182
1182
  O(h) || w(251);
1183
1183
  const p = G(h, n.getElementByKey(h.getKey()));
1184
1184
  if (!S(c) || !S(f) || !O(h) || p == null) return !1;
1185
- r.$updateTableTableSelection(s);
1185
+ l.$updateTableTableSelection(s);
1186
1186
  const C = ie(h, p), a = o.getCordsFromCellNode(c, C), u = o.getDOMCellFromCordsOrThrow(a.x, a.y, C);
1187
- if (r.$setAnchorCellForSelection(u), Y(e), e.shiftKey) {
1187
+ if (l.$setAnchorCellForSelection(u), X(e), e.shiftKey) {
1188
1188
  const [g, d, m] = U(o, c, f);
1189
- return An(r, g, d, m, t);
1189
+ return An(l, g, d, m, t);
1190
1190
  }
1191
1191
  return f.selectEnd(), !0;
1192
1192
  }
1193
1193
  return !1;
1194
1194
  }
1195
- function Y(n) {
1195
+ function X(n) {
1196
1196
  n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
1197
1197
  }
1198
1198
  function dt(n, e, t) {
@@ -1202,10 +1202,10 @@ function dt(n, e, t) {
1202
1202
  function ft(n, e, t) {
1203
1203
  const o = t.getParent();
1204
1204
  if (!o) return;
1205
- const r = Te(Xe(n));
1206
- if (!r) return;
1207
- const s = r.anchorNode, l = n.getElementByKey(o.getKey()), i = G(t, n.getElementByKey(t.getKey()));
1208
- if (!s || !l || !i || !l.contains(s) || i.contains(s)) return;
1205
+ const l = Te(Xe(n));
1206
+ if (!l) return;
1207
+ const s = l.anchorNode, r = n.getElementByKey(o.getKey()), i = G(t, n.getElementByKey(t.getKey()));
1208
+ if (!s || !r || !i || !r.contains(s) || i.contains(s)) return;
1209
1209
  const c = N(e.anchor.getNode(), (_) => S(_));
1210
1210
  if (!c) return;
1211
1211
  const f = N(c, (_) => O(_));
@@ -1213,30 +1213,30 @@ function ft(n, e, t) {
1213
1213
  const [h, p] = U(t, c, c), C = h[0][0], a = h[h.length - 1][h[0].length - 1], { startRow: u, startColumn: g } = p, d = u === C.startRow && g === C.startColumn, m = u === a.startRow && g === a.startColumn;
1214
1214
  return d ? "first" : m ? "last" : void 0;
1215
1215
  }
1216
- function Q(n, e) {
1216
+ function Z(n, e) {
1217
1217
  const { tableNode: t } = n.$lookup(), o = t.getCordsFromCellNode(e, n.table);
1218
1218
  return t.getDOMCellFromCordsOrThrow(o.x, o.y, n.table);
1219
1219
  }
1220
- function ze(n, e, t) {
1221
- return fe(n, V(e, t));
1220
+ function Le(n, e, t) {
1221
+ return ge(n, V(e, t));
1222
1222
  }
1223
1223
  function gt(n, e, t) {
1224
1224
  if (!e.theme.tableAlignment) return;
1225
- const o = [], r = [];
1225
+ const o = [], l = [];
1226
1226
  for (const s of ["center", "right"]) {
1227
- const l = e.theme.tableAlignment[s];
1228
- l && (s === t ? r : o).push(l);
1227
+ const r = e.theme.tableAlignment[s];
1228
+ r && (s === t ? l : o).push(r);
1229
1229
  }
1230
- se(n, ...o), X(n, ...r);
1230
+ se(n, ...o), Y(n, ...l);
1231
1231
  }
1232
- const Le = /* @__PURE__ */ new WeakSet();
1232
+ const He = /* @__PURE__ */ new WeakSet();
1233
1233
  function Rt(n = Ct()) {
1234
- return Le.has(n);
1234
+ return He.has(n);
1235
1235
  }
1236
1236
  function qn(n, e) {
1237
- e ? Le.add(n) : Le.delete(n);
1237
+ e ? He.add(n) : He.delete(n);
1238
1238
  }
1239
- class Z extends Pe {
1239
+ class Q extends Pe {
1240
1240
  static getType() {
1241
1241
  return "table";
1242
1242
  }
@@ -1248,7 +1248,7 @@ class Z extends Pe {
1248
1248
  return t.__colWidths = e, t;
1249
1249
  }
1250
1250
  static clone(e) {
1251
- return new Z(e.__key);
1251
+ return new Q(e.__key);
1252
1252
  }
1253
1253
  afterCloneFrom(e) {
1254
1254
  super.afterCloneFrom(e), this.__colWidths = e.__colWidths, this.__rowStriping = e.__rowStriping, this.__frozenColumnCount = e.__frozenColumnCount, this.__frozenRowCount = e.__frozenRowCount;
@@ -1257,7 +1257,7 @@ class Z extends Pe {
1257
1257
  return { table: (e) => ({ conversion: $n, priority: 1 }) };
1258
1258
  }
1259
1259
  static importJSON(e) {
1260
- return qe().updateFromJSON(e);
1260
+ return Ue().updateFromJSON(e);
1261
1261
  }
1262
1262
  updateFromJSON(e) {
1263
1263
  return super.updateFromJSON(e).setRowStriping(e.rowStriping || !1).setFrozenColumns(e.frozenColumnCount || 0).setFrozenRows(e.frozenRowCount || 0).setColWidths(e.colWidths);
@@ -1278,25 +1278,28 @@ class Z extends Pe {
1278
1278
  createDOM(e, t) {
1279
1279
  const o = document.createElement("table");
1280
1280
  this.__style && (o.style.cssText = this.__style);
1281
- const r = document.createElement("colgroup");
1282
- if (o.appendChild(r), Pt(r), X(o, e.theme.table), this.updateTableElement(null, o, e), Rt(t)) {
1283
- const s = document.createElement("div"), l = e.theme.tableScrollableWrapper;
1284
- return l ? X(s, l) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), s;
1281
+ const l = document.createElement("colgroup");
1282
+ if (o.appendChild(l), Ht(l), Y(o, e.theme.table), this.updateTableElement(null, o, e), Rt(t)) {
1283
+ const s = document.createElement("div"), r = e.theme.tableScrollableWrapper;
1284
+ return r ? Y(s, r) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), this.updateTableWrapper(null, s, o, e), s;
1285
1285
  }
1286
1286
  return o;
1287
1287
  }
1288
+ updateTableWrapper(e, t, o, l) {
1289
+ this.__frozenColumnCount !== (e ? e.__frozenColumnCount : 0) && function(s, r, i, c) {
1290
+ c > 0 ? (Y(s, i.theme.tableFrozenColumn), r.setAttribute("data-lexical-frozen-column", "true")) : (se(s, i.theme.tableFrozenColumn), r.removeAttribute("data-lexical-frozen-column"));
1291
+ }(t, o, l, this.__frozenColumnCount), this.__frozenRowCount !== (e ? e.__frozenRowCount : 0) && function(s, r, i, c) {
1292
+ c > 0 ? (Y(s, i.theme.tableFrozenRow), r.setAttribute("data-lexical-frozen-row", "true")) : (se(s, i.theme.tableFrozenRow), r.removeAttribute("data-lexical-frozen-row"));
1293
+ }(t, o, l, this.__frozenRowCount);
1294
+ }
1288
1295
  updateTableElement(e, t, o) {
1289
- this.__style !== (e ? e.__style : "") && (t.style.cssText = this.__style), this.__rowStriping !== (!!e && e.__rowStriping) && function(r, s, l) {
1290
- l ? (X(r, s.theme.tableRowStriping), r.setAttribute("data-lexical-row-striping", "true")) : (se(r, s.theme.tableRowStriping), r.removeAttribute("data-lexical-row-striping"));
1291
- }(t, o, this.__rowStriping), this.__frozenColumnCount !== (e ? e.__frozenColumnCount : 0) && function(r, s, l) {
1292
- l > 0 ? (X(r, s.theme.tableFrozenColumn), r.setAttribute("data-lexical-frozen-column", "true")) : (se(r, s.theme.tableFrozenColumn), r.removeAttribute("data-lexical-frozen-column"));
1293
- }(t, o, this.__frozenColumnCount), this.__frozenRowCount !== (e ? e.__frozenRowCount : 0) && function(r, s, l) {
1294
- l > 0 ? (X(r, s.theme.tableFrozenRow), r.setAttribute("data-lexical-frozen-row", "true")) : (se(r, s.theme.tableFrozenRow), r.removeAttribute("data-lexical-frozen-row"));
1295
- }(t, o, this.__frozenRowCount), function(r, s, l, i) {
1296
- const c = r.querySelector("colgroup");
1296
+ this.__style !== (e ? e.__style : "") && (t.style.cssText = this.__style), this.__rowStriping !== (!!e && e.__rowStriping) && function(l, s, r) {
1297
+ r ? (Y(l, s.theme.tableRowStriping), l.setAttribute("data-lexical-row-striping", "true")) : (se(l, s.theme.tableRowStriping), l.removeAttribute("data-lexical-row-striping"));
1298
+ }(t, o, this.__rowStriping), function(l, s, r, i) {
1299
+ const c = l.querySelector("colgroup");
1297
1300
  if (!c) return;
1298
1301
  const f = [];
1299
- for (let h = 0; h < l; h++) {
1302
+ for (let h = 0; h < r; h++) {
1300
1303
  const p = document.createElement("col"), C = i && i[h];
1301
1304
  C && (p.style.width = `${C}px`), f.push(p);
1302
1305
  }
@@ -1304,42 +1307,44 @@ class Z extends Pe {
1304
1307
  }(t, 0, this.getColumnCount(), this.getColWidths()), gt(t, o, this.getFormatType());
1305
1308
  }
1306
1309
  updateDOM(e, t, o) {
1307
- return this.updateTableElement(e, this.getDOMSlot(t).element, o), !1;
1310
+ const l = this.getDOMSlot(t).element;
1311
+ var s;
1312
+ return fe(s = t) && s.nodeName === "DIV" && this.updateTableWrapper(e, t, l, o), this.updateTableElement(e, this.getDOMSlot(t).element, o), !1;
1308
1313
  }
1309
1314
  exportDOM(e) {
1310
1315
  const t = super.exportDOM(e), { element: o } = t;
1311
- return { after: (r) => {
1312
- if (t.after && (r = t.after(r)), !oe(r) && ye(r) && (r = r.querySelector("table")), !oe(r)) return null;
1313
- gt(r, e._config, this.getFormatType());
1314
- const [s] = Je(this, null, null), l = /* @__PURE__ */ new Map();
1316
+ return { after: (l) => {
1317
+ if (t.after && (l = t.after(l)), !oe(l) && fe(l) && (l = l.querySelector("table")), !oe(l)) return null;
1318
+ gt(l, e._config, this.getFormatType());
1319
+ const [s] = Ye(this, null, null), r = /* @__PURE__ */ new Map();
1315
1320
  for (const h of s) for (const p of h) {
1316
1321
  const C = p.cell.getKey();
1317
- l.has(C) || l.set(C, { colSpan: p.cell.getColSpan(), startColumn: p.startColumn });
1322
+ r.has(C) || r.set(C, { colSpan: p.cell.getColSpan(), startColumn: p.startColumn });
1318
1323
  }
1319
1324
  const i = /* @__PURE__ */ new Set();
1320
- for (const h of r.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")) {
1325
+ for (const h of l.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")) {
1321
1326
  const p = h.getAttribute("data-temporary-table-cell-lexical-key");
1322
1327
  if (p) {
1323
- const C = l.get(p);
1328
+ const C = r.get(p);
1324
1329
  if (h.removeAttribute("data-temporary-table-cell-lexical-key"), C) {
1325
- l.delete(p);
1330
+ r.delete(p);
1326
1331
  for (let a = 0; a < C.colSpan; a++) i.add(a + C.startColumn);
1327
1332
  }
1328
1333
  }
1329
1334
  }
1330
- const c = r.querySelector(":scope > colgroup");
1335
+ const c = l.querySelector(":scope > colgroup");
1331
1336
  if (c) {
1332
- const h = Array.from(r.querySelectorAll(":scope > colgroup > col")).filter((p, C) => i.has(C));
1337
+ const h = Array.from(l.querySelectorAll(":scope > colgroup > col")).filter((p, C) => i.has(C));
1333
1338
  c.replaceChildren(...h);
1334
1339
  }
1335
- const f = r.querySelectorAll(":scope > tr");
1340
+ const f = l.querySelectorAll(":scope > tr");
1336
1341
  if (f.length > 0) {
1337
1342
  const h = document.createElement("tbody");
1338
1343
  for (const p of f) h.appendChild(p);
1339
- r.append(h);
1344
+ l.append(h);
1340
1345
  }
1341
- return r;
1342
- }, element: !oe(o) && ye(o) ? o.querySelector("table") : o };
1346
+ return l;
1347
+ }, element: !oe(o) && fe(o) ? o.querySelector("table") : o };
1343
1348
  }
1344
1349
  canBeEmpty() {
1345
1350
  return !1;
@@ -1348,39 +1353,39 @@ class Z extends Pe {
1348
1353
  return !0;
1349
1354
  }
1350
1355
  getCordsFromCellNode(e, t) {
1351
- const { rows: o, domRows: r } = t;
1356
+ const { rows: o, domRows: l } = t;
1352
1357
  for (let s = 0; s < o; s++) {
1353
- const l = r[s];
1354
- if (l != null) for (let i = 0; i < l.length; i++) {
1355
- const c = l[i];
1358
+ const r = l[s];
1359
+ if (r != null) for (let i = 0; i < r.length; i++) {
1360
+ const c = r[i];
1356
1361
  if (c == null) continue;
1357
- const { elem: f } = c, h = ze(this, f);
1362
+ const { elem: f } = c, h = Le(this, f);
1358
1363
  if (h !== null && e.is(h)) return { x: i, y: s };
1359
1364
  }
1360
1365
  }
1361
1366
  throw new Error("Cell not found in table.");
1362
1367
  }
1363
1368
  getDOMCellFromCords(e, t, o) {
1364
- const { domRows: r } = o, s = r[t];
1369
+ const { domRows: l } = o, s = l[t];
1365
1370
  if (s == null) return null;
1366
- const l = s[e < s.length ? e : s.length - 1];
1367
- return l ?? null;
1371
+ const r = s[e < s.length ? e : s.length - 1];
1372
+ return r ?? null;
1368
1373
  }
1369
1374
  getDOMCellFromCordsOrThrow(e, t, o) {
1370
- const r = this.getDOMCellFromCords(e, t, o);
1371
- if (!r) throw new Error("Cell not found at cords.");
1372
- return r;
1375
+ const l = this.getDOMCellFromCords(e, t, o);
1376
+ if (!l) throw new Error("Cell not found at cords.");
1377
+ return l;
1373
1378
  }
1374
1379
  getCellNodeFromCords(e, t, o) {
1375
- const r = this.getDOMCellFromCords(e, t, o);
1376
- if (r == null) return null;
1377
- const s = V(r.elem);
1380
+ const l = this.getDOMCellFromCords(e, t, o);
1381
+ if (l == null) return null;
1382
+ const s = V(l.elem);
1378
1383
  return S(s) ? s : null;
1379
1384
  }
1380
1385
  getCellNodeFromCordsOrThrow(e, t, o) {
1381
- const r = this.getCellNodeFromCords(e, t, o);
1382
- if (!r) throw new Error("Node at cords not TableCellNode.");
1383
- return r;
1386
+ const l = this.getCellNodeFromCords(e, t, o);
1387
+ if (!l) throw new Error("Node at cords not TableCellNode.");
1388
+ return l;
1384
1389
  }
1385
1390
  getRowStriping() {
1386
1391
  return !!this.getLatest().__rowStriping;
@@ -1418,19 +1423,19 @@ class Z extends Pe {
1418
1423
  }), t;
1419
1424
  }
1420
1425
  }
1421
- function En(n, e) {
1426
+ function kn(n, e) {
1422
1427
  const t = n.getElementByKey(e.getKey());
1423
1428
  return t === null && w(230), ie(e, t);
1424
1429
  }
1425
1430
  function $n(n) {
1426
- const e = qe();
1431
+ const e = Ue();
1427
1432
  n.hasAttribute("data-lexical-row-striping") && e.setRowStriping(!0);
1428
1433
  const t = n.querySelector(":scope > colgroup");
1429
1434
  if (t) {
1430
1435
  let o = [];
1431
- for (const r of t.querySelectorAll(":scope > col")) {
1432
- let s = r.style.width || "";
1433
- if (!Be.test(s) && (s = r.getAttribute("width") || "", !/^\d+$/.test(s))) {
1436
+ for (const l of t.querySelectorAll(":scope > col")) {
1437
+ let s = l.style.width || "";
1438
+ if (!Be.test(s) && (s = l.getAttribute("width") || "", !/^\d+$/.test(s))) {
1434
1439
  o = void 0;
1435
1440
  break;
1436
1441
  }
@@ -1438,66 +1443,66 @@ function $n(n) {
1438
1443
  }
1439
1444
  o && e.setColWidths(o);
1440
1445
  }
1441
- return { after: (o) => mt(o, E), node: e };
1446
+ return { after: (o) => mt(o, k), node: e };
1442
1447
  }
1443
- function qe() {
1444
- return He(new Z());
1448
+ function Ue() {
1449
+ return We(new Q());
1445
1450
  }
1446
1451
  function O(n) {
1447
- return n instanceof Z;
1452
+ return n instanceof Q;
1448
1453
  }
1449
1454
  function Mn({ rows: n, columns: e, includeHeaders: t }) {
1450
- const o = L();
1455
+ const o = L() || ke();
1451
1456
  if (!o || !z(o) || ae(o.anchor.getNode())) return !1;
1452
- const r = wn(Number(n), Number(e), t);
1453
- Mt(r);
1454
- const s = r.getFirstDescendant();
1457
+ const l = wn(Number(n), Number(e), t);
1458
+ Mt(l);
1459
+ const s = l.getFirstDescendant();
1455
1460
  return ce(s) && s.select(), !0;
1456
1461
  }
1457
1462
  function zn(n) {
1458
- E(n.getParent()) ? n.isEmpty() && n.append(j()) : n.remove();
1463
+ k(n.getParent()) ? n.isEmpty() && n.append(j()) : n.remove();
1459
1464
  }
1460
1465
  function Ln(n) {
1461
1466
  O(n.getParent()) ? pt(n, S) : n.remove();
1462
1467
  }
1463
- function Pn(n) {
1464
- pt(n, E);
1465
- const [e] = Je(n, null, null), t = e.reduce((r, s) => Math.max(r, s.length), 0), o = n.getChildren();
1466
- for (let r = 0; r < e.length; ++r) {
1467
- const s = o[r];
1468
+ function Hn(n) {
1469
+ pt(n, k);
1470
+ const [e] = Ye(n, null, null), t = e.reduce((l, s) => Math.max(l, s.length), 0), o = n.getChildren();
1471
+ for (let l = 0; l < e.length; ++l) {
1472
+ const s = o[l];
1468
1473
  if (!s) continue;
1469
- E(s) || w(254, s.constructor.name, s.getType());
1470
- const l = e[r].reduce((i, c) => c ? 1 + i : i, 0);
1471
- if (l !== t) for (let i = l; i < t; ++i) {
1472
- const c = ge();
1474
+ k(s) || w(254, s.constructor.name, s.getType());
1475
+ const r = e[l].reduce((i, c) => c ? 1 + i : i, 0);
1476
+ if (r !== t) for (let i = r; i < t; ++i) {
1477
+ const c = me();
1473
1478
  c.append(j()), s.append(c);
1474
1479
  }
1475
1480
  }
1476
1481
  }
1477
- function Hn(n) {
1482
+ function Pn(n) {
1478
1483
  if (n.detail < 3 || !de(n.target)) return !1;
1479
1484
  const e = V(n.target);
1480
1485
  if (e === null) return !1;
1481
- const t = N(e, (o) => H(o) && !o.isInline());
1486
+ const t = N(e, (o) => P(o) && !o.isInline());
1482
1487
  return t === null ? !1 : !!S(t.getParent()) && (t.select(0), !0);
1483
1488
  }
1484
1489
  function Un(n) {
1485
1490
  return n.registerNodeTransform(ee, (e) => {
1486
1491
  if (e.getColSpan() > 1 || e.getRowSpan() > 1) {
1487
- const [, , t] = le(e), [o] = U(t, e, e), r = o.length, s = o[0].length;
1488
- let l = t.getFirstChild();
1489
- E(l) || w(175);
1492
+ const [, , t] = le(e), [o] = U(t, e, e), l = o.length, s = o[0].length;
1493
+ let r = t.getFirstChild();
1494
+ k(r) || w(175);
1490
1495
  const i = [];
1491
- for (let c = 0; c < r; c++) {
1492
- c !== 0 && (l = l.getNextSibling(), E(l) || w(175));
1496
+ for (let c = 0; c < l; c++) {
1497
+ c !== 0 && (r = r.getNextSibling(), k(r) || w(175));
1493
1498
  let f = null;
1494
1499
  for (let h = 0; h < s; h++) {
1495
1500
  const p = o[c][h], C = p.cell;
1496
1501
  if (p.startRow === c && p.startColumn === h) f = C, i.push(C);
1497
1502
  else if (C.getColSpan() > 1 || C.getRowSpan() > 1) {
1498
1503
  S(C) || w(176);
1499
- const a = ge(C.__headerState);
1500
- f !== null ? f.insertAfter(a) : $t(l, a);
1504
+ const a = me(C.__headerState);
1505
+ f !== null ? f.insertAfter(a) : $t(r, a);
1501
1506
  }
1502
1507
  }
1503
1508
  }
@@ -1506,45 +1511,45 @@ function Un(n) {
1506
1511
  });
1507
1512
  }
1508
1513
  function jn(n, e = !0) {
1509
- const t = /* @__PURE__ */ new Map(), o = (s, l, i) => {
1514
+ const t = /* @__PURE__ */ new Map(), o = (s, r, i) => {
1510
1515
  const c = G(s, i), f = Kn(s, c, n, e);
1511
- t.set(l, [f, c]);
1512
- }, r = n.registerMutationListener(Z, (s) => {
1516
+ t.set(r, [f, c]);
1517
+ }, l = n.registerMutationListener(Q, (s) => {
1513
1518
  n.getEditorState().read(() => {
1514
- for (const [l, i] of s) {
1515
- const c = t.get(l);
1519
+ for (const [r, i] of s) {
1520
+ const c = t.get(r);
1516
1521
  if (i === "created" || i === "updated") {
1517
- const { tableNode: f, tableElement: h } = xt(l);
1518
- c === void 0 ? o(f, l, h) : h !== c[1] && (c[0].removeListeners(), t.delete(l), o(f, l, h));
1519
- } else i === "destroyed" && c !== void 0 && (c[0].removeListeners(), t.delete(l));
1522
+ const { tableNode: f, tableElement: h } = xt(r);
1523
+ c === void 0 ? o(f, r, h) : h !== c[1] && (c[0].removeListeners(), t.delete(r), o(f, r, h));
1524
+ } else i === "destroyed" && c !== void 0 && (c[0].removeListeners(), t.delete(r));
1520
1525
  }
1521
1526
  }, { editor: n });
1522
1527
  }, { skipInitialization: !1 });
1523
1528
  return () => {
1524
- r();
1529
+ l();
1525
1530
  for (const [, [s]] of t) s.removeListeners();
1526
1531
  };
1527
1532
  }
1528
1533
  function Vn(n) {
1529
- return n.hasNodes([Z]) || w(255), Et(n.registerCommand(Cn, Mn, Oe), n.registerCommand(_t, ({ nodes: e, selection: t }) => z(t) ? ae(t.anchor.getNode()) !== null && e.some(O) : !1, Oe), n.registerCommand(Ht, Hn, Oe), n.registerNodeTransform(Z, Pn), n.registerNodeTransform(me, Ln), n.registerNodeTransform(ee, zn));
1534
+ return n.hasNodes([Q]) || w(255), kt(n.registerCommand(Cn, Mn, Oe), n.registerCommand(_t, ({ nodes: e, selection: t }) => z(t) ? ae(t.anchor.getNode()) !== null && e.some(O) : !1, Oe), n.registerCommand(Pt, Pn, Oe), n.registerNodeTransform(Q, Hn), n.registerNodeTransform(pe, Ln), n.registerNodeTransform(ee, zn));
1530
1535
  }
1531
1536
  export {
1532
- Xn as B,
1537
+ Yn as B,
1533
1538
  bn as H,
1534
- De as K,
1535
- wn as L,
1536
- me as O,
1539
+ Ie as K,
1540
+ In as L,
1541
+ pe as O,
1537
1542
  Jn as P,
1538
1543
  qn as Q,
1539
1544
  S as T,
1540
- yt as W,
1541
- Z,
1545
+ wn as W,
1546
+ Q as Z,
1542
1547
  Vn as d,
1543
1548
  jn as h,
1544
- Yn as j,
1549
+ Xn as j,
1545
1550
  Un as u,
1546
- ge as v,
1551
+ me as v,
1547
1552
  ee as y,
1548
- In as z
1553
+ yt as z
1549
1554
  };
1550
- //# sourceMappingURL=LexicalTable.prod-BsmIydKv.js.map
1555
+ //# sourceMappingURL=LexicalTable.prod-CYafu_j9.js.map