@kerebron/legacy-compat 0.7.8 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/kerebron.js CHANGED
@@ -2894,8 +2894,8 @@ class StepMap {
2894
2894
  let d = g ? e == l ? -1 : e == I ? 1 : A : A, h = l + r + (d < 0 ? 0 : c);
2895
2895
  if (n)
2896
2896
  return h;
2897
- let u = e == (A < 0 ? l : I) ? null : makeRecover(a / 3, e - l), B = e == l ? DEL_AFTER : e == I ? DEL_BEFORE : DEL_ACROSS;
2898
- return (A < 0 ? e != l : e != I) && (B |= DEL_SIDE), new MapResult(h, B, u);
2897
+ let u = e == (A < 0 ? l : I) ? null : makeRecover(a / 3, e - l), E = e == l ? DEL_AFTER : e == I ? DEL_BEFORE : DEL_ACROSS;
2898
+ return (A < 0 ? e != l : e != I) && (E |= DEL_SIDE), new MapResult(h, E, u);
2899
2899
  }
2900
2900
  r += c - g;
2901
2901
  }
@@ -3431,8 +3431,8 @@ function addMark(t, e, A, n) {
3431
3431
  let I = l.marks;
3432
3432
  if (!n.isInSet(I) && c.type.allowsMarkType(n.type)) {
3433
3433
  let d = Math.max(g, e), h = Math.min(g + l.nodeSize, A), u = n.addToSet(I);
3434
- for (let B = 0; B < I.length; B++)
3435
- I[B].isInSet(u) || (s && s.to == d && s.mark.eq(I[B]) ? s.to = h : r.push(s = new RemoveMarkStep(d, h, I[B])));
3434
+ for (let E = 0; E < I.length; E++)
3435
+ I[E].isInSet(u) || (s && s.to == d && s.mark.eq(I[E]) ? s.to = h : r.push(s = new RemoveMarkStep(d, h, I[E])));
3436
3436
  a && a.to == d ? a.to = h : o.push(a = new AddMarkStep(d, h, n));
3437
3437
  }
3438
3438
  }), r.forEach((l) => t.step(l)), o.forEach((l) => t.step(l));
@@ -3503,11 +3503,11 @@ function liftTarget(t) {
3503
3503
  }
3504
3504
  function lift$1(t, e, A) {
3505
3505
  let { $from: n, $to: r, depth: o } = e, s = n.before(o + 1), a = r.after(o + 1), l = s, g = a, c = Fragment.empty, I = 0;
3506
- for (let u = o, B = !1; u > A; u--)
3507
- B || n.index(u) > 0 ? (B = !0, c = Fragment.from(n.node(u).copy(c)), I++) : l--;
3506
+ for (let u = o, E = !1; u > A; u--)
3507
+ E || n.index(u) > 0 ? (E = !0, c = Fragment.from(n.node(u).copy(c)), I++) : l--;
3508
3508
  let d = Fragment.empty, h = 0;
3509
- for (let u = o, B = !1; u > A; u--)
3510
- B || r.after(u + 1) < r.end(u) ? (B = !0, d = Fragment.from(r.node(u).copy(d)), h++) : g++;
3509
+ for (let u = o, E = !1; u > A; u--)
3510
+ E || r.after(u + 1) < r.end(u) ? (E = !0, d = Fragment.from(r.node(u).copy(d)), h++) : g++;
3511
3511
  t.step(new ReplaceAroundStep(l, g, s, a, new Slice(c.append(d), I, h), c.size - I, !0));
3512
3512
  }
