@nine-lab/nine-ux 0.1.54 → 0.1.55

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.
@@ -3,8 +3,8 @@ var li = (n) => {
3
3
  throw TypeError(n);
4
4
  };
5
5
  var Sl = (n, e, t) => e in n ? xl(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
6
- var ye = (n, e, t) => Sl(n, typeof e != "symbol" ? e + "" : e, t), jn = (n, e, t) => e.has(n) || li("Cannot " + t);
7
- var O = (n, e, t) => (jn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), F = (n, e, t) => e.has(n) ? li("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), oe = (n, e, t, r) => (jn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), q = (n, e, t) => (jn(n, e, "access private method"), t);
6
+ var ye = (n, e, t) => Sl(n, typeof e != "symbol" ? e + "" : e, t), Jn = (n, e, t) => e.has(n) || li("Cannot " + t);
7
+ var O = (n, e, t) => (Jn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), F = (n, e, t) => e.has(n) ? li("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), oe = (n, e, t, r) => (Jn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), q = (n, e, t) => (Jn(n, e, "access private method"), t);
8
8
  import { nine as Rt, subscribeConfig as Ml } from "@nine-lab/nine-util";
9
9
  const wl = `
10
10
  dialog::backdrop {
@@ -319,7 +319,7 @@ const wl = `
319
319
  filter: unset;
320
320
  }
321
321
  `;
322
- var Oe, j, En, vn, Nn;
322
+ var Oe, j, Nn, An, Dn;
323
323
  class Cl extends HTMLElement {
324
324
  constructor() {
325
325
  super();
@@ -331,7 +331,7 @@ class Cl extends HTMLElement {
331
331
  ye(this, "close", () => {
332
332
  O(this, j).close(), this.remove();
333
333
  });
334
- F(this, En, () => {
334
+ F(this, Nn, () => {
335
335
  const t = this.querySelector(".head");
336
336
  this.querySelectorAll(".close, .close2").forEach((r) => {
337
337
  r.onclick = () => {
@@ -339,10 +339,10 @@ class Cl extends HTMLElement {
339
339
  this.close();
340
340
  }, 300);
341
341
  };
342
- }), t.addEventListener("mousedown", O(this, vn)), t.addEventListener("touchstart", O(this, Nn), { passive: !1 });
342
+ }), t.addEventListener("mousedown", O(this, An)), t.addEventListener("touchstart", O(this, Dn), { passive: !1 });
343
343
  });
344
344
  // --- 드래그 로직 (Vanilla JS) ---
345
- F(this, vn, (t) => {
345
+ F(this, An, (t) => {
346
346
  if (t.target.closest("buttons") || t.button !== 0 || t.altKey || t.ctrlKey || t.shiftKey) return;
347
347
  const r = O(this, j).getBoundingClientRect();
348
348
  oe(this, Oe, {
@@ -356,7 +356,7 @@ class Cl extends HTMLElement {
356
356
  };
357
357
  document.addEventListener("mousemove", i), document.addEventListener("mouseup", s);
358
358
  });
359
- F(this, Nn, (t) => {
359
+ F(this, Dn, (t) => {
360
360
  if (t.target.closest("buttons")) return;
361
361
  const r = O(this, j).getBoundingClientRect(), i = t.changedTouches[0];
362
362
  oe(this, Oe, {
@@ -405,12 +405,12 @@ class Cl extends HTMLElement {
405
405
  </div>
406
406
  </div>
407
407
  </dialog>
408
- `, oe(this, j, this.querySelector("dialog")), O(this, En).call(this);
408
+ `, oe(this, j, this.querySelector("dialog")), O(this, Nn).call(this);
409
409
  }
410
410
  }
411
- Oe = new WeakMap(), j = new WeakMap(), En = new WeakMap(), vn = new WeakMap(), Nn = new WeakMap();
411
+ Oe = new WeakMap(), j = new WeakMap(), Nn = new WeakMap(), An = new WeakMap(), Dn = new WeakMap();
412
412
  customElements.get("nine-dialog") || customElements.define("nine-dialog", Cl);
413
- class Br extends HTMLElement {
413
+ class hn extends HTMLElement {
414
414
  constructor() {
415
415
  super(), this.attachShadow({ mode: "open" });
416
416
  }
@@ -426,7 +426,7 @@ class Br extends HTMLElement {
426
426
  `;
427
427
  }
428
428
  }
