@uva-glass/component-library 2.0.0 → 2.0.1

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 (55) hide show
  1. package/dist/{Lexical.prod-DeeCy7Xd.js → Lexical.prod-Bzma_w4s.js} +2 -2
  2. package/dist/{Lexical.prod-DeeCy7Xd.js.map → Lexical.prod-Bzma_w4s.js.map} +1 -1
  3. package/dist/{LexicalClipboard.prod-CayrMfkI.js → LexicalClipboard.prod-Dg23ixPD.js} +4 -4
  4. package/dist/{LexicalClipboard.prod-CayrMfkI.js.map → LexicalClipboard.prod-Dg23ixPD.js.map} +1 -1
  5. package/dist/{LexicalLink.prod-Biaqry-c.js → LexicalLink.prod-C1RDJLfo.js} +3 -3
  6. package/dist/{LexicalLink.prod-Biaqry-c.js.map → LexicalLink.prod-C1RDJLfo.js.map} +1 -1
  7. package/dist/{LexicalList.prod-Uk8UObU7.js → LexicalList.prod-BGzfDPU0.js} +3 -3
  8. package/dist/{LexicalList.prod-Uk8UObU7.js.map → LexicalList.prod-BGzfDPU0.js.map} +1 -1
  9. package/dist/{LexicalSelection.prod-C1TEIGhq.js → LexicalSelection.prod-CNWFGVlh.js} +2 -2
  10. package/dist/{LexicalSelection.prod-C1TEIGhq.js.map → LexicalSelection.prod-CNWFGVlh.js.map} +1 -1
  11. package/dist/{LexicalTable.prod-hx6rW3fc.js → LexicalTable.prod-D-4NN9o5.js} +500 -472
  12. package/dist/LexicalTable.prod-D-4NN9o5.js.map +1 -0
  13. package/dist/{LexicalUtils.prod-CCjlRAc-.js → LexicalUtils.prod-Cg2siy-c.js} +2 -2
  14. package/dist/{LexicalUtils.prod-CCjlRAc-.js.map → LexicalUtils.prod-Cg2siy-c.js.map} +1 -1
  15. package/dist/{TablePlugin-ByeOn0Zf.js → TablePlugin-DDlrU-7e.js} +27 -27
  16. package/dist/{TablePlugin-ByeOn0Zf.js.map → TablePlugin-DDlrU-7e.js.map} +1 -1
  17. package/dist/{chunk-7R3XDUXW-C-tvzxWq.js → chunk-D52XG6IA-CQ2nAQyC.js} +472 -456
  18. package/dist/chunk-D52XG6IA-CQ2nAQyC.js.map +1 -0
  19. package/dist/components/Buttons/LinkButton.js +1 -1
  20. package/dist/components/Buttons/LinkButton.stories.js +1 -1
  21. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  22. package/dist/components/FormInput/FormInput.js +1 -1
  23. package/dist/components/InputField/InputField.stories.js +1 -1
  24. package/dist/components/MenuLink/MenuLink.js +1 -1
  25. package/dist/components/MenuLink/MenuLink.stories.js +1 -1
  26. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  27. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  28. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  29. package/dist/components/MultiSelect/index.js +1 -1
  30. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  31. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  32. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  33. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +1 -1
  34. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
  35. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
  36. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
  37. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +4 -4
  38. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  39. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
  40. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +3 -3
  41. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  42. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +3 -3
  43. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +10 -10
  44. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  45. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +19 -19
  46. package/dist/components/RteEditor/Plugins/index.js +1 -1
  47. package/dist/components/RteEditor/RteEditor.js +75 -75
  48. package/dist/components/RteEditor/helpers.js +4 -4
  49. package/dist/components/index.js +1 -1
  50. package/dist/{helpers-CgzuKnuq.js → helpers-BVGma1u6.js} +4 -4
  51. package/dist/{helpers-CgzuKnuq.js.map → helpers-BVGma1u6.js.map} +1 -1
  52. package/dist/index.js +1 -1
  53. package/package.json +6 -6
  54. package/dist/LexicalTable.prod-hx6rW3fc.js.map +0 -1
  55. package/dist/chunk-7R3XDUXW-C-tvzxWq.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { W as V, o as y, j as Kt, u as ge } from "./LexicalUtils.prod-CCjlRAc-.js";
2
- import { k as Et, z as et, b as M, G as fe, h as pt, g as $t, d as Mt, I as me, T as Nt, f as G, e as pe, i as ft, P as ne, j as Yt, a as H, R as B, $ as xt, l as Ce, U as X, B as Se, m as be, O as we, n as _e, N as ye, q as Ne, r as xe, t as tt, F as q, v as St, s as ve, o as Te, c as ke, E as Fe, A as Re, W as oe, u as Oe, S as Ke, w as Ee, x as $e, y as Me, D as Ae, H as re, J as Pe, L as He, M as Be, Q as Ct, V as Le, X as De, Y as We } from "./Lexical.prod-DeeCy7Xd.js";
3
- import { O as Ie, L as ze } from "./LexicalClipboard.prod-CayrMfkI.js";
1
+ import { W as V, o as y, j as Ot, u as fe } from "./LexicalUtils.prod-Cg2siy-c.js";
2
+ import { k as Et, T as ft, z as et, b as M, G as me, h as Ct, g as $t, d as Mt, I as pe, f as G, e as Ce, i as mt, P as ne, j as Yt, a as H, R as B, $ as xt, l as Se, U as X, B as be, m as we, O as _e, n as ye, N as Ne, q as xe, r as ve, t as tt, F as J, v as bt, s as Te, o as ke, c as Fe, E as Ke, A as Re, W as oe, u as Oe, S as Ee, w as $e, x as Me, y as Ae, D as Pe, H as re, J as He, L as Be, M as Le, Q as St, V as We, X as De, Y as Ie } from "./Lexical.prod-Bzma_w4s.js";
3
+ import { O as ze, L as Xe } from "./LexicalClipboard.prod-Dg23ixPD.js";
4
4
  const At = /^(\d+(?:\.\d+)?)px$/, Y = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
