@nine-lab/nine-ux 0.1.70 → 0.1.72

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.
@@ -5,8 +5,8 @@ var li = (n) => {
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
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
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
- import { nine as yt, subscribeConfig as Ml, trace as wl } from "@nine-lab/nine-util";
9
- const Cl = `
8
+ import { nine as yt, subscribeConfig as Ml } from "@nine-lab/nine-util";
9
+ const wl = `
10
10
  dialog::backdrop {
11
11
  background: rgba(0, 0, 0, 0.3);
12
12
  }
@@ -404,7 +404,7 @@ dialog.out { animation: nx-fade-out 0.3s forwards; }
404
404
  @keyframes nx-fade-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.9); } }
405
405
  `;
406
406
  var Oe, j, Nn, An, Dn;
407
- class Tl extends HTMLElement {
407
+ class Cl extends HTMLElement {
408
408
  constructor() {
409
409
  super();
410
410
  F(this, Oe);
@@ -459,7 +459,7 @@ class Tl extends HTMLElement {
459
459
  connectedCallback() {
460
460
  const t = this.innerHTML, r = this.getAttribute("title") || "Details";
461
461
  this.innerHTML = `
462
- <style>${Cl}</style>
462
+ <style>${wl}</style>
463
463
 
464
464
  <dialog>
465
465
  <div class="head">
@@ -493,7 +493,7 @@ class Tl extends HTMLElement {
493
493
  }
494
494
  }
495
495
  Oe = new WeakMap(), j = new WeakMap(), Nn = new WeakMap(), An = new WeakMap(), Dn = new WeakMap();
