reactjs-tiptap-editor 0.3.19 → 0.3.21

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.
Files changed (244) hide show
  1. package/lib/{ActionMenuButton-BPq-R8E7.cjs → ActionMenuButton-BTFBZyG2.cjs} +1 -1
  2. package/lib/{ActionMenuButton-DCACoSG3.js → ActionMenuButton-DXwnYZhJ.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +28 -28
  5. package/lib/Attachment.d.ts +28 -28
  6. package/lib/Attachment.js +3 -3
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +28 -28
  9. package/lib/Blockquote.d.ts +28 -28
  10. package/lib/Blockquote.js +2 -2
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +28 -28
  13. package/lib/Bold.d.ts +28 -28
  14. package/lib/Bold.js +2 -2
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +28 -28
  17. package/lib/BulletList.d.ts +28 -28
  18. package/lib/BulletList.js +2 -2
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +28 -28
  21. package/lib/Clear.d.ts +28 -28
  22. package/lib/Clear.js +2 -2
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +28 -28
  25. package/lib/Code.d.ts +28 -28
  26. package/lib/Code.js +2 -2
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +28 -28
  29. package/lib/CodeBlock.d.ts +28 -28
  30. package/lib/CodeBlock.js +3 -3
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +28 -28
  33. package/lib/CodeView.d.ts +28 -28
  34. package/lib/CodeView.js +2 -2
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +28 -28
  37. package/lib/Color.d.ts +28 -28
  38. package/lib/Color.js +3 -3
  39. package/lib/Document.cjs +1 -1
  40. package/lib/Document.d.cts +28 -28
  41. package/lib/Document.d.ts +28 -28
  42. package/lib/Document.js +1 -1
  43. package/lib/{Drawer-Dwx9V0Xb.cjs → Drawer-BrHHs2E9.cjs} +1 -1
  44. package/lib/{Drawer-Qh1zEBl3.js → Drawer-CVuwyG50.js} +3 -3
  45. package/lib/Drawer.cjs +1 -1
  46. package/lib/Drawer.d.cts +28 -28
  47. package/lib/Drawer.d.ts +28 -28
  48. package/lib/Drawer.js +4 -4
  49. package/lib/Emoji.cjs +1 -1
  50. package/lib/Emoji.d.cts +28 -28
  51. package/lib/Emoji.d.ts +28 -28
  52. package/lib/Emoji.js +4 -4
  53. package/lib/{Excalidraw-BP_-zWZH.cjs → Excalidraw-Be_GDV4Q.cjs} +1 -1
  54. package/lib/{Excalidraw-DD3P3ClH.js → Excalidraw-frMX4K62.js} +3 -3
  55. package/lib/Excalidraw.cjs +1 -1
  56. package/lib/Excalidraw.d.cts +28 -28
  57. package/lib/Excalidraw.d.ts +28 -28
  58. package/lib/Excalidraw.js +3 -3
  59. package/lib/ExportPdf.cjs +1 -1
  60. package/lib/ExportPdf.d.cts +28 -28
  61. package/lib/ExportPdf.d.ts +28 -28
  62. package/lib/ExportPdf.js +2 -2
  63. package/lib/ExportWord.cjs +1 -1
  64. package/lib/ExportWord.d.cts +28 -28
  65. package/lib/ExportWord.d.ts +28 -28
  66. package/lib/ExportWord.js +2 -2
  67. package/lib/FontFamily.cjs +1 -1
  68. package/lib/FontFamily.d.cts +28 -28
  69. package/lib/FontFamily.d.ts +28 -28
  70. package/lib/FontFamily.js +4 -4
  71. package/lib/FontSize.cjs +1 -1
  72. package/lib/FontSize.d.cts +28 -28
  73. package/lib/FontSize.d.ts +28 -28
  74. package/lib/FontSize.js +3 -3
  75. package/lib/FormatPainter.cjs +1 -1
  76. package/lib/FormatPainter.d.cts +28 -28
  77. package/lib/FormatPainter.d.ts +28 -28
  78. package/lib/FormatPainter.js +2 -2
  79. package/lib/Heading.cjs +1 -1
  80. package/lib/Heading.d.cts +28 -28
  81. package/lib/Heading.d.ts +28 -28
  82. package/lib/Heading.js +3 -3
  83. package/lib/Highlight.cjs +1 -1
  84. package/lib/Highlight.d.cts +28 -28
  85. package/lib/Highlight.d.ts +28 -28
  86. package/lib/Highlight.js +2 -2
  87. package/lib/History.cjs +1 -1
  88. package/lib/History.d.cts +28 -28
  89. package/lib/History.d.ts +28 -28
  90. package/lib/History.js +2 -2
  91. package/lib/HorizontalRule.cjs +1 -1
  92. package/lib/HorizontalRule.d.cts +28 -28
  93. package/lib/HorizontalRule.d.ts +28 -28
  94. package/lib/HorizontalRule.js +2 -2
  95. package/lib/Iframe.cjs +1 -1
  96. package/lib/Iframe.d.cts +28 -28
  97. package/lib/Iframe.d.ts +28 -28
  98. package/lib/Iframe.js +3 -3
  99. package/lib/Image.cjs +1 -1
  100. package/lib/Image.d.cts +28 -28
  101. package/lib/Image.d.ts +28 -28
  102. package/lib/Image.js +3 -3
  103. package/lib/ImageGif.cjs +1 -1
  104. package/lib/ImageGif.d.cts +28 -28
  105. package/lib/ImageGif.d.ts +28 -28
  106. package/lib/ImageGif.js +3 -3
  107. package/lib/ImportWord.cjs +74 -74
  108. package/lib/ImportWord.d.cts +28 -28
  109. package/lib/ImportWord.d.ts +28 -28
  110. package/lib/ImportWord.js +5015 -4998
  111. package/lib/Indent.cjs +1 -1
  112. package/lib/Indent.d.cts +28 -28
  113. package/lib/Indent.d.ts +28 -28
  114. package/lib/Indent.js +2 -2
  115. package/lib/Italic.cjs +1 -1
  116. package/lib/Italic.d.cts +28 -28
  117. package/lib/Italic.d.ts +28 -28
  118. package/lib/Italic.js +2 -2
  119. package/lib/Katex.cjs +1 -1
  120. package/lib/Katex.d.cts +28 -28
  121. package/lib/Katex.d.ts +28 -28
  122. package/lib/Katex.js +4 -4
  123. package/lib/LineHeight.cjs +1 -1
  124. package/lib/LineHeight.d.cts +28 -28
  125. package/lib/LineHeight.d.ts +28 -28
  126. package/lib/LineHeight.js +2 -2
  127. package/lib/Link.cjs +1 -1
  128. package/lib/Link.d.cts +28 -28
  129. package/lib/Link.d.ts +28 -28
  130. package/lib/Link.js +2 -2
  131. package/lib/ListItem.cjs +1 -1
  132. package/lib/ListItem.d.cts +28 -28
  133. package/lib/ListItem.d.ts +28 -28
  134. package/lib/ListItem.js +1 -1
  135. package/lib/Mention.cjs +1 -1
  136. package/lib/Mention.d.cts +28 -28
  137. package/lib/Mention.d.ts +28 -28
  138. package/lib/Mention.js +123 -91
  139. package/lib/Mermaid.cjs +1 -1
  140. package/lib/Mermaid.d.cts +28 -28
  141. package/lib/Mermaid.d.ts +28 -28
  142. package/lib/Mermaid.js +4 -4
  143. package/lib/MoreMark.cjs +1 -1
  144. package/lib/MoreMark.d.cts +28 -28
  145. package/lib/MoreMark.d.ts +28 -28
  146. package/lib/MoreMark.js +3 -3
  147. package/lib/MultiColumn.cjs +1 -1
  148. package/lib/MultiColumn.d.cts +28 -28
  149. package/lib/MultiColumn.d.ts +28 -28
  150. package/lib/MultiColumn.js +2 -2
  151. package/lib/OrderedList.cjs +1 -1
  152. package/lib/OrderedList.d.cts +28 -28
  153. package/lib/OrderedList.d.ts +28 -28
  154. package/lib/OrderedList.js +2 -2
  155. package/lib/RichTextEditor-CAxwVWUE.cjs +137 -0
  156. package/lib/{RichTextEditor-DIvPROxl.js → RichTextEditor-DjTnd5Uu.js} +1607 -1603
  157. package/lib/SearchAndReplace.cjs +1 -1
  158. package/lib/SearchAndReplace.d.cts +28 -28
  159. package/lib/SearchAndReplace.d.ts +28 -28
  160. package/lib/SearchAndReplace.js +2 -2
  161. package/lib/Selection.cjs +1 -1
  162. package/lib/Selection.d.cts +28 -28
  163. package/lib/Selection.d.ts +28 -28
  164. package/lib/Selection.js +1 -1
  165. package/lib/SlashCommand.cjs +1 -1
  166. package/lib/SlashCommand.d.cts +28 -28
  167. package/lib/SlashCommand.d.ts +28 -28
  168. package/lib/SlashCommand.js +4 -4
  169. package/lib/Strike.cjs +1 -1
  170. package/lib/Strike.d.cts +28 -28
  171. package/lib/Strike.d.ts +28 -28
  172. package/lib/Strike.js +2 -2
  173. package/lib/SubAndSuperScript.cjs +1 -1
  174. package/lib/SubAndSuperScript.d.cts +28 -28
  175. package/lib/SubAndSuperScript.d.ts +28 -28
  176. package/lib/SubAndSuperScript.js +3 -3
  177. package/lib/Table.cjs +1 -1
  178. package/lib/Table.d.cts +28 -28
  179. package/lib/Table.d.ts +28 -28
  180. package/lib/Table.js +2 -2
  181. package/lib/TableOfContent.cjs +1 -1
  182. package/lib/TableOfContent.d.cts +28 -28
  183. package/lib/TableOfContent.d.ts +28 -28
  184. package/lib/TableOfContent.js +3 -3
  185. package/lib/TaskList.cjs +1 -1
  186. package/lib/TaskList.d.cts +28 -28
  187. package/lib/TaskList.d.ts +28 -28
  188. package/lib/TaskList.js +37 -33
  189. package/lib/TextAlign.cjs +1 -1
  190. package/lib/TextAlign.d.cts +28 -28
  191. package/lib/TextAlign.d.ts +28 -28
  192. package/lib/TextAlign.js +2 -2
  193. package/lib/TextBubble.cjs +1 -1
  194. package/lib/TextBubble.d.cts +28 -28
  195. package/lib/TextBubble.d.ts +28 -28
  196. package/lib/TextBubble.js +2 -2
  197. package/lib/TextDirection.cjs +1 -1
  198. package/lib/TextDirection.d.cts +28 -28
  199. package/lib/TextDirection.d.ts +28 -28
  200. package/lib/TextDirection.js +2 -2
  201. package/lib/TextUnderline.cjs +1 -1
  202. package/lib/TextUnderline.d.cts +28 -28
  203. package/lib/TextUnderline.d.ts +28 -28
  204. package/lib/TextUnderline.js +2 -2
  205. package/lib/TrailingNode.cjs +1 -1
  206. package/lib/TrailingNode.d.cts +28 -28
  207. package/lib/TrailingNode.d.ts +28 -28
  208. package/lib/TrailingNode.js +1 -1
  209. package/lib/{Twitter-Bl5HyIX0.cjs → Twitter-V0OzBT_E.cjs} +1 -1
  210. package/lib/{Twitter-raSi7ATg.js → Twitter-dRxbZOad.js} +3 -3
  211. package/lib/Twitter.cjs +1 -1
  212. package/lib/Twitter.d.cts +28 -28
  213. package/lib/Twitter.d.ts +28 -28
  214. package/lib/Twitter.js +3 -3
  215. package/lib/Video.cjs +1 -1
  216. package/lib/Video.d.cts +28 -28
  217. package/lib/Video.d.ts +28 -28
  218. package/lib/Video.js +2 -2
  219. package/lib/bubble-extra.cjs +2 -2
  220. package/lib/bubble-extra.d.cts +28 -28
  221. package/lib/bubble-extra.d.ts +28 -28
  222. package/lib/bubble-extra.js +25 -25
  223. package/lib/{dom-dataset-Cuy-pIfj.cjs → dom-dataset-Byuf1YmW.cjs} +5 -5
  224. package/lib/{dom-dataset-CHDbKz5J.js → dom-dataset-Di3tIRrR.js} +94 -83
  225. package/lib/index-BI-IcZcN.cjs +1 -0
  226. package/lib/{index-CSvnpArE.cjs → index-ByRfqzMr.cjs} +2 -2
  227. package/lib/{index-DIPntess.js → index-C1fzuXpN.js} +1 -1
  228. package/lib/index-CbQQFj2T.js +133 -0
  229. package/lib/{index-BWx1Mchx.js → index-DI9T3iLd.js} +243 -243
  230. package/lib/{index-CrxasX7b.cjs → index-DclQSrIx.cjs} +1 -1
  231. package/lib/{index-DEFQHExY.js → index-LUL9mqY4.js} +1 -1
  232. package/lib/{index-h9_SDuwc.cjs → index-Z4b9rzn-.cjs} +1 -1
  233. package/lib/index.cjs +1 -1
  234. package/lib/index.d.cts +28 -28
  235. package/lib/index.d.ts +28 -28
  236. package/lib/index.js +5 -5
  237. package/lib/locale-bundle.d.cts +28 -28
  238. package/lib/locale-bundle.d.ts +28 -28
  239. package/lib/{textarea-DnBlTntN.js → textarea-6c8drwXJ.js} +1 -1
  240. package/lib/{textarea-DgXP0XRK.cjs → textarea-BsJTSgT-.cjs} +1 -1
  241. package/package.json +67 -67
  242. package/lib/RichTextEditor-DszaQdvS.cjs +0 -141
  243. package/lib/index-Cyh1yoFk.cjs +0 -1
  244. package/lib/index-oQutU45z.js +0 -129
@@ -327,15 +327,15 @@ class b {
327
327
  */
328
328
  findIndex(e, t = -1) {
329
329
  if (e == 0)
330
- return Mt(0, e);
330
+ return Ct(0, e);
331
331
  if (e == this.size)
332
- return Mt(this.content.length, e);
332
+ return Ct(this.content.length, e);
333
333
  if (e > this.size || e < 0)
334
334
  throw new RangeError(`Position ${e} outside of fragment (${this})`);
335
335
  for (let n = 0, i = 0; ; n++) {
336
336
  let s = this.child(n), o = i + s.nodeSize;
337
337
  if (o >= e)
338
- return o == e || t > 0 ? Mt(n + 1, o) : Mt(n, i);
338
+ return o == e || t > 0 ? Ct(n + 1, o) : Ct(n, i);
339
339
  i = o;
340
340
  }
341
341
  }
@@ -401,10 +401,10 @@ class b {
401
401
  }
402
402
  b.empty = new b([], 0);
403
403
  const ln = { index: 0, offset: 0 };
404
- function Mt(r, e) {
404
+ function Ct(r, e) {
405
405
  return ln.index = r, ln.offset = e, ln;
406
406
  }
407
- function vt(r, e) {
407
+ function Rt(r, e) {
408
408
  if (r === e)
409
409
  return !0;
410
410
  if (!(r && typeof r == "object") || !(e && typeof e == "object"))
@@ -416,11 +416,11 @@ function vt(r, e) {
416
416
  if (r.length != e.length)
417
417
  return !1;
418
418
  for (let n = 0; n < r.length; n++)
419
- if (!vt(r[n], e[n]))
419
+ if (!Rt(r[n], e[n]))
420
420
  return !1;
421
421
  } else {
422
422
  for (let n in r)
423
- if (!(n in e) || !vt(r[n], e[n]))
423
+ if (!(n in e) || !Rt(r[n], e[n]))
424
424
  return !1;
425
425
  for (let n in e)
426
426
  if (!(n in r))
@@ -482,7 +482,7 @@ let I = class On {
482
482
  another mark.
483
483
  */
484
484
  eq(e) {
485
- return this == e || this.type == e.type && vt(this.attrs, e.attrs);
485
+ return this == e || this.type == e.type && Rt(this.attrs, e.attrs);
486
486
  }
487
487
  /**
488
488
  Convert this mark to a JSON-serializeable representation.
@@ -562,14 +562,14 @@ class k {
562
562
  @internal
563
563
  */
564
564
  insertAt(e, t) {
565
- let n = Mi(this.content, e + this.openStart, t);
565
+ let n = Ci(this.content, e + this.openStart, t);
566
566
  return n && new k(n, this.openStart, this.openEnd);
567
567
  }
568
568
  /**
569
569
  @internal
570
570
  */
571
571
  removeBetween(e, t) {
572
- return new k(Ci(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);
572
+ return new k(Mi(this.content, e + this.openStart, t + this.openStart), this.openStart, this.openEnd);
573
573
  }
574
574
  /**
575
575
  Tests whether this slice is equal to another slice.
@@ -617,7 +617,7 @@ class k {
617
617
  }
618
618
  }
619
619
  k.empty = new k(b.empty, 0, 0);
620
- function Ci(r, e, t) {
620
+ function Mi(r, e, t) {
621
621
  let { index: n, offset: i } = r.findIndex(e), s = r.maybeChild(n), { index: o, offset: l } = r.findIndex(t);
622
622
  if (i == e || s.isText) {
623
623
  if (l != t && !r.child(o).isText)
@@ -626,13 +626,13 @@ function Ci(r, e, t) {
626
626
  }
627
627
  if (n != o)
628
628
  throw new RangeError("Removing non-flat range");
629
- return r.replaceChild(n, s.copy(Ci(s.content, e - i - 1, t - i - 1)));
629
+ return r.replaceChild(n, s.copy(Mi(s.content, e - i - 1, t - i - 1)));
630
630
  }
631
- function Mi(r, e, t, n) {
631
+ function Ci(r, e, t, n) {
632
632
  let { index: i, offset: s } = r.findIndex(e), o = r.maybeChild(i);
633
633
  if (s == e || o.isText)
634
634
  return r.cut(0, e).append(t).append(r.cut(e));
635
- let l = Mi(o.content, e - s - 1, t);
635
+ let l = Ci(o.content, e - s - 1, t);
636
636
  return l && r.replaceChild(i, o.copy(l));
637
637
  }
638
638
  function so(r, e, t) {
@@ -665,29 +665,29 @@ function Nn(r, e, t) {
665
665
  let n = r.node(t);
666
666
  return Oi(n, e.node(t)), n;
667
667
  }
668
- function ve(r, e) {
668
+ function Re(r, e) {
669
669
  let t = e.length - 1;
670
670
  t >= 0 && r.isText && r.sameMarkup(e[t]) ? e[t] = r.withText(e[t].text + r.text) : e.push(r);
671
671
  }
672
672
  function st(r, e, t, n) {
673
673
  let i = (e || r).node(t), s = 0, o = e ? e.index(t) : i.childCount;
674
- r && (s = r.index(t), r.depth > t ? s++ : r.textOffset && (ve(r.nodeAfter, n), s++));
674
+ r && (s = r.index(t), r.depth > t ? s++ : r.textOffset && (Re(r.nodeAfter, n), s++));
675
675
  for (let l = s; l < o; l++)
676
- ve(i.child(l), n);
677
- e && e.depth == t && e.textOffset && ve(e.nodeBefore, n);
676
+ Re(i.child(l), n);
677
+ e && e.depth == t && e.textOffset && Re(e.nodeBefore, n);
678
678
  }
679
679
  function Pe(r, e) {
680
680
  return r.type.checkContent(e), r.copy(e);
681
681
  }
682
682
  function Ni(r, e, t, n, i) {
683
683
  let s = r.depth > i && Nn(r, e, i + 1), o = n.depth > i && Nn(t, n, i + 1), l = [];
684
- return st(null, r, i, l), s && o && e.index(i) == t.index(i) ? (Oi(s, o), ve(Pe(s, Ni(r, e, t, n, i + 1)), l)) : (s && ve(Pe(s, Bt(r, e, i + 1)), l), st(e, t, i, l), o && ve(Pe(o, Bt(t, n, i + 1)), l)), st(n, null, i, l), new b(l);
684
+ return st(null, r, i, l), s && o && e.index(i) == t.index(i) ? (Oi(s, o), Re(Pe(s, Ni(r, e, t, n, i + 1)), l)) : (s && Re(Pe(s, Bt(r, e, i + 1)), l), st(e, t, i, l), o && Re(Pe(o, Bt(t, n, i + 1)), l)), st(n, null, i, l), new b(l);
685
685
  }
686
686
  function Bt(r, e, t) {
687
687
  let n = [];
688
688
  if (st(null, r, t, n), r.depth > t) {
689
689
  let i = Nn(r, e, t + 1);
690
- ve(Pe(i, Bt(r, e, t + 1)), n);
690
+ Re(Pe(i, Bt(r, e, t + 1)), n);
691
691
  }
692
692
  return st(e, null, t, n), new b(n);
693
693
  }
@@ -1112,7 +1112,7 @@ let xe = class Tn {
1112
1112
  attributes, and marks.
1113
1113
  */
1114
1114
  hasMarkup(e, t, n) {
1115
- return this.type == e && vt(this.attrs, t || e.defaultAttrs || co) && I.sameSet(this.marks, n || I.none);
1115
+ return this.type == e && Rt(this.attrs, t || e.defaultAttrs || co) && I.sameSet(this.marks, n || I.none);
1116
1116
  }
1117
1117
  /**
1118
1118
  Create a new node with the same markup as this node, containing
@@ -1775,7 +1775,7 @@ function Ii(r, e) {
1775
1775
  }
1776
1776
  return t;
1777
1777
  }
1778
- function Ri(r, e, t, n) {
1778
+ function vi(r, e, t, n) {
1779
1779
  for (let i in e)
1780
1780
  if (!(i in r))
1781
1781
  throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);
@@ -1784,7 +1784,7 @@ function Ri(r, e, t, n) {
1784
1784
  s.validate && s.validate(e[i]);
1785
1785
  }
1786
1786
  }
1787
- function vi(r, e) {
1787
+ function Ri(r, e) {
1788
1788
  let t = /* @__PURE__ */ Object.create(null);
1789
1789
  if (e)
1790
1790
  for (let n in e)
@@ -1796,7 +1796,7 @@ let yr = class Pi {
1796
1796
  @internal
1797
1797
  */
1798
1798
  constructor(e, t, n) {
1799
- this.name = e, this.schema = t, this.spec = n, this.markSet = null, this.groups = n.group ? n.group.split(" ") : [], this.attrs = vi(e, n.attrs), this.defaultAttrs = Ai(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(n.inline || e == "text"), this.isText = e == "text";
1799
+ this.name = e, this.schema = t, this.spec = n, this.markSet = null, this.groups = n.group ? n.group.split(" ") : [], this.attrs = Ri(e, n.attrs), this.defaultAttrs = Ai(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(n.inline || e == "text"), this.isText = e == "text";
1800
1800
  }
1801
1801
  /**
1802
1802
  True if this is an inline type.
@@ -1924,7 +1924,7 @@ let yr = class Pi {
1924
1924
  @internal
1925
1925
  */
1926
1926
  checkAttrs(e) {
1927
- Ri(this.attrs, e, "node", this.name);
1927
+ vi(this.attrs, e, "node", this.name);
1928
1928
  }
1929
1929
  /**
1930
1930
  Check whether the given mark type is allowed in this node.
@@ -1991,7 +1991,7 @@ class Ht {
1991
1991
  @internal
1992
1992
  */
1993
1993
  constructor(e, t, n, i) {
1994
- this.name = e, this.rank = t, this.schema = n, this.spec = i, this.attrs = vi(e, i.attrs), this.excluded = null;
1994
+ this.name = e, this.rank = t, this.schema = n, this.spec = i, this.attrs = Ri(e, i.attrs), this.excluded = null;
1995
1995
  let s = Ai(this.attrs);
1996
1996
  this.instance = s ? new I(this, s) : null;
1997
1997
  }
@@ -2031,7 +2031,7 @@ class Ht {
2031
2031
  @internal
2032
2032
  */
2033
2033
  checkAttrs(e) {
2034
- Ri(this.attrs, e, "mark", this.name);
2034
+ vi(this.attrs, e, "mark", this.name);
2035
2035
  }
2036
2036
  /**
2037
2037
  Queries whether a given mark type is
@@ -2140,10 +2140,10 @@ function br(r, e) {
2140
2140
  }
2141
2141
  return t;
2142
2142
  }
2143
- function Co(r) {
2143
+ function Mo(r) {
2144
2144
  return r.tag != null;
2145
2145
  }
2146
- function Mo(r) {
2146
+ function Co(r) {
2147
2147
  return r.style != null;
2148
2148
  }
2149
2149
  class Se {
@@ -2155,9 +2155,9 @@ class Se {
2155
2155
  this.schema = e, this.rules = t, this.tags = [], this.styles = [];
2156
2156
  let n = this.matchedStyles = [];
2157
2157
  t.forEach((i) => {
2158
- if (Co(i))
2158
+ if (Mo(i))
2159
2159
  this.tags.push(i);
2160
- else if (Mo(i)) {
2160
+ else if (Co(i)) {
2161
2161
  let s = /[^=]*/.exec(i.style)[0];
2162
2162
  n.indexOf(s) < 0 && n.push(s), this.styles.push(i);
2163
2163
  }
@@ -2494,7 +2494,7 @@ class xr {
2494
2494
  i.match && (i.match = i.match.matchType(e.type));
2495
2495
  let s = I.none;
2496
2496
  for (let o of n.concat(e.marks))
2497
- (i.type ? i.type.allowsMarkType(o.type) : Cr(o.type, e.type)) && (s = o.addToSet(s));
2497
+ (i.type ? i.type.allowsMarkType(o.type) : Mr(o.type, e.type)) && (s = o.addToSet(s));
2498
2498
  return i.content.push(e.mark(s)), !0;
2499
2499
  }
2500
2500
  return !1;
@@ -2513,7 +2513,7 @@ class xr {
2513
2513
  let l = kr(e, s, o.options);
2514
2514
  o.options & ot && o.content.length == 0 && (l |= ot);
2515
2515
  let a = I.none;
2516
- return n = n.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Cr(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new wt(e, t, a, i, null, l)), this.open++, n;
2516
+ return n = n.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Mr(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new wt(e, t, a, i, null, l)), this.open++, n;
2517
2517
  }
2518
2518
  // Make sure all nodes above this.open are finished and added to
2519
2519
  // their parents
@@ -2622,7 +2622,7 @@ function Sr(r) {
2622
2622
  e[t] = r[t];
2623
2623
  return e;
2624
2624
  }
2625
- function Cr(r, e) {
2625
+ function Mr(r, e) {
2626
2626
  let t = e.schema.nodes;
2627
2627
  for (let n in t) {
2628
2628
  let i = t[n];
@@ -2734,17 +2734,17 @@ class $e {
2734
2734
  This can be useful as a base to build a custom serializer from.
2735
2735
  */
2736
2736
  static nodesFromSchema(e) {
2737
- let t = Mr(e.nodes);
2737
+ let t = Cr(e.nodes);
2738
2738
  return t.text || (t.text = (n) => n.text), t;
2739
2739
  }
2740
2740
  /**
2741
2741
  Gather the serializers in a schema's mark specs into an object.
2742
2742
  */
2743
2743
  static marksFromSchema(e) {
2744
- return Mr(e.marks);
2744
+ return Cr(e.marks);
2745
2745
  }
2746
2746
  }
2747
- function Mr(r) {
2747
+ function Cr(r) {
2748
2748
  let e = {};
2749
2749
  for (let t in r) {
2750
2750
  let n = r[t].spec.toDOM;
@@ -3109,7 +3109,7 @@ class J {
3109
3109
  return cn[e] = t, t.prototype.jsonID = e, t;
3110
3110
  }
3111
3111
  }
3112
- class R {
3112
+ class v {
3113
3113
  /**
3114
3114
  @internal
3115
3115
  */
@@ -3120,13 +3120,13 @@ class R {
3120
3120
  Create a successful step result.
3121
3121
  */
3122
3122
  static ok(e) {
3123
- return new R(e, null);
3123
+ return new v(e, null);
3124
3124
  }
3125
3125
  /**
3126
3126
  Create a failed step result.
3127
3127
  */
3128
3128
  static fail(e) {
3129
- return new R(null, e);
3129
+ return new v(null, e);
3130
3130
  }
3131
3131
  /**
3132
3132
  Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
@@ -3135,10 +3135,10 @@ class R {
3135
3135
  */
3136
3136
  static fromReplace(e, t, n, i) {
3137
3137
  try {
3138
- return R.ok(e.replace(t, n, i));
3138
+ return v.ok(e.replace(t, n, i));
3139
3139
  } catch (s) {
3140
3140
  if (s instanceof Pt)
3141
- return R.fail(s.message);
3141
+ return v.fail(s.message);
3142
3142
  throw s;
3143
3143
  }
3144
3144
  }
@@ -3160,7 +3160,7 @@ class ye extends J {
3160
3160
  }
3161
3161
  apply(e) {
3162
3162
  let t = e.slice(this.from, this.to), n = e.resolve(this.from), i = n.node(n.sharedDepth(this.to)), s = new k(Kn(t.content, (o, l) => !o.isAtom || !l.type.allowsMarkType(this.mark.type) ? o : o.mark(this.mark.addToSet(o.marks)), i), t.openStart, t.openEnd);
3163
- return R.fromReplace(e, this.from, this.to, s);
3163
+ return v.fromReplace(e, this.from, this.to, s);
3164
3164
  }
3165
3165
  invert() {
3166
3166
  return new re(this.from, this.to, this.mark);
@@ -3199,7 +3199,7 @@ class re extends J {
3199
3199
  }
3200
3200
  apply(e) {
3201
3201
  let t = e.slice(this.from, this.to), n = new k(Kn(t.content, (i) => i.mark(this.mark.removeFromSet(i.marks)), e), t.openStart, t.openEnd);
3202
- return R.fromReplace(e, this.from, this.to, n);
3202
+ return v.fromReplace(e, this.from, this.to, n);
3203
3203
  }
3204
3204
  invert() {
3205
3205
  return new ye(this.from, this.to, this.mark);
@@ -3239,9 +3239,9 @@ class be extends J {
3239
3239
  apply(e) {
3240
3240
  let t = e.nodeAt(this.pos);
3241
3241
  if (!t)
3242
- return R.fail("No node at mark step's position");
3242
+ return v.fail("No node at mark step's position");
3243
3243
  let n = t.type.create(t.attrs, null, this.mark.addToSet(t.marks));
3244
- return R.fromReplace(e, this.pos, this.pos + 1, new k(b.from(n), 0, t.isLeaf ? 0 : 1));
3244
+ return v.fromReplace(e, this.pos, this.pos + 1, new k(b.from(n), 0, t.isLeaf ? 0 : 1));
3245
3245
  }
3246
3246
  invert(e) {
3247
3247
  let t = e.nodeAt(this.pos);
@@ -3283,9 +3283,9 @@ class _e extends J {
3283
3283
  apply(e) {
3284
3284
  let t = e.nodeAt(this.pos);
3285
3285
  if (!t)
3286
- return R.fail("No node at mark step's position");
3286
+ return v.fail("No node at mark step's position");
3287
3287
  let n = t.type.create(t.attrs, null, this.mark.removeFromSet(t.marks));
3288
- return R.fromReplace(e, this.pos, this.pos + 1, new k(b.from(n), 0, t.isLeaf ? 0 : 1));
3288
+ return v.fromReplace(e, this.pos, this.pos + 1, new k(b.from(n), 0, t.isLeaf ? 0 : 1));
3289
3289
  }
3290
3290
  invert(e) {
3291
3291
  let t = e.nodeAt(this.pos);
@@ -3322,7 +3322,7 @@ class P extends J {
3322
3322
  super(), this.from = e, this.to = t, this.slice = n, this.structure = i;
3323
3323
  }
3324
3324
  apply(e) {
3325
- return this.structure && An(e, this.from, this.to) ? R.fail("Structure replace would overwrite content") : R.fromReplace(e, this.from, this.to, this.slice);
3325
+ return this.structure && An(e, this.from, this.to) ? v.fail("Structure replace would overwrite content") : v.fromReplace(e, this.from, this.to, this.slice);
3326
3326
  }
3327
3327
  getMap() {
3328
3328
  return new Y([this.from, this.to - this.from, this.slice.size]);
@@ -3372,12 +3372,12 @@ class B extends J {
3372
3372
  }
3373
3373
  apply(e) {
3374
3374
  if (this.structure && (An(e, this.from, this.gapFrom) || An(e, this.gapTo, this.to)))
3375
- return R.fail("Structure gap-replace would overwrite content");
3375
+ return v.fail("Structure gap-replace would overwrite content");
3376
3376
  let t = e.slice(this.gapFrom, this.gapTo);
3377
3377
  if (t.openStart || t.openEnd)
3378
- return R.fail("Gap is not a flat range");
3378
+ return v.fail("Gap is not a flat range");
3379
3379
  let n = this.slice.insertAt(this.insert, t.content);
3380
- return n ? R.fromReplace(e, this.from, this.to, n) : R.fail("Content does not fit in gap");
3380
+ return n ? v.fromReplace(e, this.from, this.to, n) : v.fail("Content does not fit in gap");
3381
3381
  }
3382
3382
  getMap() {
3383
3383
  return new Y([
@@ -3446,7 +3446,7 @@ function Io(r, e, t, n) {
3446
3446
  }
3447
3447
  }), i.forEach((a) => r.step(a)), s.forEach((a) => r.step(a));
3448
3448
  }
3449
- function Ro(r, e, t, n) {
3449
+ function vo(r, e, t, n) {
3450
3450
  let i = [], s = 0;
3451
3451
  r.doc.nodesBetween(e, t, (o, l) => {
3452
3452
  if (!o.isInline)
@@ -3496,7 +3496,7 @@ function Hn(r, e, t, n = t.contentMatch, i = !0) {
3496
3496
  for (let a = o.length - 1; a >= 0; a--)
3497
3497
  r.step(o[a]);
3498
3498
  }
3499
- function vo(r, e, t) {
3499
+ function Ro(r, e, t) {
3500
3500
  return (e == 0 || r.canReplace(e, r.childCount)) && (t == r.childCount || r.canReplace(0, t));
3501
3501
  }
3502
3502
  function et(r) {
@@ -3505,7 +3505,7 @@ function et(r) {
3505
3505
  let i = r.$from.node(n), s = r.$from.index(n), o = r.$to.indexAfter(n);
3506
3506
  if (n < r.depth && i.canReplace(s, o, t))
3507
3507
  return n;
3508
- if (n == 0 || i.type.spec.isolating || !vo(i, s, o))
3508
+ if (n == 0 || i.type.spec.isolating || !Ro(i, s, o))
3509
3509
  break;
3510
3510
  }
3511
3511
  return null;
@@ -3950,8 +3950,8 @@ function Yo(r, e, t, n) {
3950
3950
  for (let m = 0; m < o.length; m++) {
3951
3951
  let g = o[(m + a) % o.length], y = !0;
3952
3952
  g < 0 && (y = !1, g = -g);
3953
- let C = i.node(g - 1), M = i.index(g - 1);
3954
- if (C.canReplaceWith(M, M, p.type, p.marks))
3953
+ let M = i.node(g - 1), C = i.index(g - 1);
3954
+ if (M.canReplaceWith(C, C, p.type, p.marks))
3955
3955
  return r.replace(i.before(g), y ? s.after(g) : t, new k(Gi(n.content, 0, n.openStart, h), h, n.openEnd));
3956
3956
  }
3957
3957
  }
@@ -4013,13 +4013,13 @@ class Ge extends J {
4013
4013
  apply(e) {
4014
4014
  let t = e.nodeAt(this.pos);
4015
4015
  if (!t)
4016
- return R.fail("No node at attribute step's position");
4016
+ return v.fail("No node at attribute step's position");
4017
4017
  let n = /* @__PURE__ */ Object.create(null);
4018
4018
  for (let s in t.attrs)
4019
4019
  n[s] = t.attrs[s];
4020
4020
  n[this.attr] = this.value;
4021
4021
  let i = t.type.create(n, null, t.marks);
4022
- return R.fromReplace(e, this.pos, this.pos + 1, new k(b.from(i), 0, t.isLeaf ? 0 : 1));
4022
+ return v.fromReplace(e, this.pos, this.pos + 1, new k(b.from(i), 0, t.isLeaf ? 0 : 1));
4023
4023
  }
4024
4024
  getMap() {
4025
4025
  return Y.empty;
@@ -4054,7 +4054,7 @@ class ut extends J {
4054
4054
  t[i] = e.attrs[i];
4055
4055
  t[this.attr] = this.value;
4056
4056
  let n = e.type.create(t, e.content, e.marks);
4057
- return R.ok(n);
4057
+ return v.ok(n);
4058
4058
  }
4059
4059
  getMap() {
4060
4060
  return Y.empty;
@@ -4292,7 +4292,7 @@ class _i {
4292
4292
  remove all marks of any type.
4293
4293
  */
4294
4294
  removeMark(e, t, n) {
4295
- return Ro(this, e, t, n), this;
4295
+ return vo(this, e, t, n), this;
4296
4296
  }
4297
4297
  /**
4298
4298
  Removes all marks and nodes from the content of the node at
@@ -4851,12 +4851,12 @@ class el extends _i {
4851
4851
  return (this.updated & Ir) > 0;
4852
4852
  }
4853
4853
  }
4854
- function Rr(r, e) {
4854
+ function vr(r, e) {
4855
4855
  return !e || !r ? r : r.bind(e);
4856
4856
  }
4857
4857
  class it {
4858
4858
  constructor(e, t, n) {
4859
- this.name = e, this.init = Rr(t.init, n), this.apply = Rr(t.apply, n);
4859
+ this.name = e, this.init = vr(t.init, n), this.apply = vr(t.apply, n);
4860
4860
  }
4861
4861
  }
4862
4862
  const tl = [
@@ -5128,9 +5128,9 @@ const ae = function(r, e, t) {
5128
5128
  }, nl = function() {
5129
5129
  In = null;
5130
5130
  }, Ve = function(r, e, t, n) {
5131
- return t && (vr(r, e, t, n, -1) || vr(r, e, t, n, 1));
5131
+ return t && (Rr(r, e, t, n, -1) || Rr(r, e, t, n, 1));
5132
5132
  }, rl = /^(img|br|input|textarea|hr)$/i;
5133
- function vr(r, e, t, n, i) {
5133
+ function Rr(r, e, t, n, i) {
5134
5134
  for (; ; ) {
5135
5135
  if (r == t && e == n)
5136
5136
  return !0;
@@ -5221,7 +5221,7 @@ function al(r, e, t) {
5221
5221
  return { node: n.startContainer, offset: Math.min(Q(n.startContainer), n.startOffset) };
5222
5222
  }
5223
5223
  }
5224
- const ie = typeof navigator < "u" ? navigator : null, Pr = typeof document < "u" ? document : null, Te = ie && ie.userAgent || "", Rn = /Edge\/(\d+)/.exec(Te), Zi = /MSIE \d/.exec(Te), vn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Te), G = !!(Zi || vn || Rn), Ce = Zi ? document.documentMode : vn ? +vn[1] : Rn ? +Rn[1] : 0, te = !G && /gecko\/(\d+)/i.test(Te);
5224
+ const ie = typeof navigator < "u" ? navigator : null, Pr = typeof document < "u" ? document : null, Te = ie && ie.userAgent || "", vn = /Edge\/(\d+)/.exec(Te), Zi = /MSIE \d/.exec(Te), Rn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Te), G = !!(Zi || Rn || vn), Me = Zi ? document.documentMode : Rn ? +Rn[1] : vn ? +vn[1] : 0, te = !G && /gecko\/(\d+)/i.test(Te);
5225
5225
  te && +(/Firefox\/(\d+)/.exec(Te) || [0, 0])[1];
5226
5226
  const Pn = !G && /Chrome\/(\d+)/.exec(Te), W = !!Pn, es = Pn ? +Pn[1] : 0, q = !G && !!ie && /Apple Computer/.test(ie.vendor), Qe = q && (/Mobile\/\w+/.test(Te) || !!ie && ie.maxTouchPoints > 2), X = Qe || (ie ? /Mac/.test(ie.platform) : !1), cl = ie ? /Win/.test(ie.platform) : !1, ce = /Android \d/.test(Te), xt = !!Pr && "webkitFontSmoothing" in Pr.documentElement.style, fl = xt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5227
5227
  function dl(r) {
@@ -5500,7 +5500,7 @@ function ls(r, e, t) {
5500
5500
  n != e && r.updateState(n), i != r.dom && i && i.focus();
5501
5501
  }
5502
5502
  }
5503
- function Cl(r, e, t) {
5503
+ function Ml(r, e, t) {
5504
5504
  let n = e.selection, i = t == "up" ? n.$from : n.$to;
5505
5505
  return ls(r, e, () => {
5506
5506
  let { node: s } = r.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
@@ -5532,13 +5532,13 @@ function Cl(r, e, t) {
5532
5532
  return !0;
5533
5533
  });
5534
5534
  }
5535
- const Ml = /[\u0590-\u08ac]/;
5535
+ const Cl = /[\u0590-\u08ac]/;
5536
5536
  function wl(r, e, t) {
5537
5537
  let { $head: n } = e.selection;
5538
5538
  if (!n.parent.isTextblock)
5539
5539
  return !1;
5540
5540
  let i = n.parentOffset, s = !i, o = i == n.parent.content.size, l = r.domSelection();
5541
- return l ? !Ml.test(n.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : ls(r, e, () => {
5541
+ return l ? !Cl.test(n.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : ls(r, e, () => {
5542
5542
  let { focusNode: a, focusOffset: c, anchorNode: f, anchorOffset: d } = r.domSelectionRange(), u = l.caretBidiLevel;
5543
5543
  l.modify("move", t, "character");
5544
5544
  let h = n.depth ? r.docView.domAfterPos(n.before()) : r.dom, { focusNode: p, focusOffset: m } = r.domSelectionRange(), g = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
@@ -5551,7 +5551,7 @@ function wl(r, e, t) {
5551
5551
  }
5552
5552
  let Fr = null, Vr = null, Lr = !1;
5553
5553
  function Ol(r, e, t) {
5554
- return Fr == e && Vr == t ? Lr : (Fr = e, Vr = t, Lr = t == "up" || t == "down" ? Cl(r, e, t) : wl(r, e, t));
5554
+ return Fr == e && Vr == t ? Lr : (Fr = e, Vr = t, Lr = t == "up" || t == "down" ? Ml(r, e, t) : wl(r, e, t));
5555
5555
  }
5556
5556
  const Z = 0, $r = 1, Ie = 2, se = 3;
5557
5557
  class St {
@@ -5988,7 +5988,7 @@ class Le extends St {
5988
5988
  this.spec.destroy && this.spec.destroy(), super.destroy();
5989
5989
  }
5990
5990
  }
5991
- class Me extends St {
5991
+ class Ce extends St {
5992
5992
  constructor(e, t, n, i, s, o, l, a, c) {
5993
5993
  super(e, [], s, o), this.node = t, this.outerDeco = n, this.innerDeco = i, this.nodeDOM = l;
5994
5994
  }
@@ -6016,7 +6016,7 @@ class Me extends St {
6016
6016
  } else f || ({ dom: f, contentDOM: d } = $e.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
6017
6017
  !d && !t.isText && f.nodeName != "BR" && (f.hasAttribute("contenteditable") || (f.contentEditable = "false"), t.type.spec.draggable && (f.draggable = !0));
6018
6018
  let u = f;
6019
- return f = us(f, n, t), c ? a = new Tl(e, t, n, i, f, d || null, u, c, s, o + 1) : t.isText ? new Xt(e, t, n, i, f, u, s) : new Me(e, t, n, i, f, d || null, u, s, o + 1);
6019
+ return f = us(f, n, t), c ? a = new Tl(e, t, n, i, f, d || null, u, c, s, o + 1) : t.isText ? new Xt(e, t, n, i, f, u, s) : new Ce(e, t, n, i, f, d || null, u, s, o + 1);
6020
6020
  }
6021
6021
  parseRule() {
6022
6022
  if (this.node.type.spec.reparseInView)
@@ -6053,13 +6053,13 @@ class Me extends St {
6053
6053
  // `this.children`.
6054
6054
  updateChildren(e, t) {
6055
6055
  let n = 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 Dl(this, o && o.node, e);
6056
- Rl(this.node, this.innerDeco, (c, f, d) => {
6056
+ vl(this.node, this.innerDeco, (c, f, d) => {
6057
6057
  c.spec.marks ? a.syncToMarks(c.spec.marks, n, e) : c.type.side >= 0 && !d && a.syncToMarks(f == this.node.childCount ? I.none : this.node.child(f).marks, n, e), a.placeWidget(c, e, i);
6058
6058
  }, (c, f, d, u) => {
6059
6059
  a.syncToMarks(c.marks, n, e);
6060
6060
  let h;
6061
6061
  a.findNodeMatch(c, f, d, u) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (h = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, f, d, h, e) || a.updateNextNode(c, f, d, e, u, i) || a.addNode(c, f, d, e, i), i += c.nodeSize;
6062
- }), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ie) && (o && this.protectLocalComposition(e, o), fs(this.contentDOM, this.children, e), Qe && vl(this.dom));
6062
+ }), a.syncToMarks([], n, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Ie) && (o && this.protectLocalComposition(e, o), fs(this.contentDOM, this.children, e), Qe && Rl(this.dom));
6063
6063
  }
6064
6064
  localCompositionInfo(e, t) {
6065
6065
  let { from: n, to: i } = e.state.selection;
@@ -6116,10 +6116,10 @@ class Me extends St {
6116
6116
  }
6117
6117
  function Wr(r, e, t, n, i) {
6118
6118
  us(n, e, r);
6119
- let s = new Me(void 0, r, e, t, n, n, n, i, 0);
6119
+ let s = new Ce(void 0, r, e, t, n, n, n, i, 0);
6120
6120
  return s.contentDOM && s.updateChildren(i, 0), s;
6121
6121
  }
6122
- class Xt extends Me {
6122
+ class Xt extends Ce {
6123
6123
  constructor(e, t, n, i, s, o, l) {
6124
6124
  super(e, t, n, i, s, null, o, l, 0);
6125
6125
  }
@@ -6176,7 +6176,7 @@ class cs extends St {
6176
6176
  return this.dom.nodeName == "IMG";
6177
6177
  }
6178
6178
  }
6179
- class Tl extends Me {
6179
+ class Tl extends Ce {
6180
6180
  constructor(e, t, n, i, s, o, l, a, c, f) {
6181
6181
  super(e, t, n, i, s, o, l, c, f), this.spec = a;
6182
6182
  }
@@ -6233,11 +6233,11 @@ const at = function(r) {
6233
6233
  r && (this.nodeName = r);
6234
6234
  };
6235
6235
  at.prototype = /* @__PURE__ */ Object.create(null);
6236
- const Re = [new at()];
6236
+ const ve = [new at()];
6237
6237
  function Bn(r, e, t) {
6238
6238
  if (r.length == 0)
6239
- return Re;
6240
- let n = t ? Re[0] : new at(), i = [n];
6239
+ return ve;
6240
+ let n = t ? ve[0] : new at(), i = [n];
6241
6241
  for (let s = 0; s < r.length; s++) {
6242
6242
  let o = r[s].type.attrs;
6243
6243
  if (o) {
@@ -6251,16 +6251,16 @@ function Bn(r, e, t) {
6251
6251
  return i;
6252
6252
  }
6253
6253
  function ds(r, e, t, n) {
6254
- if (t == Re && n == Re)
6254
+ if (t == ve && n == ve)
6255
6255
  return e;
6256
6256
  let i = e;
6257
6257
  for (let s = 0; s < n.length; s++) {
6258
6258
  let o = n[s], l = t[s];
6259
6259
  if (s) {
6260
6260
  let a;
6261
- l && l.nodeName == o.nodeName && i != r && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Re[0]), i = a;
6261
+ l && l.nodeName == o.nodeName && i != r && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = ve[0]), i = a;
6262
6262
  }
6263
- El(i, l || Re[0], o);
6263
+ El(i, l || ve[0], o);
6264
6264
  }
6265
6265
  return i;
6266
6266
  }
@@ -6287,7 +6287,7 @@ function El(r, e, t) {
6287
6287
  }
6288
6288
  }
6289
6289
  function us(r, e, t) {
6290
- return ds(r, r, Re, Bn(e, t, r.nodeType != 1));
6290
+ return ds(r, r, ve, Bn(e, t, r.nodeType != 1));
6291
6291
  }
6292
6292
  function Vt(r, e) {
6293
6293
  if (r.length != e.length)
@@ -6387,7 +6387,7 @@ class Dl {
6387
6387
  updateNextNode(e, t, n, i, s, o) {
6388
6388
  for (let l = this.index; l < this.top.children.length; l++) {
6389
6389
  let a = this.top.children[l];
6390
- if (a instanceof Me) {
6390
+ if (a instanceof Ce) {
6391
6391
  let c = this.preMatch.matched.get(a);
6392
6392
  if (c != null && c != s)
6393
6393
  return !1;
@@ -6406,7 +6406,7 @@ class Dl {
6406
6406
  recreateWrapper(e, t, n, i, s, o) {
6407
6407
  if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !Vt(n, e.outerDeco) || !i.eq(e.innerDeco))
6408
6408
  return null;
6409
- let l = Me.create(this.top, t, n, i, s, o);
6409
+ let l = Ce.create(this.top, t, n, i, s, o);
6410
6410
  if (l.contentDOM) {
6411
6411
  l.children = e.children, e.children = [];
6412
6412
  for (let a of l.children)
@@ -6416,7 +6416,7 @@ class Dl {
6416
6416
  }
6417
6417
  // Insert the node as a newly created node desc.
6418
6418
  addNode(e, t, n, i, s) {
6419
- let o = Me.create(this.top, e, t, n, i, s);
6419
+ let o = Ce.create(this.top, e, t, n, i, s);
6420
6420
  o.contentDOM && o.updateChildren(i, s + 1), this.top.children.splice(this.index++, 0, o), this.changed = !0;
6421
6421
  }
6422
6422
  placeWidget(e, t, n) {
@@ -6481,7 +6481,7 @@ function Al(r, e) {
6481
6481
  function Il(r, e) {
6482
6482
  return r.type.side - e.type.side;
6483
6483
  }
6484
- function Rl(r, e, t, n) {
6484
+ function vl(r, e, t, n) {
6485
6485
  let i = e.locals(r), s = 0;
6486
6486
  if (i.length == 0) {
6487
6487
  for (let c = 0; c < r.childCount; c++) {
@@ -6529,7 +6529,7 @@ function Rl(r, e, t, n) {
6529
6529
  n(u, m, e.forChild(s, u), h), s = p;
6530
6530
  }
6531
6531
  }
6532
- function vl(r) {
6532
+ function Rl(r) {
6533
6533
  if (r.nodeName == "UL" || r.nodeName == "OL") {
6534
6534
  let e = r.style.cssText;
6535
6535
  r.style.cssText = e + "; list-style: square !important", window.getComputedStyle(r).listStyle, r.style.cssText = e;
@@ -6660,7 +6660,7 @@ function zl(r) {
6660
6660
  if (!e)
6661
6661
  return;
6662
6662
  let n = r.cursorWrapper.dom, i = n.nodeName == "IMG";
6663
- i ? t.setStart(n.parentNode, V(n) + 1) : t.setStart(n, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !i && !r.state.selection.visible && G && Ce <= 11 && (n.disabled = !0, n.disabled = !1);
6663
+ i ? t.setStart(n.parentNode, V(n) + 1) : t.setStart(n, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !i && !r.state.selection.visible && G && Me <= 11 && (n.disabled = !0, n.disabled = !1);
6664
6664
  }
6665
6665
  function ps(r, e) {
6666
6666
  if (e instanceof S) {
@@ -6954,7 +6954,7 @@ function Qn(r, e) {
6954
6954
  let h = n.firstChild;
6955
6955
  t.push(h.type.name, h.attrs != h.type.defaultAttrs ? h.attrs : null), n = h.content;
6956
6956
  }
6957
- let o = r.someProp("clipboardSerializer") || $e.fromSchema(r.state.schema), l = Cs(), a = l.createElement("div");
6957
+ let o = r.someProp("clipboardSerializer") || $e.fromSchema(r.state.schema), l = Ms(), a = l.createElement("div");
6958
6958
  a.appendChild(o.serializeFragment(n, { document: l }));
6959
6959
  let c = a.firstChild, f, d = 0;
6960
6960
  for (; c && c.nodeType == 1 && (f = Ss[c.nodeName.toLowerCase()]); ) {
@@ -7090,7 +7090,7 @@ const Ss = {
7090
7090
  th: ["table", "tbody", "tr"]
7091
7091
  };
7092
7092
  let ei = null;
7093
- function Cs() {
7093
+ function Ms() {
7094
7094
  return ei || (ei = document.implementation.createHTMLDocument("title"));
7095
7095
  }
7096
7096
  let yn = null;
@@ -7101,7 +7101,7 @@ function Ul(r) {
7101
7101
  function Gl(r) {
7102
7102
  let e = /^(\s*<meta [^>]*>)*/.exec(r);
7103
7103
  e && (r = r.slice(e[0].length));
7104
- let t = Cs().createElement("div"), n = /<([a-z][^>\s]+)/i.exec(r), i;
7104
+ let t = Ms().createElement("div"), n = /<([a-z][^>\s]+)/i.exec(r), i;
7105
7105
  if ((i = n && Ss[n[1].toLowerCase()]) && (r = i.map((s) => "<" + s + ">").join("") + r + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = Ul(r), i)
7106
7106
  for (let s = 0; s < i.length; s++)
7107
7107
  t = t.querySelector(i[s]) || t;
@@ -7281,18 +7281,18 @@ function ca(r, e, t) {
7281
7281
  function tr(r) {
7282
7282
  return $t(r);
7283
7283
  }
7284
- const Ms = X ? "metaKey" : "ctrlKey";
7284
+ const Cs = X ? "metaKey" : "ctrlKey";
7285
7285
  K.mousedown = (r, e) => {
7286
7286
  let t = e;
7287
7287
  r.input.shiftKey = t.shiftKey;
7288
7288
  let n = tr(r), i = Date.now(), s = "singleClick";
7289
- i - r.input.lastClick.time < 500 && ra(t, r.input.lastClick) && !t[Ms] && (r.input.lastClick.type == "singleClick" ? s = "doubleClick" : r.input.lastClick.type == "doubleClick" && (s = "tripleClick")), r.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s };
7289
+ i - r.input.lastClick.time < 500 && ra(t, r.input.lastClick) && !t[Cs] && (r.input.lastClick.type == "singleClick" ? s = "doubleClick" : r.input.lastClick.type == "doubleClick" && (s = "tripleClick")), r.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s };
7290
7290
  let o = r.posAtCoords(Qt(t));
7291
7291
  o && (s == "singleClick" ? (r.input.mouseDown && r.input.mouseDown.done(), r.input.mouseDown = new fa(r, o, t, !!n)) : (s == "doubleClick" ? la : aa)(r, o.pos, o.inside, t) ? t.preventDefault() : ke(r, "pointer"));
7292
7292
  };
7293
7293
  class fa {
7294
7294
  constructor(e, t, n, i) {
7295
- this.view = e, this.pos = t, this.event = n, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!n[Ms], this.allowDefault = n.shiftKey;
7295
+ this.view = e, this.pos = t, this.event = n, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!n[Cs], this.allowDefault = n.shiftKey;
7296
7296
  let s, o;
7297
7297
  if (t.inside > -1)
7298
7298
  s = e.state.doc.nodeAt(t.inside), o = t.inside;
@@ -7423,7 +7423,7 @@ function pa(r, e) {
7423
7423
  t.parentNode && t.parentNode.removeChild(t), r.focus();
7424
7424
  }, 50);
7425
7425
  }
7426
- const pt = G && Ce < 15 || Qe && fl < 604;
7426
+ const pt = G && Me < 15 || Qe && fl < 604;
7427
7427
  K.copy = H.cut = (r, e) => {
7428
7428
  let t = e, n = r.state.selection, i = t.type == "cut";
7429
7429
  if (n.empty)
@@ -7530,7 +7530,7 @@ H.drop = (r, e) => {
7530
7530
  c.setSelection(new S(h));
7531
7531
  else {
7532
7532
  let p = c.mapping.map(a);
7533
- c.mapping.maps[c.mapping.maps.length - 1].forEach((m, g, y, C) => p = C), c.setSelection(Xn(r, h, c.doc.resolve(p)));
7533
+ c.mapping.maps[c.mapping.maps.length - 1].forEach((m, g, y, M) => p = M), c.setSelection(Xn(r, h, c.doc.resolve(p)));
7534
7534
  }
7535
7535
  r.focus(), r.dispatch(c.setMeta("uiEvent", "drop"));
7536
7536
  };
@@ -7699,7 +7699,7 @@ class ee {
7699
7699
  }
7700
7700
  }
7701
7701
  const Ke = [], Be = {};
7702
- class v {
7702
+ class R {
7703
7703
  /**
7704
7704
  @internal
7705
7705
  */
@@ -7753,7 +7753,7 @@ class v {
7753
7753
  let a = this.local[l].map(e, n, i);
7754
7754
  a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
7755
7755
  }
7756
- return this.children.length ? ya(this.children, o || [], e, t, n, i, s) : o ? new v(o.sort(ze), Ke) : $;
7756
+ return this.children.length ? ya(this.children, o || [], e, t, n, i, s) : o ? new R(o.sort(ze), Ke) : $;
7757
7757
  }
7758
7758
  /**
7759
7759
  Add the given array of decorations to the ones in the set,
@@ -7762,7 +7762,7 @@ class v {
7762
7762
  structure.
7763
7763
  */
7764
7764
  add(e, t) {
7765
- return t.length ? this == $ ? v.create(e, t) : this.addInner(e, t, 0) : this;
7765
+ return t.length ? this == $ ? R.create(e, t) : this.addInner(e, t, 0) : this;
7766
7766
  }
7767
7767
  addInner(e, t, n) {
7768
7768
  let i, s = 0;
@@ -7774,10 +7774,10 @@ class v {
7774
7774
  i[s] == a ? i[s + 2] = i[s + 2].addInner(l, f, c + 1) : i.splice(s, 0, a, a + l.nodeSize, Jt(f, l, c + 1, Be)), s += 3;
7775
7775
  }
7776
7776
  });
7777
- let o = As(s ? Rs(t) : t, -n);
7777
+ let o = As(s ? vs(t) : t, -n);
7778
7778
  for (let l = 0; l < o.length; l++)
7779
7779
  o[l].type.valid(e, o[l]) || o.splice(l--, 1);
7780
- return new v(o.length ? this.local.concat(o).sort(ze) : this.local, i || this.children);
7780
+ return new R(o.length ? this.local.concat(o).sort(ze) : this.local, i || this.children);
7781
7781
  }
7782
7782
  /**
7783
7783
  Create a new set that contains the decorations in this set, minus
@@ -7804,13 +7804,13 @@ class v {
7804
7804
  for (let l = 0; l < i.length; l++)
7805
7805
  i[l].eq(o, t) && (i == this.local && (i = this.local.slice()), i.splice(l--, 1));
7806
7806
  }
7807
- return n == this.children && i == this.local ? this : i.length || n.length ? new v(i, n) : $;
7807
+ return n == this.children && i == this.local ? this : i.length || n.length ? new R(i, n) : $;
7808
7808
  }
7809
7809
  forChild(e, t) {
7810
7810
  if (this == $)
7811
7811
  return this;
7812
7812
  if (t.isLeaf)
7813
- return v.empty;
7813
+ return R.empty;
7814
7814
  let n, i;
7815
7815
  for (let l = 0; l < this.children.length; l += 3)
7816
7816
  if (this.children[l] >= e) {
@@ -7826,7 +7826,7 @@ class v {
7826
7826
  }
7827
7827
  }
7828
7828
  if (i) {
7829
- let l = new v(i.sort(ze), Ke);
7829
+ let l = new R(i.sort(ze), Ke);
7830
7830
  return n ? new ge([l, n]) : l;
7831
7831
  }
7832
7832
  return n || $;
@@ -7837,7 +7837,7 @@ class v {
7837
7837
  eq(e) {
7838
7838
  if (this == e)
7839
7839
  return !0;
7840
- if (!(e instanceof v) || this.local.length != e.local.length || this.children.length != e.children.length)
7840
+ if (!(e instanceof R) || this.local.length != e.local.length || this.children.length != e.children.length)
7841
7841
  return !1;
7842
7842
  for (let t = 0; t < this.local.length; t++)
7843
7843
  if (!this.local[t].eq(e.local[t]))
@@ -7870,9 +7870,9 @@ class v {
7870
7870
  e(this);
7871
7871
  }
7872
7872
  }
7873
- v.empty = new v([], []);
7874
- v.removeOverlap = rr;
7875
- const $ = v.empty;
7873
+ R.empty = new R([], []);
7874
+ R.removeOverlap = rr;
7875
+ const $ = R.empty;
7876
7876
  class ge {
7877
7877
  constructor(e) {
7878
7878
  this.members = e;
@@ -7883,7 +7883,7 @@ class ge {
7883
7883
  }
7884
7884
  forChild(e, t) {
7885
7885
  if (t.isLeaf)
7886
- return v.empty;
7886
+ return R.empty;
7887
7887
  let n = [];
7888
7888
  for (let i = 0; i < this.members.length; i++) {
7889
7889
  let s = this.members[i].forChild(e, t);
@@ -7923,7 +7923,7 @@ class ge {
7923
7923
  case 1:
7924
7924
  return e[0];
7925
7925
  default:
7926
- return new ge(e.every((t) => t instanceof v) ? e : e.reduce((t, n) => t.concat(n instanceof v ? n : n.members), []));
7926
+ return new ge(e.every((t) => t instanceof R) ? e : e.reduce((t, n) => t.concat(n instanceof R ? n : n.members), []));
7927
7927
  }
7928
7928
  }
7929
7929
  forEachSet(e) {
@@ -7938,11 +7938,11 @@ function ya(r, e, t, n, i, s, o) {
7938
7938
  t.maps[c].forEach((u, h, p, m) => {
7939
7939
  let g = m - p - (h - u);
7940
7940
  for (let y = 0; y < l.length; y += 3) {
7941
- let C = l[y + 1];
7942
- if (C < 0 || u > C + f - d)
7941
+ let M = l[y + 1];
7942
+ if (M < 0 || u > M + f - d)
7943
7943
  continue;
7944
- let M = l[y] + f - d;
7945
- h >= M ? l[y + 1] = u <= M ? -2 : -1 : u >= f && g && (l[y] += g, l[y + 1] += g);
7944
+ let C = l[y] + f - d;
7945
+ h >= C ? l[y + 1] = u <= C ? -2 : -1 : u >= f && g && (l[y] += g, l[y + 1] += g);
7946
7946
  }
7947
7947
  d += g;
7948
7948
  }), f = t.maps[c].map(f, -1);
@@ -7978,7 +7978,7 @@ function ya(r, e, t, n, i, s, o) {
7978
7978
  l.splice(u, 0, f.children[d], f.children[d + 1], f.children[d + 2]);
7979
7979
  }
7980
7980
  }
7981
- return new v(e.sort(ze), l);
7981
+ return new R(e.sort(ze), l);
7982
7982
  }
7983
7983
  function As(r, e) {
7984
7984
  if (!e || !r.length)
@@ -8011,7 +8011,7 @@ function Is(r, e, t) {
8011
8011
  (o = r[s]) && o.from > t && o.to < n && ((i || (i = [])).push(o), r[s] = null);
8012
8012
  return i;
8013
8013
  }
8014
- function Rs(r) {
8014
+ function vs(r) {
8015
8015
  let e = [];
8016
8016
  for (let t = 0; t < r.length; t++)
8017
8017
  r[t] != null && e.push(r[t]);
@@ -8027,10 +8027,10 @@ function Jt(r, e, t, n) {
8027
8027
  f != $ && i.push(a, a + l.nodeSize, f);
8028
8028
  }
8029
8029
  });
8030
- let o = As(s ? Rs(r) : r, -t).sort(ze);
8030
+ let o = As(s ? vs(r) : r, -t).sort(ze);
8031
8031
  for (let l = 0; l < o.length; l++)
8032
8032
  o[l].type.valid(e, o[l]) || (n.onRemove && n.onRemove(o[l].spec), o.splice(l--, 1));
8033
- return o.length || i.length ? new v(o, i) : $;
8033
+ return o.length || i.length ? new R(o, i) : $;
8034
8034
  }
8035
8035
  function ze(r, e) {
8036
8036
  return r.from - e.from || r.to - e.to;
@@ -8063,7 +8063,7 @@ function bn(r) {
8063
8063
  return r.someProp("decorations", (t) => {
8064
8064
  let n = t(r.state);
8065
8065
  n && n != $ && e.push(n);
8066
- }), r.cursorWrapper && e.push(v.create(r.state.doc, [r.cursorWrapper.deco])), ge.from(e);
8066
+ }), r.cursorWrapper && e.push(R.create(r.state.doc, [r.cursorWrapper.deco])), ge.from(e);
8067
8067
  }
8068
8068
  const ka = {
8069
8069
  childList: !0,
@@ -8072,7 +8072,7 @@ const ka = {
8072
8072
  attributes: !0,
8073
8073
  attributeOldValue: !0,
8074
8074
  subtree: !0
8075
- }, xa = G && Ce <= 11;
8075
+ }, xa = G && Me <= 11;
8076
8076
  class Sa {
8077
8077
  constructor() {
8078
8078
  this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
@@ -8087,12 +8087,12 @@ class Sa {
8087
8087
  return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
8088
8088
  }
8089
8089
  }
8090
- class Ca {
8090
+ class Ma {
8091
8091
  constructor(e, t) {
8092
8092
  this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Sa(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((n) => {
8093
8093
  for (let i = 0; i < n.length; i++)
8094
8094
  this.queue.push(n[i]);
8095
- G && Ce <= 11 && n.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
8095
+ G && Me <= 11 && n.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
8096
8096
  }), xa && (this.onCharData = (n) => {
8097
8097
  this.queue.push({ target: n.target, type: "characterData", oldValue: n.prevValue }), this.flushSoon();
8098
8098
  }), this.onSelectionChange = this.onSelectionChange.bind(this);
@@ -8133,7 +8133,7 @@ class Ca {
8133
8133
  if (Ur(this.view)) {
8134
8134
  if (this.suppressingSelectionUpdates)
8135
8135
  return ue(this.view);
8136
- if (G && Ce <= 11 && !this.view.state.selection.empty) {
8136
+ if (G && Me <= 11 && !this.view.state.selection.empty) {
8137
8137
  let e = this.view.domSelectionRange();
8138
8138
  if (e.focusNode && Ve(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
8139
8139
  return this.flushSoon();
@@ -8194,7 +8194,7 @@ class Ca {
8194
8194
  }
8195
8195
  }
8196
8196
  let c = null;
8197
- s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && _t(n) && (c = _n(e)) && c.eq(N.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, ue(e), this.currentSelection.set(n)) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Ma(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(n) || ue(e), this.currentSelection.set(n));
8197
+ s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && _t(n) && (c = _n(e)) && c.eq(N.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, ue(e), this.currentSelection.set(n)) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Ca(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(n) || ue(e), this.currentSelection.set(n));
8198
8198
  }
8199
8199
  registerMutation(e, t) {
8200
8200
  if (t.indexOf(e.target) > -1)
@@ -8211,7 +8211,7 @@ class Ca {
8211
8211
  if (n.contentDOM && n.contentDOM != n.dom && !n.contentDOM.contains(e.target))
8212
8212
  return { from: n.posBefore, to: n.posAfter };
8213
8213
  let i = e.previousSibling, s = e.nextSibling;
8214
- if (G && Ce <= 11 && e.addedNodes.length)
8214
+ if (G && Me <= 11 && e.addedNodes.length)
8215
8215
  for (let f = 0; f < e.addedNodes.length; f++) {
8216
8216
  let { previousSibling: d, nextSibling: u } = e.addedNodes[f];
8217
8217
  (!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (i = d), (!u || Array.prototype.indexOf.call(e.addedNodes, u) < 0) && (s = u);
@@ -8230,7 +8230,7 @@ class Ca {
8230
8230
  }
8231
8231
  }
8232
8232
  let ni = /* @__PURE__ */ new WeakMap(), ri = !1;
8233
- function Ma(r) {
8233
+ function Ca(r) {
8234
8234
  if (!ni.has(r) && (ni.set(r, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace) !== -1)) {
8235
8235
  if (r.requiresGeckoHackNode = te, ri)
8236
8236
  return;
@@ -8265,12 +8265,12 @@ function Na(r, e, t) {
8265
8265
  let { node: n, fromOffset: i, toOffset: s, from: o, to: l } = r.docView.parseRange(e, t), a = r.domSelectionRange(), c, f = a.anchorNode;
8266
8266
  if (f && r.dom.contains(f.nodeType == 1 ? f : f.parentNode) && (c = [{ node: f, offset: a.anchorOffset }], _t(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), W && r.input.lastKeyCode === 8)
8267
8267
  for (let g = s; g > i; g--) {
8268
- let y = n.childNodes[g - 1], C = y.pmViewDesc;
8269
- if (y.nodeName == "BR" && !C) {
8268
+ let y = n.childNodes[g - 1], M = y.pmViewDesc;
8269
+ if (y.nodeName == "BR" && !M) {
8270
8270
  s = g;
8271
8271
  break;
8272
8272
  }
8273
- if (!C || C.size)
8273
+ if (!M || M.size)
8274
8274
  break;
8275
8275
  }
8276
8276
  let d = r.state.doc, u = r.someProp("domParser") || Se.fromSchema(r.state.schema), h = d.resolve(o), p = null, m = u.parse(n, {
@@ -8312,8 +8312,8 @@ function Da(r, e, t, n, i) {
8312
8312
  if (he && !r.state.selection.eq(he)) {
8313
8313
  if (W && ce && r.input.lastKeyCode === 13 && Date.now() - 100 < r.input.lastKeyCodeTime && r.someProp("handleKeyDown", (io) => io(r, De(13, "Enter"))))
8314
8314
  return;
8315
- let Ct = r.state.tr.setSelection(he);
8316
- T == "pointer" ? Ct.setMeta("pointer", !0) : T == "key" && Ct.scrollIntoView(), s && Ct.setMeta("composition", s), r.dispatch(Ct);
8315
+ let Mt = r.state.tr.setSelection(he);
8316
+ T == "pointer" ? Mt.setMeta("pointer", !0) : T == "key" && Mt.scrollIntoView(), s && Mt.setMeta("composition", s), r.dispatch(Mt);
8317
8317
  }
8318
8318
  return;
8319
8319
  }
@@ -8321,7 +8321,7 @@ function Da(r, e, t, n, i) {
8321
8321
  e = o.before(l + 1), t = r.state.doc.resolve(t).after(l + 1);
8322
8322
  let a = r.state.selection, c = Na(r, e, t), f = r.state.doc, d = f.slice(c.from, c.to), u, h;
8323
8323
  r.input.lastKeyCode === 8 && Date.now() - 100 < r.input.lastKeyCodeTime ? (u = r.state.selection.to, h = "end") : (u = r.state.selection.from, h = "start"), r.input.lastKeyCode = null;
8324
- let p = Ra(d.content, c.doc.content, c.from, u, h);
8324
+ let p = va(d.content, c.doc.content, c.from, u, h);
8325
8325
  if (p && r.input.domChangeCount++, (Qe && r.input.lastIOSEnter > Date.now() - 225 || ce) && i.some((T) => T.nodeType == 1 && !Ea.test(T.nodeName)) && (!p || p.endA >= p.endB) && r.someProp("handleKeyDown", (T) => T(r, De(13, "Enter")))) {
8326
8326
  r.input.lastIOSEnter = 0;
8327
8327
  return;
@@ -8339,9 +8339,9 @@ function Da(r, e, t, n, i) {
8339
8339
  }
8340
8340
  return;
8341
8341
  }
8342
- r.state.selection.from < r.state.selection.to && p.start == p.endB && r.state.selection instanceof O && (p.start > r.state.selection.from && p.start <= r.state.selection.from + 2 && r.state.selection.from >= c.from ? p.start = r.state.selection.from : p.endA < r.state.selection.to && p.endA >= r.state.selection.to - 2 && r.state.selection.to <= c.to && (p.endB += r.state.selection.to - p.endA, p.endA = r.state.selection.to)), G && Ce <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == "  " && (p.start--, p.endA--, p.endB--);
8343
- let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = f.resolve(p.start), C = m.sameParent(g) && m.parent.inlineContent && y.end() >= p.endA, M;
8344
- if ((Qe && r.input.lastIOSEnter > Date.now() - 225 && (!C || i.some((T) => T.nodeName == "DIV" || T.nodeName == "P")) || !C && m.pos < c.doc.content.size && !m.sameParent(g) && (M = N.findFrom(c.doc.resolve(m.pos + 1), 1, !0)) && M.head == g.pos) && r.someProp("handleKeyDown", (T) => T(r, De(13, "Enter")))) {
8342
+ r.state.selection.from < r.state.selection.to && p.start == p.endB && r.state.selection instanceof O && (p.start > r.state.selection.from && p.start <= r.state.selection.from + 2 && r.state.selection.from >= c.from ? p.start = r.state.selection.from : p.endA < r.state.selection.to && p.endA >= r.state.selection.to - 2 && r.state.selection.to <= c.to && (p.endB += r.state.selection.to - p.endA, p.endA = r.state.selection.to)), G && Me <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == "  " && (p.start--, p.endA--, p.endB--);
8343
+ let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = f.resolve(p.start), M = m.sameParent(g) && m.parent.inlineContent && y.end() >= p.endA, C;
8344
+ if ((Qe && r.input.lastIOSEnter > Date.now() - 225 && (!M || i.some((T) => T.nodeName == "DIV" || T.nodeName == "P")) || !M && m.pos < c.doc.content.size && !m.sameParent(g) && (C = N.findFrom(c.doc.resolve(m.pos + 1), 1, !0)) && C.head == g.pos) && r.someProp("handleKeyDown", (T) => T(r, De(13, "Enter")))) {
8345
8345
  r.input.lastIOSEnter = 0;
8346
8346
  return;
8347
8347
  }
@@ -8349,15 +8349,15 @@ function Da(r, e, t, n, i) {
8349
8349
  ce && W && r.domObserver.suppressSelectionUpdates();
8350
8350
  return;
8351
8351
  }
8352
- W && p.endB == p.start && (r.input.lastChromeDelete = Date.now()), ce && !C && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
8352
+ W && p.endB == p.start && (r.input.lastChromeDelete = Date.now()), ce && !M && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
8353
8353
  r.someProp("handleKeyDown", function(T) {
8354
8354
  return T(r, De(13, "Enter"));
8355
8355
  });
8356
8356
  }, 20));
8357
8357
  let D = p.start, E = p.endA, A, U, j;
8358
- if (C) {
8358
+ if (M) {
8359
8359
  if (m.pos == g.pos)
8360
- G && Ce <= 11 && m.parentOffset == 0 && (r.domObserver.suppressSelectionUpdates(), setTimeout(() => ue(r), 20)), A = r.state.tr.delete(D, E), U = f.resolve(p.start).marksAcross(f.resolve(p.endA));
8360
+ G && Me <= 11 && m.parentOffset == 0 && (r.domObserver.suppressSelectionUpdates(), setTimeout(() => ue(r), 20)), A = r.state.tr.delete(D, E), U = f.resolve(p.start).marksAcross(f.resolve(p.endA));
8361
8361
  else if (
8362
8362
  // Adding or removing a mark
8363
8363
  p.endA == p.endB && (j = Aa(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
@@ -8425,7 +8425,7 @@ function kn(r, e, t) {
8425
8425
  }
8426
8426
  return i;
8427
8427
  }
8428
- function Ra(r, e, t, n, i) {
8428
+ function va(r, e, t, n, i) {
8429
8429
  let s = r.findDiffStart(e, t);
8430
8430
  if (s == null)
8431
8431
  return null;
@@ -8449,7 +8449,7 @@ function oi(r) {
8449
8449
  let e = r.charCodeAt(0), t = r.charCodeAt(1);
8450
8450
  return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
8451
8451
  }
8452
- class va {
8452
+ class Ra {
8453
8453
  /**
8454
8454
  Create a view. `place` may be a DOM node that the editor should
8455
8455
  be appended to, a function that will place it into the document,
@@ -8458,7 +8458,7 @@ class va {
8458
8458
  added to the document.
8459
8459
  */
8460
8460
  constructor(e, t) {
8461
- 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 Ql(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(di), 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 = ci(this), ai(this), this.nodeViews = fi(this), this.docView = Wr(this.state.doc, li(this), bn(this), this.dom, this), this.domObserver = new Ca(this, (n, i, s, o) => Da(this, n, i, s, o)), this.domObserver.start(), Zl(this), this.updatePluginViews();
8461
+ 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 Ql(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(di), 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 = ci(this), ai(this), this.nodeViews = fi(this), this.docView = Wr(this.state.doc, li(this), bn(this), this.dom, this), this.domObserver = new Ma(this, (n, i, s, o) => Da(this, n, i, s, o)), this.domObserver.start(), Zl(this), this.updatePluginViews();
8462
8462
  }
8463
8463
  /**
8464
8464
  Holds `true` when a
@@ -8983,12 +8983,12 @@ function ja(r) {
8983
8983
  };
8984
8984
  }
8985
8985
  const ir = (r, e) => r.selection.empty ? !1 : (e && e(r.tr.deleteSelection().scrollIntoView()), !0);
8986
- function vs(r, e) {
8986
+ function Rs(r, e) {
8987
8987
  let { $cursor: t } = r.selection;
8988
8988
  return !t || (e ? !e.endOfTextblock("backward", r) : t.parentOffset > 0) ? null : t;
8989
8989
  }
8990
8990
  const Ps = (r, e, t) => {
8991
- let n = vs(r, t);
8991
+ let n = Rs(r, t);
8992
8992
  if (!n)
8993
8993
  return !1;
8994
8994
  let i = sr(n);
@@ -9014,7 +9014,7 @@ const Ps = (r, e, t) => {
9014
9014
  }
9015
9015
  return s.isAtom && i.depth == n.depth - 1 ? (e && e(r.tr.delete(i.pos - s.nodeSize, i.pos).scrollIntoView()), !0) : !1;
9016
9016
  }, qa = (r, e, t) => {
9017
- let n = vs(r, t);
9017
+ let n = Rs(r, t);
9018
9018
  if (!n)
9019
9019
  return !1;
9020
9020
  let i = sr(n);
@@ -9271,10 +9271,10 @@ function js(r, e, t, n) {
9271
9271
  if (h.canReplace(h.childCount, h.childCount, m.content)) {
9272
9272
  if (t) {
9273
9273
  let y = b.empty;
9274
- for (let M = p.length - 1; M >= 0; M--)
9275
- y = b.from(p[M].copy(y));
9276
- let C = r.tr.step(new B(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(y, p.length, 0), 0, !0));
9277
- t(C.scrollIntoView());
9274
+ for (let C = p.length - 1; C >= 0; C--)
9275
+ y = b.from(p[C].copy(y));
9276
+ let M = r.tr.step(new B(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(y, p.length, 0), 0, !0));
9277
+ t(M.scrollIntoView());
9278
9278
  }
9279
9279
  return !0;
9280
9280
  }
@@ -9681,11 +9681,11 @@ function pc(r, e) {
9681
9681
  options: c.options,
9682
9682
  storage: c.storage,
9683
9683
  editor: e
9684
- }, u = r.reduce((y, C) => {
9685
- const M = x(C, "extendNodeSchema", d);
9684
+ }, u = r.reduce((y, M) => {
9685
+ const C = x(M, "extendNodeSchema", d);
9686
9686
  return {
9687
9687
  ...y,
9688
- ...M ? M(c) : {}
9688
+ ...C ? C(c) : {}
9689
9689
  };
9690
9690
  }, {}), h = pi({
9691
9691
  ...u,
@@ -9702,8 +9702,8 @@ function pc(r, e) {
9702
9702
  defining: w(x(c, "defining", d)),
9703
9703
  isolating: w(x(c, "isolating", d)),
9704
9704
  attrs: Object.fromEntries(f.map((y) => {
9705
- var C;
9706
- return [y.name, { default: (C = y == null ? void 0 : y.attribute) === null || C === void 0 ? void 0 : C.default }];
9705
+ var M;
9706
+ return [y.name, { default: (M = y == null ? void 0 : y.attribute) === null || M === void 0 ? void 0 : M.default }];
9707
9707
  }))
9708
9708
  }), p = w(x(c, "parseHTML", d));
9709
9709
  p && (h.parseDOM = p.map((y) => hi(y, f)));
@@ -9721,10 +9721,10 @@ function pc(r, e) {
9721
9721
  storage: c.storage,
9722
9722
  editor: e
9723
9723
  }, u = r.reduce((g, y) => {
9724
- const C = x(y, "extendMarkSchema", d);
9724
+ const M = x(y, "extendMarkSchema", d);
9725
9725
  return {
9726
9726
  ...g,
9727
- ...C ? C(c) : {}
9727
+ ...M ? M(c) : {}
9728
9728
  };
9729
9729
  }, {}), h = pi({
9730
9730
  ...u,
@@ -9751,7 +9751,7 @@ function pc(r, e) {
9751
9751
  marks: a
9752
9752
  });
9753
9753
  }
9754
- function Cn(r, e) {
9754
+ function Mn(r, e) {
9755
9755
  return e.nodes[r] || e.marks[r] || null;
9756
9756
  }
9757
9757
  function mi(r, e) {
@@ -9817,7 +9817,7 @@ function Nt(r) {
9817
9817
  }), g = {
9818
9818
  from: n - (h[0].length - s.length),
9819
9819
  to: i
9820
- }, { commands: y, chain: C, can: M } = new en({
9820
+ }, { commands: y, chain: M, can: C } = new en({
9821
9821
  editor: t,
9822
9822
  state: m
9823
9823
  });
@@ -9826,8 +9826,8 @@ function Nt(r) {
9826
9826
  range: g,
9827
9827
  match: h,
9828
9828
  commands: y,
9829
- chain: C,
9830
- can: M
9829
+ chain: M,
9830
+ can: C
9831
9831
  }) === null || !p.steps.length || (p.setMeta(l, {
9832
9832
  transform: p,
9833
9833
  from: n,
@@ -9992,16 +9992,16 @@ function Sc(r) {
9992
9992
  if (!h.isTextblock || h.type.spec.code)
9993
9993
  return;
9994
9994
  const m = Math.max(n, p), g = Math.min(i, p + h.content.size), y = h.textBetween(m - p, g - p, void 0, "");
9995
- xc(y, s.find, o).forEach((M) => {
9996
- if (M.index === void 0)
9995
+ xc(y, s.find, o).forEach((C) => {
9996
+ if (C.index === void 0)
9997
9997
  return;
9998
- const D = m + M.index + 1, E = D + M[0].length, A = {
9998
+ const D = m + C.index + 1, E = D + C[0].length, A = {
9999
9999
  from: t.tr.mapping.map(D),
10000
10000
  to: t.tr.mapping.map(E)
10001
10001
  }, U = s.handler({
10002
10002
  state: t,
10003
10003
  range: A,
10004
- match: M,
10004
+ match: C,
10005
10005
  commands: a,
10006
10006
  chain: c,
10007
10007
  can: f,
@@ -10013,14 +10013,14 @@ function Sc(r) {
10013
10013
  }), d.every((h) => h !== null);
10014
10014
  }
10015
10015
  let Et = null;
10016
- const Cc = (r) => {
10016
+ const Mc = (r) => {
10017
10017
  var e;
10018
10018
  const t = new ClipboardEvent("paste", {
10019
10019
  clipboardData: new DataTransfer()
10020
10020
  });
10021
10021
  return (e = t.clipboardData) === null || e === void 0 || e.setData("text/html", r), t;
10022
10022
  };
10023
- function Mc(r) {
10023
+ function Cc(r) {
10024
10024
  const { editor: e, rules: t } = r;
10025
10025
  let n = null, i = !1, s = !1, o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, l;
10026
10026
  try {
@@ -10070,7 +10070,7 @@ function Mc(r) {
10070
10070
  drop: (d, u) => {
10071
10071
  if (s = n === d.dom.parentElement, l = u, !s) {
10072
10072
  const h = Et;
10073
- h && setTimeout(() => {
10073
+ h != null && h.isEditable && setTimeout(() => {
10074
10074
  const p = h.state.selection;
10075
10075
  p && h.commands.deleteRange({ from: p.from, to: p.to });
10076
10076
  }, 10);
@@ -10085,13 +10085,13 @@ function Mc(r) {
10085
10085
  }
10086
10086
  },
10087
10087
  appendTransaction: (d, u, h) => {
10088
- const p = d[0], m = p.getMeta("uiEvent") === "paste" && !i, g = p.getMeta("uiEvent") === "drop" && !s, y = p.getMeta("applyPasteRules"), C = !!y;
10089
- if (!m && !g && !C)
10088
+ const p = d[0], m = p.getMeta("uiEvent") === "paste" && !i, g = p.getMeta("uiEvent") === "drop" && !s, y = p.getMeta("applyPasteRules"), M = !!y;
10089
+ if (!m && !g && !M)
10090
10090
  return;
10091
- if (C) {
10091
+ if (M) {
10092
10092
  let { text: E } = y;
10093
10093
  typeof E == "string" ? E = E : E = cr(b.from(E), h.schema);
10094
- const { from: A } = y, U = A + E.length, j = Cc(E);
10094
+ const { from: A } = y, U = A + E.length, j = Mc(E);
10095
10095
  return a({
10096
10096
  rule: f,
10097
10097
  state: h,
@@ -10100,12 +10100,12 @@ function Mc(r) {
10100
10100
  pasteEvt: j
10101
10101
  });
10102
10102
  }
10103
- const M = u.doc.content.findDiffStart(h.doc.content), D = u.doc.content.findDiffEnd(h.doc.content);
10104
- if (!(!kc(M) || !D || M === D.b))
10103
+ const C = u.doc.content.findDiffStart(h.doc.content), D = u.doc.content.findDiffEnd(h.doc.content);
10104
+ if (!(!kc(C) || !D || C === D.b))
10105
10105
  return a({
10106
10106
  rule: f,
10107
10107
  state: h,
10108
- from: M,
10108
+ from: C,
10109
10109
  to: D,
10110
10110
  pasteEvt: o
10111
10111
  });
@@ -10167,7 +10167,7 @@ class Ue {
10167
10167
  options: t.options,
10168
10168
  storage: t.storage,
10169
10169
  editor: this.editor,
10170
- type: Cn(t.name, this.schema)
10170
+ type: Mn(t.name, this.schema)
10171
10171
  }, i = x(t, "addCommands", n);
10172
10172
  return i ? {
10173
10173
  ...e,
@@ -10186,7 +10186,7 @@ class Ue {
10186
10186
  options: o.options,
10187
10187
  storage: o.storage,
10188
10188
  editor: e,
10189
- type: Cn(o.name, this.schema)
10189
+ type: Mn(o.name, this.schema)
10190
10190
  }, a = [], c = x(o, "addKeyboardShortcuts", l);
10191
10191
  let f = {};
10192
10192
  if (o.type === "mark" && x(o, "exitable", l) && (f.ArrowRight = () => qt.handleExit({ editor: e, mark: o })), c) {
@@ -10211,7 +10211,7 @@ class Ue {
10211
10211
  editor: e,
10212
10212
  rules: n
10213
10213
  }),
10214
- ...Mc({
10214
+ ...Cc({
10215
10215
  editor: e,
10216
10216
  rules: i
10217
10217
  }),
@@ -10272,7 +10272,7 @@ class Ue {
10272
10272
  options: e.options,
10273
10273
  storage: e.storage,
10274
10274
  editor: this.editor,
10275
- type: Cn(e.name, this.schema)
10275
+ type: Mn(e.name, this.schema)
10276
10276
  };
10277
10277
  e.type === "mark" && (!((t = w(x(e, "keepOnSplit", n))) !== null && t !== void 0) || t) && this.splittableMarks.push(e.name);
10278
10278
  const i = x(e, "onBeforeCreate", n), s = x(e, "onCreate", n), o = x(e, "onUpdate", n), l = x(e, "onSelectionUpdate", n), a = x(e, "onTransaction", n), c = x(e, "onFocus", n), f = x(e, "onBlur", n), d = x(e, "onDestroy", n);
@@ -10385,8 +10385,8 @@ const Oc = ne.create({
10385
10385
  const { state: i } = t, s = i.doc.slice(r.from, r.to);
10386
10386
  n.deleteRange(r.from, r.to);
10387
10387
  const o = n.mapping.map(e);
10388
- return n.insert(o, s.content), n.setSelection(new O(n.doc.resolve(o - 1))), !0;
10389
- }, Rc = () => ({ tr: r, dispatch: e }) => {
10388
+ return n.insert(o, s.content), n.setSelection(new O(n.doc.resolve(Math.max(o - 1, 0)))), !0;
10389
+ }, vc = () => ({ tr: r, dispatch: e }) => {
10390
10390
  const { selection: t } = r, n = t.$anchor.node();
10391
10391
  if (n.content.size > 0)
10392
10392
  return !1;
@@ -10400,7 +10400,7 @@ const Oc = ne.create({
10400
10400
  return !0;
10401
10401
  }
10402
10402
  return !1;
10403
- }, vc = (r) => ({ tr: e, state: t, dispatch: n }) => {
10403
+ }, Rc = (r) => ({ tr: e, state: t, dispatch: n }) => {
10404
10404
  const i = z(r, t.schema), s = e.selection.$anchor;
10405
10405
  for (let o = s.depth; o > 0; o -= 1)
10406
10406
  if (s.node(o).type === i) {
@@ -10852,7 +10852,7 @@ function Sf(r, e = JSON.stringify) {
10852
10852
  return Object.prototype.hasOwnProperty.call(t, i) ? !1 : t[i] = !0;
10853
10853
  });
10854
10854
  }
10855
- function Cf(r) {
10855
+ function Mf(r) {
10856
10856
  const e = Sf(r);
10857
10857
  return e.length === 1 ? e : e.filter((t, n) => !e.filter((s, o) => o !== n).some((s) => t.oldRange.from >= s.oldRange.from && t.oldRange.to <= s.oldRange.to && t.newRange.from >= s.newRange.from && t.newRange.to <= s.newRange.to));
10858
10858
  }
@@ -10883,7 +10883,7 @@ function nd(r) {
10883
10883
  }
10884
10884
  });
10885
10885
  });
10886
- }), Cf(n);
10886
+ }), Mf(n);
10887
10887
  }
10888
10888
  function ro(r, e, t) {
10889
10889
  const n = [];
@@ -10901,7 +10901,7 @@ function ro(r, e, t) {
10901
10901
  })));
10902
10902
  }), n;
10903
10903
  }
10904
- function Rt(r, e, t) {
10904
+ function vt(r, e, t) {
10905
10905
  return Object.fromEntries(Object.entries(t).filter(([n]) => {
10906
10906
  const i = r.find((s) => s.type === e && s.name === n);
10907
10907
  return i ? i.attribute.keepOnSplit : !1;
@@ -10918,11 +10918,11 @@ function jn(r, e, t = {}) {
10918
10918
  r.doc.nodesBetween(h, p, (m, g) => {
10919
10919
  if (!m.isText && !m.marks.length)
10920
10920
  return;
10921
- const y = Math.max(h, g), C = Math.min(p, g + m.nodeSize), M = C - y;
10922
- o += M, l.push(...m.marks.map((D) => ({
10921
+ const y = Math.max(h, g), M = Math.min(p, g + m.nodeSize), C = M - y;
10922
+ o += C, l.push(...m.marks.map((D) => ({
10923
10923
  mark: D,
10924
10924
  from: y,
10925
- to: C
10925
+ to: M
10926
10926
  })));
10927
10927
  });
10928
10928
  }), o === 0)
@@ -10930,7 +10930,7 @@ function jn(r, e, t = {}) {
10930
10930
  const a = l.filter((d) => s ? s.name === d.mark.type.name : !0).filter((d) => Kt(d.mark.attrs, t, { strict: !1 })).reduce((d, u) => d + u.to - u.from, 0), c = l.filter((d) => s ? d.mark.type !== s && d.mark.type.excludes(s) : !0).reduce((d, u) => d + u.to - u.from, 0);
10931
10931
  return (a > 0 ? a + c : a) >= o;
10932
10932
  }
10933
- function Mf(r, e, t = {}) {
10933
+ function Cf(r, e, t = {}) {
10934
10934
  if (!e)
10935
10935
  return bt(r, null, t) || jn(r, null, t);
10936
10936
  const n = on(e, r.schema);
@@ -11061,7 +11061,7 @@ function ki(r, e) {
11061
11061
  }
11062
11062
  }
11063
11063
  const If = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, editor: i }) => {
11064
- const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, f = Rt(c, l.node().type.name, l.node().attrs);
11064
+ const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, f = vt(c, l.node().type.name, l.node().attrs);
11065
11065
  if (s instanceof S && s.node.isBlock)
11066
11066
  return !l.parentOffset || !de(o, l.pos) ? !1 : (n && (r && ki(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
11067
11067
  if (!l.parent.isBlock)
@@ -11086,7 +11086,7 @@ const If = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11086
11086
  r && ki(t, i.extensionManager.splittableMarks), e.scrollIntoView();
11087
11087
  }
11088
11088
  return p;
11089
- }, Rf = (r, e = {}) => ({ tr: t, state: n, dispatch: i, editor: s }) => {
11089
+ }, vf = (r, e = {}) => ({ tr: t, state: n, dispatch: i, editor: s }) => {
11090
11090
  var o;
11091
11091
  const l = z(r, n.schema), { $from: a, $to: c } = n.selection, f = n.selection.node;
11092
11092
  if (f && f.isBlock || a.depth < 2 || !a.sameParent(c))
@@ -11100,16 +11100,16 @@ const If = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11100
11100
  return !1;
11101
11101
  if (i) {
11102
11102
  let y = b.empty;
11103
- const C = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
11104
- for (let j = a.depth - C; j >= a.depth - 3; j -= 1)
11103
+ const M = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
11104
+ for (let j = a.depth - M; j >= a.depth - 3; j -= 1)
11105
11105
  y = b.from(a.node(j).copy(y));
11106
- const M = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, D = {
11107
- ...Rt(u, a.node().type.name, a.node().attrs),
11106
+ const C = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, D = {
11107
+ ...vt(u, a.node().type.name, a.node().attrs),
11108
11108
  ...e
11109
11109
  }, E = ((o = l.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.createAndFill(D)) || void 0;
11110
11110
  y = y.append(b.from(l.createAndFill(null, E) || void 0));
11111
- const A = a.before(a.depth - (C - 1));
11112
- t.replace(A, a.after(-M), new k(y, 4 - C, 0));
11111
+ const A = a.before(a.depth - (M - 1));
11112
+ t.replace(A, a.after(-C), new k(y, 4 - M, 0));
11113
11113
  let U = -1;
11114
11114
  t.doc.nodesBetween(A, t.doc.content.size, (j, T) => {
11115
11115
  if (U > -1)
@@ -11120,10 +11120,10 @@ const If = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11120
11120
  return !0;
11121
11121
  }
11122
11122
  const h = c.pos === a.end() ? d.contentMatchAt(0).defaultType : null, p = {
11123
- ...Rt(u, d.type.name, d.attrs),
11123
+ ...vt(u, d.type.name, d.attrs),
11124
11124
  ...e
11125
11125
  }, m = {
11126
- ...Rt(u, a.node().type.name, a.node().attrs),
11126
+ ...vt(u, a.node().type.name, a.node().attrs),
11127
11127
  ...e
11128
11128
  };
11129
11129
  t.delete(a.pos, c.pos);
@@ -11134,14 +11134,14 @@ const If = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11134
11134
  if (!de(t.doc, a.pos, 2))
11135
11135
  return !1;
11136
11136
  if (i) {
11137
- const { selection: y, storedMarks: C } = n, { splittableMarks: M } = s.extensionManager, D = C || y.$to.parentOffset && y.$from.marks();
11137
+ const { selection: y, storedMarks: M } = n, { splittableMarks: C } = s.extensionManager, D = M || y.$to.parentOffset && y.$from.marks();
11138
11138
  if (t.split(a.pos, 2, g).scrollIntoView(), !D || !i)
11139
11139
  return !0;
11140
- const E = D.filter((A) => M.includes(A.type.name));
11140
+ const E = D.filter((A) => C.includes(A.type.name));
11141
11141
  t.ensureMarks(E);
11142
11142
  }
11143
11143
  return !0;
11144
- }, Mn = (r, e) => {
11144
+ }, Cn = (r, e) => {
11145
11145
  const t = ur((o) => o.type === e)(r.selection);
11146
11146
  if (!t)
11147
11147
  return !0;
@@ -11159,21 +11159,21 @@ const If = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11159
11159
  return !0;
11160
11160
  const i = r.doc.nodeAt(n);
11161
11161
  return t.node.type === (i == null ? void 0 : i.type) && Ne(r.doc, n) && r.join(n), !0;
11162
- }, vf = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: f }) => {
11163
- const { extensions: d, splittableMarks: u } = i.extensionManager, h = z(r, o.schema), p = z(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: C } = m, M = y.blockRange(C), D = g || m.$to.parentOffset && m.$from.marks();
11164
- if (!M)
11162
+ }, Rf = (r, e, t, n = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: f }) => {
11163
+ const { extensions: d, splittableMarks: u } = i.extensionManager, h = z(r, o.schema), p = z(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: M } = m, C = y.blockRange(M), D = g || m.$to.parentOffset && m.$from.marks();
11164
+ if (!C)
11165
11165
  return !1;
11166
11166
  const E = ur((A) => bi(A.type.name, d))(m);
11167
- if (M.depth >= 1 && E && M.depth - E.depth <= 1) {
11167
+ if (C.depth >= 1 && E && C.depth - E.depth <= 1) {
11168
11168
  if (E.node.type === h)
11169
11169
  return c.liftListItem(p);
11170
11170
  if (bi(E.node.type.name, d) && h.validContent(E.node.content) && l)
11171
- return a().command(() => (s.setNodeMarkup(E.pos, h), !0)).command(() => Mn(s, h)).command(() => wn(s, h)).run();
11171
+ return a().command(() => (s.setNodeMarkup(E.pos, h), !0)).command(() => Cn(s, h)).command(() => wn(s, h)).run();
11172
11172
  }
11173
- return !t || !D || !l ? a().command(() => f().wrapInList(h, n) ? !0 : c.clearNodes()).wrapInList(h, n).command(() => Mn(s, h)).command(() => wn(s, h)).run() : a().command(() => {
11173
+ return !t || !D || !l ? a().command(() => f().wrapInList(h, n) ? !0 : c.clearNodes()).wrapInList(h, n).command(() => Cn(s, h)).command(() => wn(s, h)).run() : a().command(() => {
11174
11174
  const A = f().wrapInList(h, n), U = D.filter((j) => u.includes(j.type.name));
11175
11175
  return s.ensureMarks(U), A ? !0 : c.clearNodes();
11176
- }).wrapInList(h, n).command(() => Mn(s, h)).command(() => wn(s, h)).run();
11176
+ }).wrapInList(h, n).command(() => Cn(s, h)).command(() => wn(s, h)).run();
11177
11177
  }, Pf = (r, e = {}, t = {}) => ({ state: n, commands: i }) => {
11178
11178
  const { extendEmptyMarkRange: s = !1 } = t, o = Ee(r, n.schema);
11179
11179
  return jn(n, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
@@ -11237,8 +11237,8 @@ const If = ({ keepMarks: r = !0 } = {}) => ({ tr: e, state: t, dispatch: n, edit
11237
11237
  ...e
11238
11238
  }), o && m.marks.length && m.marks.forEach((y) => {
11239
11239
  if (o === y.type) {
11240
- const C = Math.max(g, c), M = Math.min(g + m.nodeSize, f);
11241
- t.addMark(C, M, o.create({
11240
+ const M = Math.max(g, c), C = Math.min(g + m.nodeSize, f);
11241
+ t.addMark(M, C, o.create({
11242
11242
  ...y.attrs,
11243
11243
  ...e
11244
11244
  }));
@@ -11269,8 +11269,8 @@ var jf = /* @__PURE__ */ Object.freeze({
11269
11269
  command: Dc,
11270
11270
  createParagraphNear: Ac,
11271
11271
  cut: Ic,
11272
- deleteCurrentNode: Rc,
11273
- deleteNode: vc,
11272
+ deleteCurrentNode: vc,
11273
+ deleteNode: Rc,
11274
11274
  deleteRange: Pc,
11275
11275
  deleteSelection: Bc,
11276
11276
  enter: zc,
@@ -11310,8 +11310,8 @@ var jf = /* @__PURE__ */ Object.freeze({
11310
11310
  setTextSelection: Df,
11311
11311
  sinkListItem: Af,
11312
11312
  splitBlock: If,
11313
- splitListItem: Rf,
11314
- toggleList: vf,
11313
+ splitListItem: vf,
11314
+ toggleList: Rf,
11315
11315
  toggleMark: Pf,
11316
11316
  toggleNode: Bf,
11317
11317
  toggleWrap: zf,
@@ -11880,7 +11880,7 @@ class sd extends fc {
11880
11880
  }), t = Jn(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
11881
11881
  }
11882
11882
  const n = Qs(t, this.options.autofocus);
11883
- this.view = new va(this.options.element, {
11883
+ this.view = new Ra(this.options.element, {
11884
11884
  ...this.options.editorProps,
11885
11885
  attributes: {
11886
11886
  // add `role="textbox"` to the editor element
@@ -11972,7 +11972,7 @@ class sd extends fc {
11972
11972
  }
11973
11973
  isActive(e, t) {
11974
11974
  const n = typeof e == "string" ? e : null, i = typeof e == "string" ? t : e;
11975
- return Mf(this.state, n, i);
11975
+ return Cf(this.state, n, i);
11976
11976
  }
11977
11977
  /**
11978
11978
  * Get the document as JSON.
@@ -12180,8 +12180,8 @@ class fd {
12180
12180
  return;
12181
12181
  let u = 0, h = 0;
12182
12182
  if (this.dom !== d) {
12183
- const C = this.dom.getBoundingClientRect(), M = d.getBoundingClientRect(), D = (i = e.offsetX) !== null && i !== void 0 ? i : (s = e.nativeEvent) === null || s === void 0 ? void 0 : s.offsetX, E = (o = e.offsetY) !== null && o !== void 0 ? o : (l = e.nativeEvent) === null || l === void 0 ? void 0 : l.offsetY;
12184
- u = M.x - C.x + D, h = M.y - C.y + E;
12183
+ const M = this.dom.getBoundingClientRect(), C = d.getBoundingClientRect(), D = (i = e.offsetX) !== null && i !== void 0 ? i : (s = e.nativeEvent) === null || s === void 0 ? void 0 : s.offsetX, E = (o = e.offsetY) !== null && o !== void 0 ? o : (l = e.nativeEvent) === null || l === void 0 ? void 0 : l.offsetY;
12184
+ u = C.x - M.x + D, h = C.y - M.y + E;
12185
12185
  }
12186
12186
  const p = this.dom.cloneNode(!0);
12187
12187
  (a = e.dataTransfer) === null || a === void 0 || a.setDragImage(p, u, h);
@@ -12302,29 +12302,29 @@ function pd(r) {
12302
12302
  }
12303
12303
  export {
12304
12304
  _ as A,
12305
- _i as B,
12306
- yf as C,
12307
- v as D,
12305
+ Qo as B,
12306
+ _i as C,
12307
+ R as D,
12308
12308
  ne as E,
12309
12309
  b as F,
12310
- pd as G,
12311
- ir as H,
12312
- zt as I,
12313
- bi as J,
12314
- Mf as K,
12315
- ed as L,
12310
+ yf as G,
12311
+ pd as H,
12312
+ ir as I,
12313
+ zt as J,
12314
+ bi as K,
12315
+ Cf as L,
12316
12316
  qt as M,
12317
12317
  qn as N,
12318
- nd as O,
12318
+ ed as O,
12319
12319
  oe as P,
12320
- td as Q,
12321
- ro as R,
12320
+ nd as Q,
12321
+ td as R,
12322
12322
  k as S,
12323
12323
  O as T,
12324
- xf as U,
12325
- dr as V,
12326
- ur as W,
12327
- xe as X,
12324
+ ro as U,
12325
+ xf as V,
12326
+ dr as W,
12327
+ ur as X,
12328
12328
  We as a,
12329
12329
  ee as b,
12330
12330
  dd as c,
@@ -12341,14 +12341,14 @@ export {
12341
12341
  ld as n,
12342
12342
  Wn as o,
12343
12343
  id as p,
12344
- lt as q,
12345
- Ko as r,
12346
- ja as s,
12344
+ xe as q,
12345
+ lt as r,
12346
+ Ko as s,
12347
12347
  ad as t,
12348
- N as u,
12349
- w as v,
12348
+ ja as u,
12349
+ N as v,
12350
12350
  cd as w,
12351
- x,
12352
- hr as y,
12353
- Qo as z
12351
+ w as x,
12352
+ x as y,
12353
+ hr as z
12354
12354
  };