3513
3513
  function findWrapping(t, e, A = null, n = t) {
@@ -3610,8 +3610,8 @@ function canSplit(t, e, A = 1, n) {
3610
3610
  return !1;
3611
3611
  let h = I.content.cutByIndex(d, I.childCount), u = n && n[c + 1];
3612
3612
  u && (h = h.replaceChild(0, u.type.create(u.attrs)));
3613
- let B = n && n[c] || I;
3614
- if (!I.canReplace(d + 1, I.childCount) || !B.type.validContent(h))
3613
+ let E = n && n[c] || I;
3614
+ if (!I.canReplace(d + 1, I.childCount) || !E.type.validContent(h))
3615
3615
  return !1;
3616
3616
  }
3617
3617
  let a = r.indexAfter(o), l = n && n[0];
@@ -3803,26 +3803,26 @@ class Fitter {
3803
3803
  for (; this.depth > A; )
3804
3804
  this.closeFrontierNode();
3805
3805
  if (o)
3806
- for (let B = 0; B < o.length; B++)
3807
- this.openFrontierNode(o[B]);
3806
+ for (let E = 0; E < o.length; E++)
3807
+ this.openFrontierNode(o[E]);
3808
3808
  let s = this.unplaced, a = n ? n.content : s.content, l = s.openStart - e, g = 0, c = [], { match: I, type: d } = this.frontier[A];
3809
3809
  if (r) {
3810
- for (let B = 0; B < r.childCount; B++)
3811
- c.push(r.child(B));
3810
+ for (let E = 0; E < r.childCount; E++)
3811
+ c.push(r.child(E));
3812
3812
  I = I.matchFragment(r);
3813
3813
  }
3814
3814
  let h = a.size + e - (s.content.size - s.openEnd);
3815
3815
  for (; g < a.childCount; ) {
3816
- let B = a.child(g), E = I.matchType(B.type);
3817
- if (!E)
3816
+ let E = a.child(g), B = I.matchType(E.type);
3817
+ if (!B)
3818
3818
  break;
3819
- g++, (g > 1 || l == 0 || B.content.size) && (I = E, c.push(closeNodeStart(B.mark(d.allowedMarks(B.marks)), g == 1 ? l : 0, g == a.childCount ? h : -1)));
3819
+ g++, (g > 1 || l == 0 || E.content.size) && (I = B, c.push(closeNodeStart(E.mark(d.allowedMarks(E.marks)), g == 1 ? l : 0, g == a.childCount ? h : -1)));
3820
3820
  }
3821
3821
  let u = g == a.childCount;
3822
3822
  u || (h = -1), this.placed = addToFragment(this.placed, A, Fragment.from(c)), this.frontier[A].match = I, u && h < 0 && n && n.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
3823
- for (let B = 0, E = a; B < h; B++) {
3824
- let f = E.lastChild;
3825
- this.frontier.push({ type: f.type, match: f.contentMatchAt(f.childCount) }), E = f.content;
3823
+ for (let E = 0, B = a; E < h; E++) {
3824
+ let f = B.lastChild;
3825
+ this.frontier.push({ type: f.type, match: f.contentMatchAt(f.childCount) }), B = f.content;
3826
3826
  }
3827
3827
  this.unplaced = u ? e == 0 ? Slice.empty : new Slice(dropFromFragment(s.content, e - 1, 1), e - 1, h < 0 ? s.openEnd : e - 1) : new Slice(dropFromFragment(s.content, e, g), s.openStart, s.openEnd);
3828
3828
  }
@@ -3938,12 +3938,12 @@ function replaceRange(t, e, A, n) {
3938
3938
  for (let d = n.openStart; d >= 0; d--) {
3939
3939
  let h = (d + c + 1) % (n.openStart + 1), u = g[h];
3940
3940
  if (u)
3941
- for (let B = 0; B < s.length; B++) {
3942
- let E = s[(B + l) % s.length], f = !0;
3943
- E < 0 && (f = !1, E = -E);
3944
- let Q = r.node(E - 1), p = r.index(E - 1);
3941
+ for (let E = 0; E < s.length; E++) {
3942
+ let B = s[(E + l) % s.length], f = !0;
3943
+ B < 0 && (f = !1, B = -B);
3944
+ let Q = r.node(B - 1), p = r.index(B - 1);
3945
3945
  if (Q.canReplaceWith(p, p, u.type, u.marks))
3946
- return t.replace(r.before(E), f ? o.after(E) : A, new Slice(closeFragment(n.content, 0, n.openStart, h), h, n.openEnd));
3946
+ return t.replace(r.before(B), f ? o.after(B) : A, new Slice(closeFragment(n.content, 0, n.openStart, h), h, n.openEnd));
3947
3947
  }
3948
3948
  }
3949
3949
  let I = t.steps.length;
@@ -5265,8 +5265,8 @@ function scrollRectIntoView(t, e, A) {
5265
5265
  else {
5266
5266
  let h = a.scrollLeft, u = a.scrollTop;
5267
5267
  I && (a.scrollTop += I), c && (a.scrollLeft += c);
5268
- let B = a.scrollLeft - h, E = a.scrollTop - u;
5269
- e = { left: e.left - B, top: e.top - E, right: e.right - B, bottom: e.bottom - E };
5268
+ let E = a.scrollLeft - h, B = a.scrollTop - u;
5269
+ e = { left: e.left - E, top: e.top - B, right: e.right - E, bottom: e.bottom - B };
5270
5270
  }
5271
5271
  let d = l ? "fixed" : getComputedStyle(s).position;
5272
5272
  if (/^(fixed|sticky)$/.test(d))
@@ -5331,12 +5331,12 @@ function findOffsetInNode(t, e) {
5331
5331
  let u = d[h];
5332
5332
  if (u.top <= s && u.bottom >= a) {
5333
5333
  s = Math.max(u.bottom, s), a = Math.min(u.top, a);
5334
- let B = u.left > e.left ? u.left - e.left : u.right < e.left ? e.left - u.right : 0;
5335
- if (B < n) {
5336
- A = c, n = B, r = B && A.nodeType == 3 ? {
5334
+ let E = u.left > e.left ? u.left - e.left : u.right < e.left ? e.left - u.right : 0;
5335
+ if (E < n) {
5336
+ A = c, n = E, r = E && A.nodeType == 3 ? {
5337
5337
  left: u.right < e.left ? u.right : u.left,
5338
5338
  top: e.top
5339
- } : e, c.nodeType == 1 && B && (o = I + (e.left >= (u.left + u.right) / 2 ? 1 : 0));
5339
+ } : e, c.nodeType == 1 && E && (o = I + (e.left >= (u.left + u.right) / 2 ? 1 : 0));
5340
5340
  continue;
5341
5341
  }
5342
5342
  } else u.top > e.top && !l && u.left <= e.left && u.right >= e.left && (l = c, g = { left: Math.max(u.left, Math.min(u.right, e.left)), top: u.top });
@@ -5546,12 +5546,12 @@ function endOfTextblockHorizontal(t, e, A) {
5546
5546
  return a ? !maybeRTL.test(n.parent.textContent) || !a.modify ? A == "left" || A == "backward" ? o : s : withFlushedState(t, e, () => {
5547
5547
  let { focusNode: l, focusOffset: g, anchorNode: c, anchorOffset: I } = t.domSelectionRange(), d = a.caretBidiLevel;
5548
5548
  a.modify("move", A, "character");
5549
- let h = n.depth ? t.docView.domAfterPos(n.before()) : t.dom, { focusNode: u, focusOffset: B } = t.domSelectionRange(), E = u && !h.contains(u.nodeType == 1 ? u : u.parentNode) || l == u && g == B;
5549
+ let h = n.depth ? t.docView.domAfterPos(n.before()) : t.dom, { focusNode: u, focusOffset: E } = t.domSelectionRange(), B = u && !h.contains(u.nodeType == 1 ? u : u.parentNode) || l == u && g == E;
5550
5550
  try {
5551
5551
  a.collapse(c, I), l && (l != c || g != I) && a.extend && a.extend(l, g);
5552
5552
  } catch {
5553
5553
  }
5554
- return d != null && (a.caretBidiLevel = d), E;
5554
+ return d != null && (a.caretBidiLevel = d), B;
5555
5555
  }) : n.pos == n.start() || n.pos == n.end();
5556
5556
  }
5557
5557
  let cachedState = null, cachedDir = null, cachedResult = !1;
@@ -5812,10 +5812,10 @@ class ViewDesc {
5812
5812
  setSelection(e, A, n, r = !1) {
5813
5813
  let o = Math.min(e, A), s = Math.max(e, A);
5814
5814
  for (let h = 0, u = 0; h < this.children.length; h++) {
5815
- let B = this.children[h], E = u + B.size;
5816
- if (o > u && s < E)
5817
- return B.setSelection(e - u - B.border, A - u - B.border, n, r);
5818
- u = E;
5815
+ let E = this.children[h], B = u + E.size;
5816
+ if (o > u && s < B)
5817
+ return E.setSelection(e - u - E.border, A - u - E.border, n, r);
5818
+ u = B;
5819
5819
  }
5820
5820
  let a = this.domFromPos(e, e ? -1 : 1), l = A == e ? a : this.domFromPos(A, A ? -1 : 1), g = n.root.getSelection(), c = n.domSelectionRange(), I = !1;
5821
5821
  if ((gecko || safari) && e == A) {
@@ -5823,18 +5823,18 @@ class ViewDesc {
5823
5823
  if (h.nodeType == 3) {
5824
5824
  if (I = !!(u && h.nodeValue[u - 1] == `
5825
5825
  `), I && u == h.nodeValue.length)
5826
- for (let B = h, E; B; B = B.parentNode) {
5827
- if (E = B.nextSibling) {
5828
- E.nodeName == "BR" && (a = l = { node: E.parentNode, offset: domIndex(E) + 1 });
5826
+ for (let E = h, B; E; E = E.parentNode) {
5827
+ if (B = E.nextSibling) {
5828
+ B.nodeName == "BR" && (a = l = { node: B.parentNode, offset: domIndex(B) + 1 });
5829
5829
  break;
5830
5830
  }
5831
- let f = B.pmViewDesc;
5831
+ let f = E.pmViewDesc;
5832
5832
  if (f && f.node && f.node.isBlock)
5833
5833
  break;
5834
5834
  }
5835
5835
  } else {
5836
- let B = h.childNodes[u - 1];
5837
- I = B && (B.nodeName == "BR" || B.contentEditable == "false");
5836
+ let E = h.childNodes[u - 1];
5837
+ I = E && (E.nodeName == "BR" || E.contentEditable == "false");
5838
5838
  }
5839
5839
  }
5840
5840
  if (gecko && c.focusNode && c.focusNode != l.node && c.focusNode.nodeType == 1) {
@@ -6505,14 +6505,14 @@ function iterDeco(t, e, A, n) {
6505
6505
  for (let g = 0; ; ) {
6506
6506
  let c, I;
6507
6507
  for (; s < r.length && r[s].to == o; ) {
6508
- let E = r[s++];
6509
- E.widget && (c ? (I || (I = [c])).push(E) : c = E);
6508
+ let B = r[s++];
6509
+ B.widget && (c ? (I || (I = [c])).push(B) : c = B);
6510
6510
  }
6511
6511
  if (c)
6512
6512
  if (I) {
6513
6513
  I.sort(compareSide);
6514
- for (let E = 0; E < I.length; E++)
6515
- A(I[E], g, !!l);
6514
+ for (let B = 0; B < I.length; B++)
6515
+ A(I[B], g, !!l);
6516
6516
  } else
6517
6517
  A(c, g, !!l);
6518
6518
  let d, h;
@@ -6522,22 +6522,22 @@ function iterDeco(t, e, A, n) {
6522
6522
  h = g, d = t.child(g++);
6523
6523
  else
6524
6524
  break;
6525
- for (let E = 0; E < a.length; E++)
6526
- a[E].to <= o && a.splice(E--, 1);
6525
+ for (let B = 0; B < a.length; B++)
6526
+ a[B].to <= o && a.splice(B--, 1);
6527
6527
  for (; s < r.length && r[s].from <= o && r[s].to > o; )
6528
6528
  a.push(r[s++]);
6529
6529
  let u = o + d.nodeSize;
6530
6530
  if (d.isText) {
6531
- let E = u;
6532
- s < r.length && r[s].from < E && (E = r[s].from);
6531
+ let B = u;
6532
+ s < r.length && r[s].from < B && (B = r[s].from);
6533
6533
  for (let f = 0; f < a.length; f++)
6534
- a[f].to < E && (E = a[f].to);
6535
- E < u && (l = d.cut(E - o), d = d.cut(0, E - o), u = E, h = -1);
6534
+ a[f].to < B && (B = a[f].to);
6535
+ B < u && (l = d.cut(B - o), d = d.cut(0, B - o), u = B, h = -1);
6536
6536
  } else
6537
6537
  for (; s < r.length && r[s].to < u; )
6538
6538
  s++;
6539
- let B = d.isInline && !d.isLeaf ? a.filter((E) => !E.inline) : a.slice();
6540
- n(d, B, e.forChild(o, d), h), o = u;
6539
+ let E = d.isInline && !d.isLeaf ? a.filter((B) => !B.inline) : a.slice();
6540
+ n(d, E, e.forChild(o, d), h), o = u;
6541
6541
  }
6542
6542
  }
6543
6543
  function iosHacks(t) {
@@ -6999,9 +6999,9 @@ function parseFromClipboard(t, e, A, n, r) {
6999
6999
  a = I;
7000
7000
  else {
7001
7001
  let d = r.marks(), { schema: h } = t.state, u = DOMSerializer.fromSchema(h);
7002
- s = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((B) => {
7003
- let E = s.appendChild(document.createElement("p"));
7004
- B && E.appendChild(u.serializeNode(h.text(B, d)));
7002
+ s = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((E) => {
7003
+ let B = s.appendChild(document.createElement("p"));
7004
+ E && B.appendChild(u.serializeNode(h.text(E, d)));
7005
7005
  });
7006
7006
  }
7007
7007
  } else
@@ -7545,7 +7545,7 @@ editHandlers.drop = (t, e) => {
7545
7545
  g.setSelection(new NodeSelection(h));
7546
7546
  else {
7547
7547
  let u = g.mapping.map(l);
7548
- g.mapping.maps[g.mapping.maps.length - 1].forEach((B, E, f, Q) => u = Q), g.setSelection(selectionBetween(t, h, g.doc.resolve(u)));
7548
+ g.mapping.maps[g.mapping.maps.length - 1].forEach((E, B, f, Q) => u = Q), g.setSelection(selectionBetween(t, h, g.doc.resolve(u)));
7549
7549
  }
7550
7550
  t.focus(), t.dispatch(g.setMeta("uiEvent", "drop"));
7551
7551
  };
@@ -7950,16 +7950,16 @@ function mapChildren(t, e, A, n, r, o, s) {
7950
7950
  let a = t.slice();
7951
7951
  for (let g = 0, c = o; g < A.maps.length; g++) {
7952
7952
  let I = 0;
7953
- A.maps[g].forEach((d, h, u, B) => {
7954
- let E = B - u - (h - d);
7953
+ A.maps[g].forEach((d, h, u, E) => {
7954
+ let B = E - u - (h - d);
7955
7955
  for (let f = 0; f < a.length; f += 3) {
7956
7956
  let Q = a[f + 1];
7957
7957
  if (Q < 0 || d > Q + c - I)
7958
7958
  continue;
7959
7959
  let p = a[f] + c - I;
7960
- h >= p ? a[f + 1] = d <= p ? -2 : -1 : d >= c && E && (a[f] += E, a[f + 1] += E);
7960
+ h >= p ? a[f + 1] = d <= p ? -2 : -1 : d >= c && B && (a[f] += B, a[f + 1] += B);
7961
7961
  }
7962
- I += E;
7962
+ I += B;
7963
7963
  }), c = A.maps[g].map(c, -1);
7964
7964
  }
7965
7965
  let l = !1;
@@ -7974,9 +7974,9 @@ function mapChildren(t, e, A, n, r, o, s) {
7974
7974
  l = !0;
7975
7975
  continue;
7976
7976
  }
7977
- let d = A.map(t[g + 1] + o, -1), h = d - r, { index: u, offset: B } = n.content.findIndex(I), E = n.maybeChild(u);
7978
- if (E && B == I && B + E.nodeSize == h) {
7979
- let f = a[g + 2].mapInner(A, E, c + 1, t[g] + o + 1, s);
7977
+ let d = A.map(t[g + 1] + o, -1), h = d - r, { index: u, offset: E } = n.content.findIndex(I), B = n.maybeChild(u);
7978
+ if (B && E == I && E + B.nodeSize == h) {
7979
+ let f = a[g + 2].mapInner(A, B, c + 1, t[g] + o + 1, s);
7980
7980
  f != empty$1 ? (a[g] = I, a[g + 1] = h, a[g + 2] = f) : (a[g + 1] = -2, l = !0);
7981
7981
  } else
7982
7982
  l = !0;
@@ -8279,16 +8279,16 @@ function blockParent(t, e) {
8279
8279
  function parseBetween(t, e, A) {
8280
8280
  let { node: n, fromOffset: r, toOffset: o, from: s, to: a } = t.docView.parseRange(e, A), l = t.domSelectionRange(), g, c = l.anchorNode;
8281
8281
  if (c && t.dom.contains(c.nodeType == 1 ? c : c.parentNode) && (g = [{ node: c, offset: l.anchorOffset }], selectionCollapsed(l) || g.push({ node: l.focusNode, offset: l.focusOffset })), chrome && t.input.lastKeyCode === 8)
8282
- for (let E = o; E > r; E--) {
8283
- let f = n.childNodes[E - 1], Q = f.pmViewDesc;
8282
+ for (let B = o; B > r; B--) {
8283
+ let f = n.childNodes[B - 1], Q = f.pmViewDesc;
8284
8284
  if (f.nodeName == "BR" && !Q) {
8285
- o = E;
8285
+ o = B;
8286
8286
  break;
8287
8287
  }
8288
8288
  if (!Q || Q.size)
8289
8289
  break;
8290
8290
  }
8291
- let I = t.state.doc, d = t.someProp("domParser") || DOMParser$1.fromSchema(t.state.schema), h = I.resolve(s), u = null, B = d.parse(n, {
8291
+ let I = t.state.doc, d = t.someProp("domParser") || DOMParser$1.fromSchema(t.state.schema), h = I.resolve(s), u = null, E = d.parse(n, {
8292
8292
  topNode: h.parent,
8293
8293
  topMatch: h.parent.contentMatchAt(h.index()),
8294
8294
  topOpen: !0,
@@ -8300,10 +8300,10 @@ function parseBetween(t, e, A) {
8300
8300
  context: h
8301
8301
  });
8302
8302
  if (g && g[0].pos != null) {
8303
- let E = g[0].pos, f = g[1] && g[1].pos;
8304
- f == null && (f = E), u = { anchor: E + s, head: f + s };
8303
+ let B = g[0].pos, f = g[1] && g[1].pos;
8304
+ f == null && (f = B), u = { anchor: B + s, head: f + s };
8305
8305
  }
8306
- return { doc: B, sel: u, from: s, to: a };
8306
+ return { doc: E, sel: u, from: s, to: a };
8307
8307
  }
8308
8308
  function ruleFromNode(t) {
8309
8309
  let e = t.pmViewDesc;
@@ -8355,16 +8355,16 @@ function readDOMChange(t, e, A, n, r) {
8355
8355
  return;
8356
8356
  }
8357
8357
  t.state.selection.from < t.state.selection.to && u.start == u.endB && t.state.selection instanceof TextSelection && (u.start > t.state.selection.from && u.start <= t.state.selection.from + 2 && t.state.selection.from >= g.from ? u.start = t.state.selection.from : u.endA < t.state.selection.to && u.endA >= t.state.selection.to - 2 && t.state.selection.to <= g.to && (u.endB += t.state.selection.to - u.endA, u.endA = t.state.selection.to)), ie$1 && ie_version <= 11 && u.endB == u.start + 1 && u.endA == u.start && u.start > g.from && g.doc.textBetween(u.start - g.from - 1, u.start - g.from + 1) == "  " && (u.start--, u.endA--, u.endB--);
8358
- let B = g.doc.resolveNoCache(u.start - g.from), E = g.doc.resolveNoCache(u.endB - g.from), f = c.resolve(u.start), Q = B.sameParent(E) && B.parent.inlineContent && f.end() >= u.endA, p;
8359
- if ((ios && t.input.lastIOSEnter > Date.now() - 225 && (!Q || r.some((_) => _.nodeName == "DIV" || _.nodeName == "P")) || !Q && B.pos < g.doc.content.size && (!B.sameParent(E) || !B.parent.inlineContent) && !/\S/.test(g.doc.textBetween(B.pos, E.pos, "", "")) && (p = Selection.findFrom(g.doc.resolve(B.pos + 1), 1, !0)) && p.head > B.pos) && t.someProp("handleKeyDown", (_) => _(t, keyEvent(13, "Enter")))) {
8358
+ let E = g.doc.resolveNoCache(u.start - g.from), B = g.doc.resolveNoCache(u.endB - g.from), f = c.resolve(u.start), Q = E.sameParent(B) && E.parent.inlineContent && f.end() >= u.endA, p;
8359
+ if ((ios && t.input.lastIOSEnter > Date.now() - 225 && (!Q || r.some((_) => _.nodeName == "DIV" || _.nodeName == "P")) || !Q && E.pos < g.doc.content.size && (!E.sameParent(B) || !E.parent.inlineContent) && !/\S/.test(g.doc.textBetween(E.pos, B.pos, "", "")) && (p = Selection.findFrom(g.doc.resolve(E.pos + 1), 1, !0)) && p.head > E.pos) && t.someProp("handleKeyDown", (_) => _(t, keyEvent(13, "Enter")))) {
8360
8360
  t.input.lastIOSEnter = 0;
8361
8361
  return;
8362
8362
  }
8363
- if (t.state.selection.anchor > u.start && looksLikeBackspace(c, u.start, u.endA, B, E) && t.someProp("handleKeyDown", (_) => _(t, keyEvent(8, "Backspace")))) {
8363
+ if (t.state.selection.anchor > u.start && looksLikeBackspace(c, u.start, u.endA, E, B) && t.someProp("handleKeyDown", (_) => _(t, keyEvent(8, "Backspace")))) {
8364
8364
  android && chrome && t.domObserver.suppressSelectionUpdates();
8365
8365
  return;
8366
8366
  }
8367
- chrome && u.endB == u.start && (t.input.lastChromeDelete = Date.now()), android && !Q && B.start() != E.start() && E.parentOffset == 0 && B.depth == E.depth && g.sel && g.sel.anchor == g.sel.head && g.sel.head == u.endA && (u.endB -= 2, E = g.doc.resolveNoCache(u.endB - g.from), setTimeout(() => {
8367
+ chrome && u.endB == u.start && (t.input.lastChromeDelete = Date.now()), android && !Q && E.start() != B.start() && B.parentOffset == 0 && E.depth == B.depth && g.sel && g.sel.anchor == g.sel.head && g.sel.head == u.endA && (u.endB -= 2, B = g.doc.resolveNoCache(u.endB - g.from), setTimeout(() => {
8368
8368
  t.someProp("handleKeyDown", function(_) {
8369
8369
  return _(t, keyEvent(13, "Enter"));
8370
8370
  });
@@ -8378,18 +8378,18 @@ function readDOMChange(t, e, A, n, r) {
8378
8378
  return o && k.setMeta("composition", o), k.scrollIntoView();
8379
8379
  }, D;
8380
8380
  if (Q) {
8381
- if (B.pos == E.pos) {
8382
- ie$1 && ie_version <= 11 && B.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() => selectionToDOM(t), 20));
8381
+ if (E.pos == B.pos) {
8382
+ ie$1 && ie_version <= 11 && E.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() => selectionToDOM(t), 20));
8383
8383
  let _ = w(t.state.tr.delete(m, y)), k = c.resolve(u.start).marksAcross(c.resolve(u.endA));
8384
8384
  k && _.ensureMarks(k), t.dispatch(_);
8385
8385
  } else if (
8386
8386
  // Adding or removing a mark
8387
- u.endA == u.endB && (D = isMarkChange(B.parent.content.cut(B.parentOffset, E.parentOffset), f.parent.content.cut(f.parentOffset, u.endA - f.start())))
8387
+ u.endA == u.endB && (D = isMarkChange(E.parent.content.cut(E.parentOffset, B.parentOffset), f.parent.content.cut(f.parentOffset, u.endA - f.start())))
8388
8388
  ) {
8389
8389
  let _ = w(t.state.tr);
8390
8390
  D.type == "add" ? _.addMark(m, y, D.mark) : _.removeMark(m, y, D.mark), t.dispatch(_);
8391
- } else if (B.parent.child(B.index()).isText && B.index() == E.index() - (E.textOffset ? 0 : 1)) {
8392
- let _ = B.parent.textBetween(B.parentOffset, E.parentOffset), k = () => w(t.state.tr.insertText(_, m, y));
8391
+ } else if (E.parent.child(E.index()).isText && E.index() == B.index() - (B.textOffset ? 0 : 1)) {
8392
+ let _ = E.parent.textBetween(E.parentOffset, B.parentOffset), k = () => w(t.state.tr.insertText(_, m, y));
8393
8393
  t.someProp("handleTextInput", (S) => S(t, m, y, _, k)) || t.dispatch(k());
8394
8394
  }
8395
8395
  } else
@@ -8941,23 +8941,23 @@ const runInputRulesTexts = () => {
8941
8941
  for (let d = I.length - 1; d >= 0; d--) {
8942
8942
  const { pos: h, node: u } = I[d];
8943
8943
  if (!u.isText || !u.text) continue;
8944
- let B = u.text;
8944
+ let E = u.text;
8945
8945
  if (u.type.spec.code) {
8946
8946
  if (!c.inCode) continue;
8947
8947
  } else if (c.inCode === "only")
8948
8948
  continue;
8949
- const E = c.regex.exec(B);
8950
- if (!E)
8949
+ const B = c.regex.exec(E);
8950
+ if (!B)
8951
8951
  continue;
8952
- const f = E.index, Q = h + f, p = h + f + E[0].length;
8952
+ const f = B.index, Q = h + f, p = h + f + B[0].length;
8953
8953
  let m = c.handler(
8954
8954
  l,
8955
8955
  e,
8956
- E,
8956
+ B,
8957
8957
  Q,
8958
8958
  p
8959
8959
  );
8960
- m && (l = m, a = l.doc, c.undoable && l.setMeta(o, { transform: l, from: Q, to: p, text: B }));
8960
+ m && (l = m, a = l.doc, c.undoable && l.setMeta(o, { transform: l, from: Q, to: p, text: E }));
8961
8961
  }
8962
8962
  }
8963
8963
  return A && A(l), l.docChanged;
@@ -8985,18 +8985,18 @@ const runInputRulesTexts = () => {
8985
8985
  if (!u.inCode) continue;
8986
8986
  } else if (u.inCode === "only")
8987
8987
  continue;
8988
- const B = u.regex.exec(I);
8989
- if (!B)
8988
+ const E = u.regex.exec(I);
8989
+ if (!E)
8990
8990
  continue;
8991
- const E = u.handler(
8991
+ const B = u.handler(
8992
8992
  d,
8993
8993
  r,
8994
- B,
8995
- d.mapping.map(t - (B[0].length - A.length)),
8994
+ E,
8995
+ d.mapping.map(t - (E[0].length - A.length)),
8996
8996
  d.mapping.map(e)
8997
8997
  );
8998
- if (E) {
8999
- d = E, u.undoable && d.setMeta(l, { transform: d, from: t, to: e, text: A });
8998
+ if (B) {
8999
+ d = B, u.undoable && d.setMeta(l, { transform: d, from: t, to: e, text: A });
9000
9000
  break;
9001
9001
  }
9002
9002
  }
@@ -9726,8 +9726,8 @@ const exitCode = () => (t, e) => {
9726
9726
  g = r.end(u) == r.pos + (r.depth - u), c = r.start(u) == r.pos - (r.depth - u), l = defaultBlockAt(
9727
9727
  r.node(u - 1).contentMatchAt(r.indexAfter(u - 1))
9728
9728
  );
9729
- let E = t && t(o.parent, g, r);
9730
- s.unshift(E || (g && l ? { type: l } : null)), a = u;
9729
+ let B = t && t(o.parent, g, r);
9730
+ s.unshift(B || (g && l ? { type: l } : null)), a = u;
9731
9731
  break;
9732
9732
  } else {
9733
9733
  if (u == 1) return !1;
@@ -9737,10 +9737,10 @@ const exitCode = () => (t, e) => {
9737
9737
  (A.selection instanceof TextSelection || A.selection instanceof AllSelection) && I.deleteSelection();
9738
9738
  let d = I.mapping.map(r.pos), h = canSplit(I.doc, d, s.length, s);
9739
9739
  if (h || (s[0] = l ? { type: l } : null, h = canSplit(I.doc, d, s.length, s)), I.split(d, s.length, s), !g && c && r.node(a).type != l) {
9740
- let u = I.mapping.map(r.before(a)), B = I.doc.resolve(u);
9740
+ let u = I.mapping.map(r.before(a)), E = I.doc.resolve(u);
9741
9741
  l && r.node(a - 1).canReplaceWith(
9742
- B.index(),
9743
- B.index() + 1,
9742
+ E.index(),
9743
+ E.index() + 1,
9744
9744
  l
9745
9745
  ) && I.setNodeMarkup(I.mapping.map(r.before(a)), l);
9746
9746
  }
@@ -9775,7 +9775,7 @@ function deleteBarrier(t, e, A, n) {
9775
9775
  for (let f = s.length - 1; f >= 0; f--)
9776
9776
  u = Fragment.from(s[f].create(null, u));
9777
9777
  u = Fragment.from(r.copy(u));
9778
- let B = t.tr.step(
9778
+ let E = t.tr.step(
9779
9779
  new ReplaceAroundStep(
9780
9780
  e.pos - 1,
9781
9781
  h,
@@ -9785,8 +9785,8 @@ function deleteBarrier(t, e, A, n) {
9785
9785
  s.length,
9786
9786
  !0
9787
9787
  )
9788
- ), E = B.doc.resolve(h + 2 * s.length);
9789
- E.nodeAfter && E.nodeAfter.type == r.type && canJoin(B.doc, E.pos) && B.join(E.pos), A(B.scrollIntoView());
9788
+ ), B = E.doc.resolve(h + 2 * s.length);
9789
+ B.nodeAfter && B.nodeAfter.type == r.type && canJoin(E.doc, B.pos) && E.join(B.pos), A(E.scrollIntoView());
9790
9790
  }
9791
9791
  return !0;
9792
9792
  }
@@ -9797,10 +9797,10 @@ function deleteBarrier(t, e, A, n) {
9797
9797
  let h = r, u = [];
9798
9798
  for (; u.push(h), !h.isTextblock; )
9799
9799
  h = h.lastChild;
9800
- let B = o, E = 1;
9801
- for (; !B.isTextblock; B = B.firstChild)
9802
- E++;
9803
- if (h.canReplace(h.childCount, h.childCount, B.content)) {
9800
+ let E = o, B = 1;
9801
+ for (; !E.isTextblock; E = E.firstChild)
9802
+ B++;
9803
+ if (h.canReplace(h.childCount, h.childCount, E.content)) {
9804
9804
  if (A) {
9805
9805
  let f = Fragment.empty;
9806
9806
  for (let p = u.length - 1; p >= 0; p--)
@@ -9809,8 +9809,8 @@ function deleteBarrier(t, e, A, n) {
9809
9809
  new ReplaceAroundStep(
9810
9810
  e.pos - u.length,
9811
9811
  e.pos + o.nodeSize,
9812
- e.pos + E,
9813
- e.pos + o.nodeSize - E,
9812
+ e.pos + B,
9813
+ e.pos + o.nodeSize - B,
9814
9814
  new Slice(f, u.length, 0),
9815
9815
  0,
9816
9816
  !0
@@ -9901,23 +9901,23 @@ function toggleMark(t, e = null, A) {
9901
9901
  (h) => s.doc.rangeHasMark(h.$from.pos, h.$to.pos, t)
9902
9902
  ) : I = !c.every((h) => {
9903
9903
  let u = !1;
9904
- return d.doc.nodesBetween(h.$from.pos, h.$to.pos, (B, E, f) => {
9904
+ return d.doc.nodesBetween(h.$from.pos, h.$to.pos, (E, B, f) => {
9905
9905
  if (u) return !1;
9906
- u = !t.isInSet(B.marks) && !!f && f.type.allowsMarkType(t) && !(B.isText && /^\s*$/.test(
9907
- B.textBetween(
9908
- Math.max(0, h.$from.pos - E),
9909
- Math.min(B.nodeSize, h.$to.pos - E)
9906
+ u = !t.isInSet(E.marks) && !!f && f.type.allowsMarkType(t) && !(E.isText && /^\s*$/.test(
9907
+ E.textBetween(
9908
+ Math.max(0, h.$from.pos - B),
9909
+ Math.min(E.nodeSize, h.$to.pos - B)
9910
9910
  )
9911
9911
  ));
9912
9912
  }), !u;
9913
9913
  });
9914
9914
  for (let h = 0; h < c.length; h++) {
9915
- let { $from: u, $to: B } = c[h];
9915
+ let { $from: u, $to: E } = c[h];
9916
9916
  if (!I)
9917
- d.removeMark(u.pos, B.pos, t);
9917
+ d.removeMark(u.pos, E.pos, t);
9918
9918
  else {
9919
- let E = u.pos, f = B.pos, Q = u.nodeAfter, p = B.nodeBefore, m = o && Q && Q.isText ? /^\s*/.exec(Q.text)[0].length : 0, y = o && p && p.isText ? /\s*$/.exec(p.text)[0].length : 0;
9920
- E + m < f && (E += m, f -= y), d.addMark(E, f, t.create(e));
9919
+ let B = u.pos, f = E.pos, Q = u.nodeAfter, p = E.nodeBefore, m = o && Q && Q.isText ? /^\s*/.exec(Q.text)[0].length : 0, y = o && p && p.isText ? /\s*$/.exec(p.text)[0].length : 0;
9920
+ B + m < f && (B += m, f -= y), d.addMark(B, f, t.create(e));
9921
9921
  }
9922
9922
  }
9923
9923
  a(d.scrollIntoView());
@@ -10069,8 +10069,8 @@ class CommandManager {
10069
10069
  const c = createChainableState(g, o), I = () => {
10070
10070
  }, d = {
10071
10071
  ...Object.fromEntries(
10072
- Object.entries(n).map(([h, u]) => [h, (...E) => {
10073
- const Q = u(...E).apply({ editor: this.editor }, [
10072
+ Object.entries(n).map(([h, u]) => [h, (...B) => {
10073
+ const Q = u(...B).apply({ editor: this.editor }, [
10074
10074
  c,
10075
10075
  A ? I : void 0
10076
10076
  ]);
@@ -10902,8 +10902,8 @@ function textPositionsToResolvedPos(t, e, A) {
10902
10902
  function a(l, g = 0, c = 0, I = 0) {
10903
10903
  g === 1 && c === A && (o = !0);
10904
10904
  let d = 0;
10905
- l.isText && l.text ? d = l.text?.length : l.isLeaf && (d = 1), d > 0 && s(I, g, c, d), l.forEach((h, u, B) => {
10906
- a(h, g + 1, B, I + u + 1);
10905
+ l.isText && l.text ? d = l.text?.length : l.isLeaf && (d = 1), d > 0 && s(I, g, c, d), l.forEach((h, u, E) => {
10906
+ a(h, g + 1, E, I + u + 1);
10907
10907
  });
10908
10908
  }
10909
10909
  if (a(e), o)
@@ -11031,14 +11031,14 @@ class DropCursorView {
11031
11031
  this.cursorPos - (I ? I.nodeSize : 0)
11032
11032
  );
11033
11033
  if (h) {
11034
- let u = h.getBoundingClientRect(), B = I ? u.bottom : u.top;
11035
- I && d && (B = (B + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
11036
- let E = this.width / 2 * a;
11034
+ let u = h.getBoundingClientRect(), E = I ? u.bottom : u.top;
11035
+ I && d && (E = (E + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
11036
+ let B = this.width / 2 * a;
11037
11037
  n = {
11038
11038
  left: u.left,
11039
11039
  right: u.right,
11040
- top: B - E,
11041
- bottom: B + E
11040
+ top: E - B,
11041
+ bottom: E + B
11042
11042
  };
11043
11043
  }
11044
11044
  }
@@ -11683,15 +11683,15 @@ function buildPairingTransaction(t, e, A) {
11683
11683
  else {
11684
11684
  const h = r.get(d);
11685
11685
  if (h && h.length > 0) {
11686
- const u = h.pop(), B = generateId();
11686
+ const u = h.pop(), E = generateId();
11687
11687
  A.setNodeMarkup(u.pos, void 0, {
11688
11688
  ...u.node.attrs,
11689
- id: B,
11689
+ id: E,
11690
11690
  nesting: NESTING_OPENING$1,
11691
11691
  error: void 0
11692
11692
  }), A.setNodeMarkup(l, void 0, {
11693
11693
  ...a.attrs,
11694
- id: B,
11694
+ id: E,
11695
11695
  nesting: NESTING_CLOSING$1,
11696
11696
  error: void 0
11697
11697
  });
@@ -12353,13 +12353,13 @@ class NodeImage extends Node$2 {
12353
12353
  p.className = `kb-image-resize-handle kb-image-resize-handle-${Q}`, p.dataset.position = Q, o.appendChild(p);
12354
12354
  }
12355
12355
  let l = !1, g = 0, c = 0, I = 0, d = 0, h = 1, u = null;
12356
- const B = (Q) => {
12356
+ const E = (Q) => {
12357
12357
  const p = Q.target;
12358
12358
  if (!p.classList.contains("kb-image-resize-handle")) return;
12359
12359
  Q.preventDefault(), Q.stopPropagation(), l = !0, u = p.dataset.position || null, g = Q.clientX, c = Q.clientY;
12360
12360
  const m = s.getBoundingClientRect();
12361
- I = m.width, d = m.height, h = I / d, o.classList.add("kb-image-resizing"), document.addEventListener("mousemove", E), document.addEventListener("mouseup", f);
12362
- }, E = (Q) => {
12361
+ I = m.width, d = m.height, h = I / d, o.classList.add("kb-image-resizing"), document.addEventListener("mousemove", B), document.addEventListener("mouseup", f);
12362
+ }, B = (Q) => {
12363
12363
  if (!l) return;
12364
12364
  const p = Q.clientX - g, m = Q.clientY - c;
12365
12365
  let y = I, w = d;
@@ -12380,7 +12380,7 @@ class NodeImage extends Node$2 {
12380
12380
  y = Math.max(50, y), w = Math.max(50, w), s.style.width = `${Math.round(y)}px`, s.style.height = `${Math.round(w)}px`;
12381
12381
  }, f = () => {
12382
12382
  if (!l) return;
12383
- l = !1, u = null, o.classList.remove("kb-image-resizing"), document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", f);
12383
+ l = !1, u = null, o.classList.remove("kb-image-resizing"), document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", f);
12384
12384
  const Q = Math.round(s.getBoundingClientRect().width), p = Math.round(s.getBoundingClientRect().height), m = r();
12385
12385
  if (typeof m == "number") {
12386
12386
  const y = n.state.tr.setNodeMarkup(m, void 0, {
@@ -12391,7 +12391,7 @@ class NodeImage extends Node$2 {
12391
12391
  n.dispatch(y);
12392
12392
  }
12393
12393
  };
12394
- return o.addEventListener("mousedown", B), o.addEventListener("click", (Q) => {
12394
+ return o.addEventListener("mousedown", E), o.addEventListener("click", (Q) => {
12395
12395
  Q.preventDefault();
12396
12396
  const p = r();
12397
12397
  if (typeof p == "number") {
@@ -12402,7 +12402,7 @@ class NodeImage extends Node$2 {
12402
12402
  dom: o,
12403
12403
  update: (Q) => Q.type.name !== "image" ? !1 : (s.src = Q.attrs.src, Q.attrs.alt && (s.alt = Q.attrs.alt), Q.attrs.title && (s.title = Q.attrs.title), Q.attrs.width ? s.style.width = typeof Q.attrs.width == "number" ? `${Q.attrs.width}px` : Q.attrs.width : s.style.width = "", Q.attrs.height ? s.style.height = typeof Q.attrs.height == "number" ? `${Q.attrs.height}px` : Q.attrs.height : s.style.height = "", !0),
12404
12404
  destroy: () => {
12405
- o.removeEventListener("mousedown", B), document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", f);
12405
+ o.removeEventListener("mousedown", E), document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", f);
12406
12406
  },
12407
12407
  stopEvent: (Q) => Q.type === "mousedown" && Q.target.classList.contains(
12408
12408
  "kb-image-resize-handle"
@@ -12892,15 +12892,15 @@ function splitListItem(t, e) {
12892
12892
  d = Fragment.from(o.node(Q).copy(d));
12893
12893
  let u = o.indexAfter(-1) < o.node(-2).childCount ? 1 : o.indexAfter(-2) < o.node(-3).childCount ? 2 : 3;
12894
12894
  d = d.append(Fragment.from(t.createAndFill()));
12895
- let B = o.before(o.depth - (h - 1)), E = n.tr.replace(
12896
- B,
12895
+ let E = o.before(o.depth - (h - 1)), B = n.tr.replace(
12896
+ E,
12897
12897
  o.after(-u),
12898
12898
  new Slice(d, 4 - h, 0)
12899
12899
  ), f = -1;
12900
- E.doc.nodesBetween(B, E.doc.content.size, (Q, p) => {
12900
+ B.doc.nodesBetween(E, B.doc.content.size, (Q, p) => {
12901
12901
  if (f > -1) return !1;
12902
12902
  Q.isTextblock && Q.content.size == 0 && (f = p + 1);
12903
- }), f > -1 && E.setSelection(Selection.near(E.doc.resolve(f))), r(E.scrollIntoView());
12903
+ }), f > -1 && B.setSelection(Selection.near(B.doc.resolve(f))), r(B.scrollIntoView());
12904
12904
  }
12905
12905
  return !0;
12906
12906
  }
@@ -12949,7 +12949,7 @@ function liftToOuterList(t, e, A, n) {
12949
12949
  }
12950
12950
  function liftOutOfList(t, e, A) {
12951
12951
  let n = t.tr, r = A.parent;
12952
- for (let h = A.end, u = A.endIndex - 1, B = A.startIndex; u > B; u--)
12952
+ for (let h = A.end, u = A.endIndex - 1, E = A.startIndex; u > E; u--)
12953
12953
  h -= r.child(u).nodeSize, n.delete(h - 1, h + 1);
12954
12954
  let o = n.doc.resolve(A.start), s = o.nodeAfter;
12955
12955
  if (n.mapping.map(A.end) != A.start + o.nodeAfter.nodeSize)
@@ -13026,10 +13026,10 @@ const isList = (t) => t.endsWith("_list"), clearNodes = () => (t, e) => {
13026
13026
  return;
13027
13027
  const u = liftTarget(h);
13028
13028
  if (a.type.isTextblock) {
13029
- const { defaultType: B } = I.parent.contentMatchAt(
13029
+ const { defaultType: E } = I.parent.contentMatchAt(
13030
13030
  I.index()
13031
13031
  );
13032
- A.setNodeMarkup(h.start, B);
13032
+ A.setNodeMarkup(h.start, E);
13033
13033
  }
13034
13034
  (u || u === 0) && A.lift(h, u);
13035
13035
  });
@@ -13073,20 +13073,20 @@ const joinListBackwards = (t, e) => {
13073
13073
  throw new Error("Call this with Function.apply");
13074
13074
  const a = this.editor, l = Object.keys(r.schema.marks).filter(
13075
13075
  (p) => p !== "link"
13076
- ), g = r.schema.nodes[t], c = r.schema.nodes[e], { selection: I, storedMarks: d } = r, { $from: h, $to: u } = I, B = h.blockRange(u), E = d || (I.$to.parentOffset ? I.$from.marks() : []);
13077
- if (!B)
13076
+ ), g = r.schema.nodes[t], c = r.schema.nodes[e], { selection: I, storedMarks: d } = r, { $from: h, $to: u } = I, E = h.blockRange(u), B = d || (I.$to.parentOffset ? I.$from.marks() : []);
13077
+ if (!E)
13078
13078
  return !1;
13079
13079
  const f = findParentNode((p) => isList(p.type.name))(
13080
13080
  I
13081
13081
  ), Q = r.tr;
13082
- if (B.depth >= 1 && f && B.depth - f.depth <= 1) {
13082
+ if (E.depth >= 1 && f && E.depth - f.depth <= 1) {
13083
13083
  if (f.node.type === g)
13084
13084
  return liftListItem(c).apply(this, [r, o, s]);
13085
13085
  if (isList(f.node.type.name) && g.validContent(f.node.content) && o)
13086
13086
  return a.chain(Q).command(() => (Q.setNodeMarkup(f.pos, g), !0)).command(() => joinListBackwards(Q, g)).command(() => joinListForwards(Q, g)).command(() => o(Q)).run();
13087
13087
  }
13088
- return !A || !E || !o ? a.chain(Q).command(() => a.can().wrapInList(g, n).run() ? !0 : a.chain(Q).lift().run()).wrapInList(g, n).command(() => joinListBackwards(Q, g)).command(() => joinListForwards(Q, g)).command(() => (o && o(Q), !0)).run() : a.chain(Q).command(() => {
13089
- const p = a.can().wrapInList(g, n).run(), m = E.filter(
13088
+ return !A || !B || !o ? a.chain(Q).command(() => a.can().wrapInList(g, n).run() ? !0 : a.chain(Q).lift().run()).wrapInList(g, n).command(() => joinListBackwards(Q, g)).command(() => joinListForwards(Q, g)).command(() => (o && o(Q), !0)).run() : a.chain(Q).command(() => {
13089
+ const p = a.can().wrapInList(g, n).run(), m = B.filter(
13090
13090
  (y) => l.includes(y.type.name)
13091
13091
  );
13092
13092
  return Q.ensureMarks(m), p ? !0 : (f && Q.setSelection(NodeSelection.create(r.doc, f.pos)), clearNodes().apply(this, [r, o, s]));
@@ -13772,7 +13772,7 @@ class CodeJar extends EventTarget {
13772
13772
  this.listeners.push([D, _]), this.editor.addEventListener(D, _);
13773
13773
  };
13774
13774
  h("keydown", (D) => {
13775
- D.defaultPrevented || (this.prev = this.toString(), this.options.preserveIdent ? E(D) : f(D), this.options.catchTab && p(D), this.options.addClosing && Q(D), this.options.history && (m(D), I(D) && !c && (this.recordHistory(), c = !0)), l && !isCopy(D) && this.restore(this.save()));
13775
+ D.defaultPrevented || (this.prev = this.toString(), this.options.preserveIdent ? B(D) : f(D), this.options.catchTab && p(D), this.options.addClosing && Q(D), this.options.history && (m(D), I(D) && !c && (this.recordHistory(), c = !0)), l && !isCopy(D) && this.restore(this.save()));
13776
13776
  }), h("keyup", (D) => {
13777
13777
  D.defaultPrevented || D.isComposing || (this.prev !== this.toString() && g(), d(D), this.onUpdateCbk(this.toString()));
13778
13778
  }), h("focus", (D) => {
@@ -13787,12 +13787,12 @@ class CodeJar extends EventTarget {
13787
13787
  const u = () => {
13788
13788
  const _ = this.getSelection().getRangeAt(0), k = o.createRange();
13789
13789
  return k.selectNodeContents(e), k.setEnd(_.startContainer, _.startOffset), k.toString();
13790
- }, B = () => {
13790
+ }, E = () => {
13791
13791
  const _ = this.getSelection().getRangeAt(0), k = o.createRange();
13792
13792
  return k.selectNodeContents(e), k.setStart(_.endContainer, _.endOffset), k.toString();
13793
- }, E = (D) => {
13793
+ }, B = (D) => {
13794
13794
  if (D.key === "Enter") {
13795
- const _ = u(), k = B();
13795
+ const _ = u(), k = E();
13796
13796
  let [S] = findPadding(_), F = S;
13797
13797
  if (this.options.indentOn.test(_) && (F += this.options.tab), F.length > 0 ? (D.preventDefault(), D.stopPropagation(), insert$1(`
13798
13798
  ` + F)) : f(D), F !== S && this.options.moveToNewLine.test(k)) {
@@ -13803,7 +13803,7 @@ class CodeJar extends EventTarget {
13803
13803
  }
13804
13804
  }, f = (D) => {
13805
13805
  if (l && D.key === "Enter")
13806
- if (D.preventDefault(), D.stopPropagation(), B() == "") {
13806
+ if (D.preventDefault(), D.stopPropagation(), E() == "") {
13807
13807
  insert$1(`
13808
13808
  `);
13809
13809
  const _ = this.save();
@@ -15476,13 +15476,13 @@ async function Module2(moduleArg = {}) {
15476
15476
  tlsExports: /* @__PURE__ */ new Set(),
15477
15477
  weakImports: /* @__PURE__ */ new Set(),
15478
15478
  runtimePaths: []
15479
- }, u = 1, B = 2, E = 3, f = 4, Q = 5, p = 256, m = 3, y = 1; e < A; ) {
15479
+ }, u = 1, E = 2, B = 3, f = 4, Q = 5, p = 256, m = 3, y = 1; e < A; ) {
15480
15480
  var w = n(), D = r();
15481
15481
  if (w === u)
15482
15482
  h.memorySize = r(), h.memoryAlign = r(), h.tableSize = r(), h.tableAlign = r();
15483
- else if (w === B)
15484
- h.neededDynlibs = s();
15485
15483
  else if (w === E)
15484
+ h.neededDynlibs = s();
15485
+ else if (w === B)
15486
15486
  for (var _ = r(); _--; ) {
15487
15487
  var k = o(), S = r();
15488
15488
  S & p && h.tlsExports.add(k);
@@ -16493,50 +16493,50 @@ var Query = class {
16493
16493
  TRANSFER_BUFFER + SIZE_OF_INT
16494
16494
  );
16495
16495
  if (!r) {
16496
- const E = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), f = C.getValue(TRANSFER_BUFFER, "i32"), Q = C.UTF8ToString(n, f).length, p = e.slice(Q, Q + 100).split(`
16496
+ const B = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), f = C.getValue(TRANSFER_BUFFER, "i32"), Q = C.UTF8ToString(n, f).length, p = e.slice(Q, Q + 100).split(`
16497
16497
  `)[0], m = p.match(QUERY_WORD_REGEX)?.[0] ?? "";
16498
- switch (C._free(n), E) {
16498
+ switch (C._free(n), B) {
16499
16499
  case QueryErrorKind.Syntax:
16500
16500
  throw new QueryError(QueryErrorKind.Syntax, { suffix: `${Q}: '${p}'...` }, Q, 0);
16501
16501
  case QueryErrorKind.NodeName:
16502
- throw new QueryError(E, { word: m }, Q, m.length);
16502
+ throw new QueryError(B, { word: m }, Q, m.length);
16503
16503
  case QueryErrorKind.FieldName:
16504
- throw new QueryError(E, { word: m }, Q, m.length);
16504
+ throw new QueryError(B, { word: m }, Q, m.length);
16505
16505
  case QueryErrorKind.CaptureName:
16506
- throw new QueryError(E, { word: m }, Q, m.length);
16506
+ throw new QueryError(B, { word: m }, Q, m.length);
16507
16507
  case QueryErrorKind.PatternStructure:
16508
- throw new QueryError(E, { suffix: `${Q}: '${p}'...` }, Q, 0);
16508
+ throw new QueryError(B, { suffix: `${Q}: '${p}'...` }, Q, 0);
16509
16509
  }
16510
16510
  }
16511
16511
  const o = C._ts_query_string_count(r), s = C._ts_query_capture_count(r), a = C._ts_query_pattern_count(r), l = new Array(s), g = new Array(a), c = new Array(o);
16512
- for (let E = 0; E < s; E++) {
16512
+ for (let B = 0; B < s; B++) {
16513
16513
  const f = C._ts_query_capture_name_for_id(
16514
16514
  r,
16515
- E,
16515
+ B,
16516
16516
  TRANSFER_BUFFER
16517
16517
  ), Q = C.getValue(TRANSFER_BUFFER, "i32");
16518
- l[E] = C.UTF8ToString(f, Q);
16518
+ l[B] = C.UTF8ToString(f, Q);
16519
16519
  }
16520
- for (let E = 0; E < a; E++) {
16520
+ for (let B = 0; B < a; B++) {
16521
16521
  const f = new Array(s);
16522
16522
  for (let Q = 0; Q < s; Q++) {
16523
- const p = C._ts_query_capture_quantifier_for_id(r, E, Q);
16523
+ const p = C._ts_query_capture_quantifier_for_id(r, B, Q);
16524
16524
  f[Q] = p;
16525
16525
  }
16526
- g[E] = f;
16526
+ g[B] = f;
16527
16527
  }
16528
- for (let E = 0; E < o; E++) {
16528
+ for (let B = 0; B < o; B++) {
16529
16529
  const f = C._ts_query_string_value_for_id(
16530
16530
  r,
16531
- E,
16531
+ B,
16532
16532
  TRANSFER_BUFFER
16533
16533
  ), Q = C.getValue(TRANSFER_BUFFER, "i32");
16534
- c[E] = C.UTF8ToString(f, Q);
16534
+ c[B] = C.UTF8ToString(f, Q);
16535
16535
  }
16536
- const I = new Array(a), d = new Array(a), h = new Array(a), u = new Array(a), B = new Array(a);
16537
- for (let E = 0; E < a; E++) {
16538
- const f = C._ts_query_predicates_for_pattern(r, E, TRANSFER_BUFFER), Q = C.getValue(TRANSFER_BUFFER, "i32");
16539
- u[E] = [], B[E] = [];
16536
+ const I = new Array(a), d = new Array(a), h = new Array(a), u = new Array(a), E = new Array(a);
16537
+ for (let B = 0; B < a; B++) {
16538
+ const f = C._ts_query_predicates_for_pattern(r, B, TRANSFER_BUFFER), Q = C.getValue(TRANSFER_BUFFER, "i32");
16539
+ u[B] = [], E[B] = [];
16540
16540
  const p = new Array();
16541
16541
  let m = f;
16542
16542
  for (let y = 0; y < Q; y++) {
@@ -16544,22 +16544,22 @@ var Query = class {
16544
16544
  m += SIZE_OF_INT;
16545
16545
  const D = C.getValue(m, "i32");
16546
16546
  m += SIZE_OF_INT, parsePattern(
16547
- E,
16547
+ B,
16548
16548
  w,
16549
16549
  D,
16550
16550
  l,
16551
16551
  c,
16552
16552
  p,
16553
- B,
16553
+ E,
16554
16554
  u,
16555
16555
  I,
16556
16556
  d,
16557
16557
  h
16558
16558
  );
16559
16559
  }
16560
- Object.freeze(B[E]), Object.freeze(u[E]), Object.freeze(I[E]), Object.freeze(d[E]), Object.freeze(h[E]);
16560
+ Object.freeze(E[B]), Object.freeze(u[B]), Object.freeze(I[B]), Object.freeze(d[B]), Object.freeze(h[B]);
16561
16561
  }
16562
- C._free(n), this[0] = r, this.captureNames = l, this.captureQuantifiers = g, this.textPredicates = B, this.predicates = u, this.setProperties = I, this.assertedProperties = d, this.refutedProperties = h, this.exceededMatchLimit = !1;
16562
+ C._free(n), this[0] = r, this.captureNames = l, this.captureQuantifiers = g, this.textPredicates = E, this.predicates = u, this.setProperties = I, this.assertedProperties = d, this.refutedProperties = h, this.exceededMatchLimit = !1;
16563
16563
  }
16564
16564
  /** Delete the query, freeing its resources. */
16565
16565
  delete() {
@@ -16607,8 +16607,8 @@ var Query = class {
16607
16607
  c,
16608
16608
  I
16609
16609
  );
16610
- const h = C.getValue(TRANSFER_BUFFER, "i32"), u = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), B = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), E = new Array(h);
16611
- this.exceededMatchLimit = !!B;
16610
+ const h = C.getValue(TRANSFER_BUFFER, "i32"), u = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), E = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), B = new Array(h);
16611
+ this.exceededMatchLimit = !!E;
16612
16612
  let f = 0, Q = u;
16613
16613
  for (let p = 0; p < h; p++) {
16614
16614
  const m = C.getValue(Q, "i32");
@@ -16617,16 +16617,16 @@ var Query = class {
16617
16617
  Q += SIZE_OF_INT;
16618
16618
  const w = new Array(y);
16619
16619
  if (Q = unmarshalCaptures(this, t.tree, Q, m, w), this.textPredicates[m].every((D) => D(w))) {
16620
- E[f] = { patternIndex: m, captures: w };
16620
+ B[f] = { patternIndex: m, captures: w };
16621
16621
  const D = this.setProperties[m];
16622
- E[f].setProperties = D;
16622
+ B[f].setProperties = D;
16623
16623
  const _ = this.assertedProperties[m];
16624
- E[f].assertedProperties = _;
16624
+ B[f].assertedProperties = _;
16625
16625
  const k = this.refutedProperties[m];
16626
- E[f].refutedProperties = k, f++;
16626
+ B[f].refutedProperties = k, f++;
16627
16627
  }
16628
16628
  }
16629
- return E.length = f, C._free(u), C.currentQueryProgressCallback = null, E;
16629
+ return B.length = f, C._free(u), C.currentQueryProgressCallback = null, B;
16630
16630
  }
16631
16631
  /**
16632
16632
  * Iterate over all of the individual captures in the order that they
@@ -16669,8 +16669,8 @@ var Query = class {
16669
16669
  c,
16670
16670
  I
16671
16671
  );
16672
- const h = C.getValue(TRANSFER_BUFFER, "i32"), u = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), B = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), E = new Array();
16673
- this.exceededMatchLimit = !!B;
16672
+ const h = C.getValue(TRANSFER_BUFFER, "i32"), u = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), E = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), B = new Array();
16673
+ this.exceededMatchLimit = !!E;
16674
16674
  const f = new Array();
16675
16675
  let Q = u;
16676
16676
  for (let p = 0; p < h; p++) {
@@ -16685,10 +16685,10 @@ var Query = class {
16685
16685
  const k = this.assertedProperties[m];
16686
16686
  D.assertedProperties = k;
16687
16687
  const S = this.refutedProperties[m];
16688
- D.refutedProperties = S, E.push(D);
16688
+ D.refutedProperties = S, B.push(D);
16689
16689
  }
16690
16690
  }
16691
- return C._free(u), C.currentQueryProgressCallback = null, E;
16691
+ return C._free(u), C.currentQueryProgressCallback = null, B;
16692
16692
  }
16693
16693
  /** Get the predicates for a given pattern. */
16694
16694
  predicatesForPattern(t) {
@@ -17291,16 +17291,16 @@ const _childrenWithSoftNodes = (t, e, A) => {
17291
17291
  const s = (l, g, c) => {
17292
17292
  const { index: I, position: d } = g();
17293
17293
  let h = I, u = d;
17294
- const B = l.split(/(?<!\s)(?=\s+)/g);
17295
- let E = u.column, f = u.row;
17296
- for (const Q of B) {
17294
+ const E = l.split(/(?<!\s)(?=\s+)/g);
17295
+ let B = u.column, f = u.row;
17296
+ for (const Q of E) {
17297
17297
  if (Q.length == 0)
17298
17298
  continue;
17299
17299
  const p = h + Q.length;
17300
17300
  if (Q.match(/^\s/)) {
17301
- const m = f, y = E;
17302
- f += (Q.match(/\n/g) || []).length, m != f ? E = Q.split(`
17303
- `).slice(-1)[0].length : E += Q.length, n.push(
17301
+ const m = f, y = B;
17302
+ f += (Q.match(/\n/g) || []).length, m != f ? B = Q.split(`
17303
+ `).slice(-1)[0].length : B += Q.length, n.push(
17304
17304
  new WhitespaceNode({
17305
17305
  tree: t.tree,
17306
17306
  parent: c,
@@ -17311,13 +17311,13 @@ const _childrenWithSoftNodes = (t, e, A) => {
17311
17311
  _startColOffset: y - d.column,
17312
17312
  _endIndexOffset: p - I,
17313
17313
  _endRowOffset: f - d.row,
17314
- _endColOffset: E - d.column,
17314
+ _endColOffset: B - d.column,
17315
17315
  children: []
17316
17316
  })
17317
17317
  );
17318
17318
  } else {
17319
- const m = E;
17320
- E += Q.length, n.push(
17319
+ const m = B;
17320
+ B += Q.length, n.push(
17321
17321
  new SoftTextNode({
17322
17322
  tree: t.tree,
17323
17323
  parent: c,
@@ -17328,7 +17328,7 @@ const _childrenWithSoftNodes = (t, e, A) => {
17328
17328
  _startColOffset: m - d.column,
17329
17329
  _endIndexOffset: p - I,
17330
17330
  _endRowOffset: f - d.row,
17331
- _endColOffset: E - d.column,
17331
+ _endColOffset: B - d.column,
17332
17332
  children: []
17333
17333
  })
17334
17334
  );
@@ -17567,16 +17567,16 @@ class CodeJarBlockNodeView {
17567
17567
  });
17568
17568
  const d = l.params.diagnostics, h = [];
17569
17569
  for (const u of d) {
17570
- const B = I.fromLineChar(
17570
+ const E = I.fromLineChar(
17571
17571
  u.range.start.line,
17572
17572
  u.range.start.character
17573
- ), E = I.fromLineChar(
17573
+ ), B = I.fromLineChar(
17574
17574
  u.range.end.line,
17575
17575
  u.range.end.character
17576
17576
  );
17577
17577
  h.push({
17578
- startIndex: B,
17579
- endIndex: E,
17578
+ startIndex: E,
17579
+ endIndex: B,
17580
17580
  className: "kb-lsp__error",
17581
17581
  title: u.message || ""
17582
17582
  });
@@ -17952,20 +17952,20 @@ function requireHtml() {
17952
17952
  `);
17953
17953
  var u = n.token_text;
17954
17954
  if (n.token_type == "TK_SCRIPT")
17955
- var B = typeof js_beautify == "function" && js_beautify;
17955
+ var E = typeof js_beautify == "function" && js_beautify;
17956
17956
  else if (n.token_type == "TK_STYLE")
17957
- var B = typeof css_beautify == "function" && css_beautify;
17957
+ var E = typeof css_beautify == "function" && css_beautify;
17958
17958
  if (A.indent_scripts == "keep")
17959
- var E = 0;
17959
+ var B = 0;
17960
17960
  else if (A.indent_scripts == "separate")
17961
- var E = -n.indent_level;
17961
+ var B = -n.indent_level;
17962
17962
  else
17963
- var E = 1;
17964
- var f = n.get_full_indent(E);
17965
- if (B)
17966
- u = B(u.replace(/^\s*/, f), A);
17963
+ var B = 1;
17964
+ var f = n.get_full_indent(B);
17965
+ if (E)
17966
+ u = E(u.replace(/^\s*/, f), A);
17967
17967
  else {
17968
- var Q = u.match(/^\s*/)[0], p = Q.match(/[^\n\r]*$/)[0].split(n.indent_string).length - 1, m = n.get_full_indent(E - p);
17968
+ var Q = u.match(/^\s*/)[0], p = Q.match(/[^\n\r]*$/)[0].split(n.indent_string).length - 1, m = n.get_full_indent(B - p);
17969
17969
  u = u.replace(/^\s*/, f).replace(/\r\n|\r|\n/g, `
17970
17970
  ` + m).replace(/\s*$/, "");
17971
17971
  }
@@ -18307,28 +18307,28 @@ function destroy_block(t, e) {
18307
18307
  }
18308
18308
  function update_keyed_each(t, e, A, n, r, o, s, a, l, g, c, I) {
18309
18309
  let d = t.length, h = o.length, u = d;
18310
- const B = {};
18311
- for (; u--; ) B[t[u].key] = u;
18312
- const E = [], f = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map(), p = [];
18310
+ const E = {};
18311
+ for (; u--; ) E[t[u].key] = u;
18312
+ const B = [], f = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map(), p = [];
18313
18313
  for (u = h; u--; ) {
18314
18314
  const D = I(r, o, u), _ = A(D);
18315
18315
  let k = s.get(_);
18316
- k ? p.push(() => k.p(D, e)) : (k = g(_, D), k.c()), f.set(_, E[u] = k), _ in B && Q.set(_, Math.abs(u - B[_]));
18316
+ k ? p.push(() => k.p(D, e)) : (k = g(_, D), k.c()), f.set(_, B[u] = k), _ in E && Q.set(_, Math.abs(u - E[_]));
18317
18317
  }
18318
18318
  const m = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Set();
18319
18319
  function w(D) {
18320
18320
  transition_in(D, 1), D.m(a, c), s.set(D.key, D), c = D.first, h--;
18321
18321
  }
18322
18322
  for (; d && h; ) {
18323
- const D = E[h - 1], _ = t[d - 1], k = D.key, S = _.key;
18323
+ const D = B[h - 1], _ = t[d - 1], k = D.key, S = _.key;
18324
18324
  D === _ ? (c = D.first, d--, h--) : f.has(S) ? !s.has(k) || m.has(k) ? w(D) : y.has(S) ? d-- : Q.get(k) > Q.get(S) ? (y.add(k), w(D)) : (m.add(S), d--) : (l(_, s), d--);
18325
18325
  }
18326
18326
  for (; d--; ) {
18327
18327
  const D = t[d];
18328
18328
  f.has(D.key) || l(D, s);
18329
18329
  }
18330
- for (; h; ) w(E[h - 1]);
18331
- return run_all(p), E;
18330
+ for (; h; ) w(B[h - 1]);
18331
+ return run_all(p), B;
18332
18332
  }
18333
18333
  function create_component(t) {
18334
18334
  t && t.c();
@@ -18430,11 +18430,11 @@ function add_css$k(t) {
18430
18430
  append_styles(t, "svelte-1lt2k10", ".floating-btn.svelte-1lt2k10.svelte-1lt2k10{background:#363755;border:0;border-radius:50%;box-shadow:0 0 30px rgba(34, 34, 34, 0.3);cursor:pointer;position:fixed;padding:6px;transition:opacity 0.3s;-webkit-transition:opacity 0.3s;z-index:99999}.floating-btn.bottom-right.svelte-1lt2k10.svelte-1lt2k10{bottom:16px;right:16px}.floating-btn.bottom-left.svelte-1lt2k10.svelte-1lt2k10{bottom:16px;left:16px}.floating-btn.top-right.svelte-1lt2k10.svelte-1lt2k10{top:16px;right:16px}.floating-btn.top-left.svelte-1lt2k10.svelte-1lt2k10{top:16px;left:16px}.floating-btn.svelte-1lt2k10.svelte-1lt2k10:hover{opacity:0.7}.floating-btn.svelte-1lt2k10>svg.svelte-1lt2k10{display:block;width:34px;height:34px;position:relative}");
18431
18431
  }
18432
18432
  function create_fragment$k(t) {
18433
- let e, A, n, r, o, s, a, l, g, c, I, d, h, u, B, E, f, Q, p, m, y, w, D, _;
18433
+ let e, A, n, r, o, s, a, l, g, c, I, d, h, u, E, B, f, Q, p, m, y, w, D, _;
18434
18434
  return {
18435
18435
  c() {
18436
- e = element("button"), A = svg_element("svg"), n = svg_element("title"), r = text("prosemirror"), o = svg_element("desc"), s = text("Created using Figma"), a = svg_element("use"), l = svg_element("use"), g = svg_element("use"), c = svg_element("use"), I = svg_element("use"), d = svg_element("use"), h = svg_element("use"), u = svg_element("defs"), B = svg_element("path"), E = svg_element("path"), f = svg_element("path"), Q = svg_element("path"), p = svg_element("path"), m = svg_element("path"), y = svg_element("path"), xlink_attr(a, "xlink:href", "#a"), attr(a, "transform", "matrix(2 0 0 2 118 116)"), attr(a, "fill", "#FFF"), xlink_attr(l, "xlink:href", "#b"), attr(l, "transform", "rotate(16 59.054 420.192) scale(2)"), attr(l, "fill", "#FFF"), xlink_attr(g, "xlink:href", "#c"), attr(g, "transform", "matrix(2 0 0 2 154.024 141.58)"), attr(g, "fill", "#363755"), xlink_attr(c, "xlink:href", "#d"), attr(c, "transform", "matrix(2 0 0 2 220 334.8)"), attr(c, "fill", "#FFF"), xlink_attr(I, "xlink:href", "#e"), attr(I, "transform", "matrix(2 0 0 2 218.826 262.052)"), attr(I, "fill", "#363755"), xlink_attr(d, "xlink:href", "#f"), attr(d, "transform", "matrix(2 0 0 2 197.108 184.998)"), attr(d, "fill", "#FFF"), xlink_attr(h, "xlink:href", "#g"), attr(h, "transform", "matrix(2 0 0 2 221.8 216)"), attr(h, "fill", "#363755"), attr(B, "id", "a"), attr(B, "d", `M73.5 0C32.859 0 0 32.859 0 73.5S32.859 147 73.5 147 147 114.141 147 73.5 114.069 0 73.5
18437
- 0z`), attr(E, "id", "b"), attr(E, "d", `M193.601 107.116c0-13.376 8.238-23.91
18436
+ e = element("button"), A = svg_element("svg"), n = svg_element("title"), r = text("prosemirror"), o = svg_element("desc"), s = text("Created using Figma"), a = svg_element("use"), l = svg_element("use"), g = svg_element("use"), c = svg_element("use"), I = svg_element("use"), d = svg_element("use"), h = svg_element("use"), u = svg_element("defs"), E = svg_element("path"), B = svg_element("path"), f = svg_element("path"), Q = svg_element("path"), p = svg_element("path"), m = svg_element("path"), y = svg_element("path"), xlink_attr(a, "xlink:href", "#a"), attr(a, "transform", "matrix(2 0 0 2 118 116)"), attr(a, "fill", "#FFF"), xlink_attr(l, "xlink:href", "#b"), attr(l, "transform", "rotate(16 59.054 420.192) scale(2)"), attr(l, "fill", "#FFF"), xlink_attr(g, "xlink:href", "#c"), attr(g, "transform", "matrix(2 0 0 2 154.024 141.58)"), attr(g, "fill", "#363755"), xlink_attr(c, "xlink:href", "#d"), attr(c, "transform", "matrix(2 0 0 2 220 334.8)"), attr(c, "fill", "#FFF"), xlink_attr(I, "xlink:href", "#e"), attr(I, "transform", "matrix(2 0 0 2 218.826 262.052)"), attr(I, "fill", "#363755"), xlink_attr(d, "xlink:href", "#f"), attr(d, "transform", "matrix(2 0 0 2 197.108 184.998)"), attr(d, "fill", "#FFF"), xlink_attr(h, "xlink:href", "#g"), attr(h, "transform", "matrix(2 0 0 2 221.8 216)"), attr(h, "fill", "#363755"), attr(E, "id", "a"), attr(E, "d", `M73.5 0C32.859 0 0 32.859 0 73.5S32.859 147 73.5 147 147 114.141 147 73.5 114.069 0 73.5
18437
+ 0z`), attr(B, "id", "b"), attr(B, "d", `M193.601 107.116c0-13.376 8.238-23.91
18438
18438
  20.619-31.153-2.244-7.447-5.19-14.6-8.824-21.32-13.886
18439
18439
  3.633-25.12-1.799-34.568-11.26-9.449-9.437-12.344-20.672-8.709-34.571A111.362 111.362 0 0 0
18440
18440
  140.799 0c-7.243 12.37-20.339 20.594-33.689 20.594-13.363
@@ -18459,7 +18459,7 @@ function create_fragment$k(t) {
18459
18459
  )) + " svelte-1lt2k10");
18460
18460
  },
18461
18461
  m(k, S) {
18462
- insert(k, e, S), append(e, A), append(A, n), append(n, r), append(A, o), append(o, s), append(A, a), append(A, l), append(A, g), append(A, c), append(A, I), append(A, d), append(A, h), append(A, u), append(u, B), append(u, E), append(u, f), append(u, Q), append(u, p), append(u, m), append(u, y), D || (_ = listen(
18462
+ insert(k, e, S), append(e, A), append(A, n), append(n, r), append(A, o), append(o, s), append(A, a), append(A, l), append(A, g), append(A, c), append(A, I), append(A, d), append(A, h), append(A, u), append(u, E), append(u, B), append(u, f), append(u, Q), append(u, p), append(u, m), append(u, y), D || (_ = listen(
18463
18463
  e,
18464
18464
  "click",
18465
18465
  /*click_handler*/
@@ -18551,10 +18551,10 @@ function derived(t, e, A) {
18551
18551
  I();
18552
18552
  const u = e(n ? g[0] : g, s, a);
18553
18553
  o ? s(u) : I = is_function(u) ? u : noop;
18554
- }, h = r.map((u, B) => subscribe(u, (E) => {
18555
- g[B] = E, c &= ~(1 << B), l && d();
18554
+ }, h = r.map((u, E) => subscribe(u, (B) => {
18555
+ g[E] = B, c &= ~(1 << E), l && d();
18556
18556
  }, () => {
18557
- c |= 1 << B;
18557
+ c |= 1 << E;
18558
18558
  }));
18559
18559
  return l = !0, d(), function() {
18560
18560
  run_all(h), I(), l = !1;
@@ -18667,13 +18667,13 @@ function create_fragment$j(t) {
18667
18667
  ))], I = !0);
18668
18668
  },
18669
18669
  p(h, u) {
18670
- let [B] = u;
18671
- B & /*doc*/
18670
+ let [E] = u;
18671
+ E & /*doc*/
18672
18672
  2 && set_input_value(
18673
18673
  c,
18674
18674
  /*doc*/
18675
18675
  h[1]
18676
- ), B & /*isOpen*/
18676
+ ), E & /*isOpen*/
18677
18677
  1 && toggle_class(e, "hidden", !/*isOpen*/
18678
18678
  h[0]);
18679
18679
  },
@@ -18718,10 +18718,10 @@ function add_css$i(t) {
18718
18718
  append_styles(t, "svelte-10notzq", "ul.svelte-10notzq{display:flex;list-style:none;margin:0;overflow-x:scroll;padding:0}button.svelte-10notzq{background:transparent;border:0;border-bottom:2px solid transparent;color:#fff;cursor:pointer;height:100%;font-size:var(--font-medium);font-weight:400;padding:1em}button.svelte-10notzq:hover{background:rgba(255, 255, 255, 0.05)}button.active.svelte-10notzq{border-bottom:2px solid rgb(255, 162, 177)}");
18719
18719
  }
18720
18720
  function create_fragment$i(t) {
18721
- let e, A, n, r, o, s, a, l, g, c, I, d, h, u, B, E, f, Q, p, m;
18721
+ let e, A, n, r, o, s, a, l, g, c, I, d, h, u, E, B, f, Q, p, m;
18722
18722
  return {
18723
18723
  c() {
18724
- e = element("ul"), A = element("li"), n = element("button"), n.textContent = "STATE", r = space(), o = element("li"), s = element("button"), s.textContent = "HISTORY", a = space(), l = element("li"), g = element("button"), g.textContent = "PLUGINS", c = space(), I = element("li"), d = element("button"), d.textContent = "SCHEMA", h = space(), u = element("li"), B = element("button"), B.textContent = "STRUCTURE", E = space(), f = element("li"), Q = element("button"), Q.textContent = "SNAPSHOTS", attr(n, "class", "svelte-10notzq"), toggle_class(
18724
+ e = element("ul"), A = element("li"), n = element("button"), n.textContent = "STATE", r = space(), o = element("li"), s = element("button"), s.textContent = "HISTORY", a = space(), l = element("li"), g = element("button"), g.textContent = "PLUGINS", c = space(), I = element("li"), d = element("button"), d.textContent = "SCHEMA", h = space(), u = element("li"), E = element("button"), E.textContent = "STRUCTURE", B = space(), f = element("li"), Q = element("button"), Q.textContent = "SNAPSHOTS", attr(n, "class", "svelte-10notzq"), toggle_class(
18725
18725
  n,
18726
18726
  "active",
18727
18727
  /*active*/
@@ -18741,8 +18741,8 @@ function create_fragment$i(t) {
18741
18741
  "active",
18742
18742
  /*active*/
18743
18743
  t[0] === "schema"
18744
- ), attr(B, "class", "svelte-10notzq"), toggle_class(
18745
- B,
18744
+ ), attr(E, "class", "svelte-10notzq"), toggle_class(
18745
+ E,
18746
18746
  "active",
18747
18747
  /*active*/
18748
18748
  t[0] === "structure"
@@ -18754,7 +18754,7 @@ function create_fragment$i(t) {
18754
18754
  ), attr(e, "class", "tabs-menu svelte-10notzq");
18755
18755
  },
18756
18756
  m(y, w) {
18757
- insert(y, e, w), append(e, A), append(A, n), append(e, r), append(e, o), append(o, s), append(e, a), append(e, l), append(l, g), append(e, c), append(e, I), append(I, d), append(e, h), append(e, u), append(u, B), append(e, E), append(e, f), append(f, Q), p || (m = [listen(
18757
+ insert(y, e, w), append(e, A), append(A, n), append(e, r), append(e, o), append(o, s), append(e, a), append(e, l), append(l, g), append(e, c), append(e, I), append(I, d), append(e, h), append(e, u), append(u, E), append(e, B), append(e, f), append(f, Q), p || (m = [listen(
18758
18758
  n,
18759
18759
  "click",
18760
18760
  /*click_handler*/
@@ -18775,7 +18775,7 @@ function create_fragment$i(t) {
18775
18775
  /*click_handler_3*/
18776
18776
  t[5]
18777
18777
  ), listen(
18778
- B,
18778
+ E,
18779
18779
  "click",
18780
18780
  /*click_handler_4*/
18781
18781
  t[6]
@@ -18814,7 +18814,7 @@ function create_fragment$i(t) {
18814
18814
  y[0] === "schema"
18815
18815
  ), D & /*active*/
18816
18816
  1 && toggle_class(
18817
- B,
18817
+ E,
18818
18818
  "active",
18819
18819
  /*active*/
18820
18820
  y[0] === "structure"
@@ -18888,7 +18888,7 @@ var diffMatchPatch = { exports: {} };
18888
18888
  return [new e.Diff(A, o), new e.Diff(n, s)];
18889
18889
  var h = this.diff_halfMatch_(o, s);
18890
18890
  if (h) {
18891
- var u = h[0], B = h[1], E = h[2], f = h[3], Q = h[4], p = this.diff_main(u, E, a, l), m = this.diff_main(B, f, a, l);
18891
+ var u = h[0], E = h[1], B = h[2], f = h[3], Q = h[4], p = this.diff_main(u, B, a, l), m = this.diff_main(E, f, a, l);
18892
18892
  return p.concat([new e.Diff(r, Q)], m);
18893
18893
  }
18894
18894
  return a && o.length > 100 && s.length > 100 ? this.diff_lineMode_(o, s, l) : this.diff_bisect_(o, s, l);
@@ -18897,10 +18897,10 @@ var diffMatchPatch = { exports: {} };
18897
18897
  o = l.chars1, s = l.chars2;
18898
18898
  var g = l.lineArray, c = this.diff_main(o, s, !1, a);
18899
18899
  this.diff_charsToLines_(c, g), this.diff_cleanupSemantic(c), c.push(new e.Diff(r, ""));
18900
- for (var I = 0, d = 0, h = 0, u = "", B = ""; I < c.length; ) {
18900
+ for (var I = 0, d = 0, h = 0, u = "", E = ""; I < c.length; ) {
18901
18901
  switch (c[I][0]) {
18902
18902
  case n:
18903
- h++, B += c[I][1];
18903
+ h++, E += c[I][1];
18904
18904
  break;
18905
18905
  case A:
18906
18906
  d++, u += c[I][1];
@@ -18908,21 +18908,21 @@ var diffMatchPatch = { exports: {} };
18908
18908
  case r:
18909
18909
  if (d >= 1 && h >= 1) {
18910
18910
  c.splice(I - d - h, d + h), I = I - d - h;
18911
- for (var E = this.diff_main(u, B, !1, a), f = E.length - 1; f >= 0; f--)
18912
- c.splice(I, 0, E[f]);
18913
- I = I + E.length;
18911
+ for (var B = this.diff_main(u, E, !1, a), f = B.length - 1; f >= 0; f--)
18912
+ c.splice(I, 0, B[f]);
18913
+ I = I + B.length;
18914
18914
  }
18915
- h = 0, d = 0, u = "", B = "";
18915
+ h = 0, d = 0, u = "", E = "";
18916
18916
  break;
18917
18917
  }
18918
18918
  I++;
18919
18919
  }
18920
18920
  return c.pop(), c;
18921
18921
  }, e.prototype.diff_bisect_ = function(o, s, a) {
18922
- for (var l = o.length, g = s.length, c = Math.ceil((l + g) / 2), I = c, d = 2 * c, h = new Array(d), u = new Array(d), B = 0; B < d; B++)
18923
- h[B] = -1, u[B] = -1;
18922
+ for (var l = o.length, g = s.length, c = Math.ceil((l + g) / 2), I = c, d = 2 * c, h = new Array(d), u = new Array(d), E = 0; E < d; E++)
18923
+ h[E] = -1, u[E] = -1;
18924
18924
  h[I + 1] = 0, u[I + 1] = 0;
18925
- for (var E = l - g, f = E % 2 != 0, Q = 0, p = 0, m = 0, y = 0, w = 0; w < c && !((/* @__PURE__ */ new Date()).getTime() > a); w++) {
18925
+ for (var B = l - g, f = B % 2 != 0, Q = 0, p = 0, m = 0, y = 0, w = 0; w < c && !((/* @__PURE__ */ new Date()).getTime() > a); w++) {
18926
18926
  for (var D = -w + Q; D <= w - p; D += 2) {
18927
18927
  var _ = I + D, k;
18928
18928
  D == -w || D != w && h[_ - 1] < h[_ + 1] ? k = h[_ + 1] : k = h[_ - 1] + 1;
@@ -18933,7 +18933,7 @@ var diffMatchPatch = { exports: {} };
18933
18933
  else if (S > g)
18934
18934
  Q += 2;
18935
18935
  else if (f) {
18936
- var F = I + E - D;
18936
+ var F = I + B - D;
18937
18937
  if (F >= 0 && F < d && u[F] != -1) {
18938
18938
  var N = l - u[F];
18939
18939
  if (k >= N)
@@ -18951,7 +18951,7 @@ var diffMatchPatch = { exports: {} };
18951
18951
  else if (R > g)
18952
18952
  m += 2;
18953
18953
  else if (!f) {
18954
- var _ = I + E - b;
18954
+ var _ = I + B - b;
18955
18955
  if (_ >= 0 && _ < d && h[_] != -1) {
18956
18956
  var k = h[_], S = I + k - _;
18957
18957
  if (N = l - N, k >= N)
@@ -18962,17 +18962,17 @@ var diffMatchPatch = { exports: {} };
18962
18962
  }
18963
18963
  return [new e.Diff(A, o), new e.Diff(n, s)];
18964
18964
  }, e.prototype.diff_bisectSplit_ = function(o, s, a, l, g) {
18965
- var c = o.substring(0, a), I = s.substring(0, l), d = o.substring(a), h = s.substring(l), u = this.diff_main(c, I, !1, g), B = this.diff_main(d, h, !1, g);
18966
- return u.concat(B);
18965
+ var c = o.substring(0, a), I = s.substring(0, l), d = o.substring(a), h = s.substring(l), u = this.diff_main(c, I, !1, g), E = this.diff_main(d, h, !1, g);
18966
+ return u.concat(E);
18967
18967
  }, e.prototype.diff_linesToChars_ = function(o, s) {
18968
18968
  var a = [], l = {};
18969
18969
  a[0] = "";
18970
18970
  function g(h) {
18971
- for (var u = "", B = 0, E = -1, f = a.length; E < h.length - 1; ) {
18972
- E = h.indexOf(`
18973
- `, B), E == -1 && (E = h.length - 1);
18974
- var Q = h.substring(B, E + 1);
18975
- (l.hasOwnProperty ? l.hasOwnProperty(Q) : l[Q] !== void 0) ? u += String.fromCharCode(l[Q]) : (f == c && (Q = h.substring(B), E = h.length), u += String.fromCharCode(f), l[Q] = f, a[f++] = Q), B = E + 1;
18971
+ for (var u = "", E = 0, B = -1, f = a.length; B < h.length - 1; ) {
18972
+ B = h.indexOf(`
18973
+ `, E), B == -1 && (B = h.length - 1);
18974
+ var Q = h.substring(E, B + 1);
18975
+ (l.hasOwnProperty ? l.hasOwnProperty(Q) : l[Q] !== void 0) ? u += String.fromCharCode(l[Q]) : (f == c && (Q = h.substring(E), B = h.length), u += String.fromCharCode(f), l[Q] = f, a[f++] = Q), E = B + 1;
18976
18976
  }
18977
18977
  return u;
18978
18978
  }
@@ -19034,17 +19034,17 @@ var diffMatchPatch = { exports: {} };
19034
19034
  if (!I && !d)
19035
19035
  return null;
19036
19036
  d ? I ? h = I[4].length > d[4].length ? I : d : h = d : h = I;
19037
- var u, B, E, f;
19038
- o.length > s.length ? (u = h[0], B = h[1], E = h[2], f = h[3]) : (E = h[0], f = h[1], u = h[2], B = h[3]);
19037
+ var u, E, B, f;
19038
+ o.length > s.length ? (u = h[0], E = h[1], B = h[2], f = h[3]) : (B = h[0], f = h[1], u = h[2], E = h[3]);
19039
19039
  var Q = h[4];
19040
- return [u, B, E, f, Q];
19040
+ return [u, E, B, f, Q];
19041
19041
  }, e.prototype.diff_cleanupSemantic = function(o) {
19042
19042
  for (var s = !1, a = [], l = 0, g = null, c = 0, I = 0, d = 0, h = 0, u = 0; c < o.length; )
19043
19043
  o[c][0] == r ? (a[l++] = c, I = h, d = u, h = 0, u = 0, g = o[c][1]) : (o[c][0] == n ? h += o[c][1].length : u += o[c][1].length, g && g.length <= Math.max(I, d) && g.length <= Math.max(h, u) && (o.splice(a[l - 1], 0, new e.Diff(A, g)), o[a[l - 1] + 1][0] = n, l--, l--, c = l > 0 ? a[l - 1] : -1, I = 0, d = 0, h = 0, u = 0, g = null, s = !0)), c++;
19044
19044
  for (s && this.diff_cleanupMerge(o), this.diff_cleanupSemanticLossless(o), c = 1; c < o.length; ) {
19045
19045
  if (o[c - 1][0] == A && o[c][0] == n) {
19046
- var B = o[c - 1][1], E = o[c][1], f = this.diff_commonOverlap_(B, E), Q = this.diff_commonOverlap_(E, B);
19047
- f >= Q ? (f >= B.length / 2 || f >= E.length / 2) && (o.splice(c, 0, new e.Diff(r, E.substring(0, f))), o[c - 1][1] = B.substring(0, B.length - f), o[c + 1][1] = E.substring(f), c++) : (Q >= B.length / 2 || Q >= E.length / 2) && (o.splice(c, 0, new e.Diff(r, B.substring(0, Q))), o[c - 1][0] = n, o[c - 1][1] = E.substring(0, E.length - Q), o[c + 1][0] = A, o[c + 1][1] = B.substring(Q), c++), c++;
19046
+ var E = o[c - 1][1], B = o[c][1], f = this.diff_commonOverlap_(E, B), Q = this.diff_commonOverlap_(B, E);
19047
+ f >= Q ? (f >= E.length / 2 || f >= B.length / 2) && (o.splice(c, 0, new e.Diff(r, B.substring(0, f))), o[c - 1][1] = E.substring(0, E.length - f), o[c + 1][1] = B.substring(f), c++) : (Q >= E.length / 2 || Q >= B.length / 2) && (o.splice(c, 0, new e.Diff(r, E.substring(0, Q))), o[c - 1][0] = n, o[c - 1][1] = B.substring(0, B.length - Q), o[c + 1][0] = A, o[c + 1][1] = E.substring(Q), c++), c++;
19048
19048
  }
19049
19049
  c++;
19050
19050
  }
@@ -19062,12 +19062,12 @@ var diffMatchPatch = { exports: {} };
19062
19062
  var d = g.substring(g.length - I);
19063
19063
  l = l.substring(0, l.length - I), g = d + g.substring(0, g.length - I), c = d + c;
19064
19064
  }
19065
- for (var h = l, u = g, B = c, E = s(l, g) + s(g, c); g.charAt(0) === c.charAt(0); ) {
19065
+ for (var h = l, u = g, E = c, B = s(l, g) + s(g, c); g.charAt(0) === c.charAt(0); ) {
19066
19066
  l += g.charAt(0), g = g.substring(1) + c.charAt(0), c = c.substring(1);
19067
19067
  var f = s(l, g) + s(g, c);
19068
- f >= E && (E = f, h = l, u = g, B = c);
19068
+ f >= B && (B = f, h = l, u = g, E = c);
19069
19069
  }
19070
- o[a - 1][1] != h && (h ? o[a - 1][1] = h : (o.splice(a - 1, 1), a--), o[a][1] = u, B ? o[a + 1][1] = B : (o.splice(a + 1, 1), a--));
19070
+ o[a - 1][1] != h && (h ? o[a - 1][1] = h : (o.splice(a - 1, 1), a--), o[a][1] = u, E ? o[a + 1][1] = E : (o.splice(a + 1, 1), a--));
19071
19071
  }
19072
19072
  a++;
19073
19073
  }
@@ -19197,11 +19197,11 @@ var diffMatchPatch = { exports: {} };
19197
19197
  d != -1 && (I = Math.min(c(0, d), I), d = o.lastIndexOf(s, a + s.length), d != -1 && (I = Math.min(c(0, d), I)));
19198
19198
  var h = 1 << s.length - 1;
19199
19199
  d = -1;
19200
- for (var u, B, E = s.length + o.length, f, Q = 0; Q < s.length; Q++) {
19201
- for (u = 0, B = E; u < B; )
19202
- c(Q, a + B) <= I ? u = B : E = B, B = Math.floor((E - u) / 2 + u);
19203
- E = B;
19204
- var p = Math.max(1, a - B + 1), m = Math.min(a + B, o.length) + s.length, y = Array(m + 2);
19200
+ for (var u, E, B = s.length + o.length, f, Q = 0; Q < s.length; Q++) {
19201
+ for (u = 0, E = B; u < E; )
19202
+ c(Q, a + E) <= I ? u = E : B = E, E = Math.floor((B - u) / 2 + u);
19203
+ B = E;
19204
+ var p = Math.max(1, a - E + 1), m = Math.min(a + E, o.length) + s.length, y = Array(m + 2);
19205
19205
  y[m + 1] = (1 << Q) - 1;
19206
19206
  for (var w = m; w >= p; w--) {
19207
19207
  var D = l[o.charAt(w - 1)];
@@ -19262,22 +19262,22 @@ var diffMatchPatch = { exports: {} };
19262
19262
  throw new Error("Unknown call format to patch_make.");
19263
19263
  if (g.length === 0)
19264
19264
  return [];
19265
- for (var c = [], I = new e.patch_obj(), d = 0, h = 0, u = 0, B = l, E = l, f = 0; f < g.length; f++) {
19265
+ for (var c = [], I = new e.patch_obj(), d = 0, h = 0, u = 0, E = l, B = l, f = 0; f < g.length; f++) {
19266
19266
  var Q = g[f][0], p = g[f][1];
19267
19267
  switch (!d && Q !== r && (I.start1 = h, I.start2 = u), Q) {
19268
19268
  case n:
19269
- I.diffs[d++] = g[f], I.length2 += p.length, E = E.substring(0, u) + p + E.substring(u);
19269
+ I.diffs[d++] = g[f], I.length2 += p.length, B = B.substring(0, u) + p + B.substring(u);
19270
19270
  break;
19271
19271
  case A:
19272
- I.length1 += p.length, I.diffs[d++] = g[f], E = E.substring(0, u) + E.substring(u + p.length);
19272
+ I.length1 += p.length, I.diffs[d++] = g[f], B = B.substring(0, u) + B.substring(u + p.length);
19273
19273
  break;
19274
19274
  case r:
19275
- p.length <= 2 * this.Patch_Margin && d && g.length != f + 1 ? (I.diffs[d++] = g[f], I.length1 += p.length, I.length2 += p.length) : p.length >= 2 * this.Patch_Margin && d && (this.patch_addContext_(I, B), c.push(I), I = new e.patch_obj(), d = 0, B = E, h = u);
19275
+ p.length <= 2 * this.Patch_Margin && d && g.length != f + 1 ? (I.diffs[d++] = g[f], I.length1 += p.length, I.length2 += p.length) : p.length >= 2 * this.Patch_Margin && d && (this.patch_addContext_(I, E), c.push(I), I = new e.patch_obj(), d = 0, E = B, h = u);
19276
19276
  break;
19277
19277
  }
19278
19278
  Q !== n && (h += p.length), Q !== A && (u += p.length);
19279
19279
  }
19280
- return d && (this.patch_addContext_(I, B), c.push(I)), c;
19280
+ return d && (this.patch_addContext_(I, E), c.push(I)), c;
19281
19281
  }, e.prototype.patch_deepCopy = function(o) {
19282
19282
  for (var s = [], a = 0; a < o.length; a++) {
19283
19283
  var l = o[a], g = new e.patch_obj();
@@ -19299,18 +19299,18 @@ var diffMatchPatch = { exports: {} };
19299
19299
  g[c] = !1, l -= o[c].length2 - o[c].length1;
19300
19300
  else {
19301
19301
  g[c] = !0, l = h - I;
19302
- var B;
19303
- if (u == -1 ? B = s.substring(h, h + d.length) : B = s.substring(h, u + this.Match_MaxBits), d == B)
19302
+ var E;
19303
+ if (u == -1 ? E = s.substring(h, h + d.length) : E = s.substring(h, u + this.Match_MaxBits), d == E)
19304
19304
  s = s.substring(0, h) + this.diff_text2(o[c].diffs) + s.substring(h + d.length);
19305
19305
  else {
19306
- var E = this.diff_main(d, B, !1);
19307
- if (d.length > this.Match_MaxBits && this.diff_levenshtein(E) / d.length > this.Patch_DeleteThreshold)
19306
+ var B = this.diff_main(d, E, !1);
19307
+ if (d.length > this.Match_MaxBits && this.diff_levenshtein(B) / d.length > this.Patch_DeleteThreshold)
19308
19308
  g[c] = !1;
19309
19309
  else {
19310
- this.diff_cleanupSemanticLossless(E);
19310
+ this.diff_cleanupSemanticLossless(B);
19311
19311
  for (var f = 0, Q, p = 0; p < o[c].diffs.length; p++) {
19312
19312
  var m = o[c].diffs[p];
19313
- m[0] !== r && (Q = this.diff_xIndex(E, f)), m[0] === n ? s = s.substring(0, h + Q) + m[1] + s.substring(h + Q) : m[0] === A && (s = s.substring(0, h + Q) + s.substring(h + this.diff_xIndex(E, f + m[1].length))), m[0] !== A && (f += m[1].length);
19313
+ m[0] !== r && (Q = this.diff_xIndex(B, f)), m[0] === n ? s = s.substring(0, h + Q) + m[1] + s.substring(h + Q) : m[0] === A && (s = s.substring(0, h + Q) + s.substring(h + this.diff_xIndex(B, f + m[1].length))), m[0] !== A && (f += m[1].length);
19314
19314
  }
19315
19315
  }
19316
19316
  }
@@ -19344,12 +19344,12 @@ var diffMatchPatch = { exports: {} };
19344
19344
  for (var g = l.start1, c = l.start2, I = ""; l.diffs.length !== 0; ) {
19345
19345
  var d = new e.patch_obj(), h = !0;
19346
19346
  for (d.start1 = g - I.length, d.start2 = c - I.length, I !== "" && (d.length1 = d.length2 = I.length, d.diffs.push(new e.Diff(r, I))); l.diffs.length !== 0 && d.length1 < s - this.Patch_Margin; ) {
19347
- var u = l.diffs[0][0], B = l.diffs[0][1];
19348
- u === n ? (d.length2 += B.length, c += B.length, d.diffs.push(l.diffs.shift()), h = !1) : u === A && d.diffs.length == 1 && d.diffs[0][0] == r && B.length > 2 * s ? (d.length1 += B.length, g += B.length, h = !1, d.diffs.push(new e.Diff(u, B)), l.diffs.shift()) : (B = B.substring(0, s - d.length1 - this.Patch_Margin), d.length1 += B.length, g += B.length, u === r ? (d.length2 += B.length, c += B.length) : h = !1, d.diffs.push(new e.Diff(u, B)), B == l.diffs[0][1] ? l.diffs.shift() : l.diffs[0][1] = l.diffs[0][1].substring(B.length));
19347
+ var u = l.diffs[0][0], E = l.diffs[0][1];
19348
+ u === n ? (d.length2 += E.length, c += E.length, d.diffs.push(l.diffs.shift()), h = !1) : u === A && d.diffs.length == 1 && d.diffs[0][0] == r && E.length > 2 * s ? (d.length1 += E.length, g += E.length, h = !1, d.diffs.push(new e.Diff(u, E)), l.diffs.shift()) : (E = E.substring(0, s - d.length1 - this.Patch_Margin), d.length1 += E.length, g += E.length, u === r ? (d.length2 += E.length, c += E.length) : h = !1, d.diffs.push(new e.Diff(u, E)), E == l.diffs[0][1] ? l.diffs.shift() : l.diffs[0][1] = l.diffs[0][1].substring(E.length));
19349
19349
  }
19350
19350
  I = this.diff_text2(d.diffs), I = I.substring(I.length - this.Patch_Margin);
19351
- var E = this.diff_text1(l.diffs).substring(0, this.Patch_Margin);
19352
- E !== "" && (d.length1 += E.length, d.length2 += E.length, d.diffs.length !== 0 && d.diffs[d.diffs.length - 1][0] === r ? d.diffs[d.diffs.length - 1][1] += E : d.diffs.push(new e.Diff(r, E))), h || o.splice(++a, 0, d);
19351
+ var B = this.diff_text1(l.diffs).substring(0, this.Patch_Margin);
19352
+ B !== "" && (d.length1 += B.length, d.length2 += B.length, d.diffs.length !== 0 && d.diffs[d.diffs.length - 1][0] === r ? d.diffs[d.diffs.length - 1][1] += B : d.diffs.push(new e.Diff(r, B))), h || o.splice(++a, 0, d);
19353
19353
  }
19354
19354
  }
19355
19355
  }, e.prototype.patch_toText = function(o) {
@@ -19907,30 +19907,30 @@ var diffFilter$1 = function t(e) {
19907
19907
  return;
19908
19908
  }
19909
19909
  delete A.hashCache1, delete A.hashCache2;
19910
- var u = l.slice(n, c - r), B = g.slice(n, I - r), E = lcs.get(u, B, matchItems, A), f = [];
19910
+ var u = l.slice(n, c - r), E = g.slice(n, I - r), B = lcs.get(u, E, matchItems, A), f = [];
19911
19911
  for (h = h || {
19912
19912
  _t: "a"
19913
19913
  }, o = n; o < c - r; o++)
19914
- arrayIndexOf(E.indices1, o - n) < 0 && (h["_" + o] = [l[o], 0, 0], f.push(o));
19914
+ arrayIndexOf(B.indices1, o - n) < 0 && (h["_" + o] = [l[o], 0, 0], f.push(o));
19915
19915
  var Q = !0;
19916
19916
  e.options && e.options.arrays && e.options.arrays.detectMove === !1 && (Q = !1);
19917
19917
  var p = !1;
19918
19918
  e.options && e.options.arrays && e.options.arrays.includeValueOnMove && (p = !0);
19919
19919
  var m = f.length;
19920
19920
  for (o = n; o < I - r; o++) {
19921
- var y = arrayIndexOf(E.indices2, o - n);
19921
+ var y = arrayIndexOf(B.indices2, o - n);
19922
19922
  if (y < 0) {
19923
19923
  var w = !1;
19924
19924
  if (Q && m > 0) {
19925
19925
  for (var D = 0; D < m; D++)
19926
- if (s = f[D], matchItems(u, B, s - n, o - n, A)) {
19926
+ if (s = f[D], matchItems(u, E, s - n, o - n, A)) {
19927
19927
  h["_" + s].splice(1, 2, o, ARRAY_MOVE), p || (h["_" + s][0] = ""), a = o, d = new DiffContext(e.left[s], e.right[a]), e.push(d, a), f.splice(D, 1), w = !0;
19928
19928
  break;
19929
19929
  }
19930
19930
  }
19931
19931
  w || (h[o] = [g[o]]);
19932
19932
  } else
19933
- s = E.indices1[y] + n, a = E.indices2[y] + n, d = new DiffContext(e.left[s], e.right[a]), e.push(d, a);
19933
+ s = B.indices1[y] + n, a = B.indices2[y] + n, d = new DiffContext(e.left[s], e.right[a]), e.push(d, a);
19934
19934
  }
19935
19935
  e.setResult(h).exit();
19936
19936
  }
@@ -19980,8 +19980,8 @@ var compare = {
19980
19980
  var h = l.length, u = void 0;
19981
19981
  if (h > 0)
19982
19982
  for (A = 0; A < h; A++) {
19983
- var B = l[A];
19984
- u = new PatchContext(e.left[B.index], B.delta), e.push(u, B.index);
19983
+ var E = l[A];
19984
+ u = new PatchContext(e.left[E.index], E.delta), e.push(u, E.index);
19985
19985
  }
19986
19986
  if (!e.children) {
19987
19987
  e.setResult(e.left).exit();
@@ -20435,14 +20435,14 @@ var adjustArrows = function t(e) {
20435
20435
  r(A, ".jsondiffpatch-arrow", function(s) {
20436
20436
  var a = s.parentNode, l = s.children, g = s.style, c = a, I = l[0], d = I.children[1];
20437
20437
  I.style.display = "none";
20438
- var h = n(c.querySelector(".jsondiffpatch-moved-destination")), u = c.parentNode, B = void 0;
20438
+ var h = n(c.querySelector(".jsondiffpatch-moved-destination")), u = c.parentNode, E = void 0;
20439
20439
  if (o(u, function(Q) {
20440
- Q.getAttribute("data-key") === h && (B = Q);
20441
- }), !!B)
20440
+ Q.getAttribute("data-key") === h && (E = Q);
20441
+ }), !!E)
20442
20442
  try {
20443
- var E = B.offsetTop - c.offsetTop;
20444
- I.setAttribute("height", Math.abs(E) + 6), g.top = -8 + (E > 0 ? 0 : E) + "px";
20445
- var f = E > 0 ? "M30,0 Q-10," + Math.round(E / 2) + " 26," + (E - 4) : "M30," + -E + " Q-10," + Math.round(-E / 2) + " 26,4";
20443
+ var B = E.offsetTop - c.offsetTop;
20444
+ I.setAttribute("height", Math.abs(B) + 6), g.top = -8 + (B > 0 ? 0 : B) + "px";
20445
+ var f = B > 0 ? "M30,0 Q-10," + Math.round(B / 2) + " 26," + (B - 4) : "M30," + -B + " Q-10," + Math.round(-B / 2) + " 26,4";
20446
20446
  d.setAttribute("d", f), I.style.display = "";
20447
20447
  } catch {
20448
20448
  }
@@ -20987,11 +20987,11 @@ function recurseObjectProperties(t, e, A, n, r, o, s, a, l, g, c) {
20987
20987
  return null;
20988
20988
  const d = createNode(t, e, A, n, o), h = a.get(d.id);
20989
20989
  if (r ? d.collapsed = !1 : h && !g ? d.collapsed = h.collapsed : c.shouldExpandNode && (d.collapsed = !c.shouldExpandNode(d)), s.set(d.id, d), shouldRecurseChildren(d, o, l, c)) {
20990
- const u = c.mapChildren && c.mapChildren(A, getValueType(A), d), B = u ?? getChildren(A, getValueType(A));
20991
- d.children = B.map((E, f) => {
20992
- let [Q, p] = E;
20990
+ const u = c.mapChildren && c.mapChildren(A, getValueType(A), d), E = u ?? getChildren(A, getValueType(A));
20991
+ d.children = E.map((B, f) => {
20992
+ let [Q, p] = B;
20993
20993
  return recurseObjectProperties(f, Q, p, n + 1, !1, d, s, a, l, g, c);
20994
- }).filter((E) => E !== null);
20994
+ }).filter((B) => B !== null);
20995
20995
  }
20996
20996
  return d;
20997
20997
  }
@@ -21369,7 +21369,7 @@ function create_fragment$h(t) {
21369
21369
  let e, A, n, r = (
21370
21370
  /*node*/
21371
21371
  t[0].key + ""
21372
- ), o, s, a, l, g, c, I, d, h, u, B, E, f, Q, p, m, y = (
21372
+ ), o, s, a, l, g, c, I, d, h, u, E, B, f, Q, p, m, y = (
21373
21373
  /*hasChildren*/
21374
21374
  t[2] && create_if_block_4$3(t)
21375
21375
  );
@@ -21392,7 +21392,7 @@ function create_fragment$h(t) {
21392
21392
  t[2] && create_if_block$9(t);
21393
21393
  return {
21394
21394
  c() {
21395
- e = element("li"), y && y.c(), A = space(), n = element("div"), o = text(r), s = text(":"), a = space(), l = element("div"), c.c(), d = space(), h = element("div"), k && k.c(), u = space(), S && S.c(), E = space(), F && F.c(), f = empty(), attr(n, "class", "node-key svelte-ngcjq5"), attr(n, "role", "presentation"), toggle_class(
21395
+ e = element("li"), y && y.c(), A = space(), n = element("div"), o = text(r), s = text(":"), a = space(), l = element("div"), c.c(), d = space(), h = element("div"), k && k.c(), u = space(), S && S.c(), B = space(), F && F.c(), f = empty(), attr(n, "class", "node-key svelte-ngcjq5"), attr(n, "role", "presentation"), toggle_class(
21396
21396
  n,
21397
21397
  "has-children",
21398
21398
  /*hasChildren*/
@@ -21406,7 +21406,7 @@ function create_fragment$h(t) {
21406
21406
  "has-children",
21407
21407
  /*hasChildren*/
21408
21408
  t[2]
21409
- ), attr(h, "class", "buttons svelte-ngcjq5"), attr(e, "class", "row svelte-ngcjq5"), attr(e, "data-tree-id", B = /*node*/
21409
+ ), attr(h, "class", "buttons svelte-ngcjq5"), attr(e, "class", "row svelte-ngcjq5"), attr(e, "data-tree-id", E = /*node*/
21410
21410
  t[0].id), toggle_class(
21411
21411
  e,
21412
21412
  "collapsed",
@@ -21416,7 +21416,7 @@ function create_fragment$h(t) {
21416
21416
  );
21417
21417
  },
21418
21418
  m(N, b) {
21419
- insert(N, e, b), y && y.m(e, null), append(e, A), append(e, n), append(n, o), append(n, s), append(e, a), append(e, l), D[g].m(l, null), append(e, d), append(e, h), k && k.m(h, null), append(h, u), S && S.m(h, null), insert(N, E, b), F && F.m(N, b), insert(N, f, b), Q = !0, p || (m = [listen(
21419
+ insert(N, e, b), y && y.m(e, null), append(e, A), append(e, n), append(n, o), append(n, s), append(e, a), append(e, l), D[g].m(l, null), append(e, d), append(e, h), k && k.m(h, null), append(h, u), S && S.m(h, null), insert(N, B, b), F && F.m(N, b), insert(N, f, b), Q = !0, p || (m = [listen(
21420
21420
  n,
21421
21421
  "click",
21422
21422
  /*handleToggleCollapse*/
@@ -21459,8 +21459,8 @@ function create_fragment$h(t) {
21459
21459
  ), /*$props*/
21460
21460
  N[1].showLogButton ? k ? k.p(N, R) : (k = create_if_block_2$5(N), k.c(), k.m(h, u)) : k && (k.d(1), k = null), /*$props*/
21461
21461
  N[1].showCopyButton ? S ? S.p(N, R) : (S = create_if_block_1$6(N), S.c(), S.m(h, null)) : S && (S.d(1), S = null), (!Q || R & /*node*/
21462
- 1 && B !== (B = /*node*/
21463
- N[0].id)) && attr(e, "data-tree-id", B), (!Q || R & /*node, hasChildren*/
21462
+ 1 && E !== (E = /*node*/
21463
+ N[0].id)) && attr(e, "data-tree-id", E), (!Q || R & /*node, hasChildren*/
21464
21464
  5) && toggle_class(
21465
21465
  e,
21466
21466
  "collapsed",
@@ -21481,7 +21481,7 @@ function create_fragment$h(t) {
21481
21481
  transition_out(c), transition_out(F), Q = !1;
21482
21482
  },
21483
21483
  d(N) {
21484
- N && (detach(e), detach(E), detach(f)), y && y.d(), D[g].d(), k && k.d(), S && S.d(), F && F.d(N), p = !1, run_all(m);
21484
+ N && (detach(e), detach(B), detach(f)), y && y.d(), D[g].d(), k && k.d(), S && S.d(), F && F.d(N), p = !1, run_all(m);
21485
21485
  }
21486
21486
  };
21487
21487
  }
@@ -21502,7 +21502,7 @@ function instance$h(t, e, A) {
21502
21502
  const m = p.get(c);
21503
21503
  m && u !== m && A(0, u = m);
21504
21504
  });
21505
- function B() {
21505
+ function E() {
21506
21506
  console.info("%c [svelte-tree-view]: Property added to window._node", "color: #b8e248"), console.log(u.value);
21507
21507
  try {
21508
21508
  typeof window < "u" && (window._node = u.value);
@@ -21510,7 +21510,7 @@ function instance$h(t, e, A) {
21510
21510
  console.error("Failed to set _node, window was undefined");
21511
21511
  }
21512
21512
  }
21513
- function E() {
21513
+ function B() {
21514
21514
  try {
21515
21515
  navigator.clipboard.writeText(JSON.stringify(u.value));
21516
21516
  } catch (p) {
@@ -21537,7 +21537,7 @@ function instance$h(t, e, A) {
21537
21537
  t.$$.dirty & /*node*/
21538
21538
  1 && A(2, n = u && u.children.length > 0), t.$$.dirty & /*$props*/
21539
21539
  2 && A(3, o = a.valueComponent);
21540
- }, g(A(4, r = d.props)), [u, a, n, o, r, d, h, B, E, f, Q, c];
21540
+ }, g(A(4, r = d.props)), [u, a, n, o, r, d, h, E, B, f, Q, c];
21541
21541
  }
21542
21542
  class TreeViewNode extends SvelteComponent {
21543
21543
  constructor(e) {
@@ -21667,8 +21667,8 @@ function instance$g(t, e, A) {
21667
21667
  valueComponent: d = void 0,
21668
21668
  recursionOpts: h = {},
21669
21669
  valueFormatter: u = void 0
21670
- } = e, B = null;
21671
- const E = {
21670
+ } = e, E = null;
21671
+ const B = {
21672
21672
  maxDepth: 16,
21673
21673
  omitKeys: [],
21674
21674
  stopCircularRecursion: !1,
@@ -21679,7 +21679,7 @@ function instance$g(t, e, A) {
21679
21679
  showCopyButton: I,
21680
21680
  valueComponent: d,
21681
21681
  recursionOpts: {
21682
- ...E,
21682
+ ...B,
21683
21683
  ...h
21684
21684
  },
21685
21685
  valueFormatter: u
@@ -21690,11 +21690,11 @@ function instance$g(t, e, A) {
21690
21690
  rootElementStore: p,
21691
21691
  treeStore: m
21692
21692
  }), onMount(() => {
21693
- p.set(B);
21693
+ p.set(E);
21694
21694
  });
21695
21695
  function y(w) {
21696
21696
  binding_callbacks[w ? "unshift" : "push"](() => {
21697
- B = w, A(0, B);
21697
+ E = w, A(0, E);
21698
21698
  });
21699
21699
  }
21700
21700
  return t.$$set = (w) => {
@@ -21710,7 +21710,7 @@ function instance$g(t, e, A) {
21710
21710
  }), t.$$.dirty & /*recursionOpts, props, _a, data*/
21711
21711
  6672) {
21712
21712
  const w = {
21713
- ...E,
21713
+ ...B,
21714
21714
  ...h
21715
21715
  }, D = (A(11, a = f?.recursionOpts) === null || a === void 0 ? void 0 : a.shouldExpandNode) !== w.shouldExpandNode, _ = get_store_value(m.treeMap), {
21716
21716
  treeMap: k,
@@ -21720,14 +21720,14 @@ function instance$g(t, e, A) {
21720
21720
  m.init(S, k, F), A(12, f.recursionOpts = w, f), Q.setProps(f);
21721
21721
  }
21722
21722
  if (t.$$.dirty & /*theme, rootElement*/
21723
- 33 && g && B) {
21723
+ 33 && g && E) {
21724
21724
  let w;
21725
21725
  for (w in g) {
21726
21726
  const D = g[w];
21727
- B && w.includes("base") && D && B.style.setProperty("--tree-view-".concat(w), D);
21727
+ E && w.includes("base") && D && E.style.setProperty("--tree-view-".concat(w), D);
21728
21728
  }
21729
21729
  }
21730
- }, s(A(1, n = m.tree)), e = exclude_internal_props(e), [B, n, r, e, l, g, c, I, d, h, u, a, f, y];
21730
+ }, s(A(1, n = m.tree)), e = exclude_internal_props(e), [E, n, r, e, l, g, c, I, d, h, u, a, f, y];
21731
21731
  }
21732
21732
  class TreeView extends SvelteComponent {
21733
21733
  constructor(e) {
@@ -22127,7 +22127,7 @@ function create_if_block$8(t) {
22127
22127
  };
22128
22128
  }
22129
22129
  function create_right_slot$5(t) {
22130
- let e, A, n, r, o, s, a, l, g, c, I, d, h, u, B, E, f, Q, p;
22130
+ let e, A, n, r, o, s, a, l, g, c, I, d, h, u, E, B, f, Q, p;
22131
22131
  o = new Button({
22132
22132
  props: {
22133
22133
  class: "selection-btn",
@@ -22174,10 +22174,10 @@ function create_right_slot$5(t) {
22174
22174
  }
22175
22175
  }), {
22176
22176
  c() {
22177
- e = element("div"), A = element("div"), n = element("h2"), n.textContent = "Selection", r = space(), create_component(o.$$.fragment), s = space(), create_component(a.$$.fragment), l = space(), g = element("div"), c = element("h2"), c.textContent = "Active marks", I = space(), h.c(), u = space(), B = element("div"), E = element("h2"), E.textContent = "Document stats", f = space(), create_component(Q.$$.fragment), attr(A, "class", "top-row svelte-8c7oqn"), attr(e, "slot", "right"), attr(e, "class", "right-panel svelte-8c7oqn");
22177
+ e = element("div"), A = element("div"), n = element("h2"), n.textContent = "Selection", r = space(), create_component(o.$$.fragment), s = space(), create_component(a.$$.fragment), l = space(), g = element("div"), c = element("h2"), c.textContent = "Active marks", I = space(), h.c(), u = space(), E = element("div"), B = element("h2"), B.textContent = "Document stats", f = space(), create_component(Q.$$.fragment), attr(A, "class", "top-row svelte-8c7oqn"), attr(e, "slot", "right"), attr(e, "class", "right-panel svelte-8c7oqn");
22178
22178
  },
22179
22179
  m(D, _) {
22180
- insert(D, e, _), append(e, A), append(A, n), append(A, r), mount_component(o, A, null), append(e, s), mount_component(a, e, null), append(e, l), append(e, g), append(g, c), append(g, I), y[d].m(g, null), append(e, u), append(e, B), append(B, E), append(B, f), mount_component(Q, B, null), p = !0;
22180
+ insert(D, e, _), append(e, A), append(A, n), append(A, r), mount_component(o, A, null), append(e, s), mount_component(a, e, null), append(e, l), append(e, g), append(g, c), append(g, I), y[d].m(g, null), append(e, u), append(e, E), append(E, B), append(E, f), mount_component(Q, E, null), p = !0;
22181
22181
  },
22182
22182
  p(D, _) {
22183
22183
  const k = {};
@@ -22487,10 +22487,10 @@ function create_each_block$5(t, e) {
22487
22487
  let n, r, o, s = (
22488
22488
  /*group*/
22489
22489
  ((A = e[6]) === null || A === void 0 || (A = A.topEntry) === null || A === void 0 ? void 0 : A.timeStr) + ""
22490
- ), a, l, g, c, I, d, h, u, B = (
22490
+ ), a, l, g, c, I, d, h, u, E = (
22491
22491
  /*group*/
22492
22492
  e[6].isGroup && create_if_block_3$3(e)
22493
- ), E = (
22493
+ ), B = (
22494
22494
  /*group*/
22495
22495
  e[6].topEntry && /*group*/
22496
22496
  e[6].topEntry.trs.length > 1 && create_if_block_2$4(e)
@@ -22529,7 +22529,7 @@ function create_each_block$5(t, e) {
22529
22529
  first: null,
22530
22530
  c() {
22531
22531
  var y;
22532
- n = element("li"), r = element("button"), o = element("span"), a = text(s), l = space(), B && B.c(), g = space(), E && E.c(), c = space(), f && f.c(), I = space(), m && m.c(), d = empty(), attr(r, "class", "svelte-vbjxb8"), toggle_class(
22532
+ n = element("li"), r = element("button"), o = element("span"), a = text(s), l = space(), E && E.c(), g = space(), B && B.c(), c = space(), f && f.c(), I = space(), m && m.c(), d = empty(), attr(r, "class", "svelte-vbjxb8"), toggle_class(
22533
22533
  r,
22534
22534
  "is-group",
22535
22535
  /*group*/
@@ -22540,16 +22540,16 @@ function create_each_block$5(t, e) {
22540
22540
  ((y = e[6]) === null || y === void 0 || (y = y.topEntry) === null || y === void 0 ? void 0 : y.id)), this.first = n;
22541
22541
  },
22542
22542
  m(y, w) {
22543
- insert(y, n, w), append(n, r), append(r, o), append(o, a), append(o, l), B && B.m(o, null), append(o, g), E && E.m(o, null), append(r, c), f && f.m(r, null), insert(y, I, w), m && m.m(y, w), insert(y, d, w), h || (u = [listen(r, "click", Q), listen(r, "dblclick", p)], h = !0);
22543
+ insert(y, n, w), append(n, r), append(r, o), append(o, a), append(o, l), E && E.m(o, null), append(o, g), B && B.m(o, null), append(r, c), f && f.m(r, null), insert(y, I, w), m && m.m(y, w), insert(y, d, w), h || (u = [listen(r, "click", Q), listen(r, "dblclick", p)], h = !0);
22544
22544
  },
22545
22545
  p(y, w) {
22546
22546
  var D;
22547
22547
  if (e = y, w & /*listItems*/
22548
22548
  1 && s !== (s = /*group*/
22549
22549
  ((D = e[6]) === null || D === void 0 || (D = D.topEntry) === null || D === void 0 ? void 0 : D.timeStr) + "") && set_data(a, s), /*group*/
22550
- e[6].isGroup ? B ? B.p(e, w) : (B = create_if_block_3$3(e), B.c(), B.m(o, g)) : B && (B.d(1), B = null), /*group*/
22550
+ e[6].isGroup ? E ? E.p(e, w) : (E = create_if_block_3$3(e), E.c(), E.m(o, g)) : E && (E.d(1), E = null), /*group*/
22551
22551
  e[6].topEntry && /*group*/
22552
- e[6].topEntry.trs.length > 1 ? E ? E.p(e, w) : (E = create_if_block_2$4(e), E.c(), E.m(o, null)) : E && (E.d(1), E = null), /*group*/
22552
+ e[6].topEntry.trs.length > 1 ? B ? B.p(e, w) : (B = create_if_block_2$4(e), B.c(), B.m(o, null)) : B && (B.d(1), B = null), /*group*/
22553
22553
  e[6].isGroup && /*group*/
22554
22554
  e[6].entries.length > 1 ? f ? f.p(e, w) : (f = create_if_block_1$5(e), f.c(), f.m(r, null)) : f && (f.d(1), f = null), w & /*listItems*/
22555
22555
  1 && toggle_class(
@@ -22570,7 +22570,7 @@ function create_each_block$5(t, e) {
22570
22570
  e[6].expanded ? m ? m.p(e, w) : (m = create_if_block$7(e), m.c(), m.m(d.parentNode, d)) : m && (m.d(1), m = null);
22571
22571
  },
22572
22572
  d(y) {
22573
- y && (detach(n), detach(I), detach(d)), B && B.d(), E && E.d(), f && f.d(), m && m.d(y), h = !1, run_all(u);
22573
+ y && (detach(n), detach(I), detach(d)), E && E.d(), B && B.d(), f && f.d(), m && m.d(y), h = !1, run_all(u);
22574
22574
  }
22575
22575
  };
22576
22576
  }
@@ -23079,10 +23079,10 @@ function create_if_block$5(t) {
23079
23079
  let e, A, n, r, o, s, a, l, g, c, I, d, h, u = (
23080
23080
  /*selectedEntry*/
23081
23081
  t[0].contentDiff && create_if_block_5$1(t)
23082
- ), B = (
23082
+ ), E = (
23083
23083
  /*selectedEntry*/
23084
23084
  t[0].selectionDiff && create_if_block_4$1(t)
23085
- ), E = (
23085
+ ), B = (
23086
23086
  /*selectedEntry*/
23087
23087
  t[0].selectionHtml.length > 0 && create_if_block_3$1(t)
23088
23088
  ), f = (
@@ -23109,10 +23109,10 @@ function create_if_block$5(t) {
23109
23109
  );
23110
23110
  return {
23111
23111
  c() {
23112
- e = element("div"), u && u.c(), A = space(), B && B.c(), n = space(), E && E.c(), r = space(), o = element("div"), s = element("div"), a = element("h2"), a.textContent = "Transactions", l = space(), g = element("div"), f && f.c(), c = space(), create_component(I.$$.fragment), d = space(), Q && Q.c(), attr(g, "class", "transaction-buttons svelte-r7zw98"), attr(s, "class", "title-container svelte-r7zw98"), attr(o, "class", "entry-row svelte-r7zw98");
23112
+ e = element("div"), u && u.c(), A = space(), E && E.c(), n = space(), B && B.c(), r = space(), o = element("div"), s = element("div"), a = element("h2"), a.textContent = "Transactions", l = space(), g = element("div"), f && f.c(), c = space(), create_component(I.$$.fragment), d = space(), Q && Q.c(), attr(g, "class", "transaction-buttons svelte-r7zw98"), attr(s, "class", "title-container svelte-r7zw98"), attr(o, "class", "entry-row svelte-r7zw98");
23113
23113
  },
23114
23114
  m(p, m) {
23115
- insert(p, e, m), u && u.m(e, null), append(e, A), B && B.m(e, null), append(e, n), E && E.m(e, null), append(e, r), append(e, o), append(o, s), append(s, a), append(s, l), append(s, g), f && f.m(g, null), append(g, c), mount_component(I, g, null), append(o, d), Q && Q.m(o, null), h = !0;
23115
+ insert(p, e, m), u && u.m(e, null), append(e, A), E && E.m(e, null), append(e, n), B && B.m(e, null), append(e, r), append(e, o), append(o, s), append(s, a), append(s, l), append(s, g), f && f.m(g, null), append(g, c), mount_component(I, g, null), append(o, d), Q && Q.m(o, null), h = !0;
23116
23116
  },
23117
23117
  p(p, m) {
23118
23118
  /*selectedEntry*/
@@ -23120,13 +23120,13 @@ function create_if_block$5(t) {
23120
23120
  1 && transition_in(u, 1)) : (u = create_if_block_5$1(p), u.c(), transition_in(u, 1), u.m(e, A)) : u && (group_outros(), transition_out(u, 1, 1, () => {
23121
23121
  u = null;
23122
23122
  }), check_outros()), /*selectedEntry*/
23123
- p[0].selectionDiff ? B ? (B.p(p, m), m & /*selectedEntry*/
23124
- 1 && transition_in(B, 1)) : (B = create_if_block_4$1(p), B.c(), transition_in(B, 1), B.m(e, n)) : B && (group_outros(), transition_out(B, 1, 1, () => {
23125
- B = null;
23126
- }), check_outros()), /*selectedEntry*/
23127
- p[0].selectionHtml.length > 0 ? E ? (E.p(p, m), m & /*selectedEntry*/
23128
- 1 && transition_in(E, 1)) : (E = create_if_block_3$1(p), E.c(), transition_in(E, 1), E.m(e, r)) : E && (group_outros(), transition_out(E, 1, 1, () => {
23123
+ p[0].selectionDiff ? E ? (E.p(p, m), m & /*selectedEntry*/
23124
+ 1 && transition_in(E, 1)) : (E = create_if_block_4$1(p), E.c(), transition_in(E, 1), E.m(e, n)) : E && (group_outros(), transition_out(E, 1, 1, () => {
23129
23125
  E = null;
23126
+ }), check_outros()), /*selectedEntry*/
23127
+ p[0].selectionHtml.length > 0 ? B ? (B.p(p, m), m & /*selectedEntry*/
23128
+ 1 && transition_in(B, 1)) : (B = create_if_block_3$1(p), B.c(), transition_in(B, 1), B.m(e, r)) : B && (group_outros(), transition_out(B, 1, 1, () => {
23129
+ B = null;
23130
23130
  }), check_outros()), /*showTr*/
23131
23131
  p[1] ? f ? (f.p(p, m), m & /*showTr*/
23132
23132
  2 && transition_in(f, 1)) : (f = create_if_block_2$2(p), f.c(), transition_in(f, 1), f.m(g, c)) : f && (group_outros(), transition_out(f, 1, 1, () => {
@@ -23144,13 +23144,13 @@ function create_if_block$5(t) {
23144
23144
  }), check_outros());
23145
23145
  },
23146
23146
  i(p) {
23147
- h || (transition_in(u), transition_in(B), transition_in(E), transition_in(f), transition_in(I.$$.fragment, p), transition_in(Q), h = !0);
23147
+ h || (transition_in(u), transition_in(E), transition_in(B), transition_in(f), transition_in(I.$$.fragment, p), transition_in(Q), h = !0);
23148
23148
  },
23149
23149
  o(p) {
23150
- transition_out(u), transition_out(B), transition_out(E), transition_out(f), transition_out(I.$$.fragment, p), transition_out(Q), h = !1;
23150
+ transition_out(u), transition_out(E), transition_out(B), transition_out(f), transition_out(I.$$.fragment, p), transition_out(Q), h = !1;
23151
23151
  },
23152
23152
  d(p) {
23153
- p && detach(e), u && u.d(), B && B.d(), E && E.d(), f && f.d(), destroy_component(I), Q && Q.d();
23153
+ p && detach(e), u && u.d(), E && E.d(), B && B.d(), f && f.d(), destroy_component(I), Q && Q.d();
23154
23154
  }
23155
23155
  };
23156
23156
  }
@@ -23643,7 +23643,7 @@ function create_fragment$a(t) {
23643
23643
  const func$1 = () => !0, func_1 = () => !0;
23644
23644
  function instance$a(t, e, A) {
23645
23645
  let n, r, o;
23646
- component_subscribe(t, stateHistory, (E) => A(10, r = E)), component_subscribe(t, shownHistoryGroups, (E) => A(11, o = E));
23646
+ component_subscribe(t, stateHistory, (B) => A(10, r = B)), component_subscribe(t, shownHistoryGroups, (B) => A(11, o = B));
23647
23647
  let s, a = !1;
23648
23648
  const {
23649
23649
  replaceEditorContent: l
@@ -23654,8 +23654,8 @@ function instance$a(t, e, A) {
23654
23654
  omitKeys: ["schema"],
23655
23655
  shouldExpandNode: () => g
23656
23656
  };
23657
- latestEntry.subscribe((E) => {
23658
- E && A(0, s = E);
23657
+ latestEntry.subscribe((B) => {
23658
+ B && A(0, s = B);
23659
23659
  });
23660
23660
  function I() {
23661
23661
  A(1, a = !a);
@@ -23663,36 +23663,36 @@ function instance$a(t, e, A) {
23663
23663
  function d() {
23664
23664
  console.info("%c [prosemirror-dev-toolkit]: Property added to window._trs", "color: #b8e248"), console.log(s?.trs), window._trs = s?.trs;
23665
23665
  }
23666
- function h(E) {
23666
+ function h(B) {
23667
23667
  const {
23668
23668
  id: f = "",
23669
23669
  groupIdx: Q,
23670
23670
  wasTopNode: p
23671
- } = E.detail;
23671
+ } = B.detail;
23672
23672
  if (A(0, s = r.get(f)), !s) return;
23673
23673
  const m = n[Q];
23674
23674
  m.isGroup && m.entries.length > 1 && p && shownHistoryGroups.update((y) => y.map((w, D) => D !== Q ? w : Object.assign(Object.assign({}, w), {
23675
23675
  expanded: !w.expanded
23676
23676
  })));
23677
23677
  }
23678
- function u(E) {
23679
- A(0, s = r.get(E.detail.id || "")), s && l(s.state);
23678
+ function u(B) {
23679
+ A(0, s = r.get(B.detail.id || "")), s && l(s.state);
23680
23680
  }
23681
- function B() {
23681
+ function E() {
23682
23682
  A(2, g = !g), A(3, c = Object.assign(Object.assign({}, c), {
23683
23683
  shouldExpandNode: () => g
23684
23684
  }));
23685
23685
  }
23686
23686
  return t.$$.update = () => {
23687
23687
  t.$$.dirty & /*$shownHistoryGroups, $stateHistory*/
23688
- 3072 && A(4, n = o.map((E) => ({
23689
- id: E.id,
23690
- isGroup: E.isGroup,
23691
- topEntry: r.get(E.topEntryId),
23692
- entries: E.entryIds.map((f) => r.get(f)),
23693
- expanded: E.expanded
23688
+ 3072 && A(4, n = o.map((B) => ({
23689
+ id: B.id,
23690
+ isGroup: B.isGroup,
23691
+ topEntry: r.get(B.topEntryId),
23692
+ entries: B.entryIds.map((f) => r.get(f)),
23693
+ expanded: B.expanded
23694
23694
  })));
23695
- }, [s, a, g, c, n, I, d, h, u, B, r, o];
23695
+ }, [s, a, g, c, n, I, d, h, u, E, r, o];
23696
23696
  }
23697
23697
  class HistoryTab extends SvelteComponent {
23698
23698
  constructor(e) {
@@ -24118,10 +24118,10 @@ function instance$8(t, e, A) {
24118
24118
  shouldExpandNode: () => s
24119
24119
  }, l = o.state, g = l.plugins, c = g[0];
24120
24120
  latestEntry.subscribe((u) => {
24121
- u && (A(8, l = u.state), A(9, g = l.plugins), A(0, c = g.find((B) => B.key === c?.key)));
24121
+ u && (A(8, l = u.state), A(9, g = l.plugins), A(0, c = g.find((E) => E.key === c?.key)));
24122
24122
  });
24123
24123
  function I(u) {
24124
- A(0, c = g.find((B) => B.key === u.key));
24124
+ A(0, c = g.find((E) => E.key === u.key));
24125
24125
  }
24126
24126
  function d() {
24127
24127
  A(1, s = !s), A(2, a = Object.assign(Object.assign({}, a), {
@@ -24389,7 +24389,7 @@ function create_each_block$1(t) {
24389
24389
  };
24390
24390
  }
24391
24391
  function create_fragment$6(t) {
24392
- let e, A, n, r, o, s, a, l, g, c, I, d, h, u, B, E, f, Q, p = ensure_array_like(
24392
+ let e, A, n, r, o, s, a, l, g, c, I, d, h, u, E, B, f, Q, p = ensure_array_like(
24393
24393
  /*fragment*/
24394
24394
  t[2].content
24395
24395
  ), m = [];
@@ -24425,7 +24425,7 @@ function create_fragment$6(t) {
24425
24425
  "show-borders",
24426
24426
  /*depth*/
24427
24427
  t[1] >= 1
24428
- ), attr(e, "class", B = null_to_empty("".concat(
24428
+ ), attr(e, "class", E = null_to_empty("".concat(
24429
24429
  /*$$props*/
24430
24430
  t[11].class || "",
24431
24431
  " doc-node"
@@ -24440,7 +24440,7 @@ function create_fragment$6(t) {
24440
24440
  insert(w, e, D), append(e, A), append(A, n), append(n, r), append(A, o), append(A, s), append(s, a), append(a, l), append(A, g), append(A, c), append(c, I), append(e, h), append(e, u);
24441
24441
  for (let _ = 0; _ < m.length; _ += 1)
24442
24442
  m[_] && m[_].m(u, null);
24443
- E = !0, f || (Q = [listen(
24443
+ B = !0, f || (Q = [listen(
24444
24444
  a,
24445
24445
  "click",
24446
24446
  /*handleNameClick*/
@@ -24454,22 +24454,22 @@ function create_fragment$6(t) {
24454
24454
  },
24455
24455
  p(w, D) {
24456
24456
  let [_] = D;
24457
- if ((!E || _ & /*startPos*/
24457
+ if ((!B || _ & /*startPos*/
24458
24458
  1) && set_data(
24459
24459
  r,
24460
24460
  /*startPos*/
24461
24461
  w[0]
24462
- ), (!E || _ & /*name*/
24462
+ ), (!B || _ & /*name*/
24463
24463
  64) && set_data(
24464
24464
  l,
24465
24465
  /*name*/
24466
24466
  w[6]
24467
- ), (!E || _ & /*endPos*/
24467
+ ), (!B || _ & /*endPos*/
24468
24468
  16) && set_data(
24469
24469
  I,
24470
24470
  /*endPos*/
24471
24471
  w[4]
24472
- ), (!E || _ & /*color*/
24472
+ ), (!B || _ & /*color*/
24473
24473
  128 && d !== (d = "background: ".concat(
24474
24474
  /*color*/
24475
24475
  w[7]
@@ -24488,24 +24488,24 @@ function create_fragment$6(t) {
24488
24488
  y(k);
24489
24489
  check_outros();
24490
24490
  }
24491
- (!E || _ & /*inlineChildren*/
24491
+ (!B || _ & /*inlineChildren*/
24492
24492
  8) && toggle_class(
24493
24493
  u,
24494
24494
  "inline-children",
24495
24495
  /*inlineChildren*/
24496
24496
  w[3]
24497
- ), (!E || _ & /*depth*/
24497
+ ), (!B || _ & /*depth*/
24498
24498
  2) && toggle_class(
24499
24499
  u,
24500
24500
  "show-borders",
24501
24501
  /*depth*/
24502
24502
  w[1] >= 1
24503
- ), (!E || _ & /*$$props*/
24504
- 2048 && B !== (B = null_to_empty("".concat(
24503
+ ), (!B || _ & /*$$props*/
24504
+ 2048 && E !== (E = null_to_empty("".concat(
24505
24505
  /*$$props*/
24506
24506
  w[11].class || "",
24507
24507
  " doc-node"
24508
- )) + " svelte-1un819s")) && attr(e, "class", B), (!E || _ & /*$$props, isRoot*/
24508
+ )) + " svelte-1un819s")) && attr(e, "class", E), (!B || _ & /*$$props, isRoot*/
24509
24509
  2304) && toggle_class(
24510
24510
  e,
24511
24511
  "root",
@@ -24514,17 +24514,17 @@ function create_fragment$6(t) {
24514
24514
  );
24515
24515
  },
24516
24516
  i(w) {
24517
- if (!E) {
24517
+ if (!B) {
24518
24518
  for (let D = 0; D < p.length; D += 1)
24519
24519
  transition_in(m[D]);
24520
- E = !0;
24520
+ B = !0;
24521
24521
  }
24522
24522
  },
24523
24523
  o(w) {
24524
24524
  m = m.filter(Boolean);
24525
24525
  for (let D = 0; D < m.length; D += 1)
24526
24526
  transition_out(m[D]);
24527
- E = !1;
24527
+ B = !1;
24528
24528
  },
24529
24529
  d(w) {
24530
24530
  w && detach(e), destroy_each(m, w), f = !1, run_all(Q);
@@ -24543,10 +24543,10 @@ function instance$6(t, e, A) {
24543
24543
  depth: h
24544
24544
  } = e;
24545
24545
  const u = h === 0;
24546
- function B() {
24546
+ function E() {
24547
24547
  c(I, d);
24548
24548
  }
24549
- function E() {
24549
+ function B() {
24550
24550
  c(I, d, !0);
24551
24551
  }
24552
24552
  return t.$$set = (f) => {
@@ -24564,7 +24564,7 @@ function instance$6(t, e, A) {
24564
24564
  }, [])), t.$$.dirty & /*startPos, node*/
24565
24565
  4097 && A(4, a = d + I.nodeSize), t.$$.dirty & /*fragment*/
24566
24566
  4 && A(3, l = n.content.every((f) => f.isInline));
24567
- }, e = exclude_internal_props(e), [d, h, n, l, a, s, o, r, u, B, E, e, I];
24567
+ }, e = exclude_internal_props(e), [d, h, n, l, a, s, o, r, u, E, B, e, I];
24568
24568
  }
24569
24569
  class DocNode extends SvelteComponent {
24570
24570
  constructor(e) {
@@ -24916,17 +24916,17 @@ function instance$4(t, e, A) {
24916
24916
  node: I,
24917
24917
  pos: d
24918
24918
  }), !h) return;
24919
- let B = r.nodeDOM(d);
24920
- for (; B && !(B instanceof HTMLElement); )
24921
- B = B.parentElement;
24922
- if (!B || getComputedStyle(B).display === "none") return;
24923
- const E = getScrollableParent(r.dom);
24924
- if (E) {
24925
- const p = E.scrollTop, m = E.offsetTop - window.scrollY, y = E.getBoundingClientRect().top - m, w = B.getBoundingClientRect().top - m, D = E.clientHeight / 2;
24926
- E.scroll(0, p + y + w - D);
24919
+ let E = r.nodeDOM(d);
24920
+ for (; E && !(E instanceof HTMLElement); )
24921
+ E = E.parentElement;
24922
+ if (!E || getComputedStyle(E).display === "none") return;
24923
+ const B = getScrollableParent(r.dom);
24924
+ if (B) {
24925
+ const p = B.scrollTop, m = B.offsetTop - window.scrollY, y = B.getBoundingClientRect().top - m, w = E.getBoundingClientRect().top - m, D = B.clientHeight / 2;
24926
+ B.scroll(0, p + y + w - D);
24927
24927
  }
24928
24928
  const f = r.coordsAtPos(d).top, Q = ((u = document.querySelector(".floating-dock")) === null || u === void 0 ? void 0 : u.clientHeight) || 0;
24929
- window.scroll(0, f - Q + B.clientHeight + window.scrollY);
24929
+ window.scroll(0, f - Q + E.clientHeight + window.scrollY);
24930
24930
  }
24931
24931
  function c() {
24932
24932
  console.log(s), window._node = s, console.info("%c [prosemirror-dev-toolkit]: Property added to window._node", "color: #b8e248");
@@ -25075,8 +25075,8 @@ function create_each_block(t) {
25075
25075
  S[23].timestamp ? create_if_block_2$1 : create_else_block_2
25076
25076
  );
25077
25077
  }
25078
- let u = h(t), B = u(t);
25079
- function E(S, F) {
25078
+ let u = h(t), E = u(t);
25079
+ function B(S, F) {
25080
25080
  var N;
25081
25081
  return (
25082
25082
  /*selectedSnapshot*/
@@ -25084,7 +25084,7 @@ function create_each_block(t) {
25084
25084
  S[23].timestamp ? create_if_block_1$1 : create_else_block_1
25085
25085
  );
25086
25086
  }
25087
- let f = E(t), Q = f(t);
25087
+ let f = B(t), Q = f(t);
25088
25088
  function p() {
25089
25089
  return (
25090
25090
  /*click_handler*/
@@ -25132,16 +25132,16 @@ function create_each_block(t) {
25132
25132
  }
25133
25133
  return {
25134
25134
  c() {
25135
- e = element("li"), B.c(), A = space(), n = element("button"), Q.c(), r = space(), o = element("button"), o.textContent = "Restore", s = space(), a = element("button"), a.textContent = "Export", l = space(), g = element("button"), _.c(), c = space(), attr(n, "class", "snapshot-btn ml-2 svelte-969ox4"), attr(o, "class", "snapshot-btn svelte-969ox4"), attr(a, "class", "snapshot-btn svelte-969ox4"), attr(g, "class", "snapshot-btn svelte-969ox4"), attr(e, "class", "svelte-969ox4");
25135
+ e = element("li"), E.c(), A = space(), n = element("button"), Q.c(), r = space(), o = element("button"), o.textContent = "Restore", s = space(), a = element("button"), a.textContent = "Export", l = space(), g = element("button"), _.c(), c = space(), attr(n, "class", "snapshot-btn ml-2 svelte-969ox4"), attr(o, "class", "snapshot-btn svelte-969ox4"), attr(a, "class", "snapshot-btn svelte-969ox4"), attr(g, "class", "snapshot-btn svelte-969ox4"), attr(e, "class", "svelte-969ox4");
25136
25136
  },
25137
25137
  m(S, F) {
25138
- insert(S, e, F), B.m(e, null), append(e, A), append(e, n), Q.m(n, null), append(e, r), append(e, o), append(e, s), append(e, a), append(e, l), append(e, g), _.m(g, null), append(e, c), I || (d = [listen(n, "click", p), listen(o, "click", m), listen(a, "click", y), listen(g, "click", k)], I = !0);
25138
+ insert(S, e, F), E.m(e, null), append(e, A), append(e, n), Q.m(n, null), append(e, r), append(e, o), append(e, s), append(e, a), append(e, l), append(e, g), _.m(g, null), append(e, c), I || (d = [listen(n, "click", p), listen(o, "click", m), listen(a, "click", y), listen(g, "click", k)], I = !0);
25139
25139
  },
25140
25140
  p(S, F) {
25141
- t = S, u === (u = h(t)) && B ? B.p(t, F) : (B.d(1), B = u(t), B && (B.c(), B.m(e, A))), f !== (f = E(t)) && (Q.d(1), Q = f(t), Q && (Q.c(), Q.m(n, null))), D !== (D = w(t)) && (_.d(1), _ = D(t), _ && (_.c(), _.m(g, null)));
25141
+ t = S, u === (u = h(t)) && E ? E.p(t, F) : (E.d(1), E = u(t), E && (E.c(), E.m(e, A))), f !== (f = B(t)) && (Q.d(1), Q = f(t), Q && (Q.c(), Q.m(n, null))), D !== (D = w(t)) && (_.d(1), _ = D(t), _ && (_.c(), _.m(g, null)));
25142
25142
  },
25143
25143
  d(S) {
25144
- S && detach(e), B.d(), Q.d(), _.d(), I = !1, run_all(d);
25144
+ S && detach(e), E.d(), Q.d(), _.d(), I = !1, run_all(d);
25145
25145
  }
25146
25146
  };
25147
25147
  }
@@ -25207,10 +25207,10 @@ function instance$3(t, e, A) {
25207
25207
  function u(S) {
25208
25208
  A(2, c = S), A(3, I = void 0);
25209
25209
  }
25210
- function B(S) {
25210
+ function E(S) {
25211
25211
  c && (A(2, c.name = S.currentTarget.value, c), h());
25212
25212
  }
25213
- function E(S) {
25213
+ function B(S) {
25214
25214
  S.key === "Enter" && c && (o(c), clearTimeout(d), A(2, c = void 0), A(3, I = void 0));
25215
25215
  }
25216
25216
  function f(S) {
@@ -25228,7 +25228,7 @@ function instance$3(t, e, A) {
25228
25228
  const y = (S) => u(S), w = (S) => f(S), D = (S) => Q(S), _ = (S) => p(S), k = (S) => m(S);
25229
25229
  return t.$$set = (S) => {
25230
25230
  "snapshots" in S && A(0, n = S.snapshots), "selectedSnapshot" in S && A(1, r = S.selectedSnapshot), "onUpdate" in S && A(11, o = S.onUpdate), "onView" in S && A(12, s = S.onView), "onRestore" in S && A(13, a = S.onRestore), "onExport" in S && A(14, l = S.onExport), "onDelete" in S && A(15, g = S.onDelete);
25231
- }, [n, r, c, I, u, B, E, f, Q, p, m, o, s, a, l, g, y, w, D, _, k];
25231
+ }, [n, r, c, I, u, E, B, f, Q, p, m, o, s, a, l, g, y, w, D, _, k];
25232
25232
  }
25233
25233
  class SnapshotsList extends SvelteComponent {
25234
25234
  constructor(e) {
@@ -25540,7 +25540,7 @@ function create_if_block$1(t) {
25540
25540
  };
25541
25541
  }
25542
25542
  function create_fragment$1(t) {
25543
- let e, A, n, r, o, s, a, l, g, c, I, d, h, u, B, E, f, Q, p, m, y, w, D, _, k, S, F, N;
25543
+ let e, A, n, r, o, s, a, l, g, c, I, d, h, u, E, B, f, Q, p, m, y, w, D, _, k, S, F, N;
25544
25544
  A = new PasteModal({
25545
25545
  props: {
25546
25546
  isOpen: (
@@ -25592,7 +25592,7 @@ function create_fragment$1(t) {
25592
25592
  }
25593
25593
  return D = v(t), _ = R[D] = b[D](t), {
25594
25594
  c() {
25595
- e = element("div"), create_component(A.$$.fragment), n = space(), r = element("div"), o = element("div"), s = space(), a = element("div"), l = element("div"), g = element("button"), g.textContent = "Copy", c = space(), I = element("button"), I.textContent = "Save", d = space(), h = element("button"), h.textContent = "Import", u = space(), B = element("button"), B.textContent = "Paste", E = space(), f = element("button"), f.textContent = "X", Q = space(), p = element("input"), m = space(), create_component(y.$$.fragment), w = space(), _.c(), attr(o, "class", "resizing-div svelte-1quf800"), attr(o, "role", "button"), attr(o, "tabindex", "-1"), attr(g, "class", "copy-btn svelte-1quf800"), attr(I, "class", "save-btn svelte-1quf800"), attr(h, "class", "import-btn svelte-1quf800"), attr(B, "class", "paste-btn svelte-1quf800"), attr(f, "class", "close-btn svelte-1quf800"), attr(f, "aria-label", "Close dev-toolkit"), set_style(p, "display", "none"), attr(p, "type", "file"), attr(p, "accept", ".json"), p.multiple = !0, attr(a, "class", "floating-dock-body svelte-1quf800"), attr(r, "class", "floating-dock svelte-1quf800"), attr(r, "style", k = "top: ".concat(
25595
+ e = element("div"), create_component(A.$$.fragment), n = space(), r = element("div"), o = element("div"), s = space(), a = element("div"), l = element("div"), g = element("button"), g.textContent = "Copy", c = space(), I = element("button"), I.textContent = "Save", d = space(), h = element("button"), h.textContent = "Import", u = space(), E = element("button"), E.textContent = "Paste", B = space(), f = element("button"), f.textContent = "X", Q = space(), p = element("input"), m = space(), create_component(y.$$.fragment), w = space(), _.c(), attr(o, "class", "resizing-div svelte-1quf800"), attr(o, "role", "button"), attr(o, "tabindex", "-1"), attr(g, "class", "copy-btn svelte-1quf800"), attr(I, "class", "save-btn svelte-1quf800"), attr(h, "class", "import-btn svelte-1quf800"), attr(E, "class", "paste-btn svelte-1quf800"), attr(f, "class", "close-btn svelte-1quf800"), attr(f, "aria-label", "Close dev-toolkit"), set_style(p, "display", "none"), attr(p, "type", "file"), attr(p, "accept", ".json"), p.multiple = !0, attr(a, "class", "floating-dock-body svelte-1quf800"), attr(r, "class", "floating-dock svelte-1quf800"), attr(r, "style", k = "top: ".concat(
25596
25596
  /*dockTop*/
25597
25597
  t[2],
25598
25598
  "%; height: "
@@ -25603,7 +25603,7 @@ function create_fragment$1(t) {
25603
25603
  )), attr(e, "class", "floating-dock-wrapper svelte-1quf800");
25604
25604
  },
25605
25605
  m(M, L) {
25606
- insert(M, e, L), mount_component(A, e, null), append(e, n), append(e, r), append(r, o), append(r, s), append(r, a), append(a, l), append(l, g), append(l, c), append(l, I), append(l, d), append(l, h), append(l, u), append(l, B), append(l, E), append(l, f), append(a, Q), append(a, p), t[15](p), append(a, m), mount_component(y, a, null), append(a, w), R[D].m(a, null), S = !0, F || (N = [listen(
25606
+ insert(M, e, L), mount_component(A, e, null), append(e, n), append(e, r), append(r, o), append(r, s), append(r, a), append(a, l), append(l, g), append(l, c), append(l, I), append(l, d), append(l, h), append(l, u), append(l, E), append(l, B), append(l, f), append(a, Q), append(a, p), t[15](p), append(a, m), mount_component(y, a, null), append(a, w), R[D].m(a, null), S = !0, F || (N = [listen(
25607
25607
  o,
25608
25608
  "mousedown",
25609
25609
  /*handleResizeMouseDown*/
@@ -25624,7 +25624,7 @@ function create_fragment$1(t) {
25624
25624
  /*handleImportSnapshot*/
25625
25625
  t[9]
25626
25626
  ), listen(
25627
- B,
25627
+ E,
25628
25628
  "click",
25629
25629
  /*handlePasteSnapshot*/
25630
25630
  t[10]
@@ -25703,10 +25703,10 @@ function instance$1(t, e, A) {
25703
25703
  const w = (/* @__PURE__ */ new Date()).toLocaleString("sv"), D = prompt("Enter snapshot name", w);
25704
25704
  D && saveSnapshot(D, r.state.doc.toJSON());
25705
25705
  }
25706
- function B() {
25706
+ function E() {
25707
25707
  l.click();
25708
25708
  }
25709
- function E() {
25709
+ function B() {
25710
25710
  A(5, g = !g);
25711
25711
  }
25712
25712
  function f() {
@@ -25744,7 +25744,7 @@ function instance$1(t, e, A) {
25744
25744
  }
25745
25745
  return t.$$set = (w) => {
25746
25746
  "onClose" in w && A(0, n = w.onClose);
25747
- }, [n, o, s, a, l, g, c, h, u, B, E, f, Q, p, m, y];
25747
+ }, [n, o, s, a, l, g, c, h, u, E, B, f, Q, p, m, y];
25748
25748
  }
25749
25749
  class FloatingDock extends SvelteComponent {
25750
25750
  constructor(e) {
@@ -27480,16 +27480,16 @@ function writeIndented$1(t, e, A, n) {
27480
27480
  let c = "";
27481
27481
  if (t.colPos === 0 && (c += "> ".repeat(A.blockquoteCnt)), t.colPos === 0 && g.length > 0) {
27482
27482
  c += " ".repeat(A.footnoteCnt);
27483
- const E = A.listPath.slice(0, A.listPath.length - 1).map((f) => o[f]).reduce((f, Q) => f + Q, 0);
27483
+ const B = A.listPath.slice(0, A.listPath.length - 1).map((f) => o[f]).reduce((f, Q) => f + Q, 0);
27484
27484
  switch (A.listType) {
27485
27485
  case "tl":
27486
- c += " ".repeat(E), A.itemRow === 0 ? (c += "- ", A.itemSymbol ? c += "[x] " : c += "[ ] ") : c += " ";
27486
+ c += " ".repeat(B), A.itemRow === 0 ? (c += "- ", A.itemSymbol ? c += "[x] " : c += "[ ] ") : c += " ";
27487
27487
  break;
27488
27488
  case "ul":
27489
- c += " ".repeat(E), A.itemRow === 0 ? c += A.itemSymbol + " " : c += " ";
27489
+ c += " ".repeat(B), A.itemRow === 0 ? c += A.itemSymbol + " " : c += " ";
27490
27490
  break;
27491
27491
  case "ol":
27492
- c += " ".repeat(E), A.itemRow === 0 ? c += A.itemSymbol : c += " ".repeat(4);
27492
+ c += " ".repeat(B), A.itemRow === 0 ? c += A.itemSymbol : c += " ".repeat(4);
27493
27493
  break;
27494
27494
  case "dl":
27495
27495
  A.itemSymbol && (A.itemRow === 0 ? c += `${A.itemSymbol}` : c += " ".repeat(A.itemSymbol.length));
@@ -27498,12 +27498,12 @@ function writeIndented$1(t, e, A, n) {
27498
27498
  }
27499
27499
  const I = structuredClone(n);
27500
27500
  a && I && (I.map = [a + s]), g.length > 0 && A.blockquoteCnt > 0 && t.colPos === A.blockquoteCnt * 2 - 1 && (c += " ");
27501
- const d = l >= r.length - 1, h = new RegExp(A.lineBreak + "$"), u = g.match(new RegExp(A.lineBreak + "$")), B = g.replace(h, "").replace(/[ \t\u00A0]+$/g, "");
27502
- if (d ? u ? (t.log(B ? c : c.trim()), t.log(B + (u ? " " : ""), I), s += (B + (u ? " " : "")).length) : (t.log(g ? c : c.trim()), t.log(g, I), s += g.length) : (t.log(B ? c : c.trim()), t.log(B + (u ? " " : ""), I), s += (B + (u ? " " : "")).length), !d) {
27501
+ const d = l >= r.length - 1, h = new RegExp(A.lineBreak + "$"), u = g.match(new RegExp(A.lineBreak + "$")), E = g.replace(h, "").replace(/[ \t\u00A0]+$/g, "");
27502
+ if (d ? u ? (t.log(E ? c : c.trim()), t.log(E + (u ? " " : ""), I), s += (E + (u ? " " : "")).length) : (t.log(g ? c : c.trim()), t.log(g, I), s += g.length) : (t.log(E ? c : c.trim()), t.log(E + (u ? " " : ""), I), s += (E + (u ? " " : "")).length), !d) {
27503
27503
  A.itemRow++;
27504
- const E = structuredClone(n);
27505
- a && E && (E.map = [a + s]), t.log(`
27506
- `, E), s++;
27504
+ const B = structuredClone(n);
27505
+ a && B && (B.map = [a + s]), t.log(`
27506
+ `, B), s++;
27507
27507
  }
27508
27508
  }
27509
27509
  }
@@ -28056,16 +28056,16 @@ function writeIndented(t, e, A, n) {
28056
28056
  let c = "";
28057
28057
  if (t.colPos === 0 && (c += "> ".repeat(A.blockquoteCnt)), t.colPos === 0 && g.length > 0) {
28058
28058
  c += " ".repeat(A.footnoteCnt);
28059
- const E = A.listPath.slice(0, A.listPath.length - 1).map((f) => o[f]).reduce((f, Q) => f + Q, 0);
28059
+ const B = A.listPath.slice(0, A.listPath.length - 1).map((f) => o[f]).reduce((f, Q) => f + Q, 0);
28060
28060
  switch (A.listType) {
28061
28061
  case "tl":
28062
- c += " ".repeat(E), A.itemRow === 0 ? (c += "- ", A.itemSymbol ? c += "[x] " : c += "[ ] ") : c += " ";
28062
+ c += " ".repeat(B), A.itemRow === 0 ? (c += "- ", A.itemSymbol ? c += "[x] " : c += "[ ] ") : c += " ";
28063
28063
  break;
28064
28064
  case "ul":
28065
- c += " ".repeat(E), A.itemRow === 0 ? c += A.itemSymbol + " " : c += " ";
28065
+ c += " ".repeat(B), A.itemRow === 0 ? c += A.itemSymbol + " " : c += " ";
28066
28066
  break;
28067
28067
  case "ol":
28068
- c += " ".repeat(E), A.itemRow === 0 ? c += A.itemSymbol : c += " ".repeat(4);
28068
+ c += " ".repeat(B), A.itemRow === 0 ? c += A.itemSymbol : c += " ".repeat(4);
28069
28069
  break;
28070
28070
  case "dl":
28071
28071
  A.itemSymbol && (A.itemRow === 0 ? c += `${A.itemSymbol}` : c += " ".repeat(A.itemSymbol.length));
@@ -28074,12 +28074,12 @@ function writeIndented(t, e, A, n) {
28074
28074
  }
28075
28075
  const I = structuredClone(n);
28076
28076
  a && I && (I.map = [a + s]), g.length > 0 && A.blockquoteCnt > 0 && t.colPos === A.blockquoteCnt * 2 - 1 && (c += " ");
28077
- const d = l >= r.length - 1, h = new RegExp(A.lineBreak + "$"), u = g.match(new RegExp(A.lineBreak + "$")), B = g.replace(h, "").replace(/[ \t\u00A0]+$/g, "");
28078
- if (d ? u ? (t.log(B ? c : c.trim()), t.log(B + (u ? " " : ""), I), s += (B + (u ? " " : "")).length) : (t.log(g ? c : c.trim()), t.log(g, I), s += g.length) : (t.log(B ? c : c.trim()), t.log(B + (u ? " " : ""), I), s += (B + (u ? " " : "")).length), !d) {
28077
+ const d = l >= r.length - 1, h = new RegExp(A.lineBreak + "$"), u = g.match(new RegExp(A.lineBreak + "$")), E = g.replace(h, "").replace(/[ \t\u00A0]+$/g, "");
28078
+ if (d ? u ? (t.log(E ? c : c.trim()), t.log(E + (u ? " " : ""), I), s += (E + (u ? " " : "")).length) : (t.log(g ? c : c.trim()), t.log(g, I), s += g.length) : (t.log(E ? c : c.trim()), t.log(E + (u ? " " : ""), I), s += (E + (u ? " " : "")).length), !d) {
28079
28079
  A.itemRow++;
28080
- const E = structuredClone(n);
28081
- a && E && (E.map = [a + s]), t.log(`
28082
- `, E), s++;
28080
+ const B = structuredClone(n);
28081
+ a && B && (B.map = [a + s]), t.log(`
28082
+ `, B), s++;
28083
28083
  }
28084
28084
  }
28085
28085
  }
@@ -28293,7 +28293,7 @@ class DocumentMarkdownInlineTokenizer {
28293
28293
  let [p, m, y] = /^(.*?)(\s*)$/m.exec(g.text);
28294
28294
  y && (o.push([y, d]), m ? g = this.schema.text(m, g.marks) : g = nullNode, g || (h = r));
28295
28295
  }
28296
- let B = h.length ? h[h.length - 1] : null, E = B && this.getMark(B.type.name).escape === !1, f = h.length - (E ? 1 : 0);
28296
+ let E = h.length ? h[h.length - 1] : null, B = E && this.getMark(E.type.name).escape === !1, f = h.length - (B ? 1 : 0);
28297
28297
  e: for (let p = 0; p < f; p++) {
28298
28298
  let m = h[p];
28299
28299
  if (!this.getMark(m.type.name).mixable) break;
@@ -28320,12 +28320,12 @@ class DocumentMarkdownInlineTokenizer {
28320
28320
  let p = h[r.length];
28321
28321
  r.push(p), await this.markString(p, !0, s);
28322
28322
  }
28323
- if (E && g.isText) {
28324
- if (await this.markString(B, !0, s), g.text) {
28323
+ if (B && g.isText) {
28324
+ if (await this.markString(E, !0, s), g.text) {
28325
28325
  const p = new Token("text", "", 0);
28326
28326
  p.meta = "noEscText", p.map = [d], p.content = g.text, s.push(p);
28327
28327
  }
28328
- await this.markString(B, !1, s);
28328
+ await this.markString(E, !1, s);
28329
28329
  } else {
28330
28330
  const p = "type" in g && this.nodes[g.type.name] ? this.nodes[g.type.name](g, A) : blankNode$1;
28331
28331
  let m = "";
@@ -28783,13 +28783,13 @@ async function extPmToMdConverter(t, e, A, n) {
28783
28783
  }
28784
28784
  });
28785
28785
  n.dispatchEvent(u);
28786
- const B = {}, E = [];
28786
+ const E = {}, B = [];
28787
28787
  let f;
28788
28788
  if (e.sourceMap) {
28789
28789
  const Q = new SmartOutput();
28790
28790
  nodeToTreeStringOutput(Q, t), Q.getSourceMap(
28791
28791
  (p, m, y, w) => {
28792
- w && (B[w.pos] = {
28792
+ w && (E[w.pos] = {
28793
28793
  targetRow: p,
28794
28794
  targetCol: m
28795
28795
  });
@@ -28798,17 +28798,17 @@ async function extPmToMdConverter(t, e, A, n) {
28798
28798
  (p, m, y, w) => {
28799
28799
  if (w?.map) {
28800
28800
  const D = w.map[0], _ = w.map[2];
28801
- if (E.push({
28801
+ if (B.push({
28802
28802
  nodeIdx: D,
28803
28803
  targetPos: y,
28804
28804
  targetRow: p,
28805
28805
  targetCol: m,
28806
28806
  sourceCol: _
28807
- }), B[D])
28807
+ }), E[D])
28808
28808
  return {
28809
28809
  sourceNo: 0,
28810
- sourceRowPos: B[D].targetRow,
28811
- sourceColPos: B[D].targetCol
28810
+ sourceRowPos: E[D].targetRow,
28811
+ sourceColPos: E[D].targetCol
28812
28812
  };
28813
28813
  }
28814
28814
  }
@@ -28818,8 +28818,8 @@ async function extPmToMdConverter(t, e, A, n) {
28818
28818
  const Q = new CustomEvent("md:sourcemap", {
28819
28819
  detail: {
28820
28820
  sourceMap: f,
28821
- debugMap: B,
28822
- rawTextMap: E
28821
+ debugMap: E,
28822
+ rawTextMap: B
28823
28823
  }
28824
28824
  });
28825
28825
  n.dispatchEvent(Q);
@@ -28827,8 +28827,8 @@ async function extPmToMdConverter(t, e, A, n) {
28827
28827
  return {
28828
28828
  content: h.toString(),
28829
28829
  sourceMap: f,
28830
- debugMap: B,
28831
- rawTextMap: E
28830
+ debugMap: E,
28831
+ rawTextMap: B
28832
28832
  };
28833
28833
  }
28834
28834
  const removeWhitespaces = (t) => {
@@ -29001,16 +29001,16 @@ function treeToTokens(t, e, A) {
29001
29001
  const d = (u) => {
29002
29002
  if (u)
29003
29003
  return c.substring(u.startIndex, u.endIndex);
29004
- }, h = (u, B) => {
29005
- const E = u.split(`
29004
+ }, h = (u, E) => {
29005
+ const B = u.split(`
29006
29006
  `);
29007
29007
  let f = 0;
29008
- for (const Q of E) {
29008
+ for (const Q of B) {
29009
29009
  if (f > 0) {
29010
29010
  const y = [
29011
29011
  // TODO verify in viewer
29012
- I.row + B.startPosition?.row + f,
29013
- I.row + B.endPosition?.row + f,
29012
+ I.row + E.startPosition?.row + f,
29013
+ I.row + E.endPosition?.row + f,
29014
29014
  0,
29015
29015
  0
29016
29016
  ], w = new Token("softbreak", "wbr", NESTING_SELF_CLOSING);
@@ -29018,24 +29018,24 @@ function treeToTokens(t, e, A) {
29018
29018
  `, s(w, "softbreak between text rows");
29019
29019
  }
29020
29020
  const p = [
29021
- I.row + B.startPosition?.row + f,
29022
- I.row + B.endPosition?.row + f,
29023
- I.column + B.startPosition?.column,
29024
- (+B.endPosition.row == +B.startPosition.row ? I.column : 0) + B.endPosition?.column
29021
+ I.row + E.startPosition?.row + f,
29022
+ I.row + E.endPosition?.row + f,
29023
+ I.column + E.startPosition?.column,
29024
+ (+E.endPosition.row == +E.startPosition.row ? I.column : 0) + E.endPosition?.column
29025
29025
  ], m = new Token("text", "", NESTING_SELF_CLOSING);
29026
- m.map = p, m.meta = "noEscText", m.content = E.length > 1 ? Q.replace(/^\s+/, "") : Q, s(m, "text"), f++;
29026
+ m.map = p, m.meta = "noEscText", m.content = B.length > 1 ? Q.replace(/^\s+/, "") : Q, s(m, "text"), f++;
29027
29027
  }
29028
29028
  };
29029
29029
  for (const u of g) {
29030
- const B = [
29030
+ const E = [
29031
29031
  I.row + u.startPosition?.row,
29032
29032
  I.row + u.endPosition?.row,
29033
29033
  I.column + u.startPosition?.column,
29034
29034
  (+u.endPosition.row == +u.startPosition.row ? I.column : 0) + u.endPosition?.column
29035
29035
  ];
29036
29036
  if (u.type.length === 1) {
29037
- const E = new Token("text", "", NESTING_SELF_CLOSING);
29038
- E.map = B, E.meta = "noEscText", E.content = d(u) || "", s(E, "walkInline");
29037
+ const B = new Token("text", "", NESTING_SELF_CLOSING);
29038
+ B.map = E, B.meta = "noEscText", B.content = d(u) || "", s(B, "walkInline");
29039
29039
  continue;
29040
29040
  }
29041
29041
  switch (u.type) {
@@ -29045,14 +29045,14 @@ function treeToTokens(t, e, A) {
29045
29045
  break;
29046
29046
  case "text":
29047
29047
  {
29048
- const E = d(u) ?? "";
29049
- h(E, u);
29048
+ const B = d(u) ?? "";
29049
+ h(B, u);
29050
29050
  }
29051
29051
  break;
29052
29052
  case "latex_block":
29053
29053
  {
29054
- const E = u.children.find((Q) => Q?.type === "latex_span_delimiter"), f = u.children.filter((Q) => Q?.type !== "latex_span_delimiter").map((Q) => d(Q)).join("");
29055
- if (d(E) === "$$") {
29054
+ const B = u.children.find((Q) => Q?.type === "latex_span_delimiter"), f = u.children.filter((Q) => Q?.type !== "latex_span_delimiter").map((Q) => d(Q)).join("");
29055
+ if (d(B) === "$$") {
29056
29056
  const Q = new Token(
29057
29057
  "fence",
29058
29058
  "pre",
@@ -29061,45 +29061,45 @@ function treeToTokens(t, e, A) {
29061
29061
  Q.level = r, Q.markup = "$$", Q.meta = "noEscText", Q.attrSet("lang", "latex"), Q.content = f.trim(), n.push(Q);
29062
29062
  } else {
29063
29063
  const Q = new Token("math", "", NESTING_SELF_CLOSING);
29064
- Q.attrSet("lang", "latex"), Q.map = B, Q.meta = "noEscText", Q.content = f, s(Q, "latex_block");
29064
+ Q.attrSet("lang", "latex"), Q.map = E, Q.meta = "noEscText", Q.content = f, s(Q, "latex_block");
29065
29065
  }
29066
29066
  }
29067
29067
  break;
29068
29068
  case "whitespace":
29069
29069
  {
29070
- const E = d(u) || "";
29071
- if (E === `
29070
+ const B = d(u) || "";
29071
+ if (B === `
29072
29072
  `) {
29073
29073
  const f = new Token("softbreak", "wbr", NESTING_SELF_CLOSING);
29074
- f.map = B, f.content = E ?? "", s(f, `whitespace
29074
+ f.map = E, f.content = B ?? "", s(f, `whitespace
29075
29075
  `);
29076
29076
  break;
29077
29077
  }
29078
- if (E && E.match(/^\s+$/)) {
29079
- if (E.endsWith(`
29078
+ if (B && B.match(/^\s+$/)) {
29079
+ if (B.endsWith(`
29080
29080
  `)) {
29081
29081
  const f = new Token(
29082
29082
  "hardbreak",
29083
29083
  "wbr",
29084
29084
  NESTING_SELF_CLOSING
29085
29085
  );
29086
- f.map = B, f.meta = "noEscText", f.content = E ?? "", s(f, "whitespace hardbreak");
29086
+ f.map = E, f.meta = "noEscText", f.content = B ?? "", s(f, "whitespace hardbreak");
29087
29087
  } else {
29088
29088
  const f = new Token("text", "br", NESTING_SELF_CLOSING);
29089
- f.map = B, f.meta = "noEscText", f.content = E ?? "", s(f, "whitespace space");
29089
+ f.map = E, f.meta = "noEscText", f.content = B ?? "", s(f, "whitespace space");
29090
29090
  }
29091
29091
  break;
29092
29092
  }
29093
- if (E?.trim().length > 0) {
29094
- h(E, u);
29093
+ if (B?.trim().length > 0) {
29094
+ h(B, u);
29095
29095
  break;
29096
29096
  }
29097
29097
  }
29098
29098
  break;
29099
29099
  case "shortcut_link":
29100
29100
  {
29101
- const E = "link", Q = new Token(
29102
- E + "_open",
29101
+ const B = "link", Q = new Token(
29102
+ B + "_open",
29103
29103
  "a",
29104
29104
  NESTING_OPENING
29105
29105
  ), p = u.children.find((w) => w?.type === "link_destination");
@@ -29107,10 +29107,10 @@ function treeToTokens(t, e, A) {
29107
29107
  const m = u.children.find((w) => w?.type === "link_title");
29108
29108
  m && Q.attrSet("title", d(m) || ""), s(Q, "shortcut_link"), u.children.filter((w) => w.type === "link_text").forEach((w) => {
29109
29109
  const D = new Token("text", "", NESTING_SELF_CLOSING);
29110
- D.map = B, D.meta = "noEscText", D.content = d(w) ?? "", s(D, "link_text");
29110
+ D.map = E, D.meta = "noEscText", D.content = d(w) ?? "", s(D, "link_text");
29111
29111
  });
29112
29112
  const y = new Token(
29113
- E + "_close",
29113
+ B + "_close",
29114
29114
  "a",
29115
29115
  NESTING_CLOSING
29116
29116
  );
@@ -29119,8 +29119,8 @@ function treeToTokens(t, e, A) {
29119
29119
  break;
29120
29120
  case "inline_link":
29121
29121
  {
29122
- const E = "link", Q = new Token(
29123
- E + "_open",
29122
+ const B = "link", Q = new Token(
29123
+ B + "_open",
29124
29124
  "a",
29125
29125
  NESTING_OPENING
29126
29126
  ), p = u.children.find((w) => w.type === "link_destination");
@@ -29128,10 +29128,10 @@ function treeToTokens(t, e, A) {
29128
29128
  const m = u.children.find((w) => w.type === "link_title");
29129
29129
  m && Q.attrSet("title", m.text || ""), s(Q, "inline_link"), u.children.filter((w) => w.type === "link_text").forEach((w) => {
29130
29130
  const D = new Token("text", "", NESTING_SELF_CLOSING);
29131
- D.map = B, D.meta = "noEscText", D.content = d(w) ?? "", s(D, "inline_link_txt");
29131
+ D.map = E, D.meta = "noEscText", D.content = d(w) ?? "", s(D, "inline_link_txt");
29132
29132
  });
29133
29133
  const y = new Token(
29134
- E + "_close",
29134
+ B + "_close",
29135
29135
  "a",
29136
29136
  NESTING_CLOSING
29137
29137
  );
@@ -29140,8 +29140,8 @@ function treeToTokens(t, e, A) {
29140
29140
  break;
29141
29141
  case "image":
29142
29142
  {
29143
- const E = "image", Q = new Token(
29144
- E,
29143
+ const B = "image", Q = new Token(
29144
+ B,
29145
29145
  "img",
29146
29146
  NESTING_SELF_CLOSING
29147
29147
  ), p = u.children.find((w) => w.type === "image_description");
@@ -29154,23 +29154,23 @@ function treeToTokens(t, e, A) {
29154
29154
  break;
29155
29155
  case "strong_emphasis":
29156
29156
  {
29157
- const E = u.children.find((y) => y.type === "emphasis_delimiter"), f = E?.text === "_" ? "underline" : "strong", Q = E?.text === "_" ? "u" : "strong", p = new Token(
29157
+ const B = u.children.find((y) => y.type === "emphasis_delimiter"), f = B?.text === "_" ? "underline" : "strong", Q = B?.text === "_" ? "u" : "strong", p = new Token(
29158
29158
  f + "_open",
29159
29159
  Q,
29160
29160
  NESTING_OPENING
29161
29161
  );
29162
- E?.text === "_" && (p.markup = "__"), s(p, "strongem"), a(u.children, c);
29162
+ B?.text === "_" && (p.markup = "__"), s(p, "strongem"), a(u.children, c);
29163
29163
  const m = new Token(
29164
29164
  f + "_close",
29165
29165
  Q,
29166
29166
  NESTING_CLOSING
29167
29167
  );
29168
- d(E) === "_" && (m.markup = "__"), s(m, "/strongem");
29168
+ d(B) === "_" && (m.markup = "__"), s(m, "/strongem");
29169
29169
  }
29170
29170
  break;
29171
29171
  case "emphasis":
29172
29172
  {
29173
- const E = u.children.find((w) => w.type === "emphasis_delimiter"), f = u.children.filter((w) => w.type !== "emphasis_delimiter"), Q = E?.text === "_" ? "underline" : "em", p = E?.text === "_" ? "u" : "em", m = new Token(
29173
+ const B = u.children.find((w) => w.type === "emphasis_delimiter"), f = u.children.filter((w) => w.type !== "emphasis_delimiter"), Q = B?.text === "_" ? "underline" : "em", p = B?.text === "_" ? "u" : "em", m = new Token(
29174
29174
  Q + "_open",
29175
29175
  p,
29176
29176
  NESTING_OPENING
@@ -29186,14 +29186,14 @@ function treeToTokens(t, e, A) {
29186
29186
  break;
29187
29187
  case "strikethrough":
29188
29188
  {
29189
- const E = "strike", f = "strike", Q = new Token(
29190
- E + "_open",
29189
+ const B = "strike", f = "strike", Q = new Token(
29190
+ B + "_open",
29191
29191
  f,
29192
29192
  NESTING_OPENING
29193
29193
  );
29194
29194
  s(Q, "s"), a(u.children.filter((m) => !!m), c);
29195
29195
  const p = new Token(
29196
- E + "_close",
29196
+ B + "_close",
29197
29197
  f,
29198
29198
  NESTING_CLOSING
29199
29199
  );
@@ -29202,14 +29202,14 @@ function treeToTokens(t, e, A) {
29202
29202
  break;
29203
29203
  case "code_span":
29204
29204
  {
29205
- const E = "code", f = "code", Q = new Token(
29206
- E + "_open",
29205
+ const B = "code", f = "code", Q = new Token(
29206
+ B + "_open",
29207
29207
  f,
29208
29208
  NESTING_OPENING
29209
29209
  );
29210
29210
  s(Q, "code"), a(u.children.filter((m) => !!m), c);
29211
29211
  const p = new Token(
29212
- E + "_close",
29212
+ B + "_close",
29213
29213
  f,
29214
29214
  NESTING_CLOSING
29215
29215
  );
@@ -29218,8 +29218,8 @@ function treeToTokens(t, e, A) {
29218
29218
  break;
29219
29219
  case "html_tag":
29220
29220
  {
29221
- const E = "html_block", Q = new Token(
29222
- E,
29221
+ const B = "html_block", Q = new Token(
29222
+ B,
29223
29223
  "",
29224
29224
  NESTING_SELF_CLOSING
29225
29225
  );
@@ -29228,12 +29228,12 @@ function treeToTokens(t, e, A) {
29228
29228
  break;
29229
29229
  case "hard_line_break":
29230
29230
  {
29231
- const E = "hardbreak", Q = new Token(
29232
- E,
29231
+ const B = "hardbreak", Q = new Token(
29232
+ B,
29233
29233
  "br",
29234
29234
  NESTING_SELF_CLOSING
29235
29235
  );
29236
- Q.map = B, Q.meta = "noEscText", Q.content = d(u) ?? "", s(Q, "hard_line_break");
29236
+ Q.map = E, Q.meta = "noEscText", Q.content = d(u) ?? "", s(Q, "hard_line_break");
29237
29237
  }
29238
29238
  break;
29239
29239
  default:
@@ -29317,16 +29317,16 @@ function treeToTokens(t, e, A) {
29317
29317
  NESTING_OPENING
29318
29318
  );
29319
29319
  u.level = r, u.markup = o(d) || "#", u.attrSet("margin_before", "1"), n.push(u);
29320
- const B = g.children.filter((f) => !!f).filter(
29320
+ const E = g.children.filter((f) => !!f).filter(
29321
29321
  (f) => !f.type.startsWith("setext_")
29322
29322
  );
29323
- r++, B.forEach((f) => l(f, c)), r--;
29324
- const E = new Token(
29323
+ r++, E.forEach((f) => l(f, c)), r--;
29324
+ const B = new Token(
29325
29325
  I + "_close",
29326
29326
  h,
29327
29327
  NESTING_CLOSING
29328
29328
  );
29329
- E.level = r, E.markup = o(d) || "", E.attrSet("margin_after", "1"), n.push(E);
29329
+ B.level = r, B.markup = o(d) || "", B.attrSet("margin_after", "1"), n.push(B);
29330
29330
  }
29331
29331
  break;
29332
29332
  case "atx_heading":
@@ -29339,14 +29339,14 @@ function treeToTokens(t, e, A) {
29339
29339
  NESTING_OPENING
29340
29340
  );
29341
29341
  u.level = r, u.markup = o(d) || "#", u.attrSet("margin_before", "1"), n.push(u);
29342
- const B = [...g.children.filter((f) => !!f)];
29343
- B.length > 0 && B[0].type.endsWith("_marker") && B.splice(0, 1), B.length > 0 && B[0].type === "whitespace" && B.splice(0, 1), B.length > 0 && B[B.length - 1].type === "whitespace" && B.splice(B.length - 1, 1), r++, B.forEach((f) => l(f, c)), r--;
29344
- const E = new Token(
29342
+ const E = [...g.children.filter((f) => !!f)];
29343
+ E.length > 0 && E[0].type.endsWith("_marker") && E.splice(0, 1), E.length > 0 && E[0].type === "whitespace" && E.splice(0, 1), E.length > 0 && E[E.length - 1].type === "whitespace" && E.splice(E.length - 1, 1), r++, E.forEach((f) => l(f, c)), r--;
29344
+ const B = new Token(
29345
29345
  I + "_close",
29346
29346
  h,
29347
29347
  NESTING_CLOSING
29348
29348
  );
29349
- E.level = r, E.attrSet("margin_after", "1"), n.push(E);
29349
+ B.level = r, B.attrSet("margin_after", "1"), n.push(B);
29350
29350
  }
29351
29351
  break;
29352
29352
  case "minus_metadata":
@@ -29369,10 +29369,10 @@ function treeToTokens(t, e, A) {
29369
29369
  NESTING_SELF_CLOSING
29370
29370
  );
29371
29371
  u.meta = "noEscText", u.level = r, u.markup = "```", h && u.attrSet("lang", o(h) || "");
29372
- const E = [
29372
+ const B = [
29373
29373
  ...g.children.filter((f) => !!f).filter((f) => f?.type === "code_fence_content")
29374
29374
  ].map((f) => o(f) || "").join("");
29375
- u.content = E, u.attrSet("margin_before", "1"), u.attrSet("margin_after", "1"), n.push(u);
29375
+ u.content = B, u.attrSet("margin_before", "1"), u.attrSet("margin_after", "1"), n.push(u);
29376
29376
  }
29377
29377
  break;
29378
29378
  case "block_quote":
@@ -29382,7 +29382,7 @@ function treeToTokens(t, e, A) {
29382
29382
  d,
29383
29383
  NESTING_OPENING
29384
29384
  );
29385
- h.level = r, h.attrSet("margin_before", "1"), n.push(h), r++, g.children?.filter((B) => !["block_quote_marker"].includes(B.type)).forEach((B) => l(B, c)), r--;
29385
+ h.level = r, h.attrSet("margin_before", "1"), n.push(h), r++, g.children?.filter((E) => !["block_quote_marker"].includes(E.type)).forEach((E) => l(E, c)), r--;
29386
29386
  const u = new Token(
29387
29387
  I + "_close",
29388
29388
  d,
@@ -29401,17 +29401,17 @@ function treeToTokens(t, e, A) {
29401
29401
  h.level = r;
29402
29402
  let u = 80;
29403
29403
  "indent" in g && (u = g.indent.length);
29404
- const B = g.text.split(`
29404
+ const E = g.text.split(`
29405
29405
  `);
29406
- for (const f of B) {
29406
+ for (const f of E) {
29407
29407
  if (f.trim().length === 0)
29408
29408
  continue;
29409
29409
  const Q = f.match(/^ +/);
29410
29410
  Q ? u > Q[0].length && (u = Q[0].length) : u = 0;
29411
29411
  }
29412
- const E = B.map((f) => f.substring(u)).join(`
29412
+ const B = E.map((f) => f.substring(u)).join(`
29413
29413
  `);
29414
- h.attrSet("indent", "" + u), h.content = E, h.attrSet("margin_before", "1"), h.attrSet("margin_after", "1"), n.push(h);
29414
+ h.attrSet("indent", "" + u), h.content = B, h.attrSet("margin_before", "1"), h.attrSet("margin_after", "1"), n.push(h);
29415
29415
  }
29416
29416
  break;
29417
29417
  case "paragraph":
@@ -29421,7 +29421,7 @@ function treeToTokens(t, e, A) {
29421
29421
  "p",
29422
29422
  NESTING_OPENING
29423
29423
  );
29424
- h.level = r, h.attrSet("margin_before", "1"), n.push(h), r++, g.children?.forEach((B) => l(B, c)), r--;
29424
+ h.level = r, h.attrSet("margin_before", "1"), n.push(h), r++, g.children?.forEach((E) => l(E, c)), r--;
29425
29425
  const u = new Token(
29426
29426
  I + "_close",
29427
29427
  "p",
@@ -29439,8 +29439,8 @@ function treeToTokens(t, e, A) {
29439
29439
  );
29440
29440
  h.attrSet("align", c.cellAlign[c.cellNo] || "left"), h.level = r, n.push(h), r++;
29441
29441
  {
29442
- const B = "paragraph", f = new Token(
29443
- B + "_open",
29442
+ const E = "paragraph", f = new Token(
29443
+ E + "_open",
29444
29444
  "p",
29445
29445
  NESTING_OPENING
29446
29446
  );
@@ -29460,7 +29460,7 @@ function treeToTokens(t, e, A) {
29460
29460
  y.map = m, y.meta = "noEscText", y.content = g.text?.replace(/\s+$/, "") ?? "", s(y, "txt5");
29461
29461
  }
29462
29462
  const p = new Token(
29463
- B + "_close",
29463
+ E + "_close",
29464
29464
  "p",
29465
29465
  NESTING_CLOSING
29466
29466
  );
@@ -29483,7 +29483,7 @@ function treeToTokens(t, e, A) {
29483
29483
  "tr",
29484
29484
  NESTING_OPENING
29485
29485
  );
29486
- h.level = r, n.push(h), r++, g.children.filter((B) => !!B).filter((B) => B.type === "pipe_table_cell").forEach((B) => l(B, c)), r--;
29486
+ h.level = r, n.push(h), r++, g.children.filter((E) => !!E).filter((E) => E.type === "pipe_table_cell").forEach((E) => l(E, c)), r--;
29487
29487
  const u = new Token(
29488
29488
  "tr_close",
29489
29489
  "tr",
@@ -29500,25 +29500,25 @@ function treeToTokens(t, e, A) {
29500
29500
  NESTING_OPENING
29501
29501
  );
29502
29502
  h.level = r, h.attrSet("margin_before", "1"), n.push(h), r++;
29503
- const u = g.children.filter((p) => !!p).filter((p) => p.type === "pipe_table_delimiter_row"), B = [];
29503
+ const u = g.children.filter((p) => !!p).filter((p) => p.type === "pipe_table_delimiter_row"), E = [];
29504
29504
  if (u.length > 0) {
29505
29505
  const m = u[0].children.filter((y) => !!y).filter((y) => y.type === "pipe_table_delimiter_cell");
29506
29506
  for (let y = 0; y < m.length; y++)
29507
- m[y].children.filter((D) => !!D).find((D) => D.type === "pipe_table_align_right") ? B.push("right") : B.push("left");
29507
+ m[y].children.filter((D) => !!D).find((D) => D.type === "pipe_table_align_right") ? E.push("right") : E.push("left");
29508
29508
  }
29509
- const E = g.children.filter((p) => !!p).filter((p) => p.type === "pipe_table_header");
29510
- if (E.length > 0) {
29509
+ const B = g.children.filter((p) => !!p).filter((p) => p.type === "pipe_table_header");
29510
+ if (B.length > 0) {
29511
29511
  const p = "thead", m = "thead", y = new Token(
29512
29512
  p + "_open",
29513
29513
  m,
29514
29514
  NESTING_OPENING
29515
29515
  );
29516
- y.level = r, n.push(y), r++, E.forEach(
29516
+ y.level = r, n.push(y), r++, B.forEach(
29517
29517
  (D) => l(D, {
29518
29518
  ...c,
29519
29519
  tableRowType: "thead",
29520
29520
  cellNo: 0,
29521
- cellAlign: B
29521
+ cellAlign: E
29522
29522
  })
29523
29523
  ), r--;
29524
29524
  const w = new Token(
@@ -29533,7 +29533,7 @@ function treeToTokens(t, e, A) {
29533
29533
  (p) => l(p, {
29534
29534
  ...c,
29535
29535
  tableRowType: "tbody",
29536
- cellAlign: B
29536
+ cellAlign: E
29537
29537
  })
29538
29538
  ), r--), r--;
29539
29539
  const Q = new Token(
@@ -29552,20 +29552,20 @@ function treeToTokens(t, e, A) {
29552
29552
  const f = u.children.filter((p) => !!p).find((p) => p.type.startsWith("task_list_marker")), Q = u.children.filter((p) => !!p).find((p) => p.type.startsWith("list_marker_dot"));
29553
29553
  f ? (I = "task_list", d = "ul") : Q && (I = "ordered_list", d = "ol", h = (o(Q) || "").trim().replace(".", ""));
29554
29554
  }
29555
- const B = new Token(
29555
+ const E = new Token(
29556
29556
  I + "_open",
29557
29557
  d,
29558
29558
  NESTING_OPENING
29559
29559
  );
29560
- B.level = r, B.markup = d === "ol" ? "." : "*", B.attrSet("symbol", d === "ol" ? "1" : "*"), h && B.attrSet("start", h), B.attrSet("margin_before", "1"), n.push(B), r++, g.children.filter((f) => !!f).forEach(
29560
+ E.level = r, E.markup = d === "ol" ? "." : "*", E.attrSet("symbol", d === "ol" ? "1" : "*"), h && E.attrSet("start", h), E.attrSet("margin_before", "1"), n.push(E), r++, g.children.filter((f) => !!f).forEach(
29561
29561
  (f) => l(f, c)
29562
29562
  ), r--;
29563
- const E = new Token(
29563
+ const B = new Token(
29564
29564
  I + "_close",
29565
29565
  d,
29566
29566
  NESTING_CLOSING
29567
29567
  );
29568
- E.level = r, E.attrSet("margin_after", "1"), n.push(E);
29568
+ B.level = r, B.attrSet("margin_after", "1"), n.push(B);
29569
29569
  }
29570
29570
  break;
29571
29571
  case "list_item":
@@ -29574,20 +29574,20 @@ function treeToTokens(t, e, A) {
29574
29574
  if (!d)
29575
29575
  break;
29576
29576
  let h = I ? "task_item" : "list_item";
29577
- const u = "li", B = new Token(
29577
+ const u = "li", E = new Token(
29578
29578
  h + "_open",
29579
29579
  u,
29580
29580
  NESTING_OPENING
29581
29581
  );
29582
- B.level = r, B.markup = (o(d) || "").trim(), d.type === "list_marker_dot" && (B.info = "", B.markup = ""), I && (I.type, B.attrSet(
29582
+ E.level = r, E.markup = (o(d) || "").trim(), d.type === "list_marker_dot" && (E.info = "", E.markup = ""), I && (I.type, E.attrSet(
29583
29583
  "checked",
29584
29584
  I.type === "task_list_marker_checked" ? "checked" : ""
29585
- )), n.push(B), r++, l(
29585
+ )), n.push(E), r++, l(
29586
29586
  g.children.filter((Q) => !!Q).find((Q) => Q.type === "paragraph"),
29587
29587
  c
29588
29588
  );
29589
- const E = g.children.filter((Q) => !!Q).filter((Q) => Q.type === "list");
29590
- for (const Q of E)
29589
+ const B = g.children.filter((Q) => !!Q).filter((Q) => Q.type === "list");
29590
+ for (const Q of B)
29591
29591
  l(Q, c);
29592
29592
  r--;
29593
29593
  const f = new Token(
@@ -29761,26 +29761,26 @@ const addEmptyLines = (t, e) => {
29761
29761
  for (let h = 0; h < a.length; h++) {
29762
29762
  const u = a[h];
29763
29763
  if (["image", "node_bookmark"].includes(u.type.name) && h > 0) {
29764
- const B = a[h - 1];
29765
- if (B.type !== o) if (B.type === r)
29764
+ const E = a[h - 1];
29765
+ if (E.type !== o) if (E.type === r)
29766
29766
  n.setNodeMarkup(
29767
- n.mapping.map(g + I - B.nodeSize),
29767
+ n.mapping.map(g + I - E.nodeSize),
29768
29768
  o
29769
29769
  );
29770
29770
  else {
29771
- const E = o.createAndFill();
29772
- E && n.insert(
29771
+ const B = o.createAndFill();
29772
+ B && n.insert(
29773
29773
  n.mapping.map(g + I),
29774
- E
29774
+ B
29775
29775
  );
29776
29776
  }
29777
29777
  }
29778
29778
  if (u.type.name === "softbreak") {
29779
- const B = a[h - 1];
29780
- a[h + 1], B?.type.name === "softbreak" && n.delete(
29779
+ const E = a[h - 1];
29780
+ a[h + 1], E?.type.name === "softbreak" && n.delete(
29781
29781
  n.mapping.map(g + I),
29782
29782
  n.mapping.map(g + I + u.nodeSize)
29783
- ), B?.textContent?.endsWith(" ") && n.delete(
29783
+ ), E?.textContent?.endsWith(" ") && n.delete(
29784
29784
  n.mapping.map(g + I),
29785
29785
  n.mapping.map(g + I + u.nodeSize)
29786
29786
  ), d || n.delete(
@@ -29884,20 +29884,20 @@ const addEmptyLines = (t, e) => {
29884
29884
  const I = l.attrs.href, d = {}, h = await t(I, {
29885
29885
  type: "A",
29886
29886
  dest: "md",
29887
- setMeta: (u, B) => {
29888
- d[u] = B;
29887
+ setMeta: (u, E) => {
29888
+ d[u] = E;
29889
29889
  }
29890
29890
  });
29891
29891
  if (h !== I || d.mdTemplate) {
29892
29892
  const u = d.mdTemplate;
29893
29893
  n.removeMark(n.mapping.map(g), n.mapping.map(c), l);
29894
- const B = e.schema.mark("link", {
29894
+ const E = e.schema.mark("link", {
29895
29895
  ...l.attrs,
29896
29896
  href: h,
29897
29897
  origUrl: I,
29898
29898
  mdTemplate: u
29899
29899
  });
29900
- n.addMark(n.mapping.map(g), n.mapping.map(c), B);
29900
+ n.addMark(n.mapping.map(g), n.mapping.map(c), E);
29901
29901
  }
29902
29902
  }
29903
29903
  for (const [l, g] of a) {
@@ -29925,9 +29925,9 @@ const addEmptyLines = (t, e) => {
29925
29925
  let h = 0;
29926
29926
  if (c.type.name === "code_block" && c.textContent.trim())
29927
29927
  return;
29928
- function u(E, f) {
29928
+ function u(B, f) {
29929
29929
  let Q = I + f;
29930
- for (let p = E - 1; p >= 0; p--) {
29930
+ for (let p = B - 1; p >= 0; p--) {
29931
29931
  const m = g[p];
29932
29932
  if (m?.type.name !== "text")
29933
29933
  break;
@@ -29945,12 +29945,12 @@ const addEmptyLines = (t, e) => {
29945
29945
  break;
29946
29946
  }
29947
29947
  }
29948
- let B = !1;
29949
- for (let E = 0; E < g.length; E++) {
29950
- const f = g[E];
29948
+ let E = !1;
29949
+ for (let B = 0; B < g.length; B++) {
29950
+ const f = g[B];
29951
29951
  if (f.isText) {
29952
29952
  let Q = f.text || "";
29953
- if (Q.match(/^([ \t\u00A0]+)/) && !B && a !== c.type) {
29953
+ if (Q.match(/^([ \t\u00A0]+)/) && !E && a !== c.type) {
29954
29954
  Q = Q.replace(/^[ \t\u00A0]+/, "");
29955
29955
  const p = I + h, m = p + f.nodeSize;
29956
29956
  Q ? r.replaceRangeWith(
@@ -29959,9 +29959,9 @@ const addEmptyLines = (t, e) => {
29959
29959
  n.text(Q)
29960
29960
  ) : r.replace(r.mapping.map(p), r.mapping.map(m));
29961
29961
  }
29962
- Q && (B = !0);
29962
+ Q && (E = !0);
29963
29963
  }
29964
- o === f.type && (u(E, h), E + 1 < g.length && (g[E + 1].type === o || g[E + 1].type === s) && r.setNodeMarkup(r.mapping.map(I + h), s)), l(f.children, f, I + h + 1, d + 1), h += f.nodeSize;
29964
+ o === f.type && (u(B, h), B + 1 < g.length && (g[B + 1].type === o || g[B + 1].type === s) && r.setNodeMarkup(r.mapping.map(I + h), s)), l(f.children, f, I + h + 1, d + 1), h += f.nodeSize;
29965
29965
  }
29966
29966
  u(g.length, h);
29967
29967
  }
@@ -30012,8 +30012,8 @@ const addEmptyLines = (t, e) => {
30012
30012
  if (u.type !== r)
30013
30013
  break;
30014
30014
  d -= u.nodeSize;
30015
- const B = g + d, E = B + u.nodeSize;
30016
- n.replace(n.mapping.map(B), n.mapping.map(E));
30015
+ const E = g + d, B = E + u.nodeSize;
30016
+ n.replace(n.mapping.map(E), n.mapping.map(B));
30017
30017
  }
30018
30018
  return;
30019
30019
  }
@@ -30271,11 +30271,6 @@ const icons = {
30271
30271
  width: 24,
30272
30272
  height: 24,
30273
30273
  path: "M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zm0-6v2h18V3H3z"
30274
- },
30275
- folderOpen: {
30276
- width: 24,
30277
- height: 24,
30278
- path: "M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"
30279
30274
  }
30280
30275
  };
30281
30276
  class MenuItem {
@@ -30543,131 +30538,105 @@ function markActive(t, e) {
30543
30538
  return o ? !!e.isInSet(t.storedMarks || n.marks()) : t.doc.rangeHasMark(A, r, e);
30544
30539
  }
30545
30540
  function buildMenu(t, e) {
30546
- function A(E, f) {
30547
- let Q = {
30548
- active(p) {
30549
- return markActive(p, E);
30541
+ function A(E, B) {
30542
+ let f = {
30543
+ active(Q) {
30544
+ return markActive(Q, E);
30550
30545
  }
30551
30546
  };
30552
- for (let p in f)
30553
- Q[p] = f[p];
30554
- return cmdItem(t.commandFactories.toggleMark(E), Q);
30555
- }
30556
- function n(E, f) {
30557
- let Q = {
30558
- run(p, m) {
30559
- return t.commandFactories.wrapIn(E, f.attrs).apply({
30547
+ for (let Q in B)
30548
+ f[Q] = B[Q];
30549
+ return cmdItem(t.commandFactories.toggleMark(E), f);
30550
+ }
30551
+ function n(E, B) {
30552
+ let f = {
30553
+ run(Q, p) {
30554
+ return t.commandFactories.wrapIn(E, B.attrs).apply({
30560
30555
  editor: t
30561
- }, [p, m]);
30556
+ }, [Q, p]);
30562
30557
  },
30563
- select(p) {
30564
- return t.commandFactories.wrapIn(E, f.attrs).apply({
30558
+ select(Q) {
30559
+ return t.commandFactories.wrapIn(E, B.attrs).apply({
30565
30560
  editor: t
30566
- }, [p]);
30561
+ }, [Q]);
30567
30562
  }
30568
30563
  };
30569
- for (let p in f)
30570
- Q[p] = f[p];
30571
- return new MenuItem(Q);
30572
- }
30573
- function r(E, f) {
30574
- let Q = t.commandFactories.setBlockType(E, f.attrs), p = {
30575
- run: Q,
30576
- enable(m) {
30577
- return Q.apply({ editor: t }, [m]);
30564
+ for (let Q in B)
30565
+ f[Q] = B[Q];
30566
+ return new MenuItem(f);
30567
+ }
30568
+ function r(E, B) {
30569
+ let f = t.commandFactories.setBlockType(E, B.attrs), Q = {
30570
+ run: f,
30571
+ enable(p) {
30572
+ return f.apply({ editor: t }, [p]);
30578
30573
  },
30579
- active(m) {
30580
- let { $from: y, to: w, node: D } = m.selection;
30581
- return D ? D.hasMarkup(E, f.attrs) : w <= y.end() && y.parent.hasMarkup(E, f.attrs);
30574
+ active(p) {
30575
+ let { $from: m, to: y, node: w } = p.selection;
30576
+ return w ? w.hasMarkup(E, B.attrs) : y <= m.end() && m.parent.hasMarkup(E, B.attrs);
30582
30577
  }
30583
30578
  };
30584
- for (let m in f)
30585
- p[m] = f[m];
30586
- return new MenuItem(p);
30579
+ for (let p in B)
30580
+ Q[p] = B[p];
30581
+ return new MenuItem(Q);
30587
30582
  }
30588
30583
  const o = [];
30589
30584
  o.push(
30590
- new MenuItem({
30591
- title: "Load document",
30592
- icon: icons.folderOpen,
30593
- run() {
30594
- const E = document.createElement("input");
30595
- return E.type = "file", E.accept = ".odt,application/vnd.oasis.opendocument.text,.md,text/markdown,text/x-markdown", E.onchange = async (f) => {
30596
- const Q = f.target.files?.[0];
30597
- if (Q)
30598
- try {
30599
- const p = await Q.arrayBuffer();
30600
- let m = Q.type;
30601
- if (!m || m === "") {
30602
- const y = Q.name.split(".").pop()?.toLowerCase();
30603
- y === "odt" ? m = "application/vnd.oasis.opendocument.text" : y === "md" && (m = "text/x-markdown");
30604
- }
30605
- m ? await t.loadDocument(m, new Uint8Array(p)) : console.error("Could not determine file type for:", Q.name);
30606
- } catch (p) {
30607
- console.error("Failed to load document:", p);
30608
- }
30609
- }, E.click(), !0;
30610
- },
30611
- enable: () => !0
30612
- })
30613
- );
30614
- const s = [];
30615
- s.push(
30616
30585
  new MenuItem({
30617
30586
  title: "Undo last change",
30618
- run: (E, f) => {
30619
- const Q = t.commandFactories.undo?.();
30620
- return Q ? Q.apply({ editor: t }, [E, f]) : !1;
30587
+ run: (E, B) => {
30588
+ const f = t.commandFactories.undo?.();
30589
+ return f ? f.apply({ editor: t }, [E, B]) : !1;
30621
30590
  },
30622
30591
  enable: (E) => {
30623
- const f = t.commandFactories.undo?.();
30624
- return f ? f.apply({ editor: t }, [E]) : !1;
30592
+ const B = t.commandFactories.undo?.();
30593
+ return B ? B.apply({ editor: t }, [E]) : !1;
30625
30594
  },
30626
30595
  icon: icons.undo
30627
30596
  })
30628
- ), s.push(
30597
+ ), o.push(
30629
30598
  new MenuItem({
30630
30599
  title: "Redo last undone change",
30631
- run: (E, f) => {
30632
- const Q = t.commandFactories.redo?.();
30633
- return Q ? Q.apply({ editor: t }, [E, f]) : !1;
30600
+ run: (E, B) => {
30601
+ const f = t.commandFactories.redo?.();
30602
+ return f ? f.apply({ editor: t }, [E, B]) : !1;
30634
30603
  },
30635
30604
  enable: (E) => {
30636
- const f = t.commandFactories.redo?.();
30637
- return f ? f.apply({ editor: t }, [E]) : !1;
30605
+ const B = t.commandFactories.redo?.();
30606
+ return B ? B.apply({ editor: t }, [E]) : !1;
30638
30607
  },
30639
30608
  icon: icons.redo
30640
30609
  })
30641
30610
  );
30642
- const a = [], l = [];
30643
- if (e.nodes.paragraph && l.push(r(e.nodes.paragraph, {
30611
+ const s = [], a = [];
30612
+ if (e.nodes.paragraph && a.push(r(e.nodes.paragraph, {
30644
30613
  title: "Change to paragraph",
30645
30614
  label: "Plain"
30646
- })), e.nodes.code_block && l.push(r(e.nodes.code_block, {
30615
+ })), e.nodes.code_block && a.push(r(e.nodes.code_block, {
30647
30616
  title: "Change to code block",
30648
30617
  label: "Code"
30649
- })), l.length > 0 && a.push(
30650
- new Dropdown(l, {
30618
+ })), a.length > 0 && s.push(
30619
+ new Dropdown(a, {
30651
30620
  label: "Type",
30652
30621
  icon: icons.type
30653
30622
  })
30654
30623
  ), e.nodes.heading) {
30655
30624
  const E = [];
30656
- for (let f = 1; f <= 6; f++)
30625
+ for (let B = 1; B <= 6; B++)
30657
30626
  E.push(r(e.nodes.heading, {
30658
- title: "Change to heading " + f,
30659
- label: "Heading " + f,
30660
- attrs: { level: f }
30627
+ title: "Change to heading " + B,
30628
+ label: "Heading " + B,
30629
+ attrs: { level: B }
30661
30630
  }));
30662
- a.push(
30631
+ s.push(
30663
30632
  new Dropdown(E, {
30664
30633
  label: "Heading",
30665
30634
  icon: icons.heading
30666
30635
  })
30667
30636
  );
30668
30637
  }
30669
- const g = [];
30670
- e.nodes.bullet_list && g.push(
30638
+ const l = [];
30639
+ e.nodes.bullet_list && l.push(
30671
30640
  cmdItem(
30672
30641
  t.commandFactories.toggleBulletList(),
30673
30642
  {
@@ -30676,7 +30645,7 @@ function buildMenu(t, e) {
30676
30645
  icon: icons.bulletList
30677
30646
  }
30678
30647
  )
30679
- ), e.nodes.ordered_list && g.push(
30648
+ ), e.nodes.ordered_list && l.push(
30680
30649
  cmdItem(
30681
30650
  t.commandFactories.toggleOrderedList(),
30682
30651
  {
@@ -30685,7 +30654,7 @@ function buildMenu(t, e) {
30685
30654
  icon: icons.orderedList
30686
30655
  }
30687
30656
  )
30688
- ), e.nodes.task_list && g.push(
30657
+ ), e.nodes.task_list && l.push(
30689
30658
  cmdItem(
30690
30659
  t.commandFactories.toggleTaskList(),
30691
30660
  {
@@ -30694,69 +30663,69 @@ function buildMenu(t, e) {
30694
30663
  icon: icons.taskList
30695
30664
  }
30696
30665
  )
30697
- ), g.length > 0 && a.push(
30698
- new Dropdown(g, {
30666
+ ), l.length > 0 && s.push(
30667
+ new Dropdown(l, {
30699
30668
  label: "Lists",
30700
30669
  icon: icons.bulletList
30701
30670
  })
30702
- ), a.push(
30671
+ ), s.push(
30703
30672
  new MenuItem({
30704
30673
  title: "Lift out of enclosing block",
30705
30674
  run: () => t.chain().lift().run(),
30706
30675
  select: () => t.can().lift().run(),
30707
30676
  icon: icons.outdent
30708
30677
  })
30709
- ), e.nodes.blockquote && a.push(n(e.nodes.blockquote, {
30678
+ ), e.nodes.blockquote && s.push(n(e.nodes.blockquote, {
30710
30679
  title: "Wrap in block quote",
30711
30680
  icon: icons.blockquote
30712
30681
  }));
30713
- const c = [];
30714
- if (e.marks.strong && c.push(
30682
+ const g = [];
30683
+ if (e.marks.strong && g.push(
30715
30684
  new MenuItem({
30716
30685
  title: "Toggle bold",
30717
30686
  run: () => t.chain().toggleStrong().run(),
30718
30687
  enable: (E) => t.can().toggleStrong().run(),
30719
30688
  icon: icons.strong
30720
30689
  })
30721
- ), e.marks.em && c.push(
30690
+ ), e.marks.em && g.push(
30722
30691
  new MenuItem({
30723
30692
  title: "Toggle italic",
30724
30693
  run: () => t.chain().toggleItalic().run(),
30725
30694
  enable: (E) => t.can().toggleItalic().run(),
30726
30695
  icon: icons.em
30727
30696
  })
30728
- ), e.marks.strike && c.push(A(e.marks.strike, {
30697
+ ), e.marks.strike && g.push(A(e.marks.strike, {
30729
30698
  title: "Toggle strikethrough",
30730
30699
  icon: icons.strike
30731
- })), e.marks.code && c.push(A(e.marks.code, {
30700
+ })), e.marks.code && g.push(A(e.marks.code, {
30732
30701
  title: "Toggle code font",
30733
30702
  icon: icons.code
30734
- })), e.marks.underline && c.push(
30703
+ })), e.marks.underline && g.push(
30735
30704
  new MenuItem({
30736
30705
  title: "Toggle underline",
30737
30706
  run: () => t.chain().toggleUnderline().run(),
30738
30707
  enable: (E) => t.can().toggleUnderline().run(),
30739
30708
  icon: icons.underline
30740
30709
  })
30741
- ), e.marks.highlight && c.push(A(e.marks.highlight, {
30710
+ ), e.marks.highlight && g.push(A(e.marks.highlight, {
30742
30711
  title: "Toggle highlight",
30743
30712
  icon: icons.highlight
30744
30713
  })), e.marks.link) {
30745
30714
  const E = e.marks.link;
30746
- c.push(
30715
+ g.push(
30747
30716
  new MenuItem({
30748
30717
  title: "Add or remove link",
30749
30718
  icon: icons.link,
30750
- active(f) {
30751
- return markActive(f, E);
30719
+ active(B) {
30720
+ return markActive(B, E);
30752
30721
  },
30753
- enable(f) {
30754
- return !f.selection.empty;
30722
+ enable(B) {
30723
+ return !B.selection.empty;
30755
30724
  },
30756
- run(f, Q) {
30757
- return markActive(f, E) ? (t.commandFactories.toggleMark(E).apply({ editor: t }, [
30758
- f,
30759
- Q
30725
+ run(B, f) {
30726
+ return markActive(B, E) ? (t.commandFactories.toggleMark(E).apply({ editor: t }, [
30727
+ B,
30728
+ f
30760
30729
  ]), !0) : (openPrompt({
30761
30730
  title: "Create a link",
30762
30731
  fields: {
@@ -30766,8 +30735,8 @@ function buildMenu(t, e) {
30766
30735
  }),
30767
30736
  title: new TextField({ label: "Title" })
30768
30737
  },
30769
- callback(p) {
30770
- t.commandFactories.toggleMark(E, p).apply({
30738
+ callback(Q) {
30739
+ t.commandFactories.toggleMark(E, Q).apply({
30771
30740
  editor: t
30772
30741
  }, [
30773
30742
  t.view.state,
@@ -30779,37 +30748,37 @@ function buildMenu(t, e) {
30779
30748
  })
30780
30749
  );
30781
30750
  }
30782
- const I = [];
30783
- e.marks.superscript && I.push(A(e.marks.superscript, {
30751
+ const c = [];
30752
+ e.marks.superscript && c.push(A(e.marks.superscript, {
30784
30753
  title: "Toggle superscript",
30785
30754
  icon: icons.superscript
30786
- })), e.marks.subscript && I.push(A(e.marks.subscript, {
30755
+ })), e.marks.subscript && c.push(A(e.marks.subscript, {
30787
30756
  title: "Toggle subscript",
30788
30757
  icon: icons.subscript
30789
30758
  }));
30790
- const d = [];
30791
- e.nodes.paragraph?.spec?.attrs?.textAlign !== void 0 && (d.push(
30759
+ const I = [];
30760
+ e.nodes.paragraph?.spec?.attrs?.textAlign !== void 0 && (I.push(
30792
30761
  new MenuItem({
30793
30762
  title: "Align left",
30794
30763
  icon: icons.alignLeft,
30795
30764
  run: () => t.chain().setTextAlignLeft().run(),
30796
30765
  enable: () => t.can().setTextAlignLeft().run()
30797
30766
  })
30798
- ), d.push(
30767
+ ), I.push(
30799
30768
  new MenuItem({
30800
30769
  title: "Align center",
30801
30770
  icon: icons.alignCenter,
30802
30771
  run: () => t.chain().setTextAlignCenter().run(),
30803
30772
  enable: () => t.can().setTextAlignCenter().run()
30804
30773
  })
30805
- ), d.push(
30774
+ ), I.push(
30806
30775
  new MenuItem({
30807
30776
  title: "Align right",
30808
30777
  icon: icons.alignRight,
30809
30778
  run: () => t.chain().setTextAlignRight().run(),
30810
30779
  enable: () => t.can().setTextAlignRight().run()
30811
30780
  })
30812
- ), d.push(
30781
+ ), I.push(
30813
30782
  new MenuItem({
30814
30783
  title: "Justify",
30815
30784
  icon: icons.alignJustify,
@@ -30817,37 +30786,37 @@ function buildMenu(t, e) {
30817
30786
  enable: () => t.can().setTextAlignJustify().run()
30818
30787
  })
30819
30788
  ));
30820
- const h = [];
30789
+ const d = [];
30821
30790
  if (e.nodes.image) {
30822
30791
  const E = e.nodes.image;
30823
- h.push(
30792
+ d.push(
30824
30793
  new MenuItem({
30825
30794
  title: "Insert image",
30826
30795
  icon: icons.image,
30827
- enable: (f) => canInsert(f, E),
30828
- run(f, Q) {
30829
- let { from: p, to: m } = f.selection, y = null;
30830
- return f.selection instanceof NodeSelection && f.selection.node.type == E && (y = f.selection.node.attrs), openPrompt({
30796
+ enable: (B) => canInsert(B, E),
30797
+ run(B, f) {
30798
+ let { from: Q, to: p } = B.selection, m = null;
30799
+ return B.selection instanceof NodeSelection && B.selection.node.type == E && (m = B.selection.node.attrs), openPrompt({
30831
30800
  title: "Insert image",
30832
30801
  fields: {
30833
30802
  src: new FileField({
30834
30803
  label: "Choose image",
30835
30804
  required: !0,
30836
- value: y && y.src
30805
+ value: m && m.src
30837
30806
  }),
30838
30807
  title: new TextField({
30839
30808
  label: "Title",
30840
- value: y && y.title
30809
+ value: m && m.title
30841
30810
  }),
30842
30811
  alt: new TextField({
30843
30812
  label: "Description",
30844
- value: y ? y.alt : f.doc.textBetween(p, m, " ")
30813
+ value: m ? m.alt : B.doc.textBetween(Q, p, " ")
30845
30814
  })
30846
30815
  },
30847
- callback(w) {
30816
+ callback(y) {
30848
30817
  t.view.dispatch(
30849
30818
  t.view.state.tr.replaceSelectionWith(
30850
- E.createAndFill(w)
30819
+ E.createAndFill(y)
30851
30820
  )
30852
30821
  ), t.view.focus();
30853
30822
  }
@@ -30856,7 +30825,7 @@ function buildMenu(t, e) {
30856
30825
  })
30857
30826
  );
30858
30827
  }
30859
- if (e.nodes.hr && h.push(
30828
+ if (e.nodes.hr && d.push(
30860
30829
  new MenuItem({
30861
30830
  title: "Insert horizontal rule",
30862
30831
  icon: icons.horizontalRule,
@@ -30864,11 +30833,11 @@ function buildMenu(t, e) {
30864
30833
  enable: (E) => t.can().setHorizontalRule().run()
30865
30834
  })
30866
30835
  ), e.nodes.table) {
30867
- const E = (Q, p) => new MenuItem({
30868
- label: Q,
30869
- enable: () => t.can()[p]().run(),
30870
- run: () => t.chain()[p]().run()
30871
- }), f = [
30836
+ const E = (f, Q) => new MenuItem({
30837
+ label: f,
30838
+ enable: () => t.can()[Q]().run(),
30839
+ run: () => t.chain()[Q]().run()
30840
+ }), B = [
30872
30841
  E("Insert table", "insertTable"),
30873
30842
  E("Insert column before", "addColumnBefore"),
30874
30843
  E("Insert column after", "addColumnAfter"),
@@ -30883,12 +30852,12 @@ function buildMenu(t, e) {
30883
30852
  E("Toggle header row", "toggleHeaderRow"),
30884
30853
  E("Toggle header cells", "toggleHeaderCell")
30885
30854
  ];
30886
- h.push(
30887
- new Dropdown(f, { label: "Table", icon: icons.table })
30855
+ d.push(
30856
+ new Dropdown(B, { label: "Table", icon: icons.table })
30888
30857
  );
30889
30858
  }
30890
- const u = [];
30891
- return u.push(
30859
+ const h = [];
30860
+ return h.push(
30892
30861
  new MenuItem({
30893
30862
  title: "Select parent node",
30894
30863
  run: () => t.chain().selectParentNode().run(),
@@ -30897,27 +30866,25 @@ function buildMenu(t, e) {
30897
30866
  })
30898
30867
  ), [
30899
30868
  o,
30900
- // Load Document
30901
- s,
30902
30869
  // Undo, Redo
30903
- a,
30870
+ s,
30904
30871
  // Heading, Lift, Join, Blockquote
30905
- c,
30872
+ g,
30906
30873
  // Bold, Italic, Strikethrough, Code, Underline, Highlight, Link
30907
- I,
30874
+ c,
30908
30875
  // Superscript, Subscript
30909
- d,
30876
+ I,
30910
30877
  // Align left, center, right, Justify
30911
- h,
30878
+ d,
30912
30879
  // Image, Lists, HR, Table, Type
30913
- u
30880
+ h
30914
30881
  // Select parent node
30915
30882
  ].filter((E) => E.length > 0);
30916
30883
  }
30917
30884
  const CSS_PREFIX$1 = "kb-custom-menu", STORAGE_KEY = "kb-custom-menu-order", OVERFLOW_BUTTON_WIDTH = 48, DRAG_START_DELAY = 2e3;
30918
30885
  class CustomMenuView {
30919
30886
  constructor(e, A, n) {
30920
- this.editorView = e, this.editor = A, this.content = n, this.pinnedDropdownMenu = null, this.tools = [], this.closeOverflowHandler = null, this.closePinnedDropdownHandler = null, this.keydownHandler = null, this.submenuStack = [], this.pinnedDropdownStack = [], this.resizeObserver = null, this.draggedItem = null, this.dragStartTimer = null, this.isDragging = !1, this.isDraggingFromOverflow = !1, this.dragPlaceholder = null, this.dragGhost = null, this.dragSourceWrapper = null, this.currentOverflowTools = [], this.defaultOrder = [], this.focusedToolbarIndex = -1, this.root = e.root, this.wrapper = document.createElement("div"), this.wrapper.classList.add(CSS_PREFIX$1 + "__wrapper"), this.toolbar = document.createElement("div"), this.toolbar.classList.add(CSS_PREFIX$1), this.toolbar.setAttribute("role", "toolbar"), this.editorContainer = document.createElement("div"), this.editorContainer.classList.add(CSS_PREFIX$1 + "__editor-container"), this.editorContainer.style.height = "50vh", this.resizeHandle = document.createElement("div"), this.resizeHandle.classList.add(CSS_PREFIX$1 + "__resize-handle"), this.resizeHandle.innerHTML = '<div class="' + CSS_PREFIX$1 + '__resize-handle-bar"></div>', this.wrapper.appendChild(this.toolbar), e.dom.parentNode && e.dom.parentNode.replaceChild(this.wrapper, e.dom), this.editorContainer.appendChild(e.dom), this.editorContainer.appendChild(this.resizeHandle), this.wrapper.appendChild(this.editorContainer), this.overflowMenu = document.createElement("div"), this.overflowMenu.classList.add(CSS_PREFIX$1 + "__overflow-menu"), this.overflowMenu.style.display = "none", this.wrapper.insertBefore(this.overflowMenu, this.editorContainer), this.initializeTools(), this.loadOrderState(), this.setupResize(), this.render(), typeof ResizeObserver < "u" && (this.resizeObserver = new ResizeObserver(() => {
30887
+ this.editorView = e, this.editor = A, this.content = n, this.pinnedDropdownMenu = null, this.tools = [], this.closeOverflowHandler = null, this.closePinnedDropdownHandler = null, this.keydownHandler = null, this.submenuStack = [], this.pinnedDropdownStack = [], this.resizeObserver = null, this.draggedItem = null, this.dragStartTimer = null, this.isDragging = !1, this.isDraggingFromOverflow = !1, this.dragPlaceholder = null, this.dragGhost = null, this.dragSourceWrapper = null, this.currentOverflowTools = [], this.defaultOrder = [], this.root = e.root, this.wrapper = document.createElement("div"), this.wrapper.classList.add(CSS_PREFIX$1 + "__wrapper"), this.toolbar = document.createElement("div"), this.toolbar.classList.add(CSS_PREFIX$1), this.toolbar.setAttribute("role", "toolbar"), this.wrapper.appendChild(this.toolbar), e.dom.parentNode && e.dom.parentNode.replaceChild(this.wrapper, e.dom), this.wrapper.appendChild(e.dom), this.overflowMenu = document.createElement("div"), this.overflowMenu.classList.add(CSS_PREFIX$1 + "__overflow-menu"), this.overflowMenu.style.display = "none", this.wrapper.insertBefore(this.overflowMenu, e.dom), e.dom.classList.add("kb-custom-menu__editor"), this.initializeTools(), this.loadOrderState(), this.render(), typeof ResizeObserver < "u" && (this.resizeObserver = new ResizeObserver(() => {
30921
30888
  this.render();
30922
30889
  }), this.resizeObserver.observe(this.toolbar)), this.setupKeyboardNavigation();
30923
30890
  }
@@ -31239,8 +31206,8 @@ class CustomMenuView {
31239
31206
  } else {
31240
31207
  const { dom: c } = a.element.render(this.editorView);
31241
31208
  c.querySelectorAll("span").forEach((h) => {
31242
- const u = h.closest(".kb-icon") !== null, B = h.parentElement === c;
31243
- h.textContent && h.textContent.trim() && !u && B && !h.querySelector("svg") && !h.classList.contains("kb-icon") && (h.style.display = "none");
31209
+ const u = h.closest(".kb-icon") !== null, E = h.parentElement === c;
31210
+ h.textContent && h.textContent.trim() && !u && E && !h.querySelector("svg") && !h.classList.contains("kb-icon") && (h.style.display = "none");
31244
31211
  });
31245
31212
  const d = document.createElement("span");
31246
31213
  d.classList.add(CSS_PREFIX$1 + "__overflow-item-label"), d.textContent = a.label, g.appendChild(c), g.appendChild(d), g.addEventListener("mousedown", (h) => {
@@ -31301,22 +31268,22 @@ class CustomMenuView {
31301
31268
  h.classList.add(CSS_PREFIX$1 + "__overflow-item-label"), h.textContent = a.label, g.appendChild(c), g.appendChild(h), g.addEventListener("mousedown", (u) => {
31302
31269
  if (u.target !== c) {
31303
31270
  u.preventDefault();
31304
- const B = new MouseEvent("mousedown", {
31271
+ const E = new MouseEvent("mousedown", {
31305
31272
  bubbles: !0,
31306
31273
  cancelable: !0,
31307
31274
  view: window
31308
31275
  });
31309
- c.dispatchEvent(B);
31276
+ c.dispatchEvent(E);
31310
31277
  }
31311
31278
  }), g.addEventListener("keydown", (u) => {
31312
31279
  if (u.key === "Enter" || u.key === " ") {
31313
31280
  u.preventDefault();
31314
- const B = new MouseEvent("mousedown", {
31281
+ const E = new MouseEvent("mousedown", {
31315
31282
  bubbles: !0,
31316
31283
  cancelable: !0,
31317
31284
  view: window
31318
31285
  });
31319
- c.dispatchEvent(B);
31286
+ c.dispatchEvent(E);
31320
31287
  }
31321
31288
  });
31322
31289
  }
@@ -31347,7 +31314,7 @@ class CustomMenuView {
31347
31314
  const { dom: l, update: g } = o.element.render(this.editorView);
31348
31315
  l.querySelectorAll("span").forEach((I) => {
31349
31316
  !(I.closest(".kb-icon") !== null) && !I.querySelector("svg") && (I.style.display = "none");
31350
- }), l.style.pointerEvents = "none", a.appendChild(l), a.dataset.hasButton = "true", a._buttonDom = l, a.addEventListener("keydown", (I) => {
31317
+ }), l.style.pointerEvents = "none", a.appendChild(l), a.addEventListener("keydown", (I) => {
31351
31318
  (I.key === "Enter" || I.key === " ") && (I.preventDefault(), this.closeAllMenus(), requestAnimationFrame(() => {
31352
31319
  const d = o.element;
31353
31320
  d.spec && typeof d.spec.run == "function" && d.spec.run(
@@ -31373,11 +31340,11 @@ class CustomMenuView {
31373
31340
  this.tools.forEach((I) => {
31374
31341
  const d = document.createElement("span");
31375
31342
  if (d.classList.add(CSS_PREFIX$1 + "__item"), d.setAttribute("data-tool-id", I.id), d.setAttribute("draggable", "false"), I.element.content !== void 0) {
31376
- const { dom: B } = I.element.render(this.editorView), E = B.querySelector(".kb-dropdown__content");
31377
- E && (E.style.display = "none"), d.appendChild(B);
31343
+ const { dom: E } = I.element.render(this.editorView), B = E.querySelector(".kb-dropdown__content");
31344
+ B && (B.style.display = "none"), d.appendChild(E);
31378
31345
  } else {
31379
- const { dom: B } = I.element.render(this.editorView);
31380
- d.appendChild(B);
31346
+ const { dom: E } = I.element.render(this.editorView);
31347
+ d.appendChild(E);
31381
31348
  }
31382
31349
  this.toolbar.appendChild(d);
31383
31350
  const u = d.getBoundingClientRect().width;
@@ -31398,7 +31365,7 @@ class CustomMenuView {
31398
31365
  u.classList.add(CSS_PREFIX$1 + "__separator"), this.toolbar.appendChild(u);
31399
31366
  }
31400
31367
  if (c = I.groupIndex, I.element.content !== void 0) {
31401
- const u = d.querySelector("button"), B = d.querySelector(".kb-dropdown__label"), E = (Q) => {
31368
+ const u = d.querySelector("button"), E = d.querySelector(".kb-dropdown__label"), B = (Q) => {
31402
31369
  if (this.isDragging) {
31403
31370
  Q.preventDefault(), Q.stopPropagation(), Q.stopImmediatePropagation();
31404
31371
  return;
@@ -31407,9 +31374,9 @@ class CustomMenuView {
31407
31374
  }, f = (Q) => {
31408
31375
  Q.stopImmediatePropagation(), this.isDragging && Q.stopPropagation();
31409
31376
  };
31410
- u && (u.addEventListener("click", E, { capture: !0 }), u.addEventListener("mousedown", f, {
31377
+ u && (u.addEventListener("click", B, { capture: !0 }), u.addEventListener("mousedown", f, {
31411
31378
  capture: !0
31412
- })), B && (B.addEventListener("click", E, { capture: !0 }), B.addEventListener("mousedown", f, {
31379
+ })), E && (E.addEventListener("click", B, { capture: !0 }), E.addEventListener("mousedown", f, {
31413
31380
  capture: !0
31414
31381
  }));
31415
31382
  }
@@ -31432,9 +31399,9 @@ class CustomMenuView {
31432
31399
  this.overflowMenu.style.display = h ? "none" : "block", I.setAttribute("aria-expanded", String(!h));
31433
31400
  const u = this.editorView.dom.ownerDocument || document;
31434
31401
  h ? (this.closeOverflowHandler && u.removeEventListener("click", this.closeOverflowHandler), this.submenuStack = []) : (this.submenuStack = [], this.renderOverflowMenu(), setTimeout(() => {
31435
- this.closeOverflowHandler && u.removeEventListener("click", this.closeOverflowHandler), this.closeOverflowHandler = (B) => {
31436
- const E = B.target;
31437
- this.editorView.dom.contains(E) || !this.overflowMenu.contains(E) && !this.toolbar.contains(E) && (this.overflowMenu.style.display = "none", I.setAttribute("aria-expanded", "false"), this.submenuStack = [], this.closeOverflowHandler && u.removeEventListener("click", this.closeOverflowHandler));
31402
+ this.closeOverflowHandler && u.removeEventListener("click", this.closeOverflowHandler), this.closeOverflowHandler = (E) => {
31403
+ const B = E.target;
31404
+ this.editorView.dom.contains(B) || !this.overflowMenu.contains(B) && !this.toolbar.contains(B) && (this.overflowMenu.style.display = "none", I.setAttribute("aria-expanded", "false"), this.submenuStack = [], this.closeOverflowHandler && u.removeEventListener("click", this.closeOverflowHandler));
31438
31405
  }, u.addEventListener("click", this.closeOverflowHandler);
31439
31406
  }, 0));
31440
31407
  }), this.toolbar.appendChild(I);
@@ -31507,8 +31474,8 @@ class CustomMenuView {
31507
31474
  let d = null;
31508
31475
  if (c)
31509
31476
  for (let h = 0; h < I.length; h++) {
31510
- const u = I[h], B = u.getBoundingClientRect(), E = B.left + B.width / 2;
31511
- a.clientX < E && d === null && (d = u);
31477
+ const u = I[h], E = u.getBoundingClientRect(), B = E.left + E.width / 2;
31478
+ a.clientX < B && d === null && (d = u);
31512
31479
  }
31513
31480
  if (this.dragPlaceholder && this.dragPlaceholder.parentNode && this.dragPlaceholder.remove(), c && this.dragPlaceholder)
31514
31481
  if (d)
@@ -31651,19 +31618,6 @@ class CustomMenuView {
31651
31618
  );
31652
31619
  A && A.remove(), this.dragPlaceholder && (this.dragPlaceholder.remove(), this.dragPlaceholder = null), this.dragStartTimer && (clearTimeout(this.dragStartTimer), this.dragStartTimer = null);
31653
31620
  }
31654
- setupResize() {
31655
- let e = !1, A = 0, n = 0;
31656
- const r = (a) => {
31657
- e = !0, A = a.clientY, n = this.editorContainer.offsetHeight, this.wrapper.classList.add(CSS_PREFIX$1 + "__wrapper--resizing"), a.preventDefault(), document.addEventListener("mousemove", o), document.addEventListener("mouseup", s);
31658
- }, o = (a) => {
31659
- if (!e) return;
31660
- const l = a.clientY - A, g = n + l, c = 200, I = window.innerHeight - 100;
31661
- g >= c && g <= I && (this.editorContainer.style.height = g + "px");
31662
- }, s = () => {
31663
- e && (e = !1, this.wrapper.classList.remove(CSS_PREFIX$1 + "__wrapper--resizing"), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s));
31664
- };
31665
- this.resizeHandle.addEventListener("mousedown", r);
31666
- }
31667
31621
  update(e, A) {
31668
31622
  this.tools.forEach((n) => {
31669
31623
  n.element.render(this.editorView);
@@ -31685,14 +31639,14 @@ class CustomMenuPlugin extends Plugin {
31685
31639
  }
31686
31640
  }
31687
31641
  class ExtensionCustomMenu extends Extension {
31688
- constructor() {
31689
- super(...arguments), this.name = "customMenu";
31642
+ constructor(e = {}) {
31643
+ super(e), this.config = e, this.name = "customMenu";
31690
31644
  }
31691
31645
  getProseMirrorPlugins() {
31692
31646
  if (!this.editor.config.element)
31693
31647
  return [];
31694
- const e = buildMenu(this.editor, this.editor.schema);
31695
- return [
31648
+ let e = buildMenu(this.editor, this.editor.schema);
31649
+ return this.config.modifyMenu && (e = this.config.modifyMenu(e)), [
31696
31650
  new CustomMenuPlugin(this.editor, {
31697
31651
  content: e
31698
31652
  })
@@ -32161,7 +32115,7 @@ const convertCodeParagraphsToCodeBlocks = (t, e) => {
32161
32115
  const c = [];
32162
32116
  for (let I = 0; I < s.childCount; I++) {
32163
32117
  const d = s.child(I), h = d.marks.some(
32164
- (B) => B.type === o
32118
+ (E) => E.type === o
32165
32119
  ), u = d.textContent.match(/^[ \t\u00A0]+$/);
32166
32120
  if (d.type.name === "node_bookmark") {
32167
32121
  c.push(d), g += d.nodeSize;
@@ -32227,8 +32181,8 @@ const convertCodeParagraphsToCodeBlocks = (t, e) => {
32227
32181
  ...c.attrs,
32228
32182
  start: h.levels[l],
32229
32183
  continue: void 0
32230
- })), c.forEach((u, B) => {
32231
- g(u, I + B + 1, d + 1);
32184
+ })), c.forEach((u, E) => {
32185
+ g(u, I + E + 1, d + 1);
32232
32186
  }), l === 1 && r.set("_last", h), l--, a = !1;
32233
32187
  }
32234
32188
  }
@@ -32307,16 +32261,16 @@ const convertCodeParagraphsToCodeBlocks = (t, e) => {
32307
32261
  }
32308
32262
  if (c.length > 1) {
32309
32263
  const h = n.mapping.map(a), u = n.mapping.map(a + I);
32310
- let B = c.join("").replace(/\n+$/gm, `
32264
+ let E = c.join("").replace(/\n+$/gm, `
32311
32265
  `);
32312
- const E = B.split(`
32266
+ const B = E.split(`
32313
32267
  `);
32314
32268
  let f = 0;
32315
- for (f = 0; f < E.length && !E[f].trim(); f++)
32269
+ for (f = 0; f < B.length && !B[f].trim(); f++)
32316
32270
  ;
32317
- E.splice(0, f), B = E.join(`
32271
+ B.splice(0, f), E = B.join(`
32318
32272
  `);
32319
- const Q = A.text(B), p = A.nodes.code_block.createAndFill({
32273
+ const Q = A.text(E), p = A.nodes.code_block.createAndFill({
32320
32274
  lang: g.attrs.lang
32321
32275
  }, [Q]);
32322
32276
  p && (n = n.replaceRangeWith(h, u, p));
@@ -32327,18 +32281,18 @@ const convertCodeParagraphsToCodeBlocks = (t, e) => {
32327
32281
  }, ANY_LIST = ["ordered_list", "bullet_list"], fixListsLevels = (t, e) => {
32328
32282
  const A = t.doc, n = t.schema, r = n.nodes.bullet_list, o = n.nodes.list_item, s = n.nodes.paragraph, a = t.tr;
32329
32283
  let l = 0, g = [], c = [], I = 0;
32330
- function d(h, u = 0, B = 0) {
32331
- let E = 0;
32284
+ function d(h, u = 0, E = 0) {
32285
+ let B = 0;
32332
32286
  for (let f = 0; f < h.length; f++) {
32333
32287
  const Q = h[f];
32334
32288
  if (!ANY_LIST.includes(Q.type.name))
32335
- d(Q.children, u + E + 1, B + 1);
32289
+ d(Q.children, u + B + 1, E + 1);
32336
32290
  else {
32337
32291
  const p = Q.attrs.odtMarginLeft || 0;
32338
32292
  if (l === 0 && (c = [], I = 0, g.length >= l))
32339
32293
  for (let m = 0; m < g.length; m++)
32340
32294
  I < g.length && p > g[I] && (c[l + I] = g[I], I++);
32341
- if (c[l + I] = p, l++, d(Q.children, u + E, B + 1), l--, l === 0 && !Q.attrs.toc) {
32295
+ if (c[l + I] = p, l++, d(Q.children, u + B, E + 1), l--, l === 0 && !Q.attrs.toc) {
32342
32296
  g = c;
32343
32297
  for (let m = 0; m < I; m++) {
32344
32298
  const y = r.create(
@@ -32352,14 +32306,14 @@ const convertCodeParagraphsToCodeBlocks = (t, e) => {
32352
32306
  )
32353
32307
  );
32354
32308
  a.replaceWith(
32355
- a.mapping.map(u + E),
32356
- a.mapping.map(u + E + Q.nodeSize),
32309
+ a.mapping.map(u + B),
32310
+ a.mapping.map(u + B + Q.nodeSize),
32357
32311
  y
32358
32312
  );
32359
32313
  }
32360
32314
  }
32361
32315
  }
32362
- E += Q.nodeSize;
32316
+ B += Q.nodeSize;
32363
32317
  }
32364
32318
  }
32365
32319
  return d(A.children), e && e(a), a.docChanged;
@@ -32655,7 +32609,7 @@ function computeMap(t) {
32655
32609
  for (let u = 0; ; u++) {
32656
32610
  for (; r < n.length && n[r] != 0; ) r++;
32657
32611
  if (u == I.childCount) break;
32658
- const B = I.child(u), { colspan: E, rowspan: f, colwidth: Q } = B.attrs;
32612
+ const E = I.child(u), { colspan: B, rowspan: f, colwidth: Q } = E.attrs;
32659
32613
  for (let p = 0; p < f; p++) {
32660
32614
  if (p + g >= A) {
32661
32615
  (o || (o = [])).push({
@@ -32666,12 +32620,12 @@ function computeMap(t) {
32666
32620
  break;
32667
32621
  }
32668
32622
  const m = r + p * e;
32669
- for (let y = 0; y < E; y++) {
32623
+ for (let y = 0; y < B; y++) {
32670
32624
  n[m + y] == 0 ? n[m + y] = c : (o || (o = [])).push({
32671
32625
  type: "collision",
32672
32626
  row: g,
32673
32627
  pos: c,
32674
- n: E - y
32628
+ n: B - y
32675
32629
  });
32676
32630
  const w = Q && Q[y];
32677
32631
  if (w) {
@@ -32680,7 +32634,7 @@ function computeMap(t) {
32680
32634
  }
32681
32635
  }
32682
32636
  }
32683
- r += E, c += B.nodeSize;
32637
+ r += B, c += E.nodeSize;
32684
32638
  }
32685
32639
  const d = (g + 1) * e;
32686
32640
  let h = 0;
@@ -32877,13 +32831,13 @@ class CellSelection extends Selection {
32877
32831
  let u = e.nodeAt(d);
32878
32832
  if (!u)
32879
32833
  throw RangeError(`No cell with offset ${d} found`);
32880
- const B = r.left - h.left, E = h.right - r.right;
32881
- if (B > 0 || E > 0) {
32834
+ const E = r.left - h.left, B = h.right - r.right;
32835
+ if (E > 0 || B > 0) {
32882
32836
  let f = u.attrs;
32883
- if (B > 0 && (f = removeColSpan(f, 0, B)), E > 0 && (f = removeColSpan(
32837
+ if (E > 0 && (f = removeColSpan(f, 0, E)), B > 0 && (f = removeColSpan(
32884
32838
  f,
32885
- f.colspan - E,
32886
- E
32839
+ f.colspan - B,
32840
+ B
32887
32841
  )), h.left < r.left) {
32888
32842
  if (u = u.type.createAndFill(f), !u)
32889
32843
  throw RangeError(
@@ -33085,12 +33039,12 @@ function updateColumnsOnResize(t, e, A, n, r, o) {
33085
33039
  for (let c = 0, I = 0; c < g.childCount; c++) {
33086
33040
  const { colspan: d, colwidth: h } = g.child(c).attrs;
33087
33041
  for (let u = 0; u < d; u++, I++) {
33088
- const B = r == I ? o : h && h[u], E = B ? B + "px" : "";
33089
- if (s += B || n, B || (a = !1), l)
33090
- l.style.width != E && (l.style.width = E), l = l.nextSibling;
33042
+ const E = r == I ? o : h && h[u], B = E ? E + "px" : "";
33043
+ if (s += E || n, E || (a = !1), l)
33044
+ l.style.width != B && (l.style.width = B), l = l.nextSibling;
33091
33045
  else {
33092
33046
  const f = document.createElement("col");
33093
- f.style.width = E, e.appendChild(f);
33047
+ f.style.width = B, e.appendChild(f);
33094
33048
  }
33095
33049
  }
33096
33050
  }
@@ -33387,12 +33341,12 @@ function fixTable(t, e, A, n) {
33387
33341
  let h = "cell";
33388
33342
  c.firstChild && (h = c.firstChild.type.spec.tableRole);
33389
33343
  const u = [];
33390
- for (let E = 0; E < d; E++) {
33344
+ for (let B = 0; B < d; B++) {
33391
33345
  const f = tableNodeTypes(t.schema)[h].createAndFill();
33392
33346
  f && u.push(f);
33393
33347
  }
33394
- const B = (l == 0 || s == l - 1) && a == l ? g + 1 : I - 1;
33395
- n.insert(n.mapping.map(B), u);
33348
+ const E = (l == 0 || s == l - 1) && a == l ? g + 1 : I - 1;
33349
+ n.insert(n.mapping.map(E), u);
33396
33350
  }
33397
33351
  g = I;
33398
33352
  }
@@ -33533,8 +33487,8 @@ function removeRow(t, { map: e, table: A, tableStart: n }, r) {
33533
33487
  const d = A.nodeAt(I), h = d.attrs, u = d.type.create(
33534
33488
  { ...h, rowspan: d.attrs.rowspan - 1 },
33535
33489
  d.content
33536
- ), B = e.positionAt(r + 1, g, A);
33537
- t.insert(t.mapping.slice(a).map(n + B), u), g += h.colspan - 1;
33490
+ ), E = e.positionAt(r + 1, g, A);
33491
+ t.insert(t.mapping.slice(a).map(n + E), u), g += h.colspan - 1;
33538
33492
  }
33539
33493
  }
33540
33494
  }
@@ -33644,10 +33598,10 @@ const splitCellWithType = (t) => (e, A) => {
33644
33598
  for (let d = g.top; d < g.bottom; d++) {
33645
33599
  let h = g.map.positionAt(d, g.left, g.table);
33646
33600
  d == g.top && (h += r.nodeSize);
33647
- for (let u = g.left, B = 0; u < g.right; u++, B++)
33601
+ for (let u = g.left, E = 0; u < g.right; u++, E++)
33648
33602
  u == g.left && d == g.top || c.insert(
33649
33603
  I = c.mapping.map(h + g.tableStart, 1),
33650
- t({ node: r, row: d, col: u }).createAndFill(a[B])
33604
+ t({ node: r, row: d, col: u }).createAndFill(a[E])
33651
33605
  );
33652
33606
  }
33653
33607
  c.setNodeMarkup(
@@ -33748,8 +33702,8 @@ const toggleHeader = (t, e) => (e = e || { useDeprecatedLogic: !1 }, e.useDeprec
33748
33702
  bottom: 1
33749
33703
  } : o, d = t == "column" ? l ? r.cell : r.header_cell : t == "row" ? a ? r.cell : r.header_cell : r.cell;
33750
33704
  o.map.cellsInRect(I).forEach((h) => {
33751
- const u = h + o.tableStart, B = s.doc.nodeAt(u);
33752
- B && s.setNodeMarkup(u, d, B.attrs);
33705
+ const u = h + o.tableStart, E = s.doc.nodeAt(u);
33706
+ E && s.setNodeMarkup(u, d, E.attrs);
33753
33707
  }), n(s);
33754
33708
  }
33755
33709
  return !0;
@@ -33919,17 +33873,17 @@ function growTable(t, e, A, n, r, o, s) {
33919
33873
  const h = A.child(I);
33920
33874
  d += h.nodeSize;
33921
33875
  const u = [];
33922
- let B;
33923
- h.lastChild == null || h.lastChild.type == l.cell ? B = g || (g = l.cell.createAndFill()) : B = c || (c = l.header_cell.createAndFill());
33924
- for (let E = e.width; E < r; E++) u.push(B);
33876
+ let E;
33877
+ h.lastChild == null || h.lastChild.type == l.cell ? E = g || (g = l.cell.createAndFill()) : E = c || (c = l.header_cell.createAndFill());
33878
+ for (let B = e.width; B < r; B++) u.push(E);
33925
33879
  t.insert(t.mapping.slice(s).map(d - 1 + n), u);
33926
33880
  }
33927
33881
  if (o > e.height) {
33928
33882
  const I = [];
33929
- for (let u = 0, B = (e.height - 1) * e.width; u < Math.max(e.width, r); u++) {
33930
- const E = u >= e.width ? !1 : A.nodeAt(e.map[B + u]).type == l.header_cell;
33883
+ for (let u = 0, E = (e.height - 1) * e.width; u < Math.max(e.width, r); u++) {
33884
+ const B = u >= e.width ? !1 : A.nodeAt(e.map[E + u]).type == l.header_cell;
33931
33885
  I.push(
33932
- E ? c || (c = l.header_cell.createAndFill()) : g || (g = l.cell.createAndFill())
33886
+ B ? c || (c = l.header_cell.createAndFill()) : g || (g = l.cell.createAndFill())
33933
33887
  );
33934
33888
  }
33935
33889
  const d = l.row.create(null, Fragment.from(I)), h = [];
@@ -34000,10 +33954,10 @@ function insertCells(t, e, A, n, r) {
34000
33954
  }
34001
33955
  growTable(I, s, o, A, g, c, d) && h(), isolateHorizontal(I, s, o, A, l, g, a, d) && h(), isolateHorizontal(I, s, o, A, l, g, c, d) && h(), isolateVertical(I, s, o, A, a, c, l, d) && h(), isolateVertical(I, s, o, A, a, c, g, d) && h();
34002
33956
  for (let u = a; u < c; u++) {
34003
- const B = s.positionAt(u, l, o), E = s.positionAt(u, g, o);
33957
+ const E = s.positionAt(u, l, o), B = s.positionAt(u, g, o);
34004
33958
  I.replace(
34005
- I.mapping.slice(d).map(B + A),
34006
33959
  I.mapping.slice(d).map(E + A),
33960
+ I.mapping.slice(d).map(B + A),
34007
33961
  new Slice(r.rows[u - a], 0, 0)
34008
33962
  );
34009
33963
  }
@@ -34478,13 +34432,13 @@ function createDefaultMatcher(t = {}) {
34478
34432
  const h = o.pos - d.length, u = Array.from(d.matchAll(I)).pop();
34479
34433
  if (!u || u.input === void 0 || u.index === void 0)
34480
34434
  return;
34481
- const B = u.input.slice(
34435
+ const E = u.input.slice(
34482
34436
  Math.max(0, u.index - 1),
34483
34437
  u.index
34484
- ), E = new RegExp(
34438
+ ), B = new RegExp(
34485
34439
  `^[${n?.join("")}\0]?$`
34486
- ).test(B);
34487
- if (n !== null && !E)
34440
+ ).test(E);
34441
+ if (n !== null && !B)
34488
34442
  return;
34489
34443
  const f = h + u.index;
34490
34444
  let Q = f + u[0].length;
@@ -34541,22 +34495,22 @@ class AutocompletePlugin extends Plugin {
34541
34495
  !a && n.isGeneric;
34542
34496
  const { editable: g, composing: c } = A.view, { selection: I } = n, d = () => {
34543
34497
  l.active && (l.active.renderer.destroy(), l.active = void 0), l.decorationId = void 0;
34544
- }, h = (B) => {
34545
- if (B && (!B.source.allow || B.source.allow({
34546
- range: B.match.range,
34498
+ }, h = (E) => {
34499
+ if (E && (!E.source.allow || E.source.allow({
34500
+ range: E.match.range,
34547
34501
  isActive: !!l.active
34548
34502
  }))) {
34549
- const { source: E, match: f } = B;
34503
+ const { source: B, match: f } = E;
34550
34504
  console.info("Trigger matcher autocomplete", f);
34551
34505
  let Q = l.active?.renderer;
34552
- l.active?.source !== E && Q && (Q.destroy(), Q = void 0), Q || (Q = new DefaultRenderer(A), Q.addEventListener("close", () => {
34506
+ l.active?.source !== B && Q && (Q.destroy(), Q = void 0), Q || (Q = new DefaultRenderer(A), Q.addEventListener("close", () => {
34553
34507
  const m = A.state.tr.setMeta(AutocompletePluginKey, {
34554
34508
  deactivate: !0
34555
34509
  });
34556
34510
  console.info("Manual autocomplete deactivate"), A.view.dispatch(m);
34557
34511
  })), l.active = {
34558
34512
  renderer: Q,
34559
- source: E,
34513
+ source: B,
34560
34514
  match: f
34561
34515
  };
34562
34516
  const p = `id_${Math.floor(Math.random() * 4294967295)}`;
@@ -34565,19 +34519,19 @@ class AutocompletePlugin extends Plugin {
34565
34519
  d();
34566
34520
  };
34567
34521
  if (a?.addAutocompleteSource) {
34568
- const B = {
34522
+ const E = {
34569
34523
  ...a.addAutocompleteSource.autocompleteSource
34570
34524
  };
34571
- return !B.matchers && B.triggerKeys?.length === 1 && (B.matchers = [
34572
- createDefaultMatcher({ char: B.triggerKeys[0] })
34525
+ return !E.matchers && E.triggerKeys?.length === 1 && (E.matchers = [
34526
+ createDefaultMatcher({ char: E.triggerKeys[0] })
34573
34527
  ]), l.autocompleteSources.push(
34574
- B
34528
+ E
34575
34529
  ), l;
34576
34530
  }
34577
34531
  if (a?.activate) {
34578
34532
  console.info("Trigger manual autocomplete");
34579
- const B = matchSource(I, l.autocompleteSources);
34580
- return h(B), l.manual = !0, l;
34533
+ const E = matchSource(I, l.autocompleteSources);
34534
+ return h(E), l.manual = !0, l;
34581
34535
  }
34582
34536
  if (a?.deactivate)
34583
34537
  return console.info("Deactivate autocomplete"), d(), l;
@@ -34601,10 +34555,10 @@ class AutocompletePlugin extends Plugin {
34601
34555
  n.dom.querySelector(
34602
34556
  `[data-decoration-id="${s.decorationId}"]`
34603
34557
  );
34604
- const B = s.active.source.onSelect, E = s.active.match.range, f = {
34558
+ const E = s.active.source.onSelect, B = s.active.match.range, f = {
34605
34559
  match: s.active.match,
34606
34560
  items: [],
34607
- command: (Q) => B(Q, E),
34561
+ command: (Q) => E(Q, B),
34608
34562
  // decorationNode,
34609
34563
  // virtual node for popper.js or tippy.js
34610
34564
  // this can be used for building popups without a DOM node
@@ -34901,8 +34855,8 @@ class Branch {
34901
34855
  s = Math.min(s, h);
34902
34856
  let u = o.maps[h];
34903
34857
  if (d.step) {
34904
- let B = e.steps[h].invert(e.docs[h]), E = d.selection && d.selection.map(o.slice(l + 1, h));
34905
- E && a++, n.push(new Item(u, B, E));
34858
+ let E = e.steps[h].invert(e.docs[h]), B = d.selection && d.selection.map(o.slice(l + 1, h));
34859
+ B && a++, n.push(new Item(u, E, B));
34906
34860
  } else
34907
34861
  n.push(new Item(u));
34908
34862
  }, r);