@sovann72-dev/lynqify-ui 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/dist/components/RichTextEditor/Extension/{batch-segment-images.types.d.ts → BatchSegmentImages/batch-segment-images.types.d.ts} +13 -1
  2. package/dist/components/RichTextEditor/Extension/Image/ImageResize/image-resize.d.ts +1 -2
  3. package/dist/components/RichTextEditor/Extension/List/custom-list-item.extension.d.ts +3 -17
  4. package/dist/components/RichTextEditor/Extension/custom-image.extension.d.ts +2 -4
  5. package/dist/components/RichTextEditor/Extension/custom-link.extension.d.ts +1 -3
  6. package/dist/components/RichTextEditor/Extension/custom-mention.extension.d.ts +1 -3
  7. package/dist/components/RichTextEditor/Extension/custom-paragraph.extension.d.ts +1 -3
  8. package/dist/components/RichTextEditor/Extension/extensions.d.ts +2 -4
  9. package/dist/components/RichTextEditor/Videos/types.d.ts +22 -0
  10. package/dist/components/RichTextEditor/Videos/video.extension.d.ts +23 -0
  11. package/dist/{core-DSeuwlI1.js → core-CEwYiOza.js} +683 -667
  12. package/dist/{index-BCEcU3oG.js → index-C2VhDZqf.js} +1 -2
  13. package/dist/index.d.ts +8 -2
  14. package/dist/lynqify-ui.js +1751 -1535
  15. package/dist/tiptap/core.js +1 -1
  16. package/dist/tiptap/react.js +2 -2
  17. package/package.json +2 -1
  18. package/dist/components/NoteEditor/BatchImageGalleryNodeView.d.ts +0 -19
  19. package/dist/components/RichTextEditor/Extension/file-filtering.extension.d.ts +0 -1
  20. /package/dist/components/RichTextEditor/Extension/{batch-segment-images.extension.d.ts → BatchSegmentImages/batch-segment-images.extension.d.ts} +0 -0
@@ -98,7 +98,7 @@ V.from = function(n) {
98
98
  if (n) for (var t in n) e.push(t, n[t]);
99
99
  return new V(e);
100
100
  };
