@mxmweb/rtext 1.2.8 → 1.2.9

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.
package/index.js CHANGED
@@ -71,10 +71,10 @@ function ic() {
71
71
  De.unshift("Warning: " + y), Function.prototype.apply.call(console[m], console, De);
72
72
  }
73
73
  }
74
- var w = !1, T = !1, S = !1, A = !1, z = !1, K;
74
+ var w = !1, T = !1, S = !1, A = !1, I = !1, K;
75
75
  K = Symbol.for("react.module.reference");
76
76
  function G(m) {
77
- return !!(typeof m == "string" || typeof m == "function" || m === n || m === i || z || m === a || m === u || m === f || A || m === g || w || T || S || typeof m == "object" && m !== null && (m.$$typeof === p || m.$$typeof === h || m.$$typeof === s || m.$$typeof === o || m.$$typeof === l || // This needs to include all possible module reference object
77
+ return !!(typeof m == "string" || typeof m == "function" || m === n || m === i || I || m === a || m === u || m === f || A || m === g || w || T || S || typeof m == "object" && m !== null && (m.$$typeof === p || m.$$typeof === h || m.$$typeof === s || m.$$typeof === o || m.$$typeof === l || // This needs to include all possible module reference object
78
78
  // types supported by any Flight configuration anywhere since
79
79
  // we don't know which Flight build this will end up being used
80
80
  // with.
@@ -87,10 +87,10 @@ function ic() {
87
87
  var ue = y.displayName || y.name || "";
88
88
  return ue !== "" ? j + "(" + ue + ")" : j;
89
89
  }
90
- function N(m) {
90
+ function M(m) {
91
91
  return m.displayName || "Context";
92
92
  }
93
- function I(m) {
93
+ function z(m) {
94
94
  if (m == null)
95
95
  return null;
96
96
  if (typeof m.tag == "number" && B("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof m == "function")
@@ -115,19 +115,19 @@ function ic() {
115
115
  switch (m.$$typeof) {
116
116
  case o:
117
117
  var y = m;
118
- return N(y) + ".Consumer";
118
+ return M(y) + ".Consumer";
119
119
  case s:
120
120
  var j = m;
121
- return N(j._context) + ".Provider";
121
+ return M(j._context) + ".Provider";
122
122
  case l:
123
123
  return L(m, m.render, "ForwardRef");
124
124
  case h:
125
125
  var X = m.displayName || null;
126
- return X !== null ? X : I(m.type) || "Memo";
126
+ return X !== null ? X : z(m.type) || "Memo";
127
127
  case p: {
128
128
  var ue = m, De = ue._payload, re = ue._init;
129
129
  try {
130
- return I(re(De));
130
+ return z(re(De));
131
131
  } catch {
132
132
  return null;
133
133
  }
@@ -323,7 +323,7 @@ function ic() {
323
323
  }
324
324
  return "";
325
325
  }
326
- var Fe = Object.prototype.hasOwnProperty, Be = {}, Ae = E.ReactDebugCurrentFrame;
326
+ var Fe = Object.prototype.hasOwnProperty, Ee = {}, Ae = E.ReactDebugCurrentFrame;
327
327
  function je(m) {
328
328
  if (m) {
329
329
  var y = m._owner, j = Ce(m.type, m._source, y ? y.type : null);
@@ -346,7 +346,7 @@ function ic() {
346
346
  } catch (ze) {
347
347
  ye = ze;
348
348
  }
349
- ye && !(ye instanceof Error) && (je(ue), B("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", X || "React class", j, re, typeof ye), je(null)), ye instanceof Error && !(ye.message in Be) && (Be[ye.message] = !0, je(ue), B("Failed %s type: %s", j, ye.message), je(null));
349
+ ye && !(ye instanceof Error) && (je(ue), B("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", X || "React class", j, re, typeof ye), je(null)), ye instanceof Error && !(ye.message in Ee) && (Ee[ye.message] = !0, je(ue), B("Failed %s type: %s", j, ye.message), je(null));
350
350
  }
351
351
  }
352
352
  }
@@ -484,7 +484,7 @@ function ic() {
484
484
  function Wr() {
485
485
  {
486
486
  if (Ft.current) {
487
- var m = I(Ft.current.type);
487
+ var m = z(Ft.current.type);
488
488
  if (m)
489
489
  return `
490
490
 
@@ -519,7 +519,7 @@ Check the top-level render call using <` + j + ">.");
519
519
  return;
520
520
  br[j] = !0;
521
521
  var X = "";
522
- m && m._owner && m._owner !== Ft.current && (X = " It was passed a child from " + I(m._owner.type) + "."), ft(m), B('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', j, X), ft(null);
522
+ m && m._owner && m._owner !== Ft.current && (X = " It was passed a child from " + z(m._owner.type) + "."), ft(m), B('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', j, X), ft(null);
523
523
  }
524
524
  }
525
525
  function vn(m, y) {
@@ -541,7 +541,7 @@ Check the top-level render call using <` + j + ">.");
541
541
  }
542
542
  }
543
543
  }
544
- function M(m) {
544
+ function R(m) {
545
545
  {
546
546
  var y = m.type;
547
547
  if (y == null || typeof y == "string")
@@ -556,17 +556,17 @@ Check the top-level render call using <` + j + ">.");
556
556
  else
557
557
  return;
558
558
  if (j) {
559
- var X = I(y);
559
+ var X = z(y);
560
560
  Ve(j, m.props, "prop", X, m);
561
561
  } else if (y.PropTypes !== void 0 && !jt) {
562
562
  jt = !0;
563
- var ue = I(y);
563
+ var ue = z(y);
564
564
  B("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ue || "Unknown");
565
565
  }
566
566
  typeof y.getDefaultProps == "function" && !y.getDefaultProps.isReactClassApproved && B("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
567
567
  }
568
568
  }
569
- function ie(m) {
569
+ function ae(m) {
570
570
  {
571
571
  for (var y = Object.keys(m.props), j = 0; j < y.length; j++) {
572
572
  var X = y[j];
@@ -588,7 +588,7 @@ Check the top-level render call using <` + j + ">.");
588
588
  var Ne = xa();
589
589
  Ne ? ye += Ne : ye += Wr();
590
590
  var ze;
591
- m === null ? ze = "null" : Pe(m) ? ze = "array" : m !== void 0 && m.$$typeof === t ? (ze = "<" + (I(m.type) || "Unknown") + " />", ye = " Did you accidentally export a JSX literal instead of a component?") : ze = typeof m, B("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ze, ye);
591
+ m === null ? ze = "null" : Pe(m) ? ze = "array" : m !== void 0 && m.$$typeof === t ? (ze = "<" + (z(m.type) || "Unknown") + " />", ye = " Did you accidentally export a JSX literal instead of a component?") : ze = typeof m, B("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ze, ye);
592
592
  }
593
593
  var Ke = Lt(m, y, j, ue, De);
594
594
  if (Ke == null)
@@ -607,7 +607,7 @@ Check the top-level render call using <` + j + ">.");
607
607
  vn(wt, m);
608
608
  }
609
609
  if (Fe.call(y, "key")) {
610
- var rr = I(m), vt = Object.keys(y).filter(function(Ul) {
610
+ var rr = z(m), vt = Object.keys(y).filter(function(Ul) {
611
611
  return Ul !== "key";
612
612
  }), Ea = vt.length > 0 ? "{key: someKey, " + vt.join(": ..., ") + ": ...}" : "{key: someKey}";
613
613
  if (!ve[rr + Ea]) {
@@ -620,7 +620,7 @@ React keys must be passed directly to JSX without using spread:
620
620
  <%s key={someKey} {...props} />`, Ea, rr, Hl, rr), ve[rr + Ea] = !0;
621
621
  }
622
622
  }
623
- return m === n ? ie(Ke) : M(Ke), Ke;
623
+ return m === n ? ae(Ke) : R(Ke), Ke;
624
624
  }
625
625
  }
626
626
  function oe(m, y, j) {
@@ -629,8 +629,8 @@ React keys must be passed directly to JSX without using spread:
629
629
  function fe(m, y, j) {
630
630
  return ce(m, y, j, !1);
631
631
  }
632
- var ge = fe, W = oe;
633
- Hr.Fragment = n, Hr.jsx = ge, Hr.jsxs = W;
632
+ var ge = fe, _ = oe;
633
+ Hr.Fragment = n, Hr.jsx = ge, Hr.jsxs = _;
634
634
  })()), Hr;
635
635
  }
636
636
  var ls;
@@ -1179,7 +1179,7 @@ var sn = new mc(), ji = sn.produce, vs = /* @__PURE__ */ sn.createDraft.bind(sn)
1179
1179
  affinity: n
1180
1180
  } = e;
1181
1181
  if (r != null) {
1182
- var a = R.transform(r, t, {
1182
+ var a = N.transform(r, t, {
1183
1183
  affinity: n
1184
1184
  });
1185
1185
  e.current = a, a == null && e.unref();
@@ -1418,11 +1418,11 @@ var wc = (e, t, r) => {
1418
1418
  var {
1419
1419
  path: n,
1420
1420
  node: a
1421
- } = r, i = ae.parent(e, n), s = n[n.length - 1];
1421
+ } = r, i = ie.parent(e, n), s = n[n.length - 1];
1422
1422
  if (s > i.children.length)
1423
1423
  throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n, "] because the destination is past the end of the node."));
1424
1424
  if (i.children.splice(s, 0, a), t)
1425
- for (var [o, l] of R.points(t))
1425
+ for (var [o, l] of N.points(t))
1426
1426
  t[l] = Oe.transform(o, r);
1427
1427
  break;
1428
1428
  }
@@ -1433,16 +1433,16 @@ var wc = (e, t, r) => {
1433
1433
  text: h
1434
1434
  } = r;
1435
1435
  if (h.length === 0) break;
1436
- var p = ae.leaf(e, u), g = p.text.slice(0, f), v = p.text.slice(f);
1436
+ var p = ie.leaf(e, u), g = p.text.slice(0, f), v = p.text.slice(f);
1437
1437
  if (p.text = g + h + v, t)
1438
- for (var [D, c] of R.points(t))
1438
+ for (var [D, c] of N.points(t))
1439
1439
  t[c] = Oe.transform(D, r);
1440
1440
  break;
1441
1441
  }
1442
1442
  case "merge_node": {
1443
1443
  var {
1444
1444
  path: E
1445
- } = r, B = ae.get(e, E), F = C.previous(E), w = ae.get(e, F), T = ae.parent(e, E), S = E[E.length - 1];
1445
+ } = r, B = ie.get(e, E), F = C.previous(E), w = ie.get(e, F), T = ie.parent(e, E), S = E[E.length - 1];
1446
1446
  if (he.isText(B) && he.isText(w))
1447
1447
  w.text += B.text;
1448
1448
  else if (!he.isText(B) && !he.isText(w))
@@ -1450,8 +1450,8 @@ var wc = (e, t, r) => {
1450
1450
  else
1451
1451
  throw new Error('Cannot apply a "merge_node" operation at path ['.concat(E, "] to nodes of different interfaces: ").concat(at.stringify(B), " ").concat(at.stringify(w)));
1452
1452
  if (T.children.splice(S, 1), t)
1453
- for (var [A, z] of R.points(t))
1454
- t[z] = Oe.transform(A, r);
1453
+ for (var [A, I] of N.points(t))
1454
+ t[I] = Oe.transform(A, r);
1455
1455
  break;
1456
1456
  }
1457
1457
  case "move_node": {
@@ -1461,26 +1461,26 @@ var wc = (e, t, r) => {
1461
1461
  } = r;
1462
1462
  if (C.isAncestor(K, G))
1463
1463
  throw new Error("Cannot move a path [".concat(K, "] to new path [").concat(G, "] because the destination is inside itself."));
1464
- var L = ae.get(e, K), N = ae.parent(e, K), I = K[K.length - 1];
1465
- N.children.splice(I, 1);
1466
- var O = C.transform(K, r), k = ae.get(e, C.parent(O)), P = O[O.length - 1];
1464
+ var L = ie.get(e, K), M = ie.parent(e, K), z = K[K.length - 1];
1465
+ M.children.splice(z, 1);
1466
+ var O = C.transform(K, r), k = ie.get(e, C.parent(O)), P = O[O.length - 1];
1467
1467
  if (k.children.splice(P, 0, L), t)
1468
- for (var [$, U] of R.points(t))
1468
+ for (var [$, U] of N.points(t))
1469
1469
  t[U] = Oe.transform($, r);
1470
1470
  break;
1471
1471
  }
1472
1472
  case "remove_node": {
1473
1473
  var {
1474
1474
  path: Y
1475
- } = r, Z = Y[Y.length - 1], q = ae.parent(e, Y);
1475
+ } = r, Z = Y[Y.length - 1], q = ie.parent(e, Y);
1476
1476
  if (q.children.splice(Z, 1), t)
1477
- for (var [ee, se] of R.points(t)) {
1477
+ for (var [ee, se] of N.points(t)) {
1478
1478
  var xe = Oe.transform(ee, r);
1479
1479
  if (t != null && xe != null)
1480
1480
  t[se] = xe;
1481
1481
  else {
1482
1482
  var le = void 0, x = void 0;
1483
- for (var [J, H] of ae.texts(e))
1483
+ for (var [J, H] of ie.texts(e))
1484
1484
  if (C.compare(H, Y) === -1)
1485
1485
  le = [J, H];
1486
1486
  else {
@@ -1500,10 +1500,10 @@ var wc = (e, t, r) => {
1500
1500
  text: de
1501
1501
  } = r;
1502
1502
  if (de.length === 0) break;
1503
- var we = ae.leaf(e, ne), me = we.text.slice(0, te), Ce = we.text.slice(te + de.length);
1503
+ var we = ie.leaf(e, ne), me = we.text.slice(0, te), Ce = we.text.slice(te + de.length);
1504
1504
  if (we.text = me + Ce, t)
1505
- for (var [Fe, Be] of R.points(t))
1506
- t[Be] = Oe.transform(Fe, r);
1505
+ for (var [Fe, Ee] of N.points(t))
1506
+ t[Ee] = Oe.transform(Fe, r);
1507
1507
  break;
1508
1508
  }
1509
1509
  case "set_node": {
@@ -1514,7 +1514,7 @@ var wc = (e, t, r) => {
1514
1514
  } = r;
1515
1515
  if (Ae.length === 0)
1516
1516
  throw new Error("Cannot set properties on the root node!");
1517
- var ut = ae.get(e, Ae);
1517
+ var ut = ie.get(e, Ae);
1518
1518
  for (var Pe in Ve) {
1519
1519
  if (Pe === "children" || Pe === "text")
1520
1520
  throw new Error('Cannot set the "'.concat(Pe, '" property of nodes!'));
@@ -1533,7 +1533,7 @@ var wc = (e, t, r) => {
1533
1533
  t = Re;
1534
1534
  else {
1535
1535
  if (t == null) {
1536
- if (!R.isRange(Re))
1536
+ if (!N.isRange(Re))
1537
1537
  throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(at.stringify(Re), " when there is no current selection."));
1538
1538
  t = Ur({}, Re);
1539
1539
  }
@@ -1557,7 +1557,7 @@ var wc = (e, t, r) => {
1557
1557
  } = r;
1558
1558
  if (tt.length === 0)
1559
1559
  throw new Error('Cannot apply a "split_node" operation at path ['.concat(tt, "] because the root node cannot be split."));
1560
- var qe = ae.get(e, tt), It = ae.parent(e, tt), zt = tt[tt.length - 1], Tt;
1560
+ var qe = ie.get(e, tt), It = ie.parent(e, tt), zt = tt[tt.length - 1], Tt;
1561
1561
  if (he.isText(qe)) {
1562
1562
  var Kt = qe.text.slice(0, it), _r = qe.text.slice(it);
1563
1563
  qe.text = Kt, Tt = Ur(Ur({}, Te), {}, {
@@ -1570,7 +1570,7 @@ var wc = (e, t, r) => {
1570
1570
  });
1571
1571
  }
1572
1572
  if (It.children.splice(zt + 1, 0, Tt), t)
1573
- for (var [$t, ft] of R.points(t))
1573
+ for (var [$t, ft] of N.points(t))
1574
1574
  t[ft] = Oe.transform($t, r);
1575
1575
  break;
1576
1576
  }
@@ -1692,7 +1692,7 @@ function Sc(e) {
1692
1692
  }
1693
1693
  return e;
1694
1694
  }
1695
- var R = {
1695
+ var N = {
1696
1696
  edges(e) {
1697
1697
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
1698
1698
  reverse: r = !1
@@ -1700,27 +1700,27 @@ var R = {
1700
1700
  anchor: n,
1701
1701
  focus: a
1702
1702
  } = e;
1703
- return R.isBackward(e) === r ? [n, a] : [a, n];
1703
+ return N.isBackward(e) === r ? [n, a] : [a, n];
1704
1704
  },
1705
1705
  end(e) {
1706
- var [, t] = R.edges(e);
1706
+ var [, t] = N.edges(e);
1707
1707
  return t;
1708
1708
  },
1709
1709
  equals(e, t) {
1710
1710
  return Oe.equals(e.anchor, t.anchor) && Oe.equals(e.focus, t.focus);
1711
1711
  },
1712
1712
  includes(e, t) {
1713
- if (R.isRange(t)) {
1714
- if (R.includes(e, t.anchor) || R.includes(e, t.focus))
1713
+ if (N.isRange(t)) {
1714
+ if (N.includes(e, t.anchor) || N.includes(e, t.focus))
1715
1715
  return !0;
1716
- var [r, n] = R.edges(e), [a, i] = R.edges(t);
1716
+ var [r, n] = N.edges(e), [a, i] = N.edges(t);
1717
1717
  return Oe.isBefore(r, a) && Oe.isAfter(n, i);
1718
1718
  }
1719
- var [s, o] = R.edges(e), l = !1, u = !1;
1719
+ var [s, o] = N.edges(e), l = !1, u = !1;
1720
1720
  return Oe.isPoint(t) ? (l = Oe.compare(t, s) >= 0, u = Oe.compare(t, o) <= 0) : (l = C.compare(t, s.path) >= 0, u = C.compare(t, o.path) <= 0), l && u;
1721
1721
  },
1722
1722
  intersection(e, t) {
1723
- var r = Vt(e, kc), [n, a] = R.edges(e), [i, s] = R.edges(t), o = Oe.isBefore(n, i) ? i : n, l = Oe.isBefore(a, s) ? a : s;
1723
+ var r = Vt(e, kc), [n, a] = N.edges(e), [i, s] = N.edges(t), o = Oe.isBefore(n, i) ? i : n, l = Oe.isBefore(a, s) ? a : s;
1724
1724
  return Oe.isBefore(l, o) ? null : Sc({
1725
1725
  anchor: o,
1726
1726
  focus: l
@@ -1741,10 +1741,10 @@ var R = {
1741
1741
  return Oe.equals(t, r);
1742
1742
  },
1743
1743
  isExpanded(e) {
1744
- return !R.isCollapsed(e);
1744
+ return !N.isCollapsed(e);
1745
1745
  },
1746
1746
  isForward(e) {
1747
- return !R.isBackward(e);
1747
+ return !N.isBackward(e);
1748
1748
  },
1749
1749
  isRange(e) {
1750
1750
  return ot(e) && Oe.isPoint(e.anchor) && Oe.isPoint(e.focus);
@@ -1753,7 +1753,7 @@ var R = {
1753
1753
  yield [e.anchor, "anchor"], yield [e.focus, "focus"];
1754
1754
  },
1755
1755
  start(e) {
1756
- var [t] = R.edges(e);
1756
+ var [t] = N.edges(e);
1757
1757
  return t;
1758
1758
  },
1759
1759
  transform(e, t) {
@@ -1765,9 +1765,9 @@ var R = {
1765
1765
  affinity: a = "inward"
1766
1766
  } = r, i, s;
1767
1767
  if (a === "inward") {
1768
- var o = R.isCollapsed(n);
1769
- R.isForward(n) ? (i = "forward", s = o ? i : "backward") : (i = "backward", s = o ? i : "forward");
1770
- } else a === "outward" ? R.isForward(n) ? (i = "backward", s = "forward") : (i = "forward", s = "backward") : (i = a, s = a);
1768
+ var o = N.isCollapsed(n);
1769
+ N.isForward(n) ? (i = "forward", s = o ? i : "backward") : (i = "backward", s = o ? i : "forward");
1770
+ } else a === "outward" ? N.isForward(n) ? (i = "backward", s = "forward") : (i = "forward", s = "backward") : (i = a, s = a);
1771
1771
  var l = Oe.transform(n.anchor, t, {
1772
1772
  affinity: i
1773
1773
  }), u = Oe.transform(n.focus, t, {
@@ -1778,9 +1778,9 @@ var R = {
1778
1778
  n.anchor = l, n.focus = u;
1779
1779
  });
1780
1780
  }
1781
- }, Es = (e) => ot(e) && ae.isNodeList(e.children) && !d.isEditor(e), pe = {
1781
+ }, Es = (e) => ot(e) && ie.isNodeList(e.children) && !d.isEditor(e), pe = {
1782
1782
  isAncestor(e) {
1783
- return ot(e) && ae.isNodeList(e.children);
1783
+ return ot(e) && ie.isNodeList(e.children);
1784
1784
  },
1785
1785
  isElement: Es,
1786
1786
  isElementList(e) {
@@ -1799,9 +1799,9 @@ var R = {
1799
1799
  return !1;
1800
1800
  return !0;
1801
1801
  }
1802
- }, Oc = ["children"], Tc = ["text"], Bs = /* @__PURE__ */ new WeakMap(), ae = {
1802
+ }, Oc = ["children"], Tc = ["text"], Bs = /* @__PURE__ */ new WeakMap(), ie = {
1803
1803
  ancestor(e, t) {
1804
- var r = ae.get(e, t);
1804
+ var r = ie.get(e, t);
1805
1805
  if (he.isText(r))
1806
1806
  throw new Error("Cannot get the ancestor node at path [".concat(t, "] because it refers to a text node instead: ").concat(at.stringify(r)));
1807
1807
  return r;
@@ -1810,7 +1810,7 @@ var R = {
1810
1810
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1811
1811
  return (function* () {
1812
1812
  for (var n of C.ancestors(t, r)) {
1813
- var a = ae.ancestor(e, n), i = [a, n];
1813
+ var a = ie.ancestor(e, n), i = [a, n];
1814
1814
  yield i;
1815
1815
  }
1816
1816
  })();
@@ -1828,20 +1828,20 @@ var R = {
1828
1828
  return (function* () {
1829
1829
  for (var {
1830
1830
  reverse: n = !1
1831
- } = r, a = ae.ancestor(e, t), {
1831
+ } = r, a = ie.ancestor(e, t), {
1832
1832
  children: i
1833
1833
  } = a, s = n ? i.length - 1 : 0; n ? s >= 0 : s < i.length; ) {
1834
- var o = ae.child(a, s), l = t.concat(s);
1834
+ var o = ie.child(a, s), l = t.concat(s);
1835
1835
  yield [o, l], s = n ? s - 1 : s + 1;
1836
1836
  }
1837
1837
  })();
1838
1838
  },
1839
1839
  common(e, t, r) {
1840
- var n = C.common(t, r), a = ae.get(e, n);
1840
+ var n = C.common(t, r), a = ie.get(e, n);
1841
1841
  return [a, n];
1842
1842
  },
1843
1843
  descendant(e, t) {
1844
- var r = ae.get(e, t);
1844
+ var r = ie.get(e, t);
1845
1845
  if (d.isEditor(r))
1846
1846
  throw new Error("Cannot get the descendant node at path [".concat(t, "] because it refers to the root editor node instead: ").concat(at.stringify(r)));
1847
1847
  return r;
@@ -1849,14 +1849,14 @@ var R = {
1849
1849
  descendants(e) {
1850
1850
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1851
1851
  return (function* () {
1852
- for (var [r, n] of ae.nodes(e, t))
1852
+ for (var [r, n] of ie.nodes(e, t))
1853
1853
  n.length !== 0 && (yield [r, n]);
1854
1854
  })();
1855
1855
  },
1856
1856
  elements(e) {
1857
1857
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1858
1858
  return (function* () {
1859
- for (var [r, n] of ae.nodes(e, t))
1859
+ for (var [r, n] of ie.nodes(e, t))
1860
1860
  pe.isElement(r) && (yield [r, n]);
1861
1861
  })();
1862
1862
  },
@@ -1870,7 +1870,7 @@ var R = {
1870
1870
  }
1871
1871
  },
1872
1872
  first(e, t) {
1873
- for (var r = t.slice(), n = ae.get(e, r); n && !(he.isText(n) || n.children.length === 0); )
1873
+ for (var r = t.slice(), n = ie.get(e, r); n && !(he.isText(n) || n.children.length === 0); )
1874
1874
  n = n.children[0], r.push(0);
1875
1875
  return [n, r];
1876
1876
  },
@@ -1880,24 +1880,24 @@ var R = {
1880
1880
  var r = ji({
1881
1881
  children: e.children
1882
1882
  }, (n) => {
1883
- var [a, i] = R.edges(t), s = ae.nodes(n, {
1883
+ var [a, i] = N.edges(t), s = ie.nodes(n, {
1884
1884
  reverse: !0,
1885
1885
  pass: (p) => {
1886
1886
  var [, g] = p;
1887
- return !R.includes(t, g);
1887
+ return !N.includes(t, g);
1888
1888
  }
1889
1889
  });
1890
1890
  for (var [, o] of s) {
1891
- if (!R.includes(t, o)) {
1892
- var l = ae.parent(n, o), u = o[o.length - 1];
1891
+ if (!N.includes(t, o)) {
1892
+ var l = ie.parent(n, o), u = o[o.length - 1];
1893
1893
  l.children.splice(u, 1);
1894
1894
  }
1895
1895
  if (C.equals(o, i.path)) {
1896
- var f = ae.leaf(n, o);
1896
+ var f = ie.leaf(n, o);
1897
1897
  f.text = f.text.slice(0, i.offset);
1898
1898
  }
1899
1899
  if (C.equals(o, a.path)) {
1900
- var h = ae.leaf(n, o);
1900
+ var h = ie.leaf(n, o);
1901
1901
  h.text = h.text.slice(a.offset);
1902
1902
  }
1903
1903
  }
@@ -1932,18 +1932,18 @@ var R = {
1932
1932
  var t = Bs.get(e);
1933
1933
  if (t !== void 0)
1934
1934
  return t;
1935
- var r = e.every((n) => ae.isNode(n));
1935
+ var r = e.every((n) => ie.isNode(n));
1936
1936
  return Bs.set(e, r), r;
1937
1937
  },
1938
1938
  last(e, t) {
1939
- for (var r = t.slice(), n = ae.get(e, r); n && !(he.isText(n) || n.children.length === 0); ) {
1939
+ for (var r = t.slice(), n = ie.get(e, r); n && !(he.isText(n) || n.children.length === 0); ) {
1940
1940
  var a = n.children.length - 1;
1941
1941
  n = n.children[a], r.push(a);
1942
1942
  }
1943
1943
  return [n, r];
1944
1944
  },
1945
1945
  leaf(e, t) {
1946
- var r = ae.get(e, t);
1946
+ var r = ie.get(e, t);
1947
1947
  if (!he.isText(r))
1948
1948
  throw new Error("Cannot get the leaf node at path [".concat(t, "] because it refers to a non-leaf node: ").concat(at.stringify(r)));
1949
1949
  return r;
@@ -1952,7 +1952,7 @@ var R = {
1952
1952
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1953
1953
  return (function* () {
1954
1954
  for (var n of C.levels(t, r)) {
1955
- var a = ae.get(e, n);
1955
+ var a = ie.get(e, n);
1956
1956
  yield [a, n];
1957
1957
  }
1958
1958
  })();
@@ -1973,40 +1973,40 @@ var R = {
1973
1973
  if (s.has(l) || (yield [l, o]), !s.has(l) && !he.isText(l) && l.children.length !== 0 && (r == null || r([l, o]) === !1)) {
1974
1974
  s.add(l);
1975
1975
  var u = n ? l.children.length - 1 : 0;
1976
- C.isAncestor(o, a) && (u = a[o.length]), o = o.concat(u), l = ae.get(e, o);
1976
+ C.isAncestor(o, a) && (u = a[o.length]), o = o.concat(u), l = ie.get(e, o);
1977
1977
  continue;
1978
1978
  }
1979
1979
  if (o.length === 0)
1980
1980
  break;
1981
1981
  if (!n) {
1982
1982
  var f = C.next(o);
1983
- if (ae.has(e, f)) {
1984
- o = f, l = ae.get(e, o);
1983
+ if (ie.has(e, f)) {
1984
+ o = f, l = ie.get(e, o);
1985
1985
  continue;
1986
1986
  }
1987
1987
  }
1988
1988
  if (n && o[o.length - 1] !== 0) {
1989
1989
  var h = C.previous(o);
1990
- o = h, l = ae.get(e, o);
1990
+ o = h, l = ie.get(e, o);
1991
1991
  continue;
1992
1992
  }
1993
- o = C.parent(o), l = ae.get(e, o), s.add(l);
1993
+ o = C.parent(o), l = ie.get(e, o), s.add(l);
1994
1994
  }
1995
1995
  })();
1996
1996
  },
1997
1997
  parent(e, t) {
1998
- var r = C.parent(t), n = ae.get(e, r);
1998
+ var r = C.parent(t), n = ie.get(e, r);
1999
1999
  if (he.isText(n))
2000
2000
  throw new Error("Cannot get the parent of path [".concat(t, "] because it does not exist in the root."));
2001
2001
  return n;
2002
2002
  },
2003
2003
  string(e) {
2004
- return he.isText(e) ? e.text : e.children.map(ae.string).join("");
2004
+ return he.isText(e) ? e.text : e.children.map(ie.string).join("");
2005
2005
  },
2006
2006
  texts(e) {
2007
2007
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2008
2008
  return (function* () {
2009
- for (var [r, n] of ae.nodes(e, t))
2009
+ for (var [r, n] of ie.nodes(e, t))
2010
2010
  he.isText(r) && (yield [r, n]);
2011
2011
  })();
2012
2012
  }
@@ -2041,7 +2041,7 @@ var Yr = {
2041
2041
  return !1;
2042
2042
  switch (e.type) {
2043
2043
  case "insert_node":
2044
- return C.isPath(e.path) && ae.isNode(e.node);
2044
+ return C.isPath(e.path) && ie.isNode(e.node);
2045
2045
  case "insert_text":
2046
2046
  return typeof e.offset == "number" && typeof e.text == "string" && C.isPath(e.path);
2047
2047
  case "merge_node":
@@ -2049,13 +2049,13 @@ var Yr = {
2049
2049
  case "move_node":
2050
2050
  return C.isPath(e.path) && C.isPath(e.newPath);
2051
2051
  case "remove_node":
2052
- return C.isPath(e.path) && ae.isNode(e.node);
2052
+ return C.isPath(e.path) && ie.isNode(e.node);
2053
2053
  case "remove_text":
2054
2054
  return typeof e.offset == "number" && typeof e.text == "string" && C.isPath(e.path);
2055
2055
  case "set_node":
2056
2056
  return C.isPath(e.path) && ot(e.properties) && ot(e.newProperties);
2057
2057
  case "set_selection":
2058
- return e.properties === null && R.isRange(e.newProperties) || e.newProperties === null && R.isRange(e.properties) || ot(e.properties) && ot(e.newProperties);
2058
+ return e.properties === null && N.isRange(e.newProperties) || e.newProperties === null && N.isRange(e.properties) || ot(e.properties) && ot(e.newProperties);
2059
2059
  case "split_node":
2060
2060
  return C.isPath(e.path) && typeof e.position == "number" && ot(e.properties);
2061
2061
  default:
@@ -2151,7 +2151,7 @@ var Yr = {
2151
2151
  return t;
2152
2152
  if (!ot(e))
2153
2153
  return !1;
2154
- var r = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null || ot(e.marks)) && (e.selection === null || R.isRange(e.selection)) && ae.isNodeList(e.children) && Yr.isOperationList(e.operations);
2154
+ var r = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null || ot(e.marks)) && (e.selection === null || N.isRange(e.selection)) && ie.isNodeList(e.children) && Yr.isOperationList(e.operations);
2155
2155
  return Fs.set(e, r), r;
2156
2156
  }, d = {
2157
2157
  above(e, t) {
@@ -2489,7 +2489,7 @@ var he = {
2489
2489
  decorations(e, t) {
2490
2490
  var r = [_t({}, e)];
2491
2491
  for (var n of t) {
2492
- var a = Vt(n, Rc), [i, s] = R.edges(n), o = [], l = 0, u = i.offset, f = s.offset;
2492
+ var a = Vt(n, Rc), [i, s] = N.edges(n), o = [], l = 0, u = i.offset, f = s.offset;
2493
2493
  for (var h of r) {
2494
2494
  var {
2495
2495
  length: p
@@ -2529,12 +2529,12 @@ var he = {
2529
2529
  var [r] = d.node(e, t);
2530
2530
  return (n) => n === r;
2531
2531
  }, Ri = function(t) {
2532
- var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = !r, a = r ? _c(t) : t, i = Ee.None, s = Ee.None, o = 0, l = null, u = null;
2532
+ var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = !r, a = r ? _c(t) : t, i = Be.None, s = Be.None, o = 0, l = null, u = null;
2533
2533
  for (var f of a) {
2534
2534
  var h = f.codePointAt(0);
2535
2535
  if (!h) break;
2536
2536
  var p = Qc(f, h);
2537
- if ([i, s] = n ? [s, p] : [p, i], Ar(i, Ee.ZWJ) && Ar(s, Ee.ExtPict) && (n ? l = $s(t.substring(0, o)) : l = $s(t.substring(0, t.length - o)), !l) || Ar(i, Ee.RI) && Ar(s, Ee.RI) && (u !== null ? u = !u : n ? u = !0 : u = af(t.substring(0, t.length - o)), !u) || i !== Ee.None && s !== Ee.None && tf(i, s))
2537
+ if ([i, s] = n ? [s, p] : [p, i], Ar(i, Be.ZWJ) && Ar(s, Be.ExtPict) && (n ? l = $s(t.substring(0, o)) : l = $s(t.substring(0, t.length - o)), !l) || Ar(i, Be.RI) && Ar(s, Be.RI) && (u !== null ? u = !u : n ? u = !0 : u = af(t.substring(0, t.length - o)), !u) || i !== Be.None && s !== Be.None && tf(i, s))
2538
2538
  break;
2539
2539
  o += f.length;
2540
2540
  }
@@ -2579,34 +2579,34 @@ var he = {
2579
2579
  }
2580
2580
  yield a;
2581
2581
  }
2582
- }, Wc = (e) => e >= 55296 && e <= 56319, qc = (e) => e >= 56320 && e <= 57343, Ee;
2582
+ }, Wc = (e) => e >= 55296 && e <= 56319, qc = (e) => e >= 56320 && e <= 57343, Be;
2583
2583
  (function(e) {
2584
2584
  e[e.None = 0] = "None", e[e.Extend = 1] = "Extend", e[e.ZWJ = 2] = "ZWJ", e[e.RI = 4] = "RI", e[e.Prepend = 8] = "Prepend", e[e.SpacingMark = 16] = "SpacingMark", e[e.L = 32] = "L", e[e.V = 64] = "V", e[e.T = 128] = "T", e[e.LV = 256] = "LV", e[e.LVT = 512] = "LVT", e[e.ExtPict = 1024] = "ExtPict", e[e.Any = 2048] = "Any";
2585
- })(Ee || (Ee = {}));
2585
+ })(Be || (Be = {}));
2586
2586
  var Hc = /^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/, Uc = /^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/, Vc = /^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/, Kc = /^[\u1100-\u115F\uA960-\uA97C]$/, Yc = /^[\u1160-\u11A7\uD7B0-\uD7C6]$/, Gc = /^[\u11A8-\u11FF\uD7CB-\uD7FB]$/, Zc = /^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/, Jc = /^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/, Xc = /^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/, Qc = (e, t) => {
2587
- var r = Ee.Any;
2588
- return e.search(Hc) !== -1 && (r |= Ee.Extend), t === 8205 && (r |= Ee.ZWJ), t >= 127462 && t <= 127487 && (r |= Ee.RI), e.search(Uc) !== -1 && (r |= Ee.Prepend), e.search(Vc) !== -1 && (r |= Ee.SpacingMark), e.search(Kc) !== -1 && (r |= Ee.L), e.search(Yc) !== -1 && (r |= Ee.V), e.search(Gc) !== -1 && (r |= Ee.T), e.search(Zc) !== -1 && (r |= Ee.LV), e.search(Jc) !== -1 && (r |= Ee.LVT), e.search(Xc) !== -1 && (r |= Ee.ExtPict), r;
2587
+ var r = Be.Any;
2588
+ return e.search(Hc) !== -1 && (r |= Be.Extend), t === 8205 && (r |= Be.ZWJ), t >= 127462 && t <= 127487 && (r |= Be.RI), e.search(Uc) !== -1 && (r |= Be.Prepend), e.search(Vc) !== -1 && (r |= Be.SpacingMark), e.search(Kc) !== -1 && (r |= Be.L), e.search(Yc) !== -1 && (r |= Be.V), e.search(Gc) !== -1 && (r |= Be.T), e.search(Zc) !== -1 && (r |= Be.LV), e.search(Jc) !== -1 && (r |= Be.LVT), e.search(Xc) !== -1 && (r |= Be.ExtPict), r;
2589
2589
  };
2590
2590
  function Ar(e, t) {
2591
2591
  return (e & t) !== 0;
2592
2592
  }
2593
2593
  var ef = [
2594
2594
  // GB6
2595
- [Ee.L, Ee.L | Ee.V | Ee.LV | Ee.LVT],
2595
+ [Be.L, Be.L | Be.V | Be.LV | Be.LVT],
2596
2596
  // GB7
2597
- [Ee.LV | Ee.V, Ee.V | Ee.T],
2597
+ [Be.LV | Be.V, Be.V | Be.T],
2598
2598
  // GB8
2599
- [Ee.LVT | Ee.T, Ee.T],
2599
+ [Be.LVT | Be.T, Be.T],
2600
2600
  // GB9
2601
- [Ee.Any, Ee.Extend | Ee.ZWJ],
2601
+ [Be.Any, Be.Extend | Be.ZWJ],
2602
2602
  // GB9a
2603
- [Ee.Any, Ee.SpacingMark],
2603
+ [Be.Any, Be.SpacingMark],
2604
2604
  // GB9b
2605
- [Ee.Prepend, Ee.Any],
2605
+ [Be.Prepend, Be.Any],
2606
2606
  // GB11
2607
- [Ee.ZWJ, Ee.ExtPict],
2607
+ [Be.ZWJ, Be.ExtPict],
2608
2608
  // GB12 and GB13
2609
- [Ee.RI, Ee.RI]
2609
+ [Be.RI, Be.RI]
2610
2610
  ];
2611
2611
  function tf(e, t) {
2612
2612
  return ef.findIndex((r) => Ar(e, r[0]) && Ar(t, r[1])) === -1;
@@ -2632,16 +2632,16 @@ var rf = /(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u2
2632
2632
  } = r, {
2633
2633
  at: a = Pi(e)
2634
2634
  } = r;
2635
- if (C.isPath(a) && (a = d.range(e, a)), R.isRange(a))
2636
- if (R.isCollapsed(a))
2635
+ if (C.isPath(a) && (a = d.range(e, a)), N.isRange(a))
2636
+ if (N.isCollapsed(a))
2637
2637
  a = a.anchor;
2638
2638
  else {
2639
- var i = R.end(a);
2639
+ var i = N.end(a);
2640
2640
  if (!n && d.void(e, {
2641
2641
  at: i
2642
2642
  }))
2643
2643
  return;
2644
- var s = R.start(a), o = d.pointRef(e, s), l = d.pointRef(e, i);
2644
+ var s = N.start(a), o = d.pointRef(e, s), l = d.pointRef(e, i);
2645
2645
  Q.delete(e, {
2646
2646
  at: a,
2647
2647
  voids: n
@@ -2752,7 +2752,7 @@ var lf = (e, t) => {
2752
2752
  var {
2753
2753
  node: n,
2754
2754
  path: a
2755
- } = t, i = C.levels(a), s = he.isText(n) ? [] : Array.from(ae.nodes(n), (G) => {
2755
+ } = t, i = C.levels(a), s = he.isText(n) ? [] : Array.from(ie.nodes(n), (G) => {
2756
2756
  var [, L] = G;
2757
2757
  return a.concat(L);
2758
2758
  });
@@ -2792,8 +2792,8 @@ var lf = (e, t) => {
2792
2792
  case "split_node": {
2793
2793
  var {
2794
2794
  path: A
2795
- } = t, z = C.levels(A), K = C.next(A);
2796
- return [...z, K];
2795
+ } = t, I = C.levels(A), K = C.next(A);
2796
+ return [...I, K];
2797
2797
  }
2798
2798
  default:
2799
2799
  return [];
@@ -2802,7 +2802,7 @@ var lf = (e, t) => {
2802
2802
  var {
2803
2803
  selection: t
2804
2804
  } = e;
2805
- return t ? ae.fragment(e, t) : [];
2805
+ return t ? ie.fragment(e, t) : [];
2806
2806
  }, df = (e, t) => {
2807
2807
  var [r, n] = t;
2808
2808
  if (!he.isText(r)) {
@@ -2817,7 +2817,7 @@ var lf = (e, t) => {
2817
2817
  return;
2818
2818
  }
2819
2819
  for (var i = d.isEditor(r) ? !1 : pe.isElement(r) && (e.isInline(r) || r.children.length === 0 || he.isText(r.children[0]) || e.isInline(r.children[0])), s = 0, o = 0; o < r.children.length; o++, s++) {
2820
- var l = ae.get(e, n);
2820
+ var l = ie.get(e, n);
2821
2821
  if (!he.isText(l)) {
2822
2822
  var u = l.children[s], f = l.children[s - 1], h = o === r.children.length - 1, p = he.isText(u) || pe.isElement(u) && e.isInline(u);
2823
2823
  if (p !== i)
@@ -2890,7 +2890,7 @@ var lf = (e, t) => {
2890
2890
  reverse: l
2891
2891
  }))
2892
2892
  if (!he.isText(u)) {
2893
- if (R.isRange(i)) {
2893
+ if (N.isRange(i)) {
2894
2894
  if (C.isAncestor(f, i.anchor.path) && C.isAncestor(f, i.focus.path))
2895
2895
  return [u, f];
2896
2896
  } else if (!C.equals(o, f))
@@ -2929,7 +2929,7 @@ var gf = (e, t, r) => {
2929
2929
  return !1;
2930
2930
  var [g, v] = d.parent(e, p);
2931
2931
  return !e.isVoid(g) || e.markableVoid(g);
2932
- }, i = R.isExpanded(n), s = !1;
2932
+ }, i = N.isExpanded(n), s = !1;
2933
2933
  if (!i) {
2934
2934
  var [o, l] = d.node(e, n);
2935
2935
  if (o && a(o, l)) {
@@ -3035,7 +3035,7 @@ var vf = function(t, r) {
3035
3035
  var {
3036
3036
  selection: r
3037
3037
  } = e;
3038
- r && R.isCollapsed(r) && Q.delete(e, {
3038
+ r && N.isCollapsed(r) && Q.delete(e, {
3039
3039
  unit: t,
3040
3040
  reverse: !0
3041
3041
  });
@@ -3043,7 +3043,7 @@ var vf = function(t, r) {
3043
3043
  var {
3044
3044
  selection: r
3045
3045
  } = e;
3046
- r && R.isCollapsed(r) && Q.delete(e, {
3046
+ r && N.isCollapsed(r) && Q.delete(e, {
3047
3047
  unit: t
3048
3048
  });
3049
3049
  }, yf = function(t) {
@@ -3052,7 +3052,7 @@ var vf = function(t, r) {
3052
3052
  } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
3053
3053
  selection: n
3054
3054
  } = t;
3055
- n && R.isExpanded(n) && Q.delete(t, {
3055
+ n && N.isExpanded(n) && Q.delete(t, {
3056
3056
  reverse: r === "backward"
3057
3057
  });
3058
3058
  }, Cf = (e, t) => [d.start(e, t), d.end(e, t)];
@@ -3091,7 +3091,7 @@ var xf = function(t) {
3091
3091
  return d.node(e, r);
3092
3092
  }, Bf = (e, t) => {
3093
3093
  var r = d.range(e, t);
3094
- return ae.fragment(e, r);
3094
+ return ie.fragment(e, r);
3095
3095
  };
3096
3096
  function Ws(e, t) {
3097
3097
  var r = Object.keys(e);
@@ -3119,7 +3119,7 @@ var Af = function(t) {
3119
3119
  return d.above(t, qs(qs({}, r), {}, {
3120
3120
  match: (n) => pe.isElement(n) && d.isVoid(t, n)
3121
3121
  }));
3122
- }, Ff = (e, t) => t.children.some((r) => pe.isElement(r) && d.isBlock(e, r)), kf = (e, t) => t.children.some((r) => he.isText(r) || d.isInline(e, r)), Sf = (e, t) => ae.has(e, t), Of = (e, t) => t.children.every((r) => he.isText(r)), Tf = (e) => {
3122
+ }, Ff = (e, t) => t.children.some((r) => pe.isElement(r) && d.isBlock(e, r)), kf = (e, t) => t.children.some((r) => he.isText(r) || d.isInline(e, r)), Sf = (e, t) => ie.has(e, t), Of = (e, t) => t.children.every((r) => he.isText(r)), Tf = (e) => {
3123
3123
  Q.splitNodes(e, {
3124
3124
  always: !0
3125
3125
  });
@@ -3191,7 +3191,7 @@ var Rf = function(t, r) {
3191
3191
  });
3192
3192
  return d.node(e, r);
3193
3193
  }, qf = function(t, r) {
3194
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = d.path(t, r, n), i = ae.leaf(t, a);
3194
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = d.path(t, r, n), i = ie.leaf(t, a);
3195
3195
  return [i, a];
3196
3196
  };
3197
3197
  function Hf(e) {
@@ -3206,7 +3206,7 @@ function Hf(e) {
3206
3206
  } = t;
3207
3207
  if (i == null && (i = () => !0), !!r) {
3208
3208
  var s = [], o = d.path(e, r);
3209
- for (var [l, u] of ae.levels(e, o))
3209
+ for (var [l, u] of ie.levels(e, o))
3210
3210
  if (i(l, u) && (s.push([l, u]), !a && pe.isElement(l) && d.isVoid(e, l)))
3211
3211
  break;
3212
3212
  n && s.reverse(), yield* s;
@@ -3226,7 +3226,7 @@ var Uf = ["text"], Vf = ["text"], Kf = function(t) {
3226
3226
  } = n;
3227
3227
  if (r)
3228
3228
  return r;
3229
- if (R.isExpanded(n)) {
3229
+ if (N.isExpanded(n)) {
3230
3230
  var s = d.isEnd(t, a, a.path);
3231
3231
  if (s) {
3232
3232
  var o = d.after(t, a);
@@ -3299,7 +3299,7 @@ var Uf = ["text"], Vf = ["text"], Kf = function(t) {
3299
3299
  }
3300
3300
  }
3301
3301
  }, Gf = function(t, r) {
3302
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = d.path(t, r, n), i = ae.get(t, a);
3302
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = d.path(t, r, n), i = ie.get(t, a);
3303
3303
  return [i, a];
3304
3304
  };
3305
3305
  function Zf(e) {
@@ -3327,7 +3327,7 @@ function Zf(e) {
3327
3327
  });
3328
3328
  u = i ? p : h, f = i ? h : p;
3329
3329
  }
3330
- var g = ae.nodes(e, {
3330
+ var g = ie.nodes(e, {
3331
3331
  reverse: i,
3332
3332
  from: u,
3333
3333
  to: f,
@@ -3367,7 +3367,7 @@ var Jf = function(t) {
3367
3367
  };
3368
3368
  if (d.isNormalizing(t)) {
3369
3369
  if (n) {
3370
- var l = Array.from(ae.nodes(t), (f) => {
3370
+ var l = Array.from(ie.nodes(t), (f) => {
3371
3371
  var [, h] = f;
3372
3372
  return h;
3373
3373
  }), u = new Set(l.map((f) => f.join(",")));
@@ -3375,7 +3375,7 @@ var Jf = function(t) {
3375
3375
  }
3376
3376
  i(t).length !== 0 && d.withoutNormalizing(t, () => {
3377
3377
  for (var f of i(t))
3378
- if (ae.has(t, f)) {
3378
+ if (ie.has(t, f)) {
3379
3379
  var h = d.node(t, f), [p, g] = h;
3380
3380
  pe.isElement(p) && p.children.length === 0 && t.normalizeNode(h, {
3381
3381
  operation: a
@@ -3390,7 +3390,7 @@ var Jf = function(t) {
3390
3390
  }))
3391
3391
  return;
3392
3392
  var E = o(t);
3393
- if (ae.has(t, E)) {
3393
+ if (ie.has(t, E)) {
3394
3394
  var B = d.node(t, E);
3395
3395
  t.normalizeNode(B, {
3396
3396
  operation: a
@@ -3427,14 +3427,14 @@ var Jf = function(t) {
3427
3427
  } = n;
3428
3428
  if (C.isPath(r)) {
3429
3429
  if (i === "start") {
3430
- var [, s] = ae.first(t, r);
3430
+ var [, s] = ie.first(t, r);
3431
3431
  r = s;
3432
3432
  } else if (i === "end") {
3433
- var [, o] = ae.last(t, r);
3433
+ var [, o] = ie.last(t, r);
3434
3434
  r = o;
3435
3435
  }
3436
3436
  }
3437
- return R.isRange(r) && (i === "start" ? r = R.start(r) : i === "end" ? r = R.end(r) : r = C.common(r.anchor.path, r.focus.path)), Oe.isPoint(r) && (r = r.path), a != null && (r = r.slice(0, a)), r;
3437
+ return N.isRange(r) && (i === "start" ? r = N.start(r) : i === "end" ? r = N.end(r) : r = C.common(r.anchor.path, r.focus.path)), Oe.isPoint(r) && (r = r.path), a != null && (r = r.slice(0, a)), r;
3438
3438
  }, rd = function(t, r) {
3439
3439
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, {
3440
3440
  affinity: a = "forward"
@@ -3459,13 +3459,13 @@ var Jf = function(t) {
3459
3459
  if (C.isPath(r)) {
3460
3460
  var i;
3461
3461
  if (a === "end") {
3462
- var [, s] = ae.last(t, r);
3462
+ var [, s] = ie.last(t, r);
3463
3463
  i = s;
3464
3464
  } else {
3465
- var [, o] = ae.first(t, r);
3465
+ var [, o] = ie.first(t, r);
3466
3466
  i = o;
3467
3467
  }
3468
- var l = ae.get(t, i);
3468
+ var l = ie.get(t, i);
3469
3469
  if (!he.isText(l))
3470
3470
  throw new Error("Cannot get the ".concat(a, " point in the node at path [").concat(r, "] because it has no ").concat(a, " text node."));
3471
3471
  return {
@@ -3473,8 +3473,8 @@ var Jf = function(t) {
3473
3473
  offset: a === "end" ? l.text.length : 0
3474
3474
  };
3475
3475
  }
3476
- if (R.isRange(r)) {
3477
- var [u, f] = R.edges(r);
3476
+ if (N.isRange(r)) {
3477
+ var [u, f] = N.edges(r);
3478
3478
  return a === "start" ? u : f;
3479
3479
  }
3480
3480
  return r;
@@ -3491,7 +3491,7 @@ function id(e) {
3491
3491
  } = t;
3492
3492
  if (!r)
3493
3493
  return;
3494
- var o = d.range(e, r), [l, u] = R.edges(o), f = a ? u : l, h = !1, p = "", g = 0, v = 0, D = 0;
3494
+ var o = d.range(e, r), [l, u] = N.edges(o), f = a ? u : l, h = !1, p = "", g = 0, v = 0, D = 0;
3495
3495
  for (var [c, E] of d.nodes(e, {
3496
3496
  at: r,
3497
3497
  reverse: a,
@@ -3535,8 +3535,8 @@ function id(e) {
3535
3535
  }
3536
3536
  }
3537
3537
  }
3538
- function T(S, A, z) {
3539
- return A === "character" ? Ri(S, z) : A === "word" ? zc(S, z) : A === "line" || A === "block" ? S.length : 1;
3538
+ function T(S, A, I) {
3539
+ return A === "character" ? Ri(S, I) : A === "word" ? zc(S, I) : A === "line" || A === "block" ? S.length : 1;
3540
3540
  }
3541
3541
  })();
3542
3542
  }
@@ -3590,7 +3590,7 @@ var sd = function(t) {
3590
3590
  var t = Cs.get(e);
3591
3591
  return t || (t = /* @__PURE__ */ new Set(), Cs.set(e, t)), t;
3592
3592
  }, ld = (e, t, r) => {
3593
- if (R.isRange(t) && !r)
3593
+ if (N.isRange(t) && !r)
3594
3594
  return t;
3595
3595
  var n = d.start(e, t), a = d.end(e, r || t);
3596
3596
  return {
@@ -3629,7 +3629,7 @@ var fd = (e, t) => {
3629
3629
  return !1;
3630
3630
  var [p, g] = d.parent(e, h);
3631
3631
  return !e.isVoid(p) || e.markableVoid(p);
3632
- }, a = R.isExpanded(r), i = !1;
3632
+ }, a = N.isExpanded(r), i = !1;
3633
3633
  if (!a) {
3634
3634
  var [s, o] = d.node(e, r);
3635
3635
  if (s && n(s, o)) {
@@ -3655,7 +3655,7 @@ var fd = (e, t) => {
3655
3655
  }), pd = function(t, r) {
3656
3656
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, {
3657
3657
  voids: a = !1
3658
- } = n, i = d.range(t, r), [s, o] = R.edges(i), l = "";
3658
+ } = n, i = d.range(t, r), [s, o] = N.edges(i), l = "";
3659
3659
  for (var [u, f] of d.nodes(t, {
3660
3660
  at: i,
3661
3661
  match: he.isText,
@@ -3668,8 +3668,8 @@ var fd = (e, t) => {
3668
3668
  }, gd = function(t, r) {
3669
3669
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, {
3670
3670
  voids: a = !1
3671
- } = n, [i, s] = R.edges(r);
3672
- if (i.offset !== 0 || s.offset !== 0 || R.isCollapsed(r) || C.hasPrevious(s.path))
3671
+ } = n, [i, s] = N.edges(r);
3672
+ if (i.offset !== 0 || s.offset !== 0 || N.isCollapsed(r) || C.hasPrevious(s.path))
3673
3673
  return r;
3674
3674
  var o = d.above(t, {
3675
3675
  at: s,
@@ -3727,7 +3727,7 @@ var fd = (e, t) => {
3727
3727
  } = r;
3728
3728
  if (u) {
3729
3729
  var h = !1;
3730
- if (R.isRange(u) && R.isCollapsed(u) && (h = !0, u = u.anchor), Oe.isPoint(u)) {
3730
+ if (N.isRange(u) && N.isCollapsed(u) && (h = !0, u = u.anchor), Oe.isPoint(u)) {
3731
3731
  var p = d.void(t, {
3732
3732
  at: u,
3733
3733
  mode: "highest"
@@ -3753,14 +3753,14 @@ var fd = (e, t) => {
3753
3753
  });
3754
3754
  return;
3755
3755
  }
3756
- if (!R.isCollapsed(u)) {
3756
+ if (!N.isCollapsed(u)) {
3757
3757
  if (!f) {
3758
- var [, c] = R.edges(u), E = d.end(t, []);
3758
+ var [, c] = N.edges(u), E = d.end(t, []);
3759
3759
  Oe.equals(c, E) || (u = d.unhangRange(t, u, {
3760
3760
  voids: l
3761
3761
  }));
3762
3762
  }
3763
- var [B, F] = R.edges(u), w = d.above(t, {
3763
+ var [B, F] = N.edges(u), w = d.above(t, {
3764
3764
  match: (me) => pe.isElement(me) && d.isBlock(t, me),
3765
3765
  at: B,
3766
3766
  voids: l
@@ -3768,7 +3768,7 @@ var fd = (e, t) => {
3768
3768
  match: (me) => pe.isElement(me) && d.isBlock(t, me),
3769
3769
  at: F,
3770
3770
  voids: l
3771
- }), S = w && T && !C.equals(w[1], T[1]), A = C.equals(B.path, F.path), z = l ? null : (n = d.void(t, {
3771
+ }), S = w && T && !C.equals(w[1], T[1]), A = C.equals(B.path, F.path), I = l ? null : (n = d.void(t, {
3772
3772
  at: B,
3773
3773
  mode: "highest"
3774
3774
  })) !== null && n !== void 0 ? n : d.elementReadOnly(t, {
@@ -3781,7 +3781,7 @@ var fd = (e, t) => {
3781
3781
  at: F,
3782
3782
  mode: "highest"
3783
3783
  });
3784
- if (z) {
3784
+ if (I) {
3785
3785
  var G = d.before(t, B);
3786
3786
  G && w && C.isAncestor(w[1], G.path) && (B = G);
3787
3787
  }
@@ -3789,19 +3789,19 @@ var fd = (e, t) => {
3789
3789
  var L = d.after(t, F);
3790
3790
  L && T && C.isAncestor(T[1], L.path) && (F = L);
3791
3791
  }
3792
- var N = [], I;
3792
+ var M = [], z;
3793
3793
  for (var O of d.nodes(t, {
3794
3794
  at: u,
3795
3795
  voids: l
3796
3796
  })) {
3797
3797
  var [k, P] = O;
3798
- I && C.compare(P, I) === 0 || (!l && pe.isElement(k) && (d.isVoid(t, k) || d.isElementReadOnly(t, k)) || !C.isCommon(P, B.path) && !C.isCommon(P, F.path)) && (N.push(O), I = P);
3798
+ z && C.compare(P, z) === 0 || (!l && pe.isElement(k) && (d.isVoid(t, k) || d.isElementReadOnly(t, k)) || !C.isCommon(P, B.path) && !C.isCommon(P, F.path)) && (M.push(O), z = P);
3799
3799
  }
3800
- var $ = Array.from(N, (me) => {
3800
+ var $ = Array.from(M, (me) => {
3801
3801
  var [, Ce] = me;
3802
3802
  return d.pathRef(t, Ce);
3803
3803
  }), U = d.pointRef(t, B), Y = d.pointRef(t, F), Z = "";
3804
- if (!A && !z) {
3804
+ if (!A && !I) {
3805
3805
  var q = U.current, [ee] = d.leaf(t, q), {
3806
3806
  path: se
3807
3807
  } = q, {
@@ -3849,13 +3849,13 @@ var fd = (e, t) => {
3849
3849
  batchDirty: o = !0
3850
3850
  } = n;
3851
3851
  if (r.length) {
3852
- if (R.isRange(s))
3852
+ if (N.isRange(s))
3853
3853
  if (a || (s = d.unhangRange(t, s, {
3854
3854
  voids: i
3855
- })), R.isCollapsed(s))
3855
+ })), N.isCollapsed(s))
3856
3856
  s = s.anchor;
3857
3857
  else {
3858
- var [, l] = R.edges(s);
3858
+ var [, l] = N.edges(s);
3859
3859
  if (!i && d.void(t, {
3860
3860
  at: l
3861
3861
  }))
@@ -3889,34 +3889,34 @@ var fd = (e, t) => {
3889
3889
  match: (le) => pe.isElement(le) && d.isBlock(t, le),
3890
3890
  at: s,
3891
3891
  voids: i
3892
- }), [, D] = v, c = d.isStart(t, s, D), E = d.isEnd(t, s, D), B = c && E, F = !c || c && E, w = !E, [, T] = ae.first({
3892
+ }), [, D] = v, c = d.isStart(t, s, D), E = d.isEnd(t, s, D), B = c && E, F = !c || c && E, w = !E, [, T] = ie.first({
3893
3893
  children: r
3894
- }, []), [, S] = ae.last({
3894
+ }, []), [, S] = ie.last({
3895
3895
  children: r
3896
- }, []), A = [], z = (le) => {
3896
+ }, []), A = [], I = (le) => {
3897
3897
  var [x, J] = le, H = J.length === 0;
3898
3898
  return H ? !1 : B ? !0 : !(F && C.isAncestor(J, T) && pe.isElement(x) && !t.isVoid(x) && !t.isInline(x) || w && C.isAncestor(J, S) && pe.isElement(x) && !t.isVoid(x) && !t.isInline(x));
3899
3899
  };
3900
- for (var K of ae.nodes({
3900
+ for (var K of ie.nodes({
3901
3901
  children: r
3902
3902
  }, {
3903
- pass: z
3903
+ pass: I
3904
3904
  }))
3905
- z(K) && A.push(K);
3906
- var G = [], L = [], N = [], I = !0, O = !1;
3905
+ I(K) && A.push(K);
3906
+ var G = [], L = [], M = [], z = !0, O = !1;
3907
3907
  for (var [k] of A)
3908
- pe.isElement(k) && !t.isInline(k) ? (I = !1, O = !0, L.push(k)) : I ? G.push(k) : N.push(k);
3908
+ pe.isElement(k) && !t.isInline(k) ? (z = !1, O = !0, L.push(k)) : z ? G.push(k) : M.push(k);
3909
3909
  var [P] = d.nodes(t, {
3910
3910
  at: s,
3911
3911
  match: (le) => he.isText(le) || d.isInline(t, le),
3912
3912
  mode: "highest",
3913
3913
  voids: i
3914
- }), [, $] = P, U = d.isStart(t, s, $), Y = d.isEnd(t, s, $), Z = d.pathRef(t, E && !N.length ? C.next(D) : D), q = d.pathRef(t, Y ? C.next($) : $);
3914
+ }), [, $] = P, U = d.isStart(t, s, $), Y = d.isEnd(t, s, $), Z = d.pathRef(t, E && !M.length ? C.next(D) : D), q = d.pathRef(t, Y ? C.next($) : $);
3915
3915
  Q.splitNodes(t, {
3916
3916
  at: s,
3917
3917
  match: (le) => O ? pe.isElement(le) && d.isBlock(t, le) : he.isText(le) || d.isInline(t, le),
3918
3918
  mode: O ? "lowest" : "highest",
3919
- always: O && (!c || G.length > 0) && (!E || N.length > 0),
3919
+ always: O && (!c || G.length > 0) && (!E || M.length > 0),
3920
3920
  voids: i
3921
3921
  });
3922
3922
  var ee = d.pathRef(t, !U || U && Y ? C.next($) : $);
@@ -3926,7 +3926,7 @@ var fd = (e, t) => {
3926
3926
  mode: "highest",
3927
3927
  voids: i,
3928
3928
  batchDirty: o
3929
- }), B && !G.length && L.length && !N.length && Q.delete(t, {
3929
+ }), B && !G.length && L.length && !M.length && Q.delete(t, {
3930
3930
  at: D,
3931
3931
  voids: i
3932
3932
  }), Q.insertNodes(t, L, {
@@ -3935,7 +3935,7 @@ var fd = (e, t) => {
3935
3935
  mode: "lowest",
3936
3936
  voids: i,
3937
3937
  batchDirty: o
3938
- }), Q.insertNodes(t, N, {
3938
+ }), Q.insertNodes(t, M, {
3939
3939
  at: q.current,
3940
3940
  match: (le) => he.isText(le) || d.isInline(t, le),
3941
3941
  mode: "highest",
@@ -3943,7 +3943,7 @@ var fd = (e, t) => {
3943
3943
  batchDirty: o
3944
3944
  }), !n.at) {
3945
3945
  var se;
3946
- if (N.length > 0 && q.current ? se = C.previous(q.current) : L.length > 0 && Z.current ? se = C.previous(Z.current) : ee.current && (se = C.previous(ee.current)), se) {
3946
+ if (M.length > 0 && q.current ? se = C.previous(q.current) : L.length > 0 && Z.current ? se = C.previous(Z.current) : ee.current && (se = C.previous(ee.current)), se) {
3947
3947
  var xe = d.end(t, se);
3948
3948
  Q.select(t, xe);
3949
3949
  }
@@ -3964,10 +3964,10 @@ var fd = (e, t) => {
3964
3964
  else if (n === "focus")
3965
3965
  Q.select(t, a.focus);
3966
3966
  else if (n === "start") {
3967
- var [i] = R.edges(a);
3967
+ var [i] = N.edges(a);
3968
3968
  Q.select(t, i);
3969
3969
  } else if (n === "end") {
3970
- var [, s] = R.edges(a);
3970
+ var [, s] = N.edges(a);
3971
3971
  Q.select(t, s);
3972
3972
  }
3973
3973
  } else return;
@@ -3991,7 +3991,7 @@ var fd = (e, t) => {
3991
3991
  edge: o = null
3992
3992
  } = r;
3993
3993
  if (n) {
3994
- o === "start" && (o = R.isBackward(n) ? "focus" : "anchor"), o === "end" && (o = R.isBackward(n) ? "anchor" : "focus");
3994
+ o === "start" && (o = N.isBackward(n) ? "focus" : "anchor"), o === "end" && (o = N.isBackward(n) ? "anchor" : "focus");
3995
3995
  var {
3996
3996
  anchor: l,
3997
3997
  focus: u
@@ -4018,7 +4018,7 @@ var fd = (e, t) => {
4018
4018
  Q.setSelection(e, t);
4019
4019
  return;
4020
4020
  }
4021
- if (!R.isRange(t))
4021
+ if (!N.isRange(t))
4022
4022
  throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(at.stringify(t)));
4023
4023
  e.apply({
4024
4024
  type: "set_selection",
@@ -4054,7 +4054,7 @@ var Ed = function(t, r) {
4054
4054
  edge: i = "both"
4055
4055
  } = n;
4056
4056
  if (a) {
4057
- i === "start" && (i = R.isBackward(a) ? "focus" : "anchor"), i === "end" && (i = R.isBackward(a) ? "anchor" : "focus");
4057
+ i === "start" && (i = N.isBackward(a) ? "focus" : "anchor"), i === "end" && (i = N.isBackward(a) ? "anchor" : "focus");
4058
4058
  var {
4059
4059
  anchor: s,
4060
4060
  focus: o
@@ -4089,15 +4089,15 @@ var Ed = function(t, r) {
4089
4089
  match: u,
4090
4090
  select: f
4091
4091
  } = n;
4092
- if (ae.isNode(r) && (r = [r]), r.length !== 0) {
4092
+ if (ie.isNode(r) && (r = [r]), r.length !== 0) {
4093
4093
  var [h] = r;
4094
- if (l || (l = Pi(t), f !== !1 && (f = !0)), f == null && (f = !1), R.isRange(l))
4094
+ if (l || (l = Pi(t), f !== !1 && (f = !0)), f == null && (f = !1), N.isRange(l))
4095
4095
  if (a || (l = d.unhangRange(t, l, {
4096
4096
  voids: i
4097
- })), R.isCollapsed(l))
4097
+ })), N.isCollapsed(l))
4098
4098
  l = l.anchor;
4099
4099
  else {
4100
- var [, p] = R.edges(l), g = d.pointRef(t, p);
4100
+ var [, p] = N.edges(l), g = d.pointRef(t, p);
4101
4101
  Q.delete(t, {
4102
4102
  at: l
4103
4103
  }), l = g.unref();
@@ -4131,35 +4131,35 @@ var Ed = function(t, r) {
4131
4131
  var T = [], S = C.levels(F);
4132
4132
  uf(t, () => {
4133
4133
  var G = function() {
4134
- var I = F.concat(w);
4134
+ var z = F.concat(w);
4135
4135
  w++;
4136
4136
  var O = {
4137
4137
  type: "insert_node",
4138
- path: I,
4138
+ path: z,
4139
4139
  node: L
4140
4140
  };
4141
- t.apply(O), l = C.next(l), T.push(O), he.isText ? S.push(...Array.from(ae.nodes(L), (k) => {
4141
+ t.apply(O), l = C.next(l), T.push(O), he.isText ? S.push(...Array.from(ie.nodes(L), (k) => {
4142
4142
  var [, P] = k;
4143
- return I.concat(P);
4144
- })) : S.push(I);
4143
+ return z.concat(P);
4144
+ })) : S.push(z);
4145
4145
  };
4146
4146
  for (var L of r)
4147
4147
  G();
4148
4148
  }, () => {
4149
4149
  Bu(t, S, (G) => {
4150
4150
  var L = G;
4151
- for (var N of T)
4152
- if (C.operationCanTransformPath(N) && (L = C.transform(L, N), !L))
4151
+ for (var M of T)
4152
+ if (C.operationCanTransformPath(M) && (L = C.transform(L, M), !L))
4153
4153
  return null;
4154
4154
  return L;
4155
4155
  });
4156
4156
  });
4157
4157
  } else
4158
4158
  for (var A of r) {
4159
- var z = F.concat(w);
4159
+ var I = F.concat(w);
4160
4160
  w++, t.apply({
4161
4161
  type: "insert_node",
4162
- path: z,
4162
+ path: I,
4163
4163
  node: A
4164
4164
  }), l = C.next(l);
4165
4165
  }
@@ -4257,13 +4257,13 @@ var Ed = function(t, r) {
4257
4257
  n = (G) => l.children.includes(G);
4258
4258
  } else
4259
4259
  n = (G) => pe.isElement(G) && d.isBlock(t, G);
4260
- if (!i && R.isRange(a) && (a = d.unhangRange(t, a, {
4260
+ if (!i && N.isRange(a) && (a = d.unhangRange(t, a, {
4261
4261
  voids: s
4262
- })), R.isRange(a))
4263
- if (R.isCollapsed(a))
4262
+ })), N.isRange(a))
4263
+ if (N.isCollapsed(a))
4264
4264
  a = a.anchor;
4265
4265
  else {
4266
- var [, u] = R.edges(a), f = d.pointRef(t, u);
4266
+ var [, u] = N.edges(a), f = d.pointRef(t, u);
4267
4267
  Q.delete(t, {
4268
4268
  at: a
4269
4269
  }), a = f.unref(), r.at == null && Q.select(t, a);
@@ -4291,13 +4291,13 @@ var Ed = function(t, r) {
4291
4291
  at: v,
4292
4292
  mode: "highest",
4293
4293
  match: (G) => w.includes(G) && Au(t, G)
4294
- }), S = T && d.pathRef(t, T[1]), A, z;
4294
+ }), S = T && d.pathRef(t, T[1]), A, I;
4295
4295
  if (he.isText(g) && he.isText(D)) {
4296
4296
  var K = Vt(g, kd);
4297
- z = D.text.length, A = K;
4297
+ I = D.text.length, A = K;
4298
4298
  } else if (pe.isElement(g) && pe.isElement(D)) {
4299
4299
  var K = Vt(g, Sd);
4300
- z = D.children.length, A = K;
4300
+ I = D.children.length, A = K;
4301
4301
  } else
4302
4302
  throw new Error("Cannot merge the node at path [".concat(v, "] with the previous sibling because it is not the same kind: ").concat(at.stringify(g), " ").concat(at.stringify(D)));
4303
4303
  F || Q.moveNodes(t, {
@@ -4313,7 +4313,7 @@ var Ed = function(t, r) {
4313
4313
  }) : t.apply({
4314
4314
  type: "merge_node",
4315
4315
  path: E,
4316
- position: z,
4316
+ position: I,
4317
4317
  properties: A
4318
4318
  }), S && S.unref();
4319
4319
  }
@@ -4364,7 +4364,7 @@ var Ed = function(t, r) {
4364
4364
  match: o
4365
4365
  } = r;
4366
4366
  if (s) {
4367
- o == null && (o = C.isPath(s) ? Ir(t, s) : (g) => pe.isElement(g) && d.isBlock(t, g)), !n && R.isRange(s) && (s = d.unhangRange(t, s, {
4367
+ o == null && (o = C.isPath(s) ? Ir(t, s) : (g) => pe.isElement(g) && d.isBlock(t, g)), !n && N.isRange(s) && (s = d.unhangRange(t, s, {
4368
4368
  voids: a
4369
4369
  }));
4370
4370
  var l = d.nodes(t, {
@@ -4404,14 +4404,14 @@ var Ed = function(t, r) {
4404
4404
  voids: h = !1
4405
4405
  } = n;
4406
4406
  if (i) {
4407
- if (a == null && (a = C.isPath(i) ? Ir(t, i) : (z) => pe.isElement(z) && d.isBlock(t, z)), !l && R.isRange(i) && (i = d.unhangRange(t, i, {
4407
+ if (a == null && (a = C.isPath(i) ? Ir(t, i) : (I) => pe.isElement(I) && d.isBlock(t, I)), !l && N.isRange(i) && (i = d.unhangRange(t, i, {
4408
4408
  voids: h
4409
- })), f && R.isRange(i)) {
4410
- if (R.isCollapsed(i) && d.leaf(t, i.anchor)[0].text.length > 0)
4409
+ })), f && N.isRange(i)) {
4410
+ if (N.isCollapsed(i) && d.leaf(t, i.anchor)[0].text.length > 0)
4411
4411
  return;
4412
4412
  var p = d.rangeRef(t, i, {
4413
4413
  affinity: "inward"
4414
- }), [g, v] = R.edges(i), D = u === "lowest" ? "lowest" : "highest", c = d.isEnd(t, v, v.path);
4414
+ }), [g, v] = N.edges(i), D = u === "lowest" ? "lowest" : "highest", c = d.isEnd(t, v, v.path);
4415
4415
  Q.splitNodes(t, {
4416
4416
  at: v,
4417
4417
  match: a,
@@ -4428,7 +4428,7 @@ var Ed = function(t, r) {
4428
4428
  always: !E
4429
4429
  }), i = p.unref(), n.at == null && Q.select(t, i);
4430
4430
  }
4431
- s || (s = (z, K) => z !== K);
4431
+ s || (s = (I, K) => I !== K);
4432
4432
  for (var [B, F] of d.nodes(t, {
4433
4433
  at: i,
4434
4434
  match: a,
@@ -4451,9 +4451,9 @@ var Ed = function(t, r) {
4451
4451
  }
4452
4452
  });
4453
4453
  }, Pd = (e, t) => {
4454
- if (R.isCollapsed(t))
4454
+ if (N.isCollapsed(t))
4455
4455
  return t.anchor;
4456
- var [, r] = R.edges(t), n = d.pointRef(e, r);
4456
+ var [, r] = N.edges(t), n = d.pointRef(e, r);
4457
4457
  return Q.delete(e, {
4458
4458
  at: t
4459
4459
  }), n.unref();
@@ -4469,7 +4469,7 @@ var Ed = function(t, r) {
4469
4469
  height: o = 0,
4470
4470
  always: l = !1
4471
4471
  } = r;
4472
- if (i == null && (i = (Y) => pe.isElement(Y) && d.isBlock(t, Y)), R.isRange(s) && (s = Pd(t, s)), C.isPath(s)) {
4472
+ if (i == null && (i = (Y) => pe.isElement(Y) && d.isBlock(t, Y)), N.isRange(s) && (s = Pd(t, s)), C.isPath(s)) {
4473
4473
  var u = s, f = d.point(t, u), [h] = d.parent(t, u);
4474
4474
  i = (Y) => Y === h, o = f.path.length - u.length + 1, s = f, l = !0;
4475
4475
  }
@@ -4509,27 +4509,27 @@ var Ed = function(t, r) {
4509
4509
  o = S + 1, l = !0;
4510
4510
  }
4511
4511
  g = d.pointRef(t, s);
4512
- var A = s.path.length - o, [, z] = v, K = s.path.slice(0, A), G = o === 0 ? s.offset : s.path[A] + c;
4513
- for (var [L, N] of d.levels(t, {
4512
+ var A = s.path.length - o, [, I] = v, K = s.path.slice(0, A), G = o === 0 ? s.offset : s.path[A] + c;
4513
+ for (var [L, M] of d.levels(t, {
4514
4514
  at: K,
4515
4515
  reverse: !0,
4516
4516
  voids: a
4517
4517
  })) {
4518
- var I = !1;
4519
- if (N.length < z.length || N.length === 0 || !a && pe.isElement(L) && d.isVoid(t, L))
4518
+ var z = !1;
4519
+ if (M.length < I.length || M.length === 0 || !a && pe.isElement(L) && d.isVoid(t, L))
4520
4520
  break;
4521
- var O = p.current, k = d.isEnd(t, O, N);
4522
- if (l || !p || !d.isEdge(t, O, N)) {
4523
- I = !0;
4524
- var P = ae.extractProps(L);
4521
+ var O = p.current, k = d.isEnd(t, O, M);
4522
+ if (l || !p || !d.isEdge(t, O, M)) {
4523
+ z = !0;
4524
+ var P = ie.extractProps(L);
4525
4525
  t.apply({
4526
4526
  type: "split_node",
4527
- path: N,
4527
+ path: M,
4528
4528
  position: G,
4529
4529
  properties: P
4530
4530
  });
4531
4531
  }
4532
- G = N[N.length - 1] + (I || k ? 1 : 0);
4532
+ G = M[M.length - 1] + (z || k ? 1 : 0);
4533
4533
  }
4534
4534
  if (r.at == null) {
4535
4535
  var $ = g.current || d.end(t, []);
@@ -4561,7 +4561,7 @@ var Ed = function(t, r) {
4561
4561
  } = r;
4562
4562
  if (s) {
4563
4563
  o == null && (o = C.isPath(s) ? Ir(t, s) : (g) => pe.isElement(g) && d.isBlock(t, g)), C.isPath(s) && (s = d.range(t, s));
4564
- var l = R.isRange(s) ? d.rangeRef(t, s) : null, u = d.nodes(t, {
4564
+ var l = N.isRange(s) ? d.rangeRef(t, s) : null, u = d.nodes(t, {
4565
4565
  at: s,
4566
4566
  match: o,
4567
4567
  mode: n,
@@ -4577,7 +4577,7 @@ var Ed = function(t, r) {
4577
4577
  // that wrap target node. So we reverse the order.
4578
4578
  ).reverse(), h = function() {
4579
4579
  var v = p.unref(), [D] = d.node(t, v), c = d.range(t, v);
4580
- a && l && (c = R.intersection(l.current, c)), Q.liftNodes(t, {
4580
+ a && l && (c = N.intersection(l.current, c)), Q.liftNodes(t, {
4581
4581
  at: c,
4582
4582
  match: (E) => pe.isAncestor(D) && D.children.includes(E),
4583
4583
  voids: i
@@ -4622,8 +4622,8 @@ var Id = function(t, r) {
4622
4622
  at: l = t.selection
4623
4623
  } = n;
4624
4624
  if (l) {
4625
- if (o == null && (C.isPath(l) ? o = Ir(t, l) : t.isInline(r) ? o = (c) => pe.isElement(c) && d.isInline(t, c) || he.isText(c) : o = (c) => pe.isElement(c) && d.isBlock(t, c)), i && R.isRange(l)) {
4626
- var [u, f] = R.edges(l), h = d.rangeRef(t, l, {
4625
+ if (o == null && (C.isPath(l) ? o = Ir(t, l) : t.isInline(r) ? o = (c) => pe.isElement(c) && d.isInline(t, c) || he.isText(c) : o = (c) => pe.isElement(c) && d.isBlock(t, c)), i && N.isRange(l)) {
4626
+ var [u, f] = N.edges(l), h = d.rangeRef(t, l, {
4627
4627
  affinity: "inward"
4628
4628
  });
4629
4629
  Q.splitNodes(t, {
@@ -4642,7 +4642,7 @@ var Id = function(t, r) {
4642
4642
  mode: "lowest",
4643
4643
  voids: s
4644
4644
  })), g = function() {
4645
- var E = R.isRange(l) ? R.intersection(l, d.range(t, D)) : l;
4645
+ var E = N.isRange(l) ? N.intersection(l, d.range(t, D)) : l;
4646
4646
  if (!E)
4647
4647
  return 0;
4648
4648
  var B = Array.from(d.nodes(t, {
@@ -4655,16 +4655,16 @@ var Id = function(t, r) {
4655
4655
  var [F] = B, w = B[B.length - 1], [, T] = F, [, S] = w;
4656
4656
  if (T.length === 0 && S.length === 0)
4657
4657
  return 0;
4658
- var A = C.equals(T, S) ? C.parent(T) : C.common(T, S), z = d.range(t, T, S), K = d.node(t, A), [G] = K, L = A.length + 1, N = C.next(S.slice(0, L)), I = Gs(Gs({}, r), {}, {
4658
+ var A = C.equals(T, S) ? C.parent(T) : C.common(T, S), I = d.range(t, T, S), K = d.node(t, A), [G] = K, L = A.length + 1, M = C.next(S.slice(0, L)), z = Gs(Gs({}, r), {}, {
4659
4659
  children: []
4660
4660
  });
4661
- Q.insertNodes(t, I, {
4662
- at: N,
4661
+ Q.insertNodes(t, z, {
4662
+ at: M,
4663
4663
  voids: s
4664
4664
  }), Q.moveNodes(t, {
4665
- at: z,
4665
+ at: I,
4666
4666
  match: (O) => pe.isAncestor(G) && G.children.includes(O),
4667
- to: N.concat(0),
4667
+ to: M.concat(0),
4668
4668
  voids: s
4669
4669
  });
4670
4670
  }
@@ -5238,29 +5238,29 @@ function Ou() {
5238
5238
  if (typeof o != "function")
5239
5239
  throw new TypeError(n);
5240
5240
  l = r(l) || 0, e(u) && (E = !!u.leading, B = "maxWait" in u, p = B ? a(r(u.maxWait) || 0, l) : p, F = "trailing" in u ? !!u.trailing : F);
5241
- function w(I) {
5241
+ function w(z) {
5242
5242
  var O = f, k = h;
5243
- return f = h = void 0, c = I, g = o.apply(k, O), g;
5243
+ return f = h = void 0, c = z, g = o.apply(k, O), g;
5244
5244
  }
5245
- function T(I) {
5246
- return c = I, v = setTimeout(z, l), E ? w(I) : g;
5245
+ function T(z) {
5246
+ return c = z, v = setTimeout(I, l), E ? w(z) : g;
5247
5247
  }
5248
- function S(I) {
5249
- var O = I - D, k = I - c, P = l - O;
5248
+ function S(z) {
5249
+ var O = z - D, k = z - c, P = l - O;
5250
5250
  return B ? i(P, p - k) : P;
5251
5251
  }
5252
- function A(I) {
5253
- var O = I - D, k = I - c;
5252
+ function A(z) {
5253
+ var O = z - D, k = z - c;
5254
5254
  return D === void 0 || O >= l || O < 0 || B && k >= p;
5255
5255
  }
5256
- function z() {
5257
- var I = t();
5258
- if (A(I))
5259
- return K(I);
5260
- v = setTimeout(z, S(I));
5256
+ function I() {
5257
+ var z = t();
5258
+ if (A(z))
5259
+ return K(z);
5260
+ v = setTimeout(I, S(z));
5261
5261
  }
5262
- function K(I) {
5263
- return v = void 0, F && f ? w(I) : (f = h = void 0, g);
5262
+ function K(z) {
5263
+ return v = void 0, F && f ? w(z) : (f = h = void 0, g);
5264
5264
  }
5265
5265
  function G() {
5266
5266
  v !== void 0 && clearTimeout(v), c = 0, f = D = h = v = void 0;
@@ -5268,17 +5268,17 @@ function Ou() {
5268
5268
  function L() {
5269
5269
  return v === void 0 ? g : K(t());
5270
5270
  }
5271
- function N() {
5272
- var I = t(), O = A(I);
5273
- if (f = arguments, h = this, D = I, O) {
5271
+ function M() {
5272
+ var z = t(), O = A(z);
5273
+ if (f = arguments, h = this, D = z, O) {
5274
5274
  if (v === void 0)
5275
5275
  return T(D);
5276
5276
  if (B)
5277
- return clearTimeout(v), v = setTimeout(z, l), w(D);
5277
+ return clearTimeout(v), v = setTimeout(I, l), w(D);
5278
5278
  }
5279
- return v === void 0 && (v = setTimeout(z, l)), g;
5279
+ return v === void 0 && (v = setTimeout(I, l)), g;
5280
5280
  }
5281
- return N.cancel = G, N.flush = L, N;
5281
+ return M.cancel = G, M.flush = L, M;
5282
5282
  }
5283
5283
  return _a = s, _a;
5284
5284
  }
@@ -5335,23 +5335,23 @@ const rh = /* @__PURE__ */ la(th), ho = (e) => typeof e == "object" && e != null
5335
5335
  }
5336
5336
  v != null && v === document.body && wn(v) && !wn(document.documentElement) || v != null && wn(v, f) && g.push(v);
5337
5337
  }
5338
- const D = (n = (r = window.visualViewport) == null ? void 0 : r.width) != null ? n : innerWidth, c = (i = (a = window.visualViewport) == null ? void 0 : a.height) != null ? i : innerHeight, { scrollX: E, scrollY: B } = window, { height: F, width: w, top: T, right: S, bottom: A, left: z } = e.getBoundingClientRect(), { top: K, right: G, bottom: L, left: N } = ((P) => {
5338
+ const D = (n = (r = window.visualViewport) == null ? void 0 : r.width) != null ? n : innerWidth, c = (i = (a = window.visualViewport) == null ? void 0 : a.height) != null ? i : innerHeight, { scrollX: E, scrollY: B } = window, { height: F, width: w, top: T, right: S, bottom: A, left: I } = e.getBoundingClientRect(), { top: K, right: G, bottom: L, left: M } = ((P) => {
5339
5339
  const $ = window.getComputedStyle(P);
5340
5340
  return { top: parseFloat($.scrollMarginTop) || 0, right: parseFloat($.scrollMarginRight) || 0, bottom: parseFloat($.scrollMarginBottom) || 0, left: parseFloat($.scrollMarginLeft) || 0 };
5341
5341
  })(e);
5342
- let I = o === "start" || o === "nearest" ? T - K : o === "end" ? A + L : T + F / 2 - K + L, O = l === "center" ? z + w / 2 - N + G : l === "end" ? S + G : z - N;
5342
+ let z = o === "start" || o === "nearest" ? T - K : o === "end" ? A + L : T + F / 2 - K + L, O = l === "center" ? I + w / 2 - M + G : l === "end" ? S + G : I - M;
5343
5343
  const k = [];
5344
5344
  for (let P = 0; P < g.length; P++) {
5345
5345
  const $ = g[P], { height: U, width: Y, top: Z, right: q, bottom: ee, left: se } = $.getBoundingClientRect();
5346
- if (s === "if-needed" && T >= 0 && z >= 0 && A <= c && S <= D && ($ === p && !wn($) || T >= Z && A <= ee && z >= se && S <= q)) return k;
5346
+ if (s === "if-needed" && T >= 0 && I >= 0 && A <= c && S <= D && ($ === p && !wn($) || T >= Z && A <= ee && I >= se && S <= q)) return k;
5347
5347
  const xe = getComputedStyle($), le = parseInt(xe.borderLeftWidth, 10), x = parseInt(xe.borderTopWidth, 10), J = parseInt(xe.borderRightWidth, 10), H = parseInt(xe.borderBottomWidth, 10);
5348
5348
  let V = 0, ne = 0;
5349
5349
  const te = "offsetWidth" in $ ? $.offsetWidth - $.clientWidth - le - J : 0, de = "offsetHeight" in $ ? $.offsetHeight - $.clientHeight - x - H : 0, we = "offsetWidth" in $ ? $.offsetWidth === 0 ? 0 : Y / $.offsetWidth : 0, me = "offsetHeight" in $ ? $.offsetHeight === 0 ? 0 : U / $.offsetHeight : 0;
5350
- if (p === $) V = o === "start" ? I : o === "end" ? I - c : o === "nearest" ? En(B, B + c, c, x, H, B + I, B + I + F, F) : I - c / 2, ne = l === "start" ? O : l === "center" ? O - D / 2 : l === "end" ? O - D : En(E, E + D, D, le, J, E + O, E + O + w, w), V = Math.max(0, V + B), ne = Math.max(0, ne + E);
5350
+ if (p === $) V = o === "start" ? z : o === "end" ? z - c : o === "nearest" ? En(B, B + c, c, x, H, B + z, B + z + F, F) : z - c / 2, ne = l === "start" ? O : l === "center" ? O - D / 2 : l === "end" ? O - D : En(E, E + D, D, le, J, E + O, E + O + w, w), V = Math.max(0, V + B), ne = Math.max(0, ne + E);
5351
5351
  else {
5352
- V = o === "start" ? I - Z - x : o === "end" ? I - ee + H + de : o === "nearest" ? En(Z, ee, U, x, H + de, I, I + F, F) : I - (Z + U / 2) + de / 2, ne = l === "start" ? O - se - le : l === "center" ? O - (se + Y / 2) + te / 2 : l === "end" ? O - q + J + te : En(se, q, Y, le, J + te, O, O + w, w);
5352
+ V = o === "start" ? z - Z - x : o === "end" ? z - ee + H + de : o === "nearest" ? En(Z, ee, U, x, H + de, z, z + F, F) : z - (Z + U / 2) + de / 2, ne = l === "start" ? O - se - le : l === "center" ? O - (se + Y / 2) + te / 2 : l === "end" ? O - q + J + te : En(se, q, Y, le, J + te, O, O + w, w);
5353
5353
  const { scrollLeft: Ce, scrollTop: Fe } = $;
5354
- V = me === 0 ? 0 : Math.max(0, Math.min(Fe + V / me, $.scrollHeight - U / me + de)), ne = we === 0 ? 0 : Math.max(0, Math.min(Ce + ne / we, $.scrollWidth - Y / we + te)), I += Fe - V, O += Ce - ne;
5354
+ V = me === 0 ? 0 : Math.max(0, Math.min(Fe + V / me, $.scrollHeight - U / me + de)), ne = we === 0 ? 0 : Math.max(0, Math.min(Ce + ne / we, $.scrollWidth - Y / we + te)), z += Fe - V, O += Ce - ne;
5355
5355
  }
5356
5356
  k.push({ el: $, top: V, left: ne });
5357
5357
  }
@@ -5455,13 +5455,13 @@ var lr = function(e) {
5455
5455
  return Bn.get(e);
5456
5456
  if ($u(e))
5457
5457
  return Bn.set(e, bo), bo;
5458
- var r = getComputedStyle(e), n = Ii(e) && e.ownerSVGElement && e.getBBox(), a = !dh && r.boxSizing === "border-box", i = fh.test(r.writingMode || ""), s = !n && Do.test(r.overflowY || ""), o = !n && Do.test(r.overflowX || ""), l = n ? 0 : Pt(r.paddingTop), u = n ? 0 : Pt(r.paddingRight), f = n ? 0 : Pt(r.paddingBottom), h = n ? 0 : Pt(r.paddingLeft), p = n ? 0 : Pt(r.borderTopWidth), g = n ? 0 : Pt(r.borderRightWidth), v = n ? 0 : Pt(r.borderBottomWidth), D = n ? 0 : Pt(r.borderLeftWidth), c = h + u, E = l + f, B = D + g, F = p + v, w = o ? e.offsetHeight - F - e.clientHeight : 0, T = s ? e.offsetWidth - B - e.clientWidth : 0, S = a ? c + B : 0, A = a ? E + F : 0, z = n ? n.width : Pt(r.width) - S - T, K = n ? n.height : Pt(r.height) - A - w, G = z + c + T + B, L = K + E + w + F, N = lr({
5459
- devicePixelContentBoxSize: kr(Math.round(z * devicePixelRatio), Math.round(K * devicePixelRatio), i),
5458
+ var r = getComputedStyle(e), n = Ii(e) && e.ownerSVGElement && e.getBBox(), a = !dh && r.boxSizing === "border-box", i = fh.test(r.writingMode || ""), s = !n && Do.test(r.overflowY || ""), o = !n && Do.test(r.overflowX || ""), l = n ? 0 : Pt(r.paddingTop), u = n ? 0 : Pt(r.paddingRight), f = n ? 0 : Pt(r.paddingBottom), h = n ? 0 : Pt(r.paddingLeft), p = n ? 0 : Pt(r.borderTopWidth), g = n ? 0 : Pt(r.borderRightWidth), v = n ? 0 : Pt(r.borderBottomWidth), D = n ? 0 : Pt(r.borderLeftWidth), c = h + u, E = l + f, B = D + g, F = p + v, w = o ? e.offsetHeight - F - e.clientHeight : 0, T = s ? e.offsetWidth - B - e.clientWidth : 0, S = a ? c + B : 0, A = a ? E + F : 0, I = n ? n.width : Pt(r.width) - S - T, K = n ? n.height : Pt(r.height) - A - w, G = I + c + T + B, L = K + E + w + F, M = lr({
5459
+ devicePixelContentBoxSize: kr(Math.round(I * devicePixelRatio), Math.round(K * devicePixelRatio), i),
5460
5460
  borderBoxSize: kr(G, L, i),
5461
- contentBoxSize: kr(z, K, i),
5462
- contentRect: new Tu(h, l, z, K)
5461
+ contentBoxSize: kr(I, K, i),
5462
+ contentRect: new Tu(h, l, I, K)
5463
5463
  });
5464
- return Bn.set(e, N), N;
5464
+ return Bn.set(e, M), M;
5465
5465
  }, Pu = function(e, t, r) {
5466
5466
  var n = ju(e, r), a = n.borderBoxSize, i = n.contentBoxSize, s = n.devicePixelContentBoxSize;
5467
5467
  switch (t) {
@@ -5755,15 +5755,15 @@ function Fh() {
5755
5755
  var F = !0, w = !1, T = void 0;
5756
5756
  try {
5757
5757
  for (var S = c[Symbol.iterator](), A; !(F = (A = S.next()).done); F = !0) {
5758
- var z = A.value, K = z.endsWith("?") && z.length > 1;
5759
- K && (z = z.slice(0, -1));
5760
- var G = h(z), L = t[G];
5761
- if (z.length > 1 && !L && !r[z] && !n[G])
5762
- throw new TypeError('Unknown modifier: "' + z + '"');
5763
- (E === 1 || !L) && (v ? D.key = G : D.which = f(z)), L && (D[L] = K ? null : !0);
5764
- }
5765
- } catch (N) {
5766
- w = !0, T = N;
5758
+ var I = A.value, K = I.endsWith("?") && I.length > 1;
5759
+ K && (I = I.slice(0, -1));
5760
+ var G = h(I), L = t[G];
5761
+ if (I.length > 1 && !L && !r[I] && !n[G])
5762
+ throw new TypeError('Unknown modifier: "' + I + '"');
5763
+ (E === 1 || !L) && (v ? D.key = G : D.which = f(I)), L && (D[L] = K ? null : !0);
5764
+ }
5765
+ } catch (M) {
5766
+ w = !0, T = M;
5767
5767
  } finally {
5768
5768
  try {
5769
5769
  !F && S.return && S.return();
@@ -5914,9 +5914,9 @@ typeof globalThis.InputEvent.prototype.getTargetRanges == "function", Sr = /* @_
5914
5914
  return !1;
5915
5915
  var {
5916
5916
  document: a
5917
- } = _.getWindow(e);
5917
+ } = W.getWindow(e);
5918
5918
  if (a.contains(n))
5919
- return _.hasDOMNode(e, n, {
5919
+ return W.hasDOMNode(e, n, {
5920
5920
  editable: !0
5921
5921
  });
5922
5922
  var i = r.find((s) => {
@@ -5944,24 +5944,24 @@ class Yh {
5944
5944
  Bt(this, "id", void 0), this.id = "".concat(Kh++);
5945
5945
  }
5946
5946
  }
5947
- var _ = {
5947
+ var W = {
5948
5948
  androidPendingDiffs: (e) => Dt.get(e),
5949
5949
  androidScheduleFlush: (e) => {
5950
5950
  var t;
5951
5951
  (t = Wi.get(e)) === null || t === void 0 || t();
5952
5952
  },
5953
5953
  blur: (e) => {
5954
- var t = _.toDOMNode(e, e), r = _.findDocumentOrShadowRoot(e);
5954
+ var t = W.toDOMNode(e, e), r = W.findDocumentOrShadowRoot(e);
5955
5955
  Xt.set(e, !1), r.activeElement === t && t.blur();
5956
5956
  },
5957
5957
  deselect: (e) => {
5958
5958
  var {
5959
5959
  selection: t
5960
- } = e, r = _.findDocumentOrShadowRoot(e), n = Qr(r);
5960
+ } = e, r = W.findDocumentOrShadowRoot(e), n = Qr(r);
5961
5961
  n && n.rangeCount > 0 && n.removeAllRanges(), t && Q.deselect(e);
5962
5962
  },
5963
5963
  findDocumentOrShadowRoot: (e) => {
5964
- var t = _.toDOMNode(e, e), r = t.getRootNode();
5964
+ var t = W.toDOMNode(e, e), r = t.getRootNode();
5965
5965
  return r instanceof Document || r instanceof ShadowRoot ? r : t.ownerDocument;
5966
5966
  },
5967
5967
  findEventRange: (e, t) => {
@@ -5973,7 +5973,7 @@ var _ = {
5973
5973
  } = t;
5974
5974
  if (r == null || n == null)
5975
5975
  throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));
5976
- var i = _.toSlateNode(e, t.target), s = _.findPath(e, i);
5976
+ var i = W.toSlateNode(e, t.target), s = W.findPath(e, i);
5977
5977
  if (pe.isElement(i) && d.isVoid(e, i)) {
5978
5978
  var o = a.getBoundingClientRect(), l = e.isInline(i) ? r - o.left < o.left + o.width - r : n - o.top < o.top + o.height - n, u = d.point(e, s, {
5979
5979
  edge: l ? "start" : "end"
@@ -5985,7 +5985,7 @@ var _ = {
5985
5985
  }
5986
5986
  var p, {
5987
5987
  document: g
5988
- } = _.getWindow(e);
5988
+ } = W.getWindow(e);
5989
5989
  if (g.caretRangeFromPoint)
5990
5990
  p = g.caretRangeFromPoint(r, n);
5991
5991
  else {
@@ -5994,7 +5994,7 @@ var _ = {
5994
5994
  }
5995
5995
  if (!p)
5996
5996
  throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));
5997
- var D = _.toSlateRange(e, p, {
5997
+ var D = W.toSlateRange(e, p, {
5998
5998
  exactMatch: !1,
5999
5999
  suppressThrow: !1
6000
6000
  });
@@ -6028,16 +6028,16 @@ var _ = {
6028
6028
  throw new Error("Could not set focus, editor seems stuck with pending operations");
6029
6029
  if (t.operations.length > 0) {
6030
6030
  setTimeout(() => {
6031
- _.focus(t, {
6031
+ W.focus(t, {
6032
6032
  retries: r.retries - 1
6033
6033
  });
6034
6034
  }, 10);
6035
6035
  return;
6036
6036
  }
6037
- var n = _.toDOMNode(t, t), a = _.findDocumentOrShadowRoot(t);
6037
+ var n = W.toDOMNode(t, t), a = W.findDocumentOrShadowRoot(t);
6038
6038
  if (a.activeElement !== n) {
6039
6039
  if (t.selection && a instanceof Document) {
6040
- var i = Qr(a), s = _.toDOMRange(t, t.selection);
6040
+ var i = Qr(a), s = W.toDOMRange(t, t.selection);
6041
6041
  i?.removeAllRanges(), i?.addRange(s);
6042
6042
  }
6043
6043
  t.selection || Q.select(t, d.start(t, [])), Xt.set(t, !0), n.focus({
@@ -6055,7 +6055,7 @@ var _ = {
6055
6055
  hasDOMNode: function(t, r) {
6056
6056
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, {
6057
6057
  editable: a = !1
6058
- } = n, i = _.toDOMNode(t, t), s;
6058
+ } = n, i = W.toDOMNode(t, t), s;
6059
6059
  try {
6060
6060
  s = Et(r) ? r : r.parentElement;
6061
6061
  } catch (o) {
@@ -6066,7 +6066,7 @@ var _ = {
6066
6066
  // this is the core logic that lets you know you got the right editor.selection instead of null when editor is contenteditable="false"(readOnly)
6067
6067
  s.closest('[contenteditable="false"]') === i || !!s.getAttribute("data-slate-zero-width")) : !1;
6068
6068
  },
6069
- hasEditableTarget: (e, t) => Qt(t) && _.hasDOMNode(e, t, {
6069
+ hasEditableTarget: (e, t) => Qt(t) && W.hasDOMNode(e, t, {
6070
6070
  editable: !0
6071
6071
  }),
6072
6072
  hasRange: (e, t) => {
@@ -6076,8 +6076,8 @@ var _ = {
6076
6076
  } = t;
6077
6077
  return d.hasPath(e, r.path) && d.hasPath(e, n.path);
6078
6078
  },
6079
- hasSelectableTarget: (e, t) => _.hasEditableTarget(e, t) || _.isTargetInsideNonReadonlyVoid(e, t),
6080
- hasTarget: (e, t) => Qt(t) && _.hasDOMNode(e, t),
6079
+ hasSelectableTarget: (e, t) => W.hasEditableTarget(e, t) || W.isTargetInsideNonReadonlyVoid(e, t),
6080
+ hasTarget: (e, t) => Qt(t) && W.hasDOMNode(e, t),
6081
6081
  insertData: (e, t) => {
6082
6082
  e.insertData(t);
6083
6083
  },
@@ -6088,18 +6088,18 @@ var _ = {
6088
6088
  isReadOnly: (e) => !!pi.get(e),
6089
6089
  isTargetInsideNonReadonlyVoid: (e, t) => {
6090
6090
  if (pi.get(e)) return !1;
6091
- var r = _.hasTarget(e, t) && _.toSlateNode(e, t);
6091
+ var r = W.hasTarget(e, t) && W.toSlateNode(e, t);
6092
6092
  return pe.isElement(r) && d.isVoid(e, r);
6093
6093
  },
6094
6094
  setFragmentData: (e, t, r) => e.setFragmentData(t, r),
6095
6095
  toDOMNode: (e, t) => {
6096
- var r = ha.get(e), n = d.isEditor(t) ? Ln.get(e) : r?.get(_.findKey(e, t));
6096
+ var r = ha.get(e), n = d.isEditor(t) ? Ln.get(e) : r?.get(W.findKey(e, t));
6097
6097
  if (!n)
6098
6098
  throw new Error("Cannot resolve a DOM node from Slate node: ".concat(at.stringify(t)));
6099
6099
  return n;
6100
6100
  },
6101
6101
  toDOMPoint: (e, t) => {
6102
- var [r] = d.node(e, t.path), n = _.toDOMNode(e, r), a;
6102
+ var [r] = d.node(e, t.path), n = W.toDOMNode(e, r), a;
6103
6103
  d.void(e, {
6104
6104
  at: t
6105
6105
  }) && (t = {
@@ -6141,7 +6141,7 @@ var _ = {
6141
6141
  var {
6142
6142
  anchor: r,
6143
6143
  focus: n
6144
- } = t, a = R.isBackward(t), i = _.toDOMPoint(e, r), s = R.isCollapsed(t) ? i : _.toDOMPoint(e, n), o = _.getWindow(e), l = o.document.createRange(), [u, f] = a ? s : i, [h, p] = a ? i : s, g = Et(u) ? u : u.parentElement, v = !!g.getAttribute("data-slate-zero-width"), D = Et(h) ? h : h.parentElement, c = !!D.getAttribute("data-slate-zero-width");
6144
+ } = t, a = N.isBackward(t), i = W.toDOMPoint(e, r), s = N.isCollapsed(t) ? i : W.toDOMPoint(e, n), o = W.getWindow(e), l = o.document.createRange(), [u, f] = a ? s : i, [h, p] = a ? i : s, g = Et(u) ? u : u.parentElement, v = !!g.getAttribute("data-slate-zero-width"), D = Et(h) ? h : h.parentElement, c = !!D.getAttribute("data-slate-zero-width");
6145
6145
  return l.setStart(u, v ? 1 : f), l.setEnd(h, c ? 1 : p), l;
6146
6146
  },
6147
6147
  toSlateNode: (e, t) => {
@@ -6159,10 +6159,10 @@ var _ = {
6159
6159
  searchDirection: i = "backward"
6160
6160
  } = r, [s, o] = n ? t : Lh(t), l = s.parentNode, u = null, f = 0;
6161
6161
  if (l) {
6162
- var h, p, g = _.toDOMNode(e, e), v = l.closest('[data-slate-void="true"]'), D = v && g.contains(v) ? v : null, c = l.closest('[contenteditable="false"]'), E = c && g.contains(c) ? c : null, B = l.closest("[data-slate-leaf]"), F = null;
6162
+ var h, p, g = W.toDOMNode(e, e), v = l.closest('[data-slate-void="true"]'), D = v && g.contains(v) ? v : null, c = l.closest('[contenteditable="false"]'), E = c && g.contains(c) ? c : null, B = l.closest("[data-slate-leaf]"), F = null;
6163
6163
  if (B) {
6164
6164
  if (u = B.closest('[data-slate-node="text"]'), u) {
6165
- var w = _.getWindow(e), T = w.document.createRange();
6165
+ var w = W.getWindow(e), T = w.document.createRange();
6166
6166
  T.setStart(u, 0), T.setEnd(s, o);
6167
6167
  var S = T.cloneContents(), A = [...Array.prototype.slice.call(S.querySelectorAll("[data-slate-zero-width]")), ...Array.prototype.slice.call(S.querySelectorAll("[contenteditable=false]"))];
6168
6168
  A.forEach((se) => {
@@ -6174,9 +6174,9 @@ var _ = {
6174
6174
  }), f = S.textContent.length, F = u;
6175
6175
  }
6176
6176
  } else if (D) {
6177
- for (var z = D.querySelectorAll("[data-slate-leaf]"), K = 0; K < z.length; K++) {
6178
- var G = z[K];
6179
- if (_.hasDOMNode(e, G)) {
6177
+ for (var I = D.querySelectorAll("[data-slate-leaf]"), K = 0; K < I.length; K++) {
6178
+ var G = I[K];
6179
+ if (W.hasDOMNode(e, G)) {
6180
6180
  B = G;
6181
6181
  break;
6182
6182
  }
@@ -6188,12 +6188,12 @@ var _ = {
6188
6188
  var L = (se) => se ? se.querySelectorAll(
6189
6189
  // Exclude leaf nodes in nested editors
6190
6190
  "[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])"
6191
- ) : [], N = E.closest('[data-slate-node="element"]');
6191
+ ) : [], M = E.closest('[data-slate-node="element"]');
6192
6192
  if (i === "forward") {
6193
- var I, O = [...L(N), ...L(N?.nextElementSibling)];
6194
- B = (I = O.find((se) => Vh(E, se))) !== null && I !== void 0 ? I : null;
6193
+ var z, O = [...L(M), ...L(M?.nextElementSibling)];
6194
+ B = (z = O.find((se) => Vh(E, se))) !== null && z !== void 0 ? z : null;
6195
6195
  } else {
6196
- var k, P = [...L(N?.previousElementSibling), ...L(N)];
6196
+ var k, P = [...L(M?.previousElementSibling), ...L(M)];
6197
6197
  B = (k = P.findLast((se) => Fo(E, se))) !== null && k !== void 0 ? k : null;
6198
6198
  }
6199
6199
  B && (u = B.closest('[data-slate-node="text"]'), F = B, i === "forward" ? f = 0 : (f = F.textContent.length, F.querySelectorAll("[data-slate-zero-width]").forEach((se) => {
@@ -6216,13 +6216,13 @@ var _ = {
6216
6216
  }
6217
6217
  if (ht && !u && !n) {
6218
6218
  var $ = l.hasAttribute("data-slate-node") ? l : l.closest("[data-slate-node]");
6219
- if ($ && _.hasDOMNode(e, $, {
6219
+ if ($ && W.hasDOMNode(e, $, {
6220
6220
  editable: !0
6221
6221
  })) {
6222
- var U = _.toSlateNode(e, $), {
6222
+ var U = W.toSlateNode(e, $), {
6223
6223
  path: Y,
6224
6224
  offset: Z
6225
- } = d.start(e, _.findPath(e, U));
6225
+ } = d.start(e, W.findPath(e, U));
6226
6226
  return $.querySelector("[data-slate-leaf]") || (Z = o), {
6227
6227
  path: Y,
6228
6228
  offset: Z
@@ -6234,7 +6234,7 @@ var _ = {
6234
6234
  return null;
6235
6235
  throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t));
6236
6236
  }
6237
- var q = _.toSlateNode(e, u), ee = _.findPath(e, q);
6237
+ var q = W.toSlateNode(e, u), ee = W.findPath(e, q);
6238
6238
  return {
6239
6239
  path: ee,
6240
6240
  offset: f
@@ -6268,13 +6268,13 @@ var _ = {
6268
6268
  Fr && (n = u.textContent) !== null && n !== void 0 && n.endsWith(`
6269
6269
 
6270
6270
  `) && f === u.textContent.length && f--;
6271
- var B = _.toSlatePoint(e, [o, l], {
6271
+ var B = W.toSlatePoint(e, [o, l], {
6272
6272
  exactMatch: a,
6273
6273
  suppressThrow: i
6274
6274
  });
6275
6275
  if (!B)
6276
6276
  return null;
6277
- var F = Fo(o, u) || o === u && f < l, w = h ? B : _.toSlatePoint(e, [u, f], {
6277
+ var F = Fo(o, u) || o === u && f < l, w = h ? B : W.toSlatePoint(e, [u, f], {
6278
6278
  exactMatch: a,
6279
6279
  suppressThrow: i,
6280
6280
  searchDirection: F ? "forward" : "backward"
@@ -6285,7 +6285,7 @@ var _ = {
6285
6285
  anchor: B,
6286
6286
  focus: w
6287
6287
  };
6288
- return R.isExpanded(T) && R.isForward(T) && Et(u) && d.void(e, {
6288
+ return N.isExpanded(T) && N.isForward(T) && Et(u) && d.void(e, {
6289
6289
  at: T.focus,
6290
6290
  mode: "highest"
6291
6291
  }) && (T = d.unhangRange(e, T, {
@@ -6300,7 +6300,7 @@ function Gh(e, t) {
6300
6300
  } = t;
6301
6301
  if (!d.hasPath(e, r))
6302
6302
  return !1;
6303
- var a = ae.get(e, r);
6303
+ var a = ie.get(e, r);
6304
6304
  if (!he.isText(a))
6305
6305
  return !1;
6306
6306
  if (n.start !== a.text.length || n.text.length === 0)
@@ -6308,7 +6308,7 @@ function Gh(e, t) {
6308
6308
  var i = C.next(r);
6309
6309
  if (!d.hasPath(e, i))
6310
6310
  return !1;
6311
- var s = ae.get(e, i);
6311
+ var s = ie.get(e, i);
6312
6312
  return he.isText(s) && s.text.startsWith(n.text);
6313
6313
  }
6314
6314
  function Ku(e) {
@@ -6371,7 +6371,7 @@ function vi(e, t) {
6371
6371
  } = t;
6372
6372
  if (!d.hasPath(e, r))
6373
6373
  return null;
6374
- var a = ae.get(e, r);
6374
+ var a = ie.get(e, r);
6375
6375
  if (!he.isText(a))
6376
6376
  return null;
6377
6377
  var i = d.above(e, {
@@ -6398,7 +6398,7 @@ function ko(e, t) {
6398
6398
  var r = vi(e, t.anchor);
6399
6399
  if (!r)
6400
6400
  return null;
6401
- if (R.isCollapsed(t))
6401
+ if (N.isCollapsed(t))
6402
6402
  return {
6403
6403
  anchor: r,
6404
6404
  focus: r
@@ -6450,7 +6450,7 @@ function So(e, t, r) {
6450
6450
  var n = Di(e, t.anchor, r);
6451
6451
  if (!n)
6452
6452
  return null;
6453
- if (R.isCollapsed(t))
6453
+ if (N.isCollapsed(t))
6454
6454
  return {
6455
6455
  anchor: n,
6456
6456
  focus: n
@@ -6581,24 +6581,24 @@ function ip(e) {
6581
6581
  scheduleOnDOMSelectionChange: r,
6582
6582
  onDOMSelectionChange: n
6583
6583
  } = e, a = !1, i = null, s = null, o = null, l = 0, u = !1, f = () => {
6584
- var N = Jt.get(t);
6585
- if (Jt.delete(t), N) {
6584
+ var M = Jt.get(t);
6585
+ if (Jt.delete(t), M) {
6586
6586
  var {
6587
- selection: I
6588
- } = t, O = ko(t, N);
6589
- O && (!I || !R.equals(O, I)) && Q.select(t, O);
6587
+ selection: z
6588
+ } = t, O = ko(t, M);
6589
+ O && (!z || !N.equals(O, z)) && Q.select(t, O);
6590
6590
  }
6591
6591
  }, h = () => {
6592
- var N = Zt.get(t);
6593
- if (Zt.delete(t), !!N) {
6594
- if (N.at) {
6595
- var I = Oe.isPoint(N.at) ? vi(t, N.at) : ko(t, N.at);
6596
- if (!I)
6592
+ var M = Zt.get(t);
6593
+ if (Zt.delete(t), !!M) {
6594
+ if (M.at) {
6595
+ var z = Oe.isPoint(M.at) ? vi(t, M.at) : ko(t, M.at);
6596
+ if (!z)
6597
6597
  return;
6598
- var O = d.range(t, I);
6599
- (!t.selection || !R.equals(t.selection, O)) && Q.select(t, I);
6598
+ var O = d.range(t, z);
6599
+ (!t.selection || !N.equals(t.selection, O)) && Q.select(t, z);
6600
6600
  }
6601
- N.run();
6601
+ M.run();
6602
6602
  }
6603
6603
  }, p = () => {
6604
6604
  if (s && (clearTimeout(s), s = null), o && (clearTimeout(o), o = null), !w() && !F()) {
@@ -6606,58 +6606,58 @@ function ip(e) {
6606
6606
  return;
6607
6607
  }
6608
6608
  a || (a = !0, setTimeout(() => a = !1)), F() && (a = "action");
6609
- var N = t.selection && d.rangeRef(t, t.selection, {
6609
+ var M = t.selection && d.rangeRef(t, t.selection, {
6610
6610
  affinity: "forward"
6611
6611
  });
6612
6612
  qt.set(t, t.marks), np("flush", Zt.get(t), Dt.get(t));
6613
- for (var I = w(), O; O = (k = Dt.get(t)) === null || k === void 0 ? void 0 : k[0]; ) {
6613
+ for (var z = w(), O; O = (k = Dt.get(t)) === null || k === void 0 ? void 0 : k[0]; ) {
6614
6614
  var k, P, $ = St.get(t);
6615
6615
  $ !== void 0 && (St.delete(t), t.marks = $), $ && u === !1 && (u = null);
6616
6616
  var U = Qh(O);
6617
- (!t.selection || !R.equals(t.selection, U)) && Q.select(t, U), O.diff.text ? d.insertText(t, O.diff.text) : d.deleteFragment(t), Dt.set(t, (P = Dt.get(t)) === null || P === void 0 ? void 0 : P.filter((q) => {
6617
+ (!t.selection || !N.equals(t.selection, U)) && Q.select(t, U), O.diff.text ? d.insertText(t, O.diff.text) : d.deleteFragment(t), Dt.set(t, (P = Dt.get(t)) === null || P === void 0 ? void 0 : P.filter((q) => {
6618
6618
  var {
6619
6619
  id: ee
6620
6620
  } = q;
6621
6621
  return ee !== O.id;
6622
- })), Gh(t, O) || (I = !1, Zt.delete(t), qt.delete(t), a = "action", Jt.delete(t), r.cancel(), n.cancel(), N?.unref());
6622
+ })), Gh(t, O) || (z = !1, Zt.delete(t), qt.delete(t), a = "action", Jt.delete(t), r.cancel(), n.cancel(), M?.unref());
6623
6623
  }
6624
- var Y = N?.unref();
6625
- if (Y && !Jt.get(t) && (!t.selection || !R.equals(Y, t.selection)) && Q.select(t, Y), F()) {
6624
+ var Y = M?.unref();
6625
+ if (Y && !Jt.get(t) && (!t.selection || !N.equals(Y, t.selection)) && Q.select(t, Y), F()) {
6626
6626
  h();
6627
6627
  return;
6628
6628
  }
6629
- I && r(), r.flush(), n.flush(), f();
6629
+ z && r(), r.flush(), n.flush(), f();
6630
6630
  var Z = qt.get(t);
6631
6631
  qt.delete(t), Z !== void 0 && (t.marks = Z, t.onChange());
6632
- }, g = (N) => {
6632
+ }, g = (M) => {
6633
6633
  i && clearTimeout(i), i = setTimeout(() => {
6634
6634
  sr.set(t, !1), p();
6635
6635
  }, tp);
6636
- }, v = (N) => {
6636
+ }, v = (M) => {
6637
6637
  sr.set(t, !0), i && (clearTimeout(i), i = null);
6638
6638
  }, D = function() {
6639
- var I = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, O = hi.get(t);
6639
+ var z = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, O = hi.get(t);
6640
6640
  if (O) {
6641
- if (w() || I) {
6641
+ if (w() || z) {
6642
6642
  O.style.display = "none";
6643
6643
  return;
6644
6644
  }
6645
6645
  O.style.removeProperty("display");
6646
6646
  }
6647
- }, c = (N, I) => {
6647
+ }, c = (M, z) => {
6648
6648
  var O, k = (O = Dt.get(t)) !== null && O !== void 0 ? O : [];
6649
6649
  Dt.set(t, k);
6650
- var P = ae.leaf(t, N), $ = k.findIndex((Z) => C.equals(Z.path, N));
6650
+ var P = ie.leaf(t, M), $ = k.findIndex((Z) => C.equals(Z.path, M));
6651
6651
  if ($ < 0) {
6652
- var U = Yu(P.text, I);
6652
+ var U = Yu(P.text, z);
6653
6653
  U && k.push({
6654
- path: N,
6655
- diff: I,
6654
+ path: M,
6655
+ diff: z,
6656
6656
  id: l++
6657
6657
  }), D();
6658
6658
  return;
6659
6659
  }
6660
- var Y = Xh(P.text, k[$].diff, I);
6660
+ var Y = Xh(P.text, k[$].diff, z);
6661
6661
  if (!Y) {
6662
6662
  k.splice($, 1), D();
6663
6663
  return;
@@ -6665,35 +6665,35 @@ function ip(e) {
6665
6665
  k[$] = kn(kn({}, k[$]), {}, {
6666
6666
  diff: Y
6667
6667
  });
6668
- }, E = function(I) {
6668
+ }, E = function(z) {
6669
6669
  var {
6670
6670
  at: O
6671
6671
  } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
6672
6672
  u = !1, Jt.delete(t), r.cancel(), n.cancel(), F() && p(), Zt.set(t, {
6673
6673
  at: O,
6674
- run: I
6674
+ run: z
6675
6675
  }), o = setTimeout(p);
6676
- }, B = (N) => {
6677
- var I;
6676
+ }, B = (M) => {
6677
+ var z;
6678
6678
  if (s && (clearTimeout(s), s = null), !Sr.get(t)) {
6679
6679
  var {
6680
6680
  inputType: O
6681
- } = N, k = null, P = N.dataTransfer || N.data || void 0;
6681
+ } = M, k = null, P = M.dataTransfer || M.data || void 0;
6682
6682
  u !== !1 && O !== "insertText" && O !== "insertCompositionText" && (u = !1);
6683
- var [$] = N.getTargetRanges();
6684
- $ && (k = _.toSlateRange(t, $, {
6683
+ var [$] = M.getTargetRanges();
6684
+ $ && (k = W.toSlateRange(t, $, {
6685
6685
  exactMatch: !1,
6686
6686
  suppressThrow: !0
6687
6687
  }));
6688
- var U = _.getWindow(t), Y = U.getSelection();
6689
- if (!k && Y && ($ = Y, k = _.toSlateRange(t, Y, {
6688
+ var U = W.getWindow(t), Y = U.getSelection();
6689
+ if (!k && Y && ($ = Y, k = W.toSlateRange(t, Y, {
6690
6690
  exactMatch: !1,
6691
6691
  suppressThrow: !0
6692
- })), k = (I = k) !== null && I !== void 0 ? I : t.selection, !!k) {
6692
+ })), k = (z = k) !== null && z !== void 0 ? z : t.selection, !!k) {
6693
6693
  var Z = !0;
6694
6694
  if (O.startsWith("delete")) {
6695
- if (R.isExpanded(k)) {
6696
- var [q, ee] = R.edges(k), se = ae.leaf(t, q.path);
6695
+ if (N.isExpanded(k)) {
6696
+ var [q, ee] = N.edges(k), se = ie.leaf(t, q.path);
6697
6697
  if (se.text.length === q.offset && ee.offset === 0) {
6698
6698
  var xe = d.next(t, {
6699
6699
  at: q.path,
@@ -6705,12 +6705,12 @@ function ip(e) {
6705
6705
  });
6706
6706
  }
6707
6707
  }
6708
- var le = O.endsWith("Backward") ? "backward" : "forward", [x, J] = R.edges(k), [H, V] = d.leaf(t, x.path), ne = {
6708
+ var le = O.endsWith("Backward") ? "backward" : "forward", [x, J] = N.edges(k), [H, V] = d.leaf(t, x.path), ne = {
6709
6709
  text: "",
6710
6710
  start: x.offset,
6711
6711
  end: J.offset
6712
6712
  }, te = Dt.get(t), de = te?.find((tt) => C.equals(tt.path, V)), we = de ? [de.diff, ne] : [ne], me = Ku(H.text, ...we);
6713
- if (me.length === 0 && (Z = !1), R.isExpanded(k)) {
6713
+ if (me.length === 0 && (Z = !1), N.isExpanded(k)) {
6714
6714
  if (Z && C.equals(k.anchor.path, k.focus.path)) {
6715
6715
  var Ce = {
6716
6716
  path: k.anchor.path,
@@ -6739,15 +6739,15 @@ function ip(e) {
6739
6739
  case "deleteContent":
6740
6740
  case "deleteContentForward": {
6741
6741
  var {
6742
- anchor: Be
6742
+ anchor: Ee
6743
6743
  } = k;
6744
- if (Z && R.isCollapsed(k)) {
6745
- var Ae = ae.leaf(t, Be.path);
6746
- if (Be.offset < Ae.text.length)
6747
- return c(Be.path, {
6744
+ if (Z && N.isCollapsed(k)) {
6745
+ var Ae = ie.leaf(t, Ee.path);
6746
+ if (Ee.offset < Ae.text.length)
6747
+ return c(Ee.path, {
6748
6748
  text: "",
6749
- start: Be.offset,
6750
- end: Be.offset + 1
6749
+ start: Ee.offset,
6750
+ end: Ee.offset + 1
6751
6751
  });
6752
6752
  }
6753
6753
  return E(() => d.deleteForward(t), {
@@ -6758,7 +6758,7 @@ function ip(e) {
6758
6758
  var je, {
6759
6759
  anchor: Ve
6760
6760
  } = k, ut = mi($) ? $.isCollapsed : !!((je = $) !== null && je !== void 0 && je.collapsed);
6761
- return Z && ut && R.isCollapsed(k) && Ve.offset > 0 ? c(Ve.path, {
6761
+ return Z && ut && N.isCollapsed(k) && Ve.offset > 0 ? c(Ve.path, {
6762
6762
  text: "",
6763
6763
  start: Ve.offset - 1,
6764
6764
  end: Ve.offset
@@ -6829,7 +6829,7 @@ function ip(e) {
6829
6829
  case "insertReplacementText":
6830
6830
  case "insertText": {
6831
6831
  if (ap(P))
6832
- return E(() => _.insertData(t, P), {
6832
+ return E(() => W.insertData(t, P), {
6833
6833
  at: k
6834
6834
  });
6835
6835
  var Pe = P ?? "";
@@ -6845,7 +6845,7 @@ function ip(e) {
6845
6845
  at: k
6846
6846
  });
6847
6847
  if (C.equals(k.anchor.path, k.focus.path)) {
6848
- var [lt, ct] = R.edges(k), Re = {
6848
+ var [lt, ct] = N.edges(k), Re = {
6849
6849
  start: lt.offset,
6850
6850
  end: ct.offset,
6851
6851
  text: Pe
@@ -6853,7 +6853,7 @@ function ip(e) {
6853
6853
  if (Pe && u && O === "insertCompositionText") {
6854
6854
  var Me = u.start + u.text.search(/\S|$/), xt = Re.start + Re.text.search(/\S|$/);
6855
6855
  xt === Me + 1 && Re.end === u.start + u.text.length ? (Re.start -= 1, u = null, G()) : u = !1;
6856
- } else O === "insertText" ? u === null ? u = Re : u && R.isCollapsed(k) && u.end + u.text.length === lt.offset ? u = kn(kn({}, u), {}, {
6856
+ } else O === "insertText" ? u === null ? u = Re : u && N.isCollapsed(k) && u.end + u.text.length === lt.offset ? u = kn(kn({}, u), {}, {
6857
6857
  text: u.text + Pe
6858
6858
  }) : u = !1 : u = !1;
6859
6859
  if (Z) {
@@ -6869,27 +6869,27 @@ function ip(e) {
6869
6869
  }
6870
6870
  }
6871
6871
  }, F = () => !!Zt.get(t), w = () => {
6872
- var N;
6873
- return !!((N = Dt.get(t)) !== null && N !== void 0 && N.length);
6874
- }, T = () => F() || w(), S = () => a, A = (N) => {
6875
- Jt.set(t, N), s && (clearTimeout(s), s = null);
6872
+ var M;
6873
+ return !!((M = Dt.get(t)) !== null && M !== void 0 && M.length);
6874
+ }, T = () => F() || w(), S = () => a, A = (M) => {
6875
+ Jt.set(t, M), s && (clearTimeout(s), s = null);
6876
6876
  var {
6877
- selection: I
6877
+ selection: z
6878
6878
  } = t;
6879
- if (N) {
6880
- var O = !I || !C.equals(I.anchor.path, N.anchor.path), k = !I || !C.equals(I.anchor.path.slice(0, -1), N.anchor.path.slice(0, -1));
6879
+ if (M) {
6880
+ var O = !z || !C.equals(z.anchor.path, M.anchor.path), k = !z || !C.equals(z.anchor.path.slice(0, -1), M.anchor.path.slice(0, -1));
6881
6881
  (O && u || k) && (u = !1), (O || w()) && (s = setTimeout(p, rp));
6882
6882
  }
6883
- }, z = () => {
6883
+ }, I = () => {
6884
6884
  (F() || !w()) && p();
6885
- }, K = (N) => {
6885
+ }, K = (M) => {
6886
6886
  w() || (D(!0), setTimeout(D));
6887
6887
  }, G = () => {
6888
6888
  F() || (o = setTimeout(p));
6889
- }, L = (N) => {
6890
- if (!(w() || F()) && N.some((O) => Hi(t, O, N))) {
6891
- var I;
6892
- (I = _u.get(t)) === null || I === void 0 || I();
6889
+ }, L = (M) => {
6890
+ if (!(w() || F()) && M.some((O) => Hi(t, O, M))) {
6891
+ var z;
6892
+ (z = _u.get(t)) === null || z === void 0 || z();
6893
6893
  }
6894
6894
  };
6895
6895
  return {
@@ -6905,7 +6905,7 @@ function ip(e) {
6905
6905
  handleDOMBeforeInput: B,
6906
6906
  handleKeyDown: K,
6907
6907
  handleDomMutations: L,
6908
- handleInput: z
6908
+ handleInput: I
6909
6909
  };
6910
6910
  }
6911
6911
  function sp() {
@@ -6969,7 +6969,7 @@ var cp = {
6969
6969
  return !1;
6970
6970
  for (var r = 0; r < e.length; r++) {
6971
6971
  var n = e[r], a = t[r];
6972
- if (!R.equals(n, a) || !Gu(n, a))
6972
+ if (!N.equals(n, a) || !Gu(n, a))
6973
6973
  return !1;
6974
6974
  }
6975
6975
  return !0;
@@ -7010,9 +7010,9 @@ var Dp = (e) => {
7010
7010
  leaf: r,
7011
7011
  parent: n,
7012
7012
  text: a
7013
- } = e, i = tr(), s = _.findPath(i, a), o = C.parent(s), l = !!r[Wu];
7013
+ } = e, i = tr(), s = W.findPath(i, a), o = C.parent(s), l = !!r[Wu];
7014
7014
  return i.isVoid(n) ? /* @__PURE__ */ be.createElement(Ya, {
7015
- length: ae.string(n).length
7015
+ length: ie.string(n).length
7016
7016
  }) : r.text === "" && n.children[n.children.length - 1] === a && !i.isInline(n) && d.string(i, o) === "" ? /* @__PURE__ */ be.createElement(Ya, {
7017
7017
  isLineBreak: !0,
7018
7018
  isMarkPlaceholder: l
@@ -7156,7 +7156,7 @@ var xp = (e) => {
7156
7156
  renderPlaceholder: a,
7157
7157
  renderLeaf: i,
7158
7158
  text: s
7159
- } = e, o = tr(), l = Ue(null), u = he.decorations(s, t), f = _.findKey(o, s), h = [], p = 0; p < u.length; p++) {
7159
+ } = e, o = tr(), l = Ue(null), u = he.decorations(s, t), f = W.findKey(o, s), h = [], p = 0; p < u.length; p++) {
7160
7160
  var g = u[p];
7161
7161
  h.push(/* @__PURE__ */ be.createElement(wp, {
7162
7162
  isLast: r && p === u.length - 1,
@@ -7206,7 +7206,7 @@ var Ap = (e) => {
7206
7206
  renderPlaceholder: a,
7207
7207
  renderLeaf: i,
7208
7208
  selection: s
7209
- } = e, o = tr(), l = Tp(), u = o.isInline(r), f = _.findKey(o, r), h = ke((B) => {
7209
+ } = e, o = tr(), l = Tp(), u = o.isInline(r), f = W.findKey(o, r), h = ke((B) => {
7210
7210
  var F = ha.get(o);
7211
7211
  B ? (F?.set(f, B), cr.set(r, B), cn.set(B, r)) : (F?.delete(f), cr.delete(r));
7212
7212
  }, [o, f, r]), p = Qu({
@@ -7221,12 +7221,12 @@ var Ap = (e) => {
7221
7221
  ref: h
7222
7222
  };
7223
7223
  if (u && (g["data-slate-inline"] = !0), !u && d.hasInlines(o, r)) {
7224
- var v = ae.string(r), D = Fu(v);
7224
+ var v = ie.string(r), D = Fu(v);
7225
7225
  D === "rtl" && (g.dir = D);
7226
7226
  }
7227
7227
  if (d.isVoid(o, r)) {
7228
7228
  g["data-slate-void"] = !0, !l && u && (g.contentEditable = !1);
7229
- var c = u ? "span" : "div", [[E]] = ae.texts(r);
7229
+ var c = u ? "span" : "div", [[E]] = ie.texts(r);
7230
7230
  p = /* @__PURE__ */ be.createElement(c, {
7231
7231
  "data-slate-spacer": !0,
7232
7232
  style: {
@@ -7248,7 +7248,7 @@ var Ap = (e) => {
7248
7248
  children: p,
7249
7249
  element: r
7250
7250
  });
7251
- }, Fp = /* @__PURE__ */ be.memo(Ap, (e, t) => e.element === t.element && e.renderElement === t.renderElement && e.renderLeaf === t.renderLeaf && e.renderPlaceholder === t.renderPlaceholder && gp(e.decorations, t.decorations) && (e.selection === t.selection || !!e.selection && !!t.selection && R.equals(e.selection, t.selection))), kp = (e) => {
7251
+ }, Fp = /* @__PURE__ */ be.memo(Ap, (e, t) => e.element === t.element && e.renderElement === t.renderElement && e.renderLeaf === t.renderLeaf && e.renderPlaceholder === t.renderPlaceholder && gp(e.decorations, t.decorations) && (e.selection === t.selection || !!e.selection && !!t.selection && N.equals(e.selection, t.selection))), kp = (e) => {
7252
7252
  var {
7253
7253
  attributes: t,
7254
7254
  children: r,
@@ -7269,10 +7269,10 @@ var Ap = (e) => {
7269
7269
  selection: s
7270
7270
  } = e, o = Sp(), l = tr();
7271
7271
  Sr.set(l, !1);
7272
- for (var u = _.findPath(l, r), f = [], h = pe.isElement(r) && !l.isInline(r) && d.hasInlines(l, r), p = 0; p < r.children.length; p++) {
7273
- var g = u.concat(p), v = r.children[p], D = _.findKey(l, v), c = d.range(l, g), E = s && R.intersection(c, s), B = o([v, g]);
7272
+ for (var u = W.findPath(l, r), f = [], h = pe.isElement(r) && !l.isInline(r) && d.hasInlines(l, r), p = 0; p < r.children.length; p++) {
7273
+ var g = u.concat(p), v = r.children[p], D = W.findKey(l, v), c = d.range(l, g), E = s && N.intersection(c, s), B = o([v, g]);
7274
7274
  for (var F of t) {
7275
- var w = R.intersection(F, c);
7275
+ var w = N.intersection(F, c);
7276
7276
  w && B.push(w);
7277
7277
  }
7278
7278
  pe.isElement(v) ? f.push(/* @__PURE__ */ be.createElement(Op.Provider, {
@@ -7310,7 +7310,7 @@ function $p() {
7310
7310
  var e = tr(), t = Ue(!1), r = Ue(0), n = ke(() => {
7311
7311
  if (!t.current) {
7312
7312
  t.current = !0;
7313
- var a = _.getWindow(e);
7313
+ var a = W.getWindow(e);
7314
7314
  a.cancelAnimationFrame(r.current), r.current = a.requestAnimationFrame(() => {
7315
7315
  t.current = !1;
7316
7316
  });
@@ -7493,7 +7493,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7493
7493
  as: g = "div",
7494
7494
  disableDefaultStyles: v = !1
7495
7495
  } = e, D = Or(e, _p), c = rl(), [E, B] = $e(!1), F = Ue(null), w = Ue([]), [T, S] = $e(), A = Ue(!1), {
7496
- onUserInput: z,
7496
+ onUserInput: I,
7497
7497
  receivedUserInput: K
7498
7498
  } = $p(), [, G] = Gl((x) => x + 1, 0);
7499
7499
  _u.set(c, G), pi.set(c, o);
@@ -7506,53 +7506,53 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7506
7506
  Je(() => {
7507
7507
  F.current && n && F.current.focus();
7508
7508
  }, [n]);
7509
- var N = Ue(), I = We(() => rh(() => {
7509
+ var M = Ue(), z = We(() => rh(() => {
7510
7510
  if (Sr.get(c)) {
7511
- I();
7511
+ z();
7512
7512
  return;
7513
7513
  }
7514
- var x = _.toDOMNode(c, c), J = x.getRootNode();
7514
+ var x = W.toDOMNode(c, c), J = x.getRootNode();
7515
7515
  if (!A.current && ar && J instanceof ShadowRoot) {
7516
7516
  A.current = !0;
7517
7517
  var H = Uh();
7518
7518
  H ? document.execCommand("indent") : Q.deselect(c), A.current = !1;
7519
7519
  return;
7520
7520
  }
7521
- var V = N.current;
7522
- if ((ht || !_.isComposing(c)) && (!L.isUpdatingSelection || V != null && V.isFlushing()) && !L.isDraggingInternally) {
7523
- var ne = _.findDocumentOrShadowRoot(c), {
7521
+ var V = M.current;
7522
+ if ((ht || !W.isComposing(c)) && (!L.isUpdatingSelection || V != null && V.isFlushing()) && !L.isDraggingInternally) {
7523
+ var ne = W.findDocumentOrShadowRoot(c), {
7524
7524
  activeElement: te
7525
- } = ne, de = _.toDOMNode(c, c), we = Qr(ne);
7525
+ } = ne, de = W.toDOMNode(c, c), we = Qr(ne);
7526
7526
  if (te === de ? (L.latestElement = te, Xt.set(c, !0)) : Xt.delete(c), !we)
7527
7527
  return Q.deselect(c);
7528
7528
  var {
7529
7529
  anchorNode: me,
7530
7530
  focusNode: Ce
7531
- } = we, Fe = _.hasEditableTarget(c, me) || _.isTargetInsideNonReadonlyVoid(c, me), Be = _.hasTarget(c, Ce);
7532
- if (Fe && Be) {
7533
- var Ae = _.toSlateRange(c, we, {
7531
+ } = we, Fe = W.hasEditableTarget(c, me) || W.isTargetInsideNonReadonlyVoid(c, me), Ee = W.hasTarget(c, Ce);
7532
+ if (Fe && Ee) {
7533
+ var Ae = W.toSlateRange(c, we, {
7534
7534
  exactMatch: !1,
7535
7535
  suppressThrow: !0
7536
7536
  });
7537
- Ae && (!_.isComposing(c) && !(V != null && V.hasPendingChanges()) && !(V != null && V.isFlushing()) ? Q.select(c, Ae) : V?.handleUserSelect(Ae));
7537
+ Ae && (!W.isComposing(c) && !(V != null && V.hasPendingChanges()) && !(V != null && V.isFlushing()) ? Q.select(c, Ae) : V?.handleUserSelect(Ae));
7538
7538
  }
7539
- o && (!Fe || !Be) && Q.deselect(c);
7539
+ o && (!Fe || !Ee) && Q.deselect(c);
7540
7540
  }
7541
- }, 100), [c, o, L]), O = We(() => Qd(I, 0), [I]);
7542
- N.current = fp({
7541
+ }, 100), [c, o, L]), O = We(() => Qd(z, 0), [z]);
7542
+ M.current = fp({
7543
7543
  node: F,
7544
- onDOMSelectionChange: I,
7544
+ onDOMSelectionChange: z,
7545
7545
  scheduleOnDOMSelectionChange: O
7546
7546
  }), fn(() => {
7547
7547
  var x, J, H;
7548
7548
  F.current && (H = qi(F.current)) ? (Lu.set(c, H), Ln.set(c, F.current), cr.set(c, F.current), cn.set(F.current, c)) : cr.delete(c);
7549
7549
  var {
7550
7550
  selection: V
7551
- } = c, ne = _.findDocumentOrShadowRoot(c), te = Qr(ne);
7552
- if (!(!te || !_.isFocused(c) || (x = N.current) !== null && x !== void 0 && x.hasPendingAction())) {
7551
+ } = c, ne = W.findDocumentOrShadowRoot(c), te = Qr(ne);
7552
+ if (!(!te || !W.isFocused(c) || (x = M.current) !== null && x !== void 0 && x.hasPendingAction())) {
7553
7553
  var de = (Fe) => {
7554
- var Be = te.type !== "None";
7555
- if (!(!V && !Be)) {
7554
+ var Ee = te.type !== "None";
7555
+ if (!(!V && !Ee)) {
7556
7556
  var Ae = te.focusNode, je;
7557
7557
  if (Fr && te.rangeCount > 1) {
7558
7558
  var Ve = te.getRangeAt(0), ut = te.getRangeAt(te.rangeCount - 1);
@@ -7560,33 +7560,33 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7560
7560
  } else
7561
7561
  je = te.anchorNode;
7562
7562
  var Pe = Ln.get(c), lt = !1;
7563
- if (Pe.contains(je) && Pe.contains(Ae) && (lt = !0), Be && lt && V && !Fe) {
7564
- var ct = _.toSlateRange(c, te, {
7563
+ if (Pe.contains(je) && Pe.contains(Ae) && (lt = !0), Ee && lt && V && !Fe) {
7564
+ var ct = W.toSlateRange(c, te, {
7565
7565
  exactMatch: !0,
7566
7566
  // domSelection is not necessarily a valid Slate range
7567
7567
  // (e.g. when clicking on contentEditable:false element)
7568
7568
  suppressThrow: !0
7569
7569
  });
7570
- if (ct && R.equals(ct, V)) {
7570
+ if (ct && N.equals(ct, V)) {
7571
7571
  var Re;
7572
7572
  if (!L.hasMarkPlaceholder || (Re = je) !== null && Re !== void 0 && (Re = Re.parentElement) !== null && Re !== void 0 && Re.hasAttribute("data-slate-mark-placeholder"))
7573
7573
  return;
7574
7574
  }
7575
7575
  }
7576
- if (V && !_.hasRange(c, V)) {
7577
- c.selection = _.toSlateRange(c, te, {
7576
+ if (V && !W.hasRange(c, V)) {
7577
+ c.selection = W.toSlateRange(c, te, {
7578
7578
  exactMatch: !1,
7579
7579
  suppressThrow: !0
7580
7580
  });
7581
7581
  return;
7582
7582
  }
7583
7583
  L.isUpdatingSelection = !0;
7584
- var Me = V && _.toDOMRange(c, V);
7585
- return Me ? (_.isComposing(c) && !ht ? te.collapseToEnd() : R.isBackward(V) ? te.setBaseAndExtent(Me.endContainer, Me.endOffset, Me.startContainer, Me.startOffset) : te.setBaseAndExtent(Me.startContainer, Me.startOffset, Me.endContainer, Me.endOffset), h(c, Me)) : te.removeAllRanges(), Me;
7584
+ var Me = V && W.toDOMRange(c, V);
7585
+ return Me ? (W.isComposing(c) && !ht ? te.collapseToEnd() : N.isBackward(V) ? te.setBaseAndExtent(Me.endContainer, Me.endOffset, Me.startContainer, Me.startOffset) : te.setBaseAndExtent(Me.startContainer, Me.startOffset, Me.endContainer, Me.endOffset), h(c, Me)) : te.removeAllRanges(), Me;
7586
7586
  }
7587
7587
  };
7588
7588
  te.rangeCount <= 1 && de();
7589
- var we = ((J = N.current) === null || J === void 0 ? void 0 : J.isFlushing()) === "action";
7589
+ var we = ((J = M.current) === null || J === void 0 ? void 0 : J.isFlushing()) === "action";
7590
7590
  if (!ht || !we) {
7591
7591
  setTimeout(() => {
7592
7592
  L.isUpdatingSelection = !1;
@@ -7595,10 +7595,10 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7595
7595
  }
7596
7596
  var me = null, Ce = requestAnimationFrame(() => {
7597
7597
  if (we) {
7598
- var Fe = (Be) => {
7598
+ var Fe = (Ee) => {
7599
7599
  try {
7600
- var Ae = _.toDOMNode(c, c);
7601
- Ae.focus(), de(Be);
7600
+ var Ae = W.toDOMNode(c, c);
7601
+ Ae.focus(), de(Ee);
7602
7602
  } catch {
7603
7603
  }
7604
7604
  };
@@ -7613,31 +7613,31 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7613
7613
  }
7614
7614
  });
7615
7615
  var k = ke((x) => {
7616
- var J = _.toDOMNode(c, c), H = J.getRootNode();
7616
+ var J = W.toDOMNode(c, c), H = J.getRootNode();
7617
7617
  if (A != null && A.current && ar && H instanceof ShadowRoot) {
7618
7618
  var V = x.getTargetRanges(), ne = V[0], te = new window.Range();
7619
7619
  te.setStart(ne.startContainer, ne.startOffset), te.setEnd(ne.endContainer, ne.endOffset);
7620
- var de = _.toSlateRange(c, te, {
7620
+ var de = W.toSlateRange(c, te, {
7621
7621
  exactMatch: !1,
7622
7622
  suppressThrow: !1
7623
7623
  });
7624
7624
  Q.select(c, de), x.preventDefault(), x.stopImmediatePropagation();
7625
7625
  return;
7626
7626
  }
7627
- if (z(), !o && _.hasEditableTarget(c, x.target) && !Kp(x, i)) {
7627
+ if (I(), !o && W.hasEditableTarget(c, x.target) && !Kp(x, i)) {
7628
7628
  var we;
7629
- if (N.current)
7630
- return N.current.handleDOMBeforeInput(x);
7631
- O.flush(), I.flush();
7629
+ if (M.current)
7630
+ return M.current.handleDOMBeforeInput(x);
7631
+ O.flush(), z.flush();
7632
7632
  var {
7633
7633
  selection: me
7634
7634
  } = c, {
7635
7635
  inputType: Ce
7636
- } = x, Fe = x.dataTransfer || x.data || void 0, Be = Ce === "insertCompositionText" || Ce === "deleteCompositionText";
7637
- if (Be && _.isComposing(c))
7636
+ } = x, Fe = x.dataTransfer || x.data || void 0, Ee = Ce === "insertCompositionText" || Ce === "deleteCompositionText";
7637
+ if (Ee && W.isComposing(c))
7638
7638
  return;
7639
7639
  var Ae = !1;
7640
- if (Ce === "insertText" && me && R.isCollapsed(me) && // Only use native character insertion for single characters a-z or space for now.
7640
+ if (Ce === "insertText" && me && N.isCollapsed(me) && // Only use native character insertion for single characters a-z or space for now.
7641
7641
  // Long-press events (hold a + press 4 = ä) to choose a special character otherwise
7642
7642
  // causes duplicate inserts.
7643
7643
  x.data && x.data.length === 1 && /[a-z ]/i.test(x.data) && // Chrome has issues correctly editing the start of nodes: https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
@@ -7646,8 +7646,8 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7646
7646
  me.anchor.offset !== 0 && (Ae = !0, c.marks && (Ae = !1), !Sr.get(c))) {
7647
7647
  var je, Ve, {
7648
7648
  anchor: ut
7649
- } = me, [Pe, lt] = _.toDOMPoint(c, ut), ct = (je = Pe.parentElement) === null || je === void 0 ? void 0 : je.closest("a"), Re = _.getWindow(c);
7650
- if (Ae && ct && _.hasDOMNode(c, ct)) {
7649
+ } = me, [Pe, lt] = W.toDOMPoint(c, ut), ct = (je = Pe.parentElement) === null || je === void 0 ? void 0 : je.closest("a"), Re = W.getWindow(c);
7650
+ if (Ae && ct && W.hasDOMNode(c, ct)) {
7651
7651
  var Me, xt = Re?.document.createTreeWalker(ct, NodeFilter.SHOW_TEXT).lastChild();
7652
7652
  xt === Pe && ((Me = xt.textContent) === null || Me === void 0 ? void 0 : Me.length) === lt && (Ae = !1);
7653
7653
  }
@@ -7656,26 +7656,26 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7656
7656
  at: ut.path,
7657
7657
  match: (Tt) => pe.isElement(Tt) && d.isBlock(c, Tt)
7658
7658
  });
7659
- tt && ae.string(tt[0]).includes(" ") && (Ae = !1);
7659
+ tt && ie.string(tt[0]).includes(" ") && (Ae = !1);
7660
7660
  }
7661
7661
  }
7662
7662
  if ((!Ce.startsWith("delete") || Ce.startsWith("deleteBy")) && !Sr.get(c)) {
7663
7663
  var [it] = x.getTargetRanges();
7664
7664
  if (it) {
7665
- var Te = _.toSlateRange(c, it, {
7665
+ var Te = W.toSlateRange(c, it, {
7666
7666
  exactMatch: !1,
7667
7667
  suppressThrow: !1
7668
7668
  });
7669
- if (!me || !R.equals(me, Te)) {
7669
+ if (!me || !N.equals(me, Te)) {
7670
7670
  Ae = !1;
7671
- var qe = !Be && c.selection && d.rangeRef(c, c.selection);
7671
+ var qe = !Ee && c.selection && d.rangeRef(c, c.selection);
7672
7672
  Q.select(c, Te), qe && Xr.set(c, qe);
7673
7673
  }
7674
7674
  }
7675
7675
  }
7676
- if (Be)
7676
+ if (Ee)
7677
7677
  return;
7678
- if (Ae || x.preventDefault(), me && R.isExpanded(me) && Ce.startsWith("delete")) {
7678
+ if (Ae || x.preventDefault(), me && N.isExpanded(me) && Ce.startsWith("delete")) {
7679
7679
  var It = Ce.endsWith("Backward") ? "backward" : "forward";
7680
7680
  d.deleteFragment(c, {
7681
7681
  direction: It
@@ -7755,18 +7755,18 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7755
7755
  case "insertFromYank":
7756
7756
  case "insertReplacementText":
7757
7757
  case "insertText": {
7758
- Ce === "insertFromComposition" && _.isComposing(c) && (B(!1), sr.set(c, !1)), Fe?.constructor.name === "DataTransfer" ? _.insertData(c, Fe) : typeof Fe == "string" && (Ae ? w.current.push(() => d.insertText(c, Fe)) : d.insertText(c, Fe));
7758
+ Ce === "insertFromComposition" && W.isComposing(c) && (B(!1), sr.set(c, !1)), Fe?.constructor.name === "DataTransfer" ? W.insertData(c, Fe) : typeof Fe == "string" && (Ae ? w.current.push(() => d.insertText(c, Fe)) : d.insertText(c, Fe));
7759
7759
  break;
7760
7760
  }
7761
7761
  }
7762
7762
  var zt = (we = Xr.get(c)) === null || we === void 0 ? void 0 : we.unref();
7763
- Xr.delete(c), zt && (!c.selection || !R.equals(c.selection, zt)) && Q.select(c, zt);
7763
+ Xr.delete(c), zt && (!c.selection || !N.equals(c.selection, zt)) && Q.select(c, zt);
7764
7764
  }
7765
- }, [c, I, z, i, o, O]), P = ke((x) => {
7766
- x == null ? (I.cancel(), O.cancel(), Ln.delete(c), cr.delete(c), F.current && Yt && F.current.removeEventListener("beforeinput", k)) : Yt && x.addEventListener("beforeinput", k), F.current = x, typeof t == "function" ? t(x) : t && (t.current = x);
7767
- }, [I, O, c, k, t]);
7765
+ }, [c, z, I, i, o, O]), P = ke((x) => {
7766
+ x == null ? (z.cancel(), O.cancel(), Ln.delete(c), cr.delete(c), F.current && Yt && F.current.removeEventListener("beforeinput", k)) : Yt && x.addEventListener("beforeinput", k), F.current = x, typeof t == "function" ? t(x) : t && (t.current = x);
7767
+ }, [z, O, c, k, t]);
7768
7768
  fn(() => {
7769
- var x = _.getWindow(c);
7769
+ var x = W.getWindow(c);
7770
7770
  x.document.addEventListener("selectionchange", O);
7771
7771
  var J = () => {
7772
7772
  L.isDraggingInternally = !1;
@@ -7775,7 +7775,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7775
7775
  x.document.removeEventListener("selectionchange", O), x.document.removeEventListener("dragend", J), x.document.removeEventListener("drop", J);
7776
7776
  };
7777
7777
  }, [O, L]);
7778
- var $ = a([c, []]), U = s && c.children.length === 1 && Array.from(ae.texts(c)).length === 1 && ae.string(c) === "" && !E, Y = ke((x) => {
7778
+ var $ = a([c, []]), U = s && c.children.length === 1 && Array.from(ie.texts(c)).length === 1 && ie.string(c) === "" && !E, Y = ke((x) => {
7779
7779
  if (x && U) {
7780
7780
  var J;
7781
7781
  S((J = x.getBoundingClientRect()) === null || J === void 0 ? void 0 : J.height);
@@ -7795,10 +7795,10 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7795
7795
  var {
7796
7796
  marks: q
7797
7797
  } = c;
7798
- if (L.hasMarkPlaceholder = !1, c.selection && R.isCollapsed(c.selection) && q) {
7798
+ if (L.hasMarkPlaceholder = !1, c.selection && N.isCollapsed(c.selection) && q) {
7799
7799
  var {
7800
7800
  anchor: ee
7801
- } = c.selection, se = ae.leaf(c, ee.path), xe = Or(se, Wp);
7801
+ } = c.selection, se = ie.leaf(c, ee.path), xe = Or(se, Wp);
7802
7802
  if (!he.equals(se, q, {
7803
7803
  loose: !0
7804
7804
  })) {
@@ -7820,7 +7820,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7820
7820
  if (x) {
7821
7821
  var {
7822
7822
  anchor: J
7823
- } = x, H = ae.leaf(c, J.path);
7823
+ } = x, H = ie.leaf(c, J.path);
7824
7824
  if (q && !he.equals(H, q, {
7825
7825
  loose: !0
7826
7826
  })) {
@@ -7872,20 +7872,20 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7872
7872
  minHeight: T
7873
7873
  } : {})), p),
7874
7874
  onBeforeInput: ke((x) => {
7875
- if (!Yt && !o && !dt(x, D.onBeforeInput) && _.hasSelectableTarget(c, x.target) && (x.preventDefault(), !_.isComposing(c))) {
7875
+ if (!Yt && !o && !dt(x, D.onBeforeInput) && W.hasSelectableTarget(c, x.target) && (x.preventDefault(), !W.isComposing(c))) {
7876
7876
  var J = x.data;
7877
7877
  d.insertText(c, J);
7878
7878
  }
7879
7879
  }, [D.onBeforeInput, c, o]),
7880
7880
  onInput: ke((x) => {
7881
7881
  if (!dt(x, D.onInput)) {
7882
- if (N.current) {
7883
- N.current.handleInput();
7882
+ if (M.current) {
7883
+ M.current.handleInput();
7884
7884
  return;
7885
7885
  }
7886
7886
  for (var J of w.current)
7887
7887
  J();
7888
- if (w.current = [], !_.isFocused(c)) {
7888
+ if (w.current = [], !W.isFocused(c)) {
7889
7889
  var H = x.nativeEvent, V = c;
7890
7890
  if (H.inputType === "historyUndo" && typeof V.undo == "function") {
7891
7891
  V.undo();
@@ -7899,15 +7899,15 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7899
7899
  }
7900
7900
  }, [D.onInput, c]),
7901
7901
  onBlur: ke((x) => {
7902
- if (!(o || L.isUpdatingSelection || !_.hasSelectableTarget(c, x.target) || dt(x, D.onBlur))) {
7903
- var J = _.findDocumentOrShadowRoot(c);
7902
+ if (!(o || L.isUpdatingSelection || !W.hasSelectableTarget(c, x.target) || dt(x, D.onBlur))) {
7903
+ var J = W.findDocumentOrShadowRoot(c);
7904
7904
  if (L.latestElement !== J.activeElement) {
7905
7905
  var {
7906
7906
  relatedTarget: H
7907
- } = x, V = _.toDOMNode(c, c);
7907
+ } = x, V = W.toDOMNode(c, c);
7908
7908
  if (H !== V && !(Et(H) && H.hasAttribute("data-slate-spacer"))) {
7909
- if (H != null && Qt(H) && _.hasDOMNode(c, H)) {
7910
- var ne = _.toSlateNode(c, H);
7909
+ if (H != null && Qt(H) && W.hasDOMNode(c, H)) {
7910
+ var ne = W.toSlateNode(c, H);
7911
7911
  if (pe.isElement(ne) && !c.isVoid(ne))
7912
7912
  return;
7913
7913
  }
@@ -7921,9 +7921,9 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7921
7921
  }
7922
7922
  }, [o, L.isUpdatingSelection, L.latestElement, c, D.onBlur]),
7923
7923
  onClick: ke((x) => {
7924
- if (_.hasTarget(c, x.target) && !dt(x, D.onClick) && Qt(x.target)) {
7925
- var J = _.toSlateNode(c, x.target), H = _.findPath(c, J);
7926
- if (!d.hasPath(c, H) || ae.get(c, H) !== J)
7924
+ if (W.hasTarget(c, x.target) && !dt(x, D.onClick) && Qt(x.target)) {
7925
+ var J = W.toSlateNode(c, x.target), H = W.findPath(c, J);
7926
+ if (!d.hasPath(c, H) || ie.get(c, H) !== J)
7927
7927
  return;
7928
7928
  if (x.detail === jp && H.length >= 1) {
7929
7929
  var V = H;
@@ -7946,17 +7946,17 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7946
7946
  at: me
7947
7947
  });
7948
7948
  if (Ce && Fe && C.equals(Ce[1], Fe[1])) {
7949
- var Be = d.range(c, we);
7950
- Q.select(c, Be);
7949
+ var Ee = d.range(c, we);
7950
+ Q.select(c, Ee);
7951
7951
  }
7952
7952
  }
7953
7953
  }, [c, D.onClick, o]),
7954
7954
  onCompositionEnd: ke((x) => {
7955
- if (_.hasSelectableTarget(c, x.target)) {
7955
+ if (W.hasSelectableTarget(c, x.target)) {
7956
7956
  var J;
7957
- if (_.isComposing(c) && Promise.resolve().then(() => {
7957
+ if (W.isComposing(c) && Promise.resolve().then(() => {
7958
7958
  B(!1), sr.set(c, !1);
7959
- }), (J = N.current) === null || J === void 0 || J.handleCompositionEnd(x), dt(x, D.onCompositionEnd) || ht)
7959
+ }), (J = M.current) === null || J === void 0 || J.handleCompositionEnd(x), dt(x, D.onCompositionEnd) || ht)
7960
7960
  return;
7961
7961
  if (!ar && !Ph && !Iu && !Nh && !Rh && x.data) {
7962
7962
  var H = St.get(c);
@@ -7967,50 +7967,50 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
7967
7967
  }
7968
7968
  }, [D.onCompositionEnd, c]),
7969
7969
  onCompositionUpdate: ke((x) => {
7970
- _.hasSelectableTarget(c, x.target) && !dt(x, D.onCompositionUpdate) && (_.isComposing(c) || (B(!0), sr.set(c, !0)));
7970
+ W.hasSelectableTarget(c, x.target) && !dt(x, D.onCompositionUpdate) && (W.isComposing(c) || (B(!0), sr.set(c, !0)));
7971
7971
  }, [D.onCompositionUpdate, c]),
7972
7972
  onCompositionStart: ke((x) => {
7973
- if (_.hasSelectableTarget(c, x.target)) {
7973
+ if (W.hasSelectableTarget(c, x.target)) {
7974
7974
  var J;
7975
- if ((J = N.current) === null || J === void 0 || J.handleCompositionStart(x), dt(x, D.onCompositionStart) || ht)
7975
+ if ((J = M.current) === null || J === void 0 || J.handleCompositionStart(x), dt(x, D.onCompositionStart) || ht)
7976
7976
  return;
7977
7977
  B(!0);
7978
7978
  var {
7979
7979
  selection: H
7980
7980
  } = c;
7981
- if (H && R.isExpanded(H)) {
7981
+ if (H && N.isExpanded(H)) {
7982
7982
  d.deleteFragment(c);
7983
7983
  return;
7984
7984
  }
7985
7985
  }
7986
7986
  }, [D.onCompositionStart, c]),
7987
7987
  onCopy: ke((x) => {
7988
- _.hasSelectableTarget(c, x.target) && !dt(x, D.onCopy) && !Io(x) && (x.preventDefault(), _.setFragmentData(c, x.clipboardData, "copy"));
7988
+ W.hasSelectableTarget(c, x.target) && !dt(x, D.onCopy) && !Io(x) && (x.preventDefault(), W.setFragmentData(c, x.clipboardData, "copy"));
7989
7989
  }, [D.onCopy, c]),
7990
7990
  onCut: ke((x) => {
7991
- if (!o && _.hasSelectableTarget(c, x.target) && !dt(x, D.onCut) && !Io(x)) {
7992
- x.preventDefault(), _.setFragmentData(c, x.clipboardData, "cut");
7991
+ if (!o && W.hasSelectableTarget(c, x.target) && !dt(x, D.onCut) && !Io(x)) {
7992
+ x.preventDefault(), W.setFragmentData(c, x.clipboardData, "cut");
7993
7993
  var {
7994
7994
  selection: J
7995
7995
  } = c;
7996
7996
  if (J)
7997
- if (R.isExpanded(J))
7997
+ if (N.isExpanded(J))
7998
7998
  d.deleteFragment(c);
7999
7999
  else {
8000
- var H = ae.parent(c, J.anchor.path);
8000
+ var H = ie.parent(c, J.anchor.path);
8001
8001
  d.isVoid(c, H) && Q.delete(c);
8002
8002
  }
8003
8003
  }
8004
8004
  }, [o, c, D.onCut]),
8005
8005
  onDragOver: ke((x) => {
8006
- if (_.hasTarget(c, x.target) && !dt(x, D.onDragOver)) {
8007
- var J = _.toSlateNode(c, x.target);
8006
+ if (W.hasTarget(c, x.target) && !dt(x, D.onDragOver)) {
8007
+ var J = W.toSlateNode(c, x.target);
8008
8008
  pe.isElement(J) && d.isVoid(c, J) && x.preventDefault();
8009
8009
  }
8010
8010
  }, [D.onDragOver, c]),
8011
8011
  onDragStart: ke((x) => {
8012
- if (!o && _.hasTarget(c, x.target) && !dt(x, D.onDragStart)) {
8013
- var J = _.toSlateNode(c, x.target), H = _.findPath(c, J), V = pe.isElement(J) && d.isVoid(c, J) || d.void(c, {
8012
+ if (!o && W.hasTarget(c, x.target) && !dt(x, D.onDragStart)) {
8013
+ var J = W.toSlateNode(c, x.target), H = W.findPath(c, J), V = pe.isElement(J) && d.isVoid(c, J) || d.void(c, {
8014
8014
  at: H,
8015
8015
  voids: !0
8016
8016
  });
@@ -8018,27 +8018,27 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8018
8018
  var ne = d.range(c, H);
8019
8019
  Q.select(c, ne);
8020
8020
  }
8021
- L.isDraggingInternally = !0, _.setFragmentData(c, x.dataTransfer, "drag");
8021
+ L.isDraggingInternally = !0, W.setFragmentData(c, x.dataTransfer, "drag");
8022
8022
  }
8023
8023
  }, [o, c, D.onDragStart, L]),
8024
8024
  onDrop: ke((x) => {
8025
- if (!o && _.hasTarget(c, x.target) && !dt(x, D.onDrop)) {
8025
+ if (!o && W.hasTarget(c, x.target) && !dt(x, D.onDrop)) {
8026
8026
  x.preventDefault();
8027
- var J = c.selection, H = _.findEventRange(c, x), V = x.dataTransfer;
8028
- Q.select(c, H), L.isDraggingInternally && J && !R.equals(J, H) && !d.void(c, {
8027
+ var J = c.selection, H = W.findEventRange(c, x), V = x.dataTransfer;
8028
+ Q.select(c, H), L.isDraggingInternally && J && !N.equals(J, H) && !d.void(c, {
8029
8029
  at: H,
8030
8030
  voids: !0
8031
8031
  }) && Q.delete(c, {
8032
8032
  at: J
8033
- }), _.insertData(c, V), _.isFocused(c) || _.focus(c);
8033
+ }), W.insertData(c, V), W.isFocused(c) || W.focus(c);
8034
8034
  }
8035
8035
  }, [o, c, D.onDrop, L]),
8036
8036
  onDragEnd: ke((x) => {
8037
- !o && L.isDraggingInternally && D.onDragEnd && _.hasTarget(c, x.target) && D.onDragEnd(x);
8037
+ !o && L.isDraggingInternally && D.onDragEnd && W.hasTarget(c, x.target) && D.onDragEnd(x);
8038
8038
  }, [o, L, D, c]),
8039
8039
  onFocus: ke((x) => {
8040
- if (!o && !L.isUpdatingSelection && _.hasEditableTarget(c, x.target) && !dt(x, D.onFocus)) {
8041
- var J = _.toDOMNode(c, c), H = _.findDocumentOrShadowRoot(c);
8040
+ if (!o && !L.isUpdatingSelection && W.hasEditableTarget(c, x.target) && !dt(x, D.onFocus)) {
8041
+ var J = W.toDOMNode(c, c), H = W.findDocumentOrShadowRoot(c);
8042
8042
  if (L.latestElement = H.activeElement, Fr && x.target !== J) {
8043
8043
  J.focus();
8044
8044
  return;
@@ -8047,17 +8047,17 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8047
8047
  }
8048
8048
  }, [o, L, c, D.onFocus]),
8049
8049
  onKeyDown: ke((x) => {
8050
- if (!o && _.hasEditableTarget(c, x.target)) {
8050
+ if (!o && W.hasEditableTarget(c, x.target)) {
8051
8051
  var J;
8052
- (J = N.current) === null || J === void 0 || J.handleKeyDown(x);
8052
+ (J = M.current) === null || J === void 0 || J.handleKeyDown(x);
8053
8053
  var {
8054
8054
  nativeEvent: H
8055
8055
  } = x;
8056
- if (_.isComposing(c) && H.isComposing === !1 && (sr.set(c, !1), B(!1)), dt(x, D.onKeyDown) || _.isComposing(c))
8056
+ if (W.isComposing(c) && H.isComposing === !1 && (sr.set(c, !1), B(!1)), dt(x, D.onKeyDown) || W.isComposing(c))
8057
8057
  return;
8058
8058
  var {
8059
8059
  selection: V
8060
- } = c, ne = c.children[V !== null ? V.focus.path[0] : 0], te = Fu(ae.string(ne)) === "rtl";
8060
+ } = c, ne = c.children[V !== null ? V.focus.path[0] : 0], te = Fu(ie.string(ne)) === "rtl";
8061
8061
  if (Xe.isRedo(H)) {
8062
8062
  x.preventDefault();
8063
8063
  var de = c;
@@ -8099,7 +8099,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8099
8099
  return;
8100
8100
  }
8101
8101
  if (Xe.isMoveBackward(H)) {
8102
- x.preventDefault(), V && R.isCollapsed(V) ? Q.move(c, {
8102
+ x.preventDefault(), V && N.isCollapsed(V) ? Q.move(c, {
8103
8103
  reverse: !te
8104
8104
  }) : Q.collapse(c, {
8105
8105
  edge: te ? "end" : "start"
@@ -8107,7 +8107,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8107
8107
  return;
8108
8108
  }
8109
8109
  if (Xe.isMoveForward(H)) {
8110
- x.preventDefault(), V && R.isCollapsed(V) ? Q.move(c, {
8110
+ x.preventDefault(), V && N.isCollapsed(V) ? Q.move(c, {
8111
8111
  reverse: te
8112
8112
  }) : Q.collapse(c, {
8113
8113
  edge: te ? "start" : "end"
@@ -8115,7 +8115,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8115
8115
  return;
8116
8116
  }
8117
8117
  if (Xe.isMoveWordBackward(H)) {
8118
- x.preventDefault(), V && R.isExpanded(V) && Q.collapse(c, {
8118
+ x.preventDefault(), V && N.isExpanded(V) && Q.collapse(c, {
8119
8119
  edge: "focus"
8120
8120
  }), Q.move(c, {
8121
8121
  unit: "word",
@@ -8124,7 +8124,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8124
8124
  return;
8125
8125
  }
8126
8126
  if (Xe.isMoveWordForward(H)) {
8127
- x.preventDefault(), V && R.isExpanded(V) && Q.collapse(c, {
8127
+ x.preventDefault(), V && N.isExpanded(V) && Q.collapse(c, {
8128
8128
  edge: "focus"
8129
8129
  }), Q.move(c, {
8130
8130
  unit: "word",
@@ -8133,8 +8133,8 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8133
8133
  return;
8134
8134
  }
8135
8135
  if (Yt) {
8136
- if ((zu || ar) && V && (Xe.isDeleteBackward(H) || Xe.isDeleteForward(H)) && R.isCollapsed(V)) {
8137
- var me = ae.parent(c, V.anchor.path);
8136
+ if ((zu || ar) && V && (Xe.isDeleteBackward(H) || Xe.isDeleteForward(H)) && N.isCollapsed(V)) {
8137
+ var me = ie.parent(c, V.anchor.path);
8138
8138
  if (pe.isElement(me) && d.isVoid(c, me) && (d.isInline(c, me) || d.isBlock(c, me))) {
8139
8139
  x.preventDefault(), d.deleteBackward(c, {
8140
8140
  unit: "block"
@@ -8156,19 +8156,19 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8156
8156
  return;
8157
8157
  }
8158
8158
  if (Xe.isDeleteBackward(H)) {
8159
- x.preventDefault(), V && R.isExpanded(V) ? d.deleteFragment(c, {
8159
+ x.preventDefault(), V && N.isExpanded(V) ? d.deleteFragment(c, {
8160
8160
  direction: "backward"
8161
8161
  }) : d.deleteBackward(c);
8162
8162
  return;
8163
8163
  }
8164
8164
  if (Xe.isDeleteForward(H)) {
8165
- x.preventDefault(), V && R.isExpanded(V) ? d.deleteFragment(c, {
8165
+ x.preventDefault(), V && N.isExpanded(V) ? d.deleteFragment(c, {
8166
8166
  direction: "forward"
8167
8167
  }) : d.deleteForward(c);
8168
8168
  return;
8169
8169
  }
8170
8170
  if (Xe.isDeleteLineBackward(H)) {
8171
- x.preventDefault(), V && R.isExpanded(V) ? d.deleteFragment(c, {
8171
+ x.preventDefault(), V && N.isExpanded(V) ? d.deleteFragment(c, {
8172
8172
  direction: "backward"
8173
8173
  }) : d.deleteBackward(c, {
8174
8174
  unit: "line"
@@ -8176,7 +8176,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8176
8176
  return;
8177
8177
  }
8178
8178
  if (Xe.isDeleteLineForward(H)) {
8179
- x.preventDefault(), V && R.isExpanded(V) ? d.deleteFragment(c, {
8179
+ x.preventDefault(), V && N.isExpanded(V) ? d.deleteFragment(c, {
8180
8180
  direction: "forward"
8181
8181
  }) : d.deleteForward(c, {
8182
8182
  unit: "line"
@@ -8184,7 +8184,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8184
8184
  return;
8185
8185
  }
8186
8186
  if (Xe.isDeleteWordBackward(H)) {
8187
- x.preventDefault(), V && R.isExpanded(V) ? d.deleteFragment(c, {
8187
+ x.preventDefault(), V && N.isExpanded(V) ? d.deleteFragment(c, {
8188
8188
  direction: "backward"
8189
8189
  }) : d.deleteBackward(c, {
8190
8190
  unit: "word"
@@ -8192,7 +8192,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8192
8192
  return;
8193
8193
  }
8194
8194
  if (Xe.isDeleteWordForward(H)) {
8195
- x.preventDefault(), V && R.isExpanded(V) ? d.deleteFragment(c, {
8195
+ x.preventDefault(), V && N.isExpanded(V) ? d.deleteFragment(c, {
8196
8196
  direction: "forward"
8197
8197
  }) : d.deleteForward(c, {
8198
8198
  unit: "word"
@@ -8203,7 +8203,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8203
8203
  }
8204
8204
  }, [o, c, D.onKeyDown]),
8205
8205
  onPaste: ke((x) => {
8206
- !o && _.hasEditableTarget(c, x.target) && !dt(x, D.onPaste) && (!Yt || zh(x.nativeEvent) || ar) && (x.preventDefault(), _.insertData(c, x.clipboardData));
8206
+ !o && W.hasEditableTarget(c, x.target) && !dt(x, D.onPaste) && (!Yt || zh(x.nativeEvent) || ar) && (x.preventDefault(), W.insertData(c, x.clipboardData));
8207
8207
  }, [o, c, D.onPaste])
8208
8208
  }), /* @__PURE__ */ be.createElement(qp, {
8209
8209
  decorations: $,
@@ -8224,7 +8224,7 @@ var qp = (e) => /* @__PURE__ */ be.createElement(be.Fragment, null, Qu(e)), Ga =
8224
8224
  /* @__PURE__ */ be.createElement("span", Rt({}, t), r, ht && /* @__PURE__ */ be.createElement("br", null))
8225
8225
  );
8226
8226
  }, Up = () => [], Vp = (e, t) => {
8227
- if (t.getBoundingClientRect && (!e.selection || e.selection && R.isCollapsed(e.selection))) {
8227
+ if (t.getBoundingClientRect && (!e.selection || e.selection && N.isCollapsed(e.selection))) {
8228
8228
  var r = t.startContainer.parentElement;
8229
8229
  r.getBoundingClientRect = t.getBoundingClientRect.bind(t), ih(r, {
8230
8230
  scrollMode: "if-needed"
@@ -8266,7 +8266,7 @@ var Jp = ["editor", "children", "onChange", "onSelectionChange", "onValueChange"
8266
8266
  onValueChange: i,
8267
8267
  initialValue: s
8268
8268
  } = e, o = Or(e, Jp), [l, u] = be.useState(() => {
8269
- if (!ae.isNodeList(s))
8269
+ if (!ie.isNodeList(s))
8270
8270
  throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(at.stringify(s)));
8271
8271
  if (!d.isEditor(t))
8272
8272
  throw new Error("[Slate] editor is invalid! You passed: ".concat(at.stringify(t)));
@@ -8295,11 +8295,11 @@ var Jp = ["editor", "children", "onChange", "onSelectionChange", "onValueChange"
8295
8295
  gi.set(t, () => {
8296
8296
  });
8297
8297
  }), [t, p]);
8298
- var [g, v] = $e(_.isFocused(t));
8298
+ var [g, v] = $e(W.isFocused(t));
8299
8299
  return Je(() => {
8300
- v(_.isFocused(t));
8300
+ v(W.isFocused(t));
8301
8301
  }, [t]), fn(() => {
8302
- var D = () => v(_.isFocused(t));
8302
+ var D = () => v(W.isFocused(t));
8303
8303
  return Mu >= 17 ? (document.addEventListener("focusin", D), document.addEventListener("focusout", D), () => {
8304
8304
  document.removeEventListener("focusin", D), document.removeEventListener("focusout", D);
8305
8305
  }) : (document.addEventListener("focus", D, !0), document.addEventListener("blur", D, !0), () => {
@@ -8318,10 +8318,10 @@ var Jp = ["editor", "children", "onChange", "onSelectionChange", "onValueChange"
8318
8318
  var r = (t.top + t.bottom) / 2;
8319
8319
  return e.top <= r && e.bottom >= r;
8320
8320
  }, Lo = (e, t, r) => {
8321
- var n = _.toDOMRange(e, t).getBoundingClientRect(), a = _.toDOMRange(e, r).getBoundingClientRect();
8321
+ var n = W.toDOMRange(e, t).getBoundingClientRect(), a = W.toDOMRange(e, r).getBoundingClientRect();
8322
8322
  return zo(n, a) && zo(a, n);
8323
8323
  }, Xp = (e, t) => {
8324
- var r = d.range(e, R.end(t)), n = Array.from(d.positions(e, {
8324
+ var r = d.range(e, N.end(t)), n = Array.from(d.positions(e, {
8325
8325
  at: t
8326
8326
  })), a = 0, i = n.length, s = Math.floor(i / 2);
8327
8327
  if (Lo(e, d.range(e, n[a]), r))
@@ -8370,14 +8370,14 @@ var Qp = function(t) {
8370
8370
  }, n.deleteBackward = (u) => {
8371
8371
  if (u !== "line")
8372
8372
  return s(u);
8373
- if (n.selection && R.isCollapsed(n.selection)) {
8373
+ if (n.selection && N.isCollapsed(n.selection)) {
8374
8374
  var f = d.above(n, {
8375
8375
  match: (v) => pe.isElement(v) && d.isBlock(n, v),
8376
8376
  at: n.selection
8377
8377
  });
8378
8378
  if (f) {
8379
8379
  var [, h] = f, p = d.range(n, h, n.selection.anchor), g = Xp(n, p);
8380
- R.isCollapsed(g) || Q.delete(n, {
8380
+ N.isCollapsed(g) || Q.delete(n, {
8381
8381
  at: g
8382
8382
  });
8383
8383
  }
@@ -8425,7 +8425,7 @@ var Qp = function(t) {
8425
8425
  f.push(...Cr(n, F));
8426
8426
  var w;
8427
8427
  C.isBefore(u.path, u.newPath) ? (f.push(...Cr(n, C.parent(u.path))), w = u.newPath) : (f.push(...Cr(n, C.parent(u.newPath))), w = u.path);
8428
- var T = ae.get(t, C.parent(w)), S = _.findKey(n, T), A = d.pathRef(n, C.parent(w));
8428
+ var T = ie.get(t, C.parent(w)), S = W.findKey(n, T), A = d.pathRef(n, C.parent(w));
8429
8429
  h.push([A, S]);
8430
8430
  break;
8431
8431
  }
@@ -8438,14 +8438,14 @@ var Qp = function(t) {
8438
8438
  case "split_node":
8439
8439
  Sr.set(n, !0);
8440
8440
  }
8441
- for (var [z, K] of f) {
8442
- var [G] = d.node(n, z);
8441
+ for (var [I, K] of f) {
8442
+ var [G] = d.node(n, I);
8443
8443
  ea.set(G, K);
8444
8444
  }
8445
- for (var [L, N] of h) {
8445
+ for (var [L, M] of h) {
8446
8446
  if (L.current) {
8447
- var [I] = d.node(n, L.current);
8448
- ea.set(I, N);
8447
+ var [z] = d.node(n, L.current);
8448
+ ea.set(z, M);
8449
8449
  }
8450
8450
  L.unref();
8451
8451
  }
@@ -8454,17 +8454,17 @@ var Qp = function(t) {
8454
8454
  selection: f
8455
8455
  } = n;
8456
8456
  if (f) {
8457
- var [h, p] = R.edges(f), g = d.void(n, {
8457
+ var [h, p] = N.edges(f), g = d.void(n, {
8458
8458
  at: h.path
8459
8459
  }), v = d.void(n, {
8460
8460
  at: p.path
8461
8461
  });
8462
- if (!(R.isCollapsed(f) && !g)) {
8463
- var D = _.toDOMRange(n, f), c = D.cloneContents(), E = c.childNodes[0];
8462
+ if (!(N.isCollapsed(f) && !g)) {
8463
+ var D = W.toDOMRange(n, f), c = D.cloneContents(), E = c.childNodes[0];
8464
8464
  if (c.childNodes.forEach((G) => {
8465
8465
  G.textContent && G.textContent.trim() !== "" && (E = G);
8466
8466
  }), v) {
8467
- var [B] = v, F = D.cloneRange(), w = _.toDOMNode(n, B);
8467
+ var [B] = v, F = D.cloneRange(), w = W.toDOMNode(n, B);
8468
8468
  F.setEndAfter(w), c = F.cloneContents();
8469
8469
  }
8470
8470
  if (g && (E = c.querySelector("[data-slate-spacer]")), Array.from(c.querySelectorAll("[data-slate-zero-width]")).forEach((G) => {
@@ -8475,8 +8475,8 @@ var Qp = function(t) {
8475
8475
  var T = E.ownerDocument.createElement("span");
8476
8476
  T.style.whiteSpace = "pre", T.appendChild(E), c.appendChild(T), E = T;
8477
8477
  }
8478
- var S = n.getFragment(), A = JSON.stringify(S), z = window.btoa(encodeURIComponent(A));
8479
- E.setAttribute("data-slate-fragment", z), u.setData("application/".concat(r), z);
8478
+ var S = n.getFragment(), A = JSON.stringify(S), I = window.btoa(encodeURIComponent(A));
8479
+ E.setAttribute("data-slate-fragment", I), u.setData("application/".concat(r), I);
8480
8480
  var K = c.ownerDocument.createElement("div");
8481
8481
  return K.appendChild(c), K.setAttribute("hidden", "true"), c.ownerDocument.body.appendChild(K), u.setData("text/html", K.innerHTML), u.setData("text/plain", Vu(K)), c.ownerDocument.body.removeChild(K), u;
8482
8482
  }
@@ -8513,7 +8513,7 @@ var Qp = function(t) {
8513
8513
  for (var [n, a] of d.levels(e, {
8514
8514
  at: t
8515
8515
  })) {
8516
- var i = _.findKey(e, n);
8516
+ var i = W.findKey(e, n);
8517
8517
  r.push([a, i]);
8518
8518
  }
8519
8519
  return r;
@@ -11129,9 +11129,9 @@ function _m(e, t, r) {
11129
11129
  }
11130
11130
  var E = new Lm(r, p, n ? a.componentStyle : void 0);
11131
11131
  function B(w, T) {
11132
- return (function(S, A, z) {
11133
- var K = S.attrs, G = S.componentStyle, L = S.defaultProps, N = S.foldedComponentIds, I = S.styledComponentId, O = S.target, k = be.useContext(Ml), P = su(), $ = S.shouldForwardProp || P.shouldForwardProp;
11134
- process.env.NODE_ENV !== "production" && ss(I);
11132
+ return (function(S, A, I) {
11133
+ var K = S.attrs, G = S.componentStyle, L = S.defaultProps, M = S.foldedComponentIds, z = S.styledComponentId, O = S.target, k = be.useContext(Ml), P = su(), $ = S.shouldForwardProp || P.shouldForwardProp;
11134
+ process.env.NODE_ENV !== "production" && ss(z);
11135
11135
  var U = sm(A, k, L) || Rr, Y = (function(le, x, J) {
11136
11136
  for (var H, V = yt(yt({}, x), { className: void 0, theme: J }), ne = 0; ne < le.length; ne += 1) {
11137
11137
  var te = Nr(H = le[ne]) ? H(V) : H;
@@ -11145,8 +11145,8 @@ function _m(e, t, r) {
11145
11145
  return process.env.NODE_ENV !== "production" && ss(H), H;
11146
11146
  })(G, Y);
11147
11147
  process.env.NODE_ENV !== "production" && S.warnTooManyClasses && S.warnTooManyClasses(se);
11148
- var xe = or(N, I);
11149
- return se && (xe += " " + se), Y.className && (xe += " " + Y.className), q[Qa(Z) && !Ai.has(Z) ? "class" : "className"] = xe, z && (q.ref = z), Yn(Z, q);
11148
+ var xe = or(M, z);
11149
+ return se && (xe += " " + se), Y.className && (xe += " " + Y.className), q[Qa(Z) && !Ai.has(Z) ? "class" : "className"] = xe, I && (q.ref = I), Yn(Z, q);
11150
11150
  })(F, w, T);
11151
11151
  }
11152
11152
  B.displayName = h;
@@ -11156,13 +11156,13 @@ function _m(e, t, r) {
11156
11156
  }, set: function(w) {
11157
11157
  this._foldedDefaultProps = n ? (function(T) {
11158
11158
  for (var S = [], A = 1; A < arguments.length; A++) S[A - 1] = arguments[A];
11159
- for (var z = 0, K = S; z < K.length; z++) ki(T, K[z], !0);
11159
+ for (var I = 0, K = S; I < K.length; I++) ki(T, K[I], !0);
11160
11160
  return T;
11161
11161
  })({}, a.defaultProps, w) : w;
11162
11162
  } }), process.env.NODE_ENV !== "production" && (im(h, p), F.warnTooManyClasses = /* @__PURE__ */ (function(w, T) {
11163
11163
  var S = {}, A = !1;
11164
- return function(z) {
11165
- if (!A && (S[z] = !0, Object.keys(S).length >= 200)) {
11164
+ return function(I) {
11165
+ if (!A && (S[I] = !0, Object.keys(S).length >= 200)) {
11166
11166
  var K = T ? ' with the id of "'.concat(T, '"') : "";
11167
11167
  console.warn("Over ".concat(200, " classes were generated for component ").concat(w).concat(K, `.
11168
11168
  `) + `Consider using the attrs method, together with a style object for frequently changed styles.
@@ -11314,8 +11314,8 @@ const qm = Qe.span`
11314
11314
  if (S) {
11315
11315
  const A = S.closest('.sc-jwTyAe, .bdQKlw, [role="textbox"]') || S.parentElement;
11316
11316
  if (A) {
11317
- const z = A.clientWidth, K = z - 40;
11318
- return console.log("TemplateField: \u7F16\u8F91\u5668\u5BB9\u5668\u5BBD\u5EA6:", z, "\u53EF\u7528\u5BBD\u5EA6:", K), Math.max(K, 200);
11317
+ const I = A.clientWidth, K = I - 40;
11318
+ return console.log("TemplateField: \u7F16\u8F91\u5668\u5BB9\u5668\u5BBD\u5EA6:", I, "\u53EF\u7528\u5BBD\u5EA6:", K), Math.max(K, 200);
11319
11319
  }
11320
11320
  }
11321
11321
  return 600;
@@ -11338,7 +11338,7 @@ const qm = Qe.span`
11338
11338
  const A = S.target.value;
11339
11339
  f(A);
11340
11340
  }, []), F = ke(() => {
11341
- const S = _.findPath(s, e);
11341
+ const S = W.findPath(s, e);
11342
11342
  console.log("TemplateField: \u627E\u5230\u5143\u7D20\u8DEF\u5F84:", S), console.log("TemplateField: \u5F53\u524D\u5143\u7D20:", e), console.log("TemplateField: \u8981\u8BBE\u7F6E\u7684\u503C:", u), Q.setNodes(
11343
11343
  s,
11344
11344
  { value: u },
@@ -11346,9 +11346,9 @@ const qm = Qe.span`
11346
11346
  );
11347
11347
  const A = u.trim() !== "" ? u : e.placeholder || "\u6A21\u7248\u5B57\u7B26\u5185\u5BB9";
11348
11348
  p(A);
11349
- const z = s.children[S[0]];
11350
- if (z && "children" in z) {
11351
- const K = z.children[S[1]];
11349
+ const I = s.children[S[0]];
11350
+ if (I && "children" in I) {
11351
+ const K = I.children[S[1]];
11352
11352
  console.log("TemplateField: \u66F4\u65B0\u540E\u7684\u5143\u7D20:", K);
11353
11353
  }
11354
11354
  l(!1);
@@ -11485,16 +11485,16 @@ const Um = ({ children: e, attributes: t, styles: r, extraProps: n }) => {
11485
11485
  for (const G of w) {
11486
11486
  const L = G?.reply;
11487
11487
  if (!L?.databaseReference) continue;
11488
- const N = L.databaseReference;
11489
- console.log(N, "123123123jk123lk12j3l12jl3"), N?.retrieveSqlData && (console.log("Found source in raw12eku1h2lkjeh12ljkhelk12hejk:", N.retrieveSqlData.filePath), A = N.retrieveSqlData.filePath);
11490
- let I = N;
11491
- if (typeof N == "string")
11488
+ const M = L.databaseReference;
11489
+ console.log(M, "123123123jk123lk12j3l12jl3"), M?.retrieveSqlData && (console.log("Found source in raw12eku1h2lkjeh12ljkhelk12hejk:", M.retrieveSqlData.filePath), A = M.retrieveSqlData.filePath);
11490
+ let z = M;
11491
+ if (typeof M == "string")
11492
11492
  try {
11493
- I = JSON.parse(N);
11493
+ z = JSON.parse(M);
11494
11494
  } catch {
11495
11495
  }
11496
- if (!I) continue;
11497
- const O = Array.isArray(I) ? I : [I], k = O.findIndex((U) => U?.id === t.id), P = k >= 0 ? O[k] : null;
11496
+ if (!z) continue;
11497
+ const O = Array.isArray(z) ? z : [z], k = O.findIndex((U) => U?.id === t.id), P = k >= 0 ? O[k] : null;
11498
11498
  if (console.log("~~~~~~~~~~~~~~~", P), P) {
11499
11499
  T = P, S = P.retrieveSqlData || P.retrieve_table_data || P.retrieveTableData;
11500
11500
  break;
@@ -11506,14 +11506,14 @@ const Um = ({ children: e, attributes: t, styles: r, extraProps: n }) => {
11506
11506
  console.warn("No databaseReference with preData found for id:", t.id), u(!1);
11507
11507
  return;
11508
11508
  }
11509
- const z = Array.isArray(S?.preData) ? S.preData[0] : null;
11510
- if (!z) {
11509
+ const I = Array.isArray(S?.preData) ? S.preData[0] : null;
11510
+ if (!I) {
11511
11511
  console.warn("Matched item has no preData"), u(!1);
11512
11512
  return;
11513
11513
  }
11514
11514
  const K = {
11515
- columns: (z.columns || []).map((G) => ({ key: G.key, title: G.title })),
11516
- rows: z.data || z.rows || [],
11515
+ columns: (I.columns || []).map((G) => ({ key: G.key, title: G.title })),
11516
+ rows: I.data || I.rows || [],
11517
11517
  total: S?.total || 0,
11518
11518
  fetchUrl: S?.fetchUrl || "/index/knowledgeBase/file/stream",
11519
11519
  source: A || S?.source || T?.source
@@ -11529,25 +11529,25 @@ const Um = ({ children: e, attributes: t, styles: r, extraProps: n }) => {
11529
11529
  const S = T?.detail || {}, A = S?.id;
11530
11530
  if (!A || String(A) !== String(t.id))
11531
11531
  return;
11532
- const z = S.databaseReference;
11533
- if (!z) return;
11534
- let K = z;
11535
- if (typeof z == "string")
11532
+ const I = S.databaseReference;
11533
+ if (!I) return;
11534
+ let K = I;
11535
+ if (typeof I == "string")
11536
11536
  try {
11537
- K = JSON.parse(z);
11537
+ K = JSON.parse(I);
11538
11538
  } catch {
11539
11539
  }
11540
11540
  if (!K) return;
11541
- const G = Array.isArray(K) ? K : [K], L = G.findIndex((P) => String(P?.id) === String(t.id)), N = L >= 0 ? G[L] : null;
11542
- if (!N) return;
11543
- const I = N?.retrieveSqlData || N?.retrieve_table_data || N?.retrieveTableData, O = Array.isArray(I?.preData) ? I.preData[0] : null;
11541
+ const G = Array.isArray(K) ? K : [K], L = G.findIndex((P) => String(P?.id) === String(t.id)), M = L >= 0 ? G[L] : null;
11542
+ if (!M) return;
11543
+ const z = M?.retrieveSqlData || M?.retrieve_table_data || M?.retrieveTableData, O = Array.isArray(z?.preData) ? z.preData[0] : null;
11544
11544
  if (!O) return;
11545
11545
  const k = {
11546
11546
  columns: (O.columns || []).map((P) => ({ key: P.key, title: P.title })),
11547
11547
  rows: O.data || O.rows || [],
11548
- total: I?.total || 0,
11549
- fetchUrl: I?.fetchUrl || "/index/knowledgeBase/file/stream",
11550
- source: N?.source || I?.source
11548
+ total: z?.total || 0,
11549
+ fetchUrl: z?.fetchUrl || "/index/knowledgeBase/file/stream",
11550
+ source: M?.source || z?.source
11551
11551
  };
11552
11552
  o(k), u(!1);
11553
11553
  } catch {
@@ -11565,9 +11565,9 @@ const Um = ({ children: e, attributes: t, styles: r, extraProps: n }) => {
11565
11565
  }, D = (w, T) => {
11566
11566
  h(w), T && g(T);
11567
11567
  const S = (A) => {
11568
- let z = null;
11568
+ let I = null;
11569
11569
  if (A && Array.isArray(A.columns) && Array.isArray(A.rows))
11570
- z = {
11570
+ I = {
11571
11571
  columns: A.columns,
11572
11572
  rows: A.rows,
11573
11573
  total: Number(A.total) || 0,
@@ -11576,7 +11576,7 @@ const Um = ({ children: e, attributes: t, styles: r, extraProps: n }) => {
11576
11576
  };
11577
11577
  else if (A && Array.isArray(A.data)) {
11578
11578
  const K = A.data;
11579
- z = {
11579
+ I = {
11580
11580
  columns: s?.columns && s.columns.length > 0 ? s.columns : v(K),
11581
11581
  rows: K,
11582
11582
  total: Number(A.totalCount ?? A.total ?? s?.total ?? K.length) || 0,
@@ -11585,7 +11585,7 @@ const Um = ({ children: e, attributes: t, styles: r, extraProps: n }) => {
11585
11585
  }, typeof A.currentPage == "number" && h(A.currentPage), typeof A.pageSize == "number" && g(A.pageSize);
11586
11586
  } else if (Array.isArray(A)) {
11587
11587
  const K = A;
11588
- z = {
11588
+ I = {
11589
11589
  columns: s?.columns && s.columns.length > 0 ? s.columns : v(K),
11590
11590
  rows: K,
11591
11591
  // 仅有数据时,保持原 total,避免分页器消失
@@ -11594,11 +11594,11 @@ const Um = ({ children: e, attributes: t, styles: r, extraProps: n }) => {
11594
11594
  source: s?.source
11595
11595
  };
11596
11596
  }
11597
- if (!z) {
11597
+ if (!I) {
11598
11598
  console.warn("replacePredataFunction received unsupported data format:", A);
11599
11599
  return;
11600
11600
  }
11601
- console.log("Replacing table data with:", z), o(z);
11601
+ console.log("Replacing table data with:", I), o(I);
11602
11602
  };
11603
11603
  r?.("retrieve-sql-data:pagingation_click", {
11604
11604
  id: t.id,
@@ -11691,9 +11691,9 @@ const Um = ({ children: e, attributes: t, styles: r, extraProps: n }) => {
11691
11691
  children: A
11692
11692
  }
11693
11693
  );
11694
- const z = c(w.key);
11694
+ const I = c(w.key);
11695
11695
  let K = "200px";
11696
- return T === 0 ? K = "80px" : z <= 8 ? K = "100px" : z <= 15 ? K = "150px" : z <= 25 ? K = "200px" : z <= 40 ? K = "250px" : K = "300px", /* @__PURE__ */ b.jsx(
11696
+ return T === 0 ? K = "80px" : I <= 8 ? K = "100px" : I <= 15 ? K = "150px" : I <= 25 ? K = "200px" : I <= 40 ? K = "250px" : K = "300px", /* @__PURE__ */ b.jsx(
11697
11697
  "div",
11698
11698
  {
11699
11699
  style: {
@@ -12714,14 +12714,14 @@ const is = ({
12714
12714
  );
12715
12715
  if (de.length !== 0)
12716
12716
  for (const we of de) {
12717
- const [me, Ce] = we, Fe = me.text || "", Be = [];
12717
+ const [me, Ce] = we, Fe = me.text || "", Ee = [];
12718
12718
  let Ae = 0, je;
12719
12719
  for (te.lastIndex = 0; (je = te.exec(Fe)) !== null; ) {
12720
12720
  if (je.index > Ae) {
12721
12721
  const Ve = Fe.slice(Ae, je.index);
12722
- Ve && Be.push({ text: Ve });
12722
+ Ve && Ee.push({ text: Ve });
12723
12723
  }
12724
- Be.push({
12724
+ Ee.push({
12725
12725
  type: "template",
12726
12726
  placeholder: (je[1] || "").trim(),
12727
12727
  value: "",
@@ -12733,9 +12733,9 @@ const is = ({
12733
12733
  }
12734
12734
  if (Ae < Fe.length) {
12735
12735
  const Ve = Fe.slice(Ae);
12736
- Ve && Be.push({ text: Ve });
12736
+ Ve && Ee.push({ text: Ve });
12737
12737
  }
12738
- Q.removeNodes(x, { at: Ce }), Q.insertNodes(x, Be, { at: Ce });
12738
+ Q.removeNodes(x, { at: Ce }), Q.insertNodes(x, Ee, { at: Ce });
12739
12739
  }
12740
12740
  };
12741
12741
  return x.insertText = (te) => {
@@ -12751,12 +12751,12 @@ const is = ({
12751
12751
  };
12752
12752
  T.current = le(ee);
12753
12753
  }
12754
- const S = T.current, [A, z] = $e(() => e.type === "slate" ? e.content || [{ type: "paragraph", children: [{ text: "" }] }] : [{ type: "paragraph", children: [{ text: "" }] }]), [K, G] = $e(0);
12754
+ const S = T.current, [A, I] = $e(() => e.type === "slate" ? e.content || [{ type: "paragraph", children: [{ text: "" }] }] : [{ type: "paragraph", children: [{ text: "" }] }]), [K, G] = $e(0);
12755
12755
  Je(() => {
12756
12756
  if (e.type === "slate") {
12757
12757
  console.log("UnifiedRichText: dataSource.content \u53D8\u5316:", e.content);
12758
12758
  const q = e.content || [{ type: "paragraph", children: [{ text: "" }] }];
12759
- console.log("UnifiedRichText: \u8BBE\u7F6E\u65B0\u7684 value:", q), z(q), G((ee) => ee + 1);
12759
+ console.log("UnifiedRichText: \u8BBE\u7F6E\u65B0\u7684 value:", q), I(q), G((ee) => ee + 1);
12760
12760
  }
12761
12761
  }, [e.type, e.content]);
12762
12762
  const L = Ue(void 0);
@@ -12765,14 +12765,14 @@ const is = ({
12765
12765
  const q = typeof e.content == "string" ? e.content : JSON.stringify(e.content || "");
12766
12766
  L.current !== q && (L.current = q, G((ee) => ee + 1));
12767
12767
  }, [e.type, e.content]);
12768
- const N = Ue("");
12768
+ const M = Ue("");
12769
12769
  Je(() => {
12770
12770
  if (e.type !== "markdown") return;
12771
12771
  const q = JSON.stringify(g || {});
12772
- q !== N.current && (N.current = q, G((ee) => ee + 1));
12772
+ q !== M.current && (M.current = q, G((ee) => ee + 1));
12773
12773
  }, [g, e.type]);
12774
- const I = ke((q) => {
12775
- console.log("UnifiedRichText: \u5185\u5BB9\u53D8\u5316:", q), q && Array.isArray(q) ? (z(q), s?.(
12774
+ const z = ke((q) => {
12775
+ console.log("UnifiedRichText: \u5185\u5BB9\u53D8\u5316:", q), q && Array.isArray(q) ? (I(q), s?.(
12776
12776
  q,
12777
12777
  "slate"
12778
12778
  /* SLATE */
@@ -12944,7 +12944,7 @@ const is = ({
12944
12944
  {
12945
12945
  editor: S,
12946
12946
  initialValue: A,
12947
- onChange: I,
12947
+ onChange: z,
12948
12948
  children: /* @__PURE__ */ b.jsx(ri, { theme: w, children: /* @__PURE__ */ b.jsx(
12949
12949
  Ga,
12950
12950
  {
@@ -13140,8 +13140,8 @@ function Qm() {
13140
13140
  return O === void 0;
13141
13141
  } }, T = "en", S = {};
13142
13142
  S[T] = B;
13143
- var A = "$isDayjsObject", z = function(O) {
13144
- return O instanceof N || !(!O || !O[A]);
13143
+ var A = "$isDayjsObject", I = function(O) {
13144
+ return O instanceof M || !(!O || !O[A]);
13145
13145
  }, K = function O(k, P, $) {
13146
13146
  var U;
13147
13147
  if (!k) return T;
@@ -13156,14 +13156,14 @@ function Qm() {
13156
13156
  }
13157
13157
  return !$ && U && (T = U), U || !$ && T;
13158
13158
  }, G = function(O, k) {
13159
- if (z(O)) return O.clone();
13159
+ if (I(O)) return O.clone();
13160
13160
  var P = typeof k == "object" ? k : {};
13161
- return P.date = O, P.args = arguments, new N(P);
13161
+ return P.date = O, P.args = arguments, new M(P);
13162
13162
  }, L = w;
13163
- L.l = K, L.i = z, L.w = function(O, k) {
13163
+ L.l = K, L.i = I, L.w = function(O, k) {
13164
13164
  return G(O, { locale: k.$L, utc: k.$u, x: k.$x, $offset: k.$offset });
13165
13165
  };
13166
- var N = (function() {
13166
+ var M = (function() {
13167
13167
  function O(P) {
13168
13168
  this.$L = K(P.locale, null, !0), this.parse(P), this.$x = this.$x || P.x || {}, this[A] = !0;
13169
13169
  }
@@ -13378,14 +13378,14 @@ function Qm() {
13378
13378
  }, k.toString = function() {
13379
13379
  return this.$d.toUTCString();
13380
13380
  }, O;
13381
- })(), I = N.prototype;
13382
- return G.prototype = I, [["$ms", i], ["$s", s], ["$m", o], ["$H", l], ["$W", u], ["$M", h], ["$y", g], ["$D", v]].forEach((function(O) {
13383
- I[O[1]] = function(k) {
13381
+ })(), z = M.prototype;
13382
+ return G.prototype = z, [["$ms", i], ["$s", s], ["$m", o], ["$H", l], ["$W", u], ["$M", h], ["$y", g], ["$D", v]].forEach((function(O) {
13383
+ z[O[1]] = function(k) {
13384
13384
  return this.$g(k, O[0], O[1]);
13385
13385
  };
13386
13386
  })), G.extend = function(O, k) {
13387
- return O.$i || (O(k, N, G), O.$i = !0), G;
13388
- }, G.locale = K, G.isDayjs = z, G.unix = function(O) {
13387
+ return O.$i || (O(k, M, G), O.$i = !0), G;
13388
+ }, G.locale = K, G.isDayjs = I, G.unix = function(O) {
13389
13389
  return G(1e3 * O);
13390
13390
  }, G.en = S[T], G.Ls = S, G.p = {}, G;
13391
13391
  }));
@@ -14003,12 +14003,12 @@ const bv = Qe.div`
14003
14003
  fileManagerData: T,
14004
14004
  audioUrl: S,
14005
14005
  feedbackResult: A,
14006
- queryId: z,
14006
+ queryId: I,
14007
14007
  defaultAnswer: K,
14008
14008
  isWelcome: G = !1,
14009
14009
  isLast: L = !1,
14010
- respTime: N,
14011
- tokens: I,
14010
+ respTime: M,
14011
+ tokens: z,
14012
14012
  resultType: O,
14013
14013
  followUpQuestions: k = [],
14014
14014
  tools: P = {},
@@ -14037,10 +14037,10 @@ const bv = Qe.div`
14037
14037
  ...v?.theme?.icons
14038
14038
  }
14039
14039
  }), [Y, v, l, o]), q = We(() => {
14040
- const M = f || u || h;
14041
- return !M || !p ? null : tv(M).format("YY-MM-DD HH:mm:ss");
14040
+ const R = f || u || h;
14041
+ return !R || !p ? null : tv(R).format("YY-MM-DD HH:mm:ss");
14042
14042
  }, [f, u, h, p]), [ee, se] = $e([]), [xe, le] = $e(null), [x, J] = $e(!1), [H, V] = $e(!1), [ne, te] = $e(!1), [de, we] = $e(!1), [me, Ce] = $e(!1), Fe = () => {
14043
- const ie = {
14043
+ const ae = {
14044
14044
  processing: { text: "AI \u6B63\u5728\u601D\u8003...", icon: "\u{1F4AD}" },
14045
14045
  thinking: { text: "\u6DF1\u5EA6\u601D\u8003\u4E2D", icon: "\u{1F4AD}" },
14046
14046
  uploading: { text: "\u6587\u4EF6\u4E0A\u4F20\u4E2D...", icon: "\u{1F4E4}" },
@@ -14048,10 +14048,10 @@ const bv = Qe.div`
14048
14048
  error: { text: g || "\u62B1\u6B49\uFF0C\u672C\u6B21\u8BF7\u6C42\u51FA\u9519\u4E86\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5", icon: "\u274C" },
14049
14049
  initializing: { text: "\u6B63\u5728\u521D\u59CB\u5316...", icon: "\u2699\uFE0F" },
14050
14050
  ready: { text: "\u601D\u8003\u5B8C\u6210", icon: /* @__PURE__ */ b.jsx(Dn, { type: "rag/think", size: 16 }) }
14051
- }[a] || { text: "\u5904\u7406\u4E2D...", icon: "\u{1F4AD}" }, ve = N ? `(\u7528\u65F6 ${Math.round(N / 1e3)} \u79D2)` : "";
14051
+ }[a] || { text: "\u5904\u7406\u4E2D...", icon: "\u{1F4AD}" }, ve = M ? `(\u7528\u65F6 ${Math.round(M / 1e3)} \u79D2)` : "";
14052
14052
  return /* @__PURE__ */ b.jsx("div", { className: "think-header", children: /* @__PURE__ */ b.jsx("div", { className: "think-header-left ml-[16px]", children: /* @__PURE__ */ b.jsxs("div", { className: "flex items-center gap-x-1 bg-[#F5F7FA] p-2 rounded w-full", children: [
14053
- /* @__PURE__ */ b.jsx("div", { className: "think-icon", children: ie.icon }),
14054
- /* @__PURE__ */ b.jsx("div", { className: "think-title", children: ie.text }),
14053
+ /* @__PURE__ */ b.jsx("div", { className: "think-icon", children: ae.icon }),
14054
+ /* @__PURE__ */ b.jsx("div", { className: "think-title", children: ae.text }),
14055
14055
  ve && /* @__PURE__ */ b.jsx("div", { className: "think-time", children: ve }),
14056
14056
  It && /* @__PURE__ */ b.jsx(
14057
14057
  "button",
@@ -14080,35 +14080,35 @@ const bv = Qe.div`
14080
14080
  }
14081
14081
  )
14082
14082
  ] }) }) });
14083
- }, [Be, Ae] = $e([]), [je, Ve] = $e(null), ut = We(() => {
14083
+ }, [Ee, Ae] = $e([]), [je, Ve] = $e(null), ut = We(() => {
14084
14084
  try {
14085
14085
  if (!D) return [];
14086
- const M = JSON.parse(D);
14087
- return Array.isArray(M) ? M : [];
14086
+ const R = JSON.parse(D);
14087
+ return Array.isArray(R) ? R : [];
14088
14088
  } catch {
14089
14089
  return [];
14090
14090
  }
14091
- }, [D]), Pe = (M, ie) => {
14092
- const ve = M?.metadata?.source || M?.file_path || M?.path || M?.convertedFilePath || M?.parsedFilePath || "", ce = M?.metadata?.title || M?.file_name || "", oe = M?.metadata?.id || M?.id || M?.file_id || "", fe = ut.find((ge) => {
14093
- const W = ge?.metadata?.source || ge?.file_path || ge?.path || ge?.convertedFilePath || ge?.parsedFilePath || "", m = ge?.metadata?.title || ge?.file_name || "", y = ge?.metadata?.id || ge?.id || "";
14094
- return oe && y && String(oe) === String(y) || ve && W && W === ve || ce && m && m === ce;
14091
+ }, [D]), Pe = (R, ae) => {
14092
+ const ve = R?.metadata?.source || R?.file_path || R?.path || R?.convertedFilePath || R?.parsedFilePath || "", ce = R?.metadata?.title || R?.file_name || "", oe = R?.metadata?.id || R?.id || R?.file_id || "", fe = ut.find((ge) => {
14093
+ const _ = ge?.metadata?.source || ge?.file_path || ge?.path || ge?.convertedFilePath || ge?.parsedFilePath || "", m = ge?.metadata?.title || ge?.file_name || "", y = ge?.metadata?.id || ge?.id || "";
14094
+ return oe && y && String(oe) === String(y) || ve && _ && _ === ve || ce && m && m === ce;
14095
14095
  });
14096
14096
  if (fe) {
14097
- const W = (fe?.references && Array.isArray(fe.references) ? fe.references : [fe]).find((m) => String(m.order_num) === String(ie) || String(m.id) === String(ie));
14098
- if (W) return W;
14097
+ const _ = (fe?.references && Array.isArray(fe.references) ? fe.references : [fe]).find((m) => String(m.order_num) === String(ae) || String(m.id) === String(ae));
14098
+ if (_) return _;
14099
14099
  }
14100
14100
  for (const ge of ut) {
14101
14101
  if (ge?.references && Array.isArray(ge.references)) {
14102
- const W = ge.references.find((m) => String(m.order_num) === String(ie) || String(m.id) === String(ie));
14103
- if (W) return W;
14102
+ const _ = ge.references.find((m) => String(m.order_num) === String(ae) || String(m.id) === String(ae));
14103
+ if (_) return _;
14104
14104
  }
14105
- if (String(ge.order_num) === String(ie) || String(ge.id) === String(ie))
14105
+ if (String(ge.order_num) === String(ae) || String(ge.id) === String(ae))
14106
14106
  return ge;
14107
14107
  }
14108
14108
  return null;
14109
- }, lt = (M, ie) => {
14110
- function ve(W, m) {
14111
- for (const y of W) {
14109
+ }, lt = (R, ae) => {
14110
+ function ve(_, m) {
14111
+ for (const y of _) {
14112
14112
  if (y.references && Array.isArray(y.references)) {
14113
14113
  const j = y.references.find(
14114
14114
  (X) => String(X.order_num) === String(m) || String(X.id) === String(m)
@@ -14123,33 +14123,33 @@ const bv = Qe.div`
14123
14123
  let ce = [];
14124
14124
  try {
14125
14125
  D && (ce = JSON.parse(D));
14126
- } catch (W) {
14127
- console.error("Failed to parse reference:", W);
14126
+ } catch (_) {
14127
+ console.error("Failed to parse reference:", _);
14128
14128
  }
14129
- const oe = ve(ce, M.id), fe = (W) => {
14129
+ const oe = ve(ce, R.id), fe = (_) => {
14130
14130
  if (typeof t != "string") return;
14131
- const y = new RegExp(`\\[retrive-tag[^\\]]*id=['"]${W}['"][^\\]]*\\]\\[([^\\]]+)\\]\\\\/retrive-tag\\]`, "g").exec(t);
14131
+ const y = new RegExp(`\\[retrive-tag[^\\]]*id=['"]${_}['"][^\\]]*\\]\\[([^\\]]+)\\]\\\\/retrive-tag\\]`, "g").exec(t);
14132
14132
  if (y && y[1]) {
14133
14133
  const j = Number(y[1]);
14134
14134
  return Number.isNaN(j) ? void 0 : j;
14135
14135
  }
14136
14136
  }, ge = {
14137
14137
  tagInfo: {
14138
- id: M?.id,
14139
- index: fe(String(M?.id)),
14140
- image_urls: M?.imageUrls || M?.image_urls || []
14138
+ id: R?.id,
14139
+ index: fe(String(R?.id)),
14140
+ image_urls: R?.imageUrls || R?.image_urls || []
14141
14141
  },
14142
- fromtype: String(M?.fromtype ?? ""),
14143
- leaf: M,
14144
- attributes: ie,
14142
+ fromtype: String(R?.fromtype ?? ""),
14143
+ leaf: R,
14144
+ attributes: ae,
14145
14145
  referenceDoc: oe || void 0
14146
14146
  };
14147
- if (String(M?.fromtype) === "2" && B)
14147
+ if (String(R?.fromtype) === "2" && B)
14148
14148
  try {
14149
- const W = JSON.parse(B || "[]"), m = (Array.isArray(W) ? W : []).find((y) => {
14149
+ const _ = JSON.parse(B || "[]"), m = (Array.isArray(_) ? _ : []).find((y) => {
14150
14150
  if (Array.isArray(y?.traceNodes))
14151
- return y.traceNodes.some((X) => String(X?.id) === String(M.id));
14152
- const j = String(M.id || "").split("_")[0];
14151
+ return y.traceNodes.some((X) => String(X?.id) === String(R.id));
14152
+ const j = String(R.id || "").split("_")[0];
14153
14153
  return String(y?.id) === j;
14154
14154
  });
14155
14155
  m && (ge.graph = {
@@ -14157,61 +14157,61 @@ const bv = Qe.div`
14157
14157
  graphName: m.graphName,
14158
14158
  fetchUrl: m.fetchUrl,
14159
14159
  cyphers: m.cyphers
14160
- }, ge.traceNode = Array.isArray(m.traceNodes) ? m.traceNodes.find((y) => String(y?.id) === String(M.id)) : void 0);
14160
+ }, ge.traceNode = Array.isArray(m.traceNodes) ? m.traceNodes.find((y) => String(y?.id) === String(R.id)) : void 0);
14161
14161
  } catch {
14162
14162
  }
14163
14163
  $?.("action_retrive_tag", ge), $?.("retrive_tag:click", ge);
14164
- }, ct = (M) => {
14165
- if (console.log("ChatMessageAdapter received retrieve-sql-data:request-data:", M), console.log("databaseReference available:", !!E), M.id && E) {
14164
+ }, ct = (R) => {
14165
+ if (console.log("ChatMessageAdapter received retrieve-sql-data:request-data:", R), console.log("databaseReference available:", !!E), R.id && E) {
14166
14166
  console.log("Sending retrieve-sql-data:data-response with databaseReference"), console.log("databaseReference data:", E);
14167
- const ie = new CustomEvent("retrieve-sql-data:data-response", {
14167
+ const ae = new CustomEvent("retrieve-sql-data:data-response", {
14168
14168
  detail: {
14169
- id: M.id,
14169
+ id: R.id,
14170
14170
  databaseReference: E
14171
14171
  }
14172
14172
  });
14173
- console.log("Dispatching event:", ie), window.dispatchEvent(ie);
14173
+ console.log("Dispatching event:", ae), window.dispatchEvent(ae);
14174
14174
  } else
14175
14175
  console.log("Cannot send response - missing id or databaseReference");
14176
14176
  };
14177
14177
  be.useEffect(() => {
14178
- const M = (ie) => {
14179
- ct(ie.detail);
14178
+ const R = (ae) => {
14179
+ ct(ae.detail);
14180
14180
  };
14181
- return window.addEventListener("retrieve-sql-data:request-data", M), () => {
14182
- window.removeEventListener("retrieve-sql-data:request-data", M);
14181
+ return window.addEventListener("retrieve-sql-data:request-data", R), () => {
14182
+ window.removeEventListener("retrieve-sql-data:request-data", R);
14183
14183
  };
14184
14184
  }, [E]), be.useEffect(() => {
14185
- const M = (ie) => {
14186
- Re(ie.detail);
14185
+ const R = (ae) => {
14186
+ Re(ae.detail);
14187
14187
  };
14188
- return window.addEventListener("rtext_pagination_click", M), () => {
14189
- window.removeEventListener("rtext_pagination_click", M);
14188
+ return window.addEventListener("rtext_pagination_click", R), () => {
14189
+ window.removeEventListener("rtext_pagination_click", R);
14190
14190
  };
14191
14191
  }, [je]);
14192
- const Re = (M) => {
14193
- if (console.log("ChatMessageAdapter received rtext_pagination_click:", M), M.replacePredataFunction && je) {
14194
- const ie = {
14192
+ const Re = (R) => {
14193
+ if (console.log("ChatMessageAdapter received rtext_pagination_click:", R), R.replacePredataFunction && je) {
14194
+ const ae = {
14195
14195
  ...je,
14196
14196
  rows: je.rows
14197
14197
  // 这里应该是从服务器获取的新数据
14198
14198
  // 可以添加加载状态等
14199
14199
  };
14200
- M.replacePredataFunction(ie);
14200
+ R.replacePredataFunction(ae);
14201
14201
  }
14202
- $?.("rtext_pagination_click", M);
14202
+ $?.("rtext_pagination_click", R);
14203
14203
  }, Me = Ue(/* @__PURE__ */ new Map()), xt = Ue(1), tt = Ue(""), it = Ue({ 0: 1, 1: 1, 2: 1, 3: 1 }), Te = We(() => {
14204
14204
  if (r === "stream" && typeof t == "string") {
14205
- let M = t;
14206
- const ie = [];
14207
- return z && z !== tt.current && (Me.current.clear(), xt.current = 1, it.current = { 0: 1, 1: 1, 2: 1, 3: 1 }, tt.current = z), M = M.replace(
14205
+ let R = t;
14206
+ const ae = [];
14207
+ return I && I !== tt.current && (Me.current.clear(), xt.current = 1, it.current = { 0: 1, 1: 1, 2: 1, 3: 1 }, tt.current = I), R = R.replace(
14208
14208
  /\[retrive-tag([^\]]*)\]\[([^\]]+)\]\[\/retrive-tag\]/g,
14209
14209
  (ve, ce) => {
14210
14210
  const oe = ce.match(/id=['"]([^'"]+)['"]/), fe = ce.match(/fromType=['"]([^'"]+)['"]/);
14211
14211
  if (oe) {
14212
- const ge = oe[1], W = fe ? fe[1] : "0";
14212
+ const ge = oe[1], _ = fe ? fe[1] : "0";
14213
14213
  if (!Me.current.has(ge)) {
14214
- const y = it.current, j = W === "1" ? "1" : W === "2" ? "2" : W === "3" ? "3" : "0", X = y[j] ?? 1;
14214
+ const y = it.current, j = _ === "1" ? "1" : _ === "2" ? "2" : _ === "3" ? "3" : "0", X = y[j] ?? 1;
14215
14215
  Me.current.set(ge, X), y[j] = X + 1, it.current = y;
14216
14216
  }
14217
14217
  const m = Me.current.get(ge);
@@ -14219,25 +14219,25 @@ const bv = Qe.div`
14219
14219
  }
14220
14220
  return ve;
14221
14221
  }
14222
- ), M = M.replace(
14222
+ ), R = R.replace(
14223
14223
  /\[retrive-tag[^\]]*fromType=['"]0['"][^\]]*\]\[([^\]]+)\]\[\/retrive-tag\]/g,
14224
14224
  (ve) => {
14225
14225
  const ce = ve.match(/image_urls=['"]([^'"]+)['"]/);
14226
14226
  if (ce) {
14227
14227
  const fe = ce[1].split(";").map((ge) => ge.trim()).filter(Boolean);
14228
- ie.push(...fe);
14228
+ ae.push(...fe);
14229
14229
  }
14230
14230
  return ve;
14231
14231
  }
14232
- ), se(ie), M;
14232
+ ), se(ae), R;
14233
14233
  }
14234
14234
  return t;
14235
- }, [t, r, z]), qe = We(() => {
14235
+ }, [t, r, I]), qe = We(() => {
14236
14236
  if (r === "stream" && typeof Te == "string")
14237
14237
  try {
14238
14238
  return Wl(Te);
14239
- } catch (M) {
14240
- return console.error("Failed to deserialize markdown:", M), [];
14239
+ } catch (R) {
14240
+ return console.error("Failed to deserialize markdown:", R), [];
14241
14241
  }
14242
14242
  return [];
14243
14243
  }, [Te, r]);
@@ -14266,22 +14266,22 @@ const bv = Qe.div`
14266
14266
  }, [r, E]);
14267
14267
  const It = We(() => {
14268
14268
  if (!Array.isArray(qe)) return !1;
14269
- const M = (ve) => {
14269
+ const R = (ve) => {
14270
14270
  for (const ce of ve)
14271
- if (ce.type === "think" || Array.isArray(ce.children) && M(ce.children)) return !0;
14271
+ if (ce.type === "think" || Array.isArray(ce.children) && R(ce.children)) return !0;
14272
14272
  return !1;
14273
- }, ie = M(qe);
14274
- return console.log("Think detection:", { slateContent: qe, hasThinkElement: ie, displayStatus: a, isUser: s }), ie;
14273
+ }, ae = R(qe);
14274
+ return console.log("Think detection:", { slateContent: qe, hasThinkElement: ae, displayStatus: a, isUser: s }), ae;
14275
14275
  }, [qe, a, s]), zt = We(() => ({
14276
14276
  databaseReference: E,
14277
14277
  ...It && {
14278
14278
  isThinkCollapsed: me
14279
14279
  }
14280
14280
  }), [E, It, me]), Tt = We(() => i || (s ? Z.icons.userAvatar : Z.icons.aiAvatar), [i, s, Z.icons]), Kt = We(() => typeof t == "string" ? t : Array.isArray(t) ? t.map(
14281
- (M) => typeof M == "string" ? M : M.text || ""
14281
+ (R) => typeof R == "string" ? R : R.text || ""
14282
14282
  ).join("") : K || "", [t, K]), _r = () => {
14283
14283
  if (G) return null;
14284
- const M = [
14284
+ const R = [
14285
14285
  {
14286
14286
  key: "copy",
14287
14287
  show: P.copy !== !1,
@@ -14294,7 +14294,7 @@ const bv = Qe.div`
14294
14294
  show: P.like !== !1,
14295
14295
  icon: mv,
14296
14296
  label: "\u8D5E",
14297
- onClick: () => $?.("chatbox:like", { result: A, queryId: z }),
14297
+ onClick: () => $?.("chatbox:like", { result: A, queryId: I }),
14298
14298
  active: A === 1
14299
14299
  },
14300
14300
  {
@@ -14302,7 +14302,7 @@ const bv = Qe.div`
14302
14302
  show: P.dislike !== !1,
14303
14303
  icon: gv,
14304
14304
  label: "\u8E29",
14305
- onClick: () => $?.("chatbox:dislike", { result: A, queryId: z }),
14305
+ onClick: () => $?.("chatbox:dislike", { result: A, queryId: I }),
14306
14306
  active: A === 0
14307
14307
  },
14308
14308
  {
@@ -14310,85 +14310,85 @@ const bv = Qe.div`
14310
14310
  show: !s && L,
14311
14311
  icon: hv,
14312
14312
  label: "\u91CD\u590D",
14313
- onClick: () => $?.("chatbox:repeat", { content: t, queryId: z, filePaths: F, audioUrl: S })
14313
+ onClick: () => $?.("chatbox:repeat", { content: t, queryId: I, filePaths: F, audioUrl: S })
14314
14314
  },
14315
14315
  {
14316
14316
  key: "forward",
14317
14317
  show: P.forward,
14318
14318
  icon: pv,
14319
14319
  label: "\u8F6C\u53D1",
14320
- onClick: () => $?.("chatbox:forward", { content: Kt, queryId: z })
14320
+ onClick: () => $?.("chatbox:forward", { content: Kt, queryId: I })
14321
14321
  },
14322
14322
  {
14323
14323
  key: "delete",
14324
14324
  show: P.delete,
14325
14325
  icon: vv,
14326
14326
  label: "\u5220\u9664",
14327
- onClick: () => $?.("chatbox:delete", { queryId: z })
14327
+ onClick: () => $?.("chatbox:delete", { queryId: I })
14328
14328
  },
14329
14329
  {
14330
14330
  key: "edit",
14331
14331
  show: P.edit,
14332
14332
  icon: fv,
14333
14333
  label: "\u7F16\u8F91",
14334
- onClick: () => $?.("chatbox:edit", { content: Kt, queryId: z })
14334
+ onClick: () => $?.("chatbox:edit", { content: Kt, queryId: I })
14335
14335
  }
14336
14336
  ];
14337
14337
  return /* @__PURE__ */ b.jsxs("div", { style: { padding: "0 2.9rem" }, className: "flex justify-between items-center", children: [
14338
- /* @__PURE__ */ b.jsx(wv, { $theme: Z, children: M.filter((ie) => ie.show).map((ie) => {
14339
- const ve = ie.icon;
14340
- return /* @__PURE__ */ b.jsx(nc, { title: ie.label, placement: "top", children: /* @__PURE__ */ b.jsx(
14338
+ /* @__PURE__ */ b.jsx(wv, { $theme: Z, children: R.filter((ae) => ae.show).map((ae) => {
14339
+ const ve = ae.icon;
14340
+ return /* @__PURE__ */ b.jsx(nc, { title: ae.label, placement: "top", children: /* @__PURE__ */ b.jsx(
14341
14341
  "button",
14342
14342
  {
14343
- className: ie.active ? "active" : "",
14344
- onClick: ie.onClick,
14343
+ className: ae.active ? "active" : "",
14344
+ onClick: ae.onClick,
14345
14345
  children: /* @__PURE__ */ b.jsx(ve, { size: 18 })
14346
14346
  }
14347
- ) }, ie.key);
14347
+ ) }, ae.key);
14348
14348
  }) }),
14349
14349
  !s && a == "ready" && !G && /* @__PURE__ */ b.jsxs("div", { className: "text-[10px] text-[#888888]", children: [
14350
14350
  "\u672C\u6B21\u56DE\u7B54\u603B\u8BA1\u6D88\u8017",
14351
14351
  " ",
14352
- /* @__PURE__ */ b.jsx("span", { style: { color: Z.colors.primary }, children: I || 0 }),
14352
+ /* @__PURE__ */ b.jsx("span", { style: { color: Z.colors.primary }, children: z || 0 }),
14353
14353
  " ",
14354
14354
  "tokens, \u7B49\u5F85\u603B\u8BA1\u8017\u65F6",
14355
14355
  " ",
14356
- /* @__PURE__ */ b.jsx("span", { style: { color: Z.colors.primary }, children: Math.round((N || 0) / 1e3) }),
14356
+ /* @__PURE__ */ b.jsx("span", { style: { color: Z.colors.primary }, children: Math.round((M || 0) / 1e3) }),
14357
14357
  "\u79D2"
14358
14358
  ] })
14359
14359
  ] });
14360
14360
  }, Lt = We(() => {
14361
14361
  if (!D) return [];
14362
- let M = [];
14362
+ let R = [];
14363
14363
  try {
14364
14364
  const oe = JSON.parse(D);
14365
- M = Array.isArray(oe) ? oe : [];
14365
+ R = Array.isArray(oe) ? oe : [];
14366
14366
  } catch {
14367
14367
  return [];
14368
14368
  }
14369
- let ie = M.map((oe) => {
14369
+ let ae = R.map((oe) => {
14370
14370
  try {
14371
14371
  const fe = oe.metadata || {};
14372
14372
  let ge = "";
14373
14373
  fe.type === "video" && fe.source_name && typeof fe.source_name == "string" ? ge = fe.source_name : oe.name && typeof oe.name == "string" ? ge = oe.name : oe.file_name && typeof oe.file_name == "string" ? ge = oe.file_name : fe.title && typeof fe.title == "string" ? ge = fe.title : fe.source && typeof fe.source == "string" ? ge = fe.source.split("/").pop() || "" : oe.order_num ? ge = String(oe.order_num) : ge = "\u672A\u77E5\u6587\u6863";
14374
- let W = "pdf";
14374
+ let _ = "pdf";
14375
14375
  if (fe.type && typeof fe.type == "string")
14376
- W = fe.type.toLowerCase();
14376
+ _ = fe.type.toLowerCase();
14377
14377
  else if (oe.name && typeof oe.name == "string") {
14378
14378
  const ue = oe.name.split(".").pop();
14379
- ue && (W = ue.toLowerCase());
14379
+ ue && (_ = ue.toLowerCase());
14380
14380
  } else if (fe.source && typeof fe.source == "string") {
14381
14381
  const ue = fe.source.split(".").pop();
14382
- ue && (W = ue.toLowerCase());
14382
+ ue && (_ = ue.toLowerCase());
14383
14383
  } else if (oe.file_path && typeof oe.file_path == "string") {
14384
14384
  const ue = oe.file_path.split(".").pop();
14385
- ue && (W = ue.toLowerCase());
14385
+ ue && (_ = ue.toLowerCase());
14386
14386
  }
14387
14387
  const m = oe.parsedFilePath || fe.file_path || oe.file_path || oe.convertedFilePath || fe.link || fe.source_link || "", { metadata: y, ...j } = oe, X = fe.source || "";
14388
14388
  return {
14389
14389
  file_id: fe.id || oe.uid || "",
14390
14390
  file_name: ge,
14391
- file_type: W,
14391
+ file_type: _,
14392
14392
  path: m,
14393
14393
  score: Number(oe.score || fe.score) || 0,
14394
14394
  tags: [],
@@ -14399,7 +14399,7 @@ const bv = Qe.div`
14399
14399
  };
14400
14400
  } catch (fe) {
14401
14401
  console.warn("\u89E3\u6790\u5F15\u7528\u6587\u6863\u65F6\u51FA\u9519:", fe, oe);
14402
- const { metadata: ge, ...W } = oe, m = oe.metadata?.source || oe.file_path || oe.convertedFilePath || "";
14402
+ const { metadata: ge, ..._ } = oe, m = oe.metadata?.source || oe.file_path || oe.convertedFilePath || "";
14403
14403
  return {
14404
14404
  file_id: oe.uid || "",
14405
14405
  file_name: oe.name || "\u672A\u77E5\u6587\u6863",
@@ -14410,26 +14410,26 @@ const bv = Qe.div`
14410
14410
  parsedFilePath: oe.parsedFilePath,
14411
14411
  source: m,
14412
14412
  // 保留 source 字段用于去重,但不保留完整的 metadata
14413
- ...W
14413
+ ..._
14414
14414
  };
14415
14415
  }
14416
14416
  });
14417
14417
  const ve = Br(qe || []);
14418
14418
  if (ve && ve.length) {
14419
- const oe = (W) => {
14419
+ const oe = (_) => {
14420
14420
  if (typeof Te != "string") return "";
14421
- const y = new RegExp(`\\[retrive-tag[^\\]]*id=['"]${W}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`, "g").exec(Te);
14421
+ const y = new RegExp(`\\[retrive-tag[^\\]]*id=['"]${_}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`, "g").exec(Te);
14422
14422
  if (y && y[1]) {
14423
14423
  const j = Number(y[1]);
14424
14424
  return Number.isNaN(j) ? "" : j;
14425
14425
  }
14426
14426
  return "";
14427
- }, fe = ve.filter((W) => W.fromtype === "0"), ge = ve.filter((W) => W.fromtype === "3");
14428
- ie = ie.map((W) => {
14427
+ }, fe = ve.filter((_) => _.fromtype === "0"), ge = ve.filter((_) => _.fromtype === "3");
14428
+ ae = ae.map((_) => {
14429
14429
  const m = fe.map((j) => {
14430
- const X = M.find((re) => String(re.order_num) === String(j.id));
14430
+ const X = R.find((re) => String(re.order_num) === String(j.id));
14431
14431
  if (!X || !X?.metadata?.source) return null;
14432
- const ue = W.source || "", De = X.metadata.source || "";
14432
+ const ue = _.source || "", De = X.metadata.source || "";
14433
14433
  return ue && De && ue !== De ? null : {
14434
14434
  id: j.id || "",
14435
14435
  index: oe(String(j.id)) || j.indexId || "",
@@ -14442,9 +14442,9 @@ const bv = Qe.div`
14442
14442
  // 保留 parsedFilePath
14443
14443
  };
14444
14444
  }).filter((j) => j !== null), y = ge.map((j) => {
14445
- const X = M.find((re) => String(re.order_num) === String(j.id));
14445
+ const X = R.find((re) => String(re.order_num) === String(j.id));
14446
14446
  if (!X || !X?.metadata?.source) return null;
14447
- const ue = W.source || "", De = X.metadata.source || "";
14447
+ const ue = _.source || "", De = X.metadata.source || "";
14448
14448
  return ue && De && ue !== De ? null : {
14449
14449
  id: j.id || "",
14450
14450
  index: oe(String(j.id)) || j.indexId || "",
@@ -14457,25 +14457,25 @@ const bv = Qe.div`
14457
14457
  // 保留 parsedFilePath
14458
14458
  };
14459
14459
  }).filter((j) => j !== null);
14460
- return { ...W, tags: [...m, ...y] };
14460
+ return { ..._, tags: [...m, ...y] };
14461
14461
  });
14462
14462
  }
14463
14463
  const ce = /* @__PURE__ */ new Map();
14464
- return ie.filter((oe) => {
14464
+ return ae.filter((oe) => {
14465
14465
  const fe = oe?.source || oe.file_name;
14466
14466
  return fe ? ce.has(fe) ? !1 : (ce.set(fe, !0), !0) : !0;
14467
14467
  }).sort((oe, fe) => (fe?.score || 0) - (oe?.score || 0));
14468
14468
  }, [D, qe, Te]), Ft = We(() => {
14469
14469
  if (!c) return [];
14470
- let M = [];
14470
+ let R = [];
14471
14471
  try {
14472
14472
  const ce = JSON.parse(c);
14473
- M = Array.isArray(ce) ? ce : [];
14473
+ R = Array.isArray(ce) ? ce : [];
14474
14474
  } catch {
14475
14475
  return [];
14476
14476
  }
14477
- if (!M?.length) return [];
14478
- let ie = M.map((ce) => ({
14477
+ if (!R?.length) return [];
14478
+ let ae = R.map((ce) => ({
14479
14479
  link: ce?.metadata?.link,
14480
14480
  file_name: ce?.metadata?.title,
14481
14481
  // 优先使用 ref.score,如果没有则使用 metadata.score
@@ -14486,40 +14486,40 @@ const bv = Qe.div`
14486
14486
  if (ve && ve.length) {
14487
14487
  const ce = (fe) => {
14488
14488
  if (typeof Te != "string") return "";
14489
- const W = new RegExp(`\\[retrive-tag[^\\]]*id=['"]${fe}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`, "g").exec(Te);
14490
- if (W && W[1]) {
14491
- const m = Number(W[1]);
14489
+ const _ = new RegExp(`\\[retrive-tag[^\\]]*id=['"]${fe}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`, "g").exec(Te);
14490
+ if (_ && _[1]) {
14491
+ const m = Number(_[1]);
14492
14492
  return Number.isNaN(m) ? "" : m;
14493
14493
  }
14494
14494
  return "";
14495
14495
  }, oe = ve.filter((fe) => fe.fromtype === "1");
14496
- ie = ie.map((fe) => {
14497
- const ge = oe.map((W) => {
14498
- const m = M.find((y) => String(y.order_num) === String(W.id));
14496
+ ae = ae.map((fe) => {
14497
+ const ge = oe.map((_) => {
14498
+ const m = R.find((y) => String(y.order_num) === String(_.id));
14499
14499
  return !m || !m?.metadata?.title || m.metadata.title !== fe.file_name ? null : {
14500
- id: W.id || "",
14501
- index: ce(String(W.id)) || W.indexId || "",
14502
- image_urls: W.imageUrls ? Array.isArray(W.imageUrls) ? W.imageUrls : [W.imageUrls] : W.image_urls ? W.image_urls.split(";").map((y) => y.trim()).filter(Boolean) : [],
14500
+ id: _.id || "",
14501
+ index: ce(String(_.id)) || _.indexId || "",
14502
+ image_urls: _.imageUrls ? Array.isArray(_.imageUrls) ? _.imageUrls : [_.imageUrls] : _.image_urls ? _.image_urls.split(";").map((y) => y.trim()).filter(Boolean) : [],
14503
14503
  metadata: m.metadata || {},
14504
14504
  // 将对应的 metadata 放到 tag 中
14505
14505
  order_num: m.order_num
14506
14506
  // 保留 order_num
14507
14507
  };
14508
- }).filter((W) => W !== null);
14508
+ }).filter((_) => _ !== null);
14509
14509
  return { ...fe, tags: ge };
14510
14510
  });
14511
14511
  }
14512
- return ie.sort((ce, oe) => (oe?.score || 0) - (ce?.score || 0));
14512
+ return ae.sort((ce, oe) => (oe?.score || 0) - (ce?.score || 0));
14513
14513
  }, [c, qe, Te]), $t = We(() => {
14514
14514
  if (!B) return [];
14515
- let M = [];
14515
+ let R = [];
14516
14516
  try {
14517
14517
  const ce = JSON.parse(B);
14518
- M = Array.isArray(ce) ? ce : [];
14518
+ R = Array.isArray(ce) ? ce : [];
14519
14519
  } catch (ce) {
14520
14520
  return console.error("Failed to parse graphReference:", ce), [];
14521
14521
  }
14522
- let ie = M.map((ce, oe) => {
14522
+ let ae = R.map((ce, oe) => {
14523
14523
  const { metadata: fe, ...ge } = ce;
14524
14524
  return {
14525
14525
  id: ce.id || `graph-${oe}`,
@@ -14531,7 +14531,7 @@ const bv = Qe.div`
14531
14531
  const ve = Br(qe || []);
14532
14532
  if (ve && ve.length) {
14533
14533
  const ce = ve.filter((oe) => oe.fromtype === "2");
14534
- ie = ie.map((oe) => {
14534
+ ae = ae.map((oe) => {
14535
14535
  const fe = (y) => {
14536
14536
  if (typeof Te != "string") return;
14537
14537
  const X = new RegExp(`\\[retrive-tag[^\\]]*id=['"]${y}['"][^\\]]*\\]\\[([^\\]]+)\\]\\\\/retrive-tag\\]`, "g").exec(Te);
@@ -14556,93 +14556,93 @@ const bv = Qe.div`
14556
14556
  // item 不再有 metadata,使用空对象
14557
14557
  metadata: {}
14558
14558
  }));
14559
- const W = /* @__PURE__ */ new Set(), m = ge.filter((y) => W.has(String(y.id)) ? !1 : (W.add(String(y.id)), !0)).sort((y, j) => Number(y.index) - Number(j.index));
14559
+ const _ = /* @__PURE__ */ new Set(), m = ge.filter((y) => _.has(String(y.id)) ? !1 : (_.add(String(y.id)), !0)).sort((y, j) => Number(y.index) - Number(j.index));
14560
14560
  return { ...oe, tags: m };
14561
14561
  });
14562
14562
  }
14563
- return ie;
14563
+ return ae;
14564
14564
  }, [B, qe, Te]), ft = We(() => {
14565
14565
  const ve = [...Br(qe || []).filter((ce) => ce.imageUrls && Array.isArray(ce.imageUrls)).flatMap((ce) => ce.imageUrls), ...ee];
14566
14566
  return Array.from(new Set(ve));
14567
14567
  }, [qe, ee]), jt = We(() => typeof t != "string" ? [] : Dv(t), [t]), st = We(() => {
14568
14568
  if (!E) return null;
14569
14569
  try {
14570
- const M = typeof E == "string" ? JSON.parse(E) : E;
14571
- if (Array.isArray(M) && M.length > 0) {
14572
- const ie = M[0];
14573
- if (ie.retrieveSqlData)
14570
+ const R = typeof E == "string" ? JSON.parse(E) : E;
14571
+ if (Array.isArray(R) && R.length > 0) {
14572
+ const ae = R[0];
14573
+ if (ae.retrieveSqlData)
14574
14574
  return {
14575
- dataFetchUrl: ie.retrieveSqlData.fetchUrl || "/index/knowledgeBase/file/stream",
14576
- databaseName: ie.retrieveSqlData.databaseName || "\u6570\u636E\u5E93",
14577
- tableName: ie.retrieveSqlData.tableName || "\u6570\u636E\u8868",
14578
- total: ie.retrieveSqlData.total || 0,
14579
- type: ie.retrieveSqlData.type || "COLLECTION",
14575
+ dataFetchUrl: ae.retrieveSqlData.fetchUrl || "/index/knowledgeBase/file/stream",
14576
+ databaseName: ae.retrieveSqlData.databaseName || "\u6570\u636E\u5E93",
14577
+ tableName: ae.retrieveSqlData.tableName || "\u6570\u636E\u8868",
14578
+ total: ae.retrieveSqlData.total || 0,
14579
+ type: ae.retrieveSqlData.type || "COLLECTION",
14580
14580
  preData: {
14581
- columns: ie.retrieveSqlData.preData?.[0]?.columns || [],
14582
- rows: ie.retrieveSqlData.preData?.[0]?.data || []
14581
+ columns: ae.retrieveSqlData.preData?.[0]?.columns || [],
14582
+ rows: ae.retrieveSqlData.preData?.[0]?.data || []
14583
14583
  }
14584
14584
  };
14585
14585
  }
14586
- return M.retrieveSqlData ? {
14587
- dataFetchUrl: M.retrieveSqlData.fetchUrl || "/index/knowledgeBase/file/stream",
14588
- databaseName: M.retrieveSqlData.databaseName || "\u6570\u636E\u5E93",
14589
- tableName: M.retrieveSqlData.tableName || "\u6570\u636E\u8868",
14590
- total: M.retrieveSqlData.total || 0,
14591
- type: M.retrieveSqlData.type || "COLLECTION",
14586
+ return R.retrieveSqlData ? {
14587
+ dataFetchUrl: R.retrieveSqlData.fetchUrl || "/index/knowledgeBase/file/stream",
14588
+ databaseName: R.retrieveSqlData.databaseName || "\u6570\u636E\u5E93",
14589
+ tableName: R.retrieveSqlData.tableName || "\u6570\u636E\u8868",
14590
+ total: R.retrieveSqlData.total || 0,
14591
+ type: R.retrieveSqlData.type || "COLLECTION",
14592
14592
  preData: {
14593
- columns: M.retrieveSqlData.preData?.[0]?.columns || [],
14594
- rows: M.retrieveSqlData.preData?.[0]?.data || []
14593
+ columns: R.retrieveSqlData.preData?.[0]?.columns || [],
14594
+ rows: R.retrieveSqlData.preData?.[0]?.data || []
14595
14595
  }
14596
14596
  } : {
14597
- dataFetchUrl: M.dataFetchUrl || "/index/knowledgeBase/file/stream",
14598
- databaseName: M.databaseName || "\u6570\u636E\u5E93",
14599
- tableName: M.tableName || "\u6570\u636E\u8868",
14600
- total: M.total || 0,
14601
- type: M.type || "COLLECTION",
14602
- preData: M.preData || { columns: [], rows: [] }
14597
+ dataFetchUrl: R.dataFetchUrl || "/index/knowledgeBase/file/stream",
14598
+ databaseName: R.databaseName || "\u6570\u636E\u5E93",
14599
+ tableName: R.tableName || "\u6570\u636E\u8868",
14600
+ total: R.total || 0,
14601
+ type: R.type || "COLLECTION",
14602
+ preData: R.preData || { columns: [], rows: [] }
14603
14603
  };
14604
- } catch (M) {
14605
- return console.error("Failed to parse databaseReference:", M), null;
14604
+ } catch (R) {
14605
+ return console.error("Failed to parse databaseReference:", R), null;
14606
14606
  }
14607
- }, [E]), Wr = (M) => {
14608
- const { dataSourceType: ie, databaseName: ve, businessTableName: ce, tableName: oe } = M;
14609
- return ie === "DataTable" ? `${ve || "\u6570\u636E\u5E93"} - ${ce || "\u6570\u636E\u8868"}` : ie === "DirectDB" ? `${ve || "\u6570\u636E\u5E93"} - ${oe || "\u6570\u636E\u8868"}` : ve || ce || oe || "\u6570\u636E\u5E93";
14607
+ }, [E]), Wr = (R) => {
14608
+ const { dataSourceType: ae, databaseName: ve, businessTableName: ce, tableName: oe } = R;
14609
+ return ae === "DataTable" ? `${ve || "\u6570\u636E\u5E93"} - ${ce || "\u6570\u636E\u8868"}` : ae === "DirectDB" ? `${ve || "\u6570\u636E\u5E93"} - ${oe || "\u6570\u636E\u8868"}` : ve || ce || oe || "\u6570\u636E\u5E93";
14610
14610
  };
14611
14611
  be.useEffect(() => {
14612
+ Ve(null), se([]);
14613
+ }, [I]), be.useEffect(() => {
14612
14614
  if (E)
14613
14615
  try {
14614
- const M = typeof E == "string" ? JSON.parse(E) : E;
14615
- if (Array.isArray(M) && M.length > 0) {
14616
- const ie = M[0];
14617
- if (ie.retrieveTableDataList && Array.isArray(ie.retrieveTableDataList)) {
14618
- Ae(ie.retrieveTableDataList);
14616
+ const R = typeof E == "string" ? JSON.parse(E) : E;
14617
+ if (console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] databaseReference:", E), console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u89E3\u6790\u540E\u7684 dbRef:", R), console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u5F53\u524D queryId:", I), Array.isArray(R) && R.length > 0) {
14618
+ const ae = R[0];
14619
+ if (console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] firstRef:", ae), console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] firstRef.retrieveTableDataList:", ae.retrieveTableDataList), ae.retrieveTableDataList && Array.isArray(ae.retrieveTableDataList)) {
14620
+ console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u8BBE\u7F6E databaseData \u4E3A retrieveTableDataList:", ae.retrieveTableDataList), Ae(ae.retrieveTableDataList);
14619
14621
  return;
14620
14622
  }
14621
- if (ie.retrieveSqlData?.preData?.[0]?.data && Array.isArray(ie.retrieveSqlData.preData[0].data)) {
14622
- Ae(ie.retrieveSqlData.preData[0].data);
14623
+ if (ae.retrieveSqlData?.preData?.[0]?.data && Array.isArray(ae.retrieveSqlData.preData[0].data)) {
14624
+ console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u8BBE\u7F6E databaseData \u4E3A retrieveSqlData.preData[0].data:", ae.retrieveSqlData.preData[0].data), Ae(ae.retrieveSqlData.preData[0].data);
14623
14625
  return;
14624
14626
  }
14625
14627
  }
14626
- if (M.retrieveTableDataList && Array.isArray(M.retrieveTableDataList)) {
14627
- Ae(M.retrieveTableDataList);
14628
+ if (R.retrieveTableDataList && Array.isArray(R.retrieveTableDataList)) {
14629
+ console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u8BBE\u7F6E databaseData \u4E3A dbRef.retrieveTableDataList:", R.retrieveTableDataList), Ae(R.retrieveTableDataList);
14628
14630
  return;
14629
14631
  }
14630
- if (M.retrieveSqlData?.preData?.[0]?.data && Array.isArray(M.retrieveSqlData.preData[0].data)) {
14631
- Ae(M.retrieveSqlData.preData[0].data);
14632
+ if (R.retrieveSqlData?.preData?.[0]?.data && Array.isArray(R.retrieveSqlData.preData[0].data)) {
14633
+ console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u8BBE\u7F6E databaseData \u4E3A dbRef.retrieveSqlData.preData[0].data:", R.retrieveSqlData.preData[0].data), Ae(R.retrieveSqlData.preData[0].data);
14632
14634
  return;
14633
14635
  }
14634
- st?.preData?.rows && Ae(st.preData.rows);
14635
- } catch (M) {
14636
- console.error("Failed to parse databaseReference for retrieveTableDataList:", M), st?.preData?.rows && Ae(st.preData.rows);
14636
+ st?.preData?.rows ? (console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u4F7F\u7528\u540E\u5907\u65B9\u6848 parseDatabaseReference.preData.rows:", st.preData.rows), Ae(st.preData.rows)) : console.warn("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u672A\u627E\u5230\u53EF\u7528\u7684\u6570\u636E\u5E93\u6570\u636E");
14637
+ } catch (R) {
14638
+ console.error("Failed to parse databaseReference for retrieveTableDataList:", R), st?.preData?.rows && Ae(st.preData.rows);
14637
14639
  }
14638
14640
  else
14639
- Ae([]);
14640
- }, [E, st]), be.useEffect(() => {
14641
- Ae([]), Ve(null), se([]);
14642
- }, [z]);
14641
+ console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] databaseReference \u4E0D\u5B58\u5728\uFF0C\u6E05\u7A7A databaseData"), Ae([]);
14642
+ }, [E, st, I]);
14643
14643
  const xa = ke(() => {
14644
14644
  try {
14645
- const M = Array.isArray(Lt) ? Lt : [], ie = Array.isArray(Ft) ? Ft : [], ve = Array.isArray($t) ? $t : [], ce = Array.from(/* @__PURE__ */ new Set([...ft || [], ...jt || []])), oe = Br(qe || []), fe = (ue) => typeof Te != "string" ? !1 : new RegExp(`\\[retrive-tag[^\\]]*id=['"]${ue}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`, "g").test(Te), ge = (ue) => {
14645
+ const R = Array.isArray(Lt) ? Lt : [], ae = Array.isArray(Ft) ? Ft : [], ve = Array.isArray($t) ? $t : [], ce = Array.from(/* @__PURE__ */ new Set([...ft || [], ...jt || []])), oe = Br(qe || []), fe = (ue) => typeof Te != "string" ? !1 : new RegExp(`\\[retrive-tag[^\\]]*id=['"]${ue}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`, "g").test(Te), ge = (ue) => {
14646
14646
  const De = /* @__PURE__ */ new Map();
14647
14647
  return ue.forEach((re) => {
14648
14648
  if (re.id) {
@@ -14655,16 +14655,16 @@ const bv = Qe.div`
14655
14655
  }
14656
14656
  }
14657
14657
  }), Array.from(De.values());
14658
- }, W = M.map((ue) => ({
14658
+ }, _ = R.map((ue) => ({
14659
14659
  ...ue,
14660
14660
  tags: ge((ue.tags || []).filter((De) => De.id && fe(String(De.id))))
14661
- })), m = ie.map((ue) => ({
14661
+ })), m = ae.map((ue) => ({
14662
14662
  ...ue,
14663
14663
  tags: ge((ue.tags || []).filter((De) => De.id && fe(String(De.id))))
14664
14664
  })), y = ve.map((ue) => ({
14665
14665
  ...ue,
14666
14666
  tags: ge((ue.tags || []).filter((De) => De.id && fe(String(De.id))))
14667
- })), j = Be && Be.length > 0 ? Be.map((ue) => ({
14667
+ })), j = Ee && Ee.length > 0 ? Ee.map((ue) => ({
14668
14668
  // 只保留必要的元数据字段,不包含数据行
14669
14669
  id: ue.id || ue.tableName || "",
14670
14670
  databaseName: ue.databaseName || st?.databaseName || "",
@@ -14682,8 +14682,8 @@ const bv = Qe.div`
14682
14682
  } : {}
14683
14683
  })) : [];
14684
14684
  return {
14685
- queryId: z,
14686
- knowledgeRefs: W,
14685
+ queryId: I,
14686
+ knowledgeRefs: _,
14687
14687
  webRefs: m,
14688
14688
  graphRefs: y,
14689
14689
  // 移除 databaseRef,只保留 databaseRefs(ReferenceBar 只使用 databaseRefs)
@@ -14701,7 +14701,7 @@ const bv = Qe.div`
14701
14701
  };
14702
14702
  } catch {
14703
14703
  return {
14704
- queryId: z,
14704
+ queryId: I,
14705
14705
  knowledgeRefs: [],
14706
14706
  webRefs: [],
14707
14707
  graphRefs: [],
@@ -14716,11 +14716,11 @@ const bv = Qe.div`
14716
14716
  Ft,
14717
14717
  $t,
14718
14718
  st,
14719
- Be,
14719
+ Ee,
14720
14720
  ft,
14721
14721
  jt,
14722
14722
  qe,
14723
- z,
14723
+ I,
14724
14724
  D,
14725
14725
  c,
14726
14726
  B,
@@ -14738,44 +14738,44 @@ const bv = Qe.div`
14738
14738
  return [];
14739
14739
  }, [s, w]), wa = () => {
14740
14740
  if (!s || br.length === 0) return null;
14741
- const M = (W) => W?.status && (String(W.status).toLowerCase() === "uploading" || String(W.status).toLowerCase() === "parsing") ? !1 : !!(W?.url || W?.filePath || W?.convertedFilePath), ie = br.filter((W) => {
14742
- const m = (W.name || "").split(".").pop() || "";
14741
+ const R = (_) => _?.status && (String(_.status).toLowerCase() === "uploading" || String(_.status).toLowerCase() === "parsing") ? !1 : !!(_?.url || _?.filePath || _?.convertedFilePath), ae = br.filter((_) => {
14742
+ const m = (_.name || "").split(".").pop() || "";
14743
14743
  return ["image", "jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(m.toLowerCase());
14744
- }), ve = br.filter((W) => {
14745
- const m = (W.name || "").split(".").pop() || "";
14744
+ }), ve = br.filter((_) => {
14745
+ const m = (_.name || "").split(".").pop() || "";
14746
14746
  return !["image", "jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(m.toLowerCase());
14747
- }), ce = ie.filter(M), oe = ie.filter((W) => !M(W)), fe = ve.filter(M), ge = ve.filter((W) => !M(W));
14747
+ }), ce = ae.filter(R), oe = ae.filter((_) => !R(_)), fe = ve.filter(R), ge = ve.filter((_) => !R(_));
14748
14748
  return /* @__PURE__ */ b.jsxs("div", { className: "w-full mt-4", children: [
14749
14749
  (ce.length > 0 || oe.length > 0) && /* @__PURE__ */ b.jsx(ni, { $theme: Z, children: /* @__PURE__ */ b.jsxs("div", { className: "gallery-grid", style: {
14750
14750
  direction: "rtl"
14751
14751
  // 从右到左排列
14752
14752
  }, children: [
14753
- oe.map((W, m) => /* @__PURE__ */ b.jsx("div", { className: "gallery-item", style: { background: "#f5f6fa", display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ b.jsx("div", { className: "animate-spin", style: { width: 24, height: 24, border: "2px solid #d1d5db", borderTopColor: Z.colors?.primary || "#3b82f6", borderRadius: "9999px" } }) }, `pending-img-${m}`)),
14754
- ce.map((W) => /* @__PURE__ */ b.jsxs(
14753
+ oe.map((_, m) => /* @__PURE__ */ b.jsx("div", { className: "gallery-item", style: { background: "#f5f6fa", display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ b.jsx("div", { className: "animate-spin", style: { width: 24, height: 24, border: "2px solid #d1d5db", borderTopColor: Z.colors?.primary || "#3b82f6", borderRadius: "9999px" } }) }, `pending-img-${m}`)),
14754
+ ce.map((_) => /* @__PURE__ */ b.jsxs(
14755
14755
  "div",
14756
14756
  {
14757
14757
  className: "gallery-item",
14758
14758
  onClick: () => {
14759
- le(W.url || W.filePath || null), $?.("reference_file:click", {
14760
- file: W.name,
14759
+ le(_.url || _.filePath || null), $?.("reference_file:click", {
14760
+ file: _.name,
14761
14761
  file_type: "image",
14762
- url: W.url || W.filePath,
14763
- parse_url: W.parseUrl || W.convertedFilePath,
14764
- retrieve_tags: W.retrieveTags || [],
14765
- file_id: W.uid,
14762
+ url: _.url || _.filePath,
14763
+ parse_url: _.parseUrl || _.convertedFilePath,
14764
+ retrieve_tags: _.retrieveTags || [],
14765
+ file_id: _.uid,
14766
14766
  parsed_file_type: "image",
14767
- references: W,
14767
+ references: _,
14768
14768
  type: "image",
14769
14769
  isUploadFile: !0,
14770
- pdfPages: W.pdfPages || 0
14770
+ pdfPages: _.pdfPages || 0
14771
14771
  });
14772
14772
  },
14773
14773
  children: [
14774
14774
  /* @__PURE__ */ b.jsx(
14775
14775
  "img",
14776
14776
  {
14777
- src: W.url || W.filePath,
14778
- alt: W.name,
14777
+ src: _.url || _.filePath,
14778
+ alt: _.name,
14779
14779
  className: "gallery-image",
14780
14780
  onError: (m) => {
14781
14781
  const y = m.target;
@@ -14783,10 +14783,10 @@ const bv = Qe.div`
14783
14783
  }
14784
14784
  }
14785
14785
  ),
14786
- /* @__PURE__ */ b.jsx("div", { className: "gallery-overlay", children: W.name })
14786
+ /* @__PURE__ */ b.jsx("div", { className: "gallery-overlay", children: _.name })
14787
14787
  ]
14788
14788
  },
14789
- W.uid || W.name
14789
+ _.uid || _.name
14790
14790
  ))
14791
14791
  ] }) }),
14792
14792
  (fe.length > 0 || ge.length > 0) && /* @__PURE__ */ b.jsxs("div", { className: "w-full", children: [
@@ -14796,30 +14796,30 @@ const bv = Qe.div`
14796
14796
  ")"
14797
14797
  ] }),
14798
14798
  /* @__PURE__ */ b.jsxs("div", { className: "flex flex-col gap-2 px-4", style: { direction: "ltr" }, children: [
14799
- ge.map((W, m) => /* @__PURE__ */ b.jsxs("div", { className: "flex items-center gap-3 p-3 rounded-lg border border-gray-200 bg-gray-50/40", children: [
14799
+ ge.map((_, m) => /* @__PURE__ */ b.jsxs("div", { className: "flex items-center gap-3 p-3 rounded-lg border border-gray-200 bg-gray-50/40", children: [
14800
14800
  /* @__PURE__ */ b.jsx("div", { className: "flex-shrink-0 w-6 h-6 rounded bg-gray-200" }),
14801
14801
  /* @__PURE__ */ b.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ b.jsx("div", { className: "h-3 rounded bg-gray-200 w-[60%]" }) }),
14802
14802
  /* @__PURE__ */ b.jsx("div", { className: "w-6 h-6", children: /* @__PURE__ */ b.jsx("div", { className: "animate-spin", style: { width: 18, height: 18, border: "2px solid #d1d5db", borderTopColor: Z.colors?.primary || "#3b82f6", borderRadius: "9999px" } }) })
14803
14803
  ] }, `pending-doc-${m}`)),
14804
- fe.map((W) => {
14805
- const m = (W.name || "").split(".").pop() || "";
14804
+ fe.map((_) => {
14805
+ const m = (_.name || "").split(".").pop() || "";
14806
14806
  return /* @__PURE__ */ b.jsxs(
14807
14807
  "div",
14808
14808
  {
14809
14809
  className: "flex items-center gap-3 p-3 rounded-lg border border-gray-200 hover:border-blue-300 hover:bg-gray-50 transition-colors cursor-pointer",
14810
14810
  onClick: () => {
14811
14811
  $?.("reference_file:click", {
14812
- file: W.name,
14812
+ file: _.name,
14813
14813
  file_type: m,
14814
- url: W.url || W.filePath,
14815
- parse_url: W.parseUrl || W.convertedFilePath,
14816
- retrieve_tags: W.retrieveTags || [],
14817
- file_id: W.uid,
14814
+ url: _.url || _.filePath,
14815
+ parse_url: _.parseUrl || _.convertedFilePath,
14816
+ retrieve_tags: _.retrieveTags || [],
14817
+ file_id: _.uid,
14818
14818
  parsed_file_type: m,
14819
- references: W,
14819
+ references: _,
14820
14820
  type: "file",
14821
14821
  isUploadFile: !0,
14822
- pdfPages: W.pdfPages || 0
14822
+ pdfPages: _.pdfPages || 0
14823
14823
  });
14824
14824
  },
14825
14825
  children: [
@@ -14831,21 +14831,21 @@ const bv = Qe.div`
14831
14831
  onClick: (y) => {
14832
14832
  y.stopPropagation(), $?.("referenceFile_question", {
14833
14833
  data: {
14834
- ...W,
14834
+ ..._,
14835
14835
  file_type: m,
14836
- file_name: W.name,
14837
- metadata: W,
14838
- parsedFilePath: W.url || W.filePath
14836
+ file_name: _.name,
14837
+ metadata: _,
14838
+ parsedFilePath: _.url || _.filePath
14839
14839
  }
14840
14840
  });
14841
14841
  },
14842
- children: W.name
14842
+ children: _.name
14843
14843
  }
14844
14844
  ) }),
14845
- W.size && /* @__PURE__ */ b.jsx("div", { className: "text-sm text-gray-600", children: W.size })
14845
+ _.size && /* @__PURE__ */ b.jsx("div", { className: "text-sm text-gray-600", children: _.size })
14846
14846
  ]
14847
14847
  },
14848
- W.uid || W.name
14848
+ _.uid || _.name
14849
14849
  );
14850
14850
  })
14851
14851
  ] })
@@ -14853,10 +14853,10 @@ const bv = Qe.div`
14853
14853
  ] });
14854
14854
  }, mn = () => {
14855
14855
  if (s) return null;
14856
- const M = Array.isArray(Lt) ? Lt : [], ie = Array.isArray(Ft) ? Ft : [], ve = Array.isArray($t) ? $t : [], ce = M.length > 0 && O !== 5, oe = ie.length > 0, fe = ve.length > 0, ge = (ft?.length || 0) > 0 || (jt?.length || 0) > 0, W = Be && Be.length > 0, m = ce || oe || fe || ge || W;
14857
- if (U === "button") {
14856
+ const R = Array.isArray(Lt) ? Lt : [], ae = Array.isArray(Ft) ? Ft : [], ve = Array.isArray($t) ? $t : [], ce = R.length > 0 && O !== 5, oe = ae.length > 0, fe = ve.length > 0, ge = (ft?.length || 0) > 0 || (jt?.length || 0) > 0, _ = Ee && Ee.length > 0, m = ce || oe || fe || ge || _;
14857
+ if (console.log("[\u5F15\u7528\u6E32\u67D3] databaseReference:", E), console.log("[\u5F15\u7528\u6E32\u67D3] databaseData:", Ee), console.log("[\u5F15\u7528\u6E32\u67D3] databaseData.length:", Ee?.length), console.log("[\u5F15\u7528\u6E32\u67D3] hasDatabaseRefs:", _), U === "button") {
14858
14858
  if (!m) return null;
14859
- const y = (M?.length || 0) + (ie?.length || 0) + (ve?.length || 0) + (W ? 1 : 0) + ((ft?.length || 0) + (jt?.length || 0) > 0 ? 1 : 0);
14859
+ const y = (R?.length || 0) + (ae?.length || 0) + (ve?.length || 0) + (_ ? 1 : 0) + ((ft?.length || 0) + (jt?.length || 0) > 0 ? 1 : 0);
14860
14860
  return /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
14861
14861
  ge && /* @__PURE__ */ b.jsx(ni, { $theme: Z, children: /* @__PURE__ */ b.jsx("div", { className: "gallery-grid", children: [...ft, ...jt].map((j, X) => /* @__PURE__ */ b.jsxs(
14862
14862
  "div",
@@ -14963,8 +14963,8 @@ const bv = Qe.div`
14963
14963
  ce && /* @__PURE__ */ b.jsxs(Nn, { $theme: Z, children: [
14964
14964
  /* @__PURE__ */ b.jsx("div", { className: "reference-title justify-between items-center flex", children: /* @__PURE__ */ b.jsxs("div", { className: "flex items-center gap-2", children: [
14965
14965
  /* @__PURE__ */ b.jsx("span", { className: "text-[#374151]", children: "\u77E5\u8BC6\u5E93\u6587\u6863\u5F15\u7528" }),
14966
- /* @__PURE__ */ b.jsx("span", { className: "text-[#b4b4b4] text-xs", children: ` (${M.length})` }),
14967
- M.length > 2 && /* @__PURE__ */ b.jsx(
14966
+ /* @__PURE__ */ b.jsx("span", { className: "text-[#b4b4b4] text-xs", children: ` (${R.length})` }),
14967
+ R.length > 2 && /* @__PURE__ */ b.jsx(
14968
14968
  "div",
14969
14969
  {
14970
14970
  onClick: () => J(!x),
@@ -14973,7 +14973,7 @@ const bv = Qe.div`
14973
14973
  }
14974
14974
  )
14975
14975
  ] }) }),
14976
- /* @__PURE__ */ b.jsx("div", { className: "reference-list", children: (x ? M : M.slice(0, 2)).map((y, j) => y && /* @__PURE__ */ b.jsx(
14976
+ /* @__PURE__ */ b.jsx("div", { className: "reference-list", children: (x ? R : R.slice(0, 2)).map((y, j) => y && /* @__PURE__ */ b.jsx(
14977
14977
  "div",
14978
14978
  {
14979
14979
  className: "reference-item",
@@ -15074,11 +15074,11 @@ const bv = Qe.div`
15074
15074
  y.file_id || j
15075
15075
  )) })
15076
15076
  ] }),
15077
- W && /* @__PURE__ */ b.jsxs(Nn, { $theme: Z, children: [
15077
+ _ && /* @__PURE__ */ b.jsxs(Nn, { $theme: Z, children: [
15078
15078
  /* @__PURE__ */ b.jsx("div", { className: "reference-title justify-between items-center flex", children: /* @__PURE__ */ b.jsxs("div", { className: "flex items-center gap-2", children: [
15079
15079
  /* @__PURE__ */ b.jsx("span", { className: "text-[#374151]", children: "\u6570\u636E\u5E93\u5F15\u7528" }),
15080
- /* @__PURE__ */ b.jsx("span", { className: "text-[#b4b4b4] text-xs", children: ` (${Be.length || 0})` }),
15081
- Be.length > 2 && /* @__PURE__ */ b.jsx(
15080
+ /* @__PURE__ */ b.jsx("span", { className: "text-[#b4b4b4] text-xs", children: ` (${Ee.length || 0})` }),
15081
+ Ee.length > 2 && /* @__PURE__ */ b.jsx(
15082
15082
  "div",
15083
15083
  {
15084
15084
  onClick: () => te(!ne),
@@ -15087,7 +15087,7 @@ const bv = Qe.div`
15087
15087
  }
15088
15088
  )
15089
15089
  ] }) }),
15090
- /* @__PURE__ */ b.jsx("div", { className: "reference-list", children: (ne ? Be : Be.slice(0, 2)).map((y, j) => /* @__PURE__ */ b.jsx(
15090
+ /* @__PURE__ */ b.jsx("div", { className: "reference-list", children: (ne ? Ee : Ee.slice(0, 2)).map((y, j) => /* @__PURE__ */ b.jsx(
15091
15091
  "div",
15092
15092
  {
15093
15093
  className: "reference-item",
@@ -15132,8 +15132,8 @@ const bv = Qe.div`
15132
15132
  oe && /* @__PURE__ */ b.jsxs(Nn, { $theme: Z, children: [
15133
15133
  /* @__PURE__ */ b.jsx("div", { className: "reference-title justify-between items-center flex", children: /* @__PURE__ */ b.jsxs("div", { className: "flex items-center gap-2", children: [
15134
15134
  /* @__PURE__ */ b.jsx("span", { className: "text-[#374151]", children: "\u4E92\u8054\u7F51\u641C\u7D22\u5F15\u7528" }),
15135
- /* @__PURE__ */ b.jsx("span", { className: "text-[#b4b4b4] text-xs", children: ` (${ie.length})` }),
15136
- ie.length > 2 && /* @__PURE__ */ b.jsx(
15135
+ /* @__PURE__ */ b.jsx("span", { className: "text-[#b4b4b4] text-xs", children: ` (${ae.length})` }),
15136
+ ae.length > 2 && /* @__PURE__ */ b.jsx(
15137
15137
  "div",
15138
15138
  {
15139
15139
  onClick: () => V(!H),
@@ -15142,7 +15142,7 @@ const bv = Qe.div`
15142
15142
  }
15143
15143
  )
15144
15144
  ] }) }),
15145
- /* @__PURE__ */ b.jsx("div", { className: "reference-list", children: (H ? ie : ie.slice(0, 2)).map((y, j) => /* @__PURE__ */ b.jsx(
15145
+ /* @__PURE__ */ b.jsx("div", { className: "reference-list", children: (H ? ae : ae.slice(0, 2)).map((y, j) => /* @__PURE__ */ b.jsx(
15146
15146
  "div",
15147
15147
  {
15148
15148
  className: "reference-item",
@@ -15274,17 +15274,17 @@ const bv = Qe.div`
15274
15274
  )) })
15275
15275
  ] })
15276
15276
  ] }) : null;
15277
- }, vn = () => s || !L || !k || k.length === 0 ? null : /* @__PURE__ */ b.jsx(Ev, { $theme: Z, children: /* @__PURE__ */ b.jsx("div", { className: "follow-up-list", children: k.map((M, ie) => /* @__PURE__ */ b.jsx(
15277
+ }, vn = () => s || !L || !k || k.length === 0 ? null : /* @__PURE__ */ b.jsx(Ev, { $theme: Z, children: /* @__PURE__ */ b.jsx("div", { className: "follow-up-list", children: k.map((R, ae) => /* @__PURE__ */ b.jsx(
15278
15278
  "div",
15279
15279
  {
15280
15280
  className: "follow-up-item",
15281
- style: { animationDelay: `${ie * 260}ms` },
15281
+ style: { animationDelay: `${ae * 260}ms` },
15282
15282
  onClick: () => {
15283
- $?.("chatbox:follow_up_question_click", { question: M, queryId: z });
15283
+ $?.("chatbox:follow_up_question_click", { question: R, queryId: I });
15284
15284
  },
15285
- children: M
15285
+ children: R
15286
15286
  },
15287
- `${String(M)}-${ie}`
15287
+ `${String(R)}-${ae}`
15288
15288
  )) }) });
15289
15289
  return /* @__PURE__ */ b.jsxs(bv, { $align: n, $isUser: s, children: [
15290
15290
  /* @__PURE__ */ b.jsxs(yv, { $isUser: s, children: [
@@ -15328,7 +15328,7 @@ const bv = Qe.div`
15328
15328
  {
15329
15329
  $show: xe !== null,
15330
15330
  onClick: () => le(null),
15331
- children: xe && /* @__PURE__ */ b.jsxs("div", { className: "modal-content", onClick: (M) => M.stopPropagation(), children: [
15331
+ children: xe && /* @__PURE__ */ b.jsxs("div", { className: "modal-content", onClick: (R) => R.stopPropagation(), children: [
15332
15332
  /* @__PURE__ */ b.jsx(
15333
15333
  "img",
15334
15334
  {
@@ -15564,7 +15564,7 @@ const bv = Qe.div`
15564
15564
  ...u
15565
15565
  }), [B, u]), w = Ue(0);
15566
15566
  w.current += 1, console.log("[Markdownit] render count:", w.current);
15567
- const [T, S] = $e([]), [A, z] = $e({ start: 0, end: 10 }), [K, G] = $e(0), [L, N] = $e(0), [I, O] = $e(!1), [k, P] = $e(!1), [$, U] = $e(!1), Y = Ue(null), Z = Ue(null), q = Ue(null), ee = We(() => Array.isArray(e) ? e : [{
15567
+ const [T, S] = $e([]), [A, I] = $e({ start: 0, end: 10 }), [K, G] = $e(0), [L, M] = $e(0), [z, O] = $e(!1), [k, P] = $e(!1), [$, U] = $e(!1), Y = Ue(null), Z = Ue(null), q = Ue(null), ee = We(() => Array.isArray(e) ? e : [{
15568
15568
  id: "single",
15569
15569
  content: e.content,
15570
15570
  type: e.type,
@@ -15586,7 +15586,7 @@ const bv = Qe.div`
15586
15586
  const me = !t && !h && !p && !g && !a;
15587
15587
  if (console.log("[Markdownit] passiveOnly:", me), me || G((Ce) => Ce !== te ? (console.log("[Markdownit] setScrollTop:", te), te) : Ce), t && !me) {
15588
15588
  const Ce = Math.floor(te / r), Fe = Math.min(T.length, Ce + Math.ceil(L / r) + 1);
15589
- z((Be) => Be.start !== Ce || Be.end !== Fe ? (console.log("[Markdownit] setVisibleRange:", { start: Ce, end: Fe }), { start: Ce, end: Fe }) : Be);
15589
+ I((Ee) => Ee.start !== Ce || Ee.end !== Fe ? (console.log("[Markdownit] setVisibleRange:", { start: Ce, end: Fe }), { start: Ce, end: Fe }) : Ee);
15590
15590
  }
15591
15591
  if (!me) {
15592
15592
  const Ce = te <= 10;
@@ -15596,9 +15596,9 @@ const bv = Qe.div`
15596
15596
  const Ce = te + we >= de - 10;
15597
15597
  Ce !== $ && (console.log("[Markdownit] isAtBottom ->", Ce), U(Ce), Ce && g && (console.log("[Markdownit] onScrollToBottom callback"), g()));
15598
15598
  }
15599
- h && (console.log("[Markdownit] onScroll callback ->", { newScrollTop: te, scrollHeight: de }), h(te, de)), a && i && !I && !s && de - te - L < 100 && x();
15600
- }, [t, r, T.length, L, a, i, I, s, k, $, p, g, h]), x = ke(async () => {
15601
- if (!(!i || I || s)) {
15599
+ h && (console.log("[Markdownit] onScroll callback ->", { newScrollTop: te, scrollHeight: de }), h(te, de)), a && i && !z && !s && de - te - L < 100 && x();
15600
+ }, [t, r, T.length, L, a, i, z, s, k, $, p, g, h]), x = ke(async () => {
15601
+ if (!(!i || z || s)) {
15602
15602
  O(!0);
15603
15603
  try {
15604
15604
  const ne = T[T.length - 1], te = await i(ne.id);
@@ -15609,10 +15609,10 @@ const bv = Qe.div`
15609
15609
  O(!1);
15610
15610
  }
15611
15611
  }
15612
- }, [i, T, I, s]);
15612
+ }, [i, T, z, s]);
15613
15613
  Je(() => {
15614
15614
  const ne = () => {
15615
- Y.current && N(Y.current.clientHeight);
15615
+ Y.current && M(Y.current.clientHeight);
15616
15616
  };
15617
15617
  return ne(), window.addEventListener("resize", ne), () => window.removeEventListener("resize", ne);
15618
15618
  }, []);
@@ -15656,7 +15656,7 @@ const bv = Qe.div`
15656
15656
  }, [t, r, F, f, v]), H = () => (console.log("[Markdownit] renderContent segments.len:", T.length, "enableVirtualScroll:", t), T.length === 0 ? /* @__PURE__ */ b.jsxs(Sv, { theme: F, children: [
15657
15657
  /* @__PURE__ */ b.jsx("h3", { children: "\u6682\u65E0\u5185\u5BB9" }),
15658
15658
  /* @__PURE__ */ b.jsx("p", { children: "\u8BF7\u6DFB\u52A0\u4E00\u4E9B\u5185\u5BB9\u6765\u5F00\u59CB" })
15659
- ] }) : t ? /* @__PURE__ */ b.jsx("div", { ref: q, style: { height: se, position: "relative" }, children: xe.map(J) }) : /* @__PURE__ */ b.jsx("div", { ref: q, children: T.map(J) })), V = () => !I && !s ? null : /* @__PURE__ */ b.jsx(kv, { theme: F, children: s ? "\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9..." : "\u52A0\u8F7D\u4E2D..." });
15659
+ ] }) : t ? /* @__PURE__ */ b.jsx("div", { ref: q, style: { height: se, position: "relative" }, children: xe.map(J) }) : /* @__PURE__ */ b.jsx("div", { ref: q, children: T.map(J) })), V = () => !z && !s ? null : /* @__PURE__ */ b.jsx(kv, { theme: F, children: s ? "\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9..." : "\u52A0\u8F7D\u4E2D..." });
15660
15660
  return /* @__PURE__ */ b.jsx(
15661
15661
  Av,
15662
15662
  {