429
- ye(Br, "confirm", async (e, t = "Confirm", r = {}) => {
429
+ ye(hn, "confirm", async (e, t = "Confirm", r = {}) => {
430
430
  var d;
431
431
  const i = {
432
432
  "true-text": "Yes",
@@ -448,7 +448,7 @@ ye(Br, "confirm", async (e, t = "Confirm", r = {}) => {
448
448
  }, o.addEventListener("close", () => u(void 0)), o.showModal();
449
449
  });
450
450
  });
451
- class Lr extends HTMLElement {
451
+ class pn extends HTMLElement {
452
452
  constructor() {
453
453
  super(), this.attachShadow({ mode: "open" });
454
454
  }
@@ -463,7 +463,7 @@ class Lr extends HTMLElement {
463
463
  `;
464
464
  }
465
465
  }
466
- ye(Lr, "alert", async (e, t = "Alert", r = {}) => {
466
+ ye(pn, "alert", async (e, t = "Alert", r = {}) => {
467
467
  var c;
468
468
  const i = {
469
469
  class: "",
@@ -482,9 +482,9 @@ ye(Lr, "alert", async (e, t = "Alert", r = {}) => {
482
482
  l.onclick = u, o.showModal();
483
483
  });
484
484
  });
485
- customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", Br);
486
- customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Lr);
487
- var jt, Kt, ur;
485
+ customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", hn);
486
+ customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", pn);
487
+ var jt, Kt, hr;
488
488
  class Tl {
489
489
  constructor() {
490
490
  F(this, Kt);
@@ -499,10 +499,18 @@ class Tl {
499
499
  oe(this, jt, e);
500
500
  }
501
501
  alert(e, t = "Alert") {
502
- return q(this, Kt, ur).call(this, "alert", e, t, "classic");
502
+ return q(this, Kt, hr).call(this, "alert", e, t, "classic");
503
503
  }
504
504
  confirm(e, t = "Confirm") {
505
- return q(this, Kt, ur).call(this, "confirm", e, t, "classic");
505
+ return q(this, Kt, hr).call(this, "confirm", e, t, "classic");
506
+ }
507
+ // 이제 setup이나 window 교체 로직은 여기서 다 제거합니다.
508
+ // 오직 팝업을 실행하는 인터페이스 역할만 수행.
509
+ async alert1(e, t = "Alert", r = {}) {
510
+ return await pn.alert(e, t, r);
511
+ }
512
+ async confirm1(e, t = "Confirm", r = {}) {
513
+ return await hn.confirm(e, t, r);
506
514
  }
507
515
  /**
508
516
  * 컴포넌트별 CSS 경로 생성 헬퍼 (복구!)
@@ -512,23 +520,23 @@ class Tl {
512
520
  return t ? `${t.endsWith("/") ? t : t + "/"}${e}` : null;
513
521
  }
514
522
  }
515
- jt = new WeakMap(), Kt = new WeakSet(), // 이제 setup이나 window 교체 로직은 여기서 다 제거합니다.
516
- // 오직 팝업을 실행하는 인터페이스 역할만 수행.
517
- ur = function(e, t, r, i) {
518
- const s = { class: i, animation: "fade-in" }, o = e === "alert" ? Lr : Br, l = {
519
- // 디자인 선택
520
- rgb: () => (s.class = "rgb", l),
521
- classic: () => (s.class = "classic", l),
522
- // 애니메이션 선택
523
- fade: () => (s.animation = "fade-in", l),
524
- zoom: () => (s.animation = "zoom-in", l),
525
- // Promise 호환성 (await 사용 가능하게 함)
526
- then: (a, c) => o[e](t, r, s).then(a, c)
523
+ jt = new WeakMap(), Kt = new WeakSet(), hr = function(e, t, r, i) {
524
+ const s = { class: i, animation: "fade-in" }, o = e === "alert" ? pn : hn;
525
+ let l = !1;
526
+ const a = {
527
+ rgb: () => (s.class = "rgb", a),
528
+ classic: () => (s.class = "classic", a),
529
+ fade: () => (s.animation = "fade-in", a),
530
+ zoom: () => (s.animation = "zoom-in", a),
531
+ // await 사용 호출됨
532
+ then: (c, d) => (l = !0, o[e](t, r, s).then(c, d))
527
533
  };
528
- return l;
534
+ return Promise.resolve().then(() => {
535
+ l || (l = !0, o[e](t, r, s));
536
+ }), a;
529
537
  };
530
538
  const Ae = new Tl();
531
- var Jt, Ze, Ut, ae, Tt, fr, hr, _t, An;
539
+ var Jt, Ze, Ut, ae, Tt, pr, mr, _t, In;
532
540
  class Ol extends HTMLElement {
533
541
  constructor() {
534
542
  super();
@@ -553,20 +561,20 @@ class Ol extends HTMLElement {
553
561
  });
554
562
  // 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
555
563
  ye(this, "clearData", (t = {}) => {
556
- q(this, ae, hr).call(this), q(this, ae, Tt).call(this).forEach((r) => {
564
+ q(this, ae, mr).call(this), q(this, ae, Tt).call(this).forEach((r) => {
557
565
  const i = r.name;
558
566
  if (!i) return;
559
567
  const s = t && t[i] !== void 0 ? t[i] : "";
560
- q(this, ae, fr).call(this, r, s);
568
+ q(this, ae, pr).call(this, r, s);
561
569
  }), this.changed = !1;
562
570
  });
563
571
  ye(this, "setData", (t) => {
564
572
  if (!t || typeof t != "object") return;
565
- q(this, ae, hr).call(this);
573
+ q(this, ae, mr).call(this);
566
574
  let r = !1;
567
575
  q(this, ae, Tt).call(this).forEach((i) => {
568
576
  const s = i.name;
569
- !s || !t.hasOwnProperty(s) || q(this, ae, fr).call(this, i, t[s]) && (r = !0);
577
+ !s || !t.hasOwnProperty(s) || q(this, ae, pr).call(this, i, t[s]) && (r = !0);
570
578
  }), r && (this.changed = !0);
571
579
  });
572
580
  ye(this, "initData", (t) => {
@@ -575,14 +583,14 @@ class Ol extends HTMLElement {
575
583
  F(this, _t, (t) => {
576
584
  this.changed = !0;
577
585
  });
578
- F(this, An, () => {
586
+ F(this, In, () => {
579
587
  for (const t of this.attributes)
580
588
  t.name.startsWith("css-") && this.style.setProperty(t.name.substring(4), t.value);
581
589
  this.originContents = this.innerHTML.trim(), this.innerHTML = "", this.shadowRoot && this.tagName.toLowerCase() === "nx-div" && (this.shadowRoot.innerHTML = this.originContents);
582
590
  });
583
591
  }
584
592
  connectedCallback() {
585
- return O(this, Jt) ? !1 : (this.getAttribute("use-shadow") !== "false" && !this.shadowRoot ? (this.attachShadow({ mode: "open" }), oe(this, Ze, this.shadowRoot)) : oe(this, Ze, this), O(this, An).call(this), oe(this, Jt, !0), !0);
593
+ return O(this, Jt) ? !1 : (this.getAttribute("use-shadow") !== "false" && !this.shadowRoot ? (this.attachShadow({ mode: "open" }), oe(this, Ze, this.shadowRoot)) : oe(this, Ze, this), O(this, In).call(this), oe(this, Jt, !0), !0);
586
594
  }
587
595
  get changed() {
588
596
  return O(this, Ut);
@@ -605,7 +613,7 @@ Jt = new WeakMap(), Ze = new WeakMap(), Ut = new WeakMap(), ae = new WeakSet(),
605
613
  Tt = function() {
606
614
  return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", O(this, Ze));
607
615
  }, // [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
608
- fr = function(t, r) {
616
+ pr = function(t, r) {
609
617
  const i = t.tagName.toUpperCase(), s = t.type;
610
618
  let o = !1;
611
619
  if (["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"].includes(i))
@@ -621,11 +629,11 @@ fr = function(t, r) {
621
629
  t.textContent !== r && (o = !0), t.textContent = r;
622
630
  return o;
623
631
  }, // [공통 로직 2] 이벤트 리스너 일괄 등록
624
- hr = function() {
632
+ mr = function() {
625
633
  q(this, ae, Tt).call(this).forEach((t) => {
626
634
  t.removeEventListener("input", O(this, _t)), t.addEventListener("input", O(this, _t));
627
635
  });
628
- }, _t = new WeakMap(), An = new WeakMap();
636
+ }, _t = new WeakMap(), In = new WeakMap();
629
637
  function K(n) {
630
638
  this.content = n;
631
639
  }
@@ -1028,11 +1036,11 @@ class b {
1028
1036
  }
1029
1037
  }
1030
1038
  b.empty = new b([], 0);
1031
- const Kn = { index: 0, offset: 0 };
1039
+ const Un = { index: 0, offset: 0 };
1032
1040
  function en(n, e) {
1033
- return Kn.index = n, Kn.offset = e, Kn;
1041
+ return Un.index = n, Un.offset = e, Un;
1034
1042
  }
1035
- function hn(n, e) {
1043
+ function mn(n, e) {
1036
1044
  if (n === e)
1037
1045
  return !0;
1038
1046
  if (!(n && typeof n == "object") || !(e && typeof e == "object"))
@@ -1044,11 +1052,11 @@ function hn(n, e) {
1044
1052
  if (n.length != e.length)
1045
1053
  return !1;
1046
1054
  for (let r = 0; r < n.length; r++)
1047
- if (!hn(n[r], e[r]))
1055
+ if (!mn(n[r], e[r]))
1048
1056
  return !1;
1049
1057
  } else {
1050
1058
  for (let r in n)
1051
- if (!(r in e) || !hn(n[r], e[r]))
1059
+ if (!(r in e) || !mn(n[r], e[r]))
1052
1060
  return !1;
1053
1061
  for (let r in e)
1054
1062
  if (!(r in n))
@@ -1056,7 +1064,7 @@ function hn(n, e) {
1056
1064
  }
1057
1065
  return !0;
1058
1066
  }
1059
- let A = class pr {
1067
+ let A = class gr {
1060
1068
  /**
1061
1069
  @internal
1062
1070
  */
@@ -1110,7 +1118,7 @@ let A = class pr {
1110
1118
  another mark.
1111
1119
  */
1112
1120
  eq(e) {
1113
- return this == e || this.type == e.type && hn(this.attrs, e.attrs);
1121
+ return this == e || this.type == e.type && mn(this.attrs, e.attrs);
1114
1122
  }
1115
1123
  /**
1116
1124
  Convert this mark to a JSON-serializeable representation.
@@ -1154,15 +1162,15 @@ let A = class pr {
1154
1162
  */
1155
1163
  static setFrom(e) {
1156
1164
  if (!e || Array.isArray(e) && e.length == 0)
1157
- return pr.none;
1158
- if (e instanceof pr)
1165
+ return gr.none;
1166
+ if (e instanceof gr)
1159
1167
  return [e];
1160
1168
  let t = e.slice();
1161
1169
  return t.sort((r, i) => r.type.rank - i.type.rank), t;
1162
1170
  }
1163
1171
  };
1164
1172
  A.none = [];
1165
- class pn extends Error {
1173
+ class gn extends Error {
1166
1174
  }
1167
1175
  class k {
1168
1176
  /**
@@ -1265,9 +1273,9 @@ function Es(n, e, t, r) {
1265
1273
  }
1266
1274
  function El(n, e, t) {
1267
1275
  if (t.openStart > n.depth)
1268
- throw new pn("Inserted content deeper than insertion position");
1276
+ throw new gn("Inserted content deeper than insertion position");
1269
1277
  if (n.depth - t.openStart != e.depth - t.openEnd)
1270
- throw new pn("Inconsistent open depths");
1278
+ throw new gn("Inconsistent open depths");
1271
1279
  return vs(n, e, t, 0);
1272
1280
  }
1273
1281
  function vs(n, e, t, r) {
@@ -1283,13 +1291,13 @@ function vs(n, e, t, r) {
1283
1291
  let { start: o, end: l } = vl(t, n);
1284
1292
  return et(s, As(n, o, l, e, r));
1285
1293
  }
1286
- else return et(s, mn(n, e, r));
1294
+ else return et(s, yn(n, e, r));
1287
1295
  }
1288
1296
  function Ns(n, e) {
1289
1297
  if (!e.type.compatibleContent(n.type))
1290
- throw new pn("Cannot join " + e.type.name + " onto " + n.type.name);
1298
+ throw new gn("Cannot join " + e.type.name + " onto " + n.type.name);
1291
1299
  }
1292
- function mr(n, e, t) {
1300
+ function yr(n, e, t) {
1293
1301
  let r = n.node(t);
1294
1302
  return Ns(r, e.node(t)), r;
1295
1303
  }
@@ -1308,14 +1316,14 @@ function et(n, e) {
1308
1316
  return n.type.checkContent(e), n.copy(e);
1309
1317
  }
1310
1318
  function As(n, e, t, r, i) {
1311
- let s = n.depth > i && mr(n, e, i + 1), o = r.depth > i && mr(t, r, i + 1), l = [];
1312
- return Nt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Ns(s, o), Qe(et(s, As(n, e, t, r, i + 1)), l)) : (s && Qe(et(s, mn(n, e, i + 1)), l), Nt(e, t, i, l), o && Qe(et(o, mn(t, r, i + 1)), l)), Nt(r, null, i, l), new b(l);
1319
+ let s = n.depth > i && yr(n, e, i + 1), o = r.depth > i && yr(t, r, i + 1), l = [];
1320
+ return Nt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Ns(s, o), Qe(et(s, As(n, e, t, r, i + 1)), l)) : (s && Qe(et(s, yn(n, e, i + 1)), l), Nt(e, t, i, l), o && Qe(et(o, yn(t, r, i + 1)), l)), Nt(r, null, i, l), new b(l);
1313
1321
  }
1314
- function mn(n, e, t) {
1322
+ function yn(n, e, t) {
1315
1323
  let r = [];
1316
1324
  if (Nt(null, n, t, r), n.depth > t) {
1317
- let i = mr(n, e, t + 1);
1318
- Qe(et(i, mn(n, e, t + 1)), r);
1325
+ let i = yr(n, e, t + 1);
1326
+ Qe(et(i, yn(n, e, t + 1)), r);
1319
1327
  }
1320
1328
  return Nt(e, null, t, r), new b(r);
1321
1329
  }
@@ -1513,7 +1521,7 @@ class Pt {
1513
1521
  return e.blockRange(this);
1514
1522
  for (let r = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); r >= 0; r--)
1515
1523
  if (e.pos <= this.end(r) && (!t || t(this.node(r))))
1516
- return new gn(this, e, r);
1524
+ return new bn(this, e, r);
1517
1525
  return null;
1518
1526
  }
1519
1527
  /**
@@ -1581,7 +1589,7 @@ class Nl {
1581
1589
  }
1582
1590
  }
1583
1591
  const Al = 12, ai = /* @__PURE__ */ new WeakMap();
1584
- class gn {
1592
+ class bn {
1585
1593
  /**
1586
1594
  Construct a node range. `$from` and `$to` should point into the
1587
1595
  same node until at least the given `depth`, since a node range
@@ -1622,7 +1630,7 @@ class gn {
1622
1630
  }
1623
1631
  }
1624
1632
  const Dl = /* @__PURE__ */ Object.create(null);
1625
- let Fe = class gr {
1633
+ let Fe = class br {
1626
1634
  /**
1627
1635
  @internal
1628
1636
  */
@@ -1740,21 +1748,21 @@ let Fe = class gr {
1740
1748
  attributes, and marks.
1741
1749
  */
1742
1750
  hasMarkup(e, t, r) {
1743
- return this.type == e && hn(this.attrs, t || e.defaultAttrs || Dl) && A.sameSet(this.marks, r || A.none);
1751
+ return this.type == e && mn(this.attrs, t || e.defaultAttrs || Dl) && A.sameSet(this.marks, r || A.none);
1744
1752
  }
1745
1753
  /**
1746
1754
  Create a new node with the same markup as this node, containing
1747
1755
  the given content (or empty, if no content is given).
1748
1756
  */
1749
1757
  copy(e = null) {
1750
- return e == this.content ? this : new gr(this.type, this.attrs, e, this.marks);
1758
+ return e == this.content ? this : new br(this.type, this.attrs, e, this.marks);
1751
1759
  }
1752
1760
  /**
1753
1761
  Create a copy of this node, with the given set of marks instead
1754
1762
  of the node's own marks.
1755
1763
  */
1756
1764
  mark(e) {
1757
- return e == this.marks ? this : new gr(this.type, this.attrs, this.content, e);
1765
+ return e == this.marks ? this : new br(this.type, this.attrs, this.content, e);
1758
1766
  }
1759
1767
  /**
1760
1768
  Create a copy of this node with only the content between the
@@ -1992,7 +2000,7 @@ let Fe = class gr {
1992
2000
  }
1993
2001
  };
1994
2002
  Fe.prototype.text = void 0;
1995
- class yn extends Fe {
2003
+ class kn extends Fe {
1996
2004
  /**
1997
2005
  @internal
1998
2006
  */
@@ -2014,10 +2022,10 @@ class yn extends Fe {
2014
2022
  return this.text.length;
2015
2023
  }
2016
2024
  mark(e) {
2017
- return e == this.marks ? this : new yn(this.type, this.attrs, this.text, e);
2025
+ return e == this.marks ? this : new kn(this.type, this.attrs, this.text, e);
2018
2026
  }
2019
2027
  withText(e) {
2020
- return e == this.text ? this : new yn(this.type, this.attrs, e, this.marks);
2028
+ return e == this.text ? this : new kn(this.type, this.attrs, e, this.marks);
2021
2029
  }
2022
2030
  cut(e = 0, t = this.text.length) {
2023
2031
  return e == 0 && t == this.text.length ? this : this.withText(this.text.slice(e, t));
@@ -2614,7 +2622,7 @@ class Wl {
2614
2622
  return !this.hasDefault;
2615
2623
  }
2616
2624
  }
2617
- class Dn {
2625
+ class Rn {
2618
2626
  /**
2619
2627
  @internal
2620
2628
  */
@@ -2636,7 +2644,7 @@ class Dn {
2636
2644
  */
2637
2645
  static compile(e, t) {
2638
2646
  let r = /* @__PURE__ */ Object.create(null), i = 0;
2639
- return e.forEach((s, o) => r[s] = new Dn(s, i++, t, o)), r;
2647
+ return e.forEach((s, o) => r[s] = new Rn(s, i++, t, o)), r;
2640
2648
  }
2641
2649
  /**
2642
2650
  When there is a mark of this type in the given set, a new set
@@ -2678,7 +2686,7 @@ class $s {
2678
2686
  let t = this.spec = {};
2679
2687
  for (let i in e)
2680
2688
  t[i] = e[i];
2681
- t.nodes = K.from(e.nodes), t.marks = K.from(e.marks || {}), this.nodes = ui.compile(this.spec.nodes, this), this.marks = Dn.compile(this.spec.marks, this);
2689
+ t.nodes = K.from(e.nodes), t.marks = K.from(e.marks || {}), this.nodes = ui.compile(this.spec.nodes, this), this.marks = Rn.compile(this.spec.marks, this);
2682
2690
  let r = /* @__PURE__ */ Object.create(null);
2683
2691
  for (let i in this.nodes) {
2684
2692
  if (i in this.marks)
@@ -2720,7 +2728,7 @@ class $s {
2720
2728
  */
2721
2729
  text(e, t) {
2722
2730
  let r = this.nodes.text;
2723
- return new yn(r, r.defaultAttrs, e, A.setFrom(t));
2731
+ return new kn(r, r.defaultAttrs, e, A.setFrom(t));
2724
2732
  }
2725
2733
  /**
2726
2734
  Create a mark with the given type and attributes.
@@ -2915,9 +2923,9 @@ const Vs = {
2915
2923
  script: !0,
2916
2924
  style: !0,
2917
2925
  title: !0
2918
- }, Hs = { ol: !0, ul: !0 }, Bt = 1, yr = 2, At = 4;
2926
+ }, Hs = { ol: !0, ul: !0 }, Bt = 1, kr = 2, At = 4;
2919
2927
  function hi(n, e, t) {
2920
- return e != null ? (e ? Bt : 0) | (e === "full" ? yr : 0) : n && n.whitespace == "pre" ? Bt | yr : t & ~At;
2928
+ return e != null ? (e ? Bt : 0) | (e === "full" ? kr : 0) : n && n.whitespace == "pre" ? Bt | kr : t & ~At;
2921
2929
  }
2922
2930
  class tn {
2923
2931
  constructor(e, t, r, i, s, o) {
@@ -2968,7 +2976,7 @@ class pi {
2968
2976
  e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
2969
2977
  }
2970
2978
  addTextNode(e, t) {
2971
- let r = e.nodeValue, i = this.top, s = i.options & yr ? "full" : this.localPreserveWS || (i.options & Bt) > 0, { schema: o } = this.parser;
2979
+ let r = e.nodeValue, i = this.top, s = i.options & kr ? "full" : this.localPreserveWS || (i.options & Bt) > 0, { schema: o } = this.parser;
2972
2980
  if (s === "full" || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
2973
2981
  if (s)
2974
2982
  if (s === "full")
@@ -3287,7 +3295,7 @@ class dt {
3287
3295
  nodes.
3288
3296
  */
3289
3297
  serializeFragment(e, t = {}, r) {
3290
- r || (r = Jn(t).createDocumentFragment());
3298
+ r || (r = _n(t).createDocumentFragment());
3291
3299
  let i = r, s = [];
3292
3300
  return e.forEach((o) => {
3293
3301
  if (s.length || o.marks.length) {
@@ -3316,7 +3324,7 @@ class dt {
3316
3324
  @internal
3317
3325
  */
3318
3326
  serializeNodeInner(e, t) {
3319
- let { dom: r, contentDOM: i } = cn(Jn(t), this.nodes[e.type.name](e), null, e.attrs);
3327
+ let { dom: r, contentDOM: i } = cn(_n(t), this.nodes[e.type.name](e), null, e.attrs);
3320
3328
  if (i) {
3321
3329
  if (e.isLeaf)
3322
3330
  throw new RangeError("Content hole not allowed in a leaf node spec");
@@ -3344,7 +3352,7 @@ class dt {
3344
3352
  */
3345
3353
  serializeMark(e, t, r = {}) {
3346
3354
  let i = this.marks[e.type.name];
3347
- return i && cn(Jn(r), i(e, t), null, e.attrs);
3355
+ return i && cn(_n(r), i(e, t), null, e.attrs);
3348
3356
  }
3349
3357
  static renderSpec(e, t, r = null, i) {
3350
3358
  return cn(e, t, r, i);
@@ -3379,7 +3387,7 @@ function yi(n) {
3379
3387
  }
3380
3388
  return e;
3381
3389
  }
3382
- function Jn(n) {
3390
+ function _n(n) {
3383
3391
  return n.document || window.document;
3384
3392
  }
3385
3393
  const bi = /* @__PURE__ */ new WeakMap();
@@ -3454,7 +3462,7 @@ function Xl(n) {
3454
3462
  return (n - (n & Ws)) / qs;
3455
3463
  }
3456
3464
  const js = 1, Ks = 2, dn = 4, Js = 8;
3457
- class br {
3465
+ class xr {
3458
3466
  /**
3459
3467
  @internal
3460
3468
  */
@@ -3531,11 +3539,11 @@ class le {
3531
3539
  if (r)
3532
3540
  return h;
3533
3541
  let p = e == (t < 0 ? a : u) ? null : Yl(l / 3, e - a), m = e == a ? Ks : e == u ? js : dn;
3534
- return (t < 0 ? e != a : e != u) && (m |= Js), new br(h, m, p);
3542
+ return (t < 0 ? e != a : e != u) && (m |= Js), new xr(h, m, p);
3535
3543
  }
3536
3544
  i += d - c;
3537
3545
  }
3538
- return r ? e + i : new br(e + i, 0, null);
3546
+ return r ? e + i : new xr(e + i, 0, null);
3539
3547
  }
3540
3548
  /**
3541
3549
  @internal
@@ -3691,10 +3699,10 @@ class Lt {
3691
3699
  }
3692
3700
  i |= l.delInfo, e = l.pos;
3693
3701
  }
3694
- return r ? e : new br(e, i, null);
3702
+ return r ? e : new xr(e, i, null);
3695
3703
  }
3696
3704
  }
3697
- const Un = /* @__PURE__ */ Object.create(null);
3705
+ const Gn = /* @__PURE__ */ Object.create(null);
3698
3706
  class Q {
3699
3707
  /**
3700
3708
  Get the step map that represents the changes made by this step,
@@ -3719,7 +3727,7 @@ class Q {
3719
3727
  static fromJSON(e, t) {
3720
3728
  if (!t || !t.stepType)
3721
3729
  throw new RangeError("Invalid input for Step.fromJSON");
3722
- let r = Un[t.stepType];
3730
+ let r = Gn[t.stepType];
3723
3731
  if (!r)
3724
3732
  throw new RangeError(`No step type ${t.stepType} defined`);
3725
3733
  return r.fromJSON(e, t);
@@ -3731,9 +3739,9 @@ class Q {
3731
3739
  that's unlikely to clash with steps from other modules.
3732
3740
  */
3733
3741
  static jsonID(e, t) {
3734
- if (e in Un)
3742
+ if (e in Gn)
3735
3743
  throw new RangeError("Duplicate use of step JSON ID " + e);
3736
- return Un[e] = t, t.prototype.jsonID = e, t;
3744
+ return Gn[e] = t, t.prototype.jsonID = e, t;
3737
3745
  }
3738
3746
  }
3739
3747
  class B {
@@ -3764,7 +3772,7 @@ class B {
3764
3772
  try {
3765
3773
  return B.ok(e.replace(t, r, i));
3766
3774
  } catch (s) {
3767
- if (s instanceof pn)
3775
+ if (s instanceof gn)
3768
3776
  return B.fail(s.message);
3769
3777
  throw s;
3770
3778
  }
@@ -3949,7 +3957,7 @@ class P extends Q {
3949
3957
  super(), this.from = e, this.to = t, this.slice = r, this.structure = i;
3950
3958
  }
3951
3959
  apply(e) {
3952
- return this.structure && kr(e, this.from, this.to) ? B.fail("Structure replace would overwrite content") : B.fromReplace(e, this.from, this.to, this.slice);
3960
+ return this.structure && Sr(e, this.from, this.to) ? B.fail("Structure replace would overwrite content") : B.fromReplace(e, this.from, this.to, this.slice);
3953
3961
  }
3954
3962
  getMap() {
3955
3963
  return new le([this.from, this.to - this.from, this.slice.size]);
@@ -3999,7 +4007,7 @@ class $ extends Q {
3999
4007
  super(), this.from = e, this.to = t, this.gapFrom = r, this.gapTo = i, this.slice = s, this.insert = o, this.structure = l;
4000
4008
  }
4001
4009
  apply(e) {
4002
- if (this.structure && (kr(e, this.from, this.gapFrom) || kr(e, this.gapTo, this.to)))
4010
+ if (this.structure && (Sr(e, this.from, this.gapFrom) || Sr(e, this.gapTo, this.to)))
4003
4011
  return B.fail("Structure gap-replace would overwrite content");
4004
4012
  let t = e.slice(this.gapFrom, this.gapTo);
4005
4013
  if (t.openStart || t.openEnd)
@@ -4046,7 +4054,7 @@ class $ extends Q {
4046
4054
  }
4047
4055
  }
4048
4056
  Q.jsonID("replaceAround", $);
4049
- function kr(n, e, t) {
4057
+ function Sr(n, e, t) {
4050
4058
  let r = n.resolve(e), i = t - e, s = r.depth;
4051
4059
  for (; i > 0 && s > 0 && r.indexAfter(s) == r.node(s).childCount; )
4052
4060
  s--, i--;
@@ -4081,7 +4089,7 @@ function Ql(n, e, t, r) {
4081
4089
  return;
4082
4090
  s++;
4083
4091
  let a = null;
4084
- if (r instanceof Dn) {
4092
+ if (r instanceof Rn) {
4085
4093
  let c = o.marks, d;
4086
4094
  for (; d = r.isInSet(c); )
4087
4095
  (a || (a = [])).push(d), c = d.removeFromSet(c);
@@ -4281,7 +4289,7 @@ function ca(n, e) {
4281
4289
  function Gs(n, e) {
4282
4290
  return !!(n && e && !n.isLeaf && ca(n, e));
4283
4291
  }
4284
- function In(n, e, t = -1) {
4292
+ function Pn(n, e, t = -1) {
4285
4293
  let r = n.resolve(e);
4286
4294
  for (let i = r.depth; ; i--) {
4287
4295
  let s, o, l = r.index(i);
@@ -4354,7 +4362,7 @@ function Ys(n, e, t) {
4354
4362
  }
4355
4363
  return null;
4356
4364
  }
4357
- function Rn(n, e, t = e, r = k.empty) {
4365
+ function Bn(n, e, t = e, r = k.empty) {
4358
4366
  if (e == t && !r.size)
4359
4367
  return null;
4360
4368
  let i = n.resolve(e), s = n.resolve(t);
@@ -4409,7 +4417,7 @@ class fa {
4409
4417
  for (let t = 1; t <= 2; t++)
4410
4418
  for (let r = t == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
4411
4419
  let i, s = null;
4412
- r ? (s = _n(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
4420
+ r ? (s = Yn(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
4413
4421
  let o = i.firstChild;
4414
4422
  for (let l = this.depth; l >= 0; l--) {
4415
4423
  let { type: a, match: c } = this.frontier[l], d, u = null;
@@ -4423,11 +4431,11 @@ class fa {
4423
4431
  }
4424
4432
  }
4425
4433
  openMore() {
4426
- let { content: e, openStart: t, openEnd: r } = this.unplaced, i = _n(e, t);
4434
+ let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Yn(e, t);
4427
4435
  return !i.childCount || i.firstChild.isLeaf ? !1 : (this.unplaced = new k(e, t + 1, Math.max(r, i.size + t >= e.size - r ? t + 1 : 0)), !0);
4428
4436
  }
4429
4437
  dropNode() {
4430
- let { content: e, openStart: t, openEnd: r } = this.unplaced, i = _n(e, t);
4438
+ let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Yn(e, t);
4431
4439
  if (i.childCount <= 1 && t > 0) {
4432
4440
  let s = e.size - t <= t + i.size;
4433
4441
  this.unplaced = new k(Ot(e, t - 1, 1), t - 1, s ? t - 1 : r);
@@ -4468,7 +4476,7 @@ class fa {
4468
4476
  if (!this.$to.parent.isTextblock)
4469
4477
  return -1;
4470
4478
  let e = this.frontier[this.depth], t;
4471
- if (!e.type.isTextblock || !Gn(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
4479
+ if (!e.type.isTextblock || !Xn(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
4472
4480
  return -1;
4473
4481
  let { depth: r } = this.$to, i = this.$to.after(r);
4474
4482
  for (; r > 1 && i == this.$to.end(--r); )
@@ -4477,10 +4485,10 @@ class fa {
4477
4485
  }
4478
4486
  findCloseLevel(e) {
4479
4487
  e: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
4480
- let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Gn(e, t, i, r, s);
4488
+ let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Xn(e, t, i, r, s);
4481
4489
  if (o) {
4482
4490
  for (let l = t - 1; l >= 0; l--) {
4483
- let { match: a, type: c } = this.frontier[l], d = Gn(e, l, c, a, !0);
4491
+ let { match: a, type: c } = this.frontier[l], d = Xn(e, l, c, a, !0);
4484
4492
  if (!d || d.childCount)
4485
4493
  continue e;
4486
4494
  }
@@ -4516,7 +4524,7 @@ function Ot(n, e, t) {
4516
4524
  function Et(n, e, t) {
4517
4525
  return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(Et(n.lastChild.content, e - 1, t)));
4518
4526
  }
4519
- function _n(n, e) {
4527
+ function Yn(n, e) {
4520
4528
  for (let t = 0; t < e; t++)
4521
4529
  n = n.firstChild.content;
4522
4530
  return n;
@@ -4527,7 +4535,7 @@ function Zs(n, e, t) {
4527
4535
  let r = n.content;
4528
4536
  return e > 1 && (r = r.replaceChild(0, Zs(r.firstChild, e - 1, r.childCount == 1 ? t - 1 : 0))), e > 0 && (r = n.type.contentMatch.fillBefore(r).append(r), t <= 0 && (r = r.append(n.type.contentMatch.matchFragment(r).fillBefore(b.empty, !0)))), n.copy(r);
4529
4537
  }
4530
- function Gn(n, e, t, r, i) {
4538
+ function Xn(n, e, t, r, i) {
4531
4539
  let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
4532
4540
  if (o == s.childCount && !t.compatibleContent(s.type))
4533
4541
  return null;
@@ -4793,7 +4801,7 @@ class ba {
4793
4801
  given `slice`.
4794
4802
  */
4795
4803
  replace(e, t = e, r = k.empty) {
4796
- let i = Rn(this.doc, e, t, r);
4804
+ let i = Bn(this.doc, e, t, r);
4797
4805
  return i && this.step(i), this;
4798
4806
  }
4799
4807
  /**
@@ -4969,7 +4977,7 @@ class ba {
4969
4977
  return Fr(this, e, t, r), this;
4970
4978
  }
4971
4979
  }
4972
- const Yn = /* @__PURE__ */ Object.create(null);
4980
+ const Zn = /* @__PURE__ */ Object.create(null);
4973
4981
  class E {
4974
4982
  /**
4975
4983
  Initialize a selection with the head and anchor and ranges. If no
@@ -5105,7 +5113,7 @@ class E {
5105
5113
  static fromJSON(e, t) {
5106
5114
  if (!t || !t.type)
5107
5115
  throw new RangeError("Invalid input for Selection.fromJSON");
5108
- let r = Yn[t.type];
5116
+ let r = Zn[t.type];
5109
5117
  if (!r)
5110
5118
  throw new RangeError(`No selection type ${t.type} defined`);
5111
5119
  return r.fromJSON(e, t);
@@ -5117,9 +5125,9 @@ class E {
5117
5125
  clash with classes from other modules.
5118
5126
  */
5119
5127
  static jsonID(e, t) {
5120
- if (e in Yn)
5128
+ if (e in Zn)
5121
5129
  throw new RangeError("Duplicate use of selection JSON ID " + e);
5122
- return Yn[e] = t, t.prototype.jsonID = e, t;
5130
+ return Zn[e] = t, t.prototype.jsonID = e, t;
5123
5131
  }
5124
5132
  /**
5125
5133
  Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
@@ -5178,7 +5186,7 @@ class M extends E {
5178
5186
  return e instanceof M && e.anchor == this.anchor && e.head == this.head;
5179
5187
  }
5180
5188
  getBookmark() {
5181
- return new Pn(this.anchor, this.head);
5189
+ return new Ln(this.anchor, this.head);
5182
5190
  }
5183
5191
  toJSON() {
5184
5192
  return { type: "text", anchor: this.anchor, head: this.head };
@@ -5219,12 +5227,12 @@ class M extends E {
5219
5227
  }
5220
5228
  }
5221
5229
  E.jsonID("text", M);
5222
- class Pn {
5230
+ class Ln {
5223
5231
  constructor(e, t) {
5224
5232
  this.anchor = e, this.head = t;
5225
5233
  }
5226
5234
  map(e) {
5227
- return new Pn(e.map(this.anchor), e.map(this.head));
5235
+ return new Ln(e.map(this.anchor), e.map(this.head));
5228
5236
  }
5229
5237
  resolve(e) {
5230
5238
  return M.between(e.resolve(this.anchor), e.resolve(this.head));
@@ -5285,7 +5293,7 @@ class Vr {
5285
5293
  }
5286
5294
  map(e) {
5287
5295
  let { deleted: t, pos: r } = e.mapResult(this.anchor);
5288
- return t ? new Pn(r, r) : new Vr(r);
5296
+ return t ? new Ln(r, r) : new Vr(r);
5289
5297
  }
5290
5298
  resolve(e) {
5291
5299
  let t = e.resolve(this.anchor), r = t.nodeAfter;
@@ -5558,7 +5566,7 @@ const Ma = [
5558
5566
  }
5559
5567
  })
5560
5568
  ];
5561
- class Xn {
5569
+ class Qn {
5562
5570
  constructor(e, t) {
5563
5571
  this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Ma.slice(), t && t.forEach((r) => {
5564
5572
  if (this.pluginsByKey[r.key])
@@ -5659,7 +5667,7 @@ class mt {
5659
5667
  Create a new state.
5660
5668
  */
5661
5669
  static create(e) {
5662
- let t = new Xn(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new mt(t);
5670
+ let t = new Qn(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new mt(t);
5663
5671
  for (let i = 0; i < t.fields.length; i++)
5664
5672
  r[t.fields[i].name] = t.fields[i].init(e, r);
5665
5673
  return r;
@@ -5673,7 +5681,7 @@ class mt {
5673
5681
  configuration object..
5674
5682
  */
5675
5683
  reconfigure(e) {
5676
- let t = new Xn(this.schema, e.plugins), r = t.fields, i = new mt(t);
5684
+ let t = new Qn(this.schema, e.plugins), r = t.fields, i = new mt(t);
5677
5685
  for (let s = 0; s < r.length; s++) {
5678
5686
  let o = r[s].name;
5679
5687
  i[o] = this.hasOwnProperty(o) ? this[o] : r[s].init(e, i);
@@ -5710,7 +5718,7 @@ class mt {
5710
5718
  throw new RangeError("Invalid input for EditorState.fromJSON");
5711
5719
  if (!e.schema)
5712
5720
  throw new RangeError("Required config field 'schema' missing");
5713
- let i = new Xn(e.schema, e.plugins), s = new mt(i);
5721
+ let i = new Qn(e.schema, e.plugins), s = new mt(i);
5714
5722
  return i.fields.forEach((o) => {
5715
5723
  if (o.name == "doc")
5716
5724
  s.doc = Fe.fromJSON(e.schema, t.doc);
@@ -5753,9 +5761,9 @@ class se {
5753
5761
  return e[this.key];
5754
5762
  }
5755
5763
  }
5756
- const Zn = /* @__PURE__ */ Object.create(null);
5764
+ const er = /* @__PURE__ */ Object.create(null);
5757
5765
  function no(n) {
5758
- return n in Zn ? n + "$" + ++Zn[n] : (Zn[n] = 0, n + "$");
5766
+ return n in er ? n + "$" + ++er[n] : (er[n] = 0, n + "$");
5759
5767
  }
5760
5768
  class we {
5761
5769
  /**
@@ -5786,12 +5794,12 @@ const J = function(n) {
5786
5794
  let e = n.assignedSlot || n.parentNode;
5787
5795
  return e && e.nodeType == 11 ? e.host : e;
5788
5796
  };
5789
- let xr = null;
5797
+ let Mr = null;
5790
5798
  const Te = function(n, e, t) {
5791
- let r = xr || (xr = document.createRange());
5799
+ let r = Mr || (Mr = document.createRange());
5792
5800
  return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
5793
5801
  }, wa = function() {
5794
- xr = null;
5802
+ Mr = null;
5795
5803
  }, ot = function(n, e, t, r) {
5796
5804
  return t && (Ei(n, e, t, r, -1) || Ei(n, e, t, r, 1));
5797
5805
  }, Ca = /^(img|br|input|textarea|hr)$/i;
@@ -5864,7 +5872,7 @@ function Xt(n) {
5864
5872
  ;
5865
5873
  return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
5866
5874
  }
5867
- const Bn = function(n) {
5875
+ const zn = function(n) {
5868
5876
  return n.focusNode && ot(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
5869
5877
  };
5870
5878
  function Ue(n, e) {
@@ -5891,9 +5899,9 @@ function Na(n, e, t) {
5891
5899
  return { node: r.startContainer, offset: Math.min(fe(r.startContainer), r.startOffset) };
5892
5900
  }
5893
5901
  }
5894
- const xe = typeof navigator < "u" ? navigator : null, vi = typeof document < "u" ? document : null, Ke = xe && xe.userAgent || "", Sr = /Edge\/(\d+)/.exec(Ke), ro = /MSIE \d/.exec(Ke), Mr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ke), ie = !!(ro || Mr || Sr), Ve = ro ? document.documentMode : Mr ? +Mr[1] : Sr ? +Sr[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(Ke);
5902
+ const xe = typeof navigator < "u" ? navigator : null, vi = typeof document < "u" ? document : null, Ke = xe && xe.userAgent || "", wr = /Edge\/(\d+)/.exec(Ke), ro = /MSIE \d/.exec(Ke), Cr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ke), ie = !!(ro || Cr || wr), Ve = ro ? document.documentMode : Cr ? +Cr[1] : wr ? +wr[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(Ke);
5895
5903
  pe && +(/Firefox\/(\d+)/.exec(Ke) || [0, 0])[1];
5896
- const wr = !ie && /Chrome\/(\d+)/.exec(Ke), _ = !!wr, io = wr ? +wr[1] : 0, Z = !ie && !!xe && /Apple Computer/.test(xe.vendor), St = Z && (/Mobile\/\w+/.test(Ke) || !!xe && xe.maxTouchPoints > 2), ue = St || (xe ? /Mac/.test(xe.platform) : !1), so = xe ? /Win/.test(xe.platform) : !1, Ee = /Android \d/.test(Ke), Zt = !!vi && "webkitFontSmoothing" in vi.documentElement.style, Aa = Zt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5904
+ const Tr = !ie && /Chrome\/(\d+)/.exec(Ke), _ = !!Tr, io = Tr ? +Tr[1] : 0, Z = !ie && !!xe && /Apple Computer/.test(xe.vendor), St = Z && (/Mobile\/\w+/.test(Ke) || !!xe && xe.maxTouchPoints > 2), ue = St || (xe ? /Mac/.test(xe.platform) : !1), so = xe ? /Win/.test(xe.platform) : !1, Ee = /Android \d/.test(Ke), Zt = !!vi && "webkitFontSmoothing" in vi.documentElement.style, Aa = Zt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5897
5905
  function Da(n) {
5898
5906
  let e = n.defaultView && n.defaultView.visualViewport;
5899
5907
  return e ? {
@@ -6131,14 +6139,14 @@ function uo(n, e, t) {
6131
6139
  if (s == null && i && (t < 0 || i == fe(r))) {
6132
6140
  let a = r.childNodes[i - 1];
6133
6141
  if (a.nodeType == 1)
6134
- return Qn(a.getBoundingClientRect(), !1);
6142
+ return tr(a.getBoundingClientRect(), !1);
6135
6143
  }
6136
6144
  if (s == null && i < fe(r)) {
6137
6145
  let a = r.childNodes[i];
6138
6146
  if (a.nodeType == 1)
6139
- return Qn(a.getBoundingClientRect(), !0);
6147
+ return tr(a.getBoundingClientRect(), !0);
6140
6148
  }
6141
- return Qn(r.getBoundingClientRect(), t >= 0);
6149
+ return tr(r.getBoundingClientRect(), t >= 0);
6142
6150
  }
6143
6151
  if (s == null && i && (t < 0 || i == fe(r))) {
6144
6152
  let a = r.childNodes[i - 1], c = a.nodeType == 3 ? Te(a, fe(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
@@ -6161,7 +6169,7 @@ function Ct(n, e) {
6161
6169
  let t = e ? n.left : n.right;
6162
6170
  return { top: n.top, bottom: n.bottom, left: t, right: t };
6163
6171
  }
6164
- function Qn(n, e) {
6172
+ function tr(n, e) {
6165
6173
  if (n.height == 0)
6166
6174
  return n;
6167
6175
  let t = e ? n.top : n.bottom;
@@ -6658,7 +6666,7 @@ class lt extends Qt {
6658
6666
  }
6659
6667
  slice(e, t, r) {
6660
6668
  let i = lt.create(this.parent, this.mark, !0, r), s = this.children, o = this.size;
6661
- t < o && (s = Tr(s, t, o, r)), e > 0 && (s = Tr(s, 0, e, r));
6669
+ t < o && (s = Er(s, t, o, r)), e > 0 && (s = Er(s, 0, e, r));
6662
6670
  for (let l = 0; l < s.length; l++)
6663
6671
  s[l].parent = i;
6664
6672
  return i.children = s, i;
@@ -6698,7 +6706,7 @@ class He extends Qt {
6698
6706
  } else d || ({ dom: d, contentDOM: u } = dt.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6699
6707
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
6700
6708
  let f = d;
6701
- return d = yo(d, r, t), c ? a = new Ua(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Ln(e, t, r, i, d, f, s) : new He(e, t, r, i, d, u || null, f, s, o + 1);
6709
+ return d = yo(d, r, t), c ? a = new Ua(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Fn(e, t, r, i, d, f, s) : new He(e, t, r, i, d, u || null, f, s, o + 1);
6702
6710
  }
6703
6711
  parseRule() {
6704
6712
  if (this.node.type.spec.reparseInView)
@@ -6721,7 +6729,7 @@ class He extends Qt {
6721
6729
  return e;
6722
6730
  }
6723
6731
  matchesNode(e, t, r) {
6724
- return this.dirty == me && e.eq(this.node) && bn(t, this.outerDeco) && r.eq(this.innerDeco);
6732
+ return this.dirty == me && e.eq(this.node) && xn(t, this.outerDeco) && r.eq(this.innerDeco);
6725
6733
  }
6726
6734
  get size() {
6727
6735
  return this.node.nodeSize;
@@ -6768,7 +6776,7 @@ class He extends Qt {
6768
6776
  s.pmViewDesc && (s.pmViewDesc = void 0);
6769
6777
  }
6770
6778
  let o = new Ja(this, s, t, i);
6771
- e.input.compositionNodes.push(o), this.children = Tr(this.children, r, r + i.length, e, o);
6779
+ e.input.compositionNodes.push(o), this.children = Er(this.children, r, r + i.length, e, o);
6772
6780
  }
6773
6781
  // If this desc must be updated to match the given node decoration,
6774
6782
  // do so and return true.
@@ -6779,10 +6787,10 @@ class He extends Qt {
6779
6787
  this.updateOuterDeco(t), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = me;
6780
6788
  }
6781
6789
  updateOuterDeco(e) {
6782
- if (bn(e, this.outerDeco))
6790
+ if (xn(e, this.outerDeco))
6783
6791
  return;
6784
6792
  let t = this.nodeDOM.nodeType != 1, r = this.dom;
6785
- this.dom = go(this.dom, this.nodeDOM, Cr(this.outerDeco, this.node, t), Cr(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
6793
+ this.dom = go(this.dom, this.nodeDOM, Or(this.outerDeco, this.node, t), Or(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
6786
6794
  }
6787
6795
  // Mark this node as being the selected node.
6788
6796
  selectNode() {
@@ -6801,7 +6809,7 @@ function Bi(n, e, t, r, i) {
6801
6809
  let s = new He(void 0, n, e, t, r, r, r, i, 0);
6802
6810
  return s.contentDOM && s.updateChildren(i, 0), s;
6803
6811
  }
6804
- class Ln extends He {
6812
+ class Fn extends He {
6805
6813
  constructor(e, t, r, i, s, o, l) {
6806
6814
  super(e, t, r, i, s, null, o, l, 0);
6807
6815
  }
@@ -6832,7 +6840,7 @@ class Ln extends He {
6832
6840
  }
6833
6841
  slice(e, t, r) {
6834
6842
  let i = this.node.cut(e, t), s = document.createTextNode(i.text);
6835
- return new Ln(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
6843
+ return new Fn(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
6836
6844
  }
6837
6845
  markDirty(e, t) {
6838
6846
  super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Se);
@@ -6916,7 +6924,7 @@ const Dt = function(n) {
6916
6924
  };
6917
6925
  Dt.prototype = /* @__PURE__ */ Object.create(null);
6918
6926
  const Ye = [new Dt()];
6919
- function Cr(n, e, t) {
6927
+ function Or(n, e, t) {
6920
6928
  if (n.length == 0)
6921
6929
  return Ye;
6922
6930
  let r = t ? Ye[0] : new Dt(), i = [r];
@@ -6969,9 +6977,9 @@ function _a(n, e, t) {
6969
6977
  }
6970
6978
  }
6971
6979
  function yo(n, e, t) {
6972
- return go(n, n, Ye, Cr(e, t, n.nodeType != 1));
6980
+ return go(n, n, Ye, Or(e, t, n.nodeType != 1));
6973
6981
  }
6974
- function bn(n, e) {
6982
+ function xn(n, e) {
6975
6983
  if (n.length != e.length)
6976
6984
  return !1;
6977
6985
  for (let t = 0; t < n.length; t++)
@@ -7074,7 +7082,7 @@ class Ga {
7074
7082
  let c = this.preMatch.matched.get(a);
7075
7083
  if (c != null && c != s)
7076
7084
  return !1;
7077
- let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Se && bn(t, a.outerDeco));
7085
+ let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Se && xn(t, a.outerDeco));
7078
7086
  if (!f && a.update(e, t, r, i))
7079
7087
  return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
7080
7088
  if (!f && (u = this.recreateWrapper(a, e, t, r, i, o)))
@@ -7087,7 +7095,7 @@ class Ga {
7087
7095
  // When a node with content is replaced by a different node with
7088
7096
  // identical content, move over its children.
7089
7097
  recreateWrapper(e, t, r, i, s, o) {
7090
- if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !bn(r, e.outerDeco) || !i.eq(e.innerDeco))
7098
+ if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !xn(r, e.outerDeco) || !i.eq(e.innerDeco))
7091
7099
  return null;
7092
7100
  let l = He.create(this.top, t, r, i, s, o);
7093
7101
  if (l.contentDOM) {
@@ -7118,7 +7126,7 @@ class Ga {
7118
7126
  for (; e instanceof lt; )
7119
7127
  t = e, e = t.children[t.children.length - 1];
7120
7128
  (!e || // Empty textblock
7121
- !(e instanceof Ln) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((Z || _) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
7129
+ !(e instanceof Fn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((Z || _) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
7122
7130
  }
7123
7131
  addHackNode(e, t) {
7124
7132
  if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
@@ -7242,7 +7250,7 @@ function ec(n, e, t, r) {
7242
7250
  }
7243
7251
  return -1;
7244
7252
  }
7245
- function Tr(n, e, t, r, i) {
7253
+ function Er(n, e, t, r, i) {
7246
7254
  let s = [];
7247
7255
  for (let o = 0, l = 0; o < n.length; o++) {
7248
7256
  let a = n[o], c = l, d = l += a.size;
@@ -7258,7 +7266,7 @@ function Wr(n, e = null) {
7258
7266
  if (o < 0)
7259
7267
  return null;
7260
7268
  let l = r.resolve(o), a, c;
7261
- if (Bn(t)) {
7269
+ if (zn(t)) {
7262
7270
  for (a = o; i && !i.node; )
7263
7271
  i = i.parent;
7264
7272
  let u = i.node;
@@ -7314,15 +7322,15 @@ const zi = Z || _ && io < 63;
7314
7322
  function Fi(n, e) {
7315
7323
  let { node: t, offset: r } = n.docView.domFromPos(e, 0), i = r < t.childNodes.length ? t.childNodes[r] : null, s = r ? t.childNodes[r - 1] : null;
7316
7324
  if (Z && i && i.contentEditable == "false")
7317
- return er(i);
7325
+ return nr(i);
7318
7326
  if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
7319
7327
  if (i)
7320
- return er(i);
7328
+ return nr(i);
7321
7329
  if (s)
7322
- return er(s);
7330
+ return nr(s);
7323
7331
  }
7324
7332
  }
7325
- function er(n) {
7333
+ function nr(n) {
7326
7334
  return n.contentEditable = "true", Z && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
7327
7335
  }
7328
7336
  function $i(n) {
@@ -7375,7 +7383,7 @@ function rc(n) {
7375
7383
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
7376
7384
  return ot(e.node, e.offset, t.anchorNode, t.anchorOffset);
7377
7385
  }
7378
- function Or(n, e) {
7386
+ function vr(n, e) {
7379
7387
  let { $anchor: t, $head: r } = n.selection, i = e > 0 ? t.max(r) : t.min(r), s = i.parent.inlineContent ? i.depth ? n.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
7380
7388
  return s && E.findFrom(s, e);
7381
7389
  }
@@ -7393,7 +7401,7 @@ function Wi(n, e, t) {
7393
7401
  return Ie(n, new M(r.$anchor, o));
7394
7402
  } else if (r.empty) {
7395
7403
  if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
7396
- let i = Or(n.state, e);
7404
+ let i = vr(n.state, e);
7397
7405
  return i && i instanceof S ? Ie(n, i) : !1;
7398
7406
  } else if (!(ue && t.indexOf("m") > -1)) {
7399
7407
  let i = r.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, o;
@@ -7407,12 +7415,12 @@ function Wi(n, e, t) {
7407
7415
  if (r instanceof S && r.node.isInline)
7408
7416
  return Ie(n, new M(e > 0 ? r.$to : r.$from));
7409
7417
  {
7410
- let i = Or(n.state, e);
7418
+ let i = vr(n.state, e);
7411
7419
  return i ? Ie(n, i) : !1;
7412
7420
  }
7413
7421
  }
7414
7422
  }
7415
- function kn(n) {
7423
+ function Sn(n) {
7416
7424
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
7417
7425
  }
7418
7426
  function It(n, e) {
@@ -7427,7 +7435,7 @@ function ic(n) {
7427
7435
  if (!t)
7428
7436
  return;
7429
7437
  let i, s, o = !1;
7430
- for (pe && t.nodeType == 1 && r < kn(t) && It(t.childNodes[r], -1) && (o = !0); ; )
7438
+ for (pe && t.nodeType == 1 && r < Sn(t) && It(t.childNodes[r], -1) && (o = !0); ; )
7431
7439
  if (r > 0) {
7432
7440
  if (t.nodeType != 1)
7433
7441
  break;
@@ -7448,7 +7456,7 @@ function ic(n) {
7448
7456
  for (; l && It(l, -1); )
7449
7457
  i = t.parentNode, s = J(l), l = l.previousSibling;
7450
7458
  if (l)
7451
- t = l, r = kn(t);
7459
+ t = l, r = Sn(t);
7452
7460
  else {
7453
7461
  if (t = t.parentNode, t == n.dom)
7454
7462
  break;
@@ -7456,13 +7464,13 @@ function ic(n) {
7456
7464
  }
7457
7465
  }
7458
7466
  }
7459
- o ? Er(n, t, r) : i && Er(n, i, s);
7467
+ o ? Nr(n, t, r) : i && Nr(n, i, s);
7460
7468
  }
7461
7469
  function sc(n) {
7462
7470
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7463
7471
  if (!t)
7464
7472
  return;
7465
- let i = kn(t), s, o;
7473
+ let i = Sn(t), s, o;
7466
7474
  for (; ; )
7467
7475
  if (r < i) {
7468
7476
  if (t.nodeType != 1)
@@ -7480,7 +7488,7 @@ function sc(n) {
7480
7488
  for (; l && It(l, 1); )
7481
7489
  s = l.parentNode, o = J(l) + 1, l = l.nextSibling;
7482
7490
  if (l)
7483
- t = l, r = 0, i = kn(t);
7491
+ t = l, r = 0, i = Sn(t);
7484
7492
  else {
7485
7493
  if (t = t.parentNode, t == n.dom)
7486
7494
  break;
@@ -7488,7 +7496,7 @@ function sc(n) {
7488
7496
  }
7489
7497
  }
7490
7498
  }
7491
- s && Er(n, s, o);
7499
+ s && Nr(n, s, o);
7492
7500
  }
7493
7501
  function So(n) {
7494
7502
  let e = n.pmViewDesc;
@@ -7518,7 +7526,7 @@ function lc(n, e) {
7518
7526
  n = t, e = n.childNodes.length;
7519
7527
  }
7520
7528
  }
7521
- function Er(n, e, t) {
7529
+ function Nr(n, e, t) {
7522
7530
  if (e.nodeType != 3) {
7523
7531
  let s, o;
7524
7532
  (o = oc(e, t)) ? (e = o, t = 0) : (s = lc(e, t)) && (e = s, t = s.nodeValue.length);
@@ -7526,7 +7534,7 @@ function Er(n, e, t) {
7526
7534
  let r = n.domSelection();
7527
7535
  if (!r)
7528
7536
  return;
7529
- if (Bn(r)) {
7537
+ if (zn(r)) {
7530
7538
  let s = document.createRange();
7531
7539
  s.setEnd(e, t), s.setStart(e, t), r.removeAllRanges(), r.addRange(s);
7532
7540
  } else r.extend && r.extend(e, t);
@@ -7559,7 +7567,7 @@ function ji(n, e, t) {
7559
7567
  return !1;
7560
7568
  let { $from: i, $to: s } = r;
7561
7569
  if (!i.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
7562
- let o = Or(n.state, e);
7570
+ let o = vr(n.state, e);
7563
7571
  if (o && o instanceof S)
7564
7572
  return Ie(n, o);
7565
7573
  }
@@ -7756,12 +7764,12 @@ function To(n, e) {
7756
7764
  let t = n.content.replaceChild(n.childCount - 1, To(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(b.empty, !0);
7757
7765
  return n.copy(t.append(r));
7758
7766
  }
7759
- function vr(n, e, t, r, i, s) {
7767
+ function Ar(n, e, t, r, i, s) {
7760
7768
  let o = e < 0 ? n.firstChild : n.lastChild, l = o.content;
7761
- return n.childCount > 1 && (s = 0), i < r - 1 && (l = vr(l, e, t, r, i + 1, s)), i >= t && (l = e < 0 ? o.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(o.contentMatchAt(o.childCount).fillBefore(b.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, o.copy(l));
7769
+ return n.childCount > 1 && (s = 0), i < r - 1 && (l = Ar(l, e, t, r, i + 1, s)), i >= t && (l = e < 0 ? o.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(o.contentMatchAt(o.childCount).fillBefore(b.empty, !0))), n.replaceChild(e < 0 ? 0 : n.childCount - 1, o.copy(l));
7762
7770
  }
7763
7771
  function Ui(n, e, t) {
7764
- return e < n.openStart && (n = new k(vr(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(vr(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
7772
+ return e < n.openStart && (n = new k(Ar(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Ar(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
7765
7773
  }
7766
7774
  const Oo = {
7767
7775
  thead: ["table"],
@@ -7778,10 +7786,10 @@ let _i = null;
7778
7786
  function Eo() {
7779
7787
  return _i || (_i = document.implementation.createHTMLDocument("title"));
7780
7788
  }
7781
- let tr = null;
7789
+ let rr = null;
7782
7790
  function hc(n) {
7783
7791
  let e = window.trustedTypes;
7784
- return e ? (tr || (tr = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), tr.createHTML(n)) : n;
7792
+ return e ? (rr || (rr = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), rr.createHTML(n)) : n;
7785
7793
  }
7786
7794
  function pc(n) {
7787
7795
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
@@ -7830,7 +7838,7 @@ function kc(n) {
7830
7838
  Sc(n, r) && !Kr(n, r) && (n.editable || !(r.type in te)) && t(n, r);
7831
7839
  }, yc[e] ? { passive: !0 } : void 0);
7832
7840
  }
7833
- Z && n.dom.addEventListener("input", () => null), Nr(n);
7841
+ Z && n.dom.addEventListener("input", () => null), Dr(n);
7834
7842
  }
7835
7843
  function ze(n, e) {
7836
7844
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
@@ -7841,7 +7849,7 @@ function xc(n) {
7841
7849
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
7842
7850
  clearTimeout(n.input.composingTimeout), clearTimeout(n.input.lastIOSEnterFallbackTimeout);
7843
7851
  }
7844
- function Nr(n) {
7852
+ function Dr(n) {
7845
7853
  n.someProp("handleDOMEvents", (e) => {
7846
7854
  for (let t in e)
7847
7855
  n.input.eventHandlers[t] || n.dom.addEventListener(t, n.input.eventHandlers[t] = (r) => Kr(n, r));
@@ -7893,7 +7901,7 @@ te.keypress = (n, e) => {
7893
7901
  !/[\r\n]/.test(i) && !n.someProp("handleTextInput", (o) => o(n, r.$from.pos, r.$to.pos, i, s)) && n.dispatch(s()), t.preventDefault();
7894
7902
  }
7895
7903
  };
7896
- function zn(n) {
7904
+ function $n(n) {
7897
7905
  return { left: n.clientX, top: n.clientY };
7898
7906
  }
7899
7907
  function wc(n, e) {
@@ -7964,7 +7972,7 @@ function Nc(n, e, t) {
7964
7972
  }
7965
7973
  }
7966
7974
  function Ur(n) {
7967
- return xn(n);
7975
+ return Mn(n);
7968
7976
  }
7969
7977
  const vo = ue ? "metaKey" : "ctrlKey";
7970
7978
  ee.mousedown = (n, e) => {
@@ -7972,7 +7980,7 @@ ee.mousedown = (n, e) => {
7972
7980
  n.input.shiftKey = t.shiftKey;
7973
7981
  let r = Ur(n), i = Date.now(), s = "singleClick";
7974
7982
  i - n.input.lastClick.time < 500 && wc(t, n.input.lastClick) && !t[vo] && n.input.lastClick.button == t.button && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s, button: t.button };
7975
- let o = n.posAtCoords(zn(t));
7983
+ let o = n.posAtCoords($n(t));
7976
7984
  o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Ac(n, o, t, !!r)) : (s == "doubleClick" ? Ec : vc)(n, o.pos, o.inside, t) ? t.preventDefault() : ze(n, "pointer"));
7977
7985
  };
7978
7986
  class Ac {
@@ -8004,7 +8012,7 @@ class Ac {
8004
8012
  if (this.done(), !this.view.dom.contains(e.target))
8005
8013
  return;
8006
8014
  let t = this.pos;
8007
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(zn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? ze(this.view, "pointer") : Oc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
8015
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords($n(e))), this.updateAllowDefault(e), this.allowDefault || !t ? ze(this.view, "pointer") : Oc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
8008
8016
  Z && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
8009
8017
  // cursor, but still report that the node is selected
8010
8018
  // when asked through getSelection. You'll then get a
@@ -8037,8 +8045,8 @@ te.compositionstart = te.compositionupdate = (n) => {
8037
8045
  n.domObserver.flush();
8038
8046
  let { state: e } = n, t = e.selection.$to;
8039
8047
  if (e.selection instanceof M && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || _ && so && Ic(n)))
8040
- n.markCursor = n.state.storedMarks || t.marks(), xn(n, !0), n.markCursor = null;
8041
- else if (xn(n, !e.selection.empty), pe && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
8048
+ n.markCursor = n.state.storedMarks || t.marks(), Mn(n, !0), n.markCursor = null;
8049
+ else if (Mn(n, !e.selection.empty), pe && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
8042
8050
  let r = n.domSelectionRange();
8043
8051
  for (let i = r.focusNode, s = r.focusOffset; i && i.nodeType == 1 && s != 0; ) {
8044
8052
  let o = s < 0 ? i.lastChild : i.childNodes[s - 1];
@@ -8067,7 +8075,7 @@ te.compositionend = (n, e) => {
8067
8075
  n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.badSafariComposition ? n.domObserver.forceFlush() : n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, Ao(n, 20));
8068
8076
  };
8069
8077
  function Ao(n, e) {
8070
- clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => xn(n), e));
8078
+ clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Mn(n), e));
8071
8079
  }
8072
8080
  function Do(n) {
8073
8081
  for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Pc()); n.input.compositionNodes.length > 0; )
@@ -8096,7 +8104,7 @@ function Pc() {
8096
8104
  let n = document.createEvent("Event");
8097
8105
  return n.initEvent("event", !0, !0), n.timeStamp;
8098
8106
  }
8099
- function xn(n, e = !1) {
8107
+ function Mn(n, e = !1) {
8100
8108
  if (!(Ee && n.domObserver.flushingSoon >= 0)) {
8101
8109
  if (n.domObserver.forceFlush(), Do(n), e || n.docView && n.docView.dirty) {
8102
8110
  let t = Wr(n), r = n.state.selection;
@@ -8175,7 +8183,7 @@ ee.dragstart = (n, e) => {
8175
8183
  let t = e, r = n.input.mouseDown;
8176
8184
  if (r && r.done(), !t.dataTransfer)
8177
8185
  return;
8178
- let i = n.state.selection, s = i.empty ? null : n.posAtCoords(zn(t)), o;
8186
+ let i = n.state.selection, s = i.empty ? null : n.posAtCoords($n(t)), o;
8179
8187
  if (!(s && s.pos >= i.from && s.pos <= (i instanceof S ? i.to - 1 : i.to))) {
8180
8188
  if (r && r.mightDrag)
8181
8189
  o = S.create(n.state.doc, r.mightDrag.pos);
@@ -8204,7 +8212,7 @@ te.drop = (n, e) => {
8204
8212
  function $c(n, e, t) {
8205
8213
  if (!e.dataTransfer)
8206
8214
  return;
8207
- let r = n.posAtCoords(zn(e));
8215
+ let r = n.posAtCoords($n(e));
8208
8216
  if (!r)
8209
8217
  return;
8210
8218
  let i = n.state.doc.resolve(r.pos), s = t && t.slice;
@@ -8272,7 +8280,7 @@ function Vt(n, e) {
8272
8280
  return !1;
8273
8281
  return !0;
8274
8282
  }
8275
- class Sn {
8283
+ class wn {
8276
8284
  constructor(e, t) {
8277
8285
  this.toDOM = e, this.spec = t || tt, this.side = this.spec.side || 0;
8278
8286
  }
@@ -8284,7 +8292,7 @@ class Sn {
8284
8292
  return !0;
8285
8293
  }
8286
8294
  eq(e) {
8287
- return this == e || e instanceof Sn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Vt(this.spec, e.spec));
8295
+ return this == e || e instanceof wn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Vt(this.spec, e.spec));
8288
8296
  }
8289
8297
  destroy(e) {
8290
8298
  this.spec.destroy && this.spec.destroy(e);
@@ -8365,7 +8373,7 @@ class he {
8365
8373
  widget's current document position.
8366
8374
  */
8367
8375
  static widget(e, t, r) {
8368
- return new he(e, e, new Sn(t, r));
8376
+ return new he(e, e, new wn(t, r));
8369
8377
  }
8370
8378
  /**
8371
8379
  Creates an inline decoration, which adds the given attributes to
@@ -8399,7 +8407,7 @@ class he {
8399
8407
  @internal
8400
8408
  */
8401
8409
  get widget() {
8402
- return this.type instanceof Sn;
8410
+ return this.type instanceof wn;
8403
8411
  }
8404
8412
  }
8405
8413
  const pt = [], tt = {};
@@ -8416,7 +8424,7 @@ class z {
8416
8424
  you must make a copy if you want need to preserve that.
8417
8425
  */
8418
8426
  static create(e, t) {
8419
- return t.length ? Mn(t, e, 0, tt) : X;
8427
+ return t.length ? Cn(t, e, 0, tt) : X;
8420
8428
  }
8421
8429
  /**
8422
8430
  Find all decorations in this set which touch the given range
@@ -8475,7 +8483,7 @@ class z {
8475
8483
  if (d = Lo(t, l, c)) {
8476
8484
  for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
8477
8485
  s += 3;
8478
- i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, Mn(d, l, c + 1, tt)), s += 3;
8486
+ i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, Cn(d, l, c + 1, tt)), s += 3;
8479
8487
  }
8480
8488
  });
8481
8489
  let o = Bo(s ? zo(t) : t, -r);
@@ -8671,7 +8679,7 @@ function Vc(n, e, t, r, i, s, o) {
8671
8679
  a = !0;
8672
8680
  }
8673
8681
  if (a) {
8674
- let c = Hc(l, n, e, t, i, s, o), d = Mn(c, r, 0, o);
8682
+ let c = Hc(l, n, e, t, i, s, o), d = Cn(c, r, 0, o);
8675
8683
  e = d.local;
8676
8684
  for (let u = 0; u < l.length; u += 3)
8677
8685
  l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
@@ -8721,13 +8729,13 @@ function zo(n) {
8721
8729
  n[t] != null && e.push(n[t]);
8722
8730
  return e;
8723
8731
  }
8724
- function Mn(n, e, t, r) {
8732
+ function Cn(n, e, t, r) {
8725
8733
  let i = [], s = !1;
8726
8734
  e.forEach((l, a) => {
8727
8735
  let c = Lo(n, l, a + t);
8728
8736
  if (c) {
8729
8737
  s = !0;
8730
- let d = Mn(c, l, t + a + 1, r);
8738
+ let d = Cn(c, l, t + a + 1, r);
8731
8739
  d != X && i.push(a, a + l.nodeSize, d);
8732
8740
  }
8733
8741
  });
@@ -8762,7 +8770,7 @@ function Gi(n, e, t) {
8762
8770
  e++;
8763
8771
  n.splice(e, 0, t);
8764
8772
  }
8765
- function nr(n) {
8773
+ function ir(n) {
8766
8774
  let e = [];
8767
8775
  return n.someProp("decorations", (t) => {
8768
8776
  let r = t(n.state);
@@ -8910,7 +8918,7 @@ class Kc {
8910
8918
  }
8911
8919
  }
8912
8920
  let c = null;
8913
- s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Bn(r) && (c = Wr(e)) && c.eq(E.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ne(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Jc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, Gc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Ne(e), this.currentSelection.set(r));
8921
+ s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && zn(r) && (c = Wr(e)) && c.eq(E.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Ne(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Jc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, Gc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Ne(e), this.currentSelection.set(r));
8914
8922
  }
8915
8923
  registerMutation(e, t) {
8916
8924
  if (t.indexOf(e.target) > -1)
@@ -9000,7 +9008,7 @@ function Gc(n, e) {
9000
9008
  }
9001
9009
  function Yc(n, e, t) {
9002
9010
  let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
9003
- if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Bn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), _ && n.input.lastKeyCode === 8)
9011
+ if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], zn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), _ && n.input.lastKeyCode === 8)
9004
9012
  for (let g = s; g > i; g--) {
9005
9013
  let y = r.childNodes[g - 1], T = y.pmViewDesc;
9006
9014
  if (y.nodeName == "BR" && !T) {
@@ -9143,7 +9151,7 @@ function td(n, e, t, r, i) {
9143
9151
  if (
9144
9152
  // The content must have shrunk
9145
9153
  t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
9146
- rr(r, !0, !1) < i.pos
9154
+ sr(r, !0, !1) < i.pos
9147
9155
  )
9148
9156
  return !1;
9149
9157
  let s = n.resolve(e);
@@ -9153,10 +9161,10 @@ function td(n, e, t, r, i) {
9153
9161
  }
9154
9162
  if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
9155
9163
  return !1;
9156
- let o = n.resolve(rr(s, !0, !0));
9157
- return !o.parent.isTextblock || o.pos > t || rr(o, !0, !1) < t ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
9164
+ let o = n.resolve(sr(s, !0, !0));
9165
+ return !o.parent.isTextblock || o.pos > t || sr(o, !0, !1) < t ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
9158
9166
  }
9159
- function rr(n, e, t) {
9167
+ function sr(n, e, t) {
9160
9168
  let r = n.depth, i = e ? n.end() : n.pos;
9161
9169
  for (; r > 0 && (e || n.indexAfter(r) == n.node(r).childCount); )
9162
9170
  r--, i++, e = !1;
@@ -9200,7 +9208,7 @@ class Fo {
9200
9208
  added to the document.
9201
9209
  */
9202
9210
  constructor(e, t) {
9203
- 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 bc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ss), 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 = rs(this), ns(this), this.nodeViews = is(this), this.docView = Bi(this.state.doc, ts(this), nr(this), this.dom, this), this.domObserver = new Kc(this, (r, i, s, o) => Qc(this, r, i, s, o)), this.domObserver.start(), kc(this), this.updatePluginViews();
9211
+ 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 bc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ss), 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 = rs(this), ns(this), this.nodeViews = is(this), this.docView = Bi(this.state.doc, ts(this), ir(this), this.dom, this), this.domObserver = new Kc(this, (r, i, s, o) => Qc(this, r, i, s, o)), this.domObserver.start(), kc(this), this.updatePluginViews();
9204
9212
  }
9205
9213
  /**
9206
9214
  Holds `true` when a
@@ -9228,7 +9236,7 @@ class Fo {
9228
9236
  the DOM.
9229
9237
  */
9230
9238
  update(e) {
9231
- e.handleDOMEvents != this._props.handleDOMEvents && Nr(this);
9239
+ e.handleDOMEvents != this._props.handleDOMEvents && Dr(this);
9232
9240
  let t = this._props;
9233
9241
  this._props = e, e.plugins && (e.plugins.forEach(ss), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
9234
9242
  }
@@ -9262,8 +9270,8 @@ class Fo {
9262
9270
  let h = is(this);
9263
9271
  id(h, this.nodeViews) && (this.nodeViews = h, s = !0);
9264
9272
  }
9265
- (l || t.handleDOMEvents != this._props.handleDOMEvents) && Nr(this), this.editable = rs(this), ns(this);
9266
- let a = nr(this), c = ts(this), d = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", u = s || !this.docView.matchesNode(e.doc, c, a);
9273
+ (l || t.handleDOMEvents != this._props.handleDOMEvents) && Dr(this), this.editable = rs(this), ns(this);
9274
+ let a = ir(this), c = ts(this), d = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", u = s || !this.docView.matchesNode(e.doc, c, a);
9267
9275
  (u || !e.selection.eq(i.selection)) && (o = !0);
9268
9276
  let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Ra(this);
9269
9277
  if (o) {
@@ -9493,7 +9501,7 @@ class Fo {
9493
9501
  views](https://prosemirror.net/docs/ref/#view.NodeView).
9494
9502
  */
9495
9503
  destroy() {
9496
- this.docView && (xc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], nr(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, wa());
9504
+ this.docView && (xc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], ir(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, wa());
9497
9505
  }
9498
9506
  /**
9499
9507
  This is true when the view has been
@@ -9625,7 +9633,7 @@ var qe = {
9625
9633
  220: "\\",
9626
9634
  221: "]",
9627
9635
  222: "'"
9628
- }, wn = {
9636
+ }, Tn = {
9629
9637
  48: ")",
9630
9638
  49: "!",
9631
9639
  50: "@",
@@ -9654,10 +9662,10 @@ var qe = {
9654
9662
  for (var U = 0; U < 10; U++) qe[48 + U] = qe[96 + U] = String(U);
9655
9663
  for (var U = 1; U <= 24; U++) qe[U + 111] = "F" + U;
9656
9664
  for (var U = 65; U <= 90; U++)
9657
- qe[U] = String.fromCharCode(U + 32), wn[U] = String.fromCharCode(U);
9658
- for (var ir in qe) wn.hasOwnProperty(ir) || (wn[ir] = qe[ir]);
9665
+ qe[U] = String.fromCharCode(U + 32), Tn[U] = String.fromCharCode(U);
9666
+ for (var or in qe) Tn.hasOwnProperty(or) || (Tn[or] = qe[or]);
9659
9667
  function ld(n) {
9660
- var e = sd && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || od && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? wn : qe)[n.keyCode] || n.key || "Unidentified";
9668
+ var e = sd && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || od && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? Tn : qe)[n.keyCode] || n.key || "Unidentified";
9661
9669
  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;
9662
9670
  }
9663
9671
  const ad = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), cd = typeof navigator < "u" && /Win/.test(navigator.platform);
@@ -9688,7 +9696,7 @@ function ud(n) {
9688
9696
  e[dd(t)] = n[t];
9689
9697
  return e;
9690
9698
  }
9691
- function sr(n, e, t = !0) {
9699
+ function lr(n, e, t = !0) {
9692
9700
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
9693
9701
  }
9694
9702
  function fd(n) {
@@ -9697,18 +9705,18 @@ function fd(n) {
9697
9705
  function $o(n) {
9698
9706
  let e = ud(n);
9699
9707
  return function(t, r) {
9700
- let i = ld(r), s, o = e[sr(i, r)];
9708
+ let i = ld(r), s, o = e[lr(i, r)];
9701
9709
  if (o && o(t.state, t.dispatch, t))
9702
9710
  return !0;
9703
9711
  if (i.length == 1 && i != " ") {
9704
9712
  if (r.shiftKey) {
9705
- let l = e[sr(i, r, !1)];
9713
+ let l = e[lr(i, r, !1)];
9706
9714
  if (l && l(t.state, t.dispatch, t))
9707
9715
  return !0;
9708
9716
  }
9709
9717
  if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
9710
9718
  !(cd && r.ctrlKey && r.altKey) && (s = qe[r.keyCode]) && s != i) {
9711
- let l = e[sr(s, r)];
9719
+ let l = e[lr(s, r)];
9712
9720
  if (l && l(t.state, t.dispatch, t))
9713
9721
  return !0;
9714
9722
  }
@@ -9735,7 +9743,7 @@ const Ho = (n, e, t) => {
9735
9743
  return !0;
9736
9744
  if (r.parent.content.size == 0 && (Mt(s, "end") || S.isSelectable(s)))
9737
9745
  for (let o = r.depth; ; o--) {
9738
- let l = Rn(n.doc, r.before(o), r.after(o), k.empty);
9746
+ let l = Bn(n.doc, r.before(o), r.after(o), k.empty);
9739
9747
  if (l && l.slice.size < l.to - l.from) {
9740
9748
  if (e) {
9741
9749
  let a = n.tr.step(l);
@@ -9779,7 +9787,7 @@ function Wo(n, e, t) {
9779
9787
  return !1;
9780
9788
  l = d;
9781
9789
  }
9782
- let c = Rn(n.doc, s, a, k.empty);
9790
+ let c = Bn(n.doc, s, a, k.empty);
9783
9791
  if (!c || c.from != s || c instanceof P && c.slice.size >= a - s)
9784
9792
  return !1;
9785
9793
  if (t) {
@@ -9834,7 +9842,7 @@ const Ko = (n, e, t) => {
9834
9842
  if (Yo(n, i, e, 1))
9835
9843
  return !0;
9836
9844
  if (r.parent.content.size == 0 && (Mt(s, "start") || S.isSelectable(s))) {
9837
- let o = Rn(n.doc, r.before(), r.after(), k.empty);
9845
+ let o = Bn(n.doc, r.before(), r.after(), k.empty);
9838
9846
  if (o && o.slice.size < o.to - o.from) {
9839
9847
  if (e) {
9840
9848
  let l = n.tr.step(o);
@@ -9873,7 +9881,7 @@ const md = (n, e) => {
9873
9881
  if (t.node.isTextblock || !je(n.doc, t.from))
9874
9882
  return !1;
9875
9883
  i = t.from;
9876
- } else if (i = In(n.doc, t.from, -1), i == null)
9884
+ } else if (i = Pn(n.doc, t.from, -1), i == null)
9877
9885
  return !1;
9878
9886
  if (e) {
9879
9887
  let s = n.tr.join(i);
@@ -9886,7 +9894,7 @@ const md = (n, e) => {
9886
9894
  if (t.node.isTextblock || !je(n.doc, t.to))
9887
9895
  return !1;
9888
9896
  r = t.to;
9889
- } else if (r = In(n.doc, t.to, 1), r == null)
9897
+ } else if (r = Pn(n.doc, t.to, 1), r == null)
9890
9898
  return !1;
9891
9899
  return e && e(n.tr.join(r).scrollIntoView()), !0;
9892
9900
  }, yd = (n, e) => {
@@ -10092,7 +10100,7 @@ function Ed(n, e, t, r = null) {
10092
10100
  if (e.$from.index(e.depth - 1) == 0)
10093
10101
  return !1;
10094
10102
  let a = o.resolve(e.start - 2);
10095
- s = new gn(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new gn(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
10103
+ s = new bn(a, a, e.depth), e.endIndex < e.parent.childCount && (e = new bn(e.$from, o.resolve(e.$to.end(e.depth)), e.depth)), i = !0;
10096
10104
  }
10097
10105
  let l = $r(s, t, r, e);
10098
10106
  return l ? (n && vd(n, e, l, i, t), !0) : !1;
@@ -10118,7 +10126,7 @@ function Nd(n) {
10118
10126
  }
10119
10127
  function Ad(n, e, t, r) {
10120
10128
  let i = n.tr, s = r.end, o = r.$to.end(r.depth);
10121
- s < o && (i.step(new $(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new gn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
10129
+ s < o && (i.step(new $(s - 1, o, s, o, new k(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new bn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
10122
10130
  const l = wt(r);
10123
10131
  if (l == null)
10124
10132
  return !1;
@@ -10157,7 +10165,7 @@ function Id(n) {
10157
10165
  return !0;
10158
10166
  };
10159
10167
  }
10160
- function Fn(n) {
10168
+ function Vn(n) {
10161
10169
  const { state: e, transaction: t } = n;
10162
10170
  let { selection: r } = t, { doc: i } = t, { storedMarks: s } = t;
10163
10171
  return {
@@ -10182,7 +10190,7 @@ function Fn(n) {
10182
10190
  }
10183
10191
  };
10184
10192
  }
10185
- class $n {
10193
+ class Hn {
10186
10194
  constructor(e) {
10187
10195
  this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
10188
10196
  }
@@ -10227,7 +10235,7 @@ class $n {
10227
10235
  tr: e,
10228
10236
  editor: i,
10229
10237
  view: o,
10230
- state: Fn({
10238
+ state: Vn({
10231
10239
  state: s,
10232
10240
  transaction: e
10233
10241
  }),
@@ -10273,7 +10281,7 @@ function x(n, e, t) {
10273
10281
  parent: n.parent ? x(n.parent, e, t) : null
10274
10282
  }) : n.config[e];
10275
10283
  }
10276
- function Vn(n) {
10284
+ function Wn(n) {
10277
10285
  const e = n.filter((i) => i.type === "extension"), t = n.filter((i) => i.type === "node"), r = n.filter((i) => i.type === "mark");
10278
10286
  return {
10279
10287
  baseExtensions: e,
@@ -10282,7 +10290,7 @@ function Vn(n) {
10282
10290
  };
10283
10291
  }
10284
10292
  function Zo(n) {
10285
- const e = [], { nodeExtensions: t, markExtensions: r } = Vn(n), i = [...t, ...r], s = {
10293
+ const e = [], { nodeExtensions: t, markExtensions: r } = Wn(n), i = [...t, ...r], s = {
10286
10294
  default: null,
10287
10295
  rendered: !0,
10288
10296
  renderHTML: null,
@@ -10368,7 +10376,7 @@ function W(...n) {
10368
10376
  }), r;
10369
10377
  }, {});
10370
10378
  }
10371
- function Ar(n, e) {
10379
+ function Ir(n, e) {
10372
10380
  return e.filter((t) => t.type === n.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(n.attrs) || {} : {
10373
10381
  [t.name]: n.attrs[t.name]
10374
10382
  }).reduce((t, r) => W(t, r), {});
@@ -10411,7 +10419,7 @@ function cs(n) {
10411
10419
  }
10412
10420
  function Ld(n, e) {
10413
10421
  var t;
10414
- const r = Zo(n), { nodeExtensions: i, markExtensions: s } = Vn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
10422
+ const r = Zo(n), { nodeExtensions: i, markExtensions: s } = Wn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
10415
10423
  const d = r.filter((y) => y.type === c.name), u = {
10416
10424
  name: c.name,
10417
10425
  options: c.options,
@@ -10446,7 +10454,7 @@ function Ld(n, e) {
10446
10454
  const m = x(c, "renderHTML", u);
10447
10455
  m && (h.toDOM = (y) => m({
10448
10456
  node: y,
10449
- HTMLAttributes: Ar(y, d)
10457
+ HTMLAttributes: Ir(y, d)
10450
10458
  }));
10451
10459
  const g = x(c, "renderText", u);
10452
10460
  return g && (h.toText = g), [c.name, h];
@@ -10478,7 +10486,7 @@ function Ld(n, e) {
10478
10486
  const m = x(c, "renderHTML", u);
10479
10487
  return m && (h.toDOM = (g) => m({
10480
10488
  mark: g,
10481
- HTMLAttributes: Ar(g, d)
10489
+ HTMLAttributes: Ir(g, d)
10482
10490
  })), [c.name, h];
10483
10491
  }));
10484
10492
  return new $s({
@@ -10487,7 +10495,7 @@ function Ld(n, e) {
10487
10495
  marks: a
10488
10496
  });
10489
10497
  }
10490
- function or(n, e) {
10498
+ function ar(n, e) {
10491
10499
  return e.nodes[n] || e.marks[n] || null;
10492
10500
  }
10493
10501
  function ds(n, e) {
@@ -10514,7 +10522,7 @@ const zd = (n, e = 500) => {
10514
10522
  function ni(n) {
10515
10523
  return Object.prototype.toString.call(n) === "[object RegExp]";
10516
10524
  }
10517
- class Hn {
10525
+ class qn {
10518
10526
  constructor(e) {
10519
10527
  this.find = e.find, this.handler = e.handler;
10520
10528
  }
@@ -10547,13 +10555,13 @@ function rn(n) {
10547
10555
  const h = Fd(u, f.find);
10548
10556
  if (!h)
10549
10557
  return;
10550
- const p = a.state.tr, m = Fn({
10558
+ const p = a.state.tr, m = Vn({
10551
10559
  state: a.state,
10552
10560
  transaction: p
10553
10561
  }), g = {
10554
10562
  from: r - (h[0].length - s.length),
10555
10563
  to: i
10556
- }, { commands: y, chain: T, can: w } = new $n({
10564
+ }, { commands: y, chain: T, can: w } = new Hn({
10557
10565
  editor: t,
10558
10566
  state: m
10559
10567
  });
@@ -10650,10 +10658,10 @@ function Vd(n) {
10650
10658
  function sn(n) {
10651
10659
  return Vd(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
10652
10660
  }
10653
- function Wn(n, e) {
10661
+ function jn(n, e) {
10654
10662
  const t = { ...n };
10655
10663
  return sn(n) && sn(e) && Object.keys(e).forEach((r) => {
10656
- sn(e[r]) && sn(n[r]) ? t[r] = Wn(n[r], e[r]) : t[r] = e[r];
10664
+ sn(e[r]) && sn(n[r]) ? t[r] = jn(n[r], e[r]) : t[r] = e[r];
10657
10665
  }), t;
10658
10666
  }
10659
10667
  class Me {
@@ -10677,7 +10685,7 @@ class Me {
10677
10685
  configure(e = {}) {
10678
10686
  const t = this.extend({
10679
10687
  ...this.config,
10680
- addOptions: () => Wn(this.options, e)
10688
+ addOptions: () => jn(this.options, e)
10681
10689
  });
10682
10690
  return t.name = this.name, t.parent = this.parent, t;
10683
10691
  }
@@ -10720,7 +10728,7 @@ const qd = (n, e, t) => {
10720
10728
  }) : [];
10721
10729
  };
10722
10730
  function jd(n) {
10723
- const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new $n({
10731
+ const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new Hn({
10724
10732
  editor: e,
10725
10733
  state: t
10726
10734
  }), u = [];
@@ -10765,7 +10773,7 @@ function Jd(n) {
10765
10773
  l = null;
10766
10774
  }
10767
10775
  const a = ({ state: d, from: u, to: f, rule: h, pasteEvt: p }) => {
10768
- const m = d.tr, g = Fn({
10776
+ const m = d.tr, g = Vn({
10769
10777
  state: d,
10770
10778
  transaction: m
10771
10779
  });
@@ -10903,7 +10911,7 @@ class gt {
10903
10911
  options: t.options,
10904
10912
  storage: t.storage,
10905
10913
  editor: this.editor,
10906
- type: or(t.name, this.schema)
10914
+ type: ar(t.name, this.schema)
10907
10915
  }, i = x(t, "addCommands", r);
10908
10916
  return i ? {
10909
10917
  ...e,
@@ -10922,7 +10930,7 @@ class gt {
10922
10930
  options: o.options,
10923
10931
  storage: o.storage,
10924
10932
  editor: e,
10925
- type: or(o.name, this.schema)
10933
+ type: ar(o.name, this.schema)
10926
10934
  }, a = [], c = x(o, "addKeyboardShortcuts", l);
10927
10935
  let d = {};
10928
10936
  if (o.type === "mark" && x(o, "exitable", l) && (d.ArrowRight = () => Me.handleExit({ editor: e, mark: o })), c) {
@@ -10966,7 +10974,7 @@ class gt {
10966
10974
  * @returns An object with all node views where the key is the node name and the value is the node view function
10967
10975
  */
10968
10976
  get nodeViews() {
10969
- const { editor: e } = this, { nodeExtensions: t } = Vn(this.extensions);
10977
+ const { editor: e } = this, { nodeExtensions: t } = Wn(this.extensions);
10970
10978
  return Object.fromEntries(t.filter((r) => !!x(r, "addNodeView")).map((r) => {
10971
10979
  const i = this.attributes.filter((a) => a.type === r.name), s = {
10972
10980
  name: r.name,
@@ -10978,7 +10986,7 @@ class gt {
10978
10986
  if (!o)
10979
10987
  return [];
10980
10988
  const l = (a, c, d, u, f) => {
10981
- const h = Ar(a, i);
10989
+ const h = Ir(a, i);
10982
10990
  return o()({
10983
10991
  // pass-through
10984
10992
  node: a,
@@ -11008,7 +11016,7 @@ class gt {
11008
11016
  options: e.options,
11009
11017
  storage: e.storage,
11010
11018
  editor: this.editor,
11011
- type: or(e.name, this.schema)
11019
+ type: ar(e.name, this.schema)
11012
11020
  };
11013
11021
  e.type === "mark" && (!((t = v(x(e, "keepOnSplit", r))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
11014
11022
  const i = x(e, "onBeforeCreate", r), s = x(e, "onCreate", r), o = x(e, "onUpdate", r), l = x(e, "onSelectionUpdate", r), a = x(e, "onTransaction", r), c = x(e, "onFocus", r), d = x(e, "onBlur", r), u = x(e, "onDestroy", r);
@@ -11037,7 +11045,7 @@ class G {
11037
11045
  configure(e = {}) {
11038
11046
  const t = this.extend({
11039
11047
  ...this.config,
11040
- addOptions: () => Wn(this.options, e)
11048
+ addOptions: () => jn(this.options, e)
11041
11049
  });
11042
11050
  return t.name = this.name, t.parent = this.parent, t;
11043
11051
  }
@@ -11151,12 +11159,12 @@ const _d = G.create({
11151
11159
  const { from: r, to: i } = n;
11152
11160
  return t && e.delete(r, i), !0;
11153
11161
  }, iu = () => ({ state: n, dispatch: e }) => Yr(n, e), su = () => ({ commands: n }) => n.keyboardShortcut("Enter"), ou = () => ({ state: n, dispatch: e }) => bd(n, e);
11154
- function Cn(n, e, t = { strict: !0 }) {
11162
+ function On(n, e, t = { strict: !0 }) {
11155
11163
  const r = Object.keys(e);
11156
11164
  return r.length ? r.every((i) => t.strict ? e[i] === n[i] : ni(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
11157
11165
  }
11158
11166
  function nl(n, e, t = {}) {
11159
- return n.find((r) => r.type === e && Cn(
11167
+ return n.find((r) => r.type === e && On(
11160
11168
  // Only check equality for the attributes that are provided
11161
11169
  Object.fromEntries(Object.keys(t).map((i) => [i, r.attrs[i]])),
11162
11170
  t
@@ -11227,7 +11235,7 @@ function il(n, e = null) {
11227
11235
  function fs() {
11228
11236
  return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
11229
11237
  }
11230
- function Tn() {
11238
+ function En() {
11231
11239
  return [
11232
11240
  "iPad Simulator",
11233
11241
  "iPhone Simulator",
@@ -11246,8 +11254,8 @@ const du = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
11246
11254
  ...e
11247
11255
  };
11248
11256
  const o = () => {
11249
- (Tn() || fs()) && r.dom.focus(), requestAnimationFrame(() => {
11250
- t.isDestroyed || (r.focus(), cu() && !Tn() && !fs() && r.dom.focus({ preventScroll: !0 }));
11257
+ (En() || fs()) && r.dom.focus(), requestAnimationFrame(() => {
11258
+ t.isDestroyed || (r.focus(), cu() && !En() && !fs() && r.dom.focus({ preventScroll: !0 }));
11251
11259
  });
11252
11260
  };
11253
11261
  if (r.hasFocus() && n === null || n === !1)
@@ -11395,14 +11403,14 @@ const pu = (n) => !("type" in n), mu = (n, e, t) => ({ tr: r, dispatch: i, edito
11395
11403
  return !0;
11396
11404
  }, gu = () => ({ state: n, dispatch: e }) => md(n, e), yu = () => ({ state: n, dispatch: e }) => gd(n, e), bu = () => ({ state: n, dispatch: e }) => Ho(n, e), ku = () => ({ state: n, dispatch: e }) => Ko(n, e), xu = () => ({ state: n, dispatch: e, tr: t }) => {
11397
11405
  try {
11398
- const r = In(n.doc, n.selection.$from.pos, -1);
11406
+ const r = Pn(n.doc, n.selection.$from.pos, -1);
11399
11407
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11400
11408
  } catch {
11401
11409
  return !1;
11402
11410
  }
11403
11411
  }, Su = () => ({ state: n, dispatch: e, tr: t }) => {
11404
11412
  try {
11405
- const r = In(n.doc, n.selection.$from.pos, 1);
11413
+ const r = Pn(n.doc, n.selection.$from.pos, 1);
11406
11414
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11407
11415
  } catch {
11408
11416
  return !1;
@@ -11427,7 +11435,7 @@ function Cu(n) {
11427
11435
  else if (/^s(hift)?$/i.test(a))
11428
11436
  s = !0;
11429
11437
  else if (/^mod$/i.test(a))
11430
- Tn() || ol() ? o = !0 : i = !0;
11438
+ En() || ol() ? o = !0 : i = !0;
11431
11439
  else
11432
11440
  throw new Error(`Unrecognized modifier name: ${a}`);
11433
11441
  }
@@ -11462,7 +11470,7 @@ function Wt(n, e, t = {}) {
11462
11470
  to: p
11463
11471
  });
11464
11472
  });
11465
- const a = i - r, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) => Cn(u.node.attrs, t, { strict: !1 }));
11473
+ const a = i - r, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) => On(u.node.attrs, t, { strict: !1 }));
11466
11474
  return s ? !!c.length : c.reduce((u, f) => u + f.to - f.from, 0) >= a;
11467
11475
  }
11468
11476
  const Ou = (n, e = {}) => ({ state: t, dispatch: r }) => {
@@ -11472,7 +11480,7 @@ const Ou = (n, e = {}) => ({ state: t, dispatch: r }) => {
11472
11480
  const r = H(n, e.schema);
11473
11481
  return Nd(r)(e, t);
11474
11482
  }, Nu = () => ({ state: n, dispatch: e }) => Uo(n, e);
11475
- function qn(n, e) {
11483
+ function Kn(n, e) {
11476
11484
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
11477
11485
  }
11478
11486
  function hs(n, e) {
@@ -11481,7 +11489,7 @@ function hs(n, e) {
11481
11489
  }
11482
11490
  const Au = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11483
11491
  let s = null, o = null;
11484
- const l = qn(typeof n == "string" ? n : n.name, r.schema);
11492
+ const l = Kn(typeof n == "string" ? n : n.name, r.schema);
11485
11493
  return l ? (l === "node" && (s = H(n, r.schema)), l === "mark" && (o = Je(n, r.schema)), i && t.selection.ranges.forEach((a) => {
11486
11494
  r.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, d) => {
11487
11495
  s && s === c.type && t.setNodeMarkup(d, void 0, hs(c.attrs, e)), o && c.marks.length && c.marks.forEach((u) => {
@@ -11496,7 +11504,7 @@ const Au = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11496
11504
  }
11497
11505
  return !0;
11498
11506
  }, Ru = () => ({ state: n, dispatch: e }) => qo(n, e), Pu = () => ({ state: n, dispatch: e }) => Jo(n, e), Bu = () => ({ state: n, dispatch: e }) => Sd(n, e), Lu = () => ({ state: n, dispatch: e }) => Cd(n, e), zu = () => ({ state: n, dispatch: e }) => wd(n, e);
11499
- function Dr(n, e, t = {}, r = {}) {
11507
+ function Rr(n, e, t = {}, r = {}) {
11500
11508
  return Ht(n, e, {
11501
11509
  slice: !1,
11502
11510
  parseOptions: t,
@@ -11507,7 +11515,7 @@ const Fu = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, comm
11507
11515
  var a, c;
11508
11516
  const { doc: d } = s;
11509
11517
  if (t.preserveWhitespace !== "full") {
11510
- const u = Dr(n, i.schema, t, {
11518
+ const u = Rr(n, i.schema, t, {
11511
11519
  errorOnInvalidContent: (a = r.errorOnInvalidContent) !== null && a !== void 0 ? a : i.options.enableContentCheck
11512
11520
  });
11513
11521
  return o && s.replaceWith(0, d.content.size, u).setMeta("preventUpdate", !e), !0;
@@ -11564,7 +11572,7 @@ function Wu(n, e) {
11564
11572
  return o ? { ...o.attrs } : {};
11565
11573
  }
11566
11574
  function qu(n, e) {
11567
- const t = qn(typeof e == "string" ? e : e.name, n.schema);
11575
+ const t = Kn(typeof e == "string" ? e : e.name, n.schema);
11568
11576
  return t === "node" ? Wu(n, e) : t === "mark" ? ll(n, e) : {};
11569
11577
  }
11570
11578
  function al(n, e, t) {
@@ -11589,10 +11597,10 @@ function un(n, e, t) {
11589
11597
  return i ? i.attribute.keepOnSplit : !1;
11590
11598
  }));
11591
11599
  }
11592
- function Ir(n, e, t = {}) {
11600
+ function Pr(n, e, t = {}) {
11593
11601
  const { empty: r, ranges: i } = n.selection, s = e ? Je(e, n.schema) : null;
11594
11602
  if (r)
11595
- return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => Cn(u.attrs, t, { strict: !1 }));
11603
+ return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => On(u.attrs, t, { strict: !1 }));
11596
11604
  let o = 0;
11597
11605
  const l = [];
11598
11606
  if (i.forEach(({ $from: u, $to: f }) => {
@@ -11609,17 +11617,17 @@ function Ir(n, e, t = {}) {
11609
11617
  });
11610
11618
  }), o === 0)
11611
11619
  return !1;
11612
- const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => Cn(u.mark.attrs, t, { strict: !1 })).reduce((u, f) => u + f.to - f.from, 0), c = l.filter((u) => s ? u.mark.type !== s && u.mark.type.excludes(s) : !0).reduce((u, f) => u + f.to - f.from, 0);
11620
+ const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => On(u.mark.attrs, t, { strict: !1 })).reduce((u, f) => u + f.to - f.from, 0), c = l.filter((u) => s ? u.mark.type !== s && u.mark.type.excludes(s) : !0).reduce((u, f) => u + f.to - f.from, 0);
11613
11621
  return (a > 0 ? a + c : a) >= o;
11614
11622
  }
11615
11623
  function ju(n, e, t = {}) {
11616
11624
  if (!e)
11617
- return Wt(n, null, t) || Ir(n, null, t);
11618
- const r = qn(e, n.schema);
11619
- return r === "node" ? Wt(n, e, t) : r === "mark" ? Ir(n, e, t) : !1;
11625
+ return Wt(n, null, t) || Pr(n, null, t);
11626
+ const r = Kn(e, n.schema);
11627
+ return r === "node" ? Wt(n, e, t) : r === "mark" ? Pr(n, e, t) : !1;
11620
11628
  }
11621
11629
  function ps(n, e) {
11622
- const { nodeExtensions: t } = Vn(e), r = t.find((o) => o.name === n);
11630
+ const { nodeExtensions: t } = Wn(e), r = t.find((o) => o.name === n);
11623
11631
  if (!r)
11624
11632
  return !1;
11625
11633
  const i = {
@@ -11807,7 +11815,7 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11807
11815
  t.ensureMarks(D);
11808
11816
  }
11809
11817
  return !0;
11810
- }, lr = (n, e) => {
11818
+ }, cr = (n, e) => {
11811
11819
  const t = ii((o) => o.type === e)(n.selection);
11812
11820
  if (!t)
11813
11821
  return !0;
@@ -11816,7 +11824,7 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11816
11824
  return !0;
11817
11825
  const i = n.doc.nodeAt(r);
11818
11826
  return t.node.type === (i == null ? void 0 : i.type) && je(n.doc, t.pos) && n.join(t.pos), !0;
11819
- }, ar = (n, e) => {
11827
+ }, dr = (n, e) => {
11820
11828
  const t = ii((o) => o.type === e)(n.selection);
11821
11829
  if (!t)
11822
11830
  return !0;
@@ -11834,15 +11842,15 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11834
11842
  if (D.node.type === h)
11835
11843
  return c.liftListItem(p);
11836
11844
  if (ps(D.node.type.name, u) && h.validContent(D.node.content) && l)
11837
- return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => lr(s, h)).command(() => ar(s, h)).run();
11845
+ return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => cr(s, h)).command(() => dr(s, h)).run();
11838
11846
  }
11839
- return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => lr(s, h)).command(() => ar(s, h)).run() : a().command(() => {
11847
+ return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => cr(s, h)).command(() => dr(s, h)).run() : a().command(() => {
11840
11848
  const L = d().wrapInList(h, r), C = I.filter((N) => f.includes(N.type.name));
11841
11849
  return s.ensureMarks(C), L ? !0 : c.clearNodes();
11842
- }).wrapInList(h, r).command(() => lr(s, h)).command(() => ar(s, h)).run();
11850
+ }).wrapInList(h, r).command(() => cr(s, h)).command(() => dr(s, h)).run();
11843
11851
  }, nf = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
11844
11852
  const { extendEmptyMarkRange: s = !1 } = t, o = Je(n, r.schema);
11845
- return Ir(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11853
+ return Pr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11846
11854
  }, rf = (n, e, t = {}) => ({ state: r, commands: i }) => {
11847
11855
  const s = H(n, r.schema), o = H(e, r.schema), l = Wt(r, s, t);
11848
11856
  let a;
@@ -11891,7 +11899,7 @@ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11891
11899
  return t.removeStoredMark(a), !0;
11892
11900
  }, cf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11893
11901
  let s = null, o = null;
11894
- const l = qn(typeof n == "string" ? n : n.name, r.schema);
11902
+ const l = Kn(typeof n == "string" ? n : n.name, r.schema);
11895
11903
  return l ? (l === "node" && (s = H(n, r.schema)), l === "mark" && (o = Je(n, r.schema)), i && t.selection.ranges.forEach((a) => {
11896
11904
  const c = a.$from.pos, d = a.$to.pos;
11897
11905
  let u, f, h, p;
@@ -12095,7 +12103,7 @@ const hf = G.create({
12095
12103
  "Ctrl-a": () => this.editor.commands.selectTextblockStart(),
12096
12104
  "Ctrl-e": () => this.editor.commands.selectTextblockEnd()
12097
12105
  };
12098
- return Tn() || ol() ? s : i;
12106
+ return En() || ol() ? s : i;
12099
12107
  },
12100
12108
  addProseMirrorPlugins() {
12101
12109
  return [
@@ -12115,10 +12123,10 @@ const hf = G.create({
12115
12123
  const { empty: s, from: o, to: l } = e.selection, a = E.atStart(e.doc).from, c = E.atEnd(e.doc).to;
12116
12124
  if (s || !(o === a && l === c) || !si(t.doc))
12117
12125
  return;
12118
- const f = t.tr, h = Fn({
12126
+ const f = t.tr, h = Vn({
12119
12127
  state: t,
12120
12128
  transaction: f
12121
- }), { commands: p } = new $n({
12129
+ }), { commands: p } = new Hn({
12122
12130
  editor: this.editor,
12123
12131
  state: h
12124
12132
  });
@@ -12516,7 +12524,7 @@ class wf extends Rd {
12516
12524
  * Creates an command manager.
12517
12525
  */
12518
12526
  createCommandManager() {
12519
- this.commandManager = new $n({
12527
+ this.commandManager = new Hn({
12520
12528
  editor: this
12521
12529
  });
12522
12530
  }
@@ -12533,7 +12541,7 @@ class wf extends Rd {
12533
12541
  var e;
12534
12542
  let t;
12535
12543
  try {
12536
- t = Dr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
12544
+ t = Rr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
12537
12545
  } catch (o) {
12538
12546
  if (!(o instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(o.message))
12539
12547
  throw o;
@@ -12543,7 +12551,7 @@ class wf extends Rd {
12543
12551
  disableCollaboration: () => {
12544
12552
  this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((l) => l.name !== "collaboration"), this.createExtensionManager();
12545
12553
  }
12546
- }), t = Dr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
12554
+ }), t = Rr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
12547
12555
  }
12548
12556
  const r = il(t, this.options.autofocus);
12549
12557
  this.view = new Fo(this.options.element, {
@@ -12715,7 +12723,7 @@ class wf extends Rd {
12715
12723
  }
12716
12724
  }
12717
12725
  function at(n) {
12718
- return new Hn({
12726
+ return new qn({
12719
12727
  find: n.find,
12720
12728
  handler: ({ state: e, range: t, match: r }) => {
12721
12729
  const i = v(n.getAttributes, void 0, r);
@@ -12734,7 +12742,7 @@ function at(n) {
12734
12742
  });
12735
12743
  }
12736
12744
  function cl(n) {
12737
- return new Hn({
12745
+ return new qn({
12738
12746
  find: n.find,
12739
12747
  handler: ({ state: e, range: t, match: r }) => {
12740
12748
  const i = v(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
@@ -12754,8 +12762,8 @@ function cl(n) {
12754
12762
  }
12755
12763
  });
12756
12764
  }
12757
- function Rr(n) {
12758
- return new Hn({
12765
+ function Br(n) {
12766
+ return new qn({
12759
12767
  find: n.find,
12760
12768
  handler: ({ state: e, range: t, match: r }) => {
12761
12769
  const i = e.doc.resolve(t.from), s = v(n.getAttributes, void 0, r) || {};
@@ -12766,7 +12774,7 @@ function Rr(n) {
12766
12774
  });
12767
12775
  }
12768
12776
  function qt(n) {
12769
- return new Hn({
12777
+ return new qn({
12770
12778
  find: n.find,
12771
12779
  handler: ({ state: e, range: t, match: r, chain: i }) => {
12772
12780
  const s = v(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && $r(a, n.type, s);
@@ -12809,7 +12817,7 @@ class ne {
12809
12817
  configure(e = {}) {
12810
12818
  const t = this.extend({
12811
12819
  ...this.config,
12812
- addOptions: () => Wn(this.options, e)
12820
+ addOptions: () => jn(this.options, e)
12813
12821
  });
12814
12822
  return t.name = this.name, t.parent = this.parent, t;
12815
12823
  }
@@ -13144,14 +13152,14 @@ const Tf = /^\s*>\s$/, Of = ne.create({
13144
13152
  },
13145
13153
  addInputRules() {
13146
13154
  return [
13147
- Rr({
13155
+ Br({
13148
13156
  find: zf,
13149
13157
  type: this.type,
13150
13158
  getAttributes: (n) => ({
13151
13159
  language: n[1]
13152
13160
  })
13153
13161
  }),
13154
- Rr({
13162
+ Br({
13155
13163
  find: Ff,
13156
13164
  type: this.type,
13157
13165
  getAttributes: (n) => ({
@@ -13587,7 +13595,7 @@ const Xf = G.create({
13587
13595
  }), {});
13588
13596
  },
13589
13597
  addInputRules() {
13590
- return this.options.levels.map((n) => Rr({
13598
+ return this.options.levels.map((n) => Br({
13591
13599
  find: new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),
13592
13600
  type: this.type,
13593
13601
  getAttributes: {
@@ -13596,10 +13604,10 @@ const Xf = G.create({
13596
13604
  }));
13597
13605
  }
13598
13606
  });
13599
- var On = 200, V = function() {
13607
+ var vn = 200, V = function() {
13600
13608
  };
13601
13609
  V.prototype.append = function(e) {
13602
- return e.length ? (e = V.from(e), !this.length && e || e.length < On && this.leafAppend(e) || this.length < On && e.leafPrepend(this) || this.appendInner(e)) : this;
13610
+ return e.length ? (e = V.from(e), !this.length && e || e.length < vn && this.leafAppend(e) || this.length < vn && e.leafPrepend(this) || this.appendInner(e)) : this;
13603
13611
  };
13604
13612
  V.prototype.prepend = function(e) {
13605
13613
  return e.length ? V.from(e).append(this) : this;
@@ -13648,10 +13656,10 @@ var ul = /* @__PURE__ */ function(n) {
13648
13656
  if (i(this.values[a], l + a) === !1)
13649
13657
  return !1;
13650
13658
  }, e.prototype.leafAppend = function(i) {
13651
- if (this.length + i.length <= On)
13659
+ if (this.length + i.length <= vn)
13652
13660
  return new e(this.values.concat(i.flatten()));
13653
13661
  }, e.prototype.leafPrepend = function(i) {
13654
- if (this.length + i.length <= On)
13662
+ if (this.length + i.length <= vn)
13655
13663
  return new e(i.flatten().concat(this.values));
13656
13664
  }, t.length.get = function() {
13657
13665
  return this.values.length;
@@ -13843,9 +13851,9 @@ function ih(n, e, t, r) {
13843
13851
  if (o && o.getMeta(rt))
13844
13852
  return o.getMeta(rt).redo ? new Re(n.done.addTransform(t, void 0, r, fn(e)), n.undone, bs(t.mapping.maps), n.prevTime, n.prevComposition) : new Re(n.done, n.undone.addTransform(t, void 0, r, fn(e)), null, n.prevTime, n.prevComposition);
13845
13853
  if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
13846
- let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !sh(t, n.prevRanges)), c = o ? cr(n.prevRanges, t.mapping) : bs(t.mapping.maps);
13854
+ let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !sh(t, n.prevRanges)), c = o ? ur(n.prevRanges, t.mapping) : bs(t.mapping.maps);
13847
13855
  return new Re(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, fn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
13848
- } else return (s = t.getMeta("rebased")) ? new Re(n.done.rebased(t, s), n.undone.rebased(t, s), cr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Re(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), cr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
13856
+ } else return (s = t.getMeta("rebased")) ? new Re(n.done.rebased(t, s), n.undone.rebased(t, s), ur(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Re(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), ur(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
13849
13857
  }
13850
13858
  function sh(n, e) {
13851
13859
  if (!e)
@@ -13864,7 +13872,7 @@ function bs(n) {
13864
13872
  n[t].forEach((r, i, s, o) => e.push(s, o));
13865
13873
  return e;
13866
13874
  }
13867
- function cr(n, e) {
13875
+ function ur(n, e) {
13868
13876
  if (!n)
13869
13877
  return null;
13870
13878
  let t = [];
@@ -13881,18 +13889,18 @@ function oh(n, e, t) {
13881
13889
  let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new Re(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
13882
13890
  return s.transform.setSelection(o).setMeta(rt, { redo: t, historyState: a });
13883
13891
  }
13884
- let dr = !1, ks = null;
13892
+ let fr = !1, ks = null;
13885
13893
  function fn(n) {
13886
13894
  let e = n.plugins;
13887
13895
  if (ks != e) {
13888
- dr = !1, ks = e;
13896
+ fr = !1, ks = e;
13889
13897
  for (let t = 0; t < e.length; t++)
13890
13898
  if (e[t].spec.historyPreserveItems) {
13891
- dr = !0;
13899
+ fr = !0;
13892
13900
  break;
13893
13901
  }
13894
13902
  }
13895
- return dr;
13903
+ return fr;
13896
13904
  }
13897
13905
  const rt = new we("history"), lh = new we("closeHistory");
13898
13906
  function ah(n = {}) {
@@ -14497,7 +14505,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), ch = G.create({
14497
14505
  ];
14498
14506
  }
14499
14507
  });
14500
- var re, Gt, Yt, de, Pr, ml, gl, yl, bl;
14508
+ var re, Gt, Yt, de, Lr, ml, gl, yl, bl;
14501
14509
  class Ph extends Ol {
14502
14510
  constructor() {
14503
14511
  super();
@@ -14507,7 +14515,7 @@ class Ph extends Ol {
14507
14515
  F(this, Yt, null);
14508
14516
  }
14509
14517
  connectedCallback() {
14510
- super.connectedCallback() && (q(this, de, ml).call(this), q(this, de, gl).call(this), q(this, de, Pr).call(this));
14518
+ super.connectedCallback() && (q(this, de, ml).call(this), q(this, de, gl).call(this), q(this, de, Lr).call(this));
14511
14519
  }
14512
14520
  get value() {
14513
14521
  return O(this, re).getHTML();
@@ -14534,14 +14542,14 @@ class Ph extends Ol {
14534
14542
  return this.hasAttribute("readonly");
14535
14543
  }
14536
14544
  set readonly(t) {
14537
- t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), q(this, de, Pr).call(this);
14545
+ t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), q(this, de, Lr).call(this);
14538
14546
  }
14539
14547
  disconnectedCallback() {
14540
14548
  O(this, re) && (O(this, re).destroy(), oe(this, re, null));
14541
14549
  }
14542
14550
  }
14543
14551
  re = new WeakMap(), Gt = new WeakMap(), Yt = new WeakMap(), de = new WeakSet(), // 2. 에디터 상태 업데이트 로직 분리
14544
- Pr = function() {
14552
+ Lr = function() {
14545
14553
  if (O(this, re)) {
14546
14554
  const t = this.readonly;
14547
14555
  O(this, re).setEditable(!t);
@@ -14552,7 +14560,7 @@ Pr = function() {
14552
14560
  const t = Ae.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
14553
14561
  this.shadowRoot.innerHTML = `
14554
14562
  <style>
14555
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.54/dist/css/nineEditor.css";
14563
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.55/dist/css/nineEditor.css";
14556
14564
  ${r}
14557
14565
  </style>
14558
14566