@uva-glass/component-library 3.34.1 → 3.34.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 (49) hide show
  1. package/dist/{Lexical.prod-BjpEXQJZ.js → Lexical.prod-C7FcGFd7.js} +528 -522
  2. package/dist/Lexical.prod-C7FcGFd7.js.map +1 -0
  3. package/dist/{LexicalClipboard.prod-B4j0EyWx.js → LexicalClipboard.prod-CeOlk1NB.js} +104 -104
  4. package/dist/{LexicalClipboard.prod-B4j0EyWx.js.map → LexicalClipboard.prod-CeOlk1NB.js.map} +1 -1
  5. package/dist/{LexicalLink.prod-CYNCWmMx.js → LexicalLink.prod-CSI9BSPD.js} +46 -46
  6. package/dist/{LexicalLink.prod-CYNCWmMx.js.map → LexicalLink.prod-CSI9BSPD.js.map} +1 -1
  7. package/dist/{LexicalList.prod-BRwEushm.js → LexicalList.prod-TMA2LN4v.js} +46 -46
  8. package/dist/{LexicalList.prod-BRwEushm.js.map → LexicalList.prod-TMA2LN4v.js.map} +1 -1
  9. package/dist/{LexicalSelection.prod-DYo5_Y2k.js → LexicalSelection.prod-DDwSrdAV.js} +31 -31
  10. package/dist/{LexicalSelection.prod-DYo5_Y2k.js.map → LexicalSelection.prod-DDwSrdAV.js.map} +1 -1
  11. package/dist/{LexicalTable.prod-BArw8Dt5.js → LexicalTable.prod-DYP5JQC0.js} +268 -268
  12. package/dist/{LexicalTable.prod-BArw8Dt5.js.map → LexicalTable.prod-DYP5JQC0.js.map} +1 -1
  13. package/dist/{LexicalUtils.prod-DJRX2pwP.js → LexicalUtils.prod-D_SPJ6vo.js} +42 -42
  14. package/dist/{LexicalUtils.prod-DJRX2pwP.js.map → LexicalUtils.prod-D_SPJ6vo.js.map} +1 -1
  15. package/dist/{TablePlugin-BagQHe1w.js → TablePlugin-CI_6HCsd.js} +56 -56
  16. package/dist/{TablePlugin-BagQHe1w.js.map → TablePlugin-CI_6HCsd.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/PeriodSelector/PeriodSelector.js +1 -1
  25. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  26. package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
  27. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  28. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +6 -6
  29. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +10 -10
  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 +43 -43
  33. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  34. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +30 -30
  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 +12 -12
  39. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  40. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +17 -17
  41. package/dist/components/RteEditor/Plugins/index.js +1 -1
  42. package/dist/components/RteEditor/RteEditor.js +201 -201
  43. package/dist/components/RteEditor/helpers.js +6 -6
  44. package/dist/components/index.js +1 -1
  45. package/dist/{helpers-DM8qHaKY.js → helpers-CYiLlioz.js} +38 -38
  46. package/dist/{helpers-DM8qHaKY.js.map → helpers-CYiLlioz.js.map} +1 -1
  47. package/dist/index.js +1 -1
  48. package/package.json +5 -5
  49. package/dist/Lexical.prod-BjpEXQJZ.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { w as T, r as Z, i as ge, _ as vt, j as Xt, N as Yt, T as xt, S as qt, L as jt } from "./LexicalUtils.prod-DJRX2pwP.js";
2
- import { y as Ge, v as Ne, h as Qe, d as Vt, i as Ce, e as ct, R as I, r as et, j as Zt, k as Tt, T as re, l as Gt, W as De, n as Rt, g as z, f as Qt, o as be, m as D, D as B, P as Ue, C as Ae, q as en, A as tn, t as nn, x as on, z as Ie, I as rn, F as ln, G as Ft, _ as sn, U as j, K as an, N as cn, O as un, Q as hn, $ as dn, V as fn, X as gn, Y as mn, Z as fe, E as ne, a0 as Me, a1 as pn, a as Kt, a2 as Cn, B as tt, a3 as _n, u as Sn, a4 as Ee, a5 as wn, a6 as yn, a7 as ut, a8 as bn, a9 as ht, s as Nn, aa as dt, M as ft, S as Re, ab as vn, w as xn, ac as Tn, ad as Rn } from "./Lexical.prod-BjpEXQJZ.js";
3
- import { F as Fn, J as Kn } from "./LexicalClipboard.prod-B4j0EyWx.js";
1
+ import { w as T, r as Q, i as ge, _ as xt, j as Xt, N as Yt, T as vt, S as qt, L as jt } from "./LexicalUtils.prod-D_SPJ6vo.js";
2
+ import { m as Ze, T as Ne, g as Ge, e as Vt, s as Ce, h as ct, B as I, i as et, j as Qt, k as Tt, l as re, n as Zt, J as De, p as Rt, _ as z, d as Gt, r as ye, x as D, P as B, F as Ue, S as Ae, t as en, D as tn, u as nn, w as on, U as Ie, z as rn, A as ln, C as Ft, G as sn, V as j, H as an, K as cn, L as un, N as hn, Q as dn, R as fn, X as gn, Y as mn, Z as fe, M as ne, a0 as Me, a1 as pn, a as Ot, a2 as Cn, W as tt, a3 as _n, f as Sn, a4 as Ee, a5 as wn, a6 as bn, a7 as ut, a8 as yn, a9 as ht, o as Nn, aa as dt, O as ft, v as Re, ab as xn, E as vn, ac as Tn, ad as Rn } from "./Lexical.prod-C7FcGFd7.js";
3
+ import { F as Fn, J as On } from "./LexicalClipboard.prod-CeOlk1NB.js";
4
4
  const nt = /^(\d+(?:\.\d+)?)px$/, L = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
5
- class ce extends Ge {
5
+ class ce extends Ze {
6
6
  static getType() {
7
7
  return "tablecell";
8
8
  }
@@ -26,7 +26,7 @@ class ce extends Ge {
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), Xe(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), Z(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), Xe(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), Q(t, e.theme.tableCell, this.hasHeader() && e.theme.tableCellHeader), t;
30
30
  }
31
31
  exportDOM(e) {
32
32
  const t = super.exportDOM(e);
@@ -138,19 +138,19 @@ function gt(n) {
138
138
  }, node: r };
139
139
  }
140
140
  function X(n = L.NO_STATUS, e = 1, t) {
141
- return Qe(new ce(n, e, t));
141
+ return Ge(new ce(n, e, t));
142
142
  }
143
143
  function w(n) {
144
144
  return n instanceof ce;
145
145
  }
146
- const On = Qt("INSERT_TABLE_COMMAND");
147
- function y(n, ...e) {
146
+ const Kn = Gt("INSERT_TABLE_COMMAND");
147
+ function b(n, ...e) {
148
148
  const t = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
149
149
  o.append("code", n);
150
150
  for (const r of e) o.append("v", r);
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 Te extends Ge {
153
+ class Te extends Ze {
154
154
  static getType() {
155
155
  return "tablerow";
156
156
  }
@@ -161,7 +161,7 @@ class Te extends Ge {
161
161
  return { tr: (e) => ({ conversion: An, priority: 0 }) };
162
162
  }
163
163
  static importJSON(e) {
164
- return xe().updateFromJSON(e);
164
+ return ve().updateFromJSON(e);
165
165
  }
166
166
  updateFromJSON(e) {
167
167
  return super.updateFromJSON(e).setHeight(e.height);
@@ -175,7 +175,7 @@ class Te extends Ge {
175
175
  }
176
176
  createDOM(e) {
177
177
  const t = document.createElement("tr");
178
- return this.__height && (t.style.height = `${this.__height}px`), Z(t, e.theme.tableRow), t;
178
+ return this.__height && (t.style.height = `${this.__height}px`), Q(t, e.theme.tableRow), t;
179
179
  }
180
180
  extractWithChild(e, t, o) {
181
181
  return o === "html";
@@ -203,19 +203,19 @@ class Te extends Ge {
203
203
  function An(n) {
204
204
  const e = n;
205
205
  let t;
206
- return nt.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => vt(o, w), node: xe(t) };
206
+ return nt.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => xt(o, w), node: ve(t) };
207
207
  }
208
- function xe(n) {
209
- return Qe(new Te(n));
208
+ function ve(n) {
209
+ return Ge(new Te(n));
210
210
  }
211
211
  function A(n) {
212
212
  return n instanceof Te;
213
213
  }
214
214
  const ot = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, En = ot && "documentMode" in document ? document.documentMode : null, mt = ot && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
215
- function $n(n, e, t = !0) {
215
+ function kn(n, e, t = !0) {
216
216
  const o = st();
217
217
  for (let r = 0; r < n; r++) {
218
- const s = xe();
218
+ const s = ve();
219
219
  for (let l = 0; l < e; l++) {
220
220
  let i = L.NO_STATUS;
221
221
  typeof t == "object" ? (r === 0 && t.rows && (i |= L.ROW), l === 0 && t.columns && (i |= L.COLUMN)) : t && (r === 0 && (i |= L.ROW), l === 0 && (i |= L.COLUMN));
@@ -230,30 +230,30 @@ function io(n) {
230
230
  const e = T(n, (t) => w(t));
231
231
  return w(e) ? e : null;
232
232
  }
233
- function Ot(n) {
233
+ function Kt(n) {
234
234
  const e = T(n, (t) => A(t));
235
235
  if (A(e)) return e;
236
236
  throw new Error("Expected table cell to be inside of table row.");
237
237
  }
238
238
  function At(n) {
239
- const e = T(n, (t) => k(t));
240
- if (k(e)) return e;
239
+ const e = T(n, (t) => $(t));
240
+ if ($(e)) return e;
241
241
  throw new Error("Expected table cell to be inside of table.");
242
242
  }
243
243
  function ao(n) {
244
- const e = Ot(n);
244
+ const e = Kt(n);
245
245
  return At(e).getChildren().findIndex((t) => t.is(e));
246
246
  }
247
247
  function co(n) {
248
- return Ot(n).getChildren().findIndex((e) => e.is(n));
248
+ return Kt(n).getChildren().findIndex((e) => e.is(n));
249
249
  }
250
250
  ot && "InputEvent" in window && !En && new window.InputEvent("input");
251
251
  const Ye = (n, e) => n === L.BOTH || n === e ? e : L.NO_STATUS;
252
- function kn(n, e = !0) {
253
- const [, , t] = G(n), [o, r] = U(t, n, n), s = o[0].length, { startRow: l } = r;
252
+ function $n(n, e = !0) {
253
+ const [, , t] = Z(n), [o, r] = U(t, n, n), s = o[0].length, { startRow: l } = r;
254
254
  let i = null;
255
255
  if (e) {
256
- const u = l + n.__rowSpan - 1, m = o[u], h = xe();
256
+ const u = l + n.__rowSpan - 1, m = o[u], h = ve();
257
257
  for (let C = 0; C < s; C++) {
258
258
  const { cell: a, startRow: c } = m[C];
259
259
  if (c + a.__rowSpan - 1 <= u) {
@@ -262,9 +262,9 @@ function kn(n, e = !0) {
262
262
  } else a.setRowSpan(a.__rowSpan + 1);
263
263
  }
264
264
  const p = t.getChildAtIndex(u);
265
- A(p) || y(256), p.insertAfter(h), i = h;
265
+ A(p) || b(256), p.insertAfter(h), i = h;
266
266
  } else {
267
- const u = l, m = o[u], h = xe();
267
+ const u = l, m = o[u], h = ve();
268
268
  for (let C = 0; C < s; C++) {
269
269
  const { cell: a, startRow: c } = m[C];
270
270
  if (c === u) {
@@ -273,13 +273,13 @@ function kn(n, e = !0) {
273
273
  } else a.setRowSpan(a.__rowSpan + 1);
274
274
  }
275
275
  const p = t.getChildAtIndex(u);
276
- A(p) || y(257), p.insertBefore(h), i = h;
276
+ A(p) || b(257), p.insertBefore(h), i = h;
277
277
  }
278
278
  return i;
279
279
  }
280
280
  function Mn(n, e = !0, t = !0) {
281
- const [, , o] = G(n), [r, s] = U(o, n, n), l = r.length, { startColumn: i } = s, u = e ? i + n.__colSpan - 1 : i - 1, m = o.getFirstChild();
282
- A(m) || y(120);
281
+ const [, , o] = Z(n), [r, s] = U(o, n, n), l = r.length, { startColumn: i } = s, u = e ? i + n.__colSpan - 1 : i - 1, m = o.getFirstChild();
282
+ A(m) || b(120);
283
283
  let h = null;
284
284
  function p(c = L.NO_STATUS) {
285
285
  const f = X(c).append(I());
@@ -288,8 +288,8 @@ function Mn(n, e = !0, t = !0) {
288
288
  let C = m;
289
289
  e: for (let c = 0; c < l; c++) {
290
290
  if (c !== 0) {
291
- const b = C.getNextSibling();
292
- A(b) || y(121), C = b;
291
+ const y = C.getNextSibling();
292
+ A(y) || b(121), C = y;
293
293
  }
294
294
  const f = r[c], d = f[u < 0 ? 0 : u].cell.__headerState, g = Ye(d, L.ROW);
295
295
  if (u < 0) {
@@ -298,18 +298,18 @@ function Mn(n, e = !0, t = !0) {
298
298
  }
299
299
  const { cell: _, startColumn: S, startRow: N } = f[u];
300
300
  if (S + _.__colSpan - 1 <= u) {
301
- let b = _, x = N, E = u;
302
- for (; x !== c && b.__rowSpan > 1; ) {
301
+ let y = _, v = N, E = u;
302
+ for (; v !== c && y.__rowSpan > 1; ) {
303
303
  if (E -= _.__colSpan, !(E >= 0)) {
304
304
  C.append(p(g));
305
305
  continue e;
306
306
  }
307
307
  {
308
- const { cell: $, startRow: K } = f[E];
309
- b = $, x = K;
308
+ const { cell: k, startRow: O } = f[E];
309
+ y = k, v = O;
310
310
  }
311
311
  }
312
- b.insertAfter(p(g));
312
+ y.insertAfter(p(g));
313
313
  } else _.setColSpan(_.__colSpan + 1);
314
314
  }
315
315
  h !== null && t && zn(h);
@@ -373,8 +373,8 @@ function Wn(n) {
373
373
  const e = n.getFirstChildOrThrow();
374
374
  return !(!tt(e) || !e.isEmpty());
375
375
  }
376
- function Hn(n) {
377
- const [e, t, o] = G(n), r = e.__colSpan, s = e.__rowSpan;
376
+ function Pn(n) {
377
+ const [e, t, o] = Z(n), r = e.__colSpan, s = e.__rowSpan;
378
378
  if (r === 1 && s === 1) return;
379
379
  const [l, i] = U(o, e, e), { startColumn: u, startRow: m } = i, h = e.__headerState & L.COLUMN, p = Array.from({ length: r }, (c, f) => {
380
380
  let d = h;
@@ -393,11 +393,11 @@ function Hn(n) {
393
393
  let c;
394
394
  for (let f = 1; f < s; f++) {
395
395
  const d = m + f, g = l[d];
396
- c = (c || t).getNextSibling(), A(c) || y(125);
396
+ c = (c || t).getNextSibling(), A(c) || b(125);
397
397
  let _ = null;
398
398
  for (let S = 0; S < u; S++) {
399
- const N = g[S], b = N.cell;
400
- N.startRow === d && (_ = b), b.__colSpan > 1 && (S += b.__colSpan - 1);
399
+ const N = g[S], y = N.cell;
400
+ N.startRow === d && (_ = y), y.__colSpan > 1 && (S += y.__colSpan - 1);
401
401
  }
402
402
  if (_ === null) for (let S = r - 1; S >= 0; S--) Et(c, X(p[S] | a[f]).append(I()));
403
403
  else for (let S = r - 1; S >= 0; S--) _.insertAfter(X(p[S] | a[f]).append(I()));
@@ -407,7 +407,7 @@ function Hn(n) {
407
407
  }
408
408
  function U(n, e, t) {
409
409
  const [o, r, s] = oe(n, e, t);
410
- return r === null && y(207), s === null && y(208), [o, r, s];
410
+ return r === null && b(207), s === null && b(208), [o, r, s];
411
411
  }
412
412
  function oe(n, e, t) {
413
413
  const o = [];
@@ -419,10 +419,10 @@ function oe(n, e, t) {
419
419
  const i = n.getChildren();
420
420
  for (let u = 0; u < i.length; u++) {
421
421
  const m = i[u];
422
- A(m) || y(209);
422
+ A(m) || b(209);
423
423
  const h = l(u);
424
424
  for (let p = m.getFirstChild(), C = 0; p != null; p = p.getNextSibling()) {
425
- for (w(p) || y(147); h[C] !== void 0; ) C++;
425
+ for (w(p) || b(147); h[C] !== void 0; ) C++;
426
426
  const a = { cell: p, startColumn: C, startRow: u }, { __rowSpan: c, __colSpan: f } = p;
427
427
  for (let d = 0; d < c && !(u + d >= i.length); d++) {
428
428
  const g = l(u + d);
@@ -433,22 +433,22 @@ function oe(n, e, t) {
433
433
  }
434
434
  return [o, r, s];
435
435
  }
436
- function G(n) {
436
+ function Z(n) {
437
437
  let e;
438
438
  if (n instanceof ce) e = n;
439
439
  else if ("__type" in n) {
440
440
  const r = T(n, w);
441
- w(r) || y(148), e = r;
441
+ w(r) || b(148), e = r;
442
442
  } else {
443
443
  const r = T(n.getNode(), w);
444
- w(r) || y(148), e = r;
444
+ w(r) || b(148), e = r;
445
445
  }
446
446
  const t = e.getParent();
447
- A(t) || y(149);
447
+ A(t) || b(149);
448
448
  const o = t.getParent();
449
- return k(o) || y(210), [e, t, o];
449
+ return $(o) || b(210), [e, t, o];
450
450
  }
451
- function $e(n, e, t) {
451
+ function ke(n, e, t) {
452
452
  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);
453
453
  do {
454
454
  o = !1;
@@ -465,7 +465,7 @@ function $e(n, e, t) {
465
465
  return { maxColumn: l, maxRow: i, minColumn: r, minRow: s };
466
466
  }
467
467
  function pt(n) {
468
- const [e, , t] = G(n), o = t.getChildren(), r = o.length, s = o[0].getChildren().length, l = new Array(r);
468
+ const [e, , t] = Z(n), o = t.getChildren(), r = o.length, s = o[0].getChildren().length, l = new Array(r);
469
469
  for (let i = 0; i < r; i++) l[i] = new Array(s);
470
470
  for (let i = 0; i < r; i++) {
471
471
  const u = o[i].getChildren();
@@ -483,13 +483,13 @@ function pt(n) {
483
483
  function Ct(n) {
484
484
  const [[e, t, o, r], [s, l, i, u]] = ["anchor", "focus"].map((m) => {
485
485
  const h = n[m].getNode(), p = T(h, w);
486
- w(p) || y(238, m, h.getKey(), h.getType());
486
+ w(p) || b(238, m, h.getKey(), h.getType());
487
487
  const C = p.getParent();
488
- A(C) || y(239, m);
488
+ A(C) || b(239, m);
489
489
  const a = C.getParent();
490
- return k(a) || y(240, m), [h, p, C, a];
490
+ return $(a) || b(240, m), [h, p, C, a];
491
491
  });
492
- return r.is(u) || y(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: r, focusCell: l, focusNode: s, focusRow: i, focusTable: u };
492
+ return r.is(u) || b(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: r, focusCell: l, focusNode: s, focusRow: i, focusTable: u };
493
493
  }
494
494
  class ze {
495
495
  constructor(e, t, o) {
@@ -511,7 +511,7 @@ class ze {
511
511
  this._cachedNodes = e;
512
512
  }
513
513
  is(e) {
514
- return O(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus);
514
+ return K(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus);
515
515
  }
516
516
  set(e, t, o) {
517
517
  this.dirty = this.dirty || e !== this.tableKey || t !== this.anchor.key || o !== this.focus.key, this.tableKey = e, this.anchor.key = t, this.focus.key = o, this._cachedNodes = null;
@@ -540,13 +540,13 @@ class ze {
540
540
  }
541
541
  insertNodes(e) {
542
542
  const t = this.focus.getNode();
543
- D(t) || y(151), xn(t.select(0, t.getChildrenSize())).insertNodes(e);
543
+ D(t) || b(151), vn(t.select(0, t.getChildrenSize())).insertNodes(e);
544
544
  }
545
545
  getShape() {
546
546
  const { anchorCell: e, focusCell: t } = Ct(this), o = pt(e);
547
- o === null && y(153);
547
+ o === null && b(153);
548
548
  const r = pt(t);
549
- r === null && y(155);
549
+ r === null && b(155);
550
550
  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), u = Math.max(o.rowIndex + o.rowSpan - 1, r.rowIndex + r.rowSpan - 1);
551
551
  return { fromX: Math.min(s, l), fromY: Math.min(i, u), toX: Math.max(s, l), toY: Math.max(i, u) };
552
552
  }
@@ -558,18 +558,18 @@ class ze {
558
558
  if (s !== t) {
559
559
  if (t.isParentOf(r)) {
560
560
  const d = s.getParent();
561
- d == null && y(159), this.set(this.tableKey, r.getKey(), d.getKey());
561
+ d == null && b(159), this.set(this.tableKey, r.getKey(), d.getKey());
562
562
  } else {
563
563
  const d = t.getParent();
564
- d == null && y(158), this.set(this.tableKey, d.getKey(), r.getKey());
564
+ d == null && b(158), this.set(this.tableKey, d.getKey(), r.getKey());
565
565
  }
566
566
  return this.getNodes();
567
567
  }
568
- const [l, i, u] = U(t, o, r), { minColumn: m, maxColumn: h, minRow: p, maxRow: C } = $e(l, i, u), a = /* @__PURE__ */ new Map([[t.getKey(), t]]);
568
+ const [l, i, u] = U(t, o, r), { minColumn: m, maxColumn: h, minRow: p, maxRow: C } = ke(l, i, u), a = /* @__PURE__ */ new Map([[t.getKey(), t]]);
569
569
  let c = null;
570
570
  for (let d = p; d <= C; d++) for (let g = m; g <= h; g++) {
571
571
  const { cell: _ } = l[d][g], S = _.getParent();
572
- A(S) || y(160), S !== c && (a.set(S.getKey(), S), c = S), a.has(_.getKey()) || Bn(_, (N) => {
572
+ A(S) || b(160), S !== c && (a.set(S.getKey(), S), c = S), a.has(_.getKey()) || Bn(_, (N) => {
573
573
  a.set(N.getKey(), N);
574
574
  });
575
575
  }
@@ -587,16 +587,16 @@ class ze {
587
587
  return t;
588
588
  }
589
589
  }
590
- function O(n) {
590
+ function K(n) {
591
591
  return n instanceof ze;
592
592
  }
593
- function $t() {
593
+ function kt() {
594
594
  const n = Ee("root", 0, "element"), e = Ee("root", 0, "element");
595
595
  return new ze("root", n, e);
596
596
  }
597
- function Pn(n, e, t) {
597
+ function Hn(n, e, t) {
598
598
  n.getKey(), e.getKey(), t.getKey();
599
- const o = B(), r = O(o) ? o.clone() : $t();
599
+ const o = B(), r = K(o) ? o.clone() : kt();
600
600
  return r.set(n.getKey(), e.getKey(), t.getKey()), r;
601
601
  }
602
602
  function Bn(n, e) {
@@ -606,11 +606,11 @@ function Bn(n, e) {
606
606
  r === void 0 ? t.pop() : e(r) !== !1 && D(r) && t.push(r.getChildren());
607
607
  }
608
608
  }
609
- function kt(n, e = Tt()) {
609
+ function $t(n, e = Tt()) {
610
610
  const t = Ae(n);
611
- k(t) || y(231, n);
611
+ $(t) || b(231, n);
612
612
  const o = ie(t, e.getElementByKey(n));
613
- return o === null && y(232, n), { tableElement: o, tableNode: t };
613
+ return o === null && b(232, n), { tableElement: o, tableNode: t };
614
614
  }
615
615
  class Dn {
616
616
  constructor(e, t) {
@@ -623,7 +623,7 @@ class Dn {
623
623
  this.abortController.abort("removeListeners"), Array.from(this.listenersToRemove).forEach((e) => e()), this.listenersToRemove.clear();
624
624
  }
625
625
  $lookup() {
626
- return kt(this.tableNodeKey, this.editor);
626
+ return $t(this.tableNodeKey, this.editor);
627
627
  }
628
628
  trackTable() {
629
629
  const e = new MutationObserver((t) => {
@@ -658,11 +658,11 @@ class Dn {
658
658
  }
659
659
  $disableHighlightStyle() {
660
660
  const { tableElement: e } = this.$lookup();
661
- Z(e, this.editor._config.theme.tableSelection), this.hasHijackedSelectionStyles = !0;
661
+ Q(e, this.editor._config.theme.tableSelection), this.hasHijackedSelectionStyles = !0;
662
662
  }
663
663
  $updateTableTableSelection(e) {
664
664
  if (e !== null) {
665
- e.tableKey !== this.tableNodeKey && y(233, e.tableKey, this.tableNodeKey);
665
+ e.tableKey !== this.tableNodeKey && b(233, e.tableKey, this.tableNodeKey);
666
666
  const t = this.editor;
667
667
  this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(), Fe(t, this.table, this.tableSelection);
668
668
  } else this.$clearHighlight();
@@ -693,7 +693,7 @@ class Dn {
693
693
  } else this.isHighlightingCells = !0, this.$disableHighlightStyle();
694
694
  if (this.focusX = s, this.focusY = l, this.isHighlightingCells) {
695
695
  const i = je(r, e.elem);
696
- if (this.tableSelection != null && this.anchorCellNodeKey != null && i !== null) return this.focusCellNodeKey = i.getKey(), this.tableSelection = Pn(r, this.$getAnchorTableCellOrThrow(), i), ne(this.tableSelection), o.dispatchCommand(fe, void 0), Fe(o, this.table, this.tableSelection), !0;
696
+ if (this.tableSelection != null && this.anchorCellNodeKey != null && i !== null) return this.focusCellNodeKey = i.getKey(), this.tableSelection = Hn(r, this.$getAnchorTableCellOrThrow(), i), ne(this.tableSelection), o.dispatchCommand(fe, void 0), Fe(o, this.table, this.tableSelection), !0;
697
697
  }
698
698
  return !1;
699
699
  }
@@ -702,28 +702,28 @@ class Dn {
702
702
  }
703
703
  $getAnchorTableCellOrThrow() {
704
704
  const e = this.$getAnchorTableCell();
705
- return e === null && y(234), e;
705
+ return e === null && b(234), e;
706
706
  }
707
707
  $getFocusTableCell() {
708
708
  return this.focusCellNodeKey ? Ae(this.focusCellNodeKey) : null;
709
709
  }
710
710
  $getFocusTableCellOrThrow() {
711
711
  const e = this.$getFocusTableCell();
712
- return e === null && y(235), e;
712
+ return e === null && b(235), e;
713
713
  }
714
714
  $setAnchorCellForSelection(e) {
715
715
  this.isHighlightingCells = !1, this.anchorCell = e, this.anchorX = e.x, this.anchorY = e.y;
716
716
  const { tableNode: t } = this.$lookup(), o = je(t, e.elem);
717
717
  if (o !== null) {
718
718
  const r = o.getKey();
719
- this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : $t(), this.anchorCellNodeKey = r;
719
+ this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : kt(), this.anchorCellNodeKey = r;
720
720
  }
721
721
  }
722
722
  $formatCells(e) {
723
723
  const t = B();
724
- O(t) || y(236);
724
+ K(t) || b(236);
725
725
  const o = Cn(), r = o.anchor, s = o.focus, l = t.getNodes().filter(w);
726
- l.length > 0 || y(237);
726
+ l.length > 0 || b(237);
727
727
  const i = l[0].getFirstChild(), u = tt(i) ? i.getFormatFlags(e, null) : null;
728
728
  l.forEach((m) => {
729
729
  r.set(m.getKey(), 0, "element"), s.set(m.getKey(), m.getChildrenSize(), "element"), o.formatText(e, u);
@@ -731,14 +731,14 @@ class Dn {
731
731
  }
732
732
  $clearText() {
733
733
  const { editor: e } = this, t = Ae(this.tableNodeKey);
734
- if (!k(t)) throw new Error("Expected TableNode.");
734
+ if (!$(t)) throw new Error("Expected TableNode.");
735
735
  const o = B();
736
- O(o) || y(253);
736
+ K(o) || b(253);
737
737
  const r = o.getNodes().filter(w), s = t.getFirstChild(), l = t.getLastChild();
738
738
  if (r.length > 0 && s !== null && l !== null && A(s) && A(l) && r[0] === s.getFirstChild() && r[r.length - 1] === l.getLastChild()) {
739
739
  t.selectPrevious();
740
740
  const i = t.getParent();
741
- return t.remove(), void (_n(i) && i.isEmpty() && e.dispatchCommand(Kt, void 0));
741
+ return t.remove(), void (_n(i) && i.isEmpty() && e.dispatchCommand(Ot, void 0));
742
742
  }
743
743
  r.forEach((i) => {
744
744
  if (D(i)) {
@@ -757,12 +757,12 @@ function de(n) {
757
757
  function ie(n, e) {
758
758
  if (!e) return e;
759
759
  const t = de(e) ? e : n.getDOMSlot(e).element;
760
- return t.nodeName !== "TABLE" && y(245, e.nodeName), t;
760
+ return t.nodeName !== "TABLE" && b(245, e.nodeName), t;
761
761
  }
762
762
  function rt(n) {
763
763
  return n._window;
764
764
  }
765
- function ve(n, e) {
765
+ function xe(n, e) {
766
766
  for (let t = e, o = null; t !== null; t = t.getParent()) {
767
767
  if (n.is(t)) return o;
768
768
  w(t) && (o = t);
@@ -772,20 +772,20 @@ function ve(n, e) {
772
772
  const Jn = [[en, "down"], [tn, "up"], [nn, "backward"], [on, "forward"]], Un = [ln, Ft, sn], Xn = [an, cn];
773
773
  function Yn(n, e, t, o) {
774
774
  const r = t.getRootElement(), s = rt(t);
775
- r !== null && s !== null || y(246);
775
+ r !== null && s !== null || b(246);
776
776
  const l = new Dn(t, n.getKey()), i = ie(n, e);
777
777
  (function(a, c) {
778
- _t(a) !== null && y(205), a[qe] = c;
778
+ _t(a) !== null && b(205), a[qe] = c;
779
779
  })(i, l), l.listenersToRemove.add(() => function(a, c) {
780
780
  _t(a) === c && delete a[qe];
781
781
  }(i, l));
782
782
  const u = (a) => {
783
- if (l.pointerType = a.pointerType, a.button !== 0 || !be(a.target) || !s) return;
784
- const c = ke(a.target);
783
+ if (l.pointerType = a.pointerType, a.button !== 0 || !ye(a.target) || !s) return;
784
+ const c = $e(a.target);
785
785
  c !== null && t.update(() => {
786
786
  const f = Ue();
787
- if (mt && a.shiftKey && V(f, n) && (z(f) || O(f))) {
788
- const d = f.anchor.getNode(), g = ve(n, f.anchor.getNode());
787
+ if (mt && a.shiftKey && V(f, n) && (z(f) || K(f))) {
788
+ const d = f.anchor.getNode(), g = xe(n, f.anchor.getNode());
789
789
  g ? (l.$setAnchorCellForSelection(se(l, g)), l.$setFocusCellForSelection(c), ee(a)) : (n.isBefore(d) ? n.selectStart() : n.selectEnd()).anchor.set(f.anchor.key, f.anchor.offset, f.anchor.type);
790
790
  } else a.pointerType !== "touch" && l.$setAnchorCellForSelection(c);
791
791
  }), (() => {
@@ -794,7 +794,7 @@ function Yn(n, e, t, o) {
794
794
  l.isSelecting = !1, s.removeEventListener("pointerup", f), s.removeEventListener("pointermove", d);
795
795
  }, d = (g) => {
796
796
  if (!In(g) && l.isSelecting) return l.isSelecting = !1, s.removeEventListener("pointerup", f), void s.removeEventListener("pointermove", d);
797
- if (!be(g.target)) return;
797
+ if (!ye(g.target)) return;
798
798
  let _ = null;
799
799
  const S = !(mt || i.contains(g.target));
800
800
  if (S) _ = St(i, g.target);
@@ -808,16 +808,16 @@ function Yn(n, e, t, o) {
808
808
  i.removeEventListener("pointerdown", u);
809
809
  });
810
810
  const m = (a) => {
811
- a.detail >= 3 && be(a.target) && ke(a.target) !== null && a.preventDefault();
811
+ a.detail >= 3 && ye(a.target) && $e(a.target) !== null && a.preventDefault();
812
812
  };
813
813
  i.addEventListener("mousedown", m, l.listenerOptions), l.listenersToRemove.add(() => {
814
814
  i.removeEventListener("mousedown", m);
815
815
  });
816
816
  const h = (a) => {
817
817
  const c = a.target;
818
- a.button === 0 && be(c) && t.update(() => {
818
+ a.button === 0 && ye(c) && t.update(() => {
819
819
  const f = B();
820
- O(f) && f.tableKey === l.tableNodeKey && r.contains(c) && l.$clearHighlight();
820
+ K(f) && f.tableKey === l.tableNodeKey && r.contains(c) && l.$clearHighlight();
821
821
  });
822
822
  };
823
823
  s.addEventListener("pointerdown", h, l.listenerOptions), l.listenersToRemove.add(() => {
@@ -826,8 +826,8 @@ function Yn(n, e, t, o) {
826
826
  for (const [a, c] of Jn) l.listenersToRemove.add(t.registerCommand(a, (f) => Lt(t, f, c, n, l), Ie));
827
827
  l.listenersToRemove.add(t.registerCommand(rn, (a) => {
828
828
  const c = B();
829
- if (O(c)) {
830
- const f = ve(n, c.focus.getNode());
829
+ if (K(c)) {
830
+ const f = xe(n, c.focus.getNode());
831
831
  if (f !== null) return ee(a), f.selectEnd(), !0;
832
832
  }
833
833
  return !1;
@@ -835,12 +835,12 @@ function Yn(n, e, t, o) {
835
835
  const p = (a) => () => {
836
836
  const c = B();
837
837
  if (!V(c, n)) return !1;
838
- if (O(c)) return l.$clearText(), !0;
838
+ if (K(c)) return l.$clearText(), !0;
839
839
  if (z(c)) {
840
- if (!w(ve(n, c.anchor.getNode()))) return !1;
840
+ if (!w(xe(n, c.anchor.getNode()))) return !1;
841
841
  const f = c.anchor.getNode(), d = c.focus.getNode(), g = n.isParentOf(f), _ = n.isParentOf(d);
842
842
  if (g && !_ || _ && !g) return l.$clearText(), !0;
843
- const S = T(c.anchor.getNode(), (b) => D(b)), N = S && T(S, (b) => D(b) && w(b.getParent()));
843
+ const S = T(c.anchor.getNode(), (y) => D(y)), N = S && T(S, (y) => D(y) && w(y.getParent()));
844
844
  if (!D(N) || !D(S)) return !1;
845
845
  if (a === Ft && N.getPreviousSibling() === null) return !0;
846
846
  }
@@ -849,20 +849,20 @@ function Yn(n, e, t, o) {
849
849
  for (const a of Un) l.listenersToRemove.add(t.registerCommand(a, p(a), j));
850
850
  const C = (a) => {
851
851
  const c = B();
852
- if (!O(c) && !z(c)) return !1;
852
+ if (!K(c) && !z(c)) return !1;
853
853
  const f = n.isParentOf(c.anchor.getNode());
854
854
  if (f !== n.isParentOf(c.focus.getNode())) {
855
855
  const d = f ? "anchor" : "focus", g = f ? "focus" : "anchor", { key: _, offset: S, type: N } = c[g];
856
856
  return n[c[d].isBefore(c[g]) ? "selectPrevious" : "selectNext"]()[g].set(_, S, N), !1;
857
857
  }
858
- return !!V(c, n) && !!O(c) && (a && (a.preventDefault(), a.stopPropagation()), l.$clearText(), !0);
858
+ return !!V(c, n) && !!K(c) && (a && (a.preventDefault(), a.stopPropagation()), l.$clearText(), !0);
859
859
  };
860
860
  for (const a of Xn) l.listenersToRemove.add(t.registerCommand(a, C, j));
861
861
  return l.listenersToRemove.add(t.registerCommand(un, (a) => {
862
862
  const c = B();
863
863
  if (c) {
864
- if (!O(c) && !z(c)) return !1;
865
- Fn(t, jt(a, ClipboardEvent) ? a : null, Kn(c));
864
+ if (!K(c) && !z(c)) return !1;
865
+ Fn(t, jt(a, ClipboardEvent) ? a : null, On(c));
866
866
  const f = C(a);
867
867
  return z(c) ? (c.removeText(), !0) : f;
868
868
  }
@@ -870,7 +870,7 @@ function Yn(n, e, t, o) {
870
870
  }, j)), l.listenersToRemove.add(t.registerCommand(hn, (a) => {
871
871
  const c = B();
872
872
  if (!V(c, n)) return !1;
873
- if (O(c)) return l.$formatCells(a), !0;
873
+ if (K(c)) return l.$formatCells(a), !0;
874
874
  if (z(c)) {
875
875
  const f = T(c.anchor.getNode(), (d) => w(d));
876
876
  if (!w(f)) return !1;
@@ -878,12 +878,12 @@ function Yn(n, e, t, o) {
878
878
  return !1;
879
879
  }, j)), l.listenersToRemove.add(t.registerCommand(dn, (a) => {
880
880
  const c = B();
881
- if (!O(c) || !V(c, n)) return !1;
881
+ if (!K(c) || !V(c, n)) return !1;
882
882
  const f = c.anchor.getNode(), d = c.focus.getNode();
883
883
  if (!w(f) || !w(d)) return !1;
884
- if (function(K, M) {
885
- if (O(K)) {
886
- const R = K.anchor.getNode(), F = K.focus.getNode();
884
+ if (function(O, M) {
885
+ if (K(O)) {
886
+ const R = O.anchor.getNode(), F = O.focus.getNode();
887
887
  if (M && R && F) {
888
888
  const [W] = U(M, R, F);
889
889
  return R.getKey() === W[0][0].cell.getKey() && F.getKey() === W[W.length - 1].at(-1).cell.getKey();
@@ -891,152 +891,152 @@ function Yn(n, e, t, o) {
891
891
  }
892
892
  return !1;
893
893
  }(c, n)) return n.setFormat(a), !0;
894
- const [g, _, S] = U(n, f, d), N = Math.max(_.startRow + _.cell.__rowSpan - 1, S.startRow + S.cell.__rowSpan - 1), b = Math.max(_.startColumn + _.cell.__colSpan - 1, S.startColumn + S.cell.__colSpan - 1), x = Math.min(_.startRow, S.startRow), E = Math.min(_.startColumn, S.startColumn), $ = /* @__PURE__ */ new Set();
895
- for (let K = x; K <= N; K++) for (let M = E; M <= b; M++) {
896
- const R = g[K][M].cell;
897
- if ($.has(R)) continue;
898
- $.add(R), R.setFormat(a);
894
+ const [g, _, S] = U(n, f, d), N = Math.max(_.startRow + _.cell.__rowSpan - 1, S.startRow + S.cell.__rowSpan - 1), y = Math.max(_.startColumn + _.cell.__colSpan - 1, S.startColumn + S.cell.__colSpan - 1), v = Math.min(_.startRow, S.startRow), E = Math.min(_.startColumn, S.startColumn), k = /* @__PURE__ */ new Set();
895
+ for (let O = v; O <= N; O++) for (let M = E; M <= y; M++) {
896
+ const R = g[O][M].cell;
897
+ if (k.has(R)) continue;
898
+ k.add(R), R.setFormat(a);
899
899
  const F = R.getChildren();
900
900
  for (let W = 0; W < F.length; W++) {
901
- const P = F[W];
902
- D(P) && !P.isInline() && P.setFormat(a);
901
+ const H = F[W];
902
+ D(H) && !H.isInline() && H.setFormat(a);
903
903
  }
904
904
  }
905
905
  return !0;
906
906
  }, j)), l.listenersToRemove.add(t.registerCommand(fn, (a) => {
907
907
  const c = B();
908
908
  if (!V(c, n)) return !1;
909
- if (O(c)) return l.$clearHighlight(), !1;
909
+ if (K(c)) return l.$clearHighlight(), !1;
910
910
  if (z(c)) {
911
911
  const f = T(c.anchor.getNode(), (d) => w(d));
912
912
  if (!w(f)) return !1;
913
913
  if (typeof a == "string") {
914
- const d = bt(t, c, n);
915
- if (d) return yt(d, n, [et(a)]), !0;
914
+ const d = yt(t, c, n);
915
+ if (d) return bt(d, n, [et(a)]), !0;
916
916
  }
917
917
  }
918
918
  return !1;
919
919
  }, j)), o && l.listenersToRemove.add(t.registerCommand(gn, (a) => {
920
920
  const c = B();
921
921
  if (!z(c) || !c.isCollapsed() || !V(c, n)) return !1;
922
- const f = ye(c.anchor.getNode());
922
+ const f = be(c.anchor.getNode());
923
923
  return !(f === null || !n.is(pe(f))) && (ee(a), function(d, g) {
924
924
  const _ = g === "next" ? "getNextSibling" : "getPreviousSibling", S = g === "next" ? "getFirstChild" : "getLastChild", N = d[_]();
925
925
  if (D(N)) return N.selectEnd();
926
- const b = T(d, A);
927
- b === null && y(247);
928
- for (let E = b[_](); A(E); E = E[_]()) {
929
- const $ = E[S]();
930
- if (D($)) return $.selectEnd();
926
+ const y = T(d, A);
927
+ y === null && b(247);
928
+ for (let E = y[_](); A(E); E = E[_]()) {
929
+ const k = E[S]();
930
+ if (D(k)) return k.selectEnd();
931
931
  }
932
- const x = T(b, k);
933
- x === null && y(248), g === "next" ? x.selectNext() : x.selectPrevious();
932
+ const v = T(y, $);
933
+ v === null && b(248), g === "next" ? v.selectNext() : v.selectPrevious();
934
934
  }(f, a.shiftKey ? "previous" : "next"), !0);
935
935
  }, j)), l.listenersToRemove.add(t.registerCommand(mn, (a) => n.isSelected(), Ie)), l.listenersToRemove.add(t.registerCommand(Rt, (a, c) => {
936
936
  if (t !== c) return !1;
937
- const { nodes: f, selection: d } = a, g = d.getStartEndPoints(), _ = O(d), S = z(d) && T(d.anchor.getNode(), (v) => w(v)) !== null && T(d.focus.getNode(), (v) => w(v)) !== null || _;
938
- if (f.length !== 1 || !k(f[0]) || !S || g === null) return !1;
939
- const [N, b] = g, [x, E, $] = G(N), K = T(b.getNode(), (v) => w(v));
940
- if (!(w(x) && w(K) && A(E) && k($))) return !1;
941
- const M = f[0], [R, F, W] = U($, x, K), [P] = oe(M, null, null), te = R.length, _e = te > 0 ? R[0].length : 0;
942
- let Y = F.startRow, H = F.startColumn, le = P.length, ue = le > 0 ? P[0].length : 0;
937
+ const { nodes: f, selection: d } = a, g = d.getStartEndPoints(), _ = K(d), S = z(d) && T(d.anchor.getNode(), (x) => w(x)) !== null && T(d.focus.getNode(), (x) => w(x)) !== null || _;
938
+ if (f.length !== 1 || !$(f[0]) || !S || g === null) return !1;
939
+ const [N, y] = g, [v, E, k] = Z(N), O = T(y.getNode(), (x) => w(x));
940
+ if (!(w(v) && w(O) && A(E) && $(k))) return !1;
941
+ const M = f[0], [R, F, W] = U(k, v, O), [H] = oe(M, null, null), te = R.length, _e = te > 0 ? R[0].length : 0;
942
+ let Y = F.startRow, P = F.startColumn, le = H.length, ue = le > 0 ? H[0].length : 0;
943
943
  if (_) {
944
- const v = $e(R, F, W), J = v.maxRow - v.minRow + 1, q = v.maxColumn - v.minColumn + 1;
945
- Y = v.minRow, H = v.minColumn, le = Math.min(le, J), ue = Math.min(ue, q);
944
+ const x = ke(R, F, W), J = x.maxRow - x.minRow + 1, q = x.maxColumn - x.minColumn + 1;
945
+ Y = x.minRow, P = x.minColumn, le = Math.min(le, J), ue = Math.min(ue, q);
946
946
  }
947
947
  let Le = !1;
948
- const Wt = Math.min(te, Y + le) - 1, Ht = Math.min(_e, H + ue) - 1, it = /* @__PURE__ */ new Set();
949
- for (let v = Y; v <= Wt; v++) for (let J = H; J <= Ht; J++) {
950
- const q = R[v][J];
951
- it.has(q.cell.getKey()) || q.cell.__rowSpan === 1 && q.cell.__colSpan === 1 || (Hn(q.cell), it.add(q.cell.getKey()), Le = !0);
948
+ const Wt = Math.min(te, Y + le) - 1, Pt = Math.min(_e, P + ue) - 1, it = /* @__PURE__ */ new Set();
949
+ for (let x = Y; x <= Wt; x++) for (let J = P; J <= Pt; J++) {
950
+ const q = R[x][J];
951
+ it.has(q.cell.getKey()) || q.cell.__rowSpan === 1 && q.cell.__colSpan === 1 || (Pn(q.cell), it.add(q.cell.getKey()), Le = !0);
952
952
  }
953
- let [Se] = oe($.getWritable(), null, null);
954
- const Pt = le - te + Y;
955
- for (let v = 0; v < Pt; v++)
956
- kn(Se[te - 1][0].cell);
957
- const Bt = ue - _e + H;
958
- for (let v = 0; v < Bt; v++)
953
+ let [Se] = oe(k.getWritable(), null, null);
954
+ const Ht = le - te + Y;
955
+ for (let x = 0; x < Ht; x++)
956
+ $n(Se[te - 1][0].cell);
957
+ const Bt = ue - _e + P;
958
+ for (let x = 0; x < Bt; x++)
959
959
  Mn(Se[0][_e - 1].cell, !0, !1);
960
- [Se] = oe($.getWritable(), null, null);
961
- for (let v = Y; v < Y + le; v++) for (let J = H; J < H + ue; J++) {
962
- const q = v - Y, at = J - H, We = P[q][at];
960
+ [Se] = oe(k.getWritable(), null, null);
961
+ for (let x = Y; x < Y + le; x++) for (let J = P; J < P + ue; J++) {
962
+ const q = x - Y, at = J - P, We = H[q][at];
963
963
  if (We.startRow !== q || We.startColumn !== at) continue;
964
964
  const we = We.cell;
965
965
  if (we.__rowSpan !== 1 || we.__colSpan !== 1) {
966
- const Q = [], It = Math.min(v + we.__rowSpan, Y + le) - 1, Jt = Math.min(J + we.__colSpan, H + ue) - 1;
967
- for (let Pe = v; Pe <= It; Pe++) for (let Be = J; Be <= Jt; Be++) {
968
- const Ut = Se[Pe][Be];
969
- Q.push(Ut.cell);
966
+ const G = [], It = Math.min(x + we.__rowSpan, Y + le) - 1, Jt = Math.min(J + we.__colSpan, P + ue) - 1;
967
+ for (let He = x; He <= It; He++) for (let Be = J; Be <= Jt; Be++) {
968
+ const Ut = Se[He][Be];
969
+ G.push(Ut.cell);
970
970
  }
971
- Ln(Q), Le = !0;
971
+ Ln(G), Le = !0;
972
972
  }
973
- const { cell: He } = Se[v][J], Dt = He.getChildren();
974
- we.getChildren().forEach((Q) => {
975
- Ce(Q) && I().append(Q), He.append(Q);
976
- }), Dt.forEach((Q) => Q.remove());
973
+ const { cell: Pe } = Se[x][J], Dt = Pe.getChildren();
974
+ we.getChildren().forEach((G) => {
975
+ Ce(G) && I().append(G), Pe.append(G);
976
+ }), Dt.forEach((G) => G.remove());
977
977
  }
978
978
  if (_ && Le) {
979
- const [v] = oe($.getWritable(), null, null);
980
- v[F.startRow][F.startColumn].cell.selectEnd();
979
+ const [x] = oe(k.getWritable(), null, null);
980
+ x[F.startRow][F.startColumn].cell.selectEnd();
981
981
  }
982
982
  return !0;
983
983
  }, j)), l.listenersToRemove.add(t.registerCommand(fe, () => {
984
984
  const a = B(), c = Ue(), f = l.getAndClearNextFocus();
985
985
  if (f !== null) {
986
986
  const { focusCell: d } = f;
987
- if (O(a) && a.tableKey === l.tableNodeKey) return (d.x !== l.focusX || d.y !== l.focusY) && (l.$setFocusCellForSelection(d), !0);
987
+ if (K(a) && a.tableKey === l.tableNodeKey) return (d.x !== l.focusX || d.y !== l.focusY) && (l.$setFocusCellForSelection(d), !0);
988
988
  if (d !== l.anchorCell && V(a, n)) return l.$setFocusCellForSelection(d), !0;
989
989
  }
990
990
  if (l.getAndClearShouldCheckSelection() && z(c) && z(a) && a.isCollapsed()) {
991
- const d = a.anchor.getNode(), g = n.getFirstChild(), _ = ye(d);
991
+ const d = a.anchor.getNode(), g = n.getFirstChild(), _ = be(d);
992
992
  if (_ !== null && A(g)) {
993
993
  const S = g.getFirstChild();
994
994
  if (w(S) && n.is(T(_, (N) => N.is(n) || N.is(S)))) return S.selectStart(), !0;
995
995
  }
996
996
  }
997
997
  if (z(a)) {
998
- const { anchor: d, focus: g } = a, _ = d.getNode(), S = g.getNode(), N = ye(_), b = ye(S), x = !(!N || !n.is(pe(N))), E = !(!b || !n.is(pe(b))), $ = x !== E, K = x && E, M = a.isBackward();
999
- if ($) {
998
+ const { anchor: d, focus: g } = a, _ = d.getNode(), S = g.getNode(), N = be(_), y = be(S), v = !(!N || !n.is(pe(N))), E = !(!y || !n.is(pe(y))), k = v !== E, O = v && E, M = a.isBackward();
999
+ if (k) {
1000
1000
  const R = a.clone();
1001
1001
  if (E) {
1002
- const [F] = U(n, b, b), W = F[0][0].cell, P = F[F.length - 1].at(-1).cell;
1003
- R.focus.set(M ? W.getKey() : P.getKey(), M ? W.getChildrenSize() : P.getChildrenSize(), "element");
1004
- } else if (x) {
1005
- const [F] = U(n, N, N), W = F[0][0].cell, P = F[F.length - 1].at(-1).cell;
1006
- R.anchor.set(M ? P.getKey() : W.getKey(), M ? P.getChildrenSize() : 0, "element");
1002
+ const [F] = U(n, y, y), W = F[0][0].cell, H = F[F.length - 1].at(-1).cell;
1003
+ R.focus.set(M ? W.getKey() : H.getKey(), M ? W.getChildrenSize() : H.getChildrenSize(), "element");
1004
+ } else if (v) {
1005
+ const [F] = U(n, N, N), W = F[0][0].cell, H = F[F.length - 1].at(-1).cell;
1006
+ R.anchor.set(M ? H.getKey() : W.getKey(), M ? H.getChildrenSize() : 0, "element");
1007
1007
  }
1008
1008
  ne(R), wt(t, l);
1009
- } else if (K && (N.is(b) || (l.$setAnchorCellForSelection(se(l, N)), l.$setFocusCellForSelection(se(l, b), !0)), l.pointerType === "touch" && l.isSelecting && a.isCollapsed() && z(c) && c.isCollapsed())) {
1010
- const R = ye(c.anchor.getNode());
1011
- R && !R.is(b) && (l.$setAnchorCellForSelection(se(l, R)), l.$setFocusCellForSelection(se(l, b), !0), l.pointerType = null);
1009
+ } else if (O && (N.is(y) || (l.$setAnchorCellForSelection(se(l, N)), l.$setFocusCellForSelection(se(l, y), !0)), l.pointerType === "touch" && l.isSelecting && a.isCollapsed() && z(c) && c.isCollapsed())) {
1010
+ const R = be(c.anchor.getNode());
1011
+ R && !R.is(y) && (l.$setAnchorCellForSelection(se(l, R)), l.$setFocusCellForSelection(se(l, y), !0), l.pointerType = null);
1012
1012
  }
1013
- } else if (a && O(a) && a.is(c) && a.tableKey === n.getKey()) {
1013
+ } else if (a && K(a) && a.is(c) && a.tableKey === n.getKey()) {
1014
1014
  const d = Me(s);
1015
1015
  if (d && d.anchorNode && d.focusNode) {
1016
1016
  const g = re(d.focusNode), _ = g && !n.isParentOf(g), S = re(d.anchorNode), N = S && n.isParentOf(S);
1017
1017
  if (_ && N && d.rangeCount > 0) {
1018
- const b = pn(d, t);
1019
- b && (b.anchor.set(n.getKey(), a.isBackward() ? n.getChildrenSize() : 0, "element"), d.removeAllRanges(), ne(b));
1018
+ const y = pn(d, t);
1019
+ y && (y.anchor.set(n.getKey(), a.isBackward() ? n.getChildrenSize() : 0, "element"), d.removeAllRanges(), ne(y));
1020
1020
  }
1021
1021
  }
1022
1022
  }
1023
- return a && !a.is(c) && (O(a) || O(c)) && l.tableSelection && !l.tableSelection.is(c) ? (O(a) && a.tableKey === l.tableNodeKey ? l.$updateTableTableSelection(a) : !O(a) && O(c) && c.tableKey === l.tableNodeKey && l.$updateTableTableSelection(null), !1) : (l.hasHijackedSelectionStyles && !n.isSelected() ? function(d, g) {
1023
+ return a && !a.is(c) && (K(a) || K(c)) && l.tableSelection && !l.tableSelection.is(c) ? (K(a) && a.tableKey === l.tableNodeKey ? l.$updateTableTableSelection(a) : !K(a) && K(c) && c.tableKey === l.tableNodeKey && l.$updateTableTableSelection(null), !1) : (l.hasHijackedSelectionStyles && !n.isSelected() ? function(d, g) {
1024
1024
  g.$enableHighlightStyle(), lt(g.table, (_) => {
1025
1025
  const S = _.elem;
1026
1026
  _.highlighted = !1, zt(d, _), S.getAttribute("style") || S.removeAttribute("style");
1027
1027
  });
1028
1028
  }(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() && wt(t, l), !1);
1029
- }, j)), l.listenersToRemove.add(t.registerCommand(Kt, () => {
1029
+ }, j)), l.listenersToRemove.add(t.registerCommand(Ot, () => {
1030
1030
  const a = B();
1031
1031
  if (!z(a) || !a.isCollapsed() || !V(a, n)) return !1;
1032
- const c = bt(t, a, n);
1033
- return !!c && (yt(c, n), !0);
1032
+ const c = yt(t, a, n);
1033
+ return !!c && (bt(c, n), !0);
1034
1034
  }, j)), l;
1035
1035
  }
1036
1036
  function _t(n) {
1037
1037
  return n[qe] || null;
1038
1038
  }
1039
- function ke(n) {
1039
+ function $e(n) {
1040
1040
  let e = n;
1041
1041
  for (; e != null; ) {
1042
1042
  const t = e.nodeName;
@@ -1118,11 +1118,11 @@ const qn = (n, e, t, o, r) => {
1118
1118
  switch (r) {
1119
1119
  case "backward":
1120
1120
  case "forward":
1121
- return t !== (s ? n.table.columns - 1 : 0) ? Oe(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? Oe(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
1121
+ return t !== (s ? n.table.columns - 1 : 0) ? Ke(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? Ke(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
1122
1122
  case "up":
1123
- return o !== 0 ? Oe(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
1123
+ return o !== 0 ? Ke(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
1124
1124
  case "down":
1125
- return o !== n.table.rows - 1 ? Oe(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
1125
+ return o !== n.table.rows - 1 ? Ke(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
1126
1126
  default:
1127
1127
  return !1;
1128
1128
  }
@@ -1141,77 +1141,77 @@ function Je(n, e) {
1141
1141
  }
1142
1142
  return [t, o];
1143
1143
  }
1144
- function Ke([n, e]) {
1144
+ function Oe([n, e]) {
1145
1145
  return [n === "minColumn" ? "maxColumn" : "minColumn", e === "minRow" ? "maxRow" : "minRow"];
1146
1146
  }
1147
1147
  function he(n, e, [t, o]) {
1148
1148
  const r = e[o], s = n[r];
1149
- s === void 0 && y(250, o, String(r));
1149
+ s === void 0 && b(250, o, String(r));
1150
1150
  const l = e[t], i = s[l];
1151
- return i === void 0 && y(250, t, String(l)), i;
1151
+ return i === void 0 && b(250, t, String(l)), i;
1152
1152
  }
1153
1153
  function jn(n, e, t, o, r) {
1154
- const s = $e(e, t, o), l = function(x, E) {
1155
- const { minColumn: $, maxColumn: K, minRow: M, maxRow: R } = E;
1156
- let F = 1, W = 1, P = 1, te = 1;
1157
- const _e = x[M], Y = x[R];
1158
- for (let H = $; H <= K; H++) F = Math.max(F, _e[H].cell.__rowSpan), te = Math.max(te, Y[H].cell.__rowSpan);
1159
- for (let H = M; H <= R; H++) W = Math.max(W, x[H][$].cell.__colSpan), P = Math.max(P, x[H][K].cell.__colSpan);
1160
- return { bottomSpan: te, leftSpan: W, rightSpan: P, topSpan: F };
1161
- }(e, s), { topSpan: i, leftSpan: u, bottomSpan: m, rightSpan: h } = l, p = function(x, E) {
1162
- const $ = Je(x, E);
1163
- return $ === null && y(249, E.cell.getKey()), $;
1164
- }(s, t), [C, a] = Ke(p);
1154
+ const s = ke(e, t, o), l = function(v, E) {
1155
+ const { minColumn: k, maxColumn: O, minRow: M, maxRow: R } = E;
1156
+ let F = 1, W = 1, H = 1, te = 1;
1157
+ const _e = v[M], Y = v[R];
1158
+ for (let P = k; P <= O; P++) F = Math.max(F, _e[P].cell.__rowSpan), te = Math.max(te, Y[P].cell.__rowSpan);
1159
+ for (let P = M; P <= R; P++) W = Math.max(W, v[P][k].cell.__colSpan), H = Math.max(H, v[P][O].cell.__colSpan);
1160
+ return { bottomSpan: te, leftSpan: W, rightSpan: H, topSpan: F };
1161
+ }(e, s), { topSpan: i, leftSpan: u, bottomSpan: m, rightSpan: h } = l, p = function(v, E) {
1162
+ const k = Je(v, E);
1163
+ return k === null && b(249, E.cell.getKey()), k;
1164
+ }(s, t), [C, a] = Oe(p);
1165
1165
  let c = s[C], f = s[a];
1166
1166
  r === "forward" ? c += C === "maxColumn" ? 1 : u : r === "backward" ? c -= C === "minColumn" ? 1 : h : r === "down" ? f += a === "maxRow" ? 1 : i : r === "up" && (f -= a === "minRow" ? 1 : m);
1167
1167
  const d = e[f];
1168
1168
  if (d === void 0) return !1;
1169
1169
  const g = d[c];
1170
1170
  if (g === void 0) return !1;
1171
- const [_, S] = function(x, E, $) {
1172
- const K = $e(x, E, $), M = Je(K, E);
1173
- if (M) return [he(x, K, M), he(x, K, Ke(M))];
1174
- const R = Je(K, $);
1175
- if (R) return [he(x, K, Ke(R)), he(x, K, R)];
1171
+ const [_, S] = function(v, E, k) {
1172
+ const O = ke(v, E, k), M = Je(O, E);
1173
+ if (M) return [he(v, O, M), he(v, O, Oe(M))];
1174
+ const R = Je(O, k);
1175
+ if (R) return [he(v, O, Oe(R)), he(v, O, R)];
1176
1176
  const F = ["minColumn", "minRow"];
1177
- return [he(x, K, F), he(x, K, Ke(F))];
1178
- }(e, t, g), N = se(n, _.cell), b = se(n, S.cell);
1179
- return n.$setAnchorCellForSelection(N), n.$setFocusCellForSelection(b, !0), !0;
1177
+ return [he(v, O, F), he(v, O, Oe(F))];
1178
+ }(e, t, g), N = se(n, _.cell), y = se(n, S.cell);
1179
+ return n.$setAnchorCellForSelection(N), n.$setFocusCellForSelection(y, !0), !0;
1180
1180
  }
1181
1181
  function V(n, e) {
1182
- if (z(n) || O(n)) {
1182
+ if (z(n) || K(n)) {
1183
1183
  const t = e.isParentOf(n.anchor.getNode()), o = e.isParentOf(n.focus.getNode());
1184
1184
  return t && o;
1185
1185
  }
1186
1186
  return !1;
1187
1187
  }
1188
- function Oe(n, e) {
1188
+ function Ke(n, e) {
1189
1189
  e ? n.selectStart() : n.selectEnd();
1190
1190
  }
1191
1191
  function Mt(n, e) {
1192
1192
  const t = e.elem, o = n._config.theme;
1193
- w(re(t)) || y(131), Z(t, o.tableCellSelected);
1193
+ w(re(t)) || b(131), Q(t, o.tableCellSelected);
1194
1194
  }
1195
1195
  function zt(n, e) {
1196
1196
  const t = e.elem;
1197
- w(re(t)) || y(131);
1197
+ w(re(t)) || b(131);
1198
1198
  const o = n._config.theme;
1199
1199
  ge(t, o.tableCellSelected);
1200
1200
  }
1201
- function ye(n) {
1201
+ function be(n) {
1202
1202
  const e = T(n, w);
1203
1203
  return w(e) ? e : null;
1204
1204
  }
1205
1205
  function pe(n) {
1206
- const e = T(n, k);
1207
- return k(e) ? e : null;
1206
+ const e = T(n, $);
1207
+ return $(e) ? e : null;
1208
1208
  }
1209
1209
  function Vn(n, e, t, o, r, s, l) {
1210
1210
  const i = wn(t.focus, r ? "previous" : "next");
1211
- if (yn(i)) return !1;
1211
+ if (bn(i)) return !1;
1212
1212
  let u = i;
1213
1213
  for (const d of ut(i).iterNodeCarets("shadowRoot")) {
1214
- if (!bn(d) || !D(d.origin)) return !1;
1214
+ if (!yn(d) || !D(d.origin)) return !1;
1215
1215
  u = d;
1216
1216
  }
1217
1217
  const m = u.getParentAtCaret();
@@ -1224,13 +1224,13 @@ function Vn(n, e, t, o, r, s, l) {
1224
1224
  } else if (!A(_)) break;
1225
1225
  }
1226
1226
  return null;
1227
- }(dt(h, u.direction)), C = T(h, k);
1227
+ }(dt(h, u.direction)), C = T(h, $);
1228
1228
  if (!C || !C.is(s)) return !1;
1229
- const a = n.getElementByKey(h.getKey()), c = ke(a);
1229
+ const a = n.getElementByKey(h.getKey()), c = $e(a);
1230
1230
  if (!a || !c) return !1;
1231
- const f = Zn(n, C);
1231
+ const f = Qn(n, C);
1232
1232
  if (l.table = f, p) if (o === "extend") {
1233
- const d = ke(n.getElementByKey(p.origin.getKey()));
1233
+ const d = $e(n.getElementByKey(p.origin.getKey()));
1234
1234
  if (!d) return !1;
1235
1235
  l.$setAnchorCellForSelection(c), l.$setFocusCellForSelection(d, !0);
1236
1236
  } else {
@@ -1240,7 +1240,7 @@ function Vn(n, e, t, o, r, s, l) {
1240
1240
  else if (o === "extend") l.$setAnchorCellForSelection(c), l.$setFocusCellForSelection(c, !0);
1241
1241
  else {
1242
1242
  const d = function(g) {
1243
- const _ = vn(g);
1243
+ const _ = xn(g);
1244
1244
  return ht(_) ? ft(_) : g;
1245
1245
  }(dt(C, i.direction));
1246
1246
  Re(t.anchor, d), Re(t.focus, d);
@@ -1266,13 +1266,13 @@ function Lt(n, e, t, o, r) {
1266
1266
  }(s.focus.getNode());
1267
1267
  if (!l) return !1;
1268
1268
  const i = l.getPreviousSibling();
1269
- return !!k(i) && (ee(e), e.shiftKey ? s.focus.set(i.getParentOrThrow().getKey(), i.getIndexWithinParent(), "element") : i.selectEnd(), !0);
1269
+ return !!$(i) && (ee(e), e.shiftKey ? s.focus.set(i.getParentOrThrow().getKey(), i.getIndexWithinParent(), "element") : i.selectEnd(), !0);
1270
1270
  }
1271
1271
  if (e.shiftKey && (t === "up" || t === "down")) {
1272
1272
  const l = s.focus.getNode();
1273
1273
  if (!s.isCollapsed() && (t === "up" && !s.isBackward() || t === "down" && s.isBackward())) {
1274
- let i = T(l, (C) => k(C));
1275
- if (w(i) && (i = T(i, k)), i !== o || !i) return !1;
1274
+ let i = T(l, (C) => $(C));
1275
+ if (w(i) && (i = T(i, $)), i !== o || !i) return !1;
1276
1276
  const u = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
1277
1277
  if (!u) return !1;
1278
1278
  let m = 0;
@@ -1284,28 +1284,28 @@ function Lt(n, e, t, o, r) {
1284
1284
  }
1285
1285
  if (Sn(l)) {
1286
1286
  const i = t === "up" ? s.getNodes()[s.getNodes().length - 1] : s.getNodes()[0];
1287
- if (i && ve(o, i) !== null) {
1287
+ if (i && xe(o, i) !== null) {
1288
1288
  const u = o.getFirstDescendant(), m = o.getLastDescendant();
1289
1289
  if (!u || !m) return !1;
1290
- const [h] = G(u), [p] = G(m), C = o.getCordsFromCellNode(h, r.table), a = o.getCordsFromCellNode(p, r.table), c = o.getDOMCellFromCordsOrThrow(C.x, C.y, r.table), f = o.getDOMCellFromCordsOrThrow(a.x, a.y, r.table);
1290
+ const [h] = Z(u), [p] = Z(m), C = o.getCordsFromCellNode(h, r.table), a = o.getCordsFromCellNode(p, r.table), c = o.getDOMCellFromCordsOrThrow(C.x, C.y, r.table), f = o.getDOMCellFromCordsOrThrow(a.x, a.y, r.table);
1291
1291
  return r.$setAnchorCellForSelection(c), r.$setFocusCellForSelection(f, !0), !0;
1292
1292
  }
1293
1293
  return !1;
1294
1294
  }
1295
1295
  {
1296
1296
  let i = T(l, (m) => D(m) && !m.isInline());
1297
- if (w(i) && (i = T(i, k)), !i) return !1;
1297
+ if (w(i) && (i = T(i, $)), !i) return !1;
1298
1298
  const u = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
1299
- if (k(u) && r.tableNodeKey === u.getKey()) {
1299
+ if ($(u) && r.tableNodeKey === u.getKey()) {
1300
1300
  const m = u.getFirstDescendant(), h = u.getLastDescendant();
1301
1301
  if (!m || !h) return !1;
1302
- const [p] = G(m), [C] = G(h), a = s.clone();
1302
+ const [p] = Z(m), [C] = Z(h), a = s.clone();
1303
1303
  return a.focus.set((t === "up" ? p : C).getKey(), t === "up" ? 0 : C.getChildrenSize(), "element"), ee(e), ne(a), !0;
1304
1304
  }
1305
1305
  }
1306
1306
  }
1307
1307
  }
1308
- return t === "down" && Ze(n) && r.setShouldCheckSelection(), !1;
1308
+ return t === "down" && Qe(n) && r.setShouldCheckSelection(), !1;
1309
1309
  }
1310
1310
  if (z(s)) {
1311
1311
  if (t === "backward" || t === "forward")
@@ -1343,11 +1343,11 @@ function Lt(n, e, t, o, r) {
1343
1343
  return !0;
1344
1344
  }
1345
1345
  }
1346
- } else if (O(s)) {
1346
+ } else if (K(s)) {
1347
1347
  const { anchor: l, focus: i } = s, u = T(l.getNode(), w), m = T(i.getNode(), w), [h] = s.getNodes();
1348
- k(h) || y(251);
1348
+ $(h) || b(251);
1349
1349
  const p = ie(h, n.getElementByKey(h.getKey()));
1350
- if (!w(u) || !w(m) || !k(h) || p == null) return !1;
1350
+ if (!w(u) || !w(m) || !$(h) || p == null) return !1;
1351
1351
  r.$updateTableTableSelection(s);
1352
1352
  const C = me(h, p), a = o.getCordsFromCellNode(u, C), c = o.getDOMCellFromCordsOrThrow(a.x, a.y, C);
1353
1353
  if (r.$setAnchorCellForSelection(c), ee(e), e.shiftKey) {
@@ -1361,11 +1361,11 @@ function Lt(n, e, t, o, r) {
1361
1361
  function ee(n) {
1362
1362
  n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
1363
1363
  }
1364
- function yt(n, e, t) {
1364
+ function bt(n, e, t) {
1365
1365
  const o = I();
1366
1366
  n === "first" ? e.insertBefore(o) : e.insertAfter(o), o.append(...t || []), o.selectEnd();
1367
1367
  }
1368
- function bt(n, e, t) {
1368
+ function yt(n, e, t) {
1369
1369
  const o = t.getParent();
1370
1370
  if (!o) return;
1371
1371
  const r = Me(rt(n));
@@ -1374,8 +1374,8 @@ function bt(n, e, t) {
1374
1374
  if (!s || !l || !i || !l.contains(s) || i.contains(s)) return;
1375
1375
  const u = T(e.anchor.getNode(), (_) => w(_));
1376
1376
  if (!u) return;
1377
- const m = T(u, (_) => k(_));
1378
- if (!k(m) || !m.is(t)) return;
1377
+ const m = T(u, (_) => $(_));
1378
+ if (!$(m) || !m.is(t)) return;
1379
1379
  const [h, p] = U(t, u, u), C = h[0][0], a = h[h.length - 1][h[0].length - 1], { startRow: c, startColumn: f } = p, d = c === C.startRow && f === C.startColumn, g = c === a.startRow && f === a.startColumn;
1380
1380
  return d ? "first" : g ? "last" : void 0;
1381
1381
  }
@@ -1384,7 +1384,7 @@ function se(n, e) {
1384
1384
  return t.getDOMCellFromCordsOrThrow(o.x, o.y, n.table);
1385
1385
  }
1386
1386
  function je(n, e, t) {
1387
- return ve(n, re(e, t));
1387
+ return xe(n, re(e, t));
1388
1388
  }
1389
1389
  function Nt(n, e, t) {
1390
1390
  if (!e.theme.tableAlignment) return;
@@ -1393,16 +1393,16 @@ function Nt(n, e, t) {
1393
1393
  const l = e.theme.tableAlignment[s];
1394
1394
  l && (s === t ? r : o).push(l);
1395
1395
  }
1396
- ge(n, ...o), Z(n, ...r);
1396
+ ge(n, ...o), Q(n, ...r);
1397
1397
  }
1398
1398
  const Ve = /* @__PURE__ */ new WeakSet();
1399
- function Ze(n = Tt()) {
1399
+ function Qe(n = Tt()) {
1400
1400
  return Ve.has(n);
1401
1401
  }
1402
1402
  function ho(n, e) {
1403
1403
  e ? Ve.add(n) : Ve.delete(n);
1404
1404
  }
1405
- class ae extends Ge {
1405
+ class ae extends Ze {
1406
1406
  static getType() {
1407
1407
  return "table";
1408
1408
  }
@@ -1420,7 +1420,7 @@ class ae extends Ge {
1420
1420
  super.afterCloneFrom(e), this.__colWidths = e.__colWidths, this.__rowStriping = e.__rowStriping, this.__frozenColumnCount = e.__frozenColumnCount, this.__frozenRowCount = e.__frozenRowCount;
1421
1421
  }
1422
1422
  static importDOM() {
1423
- return { table: (e) => ({ conversion: Gn, priority: 1 }) };
1423
+ return { table: (e) => ({ conversion: Zn, priority: 1 }) };
1424
1424
  }
1425
1425
  static importJSON(e) {
1426
1426
  return st().updateFromJSON(e);
@@ -1439,28 +1439,28 @@ class ae extends Ge {
1439
1439
  }
1440
1440
  getDOMSlot(e) {
1441
1441
  const t = de(e) ? e : e.querySelector("table");
1442
- return de(t) || y(229), super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"));
1442
+ return de(t) || b(229), super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"));
1443
1443
  }
1444
1444
  createDOM(e, t) {
1445
1445
  const o = document.createElement("table");
1446
1446
  this.__style && (o.style.cssText = this.__style);
1447
1447
  const r = document.createElement("colgroup");
1448
- if (o.appendChild(r), Zt(r), Z(o, e.theme.table), this.updateTableElement(null, o, e), Ze(t)) {
1448
+ if (o.appendChild(r), Qt(r), Q(o, e.theme.table), this.updateTableElement(null, o, e), Qe(t)) {
1449
1449
  const s = document.createElement("div"), l = e.theme.tableScrollableWrapper;
1450
- return l ? Z(s, l) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), this.updateTableWrapper(null, s, o, e), s;
1450
+ return l ? Q(s, l) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), this.updateTableWrapper(null, s, o, e), s;
1451
1451
  }
1452
1452
  return o;
1453
1453
  }
1454
1454
  updateTableWrapper(e, t, o, r) {
1455
1455
  this.__frozenColumnCount !== (e ? e.__frozenColumnCount : 0) && function(s, l, i, u) {
1456
- u > 0 ? (Z(s, i.theme.tableFrozenColumn), l.setAttribute("data-lexical-frozen-column", "true")) : (ge(s, i.theme.tableFrozenColumn), l.removeAttribute("data-lexical-frozen-column"));
1456
+ u > 0 ? (Q(s, i.theme.tableFrozenColumn), l.setAttribute("data-lexical-frozen-column", "true")) : (ge(s, i.theme.tableFrozenColumn), l.removeAttribute("data-lexical-frozen-column"));
1457
1457
  }(t, o, r, this.__frozenColumnCount), this.__frozenRowCount !== (e ? e.__frozenRowCount : 0) && function(s, l, i, u) {
1458
- u > 0 ? (Z(s, i.theme.tableFrozenRow), l.setAttribute("data-lexical-frozen-row", "true")) : (ge(s, i.theme.tableFrozenRow), l.removeAttribute("data-lexical-frozen-row"));
1458
+ u > 0 ? (Q(s, i.theme.tableFrozenRow), l.setAttribute("data-lexical-frozen-row", "true")) : (ge(s, i.theme.tableFrozenRow), l.removeAttribute("data-lexical-frozen-row"));
1459
1459
  }(t, o, r, this.__frozenRowCount);
1460
1460
  }
1461
1461
  updateTableElement(e, t, o) {
1462
1462
  this.__style !== (e ? e.__style : "") && (t.style.cssText = this.__style), this.__rowStriping !== (!!e && e.__rowStriping) && function(r, s, l) {
1463
- l ? (Z(r, s.theme.tableRowStriping), r.setAttribute("data-lexical-row-striping", "true")) : (ge(r, s.theme.tableRowStriping), r.removeAttribute("data-lexical-row-striping"));
1463
+ l ? (Q(r, s.theme.tableRowStriping), r.setAttribute("data-lexical-row-striping", "true")) : (ge(r, s.theme.tableRowStriping), r.removeAttribute("data-lexical-row-striping"));
1464
1464
  }(t, o, this.__rowStriping), function(r, s, l, i) {
1465
1465
  const u = r.querySelector("colgroup");
1466
1466
  if (!u) return;
@@ -1474,7 +1474,7 @@ class ae extends Ge {
1474
1474
  }
1475
1475
  updateDOM(e, t, o) {
1476
1476
  const r = this.getDOMSlot(t).element;
1477
- return t === r === Ze() || (Ne(s = t) && s.nodeName === "DIV" && this.updateTableWrapper(e, t, r, o), this.updateTableElement(e, r, o), !1);
1477
+ return t === r === Qe() || (Ne(s = t) && s.nodeName === "DIV" && this.updateTableWrapper(e, t, r, o), this.updateTableElement(e, r, o), !1);
1478
1478
  var s;
1479
1479
  }
1480
1480
  exportDOM(e) {
@@ -1589,11 +1589,11 @@ class ae extends Ge {
1589
1589
  }), t;
1590
1590
  }
1591
1591
  }
1592
- function Zn(n, e) {
1592
+ function Qn(n, e) {
1593
1593
  const t = n.getElementByKey(e.getKey());
1594
- return t === null && y(230), me(e, t);
1594
+ return t === null && b(230), me(e, t);
1595
1595
  }
1596
- function Gn(n) {
1596
+ function Zn(n) {
1597
1597
  const e = st();
1598
1598
  n.hasAttribute("data-lexical-row-striping") && e.setRowStriping(!0), n.hasAttribute("data-lexical-frozen-column") && e.setFrozenColumns(1), n.hasAttribute("data-lexical-frozen-row") && e.setFrozenRows(1);
1599
1599
  const t = n.querySelector(":scope > colgroup");
@@ -1609,18 +1609,18 @@ function Gn(n) {
1609
1609
  }
1610
1610
  o && e.setColWidths(o);
1611
1611
  }
1612
- return { after: (o) => vt(o, A), node: e };
1612
+ return { after: (o) => xt(o, A), node: e };
1613
1613
  }
1614
1614
  function st() {
1615
- return Qe(new ae());
1615
+ return Ge(new ae());
1616
1616
  }
1617
- function k(n) {
1617
+ function $(n) {
1618
1618
  return n instanceof ae;
1619
1619
  }
1620
- function Qn({ rows: n, columns: e, includeHeaders: t }) {
1620
+ function Gn({ rows: n, columns: e, includeHeaders: t }) {
1621
1621
  const o = B() || Ue();
1622
1622
  if (!o || !z(o) || pe(o.anchor.getNode())) return !1;
1623
- const r = $n(Number(n), Number(e), t);
1623
+ const r = kn(Number(n), Number(e), t);
1624
1624
  qt(r);
1625
1625
  const s = r.getFirstDescendant();
1626
1626
  return Ce(s) && s.select(), !0;
@@ -1629,15 +1629,15 @@ function eo(n) {
1629
1629
  A(n.getParent()) ? n.isEmpty() && n.append(I()) : n.remove();
1630
1630
  }
1631
1631
  function to(n) {
1632
- k(n.getParent()) ? xt(n, w) : n.remove();
1632
+ $(n.getParent()) ? vt(n, w) : n.remove();
1633
1633
  }
1634
1634
  function no(n) {
1635
- xt(n, A);
1635
+ vt(n, A);
1636
1636
  const [e] = oe(n, null, null), t = e.reduce((r, s) => Math.max(r, s.length), 0), o = n.getChildren();
1637
1637
  for (let r = 0; r < e.length; ++r) {
1638
1638
  const s = o[r];
1639
1639
  if (!s) continue;
1640
- A(s) || y(254, s.constructor.name, s.getType());
1640
+ A(s) || b(254, s.constructor.name, s.getType());
1641
1641
  const l = e[r].reduce((i, u) => u ? 1 + i : i, 0);
1642
1642
  if (l !== t) for (let i = l; i < t; ++i) {
1643
1643
  const u = X();
@@ -1646,7 +1646,7 @@ function no(n) {
1646
1646
  }
1647
1647
  }
1648
1648
  function oo(n) {
1649
- if (n.detail < 3 || !be(n.target)) return !1;
1649
+ if (n.detail < 3 || !ye(n.target)) return !1;
1650
1650
  const e = re(n.target);
1651
1651
  if (e === null) return !1;
1652
1652
  const t = T(e, (o) => D(o) && !o.isInline());
@@ -1655,18 +1655,18 @@ function oo(n) {
1655
1655
  function fo(n) {
1656
1656
  return n.registerNodeTransform(ce, (e) => {
1657
1657
  if (e.getColSpan() > 1 || e.getRowSpan() > 1) {
1658
- const [, , t] = G(e), [o] = U(t, e, e), r = o.length, s = o[0].length;
1658
+ const [, , t] = Z(e), [o] = U(t, e, e), r = o.length, s = o[0].length;
1659
1659
  let l = t.getFirstChild();
1660
- A(l) || y(175);
1660
+ A(l) || b(175);
1661
1661
  const i = [];
1662
1662
  for (let u = 0; u < r; u++) {
1663
- u !== 0 && (l = l.getNextSibling(), A(l) || y(175));
1663
+ u !== 0 && (l = l.getNextSibling(), A(l) || b(175));
1664
1664
  let m = null;
1665
1665
  for (let h = 0; h < s; h++) {
1666
1666
  const p = o[u][h], C = p.cell;
1667
1667
  if (p.startRow === u && p.startColumn === h) m = C, i.push(C);
1668
1668
  else if (C.getColSpan() > 1 || C.getRowSpan() > 1) {
1669
- w(C) || y(176);
1669
+ w(C) || b(176);
1670
1670
  const a = X(C.__headerState);
1671
1671
  m !== null ? m.insertAfter(a) : Yt(l, a);
1672
1672
  }
@@ -1685,7 +1685,7 @@ function go(n, e = !0) {
1685
1685
  for (const [l, i] of s) {
1686
1686
  const u = t.get(l);
1687
1687
  if (i === "created" || i === "updated") {
1688
- const { tableNode: m, tableElement: h } = kt(l);
1688
+ const { tableNode: m, tableElement: h } = $t(l);
1689
1689
  u === void 0 ? o(m, l, h) : h !== u[1] && (u[0].removeListeners(), t.delete(l), o(m, l, h));
1690
1690
  } else i === "destroyed" && u !== void 0 && (u[0].removeListeners(), t.delete(l));
1691
1691
  }
@@ -1697,13 +1697,13 @@ function go(n, e = !0) {
1697
1697
  };
1698
1698
  }
1699
1699
  function mo(n) {
1700
- return n.hasNodes([ae]) || y(255), Xt(n.registerCommand(On, Qn, De), n.registerCommand(Rt, ({ nodes: e, selection: t }, o) => n !== o || !z(t) ? !1 : pe(t.anchor.getNode()) !== null && e.some(k), De), n.registerCommand(Gt, oo, De), n.registerNodeTransform(ae, no), n.registerNodeTransform(Te, to), n.registerNodeTransform(ce, eo));
1700
+ return n.hasNodes([ae]) || b(255), Xt(n.registerCommand(Kn, Gn, De), n.registerCommand(Rt, ({ nodes: e, selection: t }, o) => n !== o || !z(t) ? !1 : pe(t.anchor.getNode()) !== null && e.some($), De), n.registerCommand(Zt, oo, De), n.registerNodeTransform(ae, no), n.registerNodeTransform(Te, to), n.registerNodeTransform(ce, eo));
1701
1701
  }
1702
1702
  export {
1703
1703
  co as B,
1704
1704
  At as H,
1705
- xe as K,
1706
- $n as L,
1705
+ ve as K,
1706
+ kn as L,
1707
1707
  Te as O,
1708
1708
  ao as P,
1709
1709
  w as R,
@@ -1713,10 +1713,10 @@ export {
1713
1713
  ae as a,
1714
1714
  mo as b,
1715
1715
  ho as c,
1716
- Ze as s,
1716
+ Qe as s,
1717
1717
  X as v,
1718
1718
  go as w,
1719
1719
  ce as y,
1720
- Ot as z
1720
+ Kt as z
1721
1721
  };
1722
- //# sourceMappingURL=LexicalTable.prod-BArw8Dt5.js.map
1722
+ //# sourceMappingURL=LexicalTable.prod-DYP5JQC0.js.map