101
- function zi(n, e, t) {
101
+ function Bi(n, e, t) {
102
102
  for (let r = 0; ; r++) {
103
103
  if (r == n.childCount || r == e.childCount)
104
104
  return n.childCount == e.childCount ? null : t;
@@ -115,14 +115,14 @@ function zi(n, e, t) {
115
115
  return t;
116
116
  }
117
117
  if (i.content.size || s.content.size) {
118
- let o = zi(i.content, s.content, t + 1);
118
+ let o = Bi(i.content, s.content, t + 1);
119
119
  if (o != null)
120
120
  return o;
121
121
  }
122
122
  t += i.nodeSize;
123
123
  }
124
124
  }
125
- function Bi(n, e, t, r) {
125
+ function Fi(n, e, t, r) {
126
126
  for (let i = n.childCount, s = e.childCount; ; ) {
127
127
  if (i == 0 || s == 0)
128
128
  return i == s ? null : { a: t, b: r };
@@ -140,7 +140,7 @@ function Bi(n, e, t, r) {
140
140
  return { a: t, b: r };
141
141
  }
142
142
  if (o.content.size || l.content.size) {
143
- let c = Bi(o.content, l.content, t - 1, r - 1);
143
+ let c = Fi(o.content, l.content, t - 1, r - 1);
144
144
  if (c)
145
145
  return c;
146
146
  }
@@ -309,7 +309,7 @@ class b {
309
309
  fragment differ, or `null` if they are the same.
310
310
  */
311
311
  findDiffStart(e, t = 0) {
312
- return zi(this, e, t);
312
+ return Bi(this, e, t);
313
313
  }
314
314
  /**
315
315
  Find the first position, searching from the end, at which this
@@ -318,7 +318,7 @@ class b {
318
318
  nodes, an object with two separate positions is returned.
319
319
  */
320
320
  findDiffEnd(e, t = this.size, r = e.size) {
321
- return Bi(this, e, t, r);
321
+ return Fi(this, e, t, r);
322
322
  }
323
323
  /**
324
324
  Find the index and inner offset corresponding to a given relative
@@ -327,15 +327,15 @@ class b {
327
327
  */
328
328
  findIndex(e) {
329
329
  if (e == 0)
330
- return At(0, e);
330
+ return Rt(0, e);
331
331
  if (e == this.size)
332
- return At(this.content.length, e);
332
+ return Rt(this.content.length, e);
333
333
  if (e > this.size || e < 0)
334
334
  throw new RangeError(`Position ${e} outside of fragment (${this})`);
335
335
  for (let t = 0, r = 0; ; t++) {
336
336
  let i = this.child(t), s = r + i.nodeSize;
337
337
  if (s >= e)
338
- return s == e ? At(t + 1, s) : At(t, r);
338
+ return s == e ? Rt(t + 1, s) : Rt(t, r);
339
339
  r = s;
340
340
  }
341
341
  }
@@ -401,10 +401,10 @@ class b {
401
401
  }
402
402
  b.empty = new b([], 0);
403
403
  const gn = { index: 0, offset: 0 };
404
- function At(n, e) {
404
+ function Rt(n, e) {
405
405
  return gn.index = n, gn.offset = e, gn;
406
406
  }
407
- function Lt(n, e) {
407
+ function Wt(n, e) {
408
408
  if (n === e)
409
409
  return !0;
410
410
  if (!(n && typeof n == "object") || !(e && typeof e == "object"))
@@ -416,11 +416,11 @@ function Lt(n, e) {
416
416
  if (n.length != e.length)
417
417
  return !1;
418
418
  for (let r = 0; r < n.length; r++)
419
- if (!Lt(n[r], e[r]))
419
+ if (!Wt(n[r], e[r]))
420
420
  return !1;
421
421
  } else {
422
422
  for (let r in n)
423
- if (!(r in e) || !Lt(n[r], e[r]))
423
+ if (!(r in e) || !Wt(n[r], e[r]))
424
424
  return !1;
425
425
  for (let r in e)
426
426
  if (!(r in n))
@@ -482,7 +482,7 @@ let I = class Pn {
482
482
  another mark.
483
483
  */
484
484
  eq(e) {
485
- return this == e || this.type == e.type && Lt(this.attrs, e.attrs);
485
+ return this == e || this.type == e.type && Wt(this.attrs, e.attrs);
486
486
  }
487
487
  /**
488
488
  Convert this mark to a JSON-serializeable representation.
@@ -534,7 +534,7 @@ let I = class Pn {
534
534
  }
535
535
  };
536
536
  I.none = [];
537
- class Wt extends Error {
537
+ class Ht extends Error {
538
538
  }
539
539
  class k {
540
540
  /**
@@ -562,14 +562,14 @@ class k {
562
562
  @internal
563
563
  */
564
564
  insertAt(e, t) {
565
- let r = $i(this.content, e + this.openStart, t);
565
+ let r = Vi(this.content, e + this.openStart, t);
566
566
  return r && new k(r, this.openStart, this.openEnd);
567
567
  }
568
568
  /**
569
569
  @internal
570
570
  */
571
571
  removeBetween(e, t) {
572
- return new k(Fi(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);
572
+ return new k($i(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);
573
573
  }
574
574
  /**
575
575
  Tests whether this slice is equal to another slice.
@@ -617,7 +617,7 @@ class k {
617
617
  }
618
618
  }
619
619
  k.empty = new k(b.empty, 0, 0);
620
- function Fi(n, e, t) {
620
+ function $i(n, e, t) {
621
621
  let { index: r, offset: i } = n.findIndex(e), s = n.maybeChild(r), { index: o, offset: l } = n.findIndex(t);
622
622
  if (i == e || s.isText) {
623
623
  if (l != t && !n.child(o).isText)
@@ -626,26 +626,26 @@ function Fi(n, e, t) {
626
626
  }
627
627
  if (r != o)
628
628
  throw new RangeError("Removing non-flat range");
629
- return n.replaceChild(r, s.copy(Fi(s.content, e - i - 1, t - i - 1)));
629
+ return n.replaceChild(r, s.copy($i(s.content, e - i - 1, t - i - 1)));
630
630
  }
631
- function $i(n, e, t, r) {
631
+ function Vi(n, e, t, r) {
632
632
  let { index: i, offset: s } = n.findIndex(e), o = n.maybeChild(i);
633
633
  if (s == e || o.isText)
634
634
  return r && !r.canReplace(i, i, t) ? null : n.cut(0, e).append(t).append(n.cut(e));
635
- let l = $i(o.content, e - s - 1, t, o);
635
+ let l = Vi(o.content, e - s - 1, t, o);
636
636
  return l && n.replaceChild(i, o.copy(l));
637
637
  }
638
638
  function Lo(n, e, t) {
639
639
  if (t.openStart > n.depth)
640
- throw new Wt("Inserted content deeper than insertion position");
640
+ throw new Ht("Inserted content deeper than insertion position");
641
641
  if (n.depth - t.openStart != e.depth - t.openEnd)
642
- throw new Wt("Inconsistent open depths");
643
- return Vi(n, e, t, 0);
642
+ throw new Ht("Inconsistent open depths");
643
+ return Li(n, e, t, 0);
644
644
  }
645
- function Vi(n, e, t, r) {
645
+ function Li(n, e, t, r) {
646
646
  let i = n.index(r), s = n.node(r);
647
647
  if (i == e.index(r) && r < n.depth - t.openStart) {
648
- let o = Vi(n, e, t, r + 1);
648
+ let o = Li(n, e, t, r + 1);
649
649
  return s.copy(s.content.replaceChild(i, o));
650
650
  } else if (t.content.size)
651
651
  if (!t.openStart && !t.openEnd && n.depth == r && e.depth == r) {
@@ -653,17 +653,17 @@ function Vi(n, e, t, r) {
653
653
  return $e(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
654
654
  } else {
655
655
  let { start: o, end: l } = Wo(t, n);
656
- return $e(s, Wi(n, o, l, e, r));
656
+ return $e(s, Hi(n, o, l, e, r));
657
657
  }
658
- else return $e(s, Ht(n, e, r));
658
+ else return $e(s, Jt(n, e, r));
659
659
  }
660
- function Li(n, e) {
660
+ function Wi(n, e) {
661
661
  if (!e.type.compatibleContent(n.type))
662
- throw new Wt("Cannot join " + e.type.name + " onto " + n.type.name);
662
+ throw new Ht("Cannot join " + e.type.name + " onto " + n.type.name);
663
663
  }
664
664
  function zn(n, e, t) {
665
665
  let r = n.node(t);
666
- return Li(r, e.node(t)), r;
666
+ return Wi(r, e.node(t)), r;
667
667
  }
668
668
  function Fe(n, e) {
669
669
  let t = e.length - 1;
@@ -679,15 +679,15 @@ function pt(n, e, t, r) {
679
679
  function $e(n, e) {
680
680
  return n.type.checkContent(e), n.copy(e);
681
681
  }
682
- function Wi(n, e, t, r, i) {
682
+ function Hi(n, e, t, r, i) {
683
683
  let s = n.depth > i && zn(n, e, i + 1), o = r.depth > i && zn(t, r, i + 1), l = [];
684
- return pt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Li(s, o), Fe($e(s, Wi(n, e, t, r, i + 1)), l)) : (s && Fe($e(s, Ht(n, e, i + 1)), l), pt(e, t, i, l), o && Fe($e(o, Ht(t, r, i + 1)), l)), pt(r, null, i, l), new b(l);
684
+ return pt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Wi(s, o), Fe($e(s, Hi(n, e, t, r, i + 1)), l)) : (s && Fe($e(s, Jt(n, e, i + 1)), l), pt(e, t, i, l), o && Fe($e(o, Jt(t, r, i + 1)), l)), pt(r, null, i, l), new b(l);
685
685
  }
686
- function Ht(n, e, t) {
686
+ function Jt(n, e, t) {
687
687
  let r = [];
688
688
  if (pt(null, n, t, r), n.depth > t) {
689
689
  let i = zn(n, e, t + 1);
690
- Fe($e(i, Ht(n, e, t + 1)), r);
690
+ Fe($e(i, Jt(n, e, t + 1)), r);
691
691
  }
692
692
  return pt(e, null, t, r), new b(r);
693
693
  }
@@ -885,7 +885,7 @@ class kt {
885
885
  return e.blockRange(this);
886
886
  for (let r = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); r >= 0; r--)
887
887
  if (e.pos <= this.end(r) && (!t || t(this.node(r))))
888
- return new Jt(this, e, r);
888
+ return new qt(this, e, r);
889
889
  return null;
890
890
  }
891
891
  /**
@@ -934,7 +934,7 @@ class kt {
934
934
  @internal
935
935
  */
936
936
  static resolveCached(e, t) {
937
- let r = Or.get(e);
937
+ let r = vr.get(e);
938
938
  if (r)
939
939
  for (let s = 0; s < r.elts.length; s++) {
940
940
  let o = r.elts[s];
@@ -942,7 +942,7 @@ class kt {
942
942
  return o;
943
943
  }
944
944
  else
945
- Or.set(e, r = new Ho());
945
+ vr.set(e, r = new Ho());
946
946
  let i = r.elts[r.i] = kt.resolve(e, t);
947
947
  return r.i = (r.i + 1) % Jo, i;
948
948
  }
@@ -952,8 +952,8 @@ class Ho {
952
952
  this.elts = [], this.i = 0;
953
953
  }
954
954
  }
955
- const Jo = 12, Or = /* @__PURE__ */ new WeakMap();
956
- class Jt {
955
+ const Jo = 12, vr = /* @__PURE__ */ new WeakMap();
956
+ class qt {
957
957
  /**
958
958
  Construct a node range. `$from` and `$to` should point into the
959
959
  same node until at least the given `depth`, since a node range
@@ -1112,7 +1112,7 @@ class Z {
1112
1112
  attributes, and marks.
1113
1113
  */
1114
1114
  hasMarkup(e, t, r) {
1115
- return this.type == e && Lt(this.attrs, t || e.defaultAttrs || qo) && I.sameSet(this.marks, r || I.none);
1115
+ return this.type == e && Wt(this.attrs, t || e.defaultAttrs || qo) && I.sameSet(this.marks, r || I.none);
1116
1116
  }
1117
1117
  /**
1118
1118
  Create a new node with the same markup as this node, containing
@@ -1270,7 +1270,7 @@ class Z {
1270
1270
  if (this.type.spec.toDebugString)
1271
1271
  return this.type.spec.toDebugString(this);
1272
1272
  let e = this.type.name;
1273
- return this.content.size && (e += "(" + this.content.toStringInner() + ")"), Hi(this.marks, e);
1273
+ return this.content.size && (e += "(" + this.content.toStringInner() + ")"), Ji(this.marks, e);
1274
1274
  }
1275
1275
  /**
1276
1276
  Get the content match in this node at the given index.
@@ -1364,7 +1364,7 @@ class Z {
1364
1364
  }
1365
1365
  }
1366
1366
  Z.prototype.text = void 0;
1367
- class qt extends Z {
1367
+ class _t extends Z {
1368
1368
  /**
1369
1369
  @internal
1370
1370
  */
@@ -1374,7 +1374,7 @@ class qt extends Z {
1374
1374
  this.text = r;
1375
1375
  }
1376
1376
  toString() {
1377
- return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : Hi(this.marks, JSON.stringify(this.text));
1377
+ return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : Ji(this.marks, JSON.stringify(this.text));
1378
1378
  }
1379
1379
  get textContent() {
1380
1380
  return this.text;
@@ -1386,10 +1386,10 @@ class qt extends Z {
1386
1386
  return this.text.length;
1387
1387
  }
1388
1388
  mark(e) {
1389
- return e == this.marks ? this : new qt(this.type, this.attrs, this.text, e);
1389
+ return e == this.marks ? this : new _t(this.type, this.attrs, this.text, e);
1390
1390
  }
1391
1391
  withText(e) {
1392
- return e == this.text ? this : new qt(this.type, this.attrs, e, this.marks);
1392
+ return e == this.text ? this : new _t(this.type, this.attrs, e, this.marks);
1393
1393
  }
1394
1394
  cut(e = 0, t = this.text.length) {
1395
1395
  return e == 0 && t == this.text.length ? this : this.withText(this.text.slice(e, t));
@@ -1402,7 +1402,7 @@ class qt extends Z {
1402
1402
  return e.text = this.text, e;
1403
1403
  }
1404
1404
  }
1405
- function Hi(n, e) {
1405
+ function Ji(n, e) {
1406
1406
  for (let t = n.length - 1; t >= 0; t--)
1407
1407
  e = n[t].type.name + "(" + e + ")";
1408
1408
  return e;
@@ -1418,10 +1418,10 @@ class We {
1418
1418
  @internal
1419
1419
  */
1420
1420
  static parse(e, t) {
1421
- let r = new jo(e, t);
1421
+ let r = new _o(e, t);
1422
1422
  if (r.next == null)
1423
1423
  return We.empty;
1424
- let i = Ji(r);
1424
+ let i = qi(r);
1425
1425
  r.next && r.err("Unexpected trailing text");
1426
1426
  let s = Qo(Go(i));
1427
1427
  return Zo(s, r), s;
@@ -1570,7 +1570,7 @@ class We {
1570
1570
  }
1571
1571
  }
1572
1572
  We.empty = new We(!0);
1573
- class jo {
1573
+ class _o {
1574
1574
  constructor(e, t) {
1575
1575
  this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
1576
1576
  }
@@ -1584,14 +1584,14 @@ class jo {
1584
1584
  throw new SyntaxError(e + " (in content expression '" + this.string + "')");
1585
1585
  }
1586
1586
  }
1587
- function Ji(n) {
1587
+ function qi(n) {
1588
1588
  let e = [];
1589
1589
  do
1590
- e.push(_o(n));
1590
+ e.push(jo(n));
1591
1591
  while (n.eat("|"));
1592
1592
  return e.length == 1 ? e[0] : { type: "choice", exprs: e };
1593
1593
  }
1594
- function _o(n) {
1594
+ function jo(n) {
1595
1595
  let e = [];
1596
1596
  do
1597
1597
  e.push(Ko(n));
@@ -1613,14 +1613,14 @@ function Ko(n) {
1613
1613
  break;
1614
1614
  return e;
1615
1615
  }
1616
- function vr(n) {
1616
+ function Dr(n) {
1617
1617
  /\D/.test(n.next) && n.err("Expected number, got '" + n.next + "'");
1618
1618
  let e = Number(n.next);
1619
1619
  return n.pos++, e;
1620
1620
  }
1621
1621
  function Uo(n, e) {
1622
- let t = vr(n), r = t;
1623
- return n.eat(",") && (n.next != "}" ? r = vr(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
1622
+ let t = Dr(n), r = t;
1623
+ return n.eat(",") && (n.next != "}" ? r = Dr(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
1624
1624
  }
1625
1625
  function Yo(n, e) {
1626
1626
  let t = n.nodeTypes, r = t[e];
@@ -1635,7 +1635,7 @@ function Yo(n, e) {
1635
1635
  }
1636
1636
  function Xo(n) {
1637
1637
  if (n.eat("(")) {
1638
- let e = Ji(n);
1638
+ let e = qi(n);
1639
1639
  return n.eat(")") || n.err("Missing closing paren"), e;
1640
1640
  } else if (/\W/.test(n.next))
1641
1641
  n.err("Unexpected token '" + n.next + "'");
@@ -1698,12 +1698,12 @@ function Go(n) {
1698
1698
  }
1699
1699
  }
1700
1700
  }
1701
- function qi(n, e) {
1701
+ function _i(n, e) {
1702
1702
  return e - n;
1703
1703
  }
1704
- function Dr(n, e) {
1704
+ function Ar(n, e) {
1705
1705
  let t = [];
1706
- return r(e), t.sort(qi);
1706
+ return r(e), t.sort(_i);
1707
1707
  function r(i) {
1708
1708
  let s = n[i];
1709
1709
  if (s.length == 1 && !s[0].term)
@@ -1717,7 +1717,7 @@ function Dr(n, e) {
1717
1717
  }
1718
1718
  function Qo(n) {
1719
1719
  let e = /* @__PURE__ */ Object.create(null);
1720
- return t(Dr(n, 0));
1720
+ return t(Ar(n, 0));
1721
1721
  function t(r) {
1722
1722
  let i = [];
1723
1723
  r.forEach((o) => {
@@ -1727,14 +1727,14 @@ function Qo(n) {
1727
1727
  let c;
1728
1728
  for (let f = 0; f < i.length; f++)
1729
1729
  i[f][0] == l && (c = i[f][1]);
1730
- Dr(n, a).forEach((f) => {
1730
+ Ar(n, a).forEach((f) => {
1731
1731
  c || i.push([l, c = []]), c.indexOf(f) == -1 && c.push(f);
1732
1732
  });
1733
1733
  });
1734
1734
  });
1735
1735
  let s = e[r.join(",")] = new We(r.indexOf(n.length - 1) > -1);
1736
1736
  for (let o = 0; o < i.length; o++) {
1737
- let l = i[o][1].sort(qi);
1737
+ let l = i[o][1].sort(_i);
1738
1738
  s.next.push({ type: i[o][0], next: e[l.join(",")] || t(l) });
1739
1739
  }
1740
1740
  return s;
@@ -1760,7 +1760,7 @@ function ji(n) {
1760
1760
  }
1761
1761
  return e;
1762
1762
  }
1763
- function _i(n, e) {
1763
+ function Ki(n, e) {
1764
1764
  let t = /* @__PURE__ */ Object.create(null);
1765
1765
  for (let r in n) {
1766
1766
  let i = e && e[r];
@@ -1775,7 +1775,7 @@ function _i(n, e) {
1775
1775
  }
1776
1776
  return t;
1777
1777
  }
1778
- function Ki(n, e, t, r) {
1778
+ function Ui(n, e, t, r) {
1779
1779
  for (let i in e)
1780
1780
  if (!(i in n))
1781
1781
  throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);
@@ -1784,19 +1784,19 @@ function Ki(n, e, t, r) {
1784
1784
  s.validate && s.validate(e[i]);
1785
1785
  }
1786
1786
  }
1787
- function Ui(n, e) {
1787
+ function Yi(n, e) {
1788
1788
  let t = /* @__PURE__ */ Object.create(null);
1789
1789
  if (e)
1790
1790
  for (let r in e)
1791
1791
  t[r] = new tl(n, r, e[r]);
1792
1792
  return t;
1793
1793
  }
1794
- let Ar = class Yi {
1794
+ let Rr = class Xi {
1795
1795
  /**
1796
1796
  @internal
1797
1797
  */
1798
1798
  constructor(e, t, r) {
1799
- this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = Ui(e, r.attrs), this.defaultAttrs = ji(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
1799
+ this.name = e, this.schema = t, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = Yi(e, r.attrs), this.defaultAttrs = ji(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
1800
1800
  }
1801
1801
  /**
1802
1802
  True if this is an inline type.
@@ -1857,7 +1857,7 @@ let Ar = class Yi {
1857
1857
  @internal
1858
1858
  */
1859
1859
  computeAttrs(e) {
1860
- return !e && this.defaultAttrs ? this.defaultAttrs : _i(this.attrs, e);
1860
+ return !e && this.defaultAttrs ? this.defaultAttrs : Ki(this.attrs, e);
1861
1861
  }
1862
1862
  /**
1863
1863
  Create a `Node` of this type. The given attributes are
@@ -1924,7 +1924,7 @@ let Ar = class Yi {
1924
1924
  @internal
1925
1925
  */
1926
1926
  checkAttrs(e) {
1927
- Ki(this.attrs, e, "node", this.name);
1927
+ Ui(this.attrs, e, "node", this.name);
1928
1928
  }
1929
1929
  /**
1930
1930
  Check whether the given mark type is allowed in this node.
@@ -1959,7 +1959,7 @@ let Ar = class Yi {
1959
1959
  */
1960
1960
  static compile(e, t) {
1961
1961
  let r = /* @__PURE__ */ Object.create(null);
1962
- e.forEach((s, o) => r[s] = new Yi(s, t, o));
1962
+ e.forEach((s, o) => r[s] = new Xi(s, t, o));
1963
1963
  let i = t.spec.topNode || "doc";
1964
1964
  if (!r[i])
1965
1965
  throw new RangeError("Schema is missing its top node type ('" + i + "')");
@@ -1991,7 +1991,7 @@ class nn {
1991
1991
  @internal
1992
1992
  */
1993
1993
  constructor(e, t, r, i) {
1994
- this.name = e, this.rank = t, this.schema = r, this.spec = i, this.attrs = Ui(e, i.attrs), this.excluded = null;
1994
+ this.name = e, this.rank = t, this.schema = r, this.spec = i, this.attrs = Yi(e, i.attrs), this.excluded = null;
1995
1995
  let s = ji(this.attrs);
1996
1996
  this.instance = s ? new I(this, s) : null;
1997
1997
  }
@@ -2001,7 +2001,7 @@ class nn {
2001
2001
  they have defaults, will be added.
2002
2002
  */
2003
2003
  create(e = null) {
2004
- return !e && this.instance ? this.instance : new I(this, _i(this.attrs, e));
2004
+ return !e && this.instance ? this.instance : new I(this, Ki(this.attrs, e));
2005
2005
  }
2006
2006
  /**
2007
2007
  @internal
@@ -2031,7 +2031,7 @@ class nn {
2031
2031
  @internal
2032
2032
  */
2033
2033
  checkAttrs(e) {
2034
- Ki(this.attrs, e, "mark", this.name);
2034
+ Ui(this.attrs, e, "mark", this.name);
2035
2035
  }
2036
2036
  /**
2037
2037
  Queries whether a given mark type is
@@ -2041,7 +2041,7 @@ class nn {
2041
2041
  return this.excluded.indexOf(e) > -1;
2042
2042
  }
2043
2043
  }
2044
- class Xi {
2044
+ class Gi {
2045
2045
  /**
2046
2046
  Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
2047
2047
  */
@@ -2050,7 +2050,7 @@ class Xi {
2050
2050
  let t = this.spec = {};
2051
2051
  for (let i in e)
2052
2052
  t[i] = e[i];
2053
- t.nodes = V.from(e.nodes), t.marks = V.from(e.marks || {}), this.nodes = Ar.compile(this.spec.nodes, this), this.marks = nn.compile(this.spec.marks, this);
2053
+ t.nodes = V.from(e.nodes), t.marks = V.from(e.marks || {}), this.nodes = Rr.compile(this.spec.nodes, this), this.marks = nn.compile(this.spec.marks, this);
2054
2054
  let r = /* @__PURE__ */ Object.create(null);
2055
2055
  for (let i in this.nodes) {
2056
2056
  if (i in this.marks)
@@ -2063,11 +2063,11 @@ class Xi {
2063
2063
  throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
2064
2064
  this.linebreakReplacement = s;
2065
2065
  }
2066
- s.markSet = l == "_" ? null : l ? Rr(this, l.split(" ")) : l == "" || !s.inlineContent ? [] : null;
2066
+ s.markSet = l == "_" ? null : l ? Ir(this, l.split(" ")) : l == "" || !s.inlineContent ? [] : null;
2067
2067
  }
2068
2068
  for (let i in this.marks) {
2069
2069
  let s = this.marks[i], o = s.spec.excludes;
2070
- s.excluded = o == null ? [s] : o == "" ? [] : Rr(this, o.split(" "));
2070
+ s.excluded = o == null ? [s] : o == "" ? [] : Ir(this, o.split(" "));
2071
2071
  }
2072
2072
  this.nodeFromJSON = (i) => Z.fromJSON(this, i), this.markFromJSON = (i) => I.fromJSON(this, i), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
2073
2073
  }
@@ -2080,7 +2080,7 @@ class Xi {
2080
2080
  node(e, t = null, r, i) {
2081
2081
  if (typeof e == "string")
2082
2082
  e = this.nodeType(e);
2083
- else if (e instanceof Ar) {
2083
+ else if (e instanceof Rr) {
2084
2084
  if (e.schema != this)
2085
2085
  throw new RangeError("Node type from different schema used (" + e.name + ")");
2086
2086
  } else throw new RangeError("Invalid node type: " + e);
@@ -2092,7 +2092,7 @@ class Xi {
2092
2092
  */
2093
2093
  text(e, t) {
2094
2094
  let r = this.nodes.text;
2095
- return new qt(r, r.defaultAttrs, e, I.setFrom(t));
2095
+ return new _t(r, r.defaultAttrs, e, I.setFrom(t));
2096
2096
  }
2097
2097
  /**
2098
2098
  Create a mark with the given type and attributes.
@@ -2110,7 +2110,7 @@ class Xi {
2110
2110
  return t;
2111
2111
  }
2112
2112
  }
2113
- function Rr(n, e) {
2113
+ function Ir(n, e) {
2114
2114
  let t = [];
2115
2115
  for (let r = 0; r < e.length; r++) {
2116
2116
  let i = e[r], s = n.marks[i], o = s;
@@ -2158,7 +2158,7 @@ class ge {
2158
2158
  Parse a document from the content of a DOM node.
2159
2159
  */
2160
2160
  parse(e, t = {}) {
2161
- let r = new Pr(this, t, !1);
2161
+ let r = new zr(this, t, !1);
2162
2162
  return r.addAll(e, I.none, t.from, t.to), r.finish();
2163
2163
  }
2164
2164
  /**
@@ -2170,7 +2170,7 @@ class ge {
2170
2170
  the left of the input and the end of nodes at the end.
2171
2171
  */
2172
2172
  parseSlice(e, t = {}) {
2173
- let r = new Pr(this, t, !0);
2173
+ let r = new zr(this, t, !0);
2174
2174
  return r.addAll(e, I.none, t.from, t.to), k.maxOpen(r.finish());
2175
2175
  }
2176
2176
  /**
@@ -2227,13 +2227,13 @@ class ge {
2227
2227
  for (let i in e.marks) {
2228
2228
  let s = e.marks[i].spec.parseDOM;
2229
2229
  s && s.forEach((o) => {
2230
- r(o = zr(o)), o.mark || o.ignore || o.clearMark || (o.mark = i);
2230
+ r(o = Br(o)), o.mark || o.ignore || o.clearMark || (o.mark = i);
2231
2231
  });
2232
2232
  }
2233
2233
  for (let i in e.nodes) {
2234
2234
  let s = e.nodes[i].spec.parseDOM;
2235
2235
  s && s.forEach((o) => {
2236
- r(o = zr(o)), o.node || o.ignore || o.mark || (o.node = i);
2236
+ r(o = Br(o)), o.node || o.ignore || o.mark || (o.node = i);
2237
2237
  });
2238
2238
  }
2239
2239
  return t;
@@ -2247,7 +2247,7 @@ class ge {
2247
2247
  return e.cached.domParser || (e.cached.domParser = new ge(e, ge.schemaRules(e)));
2248
2248
  }
2249
2249
  }
2250
- const Gi = {
2250
+ const Qi = {
2251
2251
  address: !0,
2252
2252
  article: !0,
2253
2253
  aside: !0,
@@ -2287,11 +2287,11 @@ const Gi = {
2287
2287
  script: !0,
2288
2288
  style: !0,
2289
2289
  title: !0
2290
- }, Qi = { ol: !0, ul: !0 }, xt = 1, Bn = 2, mt = 4;
2291
- function Ir(n, e, t) {
2290
+ }, Zi = { ol: !0, ul: !0 }, xt = 1, Bn = 2, mt = 4;
2291
+ function Pr(n, e, t) {
2292
2292
  return e != null ? (e ? xt : 0) | (e === "full" ? Bn : 0) : n && n.whitespace == "pre" ? xt | Bn : t & ~mt;
2293
2293
  }
2294
- class Rt {
2294
+ class It {
2295
2295
  constructor(e, t, r, i, s, o) {
2296
2296
  this.type = e, this.attrs = t, this.marks = r, this.solid = i, this.options = o, this.content = [], this.activeMarks = I.none, this.match = s || (o & mt ? null : e.contentMatch);
2297
2297
  }
@@ -2321,14 +2321,14 @@ class Rt {
2321
2321
  return !e && this.match && (t = t.append(this.match.fillBefore(b.empty, !0))), this.type ? this.type.create(this.attrs, t, this.marks) : t;
2322
2322
  }
2323
2323
  inlineContext(e) {
2324
- return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !Gi.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
2324
+ return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !Qi.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
2325
2325
  }
2326
2326
  }
2327
- class Pr {
2327
+ class zr {
2328
2328
  constructor(e, t, r) {
2329
2329
  this.parser = e, this.options = t, this.isOpen = r, this.open = 0, this.localPreserveWS = !1;
2330
- let i = t.topNode, s, o = Ir(null, t.preserveWhitespace, 0) | (r ? mt : 0);
2331
- i ? s = new Rt(i.type, i.attrs, I.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new Rt(null, null, I.none, !0, null, o) : s = new Rt(e.schema.topNodeType, null, I.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
2330
+ let i = t.topNode, s, o = Pr(null, t.preserveWhitespace, 0) | (r ? mt : 0);
2331
+ i ? s = new It(i.type, i.attrs, I.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new It(null, null, I.none, !0, null, o) : s = new It(e.schema.topNodeType, null, I.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
2332
2332
  }
2333
2333
  get top() {
2334
2334
  return this.nodes[this.open];
@@ -2367,14 +2367,14 @@ class Pr {
2367
2367
  let i = this.localPreserveWS, s = this.top;
2368
2368
  (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
2369
2369
  let o = e.nodeName.toLowerCase(), l;
2370
- Qi.hasOwnProperty(o) && this.parser.normalizeLists && sl(e);
2370
+ Zi.hasOwnProperty(o) && this.parser.normalizeLists && sl(e);
2371
2371
  let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, r));
2372
2372
  e: if (a ? a.ignore : il.hasOwnProperty(o))
2373
2373
  this.findInside(e), this.ignoreFallback(e, t);
2374
2374
  else if (!a || a.skip || a.closeParent) {
2375
2375
  a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
2376
2376
  let c, f = this.needsBlock;
2377
- if (Gi.hasOwnProperty(o))
2377
+ if (Qi.hasOwnProperty(o))
2378
2378
  s.content.length && s.content[0].isInline && this.open && (this.open--, s = this.top), c = !0, s.type || (this.needsBlock = !0);
2379
2379
  else if (!e.firstChild) {
2380
2380
  this.leafFallback(e, t);
@@ -2493,7 +2493,7 @@ class Pr {
2493
2493
  s.match && (s.match = s.match.matchType(e.type));
2494
2494
  let o = I.none;
2495
2495
  for (let l of i.concat(e.marks))
2496
- (s.type ? s.type.allowsMarkType(l.type) : Br(l.type, e.type)) && (o = l.addToSet(o));
2496
+ (s.type ? s.type.allowsMarkType(l.type) : Fr(l.type, e.type)) && (o = l.addToSet(o));
2497
2497
  return s.content.push(e.mark(o)), !0;
2498
2498
  }
2499
2499
  return !1;
@@ -2509,10 +2509,10 @@ class Pr {
2509
2509
  this.closeExtra();
2510
2510
  let o = this.top;
2511
2511
  o.match = o.match && o.match.matchType(e);
2512
- let l = Ir(e, s, o.options);
2512
+ let l = Pr(e, s, o.options);
2513
2513
  o.options & mt && o.content.length == 0 && (l |= mt);
2514
2514
  let a = I.none;
2515
- return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Br(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new Rt(e, t, a, i, null, l)), this.open++, r;
2515
+ return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Fr(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new It(e, t, a, i, null, l)), this.open++, r;
2516
2516
  }
2517
2517
  // Make sure all nodes above this.open are finished and added to
2518
2518
  // their parents
@@ -2609,19 +2609,19 @@ class Pr {
2609
2609
  function sl(n) {
2610
2610
  for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
2611
2611
  let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
2612
- r && Qi.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
2612
+ r && Zi.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
2613
2613
  }
2614
2614
  }
2615
2615
  function ol(n, e) {
2616
2616
  return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
2617
2617
  }
2618
- function zr(n) {
2618
+ function Br(n) {
2619
2619
  let e = {};
2620
2620
  for (let t in n)
2621
2621
  e[t] = n[t];
2622
2622
  return e;
2623
2623
  }
2624
- function Br(n, e) {
2624
+ function Fr(n, e) {
2625
2625
  let t = e.schema.nodes;
2626
2626
  for (let r in t) {
2627
2627
  let i = t[r];
@@ -2639,7 +2639,7 @@ function Br(n, e) {
2639
2639
  return !0;
2640
2640
  }
2641
2641
  }
2642
- class je {
2642
+ class _e {
2643
2643
  /**
2644
2644
  Create a serializer. `nodes` should map node names to functions
2645
2645
  that take a node and return a description of the corresponding
@@ -2688,7 +2688,7 @@ class je {
2688
2688
  @internal
2689
2689
  */
2690
2690
  serializeNodeInner(e, t) {
2691
- let { dom: r, contentDOM: i } = Ft(yn(t), this.nodes[e.type.name](e), null, e.attrs);
2691
+ let { dom: r, contentDOM: i } = $t(yn(t), this.nodes[e.type.name](e), null, e.attrs);
2692
2692
  if (i) {
2693
2693
  if (e.isLeaf)
2694
2694
  throw new RangeError("Content hole not allowed in a leaf node spec");
@@ -2716,34 +2716,34 @@ class je {
2716
2716
  */
2717
2717
  serializeMark(e, t, r = {}) {
2718
2718
  let i = this.marks[e.type.name];
2719
- return i && Ft(yn(r), i(e, t), null, e.attrs);
2719
+ return i && $t(yn(r), i(e, t), null, e.attrs);
2720
2720
  }
2721
2721
  static renderSpec(e, t, r = null, i) {
2722
- return Ft(e, t, r, i);
2722
+ return $t(e, t, r, i);
2723
2723
  }
2724
2724
  /**
2725
2725
  Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
2726
2726
  properties in a schema's node and mark specs.
2727
2727
  */
2728
2728
  static fromSchema(e) {
2729
- return e.cached.domSerializer || (e.cached.domSerializer = new je(this.nodesFromSchema(e), this.marksFromSchema(e)));
2729
+ return e.cached.domSerializer || (e.cached.domSerializer = new _e(this.nodesFromSchema(e), this.marksFromSchema(e)));
2730
2730
  }
2731
2731
  /**
2732
2732
  Gather the serializers in a schema's node specs into an object.
2733
2733
  This can be useful as a base to build a custom serializer from.
2734
2734
  */
2735
2735
  static nodesFromSchema(e) {
2736
- let t = Fr(e.nodes);
2736
+ let t = $r(e.nodes);
2737
2737
  return t.text || (t.text = (r) => r.text), t;
2738
2738
  }
2739
2739
  /**
2740
2740
  Gather the serializers in a schema's mark specs into an object.
2741
2741
  */
2742
2742
  static marksFromSchema(e) {
2743
- return Fr(e.marks);
2743
+ return $r(e.marks);
2744
2744
  }
2745
2745
  }
2746
- function Fr(n) {
2746
+ function $r(n) {
2747
2747
  let e = {};
2748
2748
  for (let t in n) {
2749
2749
  let r = n[t].spec.toDOM;
@@ -2754,10 +2754,10 @@ function Fr(n) {
2754
2754
  function yn(n) {
2755
2755
  return n.document || window.document;
2756
2756
  }
2757
- const $r = /* @__PURE__ */ new WeakMap();
2757
+ const Vr = /* @__PURE__ */ new WeakMap();
2758
2758
  function ll(n) {
2759
- let e = $r.get(n);
2760
- return e === void 0 && $r.set(n, e = al(n)), e;
2759
+ let e = Vr.get(n);
2760
+ return e === void 0 && Vr.set(n, e = al(n)), e;
2761
2761
  }
2762
2762
  function al(n) {
2763
2763
  let e = null;
@@ -2775,7 +2775,7 @@ function al(n) {
2775
2775
  }
2776
2776
  return t(n), e;
2777
2777
  }
2778
- function Ft(n, e, t, r) {
2778
+ function $t(n, e, t, r) {
2779
2779
  if (typeof e == "string")
2780
2780
  return { dom: n.createTextNode(e) };
2781
2781
  if (e.nodeType != null)
@@ -2805,7 +2805,7 @@ function Ft(n, e, t, r) {
2805
2805
  throw new RangeError("Content hole must be the only child of its parent node");
2806
2806
  return { dom: a, contentDOM: a };
2807
2807
  } else {
2808
- let { dom: u, contentDOM: p } = Ft(n, h, t, r);
2808
+ let { dom: u, contentDOM: p } = $t(n, h, t, r);
2809
2809
  if (a.appendChild(u), p) {
2810
2810
  if (l)
2811
2811
  throw new RangeError("Multiple content holes");
@@ -2815,17 +2815,17 @@ function Ft(n, e, t, r) {
2815
2815
  }
2816
2816
  return { dom: a, contentDOM: l };
2817
2817
  }
2818
- const Zi = 65535, es = Math.pow(2, 16);
2818
+ const es = 65535, ts = Math.pow(2, 16);
2819
2819
  function cl(n, e) {
2820
- return n + e * es;
2820
+ return n + e * ts;
2821
2821
  }
2822
- function Vr(n) {
2823
- return n & Zi;
2822
+ function Lr(n) {
2823
+ return n & es;
2824
2824
  }
2825
2825
  function fl(n) {
2826
- return (n - (n & Zi)) / es;
2826
+ return (n - (n & es)) / ts;
2827
2827
  }
2828
- const ts = 1, ns = 2, $t = 4, rs = 8;
2828
+ const ns = 1, rs = 2, Vt = 4, is = 8;
2829
2829
  class Fn {
2830
2830
  /**
2831
2831
  @internal
@@ -2839,19 +2839,19 @@ class Fn {
2839
2839
  argument from the document.
2840
2840
  */
2841
2841
  get deleted() {
2842
- return (this.delInfo & rs) > 0;
2842
+ return (this.delInfo & is) > 0;
2843
2843
  }
2844
2844
  /**
2845
2845
  Tells you whether the token before the mapped position was deleted.
2846
2846
  */
2847
2847
  get deletedBefore() {
2848
- return (this.delInfo & (ts | $t)) > 0;
2848
+ return (this.delInfo & (ns | Vt)) > 0;
2849
2849
  }
2850
2850
  /**
2851
2851
  True when the token after the mapped position was deleted.
2852
2852
  */
2853
2853
  get deletedAfter() {
2854
- return (this.delInfo & (ns | $t)) > 0;
2854
+ return (this.delInfo & (rs | Vt)) > 0;
2855
2855
  }
2856
2856
  /**
2857
2857
  Tells whether any of the steps mapped through deletes across the
@@ -2859,7 +2859,7 @@ class Fn {
2859
2859
  position).
2860
2860
  */
2861
2861
  get deletedAcross() {
2862
- return (this.delInfo & $t) > 0;
2862
+ return (this.delInfo & Vt) > 0;
2863
2863
  }
2864
2864
  }
2865
2865
  class Q {
@@ -2876,7 +2876,7 @@ class Q {
2876
2876
  @internal
2877
2877
  */
2878
2878
  recover(e) {
2879
- let t = 0, r = Vr(e);
2879
+ let t = 0, r = Lr(e);
2880
2880
  if (!this.inverted)
2881
2881
  for (let i = 0; i < r; i++)
2882
2882
  t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
@@ -2902,8 +2902,8 @@ class Q {
2902
2902
  let h = c ? e == a ? -1 : e == d ? 1 : t : t, u = a + i + (h < 0 ? 0 : f);
2903
2903
  if (r)
2904
2904
  return u;
2905
- let p = e == (t < 0 ? a : d) ? null : cl(l / 3, e - a), m = e == a ? ns : e == d ? ts : $t;
2906
- return (t < 0 ? e != a : e != d) && (m |= rs), new Fn(u, m, p);
2905
+ let p = e == (t < 0 ? a : d) ? null : cl(l / 3, e - a), m = e == a ? rs : e == d ? ns : Vt;
2906
+ return (t < 0 ? e != a : e != d) && (m |= is), new Fn(u, m, p);
2907
2907
  }
2908
2908
  i += f - c;
2909
2909
  }
@@ -2913,7 +2913,7 @@ class Q {
2913
2913
  @internal
2914
2914
  */
2915
2915
  touches(e, t) {
2916
- let r = 0, i = Vr(t), s = this.inverted ? 2 : 1, o = this.inverted ? 1 : 2;
2916
+ let r = 0, i = Lr(t), s = this.inverted ? 2 : 1, o = this.inverted ? 1 : 2;
2917
2917
  for (let l = 0; l < this.ranges.length; l += 3) {
2918
2918
  let a = this.ranges[l] - (this.inverted ? r : 0);
2919
2919
  if (a > e)
@@ -3067,7 +3067,7 @@ class jt {
3067
3067
  }
3068
3068
  }
3069
3069
  const bn = /* @__PURE__ */ Object.create(null);
3070
- class j {
3070
+ class _ {
3071
3071
  /**
3072
3072
  Get the step map that represents the changes made by this step,
3073
3073
  and which can be used to transform between positions in the old
@@ -3136,7 +3136,7 @@ class z {
3136
3136
  try {
3137
3137
  return z.ok(e.replace(t, r, i));
3138
3138
  } catch (s) {
3139
- if (s instanceof Wt)
3139
+ if (s instanceof Ht)
3140
3140
  return z.fail(s.message);
3141
3141
  throw s;
3142
3142
  }
@@ -3150,7 +3150,7 @@ function Gn(n, e, t) {
3150
3150
  }
3151
3151
  return b.fromArray(r);
3152
3152
  }
3153
- class we extends j {
3153
+ class we extends _ {
3154
3154
  /**
3155
3155
  Create a mark step.
3156
3156
  */
@@ -3188,8 +3188,8 @@ class we extends j {
3188
3188
  return new we(t.from, t.to, e.markFromJSON(t.mark));
3189
3189
  }
3190
3190
  }
3191
- j.jsonID("addMark", we);
3192
- class oe extends j {
3191
+ _.jsonID("addMark", we);
3192
+ class oe extends _ {
3193
3193
  /**
3194
3194
  Create a mark-removing step.
3195
3195
  */
@@ -3227,8 +3227,8 @@ class oe extends j {
3227
3227
  return new oe(t.from, t.to, e.markFromJSON(t.mark));
3228
3228
  }
3229
3229
  }
3230
- j.jsonID("removeMark", oe);
3231
- class Ce extends j {
3230
+ _.jsonID("removeMark", oe);
3231
+ class Ce extends _ {
3232
3232
  /**
3233
3233
  Create a node mark step.
3234
3234
  */
@@ -3271,8 +3271,8 @@ class Ce extends j {
3271
3271
  return new Ce(t.pos, e.markFromJSON(t.mark));
3272
3272
  }
3273
3273
  }
3274
- j.jsonID("addNodeMark", Ce);
3275
- class He extends j {
3274
+ _.jsonID("addNodeMark", Ce);
3275
+ class He extends _ {
3276
3276
  /**
3277
3277
  Create a mark-removing step.
3278
3278
  */
@@ -3306,8 +3306,8 @@ class He extends j {
3306
3306
  return new He(t.pos, e.markFromJSON(t.mark));
3307
3307
  }
3308
3308
  }
3309
- j.jsonID("removeNodeMark", He);
3310
- class P extends j {
3309
+ _.jsonID("removeNodeMark", He);
3310
+ class P extends _ {
3311
3311
  /**
3312
3312
  The given `slice` should fit the 'gap' between `from` and
3313
3313
  `to`—the depths must line up, and the surrounding nodes must be
@@ -3359,8 +3359,8 @@ class P extends j {
3359
3359
  }
3360
3360
  }
3361
3361
  P.MAP_BIAS = 1;
3362
- j.jsonID("replace", P);
3363
- class F extends j {
3362
+ _.jsonID("replace", P);
3363
+ class F extends _ {
3364
3364
  /**
3365
3365
  Create a replace-around step with the given range and gap.
3366
3366
  `insert` should be the point in the slice into which the content
@@ -3417,7 +3417,7 @@ class F extends j {
3417
3417
  return new F(t.from, t.to, t.gapFrom, t.gapTo, k.fromJSON(e, t.slice), t.insert, !!t.structure);
3418
3418
  }
3419
3419
  }
3420
- j.jsonID("replaceAround", F);
3420
+ _.jsonID("replaceAround", F);
3421
3421
  function $n(n, e, t) {
3422
3422
  let r = n.resolve(e), i = t - e, s = r.depth;
3423
3423
  for (; i > 0 && s > 0 && r.indexAfter(s) == r.node(s).childCount; )
@@ -3522,9 +3522,9 @@ function pl(n, e, t) {
3522
3522
  }
3523
3523
  function Zn(n, e, t = null, r = n) {
3524
3524
  let i = ml(n, e), s = i && gl(r, e);
3525
- return s ? i.map(Lr).concat({ type: e, attrs: t }).concat(s.map(Lr)) : null;
3525
+ return s ? i.map(Wr).concat({ type: e, attrs: t }).concat(s.map(Wr)) : null;
3526
3526
  }
3527
- function Lr(n) {
3527
+ function Wr(n) {
3528
3528
  return { type: n, attrs: null };
3529
3529
  }
3530
3530
  function ml(n, e) {
@@ -3568,13 +3568,13 @@ function bl(n, e, t, r, i) {
3568
3568
  let u = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
3569
3569
  u && !p ? c = !1 : !u && p && (c = !0);
3570
3570
  }
3571
- c === !1 && ss(n, o, l, s), Qn(n, n.mapping.slice(s).map(l, 1), r, void 0, c === null);
3571
+ c === !1 && ls(n, o, l, s), Qn(n, n.mapping.slice(s).map(l, 1), r, void 0, c === null);
3572
3572
  let f = n.mapping.slice(s), d = f.map(l, 1), h = f.map(l + o.nodeSize, 1);
3573
- return n.step(new F(d, h, d + 1, h - 1, new k(b.from(r.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && is(n, o, l, s), !1;
3573
+ return n.step(new F(d, h, d + 1, h - 1, new k(b.from(r.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && ss(n, o, l, s), !1;
3574
3574
  }
3575
3575
  });
3576
3576
  }
3577
- function is(n, e, t, r) {
3577
+ function ss(n, e, t, r) {
3578
3578
  e.forEach((i, s) => {
3579
3579
  if (i.isText) {
3580
3580
  let o, l = /\r?\n|\r/g;
@@ -3585,7 +3585,7 @@ function is(n, e, t, r) {
3585
3585
  }
3586
3586
  });
3587
3587
  }
3588
- function ss(n, e, t, r) {
3588
+ function ls(n, e, t, r) {
3589
3589
  e.forEach((i, s) => {
3590
3590
  if (i.type == i.type.schema.linebreakReplacement) {
3591
3591
  let o = n.mapping.slice(r).map(t + 1 + s);
@@ -3638,7 +3638,7 @@ function Sl(n, e, t = 1, r) {
3638
3638
  }
3639
3639
  function De(n, e) {
3640
3640
  let t = n.resolve(e), r = t.index();
3641
- return ls(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(r, r + 1);
3641
+ return as(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(r, r + 1);
3642
3642
  }
3643
3643
  function Ml(n, e) {
3644
3644
  e.content.size || n.type.compatibleContent(e.type);
@@ -3650,14 +3650,14 @@ function Ml(n, e) {
3650
3650
  }
3651
3651
  return t.validEnd;
3652
3652
  }
3653
- function ls(n, e) {
3653
+ function as(n, e) {
3654
3654
  return !!(n && e && !n.isLeaf && Ml(n, e));
3655
3655
  }
3656
3656
  function rn(n, e, t = -1) {
3657
3657
  let r = n.resolve(e);
3658
3658
  for (let i = r.depth; ; i--) {
3659
3659
  let s, o, l = r.index(i);
3660
- if (i == r.depth ? (s = r.nodeBefore, o = r.nodeAfter) : t > 0 ? (s = r.node(i + 1), l++, o = r.node(i).maybeChild(l)) : (s = r.node(i).maybeChild(l - 1), o = r.node(i + 1)), s && !s.isTextblock && ls(s, o) && r.node(i).canReplace(l, l + 1))
3660
+ if (i == r.depth ? (s = r.nodeBefore, o = r.nodeAfter) : t > 0 ? (s = r.node(i + 1), l++, o = r.node(i).maybeChild(l)) : (s = r.node(i).maybeChild(l - 1), o = r.node(i + 1)), s && !s.isTextblock && as(s, o) && r.node(i).canReplace(l, l + 1))
3661
3661
  return e;
3662
3662
  if (i == 0)
3663
3663
  break;
@@ -3673,13 +3673,13 @@ function wl(n, e, t) {
3673
3673
  let l = n.steps.length;
3674
3674
  if (r === !1) {
3675
3675
  let f = n.doc.resolve(e + t);
3676
- ss(n, f.node(), f.before(), l);
3676
+ ls(n, f.node(), f.before(), l);
3677
3677
  }
3678
3678
  o.inlineContent && Qn(n, e + t - 1, o, s.node().contentMatchAt(s.index()), r == null);
3679
3679
  let a = n.mapping.slice(l), c = a.map(e - t);
3680
3680
  if (n.step(new P(c, a.map(e + t, -1), k.empty, !0)), r === !0) {
3681
3681
  let f = n.doc.resolve(c);
3682
- is(n, f.node(), f.before(), n.steps.length);
3682
+ ss(n, f.node(), f.before(), n.steps.length);
3683
3683
  }
3684
3684
  return n;
3685
3685
  }
@@ -3730,9 +3730,9 @@ function sn(n, e, t = e, r = k.empty) {
3730
3730
  if (e == t && !r.size)
3731
3731
  return null;
3732
3732
  let i = n.resolve(e), s = n.resolve(t);
3733
- return as(i, s, r) ? new P(e, t, r) : new Nl(i, s, r).fit();
3733
+ return cs(i, s, r) ? new P(e, t, r) : new Nl(i, s, r).fit();
3734
3734
  }
3735
- function as(n, e, t) {
3735
+ function cs(n, e, t) {
3736
3736
  return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
3737
3737
  }
3738
3738
  class Nl {
@@ -3826,7 +3826,7 @@ class Nl {
3826
3826
  let m = l.child(c), g = d.matchType(m.type);
3827
3827
  if (!g)
3828
3828
  break;
3829
- c++, (c > 1 || a == 0 || m.content.size) && (d = g, f.push(cs(m.mark(h.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? u : -1)));
3829
+ c++, (c > 1 || a == 0 || m.content.size) && (d = g, f.push(fs(m.mark(h.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? u : -1)));
3830
3830
  }
3831
3831
  let p = c == l.childCount;
3832
3832
  p || (u = -1), this.placed = ft(this.placed, t, b.from(f)), this.frontier[t].match = d, p && u < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
@@ -3893,11 +3893,11 @@ function kn(n, e) {
3893
3893
  n = n.firstChild.content;
3894
3894
  return n;
3895
3895
  }
3896
- function cs(n, e, t) {
3896
+ function fs(n, e, t) {
3897
3897
  if (e <= 0)
3898
3898
  return n;
3899
3899
  let r = n.content;
3900
- return e > 1 && (r = r.replaceChild(0, cs(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(b.empty, !0)))), n.copy(r);
3900
+ return e > 1 && (r = r.replaceChild(0, fs(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(b.empty, !0)))), n.copy(r);
3901
3901
  }
3902
3902
  function xn(n, e, t, r, i) {
3903
3903
  let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
@@ -3919,9 +3919,9 @@ function vl(n, e, t, r) {
3919
3919
  if (!r.size)
3920
3920
  return n.deleteRange(e, t);
3921
3921
  let i = n.doc.resolve(e), s = n.doc.resolve(t);
3922
- if (as(i, s, r))
3922
+ if (cs(i, s, r))
3923
3923
  return n.step(new P(e, t, r));
3924
- let o = ds(i, s);
3924
+ let o = us(i, s);
3925
3925
  o[o.length - 1] == 0 && o.pop();
3926
3926
  let l = -(i.depth + 1);
3927
3927
  o.unshift(l);
@@ -3953,7 +3953,7 @@ function vl(n, e, t, r) {
3953
3953
  g < 0 && (y = !1, g = -g);
3954
3954
  let x = i.node(g - 1), S = i.index(g - 1);
3955
3955
  if (x.canReplaceWith(S, S, p.type, p.marks))
3956
- return n.replace(i.before(g), y ? s.after(g) : t, new k(fs(r.content, 0, r.openStart, u), u, r.openEnd));
3956
+ return n.replace(i.before(g), y ? s.after(g) : t, new k(ds(r.content, 0, r.openStart, u), u, r.openEnd));
3957
3957
  }
3958
3958
  }
3959
3959
  let d = n.steps.length;
@@ -3962,10 +3962,10 @@ function vl(n, e, t, r) {
3962
3962
  u < 0 || (e = i.before(u), t = s.after(u));
3963
3963
  }
3964
3964
  }
3965
- function fs(n, e, t, r, i) {
3965
+ function ds(n, e, t, r, i) {
3966
3966
  if (e < t) {
3967
3967
  let s = n.firstChild;
3968
- n = n.replaceChild(0, s.copy(fs(s.content, e + 1, t, r, s)));
3968
+ n = n.replaceChild(0, s.copy(ds(s.content, e + 1, t, r, s)));
3969
3969
  }
3970
3970
  if (e > r) {
3971
3971
  let s = i.contentMatchAt(0), o = s.fillBefore(n).append(n);
@@ -3996,7 +3996,7 @@ function Al(n, e, t) {
3996
3996
  r = n.doc.resolve(e), i = n.doc.resolve(t);
3997
3997
  }
3998
3998
  }
3999
- let s = ds(r, i);
3999
+ let s = us(r, i);
4000
4000
  for (let o = 0; o < s.length; o++) {
4001
4001
  let l = s[o], a = o == s.length - 1;
4002
4002
  if (a && l == 0 || r.node(l).type.contentMatch.validEnd)
@@ -4009,7 +4009,7 @@ function Al(n, e, t) {
4009
4009
  return n.delete(r.before(o), t);
4010
4010
  n.delete(e, t);
4011
4011
  }
4012
- function ds(n, e) {
4012
+ function us(n, e) {
4013
4013
  let t = [], r = Math.min(n.depth, e.depth);
4014
4014
  for (let i = r; i >= 0; i--) {
4015
4015
  let s = n.start(i);
@@ -4019,7 +4019,7 @@ function ds(n, e) {
4019
4019
  }
4020
4020
  return t;
4021
4021
  }
4022
- class Ge extends j {
4022
+ class Ge extends _ {
4023
4023
  /**
4024
4024
  Construct an attribute step.
4025
4025
  */
@@ -4056,8 +4056,8 @@ class Ge extends j {
4056
4056
  return new Ge(t.pos, t.attr, t.value);
4057
4057
  }
4058
4058
  }
4059
- j.jsonID("attr", Ge);
4060
- class St extends j {
4059
+ _.jsonID("attr", Ge);
4060
+ class St extends _ {
4061
4061
  /**
4062
4062
  Construct an attribute step.
4063
4063
  */
@@ -4090,7 +4090,7 @@ class St extends j {
4090
4090
  return new St(t.attr, t.value);
4091
4091
  }
4092
4092
  }
4093
- j.jsonID("docAttr", St);
4093
+ _.jsonID("docAttr", St);
4094
4094
  let Ze = class extends Error {
4095
4095
  };
4096
4096
  Ze = function n(e) {
@@ -4100,7 +4100,7 @@ Ze = function n(e) {
4100
4100
  Ze.prototype = Object.create(Error.prototype);
4101
4101
  Ze.prototype.constructor = Ze;
4102
4102
  Ze.prototype.name = "TransformError";
4103
- class us {
4103
+ class hs {
4104
4104
  /**
4105
4105
  Create a transform that starts with the given document.
4106
4106
  */
@@ -4414,7 +4414,7 @@ class v {
4414
4414
  let s = e.steps.length, o = this.ranges;
4415
4415
  for (let l = 0; l < o.length; l++) {
4416
4416
  let { $from: a, $to: c } = o[l], f = e.mapping.slice(s);
4417
- e.replaceRange(f.map(a.pos), f.map(c.pos), l ? k.empty : t), l == 0 && Jr(e, s, (r ? r.isInline : i && i.isTextblock) ? -1 : 1);
4417
+ e.replaceRange(f.map(a.pos), f.map(c.pos), l ? k.empty : t), l == 0 && qr(e, s, (r ? r.isInline : i && i.isTextblock) ? -1 : 1);
4418
4418
  }
4419
4419
  }
4420
4420
  /**
@@ -4425,7 +4425,7 @@ class v {
4425
4425
  let r = e.steps.length, i = this.ranges;
4426
4426
  for (let s = 0; s < i.length; s++) {
4427
4427
  let { $from: o, $to: l } = i[s], a = e.mapping.slice(r), c = a.map(o.pos), f = a.map(l.pos);
4428
- s ? e.deleteRange(c, f) : (e.replaceRangeWith(c, f, t), Jr(e, r, t.isInline ? -1 : 1));
4428
+ s ? e.deleteRange(c, f) : (e.replaceRangeWith(c, f, t), qr(e, r, t.isInline ? -1 : 1));
4429
4429
  }
4430
4430
  }
4431
4431
  /**
@@ -4515,16 +4515,16 @@ class Rl {
4515
4515
  this.$from = e, this.$to = t;
4516
4516
  }
4517
4517
  }
4518
- let Wr = !1;
4519
- function Hr(n) {
4520
- !Wr && !n.parent.inlineContent && (Wr = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
4518
+ let Hr = !1;
4519
+ function Jr(n) {
4520
+ !Hr && !n.parent.inlineContent && (Hr = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
4521
4521
  }
4522
4522
  class E extends v {
4523
4523
  /**
4524
4524
  Construct a text selection between the given points.
4525
4525
  */
4526
4526
  constructor(e, t = e) {
4527
- Hr(e), Hr(t), super(e, t);
4527
+ Jr(e), Jr(t), super(e, t);
4528
4528
  }
4529
4529
  /**
4530
4530
  Returns a resolved position if this is a cursor selection (an
@@ -4724,7 +4724,7 @@ function Ue(n, e, t, r, i, s = !1) {
4724
4724
  }
4725
4725
  return null;
4726
4726
  }
4727
- function Jr(n, e, t) {
4727
+ function qr(n, e, t) {
4728
4728
  let r = n.steps.length - 1;
4729
4729
  if (r < e)
4730
4730
  return;
@@ -4736,8 +4736,8 @@ function Jr(n, e, t) {
4736
4736
  o == null && (o = f);
4737
4737
  }), n.setSelection(v.near(n.doc.resolve(o), t));
4738
4738
  }
4739
- const qr = 1, It = 2, jr = 4;
4740
- class Pl extends us {
4739
+ const _r = 1, Pt = 2, jr = 4;
4740
+ class Pl extends hs {
4741
4741
  /**
4742
4742
  @internal
4743
4743
  */
@@ -4760,19 +4760,19 @@ class Pl extends us {
4760
4760
  setSelection(e) {
4761
4761
  if (e.$from.doc != this.doc)
4762
4762
  throw new RangeError("Selection passed to setSelection must point at the current document");
4763
- return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | qr) & ~It, this.storedMarks = null, this;
4763
+ return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | _r) & ~Pt, this.storedMarks = null, this;
4764
4764
  }
4765
4765
  /**
4766
4766
  Whether the selection was explicitly updated by this transaction.
4767
4767
  */
4768
4768
  get selectionSet() {
4769
- return (this.updated & qr) > 0;
4769
+ return (this.updated & _r) > 0;
4770
4770
  }
4771
4771
  /**
4772
4772
  Set the current stored marks.
4773
4773
  */
4774
4774
  setStoredMarks(e) {
4775
- return this.storedMarks = e, this.updated |= It, this;
4775
+ return this.storedMarks = e, this.updated |= Pt, this;
4776
4776
  }
4777
4777
  /**
4778
4778
  Make sure the current stored marks or, if that is null, the marks
@@ -4798,13 +4798,13 @@ class Pl extends us {
4798
4798
  Whether the stored marks were explicitly set for this transaction.
4799
4799
  */
4800
4800
  get storedMarksSet() {
4801
- return (this.updated & It) > 0;
4801
+ return (this.updated & Pt) > 0;
4802
4802
  }
4803
4803
  /**
4804
4804
  @internal
4805
4805
  */
4806
4806
  addStep(e, t) {
4807
- super.addStep(e, t), this.updated = this.updated & ~It, this.storedMarks = null;
4807
+ super.addStep(e, t), this.updated = this.updated & ~Pt, this.storedMarks = null;
4808
4808
  }
4809
4809
  /**
4810
4810
  Update the timestamp for the transaction.
@@ -4888,12 +4888,12 @@ class Pl extends us {
4888
4888
  return (this.updated & jr) > 0;
4889
4889
  }
4890
4890
  }
4891
- function _r(n, e) {
4891
+ function Kr(n, e) {
4892
4892
  return !e || !n ? n : n.bind(e);
4893
4893
  }
4894
4894
  class dt {
4895
4895
  constructor(e, t, r) {
4896
- this.name = e, this.init = _r(t.init, r), this.apply = _r(t.apply, r);
4896
+ this.name = e, this.init = Kr(t.init, r), this.apply = Kr(t.apply, r);
4897
4897
  }
4898
4898
  }
4899
4899
  const zl = [
@@ -5104,10 +5104,10 @@ class Xe {
5104
5104
  }), s;
5105
5105
  }
5106
5106
  }
5107
- function hs(n, e, t) {
5107
+ function ps(n, e, t) {
5108
5108
  for (let r in n) {
5109
5109
  let i = n[r];
5110
- i instanceof Function ? i = i.bind(e) : r == "handleDOMEvents" && (i = hs(i, e, {})), t[r] = i;
5110
+ i instanceof Function ? i = i.bind(e) : r == "handleDOMEvents" && (i = ps(i, e, {})), t[r] = i;
5111
5111
  }
5112
5112
  return t;
5113
5113
  }
@@ -5116,7 +5116,7 @@ class ae {
5116
5116
  Create a plugin.
5117
5117
  */
5118
5118
  constructor(e) {
5119
- this.spec = e, this.props = {}, e.props && hs(e.props, this, this.props), this.key = e.key ? e.key.key : ps("plugin");
5119
+ this.spec = e, this.props = {}, e.props && ps(e.props, this, this.props), this.key = e.key ? e.key.key : ms("plugin");
5120
5120
  }
5121
5121
  /**
5122
5122
  Extract the plugin's state field from an editor state.
@@ -5126,7 +5126,7 @@ class ae {
5126
5126
  }
5127
5127
  }
5128
5128
  const wn = /* @__PURE__ */ Object.create(null);
5129
- function ps(n) {
5129
+ function ms(n) {
5130
5130
  return n in wn ? n + "$" + ++wn[n] : (wn[n] = 0, n + "$");
5131
5131
  }
5132
5132
  class Ae {
@@ -5134,7 +5134,7 @@ class Ae {
5134
5134
  Create a plugin key.
5135
5135
  */
5136
5136
  constructor(e = "key") {
5137
- this.key = ps(e);
5137
+ this.key = ms(e);
5138
5138
  }
5139
5139
  /**
5140
5140
  Get the active plugin with this key, if any, from an editor
@@ -5151,12 +5151,12 @@ class Ae {
5151
5151
  }
5152
5152
  }
5153
5153
  const tr = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
5154
- function ms(n, e) {
5154
+ function gs(n, e) {
5155
5155
  let { $cursor: t } = n.selection;
5156
5156
  return !t || (e ? !e.endOfTextblock("backward", n) : t.parentOffset > 0) ? null : t;
5157
5157
  }
5158
- const gs = (n, e, t) => {
5159
- let r = ms(n, t);
5158
+ const ys = (n, e, t) => {
5159
+ let r = gs(n, t);
5160
5160
  if (!r)
5161
5161
  return !1;
5162
5162
  let i = nr(r);
@@ -5165,7 +5165,7 @@ const gs = (n, e, t) => {
5165
5165
  return l == null ? !1 : (e && e(n.tr.lift(o, l).scrollIntoView()), !0);
5166
5166
  }
5167
5167
  let s = i.nodeBefore;
5168
- if (Ts(n, i, e, -1))
5168
+ if (Ns(n, i, e, -1))
5169
5169
  return !0;
5170
5170
  if (r.parent.content.size == 0 && (et(s, "end") || C.isSelectable(s)))
5171
5171
  for (let o = r.depth; ; o--) {
@@ -5182,19 +5182,19 @@ const gs = (n, e, t) => {
5182
5182
  }
5183
5183
  return s.isAtom && i.depth == r.depth - 1 ? (e && e(n.tr.delete(i.pos - s.nodeSize, i.pos).scrollIntoView()), !0) : !1;
5184
5184
  }, Bl = (n, e, t) => {
5185
- let r = ms(n, t);
5185
+ let r = gs(n, t);
5186
5186
  if (!r)
5187
5187
  return !1;
5188
5188
  let i = nr(r);
5189
- return i ? ys(n, i, e) : !1;
5189
+ return i ? bs(n, i, e) : !1;
5190
5190
  }, Fl = (n, e, t) => {
5191
- let r = ks(n, t);
5191
+ let r = xs(n, t);
5192
5192
  if (!r)
5193
5193
  return !1;
5194
5194
  let i = rr(r);
5195
- return i ? ys(n, i, e) : !1;
5195
+ return i ? bs(n, i, e) : !1;
5196
5196
  };
5197
- function ys(n, e, t) {
5197
+ function bs(n, e, t) {
5198
5198
  let r = e.nodeBefore, i = r, s = e.pos - 1;
5199
5199
  for (; !i.isTextblock; s--) {
5200
5200
  if (i.type.spec.isolating)
@@ -5231,7 +5231,7 @@ function et(n, e, t = !1) {
5231
5231
  }
5232
5232
  return !1;
5233
5233
  }
5234
- const bs = (n, e, t) => {
5234
+ const ks = (n, e, t) => {
5235
5235
  let { $head: r, empty: i } = n.selection, s = r;
5236
5236
  if (!i)
5237
5237
  return !1;
@@ -5253,19 +5253,19 @@ function nr(n) {
5253
5253
  }
5254
5254
  return null;
5255
5255
  }
5256
- function ks(n, e) {
5256
+ function xs(n, e) {
5257
5257
  let { $cursor: t } = n.selection;
5258
5258
  return !t || (e ? !e.endOfTextblock("forward", n) : t.parentOffset < t.parent.content.size) ? null : t;
5259
5259
  }
5260
- const xs = (n, e, t) => {
5261
- let r = ks(n, t);
5260
+ const Ss = (n, e, t) => {
5261
+ let r = xs(n, t);
5262
5262
  if (!r)
5263
5263
  return !1;
5264
5264
  let i = rr(r);
5265
5265
  if (!i)
5266
5266
  return !1;
5267
5267
  let s = i.nodeAfter;
5268
- if (Ts(n, i, e, 1))
5268
+ if (Ns(n, i, e, 1))
5269
5269
  return !0;
5270
5270
  if (r.parent.content.size == 0 && (et(s, "start") || C.isSelectable(s))) {
5271
5271
  let o = sn(n.doc, r.before(), r.after(), k.empty);
@@ -5278,7 +5278,7 @@ const xs = (n, e, t) => {
5278
5278
  }
5279
5279
  }
5280
5280
  return s.isAtom && i.depth == r.depth - 1 ? (e && e(n.tr.delete(i.pos, i.pos + s.nodeSize).scrollIntoView()), !0) : !1;
5281
- }, Ss = (n, e, t) => {
5281
+ }, Ms = (n, e, t) => {
5282
5282
  let { $head: r, empty: i } = n.selection, s = r;
5283
5283
  if (!i)
5284
5284
  return !1;
@@ -5326,7 +5326,7 @@ const $l = (n, e) => {
5326
5326
  }, Ll = (n, e) => {
5327
5327
  let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i && st(i);
5328
5328
  return s == null ? !1 : (e && e(n.tr.lift(i, s).scrollIntoView()), !0);
5329
- }, Ms = (n, e) => {
5329
+ }, ws = (n, e) => {
5330
5330
  let { $head: t, $anchor: r } = n.selection;
5331
5331
  return !t.parent.type.spec.code || !t.sameParent(r) ? !1 : (e && e(n.tr.insertText(`
5332
5332
  `).scrollIntoView()), !0);
@@ -5351,7 +5351,7 @@ const Wl = (n, e) => {
5351
5351
  a.setSelection(v.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
5352
5352
  }
5353
5353
  return !0;
5354
- }, ws = (n, e) => {
5354
+ }, Cs = (n, e) => {
5355
5355
  let t = n.selection, { $from: r, $to: i } = t;
5356
5356
  if (t instanceof ee || r.parent.inlineContent || i.parent.inlineContent)
5357
5357
  return !1;
@@ -5363,7 +5363,7 @@ const Wl = (n, e) => {
5363
5363
  l.setSelection(E.create(l.doc, o + 1)), e(l.scrollIntoView());
5364
5364
  }
5365
5365
  return !0;
5366
- }, Cs = (n, e) => {
5366
+ }, Ts = (n, e) => {
5367
5367
  let { $cursor: t } = n.selection;
5368
5368
  if (!t || t.parent.content.size)
5369
5369
  return !1;
@@ -5408,13 +5408,13 @@ const Jl = Hl(), ql = (n, e) => {
5408
5408
  let { $from: t, to: r } = n.selection, i, s = t.sharedDepth(r);
5409
5409
  return s == 0 ? !1 : (i = t.before(s), e && e(n.tr.setSelection(C.create(n.doc, i))), !0);
5410
5410
  };
5411
- function jl(n, e, t) {
5411
+ function _l(n, e, t) {
5412
5412
  let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
5413
5413
  return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(s - 1, s) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || De(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
5414
5414
  }
5415
- function Ts(n, e, t, r) {
5415
+ function Ns(n, e, t, r) {
5416
5416
  let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
5417
- if (!a && jl(n, e, t))
5417
+ if (!a && _l(n, e, t))
5418
5418
  return !0;
5419
5419
  let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
5420
5420
  if (c && (o = (l = i.contentMatchAt(i.childCount)).findWrapping(s.type)) && l.matchType(o[0] || s.type).validEnd) {
@@ -5451,7 +5451,7 @@ function Ts(n, e, t, r) {
5451
5451
  }
5452
5452
  return !1;
5453
5453
  }
5454
- function Ns(n) {
5454
+ function Es(n) {
5455
5455
  return function(e, t) {
5456
5456
  let r = e.selection, i = n < 0 ? r.$from : r.$to, s = i.depth;
5457
5457
  for (; i.node(s).isInline; ) {
@@ -5462,14 +5462,14 @@ function Ns(n) {
5462
5462
  return i.node(s).isTextblock ? (t && t(e.tr.setSelection(E.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
5463
5463
  };
5464
5464
  }
5465
- const _l = Ns(-1), Kl = Ns(1);
5465
+ const jl = Es(-1), Kl = Es(1);
5466
5466
  function Ul(n, e = null) {
5467
5467
  return function(t, r) {
5468
5468
  let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && Zn(o, n, e);
5469
5469
  return l ? (r && r(t.tr.wrap(o, l).scrollIntoView()), !0) : !1;
5470
5470
  };
5471
5471
  }
5472
- function Kr(n, e = null) {
5472
+ function Ur(n, e = null) {
5473
5473
  return function(t, r) {
5474
5474
  let i = !1;
5475
5475
  for (let s = 0; s < t.selection.ranges.length && !i; s++) {
@@ -5507,9 +5507,9 @@ function sr(...n) {
5507
5507
  return !1;
5508
5508
  };
5509
5509
  }
5510
- sr(tr, gs, bs);
5511
- sr(tr, xs, Ss);
5512
- sr(Ms, ws, Cs, Jl);
5510
+ sr(tr, ys, ks);
5511
+ sr(tr, Ss, Ms);
5512
+ sr(ws, Cs, Ts, Jl);
5513
5513
  typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
5514
5514
  function Yl(n, e = null) {
5515
5515
  return function(t, r) {
@@ -5526,7 +5526,7 @@ function Xl(n, e, t, r = null) {
5526
5526
  if (e.$from.index(e.depth - 1) == 0)
5527
5527
  return !1;
5528
5528
  let a = o.resolve(e.start - 2);
5529
- s = new Jt(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new Jt(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
5529
+ s = new qt(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new qt(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
5530
5530
  }
5531
5531
  let l = Zn(s, t, r, e);
5532
5532
  return l ? (n && Gl(n, e, l, i, t), !0) : !1;
@@ -5552,7 +5552,7 @@ function Ql(n) {
5552
5552
  }
5553
5553
  function Zl(n, e, t, r) {
5554
5554
  let i = n.tr, s = r.end, o = r.$to.end(r.depth);
5555
- s < o && (i.step(new F(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new Jt(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
5555
+ s < o && (i.step(new F(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new qt(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
5556
5556
  const l = st(r);
5557
5557
  if (l == null)
5558
5558
  return !1;
@@ -5606,15 +5606,15 @@ const he = function(n, e, t) {
5606
5606
  }, na = function() {
5607
5607
  Vn = null;
5608
5608
  }, Je = function(n, e, t, r) {
5609
- return t && (Ur(n, e, t, r, -1) || Ur(n, e, t, r, 1));
5609
+ return t && (Yr(n, e, t, r, -1) || Yr(n, e, t, r, 1));
5610
5610
  }, ra = /^(img|br|input|textarea|hr)$/i;
5611
- function Ur(n, e, t, r, i) {
5611
+ function Yr(n, e, t, r, i) {
5612
5612
  for (var s; ; ) {
5613
5613
  if (n == t && e == r)
5614
5614
  return !0;
5615
5615
  if (e == (i < 0 ? 0 : re(n))) {
5616
5616
  let o = n.parentNode;
5617
- if (!o || o.nodeType != 1 || Et(n) || ra.test(n.nodeName) || n.contentEditable == "false")
5617
+ if (!o || o.nodeType != 1 || Ot(n) || ra.test(n.nodeName) || n.contentEditable == "false")
5618
5618
  return !1;
5619
5619
  e = L(n) + (i < 0 ? 0 : 1), n = o;
5620
5620
  } else if (n.nodeType == 1) {
@@ -5641,7 +5641,7 @@ function ia(n, e) {
5641
5641
  if (n.contentEditable == "false")
5642
5642
  return null;
5643
5643
  n = n.childNodes[e - 1], e = re(n);
5644
- } else if (n.parentNode && !Et(n))
5644
+ } else if (n.parentNode && !Ot(n))
5645
5645
  e = L(n), n = n.parentNode;
5646
5646
  else
5647
5647
  return null;
@@ -5655,7 +5655,7 @@ function sa(n, e) {
5655
5655
  if (n.contentEditable == "false")
5656
5656
  return null;
5657
5657
  n = n.childNodes[e], e = 0;
5658
- } else if (n.parentNode && !Et(n))
5658
+ } else if (n.parentNode && !Ot(n))
5659
5659
  e = L(n) + 1, n = n.parentNode;
5660
5660
  else
5661
5661
  return null;
@@ -5671,7 +5671,7 @@ function oa(n, e, t) {
5671
5671
  r = r && s == 0, i = i && s == re(n);
5672
5672
  }
5673
5673
  }
5674
- function Et(n) {
5674
+ function Ot(n) {
5675
5675
  let e;
5676
5676
  for (let t = n; t && !(e = t.pmViewDesc); t = t.parentNode)
5677
5677
  ;
@@ -5704,9 +5704,9 @@ function aa(n, e, t) {
5704
5704
  return { node: r.startContainer, offset: Math.min(re(r.startContainer), r.startOffset) };
5705
5705
  }
5706
5706
  }
5707
- const ce = typeof navigator < "u" ? navigator : null, Yr = typeof document < "u" ? document : null, Re = ce && ce.userAgent || "", Ln = /Edge\/(\d+)/.exec(Re), Es = /MSIE \d/.exec(Re), Wn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Re), X = !!(Es || Wn || Ln), Ne = Es ? document.documentMode : Wn ? +Wn[1] : Ln ? +Ln[1] : 0, ie = !X && /gecko\/(\d+)/i.test(Re);
5707
+ const ce = typeof navigator < "u" ? navigator : null, Xr = typeof document < "u" ? document : null, Re = ce && ce.userAgent || "", Ln = /Edge\/(\d+)/.exec(Re), Os = /MSIE \d/.exec(Re), Wn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Re), X = !!(Os || Wn || Ln), Ne = Os ? document.documentMode : Wn ? +Wn[1] : Ln ? +Ln[1] : 0, ie = !X && /gecko\/(\d+)/i.test(Re);
5708
5708
  ie && +(/Firefox\/(\d+)/.exec(Re) || [0, 0])[1];
5709
- const Hn = !X && /Chrome\/(\d+)/.exec(Re), H = !!Hn, Os = Hn ? +Hn[1] : 0, q = !X && !!ce && /Apple Computer/.test(ce.vendor), nt = q && (/Mobile\/\w+/.test(Re) || !!ce && ce.maxTouchPoints > 2), ne = nt || (ce ? /Mac/.test(ce.platform) : !1), vs = ce ? /Win/.test(ce.platform) : !1, pe = /Android \d/.test(Re), Ot = !!Yr && "webkitFontSmoothing" in Yr.documentElement.style, ca = Ot ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5709
+ const Hn = !X && /Chrome\/(\d+)/.exec(Re), H = !!Hn, vs = Hn ? +Hn[1] : 0, q = !X && !!ce && /Apple Computer/.test(ce.vendor), nt = q && (/Mobile\/\w+/.test(Re) || !!ce && ce.maxTouchPoints > 2), ne = nt || (ce ? /Mac/.test(ce.platform) : !1), Ds = ce ? /Win/.test(ce.platform) : !1, pe = /Android \d/.test(Re), vt = !!Xr && "webkitFontSmoothing" in Xr.documentElement.style, ca = vt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5710
5710
  function fa(n) {
5711
5711
  let e = n.defaultView && n.defaultView.visualViewport;
5712
5712
  return e ? {
@@ -5733,7 +5733,7 @@ function da(n) {
5733
5733
  bottom: e.top + n.clientHeight * r
5734
5734
  };
5735
5735
  }
5736
- function Xr(n, e, t) {
5736
+ function Gr(n, e, t) {
5737
5737
  let r = n.someProp("scrollThreshold") || 0, i = n.someProp("scrollMargin") || 5, s = n.dom.ownerDocument;
5738
5738
  for (let o = t || n.dom; o; ) {
5739
5739
  if (o.nodeType != 1) {
@@ -5768,9 +5768,9 @@ function ua(n) {
5768
5768
  break;
5769
5769
  }
5770
5770
  }
5771
- return { refDOM: r, refTop: i, stack: Ds(n.dom) };
5771
+ return { refDOM: r, refTop: i, stack: As(n.dom) };
5772
5772
  }
5773
- function Ds(n) {
5773
+ function As(n) {
5774
5774
  let e = [], t = n.ownerDocument;
5775
5775
  for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = tt(r))
5776
5776
  ;
@@ -5778,28 +5778,28 @@ function Ds(n) {
5778
5778
  }
5779
5779
  function ha({ refDOM: n, refTop: e, stack: t }) {
5780
5780
  let r = n ? n.getBoundingClientRect().top : 0;
5781
- As(t, r == 0 ? 0 : r - e);
5781
+ Rs(t, r == 0 ? 0 : r - e);
5782
5782
  }
5783
- function As(n, e) {
5783
+ function Rs(n, e) {
5784
5784
  for (let t = 0; t < n.length; t++) {
5785
5785
  let { dom: r, top: i, left: s } = n[t];
5786
5786
  r.scrollTop != i + e && (r.scrollTop = i + e), r.scrollLeft != s && (r.scrollLeft = s);
5787
5787
  }
5788
5788
  }
5789
- let _e = null;
5789
+ let je = null;
5790
5790
  function pa(n) {
5791
5791
  if (n.setActive)
5792
5792
  return n.setActive();
5793
- if (_e)
5794
- return n.focus(_e);
5795
- let e = Ds(n);
5796
- n.focus(_e == null ? {
5793
+ if (je)
5794
+ return n.focus(je);
5795
+ let e = As(n);
5796
+ n.focus(je == null ? {
5797
5797
  get preventScroll() {
5798
- return _e = { preventScroll: !0 }, !0;
5798
+ return je = { preventScroll: !0 }, !0;
5799
5799
  }
5800
- } : void 0), _e || (_e = !1, As(e, 0));
5800
+ } : void 0), je || (je = !1, Rs(e, 0));
5801
5801
  }
5802
- function Rs(n, e) {
5802
+ function Is(n, e) {
5803
5803
  let t, r = 2e8, i, s = 0, o = e.top, l = e.top, a, c;
5804
5804
  for (let f = n.firstChild, d = 0; f; f = f.nextSibling, d++) {
5805
5805
  let h;
@@ -5825,7 +5825,7 @@ function Rs(n, e) {
5825
5825
  !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (s = d + 1);
5826
5826
  }
5827
5827
  }
5828
- return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? ma(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : Rs(t, i);
5828
+ return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? ma(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : Is(t, i);
5829
5829
  }
5830
5830
  function ma(n, e) {
5831
5831
  let t = n.nodeValue.length, r = document.createRange(), i;
@@ -5847,7 +5847,7 @@ function ga(n, e) {
5847
5847
  return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
5848
5848
  }
5849
5849
  function ya(n, e, t) {
5850
- let { node: r, offset: i } = Rs(e, t), s = -1;
5850
+ let { node: r, offset: i } = Is(e, t), s = -1;
5851
5851
  if (r.nodeType == 1 && !r.firstChild) {
5852
5852
  let o = r.getBoundingClientRect();
5853
5853
  s = o.left != o.right && t.left > (o.left + o.right) / 2 ? 1 : -1;
@@ -5867,7 +5867,7 @@ function ba(n, e, t, r) {
5867
5867
  }
5868
5868
  return i > -1 ? i : n.docView.posFromDOM(e, t, -1);
5869
5869
  }
5870
- function Is(n, e, t) {
5870
+ function Ps(n, e, t) {
5871
5871
  let r = n.childNodes.length;
5872
5872
  if (r && t.top < t.bottom)
5873
5873
  for (let i = Math.max(0, Math.min(r - 1, Math.floor(r * (e.top - t.top) / (t.bottom - t.top)) - 2)), s = i; ; ) {
@@ -5877,7 +5877,7 @@ function Is(n, e, t) {
5877
5877
  for (let a = 0; a < l.length; a++) {
5878
5878
  let c = l[a];
5879
5879
  if (or(e, c))
5880
- return Is(o, e, c);
5880
+ return Ps(o, e, c);
5881
5881
  }
5882
5882
  }
5883
5883
  if ((s = (s + 1) % r) == i)
@@ -5891,7 +5891,7 @@ function ka(n, e) {
5891
5891
  let o = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
5892
5892
  if (!o || !n.dom.contains(o.nodeType != 1 ? o.parentNode : o)) {
5893
5893
  let c = n.dom.getBoundingClientRect();
5894
- if (!or(e, c) || (o = Is(n.dom, e, c), !o))
5894
+ if (!or(e, c) || (o = Ps(n.dom, e, c), !o))
5895
5895
  return null;
5896
5896
  }
5897
5897
  if (q)
@@ -5903,27 +5903,27 @@ function ka(n, e) {
5903
5903
  f.nodeName == "IMG" && (d = f.getBoundingClientRect()).right <= e.left && d.bottom > e.top && i++;
5904
5904
  }
5905
5905
  let c;
5906
- Ot && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = ba(n, r, i, e));
5906
+ vt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = ba(n, r, i, e));
5907
5907
  }
5908
5908
  l == null && (l = ya(n, o, e));
5909
5909
  let a = n.docView.nearestDesc(o, !0);
5910
5910
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
5911
5911
  }
5912
- function Gr(n) {
5912
+ function Qr(n) {
5913
5913
  return n.top < n.bottom || n.left < n.right;
5914
5914
  }
5915
5915
  function xe(n, e) {
5916
5916
  let t = n.getClientRects();
5917
5917
  if (t.length) {
5918
5918
  let r = t[e < 0 ? 0 : t.length - 1];
5919
- if (Gr(r))
5919
+ if (Qr(r))
5920
5920
  return r;
5921
5921
  }
5922
- return Array.prototype.find.call(t, Gr) || n.getBoundingClientRect();
5922
+ return Array.prototype.find.call(t, Qr) || n.getBoundingClientRect();
5923
5923
  }
5924
5924
  const xa = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
5925
- function Ps(n, e, t) {
5926
- let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Ot || ie;
5925
+ function zs(n, e, t) {
5926
+ let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = vt || ie;
5927
5927
  if (r.nodeType == 3)
5928
5928
  if (o && (xa.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
5929
5929
  let a = xe(he(r, i, i), t);
@@ -5980,7 +5980,7 @@ function Cn(n, e) {
5980
5980
  let t = e ? n.top : n.bottom;
5981
5981
  return { top: t, bottom: t, left: n.left, right: n.right };
5982
5982
  }
5983
- function zs(n, e, t) {
5983
+ function Bs(n, e, t) {
5984
5984
  let r = n.state, i = n.root.activeElement;
5985
5985
  r != e && n.updateState(e), i != n.dom && n.focus();
5986
5986
  try {
@@ -5991,7 +5991,7 @@ function zs(n, e, t) {
5991
5991
  }
5992
5992
  function Sa(n, e, t) {
5993
5993
  let r = e.selection, i = t == "up" ? r.$from : r.$to;
5994
- return zs(n, e, () => {
5994
+ return Bs(n, e, () => {
5995
5995
  let { node: s } = n.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
5996
5996
  for (; ; ) {
5997
5997
  let l = n.docView.nearestDesc(s, !0);
@@ -6003,7 +6003,7 @@ function Sa(n, e, t) {
6003
6003
  }
6004
6004
  s = l.dom.parentNode;
6005
6005
  }
6006
- let o = Ps(n, i.pos, 1);
6006
+ let o = zs(n, i.pos, 1);
6007
6007
  for (let l = s.firstChild; l; l = l.nextSibling) {
6008
6008
  let a;
6009
6009
  if (l.nodeType == 1)
@@ -6027,7 +6027,7 @@ function wa(n, e, t) {
6027
6027
  if (!r.parent.isTextblock)
6028
6028
  return !1;
6029
6029
  let i = r.parentOffset, s = !i, o = i == r.parent.content.size, l = n.domSelection();
6030
- return l ? !Ma.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : zs(n, e, () => {
6030
+ return l ? !Ma.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : Bs(n, e, () => {
6031
6031
  let { focusNode: a, focusOffset: c, anchorNode: f, anchorOffset: d } = n.domSelectionRange(), h = l.caretBidiLevel;
6032
6032
  l.modify("move", t, "character");
6033
6033
  let u = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: m } = n.domSelectionRange(), g = p && !u.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
@@ -6038,12 +6038,12 @@ function wa(n, e, t) {
6038
6038
  return h != null && (l.caretBidiLevel = h), g;
6039
6039
  }) : r.pos == r.start() || r.pos == r.end();
6040
6040
  }
6041
- let Qr = null, Zr = null, ei = !1;
6041
+ let Zr = null, ei = null, ti = !1;
6042
6042
  function Ca(n, e, t) {
6043
- return Qr == e && Zr == t ? ei : (Qr = e, Zr = t, ei = t == "up" || t == "down" ? Sa(n, e, t) : wa(n, e, t));
6043
+ return Zr == e && ei == t ? ti : (Zr = e, ei = t, ti = t == "up" || t == "down" ? Sa(n, e, t) : wa(n, e, t));
6044
6044
  }
6045
- const se = 0, ti = 1, ze = 2, fe = 3;
6046
- class vt {
6045
+ const se = 0, ni = 1, ze = 2, fe = 3;
6046
+ class Dt {
6047
6047
  constructor(e, t, r, i) {
6048
6048
  this.parent = e, this.children = t, this.dom = r, this.contentDOM = i, this.dirty = se, r.pmViewDesc = this;
6049
6049
  }
@@ -6214,7 +6214,7 @@ class vt {
6214
6214
  let r = 0, i = 0;
6215
6215
  for (let s = 0; r < this.children.length; r++) {
6216
6216
  let o = this.children[r], l = s + o.size;
6217
- if (l > e || o instanceof Fs) {
6217
+ if (l > e || o instanceof $s) {
6218
6218
  i = e - s;
6219
6219
  break;
6220
6220
  }
@@ -6222,7 +6222,7 @@ class vt {
6222
6222
  }
6223
6223
  if (i)
6224
6224
  return this.children[r].domFromPos(i - this.children[r].border, t);
6225
- for (let s; r && !(s = this.children[r - 1]).size && s instanceof Bs && s.side >= 0; r--)
6225
+ for (let s; r && !(s = this.children[r - 1]).size && s instanceof Fs && s.side >= 0; r--)
6226
6226
  ;
6227
6227
  if (t <= 0) {
6228
6228
  let s, o = !0;
@@ -6358,7 +6358,7 @@ class vt {
6358
6358
  if (r == o ? e <= o && t >= r : e < o && t > r) {
6359
6359
  let l = r + s.border, a = o - s.border;
6360
6360
  if (e >= l && t <= a) {
6361
- this.dirty = e == r || t == o ? ze : ti, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = fe : s.markDirty(e - l, t - l);
6361
+ this.dirty = e == r || t == o ? ze : ni, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = fe : s.markDirty(e - l, t - l);
6362
6362
  return;
6363
6363
  } else
6364
6364
  s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? ze : fe;
@@ -6370,7 +6370,7 @@ class vt {
6370
6370
  markParentsDirty() {
6371
6371
  let e = 1;
6372
6372
  for (let t = this.parent; t; t = t.parent, e++) {
6373
- let r = e == 1 ? ze : ti;
6373
+ let r = e == 1 ? ze : ni;
6374
6374
  t.dirty < r && (t.dirty = r);
6375
6375
  }
6376
6376
  }
@@ -6387,7 +6387,7 @@ class vt {
6387
6387
  return !1;
6388
6388
  }
6389
6389
  }
6390
- class Bs extends vt {
6390
+ class Fs extends Dt {
6391
6391
  constructor(e, t, r, i) {
6392
6392
  let s, o = t.type.toDOM;
6393
6393
  if (typeof o == "function" && (o = o(r, () => {
@@ -6430,7 +6430,7 @@ class Bs extends vt {
6430
6430
  return this.widget.type.side;
6431
6431
  }
6432
6432
  }
6433
- class Ta extends vt {
6433
+ class Ta extends Dt {
6434
6434
  constructor(e, t, r, i) {
6435
6435
  super(e, [], t, null), this.textDOM = r, this.text = i;
6436
6436
  }
@@ -6447,13 +6447,13 @@ class Ta extends vt {
6447
6447
  return e.type === "characterData" && e.target.nodeValue == e.oldValue;
6448
6448
  }
6449
6449
  }
6450
- class qe extends vt {
6450
+ class qe extends Dt {
6451
6451
  constructor(e, t, r, i, s) {
6452
6452
  super(e, [], r, i), this.mark = t, this.spec = s;
6453
6453
  }
6454
6454
  static create(e, t, r, i) {
6455
6455
  let s = i.nodeViews[t.type.name], o = s && s(t, i, r);
6456
- return (!o || !o.dom) && (o = je.renderSpec(document, t.type.spec.toDOM(t, r), null, t.attrs)), new qe(e, t, o.dom, o.contentDOM || o.dom, o);
6456
+ return (!o || !o.dom) && (o = _e.renderSpec(document, t.type.spec.toDOM(t, r), null, t.attrs)), new qe(e, t, o.dom, o.contentDOM || o.dom, o);
6457
6457
  }
6458
6458
  parseRule() {
6459
6459
  return this.dirty & fe || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
@@ -6483,7 +6483,7 @@ class qe extends vt {
6483
6483
  this.spec.destroy && this.spec.destroy(), super.destroy();
6484
6484
  }
6485
6485
  }
6486
- class Ee extends vt {
6486
+ class Ee extends Dt {
6487
6487
  constructor(e, t, r, i, s, o, l, a, c) {
6488
6488
  super(e, [], s, o), this.node = t, this.outerDeco = r, this.innerDeco = i, this.nodeDOM = l;
6489
6489
  }
@@ -6508,10 +6508,10 @@ class Ee extends vt {
6508
6508
  f = document.createTextNode(t.text);
6509
6509
  else if (f.nodeType != 3)
6510
6510
  throw new RangeError("Text must be rendered as a DOM text node");
6511
- } else f || ({ dom: f, contentDOM: d } = je.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6511
+ } else f || ({ dom: f, contentDOM: d } = _e.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6512
6512
  !d && !t.isText && f.nodeName != "BR" && (f.hasAttribute("contenteditable") || (f.contentEditable = "false"), t.type.spec.draggable && (f.draggable = !0));
6513
6513
  let h = f;
6514
- return f = Ls(f, r, t), c ? a = new Na(e, t, r, i, f, d || null, h, c, s, o + 1) : t.isText ? new an(e, t, r, i, f, h, s) : new Ee(e, t, r, i, f, d || null, h, s, o + 1);
6514
+ return f = Ws(f, r, t), c ? a = new Na(e, t, r, i, f, d || null, h, c, s, o + 1) : t.isText ? new an(e, t, r, i, f, h, s) : new Ee(e, t, r, i, f, d || null, h, s, o + 1);
6515
6515
  }
6516
6516
  parseRule() {
6517
6517
  if (this.node.type.spec.reparseInView)
@@ -6534,7 +6534,7 @@ class Ee extends vt {
6534
6534
  return e;
6535
6535
  }
6536
6536
  matchesNode(e, t, r) {
6537
- return this.dirty == se && e.eq(this.node) && _t(t, this.outerDeco) && r.eq(this.innerDeco);
6537
+ return this.dirty == se && e.eq(this.node) && Kt(t, this.outerDeco) && r.eq(this.innerDeco);
6538
6538
  }
6539
6539
  get size() {
6540
6540
  return this.node.nodeSize;
@@ -6554,7 +6554,7 @@ class Ee extends vt {
6554
6554
  a.syncToMarks(c.marks, r, e, h);
6555
6555
  let u;
6556
6556
  a.findNodeMatch(c, f, d, h) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (u = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, f, d, u, e) || a.updateNextNode(c, f, d, e, h, i) || a.addNode(c, f, d, e, i), i += c.nodeSize;
6557
- }), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == ze) && (o && this.protectLocalComposition(e, o), $s(this.contentDOM, this.children, e), nt && Ra(this.dom));
6557
+ }), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == ze) && (o && this.protectLocalComposition(e, o), Vs(this.contentDOM, this.children, e), nt && Ra(this.dom));
6558
6558
  }
6559
6559
  localCompositionInfo(e, t) {
6560
6560
  let { from: r, to: i } = e.state.selection;
@@ -6592,10 +6592,10 @@ class Ee extends vt {
6592
6592
  this.updateOuterDeco(t), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = se;
6593
6593
  }
6594
6594
  updateOuterDeco(e) {
6595
- if (_t(e, this.outerDeco))
6595
+ if (Kt(e, this.outerDeco))
6596
6596
  return;
6597
6597
  let t = this.nodeDOM.nodeType != 1, r = this.dom;
6598
- this.dom = Vs(this.dom, this.nodeDOM, Jn(this.outerDeco, this.node, t), Jn(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
6598
+ this.dom = Ls(this.dom, this.nodeDOM, Jn(this.outerDeco, this.node, t), Jn(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
6599
6599
  }
6600
6600
  // Mark this node as being the selected node.
6601
6601
  selectNode() {
@@ -6609,8 +6609,8 @@ class Ee extends vt {
6609
6609
  return this.node.isAtom;
6610
6610
  }
6611
6611
  }
6612
- function ni(n, e, t, r, i) {
6613
- Ls(r, e, n);
6612
+ function ri(n, e, t, r, i) {
6613
+ Ws(r, e, n);
6614
6614
  let s = new Ee(void 0, n, e, t, r, r, r, i, 0);
6615
6615
  return s.contentDOM && s.updateChildren(i, 0), s;
6616
6616
  }
@@ -6657,7 +6657,7 @@ class an extends Ee {
6657
6657
  return this.node.text == e;
6658
6658
  }
6659
6659
  }
6660
- class Fs extends vt {
6660
+ class $s extends Dt {
6661
6661
  parseRule() {
6662
6662
  return { ignore: !0 };
6663
6663
  }
@@ -6705,23 +6705,23 @@ class Na extends Ee {
6705
6705
  return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
6706
6706
  }
6707
6707
  }
6708
- function $s(n, e, t) {
6708
+ function Vs(n, e, t) {
6709
6709
  let r = n.firstChild, i = !1;
6710
6710
  for (let s = 0; s < e.length; s++) {
6711
6711
  let o = e[s], l = o.dom;
6712
6712
  if (l.parentNode == n) {
6713
6713
  for (; l != r; )
6714
- r = ri(r), i = !0;
6714
+ r = ii(r), i = !0;
6715
6715
  r = r.nextSibling;
6716
6716
  } else
6717
6717
  i = !0, n.insertBefore(l, r);
6718
6718
  if (o instanceof qe) {
6719
6719
  let a = r ? r.previousSibling : n.lastChild;
6720
- $s(o.contentDOM, o.children, t), r = a ? a.nextSibling : n.firstChild;
6720
+ Vs(o.contentDOM, o.children, t), r = a ? a.nextSibling : n.firstChild;
6721
6721
  }
6722
6722
  }
6723
6723
  for (; r; )
6724
- r = ri(r), i = !0;
6724
+ r = ii(r), i = !0;
6725
6725
  i && t.trackWrites == n && (t.trackWrites = null);
6726
6726
  }
6727
6727
  const gt = function(n) {
@@ -6745,7 +6745,7 @@ function Jn(n, e, t) {
6745
6745
  }
6746
6746
  return i;
6747
6747
  }
6748
- function Vs(n, e, t, r) {
6748
+ function Ls(n, e, t, r) {
6749
6749
  if (t == Be && r == Be)
6750
6750
  return e;
6751
6751
  let i = e;
@@ -6781,10 +6781,10 @@ function Ea(n, e, t) {
6781
6781
  t.style && (n.style.cssText += t.style);
6782
6782
  }
6783
6783
  }
6784
- function Ls(n, e, t) {
6785
- return Vs(n, n, Be, Jn(e, t, n.nodeType != 1));
6784
+ function Ws(n, e, t) {
6785
+ return Ls(n, n, Be, Jn(e, t, n.nodeType != 1));
6786
6786
  }
6787
- function _t(n, e) {
6787
+ function Kt(n, e) {
6788
6788
  if (n.length != e.length)
6789
6789
  return !1;
6790
6790
  for (let t = 0; t < n.length; t++)
@@ -6792,7 +6792,7 @@ function _t(n, e) {
6792
6792
  return !1;
6793
6793
  return !0;
6794
6794
  }
6795
- function ri(n) {
6795
+ function ii(n) {
6796
6796
  let e = n.nextSibling;
6797
6797
  return n.parentNode.removeChild(n), e;
6798
6798
  }
@@ -6887,7 +6887,7 @@ class Oa {
6887
6887
  let c = this.preMatch.matched.get(a);
6888
6888
  if (c != null && c != s)
6889
6889
  return !1;
6890
- let f = a.dom, d, h = this.isLocked(f) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != fe && _t(t, a.outerDeco));
6890
+ let f = a.dom, d, h = this.isLocked(f) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != fe && Kt(t, a.outerDeco));
6891
6891
  if (!h && a.update(e, t, r, i))
6892
6892
  return this.destroyBetween(this.index, l), a.dom != f && (this.changed = !0), this.index++, !0;
6893
6893
  if (!h && (d = this.recreateWrapper(a, e, t, r, i, o)))
@@ -6900,7 +6900,7 @@ class Oa {
6900
6900
  // When a node with content is replaced by a different node with
6901
6901
  // identical content, move over its children.
6902
6902
  recreateWrapper(e, t, r, i, s, o) {
6903
- if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !_t(r, e.outerDeco) || !i.eq(e.innerDeco))
6903
+ if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !Kt(r, e.outerDeco) || !i.eq(e.innerDeco))
6904
6904
  return null;
6905
6905
  let l = Ee.create(this.top, t, r, i, s, o);
6906
6906
  if (l.contentDOM) {
@@ -6920,7 +6920,7 @@ class Oa {
6920
6920
  if (i && i.matchesWidget(e) && (e == i.widget || !i.widget.type.toDOM.parentNode))
6921
6921
  this.index++;
6922
6922
  else {
6923
- let s = new Bs(this.top, e, t, r);
6923
+ let s = new Fs(this.top, e, t, r);
6924
6924
  this.top.children.splice(this.index++, 0, s), this.changed = !0;
6925
6925
  }
6926
6926
  }
@@ -6939,7 +6939,7 @@ class Oa {
6939
6939
  else {
6940
6940
  let r = document.createElement(e);
6941
6941
  e == "IMG" && (r.className = "ProseMirror-separator", r.alt = ""), e == "BR" && (r.className = "ProseMirror-trailingBreak");
6942
- let i = new Fs(this.top, [], r, null);
6942
+ let i = new $s(this.top, [], r, null);
6943
6943
  t != this.top ? t.children.push(i) : t.children.splice(this.index++, 0, i), this.changed = !0;
6944
6944
  }
6945
6945
  }
@@ -7101,12 +7101,12 @@ function lr(n, e = null) {
7101
7101
  }
7102
7102
  return c;
7103
7103
  }
7104
- function Ws(n) {
7105
- return n.editable ? n.hasFocus() : Js(n) && document.activeElement && document.activeElement.contains(n.dom);
7104
+ function Hs(n) {
7105
+ return n.editable ? n.hasFocus() : qs(n) && document.activeElement && document.activeElement.contains(n.dom);
7106
7106
  }
7107
7107
  function be(n, e = !1) {
7108
7108
  let t = n.state.selection;
7109
- if (Hs(n, t), !!Ws(n)) {
7109
+ if (Js(n, t), !!Hs(n)) {
7110
7110
  if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault && H) {
7111
7111
  let r = n.domSelectionRange(), i = n.domObserver.currentSelection;
7112
7112
  if (r.anchorNode && i.anchorNode && Je(r.anchorNode, r.anchorOffset, i.anchorNode, i.anchorOffset)) {
@@ -7118,13 +7118,13 @@ function be(n, e = !1) {
7118
7118
  za(n);
7119
7119
  else {
7120
7120
  let { anchor: r, head: i } = t, s, o;
7121
- ii && !(t instanceof E) && (t.$from.parent.inlineContent || (s = si(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = si(n, t.to))), n.docView.setSelection(r, i, n, e), ii && (s && oi(s), o && oi(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Pa(n));
7121
+ si && !(t instanceof E) && (t.$from.parent.inlineContent || (s = oi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = oi(n, t.to))), n.docView.setSelection(r, i, n, e), si && (s && li(s), o && li(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Pa(n));
7122
7122
  }
7123
7123
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
7124
7124
  }
7125
7125
  }
7126
- const ii = q || H && Os < 63;
7127
- function si(n, e) {
7126
+ const si = q || H && vs < 63;
7127
+ function oi(n, e) {
7128
7128
  let { node: t, offset: r } = n.docView.domFromPos(e, 0), i = r < t.childNodes.length ? t.childNodes[r] : null, s = r ? t.childNodes[r - 1] : null;
7129
7129
  if (q && i && i.contentEditable == "false")
7130
7130
  return Tn(i);
@@ -7138,7 +7138,7 @@ function si(n, e) {
7138
7138
  function Tn(n) {
7139
7139
  return n.contentEditable = "true", q && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
7140
7140
  }
7141
- function oi(n) {
7141
+ function li(n) {
7142
7142
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
7143
7143
  }
7144
7144
  function Pa(n) {
@@ -7147,7 +7147,7 @@ function Pa(n) {
7147
7147
  let t = n.domSelectionRange(), r = t.anchorNode, i = t.anchorOffset;
7148
7148
  e.addEventListener("selectionchange", n.input.hideSelectionGuard = () => {
7149
7149
  (t.anchorNode != r || t.anchorOffset != i) && (e.removeEventListener("selectionchange", n.input.hideSelectionGuard), setTimeout(() => {
7150
- (!Ws(n) || n.state.selection.visible) && n.dom.classList.remove("ProseMirror-hideselection");
7150
+ (!Hs(n) || n.state.selection.visible) && n.dom.classList.remove("ProseMirror-hideselection");
7151
7151
  }, 20));
7152
7152
  });
7153
7153
  }
@@ -7158,23 +7158,23 @@ function za(n) {
7158
7158
  let t = n.cursorWrapper.dom, r = t.nodeName == "IMG";
7159
7159
  r ? e.collapse(t.parentNode, L(t) + 1) : e.collapse(t, 0), !r && !n.state.selection.visible && X && Ne <= 11 && (t.disabled = !0, t.disabled = !1);
7160
7160
  }
7161
- function Hs(n, e) {
7161
+ function Js(n, e) {
7162
7162
  if (e instanceof C) {
7163
7163
  let t = n.docView.descAt(e.from);
7164
- t != n.lastSelectedViewDesc && (li(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
7164
+ t != n.lastSelectedViewDesc && (ai(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
7165
7165
  } else
7166
- li(n);
7166
+ ai(n);
7167
7167
  }
7168
- function li(n) {
7168
+ function ai(n) {
7169
7169
  n.lastSelectedViewDesc && (n.lastSelectedViewDesc.parent && n.lastSelectedViewDesc.deselectNode(), n.lastSelectedViewDesc = void 0);
7170
7170
  }
7171
7171
  function ar(n, e, t, r) {
7172
7172
  return n.someProp("createSelectionBetween", (i) => i(n, e, t)) || E.between(e, t, r);
7173
7173
  }
7174
- function ai(n) {
7175
- return n.editable && !n.hasFocus() ? !1 : Js(n);
7174
+ function ci(n) {
7175
+ return n.editable && !n.hasFocus() ? !1 : qs(n);
7176
7176
  }
7177
- function Js(n) {
7177
+ function qs(n) {
7178
7178
  let e = n.domSelectionRange();
7179
7179
  if (!e.anchorNode)
7180
7180
  return !1;
@@ -7188,14 +7188,14 @@ function Ba(n) {
7188
7188
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
7189
7189
  return Je(e.node, e.offset, t.anchorNode, t.anchorOffset);
7190
7190
  }
7191
- function jn(n, e) {
7191
+ function _n(n, e) {
7192
7192
  let { $anchor: t, $head: r } = n.selection, i = e > 0 ? t.max(r) : t.min(r), s = i.parent.inlineContent ? i.depth ? n.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
7193
7193
  return s && v.findFrom(s, e);
7194
7194
  }
7195
7195
  function Se(n, e) {
7196
7196
  return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()), !0;
7197
7197
  }
7198
- function ci(n, e, t) {
7198
+ function fi(n, e, t) {
7199
7199
  let r = n.state.selection;
7200
7200
  if (r instanceof E)
7201
7201
  if (t.indexOf("s") > -1) {
@@ -7206,26 +7206,26 @@ function ci(n, e, t) {
7206
7206
  return Se(n, new E(r.$anchor, o));
7207
7207
  } else if (r.empty) {
7208
7208
  if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
7209
- let i = jn(n.state, e);
7209
+ let i = _n(n.state, e);
7210
7210
  return i && i instanceof C ? Se(n, i) : !1;
7211
7211
  } else if (!(ne && t.indexOf("m") > -1)) {
7212
7212
  let i = r.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, o;
7213
7213
  if (!s || s.isText)
7214
7214
  return !1;
7215
7215
  let l = e < 0 ? i.pos - s.nodeSize : i.pos;
7216
- return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ? C.isSelectable(s) ? Se(n, new C(e < 0 ? n.state.doc.resolve(i.pos - s.nodeSize) : i)) : Ot ? Se(n, new E(n.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
7216
+ return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ? C.isSelectable(s) ? Se(n, new C(e < 0 ? n.state.doc.resolve(i.pos - s.nodeSize) : i)) : vt ? Se(n, new E(n.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
7217
7217
  }
7218
7218
  } else return !1;
7219
7219
  else {
7220
7220
  if (r instanceof C && r.node.isInline)
7221
7221
  return Se(n, new E(e > 0 ? r.$to : r.$from));
7222
7222
  {
7223
- let i = jn(n.state, e);
7223
+ let i = _n(n.state, e);
7224
7224
  return i ? Se(n, i) : !1;
7225
7225
  }
7226
7226
  }
7227
7227
  }
7228
- function Kt(n) {
7228
+ function Ut(n) {
7229
7229
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
7230
7230
  }
7231
7231
  function yt(n, e) {
@@ -7240,7 +7240,7 @@ function Fa(n) {
7240
7240
  if (!t)
7241
7241
  return;
7242
7242
  let i, s, o = !1;
7243
- for (ie && t.nodeType == 1 && r < Kt(t) && yt(t.childNodes[r], -1) && (o = !0); ; )
7243
+ for (ie && t.nodeType == 1 && r < Ut(t) && yt(t.childNodes[r], -1) && (o = !0); ; )
7244
7244
  if (r > 0) {
7245
7245
  if (t.nodeType != 1)
7246
7246
  break;
@@ -7254,14 +7254,14 @@ function Fa(n) {
7254
7254
  break;
7255
7255
  }
7256
7256
  } else {
7257
- if (qs(t))
7257
+ if (_s(t))
7258
7258
  break;
7259
7259
  {
7260
7260
  let l = t.previousSibling;
7261
7261
  for (; l && yt(l, -1); )
7262
7262
  i = t.parentNode, s = L(l), l = l.previousSibling;
7263
7263
  if (l)
7264
- t = l, r = Kt(t);
7264
+ t = l, r = Ut(t);
7265
7265
  else {
7266
7266
  if (t = t.parentNode, t == n.dom)
7267
7267
  break;
@@ -7269,13 +7269,13 @@ function Fa(n) {
7269
7269
  }
7270
7270
  }
7271
7271
  }
7272
- o ? _n(n, t, r) : i && _n(n, i, s);
7272
+ o ? jn(n, t, r) : i && jn(n, i, s);
7273
7273
  }
7274
7274
  function $a(n) {
7275
7275
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7276
7276
  if (!t)
7277
7277
  return;
7278
- let i = Kt(t), s, o;
7278
+ let i = Ut(t), s, o;
7279
7279
  for (; ; )
7280
7280
  if (r < i) {
7281
7281
  if (t.nodeType != 1)
@@ -7286,14 +7286,14 @@ function $a(n) {
7286
7286
  else
7287
7287
  break;
7288
7288
  } else {
7289
- if (qs(t))
7289
+ if (_s(t))
7290
7290
  break;
7291
7291
  {
7292
7292
  let l = t.nextSibling;
7293
7293
  for (; l && yt(l, 1); )
7294
7294
  s = l.parentNode, o = L(l) + 1, l = l.nextSibling;
7295
7295
  if (l)
7296
- t = l, r = 0, i = Kt(t);
7296
+ t = l, r = 0, i = Ut(t);
7297
7297
  else {
7298
7298
  if (t = t.parentNode, t == n.dom)
7299
7299
  break;
@@ -7301,14 +7301,14 @@ function $a(n) {
7301
7301
  }
7302
7302
  }
7303
7303
  }
7304
- s && _n(n, s, o);
7304
+ s && jn(n, s, o);
7305
7305
  }
7306
- function qs(n) {
7306
+ function _s(n) {
7307
7307
  let e = n.pmViewDesc;
7308
7308
  return e && e.node && e.node.isBlock;
7309
7309
  }
7310
7310
  function Va(n, e) {
7311
- for (; n && e == n.childNodes.length && !Et(n); )
7311
+ for (; n && e == n.childNodes.length && !Ot(n); )
7312
7312
  e = L(n) + 1, n = n.parentNode;
7313
7313
  for (; n && e < n.childNodes.length; ) {
7314
7314
  let t = n.childNodes[e];
@@ -7320,7 +7320,7 @@ function Va(n, e) {
7320
7320
  }
7321
7321
  }
7322
7322
  function La(n, e) {
7323
- for (; n && !e && !Et(n); )
7323
+ for (; n && !e && !Ot(n); )
7324
7324
  e = L(n), n = n.parentNode;
7325
7325
  for (; n && e; ) {
7326
7326
  let t = n.childNodes[e - 1];
@@ -7331,7 +7331,7 @@ function La(n, e) {
7331
7331
  n = t, e = n.childNodes.length;
7332
7332
  }
7333
7333
  }
7334
- function _n(n, e, t) {
7334
+ function jn(n, e, t) {
7335
7335
  if (e.nodeType != 3) {
7336
7336
  let s, o;
7337
7337
  (o = Va(e, t)) ? (e = o, t = 0) : (s = La(e, t)) && (e = s, t = s.nodeValue.length);
@@ -7349,9 +7349,9 @@ function _n(n, e, t) {
7349
7349
  n.state == i && be(n);
7350
7350
  }, 50);
7351
7351
  }
7352
- function fi(n, e) {
7352
+ function di(n, e) {
7353
7353
  let t = n.state.doc.resolve(e);
7354
- if (!(H || vs) && t.parent.inlineContent) {
7354
+ if (!(H || Ds) && t.parent.inlineContent) {
7355
7355
  let i = n.coordsAtPos(e);
7356
7356
  if (e > t.start()) {
7357
7357
  let s = n.coordsAtPos(e - 1), o = (s.top + s.bottom) / 2;
@@ -7366,13 +7366,13 @@ function fi(n, e) {
7366
7366
  }
7367
7367
  return getComputedStyle(n.dom).direction == "rtl" ? "rtl" : "ltr";
7368
7368
  }
7369
- function di(n, e, t) {
7369
+ function ui(n, e, t) {
7370
7370
  let r = n.state.selection;
7371
7371
  if (r instanceof E && !r.empty || t.indexOf("s") > -1 || ne && t.indexOf("m") > -1)
7372
7372
  return !1;
7373
7373
  let { $from: i, $to: s } = r;
7374
7374
  if (!i.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
7375
- let o = jn(n.state, e);
7375
+ let o = _n(n.state, e);
7376
7376
  if (o && o instanceof C)
7377
7377
  return Se(n, o);
7378
7378
  }
@@ -7382,7 +7382,7 @@ function di(n, e, t) {
7382
7382
  }
7383
7383
  return !1;
7384
7384
  }
7385
- function ui(n, e) {
7385
+ function hi(n, e) {
7386
7386
  if (!(n.state.selection instanceof E))
7387
7387
  return !0;
7388
7388
  let { $head: t, $anchor: r, empty: i } = n.state.selection;
@@ -7399,7 +7399,7 @@ function ui(n, e) {
7399
7399
  }
7400
7400
  return !1;
7401
7401
  }
7402
- function hi(n, e, t) {
7402
+ function pi(n, e, t) {
7403
7403
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
7404
7404
  }
7405
7405
  function Wa(n) {
@@ -7408,7 +7408,7 @@ function Wa(n) {
7408
7408
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
7409
7409
  if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
7410
7410
  let r = e.firstChild;
7411
- hi(n, r, "true"), setTimeout(() => hi(n, r, "false"), 20);
7411
+ pi(n, r, "true"), setTimeout(() => pi(n, r, "false"), 20);
7412
7412
  }
7413
7413
  return !1;
7414
7414
  }
@@ -7419,22 +7419,22 @@ function Ha(n) {
7419
7419
  function Ja(n, e) {
7420
7420
  let t = e.keyCode, r = Ha(e);
7421
7421
  if (t == 8 || ne && t == 72 && r == "c")
7422
- return ui(n, -1) || Ke(n, -1);
7422
+ return hi(n, -1) || Ke(n, -1);
7423
7423
  if (t == 46 && !e.shiftKey || ne && t == 68 && r == "c")
7424
- return ui(n, 1) || Ke(n, 1);
7424
+ return hi(n, 1) || Ke(n, 1);
7425
7425
  if (t == 13 || t == 27)
7426
7426
  return !0;
7427
7427
  if (t == 37 || ne && t == 66 && r == "c") {
7428
- let i = t == 37 ? fi(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
7429
- return ci(n, i, r) || Ke(n, i);
7428
+ let i = t == 37 ? di(n, n.state.selection.from) == "ltr" ? -1 : 1 : -1;
7429
+ return fi(n, i, r) || Ke(n, i);
7430
7430
  } else if (t == 39 || ne && t == 70 && r == "c") {
7431
- let i = t == 39 ? fi(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
7432
- return ci(n, i, r) || Ke(n, i);
7431
+ let i = t == 39 ? di(n, n.state.selection.from) == "ltr" ? 1 : -1 : 1;
7432
+ return fi(n, i, r) || Ke(n, i);
7433
7433
  } else {
7434
7434
  if (t == 38 || ne && t == 80 && r == "c")
7435
- return di(n, -1, r) || Ke(n, -1);
7435
+ return ui(n, -1, r) || Ke(n, -1);
7436
7436
  if (t == 40 || ne && t == 78 && r == "c")
7437
- return Wa(n) || di(n, 1, r) || Ke(n, 1);
7437
+ return Wa(n) || ui(n, 1, r) || Ke(n, 1);
7438
7438
  if (r == (ne ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
7439
7439
  return !0;
7440
7440
  }
@@ -7450,7 +7450,7 @@ function cr(n, e) {
7450
7450
  let u = r.firstChild;
7451
7451
  t.push(u.type.name, u.attrs != u.type.defaultAttrs ? u.attrs : null), r = u.content;
7452
7452
  }
7453
- let o = n.someProp("clipboardSerializer") || je.fromSchema(n.state.schema), l = Xs(), a = l.createElement("div");
7453
+ let o = n.someProp("clipboardSerializer") || _e.fromSchema(n.state.schema), l = Xs(), a = l.createElement("div");
7454
7454
  a.appendChild(o.serializeFragment(r, { document: l }));
7455
7455
  let c = a.firstChild, f, d = 0;
7456
7456
  for (; c && c.nodeType == 1 && (f = Ys[c.nodeName.toLowerCase()]); ) {
@@ -7468,7 +7468,7 @@ function cr(n, e) {
7468
7468
  `);
7469
7469
  return { dom: a, text: h, slice: e };
7470
7470
  }
7471
- function js(n, e, t, r, i) {
7471
+ function fr(n, e, t, r, i) {
7472
7472
  let s = i.parent.type.spec.code, o, l;
7473
7473
  if (!t && !e)
7474
7474
  return null;
@@ -7485,7 +7485,7 @@ function js(n, e, t, r, i) {
7485
7485
  if (d)
7486
7486
  l = d;
7487
7487
  else {
7488
- let h = i.marks(), { schema: u } = n.state, p = je.fromSchema(u);
7488
+ let h = i.marks(), { schema: u } = n.state, p = _e.fromSchema(u);
7489
7489
  o = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((m) => {
7490
7490
  let g = o.appendChild(document.createElement("p"));
7491
7491
  m && g.appendChild(p.serializeNode(u.text(m, h)));
@@ -7494,7 +7494,7 @@ function js(n, e, t, r, i) {
7494
7494
  } else
7495
7495
  n.someProp("transformPastedHTML", (d) => {
7496
7496
  t = d(t, n);
7497
- }), o = Ka(t), Ot && Ua(o);
7497
+ }), o = Ka(t), vt && Ua(o);
7498
7498
  let c = o && o.querySelector("[data-pm-slice]"), f = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
7499
7499
  if (f && f[3])
7500
7500
  for (let d = +f[3]; d > 0; d--) {
@@ -7512,21 +7512,21 @@ function js(n, e, t, r, i) {
7512
7512
  return h.nodeName == "BR" && !h.nextSibling && h.parentNode && !qa.test(h.parentNode.nodeName) ? { ignore: !0 } : null;
7513
7513
  }
7514
7514
  })), f)
7515
- l = Ya(pi(l, +f[1], +f[2]), f[4]);
7516
- else if (l = k.maxOpen(ja(l.content, i), !0), l.openStart || l.openEnd) {
7515
+ l = Ya(mi(l, +f[1], +f[2]), f[4]);
7516
+ else if (l = k.maxOpen(_a(l.content, i), !0), l.openStart || l.openEnd) {
7517
7517
  let d = 0, h = 0;
7518
7518
  for (let u = l.content.firstChild; d < l.openStart && !u.type.spec.isolating; d++, u = u.firstChild)
7519
7519
  ;
7520
7520
  for (let u = l.content.lastChild; h < l.openEnd && !u.type.spec.isolating; h++, u = u.lastChild)
7521
7521
  ;
7522
- l = pi(l, d, h);
7522
+ l = mi(l, d, h);
7523
7523
  }
7524
7524
  return n.someProp("transformPasted", (d) => {
7525
7525
  l = d(l, n, a);
7526
7526
  }), l;
7527
7527
  }
7528
7528
  const qa = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7529
- function ja(n, e) {
7529
+ function _a(n, e) {
7530
7530
  if (n.childCount < 2)
7531
7531
  return n;
7532
7532
  for (let t = e.depth; t >= 0; t--) {
@@ -7541,7 +7541,7 @@ function ja(n, e) {
7541
7541
  o[o.length - 1] = c;
7542
7542
  else {
7543
7543
  o.length && (o[o.length - 1] = Us(o[o.length - 1], s.length));
7544
- let f = _s(l, a);
7544
+ let f = js(l, a);
7545
7545
  o.push(f), i = i.matchType(f.type), s = a;
7546
7546
  }
7547
7547
  }), o)
@@ -7549,7 +7549,7 @@ function ja(n, e) {
7549
7549
  }
7550
7550
  return n;
7551
7551
  }
7552
- function _s(n, e, t = 0) {
7552
+ function js(n, e, t = 0) {
7553
7553
  for (let r = e.length - 1; r >= t; r--)
7554
7554
  n = e[r].create(null, b.from(n));
7555
7555
  return n;
@@ -7560,7 +7560,7 @@ function Ks(n, e, t, r, i) {
7560
7560
  if (s)
7561
7561
  return r.copy(r.content.replaceChild(r.childCount - 1, s));
7562
7562
  if (r.contentMatchAt(r.childCount).matchType(i == n.length - 1 ? t.type : n[i + 1]))
7563
- return r.copy(r.content.append(b.from(_s(t, n, i + 1))));
7563
+ return r.copy(r.content.append(b.from(js(t, n, i + 1))));
7564
7564
  }
7565
7565
  }
7566
7566
  function Us(n, e) {
@@ -7573,7 +7573,7 @@ function Kn(n, e, t, r, i, s) {
7573
7573
  let o = e < 0 ? n.firstChild : n.lastChild, l = o.content;
7574
7574
  return n.childCount > 1 && (s = 0), i < r - 1 && (l = Kn(l, e, t, r, i + 1, s)), i >= t && (l = e < 0 ? o.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(o.contentMatchAt(o.childCount).fillBefore(b.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, o.copy(l));
7575
7575
  }
7576
- function pi(n, e, t) {
7576
+ function mi(n, e, t) {
7577
7577
  return e < n.openStart && (n = new k(Kn(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Kn(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
7578
7578
  }
7579
7579
  const Ys = {
@@ -7587,12 +7587,12 @@ const Ys = {
7587
7587
  td: ["table", "tbody", "tr"],
7588
7588
  th: ["table", "tbody", "tr"]
7589
7589
  };
7590
- let mi = null;
7590
+ let gi = null;
7591
7591
  function Xs() {
7592
- return mi || (mi = document.implementation.createHTMLDocument("title"));
7592
+ return gi || (gi = document.implementation.createHTMLDocument("title"));
7593
7593
  }
7594
7594
  let Nn = null;
7595
- function _a(n) {
7595
+ function ja(n) {
7596
7596
  let e = window.trustedTypes;
7597
7597
  return e ? (Nn || (Nn = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Nn.createHTML(n)) : n;
7598
7598
  }
@@ -7600,7 +7600,7 @@ function Ka(n) {
7600
7600
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
7601
7601
  e && (n = n.slice(e[0].length));
7602
7602
  let t = Xs().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), i;
7603
- if ((i = r && Ys[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = _a(n), i)
7603
+ if ((i = r && Ys[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = ja(n), i)
7604
7604
  for (let s = 0; s < i.length; s++)
7605
7605
  t = t.querySelector(i[s]) || t;
7606
7606
  return t;
@@ -7640,7 +7640,7 @@ function Qa(n) {
7640
7640
  for (let e in K) {
7641
7641
  let t = K[e];
7642
7642
  n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
7643
- ec(n, r) && !fr(n, r) && (n.editable || !(r.type in U)) && t(n, r);
7643
+ ec(n, r) && !dr(n, r) && (n.editable || !(r.type in U)) && t(n, r);
7644
7644
  }, Xa[e] ? { passive: !0 } : void 0);
7645
7645
  }
7646
7646
  q && n.dom.addEventListener("input", () => null), Un(n);
@@ -7657,10 +7657,10 @@ function Za(n) {
7657
7657
  function Un(n) {
7658
7658
  n.someProp("handleDOMEvents", (e) => {
7659
7659
  for (let t in e)
7660
- n.input.eventHandlers[t] || n.dom.addEventListener(t, n.input.eventHandlers[t] = (r) => fr(n, r));
7660
+ n.input.eventHandlers[t] || n.dom.addEventListener(t, n.input.eventHandlers[t] = (r) => dr(n, r));
7661
7661
  });
7662
7662
  }
7663
- function fr(n, e) {
7663
+ function dr(n, e) {
7664
7664
  return n.someProp("handleDOMEvents", (t) => {
7665
7665
  let r = t[e.type];
7666
7666
  return r ? r(n, e) || e.defaultPrevented : !1;
@@ -7677,7 +7677,7 @@ function ec(n, e) {
7677
7677
  return !0;
7678
7678
  }
7679
7679
  function tc(n, e) {
7680
- !fr(n, e) && K[e.type] && (n.editable || !(e.type in U)) && K[e.type](n, e);
7680
+ !dr(n, e) && K[e.type] && (n.editable || !(e.type in U)) && K[e.type](n, e);
7681
7681
  }
7682
7682
  U.keydown = (n, e) => {
7683
7683
  let t = e;
@@ -7713,7 +7713,7 @@ function nc(n, e) {
7713
7713
  let t = e.x - n.clientX, r = e.y - n.clientY;
7714
7714
  return t * t + r * r < 100;
7715
7715
  }
7716
- function dr(n, e, t, r, i) {
7716
+ function ur(n, e, t, r, i) {
7717
7717
  if (r == -1)
7718
7718
  return !1;
7719
7719
  let s = n.state.doc.resolve(r);
@@ -7750,13 +7750,13 @@ function ic(n, e) {
7750
7750
  return i != null ? (Qe(n, C.create(n.state.doc, i)), !0) : !1;
7751
7751
  }
7752
7752
  function sc(n, e, t, r, i) {
7753
- return dr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? ic(n, t) : rc(n, t));
7753
+ return ur(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? ic(n, t) : rc(n, t));
7754
7754
  }
7755
7755
  function oc(n, e, t, r) {
7756
- return dr(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (i) => i(n, e, r));
7756
+ return ur(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (i) => i(n, e, r));
7757
7757
  }
7758
7758
  function lc(n, e, t, r) {
7759
- return dr(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || ac(n, t, r);
7759
+ return ur(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || ac(n, t, r);
7760
7760
  }
7761
7761
  function ac(n, e, t) {
7762
7762
  if (t.button != 0)
@@ -7776,14 +7776,14 @@ function ac(n, e, t) {
7776
7776
  return !0;
7777
7777
  }
7778
7778
  }
7779
- function ur(n) {
7780
- return Ut(n);
7779
+ function hr(n) {
7780
+ return Mt(n);
7781
7781
  }
7782
7782
  const Gs = ne ? "metaKey" : "ctrlKey";
7783
7783
  K.mousedown = (n, e) => {
7784
7784
  let t = e;
7785
7785
  n.input.shiftKey = t.shiftKey;
7786
- let r = ur(n), i = Date.now(), s = "singleClick";
7786
+ let r = hr(n), i = Date.now(), s = "singleClick";
7787
7787
  i - n.input.lastClick.time < 500 && nc(t, n.input.lastClick) && !t[Gs] && n.input.lastClick.button == t.button && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s, button: t.button };
7788
7788
  let o = n.posAtCoords(cn(t));
7789
7789
  o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new cc(n, o, t, !!r)) : (s == "doubleClick" ? oc : lc)(n, o.pos, o.inside, t) ? t.preventDefault() : Te(n, "pointer"));
@@ -7835,12 +7835,12 @@ class cc {
7835
7835
  }
7836
7836
  }
7837
7837
  K.touchstart = (n) => {
7838
- n.input.lastTouch = Date.now(), ur(n), Te(n, "pointer");
7838
+ n.input.lastTouch = Date.now(), hr(n), Te(n, "pointer");
7839
7839
  };
7840
7840
  K.touchmove = (n) => {
7841
7841
  n.input.lastTouch = Date.now(), Te(n, "pointer");
7842
7842
  };
7843
- K.contextmenu = (n) => ur(n);
7843
+ K.contextmenu = (n) => hr(n);
7844
7844
  function Qs(n, e) {
7845
7845
  return n.composing ? !0 : q && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
7846
7846
  }
@@ -7849,9 +7849,9 @@ U.compositionstart = U.compositionupdate = (n) => {
7849
7849
  if (!n.composing) {
7850
7850
  n.domObserver.flush();
7851
7851
  let { state: e } = n, t = e.selection.$to;
7852
- if (e.selection instanceof E && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || H && vs && dc(n)))
7853
- n.markCursor = n.state.storedMarks || t.marks(), Ut(n, !0), n.markCursor = null;
7854
- else if (Ut(n, !e.selection.empty), ie && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
7852
+ if (e.selection instanceof E && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || H && Ds && dc(n)))
7853
+ n.markCursor = n.state.storedMarks || t.marks(), Mt(n, !0), n.markCursor = null;
7854
+ else if (Mt(n, !e.selection.empty), ie && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
7855
7855
  let r = n.domSelectionRange();
7856
7856
  for (let i = r.focusNode, s = r.focusOffset; i && i.nodeType == 1 && s != 0; ) {
7857
7857
  let o = s < 0 ? i.lastChild : i.childNodes[s - 1];
@@ -7880,7 +7880,7 @@ U.compositionend = (n, e) => {
7880
7880
  n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.badSafariComposition ? n.domObserver.forceFlush() : n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, Zs(n, 20));
7881
7881
  };
7882
7882
  function Zs(n, e) {
7883
- clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Ut(n), e));
7883
+ clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Mt(n), e));
7884
7884
  }
7885
7885
  function eo(n) {
7886
7886
  for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = hc()); n.input.compositionNodes.length > 0; )
@@ -7909,7 +7909,7 @@ function hc() {
7909
7909
  let n = document.createEvent("Event");
7910
7910
  return n.initEvent("event", !0, !0), n.timeStamp;
7911
7911
  }
7912
- function Ut(n, e = !1) {
7912
+ function Mt(n, e = !1) {
7913
7913
  if (!(pe && n.domObserver.flushingSoon >= 0)) {
7914
7914
  if (n.domObserver.forceFlush(), eo(n), e || n.docView && n.docView.dirty) {
7915
7915
  let t = lr(n), r = n.state.selection;
@@ -7928,12 +7928,12 @@ function pc(n, e) {
7928
7928
  t.parentNode && t.parentNode.removeChild(t), n.focus();
7929
7929
  }, 50);
7930
7930
  }
7931
- const Mt = X && Ne < 15 || nt && ca < 604;
7931
+ const wt = X && Ne < 15 || nt && ca < 604;
7932
7932
  K.copy = U.cut = (n, e) => {
7933
7933
  let t = e, r = n.state.selection, i = t.type == "cut";
7934
7934
  if (r.empty)
7935
7935
  return;
7936
- let s = Mt ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = cr(n, o);
7936
+ let s = wt ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = cr(n, o);
7937
7937
  s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : pc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
7938
7938
  };
7939
7939
  function mc(n) {
@@ -7946,11 +7946,11 @@ function gc(n, e) {
7946
7946
  t || (r.contentEditable = "true"), r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus();
7947
7947
  let i = n.input.shiftKey && n.input.lastKeyCode != 45;
7948
7948
  setTimeout(() => {
7949
- n.focus(), r.parentNode && r.parentNode.removeChild(r), t ? wt(n, r.value, null, i, e) : wt(n, r.textContent, r.innerHTML, i, e);
7949
+ n.focus(), r.parentNode && r.parentNode.removeChild(r), t ? Ct(n, r.value, null, i, e) : Ct(n, r.textContent, r.innerHTML, i, e);
7950
7950
  }, 50);
7951
7951
  }
7952
- function wt(n, e, t, r, i) {
7953
- let s = js(n, e, t, r, n.state.selection.$from);
7952
+ function Ct(n, e, t, r, i) {
7953
+ let s = fr(n, e, t, r, n.state.selection.$from);
7954
7954
  if (n.someProp("handlePaste", (a) => a(n, i, s || k.empty)))
7955
7955
  return !0;
7956
7956
  if (!s)
@@ -7969,8 +7969,8 @@ U.paste = (n, e) => {
7969
7969
  let t = e;
7970
7970
  if (n.composing && !pe)
7971
7971
  return;
7972
- let r = Mt ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
7973
- r && wt(n, to(r), r.getData("text/html"), i, t) ? t.preventDefault() : gc(n, t);
7972
+ let r = wt ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
7973
+ r && Ct(n, to(r), r.getData("text/html"), i, t) ? t.preventDefault() : gc(n, t);
7974
7974
  };
7975
7975
  class no {
7976
7976
  constructor(e, t, r) {
@@ -7998,7 +7998,7 @@ K.dragstart = (n, e) => {
7998
7998
  }
7999
7999
  }
8000
8000
  let l = (o || n.state.selection).content(), { dom: a, text: c, slice: f } = cr(n, l);
8001
- (!t.dataTransfer.files.length || !H || Os > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Mt ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Mt || t.dataTransfer.setData("text/plain", c), n.dragging = new no(f, ro(n, t), o);
8001
+ (!t.dataTransfer.files.length || !H || vs > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(wt ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", wt || t.dataTransfer.setData("text/plain", c), n.dragging = new no(f, ro(n, t), o);
8002
8002
  };
8003
8003
  K.dragend = (n) => {
8004
8004
  let e = n.dragging;
@@ -8023,7 +8023,7 @@ function bc(n, e, t) {
8023
8023
  let i = n.state.doc.resolve(r.pos), s = t && t.slice;
8024
8024
  s ? n.someProp("transformPasted", (u) => {
8025
8025
  s = u(s, n, !1);
8026
- }) : s = js(n, to(e.dataTransfer), Mt ? null : e.dataTransfer.getData("text/html"), !1, i);
8026
+ }) : s = fr(n, to(e.dataTransfer), wt ? null : e.dataTransfer.getData("text/html"), !1, i);
8027
8027
  let o = !!(t && ro(n, e));
8028
8028
  if (n.someProp("handleDrop", (u) => u(n, e, s || k.empty, o))) {
8029
8029
  e.preventDefault();
@@ -8074,7 +8074,7 @@ K.beforeinput = (n, e) => {
8074
8074
  };
8075
8075
  for (let n in U)
8076
8076
  K[n] = U[n];
8077
- function Ct(n, e) {
8077
+ function Tt(n, e) {
8078
8078
  if (n == e)
8079
8079
  return !0;
8080
8080
  for (let t in n)
@@ -8097,7 +8097,7 @@ class Yt {
8097
8097
  return !0;
8098
8098
  }
8099
8099
  eq(e) {
8100
- return this == e || e instanceof Yt && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Ct(this.spec, e.spec));
8100
+ return this == e || e instanceof Yt && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Tt(this.spec, e.spec));
8101
8101
  }
8102
8102
  destroy(e) {
8103
8103
  this.spec.destroy && this.spec.destroy(e);
@@ -8115,7 +8115,7 @@ class Oe {
8115
8115
  return t.from < t.to;
8116
8116
  }
8117
8117
  eq(e) {
8118
- return this == e || e instanceof Oe && Ct(this.attrs, e.attrs) && Ct(this.spec, e.spec);
8118
+ return this == e || e instanceof Oe && Tt(this.attrs, e.attrs) && Tt(this.spec, e.spec);
8119
8119
  }
8120
8120
  static is(e) {
8121
8121
  return e.type instanceof Oe;
@@ -8123,7 +8123,7 @@ class Oe {
8123
8123
  destroy() {
8124
8124
  }
8125
8125
  }
8126
- class hr {
8126
+ class pr {
8127
8127
  constructor(e, t) {
8128
8128
  this.attrs = e, this.spec = t || Ve;
8129
8129
  }
@@ -8139,7 +8139,7 @@ class hr {
8139
8139
  return i == t.from && !(s = e.child(r)).isText && i + s.nodeSize == t.to;
8140
8140
  }
8141
8141
  eq(e) {
8142
- return this == e || e instanceof hr && Ct(this.attrs, e.attrs) && Ct(this.spec, e.spec);
8142
+ return this == e || e instanceof pr && Tt(this.attrs, e.attrs) && Tt(this.spec, e.spec);
8143
8143
  }
8144
8144
  destroy() {
8145
8145
  }
@@ -8193,7 +8193,7 @@ class le {
8193
8193
  node, will receive the given attributes.
8194
8194
  */
8195
8195
  static node(e, t, r, i) {
8196
- return new le(e, t, new hr(r, i));
8196
+ return new le(e, t, new pr(r, i));
8197
8197
  }
8198
8198
  /**
8199
8199
  The spec provided when creating this decoration. Can be useful
@@ -8368,7 +8368,7 @@ class B {
8368
8368
  @internal
8369
8369
  */
8370
8370
  locals(e) {
8371
- return pr(this.localsInner(e));
8371
+ return mr(this.localsInner(e));
8372
8372
  }
8373
8373
  /**
8374
8374
  @internal
@@ -8388,7 +8388,7 @@ class B {
8388
8388
  }
8389
8389
  }
8390
8390
  B.empty = new B([], []);
8391
- B.removeOverlap = pr;
8391
+ B.removeOverlap = mr;
8392
8392
  const J = B.empty;
8393
8393
  class Me {
8394
8394
  constructor(e) {
@@ -8429,7 +8429,7 @@ class Me {
8429
8429
  t.push(s[o]);
8430
8430
  }
8431
8431
  }
8432
- return t ? pr(r ? t : t.sort(Le)) : Ye;
8432
+ return t ? mr(r ? t : t.sort(Le)) : Ye;
8433
8433
  }
8434
8434
  // Create a group for the given array of decoration sets, or return
8435
8435
  // a single set when possible.
@@ -8552,7 +8552,7 @@ function Xt(n, e, t, r) {
8552
8552
  function Le(n, e) {
8553
8553
  return n.from - e.from || n.to - e.to;
8554
8554
  }
8555
- function pr(n) {
8555
+ function mr(n) {
8556
8556
  let e = n;
8557
8557
  for (let t = 0; t < e.length - 1; t++) {
8558
8558
  let r = e[t];
@@ -8560,17 +8560,17 @@ function pr(n) {
8560
8560
  for (let i = t + 1; i < e.length; i++) {
8561
8561
  let s = e[i];
8562
8562
  if (s.from == r.from) {
8563
- s.to != r.to && (e == n && (e = n.slice()), e[i] = s.copy(s.from, r.to), gi(e, i + 1, s.copy(r.to, s.to)));
8563
+ s.to != r.to && (e == n && (e = n.slice()), e[i] = s.copy(s.from, r.to), yi(e, i + 1, s.copy(r.to, s.to)));
8564
8564
  continue;
8565
8565
  } else {
8566
- s.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, s.from), gi(e, i, r.copy(s.from, r.to)));
8566
+ s.from < r.to && (e == n && (e = n.slice()), e[t] = r.copy(r.from, s.from), yi(e, i, r.copy(s.from, r.to)));
8567
8567
  break;
8568
8568
  }
8569
8569
  }
8570
8570
  }
8571
8571
  return e;
8572
8572
  }
8573
- function gi(n, e, t) {
8573
+ function yi(n, e, t) {
8574
8574
  for (; e < n.length && Le(t, n[e]) > 0; )
8575
8575
  e++;
8576
8576
  n.splice(e, 0, t);
@@ -8647,7 +8647,7 @@ class Cc {
8647
8647
  this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
8648
8648
  }
8649
8649
  onSelectionChange() {
8650
- if (ai(this.view)) {
8650
+ if (ci(this.view)) {
8651
8651
  if (this.suppressingSelectionUpdates)
8652
8652
  return be(this.view);
8653
8653
  if (X && Ne <= 11 && !this.view.state.selection.empty) {
@@ -8691,7 +8691,7 @@ class Cc {
8691
8691
  return;
8692
8692
  let t = this.pendingRecords();
8693
8693
  t.length && (this.queue = []);
8694
- let r = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) && ai(e) && !this.ignoreSelectionChange(r), s = -1, o = -1, l = !1, a = [];
8694
+ let r = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) && ci(e) && !this.ignoreSelectionChange(r), s = -1, o = -1, l = !1, a = [];
8695
8695
  if (e.editable)
8696
8696
  for (let f = 0; f < t.length; f++) {
8697
8697
  let d = this.registerMutation(t[f], a);
@@ -8758,15 +8758,15 @@ class Cc {
8758
8758
  });
8759
8759
  }
8760
8760
  }
8761
- let yi = /* @__PURE__ */ new WeakMap(), bi = !1;
8761
+ let bi = /* @__PURE__ */ new WeakMap(), ki = !1;
8762
8762
  function Tc(n) {
8763
- if (!yi.has(n) && (yi.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
8764
- if (n.requiresGeckoHackNode = ie, bi)
8763
+ if (!bi.has(n) && (bi.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
8764
+ if (n.requiresGeckoHackNode = ie, ki)
8765
8765
  return;
8766
- console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), bi = !0;
8766
+ console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), ki = !0;
8767
8767
  }
8768
8768
  }
8769
- function ki(n, e) {
8769
+ function xi(n, e) {
8770
8770
  let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
8771
8771
  return Je(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
8772
8772
  }
@@ -8774,13 +8774,13 @@ function Nc(n, e) {
8774
8774
  if (e.getComposedRanges) {
8775
8775
  let i = e.getComposedRanges(n.root)[0];
8776
8776
  if (i)
8777
- return ki(n, i);
8777
+ return xi(n, i);
8778
8778
  }
8779
8779
  let t;
8780
8780
  function r(i) {
8781
8781
  i.preventDefault(), i.stopImmediatePropagation(), t = i.getTargetRanges()[0];
8782
8782
  }
8783
- return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? ki(n, t) : null;
8783
+ return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? xi(n, t) : null;
8784
8784
  }
8785
8785
  function Ec(n, e) {
8786
8786
  for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
@@ -8860,7 +8860,7 @@ function Rc(n, e, t, r, i) {
8860
8860
  if (n.input.compositionPendingChanges = 0, e < 0) {
8861
8861
  let w = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, O = lr(n, w);
8862
8862
  if (O && !n.state.selection.eq(O)) {
8863
- if (H && pe && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (_) => _(n, Pe(13, "Enter"))))
8863
+ if (H && pe && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (j) => j(n, Pe(13, "Enter"))))
8864
8864
  return;
8865
8865
  let D = n.state.tr.setSelection(O);
8866
8866
  w == "pointer" ? D.setMeta("pointer", !0) : w == "key" && D.scrollIntoView(), s && D.setMeta("composition", s), n.dispatch(D);
@@ -8881,7 +8881,7 @@ function Rc(n, e, t, r, i) {
8881
8881
  p = { start: a.from, endA: a.to, endB: a.to };
8882
8882
  else {
8883
8883
  if (c.sel) {
8884
- let w = xi(n, n.state.doc, c.sel);
8884
+ let w = Si(n, n.state.doc, c.sel);
8885
8885
  if (w && !w.eq(n.state.selection)) {
8886
8886
  let O = n.state.tr.setSelection(w);
8887
8887
  s && O.setMeta("composition", s), n.dispatch(O);
@@ -8907,7 +8907,7 @@ function Rc(n, e, t, r, i) {
8907
8907
  let S = p.start, N = p.endA, T = (w) => {
8908
8908
  let O = w || n.state.tr.replace(S, N, c.doc.slice(p.start - c.from, p.endB - c.from));
8909
8909
  if (c.sel) {
8910
- let D = xi(n, O.doc, c.sel);
8910
+ let D = Si(n, O.doc, c.sel);
8911
8911
  D && !(H && n.composing && D.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (D.head == S || D.head == O.mapping.map(N) - 1) || X && D.empty && D.head == S) && O.setSelection(D);
8912
8912
  }
8913
8913
  return s && O.setMeta("composition", s), O.scrollIntoView();
@@ -8931,7 +8931,7 @@ function Rc(n, e, t, r, i) {
8931
8931
  else
8932
8932
  n.dispatch(T());
8933
8933
  }
8934
- function xi(n, e, t) {
8934
+ function Si(n, e, t) {
8935
8935
  return Math.max(t.anchor, t.head) > e.content.size ? null : ar(n, e.resolve(t.anchor), e.resolve(t.head));
8936
8936
  }
8937
8937
  function Ic(n, e) {
@@ -8991,19 +8991,20 @@ function zc(n, e, t, r, i) {
8991
8991
  }
8992
8992
  if (o < s && n.size < e.size) {
8993
8993
  let a = r <= s && r >= o ? s - r : 0;
8994
- s -= a, s && s < e.size && Si(e.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), l = s + (l - o), o = s;
8994
+ s -= a, s && s < e.size && Mi(e.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), l = s + (l - o), o = s;
8995
8995
  } else if (l < s) {
8996
8996
  let a = r <= s && r >= l ? s - r : 0;
8997
- s -= a, s && s < n.size && Si(n.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), o = s + (o - l), l = s;
8997
+ s -= a, s && s < n.size && Mi(n.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), o = s + (o - l), l = s;
8998
8998
  }
8999
8999
  return { start: s, endA: o, endB: l };
9000
9000
  }
9001
- function Si(n) {
9001
+ function Mi(n) {
9002
9002
  if (n.length != 2)
9003
9003
  return !1;
9004
9004
  let e = n.charCodeAt(0), t = n.charCodeAt(1);
9005
9005
  return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
9006
9006
  }
9007
+ const Yd = fr, Xd = Mt;
9007
9008
  class lo {
9008
9009
  /**
9009
9010
  Create a view. `place` may be a DOM node that the editor should
@@ -9013,7 +9014,7 @@ class lo {
9013
9014
  added to the document.
9014
9015
  */
9015
9016
  constructor(e, t) {
9016
- this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Ga(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Ni), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Ci(this), wi(this), this.nodeViews = Ti(this), this.docView = ni(this.state.doc, Mi(this), En(this), this.dom, this), this.domObserver = new Cc(this, (r, i, s, o) => Rc(this, r, i, s, o)), this.domObserver.start(), Qa(this), this.updatePluginViews();
9017
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Ga(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Ei), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Ti(this), Ci(this), this.nodeViews = Ni(this), this.docView = ri(this.state.doc, wi(this), En(this), this.dom, this), this.domObserver = new Cc(this, (r, i, s, o) => Rc(this, r, i, s, o)), this.domObserver.start(), Qa(this), this.updatePluginViews();
9017
9018
  }
9018
9019
  /**
9019
9020
  Holds `true` when a
@@ -9043,7 +9044,7 @@ class lo {
9043
9044
  update(e) {
9044
9045
  e.handleDOMEvents != this._props.handleDOMEvents && Un(this);
9045
9046
  let t = this._props;
9046
- this._props = e, e.plugins && (e.plugins.forEach(Ni), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
9047
+ this._props = e, e.plugins && (e.plugins.forEach(Ei), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
9047
9048
  }
9048
9049
  /**
9049
9050
  Update the view by updating existing props object with the object
@@ -9072,11 +9073,11 @@ class lo {
9072
9073
  e.storedMarks && this.composing && (eo(this), o = !0), this.state = e;
9073
9074
  let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
9074
9075
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
9075
- let u = Ti(this);
9076
+ let u = Ni(this);
9076
9077
  Fc(u, this.nodeViews) && (this.nodeViews = u, s = !0);
9077
9078
  }
9078
- (l || t.handleDOMEvents != this._props.handleDOMEvents) && Un(this), this.editable = Ci(this), wi(this);
9079
- let a = En(this), c = Mi(this), f = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", d = s || !this.docView.matchesNode(e.doc, c, a);
9079
+ (l || t.handleDOMEvents != this._props.handleDOMEvents) && Un(this), this.editable = Ti(this), Ci(this);
9080
+ let a = En(this), c = wi(this), f = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", d = s || !this.docView.matchesNode(e.doc, c, a);
9080
9081
  (d || !e.selection.eq(i.selection)) && (o = !0);
9081
9082
  let h = f == "preserve" && o && this.dom.style.overflowAnchor == null && ua(this);
9082
9083
  if (o) {
@@ -9084,9 +9085,9 @@ class lo {
9084
9085
  let u = d && (X || H) && !this.composing && !i.selection.empty && !e.selection.empty && Bc(i.selection, e.selection);
9085
9086
  if (d) {
9086
9087
  let p = H ? this.trackWrites = this.domSelectionRange().focusNode : null;
9087
- this.composing && (this.input.compositionNode = uc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ni(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (u = !0);
9088
+ this.composing && (this.input.compositionNode = uc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ri(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (u = !0);
9088
9089
  }
9089
- u || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Ba(this)) ? be(this, u) : (Hs(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9090
+ u || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Ba(this)) ? be(this, u) : (Js(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9090
9091
  }
9091
9092
  this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), f == "reset" ? this.dom.scrollTop = 0 : f == "to selection" ? this.scrollToSelection() : h && ha(h);
9092
9093
  }
@@ -9098,9 +9099,9 @@ class lo {
9098
9099
  if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
9099
9100
  if (!this.someProp("handleScrollToSelection", (t) => t(this))) if (this.state.selection instanceof C) {
9100
9101
  let t = this.docView.domAfterPos(this.state.selection.from);
9101
- t.nodeType == 1 && Xr(this, t.getBoundingClientRect(), e);
9102
+ t.nodeType == 1 && Gr(this, t.getBoundingClientRect(), e);
9102
9103
  } else
9103
- Xr(this, this.coordsAtPos(this.state.selection.head, 1), e);
9104
+ Gr(this, this.coordsAtPos(this.state.selection.head, 1), e);
9104
9105
  }
9105
9106
  }
9106
9107
  destroyPluginViews() {
@@ -9220,7 +9221,7 @@ class lo {
9220
9221
  otherwise the element after.
9221
9222
  */
9222
9223
  coordsAtPos(e, t = 1) {
9223
- return Ps(this, e, t);
9224
+ return zs(this, e, t);
9224
9225
  }
9225
9226
  /**
9226
9227
  Find the DOM position that corresponds to the given document
@@ -9282,13 +9283,13 @@ class lo {
9282
9283
  [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
9283
9284
  */
9284
9285
  pasteHTML(e, t) {
9285
- return wt(this, "", e, !1, t || new ClipboardEvent("paste"));
9286
+ return Ct(this, "", e, !1, t || new ClipboardEvent("paste"));
9286
9287
  }
9287
9288
  /**
9288
9289
  Run the editor's paste logic with the given plain-text input.
9289
9290
  */
9290
9291
  pasteText(e, t) {
9291
- return wt(this, e, null, !0, t || new ClipboardEvent("paste"));
9292
+ return Ct(this, e, null, !0, t || new ClipboardEvent("paste"));
9292
9293
  }
9293
9294
  /**
9294
9295
  Serialize the given slice as it would be if it was copied from
@@ -9340,7 +9341,7 @@ lo.prototype.dispatch = function(n) {
9340
9341
  let e = this._props.dispatchTransaction;
9341
9342
  e ? e.call(this, n) : this.updateState(this.state.apply(n));
9342
9343
  };
9343
- function Mi(n) {
9344
+ function wi(n) {
9344
9345
  let e = /* @__PURE__ */ Object.create(null);
9345
9346
  return e.class = "ProseMirror", e.contenteditable = String(n.editable), n.someProp("attributes", (t) => {
9346
9347
  if (typeof t == "function" && (t = t(n.state)), t)
@@ -9348,21 +9349,21 @@ function Mi(n) {
9348
9349
  r == "class" ? e.class += " " + t[r] : r == "style" ? e.style = (e.style ? e.style + ";" : "") + t[r] : !e[r] && r != "contenteditable" && r != "nodeName" && (e[r] = String(t[r]));
9349
9350
  }), e.translate || (e.translate = "no"), [le.node(0, n.state.doc.content.size, e)];
9350
9351
  }
9351
- function wi(n) {
9352
+ function Ci(n) {
9352
9353
  if (n.markCursor) {
9353
9354
  let e = document.createElement("img");
9354
9355
  e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), n.cursorWrapper = { dom: e, deco: le.widget(n.state.selection.from, e, { raw: !0, marks: n.markCursor }) };
9355
9356
  } else
9356
9357
  n.cursorWrapper = null;
9357
9358
  }
9358
- function Ci(n) {
9359
+ function Ti(n) {
9359
9360
  return !n.someProp("editable", (e) => e(n.state) === !1);
9360
9361
  }
9361
9362
  function Bc(n, e) {
9362
9363
  let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
9363
9364
  return n.$anchor.start(t) != e.$anchor.start(t);
9364
9365
  }
9365
- function Ti(n) {
9366
+ function Ni(n) {
9366
9367
  let e = /* @__PURE__ */ Object.create(null);
9367
9368
  function t(r) {
9368
9369
  for (let i in r)
@@ -9381,7 +9382,7 @@ function Fc(n, e) {
9381
9382
  r++;
9382
9383
  return t != r;
9383
9384
  }
9384
- function Ni(n) {
9385
+ function Ei(n) {
9385
9386
  if (n.spec.state || n.spec.filterTransaction || n.spec.appendTransaction)
9386
9387
  throw new RangeError("Plugins passed directly to the view must not have a state component");
9387
9388
  }
@@ -9504,10 +9505,10 @@ function qc(n) {
9504
9505
  function Dn(n, e, t = !0) {
9505
9506
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
9506
9507
  }
9507
- function jc(n) {
9508
- return new ae({ props: { handleKeyDown: _c(n) } });
9509
- }
9510
9508
  function _c(n) {
9509
+ return new ae({ props: { handleKeyDown: jc(n) } });
9510
+ }
9511
+ function jc(n) {
9511
9512
  let e = qc(n);
9512
9513
  return function(t, r) {
9513
9514
  let i = Lc(r), s, o = e[Dn(i, r)];
@@ -9529,7 +9530,7 @@ function _c(n) {
9529
9530
  return !1;
9530
9531
  };
9531
9532
  }
9532
- var Kc = Object.defineProperty, mr = (n, e) => {
9533
+ var Kc = Object.defineProperty, gr = (n, e) => {
9533
9534
  for (var t in e)
9534
9535
  Kc(n, t, { get: e[t], enumerable: !0 });
9535
9536
  };
@@ -9626,7 +9627,7 @@ var dn = class {
9626
9627
  return o;
9627
9628
  }
9628
9629
  }, ao = {};
9629
- mr(ao, {
9630
+ gr(ao, {
9630
9631
  blur: () => Uc,
9631
9632
  clearContent: () => Yc,
9632
9633
  clearNodes: () => Xc,
@@ -9708,7 +9709,7 @@ var Uc = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
9708
9709
  (p || p === 0) && e.lift(u, p);
9709
9710
  });
9710
9711
  }), !0;
9711
- }, Gc = (n) => (e) => n(e), Qc = () => ({ state: n, dispatch: e }) => ws(n, e), Zc = (n, e) => ({ editor: t, tr: r }) => {
9712
+ }, Gc = (n) => (e) => n(e), Qc = () => ({ state: n, dispatch: e }) => Cs(n, e), Zc = (n, e) => ({ editor: t, tr: r }) => {
9712
9713
  const { state: i } = t, s = i.doc.slice(n.from, n.to);
9713
9714
  r.deleteRange(n.from, n.to);
9714
9715
  const o = r.mapping.map(e);
@@ -9751,12 +9752,12 @@ var tf = (n) => ({ tr: e, state: t, dispatch: r }) => {
9751
9752
  const { from: r, to: i } = n;
9752
9753
  return t && e.delete(r, i), !0;
9753
9754
  }, rf = () => ({ state: n, dispatch: e }) => tr(n, e), sf = () => ({ commands: n }) => n.keyboardShortcut("Enter"), of = () => ({ state: n, dispatch: e }) => Wl(n, e);
9754
- function gr(n) {
9755
+ function yr(n) {
9755
9756
  return Object.prototype.toString.call(n) === "[object RegExp]";
9756
9757
  }
9757
9758
  function Qt(n, e, t = { strict: !0 }) {
9758
9759
  const r = Object.keys(e);
9759
- return r.length ? r.every((i) => t.strict ? e[i] === n[i] : gr(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
9760
+ return r.length ? r.every((i) => t.strict ? e[i] === n[i] : yr(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
9760
9761
  }
9761
9762
  function co(n, e, t = {}) {
9762
9763
  return n.find((r) => r.type === e && Qt(
@@ -9765,10 +9766,10 @@ function co(n, e, t = {}) {
9765
9766
  t
9766
9767
  ));
9767
9768
  }
9768
- function Ei(n, e, t = {}) {
9769
+ function Oi(n, e, t = {}) {
9769
9770
  return !!co(n, e, t);
9770
9771
  }
9771
- function yr(n, e, t) {
9772
+ function br(n, e, t) {
9772
9773
  if (!n || !e)
9773
9774
  return;
9774
9775
  let r = n.parent.childAfter(n.parentOffset);
@@ -9781,9 +9782,9 @@ function yr(n, e, t) {
9781
9782
  if (!co([...r.node.marks], e, t))
9782
9783
  return;
9783
9784
  let s = r.index, o = n.start() + r.offset, l = s + 1, a = o + r.node.nodeSize;
9784
- for (; s > 0 && Ei([...n.parent.child(s - 1).marks], e, t); )
9785
+ for (; s > 0 && Oi([...n.parent.child(s - 1).marks], e, t); )
9785
9786
  s -= 1, o -= n.parent.child(s).nodeSize;
9786
- for (; l < n.parent.childCount && Ei([...n.parent.child(l).marks], e, t); )
9787
+ for (; l < n.parent.childCount && Oi([...n.parent.child(l).marks], e, t); )
9787
9788
  a += n.parent.child(l).nodeSize, l += 1;
9788
9789
  return {
9789
9790
  from: o,
@@ -9801,7 +9802,7 @@ function ke(n, e) {
9801
9802
  var lf = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
9802
9803
  const s = ke(n, r.schema), { doc: o, selection: l } = t, { $from: a, from: c, to: f } = l;
9803
9804
  if (i) {
9804
- const d = yr(a, s, e);
9805
+ const d = br(a, s, e);
9805
9806
  if (d && d.from <= c && d.to >= f) {
9806
9807
  const h = E.create(o, d.from, d.to);
9807
9808
  t.setSelection(h);
@@ -9815,7 +9816,7 @@ var lf = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
9815
9816
  return !0;
9816
9817
  return !1;
9817
9818
  };
9818
- function br(n) {
9819
+ function kr(n) {
9819
9820
  return n instanceof E;
9820
9821
  }
9821
9822
  function me(n = 0, e = 0, t = 0) {
@@ -9858,7 +9859,7 @@ var ff = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) => {
9858
9859
  } catch {
9859
9860
  return !1;
9860
9861
  }
9861
- if (s && n === null && !br(t.state.selection))
9862
+ if (s && n === null && !kr(t.state.selection))
9862
9863
  return o(), !0;
9863
9864
  const l = fo(i.doc, n) || t.state.selection, a = t.state.selection.eq(l);
9864
9865
  return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
@@ -9876,7 +9877,7 @@ function ut(n) {
9876
9877
  const e = `<body>${n}</body>`, t = new window.DOMParser().parseFromString(e, "text/html").body;
9877
9878
  return uo(t);
9878
9879
  }
9879
- function Tt(n, e, t) {
9880
+ function Nt(n, e, t) {
9880
9881
  if (n instanceof Z || n instanceof b)
9881
9882
  return n;
9882
9883
  t = {
@@ -9894,12 +9895,12 @@ function Tt(n, e, t) {
9894
9895
  } catch (s) {
9895
9896
  if (t.errorOnInvalidContent)
9896
9897
  throw new Error("[tiptap error]: Invalid JSON content", { cause: s });
9897
- return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", s), Tt("", e, t);
9898
+ return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", s), Nt("", e, t);
9898
9899
  }
9899
9900
  if (i) {
9900
9901
  if (t.errorOnInvalidContent) {
9901
9902
  let o = !1, l = "";
9902
- const a = new Xi({
9903
+ const a = new Gi({
9903
9904
  topNode: e.spec.topNode,
9904
9905
  marks: e.spec.marks,
9905
9906
  // Prosemirror's schemas are executed such that: the last to execute, matches last
@@ -9925,7 +9926,7 @@ function Tt(n, e, t) {
9925
9926
  const s = ge.fromSchema(e);
9926
9927
  return t.slice ? s.parseSlice(ut(n), t.parseOptions).content : s.parse(ut(n), t.parseOptions);
9927
9928
  }
9928
- return Tt("", e, t);
9929
+ return Nt("", e, t);
9929
9930
  }
9930
9931
  function hf(n, e, t) {
9931
9932
  const r = n.steps.length - 1;
@@ -9965,7 +9966,7 @@ var pf = (n) => !("type" in n), mf = (n, e, t) => ({ tr: r, dispatch: i, editor:
9965
9966
  };
9966
9967
  if (!t.errorOnInvalidContent && !s.options.enableContentCheck && s.options.emitContentError)
9967
9968
  try {
9968
- Tt(e, s.schema, {
9969
+ Nt(e, s.schema, {
9969
9970
  parseOptions: c,
9970
9971
  errorOnInvalidContent: !0
9971
9972
  });
@@ -9973,7 +9974,7 @@ var pf = (n) => !("type" in n), mf = (n, e, t) => ({ tr: r, dispatch: i, editor:
9973
9974
  a(g);
9974
9975
  }
9975
9976
  try {
9976
- l = Tt(e, s.schema, {
9977
+ l = Nt(e, s.schema, {
9977
9978
  parseOptions: c,
9978
9979
  errorOnInvalidContent: (o = t.errorOnInvalidContent) != null ? o : s.options.enableContentCheck
9979
9980
  });
@@ -10006,7 +10007,7 @@ var pf = (n) => !("type" in n), mf = (n, e, t) => ({ tr: r, dispatch: i, editor:
10006
10007
  t.updateSelection && hf(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: f, text: m }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: f, text: m });
10007
10008
  }
10008
10009
  return !0;
10009
- }, gf = () => ({ state: n, dispatch: e }) => $l(n, e), yf = () => ({ state: n, dispatch: e }) => Vl(n, e), bf = () => ({ state: n, dispatch: e }) => gs(n, e), kf = () => ({ state: n, dispatch: e }) => xs(n, e), xf = () => ({ state: n, dispatch: e, tr: t }) => {
10010
+ }, gf = () => ({ state: n, dispatch: e }) => $l(n, e), yf = () => ({ state: n, dispatch: e }) => Vl(n, e), bf = () => ({ state: n, dispatch: e }) => ys(n, e), kf = () => ({ state: n, dispatch: e }) => Ss(n, e), xf = () => ({ state: n, dispatch: e, tr: t }) => {
10010
10011
  try {
10011
10012
  const r = rn(n.doc, n.selection.$from.pos, -1);
10012
10013
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
@@ -10063,7 +10064,7 @@ var Tf = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
10063
10064
  f && i && r.maybeStep(f);
10064
10065
  }), !0;
10065
10066
  };
10066
- function Nt(n, e, t = {}) {
10067
+ function Et(n, e, t = {}) {
10067
10068
  const { from: r, to: i, empty: s } = n.selection, o = e ? $(e, n.schema) : null, l = [];
10068
10069
  n.doc.nodesBetween(r, i, (d, h) => {
10069
10070
  if (d.isText)
@@ -10080,15 +10081,15 @@ function Nt(n, e, t = {}) {
10080
10081
  }
10081
10082
  var Nf = (n, e = {}) => ({ state: t, dispatch: r }) => {
10082
10083
  const i = $(n, t.schema);
10083
- return Nt(t, i, e) ? Ll(t, r) : !1;
10084
- }, Ef = () => ({ state: n, dispatch: e }) => Cs(n, e), Of = (n) => ({ state: e, dispatch: t }) => {
10084
+ return Et(t, i, e) ? Ll(t, r) : !1;
10085
+ }, Ef = () => ({ state: n, dispatch: e }) => Ts(n, e), Of = (n) => ({ state: e, dispatch: t }) => {
10085
10086
  const r = $(n, e.schema);
10086
10087
  return Ql(r)(e, t);
10087
- }, vf = () => ({ state: n, dispatch: e }) => Ms(n, e);
10088
+ }, vf = () => ({ state: n, dispatch: e }) => ws(n, e);
10088
10089
  function un(n, e) {
10089
10090
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
10090
10091
  }
10091
- function Oi(n, e) {
10092
+ function vi(n, e) {
10092
10093
  const t = typeof e == "string" ? [e] : e;
10093
10094
  return Object.keys(n).reduce((r, i) => (t.includes(i) || (r[i] = n[i]), r), {});
10094
10095
  }
@@ -10104,8 +10105,8 @@ var Df = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
10104
10105
  let a = !1;
10105
10106
  return t.selection.ranges.forEach((c) => {
10106
10107
  r.doc.nodesBetween(c.$from.pos, c.$to.pos, (f, d) => {
10107
- s && s === f.type && (a = !0, i && t.setNodeMarkup(d, void 0, Oi(f.attrs, e))), o && f.marks.length && f.marks.forEach((h) => {
10108
- o === h.type && (a = !0, i && t.addMark(d, d + f.nodeSize, o.create(Oi(h.attrs, e))));
10108
+ s && s === f.type && (a = !0, i && t.setNodeMarkup(d, void 0, vi(f.attrs, e))), o && f.marks.length && f.marks.forEach((h) => {
10109
+ o === h.type && (a = !0, i && t.addMark(d, d + f.nodeSize, o.create(vi(h.attrs, e))));
10109
10110
  });
10110
10111
  });
10111
10112
  }), a;
@@ -10115,9 +10116,9 @@ var Df = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
10115
10116
  n.setSelection(t);
10116
10117
  }
10117
10118
  return !0;
10118
- }, If = () => ({ state: n, dispatch: e }) => bs(n, e), Pf = () => ({ state: n, dispatch: e }) => Ss(n, e), zf = () => ({ state: n, dispatch: e }) => ql(n, e), Bf = () => ({ state: n, dispatch: e }) => Kl(n, e), Ff = () => ({ state: n, dispatch: e }) => _l(n, e);
10119
+ }, If = () => ({ state: n, dispatch: e }) => ks(n, e), Pf = () => ({ state: n, dispatch: e }) => Ms(n, e), zf = () => ({ state: n, dispatch: e }) => ql(n, e), Bf = () => ({ state: n, dispatch: e }) => Kl(n, e), Ff = () => ({ state: n, dispatch: e }) => jl(n, e);
10119
10120
  function Yn(n, e, t = {}, r = {}) {
10120
- return Tt(n, e, {
10121
+ return Nt(n, e, {
10121
10122
  slice: !1,
10122
10123
  parseOptions: t,
10123
10124
  errorOnInvalidContent: r.errorOnInvalidContent
@@ -10145,7 +10146,7 @@ function po(n, e) {
10145
10146
  return l ? { ...l.attrs } : {};
10146
10147
  }
10147
10148
  function Vf(n, e) {
10148
- const t = new us(n);
10149
+ const t = new hs(n);
10149
10150
  return e.forEach((r) => {
10150
10151
  r.steps.forEach((i) => {
10151
10152
  t.step(i);
@@ -10160,7 +10161,7 @@ function Lf(n) {
10160
10161
  }
10161
10162
  return null;
10162
10163
  }
10163
- function Yd(n, e) {
10164
+ function Gd(n, e) {
10164
10165
  const t = [];
10165
10166
  return n.descendants((r, i) => {
10166
10167
  e(r) && t.push({
@@ -10169,7 +10170,7 @@ function Yd(n, e) {
10169
10170
  });
10170
10171
  }), t;
10171
10172
  }
10172
- function Xd(n, e, t) {
10173
+ function Qd(n, e, t) {
10173
10174
  const r = [];
10174
10175
  return n.nodesBetween(e.from, e.to, (i, s) => {
10175
10176
  t(i) && r.push({
@@ -10199,18 +10200,18 @@ function M(n, e, t) {
10199
10200
  parent: n.parent ? M(n.parent, e, t) : null
10200
10201
  }) : n.config[e];
10201
10202
  }
10202
- function kr(n) {
10203
+ function xr(n) {
10203
10204
  return n.map((e) => {
10204
10205
  const t = {
10205
10206
  name: e.name,
10206
10207
  options: e.options,
10207
10208
  storage: e.storage
10208
10209
  }, r = M(e, "addExtensions", t);
10209
- return r ? [e, ...kr(r())] : e;
10210
+ return r ? [e, ...xr(r())] : e;
10210
10211
  }).flat(10);
10211
10212
  }
10212
10213
  function pn(n, e) {
10213
- const t = je.fromSchema(e).serializeFragment(n), i = document.implementation.createHTMLDocument().createElement("div");
10214
+ const t = _e.fromSchema(e).serializeFragment(n), i = document.implementation.createHTMLDocument().createElement("div");
10214
10215
  return i.appendChild(t), i.innerHTML;
10215
10216
  }
10216
10217
  function mo(n) {
@@ -10326,7 +10327,7 @@ function Jf(n) {
10326
10327
  }
10327
10328
  return t && e.push(t), e;
10328
10329
  }
10329
- function vi(n) {
10330
+ function Di(n) {
10330
10331
  const e = [], t = Jf(n || ""), r = t.length;
10331
10332
  for (let i = 0; i < r; i += 1) {
10332
10333
  const s = t[i], o = s.indexOf(":");
@@ -10349,7 +10350,7 @@ function qf(...n) {
10349
10350
  const l = s ? String(s).split(" ") : [], a = r[i] ? r[i].split(" ") : [], c = l.filter((f) => !a.includes(f));
10350
10351
  r[i] = [...a, ...c].join(" ");
10351
10352
  } else if (i === "style") {
10352
- const l = new Map([...vi(r[i]), ...vi(s)]);
10353
+ const l = new Map([...Di(r[i]), ...Di(s)]);
10353
10354
  r[i] = Array.from(l.entries()).map(([a, c]) => `${a}: ${c}`).join("; ");
10354
10355
  } else
10355
10356
  r[i] = s;
@@ -10361,10 +10362,10 @@ function en(n, e) {
10361
10362
  [t.name]: n.attrs[t.name]
10362
10363
  }).reduce((t, r) => qf(t, r), {});
10363
10364
  }
10364
- function jf(n) {
10365
+ function _f(n) {
10365
10366
  return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
10366
10367
  }
10367
- function Di(n, e) {
10368
+ function Ai(n, e) {
10368
10369
  return "style" in n ? n : {
10369
10370
  ...n,
10370
10371
  getAttrs: (t) => {
@@ -10372,7 +10373,7 @@ function Di(n, e) {
10372
10373
  if (r === !1)
10373
10374
  return !1;
10374
10375
  const i = e.reduce((s, o) => {
10375
- const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : jf(t.getAttribute(o.name));
10376
+ const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : _f(t.getAttribute(o.name));
10376
10377
  return l == null ? s : {
10377
10378
  ...s,
10378
10379
  [o.name]: l
@@ -10382,13 +10383,13 @@ function Di(n, e) {
10382
10383
  }
10383
10384
  };
10384
10385
  }
10385
- function Ai(n) {
10386
+ function Ri(n) {
10386
10387
  return Object.fromEntries(
10387
10388
  // @ts-ignore
10388
10389
  Object.entries(n).filter(([e, t]) => e === "attrs" && Hf(t) ? !1 : t != null)
10389
10390
  );
10390
10391
  }
10391
- function Ri(n) {
10392
+ function Ii(n) {
10392
10393
  var e, t;
10393
10394
  const r = {};
10394
10395
  return !((e = n == null ? void 0 : n.attribute) != null && e.isRequired) && "default" in ((n == null ? void 0 : n.attribute) || {}) && (r.default = n.attribute.default), ((t = n == null ? void 0 : n.attribute) == null ? void 0 : t.validate) !== void 0 && (r.validate = n.attribute.validate), [n.name, r];
@@ -10408,7 +10409,7 @@ function yo(n, e) {
10408
10409
  ...y,
10409
10410
  ...S ? S(c) : {}
10410
10411
  };
10411
- }, {}), u = Ai({
10412
+ }, {}), u = Ri({
10412
10413
  ...h,
10413
10414
  content: A(M(c, "content", d)),
10414
10415
  marks: A(M(c, "marks", d)),
@@ -10424,10 +10425,10 @@ function yo(n, e) {
10424
10425
  ),
10425
10426
  defining: A(M(c, "defining", d)),
10426
10427
  isolating: A(M(c, "isolating", d)),
10427
- attrs: Object.fromEntries(f.map(Ri))
10428
+ attrs: Object.fromEntries(f.map(Ii))
10428
10429
  }), p = A(M(c, "parseHTML", d));
10429
10430
  p && (u.parseDOM = p.map(
10430
- (y) => Di(y, f)
10431
+ (y) => Ai(y, f)
10431
10432
  ));
10432
10433
  const m = M(c, "renderHTML", d);
10433
10434
  m && (u.toDOM = (y) => m({
@@ -10450,17 +10451,17 @@ function yo(n, e) {
10450
10451
  ...g,
10451
10452
  ...x ? x(c) : {}
10452
10453
  };
10453
- }, {}), u = Ai({
10454
+ }, {}), u = Ri({
10454
10455
  ...h,
10455
10456
  inclusive: A(M(c, "inclusive", d)),
10456
10457
  excludes: A(M(c, "excludes", d)),
10457
10458
  group: A(M(c, "group", d)),
10458
10459
  spanning: A(M(c, "spanning", d)),
10459
10460
  code: A(M(c, "code", d)),
10460
- attrs: Object.fromEntries(f.map(Ri))
10461
+ attrs: Object.fromEntries(f.map(Ii))
10461
10462
  }), p = A(M(c, "parseHTML", d));
10462
10463
  p && (u.parseDOM = p.map(
10463
- (g) => Di(g, f)
10464
+ (g) => Ai(g, f)
10464
10465
  ));
10465
10466
  const m = M(c, "renderHTML", d);
10466
10467
  return m && (u.toDOM = (g) => m({
@@ -10469,13 +10470,13 @@ function yo(n, e) {
10469
10470
  })), [c.name, u];
10470
10471
  })
10471
10472
  );
10472
- return new Xi({
10473
+ return new Gi({
10473
10474
  topNode: o,
10474
10475
  nodes: l,
10475
10476
  marks: a
10476
10477
  });
10477
10478
  }
10478
- function _f(n) {
10479
+ function jf(n) {
10479
10480
  const e = n.filter((t, r) => n.indexOf(t) !== r);
10480
10481
  return Array.from(new Set(e));
10481
10482
  }
@@ -10485,22 +10486,22 @@ function bt(n) {
10485
10486
  return i > s ? -1 : i < s ? 1 : 0;
10486
10487
  });
10487
10488
  }
10488
- function xr(n) {
10489
- const e = bt(kr(n)), t = _f(e.map((r) => r.name));
10489
+ function Sr(n) {
10490
+ const e = bt(xr(n)), t = jf(e.map((r) => r.name));
10490
10491
  return t.length && console.warn(
10491
10492
  `[tiptap warn]: Duplicate extension names found: [${t.map((r) => `'${r}'`).join(", ")}]. This can lead to issues.`
10492
10493
  ), e;
10493
10494
  }
10494
- function Sr(n, e) {
10495
- const t = xr(n);
10495
+ function Mr(n, e) {
10496
+ const t = Sr(n);
10496
10497
  return yo(t, e);
10497
10498
  }
10498
- function Gd(n, e) {
10499
- const t = Sr(e), r = Z.fromJSON(t, n);
10499
+ function Zd(n, e) {
10500
+ const t = Mr(e), r = Z.fromJSON(t, n);
10500
10501
  return pn(r.content, t);
10501
10502
  }
10502
- function Qd(n, e) {
10503
- const t = Sr(e), r = ut(n);
10503
+ function eu(n, e) {
10504
+ const t = Mr(e), r = ut(n);
10504
10505
  return ge.fromSchema(t).parse(r).toJSON();
10505
10506
  }
10506
10507
  function bo(n, e, t) {
@@ -10530,19 +10531,19 @@ function ko(n, e) {
10530
10531
  };
10531
10532
  return bo(n, t, e);
10532
10533
  }
10533
- function Mr(n) {
10534
+ function wr(n) {
10534
10535
  return Object.fromEntries(
10535
10536
  Object.entries(n.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText])
10536
10537
  );
10537
10538
  }
10538
- function Zd(n, e, t) {
10539
+ function tu(n, e, t) {
10539
10540
  const { blockSeparator: r = `
10540
10541
 
10541
- `, textSerializers: i = {} } = t || {}, s = Sr(e), o = Z.fromJSON(s, n);
10542
+ `, textSerializers: i = {} } = t || {}, s = Mr(e), o = Z.fromJSON(s, n);
10542
10543
  return ko(o, {
10543
10544
  blockSeparator: r,
10544
10545
  textSerializers: {
10545
- ...Mr(s),
10546
+ ...wr(s),
10546
10547
  ...i
10547
10548
  }
10548
10549
  });
@@ -10621,7 +10622,7 @@ function Qf(n, e = 0) {
10621
10622
  function xo(n, e, t) {
10622
10623
  const r = [];
10623
10624
  return n === e ? t.resolve(n).marks().forEach((i) => {
10624
- const s = t.resolve(n), o = yr(s, i.type);
10625
+ const s = t.resolve(n), o = br(s, i.type);
10625
10626
  o && r.push({
10626
10627
  mark: i,
10627
10628
  ...o
@@ -10636,7 +10637,7 @@ function xo(n, e, t) {
10636
10637
  );
10637
10638
  }), r;
10638
10639
  }
10639
- var eu = (n, e, t, r = 20) => {
10640
+ var nu = (n, e, t, r = 20) => {
10640
10641
  const i = n.doc.resolve(t);
10641
10642
  let s = r, o = null;
10642
10643
  for (; s > 0 && o === null; ) {
@@ -10648,7 +10649,7 @@ var eu = (n, e, t, r = 20) => {
10648
10649
  function at(n, e) {
10649
10650
  return e.nodes[n] || e.marks[n] || null;
10650
10651
  }
10651
- function Vt(n, e, t) {
10652
+ function Lt(n, e, t) {
10652
10653
  return Object.fromEntries(
10653
10654
  Object.entries(t).filter(([r]) => {
10654
10655
  const i = n.find((s) => s.type === e && s.name === r);
@@ -10699,11 +10700,11 @@ function Xn(n, e, t = {}) {
10699
10700
  }
10700
10701
  function ed(n, e, t = {}) {
10701
10702
  if (!e)
10702
- return Nt(n, null, t) || Xn(n, null, t);
10703
+ return Et(n, null, t) || Xn(n, null, t);
10703
10704
  const r = un(e, n.schema);
10704
- return r === "node" ? Nt(n, e, t) : r === "mark" ? Xn(n, e, t) : !1;
10705
+ return r === "node" ? Et(n, e, t) : r === "mark" ? Xn(n, e, t) : !1;
10705
10706
  }
10706
- var tu = (n, e) => {
10707
+ var ru = (n, e) => {
10707
10708
  const { $from: t, $to: r, $anchor: i } = n.selection;
10708
10709
  if (e) {
10709
10710
  const s = hn((l) => l.type.name === e)(n.selection);
@@ -10713,11 +10714,11 @@ var tu = (n, e) => {
10713
10714
  return i.pos + 1 === o.end();
10714
10715
  }
10715
10716
  return !(r.parentOffset < r.parent.nodeSize - 2 || t.pos !== r.pos);
10716
- }, nu = (n) => {
10717
+ }, iu = (n) => {
10717
10718
  const { $from: e, $to: t } = n.selection;
10718
10719
  return !(e.parentOffset > 0 || e.pos !== t.pos);
10719
10720
  };
10720
- function Ii(n, e) {
10721
+ function Pi(n, e) {
10721
10722
  return Array.isArray(e) ? e.some((t) => (typeof t == "string" ? t : t.name) === n.name) : e;
10722
10723
  }
10723
10724
  function An(n, e) {
@@ -10731,7 +10732,7 @@ function An(n, e) {
10731
10732
  }, s = A(M(r, "group", i));
10732
10733
  return typeof s != "string" ? !1 : s.split(" ").includes("list");
10733
10734
  }
10734
- function wr(n, {
10735
+ function Cr(n, {
10735
10736
  checkChildren: e = !0,
10736
10737
  ignoreWhitespace: t = !1
10737
10738
  } = {}) {
@@ -10751,22 +10752,22 @@ function wr(n, {
10751
10752
  if (e) {
10752
10753
  let i = !0;
10753
10754
  return n.content.forEach((s) => {
10754
- i !== !1 && (wr(s, { ignoreWhitespace: t, checkChildren: e }) || (i = !1));
10755
+ i !== !1 && (Cr(s, { ignoreWhitespace: t, checkChildren: e }) || (i = !1));
10755
10756
  }), i;
10756
10757
  }
10757
10758
  return !1;
10758
10759
  }
10759
- function ru(n) {
10760
+ function su(n) {
10760
10761
  return n instanceof C;
10761
10762
  }
10762
- function iu({
10763
+ function ou({
10763
10764
  selection: n,
10764
10765
  pos: e,
10765
10766
  nodeSize: t,
10766
10767
  selectedOnTextSelection: r = !1
10767
10768
  }) {
10768
10769
  const { from: i, to: s } = n;
10769
- return !!(i <= e && s >= e + t || r && br(n) && i > e && s < e + t);
10770
+ return !!(i <= e && s >= e + t || r && kr(n) && i > e && s < e + t);
10770
10771
  }
10771
10772
  var So = class Mo {
10772
10773
  constructor(e) {
@@ -10797,7 +10798,7 @@ function td(n, e) {
10797
10798
  function nd(n) {
10798
10799
  return new So(n);
10799
10800
  }
10800
- function su(n, e, t) {
10801
+ function lu(n, e, t) {
10801
10802
  const i = n.state.doc.content.size, s = me(e, 0, i), o = me(t, 0, i), l = n.coordsAtPos(s), a = n.coordsAtPos(o, -1), c = Math.min(l.top, a.top), f = Math.max(l.bottom, a.bottom), d = Math.min(l.left, a.left), h = Math.max(l.right, a.right), u = h - d, p = f - c, y = {
10802
10803
  top: c,
10803
10804
  bottom: f,
@@ -10845,7 +10846,7 @@ function wo({
10845
10846
  rewrittenContent: i
10846
10847
  }) : { json: n, rewrittenContent: i };
10847
10848
  }
10848
- function ou(n, e, t) {
10849
+ function au(n, e, t) {
10849
10850
  return wo({
10850
10851
  json: n,
10851
10852
  validNodes: new Set(Object.keys(e.nodes)),
@@ -10857,7 +10858,7 @@ function rd(n, e, t) {
10857
10858
  var r;
10858
10859
  const { selection: i } = e;
10859
10860
  let s = null;
10860
- if (br(i) && (s = i.$cursor), s) {
10861
+ if (kr(i) && (s = i.$cursor), s) {
10861
10862
  const l = (r = n.storedMarks) != null ? r : s.marks();
10862
10863
  return s.parent.type.allowsMarkType(t) && (!!t.isInSet(l) || !l.some((c) => c.type.excludes(t)));
10863
10864
  }
@@ -10907,7 +10908,7 @@ var id = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
10907
10908
  }, sd = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), od = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
10908
10909
  const s = $(n, t.schema);
10909
10910
  let o;
10910
- return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => Kr(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => Kr(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
10911
+ return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => Ur(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => Ur(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
10911
10912
  }, ld = (n) => ({ tr: e, dispatch: t }) => {
10912
10913
  if (t) {
10913
10914
  const { doc: r } = e, i = me(n, 0, r.content.size), s = C.create(r, i);
@@ -10933,7 +10934,7 @@ var id = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
10933
10934
  const r = $(n, e.schema);
10934
10935
  return ta(r)(e, t);
10935
10936
  };
10936
- function Pi(n, e) {
10937
+ function zi(n, e) {
10937
10938
  const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
10938
10939
  if (t) {
10939
10940
  const r = t.filter((i) => e == null ? void 0 : e.includes(i.type.name));
@@ -10941,9 +10942,9 @@ function Pi(n, e) {
10941
10942
  }
10942
10943
  }
10943
10944
  var dd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
10944
- const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, f = Vt(c, l.node().type.name, l.node().attrs);
10945
+ const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, f = Lt(c, l.node().type.name, l.node().attrs);
10945
10946
  if (s instanceof C && s.node.isBlock)
10946
- return !l.parentOffset || !ye(o, l.pos) ? !1 : (r && (n && Pi(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
10947
+ return !l.parentOffset || !ye(o, l.pos) ? !1 : (r && (n && zi(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
10947
10948
  if (!l.parent.isBlock)
10948
10949
  return !1;
10949
10950
  const d = a.parentOffset === a.parent.content.size, h = l.depth === 0 ? void 0 : Lf(l.node(-1).contentMatchAt(l.indexAfter(-1)));
@@ -10963,7 +10964,7 @@ var dd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
10963
10964
  const m = e.mapping.map(l.before()), g = e.doc.resolve(m);
10964
10965
  l.node(-1).canReplaceWith(g.index(), g.index() + 1, h) && e.setNodeMarkup(e.mapping.map(l.before()), h);
10965
10966
  }
10966
- n && Pi(t, i.extensionManager.splittableMarks), e.scrollIntoView();
10967
+ n && zi(t, i.extensionManager.splittableMarks), e.scrollIntoView();
10967
10968
  }
10968
10969
  return p;
10969
10970
  }, ud = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: s }) => {
@@ -10987,7 +10988,7 @@ var dd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
10987
10988
  // eslint-disable-next-line no-nested-ternary
10988
10989
  a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3
10989
10990
  ), N = {
10990
- ...Vt(h, a.node().type.name, a.node().attrs),
10991
+ ...Lt(h, a.node().type.name, a.node().attrs),
10991
10992
  ...e
10992
10993
  }, T = ((o = l.contentMatch.defaultType) == null ? void 0 : o.createAndFill(N)) || void 0;
10993
10994
  y = y.append(b.from(l.createAndFill(null, T) || void 0));
@@ -11003,10 +11004,10 @@ var dd = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
11003
11004
  return !0;
11004
11005
  }
11005
11006
  const u = c.pos === a.end() ? d.contentMatchAt(0).defaultType : null, p = {
11006
- ...Vt(h, d.type.name, d.attrs),
11007
+ ...Lt(h, d.type.name, d.attrs),
11007
11008
  ...e
11008
11009
  }, m = {
11009
- ...Vt(h, a.node().type.name, a.node().attrs),
11010
+ ...Lt(h, a.node().type.name, a.node().attrs),
11010
11011
  ...e
11011
11012
  };
11012
11013
  t.delete(a.pos, c.pos);
@@ -11057,15 +11058,15 @@ var pd = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain:
11057
11058
  const T = hn((te) => An(te.type.name, d))(m), R = m.from === 0 && m.to === o.doc.content.size, w = o.doc.content.content, O = w.length === 1 ? w[0] : null, D = R && O && An(O.type.name, d) ? {
11058
11059
  node: O,
11059
11060
  pos: 0
11060
- } : null, _ = T ?? D, ot = !!T && S.depth >= 1 && S.depth - T.depth <= 1, Ie = !!D;
11061
- if ((ot || Ie) && _) {
11062
- if (_.node.type === u)
11061
+ } : null, j = T ?? D, ot = !!T && S.depth >= 1 && S.depth - T.depth <= 1, Ie = !!D;
11062
+ if ((ot || Ie) && j) {
11063
+ if (j.node.type === u)
11063
11064
  return R && Ie ? a().command(({ tr: te, dispatch: G }) => {
11064
11065
  const Y = hd(te);
11065
11066
  return Y ? (te.setSelection(Y), G && G(te), !0) : !1;
11066
11067
  }).liftListItem(p).run() : c.liftListItem(p);
11067
- if (An(_.node.type.name, d) && u.validContent(_.node.content))
11068
- return a().command(() => (s.setNodeMarkup(_.pos, u), !0)).command(() => Rn(s, u)).command(() => In(s, u)).run();
11068
+ if (An(j.node.type.name, d) && u.validContent(j.node.content))
11069
+ return a().command(() => (s.setNodeMarkup(j.pos, u), !0)).command(() => Rn(s, u)).command(() => In(s, u)).run();
11069
11070
  }
11070
11071
  return !t || !N || !l ? a().command(() => f().wrapInList(u, r) ? !0 : c.clearNodes()).wrapInList(u, r).command(() => Rn(s, u)).command(() => In(s, u)).run() : a().command(() => {
11071
11072
  const te = f().wrapInList(u, r), G = N.filter((Y) => h.includes(Y.type.name));
@@ -11075,12 +11076,12 @@ var pd = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain:
11075
11076
  const { extendEmptyMarkRange: s = !1 } = t, o = ke(n, r.schema);
11076
11077
  return Xn(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11077
11078
  }, gd = (n, e, t = {}) => ({ state: r, commands: i }) => {
11078
- const s = $(n, r.schema), o = $(e, r.schema), l = Nt(r, s, t);
11079
+ const s = $(n, r.schema), o = $(e, r.schema), l = Et(r, s, t);
11079
11080
  let a;
11080
11081
  return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), l ? i.setNode(o, a) : i.setNode(s, { ...a, ...t });
11081
11082
  }, yd = (n, e = {}) => ({ state: t, commands: r }) => {
11082
11083
  const i = $(n, t.schema);
11083
- return Nt(t, i, e) ? r.lift(i) : r.wrapIn(i, e);
11084
+ return Et(t, i, e) ? r.lift(i) : r.wrapIn(i, e);
11084
11085
  }, bd = () => ({ state: n, dispatch: e }) => {
11085
11086
  const t = n.plugins;
11086
11087
  for (let r = 0; r < t.length; r += 1) {
@@ -11113,7 +11114,7 @@ var pd = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain:
11113
11114
  return !0;
11114
11115
  if (f && o) {
11115
11116
  let { from: h, to: u } = l;
11116
- const p = (s = c.marks().find((g) => g.type === a)) == null ? void 0 : s.attrs, m = yr(c, a, p);
11117
+ const p = (s = c.marks().find((g) => g.type === a)) == null ? void 0 : s.attrs, m = br(c, a, p);
11117
11118
  m && (h = m.from, u = m.to), t.removeMark(h, u, a);
11118
11119
  } else
11119
11120
  d.forEach((h) => {
@@ -11205,13 +11206,13 @@ var pd = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain:
11205
11206
  removeAllListeners() {
11206
11207
  this.callbacks = {};
11207
11208
  }
11208
- }, Dt = class {
11209
+ }, At = class {
11209
11210
  constructor(n) {
11210
11211
  var e;
11211
11212
  this.find = n.find, this.handler = n.handler, this.undoable = (e = n.undoable) != null ? e : !0;
11212
11213
  }
11213
11214
  }, Nd = (n, e) => {
11214
- if (gr(e))
11215
+ if (yr(e))
11215
11216
  return e.exec(n);
11216
11217
  const t = e(n);
11217
11218
  if (!t)
@@ -11219,7 +11220,7 @@ var pd = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain:
11219
11220
  const r = [t.text];
11220
11221
  return r.index = t.index, r.input = n, r.data = t.data, t.replaceWith && (t.text.includes(t.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(t.replaceWith)), r;
11221
11222
  };
11222
- function Pt(n) {
11223
+ function zt(n) {
11223
11224
  var e;
11224
11225
  const { editor: t, from: r, to: i, text: s, rules: o, plugin: l } = n, { view: a } = t;
11225
11226
  if (a.composing)
@@ -11278,7 +11279,7 @@ function Ed(n) {
11278
11279
  let { text: f } = a;
11279
11280
  typeof f == "string" ? f = f : f = pn(b.from(f), o.schema);
11280
11281
  const { from: d } = a, h = d + f.length;
11281
- Pt({
11282
+ zt({
11282
11283
  editor: e,
11283
11284
  from: d,
11284
11285
  to: h,
@@ -11291,7 +11292,7 @@ function Ed(n) {
11291
11292
  },
11292
11293
  props: {
11293
11294
  handleTextInput(i, s, o, l) {
11294
- return Pt({
11295
+ return zt({
11295
11296
  editor: e,
11296
11297
  from: s,
11297
11298
  to: o,
@@ -11303,7 +11304,7 @@ function Ed(n) {
11303
11304
  handleDOMEvents: {
11304
11305
  compositionend: (i) => (setTimeout(() => {
11305
11306
  const { $cursor: s } = i.state.selection;
11306
- s && Pt({
11307
+ s && zt({
11307
11308
  editor: e,
11308
11309
  from: s.pos,
11309
11310
  to: s.pos,
@@ -11319,7 +11320,7 @@ function Ed(n) {
11319
11320
  if (s.key !== "Enter")
11320
11321
  return !1;
11321
11322
  const { $cursor: o } = i.state.selection;
11322
- return o ? Pt({
11323
+ return o ? zt({
11323
11324
  editor: e,
11324
11325
  from: o.pos,
11325
11326
  to: o.pos,
@@ -11338,16 +11339,16 @@ function Ed(n) {
11338
11339
  function Od(n) {
11339
11340
  return Object.prototype.toString.call(n).slice(8, -1);
11340
11341
  }
11341
- function zt(n) {
11342
+ function Bt(n) {
11342
11343
  return Od(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
11343
11344
  }
11344
11345
  function Co(n, e) {
11345
11346
  const t = { ...n };
11346
- return zt(n) && zt(e) && Object.keys(e).forEach((r) => {
11347
- zt(e[r]) && zt(n[r]) ? t[r] = Co(n[r], e[r]) : t[r] = e[r];
11347
+ return Bt(n) && Bt(e) && Object.keys(e).forEach((r) => {
11348
+ Bt(e[r]) && Bt(n[r]) ? t[r] = Co(n[r], e[r]) : t[r] = e[r];
11348
11349
  }), t;
11349
11350
  }
11350
- var Cr = class {
11351
+ var Tr = class {
11351
11352
  constructor(n = {}) {
11352
11353
  this.type = "extendable", this.parent = null, this.child = null, this.name = "", this.config = {
11353
11354
  name: this.name
@@ -11386,7 +11387,7 @@ var Cr = class {
11386
11387
  const e = new this.constructor({ ...this.config, ...n });
11387
11388
  return e.parent = this, this.child = e, e.name = "name" in n ? n.name : e.parent.name, e;
11388
11389
  }
11389
- }, vd = class To extends Cr {
11390
+ }, vd = class To extends Tr {
11390
11391
  constructor() {
11391
11392
  super(...arguments), this.type = "mark";
11392
11393
  }
@@ -11420,12 +11421,12 @@ var Cr = class {
11420
11421
  function Dd(n) {
11421
11422
  return typeof n == "number";
11422
11423
  }
11423
- var Tr = class {
11424
+ var Nr = class {
11424
11425
  constructor(n) {
11425
11426
  this.find = n.find, this.handler = n.handler;
11426
11427
  }
11427
11428
  }, Ad = (n, e, t) => {
11428
- if (gr(e))
11429
+ if (yr(e))
11429
11430
  return [...n.matchAll(e)];
11430
11431
  const r = e(n, t);
11431
11432
  return r ? r.map((i) => {
@@ -11449,8 +11450,8 @@ function Rd(n) {
11449
11450
  Ad(w, s.find, o).forEach((D) => {
11450
11451
  if (D.index === void 0)
11451
11452
  return;
11452
- const _ = T + D.index + 1, ot = _ + D[0].length, Ie = {
11453
- from: t.tr.mapping.map(_),
11453
+ const j = T + D.index + 1, ot = j + D[0].length, Ie = {
11454
+ from: t.tr.mapping.map(j),
11454
11455
  to: t.tr.mapping.map(ot)
11455
11456
  }, te = s.handler({
11456
11457
  state: t,
@@ -11466,7 +11467,7 @@ function Rd(n) {
11466
11467
  });
11467
11468
  }), d.every((u) => u !== null);
11468
11469
  }
11469
- var Bt = null, Id = (n) => {
11470
+ var Ft = null, Id = (n) => {
11470
11471
  var e;
11471
11472
  const t = new ClipboardEvent("paste", {
11472
11473
  clipboardData: new DataTransfer()
@@ -11514,9 +11515,9 @@ function Pd(n) {
11514
11515
  view(d) {
11515
11516
  const h = (p) => {
11516
11517
  var m;
11517
- r = (m = d.dom.parentElement) != null && m.contains(p.target) ? d.dom.parentElement : null, r && (Bt = e);
11518
+ r = (m = d.dom.parentElement) != null && m.contains(p.target) ? d.dom.parentElement : null, r && (Ft = e);
11518
11519
  }, u = () => {
11519
- Bt && (Bt = null);
11520
+ Ft && (Ft = null);
11520
11521
  };
11521
11522
  return window.addEventListener("dragstart", h), window.addEventListener("dragend", u), {
11522
11523
  destroy() {
@@ -11528,7 +11529,7 @@ function Pd(n) {
11528
11529
  handleDOMEvents: {
11529
11530
  drop: (d, h) => {
11530
11531
  if (s = r === d.dom.parentElement, l = h, !s) {
11531
- const u = Bt;
11532
+ const u = Ft;
11532
11533
  u != null && u.isEditable && setTimeout(() => {
11533
11534
  const p = u.state.selection;
11534
11535
  p && u.commands.deleteRange({ from: p.from, to: p.to });
@@ -11573,7 +11574,7 @@ function Pd(n) {
11573
11574
  }
11574
11575
  var mn = class {
11575
11576
  constructor(n, e) {
11576
- this.splittableMarks = [], this.editor = e, this.baseExtensions = n, this.extensions = xr(n), this.schema = yo(this.extensions, e), this.setupExtensions();
11577
+ this.splittableMarks = [], this.editor = e, this.baseExtensions = n, this.extensions = Sr(n), this.schema = yo(this.extensions, e), this.setupExtensions();
11577
11578
  }
11578
11579
  /**
11579
11580
  * Get all commands from the extensions.
@@ -11619,10 +11620,10 @@ var mn = class {
11619
11620
  );
11620
11621
  l = { ...l, ...h };
11621
11622
  }
11622
- const a = jc(l);
11623
+ const a = _c(l);
11623
11624
  s.push(a);
11624
11625
  const c = M(r, "addInputRules", i);
11625
- if (Ii(r, n.options.enableInputRules) && c) {
11626
+ if (Pi(r, n.options.enableInputRules) && c) {
11626
11627
  const h = c();
11627
11628
  if (h && h.length) {
11628
11629
  const u = Ed({
@@ -11633,7 +11634,7 @@ var mn = class {
11633
11634
  }
11634
11635
  }
11635
11636
  const f = M(r, "addPasteRules", i);
11636
- if (Ii(r, n.options.enablePasteRules) && f) {
11637
+ if (Pi(r, n.options.enablePasteRules) && f) {
11637
11638
  const h = f();
11638
11639
  if (h && h.length) {
11639
11640
  const u = Pd({ editor: n, rules: h });
@@ -11810,11 +11811,11 @@ var mn = class {
11810
11811
  });
11811
11812
  }
11812
11813
  };
11813
- mn.resolve = xr;
11814
+ mn.resolve = Sr;
11814
11815
  mn.sort = bt;
11815
- mn.flatten = kr;
11816
+ mn.flatten = xr;
11816
11817
  var zd = {};
11817
- mr(zd, {
11818
+ gr(zd, {
11818
11819
  ClipboardTextSerializer: () => Eo,
11819
11820
  Commands: () => Oo,
11820
11821
  Delete: () => vo,
@@ -11827,7 +11828,7 @@ mr(zd, {
11827
11828
  TextDirection: () => Fo,
11828
11829
  focusEventsPluginKey: () => Ro
11829
11830
  });
11830
- var de = class No extends Cr {
11831
+ var de = class No extends Tr {
11831
11832
  constructor() {
11832
11833
  super(...arguments), this.type = "extension";
11833
11834
  }
@@ -11859,7 +11860,7 @@ var de = class No extends Cr {
11859
11860
  key: new Ae("clipboardTextSerializer"),
11860
11861
  props: {
11861
11862
  clipboardTextSerializer: () => {
11862
- const { editor: n } = this, { state: e, schema: t } = n, { doc: r, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((f) => f.$from.pos)), l = Math.max(...s.map((f) => f.$to.pos)), a = Mr(t);
11863
+ const { editor: n } = this, { state: e, schema: t } = n, { doc: r, selection: i } = e, { ranges: s } = i, o = Math.min(...s.map((f) => f.$from.pos)), l = Math.max(...s.map((f) => f.$to.pos)), a = wr(t);
11863
11864
  return bo(r, { from: o, to: l }, {
11864
11865
  ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
11865
11866
  textSerializers: a
@@ -12050,7 +12051,7 @@ var de = class No extends Cr {
12050
12051
  if (!r || i)
12051
12052
  return;
12052
12053
  const { empty: s, from: o, to: l } = e.selection, a = v.atStart(e.doc).from, c = v.atEnd(e.doc).to;
12053
- if (s || !(o === a && l === c) || !wr(t.doc))
12054
+ if (s || !(o === a && l === c) || !Cr(t.doc))
12054
12055
  return;
12055
12056
  const h = t.tr, u = fn({
12056
12057
  state: t,
@@ -12342,7 +12343,7 @@ function $d(n, e, t) {
12342
12343
  const i = document.createElement("style");
12343
12344
  return e && i.setAttribute("nonce", e), i.setAttribute(`data-tiptap-style${t ? `-${t}` : ""}`, ""), i.innerHTML = n, document.getElementsByTagName("head")[0].appendChild(i), i;
12344
12345
  }
12345
- var lu = class extends Td {
12346
+ var cu = class extends Td {
12346
12347
  constructor(n = {}) {
12347
12348
  super(), this.css = null, this.className = "tiptap", this.editorView = null, this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.options = {
12348
12349
  element: typeof document < "u" ? document.createElement("div") : null,
@@ -12731,7 +12732,7 @@ var lu = class extends Td {
12731
12732
  return ko(this.state.doc, {
12732
12733
  blockSeparator: e,
12733
12734
  textSerializers: {
12734
- ...Mr(this.schema),
12735
+ ...wr(this.schema),
12735
12736
  ...t
12736
12737
  }
12737
12738
  });
@@ -12740,7 +12741,7 @@ var lu = class extends Td {
12740
12741
  * Check if there is no content.
12741
12742
  */
12742
12743
  get isEmpty() {
12743
- return wr(this.state.doc);
12744
+ return Cr(this.state.doc);
12744
12745
  }
12745
12746
  /**
12746
12747
  * Destroy the editor.
@@ -12771,8 +12772,8 @@ var lu = class extends Td {
12771
12772
  return this.$pos(0);
12772
12773
  }
12773
12774
  };
12774
- function au(n) {
12775
- return new Dt({
12775
+ function fu(n) {
12776
+ return new At({
12776
12777
  find: n.find,
12777
12778
  handler: ({ state: e, range: t, match: r }) => {
12778
12779
  const i = A(n.getAttributes, void 0, r);
@@ -12791,8 +12792,8 @@ function au(n) {
12791
12792
  undoable: n.undoable
12792
12793
  });
12793
12794
  }
12794
- function cu(n) {
12795
- return new Dt({
12795
+ function du(n) {
12796
+ return new At({
12796
12797
  find: n.find,
12797
12798
  handler: ({ state: e, range: t, match: r }) => {
12798
12799
  const i = A(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
@@ -12813,8 +12814,8 @@ function cu(n) {
12813
12814
  undoable: n.undoable
12814
12815
  });
12815
12816
  }
12816
- function fu(n) {
12817
- return new Dt({
12817
+ function uu(n) {
12818
+ return new At({
12818
12819
  find: n.find,
12819
12820
  handler: ({ state: e, range: t, match: r }) => {
12820
12821
  const i = e.doc.resolve(t.from), s = A(n.getAttributes, void 0, r) || {};
@@ -12825,8 +12826,8 @@ function fu(n) {
12825
12826
  undoable: n.undoable
12826
12827
  });
12827
12828
  }
12828
- function du(n) {
12829
- return new Dt({
12829
+ function hu(n) {
12830
+ return new At({
12830
12831
  find: n.find,
12831
12832
  handler: ({ state: e, range: t, match: r }) => {
12832
12833
  let i = n.replace, s = t.from;
@@ -12842,8 +12843,8 @@ function du(n) {
12842
12843
  undoable: n.undoable
12843
12844
  });
12844
12845
  }
12845
- function uu(n) {
12846
- return new Dt({
12846
+ function pu(n) {
12847
+ return new At({
12847
12848
  find: n.find,
12848
12849
  handler: ({ state: e, range: t, match: r, chain: i }) => {
12849
12850
  const s = A(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && Zn(a, n.type, s);
@@ -12866,10 +12867,10 @@ function uu(n) {
12866
12867
  undoable: n.undoable
12867
12868
  });
12868
12869
  }
12869
- function hu(n) {
12870
+ function mu(n) {
12870
12871
  return n.children;
12871
12872
  }
12872
- var pu = (n, e) => {
12873
+ var gu = (n, e) => {
12873
12874
  if (n === "slot")
12874
12875
  return 0;
12875
12876
  if (n instanceof Function)
@@ -13145,8 +13146,8 @@ var pu = (n, e) => {
13145
13146
  height: n / this.aspectRatio
13146
13147
  };
13147
13148
  }
13148
- }, mu = Ld;
13149
- function gu(n, e) {
13149
+ }, yu = Ld;
13150
+ function bu(n, e) {
13150
13151
  const { selection: t } = n, { $from: r } = t;
13151
13152
  if (t instanceof C) {
13152
13153
  const s = r.index();
@@ -13161,32 +13162,32 @@ function gu(n, e) {
13161
13162
  }
13162
13163
  return !1;
13163
13164
  }
13164
- function yu(n) {
13165
+ function ku(n) {
13165
13166
  return n.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
13166
13167
  }
13167
- function bu(n) {
13168
+ function xu(n) {
13168
13169
  return n.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&amp;/g, "&");
13169
13170
  }
13170
- function ku(n) {
13171
+ function Su(n) {
13171
13172
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
13172
13173
  }
13173
- function xu() {
13174
+ function Mu() {
13174
13175
  return typeof navigator < "u" ? /Firefox/.test(navigator.userAgent) : !1;
13175
13176
  }
13176
- function Su(n) {
13177
+ function wu(n) {
13177
13178
  return typeof n == "string";
13178
13179
  }
13179
13180
  var Wd = {};
13180
- mr(Wd, {
13181
+ gr(Wd, {
13181
13182
  createAtomBlockMarkdownSpec: () => Hd,
13182
13183
  createBlockMarkdownSpec: () => Jd,
13183
- createInlineMarkdownSpec: () => _d,
13184
- parseAttributes: () => Nr,
13184
+ createInlineMarkdownSpec: () => jd,
13185
+ parseAttributes: () => Er,
13185
13186
  parseIndentedBlocks: () => Kd,
13186
13187
  renderNestedMarkdownContent: () => Ud,
13187
- serializeAttributes: () => Er
13188
+ serializeAttributes: () => Or
13188
13189
  });
13189
- function Nr(n) {
13190
+ function Er(n) {
13190
13191
  if (!(n != null && n.trim()))
13191
13192
  return {};
13192
13193
  const e = {}, t = [], r = n.replace(/["']([^"']*)["']/g, (c) => (t.push(c), `__QUOTED_${t.length - 1}__`)), i = r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);
@@ -13207,7 +13208,7 @@ function Nr(n) {
13207
13208
  f.match(/^[a-zA-Z][\w-]*$/) && (e[f] = !0);
13208
13209
  }), e;
13209
13210
  }
13210
- function Er(n) {
13211
+ function Or(n) {
13211
13212
  if (!n || Object.keys(n).length === 0)
13212
13213
  return "";
13213
13214
  const e = [];
@@ -13219,8 +13220,8 @@ function Hd(n) {
13219
13220
  const {
13220
13221
  nodeName: e,
13221
13222
  name: t,
13222
- parseAttributes: r = Nr,
13223
- serializeAttributes: i = Er,
13223
+ parseAttributes: r = Er,
13224
+ serializeAttributes: i = Or,
13224
13225
  defaultAttributes: s = {},
13225
13226
  requiredAttributes: o = [],
13226
13227
  allowedAttributes: l
@@ -13269,8 +13270,8 @@ function Jd(n) {
13269
13270
  nodeName: e,
13270
13271
  name: t,
13271
13272
  getContent: r,
13272
- parseAttributes: i = Nr,
13273
- serializeAttributes: s = Er,
13273
+ parseAttributes: i = Er,
13274
+ serializeAttributes: s = Or,
13274
13275
  defaultAttributes: o = {},
13275
13276
  content: l = "block",
13276
13277
  allowedAttributes: a
@@ -13314,14 +13315,14 @@ function Jd(n) {
13314
13315
  const D = w.exec(O);
13315
13316
  if (D === null)
13316
13317
  break;
13317
- const _ = D.index, ot = D[1];
13318
+ const j = D.index, ot = D[1];
13318
13319
  if (!((p = D[2]) != null && p.endsWith(":::"))) {
13319
13320
  if (ot)
13320
13321
  N += 1;
13321
13322
  else if (N -= 1, N === 0) {
13322
- const Ie = O.slice(0, _);
13323
+ const Ie = O.slice(0, j);
13323
13324
  R = Ie.trim();
13324
- const te = d.slice(0, T + _ + D[0].length);
13325
+ const te = d.slice(0, T + j + D[0].length);
13325
13326
  let G = [];
13326
13327
  if (R)
13327
13328
  if (l === "block")
@@ -13371,16 +13372,16 @@ function qd(n) {
13371
13372
  }
13372
13373
  return e;
13373
13374
  }
13374
- function jd(n) {
13375
+ function _d(n) {
13375
13376
  return Object.entries(n).filter(([, e]) => e != null).map(([e, t]) => `${e}="${t}"`).join(" ");
13376
13377
  }
13377
- function _d(n) {
13378
+ function jd(n) {
13378
13379
  const {
13379
13380
  nodeName: e,
13380
13381
  name: t,
13381
13382
  getContent: r,
13382
13383
  parseAttributes: i = qd,
13383
- serializeAttributes: s = jd,
13384
+ serializeAttributes: s = _d,
13384
13385
  defaultAttributes: o = {},
13385
13386
  selfClosing: l = !1,
13386
13387
  allowedAttributes: a
@@ -13467,7 +13468,7 @@ function Kd(n, e, t) {
13467
13468
  for (f += 1; f < l.length; ) {
13468
13469
  const T = l[f];
13469
13470
  if (T.trim() === "") {
13470
- const w = l.slice(f + 1).findIndex((_) => _.trim() !== "");
13471
+ const w = l.slice(f + 1).findIndex((j) => j.trim() !== "");
13471
13472
  if (w === -1)
13472
13473
  break;
13473
13474
  if ((((i = (r = l[f + 1 + w].match(/^(\s*)/)) == null ? void 0 : r[1]) == null ? void 0 : i.length) || 0) > m) {
@@ -13519,7 +13520,7 @@ ${p}`;
13519
13520
  }), a;
13520
13521
  }
13521
13522
  var tn = /* @__PURE__ */ new WeakMap();
13522
- function Mu(n, e) {
13523
+ function Cu(n, e) {
13523
13524
  let t = tn.get(n);
13524
13525
  if (!t) {
13525
13526
  const r = {
@@ -13535,7 +13536,7 @@ function Mu(n, e) {
13535
13536
  }
13536
13537
  t.callbacks.add(e);
13537
13538
  }
13538
- function wu(n, e) {
13539
+ function Tu(n, e) {
13539
13540
  const t = tn.get(n);
13540
13541
  t && (t.callbacks.delete(e), t.callbacks.size === 0 && (t.rafId !== null && cancelAnimationFrame(t.rafId), n.off("update", t.handler), tn.delete(n)));
13541
13542
  }
@@ -13562,7 +13563,7 @@ function $o(n, e, t = {}) {
13562
13563
  }
13563
13564
  }), s.docChanged && e.view.dispatch(s);
13564
13565
  }
13565
- var Cu = class {
13566
+ var Nu = class {
13566
13567
  constructor(n, e, t) {
13567
13568
  this.component = n, this.editor = e.editor, this.options = { ...t }, this.mark = e.mark, this.HTMLAttributes = e.HTMLAttributes;
13568
13569
  }
@@ -13582,7 +13583,7 @@ var Cu = class {
13582
13583
  ignoreMutation(n) {
13583
13584
  return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: n }) : n.type === "selection" || this.dom.contains(n.target) && n.type === "childList" && (rt() || Zt()) && this.editor.isFocused && [...Array.from(n.addedNodes), ...Array.from(n.removedNodes)].every((t) => t.isContentEditable) ? !1 : this.contentDOM === n.target && n.type === "attributes" ? !0 : !this.contentDOM.contains(n.target);
13584
13585
  }
13585
- }, Tu = class Vo extends Cr {
13586
+ }, Eu = class Vo extends Tr {
13586
13587
  constructor() {
13587
13588
  super(...arguments), this.type = "node";
13588
13589
  }
@@ -13601,7 +13602,7 @@ var Cu = class {
13601
13602
  const t = typeof e == "function" ? e() : e;
13602
13603
  return super.extend(t);
13603
13604
  }
13604
- }, Nu = class {
13605
+ }, Ou = class {
13605
13606
  constructor(n, e, t) {
13606
13607
  this.isDragging = !1, this.component = n, this.editor = e.editor, this.options = {
13607
13608
  stopEvent: null,
@@ -13720,8 +13721,8 @@ var Cu = class {
13720
13721
  this.editor.commands.deleteRange({ from: n, to: e });
13721
13722
  }
13722
13723
  };
13723
- function Eu(n) {
13724
- return new Tr({
13724
+ function vu(n) {
13725
+ return new Nr({
13725
13726
  find: n.find,
13726
13727
  handler: ({ state: e, range: t, match: r, pasteEvent: i }) => {
13727
13728
  const s = A(n.getAttributes, void 0, r, i);
@@ -13738,8 +13739,8 @@ function Eu(n) {
13738
13739
  }
13739
13740
  });
13740
13741
  }
13741
- function Ou(n) {
13742
- return new Tr({
13742
+ function Du(n) {
13743
+ return new Nr({
13743
13744
  find: n.find,
13744
13745
  handler({ match: e, chain: t, range: r, pasteEvent: i }) {
13745
13746
  const s = A(n.getAttributes, void 0, e, i), o = A(n.getContent, void 0, s);
@@ -13750,8 +13751,8 @@ function Ou(n) {
13750
13751
  }
13751
13752
  });
13752
13753
  }
13753
- function vu(n) {
13754
- return new Tr({
13754
+ function Au(n) {
13755
+ return new Nr({
13755
13756
  find: n.find,
13756
13757
  handler: ({ state: e, range: t, match: r }) => {
13757
13758
  let i = n.replace, s = t.from;
@@ -13766,7 +13767,7 @@ function vu(n) {
13766
13767
  }
13767
13768
  });
13768
13769
  }
13769
- var Du = class {
13770
+ var Ru = class {
13770
13771
  constructor(n) {
13771
13772
  this.transaction = n, this.currentStep = this.transaction.steps.length;
13772
13773
  }
@@ -13783,143 +13784,158 @@ var Du = class {
13783
13784
  };
13784
13785
  export {
13785
13786
  po as $,
13786
- yu as A,
13787
+ ku as A,
13787
13788
  zd as B,
13788
13789
  dn as C,
13789
- Yd as D,
13790
- lu as E,
13791
- hu as F,
13792
- Xd as G,
13793
- _f as H,
13794
- Dt as I,
13790
+ Gd as D,
13791
+ cu as E,
13792
+ mu as F,
13793
+ Qd as G,
13794
+ jf as H,
13795
+ At as I,
13795
13796
  hn as J,
13796
13797
  Wf as K,
13797
- kr as L,
13798
+ xr as L,
13798
13799
  So as M,
13799
- Tu as N,
13800
- jf as O,
13801
- Tr as P,
13802
- Gd as Q,
13800
+ Eu as N,
13801
+ _f as O,
13802
+ Nr as P,
13803
+ Zd as Q,
13803
13804
  Ld as R,
13804
- Qd as S,
13805
- Du as T,
13806
- Zd as U,
13805
+ eu as S,
13806
+ Ru as T,
13807
+ tu as U,
13807
13808
  Uf as V,
13808
13809
  go as W,
13809
13810
  Gf as X,
13810
13811
  Qf as Y,
13811
13812
  M as Z,
13812
13813
  pn as _,
13813
- Cr as a,
13814
+ Tr as a,
13814
13815
  it as a$,
13815
- yr as a0,
13816
+ br as a0,
13816
13817
  ke as a1,
13817
13818
  xo as a2,
13818
- eu as a3,
13819
+ nu as a3,
13819
13820
  Kf as a4,
13820
13821
  $ as a5,
13821
13822
  en as a6,
13822
- Sr as a7,
13823
+ Mr as a7,
13823
13824
  yo as a8,
13824
13825
  at as a9,
13825
- gr as aA,
13826
+ yr as aA,
13826
13827
  cf as aB,
13827
- Su as aC,
13828
- br as aD,
13828
+ wu as aC,
13829
+ kr as aD,
13829
13830
  rt as aE,
13830
- au as aF,
13831
- Eu as aG,
13831
+ fu as aF,
13832
+ vu as aG,
13832
13833
  Wd as aH,
13833
13834
  qf as aI,
13834
13835
  Co as aJ,
13835
13836
  me as aK,
13836
- cu as aL,
13837
- Ou as aM,
13837
+ du as aL,
13838
+ Du as aM,
13838
13839
  Qt as aN,
13839
- Nr as aO,
13840
+ Er as aO,
13840
13841
  Kd as aP,
13841
13842
  Pd as aQ,
13842
- su as aR,
13843
+ lu as aR,
13843
13844
  Yf as aS,
13844
13845
  Ud as aT,
13845
- xr as aU,
13846
+ Sr as aU,
13846
13847
  fo as aV,
13847
- ou as aW,
13848
- Mu as aX,
13848
+ au as aW,
13849
+ Cu as aX,
13849
13850
  hf as aY,
13850
- Er as aZ,
13851
+ Or as aZ,
13851
13852
  bt as a_,
13852
13853
  un as aa,
13853
- Vt as ab,
13854
+ Lt as ab,
13854
13855
  ko as ac,
13855
13856
  bo as ad,
13856
13857
  Zf as ae,
13857
- Mr as af,
13858
+ wr as af,
13858
13859
  td as ag,
13859
- Di as ah,
13860
+ Ai as ah,
13860
13861
  Ed as ai,
13861
13862
  ed as aj,
13862
13863
  Zt as ak,
13863
- tu as al,
13864
- nu as am,
13864
+ ru as al,
13865
+ iu as am,
13865
13866
  Hf as an,
13866
- Ii as ao,
13867
- xu as ap,
13867
+ Pi as ao,
13868
+ Mu as ap,
13868
13869
  mo as aq,
13869
13870
  An as ar,
13870
13871
  ho as as,
13871
13872
  Xn as at,
13872
- Nt as au,
13873
- wr as av,
13874
- ru as aw,
13875
- iu as ax,
13873
+ Et as au,
13874
+ Cr as av,
13875
+ su as aw,
13876
+ ou as ax,
13876
13877
  Dd as ay,
13877
- zt as az,
13878
+ Bt as az,
13878
13879
  de as b,
13879
- du as b0,
13880
- vu as b1,
13881
- fu as b2,
13880
+ hu as b0,
13881
+ Au as b1,
13882
+ uu as b2,
13882
13883
  $o as b3,
13883
- uu as b4,
13884
+ pu as b4,
13884
13885
  Ae as b5,
13885
13886
  ae as b6,
13886
13887
  B as b7,
13887
13888
  le as b8,
13888
13889
  Z as b9,
13890
+ Yd as bA,
13889
13891
  v as ba,
13890
- _c as bb,
13892
+ jc as bb,
13891
13893
  Rl as bc,
13892
13894
  E as bd,
13893
13895
  b as be,
13894
13896
  k as bf,
13895
13897
  C as bg,
13896
- us as bh,
13898
+ hs as bh,
13897
13899
  Tl as bi,
13898
13900
  jt as bj,
13899
- Jt as bk,
13901
+ qt as bk,
13900
13902
  st as bl,
13903
+ ee as bm,
13904
+ We as bn,
13905
+ ge as bo,
13906
+ _e as bp,
13907
+ Xe as bq,
13908
+ lo as br,
13909
+ I as bs,
13910
+ nn as bt,
13911
+ Rr as bu,
13912
+ Ht as bv,
13913
+ kt as bw,
13914
+ Gi as bx,
13915
+ Pl as by,
13916
+ Xd as bz,
13901
13917
  vd as c,
13902
- Cu as d,
13918
+ Nu as d,
13903
13919
  Bd as e,
13904
- Nu as f,
13905
- mu as g,
13920
+ Ou as f,
13921
+ yu as g,
13906
13922
  A as h,
13907
- gu as i,
13908
- wu as j,
13923
+ bu as i,
13924
+ Tu as j,
13909
13925
  Vf as k,
13910
13926
  ao as l,
13911
13927
  Hd as m,
13912
13928
  Jd as n,
13913
13929
  fn as o,
13914
13930
  Yn as p,
13915
- pu as q,
13916
- _d as r,
13931
+ gu as q,
13932
+ jd as r,
13917
13933
  nd as s,
13918
- Tt as t,
13934
+ Nt as t,
13919
13935
  $d as u,
13920
- bu as v,
13936
+ xu as v,
13921
13937
  Lf as w,
13922
- Oi as x,
13938
+ vi as x,
13923
13939
  ut as y,
13924
- ku as z
13940
+ Su as z
13925
13941
  };