@fileverse-dev/ddoc 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.es.js CHANGED
@@ -644,7 +644,8 @@ process.env.NODE_ENV === "production" ? ha.exports = zg() : ha.exports = Vg();
644
644
  var b = ha.exports;
645
645
  const _g = "data:image/png;base64,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", Wg = ({
646
646
  metaData: n,
647
- setMetaData: e
647
+ setMetaData: e,
648
+ isPreviewMode: t
648
649
  }) => /* @__PURE__ */ b.jsxs("div", { className: "flex items-center gap-4", children: [
649
650
  /* @__PURE__ */ b.jsx(
650
651
  "img",
@@ -657,13 +658,14 @@ const _g = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAA
657
658
  /* @__PURE__ */ b.jsx(
658
659
  "input",
659
660
  {
660
- className: "custom-input w-[50%] mx-2 focus:outline-none",
661
+ className: "custom-input mx-2 focus:outline-none",
662
+ disabled: t,
661
663
  type: "text",
662
664
  placeholder: "Untitled",
663
665
  defaultValue: n.plugin.title || "",
664
- onChange: (t) => e({
666
+ onChange: (r) => e({
665
667
  ...n,
666
- plugin: { ...n.plugin, title: t.target.value }
668
+ plugin: { ...n.plugin, title: r.target.value }
667
669
  })
668
670
  }
669
671
  )
@@ -5940,9 +5942,9 @@ function yh(n, e) {
5940
5942
  !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (i = d + 1);
5941
5943
  }
5942
5944
  }
5943
- return !t && a && (t = a, o = c, r = 0), t && t.nodeType == 3 ? ey(t, o) : !t || r && t.nodeType == 1 ? { node: n, offset: i } : yh(t, o);
5945
+ return !t && a && (t = a, o = c, r = 0), t && t.nodeType == 3 ? e1(t, o) : !t || r && t.nodeType == 1 ? { node: n, offset: i } : yh(t, o);
5944
5946
  }
5945
- function ey(n, e) {
5947
+ function e1(n, e) {
5946
5948
  let t = n.nodeValue.length, r = document.createRange();
5947
5949
  for (let o = 0; o < t; o++) {
5948
5950
  r.setEnd(n, o + 1), r.setStart(n, o);
@@ -5955,11 +5957,11 @@ function ey(n, e) {
5955
5957
  function fc(n, e) {
5956
5958
  return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
5957
5959
  }
5958
- function ty(n, e) {
5960
+ function t1(n, e) {
5959
5961
  let t = n.parentNode;
5960
5962
  return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
5961
5963
  }
5962
- function ny(n, e, t) {
5964
+ function n1(n, e, t) {
5963
5965
  let { node: r, offset: o } = yh(e, t), i = -1;
5964
5966
  if (r.nodeType == 1 && !r.firstChild) {
5965
5967
  let s = r.getBoundingClientRect();
@@ -5967,7 +5969,7 @@ function ny(n, e, t) {
5967
5969
  }
5968
5970
  return n.docView.posFromDOM(r, o, i);
5969
5971
  }
5970
- function ry(n, e, t, r) {
5972
+ function r1(n, e, t, r) {
5971
5973
  let o = -1;
5972
5974
  for (let i = e, s = !1; i != n.dom; ) {
5973
5975
  let l = n.docView.nearestDesc(i, !0);
@@ -6000,7 +6002,7 @@ function vh(n, e, t) {
6000
6002
  }
6001
6003
  return n;
6002
6004
  }
6003
- function oy(n, e) {
6005
+ function o1(n, e) {
6004
6006
  let t = n.dom.ownerDocument, r, o = 0, i = U0(t, e.left, e.top);
6005
6007
  i && ({ node: r, offset: o } = i);
6006
6008
  let s = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
@@ -6012,15 +6014,15 @@ function oy(n, e) {
6012
6014
  if (rt)
6013
6015
  for (let c = s; r && c; c = Wo(c))
6014
6016
  c.draggable && (r = void 0);
6015
- if (s = ty(s, e), r) {
6017
+ if (s = t1(s, e), r) {
6016
6018
  if ($t && r.nodeType == 1 && (o = Math.min(o, r.childNodes.length), o < r.childNodes.length)) {
6017
6019
  let u = r.childNodes[o], d;
6018
6020
  u.nodeName == "IMG" && (d = u.getBoundingClientRect()).right <= e.left && d.bottom > e.top && o++;
6019
6021
  }
6020
6022
  let c;
6021
- ai && o && r.nodeType == 1 && (c = r.childNodes[o - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && o--, r == n.dom && o == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (o == 0 || r.nodeType != 1 || r.childNodes[o - 1].nodeName != "BR") && (l = ry(n, r, o, e));
6023
+ ai && o && r.nodeType == 1 && (c = r.childNodes[o - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && o--, r == n.dom && o == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (o == 0 || r.nodeType != 1 || r.childNodes[o - 1].nodeName != "BR") && (l = r1(n, r, o, e));
6022
6024
  }
6023
- l == null && (l = ny(n, s, e));
6025
+ l == null && (l = n1(n, s, e));
6024
6026
  let a = n.docView.nearestDesc(s, !0);
6025
6027
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
6026
6028
  }
@@ -6036,11 +6038,11 @@ function An(n, e) {
6036
6038
  }
6037
6039
  return Array.prototype.find.call(t, Mu) || n.getBoundingClientRect();
6038
6040
  }
6039
- const iy = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6041
+ const i1 = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6040
6042
  function bh(n, e, t) {
6041
6043
  let { node: r, offset: o, atom: i } = n.docView.domFromPos(e, t < 0 ? -1 : 1), s = ai || $t;
6042
6044
  if (r.nodeType == 3)
6043
- if (s && (iy.test(r.nodeValue) || (t < 0 ? !o : o == r.nodeValue.length))) {
6045
+ if (s && (i1.test(r.nodeValue) || (t < 0 ? !o : o == r.nodeValue.length))) {
6044
6046
  let a = An(gn(r, o, o), t);
6045
6047
  if ($t && o && /\s/.test(r.nodeValue[o - 1]) && o < r.nodeValue.length) {
6046
6048
  let c = An(gn(r, o - 1, o - 1), -1);
@@ -6104,7 +6106,7 @@ function wh(n, e, t) {
6104
6106
  r != e && n.updateState(r), o != n.dom && o && o.focus();
6105
6107
  }
6106
6108
  }
6107
- function sy(n, e, t) {
6109
+ function s1(n, e, t) {
6108
6110
  let r = e.selection, o = t == "up" ? r.$from : r.$to;
6109
6111
  return wh(n, e, () => {
6110
6112
  let { node: i } = n.docView.domFromPos(o.pos, t == "up" ? -1 : 1);
@@ -6136,13 +6138,13 @@ function sy(n, e, t) {
6136
6138
  return !0;
6137
6139
  });
6138
6140
  }
6139
- const ly = /[\u0590-\u08ac]/;
6140
- function ay(n, e, t) {
6141
+ const l1 = /[\u0590-\u08ac]/;
6142
+ function a1(n, e, t) {
6141
6143
  let { $head: r } = e.selection;
6142
6144
  if (!r.parent.isTextblock)
6143
6145
  return !1;
6144
6146
  let o = r.parentOffset, i = !o, s = o == r.parent.content.size, l = n.domSelection();
6145
- return !ly.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? i : s : wh(n, e, () => {
6147
+ return !l1.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? i : s : wh(n, e, () => {
6146
6148
  let { focusNode: a, focusOffset: c, anchorNode: u, anchorOffset: d } = n.domSelectionRange(), f = l.caretBidiLevel;
6147
6149
  l.modify("move", t, "character");
6148
6150
  let h = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: m } = n.domSelectionRange(), g = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
@@ -6154,8 +6156,8 @@ function ay(n, e, t) {
6154
6156
  });
6155
6157
  }
6156
6158
  let Ou = null, Nu = null, Ru = !1;
6157
- function cy(n, e, t) {
6158
- return Ou == e && Nu == t ? Ru : (Ou = e, Nu = t, Ru = t == "up" || t == "down" ? sy(n, e, t) : ay(n, e, t));
6159
+ function c1(n, e, t) {
6160
+ return Ou == e && Nu == t ? Ru : (Ou = e, Nu = t, Ru = t == "up" || t == "down" ? s1(n, e, t) : a1(n, e, t));
6159
6161
  }
6160
6162
  const Mt = 0, Du = 1, sr = 2, tn = 3;
6161
6163
  class ci {
@@ -6533,7 +6535,7 @@ class xh extends ci {
6533
6535
  return this.widget.type.side;
6534
6536
  }
6535
6537
  }
6536
- class uy extends ci {
6538
+ class u1 extends ci {
6537
6539
  constructor(e, t, r, o) {
6538
6540
  super(e, [], t, null), this.textDOM = r, this.text = o;
6539
6541
  }
@@ -6609,7 +6611,7 @@ class Hn extends ci {
6609
6611
  u || ({ dom: u, contentDOM: d } = Gt.renderSpec(document, t.type.spec.toDOM(t)));
6610
6612
  !d && !t.isText && u.nodeName != "BR" && (u.hasAttribute("contenteditable") || (u.contentEditable = "false"), t.type.spec.draggable && (u.draggable = !0));
6611
6613
  let f = u;
6612
- return u = Eh(u, r, t), c ? a = new dy(e, t, r, o, u, d || null, f, c, i, s + 1) : t.isText ? new il(e, t, r, o, u, f, i) : new Hn(e, t, r, o, u, d || null, f, i, s + 1);
6614
+ return u = Eh(u, r, t), c ? a = new d1(e, t, r, o, u, d || null, f, c, i, s + 1) : t.isText ? new il(e, t, r, o, u, f, i) : new Hn(e, t, r, o, u, d || null, f, i, s + 1);
6613
6615
  }
6614
6616
  parseRule() {
6615
6617
  if (this.node.type.spec.reparseInView)
@@ -6645,14 +6647,14 @@ class Hn extends ci {
6645
6647
  // separate step, syncs the DOM inside `this.contentDOM` to
6646
6648
  // `this.children`.
6647
6649
  updateChildren(e, t) {
6648
- let r = this.node.inlineContent, o = t, i = e.composing ? this.localCompositionInfo(e, t) : null, s = i && i.pos > -1 ? i : null, l = i && i.pos < 0, a = new hy(this, s && s.node, e);
6649
- gy(this.node, this.innerDeco, (c, u, d) => {
6650
+ let r = this.node.inlineContent, o = t, i = e.composing ? this.localCompositionInfo(e, t) : null, s = i && i.pos > -1 ? i : null, l = i && i.pos < 0, a = new h1(this, s && s.node, e);
6651
+ g1(this.node, this.innerDeco, (c, u, d) => {
6650
6652
  c.spec.marks ? a.syncToMarks(c.spec.marks, r, e) : c.type.side >= 0 && !d && a.syncToMarks(u == this.node.childCount ? me.none : this.node.child(u).marks, r, e), a.placeWidget(c, e, o);
6651
6653
  }, (c, u, d, f) => {
6652
6654
  a.syncToMarks(c.marks, r, e);
6653
6655
  let h;
6654
6656
  a.findNodeMatch(c, u, d, f) || l && e.state.selection.from > o && e.state.selection.to < o + c.nodeSize && (h = a.findIndexWithChild(i.node)) > -1 && a.updateNodeAt(c, u, d, h, e) || a.updateNextNode(c, u, d, e, f, o) || a.addNode(c, u, d, e, o), o += c.nodeSize;
6655
- }), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == sr) && (s && this.protectLocalComposition(e, s), Ch(this.contentDOM, this.children, e), ro && yy(this.dom));
6657
+ }), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == sr) && (s && this.protectLocalComposition(e, s), Ch(this.contentDOM, this.children, e), ro && y1(this.dom));
6656
6658
  }
6657
6659
  localCompositionInfo(e, t) {
6658
6660
  let { from: r, to: o } = e.state.selection;
@@ -6662,7 +6664,7 @@ class Hn extends ci {
6662
6664
  if (!i || !this.dom.contains(i.parentNode))
6663
6665
  return null;
6664
6666
  if (this.node.inlineContent) {
6665
- let s = i.nodeValue, l = vy(this.node.content, s, r - t, o - t);
6667
+ let s = i.nodeValue, l = v1(this.node.content, s, r - t, o - t);
6666
6668
  return l < 0 ? null : { node: i, pos: l, text: s };
6667
6669
  } else
6668
6670
  return { node: i, pos: -1, text: "" };
@@ -6678,7 +6680,7 @@ class Hn extends ci {
6678
6680
  i.parentNode.removeChild(i.nextSibling);
6679
6681
  i.pmViewDesc && (i.pmViewDesc = void 0);
6680
6682
  }
6681
- let s = new uy(this, i, t, o);
6683
+ let s = new u1(this, i, t, o);
6682
6684
  e.input.compositionNodes.push(s), this.children = Ea(this.children, r, r + o.length, e, s);
6683
6685
  }
6684
6686
  // If this desc must be updated to match the given node decoration,
@@ -6769,7 +6771,7 @@ class kh extends ci {
6769
6771
  return this.dom.nodeName == "IMG";
6770
6772
  }
6771
6773
  }
6772
- class dy extends Hn {
6774
+ class d1 extends Hn {
6773
6775
  constructor(e, t, r, o, i, s, l, a, c, u) {
6774
6776
  super(e, t, r, o, i, s, l, c, u), this.spec = a;
6775
6777
  }
@@ -6854,11 +6856,11 @@ function Sh(n, e, t, r) {
6854
6856
  let a;
6855
6857
  l && l.nodeName == s.nodeName && o != n && (a = o.parentNode) && a.nodeName.toLowerCase() == s.nodeName || (a = document.createElement(s.nodeName), a.pmIsDeco = !0, a.appendChild(o), l = lr[0]), o = a;
6856
6858
  }
6857
- fy(o, l || lr[0], s);
6859
+ f1(o, l || lr[0], s);
6858
6860
  }
6859
6861
  return o;
6860
6862
  }
6861
- function fy(n, e, t) {
6863
+ function f1(n, e, t) {
6862
6864
  for (let r in e)
6863
6865
  r != "class" && r != "style" && r != "nodeName" && !(r in t) && n.removeAttribute(r);
6864
6866
  for (let r in t)
@@ -6895,9 +6897,9 @@ function Pu(n) {
6895
6897
  let e = n.nextSibling;
6896
6898
  return n.parentNode.removeChild(n), e;
6897
6899
  }
6898
- class hy {
6900
+ class h1 {
6899
6901
  constructor(e, t, r) {
6900
- this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = py(e.node.content, e);
6902
+ this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = p1(e.node.content, e);
6901
6903
  }
6902
6904
  // Destroy and remove the children between the given indices in
6903
6905
  // `this.top`.
@@ -7045,7 +7047,7 @@ class hy {
7045
7047
  return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
7046
7048
  }
7047
7049
  }
7048
- function py(n, e) {
7050
+ function p1(n, e) {
7049
7051
  let t = e, r = t.children.length, o = n.childCount, i = /* @__PURE__ */ new Map(), s = [];
7050
7052
  e:
7051
7053
  for (; o > 0; ) {
@@ -7073,10 +7075,10 @@ function py(n, e) {
7073
7075
  }
7074
7076
  return { index: o, matched: i, matches: s.reverse() };
7075
7077
  }
7076
- function my(n, e) {
7078
+ function m1(n, e) {
7077
7079
  return n.type.side - e.type.side;
7078
7080
  }
7079
- function gy(n, e, t, r) {
7081
+ function g1(n, e, t, r) {
7080
7082
  let o = e.locals(n), i = 0;
7081
7083
  if (o.length == 0) {
7082
7084
  for (let c = 0; c < n.childCount; c++) {
@@ -7094,7 +7096,7 @@ function gy(n, e, t, r) {
7094
7096
  }
7095
7097
  if (u)
7096
7098
  if (d) {
7097
- d.sort(my);
7099
+ d.sort(m1);
7098
7100
  for (let g = 0; g < d.length; g++)
7099
7101
  t(d[g], c, !!a);
7100
7102
  } else
@@ -7124,13 +7126,13 @@ function gy(n, e, t, r) {
7124
7126
  r(f, m, e.forChild(i, f), h), i = p;
7125
7127
  }
7126
7128
  }
7127
- function yy(n) {
7129
+ function y1(n) {
7128
7130
  if (n.nodeName == "UL" || n.nodeName == "OL") {
7129
7131
  let e = n.style.cssText;
7130
7132
  n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
7131
7133
  }
7132
7134
  }
7133
- function vy(n, e, t, r) {
7135
+ function v1(n, e, t, r) {
7134
7136
  for (let o = 0, i = 0; o < n.childCount && i <= r; ) {
7135
7137
  let s = n.child(o++), l = i;
7136
7138
  if (i += s.nodeSize, !s.isText)
@@ -7204,10 +7206,10 @@ function bn(n, e = !1) {
7204
7206
  }
7205
7207
  }
7206
7208
  if (n.domObserver.disconnectSelection(), n.cursorWrapper)
7207
- wy(n);
7209
+ w1(n);
7208
7210
  else {
7209
7211
  let { anchor: r, head: o } = t, i, s;
7210
- Iu && !(t instanceof q) && (t.$from.parent.inlineContent || (i = Fu(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (s = Fu(n, t.to))), n.docView.setSelection(r, o, n.root, e), Iu && (i && $u(i), s && $u(s)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && by(n));
7212
+ Iu && !(t instanceof q) && (t.$from.parent.inlineContent || (i = Fu(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (s = Fu(n, t.to))), n.docView.setSelection(r, o, n.root, e), Iu && (i && $u(i), s && $u(s)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && b1(n));
7211
7213
  }
7212
7214
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
7213
7215
  }
@@ -7230,7 +7232,7 @@ function Fl(n) {
7230
7232
  function $u(n) {
7231
7233
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
7232
7234
  }
7233
- function by(n) {
7235
+ function b1(n) {
7234
7236
  let e = n.dom.ownerDocument;
7235
7237
  e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
7236
7238
  let t = n.domSelectionRange(), r = t.anchorNode, o = t.anchorOffset;
@@ -7240,7 +7242,7 @@ function by(n) {
7240
7242
  }, 20));
7241
7243
  });
7242
7244
  }
7243
- function wy(n) {
7245
+ function w1(n) {
7244
7246
  let e = n.domSelection(), t = document.createRange(), r = n.cursorWrapper.dom, o = r.nodeName == "IMG";
7245
7247
  o ? t.setEnd(r.parentNode, ze(r) + 1) : t.setEnd(r, 0), t.collapse(!1), e.removeAllRanges(), e.addRange(t), !o && !n.state.selection.visible && ct && Bn <= 11 && (r.disabled = !0, r.disabled = !1);
7246
7248
  }
@@ -7270,7 +7272,7 @@ function Mh(n) {
7270
7272
  return !1;
7271
7273
  }
7272
7274
  }
7273
- function xy(n) {
7275
+ function x1(n) {
7274
7276
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
7275
7277
  return yr(e.node, e.offset, t.anchorNode, t.anchorOffset);
7276
7278
  }
@@ -7320,9 +7322,9 @@ function Po(n, e) {
7320
7322
  return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
7321
7323
  }
7322
7324
  function Lr(n, e) {
7323
- return e < 0 ? ky(n) : Cy(n);
7325
+ return e < 0 ? k1(n) : C1(n);
7324
7326
  }
7325
- function ky(n) {
7327
+ function k1(n) {
7326
7328
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7327
7329
  if (!t)
7328
7330
  return;
@@ -7358,7 +7360,7 @@ function ky(n) {
7358
7360
  }
7359
7361
  s ? Ta(n, t, r) : o && Ta(n, o, i);
7360
7362
  }
7361
- function Cy(n) {
7363
+ function C1(n) {
7362
7364
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7363
7365
  if (!t)
7364
7366
  return;
@@ -7394,7 +7396,7 @@ function Oh(n) {
7394
7396
  let e = n.pmViewDesc;
7395
7397
  return e && e.node && e.node.isBlock;
7396
7398
  }
7397
- function Sy(n, e) {
7399
+ function S1(n, e) {
7398
7400
  for (; n && e == n.childNodes.length && !li(n); )
7399
7401
  e = ze(n) + 1, n = n.parentNode;
7400
7402
  for (; n && e < n.childNodes.length; ) {
@@ -7406,7 +7408,7 @@ function Sy(n, e) {
7406
7408
  n = t, e = 0;
7407
7409
  }
7408
7410
  }
7409
- function Ey(n, e) {
7411
+ function E1(n, e) {
7410
7412
  for (; n && !e && !li(n); )
7411
7413
  e = ze(n), n = n.parentNode;
7412
7414
  for (; n && e; ) {
@@ -7421,7 +7423,7 @@ function Ey(n, e) {
7421
7423
  function Ta(n, e, t) {
7422
7424
  if (e.nodeType != 3) {
7423
7425
  let i, s;
7424
- (s = Sy(e, t)) ? (e = s, t = 0) : (i = Ey(e, t)) && (e = i, t = i.nodeValue.length);
7426
+ (s = S1(e, t)) ? (e = s, t = 0) : (i = E1(e, t)) && (e = i, t = i.nodeValue.length);
7425
7427
  }
7426
7428
  let r = n.domSelection();
7427
7429
  if (ol(r)) {
@@ -7488,7 +7490,7 @@ function _u(n, e) {
7488
7490
  function Wu(n, e, t) {
7489
7491
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
7490
7492
  }
7491
- function Ay(n) {
7493
+ function A1(n) {
7492
7494
  if (!rt || n.state.selection.$head.parentOffset > 0)
7493
7495
  return !1;
7494
7496
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
@@ -7498,12 +7500,12 @@ function Ay(n) {
7498
7500
  }
7499
7501
  return !1;
7500
7502
  }
7501
- function Ty(n) {
7503
+ function T1(n) {
7502
7504
  let e = "";
7503
7505
  return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
7504
7506
  }
7505
- function My(n, e) {
7506
- let t = e.keyCode, r = Ty(e);
7507
+ function M1(n, e) {
7508
+ let t = e.keyCode, r = T1(e);
7507
7509
  if (t == 8 || At && t == 72 && r == "c")
7508
7510
  return _u(n, -1) || Lr(n, -1);
7509
7511
  if (t == 46 && !e.shiftKey || At && t == 68 && r == "c")
@@ -7520,7 +7522,7 @@ function My(n, e) {
7520
7522
  if (t == 38 || At && t == 80 && r == "c")
7521
7523
  return Vu(n, -1, r) || Lr(n, -1);
7522
7524
  if (t == 40 || At && t == 78 && r == "c")
7523
- return Ay(n) || Vu(n, 1, r) || Lr(n, 1);
7525
+ return A1(n) || Vu(n, 1, r) || Lr(n, 1);
7524
7526
  if (r == (At ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
7525
7527
  return !0;
7526
7528
  }
@@ -7578,7 +7580,7 @@ function Rh(n, e, t, r, o) {
7578
7580
  } else
7579
7581
  n.someProp("transformPastedHTML", (d) => {
7580
7582
  t = d(t, n);
7581
- }), s = Ry(t), ai && Dy(s);
7583
+ }), s = R1(t), ai && D1(s);
7582
7584
  let c = s && s.querySelector("[data-pm-slice]"), u = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
7583
7585
  if (u && u[3])
7584
7586
  for (let d = +u[3]; d > 0; d--) {
@@ -7593,11 +7595,11 @@ function Rh(n, e, t, r, o) {
7593
7595
  preserveWhitespace: !!(a || u),
7594
7596
  context: o,
7595
7597
  ruleFromNode(f) {
7596
- return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !Oy.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7598
+ return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !O1.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7597
7599
  }
7598
7600
  })), u)
7599
- l = Ly(Uu(l, +u[1], +u[2]), u[4]);
7600
- else if (l = $.maxOpen(Ny(l.content, o), !0), l.openStart || l.openEnd) {
7601
+ l = L1(Uu(l, +u[1], +u[2]), u[4]);
7602
+ else if (l = $.maxOpen(N1(l.content, o), !0), l.openStart || l.openEnd) {
7601
7603
  let d = 0, f = 0;
7602
7604
  for (let h = l.content.firstChild; d < l.openStart && !h.type.spec.isolating; d++, h = h.firstChild)
7603
7605
  ;
@@ -7609,8 +7611,8 @@ function Rh(n, e, t, r, o) {
7609
7611
  l = d(l, n);
7610
7612
  }), l;
7611
7613
  }
7612
- const Oy = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7613
- function Ny(n, e) {
7614
+ const O1 = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7615
+ function N1(n, e) {
7614
7616
  if (n.childCount < 2)
7615
7617
  return n;
7616
7618
  for (let t = e.depth; t >= 0; t--) {
@@ -7675,7 +7677,7 @@ let qu = null;
7675
7677
  function Fh() {
7676
7678
  return qu || (qu = document.implementation.createHTMLDocument("title"));
7677
7679
  }
7678
- function Ry(n) {
7680
+ function R1(n) {
7679
7681
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
7680
7682
  e && (n = n.slice(e[0].length));
7681
7683
  let t = Fh().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), o;
@@ -7684,14 +7686,14 @@ function Ry(n) {
7684
7686
  t = t.querySelector(o[i]) || t;
7685
7687
  return t;
7686
7688
  }
7687
- function Dy(n) {
7689
+ function D1(n) {
7688
7690
  let e = n.querySelectorAll(nt ? "span:not([class]):not([style])" : "span.Apple-converted-space");
7689
7691
  for (let t = 0; t < e.length; t++) {
7690
7692
  let r = e[t];
7691
7693
  r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), r);
7692
7694
  }
7693
7695
  }
7694
- function Ly(n, e) {
7696
+ function L1(n, e) {
7695
7697
  if (!n.size)
7696
7698
  return n;
7697
7699
  let t = n.content.firstChild.type.schema, r;
@@ -7709,25 +7711,25 @@ function Ly(n, e) {
7709
7711
  }
7710
7712
  return new $(o, i, s);
7711
7713
  }
7712
- const ot = {}, it = {}, Py = { touchstart: !0, touchmove: !0 };
7713
- class Iy {
7714
+ const ot = {}, it = {}, P1 = { touchstart: !0, touchmove: !0 };
7715
+ class I1 {
7714
7716
  constructor() {
7715
7717
  this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastAndroidDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
7716
7718
  }
7717
7719
  }
7718
- function Fy(n) {
7720
+ function F1(n) {
7719
7721
  for (let e in ot) {
7720
7722
  let t = ot[e];
7721
7723
  n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
7722
- By(n, r) && !mc(n, r) && (n.editable || !(r.type in it)) && t(n, r);
7723
- }, Py[e] ? { passive: !0 } : void 0);
7724
+ B1(n, r) && !mc(n, r) && (n.editable || !(r.type in it)) && t(n, r);
7725
+ }, P1[e] ? { passive: !0 } : void 0);
7724
7726
  }
7725
7727
  rt && n.dom.addEventListener("input", () => null), Oa(n);
7726
7728
  }
7727
7729
  function $n(n, e) {
7728
7730
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
7729
7731
  }
7730
- function $y(n) {
7732
+ function $1(n) {
7731
7733
  n.domObserver.stop();
7732
7734
  for (let e in n.input.eventHandlers)
7733
7735
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
@@ -7745,7 +7747,7 @@ function mc(n, e) {
7745
7747
  return r ? r(n, e) || e.defaultPrevented : !1;
7746
7748
  });
7747
7749
  }
7748
- function By(n, e) {
7750
+ function B1(n, e) {
7749
7751
  if (!e.bubbles)
7750
7752
  return !0;
7751
7753
  if (e.defaultPrevented)
@@ -7755,7 +7757,7 @@ function By(n, e) {
7755
7757
  return !1;
7756
7758
  return !0;
7757
7759
  }
7758
- function Hy(n, e) {
7760
+ function H1(n, e) {
7759
7761
  !mc(n, e) && ot[e.type] && (n.editable || !(e.type in it)) && ot[e.type](n, e);
7760
7762
  }
7761
7763
  it.keydown = (n, e) => {
@@ -7767,7 +7769,7 @@ it.keydown = (n, e) => {
7767
7769
  n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (o) => o(n, or(13, "Enter"))), n.input.lastIOSEnter = 0);
7768
7770
  }, 200);
7769
7771
  } else
7770
- n.someProp("handleKeyDown", (r) => r(n, t)) || My(n, t) ? t.preventDefault() : $n(n, "key");
7772
+ n.someProp("handleKeyDown", (r) => r(n, t)) || M1(n, t) ? t.preventDefault() : $n(n, "key");
7771
7773
  };
7772
7774
  it.keyup = (n, e) => {
7773
7775
  e.keyCode == 16 && (n.input.shiftKey = !1);
@@ -7789,7 +7791,7 @@ it.keypress = (n, e) => {
7789
7791
  function sl(n) {
7790
7792
  return { left: n.clientX, top: n.clientY };
7791
7793
  }
7792
- function jy(n, e) {
7794
+ function j1(n, e) {
7793
7795
  let t = e.x - n.clientX, r = e.y - n.clientY;
7794
7796
  return t * t + r * r < 100;
7795
7797
  }
@@ -7807,13 +7809,13 @@ function Gr(n, e, t) {
7807
7809
  let r = n.state.tr.setSelection(e);
7808
7810
  r.setMeta("pointer", !0), n.dispatch(r);
7809
7811
  }
7810
- function zy(n, e) {
7812
+ function z1(n, e) {
7811
7813
  if (e == -1)
7812
7814
  return !1;
7813
7815
  let t = n.state.doc.resolve(e), r = t.nodeAfter;
7814
7816
  return r && r.isAtom && _.isSelectable(r) ? (Gr(n, new _(t)), !0) : !1;
7815
7817
  }
7816
- function Vy(n, e) {
7818
+ function V1(n, e) {
7817
7819
  if (e == -1)
7818
7820
  return !1;
7819
7821
  let t = n.state.selection, r, o;
@@ -7828,16 +7830,16 @@ function Vy(n, e) {
7828
7830
  }
7829
7831
  return o != null ? (Gr(n, _.create(n.state.doc, o)), !0) : !1;
7830
7832
  }
7831
- function _y(n, e, t, r, o) {
7832
- return gc(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (i) => i(n, e, r)) || (o ? Vy(n, t) : zy(n, t));
7833
+ function _1(n, e, t, r, o) {
7834
+ return gc(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (i) => i(n, e, r)) || (o ? V1(n, t) : z1(n, t));
7833
7835
  }
7834
- function Wy(n, e, t, r) {
7836
+ function W1(n, e, t, r) {
7835
7837
  return gc(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (o) => o(n, e, r));
7836
7838
  }
7837
- function Uy(n, e, t, r) {
7838
- return gc(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (o) => o(n, e, r)) || qy(n, t, r);
7839
+ function U1(n, e, t, r) {
7840
+ return gc(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (o) => o(n, e, r)) || q1(n, t, r);
7839
7841
  }
7840
- function qy(n, e, t) {
7842
+ function q1(n, e, t) {
7841
7843
  if (t.button != 0)
7842
7844
  return !1;
7843
7845
  let r = n.state.doc;
@@ -7863,11 +7865,11 @@ ot.mousedown = (n, e) => {
7863
7865
  let t = e;
7864
7866
  n.input.shiftKey = t.shiftKey;
7865
7867
  let r = yc(n), o = Date.now(), i = "singleClick";
7866
- o - n.input.lastClick.time < 500 && jy(t, n.input.lastClick) && !t[$h] && (n.input.lastClick.type == "singleClick" ? i = "doubleClick" : n.input.lastClick.type == "doubleClick" && (i = "tripleClick")), n.input.lastClick = { time: o, x: t.clientX, y: t.clientY, type: i };
7868
+ o - n.input.lastClick.time < 500 && j1(t, n.input.lastClick) && !t[$h] && (n.input.lastClick.type == "singleClick" ? i = "doubleClick" : n.input.lastClick.type == "doubleClick" && (i = "tripleClick")), n.input.lastClick = { time: o, x: t.clientX, y: t.clientY, type: i };
7867
7869
  let s = n.posAtCoords(sl(t));
7868
- s && (i == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Ky(n, s, t, !!r)) : (i == "doubleClick" ? Wy : Uy)(n, s.pos, s.inside, t) ? t.preventDefault() : $n(n, "pointer"));
7870
+ s && (i == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new K1(n, s, t, !!r)) : (i == "doubleClick" ? W1 : U1)(n, s.pos, s.inside, t) ? t.preventDefault() : $n(n, "pointer"));
7869
7871
  };
7870
- class Ky {
7872
+ class K1 {
7871
7873
  constructor(e, t, r, o) {
7872
7874
  this.view = e, this.pos = t, this.event = r, this.flushed = o, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[$h], this.allowDefault = r.shiftKey;
7873
7875
  let i, s;
@@ -7896,7 +7898,7 @@ class Ky {
7896
7898
  if (this.done(), !this.view.dom.contains(e.target))
7897
7899
  return;
7898
7900
  let t = this.pos;
7899
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(sl(e))), this.updateAllowDefault(e), this.allowDefault || !t ? $n(this.view, "pointer") : _y(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7901
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(sl(e))), this.updateAllowDefault(e), this.allowDefault || !t ? $n(this.view, "pointer") : _1(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7900
7902
  rt && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
7901
7903
  // cursor, but still report that the node is selected
7902
7904
  // when asked through getSelection. You'll then get a
@@ -7923,7 +7925,7 @@ ot.contextmenu = (n) => yc(n);
7923
7925
  function Bh(n, e) {
7924
7926
  return n.composing ? !0 : rt && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
7925
7927
  }
7926
- const Jy = Pt ? 5e3 : -1;
7928
+ const J1 = Pt ? 5e3 : -1;
7927
7929
  it.compositionstart = it.compositionupdate = (n) => {
7928
7930
  if (!n.composing) {
7929
7931
  n.domObserver.flush();
@@ -7945,7 +7947,7 @@ it.compositionstart = it.compositionupdate = (n) => {
7945
7947
  }
7946
7948
  n.input.composing = !0;
7947
7949
  }
7948
- Hh(n, Jy);
7950
+ Hh(n, J1);
7949
7951
  };
7950
7952
  it.compositionend = (n, e) => {
7951
7953
  n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, Hh(n, 20));
@@ -7954,10 +7956,10 @@ function Hh(n, e) {
7954
7956
  clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => ls(n), e));
7955
7957
  }
7956
7958
  function jh(n) {
7957
- for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Gy()); n.input.compositionNodes.length > 0; )
7959
+ for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = G1()); n.input.compositionNodes.length > 0; )
7958
7960
  n.input.compositionNodes.pop().markParentsDirty();
7959
7961
  }
7960
- function Zy(n) {
7962
+ function Z1(n) {
7961
7963
  let e = n.domSelectionRange();
7962
7964
  if (!e.focusNode)
7963
7965
  return null;
@@ -7974,7 +7976,7 @@ function Zy(n) {
7974
7976
  }
7975
7977
  return t || r;
7976
7978
  }
7977
- function Gy() {
7979
+ function G1() {
7978
7980
  let n = document.createEvent("Event");
7979
7981
  return n.initEvent("event", !0, !0), n.timeStamp;
7980
7982
  }
@@ -7987,7 +7989,7 @@ function ls(n, e = !1) {
7987
7989
  return !1;
7988
7990
  }
7989
7991
  }
7990
- function Yy(n, e) {
7992
+ function Y1(n, e) {
7991
7993
  if (!n.dom.parentNode)
7992
7994
  return;
7993
7995
  let t = n.dom.parentNode.appendChild(document.createElement("div"));
@@ -8003,12 +8005,12 @@ ot.copy = it.cut = (n, e) => {
8003
8005
  if (r.empty)
8004
8006
  return;
8005
8007
  let i = Uo ? null : t.clipboardData, s = r.content(), { dom: l, text: a } = Nh(n, s);
8006
- i ? (t.preventDefault(), i.clearData(), i.setData("text/html", l.innerHTML), i.setData("text/plain", a)) : Yy(n, l), o && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8008
+ i ? (t.preventDefault(), i.clearData(), i.setData("text/html", l.innerHTML), i.setData("text/plain", a)) : Y1(n, l), o && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8007
8009
  };
8008
- function Xy(n) {
8010
+ function X1(n) {
8009
8011
  return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
8010
8012
  }
8011
- function Qy(n, e) {
8013
+ function Q1(n, e) {
8012
8014
  if (!n.dom.parentNode)
8013
8015
  return;
8014
8016
  let t = n.input.shiftKey || n.state.selection.$from.parent.type.spec.code, r = n.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
@@ -8024,7 +8026,7 @@ function qo(n, e, t, r, o) {
8024
8026
  return !0;
8025
8027
  if (!i)
8026
8028
  return !1;
8027
- let s = Xy(i), l = s ? n.state.tr.replaceSelectionWith(s, r) : n.state.tr.replaceSelection(i);
8029
+ let s = X1(i), l = s ? n.state.tr.replaceSelectionWith(s, r) : n.state.tr.replaceSelection(i);
8028
8030
  return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
8029
8031
  }
8030
8032
  function zh(n) {
@@ -8039,7 +8041,7 @@ it.paste = (n, e) => {
8039
8041
  if (n.composing && !Pt)
8040
8042
  return;
8041
8043
  let r = Uo ? null : t.clipboardData, o = n.input.shiftKey && n.input.lastKeyCode != 45;
8042
- r && qo(n, zh(r), r.getData("text/html"), o, t) ? t.preventDefault() : Qy(n, t);
8044
+ r && qo(n, zh(r), r.getData("text/html"), o, t) ? t.preventDefault() : Q1(n, t);
8043
8045
  };
8044
8046
  class Vh {
8045
8047
  constructor(e, t, r) {
@@ -8327,7 +8329,7 @@ class be {
8327
8329
  let a = this.local[l].map(e, r, o);
8328
8330
  a && a.type.valid(t, a) ? (s || (s = [])).push(a) : i.onRemove && i.onRemove(this.local[l].spec);
8329
8331
  }
8330
- return this.children.length ? e1(this.children, s || [], e, t, r, o, i) : s ? new be(s.sort(hr), zr) : Ke;
8332
+ return this.children.length ? ey(this.children, s || [], e, t, r, o, i) : s ? new be(s.sort(hr), zr) : Ke;
8331
8333
  }
8332
8334
  /**
8333
8335
  Add the given array of decorations to the ones in the set,
@@ -8498,7 +8500,7 @@ class Rn {
8498
8500
  }
8499
8501
  }
8500
8502
  }
8501
- function e1(n, e, t, r, o, i, s) {
8503
+ function ey(n, e, t, r, o, i, s) {
8502
8504
  let l = n.slice();
8503
8505
  for (let c = 0, u = i; c < t.maps.length; c++) {
8504
8506
  let d = 0;
@@ -8534,7 +8536,7 @@ function e1(n, e, t, r, o, i, s) {
8534
8536
  a = !0;
8535
8537
  }
8536
8538
  if (a) {
8537
- let c = t1(l, n, e, t, o, i, s), u = cs(c, r, 0, s);
8539
+ let c = ty(l, n, e, t, o, i, s), u = cs(c, r, 0, s);
8538
8540
  e = u.local;
8539
8541
  for (let d = 0; d < l.length; d += 3)
8540
8542
  l[d + 1] < 0 && (l.splice(d, 3), d -= 3);
@@ -8557,7 +8559,7 @@ function Wh(n, e) {
8557
8559
  }
8558
8560
  return t;
8559
8561
  }
8560
- function t1(n, e, t, r, o, i, s) {
8562
+ function ty(n, e, t, r, o, i, s) {
8561
8563
  function l(a, c) {
8562
8564
  for (let u = 0; u < a.local.length; u++) {
8563
8565
  let d = a.local[u].map(r, o, c);
@@ -8632,15 +8634,15 @@ function $l(n) {
8632
8634
  r && r != Ke && e.push(r);
8633
8635
  }), n.cursorWrapper && e.push(be.create(n.state.doc, [n.cursorWrapper.deco])), Rn.from(e);
8634
8636
  }
8635
- const n1 = {
8637
+ const ny = {
8636
8638
  childList: !0,
8637
8639
  characterData: !0,
8638
8640
  characterDataOldValue: !0,
8639
8641
  attributes: !0,
8640
8642
  attributeOldValue: !0,
8641
8643
  subtree: !0
8642
- }, r1 = ct && Bn <= 11;
8643
- class o1 {
8644
+ }, ry = ct && Bn <= 11;
8645
+ class oy {
8644
8646
  constructor() {
8645
8647
  this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
8646
8648
  }
@@ -8654,13 +8656,13 @@ class o1 {
8654
8656
  return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
8655
8657
  }
8656
8658
  }
8657
- class i1 {
8659
+ class iy {
8658
8660
  constructor(e, t) {
8659
- this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new o1(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
8661
+ this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new oy(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
8660
8662
  for (let o = 0; o < r.length; o++)
8661
8663
  this.queue.push(r[o]);
8662
8664
  ct && Bn <= 11 && r.some((o) => o.type == "childList" && o.removedNodes.length || o.type == "characterData" && o.oldValue.length > o.target.nodeValue.length) ? this.flushSoon() : this.flush();
8663
- }), r1 && (this.onCharData = (r) => {
8665
+ }), ry && (this.onCharData = (r) => {
8664
8666
  this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
8665
8667
  }), this.onSelectionChange = this.onSelectionChange.bind(this);
8666
8668
  }
@@ -8673,7 +8675,7 @@ class i1 {
8673
8675
  this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
8674
8676
  }
8675
8677
  start() {
8676
- this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, n1)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8678
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, ny)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8677
8679
  }
8678
8680
  stop() {
8679
8681
  if (this.observer) {
@@ -8756,12 +8758,12 @@ class i1 {
8756
8758
  let { focusNode: d } = this.currentSelection;
8757
8759
  for (let f of u) {
8758
8760
  let h = f.parentNode;
8759
- h && h.nodeName == "LI" && (!d || a1(e, d) != h) && f.remove();
8761
+ h && h.nodeName == "LI" && (!d || ay(e, d) != h) && f.remove();
8760
8762
  }
8761
8763
  }
8762
8764
  }
8763
8765
  let c = null;
8764
- i < 0 && o && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && ol(r) && (c = hc(e)) && c.eq(K.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, bn(e), this.currentSelection.set(r), e.scrollToSelection()) : (i > -1 || o) && (i > -1 && (e.docView.markDirty(i, s), s1(e)), this.handleDOMChange(i, s, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || bn(e), this.currentSelection.set(r));
8766
+ i < 0 && o && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && ol(r) && (c = hc(e)) && c.eq(K.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, bn(e), this.currentSelection.set(r), e.scrollToSelection()) : (i > -1 || o) && (i > -1 && (e.docView.markDirty(i, s), sy(e)), this.handleDOMChange(i, s, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || bn(e), this.currentSelection.set(r));
8765
8767
  }
8766
8768
  registerMutation(e, t) {
8767
8769
  if (t.indexOf(e.target) > -1)
@@ -8796,7 +8798,7 @@ class i1 {
8796
8798
  }
8797
8799
  }
8798
8800
  let Ju = /* @__PURE__ */ new WeakMap(), Zu = !1;
8799
- function s1(n) {
8801
+ function sy(n) {
8800
8802
  if (!Ju.has(n) && (Ju.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
8801
8803
  if (n.requiresGeckoHackNode = $t, Zu)
8802
8804
  return;
@@ -8807,7 +8809,7 @@ function Gu(n, e) {
8807
8809
  let t = e.startContainer, r = e.startOffset, o = e.endContainer, i = e.endOffset, s = n.domAtPos(n.state.selection.anchor);
8808
8810
  return yr(s.node, s.offset, o, i) && ([t, r, o, i] = [o, i, t, r]), { anchorNode: t, anchorOffset: r, focusNode: o, focusOffset: i };
8809
8811
  }
8810
- function l1(n, e) {
8812
+ function ly(n, e) {
8811
8813
  if (e.getComposedRanges) {
8812
8814
  let o = e.getComposedRanges(n.root)[0];
8813
8815
  if (o)
@@ -8819,7 +8821,7 @@ function l1(n, e) {
8819
8821
  }
8820
8822
  return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? Gu(n, t) : null;
8821
8823
  }
8822
- function a1(n, e) {
8824
+ function ay(n, e) {
8823
8825
  for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
8824
8826
  let r = n.docView.nearestDesc(t, !0);
8825
8827
  if (r && r.node.isBlock)
@@ -8827,7 +8829,7 @@ function a1(n, e) {
8827
8829
  }
8828
8830
  return null;
8829
8831
  }
8830
- function c1(n, e, t) {
8832
+ function cy(n, e, t) {
8831
8833
  let { node: r, fromOffset: o, toOffset: i, from: s, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, u = a.anchorNode;
8832
8834
  if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], ol(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), nt && n.input.lastKeyCode === 8)
8833
8835
  for (let g = i; g > o; g--) {
@@ -8847,7 +8849,7 @@ function c1(n, e, t) {
8847
8849
  to: i,
8848
8850
  preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
8849
8851
  findPositions: c,
8850
- ruleFromNode: u1,
8852
+ ruleFromNode: uy,
8851
8853
  context: h
8852
8854
  });
8853
8855
  if (c && c[0].pos != null) {
@@ -8856,7 +8858,7 @@ function c1(n, e, t) {
8856
8858
  }
8857
8859
  return { doc: m, sel: p, from: s, to: l };
8858
8860
  }
8859
- function u1(n) {
8861
+ function uy(n) {
8860
8862
  let e = n.pmViewDesc;
8861
8863
  if (e)
8862
8864
  return e.parseRule();
@@ -8870,8 +8872,8 @@ function u1(n) {
8870
8872
  return { ignore: !0 };
8871
8873
  return null;
8872
8874
  }
8873
- const d1 = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
8874
- function f1(n, e, t, r, o) {
8875
+ const dy = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
8876
+ function fy(n, e, t, r, o) {
8875
8877
  let i = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
8876
8878
  if (n.input.compositionPendingChanges = 0, e < 0) {
8877
8879
  let E = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, D = hc(n, E);
@@ -8885,10 +8887,10 @@ function f1(n, e, t, r, o) {
8885
8887
  }
8886
8888
  let s = n.state.doc.resolve(e), l = s.sharedDepth(t);
8887
8889
  e = s.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
8888
- let a = n.state.selection, c = c1(n, e, t), u = n.state.doc, d = u.slice(c.from, c.to), f, h;
8890
+ let a = n.state.selection, c = cy(n, e, t), u = n.state.doc, d = u.slice(c.from, c.to), f, h;
8889
8891
  n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, h = "end") : (f = n.state.selection.from, h = "start"), n.input.lastKeyCode = null;
8890
- let p = m1(d.content, c.doc.content, c.from, f, h);
8891
- if ((ro && n.input.lastIOSEnter > Date.now() - 225 || Pt) && o.some((E) => E.nodeType == 1 && !d1.test(E.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (E) => E(n, or(13, "Enter")))) {
8892
+ let p = my(d.content, c.doc.content, c.from, f, h);
8893
+ if ((ro && n.input.lastIOSEnter > Date.now() - 225 || Pt) && o.some((E) => E.nodeType == 1 && !dy.test(E.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (E) => E(n, or(13, "Enter")))) {
8892
8894
  n.input.lastIOSEnter = 0;
8893
8895
  return;
8894
8896
  }
@@ -8911,7 +8913,7 @@ function f1(n, e, t, r, o) {
8911
8913
  n.input.lastIOSEnter = 0;
8912
8914
  return;
8913
8915
  }
8914
- if (n.state.selection.anchor > p.start && p1(u, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (E) => E(n, or(8, "Backspace")))) {
8916
+ if (n.state.selection.anchor > p.start && py(u, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (E) => E(n, or(8, "Backspace")))) {
8915
8917
  Pt && nt && n.domObserver.suppressSelectionUpdates();
8916
8918
  return;
8917
8919
  }
@@ -8926,7 +8928,7 @@ function f1(n, e, t, r, o) {
8926
8928
  ct && Bn <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => bn(n), 20)), C = n.state.tr.delete(v, S), M = u.resolve(p.start).marksAcross(u.resolve(p.endA));
8927
8929
  else if (
8928
8930
  // Adding or removing a mark
8929
- p.endA == p.endB && (N = h1(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
8931
+ p.endA == p.endB && (N = hy(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
8930
8932
  )
8931
8933
  C = n.state.tr, N.type == "add" ? C.addMark(v, S, N.mark) : C.removeMark(v, S, N.mark);
8932
8934
  else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
@@ -8945,7 +8947,7 @@ function f1(n, e, t, r, o) {
8945
8947
  function Yu(n, e, t) {
8946
8948
  return Math.max(t.anchor, t.head) > e.content.size ? null : pc(n, e.resolve(t.anchor), e.resolve(t.head));
8947
8949
  }
8948
- function h1(n, e) {
8950
+ function hy(n, e) {
8949
8951
  let t = n.firstChild.marks, r = e.firstChild.marks, o = t, i = r, s, l, a;
8950
8952
  for (let u = 0; u < r.length; u++)
8951
8953
  o = r[u].removeFromSet(o);
@@ -8963,7 +8965,7 @@ function h1(n, e) {
8963
8965
  if (T.from(c).eq(n))
8964
8966
  return { mark: l, type: s };
8965
8967
  }
8966
- function p1(n, e, t, r, o) {
8968
+ function py(n, e, t, r, o) {
8967
8969
  if (
8968
8970
  // The content must have shrunk
8969
8971
  t - e <= o.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
@@ -8991,7 +8993,7 @@ function Bl(n, e, t) {
8991
8993
  }
8992
8994
  return o;
8993
8995
  }
8994
- function m1(n, e, t, r, o) {
8996
+ function my(n, e, t, r, o) {
8995
8997
  let i = n.findDiffStart(e, t);
8996
8998
  if (i == null)
8997
8999
  return null;
@@ -9015,7 +9017,7 @@ function Xu(n) {
9015
9017
  let e = n.charCodeAt(0), t = n.charCodeAt(1);
9016
9018
  return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
9017
9019
  }
9018
- class g1 {
9020
+ class gy {
9019
9021
  /**
9020
9022
  Create a view. `place` may be a DOM node that the editor should
9021
9023
  be appended to, a function that will place it into the document,
@@ -9024,7 +9026,7 @@ class g1 {
9024
9026
  added to the document.
9025
9027
  */
9026
9028
  constructor(e, t) {
9027
- this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Iy(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(rd), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = td(this), ed(this), this.nodeViews = nd(this), this.docView = Lu(this.state.doc, Qu(this), $l(this), this.dom, this), this.domObserver = new i1(this, (r, o, i, s) => f1(this, r, o, i, s)), this.domObserver.start(), Fy(this), this.updatePluginViews();
9029
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new I1(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(rd), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = td(this), ed(this), this.nodeViews = nd(this), this.docView = Lu(this.state.doc, Qu(this), $l(this), this.dom, this), this.domObserver = new iy(this, (r, o, i, s) => fy(this, r, o, i, s)), this.domObserver.start(), F1(this), this.updatePluginViews();
9028
9030
  }
9029
9031
  /**
9030
9032
  Holds `true` when a
@@ -9084,7 +9086,7 @@ class g1 {
9084
9086
  let l = o.plugins != e.plugins || this._props.plugins != t.plugins;
9085
9087
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
9086
9088
  let h = nd(this);
9087
- v1(h, this.nodeViews) && (this.nodeViews = h, i = !0);
9089
+ vy(h, this.nodeViews) && (this.nodeViews = h, i = !0);
9088
9090
  }
9089
9091
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && Oa(this), this.editable = td(this), ed(this);
9090
9092
  let a = $l(this), c = Qu(this), u = o.plugins != e.plugins && !o.doc.eq(e.doc) ? "reset" : e.scrollToSelection > o.scrollToSelection ? "to selection" : "preserve", d = i || !this.docView.matchesNode(e.doc, c, a);
@@ -9092,12 +9094,12 @@ class g1 {
9092
9094
  let f = u == "preserve" && s && this.dom.style.overflowAnchor == null && Y0(this);
9093
9095
  if (s) {
9094
9096
  this.domObserver.stop();
9095
- let h = d && (ct || nt) && !this.composing && !o.selection.empty && !e.selection.empty && y1(o.selection, e.selection);
9097
+ let h = d && (ct || nt) && !this.composing && !o.selection.empty && !e.selection.empty && yy(o.selection, e.selection);
9096
9098
  if (d) {
9097
9099
  let p = nt ? this.trackWrites = this.domSelectionRange().focusNode : null;
9098
- this.composing && (this.input.compositionNode = Zy(this)), (i || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Lu(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
9100
+ this.composing && (this.input.compositionNode = Z1(this)), (i || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Lu(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (h = !0);
9099
9101
  }
9100
- h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && xy(this)) ? bn(this, h) : (Th(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9102
+ h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && x1(this)) ? bn(this, h) : (Th(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9101
9103
  }
9102
9104
  this.updatePluginViews(o), !((r = this.dragging) === null || r === void 0) && r.node && !o.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, o), u == "reset" ? this.dom.scrollTop = 0 : u == "to selection" ? this.scrollToSelection() : f && X0(f);
9103
9105
  }
@@ -9219,7 +9221,7 @@ class g1 {
9219
9221
  the top level, not in any node.
9220
9222
  */
9221
9223
  posAtCoords(e) {
9222
- return oy(this, e);
9224
+ return o1(this, e);
9223
9225
  }
9224
9226
  /**
9225
9227
  Returns the viewport rectangle at a given document position.
@@ -9284,7 +9286,7 @@ class g1 {
9284
9286
  pass a different state.
9285
9287
  */
9286
9288
  endOfTextblock(e, t) {
9287
- return cy(this, t || this.state, e);
9289
+ return c1(this, t || this.state, e);
9288
9290
  }
9289
9291
  /**
9290
9292
  Run the editor's paste logic with the given HTML string. The
@@ -9305,7 +9307,7 @@ class g1 {
9305
9307
  views](https://prosemirror.net/docs/ref/#view.NodeView).
9306
9308
  */
9307
9309
  destroy() {
9308
- this.docView && ($y(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], $l(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, H0());
9310
+ this.docView && ($1(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], $l(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, H0());
9309
9311
  }
9310
9312
  /**
9311
9313
  This is true when the view has been
@@ -9319,7 +9321,7 @@ class g1 {
9319
9321
  Used for testing.
9320
9322
  */
9321
9323
  dispatchEvent(e) {
9322
- return Hy(this, e);
9324
+ return H1(this, e);
9323
9325
  }
9324
9326
  /**
9325
9327
  Dispatch a transaction. Will call
@@ -9339,7 +9341,7 @@ class g1 {
9339
9341
  */
9340
9342
  domSelectionRange() {
9341
9343
  let e = this.domSelection();
9342
- return rt && this.root.nodeType === 11 && W0(this.dom.ownerDocument) == this.dom && l1(this, e) || e;
9344
+ return rt && this.root.nodeType === 11 && W0(this.dom.ownerDocument) == this.dom && ly(this, e) || e;
9343
9345
  }
9344
9346
  /**
9345
9347
  @internal
@@ -9366,7 +9368,7 @@ function ed(n) {
9366
9368
  function td(n) {
9367
9369
  return !n.someProp("editable", (e) => e(n.state) === !1);
9368
9370
  }
9369
- function y1(n, e) {
9371
+ function yy(n, e) {
9370
9372
  let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
9371
9373
  return n.$anchor.start(t) != e.$anchor.start(t);
9372
9374
  }
@@ -9378,7 +9380,7 @@ function nd(n) {
9378
9380
  }
9379
9381
  return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
9380
9382
  }
9381
- function v1(n, e) {
9383
+ function vy(n, e) {
9382
9384
  let t = 0, r = 0;
9383
9385
  for (let o in n) {
9384
9386
  if (n[o] != e[o])
@@ -9471,7 +9473,7 @@ var Vn = {
9471
9473
  220: "|",
9472
9474
  221: "}",
9473
9475
  222: '"'
9474
- }, b1 = typeof navigator < "u" && /Mac/.test(navigator.platform), w1 = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
9476
+ }, by = typeof navigator < "u" && /Mac/.test(navigator.platform), wy = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
9475
9477
  for (var Ve = 0; Ve < 10; Ve++)
9476
9478
  Vn[48 + Ve] = Vn[96 + Ve] = String(Ve);
9477
9479
  for (var Ve = 1; Ve <= 24; Ve++)
@@ -9480,12 +9482,12 @@ for (var Ve = 65; Ve <= 90; Ve++)
9480
9482
  Vn[Ve] = String.fromCharCode(Ve + 32), us[Ve] = String.fromCharCode(Ve);
9481
9483
  for (var Hl in Vn)
9482
9484
  us.hasOwnProperty(Hl) || (us[Hl] = Vn[Hl]);
9483
- function x1(n) {
9484
- var e = b1 && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || w1 && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? us : Vn)[n.keyCode] || n.key || "Unidentified";
9485
+ function xy(n) {
9486
+ var e = by && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || wy && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? us : Vn)[n.keyCode] || n.key || "Unidentified";
9485
9487
  return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
9486
9488
  }
9487
- const k1 = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
9488
- function C1(n) {
9489
+ const ky = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
9490
+ function Cy(n) {
9489
9491
  let e = n.split(/-(?!$)/), t = e[e.length - 1];
9490
9492
  t == "Space" && (t = " ");
9491
9493
  let r, o, i, s;
@@ -9500,28 +9502,28 @@ function C1(n) {
9500
9502
  else if (/^s(hift)?$/i.test(a))
9501
9503
  i = !0;
9502
9504
  else if (/^mod$/i.test(a))
9503
- k1 ? s = !0 : o = !0;
9505
+ ky ? s = !0 : o = !0;
9504
9506
  else
9505
9507
  throw new Error("Unrecognized modifier name: " + a);
9506
9508
  }
9507
9509
  return r && (t = "Alt-" + t), o && (t = "Ctrl-" + t), s && (t = "Meta-" + t), i && (t = "Shift-" + t), t;
9508
9510
  }
9509
- function S1(n) {
9511
+ function Sy(n) {
9510
9512
  let e = /* @__PURE__ */ Object.create(null);
9511
9513
  for (let t in n)
9512
- e[C1(t)] = n[t];
9514
+ e[Cy(t)] = n[t];
9513
9515
  return e;
9514
9516
  }
9515
9517
  function jl(n, e, t = !0) {
9516
9518
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
9517
9519
  }
9518
- function E1(n) {
9520
+ function Ey(n) {
9519
9521
  return new xe({ props: { handleKeyDown: wc(n) } });
9520
9522
  }
9521
9523
  function wc(n) {
9522
- let e = S1(n);
9524
+ let e = Sy(n);
9523
9525
  return function(t, r) {
9524
- let o = x1(r), i, s = e[jl(o, r)];
9526
+ let o = xy(r), i, s = e[jl(o, r)];
9525
9527
  if (s && s(t.state, t.dispatch, t))
9526
9528
  return !0;
9527
9529
  if (o.length == 1 && o != " ") {
@@ -9539,12 +9541,12 @@ function wc(n) {
9539
9541
  return !1;
9540
9542
  };
9541
9543
  }
9542
- const A1 = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
9544
+ const Ay = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
9543
9545
  function Kh(n, e) {
9544
9546
  let { $cursor: t } = n.selection;
9545
9547
  return !t || (e ? !e.endOfTextblock("backward", n) : t.parentOffset > 0) ? null : t;
9546
9548
  }
9547
- const T1 = (n, e, t) => {
9549
+ const Ty = (n, e, t) => {
9548
9550
  let r = Kh(n, t);
9549
9551
  if (!r)
9550
9552
  return !1;
@@ -9567,13 +9569,13 @@ const T1 = (n, e, t) => {
9567
9569
  }
9568
9570
  }
9569
9571
  return i.isAtom && o.depth == r.depth - 1 ? (e && e(n.tr.delete(o.pos - i.nodeSize, o.pos).scrollIntoView()), !0) : !1;
9570
- }, M1 = (n, e, t) => {
9572
+ }, My = (n, e, t) => {
9571
9573
  let r = Kh(n, t);
9572
9574
  if (!r)
9573
9575
  return !1;
9574
9576
  let o = xc(r);
9575
9577
  return o ? Jh(n, o, e) : !1;
9576
- }, O1 = (n, e, t) => {
9578
+ }, Oy = (n, e, t) => {
9577
9579
  let r = Zh(n, t);
9578
9580
  if (!r)
9579
9581
  return !1;
@@ -9617,7 +9619,7 @@ function oo(n, e, t = !1) {
9617
9619
  }
9618
9620
  return !1;
9619
9621
  }
9620
- const N1 = (n, e, t) => {
9622
+ const Ny = (n, e, t) => {
9621
9623
  let { $head: r, empty: o } = n.selection, i = r;
9622
9624
  if (!o)
9623
9625
  return !1;
@@ -9643,7 +9645,7 @@ function Zh(n, e) {
9643
9645
  let { $cursor: t } = n.selection;
9644
9646
  return !t || (e ? !e.endOfTextblock("forward", n) : t.parentOffset < t.parent.content.size) ? null : t;
9645
9647
  }
9646
- const R1 = (n, e, t) => {
9648
+ const Ry = (n, e, t) => {
9647
9649
  let r = Zh(n, t);
9648
9650
  if (!r)
9649
9651
  return !1;
@@ -9664,7 +9666,7 @@ const R1 = (n, e, t) => {
9664
9666
  }
9665
9667
  }
9666
9668
  return i.isAtom && o.depth == r.depth - 1 ? (e && e(n.tr.delete(o.pos, o.pos + i.nodeSize).scrollIntoView()), !0) : !1;
9667
- }, D1 = (n, e, t) => {
9669
+ }, Dy = (n, e, t) => {
9668
9670
  let { $head: r, empty: o } = n.selection, i = r;
9669
9671
  if (!o)
9670
9672
  return !1;
@@ -9687,7 +9689,7 @@ function kc(n) {
9687
9689
  }
9688
9690
  return null;
9689
9691
  }
9690
- const L1 = (n, e) => {
9692
+ const Ly = (n, e) => {
9691
9693
  let t = n.selection, r = t instanceof _, o;
9692
9694
  if (r) {
9693
9695
  if (t.node.isTextblock || !Kn(n.doc, t.from))
@@ -9700,7 +9702,7 @@ const L1 = (n, e) => {
9700
9702
  r && i.setSelection(_.create(i.doc, o - n.doc.resolve(o).nodeBefore.nodeSize)), e(i.scrollIntoView());
9701
9703
  }
9702
9704
  return !0;
9703
- }, P1 = (n, e) => {
9705
+ }, Py = (n, e) => {
9704
9706
  let t = n.selection, r;
9705
9707
  if (t instanceof _) {
9706
9708
  if (t.node.isTextblock || !Kn(n.doc, t.to))
@@ -9709,10 +9711,10 @@ const L1 = (n, e) => {
9709
9711
  } else if (r = tl(n.doc, t.to, 1), r == null)
9710
9712
  return !1;
9711
9713
  return e && e(n.tr.join(r).scrollIntoView()), !0;
9712
- }, I1 = (n, e) => {
9714
+ }, Iy = (n, e) => {
9713
9715
  let { $from: t, $to: r } = n.selection, o = t.blockRange(r), i = o && mo(o);
9714
9716
  return i == null ? !1 : (e && e(n.tr.lift(o, i).scrollIntoView()), !0);
9715
- }, F1 = (n, e) => {
9717
+ }, Fy = (n, e) => {
9716
9718
  let { $head: t, $anchor: r } = n.selection;
9717
9719
  return !t.parent.type.spec.code || !t.sameParent(r) ? !1 : (e && e(n.tr.insertText(`
9718
9720
  `).scrollIntoView()), !0);
@@ -9725,7 +9727,7 @@ function Gh(n) {
9725
9727
  }
9726
9728
  return null;
9727
9729
  }
9728
- const $1 = (n, e) => {
9730
+ const $y = (n, e) => {
9729
9731
  let { $head: t, $anchor: r } = n.selection;
9730
9732
  if (!t.parent.type.spec.code || !t.sameParent(r))
9731
9733
  return !1;
@@ -9737,7 +9739,7 @@ const $1 = (n, e) => {
9737
9739
  a.setSelection(K.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
9738
9740
  }
9739
9741
  return !0;
9740
- }, B1 = (n, e) => {
9742
+ }, By = (n, e) => {
9741
9743
  let t = n.selection, { $from: r, $to: o } = t;
9742
9744
  if (t instanceof Ft || r.parent.inlineContent || o.parent.inlineContent)
9743
9745
  return !1;
@@ -9749,7 +9751,7 @@ const $1 = (n, e) => {
9749
9751
  l.setSelection(q.create(l.doc, s + 1)), e(l.scrollIntoView());
9750
9752
  }
9751
9753
  return !0;
9752
- }, H1 = (n, e) => {
9754
+ }, Hy = (n, e) => {
9753
9755
  let { $cursor: t } = n.selection;
9754
9756
  if (!t || t.parent.content.size)
9755
9757
  return !1;
@@ -9760,11 +9762,11 @@ const $1 = (n, e) => {
9760
9762
  }
9761
9763
  let r = t.blockRange(), o = r && mo(r);
9762
9764
  return o == null ? !1 : (e && e(n.tr.lift(r, o).scrollIntoView()), !0);
9763
- }, j1 = (n, e) => {
9765
+ }, jy = (n, e) => {
9764
9766
  let { $from: t, to: r } = n.selection, o, i = t.sharedDepth(r);
9765
9767
  return i == 0 ? !1 : (o = t.before(i), e && e(n.tr.setSelection(_.create(n.doc, o))), !0);
9766
9768
  };
9767
- function z1(n, e, t) {
9769
+ function zy(n, e, t) {
9768
9770
  let r = e.nodeBefore, o = e.nodeAfter, i = e.index();
9769
9771
  return !r || !o || !r.type.compatibleContent(o.type) ? !1 : !r.content.size && e.parent.canReplace(i - 1, i) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(i, i + 1) || !(o.isTextblock || Kn(n.doc, e.pos)) ? !1 : (t && t(n.tr.clearIncompatible(e.pos, r.type, r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()), !0);
9770
9772
  }
@@ -9772,7 +9774,7 @@ function Yh(n, e, t) {
9772
9774
  let r = e.nodeBefore, o = e.nodeAfter, i, s;
9773
9775
  if (r.type.spec.isolating || o.type.spec.isolating)
9774
9776
  return !1;
9775
- if (z1(n, e, t))
9777
+ if (zy(n, e, t))
9776
9778
  return !0;
9777
9779
  let l = e.parent.canReplace(e.index(), e.index() + 1);
9778
9780
  if (l && (i = (s = r.contentMatchAt(r.childCount)).findWrapping(o.type)) && s.matchType(i[0] || o.type).validEnd) {
@@ -9820,8 +9822,8 @@ function Xh(n) {
9820
9822
  return o.node(i).isTextblock ? (t && t(e.tr.setSelection(q.create(e.doc, n < 0 ? o.start(i) : o.end(i)))), !0) : !1;
9821
9823
  };
9822
9824
  }
9823
- const V1 = Xh(-1), _1 = Xh(1);
9824
- function W1(n, e = null) {
9825
+ const Vy = Xh(-1), _y = Xh(1);
9826
+ function Wy(n, e = null) {
9825
9827
  return function(t, r) {
9826
9828
  let { $from: o, $to: i } = t.selection, s = o.blockRange(i), l = s && ac(s, n, e);
9827
9829
  return l ? (r && r(t.tr.wrap(s, l).scrollIntoView()), !0) : !1;
@@ -9858,7 +9860,7 @@ function od(n, e = null) {
9858
9860
  };
9859
9861
  }
9860
9862
  typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
9861
- function U1(n, e = null) {
9863
+ function Uy(n, e = null) {
9862
9864
  return function(t, r) {
9863
9865
  let { $from: o, $to: i } = t.selection, s = o.blockRange(i), l = !1, a = s;
9864
9866
  if (!s)
@@ -9870,10 +9872,10 @@ function U1(n, e = null) {
9870
9872
  a = new ts(u, u, s.depth), s.endIndex < s.parent.childCount && (s = new ts(o, t.doc.resolve(i.end(s.depth)), s.depth)), l = !0;
9871
9873
  }
9872
9874
  let c = ac(a, n, e, s);
9873
- return c ? (r && r(q1(t.tr, s, c, l, n).scrollIntoView()), !0) : !1;
9875
+ return c ? (r && r(qy(t.tr, s, c, l, n).scrollIntoView()), !0) : !1;
9874
9876
  };
9875
9877
  }
9876
- function q1(n, e, t, r, o) {
9878
+ function qy(n, e, t, r, o) {
9877
9879
  let i = T.empty;
9878
9880
  for (let u = t.length - 1; u >= 0; u--)
9879
9881
  i = T.from(t[u].type.create(t[u].attrs, i));
@@ -9886,13 +9888,13 @@ function q1(n, e, t, r, o) {
9886
9888
  !f && Jr(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(u).nodeSize;
9887
9889
  return n;
9888
9890
  }
9889
- function K1(n) {
9891
+ function Ky(n) {
9890
9892
  return function(e, t) {
9891
9893
  let { $from: r, $to: o } = e.selection, i = r.blockRange(o, (s) => s.childCount > 0 && s.firstChild.type == n);
9892
- return i ? t ? r.node(i.depth - 1).type == n ? J1(e, t, n, i) : Z1(e, t, i) : !0 : !1;
9894
+ return i ? t ? r.node(i.depth - 1).type == n ? Jy(e, t, n, i) : Zy(e, t, i) : !0 : !1;
9893
9895
  };
9894
9896
  }
9895
- function J1(n, e, t, r) {
9897
+ function Jy(n, e, t, r) {
9896
9898
  let o = n.tr, i = r.end, s = r.$to.end(r.depth);
9897
9899
  i < s && (o.step(new Ie(i - 1, s, i, s, new $(T.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new ts(o.doc.resolve(r.$from.pos), o.doc.resolve(s), r.depth));
9898
9900
  const l = mo(r);
@@ -9902,7 +9904,7 @@ function J1(n, e, t, r) {
9902
9904
  let a = o.mapping.map(i, -1) - 1;
9903
9905
  return Kn(o.doc, a) && o.join(a), e(o.scrollIntoView()), !0;
9904
9906
  }
9905
- function Z1(n, e, t) {
9907
+ function Zy(n, e, t) {
9906
9908
  let r = n.tr, o = t.parent;
9907
9909
  for (let h = t.end, p = t.endIndex - 1, m = t.startIndex; p > m; p--)
9908
9910
  h -= o.child(p).nodeSize, r.delete(h - 1, h + 1);
@@ -9915,7 +9917,7 @@ function Z1(n, e, t) {
9915
9917
  let d = i.pos, f = d + s.nodeSize;
9916
9918
  return r.step(new Ie(d - (l ? 1 : 0), f + (a ? 1 : 0), d + 1, f - 1, new $((l ? T.empty : T.from(o.copy(T.empty))).append(a ? T.empty : T.from(o.copy(T.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
9917
9919
  }
9918
- function G1(n) {
9920
+ function Gy(n) {
9919
9921
  return function(e, t) {
9920
9922
  let { $from: r, $to: o } = e.selection, i = r.blockRange(o, (c) => c.childCount > 0 && c.firstChild.type == n);
9921
9923
  if (!i)
@@ -10018,7 +10020,7 @@ class al {
10018
10020
  return l;
10019
10021
  }
10020
10022
  }
10021
- class Y1 {
10023
+ class Yy {
10022
10024
  constructor() {
10023
10025
  this.callbacks = {};
10024
10026
  }
@@ -10139,10 +10141,10 @@ function ep(n) {
10139
10141
  function Y(n, e = void 0, ...t) {
10140
10142
  return ep(n) ? e ? n.bind(e)(...t) : n(...t) : n;
10141
10143
  }
10142
- function X1(n = {}) {
10144
+ function Xy(n = {}) {
10143
10145
  return Object.keys(n).length === 0 && n.constructor === Object;
10144
10146
  }
10145
- function Q1(n) {
10147
+ function Qy(n) {
10146
10148
  return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
10147
10149
  }
10148
10150
  function id(n, e) {
@@ -10153,7 +10155,7 @@ function id(n, e) {
10153
10155
  if (r === !1)
10154
10156
  return !1;
10155
10157
  const o = e.reduce((i, s) => {
10156
- const l = s.attribute.parseHTML ? s.attribute.parseHTML(t) : Q1(t.getAttribute(s.name));
10158
+ const l = s.attribute.parseHTML ? s.attribute.parseHTML(t) : Qy(t.getAttribute(s.name));
10157
10159
  return l == null ? i : {
10158
10160
  ...i,
10159
10161
  [s.name]: l
@@ -10166,7 +10168,7 @@ function id(n, e) {
10166
10168
  function sd(n) {
10167
10169
  return Object.fromEntries(
10168
10170
  // @ts-ignore
10169
- Object.entries(n).filter(([e, t]) => e === "attrs" && X1(t) ? !1 : t != null)
10171
+ Object.entries(n).filter(([e, t]) => e === "attrs" && Xy(t) ? !1 : t != null)
10170
10172
  );
10171
10173
  }
10172
10174
  function ev(n, e) {
@@ -10598,7 +10600,7 @@ class Ur {
10598
10600
  const m = Object.fromEntries(Object.entries(c()).map(([g, y]) => [g, () => y({ editor: e })]));
10599
10601
  u = { ...u, ...m };
10600
10602
  }
10601
- const d = E1(u);
10603
+ const d = Ey(u);
10602
10604
  a.push(d);
10603
10605
  const f = z(s, "addInputRules", l);
10604
10606
  ld(s, e.options.enableInputRules) && f && r.push(...f());
@@ -10794,7 +10796,7 @@ const fv = Se.create({
10794
10796
  (p || p === 0) && e.lift(h, p);
10795
10797
  });
10796
10798
  }), !0;
10797
- }, gv = (n) => (e) => n(e), yv = () => ({ state: n, dispatch: e }) => B1(n, e), vv = (n, e) => ({ editor: t, tr: r }) => {
10799
+ }, gv = (n) => (e) => n(e), yv = () => ({ state: n, dispatch: e }) => By(n, e), vv = (n, e) => ({ editor: t, tr: r }) => {
10798
10800
  const { state: o } = t, i = o.doc.slice(n.from, n.to);
10799
10801
  r.deleteRange(n.from, n.to);
10800
10802
  const s = r.mapping.map(e);
@@ -10827,7 +10829,7 @@ const fv = Se.create({
10827
10829
  }, xv = (n) => ({ tr: e, dispatch: t }) => {
10828
10830
  const { from: r, to: o } = n;
10829
10831
  return t && e.delete(r, o), !0;
10830
- }, kv = () => ({ state: n, dispatch: e }) => A1(n, e), Cv = () => ({ commands: n }) => n.keyboardShortcut("Enter"), Sv = () => ({ state: n, dispatch: e }) => $1(n, e);
10832
+ }, kv = () => ({ state: n, dispatch: e }) => Ay(n, e), Cv = () => ({ commands: n }) => n.keyboardShortcut("Enter"), Sv = () => ({ state: n, dispatch: e }) => $y(n, e);
10831
10833
  function ds(n, e, t = { strict: !0 }) {
10832
10834
  const r = Object.keys(e);
10833
10835
  return r.length ? r.every((o) => t.strict ? e[o] === n[o] : Cc(e[o]) ? e[o].test(n[o]) : e[o] === n[o]) : !0;
@@ -10997,7 +10999,7 @@ const Dv = (n) => n.toString().startsWith("<"), Lv = (n, e, t) => ({ tr: r, disp
10997
10999
  c ? (Array.isArray(e) ? f = e.map((h) => h.text || "").join("") : typeof e == "object" && e && e.text ? f = e.text : f = e, r.insertText(f, l, a)) : (f = s, r.replaceWith(l, a, f)), t.updateSelection && Rv(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: l, text: f }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: l, text: f });
10998
11000
  }
10999
11001
  return !0;
11000
- }, Pv = () => ({ state: n, dispatch: e }) => L1(n, e), Iv = () => ({ state: n, dispatch: e }) => P1(n, e), Fv = () => ({ state: n, dispatch: e }) => T1(n, e), $v = () => ({ state: n, dispatch: e }) => R1(n, e), Bv = () => ({ tr: n, state: e, dispatch: t }) => {
11002
+ }, Pv = () => ({ state: n, dispatch: e }) => Ly(n, e), Iv = () => ({ state: n, dispatch: e }) => Py(n, e), Fv = () => ({ state: n, dispatch: e }) => Ty(n, e), $v = () => ({ state: n, dispatch: e }) => Ry(n, e), Bv = () => ({ tr: n, state: e, dispatch: t }) => {
11001
11003
  try {
11002
11004
  const r = tl(e.doc, e.selection.$from.pos, -1);
11003
11005
  return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
@@ -11011,7 +11013,7 @@ const Dv = (n) => n.toString().startsWith("<"), Lv = (n, e, t) => ({ tr: r, disp
11011
11013
  } catch {
11012
11014
  return !1;
11013
11015
  }
11014
- }, jv = () => ({ state: n, dispatch: e }) => M1(n, e), zv = () => ({ state: n, dispatch: e }) => O1(n, e);
11016
+ }, jv = () => ({ state: n, dispatch: e }) => My(n, e), zv = () => ({ state: n, dispatch: e }) => Oy(n, e);
11015
11017
  function ip() {
11016
11018
  return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
11017
11019
  }
@@ -11071,11 +11073,11 @@ function Jo(n, e, t = {}) {
11071
11073
  }
11072
11074
  const Wv = (n, e = {}) => ({ state: t, dispatch: r }) => {
11073
11075
  const o = Be(n, t.schema);
11074
- return Jo(t, o, e) ? I1(t, r) : !1;
11075
- }, Uv = () => ({ state: n, dispatch: e }) => H1(n, e), qv = (n) => ({ state: e, dispatch: t }) => {
11076
+ return Jo(t, o, e) ? Iy(t, r) : !1;
11077
+ }, Uv = () => ({ state: n, dispatch: e }) => Hy(n, e), qv = (n) => ({ state: e, dispatch: t }) => {
11076
11078
  const r = Be(n, e.schema);
11077
- return K1(r)(e, t);
11078
- }, Kv = () => ({ state: n, dispatch: e }) => F1(n, e);
11079
+ return Ky(r)(e, t);
11080
+ }, Kv = () => ({ state: n, dispatch: e }) => Fy(n, e);
11079
11081
  function fl(n, e) {
11080
11082
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
11081
11083
  }
@@ -11096,7 +11098,7 @@ const Jv = (n, e) => ({ tr: t, state: r, dispatch: o }) => {
11096
11098
  }, Zv = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Gv = () => ({ tr: n, commands: e }) => e.setTextSelection({
11097
11099
  from: 0,
11098
11100
  to: n.doc.content.size
11099
- }), Yv = () => ({ state: n, dispatch: e }) => N1(n, e), Xv = () => ({ state: n, dispatch: e }) => D1(n, e), Qv = () => ({ state: n, dispatch: e }) => j1(n, e), eb = () => ({ state: n, dispatch: e }) => _1(n, e), tb = () => ({ state: n, dispatch: e }) => V1(n, e);
11101
+ }), Yv = () => ({ state: n, dispatch: e }) => Ny(n, e), Xv = () => ({ state: n, dispatch: e }) => Dy(n, e), Qv = () => ({ state: n, dispatch: e }) => jy(n, e), eb = () => ({ state: n, dispatch: e }) => _y(n, e), tb = () => ({ state: n, dispatch: e }) => Vy(n, e);
11100
11102
  function sp(n, e, t = {}) {
11101
11103
  return fs(n, e, { slice: !1, parseOptions: t });
11102
11104
  }
@@ -11363,7 +11365,7 @@ const gb = (n, e = {}) => ({ tr: t, state: r, dispatch: o }) => {
11363
11365
  return !0;
11364
11366
  }, xb = (n) => ({ state: e, dispatch: t }) => {
11365
11367
  const r = Be(n, e.schema);
11366
- return G1(r)(e, t);
11368
+ return Gy(r)(e, t);
11367
11369
  };
11368
11370
  function dd(n, e) {
11369
11371
  const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
@@ -11549,10 +11551,10 @@ const kb = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11549
11551
  }), !0) : !1;
11550
11552
  }, Db = (n, e = {}) => ({ state: t, dispatch: r }) => {
11551
11553
  const o = Be(n, t.schema);
11552
- return W1(o, e)(t, r);
11554
+ return Wy(o, e)(t, r);
11553
11555
  }, Lb = (n, e = {}) => ({ state: t, dispatch: r }) => {
11554
11556
  const o = Be(n, t.schema);
11555
- return U1(o, e)(t, r);
11557
+ return Uy(o, e)(t, r);
11556
11558
  };
11557
11559
  var Pb = /* @__PURE__ */ Object.freeze({
11558
11560
  __proto__: null,
@@ -11948,7 +11950,7 @@ function zb(n, e, t) {
11948
11950
  const o = document.createElement("style");
11949
11951
  return e && o.setAttribute("nonce", e), o.setAttribute("data-tiptap-style", ""), o.innerHTML = n, document.getElementsByTagName("head")[0].appendChild(o), o;
11950
11952
  }
11951
- let Vb = class extends Y1 {
11953
+ let Vb = class extends Yy {
11952
11954
  constructor(e = {}) {
11953
11955
  super(), this.isFocused = !1, this.extensionStorage = {}, this.options = {
11954
11956
  element: document.createElement("div"),
@@ -12095,7 +12097,7 @@ let Vb = class extends Y1 {
12095
12097
  */
12096
12098
  createView() {
12097
12099
  const e = sp(this.options.content, this.schema, this.options.parseOptions), t = rp(e, this.options.autofocus);
12098
- this.view = new g1(this.options.element, {
12100
+ this.view = new gy(this.options.element, {
12099
12101
  ...this.options.editorProps,
12100
12102
  dispatchTransaction: this.dispatchTransaction.bind(this),
12101
12103
  state: Wr.create({
@@ -26180,51 +26182,45 @@ const jT = /* @__PURE__ */ $f(HT), zT = (n, e) => {
26180
26182
  s == null || s.setEditable(!n);
26181
26183
  }, [n]), le(() => {
26182
26184
  t && s && (s == null || s.commands.setContent(t));
26183
- }, [t, s]), s ? /* @__PURE__ */ b.jsx(
26184
- "div",
26185
- {
26186
- "data-cy": "single-webpage",
26187
- className: "h-screen w-screen bg-[#f9fbfd]",
26188
- children: /* @__PURE__ */ b.jsx("div", { className: "h-full flex flex-col overflow-scroll no-scrollbar", children: /* @__PURE__ */ b.jsxs("div", { className: "w-full h-screen", children: [
26189
- /* @__PURE__ */ b.jsx("div", { className: "h-fit relative bg-[#ffffff]", children: /* @__PURE__ */ b.jsxs("div", { className: "flex items-center justify-center pl-4 pr-4 border-b-1 border gap-2 h-16", children: [
26190
- /* @__PURE__ */ b.jsx("div", { className: "grow", children: /* @__PURE__ */ b.jsx(
26191
- Wg,
26192
- {
26193
- metaData: o,
26194
- setMetaData: i
26195
- }
26196
- ) }),
26197
- !n && /* @__PURE__ */ b.jsx("div", { className: "grow relative", children: /* @__PURE__ */ b.jsx(_T, { editor: s }) }),
26198
- /* @__PURE__ */ b.jsx("div", { children: /* @__PURE__ */ b.jsx(Xs, { onClick: () => r(n), children: n ? "Edit" : "Preview" }) }),
26199
- e && /* @__PURE__ */ b.jsx(
26200
- "div",
26201
- {
26202
- onClick: () => e({
26203
- metaData: o,
26204
- editorJSONData: s.getJSON()
26205
- }),
26206
- className: "cursor-pointer",
26207
- children: /* @__PURE__ */ b.jsx(Xs, { children: "Publish" })
26208
- }
26209
- )
26210
- ] }) }),
26211
- /* @__PURE__ */ b.jsx("main", { className: "h-screen lg:h-full w-full rounded-[8px] flex flex-col justify-start items-center gap-2", children: /* @__PURE__ */ b.jsx(
26212
- "div",
26213
- {
26214
- onClick: a,
26215
- className: "w-full flex justify-center relative",
26216
- children: /* @__PURE__ */ b.jsx("div", { className: "p-[96px] mt-4 min-h-[900px] shadow-inner bg-white overflow-scroll no-scrollbar rounded-md w-[70%] max-w-[856px]", children: /* @__PURE__ */ b.jsxs("div", { ref: l, className: "w-full pt-4 h-full", children: [
26217
- !n && /* @__PURE__ */ b.jsxs("div", { children: [
26218
- /* @__PURE__ */ b.jsx(FT, { editor: s }),
26219
- /* @__PURE__ */ b.jsx(VT, { editor: s, appendTo: l })
26220
- ] }),
26221
- /* @__PURE__ */ b.jsx(Qk, { isPreviewMode: n, children: /* @__PURE__ */ b.jsx(Rw, { editor: s }) })
26222
- ] }) })
26223
- }
26224
- ) })
26225
- ] }) })
26226
- }
26227
- ) : /* @__PURE__ */ b.jsxs("div", { className: " w-screen h-screen flex flex-col gap-4 justify-center items-center", children: [
26185
+ }, [t, s]), s ? /* @__PURE__ */ b.jsx("div", { "data-cy": "single-webpage", className: "h-screen w-screen bg-[#f9fbfd]", children: /* @__PURE__ */ b.jsx("div", { className: "h-full flex flex-col overflow-scroll no-scrollbar", children: /* @__PURE__ */ b.jsxs("div", { className: "w-full h-screen", children: [
26186
+ /* @__PURE__ */ b.jsx("div", { className: "h-fit relative bg-[#ffffff]", children: /* @__PURE__ */ b.jsxs("div", { className: "flex items-center justify-center pl-4 pr-4 border-b-1 border gap-2 h-16", children: [
26187
+ /* @__PURE__ */ b.jsx("div", { className: "grow", children: /* @__PURE__ */ b.jsx(
26188
+ Wg,
26189
+ {
26190
+ isPreviewMode: n,
26191
+ metaData: o,
26192
+ setMetaData: i
26193
+ }
26194
+ ) }),
26195
+ !n && /* @__PURE__ */ b.jsx("div", { className: "grow relative", children: /* @__PURE__ */ b.jsx(_T, { editor: s }) }),
26196
+ /* @__PURE__ */ b.jsx("div", { children: /* @__PURE__ */ b.jsx(Xs, { onClick: () => r(n), children: n ? "Edit" : "Preview" }) }),
26197
+ e && /* @__PURE__ */ b.jsx(
26198
+ "div",
26199
+ {
26200
+ onClick: () => e({
26201
+ metaData: o,
26202
+ editorJSONData: s.getJSON()
26203
+ }),
26204
+ className: "cursor-pointer",
26205
+ children: /* @__PURE__ */ b.jsx(Xs, { children: "Publish" })
26206
+ }
26207
+ )
26208
+ ] }) }),
26209
+ /* @__PURE__ */ b.jsx("main", { className: "h-screen lg:h-full w-full rounded-[8px] flex flex-col justify-start items-center gap-2", children: /* @__PURE__ */ b.jsx(
26210
+ "div",
26211
+ {
26212
+ onClick: a,
26213
+ className: "w-full flex justify-center relative",
26214
+ children: /* @__PURE__ */ b.jsx("div", { className: "p-12 sm:p-[96px] mt-4 min-h-[900px] shadow-inner bg-white overflow-scroll no-scrollbar rounded-md w-full sm:w-[70%] max-w-[856px]", children: /* @__PURE__ */ b.jsxs("div", { ref: l, className: "w-full pt-4 h-full", children: [
26215
+ !n && /* @__PURE__ */ b.jsxs("div", { children: [
26216
+ /* @__PURE__ */ b.jsx(FT, { editor: s }),
26217
+ /* @__PURE__ */ b.jsx(VT, { editor: s, appendTo: l })
26218
+ ] }),
26219
+ /* @__PURE__ */ b.jsx(Qk, { isPreviewMode: n, children: /* @__PURE__ */ b.jsx(Rw, { editor: s }) })
26220
+ ] }) })
26221
+ }
26222
+ ) })
26223
+ ] }) }) }) : /* @__PURE__ */ b.jsxs("div", { className: " w-screen h-screen flex flex-col gap-4 justify-center items-center", children: [
26228
26224
  /* @__PURE__ */ b.jsx(bm, {}),
26229
26225
  /* @__PURE__ */ b.jsx("p", { children: "Loading Editor..." })
26230
26226
  ] });