@tempots/beatui 0.95.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/dist/{ar-BVXPzVJB.cjs → ar-CuI1Jgt6.cjs} +1 -1
  2. package/dist/{ar-B4jDJwHQ.js → ar-DaKbK_t8.js} +87 -11
  3. package/dist/auth/index.cjs.js +1 -1
  4. package/dist/auth/index.es.js +1 -1
  5. package/dist/{auth-divider-BPwKk8MW.js → auth-divider-BQIhr3-R.js} +99 -98
  6. package/dist/auth-divider-DvnUModP.cjs +1 -0
  7. package/dist/beatui.css +1628 -541
  8. package/dist/beatui.tailwind.css +1629 -542
  9. package/dist/better-auth/index.cjs.js +1 -1
  10. package/dist/better-auth/index.es.js +9 -9
  11. package/dist/codehighlight/index.cjs.js +22 -0
  12. package/dist/codehighlight/index.es.js +76 -0
  13. package/dist/colors-B-p6IzX9.cjs +1 -0
  14. package/dist/{colors-BY0Ja_bf.js → colors-DwufPN8S.js} +18 -18
  15. package/dist/{de-Dd33yWzb.js → de-3MTPDS1i.js} +82 -6
  16. package/dist/{de-BdfPZskW.cjs → de-DthHehbh.cjs} +1 -1
  17. package/dist/{deep-merge-C8dSqIXI.js → deep-merge-BzIheQtH.js} +511 -517
  18. package/dist/deep-merge-EkjEgK0N.cjs +1 -0
  19. package/dist/{duration-input-IuFWywO5.cjs → duration-input-ClgYjeBa.cjs} +1 -1
  20. package/dist/{duration-input-DFZwkg6M.js → duration-input-DGzmIImj.js} +5 -5
  21. package/dist/{editor-toolbar-group-DiJFgGcI.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
  22. package/dist/{editor-toolbar-group-BCBfu8pG.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
  23. package/dist/es-B6GJLk9h.cjs +1 -0
  24. package/dist/{es-jHMT3_7O.js → es-DwMUvBeU.js} +94 -18
  25. package/dist/{fa-eX3_BAZR.js → fa-0rvQiKrJ.js} +87 -11
  26. package/dist/{fa-BXnP4pbN.cjs → fa-BwgP93iV.cjs} +1 -1
  27. package/dist/{fr-Bj-GjMJm.js → fr-B4i6NzLl.js} +86 -10
  28. package/dist/{fr-HJDhGjI2.cjs → fr-CQzk5zqY.cjs} +1 -1
  29. package/dist/{he-DYgmPPkG.js → he-C71n-hsn.js} +87 -11
  30. package/dist/{he-C6nEVZhN.cjs → he-DcxxvRfs.cjs} +1 -1
  31. package/dist/{hi-DMVSXAJt.cjs → hi-D-KHVWg4.cjs} +1 -1
  32. package/dist/{hi-CgYLonE9.js → hi-xmrXpeVU.js} +87 -11
  33. package/dist/index-B5MAsOC-.cjs +1 -0
  34. package/dist/{index-B8cqD9ny.js → index-C3o9GSH6.js} +106 -105
  35. package/dist/index.cjs.js +4 -4
  36. package/dist/index.es.js +8055 -5285
  37. package/dist/input-container-BvEcp7FU.js +275 -0
  38. package/dist/input-container-Di1YvVB_.cjs +1 -0
  39. package/dist/{it-CO2BPqah.js → it-CDZTtOBC.js} +83 -7
  40. package/dist/{it-DhfVcjKb.cjs → it-D344Dutu.cjs} +1 -1
  41. package/dist/{ja-Bt6fGS_Q.cjs → ja-BNgnDZ27.cjs} +1 -1
  42. package/dist/{ja-BrzwjH8T.js → ja-Zz1LzidW.js} +91 -15
  43. package/dist/json-schema/index.cjs.js +1 -1
  44. package/dist/json-schema/index.es.js +261 -257
  45. package/dist/json-schema-display/index.cjs.js +1 -1
  46. package/dist/json-schema-display/index.es.js +2 -2
  47. package/dist/json-structure/index.cjs.js +1 -1
  48. package/dist/json-structure/index.es.js +132 -133
  49. package/dist/{ko-D-lJ4wYQ.js → ko-9laUsZDL.js} +90 -14
  50. package/dist/{ko-DfAaBGrz.cjs → ko-D-WJ9NK7.cjs} +1 -1
  51. package/dist/lexical/index.cjs.js +2 -39
  52. package/dist/lexical/index.es.js +2056 -20626
  53. package/dist/markdown/index.cjs.js +1 -1
  54. package/dist/markdown/index.es.js +41 -4
  55. package/dist/{menu-CV85y3Xf.js → menu-B8yoDMRS.js} +23 -23
  56. package/dist/menu-B92oSDct.cjs +1 -0
  57. package/dist/modal-BT0jjDqX.cjs +1 -0
  58. package/dist/{modal-CwZuWiSK.js → modal-DBguyX-b.js} +9 -9
  59. package/dist/monaco/index.cjs.js +2 -2
  60. package/dist/monaco/index.es.js +7 -7
  61. package/dist/{nl-CNWBQjK5.cjs → nl-CrqUlFie.cjs} +1 -1
  62. package/dist/{nl-ClsworIe.js → nl-Dcll9fVA.js} +86 -10
  63. package/dist/{notice-D7hYFM5A.js → notice-E19wu9lA.js} +51 -51
  64. package/dist/notice-_9XhdrFw.cjs +1 -0
  65. package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
  66. package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
  67. package/dist/{pl-CqHTeu3-.cjs → pl-9UksIrvX.cjs} +1 -1
  68. package/dist/{pl-WTwLAxnV.js → pl-Dm9N9Gbr.js} +83 -7
  69. package/dist/prosemirror/index.cjs.js +3 -1
  70. package/dist/prosemirror/index.es.js +636 -4
  71. package/dist/{pt-CgkjJnsG.js → pt-CFi5cn0k.js} +88 -12
  72. package/dist/{pt-BQmsiqbo.cjs → pt-_kfdzwqi.cjs} +1 -1
  73. package/dist/{ru-CtgH7OY9.js → ru-CEhZUw8R.js} +91 -15
  74. package/dist/{ru-CG56A2To.cjs → ru-CW1WNNlr.cjs} +1 -1
  75. package/dist/stack-BLMteGTn.js +15 -0
  76. package/dist/stack-dwLevGa2.cjs +1 -0
  77. package/dist/tailwind/preset.cjs.js +1 -1
  78. package/dist/tailwind/preset.es.js +2 -2
  79. package/dist/tailwind/vite-plugin.cjs.js +1 -1
  80. package/dist/tailwind/vite-plugin.es.js +1 -1
  81. package/dist/text-input-DfqXolVe.js +55 -0
  82. package/dist/text-input-X_q01NsY.cjs +1 -0
  83. package/dist/toolbar-DY0ax2Qd.js +130 -0
  84. package/dist/toolbar-DoKdYXIL.cjs +1 -0
  85. package/dist/{tr-DE7_VtKu.cjs → tr-B6GIRegf.cjs} +1 -1
  86. package/dist/{tr-D1O1vEmr.js → tr-ZmnVDhLP.js} +81 -5
  87. package/dist/{translations-yu4gNqlP.js → translations-A4kR7CW8.js} +1 -1
  88. package/dist/{translations-DyCmyLE_.js → translations-B1_yyDUK.js} +207 -129
  89. package/dist/{translations-DBxIjvWR.cjs → translations-C81buKAw.cjs} +1 -1
  90. package/dist/translations-Dbx7L7Q1.cjs +1 -0
  91. package/dist/types/beatui-i18n/default.d.ts +71 -0
  92. package/dist/types/beatui-i18n/locales/en.d.ts +71 -0
  93. package/dist/types/beatui-i18n/translations.d.ts +71 -0
  94. package/dist/types/codehighlight/code-highlight.d.ts +21 -0
  95. package/dist/types/codehighlight/index.d.ts +14 -0
  96. package/dist/types/components/button/toggle-button.d.ts +4 -4
  97. package/dist/types/components/data/avatar.d.ts +3 -1
  98. package/dist/types/components/data/badge.d.ts +10 -18
  99. package/dist/types/components/data/column-filter-panel.d.ts +31 -0
  100. package/dist/types/components/data/column-filter.d.ts +110 -0
  101. package/dist/types/components/data/column-header-menu.d.ts +42 -0
  102. package/dist/types/components/data/data-source.d.ts +190 -0
  103. package/dist/types/components/data/data-table-body.d.ts +12 -0
  104. package/dist/types/components/data/data-table-column-toggle.d.ts +4 -0
  105. package/dist/types/components/data/data-table-context.d.ts +53 -0
  106. package/dist/types/components/data/data-table-header.d.ts +6 -0
  107. package/dist/types/components/data/data-table-resolve.d.ts +26 -0
  108. package/dist/types/components/data/data-table-types.d.ts +201 -0
  109. package/dist/types/components/data/data-table.d.ts +38 -0
  110. package/dist/types/components/data/data-toolbar.d.ts +44 -0
  111. package/dist/types/components/data/date-picker-shared.d.ts +55 -0
  112. package/dist/types/components/data/date-picker.d.ts +58 -0
  113. package/dist/types/components/data/date-range-picker.d.ts +56 -0
  114. package/dist/types/components/data/filter.d.ts +268 -0
  115. package/dist/types/components/data/index.d.ts +13 -4
  116. package/dist/types/components/data/indicator.d.ts +41 -0
  117. package/dist/types/components/data/progress-bar.d.ts +2 -2
  118. package/dist/types/components/data/selection-checkbox.d.ts +63 -0
  119. package/dist/types/components/data/skeleton.d.ts +1 -1
  120. package/dist/types/components/data/sortable-header.d.ts +55 -0
  121. package/dist/types/components/data/unstyled-drop-zone.d.ts +2 -2
  122. package/dist/types/components/form/control/control.d.ts +9 -9
  123. package/dist/types/components/form/input/advanced-slider.d.ts +6 -6
  124. package/dist/types/components/form/input/appearance-selector.d.ts +9 -2
  125. package/dist/types/components/form/input/checkbox-input.d.ts +6 -7
  126. package/dist/types/components/form/input/color-input.d.ts +1 -1
  127. package/dist/types/components/form/input/color-swatch-input.d.ts +3 -3
  128. package/dist/types/components/form/input/combobox-input.d.ts +5 -5
  129. package/dist/types/components/form/input/combobox-tags-input.d.ts +5 -5
  130. package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
  131. package/dist/types/components/form/input/date-input.d.ts +4 -4
  132. package/dist/types/components/form/input/dropdown-input.d.ts +5 -5
  133. package/dist/types/components/form/input/editable-text.d.ts +2 -2
  134. package/dist/types/components/form/input/email-input.d.ts +4 -4
  135. package/dist/types/components/form/input/index.d.ts +1 -0
  136. package/dist/types/components/form/input/input-container.d.ts +1 -1
  137. package/dist/types/components/form/input/input-options.d.ts +28 -1
  138. package/dist/types/components/form/input/mask-input.d.ts +8 -2
  139. package/dist/types/components/form/input/native-select.d.ts +3 -3
  140. package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
  141. package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
  142. package/dist/types/components/form/input/nullable-rating-input.d.ts +8 -8
  143. package/dist/types/components/form/input/nullable-uuid-input.d.ts +4 -4
  144. package/dist/types/components/form/input/number-input.d.ts +3 -3
  145. package/dist/types/components/form/input/otp-input.d.ts +12 -12
  146. package/dist/types/components/form/input/rating-input.d.ts +7 -8
  147. package/dist/types/components/form/input/select-tags-input.d.ts +5 -5
  148. package/dist/types/components/form/input/switch.d.ts +2 -2
  149. package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +82 -0
  150. package/dist/types/components/form/input/uuid-input.d.ts +2 -2
  151. package/dist/types/components/json-structure/controls/uuid-control.d.ts +1 -1
  152. package/dist/types/components/layout/card.d.ts +66 -0
  153. package/dist/types/components/layout/collapse.d.ts +2 -2
  154. package/dist/types/components/layout/flex.d.ts +26 -0
  155. package/dist/types/components/layout/index.d.ts +1 -0
  156. package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
  157. package/dist/types/components/media/pdf-page-viewer.d.ts +8 -5
  158. package/dist/types/components/misc/index.d.ts +1 -0
  159. package/dist/types/components/misc/loading-overlay.d.ts +29 -0
  160. package/dist/types/components/misc/notice.d.ts +4 -4
  161. package/dist/types/components/misc/notification-provider.d.ts +9 -3
  162. package/dist/types/components/misc/notification.d.ts +9 -9
  163. package/dist/types/components/navigation/breadcrumbs.d.ts +1 -1
  164. package/dist/types/components/navigation/menu.d.ts +6 -6
  165. package/dist/types/components/navigation/pagination.d.ts +17 -4
  166. package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +2 -2
  167. package/dist/types/components/navigation/tabs/tabs.d.ts +17 -8
  168. package/dist/types/components/navigation/toolbar/toolbar.d.ts +12 -6
  169. package/dist/types/components/overlay/announcement-bar.d.ts +12 -4
  170. package/dist/types/components/overlay/dialogs.d.ts +2 -2
  171. package/dist/types/components/overlay/modal.d.ts +9 -2
  172. package/dist/types/components/overlay/tooltip.d.ts +6 -6
  173. package/dist/types/components/theme/types.d.ts +15 -4
  174. package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
  175. package/dist/types/tokens/z-index.d.ts +18 -18
  176. package/dist/types/utils/use-animated-toggle.d.ts +12 -4
  177. package/dist/{ur-ZJgsSpG2.cjs → ur-CtFl_tz6.cjs} +1 -1
  178. package/dist/{ur-BcuB7IqE.js → ur-yYgj3NmT.js} +87 -11
  179. package/dist/use-animated-toggle-C3asw_Sg.js +207 -0
  180. package/dist/use-animated-toggle-cKcuItmz.cjs +1 -0
  181. package/dist/use-form-CaW192gw.cjs +2 -0
  182. package/dist/{use-form-CfxvyTfd.js → use-form-Dn6v2tEh.js} +153 -152
  183. package/dist/utils-DmEuG3Np.cjs +1 -0
  184. package/dist/utils-vUtP6iPG.js +165 -0
  185. package/dist/{vi-D0rQ3dIx.js → vi-D5u4CLQO.js} +88 -12
  186. package/dist/{vi-BOgLRkuK.cjs → vi-DyCZSpsk.cjs} +1 -1
  187. package/dist/widget-customization-DgW1SXN6.cjs +1 -0
  188. package/dist/{widget-customization-CLZNGavL.js → widget-customization-Dkx7kNSe.js} +413 -398
  189. package/dist/{zh-DoYqiZO1.js → zh-B0kwMMer.js} +90 -14
  190. package/dist/{zh-BTZ8OZ4H.cjs → zh-C3ZxMQKb.cjs} +1 -1
  191. package/package.json +208 -37
  192. package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
  193. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  194. package/dist/auth-divider-BgaQ8ifw.cjs +0 -1
  195. package/dist/colors-BI0YhONJ.cjs +0 -1
  196. package/dist/deep-merge-ChJQbUKq.cjs +0 -1
  197. package/dist/es-C8TpneCm.cjs +0 -1
  198. package/dist/hls.light.min-C6xKDzRR.cjs +0 -27
  199. package/dist/hls.light.min-hEMf_E8u.js +0 -8311
  200. package/dist/index-1JaBwDB-.js +0 -921
  201. package/dist/index-CN10Cyqr.cjs +0 -1
  202. package/dist/index-CTcbhnPw.cjs +0 -4
  203. package/dist/index-DF7RFzD9.cjs +0 -1
  204. package/dist/index-D_zOXmU5.cjs +0 -36
  205. package/dist/index-DfPkCwdC.js +0 -2709
  206. package/dist/index-vowHNIPH.js +0 -14308
  207. package/dist/index-yOU4Ceaq.js +0 -68
  208. package/dist/index-zQ3IYJFH.cjs +0 -1
  209. package/dist/input-container-BWYHj0Iq.cjs +0 -1
  210. package/dist/input-container-DMoVdH6E.js +0 -263
  211. package/dist/menu-De_-sGeb.cjs +0 -1
  212. package/dist/modal-CiGmgsOI.cjs +0 -1
  213. package/dist/notice-CPZQuxcA.cjs +0 -1
  214. package/dist/oneof-branch-detection-BFxukD63.cjs +0 -8
  215. package/dist/oneof-branch-detection-izpPjBCR.js +0 -6290
  216. package/dist/stack-4VUGISn6.cjs +0 -1
  217. package/dist/stack-Bm-UZosx.js +0 -879
  218. package/dist/string-B9vVyfq3.cjs +0 -1
  219. package/dist/string-DYyMxBl-.js +0 -19
  220. package/dist/text-input-BLupB3cU.js +0 -45
  221. package/dist/text-input-M6WBhhVj.cjs +0 -1
  222. package/dist/timer-BJHOsuS6.cjs +0 -1
  223. package/dist/timer-Rd2sKnvH.js +0 -65
  224. package/dist/toolbar-Be1eU0qU.js +0 -118
  225. package/dist/toolbar-WWv5kcYG.cjs +0 -1
  226. package/dist/translations-OOsMRpX9.cjs +0 -1
  227. package/dist/types/components/data/calendar-shared.d.ts +0 -59
  228. package/dist/types/components/data/calendar.d.ts +0 -107
  229. package/dist/types/components/data/icon-badge.d.ts +0 -14
  230. package/dist/types/components/data/range-calendar.d.ts +0 -104
  231. package/dist/types/components/data/tag.d.ts +0 -51
  232. package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
  233. package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
  234. package/dist/use-form-ClA0ZRco.cjs +0 -2
  235. package/dist/utils-DEbsp9Q9.js +0 -129
  236. package/dist/utils-DIUEhA-Z.cjs +0 -1
  237. package/dist/widget-customization-DtEEo35Y.cjs +0 -1
@@ -1,2709 +0,0 @@
1
- import { computedOf as Lt, html as Pt, Task as Bt, attr as Mn, MapSignal as Ot, Async as Mt } from "@tempots/dom";
2
- import { L as Dt } from "./link-portal-Cr2l9f3k.js";
3
- const Dn = document.createElement("i");
4
- function Yn(n) {
5
- const r = "&" + n + ";";
6
- Dn.innerHTML = r;
7
- const t = Dn.textContent;
8
- return t.charCodeAt(t.length - 1) === 59 && n !== "semi" || t === r ? !1 : t;
9
- }
10
- function nn(n, r, t, e) {
11
- const u = n.length;
12
- let i = 0, l;
13
- if (r < 0 ? r = -r > u ? 0 : u + r : r = r > u ? u : r, t = t > 0 ? t : 0, e.length < 1e4)
14
- l = Array.from(e), l.unshift(r, t), n.splice(...l);
15
- else
16
- for (t && n.splice(r, t); i < e.length; )
17
- l = e.slice(i, i + 1e4), l.unshift(r, 0), n.splice(...l), i += 1e4, r += 1e4;
18
- }
19
- function W(n, r) {
20
- return n.length > 0 ? (nn(n, n.length, 0, r), n) : r;
21
- }
22
- const In = {}.hasOwnProperty;
23
- function Nt(n) {
24
- const r = {};
25
- let t = -1;
26
- for (; ++t < n.length; )
27
- qt(r, n[t]);
28
- return r;
29
- }
30
- function qt(n, r) {
31
- let t;
32
- for (t in r) {
33
- const u = (In.call(n, t) ? n[t] : void 0) || (n[t] = {}), i = r[t];
34
- let l;
35
- if (i)
36
- for (l in i) {
37
- In.call(u, l) || (u[l] = []);
38
- const a = i[l];
39
- Rt(
40
- // @ts-expect-error Looks like a list.
41
- u[l],
42
- Array.isArray(a) ? a : a ? [a] : []
43
- );
44
- }
45
- }
46
- }
47
- function Rt(n, r) {
48
- let t = -1;
49
- const e = [];
50
- for (; ++t < r.length; )
51
- (r[t].add === "after" ? n : e).push(r[t]);
52
- nn(n, 0, 0, e);
53
- }
54
- function Ht(n) {
55
- const r = {};
56
- let t = -1;
57
- for (; ++t < n.length; )
58
- Vt(r, n[t]);
59
- return r;
60
- }
61
- function Vt(n, r) {
62
- let t;
63
- for (t in r) {
64
- const u = (In.call(n, t) ? n[t] : void 0) || (n[t] = {}), i = r[t];
65
- let l;
66
- if (i)
67
- for (l in i)
68
- u[l] = i[l];
69
- }
70
- }
71
- function Qt(n, r) {
72
- const t = Number.parseInt(n, r);
73
- return (
74
- // C0 except for HT, LF, FF, CR, space.
75
- t < 9 || t === 11 || t > 13 && t < 32 || // Control character (DEL) of C0, and C1 controls.
76
- t > 126 && t < 160 || // Lone high surrogates and low surrogates.
77
- t > 55295 && t < 57344 || // Noncharacters.
78
- t > 64975 && t < 65008 || /* eslint-disable no-bitwise */
79
- (t & 65535) === 65535 || (t & 65535) === 65534 || /* eslint-enable no-bitwise */
80
- // Out of range
81
- t > 1114111 ? "�" : String.fromCodePoint(t)
82
- );
83
- }
84
- const Wt = { '"': "quot", "&": "amp", "<": "lt", ">": "gt" };
85
- function Zn(n) {
86
- return n.replace(/["&<>]/g, r);
87
- function r(t) {
88
- return "&" + Wt[
89
- /** @type {keyof typeof characterReferences} */
90
- t
91
- ] + ";";
92
- }
93
- }
94
- function mn(n) {
95
- return n.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
96
- }
97
- const v = ln(/[A-Za-z]/), $ = ln(/[\dA-Za-z]/), Ut = ln(/[#-'*+\--9=?A-Z^-~]/);
98
- function wn(n) {
99
- return (
100
- // Special whitespace codes (which have negative values), C0 and Control
101
- // character DEL
102
- n !== null && (n < 32 || n === 127)
103
- );
104
- }
105
- const Cn = ln(/\d/), jt = ln(/[\dA-Fa-f]/), $t = ln(/[!-/:-@[-`{-~]/);
106
- function E(n) {
107
- return n !== null && n < -2;
108
- }
109
- function j(n) {
110
- return n !== null && (n < 0 || n === 32);
111
- }
112
- function _(n) {
113
- return n === -2 || n === -1 || n === 32;
114
- }
115
- const Yt = ln(new RegExp("\\p{P}|\\p{S}", "u")), Zt = ln(/\s/);
116
- function ln(n) {
117
- return r;
118
- function r(t) {
119
- return t !== null && t > -1 && n.test(String.fromCharCode(t));
120
- }
121
- }
122
- function gn(n, r) {
123
- const t = Zn(Gt(n || ""));
124
- if (!r)
125
- return t;
126
- const e = t.indexOf(":"), u = t.indexOf("?"), i = t.indexOf("#"), l = t.indexOf("/");
127
- return (
128
- // If there is no protocol, it’s relative.
129
- e < 0 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
130
- l > -1 && e > l || u > -1 && e > u || i > -1 && e > i || // It is a protocol, it should be allowed.
131
- r.test(t.slice(0, e)) ? t : ""
132
- );
133
- }
134
- function Gt(n) {
135
- const r = [];
136
- let t = -1, e = 0, u = 0;
137
- for (; ++t < n.length; ) {
138
- const i = n.charCodeAt(t);
139
- let l = "";
140
- if (i === 37 && $(n.charCodeAt(t + 1)) && $(n.charCodeAt(t + 2)))
141
- u = 2;
142
- else if (i < 128)
143
- /[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i)) || (l = String.fromCharCode(i));
144
- else if (i > 55295 && i < 57344) {
145
- const a = n.charCodeAt(t + 1);
146
- i < 56320 && a > 56319 && a < 57344 ? (l = String.fromCharCode(i, a), u = 1) : l = "�";
147
- } else
148
- l = String.fromCharCode(i);
149
- l && (r.push(n.slice(e, t), encodeURIComponent(l)), e = t + u + 1, l = ""), u && (t += u, u = 0);
150
- }
151
- return r.join("") + n.slice(e);
152
- }
153
- const Nn = {}.hasOwnProperty, qn = /^(https?|ircs?|mailto|xmpp)$/i, Jt = /^https?$/i;
154
- function Kt(n) {
155
- const r = n || {};
156
- let t = !0;
157
- const e = {}, u = [[]], i = [], l = [], m = (
158
- /** @type {NormalizedHtmlExtension} */
159
- Ht([{
160
- enter: {
161
- blockQuote: A,
162
- codeFenced: tn,
163
- codeFencedFenceInfo: F,
164
- codeFencedFenceMeta: F,
165
- codeIndented: en,
166
- codeText: Ct,
167
- content: ht,
168
- definition: ut,
169
- definitionDestinationString: at,
170
- definitionLabelString: F,
171
- definitionTitleString: F,
172
- emphasis: It,
173
- htmlFlow: dt,
174
- htmlText: _n,
175
- image: G,
176
- label: F,
177
- link: an,
178
- listItemMarker: z,
179
- listItemValue: q,
180
- listOrdered: D,
181
- listUnordered: N,
182
- paragraph: R,
183
- reference: F,
184
- resource: on,
185
- resourceDestinationString: sn,
186
- resourceTitleString: F,
187
- setextHeading: pt,
188
- strong: wt
189
- },
190
- exit: {
191
- atxHeading: gt,
192
- atxHeadingSequence: ft,
193
- autolinkEmail: _t,
194
- autolinkProtocol: At,
195
- blockQuote: V,
196
- characterEscapeValue: hn,
197
- characterReferenceMarkerHexadecimal: Ln,
198
- characterReferenceMarkerNumeric: Ln,
199
- characterReferenceValue: Ft,
200
- codeFenced: s,
201
- codeFencedFence: Z,
202
- codeFencedFenceInfo: o,
203
- codeFencedFenceMeta: L,
204
- codeFlowValue: bt,
205
- codeIndented: s,
206
- codeText: zt,
207
- codeTextData: hn,
208
- data: hn,
209
- definition: ct,
210
- definitionDestinationString: ot,
211
- definitionLabelString: lt,
212
- definitionTitleString: st,
213
- emphasis: yt,
214
- hardBreakEscape: Fn,
215
- hardBreakTrailing: Fn,
216
- htmlFlow: An,
217
- htmlFlowData: hn,
218
- htmlText: An,
219
- htmlTextData: hn,
220
- image: Tn,
221
- label: cn,
222
- labelText: H,
223
- lineEnding: St,
224
- link: Tn,
225
- listOrdered: C,
226
- listUnordered: O,
227
- paragraph: Y,
228
- reference: L,
229
- referenceString: un,
230
- resource: L,
231
- resourceDestinationString: Sn,
232
- resourceTitleString: it,
233
- setextHeading: kt,
234
- setextHeadingLineSequence: xt,
235
- setextHeadingText: mt,
236
- strong: Et,
237
- thematicBreak: Tt
238
- }
239
- }, ...r.htmlExtensions || []])
240
- ), h = {
241
- definitions: e,
242
- tightStack: l
243
- }, p = {
244
- buffer: F,
245
- encode: x,
246
- getData: y,
247
- lineEndingIfNeeded: T,
248
- options: r,
249
- raw: d,
250
- resume: S,
251
- setData: b,
252
- tag: I
253
- };
254
- let f = r.defaultLineEnding;
255
- return g;
256
- function g(k) {
257
- let w = -1, Q = 0;
258
- const J = [];
259
- let K = [], rn = [];
260
- for (; ++w < k.length; )
261
- !f && (k[w][1].type === "lineEnding" || k[w][1].type === "lineEndingBlank") && (f = /** @type {LineEnding} */
262
- k[w][2].sliceSerialize(k[w][1])), (k[w][1].type === "listOrdered" || k[w][1].type === "listUnordered") && (k[w][0] === "enter" ? J.push(w) : c(k.slice(J.pop(), w))), k[w][1].type === "definition" && (k[w][0] === "enter" ? (rn = W(rn, k.slice(Q, w)), Q = w) : (K = W(K, k.slice(Q, w + 1)), Q = w + 1));
263
- K = W(K, rn), K = W(K, k.slice(Q)), w = -1;
264
- const X = K;
265
- for (m.enter.null && m.enter.null.call(p); ++w < k.length; ) {
266
- const Pn = m[X[w][0]], Bn = X[w][1].type, On = Pn[Bn];
267
- Nn.call(Pn, Bn) && On && On.call({
268
- sliceSerialize: X[w][2].sliceSerialize,
269
- ...p
270
- }, X[w][1]);
271
- }
272
- return m.exit.null && m.exit.null.call(p), u[0].join("");
273
- }
274
- function c(k) {
275
- const w = k.length;
276
- let Q = 0, J = 0, K = !1, rn;
277
- for (; ++Q < w; ) {
278
- const X = k[Q];
279
- if (X[1]._container)
280
- rn = void 0, X[0] === "enter" ? J++ : J--;
281
- else switch (X[1].type) {
282
- case "listItemPrefix": {
283
- X[0] === "exit" && (rn = !0);
284
- break;
285
- }
286
- case "linePrefix":
287
- break;
288
- case "lineEndingBlank": {
289
- X[0] === "enter" && !J && (rn ? rn = void 0 : K = !0);
290
- break;
291
- }
292
- default:
293
- rn = void 0;
294
- }
295
- }
296
- k[0][1]._loose = K;
297
- }
298
- function b(k, w) {
299
- h[k] = w;
300
- }
301
- function y(k) {
302
- return h[k];
303
- }
304
- function F() {
305
- u.push([]);
306
- }
307
- function S() {
308
- return u.pop().join("");
309
- }
310
- function I(k) {
311
- t && (b("lastWasTag", !0), u[u.length - 1].push(k));
312
- }
313
- function d(k) {
314
- b("lastWasTag"), u[u.length - 1].push(k);
315
- }
316
- function P() {
317
- d(f || `
318
- `);
319
- }
320
- function T() {
321
- const k = u[u.length - 1], w = k[k.length - 1], Q = w ? w.charCodeAt(w.length - 1) : null;
322
- Q === 10 || Q === 13 || Q === null || P();
323
- }
324
- function x(k) {
325
- return y("ignoreEncode") ? k : Zn(k);
326
- }
327
- function L() {
328
- S();
329
- }
330
- function D(k) {
331
- l.push(!k._loose), T(), I("<ol"), b("expectFirstItem", !0);
332
- }
333
- function N(k) {
334
- l.push(!k._loose), T(), I("<ul"), b("expectFirstItem", !0);
335
- }
336
- function q(k) {
337
- if (y("expectFirstItem")) {
338
- const w = Number.parseInt(this.sliceSerialize(k), 10);
339
- w !== 1 && I(' start="' + x(String(w)) + '"');
340
- }
341
- }
342
- function z() {
343
- y("expectFirstItem") ? I(">") : M(), T(), I("<li>"), b("expectFirstItem"), b("lastWasTag");
344
- }
345
- function C() {
346
- M(), l.pop(), P(), I("</ol>");
347
- }
348
- function O() {
349
- M(), l.pop(), P(), I("</ul>");
350
- }
351
- function M() {
352
- y("lastWasTag") && !y("slurpAllLineEndings") && T(), I("</li>"), b("slurpAllLineEndings");
353
- }
354
- function A() {
355
- l.push(!1), T(), I("<blockquote>");
356
- }
357
- function V() {
358
- l.pop(), T(), I("</blockquote>"), b("slurpAllLineEndings");
359
- }
360
- function R() {
361
- l[l.length - 1] || (T(), I("<p>")), b("slurpAllLineEndings");
362
- }
363
- function Y() {
364
- l[l.length - 1] ? b("slurpAllLineEndings", !0) : I("</p>");
365
- }
366
- function tn() {
367
- T(), I("<pre><code"), b("fencesCount", 0);
368
- }
369
- function o() {
370
- const k = S();
371
- I(' class="language-' + k + '"');
372
- }
373
- function Z() {
374
- const k = y("fencesCount") || 0;
375
- k || (I(">"), b("slurpOneLineEnding", !0)), b("fencesCount", k + 1);
376
- }
377
- function en() {
378
- T(), I("<pre><code>");
379
- }
380
- function s() {
381
- const k = y("fencesCount");
382
- k !== void 0 && k < 2 && h.tightStack.length > 0 && !y("lastWasTag") && P(), y("flowCodeSeenData") && T(), I("</code></pre>"), k !== void 0 && k < 2 && T(), b("flowCodeSeenData"), b("fencesCount"), b("slurpOneLineEnding");
383
- }
384
- function G() {
385
- i.push({
386
- image: !0
387
- }), t = void 0;
388
- }
389
- function an() {
390
- i.push({});
391
- }
392
- function H(k) {
393
- i[i.length - 1].labelId = this.sliceSerialize(k);
394
- }
395
- function cn() {
396
- i[i.length - 1].label = S();
397
- }
398
- function un(k) {
399
- i[i.length - 1].referenceId = this.sliceSerialize(k);
400
- }
401
- function on() {
402
- F(), i[i.length - 1].destination = "";
403
- }
404
- function sn() {
405
- F(), b("ignoreEncode", !0);
406
- }
407
- function Sn() {
408
- i[i.length - 1].destination = S(), b("ignoreEncode");
409
- }
410
- function it() {
411
- i[i.length - 1].title = S();
412
- }
413
- function Tn() {
414
- let k = i.length - 1;
415
- const w = i[k], Q = w.referenceId || w.labelId, J = w.destination === void 0 ? e[mn(Q)] : w;
416
- for (t = !0; k--; )
417
- if (i[k].image) {
418
- t = void 0;
419
- break;
420
- }
421
- w.image ? (I('<img src="' + gn(J.destination, r.allowDangerousProtocol ? void 0 : Jt) + '" alt="'), d(w.label), I('"')) : I('<a href="' + gn(J.destination, r.allowDangerousProtocol ? void 0 : qn) + '"'), I(J.title ? ' title="' + J.title + '"' : ""), w.image ? I(" />") : (I(">"), d(w.label), I("</a>")), i.pop();
422
- }
423
- function ut() {
424
- F(), i.push({});
425
- }
426
- function lt(k) {
427
- S(), i[i.length - 1].labelId = this.sliceSerialize(k);
428
- }
429
- function at() {
430
- F(), b("ignoreEncode", !0);
431
- }
432
- function ot() {
433
- i[i.length - 1].destination = S(), b("ignoreEncode");
434
- }
435
- function st() {
436
- i[i.length - 1].title = S();
437
- }
438
- function ct() {
439
- const k = i[i.length - 1], w = mn(k.labelId);
440
- S(), Nn.call(e, w) || (e[w] = i[i.length - 1]), i.pop();
441
- }
442
- function ht() {
443
- b("slurpAllLineEndings", !0);
444
- }
445
- function ft(k) {
446
- y("headingRank") || (b("headingRank", this.sliceSerialize(k).length), T(), I("<h" + y("headingRank") + ">"));
447
- }
448
- function pt() {
449
- F(), b("slurpAllLineEndings");
450
- }
451
- function mt() {
452
- b("slurpAllLineEndings", !0);
453
- }
454
- function gt() {
455
- I("</h" + y("headingRank") + ">"), b("headingRank");
456
- }
457
- function xt(k) {
458
- b("headingRank", this.sliceSerialize(k).charCodeAt(0) === 61 ? 1 : 2);
459
- }
460
- function kt() {
461
- const k = S();
462
- T(), I("<h" + y("headingRank") + ">"), d(k), I("</h" + y("headingRank") + ">"), b("slurpAllLineEndings"), b("headingRank");
463
- }
464
- function hn(k) {
465
- d(x(this.sliceSerialize(k)));
466
- }
467
- function St(k) {
468
- if (!y("slurpAllLineEndings")) {
469
- if (y("slurpOneLineEnding")) {
470
- b("slurpOneLineEnding");
471
- return;
472
- }
473
- if (y("inCodeText")) {
474
- d(" ");
475
- return;
476
- }
477
- d(x(this.sliceSerialize(k)));
478
- }
479
- }
480
- function bt(k) {
481
- d(x(this.sliceSerialize(k))), b("flowCodeSeenData", !0);
482
- }
483
- function Fn() {
484
- I("<br />");
485
- }
486
- function dt() {
487
- T(), _n();
488
- }
489
- function An() {
490
- b("ignoreEncode");
491
- }
492
- function _n() {
493
- r.allowDangerousHtml && b("ignoreEncode", !0);
494
- }
495
- function It() {
496
- I("<em>");
497
- }
498
- function wt() {
499
- I("<strong>");
500
- }
501
- function Ct() {
502
- b("inCodeText", !0), I("<code>");
503
- }
504
- function zt() {
505
- b("inCodeText"), I("</code>");
506
- }
507
- function yt() {
508
- I("</em>");
509
- }
510
- function Et() {
511
- I("</strong>");
512
- }
513
- function Tt() {
514
- T(), I("<hr />");
515
- }
516
- function Ln(k) {
517
- b("characterReferenceType", k.type);
518
- }
519
- function Ft(k) {
520
- const w = this.sliceSerialize(k), Q = y("characterReferenceType") ? Qt(w, y("characterReferenceType") === "characterReferenceMarkerNumeric" ? 10 : 16) : Yn(w);
521
- d(x(
522
- /** @type {string} */
523
- Q
524
- )), b("characterReferenceType");
525
- }
526
- function At(k) {
527
- const w = this.sliceSerialize(k);
528
- I('<a href="' + gn(w, r.allowDangerousProtocol ? void 0 : qn) + '">'), d(x(w)), I("</a>");
529
- }
530
- function _t(k) {
531
- const w = this.sliceSerialize(k);
532
- I('<a href="' + gn("mailto:" + w) + '">'), d(x(w)), I("</a>");
533
- }
534
- }
535
- function B(n, r, t, e) {
536
- const u = e ? e - 1 : Number.POSITIVE_INFINITY;
537
- let i = 0;
538
- return l;
539
- function l(m) {
540
- return _(m) ? (n.enter(t), a(m)) : r(m);
541
- }
542
- function a(m) {
543
- return _(m) && i++ < u ? (n.consume(m), a) : (n.exit(t), r(m));
544
- }
545
- }
546
- const Xt = {
547
- tokenize: vt
548
- };
549
- function vt(n) {
550
- const r = n.attempt(this.parser.constructs.contentInitial, e, u);
551
- let t;
552
- return r;
553
- function e(a) {
554
- if (a === null) {
555
- n.consume(a);
556
- return;
557
- }
558
- return n.enter("lineEnding"), n.consume(a), n.exit("lineEnding"), B(n, r, "linePrefix");
559
- }
560
- function u(a) {
561
- return n.enter("paragraph"), i(a);
562
- }
563
- function i(a) {
564
- const m = n.enter("chunkText", {
565
- contentType: "text",
566
- previous: t
567
- });
568
- return t && (t.next = m), t = m, l(a);
569
- }
570
- function l(a) {
571
- if (a === null) {
572
- n.exit("chunkText"), n.exit("paragraph"), n.consume(a);
573
- return;
574
- }
575
- return E(a) ? (n.consume(a), n.exit("chunkText"), i) : (n.consume(a), l);
576
- }
577
- }
578
- const ne = {
579
- tokenize: te
580
- }, Rn = {
581
- tokenize: ee
582
- };
583
- function te(n) {
584
- const r = this, t = [];
585
- let e = 0, u, i, l;
586
- return a;
587
- function a(d) {
588
- if (e < t.length) {
589
- const P = t[e];
590
- return r.containerState = P[1], n.attempt(P[0].continuation, m, h)(d);
591
- }
592
- return h(d);
593
- }
594
- function m(d) {
595
- if (e++, r.containerState._closeFlow) {
596
- r.containerState._closeFlow = void 0, u && I();
597
- const P = r.events.length;
598
- let T = P, x;
599
- for (; T--; )
600
- if (r.events[T][0] === "exit" && r.events[T][1].type === "chunkFlow") {
601
- x = r.events[T][1].end;
602
- break;
603
- }
604
- S(e);
605
- let L = P;
606
- for (; L < r.events.length; )
607
- r.events[L][1].end = {
608
- ...x
609
- }, L++;
610
- return nn(r.events, T + 1, 0, r.events.slice(P)), r.events.length = L, h(d);
611
- }
612
- return a(d);
613
- }
614
- function h(d) {
615
- if (e === t.length) {
616
- if (!u)
617
- return g(d);
618
- if (u.currentConstruct && u.currentConstruct.concrete)
619
- return b(d);
620
- r.interrupt = !!(u.currentConstruct && !u._gfmTableDynamicInterruptHack);
621
- }
622
- return r.containerState = {}, n.check(Rn, p, f)(d);
623
- }
624
- function p(d) {
625
- return u && I(), S(e), g(d);
626
- }
627
- function f(d) {
628
- return r.parser.lazy[r.now().line] = e !== t.length, l = r.now().offset, b(d);
629
- }
630
- function g(d) {
631
- return r.containerState = {}, n.attempt(Rn, c, b)(d);
632
- }
633
- function c(d) {
634
- return e++, t.push([r.currentConstruct, r.containerState]), g(d);
635
- }
636
- function b(d) {
637
- if (d === null) {
638
- u && I(), S(0), n.consume(d);
639
- return;
640
- }
641
- return u = u || r.parser.flow(r.now()), n.enter("chunkFlow", {
642
- _tokenizer: u,
643
- contentType: "flow",
644
- previous: i
645
- }), y(d);
646
- }
647
- function y(d) {
648
- if (d === null) {
649
- F(n.exit("chunkFlow"), !0), S(0), n.consume(d);
650
- return;
651
- }
652
- return E(d) ? (n.consume(d), F(n.exit("chunkFlow")), e = 0, r.interrupt = void 0, a) : (n.consume(d), y);
653
- }
654
- function F(d, P) {
655
- const T = r.sliceStream(d);
656
- if (P && T.push(null), d.previous = i, i && (i.next = d), i = d, u.defineSkip(d.start), u.write(T), r.parser.lazy[d.start.line]) {
657
- let x = u.events.length;
658
- for (; x--; )
659
- if (
660
- // The token starts before the line ending…
661
- u.events[x][1].start.offset < l && // …and either is not ended yet…
662
- (!u.events[x][1].end || // …or ends after it.
663
- u.events[x][1].end.offset > l)
664
- )
665
- return;
666
- const L = r.events.length;
667
- let D = L, N, q;
668
- for (; D--; )
669
- if (r.events[D][0] === "exit" && r.events[D][1].type === "chunkFlow") {
670
- if (N) {
671
- q = r.events[D][1].end;
672
- break;
673
- }
674
- N = !0;
675
- }
676
- for (S(e), x = L; x < r.events.length; )
677
- r.events[x][1].end = {
678
- ...q
679
- }, x++;
680
- nn(r.events, D + 1, 0, r.events.slice(L)), r.events.length = x;
681
- }
682
- }
683
- function S(d) {
684
- let P = t.length;
685
- for (; P-- > d; ) {
686
- const T = t[P];
687
- r.containerState = T[1], T[0].exit.call(r, n);
688
- }
689
- t.length = d;
690
- }
691
- function I() {
692
- u.write([null]), i = void 0, u = void 0, r.containerState._closeFlow = void 0;
693
- }
694
- }
695
- function ee(n, r, t) {
696
- return B(n, n.attempt(this.parser.constructs.document, r, t), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
697
- }
698
- function Hn(n) {
699
- if (n === null || j(n) || Zt(n))
700
- return 1;
701
- if (Yt(n))
702
- return 2;
703
- }
704
- function yn(n, r, t) {
705
- const e = [];
706
- let u = -1;
707
- for (; ++u < n.length; ) {
708
- const i = n[u].resolveAll;
709
- i && !e.includes(i) && (r = i(r, t), e.push(i));
710
- }
711
- return r;
712
- }
713
- const zn = {
714
- name: "attention",
715
- resolveAll: re,
716
- tokenize: ie
717
- };
718
- function re(n, r) {
719
- let t = -1, e, u, i, l, a, m, h, p;
720
- for (; ++t < n.length; )
721
- if (n[t][0] === "enter" && n[t][1].type === "attentionSequence" && n[t][1]._close) {
722
- for (e = t; e--; )
723
- if (n[e][0] === "exit" && n[e][1].type === "attentionSequence" && n[e][1]._open && // If the markers are the same:
724
- r.sliceSerialize(n[e][1]).charCodeAt(0) === r.sliceSerialize(n[t][1]).charCodeAt(0)) {
725
- 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))
726
- continue;
727
- 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;
728
- const f = {
729
- ...n[e][1].end
730
- }, g = {
731
- ...n[t][1].start
732
- };
733
- Vn(f, -m), Vn(g, m), l = {
734
- type: m > 1 ? "strongSequence" : "emphasisSequence",
735
- start: f,
736
- end: {
737
- ...n[e][1].end
738
- }
739
- }, a = {
740
- type: m > 1 ? "strongSequence" : "emphasisSequence",
741
- start: {
742
- ...n[t][1].start
743
- },
744
- end: g
745
- }, i = {
746
- type: m > 1 ? "strongText" : "emphasisText",
747
- start: {
748
- ...n[e][1].end
749
- },
750
- end: {
751
- ...n[t][1].start
752
- }
753
- }, u = {
754
- type: m > 1 ? "strong" : "emphasis",
755
- start: {
756
- ...l.start
757
- },
758
- end: {
759
- ...a.end
760
- }
761
- }, n[e][1].end = {
762
- ...l.start
763
- }, n[t][1].start = {
764
- ...a.end
765
- }, h = [], n[e][1].end.offset - n[e][1].start.offset && (h = W(h, [["enter", n[e][1], r], ["exit", n[e][1], r]])), h = W(h, [["enter", u, r], ["enter", l, r], ["exit", l, r], ["enter", i, r]]), h = W(h, yn(r.parser.constructs.insideSpan.null, n.slice(e + 1, t), r)), h = W(h, [["exit", i, r], ["enter", a, r], ["exit", a, r], ["exit", u, r]]), n[t][1].end.offset - n[t][1].start.offset ? (p = 2, h = W(h, [["enter", n[t][1], r], ["exit", n[t][1], r]])) : p = 0, nn(n, e - 1, t - e + 3, h), t = e + h.length - p - 2;
766
- break;
767
- }
768
- }
769
- for (t = -1; ++t < n.length; )
770
- n[t][1].type === "attentionSequence" && (n[t][1].type = "data");
771
- return n;
772
- }
773
- function ie(n, r) {
774
- const t = this.parser.constructs.attentionMarkers.null, e = this.previous, u = Hn(e);
775
- let i;
776
- return l;
777
- function l(m) {
778
- return i = m, n.enter("attentionSequence"), a(m);
779
- }
780
- function a(m) {
781
- if (m === i)
782
- return n.consume(m), a;
783
- const h = n.exit("attentionSequence"), p = Hn(m), f = !p || p === 2 && u || t.includes(m), g = !u || u === 2 && p || t.includes(e);
784
- return h._open = !!(i === 42 ? f : f && (u || !g)), h._close = !!(i === 42 ? g : g && (p || !f)), r(m);
785
- }
786
- }
787
- function Vn(n, r) {
788
- n.column += r, n.offset += r, n._bufferIndex += r;
789
- }
790
- const ue = {
791
- name: "autolink",
792
- tokenize: le
793
- };
794
- function le(n, r, t) {
795
- let e = 0;
796
- return u;
797
- function u(c) {
798
- return n.enter("autolink"), n.enter("autolinkMarker"), n.consume(c), n.exit("autolinkMarker"), n.enter("autolinkProtocol"), i;
799
- }
800
- function i(c) {
801
- return v(c) ? (n.consume(c), l) : c === 64 ? t(c) : h(c);
802
- }
803
- function l(c) {
804
- return c === 43 || c === 45 || c === 46 || $(c) ? (e = 1, a(c)) : h(c);
805
- }
806
- function a(c) {
807
- return c === 58 ? (n.consume(c), e = 0, m) : (c === 43 || c === 45 || c === 46 || $(c)) && e++ < 32 ? (n.consume(c), a) : (e = 0, h(c));
808
- }
809
- function m(c) {
810
- return c === 62 ? (n.exit("autolinkProtocol"), n.enter("autolinkMarker"), n.consume(c), n.exit("autolinkMarker"), n.exit("autolink"), r) : c === null || c === 32 || c === 60 || wn(c) ? t(c) : (n.consume(c), m);
811
- }
812
- function h(c) {
813
- return c === 64 ? (n.consume(c), p) : Ut(c) ? (n.consume(c), h) : t(c);
814
- }
815
- function p(c) {
816
- return $(c) ? f(c) : t(c);
817
- }
818
- function f(c) {
819
- return c === 46 ? (n.consume(c), e = 0, p) : c === 62 ? (n.exit("autolinkProtocol").type = "autolinkEmail", n.enter("autolinkMarker"), n.consume(c), n.exit("autolinkMarker"), n.exit("autolink"), r) : g(c);
820
- }
821
- function g(c) {
822
- if ((c === 45 || $(c)) && e++ < 63) {
823
- const b = c === 45 ? g : f;
824
- return n.consume(c), b;
825
- }
826
- return t(c);
827
- }
828
- }
829
- const kn = {
830
- partial: !0,
831
- tokenize: ae
832
- };
833
- function ae(n, r, t) {
834
- return e;
835
- function e(i) {
836
- return _(i) ? B(n, u, "linePrefix")(i) : u(i);
837
- }
838
- function u(i) {
839
- return i === null || E(i) ? r(i) : t(i);
840
- }
841
- }
842
- const Gn = {
843
- continuation: {
844
- tokenize: se
845
- },
846
- exit: ce,
847
- name: "blockQuote",
848
- tokenize: oe
849
- };
850
- function oe(n, r, t) {
851
- const e = this;
852
- return u;
853
- function u(l) {
854
- if (l === 62) {
855
- const a = e.containerState;
856
- return a.open || (n.enter("blockQuote", {
857
- _container: !0
858
- }), a.open = !0), n.enter("blockQuotePrefix"), n.enter("blockQuoteMarker"), n.consume(l), n.exit("blockQuoteMarker"), i;
859
- }
860
- return t(l);
861
- }
862
- function i(l) {
863
- return _(l) ? (n.enter("blockQuotePrefixWhitespace"), n.consume(l), n.exit("blockQuotePrefixWhitespace"), n.exit("blockQuotePrefix"), r) : (n.exit("blockQuotePrefix"), r(l));
864
- }
865
- }
866
- function se(n, r, t) {
867
- const e = this;
868
- return u;
869
- function u(l) {
870
- return _(l) ? B(n, i, "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(l) : i(l);
871
- }
872
- function i(l) {
873
- return n.attempt(Gn, r, t)(l);
874
- }
875
- }
876
- function ce(n) {
877
- n.exit("blockQuote");
878
- }
879
- const Jn = {
880
- name: "characterEscape",
881
- tokenize: he
882
- };
883
- function he(n, r, t) {
884
- return e;
885
- function e(i) {
886
- return n.enter("characterEscape"), n.enter("escapeMarker"), n.consume(i), n.exit("escapeMarker"), u;
887
- }
888
- function u(i) {
889
- return $t(i) ? (n.enter("characterEscapeValue"), n.consume(i), n.exit("characterEscapeValue"), n.exit("characterEscape"), r) : t(i);
890
- }
891
- }
892
- const Kn = {
893
- name: "characterReference",
894
- tokenize: fe
895
- };
896
- function fe(n, r, t) {
897
- const e = this;
898
- let u = 0, i, l;
899
- return a;
900
- function a(f) {
901
- return n.enter("characterReference"), n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), m;
902
- }
903
- function m(f) {
904
- return f === 35 ? (n.enter("characterReferenceMarkerNumeric"), n.consume(f), n.exit("characterReferenceMarkerNumeric"), h) : (n.enter("characterReferenceValue"), i = 31, l = $, p(f));
905
- }
906
- function h(f) {
907
- return f === 88 || f === 120 ? (n.enter("characterReferenceMarkerHexadecimal"), n.consume(f), n.exit("characterReferenceMarkerHexadecimal"), n.enter("characterReferenceValue"), i = 6, l = jt, p) : (n.enter("characterReferenceValue"), i = 7, l = Cn, p(f));
908
- }
909
- function p(f) {
910
- if (f === 59 && u) {
911
- const g = n.exit("characterReferenceValue");
912
- return l === $ && !Yn(e.sliceSerialize(g)) ? t(f) : (n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), n.exit("characterReference"), r);
913
- }
914
- return l(f) && u++ < i ? (n.consume(f), p) : t(f);
915
- }
916
- }
917
- const Qn = {
918
- partial: !0,
919
- tokenize: me
920
- }, Wn = {
921
- concrete: !0,
922
- name: "codeFenced",
923
- tokenize: pe
924
- };
925
- function pe(n, r, t) {
926
- const e = this, u = {
927
- partial: !0,
928
- tokenize: T
929
- };
930
- let i = 0, l = 0, a;
931
- return m;
932
- function m(x) {
933
- return h(x);
934
- }
935
- function h(x) {
936
- const L = e.events[e.events.length - 1];
937
- return i = L && L[1].type === "linePrefix" ? L[2].sliceSerialize(L[1], !0).length : 0, a = x, n.enter("codeFenced"), n.enter("codeFencedFence"), n.enter("codeFencedFenceSequence"), p(x);
938
- }
939
- function p(x) {
940
- return x === a ? (l++, n.consume(x), p) : l < 3 ? t(x) : (n.exit("codeFencedFenceSequence"), _(x) ? B(n, f, "whitespace")(x) : f(x));
941
- }
942
- function f(x) {
943
- return x === null || E(x) ? (n.exit("codeFencedFence"), e.interrupt ? r(x) : n.check(Qn, y, P)(x)) : (n.enter("codeFencedFenceInfo"), n.enter("chunkString", {
944
- contentType: "string"
945
- }), g(x));
946
- }
947
- function g(x) {
948
- return x === null || E(x) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), f(x)) : _(x) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), B(n, c, "whitespace")(x)) : x === 96 && x === a ? t(x) : (n.consume(x), g);
949
- }
950
- function c(x) {
951
- return x === null || E(x) ? f(x) : (n.enter("codeFencedFenceMeta"), n.enter("chunkString", {
952
- contentType: "string"
953
- }), b(x));
954
- }
955
- function b(x) {
956
- return x === null || E(x) ? (n.exit("chunkString"), n.exit("codeFencedFenceMeta"), f(x)) : x === 96 && x === a ? t(x) : (n.consume(x), b);
957
- }
958
- function y(x) {
959
- return n.attempt(u, P, F)(x);
960
- }
961
- function F(x) {
962
- return n.enter("lineEnding"), n.consume(x), n.exit("lineEnding"), S;
963
- }
964
- function S(x) {
965
- return i > 0 && _(x) ? B(n, I, "linePrefix", i + 1)(x) : I(x);
966
- }
967
- function I(x) {
968
- return x === null || E(x) ? n.check(Qn, y, P)(x) : (n.enter("codeFlowValue"), d(x));
969
- }
970
- function d(x) {
971
- return x === null || E(x) ? (n.exit("codeFlowValue"), I(x)) : (n.consume(x), d);
972
- }
973
- function P(x) {
974
- return n.exit("codeFenced"), r(x);
975
- }
976
- function T(x, L, D) {
977
- let N = 0;
978
- return q;
979
- function q(A) {
980
- return x.enter("lineEnding"), x.consume(A), x.exit("lineEnding"), z;
981
- }
982
- function z(A) {
983
- return x.enter("codeFencedFence"), _(A) ? B(x, C, "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(A) : C(A);
984
- }
985
- function C(A) {
986
- return A === a ? (x.enter("codeFencedFenceSequence"), O(A)) : D(A);
987
- }
988
- function O(A) {
989
- return A === a ? (N++, x.consume(A), O) : N >= l ? (x.exit("codeFencedFenceSequence"), _(A) ? B(x, M, "whitespace")(A) : M(A)) : D(A);
990
- }
991
- function M(A) {
992
- return A === null || E(A) ? (x.exit("codeFencedFence"), L(A)) : D(A);
993
- }
994
- }
995
- }
996
- function me(n, r, t) {
997
- const e = this;
998
- return u;
999
- function u(l) {
1000
- return l === null ? t(l) : (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i);
1001
- }
1002
- function i(l) {
1003
- return e.parser.lazy[e.now().line] ? t(l) : r(l);
1004
- }
1005
- }
1006
- const bn = {
1007
- name: "codeIndented",
1008
- tokenize: xe
1009
- }, ge = {
1010
- partial: !0,
1011
- tokenize: ke
1012
- };
1013
- function xe(n, r, t) {
1014
- const e = this;
1015
- return u;
1016
- function u(h) {
1017
- return n.enter("codeIndented"), B(n, i, "linePrefix", 5)(h);
1018
- }
1019
- function i(h) {
1020
- const p = e.events[e.events.length - 1];
1021
- return p && p[1].type === "linePrefix" && p[2].sliceSerialize(p[1], !0).length >= 4 ? l(h) : t(h);
1022
- }
1023
- function l(h) {
1024
- return h === null ? m(h) : E(h) ? n.attempt(ge, l, m)(h) : (n.enter("codeFlowValue"), a(h));
1025
- }
1026
- function a(h) {
1027
- return h === null || E(h) ? (n.exit("codeFlowValue"), l(h)) : (n.consume(h), a);
1028
- }
1029
- function m(h) {
1030
- return n.exit("codeIndented"), r(h);
1031
- }
1032
- }
1033
- function ke(n, r, t) {
1034
- const e = this;
1035
- return u;
1036
- function u(l) {
1037
- return e.parser.lazy[e.now().line] ? t(l) : E(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), u) : B(n, i, "linePrefix", 5)(l);
1038
- }
1039
- function i(l) {
1040
- const a = e.events[e.events.length - 1];
1041
- return a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(l) : E(l) ? u(l) : t(l);
1042
- }
1043
- }
1044
- const Se = {
1045
- name: "codeText",
1046
- previous: de,
1047
- resolve: be,
1048
- tokenize: Ie
1049
- };
1050
- function be(n) {
1051
- let r = n.length - 4, t = 3, e, u;
1052
- if ((n[t][1].type === "lineEnding" || n[t][1].type === "space") && (n[r][1].type === "lineEnding" || n[r][1].type === "space")) {
1053
- for (e = t; ++e < r; )
1054
- if (n[e][1].type === "codeTextData") {
1055
- n[t][1].type = "codeTextPadding", n[r][1].type = "codeTextPadding", t += 2, r -= 2;
1056
- break;
1057
- }
1058
- }
1059
- for (e = t - 1, r++; ++e <= r; )
1060
- 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);
1061
- return n;
1062
- }
1063
- function de(n) {
1064
- return n !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
1065
- }
1066
- function Ie(n, r, t) {
1067
- let e = 0, u, i;
1068
- return l;
1069
- function l(f) {
1070
- return n.enter("codeText"), n.enter("codeTextSequence"), a(f);
1071
- }
1072
- function a(f) {
1073
- return f === 96 ? (n.consume(f), e++, a) : (n.exit("codeTextSequence"), m(f));
1074
- }
1075
- function m(f) {
1076
- 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)) : E(f) ? (n.enter("lineEnding"), n.consume(f), n.exit("lineEnding"), m) : (n.enter("codeTextData"), h(f));
1077
- }
1078
- function h(f) {
1079
- return f === null || f === 32 || f === 96 || E(f) ? (n.exit("codeTextData"), m(f)) : (n.consume(f), h);
1080
- }
1081
- function p(f) {
1082
- return f === 96 ? (n.consume(f), u++, p) : u === e ? (n.exit("codeTextSequence"), n.exit("codeText"), r(f)) : (i.type = "codeTextData", h(f));
1083
- }
1084
- }
1085
- class we {
1086
- /**
1087
- * @param {ReadonlyArray<T> | null | undefined} [initial]
1088
- * Initial items (optional).
1089
- * @returns
1090
- * Splice buffer.
1091
- */
1092
- constructor(r) {
1093
- this.left = r ? [...r] : [], this.right = [];
1094
- }
1095
- /**
1096
- * Array access;
1097
- * does not move the cursor.
1098
- *
1099
- * @param {number} index
1100
- * Index.
1101
- * @return {T}
1102
- * Item.
1103
- */
1104
- get(r) {
1105
- if (r < 0 || r >= this.left.length + this.right.length)
1106
- throw new RangeError("Cannot access index `" + r + "` in a splice buffer of size `" + (this.left.length + this.right.length) + "`");
1107
- return r < this.left.length ? this.left[r] : this.right[this.right.length - r + this.left.length - 1];
1108
- }
1109
- /**
1110
- * The length of the splice buffer, one greater than the largest index in the
1111
- * array.
1112
- */
1113
- get length() {
1114
- return this.left.length + this.right.length;
1115
- }
1116
- /**
1117
- * Remove and return `list[0]`;
1118
- * moves the cursor to `0`.
1119
- *
1120
- * @returns {T | undefined}
1121
- * Item, optional.
1122
- */
1123
- shift() {
1124
- return this.setCursor(0), this.right.pop();
1125
- }
1126
- /**
1127
- * Slice the buffer to get an array;
1128
- * does not move the cursor.
1129
- *
1130
- * @param {number} start
1131
- * Start.
1132
- * @param {number | null | undefined} [end]
1133
- * End (optional).
1134
- * @returns {Array<T>}
1135
- * Array of items.
1136
- */
1137
- slice(r, t) {
1138
- const e = t ?? Number.POSITIVE_INFINITY;
1139
- return e < this.left.length ? this.left.slice(r, e) : r > this.left.length ? this.right.slice(this.right.length - e + this.left.length, this.right.length - r + this.left.length).reverse() : this.left.slice(r).concat(this.right.slice(this.right.length - e + this.left.length).reverse());
1140
- }
1141
- /**
1142
- * Mimics the behavior of Array.prototype.splice() except for the change of
1143
- * interface necessary to avoid segfaults when patching in very large arrays.
1144
- *
1145
- * This operation moves cursor is moved to `start` and results in the cursor
1146
- * placed after any inserted items.
1147
- *
1148
- * @param {number} start
1149
- * Start;
1150
- * zero-based index at which to start changing the array;
1151
- * negative numbers count backwards from the end of the array and values
1152
- * that are out-of bounds are clamped to the appropriate end of the array.
1153
- * @param {number | null | undefined} [deleteCount=0]
1154
- * Delete count (default: `0`);
1155
- * maximum number of elements to delete, starting from start.
1156
- * @param {Array<T> | null | undefined} [items=[]]
1157
- * Items to include in place of the deleted items (default: `[]`).
1158
- * @return {Array<T>}
1159
- * Any removed items.
1160
- */
1161
- splice(r, t, e) {
1162
- const u = t || 0;
1163
- this.setCursor(Math.trunc(r));
1164
- const i = this.right.splice(this.right.length - u, Number.POSITIVE_INFINITY);
1165
- return e && fn(this.left, e), i.reverse();
1166
- }
1167
- /**
1168
- * Remove and return the highest-numbered item in the array, so
1169
- * `list[list.length - 1]`;
1170
- * Moves the cursor to `length`.
1171
- *
1172
- * @returns {T | undefined}
1173
- * Item, optional.
1174
- */
1175
- pop() {
1176
- return this.setCursor(Number.POSITIVE_INFINITY), this.left.pop();
1177
- }
1178
- /**
1179
- * Inserts a single item to the high-numbered side of the array;
1180
- * moves the cursor to `length`.
1181
- *
1182
- * @param {T} item
1183
- * Item.
1184
- * @returns {undefined}
1185
- * Nothing.
1186
- */
1187
- push(r) {
1188
- this.setCursor(Number.POSITIVE_INFINITY), this.left.push(r);
1189
- }
1190
- /**
1191
- * Inserts many items to the high-numbered side of the array.
1192
- * Moves the cursor to `length`.
1193
- *
1194
- * @param {Array<T>} items
1195
- * Items.
1196
- * @returns {undefined}
1197
- * Nothing.
1198
- */
1199
- pushMany(r) {
1200
- this.setCursor(Number.POSITIVE_INFINITY), fn(this.left, r);
1201
- }
1202
- /**
1203
- * Inserts a single item to the low-numbered side of the array;
1204
- * Moves the cursor to `0`.
1205
- *
1206
- * @param {T} item
1207
- * Item.
1208
- * @returns {undefined}
1209
- * Nothing.
1210
- */
1211
- unshift(r) {
1212
- this.setCursor(0), this.right.push(r);
1213
- }
1214
- /**
1215
- * Inserts many items to the low-numbered side of the array;
1216
- * moves the cursor to `0`.
1217
- *
1218
- * @param {Array<T>} items
1219
- * Items.
1220
- * @returns {undefined}
1221
- * Nothing.
1222
- */
1223
- unshiftMany(r) {
1224
- this.setCursor(0), fn(this.right, r.reverse());
1225
- }
1226
- /**
1227
- * Move the cursor to a specific position in the array. Requires
1228
- * time proportional to the distance moved.
1229
- *
1230
- * If `n < 0`, the cursor will end up at the beginning.
1231
- * If `n > length`, the cursor will end up at the end.
1232
- *
1233
- * @param {number} n
1234
- * Position.
1235
- * @return {undefined}
1236
- * Nothing.
1237
- */
1238
- setCursor(r) {
1239
- if (!(r === this.left.length || r > this.left.length && this.right.length === 0 || r < 0 && this.left.length === 0))
1240
- if (r < this.left.length) {
1241
- const t = this.left.splice(r, Number.POSITIVE_INFINITY);
1242
- fn(this.right, t.reverse());
1243
- } else {
1244
- const t = this.right.splice(this.left.length + this.right.length - r, Number.POSITIVE_INFINITY);
1245
- fn(this.left, t.reverse());
1246
- }
1247
- }
1248
- }
1249
- function fn(n, r) {
1250
- let t = 0;
1251
- if (r.length < 1e4)
1252
- n.push(...r);
1253
- else
1254
- for (; t < r.length; )
1255
- n.push(...r.slice(t, t + 1e4)), t += 1e4;
1256
- }
1257
- function Xn(n) {
1258
- const r = {};
1259
- let t = -1, e, u, i, l, a, m, h;
1260
- const p = new we(n);
1261
- for (; ++t < p.length; ) {
1262
- for (; t in r; )
1263
- t = r[t];
1264
- if (e = p.get(t), t && e[1].type === "chunkFlow" && p.get(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"))
1265
- for (; ++i < m.length && m[i][1].type !== "content"; )
1266
- m[i][1].type === "chunkText" && (m[i][1]._isInFirstContentOfListItem = !0, i++);
1267
- if (e[0] === "enter")
1268
- e[1].contentType && (Object.assign(r, Ce(p, t)), t = r[t], h = !0);
1269
- else if (e[1]._container) {
1270
- for (i = t, u = void 0; i--; )
1271
- if (l = p.get(i), l[1].type === "lineEnding" || l[1].type === "lineEndingBlank")
1272
- l[0] === "enter" && (u && (p.get(u)[1].type = "lineEndingBlank"), l[1].type = "lineEnding", u = i);
1273
- else if (!(l[1].type === "linePrefix" || l[1].type === "listItemIndent")) break;
1274
- u && (e[1].end = {
1275
- ...p.get(u)[1].start
1276
- }, a = p.slice(u, t), a.unshift(e), p.splice(u, t - u + 1, a));
1277
- }
1278
- }
1279
- return nn(n, 0, Number.POSITIVE_INFINITY, p.slice(0)), !h;
1280
- }
1281
- function Ce(n, r) {
1282
- const t = n.get(r)[1], e = n.get(r)[2];
1283
- let u = r - 1;
1284
- const i = [];
1285
- let l = t._tokenizer;
1286
- l || (l = e.parser[t.contentType](t.start), t._contentTypeTextTrailing && (l._contentTypeTextTrailing = !0));
1287
- const a = l.events, m = [], h = {};
1288
- let p, f, g = -1, c = t, b = 0, y = 0;
1289
- const F = [y];
1290
- for (; c; ) {
1291
- for (; n.get(++u)[1] !== c; )
1292
- ;
1293
- i.push(u), c._tokenizer || (p = e.sliceStream(c), c.next || p.push(null), f && l.defineSkip(c.start), c._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = !0), l.write(p), c._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = void 0)), f = c, c = c.next;
1294
- }
1295
- for (c = t; ++g < a.length; )
1296
- // Find a void token that includes a break.
1297
- a[g][0] === "exit" && a[g - 1][0] === "enter" && a[g][1].type === a[g - 1][1].type && a[g][1].start.line !== a[g][1].end.line && (y = g + 1, F.push(y), c._tokenizer = void 0, c.previous = void 0, c = c.next);
1298
- for (l.events = [], c ? (c._tokenizer = void 0, c.previous = void 0) : F.pop(), g = F.length; g--; ) {
1299
- const S = a.slice(F[g], F[g + 1]), I = i.pop();
1300
- m.push([I, I + S.length - 1]), n.splice(I, 2, S);
1301
- }
1302
- for (m.reverse(), g = -1; ++g < m.length; )
1303
- h[b + m[g][0]] = b + m[g][1], b += m[g][1] - m[g][0] - 1;
1304
- return h;
1305
- }
1306
- const ze = {
1307
- resolve: Ee,
1308
- tokenize: Te
1309
- }, ye = {
1310
- partial: !0,
1311
- tokenize: Fe
1312
- };
1313
- function Ee(n) {
1314
- return Xn(n), n;
1315
- }
1316
- function Te(n, r) {
1317
- let t;
1318
- return e;
1319
- function e(a) {
1320
- return n.enter("content"), t = n.enter("chunkContent", {
1321
- contentType: "content"
1322
- }), u(a);
1323
- }
1324
- function u(a) {
1325
- return a === null ? i(a) : E(a) ? n.check(ye, l, i)(a) : (n.consume(a), u);
1326
- }
1327
- function i(a) {
1328
- return n.exit("chunkContent"), n.exit("content"), r(a);
1329
- }
1330
- function l(a) {
1331
- return n.consume(a), n.exit("chunkContent"), t.next = n.enter("chunkContent", {
1332
- contentType: "content",
1333
- previous: t
1334
- }), t = t.next, u;
1335
- }
1336
- }
1337
- function Fe(n, r, t) {
1338
- const e = this;
1339
- return u;
1340
- function u(l) {
1341
- return n.exit("chunkContent"), n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), B(n, i, "linePrefix");
1342
- }
1343
- function i(l) {
1344
- if (l === null || E(l))
1345
- return t(l);
1346
- const a = e.events[e.events.length - 1];
1347
- 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);
1348
- }
1349
- }
1350
- function vn(n, r, t, e, u, i, l, a, m) {
1351
- const h = m || Number.POSITIVE_INFINITY;
1352
- let p = 0;
1353
- return f;
1354
- function f(S) {
1355
- return S === 60 ? (n.enter(e), n.enter(u), n.enter(i), n.consume(S), n.exit(i), g) : S === null || S === 32 || S === 41 || wn(S) ? t(S) : (n.enter(e), n.enter(l), n.enter(a), n.enter("chunkString", {
1356
- contentType: "string"
1357
- }), y(S));
1358
- }
1359
- function g(S) {
1360
- return S === 62 ? (n.enter(i), n.consume(S), n.exit(i), n.exit(u), n.exit(e), r) : (n.enter(a), n.enter("chunkString", {
1361
- contentType: "string"
1362
- }), c(S));
1363
- }
1364
- function c(S) {
1365
- return S === 62 ? (n.exit("chunkString"), n.exit(a), g(S)) : S === null || S === 60 || E(S) ? t(S) : (n.consume(S), S === 92 ? b : c);
1366
- }
1367
- function b(S) {
1368
- return S === 60 || S === 62 || S === 92 ? (n.consume(S), c) : c(S);
1369
- }
1370
- function y(S) {
1371
- return !p && (S === null || S === 41 || j(S)) ? (n.exit("chunkString"), n.exit(a), n.exit(l), n.exit(e), r(S)) : p < h && S === 40 ? (n.consume(S), p++, y) : S === 41 ? (n.consume(S), p--, y) : S === null || S === 32 || S === 40 || wn(S) ? t(S) : (n.consume(S), S === 92 ? F : y);
1372
- }
1373
- function F(S) {
1374
- return S === 40 || S === 41 || S === 92 ? (n.consume(S), y) : y(S);
1375
- }
1376
- }
1377
- function nt(n, r, t, e, u, i) {
1378
- const l = this;
1379
- let a = 0, m;
1380
- return h;
1381
- function h(c) {
1382
- return n.enter(e), n.enter(u), n.consume(c), n.exit(u), n.enter(i), p;
1383
- }
1384
- function p(c) {
1385
- return a > 999 || c === null || c === 91 || c === 93 && !m || // To do: remove in the future once we’ve switched from
1386
- // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
1387
- // which doesn’t need this.
1388
- // Hidden footnotes hook.
1389
- /* c8 ignore next 3 */
1390
- c === 94 && !a && "_hiddenFootnoteSupport" in l.parser.constructs ? t(c) : c === 93 ? (n.exit(i), n.enter(u), n.consume(c), n.exit(u), n.exit(e), r) : E(c) ? (n.enter("lineEnding"), n.consume(c), n.exit("lineEnding"), p) : (n.enter("chunkString", {
1391
- contentType: "string"
1392
- }), f(c));
1393
- }
1394
- function f(c) {
1395
- return c === null || c === 91 || c === 93 || E(c) || a++ > 999 ? (n.exit("chunkString"), p(c)) : (n.consume(c), m || (m = !_(c)), c === 92 ? g : f);
1396
- }
1397
- function g(c) {
1398
- return c === 91 || c === 92 || c === 93 ? (n.consume(c), a++, f) : f(c);
1399
- }
1400
- }
1401
- function tt(n, r, t, e, u, i) {
1402
- let l;
1403
- return a;
1404
- function a(g) {
1405
- return g === 34 || g === 39 || g === 40 ? (n.enter(e), n.enter(u), n.consume(g), n.exit(u), l = g === 40 ? 41 : g, m) : t(g);
1406
- }
1407
- function m(g) {
1408
- return g === l ? (n.enter(u), n.consume(g), n.exit(u), n.exit(e), r) : (n.enter(i), h(g));
1409
- }
1410
- function h(g) {
1411
- return g === l ? (n.exit(i), m(l)) : g === null ? t(g) : E(g) ? (n.enter("lineEnding"), n.consume(g), n.exit("lineEnding"), B(n, h, "linePrefix")) : (n.enter("chunkString", {
1412
- contentType: "string"
1413
- }), p(g));
1414
- }
1415
- function p(g) {
1416
- return g === l || g === null || E(g) ? (n.exit("chunkString"), h(g)) : (n.consume(g), g === 92 ? f : p);
1417
- }
1418
- function f(g) {
1419
- return g === l || g === 92 ? (n.consume(g), p) : p(g);
1420
- }
1421
- }
1422
- function pn(n, r) {
1423
- let t;
1424
- return e;
1425
- function e(u) {
1426
- return E(u) ? (n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), t = !0, e) : _(u) ? B(n, e, t ? "linePrefix" : "lineSuffix")(u) : r(u);
1427
- }
1428
- }
1429
- const Ae = {
1430
- name: "definition",
1431
- tokenize: Le
1432
- }, _e = {
1433
- partial: !0,
1434
- tokenize: Pe
1435
- };
1436
- function Le(n, r, t) {
1437
- const e = this;
1438
- let u;
1439
- return i;
1440
- function i(c) {
1441
- return n.enter("definition"), l(c);
1442
- }
1443
- function l(c) {
1444
- return nt.call(
1445
- e,
1446
- n,
1447
- a,
1448
- // Note: we don’t need to reset the way `markdown-rs` does.
1449
- t,
1450
- "definitionLabel",
1451
- "definitionLabelMarker",
1452
- "definitionLabelString"
1453
- )(c);
1454
- }
1455
- function a(c) {
1456
- return u = mn(e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1)), c === 58 ? (n.enter("definitionMarker"), n.consume(c), n.exit("definitionMarker"), m) : t(c);
1457
- }
1458
- function m(c) {
1459
- return j(c) ? pn(n, h)(c) : h(c);
1460
- }
1461
- function h(c) {
1462
- return vn(
1463
- n,
1464
- p,
1465
- // Note: we don’t need to reset the way `markdown-rs` does.
1466
- t,
1467
- "definitionDestination",
1468
- "definitionDestinationLiteral",
1469
- "definitionDestinationLiteralMarker",
1470
- "definitionDestinationRaw",
1471
- "definitionDestinationString"
1472
- )(c);
1473
- }
1474
- function p(c) {
1475
- return n.attempt(_e, f, f)(c);
1476
- }
1477
- function f(c) {
1478
- return _(c) ? B(n, g, "whitespace")(c) : g(c);
1479
- }
1480
- function g(c) {
1481
- return c === null || E(c) ? (n.exit("definition"), e.parser.defined.push(u), r(c)) : t(c);
1482
- }
1483
- }
1484
- function Pe(n, r, t) {
1485
- return e;
1486
- function e(a) {
1487
- return j(a) ? pn(n, u)(a) : t(a);
1488
- }
1489
- function u(a) {
1490
- return tt(n, i, t, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(a);
1491
- }
1492
- function i(a) {
1493
- return _(a) ? B(n, l, "whitespace")(a) : l(a);
1494
- }
1495
- function l(a) {
1496
- return a === null || E(a) ? r(a) : t(a);
1497
- }
1498
- }
1499
- const Be = {
1500
- name: "hardBreakEscape",
1501
- tokenize: Oe
1502
- };
1503
- function Oe(n, r, t) {
1504
- return e;
1505
- function e(i) {
1506
- return n.enter("hardBreakEscape"), n.consume(i), u;
1507
- }
1508
- function u(i) {
1509
- return E(i) ? (n.exit("hardBreakEscape"), r(i)) : t(i);
1510
- }
1511
- }
1512
- const Me = {
1513
- name: "headingAtx",
1514
- resolve: De,
1515
- tokenize: Ne
1516
- };
1517
- function De(n, r) {
1518
- let t = n.length - 2, e = 3, u, i;
1519
- 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 = {
1520
- type: "atxHeadingText",
1521
- start: n[e][1].start,
1522
- end: n[t][1].end
1523
- }, i = {
1524
- type: "chunkText",
1525
- start: n[e][1].start,
1526
- end: n[t][1].end,
1527
- contentType: "text"
1528
- }, nn(n, e, t - e + 1, [["enter", u, r], ["enter", i, r], ["exit", i, r], ["exit", u, r]])), n;
1529
- }
1530
- function Ne(n, r, t) {
1531
- let e = 0;
1532
- return u;
1533
- function u(p) {
1534
- return n.enter("atxHeading"), i(p);
1535
- }
1536
- function i(p) {
1537
- return n.enter("atxHeadingSequence"), l(p);
1538
- }
1539
- function l(p) {
1540
- return p === 35 && e++ < 6 ? (n.consume(p), l) : p === null || j(p) ? (n.exit("atxHeadingSequence"), a(p)) : t(p);
1541
- }
1542
- function a(p) {
1543
- return p === 35 ? (n.enter("atxHeadingSequence"), m(p)) : p === null || E(p) ? (n.exit("atxHeading"), r(p)) : _(p) ? B(n, a, "whitespace")(p) : (n.enter("atxHeadingText"), h(p));
1544
- }
1545
- function m(p) {
1546
- return p === 35 ? (n.consume(p), m) : (n.exit("atxHeadingSequence"), a(p));
1547
- }
1548
- function h(p) {
1549
- return p === null || p === 35 || j(p) ? (n.exit("atxHeadingText"), a(p)) : (n.consume(p), h);
1550
- }
1551
- }
1552
- const qe = [
1553
- "address",
1554
- "article",
1555
- "aside",
1556
- "base",
1557
- "basefont",
1558
- "blockquote",
1559
- "body",
1560
- "caption",
1561
- "center",
1562
- "col",
1563
- "colgroup",
1564
- "dd",
1565
- "details",
1566
- "dialog",
1567
- "dir",
1568
- "div",
1569
- "dl",
1570
- "dt",
1571
- "fieldset",
1572
- "figcaption",
1573
- "figure",
1574
- "footer",
1575
- "form",
1576
- "frame",
1577
- "frameset",
1578
- "h1",
1579
- "h2",
1580
- "h3",
1581
- "h4",
1582
- "h5",
1583
- "h6",
1584
- "head",
1585
- "header",
1586
- "hr",
1587
- "html",
1588
- "iframe",
1589
- "legend",
1590
- "li",
1591
- "link",
1592
- "main",
1593
- "menu",
1594
- "menuitem",
1595
- "nav",
1596
- "noframes",
1597
- "ol",
1598
- "optgroup",
1599
- "option",
1600
- "p",
1601
- "param",
1602
- "search",
1603
- "section",
1604
- "summary",
1605
- "table",
1606
- "tbody",
1607
- "td",
1608
- "tfoot",
1609
- "th",
1610
- "thead",
1611
- "title",
1612
- "tr",
1613
- "track",
1614
- "ul"
1615
- ], Un = ["pre", "script", "style", "textarea"], Re = {
1616
- concrete: !0,
1617
- name: "htmlFlow",
1618
- resolveTo: Qe,
1619
- tokenize: We
1620
- }, He = {
1621
- partial: !0,
1622
- tokenize: je
1623
- }, Ve = {
1624
- partial: !0,
1625
- tokenize: Ue
1626
- };
1627
- function Qe(n) {
1628
- let r = n.length;
1629
- for (; r-- && !(n[r][0] === "enter" && n[r][1].type === "htmlFlow"); )
1630
- ;
1631
- 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;
1632
- }
1633
- function We(n, r, t) {
1634
- const e = this;
1635
- let u, i, l, a, m;
1636
- return h;
1637
- function h(s) {
1638
- return p(s);
1639
- }
1640
- function p(s) {
1641
- return n.enter("htmlFlow"), n.enter("htmlFlowData"), n.consume(s), f;
1642
- }
1643
- function f(s) {
1644
- return s === 33 ? (n.consume(s), g) : s === 47 ? (n.consume(s), i = !0, y) : s === 63 ? (n.consume(s), u = 3, e.interrupt ? r : o) : v(s) ? (n.consume(s), l = String.fromCharCode(s), F) : t(s);
1645
- }
1646
- function g(s) {
1647
- return s === 45 ? (n.consume(s), u = 2, c) : s === 91 ? (n.consume(s), u = 5, a = 0, b) : v(s) ? (n.consume(s), u = 4, e.interrupt ? r : o) : t(s);
1648
- }
1649
- function c(s) {
1650
- return s === 45 ? (n.consume(s), e.interrupt ? r : o) : t(s);
1651
- }
1652
- function b(s) {
1653
- const G = "CDATA[";
1654
- return s === G.charCodeAt(a++) ? (n.consume(s), a === G.length ? e.interrupt ? r : C : b) : t(s);
1655
- }
1656
- function y(s) {
1657
- return v(s) ? (n.consume(s), l = String.fromCharCode(s), F) : t(s);
1658
- }
1659
- function F(s) {
1660
- if (s === null || s === 47 || s === 62 || j(s)) {
1661
- const G = s === 47, an = l.toLowerCase();
1662
- return !G && !i && Un.includes(an) ? (u = 1, e.interrupt ? r(s) : C(s)) : qe.includes(l.toLowerCase()) ? (u = 6, G ? (n.consume(s), S) : e.interrupt ? r(s) : C(s)) : (u = 7, e.interrupt && !e.parser.lazy[e.now().line] ? t(s) : i ? I(s) : d(s));
1663
- }
1664
- return s === 45 || $(s) ? (n.consume(s), l += String.fromCharCode(s), F) : t(s);
1665
- }
1666
- function S(s) {
1667
- return s === 62 ? (n.consume(s), e.interrupt ? r : C) : t(s);
1668
- }
1669
- function I(s) {
1670
- return _(s) ? (n.consume(s), I) : q(s);
1671
- }
1672
- function d(s) {
1673
- return s === 47 ? (n.consume(s), q) : s === 58 || s === 95 || v(s) ? (n.consume(s), P) : _(s) ? (n.consume(s), d) : q(s);
1674
- }
1675
- function P(s) {
1676
- return s === 45 || s === 46 || s === 58 || s === 95 || $(s) ? (n.consume(s), P) : T(s);
1677
- }
1678
- function T(s) {
1679
- return s === 61 ? (n.consume(s), x) : _(s) ? (n.consume(s), T) : d(s);
1680
- }
1681
- function x(s) {
1682
- return s === null || s === 60 || s === 61 || s === 62 || s === 96 ? t(s) : s === 34 || s === 39 ? (n.consume(s), m = s, L) : _(s) ? (n.consume(s), x) : D(s);
1683
- }
1684
- function L(s) {
1685
- return s === m ? (n.consume(s), m = null, N) : s === null || E(s) ? t(s) : (n.consume(s), L);
1686
- }
1687
- function D(s) {
1688
- return s === null || s === 34 || s === 39 || s === 47 || s === 60 || s === 61 || s === 62 || s === 96 || j(s) ? T(s) : (n.consume(s), D);
1689
- }
1690
- function N(s) {
1691
- return s === 47 || s === 62 || _(s) ? d(s) : t(s);
1692
- }
1693
- function q(s) {
1694
- return s === 62 ? (n.consume(s), z) : t(s);
1695
- }
1696
- function z(s) {
1697
- return s === null || E(s) ? C(s) : _(s) ? (n.consume(s), z) : t(s);
1698
- }
1699
- function C(s) {
1700
- return s === 45 && u === 2 ? (n.consume(s), V) : s === 60 && u === 1 ? (n.consume(s), R) : s === 62 && u === 4 ? (n.consume(s), Z) : s === 63 && u === 3 ? (n.consume(s), o) : s === 93 && u === 5 ? (n.consume(s), tn) : E(s) && (u === 6 || u === 7) ? (n.exit("htmlFlowData"), n.check(He, en, O)(s)) : s === null || E(s) ? (n.exit("htmlFlowData"), O(s)) : (n.consume(s), C);
1701
- }
1702
- function O(s) {
1703
- return n.check(Ve, M, en)(s);
1704
- }
1705
- function M(s) {
1706
- return n.enter("lineEnding"), n.consume(s), n.exit("lineEnding"), A;
1707
- }
1708
- function A(s) {
1709
- return s === null || E(s) ? O(s) : (n.enter("htmlFlowData"), C(s));
1710
- }
1711
- function V(s) {
1712
- return s === 45 ? (n.consume(s), o) : C(s);
1713
- }
1714
- function R(s) {
1715
- return s === 47 ? (n.consume(s), l = "", Y) : C(s);
1716
- }
1717
- function Y(s) {
1718
- if (s === 62) {
1719
- const G = l.toLowerCase();
1720
- return Un.includes(G) ? (n.consume(s), Z) : C(s);
1721
- }
1722
- return v(s) && l.length < 8 ? (n.consume(s), l += String.fromCharCode(s), Y) : C(s);
1723
- }
1724
- function tn(s) {
1725
- return s === 93 ? (n.consume(s), o) : C(s);
1726
- }
1727
- function o(s) {
1728
- return s === 62 ? (n.consume(s), Z) : s === 45 && u === 2 ? (n.consume(s), o) : C(s);
1729
- }
1730
- function Z(s) {
1731
- return s === null || E(s) ? (n.exit("htmlFlowData"), en(s)) : (n.consume(s), Z);
1732
- }
1733
- function en(s) {
1734
- return n.exit("htmlFlow"), r(s);
1735
- }
1736
- }
1737
- function Ue(n, r, t) {
1738
- const e = this;
1739
- return u;
1740
- function u(l) {
1741
- return E(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i) : t(l);
1742
- }
1743
- function i(l) {
1744
- return e.parser.lazy[e.now().line] ? t(l) : r(l);
1745
- }
1746
- }
1747
- function je(n, r, t) {
1748
- return e;
1749
- function e(u) {
1750
- return n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), n.attempt(kn, r, t);
1751
- }
1752
- }
1753
- const $e = {
1754
- name: "htmlText",
1755
- tokenize: Ye
1756
- };
1757
- function Ye(n, r, t) {
1758
- const e = this;
1759
- let u, i, l;
1760
- return a;
1761
- function a(o) {
1762
- return n.enter("htmlText"), n.enter("htmlTextData"), n.consume(o), m;
1763
- }
1764
- function m(o) {
1765
- return o === 33 ? (n.consume(o), h) : o === 47 ? (n.consume(o), T) : o === 63 ? (n.consume(o), d) : v(o) ? (n.consume(o), D) : t(o);
1766
- }
1767
- function h(o) {
1768
- return o === 45 ? (n.consume(o), p) : o === 91 ? (n.consume(o), i = 0, b) : v(o) ? (n.consume(o), I) : t(o);
1769
- }
1770
- function p(o) {
1771
- return o === 45 ? (n.consume(o), c) : t(o);
1772
- }
1773
- function f(o) {
1774
- return o === null ? t(o) : o === 45 ? (n.consume(o), g) : E(o) ? (l = f, R(o)) : (n.consume(o), f);
1775
- }
1776
- function g(o) {
1777
- return o === 45 ? (n.consume(o), c) : f(o);
1778
- }
1779
- function c(o) {
1780
- return o === 62 ? V(o) : o === 45 ? g(o) : f(o);
1781
- }
1782
- function b(o) {
1783
- const Z = "CDATA[";
1784
- return o === Z.charCodeAt(i++) ? (n.consume(o), i === Z.length ? y : b) : t(o);
1785
- }
1786
- function y(o) {
1787
- return o === null ? t(o) : o === 93 ? (n.consume(o), F) : E(o) ? (l = y, R(o)) : (n.consume(o), y);
1788
- }
1789
- function F(o) {
1790
- return o === 93 ? (n.consume(o), S) : y(o);
1791
- }
1792
- function S(o) {
1793
- return o === 62 ? V(o) : o === 93 ? (n.consume(o), S) : y(o);
1794
- }
1795
- function I(o) {
1796
- return o === null || o === 62 ? V(o) : E(o) ? (l = I, R(o)) : (n.consume(o), I);
1797
- }
1798
- function d(o) {
1799
- return o === null ? t(o) : o === 63 ? (n.consume(o), P) : E(o) ? (l = d, R(o)) : (n.consume(o), d);
1800
- }
1801
- function P(o) {
1802
- return o === 62 ? V(o) : d(o);
1803
- }
1804
- function T(o) {
1805
- return v(o) ? (n.consume(o), x) : t(o);
1806
- }
1807
- function x(o) {
1808
- return o === 45 || $(o) ? (n.consume(o), x) : L(o);
1809
- }
1810
- function L(o) {
1811
- return E(o) ? (l = L, R(o)) : _(o) ? (n.consume(o), L) : V(o);
1812
- }
1813
- function D(o) {
1814
- return o === 45 || $(o) ? (n.consume(o), D) : o === 47 || o === 62 || j(o) ? N(o) : t(o);
1815
- }
1816
- function N(o) {
1817
- return o === 47 ? (n.consume(o), V) : o === 58 || o === 95 || v(o) ? (n.consume(o), q) : E(o) ? (l = N, R(o)) : _(o) ? (n.consume(o), N) : V(o);
1818
- }
1819
- function q(o) {
1820
- return o === 45 || o === 46 || o === 58 || o === 95 || $(o) ? (n.consume(o), q) : z(o);
1821
- }
1822
- function z(o) {
1823
- return o === 61 ? (n.consume(o), C) : E(o) ? (l = z, R(o)) : _(o) ? (n.consume(o), z) : N(o);
1824
- }
1825
- function C(o) {
1826
- return o === null || o === 60 || o === 61 || o === 62 || o === 96 ? t(o) : o === 34 || o === 39 ? (n.consume(o), u = o, O) : E(o) ? (l = C, R(o)) : _(o) ? (n.consume(o), C) : (n.consume(o), M);
1827
- }
1828
- function O(o) {
1829
- return o === u ? (n.consume(o), u = void 0, A) : o === null ? t(o) : E(o) ? (l = O, R(o)) : (n.consume(o), O);
1830
- }
1831
- function M(o) {
1832
- return o === null || o === 34 || o === 39 || o === 60 || o === 61 || o === 96 ? t(o) : o === 47 || o === 62 || j(o) ? N(o) : (n.consume(o), M);
1833
- }
1834
- function A(o) {
1835
- return o === 47 || o === 62 || j(o) ? N(o) : t(o);
1836
- }
1837
- function V(o) {
1838
- return o === 62 ? (n.consume(o), n.exit("htmlTextData"), n.exit("htmlText"), r) : t(o);
1839
- }
1840
- function R(o) {
1841
- return n.exit("htmlTextData"), n.enter("lineEnding"), n.consume(o), n.exit("lineEnding"), Y;
1842
- }
1843
- function Y(o) {
1844
- return _(o) ? B(n, tn, "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(o) : tn(o);
1845
- }
1846
- function tn(o) {
1847
- return n.enter("htmlTextData"), l(o);
1848
- }
1849
- }
1850
- const En = {
1851
- name: "labelEnd",
1852
- resolveAll: Ke,
1853
- resolveTo: Xe,
1854
- tokenize: ve
1855
- }, Ze = {
1856
- tokenize: nr
1857
- }, Ge = {
1858
- tokenize: tr
1859
- }, Je = {
1860
- tokenize: er
1861
- };
1862
- function Ke(n) {
1863
- let r = -1;
1864
- const t = [];
1865
- for (; ++r < n.length; ) {
1866
- const e = n[r][1];
1867
- if (t.push(n[r]), e.type === "labelImage" || e.type === "labelLink" || e.type === "labelEnd") {
1868
- const u = e.type === "labelImage" ? 4 : 2;
1869
- e.type = "data", r += u;
1870
- }
1871
- }
1872
- return n.length !== t.length && nn(n, 0, n.length, t), n;
1873
- }
1874
- function Xe(n, r) {
1875
- let t = n.length, e = 0, u, i, l, a;
1876
- for (; t--; )
1877
- if (u = n[t][1], i) {
1878
- if (u.type === "link" || u.type === "labelLink" && u._inactive)
1879
- break;
1880
- n[t][0] === "enter" && u.type === "labelLink" && (u._inactive = !0);
1881
- } else if (l) {
1882
- if (n[t][0] === "enter" && (u.type === "labelImage" || u.type === "labelLink") && !u._balanced && (i = t, u.type !== "labelLink")) {
1883
- e = 2;
1884
- break;
1885
- }
1886
- } else u.type === "labelEnd" && (l = t);
1887
- const m = {
1888
- type: n[i][1].type === "labelLink" ? "link" : "image",
1889
- start: {
1890
- ...n[i][1].start
1891
- },
1892
- end: {
1893
- ...n[n.length - 1][1].end
1894
- }
1895
- }, h = {
1896
- type: "label",
1897
- start: {
1898
- ...n[i][1].start
1899
- },
1900
- end: {
1901
- ...n[l][1].end
1902
- }
1903
- }, p = {
1904
- type: "labelText",
1905
- start: {
1906
- ...n[i + e + 2][1].end
1907
- },
1908
- end: {
1909
- ...n[l - 2][1].start
1910
- }
1911
- };
1912
- return a = [["enter", m, r], ["enter", h, r]], a = W(a, n.slice(i + 1, i + e + 3)), a = W(a, [["enter", p, r]]), a = W(a, yn(r.parser.constructs.insideSpan.null, n.slice(i + e + 4, l - 3), r)), a = W(a, [["exit", p, r], n[l - 2], n[l - 1], ["exit", h, r]]), a = W(a, n.slice(l + 1)), a = W(a, [["exit", m, r]]), nn(n, i, n.length, a), n;
1913
- }
1914
- function ve(n, r, t) {
1915
- const e = this;
1916
- let u = e.events.length, i, l;
1917
- for (; u--; )
1918
- if ((e.events[u][1].type === "labelImage" || e.events[u][1].type === "labelLink") && !e.events[u][1]._balanced) {
1919
- i = e.events[u][1];
1920
- break;
1921
- }
1922
- return a;
1923
- function a(g) {
1924
- return i ? i._inactive ? f(g) : (l = e.parser.defined.includes(mn(e.sliceSerialize({
1925
- start: i.end,
1926
- end: e.now()
1927
- }))), n.enter("labelEnd"), n.enter("labelMarker"), n.consume(g), n.exit("labelMarker"), n.exit("labelEnd"), m) : t(g);
1928
- }
1929
- function m(g) {
1930
- return g === 40 ? n.attempt(Ze, p, l ? p : f)(g) : g === 91 ? n.attempt(Ge, p, l ? h : f)(g) : l ? p(g) : f(g);
1931
- }
1932
- function h(g) {
1933
- return n.attempt(Je, p, f)(g);
1934
- }
1935
- function p(g) {
1936
- return r(g);
1937
- }
1938
- function f(g) {
1939
- return i._balanced = !0, t(g);
1940
- }
1941
- }
1942
- function nr(n, r, t) {
1943
- return e;
1944
- function e(f) {
1945
- return n.enter("resource"), n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), u;
1946
- }
1947
- function u(f) {
1948
- return j(f) ? pn(n, i)(f) : i(f);
1949
- }
1950
- function i(f) {
1951
- return f === 41 ? p(f) : vn(n, l, a, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(f);
1952
- }
1953
- function l(f) {
1954
- return j(f) ? pn(n, m)(f) : p(f);
1955
- }
1956
- function a(f) {
1957
- return t(f);
1958
- }
1959
- function m(f) {
1960
- return f === 34 || f === 39 || f === 40 ? tt(n, h, t, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(f) : p(f);
1961
- }
1962
- function h(f) {
1963
- return j(f) ? pn(n, p)(f) : p(f);
1964
- }
1965
- function p(f) {
1966
- return f === 41 ? (n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), n.exit("resource"), r) : t(f);
1967
- }
1968
- }
1969
- function tr(n, r, t) {
1970
- const e = this;
1971
- return u;
1972
- function u(a) {
1973
- return nt.call(e, n, i, l, "reference", "referenceMarker", "referenceString")(a);
1974
- }
1975
- function i(a) {
1976
- return e.parser.defined.includes(mn(e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1))) ? r(a) : t(a);
1977
- }
1978
- function l(a) {
1979
- return t(a);
1980
- }
1981
- }
1982
- function er(n, r, t) {
1983
- return e;
1984
- function e(i) {
1985
- return n.enter("reference"), n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), u;
1986
- }
1987
- function u(i) {
1988
- return i === 93 ? (n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), n.exit("reference"), r) : t(i);
1989
- }
1990
- }
1991
- const rr = {
1992
- name: "labelStartImage",
1993
- resolveAll: En.resolveAll,
1994
- tokenize: ir
1995
- };
1996
- function ir(n, r, t) {
1997
- const e = this;
1998
- return u;
1999
- function u(a) {
2000
- return n.enter("labelImage"), n.enter("labelImageMarker"), n.consume(a), n.exit("labelImageMarker"), i;
2001
- }
2002
- function i(a) {
2003
- return a === 91 ? (n.enter("labelMarker"), n.consume(a), n.exit("labelMarker"), n.exit("labelImage"), l) : t(a);
2004
- }
2005
- function l(a) {
2006
- return a === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(a) : r(a);
2007
- }
2008
- }
2009
- const ur = {
2010
- name: "labelStartLink",
2011
- resolveAll: En.resolveAll,
2012
- tokenize: lr
2013
- };
2014
- function lr(n, r, t) {
2015
- const e = this;
2016
- return u;
2017
- function u(l) {
2018
- return n.enter("labelLink"), n.enter("labelMarker"), n.consume(l), n.exit("labelMarker"), n.exit("labelLink"), i;
2019
- }
2020
- function i(l) {
2021
- return l === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(l) : r(l);
2022
- }
2023
- }
2024
- const dn = {
2025
- name: "lineEnding",
2026
- tokenize: ar
2027
- };
2028
- function ar(n, r) {
2029
- return t;
2030
- function t(e) {
2031
- return n.enter("lineEnding"), n.consume(e), n.exit("lineEnding"), B(n, r, "linePrefix");
2032
- }
2033
- }
2034
- const xn = {
2035
- name: "thematicBreak",
2036
- tokenize: or
2037
- };
2038
- function or(n, r, t) {
2039
- let e = 0, u;
2040
- return i;
2041
- function i(h) {
2042
- return n.enter("thematicBreak"), l(h);
2043
- }
2044
- function l(h) {
2045
- return u = h, a(h);
2046
- }
2047
- function a(h) {
2048
- return h === u ? (n.enter("thematicBreakSequence"), m(h)) : e >= 3 && (h === null || E(h)) ? (n.exit("thematicBreak"), r(h)) : t(h);
2049
- }
2050
- function m(h) {
2051
- return h === u ? (n.consume(h), e++, m) : (n.exit("thematicBreakSequence"), _(h) ? B(n, a, "whitespace")(h) : a(h));
2052
- }
2053
- }
2054
- const U = {
2055
- continuation: {
2056
- tokenize: fr
2057
- },
2058
- exit: mr,
2059
- name: "list",
2060
- tokenize: hr
2061
- }, sr = {
2062
- partial: !0,
2063
- tokenize: gr
2064
- }, cr = {
2065
- partial: !0,
2066
- tokenize: pr
2067
- };
2068
- function hr(n, r, t) {
2069
- const e = this, u = e.events[e.events.length - 1];
2070
- let i = u && u[1].type === "linePrefix" ? u[2].sliceSerialize(u[1], !0).length : 0, l = 0;
2071
- return a;
2072
- function a(c) {
2073
- const b = e.containerState.type || (c === 42 || c === 43 || c === 45 ? "listUnordered" : "listOrdered");
2074
- if (b === "listUnordered" ? !e.containerState.marker || c === e.containerState.marker : Cn(c)) {
2075
- if (e.containerState.type || (e.containerState.type = b, n.enter(b, {
2076
- _container: !0
2077
- })), b === "listUnordered")
2078
- return n.enter("listItemPrefix"), c === 42 || c === 45 ? n.check(xn, t, h)(c) : h(c);
2079
- if (!e.interrupt || c === 49)
2080
- return n.enter("listItemPrefix"), n.enter("listItemValue"), m(c);
2081
- }
2082
- return t(c);
2083
- }
2084
- function m(c) {
2085
- return Cn(c) && ++l < 10 ? (n.consume(c), m) : (!e.interrupt || l < 2) && (e.containerState.marker ? c === e.containerState.marker : c === 41 || c === 46) ? (n.exit("listItemValue"), h(c)) : t(c);
2086
- }
2087
- function h(c) {
2088
- return n.enter("listItemMarker"), n.consume(c), n.exit("listItemMarker"), e.containerState.marker = e.containerState.marker || c, n.check(
2089
- kn,
2090
- // Can’t be empty when interrupting.
2091
- e.interrupt ? t : p,
2092
- n.attempt(sr, g, f)
2093
- );
2094
- }
2095
- function p(c) {
2096
- return e.containerState.initialBlankLine = !0, i++, g(c);
2097
- }
2098
- function f(c) {
2099
- return _(c) ? (n.enter("listItemPrefixWhitespace"), n.consume(c), n.exit("listItemPrefixWhitespace"), g) : t(c);
2100
- }
2101
- function g(c) {
2102
- return e.containerState.size = i + e.sliceSerialize(n.exit("listItemPrefix"), !0).length, r(c);
2103
- }
2104
- }
2105
- function fr(n, r, t) {
2106
- const e = this;
2107
- return e.containerState._closeFlow = void 0, n.check(kn, u, i);
2108
- function u(a) {
2109
- return e.containerState.furtherBlankLines = e.containerState.furtherBlankLines || e.containerState.initialBlankLine, B(n, r, "listItemIndent", e.containerState.size + 1)(a);
2110
- }
2111
- function i(a) {
2112
- return e.containerState.furtherBlankLines || !_(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(cr, r, l)(a));
2113
- }
2114
- function l(a) {
2115
- return e.containerState._closeFlow = !0, e.interrupt = void 0, B(n, n.attempt(U, r, t), "linePrefix", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(a);
2116
- }
2117
- }
2118
- function pr(n, r, t) {
2119
- const e = this;
2120
- return B(n, u, "listItemIndent", e.containerState.size + 1);
2121
- function u(i) {
2122
- const l = e.events[e.events.length - 1];
2123
- return l && l[1].type === "listItemIndent" && l[2].sliceSerialize(l[1], !0).length === e.containerState.size ? r(i) : t(i);
2124
- }
2125
- }
2126
- function mr(n) {
2127
- n.exit(this.containerState.type);
2128
- }
2129
- function gr(n, r, t) {
2130
- const e = this;
2131
- return B(n, u, "listItemPrefixWhitespace", e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5);
2132
- function u(i) {
2133
- const l = e.events[e.events.length - 1];
2134
- return !_(i) && l && l[1].type === "listItemPrefixWhitespace" ? r(i) : t(i);
2135
- }
2136
- }
2137
- const jn = {
2138
- name: "setextUnderline",
2139
- resolveTo: xr,
2140
- tokenize: kr
2141
- };
2142
- function xr(n, r) {
2143
- let t = n.length, e, u, i;
2144
- for (; t--; )
2145
- if (n[t][0] === "enter") {
2146
- if (n[t][1].type === "content") {
2147
- e = t;
2148
- break;
2149
- }
2150
- n[t][1].type === "paragraph" && (u = t);
2151
- } else
2152
- n[t][1].type === "content" && n.splice(t, 1), !i && n[t][1].type === "definition" && (i = t);
2153
- const l = {
2154
- type: "setextHeading",
2155
- start: {
2156
- ...n[e][1].start
2157
- },
2158
- end: {
2159
- ...n[n.length - 1][1].end
2160
- }
2161
- };
2162
- 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 = {
2163
- ...n[i][1].end
2164
- }) : n[e][1] = l, n.push(["exit", l, r]), n;
2165
- }
2166
- function kr(n, r, t) {
2167
- const e = this;
2168
- let u;
2169
- return i;
2170
- function i(h) {
2171
- let p = e.events.length, f;
2172
- for (; p--; )
2173
- if (e.events[p][1].type !== "lineEnding" && e.events[p][1].type !== "linePrefix" && e.events[p][1].type !== "content") {
2174
- f = e.events[p][1].type === "paragraph";
2175
- break;
2176
- }
2177
- return !e.parser.lazy[e.now().line] && (e.interrupt || f) ? (n.enter("setextHeadingLine"), u = h, l(h)) : t(h);
2178
- }
2179
- function l(h) {
2180
- return n.enter("setextHeadingLineSequence"), a(h);
2181
- }
2182
- function a(h) {
2183
- return h === u ? (n.consume(h), a) : (n.exit("setextHeadingLineSequence"), _(h) ? B(n, m, "lineSuffix")(h) : m(h));
2184
- }
2185
- function m(h) {
2186
- return h === null || E(h) ? (n.exit("setextHeadingLine"), r(h)) : t(h);
2187
- }
2188
- }
2189
- const Sr = {
2190
- tokenize: br
2191
- };
2192
- function br(n) {
2193
- const r = this, t = n.attempt(
2194
- // Try to parse a blank line.
2195
- kn,
2196
- e,
2197
- // Try to parse initial flow (essentially, only code).
2198
- n.attempt(this.parser.constructs.flowInitial, u, B(n, n.attempt(this.parser.constructs.flow, u, n.attempt(ze, u)), "linePrefix"))
2199
- );
2200
- return t;
2201
- function e(i) {
2202
- if (i === null) {
2203
- n.consume(i);
2204
- return;
2205
- }
2206
- return n.enter("lineEndingBlank"), n.consume(i), n.exit("lineEndingBlank"), r.currentConstruct = void 0, t;
2207
- }
2208
- function u(i) {
2209
- if (i === null) {
2210
- n.consume(i);
2211
- return;
2212
- }
2213
- return n.enter("lineEnding"), n.consume(i), n.exit("lineEnding"), r.currentConstruct = void 0, t;
2214
- }
2215
- }
2216
- const dr = {
2217
- resolveAll: rt()
2218
- }, Ir = et("string"), wr = et("text");
2219
- function et(n) {
2220
- return {
2221
- resolveAll: rt(n === "text" ? Cr : void 0),
2222
- tokenize: r
2223
- };
2224
- function r(t) {
2225
- const e = this, u = this.parser.constructs[n], i = t.attempt(u, l, a);
2226
- return l;
2227
- function l(p) {
2228
- return h(p) ? i(p) : a(p);
2229
- }
2230
- function a(p) {
2231
- if (p === null) {
2232
- t.consume(p);
2233
- return;
2234
- }
2235
- return t.enter("data"), t.consume(p), m;
2236
- }
2237
- function m(p) {
2238
- return h(p) ? (t.exit("data"), i(p)) : (t.consume(p), m);
2239
- }
2240
- function h(p) {
2241
- if (p === null)
2242
- return !0;
2243
- const f = u[p];
2244
- let g = -1;
2245
- if (f)
2246
- for (; ++g < f.length; ) {
2247
- const c = f[g];
2248
- if (!c.previous || c.previous.call(e, e.previous))
2249
- return !0;
2250
- }
2251
- return !1;
2252
- }
2253
- }
2254
- }
2255
- function rt(n) {
2256
- return r;
2257
- function r(t, e) {
2258
- let u = -1, i;
2259
- for (; ++u <= t.length; )
2260
- 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);
2261
- return n ? n(t, e) : t;
2262
- }
2263
- }
2264
- function Cr(n, r) {
2265
- let t = 0;
2266
- for (; ++t <= n.length; )
2267
- if ((t === n.length || n[t][1].type === "lineEnding") && n[t - 1][1].type === "data") {
2268
- const e = n[t - 1][1], u = r.sliceStream(e);
2269
- let i = u.length, l = -1, a = 0, m;
2270
- for (; i--; ) {
2271
- const h = u[i];
2272
- if (typeof h == "string") {
2273
- for (l = h.length; h.charCodeAt(l - 1) === 32; )
2274
- a++, l--;
2275
- if (l) break;
2276
- l = -1;
2277
- } else if (h === -2)
2278
- m = !0, a++;
2279
- else if (h !== -1) {
2280
- i++;
2281
- break;
2282
- }
2283
- }
2284
- if (r._contentTypeTextTrailing && t === n.length && (a = 0), a) {
2285
- const h = {
2286
- type: t === n.length || m || a < 2 ? "lineSuffix" : "hardBreakTrailing",
2287
- start: {
2288
- _bufferIndex: i ? l : e.start._bufferIndex + l,
2289
- _index: e.start._index + i,
2290
- line: e.end.line,
2291
- column: e.end.column - a,
2292
- offset: e.end.offset - a
2293
- },
2294
- end: {
2295
- ...e.end
2296
- }
2297
- };
2298
- e.end = {
2299
- ...h.start
2300
- }, e.start.offset === e.end.offset ? Object.assign(e, h) : (n.splice(t, 0, ["enter", h, r], ["exit", h, r]), t += 2);
2301
- }
2302
- t++;
2303
- }
2304
- return n;
2305
- }
2306
- const zr = {
2307
- 42: U,
2308
- 43: U,
2309
- 45: U,
2310
- 48: U,
2311
- 49: U,
2312
- 50: U,
2313
- 51: U,
2314
- 52: U,
2315
- 53: U,
2316
- 54: U,
2317
- 55: U,
2318
- 56: U,
2319
- 57: U,
2320
- 62: Gn
2321
- }, yr = {
2322
- 91: Ae
2323
- }, Er = {
2324
- [-2]: bn,
2325
- [-1]: bn,
2326
- 32: bn
2327
- }, Tr = {
2328
- 35: Me,
2329
- 42: xn,
2330
- 45: [jn, xn],
2331
- 60: Re,
2332
- 61: jn,
2333
- 95: xn,
2334
- 96: Wn,
2335
- 126: Wn
2336
- }, Fr = {
2337
- 38: Kn,
2338
- 92: Jn
2339
- }, Ar = {
2340
- [-5]: dn,
2341
- [-4]: dn,
2342
- [-3]: dn,
2343
- 33: rr,
2344
- 38: Kn,
2345
- 42: zn,
2346
- 60: [ue, $e],
2347
- 91: ur,
2348
- 92: [Be, Jn],
2349
- 93: En,
2350
- 95: zn,
2351
- 96: Se
2352
- }, _r = {
2353
- null: [zn, dr]
2354
- }, Lr = {
2355
- null: [42, 95]
2356
- }, Pr = {
2357
- null: []
2358
- }, Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2359
- __proto__: null,
2360
- attentionMarkers: Lr,
2361
- contentInitial: yr,
2362
- disable: Pr,
2363
- document: zr,
2364
- flow: Tr,
2365
- flowInitial: Er,
2366
- insideSpan: _r,
2367
- string: Fr,
2368
- text: Ar
2369
- }, Symbol.toStringTag, { value: "Module" }));
2370
- function Or(n, r, t) {
2371
- let e = {
2372
- _bufferIndex: -1,
2373
- _index: 0,
2374
- line: t && t.line || 1,
2375
- column: t && t.column || 1,
2376
- offset: t && t.offset || 0
2377
- };
2378
- const u = {}, i = [];
2379
- let l = [], a = [];
2380
- const m = {
2381
- attempt: L(T),
2382
- check: L(x),
2383
- consume: I,
2384
- enter: d,
2385
- exit: P,
2386
- interrupt: L(x, {
2387
- interrupt: !0
2388
- })
2389
- }, h = {
2390
- code: null,
2391
- containerState: {},
2392
- defineSkip: y,
2393
- events: [],
2394
- now: b,
2395
- parser: n,
2396
- previous: null,
2397
- sliceSerialize: g,
2398
- sliceStream: c,
2399
- write: f
2400
- };
2401
- let p = r.tokenize.call(h, m);
2402
- return r.resolveAll && i.push(r), h;
2403
- function f(z) {
2404
- return l = W(l, z), F(), l[l.length - 1] !== null ? [] : (D(r, 0), h.events = yn(i, h.events, h), h.events);
2405
- }
2406
- function g(z, C) {
2407
- return Dr(c(z), C);
2408
- }
2409
- function c(z) {
2410
- return Mr(l, z);
2411
- }
2412
- function b() {
2413
- const {
2414
- _bufferIndex: z,
2415
- _index: C,
2416
- line: O,
2417
- column: M,
2418
- offset: A
2419
- } = e;
2420
- return {
2421
- _bufferIndex: z,
2422
- _index: C,
2423
- line: O,
2424
- column: M,
2425
- offset: A
2426
- };
2427
- }
2428
- function y(z) {
2429
- u[z.line] = z.column, q();
2430
- }
2431
- function F() {
2432
- let z;
2433
- for (; e._index < l.length; ) {
2434
- const C = l[e._index];
2435
- if (typeof C == "string")
2436
- for (z = e._index, e._bufferIndex < 0 && (e._bufferIndex = 0); e._index === z && e._bufferIndex < C.length; )
2437
- S(C.charCodeAt(e._bufferIndex));
2438
- else
2439
- S(C);
2440
- }
2441
- }
2442
- function S(z) {
2443
- p = p(z);
2444
- }
2445
- function I(z) {
2446
- E(z) ? (e.line++, e.column = 1, e.offset += z === -3 ? 2 : 1, q()) : z !== -1 && (e.column++, e.offset++), e._bufferIndex < 0 ? e._index++ : (e._bufferIndex++, e._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
2447
- // strings.
2448
- /** @type {string} */
2449
- l[e._index].length && (e._bufferIndex = -1, e._index++)), h.previous = z;
2450
- }
2451
- function d(z, C) {
2452
- const O = C || {};
2453
- return O.type = z, O.start = b(), h.events.push(["enter", O, h]), a.push(O), O;
2454
- }
2455
- function P(z) {
2456
- const C = a.pop();
2457
- return C.end = b(), h.events.push(["exit", C, h]), C;
2458
- }
2459
- function T(z, C) {
2460
- D(z, C.from);
2461
- }
2462
- function x(z, C) {
2463
- C.restore();
2464
- }
2465
- function L(z, C) {
2466
- return O;
2467
- function O(M, A, V) {
2468
- let R, Y, tn, o;
2469
- return Array.isArray(M) ? (
2470
- /* c8 ignore next 1 */
2471
- en(M)
2472
- ) : "tokenize" in M ? (
2473
- // Looks like a construct.
2474
- en([
2475
- /** @type {Construct} */
2476
- M
2477
- ])
2478
- ) : Z(M);
2479
- function Z(H) {
2480
- return cn;
2481
- function cn(un) {
2482
- const on = un !== null && H[un], sn = un !== null && H.null, Sn = [
2483
- // To do: add more extension tests.
2484
- /* c8 ignore next 2 */
2485
- ...Array.isArray(on) ? on : on ? [on] : [],
2486
- ...Array.isArray(sn) ? sn : sn ? [sn] : []
2487
- ];
2488
- return en(Sn)(un);
2489
- }
2490
- }
2491
- function en(H) {
2492
- return R = H, Y = 0, H.length === 0 ? V : s(H[Y]);
2493
- }
2494
- function s(H) {
2495
- return cn;
2496
- function cn(un) {
2497
- return o = N(), tn = H, H.partial || (h.currentConstruct = H), H.name && h.parser.constructs.disable.null.includes(H.name) ? an() : H.tokenize.call(
2498
- // If we do have fields, create an object w/ `context` as its
2499
- // prototype.
2500
- // This allows a “live binding”, which is needed for `interrupt`.
2501
- C ? Object.assign(Object.create(h), C) : h,
2502
- m,
2503
- G,
2504
- an
2505
- )(un);
2506
- }
2507
- }
2508
- function G(H) {
2509
- return z(tn, o), A;
2510
- }
2511
- function an(H) {
2512
- return o.restore(), ++Y < R.length ? s(R[Y]) : V;
2513
- }
2514
- }
2515
- }
2516
- function D(z, C) {
2517
- z.resolveAll && !i.includes(z) && i.push(z), z.resolve && nn(h.events, C, h.events.length - C, z.resolve(h.events.slice(C), h)), z.resolveTo && (h.events = z.resolveTo(h.events, h));
2518
- }
2519
- function N() {
2520
- const z = b(), C = h.previous, O = h.currentConstruct, M = h.events.length, A = Array.from(a);
2521
- return {
2522
- from: M,
2523
- restore: V
2524
- };
2525
- function V() {
2526
- e = z, h.previous = C, h.currentConstruct = O, h.events.length = M, a = A, q();
2527
- }
2528
- }
2529
- function q() {
2530
- e.line in u && e.column < 2 && (e.column = u[e.line], e.offset += u[e.line] - 1);
2531
- }
2532
- }
2533
- function Mr(n, r) {
2534
- const t = r.start._index, e = r.start._bufferIndex, u = r.end._index, i = r.end._bufferIndex;
2535
- let l;
2536
- if (t === u)
2537
- l = [n[t].slice(e, i)];
2538
- else {
2539
- if (l = n.slice(t, u), e > -1) {
2540
- const a = l[0];
2541
- typeof a == "string" ? l[0] = a.slice(e) : l.shift();
2542
- }
2543
- i > 0 && l.push(n[u].slice(0, i));
2544
- }
2545
- return l;
2546
- }
2547
- function Dr(n, r) {
2548
- let t = -1;
2549
- const e = [];
2550
- let u;
2551
- for (; ++t < n.length; ) {
2552
- const i = n[t];
2553
- let l;
2554
- if (typeof i == "string")
2555
- l = i;
2556
- else switch (i) {
2557
- case -5: {
2558
- l = "\r";
2559
- break;
2560
- }
2561
- case -4: {
2562
- l = `
2563
- `;
2564
- break;
2565
- }
2566
- case -3: {
2567
- l = `\r
2568
- `;
2569
- break;
2570
- }
2571
- case -2: {
2572
- l = r ? " " : " ";
2573
- break;
2574
- }
2575
- case -1: {
2576
- if (!r && u) continue;
2577
- l = " ";
2578
- break;
2579
- }
2580
- default:
2581
- l = String.fromCharCode(i);
2582
- }
2583
- u = i === -2, e.push(l);
2584
- }
2585
- return e.join("");
2586
- }
2587
- function Nr(n) {
2588
- const e = {
2589
- constructs: (
2590
- /** @type {FullNormalizedExtension} */
2591
- Nt([Br, ...(n || {}).extensions || []])
2592
- ),
2593
- content: u(Xt),
2594
- defined: [],
2595
- document: u(ne),
2596
- flow: u(Sr),
2597
- lazy: {},
2598
- string: u(Ir),
2599
- text: u(wr)
2600
- };
2601
- return e;
2602
- function u(i) {
2603
- return l;
2604
- function l(a) {
2605
- return Or(e, i, a);
2606
- }
2607
- }
2608
- }
2609
- function qr(n) {
2610
- for (; !Xn(n); )
2611
- ;
2612
- return n;
2613
- }
2614
- const $n = /[\0\t\n\r]/g;
2615
- function Rr() {
2616
- let n = 1, r = "", t = !0, e;
2617
- return u;
2618
- function u(i, l, a) {
2619
- const m = [];
2620
- let h, p, f, g, c;
2621
- for (i = r + (typeof i == "string" ? i.toString() : new TextDecoder(l || void 0).decode(i)), f = 0, r = "", t && (i.charCodeAt(0) === 65279 && f++, t = void 0); f < i.length; ) {
2622
- if ($n.lastIndex = f, h = $n.exec(i), g = h && h.index !== void 0 ? h.index : i.length, c = i.charCodeAt(g), !h) {
2623
- r = i.slice(f);
2624
- break;
2625
- }
2626
- if (c === 10 && f === g && e)
2627
- m.push(-3), e = void 0;
2628
- else
2629
- switch (e && (m.push(-5), e = void 0), f < g && (m.push(i.slice(f, g)), n += g - f), c) {
2630
- case 0: {
2631
- m.push(65533), n++;
2632
- break;
2633
- }
2634
- case 9: {
2635
- for (p = Math.ceil(n / 4) * 4, m.push(-2); n++ < p; ) m.push(-1);
2636
- break;
2637
- }
2638
- case 10: {
2639
- m.push(-4), n = 1;
2640
- break;
2641
- }
2642
- default:
2643
- e = !0, n = 1;
2644
- }
2645
- f = g + 1;
2646
- }
2647
- return a && (e && m.push(-5), r && m.push(r), m.push(null)), m;
2648
- }
2649
- }
2650
- function Hr(n, r, t) {
2651
- return typeof r != "string" && (t = r, r = void 0), Kt(t)(qr(Nr(t).document().write(Rr()(n, r, !0))));
2652
- }
2653
- async function Vr(n = {}) {
2654
- const r = [], t = [];
2655
- if (n.gfm === !0) {
2656
- const e = await import("./index-1JaBwDB-.js");
2657
- r.push(e.gfm({})), t.push(e.gfmHtml({}));
2658
- }
2659
- return { extensions: r, htmlExtensions: t };
2660
- }
2661
- function Ur(n, ...r) {
2662
- const { content: t, allowHtml: e = !1, allowDangerousProtocol: u = !1 } = n, i = Lt(
2663
- t,
2664
- e,
2665
- u,
2666
- n.features
2667
- )(async (l = "", a = !1, m = !1, h = {}) => {
2668
- const { extensions: p, htmlExtensions: f } = await Vr(h);
2669
- return Hr(l, {
2670
- allowDangerousHtml: a,
2671
- allowDangerousProtocol: m,
2672
- extensions: p,
2673
- htmlExtensions: f
2674
- });
2675
- });
2676
- return Pt.div(
2677
- // Ensure styles are present declaratively via head portal
2678
- (n.cssInjection ?? "none") === "none" ? null : Bt(
2679
- () => import("./styles-url-CJYy5nML.js"),
2680
- ({ default: l }) => Dt({ id: "beatui-markdown-css", href: l })
2681
- ),
2682
- Mn.class("bc-markdown"),
2683
- Ot(
2684
- i,
2685
- (l) => Mt(l, (a) => Mn.innerHTML(a))
2686
- ),
2687
- ...r
2688
- );
2689
- }
2690
- export {
2691
- Ur as M,
2692
- $ as a,
2693
- v as b,
2694
- Yt as c,
2695
- wn as d,
2696
- kn as e,
2697
- B as f,
2698
- nn as g,
2699
- Hn as h,
2700
- E as i,
2701
- _ as j,
2702
- Nt as k,
2703
- Ht as l,
2704
- j as m,
2705
- mn as n,
2706
- yn as r,
2707
- gn as s,
2708
- Zt as u
2709
- };