@layers-app/editor 0.5.1 → 0.5.2

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 (240) hide show
  1. package/dist/index.cjs +2 -0
  2. package/dist/index.d.ts +315 -0
  3. package/dist/index.js +13 -0
  4. package/dist/layers.-TbWEgSf.js +425 -0
  5. package/dist/layers.0aivjg14.js +202 -0
  6. package/dist/layers.1kchl9Fg.js +33 -0
  7. package/dist/layers.2RmTpOSe.js +65 -0
  8. package/dist/layers.37cL7YbN.js +40 -0
  9. package/dist/layers.4q_x5roN.js +5 -0
  10. package/dist/layers.52famHy6.js +1 -0
  11. package/dist/layers.68ma6K6f.js +1 -0
  12. package/dist/layers.6HZckrJk.js +1 -0
  13. package/dist/layers.7JqFgE4-.js +15 -0
  14. package/dist/layers.8xliMm_4.js +14 -0
  15. package/dist/layers.9pNaFvaX.js +1 -0
  16. package/dist/layers.A7FX8Cpf.js +220 -0
  17. package/dist/layers.B-MfAaIy.js +1 -0
  18. package/dist/layers.B17DijoR.js +6 -0
  19. package/dist/layers.B1970UjZ.js +282 -0
  20. package/dist/layers.B19hGmey.js +1 -0
  21. package/dist/layers.B1IP0xF5.js +122 -0
  22. package/dist/layers.B1TVCKFc.js +423 -0
  23. package/dist/layers.B2wb1BnV.js +1 -0
  24. package/dist/layers.B3D4g2HH.js +1 -0
  25. package/dist/layers.B3QZKSP7.js +4 -0
  26. package/dist/layers.B4cctrKy.js +2235 -0
  27. package/dist/layers.B5eIpqUm.js +5 -0
  28. package/dist/layers.B5fhqRqQ.js +32 -0
  29. package/dist/layers.B5o5YNLY.js +41 -0
  30. package/dist/layers.B7QKbjTP.js +1 -0
  31. package/dist/layers.B7R5e9nb.js +39 -0
  32. package/dist/layers.B9H_VqGH.js +38 -0
  33. package/dist/layers.B9gDt0mt.js +2 -0
  34. package/dist/layers.BAtv1CM7.js +1 -0
  35. package/dist/layers.BAx1rxXM.js +1 -0
  36. package/dist/layers.BBu8KTxD.js +40 -0
  37. package/dist/layers.BC0UHUHZ.js +6 -0
  38. package/dist/layers.BEsDNARG.js +2966 -0
  39. package/dist/layers.BIFfWqjp.js +6 -0
  40. package/dist/layers.BIRO82v2.js +1 -0
  41. package/dist/layers.BIXkxpJg.js +7 -0
  42. package/dist/layers.BIeVwYKL.js +1 -0
  43. package/dist/layers.BJDrjORS.js +244 -0
  44. package/dist/layers.BJWQnQ1b.js +931 -0
  45. package/dist/layers.BKA3G4tE.js +8 -0
  46. package/dist/layers.BKcOrB7G.js +8 -0
  47. package/dist/layers.BLd2spTm.js +1 -0
  48. package/dist/layers.BLomL8Y1.js +40 -0
  49. package/dist/layers.BOGcxS4S.js +11 -0
  50. package/dist/layers.BPpqQ2zl.js +10 -0
  51. package/dist/layers.BQGV7_aP.js +7 -0
  52. package/dist/layers.BQvMgKOV.js +257 -0
  53. package/dist/layers.BRVeeDcH.js +802 -0
  54. package/dist/layers.BSB9eX8_.js +96 -0
  55. package/dist/layers.BSDp4pjf.js +160 -0
  56. package/dist/layers.BSTBZrFn.js +1 -0
  57. package/dist/layers.BWwCeuKP.js +39 -0
  58. package/dist/layers.BXYVnzZo.js +10 -0
  59. package/dist/layers.BYxlPasW.js +9 -0
  60. package/dist/layers.B_C8Ox8-.js +320 -0
  61. package/dist/layers.B_rZy9ZE.js +10 -0
  62. package/dist/layers.BbCfEXyj.js +55 -0
  63. package/dist/layers.Becl7PvM.js +1 -0
  64. package/dist/layers.BekArbNQ.js +501 -0
  65. package/dist/layers.BgOa2ZQq.js +7 -0
  66. package/dist/layers.BhZmc2PE.js +1 -0
  67. package/dist/layers.BhaSD27u.js +8 -0
  68. package/dist/layers.BiJ8hfRt.js +1510 -0
  69. package/dist/layers.Bm7EN78W.js +5 -0
  70. package/dist/layers.BocrFl_z.js +1265 -0
  71. package/dist/layers.BpilXLfW.js +6 -0
  72. package/dist/layers.BrBnUsI5.js +41 -0
  73. package/dist/layers.BrhJtZkc.js +84 -0
  74. package/dist/layers.Bsxy-Zmv.js +7 -0
  75. package/dist/layers.Bu9go6nF.js +10 -0
  76. package/dist/layers.BuJFmhxG.js +1 -0
  77. package/dist/layers.BuNBio9d.js +10 -0
  78. package/dist/layers.BufbpNF2.js +35 -0
  79. package/dist/layers.Bv6t74Ng.js +37 -0
  80. package/dist/layers.Bw7AFM_C.js +39 -0
  81. package/dist/layers.ByEhw12k.js +40 -0
  82. package/dist/layers.Bz8CGnnD.js +32 -0
  83. package/dist/layers.BzfTuld3.js +304 -0
  84. package/dist/layers.C-f2Ts9u.js +32 -0
  85. package/dist/layers.C0Lgw_Sx.js +11688 -0
  86. package/dist/layers.C0xLKPSB.js +7 -0
  87. package/dist/layers.C8_lu5UH.js +23 -0
  88. package/dist/layers.C8d9V9GQ.js +1619 -0
  89. package/dist/layers.C9KUAI3S.js +9 -0
  90. package/dist/layers.C9Qm4iyY.js +51 -0
  91. package/dist/layers.CAAtHbGC.js +1034 -0
  92. package/dist/layers.CBTk7340.js +41 -0
  93. package/dist/layers.CCGTXI7t.js +37 -0
  94. package/dist/layers.CDnEPiFS.js +13 -0
  95. package/dist/layers.CF0jHwg8.js +36 -0
  96. package/dist/layers.CFEmW02q.js +189 -0
  97. package/dist/layers.CFpY72SE.js +1 -0
  98. package/dist/layers.CG-pQKxy.js +32 -0
  99. package/dist/layers.CHZsXQcr.js +1 -0
  100. package/dist/layers.CIBiA4cp.js +9 -0
  101. package/dist/layers.CJ5oFhK5.js +9 -0
  102. package/dist/layers.CLG-12Ft.js +803 -0
  103. package/dist/layers.CLQVPEWO.js +70 -0
  104. package/dist/layers.CNAZOY0z.js +42 -0
  105. package/dist/layers.CNAp0agL.js +11 -0
  106. package/dist/layers.CNNAjKqx.js +42 -0
  107. package/dist/layers.CO0NalVl.js +1283 -0
  108. package/dist/layers.COTtcXWr.js +38 -0
  109. package/dist/layers.COsJBDU8.js +11 -0
  110. package/dist/layers.CPdjh9hT.js +373 -0
  111. package/dist/layers.CSFyrYzY.js +118 -0
  112. package/dist/layers.CX_ayh7E.js +42 -0
  113. package/dist/layers.CeNyh2LV.js +41 -0
  114. package/dist/layers.Ce_CBSin.js +9 -0
  115. package/dist/layers.CfjCZzg8.js +33 -0
  116. package/dist/layers.CfsQNfbN.js +35 -0
  117. package/dist/layers.CgqehJlq.js +268 -0
  118. package/dist/layers.CildyhOW.js +1 -0
  119. package/dist/layers.CjBfNqWg.js +207 -0
  120. package/dist/layers.CjZ_56YO.js +39 -0
  121. package/dist/layers.CqVTtuYm.js +6 -0
  122. package/dist/layers.Ct7y2KbU.js +1 -0
  123. package/dist/layers.CtASemAs.js +1 -0
  124. package/dist/layers.CvCe_XZO.js +44 -0
  125. package/dist/layers.CvF4WyAB.js +8 -0
  126. package/dist/layers.CvgnifSj.js +10 -0
  127. package/dist/layers.CyGuH0wW.js +84 -0
  128. package/dist/layers.Cyzu9PKQ.js +1 -0
  129. package/dist/layers.CzZCiNn3.js +1 -0
  130. package/dist/layers.Cz_HcKZR.js +9 -0
  131. package/dist/layers.CzqAzeMM.js +295 -0
  132. package/dist/layers.D-0DKizI.js +36 -0
  133. package/dist/layers.D-4uOpUj.js +2479 -0
  134. package/dist/layers.D-P1auk3.js +40 -0
  135. package/dist/layers.D-z4IZwp.js +139 -0
  136. package/dist/layers.D0zn4_Mx.js +1 -0
  137. package/dist/layers.D176Y7Vo.js +437 -0
  138. package/dist/layers.D1TLKJdE.js +2 -0
  139. package/dist/layers.D4SM8Ihn.js +10 -0
  140. package/dist/layers.D4T8fTcj.js +1223 -0
  141. package/dist/layers.D7jGxypv.js +8 -0
  142. package/dist/layers.D819V-1U.js +5 -0
  143. package/dist/layers.D92dwfZm.js +9 -0
  144. package/dist/layers.D9oxm2Q3.js +36 -0
  145. package/dist/layers.DAUiVpfA.js +41 -0
  146. package/dist/layers.DAgjLyi0.js +21938 -0
  147. package/dist/layers.DG5DkMsX.js +4 -0
  148. package/dist/layers.DG5nJvev.js +41 -0
  149. package/dist/layers.DGIvTJgm.js +1 -0
  150. package/dist/layers.DGKHsEgL.js +37 -0
  151. package/dist/layers.DJINSxsc.js +1 -0
  152. package/dist/layers.DJJF7QHv.js +39 -0
  153. package/dist/layers.DLK9DV2V.js +40 -0
  154. package/dist/layers.DLNMmOF6.js +10 -0
  155. package/dist/layers.DLwuMfdd.js +84 -0
  156. package/dist/layers.DMkBISW1.js +1 -0
  157. package/dist/layers.DN9HoVxI.js +18 -0
  158. package/dist/layers.DO3jf13r.js +139 -0
  159. package/dist/layers.DOrgOHBr.js +1 -0
  160. package/dist/layers.DRi0nv8t.js +769 -0
  161. package/dist/layers.DTEtUQ-N.js +11 -0
  162. package/dist/layers.DXM-M_t4.js +904 -0
  163. package/dist/layers.DZ4rueAA.js +1126 -0
  164. package/dist/layers.DZAc2rlA.js +19 -0
  165. package/dist/layers.DZAwluRX.js +7 -0
  166. package/dist/layers.D__Ge0jR.js +1580 -0
  167. package/dist/layers.D_qBxnuW.js +6 -0
  168. package/dist/layers.Da7N3t0o.js +59 -0
  169. package/dist/layers.DbCde96z.js +61 -0
  170. package/dist/layers.DbaKVP5e.js +1 -0
  171. package/dist/layers.Deuxf8WS.js +37 -0
  172. package/dist/layers.DgQ6wjQ6.js +1089 -0
  173. package/dist/layers.Dhs3Sikn.js +230 -0
  174. package/dist/layers.DizdRJDv.js +10 -0
  175. package/dist/layers.DjUOC4st.js +16 -0
  176. package/dist/layers.DkRaFpYI.js +39 -0
  177. package/dist/layers.Dn0j_OK5.js +8 -0
  178. package/dist/layers.DneF9QFl.js +39 -0
  179. package/dist/layers.DnohNr8z.js +2 -0
  180. package/dist/layers.DtjaV33P.js +4 -0
  181. package/dist/layers.DtwPvqvM.js +1359 -0
  182. package/dist/layers.DuQS64hQ.js +35 -0
  183. package/dist/layers.DvcL-c1J.js +10 -0
  184. package/dist/layers.DwGEUGi4.js +1 -0
  185. package/dist/layers.Dwf-cmfl.js +1 -0
  186. package/dist/layers.DxA6ocdw.js +70 -0
  187. package/dist/layers.DxuaZtRi.js +116 -0
  188. package/dist/layers.Dy1naDTQ.js +14 -0
  189. package/dist/layers.DyVeJ5nq.js +41 -0
  190. package/dist/layers.Dz5Fekdu.js +8 -0
  191. package/dist/layers.DzTjTsrg.js +52 -0
  192. package/dist/layers.DzWSztoe.js +8 -0
  193. package/dist/layers.DzWUGmmi.js +21763 -0
  194. package/dist/layers.Fv2UzX_J.js +40 -0
  195. package/dist/layers.GGg0Uela.js +48146 -0
  196. package/dist/layers.HISmbvvZ.js +41 -0
  197. package/dist/layers.J-SBicA2.js +39 -0
  198. package/dist/layers.JWCLFILJ.js +1 -0
  199. package/dist/layers.Jy2BJnrD.js +7 -0
  200. package/dist/layers.KNG61fVD.js +32 -0
  201. package/dist/layers.KZKDnGbd.js +9166 -0
  202. package/dist/layers.Kcxw1ZN5.js +8 -0
  203. package/dist/layers.LG7pZboq.js +42 -0
  204. package/dist/layers.N7uLiJJF.js +791 -0
  205. package/dist/layers.P0mMn9V6.js +4 -0
  206. package/dist/layers.RY1Pc_vI.js +39 -0
  207. package/dist/layers.T5F5IY6f.js +38 -0
  208. package/dist/layers.UBsT16id.js +9 -0
  209. package/dist/layers.Ww9bBIaA.js +32 -0
  210. package/dist/layers.YUbPYUxB.js +1088 -0
  211. package/dist/layers.YejPlmok.js +34 -0
  212. package/dist/layers.YsjMDe1Z.js +8 -0
  213. package/dist/layers._IMfh4Om.js +1 -0
  214. package/dist/layers.b0h5ZBmD.js +61 -0
  215. package/dist/layers.cXShihLV.js +793 -0
  216. package/dist/layers.dBCFbDUQ.js +5 -0
  217. package/dist/layers.dsZSDggl.js +1 -0
  218. package/dist/layers.dzPD2Tq6.js +8 -0
  219. package/dist/layers.fdHV7i_n.js +47540 -0
  220. package/dist/layers.g0MJEmgM.js +36 -0
  221. package/dist/layers.g6KGAlYG.js +7 -0
  222. package/dist/layers.gAwY5NlW.js +6 -0
  223. package/dist/layers.hJXmn9h9.js +3 -0
  224. package/dist/layers.hMr_bHrn.js +1 -0
  225. package/dist/layers.hweLqW3I.js +261 -0
  226. package/dist/layers.ifrGR0tH.js +1 -0
  227. package/dist/layers.jS5D2j9k.js +186 -0
  228. package/dist/layers.k5zSy7kx.js +40 -0
  229. package/dist/layers.ku7sc5w7.js +40 -0
  230. package/dist/layers.l0OsrJxT.js +9 -0
  231. package/dist/layers.lCpg7dOn.js +21 -0
  232. package/dist/layers.mcrEJ5IL.js +1 -0
  233. package/dist/layers.mkPf05Ff.js +960 -0
  234. package/dist/layers.n8BNeBDu.js +40 -0
  235. package/dist/layers.nesKhKqv.js +9 -0
  236. package/dist/layers.o8uxn2z6.js +6 -0
  237. package/dist/layers.qKFGZSrv.js +42 -0
  238. package/dist/layers.tehvhFRL.js +11 -0
  239. package/dist/layers.yaVCGcoo.js +7 -0
  240. package/package.json +1 -1