496
- customElements.get("nine-dialog") || customElements.define("nine-dialog", Tl);
496
+ customElements.get("nine-dialog") || customElements.define("nine-dialog", Cl);
497
497
  class hn extends HTMLElement {
498
498
  constructor() {
499
499
  super(), this.attachShadow({ mode: "open" });
@@ -569,7 +569,7 @@ ye(pn, "alert", async (e, t = "Alert", r = {}) => {
569
569
  customElements.get("nine-confirm-popup") || customElements.define("nine-confirm-popup", hn);
570
570
  customElements.get("nine-alert-popup") || customElements.define("nine-alert-popup", pn);
571
571
  var jt, Kt, hr;
572
- class Ol {
572
+ class Tl {
573
573
  constructor() {
574
574
  F(this, Kt);
575
575
  F(this, jt, "");
@@ -626,9 +626,9 @@ jt = new WeakMap(), Kt = new WeakSet(), hr = function(e, t, r, i) {
626
626
  l || (l = !0, o[e](t, r, s));
627
627
  }), a;
628
628
  };
629
- const Ae = new Ol();
629
+ const Ae = new Tl();
630
630
  var Jt, Ze, Ut, ae, Ot, pr, mr, _t, In;
631
- class vl extends HTMLElement {
631
+ class Ol extends HTMLElement {
632
632
  constructor() {
633
633
  super();
634
634
  F(this, ae);
@@ -1362,7 +1362,7 @@ function vs(n, e, t, r) {
1362
1362
  let l = vs(o.content, e - s - 1, t, o);
1363
1363
  return l && n.replaceChild(i, o.copy(l));
1364
1364
  }
1365
- function El(n, e, t) {
1365
+ function vl(n, e, t) {
1366
1366
  if (t.openStart > n.depth)
1367
1367
  throw new gn("Inserted content deeper than insertion position");
1368
1368
  if (n.depth - t.openStart != e.depth - t.openEnd)
@@ -1379,7 +1379,7 @@ function Es(n, e, t, r) {
1379
1379
  let o = n.parent, l = o.content;
1380
1380
  return et(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
1381
1381
  } else {
1382
- let { start: o, end: l } = Nl(t, n);
1382
+ let { start: o, end: l } = El(t, n);
1383
1383
  return et(s, As(n, o, l, e, r));
1384
1384
  }
1385
1385
  else return et(s, yn(n, e, r));
@@ -1418,7 +1418,7 @@ function yn(n, e, t) {
1418
1418
  }
1419
1419
  return At(e, null, t, r), new b(r);
1420
1420
  }
1421
- function Nl(n, e) {
1421
+ function El(n, e) {
1422
1422
  let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
1423
1423
  for (let s = t - 1; s >= 0; s--)
1424
1424
  i = e.node(s).copy(b.from(i));
@@ -1669,17 +1669,17 @@ class Pt {
1669
1669
  return o;
1670
1670
  }
1671
1671
  else
1672
- ai.set(e, r = new Al());
1672
+ ai.set(e, r = new Nl());
1673
1673
  let i = r.elts[r.i] = Pt.resolve(e, t);
1674
- return r.i = (r.i + 1) % Dl, i;
1674
+ return r.i = (r.i + 1) % Al, i;
1675
1675
  }
1676
1676
  }
1677
- class Al {
1677
+ class Nl {
1678
1678
  constructor() {
1679
1679
  this.elts = [], this.i = 0;
1680
1680
  }
1681
1681
  }
1682
- const Dl = 12, ai = /* @__PURE__ */ new WeakMap();
1682
+ const Al = 12, ai = /* @__PURE__ */ new WeakMap();
1683
1683
  class bn {
1684
1684
  /**
1685
1685
  Construct a node range. `$from` and `$to` should point into the
@@ -1720,7 +1720,7 @@ class bn {
1720
1720
  return this.$to.indexAfter(this.depth);
1721
1721
  }
1722
1722
  }
1723
- const Il = /* @__PURE__ */ Object.create(null);
1723
+ const Dl = /* @__PURE__ */ Object.create(null);
1724
1724
  let Fe = class br {
1725
1725
  /**
1726
1726
  @internal
@@ -1839,7 +1839,7 @@ let Fe = class br {
1839
1839
  attributes, and marks.
1840
1840
  */
1841
1841
  hasMarkup(e, t, r) {
1842
- return this.type == e && mn(this.attrs, t || e.defaultAttrs || Il) && A.sameSet(this.marks, r || A.none);
1842
+ return this.type == e && mn(this.attrs, t || e.defaultAttrs || Dl) && A.sameSet(this.marks, r || A.none);
1843
1843
  }
1844
1844
  /**
1845
1845
  Create a new node with the same markup as this node, containing
@@ -1882,7 +1882,7 @@ let Fe = class br {
1882
1882
  [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
1883
1883
  */
1884
1884
  replace(e, t, r) {
1885
- return El(this.resolve(e), this.resolve(t), r);
1885
+ return vl(this.resolve(e), this.resolve(t), r);
1886
1886
  }
1887
1887
  /**
1888
1888
  Find the node directly after the given position.
@@ -2145,13 +2145,13 @@ class it {
2145
2145
  @internal
2146
2146
  */
2147
2147
  static parse(e, t) {
2148
- let r = new Rl(e, t);
2148
+ let r = new Il(e, t);
2149
2149
  if (r.next == null)
2150
2150
  return it.empty;
2151
2151
  let i = Is(r);
2152
2152
  r.next && r.err("Unexpected trailing text");
2153
- let s = Vl($l(i));
2154
- return Hl(s, r), s;
2153
+ let s = $l(Fl(i));
2154
+ return Vl(s, r), s;
2155
2155
  }
2156
2156
  /**
2157
2157
  Match a node type, returning a match after that node if
@@ -2297,7 +2297,7 @@ class it {
2297
2297
  }
2298
2298
  }
2299
2299
  it.empty = new it(!0);
2300
- class Rl {
2300
+ class Il {
2301
2301
  constructor(e, t) {
2302
2302
  this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
2303
2303
  }
@@ -2314,19 +2314,19 @@ class Rl {
2314
2314
  function Is(n) {
2315
2315
  let e = [];
2316
2316
  do
2317
- e.push(Pl(n));
2317
+ e.push(Rl(n));
2318
2318
  while (n.eat("|"));
2319
2319
  return e.length == 1 ? e[0] : { type: "choice", exprs: e };
2320
2320
  }
2321
- function Pl(n) {
2321
+ function Rl(n) {
2322
2322
  let e = [];
2323
2323
  do
2324
- e.push(Bl(n));
2324
+ e.push(Pl(n));
2325
2325
  while (n.next && n.next != ")" && n.next != "|");
2326
2326
  return e.length == 1 ? e[0] : { type: "seq", exprs: e };
2327
2327
  }
2328
- function Bl(n) {
2329
- let e = Fl(n);
2328
+ function Pl(n) {
2329
+ let e = zl(n);
2330
2330
  for (; ; )
2331
2331
  if (n.eat("+"))
2332
2332
  e = { type: "plus", expr: e };
@@ -2335,7 +2335,7 @@ function Bl(n) {
2335
2335
  else if (n.eat("?"))
2336
2336
  e = { type: "opt", expr: e };
2337
2337
  else if (n.eat("{"))
2338
- e = Ll(n, e);
2338
+ e = Bl(n, e);
2339
2339
  else
2340
2340
  break;
2341
2341
  return e;
@@ -2345,11 +2345,11 @@ function ci(n) {
2345
2345
  let e = Number(n.next);
2346
2346
  return n.pos++, e;
2347
2347
  }
2348
- function Ll(n, e) {
2348
+ function Bl(n, e) {
2349
2349
  let t = ci(n), r = t;
2350
2350
  return n.eat(",") && (n.next != "}" ? r = ci(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
2351
2351
  }
2352
- function zl(n, e) {
2352
+ function Ll(n, e) {
2353
2353
  let t = n.nodeTypes, r = t[e];
2354
2354
  if (r)
2355
2355
  return [r];
@@ -2360,18 +2360,18 @@ function zl(n, e) {
2360
2360
  }
2361
2361
  return i.length == 0 && n.err("No node type or group '" + e + "' found"), i;
2362
2362
  }
2363
- function Fl(n) {
2363
+ function zl(n) {
2364
2364
  if (n.eat("(")) {
2365
2365
  let e = Is(n);
2366
2366
  return n.eat(")") || n.err("Missing closing paren"), e;
2367
2367
  } else if (/\W/.test(n.next))
2368
2368
  n.err("Unexpected token '" + n.next + "'");
2369
2369
  else {
2370
- let e = zl(n, n.next).map((t) => (n.inline == null ? n.inline = t.isInline : n.inline != t.isInline && n.err("Mixing inline and block content"), { type: "name", value: t }));
2370
+ let e = Ll(n, n.next).map((t) => (n.inline == null ? n.inline = t.isInline : n.inline != t.isInline && n.err("Mixing inline and block content"), { type: "name", value: t }));
2371
2371
  return n.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
2372
2372
  }
2373
2373
  }
2374
- function $l(n) {
2374
+ function Fl(n) {
2375
2375
  let e = [[]];
2376
2376
  return i(s(n, 0), t()), e;
2377
2377
  function t() {
@@ -2442,7 +2442,7 @@ function di(n, e) {
2442
2442
  }
2443
2443
  }
2444
2444
  }
2445
- function Vl(n) {
2445
+ function $l(n) {
2446
2446
  let e = /* @__PURE__ */ Object.create(null);
2447
2447
  return t(di(n, 0));
2448
2448
  function t(r) {
@@ -2467,7 +2467,7 @@ function Vl(n) {
2467
2467
  return s;
2468
2468
  }
2469
2469
  }
2470
- function Hl(n, e) {
2470
+ function Vl(n, e) {
2471
2471
  for (let t = 0, r = [n]; t < r.length; t++) {
2472
2472
  let i = r[t], s = !i.validEnd, o = [];
2473
2473
  for (let l = 0; l < i.next.length; l++) {
@@ -2515,7 +2515,7 @@ function zs(n, e) {
2515
2515
  let t = /* @__PURE__ */ Object.create(null);
2516
2516
  if (e)
2517
2517
  for (let r in e)
2518
- t[r] = new ql(n, r, e[r]);
2518
+ t[r] = new Wl(n, r, e[r]);
2519
2519
  return t;
2520
2520
  }
2521
2521
  let ui = class Fs {
@@ -2697,7 +2697,7 @@ let ui = class Fs {
2697
2697
  return r;
2698
2698
  }
2699
2699
  };
2700
- function Wl(n, e, t) {
2700
+ function Hl(n, e, t) {
2701
2701
  let r = t.split("|");
2702
2702
  return (i) => {
2703
2703
  let s = i === null ? "null" : typeof i;
@@ -2705,9 +2705,9 @@ function Wl(n, e, t) {
2705
2705
  throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`);
2706
2706
  };
2707
2707
  }
2708
- class ql {
2708
+ class Wl {
2709
2709
  constructor(e, t, r) {
2710
- this.hasDefault = Object.prototype.hasOwnProperty.call(r, "default"), this.default = r.default, this.validate = typeof r.validate == "string" ? Wl(e, t, r.validate) : r.validate;
2710
+ this.hasDefault = Object.prototype.hasOwnProperty.call(r, "default"), this.default = r.default, this.validate = typeof r.validate == "string" ? Hl(e, t, r.validate) : r.validate;
2711
2711
  }
2712
2712
  get isRequired() {
2713
2713
  return !this.hasDefault;
@@ -2853,10 +2853,10 @@ function fi(n, e) {
2853
2853
  }
2854
2854
  return t;
2855
2855
  }
2856
- function jl(n) {
2856
+ function ql(n) {
2857
2857
  return n.tag != null;
2858
2858
  }
2859
- function Kl(n) {
2859
+ function jl(n) {
2860
2860
  return n.style != null;
2861
2861
  }
2862
2862
  class $e {
@@ -2868,9 +2868,9 @@ class $e {
2868
2868
  this.schema = e, this.rules = t, this.tags = [], this.styles = [];
2869
2869
  let r = this.matchedStyles = [];
2870
2870
  t.forEach((i) => {
2871
- if (jl(i))
2871
+ if (ql(i))
2872
2872
  this.tags.push(i);
2873
- else if (Kl(i)) {
2873
+ else if (jl(i)) {
2874
2874
  let s = /[^=]*/.exec(i.style)[0];
2875
2875
  r.indexOf(s) < 0 && r.push(s), this.styles.push(i);
2876
2876
  }
@@ -2906,7 +2906,7 @@ class $e {
2906
2906
  matchTag(e, t, r) {
2907
2907
  for (let i = r ? this.tags.indexOf(r) + 1 : 0; i < this.tags.length; i++) {
2908
2908
  let s = this.tags[i];
2909
- if (_l(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
2909
+ if (Ul(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
2910
2910
  if (s.getAttrs) {
2911
2911
  let o = s.getAttrs(e);
2912
2912
  if (o === !1)
@@ -3007,7 +3007,7 @@ const Vs = {
3007
3007
  table: !0,
3008
3008
  tfoot: !0,
3009
3009
  ul: !0
3010
- }, Jl = {
3010
+ }, Kl = {
3011
3011
  head: !0,
3012
3012
  noscript: !0,
3013
3013
  object: !0,
@@ -3094,9 +3094,9 @@ class pi {
3094
3094
  let i = this.localPreserveWS, s = this.top;
3095
3095
  (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
3096
3096
  let o = e.nodeName.toLowerCase(), l;
3097
- Hs.hasOwnProperty(o) && this.parser.normalizeLists && Ul(e);
3097
+ Hs.hasOwnProperty(o) && this.parser.normalizeLists && Jl(e);
3098
3098
  let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, r));
3099
- e: if (a ? a.ignore : Jl.hasOwnProperty(o))
3099
+ e: if (a ? a.ignore : Kl.hasOwnProperty(o))
3100
3100
  this.findInside(e), this.ignoreFallback(e, t);
3101
3101
  else if (!a || a.skip || a.closeParent) {
3102
3102
  a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
@@ -3333,13 +3333,13 @@ class pi {
3333
3333
  }
3334
3334
  }
3335
3335
  }
3336
- function Ul(n) {
3336
+ function Jl(n) {
3337
3337
  for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
3338
3338
  let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
3339
3339
  r && Hs.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
3340
3340
  }
3341
3341
  }
3342
- function _l(n, e) {
3342
+ function Ul(n, e) {
3343
3343
  return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
3344
3344
  }
3345
3345
  function mi(n) {
@@ -3482,11 +3482,11 @@ function _n(n) {
3482
3482
  return n.document || window.document;
3483
3483
  }
3484
3484
  const bi = /* @__PURE__ */ new WeakMap();
3485
- function Gl(n) {
3485
+ function _l(n) {
3486
3486
  let e = bi.get(n);
3487
- return e === void 0 && bi.set(n, e = Xl(n)), e;
3487
+ return e === void 0 && bi.set(n, e = Gl(n)), e;
3488
3488
  }
3489
- function Xl(n) {
3489
+ function Gl(n) {
3490
3490
  let e = null;
3491
3491
  function t(r) {
3492
3492
  if (r && typeof r == "object")
@@ -3512,7 +3512,7 @@ function cn(n, e, t, r) {
3512
3512
  let i = e[0], s;
3513
3513
  if (typeof i != "string")
3514
3514
  throw new RangeError("Invalid array passed to renderSpec");
3515
- if (r && (s = Gl(r)) && s.indexOf(e) > -1)
3515
+ if (r && (s = _l(r)) && s.indexOf(e) > -1)
3516
3516
  throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
3517
3517
  let o = i.indexOf(" ");
3518
3518
  o > 0 && (t = i.slice(0, o), i = i.slice(o + 1));
@@ -3543,13 +3543,13 @@ function cn(n, e, t, r) {
3543
3543
  return { dom: a, contentDOM: l };
3544
3544
  }
3545
3545
  const Ws = 65535, qs = Math.pow(2, 16);
3546
- function Yl(n, e) {
3546
+ function Xl(n, e) {
3547
3547
  return n + e * qs;
3548
3548
  }
3549
3549
  function ki(n) {
3550
3550
  return n & Ws;
3551
3551
  }
3552
- function Zl(n) {
3552
+ function Yl(n) {
3553
3553
  return (n - (n & Ws)) / qs;
3554
3554
  }
3555
3555
  const js = 1, Ks = 2, dn = 4, Js = 8;
@@ -3607,7 +3607,7 @@ class le {
3607
3607
  if (!this.inverted)
3608
3608
  for (let i = 0; i < r; i++)
3609
3609
  t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
3610
- return this.ranges[r * 3] + t + Zl(e);
3610
+ return this.ranges[r * 3] + t + Yl(e);
3611
3611
  }
3612
3612
  mapResult(e, t = 1) {
3613
3613
  return this._map(e, t, !1);
@@ -3629,7 +3629,7 @@ class le {
3629
3629
  let f = c ? e == a ? -1 : e == u ? 1 : t : t, h = a + i + (f < 0 ? 0 : d);
3630
3630
  if (r)
3631
3631
  return h;
3632
- let p = e == (t < 0 ? a : u) ? null : Yl(l / 3, e - a), m = e == a ? Ks : e == u ? js : dn;
3632
+ let p = e == (t < 0 ? a : u) ? null : Xl(l / 3, e - a), m = e == a ? Ks : e == u ? js : dn;
3633
3633
  return (t < 0 ? e != a : e != u) && (m |= Js), new xr(h, m, p);
3634
3634
  }
3635
3635
  i += d - c;
@@ -4159,7 +4159,7 @@ function Sr(n, e, t) {
4159
4159
  }
4160
4160
  return !1;
4161
4161
  }
4162
- function Ql(n, e, t, r) {
4162
+ function Zl(n, e, t, r) {
4163
4163
  let i = [], s = [], o, l;
4164
4164
  n.doc.nodesBetween(e, t, (a, c, d) => {
4165
4165
  if (!a.isInline)
@@ -4173,7 +4173,7 @@ function Ql(n, e, t, r) {
4173
4173
  }
4174
4174
  }), i.forEach((a) => n.step(a)), s.forEach((a) => n.step(a));
4175
4175
  }
4176
- function ea(n, e, t, r) {
4176
+ function Ql(n, e, t, r) {
4177
4177
  let i = [], s = 0;
4178
4178
  n.doc.nodesBetween(e, t, (o, l) => {
4179
4179
  if (!o.isInline)
@@ -4223,7 +4223,7 @@ function Fr(n, e, t, r = t.contentMatch, i = !0) {
4223
4223
  for (let a = o.length - 1; a >= 0; a--)
4224
4224
  n.step(o[a]);
4225
4225
  }
4226
- function ta(n, e, t) {
4226
+ function ea(n, e, t) {
4227
4227
  return (e == 0 || n.canReplace(e, n.childCount)) && (t == n.childCount || n.canReplace(0, t));
4228
4228
  }
4229
4229
  function Ct(n) {
@@ -4232,13 +4232,13 @@ function Ct(n) {
4232
4232
  let o = n.$from.node(r), l = n.$from.index(r) + i, a = n.$to.indexAfter(r) - s;
4233
4233
  if (r < n.depth && o.canReplace(l, a, t))
4234
4234
  return r;
4235
- if (r == 0 || o.type.spec.isolating || !ta(o, l, a))
4235
+ if (r == 0 || o.type.spec.isolating || !ea(o, l, a))
4236
4236
  break;
4237
4237
  l && (i = 1), a < o.childCount && (s = 1);
4238
4238
  }
4239
4239
  return null;
4240
4240
  }
4241
- function na(n, e, t) {
4241
+ function ta(n, e, t) {
4242
4242
  let { $from: r, $to: i, depth: s } = e, o = r.before(s + 1), l = i.after(s + 1), a = o, c = l, d = b.empty, u = 0;
4243
4243
  for (let p = s, m = !1; p > t; p--)
4244
4244
  m || r.index(p) > 0 ? (m = !0, d = b.from(r.node(p).copy(d)), u++) : a--;
@@ -4248,20 +4248,20 @@ function na(n, e, t) {
4248
4248
  n.step(new $(a, c, o, l, new k(d.append(f), u, h), d.size - u, !0));
4249
4249
  }
4250
4250
  function $r(n, e, t = null, r = n) {
4251
- let i = ra(n, e), s = i && ia(r, e);
4251
+ let i = na(n, e), s = i && ra(r, e);
4252
4252
  return s ? i.map(xi).concat({ type: e, attrs: t }).concat(s.map(xi)) : null;
4253
4253
  }
4254
4254
  function xi(n) {
4255
4255
  return { type: n, attrs: null };
4256
4256
  }
4257
- function ra(n, e) {
4257
+ function na(n, e) {
4258
4258
  let { parent: t, startIndex: r, endIndex: i } = n, s = t.contentMatchAt(r).findWrapping(e);
4259
4259
  if (!s)
4260
4260
  return null;
4261
4261
  let o = s.length ? s[0] : e;
4262
4262
  return t.canReplaceWith(r, i, o) ? s : null;
4263
4263
  }
4264
- function ia(n, e) {
4264
+ function ra(n, e) {
4265
4265
  let { parent: t, startIndex: r, endIndex: i } = n, s = t.child(r), o = e.contentMatch.findWrapping(s.type);
4266
4266
  if (!o)
4267
4267
  return null;
@@ -4270,7 +4270,7 @@ function ia(n, e) {
4270
4270
  a = a.matchType(t.child(c).type);
4271
4271
  return !a || !a.validEnd ? null : o;
4272
4272
  }
4273
- function sa(n, e, t) {
4273
+ function ia(n, e, t) {
4274
4274
  let r = b.empty;
4275
4275
  for (let o = t.length - 1; o >= 0; o--) {
4276
4276
  if (r.size) {
@@ -4283,13 +4283,13 @@ function sa(n, e, t) {
4283
4283
  let i = e.start, s = e.end;
4284
4284
  n.step(new $(i, s, i, s, new k(r, 0, 0), t.length, !0));
4285
4285
  }
4286
- function oa(n, e, t, r, i) {
4286
+ function sa(n, e, t, r, i) {
4287
4287
  if (!r.isTextblock)
4288
4288
  throw new RangeError("Type given to setBlockType should be a textblock");
4289
4289
  let s = n.steps.length;
4290
4290
  n.doc.nodesBetween(e, t, (o, l) => {
4291
4291
  let a = typeof i == "function" ? i(o) : i;
4292
- if (o.isTextblock && !o.hasMarkup(r, a) && la(n.doc, n.mapping.slice(s).map(l), r)) {
4292
+ if (o.isTextblock && !o.hasMarkup(r, a) && oa(n.doc, n.mapping.slice(s).map(l), r)) {
4293
4293
  let c = null;
4294
4294
  if (r.schema.linebreakReplacement) {
4295
4295
  let h = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
@@ -4321,11 +4321,11 @@ function _s(n, e, t, r) {
4321
4321
  }
4322
4322
  });
4323
4323
  }
4324
- function la(n, e, t) {
4324
+ function oa(n, e, t) {
4325
4325
  let r = n.resolve(e), i = r.index();
4326
4326
  return r.parent.canReplaceWith(i, i + 1, t);
4327
4327
  }
4328
- function aa(n, e, t, r, i) {
4328
+ function la(n, e, t, r, i) {
4329
4329
  let s = n.doc.nodeAt(e);
4330
4330
  if (!s)
4331
4331
  throw new RangeError("No node at given position");
@@ -4354,7 +4354,7 @@ function Ee(n, e, t = 1, r) {
4354
4354
  let l = i.indexAfter(s), a = r && r[0];
4355
4355
  return i.node(s).canReplaceWith(l, l, a ? a.type : i.node(s + 1).type);
4356
4356
  }
4357
- function ca(n, e, t = 1, r) {
4357
+ function aa(n, e, t = 1, r) {
4358
4358
  let i = n.doc.resolve(e), s = b.empty, o = b.empty;
4359
4359
  for (let l = i.depth, a = i.depth - t, c = t - 1; l > a; l--, c--) {
4360
4360
  s = b.from(i.node(l).copy(s));
@@ -4367,7 +4367,7 @@ function je(n, e) {
4367
4367
  let t = n.resolve(e), r = t.index();
4368
4368
  return Gs(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(r, r + 1);
4369
4369
  }
4370
- function da(n, e) {
4370
+ function ca(n, e) {
4371
4371
  e.content.size || n.type.compatibleContent(e.type);
4372
4372
  let t = n.contentMatchAt(n.childCount), { linebreakReplacement: r } = n.type.schema;
4373
4373
  for (let i = 0; i < e.childCount; i++) {
@@ -4378,7 +4378,7 @@ function da(n, e) {
4378
4378
  return t.validEnd;
4379
4379
  }
4380
4380
  function Gs(n, e) {
4381
- return !!(n && e && !n.isLeaf && da(n, e));
4381
+ return !!(n && e && !n.isLeaf && ca(n, e));
4382
4382
  }
4383
4383
  function Pn(n, e, t = -1) {
4384
4384
  let r = n.resolve(e);
@@ -4391,7 +4391,7 @@ function Pn(n, e, t = -1) {
4391
4391
  e = t < 0 ? r.before(i) : r.after(i);
4392
4392
  }
4393
4393
  }
4394
- function ua(n, e, t) {
4394
+ function da(n, e, t) {
4395
4395
  let r = null, { linebreakReplacement: i } = n.doc.type.schema, s = n.doc.resolve(e - t), o = s.node().type;
4396
4396
  if (i && o.inlineContent) {
4397
4397
  let d = o.whitespace == "pre", u = !!o.contentMatch.matchType(i);
@@ -4410,7 +4410,7 @@ function ua(n, e, t) {
4410
4410
  }
4411
4411
  return n;
4412
4412
  }
4413
- function fa(n, e, t) {
4413
+ function ua(n, e, t) {
4414
4414
  let r = n.resolve(e);
4415
4415
  if (r.parent.canReplaceWith(r.index(), r.index(), t))
4416
4416
  return e;
@@ -4457,12 +4457,12 @@ function Bn(n, e, t = e, r = k.empty) {
4457
4457
  if (e == t && !r.size)
4458
4458
  return null;
4459
4459
  let i = n.resolve(e), s = n.resolve(t);
4460
- return Ys(i, s, r) ? new P(e, t, r) : new ha(i, s, r).fit();
4460
+ return Ys(i, s, r) ? new P(e, t, r) : new fa(i, s, r).fit();
4461
4461
  }
4462
4462
  function Ys(n, e, t) {
4463
4463
  return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
4464
4464
  }
4465
- class ha {
4465
+ class fa {
4466
4466
  constructor(e, t, r) {
4467
4467
  this.$from = e, this.$to = t, this.unplaced = r, this.frontier = [], this.placed = b.empty;
4468
4468
  for (let i = 0; i <= e.depth; i++) {
@@ -4631,18 +4631,18 @@ function Yn(n, e, t, r, i) {
4631
4631
  if (o == s.childCount && !t.compatibleContent(s.type))
4632
4632
  return null;
4633
4633
  let l = r.fillBefore(s.content, !0, o);
4634
- return l && !pa(t, s.content, o) ? l : null;
4634
+ return l && !ha(t, s.content, o) ? l : null;
4635
4635
  }
4636
- function pa(n, e, t) {
4636
+ function ha(n, e, t) {
4637
4637
  for (let r = t; r < e.childCount; r++)
4638
4638
  if (!n.allowsMarks(e.child(r).marks))
4639
4639
  return !0;
4640
4640
  return !1;
4641
4641
  }
4642
- function ma(n) {
4642
+ function pa(n) {
4643
4643
  return n.spec.defining || n.spec.definingForContent;
4644
4644
  }
4645
- function ga(n, e, t, r) {
4645
+ function ma(n, e, t, r) {
4646
4646
  if (!r.size)
4647
4647
  return n.deleteRange(e, t);
4648
4648
  let i = n.doc.resolve(e), s = n.doc.resolve(t);
@@ -4666,7 +4666,7 @@ function ga(n, e, t, r) {
4666
4666
  f = p.content;
4667
4667
  }
4668
4668
  for (let f = d - 1; f >= 0; f--) {
4669
- let h = c[f], p = ma(h.type);
4669
+ let h = c[f], p = pa(h.type);
4670
4670
  if (p && !h.sameMarkup(i.node(Math.abs(l) - 1)))
4671
4671
  d = f;
4672
4672
  else if (p || !h.type.isTextblock)
@@ -4700,14 +4700,14 @@ function Qs(n, e, t, r, i) {
4700
4700
  }
4701
4701
  return n;
4702
4702
  }
4703
- function ya(n, e, t, r) {
4703
+ function ga(n, e, t, r) {
4704
4704
  if (!r.isInline && e == t && n.doc.resolve(e).parent.content.size) {
4705
- let i = fa(n.doc, e, r.type);
4705
+ let i = ua(n.doc, e, r.type);
4706
4706
  i != null && (e = t = i);
4707
4707
  }
4708
4708
  n.replaceRange(e, t, new k(b.from(r), 0, 0));
4709
4709
  }
4710
- function ba(n, e, t) {
4710
+ function ya(n, e, t) {
4711
4711
  let r = n.doc.resolve(e), i = n.doc.resolve(t);
4712
4712
  if (r.parent.isTextblock && i.parent.isTextblock && r.start() != i.start() && r.parentOffset == 0 && i.parentOffset == 0) {
4713
4713
  let o = r.sharedDepth(t), l = !1;
@@ -4827,7 +4827,7 @@ xt = function n(e) {
4827
4827
  xt.prototype = Object.create(Error.prototype);
4828
4828
  xt.prototype.constructor = xt;
4829
4829
  xt.prototype.name = "TransformError";
4830
- class ka {
4830
+ class ba {
4831
4831
  /**
4832
4832
  Create a transform that starts with the given document.
4833
4833
  */
@@ -4934,7 +4934,7 @@ class ka {
4934
4934
  control over what happens.
4935
4935
  */
4936
4936
  replaceRange(e, t, r) {
4937
- return ga(this, e, t, r), this;
4937
+ return ma(this, e, t, r), this;
4938
4938
  }
4939
4939
  /**
4940
4940
  Replace the given range with a node, but use `from` and `to` as
@@ -4946,14 +4946,14 @@ class ka {
4946
4946
  that parent node.
4947
4947
  */
4948
4948
  replaceRangeWith(e, t, r) {
4949
- return ya(this, e, t, r), this;
4949
+ return ga(this, e, t, r), this;
4950
4950
  }
4951
4951
  /**
4952
4952
  Delete the given range, expanding it to cover fully covered
4953
4953
  parent nodes until a valid replace is found.
4954
4954
  */
4955
4955
  deleteRange(e, t) {
4956
- return ba(this, e, t), this;
4956
+ return ya(this, e, t), this;
4957
4957
  }
4958
4958
  /**
4959
4959
  Split the content in the given range off from its parent, if there
@@ -4963,14 +4963,14 @@ class ka {
4963
4963
  sure the lift is valid.
4964
4964
  */
4965
4965
  lift(e, t) {
4966
- return na(this, e, t), this;
4966
+ return ta(this, e, t), this;
4967
4967
  }
4968
4968
  /**
4969
4969
  Join the blocks around the given position. If depth is 2, their
4970
4970
  last and first siblings are also joined, and so on.
4971
4971
  */
4972
4972
  join(e, t = 1) {
4973
- return ua(this, e, t), this;
4973
+ return da(this, e, t), this;
4974
4974
  }
4975
4975
  /**
4976
4976
  Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
@@ -4978,21 +4978,21 @@ class ka {
4978
4978
  probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
4979
4979
  */
4980
4980
  wrap(e, t) {
4981
- return sa(this, e, t), this;
4981
+ return ia(this, e, t), this;
4982
4982
  }
4983
4983
  /**
4984
4984
  Set the type of all textblocks (partly) between `from` and `to` to
4985
4985
  the given node type with the given attributes.
4986
4986
  */
4987
4987
  setBlockType(e, t = e, r, i = null) {
4988
- return oa(this, e, t, r, i), this;
4988
+ return sa(this, e, t, r, i), this;
4989
4989
  }
4990
4990
  /**
4991
4991
  Change the type, attributes, and/or marks of the node at `pos`.
4992
4992
  When `type` isn't given, the existing node type is preserved,
4993
4993
  */
4994
4994
  setNodeMarkup(e, t, r = null, i) {
4995
- return aa(this, e, t, r, i), this;
4995
+ return la(this, e, t, r, i), this;
4996
4996
  }
4997
4997
  /**
4998
4998
  Set a single attribute on a given node to a new value.
@@ -5041,13 +5041,13 @@ class ka {
5041
5041
  use after the split (with the outermost nodes coming first).
5042
5042
  */
5043
5043
  split(e, t = 1, r) {
5044
- return ca(this, e, t, r), this;
5044
+ return aa(this, e, t, r), this;
5045
5045
  }
5046
5046
  /**
5047
5047
  Add the given mark to the inline content between `from` and `to`.
5048
5048
  */
5049
5049
  addMark(e, t, r) {
5050
- return Ql(this, e, t, r), this;
5050
+ return Zl(this, e, t, r), this;
5051
5051
  }
5052
5052
  /**
5053
5053
  Remove marks from inline nodes between `from` and `to`. When
@@ -5056,7 +5056,7 @@ class ka {
5056
5056
  remove all marks of any type.
5057
5057
  */
5058
5058
  removeMark(e, t, r) {
5059
- return ea(this, e, t, r), this;
5059
+ return Ql(this, e, t, r), this;
5060
5060
  }
5061
5061
  /**
5062
5062
  Removes all marks and nodes from the content of the node at
@@ -5076,7 +5076,7 @@ class v {
5076
5076
  `$head`.
5077
5077
  */
5078
5078
  constructor(e, t, r) {
5079
- this.$anchor = e, this.$head = t, this.ranges = r || [new xa(e.min(t), e.max(t))];
5079
+ this.$anchor = e, this.$head = t, this.ranges = r || [new ka(e.min(t), e.max(t))];
5080
5080
  }
5081
5081
  /**
5082
5082
  The selection's anchor, as an unresolved position.
@@ -5234,7 +5234,7 @@ class v {
5234
5234
  }
5235
5235
  }
5236
5236
  v.prototype.visible = !0;
5237
- class xa {
5237
+ class ka {
5238
5238
  /**
5239
5239
  Create a range.
5240
5240
  */
@@ -5422,11 +5422,11 @@ class ce extends v {
5422
5422
  return e instanceof ce;
5423
5423
  }
5424
5424
  getBookmark() {
5425
- return Sa;
5425
+ return xa;
5426
5426
  }
5427
5427
  }
5428
5428
  v.jsonID("all", ce);
5429
- const Sa = {
5429
+ const xa = {
5430
5430
  map() {
5431
5431
  return this;
5432
5432
  },
@@ -5464,7 +5464,7 @@ function wi(n, e, t) {
5464
5464
  }), n.setSelection(v.near(n.doc.resolve(o), t));
5465
5465
  }
5466
5466
  const Ci = 1, nn = 2, Ti = 4;
5467
- class Ma extends ka {
5467
+ class Sa extends ba {
5468
5468
  /**
5469
5469
  @internal
5470
5470
  */
@@ -5623,7 +5623,7 @@ class Nt {
5623
5623
  this.name = e, this.init = Oi(t.init, r), this.apply = Oi(t.apply, r);
5624
5624
  }
5625
5625
  }
5626
- const wa = [
5626
+ const Ma = [
5627
5627
  new Nt("doc", {
5628
5628
  init(n) {
5629
5629
  return n.doc || n.schema.topNodeType.createAndFill();
@@ -5659,7 +5659,7 @@ const wa = [
5659
5659
  ];
5660
5660
  class Qn {
5661
5661
  constructor(e, t) {
5662
- this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = wa.slice(), t && t.forEach((r) => {
5662
+ this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Ma.slice(), t && t.forEach((r) => {
5663
5663
  if (this.pluginsByKey[r.key])
5664
5664
  throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
5665
5665
  this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new Nt(r.key, r.spec.state, r));
@@ -5752,7 +5752,7 @@ class mt {
5752
5752
  Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
5753
5753
  */
5754
5754
  get tr() {
5755
- return new Ma(this);
5755
+ return new Sa(this);
5756
5756
  }
5757
5757
  /**
5758
5758
  Create a new state.
@@ -5889,18 +5889,18 @@ let Mr = null;
5889
5889
  const Te = function(n, e, t) {
5890
5890
  let r = Mr || (Mr = document.createRange());
5891
5891
  return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
5892
- }, Ca = function() {
5892
+ }, wa = function() {
5893
5893
  Mr = null;
5894
5894
  }, ot = function(n, e, t, r) {
5895
5895
  return t && (vi(n, e, t, r, -1) || vi(n, e, t, r, 1));
5896
- }, Ta = /^(img|br|input|textarea|hr)$/i;
5896
+ }, Ca = /^(img|br|input|textarea|hr)$/i;
5897
5897
  function vi(n, e, t, r, i) {
5898
5898
  for (var s; ; ) {
5899
5899
  if (n == t && e == r)
5900
5900
  return !0;
5901
5901
  if (e == (i < 0 ? 0 : fe(n))) {
5902
5902
  let o = n.parentNode;
5903
- if (!o || o.nodeType != 1 || Yt(n) || Ta.test(n.nodeName) || n.contentEditable == "false")
5903
+ if (!o || o.nodeType != 1 || Yt(n) || Ca.test(n.nodeName) || n.contentEditable == "false")
5904
5904
  return !1;
5905
5905
  e = J(n) + (i < 0 ? 0 : 1), n = o;
5906
5906
  } else if (n.nodeType == 1) {
@@ -5919,7 +5919,7 @@ function vi(n, e, t, r, i) {
5919
5919
  function fe(n) {
5920
5920
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
5921
5921
  }
5922
- function Oa(n, e) {
5922
+ function Ta(n, e) {
5923
5923
  for (; ; ) {
5924
5924
  if (n.nodeType == 3 && e)
5925
5925
  return n;
@@ -5933,7 +5933,7 @@ function Oa(n, e) {
5933
5933
  return null;
5934
5934
  }
5935
5935
  }
5936
- function va(n, e) {
5936
+ function Oa(n, e) {
5937
5937
  for (; ; ) {
5938
5938
  if (n.nodeType == 3 && e < n.nodeValue.length)
5939
5939
  return n;
@@ -5947,7 +5947,7 @@ function va(n, e) {
5947
5947
  return null;
5948
5948
  }
5949
5949
  }
5950
- function Ea(n, e, t) {
5950
+ function va(n, e, t) {
5951
5951
  for (let r = e == 0, i = e == fe(n); r || i; ) {
5952
5952
  if (n == t)
5953
5953
  return !0;
@@ -5970,13 +5970,13 @@ function Ue(n, e) {
5970
5970
  let t = document.createEvent("Event");
5971
5971
  return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
5972
5972
  }
5973
- function Na(n) {
5973
+ function Ea(n) {
5974
5974
  let e = n.activeElement;
5975
5975
  for (; e && e.shadowRoot; )
5976
5976
  e = e.shadowRoot.activeElement;
5977
5977
  return e;
5978
5978
  }
5979
- function Aa(n, e, t) {
5979
+ function Na(n, e, t) {
5980
5980
  if (n.caretPositionFromPoint)
5981
5981
  try {
5982
5982
  let r = n.caretPositionFromPoint(e, t);
@@ -5992,8 +5992,8 @@ function Aa(n, e, t) {
5992
5992
  }
5993
5993
  const xe = typeof navigator < "u" ? navigator : null, Ei = 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);
5994
5994
  pe && +(/Firefox\/(\d+)/.exec(Ke) || [0, 0])[1];
5995
- const Tr = !ie && /Chrome\/(\d+)/.exec(Ke), _ = !!Tr, io = Tr ? +Tr[1] : 0, Z = !ie && !!xe && /Apple Computer/.test(xe.vendor), Mt = Z && (/Mobile\/\w+/.test(Ke) || !!xe && xe.maxTouchPoints > 2), ue = Mt || (xe ? /Mac/.test(xe.platform) : !1), so = xe ? /Win/.test(xe.platform) : !1, ve = /Android \d/.test(Ke), Zt = !!Ei && "webkitFontSmoothing" in Ei.documentElement.style, Da = Zt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5996
- function Ia(n) {
5995
+ const Tr = !ie && /Chrome\/(\d+)/.exec(Ke), _ = !!Tr, io = Tr ? +Tr[1] : 0, Z = !ie && !!xe && /Apple Computer/.test(xe.vendor), Mt = Z && (/Mobile\/\w+/.test(Ke) || !!xe && xe.maxTouchPoints > 2), ue = Mt || (xe ? /Mac/.test(xe.platform) : !1), so = xe ? /Win/.test(xe.platform) : !1, ve = /Android \d/.test(Ke), Zt = !!Ei && "webkitFontSmoothing" in Ei.documentElement.style, Aa = Zt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5996
+ function Da(n) {
5997
5997
  let e = n.defaultView && n.defaultView.visualViewport;
5998
5998
  return e ? {
5999
5999
  left: 0,
@@ -6010,7 +6010,7 @@ function Ia(n) {
6010
6010
  function Ce(n, e) {
6011
6011
  return typeof n == "number" ? n : n[e];
6012
6012
  }
6013
- function Ra(n) {
6013
+ function Ia(n) {
6014
6014
  let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, r = e.height / n.offsetHeight || 1;
6015
6015
  return {
6016
6016
  left: e.left,
@@ -6026,7 +6026,7 @@ function Ni(n, e, t) {
6026
6026
  o = St(o);
6027
6027
  continue;
6028
6028
  }
6029
- let l = o, a = l == s.body, c = a ? Ia(s) : Ra(l), d = 0, u = 0;
6029
+ let l = o, a = l == s.body, c = a ? Da(s) : Ia(l), d = 0, u = 0;
6030
6030
  if (e.top < c.top + Ce(r, "top") ? u = -(c.top - e.top + Ce(i, "top")) : e.bottom > c.bottom - Ce(r, "bottom") && (u = e.bottom - e.top > c.bottom - c.top ? e.top + Ce(i, "top") - c.top : e.bottom - c.bottom + Ce(i, "bottom")), e.left < c.left + Ce(r, "left") ? d = -(c.left - e.left + Ce(i, "left")) : e.right > c.right - Ce(r, "right") && (d = e.right - c.right + Ce(i, "right")), d || u)
6031
6031
  if (a)
6032
6032
  s.defaultView.scrollBy(d, u);
@@ -6042,7 +6042,7 @@ function Ni(n, e, t) {
6042
6042
  o = f == "absolute" ? o.offsetParent : St(o);
6043
6043
  }
6044
6044
  }
6045
- function Pa(n) {
6045
+ function Ra(n) {
6046
6046
  let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), r, i;
6047
6047
  for (let s = (e.left + e.right) / 2, o = t + 1; o < Math.min(innerHeight, e.bottom); o += 5) {
6048
6048
  let l = n.root.elementFromPoint(s, o);
@@ -6062,7 +6062,7 @@ function oo(n) {
6062
6062
  ;
6063
6063
  return e;
6064
6064
  }
6065
- function Ba({ refDOM: n, refTop: e, stack: t }) {
6065
+ function Pa({ refDOM: n, refTop: e, stack: t }) {
6066
6066
  let r = n ? n.getBoundingClientRect().top : 0;
6067
6067
  lo(t, r == 0 ? 0 : r - e);
6068
6068
  }
@@ -6073,7 +6073,7 @@ function lo(n, e) {
6073
6073
  }
6074
6074
  }
6075
6075
  let ut = null;
6076
- function La(n) {
6076
+ function Ba(n) {
6077
6077
  if (n.setActive)
6078
6078
  return n.setActive();
6079
6079
  if (ut)
@@ -6111,9 +6111,9 @@ function ao(n, e) {
6111
6111
  !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (s = u + 1);
6112
6112
  }
6113
6113
  }
6114
- return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? za(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : ao(t, i);
6114
+ return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? La(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : ao(t, i);
6115
6115
  }
6116
- function za(n, e) {
6116
+ function La(n, e) {
6117
6117
  let t = n.nodeValue.length, r = document.createRange(), i;
6118
6118
  for (let s = 0; s < t; s++) {
6119
6119
  r.setEnd(n, s + 1), r.setStart(n, s);
@@ -6128,11 +6128,11 @@ function za(n, e) {
6128
6128
  function Hr(n, e) {
6129
6129
  return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
6130
6130
  }
6131
- function Fa(n, e) {
6131
+ function za(n, e) {
6132
6132
  let t = n.parentNode;
6133
6133
  return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
6134
6134
  }
6135
- function $a(n, e, t) {
6135
+ function Fa(n, e, t) {
6136
6136
  let { node: r, offset: i } = ao(e, t), s = -1;
6137
6137
  if (r.nodeType == 1 && !r.firstChild) {
6138
6138
  let o = r.getBoundingClientRect();
@@ -6140,7 +6140,7 @@ function $a(n, e, t) {
6140
6140
  }
6141
6141
  return n.docView.posFromDOM(r, i, s);
6142
6142
  }
6143
- function Va(n, e, t, r) {
6143
+ function $a(n, e, t, r) {
6144
6144
  let i = -1;
6145
6145
  for (let s = e, o = !1; s != n.dom; ) {
6146
6146
  let l = n.docView.nearestDesc(s, !0), a;
@@ -6171,8 +6171,8 @@ function co(n, e, t) {
6171
6171
  }
6172
6172
  return n;
6173
6173
  }
6174
- function Ha(n, e) {
6175
- let t = n.dom.ownerDocument, r, i = 0, s = Aa(t, e.left, e.top);
6174
+ function Va(n, e) {
6175
+ let t = n.dom.ownerDocument, r, i = 0, s = Na(t, e.left, e.top);
6176
6176
  s && ({ node: r, offset: i } = s);
6177
6177
  let o = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
6178
6178
  if (!o || !n.dom.contains(o.nodeType != 1 ? o.parentNode : o)) {
@@ -6183,15 +6183,15 @@ function Ha(n, e) {
6183
6183
  if (Z)
6184
6184
  for (let c = o; r && c; c = St(c))
6185
6185
  c.draggable && (r = void 0);
6186
- if (o = Fa(o, e), r) {
6186
+ if (o = za(o, e), r) {
6187
6187
  if (pe && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
6188
6188
  let d = r.childNodes[i], u;
6189
6189
  d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && i++;
6190
6190
  }
6191
6191
  let c;
6192
- Zt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = Va(n, r, i, e));
6192
+ Zt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = $a(n, r, i, e));
6193
6193
  }
6194
- l == null && (l = $a(n, o, e));
6194
+ l == null && (l = Fa(n, o, e));
6195
6195
  let a = n.docView.nearestDesc(o, !0);
6196
6196
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
6197
6197
  }
@@ -6207,11 +6207,11 @@ function De(n, e) {
6207
6207
  }
6208
6208
  return Array.prototype.find.call(t, Ai) || n.getBoundingClientRect();
6209
6209
  }
6210
- const Wa = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6210
+ const Ha = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
6211
6211
  function uo(n, e, t) {
6212
6212
  let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Zt || pe;
6213
6213
  if (r.nodeType == 3)
6214
- if (o && (Wa.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
6214
+ if (o && (Ha.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
6215
6215
  let a = De(Te(r, i, i), t);
6216
6216
  if (pe && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
6217
6217
  let c = De(Te(r, i - 1, i - 1), -1);
@@ -6275,7 +6275,7 @@ function fo(n, e, t) {
6275
6275
  r != e && n.updateState(r), i != n.dom && i && i.focus();
6276
6276
  }
6277
6277
  }
6278
- function qa(n, e, t) {
6278
+ function Wa(n, e, t) {
6279
6279
  let r = e.selection, i = t == "up" ? r.$from : r.$to;
6280
6280
  return fo(n, e, () => {
6281
6281
  let { node: s } = n.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
@@ -6307,13 +6307,13 @@ function qa(n, e, t) {
6307
6307
  return !0;
6308
6308
  });
6309
6309
  }
6310
- const ja = /[\u0590-\u08ac]/;
6311
- function Ka(n, e, t) {
6310
+ const qa = /[\u0590-\u08ac]/;
6311
+ function ja(n, e, t) {
6312
6312
  let { $head: r } = e.selection;
6313
6313
  if (!r.parent.isTextblock)
6314
6314
  return !1;
6315
6315
  let i = r.parentOffset, s = !i, o = i == r.parent.content.size, l = n.domSelection();
6316
- return l ? !ja.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : fo(n, e, () => {
6316
+ return l ? !qa.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : fo(n, e, () => {
6317
6317
  let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: u } = n.domSelectionRange(), f = l.caretBidiLevel;
6318
6318
  l.modify("move", t, "character");
6319
6319
  let h = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: m } = n.domSelectionRange(), g = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
@@ -6325,8 +6325,8 @@ function Ka(n, e, t) {
6325
6325
  }) : r.pos == r.start() || r.pos == r.end();
6326
6326
  }
6327
6327
  let Di = null, Ii = null, Ri = !1;
6328
- function Ja(n, e, t) {
6329
- return Di == e && Ii == t ? Ri : (Di = e, Ii = t, Ri = t == "up" || t == "down" ? qa(n, e, t) : Ka(n, e, t));
6328
+ function Ka(n, e, t) {
6329
+ return Di == e && Ii == t ? Ri : (Di = e, Ii = t, Ri = t == "up" || t == "down" ? Wa(n, e, t) : ja(n, e, t));
6330
6330
  }
6331
6331
  const me = 0, Pi = 1, Ge = 2, Se = 3;
6332
6332
  class Qt {
@@ -6716,7 +6716,7 @@ class ho extends Qt {
6716
6716
  return this.widget.type.side;
6717
6717
  }
6718
6718
  }
6719
- class Ua extends Qt {
6719
+ class Ja extends Qt {
6720
6720
  constructor(e, t, r, i) {
6721
6721
  super(e, [], t, null), this.textDOM = r, this.text = i;
6722
6722
  }
@@ -6797,7 +6797,7 @@ class He extends Qt {
6797
6797
  } else d || ({ dom: d, contentDOM: u } = dt.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6798
6798
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
6799
6799
  let f = d;
6800
- return d = yo(d, r, t), c ? a = new _a(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);
6800
+ 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);
6801
6801
  }
6802
6802
  parseRule() {
6803
6803
  if (this.node.type.spec.reparseInView)
@@ -6833,14 +6833,14 @@ class He extends Qt {
6833
6833
  // separate step, syncs the DOM inside `this.contentDOM` to
6834
6834
  // `this.children`.
6835
6835
  updateChildren(e, t) {
6836
- let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new Xa(this, o && o.node, e);
6837
- Qa(this.node, this.innerDeco, (c, d, u) => {
6836
+ let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new Ga(this, o && o.node, e);
6837
+ Za(this.node, this.innerDeco, (c, d, u) => {
6838
6838
  c.spec.marks ? a.syncToMarks(c.spec.marks, r, e, d) : c.type.side >= 0 && !u && a.syncToMarks(d == this.node.childCount ? A.none : this.node.child(d).marks, r, e, d), a.placeWidget(c, e, i);
6839
6839
  }, (c, d, u, f) => {
6840
6840
  a.syncToMarks(c.marks, r, e, f);
6841
6841
  let h;
6842
6842
  a.findNodeMatch(c, d, u, f) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (h = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, u, h, e) || a.updateNextNode(c, d, u, e, f, i) || a.addNode(c, d, u, e, i), i += c.nodeSize;
6843
- }), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ge) && (o && this.protectLocalComposition(e, o), mo(this.contentDOM, this.children, e), Mt && ec(this.dom));
6843
+ }), a.syncToMarks([], r, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ge) && (o && this.protectLocalComposition(e, o), mo(this.contentDOM, this.children, e), Mt && Qa(this.dom));
6844
6844
  }
6845
6845
  localCompositionInfo(e, t) {
6846
6846
  let { from: r, to: i } = e.state.selection;
@@ -6850,7 +6850,7 @@ class He extends Qt {
6850
6850
  if (!s || !this.dom.contains(s.parentNode))
6851
6851
  return null;
6852
6852
  if (this.node.inlineContent) {
6853
- let o = s.nodeValue, l = tc(this.node.content, o, r - t, i - t);
6853
+ let o = s.nodeValue, l = ec(this.node.content, o, r - t, i - t);
6854
6854
  return l < 0 ? null : { node: s, pos: l, text: o };
6855
6855
  } else
6856
6856
  return { node: s, pos: -1, text: "" };
@@ -6866,7 +6866,7 @@ class He extends Qt {
6866
6866
  s.parentNode.removeChild(s.nextSibling);
6867
6867
  s.pmViewDesc && (s.pmViewDesc = void 0);
6868
6868
  }
6869
- let o = new Ua(this, s, t, i);
6869
+ let o = new Ja(this, s, t, i);
6870
6870
  e.input.compositionNodes.push(o), this.children = vr(this.children, r, r + i.length, e, o);
6871
6871
  }
6872
6872
  // If this desc must be updated to match the given node decoration,
@@ -6957,7 +6957,7 @@ class po extends Qt {
6957
6957
  return this.dom.nodeName == "IMG";
6958
6958
  }
6959
6959
  }
6960
- class _a extends He {
6960
+ class Ua extends He {
6961
6961
  constructor(e, t, r, i, s, o, l, a, c, d) {
6962
6962
  super(e, t, r, i, s, o, l, c, d), this.spec = a;
6963
6963
  }
@@ -7041,11 +7041,11 @@ function go(n, e, t, r) {
7041
7041
  let a;
7042
7042
  l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Xe[0]), i = a;
7043
7043
  }
7044
- Ga(i, l || Xe[0], o);
7044
+ _a(i, l || Xe[0], o);
7045
7045
  }
7046
7046
  return i;
7047
7047
  }
7048
- function Ga(n, e, t) {
7048
+ function _a(n, e, t) {
7049
7049
  for (let r in e)
7050
7050
  r != "class" && r != "style" && r != "nodeName" && !(r in t) && n.removeAttribute(r);
7051
7051
  for (let r in t)
@@ -7082,9 +7082,9 @@ function Li(n) {
7082
7082
  let e = n.nextSibling;
7083
7083
  return n.parentNode.removeChild(n), e;
7084
7084
  }
7085
- class Xa {
7085
+ class Ga {
7086
7086
  constructor(e, t, r) {
7087
- this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Ya(e.node.content, e);
7087
+ this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Xa(e.node.content, e);
7088
7088
  }
7089
7089
  // Destroy and remove the children between the given indices in
7090
7090
  // `this.top`.
@@ -7233,7 +7233,7 @@ class Xa {
7233
7233
  return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
7234
7234
  }
7235
7235
  }
7236
- function Ya(n, e) {
7236
+ function Xa(n, e) {
7237
7237
  let t = e, r = t.children.length, i = n.childCount, s = /* @__PURE__ */ new Map(), o = [];
7238
7238
  e: for (; i > 0; ) {
7239
7239
  let l;
@@ -7260,10 +7260,10 @@ function Ya(n, e) {
7260
7260
  }
7261
7261
  return { index: i, matched: s, matches: o.reverse() };
7262
7262
  }
7263
- function Za(n, e) {
7263
+ function Ya(n, e) {
7264
7264
  return n.type.side - e.type.side;
7265
7265
  }
7266
- function Qa(n, e, t, r) {
7266
+ function Za(n, e, t, r) {
7267
7267
  let i = e.locals(n), s = 0;
7268
7268
  if (i.length == 0) {
7269
7269
  for (let c = 0; c < n.childCount; c++) {
@@ -7281,7 +7281,7 @@ function Qa(n, e, t, r) {
7281
7281
  }
7282
7282
  if (d)
7283
7283
  if (u) {
7284
- u.sort(Za);
7284
+ u.sort(Ya);
7285
7285
  for (let g = 0; g < u.length; g++)
7286
7286
  t(u[g], c, !!a);
7287
7287
  } else
@@ -7311,13 +7311,13 @@ function Qa(n, e, t, r) {
7311
7311
  r(f, m, e.forChild(s, f), h), s = p;
7312
7312
  }
7313
7313
  }
7314
- function ec(n) {
7314
+ function Qa(n) {
7315
7315
  if (n.nodeName == "UL" || n.nodeName == "OL") {
7316
7316
  let e = n.style.cssText;
7317
7317
  n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
7318
7318
  }
7319
7319
  }
7320
- function tc(n, e, t, r) {
7320
+ function ec(n, e, t, r) {
7321
7321
  for (let i = 0, s = 0; i < n.childCount && s <= r; ) {
7322
7322
  let o = n.child(i++), l = s;
7323
7323
  if (s += o.nodeSize, !o.isText)
@@ -7361,7 +7361,7 @@ function Wr(n, e = null) {
7361
7361
  for (a = o; i && !i.node; )
7362
7362
  i = i.parent;
7363
7363
  let u = i.node;
7364
- if (i && u.isAtom && S.isSelectable(u) && i.parent && !(u.isInline && Ea(t.focusNode, t.focusOffset, i.dom))) {
7364
+ if (i && u.isAtom && S.isSelectable(u) && i.parent && !(u.isInline && va(t.focusNode, t.focusOffset, i.dom))) {
7365
7365
  let f = i.posBefore;
7366
7366
  c = new S(o == f ? l : r.resolve(f));
7367
7367
  }
@@ -7401,10 +7401,10 @@ function Ne(n, e = !1) {
7401
7401
  }
7402
7402
  }
7403
7403
  if (n.domObserver.disconnectSelection(), n.cursorWrapper)
7404
- rc(n);
7404
+ nc(n);
7405
7405
  else {
7406
7406
  let { anchor: r, head: i } = t, s, o;
7407
- zi && !(t instanceof M) && (t.$from.parent.inlineContent || (s = Fi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = Fi(n, t.to))), n.docView.setSelection(r, i, n, e), zi && (s && $i(s), o && $i(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && nc(n));
7407
+ zi && !(t instanceof M) && (t.$from.parent.inlineContent || (s = Fi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = Fi(n, t.to))), n.docView.setSelection(r, i, n, e), zi && (s && $i(s), o && $i(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && tc(n));
7408
7408
  }
7409
7409
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
7410
7410
  }
@@ -7427,7 +7427,7 @@ function nr(n) {
7427
7427
  function $i(n) {
7428
7428
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
7429
7429
  }
7430
- function nc(n) {
7430
+ function tc(n) {
7431
7431
  let e = n.dom.ownerDocument;
7432
7432
  e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
7433
7433
  let t = n.domSelectionRange(), r = t.anchorNode, i = t.anchorOffset;
@@ -7437,7 +7437,7 @@ function nc(n) {
7437
7437
  }, 20));
7438
7438
  });
7439
7439
  }
7440
- function rc(n) {
7440
+ function nc(n) {
7441
7441
  let e = n.domSelection();
7442
7442
  if (!e)
7443
7443
  return;
@@ -7470,7 +7470,7 @@ function xo(n) {
7470
7470
  return !1;
7471
7471
  }
7472
7472
  }
7473
- function ic(n) {
7473
+ function rc(n) {
7474
7474
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
7475
7475
  return ot(e.node, e.offset, t.anchorNode, t.anchorOffset);
7476
7476
  }
@@ -7519,9 +7519,9 @@ function Rt(n, e) {
7519
7519
  return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
7520
7520
  }
7521
7521
  function ft(n, e) {
7522
- return e < 0 ? sc(n) : oc(n);
7522
+ return e < 0 ? ic(n) : sc(n);
7523
7523
  }
7524
- function sc(n) {
7524
+ function ic(n) {
7525
7525
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7526
7526
  if (!t)
7527
7527
  return;
@@ -7557,7 +7557,7 @@ function sc(n) {
7557
7557
  }
7558
7558
  o ? Nr(n, t, r) : i && Nr(n, i, s);
7559
7559
  }
7560
- function oc(n) {
7560
+ function sc(n) {
7561
7561
  let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
7562
7562
  if (!t)
7563
7563
  return;
@@ -7593,7 +7593,7 @@ function So(n) {
7593
7593
  let e = n.pmViewDesc;
7594
7594
  return e && e.node && e.node.isBlock;
7595
7595
  }
7596
- function lc(n, e) {
7596
+ function oc(n, e) {
7597
7597
  for (; n && e == n.childNodes.length && !Yt(n); )
7598
7598
  e = J(n) + 1, n = n.parentNode;
7599
7599
  for (; n && e < n.childNodes.length; ) {
@@ -7605,7 +7605,7 @@ function lc(n, e) {
7605
7605
  n = t, e = 0;
7606
7606
  }
7607
7607
  }
7608
- function ac(n, e) {
7608
+ function lc(n, e) {
7609
7609
  for (; n && !e && !Yt(n); )
7610
7610
  e = J(n), n = n.parentNode;
7611
7611
  for (; n && e; ) {
@@ -7620,7 +7620,7 @@ function ac(n, e) {
7620
7620
  function Nr(n, e, t) {
7621
7621
  if (e.nodeType != 3) {
7622
7622
  let s, o;
7623
- (o = lc(e, t)) ? (e = o, t = 0) : (s = ac(e, t)) && (e = s, t = s.nodeValue.length);
7623
+ (o = oc(e, t)) ? (e = o, t = 0) : (s = lc(e, t)) && (e = s, t = s.nodeValue.length);
7624
7624
  }
7625
7625
  let r = n.domSelection();
7626
7626
  if (!r)
@@ -7688,7 +7688,7 @@ function Ki(n, e) {
7688
7688
  function Ji(n, e, t) {
7689
7689
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
7690
7690
  }
7691
- function cc(n) {
7691
+ function ac(n) {
7692
7692
  if (!Z || n.state.selection.$head.parentOffset > 0)
7693
7693
  return !1;
7694
7694
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
@@ -7698,12 +7698,12 @@ function cc(n) {
7698
7698
  }
7699
7699
  return !1;
7700
7700
  }
7701
- function dc(n) {
7701
+ function cc(n) {
7702
7702
  let e = "";
7703
7703
  return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
7704
7704
  }
7705
- function uc(n, e) {
7706
- let t = e.keyCode, r = dc(e);
7705
+ function dc(n, e) {
7706
+ let t = e.keyCode, r = cc(e);
7707
7707
  if (t == 8 || ue && t == 72 && r == "c")
7708
7708
  return Ki(n, -1) || ft(n, -1);
7709
7709
  if (t == 46 && !e.shiftKey || ue && t == 68 && r == "c")
@@ -7720,7 +7720,7 @@ function uc(n, e) {
7720
7720
  if (t == 38 || ue && t == 80 && r == "c")
7721
7721
  return ji(n, -1, r) || ft(n, -1);
7722
7722
  if (t == 40 || ue && t == 78 && r == "c")
7723
- return cc(n) || ji(n, 1, r) || ft(n, 1);
7723
+ return ac(n) || ji(n, 1, r) || ft(n, 1);
7724
7724
  if (r == (ue ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
7725
7725
  return !0;
7726
7726
  }
@@ -7780,7 +7780,7 @@ function Mo(n, e, t, r, i) {
7780
7780
  } else
7781
7781
  n.someProp("transformPastedHTML", (u) => {
7782
7782
  t = u(t, n);
7783
- }), o = mc(t), Zt && gc(o);
7783
+ }), o = pc(t), Zt && mc(o);
7784
7784
  let c = o && o.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
7785
7785
  if (d && d[3])
7786
7786
  for (let u = +d[3]; u > 0; u--) {
@@ -7795,11 +7795,11 @@ function Mo(n, e, t, r, i) {
7795
7795
  preserveWhitespace: !!(a || d),
7796
7796
  context: i,
7797
7797
  ruleFromNode(f) {
7798
- return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !fc.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7798
+ return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !uc.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
7799
7799
  }
7800
7800
  })), d)
7801
- l = yc(Ui(l, +d[1], +d[2]), d[4]);
7802
- else if (l = k.maxOpen(hc(l.content, i), !0), l.openStart || l.openEnd) {
7801
+ l = gc(Ui(l, +d[1], +d[2]), d[4]);
7802
+ else if (l = k.maxOpen(fc(l.content, i), !0), l.openStart || l.openEnd) {
7803
7803
  let u = 0, f = 0;
7804
7804
  for (let h = l.content.firstChild; u < l.openStart && !h.type.spec.isolating; u++, h = h.firstChild)
7805
7805
  ;
@@ -7811,8 +7811,8 @@ function Mo(n, e, t, r, i) {
7811
7811
  l = u(l, n, a);
7812
7812
  }), l;
7813
7813
  }
7814
- const fc = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7815
- function hc(n, e) {
7814
+ const uc = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
7815
+ function fc(n, e) {
7816
7816
  if (n.childCount < 2)
7817
7817
  return n;
7818
7818
  for (let t = e.depth; t >= 0; t--) {
@@ -7878,27 +7878,27 @@ function vo() {
7878
7878
  return _i || (_i = document.implementation.createHTMLDocument("title"));
7879
7879
  }
7880
7880
  let rr = null;
7881
- function pc(n) {
7881
+ function hc(n) {
7882
7882
  let e = window.trustedTypes;
7883
7883
  return e ? (rr || (rr = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), rr.createHTML(n)) : n;
7884
7884
  }
7885
- function mc(n) {
7885
+ function pc(n) {
7886
7886
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
7887
7887
  e && (n = n.slice(e[0].length));
7888
7888
  let t = vo().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), i;
7889
- if ((i = r && Oo[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = pc(n), i)
7889
+ if ((i = r && Oo[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = hc(n), i)
7890
7890
  for (let s = 0; s < i.length; s++)
7891
7891
  t = t.querySelector(i[s]) || t;
7892
7892
  return t;
7893
7893
  }
7894
- function gc(n) {
7894
+ function mc(n) {
7895
7895
  let e = n.querySelectorAll(_ ? "span:not([class]):not([style])" : "span.Apple-converted-space");
7896
7896
  for (let t = 0; t < e.length; t++) {
7897
7897
  let r = e[t];
7898
7898
  r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), r);
7899
7899
  }
7900
7900
  }
7901
- function yc(n, e) {
7901
+ function gc(n, e) {
7902
7902
  if (!n.size)
7903
7903
  return n;
7904
7904
  let t = n.content.firstChild.type.schema, r;
@@ -7916,25 +7916,25 @@ function yc(n, e) {
7916
7916
  }
7917
7917
  return new k(i, s, o);
7918
7918
  }
7919
- const ee = {}, te = {}, bc = { touchstart: !0, touchmove: !0 };
7920
- class kc {
7919
+ const ee = {}, te = {}, yc = { touchstart: !0, touchmove: !0 };
7920
+ class bc {
7921
7921
  constructor() {
7922
7922
  this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.badSafariComposition = !1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
7923
7923
  }
7924
7924
  }
7925
- function xc(n) {
7925
+ function kc(n) {
7926
7926
  for (let e in ee) {
7927
7927
  let t = ee[e];
7928
7928
  n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
7929
- Mc(n, r) && !Kr(n, r) && (n.editable || !(r.type in te)) && t(n, r);
7930
- }, bc[e] ? { passive: !0 } : void 0);
7929
+ Sc(n, r) && !Kr(n, r) && (n.editable || !(r.type in te)) && t(n, r);
7930
+ }, yc[e] ? { passive: !0 } : void 0);
7931
7931
  }
7932
7932
  Z && n.dom.addEventListener("input", () => null), Dr(n);
7933
7933
  }
7934
7934
  function ze(n, e) {
7935
7935
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
7936
7936
  }
7937
- function Sc(n) {
7937
+ function xc(n) {
7938
7938
  n.domObserver.stop();
7939
7939
  for (let e in n.input.eventHandlers)
7940
7940
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
@@ -7952,7 +7952,7 @@ function Kr(n, e) {
7952
7952
  return r ? r(n, e) || e.defaultPrevented : !1;
7953
7953
  });
7954
7954
  }
7955
- function Mc(n, e) {
7955
+ function Sc(n, e) {
7956
7956
  if (!e.bubbles)
7957
7957
  return !0;
7958
7958
  if (e.defaultPrevented)
@@ -7962,7 +7962,7 @@ function Mc(n, e) {
7962
7962
  return !1;
7963
7963
  return !0;
7964
7964
  }
7965
- function wc(n, e) {
7965
+ function Mc(n, e) {
7966
7966
  !Kr(n, e) && ee[e.type] && (n.editable || !(e.type in te)) && ee[e.type](n, e);
7967
7967
  }
7968
7968
  te.keydown = (n, e) => {
@@ -7973,7 +7973,7 @@ te.keydown = (n, e) => {
7973
7973
  n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
7974
7974
  n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (i) => i(n, Ue(13, "Enter"))), n.input.lastIOSEnter = 0);
7975
7975
  }, 200);
7976
- } else n.someProp("handleKeyDown", (r) => r(n, t)) || uc(n, t) ? t.preventDefault() : ze(n, "key");
7976
+ } else n.someProp("handleKeyDown", (r) => r(n, t)) || dc(n, t) ? t.preventDefault() : ze(n, "key");
7977
7977
  };
7978
7978
  te.keyup = (n, e) => {
7979
7979
  e.keyCode == 16 && (n.input.shiftKey = !1);
@@ -7995,7 +7995,7 @@ te.keypress = (n, e) => {
7995
7995
  function $n(n) {
7996
7996
  return { left: n.clientX, top: n.clientY };
7997
7997
  }
7998
- function Cc(n, e) {
7998
+ function wc(n, e) {
7999
7999
  let t = e.x - n.clientX, r = e.y - n.clientY;
8000
8000
  return t * t + r * r < 100;
8001
8001
  }
@@ -8014,13 +8014,13 @@ function kt(n, e, t) {
8014
8014
  let r = n.state.tr.setSelection(e);
8015
8015
  r.setMeta("pointer", !0), n.dispatch(r);
8016
8016
  }
8017
- function Tc(n, e) {
8017
+ function Cc(n, e) {
8018
8018
  if (e == -1)
8019
8019
  return !1;
8020
8020
  let t = n.state.doc.resolve(e), r = t.nodeAfter;
8021
8021
  return r && r.isAtom && S.isSelectable(r) ? (kt(n, new S(t)), !0) : !1;
8022
8022
  }
8023
- function Oc(n, e) {
8023
+ function Tc(n, e) {
8024
8024
  if (e == -1)
8025
8025
  return !1;
8026
8026
  let t = n.state.selection, r, i;
@@ -8035,16 +8035,16 @@ function Oc(n, e) {
8035
8035
  }
8036
8036
  return i != null ? (kt(n, S.create(n.state.doc, i)), !0) : !1;
8037
8037
  }
8038
- function vc(n, e, t, r, i) {
8039
- return Jr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? Oc(n, t) : Tc(n, t));
8038
+ function Oc(n, e, t, r, i) {
8039
+ return Jr(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? Tc(n, t) : Cc(n, t));
8040
8040
  }
8041
- function Ec(n, e, t, r) {
8041
+ function vc(n, e, t, r) {
8042
8042
  return Jr(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (i) => i(n, e, r));
8043
8043
  }
8044
- function Nc(n, e, t, r) {
8045
- return Jr(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || Ac(n, t, r);
8044
+ function Ec(n, e, t, r) {
8045
+ return Jr(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || Nc(n, t, r);
8046
8046
  }
8047
- function Ac(n, e, t) {
8047
+ function Nc(n, e, t) {
8048
8048
  if (t.button != 0)
8049
8049
  return !1;
8050
8050
  let r = n.state.doc;
@@ -8070,11 +8070,11 @@ ee.mousedown = (n, e) => {
8070
8070
  let t = e;
8071
8071
  n.input.shiftKey = t.shiftKey;
8072
8072
  let r = Ur(n), i = Date.now(), s = "singleClick";
8073
- i - n.input.lastClick.time < 500 && Cc(t, n.input.lastClick) && !t[Eo] && 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 };
8073
+ i - n.input.lastClick.time < 500 && wc(t, n.input.lastClick) && !t[Eo] && 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 };
8074
8074
  let o = n.posAtCoords($n(t));
8075
- o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Dc(n, o, t, !!r)) : (s == "doubleClick" ? Ec : Nc)(n, o.pos, o.inside, t) ? t.preventDefault() : ze(n, "pointer"));
8075
+ o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Ac(n, o, t, !!r)) : (s == "doubleClick" ? vc : Ec)(n, o.pos, o.inside, t) ? t.preventDefault() : ze(n, "pointer"));
8076
8076
  };
8077
- class Dc {
8077
+ class Ac {
8078
8078
  constructor(e, t, r, i) {
8079
8079
  this.view = e, this.pos = t, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[Eo], this.allowDefault = r.shiftKey;
8080
8080
  let s, o;
@@ -8103,7 +8103,7 @@ class Dc {
8103
8103
  if (this.done(), !this.view.dom.contains(e.target))
8104
8104
  return;
8105
8105
  let t = this.pos;
8106
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords($n(e))), this.updateAllowDefault(e), this.allowDefault || !t ? ze(this.view, "pointer") : vc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
8106
+ 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
8107
8107
  Z && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
8108
8108
  // cursor, but still report that the node is selected
8109
8109
  // when asked through getSelection. You'll then get a
@@ -8130,12 +8130,12 @@ ee.contextmenu = (n) => Ur(n);
8130
8130
  function No(n, e) {
8131
8131
  return n.composing ? !0 : Z && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
8132
8132
  }
8133
- const Ic = ve ? 5e3 : -1;
8133
+ const Dc = ve ? 5e3 : -1;
8134
8134
  te.compositionstart = te.compositionupdate = (n) => {
8135
8135
  if (!n.composing) {
8136
8136
  n.domObserver.flush();
8137
8137
  let { state: e } = n, t = e.selection.$to;
8138
- if (e.selection instanceof M && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || _ && so && Rc(n)))
8138
+ if (e.selection instanceof M && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || _ && so && Ic(n)))
8139
8139
  n.markCursor = n.state.storedMarks || t.marks(), Mn(n, !0), n.markCursor = null;
8140
8140
  else if (Mn(n, !e.selection.empty), pe && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
8141
8141
  let r = n.domSelectionRange();
@@ -8153,9 +8153,9 @@ te.compositionstart = te.compositionupdate = (n) => {
8153
8153
  }
8154
8154
  n.input.composing = !0;
8155
8155
  }
8156
- Ao(n, Ic);
8156
+ Ao(n, Dc);
8157
8157
  };
8158
- function Rc(n) {
8158
+ function Ic(n) {
8159
8159
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
8160
8160
  if (!e || e.nodeType != 1 || t >= e.childNodes.length)
8161
8161
  return !1;
@@ -8169,14 +8169,14 @@ function Ao(n, e) {
8169
8169
  clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Mn(n), e));
8170
8170
  }
8171
8171
  function Do(n) {
8172
- for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Bc()); n.input.compositionNodes.length > 0; )
8172
+ for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Pc()); n.input.compositionNodes.length > 0; )
8173
8173
  n.input.compositionNodes.pop().markParentsDirty();
8174
8174
  }
8175
- function Pc(n) {
8175
+ function Rc(n) {
8176
8176
  let e = n.domSelectionRange();
8177
8177
  if (!e.focusNode)
8178
8178
  return null;
8179
- let t = Oa(e.focusNode, e.focusOffset), r = va(e.focusNode, e.focusOffset);
8179
+ let t = Ta(e.focusNode, e.focusOffset), r = Oa(e.focusNode, e.focusOffset);
8180
8180
  if (t && r && t != r) {
8181
8181
  let i = r.pmViewDesc, s = n.domObserver.lastChangedTextNode;
8182
8182
  if (t == s || r == s)
@@ -8191,7 +8191,7 @@ function Pc(n) {
8191
8191
  }
8192
8192
  return t || r;
8193
8193
  }
8194
- function Bc() {
8194
+ function Pc() {
8195
8195
  let n = document.createEvent("Event");
8196
8196
  return n.initEvent("event", !0, !0), n.timeStamp;
8197
8197
  }
@@ -8204,7 +8204,7 @@ function Mn(n, e = !1) {
8204
8204
  return !1;
8205
8205
  }
8206
8206
  }
8207
- function Lc(n, e) {
8207
+ function Bc(n, e) {
8208
8208
  if (!n.dom.parentNode)
8209
8209
  return;
8210
8210
  let t = n.dom.parentNode.appendChild(document.createElement("div"));
@@ -8214,18 +8214,18 @@ function Lc(n, e) {
8214
8214
  t.parentNode && t.parentNode.removeChild(t), n.focus();
8215
8215
  }, 50);
8216
8216
  }
8217
- const Ft = ie && Ve < 15 || Mt && Da < 604;
8217
+ const Ft = ie && Ve < 15 || Mt && Aa < 604;
8218
8218
  ee.copy = te.cut = (n, e) => {
8219
8219
  let t = e, r = n.state.selection, i = t.type == "cut";
8220
8220
  if (r.empty)
8221
8221
  return;
8222
8222
  let s = Ft ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = jr(n, o);
8223
- s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Lc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8223
+ s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Bc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8224
8224
  };
8225
- function zc(n) {
8225
+ function Lc(n) {
8226
8226
  return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
8227
8227
  }
8228
- function Fc(n, e) {
8228
+ function zc(n, e) {
8229
8229
  if (!n.dom.parentNode)
8230
8230
  return;
8231
8231
  let t = n.input.shiftKey || n.state.selection.$from.parent.type.spec.code, r = n.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
@@ -8241,7 +8241,7 @@ function $t(n, e, t, r, i) {
8241
8241
  return !0;
8242
8242
  if (!s)
8243
8243
  return !1;
8244
- let o = zc(s), l = o ? n.state.tr.replaceSelectionWith(o, r) : n.state.tr.replaceSelection(s);
8244
+ let o = Lc(s), l = o ? n.state.tr.replaceSelectionWith(o, r) : n.state.tr.replaceSelection(s);
8245
8245
  return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
8246
8246
  }
8247
8247
  function Io(n) {
@@ -8256,19 +8256,19 @@ te.paste = (n, e) => {
8256
8256
  if (n.composing && !ve)
8257
8257
  return;
8258
8258
  let r = Ft ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
8259
- r && $t(n, Io(r), r.getData("text/html"), i, t) ? t.preventDefault() : Fc(n, t);
8259
+ r && $t(n, Io(r), r.getData("text/html"), i, t) ? t.preventDefault() : zc(n, t);
8260
8260
  };
8261
8261
  class Ro {
8262
8262
  constructor(e, t, r) {
8263
8263
  this.slice = e, this.move = t, this.node = r;
8264
8264
  }
8265
8265
  }
8266
- const $c = ue ? "altKey" : "ctrlKey";
8266
+ const Fc = ue ? "altKey" : "ctrlKey";
8267
8267
  function Po(n, e) {
8268
8268
  let t;
8269
8269
  return n.someProp("dragCopies", (r) => {
8270
8270
  t = t || r(e);
8271
- }), t != null ? !t : !e[$c];
8271
+ }), t != null ? !t : !e[Fc];
8272
8272
  }
8273
8273
  ee.dragstart = (n, e) => {
8274
8274
  let t = e, r = n.input.mouseDown;
@@ -8295,12 +8295,12 @@ ee.dragend = (n) => {
8295
8295
  te.dragover = te.dragenter = (n, e) => e.preventDefault();
8296
8296
  te.drop = (n, e) => {
8297
8297
  try {
8298
- Vc(n, e, n.dragging);
8298
+ $c(n, e, n.dragging);
8299
8299
  } finally {
8300
8300
  n.dragging = null;
8301
8301
  }
8302
8302
  };
8303
- function Vc(n, e, t) {
8303
+ function $c(n, e, t) {
8304
8304
  if (!e.dataTransfer)
8305
8305
  return;
8306
8306
  let r = n.posAtCoords($n(e));
@@ -8556,7 +8556,7 @@ class z {
8556
8556
  let a = this.local[l].map(e, r, i);
8557
8557
  a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
8558
8558
  }
8559
- return this.children.length ? Hc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(nt), pt) : Y;
8559
+ return this.children.length ? Vc(this.children, o || [], e, t, r, i, s) : o ? new z(o.sort(nt), pt) : Y;
8560
8560
  }
8561
8561
  /**
8562
8562
  Add the given array of decorations to the ones in the set,
@@ -8734,7 +8734,7 @@ class Pe {
8734
8734
  this.members[t].forEachSet(e);
8735
8735
  }
8736
8736
  }
8737
- function Hc(n, e, t, r, i, s, o) {
8737
+ function Vc(n, e, t, r, i, s, o) {
8738
8738
  let l = n.slice();
8739
8739
  for (let c = 0, d = s; c < t.maps.length; c++) {
8740
8740
  let u = 0;
@@ -8770,7 +8770,7 @@ function Hc(n, e, t, r, i, s, o) {
8770
8770
  a = !0;
8771
8771
  }
8772
8772
  if (a) {
8773
- let c = Wc(l, n, e, t, i, s, o), d = Cn(c, r, 0, o);
8773
+ let c = Hc(l, n, e, t, i, s, o), d = Cn(c, r, 0, o);
8774
8774
  e = d.local;
8775
8775
  for (let u = 0; u < l.length; u += 3)
8776
8776
  l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
@@ -8793,7 +8793,7 @@ function Bo(n, e) {
8793
8793
  }
8794
8794
  return t;
8795
8795
  }
8796
- function Wc(n, e, t, r, i, s, o) {
8796
+ function Hc(n, e, t, r, i, s, o) {
8797
8797
  function l(a, c) {
8798
8798
  for (let d = 0; d < a.local.length; d++) {
8799
8799
  let u = a.local[d].map(r, i, c);
@@ -8868,15 +8868,15 @@ function ir(n) {
8868
8868
  r && r != Y && e.push(r);
8869
8869
  }), n.cursorWrapper && e.push(z.create(n.state.doc, [n.cursorWrapper.deco])), Pe.from(e);
8870
8870
  }
8871
- const qc = {
8871
+ const Wc = {
8872
8872
  childList: !0,
8873
8873
  characterData: !0,
8874
8874
  characterDataOldValue: !0,
8875
8875
  attributes: !0,
8876
8876
  attributeOldValue: !0,
8877
8877
  subtree: !0
8878
- }, jc = ie && Ve <= 11;
8879
- class Kc {
8878
+ }, qc = ie && Ve <= 11;
8879
+ class jc {
8880
8880
  constructor() {
8881
8881
  this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
8882
8882
  }
@@ -8890,13 +8890,13 @@ class Kc {
8890
8890
  return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
8891
8891
  }
8892
8892
  }
8893
- class Jc {
8893
+ class Kc {
8894
8894
  constructor(e, t) {
8895
- this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Kc(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
8895
+ this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new jc(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
8896
8896
  for (let i = 0; i < r.length; i++)
8897
8897
  this.queue.push(r[i]);
8898
8898
  ie && Ve <= 11 && r.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : Z && e.composing && r.some((i) => i.type == "childList" && i.target.nodeName == "TR") ? (e.input.badSafariComposition = !0, this.flushSoon()) : this.flush();
8899
- }), jc && (this.onCharData = (r) => {
8899
+ }), qc && (this.onCharData = (r) => {
8900
8900
  this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
8901
8901
  }), this.onSelectionChange = this.onSelectionChange.bind(this);
8902
8902
  }
@@ -8909,7 +8909,7 @@ class Jc {
8909
8909
  this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
8910
8910
  }
8911
8911
  start() {
8912
- this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, qc)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8912
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, Wc)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8913
8913
  }
8914
8914
  stop() {
8915
8915
  if (this.observer) {
@@ -9004,12 +9004,12 @@ class Jc {
9004
9004
  let { focusNode: u } = this.currentSelection;
9005
9005
  for (let f of d) {
9006
9006
  let h = f.parentNode;
9007
- h && h.nodeName == "LI" && (!u || Gc(e, u) != h) && f.remove();
9007
+ h && h.nodeName == "LI" && (!u || _c(e, u) != h) && f.remove();
9008
9008
  }
9009
9009
  }
9010
9010
  }
9011
9011
  let c = null;
9012
- 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(v.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), Uc(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, Xc(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));
9012
+ 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(v.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));
9013
9013
  }
9014
9014
  registerMutation(e, t) {
9015
9015
  if (t.indexOf(e.target) > -1)
@@ -9045,7 +9045,7 @@ class Jc {
9045
9045
  }
9046
9046
  }
9047
9047
  let Xi = /* @__PURE__ */ new WeakMap(), Yi = !1;
9048
- function Uc(n) {
9048
+ function Jc(n) {
9049
9049
  if (!Xi.has(n) && (Xi.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
9050
9050
  if (n.requiresGeckoHackNode = pe, Yi)
9051
9051
  return;
@@ -9056,7 +9056,7 @@ function Zi(n, e) {
9056
9056
  let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
9057
9057
  return ot(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
9058
9058
  }
9059
- function _c(n, e) {
9059
+ function Uc(n, e) {
9060
9060
  if (e.getComposedRanges) {
9061
9061
  let i = e.getComposedRanges(n.root)[0];
9062
9062
  if (i)
@@ -9068,7 +9068,7 @@ function _c(n, e) {
9068
9068
  }
9069
9069
  return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? Zi(n, t) : null;
9070
9070
  }
9071
- function Gc(n, e) {
9071
+ function _c(n, e) {
9072
9072
  for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
9073
9073
  let r = n.docView.nearestDesc(t, !0);
9074
9074
  if (r && r.node.isBlock)
@@ -9076,7 +9076,7 @@ function Gc(n, e) {
9076
9076
  }
9077
9077
  return null;
9078
9078
  }
9079
- function Xc(n, e) {
9079
+ function Gc(n, e) {
9080
9080
  var t;
9081
9081
  let { focusNode: r, focusOffset: i } = n.domSelectionRange();
9082
9082
  for (let s of e)
@@ -9097,7 +9097,7 @@ function Xc(n, e) {
9097
9097
  s.parentNode.removeChild(s);
9098
9098
  }
9099
9099
  }
9100
- function Yc(n, e, t) {
9100
+ function Xc(n, e, t) {
9101
9101
  let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
9102
9102
  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)
9103
9103
  for (let g = s; g > i; g--) {
@@ -9117,7 +9117,7 @@ function Yc(n, e, t) {
9117
9117
  to: s,
9118
9118
  preserveWhitespace: h.parent.type.whitespace == "pre" ? "full" : !0,
9119
9119
  findPositions: c,
9120
- ruleFromNode: Zc,
9120
+ ruleFromNode: Yc,
9121
9121
  context: h
9122
9122
  });
9123
9123
  if (c && c[0].pos != null) {
@@ -9126,7 +9126,7 @@ function Yc(n, e, t) {
9126
9126
  }
9127
9127
  return { doc: m, sel: p, from: o, to: l };
9128
9128
  }
9129
- function Zc(n) {
9129
+ function Yc(n) {
9130
9130
  let e = n.pmViewDesc;
9131
9131
  if (e)
9132
9132
  return e.parseRule();
@@ -9140,8 +9140,8 @@ function Zc(n) {
9140
9140
  return { ignore: !0 };
9141
9141
  return null;
9142
9142
  }
9143
- const Qc = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
9144
- function ed(n, e, t, r, i) {
9143
+ const Zc = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
9144
+ function Qc(n, e, t, r, i) {
9145
9145
  let s = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
9146
9146
  if (n.input.compositionPendingChanges = 0, e < 0) {
9147
9147
  let C = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, N = Wr(n, C);
@@ -9155,10 +9155,10 @@ function ed(n, e, t, r, i) {
9155
9155
  }
9156
9156
  let o = n.state.doc.resolve(e), l = o.sharedDepth(t);
9157
9157
  e = o.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
9158
- let a = n.state.selection, c = Yc(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, h;
9158
+ let a = n.state.selection, c = Xc(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, h;
9159
9159
  n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, h = "end") : (f = n.state.selection.from, h = "start"), n.input.lastKeyCode = null;
9160
- let p = rd(u.content, c.doc.content, c.from, f, h);
9161
- if (p && n.input.domChangeCount++, (Mt && n.input.lastIOSEnter > Date.now() - 225 || ve) && i.some((C) => C.nodeType == 1 && !Qc.test(C.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (C) => C(n, Ue(13, "Enter")))) {
9160
+ let p = nd(u.content, c.doc.content, c.from, f, h);
9161
+ if (p && n.input.domChangeCount++, (Mt && n.input.lastIOSEnter > Date.now() - 225 || ve) && i.some((C) => C.nodeType == 1 && !Zc.test(C.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (C) => C(n, Ue(13, "Enter")))) {
9162
9162
  n.input.lastIOSEnter = 0;
9163
9163
  return;
9164
9164
  }
@@ -9181,7 +9181,7 @@ function ed(n, e, t, r, i) {
9181
9181
  n.input.lastIOSEnter = 0;
9182
9182
  return;
9183
9183
  }
9184
- if (n.state.selection.anchor > p.start && nd(d, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (C) => C(n, Ue(8, "Backspace")))) {
9184
+ if (n.state.selection.anchor > p.start && td(d, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (C) => C(n, Ue(8, "Backspace")))) {
9185
9185
  ve && _ && n.domObserver.suppressSelectionUpdates();
9186
9186
  return;
9187
9187
  }
@@ -9205,7 +9205,7 @@ function ed(n, e, t, r, i) {
9205
9205
  N && C.ensureMarks(N), n.dispatch(C);
9206
9206
  } else if (
9207
9207
  // Adding or removing a mark
9208
- p.endA == p.endB && (L = td(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
9208
+ p.endA == p.endB && (L = ed(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
9209
9209
  ) {
9210
9210
  let C = D(n.state.tr);
9211
9211
  L.type == "add" ? C.addMark(w, I, L.mark) : C.removeMark(w, I, L.mark), n.dispatch(C);
@@ -9220,7 +9220,7 @@ function ed(n, e, t, r, i) {
9220
9220
  function Qi(n, e, t) {
9221
9221
  return Math.max(t.anchor, t.head) > e.content.size ? null : qr(n, e.resolve(t.anchor), e.resolve(t.head));
9222
9222
  }
9223
- function td(n, e) {
9223
+ function ed(n, e) {
9224
9224
  let t = n.firstChild.marks, r = e.firstChild.marks, i = t, s = r, o, l, a;
9225
9225
  for (let d = 0; d < r.length; d++)
9226
9226
  i = r[d].removeFromSet(i);
@@ -9238,7 +9238,7 @@ function td(n, e) {
9238
9238
  if (b.from(c).eq(n))
9239
9239
  return { mark: l, type: o };
9240
9240
  }
9241
- function nd(n, e, t, r, i) {
9241
+ function td(n, e, t, r, i) {
9242
9242
  if (
9243
9243
  // The content must have shrunk
9244
9244
  t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
@@ -9266,7 +9266,7 @@ function sr(n, e, t) {
9266
9266
  }
9267
9267
  return i;
9268
9268
  }
9269
- function rd(n, e, t, r, i) {
9269
+ function nd(n, e, t, r, i) {
9270
9270
  let s = n.findDiffStart(e, t);
9271
9271
  if (s == null)
9272
9272
  return null;
@@ -9299,7 +9299,7 @@ class Fo {
9299
9299
  added to the document.
9300
9300
  */
9301
9301
  constructor(e, t) {
9302
- 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 kc(), 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 Jc(this, (r, i, s, o) => ed(this, r, i, s, o)), this.domObserver.start(), xc(this), this.updatePluginViews();
9302
+ 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();
9303
9303
  }
9304
9304
  /**
9305
9305
  Holds `true` when a
@@ -9359,22 +9359,22 @@ class Fo {
9359
9359
  let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
9360
9360
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
9361
9361
  let h = is(this);
9362
- sd(h, this.nodeViews) && (this.nodeViews = h, s = !0);
9362
+ id(h, this.nodeViews) && (this.nodeViews = h, s = !0);
9363
9363
  }
9364
9364
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && Dr(this), this.editable = rs(this), ns(this);
9365
9365
  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);
9366
9366
  (u || !e.selection.eq(i.selection)) && (o = !0);
9367
- let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Pa(this);
9367
+ let f = d == "preserve" && o && this.dom.style.overflowAnchor == null && Ra(this);
9368
9368
  if (o) {
9369
9369
  this.domObserver.stop();
9370
- let h = u && (ie || _) && !this.composing && !i.selection.empty && !e.selection.empty && id(i.selection, e.selection);
9370
+ let h = u && (ie || _) && !this.composing && !i.selection.empty && !e.selection.empty && rd(i.selection, e.selection);
9371
9371
  if (u) {
9372
9372
  let p = _ ? this.trackWrites = this.domSelectionRange().focusNode : null;
9373
- this.composing && (this.input.compositionNode = Pc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Bi(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (h = !0);
9373
+ this.composing && (this.input.compositionNode = Rc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Bi(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (h = !0);
9374
9374
  }
9375
- h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && ic(this)) ? Ne(this, h) : (ko(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9375
+ h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && rc(this)) ? Ne(this, h) : (ko(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
9376
9376
  }
9377
- this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Ba(f);
9377
+ this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Pa(f);
9378
9378
  }
9379
9379
  /**
9380
9380
  @internal
@@ -9461,7 +9461,7 @@ class Fo {
9461
9461
  Focus the editor.
9462
9462
  */
9463
9463
  focus() {
9464
- this.domObserver.stop(), this.editable && La(this.dom), Ne(this), this.domObserver.start();
9464
+ this.domObserver.stop(), this.editable && Ba(this.dom), Ne(this), this.domObserver.start();
9465
9465
  }
9466
9466
  /**
9467
9467
  Get the document root in which the editor exists. This will
@@ -9495,7 +9495,7 @@ class Fo {
9495
9495
  the top level, not in any node.
9496
9496
  */
9497
9497
  posAtCoords(e) {
9498
- return Ha(this, e);
9498
+ return Va(this, e);
9499
9499
  }
9500
9500
  /**
9501
9501
  Returns the viewport rectangle at a given document position.
@@ -9560,7 +9560,7 @@ class Fo {
9560
9560
  pass a different state.
9561
9561
  */
9562
9562
  endOfTextblock(e, t) {
9563
- return Ja(this, t || this.state, e);
9563
+ return Ka(this, t || this.state, e);
9564
9564
  }
9565
9565
  /**
9566
9566
  Run the editor's paste logic with the given HTML string. The
@@ -9592,7 +9592,7 @@ class Fo {
9592
9592
  views](https://prosemirror.net/docs/ref/#view.NodeView).
9593
9593
  */
9594
9594
  destroy() {
9595
- this.docView && (Sc(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, Ca());
9595
+ 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());
9596
9596
  }
9597
9597
  /**
9598
9598
  This is true when the view has been
@@ -9606,14 +9606,14 @@ class Fo {
9606
9606
  Used for testing.
9607
9607
  */
9608
9608
  dispatchEvent(e) {
9609
- return wc(this, e);
9609
+ return Mc(this, e);
9610
9610
  }
9611
9611
  /**
9612
9612
  @internal
9613
9613
  */
9614
9614
  domSelectionRange() {
9615
9615
  let e = this.domSelection();
9616
- return e ? Z && this.root.nodeType === 11 && Na(this.dom.ownerDocument) == this.dom && _c(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
9616
+ return e ? Z && this.root.nodeType === 11 && Ea(this.dom.ownerDocument) == this.dom && Uc(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
9617
9617
  }
9618
9618
  /**
9619
9619
  @internal
@@ -9644,7 +9644,7 @@ function ns(n) {
9644
9644
  function rs(n) {
9645
9645
  return !n.someProp("editable", (e) => e(n.state) === !1);
9646
9646
  }
9647
- function id(n, e) {
9647
+ function rd(n, e) {
9648
9648
  let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
9649
9649
  return n.$anchor.start(t) != e.$anchor.start(t);
9650
9650
  }
@@ -9656,7 +9656,7 @@ function is(n) {
9656
9656
  }
9657
9657
  return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
9658
9658
  }
9659
- function sd(n, e) {
9659
+ function id(n, e) {
9660
9660
  let t = 0, r = 0;
9661
9661
  for (let i in n) {
9662
9662
  if (n[i] != e[i])
@@ -9749,18 +9749,18 @@ var qe = {
9749
9749
  220: "|",
9750
9750
  221: "}",
9751
9751
  222: '"'
9752
- }, od = typeof navigator < "u" && /Mac/.test(navigator.platform), ld = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
9752
+ }, sd = typeof navigator < "u" && /Mac/.test(navigator.platform), od = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
9753
9753
  for (var U = 0; U < 10; U++) qe[48 + U] = qe[96 + U] = String(U);
9754
9754
  for (var U = 1; U <= 24; U++) qe[U + 111] = "F" + U;
9755
9755
  for (var U = 65; U <= 90; U++)
9756
9756
  qe[U] = String.fromCharCode(U + 32), Tn[U] = String.fromCharCode(U);
9757
9757
  for (var or in qe) Tn.hasOwnProperty(or) || (Tn[or] = qe[or]);
9758
- function ad(n) {
9759
- var e = od && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || ld && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? Tn : qe)[n.keyCode] || n.key || "Unidentified";
9758
+ function ld(n) {
9759
+ 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";
9760
9760
  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;
9761
9761
  }
9762
- const cd = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), dd = typeof navigator < "u" && /Win/.test(navigator.platform);
9763
- function ud(n) {
9762
+ const ad = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), cd = typeof navigator < "u" && /Win/.test(navigator.platform);
9763
+ function dd(n) {
9764
9764
  let e = n.split(/-(?!$)/), t = e[e.length - 1];
9765
9765
  t == "Space" && (t = " ");
9766
9766
  let r, i, s, o;
@@ -9775,28 +9775,28 @@ function ud(n) {
9775
9775
  else if (/^s(hift)?$/i.test(a))
9776
9776
  s = !0;
9777
9777
  else if (/^mod$/i.test(a))
9778
- cd ? o = !0 : i = !0;
9778
+ ad ? o = !0 : i = !0;
9779
9779
  else
9780
9780
  throw new Error("Unrecognized modifier name: " + a);
9781
9781
  }
9782
9782
  return r && (t = "Alt-" + t), i && (t = "Ctrl-" + t), o && (t = "Meta-" + t), s && (t = "Shift-" + t), t;
9783
9783
  }
9784
- function fd(n) {
9784
+ function ud(n) {
9785
9785
  let e = /* @__PURE__ */ Object.create(null);
9786
9786
  for (let t in n)
9787
- e[ud(t)] = n[t];
9787
+ e[dd(t)] = n[t];
9788
9788
  return e;
9789
9789
  }
9790
9790
  function lr(n, e, t = !0) {
9791
9791
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
9792
9792
  }
9793
- function hd(n) {
9793
+ function fd(n) {
9794
9794
  return new se({ props: { handleKeyDown: $o(n) } });
9795
9795
  }
9796
9796
  function $o(n) {
9797
- let e = fd(n);
9797
+ let e = ud(n);
9798
9798
  return function(t, r) {
9799
- let i = ad(r), s, o = e[lr(i, r)];
9799
+ let i = ld(r), s, o = e[lr(i, r)];
9800
9800
  if (o && o(t.state, t.dispatch, t))
9801
9801
  return !0;
9802
9802
  if (i.length == 1 && i != " ") {
@@ -9806,7 +9806,7 @@ function $o(n) {
9806
9806
  return !0;
9807
9807
  }
9808
9808
  if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
9809
- !(dd && r.ctrlKey && r.altKey) && (s = qe[r.keyCode]) && s != i) {
9809
+ !(cd && r.ctrlKey && r.altKey) && (s = qe[r.keyCode]) && s != i) {
9810
9810
  let l = e[lr(s, r)];
9811
9811
  if (l && l(t.state, t.dispatch, t))
9812
9812
  return !0;
@@ -9846,13 +9846,13 @@ const Ho = (n, e, t) => {
9846
9846
  break;
9847
9847
  }
9848
9848
  return s.isAtom && i.depth == r.depth - 1 ? (e && e(n.tr.delete(i.pos - s.nodeSize, i.pos).scrollIntoView()), !0) : !1;
9849
- }, pd = (n, e, t) => {
9849
+ }, hd = (n, e, t) => {
9850
9850
  let r = Vo(n, t);
9851
9851
  if (!r)
9852
9852
  return !1;
9853
9853
  let i = Yr(r);
9854
9854
  return i ? Wo(n, i, e) : !1;
9855
- }, md = (n, e, t) => {
9855
+ }, pd = (n, e, t) => {
9856
9856
  let r = jo(n, t);
9857
9857
  if (!r)
9858
9858
  return !1;
@@ -9966,7 +9966,7 @@ function Zr(n) {
9966
9966
  }
9967
9967
  return null;
9968
9968
  }
9969
- const gd = (n, e) => {
9969
+ const md = (n, e) => {
9970
9970
  let t = n.selection, r = t instanceof S, i;
9971
9971
  if (r) {
9972
9972
  if (t.node.isTextblock || !je(n.doc, t.from))
@@ -9979,7 +9979,7 @@ const gd = (n, e) => {
9979
9979
  r && s.setSelection(S.create(s.doc, i - n.doc.resolve(i).nodeBefore.nodeSize)), e(s.scrollIntoView());
9980
9980
  }
9981
9981
  return !0;
9982
- }, yd = (n, e) => {
9982
+ }, gd = (n, e) => {
9983
9983
  let t = n.selection, r;
9984
9984
  if (t instanceof S) {
9985
9985
  if (t.node.isTextblock || !je(n.doc, t.to))
@@ -9988,7 +9988,7 @@ const gd = (n, e) => {
9988
9988
  } else if (r = Pn(n.doc, t.to, 1), r == null)
9989
9989
  return !1;
9990
9990
  return e && e(n.tr.join(r).scrollIntoView()), !0;
9991
- }, bd = (n, e) => {
9991
+ }, yd = (n, e) => {
9992
9992
  let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i && Ct(i);
9993
9993
  return s == null ? !1 : (e && e(n.tr.lift(i, s).scrollIntoView()), !0);
9994
9994
  }, Uo = (n, e) => {
@@ -10004,7 +10004,7 @@ function Qr(n) {
10004
10004
  }
10005
10005
  return null;
10006
10006
  }
10007
- const kd = (n, e) => {
10007
+ const bd = (n, e) => {
10008
10008
  let { $head: t, $anchor: r } = n.selection;
10009
10009
  if (!t.parent.type.spec.code || !t.sameParent(r))
10010
10010
  return !1;
@@ -10040,7 +10040,7 @@ const kd = (n, e) => {
10040
10040
  let r = t.blockRange(), i = r && Ct(r);
10041
10041
  return i == null ? !1 : (e && e(n.tr.lift(r, i).scrollIntoView()), !0);
10042
10042
  };
10043
- function xd(n) {
10043
+ function kd(n) {
10044
10044
  return (e, t) => {
10045
10045
  let { $from: r, $to: i } = e.selection;
10046
10046
  if (e.selection instanceof S && e.selection.node.isBlock)
@@ -10069,17 +10069,17 @@ function xd(n) {
10069
10069
  return t && t(d.scrollIntoView()), !0;
10070
10070
  };
10071
10071
  }
10072
- const Sd = xd(), Md = (n, e) => {
10072
+ const xd = kd(), Sd = (n, e) => {
10073
10073
  let { $from: t, to: r } = n.selection, i, s = t.sharedDepth(r);
10074
10074
  return s == 0 ? !1 : (i = t.before(s), e && e(n.tr.setSelection(S.create(n.doc, i))), !0);
10075
10075
  };
10076
- function wd(n, e, t) {
10076
+ function Md(n, e, t) {
10077
10077
  let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
10078
10078
  return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(s - 1, s) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || je(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
10079
10079
  }
10080
10080
  function Xo(n, e, t, r) {
10081
10081
  let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
10082
- if (!a && wd(n, e, t))
10082
+ if (!a && Md(n, e, t))
10083
10083
  return !0;
10084
10084
  let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
10085
10085
  if (c && (o = (l = i.contentMatchAt(i.childCount)).findWrapping(s.type)) && l.matchType(o[0] || s.type).validEnd) {
@@ -10127,8 +10127,8 @@ function Yo(n) {
10127
10127
  return i.node(s).isTextblock ? (t && t(e.tr.setSelection(M.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
10128
10128
  };
10129
10129
  }
10130
- const Cd = Yo(-1), Td = Yo(1);
10131
- function Od(n, e = null) {
10130
+ const wd = Yo(-1), Cd = Yo(1);
10131
+ function Td(n, e = null) {
10132
10132
  return function(t, r) {
10133
10133
  let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && $r(o, n, e);
10134
10134
  return l ? (r && r(t.tr.wrap(o, l).scrollIntoView()), !0) : !1;
@@ -10174,18 +10174,18 @@ function ei(...n) {
10174
10174
  }
10175
10175
  ei(Xr, Ho, qo);
10176
10176
  ei(Xr, Ko, Jo);
10177
- ei(Uo, _o, Go, Sd);
10177
+ ei(Uo, _o, Go, xd);
10178
10178
  typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
10179
- function vd(n, e = null) {
10179
+ function Od(n, e = null) {
10180
10180
  return function(t, r) {
10181
10181
  let { $from: i, $to: s } = t.selection, o = i.blockRange(s);
10182
10182
  if (!o)
10183
10183
  return !1;
10184
10184
  let l = r ? t.tr : null;
10185
- return Ed(l, o, n, e) ? (r && r(l.scrollIntoView()), !0) : !1;
10185
+ return vd(l, o, n, e) ? (r && r(l.scrollIntoView()), !0) : !1;
10186
10186
  };
10187
10187
  }
10188
- function Ed(n, e, t, r = null) {
10188
+ function vd(n, e, t, r = null) {
10189
10189
  let i = !1, s = e, o = e.$from.doc;
10190
10190
  if (e.depth >= 2 && e.$from.node(e.depth - 1).type.compatibleContent(t) && e.startIndex == 0) {
10191
10191
  if (e.$from.index(e.depth - 1) == 0)
@@ -10194,9 +10194,9 @@ function Ed(n, e, t, r = null) {
10194
10194
  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;
10195
10195
  }
10196
10196
  let l = $r(s, t, r, e);
10197
- return l ? (n && Nd(n, e, l, i, t), !0) : !1;
10197
+ return l ? (n && Ed(n, e, l, i, t), !0) : !1;
10198
10198
  }
10199
- function Nd(n, e, t, r, i) {
10199
+ function Ed(n, e, t, r, i) {
10200
10200
  let s = b.empty;
10201
10201
  for (let d = t.length - 1; d >= 0; d--)
10202
10202
  s = b.from(t[d].type.create(t[d].attrs, s));
@@ -10209,13 +10209,13 @@ function Nd(n, e, t, r, i) {
10209
10209
  !f && Ee(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(d).nodeSize;
10210
10210
  return n;
10211
10211
  }
10212
- function Ad(n) {
10212
+ function Nd(n) {
10213
10213
  return function(e, t) {
10214
10214
  let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (o) => o.childCount > 0 && o.firstChild.type == n);
10215
- return s ? t ? r.node(s.depth - 1).type == n ? Dd(e, t, n, s) : Id(e, t, s) : !0 : !1;
10215
+ return s ? t ? r.node(s.depth - 1).type == n ? Ad(e, t, n, s) : Dd(e, t, s) : !0 : !1;
10216
10216
  };
10217
10217
  }
10218
- function Dd(n, e, t, r) {
10218
+ function Ad(n, e, t, r) {
10219
10219
  let i = n.tr, s = r.end, o = r.$to.end(r.depth);
10220
10220
  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));
10221
10221
  const l = Ct(r);
@@ -10225,7 +10225,7 @@ function Dd(n, e, t, r) {
10225
10225
  let a = i.doc.resolve(i.mapping.map(s, -1) - 1);
10226
10226
  return je(i.doc, a.pos) && a.nodeBefore.type == a.nodeAfter.type && i.join(a.pos), e(i.scrollIntoView()), !0;
10227
10227
  }
10228
- function Id(n, e, t) {
10228
+ function Dd(n, e, t) {
10229
10229
  let r = n.tr, i = t.parent;
10230
10230
  for (let h = t.end, p = t.endIndex - 1, m = t.startIndex; p > m; p--)
10231
10231
  h -= i.child(p).nodeSize, r.delete(h - 1, h + 1);
@@ -10238,7 +10238,7 @@ function Id(n, e, t) {
10238
10238
  let u = s.pos, f = u + o.nodeSize;
10239
10239
  return r.step(new $(u - (l ? 1 : 0), f + (a ? 1 : 0), u + 1, f - 1, new k((l ? b.empty : b.from(i.copy(b.empty))).append(a ? b.empty : b.from(i.copy(b.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
10240
10240
  }
10241
- function Rd(n) {
10241
+ function Id(n) {
10242
10242
  return function(e, t) {
10243
10243
  let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (c) => c.childCount > 0 && c.firstChild.type == n);
10244
10244
  if (!s)
@@ -10341,7 +10341,7 @@ class Hn {
10341
10341
  return l;
10342
10342
  }
10343
10343
  }
10344
- class Pd {
10344
+ class Rd {
10345
10345
  constructor() {
10346
10346
  this.callbacks = {};
10347
10347
  }
@@ -10478,10 +10478,10 @@ function Qo(n) {
10478
10478
  function E(n, e = void 0, ...t) {
10479
10479
  return Qo(n) ? e ? n.bind(e)(...t) : n(...t) : n;
10480
10480
  }
10481
- function Bd(n = {}) {
10481
+ function Pd(n = {}) {
10482
10482
  return Object.keys(n).length === 0 && n.constructor === Object;
10483
10483
  }
10484
- function Ld(n) {
10484
+ function Bd(n) {
10485
10485
  return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
10486
10486
  }
10487
10487
  function as(n, e) {
@@ -10492,7 +10492,7 @@ function as(n, e) {
10492
10492
  if (r === !1)
10493
10493
  return !1;
10494
10494
  const i = e.reduce((s, o) => {
10495
- const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : Ld(t.getAttribute(o.name));
10495
+ const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : Bd(t.getAttribute(o.name));
10496
10496
  return l == null ? s : {
10497
10497
  ...s,
10498
10498
  [o.name]: l
@@ -10505,10 +10505,10 @@ function as(n, e) {
10505
10505
  function cs(n) {
10506
10506
  return Object.fromEntries(
10507
10507
  // @ts-ignore
10508
- Object.entries(n).filter(([e, t]) => e === "attrs" && Bd(t) ? !1 : t != null)
10508
+ Object.entries(n).filter(([e, t]) => e === "attrs" && Pd(t) ? !1 : t != null)
10509
10509
  );
10510
10510
  }
10511
- function zd(n, e) {
10511
+ function Ld(n, e) {
10512
10512
  var t;
10513
10513
  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) => {
10514
10514
  const d = r.filter((y) => y.type === c.name), u = {
@@ -10596,7 +10596,7 @@ function ti(n, e) {
10596
10596
  const t = dt.fromSchema(e).serializeFragment(n), i = document.implementation.createHTMLDocument().createElement("div");
10597
10597
  return i.appendChild(t), i.innerHTML;
10598
10598
  }
10599
- const Fd = (n, e = 500) => {
10599
+ const zd = (n, e = 500) => {
10600
10600
  let t = "";
10601
10601
  const r = n.parentOffset;
10602
10602
  return n.parent.nodesBetween(Math.max(0, r - e), r, (i, s, o, l) => {
@@ -10618,7 +10618,7 @@ class qn {
10618
10618
  this.find = e.find, this.handler = e.handler;
10619
10619
  }
10620
10620
  }
10621
- const $d = (n, e) => {
10621
+ const Fd = (n, e) => {
10622
10622
  if (ni(e))
10623
10623
  return e.exec(n);
10624
10624
  const t = e(n);
@@ -10639,11 +10639,11 @@ function rn(n) {
10639
10639
  )
10640
10640
  return !1;
10641
10641
  let d = !1;
10642
- const u = Fd(c) + s;
10642
+ const u = zd(c) + s;
10643
10643
  return o.forEach((f) => {
10644
10644
  if (d)
10645
10645
  return;
10646
- const h = $d(u, f.find);
10646
+ const h = Fd(u, f.find);
10647
10647
  if (!h)
10648
10648
  return;
10649
10649
  const p = a.state.tr, m = Vn({
@@ -10671,7 +10671,7 @@ function rn(n) {
10671
10671
  }), a.dispatch(p), d = !0);
10672
10672
  }), d;
10673
10673
  }
10674
- function Vd(n) {
10674
+ function $d(n) {
10675
10675
  const { editor: e, rules: t } = n, r = new se({
10676
10676
  state: {
10677
10677
  init() {
@@ -10743,11 +10743,11 @@ function Vd(n) {
10743
10743
  });
10744
10744
  return r;
10745
10745
  }
10746
- function Hd(n) {
10746
+ function Vd(n) {
10747
10747
  return Object.prototype.toString.call(n).slice(8, -1);
10748
10748
  }
10749
10749
  function sn(n) {
10750
- return Hd(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
10750
+ return Vd(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
10751
10751
  }
10752
10752
  function jn(n, e) {
10753
10753
  const t = { ...n };
@@ -10801,15 +10801,15 @@ class Me {
10801
10801
  return !1;
10802
10802
  }
10803
10803
  }
10804
- function Wd(n) {
10804
+ function Hd(n) {
10805
10805
  return typeof n == "number";
10806
10806
  }
10807
- class qd {
10807
+ class Wd {
10808
10808
  constructor(e) {
10809
10809
  this.find = e.find, this.handler = e.handler;
10810
10810
  }
10811
10811
  }
10812
- const jd = (n, e, t) => {
10812
+ const qd = (n, e, t) => {
10813
10813
  if (ni(e))
10814
10814
  return [...n.matchAll(e)];
10815
10815
  const r = e(n, t);
@@ -10818,7 +10818,7 @@ const jd = (n, e, t) => {
10818
10818
  return s.index = i.index, s.input = n, s.data = i.data, i.replaceWith && (i.text.includes(i.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), s.push(i.replaceWith)), s;
10819
10819
  }) : [];
10820
10820
  };
10821
- function Kd(n) {
10821
+ function jd(n) {
10822
10822
  const { editor: e, state: t, from: r, to: i, rule: s, pasteEvent: o, dropEvent: l } = n, { commands: a, chain: c, can: d } = new Hn({
10823
10823
  editor: e,
10824
10824
  state: t
@@ -10827,7 +10827,7 @@ function Kd(n) {
10827
10827
  if (!h.isTextblock || h.type.spec.code)
10828
10828
  return;
10829
10829
  const m = Math.max(r, p), g = Math.min(i, p + h.content.size), y = h.textBetween(m - p, g - p, void 0, "");
10830
- jd(y, s.find, o).forEach((w) => {
10830
+ qd(y, s.find, o).forEach((w) => {
10831
10831
  if (w.index === void 0)
10832
10832
  return;
10833
10833
  const I = m + w.index + 1, D = I + w[0].length, L = {
@@ -10848,14 +10848,14 @@ function Kd(n) {
10848
10848
  }), u.every((h) => h !== null);
10849
10849
  }
10850
10850
  let on = null;
10851
- const Jd = (n) => {
10851
+ const Kd = (n) => {
10852
10852
  var e;
10853
10853
  const t = new ClipboardEvent("paste", {
10854
10854
  clipboardData: new DataTransfer()
10855
10855
  });
10856
10856
  return (e = t.clipboardData) === null || e === void 0 || e.setData("text/html", n), t;
10857
10857
  };
10858
- function Ud(n) {
10858
+ function Jd(n) {
10859
10859
  const { editor: e, rules: t } = n;
10860
10860
  let r = null, i = !1, s = !1, o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, l;
10861
10861
  try {
@@ -10868,7 +10868,7 @@ function Ud(n) {
10868
10868
  state: d,
10869
10869
  transaction: m
10870
10870
  });
10871
- if (!(!Kd({
10871
+ if (!(!jd({
10872
10872
  editor: e,
10873
10873
  state: g,
10874
10874
  from: Math.max(u - 1, 0),
@@ -10926,7 +10926,7 @@ function Ud(n) {
10926
10926
  if (T) {
10927
10927
  let { text: D } = y;
10928
10928
  typeof D == "string" ? D = D : D = ti(b.from(D), h.schema);
10929
- const { from: L } = y, C = L + D.length, N = Jd(D);
10929
+ const { from: L } = y, C = L + D.length, N = Kd(D);
10930
10930
  return a({
10931
10931
  rule: d,
10932
10932
  state: h,
@@ -10936,7 +10936,7 @@ function Ud(n) {
10936
10936
  });
10937
10937
  }
10938
10938
  const w = f.doc.content.findDiffStart(h.doc.content), I = f.doc.content.findDiffEnd(h.doc.content);
10939
- if (!(!Wd(w) || !I || w === I.b))
10939
+ if (!(!Hd(w) || !I || w === I.b))
10940
10940
  return a({
10941
10941
  rule: d,
10942
10942
  state: h,
@@ -10947,13 +10947,13 @@ function Ud(n) {
10947
10947
  }
10948
10948
  }));
10949
10949
  }
10950
- function _d(n) {
10950
+ function Ud(n) {
10951
10951
  const e = n.filter((t, r) => n.indexOf(t) !== r);
10952
10952
  return Array.from(new Set(e));
10953
10953
  }
10954
10954
  class gt {
10955
10955
  constructor(e, t) {
10956
- this.splittableMarks = [], this.editor = t, this.extensions = gt.resolve(e), this.schema = zd(this.extensions, t), this.setupExtensions();
10956
+ this.splittableMarks = [], this.editor = t, this.extensions = gt.resolve(e), this.schema = Ld(this.extensions, t), this.setupExtensions();
10957
10957
  }
10958
10958
  /**
10959
10959
  * Returns a flattened and sorted extension list while
@@ -10962,7 +10962,7 @@ class gt {
10962
10962
  * @returns An flattened and sorted array of Tiptap extensions
10963
10963
  */
10964
10964
  static resolve(e) {
10965
- const t = gt.sort(gt.flatten(e)), r = _d(t.map((i) => i.name));
10965
+ const t = gt.sort(gt.flatten(e)), r = Ud(t.map((i) => i.name));
10966
10966
  return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), t;
10967
10967
  }
10968
10968
  /**
@@ -11028,7 +11028,7 @@ class gt {
11028
11028
  const m = Object.fromEntries(Object.entries(c()).map(([g, y]) => [g, () => y({ editor: e })]));
11029
11029
  d = { ...d, ...m };
11030
11030
  }
11031
- const u = hd(d);
11031
+ const u = fd(d);
11032
11032
  a.push(u);
11033
11033
  const f = x(o, "addInputRules", l);
11034
11034
  ds(o, e.options.enableInputRules) && f && r.push(...f());
@@ -11042,11 +11042,11 @@ class gt {
11042
11042
  return a;
11043
11043
  }).flat();
11044
11044
  return [
11045
- Vd({
11045
+ $d({
11046
11046
  editor: e,
11047
11047
  rules: r
11048
11048
  }),
11049
- ...Ud({
11049
+ ...Jd({
11050
11050
  editor: e,
11051
11051
  rules: i
11052
11052
  }),
@@ -11173,7 +11173,7 @@ function el(n, e, t) {
11173
11173
  function tl(n) {
11174
11174
  return Object.fromEntries(Object.entries(n.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
11175
11175
  }
11176
- const Gd = G.create({
11176
+ const _d = G.create({
11177
11177
  name: "clipboardTextSerializer",
11178
11178
  addOptions() {
11179
11179
  return {
@@ -11196,10 +11196,10 @@ const Gd = G.create({
11196
11196
  })
11197
11197
  ];
11198
11198
  }
11199
- }), Xd = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
11199
+ }), Gd = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
11200
11200
  var t;
11201
11201
  n.isDestroyed || (e.dom.blur(), (t = window == null ? void 0 : window.getSelection()) === null || t === void 0 || t.removeAllRanges());
11202
- }), !0), Yd = (n = !1) => ({ commands: e }) => e.setContent("", n), Zd = () => ({ state: n, tr: e, dispatch: t }) => {
11202
+ }), !0), Xd = (n = !1) => ({ commands: e }) => e.setContent("", n), Yd = () => ({ state: n, tr: e, dispatch: t }) => {
11203
11203
  const { selection: r } = e, { ranges: i } = r;
11204
11204
  return t && i.forEach(({ $from: s, $to: o }) => {
11205
11205
  n.doc.nodesBetween(s.pos, o.pos, (l, a) => {
@@ -11216,12 +11216,12 @@ const Gd = G.create({
11216
11216
  (p || p === 0) && e.lift(h, p);
11217
11217
  });
11218
11218
  }), !0;
11219
- }, Qd = (n) => (e) => n(e), eu = () => ({ state: n, dispatch: e }) => _o(n, e), tu = (n, e) => ({ editor: t, tr: r }) => {
11219
+ }, Zd = (n) => (e) => n(e), Qd = () => ({ state: n, dispatch: e }) => _o(n, e), eu = (n, e) => ({ editor: t, tr: r }) => {
11220
11220
  const { state: i } = t, s = i.doc.slice(n.from, n.to);
11221
11221
  r.deleteRange(n.from, n.to);
11222
11222
  const o = r.mapping.map(e);
11223
11223
  return r.insert(o, s.content), r.setSelection(new M(r.doc.resolve(Math.max(o - 1, 0)))), !0;
11224
- }, nu = () => ({ tr: n, dispatch: e }) => {
11224
+ }, tu = () => ({ tr: n, dispatch: e }) => {
11225
11225
  const { selection: t } = n, r = t.$anchor.node();
11226
11226
  if (r.content.size > 0)
11227
11227
  return !1;
@@ -11235,7 +11235,7 @@ const Gd = G.create({
11235
11235
  return !0;
11236
11236
  }
11237
11237
  return !1;
11238
- }, ru = (n) => ({ tr: e, state: t, dispatch: r }) => {
11238
+ }, nu = (n) => ({ tr: e, state: t, dispatch: r }) => {
11239
11239
  const i = H(n, t.schema), s = e.selection.$anchor;
11240
11240
  for (let o = s.depth; o > 0; o -= 1)
11241
11241
  if (s.node(o).type === i) {
@@ -11246,10 +11246,10 @@ const Gd = G.create({
11246
11246
  return !0;
11247
11247
  }
11248
11248
  return !1;
11249
- }, iu = (n) => ({ tr: e, dispatch: t }) => {
11249
+ }, ru = (n) => ({ tr: e, dispatch: t }) => {
11250
11250
  const { from: r, to: i } = n;
11251
11251
  return t && e.delete(r, i), !0;
11252
- }, su = () => ({ state: n, dispatch: e }) => Xr(n, e), ou = () => ({ commands: n }) => n.keyboardShortcut("Enter"), lu = () => ({ state: n, dispatch: e }) => kd(n, e);
11252
+ }, iu = () => ({ state: n, dispatch: e }) => Xr(n, e), su = () => ({ commands: n }) => n.keyboardShortcut("Enter"), ou = () => ({ state: n, dispatch: e }) => bd(n, e);
11253
11253
  function On(n, e, t = { strict: !0 }) {
11254
11254
  const r = Object.keys(e);
11255
11255
  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;
@@ -11289,7 +11289,7 @@ function Je(n, e) {
11289
11289
  }
11290
11290
  return n;
11291
11291
  }
11292
- const au = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11292
+ const lu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11293
11293
  const s = Je(n, r.schema), { doc: o, selection: l } = t, { $from: a, from: c, to: d } = l;
11294
11294
  if (i) {
11295
11295
  const u = ri(a, s, e);
@@ -11299,7 +11299,7 @@ const au = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11299
11299
  }
11300
11300
  }
11301
11301
  return !0;
11302
- }, cu = (n) => (e) => {
11302
+ }, au = (n) => (e) => {
11303
11303
  const t = typeof n == "function" ? n(e) : n;
11304
11304
  for (let r = 0; r < t.length; r += 1)
11305
11305
  if (t[r](e))
@@ -11336,17 +11336,17 @@ function vn() {
11336
11336
  "iPod"
11337
11337
  ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
11338
11338
  }
11339
- function du() {
11339
+ function cu() {
11340
11340
  return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
11341
11341
  }
11342
- const uu = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) => {
11342
+ const du = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) => {
11343
11343
  e = {
11344
11344
  scrollIntoView: !0,
11345
11345
  ...e
11346
11346
  };
11347
11347
  const o = () => {
11348
11348
  (vn() || fs()) && r.dom.focus(), requestAnimationFrame(() => {
11349
- t.isDestroyed || (r.focus(), du() && !vn() && !fs() && r.dom.focus({ preventScroll: !0 }));
11349
+ t.isDestroyed || (r.focus(), cu() && !vn() && !fs() && r.dom.focus({ preventScroll: !0 }));
11350
11350
  });
11351
11351
  };
11352
11352
  if (r.hasFocus() && n === null || n === !1)
@@ -11355,7 +11355,7 @@ const uu = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
11355
11355
  return o(), !0;
11356
11356
  const l = il(i.doc, n) || t.state.selection, a = t.state.selection.eq(l);
11357
11357
  return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
11358
- }, fu = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), hu = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e), sl = (n) => {
11358
+ }, uu = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), fu = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e), sl = (n) => {
11359
11359
  const e = n.childNodes;
11360
11360
  for (let t = e.length - 1; t >= 0; t -= 1) {
11361
11361
  const r = e[t];
@@ -11416,7 +11416,7 @@ function Ht(n, e, t) {
11416
11416
  }
11417
11417
  return Ht("", e, t);
11418
11418
  }
11419
- function pu(n, e, t) {
11419
+ function hu(n, e, t) {
11420
11420
  const r = n.steps.length - 1;
11421
11421
  if (r < e)
11422
11422
  return;
@@ -11429,7 +11429,7 @@ function pu(n, e, t) {
11429
11429
  o === 0 && (o = d);
11430
11430
  }), n.setSelection(v.near(n.doc.resolve(o), t));
11431
11431
  }
11432
- const mu = (n) => !("type" in n), gu = (n, e, t) => ({ tr: r, dispatch: i, editor: s }) => {
11432
+ const pu = (n) => !("type" in n), mu = (n, e, t) => ({ tr: r, dispatch: i, editor: s }) => {
11433
11433
  var o;
11434
11434
  if (i) {
11435
11435
  t = {
@@ -11470,7 +11470,7 @@ const mu = (n) => !("type" in n), gu = (n, e, t) => ({ tr: r, dispatch: i, edito
11470
11470
  return a(g), !1;
11471
11471
  }
11472
11472
  let { from: d, to: u } = typeof n == "number" ? { from: n, to: n } : { from: n.from, to: n.to }, f = !0, h = !0;
11473
- if ((mu(l) ? l : [l]).forEach((g) => {
11473
+ if ((pu(l) ? l : [l]).forEach((g) => {
11474
11474
  g.check(), f = f ? g.isText && g.marks.length === 0 : !1, h = h ? g.isBlock : !1;
11475
11475
  }), d === u && h) {
11476
11476
  const { parent: g } = r.doc.resolve(d);
@@ -11489,28 +11489,28 @@ const mu = (n) => !("type" in n), gu = (n, e, t) => ({ tr: r, dispatch: i, edito
11489
11489
  r.insertText(m, d, u);
11490
11490
  } else
11491
11491
  m = l, r.replaceWith(d, u, m);
11492
- t.updateSelection && pu(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: d, text: m }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: d, text: m });
11492
+ t.updateSelection && hu(r, r.steps.length - 1, -1), t.applyInputRules && r.setMeta("applyInputRules", { from: d, text: m }), t.applyPasteRules && r.setMeta("applyPasteRules", { from: d, text: m });
11493
11493
  }
11494
11494
  return !0;
11495
- }, yu = () => ({ state: n, dispatch: e }) => gd(n, e), bu = () => ({ state: n, dispatch: e }) => yd(n, e), ku = () => ({ state: n, dispatch: e }) => Ho(n, e), xu = () => ({ state: n, dispatch: e }) => Ko(n, e), Su = () => ({ state: n, dispatch: e, tr: t }) => {
11495
+ }, 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 }) => {
11496
11496
  try {
11497
11497
  const r = Pn(n.doc, n.selection.$from.pos, -1);
11498
11498
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11499
11499
  } catch {
11500
11500
  return !1;
11501
11501
  }
11502
- }, Mu = () => ({ state: n, dispatch: e, tr: t }) => {
11502
+ }, Su = () => ({ state: n, dispatch: e, tr: t }) => {
11503
11503
  try {
11504
11504
  const r = Pn(n.doc, n.selection.$from.pos, 1);
11505
11505
  return r == null ? !1 : (t.join(r, 2), e && e(t), !0);
11506
11506
  } catch {
11507
11507
  return !1;
11508
11508
  }
11509
- }, wu = () => ({ state: n, dispatch: e }) => pd(n, e), Cu = () => ({ state: n, dispatch: e }) => md(n, e);
11509
+ }, Mu = () => ({ state: n, dispatch: e }) => hd(n, e), wu = () => ({ state: n, dispatch: e }) => pd(n, e);
11510
11510
  function ol() {
11511
11511
  return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
11512
11512
  }
11513
- function Tu(n) {
11513
+ function Cu(n) {
11514
11514
  const e = n.split(/-(?!$)/);
11515
11515
  let t = e[e.length - 1];
11516
11516
  t === "Space" && (t = " ");
@@ -11532,8 +11532,8 @@ function Tu(n) {
11532
11532
  }
11533
11533
  return r && (t = `Alt-${t}`), i && (t = `Ctrl-${t}`), o && (t = `Meta-${t}`), s && (t = `Shift-${t}`), t;
11534
11534
  }
11535
- const Ou = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
11536
- const s = Tu(n).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
11535
+ const Tu = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
11536
+ const s = Cu(n).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
11537
11537
  key: o === "Space" ? " " : o,
11538
11538
  altKey: s.includes("Alt"),
11539
11539
  ctrlKey: s.includes("Ctrl"),
@@ -11564,13 +11564,13 @@ function Wt(n, e, t = {}) {
11564
11564
  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 }));
11565
11565
  return s ? !!c.length : c.reduce((u, f) => u + f.to - f.from, 0) >= a;
11566
11566
  }
11567
- const vu = (n, e = {}) => ({ state: t, dispatch: r }) => {
11567
+ const Ou = (n, e = {}) => ({ state: t, dispatch: r }) => {
11568
11568
  const i = H(n, t.schema);
11569
- return Wt(t, i, e) ? bd(t, r) : !1;
11570
- }, Eu = () => ({ state: n, dispatch: e }) => Go(n, e), Nu = (n) => ({ state: e, dispatch: t }) => {
11569
+ return Wt(t, i, e) ? yd(t, r) : !1;
11570
+ }, vu = () => ({ state: n, dispatch: e }) => Go(n, e), Eu = (n) => ({ state: e, dispatch: t }) => {
11571
11571
  const r = H(n, e.schema);
11572
- return Ad(r)(e, t);
11573
- }, Au = () => ({ state: n, dispatch: e }) => Uo(n, e);
11572
+ return Nd(r)(e, t);
11573
+ }, Nu = () => ({ state: n, dispatch: e }) => Uo(n, e);
11574
11574
  function Kn(n, e) {
11575
11575
  return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
11576
11576
  }
@@ -11578,7 +11578,7 @@ function hs(n, e) {
11578
11578
  const t = typeof e == "string" ? [e] : e;
11579
11579
  return Object.keys(n).reduce((r, i) => (t.includes(i) || (r[i] = n[i]), r), {});
11580
11580
  }
11581
- const Du = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11581
+ const Au = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11582
11582
  let s = null, o = null;
11583
11583
  const l = Kn(typeof n == "string" ? n : n.name, r.schema);
11584
11584
  return l ? (l === "node" && (s = H(n, r.schema)), l === "mark" && (o = Je(n, r.schema)), i && t.selection.ranges.forEach((a) => {
@@ -11588,13 +11588,13 @@ const Du = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
11588
11588
  });
11589
11589
  });
11590
11590
  }), !0) : !1;
11591
- }, Iu = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Ru = () => ({ tr: n, dispatch: e }) => {
11591
+ }, Du = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Iu = () => ({ tr: n, dispatch: e }) => {
11592
11592
  if (e) {
11593
11593
  const t = new ce(n.doc);
11594
11594
  n.setSelection(t);
11595
11595
  }
11596
11596
  return !0;
11597
- }, Pu = () => ({ state: n, dispatch: e }) => qo(n, e), Bu = () => ({ state: n, dispatch: e }) => Jo(n, e), Lu = () => ({ state: n, dispatch: e }) => Md(n, e), zu = () => ({ state: n, dispatch: e }) => Td(n, e), Fu = () => ({ state: n, dispatch: e }) => Cd(n, e);
11597
+ }, 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);
11598
11598
  function Rr(n, e, t = {}, r = {}) {
11599
11599
  return Ht(n, e, {
11600
11600
  slice: !1,
@@ -11602,7 +11602,7 @@ function Rr(n, e, t = {}, r = {}) {
11602
11602
  errorOnInvalidContent: r.errorOnInvalidContent
11603
11603
  });
11604
11604
  }
11605
- const $u = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, commands: l }) => {
11605
+ const Fu = (n, e = !1, t = {}, r = {}) => ({ editor: i, tr: s, dispatch: o, commands: l }) => {
11606
11606
  var a, c;
11607
11607
  const { doc: d } = s;
11608
11608
  if (t.preserveWhitespace !== "full") {
@@ -11624,7 +11624,7 @@ function ll(n, e) {
11624
11624
  const l = o.find((a) => a.type.name === t.name);
11625
11625
  return l ? { ...l.attrs } : {};
11626
11626
  }
11627
- function Vu(n) {
11627
+ function $u(n) {
11628
11628
  for (let e = 0; e < n.edgeCount; e += 1) {
11629
11629
  const { type: t } = n.edge(e);
11630
11630
  if (t.isTextblock && !t.hasRequiredAttrs())
@@ -11632,7 +11632,7 @@ function Vu(n) {
11632
11632
  }
11633
11633
  return null;
11634
11634
  }
11635
- function Hu(n, e) {
11635
+ function Vu(n, e) {
11636
11636
  for (let t = n.depth; t > 0; t -= 1) {
11637
11637
  const r = n.node(t);
11638
11638
  if (e(r))
@@ -11645,16 +11645,16 @@ function Hu(n, e) {
11645
11645
  }
11646
11646
  }
11647
11647
  function ii(n) {
11648
- return (e) => Hu(e.$from, n);
11648
+ return (e) => Vu(e.$from, n);
11649
11649
  }
11650
- function Wu(n, e) {
11650
+ function Hu(n, e) {
11651
11651
  const t = {
11652
11652
  from: 0,
11653
11653
  to: n.content.size
11654
11654
  };
11655
11655
  return el(n, t, e);
11656
11656
  }
11657
- function qu(n, e) {
11657
+ function Wu(n, e) {
11658
11658
  const t = H(e, n.schema), { from: r, to: i } = n.selection, s = [];
11659
11659
  n.doc.nodesBetween(r, i, (l) => {
11660
11660
  s.push(l);
@@ -11662,9 +11662,9 @@ function qu(n, e) {
11662
11662
  const o = s.reverse().find((l) => l.type.name === t.name);
11663
11663
  return o ? { ...o.attrs } : {};
11664
11664
  }
11665
- function ju(n, e) {
11665
+ function qu(n, e) {
11666
11666
  const t = Kn(typeof e == "string" ? e : e.name, n.schema);
11667
- return t === "node" ? qu(n, e) : t === "mark" ? ll(n, e) : {};
11667
+ return t === "node" ? Wu(n, e) : t === "mark" ? ll(n, e) : {};
11668
11668
  }
11669
11669
  function al(n, e, t) {
11670
11670
  const r = [];
@@ -11711,7 +11711,7 @@ function Pr(n, e, t = {}) {
11711
11711
  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);
11712
11712
  return (a > 0 ? a + c : a) >= o;
11713
11713
  }
11714
- function Ku(n, e, t = {}) {
11714
+ function ju(n, e, t = {}) {
11715
11715
  if (!e)
11716
11716
  return Wt(n, null, t) || Pr(n, null, t);
11717
11717
  const r = Kn(e, n.schema);
@@ -11750,10 +11750,10 @@ function si(n, { checkChildren: e = !0, ignoreWhitespace: t = !1 } = {}) {
11750
11750
  }
11751
11751
  return !1;
11752
11752
  }
11753
- function Ju(n) {
11753
+ function Ku(n) {
11754
11754
  return n instanceof S;
11755
11755
  }
11756
- function Uu(n, e, t) {
11756
+ function Ju(n, e, t) {
11757
11757
  var r;
11758
11758
  const { selection: i } = e;
11759
11759
  let s = null;
@@ -11775,7 +11775,7 @@ function Uu(n, e, t) {
11775
11775
  }), c;
11776
11776
  });
11777
11777
  }
11778
- const _u = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11778
+ const Uu = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11779
11779
  const { selection: s } = t, { empty: o, ranges: l } = s, a = Je(n, r.schema);
11780
11780
  if (i)
11781
11781
  if (o) {
@@ -11797,26 +11797,26 @@ const _u = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11797
11797
  }) : t.addMark(p, m, a.create(e));
11798
11798
  });
11799
11799
  });
11800
- return Uu(r, t, a);
11801
- }, Gu = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), Xu = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
11800
+ return Ju(r, t, a);
11801
+ }, _u = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), Gu = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
11802
11802
  const s = H(n, t.schema);
11803
11803
  let o;
11804
11804
  return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? i().command(({ commands: l }) => ls(s, { ...o, ...e })(t) ? !0 : l.clearNodes()).command(({ state: l }) => ls(s, { ...o, ...e })(l, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
11805
- }, Yu = (n) => ({ tr: e, dispatch: t }) => {
11805
+ }, Xu = (n) => ({ tr: e, dispatch: t }) => {
11806
11806
  if (t) {
11807
11807
  const { doc: r } = e, i = Ye(n, 0, r.content.size), s = S.create(r, i);
11808
11808
  e.setSelection(s);
11809
11809
  }
11810
11810
  return !0;
11811
- }, Zu = (n) => ({ tr: e, dispatch: t }) => {
11811
+ }, Yu = (n) => ({ tr: e, dispatch: t }) => {
11812
11812
  if (t) {
11813
11813
  const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = M.atStart(r).from, l = M.atEnd(r).to, a = Ye(i, o, l), c = Ye(s, o, l), d = M.create(r, a, c);
11814
11814
  e.setSelection(d);
11815
11815
  }
11816
11816
  return !0;
11817
- }, Qu = (n) => ({ state: e, dispatch: t }) => {
11817
+ }, Zu = (n) => ({ state: e, dispatch: t }) => {
11818
11818
  const r = H(n, e.schema);
11819
- return Rd(r)(e, t);
11819
+ return Id(r)(e, t);
11820
11820
  };
11821
11821
  function ms(n, e) {
11822
11822
  const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
@@ -11825,13 +11825,13 @@ function ms(n, e) {
11825
11825
  n.tr.ensureMarks(r);
11826
11826
  }
11827
11827
  }
11828
- const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
11828
+ const Qu = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
11829
11829
  const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, d = un(c, l.node().type.name, l.node().attrs);
11830
11830
  if (s instanceof S && s.node.isBlock)
11831
11831
  return !l.parentOffset || !Ee(o, l.pos) ? !1 : (r && (n && ms(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
11832
11832
  if (!l.parent.isBlock)
11833
11833
  return !1;
11834
- const u = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : Vu(l.node(-1).contentMatchAt(l.indexAfter(-1)));
11834
+ const u = a.parentOffset === a.parent.content.size, f = l.depth === 0 ? void 0 : $u(l.node(-1).contentMatchAt(l.indexAfter(-1)));
11835
11835
  let h = u && f ? [
11836
11836
  {
11837
11837
  type: f,
@@ -11851,7 +11851,7 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11851
11851
  n && ms(t, i.extensionManager.splittableMarks), e.scrollIntoView();
11852
11852
  }
11853
11853
  return p;
11854
- }, tf = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: s }) => {
11854
+ }, ef = (n, e = {}) => ({ tr: t, state: r, dispatch: i, editor: s }) => {
11855
11855
  var o;
11856
11856
  const l = H(n, r.schema), { $from: a, $to: c } = r.selection, d = r.selection.node;
11857
11857
  if (d && d.isBlock || a.depth < 2 || !a.sameParent(c))
@@ -11924,7 +11924,7 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11924
11924
  return !0;
11925
11925
  const i = n.doc.nodeAt(r);
11926
11926
  return t.node.type === (i == null ? void 0 : i.type) && je(n.doc, r) && n.join(r), !0;
11927
- }, nf = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: d }) => {
11927
+ }, tf = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: d }) => {
11928
11928
  const { extensions: u, splittableMarks: f } = i.extensionManager, h = H(n, o.schema), p = H(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: T } = m, w = y.blockRange(T), I = g || m.$to.parentOffset && m.$from.marks();
11929
11929
  if (!w)
11930
11930
  return !1;
@@ -11939,17 +11939,17 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11939
11939
  const L = d().wrapInList(h, r), C = I.filter((N) => f.includes(N.type.name));
11940
11940
  return s.ensureMarks(C), L ? !0 : c.clearNodes();
11941
11941
  }).wrapInList(h, r).command(() => cr(s, h)).command(() => dr(s, h)).run();
11942
- }, rf = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
11942
+ }, nf = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
11943
11943
  const { extendEmptyMarkRange: s = !1 } = t, o = Je(n, r.schema);
11944
11944
  return Pr(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
11945
- }, sf = (n, e, t = {}) => ({ state: r, commands: i }) => {
11945
+ }, rf = (n, e, t = {}) => ({ state: r, commands: i }) => {
11946
11946
  const s = H(n, r.schema), o = H(e, r.schema), l = Wt(r, s, t);
11947
11947
  let a;
11948
11948
  return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), l ? i.setNode(o, a) : i.setNode(s, { ...a, ...t });
11949
- }, of = (n, e = {}) => ({ state: t, commands: r }) => {
11949
+ }, sf = (n, e = {}) => ({ state: t, commands: r }) => {
11950
11950
  const i = H(n, t.schema);
11951
11951
  return Wt(t, i, e) ? r.lift(i) : r.wrapIn(i, e);
11952
- }, lf = () => ({ state: n, dispatch: e }) => {
11952
+ }, of = () => ({ state: n, dispatch: e }) => {
11953
11953
  const t = n.plugins;
11954
11954
  for (let r = 0; r < t.length; r += 1) {
11955
11955
  const i = t[r];
@@ -11969,12 +11969,12 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11969
11969
  }
11970
11970
  }
11971
11971
  return !1;
11972
- }, af = () => ({ tr: n, dispatch: e }) => {
11972
+ }, lf = () => ({ tr: n, dispatch: e }) => {
11973
11973
  const { selection: t } = n, { empty: r, ranges: i } = t;
11974
11974
  return r || e && i.forEach((s) => {
11975
11975
  n.removeMark(s.$from.pos, s.$to.pos);
11976
11976
  }), !0;
11977
- }, cf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11977
+ }, af = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11978
11978
  var s;
11979
11979
  const { extendEmptyMarkRange: o = !1 } = e, { selection: l } = t, a = Je(n, r.schema), { $from: c, empty: d, ranges: u } = l;
11980
11980
  if (!i)
@@ -11988,7 +11988,7 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
11988
11988
  t.removeMark(f.$from.pos, f.$to.pos, a);
11989
11989
  });
11990
11990
  return t.removeStoredMark(a), !0;
11991
- }, df = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11991
+ }, cf = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
11992
11992
  let s = null, o = null;
11993
11993
  const l = Kn(typeof n == "string" ? n : n.name, r.schema);
11994
11994
  return l ? (l === "node" && (s = H(n, r.schema)), l === "mark" && (o = Je(n, r.schema)), i && t.selection.ranges.forEach((a) => {
@@ -12019,82 +12019,82 @@ const ef = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
12019
12019
  }));
12020
12020
  }));
12021
12021
  }), !0) : !1;
12022
+ }, df = (n, e = {}) => ({ state: t, dispatch: r }) => {
12023
+ const i = H(n, t.schema);
12024
+ return Td(i, e)(t, r);
12022
12025
  }, uf = (n, e = {}) => ({ state: t, dispatch: r }) => {
12023
12026
  const i = H(n, t.schema);
12024
12027
  return Od(i, e)(t, r);
12025
- }, ff = (n, e = {}) => ({ state: t, dispatch: r }) => {
12026
- const i = H(n, t.schema);
12027
- return vd(i, e)(t, r);
12028
12028
  };
12029
- var hf = /* @__PURE__ */ Object.freeze({
12029
+ var ff = /* @__PURE__ */ Object.freeze({
12030
12030
  __proto__: null,
12031
- blur: Xd,
12032
- clearContent: Yd,
12033
- clearNodes: Zd,
12034
- command: Qd,
12035
- createParagraphNear: eu,
12036
- cut: tu,
12037
- deleteCurrentNode: nu,
12038
- deleteNode: ru,
12039
- deleteRange: iu,
12040
- deleteSelection: su,
12041
- enter: ou,
12042
- exitCode: lu,
12043
- extendMarkRange: au,
12044
- first: cu,
12045
- focus: uu,
12046
- forEach: fu,
12047
- insertContent: hu,
12048
- insertContentAt: gu,
12049
- joinBackward: ku,
12050
- joinDown: bu,
12051
- joinForward: xu,
12052
- joinItemBackward: Su,
12053
- joinItemForward: Mu,
12054
- joinTextblockBackward: wu,
12055
- joinTextblockForward: Cu,
12056
- joinUp: yu,
12057
- keyboardShortcut: Ou,
12058
- lift: vu,
12059
- liftEmptyBlock: Eu,
12060
- liftListItem: Nu,
12061
- newlineInCode: Au,
12062
- resetAttributes: Du,
12063
- scrollIntoView: Iu,
12064
- selectAll: Ru,
12065
- selectNodeBackward: Pu,
12066
- selectNodeForward: Bu,
12067
- selectParentNode: Lu,
12068
- selectTextblockEnd: zu,
12069
- selectTextblockStart: Fu,
12070
- setContent: $u,
12071
- setMark: _u,
12072
- setMeta: Gu,
12073
- setNode: Xu,
12074
- setNodeSelection: Yu,
12075
- setTextSelection: Zu,
12076
- sinkListItem: Qu,
12077
- splitBlock: ef,
12078
- splitListItem: tf,
12079
- toggleList: nf,
12080
- toggleMark: rf,
12081
- toggleNode: sf,
12082
- toggleWrap: of,
12083
- undoInputRule: lf,
12084
- unsetAllMarks: af,
12085
- unsetMark: cf,
12086
- updateAttributes: df,
12087
- wrapIn: uf,
12088
- wrapInList: ff
12031
+ blur: Gd,
12032
+ clearContent: Xd,
12033
+ clearNodes: Yd,
12034
+ command: Zd,
12035
+ createParagraphNear: Qd,
12036
+ cut: eu,
12037
+ deleteCurrentNode: tu,
12038
+ deleteNode: nu,
12039
+ deleteRange: ru,
12040
+ deleteSelection: iu,
12041
+ enter: su,
12042
+ exitCode: ou,
12043
+ extendMarkRange: lu,
12044
+ first: au,
12045
+ focus: du,
12046
+ forEach: uu,
12047
+ insertContent: fu,
12048
+ insertContentAt: mu,
12049
+ joinBackward: bu,
12050
+ joinDown: yu,
12051
+ joinForward: ku,
12052
+ joinItemBackward: xu,
12053
+ joinItemForward: Su,
12054
+ joinTextblockBackward: Mu,
12055
+ joinTextblockForward: wu,
12056
+ joinUp: gu,
12057
+ keyboardShortcut: Tu,
12058
+ lift: Ou,
12059
+ liftEmptyBlock: vu,
12060
+ liftListItem: Eu,
12061
+ newlineInCode: Nu,
12062
+ resetAttributes: Au,
12063
+ scrollIntoView: Du,
12064
+ selectAll: Iu,
12065
+ selectNodeBackward: Ru,
12066
+ selectNodeForward: Pu,
12067
+ selectParentNode: Bu,
12068
+ selectTextblockEnd: Lu,
12069
+ selectTextblockStart: zu,
12070
+ setContent: Fu,
12071
+ setMark: Uu,
12072
+ setMeta: _u,
12073
+ setNode: Gu,
12074
+ setNodeSelection: Xu,
12075
+ setTextSelection: Yu,
12076
+ sinkListItem: Zu,
12077
+ splitBlock: Qu,
12078
+ splitListItem: ef,
12079
+ toggleList: tf,
12080
+ toggleMark: nf,
12081
+ toggleNode: rf,
12082
+ toggleWrap: sf,
12083
+ undoInputRule: of,
12084
+ unsetAllMarks: lf,
12085
+ unsetMark: af,
12086
+ updateAttributes: cf,
12087
+ wrapIn: df,
12088
+ wrapInList: uf
12089
12089
  });
12090
- const pf = G.create({
12090
+ const hf = G.create({
12091
12091
  name: "commands",
12092
12092
  addCommands() {
12093
12093
  return {
12094
- ...hf
12094
+ ...ff
12095
12095
  };
12096
12096
  }
12097
- }), mf = G.create({
12097
+ }), pf = G.create({
12098
12098
  name: "drop",
12099
12099
  addProseMirrorPlugins() {
12100
12100
  return [
@@ -12113,7 +12113,7 @@ const pf = G.create({
12113
12113
  })
12114
12114
  ];
12115
12115
  }
12116
- }), gf = G.create({
12116
+ }), mf = G.create({
12117
12117
  name: "editable",
12118
12118
  addProseMirrorPlugins() {
12119
12119
  return [
@@ -12125,13 +12125,13 @@ const pf = G.create({
12125
12125
  })
12126
12126
  ];
12127
12127
  }
12128
- }), yf = new we("focusEvents"), bf = G.create({
12128
+ }), gf = new we("focusEvents"), yf = G.create({
12129
12129
  name: "focusEvents",
12130
12130
  addProseMirrorPlugins() {
12131
12131
  const { editor: n } = this;
12132
12132
  return [
12133
12133
  new se({
12134
- key: yf,
12134
+ key: gf,
12135
12135
  props: {
12136
12136
  handleDOMEvents: {
12137
12137
  focus: (e, t) => {
@@ -12149,7 +12149,7 @@ const pf = G.create({
12149
12149
  })
12150
12150
  ];
12151
12151
  }
12152
- }), kf = G.create({
12152
+ }), bf = G.create({
12153
12153
  name: "keymap",
12154
12154
  addKeyboardShortcuts() {
12155
12155
  const n = () => this.editor.commands.first(({ commands: o }) => [
@@ -12227,7 +12227,7 @@ const pf = G.create({
12227
12227
  })
12228
12228
  ];
12229
12229
  }
12230
- }), xf = G.create({
12230
+ }), kf = G.create({
12231
12231
  name: "paste",
12232
12232
  addProseMirrorPlugins() {
12233
12233
  return [
@@ -12245,7 +12245,7 @@ const pf = G.create({
12245
12245
  })
12246
12246
  ];
12247
12247
  }
12248
- }), Sf = G.create({
12248
+ }), xf = G.create({
12249
12249
  name: "tabindex",
12250
12250
  addProseMirrorPlugins() {
12251
12251
  return [
@@ -12384,7 +12384,7 @@ class _e {
12384
12384
  }), this.editor.view.dispatch(t);
12385
12385
  }
12386
12386
  }
12387
- const Mf = `.ProseMirror {
12387
+ const Sf = `.ProseMirror {
12388
12388
  position: relative;
12389
12389
  }
12390
12390
 
@@ -12459,14 +12459,14 @@ img.ProseMirror-separator {
12459
12459
  .tippy-box[data-animation=fade][data-state=hidden] {
12460
12460
  opacity: 0
12461
12461
  }`;
12462
- function wf(n, e, t) {
12462
+ function Mf(n, e, t) {
12463
12463
  const r = document.querySelector("style[data-tiptap-style]");
12464
12464
  if (r !== null)
12465
12465
  return r;
12466
12466
  const i = document.createElement("style");
12467
12467
  return e && i.setAttribute("nonce", e), i.setAttribute("data-tiptap-style", ""), i.innerHTML = n, document.getElementsByTagName("head")[0].appendChild(i), i;
12468
12468
  }
12469
- class Cf extends Pd {
12469
+ class wf extends Rd {
12470
12470
  constructor(e = {}) {
12471
12471
  super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
12472
12472
  element: document.createElement("div"),
@@ -12529,7 +12529,7 @@ class Cf extends Pd {
12529
12529
  * Inject CSS styles.
12530
12530
  */
12531
12531
  injectCSS() {
12532
- this.options.injectCSS && document && (this.css = wf(Mf, this.options.injectNonce));
12532
+ this.options.injectCSS && document && (this.css = Mf(Sf, this.options.injectNonce));
12533
12533
  }
12534
12534
  /**
12535
12535
  * Update editor options.
@@ -12598,16 +12598,16 @@ class Cf extends Pd {
12598
12598
  createExtensionManager() {
12599
12599
  var e, t;
12600
12600
  const i = [...this.options.enableCoreExtensions ? [
12601
- gf,
12602
- Gd.configure({
12601
+ mf,
12602
+ _d.configure({
12603
12603
  blockSeparator: (t = (e = this.options.coreExtensionOptions) === null || e === void 0 ? void 0 : e.clipboardTextSerializer) === null || t === void 0 ? void 0 : t.blockSeparator
12604
12604
  }),
12605
- pf,
12605
+ hf,
12606
+ yf,
12606
12607
  bf,
12607
- kf,
12608
- Sf,
12609
- mf,
12610
- xf
12608
+ xf,
12609
+ pf,
12610
+ kf
12611
12611
  ].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s == null ? void 0 : s.type));
12612
12612
  this.extensionManager = new gt(i, this);
12613
12613
  }
@@ -12733,11 +12733,11 @@ class Cf extends Pd {
12733
12733
  * Get attributes of the currently selected node or mark.
12734
12734
  */
12735
12735
  getAttributes(e) {
12736
- return ju(this.state, e);
12736
+ return qu(this.state, e);
12737
12737
  }
12738
12738
  isActive(e, t) {
12739
12739
  const r = typeof e == "string" ? e : null, i = typeof e == "string" ? t : e;
12740
- return Ku(this.state, r, i);
12740
+ return ju(this.state, r, i);
12741
12741
  }
12742
12742
  /**
12743
12743
  * Get the document as JSON.
@@ -12758,7 +12758,7 @@ class Cf extends Pd {
12758
12758
  const { blockSeparator: t = `
12759
12759
 
12760
12760
  `, textSerializers: r = {} } = e || {};
12761
- return Wu(this.state.doc, {
12761
+ return Hu(this.state.doc, {
12762
12762
  blockSeparator: t,
12763
12763
  textSerializers: {
12764
12764
  ...tl(this.schema),
@@ -12923,7 +12923,7 @@ class ne {
12923
12923
  }
12924
12924
  }
12925
12925
  function ct(n) {
12926
- return new qd({
12926
+ return new Wd({
12927
12927
  find: n.find,
12928
12928
  handler: ({ state: e, range: t, match: r, pasteEvent: i }) => {
12929
12929
  const s = E(n.getAttributes, void 0, r, i);
@@ -12940,7 +12940,7 @@ function ct(n) {
12940
12940
  }
12941
12941
  });
12942
12942
  }
12943
- function Tf(n, e) {
12943
+ function Cf(n, e) {
12944
12944
  const { selection: t } = n, { $from: r } = t;
12945
12945
  if (t instanceof S) {
12946
12946
  const s = r.index();
@@ -12955,7 +12955,7 @@ function Tf(n, e) {
12955
12955
  }
12956
12956
  return !1;
12957
12957
  }
12958
- const Of = /^\s*>\s$/, vf = ne.create({
12958
+ const Tf = /^\s*>\s$/, Of = ne.create({
12959
12959
  name: "blockquote",
12960
12960
  addOptions() {
12961
12961
  return {
@@ -12988,12 +12988,12 @@ const Of = /^\s*>\s$/, vf = ne.create({
12988
12988
  addInputRules() {
12989
12989
  return [
12990
12990
  qt({
12991
- find: Of,
12991
+ find: Tf,
12992
12992
  type: this.type
12993
12993
  })
12994
12994
  ];
12995
12995
  }
12996
- }), Ef = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Nf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Af = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Df = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, If = Me.create({
12996
+ }), vf = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Ef = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Nf = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Af = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Df = Me.create({
12997
12997
  name: "bold",
12998
12998
  addOptions() {
12999
12999
  return {
@@ -13038,11 +13038,11 @@ const Of = /^\s*>\s$/, vf = ne.create({
13038
13038
  addInputRules() {
13039
13039
  return [
13040
13040
  at({
13041
- find: Ef,
13041
+ find: vf,
13042
13042
  type: this.type
13043
13043
  }),
13044
13044
  at({
13045
- find: Af,
13045
+ find: Nf,
13046
13046
  type: this.type
13047
13047
  })
13048
13048
  ];
@@ -13050,16 +13050,16 @@ const Of = /^\s*>\s$/, vf = ne.create({
13050
13050
  addPasteRules() {
13051
13051
  return [
13052
13052
  ct({
13053
- find: Nf,
13053
+ find: Ef,
13054
13054
  type: this.type
13055
13055
  }),
13056
13056
  ct({
13057
- find: Df,
13057
+ find: Af,
13058
13058
  type: this.type
13059
13059
  })
13060
13060
  ];
13061
13061
  }
13062
- }), Rf = "listItem", gs = "textStyle", ys = /^\s*([-+*])\s$/, Pf = ne.create({
13062
+ }), If = "listItem", gs = "textStyle", ys = /^\s*([-+*])\s$/, Rf = ne.create({
13063
13063
  name: "bulletList",
13064
13064
  addOptions() {
13065
13065
  return {
@@ -13083,7 +13083,7 @@ const Of = /^\s*>\s$/, vf = ne.create({
13083
13083
  },
13084
13084
  addCommands() {
13085
13085
  return {
13086
- toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Rf, this.editor.getAttributes(gs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
13086
+ toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(If, this.editor.getAttributes(gs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
13087
13087
  };
13088
13088
  },
13089
13089
  addKeyboardShortcuts() {
@@ -13107,7 +13107,7 @@ const Of = /^\s*>\s$/, vf = ne.create({
13107
13107
  n
13108
13108
  ];
13109
13109
  }
13110
- }), Bf = /(^|[^`])`([^`]+)`(?!`)/, Lf = /(^|[^`])`([^`]+)`(?!`)/g, zf = Me.create({
13110
+ }), Pf = /(^|[^`])`([^`]+)`(?!`)/, Bf = /(^|[^`])`([^`]+)`(?!`)/g, Lf = Me.create({
13111
13111
  name: "code",
13112
13112
  addOptions() {
13113
13113
  return {
@@ -13140,7 +13140,7 @@ const Of = /^\s*>\s$/, vf = ne.create({
13140
13140
  addInputRules() {
13141
13141
  return [
13142
13142
  at({
13143
- find: Bf,
13143
+ find: Pf,
13144
13144
  type: this.type
13145
13145
  })
13146
13146
  ];
@@ -13148,12 +13148,12 @@ const Of = /^\s*>\s$/, vf = ne.create({
13148
13148
  addPasteRules() {
13149
13149
  return [
13150
13150
  ct({
13151
- find: Lf,
13151
+ find: Bf,
13152
13152
  type: this.type
13153
13153
  })
13154
13154
  ];
13155
13155
  }
13156
- }), Ff = /^```([a-z]+)?[\s\n]$/, $f = /^~~~([a-z]+)?[\s\n]$/, Vf = ne.create({
13156
+ }), zf = /^```([a-z]+)?[\s\n]$/, Ff = /^~~~([a-z]+)?[\s\n]$/, $f = ne.create({
13157
13157
  name: "codeBlock",
13158
13158
  addOptions() {
13159
13159
  return {
@@ -13244,14 +13244,14 @@ const Of = /^\s*>\s$/, vf = ne.create({
13244
13244
  addInputRules() {
13245
13245
  return [
13246
13246
  Br({
13247
- find: Ff,
13247
+ find: zf,
13248
13248
  type: this.type,
13249
13249
  getAttributes: (n) => ({
13250
13250
  language: n[1]
13251
13251
  })
13252
13252
  }),
13253
13253
  Br({
13254
- find: $f,
13254
+ find: Ff,
13255
13255
  type: this.type,
13256
13256
  getAttributes: (n) => ({
13257
13257
  language: n[1]
@@ -13280,19 +13280,19 @@ const Of = /^\s*>\s$/, vf = ne.create({
13280
13280
  })
13281
13281
  ];
13282
13282
  }
13283
- }), Hf = ne.create({
13283
+ }), Vf = ne.create({
13284
13284
  name: "doc",
13285
13285
  topNode: !0,
13286
13286
  content: "block+"
13287
13287
  });
13288
- function Wf(n = {}) {
13288
+ function Hf(n = {}) {
13289
13289
  return new se({
13290
13290
  view(e) {
13291
- return new qf(e, n);
13291
+ return new Wf(e, n);
13292
13292
  }
13293
13293
  });
13294
13294
  }
13295
- class qf {
13295
+ class Wf {
13296
13296
  constructor(e, t) {
13297
13297
  var r;
13298
13298
  this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = (r = t.width) !== null && r !== void 0 ? r : 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((i) => {
@@ -13366,7 +13366,7 @@ class qf {
13366
13366
  this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
13367
13367
  }
13368
13368
  }
13369
- const jf = G.create({
13369
+ const qf = G.create({
13370
13370
  name: "dropCursor",
13371
13371
  addOptions() {
13372
13372
  return {
@@ -13377,7 +13377,7 @@ const jf = G.create({
13377
13377
  },
13378
13378
  addProseMirrorPlugins() {
13379
13379
  return [
13380
- Wf(this.options)
13380
+ Hf(this.options)
13381
13381
  ];
13382
13382
  }
13383
13383
  });
@@ -13420,7 +13420,7 @@ class R extends v {
13420
13420
  */
13421
13421
  static valid(e) {
13422
13422
  let t = e.parent;
13423
- if (t.inlineContent || !Kf(e) || !Jf(e))
13423
+ if (t.inlineContent || !jf(e) || !Kf(e))
13424
13424
  return !1;
13425
13425
  let r = t.type.spec.allowGapCursor;
13426
13426
  if (r != null)
@@ -13484,7 +13484,7 @@ class oi {
13484
13484
  function dl(n) {
13485
13485
  return n.isAtom || n.spec.isolating || n.spec.createGapCursor;
13486
13486
  }
13487
- function Kf(n) {
13487
+ function jf(n) {
13488
13488
  for (let e = n.depth; e >= 0; e--) {
13489
13489
  let t = n.index(e), r = n.node(e);
13490
13490
  if (t == 0) {
@@ -13501,7 +13501,7 @@ function Kf(n) {
13501
13501
  }
13502
13502
  return !0;
13503
13503
  }
13504
- function Jf(n) {
13504
+ function Kf(n) {
13505
13505
  for (let e = n.depth; e >= 0; e--) {
13506
13506
  let t = n.indexAfter(e), r = n.node(e);
13507
13507
  if (t == r.childCount) {
@@ -13518,20 +13518,20 @@ function Jf(n) {
13518
13518
  }
13519
13519
  return !0;
13520
13520
  }
13521
- function Uf() {
13521
+ function Jf() {
13522
13522
  return new se({
13523
13523
  props: {
13524
- decorations: Yf,
13524
+ decorations: Xf,
13525
13525
  createSelectionBetween(n, e, t) {
13526
13526
  return e.pos == t.pos && R.valid(t) ? new R(t) : null;
13527
13527
  },
13528
- handleClick: Gf,
13529
- handleKeyDown: _f,
13530
- handleDOMEvents: { beforeinput: Xf }
13528
+ handleClick: _f,
13529
+ handleKeyDown: Uf,
13530
+ handleDOMEvents: { beforeinput: Gf }
13531
13531
  }
13532
13532
  });
13533
13533
  }
13534
- const _f = $o({
13534
+ const Uf = $o({
13535
13535
  ArrowLeft: an("horiz", -1),
13536
13536
  ArrowRight: an("horiz", 1),
13537
13537
  ArrowUp: an("vert", -1),
@@ -13550,7 +13550,7 @@ function an(n, e) {
13550
13550
  return c ? (i && i(r.tr.setSelection(new R(c))), !0) : !1;
13551
13551
  };
13552
13552
  }
13553
- function Gf(n, e, t) {
13553
+ function _f(n, e, t) {
13554
13554
  if (!n || !n.editable)
13555
13555
  return !1;
13556
13556
  let r = n.state.doc.resolve(e);
@@ -13559,7 +13559,7 @@ function Gf(n, e, t) {
13559
13559
  let i = n.posAtCoords({ left: t.clientX, top: t.clientY });
13560
13560
  return i && i.inside > -1 && S.isSelectable(n.state.doc.nodeAt(i.inside)) ? !1 : (n.dispatch(n.state.tr.setSelection(new R(r))), !0);
13561
13561
  }
13562
- function Xf(n, e) {
13562
+ function Gf(n, e) {
13563
13563
  if (e.inputType != "insertCompositionText" || !(n.state.selection instanceof R))
13564
13564
  return !1;
13565
13565
  let { $from: t } = n.state.selection, r = t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);
@@ -13571,17 +13571,17 @@ function Xf(n, e) {
13571
13571
  let s = n.state.tr.replace(t.pos, t.pos, new k(i, 0, 0));
13572
13572
  return s.setSelection(M.near(s.doc.resolve(t.pos + 1))), n.dispatch(s), !1;
13573
13573
  }
13574
- function Yf(n) {
13574
+ function Xf(n) {
13575
13575
  if (!(n.selection instanceof R))
13576
13576
  return null;
13577
13577
  let e = document.createElement("div");
13578
13578
  return e.className = "ProseMirror-gapcursor", z.create(n.doc, [he.widget(n.selection.head, e, { key: "gapcursor" })]);
13579
13579
  }
13580
- const Zf = G.create({
13580
+ const Yf = G.create({
13581
13581
  name: "gapCursor",
13582
13582
  addProseMirrorPlugins() {
13583
13583
  return [
13584
- Uf()
13584
+ Jf()
13585
13585
  ];
13586
13586
  },
13587
13587
  extendNodeSchema(n) {
@@ -13595,7 +13595,7 @@ const Zf = G.create({
13595
13595
  allowGapCursor: (e = E(x(n, "allowGapCursor", t))) !== null && e !== void 0 ? e : null
13596
13596
  };
13597
13597
  }
13598
- }), Qf = ne.create({
13598
+ }), Zf = ne.create({
13599
13599
  name: "hardBreak",
13600
13600
  addOptions() {
13601
13601
  return {
@@ -13645,7 +13645,7 @@ const Zf = G.create({
13645
13645
  "Shift-Enter": () => this.editor.commands.setHardBreak()
13646
13646
  };
13647
13647
  }
13648
- }), eh = ne.create({
13648
+ }), Qf = ne.create({
13649
13649
  name: "heading",
13650
13650
  addOptions() {
13651
13651
  return {
@@ -13704,7 +13704,7 @@ V.prototype.prepend = function(e) {
13704
13704
  return e.length ? V.from(e).append(this) : this;
13705
13705
  };
13706
13706
  V.prototype.appendInner = function(e) {
13707
- return new th(this, e);
13707
+ return new eh(this, e);
13708
13708
  };
13709
13709
  V.prototype.slice = function(e, t) {
13710
13710
  return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? V.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
@@ -13759,7 +13759,7 @@ var ul = /* @__PURE__ */ function(n) {
13759
13759
  }, Object.defineProperties(e.prototype, t), e;
13760
13760
  }(V);
13761
13761
  V.empty = new ul([]);
13762
- var th = /* @__PURE__ */ function(n) {
13762
+ var eh = /* @__PURE__ */ function(n) {
13763
13763
  function e(t, r) {
13764
13764
  n.call(this), this.left = t, this.right = r, this.length = t.length + r.length, this.depth = Math.max(t.depth, r.depth) + 1;
13765
13765
  }
@@ -13792,7 +13792,7 @@ var th = /* @__PURE__ */ function(n) {
13792
13792
  return this.left.depth >= Math.max(this.right.depth, r.depth) + 1 ? new e(this.left, new e(this.right, r)) : new e(this, r);
13793
13793
  }, e;
13794
13794
  }(V);
13795
- const nh = 500;
13795
+ const th = 500;
13796
13796
  class ge {
13797
13797
  constructor(e, t) {
13798
13798
  this.items = e, this.eventCount = t;
@@ -13834,7 +13834,7 @@ class ge {
13834
13834
  (h = a && a.merge(f)) && (f = h, d ? s.pop() : l = l.slice(0, l.length - 1)), s.push(f), t && (o++, t = void 0), i || (a = f);
13835
13835
  }
13836
13836
  let c = o - r.depth;
13837
- return c > ih && (l = rh(l, c), o -= c), new ge(l.append(s), o);
13837
+ return c > rh && (l = nh(l, c), o -= c), new ge(l.append(s), o);
13838
13838
  }
13839
13839
  remapping(e, t) {
13840
13840
  let r = new Lt();
@@ -13874,7 +13874,7 @@ class ge {
13874
13874
  for (let f = t; f < o; f++)
13875
13875
  c.push(new be(s.maps[f]));
13876
13876
  let d = this.items.slice(0, i).append(c).append(r), u = new ge(d, l);
13877
- return u.emptyItemCount() > nh && (u = u.compress(this.items.length - r.length)), u;
13877
+ return u.emptyItemCount() > th && (u = u.compress(this.items.length - r.length)), u;
13878
13878
  }
13879
13879
  emptyItemCount() {
13880
13880
  let e = 0;
@@ -13906,7 +13906,7 @@ class ge {
13906
13906
  }
13907
13907
  }
13908
13908
  ge.empty = new ge(V.empty, 0);
13909
- function rh(n, e) {
13909
+ function nh(n, e) {
13910
13910
  let t;
13911
13911
  return n.forEach((r, i) => {
13912
13912
  if (r.selection && e-- == 0)
@@ -13930,23 +13930,23 @@ class Re {
13930
13930
  this.done = e, this.undone = t, this.prevRanges = r, this.prevTime = i, this.prevComposition = s;
13931
13931
  }
13932
13932
  }
13933
- const ih = 20;
13934
- function sh(n, e, t, r) {
13933
+ const rh = 20;
13934
+ function ih(n, e, t, r) {
13935
13935
  let i = t.getMeta(rt), s;
13936
13936
  if (i)
13937
13937
  return i.historyState;
13938
- t.getMeta(ah) && (n = new Re(n.done, n.undone, null, 0, -1));
13938
+ t.getMeta(lh) && (n = new Re(n.done, n.undone, null, 0, -1));
13939
13939
  let o = t.getMeta("appendedTransaction");
13940
13940
  if (t.steps.length == 0)
13941
13941
  return n;
13942
13942
  if (o && o.getMeta(rt))
13943
13943
  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);
13944
13944
  if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
13945
- let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !oh(t, n.prevRanges)), c = o ? ur(n.prevRanges, t.mapping) : bs(t.mapping.maps);
13945
+ 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);
13946
13946
  return new Re(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, fn(e)), ge.empty, c, t.time, l ?? n.prevComposition);
13947
13947
  } 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);
13948
13948
  }
13949
- function oh(n, e) {
13949
+ function sh(n, e) {
13950
13950
  if (!e)
13951
13951
  return !1;
13952
13952
  if (!n.docChanged)
@@ -13973,7 +13973,7 @@ function ur(n, e) {
13973
13973
  }
13974
13974
  return t;
13975
13975
  }
13976
- function lh(n, e, t) {
13976
+ function oh(n, e, t) {
13977
13977
  let r = fn(e), i = rt.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, r);
13978
13978
  if (!s)
13979
13979
  return null;
@@ -13993,8 +13993,8 @@ function fn(n) {
13993
13993
  }
13994
13994
  return fr;
13995
13995
  }
13996
- const rt = new we("history"), ah = new we("closeHistory");
13997
- function ch(n = {}) {
13996
+ const rt = new we("history"), lh = new we("closeHistory");
13997
+ function ah(n = {}) {
13998
13998
  return n = {
13999
13999
  depth: n.depth || 100,
14000
14000
  newGroupDelay: n.newGroupDelay || 500
@@ -14005,7 +14005,7 @@ function ch(n = {}) {
14005
14005
  return new Re(ge.empty, ge.empty, null, 0, -1);
14006
14006
  },
14007
14007
  apply(e, t, r) {
14008
- return sh(t, r, e, n);
14008
+ return ih(t, r, e, n);
14009
14009
  }
14010
14010
  },
14011
14011
  config: n,
@@ -14025,13 +14025,13 @@ function fl(n, e) {
14025
14025
  if (!i || (n ? i.undone : i.done).eventCount == 0)
14026
14026
  return !1;
14027
14027
  if (r) {
14028
- let s = lh(i, t, n);
14028
+ let s = oh(i, t, n);
14029
14029
  s && r(e ? s.scrollIntoView() : s);
14030
14030
  }
14031
14031
  return !0;
14032
14032
  };
14033
14033
  }
14034
- const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14034
+ const hl = fl(!1, !0), pl = fl(!0, !0), ch = G.create({
14035
14035
  name: "history",
14036
14036
  addOptions() {
14037
14037
  return {
@@ -14047,7 +14047,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14047
14047
  },
14048
14048
  addProseMirrorPlugins() {
14049
14049
  return [
14050
- ch(this.options)
14050
+ ah(this.options)
14051
14051
  ];
14052
14052
  },
14053
14053
  addKeyboardShortcuts() {
@@ -14060,7 +14060,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14060
14060
  "Shift-Mod-я": () => this.editor.commands.redo()
14061
14061
  };
14062
14062
  }
14063
- }), uh = ne.create({
14063
+ }), dh = ne.create({
14064
14064
  name: "horizontalRule",
14065
14065
  addOptions() {
14066
14066
  return {
@@ -14077,7 +14077,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14077
14077
  addCommands() {
14078
14078
  return {
14079
14079
  setHorizontalRule: () => ({ chain: n, state: e }) => {
14080
- if (!Tf(e, e.schema.nodes[this.name]))
14080
+ if (!Cf(e, e.schema.nodes[this.name]))
14081
14081
  return !1;
14082
14082
  const { selection: t } = e, { $from: r, $to: i } = t, s = n();
14083
14083
  return r.parentOffset === 0 ? s.insertContentAt({
@@ -14085,7 +14085,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14085
14085
  to: i.pos
14086
14086
  }, {
14087
14087
  type: this.name
14088
- }) : Ju(t) ? s.insertContentAt(i.pos, {
14088
+ }) : Ku(t) ? s.insertContentAt(i.pos, {
14089
14089
  type: this.name
14090
14090
  }) : s.insertContent({ type: this.name }), s.command(({ tr: o, dispatch: l }) => {
14091
14091
  var a;
@@ -14112,7 +14112,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14112
14112
  })
14113
14113
  ];
14114
14114
  }
14115
- }), fh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, hh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, ph = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, mh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, gh = Me.create({
14115
+ }), uh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, fh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, hh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, ph = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, mh = Me.create({
14116
14116
  name: "italic",
14117
14117
  addOptions() {
14118
14118
  return {
@@ -14156,11 +14156,11 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14156
14156
  addInputRules() {
14157
14157
  return [
14158
14158
  at({
14159
- find: fh,
14159
+ find: uh,
14160
14160
  type: this.type
14161
14161
  }),
14162
14162
  at({
14163
- find: ph,
14163
+ find: hh,
14164
14164
  type: this.type
14165
14165
  })
14166
14166
  ];
@@ -14168,16 +14168,16 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14168
14168
  addPasteRules() {
14169
14169
  return [
14170
14170
  ct({
14171
- find: hh,
14171
+ find: fh,
14172
14172
  type: this.type
14173
14173
  }),
14174
14174
  ct({
14175
- find: mh,
14175
+ find: ph,
14176
14176
  type: this.type
14177
14177
  })
14178
14178
  ];
14179
14179
  }
14180
- }), yh = ne.create({
14180
+ }), gh = ne.create({
14181
14181
  name: "listItem",
14182
14182
  addOptions() {
14183
14183
  return {
@@ -14205,7 +14205,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14205
14205
  "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
14206
14206
  };
14207
14207
  }
14208
- }), bh = "listItem", xs = "textStyle", Ss = /^(\d+)\.\s$/, kh = ne.create({
14208
+ }), yh = "listItem", xs = "textStyle", Ss = /^(\d+)\.\s$/, bh = ne.create({
14209
14209
  name: "orderedList",
14210
14210
  addOptions() {
14211
14211
  return {
@@ -14244,7 +14244,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14244
14244
  },
14245
14245
  addCommands() {
14246
14246
  return {
14247
- toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(bh, this.editor.getAttributes(xs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
14247
+ toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(yh, this.editor.getAttributes(xs)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
14248
14248
  };
14249
14249
  },
14250
14250
  addKeyboardShortcuts() {
@@ -14271,7 +14271,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14271
14271
  n
14272
14272
  ];
14273
14273
  }
14274
- }), xh = ne.create({
14274
+ }), kh = ne.create({
14275
14275
  name: "paragraph",
14276
14276
  priority: 1e3,
14277
14277
  addOptions() {
@@ -14299,7 +14299,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14299
14299
  "Mod-Alt-0": () => this.editor.commands.setParagraph()
14300
14300
  };
14301
14301
  }
14302
- }), Sh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, Mh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, wh = Me.create({
14302
+ }), xh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, Sh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, Mh = Me.create({
14303
14303
  name: "strike",
14304
14304
  addOptions() {
14305
14305
  return {
@@ -14342,7 +14342,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14342
14342
  addInputRules() {
14343
14343
  return [
14344
14344
  at({
14345
- find: Sh,
14345
+ find: xh,
14346
14346
  type: this.type
14347
14347
  })
14348
14348
  ];
@@ -14350,21 +14350,21 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14350
14350
  addPasteRules() {
14351
14351
  return [
14352
14352
  ct({
14353
- find: Mh,
14353
+ find: Sh,
14354
14354
  type: this.type
14355
14355
  })
14356
14356
  ];
14357
14357
  }
14358
- }), Ch = ne.create({
14358
+ }), wh = ne.create({
14359
14359
  name: "text",
14360
14360
  group: "inline"
14361
- }), Th = G.create({
14361
+ }), Ch = G.create({
14362
14362
  name: "starterKit",
14363
14363
  addExtensions() {
14364
14364
  const n = [];
14365
- return this.options.bold !== !1 && n.push(If.configure(this.options.bold)), this.options.blockquote !== !1 && n.push(vf.configure(this.options.blockquote)), this.options.bulletList !== !1 && n.push(Pf.configure(this.options.bulletList)), this.options.code !== !1 && n.push(zf.configure(this.options.code)), this.options.codeBlock !== !1 && n.push(Vf.configure(this.options.codeBlock)), this.options.document !== !1 && n.push(Hf.configure(this.options.document)), this.options.dropcursor !== !1 && n.push(jf.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && n.push(Zf.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && n.push(Qf.configure(this.options.hardBreak)), this.options.heading !== !1 && n.push(eh.configure(this.options.heading)), this.options.history !== !1 && n.push(dh.configure(this.options.history)), this.options.horizontalRule !== !1 && n.push(uh.configure(this.options.horizontalRule)), this.options.italic !== !1 && n.push(gh.configure(this.options.italic)), this.options.listItem !== !1 && n.push(yh.configure(this.options.listItem)), this.options.orderedList !== !1 && n.push(kh.configure(this.options.orderedList)), this.options.paragraph !== !1 && n.push(xh.configure(this.options.paragraph)), this.options.strike !== !1 && n.push(wh.configure(this.options.strike)), this.options.text !== !1 && n.push(Ch.configure(this.options.text)), n;
14365
+ return this.options.bold !== !1 && n.push(Df.configure(this.options.bold)), this.options.blockquote !== !1 && n.push(Of.configure(this.options.blockquote)), this.options.bulletList !== !1 && n.push(Rf.configure(this.options.bulletList)), this.options.code !== !1 && n.push(Lf.configure(this.options.code)), this.options.codeBlock !== !1 && n.push($f.configure(this.options.codeBlock)), this.options.document !== !1 && n.push(Vf.configure(this.options.document)), this.options.dropcursor !== !1 && n.push(qf.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && n.push(Yf.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && n.push(Zf.configure(this.options.hardBreak)), this.options.heading !== !1 && n.push(Qf.configure(this.options.heading)), this.options.history !== !1 && n.push(ch.configure(this.options.history)), this.options.horizontalRule !== !1 && n.push(dh.configure(this.options.horizontalRule)), this.options.italic !== !1 && n.push(mh.configure(this.options.italic)), this.options.listItem !== !1 && n.push(gh.configure(this.options.listItem)), this.options.orderedList !== !1 && n.push(bh.configure(this.options.orderedList)), this.options.paragraph !== !1 && n.push(kh.configure(this.options.paragraph)), this.options.strike !== !1 && n.push(Mh.configure(this.options.strike)), this.options.text !== !1 && n.push(wh.configure(this.options.text)), n;
14366
14366
  }
14367
- }), Oh = (n) => {
14367
+ }), Th = (n) => {
14368
14368
  if (!n.children.length)
14369
14369
  return;
14370
14370
  const e = n.querySelectorAll("span");
@@ -14373,7 +14373,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14373
14373
  const s = t.getAttribute("style"), o = (i = (r = t.parentElement) === null || r === void 0 ? void 0 : r.closest("span")) === null || i === void 0 ? void 0 : i.getAttribute("style");
14374
14374
  t.setAttribute("style", `${o};${s}`);
14375
14375
  });
14376
- }, vh = Me.create({
14376
+ }, Oh = Me.create({
14377
14377
  name: "textStyle",
14378
14378
  priority: 101,
14379
14379
  addOptions() {
@@ -14386,7 +14386,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14386
14386
  return [
14387
14387
  {
14388
14388
  tag: "span",
14389
- getAttrs: (n) => n.hasAttribute("style") ? (this.options.mergeNestedSpanStyles && Oh(n), {}) : !1
14389
+ getAttrs: (n) => n.hasAttribute("style") ? (this.options.mergeNestedSpanStyles && Th(n), {}) : !1
14390
14390
  }
14391
14391
  ];
14392
14392
  },
@@ -14405,7 +14405,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14405
14405
  }
14406
14406
  };
14407
14407
  }
14408
- }), Eh = G.create({
14408
+ }), vh = G.create({
14409
14409
  name: "color",
14410
14410
  addOptions() {
14411
14411
  return {
@@ -14437,7 +14437,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14437
14437
  unsetColor: () => ({ chain: n }) => n().setMark("textStyle", { color: null }).removeEmptyTextStyle().run()
14438
14438
  };
14439
14439
  }
14440
- }), Nh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Ah = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Dh = Me.create({
14440
+ }), Eh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Nh = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Ah = Me.create({
14441
14441
  name: "highlight",
14442
14442
  addOptions() {
14443
14443
  return {
@@ -14482,7 +14482,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14482
14482
  addInputRules() {
14483
14483
  return [
14484
14484
  at({
14485
- find: Nh,
14485
+ find: Eh,
14486
14486
  type: this.type
14487
14487
  })
14488
14488
  ];
@@ -14490,12 +14490,12 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14490
14490
  addPasteRules() {
14491
14491
  return [
14492
14492
  ct({
14493
- find: Ah,
14493
+ find: Nh,
14494
14494
  type: this.type
14495
14495
  })
14496
14496
  ];
14497
14497
  }
14498
- }), Ih = G.create({
14498
+ }), Dh = G.create({
14499
14499
  name: "textAlign",
14500
14500
  addOptions() {
14501
14501
  return {
@@ -14536,7 +14536,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14536
14536
  "Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
14537
14537
  };
14538
14538
  }
14539
- }), Rh = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Ph = ne.create({
14539
+ }), Ih = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Rh = ne.create({
14540
14540
  name: "image",
14541
14541
  addOptions() {
14542
14542
  return {
@@ -14586,7 +14586,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14586
14586
  addInputRules() {
14587
14587
  return [
14588
14588
  cl({
14589
- find: Rh,
14589
+ find: Ih,
14590
14590
  type: this.type,
14591
14591
  getAttributes: (n) => {
14592
14592
  const [, , e, t, r] = n;
@@ -14597,7 +14597,7 @@ const hl = fl(!1, !0), pl = fl(!0, !0), dh = G.create({
14597
14597
  }
14598
14598
  });
14599
14599
  var re, Gt, Xt, de, Lr, ml, gl, yl, bl;
14600
- class Bh extends vl {
14600
+ class Ph extends Ol {
14601
14601
  constructor() {
14602
14602
  super();
14603
14603
  F(this, de);
@@ -14651,7 +14651,7 @@ Lr = function() {
14651
14651
  const t = Ae.getComponentCssPath("nineEditor.css"), r = t ? `@import "${t}";` : "";
14652
14652
  this.shadowRoot.innerHTML = `
14653
14653
  <style>
14654
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.70/dist/css/nineEditor.css";
14654
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-ux@0.1.72/dist/css/nineEditor.css";
14655
14655
  ${r}
14656
14656
  </style>
14657
14657
 
@@ -14691,22 +14691,22 @@ Lr = function() {
14691
14691
  console.log(i.target, s), O(this, re).chain().focus().setMark("textStyle", { fontSize: s }).run();
14692
14692
  };
14693
14693
  }, gl = function() {
14694
- oe(this, re, new Cf({
14694
+ oe(this, re, new wf({
14695
14695
  element: O(this, Gt),
14696
14696
  editable: !this.readonly,
14697
14697
  // 4. 생성 시 readonly 여부 반영
14698
14698
  extensions: [
14699
- Th,
14699
+ Ch,
14700
14700
  // 기본 셋 (Bold, Italic, Strike 등 포함)
14701
14701
  //Underline, // StarterKit에 없으므로 유지
14702
- Eh,
14702
+ vh,
14703
14703
  // StarterKit에 없으므로 유지
14704
- Dh.configure({ multicolor: !0 }),
14705
- Ih.configure({ types: ["heading", "paragraph"] }),
14706
- Ph.configure({ inline: !0, allowBase64: !0 }),
14704
+ Ah.configure({ multicolor: !0 }),
14705
+ Dh.configure({ types: ["heading", "paragraph"] }),
14706
+ Rh.configure({ inline: !0, allowBase64: !0 }),
14707
14707
  // TextStyle은 여기서 'extend'로 직접 정의하므로
14708
14708
  // 배열에 별도의 TextStyle을 또 넣지 마세요.
14709
- vh.extend({
14709
+ Oh.extend({
14710
14710
  addAttributes() {
14711
14711
  return {
14712
14712
  fontSize: {
@@ -14757,16 +14757,16 @@ const Ms = {
14757
14757
  confirm: window.confirm
14758
14758
  }, ws = () => {
14759
14759
  var t, r;
14760
- wl.log(yt);
14760
+ console.log(yt, window.nine);
14761
14761
  const { nativeOverride: n } = ((r = (t = yt) == null ? void 0 : t.config) == null ? void 0 : r.ux) || {}, e = Array.isArray(n) ? n : n === !0 ? ["alert", "confirm"] : [];
14762
14762
  console.log(e), window.alert = e.includes("alert") ? (i) => Ae.alert(i) : Ms.alert, window.confirm = e.includes("confirm") ? async (i) => await Ae.confirm(i) : Ms.confirm, yt.config.debug && e.length > 0 && console.log(`[nine-ux] Native API Overridden: ${e.join(", ")}`);
14763
- }, Lh = () => {
14763
+ }, Bh = () => {
14764
14764
  ws(), Ml((n) => {
14765
14765
  (n === "ux" || n === "config") && ws();
14766
14766
  });
14767
14767
  };
14768
- Lh();
14768
+ Bh();
14769
14769
  yt.alert = Ae.alert.bind(Ae);
14770
14770
  yt.confirm = Ae.confirm.bind(Ae);
14771
- typeof window < "u" && (customElements.get("nine-editor") || customElements.define("nine-editor", Bh));
14771
+ typeof window < "u" && (customElements.get("nine-editor") || customElements.define("nine-editor", Ph));
14772
14772
  //# sourceMappingURL=nine-ux.es.js.map