@templatical/editor 0.13.0 → 0.15.0

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 (178) hide show
  1. package/dist/{AiChatSidebar-B0-U5-sb.js → AiChatSidebar-BIKvYREk.js} +57 -56
  2. package/dist/{AiFeatureMenu-DxDwLS8B.js → AiFeatureMenu-QbD82crt.js} +23 -23
  3. package/dist/{BlockIssueBadge-C-EPqWsh.js → BlockIssueBadge-B3xVgMTh.js} +11 -11
  4. package/dist/CloudEditor-DptuSf7A.js +1234 -0
  5. package/dist/{CollaboratorBar-DgwjisX2.js → CollaboratorBar-DrA_K69w.js} +20 -20
  6. package/dist/{CommentsSidebar-CpRLN40c.js → CommentsSidebar-D_tSGvTX.js} +158 -157
  7. package/dist/CountdownBlock-apiYUhkQ.js +92 -0
  8. package/dist/CountdownToolbar-CS0axcjz.js +210 -0
  9. package/dist/{DesignReferenceSidebar-BgPDbOsl.js → DesignReferenceSidebar-DWYK9nTk.js} +58 -57
  10. package/dist/{IssuesPanel-I0z6k6-H.js → IssuesPanel-CR1MPaDE.js} +40 -40
  11. package/dist/{LoadingTrack-C7mGWPHS.js → LoadingTrack-DsecR8Rw.js} +1 -1
  12. package/dist/MergeTagSuggestion-CH2SUxBo.js +1327 -0
  13. package/dist/ModuleBrowserModal-D45rBj5C.js +202 -0
  14. package/dist/{ModulePreviewCanvas-Dni9kK4j.js → ModulePreviewCanvas-BiQ6B2-l.js} +29 -29
  15. package/dist/{NumberWithSuffix-D3fdj0iO.js → NumberWithSuffix-CrA6quxx.js} +143 -142
  16. package/dist/ParagraphEditor-1NaUJpZO.js +721 -0
  17. package/dist/{RichTextEditorContent-Q5altsx1.js → RichTextEditorContent-BqLHIZY7.js} +45 -44
  18. package/dist/{SaveModuleDialog-C38VqN2T.js → SaveModuleDialog-B0sPOTgO.js} +38 -37
  19. package/dist/{SnapshotHistory-ByloTpwh.js → SnapshotHistory-DslVzmSb.js} +34 -33
  20. package/dist/{TemplateScoringPanel-CUxiPtEf.js → TemplateScoringPanel-CZ62rGHz.js} +83 -82
  21. package/dist/{TestEmailModal-BvZBMBad.js → TestEmailModal-DWGniJVu.js} +22 -21
  22. package/dist/TitleEditor-D4t_gZZJ.js +193 -0
  23. package/dist/{TplModal-BYb-X5Bj.js → TplModal-Br2VG6cn.js} +14 -13
  24. package/dist/{blockTypeIcons-CyAom3iI.js → blockTypeIcons-CXhCS5WV.js} +5 -5
  25. package/dist/bundle-stats.json +8 -8
  26. package/dist/cdn/chunks/{AiFeatureMenu-BSoy-SoF.js → AiFeatureMenu-3Slo_LGA.js} +8 -8
  27. package/dist/cdn/chunks/{AiFeatureMenu-BSoy-SoF.js.map → AiFeatureMenu-3Slo_LGA.js.map} +1 -1
  28. package/dist/cdn/chunks/{BlockIssueBadge-BQDUuJxy.js → BlockIssueBadge-BxwEiiF3.js} +5 -5
  29. package/dist/cdn/chunks/{BlockIssueBadge-BQDUuJxy.js.map → BlockIssueBadge-BxwEiiF3.js.map} +1 -1
  30. package/dist/cdn/chunks/{CloudEditor-BZuzsQOZ.js → CloudEditor-DFIFWD9G.js} +163 -161
  31. package/dist/cdn/chunks/CloudEditor-DFIFWD9G.js.map +1 -0
  32. package/dist/cdn/chunks/{CollaboratorBar-DUpSrtDr.js → CollaboratorBar-Cu3vuN66.js} +4 -4
  33. package/dist/cdn/chunks/{CollaboratorBar-DUpSrtDr.js.map → CollaboratorBar-Cu3vuN66.js.map} +1 -1
  34. package/dist/cdn/chunks/{CountdownBlock-DChGTAsH.js → CountdownBlock-BEVAJQtQ.js} +3 -3
  35. package/dist/cdn/chunks/{CountdownBlock-DChGTAsH.js.map → CountdownBlock-BEVAJQtQ.js.map} +1 -1
  36. package/dist/cdn/chunks/{CountdownToolbar-C6gX2SJr.js → CountdownToolbar-CI2sQZv5.js} +4 -4
  37. package/dist/cdn/chunks/{CountdownToolbar-C6gX2SJr.js.map → CountdownToolbar-CI2sQZv5.js.map} +1 -1
  38. package/dist/cdn/chunks/{IssuesPanel-Bo1uhdSe.js → IssuesPanel-BdeDoTcn.js} +11 -11
  39. package/dist/cdn/chunks/{IssuesPanel-Bo1uhdSe.js.map → IssuesPanel-BdeDoTcn.js.map} +1 -1
  40. package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js +213 -0
  41. package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js.map +1 -0
  42. package/dist/cdn/chunks/{ModuleBrowserModal-a-tZRCcD.js → ModuleBrowserModal-Dz-I5zfj.js} +11 -8
  43. package/dist/cdn/chunks/{ModuleBrowserModal-a-tZRCcD.js.map → ModuleBrowserModal-Dz-I5zfj.js.map} +1 -1
  44. package/dist/cdn/chunks/{ModulePreviewCanvas-Bm6k0Op0.js → ModulePreviewCanvas-BfinyuAN.js} +21 -21
  45. package/dist/cdn/chunks/{ModulePreviewCanvas-Bm6k0Op0.js.map → ModulePreviewCanvas-BfinyuAN.js.map} +1 -1
  46. package/dist/cdn/chunks/{NumberWithSuffix-HTbuD3VJ.js → NumberWithSuffix-CDjEa08X.js} +4 -4
  47. package/dist/cdn/chunks/{NumberWithSuffix-HTbuD3VJ.js.map → NumberWithSuffix-CDjEa08X.js.map} +1 -1
  48. package/dist/cdn/chunks/{ParagraphEditor-pGrfSccu.js → ParagraphEditor-B3fG0vge.js} +130 -110
  49. package/dist/cdn/chunks/ParagraphEditor-B3fG0vge.js.map +1 -0
  50. package/dist/cdn/chunks/{RichTextEditorContent-D7XZix_1.js → RichTextEditorContent-C6YPCp9j.js} +4 -4
  51. package/dist/cdn/chunks/{RichTextEditorContent-D7XZix_1.js.map → RichTextEditorContent-C6YPCp9j.js.map} +1 -1
  52. package/dist/cdn/chunks/{SaveModuleDialog-C9PQ9x6j.js → SaveModuleDialog-C6UIIVAM.js} +6 -6
  53. package/dist/cdn/chunks/{SaveModuleDialog-C9PQ9x6j.js.map → SaveModuleDialog-C6UIIVAM.js.map} +1 -1
  54. package/dist/cdn/chunks/{TitleEditor-BvFbL16O.js → TitleEditor-BiZbLYF1.js} +62 -46
  55. package/dist/cdn/chunks/TitleEditor-BiZbLYF1.js.map +1 -0
  56. package/dist/cdn/chunks/blockTypeIcons-BernVG06.js +22 -0
  57. package/dist/cdn/chunks/{blockTypeIcons-Kd1MT0u8.js.map → blockTypeIcons-BernVG06.js.map} +1 -1
  58. package/dist/{de-C2wOXoxs.js → cdn/chunks/de-LsV0u1tP.js} +19 -1
  59. package/dist/cdn/chunks/de-LsV0u1tP.js.map +1 -0
  60. package/dist/cdn/chunks/{draggable-Bci-fq8y.js → draggable-kG-D5Xsm.js} +19 -10
  61. package/dist/cdn/chunks/draggable-kG-D5Xsm.js.map +1 -0
  62. package/dist/cdn/chunks/{en-dR7zfNC3.js → en-Bb8X1bOs.js} +18 -2
  63. package/dist/cdn/chunks/en-Bb8X1bOs.js.map +1 -0
  64. package/dist/cdn/chunks/extensions-Drp8UDc6.js +421 -0
  65. package/dist/cdn/chunks/extensions-Drp8UDc6.js.map +1 -0
  66. package/dist/cdn/chunks/{features-DU6lA8l1.js → features-Dpczf9Su.js} +1171 -994
  67. package/dist/cdn/chunks/features-Dpczf9Su.js.map +1 -0
  68. package/dist/cdn/chunks/{icons-BjHUZZyJ.js → icons-CuxnJiGQ.js} +170 -164
  69. package/dist/cdn/chunks/icons-CuxnJiGQ.js.map +1 -0
  70. package/dist/cdn/chunks/{liquid.browser-DKKBzRQu.js → liquid.browser-BJOEu6Cg.js} +693 -678
  71. package/dist/cdn/chunks/liquid.browser-BJOEu6Cg.js.map +1 -0
  72. package/dist/cdn/chunks/{media-library-Byelliig.js → media-library-CiYl_BO7.js} +556 -554
  73. package/dist/cdn/chunks/{media-library-Byelliig.js.map → media-library-CiYl_BO7.js.map} +1 -1
  74. package/dist/cdn/chunks/{pt-BR-BZ86xqK6.js → pt-BR-BwJY_cvb.js} +18 -2
  75. package/dist/cdn/chunks/pt-BR-BwJY_cvb.js.map +1 -0
  76. package/dist/cdn/chunks/{pusher-BICWUP2j.js → pusher-CIwiKF8H.js} +9 -6
  77. package/dist/cdn/chunks/{pusher-BICWUP2j.js.map → pusher-CIwiKF8H.js.map} +1 -1
  78. package/dist/cdn/chunks/quality-CNjGxBG0.js +2176 -0
  79. package/dist/cdn/chunks/{quality-DNnYAntR.js.map → quality-CNjGxBG0.js.map} +1 -1
  80. package/dist/cdn/chunks/{renderer-CZKO-Tav.js → renderer-CFkg8h-K.js} +40 -31
  81. package/dist/cdn/chunks/renderer-CFkg8h-K.js.map +1 -0
  82. package/dist/cdn/chunks/{src-DsqSXXjk.js → src-DRpKu4Dy.js} +11 -11
  83. package/dist/cdn/chunks/{src-DsqSXXjk.js.map → src-DRpKu4Dy.js.map} +1 -1
  84. package/dist/cdn/chunks/styles-B7wryV0l.js +3943 -0
  85. package/dist/cdn/chunks/styles-B7wryV0l.js.map +1 -0
  86. package/dist/cdn/chunks/{tiptap-CwScfbsM.js → tiptap-DF9PEiqH.js} +5429 -5373
  87. package/dist/cdn/chunks/tiptap-DF9PEiqH.js.map +1 -0
  88. package/dist/cdn/editor.css +1 -1
  89. package/dist/cdn/editor.js +117 -115
  90. package/dist/cdn/editor.js.map +1 -1
  91. package/dist/{check-BRzXxFHr.js → check-rl7ok6uJ.js} +1 -1
  92. package/dist/{chevron-down-DmEgzmYT.js → chevron-down-BKe__NOD.js} +1 -1
  93. package/dist/{circle-alert-BStvZr3O.js → circle-alert-C8xmpMsK.js} +1 -1
  94. package/dist/{clock-Blwp_1R6.js → clock-BW4JuDCN.js} +1 -1
  95. package/dist/{cloud-_olro76D.js → cloud-BQusL53H.js} +208 -208
  96. package/dist/createLucideIcon-Dx-EjR9r.js +43 -0
  97. package/dist/{cdn/chunks/de-C2wOXoxs.js → de-LsV0u1tP.js} +17 -3
  98. package/dist/{dist-BlG7k25W.js → dist-B5Sov3sS.js} +7 -7
  99. package/dist/dist-BEWiuOMi.js +251 -0
  100. package/dist/{dist-b7Ak-CuM.js → dist-BFmE-7hB.js} +2 -2
  101. package/dist/{dist-o73iaGqy.js → dist-BMoa33wT.js} +2 -2
  102. package/dist/{dist-BctFrpeA.js → dist-BibU4HNl.js} +74 -65
  103. package/dist/{dist-D6x1cQeh.js → dist-BsCGIDSt.js} +103 -102
  104. package/dist/dist-CNLKj9wa.js +5 -0
  105. package/dist/{dist-DULfKmTh.js → dist-CNXDNYQn.js} +729 -695
  106. package/dist/{dist-412xXefB.js → dist-COG3IdPK.js} +3 -3
  107. package/dist/{dist-Cz79qrLL.js → dist-CQZxDvFw.js} +3 -3
  108. package/dist/{dist-BwgjpLfr.js → dist-CRsjOQM-.js} +2 -2
  109. package/dist/dist-CTT6WYJ6.js +134 -0
  110. package/dist/dist-Cqa6aeAJ.js +5 -0
  111. package/dist/{dist-BCQZZUE9.js → dist-SXJJ2v41.js} +2 -2
  112. package/dist/{dist-DhKTdU52.js → dist-itdjZraK.js} +1445 -1420
  113. package/dist/{en-dR7zfNC3.js → en-Bb8X1bOs.js} +17 -1
  114. package/dist/extensions-DwaZAqm6.js +423 -0
  115. package/dist/{image-up-BFPbw_Zq.js → image-up-BwBCmQ4P.js} +1 -1
  116. package/dist/index.d.ts +17 -0
  117. package/dist/{info-B_qLEBN2.js → info-TCn7uWR5.js} +1 -1
  118. package/dist/keys-Cv8-8GsD.js +10 -0
  119. package/dist/{liquid.browser-CVjP5Mex.js → liquid.browser-DZLtv26k.js} +692 -677
  120. package/dist/{list-checks-CGg7JxPm.js → list-checks-CSrOWNgq.js} +1 -1
  121. package/dist/{loader-circle-CDF8eR_Q.js → loader-circle-BLmicnPG.js} +1 -1
  122. package/dist/{message-circle-C3cHsCJl.js → message-circle-C9hHMQCI.js} +1 -1
  123. package/dist/{pt-BR-BZ86xqK6.js → pt-BR-BwJY_cvb.js} +17 -1
  124. package/dist/{refresh-cw-Butml7Q4.js → refresh-cw-D1JQ1LNa.js} +1 -1
  125. package/dist/runtime-dom.esm-bundler-BzuoCyNp.js +523 -0
  126. package/dist/scan-line-DgijVq9y.js +31 -0
  127. package/dist/{send-k7npFJNO.js → send-DjPdq69F.js} +1 -1
  128. package/dist/{shield-check-CV6GbmCu.js → shield-check-Bqluu8FS.js} +1 -1
  129. package/dist/{sparkles-C965Xop4.js → sparkles-M4azPVSP.js} +1 -1
  130. package/dist/style.css +1 -1
  131. package/dist/styles-D7fQ7f_1.js +4164 -0
  132. package/dist/templatical-editor.js +155 -152
  133. package/dist/{text-align-start-Bxnps8fH.js → text-align-start-CMya5pCQ.js} +11 -11
  134. package/dist/{trash-2-DpGb7fIt.js → trash-2-C-81rkLS.js} +1 -1
  135. package/dist/{triangle-alert-BKYElAwz.js → triangle-alert-BuRWnynk.js} +1 -1
  136. package/dist/{upload-BF7sxd1_.js → upload-CWBIoLd4.js} +1 -1
  137. package/dist/{useAliveFlag-BinvbqQR.js → useAliveFlag-CECL_OUb.js} +1 -1
  138. package/dist/{useCloudI18n-L3H2XvdW.js → useCloudI18n-AKCy98qD.js} +2 -2
  139. package/dist/{useEditorCore-DKYZ7aKk.js → useEditorCore-vcWLdnjN.js} +1480 -1310
  140. package/dist/{useI18n-CTs_bP9d.js → useI18n-C-TDeJBt.js} +2 -2
  141. package/dist/{useMergeTag-e3RSY-s3.js → useMergeTag-DSrBY0-2.js} +6 -6
  142. package/dist/usePopoverRoot-DKUDnr55.js +8 -0
  143. package/dist/{vue.runtime.esm-bundler-B2k01iQh.js → vue.runtime.esm-bundler-l0XAqiyv.js} +639 -1151
  144. package/dist/{x-CGjkjdKK.js → x-CQSvXnGR.js} +1 -1
  145. package/package.json +27 -27
  146. package/dist/CloudEditor-DaEfipBn.js +0 -1230
  147. package/dist/CountdownBlock-DO9fziwf.js +0 -92
  148. package/dist/CountdownToolbar-BeII06yJ.js +0 -210
  149. package/dist/ModuleBrowserModal-DsZRr87F.js +0 -198
  150. package/dist/ParagraphEditor-CZ-cmhX3.js +0 -700
  151. package/dist/TitleEditor-DbNOcvhR.js +0 -177
  152. package/dist/cdn/chunks/CloudEditor-BZuzsQOZ.js.map +0 -1
  153. package/dist/cdn/chunks/ParagraphEditor-pGrfSccu.js.map +0 -1
  154. package/dist/cdn/chunks/TitleEditor-BvFbL16O.js.map +0 -1
  155. package/dist/cdn/chunks/blockTypeIcons-Kd1MT0u8.js +0 -22
  156. package/dist/cdn/chunks/de-C2wOXoxs.js.map +0 -1
  157. package/dist/cdn/chunks/draggable-Bci-fq8y.js.map +0 -1
  158. package/dist/cdn/chunks/en-dR7zfNC3.js.map +0 -1
  159. package/dist/cdn/chunks/extensions-CuUjSmuA.js +0 -605
  160. package/dist/cdn/chunks/extensions-CuUjSmuA.js.map +0 -1
  161. package/dist/cdn/chunks/features-DU6lA8l1.js.map +0 -1
  162. package/dist/cdn/chunks/icons-BjHUZZyJ.js.map +0 -1
  163. package/dist/cdn/chunks/liquid.browser-DKKBzRQu.js.map +0 -1
  164. package/dist/cdn/chunks/pt-BR-BZ86xqK6.js.map +0 -1
  165. package/dist/cdn/chunks/quality-DNnYAntR.js +0 -2176
  166. package/dist/cdn/chunks/renderer-CZKO-Tav.js.map +0 -1
  167. package/dist/cdn/chunks/styles-DiAdtiz9.js +0 -3428
  168. package/dist/cdn/chunks/styles-DiAdtiz9.js.map +0 -1
  169. package/dist/cdn/chunks/tiptap-CwScfbsM.js.map +0 -1
  170. package/dist/createLucideIcon-CmPAC-gt.js +0 -43
  171. package/dist/dist-BNEdeWub.js +0 -5
  172. package/dist/dist-Cgry6fNv.js +0 -382
  173. package/dist/dist-u0iIJH3V.js +0 -5
  174. package/dist/extensions-XPlNAKIL.js +0 -1720
  175. package/dist/keys-mFiJ5N0_.js +0 -10
  176. package/dist/scan-line-XYEqim_E.js +0 -25
  177. package/dist/styles-D0RCAWhB.js +0 -3647
  178. package/dist/usePopoverRoot-DVh7NY1q.js +0 -8
