@jinntec/jinntap 1.14.0 → 1.15.0

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 (2) hide show
  1. package/dist/jinn-tap.es.js +518 -488
  2. package/package.json +2 -1
@@ -428,7 +428,7 @@ function tr(n, e) {
428
428
  }
429
429
  return !0;
430
430
  }
431
- let R = class Ns {
431
+ let z = class Ns {
432
432
  /**
433
433
  @internal
434
434
  */
@@ -533,7 +533,7 @@ let R = class Ns {
533
533
  return t.sort((i, r) => i.type.rank - r.type.rank), t;
534
534
  }
535
535
  };
536
- R.none = [];
536
+ z.none = [];
537
537
  class nr extends Error {
538
538
  }
539
539
  class v {
@@ -650,12 +650,12 @@ function Oc(n, e, t, i) {
650
650
  } else if (t.content.size)
651
651
  if (!t.openStart && !t.openEnd && n.depth == i && e.depth == i) {
652
652
  let o = n.parent, a = o.content;
653
- return zt(o, a.cut(0, n.parentOffset).append(t.content).append(a.cut(e.parentOffset)));
653
+ return Rt(o, a.cut(0, n.parentOffset).append(t.content).append(a.cut(e.parentOffset)));
654
654
  } else {
655
655
  let { start: o, end: a } = qh(t, n);
656
- return zt(s, Nc(n, o, a, e, i));
656
+ return Rt(s, Nc(n, o, a, e, i));
657
657
  }
658
- else return zt(s, ir(n, e, i));
658
+ else return Rt(s, ir(n, e, i));
659
659
  }
660
660
  function Dc(n, e) {
661
661
  if (!e.type.compatibleContent(n.type))
@@ -676,18 +676,18 @@ function Ln(n, e, t, i) {
676
676
  Pt(r.child(a), i);
677
677
  e && e.depth == t && e.textOffset && Pt(e.nodeBefore, i);
678
678
  }
679
- function zt(n, e) {
679
+ function Rt(n, e) {
680
680
  return n.type.checkContent(e), n.copy(e);
681
681
  }
682
682
  function Nc(n, e, t, i, r) {
683
683
  let s = n.depth > r && Is(n, e, r + 1), o = i.depth > r && Is(t, i, r + 1), a = [];
684
- return Ln(null, n, r, a), s && o && e.index(r) == t.index(r) ? (Dc(s, o), Pt(zt(s, Nc(n, e, t, i, r + 1)), a)) : (s && Pt(zt(s, ir(n, e, r + 1)), a), Ln(e, t, r, a), o && Pt(zt(o, ir(t, i, r + 1)), a)), Ln(i, null, r, a), new y(a);
684
+ return Ln(null, n, r, a), s && o && e.index(r) == t.index(r) ? (Dc(s, o), Pt(Rt(s, Nc(n, e, t, i, r + 1)), a)) : (s && Pt(Rt(s, ir(n, e, r + 1)), a), Ln(e, t, r, a), o && Pt(Rt(o, ir(t, i, r + 1)), a)), Ln(i, null, r, a), new y(a);
685
685
  }
686
686
  function ir(n, e, t) {
687
687
  let i = [];
688
688
  if (Ln(null, n, t, i), n.depth > t) {
689
689
  let r = Is(n, e, t + 1);
690
- Pt(zt(r, ir(n, e, t + 1)), i);
690
+ Pt(Rt(r, ir(n, e, t + 1)), i);
691
691
  }
692
692
  return Ln(e, null, t, i), new y(i);
693
693
  }
@@ -831,7 +831,7 @@ class Gn {
831
831
  marks() {
832
832
  let e = this.parent, t = this.index();
833
833
  if (e.content.size == 0)
834
- return R.none;
834
+ return z.none;
835
835
  if (this.textOffset)
836
836
  return e.child(t).marks;
837
837
  let i = e.maybeChild(t - 1), r = e.maybeChild(t);
@@ -998,7 +998,7 @@ let mt = class Ps {
998
998
  /**
999
999
  @internal
1000
1000
  */
1001
- constructor(e, t, i, r = R.none) {
1001
+ constructor(e, t, i, r = z.none) {
1002
1002
  this.type = e, this.attrs = t, this.marks = r, this.content = i || y.empty;
1003
1003
  }
1004
1004
  /**
@@ -1112,7 +1112,7 @@ let mt = class Ps {
1112
1112
  attributes, and marks.
1113
1113
  */
1114
1114
  hasMarkup(e, t, i) {
1115
- return this.type == e && tr(this.attrs, t || e.defaultAttrs || Wh) && R.sameSet(this.marks, i || R.none);
1115
+ return this.type == e && tr(this.attrs, t || e.defaultAttrs || Wh) && z.sameSet(this.marks, i || z.none);
1116
1116
  }
1117
1117
  /**
1118
1118
  Create a new node with the same markup as this node, containing
@@ -1322,12 +1322,12 @@ let mt = class Ps {
1322
1322
  */
1323
1323
  check() {
1324
1324
  this.type.checkContent(this.content), this.type.checkAttrs(this.attrs);
1325
- let e = R.none;
1325
+ let e = z.none;
1326
1326
  for (let t = 0; t < this.marks.length; t++) {
1327
1327
  let i = this.marks[t];
1328
1328
  i.type.checkAttrs(i.attrs), e = i.addToSet(e);
1329
1329
  }
1330
- if (!R.sameSet(e, this.marks))
1330
+ if (!z.sameSet(e, this.marks))
1331
1331
  throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((t) => t.type.name)}`);
1332
1332
  this.content.forEach((t) => t.check());
1333
1333
  }
@@ -1698,12 +1698,12 @@ function Zh(n) {
1698
1698
  }
1699
1699
  }
1700
1700
  }
1701
- function zc(n, e) {
1701
+ function Rc(n, e) {
1702
1702
  return e - n;
1703
1703
  }
1704
1704
  function Ta(n, e) {
1705
1705
  let t = [];
1706
- return i(e), t.sort(zc);
1706
+ return i(e), t.sort(Rc);
1707
1707
  function i(r) {
1708
1708
  let s = n[r];
1709
1709
  if (s.length == 1 && !s[0].term)
@@ -1734,7 +1734,7 @@ function ep(n) {
1734
1734
  });
1735
1735
  let s = e[i.join(",")] = new $t(i.indexOf(n.length - 1) > -1);
1736
1736
  for (let o = 0; o < r.length; o++) {
1737
- let a = r[o][1].sort(zc);
1737
+ let a = r[o][1].sort(Rc);
1738
1738
  s.next.push({ type: r[o][0], next: e[a.join(",")] || t(a) });
1739
1739
  }
1740
1740
  return s;
@@ -1750,7 +1750,7 @@ function tp(n, e) {
1750
1750
  s && e.err("Only non-generatable nodes (" + o.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
1751
1751
  }
1752
1752
  }
1753
- function Rc(n) {
1753
+ function zc(n) {
1754
1754
  let e = /* @__PURE__ */ Object.create(null);
1755
1755
  for (let t in n) {
1756
1756
  let i = n[t];
@@ -1784,19 +1784,19 @@ function Lc(n, e, t, i) {
1784
1784
  s.validate && s.validate(e[r]);
1785
1785
  }
1786
1786
  }
1787
- function Bc(n, e) {
1787
+ function jc(n, e) {
1788
1788
  let t = /* @__PURE__ */ Object.create(null);
1789
1789
  if (e)
1790
1790
  for (let i in e)
1791
1791
  t[i] = new ip(n, i, e[i]);
1792
1792
  return t;
1793
1793
  }
1794
- let Aa = class jc {
1794
+ let Aa = class Bc {
1795
1795
  /**
1796
1796
  @internal
1797
1797
  */
1798
1798
  constructor(e, t, i) {
1799
- this.name = e, this.schema = t, this.spec = i, this.markSet = null, this.groups = i.group ? i.group.split(" ") : [], this.attrs = Bc(e, i.attrs), this.defaultAttrs = Rc(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(i.inline || e == "text"), this.isText = e == "text";
1799
+ this.name = e, this.schema = t, this.spec = i, this.markSet = null, this.groups = i.group ? i.group.split(" ") : [], this.attrs = jc(e, i.attrs), this.defaultAttrs = zc(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(i.inline || e == "text"), this.isText = e == "text";
1800
1800
  }
1801
1801
  /**
1802
1802
  True if this is an inline type.
@@ -1870,7 +1870,7 @@ let Aa = class jc {
1870
1870
  create(e = null, t, i) {
1871
1871
  if (this.isText)
1872
1872
  throw new Error("NodeType.create can't construct text nodes");
1873
- return new mt(this, this.computeAttrs(e), y.from(t), R.setFrom(i));
1873
+ return new mt(this, this.computeAttrs(e), y.from(t), z.setFrom(i));
1874
1874
  }
1875
1875
  /**
1876
1876
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
@@ -1878,7 +1878,7 @@ let Aa = class jc {
1878
1878
  if it doesn't match.
1879
1879
  */
1880
1880
  createChecked(e = null, t, i) {
1881
- return t = y.from(t), this.checkContent(t), new mt(this, this.computeAttrs(e), t, R.setFrom(i));
1881
+ return t = y.from(t), this.checkContent(t), new mt(this, this.computeAttrs(e), t, z.setFrom(i));
1882
1882
  }
1883
1883
  /**
1884
1884
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
@@ -1896,7 +1896,7 @@ let Aa = class jc {
1896
1896
  t = o.append(t);
1897
1897
  }
1898
1898
  let r = this.contentMatch.matchFragment(t), s = r && r.fillBefore(y.empty, !0);
1899
- return s ? new mt(this, e, t.append(s), R.setFrom(i)) : null;
1899
+ return s ? new mt(this, e, t.append(s), z.setFrom(i)) : null;
1900
1900
  }
1901
1901
  /**
1902
1902
  Returns true if the given fragment is valid content for this node
@@ -1952,14 +1952,14 @@ let Aa = class jc {
1952
1952
  let t;
1953
1953
  for (let i = 0; i < e.length; i++)
1954
1954
  this.allowsMarkType(e[i].type) ? t && t.push(e[i]) : t || (t = e.slice(0, i));
1955
- return t ? t.length ? t : R.none : e;
1955
+ return t ? t.length ? t : z.none : e;
1956
1956
  }
1957
1957
  /**
1958
1958
  @internal
1959
1959
  */
1960
1960
  static compile(e, t) {
1961
1961
  let i = /* @__PURE__ */ Object.create(null);
1962
- e.forEach((s, o) => i[s] = new jc(s, t, o));
1962
+ e.forEach((s, o) => i[s] = new Bc(s, t, o));
1963
1963
  let r = t.spec.topNode || "doc";
1964
1964
  if (!i[r])
1965
1965
  throw new RangeError("Schema is missing its top node type ('" + r + "')");
@@ -1991,9 +1991,9 @@ class Ar {
1991
1991
  @internal
1992
1992
  */
1993
1993
  constructor(e, t, i, r) {
1994
- this.name = e, this.rank = t, this.schema = i, this.spec = r, this.attrs = Bc(e, r.attrs), this.excluded = null;
1995
- let s = Rc(this.attrs);
1996
- this.instance = s ? new R(this, s) : null;
1994
+ this.name = e, this.rank = t, this.schema = i, this.spec = r, this.attrs = jc(e, r.attrs), this.excluded = null;
1995
+ let s = zc(this.attrs);
1996
+ this.instance = s ? new z(this, s) : null;
1997
1997
  }
1998
1998
  /**
1999
1999
  Create a mark of this type. `attrs` may be `null` or an object
@@ -2001,7 +2001,7 @@ class Ar {
2001
2001
  they have defaults, will be added.
2002
2002
  */
2003
2003
  create(e = null) {
2004
- return !e && this.instance ? this.instance : new R(this, _c(this.attrs, e));
2004
+ return !e && this.instance ? this.instance : new z(this, _c(this.attrs, e));
2005
2005
  }
2006
2006
  /**
2007
2007
  @internal
@@ -2092,7 +2092,7 @@ class $c {
2092
2092
  */
2093
2093
  text(e, t) {
2094
2094
  let i = this.nodes.text;
2095
- return new sr(i, i.defaultAttrs, e, R.setFrom(t));
2095
+ return new sr(i, i.defaultAttrs, e, z.setFrom(t));
2096
2096
  }
2097
2097
  /**
2098
2098
  Create a mark with the given type and attributes.
@@ -2112,7 +2112,7 @@ class $c {
2112
2112
  bound.
2113
2113
  */
2114
2114
  markFromJSON(e) {
2115
- return R.fromJSON(this, e);
2115
+ return z.fromJSON(this, e);
2116
2116
  }
2117
2117
  /**
2118
2118
  @internal
@@ -2146,7 +2146,7 @@ function rp(n) {
2146
2146
  function sp(n) {
2147
2147
  return n.style != null;
2148
2148
  }
2149
- let Bn = class zs {
2149
+ let jn = class Rs {
2150
2150
  /**
2151
2151
  Create a parser that targets the given schema, using the given
2152
2152
  parsing rules.
@@ -2173,7 +2173,7 @@ let Bn = class zs {
2173
2173
  */
2174
2174
  parse(e, t = {}) {
2175
2175
  let i = new Na(this, t, !1);
2176
- return i.addAll(e, R.none, t.from, t.to), i.finish();
2176
+ return i.addAll(e, z.none, t.from, t.to), i.finish();
2177
2177
  }
2178
2178
  /**
2179
2179
  Parses the content of the given DOM node, like
@@ -2185,7 +2185,7 @@ let Bn = class zs {
2185
2185
  */
2186
2186
  parseSlice(e, t = {}) {
2187
2187
  let i = new Na(this, t, !0);
2188
- return i.addAll(e, R.none, t.from, t.to), v.maxOpen(i.finish());
2188
+ return i.addAll(e, z.none, t.from, t.to), v.maxOpen(i.finish());
2189
2189
  }
2190
2190
  /**
2191
2191
  @internal
@@ -2258,7 +2258,7 @@ let Bn = class zs {
2258
2258
  [priority](https://prosemirror.net/docs/ref/#model.ParseRule.priority).
2259
2259
  */
2260
2260
  static fromSchema(e) {
2261
- return e.cached.domParser || (e.cached.domParser = new zs(e, zs.schemaRules(e)));
2261
+ return e.cached.domParser || (e.cached.domParser = new Rs(e, Rs.schemaRules(e)));
2262
2262
  }
2263
2263
  };
2264
2264
  const Fc = {
@@ -2301,13 +2301,13 @@ const Fc = {
2301
2301
  script: !0,
2302
2302
  style: !0,
2303
2303
  title: !0
2304
- }, Vc = { ol: !0, ul: !0 }, Yn = 1, Rs = 2, Vi = 4;
2304
+ }, Vc = { ol: !0, ul: !0 }, Yn = 1, zs = 2, Vi = 4;
2305
2305
  function Da(n, e, t) {
2306
- return e != null ? (e ? Yn : 0) | (e === "full" ? Rs : 0) : n && n.whitespace == "pre" ? Yn | Rs : t & -5;
2306
+ return e != null ? (e ? Yn : 0) | (e === "full" ? zs : 0) : n && n.whitespace == "pre" ? Yn | zs : t & -5;
2307
2307
  }
2308
2308
  class Ii {
2309
2309
  constructor(e, t, i, r, s, o) {
2310
- this.type = e, this.attrs = t, this.marks = i, this.solid = r, this.options = o, this.content = [], this.activeMarks = R.none, this.match = s || (o & Vi ? null : e.contentMatch);
2310
+ this.type = e, this.attrs = t, this.marks = i, this.solid = r, this.options = o, this.content = [], this.activeMarks = z.none, this.match = s || (o & Vi ? null : e.contentMatch);
2311
2311
  }
2312
2312
  findWrapping(e) {
2313
2313
  if (!this.match) {
@@ -2342,7 +2342,7 @@ class Na {
2342
2342
  constructor(e, t, i) {
2343
2343
  this.parser = e, this.options = t, this.isOpen = i, this.open = 0, this.localPreserveWS = !1;
2344
2344
  let r = t.topNode, s, o = Da(null, t.preserveWhitespace, 0) | (i ? Vi : 0);
2345
- r ? s = new Ii(r.type, r.attrs, R.none, !0, t.topMatch || r.type.contentMatch, o) : i ? s = new Ii(null, null, R.none, !0, null, o) : s = new Ii(e.schema.topNodeType, null, R.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
2345
+ r ? s = new Ii(r.type, r.attrs, z.none, !0, t.topMatch || r.type.contentMatch, o) : i ? s = new Ii(null, null, z.none, !0, null, o) : s = new Ii(e.schema.topNodeType, null, z.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
2346
2346
  }
2347
2347
  get top() {
2348
2348
  return this.nodes[this.open];
@@ -2354,7 +2354,7 @@ class Na {
2354
2354
  e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
2355
2355
  }
2356
2356
  addTextNode(e, t) {
2357
- let i = e.nodeValue, r = this.top, s = r.options & Rs ? "full" : this.localPreserveWS || (r.options & Yn) > 0;
2357
+ let i = e.nodeValue, r = this.top, s = r.options & zs ? "full" : this.localPreserveWS || (r.options & Yn) > 0;
2358
2358
  if (s === "full" || r.inlineContext(e) || /[^ \t\r\n\u000c]/.test(i)) {
2359
2359
  if (s)
2360
2360
  s !== "full" ? i = i.replace(/\r?\n|\r/g, " ") : i = i.replace(/\r\n?/g, `
@@ -2497,7 +2497,7 @@ class Na {
2497
2497
  this.closeExtra();
2498
2498
  let s = this.top;
2499
2499
  s.match && (s.match = s.match.matchType(e.type));
2500
- let o = R.none;
2500
+ let o = z.none;
2501
2501
  for (let a of r.concat(e.marks))
2502
2502
  (s.type ? s.type.allowsMarkType(a.type) : Pa(a.type, e.type)) && (o = a.addToSet(o));
2503
2503
  return s.content.push(e.mark(o)), !0;
@@ -2517,7 +2517,7 @@ class Na {
2517
2517
  o.match = o.match && o.match.matchType(e);
2518
2518
  let a = Da(e, s, o.options);
2519
2519
  o.options & Vi && o.content.length == 0 && (a |= Vi);
2520
- let l = R.none;
2520
+ let l = z.none;
2521
2521
  return i = i.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Pa(c.type, e)) ? (l = c.addToSet(l), !1) : !0), this.nodes.push(new Ii(e, t, l, r, null, a)), this.open++, i;
2522
2522
  }
2523
2523
  // Make sure all nodes above this.open are finished and added to
@@ -2739,17 +2739,17 @@ class Gt {
2739
2739
  This can be useful as a base to build a custom serializer from.
2740
2740
  */
2741
2741
  static nodesFromSchema(e) {
2742
- let t = za(e.nodes);
2742
+ let t = Ra(e.nodes);
2743
2743
  return t.text || (t.text = (i) => i.text), t;
2744
2744
  }
2745
2745
  /**
2746
2746
  Gather the serializers in a schema's mark specs into an object.
2747
2747
  */
2748
2748
  static marksFromSchema(e) {
2749
- return za(e.marks);
2749
+ return Ra(e.marks);
2750
2750
  }
2751
2751
  }
2752
- function za(n) {
2752
+ function Ra(n) {
2753
2753
  let e = {};
2754
2754
  for (let t in n) {
2755
2755
  let i = n[t].spec.toDOM;
@@ -2760,10 +2760,10 @@ function za(n) {
2760
2760
  function Qr(n) {
2761
2761
  return n.document || window.document;
2762
2762
  }
2763
- const Ra = /* @__PURE__ */ new WeakMap();
2763
+ const za = /* @__PURE__ */ new WeakMap();
2764
2764
  function cp(n) {
2765
- let e = Ra.get(n);
2766
- return e === void 0 && Ra.set(n, e = up(n)), e;
2765
+ let e = za.get(n);
2766
+ return e === void 0 && za.set(n, e = up(n)), e;
2767
2767
  }
2768
2768
  function up(n) {
2769
2769
  let e = null;
@@ -3806,9 +3806,9 @@ class Ap {
3806
3806
  let { content: e, openStart: t, openEnd: i } = this.unplaced, r = es(e, t);
3807
3807
  if (r.childCount <= 1 && t > 0) {
3808
3808
  let s = e.size - t <= t + r.size;
3809
- this.unplaced = new v(zn(e, t - 1, 1), t - 1, s ? t - 1 : i);
3809
+ this.unplaced = new v(Rn(e, t - 1, 1), t - 1, s ? t - 1 : i);
3810
3810
  } else
3811
- this.unplaced = new v(zn(e, t, 1), t, i);
3811
+ this.unplaced = new v(Rn(e, t, 1), t, i);
3812
3812
  }
3813
3813
  // Move content from the unplaced slice at `sliceDepth` to the
3814
3814
  // frontier node at `frontierDepth`. Close that frontier node when
@@ -3833,12 +3833,12 @@ class Ap {
3833
3833
  c++, (c > 1 || l == 0 || m.content.size) && (d = g, u.push(Qc(m.mark(h.allowedMarks(m.marks)), c == 1 ? l : 0, c == a.childCount ? p : -1)));
3834
3834
  }
3835
3835
  let f = c == a.childCount;
3836
- f || (p = -1), this.placed = Rn(this.placed, t, y.from(u)), this.frontier[t].match = d, f && p < 0 && i && i.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
3836
+ f || (p = -1), this.placed = zn(this.placed, t, y.from(u)), this.frontier[t].match = d, f && p < 0 && i && i.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
3837
3837
  for (let m = 0, g = a; m < p; m++) {
3838
3838
  let b = g.lastChild;
3839
3839
  this.frontier.push({ type: b.type, match: b.contentMatchAt(b.childCount) }), g = b.content;
3840
3840
  }
3841
- this.unplaced = f ? e == 0 ? v.empty : new v(zn(o.content, e - 1, 1), e - 1, p < 0 ? o.openEnd : e - 1) : new v(zn(o.content, e, c), o.openStart, o.openEnd);
3841
+ this.unplaced = f ? e == 0 ? v.empty : new v(Rn(o.content, e - 1, 1), e - 1, p < 0 ? o.openEnd : e - 1) : new v(Rn(o.content, e, c), o.openStart, o.openEnd);
3842
3842
  }
3843
3843
  mustMoveInline() {
3844
3844
  if (!this.$to.parent.isTextblock)
@@ -3870,7 +3870,7 @@ class Ap {
3870
3870
  return null;
3871
3871
  for (; this.depth > t.depth; )
3872
3872
  this.closeFrontierNode();
3873
- t.fit.childCount && (this.placed = Rn(this.placed, t.depth, t.fit)), e = t.move;
3873
+ t.fit.childCount && (this.placed = zn(this.placed, t.depth, t.fit)), e = t.move;
3874
3874
  for (let i = t.depth + 1; i <= e.depth; i++) {
3875
3875
  let r = e.node(i), s = r.type.contentMatch.fillBefore(r.content, !0, e.index(i));
3876
3876
  this.openFrontierNode(r.type, r.attrs, s);
@@ -3879,18 +3879,18 @@ class Ap {
3879
3879
  }
3880
3880
  openFrontierNode(e, t = null, i) {
3881
3881
  let r = this.frontier[this.depth];
3882
- r.match = r.match.matchType(e), this.placed = Rn(this.placed, this.depth, y.from(e.create(t, i))), this.frontier.push({ type: e, match: e.contentMatch });
3882
+ r.match = r.match.matchType(e), this.placed = zn(this.placed, this.depth, y.from(e.create(t, i))), this.frontier.push({ type: e, match: e.contentMatch });
3883
3883
  }
3884
3884
  closeFrontierNode() {
3885
3885
  let t = this.frontier.pop().match.fillBefore(y.empty, !0);
3886
- t.childCount && (this.placed = Rn(this.placed, this.frontier.length, t));
3886
+ t.childCount && (this.placed = zn(this.placed, this.frontier.length, t));
3887
3887
  }
3888
3888
  }
3889
- function zn(n, e, t) {
3890
- return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(zn(n.firstChild.content, e - 1, t)));
3891
- }
3892
3889
  function Rn(n, e, t) {
3893
- return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(Rn(n.lastChild.content, e - 1, t)));
3890
+ return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(Rn(n.firstChild.content, e - 1, t)));
3891
+ }
3892
+ function zn(n, e, t) {
3893
+ return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(zn(n.lastChild.content, e - 1, t)));
3894
3894
  }
3895
3895
  function es(n, e) {
3896
3896
  for (let t = 0; t < e; t++)
@@ -4089,7 +4089,7 @@ fn = function n(e) {
4089
4089
  fn.prototype = Object.create(Error.prototype);
4090
4090
  fn.prototype.constructor = fn;
4091
4091
  fn.prototype.name = "TransformError";
4092
- class zp {
4092
+ class Rp {
4093
4093
  /**
4094
4094
  Create a transform that starts with the given document.
4095
4095
  */
@@ -4268,7 +4268,7 @@ class zp {
4268
4268
  let i = this.doc.nodeAt(e);
4269
4269
  if (!i)
4270
4270
  throw new RangeError("No node at position " + e);
4271
- if (t instanceof R)
4271
+ if (t instanceof z)
4272
4272
  t.isInSet(i.marks) && this.step(new Ft(e, t));
4273
4273
  else {
4274
4274
  let r = i.marks, s, o = [];
@@ -4322,7 +4322,7 @@ class P {
4322
4322
  `$head`.
4323
4323
  */
4324
4324
  constructor(e, t, i) {
4325
- this.$anchor = e, this.$head = t, this.ranges = i || [new Rp(e.min(t), e.max(t))];
4325
+ this.$anchor = e, this.$head = t, this.ranges = i || [new zp(e.min(t), e.max(t))];
4326
4326
  }
4327
4327
  /**
4328
4328
  The selection's anchor, as an unresolved position.
@@ -4480,7 +4480,7 @@ class P {
4480
4480
  }
4481
4481
  }
4482
4482
  P.prototype.visible = !0;
4483
- class Rp {
4483
+ class zp {
4484
4484
  /**
4485
4485
  Create a range.
4486
4486
  */
@@ -4488,16 +4488,16 @@ class Rp {
4488
4488
  this.$from = e, this.$to = t;
4489
4489
  }
4490
4490
  }
4491
- let Ba = !1;
4492
- function ja(n) {
4493
- !Ba && !n.parent.inlineContent && (Ba = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
4491
+ let ja = !1;
4492
+ function Ba(n) {
4493
+ !ja && !n.parent.inlineContent && (ja = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
4494
4494
  }
4495
4495
  class T extends P {
4496
4496
  /**
4497
4497
  Construct a text selection between the given points.
4498
4498
  */
4499
4499
  constructor(e, t = e) {
4500
- ja(e), ja(t), super(e, t);
4500
+ Ba(e), Ba(t), super(e, t);
4501
4501
  }
4502
4502
  /**
4503
4503
  Returns a resolved position if this is a cursor selection (an
@@ -4710,7 +4710,7 @@ function $a(n, e, t) {
4710
4710
  }), n.setSelection(P.near(n.doc.resolve(o), t));
4711
4711
  }
4712
4712
  const Fa = 1, Va = 2, qa = 4;
4713
- let Lp = class extends zp {
4713
+ let Lp = class extends Rp {
4714
4714
  /**
4715
4715
  @internal
4716
4716
  */
@@ -4753,7 +4753,7 @@ let Lp = class extends zp {
4753
4753
  this is already the case.
4754
4754
  */
4755
4755
  ensureMarks(e) {
4756
- return R.sameSet(this.storedMarks || this.selection.$from.marks(), e) || this.setStoredMarks(e), this;
4756
+ return z.sameSet(this.storedMarks || this.selection.$from.marks(), e) || this.setStoredMarks(e), this;
4757
4757
  }
4758
4758
  /**
4759
4759
  Add a mark to the set of stored marks.
@@ -4798,7 +4798,7 @@ let Lp = class extends zp {
4798
4798
  */
4799
4799
  replaceSelectionWith(e, t = !0) {
4800
4800
  let i = this.selection;
4801
- return t && (e = e.mark(this.storedMarks || (i.empty ? i.$from.marks() : i.$from.marksAcross(i.$to) || R.none))), i.replaceWith(this, e), this;
4801
+ return t && (e = e.mark(this.storedMarks || (i.empty ? i.$from.marks() : i.$from.marksAcross(i.$to) || z.none))), i.replaceWith(this, e), this;
4802
4802
  }
4803
4803
  /**
4804
4804
  Delete the selection.
@@ -4869,7 +4869,7 @@ class _n {
4869
4869
  this.name = e, this.init = Ua(t.init, i), this.apply = Ua(t.apply, i);
4870
4870
  }
4871
4871
  }
4872
- const Bp = [
4872
+ const jp = [
4873
4873
  new _n("doc", {
4874
4874
  init(n) {
4875
4875
  return n.doc || n.schema.topNodeType.createAndFill();
@@ -4905,7 +4905,7 @@ const Bp = [
4905
4905
  ];
4906
4906
  class is {
4907
4907
  constructor(e, t) {
4908
- this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Bp.slice(), t && t.forEach((i) => {
4908
+ this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = jp.slice(), t && t.forEach((i) => {
4909
4909
  if (this.pluginsByKey[i.key])
4910
4910
  throw new RangeError("Adding different instances of a keyed plugin (" + i.key + ")");
4911
4911
  this.plugins.push(i), this.pluginsByKey[i.key] = i, i.spec.state && this.fields.push(new _n(i.key, i.spec.state, i));
@@ -5131,12 +5131,12 @@ const te = function(n) {
5131
5131
  let e = n.assignedSlot || n.parentNode;
5132
5132
  return e && e.nodeType == 11 ? e.host : e;
5133
5133
  };
5134
- let Bs = null;
5134
+ let js = null;
5135
5135
  const Ge = function(n, e, t) {
5136
- let i = Bs || (Bs = document.createRange());
5136
+ let i = js || (js = document.createRange());
5137
5137
  return i.setEnd(n, t ?? n.nodeValue.length), i.setStart(n, e || 0), i;
5138
- }, jp = function() {
5139
- Bs = null;
5138
+ }, Bp = function() {
5139
+ js = null;
5140
5140
  }, Vt = function(n, e, t, i) {
5141
5141
  return t && (Ha(n, e, t, i, -1) || Ha(n, e, t, i, 1));
5142
5142
  }, $p = /^(img|br|input|textarea|hr)$/i;
@@ -5231,7 +5231,7 @@ function Hp(n, e, t) {
5231
5231
  return { node: i.startContainer, offset: Math.min(Ee(i.startContainer), i.startOffset) };
5232
5232
  }
5233
5233
  }
5234
- const qe = typeof navigator < "u" ? navigator : null, Wa = typeof document < "u" ? document : null, Et = qe && qe.userAgent || "", js = /Edge\/(\d+)/.exec(Et), iu = /MSIE \d/.exec(Et), $s = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Et), be = !!(iu || $s || js), gt = iu ? document.documentMode : $s ? +$s[1] : js ? +js[1] : 0, Pe = !be && /gecko\/(\d+)/i.test(Et);
5234
+ const qe = typeof navigator < "u" ? navigator : null, Wa = typeof document < "u" ? document : null, Et = qe && qe.userAgent || "", Bs = /Edge\/(\d+)/.exec(Et), iu = /MSIE \d/.exec(Et), $s = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Et), be = !!(iu || $s || Bs), gt = iu ? document.documentMode : $s ? +$s[1] : Bs ? +Bs[1] : 0, Pe = !be && /gecko\/(\d+)/i.test(Et);
5235
5235
  Pe && +(/Firefox\/(\d+)/.exec(Et) || [0, 0])[1];
5236
5236
  const Fs = !be && /Chrome\/(\d+)/.exec(Et), se = !!Fs, ru = Fs ? +Fs[1] : 0, ue = !be && !!qe && /Apple Computer/.test(qe.vendor), gn = ue && (/Mobile\/\w+/.test(Et) || !!qe && qe.maxTouchPoints > 2), Ce = gn || (qe ? /Mac/.test(qe.platform) : !1), Wp = qe ? /Win/.test(qe.platform) : !1, Ye = /Android \d/.test(Et), vi = !!Wa && "webkitFontSmoothing" in Wa.documentElement.style, Jp = vi ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5237
5237
  function Kp(n) {
@@ -6068,7 +6068,7 @@ class bt extends xi {
6068
6068
  updateChildren(e, t) {
6069
6069
  let i = this.node.inlineContent, r = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, a = s && s.pos < 0, l = new pf(this, o && o.node, e);
6070
6070
  gf(this.node, this.innerDeco, (c, u, d) => {
6071
- c.spec.marks ? l.syncToMarks(c.spec.marks, i, e) : c.type.side >= 0 && !d && l.syncToMarks(u == this.node.childCount ? R.none : this.node.child(u).marks, i, e), l.placeWidget(c, e, r);
6071
+ c.spec.marks ? l.syncToMarks(c.spec.marks, i, e) : c.type.side >= 0 && !d && l.syncToMarks(u == this.node.childCount ? z.none : this.node.child(u).marks, i, e), l.placeWidget(c, e, r);
6072
6072
  }, (c, u, d, h) => {
6073
6073
  l.syncToMarks(c.marks, i, e);
6074
6074
  let p;
@@ -6243,22 +6243,22 @@ function pu(n, e, t) {
6243
6243
  i = el(i), r = !0;
6244
6244
  r && t.trackWrites == n && (t.trackWrites = null);
6245
6245
  }
6246
- const jn = function(n) {
6246
+ const Bn = function(n) {
6247
6247
  n && (this.nodeName = n);
6248
6248
  };
6249
- jn.prototype = /* @__PURE__ */ Object.create(null);
6250
- const Nt = [new jn()];
6249
+ Bn.prototype = /* @__PURE__ */ Object.create(null);
6250
+ const Nt = [new Bn()];
6251
6251
  function Vs(n, e, t) {
6252
6252
  if (n.length == 0)
6253
6253
  return Nt;
6254
- let i = t ? Nt[0] : new jn(), r = [i];
6254
+ let i = t ? Nt[0] : new Bn(), r = [i];
6255
6255
  for (let s = 0; s < n.length; s++) {
6256
6256
  let o = n[s].type.attrs;
6257
6257
  if (o) {
6258
- o.nodeName && r.push(i = new jn(o.nodeName));
6258
+ o.nodeName && r.push(i = new Bn(o.nodeName));
6259
6259
  for (let a in o) {
6260
6260
  let l = o[a];
6261
- l != null && (t && r.length == 1 && r.push(i = new jn(e.isInline ? "span" : "div")), a == "class" ? i.class = (i.class ? i.class + " " : "") + l : a == "style" ? i.style = (i.style ? i.style + ";" : "") + l : a != "nodeName" && (i[a] = l));
6261
+ l != null && (t && r.length == 1 && r.push(i = new Bn(e.isInline ? "span" : "div")), a == "class" ? i.class = (i.class ? i.class + " " : "") + l : a == "style" ? i.style = (i.style ? i.style + ";" : "") + l : a != "nodeName" && (i[a] = l));
6262
6262
  }
6263
6263
  }
6264
6264
  }
@@ -7021,14 +7021,14 @@ function ku(n, e, t, i, r) {
7021
7021
  break;
7022
7022
  o = h;
7023
7023
  }
7024
- if (a || (a = (n.someProp("clipboardParser") || n.someProp("domParser") || Bn.fromSchema(n.state.schema)).parseSlice(o, {
7024
+ if (a || (a = (n.someProp("clipboardParser") || n.someProp("domParser") || jn.fromSchema(n.state.schema)).parseSlice(o, {
7025
7025
  preserveWhitespace: !!(l || u),
7026
7026
  context: r,
7027
7027
  ruleFromNode(h) {
7028
7028
  return h.nodeName == "BR" && !h.nextSibling && h.parentNode && !Of.test(h.parentNode.nodeName) ? { ignore: !0 } : null;
7029
7029
  }
7030
7030
  })), u)
7031
- a = zf(dl(a, +u[1], +u[2]), u[4]);
7031
+ a = Rf(dl(a, +u[1], +u[2]), u[4]);
7032
7032
  else if (a = v.maxOpen(Df(a.content, r), !0), a.openStart || a.openEnd) {
7033
7033
  let d = 0, h = 0;
7034
7034
  for (let p = a.content.firstChild; d < a.openStart && !p.type.spec.isolating; d++, p = p.firstChild)
@@ -7128,7 +7128,7 @@ function Pf(n) {
7128
7128
  i.childNodes.length == 1 && i.textContent == " " && i.parentNode && i.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), i);
7129
7129
  }
7130
7130
  }
7131
- function zf(n, e) {
7131
+ function Rf(n, e) {
7132
7132
  if (!n.size)
7133
7133
  return n;
7134
7134
  let t = n.content.firstChild.type.schema, i;
@@ -7146,7 +7146,7 @@ function zf(n, e) {
7146
7146
  }
7147
7147
  return new v(r, s, o);
7148
7148
  }
7149
- const de = {}, he = {}, Rf = { touchstart: !0, touchmove: !0 };
7149
+ const de = {}, he = {}, zf = { touchstart: !0, touchmove: !0 };
7150
7150
  class _f {
7151
7151
  constructor() {
7152
7152
  this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
@@ -7156,15 +7156,15 @@ function Lf(n) {
7156
7156
  for (let e in de) {
7157
7157
  let t = de[e];
7158
7158
  n.dom.addEventListener(e, n.input.eventHandlers[e] = (i) => {
7159
- jf(n, i) && !Io(n, i) && (n.editable || !(i.type in he)) && t(n, i);
7160
- }, Rf[e] ? { passive: !0 } : void 0);
7159
+ Bf(n, i) && !Io(n, i) && (n.editable || !(i.type in he)) && t(n, i);
7160
+ }, zf[e] ? { passive: !0 } : void 0);
7161
7161
  }
7162
7162
  ue && n.dom.addEventListener("input", () => null), Js(n);
7163
7163
  }
7164
7164
  function pt(n, e) {
7165
7165
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
7166
7166
  }
7167
- function Bf(n) {
7167
+ function jf(n) {
7168
7168
  n.domObserver.stop();
7169
7169
  for (let e in n.input.eventHandlers)
7170
7170
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
@@ -7182,7 +7182,7 @@ function Io(n, e) {
7182
7182
  return i ? i(n, e) || e.defaultPrevented : !1;
7183
7183
  });
7184
7184
  }
7185
- function jf(n, e) {
7185
+ function Bf(n, e) {
7186
7186
  if (!e.bubbles)
7187
7187
  return !0;
7188
7188
  if (e.defaultPrevented)
@@ -7222,7 +7222,7 @@ he.keypress = (n, e) => {
7222
7222
  !/[\r\n]/.test(r) && !n.someProp("handleTextInput", (s) => s(n, i.$from.pos, i.$to.pos, r)) && n.dispatch(n.state.tr.insertText(r).scrollIntoView()), t.preventDefault();
7223
7223
  }
7224
7224
  };
7225
- function zr(n) {
7225
+ function Rr(n) {
7226
7226
  return { left: n.clientX, top: n.clientY };
7227
7227
  }
7228
7228
  function Ff(n, e) {
@@ -7292,16 +7292,16 @@ function Jf(n, e, t) {
7292
7292
  return !0;
7293
7293
  }
7294
7294
  }
7295
- function zo(n) {
7295
+ function Ro(n) {
7296
7296
  return lr(n);
7297
7297
  }
7298
7298
  const Mu = Ce ? "metaKey" : "ctrlKey";
7299
7299
  de.mousedown = (n, e) => {
7300
7300
  let t = e;
7301
7301
  n.input.shiftKey = t.shiftKey;
7302
- let i = zo(n), r = Date.now(), s = "singleClick";
7302
+ let i = Ro(n), r = Date.now(), s = "singleClick";
7303
7303
  r - n.input.lastClick.time < 500 && Ff(t, n.input.lastClick) && !t[Mu] && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: r, x: t.clientX, y: t.clientY, type: s };
7304
- let o = n.posAtCoords(zr(t));
7304
+ let o = n.posAtCoords(Rr(t));
7305
7305
  o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Kf(n, o, t, !!i)) : (s == "doubleClick" ? Hf : Wf)(n, o.pos, o.inside, t) ? t.preventDefault() : pt(n, "pointer"));
7306
7306
  };
7307
7307
  class Kf {
@@ -7333,7 +7333,7 @@ class Kf {
7333
7333
  if (this.done(), !this.view.dom.contains(e.target))
7334
7334
  return;
7335
7335
  let t = this.pos;
7336
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(zr(e))), this.updateAllowDefault(e), this.allowDefault || !t ? pt(this.view, "pointer") : Uf(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7336
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Rr(e))), this.updateAllowDefault(e), this.allowDefault || !t ? pt(this.view, "pointer") : Uf(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7337
7337
  ue && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
7338
7338
  // cursor, but still report that the node is selected
7339
7339
  // when asked through getSelection. You'll then get a
@@ -7351,12 +7351,12 @@ class Kf {
7351
7351
  }
7352
7352
  }
7353
7353
  de.touchstart = (n) => {
7354
- n.input.lastTouch = Date.now(), zo(n), pt(n, "pointer");
7354
+ n.input.lastTouch = Date.now(), Ro(n), pt(n, "pointer");
7355
7355
  };
7356
7356
  de.touchmove = (n) => {
7357
7357
  n.input.lastTouch = Date.now(), pt(n, "pointer");
7358
7358
  };
7359
- de.contextmenu = (n) => zo(n);
7359
+ de.contextmenu = (n) => Ro(n);
7360
7360
  function Tu(n, e) {
7361
7361
  return n.composing ? !0 : ue && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
7362
7362
  }
@@ -7495,7 +7495,7 @@ de.dragstart = (n, e) => {
7495
7495
  let t = e, i = n.input.mouseDown;
7496
7496
  if (i && i.done(), !t.dataTransfer)
7497
7497
  return;
7498
- let r = n.state.selection, s = r.empty ? null : n.posAtCoords(zr(t)), o;
7498
+ let r = n.state.selection, s = r.empty ? null : n.posAtCoords(Rr(t)), o;
7499
7499
  if (!(s && s.pos >= r.from && s.pos <= (r instanceof M ? r.to - 1 : r.to))) {
7500
7500
  if (i && i.mightDrag)
7501
7501
  o = M.create(n.state.doc, i.mightDrag.pos);
@@ -7518,7 +7518,7 @@ he.drop = (n, e) => {
7518
7518
  let t = e, i = n.dragging;
7519
7519
  if (n.dragging = null, !t.dataTransfer)
7520
7520
  return;
7521
- let r = n.posAtCoords(zr(t));
7521
+ let r = n.posAtCoords(Rr(t));
7522
7522
  if (!r)
7523
7523
  return;
7524
7524
  let s = n.state.doc.resolve(r.pos), o = i && i.slice;
@@ -7588,7 +7588,7 @@ function ti(n, e) {
7588
7588
  }
7589
7589
  class cr {
7590
7590
  constructor(e, t) {
7591
- this.toDOM = e, this.spec = t || Rt, this.side = this.spec.side || 0;
7591
+ this.toDOM = e, this.spec = t || zt, this.side = this.spec.side || 0;
7592
7592
  }
7593
7593
  map(e, t, i, r) {
7594
7594
  let { pos: s, deleted: o } = e.mapResult(t.from + r, this.side < 0 ? -1 : 1);
@@ -7606,7 +7606,7 @@ class cr {
7606
7606
  }
7607
7607
  class yt {
7608
7608
  constructor(e, t) {
7609
- this.attrs = e, this.spec = t || Rt;
7609
+ this.attrs = e, this.spec = t || zt;
7610
7610
  }
7611
7611
  map(e, t, i, r) {
7612
7612
  let s = e.map(t.from + r, this.spec.inclusiveStart ? -1 : 1) - i, o = e.map(t.to + r, this.spec.inclusiveEnd ? 1 : -1) - i;
@@ -7624,9 +7624,9 @@ class yt {
7624
7624
  destroy() {
7625
7625
  }
7626
7626
  }
7627
- class Ro {
7627
+ class zo {
7628
7628
  constructor(e, t) {
7629
- this.attrs = e, this.spec = t || Rt;
7629
+ this.attrs = e, this.spec = t || zt;
7630
7630
  }
7631
7631
  map(e, t, i, r) {
7632
7632
  let s = e.mapResult(t.from + r, 1);
@@ -7640,7 +7640,7 @@ class Ro {
7640
7640
  return r == t.from && !(s = e.child(i)).isText && r + s.nodeSize == t.to;
7641
7641
  }
7642
7642
  eq(e) {
7643
- return this == e || e instanceof Ro && ti(this.attrs, e.attrs) && ti(this.spec, e.spec);
7643
+ return this == e || e instanceof zo && ti(this.attrs, e.attrs) && ti(this.spec, e.spec);
7644
7644
  }
7645
7645
  destroy() {
7646
7646
  }
@@ -7694,7 +7694,7 @@ class me {
7694
7694
  node, will receive the given attributes.
7695
7695
  */
7696
7696
  static node(e, t, i, r) {
7697
- return new me(e, t, new Ro(i, r));
7697
+ return new me(e, t, new zo(i, r));
7698
7698
  }
7699
7699
  /**
7700
7700
  The spec provided when creating this decoration. Can be useful
@@ -7716,7 +7716,7 @@ class me {
7716
7716
  return this.type instanceof cr;
7717
7717
  }
7718
7718
  }
7719
- const en = [], Rt = {};
7719
+ const en = [], zt = {};
7720
7720
  class $ {
7721
7721
  /**
7722
7722
  @internal
@@ -7730,7 +7730,7 @@ class $ {
7730
7730
  you must make a copy if you want need to preserve that.
7731
7731
  */
7732
7732
  static create(e, t) {
7733
- return t.length ? ur(t, e, 0, Rt) : re;
7733
+ return t.length ? ur(t, e, 0, zt) : re;
7734
7734
  }
7735
7735
  /**
7736
7736
  Find all decorations in this set which touch the given range
@@ -7760,7 +7760,7 @@ class $ {
7760
7760
  document.
7761
7761
  */
7762
7762
  map(e, t, i) {
7763
- return this == re || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, i || Rt);
7763
+ return this == re || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, i || zt);
7764
7764
  }
7765
7765
  /**
7766
7766
  @internal
@@ -7786,13 +7786,13 @@ class $ {
7786
7786
  let r, s = 0;
7787
7787
  e.forEach((a, l) => {
7788
7788
  let c = l + i, u;
7789
- if (u = zu(t, a, c)) {
7789
+ if (u = Ru(t, a, c)) {
7790
7790
  for (r || (r = this.children.slice()); s < r.length && r[s] < l; )
7791
7791
  s += 3;
7792
- r[s] == l ? r[s + 2] = r[s + 2].addInner(a, u, c + 1) : r.splice(s, 0, l, l + a.nodeSize, ur(u, a, c + 1, Rt)), s += 3;
7792
+ r[s] == l ? r[s + 2] = r[s + 2].addInner(a, u, c + 1) : r.splice(s, 0, l, l + a.nodeSize, ur(u, a, c + 1, zt)), s += 3;
7793
7793
  }
7794
7794
  });
7795
- let o = Pu(s ? Ru(t) : t, -i);
7795
+ let o = Pu(s ? zu(t) : t, -i);
7796
7796
  for (let a = 0; a < o.length; a++)
7797
7797
  o[a].type.valid(e, o[a]) || o.splice(a--, 1);
7798
7798
  return new $(o.length ? this.local.concat(o).sort(_t) : this.local, r || this.children);
@@ -7896,7 +7896,7 @@ class ct {
7896
7896
  this.members = e;
7897
7897
  }
7898
7898
  map(e, t) {
7899
- const i = this.members.map((r) => r.map(e, t, Rt));
7899
+ const i = this.members.map((r) => r.map(e, t, zt));
7900
7900
  return ct.from(i);
7901
7901
  }
7902
7902
  forChild(e, t) {
@@ -8021,7 +8021,7 @@ function im(n, e, t, i, r, s, o) {
8021
8021
  n[l + 1] == -1 && a(n[l + 2], e[l] + s + 1);
8022
8022
  return t;
8023
8023
  }
8024
- function zu(n, e, t) {
8024
+ function Ru(n, e, t) {
8025
8025
  if (e.isLeaf)
8026
8026
  return null;
8027
8027
  let i = t + e.nodeSize, r = null;
@@ -8029,7 +8029,7 @@ function zu(n, e, t) {
8029
8029
  (o = n[s]) && o.from > t && o.to < i && ((r || (r = [])).push(o), n[s] = null);
8030
8030
  return r;
8031
8031
  }
8032
- function Ru(n) {
8032
+ function zu(n) {
8033
8033
  let e = [];
8034
8034
  for (let t = 0; t < n.length; t++)
8035
8035
  n[t] != null && e.push(n[t]);
@@ -8038,14 +8038,14 @@ function Ru(n) {
8038
8038
  function ur(n, e, t, i) {
8039
8039
  let r = [], s = !1;
8040
8040
  e.forEach((a, l) => {
8041
- let c = zu(n, a, l + t);
8041
+ let c = Ru(n, a, l + t);
8042
8042
  if (c) {
8043
8043
  s = !0;
8044
8044
  let u = ur(c, a, t + l + 1, i);
8045
8045
  u != re && r.push(l, l + a.nodeSize, u);
8046
8046
  }
8047
8047
  });
8048
- let o = Pu(s ? Ru(n) : n, -t).sort(_t);
8048
+ let o = Pu(s ? zu(n) : n, -t).sort(_t);
8049
8049
  for (let a = 0; a < o.length; a++)
8050
8050
  o[a].type.valid(e, o[a]) || (i.onRemove && i.onRemove(o[a].spec), o.splice(a--, 1));
8051
8051
  return o.length || r.length ? new $(o, r) : re;
@@ -8291,7 +8291,7 @@ function dm(n, e, t) {
8291
8291
  if (!k || k.size)
8292
8292
  break;
8293
8293
  }
8294
- let d = n.state.doc, h = n.someProp("domParser") || Bn.fromSchema(n.state.schema), p = d.resolve(o), f = null, m = h.parse(i, {
8294
+ let d = n.state.doc, h = n.someProp("domParser") || jn.fromSchema(n.state.schema), p = d.resolve(o), f = null, m = h.parse(i, {
8295
8295
  topNode: p.parent,
8296
8296
  topMatch: p.parent.contentMatchAt(p.index()),
8297
8297
  topOpen: !0,
@@ -8769,7 +8769,7 @@ class ym {
8769
8769
  views](https://prosemirror.net/docs/ref/#view.NodeView).
8770
8770
  */
8771
8771
  destroy() {
8772
- this.docView && (Bf(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], cs(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, jp());
8772
+ this.docView && (jf(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], cs(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Bp());
8773
8773
  }
8774
8774
  /**
8775
8775
  This is true when the view has been
@@ -9009,7 +9009,7 @@ const Lu = (n, e, t) => {
9009
9009
  let i = _u(n, t);
9010
9010
  if (!i)
9011
9011
  return !1;
9012
- let r = Bo(i);
9012
+ let r = jo(i);
9013
9013
  if (!r) {
9014
9014
  let o = i.blockRange(), a = o && En(o);
9015
9015
  return a == null ? !1 : (e && e(n.tr.lift(o, a).scrollIntoView()), !0);
@@ -9035,16 +9035,16 @@ const Lu = (n, e, t) => {
9035
9035
  let i = _u(n, t);
9036
9036
  if (!i)
9037
9037
  return !1;
9038
- let r = Bo(i);
9039
- return r ? Bu(n, r, e) : !1;
9038
+ let r = jo(i);
9039
+ return r ? ju(n, r, e) : !1;
9040
9040
  }, Dm = (n, e, t) => {
9041
9041
  let i = $u(n, t);
9042
9042
  if (!i)
9043
9043
  return !1;
9044
- let r = jo(i);
9045
- return r ? Bu(n, r, e) : !1;
9044
+ let r = Bo(i);
9045
+ return r ? ju(n, r, e) : !1;
9046
9046
  };
9047
- function Bu(n, e, t) {
9047
+ function ju(n, e, t) {
9048
9048
  let i = e.nodeBefore, r = i, s = e.pos - 1;
9049
9049
  for (; !r.isTextblock; s--) {
9050
9050
  if (r.type.spec.isolating)
@@ -9081,19 +9081,19 @@ function bn(n, e, t = !1) {
9081
9081
  }
9082
9082
  return !1;
9083
9083
  }
9084
- const ju = (n, e, t) => {
9084
+ const Bu = (n, e, t) => {
9085
9085
  let { $head: i, empty: r } = n.selection, s = i;
9086
9086
  if (!r)
9087
9087
  return !1;
9088
9088
  if (i.parent.isTextblock) {
9089
9089
  if (t ? !t.endOfTextblock("backward", n) : i.parentOffset > 0)
9090
9090
  return !1;
9091
- s = Bo(i);
9091
+ s = jo(i);
9092
9092
  }
9093
9093
  let o = s && s.nodeBefore;
9094
9094
  return !o || !M.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(M.create(n.doc, s.pos - o.nodeSize)).scrollIntoView()), !0);
9095
9095
  };
9096
- function Bo(n) {
9096
+ function jo(n) {
9097
9097
  if (!n.parent.type.spec.isolating)
9098
9098
  for (let e = n.depth - 1; e >= 0; e--) {
9099
9099
  if (n.index(e) > 0)
@@ -9111,7 +9111,7 @@ const Fu = (n, e, t) => {
9111
9111
  let i = $u(n, t);
9112
9112
  if (!i)
9113
9113
  return !1;
9114
- let r = jo(i);
9114
+ let r = Bo(i);
9115
9115
  if (!r)
9116
9116
  return !1;
9117
9117
  let s = r.nodeAfter;
@@ -9135,12 +9135,12 @@ const Fu = (n, e, t) => {
9135
9135
  if (i.parent.isTextblock) {
9136
9136
  if (t ? !t.endOfTextblock("forward", n) : i.parentOffset < i.parent.content.size)
9137
9137
  return !1;
9138
- s = jo(i);
9138
+ s = Bo(i);
9139
9139
  }
9140
9140
  let o = s && s.nodeAfter;
9141
9141
  return !o || !M.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(M.create(n.doc, s.pos)).scrollIntoView()), !0);
9142
9142
  };
9143
- function jo(n) {
9143
+ function Bo(n) {
9144
9144
  if (!n.parent.type.spec.isolating)
9145
9145
  for (let e = n.depth - 1; e >= 0; e--) {
9146
9146
  let t = n.node(e);
@@ -9189,7 +9189,7 @@ function $o(n) {
9189
9189
  }
9190
9190
  return null;
9191
9191
  }
9192
- const zm = (n, e) => {
9192
+ const Rm = (n, e) => {
9193
9193
  let { $head: t, $anchor: i } = n.selection;
9194
9194
  if (!t.parent.type.spec.code || !t.sameParent(i))
9195
9195
  return !1;
@@ -9225,7 +9225,7 @@ const zm = (n, e) => {
9225
9225
  let i = t.blockRange(), r = i && En(i);
9226
9226
  return r == null ? !1 : (e && e(n.tr.lift(i, r).scrollIntoView()), !0);
9227
9227
  };
9228
- function Rm(n) {
9228
+ function zm(n) {
9229
9229
  return (e, t) => {
9230
9230
  let { $from: i, $to: r } = e.selection;
9231
9231
  if (e.selection instanceof M && e.selection.node.isBlock)
@@ -9254,17 +9254,17 @@ function Rm(n) {
9254
9254
  return t && t(u.scrollIntoView()), !0;
9255
9255
  };
9256
9256
  }
9257
- const _m = Rm(), Lm = (n, e) => {
9257
+ const _m = zm(), Lm = (n, e) => {
9258
9258
  let { $from: t, to: i } = n.selection, r, s = t.sharedDepth(i);
9259
9259
  return s == 0 ? !1 : (r = t.before(s), e && e(n.tr.setSelection(M.create(n.doc, r))), !0);
9260
9260
  };
9261
- function Bm(n, e, t) {
9261
+ function jm(n, e, t) {
9262
9262
  let i = e.nodeBefore, r = e.nodeAfter, s = e.index();
9263
9263
  return !i || !r || !i.type.compatibleContent(r.type) ? !1 : !i.content.size && e.parent.canReplace(s - 1, s) ? (t && t(n.tr.delete(e.pos - i.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(r.isTextblock || Ct(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
9264
9264
  }
9265
9265
  function Wu(n, e, t, i) {
9266
9266
  let r = e.nodeBefore, s = e.nodeAfter, o, a, l = r.type.spec.isolating || s.type.spec.isolating;
9267
- if (!l && Bm(n, e, t))
9267
+ if (!l && jm(n, e, t))
9268
9268
  return !0;
9269
9269
  let c = !l && e.parent.canReplace(e.index(), e.index() + 1);
9270
9270
  if (c && (o = (a = r.contentMatchAt(r.childCount)).findWrapping(s.type)) && a.matchType(o[0] || s.type).validEnd) {
@@ -9312,7 +9312,7 @@ function Ju(n) {
9312
9312
  return r.node(s).isTextblock ? (t && t(e.tr.setSelection(T.create(e.doc, n < 0 ? r.start(s) : r.end(s)))), !0) : !1;
9313
9313
  };
9314
9314
  }
9315
- const jm = Ju(-1), $m = Ju(1);
9315
+ const Bm = Ju(-1), $m = Ju(1);
9316
9316
  function Fm(n, e = null) {
9317
9317
  return function(t, i) {
9318
9318
  let { $from: r, $to: s } = t.selection, o = r.blockRange(s), a = o && Mo(o, n, e);
@@ -9357,7 +9357,7 @@ function Fo(...n) {
9357
9357
  return !1;
9358
9358
  };
9359
9359
  }
9360
- Fo(Lo, Lu, ju);
9360
+ Fo(Lo, Lu, Bu);
9361
9361
  Fo(Lo, Fu, Vu);
9362
9362
  Fo(qu, Uu, Hu, _m);
9363
9363
  typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
@@ -9441,7 +9441,7 @@ function Km(n) {
9441
9441
  return !0;
9442
9442
  };
9443
9443
  }
9444
- function Rr(n) {
9444
+ function zr(n) {
9445
9445
  const { state: e, transaction: t } = n;
9446
9446
  let { selection: i } = t, { doc: r } = t, { storedMarks: s } = t;
9447
9447
  return {
@@ -9511,7 +9511,7 @@ class _r {
9511
9511
  tr: e,
9512
9512
  editor: r,
9513
9513
  view: o,
9514
- state: Rr({
9514
+ state: zr({
9515
9515
  state: s,
9516
9516
  transaction: e
9517
9517
  }),
@@ -9660,7 +9660,7 @@ function Ks(n, e) {
9660
9660
  function Gu(n) {
9661
9661
  return typeof n == "function";
9662
9662
  }
9663
- function z(n, e = void 0, ...t) {
9663
+ function R(n, e = void 0, ...t) {
9664
9664
  return Gu(n) ? e ? n.bind(e)(...t) : n(...t) : n;
9665
9665
  }
9666
9666
  function Xm(n = {}) {
@@ -9709,23 +9709,23 @@ function Zm(n, e) {
9709
9709
  };
9710
9710
  }, {}), p = Ml({
9711
9711
  ...h,
9712
- content: z(S(c, "content", d)),
9713
- marks: z(S(c, "marks", d)),
9714
- group: z(S(c, "group", d)),
9715
- inline: z(S(c, "inline", d)),
9716
- atom: z(S(c, "atom", d)),
9717
- selectable: z(S(c, "selectable", d)),
9718
- draggable: z(S(c, "draggable", d)),
9719
- code: z(S(c, "code", d)),
9720
- whitespace: z(S(c, "whitespace", d)),
9721
- linebreakReplacement: z(S(c, "linebreakReplacement", d)),
9722
- defining: z(S(c, "defining", d)),
9723
- isolating: z(S(c, "isolating", d)),
9712
+ content: R(S(c, "content", d)),
9713
+ marks: R(S(c, "marks", d)),
9714
+ group: R(S(c, "group", d)),
9715
+ inline: R(S(c, "inline", d)),
9716
+ atom: R(S(c, "atom", d)),
9717
+ selectable: R(S(c, "selectable", d)),
9718
+ draggable: R(S(c, "draggable", d)),
9719
+ code: R(S(c, "code", d)),
9720
+ whitespace: R(S(c, "whitespace", d)),
9721
+ linebreakReplacement: R(S(c, "linebreakReplacement", d)),
9722
+ defining: R(S(c, "defining", d)),
9723
+ isolating: R(S(c, "isolating", d)),
9724
9724
  attrs: Object.fromEntries(u.map((b) => {
9725
9725
  var k;
9726
9726
  return [b.name, { default: (k = b == null ? void 0 : b.attribute) === null || k === void 0 ? void 0 : k.default }];
9727
9727
  }))
9728
- }), f = z(S(c, "parseHTML", d));
9728
+ }), f = R(S(c, "parseHTML", d));
9729
9729
  f && (p.parseDOM = f.map((b) => El(b, u)));
9730
9730
  const m = S(c, "renderHTML", d);
9731
9731
  m && (p.toDOM = (b) => m({
@@ -9748,16 +9748,16 @@ function Zm(n, e) {
9748
9748
  };
9749
9749
  }, {}), p = Ml({
9750
9750
  ...h,
9751
- inclusive: z(S(c, "inclusive", d)),
9752
- excludes: z(S(c, "excludes", d)),
9753
- group: z(S(c, "group", d)),
9754
- spanning: z(S(c, "spanning", d)),
9755
- code: z(S(c, "code", d)),
9751
+ inclusive: R(S(c, "inclusive", d)),
9752
+ excludes: R(S(c, "excludes", d)),
9753
+ group: R(S(c, "group", d)),
9754
+ spanning: R(S(c, "spanning", d)),
9755
+ code: R(S(c, "code", d)),
9756
9756
  attrs: Object.fromEntries(u.map((g) => {
9757
9757
  var b;
9758
9758
  return [g.name, { default: (b = g == null ? void 0 : g.attribute) === null || b === void 0 ? void 0 : b.default }];
9759
9759
  }))
9760
- }), f = z(S(c, "parseHTML", d));
9760
+ }), f = R(S(c, "parseHTML", d));
9761
9761
  f && (p.parseDOM = f.map((g) => El(g, u)));
9762
9762
  const m = S(c, "renderHTML", d);
9763
9763
  return m && (p.toDOM = (g) => m({
@@ -9831,7 +9831,7 @@ function Pi(n) {
9831
9831
  const p = tg(d, h.find);
9832
9832
  if (!p)
9833
9833
  return;
9834
- const f = l.state.tr, m = Rr({
9834
+ const f = l.state.tr, m = zr({
9835
9835
  state: l.state,
9836
9836
  transaction: f
9837
9837
  }), g = {
@@ -9931,13 +9931,13 @@ function ng(n) {
9931
9931
  function ig(n) {
9932
9932
  return Object.prototype.toString.call(n).slice(8, -1);
9933
9933
  }
9934
- function zi(n) {
9934
+ function Ri(n) {
9935
9935
  return ig(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
9936
9936
  }
9937
- function Br(n, e) {
9937
+ function jr(n, e) {
9938
9938
  const t = { ...n };
9939
- return zi(n) && zi(e) && Object.keys(e).forEach((i) => {
9940
- zi(e[i]) && zi(n[i]) ? t[i] = Br(n[i], e[i]) : t[i] = e[i];
9939
+ return Ri(n) && Ri(e) && Object.keys(e).forEach((i) => {
9940
+ Ri(e[i]) && Ri(n[i]) ? t[i] = jr(n[i], e[i]) : t[i] = e[i];
9941
9941
  }), t;
9942
9942
  }
9943
9943
  class ni {
@@ -9948,9 +9948,9 @@ class ni {
9948
9948
  }, this.config = {
9949
9949
  ...this.config,
9950
9950
  ...e
9951
- }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = z(S(this, "addOptions", {
9951
+ }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = R(S(this, "addOptions", {
9952
9952
  name: this.name
9953
- }))), this.storage = z(S(this, "addStorage", {
9953
+ }))), this.storage = R(S(this, "addStorage", {
9954
9954
  name: this.name,
9955
9955
  options: this.options
9956
9956
  })) || {};
@@ -9961,15 +9961,15 @@ class ni {
9961
9961
  configure(e = {}) {
9962
9962
  const t = this.extend({
9963
9963
  ...this.config,
9964
- addOptions: () => Br(this.options, e)
9964
+ addOptions: () => jr(this.options, e)
9965
9965
  });
9966
9966
  return t.name = this.name, t.parent = this.parent, t;
9967
9967
  }
9968
9968
  extend(e = {}) {
9969
9969
  const t = new ni(e);
9970
- return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = z(S(t, "addOptions", {
9970
+ return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = R(S(t, "addOptions", {
9971
9971
  name: t.name
9972
- })), t.storage = z(S(t, "addStorage", {
9972
+ })), t.storage = R(S(t, "addStorage", {
9973
9973
  name: t.name,
9974
9974
  options: t.options
9975
9975
  })), t;
@@ -10027,7 +10027,7 @@ function og(n) {
10027
10027
  });
10028
10028
  }), d.every((p) => p !== null);
10029
10029
  }
10030
- let Ri = null;
10030
+ let zi = null;
10031
10031
  const ag = (n) => {
10032
10032
  var e;
10033
10033
  const t = new ClipboardEvent("paste", {
@@ -10044,7 +10044,7 @@ function lg(n) {
10044
10044
  a = null;
10045
10045
  }
10046
10046
  const l = ({ state: u, from: d, to: h, rule: p, pasteEvt: f }) => {
10047
- const m = u.tr, g = Rr({
10047
+ const m = u.tr, g = zr({
10048
10048
  state: u,
10049
10049
  transaction: m
10050
10050
  });
@@ -10070,9 +10070,9 @@ function lg(n) {
10070
10070
  view(d) {
10071
10071
  const h = (f) => {
10072
10072
  var m;
10073
- i = !((m = d.dom.parentElement) === null || m === void 0) && m.contains(f.target) ? d.dom.parentElement : null, i && (Ri = e);
10073
+ i = !((m = d.dom.parentElement) === null || m === void 0) && m.contains(f.target) ? d.dom.parentElement : null, i && (zi = e);
10074
10074
  }, p = () => {
10075
- Ri && (Ri = null);
10075
+ zi && (zi = null);
10076
10076
  };
10077
10077
  return window.addEventListener("dragstart", h), window.addEventListener("dragend", p), {
10078
10078
  destroy() {
@@ -10084,7 +10084,7 @@ function lg(n) {
10084
10084
  handleDOMEvents: {
10085
10085
  drop: (d, h) => {
10086
10086
  if (s = i === d.dom.parentElement, a = h, !s) {
10087
- const p = Ri;
10087
+ const p = zi;
10088
10088
  p && setTimeout(() => {
10089
10089
  const f = p.state.selection;
10090
10090
  f && p.commands.deleteRange({ from: f.from, to: f.to });
@@ -10289,7 +10289,7 @@ class nn {
10289
10289
  editor: this.editor,
10290
10290
  type: ps(e.name, this.schema)
10291
10291
  };
10292
- e.type === "mark" && (!((t = z(S(e, "keepOnSplit", i))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
10292
+ e.type === "mark" && (!((t = R(S(e, "keepOnSplit", i))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
10293
10293
  const r = S(e, "onBeforeCreate", i), s = S(e, "onCreate", i), o = S(e, "onUpdate", i), a = S(e, "onSelectionUpdate", i), l = S(e, "onTransaction", i), c = S(e, "onFocus", i), u = S(e, "onBlur", i), d = S(e, "onDestroy", i);
10294
10294
  r && this.editor.on("beforeCreate", r), s && this.editor.on("create", s), o && this.editor.on("update", o), a && this.editor.on("selectionUpdate", a), l && this.editor.on("transaction", l), c && this.editor.on("focus", c), u && this.editor.on("blur", u), d && this.editor.on("destroy", d);
10295
10295
  });
@@ -10303,9 +10303,9 @@ class Z {
10303
10303
  }, this.config = {
10304
10304
  ...this.config,
10305
10305
  ...e
10306
- }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = z(S(this, "addOptions", {
10306
+ }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = R(S(this, "addOptions", {
10307
10307
  name: this.name
10308
- }))), this.storage = z(S(this, "addStorage", {
10308
+ }))), this.storage = R(S(this, "addStorage", {
10309
10309
  name: this.name,
10310
10310
  options: this.options
10311
10311
  })) || {};
@@ -10316,15 +10316,15 @@ class Z {
10316
10316
  configure(e = {}) {
10317
10317
  const t = this.extend({
10318
10318
  ...this.config,
10319
- addOptions: () => Br(this.options, e)
10319
+ addOptions: () => jr(this.options, e)
10320
10320
  });
10321
10321
  return t.name = this.name, t.parent = this.parent, t;
10322
10322
  }
10323
10323
  extend(e = {}) {
10324
10324
  const t = new Z({ ...this.config, ...e });
10325
- return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = z(S(t, "addOptions", {
10325
+ return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = R(S(t, "addOptions", {
10326
10326
  name: t.name
10327
- })), t.storage = z(S(t, "addStorage", {
10327
+ })), t.storage = R(S(t, "addStorage", {
10328
10328
  name: t.name,
10329
10329
  options: t.options
10330
10330
  })), t;
@@ -10429,7 +10429,7 @@ const ug = Z.create({
10429
10429
  }, wg = (n) => ({ tr: e, dispatch: t }) => {
10430
10430
  const { from: i, to: r } = n;
10431
10431
  return t && e.delete(i, r), !0;
10432
- }, kg = () => ({ state: n, dispatch: e }) => Lo(n, e), vg = () => ({ commands: n }) => n.keyboardShortcut("Enter"), xg = () => ({ state: n, dispatch: e }) => zm(n, e);
10432
+ }, kg = () => ({ state: n, dispatch: e }) => Lo(n, e), vg = () => ({ commands: n }) => n.keyboardShortcut("Enter"), xg = () => ({ state: n, dispatch: e }) => Rm(n, e);
10433
10433
  function hr(n, e, t = { strict: !0 }) {
10434
10434
  const i = Object.keys(e);
10435
10435
  return i.length ? i.every((r) => t.strict ? e[r] === n[r] : qo(e[r]) ? e[r].test(n[r]) : e[r] === n[r]) : !0;
@@ -10585,10 +10585,10 @@ function ii(n, e, t) {
10585
10585
  }
10586
10586
  })
10587
10587
  });
10588
- if (t.slice ? Bn.fromSchema(l).parseSlice(_i(n), t.parseOptions) : Bn.fromSchema(l).parse(_i(n), t.parseOptions), t.errorOnInvalidContent && o)
10588
+ if (t.slice ? jn.fromSchema(l).parseSlice(_i(n), t.parseOptions) : jn.fromSchema(l).parse(_i(n), t.parseOptions), t.errorOnInvalidContent && o)
10589
10589
  throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${a}`) });
10590
10590
  }
10591
- const s = Bn.fromSchema(e);
10591
+ const s = jn.fromSchema(e);
10592
10592
  return t.slice ? s.parseSlice(_i(n), t.parseOptions).content : s.parse(_i(n), t.parseOptions);
10593
10593
  }
10594
10594
  return ii("", e, t);
@@ -10657,7 +10657,7 @@ const Dg = (n) => !("type" in n), Ng = (n, e, t) => ({ tr: i, dispatch: r, edito
10657
10657
  t.updateSelection && Og(i, i.steps.length - 1, -1), t.applyInputRules && i.setMeta("applyInputRules", { from: l, text: p }), t.applyPasteRules && i.setMeta("applyPasteRules", { from: l, text: p });
10658
10658
  }
10659
10659
  return !0;
10660
- }, Ig = () => ({ state: n, dispatch: e }) => Nm(n, e), Pg = () => ({ state: n, dispatch: e }) => Im(n, e), zg = () => ({ state: n, dispatch: e }) => Lu(n, e), Rg = () => ({ state: n, dispatch: e }) => Fu(n, e), _g = () => ({ state: n, dispatch: e, tr: t }) => {
10660
+ }, Ig = () => ({ state: n, dispatch: e }) => Nm(n, e), Pg = () => ({ state: n, dispatch: e }) => Im(n, e), Rg = () => ({ state: n, dispatch: e }) => Lu(n, e), zg = () => ({ state: n, dispatch: e }) => Fu(n, e), _g = () => ({ state: n, dispatch: e, tr: t }) => {
10661
10661
  try {
10662
10662
  const i = Or(n.doc, n.selection.$from.pos, -1);
10663
10663
  return i == null ? !1 : (t.join(i, 2), e && e(t), !0);
@@ -10671,7 +10671,7 @@ const Dg = (n) => !("type" in n), Ng = (n, e, t) => ({ tr: i, dispatch: r, edito
10671
10671
  } catch {
10672
10672
  return !1;
10673
10673
  }
10674
- }, Bg = () => ({ state: n, dispatch: e }) => Om(n, e), jg = () => ({ state: n, dispatch: e }) => Dm(n, e);
10674
+ }, jg = () => ({ state: n, dispatch: e }) => Om(n, e), Bg = () => ({ state: n, dispatch: e }) => Dm(n, e);
10675
10675
  function nd() {
10676
10676
  return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
10677
10677
  }
@@ -10736,7 +10736,7 @@ const Vg = (n, e = {}) => ({ state: t, dispatch: i }) => {
10736
10736
  const i = Q(n, e.schema);
10737
10737
  return Hm(i)(e, t);
10738
10738
  }, Hg = () => ({ state: n, dispatch: e }) => qu(n, e);
10739
- function jr(n, e) {
10739
+ function Br(n, e) {
10740
10740
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
10741
10741
  }
10742
10742
  function Ol(n, e) {
@@ -10745,7 +10745,7 @@ function Ol(n, e) {
10745
10745
  }
10746
10746
  const Wg = (n, e) => ({ tr: t, state: i, dispatch: r }) => {
10747
10747
  let s = null, o = null;
10748
- const a = jr(typeof n == "string" ? n : n.name, i.schema);
10748
+ const a = Br(typeof n == "string" ? n : n.name, i.schema);
10749
10749
  return a ? (a === "node" && (s = Q(n, i.schema)), a === "mark" && (o = Mt(n, i.schema)), r && t.selection.ranges.forEach((l) => {
10750
10750
  i.doc.nodesBetween(l.$from.pos, l.$to.pos, (c, u) => {
10751
10751
  s && s === c.type && t.setNodeMarkup(u, void 0, Ol(c.attrs, e)), o && c.marks.length && c.marks.forEach((d) => {
@@ -10759,7 +10759,7 @@ const Wg = (n, e) => ({ tr: t, state: i, dispatch: r }) => {
10759
10759
  n.setSelection(t);
10760
10760
  }
10761
10761
  return !0;
10762
- }, Gg = () => ({ state: n, dispatch: e }) => ju(n, e), Yg = () => ({ state: n, dispatch: e }) => Vu(n, e), Xg = () => ({ state: n, dispatch: e }) => Lm(n, e), Qg = () => ({ state: n, dispatch: e }) => $m(n, e), Zg = () => ({ state: n, dispatch: e }) => jm(n, e);
10762
+ }, Gg = () => ({ state: n, dispatch: e }) => Bu(n, e), Yg = () => ({ state: n, dispatch: e }) => Vu(n, e), Xg = () => ({ state: n, dispatch: e }) => Lm(n, e), Qg = () => ({ state: n, dispatch: e }) => $m(n, e), Zg = () => ({ state: n, dispatch: e }) => Bm(n, e);
10763
10763
  function Gs(n, e, t = {}, i = {}) {
10764
10764
  return ii(n, e, {
10765
10765
  slice: !1,
@@ -10828,7 +10828,7 @@ function ib(n, e) {
10828
10828
  return o ? { ...o.attrs } : {};
10829
10829
  }
10830
10830
  function rb(n, e) {
10831
- const t = jr(typeof e == "string" ? e : e.name, n.schema);
10831
+ const t = Br(typeof e == "string" ? e : e.name, n.schema);
10832
10832
  return t === "node" ? ib(n, e) : t === "mark" ? id(n, e) : {};
10833
10833
  }
10834
10834
  function Hi(n, e, t) {
@@ -10863,7 +10863,7 @@ function Ys(n, e, t = {}) {
10863
10863
  function sb(n, e, t = {}) {
10864
10864
  if (!e)
10865
10865
  return ri(n, null, t) || Ys(n, null, t);
10866
- const i = jr(e, n.schema);
10866
+ const i = Br(e, n.schema);
10867
10867
  return i === "node" ? ri(n, e, t) : i === "mark" ? Ys(n, e, t) : !1;
10868
10868
  }
10869
10869
  function Dl(n, e) {
@@ -10874,7 +10874,7 @@ function Dl(n, e) {
10874
10874
  name: i.name,
10875
10875
  options: i.options,
10876
10876
  storage: i.storage
10877
- }, s = z(S(i, "group", r));
10877
+ }, s = R(S(i, "group", r));
10878
10878
  return typeof s != "string" ? !1 : s.split(" ").includes("list");
10879
10879
  }
10880
10880
  function $r(n, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
@@ -11136,7 +11136,7 @@ const pb = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, edit
11136
11136
  return t.removeStoredMark(l), !0;
11137
11137
  }, xb = (n, e = {}) => ({ tr: t, state: i, dispatch: r }) => {
11138
11138
  let s = null, o = null;
11139
- const a = jr(typeof n == "string" ? n : n.name, i.schema);
11139
+ const a = Br(typeof n == "string" ? n : n.name, i.schema);
11140
11140
  return a ? (a === "node" && (s = Q(n, i.schema)), a === "mark" && (o = Mt(n, i.schema)), r && t.selection.ranges.forEach((l) => {
11141
11141
  const c = l.$from.pos, u = l.$to.pos;
11142
11142
  let d, h, p, f;
@@ -11192,13 +11192,13 @@ var Eb = /* @__PURE__ */ Object.freeze({
11192
11192
  forEach: Tg,
11193
11193
  insertContent: Ag,
11194
11194
  insertContentAt: Ng,
11195
- joinBackward: zg,
11195
+ joinBackward: Rg,
11196
11196
  joinDown: Pg,
11197
- joinForward: Rg,
11197
+ joinForward: zg,
11198
11198
  joinItemBackward: _g,
11199
11199
  joinItemForward: Lg,
11200
- joinTextblockBackward: Bg,
11201
- joinTextblockForward: jg,
11200
+ joinTextblockBackward: jg,
11201
+ joinTextblockForward: Bg,
11202
11202
  joinUp: Ig,
11203
11203
  keyboardShortcut: Fg,
11204
11204
  lift: Vg,
@@ -11360,7 +11360,7 @@ const Mb = Z.create({
11360
11360
  const { empty: s, from: o, to: a } = e.selection, l = P.atStart(e.doc).from, c = P.atEnd(e.doc).to;
11361
11361
  if (s || !(o === l && a === c) || !$r(t.doc))
11362
11362
  return;
11363
- const h = t.tr, p = Rr({
11363
+ const h = t.tr, p = zr({
11364
11364
  state: t,
11365
11365
  transaction: h
11366
11366
  }), { commands: f } = new _r({
@@ -11527,7 +11527,7 @@ class At {
11527
11527
  }), this.editor.view.dispatch(t);
11528
11528
  }
11529
11529
  }
11530
- const zb = `.ProseMirror {
11530
+ const Rb = `.ProseMirror {
11531
11531
  position: relative;
11532
11532
  }
11533
11533
 
@@ -11602,7 +11602,7 @@ img.ProseMirror-separator {
11602
11602
  .tippy-box[data-animation=fade][data-state=hidden] {
11603
11603
  opacity: 0
11604
11604
  }`;
11605
- function Rb(n, e, t) {
11605
+ function zb(n, e, t) {
11606
11606
  const i = document.querySelector("style[data-tiptap-style]");
11607
11607
  if (i !== null)
11608
11608
  return i;
@@ -11671,7 +11671,7 @@ class _b extends Gm {
11671
11671
  * Inject CSS styles.
11672
11672
  */
11673
11673
  injectCSS() {
11674
- this.options.injectCSS && document && (this.css = Rb(zb, this.options.injectNonce));
11674
+ this.options.injectCSS && document && (this.css = zb(Rb, this.options.injectNonce));
11675
11675
  }
11676
11676
  /**
11677
11677
  * Update editor options.
@@ -11726,7 +11726,7 @@ class _b extends Gm {
11726
11726
  let i = t;
11727
11727
  if ([].concat(e).forEach((s) => {
11728
11728
  const o = typeof s == "string" ? `${s}$` : s.key;
11729
- i = t.filter((a) => !a.key.startsWith(o));
11729
+ i = i.filter((a) => !a.key.startsWith(o));
11730
11730
  }), t.length === i.length)
11731
11731
  return;
11732
11732
  const r = this.state.reconfigure({
@@ -11959,7 +11959,7 @@ function Lb(n) {
11959
11959
  return new Uo({
11960
11960
  find: n.find,
11961
11961
  handler: ({ state: e, range: t, match: i }) => {
11962
- const r = e.doc.resolve(t.from), s = z(n.getAttributes, void 0, i) || {};
11962
+ const r = e.doc.resolve(t.from), s = R(n.getAttributes, void 0, i) || {};
11963
11963
  if (!r.node(-1).canReplaceWith(r.index(-1), r.indexAfter(-1), n.type))
11964
11964
  return null;
11965
11965
  e.tr.delete(t.from, t.to).setBlockType(t.from, t.from, n.type, s);
@@ -11982,11 +11982,11 @@ function rd(n) {
11982
11982
  }
11983
11983
  });
11984
11984
  }
11985
- function Bb(n) {
11985
+ function jb(n) {
11986
11986
  return new Uo({
11987
11987
  find: n.find,
11988
11988
  handler: ({ state: e, range: t, match: i, chain: r }) => {
11989
- const s = z(n.getAttributes, void 0, i) || {}, o = e.tr.delete(t.from, t.to), l = o.doc.resolve(t.from).blockRange(), c = l && Mo(l, n.type, s);
11989
+ const s = R(n.getAttributes, void 0, i) || {}, o = e.tr.delete(t.from, t.to), l = o.doc.resolve(t.from).blockRange(), c = l && Mo(l, n.type, s);
11990
11990
  if (!c)
11991
11991
  return null;
11992
11992
  if (o.wrap(l, c), n.keepMarks && n.editor) {
@@ -12013,9 +12013,9 @@ let Ko = class Xs {
12013
12013
  }, this.config = {
12014
12014
  ...this.config,
12015
12015
  ...e
12016
- }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = z(S(this, "addOptions", {
12016
+ }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = R(S(this, "addOptions", {
12017
12017
  name: this.name
12018
- }))), this.storage = z(S(this, "addStorage", {
12018
+ }))), this.storage = R(S(this, "addStorage", {
12019
12019
  name: this.name,
12020
12020
  options: this.options
12021
12021
  })) || {};
@@ -12026,15 +12026,15 @@ let Ko = class Xs {
12026
12026
  configure(e = {}) {
12027
12027
  const t = this.extend({
12028
12028
  ...this.config,
12029
- addOptions: () => Br(this.options, e)
12029
+ addOptions: () => jr(this.options, e)
12030
12030
  });
12031
12031
  return t.name = this.name, t.parent = this.parent, t;
12032
12032
  }
12033
12033
  extend(e = {}) {
12034
12034
  const t = new Xs(e);
12035
- return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = z(S(t, "addOptions", {
12035
+ return t.parent = this, this.child = t, t.name = e.name ? e.name : t.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`), t.options = R(S(t, "addOptions", {
12036
12036
  name: t.name
12037
- })), t.storage = z(S(t, "addStorage", {
12037
+ })), t.storage = R(S(t, "addStorage", {
12038
12038
  name: t.name,
12039
12039
  options: t.options
12040
12040
  })), t;
@@ -12049,7 +12049,7 @@ G.prototype.prepend = function(e) {
12049
12049
  return e.length ? G.from(e).append(this) : this;
12050
12050
  };
12051
12051
  G.prototype.appendInner = function(e) {
12052
- return new jb(this, e);
12052
+ return new Bb(this, e);
12053
12053
  };
12054
12054
  G.prototype.slice = function(e, t) {
12055
12055
  return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? G.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
@@ -12104,7 +12104,7 @@ var sd = /* @__PURE__ */ function(n) {
12104
12104
  }, Object.defineProperties(e.prototype, t), e;
12105
12105
  }(G);
12106
12106
  G.empty = new sd([]);
12107
- var jb = /* @__PURE__ */ function(n) {
12107
+ var Bb = /* @__PURE__ */ function(n) {
12108
12108
  function e(t, i) {
12109
12109
  n.call(this), this.left = t, this.right = i, this.length = t.length + i.length, this.depth = Math.max(t.depth, i.depth) + 1;
12110
12110
  }
@@ -12539,7 +12539,7 @@ class ud {
12539
12539
  this._observers = Oe();
12540
12540
  }
12541
12541
  }
12542
- const nt = Math.floor, Ji = Math.abs, Ze = (n, e) => n < e ? n : e, ze = (n, e) => n > e ? n : e, dd = (n) => n !== 0 ? n < 0 : 1 / n < 0, zl = 1, Rl = 2, ws = 4, ks = 8, si = 32, et = 64, ce = 128, ey = 1 << 29, Fr = 31, eo = 63, Bt = 127, ty = 2147483647, hd = Number.MAX_SAFE_INTEGER, ny = Number.isInteger || ((n) => typeof n == "number" && isFinite(n) && nt(n) === n), iy = String.fromCharCode, ry = (n) => n.toLowerCase(), sy = /^\s*/g, oy = (n) => n.replace(sy, ""), ay = /([A-Z])/g, _l = (n, e) => oy(n.replace(ay, (t) => `${e}${ry(t)}`)), ly = (n) => {
12542
+ const nt = Math.floor, Ji = Math.abs, Ze = (n, e) => n < e ? n : e, Re = (n, e) => n > e ? n : e, dd = (n) => n !== 0 ? n < 0 : 1 / n < 0, Rl = 1, zl = 2, ws = 4, ks = 8, si = 32, et = 64, ce = 128, ey = 1 << 29, Fr = 31, eo = 63, jt = 127, ty = 2147483647, hd = Number.MAX_SAFE_INTEGER, ny = Number.isInteger || ((n) => typeof n == "number" && isFinite(n) && nt(n) === n), iy = String.fromCharCode, ry = (n) => n.toLowerCase(), sy = /^\s*/g, oy = (n) => n.replace(sy, ""), ay = /([A-Z])/g, _l = (n, e) => oy(n.replace(ay, (t) => `${e}${ry(t)}`)), ly = (n) => {
12543
12543
  const e = unescape(encodeURIComponent(n)), t = e.length, i = new Uint8Array(t);
12544
12544
  for (let r = 0; r < t; r++)
12545
12545
  i[r] = /** @type {number} */
@@ -12574,18 +12574,18 @@ const Ci = () => new Si(), dy = (n) => {
12574
12574
  return e.set(new Uint8Array(n.cbuf.buffer, 0, n.cpos), t), e;
12575
12575
  }, py = (n, e) => {
12576
12576
  const t = n.cbuf.length;
12577
- t - n.cpos < e && (n.bufs.push(new Uint8Array(n.cbuf.buffer, 0, n.cpos)), n.cbuf = new Uint8Array(ze(t, e) * 2), n.cpos = 0);
12577
+ t - n.cpos < e && (n.bufs.push(new Uint8Array(n.cbuf.buffer, 0, n.cpos)), n.cbuf = new Uint8Array(Re(t, e) * 2), n.cpos = 0);
12578
12578
  }, W = (n, e) => {
12579
12579
  const t = n.cbuf.length;
12580
12580
  n.cpos === t && (n.bufs.push(n.cbuf), n.cbuf = new Uint8Array(t * 2), n.cpos = 0), n.cbuf[n.cpos++] = e;
12581
12581
  }, to = W, I = (n, e) => {
12582
- for (; e > Bt; )
12583
- W(n, ce | Bt & e), e = nt(e / 128);
12584
- W(n, Bt & e);
12582
+ for (; e > jt; )
12583
+ W(n, ce | jt & e), e = nt(e / 128);
12584
+ W(n, jt & e);
12585
12585
  }, Go = (n, e) => {
12586
12586
  const t = dd(e);
12587
12587
  for (t && (e = -e), W(n, (e > eo ? ce : 0) | (t ? et : 0) | eo & e), e = nt(e / 64); e > 0; )
12588
- W(n, (e > Bt ? ce : 0) | Bt & e), e = nt(e / 128);
12588
+ W(n, (e > jt ? ce : 0) | jt & e), e = nt(e / 128);
12589
12589
  }, no = new Uint8Array(3e4), fy = no.length / 3, my = (n, e) => {
12590
12590
  if (e.length < fy) {
12591
12591
  const t = oi.encodeInto(e, no).written || 0;
@@ -12606,7 +12606,7 @@ const Ci = () => new Si(), dy = (n) => {
12606
12606
  }, an = oi && /** @type {any} */
12607
12607
  oi.encodeInto ? my : gy, Vr = (n, e) => {
12608
12608
  const t = n.cbuf.length, i = n.cpos, r = Ze(t - i, e.length), s = e.length - r;
12609
- n.cbuf.set(e.subarray(0, r), i), n.cpos += r, s > 0 && (n.bufs.push(n.cbuf), n.cbuf = new Uint8Array(ze(t * 2, s)), n.cbuf.set(e.subarray(r)), n.cpos = s);
12609
+ n.cbuf.set(e.subarray(0, r), i), n.cpos += r, s > 0 && (n.bufs.push(n.cbuf), n.cbuf = new Uint8Array(Re(t * 2, s)), n.cbuf.set(e.subarray(r)), n.cpos = s);
12610
12610
  }, ke = (n, e) => {
12611
12611
  I(n, e.byteLength), Vr(n, e);
12612
12612
  }, Yo = (n, e) => {
@@ -12653,7 +12653,7 @@ oi.encodeInto ? my : gy, Vr = (n, e) => {
12653
12653
  W(n, 127);
12654
12654
  }
12655
12655
  };
12656
- class Bl extends Si {
12656
+ class jl extends Si {
12657
12657
  /**
12658
12658
  * @param {function(Encoder, T):void} writer
12659
12659
  */
@@ -12667,7 +12667,7 @@ class Bl extends Si {
12667
12667
  this.s === e ? this.count++ : (this.count > 0 && I(this, this.count - 1), this.count = 1, this.w(this, e), this.s = e);
12668
12668
  }
12669
12669
  }
12670
- const jl = (n) => {
12670
+ const Bl = (n) => {
12671
12671
  n.count > 0 && (Go(n.encoder, n.count === 1 ? n.s : -n.s), n.count > 1 && I(n.encoder, n.count - 2));
12672
12672
  };
12673
12673
  class Ki {
@@ -12678,7 +12678,7 @@ class Ki {
12678
12678
  * @param {number} v
12679
12679
  */
12680
12680
  write(e) {
12681
- this.s === e ? this.count++ : (jl(this), this.count = 1, this.s = e);
12681
+ this.s === e ? this.count++ : (Bl(this), this.count = 1, this.s = e);
12682
12682
  }
12683
12683
  /**
12684
12684
  * Flush the encoded state and transform this to a Uint8Array.
@@ -12686,7 +12686,7 @@ class Ki {
12686
12686
  * Note that this should only be called once.
12687
12687
  */
12688
12688
  toUint8Array() {
12689
- return jl(this), Ne(this.encoder);
12689
+ return Bl(this), Ne(this.encoder);
12690
12690
  }
12691
12691
  }
12692
12692
  const $l = (n) => {
@@ -12750,7 +12750,7 @@ const Mn = (n) => new qr(n), xy = (n) => n.pos !== n.arr.length, Sy = (n, e) =>
12750
12750
  const i = n.arr.length;
12751
12751
  for (; n.pos < i; ) {
12752
12752
  const r = n.arr[n.pos++];
12753
- if (e = e + (r & Bt) * t, t *= 128, r < ce)
12753
+ if (e = e + (r & jt) * t, t *= 128, r < ce)
12754
12754
  return e;
12755
12755
  if (e > hd)
12756
12756
  throw fd;
@@ -12763,7 +12763,7 @@ const Mn = (n) => new qr(n), xy = (n) => n.pos !== n.arr.length, Sy = (n, e) =>
12763
12763
  return r * t;
12764
12764
  const s = n.arr.length;
12765
12765
  for (; n.pos < s; ) {
12766
- if (e = n.arr[n.pos++], t = t + (e & Bt) * i, i *= 128, e < ce)
12766
+ if (e = n.arr[n.pos++], t = t + (e & jt) * i, i *= 128, e < ce)
12767
12767
  return r * t;
12768
12768
  if (t > hd)
12769
12769
  throw fd;
@@ -12898,7 +12898,7 @@ class Dy {
12898
12898
  return this.spos = e, t;
12899
12899
  }
12900
12900
  }
12901
- const Ny = crypto.getRandomValues.bind(crypto), Iy = Math.random, md = () => Ny(new Uint32Array(1))[0], Py = (n) => n[nt(Iy() * n.length)], zy = "10000000-1000-4000-8000" + -1e11, Ry = () => zy.replace(
12901
+ const Ny = crypto.getRandomValues.bind(crypto), Iy = Math.random, md = () => Ny(new Uint32Array(1))[0], Py = (n) => n[nt(Iy() * n.length)], Ry = "10000000-1000-4000-8000" + -1e11, zy = () => Ry.replace(
12902
12902
  /[018]/g,
12903
12903
  /** @param {number} c */
12904
12904
  (n) => (n ^ md() & 15 >> n / 4).toString(16)
@@ -12925,12 +12925,12 @@ let Ly = class {
12925
12925
  getItem(e) {
12926
12926
  return this.map.get(e);
12927
12927
  }
12928
- }, gd = new Ly(), By = !0;
12928
+ }, gd = new Ly(), jy = !0;
12929
12929
  try {
12930
- typeof localStorage < "u" && localStorage && (gd = localStorage, By = !1);
12930
+ typeof localStorage < "u" && localStorage && (gd = localStorage, jy = !1);
12931
12931
  } catch {
12932
12932
  }
12933
- const jy = gd, $y = Object.assign, bd = Object.keys, Fy = (n, e) => {
12933
+ const By = gd, $y = Object.assign, bd = Object.keys, Fy = (n, e) => {
12934
12934
  for (const t in n)
12935
12935
  e(n[t], t);
12936
12936
  }, Ul = (n) => bd(n).length, Vy = (n) => {
@@ -12956,26 +12956,26 @@ const jy = gd, $y = Object.assign, bd = Object.keys, Fy = (n, e) => {
12956
12956
  t < n.length && Zo(n, e, t + 1);
12957
12957
  }
12958
12958
  }, Wy = (n) => n, Jy = (n, e) => e.includes(n), kn = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", kd = typeof window < "u" && typeof document < "u" && !kn;
12959
- let je;
12959
+ let Be;
12960
12960
  const Ky = () => {
12961
- if (je === void 0)
12961
+ if (Be === void 0)
12962
12962
  if (kn) {
12963
- je = Oe();
12963
+ Be = Oe();
12964
12964
  const n = process.argv;
12965
12965
  let e = null;
12966
12966
  for (let t = 0; t < n.length; t++) {
12967
12967
  const i = n[t];
12968
- i[0] === "-" ? (e !== null && je.set(e, ""), e = i) : e !== null && (je.set(e, i), e = null);
12968
+ i[0] === "-" ? (e !== null && Be.set(e, ""), e = i) : e !== null && (Be.set(e, i), e = null);
12969
12969
  }
12970
- e !== null && je.set(e, "");
12971
- } else typeof location == "object" ? (je = Oe(), (location.search || "?").slice(1).split("&").forEach((n) => {
12970
+ e !== null && Be.set(e, "");
12971
+ } else typeof location == "object" ? (Be = Oe(), (location.search || "?").slice(1).split("&").forEach((n) => {
12972
12972
  if (n.length !== 0) {
12973
12973
  const [e, t] = n.split("=");
12974
- je.set(`--${_l(e, "-")}`, t), je.set(`-${_l(e, "-")}`, t);
12974
+ Be.set(`--${_l(e, "-")}`, t), Be.set(`-${_l(e, "-")}`, t);
12975
12975
  }
12976
- })) : je = Oe();
12977
- return je;
12978
- }, io = (n) => Ky().has(n), fr = (n) => ql(kn ? process.env[n.toUpperCase().replaceAll("-", "_")] : jy.getItem(n)), vd = (n) => io("--" + n) || fr(n) !== null;
12976
+ })) : Be = Oe();
12977
+ return Be;
12978
+ }, io = (n) => Ky().has(n), fr = (n) => ql(kn ? process.env[n.toUpperCase().replaceAll("-", "_")] : By.getItem(n)), vd = (n) => io("--" + n) || fr(n) !== null;
12979
12979
  vd("production");
12980
12980
  const Gy = kn && Jy(process.env.FORCE_COLOR, ["true", "1", "2"]), Yy = Gy || !io("--no-colors") && // @todo deprecate --no-colors
12981
12981
  !vd("no-color") && (!kn || process.stdout.isTTY) && (!kn || io("--color") || fr("COLORTERM") !== null || (fr("TERM") || "").includes("color")), Xy = (n) => new Uint8Array(n), Qy = (n) => {
@@ -13137,7 +13137,7 @@ const xt = (n, e, t) => e.clients.forEach((i, r) => {
13137
13137
  let t, i;
13138
13138
  for (t = 1, i = 1; t < e.length; t++) {
13139
13139
  const r = e[i - 1], s = e[t];
13140
- r.clock + r.len >= s.clock ? r.len = ze(r.len, s.clock + s.len - r.clock) : (i < t && (e[i] = s), i++);
13140
+ r.clock + r.len >= s.clock ? r.len = Re(r.len, s.clock + s.len - r.clock) : (i < t && (e[i] = s), i++);
13141
13141
  }
13142
13142
  e.length = i;
13143
13143
  });
@@ -13209,7 +13209,7 @@ const xt = (n, e, t) => e.clients.forEach((i, r) => {
13209
13209
  const d = n.readDsClock(), h = d + n.readDsLen();
13210
13210
  if (d < c) {
13211
13211
  c < h && li(i, o, c, h - c);
13212
- let p = Re(l, d), f = l[p];
13212
+ let p = ze(l, d), f = l[p];
13213
13213
  for (!f.deleted && f.id.clock < d && (l.splice(p + 1, 0, vr(e, f, d - f.id.clock)), p++); p < l.length && (f = l[p++], f.id.clock < h); )
13214
13214
  f.deleted || (h < f.id.clock + f.length && l.splice(p, 0, vr(e, f, h - f.id.clock)), f.delete(e));
13215
13215
  } else
@@ -13226,7 +13226,7 @@ class rt extends ud {
13226
13226
  /**
13227
13227
  * @param {DocOpts} opts configuration
13228
13228
  */
13229
- constructor({ guid: e = Ry(), collectionid: t = null, gc: i = !0, gcFilter: r = () => !0, meta: s = null, autoLoad: o = !1, shouldLoad: a = !0 } = {}) {
13229
+ constructor({ guid: e = zy(), collectionid: t = null, gc: i = !0, gcFilter: r = () => !0, meta: s = null, autoLoad: o = !1, shouldLoad: a = !0 } = {}) {
13230
13230
  super(), this.gc = i, this.gcFilter = r, this.clientID = Nd(), this.guid = e, this.collectionid = t, this.share = /* @__PURE__ */ new Map(), this.store = new $d(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = a, this.autoLoad = o, this.meta = s, this.isLoaded = !1, this.isSynced = !1, this.isDestroyed = !1, this.whenLoaded = Vl((c) => {
13231
13231
  this.on("load", () => {
13232
13232
  this.isLoaded = !0, c(this);
@@ -13251,7 +13251,7 @@ class rt extends ud {
13251
13251
  */
13252
13252
  load() {
13253
13253
  const e = this._item;
13254
- e !== null && !this.shouldLoad && B(
13254
+ e !== null && !this.shouldLoad && j(
13255
13255
  /** @type {any} */
13256
13256
  e.parent.doc,
13257
13257
  (t) => {
@@ -13281,7 +13281,7 @@ class rt extends ud {
13281
13281
  * @public
13282
13282
  */
13283
13283
  transact(e, t = null) {
13284
- return B(this, e, t);
13284
+ return j(this, e, t);
13285
13285
  }
13286
13286
  /**
13287
13287
  * Define a shared data type.
@@ -13421,7 +13421,7 @@ class rt extends ud {
13421
13421
  /** @type {ContentDoc} */
13422
13422
  e.content
13423
13423
  );
13424
- t.doc = new rt({ guid: this.guid, ...t.opts, shouldLoad: !1 }), t.doc._item = e, B(
13424
+ t.doc = new rt({ guid: this.guid, ...t.opts, shouldLoad: !1 }), t.doc._item = e, j(
13425
13425
  /** @type {any} */
13426
13426
  e.parent.doc,
13427
13427
  (i) => {
@@ -13656,7 +13656,7 @@ class vn extends ww {
13656
13656
  }
13657
13657
  }
13658
13658
  }
13659
- class zd {
13659
+ class Rd {
13660
13660
  constructor() {
13661
13661
  this.restEncoder = Ci();
13662
13662
  }
@@ -13678,7 +13678,7 @@ class zd {
13678
13678
  I(this.restEncoder, e);
13679
13679
  }
13680
13680
  }
13681
- class Ei extends zd {
13681
+ class Ei extends Rd {
13682
13682
  /**
13683
13683
  * @param {ID} id
13684
13684
  */
@@ -13755,7 +13755,7 @@ class Ei extends zd {
13755
13755
  an(this.restEncoder, e);
13756
13756
  }
13757
13757
  }
13758
- class Rd {
13758
+ class zd {
13759
13759
  constructor() {
13760
13760
  this.restEncoder = Ci(), this.dsCurrVal = 0;
13761
13761
  }
@@ -13779,9 +13779,9 @@ class Rd {
13779
13779
  e === 0 && we(), I(this.restEncoder, e - 1), this.dsCurrVal += e;
13780
13780
  }
13781
13781
  }
13782
- class Ht extends Rd {
13782
+ class Ht extends zd {
13783
13783
  constructor() {
13784
- super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new vs(), this.clientEncoder = new Ki(), this.leftClockEncoder = new vs(), this.rightClockEncoder = new vs(), this.infoEncoder = new Bl(to), this.stringEncoder = new vy(), this.parentInfoEncoder = new Bl(to), this.typeRefEncoder = new Ki(), this.lenEncoder = new Ki();
13784
+ super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new vs(), this.clientEncoder = new Ki(), this.leftClockEncoder = new vs(), this.rightClockEncoder = new vs(), this.infoEncoder = new jl(to), this.stringEncoder = new vy(), this.parentInfoEncoder = new jl(to), this.typeRefEncoder = new Ki(), this.lenEncoder = new Ki();
13785
13785
  }
13786
13786
  toUint8Array() {
13787
13787
  const e = Ci();
@@ -13873,8 +13873,8 @@ class Ht extends Rd {
13873
13873
  }
13874
13874
  }
13875
13875
  const kw = (n, e, t, i) => {
13876
- i = ze(i, e[0].id.clock);
13877
- const r = Re(e, i);
13876
+ i = Re(i, e[0].id.clock);
13877
+ const r = ze(e, i);
13878
13878
  I(n.restEncoder, e.length - r), n.writeClient(t), I(n.restEncoder, i);
13879
13879
  const s = e[r];
13880
13880
  s.write(n, i - s.id.clock);
@@ -14023,7 +14023,7 @@ const kw = (n, e, t, i) => {
14023
14023
  return sa(p, a, /* @__PURE__ */ new Map()), I(p.restEncoder, 0), { missing: l, update: p.toUint8Array() };
14024
14024
  }
14025
14025
  return null;
14026
- }, Sw = (n, e) => sa(n, e.doc.store, e.beforeState), Cw = (n, e, t, i = new vn(n)) => B(e, (r) => {
14026
+ }, Sw = (n, e) => sa(n, e.doc.store, e.beforeState), Cw = (n, e, t, i = new vn(n)) => j(e, (r) => {
14027
14027
  r.local = !1;
14028
14028
  let s = !1;
14029
14029
  const o = r.doc, a = o.store, l = vw(i, o), c = xw(r, a, l), u = a.pendingStructs;
@@ -14082,7 +14082,7 @@ const kw = (n, e, t, i) => {
14082
14082
  return e;
14083
14083
  }, _d = (n) => Ow(new Id(Mn(n))), Ld = (n, e) => (I(n.restEncoder, e.size), kt(e.entries()).sort((t, i) => i[0] - t[0]).forEach(([t, i]) => {
14084
14084
  I(n.restEncoder, t), I(n.restEncoder, i);
14085
- }), n), Dw = (n, e) => Ld(n, Mi(e.store)), Nw = (n, e = new Rd()) => (n instanceof Map ? Ld(e, n) : Dw(e, n), e.toUint8Array()), Iw = (n) => Nw(n, new zd());
14085
+ }), n), Dw = (n, e) => Ld(n, Mi(e.store)), Nw = (n, e = new zd()) => (n instanceof Map ? Ld(e, n) : Dw(e, n), e.toUint8Array()), Iw = (n) => Nw(n, new Rd());
14086
14086
  class Pw {
14087
14087
  constructor() {
14088
14088
  this.l = [];
@@ -14091,7 +14091,7 @@ class Pw {
14091
14091
  const Wl = () => new Pw(), Jl = (n, e) => n.l.push(e), Kl = (n, e) => {
14092
14092
  const t = n.l, i = t.length;
14093
14093
  n.l = t.filter((r) => e !== r), i === n.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
14094
- }, Bd = (n, e, t) => Zo(n.l, [e, t]);
14094
+ }, jd = (n, e, t) => Zo(n.l, [e, t]);
14095
14095
  class cn {
14096
14096
  /**
14097
14097
  * @param {number} client client id
@@ -14127,7 +14127,7 @@ class di {
14127
14127
  }
14128
14128
  }
14129
14129
  const qn = (n) => new di(n.type == null ? null : A(n.type.client, n.type.clock), n.tname ?? null, n.item == null ? null : A(n.item.client, n.item.clock), n.assoc == null ? 0 : n.assoc);
14130
- class zw {
14130
+ class Rw {
14131
14131
  /**
14132
14132
  * @param {AbstractType<any>} type
14133
14133
  * @param {number} index
@@ -14137,7 +14137,7 @@ class zw {
14137
14137
  this.type = e, this.index = t, this.assoc = i;
14138
14138
  }
14139
14139
  }
14140
- const Rw = (n, e, t = 0) => new zw(n, e, t), Li = (n, e, t) => {
14140
+ const zw = (n, e, t = 0) => new Rw(n, e, t), Li = (n, e, t) => {
14141
14141
  let i = null, r = null;
14142
14142
  return n._item === null ? r = ci(n) : i = A(n._item.id.client, n._item.id.clock), new di(i, r, e, t);
14143
14143
  }, Cs = (n, e, t = 0) => {
@@ -14187,7 +14187,7 @@ const Rw = (n, e, t = 0) => new zw(n, e, t), Li = (n, e, t) => {
14187
14187
  if (F(i, s.client) <= s.clock)
14188
14188
  return null;
14189
14189
  const { item: u } = t ? lo(i, s) : { item: un(i, s) };
14190
- if (u instanceof _ && u.content instanceof Be)
14190
+ if (u instanceof _ && u.content instanceof je)
14191
14191
  l = u.content.type;
14192
14192
  else
14193
14193
  return null;
@@ -14195,7 +14195,7 @@ const Rw = (n, e, t = 0) => new zw(n, e, t), Li = (n, e, t) => {
14195
14195
  throw we();
14196
14196
  a >= 0 ? c = l._length : c = 0;
14197
14197
  }
14198
- return Rw(l, c, n.assoc);
14198
+ return zw(l, c, n.assoc);
14199
14199
  }, Gl = (n, e) => n === e || n !== null && e !== null && n.tname === e.tname && rn(n.item, e.item) && rn(n.type, e.type) && n.assoc === e.assoc;
14200
14200
  class oa {
14201
14201
  /**
@@ -14206,7 +14206,7 @@ class oa {
14206
14206
  this.ds = e, this.sv = t;
14207
14207
  }
14208
14208
  }
14209
- const jd = (n, e) => new oa(n, e), Es = (n) => jd(Dd(n.store), Mi(n.store)), Ot = (n, e) => e === void 0 ? !n.deleted : e.sv.has(n.id.client) && (e.sv.get(n.id.client) || 0) > n.id.clock && !An(e.ds, n.id), so = (n, e) => {
14209
+ const Bd = (n, e) => new oa(n, e), Es = (n) => Bd(Dd(n.store), Mi(n.store)), Ot = (n, e) => e === void 0 ? !n.deleted : e.sv.has(n.id.client) && (e.sv.get(n.id.client) || 0) > n.id.clock && !An(e.ds, n.id), so = (n, e) => {
14210
14210
  const t = We(n.meta, so, Ut), i = n.doc.store;
14211
14211
  t.has(e) || (e.sv.forEach((r, s) => {
14212
14212
  r < F(i, s) && fe(n, A(s, r));
@@ -14240,7 +14240,7 @@ const Mi = (n) => {
14240
14240
  throw we();
14241
14241
  }
14242
14242
  t.push(e);
14243
- }, Re = (n, e) => {
14243
+ }, ze = (n, e) => {
14244
14244
  let t = 0, i = n.length - 1, r = n[i], s = r.id.clock;
14245
14245
  if (s === e)
14246
14246
  return i;
@@ -14255,14 +14255,14 @@ const Mi = (n) => {
14255
14255
  o = nt((t + i) / 2);
14256
14256
  }
14257
14257
  throw we();
14258
- }, Bw = (n, e) => {
14258
+ }, jw = (n, e) => {
14259
14259
  const t = n.clients.get(e.client);
14260
- return t[Re(t, e.clock)];
14260
+ return t[ze(t, e.clock)];
14261
14261
  }, un = (
14262
14262
  /** @type {function(StructStore,ID):Item} */
14263
- Bw
14263
+ jw
14264
14264
  ), oo = (n, e, t) => {
14265
- const i = Re(e, t), r = e[i];
14265
+ const i = ze(e, t), r = e[i];
14266
14266
  return r.id.clock < t && r instanceof _ ? (e.splice(i + 1, 0, vr(n, r, t - r.id.clock)), i + 1) : i;
14267
14267
  }, fe = (n, e) => {
14268
14268
  const t = (
@@ -14271,14 +14271,14 @@ const Mi = (n) => {
14271
14271
  );
14272
14272
  return t[oo(n, t, e.clock)];
14273
14273
  }, Yl = (n, e, t) => {
14274
- const i = e.clients.get(t.client), r = Re(i, t.clock), s = i[r];
14274
+ const i = e.clients.get(t.client), r = ze(i, t.clock), s = i[r];
14275
14275
  return t.clock !== s.id.clock + s.length - 1 && s.constructor !== Me && i.splice(r + 1, 0, vr(n, s, t.clock - s.id.clock + 1)), s;
14276
- }, jw = (n, e, t) => {
14276
+ }, Bw = (n, e, t) => {
14277
14277
  const i = (
14278
14278
  /** @type {Array<GC|Item>} */
14279
14279
  n.clients.get(e.id.client)
14280
14280
  );
14281
- i[Re(i, e.id.clock)] = t;
14281
+ i[ze(i, e.id.clock)] = t;
14282
14282
  }, Vd = (n, e, t, i, r) => {
14283
14283
  if (i === 0)
14284
14284
  return;
@@ -14325,7 +14325,7 @@ const Xl = (n, e) => e.deleteSet.clients.size === 0 && !Xb(e.afterState, (t, i)
14325
14325
  );
14326
14326
  for (let o = r.length - 1; o >= 0; o--) {
14327
14327
  const a = r[o], l = a.clock + a.len;
14328
- for (let c = Re(s, a.clock), u = s[c]; c < s.length && u.id.clock < l; u = s[++c]) {
14328
+ for (let c = ze(s, a.clock), u = s[c]; c < s.length && u.id.clock < l; u = s[++c]) {
14329
14329
  const d = s[c];
14330
14330
  if (a.clock + a.len <= d.id.clock)
14331
14331
  break;
@@ -14340,7 +14340,7 @@ const Xl = (n, e) => e.deleteSet.clients.size === 0 && !Xb(e.afterState, (t, i)
14340
14340
  e.clients.get(i)
14341
14341
  );
14342
14342
  for (let s = t.length - 1; s >= 0; s--) {
14343
- const o = t[s], a = Ze(r.length - 1, 1 + Re(r, o.clock + o.len - 1));
14343
+ const o = t[s], a = Ze(r.length - 1, 1 + ze(r, o.clock + o.len - 1));
14344
14344
  for (let l = a, c = r[l]; l > 0 && c.id.clock >= o.clock; c = r[l])
14345
14345
  l -= 1 + Yi(r, l);
14346
14346
  }
@@ -14361,7 +14361,7 @@ const Xl = (n, e) => e.deleteSet.clients.size === 0 && !Xb(e.afterState, (t, i)
14361
14361
  (u) => u.target._item === null || !u.target._item.deleted
14362
14362
  ), l.forEach((u) => {
14363
14363
  u.currentTarget = c, u._path = null;
14364
- }), l.sort((u, d) => u.path.length - d.path.length), Bd(c._dEH, l, t));
14364
+ }), l.sort((u, d) => u.path.length - d.path.length), jd(c._dEH, l, t));
14365
14365
  });
14366
14366
  }), a.push(() => i.emit("afterTransaction", [t, i])), Zo(a, []), t._needFormattingCleanup && ck(t);
14367
14367
  } finally {
@@ -14371,7 +14371,7 @@ const Xl = (n, e) => e.deleteSet.clients.size === 0 && !Xb(e.afterState, (t, i)
14371
14371
  const p = (
14372
14372
  /** @type {Array<GC|Item>} */
14373
14373
  r.clients.get(d)
14374
- ), f = ze(Re(p, h), 1);
14374
+ ), f = Re(ze(p, h), 1);
14375
14375
  for (let m = p.length - 1; m >= f; )
14376
14376
  m -= 1 + Yi(p, m);
14377
14377
  }
@@ -14380,7 +14380,7 @@ const Xl = (n, e) => e.deleteSet.clients.size === 0 && !Xb(e.afterState, (t, i)
14380
14380
  const { client: d, clock: h } = o[u].id, p = (
14381
14381
  /** @type {Array<GC|Item>} */
14382
14382
  r.clients.get(d)
14383
- ), f = Re(p, h);
14383
+ ), f = ze(p, h);
14384
14384
  f + 1 < p.length && Yi(p, f + 1) > 1 || f > 0 && Yi(p, f);
14385
14385
  }
14386
14386
  if (!t.local && t.afterState.get(i.clientID) !== t.beforeState.get(i.clientID) && (gw(ta, xd, "[yjs] ", Sd, Cd, "Changed the client-id because another client seems to be using it."), i.clientID = Nd()), i.emit("afterTransactionCleanup", [t, i]), i._observers.has("update")) {
@@ -14397,7 +14397,7 @@ const Xl = (n, e) => e.deleteSet.clients.size === 0 && !Xb(e.afterState, (t, i)
14397
14397
  }), c.forEach((u) => i.subdocs.delete(u)), i.emit("subdocs", [{ loaded: l, added: a, removed: c }, i, t]), c.forEach((u) => u.destroy())), n.length <= e + 1 ? (i._transactionCleanups = [], i.emit("afterAllTransactions", [i, n])) : qd(n, e + 1);
14398
14398
  }
14399
14399
  }
14400
- }, B = (n, e, t = null, i = !0) => {
14400
+ }, j = (n, e, t = null, i = !0) => {
14401
14401
  const r = n._transactionCleanups;
14402
14402
  let s = !1, o = null;
14403
14403
  n._transaction === null && (s = !0, n._transaction = new $w(n, t, i), r.push(n._transaction), r.length === 1 && n.emit("beforeAllTransactions", [n]), n.emit("beforeTransaction", [n._transaction, n]));
@@ -14431,7 +14431,7 @@ const Zl = (n, e, t) => {
14431
14431
  }, ec = (n, e, t) => {
14432
14432
  let i = null;
14433
14433
  const r = n.doc, s = n.scope;
14434
- B(r, (a) => {
14434
+ j(r, (a) => {
14435
14435
  for (; e.length > 0 && n.currStackItem === null; ) {
14436
14436
  const l = r.store, c = (
14437
14437
  /** @type {StackItem} */
@@ -14787,7 +14787,7 @@ const Hw = (n) => gr(n, Pd, Ei), Ww = (n, e) => {
14787
14787
  continue;
14788
14788
  }
14789
14789
  if (u.id.clock + u.length > h)
14790
- for (ut(o, u, ze(h - u.id.clock, 0)), l.next(); l.curr && l.curr.id.client === d; )
14790
+ for (ut(o, u, Re(h - u.id.clock, 0)), l.next(); l.curr && l.curr.id.client === d; )
14791
14791
  ut(o, l.curr, 0), l.next();
14792
14792
  else
14793
14793
  for (; l.curr && l.curr.id.client === d && l.curr.id.clock + l.curr.length <= h; )
@@ -15025,14 +15025,14 @@ const Qw = (n) => {
15025
15025
  }
15026
15026
  r.p = s, s.marker = !0;
15027
15027
  }
15028
- (e < r.index || t > 0 && e === r.index) && (r.index = ze(e, r.index + t));
15028
+ (e < r.index || t > 0 && e === r.index) && (r.index = Re(e, r.index + t));
15029
15029
  }
15030
15030
  }, Wr = (n, e, t) => {
15031
15031
  const i = n, r = e.changedParentTypes;
15032
15032
  for (; We(r, n, () => []).push(t), n._item !== null; )
15033
15033
  n = /** @type {AbstractType<any>} */
15034
15034
  n._item.parent;
15035
- Bd(i._eH, t, e);
15035
+ jd(i._eH, t, e);
15036
15036
  };
15037
15037
  class Y {
15038
15038
  constructor() {
@@ -15268,7 +15268,7 @@ const Kd = (n, e, t) => {
15268
15268
  break;
15269
15269
  default:
15270
15270
  if (d instanceof Y)
15271
- r = new _(A(o, F(a, o)), r, r && r.lastId, l, l && l.id, e, null, new Be(d)), r.integrate(n, 0);
15271
+ r = new _(A(o, F(a, o)), r, r && r.lastId, l, l && l.id, e, null, new je(d)), r.integrate(n, 0);
15272
15272
  else
15273
15273
  throw new Error("Unexpected content type in insert operation");
15274
15274
  }
@@ -15344,7 +15344,7 @@ const Kd = (n, e, t) => {
15344
15344
  break;
15345
15345
  default:
15346
15346
  if (i instanceof Y)
15347
- a = new Be(i);
15347
+ a = new je(i);
15348
15348
  else
15349
15349
  throw new Error("Unexpected content type");
15350
15350
  }
@@ -15370,7 +15370,7 @@ const Kd = (n, e, t) => {
15370
15370
  s = s.left;
15371
15371
  s !== null && Ot(s, e) && (t[r] = s.content.getContent()[s.length - 1]);
15372
15372
  }), t;
15373
- }, Bi = (n) => (n.doc ?? ae(), bw(
15373
+ }, ji = (n) => (n.doc ?? ae(), bw(
15374
15374
  n._map.entries(),
15375
15375
  /** @param {any} entry */
15376
15376
  (e) => !e[1].deleted
@@ -15459,7 +15459,7 @@ class dn extends Y {
15459
15459
  * @param {Array<T>} content The array of content
15460
15460
  */
15461
15461
  insert(e, t) {
15462
- this.doc !== null ? B(this.doc, (i) => {
15462
+ this.doc !== null ? j(this.doc, (i) => {
15463
15463
  eh(
15464
15464
  i,
15465
15465
  this,
@@ -15477,7 +15477,7 @@ class dn extends Y {
15477
15477
  * @todo Use the following implementation in all types.
15478
15478
  */
15479
15479
  push(e) {
15480
- this.doc !== null ? B(this.doc, (t) => {
15480
+ this.doc !== null ? j(this.doc, (t) => {
15481
15481
  tk(
15482
15482
  t,
15483
15483
  this,
@@ -15501,7 +15501,7 @@ class dn extends Y {
15501
15501
  * @param {number} length The number of elements to remove. Defaults to 1.
15502
15502
  */
15503
15503
  delete(e, t = 1) {
15504
- this.doc !== null ? B(this.doc, (i) => {
15504
+ this.doc !== null ? j(this.doc, (i) => {
15505
15505
  th(i, this, e, t);
15506
15506
  }) : this._prelimContent.splice(e, t);
15507
15507
  }
@@ -15664,7 +15664,7 @@ class xn extends Y {
15664
15664
  * @return {number}
15665
15665
  */
15666
15666
  get size() {
15667
- return [...Bi(this)].length;
15667
+ return [...ji(this)].length;
15668
15668
  }
15669
15669
  /**
15670
15670
  * Returns the keys for each element in the YMap Type.
@@ -15673,7 +15673,7 @@ class xn extends Y {
15673
15673
  */
15674
15674
  keys() {
15675
15675
  return Ss(
15676
- Bi(this),
15676
+ ji(this),
15677
15677
  /** @param {any} v */
15678
15678
  (e) => e[0]
15679
15679
  );
@@ -15685,7 +15685,7 @@ class xn extends Y {
15685
15685
  */
15686
15686
  values() {
15687
15687
  return Ss(
15688
- Bi(this),
15688
+ ji(this),
15689
15689
  /** @param {any} v */
15690
15690
  (e) => e[1].content.getContent()[e[1].length - 1]
15691
15691
  );
@@ -15697,7 +15697,7 @@ class xn extends Y {
15697
15697
  */
15698
15698
  entries() {
15699
15699
  return Ss(
15700
- Bi(this),
15700
+ ji(this),
15701
15701
  /** @param {any} v */
15702
15702
  (e) => (
15703
15703
  /** @type {any} */
@@ -15729,7 +15729,7 @@ class xn extends Y {
15729
15729
  * @param {string} key The key of the element to remove.
15730
15730
  */
15731
15731
  delete(e) {
15732
- this.doc !== null ? B(this.doc, (t) => {
15732
+ this.doc !== null ? j(this.doc, (t) => {
15733
15733
  yr(t, this, e);
15734
15734
  }) : this._prelimContent.delete(e);
15735
15735
  }
@@ -15742,7 +15742,7 @@ class xn extends Y {
15742
15742
  * @return {VAL}
15743
15743
  */
15744
15744
  set(e, t) {
15745
- return this.doc !== null ? B(this.doc, (i) => {
15745
+ return this.doc !== null ? j(this.doc, (i) => {
15746
15746
  da(
15747
15747
  i,
15748
15748
  this,
@@ -15777,7 +15777,7 @@ class xn extends Y {
15777
15777
  * Removes all elements from this YMap.
15778
15778
  */
15779
15779
  clear() {
15780
- this.doc !== null ? B(this.doc, (e) => {
15780
+ this.doc !== null ? j(this.doc, (e) => {
15781
15781
  this.forEach(function(t, i, r) {
15782
15782
  yr(e, r, i);
15783
15783
  });
@@ -15837,7 +15837,7 @@ const nc = (n, e, t) => {
15837
15837
  e.left = e.right, e.right = e.right.right;
15838
15838
  }
15839
15839
  return e;
15840
- }, ji = (n, e, t, i) => {
15840
+ }, Bi = (n, e, t, i) => {
15841
15841
  const r = /* @__PURE__ */ new Map(), s = i ? Hr(e, t) : null;
15842
15842
  if (s) {
15843
15843
  const o = new ao(s.p.left, s.p, s.index, r);
@@ -15899,7 +15899,7 @@ const nc = (n, e, t) => {
15899
15899
  const a = oh(n, e, t, r), l = i.constructor === String ? new _e(
15900
15900
  /** @type {string} */
15901
15901
  i
15902
- ) : i instanceof Y ? new Be(i) : new Yt(i);
15902
+ ) : i instanceof Y ? new je(i) : new Yt(i);
15903
15903
  let { left: c, right: u, index: d } = t;
15904
15904
  e._searchMarker && hi(e._searchMarker, t.index, l.getLength()), u = new _(A(o, F(s.store, o)), c, c && c.lastId, u, u && u.id, e, null, l), u.integrate(n, 0), t.right = u, t.index = d, t.forward(), rh(n, e, t, a);
15905
15905
  }, ic = (n, e, t, i, r) => {
@@ -15993,7 +15993,7 @@ const nc = (n, e, t) => {
15993
15993
  }
15994
15994
  }, lk = (n) => {
15995
15995
  let e = 0;
15996
- return B(
15996
+ return j(
15997
15997
  /** @type {Doc} */
15998
15998
  n.doc,
15999
15999
  (t) => {
@@ -16039,7 +16039,7 @@ const nc = (n, e, t) => {
16039
16039
  }
16040
16040
  );
16041
16041
  }
16042
- B(t, (i) => {
16042
+ j(t, (i) => {
16043
16043
  xt(n, n.deleteSet, (r) => {
16044
16044
  if (r instanceof Me || !/** @type {YText} */
16045
16045
  r.parent._hasFormatting || e.has(
@@ -16061,7 +16061,7 @@ const nc = (n, e, t) => {
16061
16061
  for (; t > 0 && e.right !== null; ) {
16062
16062
  if (e.right.deleted === !1)
16063
16063
  switch (e.right.content.constructor) {
16064
- case Be:
16064
+ case je:
16065
16065
  case Yt:
16066
16066
  case _e:
16067
16067
  t < e.right.length && fe(n, A(e.right.id.client, e.right.id.clock + t)), t -= e.right.length, e.right.delete(n);
@@ -16120,7 +16120,7 @@ class uk extends Ur {
16120
16120
  /** @type {Doc} */
16121
16121
  this.target.doc
16122
16122
  ), t = [];
16123
- B(e, (i) => {
16123
+ j(e, (i) => {
16124
16124
  const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
16125
16125
  let o = this.target._start, a = null;
16126
16126
  const l = {};
@@ -16146,7 +16146,7 @@ class uk extends Ur {
16146
16146
  };
16147
16147
  for (; o !== null; ) {
16148
16148
  switch (o.content.constructor) {
16149
- case Be:
16149
+ case je:
16150
16150
  case Yt:
16151
16151
  this.adds(o) ? this.deletes(o) || (h(), a = "insert", c = o.content.getContent()[0], h()) : this.deletes(o) ? (a !== "delete" && (h(), a = "delete"), d += 1) : o.deleted || (a !== "retain" && (h(), a = "retain"), u += 1);
16152
16152
  break;
@@ -16284,7 +16284,7 @@ class St extends Y {
16284
16284
  * @public
16285
16285
  */
16286
16286
  applyDelta(e, { sanitize: t = !0 } = {}) {
16287
- this.doc !== null ? B(this.doc, (i) => {
16287
+ this.doc !== null ? j(this.doc, (i) => {
16288
16288
  const r = new ao(null, this._start, 0, /* @__PURE__ */ new Map());
16289
16289
  for (let s = 0; s < e.length; s++) {
16290
16290
  const o = e[s];
@@ -16334,7 +16334,7 @@ class St extends Y {
16334
16334
  l.content.str;
16335
16335
  break;
16336
16336
  }
16337
- case Be:
16337
+ case je:
16338
16338
  case Yt: {
16339
16339
  c();
16340
16340
  const d = {
@@ -16364,7 +16364,7 @@ class St extends Y {
16364
16364
  }
16365
16365
  c();
16366
16366
  };
16367
- return e || t ? B(o, (d) => {
16367
+ return e || t ? j(o, (d) => {
16368
16368
  e && so(d, e), t && so(d, t), u();
16369
16369
  }, "cleanup") : u(), r;
16370
16370
  }
@@ -16382,8 +16382,8 @@ class St extends Y {
16382
16382
  if (t.length <= 0)
16383
16383
  return;
16384
16384
  const r = this.doc;
16385
- r !== null ? B(r, (s) => {
16386
- const o = ji(s, this, e, !i);
16385
+ r !== null ? j(r, (s) => {
16386
+ const o = Bi(s, this, e, !i);
16387
16387
  i || (i = {}, o.currentAttributes.forEach((a, l) => {
16388
16388
  i[l] = a;
16389
16389
  })), Ms(s, this, o, t, i);
@@ -16401,8 +16401,8 @@ class St extends Y {
16401
16401
  */
16402
16402
  insertEmbed(e, t, i) {
16403
16403
  const r = this.doc;
16404
- r !== null ? B(r, (s) => {
16405
- const o = ji(s, this, e, !i);
16404
+ r !== null ? j(r, (s) => {
16405
+ const o = Bi(s, this, e, !i);
16406
16406
  Ms(s, this, o, t, i || {});
16407
16407
  }) : this._pending.push(() => this.insertEmbed(e, t, i || {}));
16408
16408
  }
@@ -16418,8 +16418,8 @@ class St extends Y {
16418
16418
  if (t === 0)
16419
16419
  return;
16420
16420
  const i = this.doc;
16421
- i !== null ? B(i, (r) => {
16422
- rc(r, ji(r, this, e, !0), t);
16421
+ i !== null ? j(i, (r) => {
16422
+ rc(r, Bi(r, this, e, !0), t);
16423
16423
  }) : this._pending.push(() => this.delete(e, t));
16424
16424
  }
16425
16425
  /**
@@ -16436,8 +16436,8 @@ class St extends Y {
16436
16436
  if (t === 0)
16437
16437
  return;
16438
16438
  const r = this.doc;
16439
- r !== null ? B(r, (s) => {
16440
- const o = ji(s, this, e, !1);
16439
+ r !== null ? j(r, (s) => {
16440
+ const o = Bi(s, this, e, !1);
16441
16441
  o.right !== null && ic(s, this, o, t, i);
16442
16442
  }) : this._pending.push(() => this.format(e, t, i));
16443
16443
  }
@@ -16451,7 +16451,7 @@ class St extends Y {
16451
16451
  * @public
16452
16452
  */
16453
16453
  removeAttribute(e) {
16454
- this.doc !== null ? B(this.doc, (t) => {
16454
+ this.doc !== null ? j(this.doc, (t) => {
16455
16455
  yr(t, this, e);
16456
16456
  }) : this._pending.push(() => this.removeAttribute(e));
16457
16457
  }
@@ -16466,7 +16466,7 @@ class St extends Y {
16466
16466
  * @public
16467
16467
  */
16468
16468
  setAttribute(e, t) {
16469
- this.doc !== null ? B(this.doc, (i) => {
16469
+ this.doc !== null ? j(this.doc, (i) => {
16470
16470
  da(i, this, e, t);
16471
16471
  }) : this._pending.push(() => this.setAttribute(e, t));
16472
16472
  }
@@ -16707,7 +16707,7 @@ class Wt extends Y {
16707
16707
  * @param {Array<YXmlElement|YXmlText>} content The array of content
16708
16708
  */
16709
16709
  insert(e, t) {
16710
- this.doc !== null ? B(this.doc, (i) => {
16710
+ this.doc !== null ? j(this.doc, (i) => {
16711
16711
  eh(i, this, e, t);
16712
16712
  }) : this._prelimContent.splice(e, 0, ...t);
16713
16713
  }
@@ -16723,7 +16723,7 @@ class Wt extends Y {
16723
16723
  */
16724
16724
  insertAfter(e, t) {
16725
16725
  if (this.doc !== null)
16726
- B(this.doc, (i) => {
16726
+ j(this.doc, (i) => {
16727
16727
  const r = e && e instanceof Y ? e._item : e;
16728
16728
  br(i, this, r, t);
16729
16729
  });
@@ -16744,7 +16744,7 @@ class Wt extends Y {
16744
16744
  * @param {number} [length=1] The number of elements to remove. Defaults to 1.
16745
16745
  */
16746
16746
  delete(e, t = 1) {
16747
- this.doc !== null ? B(this.doc, (i) => {
16747
+ this.doc !== null ? j(this.doc, (i) => {
16748
16748
  th(i, this, e, t);
16749
16749
  }) : this._prelimContent.splice(e, t);
16750
16750
  }
@@ -16906,7 +16906,7 @@ class oe extends Wt {
16906
16906
  * @public
16907
16907
  */
16908
16908
  removeAttribute(e) {
16909
- this.doc !== null ? B(this.doc, (t) => {
16909
+ this.doc !== null ? j(this.doc, (t) => {
16910
16910
  yr(t, this, e);
16911
16911
  }) : this._prelimAttrs.delete(e);
16912
16912
  }
@@ -16921,7 +16921,7 @@ class oe extends Wt {
16921
16921
  * @public
16922
16922
  */
16923
16923
  setAttribute(e, t) {
16924
- this.doc !== null ? B(this.doc, (i) => {
16924
+ this.doc !== null ? j(this.doc, (i) => {
16925
16925
  da(i, this, e, t);
16926
16926
  }) : this._prelimAttrs.set(e, t);
16927
16927
  }
@@ -17173,7 +17173,7 @@ class ye extends St {
17173
17173
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
17174
17174
  */
17175
17175
  _write(e) {
17176
- e.writeTypeRef(zk);
17176
+ e.writeTypeRef(Rk);
17177
17177
  }
17178
17178
  }
17179
17179
  const gk = (n) => new ye();
@@ -17908,8 +17908,8 @@ const Mk = (n) => new _e(n.readString()), Tk = [
17908
17908
  hk,
17909
17909
  mk,
17910
17910
  gk
17911
- ], Ak = 0, Ok = 1, Dk = 2, Nk = 3, Ik = 4, Pk = 5, zk = 6;
17912
- class Be {
17911
+ ], Ak = 0, Ok = 1, Dk = 2, Nk = 3, Ik = 4, Pk = 5, Rk = 6;
17912
+ class je {
17913
17913
  /**
17914
17914
  * @param {AbstractType<any>} type
17915
17915
  */
@@ -17938,7 +17938,7 @@ class Be {
17938
17938
  * @return {ContentType}
17939
17939
  */
17940
17940
  copy() {
17941
- return new Be(this.type._copy());
17941
+ return new je(this.type._copy());
17942
17942
  }
17943
17943
  /**
17944
17944
  * @param {number} offset
@@ -18001,7 +18001,7 @@ class Be {
18001
18001
  return 7;
18002
18002
  }
18003
18003
  }
18004
- const Rk = (n) => new Be(Tk[n.readTypeRef()](n)), lo = (n, e) => {
18004
+ const zk = (n) => new je(Tk[n.readTypeRef()](n)), lo = (n, e) => {
18005
18005
  let t = e, i = 0, r;
18006
18006
  do
18007
18007
  i > 0 && (t = A(t.client, t.clock + i)), r = un(n, t), i = t.clock - r.id.clock, t = r.redone;
@@ -18107,7 +18107,7 @@ class _ extends pa {
18107
18107
  * @param {AbstractContent} content
18108
18108
  */
18109
18109
  constructor(e, t, i, r, s, o, a, l) {
18110
- super(e, l.getLength()), this.origin = i, this.left = t, this.right = r, this.rightOrigin = s, this.parent = o, this.parentSub = a, this.redone = null, this.content = l, this.info = this.content.isCountable() ? Rl : 0;
18110
+ super(e, l.getLength()), this.origin = i, this.left = t, this.right = r, this.rightOrigin = s, this.parent = o, this.parentSub = a, this.redone = null, this.content = l, this.info = this.content.isCountable() ? zl : 0;
18111
18111
  }
18112
18112
  /**
18113
18113
  * This is used to mark the item as an indexed fast-search marker
@@ -18124,13 +18124,13 @@ class _ extends pa {
18124
18124
  * If true, do not garbage collect this Item.
18125
18125
  */
18126
18126
  get keep() {
18127
- return (this.info & zl) > 0;
18127
+ return (this.info & Rl) > 0;
18128
18128
  }
18129
18129
  set keep(e) {
18130
- this.keep !== e && (this.info ^= zl);
18130
+ this.keep !== e && (this.info ^= Rl);
18131
18131
  }
18132
18132
  get countable() {
18133
- return (this.info & Rl) > 0;
18133
+ return (this.info & zl) > 0;
18134
18134
  }
18135
18135
  /**
18136
18136
  * Whether this item was deleted or not.
@@ -18290,7 +18290,7 @@ class _ extends pa {
18290
18290
  gc(e, t) {
18291
18291
  if (!this.deleted)
18292
18292
  throw we();
18293
- this.content.gc(e), t ? jw(e, this, new Me(this.id, this.length)) : this.content = new fi(this.length);
18293
+ this.content.gc(e), t ? Bw(e, this, new Me(this.id, this.length)) : this.content = new fi(this.length);
18294
18294
  }
18295
18295
  /**
18296
18296
  * Transform the properties of this type to binary and write it to an
@@ -18340,7 +18340,7 @@ const uh = (n, e) => _k[e & Fr](n), _k = [
18340
18340
  // 5
18341
18341
  xk,
18342
18342
  // 6
18343
- Rk,
18343
+ zk,
18344
18344
  // 7
18345
18345
  Ek,
18346
18346
  // 8
@@ -18393,7 +18393,7 @@ const dh = (
18393
18393
  ), hh = "__ $YJS$ __";
18394
18394
  dh[hh] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");
18395
18395
  dh[hh] = !0;
18396
- const Bk = () => {
18396
+ const jk = () => {
18397
18397
  let n = !0;
18398
18398
  return (e, t) => {
18399
18399
  if (n) {
@@ -18405,18 +18405,18 @@ const Bk = () => {
18405
18405
  }
18406
18406
  } else t !== void 0 && t();
18407
18407
  };
18408
- }, jk = /[\uD800-\uDBFF]/, $k = /[\uDC00-\uDFFF]/, Fk = (n, e) => {
18408
+ }, Bk = /[\uD800-\uDBFF]/, $k = /[\uDC00-\uDFFF]/, Fk = (n, e) => {
18409
18409
  let t = 0, i = 0;
18410
18410
  for (; t < n.length && t < e.length && n[t] === e[t]; )
18411
18411
  t++;
18412
- for (t > 0 && jk.test(n[t - 1]) && t--; i + t < n.length && i + t < e.length && n[n.length - i - 1] === e[e.length - i - 1]; )
18412
+ for (t > 0 && Bk.test(n[t - 1]) && t--; i + t < n.length && i + t < e.length && n[n.length - i - 1] === e[e.length - i - 1]; )
18413
18413
  i++;
18414
18414
  return i > 0 && $k.test(n[n.length - i]) && i--, {
18415
18415
  index: t,
18416
18416
  remove: n.length - t - i,
18417
18417
  insert: e.slice(t, e.length - i)
18418
18418
  };
18419
- }, Vk = Fk, j = new pe("y-sync"), tt = new pe("y-undo"), $i = new pe("yjs-cursor"), Ve = (n, e) => n >>> e | n << 32 - e, qk = (n) => Ve(n, 2) ^ Ve(n, 13) ^ Ve(n, 22), Uk = (n) => Ve(n, 6) ^ Ve(n, 11) ^ Ve(n, 25), Hk = (n) => Ve(n, 7) ^ Ve(n, 18) ^ n >>> 3, Wk = (n) => Ve(n, 17) ^ Ve(n, 19) ^ n >>> 10, Jk = new Uint32Array([
18419
+ }, Vk = Fk, B = new pe("y-sync"), tt = new pe("y-undo"), $i = new pe("yjs-cursor"), Ve = (n, e) => n >>> e | n << 32 - e, qk = (n) => Ve(n, 2) ^ Ve(n, 13) ^ Ve(n, 22), Uk = (n) => Ve(n, 6) ^ Ve(n, 11) ^ Ve(n, 25), Hk = (n) => Ve(n, 7) ^ Ve(n, 18) ^ n >>> 3, Wk = (n) => Ve(n, 17) ^ Ve(n, 19) ^ n >>> 10, Jk = new Uint32Array([
18420
18420
  1116352408,
18421
18421
  1899447441,
18422
18422
  3049323471,
@@ -18566,11 +18566,11 @@ e.sv.get(n.id.client) > n.id.clock && !An(e.ds, n.id), Zk = [{ light: "#ecd44433
18566
18566
  const a = new iv(n, s), l = new ie({
18567
18567
  props: {
18568
18568
  editable: (c) => {
18569
- const u = j.getState(c);
18569
+ const u = B.getState(c);
18570
18570
  return u.snapshot == null && u.prevSnapshot == null;
18571
18571
  }
18572
18572
  },
18573
- key: j,
18573
+ key: B,
18574
18574
  state: {
18575
18575
  /**
18576
18576
  * @returns {any}
@@ -18589,7 +18589,7 @@ e.sv.get(n.id.client) > n.id.clock && !An(e.ds, n.id), Zk = [{ light: "#ecd44433
18589
18589
  permanentUserData: i
18590
18590
  }),
18591
18591
  apply: (c, u) => {
18592
- const d = c.getMeta(j);
18592
+ const d = c.getMeta(B);
18593
18593
  if (d !== void 0) {
18594
18594
  u = Object.assign({}, u);
18595
18595
  for (const h in d)
@@ -18628,7 +18628,7 @@ e.sv.get(n.id.client) > n.id.clock && !An(e.ds, n.id), Zk = [{ light: "#ecd44433
18628
18628
  a.mux(() => {
18629
18629
  u.doc.transact((d) => {
18630
18630
  d.meta.set("addToHistory", u.addToHistory), a._prosemirrorChanged(c.state.doc);
18631
- }, j);
18631
+ }, B);
18632
18632
  });
18633
18633
  }
18634
18634
  },
@@ -18686,7 +18686,7 @@ class iv {
18686
18686
  * @param {ProsemirrorMapping} mapping
18687
18687
  */
18688
18688
  constructor(e, t = /* @__PURE__ */ new Map()) {
18689
- this.type = e, this.prosemirrorView = null, this.mux = Bk(), this.mapping = t, this.isOMark = /* @__PURE__ */ new Map(), this._observeFunction = this._typeChanged.bind(this), this.doc = e.doc, this.beforeTransactionSelection = null, this.beforeAllTransactions = () => {
18689
+ this.type = e, this.prosemirrorView = null, this.mux = jk(), this.mapping = t, this.isOMark = /* @__PURE__ */ new Map(), this._observeFunction = this._typeChanged.bind(this), this.doc = e.doc, this.beforeTransactionSelection = null, this.beforeAllTransactions = () => {
18690
18690
  this.beforeTransactionSelection === null && this.prosemirrorView != null && (this.beforeTransactionSelection = co(
18691
18691
  this,
18692
18692
  this.prosemirrorView.state
@@ -18721,8 +18721,8 @@ class iv {
18721
18721
  * @param {Y.Snapshot} prevSnapshot
18722
18722
  */
18723
18723
  renderSnapshot(e, t) {
18724
- t || (t = jd(Od(), /* @__PURE__ */ new Map())), this.prosemirrorView.dispatch(
18725
- this._tr.setMeta(j, { snapshot: e, prevSnapshot: t })
18724
+ t || (t = Bd(Od(), /* @__PURE__ */ new Map())), this.prosemirrorView.dispatch(
18725
+ this._tr.setMeta(B, { snapshot: e, prevSnapshot: t })
18726
18726
  );
18727
18727
  }
18728
18728
  unrenderSnapshot() {
@@ -18739,7 +18739,7 @@ class iv {
18739
18739
  this.prosemirrorView.state.doc.content.size,
18740
18740
  new v(y.from(e), 0, 0)
18741
18741
  );
18742
- t.setMeta(j, { snapshot: null, prevSnapshot: null }), this.prosemirrorView.dispatch(t);
18742
+ t.setMeta(B, { snapshot: null, prevSnapshot: null }), this.prosemirrorView.dispatch(t);
18743
18743
  });
18744
18744
  }
18745
18745
  _forceRerender() {
@@ -18757,11 +18757,11 @@ class iv {
18757
18757
  new v(y.from(t), 0, 0)
18758
18758
  );
18759
18759
  if (e) {
18760
- const r = Ze(ze(e.anchor, 0), i.doc.content.size), s = Ze(ze(e.head, 0), i.doc.content.size);
18760
+ const r = Ze(Re(e.anchor, 0), i.doc.content.size), s = Ze(Re(e.head, 0), i.doc.content.size);
18761
18761
  i.setSelection(T.create(i.doc, r, s));
18762
18762
  }
18763
18763
  this.prosemirrorView.dispatch(
18764
- i.setMeta(j, { isChangeOrigin: !0, binding: this })
18764
+ i.setMeta(B, { isChangeOrigin: !0, binding: this })
18765
18765
  );
18766
18766
  });
18767
18767
  }
@@ -18779,7 +18779,7 @@ class iv {
18779
18779
  );
18780
18780
  s = r.getXmlFragment(o);
18781
18781
  } else {
18782
- const o = r.store.clients.get(s._item.id.client) ?? [], a = Re(
18782
+ const o = r.store.clients.get(s._item.id.client) ?? [], a = ze(
18783
18783
  o,
18784
18784
  s._item.id.clock
18785
18785
  );
@@ -18822,9 +18822,9 @@ class iv {
18822
18822
  new v(y.from(c), 0, 0)
18823
18823
  );
18824
18824
  this.prosemirrorView.dispatch(
18825
- u.setMeta(j, { isChangeOrigin: !0 })
18825
+ u.setMeta(B, { isChangeOrigin: !0 })
18826
18826
  );
18827
- }, j);
18827
+ }, B);
18828
18828
  });
18829
18829
  }
18830
18830
  /**
@@ -18833,7 +18833,7 @@ class iv {
18833
18833
  */
18834
18834
  _typeChanged(e, t) {
18835
18835
  if (this.prosemirrorView == null) return;
18836
- const i = j.getState(this.prosemirrorView.state);
18836
+ const i = B.getState(this.prosemirrorView.state);
18837
18837
  if (e.length === 0 || i.snapshot != null || i.prevSnapshot != null) {
18838
18838
  this.renderSnapshot(i.snapshot, i.prevSnapshot);
18839
18839
  return;
@@ -18867,7 +18867,7 @@ class iv {
18867
18867
  this.prosemirrorView.state.doc.content.size,
18868
18868
  new v(y.from(s), 0, 0)
18869
18869
  );
18870
- nv(o, this.beforeTransactionSelection, this), o = o.setMeta(j, { isChangeOrigin: !0, isUndoRedoOperation: t.origin instanceof Ud }), this.beforeTransactionSelection !== null && this._isLocalCursorInView() && o.scrollIntoView(), this.prosemirrorView.dispatch(o);
18870
+ nv(o, this.beforeTransactionSelection, this), o = o.setMeta(B, { isChangeOrigin: !0, isUndoRedoOperation: t.origin instanceof Ud }), this.beforeTransactionSelection !== null && this._isLocalCursorInView() && o.scrollIntoView(), this.prosemirrorView.dispatch(o);
18871
18871
  });
18872
18872
  }
18873
18873
  /**
@@ -18879,7 +18879,7 @@ class iv {
18879
18879
  this,
18880
18880
  this.prosemirrorView.state
18881
18881
  );
18882
- }, j);
18882
+ }, B);
18883
18883
  }
18884
18884
  /**
18885
18885
  * View is ready to listen to changes. Register observers.
@@ -18972,7 +18972,7 @@ const ph = (n, e, t, i, r, s) => {
18972
18972
  } catch {
18973
18973
  return n.doc.transact((c) => {
18974
18974
  n._item.delete(c);
18975
- }, j), t.mapping.delete(n), null;
18975
+ }, B), t.mapping.delete(n), null;
18976
18976
  }
18977
18977
  }, rv = (n, e, t, i, r, s) => {
18978
18978
  const o = [], a = n.toDelta(i, r, s);
@@ -18984,7 +18984,7 @@ const ph = (n, e, t, i, r, s) => {
18984
18984
  } catch {
18985
18985
  return n.doc.transact((c) => {
18986
18986
  n._item.delete(c);
18987
- }, j), null;
18987
+ }, B), null;
18988
18988
  }
18989
18989
  return o;
18990
18990
  }, sv = (n, e) => {
@@ -19189,7 +19189,7 @@ const ph = (n, e, t, i, r, s) => {
19189
19189
  h.push(uo(r[p], i));
19190
19190
  e.insert(c, h);
19191
19191
  }
19192
- }, j);
19192
+ }, B);
19193
19193
  }, po = (n, e) => !(e instanceof Array) && n.nodeName === e.type.name;
19194
19194
  let Un = null;
19195
19195
  const dv = () => {
@@ -19198,7 +19198,7 @@ const dv = () => {
19198
19198
  Un
19199
19199
  );
19200
19200
  Un = null, n.forEach((e, t) => {
19201
- const i = t.state.tr, r = j.getState(t.state);
19201
+ const i = t.state.tr, r = B.getState(t.state);
19202
19202
  r && r.binding && !r.binding.isDestroyed && (e.forEach((s, o) => {
19203
19203
  i.setMeta(o, s);
19204
19204
  }), t.dispatch(i));
@@ -19361,7 +19361,7 @@ const mv = (n, e, t) => n !== e, gv = (n) => {
19361
19361
  style: `background-color: ${n.color}70`,
19362
19362
  class: "ProseMirror-yjs-selection"
19363
19363
  }), bv = /^#[0-9a-fA-F]{6}$/, lc = (n, e, t, i, r) => {
19364
- const s = j.getState(n), o = s.doc, a = [];
19364
+ const s = B.getState(n), o = s.doc, a = [];
19365
19365
  return s.snapshot != null || s.prevSnapshot != null || s.binding.mapping.size === 0 ? $.create(n.doc, []) : (e.getStates().forEach((l, c) => {
19366
19366
  if (t(o.clientID, c, l) && l.cursor != null) {
19367
19367
  const u = l.user || {};
@@ -19378,14 +19378,14 @@ const mv = (n, e, t) => n !== e, gv = (n) => {
19378
19378
  s.binding.mapping
19379
19379
  );
19380
19380
  if (d !== null && h !== null) {
19381
- const p = ze(n.doc.content.size - 1, 0);
19381
+ const p = Re(n.doc.content.size - 1, 0);
19382
19382
  d = Ze(d, p), h = Ze(h, p), a.push(
19383
19383
  me.widget(h, () => i(u, c), {
19384
19384
  key: c + "",
19385
19385
  side: 10
19386
19386
  })
19387
19387
  );
19388
- const f = Ze(d, h), m = ze(d, h);
19388
+ const f = Ze(d, h), m = Re(d, h);
19389
19389
  a.push(
19390
19390
  me.inline(f, m, r(u, c), {
19391
19391
  inclusiveEnd: !0,
@@ -19413,7 +19413,7 @@ const mv = (n, e, t) => n !== e, gv = (n) => {
19413
19413
  );
19414
19414
  },
19415
19415
  apply(o, a, l, c) {
19416
- const u = j.getState(c), d = o.getMeta($i);
19416
+ const u = B.getState(c), d = o.getMeta($i);
19417
19417
  return u && u.isChangeOrigin || d && d.awarenessUpdated ? lc(
19418
19418
  c,
19419
19419
  n,
@@ -19430,7 +19430,7 @@ const mv = (n, e, t) => n !== e, gv = (n) => {
19430
19430
  const a = () => {
19431
19431
  o.docView && hv(o, $i, { awarenessUpdated: !0 });
19432
19432
  }, l = () => {
19433
- const c = j.getState(o.state), u = n.getLocalState() || {};
19433
+ const c = B.getState(o.state), u = n.getLocalState() || {};
19434
19434
  if (o.hasFocus()) {
19435
19435
  const d = r(o.state), h = Cr(
19436
19436
  d.anchor,
@@ -19471,12 +19471,12 @@ const mv = (n, e, t) => n !== e, gv = (n) => {
19471
19471
  }, kv = (n) => {
19472
19472
  var e, t;
19473
19473
  return ((t = (e = tt.getState(n)) == null ? void 0 : e.undoManager) == null ? void 0 : t.redo()) != null;
19474
- }, vv = /* @__PURE__ */ new Set(["paragraph"]), xv = (n, e) => !(n instanceof _) || !(n.content instanceof Be) || !(n.content.type instanceof St || n.content.type instanceof oe && e.has(n.content.type.nodeName)) || n.content.type._length === 0, Sv = ({ protectedNodes: n = vv, trackedOrigins: e = [], undoManager: t = null } = {}) => new ie({
19474
+ }, vv = /* @__PURE__ */ new Set(["paragraph"]), xv = (n, e) => !(n instanceof _) || !(n.content instanceof je) || !(n.content.type instanceof St || n.content.type instanceof oe && e.has(n.content.type.nodeName)) || n.content.type._length === 0, Sv = ({ protectedNodes: n = vv, trackedOrigins: e = [], undoManager: t = null } = {}) => new ie({
19475
19475
  key: tt,
19476
19476
  state: {
19477
19477
  init: (i, r) => {
19478
- const s = j.getState(r), o = t || new Ud(s.type, {
19479
- trackedOrigins: new Set([j].concat(e)),
19478
+ const s = B.getState(r), o = t || new Ud(s.type, {
19479
+ trackedOrigins: new Set([B].concat(e)),
19480
19480
  deleteFilter: (a) => xv(a, n),
19481
19481
  captureTransaction: (a) => a.meta.get("addToHistory") !== !1
19482
19482
  });
@@ -19488,7 +19488,7 @@ const mv = (n, e, t) => n !== e, gv = (n) => {
19488
19488
  };
19489
19489
  },
19490
19490
  apply: (i, r, s, o) => {
19491
- const a = j.getState(o).binding, l = r.undoManager, c = l.undoStack.length > 0, u = l.redoStack.length > 0;
19491
+ const a = B.getState(o).binding, l = r.undoManager, c = l.undoStack.length > 0, u = l.redoStack.length > 0;
19492
19492
  return a ? {
19493
19493
  undoManager: l,
19494
19494
  prevSel: co(a, s),
@@ -19501,7 +19501,7 @@ const mv = (n, e, t) => n !== e, gv = (n) => {
19501
19501
  }
19502
19502
  },
19503
19503
  view: (i) => {
19504
- const r = j.getState(i.state), s = tt.getState(i.state).undoManager;
19504
+ const r = B.getState(i.state), s = tt.getState(i.state).undoManager;
19505
19505
  return s.on("stack-item-added", ({ stackItem: o }) => {
19506
19506
  const a = r.binding;
19507
19507
  a && o.meta.set(a, tt.getState(i.state).prevSel);
@@ -19666,15 +19666,15 @@ const Er = (n, e) => {
19666
19666
  for (; e > Qi; )
19667
19667
  Er(n, bh | Qi & e), e = Mv(e / 128);
19668
19668
  Er(n, Qi & e);
19669
- }, fo = new Uint8Array(3e4), Pv = fo.length / 3, zv = (n, e) => {
19669
+ }, fo = new Uint8Array(3e4), Pv = fo.length / 3, Rv = (n, e) => {
19670
19670
  if (e.length < Pv) {
19671
19671
  const t = gi.encodeInto(e, fo).written || 0;
19672
19672
  Kr(n, t);
19673
19673
  for (let i = 0; i < t; i++)
19674
19674
  Er(n, fo[i]);
19675
19675
  } else
19676
- Bv(n, Iv(e));
19677
- }, Rv = (n, e) => {
19676
+ jv(n, Iv(e));
19677
+ }, zv = (n, e) => {
19678
19678
  const t = unescape(encodeURIComponent(e)), i = t.length;
19679
19679
  Kr(n, i);
19680
19680
  for (let r = 0; r < i; r++)
@@ -19684,12 +19684,12 @@ const Er = (n, e) => {
19684
19684
  t.codePointAt(r)
19685
19685
  );
19686
19686
  }, _v = gi && /** @type {any} */
19687
- gi.encodeInto ? zv : Rv, Lv = (n, e) => {
19687
+ gi.encodeInto ? Rv : zv, Lv = (n, e) => {
19688
19688
  const t = n.cbuf.length, i = n.cpos, r = Tv(t - i, e.length), s = e.length - r;
19689
19689
  n.cbuf.set(e.subarray(0, r), i), n.cpos += r, s > 0 && (n.bufs.push(n.cbuf), n.cbuf = new Uint8Array(Av(t * 2, s)), n.cbuf.set(e.subarray(r)), n.cpos = s);
19690
- }, Bv = (n, e) => {
19690
+ }, jv = (n, e) => {
19691
19691
  Kr(n, e.byteLength), Lv(n, e);
19692
- }, yh = (n) => new Error(n), jv = yh("Unexpected end of array"), $v = yh("Integer out of Range"), Fv = (n, e) => {
19692
+ }, yh = (n) => new Error(n), Bv = yh("Unexpected end of array"), $v = yh("Integer out of Range"), Fv = (n, e) => {
19693
19693
  const t = new Uint8Array(n.arr.buffer, n.pos + n.arr.byteOffset, e);
19694
19694
  return n.pos += e, t;
19695
19695
  }, Vv = (n) => Fv(n, ba(n)), dc = (n) => n.arr[n.pos++], ba = (n) => {
@@ -19702,7 +19702,7 @@ gi.encodeInto ? zv : Rv, Lv = (n, e) => {
19702
19702
  if (e > Ov)
19703
19703
  throw $v;
19704
19704
  }
19705
- throw jv;
19705
+ throw Bv;
19706
19706
  }, qv = (n) => {
19707
19707
  let e = ba(n);
19708
19708
  if (e === 0)
@@ -20043,7 +20043,7 @@ class M0 {
20043
20043
  const Dh = (n) => new M0(n), T0 = (n, e) => {
20044
20044
  const t = new Uint8Array(n.arr.buffer, n.pos + n.arr.byteOffset, e);
20045
20045
  return n.pos += e, t;
20046
- }, Gr = (n) => T0(n, jt(n)), wc = (n) => n.arr[n.pos++], jt = (n) => {
20046
+ }, Gr = (n) => T0(n, Bt(n)), wc = (n) => n.arr[n.pos++], Bt = (n) => {
20047
20047
  let e = 0, t = 1;
20048
20048
  const i = n.arr.length;
20049
20049
  for (; n.pos < i; ) {
@@ -20068,7 +20068,7 @@ const Dh = (n) => new M0(n), T0 = (n, e) => {
20068
20068
  }
20069
20069
  throw Ah;
20070
20070
  }, O0 = (n) => {
20071
- let e = jt(n);
20071
+ let e = Bt(n);
20072
20072
  if (e === 0)
20073
20073
  return "";
20074
20074
  {
@@ -20093,7 +20093,7 @@ const Dh = (n) => new M0(n), T0 = (n, e) => {
20093
20093
  ), Yr = Wn ? D0 : O0, N0 = (n) => {
20094
20094
  const e = n.pos, t = Yr(n);
20095
20095
  return n.pos = e, t;
20096
- }, I0 = (n) => new Uint8Array(n), P0 = (n, e, t) => new Uint8Array(n, e, t), z0 = (n) => new Uint8Array(n), R0 = (n) => {
20096
+ }, I0 = (n) => new Uint8Array(n), P0 = (n, e, t) => new Uint8Array(n, e, t), R0 = (n) => new Uint8Array(n), z0 = (n) => {
20097
20097
  let e = "";
20098
20098
  for (let t = 0; t < n.byteLength; t++)
20099
20099
  e += Zv(n[t]);
@@ -20103,10 +20103,10 @@ const Dh = (n) => new M0(n), T0 = (n, e) => {
20103
20103
  for (let i = 0; i < e.length; i++)
20104
20104
  t[i] = e.charCodeAt(i);
20105
20105
  return t;
20106
- }, B0 = (n) => {
20106
+ }, j0 = (n) => {
20107
20107
  const e = Buffer.from(n, "base64");
20108
20108
  return P0(e.buffer, e.byteOffset, e.byteLength);
20109
- }, j0 = Sh ? R0 : _0, $0 = Sh ? L0 : B0, Nh = /* @__PURE__ */ new Map();
20109
+ }, B0 = Sh ? z0 : _0, $0 = Sh ? L0 : j0, Nh = /* @__PURE__ */ new Map();
20110
20110
  class F0 {
20111
20111
  /**
20112
20112
  * @param {string} room
@@ -20118,7 +20118,7 @@ class F0 {
20118
20118
  * @param {ArrayBuffer} buf
20119
20119
  */
20120
20120
  postMessage(e) {
20121
- xh.setItem(this.room, j0(z0(e)));
20121
+ xh.setItem(this.room, B0(R0(e)));
20122
20122
  }
20123
20123
  close() {
20124
20124
  c0(this._onChange);
@@ -20283,10 +20283,10 @@ const Zi = (n, e, t) => {
20283
20283
  }
20284
20284
  return ka(r);
20285
20285
  }, G0 = (n, e, t) => {
20286
- const i = Dh(e), r = Cn(), s = [], o = [], a = [], l = [], c = jt(i);
20286
+ const i = Dh(e), r = Cn(), s = [], o = [], a = [], l = [], c = Bt(i);
20287
20287
  for (let u = 0; u < c; u++) {
20288
- const d = jt(i);
20289
- let h = jt(i);
20288
+ const d = Bt(i);
20289
+ let h = Bt(i);
20290
20290
  const p = JSON.parse(Yr(i)), f = n.meta.get(d), m = n.states.get(d), g = f === void 0 ? 0 : f.clock;
20291
20291
  (g < h || g === h && p === null && n.states.has(d)) && (p === null ? d === n.clientID && n.getLocalState() != null ? h++ : n.states.delete(d) : n.states.set(d, p), n.meta.set(d, {
20292
20292
  clock: h,
@@ -20339,7 +20339,7 @@ class er {
20339
20339
  return N0(this.decoder);
20340
20340
  }
20341
20341
  readVarUint() {
20342
- return jt(this.decoder);
20342
+ return Bt(this.decoder);
20343
20343
  }
20344
20344
  readVarString() {
20345
20345
  return Yr(this.decoder);
@@ -20543,22 +20543,22 @@ class X0 extends Ih {
20543
20543
  this.emit("destroy"), this.intervals.forceSync && clearInterval(this.intervals.forceSync), clearInterval(this.intervals.connectionChecker), this.stopConnectionAttempt(), this.disconnect(), this.removeAllListeners(), this.cleanupWebSocket();
20544
20544
  }
20545
20545
  }
20546
- const Ph = 0, xa = 1, zh = 2, Q0 = (n, e) => {
20546
+ const Ph = 0, xa = 1, Rh = 2, Q0 = (n, e) => {
20547
20547
  X(n, Ph);
20548
20548
  const t = Iw(e);
20549
20549
  Nn(n, t);
20550
- }, Rh = (n, e, t) => {
20550
+ }, zh = (n, e, t) => {
20551
20551
  X(n, xa), Nn(n, Aw(e, t));
20552
- }, Z0 = (n, e, t) => Rh(e, t, Gr(n)), _h = (n, e, t) => {
20552
+ }, Z0 = (n, e, t) => zh(e, t, Gr(n)), _h = (n, e, t) => {
20553
20553
  try {
20554
20554
  Ew(e, Gr(n), t);
20555
20555
  } catch (i) {
20556
20556
  console.error("Caught error while handling a Yjs update", i);
20557
20557
  }
20558
20558
  }, ex = (n, e) => {
20559
- X(n, zh), Nn(n, e);
20559
+ X(n, Rh), Nn(n, e);
20560
20560
  }, tx = _h, nx = (n, e, t, i) => {
20561
- const r = jt(n);
20561
+ const r = Bt(n);
20562
20562
  switch (r) {
20563
20563
  case Ph:
20564
20564
  Z0(n, e, t);
@@ -20566,7 +20566,7 @@ const Ph = 0, xa = 1, zh = 2, Q0 = (n, e) => {
20566
20566
  case xa:
20567
20567
  _h(n, t, i);
20568
20568
  break;
20569
- case zh:
20569
+ case Rh:
20570
20570
  tx(n, t, i);
20571
20571
  break;
20572
20572
  default:
@@ -20724,7 +20724,7 @@ class ax extends He {
20724
20724
  get(e) {
20725
20725
  if (typeof e.document > "u")
20726
20726
  throw new Error("The sync step two message requires document as an argument");
20727
- return Le(this.encoder, e.documentName), X(this.encoder, this.type), Rh(this.encoder, e.document), this.encoder;
20727
+ return Le(this.encoder, e.documentName), X(this.encoder, this.type), zh(this.encoder, e.document), this.encoder;
20728
20728
  }
20729
20729
  }
20730
20730
  class lx extends He {
@@ -21117,7 +21117,7 @@ const hx = Ko.create({
21117
21117
  getAttributes: () => n.attributes || {}
21118
21118
  });
21119
21119
  if (n.type === "wrapping")
21120
- return Bb({
21120
+ return jb({
21121
21121
  find: new RegExp(n.find),
21122
21122
  type: this.type,
21123
21123
  keepMarks: !0,
@@ -21412,64 +21412,66 @@ const xx = Lh.extend({
21412
21412
  new ie({
21413
21413
  key: new pe("footnoteRules"),
21414
21414
  appendTransaction(e, t, i) {
21415
- let r = i.tr, s = null, o = !1, a = /* @__PURE__ */ new Set();
21416
- if (e.some((c) => c.steps.some((u) => u instanceof V ? u.from === 0 && u.to === t.doc.content.size : !1)))
21417
- o = !0;
21415
+ if (e.every((u) => u.meta["y-sync$"] !== void 0))
21416
+ return null;
21417
+ let s = i.tr, o = null, a = !1, l = /* @__PURE__ */ new Set();
21418
+ if (e.some((u) => u.steps.some((d) => d instanceof V ? d.from === 0 && d.to === t.doc.content.size : !1)))
21419
+ a = !0;
21418
21420
  else
21419
- for (let c of e)
21420
- if (c.docChanged)
21421
- for (let u of c.steps) {
21422
- if (!(u instanceof V)) continue;
21423
- u.slice.size > 0 && u.slice.content.descendants((g, b) => {
21424
- if ((g == null ? void 0 : g.type.name) == "anchor")
21425
- return s = g.attrs.id, o = !0, !1;
21421
+ for (let u of e)
21422
+ if (u.docChanged)
21423
+ for (let d of u.steps) {
21424
+ if (!(d instanceof V)) continue;
21425
+ d.slice.size > 0 && d.slice.content.descendants((b, k) => {
21426
+ if ((b == null ? void 0 : b.type.name) == "anchor")
21427
+ return o = b.attrs.id, a = !0, !1;
21426
21428
  });
21427
- const h = c.docs[0], p = c.doc, f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
21428
- h.descendants((g, b) => {
21429
- g.type.name === "anchor" && f.set(g.attrs.id, b);
21430
- }), p.descendants((g, b) => {
21431
- g.type.name === "anchor" && m.set(g.attrs.id, b);
21429
+ const p = u.docs[0], f = u.doc, m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
21430
+ p.descendants((b, k) => {
21431
+ b.type.name === "anchor" && m.set(b.attrs.id, k);
21432
+ }), f.descendants((b, k) => {
21433
+ b.type.name === "anchor" && g.set(b.attrs.id, k);
21432
21434
  });
21433
- for (const [g, b] of f)
21434
- m.has(g) || (a.add(g), o = !0);
21435
- (f.size !== m.size || Array.from(f.entries()).some(([g, b]) => m.get(g) !== b)) && (o = !0);
21435
+ for (const [b, k] of m)
21436
+ g.has(b) || (l.add(b), a = !0);
21437
+ (m.size !== g.size || Array.from(m.entries()).some(([b, k]) => g.get(b) !== k)) && (a = !0);
21436
21438
  }
21437
- if (a.size > 0 && i.doc.descendants((c, u) => {
21438
- if (c.type.name === "note") {
21439
- const d = c.attrs.target;
21440
- if (d && d.startsWith("#")) {
21441
- const h = d.substring(1);
21442
- a.has(h) && (r = r.delete(u, u + c.nodeSize));
21439
+ if (l.size > 0 && i.doc.descendants((u, d) => {
21440
+ if (u.type.name === "note") {
21441
+ const h = u.attrs.target;
21442
+ if (h && h.startsWith("#")) {
21443
+ const p = h.substring(1);
21444
+ l.has(p) && (s = s.delete(d, d + u.nodeSize));
21443
21445
  }
21444
21446
  }
21445
- }), s) {
21446
- let c = !1;
21447
- if (i.doc.descendants((g, b) => {
21448
- if (g.type.name === "note" && g.attrs.target === `#${s}`)
21449
- return console.log("note found", g), c = !0, !1;
21450
- }), c)
21447
+ }), o) {
21448
+ let u = !1;
21449
+ if (i.doc.descendants((b, k) => {
21450
+ if (b.type.name === "note" && b.attrs.target === `#${o}`)
21451
+ return console.log("note found", b), u = !0, !1;
21452
+ }), u)
21451
21453
  return null;
21452
- let u = null;
21453
- i.doc.descendants((g, b) => {
21454
- if (g.type.name === n.notesWrapper)
21455
- return u = b, !1;
21456
- }), u === null && (u = i.doc.content.size, r = r.insert(u, i.schema.nodes.listAnnotation.create()));
21457
- const d = r.doc.nodeAt(u);
21458
- if (!d)
21454
+ let d = null;
21455
+ i.doc.descendants((b, k) => {
21456
+ if (b.type.name === n.notesWrapper)
21457
+ return d = k, !1;
21458
+ }), d === null && (d = i.doc.content.size, s = s.insert(d, i.schema.nodes.listAnnotation.create()));
21459
+ const h = s.doc.nodeAt(d);
21460
+ if (!h)
21459
21461
  return null;
21460
- const h = i.schema.nodes.note.create({
21461
- target: `#${s}`,
21462
+ const p = i.schema.nodes.note.create({
21463
+ target: `#${o}`,
21462
21464
  _reference: "1"
21463
21465
  // Will be updated later
21464
- }), p = u + d.nodeSize - 1;
21465
- r = r.insert(p, h);
21466
- const f = p;
21467
- r.doc.nodeAt(f) && (r = r.setSelection(T.create(
21468
- r.doc,
21469
- f + 1
21470
- )), r.scrollIntoView());
21466
+ }), f = d + h.nodeSize - 1;
21467
+ s = s.insert(f, p);
21468
+ const m = f;
21469
+ s.doc.nodeAt(m) && (s = s.setSelection(T.create(
21470
+ s.doc,
21471
+ m + 1
21472
+ )), s.scrollIntoView());
21471
21473
  }
21472
- return o && (yx(r.doc), r = vx(r, r.doc), r = wx(r, r.doc), r = kx(r, r.doc, n.notesWrapper, s)), r;
21474
+ return a && (yx(s.doc), s = vx(s, s.doc), s = wx(s, s.doc), s = kx(s, s.doc, n.notesWrapper, o)), s;
21473
21475
  }
21474
21476
  })
21475
21477
  ];
@@ -21606,7 +21608,7 @@ const Mx = hx.extend({
21606
21608
  };
21607
21609
  }
21608
21610
  });
21609
- function Bh(n, e, t) {
21611
+ function jh(n, e, t) {
21610
21612
  let i = null;
21611
21613
  return n.state.doc.nodesBetween(e, t, (r, s, o, a) => {
21612
21614
  r.isText && (i == null ? i = r.marks.map((l) => ({ mark: l, pos: s })) : i = i.filter((l) => r.marks.find((c) => c.type.name === l.mark.type.name)));
@@ -21659,23 +21661,24 @@ function Px(n, e, t, i = 3) {
21659
21661
  }
21660
21662
  return `&#8230; ${n.substring(r, e)}<mark>${n.substring(e, t)}</mark>${n.substring(t, o + 1)} &#8230;`;
21661
21663
  }
21662
- class zx {
21664
+ class Rx {
21663
21665
  constructor(e, t) {
21664
- this.editor = e.tiptap, this.schemaDef = t, this.panel = e.querySelector(".attribute-panel"), this.currentElement = null, this.currentMark = null, this.setupEventListeners(), this.overlay = document.createElement("div"), this.overlay.className = "jinn-tap overlay", this.overlay.style.display = "block", this.overlay.style.position = "fixed", this.overlay.style.pointerEvents = "none", this.overlay.style.zIndex = "1000", this.overlay.style.display = "none";
21665
- }
21666
- setupEventListeners() {
21667
- this.editor.on("selectionUpdate", ({ editor: e }) => {
21668
- this.updatePanelForCurrentPosition(e);
21669
- }), this.editor.on("update", ({ editor: e }) => {
21670
- this.updatePanelForCurrentPosition(e);
21671
- }), this.editor.options.element.addEventListener("empty-element-clicked", ({ detail: e }) => {
21672
- const { node: t, pos: i } = e;
21673
- this.editor.chain().focus().setNodeSelection(i).run(), this.showNodeAttributes(t);
21666
+ this.editor = e.tiptap, this.schemaDef = t, this.panel = e.querySelector(".attribute-panel"), this.currentElement = null, this.currentMark = null, this.setupEventListeners(e), this.overlay = document.createElement("div"), this.overlay.className = "jinn-tap overlay", this.overlay.style.display = "block", this.overlay.style.position = "fixed", this.overlay.style.pointerEvents = "none", this.overlay.style.zIndex = "1000", this.overlay.style.display = "none";
21667
+ }
21668
+ setupEventListeners(e) {
21669
+ this.editor.on("selectionUpdate", (t) => {
21670
+ this.updatePanelForCurrentPosition(t.editor);
21671
+ }), this.editor.on("transaction", ({ editor: t, transaction: i }) => {
21672
+ const r = i.meta["y-sync$"] !== void 0;
21673
+ i.docChanged && !r && this.updatePanelForCurrentPosition(t);
21674
+ }), this.editor.options.element.addEventListener("empty-element-clicked", ({ detail: t }) => {
21675
+ const { node: i, pos: r } = t;
21676
+ this.editor.chain().focus().setNodeSelection(r).run(), this.showNodeAttributes(i);
21674
21677
  });
21675
21678
  }
21676
21679
  updatePanelForCurrentPosition(e) {
21677
21680
  var a;
21678
- const { from: t, to: i } = e.state.selection, r = Bh(e, t, i);
21681
+ const { from: t, to: i } = e.state.selection, r = jh(e, t, i);
21679
21682
  if (r && r.length > 0) {
21680
21683
  this.currentElement = null;
21681
21684
  const l = r[r.length - 1];
@@ -21786,8 +21789,8 @@ class zx {
21786
21789
  l !== "" ? t[a] = l : r.push(a);
21787
21790
  console.log("<jinn-tap> pendingChanges: %o, cleared: %o", t, r);
21788
21791
  const { from: s, to: o } = this.editor.state.selection;
21789
- if (e instanceof R && this.editor.chain().focus().extendMarkRange(e.type).run(), Object.keys(t).length > 0)
21790
- if (e instanceof R)
21792
+ if (e instanceof z && this.editor.chain().focus().extendMarkRange(e.type).run(), Object.keys(t).length > 0)
21793
+ if (e instanceof z)
21791
21794
  r.length > 0 && this.editor.commands.resetAttributes(e.type, r), this.editor.chain().focus().updateAttributes(e.type, t).setTextSelection({ from: s, to: o }).run();
21792
21795
  else {
21793
21796
  let a = null;
@@ -21861,13 +21864,14 @@ class zx {
21861
21864
  });
21862
21865
  }
21863
21866
  }
21864
- class Rx {
21867
+ class zx {
21865
21868
  constructor(e, t) {
21866
21869
  this.editor = e.tiptap, this.attributePanel = t, this.panel = e.querySelector(".navigation-panel"), this.setupEventListeners();
21867
21870
  }
21868
21871
  setupEventListeners() {
21869
- this.editor.on("update", ({ editor: e }) => {
21870
- this.updatePanelForCurrentPosition(e);
21872
+ this.editor.on("transaction", ({ editor: e, transaction: t }) => {
21873
+ const i = t.meta["y-sync$"] !== void 0;
21874
+ t.docChanged && !i && this.updatePanelForCurrentPosition(e);
21871
21875
  }), this.editor.on("selectionUpdate", ({ editor: e }) => {
21872
21876
  this.updatePanelForCurrentPosition(e);
21873
21877
  });
@@ -21877,7 +21881,7 @@ class Rx {
21877
21881
  const { from: t, to: i } = e.state.selection, r = e.state.doc.resolve(t), s = r.node(), o = [];
21878
21882
  let a;
21879
21883
  if (s) {
21880
- a = Bh(e, t, i);
21884
+ a = jh(e, t, i);
21881
21885
  let c = r.depth;
21882
21886
  for (; c > 0; ) {
21883
21887
  const u = r.node(c);
@@ -21996,7 +22000,7 @@ class _x {
21996
22000
  else if (t.type === "list")
21997
22001
  s = s.toggleList(i.attributes);
21998
22002
  else if (t.type === "anchor")
21999
- s = s.addAnchor(i.attributes);
22003
+ s = r ? !0 : s.addAnchor(i.attributes);
22000
22004
  else if (t.type === "empty" || t.type === "graphic")
22001
22005
  s = s.insertContent({
22002
22006
  type: e,
@@ -22050,7 +22054,7 @@ class _x {
22050
22054
  return e.hasAttribute("debug") ? e.removeAttribute("debug") : e.setAttribute("debug", ""), !0;
22051
22055
  }
22052
22056
  }
22053
- const jh = (n) => {
22057
+ const Bh = (n) => {
22054
22058
  let e = parseInt(n.substring(1, 3), 16) / 255, t = parseInt(n.substring(3, 5), 16) / 255, i = parseInt(n.substring(5, 7), 16) / 255, r = Math.max(e, t, i), s = Math.min(e, t, i), o, a, l = (r + s) / 2;
22055
22059
  if (r === s)
22056
22060
  o = a = 0;
@@ -22079,7 +22083,7 @@ const jh = (n) => {
22079
22083
  return `#${r(0)}${r(8)}${r(4)}`;
22080
22084
  };
22081
22085
  function Lx(n) {
22082
- const e = "#E48500", t = {}, i = [], [r, s, o] = jh(e);
22086
+ const e = "#E48500", t = {}, i = [], [r, s, o] = Bh(e);
22083
22087
  for (let l = 0; l < 5; l++) {
22084
22088
  const c = (r + l * 40) % 360, u = vo(c, s, o);
22085
22089
  t[`--tei-div-color-${l}`] = u;
@@ -22103,11 +22107,11 @@ function Lx(n) {
22103
22107
  `)}
22104
22108
  `;
22105
22109
  }
22106
- function Bx() {
22107
- const n = "#E48500", [e, t, i] = jh(n), r = (e + Math.random() * 360) % 360;
22110
+ function jx() {
22111
+ const n = "#E48500", [e, t, i] = Bh(n), r = (e + Math.random() * 360) % 360;
22108
22112
  return vo(r, t, i);
22109
22113
  }
22110
- function jx(n) {
22114
+ function Bx(n) {
22111
22115
  if (!n) return "";
22112
22116
  const e = [], t = n.querySelectorAll("text > body > *"), i = (r) => {
22113
22117
  if (r.nodeType === Node.ELEMENT_NODE) {
@@ -22127,7 +22131,7 @@ function jx(n) {
22127
22131
  }
22128
22132
  function $x(n) {
22129
22133
  const e = Ix(n);
22130
- return e.documentElement.namespaceURI === "http://www.tei-c.org/ns/1.0" ? jx(e) : xml;
22134
+ return e.documentElement.namespaceURI === "http://www.tei-c.org/ns/1.0" ? Bx(e) : xml;
22131
22135
  }
22132
22136
  var Cc = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
22133
22137
  function Fx(n) {
@@ -39104,7 +39108,7 @@ class Qx extends HTMLElement {
39104
39108
  return ["debug", "url", "schema"];
39105
39109
  }
39106
39110
  constructor() {
39107
- super(), this.editor = null, this.toolbar = null, this.attributePanel = null, this.notesWrapper = "listAnnotation", this.collabEnabled = !1, this.collabPort = null, this.collabServer = null, this.collabDocument = "New Document", this.collabUser = null, this.provider = null, this._schema = Xx, this._initialized = !1;
39111
+ super(), this.editor = null, this.toolbar = null, this.attributePanel = null, this.notesWrapper = "listAnnotation", this.collaboration = null, this.provider = null, this._schema = Xx, this._initialized = !1;
39108
39112
  }
39109
39113
  attributeChangedCallback(e, t, i) {
39110
39114
  e === "debug" ? i !== null ? this.classList.add("debug") : this.classList.remove("debug") : e === "url" && i && this._initialized ? this.loadFromUrl(i) : e === "schema" && i && this.loadSchema(i);
@@ -39139,17 +39143,35 @@ class Qx extends HTMLElement {
39139
39143
  } catch (i) {
39140
39144
  console.error("Error loading content from URL:", i), document.dispatchEvent(new CustomEvent("jinn-toast", {
39141
39145
  detail: {
39142
- message: "Error loading content from URL:",
39146
+ message: `Error loading content from URL: ${i.message}`,
39143
39147
  type: "error"
39144
39148
  }
39145
39149
  }));
39146
39150
  }
39147
39151
  }
39148
39152
  connectedCallback() {
39149
- this.hasAttribute("notesWrapper") && (this.notesWrapper = this.getAttribute("notes")), this.collabPort = this.getAttribute("collab-port"), this.collabServer = this.getAttribute("collab-server"), this.collabDocument = this.getAttribute("collab-document"), this.collabUser = this.getAttribute("collab-user"), (this.collabPort || this.collabServer) && (this.collabEnabled = !0), this.collabUser || (this.collabUser = $h.generateUsername("", 2));
39150
- const e = Lx(this._schema);
39151
- let t = document.getElementById("jinn-tap-color-css");
39152
- t ? t.textContent = e : (t = document.createElement("style"), t.id = "jinn-tap-color-css", t.textContent = e, document.head.appendChild(t)), this.setupEditor(), this._initialized = !0;
39153
+ this.hasAttribute("notesWrapper") && (this.notesWrapper = this.getAttribute("notes"));
39154
+ const e = this.getAttribute("port") || null, t = this.getAttribute("server") || null, i = this.getAttribute("token") || null, r = this.getAttribute("name") || null;
39155
+ if (e || t)
39156
+ if (!(i && r))
39157
+ console.error("collab-token is required when collab-port or collab-server is provided"), document.dispatchEvent(new CustomEvent("jinn-toast", {
39158
+ detail: {
39159
+ message: "collab-token is required when collab-port or collab-server is provided",
39160
+ type: "error"
39161
+ }
39162
+ }));
39163
+ else {
39164
+ this.collaboration = {
39165
+ token: i,
39166
+ user: this.getAttribute("user") || $h.generateUsername("", 2),
39167
+ name: r
39168
+ };
39169
+ let a = t;
39170
+ a || (a = `ws://${window.location.hostname}:${e}`), this.collaboration.url = a;
39171
+ }
39172
+ const s = Lx(this._schema);
39173
+ let o = document.getElementById("jinn-tap-color-css");
39174
+ o ? o.textContent = s : (o = document.createElement("style"), o.id = "jinn-tap-color-css", o.textContent = s, document.head.appendChild(o)), this.setupEditor(), this._initialized = !0;
39153
39175
  }
39154
39176
  async setupEditor() {
39155
39177
  const e = document.createElement("div");
@@ -39181,20 +39203,26 @@ class Qx extends HTMLElement {
39181
39203
  }
39182
39204
  });
39183
39205
  const r = Ex(this._schema);
39184
- if (this.collabEnabled) {
39185
- let o = this.collabServer;
39186
- o || (o = `ws://${window.location.hostname}:${this.collabPort}`), this.doc = new rt(), this.provider = new ux({
39187
- name: this.collabDocument,
39188
- url: o,
39189
- document: this.doc,
39190
- onSynced: () => {
39191
- !this.doc.getMap("config").get("initialContentLoaded") && this.editor && (this.doc.getMap("config").set("initialContentLoaded", !0), this.editor.chain().setContent(t).setTextSelection(0).focus().run(), this.dispatchContentChange());
39192
- }
39193
- // onAwarenessChange: ({ states }) => {
39194
- // console.log('onAwarenessChange: %o', states);
39195
- // }
39196
- });
39197
- }
39206
+ this.collaboration && (this.doc = new rt(), this.provider = new ux({
39207
+ name: this.collaboration.name,
39208
+ token: this.collaboration.token,
39209
+ url: this.collaboration.url,
39210
+ document: this.doc,
39211
+ onConnect: () => {
39212
+ document.dispatchEvent(new CustomEvent("jinn-toast", {
39213
+ detail: {
39214
+ message: "Connected to collaboration server",
39215
+ type: "info"
39216
+ }
39217
+ }));
39218
+ },
39219
+ onSynced: () => {
39220
+ !this.doc.getMap("config").get("initialContentLoaded") && this.editor && (this.doc.getMap("config").set("initialContentLoaded", !0), this.editor.chain().setContent(t).setTextSelection(0).focus().run(), this.dispatchContentChange());
39221
+ }
39222
+ // onAwarenessChange: ({ states }) => {
39223
+ // console.log('onAwarenessChange: %o', states);
39224
+ // }
39225
+ }));
39198
39226
  const s = {
39199
39227
  element: this.querySelector(".editor-area"),
39200
39228
  extensions: [
@@ -39202,7 +39230,8 @@ class Qx extends HTMLElement {
39202
39230
  Ox,
39203
39231
  Dx,
39204
39232
  Sx.configure({
39205
- notesWrapper: this.notesWrapper
39233
+ notesWrapper: this.notesWrapper,
39234
+ notesWithoutAnchor: !1
39206
39235
  }),
39207
39236
  Gb.configure({
39208
39237
  placeholder: "Write something...",
@@ -39211,25 +39240,26 @@ class Qx extends HTMLElement {
39211
39240
  ],
39212
39241
  autofocus: !1,
39213
39242
  onCreate: () => {
39214
- this.dispatchContentChange(), this.dispatchEvent(new CustomEvent("ready"));
39243
+ this.dispatchEvent(new CustomEvent("ready"));
39215
39244
  },
39216
- onUpdate: () => this.dispatchContentChange()
39245
+ onTransaction: ({ editor: o, transaction: a }) => {
39246
+ a.docChanged && this.dispatchContentChange();
39247
+ }
39217
39248
  };
39218
- this.collabEnabled ? (s.extensions.push(Cv.configure({
39249
+ this.collaboration ? (s.extensions.push(Cv.configure({
39219
39250
  provider: this.provider,
39220
39251
  document: this.doc
39221
39252
  })), s.extensions.push(Ev.configure({
39222
39253
  provider: this.provider,
39223
39254
  user: {
39224
- name: this.collabUser,
39225
- color: Bx()
39255
+ name: this.collaboration.user,
39256
+ color: jx()
39226
39257
  }
39227
- }))) : s.extensions.push(Kb), this.editor = new _b(s), this.attributePanel = new zx(this, this._schema), this.navigationPanel = new Rx(this, this.attributePanel), this.toolbar = new _x(this, this._schema), this.collabEnabled || (this.content = t);
39258
+ }))) : s.extensions.push(Kb), this.editor = new _b(s), this.attributePanel = new Rx(this, this._schema), this.navigationPanel = new zx(this, this.attributePanel), this.toolbar = new _x(this, this._schema), this.collaboration || (this.content = t);
39228
39259
  }
39229
39260
  dispatchContentChange() {
39230
39261
  this.dispatchEvent(new CustomEvent("content-change", {
39231
39262
  detail: {
39232
- content: this.editor.getText(),
39233
39263
  xml: xc(this.editor)
39234
39264
  }
39235
39265
  }));