5
5
  class at extends Et {
6
6
  static getType() {
@@ -13,14 +13,14 @@ class at extends Et {
13
13
  super.afterCloneFrom(t), this.__rowSpan = t.__rowSpan, this.__backgroundColor = t.__backgroundColor;
14
14
  }
15
15
  static importDOM() {
16
- return { td: (t) => ({ conversion: jt, priority: 0 }), th: (t) => ({ conversion: jt, priority: 0 }) };
16
+ return { td: (t) => ({ conversion: qt, priority: 0 }), th: (t) => ({ conversion: qt, priority: 0 }) };
17
17
  }
18
18
  static importJSON(t) {
19
19
  const e = t.colSpan || 1, o = t.rowSpan || 1;
20
20
  return Pt(t.headerState, e, t.width || void 0).setRowSpan(o).setBackgroundColor(t.backgroundColor || null);
21
21
  }
22
- constructor(t = Y.NO_STATUS, e = 1, o, l) {
23
- super(l), this.__colSpan = e, this.__rowSpan = 1, this.__headerState = t, this.__width = o, this.__backgroundColor = null;
22
+ constructor(t = Y.NO_STATUS, e = 1, o, r) {
23
+ super(r), this.__colSpan = e, this.__rowSpan = 1, this.__headerState = t, this.__width = o, this.__backgroundColor = null;
24
24
  }
25
25
  createDOM(t) {
26
26
  const e = document.createElement(this.getTag());
@@ -28,9 +28,9 @@ class at extends Et {
28
28
  }
29
29
  exportDOM(t) {
30
30
  const e = super.exportDOM(t);
31
- if (e.element) {
31
+ if (e.element && ft(e.element)) {
32
32
  const o = e.element;
33
- 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 = "top", o.style.textAlign = "start", this.__backgroundColor === null && this.hasHeader() && (o.style.backgroundColor = "#f2f3f5");
33
+ 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 = "top", o.style.textAlign = "start", this.__backgroundColor === null && this.hasHeader() && (o.style.backgroundColor = "#f2f3f5");
34
34
  }
35
35
  return e;
36
36
  }
@@ -101,23 +101,23 @@ class at extends Et {
101
101
  return !1;
102
102
  }
103
103
  }
104
- function jt(n) {
104
+ function qt(n) {
105
105
  const t = n, e = n.nodeName.toLowerCase();
106
106
  let o;
107
107
  At.test(t.style.width) && (o = parseFloat(t.style.width));
108
- const l = Pt(e === "th" ? Y.ROW : Y.NO_STATUS, t.colSpan, o);
109
- l.__rowSpan = t.rowSpan;
108
+ const r = Pt(e === "th" ? Y.ROW : Y.NO_STATUS, t.colSpan, o);
109
+ r.__rowSpan = t.rowSpan;
110
110
  const i = t.style.backgroundColor;
111
- i !== "" && (l.__backgroundColor = i);
112
- const r = t.style, c = (r && r.textDecoration || "").split(" "), d = r.fontWeight === "700" || r.fontWeight === "bold", f = c.includes("line-through"), s = r.fontStyle === "italic", a = c.includes("underline");
113
- return { after: (u) => (u.length === 0 && u.push(et()), u), forChild: (u, h) => {
114
- if (S(h) && !M(u)) {
111
+ i !== "" && (r.__backgroundColor = i);
112
+ const l = t.style, u = (l && l.textDecoration || "").split(" "), d = l.fontWeight === "700" || l.fontWeight === "bold", f = u.includes("line-through"), s = l.fontStyle === "italic", a = u.includes("underline");
113
+ return { after: (c) => (c.length === 0 && c.push(et()), c), forChild: (c, h) => {
114
+ if (S(h) && !M(c)) {
115
115
  const g = et();
116
- return fe(u) && u.getTextContent() === `
117
- ` ? null : (pt(u) && (d && u.toggleFormat("bold"), f && u.toggleFormat("strikethrough"), s && u.toggleFormat("italic"), a && u.toggleFormat("underline")), g.append(u), g);
116
+ return me(c) && c.getTextContent() === `
117
+ ` ? null : (Ct(c) && (d && c.toggleFormat("bold"), f && c.toggleFormat("strikethrough"), s && c.toggleFormat("italic"), a && c.toggleFormat("underline")), g.append(c), g);
118
118
  }
119
- return u;
120
- }, node: l };
119
+ return c;
120
+ }, node: r };
121
121
  }
122
122
  function Pt(n, t = 1, e) {
123
123
  return $t(new at(n, t, e));
@@ -125,27 +125,27 @@ function Pt(n, t = 1, e) {
125
125
  function S(n) {
126
126
  return n instanceof at;
127
127
  }
128
- const cn = pe();
129
- function Xe(n) {
128
+ const cn = Ce();
129
+ function Ye(n) {
130
130
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
131
131
  }
132
- var w = Xe(function(n) {
132
+ var w = Ye(function(n) {
133
133
  const t = new URLSearchParams();
134
134
  t.append("code", n);
135
135
  for (let e = 1; e < arguments.length; e++) t.append("v", arguments[e]);
136
136
  throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
137
137
  });
138
- const Ht = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Ye = Ht && "documentMode" in document ? document.documentMode : null, je = Ht && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
139
- Ht && "InputEvent" in window && !Ye && new window.InputEvent("input");
140
- class bt extends Et {
138
+ const Ht = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, qe = Ht && "documentMode" in document ? document.documentMode : null, je = Ht && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
139
+ Ht && "InputEvent" in window && !qe && new window.InputEvent("input");
140
+ class wt extends Et {
141
141
  static getType() {
142
142
  return "tablerow";
143
143
  }
144
144
  static clone(t) {
145
- return new bt(t.__height, t.__key);
145
+ return new wt(t.__height, t.__key);
146
146
  }
147
147
  static importDOM() {
148
- return { tr: (t) => ({ conversion: Ue, priority: 0 }) };
148
+ return { tr: (t) => ({ conversion: Je, priority: 0 }) };
149
149
  }
150
150
  static importJSON(t) {
151
151
  return Bt(t.height);
@@ -160,6 +160,9 @@ class bt extends Et {
160
160
  const e = document.createElement("tr");
161
161
  return this.__height && (e.style.height = `${this.__height}px`), V(e, t.theme.tableRow), e;
162
162
  }
163
+ extractWithChild(t, e, o) {
164
+ return o === "html";
165
+ }
163
166
  isShadowRoot() {
164
167
  return !0;
165
168
  }
@@ -179,25 +182,25 @@ class bt extends Et {
179
182
  return !1;
180
183
  }
181
184
  }
182
- function Ue(n) {
185
+ function Je(n) {
183
186
  const t = n;
184
187
  let e;
185
188
  return At.test(t.style.height) && (e = parseFloat(t.style.height)), { node: Bt(e) };
186
189
  }
187
190
  function Bt(n) {
188
- return $t(new bt(n));
191
+ return $t(new wt(n));
189
192
  }
190
193
  function L(n) {
191
- return n instanceof bt;
194
+ return n instanceof wt;
192
195
  }
193
196
  function un(n, t, e = !0) {
194
- const o = Wt();
195
- for (let l = 0; l < n; l++) {
197
+ const o = Dt();
198
+ for (let r = 0; r < n; r++) {
196
199
  const i = Bt();
197
- for (let r = 0; r < t; r++) {
198
- let c = Y.NO_STATUS;
199
- typeof e == "object" ? (l === 0 && e.rows && (c |= Y.ROW), r === 0 && e.columns && (c |= Y.COLUMN)) : e && (l === 0 && (c |= Y.ROW), r === 0 && (c |= Y.COLUMN));
200
- const d = Pt(c), f = et();
200
+ for (let l = 0; l < t; l++) {
201
+ let u = Y.NO_STATUS;
202
+ typeof e == "object" ? (r === 0 && e.rows && (u |= Y.ROW), l === 0 && e.columns && (u |= Y.COLUMN)) : e && (r === 0 && (u |= Y.ROW), l === 0 && (u |= Y.COLUMN));
203
+ const d = Pt(u), f = et();
201
204
  f.append(Mt()), d.append(f), i.append(d);
202
205
  }
203
206
  o.append(i);
@@ -213,14 +216,14 @@ function le(n) {
213
216
  if (L(t)) return t;
214
217
  throw new Error("Expected table cell to be inside of table row.");
215
218
  }
216
- function qe(n) {
217
- const t = y(n, (e) => K(e));
218
- if (K(t)) return t;
219
+ function Ue(n) {
220
+ const t = y(n, (e) => O(e));
221
+ if (O(t)) return t;
219
222
  throw new Error("Expected table cell to be inside of table.");
220
223
  }
221
224
  function dn(n) {
222
225
  const t = le(n);
223
- return qe(t).getChildren().findIndex((e) => e.is(t));
226
+ return Ue(t).getChildren().findIndex((e) => e.is(t));
224
227
  }
225
228
  function gn(n) {
226
229
  return le(n).getChildren().findIndex((t) => t.is(n));
@@ -228,117 +231,117 @@ function gn(n) {
228
231
  function fn(n, t) {
229
232
  const e = n.getChildren();
230
233
  for (let o = 0; o < e.length; o++) {
231
- const l = e[o];
232
- if (L(l)) {
233
- const i = l.getChildren();
234
+ const r = e[o];
235
+ if (L(r)) {
236
+ const i = r.getChildren();
234
237
  if (t >= i.length || t < 0) throw new Error("Table column target index out of range");
235
238
  i[t].remove();
236
239
  }
237
240
  }
238
241
  return n;
239
242
  }
240
- function J(n, t, e) {
241
- const [o, l, i] = Je(n, t, e);
242
- return l === null && w(207), i === null && w(208), [o, l, i];
243
+ function U(n, t, e) {
244
+ const [o, r, i] = se(n, t, e);
245
+ return r === null && w(207), i === null && w(208), [o, r, i];
243
246
  }
244
- function Je(n, t, e) {
247
+ function se(n, t, e) {
245
248
  const o = [];
246
- let l = null, i = null;
247
- function r(d) {
249
+ let r = null, i = null;
250
+ function l(d) {
248
251
  let f = o[d];
249
252
  return f === void 0 && (o[d] = f = []), f;
250
253
  }
251
- const c = n.getChildren();
252
- for (let d = 0; d < c.length; d++) {
253
- const f = c[d];
254
+ const u = n.getChildren();
255
+ for (let d = 0; d < u.length; d++) {
256
+ const f = u[d];
254
257
  L(f) || w(209);
255
258
  for (let s = f.getFirstChild(), a = 0; s != null; s = s.getNextSibling()) {
256
259
  S(s) || w(147);
257
- const u = r(d);
258
- for (; u[a] !== void 0; ) a++;
260
+ const c = l(d);
261
+ for (; c[a] !== void 0; ) a++;
259
262
  const h = { cell: s, startColumn: a, startRow: d }, { __rowSpan: g, __colSpan: p } = s;
260
- for (let m = 0; m < g && !(d + m >= c.length); m++) {
261
- const C = r(d + m);
263
+ for (let m = 0; m < g && !(d + m >= u.length); m++) {
264
+ const C = l(d + m);
262
265
  for (let b = 0; b < p; b++) C[a + b] = h;
263
266
  }
264
- t !== null && l === null && t.is(s) && (l = h), e !== null && i === null && e.is(s) && (i = h);
267
+ t !== null && r === null && t.is(s) && (r = h), e !== null && i === null && e.is(s) && (i = h);
265
268
  }
266
269
  }
267
- return [o, l, i];
270
+ return [o, r, i];
268
271
  }
269
272
  function rt(n) {
270
273
  let t;
271
274
  if (n instanceof at) t = n;
272
275
  else if ("__type" in n) {
273
- const l = y(n, S);
274
- S(l) || w(148), t = l;
276
+ const r = y(n, S);
277
+ S(r) || w(148), t = r;
275
278
  } else {
276
- const l = y(n.getNode(), S);
277
- S(l) || w(148), t = l;
279
+ const r = y(n.getNode(), S);
280
+ S(r) || w(148), t = r;
278
281
  }
279
282
  const e = t.getParent();
280
283
  L(e) || w(149);
281
284
  const o = e.getParent();
282
- return K(o) || w(210), [t, e, o];
285
+ return O(o) || w(210), [t, e, o];
283
286
  }
284
287
  function kt(n, t, e) {
285
- let o = Math.min(t.startColumn, e.startColumn), l = Math.min(t.startRow, e.startRow), i = Math.max(t.startColumn + t.cell.__colSpan - 1, e.startColumn + e.cell.__colSpan - 1), r = Math.max(t.startRow + t.cell.__rowSpan - 1, e.startRow + e.cell.__rowSpan - 1), c = o, d = l, f = o, s = l;
286
- function a(u) {
287
- const { cell: h, startColumn: g, startRow: p } = u;
288
- o = Math.min(o, g), l = Math.min(l, p), i = Math.max(i, g + h.__colSpan - 1), r = Math.max(r, p + h.__rowSpan - 1);
289
- }
290
- for (; o < c || l < d || i > f || r > s; ) {
291
- if (o < c) {
292
- const u = s - d, h = c - 1;
293
- for (let g = 0; g <= u; g++) a(n[d + g][h]);
294
- c = h;
288
+ let o = Math.min(t.startColumn, e.startColumn), r = Math.min(t.startRow, e.startRow), i = Math.max(t.startColumn + t.cell.__colSpan - 1, e.startColumn + e.cell.__colSpan - 1), l = Math.max(t.startRow + t.cell.__rowSpan - 1, e.startRow + e.cell.__rowSpan - 1), u = o, d = r, f = o, s = r;
289
+ function a(c) {
290
+ const { cell: h, startColumn: g, startRow: p } = c;
291
+ o = Math.min(o, g), r = Math.min(r, p), i = Math.max(i, g + h.__colSpan - 1), l = Math.max(l, p + h.__rowSpan - 1);
292
+ }
293
+ for (; o < u || r < d || i > f || l > s; ) {
294
+ if (o < u) {
295
+ const c = s - d, h = u - 1;
296
+ for (let g = 0; g <= c; g++) a(n[d + g][h]);
297
+ u = h;
295
298
  }
296
- if (l < d) {
297
- const u = f - c, h = d - 1;
298
- for (let g = 0; g <= u; g++) a(n[h][c + g]);
299
+ if (r < d) {
300
+ const c = f - u, h = d - 1;
301
+ for (let g = 0; g <= c; g++) a(n[h][u + g]);
299
302
  d = h;
300
303
  }
301
304
  if (i > f) {
302
- const u = s - d, h = f + 1;
303
- for (let g = 0; g <= u; g++) a(n[d + g][h]);
305
+ const c = s - d, h = f + 1;
306
+ for (let g = 0; g <= c; g++) a(n[d + g][h]);
304
307
  f = h;
305
308
  }
306
- if (r > s) {
307
- const u = f - c, h = s + 1;
308
- for (let g = 0; g <= u; g++) a(n[h][c + g]);
309
+ if (l > s) {
310
+ const c = f - u, h = s + 1;
311
+ for (let g = 0; g <= c; g++) a(n[h][u + g]);
309
312
  s = h;
310
313
  }
311
314
  }
312
- return { maxColumn: i, maxRow: r, minColumn: o, minRow: l };
315
+ return { maxColumn: i, maxRow: l, minColumn: o, minRow: r };
313
316
  }
314
- function Ut(n) {
315
- const [t, , e] = rt(n), o = e.getChildren(), l = o.length, i = o[0].getChildren().length, r = new Array(l);
316
- for (let c = 0; c < l; c++) r[c] = new Array(i);
317
- for (let c = 0; c < l; c++) {
318
- const d = o[c].getChildren();
317
+ function jt(n) {
318
+ const [t, , e] = rt(n), o = e.getChildren(), r = o.length, i = o[0].getChildren().length, l = new Array(r);
319
+ for (let u = 0; u < r; u++) l[u] = new Array(i);
320
+ for (let u = 0; u < r; u++) {
321
+ const d = o[u].getChildren();
319
322
  let f = 0;
320
323
  for (let s = 0; s < d.length; s++) {
321
- for (; r[c][f]; ) f++;
322
- const a = d[s], u = a.__rowSpan || 1, h = a.__colSpan || 1;
323
- for (let g = 0; g < u; g++) for (let p = 0; p < h; p++) r[c + g][f + p] = a;
324
- if (t === a) return { colSpan: h, columnIndex: f, rowIndex: c, rowSpan: u };
324
+ for (; l[u][f]; ) f++;
325
+ const a = d[s], c = a.__rowSpan || 1, h = a.__colSpan || 1;
326
+ for (let g = 0; g < c; g++) for (let p = 0; p < h; p++) l[u + g][f + p] = a;
327
+ if (t === a) return { colSpan: h, columnIndex: f, rowIndex: u, rowSpan: c };
325
328
  f += h;
326
329
  }
327
330
  }
328
331
  return null;
329
332
  }
330
- function qt(n) {
331
- const [[t, e, o, l], [i, r, c, d]] = ["anchor", "focus"].map((f) => {
333
+ function Jt(n) {
334
+ const [[t, e, o, r], [i, l, u, d]] = ["anchor", "focus"].map((f) => {
332
335
  const s = n[f].getNode(), a = y(s, S);
333
336
  S(a) || w(238, f, s.getKey(), s.getType());
334
- const u = a.getParent();
335
- L(u) || w(239, f);
336
- const h = u.getParent();
337
- return K(h) || w(240, f), [s, a, u, h];
337
+ const c = a.getParent();
338
+ L(c) || w(239, f);
339
+ const h = c.getParent();
340
+ return O(h) || w(240, f), [s, a, c, h];
338
341
  });
339
- return l.is(d) || w(241), { anchorCell: e, anchorNode: t, anchorRow: o, anchorTable: l, focusCell: r, focusNode: i, focusRow: c, focusTable: d };
342
+ return r.is(d) || w(241), { anchorCell: e, anchorNode: t, anchorRow: o, anchorTable: r, focusCell: l, focusNode: i, focusRow: u, focusTable: d };
340
343
  }
341
- class wt {
344
+ class _t {
342
345
  constructor(t, e, o) {
343
346
  this.anchor = e, this.focus = o, e._selection = this, o._selection = this, this._cachedNodes = null, this.dirty = !1, this.tableKey = t;
344
347
  }
@@ -358,13 +361,13 @@ class wt {
358
361
  this._cachedNodes = t;
359
362
  }
360
363
  is(t) {
361
- return R(t) && this.tableKey === t.tableKey && this.anchor.is(t.anchor) && this.focus.is(t.focus);
364
+ return K(t) && this.tableKey === t.tableKey && this.anchor.is(t.anchor) && this.focus.is(t.focus);
362
365
  }
363
366
  set(t, e, o) {
364
367
  this.dirty = this.dirty || t !== this.tableKey || e !== this.anchor.key || o !== this.focus.key, this.tableKey = t, this.anchor.key = e, this.focus.key = o, this._cachedNodes = null;
365
368
  }
366
369
  clone() {
367
- return new wt(this.tableKey, Ct(this.anchor.key, this.anchor.offset, this.anchor.type), Ct(this.focus.key, this.focus.offset, this.focus.type));
370
+ return new _t(this.tableKey, St(this.anchor.key, this.anchor.offset, this.anchor.type), St(this.focus.key, this.focus.offset, this.focus.type));
368
371
  }
369
372
  isCollapsed() {
370
373
  return !1;
@@ -378,45 +381,45 @@ class wt {
378
381
  }
379
382
  hasFormat(t) {
380
383
  let e = 0;
381
- this.getNodes().filter(S).forEach((l) => {
382
- const i = l.getFirstChild();
384
+ this.getNodes().filter(S).forEach((r) => {
385
+ const i = r.getFirstChild();
383
386
  oe(i) && (e |= i.getTextFormat());
384
387
  });
385
- const o = We[t];
388
+ const o = Ie[t];
386
389
  return !!(e & o);
387
390
  }
388
391
  insertNodes(t) {
389
392
  const e = this.focus.getNode();
390
- M(e) || w(151), Le(e.select(0, e.getChildrenSize())).insertNodes(t);
393
+ M(e) || w(151), We(e.select(0, e.getChildrenSize())).insertNodes(t);
391
394
  }
392
395
  getShape() {
393
- const { anchorCell: t, focusCell: e } = qt(this), o = Ut(t);
396
+ const { anchorCell: t, focusCell: e } = Jt(this), o = jt(t);
394
397
  o === null && w(153);
395
- const l = Ut(e);
396
- l === null && w(155);
397
- const i = Math.min(o.columnIndex, l.columnIndex), r = Math.max(o.columnIndex + o.colSpan - 1, l.columnIndex + l.colSpan - 1), c = Math.min(o.rowIndex, l.rowIndex), d = Math.max(o.rowIndex + o.rowSpan - 1, l.rowIndex + l.rowSpan - 1);
398
- return { fromX: Math.min(i, r), fromY: Math.min(c, d), toX: Math.max(i, r), toY: Math.max(c, d) };
398
+ const r = jt(e);
399
+ r === null && w(155);
400
+ const i = Math.min(o.columnIndex, r.columnIndex), l = Math.max(o.columnIndex + o.colSpan - 1, r.columnIndex + r.colSpan - 1), u = Math.min(o.rowIndex, r.rowIndex), d = Math.max(o.rowIndex + o.rowSpan - 1, r.rowIndex + r.rowSpan - 1);
401
+ return { fromX: Math.min(i, l), fromY: Math.min(u, d), toX: Math.max(i, l), toY: Math.max(u, d) };
399
402
  }
400
403
  getNodes() {
401
404
  if (!this.isValid()) return [];
402
405
  const t = this._cachedNodes;
403
406
  if (t !== null) return t;
404
- const { anchorTable: e, anchorCell: o, focusCell: l } = qt(this), i = l.getParents()[1];
407
+ const { anchorTable: e, anchorCell: o, focusCell: r } = Jt(this), i = r.getParents()[1];
405
408
  if (i !== e) {
406
- if (e.isParentOf(l)) {
409
+ if (e.isParentOf(r)) {
407
410
  const m = i.getParent();
408
- m == null && w(159), this.set(this.tableKey, l.getKey(), m.getKey());
411
+ m == null && w(159), this.set(this.tableKey, r.getKey(), m.getKey());
409
412
  } else {
410
413
  const m = e.getParent();
411
- m == null && w(158), this.set(this.tableKey, m.getKey(), l.getKey());
414
+ m == null && w(158), this.set(this.tableKey, m.getKey(), r.getKey());
412
415
  }
413
416
  return this.getNodes();
414
417
  }
415
- const [r, c, d] = J(e, o, l), { minColumn: f, maxColumn: s, minRow: a, maxRow: u } = kt(r, c, d), h = /* @__PURE__ */ new Map([[e.getKey(), e]]);
418
+ const [l, u, d] = U(e, o, r), { minColumn: f, maxColumn: s, minRow: a, maxRow: c } = kt(l, u, d), h = /* @__PURE__ */ new Map([[e.getKey(), e]]);
416
419
  let g = null;
417
- for (let m = a; m <= u; m++) for (let C = f; C <= s; C++) {
418
- const { cell: b } = r[m][C], O = b.getParent();
419
- L(O) || w(160), O !== g && (h.set(O.getKey(), O), g = O), h.has(b.getKey()) || Ve(b, (E) => {
420
+ for (let m = a; m <= c; m++) for (let C = f; C <= s; C++) {
421
+ const { cell: b } = l[m][C], R = b.getParent();
422
+ L(R) || w(160), R !== g && (h.set(R.getKey(), R), g = R), h.has(b.getKey()) || Ve(b, (E) => {
420
423
  h.set(E.getKey(), E);
421
424
  });
422
425
  }
@@ -427,30 +430,30 @@ class wt {
427
430
  const t = this.getNodes().filter((o) => S(o));
428
431
  let e = "";
429
432
  for (let o = 0; o < t.length; o++) {
430
- const l = t[o], i = l.__parent, r = (t[o + 1] || {}).__parent;
431
- e += l.getTextContent() + (r !== i ? `
433
+ const r = t[o], i = r.__parent, l = (t[o + 1] || {}).__parent;
434
+ e += r.getTextContent() + (l !== i ? `
432
435
  ` : " ");
433
436
  }
434
437
  return e;
435
438
  }
436
439
  }
437
- function R(n) {
438
- return n instanceof wt;
440
+ function K(n) {
441
+ return n instanceof _t;
439
442
  }
440
- function Jt() {
441
- const n = Ct("root", 0, "element"), t = Ct("root", 0, "element");
442
- return new wt("root", n, t);
443
+ function Ut() {
444
+ const n = St("root", 0, "element"), t = St("root", 0, "element");
445
+ return new _t("root", n, t);
443
446
  }
444
447
  function Ve(n, t) {
445
448
  const e = [[n]];
446
449
  for (let o = e.at(-1); o !== void 0 && e.length > 0; o = e.at(-1)) {
447
- const l = o.pop();
448
- l === void 0 ? e.pop() : t(l) !== !1 && M(l) && e.push(l.getChildren());
450
+ const r = o.pop();
451
+ r === void 0 ? e.pop() : t(r) !== !1 && M(r) && e.push(r.getChildren());
449
452
  }
450
453
  }
451
454
  function Ge(n, t = ne()) {
452
- const e = ft(n);
453
- K(e) || w(231, n);
455
+ const e = mt(n);
456
+ O(e) || w(231, n);
454
457
  const o = nt(e, t.getElementByKey(n));
455
458
  return o === null && w(232, n), { tableElement: o, tableNode: e };
456
459
  }
@@ -471,16 +474,16 @@ class Qe {
471
474
  const t = new MutationObserver((e) => {
472
475
  this.editor.getEditorState().read(() => {
473
476
  let o = !1;
474
- for (let r = 0; r < e.length; r++) {
475
- const c = e[r].target.nodeName;
476
- if (c === "TABLE" || c === "TBODY" || c === "THEAD" || c === "TR") {
477
+ for (let l = 0; l < e.length; l++) {
478
+ const u = e[l].target.nodeName;
479
+ if (u === "TABLE" || u === "TBODY" || u === "THEAD" || u === "TR") {
477
480
  o = !0;
478
481
  break;
479
482
  }
480
483
  }
481
484
  if (!o) return;
482
- const { tableNode: l, tableElement: i } = this.$lookup();
483
- this.table = st(l, i);
485
+ const { tableNode: r, tableElement: i } = this.$lookup();
486
+ this.table = st(r, i);
484
487
  }, { editor: this.editor });
485
488
  });
486
489
  this.editor.getEditorState().read(() => {
@@ -492,11 +495,11 @@ class Qe {
492
495
  const t = this.editor;
493
496
  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();
494
497
  const { tableNode: e, tableElement: o } = this.$lookup();
495
- ut(t, st(e, o), null), B() !== null && (q(null), t.dispatchCommand(tt, void 0));
498
+ ut(t, st(e, o), null), B() !== null && (J(null), t.dispatchCommand(tt, void 0));
496
499
  }
497
500
  $enableHighlightStyle() {
498
501
  const t = this.editor, { tableElement: e } = this.$lookup();
499
- Kt(e, t._config.theme.tableSelection), e.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1;
502
+ Ot(e, t._config.theme.tableSelection), e.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1;
500
503
  }
501
504
  $disableHighlightStyle() {
502
505
  const { tableElement: t } = this.$lookup();
@@ -524,34 +527,34 @@ class Qe {
524
527
  }
525
528
  updateDOMSelection() {
526
529
  if (this.anchorCell !== null && this.focusCell !== null) {
527
- const t = St(this.editor._window);
530
+ const t = bt(this.editor._window);
528
531
  t && t.rangeCount > 0 && t.removeAllRanges();
529
532
  }
530
533
  }
531
534
  $setFocusCellForSelection(t, e = !1) {
532
- const o = this.editor, { tableNode: l } = this.$lookup(), i = t.x, r = t.y;
533
- if (this.focusCell = t, this.isHighlightingCells || this.anchorX === i && this.anchorY === r && !e) {
534
- if (i === this.focusX && r === this.focusY) return !1;
535
+ const o = this.editor, { tableNode: r } = this.$lookup(), i = t.x, l = t.y;
536
+ if (this.focusCell = t, this.isHighlightingCells || this.anchorX === i && this.anchorY === l && !e) {
537
+ if (i === this.focusX && l === this.focusY) return !1;
535
538
  } else this.isHighlightingCells = !0, this.$disableHighlightStyle();
536
- if (this.focusX = i, this.focusY = r, this.isHighlightingCells) {
537
- const c = Rt(l, t.elem);
538
- if (this.tableSelection != null && this.anchorCellNodeKey != null && c !== null) return this.focusCellNodeKey = c.getKey(), this.tableSelection = function(d, f, s) {
539
+ if (this.focusX = i, this.focusY = l, this.isHighlightingCells) {
540
+ const u = Kt(r, t.elem);
541
+ if (this.tableSelection != null && this.anchorCellNodeKey != null && u !== null) return this.focusCellNodeKey = u.getKey(), this.tableSelection = function(d, f, s) {
539
542
  d.getKey(), f.getKey(), s.getKey();
540
- const a = B(), u = R(a) ? a.clone() : Jt();
541
- return u.set(d.getKey(), f.getKey(), s.getKey()), u;
542
- }(l, this.$getAnchorTableCellOrThrow(), c), q(this.tableSelection), o.dispatchCommand(tt, void 0), ut(o, this.table, this.tableSelection), !0;
543
+ const a = B(), c = K(a) ? a.clone() : Ut();
544
+ return c.set(d.getKey(), f.getKey(), s.getKey()), c;
545
+ }(r, this.$getAnchorTableCellOrThrow(), u), J(this.tableSelection), o.dispatchCommand(tt, void 0), ut(o, this.table, this.tableSelection), !0;
543
546
  }
544
547
  return !1;
545
548
  }
546
549
  $getAnchorTableCell() {
547
- return this.anchorCellNodeKey ? ft(this.anchorCellNodeKey) : null;
550
+ return this.anchorCellNodeKey ? mt(this.anchorCellNodeKey) : null;
548
551
  }
549
552
  $getAnchorTableCellOrThrow() {
550
553
  const t = this.$getAnchorTableCell();
551
554
  return t === null && w(234), t;
552
555
  }
553
556
  $getFocusTableCell() {
554
- return this.focusCellNodeKey ? ft(this.focusCellNodeKey) : null;
557
+ return this.focusCellNodeKey ? mt(this.focusCellNodeKey) : null;
555
558
  }
556
559
  $getFocusTableCellOrThrow() {
557
560
  const t = this.$getFocusTableCell();
@@ -559,36 +562,36 @@ class Qe {
559
562
  }
560
563
  $setAnchorCellForSelection(t) {
561
564
  this.isHighlightingCells = !1, this.anchorCell = t, this.anchorX = t.x, this.anchorY = t.y;
562
- const { tableNode: e } = this.$lookup(), o = Rt(e, t.elem);
565
+ const { tableNode: e } = this.$lookup(), o = Kt(e, t.elem);
563
566
  if (o !== null) {
564
- const l = o.getKey();
565
- this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Jt(), this.anchorCellNodeKey = l;
567
+ const r = o.getKey();
568
+ this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Ut(), this.anchorCellNodeKey = r;
566
569
  }
567
570
  }
568
571
  $formatCells(t) {
569
572
  const e = B();
570
- R(e) || w(236);
571
- const o = Re(), l = o.anchor, i = o.focus, r = e.getNodes().filter(S);
572
- r.length > 0 || w(237);
573
- const c = r[0].getFirstChild(), d = oe(c) ? c.getFormatFlags(t, null) : null;
574
- r.forEach((f) => {
575
- l.set(f.getKey(), 0, "element"), i.set(f.getKey(), f.getChildrenSize(), "element"), o.formatText(t, d);
576
- }), q(e), this.editor.dispatchCommand(tt, void 0);
573
+ K(e) || w(236);
574
+ const o = Re(), r = o.anchor, i = o.focus, l = e.getNodes().filter(S);
575
+ l.length > 0 || w(237);
576
+ const u = l[0].getFirstChild(), d = oe(u) ? u.getFormatFlags(t, null) : null;
577
+ l.forEach((f) => {
578
+ r.set(f.getKey(), 0, "element"), i.set(f.getKey(), f.getChildrenSize(), "element"), o.formatText(t, d);
579
+ }), J(e), this.editor.dispatchCommand(tt, void 0);
577
580
  }
578
581
  $clearText() {
579
- const { editor: t } = this, e = ft(this.tableNodeKey);
580
- if (!K(e)) throw new Error("Expected TableNode.");
582
+ const { editor: t } = this, e = mt(this.tableNodeKey);
583
+ if (!O(e)) throw new Error("Expected TableNode.");
581
584
  const o = B();
582
- R(o) || w(11);
583
- const l = o.getNodes().filter(S);
584
- l.length !== this.table.columns * this.table.rows ? (l.forEach((i) => {
585
+ K(o) || w(11);
586
+ const r = o.getNodes().filter(S);
587
+ r.length !== this.table.columns * this.table.rows ? (r.forEach((i) => {
585
588
  if (M(i)) {
586
- const r = et(), c = Mt();
587
- r.append(c), i.append(r), i.getChildren().forEach((d) => {
588
- d !== r && d.remove();
589
+ const l = et(), u = Mt();
590
+ l.append(u), i.append(l), i.getChildren().forEach((d) => {
591
+ d !== l && d.remove();
589
592
  });
590
593
  }
591
- }), ut(t, this.table, null), q(null), t.dispatchCommand(tt, void 0)) : (e.selectPrevious(), e.remove(), Oe().selectStart());
594
+ }), ut(t, this.table, null), J(null), t.dispatchCommand(tt, void 0)) : (e.selectPrevious(), e.remove(), Oe().selectStart());
592
595
  }
593
596
  }
594
597
  const Ft = "__lexicalTableSelection";
@@ -607,105 +610,105 @@ function lt(n, t) {
607
610
  }
608
611
  return null;
609
612
  }
610
- const Ze = [[Ke, "down"], [Ee, "up"], [$e, "backward"], [Me, "forward"]], tn = [Ae, re, Pe], en = [He, Be];
613
+ const Ze = [[Ee, "down"], [$e, "up"], [Me, "backward"], [Ae, "forward"]], tn = [Pe, re, He], en = [Be, Le];
611
614
  function mn(n, t, e, o) {
612
- const l = e.getRootElement(), i = Lt(e);
613
- l !== null && i !== null || w(246);
614
- const r = new Qe(e, n.getKey()), c = nt(n, t);
615
+ const r = e.getRootElement(), i = Lt(e);
616
+ r !== null && i !== null || w(246);
617
+ const l = new Qe(e, n.getKey()), u = nt(n, t);
615
618
  (function(s, a) {
616
619
  Vt(s) !== null && w(205), s[Ft] = a;
617
- })(c, r), r.listenersToRemove.add(() => function(s, a) {
620
+ })(u, l), l.listenersToRemove.add(() => function(s, a) {
618
621
  Vt(s) === a && delete s[Ft];
619
- }(c, r)), c.addEventListener("mousedown", (s) => {
622
+ }(u, l)), u.addEventListener("mousedown", (s) => {
620
623
  if (s.button !== 0 || !i) return;
621
624
  const a = vt(s.target);
622
625
  a !== null && e.update(() => {
623
- const u = Yt();
624
- if (je && s.shiftKey && j(u, n) && (H(u) || R(u))) {
625
- const h = u.anchor.getNode(), g = lt(n, u.anchor.getNode());
626
- g ? (r.$setAnchorCellForSelection(it(r, g)), r.$setFocusCellForSelection(a), U(s)) : (n.isBefore(h) ? n.selectStart() : n.selectEnd()).anchor.set(u.anchor.key, u.anchor.offset, u.anchor.type);
627
- } else r.$setAnchorCellForSelection(a);
626
+ const c = Yt();
627
+ if (je && s.shiftKey && q(c, n) && (H(c) || K(c))) {
628
+ const h = c.anchor.getNode(), g = lt(n, c.anchor.getNode());
629
+ g ? (l.$setAnchorCellForSelection(it(l, g)), l.$setFocusCellForSelection(a), j(s)) : (n.isBefore(h) ? n.selectStart() : n.selectEnd()).anchor.set(c.anchor.key, c.anchor.offset, c.anchor.type);
630
+ } else l.$setAnchorCellForSelection(a);
628
631
  }), (() => {
629
- if (r.isSelecting) return;
630
- const u = () => {
631
- r.isSelecting = !1, i.removeEventListener("mouseup", u), i.removeEventListener("mousemove", h);
632
+ if (l.isSelecting) return;
633
+ const c = () => {
634
+ l.isSelecting = !1, i.removeEventListener("mouseup", c), i.removeEventListener("mousemove", h);
632
635
  }, h = (g) => {
633
- if (1 & ~g.buttons && r.isSelecting) return r.isSelecting = !1, i.removeEventListener("mouseup", u), void i.removeEventListener("mousemove", h);
634
- const p = !c.contains(g.target);
636
+ if (1 & ~g.buttons && l.isSelecting) return l.isSelecting = !1, i.removeEventListener("mouseup", c), void i.removeEventListener("mousemove", h);
637
+ const p = !u.contains(g.target);
635
638
  let m = null;
636
639
  if (p) {
637
- for (const C of document.elementsFromPoint(g.clientX, g.clientY)) if (m = c.contains(C) ? vt(C) : null, m) break;
640
+ for (const C of document.elementsFromPoint(g.clientX, g.clientY)) if (m = u.contains(C) ? vt(C) : null, m) break;
638
641
  } else m = vt(g.target);
639
- !m || r.focusCell !== null && m.elem === r.focusCell.elem || (r.setNextFocus({ focusCell: m, override: p }), e.dispatchCommand(tt, void 0));
642
+ !m || l.focusCell !== null && m.elem === l.focusCell.elem || (l.setNextFocus({ focusCell: m, override: p }), e.dispatchCommand(tt, void 0));
640
643
  };
641
- r.isSelecting = !0, i.addEventListener("mouseup", u, r.listenerOptions), i.addEventListener("mousemove", h, r.listenerOptions);
644
+ l.isSelecting = !0, i.addEventListener("mouseup", c, l.listenerOptions), i.addEventListener("mousemove", h, l.listenerOptions);
642
645
  })();
643
- }, r.listenerOptions), i.addEventListener("mousedown", (s) => {
646
+ }, l.listenerOptions), i.addEventListener("mousedown", (s) => {
644
647
  s.button === 0 && e.update(() => {
645
- const a = B(), u = s.target;
646
- R(a) && a.tableKey === r.tableNodeKey && l.contains(u) && r.$clearHighlight();
648
+ const a = B(), c = s.target;
649
+ K(a) && a.tableKey === l.tableNodeKey && r.contains(c) && l.$clearHighlight();
647
650
  });
648
- }, r.listenerOptions);
649
- for (const [s, a] of Ze) r.listenersToRemove.add(e.registerCommand(s, (u) => ae(e, u, a, n, r), xt));
650
- r.listenersToRemove.add(e.registerCommand(Ce, (s) => {
651
+ }, l.listenerOptions);
652
+ for (const [s, a] of Ze) l.listenersToRemove.add(e.registerCommand(s, (c) => ce(e, c, a, n, l), xt));
653
+ l.listenersToRemove.add(e.registerCommand(Se, (s) => {
651
654
  const a = B();
652
- if (R(a)) {
653
- const u = lt(n, a.focus.getNode());
654
- if (u !== null) return U(s), u.selectEnd(), !0;
655
+ if (K(a)) {
656
+ const c = lt(n, a.focus.getNode());
657
+ if (c !== null) return j(s), c.selectEnd(), !0;
655
658
  }
656
659
  return !1;
657
660
  }, xt));
658
661
  const d = (s) => () => {
659
662
  const a = B();
660
- if (!j(a, n)) return !1;
661
- if (R(a)) return r.$clearText(), !0;
663
+ if (!q(a, n)) return !1;
664
+ if (K(a)) return l.$clearText(), !0;
662
665
  if (H(a)) {
663
666
  if (!S(lt(n, a.anchor.getNode()))) return !1;
664
- const u = a.anchor.getNode(), h = a.focus.getNode(), g = n.isParentOf(u), p = n.isParentOf(h);
665
- if (g && !p || p && !g) return r.$clearText(), !0;
667
+ const c = a.anchor.getNode(), h = a.focus.getNode(), g = n.isParentOf(c), p = n.isParentOf(h);
668
+ if (g && !p || p && !g) return l.$clearText(), !0;
666
669
  const m = y(a.anchor.getNode(), (b) => M(b)), C = m && y(m, (b) => M(b) && S(b.getParent()));
667
670
  if (!M(C) || !M(m)) return !1;
668
671
  if (s === re && C.getPreviousSibling() === null) return !0;
669
672
  }
670
673
  return !1;
671
674
  };
672
- for (const s of tn) r.listenersToRemove.add(e.registerCommand(s, d(s), X));
675
+ for (const s of tn) l.listenersToRemove.add(e.registerCommand(s, d(s), X));
673
676
  const f = (s) => {
674
677
  const a = B();
675
- if (!R(a) && !H(a)) return !1;
676
- const u = n.isParentOf(a.anchor.getNode());
677
- if (u !== n.isParentOf(a.focus.getNode())) {
678
- const h = u ? "anchor" : "focus", g = u ? "focus" : "anchor", { key: p, offset: m, type: C } = a[g];
678
+ if (!K(a) && !H(a)) return !1;
679
+ const c = n.isParentOf(a.anchor.getNode());
680
+ if (c !== n.isParentOf(a.focus.getNode())) {
681
+ const h = c ? "anchor" : "focus", g = c ? "focus" : "anchor", { key: p, offset: m, type: C } = a[g];
679
682
  return n[a[h].isBefore(a[g]) ? "selectPrevious" : "selectNext"]()[g].set(p, m, C), !1;
680
683
  }
681
- return !!R(a) && (s && (s.preventDefault(), s.stopPropagation()), r.$clearText(), !0);
684
+ return !!K(a) && (s && (s.preventDefault(), s.stopPropagation()), l.$clearText(), !0);
682
685
  };
683
- for (const s of en) r.listenersToRemove.add(e.registerCommand(s, f, X));
684
- return r.listenersToRemove.add(e.registerCommand(Se, (s) => {
686
+ for (const s of en) l.listenersToRemove.add(e.registerCommand(s, f, X));
687
+ return l.listenersToRemove.add(e.registerCommand(be, (s) => {
685
688
  const a = B();
686
689
  if (a) {
687
- if (!R(a) && !H(a)) return !1;
688
- Ie(e, ge(s, ClipboardEvent) ? s : null, ze(a));
689
- const u = f(s);
690
- return H(a) ? (a.removeText(), !0) : u;
690
+ if (!K(a) && !H(a)) return !1;
691
+ ze(e, fe(s, ClipboardEvent) ? s : null, Xe(a));
692
+ const c = f(s);
693
+ return H(a) ? (a.removeText(), !0) : c;
691
694
  }
692
695
  return !1;
693
- }, X)), r.listenersToRemove.add(e.registerCommand(be, (s) => {
696
+ }, X)), l.listenersToRemove.add(e.registerCommand(we, (s) => {
694
697
  const a = B();
695
- if (!j(a, n)) return !1;
696
- if (R(a)) return r.$formatCells(s), !0;
698
+ if (!q(a, n)) return !1;
699
+ if (K(a)) return l.$formatCells(s), !0;
697
700
  if (H(a)) {
698
- const u = y(a.anchor.getNode(), (h) => S(h));
699
- if (!S(u)) return !1;
701
+ const c = y(a.anchor.getNode(), (h) => S(h));
702
+ if (!S(c)) return !1;
700
703
  }
701
704
  return !1;
702
- }, X)), r.listenersToRemove.add(e.registerCommand(we, (s) => {
705
+ }, X)), l.listenersToRemove.add(e.registerCommand(_e, (s) => {
703
706
  const a = B();
704
- if (!R(a) || !j(a, n)) return !1;
705
- const u = a.anchor.getNode(), h = a.focus.getNode();
706
- if (!S(u) || !S(h)) return !1;
707
- const [g, p, m] = J(n, u, h), C = Math.max(p.startRow + p.cell.__rowSpan - 1, m.startRow + m.cell.__rowSpan - 1), b = Math.max(p.startColumn + p.cell.__colSpan - 1, m.startColumn + m.cell.__colSpan - 1), O = Math.min(p.startRow, m.startRow), E = Math.min(p.startColumn, m.startColumn), $ = /* @__PURE__ */ new Set();
708
- for (let N = O; N <= C; N++) for (let k = E; k <= b; k++) {
707
+ if (!K(a) || !q(a, n)) return !1;
708
+ const c = a.anchor.getNode(), h = a.focus.getNode();
709
+ if (!S(c) || !S(h)) return !1;
710
+ const [g, p, m] = U(n, c, h), C = Math.max(p.startRow + p.cell.__rowSpan - 1, m.startRow + m.cell.__rowSpan - 1), b = Math.max(p.startColumn + p.cell.__colSpan - 1, m.startColumn + m.cell.__colSpan - 1), R = Math.min(p.startRow, m.startRow), E = Math.min(p.startColumn, m.startColumn), $ = /* @__PURE__ */ new Set();
711
+ for (let N = R; N <= C; N++) for (let k = E; k <= b; k++) {
709
712
  const v = g[N][k].cell;
710
713
  if ($.has(v)) continue;
711
714
  $.add(v), v.setFormat(s);
@@ -716,24 +719,24 @@ function mn(n, t, e, o) {
716
719
  }
717
720
  }
718
721
  return !0;
719
- }, X)), r.listenersToRemove.add(e.registerCommand(_e, (s) => {
722
+ }, X)), l.listenersToRemove.add(e.registerCommand(ye, (s) => {
720
723
  const a = B();
721
- if (!j(a, n)) return !1;
722
- if (R(a)) return r.$clearHighlight(), !1;
724
+ if (!q(a, n)) return !1;
725
+ if (K(a)) return l.$clearHighlight(), !1;
723
726
  if (H(a)) {
724
- const u = y(a.anchor.getNode(), (h) => S(h));
725
- if (!S(u)) return !1;
727
+ const c = y(a.anchor.getNode(), (h) => S(h));
728
+ if (!S(c)) return !1;
726
729
  if (typeof s == "string") {
727
730
  const h = Zt(e, a, n);
728
731
  if (h) return Qt(h, n, [Mt(s)]), !0;
729
732
  }
730
733
  }
731
734
  return !1;
732
- }, X)), o && r.listenersToRemove.add(e.registerCommand(ye, (s) => {
735
+ }, X)), o && l.listenersToRemove.add(e.registerCommand(Ne, (s) => {
733
736
  const a = B();
734
- if (!H(a) || !a.isCollapsed() || !j(a, n)) return !1;
735
- const u = gt(a.anchor.getNode());
736
- return !(u === null || !n.is(mt(u))) && (U(s), function(h, g) {
737
+ if (!H(a) || !a.isCollapsed() || !q(a, n)) return !1;
738
+ const c = gt(a.anchor.getNode());
739
+ return !(c === null || !n.is(pt(c))) && (j(s), function(h, g) {
737
740
  const p = g === "next" ? "getNextSibling" : "getPreviousSibling", m = g === "next" ? "getFirstChild" : "getLastChild", C = h[p]();
738
741
  if (M(C)) return C.selectEnd();
739
742
  const b = y(h, L);
@@ -742,44 +745,44 @@ function mn(n, t, e, o) {
742
745
  const $ = E[m]();
743
746
  if (M($)) return $.selectEnd();
744
747
  }
745
- const O = y(b, K);
746
- O === null && w(248), g === "next" ? O.selectNext() : O.selectPrevious();
747
- }(u, s.shiftKey ? "previous" : "next"), !0);
748
- }, X)), r.listenersToRemove.add(e.registerCommand(Ne, (s) => n.isSelected(), xt)), r.listenersToRemove.add(e.registerCommand(xe, (s) => {
749
- const { nodes: a, selection: u } = s, h = u.getStartEndPoints(), g = R(u), p = H(u) && y(u.anchor.getNode(), (x) => S(x)) !== null && y(u.focus.getNode(), (x) => S(x)) !== null || g;
750
- if (a.length !== 1 || !K(a[0]) || !p || h === null) return !1;
751
- const [m] = h, C = a[0], b = C.getChildren(), O = C.getFirstChildOrThrow().getChildrenSize(), E = C.getChildrenSize(), $ = y(m.getNode(), (x) => S(x)), N = $ && y($, (x) => L(x)), k = N && y(N, (x) => K(x));
752
- if (!S($) || !L(N) || !K(k)) return !1;
753
- const v = N.getIndexWithinParent(), _ = Math.min(k.getChildrenSize() - 1, v + E - 1), T = $.getIndexWithinParent(), F = Math.min(N.getChildrenSize() - 1, T + O - 1), A = Math.min(T, F), P = Math.min(v, _), W = Math.max(T, F), D = Math.max(v, _), z = k.getChildren();
748
+ const R = y(b, O);
749
+ R === null && w(248), g === "next" ? R.selectNext() : R.selectPrevious();
750
+ }(c, s.shiftKey ? "previous" : "next"), !0);
751
+ }, X)), l.listenersToRemove.add(e.registerCommand(xe, (s) => n.isSelected(), xt)), l.listenersToRemove.add(e.registerCommand(ve, (s) => {
752
+ const { nodes: a, selection: c } = s, h = c.getStartEndPoints(), g = K(c), p = H(c) && y(c.anchor.getNode(), (x) => S(x)) !== null && y(c.focus.getNode(), (x) => S(x)) !== null || g;
753
+ if (a.length !== 1 || !O(a[0]) || !p || h === null) return !1;
754
+ const [m] = h, C = a[0], b = C.getChildren(), R = C.getFirstChildOrThrow().getChildrenSize(), E = C.getChildrenSize(), $ = y(m.getNode(), (x) => S(x)), N = $ && y($, (x) => L(x)), k = N && y(N, (x) => O(x));
755
+ if (!S($) || !L(N) || !O(k)) return !1;
756
+ const v = N.getIndexWithinParent(), _ = Math.min(k.getChildrenSize() - 1, v + E - 1), T = $.getIndexWithinParent(), F = Math.min(N.getChildrenSize() - 1, T + R - 1), A = Math.min(T, F), P = Math.min(v, _), D = Math.max(T, F), W = Math.max(v, _), z = k.getChildren();
754
757
  let I = 0;
755
- for (let x = P; x <= D; x++) {
758
+ for (let x = P; x <= W; x++) {
756
759
  const ot = z[x];
757
760
  if (!L(ot)) return !1;
758
761
  const It = b[I];
759
762
  if (!L(It)) return !1;
760
- const ue = ot.getChildren(), he = It.getChildren();
763
+ const he = ot.getChildren(), de = It.getChildren();
761
764
  let zt = 0;
762
- for (let yt = A; yt <= W; yt++) {
763
- const ct = ue[yt];
765
+ for (let Nt = A; Nt <= D; Nt++) {
766
+ const ct = he[Nt];
764
767
  if (!S(ct)) return !1;
765
- const Xt = he[zt];
768
+ const Xt = de[zt];
766
769
  if (!S(Xt)) return !1;
767
- const de = ct.getChildren();
770
+ const ge = ct.getChildren();
768
771
  Xt.getChildren().forEach((Q) => {
769
- pt(Q) && et().append(Q), ct.append(Q);
770
- }), de.forEach((Q) => Q.remove()), zt++;
772
+ Ct(Q) && et().append(Q), ct.append(Q);
773
+ }), ge.forEach((Q) => Q.remove()), zt++;
771
774
  }
772
775
  I++;
773
776
  }
774
777
  return !0;
775
- }, X)), r.listenersToRemove.add(e.registerCommand(tt, () => {
776
- const s = B(), a = Yt(), u = r.getAndClearNextFocus();
777
- if (u !== null) {
778
- const { focusCell: h } = u;
779
- if (R(s) && s.tableKey === r.tableNodeKey) return (h.x !== r.focusX || h.y !== r.focusY) && (r.$setFocusCellForSelection(h), !0);
780
- if (h !== r.anchorCell && j(s, n)) return r.$setFocusCellForSelection(h), !0;
778
+ }, X)), l.listenersToRemove.add(e.registerCommand(tt, () => {
779
+ const s = B(), a = Yt(), c = l.getAndClearNextFocus();
780
+ if (c !== null) {
781
+ const { focusCell: h } = c;
782
+ if (K(s) && s.tableKey === l.tableNodeKey) return (h.x !== l.focusX || h.y !== l.focusY) && (l.$setFocusCellForSelection(h), !0);
783
+ if (h !== l.anchorCell && q(s, n)) return l.$setFocusCellForSelection(h), !0;
781
784
  }
782
- if (r.getAndClearShouldCheckSelection() && H(a) && H(s) && s.isCollapsed()) {
785
+ if (l.getAndClearShouldCheckSelection() && H(a) && H(s) && s.isCollapsed()) {
783
786
  const h = s.anchor.getNode(), g = n.getFirstChild(), p = gt(h);
784
787
  if (p !== null && L(g)) {
785
788
  const m = g.getFirstChild();
@@ -787,40 +790,40 @@ function mn(n, t, e, o) {
787
790
  }
788
791
  }
789
792
  if (H(s)) {
790
- const { anchor: h, focus: g } = s, p = h.getNode(), m = g.getNode(), C = gt(p), b = gt(m), O = !(!C || !n.is(mt(C))), E = !(!b || !n.is(mt(b))), $ = O !== E, N = O && E, k = s.isBackward();
793
+ const { anchor: h, focus: g } = s, p = h.getNode(), m = g.getNode(), C = gt(p), b = gt(m), R = !(!C || !n.is(pt(C))), E = !(!b || !n.is(pt(b))), $ = R !== E, N = R && E, k = s.isBackward();
791
794
  if ($) {
792
795
  const v = s.clone();
793
796
  if (E) {
794
- const [_] = J(n, b, b), T = _[0][0].cell, F = _[_.length - 1].at(-1).cell;
797
+ const [_] = U(n, b, b), T = _[0][0].cell, F = _[_.length - 1].at(-1).cell;
795
798
  v.focus.set(k ? T.getKey() : F.getKey(), k ? T.getChildrenSize() : F.getChildrenSize(), "element");
796
- } else if (O) {
797
- const [_] = J(n, C, C), T = _[0][0].cell, F = _[_.length - 1].at(-1).cell;
799
+ } else if (R) {
800
+ const [_] = U(n, C, C), T = _[0][0].cell, F = _[_.length - 1].at(-1).cell;
798
801
  v.anchor.set(k ? F.getKey() : T.getKey(), k ? F.getChildrenSize() : 0, "element");
799
802
  }
800
- q(v), Gt(e, r);
801
- } else N && (C.is(b) || (r.$setAnchorCellForSelection(it(r, C)), r.$setFocusCellForSelection(it(r, b), !0)));
802
- } else if (s && R(s) && s.is(a) && s.tableKey === n.getKey()) {
803
- const h = St(i);
803
+ J(v), Gt(e, l);
804
+ } else N && (C.is(b) || (l.$setAnchorCellForSelection(it(l, C)), l.$setFocusCellForSelection(it(l, b), !0)));
805
+ } else if (s && K(s) && s.is(a) && s.tableKey === n.getKey()) {
806
+ const h = bt(i);
804
807
  if (h && h.anchorNode && h.focusNode) {
805
808
  const g = G(h.focusNode), p = g && !n.isParentOf(g), m = G(h.anchorNode), C = m && n.isParentOf(m);
806
809
  if (p && C && h.rangeCount > 0) {
807
- const b = ve(h, e);
808
- b && (b.anchor.set(n.getKey(), s.isBackward() ? n.getChildrenSize() : 0, "element"), h.removeAllRanges(), q(b));
810
+ const b = Te(h, e);
811
+ b && (b.anchor.set(n.getKey(), s.isBackward() ? n.getChildrenSize() : 0, "element"), h.removeAllRanges(), J(b));
809
812
  }
810
813
  }
811
814
  }
812
- return s && !s.is(a) && (R(s) || R(a)) && r.tableSelection && !r.tableSelection.is(a) ? (R(s) && s.tableKey === r.tableNodeKey ? r.$updateTableTableSelection(s) : !R(s) && R(a) && a.tableKey === r.tableNodeKey && r.$updateTableTableSelection(null), !1) : (r.hasHijackedSelectionStyles && !n.isSelected() ? function(h, g) {
813
- g.$enableHighlightStyle(), Dt(g.table, (p) => {
815
+ return s && !s.is(a) && (K(s) || K(a)) && l.tableSelection && !l.tableSelection.is(a) ? (K(s) && s.tableKey === l.tableNodeKey ? l.$updateTableTableSelection(s) : !K(s) && K(a) && a.tableKey === l.tableNodeKey && l.$updateTableTableSelection(null), !1) : (l.hasHijackedSelectionStyles && !n.isSelected() ? function(h, g) {
816
+ g.$enableHighlightStyle(), Wt(g.table, (p) => {
814
817
  const m = p.elem;
815
- p.highlighted = !1, ie(h, p), m.getAttribute("style") || m.removeAttribute("style");
818
+ p.highlighted = !1, ae(h, p), m.getAttribute("style") || m.removeAttribute("style");
816
819
  });
817
- }(e, r) : !r.hasHijackedSelectionStyles && n.isSelected() && Gt(e, r), !1);
818
- }, X)), r.listenersToRemove.add(e.registerCommand(Te, () => {
820
+ }(e, l) : !l.hasHijackedSelectionStyles && n.isSelected() && Gt(e, l), !1);
821
+ }, X)), l.listenersToRemove.add(e.registerCommand(ke, () => {
819
822
  const s = B();
820
- if (!H(s) || !s.isCollapsed() || !j(s, n)) return !1;
823
+ if (!H(s) || !s.isCollapsed() || !q(s, n)) return !1;
821
824
  const a = Zt(e, s, n);
822
825
  return !!a && (Qt(a, n), !0);
823
- }, X)), r;
826
+ }, X)), l;
824
827
  }
825
828
  function Vt(n) {
826
829
  return n[Ft] || null;
@@ -839,62 +842,62 @@ function vt(n) {
839
842
  }
840
843
  function st(n, t) {
841
844
  const e = [], o = { columns: 0, domRows: e, rows: 0 };
842
- let l = nt(n, t).querySelector("tr"), i = 0, r = 0;
843
- for (e.length = 0; l != null; ) {
844
- const c = l.nodeName;
845
- if (c === "TD" || c === "TH") {
846
- const s = { elem: l, hasBackgroundColor: l.style.backgroundColor !== "", highlighted: !1, x: i, y: r };
847
- l._cell = s;
848
- let a = e[r];
849
- a === void 0 && (a = e[r] = []), a[i] = s;
845
+ let r = nt(n, t).querySelector("tr"), i = 0, l = 0;
846
+ for (e.length = 0; r != null; ) {
847
+ const u = r.nodeName;
848
+ if (u === "TD" || u === "TH") {
849
+ const s = { elem: r, hasBackgroundColor: r.style.backgroundColor !== "", highlighted: !1, x: i, y: l };
850
+ r._cell = s;
851
+ let a = e[l];
852
+ a === void 0 && (a = e[l] = []), a[i] = s;
850
853
  } else {
851
- const s = l.firstChild;
854
+ const s = r.firstChild;
852
855
  if (s != null) {
853
- l = s;
856
+ r = s;
854
857
  continue;
855
858
  }
856
859
  }
857
- const d = l.nextSibling;
860
+ const d = r.nextSibling;
858
861
  if (d != null) {
859
- i++, l = d;
862
+ i++, r = d;
860
863
  continue;
861
864
  }
862
- const f = l.parentNode;
865
+ const f = r.parentNode;
863
866
  if (f != null) {
864
867
  const s = f.nextSibling;
865
868
  if (s == null) break;
866
- r++, i = 0, l = s;
869
+ l++, i = 0, r = s;
867
870
  }
868
871
  }
869
- return o.columns = i + 1, o.rows = r + 1, o;
872
+ return o.columns = i + 1, o.rows = l + 1, o;
870
873
  }
871
874
  function ut(n, t, e) {
872
875
  const o = new Set(e ? e.getNodes() : []);
873
- Dt(t, (l, i) => {
874
- const r = l.elem;
875
- o.has(i) ? (l.highlighted = !0, se(n, l)) : (l.highlighted = !1, ie(n, l), r.getAttribute("style") || r.removeAttribute("style"));
876
+ Wt(t, (r, i) => {
877
+ const l = r.elem;
878
+ o.has(i) ? (r.highlighted = !0, ie(n, r)) : (r.highlighted = !1, ae(n, r), l.getAttribute("style") || l.removeAttribute("style"));
876
879
  });
877
880
  }
878
- function Dt(n, t) {
881
+ function Wt(n, t) {
879
882
  const { domRows: e } = n;
880
883
  for (let o = 0; o < e.length; o++) {
881
- const l = e[o];
882
- if (l) for (let i = 0; i < l.length; i++) {
883
- const r = l[i];
884
- if (!r) continue;
885
- const c = G(r.elem);
886
- c !== null && t(r, c, { x: i, y: o });
884
+ const r = e[o];
885
+ if (r) for (let i = 0; i < r.length; i++) {
886
+ const l = r[i];
887
+ if (!l) continue;
888
+ const u = G(l.elem);
889
+ u !== null && t(l, u, { x: i, y: o });
887
890
  }
888
891
  }
889
892
  }
890
893
  function Gt(n, t) {
891
- t.$disableHighlightStyle(), Dt(t.table, (e) => {
892
- e.highlighted = !0, se(n, e);
894
+ t.$disableHighlightStyle(), Wt(t.table, (e) => {
895
+ e.highlighted = !0, ie(n, e);
893
896
  });
894
897
  }
895
- const nn = (n, t, e, o, l) => {
896
- const i = l === "forward";
897
- switch (l) {
898
+ const nn = (n, t, e, o, r) => {
899
+ const i = r === "forward";
900
+ switch (r) {
898
901
  case "backward":
899
902
  case "forward":
900
903
  return e !== (i ? n.table.columns - 1 : 0) ? dt(t.getCellNodeFromCordsOrThrow(e + (i ? 1 : -1), o, n.table), i) : o !== (i ? n.table.rows - 1 : 0) ? dt(t.getCellNodeFromCordsOrThrow(i ? 0 : n.table.columns - 1, o + (i ? 1 : -1), n.table), i) : i ? t.selectNext() : t.selectPrevious(), !0;
@@ -924,41 +927,41 @@ function ht([n, t]) {
924
927
  return [n === "minColumn" ? "maxColumn" : "minColumn", t === "minRow" ? "maxRow" : "minRow"];
925
928
  }
926
929
  function Z(n, t, [e, o]) {
927
- const l = t[o], i = n[l];
928
- i === void 0 && w(250, o, String(l));
929
- const r = t[e], c = i[r];
930
- return c === void 0 && w(250, e, String(r)), c;
930
+ const r = t[o], i = n[r];
931
+ i === void 0 && w(250, o, String(r));
932
+ const l = t[e], u = i[l];
933
+ return u === void 0 && w(250, e, String(l)), u;
931
934
  }
932
- function on(n, t, e, o, l) {
933
- const i = kt(t, e, o), r = function(N, k) {
935
+ function on(n, t, e, o, r) {
936
+ const i = kt(t, e, o), l = function(N, k) {
934
937
  const { minColumn: v, maxColumn: _, minRow: T, maxRow: F } = k;
935
- let A = 1, P = 1, W = 1, D = 1;
938
+ let A = 1, P = 1, D = 1, W = 1;
936
939
  const z = N[T], I = N[F];
937
- for (let x = v; x <= _; x++) A = Math.max(A, z[x].cell.__rowSpan), D = Math.max(D, I[x].cell.__rowSpan);
938
- for (let x = T; x <= F; x++) P = Math.max(P, N[x][v].cell.__colSpan), W = Math.max(W, N[x][_].cell.__colSpan);
939
- return { bottomSpan: D, leftSpan: P, rightSpan: W, topSpan: A };
940
- }(t, i), { topSpan: c, leftSpan: d, bottomSpan: f, rightSpan: s } = r, a = function(N, k) {
940
+ for (let x = v; x <= _; x++) A = Math.max(A, z[x].cell.__rowSpan), W = Math.max(W, I[x].cell.__rowSpan);
941
+ for (let x = T; x <= F; x++) P = Math.max(P, N[x][v].cell.__colSpan), D = Math.max(D, N[x][_].cell.__colSpan);
942
+ return { bottomSpan: W, leftSpan: P, rightSpan: D, topSpan: A };
943
+ }(t, i), { topSpan: u, leftSpan: d, bottomSpan: f, rightSpan: s } = l, a = function(N, k) {
941
944
  const v = Tt(N, k);
942
945
  return v === null && w(249, k.cell.getKey()), v;
943
- }(i, e), [u, h] = ht(a);
944
- let g = i[u], p = i[h];
945
- l === "forward" ? g += u === "maxColumn" ? 1 : d : l === "backward" ? g -= u === "minColumn" ? 1 : s : l === "down" ? p += h === "maxRow" ? 1 : c : l === "up" && (p -= h === "minRow" ? 1 : f);
946
+ }(i, e), [c, h] = ht(a);
947
+ let g = i[c], p = i[h];
948
+ r === "forward" ? g += c === "maxColumn" ? 1 : d : r === "backward" ? g -= c === "minColumn" ? 1 : s : r === "down" ? p += h === "maxRow" ? 1 : u : r === "up" && (p -= h === "minRow" ? 1 : f);
946
949
  const m = t[p];
947
950
  if (m === void 0) return !1;
948
951
  const C = m[g];
949
952
  if (C === void 0) return !1;
950
- const [b, O] = function(N, k, v) {
953
+ const [b, R] = function(N, k, v) {
951
954
  const _ = kt(N, k, v), T = Tt(_, k);
952
955
  if (T) return [Z(N, _, T), Z(N, _, ht(T))];
953
956
  const F = Tt(_, v);
954
957
  if (F) return [Z(N, _, ht(F)), Z(N, _, F)];
955
958
  const A = ["minColumn", "minRow"];
956
959
  return [Z(N, _, A), Z(N, _, ht(A))];
957
- }(t, e, C), E = it(n, b.cell), $ = it(n, O.cell);
960
+ }(t, e, C), E = it(n, b.cell), $ = it(n, R.cell);
958
961
  return n.$setAnchorCellForSelection(E), n.$setFocusCellForSelection($, !0), !0;
959
962
  }
960
- function j(n, t) {
961
- if (H(n) || R(n)) {
963
+ function q(n, t) {
964
+ if (H(n) || K(n)) {
962
965
  const e = t.isParentOf(n.anchor.getNode()), o = t.isParentOf(n.focus.getNode());
963
966
  return e && o;
964
967
  }
@@ -967,126 +970,126 @@ function j(n, t) {
967
970
  function dt(n, t) {
968
971
  t ? n.selectStart() : n.selectEnd();
969
972
  }
970
- function se(n, t) {
973
+ function ie(n, t) {
971
974
  const e = t.elem, o = n._config.theme;
972
975
  S(G(e)) || w(131), V(e, o.tableCellSelected);
973
976
  }
974
- function ie(n, t) {
977
+ function ae(n, t) {
975
978
  const e = t.elem;
976
979
  S(G(e)) || w(131);
977
980
  const o = n._config.theme;
978
- Kt(e, o.tableCellSelected);
981
+ Ot(e, o.tableCellSelected);
979
982
  }
980
983
  function gt(n) {
981
984
  const t = y(n, S);
982
985
  return S(t) ? t : null;
983
986
  }
984
- function mt(n) {
985
- const t = y(n, K);
986
- return K(t) ? t : null;
987
+ function pt(n) {
988
+ const t = y(n, O);
989
+ return O(t) ? t : null;
987
990
  }
988
- function ae(n, t, e, o, l) {
989
- if ((e === "up" || e === "down") && function(r) {
990
- const c = r.getRootElement();
991
- return c ? c.hasAttribute("aria-controls") && c.getAttribute("aria-controls") === "typeahead-menu" : !1;
991
+ function ce(n, t, e, o, r) {
992
+ if ((e === "up" || e === "down") && function(l) {
993
+ const u = l.getRootElement();
994
+ return u ? u.hasAttribute("aria-controls") && u.getAttribute("aria-controls") === "typeahead-menu" : !1;
992
995
  }(n)) return !1;
993
996
  const i = B();
994
- if (!j(i, o)) {
997
+ if (!q(i, o)) {
995
998
  if (H(i)) {
996
999
  if (e === "backward") {
997
1000
  if (i.focus.offset > 0) return !1;
998
- const r = function(d) {
1001
+ const l = function(d) {
999
1002
  for (let f = d, s = d; s !== null; f = s, s = s.getParent()) if (M(s)) {
1000
1003
  if (s !== f && s.getFirstChild() !== f) return null;
1001
1004
  if (!s.isInline()) return s;
1002
1005
  }
1003
1006
  return null;
1004
1007
  }(i.focus.getNode());
1005
- if (!r) return !1;
1006
- const c = r.getPreviousSibling();
1007
- return !!K(c) && (U(t), t.shiftKey ? i.focus.set(c.getParentOrThrow().getKey(), c.getIndexWithinParent(), "element") : c.selectEnd(), !0);
1008
+ if (!l) return !1;
1009
+ const u = l.getPreviousSibling();
1010
+ return !!O(u) && (j(t), t.shiftKey ? i.focus.set(u.getParentOrThrow().getKey(), u.getIndexWithinParent(), "element") : u.selectEnd(), !0);
1008
1011
  }
1009
1012
  if (t.shiftKey && (e === "up" || e === "down")) {
1010
- const r = i.focus.getNode();
1013
+ const l = i.focus.getNode();
1011
1014
  if (!i.isCollapsed() && (e === "up" && !i.isBackward() || e === "down" && i.isBackward())) {
1012
- let c = y(r, (u) => K(u));
1013
- if (S(c) && (c = y(c, K)), c !== o || !c) return !1;
1014
- const d = e === "down" ? c.getNextSibling() : c.getPreviousSibling();
1015
+ let u = y(l, (c) => O(c));
1016
+ if (S(u) && (u = y(u, O)), u !== o || !u) return !1;
1017
+ const d = e === "down" ? u.getNextSibling() : u.getPreviousSibling();
1015
1018
  if (!d) return !1;
1016
1019
  let f = 0;
1017
1020
  e === "up" && M(d) && (f = d.getChildrenSize());
1018
1021
  let s = d;
1019
- e === "up" && M(d) && (s = d.getLastChild() || d, f = pt(s) ? s.getTextContentSize() : 0);
1022
+ e === "up" && M(d) && (s = d.getLastChild() || d, f = Ct(s) ? s.getTextContentSize() : 0);
1020
1023
  const a = i.clone();
1021
- return a.focus.set(s.getKey(), f, pt(s) ? "text" : "element"), q(a), U(t), !0;
1024
+ return a.focus.set(s.getKey(), f, Ct(s) ? "text" : "element"), J(a), j(t), !0;
1022
1025
  }
1023
- if (ke(r)) {
1024
- const c = e === "up" ? i.getNodes()[i.getNodes().length - 1] : i.getNodes()[0];
1025
- if (c && lt(o, c) !== null) {
1026
+ if (Fe(l)) {
1027
+ const u = e === "up" ? i.getNodes()[i.getNodes().length - 1] : i.getNodes()[0];
1028
+ if (u && lt(o, u) !== null) {
1026
1029
  const d = o.getFirstDescendant(), f = o.getLastDescendant();
1027
1030
  if (!d || !f) return !1;
1028
- const [s] = rt(d), [a] = rt(f), u = o.getCordsFromCellNode(s, l.table), h = o.getCordsFromCellNode(a, l.table), g = o.getDOMCellFromCordsOrThrow(u.x, u.y, l.table), p = o.getDOMCellFromCordsOrThrow(h.x, h.y, l.table);
1029
- return l.$setAnchorCellForSelection(g), l.$setFocusCellForSelection(p, !0), !0;
1031
+ const [s] = rt(d), [a] = rt(f), c = o.getCordsFromCellNode(s, r.table), h = o.getCordsFromCellNode(a, r.table), g = o.getDOMCellFromCordsOrThrow(c.x, c.y, r.table), p = o.getDOMCellFromCordsOrThrow(h.x, h.y, r.table);
1032
+ return r.$setAnchorCellForSelection(g), r.$setFocusCellForSelection(p, !0), !0;
1030
1033
  }
1031
1034
  return !1;
1032
1035
  }
1033
1036
  {
1034
- let c = y(r, (f) => M(f) && !f.isInline());
1035
- if (S(c) && (c = y(c, K)), !c) return !1;
1036
- const d = e === "down" ? c.getNextSibling() : c.getPreviousSibling();
1037
- if (K(d) && l.tableNodeKey === d.getKey()) {
1037
+ let u = y(l, (f) => M(f) && !f.isInline());
1038
+ if (S(u) && (u = y(u, O)), !u) return !1;
1039
+ const d = e === "down" ? u.getNextSibling() : u.getPreviousSibling();
1040
+ if (O(d) && r.tableNodeKey === d.getKey()) {
1038
1041
  const f = d.getFirstDescendant(), s = d.getLastDescendant();
1039
1042
  if (!f || !s) return !1;
1040
- const [a] = rt(f), [u] = rt(s), h = i.clone();
1041
- return h.focus.set((e === "up" ? a : u).getKey(), e === "up" ? 0 : u.getChildrenSize(), "element"), U(t), q(h), !0;
1043
+ const [a] = rt(f), [c] = rt(s), h = i.clone();
1044
+ return h.focus.set((e === "up" ? a : c).getKey(), e === "up" ? 0 : c.getChildrenSize(), "element"), j(t), J(h), !0;
1042
1045
  }
1043
1046
  }
1044
1047
  }
1045
1048
  }
1046
- return e === "down" && ce(n) && l.setShouldCheckSelection(), !1;
1049
+ return e === "down" && ue(n) && r.setShouldCheckSelection(), !1;
1047
1050
  }
1048
1051
  if (H(i) && i.isCollapsed()) {
1049
- const { anchor: r, focus: c } = i, d = y(r.getNode(), S), f = y(c.getNode(), S);
1052
+ const { anchor: l, focus: u } = i, d = y(l.getNode(), S), f = y(u.getNode(), S);
1050
1053
  if (!S(d) || !d.is(f)) return !1;
1051
- const s = mt(d);
1054
+ const s = pt(d);
1052
1055
  if (s !== o && s != null) {
1053
1056
  const C = nt(s, n.getElementByKey(s.getKey()));
1054
- if (C != null) return l.table = st(s, C), ae(n, t, e, s, l);
1057
+ if (C != null) return r.table = st(s, C), ce(n, t, e, s, r);
1055
1058
  }
1056
1059
  if (e === "backward" || e === "forward") {
1057
- const C = r.type, b = r.offset, O = r.getNode();
1058
- if (!O) return !1;
1060
+ const C = l.type, b = l.offset, R = l.getNode();
1061
+ if (!R) return !1;
1059
1062
  const E = i.getNodes();
1060
- return (E.length !== 1 || !Fe(E[0])) && !!function($, N, k, v) {
1063
+ return (E.length !== 1 || !Ke(E[0])) && !!function($, N, k, v) {
1061
1064
  return function(_, T, F) {
1062
1065
  return _ === "element" && (F === "backward" ? T.getPreviousSibling() === null : T.getNextSibling() === null);
1063
1066
  }($, k, v) || function(_, T, F, A) {
1064
- const P = y(F, (D) => M(D) && !D.isInline());
1067
+ const P = y(F, (W) => M(W) && !W.isInline());
1065
1068
  if (!P) return !1;
1066
- const W = A === "backward" ? T === 0 : T === F.getTextContentSize();
1067
- return _ === "text" && W && (A === "backward" ? P.getPreviousSibling() === null : P.getNextSibling() === null);
1069
+ const D = A === "backward" ? T === 0 : T === F.getTextContentSize();
1070
+ return _ === "text" && D && (A === "backward" ? P.getPreviousSibling() === null : P.getNextSibling() === null);
1068
1071
  }($, N, k, v);
1069
- }(C, b, O, e) && function($, N, k, v, _) {
1070
- const [T, F] = J(v, k, k);
1071
- if (!function(P, W, D) {
1072
- const z = P[0][0], I = P[P.length - 1][P[0].length - 1], { startColumn: x, startRow: ot } = W;
1073
- return D === "backward" ? x === z.startColumn && ot === z.startRow : x === I.startColumn && ot === I.startRow;
1072
+ }(C, b, R, e) && function($, N, k, v, _) {
1073
+ const [T, F] = U(v, k, k);
1074
+ if (!function(P, D, W) {
1075
+ const z = P[0][0], I = P[P.length - 1][P[0].length - 1], { startColumn: x, startRow: ot } = D;
1076
+ return W === "backward" ? x === z.startColumn && ot === z.startRow : x === I.startColumn && ot === I.startRow;
1074
1077
  }(T, F, _)) return !1;
1075
- const A = function(P, W, D) {
1078
+ const A = function(P, D, W) {
1076
1079
  const z = y(P, (x) => M(x) && !x.isInline());
1077
1080
  if (!z) return;
1078
- const I = W === "backward" ? z.getPreviousSibling() : z.getNextSibling();
1079
- return I && K(I) ? I : W === "backward" ? D.getPreviousSibling() : D.getNextSibling();
1081
+ const I = D === "backward" ? z.getPreviousSibling() : z.getNextSibling();
1082
+ return I && O(I) ? I : D === "backward" ? W.getPreviousSibling() : W.getNextSibling();
1080
1083
  }(N, _, v);
1081
- return !A || K(A) ? !1 : (U($), _ === "backward" ? A.selectEnd() : A.selectStart(), !0);
1082
- }(t, O, d, o, e);
1084
+ return !A || O(A) ? !1 : (j($), _ === "backward" ? A.selectEnd() : A.selectStart(), !0);
1085
+ }(t, R, d, o, e);
1083
1086
  }
1084
- const a = n.getElementByKey(d.__key), u = n.getElementByKey(r.key);
1085
- if (u == null || a == null) return !1;
1087
+ const a = n.getElementByKey(d.__key), c = n.getElementByKey(l.key);
1088
+ if (c == null || a == null) return !1;
1086
1089
  let h;
1087
- if (r.type === "element") h = u.getBoundingClientRect();
1090
+ if (l.type === "element") h = c.getBoundingClientRect();
1088
1091
  else {
1089
- const C = St(Lt(n));
1092
+ const C = bt(Lt(n));
1090
1093
  if (C === null || C.rangeCount === 0) return !1;
1091
1094
  h = C.getRangeAt(0).getBoundingClientRect();
1092
1095
  }
@@ -1096,31 +1099,31 @@ function ae(n, t, e, o, l) {
1096
1099
  if (p == null) return !1;
1097
1100
  const m = p.getBoundingClientRect();
1098
1101
  if (e === "up" ? m.top > h.top - h.height : h.bottom + h.height > m.bottom) {
1099
- U(t);
1100
- const C = o.getCordsFromCellNode(d, l.table);
1101
- if (!t.shiftKey) return nn(l, o, C.x, C.y, e);
1102
+ j(t);
1103
+ const C = o.getCordsFromCellNode(d, r.table);
1104
+ if (!t.shiftKey) return nn(r, o, C.x, C.y, e);
1102
1105
  {
1103
- const b = o.getDOMCellFromCordsOrThrow(C.x, C.y, l.table);
1104
- l.$setAnchorCellForSelection(b), l.$setFocusCellForSelection(b, !0);
1106
+ const b = o.getDOMCellFromCordsOrThrow(C.x, C.y, r.table);
1107
+ r.$setAnchorCellForSelection(b), r.$setFocusCellForSelection(b, !0);
1105
1108
  }
1106
1109
  return !0;
1107
1110
  }
1108
- } else if (R(i)) {
1109
- const { anchor: r, focus: c } = i, d = y(r.getNode(), S), f = y(c.getNode(), S), [s] = i.getNodes();
1110
- K(s) || w(251);
1111
+ } else if (K(i)) {
1112
+ const { anchor: l, focus: u } = i, d = y(l.getNode(), S), f = y(u.getNode(), S), [s] = i.getNodes();
1113
+ O(s) || w(251);
1111
1114
  const a = nt(s, n.getElementByKey(s.getKey()));
1112
- if (!S(d) || !S(f) || !K(s) || a == null) return !1;
1113
- l.$updateTableTableSelection(i);
1114
- const u = st(s, a), h = o.getCordsFromCellNode(d, u), g = o.getDOMCellFromCordsOrThrow(h.x, h.y, u);
1115
- if (l.$setAnchorCellForSelection(g), U(t), t.shiftKey) {
1116
- const [p, m, C] = J(o, d, f);
1117
- return on(l, p, m, C, e);
1115
+ if (!S(d) || !S(f) || !O(s) || a == null) return !1;
1116
+ r.$updateTableTableSelection(i);
1117
+ const c = st(s, a), h = o.getCordsFromCellNode(d, c), g = o.getDOMCellFromCordsOrThrow(h.x, h.y, c);
1118
+ if (r.$setAnchorCellForSelection(g), j(t), t.shiftKey) {
1119
+ const [p, m, C] = U(o, d, f);
1120
+ return on(r, p, m, C, e);
1118
1121
  }
1119
1122
  return f.selectEnd(), !0;
1120
1123
  }
1121
1124
  return !1;
1122
1125
  }
1123
- function U(n) {
1126
+ function j(n) {
1124
1127
  n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
1125
1128
  }
1126
1129
  function Qt(n, t, e) {
@@ -1130,45 +1133,45 @@ function Qt(n, t, e) {
1130
1133
  function Zt(n, t, e) {
1131
1134
  const o = e.getParent();
1132
1135
  if (!o) return;
1133
- const l = St(Lt(n));
1134
- if (!l) return;
1135
- const i = l.anchorNode, r = n.getElementByKey(o.getKey()), c = nt(e, n.getElementByKey(e.getKey()));
1136
- if (!i || !r || !c || !r.contains(i) || c.contains(i)) return;
1136
+ const r = bt(Lt(n));
1137
+ if (!r) return;
1138
+ const i = r.anchorNode, l = n.getElementByKey(o.getKey()), u = nt(e, n.getElementByKey(e.getKey()));
1139
+ if (!i || !l || !u || !l.contains(i) || u.contains(i)) return;
1137
1140
  const d = y(t.anchor.getNode(), (b) => S(b));
1138
1141
  if (!d) return;
1139
- const f = y(d, (b) => K(b));
1140
- if (!K(f) || !f.is(e)) return;
1141
- const [s, a] = J(e, d, d), u = s[0][0], h = s[s.length - 1][s[0].length - 1], { startRow: g, startColumn: p } = a, m = g === u.startRow && p === u.startColumn, C = g === h.startRow && p === h.startColumn;
1142
+ const f = y(d, (b) => O(b));
1143
+ if (!O(f) || !f.is(e)) return;
1144
+ const [s, a] = U(e, d, d), c = s[0][0], h = s[s.length - 1][s[0].length - 1], { startRow: g, startColumn: p } = a, m = g === c.startRow && p === c.startColumn, C = g === h.startRow && p === h.startColumn;
1142
1145
  return m ? "first" : C ? "last" : void 0;
1143
1146
  }
1144
1147
  function it(n, t) {
1145
1148
  const { tableNode: e } = n.$lookup(), o = e.getCordsFromCellNode(t, n.table);
1146
1149
  return e.getDOMCellFromCordsOrThrow(o.x, o.y, n.table);
1147
1150
  }
1148
- function Rt(n, t, e) {
1151
+ function Kt(n, t, e) {
1149
1152
  return lt(n, G(t, e));
1150
1153
  }
1151
1154
  function te(n, t, e, o) {
1152
- const l = n.querySelector("colgroup");
1153
- if (!l) return;
1155
+ const r = n.querySelector("colgroup");
1156
+ if (!r) return;
1154
1157
  const i = [];
1155
- for (let r = 0; r < e; r++) {
1156
- const c = document.createElement("col"), d = o && o[r];
1157
- d && (c.style.width = `${d}px`), i.push(c);
1158
+ for (let l = 0; l < e; l++) {
1159
+ const u = document.createElement("col"), d = o && o[l];
1160
+ d && (u.style.width = `${d}px`), i.push(u);
1158
1161
  }
1159
- l.replaceChildren(...i);
1162
+ r.replaceChildren(...i);
1160
1163
  }
1161
1164
  function ee(n, t, e) {
1162
- e ? (V(n, t.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (Kt(n, t.theme.tableRowStriping), n.removeAttribute("data-lexical-row-striping"));
1165
+ e ? (V(n, t.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (Ot(n, t.theme.tableRowStriping), n.removeAttribute("data-lexical-row-striping"));
1163
1166
  }
1164
- const Ot = /* @__PURE__ */ new WeakSet();
1165
- function ce(n = ne()) {
1166
- return Ot.has(n);
1167
+ const Rt = /* @__PURE__ */ new WeakSet();
1168
+ function ue(n = ne()) {
1169
+ return Rt.has(n);
1167
1170
  }
1168
1171
  function pn(n, t) {
1169
- t ? Ot.add(n) : Ot.delete(n);
1172
+ t ? Rt.add(n) : Rt.delete(n);
1170
1173
  }
1171
- class _t extends Et {
1174
+ class yt extends Et {
1172
1175
  static getType() {
1173
1176
  return "table";
1174
1177
  }
@@ -1180,7 +1183,7 @@ class _t extends Et {
1180
1183
  return e.__colWidths = t, e;
1181
1184
  }
1182
1185
  static clone(t) {
1183
- return new _t(t.__key);
1186
+ return new yt(t.__key);
1184
1187
  }
1185
1188
  afterCloneFrom(t) {
1186
1189
  super.afterCloneFrom(t), this.__colWidths = t.__colWidths, this.__rowStriping = t.__rowStriping;
@@ -1189,7 +1192,7 @@ class _t extends Et {
1189
1192
  return { table: (t) => ({ conversion: rn, priority: 1 }) };
1190
1193
  }
1191
1194
  static importJSON(t) {
1192
- const e = Wt();
1195
+ const e = Dt();
1193
1196
  return e.__rowStriping = t.rowStriping || !1, e.__colWidths = t.colWidths, e;
1194
1197
  }
1195
1198
  constructor(t) {
@@ -1198,15 +1201,18 @@ class _t extends Et {
1198
1201
  exportJSON() {
1199
1202
  return { ...super.exportJSON(), colWidths: this.getColWidths(), rowStriping: this.__rowStriping ? this.__rowStriping : void 0, type: "table", version: 1 };
1200
1203
  }
1204
+ extractWithChild(t, e, o) {
1205
+ return o === "html";
1206
+ }
1201
1207
  getDOMSlot(t) {
1202
1208
  const e = t.nodeName !== "TABLE" && t.querySelector("table") || t;
1203
1209
  return e.nodeName !== "TABLE" && w(229), super.getDOMSlot(e).withAfter(e.querySelector("colgroup"));
1204
1210
  }
1205
1211
  createDOM(t, e) {
1206
- const o = document.createElement("table"), l = document.createElement("colgroup");
1207
- if (o.appendChild(l), te(o, 0, this.getColumnCount(), this.getColWidths()), me(l), V(o, t.theme.table), this.__rowStriping && ee(o, t, !0), ce(e)) {
1208
- const i = document.createElement("div"), r = t.theme.tableScrollableWrapper;
1209
- return r ? V(i, r) : i.style.cssText = "overflow-x: auto;", i.appendChild(o), i;
1212
+ const o = document.createElement("table"), r = document.createElement("colgroup");
1213
+ if (o.appendChild(r), te(o, 0, this.getColumnCount(), this.getColWidths()), pe(r), V(o, t.theme.table), this.__rowStriping && ee(o, t, !0), ue(e)) {
1214
+ const i = document.createElement("div"), l = t.theme.tableScrollableWrapper;
1215
+ return l ? V(i, l) : i.style.cssText = "overflow-x: auto;", i.appendChild(o), i;
1210
1216
  }
1211
1217
  return o;
1212
1218
  }
@@ -1214,16 +1220,38 @@ class _t extends Et {
1214
1220
  return t.__rowStriping !== this.__rowStriping && ee(e, o, this.__rowStriping), te(e, 0, this.getColumnCount(), this.getColWidths()), !1;
1215
1221
  }
1216
1222
  exportDOM(t) {
1217
- const { element: e, after: o } = super.exportDOM(t);
1218
- return { after: (l) => {
1219
- if (o && (l = o(l)), l && Nt(l) && l.nodeName !== "TABLE" && (l = l.querySelector("table")), !l || !Nt(l)) return null;
1220
- const i = l.querySelectorAll(":scope > tr");
1221
- if (i.length > 0) {
1222
- const r = document.createElement("tbody");
1223
- r.append(...i), l.append(r);
1223
+ const e = super.exportDOM(t), { element: o } = e;
1224
+ return { after: (r) => {
1225
+ if (e.after && (r = e.after(r)), r && ft(r) && r.nodeName !== "TABLE" && (r = r.querySelector("table")), !r || !ft(r)) return null;
1226
+ const [i] = se(this, null, null), l = /* @__PURE__ */ new Map();
1227
+ for (const s of i) for (const a of s) {
1228
+ const c = a.cell.getKey();
1229
+ l.has(c) || l.set(c, { colSpan: a.cell.getColSpan(), startColumn: a.startColumn });
1230
+ }
1231
+ const u = /* @__PURE__ */ new Set();
1232
+ for (const s of r.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")) {
1233
+ const a = s.getAttribute("data-temporary-table-cell-lexical-key");
1234
+ if (a) {
1235
+ const c = l.get(a);
1236
+ if (s.removeAttribute("data-temporary-table-cell-lexical-key"), c) {
1237
+ l.delete(a);
1238
+ for (let h = 0; h < c.colSpan; h++) u.add(h + c.startColumn);
1239
+ }
1240
+ }
1241
+ }
1242
+ const d = r.querySelector(":scope > colgroup");
1243
+ if (d) {
1244
+ const s = Array.from(r.querySelectorAll(":scope > colgroup > col")).filter((a, c) => u.has(c));
1245
+ d.replaceChildren(...s);
1246
+ }
1247
+ const f = r.querySelectorAll(":scope > tr");
1248
+ if (f.length > 0) {
1249
+ const s = document.createElement("tbody");
1250
+ for (const a of f) s.appendChild(a);
1251
+ r.append(s);
1224
1252
  }
1225
- return l;
1226
- }, element: e && Nt(e) && e.nodeName !== "TABLE" ? e.querySelector("table") : e };
1253
+ return r;
1254
+ }, element: o && ft(o) && o.nodeName !== "TABLE" ? o.querySelector("table") : o };
1227
1255
  }
1228
1256
  canBeEmpty() {
1229
1257
  return !1;
@@ -1232,39 +1260,39 @@ class _t extends Et {
1232
1260
  return !0;
1233
1261
  }
1234
1262
  getCordsFromCellNode(t, e) {
1235
- const { rows: o, domRows: l } = e;
1263
+ const { rows: o, domRows: r } = e;
1236
1264
  for (let i = 0; i < o; i++) {
1237
- const r = l[i];
1238
- if (r != null) for (let c = 0; c < r.length; c++) {
1239
- const d = r[c];
1265
+ const l = r[i];
1266
+ if (l != null) for (let u = 0; u < l.length; u++) {
1267
+ const d = l[u];
1240
1268
  if (d == null) continue;
1241
- const { elem: f } = d, s = Rt(this, f);
1242
- if (s !== null && t.is(s)) return { x: c, y: i };
1269
+ const { elem: f } = d, s = Kt(this, f);
1270
+ if (s !== null && t.is(s)) return { x: u, y: i };
1243
1271
  }
1244
1272
  }
1245
1273
  throw new Error("Cell not found in table.");
1246
1274
  }
1247
1275
  getDOMCellFromCords(t, e, o) {
1248
- const { domRows: l } = o, i = l[e];
1276
+ const { domRows: r } = o, i = r[e];
1249
1277
  if (i == null) return null;
1250
- const r = i[t < i.length ? t : i.length - 1];
1251
- return r ?? null;
1278
+ const l = i[t < i.length ? t : i.length - 1];
1279
+ return l ?? null;
1252
1280
  }
1253
1281
  getDOMCellFromCordsOrThrow(t, e, o) {
1254
- const l = this.getDOMCellFromCords(t, e, o);
1255
- if (!l) throw new Error("Cell not found at cords.");
1256
- return l;
1282
+ const r = this.getDOMCellFromCords(t, e, o);
1283
+ if (!r) throw new Error("Cell not found at cords.");
1284
+ return r;
1257
1285
  }
1258
1286
  getCellNodeFromCords(t, e, o) {
1259
- const l = this.getDOMCellFromCords(t, e, o);
1260
- if (l == null) return null;
1261
- const i = G(l.elem);
1287
+ const r = this.getDOMCellFromCords(t, e, o);
1288
+ if (r == null) return null;
1289
+ const i = G(r.elem);
1262
1290
  return S(i) ? i : null;
1263
1291
  }
1264
1292
  getCellNodeFromCordsOrThrow(t, e, o) {
1265
- const l = this.getCellNodeFromCords(t, e, o);
1266
- if (!l) throw new Error("Node at cords not TableCellNode.");
1267
- return l;
1293
+ const r = this.getCellNodeFromCords(t, e, o);
1294
+ if (!r) throw new Error("Node at cords not TableCellNode.");
1295
+ return r;
1268
1296
  }
1269
1297
  getRowStriping() {
1270
1298
  return !!this.getLatest().__rowStriping;
@@ -1288,13 +1316,13 @@ class _t extends Et {
1288
1316
  }
1289
1317
  }
1290
1318
  function rn(n) {
1291
- const t = Wt();
1319
+ const t = Dt();
1292
1320
  n.hasAttribute("data-lexical-row-striping") && t.setRowStriping(!0);
1293
1321
  const e = n.querySelector(":scope > colgroup");
1294
1322
  if (e) {
1295
1323
  let o = [];
1296
- for (const l of e.querySelectorAll(":scope > col")) {
1297
- const i = l.style.width;
1324
+ for (const r of e.querySelectorAll(":scope > col")) {
1325
+ const i = r.style.width;
1298
1326
  if (!i || !At.test(i)) {
1299
1327
  o = void 0;
1300
1328
  break;
@@ -1305,34 +1333,34 @@ function rn(n) {
1305
1333
  }
1306
1334
  return { node: t };
1307
1335
  }
1308
- function Wt() {
1309
- return $t(new _t());
1336
+ function Dt() {
1337
+ return $t(new yt());
1310
1338
  }
1311
- function K(n) {
1312
- return n instanceof _t;
1339
+ function O(n) {
1340
+ return n instanceof yt;
1313
1341
  }
1314
1342
  export {
1315
- Je as B,
1316
- un as C,
1317
- pn as F,
1318
- rt as H,
1319
- J as P,
1320
- hn as S,
1343
+ rt as B,
1344
+ L as C,
1345
+ U as H,
1346
+ yt as K,
1347
+ gn as N,
1348
+ se as P,
1349
+ un as S,
1350
+ nt as V,
1321
1351
  Ge as X,
1322
- le as _,
1352
+ hn as _,
1323
1353
  fn as a,
1324
- dn as b,
1325
- bt as g,
1326
- cn as i,
1327
- nt as j,
1328
- _t as k,
1329
- Pt as l,
1330
- Bt as m,
1331
- at as o,
1332
- L as p,
1333
- S as s,
1334
- mn as t,
1335
- qe as w,
1336
- gn as y
1354
+ Ue as b,
1355
+ cn as c,
1356
+ wt as f,
1357
+ S as i,
1358
+ pn as k,
1359
+ mn as n,
1360
+ Bt as p,
1361
+ at as r,
1362
+ Pt as s,
1363
+ le as w,
1364
+ dn as y
1337
1365
  };
1338
- //# sourceMappingURL=LexicalTable.prod-hx6rW3fc.js.map
1366
+ //# sourceMappingURL=LexicalTable.prod-D-4NN9o5.js.map