@@ -1,8 +1,8 @@
1
- import { Cn as e, Ct as t, Dn as n, En as r, Mt as i, Nt as a, On as o, Pt as s, Sn as c, Tn as l, Ut as u, Wt as d, Xt as f, Z as p, _n as m, at as h, bn as g, c as _, en as ee, gn as v, i as y, in as te, k as ne, mn as re, ot as ie, qt as b, rt as ae, u as x, v as oe, vn as S, wn as C, wt as se, xn as w, y as ce, yn as T } from "./dist-DhKTdU52.js";
2
- import { Link as le } from "./dist-BlG7k25W.js";
3
- import { Underline as ue } from "./dist-o73iaGqy.js";
4
- //#region ../../node_modules/.pnpm/@tiptap+core@3.27.1_@tiptap+pm@3.27.1/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
5
- var de = (e, t) => {
1
+ import { Cn as e, Ct as t, Dn as n, En as r, Mt as i, Nt as a, On as o, Pt as s, Sn as c, Tn as l, Ut as u, Wt as d, Xt as f, Y as p, Z as m, _n as h, at as g, bn as _, c as ee, en as te, gn as v, i as y, in as ne, k as re, mn as ie, ot as ae, qt as b, rt as oe, u as x, v as se, vn as S, wn as C, wt as ce, xn as w, y as le, yn as T } from "./dist-itdjZraK.js";
2
+ import { Link as ue } from "./dist-B5Sov3sS.js";
3
+ import { Underline as de } from "./dist-BMoa33wT.js";
4
+ //#region ../../node_modules/.pnpm/@tiptap+core@3.27.3_@tiptap+pm@3.27.3/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
5
+ var fe = (e, t) => {
6
6
  if (e === "slot") return 0;
7
7
  if (e instanceof Function) return e(t);
8
8
  let { children: n, ...r } = t ?? {};
@@ -14,8 +14,8 @@ var de = (e, t) => {
14
14
  ];
15
15
  };
16
16
  //#endregion
17
- //#region ../../node_modules/.pnpm/@tiptap+extension-blockquote@3.27.1_@tiptap+core@3.27.1_@tiptap+pm@3.27.1_/node_modules/@tiptap/extension-blockquote/dist/index.js
18
- function fe(e, t, n) {
17
+ //#region ../../node_modules/.pnpm/@tiptap+extension-blockquote@3.27.3_@tiptap+core@3.27.3_@tiptap+pm@3.27.3_/node_modules/@tiptap/extension-blockquote/dist/index.js
18
+ function pe(e, t, n) {
19
19
  for (let r = 0;; r++) {
20
20
  if (r == e.childCount || r == t.childCount) return e.childCount == t.childCount ? null : n;
21
21
  let i = e.child(r), a = t.child(r);
@@ -25,17 +25,18 @@ function fe(e, t, n) {
25
25
  }
26
26
  if (!i.sameMarkup(a)) return n;
27
27
  if (i.isText && i.text != a.text) {
28
- for (let e = 0; i.text[e] == a.text[e]; e++) n++;
29
- return n;
28
+ let e = i.text, t = a.text, r = 0;
29
+ for (; e[r] == t[r]; r++) n++;
30
+ return r && r < e.length && r < t.length && ge(e.charCodeAt(r - 1)) && he(e.charCodeAt(r)) && n--, n;
30
31
  }
31
32
  if (i.content.size || a.content.size) {
32
- let e = fe(i.content, a.content, n + 1);
33
+ let e = pe(i.content, a.content, n + 1);
33
34
  if (e != null) return e;
34
35
  }
35
36
  n += i.nodeSize;
36
37
  }
37
38
  }
38
- function pe(e, t, n, r) {
39
+ function me(e, t, n, r) {
39
40
  for (let i = e.childCount, a = t.childCount;;) {
40
41
  if (i == 0 || a == 0) return i == a ? null : {
41
42
  a: n,
@@ -51,20 +52,26 @@ function pe(e, t, n, r) {
51
52
  b: r
52
53
  };
53
54
  if (o.isText && o.text != s.text) {
54
- let e = 0, t = Math.min(o.text.length, s.text.length);
55
- for (; e < t && o.text[o.text.length - e - 1] == s.text[s.text.length - e - 1];) e++, n--, r--;
56
- return {
55
+ let e = o.text, t = s.text, i = e.length, a = t.length;
56
+ for (; i > 0 && a > 0 && e[i - 1] == t[a - 1];) i--, a--, n--, r--;
57
+ return i && a && i < e.length && ge(e.charCodeAt(i - 1)) && he(e.charCodeAt(i)) && (n++, r++), {
57
58
  a: n,
58
59
  b: r
59
60
  };
60
61
  }
61
62
  if (o.content.size || s.content.size) {
62
- let e = pe(o.content, s.content, n - 1, r - 1);
63
+ let e = me(o.content, s.content, n - 1, r - 1);
63
64
  if (e) return e;
64
65
  }
65
66
  n -= c, r -= c;
66
67
  }
67
68
  }
69
+ function he(e) {
70
+ return e >= 56320 && e < 57344;
71
+ }
72
+ function ge(e) {
73
+ return e >= 55296 && e < 56320;
74
+ }
68
75
  var E = class e {
69
76
  constructor(e, t) {
70
77
  if (this.content = e, this.size = t || 0, t == null) for (let t = 0; t < e.length; t++) this.size += e[t].nodeSize;
@@ -149,18 +156,18 @@ var E = class e {
149
156
  }
150
157
  }
151
158
  findDiffStart(e, t = 0) {
152
- return fe(this, e, t);
159
+ return pe(this, e, t);
153
160
  }
154
161
  findDiffEnd(e, t = this.size, n = e.size) {
155
- return pe(this, e, t, n);
162
+ return me(this, e, t, n);
156
163
  }
157
164
  findIndex(e) {
158
- if (e == 0) return D(0, e);
159
- if (e == this.size) return D(this.content.length, e);
165
+ if (e == 0) return ve(0, e);
166
+ if (e == this.size) return ve(this.content.length, e);
160
167
  if (e > this.size || e < 0) throw RangeError(`Position ${e} outside of fragment (${this})`);
161
168
  for (let t = 0, n = 0;; t++) {
162
169
  let r = this.child(t), i = n + r.nodeSize;
163
- if (i >= e) return i == e ? D(t + 1, i) : D(t, n);
170
+ if (i >= e) return i == e ? ve(t + 1, i) : ve(t, n);
164
171
  n = i;
165
172
  }
166
173
  }
@@ -196,28 +203,28 @@ var E = class e {
196
203
  }
197
204
  };
198
205
  E.empty = new E([], 0);
199
- var me = {
206
+ var _e = {
200
207
  index: 0,
201
208
  offset: 0
202
209
  };
203
- function D(e, t) {
204
- return me.index = e, me.offset = t, me;
210
+ function ve(e, t) {
211
+ return _e.index = e, _e.offset = t, _e;
205
212
  }
206
- function he(e, t) {
213
+ function ye(e, t) {
207
214
  if (e === t) return !0;
208
215
  if (!(e && typeof e == "object") || !(t && typeof t == "object")) return !1;
209
216
  let n = Array.isArray(e);
210
217
  if (Array.isArray(t) != n) return !1;
211
218
  if (n) {
212
219
  if (e.length != t.length) return !1;
213
- for (let n = 0; n < e.length; n++) if (!he(e[n], t[n])) return !1;
220
+ for (let n = 0; n < e.length; n++) if (!ye(e[n], t[n])) return !1;
214
221
  } else {
215
- for (let n in e) if (!(n in t) || !he(e[n], t[n])) return !1;
222
+ for (let n in e) if (!(n in t) || !ye(e[n], t[n])) return !1;
216
223
  for (let n in t) if (!(n in e)) return !1;
217
224
  }
218
225
  return !0;
219
226
  }
220
- var O = class e {
227
+ var D = class e {
221
228
  constructor(e, t) {
222
229
  this.type = e, this.attrs = t;
223
230
  }
@@ -241,7 +248,7 @@ var O = class e {
241
248
  return !1;
242
249
  }
243
250
  eq(e) {
244
- return this == e || this.type == e.type && he(this.attrs, e.attrs);
251
+ return this == e || this.type == e.type && ye(this.attrs, e.attrs);
245
252
  }
246
253
  toJSON() {
247
254
  let e = { type: this.type.name };
@@ -271,8 +278,8 @@ var O = class e {
271
278
  return n.sort((e, t) => e.type.rank - t.type.rank), n;
272
279
  }
273
280
  };
274
- O.none = [];
275
- var k = class extends Error {}, A = class e {
281
+ D.none = [];
282
+ var O = class extends Error {}, k = class e {
276
283
  constructor(e, t, n) {
277
284
  this.content = e, this.openStart = t, this.openEnd = n;
278
285
  }
@@ -280,11 +287,11 @@ var k = class extends Error {}, A = class e {
280
287
  return this.content.size - this.openStart - this.openEnd;
281
288
  }
282
289
  insertAt(t, n) {
283
- let r = _e(this.content, t + this.openStart, n, this.openStart + 1, this.openEnd + 1);
290
+ let r = xe(this.content, t + this.openStart, n, this.openStart + 1, this.openEnd + 1);
284
291
  return r && new e(r, this.openStart, this.openEnd);
285
292
  }
286
293
  removeBetween(t, n) {
287
- return new e(ge(this.content, t + this.openStart, n + this.openStart), this.openStart, this.openEnd);
294
+ return new e(be(this.content, t + this.openStart, n + this.openStart), this.openStart, this.openEnd);
288
295
  }
289
296
  eq(e) {
290
297
  return this.content.eq(e.content) && this.openStart == e.openStart && this.openEnd == e.openEnd;
@@ -310,70 +317,71 @@ var k = class extends Error {}, A = class e {
310
317
  return new e(t, r, i);
311
318
  }
312
319
  };
313
- A.empty = new A(E.empty, 0, 0);
314
- function ge(e, t, n) {
320
+ k.empty = new k(E.empty, 0, 0);
321
+ function be(e, t, n) {
315
322
  let { index: r, offset: i } = e.findIndex(t), a = e.maybeChild(r), { index: o, offset: s } = e.findIndex(n);
316
323
  if (i == t || a.isText) {
317
324
  if (s != n && !e.child(o).isText) throw RangeError("Removing non-flat range");
318
325
  return e.cut(0, t).append(e.cut(n));
319
326
  }
320
327
  if (r != o) throw RangeError("Removing non-flat range");
321
- return e.replaceChild(r, a.copy(ge(a.content, t - i - 1, n - i - 1)));
328
+ return e.replaceChild(r, a.copy(be(a.content, t - i - 1, n - i - 1)));
322
329
  }
323
- function _e(e, t, n, r, i, a) {
330
+ function xe(e, t, n, r, i, a) {
324
331
  let { index: o, offset: s } = e.findIndex(t), c = e.maybeChild(o);
325
332
  if (s == t || c.isText) return a && r <= 0 && i <= 0 && !a.canReplace(o, o, n) ? null : e.cut(0, t).append(n).append(e.cut(t));
326
- let l = _e(c.content, t - s - 1, n, o == 0 ? r - 1 : 0, o == e.childCount - 1 ? i - 1 : 0, c);
333
+ let l = xe(c.content, t - s - 1, n, o == 0 ? r - 1 : 0, o == e.childCount - 1 ? i - 1 : 0, c);
327
334
  return l && e.replaceChild(o, c.copy(l));
328
335
  }
329
- function ve(e, t, n) {
330
- if (n.openStart > e.depth) throw new k("Inserted content deeper than insertion position");
331
- if (e.depth - n.openStart != t.depth - n.openEnd) throw new k("Inconsistent open depths");
332
- return ye(e, t, n, 0);
336
+ function Se(e, t, n) {
337
+ if (n.openStart > e.depth) throw new O("Inserted content deeper than insertion position");
338
+ if (e.depth - n.openStart != t.depth - n.openEnd) throw new O("Inconsistent open depths");
339
+ return Ce(e, t, n, 0);
333
340
  }
334
- function ye(e, t, n, r) {
341
+ function Ce(e, t, n, r) {
335
342
  let i = e.index(r), a = e.node(r);
336
343
  if (i == t.index(r) && r < e.depth - n.openStart) {
337
- let o = ye(e, t, n, r + 1);
344
+ let o = Ce(e, t, n, r + 1);
338
345
  return a.copy(a.content.replaceChild(i, o));
339
- } else if (!n.content.size) return N(a, P(e, t, r));
346
+ } else if (!n.content.size) return M(a, N(e, t, r));
340
347
  else if (!n.openStart && !n.openEnd && e.depth == r && t.depth == r) {
341
348
  let r = e.parent, i = r.content;
342
- return N(r, i.cut(0, e.parentOffset).append(n.content).append(i.cut(t.parentOffset)));
349
+ return M(r, i.cut(0, e.parentOffset).append(n.content).append(i.cut(t.parentOffset)));
343
350
  } else {
344
- let { start: i, end: o } = Ce(n, e);
345
- return N(a, Se(e, i, o, t, r));
351
+ let { start: i, end: o } = De(n, e);
352
+ return M(a, Ee(e, i, o, t, r));
346
353
  }
347
354
  }
348
- function be(e, t) {
349
- if (!t.type.compatibleContent(e.type)) throw new k("Cannot join " + t.type.name + " onto " + e.type.name);
355
+ function we(e, t) {
356
+ if (!t.type.compatibleContent(e.type)) throw new O("Cannot join " + t.type.name + " onto " + e.type.name);
350
357
  }
351
- function xe(e, t, n) {
358
+ function Te(e, t, n) {
352
359
  let r = e.node(n);
353
- return be(r, t.node(n)), r;
360
+ return we(r, t.node(n)), r;
354
361
  }
355
- function j(e, t) {
362
+ function A(e, t) {
356
363
  let n = t.length - 1;
357
364
  n >= 0 && e.isText && e.sameMarkup(t[n]) ? t[n] = e.withText(t[n].text + e.text) : t.push(e);
358
365
  }
359
- function M(e, t, n, r) {
366
+ function j(e, t, n, r) {
360
367
  let i = (t || e).node(n), a = 0, o = t ? t.index(n) : i.childCount;
361
- e && (a = e.index(n), e.depth > n ? a++ : e.textOffset && (j(e.nodeAfter, r), a++));
362
- for (let e = a; e < o; e++) j(i.child(e), r);
363
- t && t.depth == n && t.textOffset && j(t.nodeBefore, r);
368
+ e && (a = e.index(n), e.depth > n ? a++ : e.textOffset && (A(e.nodeAfter, r), a++));
369
+ for (let e = a; e < o; e++) A(i.child(e), r);
370
+ t && t.depth == n && t.textOffset && A(t.nodeBefore, r);
364
371
  }
365
- function N(e, t) {
366
- return e.type.checkContent(t), e.copy(t);
372
+ function M(e, t) {
373
+ if (!e.type.validContent(t)) throw new O("Invalid content for node " + e.type.name);
374
+ return e.copy(t);
367
375
  }
368
- function Se(e, t, n, r, i) {
369
- let a = e.depth > i && xe(e, t, i + 1), o = r.depth > i && xe(n, r, i + 1), s = [];
370
- return M(null, e, i, s), a && o && t.index(i) == n.index(i) ? (be(a, o), j(N(a, Se(e, t, n, r, i + 1)), s)) : (a && j(N(a, P(e, t, i + 1)), s), M(t, n, i, s), o && j(N(o, P(n, r, i + 1)), s)), M(r, null, i, s), new E(s);
376
+ function Ee(e, t, n, r, i) {
377
+ let a = e.depth > i && Te(e, t, i + 1), o = r.depth > i && Te(n, r, i + 1), s = [];
378
+ return j(null, e, i, s), a && o && t.index(i) == n.index(i) ? (we(a, o), A(M(a, Ee(e, t, n, r, i + 1)), s)) : (a && A(M(a, N(e, t, i + 1)), s), j(t, n, i, s), o && A(M(o, N(n, r, i + 1)), s)), j(r, null, i, s), new E(s);
371
379
  }
372
- function P(e, t, n) {
380
+ function N(e, t, n) {
373
381
  let r = [];
374
- return M(null, e, n, r), e.depth > n && j(N(xe(e, t, n + 1), P(e, t, n + 1)), r), M(t, null, n, r), new E(r);
382
+ return j(null, e, n, r), e.depth > n && A(M(Te(e, t, n + 1), N(e, t, n + 1)), r), j(t, null, n, r), new E(r);
375
383
  }
376
- function Ce(e, t) {
384
+ function De(e, t) {
377
385
  let n = t.depth - e.openStart, r = t.node(n).copy(e.content);
378
386
  for (let e = n - 1; e >= 0; e--) r = t.node(e).copy(E.from(r));
379
387
  return {
@@ -381,7 +389,7 @@ function Ce(e, t) {
381
389
  end: r.resolveNoCache(r.content.size - e.openEnd - n)
382
390
  };
383
391
  }
384
- var we = class e {
392
+ var Oe = class e {
385
393
  constructor(e, t, n) {
386
394
  this.pos = e, this.path = t, this.parentOffset = n, this.depth = t.length / 3 - 1;
387
395
  }
@@ -438,7 +446,7 @@ var we = class e {
438
446
  }
439
447
  marks() {
440
448
  let e = this.parent, t = this.index();
441
- if (e.content.size == 0) return O.none;
449
+ if (e.content.size == 0) return D.none;
442
450
  if (this.textOffset) return e.child(t).marks;
443
451
  let n = e.maybeChild(t - 1), r = e.maybeChild(t);
444
452
  if (!n) {
@@ -462,7 +470,7 @@ var we = class e {
462
470
  }
463
471
  blockRange(e = this, t) {
464
472
  if (e.pos < this.pos) return e.blockRange(this);
465
- for (let n = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); n >= 0; n--) if (e.pos <= this.end(n) && (!t || t(this.node(n)))) return new Oe(this, e, n);
473
+ for (let n = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); n >= 0; n--) if (e.pos <= this.end(n) && (!t || t(this.node(n)))) return new Me(this, e, n);
466
474
  return null;
467
475
  }
468
476
  sameParent(e) {
@@ -490,20 +498,20 @@ var we = class e {
490
498
  return new e(n, r, a);
491
499
  }
492
500
  static resolveCached(t, n) {
493
- let r = De.get(t);
501
+ let r = je.get(t);
494
502
  if (r) for (let e = 0; e < r.elts.length; e++) {
495
503
  let t = r.elts[e];
496
504
  if (t.pos == n) return t;
497
505
  }
498
- else De.set(t, r = new Te());
506
+ else je.set(t, r = new ke());
499
507
  let i = r.elts[r.i] = e.resolve(t, n);
500
- return r.i = (r.i + 1) % Ee, i;
508
+ return r.i = (r.i + 1) % Ae, i;
501
509
  }
502
- }, Te = class {
510
+ }, ke = class {
503
511
  constructor() {
504
512
  this.elts = [], this.i = 0;
505
513
  }
506
- }, Ee = 12, De = /* @__PURE__ */ new WeakMap(), Oe = class {
514
+ }, Ae = 12, je = /* @__PURE__ */ new WeakMap(), Me = class {
507
515
  constructor(e, t, n) {
508
516
  this.$from = e, this.$to = t, this.depth = n;
509
517
  }
@@ -522,8 +530,8 @@ var we = class e {
522
530
  get endIndex() {
523
531
  return this.$to.indexAfter(this.depth);
524
532
  }
525
- }, ke = /* @__PURE__ */ Object.create(null), Ae = class e {
526
- constructor(e, t, n, r = O.none) {
533
+ }, Ne = /* @__PURE__ */ Object.create(null), Pe = class e {
534
+ constructor(e, t, n, r = D.none) {
527
535
  this.type = e, this.attrs = t, this.marks = r, this.content = n || E.empty;
528
536
  }
529
537
  get children() {
@@ -569,7 +577,7 @@ var we = class e {
569
577
  return this.hasMarkup(e.type, e.attrs, e.marks);
570
578
  }
571
579
  hasMarkup(e, t, n) {
572
- return this.type == e && he(this.attrs, t || e.defaultAttrs || ke) && O.sameSet(this.marks, n || O.none);
580
+ return this.type == e && ye(this.attrs, t || e.defaultAttrs || Ne) && D.sameSet(this.marks, n || D.none);
573
581
  }
574
582
  copy(t = null) {
575
583
  return t == this.content ? this : new e(this.type, this.attrs, t, this.marks);
@@ -581,12 +589,12 @@ var we = class e {
581
589
  return e == 0 && t == this.content.size ? this : this.copy(this.content.cut(e, t));
582
590
  }
583
591
  slice(e, t = this.content.size, n = !1) {
584
- if (e == t) return A.empty;
592
+ if (e == t) return k.empty;
585
593
  let r = this.resolve(e), i = this.resolve(t), a = n ? 0 : r.sharedDepth(t), o = r.start(a);
586
- return new A(r.node(a).content.cut(r.pos - o, i.pos - o), r.depth - a, i.depth - a);
594
+ return new k(r.node(a).content.cut(r.pos - o, i.pos - o), r.depth - a, i.depth - a);
587
595
  }
588
596
  replace(e, t, n) {
589
- return ve(this.resolve(e), this.resolve(t), n);
597
+ return Se(this.resolve(e), this.resolve(t), n);
590
598
  }
591
599
  nodeAt(e) {
592
600
  for (let t = this;;) {
@@ -624,10 +632,10 @@ var we = class e {
624
632
  };
625
633
  }
626
634
  resolve(e) {
627
- return we.resolveCached(this, e);
635
+ return Oe.resolveCached(this, e);
628
636
  }
629
637
  resolveNoCache(e) {
630
- return we.resolve(this, e);
638
+ return Oe.resolve(this, e);
631
639
  }
632
640
  rangeHasMark(e, t, n) {
633
641
  let r = !1;
@@ -657,7 +665,7 @@ var we = class e {
657
665
  toString() {
658
666
  if (this.type.spec.toDebugString) return this.type.spec.toDebugString(this);
659
667
  let e = this.type.name;
660
- return this.content.size && (e += "(" + this.content.toStringInner() + ")"), je(this.marks, e);
668
+ return this.content.size && (e += "(" + this.content.toStringInner() + ")"), Fe(this.marks, e);
661
669
  }
662
670
  contentMatchAt(e) {
663
671
  let t = this.type.contentMatch.matchFragment(this.content, 0, e);
@@ -680,12 +688,12 @@ var we = class e {
680
688
  }
681
689
  check() {
682
690
  this.type.checkContent(this.content), this.type.checkAttrs(this.attrs);
683
- let e = O.none;
691
+ let e = D.none;
684
692
  for (let t = 0; t < this.marks.length; t++) {
685
693
  let n = this.marks[t];
686
694
  n.type.checkAttrs(n.attrs), e = n.addToSet(e);
687
695
  }
688
- if (!O.sameSet(e, this.marks)) throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e) => e.type.name)}`);
696
+ if (!D.sameSet(e, this.marks)) throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e) => e.type.name)}`);
689
697
  this.content.forEach((e) => e.check());
690
698
  }
691
699
  toJSON() {
@@ -711,22 +719,22 @@ var we = class e {
711
719
  return i.type.checkAttrs(i.attrs), i;
712
720
  }
713
721
  };
714
- Ae.prototype.text = void 0;
715
- function je(e, t) {
722
+ Pe.prototype.text = void 0;
723
+ function Fe(e, t) {
716
724
  for (let n = e.length - 1; n >= 0; n--) t = e[n].type.name + "(" + t + ")";
717
725
  return t;
718
726
  }
719
- var Me = class e {
727
+ var Ie = class e {
720
728
  constructor(e) {
721
729
  this.validEnd = e, this.next = [], this.wrapCache = [];
722
730
  }
723
731
  static parse(t, n) {
724
- let r = new Ne(t, n);
732
+ let r = new Le(t, n);
725
733
  if (r.next == null) return e.empty;
726
- let i = Pe(r);
734
+ let i = Re(r);
727
735
  r.next && r.err("Unexpected trailing text");
728
- let a = We(Ve(i));
729
- return Ge(a, r), a;
736
+ let a = Je(Ge(i));
737
+ return Ye(a, r), a;
730
738
  }
731
739
  matchType(e) {
732
740
  for (let t = 0; t < this.next.length; t++) if (this.next[t].type == e) return this.next[t].next;
@@ -817,8 +825,8 @@ var Me = class e {
817
825
  }).join("\n");
818
826
  }
819
827
  };
820
- Me.empty = new Me(!0);
821
- var Ne = class {
828
+ Ie.empty = new Ie(!0);
829
+ var Le = class {
822
830
  constructor(e, t) {
823
831
  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();
824
832
  }
@@ -832,28 +840,28 @@ var Ne = class {
832
840
  throw SyntaxError(e + " (in content expression '" + this.string + "')");
833
841
  }
834
842
  };
835
- function Pe(e) {
843
+ function Re(e) {
836
844
  let t = [];
837
845
  do
838
- t.push(Fe(e));
846
+ t.push(ze(e));
839
847
  while (e.eat("|"));
840
848
  return t.length == 1 ? t[0] : {
841
849
  type: "choice",
842
850
  exprs: t
843
851
  };
844
852
  }
845
- function Fe(e) {
853
+ function ze(e) {
846
854
  let t = [];
847
855
  do
848
- t.push(Ie(e));
856
+ t.push(Be(e));
849
857
  while (e.next && e.next != ")" && e.next != "|");
850
858
  return t.length == 1 ? t[0] : {
851
859
  type: "seq",
852
860
  exprs: t
853
861
  };
854
862
  }
855
- function Ie(e) {
856
- let t = Be(e);
863
+ function Be(e) {
864
+ let t = We(e);
857
865
  for (;;) if (e.eat("+")) t = {
858
866
  type: "plus",
859
867
  expr: t
@@ -866,25 +874,25 @@ function Ie(e) {
866
874
  type: "opt",
867
875
  expr: t
868
876
  };
869
- else if (e.eat("{")) t = Re(e, t);
877
+ else if (e.eat("{")) t = He(e, t);
870
878
  else break;
871
879
  return t;
872
880
  }
873
- function Le(e) {
881
+ function Ve(e) {
874
882
  /\D/.test(e.next) && e.err("Expected number, got '" + e.next + "'");
875
883
  let t = Number(e.next);
876
884
  return e.pos++, t;
877
885
  }
878
- function Re(e, t) {
879
- let n = Le(e), r = n;
880
- return e.eat(",") && (r = e.next == "}" ? -1 : Le(e)), e.eat("}") || e.err("Unclosed braced range"), {
886
+ function He(e, t) {
887
+ let n = Ve(e), r = n;
888
+ return e.eat(",") && (r = e.next == "}" ? -1 : Ve(e)), e.eat("}") || e.err("Unclosed braced range"), {
881
889
  type: "range",
882
890
  min: n,
883
891
  max: r,
884
892
  expr: t
885
893
  };
886
894
  }
887
- function ze(e, t) {
895
+ function Ue(e, t) {
888
896
  let n = e.nodeTypes, r = n[t];
889
897
  if (r) return [r];
890
898
  let i = [];
@@ -894,13 +902,13 @@ function ze(e, t) {
894
902
  }
895
903
  return i.length == 0 && e.err("No node type or group '" + t + "' found"), i;
896
904
  }
897
- function Be(e) {
905
+ function We(e) {
898
906
  if (e.eat("(")) {
899
- let t = Pe(e);
907
+ let t = Re(e);
900
908
  return e.eat(")") || e.err("Missing closing paren"), t;
901
909
  } else if (/\W/.test(e.next)) e.err("Unexpected token '" + e.next + "'");
902
910
  else {
903
- let t = ze(e, e.next).map((t) => (e.inline == null ? e.inline = t.isInline : e.inline != t.isInline && e.err("Mixing inline and block content"), {
911
+ let t = Ue(e, e.next).map((t) => (e.inline == null ? e.inline = t.isInline : e.inline != t.isInline && e.err("Mixing inline and block content"), {
904
912
  type: "name",
905
913
  value: t
906
914
  }));
@@ -910,7 +918,7 @@ function Be(e) {
910
918
  };
911
919
  }
912
920
  }
913
- function Ve(e) {
921
+ function Ge(e) {
914
922
  let t = [[]];
915
923
  return i(a(e, 0), n()), t;
916
924
  function n() {
@@ -956,12 +964,12 @@ function Ve(e) {
956
964
  else throw Error("Unknown expr type");
957
965
  }
958
966
  }
959
- function He(e, t) {
967
+ function Ke(e, t) {
960
968
  return t - e;
961
969
  }
962
- function Ue(e, t) {
970
+ function qe(e, t) {
963
971
  let n = [];
964
- return r(t), n.sort(He);
972
+ return r(t), n.sort(Ke);
965
973
  function r(t) {
966
974
  let i = e[t];
967
975
  if (i.length == 1 && !i[0].term) return r(i[0].to);
@@ -972,9 +980,9 @@ function Ue(e, t) {
972
980
  }
973
981
  }
974
982
  }
975
- function We(e) {
983
+ function Je(e) {
976
984
  let t = /* @__PURE__ */ Object.create(null);
977
- return n(Ue(e, 0));
985
+ return n(qe(e, 0));
978
986
  function n(r) {
979
987
  let i = [];
980
988
  r.forEach((t) => {
@@ -982,14 +990,14 @@ function We(e) {
982
990
  if (!t) return;
983
991
  let r;
984
992
  for (let e = 0; e < i.length; e++) i[e][0] == t && (r = i[e][1]);
985
- Ue(e, n).forEach((e) => {
993
+ qe(e, n).forEach((e) => {
986
994
  r || i.push([t, r = []]), r.indexOf(e) == -1 && r.push(e);
987
995
  });
988
996
  });
989
997
  });
990
- let a = t[r.join(",")] = new Me(r.indexOf(e.length - 1) > -1);
998
+ let a = t[r.join(",")] = new Ie(r.indexOf(e.length - 1) > -1);
991
999
  for (let e = 0; e < i.length; e++) {
992
- let r = i[e][1].sort(He);
1000
+ let r = i[e][1].sort(Ke);
993
1001
  a.next.push({
994
1002
  type: i[e][0],
995
1003
  next: t[r.join(",")] || n(r)
@@ -998,7 +1006,7 @@ function We(e) {
998
1006
  return a;
999
1007
  }
1000
1008
  }
1001
- function Ge(e, t) {
1009
+ function Ye(e, t) {
1002
1010
  for (let n = 0, r = [e]; n < r.length; n++) {
1003
1011
  let e = r[n], i = !e.validEnd, a = [];
1004
1012
  for (let t = 0; t < e.next.length; t++) {
@@ -1008,40 +1016,40 @@ function Ge(e, t) {
1008
1016
  i && t.err("Only non-generatable nodes (" + a.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
1009
1017
  }
1010
1018
  }
1011
- var Ke = 65535, qe = 2 ** 16;
1012
- function Je(e, t) {
1013
- return e + t * qe;
1019
+ var Xe = 65535, Ze = 2 ** 16;
1020
+ function Qe(e, t) {
1021
+ return e + t * Ze;
1014
1022
  }
1015
- function Ye(e) {
1016
- return e & Ke;
1023
+ function $e(e) {
1024
+ return e & Xe;
1017
1025
  }
1018
- function Xe(e) {
1019
- return (e - (e & Ke)) / qe;
1026
+ function et(e) {
1027
+ return (e - (e & Xe)) / Ze;
1020
1028
  }
1021
- var Ze = 1, Qe = 2, F = 4, $e = 8, et = class {
1029
+ var tt = 1, nt = 2, rt = 4, it = 8, at = class {
1022
1030
  constructor(e, t, n) {
1023
1031
  this.pos = e, this.delInfo = t, this.recover = n;
1024
1032
  }
1025
1033
  get deleted() {
1026
- return (this.delInfo & $e) > 0;
1034
+ return (this.delInfo & it) > 0;
1027
1035
  }
1028
1036
  get deletedBefore() {
1029
- return (this.delInfo & (Ze | F)) > 0;
1037
+ return (this.delInfo & (tt | rt)) > 0;
1030
1038
  }
1031
1039
  get deletedAfter() {
1032
- return (this.delInfo & (Qe | F)) > 0;
1040
+ return (this.delInfo & (nt | rt)) > 0;
1033
1041
  }
1034
1042
  get deletedAcross() {
1035
- return (this.delInfo & F) > 0;
1043
+ return (this.delInfo & rt) > 0;
1036
1044
  }
1037
- }, I = class e {
1045
+ }, P = class e {
1038
1046
  constructor(t, n = !1) {
1039
1047
  if (this.ranges = t, this.inverted = n, !t.length && e.empty) return e.empty;
1040
1048
  }
1041
1049
  recover(e) {
1042
- let t = 0, n = Ye(e);
1050
+ let t = 0, n = $e(e);
1043
1051
  if (!this.inverted) for (let e = 0; e < n; e++) t += this.ranges[e * 3 + 2] - this.ranges[e * 3 + 1];
1044
- return this.ranges[n * 3] + t + Xe(e);
1052
+ return this.ranges[n * 3] + t + et(e);
1045
1053
  }
1046
1054
  mapResult(e, t = 1) {
1047
1055
  return this._map(e, t, !1);
@@ -1058,15 +1066,15 @@ var Ze = 1, Qe = 2, F = 4, $e = 8, et = class {
1058
1066
  if (e <= u) {
1059
1067
  let i = c ? e == s ? -1 : e == u ? 1 : t : t, a = s + r + (i < 0 ? 0 : l);
1060
1068
  if (n) return a;
1061
- let d = e == (t < 0 ? s : u) ? null : Je(o / 3, e - s), f = e == s ? Qe : e == u ? Ze : F;
1062
- return (t < 0 ? e != s : e != u) && (f |= $e), new et(a, f, d);
1069
+ let d = e == (t < 0 ? s : u) ? null : Qe(o / 3, e - s), f = e == s ? nt : e == u ? tt : rt;
1070
+ return (t < 0 ? e != s : e != u) && (f |= it), new at(a, f, d);
1063
1071
  }
1064
1072
  r += l - c;
1065
1073
  }
1066
- return n ? e + r : new et(e + r, 0, null);
1074
+ return n ? e + r : new at(e + r, 0, null);
1067
1075
  }
1068
1076
  touches(e, t) {
1069
- let n = 0, r = Ye(t), i = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
1077
+ let n = 0, r = $e(t), i = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
1070
1078
  for (let t = 0; t < this.ranges.length; t += 3) {
1071
1079
  let o = this.ranges[t] - (this.inverted ? n : 0);
1072
1080
  if (o > e) break;
@@ -1101,25 +1109,25 @@ var Ze = 1, Qe = 2, F = 4, $e = 8, et = class {
1101
1109
  ]);
1102
1110
  }
1103
1111
  };
1104
- I.empty = new I([]);
1105
- var tt = /* @__PURE__ */ Object.create(null), L = class {
1112
+ P.empty = new P([]);
1113
+ var ot = /* @__PURE__ */ Object.create(null), F = class {
1106
1114
  getMap() {
1107
- return I.empty;
1115
+ return P.empty;
1108
1116
  }
1109
1117
  merge(e) {
1110
1118
  return null;
1111
1119
  }
1112
1120
  static fromJSON(e, t) {
1113
1121
  if (!t || !t.stepType) throw RangeError("Invalid input for Step.fromJSON");
1114
- let n = tt[t.stepType];
1122
+ let n = ot[t.stepType];
1115
1123
  if (!n) throw RangeError(`No step type ${t.stepType} defined`);
1116
1124
  return n.fromJSON(e, t);
1117
1125
  }
1118
1126
  static jsonID(e, t) {
1119
- if (e in tt) throw RangeError("Duplicate use of step JSON ID " + e);
1120
- return tt[e] = t, t.prototype.jsonID = e, t;
1127
+ if (e in ot) throw RangeError("Duplicate use of step JSON ID " + e);
1128
+ return ot[e] = t, t.prototype.jsonID = e, t;
1121
1129
  }
1122
- }, R = class e {
1130
+ }, I = class e {
1123
1131
  constructor(e, t) {
1124
1132
  this.doc = e, this.failed = t;
1125
1133
  }
@@ -1133,29 +1141,29 @@ var tt = /* @__PURE__ */ Object.create(null), L = class {
1133
1141
  try {
1134
1142
  return e.ok(t.replace(n, r, i));
1135
1143
  } catch (t) {
1136
- if (t instanceof k) return e.fail(t.message);
1144
+ if (t instanceof O) return e.fail(t.message);
1137
1145
  throw t;
1138
1146
  }
1139
1147
  }
1140
1148
  };
1141
- function nt(e, t, n) {
1149
+ function st(e, t, n) {
1142
1150
  let r = [];
1143
1151
  for (let i = 0; i < e.childCount; i++) {
1144
1152
  let a = e.child(i);
1145
- a.content.size && (a = a.copy(nt(a.content, t, a))), a.isInline && (a = t(a, n, i)), r.push(a);
1153
+ a.content.size && (a = a.copy(st(a.content, t, a))), a.isInline && (a = t(a, n, i)), r.push(a);
1146
1154
  }
1147
1155
  return E.fromArray(r);
1148
1156
  }
1149
- var rt = class e extends L {
1157
+ var ct = class e extends F {
1150
1158
  constructor(e, t, n) {
1151
1159
  super(), this.from = e, this.to = t, this.mark = n;
1152
1160
  }
1153
1161
  apply(e) {
1154
- let t = e.slice(this.from, this.to), n = e.resolve(this.from), r = n.node(n.sharedDepth(this.to)), i = new A(nt(t.content, (e, t) => !e.isAtom || !t.type.allowsMarkType(this.mark.type) ? e : e.mark(this.mark.addToSet(e.marks)), r), t.openStart, t.openEnd);
1155
- return R.fromReplace(e, this.from, this.to, i);
1162
+ let t = e.slice(this.from, this.to), n = e.resolve(this.from), r = n.node(n.sharedDepth(this.to)), i = new k(st(t.content, (e, t) => !e.isAtom || !t.type.allowsMarkType(this.mark.type) ? e : e.mark(this.mark.addToSet(e.marks)), r), t.openStart, t.openEnd);
1163
+ return I.fromReplace(e, this.from, this.to, i);
1156
1164
  }
1157
1165
  invert() {
1158
- return new it(this.from, this.to, this.mark);
1166
+ return new lt(this.from, this.to, this.mark);
1159
1167
  }
1160
1168
  map(t) {
1161
1169
  let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
@@ -1177,17 +1185,17 @@ var rt = class e extends L {
1177
1185
  return new e(n.from, n.to, t.markFromJSON(n.mark));
1178
1186
  }
1179
1187
  };
1180
- L.jsonID("addMark", rt);
1181
- var it = class e extends L {
1188
+ F.jsonID("addMark", ct);
1189
+ var lt = class e extends F {
1182
1190
  constructor(e, t, n) {
1183
1191
  super(), this.from = e, this.to = t, this.mark = n;
1184
1192
  }
1185
1193
  apply(e) {
1186
- let t = e.slice(this.from, this.to), n = new A(nt(t.content, (e) => e.mark(this.mark.removeFromSet(e.marks)), e), t.openStart, t.openEnd);
1187
- return R.fromReplace(e, this.from, this.to, n);
1194
+ let t = e.slice(this.from, this.to), n = new k(st(t.content, (e) => e.mark(this.mark.removeFromSet(e.marks)), e), t.openStart, t.openEnd);
1195
+ return I.fromReplace(e, this.from, this.to, n);
1188
1196
  }
1189
1197
  invert() {
1190
- return new rt(this.from, this.to, this.mark);
1198
+ return new ct(this.from, this.to, this.mark);
1191
1199
  }
1192
1200
  map(t) {
1193
1201
  let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
@@ -1209,16 +1217,16 @@ var it = class e extends L {
1209
1217
  return new e(n.from, n.to, t.markFromJSON(n.mark));
1210
1218
  }
1211
1219
  };
1212
- L.jsonID("removeMark", it);
1213
- var at = class e extends L {
1220
+ F.jsonID("removeMark", lt);
1221
+ var ut = class e extends F {
1214
1222
  constructor(e, t) {
1215
1223
  super(), this.pos = e, this.mark = t;
1216
1224
  }
1217
1225
  apply(e) {
1218
1226
  let t = e.nodeAt(this.pos);
1219
- if (!t) return R.fail("No node at mark step's position");
1227
+ if (!t) return I.fail("No node at mark step's position");
1220
1228
  let n = t.type.create(t.attrs, null, this.mark.addToSet(t.marks));
1221
- return R.fromReplace(e, this.pos, this.pos + 1, new A(E.from(n), 0, +!t.isLeaf));
1229
+ return I.fromReplace(e, this.pos, this.pos + 1, new k(E.from(n), 0, +!t.isLeaf));
1222
1230
  }
1223
1231
  invert(t) {
1224
1232
  let n = t.nodeAt(this.pos);
@@ -1229,7 +1237,7 @@ var at = class e extends L {
1229
1237
  return new e(this.pos, this.mark);
1230
1238
  }
1231
1239
  }
1232
- return new ot(this.pos, this.mark);
1240
+ return new dt(this.pos, this.mark);
1233
1241
  }
1234
1242
  map(t) {
1235
1243
  let n = t.mapResult(this.pos, 1);
@@ -1247,20 +1255,20 @@ var at = class e extends L {
1247
1255
  return new e(n.pos, t.markFromJSON(n.mark));
1248
1256
  }
1249
1257
  };
1250
- L.jsonID("addNodeMark", at);
1251
- var ot = class e extends L {
1258
+ F.jsonID("addNodeMark", ut);
1259
+ var dt = class e extends F {
1252
1260
  constructor(e, t) {
1253
1261
  super(), this.pos = e, this.mark = t;
1254
1262
  }
1255
1263
  apply(e) {
1256
1264
  let t = e.nodeAt(this.pos);
1257
- if (!t) return R.fail("No node at mark step's position");
1265
+ if (!t) return I.fail("No node at mark step's position");
1258
1266
  let n = t.type.create(t.attrs, null, this.mark.removeFromSet(t.marks));
1259
- return R.fromReplace(e, this.pos, this.pos + 1, new A(E.from(n), 0, +!t.isLeaf));
1267
+ return I.fromReplace(e, this.pos, this.pos + 1, new k(E.from(n), 0, +!t.isLeaf));
1260
1268
  }
1261
1269
  invert(e) {
1262
1270
  let t = e.nodeAt(this.pos);
1263
- return !t || !this.mark.isInSet(t.marks) ? this : new at(this.pos, this.mark);
1271
+ return !t || !this.mark.isInSet(t.marks) ? this : new ut(this.pos, this.mark);
1264
1272
  }
1265
1273
  map(t) {
1266
1274
  let n = t.mapResult(this.pos, 1);
@@ -1278,16 +1286,16 @@ var ot = class e extends L {
1278
1286
  return new e(n.pos, t.markFromJSON(n.mark));
1279
1287
  }
1280
1288
  };
1281
- L.jsonID("removeNodeMark", ot);
1282
- var st = class e extends L {
1289
+ F.jsonID("removeNodeMark", dt);
1290
+ var ft = class e extends F {
1283
1291
  constructor(e, t, n, r = !1) {
1284
1292
  super(), this.from = e, this.to = t, this.slice = n, this.structure = r;
1285
1293
  }
1286
1294
  apply(e) {
1287
- return this.structure && lt(e, this.from, this.to) ? R.fail("Structure replace would overwrite content") : R.fromReplace(e, this.from, this.to, this.slice);
1295
+ return this.structure && mt(e, this.from, this.to) ? I.fail("Structure replace would overwrite content") : I.fromReplace(e, this.from, this.to, this.slice);
1288
1296
  }
1289
1297
  getMap() {
1290
- return new I([
1298
+ return new P([
1291
1299
  this.from,
1292
1300
  this.to - this.from,
1293
1301
  this.slice.size
@@ -1303,10 +1311,10 @@ var st = class e extends L {
1303
1311
  merge(t) {
1304
1312
  if (!(t instanceof e) || t.structure || this.structure) return null;
1305
1313
  if (this.from + this.slice.size == t.from && !this.slice.openEnd && !t.slice.openStart) {
1306
- let n = this.slice.size + t.slice.size == 0 ? A.empty : new A(this.slice.content.append(t.slice.content), this.slice.openStart, t.slice.openEnd);
1314
+ let n = this.slice.size + t.slice.size == 0 ? k.empty : new k(this.slice.content.append(t.slice.content), this.slice.openStart, t.slice.openEnd);
1307
1315
  return new e(this.from, this.to + (t.to - t.from), n, this.structure);
1308
1316
  } else if (t.to == this.from && !this.slice.openStart && !t.slice.openEnd) {
1309
- let n = this.slice.size + t.slice.size == 0 ? A.empty : new A(t.slice.content.append(this.slice.content), t.slice.openStart, this.slice.openEnd);
1317
+ let n = this.slice.size + t.slice.size == 0 ? k.empty : new k(t.slice.content.append(this.slice.content), t.slice.openStart, this.slice.openEnd);
1310
1318
  return new e(t.from, this.to, n, this.structure);
1311
1319
  } else return null;
1312
1320
  }
@@ -1320,23 +1328,23 @@ var st = class e extends L {
1320
1328
  }
1321
1329
  static fromJSON(t, n) {
1322
1330
  if (typeof n.from != "number" || typeof n.to != "number") throw RangeError("Invalid input for ReplaceStep.fromJSON");
1323
- return new e(n.from, n.to, A.fromJSON(t, n.slice), !!n.structure);
1331
+ return new e(n.from, n.to, k.fromJSON(t, n.slice), !!n.structure);
1324
1332
  }
1325
1333
  };
1326
- st.MAP_BIAS = 1, L.jsonID("replace", st);
1327
- var ct = class e extends L {
1334
+ ft.MAP_BIAS = 1, F.jsonID("replace", ft);
1335
+ var pt = class e extends F {
1328
1336
  constructor(e, t, n, r, i, a, o = !1) {
1329
1337
  super(), this.from = e, this.to = t, this.gapFrom = n, this.gapTo = r, this.slice = i, this.insert = a, this.structure = o;
1330
1338
  }
1331
1339
  apply(e) {
1332
- if (this.structure && (lt(e, this.from, this.gapFrom) || lt(e, this.gapTo, this.to))) return R.fail("Structure gap-replace would overwrite content");
1340
+ if (this.structure && (mt(e, this.from, this.gapFrom) || mt(e, this.gapTo, this.to))) return I.fail("Structure gap-replace would overwrite content");
1333
1341
  let t = e.slice(this.gapFrom, this.gapTo);
1334
- if (t.openStart || t.openEnd) return R.fail("Gap is not a flat range");
1342
+ if (t.openStart || t.openEnd) return I.fail("Gap is not a flat range");
1335
1343
  let n = this.slice.insertAt(this.insert, t.content);
1336
- return n ? R.fromReplace(e, this.from, this.to, n) : R.fail("Content does not fit in gap");
1344
+ return n ? I.fromReplace(e, this.from, this.to, n) : I.fail("Content does not fit in gap");
1337
1345
  }
1338
1346
  getMap() {
1339
- return new I([
1347
+ return new P([
1340
1348
  this.from,
1341
1349
  this.gapFrom - this.from,
1342
1350
  this.insert,
@@ -1366,11 +1374,11 @@ var ct = class e extends L {
1366
1374
  }
1367
1375
  static fromJSON(t, n) {
1368
1376
  if (typeof n.from != "number" || typeof n.to != "number" || typeof n.gapFrom != "number" || typeof n.gapTo != "number" || typeof n.insert != "number") throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");
1369
- return new e(n.from, n.to, n.gapFrom, n.gapTo, A.fromJSON(t, n.slice), n.insert, !!n.structure);
1377
+ return new e(n.from, n.to, n.gapFrom, n.gapTo, k.fromJSON(t, n.slice), n.insert, !!n.structure);
1370
1378
  }
1371
1379
  };
1372
- L.jsonID("replaceAround", ct);
1373
- function lt(e, t, n) {
1380
+ F.jsonID("replaceAround", pt);
1381
+ function mt(e, t, n) {
1374
1382
  let r = e.resolve(t), i = n - t, a = r.depth;
1375
1383
  for (; i > 0 && a > 0 && r.indexAfter(a) == r.node(a).childCount;) a--, i--;
1376
1384
  if (i > 0) {
@@ -1382,21 +1390,21 @@ function lt(e, t, n) {
1382
1390
  }
1383
1391
  return !1;
1384
1392
  }
1385
- var ut = class e extends L {
1393
+ var ht = class e extends F {
1386
1394
  constructor(e, t, n) {
1387
1395
  super(), this.pos = e, this.attr = t, this.value = n;
1388
1396
  }
1389
1397
  apply(e) {
1390
1398
  let t = e.nodeAt(this.pos);
1391
- if (!t) return R.fail("No node at attribute step's position");
1399
+ if (!t) return I.fail("No node at attribute step's position");
1392
1400
  let n = /* @__PURE__ */ Object.create(null);
1393
1401
  for (let e in t.attrs) n[e] = t.attrs[e];
1394
1402
  n[this.attr] = this.value;
1395
1403
  let r = t.type.create(n, null, t.marks);
1396
- return R.fromReplace(e, this.pos, this.pos + 1, new A(E.from(r), 0, +!t.isLeaf));
1404
+ return I.fromReplace(e, this.pos, this.pos + 1, new k(E.from(r), 0, +!t.isLeaf));
1397
1405
  }
1398
1406
  getMap() {
1399
- return I.empty;
1407
+ return P.empty;
1400
1408
  }
1401
1409
  invert(t) {
1402
1410
  return new e(this.pos, this.attr, t.nodeAt(this.pos).attrs[this.attr]);
@@ -1418,8 +1426,8 @@ var ut = class e extends L {
1418
1426
  return new e(n.pos, n.attr, n.value);
1419
1427
  }
1420
1428
  };
1421
- L.jsonID("attr", ut);
1422
- var dt = class e extends L {
1429
+ F.jsonID("attr", ht);
1430
+ var gt = class e extends F {
1423
1431
  constructor(e, t) {
1424
1432
  super(), this.attr = e, this.value = t;
1425
1433
  }
@@ -1428,10 +1436,10 @@ var dt = class e extends L {
1428
1436
  for (let n in e.attrs) t[n] = e.attrs[n];
1429
1437
  t[this.attr] = this.value;
1430
1438
  let n = e.type.create(t, e.content, e.marks);
1431
- return R.ok(n);
1439
+ return I.ok(n);
1432
1440
  }
1433
1441
  getMap() {
1434
- return I.empty;
1442
+ return P.empty;
1435
1443
  }
1436
1444
  invert(t) {
1437
1445
  return new e(this.attr, t.attrs[this.attr]);
@@ -1451,15 +1459,15 @@ var dt = class e extends L {
1451
1459
  return new e(n.attr, n.value);
1452
1460
  }
1453
1461
  };
1454
- L.jsonID("docAttr", dt);
1455
- var z = class extends Error {};
1456
- z = function e(t) {
1462
+ F.jsonID("docAttr", gt);
1463
+ var L = class extends Error {};
1464
+ L = function e(t) {
1457
1465
  let n = Error.call(this, t);
1458
1466
  return n.__proto__ = e.prototype, n;
1459
- }, z.prototype = Object.create(Error.prototype), z.prototype.constructor = z, z.prototype.name = "TransformError";
1460
- var ft = /* @__PURE__ */ Object.create(null), B = class {
1467
+ }, L.prototype = Object.create(Error.prototype), L.prototype.constructor = L, L.prototype.name = "TransformError";
1468
+ var _t = /* @__PURE__ */ Object.create(null), R = class {
1461
1469
  constructor(e, t, n) {
1462
- this.$anchor = e, this.$head = t, this.ranges = n || [new pt(e.min(t), e.max(t))];
1470
+ this.$anchor = e, this.$head = t, this.ranges = n || [new vt(e.min(t), e.max(t))];
1463
1471
  }
1464
1472
  get anchor() {
1465
1473
  return this.$anchor.pos;
@@ -1487,78 +1495,78 @@ var ft = /* @__PURE__ */ Object.create(null), B = class {
1487
1495
  content() {
1488
1496
  return this.$from.doc.slice(this.from, this.to, !0);
1489
1497
  }
1490
- replace(e, t = A.empty) {
1498
+ replace(e, t = k.empty) {
1491
1499
  let n = t.content.lastChild, r = null;
1492
1500
  for (let e = 0; e < t.openEnd; e++) r = n, n = n.lastChild;
1493
1501
  let i = e.steps.length, a = this.ranges;
1494
1502
  for (let o = 0; o < a.length; o++) {
1495
1503
  let { $from: s, $to: c } = a[o], l = e.mapping.slice(i);
1496
- e.replaceRange(l.map(s.pos), l.map(c.pos), o ? A.empty : t), o == 0 && yt(e, i, (n ? n.isInline : r && r.isTextblock) ? -1 : 1);
1504
+ e.replaceRange(l.map(s.pos), l.map(c.pos), o ? k.empty : t), o == 0 && wt(e, i, (n ? n.isInline : r && r.isTextblock) ? -1 : 1);
1497
1505
  }
1498
1506
  }
1499
1507
  replaceWith(e, t) {
1500
1508
  let n = e.steps.length, r = this.ranges;
1501
1509
  for (let i = 0; i < r.length; i++) {
1502
1510
  let { $from: a, $to: o } = r[i], s = e.mapping.slice(n), c = s.map(a.pos), l = s.map(o.pos);
1503
- i ? e.deleteRange(c, l) : (e.replaceRangeWith(c, l, t), yt(e, n, t.isInline ? -1 : 1));
1511
+ i ? e.deleteRange(c, l) : (e.replaceRangeWith(c, l, t), wt(e, n, t.isInline ? -1 : 1));
1504
1512
  }
1505
1513
  }
1506
1514
  static findFrom(e, t, n = !1) {
1507
- let r = e.parent.inlineContent ? new V(e) : W(e.node(0), e.parent, e.pos, e.index(), t, n);
1515
+ let r = e.parent.inlineContent ? new z(e) : H(e.node(0), e.parent, e.pos, e.index(), t, n);
1508
1516
  if (r) return r;
1509
1517
  for (let r = e.depth - 1; r >= 0; r--) {
1510
- let i = t < 0 ? W(e.node(0), e.node(r), e.before(r + 1), e.index(r), t, n) : W(e.node(0), e.node(r), e.after(r + 1), e.index(r) + 1, t, n);
1518
+ let i = t < 0 ? H(e.node(0), e.node(r), e.before(r + 1), e.index(r), t, n) : H(e.node(0), e.node(r), e.after(r + 1), e.index(r) + 1, t, n);
1511
1519
  if (i) return i;
1512
1520
  }
1513
1521
  return null;
1514
1522
  }
1515
1523
  static near(e, t = 1) {
1516
- return this.findFrom(e, t) || this.findFrom(e, -t) || new U(e.node(0));
1524
+ return this.findFrom(e, t) || this.findFrom(e, -t) || new V(e.node(0));
1517
1525
  }
1518
1526
  static atStart(e) {
1519
- return W(e, e, 0, 0, 1) || new U(e);
1527
+ return H(e, e, 0, 0, 1) || new V(e);
1520
1528
  }
1521
1529
  static atEnd(e) {
1522
- return W(e, e, e.content.size, e.childCount, -1) || new U(e);
1530
+ return H(e, e, e.content.size, e.childCount, -1) || new V(e);
1523
1531
  }
1524
1532
  static fromJSON(e, t) {
1525
1533
  if (!t || !t.type) throw RangeError("Invalid input for Selection.fromJSON");
1526
- let n = ft[t.type];
1534
+ let n = _t[t.type];
1527
1535
  if (!n) throw RangeError(`No selection type ${t.type} defined`);
1528
1536
  return n.fromJSON(e, t);
1529
1537
  }
1530
1538
  static jsonID(e, t) {
1531
- if (e in ft) throw RangeError("Duplicate use of selection JSON ID " + e);
1532
- return ft[e] = t, t.prototype.jsonID = e, t;
1539
+ if (e in _t) throw RangeError("Duplicate use of selection JSON ID " + e);
1540
+ return _t[e] = t, t.prototype.jsonID = e, t;
1533
1541
  }
1534
1542
  getBookmark() {
1535
- return V.between(this.$anchor, this.$head).getBookmark();
1543
+ return z.between(this.$anchor, this.$head).getBookmark();
1536
1544
  }
1537
1545
  };
1538
- B.prototype.visible = !0;
1539
- var pt = class {
1546
+ R.prototype.visible = !0;
1547
+ var vt = class {
1540
1548
  constructor(e, t) {
1541
1549
  this.$from = e, this.$to = t;
1542
1550
  }
1543
- }, mt = !1;
1544
- function ht(e) {
1545
- !mt && !e.parent.inlineContent && (mt = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + e.parent.type.name + ")"));
1551
+ }, yt = !1;
1552
+ function bt(e) {
1553
+ !yt && !e.parent.inlineContent && (yt = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + e.parent.type.name + ")"));
1546
1554
  }
1547
- var V = class e extends B {
1555
+ var z = class e extends R {
1548
1556
  constructor(e, t = e) {
1549
- ht(e), ht(t), super(e, t);
1557
+ bt(e), bt(t), super(e, t);
1550
1558
  }
1551
1559
  get $cursor() {
1552
1560
  return this.$anchor.pos == this.$head.pos ? this.$head : null;
1553
1561
  }
1554
1562
  map(t, n) {
1555
1563
  let r = t.resolve(n.map(this.head));
1556
- if (!r.parent.inlineContent) return B.near(r);
1564
+ if (!r.parent.inlineContent) return R.near(r);
1557
1565
  let i = t.resolve(n.map(this.anchor));
1558
1566
  return new e(i.parent.inlineContent ? i : r, r);
1559
1567
  }
1560
- replace(e, t = A.empty) {
1561
- if (super.replace(e, t), t == A.empty) {
1568
+ replace(e, t = k.empty) {
1569
+ if (super.replace(e, t), t == k.empty) {
1562
1570
  let t = this.$from.marksAcross(this.$to);
1563
1571
  t && e.ensureMarks(t);
1564
1572
  }
@@ -1567,7 +1575,7 @@ var V = class e extends B {
1567
1575
  return t instanceof e && t.anchor == this.anchor && t.head == this.head;
1568
1576
  }
1569
1577
  getBookmark() {
1570
- return new gt(this.anchor, this.head);
1578
+ return new xt(this.anchor, this.head);
1571
1579
  }
1572
1580
  toJSON() {
1573
1581
  return {
@@ -1587,15 +1595,15 @@ var V = class e extends B {
1587
1595
  static between(t, n, r) {
1588
1596
  let i = t.pos - n.pos;
1589
1597
  if ((!r || i) && (r = i >= 0 ? 1 : -1), !n.parent.inlineContent) {
1590
- let e = B.findFrom(n, r, !0) || B.findFrom(n, -r, !0);
1598
+ let e = R.findFrom(n, r, !0) || R.findFrom(n, -r, !0);
1591
1599
  if (e) n = e.$head;
1592
- else return B.near(n, r);
1600
+ else return R.near(n, r);
1593
1601
  }
1594
- return t.parent.inlineContent || (i == 0 ? t = n : (t = (B.findFrom(t, -r, !0) || B.findFrom(t, r, !0)).$anchor, t.pos < n.pos != i < 0 && (t = n))), new e(t, n);
1602
+ return t.parent.inlineContent || (i == 0 ? t = n : (t = (R.findFrom(t, -r, !0) || R.findFrom(t, r, !0)).$anchor, t.pos < n.pos != i < 0 && (t = n))), new e(t, n);
1595
1603
  }
1596
1604
  };
1597
- B.jsonID("text", V);
1598
- var gt = class e {
1605
+ R.jsonID("text", z);
1606
+ var xt = class e {
1599
1607
  constructor(e, t) {
1600
1608
  this.anchor = e, this.head = t;
1601
1609
  }
@@ -1603,19 +1611,19 @@ var gt = class e {
1603
1611
  return new e(t.map(this.anchor), t.map(this.head));
1604
1612
  }
1605
1613
  resolve(e) {
1606
- return V.between(e.resolve(this.anchor), e.resolve(this.head));
1614
+ return z.between(e.resolve(this.anchor), e.resolve(this.head));
1607
1615
  }
1608
- }, H = class e extends B {
1616
+ }, B = class e extends R {
1609
1617
  constructor(e) {
1610
1618
  let t = e.nodeAfter, n = e.node(0).resolve(e.pos + t.nodeSize);
1611
1619
  super(e, n), this.node = t;
1612
1620
  }
1613
1621
  map(t, n) {
1614
1622
  let { deleted: r, pos: i } = n.mapResult(this.anchor), a = t.resolve(i);
1615
- return r ? B.near(a) : new e(a);
1623
+ return r ? R.near(a) : new e(a);
1616
1624
  }
1617
1625
  content() {
1618
- return new A(E.from(this.node), 0, 0);
1626
+ return new k(E.from(this.node), 0, 0);
1619
1627
  }
1620
1628
  eq(t) {
1621
1629
  return t instanceof e && t.anchor == this.anchor;
@@ -1627,7 +1635,7 @@ var gt = class e {
1627
1635
  };
1628
1636
  }
1629
1637
  getBookmark() {
1630
- return new _t(this.anchor);
1638
+ return new St(this.anchor);
1631
1639
  }
1632
1640
  static fromJSON(t, n) {
1633
1641
  if (typeof n.anchor != "number") throw RangeError("Invalid input for NodeSelection.fromJSON");
@@ -1640,27 +1648,27 @@ var gt = class e {
1640
1648
  return !e.isText && e.type.spec.selectable !== !1;
1641
1649
  }
1642
1650
  };
1643
- H.prototype.visible = !1, B.jsonID("node", H);
1644
- var _t = class e {
1651
+ B.prototype.visible = !1, R.jsonID("node", B);
1652
+ var St = class e {
1645
1653
  constructor(e) {
1646
1654
  this.anchor = e;
1647
1655
  }
1648
1656
  map(t) {
1649
1657
  let { deleted: n, pos: r } = t.mapResult(this.anchor);
1650
- return n ? new gt(r, r) : new e(r);
1658
+ return n ? new xt(r, r) : new e(r);
1651
1659
  }
1652
1660
  resolve(e) {
1653
1661
  let t = e.resolve(this.anchor), n = t.nodeAfter;
1654
- return n && H.isSelectable(n) ? new H(t) : B.near(t);
1662
+ return n && B.isSelectable(n) ? new B(t) : R.near(t);
1655
1663
  }
1656
- }, U = class e extends B {
1664
+ }, V = class e extends R {
1657
1665
  constructor(e) {
1658
1666
  super(e.resolve(0), e.resolve(e.content.size));
1659
1667
  }
1660
- replace(e, t = A.empty) {
1661
- if (t == A.empty) {
1668
+ replace(e, t = k.empty) {
1669
+ if (t == k.empty) {
1662
1670
  e.delete(0, e.doc.content.size);
1663
- let t = B.atStart(e.doc);
1671
+ let t = R.atStart(e.doc);
1664
1672
  t.eq(e.selection) || e.setSelection(t);
1665
1673
  } else super.replace(e, t);
1666
1674
  }
@@ -1677,70 +1685,70 @@ var _t = class e {
1677
1685
  return t instanceof e;
1678
1686
  }
1679
1687
  getBookmark() {
1680
- return vt;
1688
+ return Ct;
1681
1689
  }
1682
1690
  };
1683
- B.jsonID("all", U);
1684
- var vt = {
1691
+ R.jsonID("all", V);
1692
+ var Ct = {
1685
1693
  map() {
1686
1694
  return this;
1687
1695
  },
1688
1696
  resolve(e) {
1689
- return new U(e);
1697
+ return new V(e);
1690
1698
  }
1691
1699
  };
1692
- function W(e, t, n, r, i, a = !1) {
1693
- if (t.inlineContent) return V.create(e, n);
1700
+ function H(e, t, n, r, i, a = !1) {
1701
+ if (t.inlineContent) return z.create(e, n);
1694
1702
  for (let o = r - (i > 0 ? 0 : 1); i > 0 ? o < t.childCount : o >= 0; o += i) {
1695
1703
  let r = t.child(o);
1696
1704
  if (!r.isAtom) {
1697
- let t = W(e, r, n + i, i < 0 ? r.childCount : 0, i, a);
1705
+ let t = H(e, r, n + i, i < 0 ? r.childCount : 0, i, a);
1698
1706
  if (t) return t;
1699
- } else if (!a && H.isSelectable(r)) return H.create(e, n - (i < 0 ? r.nodeSize : 0));
1707
+ } else if (!a && B.isSelectable(r)) return B.create(e, n - (i < 0 ? r.nodeSize : 0));
1700
1708
  n += r.nodeSize * i;
1701
1709
  }
1702
1710
  return null;
1703
1711
  }
1704
- function yt(e, t, n) {
1712
+ function wt(e, t, n) {
1705
1713
  let r = e.steps.length - 1;
1706
1714
  if (r < t) return;
1707
1715
  let i = e.steps[r];
1708
- if (!(i instanceof st || i instanceof ct)) return;
1716
+ if (!(i instanceof ft || i instanceof pt)) return;
1709
1717
  let a = e.mapping.maps[r], o;
1710
1718
  a.forEach((e, t, n, r) => {
1711
1719
  o ??= r;
1712
- }), e.setSelection(B.near(e.doc.resolve(o), n));
1720
+ }), e.setSelection(R.near(e.doc.resolve(o), n));
1713
1721
  }
1714
- function bt(e, t) {
1722
+ function Tt(e, t) {
1715
1723
  return !t || !e ? e : e.bind(t);
1716
1724
  }
1717
- var G = class {
1725
+ var U = class {
1718
1726
  constructor(e, t, n) {
1719
- this.name = e, this.init = bt(t.init, n), this.apply = bt(t.apply, n);
1727
+ this.name = e, this.init = Tt(t.init, n), this.apply = Tt(t.apply, n);
1720
1728
  }
1721
1729
  };
1722
- new G("doc", {
1730
+ new U("doc", {
1723
1731
  init(e) {
1724
1732
  return e.doc || e.schema.topNodeType.createAndFill();
1725
1733
  },
1726
1734
  apply(e) {
1727
1735
  return e.doc;
1728
1736
  }
1729
- }), new G("selection", {
1737
+ }), new U("selection", {
1730
1738
  init(e, t) {
1731
- return e.selection || B.atStart(t.doc);
1739
+ return e.selection || R.atStart(t.doc);
1732
1740
  },
1733
1741
  apply(e) {
1734
1742
  return e.selection;
1735
1743
  }
1736
- }), new G("storedMarks", {
1744
+ }), new U("storedMarks", {
1737
1745
  init(e) {
1738
1746
  return e.storedMarks || null;
1739
1747
  },
1740
1748
  apply(e, t, n, r) {
1741
1749
  return r.selection.$cursor ? e.storedMarks : null;
1742
1750
  }
1743
- }), new G("scrollToSelection", {
1751
+ }), new U("scrollToSelection", {
1744
1752
  init() {
1745
1753
  return 0;
1746
1754
  },
@@ -1748,7 +1756,7 @@ new G("doc", {
1748
1756
  return e.scrolledIntoView ? t + 1 : t;
1749
1757
  }
1750
1758
  });
1751
- var xt = (e, t) => {
1759
+ var Et = (e, t) => {
1752
1760
  let { state: n, view: r } = e, { selection: i } = n;
1753
1761
  if (!i.empty) return !1;
1754
1762
  let { $from: a } = i;
@@ -1759,8 +1767,8 @@ var xt = (e, t) => {
1759
1767
  let l = s.child(c - 1);
1760
1768
  if (l.type !== t || !l.lastChild?.isTextblock) return !1;
1761
1769
  let u = a.before(), d = u - 1 - 1, { tr: f } = n;
1762
- return f.delete(u, a.after()).insert(d, a.parent.content), f.setSelection(V.create(f.doc, d)), r.dispatch(f.scrollIntoView()), !0;
1763
- }, St = /^\s*>\s$/, Ct = x.create({
1770
+ return f.delete(u, a.after()).insert(d, a.parent.content), f.setSelection(z.create(f.doc, d)), r.dispatch(f.scrollIntoView()), !0;
1771
+ }, Dt = /^\s*>\s$/, Ot = x.create({
1764
1772
  name: "blockquote",
1765
1773
  addOptions() {
1766
1774
  return { HTMLAttributes: {} };
@@ -1772,9 +1780,9 @@ var xt = (e, t) => {
1772
1780
  return [{ tag: "blockquote" }];
1773
1781
  },
1774
1782
  renderHTML({ HTMLAttributes: e }) {
1775
- return /* @__PURE__ */ de("blockquote", {
1783
+ return /* @__PURE__ */ fe("blockquote", {
1776
1784
  ...b(this.options.HTMLAttributes, e),
1777
- children: /* @__PURE__ */ de("slot", {})
1785
+ children: /* @__PURE__ */ fe("slot", {})
1778
1786
  });
1779
1787
  },
1780
1788
  parseMarkdown: (e, t) => {
@@ -1799,16 +1807,16 @@ var xt = (e, t) => {
1799
1807
  addKeyboardShortcuts() {
1800
1808
  return {
1801
1809
  "Mod-Shift-b": () => this.editor.commands.toggleBlockquote(),
1802
- Backspace: () => xt(this.editor, this.type)
1810
+ Backspace: () => Et(this.editor, this.type)
1803
1811
  };
1804
1812
  },
1805
1813
  addInputRules() {
1806
1814
  return [v({
1807
- find: St,
1815
+ find: Dt,
1808
1816
  type: this.type
1809
1817
  })];
1810
1818
  }
1811
- }), wt = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Tt = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Et = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Dt = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Ot = _.create({
1819
+ }), kt = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, At = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, jt = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, Mt = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Nt = ee.create({
1812
1820
  name: "bold",
1813
1821
  addOptions() {
1814
1822
  return { HTMLAttributes: {} };
@@ -1831,9 +1839,9 @@ var xt = (e, t) => {
1831
1839
  ];
1832
1840
  },
1833
1841
  renderHTML({ HTMLAttributes: e }) {
1834
- return /* @__PURE__ */ de("strong", {
1842
+ return /* @__PURE__ */ fe("strong", {
1835
1843
  ...b(this.options.HTMLAttributes, e),
1836
- children: /* @__PURE__ */ de("slot", {})
1844
+ children: /* @__PURE__ */ fe("slot", {})
1837
1845
  });
1838
1846
  },
1839
1847
  markdownTokenName: "strong",
@@ -1858,30 +1866,30 @@ var xt = (e, t) => {
1858
1866
  },
1859
1867
  addInputRules() {
1860
1868
  return [u({
1861
- find: wt,
1869
+ find: kt,
1862
1870
  type: this.type
1863
1871
  }), u({
1864
- find: Et,
1872
+ find: jt,
1865
1873
  type: this.type
1866
1874
  })];
1867
1875
  },
1868
1876
  addPasteRules() {
1869
1877
  return [d({
1870
- find: Tt,
1878
+ find: At,
1871
1879
  type: this.type
1872
1880
  }), d({
1873
- find: Dt,
1881
+ find: Mt,
1874
1882
  type: this.type
1875
1883
  })];
1876
1884
  }
1877
- }), kt = (e) => {
1885
+ }), Pt = (e) => {
1878
1886
  let t = /`([^`]+)`(?!`)$/.exec(e);
1879
1887
  return !t || t.index > 0 && e[t.index - 1] === "`" ? null : {
1880
1888
  index: t.index,
1881
1889
  text: t[0],
1882
1890
  replaceWith: t[1]
1883
1891
  };
1884
- }, At = (e) => {
1892
+ }, Ft = (e) => {
1885
1893
  let t = /`([^`]+)`(?!`)/g, n = [], r;
1886
1894
  for (; (r = t.exec(e)) !== null;) r.index > 0 && e[r.index - 1] === "`" || n.push({
1887
1895
  index: r.index,
@@ -1889,7 +1897,7 @@ var xt = (e, t) => {
1889
1897
  replaceWith: r[1]
1890
1898
  });
1891
1899
  return n;
1892
- }, jt = _.create({
1900
+ }, It = ee.create({
1893
1901
  name: "code",
1894
1902
  addOptions() {
1895
1903
  return { HTMLAttributes: {} };
@@ -1925,17 +1933,17 @@ var xt = (e, t) => {
1925
1933
  },
1926
1934
  addInputRules() {
1927
1935
  return [u({
1928
- find: kt,
1936
+ find: Pt,
1929
1937
  type: this.type
1930
1938
  })];
1931
1939
  },
1932
1940
  addPasteRules() {
1933
1941
  return [d({
1934
- find: At,
1942
+ find: Ft,
1935
1943
  type: this.type
1936
1944
  })];
1937
1945
  }
1938
- }), Mt = 4, Nt = /^```([a-z]+)?[\s\n]$/, Pt = /^~~~([a-z]+)?[\s\n]$/, Ft = x.create({
1946
+ }), Lt = 4, Rt = /^```([a-z]+)?[\s\n]$/, zt = /^~~~([a-z]+)?[\s\n]$/, Bt = x.create({
1939
1947
  name: "codeBlock",
1940
1948
  addOptions() {
1941
1949
  return {
@@ -1944,7 +1952,7 @@ var xt = (e, t) => {
1944
1952
  exitOnArrowDown: !0,
1945
1953
  defaultLanguage: null,
1946
1954
  enableTabIndentation: !1,
1947
- tabSize: Mt,
1955
+ tabSize: Lt,
1948
1956
  HTMLAttributes: {}
1949
1957
  };
1950
1958
  },
@@ -2007,7 +2015,7 @@ var xt = (e, t) => {
2007
2015
  },
2008
2016
  Tab: ({ editor: e }) => {
2009
2017
  if (!this.options.enableTabIndentation) return !1;
2010
- let t = this.options.tabSize ?? Mt, { state: n } = e, { selection: r } = n, { $from: i, empty: a } = r;
2018
+ let t = this.options.tabSize ?? Lt, { state: n } = e, { selection: r } = n, { $from: i, empty: a } = r;
2011
2019
  if (i.parent.type !== this.type) return !1;
2012
2020
  let o = " ".repeat(t);
2013
2021
  return a ? e.commands.insertContent(o) : e.commands.command(({ tr: e }) => {
@@ -2017,7 +2025,7 @@ var xt = (e, t) => {
2017
2025
  },
2018
2026
  "Shift-Tab": ({ editor: e }) => {
2019
2027
  if (!this.options.enableTabIndentation) return !1;
2020
- let t = this.options.tabSize ?? Mt, { state: n } = e, { selection: r } = n, { $from: i, empty: a } = r;
2028
+ let t = this.options.tabSize ?? Lt, { state: n } = e, { selection: r } = n, { $from: i, empty: a } = r;
2021
2029
  return i.parent.type === this.type ? a ? e.commands.command(({ tr: e }) => {
2022
2030
  let { pos: r } = i, a = i.start(), o = i.end(), s = n.doc.textBetween(a, o, "\n", "\n").split("\n"), c = 0, l = 0, u = r - a;
2023
2031
  for (let e = 0; e < s.length; e += 1) {
@@ -2057,12 +2065,12 @@ var xt = (e, t) => {
2057
2065
  };
2058
2066
  },
2059
2067
  addInputRules() {
2060
- return [re({
2061
- find: Nt,
2068
+ return [ie({
2069
+ find: Rt,
2062
2070
  type: this.type,
2063
2071
  getAttributes: (e) => ({ language: e[1] })
2064
- }), re({
2065
- find: Pt,
2072
+ }), ie({
2073
+ find: zt,
2066
2074
  type: this.type,
2067
2075
  getAttributes: (e) => ({ language: e[1] })
2068
2076
  })];
@@ -2079,12 +2087,12 @@ var xt = (e, t) => {
2079
2087
  } }
2080
2088
  })];
2081
2089
  }
2082
- }), It = x.create({
2090
+ }), Vt = x.create({
2083
2091
  name: "doc",
2084
2092
  topNode: !0,
2085
2093
  content: "block+",
2086
2094
  renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n\n") : ""
2087
- }), Lt = x.create({
2095
+ }), Ht = x.create({
2088
2096
  name: "hardBreak",
2089
2097
  markdownTokenName: "br",
2090
2098
  addOptions() {
@@ -2128,7 +2136,7 @@ var xt = (e, t) => {
2128
2136
  "Shift-Enter": () => this.editor.commands.setHardBreak()
2129
2137
  };
2130
2138
  }
2131
- }), Rt = x.create({
2139
+ }), Ut = x.create({
2132
2140
  name: "heading",
2133
2141
  addOptions() {
2134
2142
  return {
@@ -2183,13 +2191,13 @@ var xt = (e, t) => {
2183
2191
  }), {});
2184
2192
  },
2185
2193
  addInputRules() {
2186
- return this.options.levels.map((e) => re({
2194
+ return this.options.levels.map((e) => ie({
2187
2195
  find: RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),
2188
2196
  type: this.type,
2189
2197
  getAttributes: { level: e }
2190
2198
  }));
2191
2199
  }
2192
- }), zt = x.create({
2200
+ }), Wt = x.create({
2193
2201
  name: "horizontalRule",
2194
2202
  addOptions() {
2195
2203
  return {
@@ -2209,12 +2217,12 @@ var xt = (e, t) => {
2209
2217
  renderMarkdown: () => "---",
2210
2218
  addCommands() {
2211
2219
  return { setHorizontalRule: () => ({ chain: e, state: t }) => {
2212
- if (!ce(t, t.schema.nodes[this.name])) return !1;
2220
+ if (!le(t, t.schema.nodes[this.name])) return !1;
2213
2221
  let { selection: n } = t, { $to: r } = n, i = e();
2214
2222
  return s(n) ? i.insertContentAt(r.pos, { type: this.name }) : i.insertContent({ type: this.name }), i.command(({ state: e, tr: t, dispatch: n }) => {
2215
2223
  if (n) {
2216
2224
  let { $to: n } = t.selection, r = n.end();
2217
- if (n.nodeAfter) n.nodeAfter.isTextblock ? t.setSelection(C.create(t.doc, n.pos + 1)) : n.nodeAfter.isBlock ? t.setSelection(g.create(t.doc, n.pos)) : t.setSelection(C.create(t.doc, n.pos));
2225
+ if (n.nodeAfter) n.nodeAfter.isTextblock ? t.setSelection(C.create(t.doc, n.pos + 1)) : n.nodeAfter.isBlock ? t.setSelection(_.create(t.doc, n.pos)) : t.setSelection(C.create(t.doc, n.pos));
2218
2226
  else {
2219
2227
  let i = (e.schema.nodes[this.options.nextNodeType] || n.parent.type.contentMatch.defaultType)?.create();
2220
2228
  i && (t.insert(r, i), t.setSelection(C.create(t.doc, r + 1)));
@@ -2231,7 +2239,7 @@ var xt = (e, t) => {
2231
2239
  type: this.type
2232
2240
  })];
2233
2241
  }
2234
- }), Bt = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Vt = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, Ht = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Ut = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Wt = _.create({
2242
+ }), Gt = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Kt = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, qt = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Jt = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Yt = ee.create({
2235
2243
  name: "italic",
2236
2244
  addOptions() {
2237
2245
  return { HTMLAttributes: {} };
@@ -2279,28 +2287,28 @@ var xt = (e, t) => {
2279
2287
  },
2280
2288
  addInputRules() {
2281
2289
  return [u({
2282
- find: Bt,
2290
+ find: Gt,
2283
2291
  type: this.type
2284
2292
  }), u({
2285
- find: Ht,
2293
+ find: qt,
2286
2294
  type: this.type
2287
2295
  })];
2288
2296
  },
2289
2297
  addPasteRules() {
2290
2298
  return [d({
2291
- find: Vt,
2299
+ find: Kt,
2292
2300
  type: this.type
2293
2301
  }), d({
2294
- find: Ut,
2302
+ find: Jt,
2295
2303
  type: this.type
2296
2304
  })];
2297
2305
  }
2298
- }), Gt = Object.defineProperty, Kt = (e, t) => {
2299
- for (var n in t) Gt(e, n, {
2306
+ }), Xt = Object.defineProperty, Zt = (e, t) => {
2307
+ for (var n in t) Xt(e, n, {
2300
2308
  get: t[n],
2301
2309
  enumerable: !0
2302
2310
  });
2303
- }, qt = "listItem", Jt = "textStyle", Yt = /^\s*([-+*])\s$/, Xt = x.create({
2311
+ }, Qt = "listItem", $t = "textStyle", en = /^\s*([-+*])\s$/, tn = x.create({
2304
2312
  name: "bulletList",
2305
2313
  addOptions() {
2306
2314
  return {
@@ -2332,26 +2340,26 @@ var xt = (e, t) => {
2332
2340
  renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n") : "",
2333
2341
  markdownOptions: { indentsContent: !0 },
2334
2342
  addCommands() {
2335
- return { toggleBulletList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(qt, this.editor.getAttributes(Jt)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
2343
+ return { toggleBulletList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Qt, this.editor.getAttributes($t)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
2336
2344
  },
2337
2345
  addKeyboardShortcuts() {
2338
2346
  return { "Mod-Shift-8": () => this.editor.commands.toggleBulletList() };
2339
2347
  },
2340
2348
  addInputRules() {
2341
2349
  let e = v({
2342
- find: Yt,
2350
+ find: en,
2343
2351
  type: this.type
2344
2352
  });
2345
2353
  return (this.options.keepMarks || this.options.keepAttributes) && (e = v({
2346
- find: Yt,
2354
+ find: en,
2347
2355
  type: this.type,
2348
2356
  keepMarks: this.options.keepMarks,
2349
2357
  keepAttributes: this.options.keepAttributes,
2350
- getAttributes: () => this.editor.getAttributes(Jt),
2358
+ getAttributes: () => this.editor.getAttributes($t),
2351
2359
  editor: this.editor
2352
2360
  })), [e];
2353
2361
  }
2354
- }), Zt = (e, t, n) => {
2362
+ }), nn = (e, t, n) => {
2355
2363
  let { selection: r } = e;
2356
2364
  if (!r.empty) return null;
2357
2365
  let { $from: i } = r;
@@ -2382,24 +2390,24 @@ var xt = (e, t) => {
2382
2390
  insertPos: i.after(a),
2383
2391
  items: f
2384
2392
  };
2385
- }, Qt = (e, t, r, i) => {
2386
- let a = Zt(e, r, i);
2393
+ }, rn = (e, t, r, i) => {
2394
+ let a = nn(e, r, i);
2387
2395
  if (!a) return !1;
2388
2396
  let { selection: o } = e, { nestedList: s, nestedListPos: c, insertPos: l, items: u } = a, d = e.tr;
2389
2397
  d.delete(c, c + s.nodeSize);
2390
2398
  let f = d.mapping.map(l);
2391
2399
  return d.insert(f, n.from(u)), d.setSelection(o.map(d.doc, d.mapping)), t && t(d), !0;
2392
- }, $t = (e, t, n) => Qt(e.state, e.view.dispatch, t, n), en = (e, t) => y.create({
2400
+ }, an = (e, t, n) => rn(e.state, e.view.dispatch, t, n), on = (e, t) => y.create({
2393
2401
  name: `${e}BranchingDeleteKeymap`,
2394
2402
  priority: 101,
2395
2403
  addKeyboardShortcuts() {
2396
- let n = () => $t(this.editor, e, t);
2404
+ let n = () => an(this.editor, e, t);
2397
2405
  return {
2398
2406
  Delete: n,
2399
2407
  "Mod-Delete": n
2400
2408
  };
2401
2409
  }
2402
- }), tn = [
2410
+ }), sn = [
2403
2411
  [1e3, "m"],
2404
2412
  [900, "cm"],
2405
2413
  [500, "d"],
@@ -2413,20 +2421,20 @@ var xt = (e, t) => {
2413
2421
  [5, "v"],
2414
2422
  [4, "iv"],
2415
2423
  [1, "i"]
2416
- ], K = "abcdefghijklmnopqrstuvwxyz", nn = String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;
2417
- function rn(e) {
2424
+ ], W = "abcdefghijklmnopqrstuvwxyz", cn = String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;
2425
+ function ln(e) {
2418
2426
  let t = e, n = "";
2419
- for (let [e, r] of tn) for (; t >= e;) n += r, t -= e;
2427
+ for (let [e, r] of sn) for (; t >= e;) n += r, t -= e;
2420
2428
  return n;
2421
2429
  }
2422
- function an(e) {
2423
- return rn(e).toUpperCase();
2430
+ function un(e) {
2431
+ return ln(e).toUpperCase();
2424
2432
  }
2425
- function on(e) {
2433
+ function dn(e) {
2426
2434
  let t = e.toLowerCase(), n = 0, r = 0;
2427
2435
  for (; n < t.length;) {
2428
2436
  let e = !1;
2429
- for (let [i, a] of tn) if (t.startsWith(a, n)) {
2437
+ for (let [i, a] of sn) if (t.startsWith(a, n)) {
2430
2438
  r += i, n += a.length, e = !0;
2431
2439
  break;
2432
2440
  }
@@ -2434,12 +2442,12 @@ function on(e) {
2434
2442
  }
2435
2443
  return r;
2436
2444
  }
2437
- function sn(e) {
2445
+ function fn(e) {
2438
2446
  if (!/^[ivxlcdmIVXLCDM]+$/.test(e)) return !1;
2439
- let t = on(e);
2440
- return t <= 0 ? !1 : (e === e.toLowerCase() ? rn(t) : an(t)) === e;
2447
+ let t = dn(e);
2448
+ return t <= 0 ? !1 : (e === e.toLowerCase() ? ln(t) : un(t)) === e;
2441
2449
  }
2442
- function cn(e) {
2450
+ function pn(e) {
2443
2451
  let t = e.toLowerCase();
2444
2452
  if (t.length === 1) return t.charCodeAt(0) - 97 + 1;
2445
2453
  if (t.length === 2) {
@@ -2448,82 +2456,82 @@ function cn(e) {
2448
2456
  }
2449
2457
  return 0;
2450
2458
  }
2451
- function ln(e) {
2452
- if (e <= 26) return K[e - 1];
2459
+ function mn(e) {
2460
+ if (e <= 26) return W[e - 1];
2453
2461
  let t = Math.floor((e - 1) / 26) - 1, n = (e - 1) % 26;
2454
- return t < 0 ? K[n] : K[t] + K[n];
2462
+ return t < 0 ? W[n] : W[t] + W[n];
2455
2463
  }
2456
- function un(e) {
2464
+ function hn(e) {
2457
2465
  if (!(!e || /^\d+$/.test(e))) {
2458
- if (sn(e)) return e === e.toLowerCase() ? "i" : "I";
2466
+ if (fn(e)) return e === e.toLowerCase() ? "i" : "I";
2459
2467
  if (/^[a-z]{1,2}$/.test(e)) return "a";
2460
2468
  if (/^[A-Z]{1,2}$/.test(e)) return "A";
2461
2469
  }
2462
2470
  }
2463
- function dn(e) {
2471
+ function gn(e) {
2464
2472
  if (/^\d+$/.test(e)) return parseInt(e, 10);
2465
- let t = un(e);
2466
- if (t === "i" || t === "I") return on(e);
2473
+ let t = hn(e);
2474
+ if (t === "i" || t === "I") return dn(e);
2467
2475
  if (t === "a" || t === "A") {
2468
- let t = cn(e);
2476
+ let t = pn(e);
2469
2477
  return t > 0 ? t : 1;
2470
2478
  }
2471
2479
  let n = parseInt(e, 10);
2472
2480
  return Number.isNaN(n) ? 1 : n;
2473
2481
  }
2474
- function fn(e, t) {
2482
+ function _n(e, t) {
2475
2483
  if (e === "numeric") return String(t);
2476
2484
  switch (e) {
2477
- case "a": return ln(t);
2478
- case "A": return ln(t).toUpperCase();
2479
- case "i": return rn(t);
2480
- case "I": return an(t);
2485
+ case "a": return mn(t);
2486
+ case "A": return mn(t).toUpperCase();
2487
+ case "i": return ln(t);
2488
+ case "I": return un(t);
2481
2489
  default: return String(t);
2482
2490
  }
2483
2491
  }
2484
- function pn(e) {
2492
+ function vn(e) {
2485
2493
  if (e.length === 0) return !1;
2486
- let t = un(e[0]) ?? "numeric", n = dn(e[0]);
2494
+ let t = hn(e[0]) ?? "numeric", n = gn(e[0]);
2487
2495
  if (n < 1) return !1;
2488
2496
  for (let r = 0; r < e.length; r++) {
2489
- let i = fn(t, n + r);
2497
+ let i = _n(t, n + r);
2490
2498
  if (e[r] !== i) return !1;
2491
2499
  }
2492
2500
  return !0;
2493
2501
  }
2494
- function mn(e) {
2502
+ function yn(e) {
2495
2503
  return {
2496
- type: un(e),
2497
- start: dn(e)
2504
+ type: hn(e),
2505
+ start: gn(e)
2498
2506
  };
2499
2507
  }
2500
- function hn(e) {
2501
- let { type: t, start: n } = mn(e), r = {};
2508
+ function bn(e) {
2509
+ let { type: t, start: n } = yn(e), r = {};
2502
2510
  return t && (r.type = t), n !== 1 && (r.start = n), r;
2503
2511
  }
2504
- function gn(e, t, n = ". ") {
2512
+ function xn(e, t, n = ". ") {
2505
2513
  let r = t + 1;
2506
2514
  if (!e || e === "1") return `${r}${n}`;
2507
2515
  switch (e) {
2508
- case "a": return `${ln(r)}${n}`;
2509
- case "A": return `${ln(r).toUpperCase()}${n}`;
2510
- case "i": return `${rn(r)}${n}`;
2511
- case "I": return `${an(r)}${n}`;
2516
+ case "a": return `${mn(r)}${n}`;
2517
+ case "A": return `${mn(r).toUpperCase()}${n}`;
2518
+ case "i": return `${ln(r)}${n}`;
2519
+ case "I": return `${un(r)}${n}`;
2512
2520
  default: return `${r}${n}`;
2513
2521
  }
2514
2522
  }
2515
- function _n(e) {
2523
+ function Sn(e) {
2516
2524
  let t = e.tokens?.[0];
2517
2525
  return !!(e.text && e.tokens?.length === 1 && t?.type === "list" && t.ordered && t.raw === e.text);
2518
2526
  }
2519
- function vn(e, t) {
2527
+ function Cn(e, t) {
2520
2528
  return t.tokenizeInline ? t.parseInline(t.tokenizeInline(e)) : t.parseInline([{
2521
2529
  type: "text",
2522
2530
  raw: e,
2523
2531
  text: e
2524
2532
  }]);
2525
2533
  }
2526
- var yn = x.create({
2534
+ var wn = x.create({
2527
2535
  name: "listItem",
2528
2536
  addOptions() {
2529
2537
  return {
@@ -2549,11 +2557,11 @@ var yn = x.create({
2549
2557
  if (e.type !== "list_item") return [];
2550
2558
  let n = t.parseBlockChildren ?? t.parseChildren, r = [];
2551
2559
  if (e.tokens && e.tokens.length > 0) {
2552
- if (_n(e)) return {
2560
+ if (Sn(e)) return {
2553
2561
  type: "listItem",
2554
2562
  content: [{
2555
2563
  type: "paragraph",
2556
- content: vn(e.text || "", t)
2564
+ content: Cn(e.text || "", t)
2557
2565
  }]
2558
2566
  };
2559
2567
  if (e.tokens.some((e) => e.type === "paragraph")) r = n(e.tokens);
@@ -2578,16 +2586,16 @@ var yn = x.create({
2578
2586
  content: r
2579
2587
  };
2580
2588
  },
2581
- renderMarkdown: (e, t, n) => te(e, t, (e) => {
2589
+ renderMarkdown: (e, t, n) => ne(e, t, (e) => {
2582
2590
  if (e.parentType === "bulletList") return "- ";
2583
2591
  if (e.parentType === "orderedList") {
2584
2592
  let t = e.meta?.parentAttrs?.start || 1;
2585
- return gn(e.meta?.parentAttrs?.type, t - 1 + (e.index || 0), ". ");
2593
+ return xn(e.meta?.parentAttrs?.type, t - 1 + (e.index || 0), ". ");
2586
2594
  }
2587
2595
  return "- ";
2588
2596
  }, n),
2589
2597
  addExtensions() {
2590
- return [en(this.name, [this.options.bulletListTypeName, this.options.orderedListTypeName])];
2598
+ return [on(this.name, [this.options.bulletListTypeName, this.options.orderedListTypeName])];
2591
2599
  },
2592
2600
  addKeyboardShortcuts() {
2593
2601
  return {
@@ -2597,37 +2605,37 @@ var yn = x.create({
2597
2605
  };
2598
2606
  }
2599
2607
  });
2600
- Kt({}, {
2601
- findListItemPos: () => bn,
2602
- getNextListDepth: () => xn,
2603
- handleBackspace: () => Cn,
2604
- handleDelete: () => En,
2605
- hasListBefore: () => Sn,
2606
- hasListItemAfter: () => Dn,
2607
- hasListItemBefore: () => On,
2608
- listItemHasSubList: () => kn,
2609
- nextListIsDeeper: () => wn,
2610
- nextListIsHigher: () => Tn
2608
+ Zt({}, {
2609
+ findListItemPos: () => Tn,
2610
+ getNextListDepth: () => En,
2611
+ handleBackspace: () => On,
2612
+ handleDelete: () => jn,
2613
+ hasListBefore: () => Dn,
2614
+ hasListItemAfter: () => Mn,
2615
+ hasListItemBefore: () => Nn,
2616
+ listItemHasSubList: () => Pn,
2617
+ nextListIsDeeper: () => kn,
2618
+ nextListIsHigher: () => An
2611
2619
  });
2612
- var bn = (e, t) => {
2613
- let { $from: n } = t.selection, r = h(e, t.schema), i = null, a = n.depth, o = n.pos, s = null;
2620
+ var Tn = (e, t) => {
2621
+ let { $from: n } = t.selection, r = g(e, t.schema), i = null, a = n.depth, o = n.pos, s = null;
2614
2622
  for (; a > 0 && s === null;) i = n.node(a), i.type === r ? s = a : (--a, --o);
2615
2623
  return s === null ? null : {
2616
2624
  $pos: t.doc.resolve(o),
2617
2625
  depth: s
2618
2626
  };
2619
- }, xn = (e, t) => {
2620
- let n = bn(e, t);
2627
+ }, En = (e, t) => {
2628
+ let n = Tn(e, t);
2621
2629
  if (!n) return !1;
2622
- let [, r] = ae(t, e, n.$pos.pos + 4);
2630
+ let [, r] = oe(t, e, n.$pos.pos + 4);
2623
2631
  return r;
2624
- }, Sn = (e, t, n) => {
2632
+ }, Dn = (e, t, n) => {
2625
2633
  let { $anchor: r } = e.selection, i = Math.max(0, r.pos - 2), a = e.doc.resolve(i).node();
2626
2634
  return !(!a || !n.includes(a.type.name));
2627
- }, Cn = (e, t, n) => {
2635
+ }, On = (e, t, n) => {
2628
2636
  if (e.commands.undoInputRule()) return !0;
2629
2637
  if (e.state.selection.from !== e.state.selection.to) return !1;
2630
- if (!i(e.state, t) && Sn(e.state, t, n)) {
2638
+ if (!i(e.state, t) && Dn(e.state, t, n)) {
2631
2639
  let { $anchor: n } = e.state.selection, r = e.state.doc.resolve(n.before() - 1), i = [];
2632
2640
  r.node().descendants((e, n) => {
2633
2641
  e.type.name === t && i.push({
@@ -2643,30 +2651,30 @@ var bn = (e, t) => {
2643
2651
  to: n.end() + 1
2644
2652
  }, o.end()).joinForward().run();
2645
2653
  }
2646
- return !i(e.state, t) || !se(e.state) ? !1 : e.chain().liftListItem(t).run();
2647
- }, wn = (e, t) => {
2648
- let n = xn(e, t), r = bn(e, t);
2654
+ return !i(e.state, t) || !ce(e.state) ? !1 : e.chain().liftListItem(t).run();
2655
+ }, kn = (e, t) => {
2656
+ let n = En(e, t), r = Tn(e, t);
2649
2657
  return !r || !n ? !1 : n > r.depth;
2650
- }, Tn = (e, t) => {
2651
- let n = xn(e, t), r = bn(e, t);
2658
+ }, An = (e, t) => {
2659
+ let n = En(e, t), r = Tn(e, t);
2652
2660
  return !r || !n ? !1 : n < r.depth;
2653
- }, En = (e, n) => {
2661
+ }, jn = (e, n) => {
2654
2662
  if (!i(e.state, n) || !t(e.state, n)) return !1;
2655
2663
  let { selection: r } = e.state, { $from: a, $to: o } = r;
2656
- return !r.empty && a.sameParent(o) ? !1 : wn(n, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(n).joinBackward().run() : Tn(n, e.state) ? e.chain().joinForward().joinBackward().run() : e.commands.joinItemForward();
2657
- }, Dn = (e, t) => {
2664
+ return !r.empty && a.sameParent(o) ? !1 : kn(n, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(n).joinBackward().run() : An(n, e.state) ? e.chain().joinForward().joinBackward().run() : e.commands.joinItemForward();
2665
+ }, Mn = (e, t) => {
2658
2666
  let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - n.parentOffset - 2);
2659
2667
  return !(r.index() === r.parent.childCount - 1 || r.nodeAfter?.type.name !== e);
2660
- }, On = (e, t) => {
2668
+ }, Nn = (e, t) => {
2661
2669
  let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - 2);
2662
2670
  return !(r.index() === 0 || r.nodeBefore?.type.name !== e);
2663
- }, kn = (e, t, n) => {
2671
+ }, Pn = (e, t, n) => {
2664
2672
  if (!n) return !1;
2665
- let r = h(e, t.schema), i = !1;
2673
+ let r = g(e, t.schema), i = !1;
2666
2674
  return n.descendants((e) => {
2667
2675
  e.type === r && (i = !0);
2668
2676
  }), i;
2669
- }, An = y.create({
2677
+ }, Fn = y.create({
2670
2678
  name: "listKeymap",
2671
2679
  addOptions() {
2672
2680
  return { listTypes: [{
@@ -2682,38 +2690,46 @@ var bn = (e, t) => {
2682
2690
  Delete: ({ editor: e }) => {
2683
2691
  let t = !1;
2684
2692
  return this.options.listTypes.forEach(({ itemName: n }) => {
2685
- e.state.schema.nodes[n] !== void 0 && En(e, n) && (t = !0);
2693
+ e.state.schema.nodes[n] !== void 0 && jn(e, n) && (t = !0);
2686
2694
  }), t;
2687
2695
  },
2688
2696
  "Mod-Delete": ({ editor: e }) => {
2689
2697
  let t = !1;
2690
2698
  return this.options.listTypes.forEach(({ itemName: n }) => {
2691
- e.state.schema.nodes[n] !== void 0 && En(e, n) && (t = !0);
2699
+ e.state.schema.nodes[n] !== void 0 && jn(e, n) && (t = !0);
2692
2700
  }), t;
2693
2701
  },
2694
2702
  Backspace: ({ editor: e }) => {
2695
2703
  let t = !1;
2696
2704
  return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
2697
- e.state.schema.nodes[n] !== void 0 && Cn(e, n, r) && (t = !0);
2705
+ e.state.schema.nodes[n] !== void 0 && On(e, n, r) && (t = !0);
2698
2706
  }), t;
2699
2707
  },
2700
2708
  "Mod-Backspace": ({ editor: e }) => {
2701
2709
  let t = !1;
2702
2710
  return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
2703
- e.state.schema.nodes[n] !== void 0 && Cn(e, n, r) && (t = !0);
2711
+ e.state.schema.nodes[n] !== void 0 && On(e, n, r) && (t = !0);
2704
2712
  }), t;
2705
2713
  }
2706
2714
  };
2707
2715
  }
2708
- }), jn = RegExp(`^(\\s*)(${nn})([.)])\\s+(.*)$`), Mn = RegExp(`^(\\s*)(${nn})([.)])\\s+`), Nn = /^\s/;
2709
- function Pn(e) {
2710
- return jn.test(e.trimStart());
2716
+ }), In = RegExp(`^(\\s*)(${cn})([.)])\\s+(.*)$`), Ln = RegExp(`^(\\s*)(${cn})([.)])\\s+`), Rn = /^\s/, G = {
2717
+ heading: /^#{1,6}(?:\s|$)/,
2718
+ bulletItem: /^[-+*]\s+/,
2719
+ codeFence: /^(?:```|~~~)/,
2720
+ thematicBreak: /^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/
2721
+ };
2722
+ function zn(e) {
2723
+ return In.test(e.trimStart());
2711
2724
  }
2712
- function Fn(e) {
2725
+ function Bn(e) {
2713
2726
  let t = e.trimStart();
2714
- return /^[-+*]\s+/.test(t) || Pn(t) || /^>\s?/.test(t) || /^```/.test(t) || /^~~~/.test(t);
2727
+ return G.bulletItem.test(t) || zn(t) || G.heading.test(t) || G.thematicBreak.test(t) && !t.startsWith("-") || /^>\s?/.test(t) || G.codeFence.test(t);
2715
2728
  }
2716
- function In(e) {
2729
+ function Vn(e) {
2730
+ return Object.values(G).some((t) => t.test(e));
2731
+ }
2732
+ function Hn(e) {
2717
2733
  let t = [], n = [], r = !1;
2718
2734
  return e.forEach((e) => {
2719
2735
  if (r) {
@@ -2724,7 +2740,7 @@ function In(e) {
2724
2740
  r = !0, n.push(e);
2725
2741
  return;
2726
2742
  }
2727
- if (t.length > 0 && Fn(e)) {
2743
+ if (t.length > 0 && Bn(e)) {
2728
2744
  r = !0, n.push(e);
2729
2745
  return;
2730
2746
  }
@@ -2734,21 +2750,21 @@ function In(e) {
2734
2750
  blockLines: n
2735
2751
  };
2736
2752
  }
2737
- function Ln(e) {
2753
+ function Un(e) {
2738
2754
  let t = [], n = 0, r = 0;
2739
2755
  for (; n < e.length;) {
2740
- let i = e[n], a = i.match(jn);
2756
+ let i = e[n], a = i.match(In);
2741
2757
  if (!a) break;
2742
- let [, o, s, c, l] = a, u = o.length, d = parseInt(s, 10), f = isNaN(d) ? un(s) : void 0, p = isNaN(d) ? dn(s) : d, m = [l], h = n + 1, g = [i], _ = !1;
2758
+ let [, o, s, c, l] = a, u = o.length, d = parseInt(s, 10), f = isNaN(d) ? hn(s) : void 0, p = isNaN(d) ? gn(s) : d, m = [l], h = n + 1, g = [i], _ = !1;
2743
2759
  for (; h < e.length;) {
2744
2760
  let t = e[h];
2745
- if (t.match(jn)) break;
2761
+ if (t.match(In)) break;
2746
2762
  if (t.trim() === "") g.push(t), m.push(""), _ = !0, h += 1;
2747
- else if (t.match(Nn)) {
2763
+ else if (t.match(Rn)) {
2748
2764
  let e = t.length - t.trimStart().length, n = u + s.length + 1;
2749
2765
  g.push(t), m.push(t.slice(Math.min(e, n))), h += 1;
2750
2766
  } else {
2751
- if (_) break;
2767
+ if (_ || Vn(t)) break;
2752
2768
  g.push(t), m.push(t), h += 1;
2753
2769
  }
2754
2770
  }
@@ -2763,22 +2779,22 @@ function Ln(e) {
2763
2779
  }
2764
2780
  return [t, r];
2765
2781
  }
2766
- var Rn = RegExp(`^(${nn})([.)])\\s+(.+)$`);
2767
- function zn(e) {
2782
+ var Wn = RegExp(`^(${cn})([.)])\\s+(.+)$`);
2783
+ function Gn(e) {
2768
2784
  let t = e.split("\n").filter((e) => e.trim().length > 0);
2769
2785
  if (t.length === 0) return null;
2770
2786
  let n = [];
2771
2787
  for (let e of t) {
2772
- let t = e.trim().match(Rn);
2788
+ let t = e.trim().match(Wn);
2773
2789
  if (!t) return null;
2774
2790
  n.push({
2775
2791
  marker: t[1],
2776
2792
  content: t[3]
2777
2793
  });
2778
2794
  }
2779
- return pn(n.map((e) => e.marker)) ? {
2795
+ return vn(n.map((e) => e.marker)) ? {
2780
2796
  type: "orderedList",
2781
- attrs: hn(n[0].marker),
2797
+ attrs: bn(n[0].marker),
2782
2798
  content: n.map((e) => ({
2783
2799
  type: "listItem",
2784
2800
  content: [{
@@ -2791,12 +2807,12 @@ function zn(e) {
2791
2807
  }))
2792
2808
  } : null;
2793
2809
  }
2794
- function Bn(e, t, n) {
2810
+ function Kn(e, t, n) {
2795
2811
  let r = [], i = 0;
2796
2812
  for (; i < e.length;) {
2797
2813
  let a = e[i];
2798
2814
  if (a.indent === t) {
2799
- let { paragraphLines: o, blockLines: s } = In(a.contentLines), c = o.join("\n").trim(), l = [];
2815
+ let { paragraphLines: o, blockLines: s } = Hn(a.contentLines), c = o.join("\n").trim(), l = [];
2800
2816
  c && l.push({
2801
2817
  type: "paragraph",
2802
2818
  raw: c,
@@ -2810,7 +2826,7 @@ function Bn(e, t, n) {
2810
2826
  let d = i + 1, f = [];
2811
2827
  for (; d < e.length && e[d].indent > t;) f.push(e[d]), d += 1;
2812
2828
  if (f.length > 0) {
2813
- let e = Bn(f, Math.min(...f.map((e) => e.indent)), n);
2829
+ let e = Kn(f, Math.min(...f.map((e) => e.indent)), n);
2814
2830
  l.push({
2815
2831
  type: "list",
2816
2832
  ordered: !0,
@@ -2829,7 +2845,7 @@ function Bn(e, t, n) {
2829
2845
  }
2830
2846
  return r;
2831
2847
  }
2832
- function Vn(e, t) {
2848
+ function qn(e, t) {
2833
2849
  return e.map((e) => {
2834
2850
  if (e.type !== "list_item") return t.parseChildren([e])[0];
2835
2851
  let n = [];
@@ -2851,8 +2867,8 @@ function Vn(e, t) {
2851
2867
  };
2852
2868
  });
2853
2869
  }
2854
- var Hn = "listItem", Un = "textStyle", Wn = /^(\d+)\.\s$/;
2855
- function Gn(e) {
2870
+ var Jn = "listItem", Yn = "textStyle", Xn = /^(\d+)\.\s$/;
2871
+ function Zn(e) {
2856
2872
  let t = e.match(/list-style-type\s*:\s*([^;]+)/i);
2857
2873
  if (!t) return null;
2858
2874
  switch (t[1].trim().toLowerCase()) {
@@ -2865,7 +2881,7 @@ function Gn(e) {
2865
2881
  default: return null;
2866
2882
  }
2867
2883
  }
2868
- var Kn = x.create({
2884
+ var Qn = x.create({
2869
2885
  name: "orderedList",
2870
2886
  addOptions() {
2871
2887
  return {
@@ -2892,14 +2908,14 @@ var Kn = x.create({
2892
2908
  if (t) return t;
2893
2909
  let n = e.getAttribute("style");
2894
2910
  if (n) {
2895
- let e = Gn(n);
2911
+ let e = Zn(n);
2896
2912
  if (e) return e;
2897
2913
  }
2898
2914
  let r = e.querySelector("li");
2899
2915
  if (r) {
2900
2916
  let e = r.getAttribute("style");
2901
2917
  if (e) {
2902
- let t = Gn(e);
2918
+ let t = Zn(e);
2903
2919
  if (t) return t;
2904
2920
  }
2905
2921
  }
@@ -2922,7 +2938,7 @@ var Kn = x.create({
2922
2938
  markdownTokenName: "list",
2923
2939
  parseMarkdown: (e, t) => {
2924
2940
  if (e.type !== "list" || !e.ordered) return [];
2925
- let n = e.start || 1, r = e.typeMarker, i = e.items ? Vn(e.items, t) : [], a = {};
2941
+ let n = e.start || 1, r = e.typeMarker, i = e.items ? qn(e.items, t) : [], a = {};
2926
2942
  return n !== 1 && (a.start = n), r && (a.type = r), Object.keys(a).length > 0 ? {
2927
2943
  type: "orderedList",
2928
2944
  attrs: a,
@@ -2937,13 +2953,13 @@ var Kn = x.create({
2937
2953
  name: "orderedList",
2938
2954
  level: "block",
2939
2955
  start: (e) => {
2940
- let t = e.match(Mn)?.index;
2956
+ let t = e.match(Ln)?.index;
2941
2957
  return t === void 0 ? -1 : t;
2942
2958
  },
2943
2959
  tokenize: (e, t, n) => {
2944
- let r = e.split("\n"), [i, a] = Ln(r);
2960
+ let r = e.split("\n"), [i, a] = Un(r);
2945
2961
  if (i.length === 0) return;
2946
- let o = Bn(i, 0, n);
2962
+ let o = Kn(i, i[0].indent, n);
2947
2963
  if (o.length !== 0) return {
2948
2964
  type: "list",
2949
2965
  ordered: !0,
@@ -2956,7 +2972,7 @@ var Kn = x.create({
2956
2972
  },
2957
2973
  markdownOptions: { indentsContent: !0 },
2958
2974
  addCommands() {
2959
- return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Hn, this.editor.getAttributes(Un)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
2975
+ return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Jn, this.editor.getAttributes(Yn)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
2960
2976
  },
2961
2977
  addKeyboardShortcuts() {
2962
2978
  return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
@@ -2966,7 +2982,7 @@ var Kn = x.create({
2966
2982
  if ((t.clipboardData?.getData("text/html"))?.trim()) return !1;
2967
2983
  let n = t.clipboardData?.getData("text/plain");
2968
2984
  if (!n) return !1;
2969
- let r = zn(n);
2985
+ let r = Gn(n);
2970
2986
  if (!r) return !1;
2971
2987
  try {
2972
2988
  let t = e.state.schema.nodeFromJSON(r), n = e.state.tr.replaceSelectionWith(t);
@@ -2978,25 +2994,25 @@ var Kn = x.create({
2978
2994
  },
2979
2995
  addInputRules() {
2980
2996
  let e = (e, t) => (!t.attrs.type || t.attrs.type === "1") && t.childCount + t.attrs.start === +e[1], t = v({
2981
- find: Wn,
2997
+ find: Xn,
2982
2998
  type: this.type,
2983
2999
  getAttributes: (e) => ({ start: +e[1] }),
2984
3000
  joinPredicate: e
2985
3001
  });
2986
3002
  return (this.options.keepMarks || this.options.keepAttributes) && (t = v({
2987
- find: Wn,
3003
+ find: Xn,
2988
3004
  type: this.type,
2989
3005
  keepMarks: this.options.keepMarks,
2990
3006
  keepAttributes: this.options.keepAttributes,
2991
3007
  getAttributes: (e) => ({
2992
3008
  start: +e[1],
2993
- ...this.editor.getAttributes(Un)
3009
+ ...this.editor.getAttributes(Yn)
2994
3010
  }),
2995
3011
  joinPredicate: e,
2996
3012
  editor: this.editor
2997
3013
  })), [t];
2998
3014
  }
2999
- }), qn = /^\s*(\[([( |x])?\])\s$/, Jn = x.create({
3015
+ }), $n = /^\s*(\[([( |x])?\])\s$/, er = x.create({
3000
3016
  name: "taskItem",
3001
3017
  addOptions() {
3002
3018
  return {
@@ -3050,9 +3066,9 @@ var Kn = x.create({
3050
3066
  }
3051
3067
  return t.createNode("taskItem", { checked: e.checked || !1 }, n);
3052
3068
  },
3053
- renderMarkdown: (e, t) => te(e, t, `- [${e.attrs?.checked ? "x" : " "}] `),
3069
+ renderMarkdown: (e, t) => ne(e, t, `- [${e.attrs?.checked ? "x" : " "}] `),
3054
3070
  addExtensions() {
3055
- return this.options.nested ? [en(this.name, [this.options.taskListTypeName])] : [];
3071
+ return this.options.nested ? [on(this.name, [this.options.taskListTypeName])] : [];
3056
3072
  },
3057
3073
  addKeyboardShortcuts() {
3058
3074
  let e = {
@@ -3097,7 +3113,7 @@ var Kn = x.create({
3097
3113
  update: (e) => {
3098
3114
  if (e.type !== this.type) return !1;
3099
3115
  i.dataset.checked = e.attrs.checked, s.checked = e.attrs.checked, l(e);
3100
- let t = r.extensionManager.attributes, n = ie(e, t), a = new Set(Object.keys(n)), o = this.options.HTMLAttributes;
3116
+ let t = r.extensionManager.attributes, n = ae(e, t), a = new Set(Object.keys(n)), o = this.options.HTMLAttributes;
3101
3117
  return u.forEach((e) => {
3102
3118
  a.has(e) || (e in o ? i.setAttribute(e, o[e]) : i.removeAttribute(e));
3103
3119
  }), Object.entries(n).forEach(([e, t]) => {
@@ -3109,12 +3125,12 @@ var Kn = x.create({
3109
3125
  },
3110
3126
  addInputRules() {
3111
3127
  return [v({
3112
- find: qn,
3128
+ find: $n,
3113
3129
  type: this.type,
3114
3130
  getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
3115
3131
  })];
3116
3132
  }
3117
- }), Yn = x.create({
3133
+ }), tr = x.create({
3118
3134
  name: "taskList",
3119
3135
  addOptions() {
3120
3136
  return {
@@ -3150,7 +3166,7 @@ var Kn = x.create({
3150
3166
  },
3151
3167
  tokenize(e, t, n) {
3152
3168
  let r = (e) => {
3153
- let t = ee(e, {
3169
+ let t = te(e, {
3154
3170
  itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
3155
3171
  extractItemData: (e) => ({
3156
3172
  indentLevel: e[1].length,
@@ -3174,7 +3190,7 @@ var Kn = x.create({
3174
3190
  raw: t.raw,
3175
3191
  items: t.items
3176
3192
  }] : n.blockTokens(e);
3177
- }, i = ee(e, {
3193
+ }, i = te(e, {
3178
3194
  itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
3179
3195
  extractItemData: (e) => ({
3180
3196
  indentLevel: e[1].length,
@@ -3212,12 +3228,12 @@ y.create({
3212
3228
  name: "listKit",
3213
3229
  addExtensions() {
3214
3230
  let e = [];
3215
- return this.options.bulletList !== !1 && e.push(Xt.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(yn.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(An.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(Kn.configure(this.options.orderedList)), this.options.taskItem !== !1 && e.push(Jn.configure(this.options.taskItem)), this.options.taskList !== !1 && e.push(Yn.configure(this.options.taskList)), e;
3231
+ return this.options.bulletList !== !1 && e.push(tn.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(wn.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(Fn.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(Qn.configure(this.options.orderedList)), this.options.taskItem !== !1 && e.push(er.configure(this.options.taskItem)), this.options.taskList !== !1 && e.push(tr.configure(this.options.taskList)), e;
3216
3232
  }
3217
3233
  });
3218
3234
  //#endregion
3219
- //#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.27.1_@tiptap+core@3.27.1_@tiptap+pm@3.27.1_/node_modules/@tiptap/extension-paragraph/dist/index.js
3220
- var Xn = "&nbsp;", Zn = "\xA0", Qn = x.create({
3235
+ //#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.27.3_@tiptap+core@3.27.3_@tiptap+pm@3.27.3_/node_modules/@tiptap/extension-paragraph/dist/index.js
3236
+ var nr = "&nbsp;", rr = "\xA0", ir = x.create({
3221
3237
  name: "paragraph",
3222
3238
  priority: 1e3,
3223
3239
  addOptions() {
@@ -3239,14 +3255,14 @@ var Xn = "&nbsp;", Zn = "\xA0", Qn = x.create({
3239
3255
  let n = e.tokens || [];
3240
3256
  if (n.length === 1 && n[0].type === "image") return t.parseChildren([n[0]]);
3241
3257
  let r = t.parseInline(n);
3242
- return n.length === 1 && n[0].type === "text" && (n[0].raw === Xn || n[0].text === Xn || n[0].raw === Zn || n[0].text === Zn) && r.length === 1 && r[0].type === "text" && (r[0].text === Xn || r[0].text === Zn) ? t.createNode("paragraph", void 0, []) : t.createNode("paragraph", void 0, r);
3258
+ return n.length === 1 && n[0].type === "text" && (n[0].raw === nr || n[0].text === nr || n[0].raw === rr || n[0].text === rr) && r.length === 1 && r[0].type === "text" && (r[0].text === nr || r[0].text === rr) ? t.createNode("paragraph", void 0, []) : t.createNode("paragraph", void 0, r);
3243
3259
  },
3244
3260
  renderMarkdown: (e, t, n) => {
3245
3261
  if (!e) return "";
3246
3262
  let r = Array.isArray(e.content) ? e.content : [];
3247
3263
  if (r.length === 0) {
3248
3264
  let e = Array.isArray(n?.previousNode?.content) ? n.previousNode.content : [];
3249
- return n?.previousNode?.type === "paragraph" && e.length === 0 ? Xn : "";
3265
+ return n?.previousNode?.type === "paragraph" && e.length === 0 ? nr : "";
3250
3266
  }
3251
3267
  return t.renderChildren(r);
3252
3268
  },
@@ -3256,7 +3272,7 @@ var Xn = "&nbsp;", Zn = "\xA0", Qn = x.create({
3256
3272
  addKeyboardShortcuts() {
3257
3273
  return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
3258
3274
  }
3259
- }), $n = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, er = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, tr = _.create({
3275
+ }), ar = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, or = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, sr = ee.create({
3260
3276
  name: "strike",
3261
3277
  addOptions() {
3262
3278
  return { HTMLAttributes: {} };
@@ -3295,17 +3311,17 @@ var Xn = "&nbsp;", Zn = "\xA0", Qn = x.create({
3295
3311
  },
3296
3312
  addInputRules() {
3297
3313
  return [u({
3298
- find: $n,
3314
+ find: ar,
3299
3315
  type: this.type
3300
3316
  })];
3301
3317
  },
3302
3318
  addPasteRules() {
3303
3319
  return [d({
3304
- find: er,
3320
+ find: or,
3305
3321
  type: this.type
3306
3322
  })];
3307
3323
  }
3308
- }), nr = x.create({
3324
+ }), cr = x.create({
3309
3325
  name: "text",
3310
3326
  group: "inline",
3311
3327
  parseMarkdown: (e) => ({
@@ -3316,12 +3332,12 @@ var Xn = "&nbsp;", Zn = "\xA0", Qn = x.create({
3316
3332
  });
3317
3333
  //#endregion
3318
3334
  //#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
3319
- function rr(e = {}) {
3335
+ function lr(e = {}) {
3320
3336
  return new w({ view(t) {
3321
- return new ir(t, e);
3337
+ return new ur(t, e);
3322
3338
  } });
3323
3339
  }
3324
- var ir = class {
3340
+ var ur = class {
3325
3341
  constructor(e, t) {
3326
3342
  this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
3327
3343
  "dragover",
@@ -3412,7 +3428,7 @@ var ir = class {
3412
3428
  dragleave(e) {
3413
3429
  this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
3414
3430
  }
3415
- }, q = class t extends e {
3431
+ }, K = class t extends e {
3416
3432
  constructor(e) {
3417
3433
  super(e, e);
3418
3434
  }
@@ -3437,11 +3453,11 @@ var ir = class {
3437
3453
  return new t(e.resolve(n.pos));
3438
3454
  }
3439
3455
  getBookmark() {
3440
- return new ar(this.anchor);
3456
+ return new dr(this.anchor);
3441
3457
  }
3442
3458
  static valid(e) {
3443
3459
  let t = e.parent;
3444
- if (t.inlineContent || !sr(e) || !cr(e)) return !1;
3460
+ if (t.inlineContent || !pr(e) || !mr(e)) return !1;
3445
3461
  let n = t.type.spec.allowGapCursor;
3446
3462
  if (n != null) return n;
3447
3463
  let r = t.contentMatchAt(e.index()).defaultType;
@@ -3464,7 +3480,7 @@ var ir = class {
3464
3480
  for (;;) {
3465
3481
  let o = n > 0 ? a.firstChild : a.lastChild;
3466
3482
  if (!o) {
3467
- if (a.isAtom && !a.isText && !g.isSelectable(a)) {
3483
+ if (a.isAtom && !a.isText && !_.isSelectable(a)) {
3468
3484
  e = e.doc.resolve(i + a.nodeSize * n), r = !1;
3469
3485
  continue search;
3470
3486
  }
@@ -3478,8 +3494,8 @@ var ir = class {
3478
3494
  }
3479
3495
  }
3480
3496
  };
3481
- q.prototype.visible = !1, q.findFrom = q.findGapCursorFrom, e.jsonID("gapcursor", q);
3482
- var ar = class t {
3497
+ K.prototype.visible = !1, K.findFrom = K.findGapCursorFrom, e.jsonID("gapcursor", K);
3498
+ var dr = class t {
3483
3499
  constructor(e) {
3484
3500
  this.pos = e;
3485
3501
  }
@@ -3488,13 +3504,13 @@ var ar = class t {
3488
3504
  }
3489
3505
  resolve(t) {
3490
3506
  let n = t.resolve(this.pos);
3491
- return q.valid(n) ? new q(n) : e.near(n);
3507
+ return K.valid(n) ? new K(n) : e.near(n);
3492
3508
  }
3493
3509
  };
3494
- function or(e) {
3510
+ function fr(e) {
3495
3511
  return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
3496
3512
  }
3497
- function sr(e) {
3513
+ function pr(e) {
3498
3514
  for (let t = e.depth; t >= 0; t--) {
3499
3515
  let n = e.index(t), r = e.node(t);
3500
3516
  if (n == 0) {
@@ -3502,13 +3518,13 @@ function sr(e) {
3502
3518
  continue;
3503
3519
  }
3504
3520
  for (let e = r.child(n - 1);; e = e.lastChild) {
3505
- if (e.childCount == 0 && !e.inlineContent || or(e.type)) return !0;
3521
+ if (e.childCount == 0 && !e.inlineContent || fr(e.type)) return !0;
3506
3522
  if (e.inlineContent) return !1;
3507
3523
  }
3508
3524
  }
3509
3525
  return !0;
3510
3526
  }
3511
- function cr(e) {
3527
+ function mr(e) {
3512
3528
  for (let t = e.depth; t >= 0; t--) {
3513
3529
  let n = e.indexAfter(t), r = e.node(t);
3514
3530
  if (n == r.childCount) {
@@ -3516,30 +3532,30 @@ function cr(e) {
3516
3532
  continue;
3517
3533
  }
3518
3534
  for (let e = r.child(n);; e = e.firstChild) {
3519
- if (e.childCount == 0 && !e.inlineContent || or(e.type)) return !0;
3535
+ if (e.childCount == 0 && !e.inlineContent || fr(e.type)) return !0;
3520
3536
  if (e.inlineContent) return !1;
3521
3537
  }
3522
3538
  }
3523
3539
  return !0;
3524
3540
  }
3525
- function lr() {
3541
+ function hr() {
3526
3542
  return new w({ props: {
3527
- decorations: mr,
3543
+ decorations: br,
3528
3544
  createSelectionBetween(e, t, n) {
3529
- return t.pos == n.pos && q.valid(n) ? new q(n) : null;
3545
+ return t.pos == n.pos && K.valid(n) ? new K(n) : null;
3530
3546
  },
3531
- handleClick: fr,
3532
- handleKeyDown: ur,
3533
- handleDOMEvents: { beforeinput: pr }
3547
+ handleClick: vr,
3548
+ handleKeyDown: gr,
3549
+ handleDOMEvents: { beforeinput: yr }
3534
3550
  } });
3535
3551
  }
3536
- var ur = m({
3537
- ArrowLeft: dr("horiz", -1),
3538
- ArrowRight: dr("horiz", 1),
3539
- ArrowUp: dr("vert", -1),
3540
- ArrowDown: dr("vert", 1)
3552
+ var gr = h({
3553
+ ArrowLeft: _r("horiz", -1),
3554
+ ArrowRight: _r("horiz", 1),
3555
+ ArrowUp: _r("vert", -1),
3556
+ ArrowDown: _r("vert", 1)
3541
3557
  });
3542
- function dr(e, t) {
3558
+ function _r(e, t) {
3543
3559
  let n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
3544
3560
  return function(e, r, i) {
3545
3561
  let a = e.selection, o = t > 0 ? a.$to : a.$from, s = a.empty;
@@ -3547,22 +3563,22 @@ function dr(e, t) {
3547
3563
  if (!i.endOfTextblock(n) || o.depth == 0) return !1;
3548
3564
  s = !1, o = e.doc.resolve(t > 0 ? o.after() : o.before());
3549
3565
  }
3550
- let c = q.findGapCursorFrom(o, t, s);
3551
- return c ? (r && r(e.tr.setSelection(new q(c))), !0) : !1;
3566
+ let c = K.findGapCursorFrom(o, t, s);
3567
+ return c ? (r && r(e.tr.setSelection(new K(c))), !0) : !1;
3552
3568
  };
3553
3569
  }
3554
- function fr(e, t, n) {
3570
+ function vr(e, t, n) {
3555
3571
  if (!e || !e.editable) return !1;
3556
3572
  let r = e.state.doc.resolve(t);
3557
- if (!q.valid(r)) return !1;
3573
+ if (!K.valid(r)) return !1;
3558
3574
  let i = e.posAtCoords({
3559
3575
  left: n.clientX,
3560
3576
  top: n.clientY
3561
3577
  });
3562
- return i && i.inside > -1 && g.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new q(r))), !0);
3578
+ return i && i.inside > -1 && _.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new K(r))), !0);
3563
3579
  }
3564
- function pr(e, t) {
3565
- if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof q)) return !1;
3580
+ function yr(e, t) {
3581
+ if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof K)) return !1;
3566
3582
  let { $from: r } = e.state.selection, i = r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);
3567
3583
  if (!i) return !1;
3568
3584
  let a = n.empty;
@@ -3570,36 +3586,36 @@ function pr(e, t) {
3570
3586
  let s = e.state.tr.replace(r.pos, r.pos, new o(a, 0, 0));
3571
3587
  return s.setSelection(C.near(s.doc.resolve(r.pos + 1))), e.dispatch(s), !1;
3572
3588
  }
3573
- function mr(e) {
3574
- if (!(e.selection instanceof q)) return null;
3589
+ function br(e) {
3590
+ if (!(e.selection instanceof K)) return null;
3575
3591
  let t = document.createElement("div");
3576
3592
  return t.className = "ProseMirror-gapcursor", T.create(e.doc, [S.widget(e.selection.head, t, { key: "gapcursor" })]);
3577
3593
  }
3578
3594
  //#endregion
3579
3595
  //#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
3580
- var hr = 200, J = function() {};
3581
- J.prototype.append = function(e) {
3582
- return e.length ? (e = J.from(e), !this.length && e || e.length < hr && this.leafAppend(e) || this.length < hr && e.leafPrepend(this) || this.appendInner(e)) : this;
3583
- }, J.prototype.prepend = function(e) {
3584
- return e.length ? J.from(e).append(this) : this;
3585
- }, J.prototype.appendInner = function(e) {
3586
- return new _r(this, e);
3587
- }, J.prototype.slice = function(e, t) {
3588
- return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? J.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
3589
- }, J.prototype.get = function(e) {
3596
+ var xr = 200, q = function() {};
3597
+ q.prototype.append = function(e) {
3598
+ return e.length ? (e = q.from(e), !this.length && e || e.length < xr && this.leafAppend(e) || this.length < xr && e.leafPrepend(this) || this.appendInner(e)) : this;
3599
+ }, q.prototype.prepend = function(e) {
3600
+ return e.length ? q.from(e).append(this) : this;
3601
+ }, q.prototype.appendInner = function(e) {
3602
+ return new Cr(this, e);
3603
+ }, q.prototype.slice = function(e, t) {
3604
+ return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? q.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
3605
+ }, q.prototype.get = function(e) {
3590
3606
  if (!(e < 0 || e >= this.length)) return this.getInner(e);
3591
- }, J.prototype.forEach = function(e, t, n) {
3607
+ }, q.prototype.forEach = function(e, t, n) {
3592
3608
  t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
3593
- }, J.prototype.map = function(e, t, n) {
3609
+ }, q.prototype.map = function(e, t, n) {
3594
3610
  t === void 0 && (t = 0), n === void 0 && (n = this.length);
3595
3611
  var r = [];
3596
3612
  return this.forEach(function(t, n) {
3597
3613
  return r.push(e(t, n));
3598
3614
  }, t, n), r;
3599
- }, J.from = function(e) {
3600
- return e instanceof J ? e : e && e.length ? new gr(e) : J.empty;
3615
+ }, q.from = function(e) {
3616
+ return e instanceof q ? e : e && e.length ? new Sr(e) : q.empty;
3601
3617
  };
3602
- var gr = /* @__PURE__ */ function(e) {
3618
+ var Sr = /* @__PURE__ */ function(e) {
3603
3619
  function t(t) {
3604
3620
  e.call(this), this.values = t;
3605
3621
  }
@@ -3619,17 +3635,17 @@ var gr = /* @__PURE__ */ function(e) {
3619
3635
  }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
3620
3636
  for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
3621
3637
  }, t.prototype.leafAppend = function(e) {
3622
- if (this.length + e.length <= hr) return new t(this.values.concat(e.flatten()));
3638
+ if (this.length + e.length <= xr) return new t(this.values.concat(e.flatten()));
3623
3639
  }, t.prototype.leafPrepend = function(e) {
3624
- if (this.length + e.length <= hr) return new t(e.flatten().concat(this.values));
3640
+ if (this.length + e.length <= xr) return new t(e.flatten().concat(this.values));
3625
3641
  }, n.length.get = function() {
3626
3642
  return this.values.length;
3627
3643
  }, n.depth.get = function() {
3628
3644
  return 0;
3629
3645
  }, Object.defineProperties(t.prototype, n), t;
3630
- }(J);
3631
- J.empty = new gr([]);
3632
- var _r = /* @__PURE__ */ function(e) {
3646
+ }(q);
3647
+ q.empty = new Sr([]);
3648
+ var Cr = /* @__PURE__ */ function(e) {
3633
3649
  function t(t, n) {
3634
3650
  e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
3635
3651
  }
@@ -3656,7 +3672,7 @@ var _r = /* @__PURE__ */ function(e) {
3656
3672
  }, t.prototype.appendInner = function(e) {
3657
3673
  return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
3658
3674
  }, t;
3659
- }(J), vr = 500, Y = class e {
3675
+ }(q), wr = 500, J = class e {
3660
3676
  constructor(e, t) {
3661
3677
  this.items = e, this.eventCount = t;
3662
3678
  }
@@ -3676,9 +3692,9 @@ var _r = /* @__PURE__ */ function(e) {
3676
3692
  return;
3677
3693
  }
3678
3694
  if (i) {
3679
- u.push(new X(t.map));
3695
+ u.push(new Y(t.map));
3680
3696
  let e = t.step.map(i.slice(a)), n;
3681
- e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new X(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
3697
+ e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new Y(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
3682
3698
  } else o.maybeStep(t.step);
3683
3699
  if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
3684
3700
  }, this.items.length, 0), {
@@ -3690,11 +3706,11 @@ var _r = /* @__PURE__ */ function(e) {
3690
3706
  addTransform(t, n, r, i) {
3691
3707
  let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
3692
3708
  for (let e = 0; e < t.steps.length; e++) {
3693
- let r = t.steps[e].invert(t.docs[e]), l = new X(t.mapping.maps[e], r, n), u;
3709
+ let r = t.steps[e].invert(t.docs[e]), l = new Y(t.mapping.maps[e], r, n), u;
3694
3710
  (u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
3695
3711
  }
3696
3712
  let l = o - r.depth;
3697
- return l > br && (s = yr(s, l), o -= l), new e(s.append(a), o);
3713
+ return l > Er && (s = Tr(s, l), o -= l), new e(s.append(a), o);
3698
3714
  }
3699
3715
  remapping(e, t) {
3700
3716
  let n = new l();
@@ -3704,7 +3720,7 @@ var _r = /* @__PURE__ */ function(e) {
3704
3720
  }, e, t), n;
3705
3721
  }
3706
3722
  addMaps(t) {
3707
- return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new X(e))), this.eventCount);
3723
+ return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new Y(e))), this.eventCount);
3708
3724
  }
3709
3725
  rebased(t, n) {
3710
3726
  if (!this.eventCount) return this;
@@ -3720,13 +3736,13 @@ var _r = /* @__PURE__ */ function(e) {
3720
3736
  let i = a.maps[n];
3721
3737
  if (e.step) {
3722
3738
  let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
3723
- l && s++, r.push(new X(i, o, l));
3724
- } else r.push(new X(i));
3739
+ l && s++, r.push(new Y(i, o, l));
3740
+ } else r.push(new Y(i));
3725
3741
  }, i);
3726
3742
  let l = [];
3727
- for (let e = n; e < o; e++) l.push(new X(a.maps[e]));
3728
- let u = new e(this.items.slice(0, i).append(l).append(r), s);
3729
- return u.emptyItemCount() > vr && (u = u.compress(this.items.length - r.length)), u;
3743
+ for (let e = n; e < o; e++) l.push(new Y(a.maps[e]));
3744
+ let u = this.items.slice(0, i).append(l).append(r), d = new e(u, s);
3745
+ return d.emptyItemCount() > wr && (d = d.compress(this.items.length - r.length)), d;
3730
3746
  }
3731
3747
  emptyItemCount() {
3732
3748
  let e = 0;
@@ -3743,21 +3759,21 @@ var _r = /* @__PURE__ */ function(e) {
3743
3759
  if (r--, o && n.appendMap(o, r), t) {
3744
3760
  let s = e.selection && e.selection.map(n.slice(r));
3745
3761
  s && a++;
3746
- let c = new X(o.invert(), t, s), l, u = i.length - 1;
3762
+ let c = new Y(o.invert(), t, s), l, u = i.length - 1;
3747
3763
  (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
3748
3764
  }
3749
3765
  } else e.map && r--;
3750
- }, this.items.length, 0), new e(J.from(i.reverse()), a);
3766
+ }, this.items.length, 0), new e(q.from(i.reverse()), a);
3751
3767
  }
3752
3768
  };
3753
- Y.empty = new Y(J.empty, 0);
3754
- function yr(e, t) {
3769
+ J.empty = new J(q.empty, 0);
3770
+ function Tr(e, t) {
3755
3771
  let n;
3756
3772
  return e.forEach((e, r) => {
3757
3773
  if (e.selection && t-- == 0) return n = r, !1;
3758
3774
  }), e.slice(n);
3759
3775
  }
3760
- var X = class e {
3776
+ var Y = class e {
3761
3777
  constructor(e, t, n, r) {
3762
3778
  this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
3763
3779
  }
@@ -3767,25 +3783,25 @@ var X = class e {
3767
3783
  if (n) return new e(n.getMap().invert(), n, this.selection);
3768
3784
  }
3769
3785
  }
3770
- }, Z = class {
3786
+ }, X = class {
3771
3787
  constructor(e, t, n, r, i) {
3772
3788
  this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
3773
3789
  }
3774
- }, br = 20;
3775
- function xr(e, t, n, r) {
3776
- let i = n.getMeta(Q), a;
3790
+ }, Er = 20;
3791
+ function Dr(e, t, n, r) {
3792
+ let i = n.getMeta(Z), a;
3777
3793
  if (i) return i.historyState;
3778
- n.getMeta(kr) && (e = new Z(e.done, e.undone, null, 0, -1));
3794
+ n.getMeta(Fr) && (e = new X(e.done, e.undone, null, 0, -1));
3779
3795
  let o = n.getMeta("appendedTransaction");
3780
3796
  if (n.steps.length == 0) return e;
3781
- if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new Z(e.done.addTransform(n, void 0, r, Or(t)), e.undone, Cr(n.mapping.maps), e.prevTime, e.prevComposition) : new Z(e.done, e.undone.addTransform(n, void 0, r, Or(t)), null, e.prevTime, e.prevComposition);
3797
+ if (o && o.getMeta(Z)) return o.getMeta(Z).redo ? new X(e.done.addTransform(n, void 0, r, Pr(t)), e.undone, kr(n.mapping.maps), e.prevTime, e.prevComposition) : new X(e.done, e.undone.addTransform(n, void 0, r, Pr(t)), null, e.prevTime, e.prevComposition);
3782
3798
  if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
3783
- let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Sr(n, e.prevRanges)), s = o ? wr(e.prevRanges, n.mapping) : Cr(n.mapping.maps);
3784
- return new Z(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Or(t)), Y.empty, s, n.time, i ?? e.prevComposition);
3785
- } else if (a = n.getMeta("rebased")) return new Z(e.done.rebased(n, a), e.undone.rebased(n, a), wr(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
3786
- else return new Z(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), wr(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
3799
+ let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Or(n, e.prevRanges)), s = o ? Ar(e.prevRanges, n.mapping) : kr(n.mapping.maps);
3800
+ return new X(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Pr(t)), J.empty, s, n.time, i ?? e.prevComposition);
3801
+ } else if (a = n.getMeta("rebased")) return new X(e.done.rebased(n, a), e.undone.rebased(n, a), Ar(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
3802
+ else return new X(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), Ar(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
3787
3803
  }
3788
- function Sr(e, t) {
3804
+ function Or(e, t) {
3789
3805
  if (!t) return !1;
3790
3806
  if (!e.docChanged) return !0;
3791
3807
  let n = !1;
@@ -3793,12 +3809,12 @@ function Sr(e, t) {
3793
3809
  for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
3794
3810
  }), n;
3795
3811
  }
3796
- function Cr(e) {
3812
+ function kr(e) {
3797
3813
  let t = [];
3798
3814
  for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
3799
3815
  return t;
3800
3816
  }
3801
- function wr(e, t) {
3817
+ function Ar(e, t) {
3802
3818
  if (!e) return null;
3803
3819
  let n = [];
3804
3820
  for (let r = 0; r < e.length; r += 2) {
@@ -3807,61 +3823,61 @@ function wr(e, t) {
3807
3823
  }
3808
3824
  return n;
3809
3825
  }
3810
- function Tr(e, t, n) {
3811
- let r = Or(t), i = Q.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
3826
+ function jr(e, t, n) {
3827
+ let r = Pr(t), i = Z.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
3812
3828
  if (!a) return null;
3813
- let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Z(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
3814
- return a.transform.setSelection(o).setMeta(Q, {
3829
+ let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new X(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
3830
+ return a.transform.setSelection(o).setMeta(Z, {
3815
3831
  redo: n,
3816
3832
  historyState: c
3817
3833
  });
3818
3834
  }
3819
- var Er = !1, Dr = null;
3820
- function Or(e) {
3835
+ var Mr = !1, Nr = null;
3836
+ function Pr(e) {
3821
3837
  let t = e.plugins;
3822
- if (Dr != t) {
3823
- Er = !1, Dr = t;
3838
+ if (Nr != t) {
3839
+ Mr = !1, Nr = t;
3824
3840
  for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
3825
- Er = !0;
3841
+ Mr = !0;
3826
3842
  break;
3827
3843
  }
3828
3844
  }
3829
- return Er;
3845
+ return Mr;
3830
3846
  }
3831
- var Q = new c("history"), kr = new c("closeHistory");
3832
- function Ar(e = {}) {
3847
+ var Z = new c("history"), Fr = new c("closeHistory");
3848
+ function Ir(e = {}) {
3833
3849
  return e = {
3834
3850
  depth: e.depth || 100,
3835
3851
  newGroupDelay: e.newGroupDelay || 500
3836
3852
  }, new w({
3837
- key: Q,
3853
+ key: Z,
3838
3854
  state: {
3839
3855
  init() {
3840
- return new Z(Y.empty, Y.empty, null, 0, -1);
3856
+ return new X(J.empty, J.empty, null, 0, -1);
3841
3857
  },
3842
3858
  apply(t, n, r) {
3843
- return xr(n, r, t, e);
3859
+ return Dr(n, r, t, e);
3844
3860
  }
3845
3861
  },
3846
3862
  config: e,
3847
3863
  props: { handleDOMEvents: { beforeinput(e, t) {
3848
- let n = t.inputType, r = n == "historyUndo" ? Mr : n == "historyRedo" ? Nr : null;
3864
+ let n = t.inputType, r = n == "historyUndo" ? Rr : n == "historyRedo" ? zr : null;
3849
3865
  return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
3850
3866
  } } }
3851
3867
  });
3852
3868
  }
3853
- function jr(e, t) {
3869
+ function Lr(e, t) {
3854
3870
  return (n, r) => {
3855
- let i = Q.getState(n);
3871
+ let i = Z.getState(n);
3856
3872
  if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
3857
3873
  if (r) {
3858
- let a = Tr(i, n, e);
3874
+ let a = jr(i, n, e);
3859
3875
  a && r(t ? a.scrollIntoView() : a);
3860
3876
  }
3861
3877
  return !0;
3862
3878
  };
3863
3879
  }
3864
- var Mr = jr(!1, !0), Nr = jr(!0, !0);
3880
+ var Rr = Lr(!1, !0), zr = Lr(!0, !0);
3865
3881
  y.create({
3866
3882
  name: "characterCount",
3867
3883
  addOptions() {
@@ -3924,7 +3940,7 @@ y.create({
3924
3940
  })];
3925
3941
  }
3926
3942
  });
3927
- var Pr = y.create({
3943
+ var Br = y.create({
3928
3944
  name: "dropCursor",
3929
3945
  addOptions() {
3930
3946
  return {
@@ -3934,7 +3950,7 @@ var Pr = y.create({
3934
3950
  };
3935
3951
  },
3936
3952
  addProseMirrorPlugins() {
3937
- return [rr(this.options)];
3953
+ return [lr(this.options)];
3938
3954
  }
3939
3955
  });
3940
3956
  y.create({
@@ -3968,20 +3984,20 @@ y.create({
3968
3984
  })];
3969
3985
  }
3970
3986
  });
3971
- var Fr = y.create({
3987
+ var Vr = y.create({
3972
3988
  name: "gapCursor",
3973
3989
  addProseMirrorPlugins() {
3974
- return [lr()];
3990
+ return [hr()];
3975
3991
  },
3976
3992
  extendNodeSchema(e) {
3977
- return { allowGapCursor: oe(p(e, "allowGapCursor", {
3993
+ return { allowGapCursor: se(m(e, "allowGapCursor", {
3978
3994
  name: e.name,
3979
3995
  options: e.options,
3980
3996
  storage: e.storage
3981
3997
  })) ?? null };
3982
3998
  }
3983
- }), Ir = "placeholder", $ = new c("tiptap__placeholder"), Lr = 200;
3984
- function Rr(e) {
3999
+ }), Hr = "placeholder", Ur = new c("tiptap__placeholder");
4000
+ function Wr(e) {
3985
4001
  let { editor: t, placeholder: n, dataAttribute: r, pos: i, node: a, isEmptyDoc: o, hasAnchor: s, classes: { emptyNode: c, emptyEditor: l } } = e, u = [c];
3986
4002
  return o && u.push(l), S.node(i, i + a.nodeSize, {
3987
4003
  class: u.join(" "),
@@ -3993,17 +4009,41 @@ function Rr(e) {
3993
4009
  }) : n
3994
4010
  });
3995
4011
  }
3996
- function zr(e, t) {
4012
+ function Gr(e, t) {
3997
4013
  return typeof e == "function" ? e(t) : e;
3998
4014
  }
3999
- function Br({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
4015
+ function Kr({ editor: e, options: t, dataAttribute: n, doc: r, selection: i, from: o, to: s }) {
4016
+ let { anchor: c } = i, l = [], u = e.isEmpty;
4017
+ return r.nodesBetween(o, s, (r, i) => {
4018
+ let o = c >= i && c <= i + r.nodeSize, s = !r.isLeaf && a(r);
4019
+ return r.type.isTextblock && (o || !t.showOnlyCurrent) && s && l.push(Wr({
4020
+ editor: e,
4021
+ isEmptyDoc: u,
4022
+ dataAttribute: n,
4023
+ hasAnchor: o,
4024
+ placeholder: t.placeholder,
4025
+ classes: {
4026
+ emptyEditor: t.emptyEditorClass,
4027
+ emptyNode: Gr(t.emptyNodeClass, {
4028
+ editor: e,
4029
+ node: r,
4030
+ pos: i,
4031
+ hasAnchor: o
4032
+ })
4033
+ },
4034
+ node: r,
4035
+ pos: i
4036
+ })), t.includeChildren;
4037
+ }), l;
4038
+ }
4039
+ function qr({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
4000
4040
  if (!(e.isEditable || !t.showOnlyWhenEditable)) return null;
4001
4041
  let { anchor: o } = i, s = [], c = e.isEmpty;
4002
4042
  if (t.showOnlyCurrent && !t.includeChildren) {
4003
4043
  let i = r.resolve(o), l = i.depth > 0 ? i.node(1) : i.nodeAfter, u = i.depth > 0 ? i.before(1) : o;
4004
4044
  if (l && l.type.isTextblock && a(l)) {
4005
4045
  let r = o >= u && o <= u + l.nodeSize;
4006
- s.push(Rr({
4046
+ s.push(Wr({
4007
4047
  editor: e,
4008
4048
  isEmptyDoc: c,
4009
4049
  dataAttribute: n,
@@ -4011,7 +4051,7 @@ function Br({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
4011
4051
  placeholder: t.placeholder,
4012
4052
  classes: {
4013
4053
  emptyEditor: t.emptyEditorClass,
4014
- emptyNode: zr(t.emptyNodeClass, {
4054
+ emptyNode: Gr(t.emptyNodeClass, {
4015
4055
  editor: e,
4016
4056
  node: l,
4017
4057
  pos: u,
@@ -4022,148 +4062,142 @@ function Br({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
4022
4062
  pos: u
4023
4063
  }));
4024
4064
  }
4025
- } else {
4026
- let i = $.getState(e.state), l = i?.topPos ?? 0, u = i?.bottomPos ?? r.content.size;
4027
- r.nodesBetween(l, u, (r, i) => {
4028
- let l = o >= i && o <= i + r.nodeSize, u = !r.isLeaf && a(r);
4029
- return r.type.isTextblock && (l || !t.showOnlyCurrent) && u && s.push(Rr({
4030
- editor: e,
4031
- isEmptyDoc: c,
4032
- dataAttribute: n,
4033
- hasAnchor: l,
4034
- placeholder: t.placeholder,
4035
- classes: {
4036
- emptyEditor: t.emptyEditorClass,
4037
- emptyNode: zr(t.emptyNodeClass, {
4038
- editor: e,
4039
- node: r,
4040
- pos: i,
4041
- hasAnchor: l
4042
- })
4043
- },
4044
- node: r,
4045
- pos: i
4046
- })), t.includeChildren;
4047
- });
4048
- }
4065
+ } else s.push(...Kr({
4066
+ editor: e,
4067
+ options: t,
4068
+ dataAttribute: n,
4069
+ doc: r,
4070
+ selection: i,
4071
+ from: 0,
4072
+ to: r.content.size
4073
+ }));
4049
4074
  return T.create(r, s);
4050
4075
  }
4051
- function Vr(e) {
4052
- return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
4076
+ function Q(e, t) {
4077
+ let n = e.resolve(t);
4078
+ if (n.depth === 0) {
4079
+ let e = n.nodeAfter ?? n.nodeBefore;
4080
+ if (!e) return {
4081
+ from: t,
4082
+ to: t
4083
+ };
4084
+ let r = n.nodeAfter ? t : t - e.nodeSize;
4085
+ return {
4086
+ from: r,
4087
+ to: r + e.nodeSize
4088
+ };
4089
+ }
4090
+ let r = n.before(1);
4091
+ return {
4092
+ from: r,
4093
+ to: r + n.node(1).nodeSize
4094
+ };
4053
4095
  }
4054
- function Hr(e) {
4055
- let t = getComputedStyle(e), n = `${t.overflow} ${t.overflowY} ${t.overflowX}`;
4056
- return /auto|scroll|overlay/.test(n);
4096
+ function $(e, t) {
4097
+ return {
4098
+ from: Math.max(0, t.from - 1),
4099
+ to: Math.min(e.content.size, t.to - 1)
4100
+ };
4057
4101
  }
4058
- function Ur(e) {
4059
- let t = e;
4060
- for (; t;) {
4061
- if (Hr(t)) return t;
4062
- let e = t.parentElement;
4063
- if (!e) {
4064
- let e = t.getRootNode();
4065
- if (e instanceof ShadowRoot) {
4066
- t = e.host;
4067
- continue;
4068
- }
4069
- return window;
4070
- }
4071
- t = e;
4102
+ function Jr(e, t, n) {
4103
+ let r = [];
4104
+ return e.forEach((e, i) => {
4105
+ let a = i, o = a + e.nodeSize, s = a + 1, c = o + 1;
4106
+ s < n && c > t && r.push({
4107
+ from: a,
4108
+ to: o
4109
+ });
4110
+ }), r;
4111
+ }
4112
+ function Yr(e) {
4113
+ if (e.length === 0) return [];
4114
+ let t = [...e].sort((e, t) => e.from - t.from), n = [{ ...t[0] }];
4115
+ for (let e = 1; e < t.length; e += 1) {
4116
+ let r = n[n.length - 1], i = t[e];
4117
+ i.from <= r.to ? r.to = Math.max(r.to, i.to) : n.push({ ...i });
4072
4118
  }
4073
- return window;
4119
+ return n;
4074
4120
  }
4075
- function Wr(e) {
4076
- return e === window ? {
4077
- top: 0,
4078
- bottom: window.innerHeight
4079
- } : e.getBoundingClientRect();
4121
+ function Xr(e, t) {
4122
+ let n = Jr(e, t.from, t.to);
4123
+ return n.push($(e, Q(e, t.from))), t.to > t.from ? n.push($(e, Q(e, Math.min(t.to, e.content.size + 1) - 1))) : t.from < e.content.size + 1 && n.push($(e, Q(e, Math.min(t.from + 1, e.content.size)))), n;
4080
4124
  }
4081
- function Gr({ view: e, scrollContainer: t }) {
4082
- let n = e.dom.getBoundingClientRect();
4083
- if (n.width <= 0 || n.height <= 0) return null;
4084
- let r = t ? Wr(t) : {
4085
- top: 0,
4086
- bottom: window.innerHeight
4087
- }, i = Math.max(n.top, r.top) - Lr, a = Math.min(n.bottom, r.bottom) + Lr;
4088
- if (i >= a) return null;
4089
- let o = n.left + 1, s = n.right - 1;
4090
- if (o > s) return null;
4091
- let c = getComputedStyle(e.dom).direction === "rtl" ? n.right - 2 : n.left + 2, l = Math.min(Math.max(c, o), s), u = Math.max(i + 2, n.top + 1), d = Math.min(a - 2, n.bottom - 1);
4092
- if (u > d) return null;
4093
- let f = e.posAtCoords({
4094
- left: l,
4095
- top: u
4096
- }), p = e.posAtCoords({
4097
- left: l,
4098
- top: d
4099
- });
4100
- return !f || !p ? null : {
4101
- top: f.pos,
4102
- bottom: p.pos
4125
+ function Zr(e, t, n) {
4126
+ let r = [];
4127
+ if (e.docChanged) {
4128
+ let t = p(e);
4129
+ for (let e of t) r.push(...Xr(n.doc, e.newRange));
4130
+ }
4131
+ return e.selectionSet && (r.push($(n.doc, Q(n.doc, e.mapping.map(t.selection.anchor)))), r.push($(n.doc, Q(n.doc, n.selection.anchor)))), Yr(r);
4132
+ }
4133
+ function Qr(e, t, n) {
4134
+ let r = Math.max(0, Math.min(e, n.content.size));
4135
+ return {
4136
+ from: r,
4137
+ to: Math.max(r, Math.min(t, n.content.size))
4103
4138
  };
4104
4139
  }
4105
- var Kr = {
4106
- init() {
4107
- return {
4108
- topPos: null,
4109
- bottomPos: null
4110
- };
4111
- },
4112
- apply(e, t) {
4113
- let n = e.getMeta($);
4114
- return n?.positions ? {
4115
- topPos: n.positions.top,
4116
- bottomPos: n.positions.bottom
4117
- } : e.docChanged ? {
4118
- topPos: t.topPos === null ? null : e.mapping.map(t.topPos),
4119
- bottomPos: t.bottomPos === null ? null : e.mapping.map(t.bottomPos)
4120
- } : t;
4121
- }
4122
- };
4123
- function qr(e) {
4124
- let t = Ur(e.dom), n = () => {
4125
- let n = Gr({
4126
- view: e,
4127
- scrollContainer: t
4140
+ function $r({ decorations: e, ranges: t, editor: n, options: r, dataAttribute: i, doc: a, selection: o }) {
4141
+ let s = e;
4142
+ for (let e of t) {
4143
+ let { from: t, to: c } = Qr(e.from, e.to, a), l = s.find(t, c).filter((e) => e.from >= t && e.to <= c);
4144
+ l.length && (s = s.remove(l));
4145
+ let u = Kr({
4146
+ editor: n,
4147
+ options: r,
4148
+ dataAttribute: i,
4149
+ doc: a,
4150
+ selection: o,
4151
+ from: t,
4152
+ to: c
4128
4153
  });
4129
- if (n === null) return;
4130
- let r = $.getState(e.state);
4131
- if (r?.topPos === n.top && r?.bottomPos === n.bottom) return;
4132
- let i = e.state.tr.setMeta($, { positions: n });
4133
- e.dispatch(i);
4134
- }, r = null, i = 0, a = () => {
4135
- r === null && (r = requestAnimationFrame(() => {
4136
- r = null;
4137
- let e = performance.now();
4138
- e - i >= 150 ? (i = e, n()) : a();
4139
- }));
4140
- };
4141
- t.addEventListener("scroll", a, { passive: !0 });
4142
- let o = typeof ResizeObserver < "u" ? new ResizeObserver(a) : null;
4143
- o?.observe(e.dom);
4144
- let s = typeof IntersectionObserver < "u" ? new IntersectionObserver(a) : null;
4145
- return s?.observe(e.dom), e.dom.addEventListener("focus", a), n(), {
4146
- update(t, n) {
4147
- e.state.doc.content.size !== n.doc.content.size && a();
4154
+ u.length && (s = s.add(a, u));
4155
+ }
4156
+ return s;
4157
+ }
4158
+ function ei({ editor: e, options: t, dataAttribute: n }) {
4159
+ return {
4160
+ init(r, i) {
4161
+ return qr({
4162
+ editor: e,
4163
+ options: t,
4164
+ dataAttribute: n,
4165
+ doc: i.doc,
4166
+ selection: i.selection
4167
+ }) ?? T.empty;
4148
4168
  },
4149
- destroy: () => {
4150
- r !== null && cancelAnimationFrame(r), t.removeEventListener("scroll", a), o?.disconnect(), s?.disconnect(), e.dom.removeEventListener("focus", a);
4169
+ apply(r, i, a, o) {
4170
+ return !r.docChanged && !r.selectionSet ? i : $r({
4171
+ decorations: i.map(r.mapping, r.doc),
4172
+ ranges: Zr(r, a, o),
4173
+ editor: e,
4174
+ options: t,
4175
+ dataAttribute: n,
4176
+ doc: o.doc,
4177
+ selection: o.selection
4178
+ });
4151
4179
  }
4152
4180
  };
4153
4181
  }
4154
- function Jr({ editor: e, options: t }) {
4155
- let n = t.dataAttribute ? `data-${Vr(t.dataAttribute)}` : `data-${Ir}`;
4182
+ function ti(e) {
4183
+ return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
4184
+ }
4185
+ function ni({ editor: e, options: t }) {
4186
+ let n = t.dataAttribute ? `data-${ti(t.dataAttribute)}` : `data-${Hr}`, r = t.showOnlyCurrent && !t.includeChildren;
4156
4187
  return new w({
4157
- key: $,
4158
- state: Kr,
4159
- view: qr,
4160
- props: { decorations: ({ doc: r, selection: i }) => Br({
4188
+ key: Ur,
4189
+ ...r ? {} : { state: ei({
4190
+ editor: e,
4191
+ options: t,
4192
+ dataAttribute: n
4193
+ }) },
4194
+ props: { decorations: r ? ({ doc: r, selection: i }) => qr({
4161
4195
  editor: e,
4162
4196
  options: t,
4163
4197
  dataAttribute: n,
4164
4198
  doc: r,
4165
4199
  selection: i
4166
- }) }
4200
+ }) : (n) => t.showOnlyWhenEditable && !e.isEditable ? T.empty : Ur.getState(n) ?? T.empty }
4167
4201
  });
4168
4202
  }
4169
4203
  y.create({
@@ -4172,7 +4206,7 @@ y.create({
4172
4206
  return {
4173
4207
  emptyEditorClass: "is-editor-empty",
4174
4208
  emptyNodeClass: "is-empty",
4175
- dataAttribute: Ir,
4209
+ dataAttribute: Hr,
4176
4210
  placeholder: "Write something …",
4177
4211
  showOnlyWhenEditable: !0,
4178
4212
  showOnlyCurrent: !0,
@@ -4180,13 +4214,13 @@ y.create({
4180
4214
  };
4181
4215
  },
4182
4216
  addProseMirrorPlugins() {
4183
- return [Jr({
4217
+ return [ni({
4184
4218
  editor: this.editor,
4185
4219
  options: this.options
4186
4220
  })];
4187
4221
  }
4188
4222
  });
4189
- var Yr = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
4223
+ var ri = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
4190
4224
  y.create({
4191
4225
  name: "selection",
4192
4226
  addOptions() {
@@ -4194,7 +4228,7 @@ y.create({
4194
4228
  },
4195
4229
  addProseMirrorPlugins() {
4196
4230
  let { editor: e, options: t } = this;
4197
- return e.options.injectCSS && typeof document < "u" && ne(Yr, e.options.injectNonce, "selection"), [new w({
4231
+ return e.options.injectCSS && typeof document < "u" && re(ri, e.options.injectNonce, "selection"), [new w({
4198
4232
  key: new c("selection"),
4199
4233
  props: { decorations(n) {
4200
4234
  return n.selection.empty || e.isFocused || !e.isEditable || s(n.selection) || e.view.dragging ? null : T.create(n.doc, [S.inline(n.selection.from, n.selection.to, { class: t.className })]);
@@ -4202,10 +4236,10 @@ y.create({
4202
4236
  })];
4203
4237
  }
4204
4238
  });
4205
- function Xr({ types: e, node: t }) {
4239
+ function ii({ types: e, node: t }) {
4206
4240
  return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
4207
4241
  }
4208
- var Zr = y.create({
4242
+ var ai = y.create({
4209
4243
  name: "trailingNode",
4210
4244
  addOptions() {
4211
4245
  return {
@@ -4224,7 +4258,7 @@ var Zr = y.create({
4224
4258
  state: {
4225
4259
  init: (e, t) => {
4226
4260
  let r = t.tr.doc.lastChild;
4227
- return !Xr({
4261
+ return !ii({
4228
4262
  node: r,
4229
4263
  types: n
4230
4264
  });
@@ -4232,7 +4266,7 @@ var Zr = y.create({
4232
4266
  apply: (e, t) => {
4233
4267
  if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
4234
4268
  let r = e.doc.lastChild;
4235
- return !Xr({
4269
+ return !ii({
4236
4270
  node: r,
4237
4271
  types: n
4238
4272
  });
@@ -4240,7 +4274,7 @@ var Zr = y.create({
4240
4274
  }
4241
4275
  })];
4242
4276
  }
4243
- }), Qr = y.create({
4277
+ }), oi = y.create({
4244
4278
  name: "undoRedo",
4245
4279
  addOptions() {
4246
4280
  return {
@@ -4250,12 +4284,12 @@ var Zr = y.create({
4250
4284
  },
4251
4285
  addCommands() {
4252
4286
  return {
4253
- undo: () => ({ state: e, dispatch: t }) => Mr(e, t),
4254
- redo: () => ({ state: e, dispatch: t }) => Nr(e, t)
4287
+ undo: () => ({ state: e, dispatch: t }) => Rr(e, t),
4288
+ redo: () => ({ state: e, dispatch: t }) => zr(e, t)
4255
4289
  };
4256
4290
  },
4257
4291
  addProseMirrorPlugins() {
4258
- return [Ar(this.options)];
4292
+ return [Ir(this.options)];
4259
4293
  },
4260
4294
  addKeyboardShortcuts() {
4261
4295
  return {
@@ -4266,12 +4300,12 @@ var Zr = y.create({
4266
4300
  "Shift-Mod-я": () => this.editor.commands.redo()
4267
4301
  };
4268
4302
  }
4269
- }), $r = y.create({
4303
+ }), si = y.create({
4270
4304
  name: "starterKit",
4271
4305
  addExtensions() {
4272
4306
  let e = [];
4273
- return this.options.bold !== !1 && e.push(Ot.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(Ct.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(Xt.configure(this.options.bulletList)), this.options.code !== !1 && e.push(jt.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(Ft.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(It.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(Pr.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(Fr.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(Lt.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(Rt.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(Qr.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(zt.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(Wt.configure(this.options.italic)), this.options.listItem !== !1 && e.push(yn.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(An.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(le.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(Kn.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(Qn.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(tr.configure(this.options.strike)), this.options.text !== !1 && e.push(nr.configure(this.options.text)), this.options.underline !== !1 && e.push(ue.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(Zr.configure(this.options?.trailingNode)), e;
4307
+ return this.options.bold !== !1 && e.push(Nt.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(Ot.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(tn.configure(this.options.bulletList)), this.options.code !== !1 && e.push(It.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(Bt.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(Vt.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(Br.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(Vr.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(Ht.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(Ut.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(oi.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(Wt.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(Yt.configure(this.options.italic)), this.options.listItem !== !1 && e.push(wn.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(Fn.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(ue.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(Qn.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(ir.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(sr.configure(this.options.strike)), this.options.text !== !1 && e.push(cr.configure(this.options.text)), this.options.underline !== !1 && e.push(de.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(ai.configure(this.options?.trailingNode)), e;
4274
4308
  }
4275
- }), ei = $r;
4309
+ }), ci = si;
4276
4310
  //#endregion
4277
- export { $r as StarterKit, ei as default };
4311
+ export { si as StarterKit, ci as default };