@nine-lab/nine-ux 0.1.42 → 0.1.43

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 ii = (n) => {
3
3
  throw TypeError(n);
4
4
  };
5
5
  var gl = (n, e, t) => e in n ? ml(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
6
- var ye = (n, e, t) => gl(n, typeof e != "symbol" ? e + "" : e, t), Wn = (n, e, t) => e.has(n) || ii("Cannot " + t);
7
- var O = (n, e, t) => (Wn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), W = (n, e, t) => e.has(n) ? ii("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), oe = (n, e, t, r) => (Wn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), Q = (n, e, t) => (Wn(n, e, "access private method"), t);
6
+ var ye = (n, e, t) => gl(n, typeof e != "symbol" ? e + "" : e, t), Hn = (n, e, t) => e.has(n) || ii("Cannot " + t);
7
+ var O = (n, e, t) => (Hn(n, e, "read from private field"), t ? t.call(n) : e.get(n)), W = (n, e, t) => e.has(n) ? ii("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), oe = (n, e, t, r) => (Hn(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), Q = (n, e, t) => (Hn(n, e, "access private method"), t);
8
8
  import { nine as yl } from "@nine-lab/nine-util";
9
9
  const bl = `
10
10
  dialog::backdrop {
@@ -410,7 +410,7 @@ class kl extends HTMLElement {
410
410
  }
411
411
  Oe = new WeakMap(), q = new WeakMap(), Cn = new WeakMap(), Tn = new WeakMap(), On = new WeakMap();
412
412
  customElements.get("nine-dialog") || customElements.define("nine-dialog", kl);
413
- class Ir extends HTMLElement {
413
+ class Dr extends HTMLElement {
414
414
  constructor() {
415
415
  super(), this.attachShadow({ mode: "open" });
416
416
  }
@@ -426,14 +426,14 @@ class Ir extends HTMLElement {
426
426
  `;
427
427
  }
428
428
  }
429
- ye(Ir, "confirm", async (e, t = "Confirm", r = {}) => {
429
+ ye(Dr, "confirm", async (e, t = "Confirm", r = {}) => {
430
430
  var d;
431
431
  const i = {
432
432
  "true-text": "Yes",
433
433
  "false-text": "No",
434
434
  class: "",
435
435
  animation: "",
436
- ...((d = Nn.options) == null ? void 0 : d.confirm) || {},
436
+ ...((d = Rr.options) == null ? void 0 : d.confirm) || {},
437
437
  ...r
438
438
  };
439
439
  document.querySelectorAll("nine-confirm-popup").forEach((u) => u.remove());
@@ -448,7 +448,7 @@ ye(Ir, "confirm", async (e, t = "Confirm", r = {}) => {
448
448
  }, o.addEventListener("close", () => u(void 0)), o.showModal();
449
449
  });
450
450
  });
451
- class Rr extends HTMLElement {
451
+ class Ir extends HTMLElement {
452
452
  constructor() {
453
453
  super(), this.attachShadow({ mode: "open" });
454
454
  }
@@ -463,12 +463,12 @@ class Rr extends HTMLElement {
463
463
  `;
464
464
  }
465
465
  }
466
- ye(Rr, "alert", async (e, t = "Alert", r = {}) => {
466
+ ye(Ir, "alert", async (e, t = "Alert", r = {}) => {
467
467
  var c;
468
468
  const i = {
469
469
  class: "",
470
470
  animation: "",
471
- ...((c = Nn.options) == null ? void 0 : c.alert) || {},
471
+ ...((c = Rr.options) == null ? void 0 : c.alert) || {},
472
472
  ...r
473
473
  };
474
474
  document.querySelectorAll("nine-alert-popup").forEach((d) => d.remove());
@@ -482,8 +482,8 @@ ye(Rr, "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", Ir);
486
- customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Rr);
485
+ customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", Dr);
486
+ customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", Ir);
487
487
  var Wt;
488
488
  class xl {
489
489
  constructor() {
@@ -500,10 +500,10 @@ class xl {
500
500
  // 이제 setup이나 window 교체 로직은 여기서 다 제거합니다.
501
501
  // 오직 팝업을 실행하는 인터페이스 역할만 수행.
502
502
  async alert(e, t = "Alert", r = {}) {
503
- return await Rr.alert(e, t, r);
503
+ return await Ir.alert(e, t, r);
504
504
  }
505
505
  async confirm(e, t = "Confirm", r = {}) {
506
- return await Ir.confirm(e, t, r);
506
+ return await Dr.confirm(e, t, r);
507
507
  }
508
508
  /**
509
509
  * 컴포넌트별 CSS 경로 생성 헬퍼 (복구!)
@@ -514,8 +514,8 @@ class xl {
514
514
  }
515
515
  }
516
516
  Wt = new WeakMap();
517
- const Nn = new xl();
518
- var qt, Xe, jt, ae, Ct, cr, dr, Kt, En;
517
+ const Rr = new xl();
518
+ var qt, Xe, jt, ae, Ct, ar, cr, Kt, En;
519
519
  class Sl extends HTMLElement {
520
520
  constructor() {
521
521
  super();
@@ -540,20 +540,20 @@ class Sl extends HTMLElement {
540
540
  });
541
541
  // 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
542
542
  ye(this, "clearData", (t = {}) => {
543
- Q(this, ae, dr).call(this), Q(this, ae, Ct).call(this).forEach((r) => {
543
+ Q(this, ae, cr).call(this), Q(this, ae, Ct).call(this).forEach((r) => {
544
544
  const i = r.name;
545
545
  if (!i) return;
546
546
  const s = t && t[i] !== void 0 ? t[i] : "";
547
- Q(this, ae, cr).call(this, r, s);
547
+ Q(this, ae, ar).call(this, r, s);
548
548
  }), this.changed = !1;
549
549
  });
550
550
  ye(this, "setData", (t) => {
551
551
  if (!t || typeof t != "object") return;
552
- Q(this, ae, dr).call(this);
552
+ Q(this, ae, cr).call(this);
553
553
  let r = !1;
554
554
  Q(this, ae, Ct).call(this).forEach((i) => {
555
555
  const s = i.name;
556
- !s || !t.hasOwnProperty(s) || Q(this, ae, cr).call(this, i, t[s]) && (r = !0);
556
+ !s || !t.hasOwnProperty(s) || Q(this, ae, ar).call(this, i, t[s]) && (r = !0);
557
557
  }), r && (this.changed = !0);
558
558
  });
559
559
  ye(this, "initData", (t) => {
@@ -592,7 +592,7 @@ qt = new WeakMap(), Xe = new WeakMap(), jt = new WeakMap(), ae = new WeakSet(),
592
592
  Ct = function() {
593
593
  return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", O(this, Xe));
594
594
  }, // [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
595
- cr = function(t, r) {
595
+ ar = function(t, r) {
596
596
  const i = t.tagName.toUpperCase(), s = t.type;
597
597
  let o = !1;
598
598
  if (["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"].includes(i))
@@ -608,7 +608,7 @@ cr = function(t, r) {
608
608
  t.textContent !== r && (o = !0), t.textContent = r;
609
609
  return o;
610
610
  }, // [공통 로직 2] 이벤트 리스너 일괄 등록
611
- dr = function() {
611
+ cr = function() {
612
612
  Q(this, ae, Ct).call(this).forEach((t) => {
613
613
  t.removeEventListener("input", O(this, Kt)), t.addEventListener("input", O(this, Kt));
614
614
  });
@@ -1015,9 +1015,9 @@ class b {
1015
1015
  }
1016
1016
  }
1017
1017
  b.empty = new b([], 0);
1018
- const qn = { index: 0, offset: 0 };
1018
+ const Wn = { index: 0, offset: 0 };
1019
1019
  function Xt(n, e) {
1020
- return qn.index = n, qn.offset = e, qn;
1020
+ return Wn.index = n, Wn.offset = e, Wn;
1021
1021
  }
1022
1022
  function dn(n, e) {
1023
1023
  if (n === e)
@@ -1043,7 +1043,7 @@ function dn(n, e) {
1043
1043
  }
1044
1044
  return !0;
1045
1045
  }
1046
- let A = class ur {
1046
+ let A = class dr {
1047
1047
  /**
1048
1048
  @internal
1049
1049
  */
@@ -1141,8 +1141,8 @@ let A = class ur {
1141
1141
  */
1142
1142
  static setFrom(e) {
1143
1143
  if (!e || Array.isArray(e) && e.length == 0)
1144
- return ur.none;
1145
- if (e instanceof ur)
1144
+ return dr.none;
1145
+ if (e instanceof dr)
1146
1146
  return [e];
1147
1147
  let t = e.slice();
1148
1148
  return t.sort((r, i) => r.type.rank - i.type.rank), t;
@@ -1276,7 +1276,7 @@ function Cs(n, e) {
1276
1276
  if (!e.type.compatibleContent(n.type))
1277
1277
  throw new un("Cannot join " + e.type.name + " onto " + n.type.name);
1278
1278
  }
1279
- function fr(n, e, t) {
1279
+ function ur(n, e, t) {
1280
1280
  let r = n.node(t);
1281
1281
  return Cs(r, e.node(t)), r;
1282
1282
  }
@@ -1295,13 +1295,13 @@ function Qe(n, e) {
1295
1295
  return n.type.checkContent(e), n.copy(e);
1296
1296
  }
1297
1297
  function Ts(n, e, t, r, i) {
1298
- let s = n.depth > i && fr(n, e, i + 1), o = r.depth > i && fr(t, r, i + 1), l = [];
1298
+ let s = n.depth > i && ur(n, e, i + 1), o = r.depth > i && ur(t, r, i + 1), l = [];
1299
1299
  return Nt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (Cs(s, o), Ze(Qe(s, Ts(n, e, t, r, i + 1)), l)) : (s && Ze(Qe(s, fn(n, e, i + 1)), l), Nt(e, t, i, l), o && Ze(Qe(o, fn(t, r, i + 1)), l)), Nt(r, null, i, l), new b(l);
1300
1300
  }
1301
1301
  function fn(n, e, t) {
1302
1302
  let r = [];
1303
1303
  if (Nt(null, n, t, r), n.depth > t) {
1304
- let i = fr(n, e, t + 1);
1304
+ let i = ur(n, e, t + 1);
1305
1305
  Ze(Qe(i, fn(n, e, t + 1)), r);
1306
1306
  }
1307
1307
  return Nt(e, null, t, r), new b(r);
@@ -1609,7 +1609,7 @@ class hn {
1609
1609
  }
1610
1610
  }
1611
1611
  const Ol = /* @__PURE__ */ Object.create(null);
1612
- let ze = class hr {
1612
+ let ze = class fr {
1613
1613
  /**
1614
1614
  @internal
1615
1615
  */
@@ -1734,14 +1734,14 @@ let ze = class hr {
1734
1734
  the given content (or empty, if no content is given).
1735
1735
  */
1736
1736
  copy(e = null) {
1737
- return e == this.content ? this : new hr(this.type, this.attrs, e, this.marks);
1737
+ return e == this.content ? this : new fr(this.type, this.attrs, e, this.marks);
1738
1738
  }
1739
1739
  /**
1740
1740
  Create a copy of this node, with the given set of marks instead
1741
1741
  of the node's own marks.
1742
1742
  */
1743
1743
  mark(e) {
1744
- return e == this.marks ? this : new hr(this.type, this.attrs, this.content, e);
1744
+ return e == this.marks ? this : new fr(this.type, this.attrs, this.content, e);
1745
1745
  }
1746
1746
  /**
1747
1747
  Create a copy of this node with only the content between the
@@ -2601,7 +2601,7 @@ class zl {
2601
2601
  return !this.hasDefault;
2602
2602
  }
2603
2603
  }
2604
- class vn {
2604
+ class Nn {
2605
2605
  /**
2606
2606
  @internal
2607
2607
  */
@@ -2623,7 +2623,7 @@ class vn {
2623
2623
  */
2624
2624
  static compile(e, t) {
2625
2625
  let r = /* @__PURE__ */ Object.create(null), i = 0;
2626
- return e.forEach((s, o) => r[s] = new vn(s, i++, t, o)), r;
2626
+ return e.forEach((s, o) => r[s] = new Nn(s, i++, t, o)), r;
2627
2627
  }
2628
2628
  /**
2629
2629
  When there is a mark of this type in the given set, a new set
@@ -2665,7 +2665,7 @@ class Ps {
2665
2665
  let t = this.spec = {};
2666
2666
  for (let i in e)
2667
2667
  t[i] = e[i];
2668
- t.nodes = j.from(e.nodes), t.marks = j.from(e.marks || {}), this.nodes = ai.compile(this.spec.nodes, this), this.marks = vn.compile(this.spec.marks, this);
2668
+ t.nodes = j.from(e.nodes), t.marks = j.from(e.marks || {}), this.nodes = ai.compile(this.spec.nodes, this), this.marks = Nn.compile(this.spec.marks, this);
2669
2669
  let r = /* @__PURE__ */ Object.create(null);
2670
2670
  for (let i in this.nodes) {
2671
2671
  if (i in this.marks)
@@ -2902,9 +2902,9 @@ const Bs = {
2902
2902
  script: !0,
2903
2903
  style: !0,
2904
2904
  title: !0
2905
- }, Ls = { ol: !0, ul: !0 }, Rt = 1, pr = 2, vt = 4;
2905
+ }, Ls = { ol: !0, ul: !0 }, Rt = 1, hr = 2, vt = 4;
2906
2906
  function di(n, e, t) {
2907
- return e != null ? (e ? Rt : 0) | (e === "full" ? pr : 0) : n && n.whitespace == "pre" ? Rt | pr : t & ~vt;
2907
+ return e != null ? (e ? Rt : 0) | (e === "full" ? hr : 0) : n && n.whitespace == "pre" ? Rt | hr : t & ~vt;
2908
2908
  }
2909
2909
  class Zt {
2910
2910
  constructor(e, t, r, i, s, o) {
@@ -2955,7 +2955,7 @@ class ui {
2955
2955
  e.nodeType == 3 ? this.addTextNode(e, t) : e.nodeType == 1 && this.addElement(e, t);
2956
2956
  }
2957
2957
  addTextNode(e, t) {
2958
- let r = e.nodeValue, i = this.top, s = i.options & pr ? "full" : this.localPreserveWS || (i.options & Rt) > 0, { schema: o } = this.parser;
2958
+ let r = e.nodeValue, i = this.top, s = i.options & hr ? "full" : this.localPreserveWS || (i.options & Rt) > 0, { schema: o } = this.parser;
2959
2959
  if (s === "full" || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
2960
2960
  if (s)
2961
2961
  if (s === "full")
@@ -3274,7 +3274,7 @@ class ct {
3274
3274
  nodes.
3275
3275
  */
3276
3276
  serializeFragment(e, t = {}, r) {
3277
- r || (r = jn(t).createDocumentFragment());
3277
+ r || (r = qn(t).createDocumentFragment());
3278
3278
  let i = r, s = [];
3279
3279
  return e.forEach((o) => {
3280
3280
  if (s.length || o.marks.length) {
@@ -3303,7 +3303,7 @@ class ct {
3303
3303
  @internal
3304
3304
  */
3305
3305
  serializeNodeInner(e, t) {
3306
- let { dom: r, contentDOM: i } = on(jn(t), this.nodes[e.type.name](e), null, e.attrs);
3306
+ let { dom: r, contentDOM: i } = on(qn(t), this.nodes[e.type.name](e), null, e.attrs);
3307
3307
  if (i) {
3308
3308
  if (e.isLeaf)
3309
3309
  throw new RangeError("Content hole not allowed in a leaf node spec");
@@ -3331,7 +3331,7 @@ class ct {
3331
3331
  */
3332
3332
  serializeMark(e, t, r = {}) {
3333
3333
  let i = this.marks[e.type.name];
3334
- return i && on(jn(r), i(e, t), null, e.attrs);
3334
+ return i && on(qn(r), i(e, t), null, e.attrs);
3335
3335
  }
3336
3336
  static renderSpec(e, t, r = null, i) {
3337
3337
  return on(e, t, r, i);
@@ -3366,7 +3366,7 @@ function pi(n) {
3366
3366
  }
3367
3367
  return e;
3368
3368
  }
3369
- function jn(n) {
3369
+ function qn(n) {
3370
3370
  return n.document || window.document;
3371
3371
  }
3372
3372
  const mi = /* @__PURE__ */ new WeakMap();
@@ -3441,7 +3441,7 @@ function Jl(n) {
3441
3441
  return (n - (n & zs)) / Fs;
3442
3442
  }
3443
3443
  const $s = 1, Vs = 2, ln = 4, Hs = 8;
3444
- class mr {
3444
+ class pr {
3445
3445
  /**
3446
3446
  @internal
3447
3447
  */
@@ -3518,11 +3518,11 @@ class le {
3518
3518
  if (r)
3519
3519
  return h;
3520
3520
  let p = e == (t < 0 ? a : u) ? null : Kl(l / 3, e - a), m = e == a ? Vs : e == u ? $s : ln;
3521
- return (t < 0 ? e != a : e != u) && (m |= Hs), new mr(h, m, p);
3521
+ return (t < 0 ? e != a : e != u) && (m |= Hs), new pr(h, m, p);
3522
3522
  }
3523
3523
  i += d - c;
3524
3524
  }
3525
- return r ? e + i : new mr(e + i, 0, null);
3525
+ return r ? e + i : new pr(e + i, 0, null);
3526
3526
  }
3527
3527
  /**
3528
3528
  @internal
@@ -3678,10 +3678,10 @@ class Pt {
3678
3678
  }
3679
3679
  i |= l.delInfo, e = l.pos;
3680
3680
  }
3681
- return r ? e : new mr(e, i, null);
3681
+ return r ? e : new pr(e, i, null);
3682
3682
  }
3683
3683
  }
3684
- const Kn = /* @__PURE__ */ Object.create(null);
3684
+ const jn = /* @__PURE__ */ Object.create(null);
3685
3685
  class Z {
3686
3686
  /**
3687
3687
  Get the step map that represents the changes made by this step,
@@ -3706,7 +3706,7 @@ class Z {
3706
3706
  static fromJSON(e, t) {
3707
3707
  if (!t || !t.stepType)
3708
3708
  throw new RangeError("Invalid input for Step.fromJSON");
3709
- let r = Kn[t.stepType];
3709
+ let r = jn[t.stepType];
3710
3710
  if (!r)
3711
3711
  throw new RangeError(`No step type ${t.stepType} defined`);
3712
3712
  return r.fromJSON(e, t);
@@ -3718,9 +3718,9 @@ class Z {
3718
3718
  that's unlikely to clash with steps from other modules.
3719
3719
  */
3720
3720
  static jsonID(e, t) {
3721
- if (e in Kn)
3721
+ if (e in jn)
3722
3722
  throw new RangeError("Duplicate use of step JSON ID " + e);
3723
- return Kn[e] = t, t.prototype.jsonID = e, t;
3723
+ return jn[e] = t, t.prototype.jsonID = e, t;
3724
3724
  }
3725
3725
  }
3726
3726
  class B {
@@ -3936,7 +3936,7 @@ class P extends Z {
3936
3936
  super(), this.from = e, this.to = t, this.slice = r, this.structure = i;
3937
3937
  }
3938
3938
  apply(e) {
3939
- return this.structure && gr(e, this.from, this.to) ? B.fail("Structure replace would overwrite content") : B.fromReplace(e, this.from, this.to, this.slice);
3939
+ return this.structure && mr(e, this.from, this.to) ? B.fail("Structure replace would overwrite content") : B.fromReplace(e, this.from, this.to, this.slice);
3940
3940
  }
3941
3941
  getMap() {
3942
3942
  return new le([this.from, this.to - this.from, this.slice.size]);
@@ -3986,7 +3986,7 @@ class F extends Z {
3986
3986
  super(), this.from = e, this.to = t, this.gapFrom = r, this.gapTo = i, this.slice = s, this.insert = o, this.structure = l;
3987
3987
  }
3988
3988
  apply(e) {
3989
- if (this.structure && (gr(e, this.from, this.gapFrom) || gr(e, this.gapTo, this.to)))
3989
+ if (this.structure && (mr(e, this.from, this.gapFrom) || mr(e, this.gapTo, this.to)))
3990
3990
  return B.fail("Structure gap-replace would overwrite content");
3991
3991
  let t = e.slice(this.gapFrom, this.gapTo);
3992
3992
  if (t.openStart || t.openEnd)
@@ -4033,7 +4033,7 @@ class F extends Z {
4033
4033
  }
4034
4034
  }
4035
4035
  Z.jsonID("replaceAround", F);
4036
- function gr(n, e, t) {
4036
+ function mr(n, e, t) {
4037
4037
  let r = n.resolve(e), i = t - e, s = r.depth;
4038
4038
  for (; i > 0 && s > 0 && r.indexAfter(s) == r.node(s).childCount; )
4039
4039
  s--, i--;
@@ -4068,7 +4068,7 @@ function _l(n, e, t, r) {
4068
4068
  return;
4069
4069
  s++;
4070
4070
  let a = null;
4071
- if (r instanceof vn) {
4071
+ if (r instanceof Nn) {
4072
4072
  let c = o.marks, d;
4073
4073
  for (; d = r.isInSet(c); )
4074
4074
  (a || (a = [])).push(d), c = d.removeFromSet(c);
@@ -4268,7 +4268,7 @@ function ia(n, e) {
4268
4268
  function js(n, e) {
4269
4269
  return !!(n && e && !n.isLeaf && ia(n, e));
4270
4270
  }
4271
- function An(n, e, t = -1) {
4271
+ function vn(n, e, t = -1) {
4272
4272
  let r = n.resolve(e);
4273
4273
  for (let i = r.depth; ; i--) {
4274
4274
  let s, o, l = r.index(i);
@@ -4341,7 +4341,7 @@ function Ks(n, e, t) {
4341
4341
  }
4342
4342
  return null;
4343
4343
  }
4344
- function Dn(n, e, t = e, r = k.empty) {
4344
+ function An(n, e, t = e, r = k.empty) {
4345
4345
  if (e == t && !r.size)
4346
4346
  return null;
4347
4347
  let i = n.resolve(e), s = n.resolve(t);
@@ -4396,7 +4396,7 @@ class la {
4396
4396
  for (let t = 1; t <= 2; t++)
4397
4397
  for (let r = t == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
4398
4398
  let i, s = null;
4399
- r ? (s = Jn(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
4399
+ r ? (s = Kn(this.unplaced.content, r - 1).firstChild, i = s.content) : i = this.unplaced.content;
4400
4400
  let o = i.firstChild;
4401
4401
  for (let l = this.depth; l >= 0; l--) {
4402
4402
  let { type: a, match: c } = this.frontier[l], d, u = null;
@@ -4410,11 +4410,11 @@ class la {
4410
4410
  }
4411
4411
  }
4412
4412
  openMore() {
4413
- let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Jn(e, t);
4413
+ let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Kn(e, t);
4414
4414
  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);
4415
4415
  }
4416
4416
  dropNode() {
4417
- let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Jn(e, t);
4417
+ let { content: e, openStart: t, openEnd: r } = this.unplaced, i = Kn(e, t);
4418
4418
  if (i.childCount <= 1 && t > 0) {
4419
4419
  let s = e.size - t <= t + i.size;
4420
4420
  this.unplaced = new k(Tt(e, t - 1, 1), t - 1, s ? t - 1 : r);
@@ -4455,7 +4455,7 @@ class la {
4455
4455
  if (!this.$to.parent.isTextblock)
4456
4456
  return -1;
4457
4457
  let e = this.frontier[this.depth], t;
4458
- if (!e.type.isTextblock || !Un(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
4458
+ if (!e.type.isTextblock || !Jn(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth)
4459
4459
  return -1;
4460
4460
  let { depth: r } = this.$to, i = this.$to.after(r);
4461
4461
  for (; r > 1 && i == this.$to.end(--r); )
@@ -4464,10 +4464,10 @@ class la {
4464
4464
  }
4465
4465
  findCloseLevel(e) {
4466
4466
  e: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
4467
- let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Un(e, t, i, r, s);
4467
+ let { match: r, type: i } = this.frontier[t], s = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), o = Jn(e, t, i, r, s);
4468
4468
  if (o) {
4469
4469
  for (let l = t - 1; l >= 0; l--) {
4470
- let { match: a, type: c } = this.frontier[l], d = Un(e, l, c, a, !0);
4470
+ let { match: a, type: c } = this.frontier[l], d = Jn(e, l, c, a, !0);
4471
4471
  if (!d || d.childCount)
4472
4472
  continue e;
4473
4473
  }
@@ -4503,7 +4503,7 @@ function Tt(n, e, t) {
4503
4503
  function Ot(n, e, t) {
4504
4504
  return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(Ot(n.lastChild.content, e - 1, t)));
4505
4505
  }
4506
- function Jn(n, e) {
4506
+ function Kn(n, e) {
4507
4507
  for (let t = 0; t < e; t++)
4508
4508
  n = n.firstChild.content;
4509
4509
  return n;
@@ -4514,7 +4514,7 @@ function Us(n, e, t) {
4514
4514
  let r = n.content;
4515
4515
  return e > 1 && (r = r.replaceChild(0, Us(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);
4516
4516
  }
4517
- function Un(n, e, t, r, i) {
4517
+ function Jn(n, e, t, r, i) {
4518
4518
  let s = n.node(e), o = i ? n.indexAfter(e) : n.index(e);
4519
4519
  if (o == s.childCount && !t.compatibleContent(s.type))
4520
4520
  return null;
@@ -4780,7 +4780,7 @@ class ha {
4780
4780
  given `slice`.
4781
4781
  */
4782
4782
  replace(e, t = e, r = k.empty) {
4783
- let i = Dn(this.doc, e, t, r);
4783
+ let i = An(this.doc, e, t, r);
4784
4784
  return i && this.step(i), this;
4785
4785
  }
4786
4786
  /**
@@ -4956,7 +4956,7 @@ class ha {
4956
4956
  return Br(this, e, t, r), this;
4957
4957
  }
4958
4958
  }
4959
- const _n = /* @__PURE__ */ Object.create(null);
4959
+ const Un = /* @__PURE__ */ Object.create(null);
4960
4960
  class E {
4961
4961
  /**
4962
4962
  Initialize a selection with the head and anchor and ranges. If no
@@ -5092,7 +5092,7 @@ class E {
5092
5092
  static fromJSON(e, t) {
5093
5093
  if (!t || !t.type)
5094
5094
  throw new RangeError("Invalid input for Selection.fromJSON");
5095
- let r = _n[t.type];
5095
+ let r = Un[t.type];
5096
5096
  if (!r)
5097
5097
  throw new RangeError(`No selection type ${t.type} defined`);
5098
5098
  return r.fromJSON(e, t);
@@ -5104,9 +5104,9 @@ class E {
5104
5104
  clash with classes from other modules.
5105
5105
  */
5106
5106
  static jsonID(e, t) {
5107
- if (e in _n)
5107
+ if (e in Un)
5108
5108
  throw new RangeError("Duplicate use of selection JSON ID " + e);
5109
- return _n[e] = t, t.prototype.jsonID = e, t;
5109
+ return Un[e] = t, t.prototype.jsonID = e, t;
5110
5110
  }
5111
5111
  /**
5112
5112
  Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
@@ -5165,7 +5165,7 @@ class M extends E {
5165
5165
  return e instanceof M && e.anchor == this.anchor && e.head == this.head;
5166
5166
  }
5167
5167
  getBookmark() {
5168
- return new In(this.anchor, this.head);
5168
+ return new Dn(this.anchor, this.head);
5169
5169
  }
5170
5170
  toJSON() {
5171
5171
  return { type: "text", anchor: this.anchor, head: this.head };
@@ -5206,12 +5206,12 @@ class M extends E {
5206
5206
  }
5207
5207
  }
5208
5208
  E.jsonID("text", M);
5209
- class In {
5209
+ class Dn {
5210
5210
  constructor(e, t) {
5211
5211
  this.anchor = e, this.head = t;
5212
5212
  }
5213
5213
  map(e) {
5214
- return new In(e.map(this.anchor), e.map(this.head));
5214
+ return new Dn(e.map(this.anchor), e.map(this.head));
5215
5215
  }
5216
5216
  resolve(e) {
5217
5217
  return M.between(e.resolve(this.anchor), e.resolve(this.head));
@@ -5272,7 +5272,7 @@ class zr {
5272
5272
  }
5273
5273
  map(e) {
5274
5274
  let { deleted: t, pos: r } = e.mapResult(this.anchor);
5275
- return t ? new In(r, r) : new zr(r);
5275
+ return t ? new Dn(r, r) : new zr(r);
5276
5276
  }
5277
5277
  resolve(e) {
5278
5278
  let t = e.resolve(this.anchor), r = t.nodeAfter;
@@ -5545,7 +5545,7 @@ const ya = [
5545
5545
  }
5546
5546
  })
5547
5547
  ];
5548
- class Gn {
5548
+ class _n {
5549
5549
  constructor(e, t) {
5550
5550
  this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = ya.slice(), t && t.forEach((r) => {
5551
5551
  if (this.pluginsByKey[r.key])
@@ -5646,7 +5646,7 @@ class pt {
5646
5646
  Create a new state.
5647
5647
  */
5648
5648
  static create(e) {
5649
- let t = new Gn(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new pt(t);
5649
+ let t = new _n(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new pt(t);
5650
5650
  for (let i = 0; i < t.fields.length; i++)
5651
5651
  r[t.fields[i].name] = t.fields[i].init(e, r);
5652
5652
  return r;
@@ -5660,7 +5660,7 @@ class pt {
5660
5660
  configuration object..
5661
5661
  */
5662
5662
  reconfigure(e) {
5663
- let t = new Gn(this.schema, e.plugins), r = t.fields, i = new pt(t);
5663
+ let t = new _n(this.schema, e.plugins), r = t.fields, i = new pt(t);
5664
5664
  for (let s = 0; s < r.length; s++) {
5665
5665
  let o = r[s].name;
5666
5666
  i[o] = this.hasOwnProperty(o) ? this[o] : r[s].init(e, i);
@@ -5697,7 +5697,7 @@ class pt {
5697
5697
  throw new RangeError("Invalid input for EditorState.fromJSON");
5698
5698
  if (!e.schema)
5699
5699
  throw new RangeError("Required config field 'schema' missing");
5700
- let i = new Gn(e.schema, e.plugins), s = new pt(i);
5700
+ let i = new _n(e.schema, e.plugins), s = new pt(i);
5701
5701
  return i.fields.forEach((o) => {
5702
5702
  if (o.name == "doc")
5703
5703
  s.doc = ze.fromJSON(e.schema, t.doc);
@@ -5740,9 +5740,9 @@ class se {
5740
5740
  return e[this.key];
5741
5741
  }
5742
5742
  }
5743
- const Yn = /* @__PURE__ */ Object.create(null);
5743
+ const Gn = /* @__PURE__ */ Object.create(null);
5744
5744
  function Xs(n) {
5745
- return n in Yn ? n + "$" + ++Yn[n] : (Yn[n] = 0, n + "$");
5745
+ return n in Gn ? n + "$" + ++Gn[n] : (Gn[n] = 0, n + "$");
5746
5746
  }
5747
5747
  class we {
5748
5748
  /**
@@ -5773,12 +5773,12 @@ const K = function(n) {
5773
5773
  let e = n.assignedSlot || n.parentNode;
5774
5774
  return e && e.nodeType == 11 ? e.host : e;
5775
5775
  };
5776
- let yr = null;
5776
+ let gr = null;
5777
5777
  const Te = function(n, e, t) {
5778
- let r = yr || (yr = document.createRange());
5778
+ let r = gr || (gr = document.createRange());
5779
5779
  return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
5780
5780
  }, ba = function() {
5781
- yr = null;
5781
+ gr = null;
5782
5782
  }, st = function(n, e, t, r) {
5783
5783
  return t && (Ci(n, e, t, r, -1) || Ci(n, e, t, r, 1));
5784
5784
  }, ka = /^(img|br|input|textarea|hr)$/i;
@@ -5851,7 +5851,7 @@ function _t(n) {
5851
5851
  ;
5852
5852
  return e && e.node && e.node.isBlock && (e.dom == n || e.contentDOM == n);
5853
5853
  }
5854
- const Rn = function(n) {
5854
+ const In = function(n) {
5855
5855
  return n.focusNode && st(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
5856
5856
  };
5857
5857
  function Je(n, e) {
@@ -5878,9 +5878,9 @@ function Ca(n, e, t) {
5878
5878
  return { node: r.startContainer, offset: Math.min(fe(r.startContainer), r.startOffset) };
5879
5879
  }
5880
5880
  }
5881
- const xe = typeof navigator < "u" ? navigator : null, Ti = typeof document < "u" ? document : null, je = xe && xe.userAgent || "", br = /Edge\/(\d+)/.exec(je), Zs = /MSIE \d/.exec(je), kr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(je), ie = !!(Zs || kr || br), $e = Zs ? document.documentMode : kr ? +kr[1] : br ? +br[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(je);
5881
+ const xe = typeof navigator < "u" ? navigator : null, Ti = typeof document < "u" ? document : null, je = xe && xe.userAgent || "", yr = /Edge\/(\d+)/.exec(je), Zs = /MSIE \d/.exec(je), br = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(je), ie = !!(Zs || br || yr), $e = Zs ? document.documentMode : br ? +br[1] : yr ? +yr[1] : 0, pe = !ie && /gecko\/(\d+)/i.test(je);
5882
5882
  pe && +(/Firefox\/(\d+)/.exec(je) || [0, 0])[1];
5883
- const xr = !ie && /Chrome\/(\d+)/.exec(je), U = !!xr, Qs = xr ? +xr[1] : 0, X = !ie && !!xe && /Apple Computer/.test(xe.vendor), xt = X && (/Mobile\/\w+/.test(je) || !!xe && xe.maxTouchPoints > 2), ue = xt || (xe ? /Mac/.test(xe.platform) : !1), eo = xe ? /Win/.test(xe.platform) : !1, Ee = /Android \d/.test(je), Gt = !!Ti && "webkitFontSmoothing" in Ti.documentElement.style, Ta = Gt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5883
+ const kr = !ie && /Chrome\/(\d+)/.exec(je), U = !!kr, Qs = kr ? +kr[1] : 0, X = !ie && !!xe && /Apple Computer/.test(xe.vendor), xt = X && (/Mobile\/\w+/.test(je) || !!xe && xe.maxTouchPoints > 2), ue = xt || (xe ? /Mac/.test(xe.platform) : !1), eo = xe ? /Win/.test(xe.platform) : !1, Ee = /Android \d/.test(je), Gt = !!Ti && "webkitFontSmoothing" in Ti.documentElement.style, Ta = Gt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5884
5884
  function Oa(n) {
5885
5885
  let e = n.defaultView && n.defaultView.visualViewport;
5886
5886
  return e ? {
@@ -6118,14 +6118,14 @@ function so(n, e, t) {
6118
6118
  if (s == null && i && (t < 0 || i == fe(r))) {
6119
6119
  let a = r.childNodes[i - 1];
6120
6120
  if (a.nodeType == 1)
6121
- return Xn(a.getBoundingClientRect(), !1);
6121
+ return Yn(a.getBoundingClientRect(), !1);
6122
6122
  }
6123
6123
  if (s == null && i < fe(r)) {
6124
6124
  let a = r.childNodes[i];
6125
6125
  if (a.nodeType == 1)
6126
- return Xn(a.getBoundingClientRect(), !0);
6126
+ return Yn(a.getBoundingClientRect(), !0);
6127
6127
  }
6128
- return Xn(r.getBoundingClientRect(), t >= 0);
6128
+ return Yn(r.getBoundingClientRect(), t >= 0);
6129
6129
  }
6130
6130
  if (s == null && i && (t < 0 || i == fe(r))) {
6131
6131
  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;
@@ -6148,7 +6148,7 @@ function wt(n, e) {
6148
6148
  let t = e ? n.left : n.right;
6149
6149
  return { top: n.top, bottom: n.bottom, left: t, right: t };
6150
6150
  }
6151
- function Xn(n, e) {
6151
+ function Yn(n, e) {
6152
6152
  if (n.height == 0)
6153
6153
  return n;
6154
6154
  let t = e ? n.top : n.bottom;
@@ -6645,7 +6645,7 @@ class ot extends Yt {
6645
6645
  }
6646
6646
  slice(e, t, r) {
6647
6647
  let i = ot.create(this.parent, this.mark, !0, r), s = this.children, o = this.size;
6648
- t < o && (s = Mr(s, t, o, r)), e > 0 && (s = Mr(s, 0, e, r));
6648
+ t < o && (s = Sr(s, t, o, r)), e > 0 && (s = Sr(s, 0, e, r));
6649
6649
  for (let l = 0; l < s.length; l++)
6650
6650
  s[l].parent = i;
6651
6651
  return i.children = s, i;
@@ -6685,7 +6685,7 @@ class Ve extends Yt {
6685
6685
  } else d || ({ dom: d, contentDOM: u } = ct.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6686
6686
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
6687
6687
  let f = d;
6688
- return d = fo(d, r, t), c ? a = new Wa(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Pn(e, t, r, i, d, f, s) : new Ve(e, t, r, i, d, u || null, f, s, o + 1);
6688
+ return d = fo(d, r, t), c ? a = new Wa(e, t, r, i, d, u || null, f, c, s, o + 1) : t.isText ? new Rn(e, t, r, i, d, f, s) : new Ve(e, t, r, i, d, u || null, f, s, o + 1);
6689
6689
  }
6690
6690
  parseRule() {
6691
6691
  if (this.node.type.spec.reparseInView)
@@ -6755,7 +6755,7 @@ class Ve extends Yt {
6755
6755
  s.pmViewDesc && (s.pmViewDesc = void 0);
6756
6756
  }
6757
6757
  let o = new Ha(this, s, t, i);
6758
- e.input.compositionNodes.push(o), this.children = Mr(this.children, r, r + i.length, e, o);
6758
+ e.input.compositionNodes.push(o), this.children = Sr(this.children, r, r + i.length, e, o);
6759
6759
  }
6760
6760
  // If this desc must be updated to match the given node decoration,
6761
6761
  // do so and return true.
@@ -6769,7 +6769,7 @@ class Ve extends Yt {
6769
6769
  if (mn(e, this.outerDeco))
6770
6770
  return;
6771
6771
  let t = this.nodeDOM.nodeType != 1, r = this.dom;
6772
- this.dom = uo(this.dom, this.nodeDOM, Sr(this.outerDeco, this.node, t), Sr(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
6772
+ this.dom = uo(this.dom, this.nodeDOM, xr(this.outerDeco, this.node, t), xr(e, this.node, t)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
6773
6773
  }
6774
6774
  // Mark this node as being the selected node.
6775
6775
  selectNode() {
@@ -6788,7 +6788,7 @@ function Ii(n, e, t, r, i) {
6788
6788
  let s = new Ve(void 0, n, e, t, r, r, r, i, 0);
6789
6789
  return s.contentDOM && s.updateChildren(i, 0), s;
6790
6790
  }
6791
- class Pn extends Ve {
6791
+ class Rn extends Ve {
6792
6792
  constructor(e, t, r, i, s, o, l) {
6793
6793
  super(e, t, r, i, s, null, o, l, 0);
6794
6794
  }
@@ -6819,7 +6819,7 @@ class Pn extends Ve {
6819
6819
  }
6820
6820
  slice(e, t, r) {
6821
6821
  let i = this.node.cut(e, t), s = document.createTextNode(i.text);
6822
- return new Pn(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
6822
+ return new Rn(this.parent, i, this.outerDeco, this.innerDeco, s, s, r);
6823
6823
  }
6824
6824
  markDirty(e, t) {
6825
6825
  super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Se);
@@ -6903,7 +6903,7 @@ const At = function(n) {
6903
6903
  };
6904
6904
  At.prototype = /* @__PURE__ */ Object.create(null);
6905
6905
  const Ge = [new At()];
6906
- function Sr(n, e, t) {
6906
+ function xr(n, e, t) {
6907
6907
  if (n.length == 0)
6908
6908
  return Ge;
6909
6909
  let r = t ? Ge[0] : new At(), i = [r];
@@ -6956,7 +6956,7 @@ function qa(n, e, t) {
6956
6956
  }
6957
6957
  }
6958
6958
  function fo(n, e, t) {
6959
- return uo(n, n, Ge, Sr(e, t, n.nodeType != 1));
6959
+ return uo(n, n, Ge, xr(e, t, n.nodeType != 1));
6960
6960
  }
6961
6961
  function mn(n, e) {
6962
6962
  if (n.length != e.length)
@@ -7105,7 +7105,7 @@ class ja {
7105
7105
  for (; e instanceof ot; )
7106
7106
  t = e, e = t.children[t.children.length - 1];
7107
7107
  (!e || // Empty textblock
7108
- !(e instanceof Pn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((X || U) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
7108
+ !(e instanceof Rn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((X || U) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
7109
7109
  }
7110
7110
  addHackNode(e, t) {
7111
7111
  if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
@@ -7229,7 +7229,7 @@ function Ga(n, e, t, r) {
7229
7229
  }
7230
7230
  return -1;
7231
7231
  }
7232
- function Mr(n, e, t, r, i) {
7232
+ function Sr(n, e, t, r, i) {
7233
7233
  let s = [];
7234
7234
  for (let o = 0, l = 0; o < n.length; o++) {
7235
7235
  let a = n[o], c = l, d = l += a.size;
@@ -7245,7 +7245,7 @@ function $r(n, e = null) {
7245
7245
  if (o < 0)
7246
7246
  return null;
7247
7247
  let l = r.resolve(o), a, c;
7248
- if (Rn(t)) {
7248
+ if (In(t)) {
7249
7249
  for (a = o; i && !i.node; )
7250
7250
  i = i.parent;
7251
7251
  let u = i.node;
@@ -7301,15 +7301,15 @@ const Pi = X || U && Qs < 63;
7301
7301
  function Bi(n, e) {
7302
7302
  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;
7303
7303
  if (X && i && i.contentEditable == "false")
7304
- return Zn(i);
7304
+ return Xn(i);
7305
7305
  if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
7306
7306
  if (i)
7307
- return Zn(i);
7307
+ return Xn(i);
7308
7308
  if (s)
7309
- return Zn(s);
7309
+ return Xn(s);
7310
7310
  }
7311
7311
  }
7312
- function Zn(n) {
7312
+ function Xn(n) {
7313
7313
  return n.contentEditable = "true", X && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
7314
7314
  }
7315
7315
  function Li(n) {
@@ -7362,7 +7362,7 @@ function Za(n) {
7362
7362
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
7363
7363
  return st(e.node, e.offset, t.anchorNode, t.anchorOffset);
7364
7364
  }
7365
- function wr(n, e) {
7365
+ function Mr(n, e) {
7366
7366
  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;
7367
7367
  return s && E.findFrom(s, e);
7368
7368
  }
@@ -7380,7 +7380,7 @@ function $i(n, e, t) {
7380
7380
  return De(n, new M(r.$anchor, o));
7381
7381
  } else if (r.empty) {
7382
7382
  if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
7383
- let i = wr(n.state, e);
7383
+ let i = Mr(n.state, e);
7384
7384
  return i && i instanceof S ? De(n, i) : !1;
7385
7385
  } else if (!(ue && t.indexOf("m") > -1)) {
7386
7386
  let i = r.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, o;
@@ -7394,7 +7394,7 @@ function $i(n, e, t) {
7394
7394
  if (r instanceof S && r.node.isInline)
7395
7395
  return De(n, new M(e > 0 ? r.$to : r.$from));
7396
7396
  {
7397
- let i = wr(n.state, e);
7397
+ let i = Mr(n.state, e);
7398
7398
  return i ? De(n, i) : !1;
7399
7399
  }
7400
7400
  }
@@ -7443,7 +7443,7 @@ function Qa(n) {
7443
7443
  }
7444
7444
  }
7445
7445
  }
7446
- o ? Cr(n, t, r) : i && Cr(n, i, s);
7446
+ o ? wr(n, t, r) : i && wr(n, i, s);
7447
7447
  }
7448
7448
  function ec(n) {
7449
7449
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
@@ -7475,7 +7475,7 @@ function ec(n) {
7475
7475
  }
7476
7476
  }
7477
7477
  }
7478
- s && Cr(n, s, o);
7478
+ s && wr(n, s, o);
7479
7479
  }
7480
7480
  function go(n) {
7481
7481
  let e = n.pmViewDesc;
@@ -7505,7 +7505,7 @@ function nc(n, e) {
7505
7505
  n = t, e = n.childNodes.length;
7506
7506
  }
7507
7507
  }
7508
- function Cr(n, e, t) {
7508
+ function wr(n, e, t) {
7509
7509
  if (e.nodeType != 3) {
7510
7510
  let s, o;
7511
7511
  (o = tc(e, t)) ? (e = o, t = 0) : (s = nc(e, t)) && (e = s, t = s.nodeValue.length);
@@ -7513,7 +7513,7 @@ function Cr(n, e, t) {
7513
7513
  let r = n.domSelection();
7514
7514
  if (!r)
7515
7515
  return;
7516
- if (Rn(r)) {
7516
+ if (In(r)) {
7517
7517
  let s = document.createRange();
7518
7518
  s.setEnd(e, t), s.setStart(e, t), r.removeAllRanges(), r.addRange(s);
7519
7519
  } else r.extend && r.extend(e, t);
@@ -7546,7 +7546,7 @@ function Hi(n, e, t) {
7546
7546
  return !1;
7547
7547
  let { $from: i, $to: s } = r;
7548
7548
  if (!i.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
7549
- let o = wr(n.state, e);
7549
+ let o = Mr(n.state, e);
7550
7550
  if (o && o instanceof S)
7551
7551
  return De(n, o);
7552
7552
  }
@@ -7743,12 +7743,12 @@ function xo(n, e) {
7743
7743
  let t = n.content.replaceChild(n.childCount - 1, xo(n.lastChild, e - 1)), r = n.contentMatchAt(n.childCount).fillBefore(b.empty, !0);
7744
7744
  return n.copy(t.append(r));
7745
7745
  }
7746
- function Tr(n, e, t, r, i, s) {
7746
+ function Cr(n, e, t, r, i, s) {
7747
7747
  let o = e < 0 ? n.firstChild : n.lastChild, l = o.content;
7748
- return n.childCount > 1 && (s = 0), i < r - 1 && (l = Tr(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));
7748
+ return n.childCount > 1 && (s = 0), i < r - 1 && (l = Cr(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));
7749
7749
  }
7750
7750
  function ji(n, e, t) {
7751
- return e < n.openStart && (n = new k(Tr(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Tr(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
7751
+ return e < n.openStart && (n = new k(Cr(n.content, -1, e, n.openStart, 0, n.openEnd), e, n.openEnd)), t < n.openEnd && (n = new k(Cr(n.content, 1, t, n.openEnd, 0, 0), n.openStart, t)), n;
7752
7752
  }
7753
7753
  const So = {
7754
7754
  thead: ["table"],
@@ -7765,10 +7765,10 @@ let Ki = null;
7765
7765
  function Mo() {
7766
7766
  return Ki || (Ki = document.implementation.createHTMLDocument("title"));
7767
7767
  }
7768
- let Qn = null;
7768
+ let Zn = null;
7769
7769
  function ac(n) {
7770
7770
  let e = window.trustedTypes;
7771
- return e ? (Qn || (Qn = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Qn.createHTML(n)) : n;
7771
+ return e ? (Zn || (Zn = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), Zn.createHTML(n)) : n;
7772
7772
  }
7773
7773
  function cc(n) {
7774
7774
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
@@ -7817,7 +7817,7 @@ function pc(n) {
7817
7817
  gc(n, r) && !Wr(n, r) && (n.editable || !(r.type in te)) && t(n, r);
7818
7818
  }, fc[e] ? { passive: !0 } : void 0);
7819
7819
  }
7820
- X && n.dom.addEventListener("input", () => null), Or(n);
7820
+ X && n.dom.addEventListener("input", () => null), Tr(n);
7821
7821
  }
7822
7822
  function Le(n, e) {
7823
7823
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
@@ -7828,7 +7828,7 @@ function mc(n) {
7828
7828
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
7829
7829
  clearTimeout(n.input.composingTimeout), clearTimeout(n.input.lastIOSEnterFallbackTimeout);
7830
7830
  }
7831
- function Or(n) {
7831
+ function Tr(n) {
7832
7832
  n.someProp("handleDOMEvents", (e) => {
7833
7833
  for (let t in e)
7834
7834
  n.input.eventHandlers[t] || n.dom.addEventListener(t, n.input.eventHandlers[t] = (r) => Wr(n, r));
@@ -7880,7 +7880,7 @@ te.keypress = (n, e) => {
7880
7880
  !/[\r\n]/.test(i) && !n.someProp("handleTextInput", (o) => o(n, r.$from.pos, r.$to.pos, i, s)) && n.dispatch(s()), t.preventDefault();
7881
7881
  }
7882
7882
  };
7883
- function Bn(n) {
7883
+ function Pn(n) {
7884
7884
  return { left: n.clientX, top: n.clientY };
7885
7885
  }
7886
7886
  function bc(n, e) {
@@ -7959,7 +7959,7 @@ ee.mousedown = (n, e) => {
7959
7959
  n.input.shiftKey = t.shiftKey;
7960
7960
  let r = jr(n), i = Date.now(), s = "singleClick";
7961
7961
  i - n.input.lastClick.time < 500 && bc(t, n.input.lastClick) && !t[wo] && 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 };
7962
- let o = n.posAtCoords(Bn(t));
7962
+ let o = n.posAtCoords(Pn(t));
7963
7963
  o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Tc(n, o, t, !!r)) : (s == "doubleClick" ? Mc : wc)(n, o.pos, o.inside, t) ? t.preventDefault() : Le(n, "pointer"));
7964
7964
  };
7965
7965
  class Tc {
@@ -7991,7 +7991,7 @@ class Tc {
7991
7991
  if (this.done(), !this.view.dom.contains(e.target))
7992
7992
  return;
7993
7993
  let t = this.pos;
7994
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Bn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Le(this.view, "pointer") : Sc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7994
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Pn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Le(this.view, "pointer") : Sc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7995
7995
  X && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
7996
7996
  // cursor, but still report that the node is selected
7997
7997
  // when asked through getSelection. You'll then get a
@@ -8162,7 +8162,7 @@ ee.dragstart = (n, e) => {
8162
8162
  let t = e, r = n.input.mouseDown;
8163
8163
  if (r && r.done(), !t.dataTransfer)
8164
8164
  return;
8165
- let i = n.state.selection, s = i.empty ? null : n.posAtCoords(Bn(t)), o;
8165
+ let i = n.state.selection, s = i.empty ? null : n.posAtCoords(Pn(t)), o;
8166
8166
  if (!(s && s.pos >= i.from && s.pos <= (i instanceof S ? i.to - 1 : i.to))) {
8167
8167
  if (r && r.mightDrag)
8168
8168
  o = S.create(n.state.doc, r.mightDrag.pos);
@@ -8191,7 +8191,7 @@ te.drop = (n, e) => {
8191
8191
  function Pc(n, e, t) {
8192
8192
  if (!e.dataTransfer)
8193
8193
  return;
8194
- let r = n.posAtCoords(Bn(e));
8194
+ let r = n.posAtCoords(Pn(e));
8195
8195
  if (!r)
8196
8196
  return;
8197
8197
  let i = n.state.doc.resolve(r.pos), s = t && t.slice;
@@ -8749,7 +8749,7 @@ function Ji(n, e, t) {
8749
8749
  e++;
8750
8750
  n.splice(e, 0, t);
8751
8751
  }
8752
- function er(n) {
8752
+ function Qn(n) {
8753
8753
  let e = [];
8754
8754
  return n.someProp("decorations", (t) => {
8755
8755
  let r = t(n.state);
@@ -8897,7 +8897,7 @@ class Vc {
8897
8897
  }
8898
8898
  }
8899
8899
  let c = null;
8900
- s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Rn(r) && (c = $r(e)) && c.eq(E.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, ve(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Hc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, jc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || ve(e), this.currentSelection.set(r));
8900
+ s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && In(r) && (c = $r(e)) && c.eq(E.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, ve(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Hc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, jc(e, a)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || ve(e), this.currentSelection.set(r));
8901
8901
  }
8902
8902
  registerMutation(e, t) {
8903
8903
  if (t.indexOf(e.target) > -1)
@@ -8987,7 +8987,7 @@ function jc(n, e) {
8987
8987
  }
8988
8988
  function Kc(n, e, t) {
8989
8989
  let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
8990
- if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Rn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), U && n.input.lastKeyCode === 8)
8990
+ if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], In(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), U && n.input.lastKeyCode === 8)
8991
8991
  for (let g = s; g > i; g--) {
8992
8992
  let y = r.childNodes[g - 1], T = y.pmViewDesc;
8993
8993
  if (y.nodeName == "BR" && !T) {
@@ -9130,7 +9130,7 @@ function Yc(n, e, t, r, i) {
9130
9130
  if (
9131
9131
  // The content must have shrunk
9132
9132
  t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
9133
- tr(r, !0, !1) < i.pos
9133
+ er(r, !0, !1) < i.pos
9134
9134
  )
9135
9135
  return !1;
9136
9136
  let s = n.resolve(e);
@@ -9140,10 +9140,10 @@ function Yc(n, e, t, r, i) {
9140
9140
  }
9141
9141
  if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
9142
9142
  return !1;
9143
- let o = n.resolve(tr(s, !0, !0));
9144
- return !o.parent.isTextblock || o.pos > t || tr(o, !0, !1) < t ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
9143
+ let o = n.resolve(er(s, !0, !0));
9144
+ return !o.parent.isTextblock || o.pos > t || er(o, !0, !1) < t ? !1 : r.parent.content.cut(r.parentOffset).eq(o.parent.content);
9145
9145
  }
9146
- function tr(n, e, t) {
9146
+ function er(n, e, t) {
9147
9147
  let r = n.depth, i = e ? n.end() : n.pos;
9148
9148
  for (; r > 0 && (e || n.indexAfter(r) == n.node(r).childCount); )
9149
9149
  r--, i++, e = !1;
@@ -9187,7 +9187,7 @@ class Ro {
9187
9187
  added to the document.
9188
9188
  */
9189
9189
  constructor(e, t) {
9190
- 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 hc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ns), 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 = es(this), Qi(this), this.nodeViews = ts(this), this.docView = Ii(this.state.doc, Zi(this), er(this), this.dom, this), this.domObserver = new Vc(this, (r, i, s, o) => _c(this, r, i, s, o)), this.domObserver.start(), pc(this), this.updatePluginViews();
9190
+ 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 hc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(ns), 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 = es(this), Qi(this), this.nodeViews = ts(this), this.docView = Ii(this.state.doc, Zi(this), Qn(this), this.dom, this), this.domObserver = new Vc(this, (r, i, s, o) => _c(this, r, i, s, o)), this.domObserver.start(), pc(this), this.updatePluginViews();
9191
9191
  }
9192
9192
  /**
9193
9193
  Holds `true` when a
@@ -9215,7 +9215,7 @@ class Ro {
9215
9215
  the DOM.
9216
9216
  */
9217
9217
  update(e) {
9218
- e.handleDOMEvents != this._props.handleDOMEvents && Or(this);
9218
+ e.handleDOMEvents != this._props.handleDOMEvents && Tr(this);
9219
9219
  let t = this._props;
9220
9220
  this._props = e, e.plugins && (e.plugins.forEach(ns), this.directPlugins = e.plugins), this.updateStateInner(e.state, t);
9221
9221
  }
@@ -9249,8 +9249,8 @@ class Ro {
9249
9249
  let h = ts(this);
9250
9250
  Qc(h, this.nodeViews) && (this.nodeViews = h, s = !0);
9251
9251
  }
9252
- (l || t.handleDOMEvents != this._props.handleDOMEvents) && Or(this), this.editable = es(this), Qi(this);
9253
- let a = er(this), c = Zi(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);
9252
+ (l || t.handleDOMEvents != this._props.handleDOMEvents) && Tr(this), this.editable = es(this), Qi(this);
9253
+ let a = Qn(this), c = Zi(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);
9254
9254
  (u || !e.selection.eq(i.selection)) && (o = !0);
9255
9255
  let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Na(this);
9256
9256
  if (o) {
@@ -9480,7 +9480,7 @@ class Ro {
9480
9480
  views](https://prosemirror.net/docs/ref/#view.NodeView).
9481
9481
  */
9482
9482
  destroy() {
9483
- this.docView && (mc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], er(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, ba());
9483
+ this.docView && (mc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], Qn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, ba());
9484
9484
  }
9485
9485
  /**
9486
9486
  This is true when the view has been
@@ -9642,7 +9642,7 @@ for (var J = 0; J < 10; J++) We[48 + J] = We[96 + J] = String(J);
9642
9642
  for (var J = 1; J <= 24; J++) We[J + 111] = "F" + J;
9643
9643
  for (var J = 65; J <= 90; J++)
9644
9644
  We[J] = String.fromCharCode(J + 32), xn[J] = String.fromCharCode(J);
9645
- for (var nr in We) xn.hasOwnProperty(nr) || (xn[nr] = We[nr]);
9645
+ for (var tr in We) xn.hasOwnProperty(tr) || (xn[tr] = We[tr]);
9646
9646
  function nd(n) {
9647
9647
  var e = ed && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || td && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? xn : We)[n.keyCode] || n.key || "Unidentified";
9648
9648
  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;
@@ -9675,7 +9675,7 @@ function od(n) {
9675
9675
  e[sd(t)] = n[t];
9676
9676
  return e;
9677
9677
  }
9678
- function rr(n, e, t = !0) {
9678
+ function nr(n, e, t = !0) {
9679
9679
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
9680
9680
  }
9681
9681
  function ld(n) {
@@ -9684,18 +9684,18 @@ function ld(n) {
9684
9684
  function Po(n) {
9685
9685
  let e = od(n);
9686
9686
  return function(t, r) {
9687
- let i = nd(r), s, o = e[rr(i, r)];
9687
+ let i = nd(r), s, o = e[nr(i, r)];
9688
9688
  if (o && o(t.state, t.dispatch, t))
9689
9689
  return !0;
9690
9690
  if (i.length == 1 && i != " ") {
9691
9691
  if (r.shiftKey) {
9692
- let l = e[rr(i, r, !1)];
9692
+ let l = e[nr(i, r, !1)];
9693
9693
  if (l && l(t.state, t.dispatch, t))
9694
9694
  return !0;
9695
9695
  }
9696
9696
  if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
9697
9697
  !(id && r.ctrlKey && r.altKey) && (s = We[r.keyCode]) && s != i) {
9698
- let l = e[rr(s, r)];
9698
+ let l = e[nr(s, r)];
9699
9699
  if (l && l(t.state, t.dispatch, t))
9700
9700
  return !0;
9701
9701
  }
@@ -9722,7 +9722,7 @@ const Lo = (n, e, t) => {
9722
9722
  return !0;
9723
9723
  if (r.parent.content.size == 0 && (St(s, "end") || S.isSelectable(s)))
9724
9724
  for (let o = r.depth; ; o--) {
9725
- let l = Dn(n.doc, r.before(o), r.after(o), k.empty);
9725
+ let l = An(n.doc, r.before(o), r.after(o), k.empty);
9726
9726
  if (l && l.slice.size < l.to - l.from) {
9727
9727
  if (e) {
9728
9728
  let a = n.tr.step(l);
@@ -9766,7 +9766,7 @@ function zo(n, e, t) {
9766
9766
  return !1;
9767
9767
  l = d;
9768
9768
  }
9769
- let c = Dn(n.doc, s, a, k.empty);
9769
+ let c = An(n.doc, s, a, k.empty);
9770
9770
  if (!c || c.from != s || c instanceof P && c.slice.size >= a - s)
9771
9771
  return !1;
9772
9772
  if (t) {
@@ -9821,7 +9821,7 @@ const Vo = (n, e, t) => {
9821
9821
  if (Ko(n, i, e, 1))
9822
9822
  return !0;
9823
9823
  if (r.parent.content.size == 0 && (St(s, "start") || S.isSelectable(s))) {
9824
- let o = Dn(n.doc, r.before(), r.after(), k.empty);
9824
+ let o = An(n.doc, r.before(), r.after(), k.empty);
9825
9825
  if (o && o.slice.size < o.to - o.from) {
9826
9826
  if (e) {
9827
9827
  let l = n.tr.step(o);
@@ -9860,7 +9860,7 @@ const dd = (n, e) => {
9860
9860
  if (t.node.isTextblock || !qe(n.doc, t.from))
9861
9861
  return !1;
9862
9862
  i = t.from;
9863
- } else if (i = An(n.doc, t.from, -1), i == null)
9863
+ } else if (i = vn(n.doc, t.from, -1), i == null)
9864
9864
  return !1;
9865
9865
  if (e) {
9866
9866
  let s = n.tr.join(i);
@@ -9873,7 +9873,7 @@ const dd = (n, e) => {
9873
9873
  if (t.node.isTextblock || !qe(n.doc, t.to))
9874
9874
  return !1;
9875
9875
  r = t.to;
9876
- } else if (r = An(n.doc, t.to, 1), r == null)
9876
+ } else if (r = vn(n.doc, t.to, 1), r == null)
9877
9877
  return !1;
9878
9878
  return e && e(n.tr.join(r).scrollIntoView()), !0;
9879
9879
  }, fd = (n, e) => {
@@ -10144,7 +10144,7 @@ function Ed(n) {
10144
10144
  return !0;
10145
10145
  };
10146
10146
  }
10147
- function Ln(n) {
10147
+ function Bn(n) {
10148
10148
  const { state: e, transaction: t } = n;
10149
10149
  let { selection: r } = t, { doc: i } = t, { storedMarks: s } = t;
10150
10150
  return {
@@ -10169,7 +10169,7 @@ function Ln(n) {
10169
10169
  }
10170
10170
  };
10171
10171
  }
10172
- class zn {
10172
+ class Ln {
10173
10173
  constructor(e) {
10174
10174
  this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
10175
10175
  }
@@ -10214,7 +10214,7 @@ class zn {
10214
10214
  tr: e,
10215
10215
  editor: i,
10216
10216
  view: o,
10217
- state: Ln({
10217
+ state: Bn({
10218
10218
  state: s,
10219
10219
  transaction: e
10220
10220
  }),
@@ -10260,7 +10260,7 @@ function x(n, e, t) {
10260
10260
  parent: n.parent ? x(n.parent, e, t) : null
10261
10261
  }) : n.config[e];
10262
10262
  }
10263
- function Fn(n) {
10263
+ function zn(n) {
10264
10264
  const e = n.filter((i) => i.type === "extension"), t = n.filter((i) => i.type === "node"), r = n.filter((i) => i.type === "mark");
10265
10265
  return {
10266
10266
  baseExtensions: e,
@@ -10269,7 +10269,7 @@ function Fn(n) {
10269
10269
  };
10270
10270
  }
10271
10271
  function Uo(n) {
10272
- const e = [], { nodeExtensions: t, markExtensions: r } = Fn(n), i = [...t, ...r], s = {
10272
+ const e = [], { nodeExtensions: t, markExtensions: r } = zn(n), i = [...t, ...r], s = {
10273
10273
  default: null,
10274
10274
  rendered: !0,
10275
10275
  renderHTML: null,
@@ -10355,7 +10355,7 @@ function H(...n) {
10355
10355
  }), r;
10356
10356
  }, {});
10357
10357
  }
10358
- function Er(n, e) {
10358
+ function Or(n, e) {
10359
10359
  return e.filter((t) => t.type === n.type.name).filter((t) => t.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(n.attrs) || {} : {
10360
10360
  [t.name]: n.attrs[t.name]
10361
10361
  }).reduce((t, r) => H(t, r), {});
@@ -10398,7 +10398,7 @@ function ss(n) {
10398
10398
  }
10399
10399
  function Dd(n, e) {
10400
10400
  var t;
10401
- const r = Uo(n), { nodeExtensions: i, markExtensions: s } = Fn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
10401
+ const r = Uo(n), { nodeExtensions: i, markExtensions: s } = zn(n), o = (t = i.find((c) => x(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
10402
10402
  const d = r.filter((y) => y.type === c.name), u = {
10403
10403
  name: c.name,
10404
10404
  options: c.options,
@@ -10433,7 +10433,7 @@ function Dd(n, e) {
10433
10433
  const m = x(c, "renderHTML", u);
10434
10434
  m && (h.toDOM = (y) => m({
10435
10435
  node: y,
10436
- HTMLAttributes: Er(y, d)
10436
+ HTMLAttributes: Or(y, d)
10437
10437
  }));
10438
10438
  const g = x(c, "renderText", u);
10439
10439
  return g && (h.toText = g), [c.name, h];
@@ -10465,7 +10465,7 @@ function Dd(n, e) {
10465
10465
  const m = x(c, "renderHTML", u);
10466
10466
  return m && (h.toDOM = (g) => m({
10467
10467
  mark: g,
10468
- HTMLAttributes: Er(g, d)
10468
+ HTMLAttributes: Or(g, d)
10469
10469
  })), [c.name, h];
10470
10470
  }));
10471
10471
  return new Ps({
@@ -10474,7 +10474,7 @@ function Dd(n, e) {
10474
10474
  marks: a
10475
10475
  });
10476
10476
  }
10477
- function ir(n, e) {
10477
+ function rr(n, e) {
10478
10478
  return e.nodes[n] || e.marks[n] || null;
10479
10479
  }
10480
10480
  function ls(n, e) {
@@ -10501,7 +10501,7 @@ const Id = (n, e = 500) => {
10501
10501
  function Qr(n) {
10502
10502
  return Object.prototype.toString.call(n) === "[object RegExp]";
10503
10503
  }
10504
- class $n {
10504
+ class Fn {
10505
10505
  constructor(e) {
10506
10506
  this.find = e.find, this.handler = e.handler;
10507
10507
  }
@@ -10534,13 +10534,13 @@ function en(n) {
10534
10534
  const h = Rd(u, f.find);
10535
10535
  if (!h)
10536
10536
  return;
10537
- const p = a.state.tr, m = Ln({
10537
+ const p = a.state.tr, m = Bn({
10538
10538
  state: a.state,
10539
10539
  transaction: p
10540
10540
  }), g = {
10541
10541
  from: r - (h[0].length - s.length),
10542
10542
  to: i
10543
- }, { commands: y, chain: T, can: w } = new zn({
10543
+ }, { commands: y, chain: T, can: w } = new Ln({
10544
10544
  editor: t,
10545
10545
  state: m
10546
10546
  });
@@ -10637,10 +10637,10 @@ function Bd(n) {
10637
10637
  function tn(n) {
10638
10638
  return Bd(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
10639
10639
  }
10640
- function Vn(n, e) {
10640
+ function $n(n, e) {
10641
10641
  const t = { ...n };
10642
10642
  return tn(n) && tn(e) && Object.keys(e).forEach((r) => {
10643
- tn(e[r]) && tn(n[r]) ? t[r] = Vn(n[r], e[r]) : t[r] = e[r];
10643
+ tn(e[r]) && tn(n[r]) ? t[r] = $n(n[r], e[r]) : t[r] = e[r];
10644
10644
  }), t;
10645
10645
  }
10646
10646
  class Me {
@@ -10664,7 +10664,7 @@ class Me {
10664
10664
  configure(e = {}) {
10665
10665
  const t = this.extend({
10666
10666
  ...this.config,
10667
- addOptions: () => Vn(this.options, e)
10667
+ addOptions: () => $n(this.options, e)
10668
10668
  });
10669
10669
  return t.name = this.name, t.parent = this.parent, t;
10670
10670
  }
@@ -10707,7 +10707,7 @@ const Fd = (n, e, t) => {
10707
10707
  }) : [];
10708
10708
  };
10709
10709
  function $d(n) {
10710
- const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new zn({
10710
+ const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new Ln({
10711
10711
  editor: e,
10712
10712
  state: t
10713
10713
  }), u = [];
@@ -10752,7 +10752,7 @@ function Hd(n) {
10752
10752
  l = null;
10753
10753
  }
10754
10754
  const a = ({ state: d, from: u, to: f, rule: h, pasteEvt: p }) => {
10755
- const m = d.tr, g = Ln({
10755
+ const m = d.tr, g = Bn({
10756
10756
  state: d,
10757
10757
  transaction: m
10758
10758
  });
@@ -10890,7 +10890,7 @@ class mt {
10890
10890
  options: t.options,
10891
10891
  storage: t.storage,
10892
10892
  editor: this.editor,
10893
- type: ir(t.name, this.schema)
10893
+ type: rr(t.name, this.schema)
10894
10894
  }, i = x(t, "addCommands", r);
10895
10895
  return i ? {
10896
10896
  ...e,
@@ -10909,7 +10909,7 @@ class mt {
10909
10909
  options: o.options,
10910
10910
  storage: o.storage,
10911
10911
  editor: e,
10912
- type: ir(o.name, this.schema)
10912
+ type: rr(o.name, this.schema)
10913
10913
  }, a = [], c = x(o, "addKeyboardShortcuts", l);
10914
10914
  let d = {};
10915
10915
  if (o.type === "mark" && x(o, "exitable", l) && (d.ArrowRight = () => Me.handleExit({ editor: e, mark: o })), c) {
@@ -10953,7 +10953,7 @@ class mt {
10953
10953
  * @returns An object with all node views where the key is the node name and the value is the node view function
10954
10954
  */
10955
10955
  get nodeViews() {
10956
- const { editor: e } = this, { nodeExtensions: t } = Fn(this.extensions);
10956
+ const { editor: e } = this, { nodeExtensions: t } = zn(this.extensions);
10957
10957
  return Object.fromEntries(t.filter((r) => !!x(r, "addNodeView")).map((r) => {
10958
10958
  const i = this.attributes.filter((a) => a.type === r.name), s = {
10959
10959
  name: r.name,
@@ -10965,7 +10965,7 @@ class mt {
10965
10965
  if (!o)
10966
10966
  return [];
10967
10967
  const l = (a, c, d, u, f) => {
10968
- const h = Er(a, i);
10968
+ const h = Or(a, i);
10969
10969
  return o()({
10970
10970
  // pass-through
10971
10971
  node: a,
@@ -10995,7 +10995,7 @@ class mt {
10995
10995
  options: e.options,
10996
10996
  storage: e.storage,
10997
10997
  editor: this.editor,
10998
- type: ir(e.name, this.schema)
10998
+ type: rr(e.name, this.schema)
10999
10999
  };
11000
11000
  e.type === "mark" && (!((t = N(x(e, "keepOnSplit", r))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
11001
11001
  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);
@@ -11024,7 +11024,7 @@ class _ {
11024
11024
  configure(e = {}) {
11025
11025
  const t = this.extend({
11026
11026
  ...this.config,
11027
- addOptions: () => Vn(this.options, e)
11027
+ addOptions: () => $n(this.options, e)
11028
11028
  });
11029
11029
  return t.name = this.name, t.parent = this.parent, t;
11030
11030
  }
@@ -11382,14 +11382,14 @@ const cu = (n) => !("type" in n), du = (n, e, t) => ({ tr: r, dispatch: i, edito
11382
11382
  return !0;
11383
11383
  }, uu = () => ({ state: n, dispatch: e }) => dd(n, e), fu = () => ({ state: n, dispatch: e }) => ud(n, e), hu = () => ({ state: n, dispatch: e }) => Lo(n, e), pu = () => ({ state: n, dispatch: e }) => Vo(n, e), mu = () => ({ state: n, dispatch: e, tr: t }) => {
11384
11384
  try {
11385
- const r = An(n.doc, n.selection.$from.pos, -1);
11385
+ const r = vn(n.doc, n.selection.$from.pos, -1);
11386
11386
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11387
11387
  } catch {
11388
11388
  return !1;
11389
11389
  }
11390
11390
  }, gu = () => ({ state: n, dispatch: e, tr: t }) => {
11391
11391
  try {
11392
- const r = An(n.doc, n.selection.$from.pos, 1);
11392
+ const r = vn(n.doc, n.selection.$from.pos, 1);
11393
11393
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11394
11394
  } catch {
11395
11395
  return !1;
@@ -11459,7 +11459,7 @@ const Su = (n, e = {}) => ({ state: t, dispatch: r }) => {
11459
11459
  const r = V(n, e.schema);
11460
11460
  return Cd(r)(e, t);
11461
11461
  }, Cu = () => ({ state: n, dispatch: e }) => Wo(n, e);
11462
- function Hn(n, e) {
11462
+ function Vn(n, e) {
11463
11463
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
11464
11464
  }
11465
11465
  function ds(n, e) {
@@ -11468,7 +11468,7 @@ function ds(n, e) {
11468
11468
  }
11469
11469
  const Tu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11470
11470
  let s = null, o = null;
11471
- const l = Hn(typeof n == "string" ? n : n.name, r.schema);
11471
+ const l = Vn(typeof n == "string" ? n : n.name, r.schema);
11472
11472
  return l ? (l === "node" && (s = V(n, r.schema)), l === "mark" && (o = Ke(n, r.schema)), i && t.selection.ranges.forEach((a) => {
11473
11473
  r.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, d) => {
11474
11474
  s && s === c.type && t.setNodeMarkup(d, void 0, ds(c.attrs, e)), o && c.marks.length && c.marks.forEach((u) => {
@@ -11483,7 +11483,7 @@ const Tu = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11483
11483
  }
11484
11484
  return !0;
11485
11485
  }, Nu = () => ({ state: n, dispatch: e }) => Fo(n, e), vu = () => ({ state: n, dispatch: e }) => Ho(n, e), Au = () => ({ state: n, dispatch: e }) => gd(n, e), Du = () => ({ state: n, dispatch: e }) => kd(n, e), Iu = () => ({ state: n, dispatch: e }) => bd(n, e);
11486
- function Nr(n, e, t = {}, r = {}) {
11486
+ function Er(n, e, t = {}, r = {}) {
11487
11487
  return $t(n, e, {
11488
11488
  slice: !1,
11489
11489
  parseOptions: t,
@@ -11494,7 +11494,7 @@ const Ru = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, comm
11494
11494
  var a, c;
11495
11495
  const { doc: d } = s;
11496
11496
  if (t.preserveWhitespace !== "full") {
11497
- const u = Nr(n, i.schema, t, {
11497
+ const u = Er(n, i.schema, t, {
11498
11498
  errorOnInvalidContent: (a = r.errorOnInvalidContent) !== null && a !== void 0 ? a : i.options.enableContentCheck
11499
11499
  });
11500
11500
  return o && s.replaceWith(0, d.content.size, u).setMeta("preventUpdate", !e), !0;
@@ -11551,7 +11551,7 @@ function zu(n, e) {
11551
11551
  return o ? { ...o.attrs } : {};
11552
11552
  }
11553
11553
  function Fu(n, e) {
11554
- const t = Hn(typeof e == "string" ? e : e.name, n.schema);
11554
+ const t = Vn(typeof e == "string" ? e : e.name, n.schema);
11555
11555
  return t === "node" ? zu(n, e) : t === "mark" ? nl(n, e) : {};
11556
11556
  }
11557
11557
  function rl(n, e, t) {
@@ -11576,7 +11576,7 @@ function an(n, e, t) {
11576
11576
  return i ? i.attribute.keepOnSplit : !1;
11577
11577
  }));
11578
11578
  }
11579
- function vr(n, e, t = {}) {
11579
+ function Nr(n, e, t = {}) {
11580
11580
  const { empty: r, ranges: i } = n.selection, s = e ? Ke(e, n.schema) : null;
11581
11581
  if (r)
11582
11582
  return !!(n.storedMarks || n.selection.$from.marks()).filter((u) => s ? s.name === u.type.name : !0).find((u) => Sn(u.attrs, t, { strict: !1 }));
@@ -11601,12 +11601,12 @@ function vr(n, e, t = {}) {
11601
11601
  }
11602
11602
  function $u(n, e, t = {}) {
11603
11603
  if (!e)
11604
- return Vt(n, null, t) || vr(n, null, t);
11605
- const r = Hn(e, n.schema);
11606
- return r === "node" ? Vt(n, e, t) : r === "mark" ? vr(n, e, t) : !1;
11604
+ return Vt(n, null, t) || Nr(n, null, t);
11605
+ const r = Vn(e, n.schema);
11606
+ return r === "node" ? Vt(n, e, t) : r === "mark" ? Nr(n, e, t) : !1;
11607
11607
  }
11608
11608
  function us(n, e) {
11609
- const { nodeExtensions: t } = Fn(e), r = t.find((o) => o.name === n);
11609
+ const { nodeExtensions: t } = zn(e), r = t.find((o) => o.name === n);
11610
11610
  if (!r)
11611
11611
  return !1;
11612
11612
  const i = {
@@ -11794,7 +11794,7 @@ const _u = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11794
11794
  t.ensureMarks(D);
11795
11795
  }
11796
11796
  return !0;
11797
- }, sr = (n, e) => {
11797
+ }, ir = (n, e) => {
11798
11798
  const t = ti((o) => o.type === e)(n.selection);
11799
11799
  if (!t)
11800
11800
  return !0;
@@ -11803,7 +11803,7 @@ const _u = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11803
11803
  return !0;
11804
11804
  const i = n.doc.nodeAt(r);
11805
11805
  return t.node.type === (i == null ? void 0 : i.type) && qe(n.doc, t.pos) && n.join(t.pos), !0;
11806
- }, or = (n, e) => {
11806
+ }, sr = (n, e) => {
11807
11807
  const t = ti((o) => o.type === e)(n.selection);
11808
11808
  if (!t)
11809
11809
  return !0;
@@ -11821,15 +11821,15 @@ const _u = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11821
11821
  if (D.node.type === h)
11822
11822
  return c.liftListItem(p);
11823
11823
  if (us(D.node.type.name, u) && h.validContent(D.node.content) && l)
11824
- return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => sr(s, h)).command(() => or(s, h)).run();
11824
+ return a().command(() => (s.setNodeMarkup(D.pos, h), !0)).command(() => ir(s, h)).command(() => sr(s, h)).run();
11825
11825
  }
11826
- return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => sr(s, h)).command(() => or(s, h)).run() : a().command(() => {
11826
+ return !t || !I || !l ? a().command(() => d().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => ir(s, h)).command(() => sr(s, h)).run() : a().command(() => {
11827
11827
  const L = d().wrapInList(h, r), C = I.filter((v) => f.includes(v.type.name));
11828
11828
  return s.ensureMarks(C), L ? !0 : c.clearNodes();
11829
- }).wrapInList(h, r).command(() => sr(s, h)).command(() => or(s, h)).run();
11829
+ }).wrapInList(h, r).command(() => ir(s, h)).command(() => sr(s, h)).run();
11830
11830
  }, Xu = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
11831
11831
  const { extendEmptyMarkRange: s = !1 } = t, o = Ke(n, r.schema);
11832
- return vr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11832
+ return Nr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11833
11833
  }, Zu = (n, e, t = {}) => ({ state: r, commands: i }) => {
11834
11834
  const s = V(n, r.schema), o = V(e, r.schema), l = Vt(r, s, t);
11835
11835
  let a;
@@ -11878,7 +11878,7 @@ const _u = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11878
11878
  return t.removeStoredMark(a), !0;
11879
11879
  }, rf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11880
11880
  let s = null, o = null;
11881
- const l = Hn(typeof n == "string" ? n : n.name, r.schema);
11881
+ const l = Vn(typeof n == "string" ? n : n.name, r.schema);
11882
11882
  return l ? (l === "node" && (s = V(n, r.schema)), l === "mark" && (o = Ke(n, r.schema)), i && t.selection.ranges.forEach((a) => {
11883
11883
  const c = a.$from.pos, d = a.$to.pos;
11884
11884
  let u, f, h, p;
@@ -12102,10 +12102,10 @@ const af = _.create({
12102
12102
  const { empty: s, from: o, to: l } = e.selection, a = E.atStart(e.doc).from, c = E.atEnd(e.doc).to;
12103
12103
  if (s || !(o === a && l === c) || !ni(t.doc))
12104
12104
  return;
12105
- const f = t.tr, h = Ln({
12105
+ const f = t.tr, h = Bn({
12106
12106
  state: t,
12107
12107
  transaction: f
12108
- }), { commands: p } = new zn({
12108
+ }), { commands: p } = new Ln({
12109
12109
  editor: this.editor,
12110
12110
  state: h
12111
12111
  });
@@ -12503,7 +12503,7 @@ class bf extends Nd {
12503
12503
  * Creates an command manager.
12504
12504
  */
12505
12505
  createCommandManager() {
12506
- this.commandManager = new zn({
12506
+ this.commandManager = new Ln({
12507
12507
  editor: this
12508
12508
  });
12509
12509
  }
@@ -12520,7 +12520,7 @@ class bf extends Nd {
12520
12520
  var e;
12521
12521
  let t;
12522
12522
  try {
12523
- t = Nr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
12523
+ t = Er(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
12524
12524
  } catch (o) {
12525
12525
  if (!(o instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(o.message))
12526
12526
  throw o;
@@ -12530,7 +12530,7 @@ class bf extends Nd {
12530
12530
  disableCollaboration: () => {
12531
12531
  this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((l) => l.name !== "collaboration"), this.createExtensionManager();
12532
12532
  }
12533
- }), t = Nr(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
12533
+ }), t = Er(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
12534
12534
  }
12535
12535
  const r = Qo(t, this.options.autofocus);
12536
12536
  this.view = new Ro(this.options.element, {
@@ -12702,7 +12702,7 @@ class bf extends Nd {
12702
12702
  }
12703
12703
  }
12704
12704
  function lt(n) {
12705
- return new $n({
12705
+ return new Fn({
12706
12706
  find: n.find,
12707
12707
  handler: ({ state: e, range: t, match: r }) => {
12708
12708
  const i = N(n.getAttributes, void 0, r);
@@ -12721,7 +12721,7 @@ function lt(n) {
12721
12721
  });
12722
12722
  }
12723
12723
  function il(n) {
12724
- return new $n({
12724
+ return new Fn({
12725
12725
  find: n.find,
12726
12726
  handler: ({ state: e, range: t, match: r }) => {
12727
12727
  const i = N(n.getAttributes, void 0, r) || {}, { tr: s } = e, o = t.from;
@@ -12741,8 +12741,8 @@ function il(n) {
12741
12741
  }
12742
12742
  });
12743
12743
  }
12744
- function Ar(n) {
12745
- return new $n({
12744
+ function vr(n) {
12745
+ return new Fn({
12746
12746
  find: n.find,
12747
12747
  handler: ({ state: e, range: t, match: r }) => {
12748
12748
  const i = e.doc.resolve(t.from), s = N(n.getAttributes, void 0, r) || {};
@@ -12753,7 +12753,7 @@ function Ar(n) {
12753
12753
  });
12754
12754
  }
12755
12755
  function Ht(n) {
12756
- return new $n({
12756
+ return new Fn({
12757
12757
  find: n.find,
12758
12758
  handler: ({ state: e, range: t, match: r, chain: i }) => {
12759
12759
  const s = N(n.getAttributes, void 0, r) || {}, o = e.tr.delete(t.from, t.to), a = o.doc.resolve(t.from).blockRange(), c = a && Lr(a, n.type, s);
@@ -12796,7 +12796,7 @@ class ne {
12796
12796
  configure(e = {}) {
12797
12797
  const t = this.extend({
12798
12798
  ...this.config,
12799
- addOptions: () => Vn(this.options, e)
12799
+ addOptions: () => $n(this.options, e)
12800
12800
  });
12801
12801
  return t.name = this.name, t.parent = this.parent, t;
12802
12802
  }
@@ -13131,14 +13131,14 @@ const xf = /^\s*>\s$/, Sf = ne.create({
13131
13131
  },
13132
13132
  addInputRules() {
13133
13133
  return [
13134
- Ar({
13134
+ vr({
13135
13135
  find: If,
13136
13136
  type: this.type,
13137
13137
  getAttributes: (n) => ({
13138
13138
  language: n[1]
13139
13139
  })
13140
13140
  }),
13141
- Ar({
13141
+ vr({
13142
13142
  find: Rf,
13143
13143
  type: this.type,
13144
13144
  getAttributes: (n) => ({
@@ -13574,7 +13574,7 @@ const Jf = _.create({
13574
13574
  }), {});
13575
13575
  },
13576
13576
  addInputRules() {
13577
- return this.options.levels.map((n) => Ar({
13577
+ return this.options.levels.map((n) => vr({
13578
13578
  find: new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),
13579
13579
  type: this.type,
13580
13580
  getAttributes: {
@@ -13830,9 +13830,9 @@ function Qf(n, e, t, r) {
13830
13830
  if (o && o.getMeta(nt))
13831
13831
  return o.getMeta(nt).redo ? new Ie(n.done.addTransform(t, void 0, r, cn(e)), n.undone, ms(t.mapping.maps), n.prevTime, n.prevComposition) : new Ie(n.done, n.undone.addTransform(t, void 0, r, cn(e)), null, n.prevTime, n.prevComposition);
13832
13832
  if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
13833
- let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !eh(t, n.prevRanges)), c = o ? lr(n.prevRanges, t.mapping) : ms(t.mapping.maps);
13833
+ let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !eh(t, n.prevRanges)), c = o ? or(n.prevRanges, t.mapping) : ms(t.mapping.maps);
13834
13834
  return new Ie(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, cn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
13835
- } else return (s = t.getMeta("rebased")) ? new Ie(n.done.rebased(t, s), n.undone.rebased(t, s), lr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Ie(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), lr(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
13835
+ } else return (s = t.getMeta("rebased")) ? new Ie(n.done.rebased(t, s), n.undone.rebased(t, s), or(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new Ie(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), or(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
13836
13836
  }
13837
13837
  function eh(n, e) {
13838
13838
  if (!e)
@@ -13851,7 +13851,7 @@ function ms(n) {
13851
13851
  n[t].forEach((r, i, s, o) => e.push(s, o));
13852
13852
  return e;
13853
13853
  }
13854
- function lr(n, e) {
13854
+ function or(n, e) {
13855
13855
  if (!n)
13856
13856
  return null;
13857
13857
  let t = [];
@@ -13868,18 +13868,18 @@ function th(n, e, t) {
13868
13868
  let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new Ie(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
13869
13869
  return s.transform.setSelection(o).setMeta(nt, { redo: t, historyState: a });
13870
13870
  }
13871
- let ar = !1, gs = null;
13871
+ let lr = !1, gs = null;
13872
13872
  function cn(n) {
13873
13873
  let e = n.plugins;
13874
13874
  if (gs != e) {
13875
- ar = !1, gs = e;
13875
+ lr = !1, gs = e;
13876
13876
  for (let t = 0; t < e.length; t++)
13877
13877
  if (e[t].spec.historyPreserveItems) {
13878
- ar = !0;
13878
+ lr = !0;
13879
13879
  break;
13880
13880
  }
13881
13881
  }
13882
- return ar;
13882
+ return lr;
13883
13883
  }
13884
13884
  const nt = new we("history"), nh = new we("closeHistory");
13885
13885
  function rh(n = {}) {
@@ -14484,7 +14484,7 @@ const al = ll(!1, !0), cl = ll(!0, !0), ih = _.create({
14484
14484
  ];
14485
14485
  }
14486
14486
  });
14487
- var re, Jt, Ut, de, Dr, dl, ul, fl, hl;
14487
+ var re, Jt, Ut, de, Ar, dl, ul, fl, hl;
14488
14488
  class vh extends Sl {
14489
14489
  constructor() {
14490
14490
  super();
@@ -14494,7 +14494,7 @@ class vh extends Sl {
14494
14494
  W(this, Ut, null);
14495
14495
  }
14496
14496
  connectedCallback() {
14497
- super.connectedCallback() && (Q(this, de, dl).call(this), Q(this, de, ul).call(this), Q(this, de, Dr).call(this));
14497
+ super.connectedCallback() && (Q(this, de, dl).call(this), Q(this, de, ul).call(this), Q(this, de, Ar).call(this));
14498
14498
  }
14499
14499
  get value() {
14500
14500
  return O(this, re).getHTML();
@@ -14521,14 +14521,14 @@ class vh extends Sl {
14521
14521
  return this.hasAttribute("readonly");
14522
14522
  }
14523
14523
  set readonly(t) {
14524
- t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), Q(this, de, Dr).call(this);
14524
+ t ? this.setAttribute("readonly", "") : this.removeAttribute("readonly"), Q(this, de, Ar).call(this);
14525
14525
  }
14526
14526
  disconnectedCallback() {
14527
14527
  O(this, re) && (O(this, re).destroy(), oe(this, re, null));
14528
14528
  }
14529
14529
  }
14530
14530
  re = new WeakMap(), Jt = new WeakMap(), Ut = new WeakMap(), de = new WeakSet(), // 2. 에디터 상태 업데이트 로직 분리
14531
- Dr = function() {
14531
+ Ar = function() {
14532
14532
  if (O(this, re)) {
14533
14533
  const t = this.readonly;
14534
14534
  O(this, re).setEditable(!t);
@@ -14536,10 +14536,10 @@ Dr = function() {
14536
14536
  r && (r.style.display = t ? "none" : "flex");
14537
14537
  }
14538
14538
  }, dl = function() {
14539
- const t = Nn.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
14539
+ const t = Rr.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
14540
14540
  this.shadowRoot.innerHTML = `
14541
14541
  <style>
14542
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.42/dist/css/nineEditor.css";
14542
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.43/dist/css/nineEditor.css";
14543
14543
  ${r}
14544
14544
  </style>
14545
14545
 
@@ -14640,9 +14640,8 @@ Dr = function() {
14640
14640
  r && t.chain().focus().setImage({ src: r }).run();
14641
14641
  };
14642
14642
  };
14643
- typeof window < "u" && (window.nineUx = Nn, customElements.get("nine-editor") || customElements.define("nine-editor", vh));
14643
+ typeof window < "u" && (customElements.get("nine-editor") || customElements.define("nine-editor", vh));
14644
14644
  export {
14645
- vh as nineEditor,
14646
- Nn as nineUx
14645
+ vh as nineEditor
14647
14646
  };
14648
14647
  //# sourceMappingURL=nine-ux.es.js.map