@@ -0,0 +1,2966 @@
1
+ import { l as At, v as zt, i as It, W as Tt, aH as Bt } from "./layers.KZKDnGbd.js";
2
+ const Lt = {};
3
+ function Ot(n, r) {
4
+ const t = Lt, e = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, u = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
5
+ return et(n, e, u);
6
+ }
7
+ function et(n, r, t) {
8
+ if (Dt(n)) {
9
+ if ("value" in n)
10
+ return n.type === "html" && !t ? "" : n.value;
11
+ if (r && "alt" in n && n.alt)
12
+ return n.alt;
13
+ if ("children" in n)
14
+ return Vn(n.children, r, t);
15
+ }
16
+ return Array.isArray(n) ? Vn(n, r, t) : "";
17
+ }
18
+ function Vn(n, r, t) {
19
+ const e = [];
20
+ let u = -1;
21
+ for (; ++u < n.length; )
22
+ e[u] = et(n[u], r, t);
23
+ return e.join("");
24
+ }
25
+ function Dt(n) {
26
+ return !!(n && typeof n == "object");
27
+ }
28
+ function tn(n, r, t, e) {
29
+ const u = n.length;
30
+ let i = 0, l;
31
+ if (r < 0 ? r = -r > u ? 0 : u + r : r = r > u ? u : r, t = t > 0 ? t : 0, e.length < 1e4)
32
+ l = Array.from(e), l.unshift(r, t), n.splice(...l);
33
+ else
34
+ for (t && n.splice(r, t); i < e.length; )
35
+ l = e.slice(i, i + 1e4), l.unshift(r, 0), n.splice(...l), i += 1e4, r += 1e4;
36
+ }
37
+ function Y(n, r) {
38
+ return n.length > 0 ? (tn(n, n.length, 0, r), n) : r;
39
+ }
40
+ const Wn = {}.hasOwnProperty;
41
+ function Pt(n) {
42
+ const r = {};
43
+ let t = -1;
44
+ for (; ++t < n.length; )
45
+ _t(r, n[t]);
46
+ return r;
47
+ }
48
+ function _t(n, r) {
49
+ let t;
50
+ for (t in r) {
51
+ const u = (Wn.call(n, t) ? n[t] : void 0) || (n[t] = {}), i = r[t];
52
+ let l;
53
+ if (i)
54
+ for (l in i) {
55
+ Wn.call(u, l) || (u[l] = []);
56
+ const a = i[l];
57
+ Mt(
58
+ // @ts-expect-error Looks like a list.
59
+ u[l],
60
+ Array.isArray(a) ? a : a ? [a] : []
61
+ );
62
+ }
63
+ }
64
+ }
65
+ function Mt(n, r) {
66
+ let t = -1;
67
+ const e = [];
68
+ for (; ++t < r.length; )
69
+ (r[t].add === "after" ? n : e).push(r[t]);
70
+ tn(n, 0, 0, e);
71
+ }
72
+ const jt = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/, nn = cn(/[A-Za-z]/), v = cn(/[\dA-Za-z]/), Rt = cn(/[#-'*+\--9=?A-Z^-~]/);
73
+ function An(n) {
74
+ return (
75
+ // Special whitespace codes (which have negative values), C0 and Control
76
+ // character DEL
77
+ n !== null && (n < 32 || n === 127)
78
+ );
79
+ }
80
+ const zn = cn(/\d/), qt = cn(/[\dA-Fa-f]/), Ht = cn(/[!-/:-@[-`{-~]/);
81
+ function C(n) {
82
+ return n !== null && n < -2;
83
+ }
84
+ function Z(n) {
85
+ return n !== null && (n < 0 || n === 32);
86
+ }
87
+ function z(n) {
88
+ return n === -2 || n === -1 || n === 32;
89
+ }
90
+ const Nt = cn(jt), Vt = cn(/\s/);
91
+ function cn(n) {
92
+ return r;
93
+ function r(t) {
94
+ return t !== null && n.test(String.fromCharCode(t));
95
+ }
96
+ }
97
+ function O(n, r, t, e) {
98
+ const u = e ? e - 1 : Number.POSITIVE_INFINITY;
99
+ let i = 0;
100
+ return l;
101
+ function l(m) {
102
+ return z(m) ? (n.enter(t), a(m)) : r(m);
103
+ }
104
+ function a(m) {
105
+ return z(m) && i++ < u ? (n.consume(m), a) : (n.exit(t), r(m));
106
+ }
107
+ }
108
+ const Wt = {
109
+ tokenize: Qt
110
+ };
111
+ function Qt(n) {
112
+ const r = n.attempt(
113
+ this.parser.constructs.contentInitial,
114
+ e,
115
+ u
116
+ );
117
+ let t;
118
+ return r;
119
+ function e(a) {
120
+ if (a === null) {
121
+ n.consume(a);
122
+ return;
123
+ }
124
+ return n.enter("lineEnding"), n.consume(a), n.exit("lineEnding"), O(n, r, "linePrefix");
125
+ }
126
+ function u(a) {
127
+ return n.enter("paragraph"), i(a);
128
+ }
129
+ function i(a) {
130
+ const m = n.enter("chunkText", {
131
+ contentType: "text",
132
+ previous: t
133
+ });
134
+ return t && (t.next = m), t = m, l(a);
135
+ }
136
+ function l(a) {
137
+ if (a === null) {
138
+ n.exit("chunkText"), n.exit("paragraph"), n.consume(a);
139
+ return;
140
+ }
141
+ return C(a) ? (n.consume(a), n.exit("chunkText"), i) : (n.consume(a), l);
142
+ }
143
+ }
144
+ const Ut = {
145
+ tokenize: $t
146
+ }, Qn = {
147
+ tokenize: Zt
148
+ };
149
+ function $t(n) {
150
+ const r = this, t = [];
151
+ let e = 0, u, i, l;
152
+ return a;
153
+ function a(F) {
154
+ if (e < t.length) {
155
+ const D = t[e];
156
+ return r.containerState = D[1], n.attempt(
157
+ D[0].continuation,
158
+ m,
159
+ c
160
+ )(F);
161
+ }
162
+ return c(F);
163
+ }
164
+ function m(F) {
165
+ if (e++, r.containerState._closeFlow) {
166
+ r.containerState._closeFlow = void 0, u && j();
167
+ const D = r.events.length;
168
+ let _ = D, k;
169
+ for (; _--; )
170
+ if (r.events[_][0] === "exit" && r.events[_][1].type === "chunkFlow") {
171
+ k = r.events[_][1].end;
172
+ break;
173
+ }
174
+ b(e);
175
+ let T = D;
176
+ for (; T < r.events.length; )
177
+ r.events[T][1].end = Object.assign({}, k), T++;
178
+ return tn(
179
+ r.events,
180
+ _ + 1,
181
+ 0,
182
+ r.events.slice(D)
183
+ ), r.events.length = T, c(F);
184
+ }
185
+ return a(F);
186
+ }
187
+ function c(F) {
188
+ if (e === t.length) {
189
+ if (!u)
190
+ return x(F);
191
+ if (u.currentConstruct && u.currentConstruct.concrete)
192
+ return A(F);
193
+ r.interrupt = !!(u.currentConstruct && !u._gfmTableDynamicInterruptHack);
194
+ }
195
+ return r.containerState = {}, n.check(
196
+ Qn,
197
+ p,
198
+ f
199
+ )(F);
200
+ }
201
+ function p(F) {
202
+ return u && j(), b(e), x(F);
203
+ }
204
+ function f(F) {
205
+ return r.parser.lazy[r.now().line] = e !== t.length, l = r.now().offset, A(F);
206
+ }
207
+ function x(F) {
208
+ return r.containerState = {}, n.attempt(
209
+ Qn,
210
+ h,
211
+ A
212
+ )(F);
213
+ }
214
+ function h(F) {
215
+ return e++, t.push([r.currentConstruct, r.containerState]), x(F);
216
+ }
217
+ function A(F) {
218
+ if (F === null) {
219
+ u && j(), b(0), n.consume(F);
220
+ return;
221
+ }
222
+ return u = u || r.parser.flow(r.now()), n.enter("chunkFlow", {
223
+ contentType: "flow",
224
+ previous: i,
225
+ _tokenizer: u
226
+ }), I(F);
227
+ }
228
+ function I(F) {
229
+ if (F === null) {
230
+ M(n.exit("chunkFlow"), !0), b(0), n.consume(F);
231
+ return;
232
+ }
233
+ return C(F) ? (n.consume(F), M(n.exit("chunkFlow")), e = 0, r.interrupt = void 0, a) : (n.consume(F), I);
234
+ }
235
+ function M(F, D) {
236
+ const _ = r.sliceStream(F);
237
+ if (D && _.push(null), F.previous = i, i && (i.next = F), i = F, u.defineSkip(F.start), u.write(_), r.parser.lazy[F.start.line]) {
238
+ let k = u.events.length;
239
+ for (; k--; )
240
+ if (
241
+ // The token starts before the line ending…
242
+ u.events[k][1].start.offset < l && // …and either is not ended yet…
243
+ (!u.events[k][1].end || // …or ends after it.
244
+ u.events[k][1].end.offset > l)
245
+ )
246
+ return;
247
+ const T = r.events.length;
248
+ let H = T, N, V;
249
+ for (; H--; )
250
+ if (r.events[H][0] === "exit" && r.events[H][1].type === "chunkFlow") {
251
+ if (N) {
252
+ V = r.events[H][1].end;
253
+ break;
254
+ }
255
+ N = !0;
256
+ }
257
+ for (b(e), k = T; k < r.events.length; )
258
+ r.events[k][1].end = Object.assign({}, V), k++;
259
+ tn(
260
+ r.events,
261
+ H + 1,
262
+ 0,
263
+ r.events.slice(T)
264
+ ), r.events.length = k;
265
+ }
266
+ }
267
+ function b(F) {
268
+ let D = t.length;
269
+ for (; D-- > F; ) {
270
+ const _ = t[D];
271
+ r.containerState = _[1], _[0].exit.call(r, n);
272
+ }
273
+ t.length = F;
274
+ }
275
+ function j() {
276
+ u.write([null]), i = void 0, u = void 0, r.containerState._closeFlow = void 0;
277
+ }
278
+ }
279
+ function Zt(n, r, t) {
280
+ return O(
281
+ n,
282
+ n.attempt(this.parser.constructs.document, r, t),
283
+ "linePrefix",
284
+ this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
285
+ );
286
+ }
287
+ function Un(n) {
288
+ if (n === null || Z(n) || Vt(n))
289
+ return 1;
290
+ if (Nt(n))
291
+ return 2;
292
+ }
293
+ function Ln(n, r, t) {
294
+ const e = [];
295
+ let u = -1;
296
+ for (; ++u < n.length; ) {
297
+ const i = n[u].resolveAll;
298
+ i && !e.includes(i) && (r = i(r, t), e.push(i));
299
+ }
300
+ return r;
301
+ }
302
+ const In = {
303
+ name: "attention",
304
+ tokenize: Gt,
305
+ resolveAll: Yt
306
+ };
307
+ function Yt(n, r) {
308
+ let t = -1, e, u, i, l, a, m, c, p;
309
+ for (; ++t < n.length; )
310
+ if (n[t][0] === "enter" && n[t][1].type === "attentionSequence" && n[t][1]._close) {
311
+ for (e = t; e--; )
312
+ if (n[e][0] === "exit" && n[e][1].type === "attentionSequence" && n[e][1]._open && // If the markers are the same:
313
+ r.sliceSerialize(n[e][1]).charCodeAt(0) === r.sliceSerialize(n[t][1]).charCodeAt(0)) {
314
+ if ((n[e][1]._close || n[t][1]._open) && (n[t][1].end.offset - n[t][1].start.offset) % 3 && !((n[e][1].end.offset - n[e][1].start.offset + n[t][1].end.offset - n[t][1].start.offset) % 3))
315
+ continue;
316
+ m = n[e][1].end.offset - n[e][1].start.offset > 1 && n[t][1].end.offset - n[t][1].start.offset > 1 ? 2 : 1;
317
+ const f = Object.assign({}, n[e][1].end), x = Object.assign({}, n[t][1].start);
318
+ $n(f, -m), $n(x, m), l = {
319
+ type: m > 1 ? "strongSequence" : "emphasisSequence",
320
+ start: f,
321
+ end: Object.assign({}, n[e][1].end)
322
+ }, a = {
323
+ type: m > 1 ? "strongSequence" : "emphasisSequence",
324
+ start: Object.assign({}, n[t][1].start),
325
+ end: x
326
+ }, i = {
327
+ type: m > 1 ? "strongText" : "emphasisText",
328
+ start: Object.assign({}, n[e][1].end),
329
+ end: Object.assign({}, n[t][1].start)
330
+ }, u = {
331
+ type: m > 1 ? "strong" : "emphasis",
332
+ start: Object.assign({}, l.start),
333
+ end: Object.assign({}, a.end)
334
+ }, n[e][1].end = Object.assign({}, l.start), n[t][1].start = Object.assign({}, a.end), c = [], n[e][1].end.offset - n[e][1].start.offset && (c = Y(c, [
335
+ ["enter", n[e][1], r],
336
+ ["exit", n[e][1], r]
337
+ ])), c = Y(c, [
338
+ ["enter", u, r],
339
+ ["enter", l, r],
340
+ ["exit", l, r],
341
+ ["enter", i, r]
342
+ ]), c = Y(
343
+ c,
344
+ Ln(
345
+ r.parser.constructs.insideSpan.null,
346
+ n.slice(e + 1, t),
347
+ r
348
+ )
349
+ ), c = Y(c, [
350
+ ["exit", i, r],
351
+ ["enter", a, r],
352
+ ["exit", a, r],
353
+ ["exit", u, r]
354
+ ]), n[t][1].end.offset - n[t][1].start.offset ? (p = 2, c = Y(c, [
355
+ ["enter", n[t][1], r],
356
+ ["exit", n[t][1], r]
357
+ ])) : p = 0, tn(n, e - 1, t - e + 3, c), t = e + c.length - p - 2;
358
+ break;
359
+ }
360
+ }
361
+ for (t = -1; ++t < n.length; )
362
+ n[t][1].type === "attentionSequence" && (n[t][1].type = "data");
363
+ return n;
364
+ }
365
+ function Gt(n, r) {
366
+ const t = this.parser.constructs.attentionMarkers.null, e = this.previous, u = Un(e);
367
+ let i;
368
+ return l;
369
+ function l(m) {
370
+ return i = m, n.enter("attentionSequence"), a(m);
371
+ }
372
+ function a(m) {
373
+ if (m === i)
374
+ return n.consume(m), a;
375
+ const c = n.exit("attentionSequence"), p = Un(m), f = !p || p === 2 && u || t.includes(m), x = !u || u === 2 && p || t.includes(e);
376
+ return c._open = !!(i === 42 ? f : f && (u || !x)), c._close = !!(i === 42 ? x : x && (p || !f)), r(m);
377
+ }
378
+ }
379
+ function $n(n, r) {
380
+ n.column += r, n.offset += r, n._bufferIndex += r;
381
+ }
382
+ const Jt = {
383
+ name: "autolink",
384
+ tokenize: Kt
385
+ };
386
+ function Kt(n, r, t) {
387
+ let e = 0;
388
+ return u;
389
+ function u(h) {
390
+ return n.enter("autolink"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.enter("autolinkProtocol"), i;
391
+ }
392
+ function i(h) {
393
+ return nn(h) ? (n.consume(h), l) : c(h);
394
+ }
395
+ function l(h) {
396
+ return h === 43 || h === 45 || h === 46 || v(h) ? (e = 1, a(h)) : c(h);
397
+ }
398
+ function a(h) {
399
+ return h === 58 ? (n.consume(h), e = 0, m) : (h === 43 || h === 45 || h === 46 || v(h)) && e++ < 32 ? (n.consume(h), a) : (e = 0, c(h));
400
+ }
401
+ function m(h) {
402
+ return h === 62 ? (n.exit("autolinkProtocol"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : h === null || h === 32 || h === 60 || An(h) ? t(h) : (n.consume(h), m);
403
+ }
404
+ function c(h) {
405
+ return h === 64 ? (n.consume(h), p) : Rt(h) ? (n.consume(h), c) : t(h);
406
+ }
407
+ function p(h) {
408
+ return v(h) ? f(h) : t(h);
409
+ }
410
+ function f(h) {
411
+ return h === 46 ? (n.consume(h), e = 0, p) : h === 62 ? (n.exit("autolinkProtocol").type = "autolinkEmail", n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : x(h);
412
+ }
413
+ function x(h) {
414
+ if ((h === 45 || v(h)) && e++ < 63) {
415
+ const A = h === 45 ? x : f;
416
+ return n.consume(h), A;
417
+ }
418
+ return t(h);
419
+ }
420
+ }
421
+ const Sn = {
422
+ tokenize: Xt,
423
+ partial: !0
424
+ };
425
+ function Xt(n, r, t) {
426
+ return e;
427
+ function e(i) {
428
+ return z(i) ? O(n, u, "linePrefix")(i) : u(i);
429
+ }
430
+ function u(i) {
431
+ return i === null || C(i) ? r(i) : t(i);
432
+ }
433
+ }
434
+ const rt = {
435
+ name: "blockQuote",
436
+ tokenize: vt,
437
+ continuation: {
438
+ tokenize: ne
439
+ },
440
+ exit: te
441
+ };
442
+ function vt(n, r, t) {
443
+ const e = this;
444
+ return u;
445
+ function u(l) {
446
+ if (l === 62) {
447
+ const a = e.containerState;
448
+ return a.open || (n.enter("blockQuote", {
449
+ _container: !0
450
+ }), a.open = !0), n.enter("blockQuotePrefix"), n.enter("blockQuoteMarker"), n.consume(l), n.exit("blockQuoteMarker"), i;
451
+ }
452
+ return t(l);
453
+ }
454
+ function i(l) {
455
+ return z(l) ? (n.enter("blockQuotePrefixWhitespace"), n.consume(l), n.exit("blockQuotePrefixWhitespace"), n.exit("blockQuotePrefix"), r) : (n.exit("blockQuotePrefix"), r(l));
456
+ }
457
+ }
458
+ function ne(n, r, t) {
459
+ const e = this;
460
+ return u;
461
+ function u(l) {
462
+ return z(l) ? O(
463
+ n,
464
+ i,
465
+ "linePrefix",
466
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
467
+ )(l) : i(l);
468
+ }
469
+ function i(l) {
470
+ return n.attempt(rt, r, t)(l);
471
+ }
472
+ }
473
+ function te(n) {
474
+ n.exit("blockQuote");
475
+ }
476
+ const it = {
477
+ name: "characterEscape",
478
+ tokenize: ee
479
+ };
480
+ function ee(n, r, t) {
481
+ return e;
482
+ function e(i) {
483
+ return n.enter("characterEscape"), n.enter("escapeMarker"), n.consume(i), n.exit("escapeMarker"), u;
484
+ }
485
+ function u(i) {
486
+ return Ht(i) ? (n.enter("characterEscapeValue"), n.consume(i), n.exit("characterEscapeValue"), n.exit("characterEscape"), r) : t(i);
487
+ }
488
+ }
489
+ const Zn = document.createElement("i");
490
+ function On(n) {
491
+ const r = "&" + n + ";";
492
+ Zn.innerHTML = r;
493
+ const t = Zn.textContent;
494
+ return (
495
+ // @ts-expect-error: TypeScript is wrong that `textContent` on elements can
496
+ // yield `null`.
497
+ t.charCodeAt(t.length - 1) === 59 && n !== "semi" || t === r ? !1 : t
498
+ );
499
+ }
500
+ const ut = {
501
+ name: "characterReference",
502
+ tokenize: re
503
+ };
504
+ function re(n, r, t) {
505
+ const e = this;
506
+ let u = 0, i, l;
507
+ return a;
508
+ function a(f) {
509
+ return n.enter("characterReference"), n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), m;
510
+ }
511
+ function m(f) {
512
+ return f === 35 ? (n.enter("characterReferenceMarkerNumeric"), n.consume(f), n.exit("characterReferenceMarkerNumeric"), c) : (n.enter("characterReferenceValue"), i = 31, l = v, p(f));
513
+ }
514
+ function c(f) {
515
+ return f === 88 || f === 120 ? (n.enter("characterReferenceMarkerHexadecimal"), n.consume(f), n.exit("characterReferenceMarkerHexadecimal"), n.enter("characterReferenceValue"), i = 6, l = qt, p) : (n.enter("characterReferenceValue"), i = 7, l = zn, p(f));
516
+ }
517
+ function p(f) {
518
+ if (f === 59 && u) {
519
+ const x = n.exit("characterReferenceValue");
520
+ return l === v && !On(e.sliceSerialize(x)) ? t(f) : (n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), n.exit("characterReference"), r);
521
+ }
522
+ return l(f) && u++ < i ? (n.consume(f), p) : t(f);
523
+ }
524
+ }
525
+ const Yn = {
526
+ tokenize: ue,
527
+ partial: !0
528
+ }, Gn = {
529
+ name: "codeFenced",
530
+ tokenize: ie,
531
+ concrete: !0
532
+ };
533
+ function ie(n, r, t) {
534
+ const e = this, u = {
535
+ tokenize: _,
536
+ partial: !0
537
+ };
538
+ let i = 0, l = 0, a;
539
+ return m;
540
+ function m(k) {
541
+ return c(k);
542
+ }
543
+ function c(k) {
544
+ const T = e.events[e.events.length - 1];
545
+ return i = T && T[1].type === "linePrefix" ? T[2].sliceSerialize(T[1], !0).length : 0, a = k, n.enter("codeFenced"), n.enter("codeFencedFence"), n.enter("codeFencedFenceSequence"), p(k);
546
+ }
547
+ function p(k) {
548
+ return k === a ? (l++, n.consume(k), p) : l < 3 ? t(k) : (n.exit("codeFencedFenceSequence"), z(k) ? O(n, f, "whitespace")(k) : f(k));
549
+ }
550
+ function f(k) {
551
+ return k === null || C(k) ? (n.exit("codeFencedFence"), e.interrupt ? r(k) : n.check(Yn, I, D)(k)) : (n.enter("codeFencedFenceInfo"), n.enter("chunkString", {
552
+ contentType: "string"
553
+ }), x(k));
554
+ }
555
+ function x(k) {
556
+ return k === null || C(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), f(k)) : z(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), O(n, h, "whitespace")(k)) : k === 96 && k === a ? t(k) : (n.consume(k), x);
557
+ }
558
+ function h(k) {
559
+ return k === null || C(k) ? f(k) : (n.enter("codeFencedFenceMeta"), n.enter("chunkString", {
560
+ contentType: "string"
561
+ }), A(k));
562
+ }
563
+ function A(k) {
564
+ return k === null || C(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceMeta"), f(k)) : k === 96 && k === a ? t(k) : (n.consume(k), A);
565
+ }
566
+ function I(k) {
567
+ return n.attempt(u, D, M)(k);
568
+ }
569
+ function M(k) {
570
+ return n.enter("lineEnding"), n.consume(k), n.exit("lineEnding"), b;
571
+ }
572
+ function b(k) {
573
+ return i > 0 && z(k) ? O(
574
+ n,
575
+ j,
576
+ "linePrefix",
577
+ i + 1
578
+ )(k) : j(k);
579
+ }
580
+ function j(k) {
581
+ return k === null || C(k) ? n.check(Yn, I, D)(k) : (n.enter("codeFlowValue"), F(k));
582
+ }
583
+ function F(k) {
584
+ return k === null || C(k) ? (n.exit("codeFlowValue"), j(k)) : (n.consume(k), F);
585
+ }
586
+ function D(k) {
587
+ return n.exit("codeFenced"), r(k);
588
+ }
589
+ function _(k, T, H) {
590
+ let N = 0;
591
+ return V;
592
+ function V(w) {
593
+ return k.enter("lineEnding"), k.consume(w), k.exit("lineEnding"), y;
594
+ }
595
+ function y(w) {
596
+ return k.enter("codeFencedFence"), z(w) ? O(
597
+ k,
598
+ S,
599
+ "linePrefix",
600
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
601
+ )(w) : S(w);
602
+ }
603
+ function S(w) {
604
+ return w === a ? (k.enter("codeFencedFenceSequence"), P(w)) : H(w);
605
+ }
606
+ function P(w) {
607
+ return w === a ? (N++, k.consume(w), P) : N >= l ? (k.exit("codeFencedFenceSequence"), z(w) ? O(k, R, "whitespace")(w) : R(w)) : H(w);
608
+ }
609
+ function R(w) {
610
+ return w === null || C(w) ? (k.exit("codeFencedFence"), T(w)) : H(w);
611
+ }
612
+ }
613
+ }
614
+ function ue(n, r, t) {
615
+ const e = this;
616
+ return u;
617
+ function u(l) {
618
+ return l === null ? t(l) : (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i);
619
+ }
620
+ function i(l) {
621
+ return e.parser.lazy[e.now().line] ? t(l) : r(l);
622
+ }
623
+ }
624
+ const Cn = {
625
+ name: "codeIndented",
626
+ tokenize: ae
627
+ }, le = {
628
+ tokenize: oe,
629
+ partial: !0
630
+ };
631
+ function ae(n, r, t) {
632
+ const e = this;
633
+ return u;
634
+ function u(c) {
635
+ return n.enter("codeIndented"), O(n, i, "linePrefix", 5)(c);
636
+ }
637
+ function i(c) {
638
+ const p = e.events[e.events.length - 1];
639
+ return p && p[1].type === "linePrefix" && p[2].sliceSerialize(p[1], !0).length >= 4 ? l(c) : t(c);
640
+ }
641
+ function l(c) {
642
+ return c === null ? m(c) : C(c) ? n.attempt(le, l, m)(c) : (n.enter("codeFlowValue"), a(c));
643
+ }
644
+ function a(c) {
645
+ return c === null || C(c) ? (n.exit("codeFlowValue"), l(c)) : (n.consume(c), a);
646
+ }
647
+ function m(c) {
648
+ return n.exit("codeIndented"), r(c);
649
+ }
650
+ }
651
+ function oe(n, r, t) {
652
+ const e = this;
653
+ return u;
654
+ function u(l) {
655
+ return e.parser.lazy[e.now().line] ? t(l) : C(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), u) : O(n, i, "linePrefix", 5)(l);
656
+ }
657
+ function i(l) {
658
+ const a = e.events[e.events.length - 1];
659
+ return a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(l) : C(l) ? u(l) : t(l);
660
+ }
661
+ }
662
+ const se = {
663
+ name: "codeText",
664
+ tokenize: pe,
665
+ resolve: ce,
666
+ previous: he
667
+ };
668
+ function ce(n) {
669
+ let r = n.length - 4, t = 3, e, u;
670
+ if ((n[t][1].type === "lineEnding" || n[t][1].type === "space") && (n[r][1].type === "lineEnding" || n[r][1].type === "space")) {
671
+ for (e = t; ++e < r; )
672
+ if (n[e][1].type === "codeTextData") {
673
+ n[t][1].type = "codeTextPadding", n[r][1].type = "codeTextPadding", t += 2, r -= 2;
674
+ break;
675
+ }
676
+ }
677
+ for (e = t - 1, r++; ++e <= r; )
678
+ u === void 0 ? e !== r && n[e][1].type !== "lineEnding" && (u = e) : (e === r || n[e][1].type === "lineEnding") && (n[u][1].type = "codeTextData", e !== u + 2 && (n[u][1].end = n[e - 1][1].end, n.splice(u + 2, e - u - 2), r -= e - u - 2, e = u + 2), u = void 0);
679
+ return n;
680
+ }
681
+ function he(n) {
682
+ return n !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
683
+ }
684
+ function pe(n, r, t) {
685
+ let e = 0, u, i;
686
+ return l;
687
+ function l(f) {
688
+ return n.enter("codeText"), n.enter("codeTextSequence"), a(f);
689
+ }
690
+ function a(f) {
691
+ return f === 96 ? (n.consume(f), e++, a) : (n.exit("codeTextSequence"), m(f));
692
+ }
693
+ function m(f) {
694
+ return f === null ? t(f) : f === 32 ? (n.enter("space"), n.consume(f), n.exit("space"), m) : f === 96 ? (i = n.enter("codeTextSequence"), u = 0, p(f)) : C(f) ? (n.enter("lineEnding"), n.consume(f), n.exit("lineEnding"), m) : (n.enter("codeTextData"), c(f));
695
+ }
696
+ function c(f) {
697
+ return f === null || f === 32 || f === 96 || C(f) ? (n.exit("codeTextData"), m(f)) : (n.consume(f), c);
698
+ }
699
+ function p(f) {
700
+ return f === 96 ? (n.consume(f), u++, p) : u === e ? (n.exit("codeTextSequence"), n.exit("codeText"), r(f)) : (i.type = "codeTextData", c(f));
701
+ }
702
+ }
703
+ function lt(n) {
704
+ const r = {};
705
+ let t = -1, e, u, i, l, a, m, c;
706
+ for (; ++t < n.length; ) {
707
+ for (; t in r; )
708
+ t = r[t];
709
+ if (e = n[t], t && e[1].type === "chunkFlow" && n[t - 1][1].type === "listItemPrefix" && (m = e[1]._tokenizer.events, i = 0, i < m.length && m[i][1].type === "lineEndingBlank" && (i += 2), i < m.length && m[i][1].type === "content"))
710
+ for (; ++i < m.length && m[i][1].type !== "content"; )
711
+ m[i][1].type === "chunkText" && (m[i][1]._isInFirstContentOfListItem = !0, i++);
712
+ if (e[0] === "enter")
713
+ e[1].contentType && (Object.assign(r, fe(n, t)), t = r[t], c = !0);
714
+ else if (e[1]._container) {
715
+ for (i = t, u = void 0; i-- && (l = n[i], l[1].type === "lineEnding" || l[1].type === "lineEndingBlank"); )
716
+ l[0] === "enter" && (u && (n[u][1].type = "lineEndingBlank"), l[1].type = "lineEnding", u = i);
717
+ u && (e[1].end = Object.assign({}, n[u][1].start), a = n.slice(u, t), a.unshift(e), tn(n, u, t - u + 1, a));
718
+ }
719
+ }
720
+ return !c;
721
+ }
722
+ function fe(n, r) {
723
+ const t = n[r][1], e = n[r][2];
724
+ let u = r - 1;
725
+ const i = [], l = t._tokenizer || e.parser[t.contentType](t.start), a = l.events, m = [], c = {};
726
+ let p, f, x = -1, h = t, A = 0, I = 0;
727
+ const M = [I];
728
+ for (; h; ) {
729
+ for (; n[++u][1] !== h; )
730
+ ;
731
+ i.push(u), h._tokenizer || (p = e.sliceStream(h), h.next || p.push(null), f && l.defineSkip(h.start), h._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = !0), l.write(p), h._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = void 0)), f = h, h = h.next;
732
+ }
733
+ for (h = t; ++x < a.length; )
734
+ // Find a void token that includes a break.
735
+ a[x][0] === "exit" && a[x - 1][0] === "enter" && a[x][1].type === a[x - 1][1].type && a[x][1].start.line !== a[x][1].end.line && (I = x + 1, M.push(I), h._tokenizer = void 0, h.previous = void 0, h = h.next);
736
+ for (l.events = [], h ? (h._tokenizer = void 0, h.previous = void 0) : M.pop(), x = M.length; x--; ) {
737
+ const b = a.slice(M[x], M[x + 1]), j = i.pop();
738
+ m.unshift([j, j + b.length - 1]), tn(n, j, 2, b);
739
+ }
740
+ for (x = -1; ++x < m.length; )
741
+ c[A + m[x][0]] = A + m[x][1], A += m[x][1] - m[x][0] - 1;
742
+ return c;
743
+ }
744
+ const me = {
745
+ tokenize: ke,
746
+ resolve: ge
747
+ }, xe = {
748
+ tokenize: de,
749
+ partial: !0
750
+ };
751
+ function ge(n) {
752
+ return lt(n), n;
753
+ }
754
+ function ke(n, r) {
755
+ let t;
756
+ return e;
757
+ function e(a) {
758
+ return n.enter("content"), t = n.enter("chunkContent", {
759
+ contentType: "content"
760
+ }), u(a);
761
+ }
762
+ function u(a) {
763
+ return a === null ? i(a) : C(a) ? n.check(
764
+ xe,
765
+ l,
766
+ i
767
+ )(a) : (n.consume(a), u);
768
+ }
769
+ function i(a) {
770
+ return n.exit("chunkContent"), n.exit("content"), r(a);
771
+ }
772
+ function l(a) {
773
+ return n.consume(a), n.exit("chunkContent"), t.next = n.enter("chunkContent", {
774
+ contentType: "content",
775
+ previous: t
776
+ }), t = t.next, u;
777
+ }
778
+ }
779
+ function de(n, r, t) {
780
+ const e = this;
781
+ return u;
782
+ function u(l) {
783
+ return n.exit("chunkContent"), n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), O(n, i, "linePrefix");
784
+ }
785
+ function i(l) {
786
+ if (l === null || C(l))
787
+ return t(l);
788
+ const a = e.events[e.events.length - 1];
789
+ return !e.parser.constructs.disable.null.includes("codeIndented") && a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(l) : n.interrupt(e.parser.constructs.flow, t, r)(l);
790
+ }
791
+ }
792
+ function at(n, r, t, e, u, i, l, a, m) {
793
+ const c = m || Number.POSITIVE_INFINITY;
794
+ let p = 0;
795
+ return f;
796
+ function f(b) {
797
+ return b === 60 ? (n.enter(e), n.enter(u), n.enter(i), n.consume(b), n.exit(i), x) : b === null || b === 32 || b === 41 || An(b) ? t(b) : (n.enter(e), n.enter(l), n.enter(a), n.enter("chunkString", {
798
+ contentType: "string"
799
+ }), I(b));
800
+ }
801
+ function x(b) {
802
+ return b === 62 ? (n.enter(i), n.consume(b), n.exit(i), n.exit(u), n.exit(e), r) : (n.enter(a), n.enter("chunkString", {
803
+ contentType: "string"
804
+ }), h(b));
805
+ }
806
+ function h(b) {
807
+ return b === 62 ? (n.exit("chunkString"), n.exit(a), x(b)) : b === null || b === 60 || C(b) ? t(b) : (n.consume(b), b === 92 ? A : h);
808
+ }
809
+ function A(b) {
810
+ return b === 60 || b === 62 || b === 92 ? (n.consume(b), h) : h(b);
811
+ }
812
+ function I(b) {
813
+ return !p && (b === null || b === 41 || Z(b)) ? (n.exit("chunkString"), n.exit(a), n.exit(l), n.exit(e), r(b)) : p < c && b === 40 ? (n.consume(b), p++, I) : b === 41 ? (n.consume(b), p--, I) : b === null || b === 32 || b === 40 || An(b) ? t(b) : (n.consume(b), b === 92 ? M : I);
814
+ }
815
+ function M(b) {
816
+ return b === 40 || b === 41 || b === 92 ? (n.consume(b), I) : I(b);
817
+ }
818
+ }
819
+ function ot(n, r, t, e, u, i) {
820
+ const l = this;
821
+ let a = 0, m;
822
+ return c;
823
+ function c(h) {
824
+ return n.enter(e), n.enter(u), n.consume(h), n.exit(u), n.enter(i), p;
825
+ }
826
+ function p(h) {
827
+ return a > 999 || h === null || h === 91 || h === 93 && !m || // To do: remove in the future once we’ve switched from
828
+ // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
829
+ // which doesn’t need this.
830
+ // Hidden footnotes hook.
831
+ /* c8 ignore next 3 */
832
+ h === 94 && !a && "_hiddenFootnoteSupport" in l.parser.constructs ? t(h) : h === 93 ? (n.exit(i), n.enter(u), n.consume(h), n.exit(u), n.exit(e), r) : C(h) ? (n.enter("lineEnding"), n.consume(h), n.exit("lineEnding"), p) : (n.enter("chunkString", {
833
+ contentType: "string"
834
+ }), f(h));
835
+ }
836
+ function f(h) {
837
+ return h === null || h === 91 || h === 93 || C(h) || a++ > 999 ? (n.exit("chunkString"), p(h)) : (n.consume(h), m || (m = !z(h)), h === 92 ? x : f);
838
+ }
839
+ function x(h) {
840
+ return h === 91 || h === 92 || h === 93 ? (n.consume(h), a++, f) : f(h);
841
+ }
842
+ }
843
+ function st(n, r, t, e, u, i) {
844
+ let l;
845
+ return a;
846
+ function a(x) {
847
+ return x === 34 || x === 39 || x === 40 ? (n.enter(e), n.enter(u), n.consume(x), n.exit(u), l = x === 40 ? 41 : x, m) : t(x);
848
+ }
849
+ function m(x) {
850
+ return x === l ? (n.enter(u), n.consume(x), n.exit(u), n.exit(e), r) : (n.enter(i), c(x));
851
+ }
852
+ function c(x) {
853
+ return x === l ? (n.exit(i), m(l)) : x === null ? t(x) : C(x) ? (n.enter("lineEnding"), n.consume(x), n.exit("lineEnding"), O(n, c, "linePrefix")) : (n.enter("chunkString", {
854
+ contentType: "string"
855
+ }), p(x));
856
+ }
857
+ function p(x) {
858
+ return x === l || x === null || C(x) ? (n.exit("chunkString"), c(x)) : (n.consume(x), x === 92 ? f : p);
859
+ }
860
+ function f(x) {
861
+ return x === l || x === 92 ? (n.consume(x), p) : p(x);
862
+ }
863
+ }
864
+ function dn(n, r) {
865
+ let t;
866
+ return e;
867
+ function e(u) {
868
+ return C(u) ? (n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), t = !0, e) : z(u) ? O(
869
+ n,
870
+ e,
871
+ t ? "linePrefix" : "lineSuffix"
872
+ )(u) : r(u);
873
+ }
874
+ }
875
+ function xn(n) {
876
+ return n.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
877
+ }
878
+ const be = {
879
+ name: "definition",
880
+ tokenize: Se
881
+ }, ye = {
882
+ tokenize: Fe,
883
+ partial: !0
884
+ };
885
+ function Se(n, r, t) {
886
+ const e = this;
887
+ let u;
888
+ return i;
889
+ function i(h) {
890
+ return n.enter("definition"), l(h);
891
+ }
892
+ function l(h) {
893
+ return ot.call(
894
+ e,
895
+ n,
896
+ a,
897
+ // Note: we don’t need to reset the way `markdown-rs` does.
898
+ t,
899
+ "definitionLabel",
900
+ "definitionLabelMarker",
901
+ "definitionLabelString"
902
+ )(h);
903
+ }
904
+ function a(h) {
905
+ return u = xn(
906
+ e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1)
907
+ ), h === 58 ? (n.enter("definitionMarker"), n.consume(h), n.exit("definitionMarker"), m) : t(h);
908
+ }
909
+ function m(h) {
910
+ return Z(h) ? dn(n, c)(h) : c(h);
911
+ }
912
+ function c(h) {
913
+ return at(
914
+ n,
915
+ p,
916
+ // Note: we don’t need to reset the way `markdown-rs` does.
917
+ t,
918
+ "definitionDestination",
919
+ "definitionDestinationLiteral",
920
+ "definitionDestinationLiteralMarker",
921
+ "definitionDestinationRaw",
922
+ "definitionDestinationString"
923
+ )(h);
924
+ }
925
+ function p(h) {
926
+ return n.attempt(ye, f, f)(h);
927
+ }
928
+ function f(h) {
929
+ return z(h) ? O(n, x, "whitespace")(h) : x(h);
930
+ }
931
+ function x(h) {
932
+ return h === null || C(h) ? (n.exit("definition"), e.parser.defined.push(u), r(h)) : t(h);
933
+ }
934
+ }
935
+ function Fe(n, r, t) {
936
+ return e;
937
+ function e(a) {
938
+ return Z(a) ? dn(n, u)(a) : t(a);
939
+ }
940
+ function u(a) {
941
+ return st(
942
+ n,
943
+ i,
944
+ t,
945
+ "definitionTitle",
946
+ "definitionTitleMarker",
947
+ "definitionTitleString"
948
+ )(a);
949
+ }
950
+ function i(a) {
951
+ return z(a) ? O(n, l, "whitespace")(a) : l(a);
952
+ }
953
+ function l(a) {
954
+ return a === null || C(a) ? r(a) : t(a);
955
+ }
956
+ }
957
+ const Ee = {
958
+ name: "hardBreakEscape",
959
+ tokenize: Ce
960
+ };
961
+ function Ce(n, r, t) {
962
+ return e;
963
+ function e(i) {
964
+ return n.enter("hardBreakEscape"), n.consume(i), u;
965
+ }
966
+ function u(i) {
967
+ return C(i) ? (n.exit("hardBreakEscape"), r(i)) : t(i);
968
+ }
969
+ }
970
+ const we = {
971
+ name: "headingAtx",
972
+ tokenize: ze,
973
+ resolve: Ae
974
+ };
975
+ function Ae(n, r) {
976
+ let t = n.length - 2, e = 3, u, i;
977
+ return n[e][1].type === "whitespace" && (e += 2), t - 2 > e && n[t][1].type === "whitespace" && (t -= 2), n[t][1].type === "atxHeadingSequence" && (e === t - 1 || t - 4 > e && n[t - 2][1].type === "whitespace") && (t -= e + 1 === t ? 2 : 4), t > e && (u = {
978
+ type: "atxHeadingText",
979
+ start: n[e][1].start,
980
+ end: n[t][1].end
981
+ }, i = {
982
+ type: "chunkText",
983
+ start: n[e][1].start,
984
+ end: n[t][1].end,
985
+ contentType: "text"
986
+ }, tn(n, e, t - e + 1, [
987
+ ["enter", u, r],
988
+ ["enter", i, r],
989
+ ["exit", i, r],
990
+ ["exit", u, r]
991
+ ])), n;
992
+ }
993
+ function ze(n, r, t) {
994
+ let e = 0;
995
+ return u;
996
+ function u(p) {
997
+ return n.enter("atxHeading"), i(p);
998
+ }
999
+ function i(p) {
1000
+ return n.enter("atxHeadingSequence"), l(p);
1001
+ }
1002
+ function l(p) {
1003
+ return p === 35 && e++ < 6 ? (n.consume(p), l) : p === null || Z(p) ? (n.exit("atxHeadingSequence"), a(p)) : t(p);
1004
+ }
1005
+ function a(p) {
1006
+ return p === 35 ? (n.enter("atxHeadingSequence"), m(p)) : p === null || C(p) ? (n.exit("atxHeading"), r(p)) : z(p) ? O(n, a, "whitespace")(p) : (n.enter("atxHeadingText"), c(p));
1007
+ }
1008
+ function m(p) {
1009
+ return p === 35 ? (n.consume(p), m) : (n.exit("atxHeadingSequence"), a(p));
1010
+ }
1011
+ function c(p) {
1012
+ return p === null || p === 35 || Z(p) ? (n.exit("atxHeadingText"), a(p)) : (n.consume(p), c);
1013
+ }
1014
+ }
1015
+ const Ie = [
1016
+ "address",
1017
+ "article",
1018
+ "aside",
1019
+ "base",
1020
+ "basefont",
1021
+ "blockquote",
1022
+ "body",
1023
+ "caption",
1024
+ "center",
1025
+ "col",
1026
+ "colgroup",
1027
+ "dd",
1028
+ "details",
1029
+ "dialog",
1030
+ "dir",
1031
+ "div",
1032
+ "dl",
1033
+ "dt",
1034
+ "fieldset",
1035
+ "figcaption",
1036
+ "figure",
1037
+ "footer",
1038
+ "form",
1039
+ "frame",
1040
+ "frameset",
1041
+ "h1",
1042
+ "h2",
1043
+ "h3",
1044
+ "h4",
1045
+ "h5",
1046
+ "h6",
1047
+ "head",
1048
+ "header",
1049
+ "hr",
1050
+ "html",
1051
+ "iframe",
1052
+ "legend",
1053
+ "li",
1054
+ "link",
1055
+ "main",
1056
+ "menu",
1057
+ "menuitem",
1058
+ "nav",
1059
+ "noframes",
1060
+ "ol",
1061
+ "optgroup",
1062
+ "option",
1063
+ "p",
1064
+ "param",
1065
+ "search",
1066
+ "section",
1067
+ "summary",
1068
+ "table",
1069
+ "tbody",
1070
+ "td",
1071
+ "tfoot",
1072
+ "th",
1073
+ "thead",
1074
+ "title",
1075
+ "tr",
1076
+ "track",
1077
+ "ul"
1078
+ ], Jn = ["pre", "script", "style", "textarea"], Te = {
1079
+ name: "htmlFlow",
1080
+ tokenize: De,
1081
+ resolveTo: Oe,
1082
+ concrete: !0
1083
+ }, Be = {
1084
+ tokenize: _e,
1085
+ partial: !0
1086
+ }, Le = {
1087
+ tokenize: Pe,
1088
+ partial: !0
1089
+ };
1090
+ function Oe(n) {
1091
+ let r = n.length;
1092
+ for (; r-- && !(n[r][0] === "enter" && n[r][1].type === "htmlFlow"); )
1093
+ ;
1094
+ return r > 1 && n[r - 2][1].type === "linePrefix" && (n[r][1].start = n[r - 2][1].start, n[r + 1][1].start = n[r - 2][1].start, n.splice(r - 2, 2)), n;
1095
+ }
1096
+ function De(n, r, t) {
1097
+ const e = this;
1098
+ let u, i, l, a, m;
1099
+ return c;
1100
+ function c(s) {
1101
+ return p(s);
1102
+ }
1103
+ function p(s) {
1104
+ return n.enter("htmlFlow"), n.enter("htmlFlowData"), n.consume(s), f;
1105
+ }
1106
+ function f(s) {
1107
+ return s === 33 ? (n.consume(s), x) : s === 47 ? (n.consume(s), i = !0, I) : s === 63 ? (n.consume(s), u = 3, e.interrupt ? r : o) : nn(s) ? (n.consume(s), l = String.fromCharCode(s), M) : t(s);
1108
+ }
1109
+ function x(s) {
1110
+ return s === 45 ? (n.consume(s), u = 2, h) : s === 91 ? (n.consume(s), u = 5, a = 0, A) : nn(s) ? (n.consume(s), u = 4, e.interrupt ? r : o) : t(s);
1111
+ }
1112
+ function h(s) {
1113
+ return s === 45 ? (n.consume(s), e.interrupt ? r : o) : t(s);
1114
+ }
1115
+ function A(s) {
1116
+ const K = "CDATA[";
1117
+ return s === K.charCodeAt(a++) ? (n.consume(s), a === K.length ? e.interrupt ? r : S : A) : t(s);
1118
+ }
1119
+ function I(s) {
1120
+ return nn(s) ? (n.consume(s), l = String.fromCharCode(s), M) : t(s);
1121
+ }
1122
+ function M(s) {
1123
+ if (s === null || s === 47 || s === 62 || Z(s)) {
1124
+ const K = s === 47, hn = l.toLowerCase();
1125
+ return !K && !i && Jn.includes(hn) ? (u = 1, e.interrupt ? r(s) : S(s)) : Ie.includes(l.toLowerCase()) ? (u = 6, K ? (n.consume(s), b) : e.interrupt ? r(s) : S(s)) : (u = 7, e.interrupt && !e.parser.lazy[e.now().line] ? t(s) : i ? j(s) : F(s));
1126
+ }
1127
+ return s === 45 || v(s) ? (n.consume(s), l += String.fromCharCode(s), M) : t(s);
1128
+ }
1129
+ function b(s) {
1130
+ return s === 62 ? (n.consume(s), e.interrupt ? r : S) : t(s);
1131
+ }
1132
+ function j(s) {
1133
+ return z(s) ? (n.consume(s), j) : V(s);
1134
+ }
1135
+ function F(s) {
1136
+ return s === 47 ? (n.consume(s), V) : s === 58 || s === 95 || nn(s) ? (n.consume(s), D) : z(s) ? (n.consume(s), F) : V(s);
1137
+ }
1138
+ function D(s) {
1139
+ return s === 45 || s === 46 || s === 58 || s === 95 || v(s) ? (n.consume(s), D) : _(s);
1140
+ }
1141
+ function _(s) {
1142
+ return s === 61 ? (n.consume(s), k) : z(s) ? (n.consume(s), _) : F(s);
1143
+ }
1144
+ function k(s) {
1145
+ return s === null || s === 60 || s === 61 || s === 62 || s === 96 ? t(s) : s === 34 || s === 39 ? (n.consume(s), m = s, T) : z(s) ? (n.consume(s), k) : H(s);
1146
+ }
1147
+ function T(s) {
1148
+ return s === m ? (n.consume(s), m = null, N) : s === null || C(s) ? t(s) : (n.consume(s), T);
1149
+ }
1150
+ function H(s) {
1151
+ return s === null || s === 34 || s === 39 || s === 47 || s === 60 || s === 61 || s === 62 || s === 96 || Z(s) ? _(s) : (n.consume(s), H);
1152
+ }
1153
+ function N(s) {
1154
+ return s === 47 || s === 62 || z(s) ? F(s) : t(s);
1155
+ }
1156
+ function V(s) {
1157
+ return s === 62 ? (n.consume(s), y) : t(s);
1158
+ }
1159
+ function y(s) {
1160
+ return s === null || C(s) ? S(s) : z(s) ? (n.consume(s), y) : t(s);
1161
+ }
1162
+ function S(s) {
1163
+ return s === 45 && u === 2 ? (n.consume(s), U) : s === 60 && u === 1 ? (n.consume(s), W) : s === 62 && u === 4 ? (n.consume(s), J) : s === 63 && u === 3 ? (n.consume(s), o) : s === 93 && u === 5 ? (n.consume(s), en) : C(s) && (u === 6 || u === 7) ? (n.exit("htmlFlowData"), n.check(
1164
+ Be,
1165
+ rn,
1166
+ P
1167
+ )(s)) : s === null || C(s) ? (n.exit("htmlFlowData"), P(s)) : (n.consume(s), S);
1168
+ }
1169
+ function P(s) {
1170
+ return n.check(
1171
+ Le,
1172
+ R,
1173
+ rn
1174
+ )(s);
1175
+ }
1176
+ function R(s) {
1177
+ return n.enter("lineEnding"), n.consume(s), n.exit("lineEnding"), w;
1178
+ }
1179
+ function w(s) {
1180
+ return s === null || C(s) ? P(s) : (n.enter("htmlFlowData"), S(s));
1181
+ }
1182
+ function U(s) {
1183
+ return s === 45 ? (n.consume(s), o) : S(s);
1184
+ }
1185
+ function W(s) {
1186
+ return s === 47 ? (n.consume(s), l = "", G) : S(s);
1187
+ }
1188
+ function G(s) {
1189
+ if (s === 62) {
1190
+ const K = l.toLowerCase();
1191
+ return Jn.includes(K) ? (n.consume(s), J) : S(s);
1192
+ }
1193
+ return nn(s) && l.length < 8 ? (n.consume(s), l += String.fromCharCode(s), G) : S(s);
1194
+ }
1195
+ function en(s) {
1196
+ return s === 93 ? (n.consume(s), o) : S(s);
1197
+ }
1198
+ function o(s) {
1199
+ return s === 62 ? (n.consume(s), J) : s === 45 && u === 2 ? (n.consume(s), o) : S(s);
1200
+ }
1201
+ function J(s) {
1202
+ return s === null || C(s) ? (n.exit("htmlFlowData"), rn(s)) : (n.consume(s), J);
1203
+ }
1204
+ function rn(s) {
1205
+ return n.exit("htmlFlow"), r(s);
1206
+ }
1207
+ }
1208
+ function Pe(n, r, t) {
1209
+ const e = this;
1210
+ return u;
1211
+ function u(l) {
1212
+ return C(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i) : t(l);
1213
+ }
1214
+ function i(l) {
1215
+ return e.parser.lazy[e.now().line] ? t(l) : r(l);
1216
+ }
1217
+ }
1218
+ function _e(n, r, t) {
1219
+ return e;
1220
+ function e(u) {
1221
+ return n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), n.attempt(Sn, r, t);
1222
+ }
1223
+ }
1224
+ const Me = {
1225
+ name: "htmlText",
1226
+ tokenize: je
1227
+ };
1228
+ function je(n, r, t) {
1229
+ const e = this;
1230
+ let u, i, l;
1231
+ return a;
1232
+ function a(o) {
1233
+ return n.enter("htmlText"), n.enter("htmlTextData"), n.consume(o), m;
1234
+ }
1235
+ function m(o) {
1236
+ return o === 33 ? (n.consume(o), c) : o === 47 ? (n.consume(o), _) : o === 63 ? (n.consume(o), F) : nn(o) ? (n.consume(o), H) : t(o);
1237
+ }
1238
+ function c(o) {
1239
+ return o === 45 ? (n.consume(o), p) : o === 91 ? (n.consume(o), i = 0, A) : nn(o) ? (n.consume(o), j) : t(o);
1240
+ }
1241
+ function p(o) {
1242
+ return o === 45 ? (n.consume(o), h) : t(o);
1243
+ }
1244
+ function f(o) {
1245
+ return o === null ? t(o) : o === 45 ? (n.consume(o), x) : C(o) ? (l = f, W(o)) : (n.consume(o), f);
1246
+ }
1247
+ function x(o) {
1248
+ return o === 45 ? (n.consume(o), h) : f(o);
1249
+ }
1250
+ function h(o) {
1251
+ return o === 62 ? U(o) : o === 45 ? x(o) : f(o);
1252
+ }
1253
+ function A(o) {
1254
+ const J = "CDATA[";
1255
+ return o === J.charCodeAt(i++) ? (n.consume(o), i === J.length ? I : A) : t(o);
1256
+ }
1257
+ function I(o) {
1258
+ return o === null ? t(o) : o === 93 ? (n.consume(o), M) : C(o) ? (l = I, W(o)) : (n.consume(o), I);
1259
+ }
1260
+ function M(o) {
1261
+ return o === 93 ? (n.consume(o), b) : I(o);
1262
+ }
1263
+ function b(o) {
1264
+ return o === 62 ? U(o) : o === 93 ? (n.consume(o), b) : I(o);
1265
+ }
1266
+ function j(o) {
1267
+ return o === null || o === 62 ? U(o) : C(o) ? (l = j, W(o)) : (n.consume(o), j);
1268
+ }
1269
+ function F(o) {
1270
+ return o === null ? t(o) : o === 63 ? (n.consume(o), D) : C(o) ? (l = F, W(o)) : (n.consume(o), F);
1271
+ }
1272
+ function D(o) {
1273
+ return o === 62 ? U(o) : F(o);
1274
+ }
1275
+ function _(o) {
1276
+ return nn(o) ? (n.consume(o), k) : t(o);
1277
+ }
1278
+ function k(o) {
1279
+ return o === 45 || v(o) ? (n.consume(o), k) : T(o);
1280
+ }
1281
+ function T(o) {
1282
+ return C(o) ? (l = T, W(o)) : z(o) ? (n.consume(o), T) : U(o);
1283
+ }
1284
+ function H(o) {
1285
+ return o === 45 || v(o) ? (n.consume(o), H) : o === 47 || o === 62 || Z(o) ? N(o) : t(o);
1286
+ }
1287
+ function N(o) {
1288
+ return o === 47 ? (n.consume(o), U) : o === 58 || o === 95 || nn(o) ? (n.consume(o), V) : C(o) ? (l = N, W(o)) : z(o) ? (n.consume(o), N) : U(o);
1289
+ }
1290
+ function V(o) {
1291
+ return o === 45 || o === 46 || o === 58 || o === 95 || v(o) ? (n.consume(o), V) : y(o);
1292
+ }
1293
+ function y(o) {
1294
+ return o === 61 ? (n.consume(o), S) : C(o) ? (l = y, W(o)) : z(o) ? (n.consume(o), y) : N(o);
1295
+ }
1296
+ function S(o) {
1297
+ return o === null || o === 60 || o === 61 || o === 62 || o === 96 ? t(o) : o === 34 || o === 39 ? (n.consume(o), u = o, P) : C(o) ? (l = S, W(o)) : z(o) ? (n.consume(o), S) : (n.consume(o), R);
1298
+ }
1299
+ function P(o) {
1300
+ return o === u ? (n.consume(o), u = void 0, w) : o === null ? t(o) : C(o) ? (l = P, W(o)) : (n.consume(o), P);
1301
+ }
1302
+ function R(o) {
1303
+ return o === null || o === 34 || o === 39 || o === 60 || o === 61 || o === 96 ? t(o) : o === 47 || o === 62 || Z(o) ? N(o) : (n.consume(o), R);
1304
+ }
1305
+ function w(o) {
1306
+ return o === 47 || o === 62 || Z(o) ? N(o) : t(o);
1307
+ }
1308
+ function U(o) {
1309
+ return o === 62 ? (n.consume(o), n.exit("htmlTextData"), n.exit("htmlText"), r) : t(o);
1310
+ }
1311
+ function W(o) {
1312
+ return n.exit("htmlTextData"), n.enter("lineEnding"), n.consume(o), n.exit("lineEnding"), G;
1313
+ }
1314
+ function G(o) {
1315
+ return z(o) ? O(
1316
+ n,
1317
+ en,
1318
+ "linePrefix",
1319
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
1320
+ )(o) : en(o);
1321
+ }
1322
+ function en(o) {
1323
+ return n.enter("htmlTextData"), l(o);
1324
+ }
1325
+ }
1326
+ const Dn = {
1327
+ name: "labelEnd",
1328
+ tokenize: We,
1329
+ resolveTo: Ve,
1330
+ resolveAll: Ne
1331
+ }, Re = {
1332
+ tokenize: Qe
1333
+ }, qe = {
1334
+ tokenize: Ue
1335
+ }, He = {
1336
+ tokenize: $e
1337
+ };
1338
+ function Ne(n) {
1339
+ let r = -1;
1340
+ for (; ++r < n.length; ) {
1341
+ const t = n[r][1];
1342
+ (t.type === "labelImage" || t.type === "labelLink" || t.type === "labelEnd") && (n.splice(r + 1, t.type === "labelImage" ? 4 : 2), t.type = "data", r++);
1343
+ }
1344
+ return n;
1345
+ }
1346
+ function Ve(n, r) {
1347
+ let t = n.length, e = 0, u, i, l, a;
1348
+ for (; t--; )
1349
+ if (u = n[t][1], i) {
1350
+ if (u.type === "link" || u.type === "labelLink" && u._inactive)
1351
+ break;
1352
+ n[t][0] === "enter" && u.type === "labelLink" && (u._inactive = !0);
1353
+ } else if (l) {
1354
+ if (n[t][0] === "enter" && (u.type === "labelImage" || u.type === "labelLink") && !u._balanced && (i = t, u.type !== "labelLink")) {
1355
+ e = 2;
1356
+ break;
1357
+ }
1358
+ } else u.type === "labelEnd" && (l = t);
1359
+ const m = {
1360
+ type: n[i][1].type === "labelLink" ? "link" : "image",
1361
+ start: Object.assign({}, n[i][1].start),
1362
+ end: Object.assign({}, n[n.length - 1][1].end)
1363
+ }, c = {
1364
+ type: "label",
1365
+ start: Object.assign({}, n[i][1].start),
1366
+ end: Object.assign({}, n[l][1].end)
1367
+ }, p = {
1368
+ type: "labelText",
1369
+ start: Object.assign({}, n[i + e + 2][1].end),
1370
+ end: Object.assign({}, n[l - 2][1].start)
1371
+ };
1372
+ return a = [
1373
+ ["enter", m, r],
1374
+ ["enter", c, r]
1375
+ ], a = Y(a, n.slice(i + 1, i + e + 3)), a = Y(a, [["enter", p, r]]), a = Y(
1376
+ a,
1377
+ Ln(
1378
+ r.parser.constructs.insideSpan.null,
1379
+ n.slice(i + e + 4, l - 3),
1380
+ r
1381
+ )
1382
+ ), a = Y(a, [
1383
+ ["exit", p, r],
1384
+ n[l - 2],
1385
+ n[l - 1],
1386
+ ["exit", c, r]
1387
+ ]), a = Y(a, n.slice(l + 1)), a = Y(a, [["exit", m, r]]), tn(n, i, n.length, a), n;
1388
+ }
1389
+ function We(n, r, t) {
1390
+ const e = this;
1391
+ let u = e.events.length, i, l;
1392
+ for (; u--; )
1393
+ if ((e.events[u][1].type === "labelImage" || e.events[u][1].type === "labelLink") && !e.events[u][1]._balanced) {
1394
+ i = e.events[u][1];
1395
+ break;
1396
+ }
1397
+ return a;
1398
+ function a(x) {
1399
+ return i ? i._inactive ? f(x) : (l = e.parser.defined.includes(
1400
+ xn(
1401
+ e.sliceSerialize({
1402
+ start: i.end,
1403
+ end: e.now()
1404
+ })
1405
+ )
1406
+ ), n.enter("labelEnd"), n.enter("labelMarker"), n.consume(x), n.exit("labelMarker"), n.exit("labelEnd"), m) : t(x);
1407
+ }
1408
+ function m(x) {
1409
+ return x === 40 ? n.attempt(
1410
+ Re,
1411
+ p,
1412
+ l ? p : f
1413
+ )(x) : x === 91 ? n.attempt(
1414
+ qe,
1415
+ p,
1416
+ l ? c : f
1417
+ )(x) : l ? p(x) : f(x);
1418
+ }
1419
+ function c(x) {
1420
+ return n.attempt(
1421
+ He,
1422
+ p,
1423
+ f
1424
+ )(x);
1425
+ }
1426
+ function p(x) {
1427
+ return r(x);
1428
+ }
1429
+ function f(x) {
1430
+ return i._balanced = !0, t(x);
1431
+ }
1432
+ }
1433
+ function Qe(n, r, t) {
1434
+ return e;
1435
+ function e(f) {
1436
+ return n.enter("resource"), n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), u;
1437
+ }
1438
+ function u(f) {
1439
+ return Z(f) ? dn(n, i)(f) : i(f);
1440
+ }
1441
+ function i(f) {
1442
+ return f === 41 ? p(f) : at(
1443
+ n,
1444
+ l,
1445
+ a,
1446
+ "resourceDestination",
1447
+ "resourceDestinationLiteral",
1448
+ "resourceDestinationLiteralMarker",
1449
+ "resourceDestinationRaw",
1450
+ "resourceDestinationString",
1451
+ 32
1452
+ )(f);
1453
+ }
1454
+ function l(f) {
1455
+ return Z(f) ? dn(n, m)(f) : p(f);
1456
+ }
1457
+ function a(f) {
1458
+ return t(f);
1459
+ }
1460
+ function m(f) {
1461
+ return f === 34 || f === 39 || f === 40 ? st(
1462
+ n,
1463
+ c,
1464
+ t,
1465
+ "resourceTitle",
1466
+ "resourceTitleMarker",
1467
+ "resourceTitleString"
1468
+ )(f) : p(f);
1469
+ }
1470
+ function c(f) {
1471
+ return Z(f) ? dn(n, p)(f) : p(f);
1472
+ }
1473
+ function p(f) {
1474
+ return f === 41 ? (n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), n.exit("resource"), r) : t(f);
1475
+ }
1476
+ }
1477
+ function Ue(n, r, t) {
1478
+ const e = this;
1479
+ return u;
1480
+ function u(a) {
1481
+ return ot.call(
1482
+ e,
1483
+ n,
1484
+ i,
1485
+ l,
1486
+ "reference",
1487
+ "referenceMarker",
1488
+ "referenceString"
1489
+ )(a);
1490
+ }
1491
+ function i(a) {
1492
+ return e.parser.defined.includes(
1493
+ xn(
1494
+ e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1)
1495
+ )
1496
+ ) ? r(a) : t(a);
1497
+ }
1498
+ function l(a) {
1499
+ return t(a);
1500
+ }
1501
+ }
1502
+ function $e(n, r, t) {
1503
+ return e;
1504
+ function e(i) {
1505
+ return n.enter("reference"), n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), u;
1506
+ }
1507
+ function u(i) {
1508
+ return i === 93 ? (n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), n.exit("reference"), r) : t(i);
1509
+ }
1510
+ }
1511
+ const Ze = {
1512
+ name: "labelStartImage",
1513
+ tokenize: Ye,
1514
+ resolveAll: Dn.resolveAll
1515
+ };
1516
+ function Ye(n, r, t) {
1517
+ const e = this;
1518
+ return u;
1519
+ function u(a) {
1520
+ return n.enter("labelImage"), n.enter("labelImageMarker"), n.consume(a), n.exit("labelImageMarker"), i;
1521
+ }
1522
+ function i(a) {
1523
+ return a === 91 ? (n.enter("labelMarker"), n.consume(a), n.exit("labelMarker"), n.exit("labelImage"), l) : t(a);
1524
+ }
1525
+ function l(a) {
1526
+ return a === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(a) : r(a);
1527
+ }
1528
+ }
1529
+ const Ge = {
1530
+ name: "labelStartLink",
1531
+ tokenize: Je,
1532
+ resolveAll: Dn.resolveAll
1533
+ };
1534
+ function Je(n, r, t) {
1535
+ const e = this;
1536
+ return u;
1537
+ function u(l) {
1538
+ return n.enter("labelLink"), n.enter("labelMarker"), n.consume(l), n.exit("labelMarker"), n.exit("labelLink"), i;
1539
+ }
1540
+ function i(l) {
1541
+ return l === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(l) : r(l);
1542
+ }
1543
+ }
1544
+ const wn = {
1545
+ name: "lineEnding",
1546
+ tokenize: Ke
1547
+ };
1548
+ function Ke(n, r) {
1549
+ return t;
1550
+ function t(e) {
1551
+ return n.enter("lineEnding"), n.consume(e), n.exit("lineEnding"), O(n, r, "linePrefix");
1552
+ }
1553
+ }
1554
+ const bn = {
1555
+ name: "thematicBreak",
1556
+ tokenize: Xe
1557
+ };
1558
+ function Xe(n, r, t) {
1559
+ let e = 0, u;
1560
+ return i;
1561
+ function i(c) {
1562
+ return n.enter("thematicBreak"), l(c);
1563
+ }
1564
+ function l(c) {
1565
+ return u = c, a(c);
1566
+ }
1567
+ function a(c) {
1568
+ return c === u ? (n.enter("thematicBreakSequence"), m(c)) : e >= 3 && (c === null || C(c)) ? (n.exit("thematicBreak"), r(c)) : t(c);
1569
+ }
1570
+ function m(c) {
1571
+ return c === u ? (n.consume(c), e++, m) : (n.exit("thematicBreakSequence"), z(c) ? O(n, a, "whitespace")(c) : a(c));
1572
+ }
1573
+ }
1574
+ const $ = {
1575
+ name: "list",
1576
+ tokenize: tr,
1577
+ continuation: {
1578
+ tokenize: er
1579
+ },
1580
+ exit: ir
1581
+ }, ve = {
1582
+ tokenize: ur,
1583
+ partial: !0
1584
+ }, nr = {
1585
+ tokenize: rr,
1586
+ partial: !0
1587
+ };
1588
+ function tr(n, r, t) {
1589
+ const e = this, u = e.events[e.events.length - 1];
1590
+ let i = u && u[1].type === "linePrefix" ? u[2].sliceSerialize(u[1], !0).length : 0, l = 0;
1591
+ return a;
1592
+ function a(h) {
1593
+ const A = e.containerState.type || (h === 42 || h === 43 || h === 45 ? "listUnordered" : "listOrdered");
1594
+ if (A === "listUnordered" ? !e.containerState.marker || h === e.containerState.marker : zn(h)) {
1595
+ if (e.containerState.type || (e.containerState.type = A, n.enter(A, {
1596
+ _container: !0
1597
+ })), A === "listUnordered")
1598
+ return n.enter("listItemPrefix"), h === 42 || h === 45 ? n.check(bn, t, c)(h) : c(h);
1599
+ if (!e.interrupt || h === 49)
1600
+ return n.enter("listItemPrefix"), n.enter("listItemValue"), m(h);
1601
+ }
1602
+ return t(h);
1603
+ }
1604
+ function m(h) {
1605
+ return zn(h) && ++l < 10 ? (n.consume(h), m) : (!e.interrupt || l < 2) && (e.containerState.marker ? h === e.containerState.marker : h === 41 || h === 46) ? (n.exit("listItemValue"), c(h)) : t(h);
1606
+ }
1607
+ function c(h) {
1608
+ return n.enter("listItemMarker"), n.consume(h), n.exit("listItemMarker"), e.containerState.marker = e.containerState.marker || h, n.check(
1609
+ Sn,
1610
+ // Can’t be empty when interrupting.
1611
+ e.interrupt ? t : p,
1612
+ n.attempt(
1613
+ ve,
1614
+ x,
1615
+ f
1616
+ )
1617
+ );
1618
+ }
1619
+ function p(h) {
1620
+ return e.containerState.initialBlankLine = !0, i++, x(h);
1621
+ }
1622
+ function f(h) {
1623
+ return z(h) ? (n.enter("listItemPrefixWhitespace"), n.consume(h), n.exit("listItemPrefixWhitespace"), x) : t(h);
1624
+ }
1625
+ function x(h) {
1626
+ return e.containerState.size = i + e.sliceSerialize(n.exit("listItemPrefix"), !0).length, r(h);
1627
+ }
1628
+ }
1629
+ function er(n, r, t) {
1630
+ const e = this;
1631
+ return e.containerState._closeFlow = void 0, n.check(Sn, u, i);
1632
+ function u(a) {
1633
+ return e.containerState.furtherBlankLines = e.containerState.furtherBlankLines || e.containerState.initialBlankLine, O(
1634
+ n,
1635
+ r,
1636
+ "listItemIndent",
1637
+ e.containerState.size + 1
1638
+ )(a);
1639
+ }
1640
+ function i(a) {
1641
+ return e.containerState.furtherBlankLines || !z(a) ? (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, l(a)) : (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, n.attempt(nr, r, l)(a));
1642
+ }
1643
+ function l(a) {
1644
+ return e.containerState._closeFlow = !0, e.interrupt = void 0, O(
1645
+ n,
1646
+ n.attempt($, r, t),
1647
+ "linePrefix",
1648
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
1649
+ )(a);
1650
+ }
1651
+ }
1652
+ function rr(n, r, t) {
1653
+ const e = this;
1654
+ return O(
1655
+ n,
1656
+ u,
1657
+ "listItemIndent",
1658
+ e.containerState.size + 1
1659
+ );
1660
+ function u(i) {
1661
+ const l = e.events[e.events.length - 1];
1662
+ return l && l[1].type === "listItemIndent" && l[2].sliceSerialize(l[1], !0).length === e.containerState.size ? r(i) : t(i);
1663
+ }
1664
+ }
1665
+ function ir(n) {
1666
+ n.exit(this.containerState.type);
1667
+ }
1668
+ function ur(n, r, t) {
1669
+ const e = this;
1670
+ return O(
1671
+ n,
1672
+ u,
1673
+ "listItemPrefixWhitespace",
1674
+ e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5
1675
+ );
1676
+ function u(i) {
1677
+ const l = e.events[e.events.length - 1];
1678
+ return !z(i) && l && l[1].type === "listItemPrefixWhitespace" ? r(i) : t(i);
1679
+ }
1680
+ }
1681
+ const Kn = {
1682
+ name: "setextUnderline",
1683
+ tokenize: ar,
1684
+ resolveTo: lr
1685
+ };
1686
+ function lr(n, r) {
1687
+ let t = n.length, e, u, i;
1688
+ for (; t--; )
1689
+ if (n[t][0] === "enter") {
1690
+ if (n[t][1].type === "content") {
1691
+ e = t;
1692
+ break;
1693
+ }
1694
+ n[t][1].type === "paragraph" && (u = t);
1695
+ } else
1696
+ n[t][1].type === "content" && n.splice(t, 1), !i && n[t][1].type === "definition" && (i = t);
1697
+ const l = {
1698
+ type: "setextHeading",
1699
+ start: Object.assign({}, n[u][1].start),
1700
+ end: Object.assign({}, n[n.length - 1][1].end)
1701
+ };
1702
+ return n[u][1].type = "setextHeadingText", i ? (n.splice(u, 0, ["enter", l, r]), n.splice(i + 1, 0, ["exit", n[e][1], r]), n[e][1].end = Object.assign({}, n[i][1].end)) : n[e][1] = l, n.push(["exit", l, r]), n;
1703
+ }
1704
+ function ar(n, r, t) {
1705
+ const e = this;
1706
+ let u;
1707
+ return i;
1708
+ function i(c) {
1709
+ let p = e.events.length, f;
1710
+ for (; p--; )
1711
+ if (e.events[p][1].type !== "lineEnding" && e.events[p][1].type !== "linePrefix" && e.events[p][1].type !== "content") {
1712
+ f = e.events[p][1].type === "paragraph";
1713
+ break;
1714
+ }
1715
+ return !e.parser.lazy[e.now().line] && (e.interrupt || f) ? (n.enter("setextHeadingLine"), u = c, l(c)) : t(c);
1716
+ }
1717
+ function l(c) {
1718
+ return n.enter("setextHeadingLineSequence"), a(c);
1719
+ }
1720
+ function a(c) {
1721
+ return c === u ? (n.consume(c), a) : (n.exit("setextHeadingLineSequence"), z(c) ? O(n, m, "lineSuffix")(c) : m(c));
1722
+ }
1723
+ function m(c) {
1724
+ return c === null || C(c) ? (n.exit("setextHeadingLine"), r(c)) : t(c);
1725
+ }
1726
+ }
1727
+ const or = {
1728
+ tokenize: sr
1729
+ };
1730
+ function sr(n) {
1731
+ const r = this, t = n.attempt(
1732
+ // Try to parse a blank line.
1733
+ Sn,
1734
+ e,
1735
+ // Try to parse initial flow (essentially, only code).
1736
+ n.attempt(
1737
+ this.parser.constructs.flowInitial,
1738
+ u,
1739
+ O(
1740
+ n,
1741
+ n.attempt(
1742
+ this.parser.constructs.flow,
1743
+ u,
1744
+ n.attempt(me, u)
1745
+ ),
1746
+ "linePrefix"
1747
+ )
1748
+ )
1749
+ );
1750
+ return t;
1751
+ function e(i) {
1752
+ if (i === null) {
1753
+ n.consume(i);
1754
+ return;
1755
+ }
1756
+ return n.enter("lineEndingBlank"), n.consume(i), n.exit("lineEndingBlank"), r.currentConstruct = void 0, t;
1757
+ }
1758
+ function u(i) {
1759
+ if (i === null) {
1760
+ n.consume(i);
1761
+ return;
1762
+ }
1763
+ return n.enter("lineEnding"), n.consume(i), n.exit("lineEnding"), r.currentConstruct = void 0, t;
1764
+ }
1765
+ }
1766
+ const cr = {
1767
+ resolveAll: ht()
1768
+ }, hr = ct("string"), pr = ct("text");
1769
+ function ct(n) {
1770
+ return {
1771
+ tokenize: r,
1772
+ resolveAll: ht(
1773
+ n === "text" ? fr : void 0
1774
+ )
1775
+ };
1776
+ function r(t) {
1777
+ const e = this, u = this.parser.constructs[n], i = t.attempt(u, l, a);
1778
+ return l;
1779
+ function l(p) {
1780
+ return c(p) ? i(p) : a(p);
1781
+ }
1782
+ function a(p) {
1783
+ if (p === null) {
1784
+ t.consume(p);
1785
+ return;
1786
+ }
1787
+ return t.enter("data"), t.consume(p), m;
1788
+ }
1789
+ function m(p) {
1790
+ return c(p) ? (t.exit("data"), i(p)) : (t.consume(p), m);
1791
+ }
1792
+ function c(p) {
1793
+ if (p === null)
1794
+ return !0;
1795
+ const f = u[p];
1796
+ let x = -1;
1797
+ if (f)
1798
+ for (; ++x < f.length; ) {
1799
+ const h = f[x];
1800
+ if (!h.previous || h.previous.call(e, e.previous))
1801
+ return !0;
1802
+ }
1803
+ return !1;
1804
+ }
1805
+ }
1806
+ }
1807
+ function ht(n) {
1808
+ return r;
1809
+ function r(t, e) {
1810
+ let u = -1, i;
1811
+ for (; ++u <= t.length; )
1812
+ i === void 0 ? t[u] && t[u][1].type === "data" && (i = u, u++) : (!t[u] || t[u][1].type !== "data") && (u !== i + 2 && (t[i][1].end = t[u - 1][1].end, t.splice(i + 2, u - i - 2), u = i + 2), i = void 0);
1813
+ return n ? n(t, e) : t;
1814
+ }
1815
+ }
1816
+ function fr(n, r) {
1817
+ let t = 0;
1818
+ for (; ++t <= n.length; )
1819
+ if ((t === n.length || n[t][1].type === "lineEnding") && n[t - 1][1].type === "data") {
1820
+ const e = n[t - 1][1], u = r.sliceStream(e);
1821
+ let i = u.length, l = -1, a = 0, m;
1822
+ for (; i--; ) {
1823
+ const c = u[i];
1824
+ if (typeof c == "string") {
1825
+ for (l = c.length; c.charCodeAt(l - 1) === 32; )
1826
+ a++, l--;
1827
+ if (l) break;
1828
+ l = -1;
1829
+ } else if (c === -2)
1830
+ m = !0, a++;
1831
+ else if (c !== -1) {
1832
+ i++;
1833
+ break;
1834
+ }
1835
+ }
1836
+ if (a) {
1837
+ const c = {
1838
+ type: t === n.length || m || a < 2 ? "lineSuffix" : "hardBreakTrailing",
1839
+ start: {
1840
+ line: e.end.line,
1841
+ column: e.end.column - a,
1842
+ offset: e.end.offset - a,
1843
+ _index: e.start._index + i,
1844
+ _bufferIndex: i ? l : e.start._bufferIndex + l
1845
+ },
1846
+ end: Object.assign({}, e.end)
1847
+ };
1848
+ e.end = Object.assign({}, c.start), e.start.offset === e.end.offset ? Object.assign(e, c) : (n.splice(
1849
+ t,
1850
+ 0,
1851
+ ["enter", c, r],
1852
+ ["exit", c, r]
1853
+ ), t += 2);
1854
+ }
1855
+ t++;
1856
+ }
1857
+ return n;
1858
+ }
1859
+ function mr(n, r, t) {
1860
+ let e = Object.assign(
1861
+ t ? Object.assign({}, t) : {
1862
+ line: 1,
1863
+ column: 1,
1864
+ offset: 0
1865
+ },
1866
+ {
1867
+ _index: 0,
1868
+ _bufferIndex: -1
1869
+ }
1870
+ );
1871
+ const u = {}, i = [];
1872
+ let l = [], a = [];
1873
+ const m = {
1874
+ consume: j,
1875
+ enter: F,
1876
+ exit: D,
1877
+ attempt: T(_),
1878
+ check: T(k),
1879
+ interrupt: T(k, {
1880
+ interrupt: !0
1881
+ })
1882
+ }, c = {
1883
+ previous: null,
1884
+ code: null,
1885
+ containerState: {},
1886
+ events: [],
1887
+ parser: n,
1888
+ sliceStream: h,
1889
+ sliceSerialize: x,
1890
+ now: A,
1891
+ defineSkip: I,
1892
+ write: f
1893
+ };
1894
+ let p = r.tokenize.call(c, m);
1895
+ return r.resolveAll && i.push(r), c;
1896
+ function f(y) {
1897
+ return l = Y(l, y), M(), l[l.length - 1] !== null ? [] : (H(r, 0), c.events = Ln(i, c.events, c), c.events);
1898
+ }
1899
+ function x(y, S) {
1900
+ return gr(h(y), S);
1901
+ }
1902
+ function h(y) {
1903
+ return xr(l, y);
1904
+ }
1905
+ function A() {
1906
+ const { line: y, column: S, offset: P, _index: R, _bufferIndex: w } = e;
1907
+ return {
1908
+ line: y,
1909
+ column: S,
1910
+ offset: P,
1911
+ _index: R,
1912
+ _bufferIndex: w
1913
+ };
1914
+ }
1915
+ function I(y) {
1916
+ u[y.line] = y.column, V();
1917
+ }
1918
+ function M() {
1919
+ let y;
1920
+ for (; e._index < l.length; ) {
1921
+ const S = l[e._index];
1922
+ if (typeof S == "string")
1923
+ for (y = e._index, e._bufferIndex < 0 && (e._bufferIndex = 0); e._index === y && e._bufferIndex < S.length; )
1924
+ b(S.charCodeAt(e._bufferIndex));
1925
+ else
1926
+ b(S);
1927
+ }
1928
+ }
1929
+ function b(y) {
1930
+ p = p(y);
1931
+ }
1932
+ function j(y) {
1933
+ C(y) ? (e.line++, e.column = 1, e.offset += y === -3 ? 2 : 1, V()) : y !== -1 && (e.column++, e.offset++), e._bufferIndex < 0 ? e._index++ : (e._bufferIndex++, e._bufferIndex === l[e._index].length && (e._bufferIndex = -1, e._index++)), c.previous = y;
1934
+ }
1935
+ function F(y, S) {
1936
+ const P = S || {};
1937
+ return P.type = y, P.start = A(), c.events.push(["enter", P, c]), a.push(P), P;
1938
+ }
1939
+ function D(y) {
1940
+ const S = a.pop();
1941
+ return S.end = A(), c.events.push(["exit", S, c]), S;
1942
+ }
1943
+ function _(y, S) {
1944
+ H(y, S.from);
1945
+ }
1946
+ function k(y, S) {
1947
+ S.restore();
1948
+ }
1949
+ function T(y, S) {
1950
+ return P;
1951
+ function P(R, w, U) {
1952
+ let W, G, en, o;
1953
+ return Array.isArray(R) ? rn(R) : "tokenize" in R ? (
1954
+ // @ts-expect-error Looks like a construct.
1955
+ rn([R])
1956
+ ) : J(R);
1957
+ function J(Q) {
1958
+ return pn;
1959
+ function pn(an) {
1960
+ const fn = an !== null && Q[an], mn = an !== null && Q.null, Fn = [
1961
+ // To do: add more extension tests.
1962
+ /* c8 ignore next 2 */
1963
+ ...Array.isArray(fn) ? fn : fn ? [fn] : [],
1964
+ ...Array.isArray(mn) ? mn : mn ? [mn] : []
1965
+ ];
1966
+ return rn(Fn)(an);
1967
+ }
1968
+ }
1969
+ function rn(Q) {
1970
+ return W = Q, G = 0, Q.length === 0 ? U : s(Q[G]);
1971
+ }
1972
+ function s(Q) {
1973
+ return pn;
1974
+ function pn(an) {
1975
+ return o = N(), en = Q, Q.partial || (c.currentConstruct = Q), Q.name && c.parser.constructs.disable.null.includes(Q.name) ? hn() : Q.tokenize.call(
1976
+ // If we do have fields, create an object w/ `context` as its
1977
+ // prototype.
1978
+ // This allows a “live binding”, which is needed for `interrupt`.
1979
+ S ? Object.assign(Object.create(c), S) : c,
1980
+ m,
1981
+ K,
1982
+ hn
1983
+ )(an);
1984
+ }
1985
+ }
1986
+ function K(Q) {
1987
+ return y(en, o), w;
1988
+ }
1989
+ function hn(Q) {
1990
+ return o.restore(), ++G < W.length ? s(W[G]) : U;
1991
+ }
1992
+ }
1993
+ }
1994
+ function H(y, S) {
1995
+ y.resolveAll && !i.includes(y) && i.push(y), y.resolve && tn(
1996
+ c.events,
1997
+ S,
1998
+ c.events.length - S,
1999
+ y.resolve(c.events.slice(S), c)
2000
+ ), y.resolveTo && (c.events = y.resolveTo(c.events, c));
2001
+ }
2002
+ function N() {
2003
+ const y = A(), S = c.previous, P = c.currentConstruct, R = c.events.length, w = Array.from(a);
2004
+ return {
2005
+ restore: U,
2006
+ from: R
2007
+ };
2008
+ function U() {
2009
+ e = y, c.previous = S, c.currentConstruct = P, c.events.length = R, a = w, V();
2010
+ }
2011
+ }
2012
+ function V() {
2013
+ e.line in u && e.column < 2 && (e.column = u[e.line], e.offset += u[e.line] - 1);
2014
+ }
2015
+ }
2016
+ function xr(n, r) {
2017
+ const t = r.start._index, e = r.start._bufferIndex, u = r.end._index, i = r.end._bufferIndex;
2018
+ let l;
2019
+ if (t === u)
2020
+ l = [n[t].slice(e, i)];
2021
+ else {
2022
+ if (l = n.slice(t, u), e > -1) {
2023
+ const a = l[0];
2024
+ typeof a == "string" ? l[0] = a.slice(e) : l.shift();
2025
+ }
2026
+ i > 0 && l.push(n[u].slice(0, i));
2027
+ }
2028
+ return l;
2029
+ }
2030
+ function gr(n, r) {
2031
+ let t = -1;
2032
+ const e = [];
2033
+ let u;
2034
+ for (; ++t < n.length; ) {
2035
+ const i = n[t];
2036
+ let l;
2037
+ if (typeof i == "string")
2038
+ l = i;
2039
+ else
2040
+ switch (i) {
2041
+ case -5: {
2042
+ l = "\r";
2043
+ break;
2044
+ }
2045
+ case -4: {
2046
+ l = `
2047
+ `;
2048
+ break;
2049
+ }
2050
+ case -3: {
2051
+ l = `\r
2052
+ `;
2053
+ break;
2054
+ }
2055
+ case -2: {
2056
+ l = r ? " " : " ";
2057
+ break;
2058
+ }
2059
+ case -1: {
2060
+ if (!r && u) continue;
2061
+ l = " ";
2062
+ break;
2063
+ }
2064
+ default:
2065
+ l = String.fromCharCode(i);
2066
+ }
2067
+ u = i === -2, e.push(l);
2068
+ }
2069
+ return e.join("");
2070
+ }
2071
+ const kr = {
2072
+ 42: $,
2073
+ 43: $,
2074
+ 45: $,
2075
+ 48: $,
2076
+ 49: $,
2077
+ 50: $,
2078
+ 51: $,
2079
+ 52: $,
2080
+ 53: $,
2081
+ 54: $,
2082
+ 55: $,
2083
+ 56: $,
2084
+ 57: $,
2085
+ 62: rt
2086
+ }, dr = {
2087
+ 91: be
2088
+ }, br = {
2089
+ [-2]: Cn,
2090
+ [-1]: Cn,
2091
+ 32: Cn
2092
+ }, yr = {
2093
+ 35: we,
2094
+ 42: bn,
2095
+ 45: [Kn, bn],
2096
+ 60: Te,
2097
+ 61: Kn,
2098
+ 95: bn,
2099
+ 96: Gn,
2100
+ 126: Gn
2101
+ }, Sr = {
2102
+ 38: ut,
2103
+ 92: it
2104
+ }, Fr = {
2105
+ [-5]: wn,
2106
+ [-4]: wn,
2107
+ [-3]: wn,
2108
+ 33: Ze,
2109
+ 38: ut,
2110
+ 42: In,
2111
+ 60: [Jt, Me],
2112
+ 91: Ge,
2113
+ 92: [Ee, it],
2114
+ 93: Dn,
2115
+ 95: In,
2116
+ 96: se
2117
+ }, Er = {
2118
+ null: [In, cr]
2119
+ }, Cr = {
2120
+ null: [42, 95]
2121
+ }, wr = {
2122
+ null: []
2123
+ }, Ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2124
+ __proto__: null,
2125
+ attentionMarkers: Cr,
2126
+ contentInitial: dr,
2127
+ disable: wr,
2128
+ document: kr,
2129
+ flow: yr,
2130
+ flowInitial: br,
2131
+ insideSpan: Er,
2132
+ string: Sr,
2133
+ text: Fr
2134
+ }, Symbol.toStringTag, { value: "Module" }));
2135
+ function zr(n) {
2136
+ const t = (
2137
+ /** @type {FullNormalizedExtension} */
2138
+ Pt([Ar, ...(n || {}).extensions || []])
2139
+ ), e = {
2140
+ defined: [],
2141
+ lazy: {},
2142
+ constructs: t,
2143
+ content: u(Wt),
2144
+ document: u(Ut),
2145
+ flow: u(or),
2146
+ string: u(hr),
2147
+ text: u(pr)
2148
+ };
2149
+ return e;
2150
+ function u(i) {
2151
+ return l;
2152
+ function l(a) {
2153
+ return mr(e, i, a);
2154
+ }
2155
+ }
2156
+ }
2157
+ const Xn = /[\0\t\n\r]/g;
2158
+ function Ir() {
2159
+ let n = 1, r = "", t = !0, e;
2160
+ return u;
2161
+ function u(i, l, a) {
2162
+ const m = [];
2163
+ let c, p, f, x, h;
2164
+ for (i = r + i.toString(l), f = 0, r = "", t && (i.charCodeAt(0) === 65279 && f++, t = void 0); f < i.length; ) {
2165
+ if (Xn.lastIndex = f, c = Xn.exec(i), x = c && c.index !== void 0 ? c.index : i.length, h = i.charCodeAt(x), !c) {
2166
+ r = i.slice(f);
2167
+ break;
2168
+ }
2169
+ if (h === 10 && f === x && e)
2170
+ m.push(-3), e = void 0;
2171
+ else
2172
+ switch (e && (m.push(-5), e = void 0), f < x && (m.push(i.slice(f, x)), n += x - f), h) {
2173
+ case 0: {
2174
+ m.push(65533), n++;
2175
+ break;
2176
+ }
2177
+ case 9: {
2178
+ for (p = Math.ceil(n / 4) * 4, m.push(-2); n++ < p; ) m.push(-1);
2179
+ break;
2180
+ }
2181
+ case 10: {
2182
+ m.push(-4), n = 1;
2183
+ break;
2184
+ }
2185
+ default:
2186
+ e = !0, n = 1;
2187
+ }
2188
+ f = x + 1;
2189
+ }
2190
+ return a && (e && m.push(-5), r && m.push(r), m.push(null)), m;
2191
+ }
2192
+ }
2193
+ function Tr(n) {
2194
+ for (; !lt(n); )
2195
+ ;
2196
+ return n;
2197
+ }
2198
+ function pt(n, r) {
2199
+ const t = Number.parseInt(n, r);
2200
+ return (
2201
+ // C0 except for HT, LF, FF, CR, space.
2202
+ t < 9 || t === 11 || t > 13 && t < 32 || // Control character (DEL) of C0, and C1 controls.
2203
+ t > 126 && t < 160 || // Lone high surrogates and low surrogates.
2204
+ t > 55295 && t < 57344 || // Noncharacters.
2205
+ t > 64975 && t < 65008 || (t & 65535) === 65535 || (t & 65535) === 65534 || // Out of range
2206
+ t > 1114111 ? "�" : String.fromCharCode(t)
2207
+ );
2208
+ }
2209
+ const Br = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
2210
+ function Lr(n) {
2211
+ return n.replace(Br, Or);
2212
+ }
2213
+ function Or(n, r, t) {
2214
+ if (r)
2215
+ return r;
2216
+ if (t.charCodeAt(0) === 35) {
2217
+ const u = t.charCodeAt(1), i = u === 120 || u === 88;
2218
+ return pt(t.slice(i ? 2 : 1), i ? 16 : 10);
2219
+ }
2220
+ return On(t) || n;
2221
+ }
2222
+ function yn(n) {
2223
+ return !n || typeof n != "object" ? "" : "position" in n || "type" in n ? vn(n.position) : "start" in n || "end" in n ? vn(n) : "line" in n || "column" in n ? Tn(n) : "";
2224
+ }
2225
+ function Tn(n) {
2226
+ return nt(n && n.line) + ":" + nt(n && n.column);
2227
+ }
2228
+ function vn(n) {
2229
+ return Tn(n && n.start) + "-" + Tn(n && n.end);
2230
+ }
2231
+ function nt(n) {
2232
+ return n && typeof n == "number" ? n : 1;
2233
+ }
2234
+ const ft = {}.hasOwnProperty, mt = (
2235
+ /**
2236
+ * @type {(
2237
+ * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &
2238
+ * ((value: Value, options?: Options | null | undefined) => Root)
2239
+ * )}
2240
+ */
2241
+ /**
2242
+ * @param {Value} value
2243
+ * @param {Encoding | Options | null | undefined} [encoding]
2244
+ * @param {Options | null | undefined} [options]
2245
+ * @returns {Root}
2246
+ */
2247
+ function(n, r, t) {
2248
+ return typeof r != "string" && (t = r, r = void 0), Dr(t)(
2249
+ Tr(
2250
+ zr(t).document().write(Ir()(n, r, !0))
2251
+ )
2252
+ );
2253
+ }
2254
+ );
2255
+ function Dr(n) {
2256
+ const r = {
2257
+ transforms: [],
2258
+ canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
2259
+ enter: {
2260
+ autolink: a(Hn),
2261
+ autolinkProtocol: y,
2262
+ autolinkEmail: y,
2263
+ atxHeading: a(jn),
2264
+ blockQuote: a(Fn),
2265
+ characterEscape: y,
2266
+ characterReference: y,
2267
+ codeFenced: a(Mn),
2268
+ codeFencedFenceInfo: m,
2269
+ codeFencedFenceMeta: m,
2270
+ codeIndented: a(Mn, m),
2271
+ codeText: a(kt, m),
2272
+ codeTextData: y,
2273
+ data: y,
2274
+ codeFlowValue: y,
2275
+ definition: a(dt),
2276
+ definitionDestinationString: m,
2277
+ definitionLabelString: m,
2278
+ definitionTitleString: m,
2279
+ emphasis: a(bt),
2280
+ hardBreakEscape: a(Rn),
2281
+ hardBreakTrailing: a(Rn),
2282
+ htmlFlow: a(qn, m),
2283
+ htmlFlowData: y,
2284
+ htmlText: a(qn, m),
2285
+ htmlTextData: y,
2286
+ image: a(yt),
2287
+ label: m,
2288
+ link: a(Hn),
2289
+ listItem: a(St),
2290
+ listItemValue: A,
2291
+ listOrdered: a(Nn, h),
2292
+ listUnordered: a(Nn),
2293
+ paragraph: a(Ft),
2294
+ reference: hn,
2295
+ referenceString: m,
2296
+ resourceDestinationString: m,
2297
+ resourceTitleString: m,
2298
+ setextHeading: a(jn),
2299
+ strong: a(Et),
2300
+ thematicBreak: a(wt)
2301
+ },
2302
+ exit: {
2303
+ atxHeading: p(),
2304
+ atxHeadingSequence: T,
2305
+ autolink: p(),
2306
+ autolinkEmail: mn,
2307
+ autolinkProtocol: fn,
2308
+ blockQuote: p(),
2309
+ characterEscapeValue: S,
2310
+ characterReferenceMarkerHexadecimal: pn,
2311
+ characterReferenceMarkerNumeric: pn,
2312
+ characterReferenceValue: an,
2313
+ codeFenced: p(j),
2314
+ codeFencedFence: b,
2315
+ codeFencedFenceInfo: I,
2316
+ codeFencedFenceMeta: M,
2317
+ codeFlowValue: S,
2318
+ codeIndented: p(F),
2319
+ codeText: p(W),
2320
+ codeTextData: S,
2321
+ data: S,
2322
+ definition: p(),
2323
+ definitionDestinationString: k,
2324
+ definitionLabelString: D,
2325
+ definitionTitleString: _,
2326
+ emphasis: p(),
2327
+ hardBreakEscape: p(R),
2328
+ hardBreakTrailing: p(R),
2329
+ htmlFlow: p(w),
2330
+ htmlFlowData: S,
2331
+ htmlText: p(U),
2332
+ htmlTextData: S,
2333
+ image: p(en),
2334
+ label: J,
2335
+ labelText: o,
2336
+ lineEnding: P,
2337
+ link: p(G),
2338
+ listItem: p(),
2339
+ listOrdered: p(),
2340
+ listUnordered: p(),
2341
+ paragraph: p(),
2342
+ referenceString: Q,
2343
+ resourceDestinationString: rn,
2344
+ resourceTitleString: s,
2345
+ resource: K,
2346
+ setextHeading: p(V),
2347
+ setextHeadingLineSequence: N,
2348
+ setextHeadingText: H,
2349
+ strong: p(),
2350
+ thematicBreak: p()
2351
+ }
2352
+ };
2353
+ xt(r, (n || {}).mdastExtensions || []);
2354
+ const t = {};
2355
+ return e;
2356
+ function e(g) {
2357
+ let d = {
2358
+ type: "root",
2359
+ children: []
2360
+ };
2361
+ const E = {
2362
+ stack: [d],
2363
+ tokenStack: [],
2364
+ config: r,
2365
+ enter: c,
2366
+ exit: f,
2367
+ buffer: m,
2368
+ resume: x,
2369
+ setData: i,
2370
+ getData: l
2371
+ }, B = [];
2372
+ let L = -1;
2373
+ for (; ++L < g.length; )
2374
+ if (g[L][1].type === "listOrdered" || g[L][1].type === "listUnordered")
2375
+ if (g[L][0] === "enter")
2376
+ B.push(L);
2377
+ else {
2378
+ const X = B.pop();
2379
+ L = u(g, X, L);
2380
+ }
2381
+ for (L = -1; ++L < g.length; ) {
2382
+ const X = r[g[L][0]];
2383
+ ft.call(X, g[L][1].type) && X[g[L][1].type].call(
2384
+ Object.assign(
2385
+ {
2386
+ sliceSerialize: g[L][2].sliceSerialize
2387
+ },
2388
+ E
2389
+ ),
2390
+ g[L][1]
2391
+ );
2392
+ }
2393
+ if (E.tokenStack.length > 0) {
2394
+ const X = E.tokenStack[E.tokenStack.length - 1];
2395
+ (X[1] || tt).call(E, void 0, X[0]);
2396
+ }
2397
+ for (d.position = {
2398
+ start: sn(
2399
+ g.length > 0 ? g[0][1].start : {
2400
+ line: 1,
2401
+ column: 1,
2402
+ offset: 0
2403
+ }
2404
+ ),
2405
+ end: sn(
2406
+ g.length > 0 ? g[g.length - 2][1].end : {
2407
+ line: 1,
2408
+ column: 1,
2409
+ offset: 0
2410
+ }
2411
+ )
2412
+ }, L = -1; ++L < r.transforms.length; )
2413
+ d = r.transforms[L](d) || d;
2414
+ return d;
2415
+ }
2416
+ function u(g, d, E) {
2417
+ let B = d - 1, L = -1, X = !1, on, un, gn, kn;
2418
+ for (; ++B <= E; ) {
2419
+ const q = g[B];
2420
+ if (q[1].type === "listUnordered" || q[1].type === "listOrdered" || q[1].type === "blockQuote" ? (q[0] === "enter" ? L++ : L--, kn = void 0) : q[1].type === "lineEndingBlank" ? q[0] === "enter" && (on && !kn && !L && !gn && (gn = B), kn = void 0) : q[1].type === "linePrefix" || q[1].type === "listItemValue" || q[1].type === "listItemMarker" || q[1].type === "listItemPrefix" || q[1].type === "listItemPrefixWhitespace" || (kn = void 0), !L && q[0] === "enter" && q[1].type === "listItemPrefix" || L === -1 && q[0] === "exit" && (q[1].type === "listUnordered" || q[1].type === "listOrdered")) {
2421
+ if (on) {
2422
+ let En = B;
2423
+ for (un = void 0; En--; ) {
2424
+ const ln = g[En];
2425
+ if (ln[1].type === "lineEnding" || ln[1].type === "lineEndingBlank") {
2426
+ if (ln[0] === "exit") continue;
2427
+ un && (g[un][1].type = "lineEndingBlank", X = !0), ln[1].type = "lineEnding", un = En;
2428
+ } else if (!(ln[1].type === "linePrefix" || ln[1].type === "blockQuotePrefix" || ln[1].type === "blockQuotePrefixWhitespace" || ln[1].type === "blockQuoteMarker" || ln[1].type === "listItemIndent")) break;
2429
+ }
2430
+ gn && (!un || gn < un) && (on._spread = !0), on.end = Object.assign(
2431
+ {},
2432
+ un ? g[un][1].start : q[1].end
2433
+ ), g.splice(un || B, 0, ["exit", on, q[2]]), B++, E++;
2434
+ }
2435
+ q[1].type === "listItemPrefix" && (on = {
2436
+ type: "listItem",
2437
+ _spread: !1,
2438
+ start: Object.assign({}, q[1].start),
2439
+ // @ts-expect-error: we’ll add `end` in a second.
2440
+ end: void 0
2441
+ }, g.splice(B, 0, ["enter", on, q[2]]), B++, E++, gn = void 0, kn = !0);
2442
+ }
2443
+ }
2444
+ return g[d][1]._spread = X, E;
2445
+ }
2446
+ function i(g, d) {
2447
+ t[g] = d;
2448
+ }
2449
+ function l(g) {
2450
+ return t[g];
2451
+ }
2452
+ function a(g, d) {
2453
+ return E;
2454
+ function E(B) {
2455
+ c.call(this, g(B), B), d && d.call(this, B);
2456
+ }
2457
+ }
2458
+ function m() {
2459
+ this.stack.push({
2460
+ type: "fragment",
2461
+ children: []
2462
+ });
2463
+ }
2464
+ function c(g, d, E) {
2465
+ return this.stack[this.stack.length - 1].children.push(g), this.stack.push(g), this.tokenStack.push([d, E]), g.position = {
2466
+ start: sn(d.start)
2467
+ }, g;
2468
+ }
2469
+ function p(g) {
2470
+ return d;
2471
+ function d(E) {
2472
+ g && g.call(this, E), f.call(this, E);
2473
+ }
2474
+ }
2475
+ function f(g, d) {
2476
+ const E = this.stack.pop(), B = this.tokenStack.pop();
2477
+ if (B)
2478
+ B[0].type !== g.type && (d ? d.call(this, g, B[0]) : (B[1] || tt).call(this, g, B[0]));
2479
+ else throw new Error(
2480
+ "Cannot close `" + g.type + "` (" + yn({
2481
+ start: g.start,
2482
+ end: g.end
2483
+ }) + "): it’s not open"
2484
+ );
2485
+ return E.position.end = sn(g.end), E;
2486
+ }
2487
+ function x() {
2488
+ return Ot(this.stack.pop());
2489
+ }
2490
+ function h() {
2491
+ i("expectingFirstListItemValue", !0);
2492
+ }
2493
+ function A(g) {
2494
+ if (l("expectingFirstListItemValue")) {
2495
+ const d = this.stack[this.stack.length - 2];
2496
+ d.start = Number.parseInt(this.sliceSerialize(g), 10), i("expectingFirstListItemValue");
2497
+ }
2498
+ }
2499
+ function I() {
2500
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2501
+ d.lang = g;
2502
+ }
2503
+ function M() {
2504
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2505
+ d.meta = g;
2506
+ }
2507
+ function b() {
2508
+ l("flowCodeInside") || (this.buffer(), i("flowCodeInside", !0));
2509
+ }
2510
+ function j() {
2511
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2512
+ d.value = g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), i("flowCodeInside");
2513
+ }
2514
+ function F() {
2515
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2516
+ d.value = g.replace(/(\r?\n|\r)$/g, "");
2517
+ }
2518
+ function D(g) {
2519
+ const d = this.resume(), E = this.stack[this.stack.length - 1];
2520
+ E.label = d, E.identifier = xn(
2521
+ this.sliceSerialize(g)
2522
+ ).toLowerCase();
2523
+ }
2524
+ function _() {
2525
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2526
+ d.title = g;
2527
+ }
2528
+ function k() {
2529
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2530
+ d.url = g;
2531
+ }
2532
+ function T(g) {
2533
+ const d = this.stack[this.stack.length - 1];
2534
+ if (!d.depth) {
2535
+ const E = this.sliceSerialize(g).length;
2536
+ d.depth = E;
2537
+ }
2538
+ }
2539
+ function H() {
2540
+ i("setextHeadingSlurpLineEnding", !0);
2541
+ }
2542
+ function N(g) {
2543
+ const d = this.stack[this.stack.length - 1];
2544
+ d.depth = this.sliceSerialize(g).charCodeAt(0) === 61 ? 1 : 2;
2545
+ }
2546
+ function V() {
2547
+ i("setextHeadingSlurpLineEnding");
2548
+ }
2549
+ function y(g) {
2550
+ const d = this.stack[this.stack.length - 1];
2551
+ let E = d.children[d.children.length - 1];
2552
+ (!E || E.type !== "text") && (E = Ct(), E.position = {
2553
+ start: sn(g.start)
2554
+ }, d.children.push(E)), this.stack.push(E);
2555
+ }
2556
+ function S(g) {
2557
+ const d = this.stack.pop();
2558
+ d.value += this.sliceSerialize(g), d.position.end = sn(g.end);
2559
+ }
2560
+ function P(g) {
2561
+ const d = this.stack[this.stack.length - 1];
2562
+ if (l("atHardBreak")) {
2563
+ const E = d.children[d.children.length - 1];
2564
+ E.position.end = sn(g.end), i("atHardBreak");
2565
+ return;
2566
+ }
2567
+ !l("setextHeadingSlurpLineEnding") && r.canContainEols.includes(d.type) && (y.call(this, g), S.call(this, g));
2568
+ }
2569
+ function R() {
2570
+ i("atHardBreak", !0);
2571
+ }
2572
+ function w() {
2573
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2574
+ d.value = g;
2575
+ }
2576
+ function U() {
2577
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2578
+ d.value = g;
2579
+ }
2580
+ function W() {
2581
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2582
+ d.value = g;
2583
+ }
2584
+ function G() {
2585
+ const g = this.stack[this.stack.length - 1];
2586
+ if (l("inReference")) {
2587
+ const d = l("referenceType") || "shortcut";
2588
+ g.type += "Reference", g.referenceType = d, delete g.url, delete g.title;
2589
+ } else
2590
+ delete g.identifier, delete g.label;
2591
+ i("referenceType");
2592
+ }
2593
+ function en() {
2594
+ const g = this.stack[this.stack.length - 1];
2595
+ if (l("inReference")) {
2596
+ const d = l("referenceType") || "shortcut";
2597
+ g.type += "Reference", g.referenceType = d, delete g.url, delete g.title;
2598
+ } else
2599
+ delete g.identifier, delete g.label;
2600
+ i("referenceType");
2601
+ }
2602
+ function o(g) {
2603
+ const d = this.sliceSerialize(g), E = this.stack[this.stack.length - 2];
2604
+ E.label = Lr(d), E.identifier = xn(d).toLowerCase();
2605
+ }
2606
+ function J() {
2607
+ const g = this.stack[this.stack.length - 1], d = this.resume(), E = this.stack[this.stack.length - 1];
2608
+ if (i("inReference", !0), E.type === "link") {
2609
+ const B = g.children;
2610
+ E.children = B;
2611
+ } else
2612
+ E.alt = d;
2613
+ }
2614
+ function rn() {
2615
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2616
+ d.url = g;
2617
+ }
2618
+ function s() {
2619
+ const g = this.resume(), d = this.stack[this.stack.length - 1];
2620
+ d.title = g;
2621
+ }
2622
+ function K() {
2623
+ i("inReference");
2624
+ }
2625
+ function hn() {
2626
+ i("referenceType", "collapsed");
2627
+ }
2628
+ function Q(g) {
2629
+ const d = this.resume(), E = this.stack[this.stack.length - 1];
2630
+ E.label = d, E.identifier = xn(
2631
+ this.sliceSerialize(g)
2632
+ ).toLowerCase(), i("referenceType", "full");
2633
+ }
2634
+ function pn(g) {
2635
+ i("characterReferenceType", g.type);
2636
+ }
2637
+ function an(g) {
2638
+ const d = this.sliceSerialize(g), E = l("characterReferenceType");
2639
+ let B;
2640
+ E ? (B = pt(
2641
+ d,
2642
+ E === "characterReferenceMarkerNumeric" ? 10 : 16
2643
+ ), i("characterReferenceType")) : B = On(d);
2644
+ const L = this.stack.pop();
2645
+ L.value += B, L.position.end = sn(g.end);
2646
+ }
2647
+ function fn(g) {
2648
+ S.call(this, g);
2649
+ const d = this.stack[this.stack.length - 1];
2650
+ d.url = this.sliceSerialize(g);
2651
+ }
2652
+ function mn(g) {
2653
+ S.call(this, g);
2654
+ const d = this.stack[this.stack.length - 1];
2655
+ d.url = "mailto:" + this.sliceSerialize(g);
2656
+ }
2657
+ function Fn() {
2658
+ return {
2659
+ type: "blockquote",
2660
+ children: []
2661
+ };
2662
+ }
2663
+ function Mn() {
2664
+ return {
2665
+ type: "code",
2666
+ lang: null,
2667
+ meta: null,
2668
+ value: ""
2669
+ };
2670
+ }
2671
+ function kt() {
2672
+ return {
2673
+ type: "inlineCode",
2674
+ value: ""
2675
+ };
2676
+ }
2677
+ function dt() {
2678
+ return {
2679
+ type: "definition",
2680
+ identifier: "",
2681
+ label: null,
2682
+ title: null,
2683
+ url: ""
2684
+ };
2685
+ }
2686
+ function bt() {
2687
+ return {
2688
+ type: "emphasis",
2689
+ children: []
2690
+ };
2691
+ }
2692
+ function jn() {
2693
+ return {
2694
+ type: "heading",
2695
+ depth: void 0,
2696
+ children: []
2697
+ };
2698
+ }
2699
+ function Rn() {
2700
+ return {
2701
+ type: "break"
2702
+ };
2703
+ }
2704
+ function qn() {
2705
+ return {
2706
+ type: "html",
2707
+ value: ""
2708
+ };
2709
+ }
2710
+ function yt() {
2711
+ return {
2712
+ type: "image",
2713
+ title: null,
2714
+ url: "",
2715
+ alt: null
2716
+ };
2717
+ }
2718
+ function Hn() {
2719
+ return {
2720
+ type: "link",
2721
+ title: null,
2722
+ url: "",
2723
+ children: []
2724
+ };
2725
+ }
2726
+ function Nn(g) {
2727
+ return {
2728
+ type: "list",
2729
+ ordered: g.type === "listOrdered",
2730
+ start: null,
2731
+ spread: g._spread,
2732
+ children: []
2733
+ };
2734
+ }
2735
+ function St(g) {
2736
+ return {
2737
+ type: "listItem",
2738
+ spread: g._spread,
2739
+ checked: null,
2740
+ children: []
2741
+ };
2742
+ }
2743
+ function Ft() {
2744
+ return {
2745
+ type: "paragraph",
2746
+ children: []
2747
+ };
2748
+ }
2749
+ function Et() {
2750
+ return {
2751
+ type: "strong",
2752
+ children: []
2753
+ };
2754
+ }
2755
+ function Ct() {
2756
+ return {
2757
+ type: "text",
2758
+ value: ""
2759
+ };
2760
+ }
2761
+ function wt() {
2762
+ return {
2763
+ type: "thematicBreak"
2764
+ };
2765
+ }
2766
+ }
2767
+ function sn(n) {
2768
+ return {
2769
+ line: n.line,
2770
+ column: n.column,
2771
+ offset: n.offset
2772
+ };
2773
+ }
2774
+ function xt(n, r) {
2775
+ let t = -1;
2776
+ for (; ++t < r.length; ) {
2777
+ const e = r[t];
2778
+ Array.isArray(e) ? xt(n, e) : Pr(n, e);
2779
+ }
2780
+ }
2781
+ function Pr(n, r) {
2782
+ let t;
2783
+ for (t in r)
2784
+ if (ft.call(r, t)) {
2785
+ if (t === "canContainEols") {
2786
+ const e = r[t];
2787
+ e && n[t].push(...e);
2788
+ } else if (t === "transforms") {
2789
+ const e = r[t];
2790
+ e && n[t].push(...e);
2791
+ } else if (t === "enter" || t === "exit") {
2792
+ const e = r[t];
2793
+ e && Object.assign(n[t], e);
2794
+ }
2795
+ }
2796
+ }
2797
+ function tt(n, r) {
2798
+ throw n ? new Error(
2799
+ "Cannot close `" + n.type + "` (" + yn({
2800
+ start: n.start,
2801
+ end: n.end
2802
+ }) + "): a different token (`" + r.type + "`, " + yn({
2803
+ start: r.start,
2804
+ end: r.end
2805
+ }) + ") is open"
2806
+ ) : new Error(
2807
+ "Cannot close document, a token (`" + r.type + "`, " + yn({
2808
+ start: r.start,
2809
+ end: r.end
2810
+ }) + ") is still open"
2811
+ );
2812
+ }
2813
+ function _r(n) {
2814
+ const r = n.replace(/\n{2,}/g, `
2815
+ `);
2816
+ return Bt(r);
2817
+ }
2818
+ function Mr(n) {
2819
+ const r = _r(n), { children: t } = mt(r), e = [[]];
2820
+ let u = 0;
2821
+ function i(l, a = "normal") {
2822
+ l.type === "text" ? l.value.split(`
2823
+ `).forEach((c, p) => {
2824
+ p !== 0 && (u++, e.push([])), c.split(" ").forEach((f) => {
2825
+ f && e[u].push({ content: f, type: a });
2826
+ });
2827
+ }) : (l.type === "strong" || l.type === "emphasis") && l.children.forEach((m) => {
2828
+ i(m, l.type);
2829
+ });
2830
+ }
2831
+ return t.forEach((l) => {
2832
+ l.type === "paragraph" && l.children.forEach((a) => {
2833
+ i(a);
2834
+ });
2835
+ }), e;
2836
+ }
2837
+ function jr(n) {
2838
+ const { children: r } = mt(n);
2839
+ function t(e) {
2840
+ return e.type === "text" ? e.value.replace(/\n/g, "<br/>") : e.type === "strong" ? `<strong>${e.children.map(t).join("")}</strong>` : e.type === "emphasis" ? `<em>${e.children.map(t).join("")}</em>` : e.type === "paragraph" ? `<p>${e.children.map(t).join("")}</p>` : `Unsupported markdown: ${e.type}`;
2841
+ }
2842
+ return r.map(t).join("");
2843
+ }
2844
+ function Rr(n) {
2845
+ return Intl.Segmenter ? [...new Intl.Segmenter().segment(n)].map((r) => r.segment) : [...n];
2846
+ }
2847
+ function qr(n, r) {
2848
+ const t = Rr(r.content);
2849
+ return gt(n, [], t, r.type);
2850
+ }
2851
+ function gt(n, r, t, e) {
2852
+ if (t.length === 0)
2853
+ return [
2854
+ { content: r.join(""), type: e },
2855
+ { content: "", type: e }
2856
+ ];
2857
+ const [u, ...i] = t, l = [...r, u];
2858
+ return n([{ content: l.join(""), type: e }]) ? gt(n, l, i, e) : (r.length === 0 && u && (r.push(u), t.shift()), [
2859
+ { content: r.join(""), type: e },
2860
+ { content: t.join(""), type: e }
2861
+ ]);
2862
+ }
2863
+ function Hr(n, r) {
2864
+ if (n.some(({ content: t }) => t.includes(`
2865
+ `)))
2866
+ throw new Error("splitLineToFitWidth does not support newlines in the line");
2867
+ return Bn(n, r);
2868
+ }
2869
+ function Bn(n, r, t = [], e = []) {
2870
+ if (n.length === 0)
2871
+ return e.length > 0 && t.push(e), t.length > 0 ? t : [];
2872
+ let u = "";
2873
+ n[0].content === " " && (u = " ", n.shift());
2874
+ const i = n.shift() ?? { content: " ", type: "normal" }, l = [...e];
2875
+ if (u !== "" && l.push({ content: u, type: "normal" }), l.push(i), r(l))
2876
+ return Bn(n, r, t, l);
2877
+ if (e.length > 0)
2878
+ t.push(e), n.unshift(i);
2879
+ else if (i.content) {
2880
+ const [a, m] = qr(r, i);
2881
+ t.push([a]), m.content && n.unshift(m);
2882
+ }
2883
+ return Bn(n, r, t);
2884
+ }
2885
+ function Nr(n, r) {
2886
+ r && n.attr("style", r);
2887
+ }
2888
+ function Vr(n, r, t, e, u = !1) {
2889
+ const i = n.append("foreignObject"), l = i.append("xhtml:div"), a = r.label, m = r.isNode ? "nodeLabel" : "edgeLabel";
2890
+ l.html(
2891
+ It(
2892
+ `
2893
+ <span class="${m} ${e}" ` + (r.labelStyle ? 'style="' + r.labelStyle + '"' : "") + ">" + a + "</span>",
2894
+ Tt()
2895
+ )
2896
+ ), Nr(l, r.labelStyle), l.style("display", "table-cell"), l.style("white-space", "nowrap"), l.style("max-width", t + "px"), l.attr("xmlns", "http://www.w3.org/1999/xhtml"), u && l.attr("class", "labelBkg");
2897
+ let c = l.node().getBoundingClientRect();
2898
+ return c.width === t && (l.style("display", "table"), l.style("white-space", "break-spaces"), l.style("width", t + "px"), c = l.node().getBoundingClientRect()), i.style("width", c.width), i.style("height", c.height), i.node();
2899
+ }
2900
+ function Pn(n, r, t) {
2901
+ return n.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", r * t - 0.1 + "em").attr("dy", t + "em");
2902
+ }
2903
+ function Wr(n, r, t) {
2904
+ const e = n.append("text"), u = Pn(e, 1, r);
2905
+ _n(u, t);
2906
+ const i = u.node().getComputedTextLength();
2907
+ return e.remove(), i;
2908
+ }
2909
+ function $r(n, r, t) {
2910
+ var e;
2911
+ const u = n.append("text"), i = Pn(u, 1, r);
2912
+ _n(i, [{ content: t, type: "normal" }]);
2913
+ const l = (e = i.node()) == null ? void 0 : e.getBoundingClientRect();
2914
+ return l && u.remove(), l;
2915
+ }
2916
+ function Qr(n, r, t, e = !1) {
2917
+ const i = r.append("g"), l = i.insert("rect").attr("class", "background"), a = i.append("text").attr("y", "-10.1");
2918
+ let m = 0;
2919
+ for (const c of t) {
2920
+ const p = (x) => Wr(i, 1.1, x) <= n, f = p(c) ? [c] : Hr(c, p);
2921
+ for (const x of f) {
2922
+ const h = Pn(a, m, 1.1);
2923
+ _n(h, x), m++;
2924
+ }
2925
+ }
2926
+ if (e) {
2927
+ const c = a.node().getBBox(), p = 2;
2928
+ return l.attr("x", -p).attr("y", -p).attr("width", c.width + 2 * p).attr("height", c.height + 2 * p), i.node();
2929
+ } else
2930
+ return a.node();
2931
+ }
2932
+ function _n(n, r) {
2933
+ n.text(""), r.forEach((t, e) => {
2934
+ const u = n.append("tspan").attr("font-style", t.type === "emphasis" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal");
2935
+ e === 0 ? u.text(t.content) : u.text(" " + t.content);
2936
+ });
2937
+ }
2938
+ const Zr = (n, r = "", {
2939
+ style: t = "",
2940
+ isTitle: e = !1,
2941
+ classes: u = "",
2942
+ useHtmlLabels: i = !0,
2943
+ isNode: l = !0,
2944
+ width: a = 200,
2945
+ addSvgBackground: m = !1
2946
+ } = {}) => {
2947
+ if (At.info("createText", r, t, e, u, i, l, m), i) {
2948
+ const c = jr(r), p = {
2949
+ isNode: l,
2950
+ label: zt(c).replace(
2951
+ /fa[blrs]?:fa-[\w-]+/g,
2952
+ // cspell: disable-line
2953
+ (x) => `<i class='${x.replace(":", " ")}'></i>`
2954
+ ),
2955
+ labelStyle: t.replace("fill:", "color:")
2956
+ };
2957
+ return Vr(n, p, a, u, m);
2958
+ } else {
2959
+ const c = Mr(r);
2960
+ return Qr(a, n, c, m);
2961
+ }
2962
+ };
2963
+ export {
2964
+ $r as a,
2965
+ Zr as c
2966
+ };