@loopstack/loopstack-studio 0.25.0 → 0.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/components/ai-elements/message.js +2 -2
  2. package/dist/components/ai-elements/reasoning.js +9 -9
  3. package/dist/loopstack-studio.css +1 -1
  4. package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +2 -5
  5. package/dist/node_modules/@chevrotain/gast/lib/src/model.js +69 -72
  6. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-7HQA4BMR.js → architecture-YZFGNWBL.js} +2 -2
  7. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-TQ3KTPDO.js → chunk-2KRD3SAO.js} +1 -1
  8. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-4F5CHEZ2.js → chunk-67CJDMHE.js} +1 -1
  9. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-UMXZTB3W.js → chunk-7N4EOEYR.js} +5 -2
  10. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-PL6DKKU2.js → chunk-AA7GKIK3.js} +1 -1
  11. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +23 -0
  12. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-SJTYNZTY.js → chunk-FOC6F5B3.js} +1 -1
  13. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +1197 -0
  14. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FRFDVMJY.js → chunk-KGLVRYIC.js} +1 -1
  15. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-B2363JML.js → chunk-LIHQZDEY.js} +1 -1
  16. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +29 -0
  17. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-G5XIXVHT.js → gitGraph-7Q5UKJZL.js} +2 -2
  18. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +3 -0
  19. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +3 -0
  20. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +3 -0
  21. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +3 -0
  22. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-SZITEDCU.js +3 -0
  23. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +3 -0
  24. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +3 -0
  25. package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +27 -17
  26. package/dist/node_modules/@upsetjs/venn.js/build/venn.esm.js +903 -0
  27. package/dist/node_modules/@xyflow/react/dist/esm/index.js +76 -75
  28. package/dist/node_modules/@xyflow/system/dist/esm/index.js +30 -28
  29. package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +31 -40
  30. package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +23 -26
  31. package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +12 -13
  32. package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +181 -205
  33. package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +11 -13
  34. package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +12 -13
  35. package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +8 -9
  36. package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +176 -183
  37. package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +17 -19
  38. package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +153 -160
  39. package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +10 -12
  40. package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +36 -38
  41. package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +37 -45
  42. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +12 -14
  43. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +80 -86
  44. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +6 -2
  45. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +39 -41
  46. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +7 -8
  47. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +69 -70
  48. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +215 -205
  49. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +76 -76
  50. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +29 -39
  51. package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +252 -274
  52. package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +93 -106
  53. package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +61 -61
  54. package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +31 -41
  55. package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +15 -18
  56. package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +226 -226
  57. package/dist/node_modules/chevrotain-allstar/lib/atn.js +17 -17
  58. package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +17 -14
  59. package/dist/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +19 -19
  60. package/dist/node_modules/dagre-d3-es/src/dagre/layout.js +48 -48
  61. package/dist/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +9 -9
  62. package/dist/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +3 -3
  63. package/dist/node_modules/dagre-d3-es/src/dagre/order/index.js +11 -11
  64. package/dist/node_modules/dagre-d3-es/src/dagre/order/init-order.js +4 -4
  65. package/dist/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +4 -4
  66. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +8 -8
  67. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort.js +5 -5
  68. package/dist/node_modules/dagre-d3-es/src/dagre/position/bk.js +61 -61
  69. package/dist/node_modules/dagre-d3-es/src/dagre/position/index.js +1 -1
  70. package/dist/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +25 -25
  71. package/dist/node_modules/dagre-d3-es/src/dagre/rank/util.js +8 -8
  72. package/dist/node_modules/dagre-d3-es/src/dagre/util.js +48 -48
  73. package/dist/node_modules/dagre-d3-es/src/graphlib/graph.js +109 -109
  74. package/dist/node_modules/dagre-d3-es/src/graphlib/json.js +17 -17
  75. package/dist/node_modules/dompurify/dist/purify.es.js +67 -67
  76. package/dist/node_modules/katex/dist/katex.js +1256 -1209
  77. package/dist/node_modules/khroma/dist/methods/transparentize.js +3 -0
  78. package/dist/node_modules/lodash-es/_baseClone.js +2 -2
  79. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
  80. package/dist/node_modules/lodash-es/_baseToString.js +1 -1
  81. package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
  82. package/dist/node_modules/lodash-es/_createSet.js +1 -1
  83. package/dist/node_modules/lodash-es/_getAllKeys.js +2 -2
  84. package/dist/node_modules/lodash-es/_getAllKeysIn.js +1 -1
  85. package/dist/node_modules/lodash-es/findIndex.js +2 -2
  86. package/dist/node_modules/lodash-es/flatMap.js +1 -1
  87. package/dist/node_modules/lodash-es/forEach.js +1 -1
  88. package/dist/node_modules/lodash-es/max.js +1 -1
  89. package/dist/node_modules/lodash-es/min.js +1 -1
  90. package/dist/node_modules/lodash-es/minBy.js +1 -1
  91. package/dist/node_modules/lodash-es/reduce.js +1 -1
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-Q4EWVU46.js +691 -0
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-VD42YOAC.js → blockDiagram-DXYQGD6D.js} +183 -157
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-YG6GDRKO.js → c4Diagram-AHTNJAMY.js} +65 -63
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-336JU56O.js +47 -0
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EXTU4WIE.js → chunk-426QAEUC.js} +1 -1
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-B4BG7PRW.js → chunk-4TB4RGXK.js} +533 -393
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5FUZZQ4R.js +3638 -0
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-S3R3BYOJ.js → chunk-5PVQY5BW.js} +1 -1
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-HN2XXSSU.js → chunk-BSJP7CBP.js} +20 -14
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-QN33PNHL.js → chunk-EDXVE4YY.js} +1 -1
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ENJZ2VHE.js +568 -0
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICPOFSXX.js +2320 -0
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-DI55MBZ5.js → chunk-OYMX7WX6.js} +35 -21
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U2HBQHQK.js +272 -0
  106. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ATLVNIR6.js → chunk-X2U36JSP.js} +1 -1
  107. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-MI3HLSF2.js → chunk-XPW4576I.js} +11 -7
  108. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-YZCP3GAM.js +60 -0
  109. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZZ45TVLE.js +30 -0
  110. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-2ON5EDUG.js → classDiagram-6PBFFD2Q.js} +12 -11
  111. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-WZHVMYZB.js → classDiagram-v2-HSJHXN6E.js} +12 -11
  112. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-6UL2VRFP.js → dagre-KV5264BT.js} +8 -8
  113. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-5BDNPKRD.js +99 -0
  114. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-PSM6KHXK.js → diagram-G4DWMVQ6.js} +20 -23
  115. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-MMDJMWI5.js +211 -0
  116. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-S2PKOQOG.js → diagram-TYMM5635.js} +4 -4
  117. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-Q2GNP2WA.js → erDiagram-SMLLAGMA.js} +486 -386
  118. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-NV44I4VS.js → flowDiagram-DWJPFMVM.js} +915 -898
  119. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-JELNMOA3.js → ganttDiagram-T4ZO3ILL.js} +59 -29
  120. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-UUTBAWPF.js +728 -0
  121. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-42DDH7IO.js +17 -0
  122. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-UXIWVN3A.js +714 -0
  123. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-XKPGCS4Q.js → journeyDiagram-VCZTEJTY.js} +32 -32
  124. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-3W4ZIXB7.js → kanban-definition-6JOO6SKY.js} +13 -9
  125. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-VGOIOE7T.js → mindmap-definition-QFDTVHPH.js} +105 -59
  126. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-DEJITSTG.js +117 -0
  127. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-AYHSOK5B.js → quadrantDiagram-34T5L4WZ.js} +1 -1
  128. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-UZGBJVZJ.js → requirementDiagram-MS252O5E.js} +49 -19
  129. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-TZEHDZUN.js → sankeyDiagram-XADWPNL6.js} +1 -1
  130. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-FGHM5R23.js +4155 -0
  131. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FKZM4ZOC.js → stateDiagram-FHFEXIEX.js} +12 -12
  132. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-4FDKWEC3.js → stateDiagram-v2-QKLJ7IA2.js} +11 -11
  133. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-GMOUNBTQ.js +1071 -0
  134. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-DHZGUBPP.js +959 -0
  135. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +574 -0
  136. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-PRI3JC2R.js → xychartDiagram-5P7HB3ND.js} +38 -35
  137. package/dist/node_modules/mermaid/dist/mermaid.core.js +235 -192
  138. package/dist/node_modules/nanoid/url-alphabet/index.js +1 -1
  139. package/dist/node_modules/remend/dist/index.js +333 -264
  140. package/dist/node_modules/streamdown/dist/chunk-BO2N2NFS.js +2498 -0
  141. package/dist/node_modules/streamdown/dist/highlighted-body-OFNGDK62.js +35 -0
  142. package/dist/node_modules/streamdown/dist/index.js +1 -1
  143. package/dist/node_modules/streamdown/dist/mermaid-GHXKKRXX.js +3 -0
  144. package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +672 -667
  145. package/dist/pages/DashboardPage.js +3 -3
  146. package/package.json +2 -2
  147. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-TCCFYFTB.js +0 -787
  148. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-VBDWY6EO.js +0 -3
  149. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-DYOGHKS2.js +0 -3
  150. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-VRWISCQL.js +0 -3
  151. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-ZZBFDIW7.js +0 -3
  152. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-GDKQZRPO.js +0 -3
  153. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js +0 -16
  154. package/dist/node_modules/lodash-es/_arrayAggregator.js +0 -9
  155. package/dist/node_modules/lodash-es/_arrayEvery.js +0 -6
  156. package/dist/node_modules/lodash-es/_baseAggregator.js +0 -8
  157. package/dist/node_modules/lodash-es/_baseDifference.js +0 -22
  158. package/dist/node_modules/lodash-es/_baseEvery.js +0 -9
  159. package/dist/node_modules/lodash-es/_baseIsRegExp.js +0 -8
  160. package/dist/node_modules/lodash-es/_baseSlice.js +0 -8
  161. package/dist/node_modules/lodash-es/_baseSome.js +0 -9
  162. package/dist/node_modules/lodash-es/_createAggregator.js +0 -12
  163. package/dist/node_modules/lodash-es/assign.js +0 -14
  164. package/dist/node_modules/lodash-es/compact.js +0 -9
  165. package/dist/node_modules/lodash-es/difference.js +0 -8
  166. package/dist/node_modules/lodash-es/drop.js +0 -8
  167. package/dist/node_modules/lodash-es/dropRight.js +0 -8
  168. package/dist/node_modules/lodash-es/every.js +0 -11
  169. package/dist/node_modules/lodash-es/groupBy.js +0 -6
  170. package/dist/node_modules/lodash-es/head.js +0 -5
  171. package/dist/node_modules/lodash-es/includes.js +0 -13
  172. package/dist/node_modules/lodash-es/indexOf.js +0 -11
  173. package/dist/node_modules/lodash-es/isRegExp.js +0 -5
  174. package/dist/node_modules/lodash-es/negate.js +0 -16
  175. package/dist/node_modules/lodash-es/pickBy.js +0 -15
  176. package/dist/node_modules/lodash-es/reject.js +0 -10
  177. package/dist/node_modules/lodash-es/some.js +0 -11
  178. package/dist/node_modules/lodash-es/uniq.js +0 -6
  179. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-VXUJARFQ.js +0 -673
  180. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.js +0 -1547
  181. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-CVBHYZKI.js +0 -10
  182. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DR5Q36YT.js +0 -135
  183. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.js +0 -247
  184. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JZLCHNYA.js +0 -3516
  185. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-N4CR4FBY.js +0 -39
  186. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QXUST7PY.js +0 -497
  187. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.js +0 -55
  188. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-QEK2KX5R.js +0 -211
  189. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-V2S2FVAM.js +0 -621
  190. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-HS3SLOUP.js +0 -18
  191. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.js +0 -117
  192. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.js +0 -3560
  193. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-IT6M3QCI.js +0 -833
  194. package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +0 -2189
  195. package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +0 -33
  196. package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +0 -3
@@ -12,22 +12,22 @@ function M() {
12
12
  walkTokens: null
13
13
  };
14
14
  }
15
- var T = M();
16
- function H(e) {
17
- T = e;
15
+ var O = M();
16
+ function G(e) {
17
+ O = e;
18
18
  }
19
19
  var _ = { exec: () => null };
20
- function k(e, c = "") {
21
- let l = typeof e == "string" ? e : e.source, u = {
22
- replace: (e, c) => {
23
- let d = typeof c == "string" ? c : c.source;
24
- return d = d.replace(m.caret, "$1"), l = l.replace(e, d), u;
20
+ function k(e, s = "") {
21
+ let c = typeof e == "string" ? e : e.source, l = {
22
+ replace: (e, s) => {
23
+ let u = typeof s == "string" ? s : s.source;
24
+ return u = u.replace(m.caret, "$1"), c = c.replace(e, u), l;
25
25
  },
26
- getRegex: () => new RegExp(l, c)
26
+ getRegex: () => new RegExp(c, s)
27
27
  };
28
- return u;
28
+ return l;
29
29
  }
30
- var Re = (() => {
30
+ var be = (() => {
31
31
  try {
32
32
  return !0;
33
33
  } catch {
@@ -74,7 +74,6 @@ var Re = (() => {
74
74
  escapeReplace: /[&<>"']/g,
75
75
  escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
76
76
  escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
77
- unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
78
77
  caret: /(^|[^\[])\^/g,
79
78
  percentDecode: /%25/g,
80
79
  findPipe: /\|/g,
@@ -91,96 +90,96 @@ var Re = (() => {
91
90
  headingBeginRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
92
91
  htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i"),
93
92
  blockquoteBeginRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}>`)
94
- }, Te = /^(?:[ \t]*(?:\n|$))+/, Oe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, we = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, N = / {0,3}(?:[*+-]|\d{1,9}[.)])/, re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, se = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Pe = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Se = /^[^\n]+/, F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, $e = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), _e = k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex(), q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Le = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", j).replace("tag", q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ie = k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), U = {
95
- blockquote: k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex(),
93
+ }, Re = /^(?:[ \t]*(?:\n|$))+/, Oe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, C = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Q = / {0,3}(?:[*+-]|\d{1,9}[.)])/, se = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ie = k(se).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ye = k(se).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Pe = /^[^\n]+/, F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Se = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), $e = k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex(), v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _e = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), oe = k(j).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), K = {
94
+ blockquote: k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex(),
96
95
  code: Oe,
97
- def: $e,
98
- fences: we,
99
- heading: ye,
100
- hr: I,
101
- html: Le,
102
- lheading: se,
103
- list: _e,
104
- newline: Te,
105
- paragraph: ie,
96
+ def: Se,
97
+ fences: Te,
98
+ heading: we,
99
+ hr: C,
100
+ html: _e,
101
+ lheading: ie,
102
+ list: $e,
103
+ newline: Re,
104
+ paragraph: oe,
106
105
  table: _,
107
- text: Se
108
- }, te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), ze = {
109
- ...U,
110
- lheading: Pe,
111
- table: te,
112
- paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex()
113
- }, Ce = {
114
- ...U,
115
- html: k("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", j).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
106
+ text: Pe
107
+ }, ne = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Me = {
108
+ ...K,
109
+ lheading: ye,
110
+ table: ne,
111
+ paragraph: k(j).replace("hr", C).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ne).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex()
112
+ }, ze = {
113
+ ...K,
114
+ html: k("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
116
115
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
117
116
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
118
117
  fences: _,
119
118
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
120
- paragraph: k(Q).replace("hr", I).replace("heading", " *#{1,6} *[^\n]").replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
121
- }, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ie = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, oe = /^( {2,}|\\)\n(?!\s*$)/, Ee = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, v = /[\p{P}\p{S}]/u, K = /[\s\p{P}\p{S}]/u, ae = /[^\s\p{P}\p{S}]/u, Be = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex(), le = /(?!~)[\p{P}\p{S}]/u, De = /(?!~)[\s\p{P}\p{S}]/u, qe = /(?:[^\s\p{P}\p{S}]|~)/u, ue = /(?![*_])[\p{P}\p{S}]/u, ve = /(?![*_])[\s\p{P}\p{S}]/u, Ge = /(?:[^\s\p{P}\p{S}]|[*_])/u, He = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Re ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ze = k(pe, "u").replace(/punct/g, v).getRegex(), Ne = k(pe, "u").replace(/punct/g, le).getRegex(), ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Qe = k(ce, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, v).getRegex(), Fe = k(ce, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, De).replace(/punct/g, le).getRegex(), je = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, v).getRegex(), Ue = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, ue).getRegex(), We = k("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, ve).replace(/punct/g, ue).getRegex(), Xe = k(/\\(punct)/, "gu").replace(/punct/g, v).getRegex(), Je = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ve = k(j).replace("(?:-->|$)", "-->").getRegex(), Ye = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ve).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), D = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, et = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", D).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), he = k(/^!?\[(label)\]\[(ref)\]/).replace("label", D).replace("ref", F).getRegex(), ke = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex(), tt = k("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", ke).getRegex(), ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, W = {
119
+ paragraph: k(j).replace("hr", C).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
120
+ }, Ee = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ie = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ae = /^( {2,}|\\)\n(?!\s*$)/, Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, z = /[\p{P}\p{S}]/u, H = /[\s\p{P}\p{S}]/u, W = /[^\s\p{P}\p{S}]/u, Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, H).getRegex(), le = /(?!~)[\p{P}\p{S}]/u, Be = /(?!~)[\s\p{P}\p{S}]/u, De = /(?:[^\s\p{P}\p{S}]|~)/u, qe = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ue = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ve = k(ue, "u").replace(/punct/g, z).getRegex(), He = k(ue, "u").replace(/punct/g, le).getRegex(), pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ze = k(pe, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H).replace(/punct/g, z).getRegex(), Ge = k(pe, "gu").replace(/notPunctSpace/g, De).replace(/punctSpace/g, Be).replace(/punct/g, le).getRegex(), Ne = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H).replace(/punct/g, z).getRegex(), Qe = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, z).getRegex(), Fe = k("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H).replace(/punct/g, z).getRegex(), Ue = k(/\\(punct)/, "gu").replace(/punct/g, z).getRegex(), Ke = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), We = k(U).replace("(?:-->|$)", "-->").getRegex(), Xe = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", We).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex(), he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex(), Ve = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex(), re = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, X = {
122
121
  _backpedal: _,
123
- anyPunctuation: Xe,
124
- autolink: Je,
125
- blockSkip: He,
126
- br: oe,
122
+ anyPunctuation: Ue,
123
+ autolink: Ke,
124
+ blockSkip: qe,
125
+ br: ae,
127
126
  code: Ie,
128
127
  del: _,
129
128
  delLDelim: _,
130
129
  delRDelim: _,
131
- emStrongLDelim: Ze,
132
- emStrongRDelimAst: Qe,
133
- emStrongRDelimUnd: je,
134
- escape: Ae,
135
- link: et,
136
- nolink: ke,
137
- punctuation: Be,
138
- reflink: he,
139
- reflinkSearch: tt,
140
- tag: Ye,
141
- text: Ee,
130
+ emStrongLDelim: ve,
131
+ emStrongRDelimAst: Ze,
132
+ emStrongRDelimUnd: Ne,
133
+ escape: Ee,
134
+ link: Je,
135
+ nolink: he,
136
+ punctuation: Ce,
137
+ reflink: ce,
138
+ reflinkSearch: Ve,
139
+ tag: Xe,
140
+ text: Ae,
142
141
  url: _
143
- }, nt = {
144
- ...W,
145
- link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", D).getRegex(),
146
- reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", D).getRegex()
147
- }, Z = {
148
- ...W,
149
- emStrongRDelimAst: Fe,
150
- emStrongLDelim: Ne,
151
- delLDelim: Ue,
152
- delRDelim: We,
153
- url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
142
+ }, Ye = {
143
+ ...X,
144
+ link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(),
145
+ reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex()
146
+ }, N = {
147
+ ...X,
148
+ emStrongRDelimAst: Ge,
149
+ emStrongLDelim: He,
150
+ delLDelim: Qe,
151
+ delRDelim: Fe,
152
+ url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", re).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
154
153
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
155
154
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
156
- text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex()
157
- }, rt = {
158
- ...Z,
159
- br: k(oe).replace("{2,}", "*").getRegex(),
160
- text: k(Z.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
155
+ text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", re).getRegex()
156
+ }, et = {
157
+ ...N,
158
+ br: k(ae).replace("{2,}", "*").getRegex(),
159
+ text: k(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
160
+ }, B = {
161
+ normal: K,
162
+ gfm: Me,
163
+ pedantic: ze
161
164
  }, E = {
162
- normal: U,
163
- gfm: ze,
164
- pedantic: Ce
165
- }, z = {
166
- normal: W,
167
- gfm: Z,
168
- breaks: rt,
169
- pedantic: nt
170
- }, st = {
165
+ normal: X,
166
+ gfm: N,
167
+ breaks: et,
168
+ pedantic: Ye
169
+ }, tt = {
171
170
  "&": "&amp;",
172
171
  "<": "&lt;",
173
172
  ">": "&gt;",
174
173
  "\"": "&quot;",
175
174
  "'": "&#39;"
176
- }, de = (e) => st[e];
177
- function O(e, c) {
178
- if (c) {
179
- if (m.escapeTest.test(e)) return e.replace(m.escapeReplace, de);
180
- } else if (m.escapeTestNoEncode.test(e)) return e.replace(m.escapeReplaceNoEncode, de);
175
+ }, ke = (e) => tt[e];
176
+ function T(e, s) {
177
+ if (s) {
178
+ if (m.escapeTest.test(e)) return e.replace(m.escapeReplace, ke);
179
+ } else if (m.escapeTestNoEncode.test(e)) return e.replace(m.escapeReplaceNoEncode, ke);
181
180
  return e;
182
181
  }
183
- function X(e) {
182
+ function J(e) {
184
183
  try {
185
184
  e = encodeURI(e).replace(m.percentDecode, "%");
186
185
  } catch {
@@ -188,67 +187,67 @@ function X(e) {
188
187
  }
189
188
  return e;
190
189
  }
191
- function J(e, c) {
192
- let l = e.replace(m.findPipe, (e, c, l) => {
193
- let u = !1, d = c;
194
- for (; --d >= 0 && l[d] === "\\";) u = !u;
195
- return u ? "|" : " |";
196
- }).split(m.splitPipe), u = 0;
197
- if (l[0].trim() || l.shift(), l.length > 0 && !l.at(-1)?.trim() && l.pop(), c) if (l.length > c) l.splice(c);
198
- else for (; l.length < c;) l.push("");
199
- for (; u < l.length; u++) l[u] = l[u].trim().replace(m.slashPipe, "|");
200
- return l;
190
+ function V(e, s) {
191
+ let c = e.replace(m.findPipe, (e, s, c) => {
192
+ let l = !1, u = s;
193
+ for (; --u >= 0 && c[u] === "\\";) l = !l;
194
+ return l ? "|" : " |";
195
+ }).split(m.splitPipe), l = 0;
196
+ if (c[0].trim() || c.shift(), c.length > 0 && !c.at(-1)?.trim() && c.pop(), s) if (c.length > s) c.splice(s);
197
+ else for (; c.length < s;) c.push("");
198
+ for (; l < c.length; l++) c[l] = c[l].trim().replace(m.slashPipe, "|");
199
+ return c;
201
200
  }
202
- function C(e, c, l) {
203
- let u = e.length;
204
- if (u === 0) return "";
205
- let d = 0;
206
- for (; d < u;) {
207
- let f = e.charAt(u - d - 1);
208
- if (f === c && !l) d++;
209
- else if (f !== c && l) d++;
201
+ function I(e, s, c) {
202
+ let l = e.length;
203
+ if (l === 0) return "";
204
+ let u = 0;
205
+ for (; u < l;) {
206
+ let d = e.charAt(l - u - 1);
207
+ if (d === s && !c) u++;
208
+ else if (d !== s && c) u++;
210
209
  else break;
211
210
  }
212
- return e.slice(0, u - d);
211
+ return e.slice(0, l - u);
213
212
  }
214
- function ge(e, c) {
215
- if (e.indexOf(c[1]) === -1) return -1;
216
- let l = 0;
217
- for (let u = 0; u < e.length; u++) if (e[u] === "\\") u++;
218
- else if (e[u] === c[0]) l++;
219
- else if (e[u] === c[1] && (l--, l < 0)) return u;
220
- return l > 0 ? -2 : -1;
213
+ function de(e, s) {
214
+ if (e.indexOf(s[1]) === -1) return -1;
215
+ let c = 0;
216
+ for (let l = 0; l < e.length; l++) if (e[l] === "\\") l++;
217
+ else if (e[l] === s[0]) c++;
218
+ else if (e[l] === s[1] && (c--, c < 0)) return l;
219
+ return c > 0 ? -2 : -1;
221
220
  }
222
- function fe(e, c = 0) {
223
- let l = c, u = "";
224
- for (let c of e) if (c === " ") {
225
- let e = 4 - l % 4;
226
- u += " ".repeat(e), l += e;
227
- } else u += c, l++;
228
- return u;
221
+ function ge(e, s = 0) {
222
+ let c = s, l = "";
223
+ for (let s of e) if (s === " ") {
224
+ let e = 4 - c % 4;
225
+ l += " ".repeat(e), c += e;
226
+ } else l += s, c++;
227
+ return l;
229
228
  }
230
- function me(e, c, l, u, d) {
231
- let f = c.href, p = c.title || null, h = e[1].replace(d.other.outputLinkReplace, "$1");
232
- u.state.inLink = !0;
233
- let S = {
229
+ function fe(e, s, c, l, u) {
230
+ let d = s.href, f = s.title || null, p = e[1].replace(u.other.outputLinkReplace, "$1");
231
+ l.state.inLink = !0;
232
+ let h = {
234
233
  type: e[0].charAt(0) === "!" ? "image" : "link",
235
- raw: l,
236
- href: f,
237
- title: p,
238
- text: h,
239
- tokens: u.inlineTokens(h)
234
+ raw: c,
235
+ href: d,
236
+ title: f,
237
+ text: p,
238
+ tokens: l.inlineTokens(p)
240
239
  };
241
- return u.state.inLink = !1, S;
240
+ return l.state.inLink = !1, h;
242
241
  }
243
- function it(e, c, l) {
244
- let u = e.match(l.other.indentCodeCompensation);
245
- if (u === null) return c;
246
- let d = u[1];
247
- return c.split("\n").map((e) => {
248
- let c = e.match(l.other.beginningSpace);
249
- if (c === null) return e;
250
- let [u] = c;
251
- return u.length >= d.length ? e.slice(d.length) : e;
242
+ function nt(e, s, c) {
243
+ let l = e.match(c.other.indentCodeCompensation);
244
+ if (l === null) return s;
245
+ let u = l[1];
246
+ return s.split("\n").map((e) => {
247
+ let s = e.match(c.other.beginningSpace);
248
+ if (s === null) return e;
249
+ let [l] = s;
250
+ return l.length >= u.length ? e.slice(u.length) : e;
252
251
  }).join("\n");
253
252
  }
254
253
  var w = class {
@@ -256,144 +255,144 @@ var w = class {
256
255
  rules;
257
256
  lexer;
258
257
  constructor(e) {
259
- this.options = e || T;
258
+ this.options = e || O;
260
259
  }
261
260
  space(e) {
262
- let c = this.rules.block.newline.exec(e);
263
- if (c && c[0].length > 0) return {
261
+ let s = this.rules.block.newline.exec(e);
262
+ if (s && s[0].length > 0) return {
264
263
  type: "space",
265
- raw: c[0]
264
+ raw: s[0]
266
265
  };
267
266
  }
268
267
  code(e) {
269
- let c = this.rules.block.code.exec(e);
270
- if (c) {
271
- let e = c[0].replace(this.rules.other.codeRemoveIndent, "");
268
+ let s = this.rules.block.code.exec(e);
269
+ if (s) {
270
+ let e = s[0].replace(this.rules.other.codeRemoveIndent, "");
272
271
  return {
273
272
  type: "code",
274
- raw: c[0],
273
+ raw: s[0],
275
274
  codeBlockStyle: "indented",
276
- text: this.options.pedantic ? e : C(e, "\n")
275
+ text: this.options.pedantic ? e : I(e, "\n")
277
276
  };
278
277
  }
279
278
  }
280
279
  fences(e) {
281
- let c = this.rules.block.fences.exec(e);
282
- if (c) {
283
- let e = c[0], l = it(e, c[3] || "", this.rules);
280
+ let s = this.rules.block.fences.exec(e);
281
+ if (s) {
282
+ let e = s[0], c = nt(e, s[3] || "", this.rules);
284
283
  return {
285
284
  type: "code",
286
285
  raw: e,
287
- lang: c[2] ? c[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : c[2],
288
- text: l
286
+ lang: s[2] ? s[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : s[2],
287
+ text: c
289
288
  };
290
289
  }
291
290
  }
292
291
  heading(e) {
293
- let c = this.rules.block.heading.exec(e);
294
- if (c) {
295
- let e = c[2].trim();
292
+ let s = this.rules.block.heading.exec(e);
293
+ if (s) {
294
+ let e = s[2].trim();
296
295
  if (this.rules.other.endingHash.test(e)) {
297
- let c = C(e, "#");
298
- (this.options.pedantic || !c || this.rules.other.endingSpaceChar.test(c)) && (e = c.trim());
296
+ let s = I(e, "#");
297
+ (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (e = s.trim());
299
298
  }
300
299
  return {
301
300
  type: "heading",
302
- raw: c[0],
303
- depth: c[1].length,
301
+ raw: s[0],
302
+ depth: s[1].length,
304
303
  text: e,
305
304
  tokens: this.lexer.inline(e)
306
305
  };
307
306
  }
308
307
  }
309
308
  hr(e) {
310
- let c = this.rules.block.hr.exec(e);
311
- if (c) return {
309
+ let s = this.rules.block.hr.exec(e);
310
+ if (s) return {
312
311
  type: "hr",
313
- raw: C(c[0], "\n")
312
+ raw: I(s[0], "\n")
314
313
  };
315
314
  }
316
315
  blockquote(e) {
317
- let c = this.rules.block.blockquote.exec(e);
318
- if (c) {
319
- let e = C(c[0], "\n").split("\n"), l = "", u = "", d = [];
316
+ let s = this.rules.block.blockquote.exec(e);
317
+ if (s) {
318
+ let e = I(s[0], "\n").split("\n"), c = "", l = "", u = [];
320
319
  for (; e.length > 0;) {
321
- let c = !1, f = [], p;
322
- for (p = 0; p < e.length; p++) if (this.rules.other.blockquoteStart.test(e[p])) f.push(e[p]), c = !0;
323
- else if (!c) f.push(e[p]);
320
+ let s = !1, d = [], f;
321
+ for (f = 0; f < e.length; f++) if (this.rules.other.blockquoteStart.test(e[f])) d.push(e[f]), s = !0;
322
+ else if (!s) d.push(e[f]);
324
323
  else break;
325
- e = e.slice(p);
326
- let h = f.join("\n"), S = h.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
327
- l = l ? `${l}
328
- ${h}` : h, u = u ? `${u}
329
- ${S}` : S;
330
- let A = this.lexer.state.top;
331
- if (this.lexer.state.top = !0, this.lexer.blockTokens(S, d, !0), this.lexer.state.top = A, e.length === 0) break;
332
- let R = d.at(-1);
333
- if (R?.type === "code") break;
334
- if (R?.type === "blockquote") {
335
- let c = R, f = c.raw + "\n" + e.join("\n"), p = this.blockquote(f);
336
- d[d.length - 1] = p, l = l.substring(0, l.length - c.raw.length) + p.raw, u = u.substring(0, u.length - c.text.length) + p.text;
324
+ e = e.slice(f);
325
+ let p = d.join("\n"), h = p.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
326
+ c = c ? `${c}
327
+ ${p}` : p, l = l ? `${l}
328
+ ${h}` : h;
329
+ let S = this.lexer.state.top;
330
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(h, u, !0), this.lexer.state.top = S, e.length === 0) break;
331
+ let D = u.at(-1);
332
+ if (D?.type === "code") break;
333
+ if (D?.type === "blockquote") {
334
+ let s = D, d = s.raw + "\n" + e.join("\n"), f = this.blockquote(d);
335
+ u[u.length - 1] = f, c = c.substring(0, c.length - s.raw.length) + f.raw, l = l.substring(0, l.length - s.text.length) + f.text;
337
336
  break;
338
- } else if (R?.type === "list") {
339
- let c = R, f = c.raw + "\n" + e.join("\n"), p = this.list(f);
340
- d[d.length - 1] = p, l = l.substring(0, l.length - R.raw.length) + p.raw, u = u.substring(0, u.length - c.raw.length) + p.raw, e = f.substring(d.at(-1).raw.length).split("\n");
337
+ } else if (D?.type === "list") {
338
+ let s = D, d = s.raw + "\n" + e.join("\n"), f = this.list(d);
339
+ u[u.length - 1] = f, c = c.substring(0, c.length - D.raw.length) + f.raw, l = l.substring(0, l.length - s.raw.length) + f.raw, e = d.substring(u.at(-1).raw.length).split("\n");
341
340
  continue;
342
341
  }
343
342
  }
344
343
  return {
345
344
  type: "blockquote",
346
- raw: l,
347
- tokens: d,
348
- text: u
345
+ raw: c,
346
+ tokens: u,
347
+ text: l
349
348
  };
350
349
  }
351
350
  }
352
351
  list(e) {
353
- let c = this.rules.block.list.exec(e);
354
- if (c) {
355
- let l = c[1].trim(), u = l.length > 1, d = {
352
+ let s = this.rules.block.list.exec(e);
353
+ if (s) {
354
+ let c = s[1].trim(), l = c.length > 1, u = {
356
355
  type: "list",
357
356
  raw: "",
358
- ordered: u,
359
- start: u ? +l.slice(0, -1) : "",
357
+ ordered: l,
358
+ start: l ? +c.slice(0, -1) : "",
360
359
  loose: !1,
361
360
  items: []
362
361
  };
363
- l = u ? `\\d{1,9}\\${l.slice(-1)}` : `\\${l}`, this.options.pedantic && (l = u ? l : "[*+-]");
364
- let f = this.rules.other.listItemRegex(l), p = !1;
362
+ c = l ? `\\d{1,9}\\${c.slice(-1)}` : `\\${c}`, this.options.pedantic && (c = l ? c : "[*+-]");
363
+ let d = this.rules.other.listItemRegex(c), f = !1;
365
364
  for (; e;) {
366
- let l = !1, u = "", h = "";
367
- if (!(c = f.exec(e)) || this.rules.block.hr.test(e)) break;
368
- u = c[0], e = e.substring(u.length);
369
- let S = fe(c[2].split("\n", 1)[0], c[1].length), A = e.split("\n", 1)[0], R = !S.trim(), B = 0;
370
- if (this.options.pedantic ? (B = 2, h = S.trimStart()) : R ? B = c[1].length + 1 : (B = S.search(this.rules.other.nonSpaceChar), B = B > 4 ? 1 : B, h = S.slice(B), B += c[1].length), R && this.rules.other.blankLine.test(A) && (u += A + "\n", e = e.substring(A.length + 1), l = !0), !l) {
371
- let c = this.rules.other.nextBulletRegex(B), l = this.rules.other.hrRegex(B), d = this.rules.other.fencesBeginRegex(B), f = this.rules.other.headingBeginRegex(B), p = this.rules.other.htmlBeginRegex(B), V = this.rules.other.blockquoteBeginRegex(B);
365
+ let c = !1, l = "", p = "";
366
+ if (!(s = d.exec(e)) || this.rules.block.hr.test(e)) break;
367
+ l = s[0], e = e.substring(l.length);
368
+ let h = ge(s[2].split("\n", 1)[0], s[1].length), S = e.split("\n", 1)[0], D = !h.trim(), A = 0;
369
+ if (this.options.pedantic ? (A = 2, p = h.trimStart()) : D ? A = s[1].length + 1 : (A = h.search(this.rules.other.nonSpaceChar), A = A > 4 ? 1 : A, p = h.slice(A), A += s[1].length), D && this.rules.other.blankLine.test(S) && (l += S + "\n", e = e.substring(S.length + 1), c = !0), !c) {
370
+ let s = this.rules.other.nextBulletRegex(A), c = this.rules.other.hrRegex(A), u = this.rules.other.fencesBeginRegex(A), d = this.rules.other.headingBeginRegex(A), f = this.rules.other.htmlBeginRegex(A), R = this.rules.other.blockquoteBeginRegex(A);
372
371
  for (; e;) {
373
- let G = e.split("\n", 1)[0], Y;
374
- if (A = G, this.options.pedantic ? (A = A.replace(this.rules.other.listReplaceNesting, " "), Y = A) : Y = A.replace(this.rules.other.tabCharGlobal, " "), d.test(A) || f.test(A) || p.test(A) || V.test(A) || c.test(A) || l.test(A)) break;
375
- if (Y.search(this.rules.other.nonSpaceChar) >= B || !A.trim()) h += "\n" + Y.slice(B);
372
+ let Y = e.split("\n", 1)[0], Z;
373
+ if (S = Y, this.options.pedantic ? (S = S.replace(this.rules.other.listReplaceNesting, " "), Z = S) : Z = S.replace(this.rules.other.tabCharGlobal, " "), u.test(S) || d.test(S) || f.test(S) || R.test(S) || s.test(S) || c.test(S)) break;
374
+ if (Z.search(this.rules.other.nonSpaceChar) >= A || !S.trim()) p += "\n" + Z.slice(A);
376
375
  else {
377
- if (R || S.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || d.test(S) || f.test(S) || l.test(S)) break;
378
- h += "\n" + A;
376
+ if (D || h.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || u.test(h) || d.test(h) || c.test(h)) break;
377
+ p += "\n" + S;
379
378
  }
380
- R = !A.trim(), u += G + "\n", e = e.substring(G.length + 1), S = Y.slice(B);
379
+ D = !S.trim(), l += Y + "\n", e = e.substring(Y.length + 1), h = Z.slice(A);
381
380
  }
382
381
  }
383
- d.loose || (p ? d.loose = !0 : this.rules.other.doubleBlankLine.test(u) && (p = !0)), d.items.push({
382
+ u.loose || (f ? u.loose = !0 : this.rules.other.doubleBlankLine.test(l) && (f = !0)), u.items.push({
384
383
  type: "list_item",
385
- raw: u,
386
- task: !!this.options.gfm && this.rules.other.listIsTask.test(h),
384
+ raw: l,
385
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(p),
387
386
  loose: !1,
388
- text: h,
387
+ text: p,
389
388
  tokens: []
390
- }), d.raw += u;
389
+ }), u.raw += l;
391
390
  }
392
- let h = d.items.at(-1);
393
- if (h) h.raw = h.raw.trimEnd(), h.text = h.text.trimEnd();
391
+ let p = u.items.at(-1);
392
+ if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
394
393
  else return;
395
- d.raw = d.raw.trimEnd();
396
- for (let e of d.items) {
394
+ u.raw = u.raw.trimEnd();
395
+ for (let e of u.items) {
397
396
  if (this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []), e.task) {
398
397
  if (e.text = e.text.replace(this.rules.other.listReplaceTask, ""), e.tokens[0]?.type === "text" || e.tokens[0]?.type === "paragraph") {
399
398
  e.tokens[0].raw = e.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), e.tokens[0].text = e.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
@@ -402,259 +401,262 @@ ${S}` : S;
402
401
  break;
403
402
  }
404
403
  }
405
- let c = this.rules.other.listTaskCheckbox.exec(e.raw);
406
- if (c) {
407
- let l = {
404
+ let s = this.rules.other.listTaskCheckbox.exec(e.raw);
405
+ if (s) {
406
+ let c = {
408
407
  type: "checkbox",
409
- raw: c[0] + " ",
410
- checked: c[0] !== "[ ]"
408
+ raw: s[0] + " ",
409
+ checked: s[0] !== "[ ]"
411
410
  };
412
- e.checked = l.checked, d.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = l.raw + e.tokens[0].raw, e.tokens[0].text = l.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(l)) : e.tokens.unshift({
411
+ e.checked = c.checked, u.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = c.raw + e.tokens[0].raw, e.tokens[0].text = c.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(c)) : e.tokens.unshift({
413
412
  type: "paragraph",
414
- raw: l.raw,
415
- text: l.raw,
416
- tokens: [l]
417
- }) : e.tokens.unshift(l);
413
+ raw: c.raw,
414
+ text: c.raw,
415
+ tokens: [c]
416
+ }) : e.tokens.unshift(c);
418
417
  }
419
418
  }
420
- if (!d.loose) {
421
- let c = e.tokens.filter((e) => e.type === "space");
422
- d.loose = c.length > 0 && c.some((e) => this.rules.other.anyLine.test(e.raw));
419
+ if (!u.loose) {
420
+ let s = e.tokens.filter((e) => e.type === "space");
421
+ u.loose = s.length > 0 && s.some((e) => this.rules.other.anyLine.test(e.raw));
423
422
  }
424
423
  }
425
- if (d.loose) for (let e of d.items) {
424
+ if (u.loose) for (let e of u.items) {
426
425
  e.loose = !0;
427
- for (let c of e.tokens) c.type === "text" && (c.type = "paragraph");
426
+ for (let s of e.tokens) s.type === "text" && (s.type = "paragraph");
428
427
  }
429
- return d;
428
+ return u;
430
429
  }
431
430
  }
432
431
  html(e) {
433
- let c = this.rules.block.html.exec(e);
434
- if (c) return {
432
+ let s = this.rules.block.html.exec(e);
433
+ if (s) return {
435
434
  type: "html",
436
435
  block: !0,
437
- raw: c[0],
438
- pre: c[1] === "pre" || c[1] === "script" || c[1] === "style",
439
- text: c[0]
436
+ raw: s[0],
437
+ pre: s[1] === "pre" || s[1] === "script" || s[1] === "style",
438
+ text: s[0]
440
439
  };
441
440
  }
442
441
  def(e) {
443
- let c = this.rules.block.def.exec(e);
444
- if (c) {
445
- let e = c[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), l = c[2] ? c[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", u = c[3] ? c[3].substring(1, c[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : c[3];
442
+ let s = this.rules.block.def.exec(e);
443
+ if (s) {
444
+ let e = s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), c = s[2] ? s[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", l = s[3] ? s[3].substring(1, s[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : s[3];
446
445
  return {
447
446
  type: "def",
448
447
  tag: e,
449
- raw: c[0],
450
- href: l,
451
- title: u
448
+ raw: s[0],
449
+ href: c,
450
+ title: l
452
451
  };
453
452
  }
454
453
  }
455
454
  table(e) {
456
- let c = this.rules.block.table.exec(e);
457
- if (!c || !this.rules.other.tableDelimiter.test(c[2])) return;
458
- let l = J(c[1]), u = c[2].replace(this.rules.other.tableAlignChars, "").split("|"), d = c[3]?.trim() ? c[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], f = {
455
+ let s = this.rules.block.table.exec(e);
456
+ if (!s || !this.rules.other.tableDelimiter.test(s[2])) return;
457
+ let c = V(s[1]), l = s[2].replace(this.rules.other.tableAlignChars, "").split("|"), u = s[3]?.trim() ? s[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], d = {
459
458
  type: "table",
460
- raw: c[0],
459
+ raw: s[0],
461
460
  header: [],
462
461
  align: [],
463
462
  rows: []
464
463
  };
465
- if (l.length === u.length) {
466
- for (let e of u) this.rules.other.tableAlignRight.test(e) ? f.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? f.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? f.align.push("left") : f.align.push(null);
467
- for (let e = 0; e < l.length; e++) f.header.push({
468
- text: l[e],
469
- tokens: this.lexer.inline(l[e]),
464
+ if (c.length === l.length) {
465
+ for (let e of l) this.rules.other.tableAlignRight.test(e) ? d.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? d.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? d.align.push("left") : d.align.push(null);
466
+ for (let e = 0; e < c.length; e++) d.header.push({
467
+ text: c[e],
468
+ tokens: this.lexer.inline(c[e]),
470
469
  header: !0,
471
- align: f.align[e]
470
+ align: d.align[e]
472
471
  });
473
- for (let e of d) f.rows.push(J(e, f.header.length).map((e, c) => ({
472
+ for (let e of u) d.rows.push(V(e, d.header.length).map((e, s) => ({
474
473
  text: e,
475
474
  tokens: this.lexer.inline(e),
476
475
  header: !1,
477
- align: f.align[c]
476
+ align: d.align[s]
478
477
  })));
479
- return f;
478
+ return d;
480
479
  }
481
480
  }
482
481
  lheading(e) {
483
- let c = this.rules.block.lheading.exec(e);
484
- if (c) return {
485
- type: "heading",
486
- raw: c[0],
487
- depth: c[2].charAt(0) === "=" ? 1 : 2,
488
- text: c[1],
489
- tokens: this.lexer.inline(c[1])
490
- };
482
+ let s = this.rules.block.lheading.exec(e);
483
+ if (s) {
484
+ let e = s[1].trim();
485
+ return {
486
+ type: "heading",
487
+ raw: s[0],
488
+ depth: s[2].charAt(0) === "=" ? 1 : 2,
489
+ text: e,
490
+ tokens: this.lexer.inline(e)
491
+ };
492
+ }
491
493
  }
492
494
  paragraph(e) {
493
- let c = this.rules.block.paragraph.exec(e);
494
- if (c) {
495
- let e = c[1].charAt(c[1].length - 1) === "\n" ? c[1].slice(0, -1) : c[1];
495
+ let s = this.rules.block.paragraph.exec(e);
496
+ if (s) {
497
+ let e = s[1].charAt(s[1].length - 1) === "\n" ? s[1].slice(0, -1) : s[1];
496
498
  return {
497
499
  type: "paragraph",
498
- raw: c[0],
500
+ raw: s[0],
499
501
  text: e,
500
502
  tokens: this.lexer.inline(e)
501
503
  };
502
504
  }
503
505
  }
504
506
  text(e) {
505
- let c = this.rules.block.text.exec(e);
506
- if (c) return {
507
+ let s = this.rules.block.text.exec(e);
508
+ if (s) return {
507
509
  type: "text",
508
- raw: c[0],
509
- text: c[0],
510
- tokens: this.lexer.inline(c[0])
510
+ raw: s[0],
511
+ text: s[0],
512
+ tokens: this.lexer.inline(s[0])
511
513
  };
512
514
  }
513
515
  escape(e) {
514
- let c = this.rules.inline.escape.exec(e);
515
- if (c) return {
516
+ let s = this.rules.inline.escape.exec(e);
517
+ if (s) return {
516
518
  type: "escape",
517
- raw: c[0],
518
- text: c[1]
519
+ raw: s[0],
520
+ text: s[1]
519
521
  };
520
522
  }
521
523
  tag(e) {
522
- let c = this.rules.inline.tag.exec(e);
523
- if (c) return !this.lexer.state.inLink && this.rules.other.startATag.test(c[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(c[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(c[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(c[0]) && (this.lexer.state.inRawBlock = !1), {
524
+ let s = this.rules.inline.tag.exec(e);
525
+ if (s) return !this.lexer.state.inLink && this.rules.other.startATag.test(s[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(s[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(s[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(s[0]) && (this.lexer.state.inRawBlock = !1), {
524
526
  type: "html",
525
- raw: c[0],
527
+ raw: s[0],
526
528
  inLink: this.lexer.state.inLink,
527
529
  inRawBlock: this.lexer.state.inRawBlock,
528
530
  block: !1,
529
- text: c[0]
531
+ text: s[0]
530
532
  };
531
533
  }
532
534
  link(e) {
533
- let c = this.rules.inline.link.exec(e);
534
- if (c) {
535
- let e = c[2].trim();
535
+ let s = this.rules.inline.link.exec(e);
536
+ if (s) {
537
+ let e = s[2].trim();
536
538
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
537
539
  if (!this.rules.other.endAngleBracket.test(e)) return;
538
- let c = C(e.slice(0, -1), "\\");
539
- if ((e.length - c.length) % 2 == 0) return;
540
+ let s = I(e.slice(0, -1), "\\");
541
+ if ((e.length - s.length) % 2 == 0) return;
540
542
  } else {
541
- let e = ge(c[2], "()");
543
+ let e = de(s[2], "()");
542
544
  if (e === -2) return;
543
545
  if (e > -1) {
544
- let l = (c[0].indexOf("!") === 0 ? 5 : 4) + c[1].length + e;
545
- c[2] = c[2].substring(0, e), c[0] = c[0].substring(0, l).trim(), c[3] = "";
546
+ let c = (s[0].indexOf("!") === 0 ? 5 : 4) + s[1].length + e;
547
+ s[2] = s[2].substring(0, e), s[0] = s[0].substring(0, c).trim(), s[3] = "";
546
548
  }
547
549
  }
548
- let l = c[2], u = "";
550
+ let c = s[2], l = "";
549
551
  if (this.options.pedantic) {
550
- let e = this.rules.other.pedanticHrefTitle.exec(l);
551
- e && (l = e[1], u = e[3]);
552
- } else u = c[3] ? c[3].slice(1, -1) : "";
553
- return l = l.trim(), this.rules.other.startAngleBracket.test(l) && (l = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? l.slice(1) : l.slice(1, -1)), me(c, {
554
- href: l && l.replace(this.rules.inline.anyPunctuation, "$1"),
555
- title: u && u.replace(this.rules.inline.anyPunctuation, "$1")
556
- }, c[0], this.lexer, this.rules);
552
+ let e = this.rules.other.pedanticHrefTitle.exec(c);
553
+ e && (c = e[1], l = e[3]);
554
+ } else l = s[3] ? s[3].slice(1, -1) : "";
555
+ return c = c.trim(), this.rules.other.startAngleBracket.test(c) && (c = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? c.slice(1) : c.slice(1, -1)), fe(s, {
556
+ href: c && c.replace(this.rules.inline.anyPunctuation, "$1"),
557
+ title: l && l.replace(this.rules.inline.anyPunctuation, "$1")
558
+ }, s[0], this.lexer, this.rules);
557
559
  }
558
560
  }
559
- reflink(e, c) {
560
- let l;
561
- if ((l = this.rules.inline.reflink.exec(e)) || (l = this.rules.inline.nolink.exec(e))) {
562
- let e = c[(l[2] || l[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
561
+ reflink(e, s) {
562
+ let c;
563
+ if ((c = this.rules.inline.reflink.exec(e)) || (c = this.rules.inline.nolink.exec(e))) {
564
+ let e = s[(c[2] || c[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
563
565
  if (!e) {
564
- let e = l[0].charAt(0);
566
+ let e = c[0].charAt(0);
565
567
  return {
566
568
  type: "text",
567
569
  raw: e,
568
570
  text: e
569
571
  };
570
572
  }
571
- return me(l, e, l[0], this.lexer, this.rules);
573
+ return fe(c, e, c[0], this.lexer, this.rules);
572
574
  }
573
575
  }
574
- emStrong(e, c, l = "") {
575
- let u = this.rules.inline.emStrongLDelim.exec(e);
576
- if (!(!u || u[3] && l.match(this.rules.other.unicodeAlphaNumeric)) && (!(u[1] || u[2]) || !l || this.rules.inline.punctuation.exec(l))) {
577
- let l = [...u[0]].length - 1, d, f, p = l, h = 0, S = u[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
578
- for (S.lastIndex = 0, c = c.slice(-1 * e.length + l); (u = S.exec(c)) != null;) {
579
- if (d = u[1] || u[2] || u[3] || u[4] || u[5] || u[6], !d) continue;
580
- if (f = [...d].length, u[3] || u[4]) {
581
- p += f;
576
+ emStrong(e, s, c = "") {
577
+ let l = this.rules.inline.emStrongLDelim.exec(e);
578
+ if (!(!l || !l[1] && !l[2] && !l[3] && !l[4] || l[4] && c.match(this.rules.other.unicodeAlphaNumeric)) && (!(l[1] || l[3]) || !c || this.rules.inline.punctuation.exec(c))) {
579
+ let c = [...l[0]].length - 1, u, d, f = c, p = 0, h = l[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
580
+ for (h.lastIndex = 0, s = s.slice(-1 * e.length + c); (l = h.exec(s)) !== null;) {
581
+ if (u = l[1] || l[2] || l[3] || l[4] || l[5] || l[6], !u) continue;
582
+ if (d = [...u].length, l[3] || l[4]) {
583
+ f += d;
582
584
  continue;
583
- } else if ((u[5] || u[6]) && l % 3 && !((l + f) % 3)) {
584
- h += f;
585
+ } else if ((l[5] || l[6]) && c % 3 && !((c + d) % 3)) {
586
+ p += d;
585
587
  continue;
586
588
  }
587
- if (p -= f, p > 0) continue;
588
- f = Math.min(f, f + p + h);
589
- let c = [...u[0]][0].length, S = e.slice(0, l + u.index + c + f);
590
- if (Math.min(l, f) % 2) {
591
- let e = S.slice(1, -1);
589
+ if (f -= d, f > 0) continue;
590
+ d = Math.min(d, d + f + p);
591
+ let s = [...l[0]][0].length, h = e.slice(0, c + l.index + s + d);
592
+ if (Math.min(c, d) % 2) {
593
+ let e = h.slice(1, -1);
592
594
  return {
593
595
  type: "em",
594
- raw: S,
596
+ raw: h,
595
597
  text: e,
596
598
  tokens: this.lexer.inlineTokens(e)
597
599
  };
598
600
  }
599
- let A = S.slice(2, -2);
601
+ let S = h.slice(2, -2);
600
602
  return {
601
603
  type: "strong",
602
- raw: S,
603
- text: A,
604
- tokens: this.lexer.inlineTokens(A)
604
+ raw: h,
605
+ text: S,
606
+ tokens: this.lexer.inlineTokens(S)
605
607
  };
606
608
  }
607
609
  }
608
610
  }
609
611
  codespan(e) {
610
- let c = this.rules.inline.code.exec(e);
611
- if (c) {
612
- let e = c[2].replace(this.rules.other.newLineCharGlobal, " "), l = this.rules.other.nonSpaceChar.test(e), u = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
613
- return l && u && (e = e.substring(1, e.length - 1)), {
612
+ let s = this.rules.inline.code.exec(e);
613
+ if (s) {
614
+ let e = s[2].replace(this.rules.other.newLineCharGlobal, " "), c = this.rules.other.nonSpaceChar.test(e), l = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
615
+ return c && l && (e = e.substring(1, e.length - 1)), {
614
616
  type: "codespan",
615
- raw: c[0],
617
+ raw: s[0],
616
618
  text: e
617
619
  };
618
620
  }
619
621
  }
620
622
  br(e) {
621
- let c = this.rules.inline.br.exec(e);
622
- if (c) return {
623
+ let s = this.rules.inline.br.exec(e);
624
+ if (s) return {
623
625
  type: "br",
624
- raw: c[0]
626
+ raw: s[0]
625
627
  };
626
628
  }
627
- del(e, c, l = "") {
628
- let u = this.rules.inline.delLDelim.exec(e);
629
- if (u && (!u[1] || !l || this.rules.inline.punctuation.exec(l))) {
630
- let l = [...u[0]].length - 1, d, f, p = l, h = this.rules.inline.delRDelim;
631
- for (h.lastIndex = 0, c = c.slice(-1 * e.length + l); (u = h.exec(c)) != null;) {
632
- if (d = u[1] || u[2] || u[3] || u[4] || u[5] || u[6], !d || (f = [...d].length, f !== l)) continue;
633
- if (u[3] || u[4]) {
634
- p += f;
629
+ del(e, s, c = "") {
630
+ let l = this.rules.inline.delLDelim.exec(e);
631
+ if (l && (!l[1] || !c || this.rules.inline.punctuation.exec(c))) {
632
+ let c = [...l[0]].length - 1, u, d, f = c, p = this.rules.inline.delRDelim;
633
+ for (p.lastIndex = 0, s = s.slice(-1 * e.length + c); (l = p.exec(s)) !== null;) {
634
+ if (u = l[1] || l[2] || l[3] || l[4] || l[5] || l[6], !u || (d = [...u].length, d !== c)) continue;
635
+ if (l[3] || l[4]) {
636
+ f += d;
635
637
  continue;
636
638
  }
637
- if (p -= f, p > 0) continue;
638
- f = Math.min(f, f + p);
639
- let c = [...u[0]][0].length, h = e.slice(0, l + u.index + c + f), S = h.slice(l, -l);
639
+ if (f -= d, f > 0) continue;
640
+ d = Math.min(d, d + f);
641
+ let s = [...l[0]][0].length, p = e.slice(0, c + l.index + s + d), h = p.slice(c, -c);
640
642
  return {
641
643
  type: "del",
642
- raw: h,
643
- text: S,
644
- tokens: this.lexer.inlineTokens(S)
644
+ raw: p,
645
+ text: h,
646
+ tokens: this.lexer.inlineTokens(h)
645
647
  };
646
648
  }
647
649
  }
648
650
  }
649
651
  autolink(e) {
650
- let c = this.rules.inline.autolink.exec(e);
651
- if (c) {
652
- let e, l;
653
- return c[2] === "@" ? (e = c[1], l = "mailto:" + e) : (e = c[1], l = e), {
652
+ let s = this.rules.inline.autolink.exec(e);
653
+ if (s) {
654
+ let e, c;
655
+ return s[2] === "@" ? (e = s[1], c = "mailto:" + e) : (e = s[1], c = e), {
654
656
  type: "link",
655
- raw: c[0],
657
+ raw: s[0],
656
658
  text: e,
657
- href: l,
659
+ href: c,
658
660
  tokens: [{
659
661
  type: "text",
660
662
  raw: e,
@@ -664,22 +666,22 @@ ${S}` : S;
664
666
  }
665
667
  }
666
668
  url(e) {
667
- let c;
668
- if (c = this.rules.inline.url.exec(e)) {
669
- let e, l;
670
- if (c[2] === "@") e = c[0], l = "mailto:" + e;
669
+ let s;
670
+ if (s = this.rules.inline.url.exec(e)) {
671
+ let e, c;
672
+ if (s[2] === "@") e = s[0], c = "mailto:" + e;
671
673
  else {
672
- let u;
674
+ let l;
673
675
  do
674
- u = c[0], c[0] = this.rules.inline._backpedal.exec(c[0])?.[0] ?? "";
675
- while (u !== c[0]);
676
- e = c[0], l = c[1] === "www." ? "http://" + c[0] : c[0];
676
+ l = s[0], s[0] = this.rules.inline._backpedal.exec(s[0])?.[0] ?? "";
677
+ while (l !== s[0]);
678
+ e = s[0], c = s[1] === "www." ? "http://" + s[0] : s[0];
677
679
  }
678
680
  return {
679
681
  type: "link",
680
- raw: c[0],
682
+ raw: s[0],
681
683
  text: e,
682
- href: l,
684
+ href: c,
683
685
  tokens: [{
684
686
  type: "text",
685
687
  raw: e,
@@ -689,13 +691,13 @@ ${S}` : S;
689
691
  }
690
692
  }
691
693
  inlineText(e) {
692
- let c = this.rules.inline.text.exec(e);
693
- if (c) {
694
+ let s = this.rules.inline.text.exec(e);
695
+ if (s) {
694
696
  let e = this.lexer.state.inRawBlock;
695
697
  return {
696
698
  type: "text",
697
- raw: c[0],
698
- text: c[0],
699
+ raw: s[0],
700
+ text: s[0],
699
701
  escaped: e
700
702
  };
701
703
  }
@@ -707,221 +709,222 @@ ${S}` : S;
707
709
  inlineQueue;
708
710
  tokenizer;
709
711
  constructor(e) {
710
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
712
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || O, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
711
713
  inLink: !1,
712
714
  inRawBlock: !1,
713
715
  top: !0
714
716
  };
715
- let l = {
717
+ let c = {
716
718
  other: m,
717
- block: E.normal,
718
- inline: z.normal
719
+ block: B.normal,
720
+ inline: E.normal
719
721
  };
720
- this.options.pedantic ? (l.block = E.pedantic, l.inline = z.pedantic) : this.options.gfm && (l.block = E.gfm, this.options.breaks ? l.inline = z.breaks : l.inline = z.gfm), this.tokenizer.rules = l;
722
+ this.options.pedantic ? (c.block = B.pedantic, c.inline = E.pedantic) : this.options.gfm && (c.block = B.gfm, this.options.breaks ? c.inline = E.breaks : c.inline = E.gfm), this.tokenizer.rules = c;
721
723
  }
722
724
  static get rules() {
723
725
  return {
724
- block: E,
725
- inline: z
726
+ block: B,
727
+ inline: E
726
728
  };
727
729
  }
728
- static lex(c, l) {
729
- return new e(l).lex(c);
730
+ static lex(s, c) {
731
+ return new e(c).lex(s);
730
732
  }
731
- static lexInline(c, l) {
732
- return new e(l).inlineTokens(c);
733
+ static lexInline(s, c) {
734
+ return new e(c).inlineTokens(s);
733
735
  }
734
736
  lex(e) {
735
737
  e = e.replace(m.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
736
738
  for (let e = 0; e < this.inlineQueue.length; e++) {
737
- let c = this.inlineQueue[e];
738
- this.inlineTokens(c.src, c.tokens);
739
+ let s = this.inlineQueue[e];
740
+ this.inlineTokens(s.src, s.tokens);
739
741
  }
740
742
  return this.inlineQueue = [], this.tokens;
741
743
  }
742
- blockTokens(e, c = [], l = !1) {
743
- for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e;) {
744
- let u;
745
- if (this.options.extensions?.block?.some((l) => (u = l.call({ lexer: this }, e, c)) ? (e = e.substring(u.raw.length), c.push(u), !0) : !1)) continue;
746
- if (u = this.tokenizer.space(e)) {
747
- e = e.substring(u.raw.length);
748
- let l = c.at(-1);
749
- u.raw.length === 1 && l !== void 0 ? l.raw += "\n" : c.push(u);
744
+ blockTokens(e, s = [], c = !1) {
745
+ for (this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e;) {
746
+ let l;
747
+ if (this.options.extensions?.block?.some((c) => (l = c.call({ lexer: this }, e, s)) ? (e = e.substring(l.raw.length), s.push(l), !0) : !1)) continue;
748
+ if (l = this.tokenizer.space(e)) {
749
+ e = e.substring(l.raw.length);
750
+ let c = s.at(-1);
751
+ l.raw.length === 1 && c !== void 0 ? c.raw += "\n" : s.push(l);
750
752
  continue;
751
753
  }
752
- if (u = this.tokenizer.code(e)) {
753
- e = e.substring(u.raw.length);
754
- let l = c.at(-1);
755
- l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith("\n") ? "" : "\n") + u.raw, l.text += "\n" + u.text, this.inlineQueue.at(-1).src = l.text) : c.push(u);
754
+ if (l = this.tokenizer.code(e)) {
755
+ e = e.substring(l.raw.length);
756
+ let c = s.at(-1);
757
+ c?.type === "paragraph" || c?.type === "text" ? (c.raw += (c.raw.endsWith("\n") ? "" : "\n") + l.raw, c.text += "\n" + l.text, this.inlineQueue.at(-1).src = c.text) : s.push(l);
756
758
  continue;
757
759
  }
758
- if (u = this.tokenizer.fences(e)) {
759
- e = e.substring(u.raw.length), c.push(u);
760
+ if (l = this.tokenizer.fences(e)) {
761
+ e = e.substring(l.raw.length), s.push(l);
760
762
  continue;
761
763
  }
762
- if (u = this.tokenizer.heading(e)) {
763
- e = e.substring(u.raw.length), c.push(u);
764
+ if (l = this.tokenizer.heading(e)) {
765
+ e = e.substring(l.raw.length), s.push(l);
764
766
  continue;
765
767
  }
766
- if (u = this.tokenizer.hr(e)) {
767
- e = e.substring(u.raw.length), c.push(u);
768
+ if (l = this.tokenizer.hr(e)) {
769
+ e = e.substring(l.raw.length), s.push(l);
768
770
  continue;
769
771
  }
770
- if (u = this.tokenizer.blockquote(e)) {
771
- e = e.substring(u.raw.length), c.push(u);
772
+ if (l = this.tokenizer.blockquote(e)) {
773
+ e = e.substring(l.raw.length), s.push(l);
772
774
  continue;
773
775
  }
774
- if (u = this.tokenizer.list(e)) {
775
- e = e.substring(u.raw.length), c.push(u);
776
+ if (l = this.tokenizer.list(e)) {
777
+ e = e.substring(l.raw.length), s.push(l);
776
778
  continue;
777
779
  }
778
- if (u = this.tokenizer.html(e)) {
779
- e = e.substring(u.raw.length), c.push(u);
780
+ if (l = this.tokenizer.html(e)) {
781
+ e = e.substring(l.raw.length), s.push(l);
780
782
  continue;
781
783
  }
782
- if (u = this.tokenizer.def(e)) {
783
- e = e.substring(u.raw.length);
784
- let l = c.at(-1);
785
- l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith("\n") ? "" : "\n") + u.raw, l.text += "\n" + u.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[u.tag] || (this.tokens.links[u.tag] = {
786
- href: u.href,
787
- title: u.title
788
- }, c.push(u));
784
+ if (l = this.tokenizer.def(e)) {
785
+ e = e.substring(l.raw.length);
786
+ let c = s.at(-1);
787
+ c?.type === "paragraph" || c?.type === "text" ? (c.raw += (c.raw.endsWith("\n") ? "" : "\n") + l.raw, c.text += "\n" + l.raw, this.inlineQueue.at(-1).src = c.text) : this.tokens.links[l.tag] || (this.tokens.links[l.tag] = {
788
+ href: l.href,
789
+ title: l.title
790
+ }, s.push(l));
789
791
  continue;
790
792
  }
791
- if (u = this.tokenizer.table(e)) {
792
- e = e.substring(u.raw.length), c.push(u);
793
+ if (l = this.tokenizer.table(e)) {
794
+ e = e.substring(l.raw.length), s.push(l);
793
795
  continue;
794
796
  }
795
- if (u = this.tokenizer.lheading(e)) {
796
- e = e.substring(u.raw.length), c.push(u);
797
+ if (l = this.tokenizer.lheading(e)) {
798
+ e = e.substring(l.raw.length), s.push(l);
797
799
  continue;
798
800
  }
799
- let d = e;
801
+ let u = e;
800
802
  if (this.options.extensions?.startBlock) {
801
- let c = Infinity, l = e.slice(1), u;
803
+ let s = Infinity, c = e.slice(1), l;
802
804
  this.options.extensions.startBlock.forEach((e) => {
803
- u = e.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
804
- }), c < Infinity && c >= 0 && (d = e.substring(0, c + 1));
805
+ l = e.call({ lexer: this }, c), typeof l == "number" && l >= 0 && (s = Math.min(s, l));
806
+ }), s < Infinity && s >= 0 && (u = e.substring(0, s + 1));
805
807
  }
806
- if (this.state.top && (u = this.tokenizer.paragraph(d))) {
807
- let f = c.at(-1);
808
- l && f?.type === "paragraph" ? (f.raw += (f.raw.endsWith("\n") ? "" : "\n") + u.raw, f.text += "\n" + u.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = f.text) : c.push(u), l = d.length !== e.length, e = e.substring(u.raw.length);
808
+ if (this.state.top && (l = this.tokenizer.paragraph(u))) {
809
+ let d = s.at(-1);
810
+ c && d?.type === "paragraph" ? (d.raw += (d.raw.endsWith("\n") ? "" : "\n") + l.raw, d.text += "\n" + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = d.text) : s.push(l), c = u.length !== e.length, e = e.substring(l.raw.length);
809
811
  continue;
810
812
  }
811
- if (u = this.tokenizer.text(e)) {
812
- e = e.substring(u.raw.length);
813
- let l = c.at(-1);
814
- l?.type === "text" ? (l.raw += (l.raw.endsWith("\n") ? "" : "\n") + u.raw, l.text += "\n" + u.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : c.push(u);
813
+ if (l = this.tokenizer.text(e)) {
814
+ e = e.substring(l.raw.length);
815
+ let c = s.at(-1);
816
+ c?.type === "text" ? (c.raw += (c.raw.endsWith("\n") ? "" : "\n") + l.raw, c.text += "\n" + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = c.text) : s.push(l);
815
817
  continue;
816
818
  }
817
819
  if (e) {
818
- let c = "Infinite loop on byte: " + e.charCodeAt(0);
820
+ let s = "Infinite loop on byte: " + e.charCodeAt(0);
819
821
  if (this.options.silent) {
820
- console.error(c);
822
+ console.error(s);
821
823
  break;
822
- } else throw Error(c);
824
+ } else throw Error(s);
823
825
  }
824
826
  }
825
- return this.state.top = !0, c;
827
+ return this.state.top = !0, s;
826
828
  }
827
- inline(e, c = []) {
829
+ inline(e, s = []) {
828
830
  return this.inlineQueue.push({
829
831
  src: e,
830
- tokens: c
831
- }), c;
832
+ tokens: s
833
+ }), s;
832
834
  }
833
- inlineTokens(e, c = []) {
834
- let l = e, u = null;
835
+ inlineTokens(e, s = []) {
836
+ this.tokenizer.lexer = this;
837
+ let c = e, l = null;
835
838
  if (this.tokens.links) {
836
839
  let e = Object.keys(this.tokens.links);
837
- if (e.length > 0) for (; (u = this.tokenizer.rules.inline.reflinkSearch.exec(l)) != null;) e.includes(u[0].slice(u[0].lastIndexOf("[") + 1, -1)) && (l = l.slice(0, u.index) + "[" + "a".repeat(u[0].length - 2) + "]" + l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
840
+ if (e.length > 0) for (; (l = this.tokenizer.rules.inline.reflinkSearch.exec(c)) !== null;) e.includes(l[0].slice(l[0].lastIndexOf("[") + 1, -1)) && (c = c.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
838
841
  }
839
- for (; (u = this.tokenizer.rules.inline.anyPunctuation.exec(l)) != null;) l = l.slice(0, u.index) + "++" + l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
840
- let d;
841
- for (; (u = this.tokenizer.rules.inline.blockSkip.exec(l)) != null;) d = u[2] ? u[2].length : 0, l = l.slice(0, u.index + d) + "[" + "a".repeat(u[0].length - d - 2) + "]" + l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
842
- l = this.options.hooks?.emStrongMask?.call({ lexer: this }, l) ?? l;
843
- let f = !1, p = "";
842
+ for (; (l = this.tokenizer.rules.inline.anyPunctuation.exec(c)) !== null;) c = c.slice(0, l.index) + "++" + c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
843
+ let u;
844
+ for (; (l = this.tokenizer.rules.inline.blockSkip.exec(c)) !== null;) u = l[2] ? l[2].length : 0, c = c.slice(0, l.index + u) + "[" + "a".repeat(l[0].length - u - 2) + "]" + c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
845
+ c = this.options.hooks?.emStrongMask?.call({ lexer: this }, c) ?? c;
846
+ let d = !1, f = "";
844
847
  for (; e;) {
845
- f || (p = ""), f = !1;
846
- let u;
847
- if (this.options.extensions?.inline?.some((l) => (u = l.call({ lexer: this }, e, c)) ? (e = e.substring(u.raw.length), c.push(u), !0) : !1)) continue;
848
- if (u = this.tokenizer.escape(e)) {
849
- e = e.substring(u.raw.length), c.push(u);
848
+ d || (f = ""), d = !1;
849
+ let l;
850
+ if (this.options.extensions?.inline?.some((c) => (l = c.call({ lexer: this }, e, s)) ? (e = e.substring(l.raw.length), s.push(l), !0) : !1)) continue;
851
+ if (l = this.tokenizer.escape(e)) {
852
+ e = e.substring(l.raw.length), s.push(l);
850
853
  continue;
851
854
  }
852
- if (u = this.tokenizer.tag(e)) {
853
- e = e.substring(u.raw.length), c.push(u);
855
+ if (l = this.tokenizer.tag(e)) {
856
+ e = e.substring(l.raw.length), s.push(l);
854
857
  continue;
855
858
  }
856
- if (u = this.tokenizer.link(e)) {
857
- e = e.substring(u.raw.length), c.push(u);
859
+ if (l = this.tokenizer.link(e)) {
860
+ e = e.substring(l.raw.length), s.push(l);
858
861
  continue;
859
862
  }
860
- if (u = this.tokenizer.reflink(e, this.tokens.links)) {
861
- e = e.substring(u.raw.length);
862
- let l = c.at(-1);
863
- u.type === "text" && l?.type === "text" ? (l.raw += u.raw, l.text += u.text) : c.push(u);
863
+ if (l = this.tokenizer.reflink(e, this.tokens.links)) {
864
+ e = e.substring(l.raw.length);
865
+ let c = s.at(-1);
866
+ l.type === "text" && c?.type === "text" ? (c.raw += l.raw, c.text += l.text) : s.push(l);
864
867
  continue;
865
868
  }
866
- if (u = this.tokenizer.emStrong(e, l, p)) {
867
- e = e.substring(u.raw.length), c.push(u);
869
+ if (l = this.tokenizer.emStrong(e, c, f)) {
870
+ e = e.substring(l.raw.length), s.push(l);
868
871
  continue;
869
872
  }
870
- if (u = this.tokenizer.codespan(e)) {
871
- e = e.substring(u.raw.length), c.push(u);
873
+ if (l = this.tokenizer.codespan(e)) {
874
+ e = e.substring(l.raw.length), s.push(l);
872
875
  continue;
873
876
  }
874
- if (u = this.tokenizer.br(e)) {
875
- e = e.substring(u.raw.length), c.push(u);
877
+ if (l = this.tokenizer.br(e)) {
878
+ e = e.substring(l.raw.length), s.push(l);
876
879
  continue;
877
880
  }
878
- if (u = this.tokenizer.del(e, l, p)) {
879
- e = e.substring(u.raw.length), c.push(u);
881
+ if (l = this.tokenizer.del(e, c, f)) {
882
+ e = e.substring(l.raw.length), s.push(l);
880
883
  continue;
881
884
  }
882
- if (u = this.tokenizer.autolink(e)) {
883
- e = e.substring(u.raw.length), c.push(u);
885
+ if (l = this.tokenizer.autolink(e)) {
886
+ e = e.substring(l.raw.length), s.push(l);
884
887
  continue;
885
888
  }
886
- if (!this.state.inLink && (u = this.tokenizer.url(e))) {
887
- e = e.substring(u.raw.length), c.push(u);
889
+ if (!this.state.inLink && (l = this.tokenizer.url(e))) {
890
+ e = e.substring(l.raw.length), s.push(l);
888
891
  continue;
889
892
  }
890
- let d = e;
893
+ let u = e;
891
894
  if (this.options.extensions?.startInline) {
892
- let c = Infinity, l = e.slice(1), u;
895
+ let s = Infinity, c = e.slice(1), l;
893
896
  this.options.extensions.startInline.forEach((e) => {
894
- u = e.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
895
- }), c < Infinity && c >= 0 && (d = e.substring(0, c + 1));
897
+ l = e.call({ lexer: this }, c), typeof l == "number" && l >= 0 && (s = Math.min(s, l));
898
+ }), s < Infinity && s >= 0 && (u = e.substring(0, s + 1));
896
899
  }
897
- if (u = this.tokenizer.inlineText(d)) {
898
- e = e.substring(u.raw.length), u.raw.slice(-1) !== "_" && (p = u.raw.slice(-1)), f = !0;
899
- let l = c.at(-1);
900
- l?.type === "text" ? (l.raw += u.raw, l.text += u.text) : c.push(u);
900
+ if (l = this.tokenizer.inlineText(u)) {
901
+ e = e.substring(l.raw.length), l.raw.slice(-1) !== "_" && (f = l.raw.slice(-1)), d = !0;
902
+ let c = s.at(-1);
903
+ c?.type === "text" ? (c.raw += l.raw, c.text += l.text) : s.push(l);
901
904
  continue;
902
905
  }
903
906
  if (e) {
904
- let c = "Infinite loop on byte: " + e.charCodeAt(0);
907
+ let s = "Infinite loop on byte: " + e.charCodeAt(0);
905
908
  if (this.options.silent) {
906
- console.error(c);
909
+ console.error(s);
907
910
  break;
908
- } else throw Error(c);
911
+ } else throw Error(s);
909
912
  }
910
913
  }
911
- return c;
914
+ return s;
912
915
  }
913
916
  }, y = class {
914
917
  options;
915
918
  parser;
916
919
  constructor(e) {
917
- this.options = e || T;
920
+ this.options = e || O;
918
921
  }
919
922
  space(e) {
920
923
  return "";
921
924
  }
922
- code({ text: e, lang: c, escaped: l }) {
923
- let u = (c || "").match(m.notSpaceStart)?.[0], d = e.replace(m.endingNewline, "") + "\n";
924
- return u ? "<pre><code class=\"language-" + O(u) + "\">" + (l ? d : O(d, !0)) + "</code></pre>\n" : "<pre><code>" + (l ? d : O(d, !0)) + "</code></pre>\n";
925
+ code({ text: e, lang: s, escaped: c }) {
926
+ let l = (s || "").match(m.notSpaceStart)?.[0], u = e.replace(m.endingNewline, "") + "\n";
927
+ return l ? "<pre><code class=\"language-" + T(l) + "\">" + (c ? u : T(u, !0)) + "</code></pre>\n" : "<pre><code>" + (c ? u : T(u, !0)) + "</code></pre>\n";
925
928
  }
926
929
  blockquote({ tokens: e }) {
927
930
  return `<blockquote>
@@ -934,21 +937,21 @@ ${this.parser.parse(e)}</blockquote>
934
937
  def(e) {
935
938
  return "";
936
939
  }
937
- heading({ tokens: e, depth: c }) {
938
- return `<h${c}>${this.parser.parseInline(e)}</h${c}>
940
+ heading({ tokens: e, depth: s }) {
941
+ return `<h${s}>${this.parser.parseInline(e)}</h${s}>
939
942
  `;
940
943
  }
941
944
  hr(e) {
942
945
  return "<hr>\n";
943
946
  }
944
947
  list(e) {
945
- let c = e.ordered, l = e.start, u = "";
946
- for (let c = 0; c < e.items.length; c++) {
947
- let l = e.items[c];
948
- u += this.listitem(l);
948
+ let s = e.ordered, c = e.start, l = "";
949
+ for (let s = 0; s < e.items.length; s++) {
950
+ let c = e.items[s];
951
+ l += this.listitem(c);
949
952
  }
950
- let d = c ? "ol" : "ul", f = c && l !== 1 ? " start=\"" + l + "\"" : "";
951
- return "<" + d + f + ">\n" + u + "</" + d + ">\n";
953
+ let u = s ? "ol" : "ul", d = s && c !== 1 ? " start=\"" + c + "\"" : "";
954
+ return "<" + u + d + ">\n" + l + "</" + u + ">\n";
952
955
  }
953
956
  listitem(e) {
954
957
  return `<li>${this.parser.parse(e.tokens)}</li>
@@ -962,17 +965,17 @@ ${this.parser.parse(e)}</blockquote>
962
965
  `;
963
966
  }
964
967
  table(e) {
965
- let c = "", l = "";
966
- for (let c = 0; c < e.header.length; c++) l += this.tablecell(e.header[c]);
967
- c += this.tablerow({ text: l });
968
- let u = "";
969
- for (let c = 0; c < e.rows.length; c++) {
970
- let d = e.rows[c];
971
- l = "";
972
- for (let e = 0; e < d.length; e++) l += this.tablecell(d[e]);
973
- u += this.tablerow({ text: l });
968
+ let s = "", c = "";
969
+ for (let s = 0; s < e.header.length; s++) c += this.tablecell(e.header[s]);
970
+ s += this.tablerow({ text: c });
971
+ let l = "";
972
+ for (let s = 0; s < e.rows.length; s++) {
973
+ let u = e.rows[s];
974
+ c = "";
975
+ for (let e = 0; e < u.length; e++) c += this.tablecell(u[e]);
976
+ l += this.tablerow({ text: c });
974
977
  }
975
- return u &&= `<tbody>${u}</tbody>`, "<table>\n<thead>\n" + c + "</thead>\n" + u + "</table>\n";
978
+ return l &&= `<tbody>${l}</tbody>`, "<table>\n<thead>\n" + s + "</thead>\n" + l + "</table>\n";
976
979
  }
977
980
  tablerow({ text: e }) {
978
981
  return `<tr>
@@ -980,8 +983,8 @@ ${e}</tr>
980
983
  `;
981
984
  }
982
985
  tablecell(e) {
983
- let c = this.parser.parseInline(e.tokens), l = e.header ? "th" : "td";
984
- return (e.align ? `<${l} align="${e.align}">` : `<${l}>`) + c + `</${l}>
986
+ let s = this.parser.parseInline(e.tokens), c = e.header ? "th" : "td";
987
+ return (e.align ? `<${c} align="${e.align}">` : `<${c}>`) + s + `</${c}>
985
988
  `;
986
989
  }
987
990
  strong({ tokens: e }) {
@@ -991,7 +994,7 @@ ${e}</tr>
991
994
  return `<em>${this.parser.parseInline(e)}</em>`;
992
995
  }
993
996
  codespan({ text: e }) {
994
- return `<code>${O(e, !0)}</code>`;
997
+ return `<code>${T(e, !0)}</code>`;
995
998
  }
996
999
  br(e) {
997
1000
  return "<br>";
@@ -999,23 +1002,23 @@ ${e}</tr>
999
1002
  del({ tokens: e }) {
1000
1003
  return `<del>${this.parser.parseInline(e)}</del>`;
1001
1004
  }
1002
- link({ href: e, title: c, tokens: l }) {
1003
- let u = this.parser.parseInline(l), d = X(e);
1004
- if (d === null) return u;
1005
- e = d;
1006
- let f = "<a href=\"" + e + "\"";
1007
- return c && (f += " title=\"" + O(c) + "\""), f += ">" + u + "</a>", f;
1008
- }
1009
- image({ href: e, title: c, text: l, tokens: u }) {
1010
- u && (l = this.parser.parseInline(u, this.parser.textRenderer));
1011
- let d = X(e);
1012
- if (d === null) return O(l);
1013
- e = d;
1014
- let f = `<img src="${e}" alt="${O(l)}"`;
1015
- return c && (f += ` title="${O(c)}"`), f += ">", f;
1005
+ link({ href: e, title: s, tokens: c }) {
1006
+ let l = this.parser.parseInline(c), u = J(e);
1007
+ if (u === null) return l;
1008
+ e = u;
1009
+ let d = "<a href=\"" + e + "\"";
1010
+ return s && (d += " title=\"" + T(s) + "\""), d += ">" + l + "</a>", d;
1011
+ }
1012
+ image({ href: e, title: s, text: c, tokens: l }) {
1013
+ l && (c = this.parser.parseInline(l, this.parser.textRenderer));
1014
+ let u = J(e);
1015
+ if (u === null) return T(c);
1016
+ e = u;
1017
+ let d = `<img src="${e}" alt="${T(c)}"`;
1018
+ return s && (d += ` title="${T(s)}"`), d += ">", d;
1016
1019
  }
1017
1020
  text(e) {
1018
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : O(e.text);
1021
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : T(e.text);
1019
1022
  }
1020
1023
  }, $ = class {
1021
1024
  strong({ text: e }) {
@@ -1053,21 +1056,22 @@ ${e}</tr>
1053
1056
  renderer;
1054
1057
  textRenderer;
1055
1058
  constructor(e) {
1056
- this.options = e || T, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
1059
+ this.options = e || O, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
1057
1060
  }
1058
- static parse(c, l) {
1059
- return new e(l).parse(c);
1061
+ static parse(s, c) {
1062
+ return new e(c).parse(s);
1060
1063
  }
1061
- static parseInline(c, l) {
1062
- return new e(l).parseInline(c);
1064
+ static parseInline(s, c) {
1065
+ return new e(c).parseInline(s);
1063
1066
  }
1064
1067
  parse(e) {
1065
- let c = "";
1066
- for (let l = 0; l < e.length; l++) {
1067
- let u = e[l];
1068
- if (this.options.extensions?.renderers?.[u.type]) {
1069
- let e = u, l = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1070
- if (l !== !1 || ![
1068
+ this.renderer.parser = this;
1069
+ let s = "";
1070
+ for (let c = 0; c < e.length; c++) {
1071
+ let l = e[c];
1072
+ if (this.options.extensions?.renderers?.[l.type]) {
1073
+ let e = l, c = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1074
+ if (c !== !1 || ![
1071
1075
  "space",
1072
1076
  "hr",
1073
1077
  "heading",
@@ -1080,63 +1084,64 @@ ${e}</tr>
1080
1084
  "paragraph",
1081
1085
  "text"
1082
1086
  ].includes(e.type)) {
1083
- c += l || "";
1087
+ s += c || "";
1084
1088
  continue;
1085
1089
  }
1086
1090
  }
1087
- let d = u;
1088
- switch (d.type) {
1091
+ let u = l;
1092
+ switch (u.type) {
1089
1093
  case "space":
1090
- c += this.renderer.space(d);
1094
+ s += this.renderer.space(u);
1091
1095
  break;
1092
1096
  case "hr":
1093
- c += this.renderer.hr(d);
1097
+ s += this.renderer.hr(u);
1094
1098
  break;
1095
1099
  case "heading":
1096
- c += this.renderer.heading(d);
1100
+ s += this.renderer.heading(u);
1097
1101
  break;
1098
1102
  case "code":
1099
- c += this.renderer.code(d);
1103
+ s += this.renderer.code(u);
1100
1104
  break;
1101
1105
  case "table":
1102
- c += this.renderer.table(d);
1106
+ s += this.renderer.table(u);
1103
1107
  break;
1104
1108
  case "blockquote":
1105
- c += this.renderer.blockquote(d);
1109
+ s += this.renderer.blockquote(u);
1106
1110
  break;
1107
1111
  case "list":
1108
- c += this.renderer.list(d);
1112
+ s += this.renderer.list(u);
1109
1113
  break;
1110
1114
  case "checkbox":
1111
- c += this.renderer.checkbox(d);
1115
+ s += this.renderer.checkbox(u);
1112
1116
  break;
1113
1117
  case "html":
1114
- c += this.renderer.html(d);
1118
+ s += this.renderer.html(u);
1115
1119
  break;
1116
1120
  case "def":
1117
- c += this.renderer.def(d);
1121
+ s += this.renderer.def(u);
1118
1122
  break;
1119
1123
  case "paragraph":
1120
- c += this.renderer.paragraph(d);
1124
+ s += this.renderer.paragraph(u);
1121
1125
  break;
1122
1126
  case "text":
1123
- c += this.renderer.text(d);
1127
+ s += this.renderer.text(u);
1124
1128
  break;
1125
1129
  default: {
1126
- let e = "Token with \"" + d.type + "\" type was not found.";
1130
+ let e = "Token with \"" + u.type + "\" type was not found.";
1127
1131
  if (this.options.silent) return console.error(e), "";
1128
1132
  throw Error(e);
1129
1133
  }
1130
1134
  }
1131
1135
  }
1132
- return c;
1136
+ return s;
1133
1137
  }
1134
- parseInline(e, c = this.renderer) {
1135
- let l = "";
1136
- for (let u = 0; u < e.length; u++) {
1137
- let d = e[u];
1138
- if (this.options.extensions?.renderers?.[d.type]) {
1139
- let e = this.options.extensions.renderers[d.type].call({ parser: this }, d);
1138
+ parseInline(e, s = this.renderer) {
1139
+ this.renderer.parser = this;
1140
+ let c = "";
1141
+ for (let l = 0; l < e.length; l++) {
1142
+ let u = e[l];
1143
+ if (this.options.extensions?.renderers?.[u.type]) {
1144
+ let e = this.options.extensions.renderers[u.type].call({ parser: this }, u);
1140
1145
  if (e !== !1 || ![
1141
1146
  "escape",
1142
1147
  "html",
@@ -1148,60 +1153,60 @@ ${e}</tr>
1148
1153
  "br",
1149
1154
  "del",
1150
1155
  "text"
1151
- ].includes(d.type)) {
1152
- l += e || "";
1156
+ ].includes(u.type)) {
1157
+ c += e || "";
1153
1158
  continue;
1154
1159
  }
1155
1160
  }
1156
- let f = d;
1157
- switch (f.type) {
1161
+ let d = u;
1162
+ switch (d.type) {
1158
1163
  case "escape":
1159
- l += c.text(f);
1164
+ c += s.text(d);
1160
1165
  break;
1161
1166
  case "html":
1162
- l += c.html(f);
1167
+ c += s.html(d);
1163
1168
  break;
1164
1169
  case "link":
1165
- l += c.link(f);
1170
+ c += s.link(d);
1166
1171
  break;
1167
1172
  case "image":
1168
- l += c.image(f);
1173
+ c += s.image(d);
1169
1174
  break;
1170
1175
  case "checkbox":
1171
- l += c.checkbox(f);
1176
+ c += s.checkbox(d);
1172
1177
  break;
1173
1178
  case "strong":
1174
- l += c.strong(f);
1179
+ c += s.strong(d);
1175
1180
  break;
1176
1181
  case "em":
1177
- l += c.em(f);
1182
+ c += s.em(d);
1178
1183
  break;
1179
1184
  case "codespan":
1180
- l += c.codespan(f);
1185
+ c += s.codespan(d);
1181
1186
  break;
1182
1187
  case "br":
1183
- l += c.br(f);
1188
+ c += s.br(d);
1184
1189
  break;
1185
1190
  case "del":
1186
- l += c.del(f);
1191
+ c += s.del(d);
1187
1192
  break;
1188
1193
  case "text":
1189
- l += c.text(f);
1194
+ c += s.text(d);
1190
1195
  break;
1191
1196
  default: {
1192
- let e = "Token with \"" + f.type + "\" type was not found.";
1197
+ let e = "Token with \"" + d.type + "\" type was not found.";
1193
1198
  if (this.options.silent) return console.error(e), "";
1194
1199
  throw Error(e);
1195
1200
  }
1196
1201
  }
1197
1202
  }
1198
- return l;
1203
+ return c;
1199
1204
  }
1200
1205
  }, P = class {
1201
1206
  options;
1202
1207
  block;
1203
1208
  constructor(e) {
1204
- this.options = e || T;
1209
+ this.options = e || O;
1205
1210
  }
1206
1211
  static passThroughHooks = new Set([
1207
1212
  "preprocess",
@@ -1226,11 +1231,11 @@ ${e}</tr>
1226
1231
  emStrongMask(e) {
1227
1232
  return e;
1228
1233
  }
1229
- provideLexer() {
1230
- return this.block ? x.lex : x.lexInline;
1234
+ provideLexer(e = this.block) {
1235
+ return e ? x.lex : x.lexInline;
1231
1236
  }
1232
- provideParser() {
1233
- return this.block ? b.parse : b.parseInline;
1237
+ provideParser(e = this.block) {
1238
+ return e ? b.parse : b.parseInline;
1234
1239
  }
1235
1240
  }, L = new class {
1236
1241
  defaults = M();
@@ -1246,116 +1251,116 @@ ${e}</tr>
1246
1251
  constructor(...e) {
1247
1252
  this.use(...e);
1248
1253
  }
1249
- walkTokens(e, c) {
1250
- let l = [];
1251
- for (let u of e) switch (l = l.concat(c.call(this, u)), u.type) {
1254
+ walkTokens(e, s) {
1255
+ let c = [];
1256
+ for (let l of e) switch (c = c.concat(s.call(this, l)), l.type) {
1252
1257
  case "table": {
1253
- let e = u;
1254
- for (let u of e.header) l = l.concat(this.walkTokens(u.tokens, c));
1255
- for (let u of e.rows) for (let e of u) l = l.concat(this.walkTokens(e.tokens, c));
1258
+ let e = l;
1259
+ for (let l of e.header) c = c.concat(this.walkTokens(l.tokens, s));
1260
+ for (let l of e.rows) for (let e of l) c = c.concat(this.walkTokens(e.tokens, s));
1256
1261
  break;
1257
1262
  }
1258
1263
  case "list": {
1259
- let e = u;
1260
- l = l.concat(this.walkTokens(e.items, c));
1264
+ let e = l;
1265
+ c = c.concat(this.walkTokens(e.items, s));
1261
1266
  break;
1262
1267
  }
1263
1268
  default: {
1264
- let e = u;
1265
- this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((u) => {
1266
- let d = e[u].flat(Infinity);
1267
- l = l.concat(this.walkTokens(d, c));
1268
- }) : e.tokens && (l = l.concat(this.walkTokens(e.tokens, c)));
1269
+ let e = l;
1270
+ this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((l) => {
1271
+ let u = e[l].flat(Infinity);
1272
+ c = c.concat(this.walkTokens(u, s));
1273
+ }) : e.tokens && (c = c.concat(this.walkTokens(e.tokens, s)));
1269
1274
  }
1270
1275
  }
1271
- return l;
1276
+ return c;
1272
1277
  }
1273
1278
  use(...e) {
1274
- let c = this.defaults.extensions || {
1279
+ let s = this.defaults.extensions || {
1275
1280
  renderers: {},
1276
1281
  childTokens: {}
1277
1282
  };
1278
1283
  return e.forEach((e) => {
1279
- let l = { ...e };
1280
- if (l.async = this.defaults.async || l.async || !1, e.extensions && (e.extensions.forEach((e) => {
1284
+ let c = { ...e };
1285
+ if (c.async = this.defaults.async || c.async || !1, e.extensions && (e.extensions.forEach((e) => {
1281
1286
  if (!e.name) throw Error("extension name required");
1282
1287
  if ("renderer" in e) {
1283
- let l = c.renderers[e.name];
1284
- l ? c.renderers[e.name] = function(...c) {
1285
- let u = e.renderer.apply(this, c);
1286
- return u === !1 && (u = l.apply(this, c)), u;
1287
- } : c.renderers[e.name] = e.renderer;
1288
+ let c = s.renderers[e.name];
1289
+ c ? s.renderers[e.name] = function(...s) {
1290
+ let l = e.renderer.apply(this, s);
1291
+ return l === !1 && (l = c.apply(this, s)), l;
1292
+ } : s.renderers[e.name] = e.renderer;
1288
1293
  }
1289
1294
  if ("tokenizer" in e) {
1290
1295
  if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1291
- let l = c[e.level];
1292
- l ? l.unshift(e.tokenizer) : c[e.level] = [e.tokenizer], e.start && (e.level === "block" ? c.startBlock ? c.startBlock.push(e.start) : c.startBlock = [e.start] : e.level === "inline" && (c.startInline ? c.startInline.push(e.start) : c.startInline = [e.start]));
1296
+ let c = s[e.level];
1297
+ c ? c.unshift(e.tokenizer) : s[e.level] = [e.tokenizer], e.start && (e.level === "block" ? s.startBlock ? s.startBlock.push(e.start) : s.startBlock = [e.start] : e.level === "inline" && (s.startInline ? s.startInline.push(e.start) : s.startInline = [e.start]));
1293
1298
  }
1294
- "childTokens" in e && e.childTokens && (c.childTokens[e.name] = e.childTokens);
1295
- }), l.extensions = c), e.renderer) {
1296
- let c = this.defaults.renderer || new y(this.defaults);
1297
- for (let l in e.renderer) {
1298
- if (!(l in c)) throw Error(`renderer '${l}' does not exist`);
1299
- if (["options", "parser"].includes(l)) continue;
1300
- let u = l, d = e.renderer[u], f = c[u];
1301
- c[u] = (...e) => {
1302
- let l = d.apply(c, e);
1303
- return l === !1 && (l = f.apply(c, e)), l || "";
1299
+ "childTokens" in e && e.childTokens && (s.childTokens[e.name] = e.childTokens);
1300
+ }), c.extensions = s), e.renderer) {
1301
+ let s = this.defaults.renderer || new y(this.defaults);
1302
+ for (let c in e.renderer) {
1303
+ if (!(c in s)) throw Error(`renderer '${c}' does not exist`);
1304
+ if (["options", "parser"].includes(c)) continue;
1305
+ let l = c, u = e.renderer[l], d = s[l];
1306
+ s[l] = (...e) => {
1307
+ let c = u.apply(s, e);
1308
+ return c === !1 && (c = d.apply(s, e)), c || "";
1304
1309
  };
1305
1310
  }
1306
- l.renderer = c;
1311
+ c.renderer = s;
1307
1312
  }
1308
1313
  if (e.tokenizer) {
1309
- let c = this.defaults.tokenizer || new w(this.defaults);
1310
- for (let l in e.tokenizer) {
1311
- if (!(l in c)) throw Error(`tokenizer '${l}' does not exist`);
1314
+ let s = this.defaults.tokenizer || new w(this.defaults);
1315
+ for (let c in e.tokenizer) {
1316
+ if (!(c in s)) throw Error(`tokenizer '${c}' does not exist`);
1312
1317
  if ([
1313
1318
  "options",
1314
1319
  "rules",
1315
1320
  "lexer"
1316
- ].includes(l)) continue;
1317
- let u = l, d = e.tokenizer[u], f = c[u];
1318
- c[u] = (...e) => {
1319
- let l = d.apply(c, e);
1320
- return l === !1 && (l = f.apply(c, e)), l;
1321
+ ].includes(c)) continue;
1322
+ let l = c, u = e.tokenizer[l], d = s[l];
1323
+ s[l] = (...e) => {
1324
+ let c = u.apply(s, e);
1325
+ return c === !1 && (c = d.apply(s, e)), c;
1321
1326
  };
1322
1327
  }
1323
- l.tokenizer = c;
1328
+ c.tokenizer = s;
1324
1329
  }
1325
1330
  if (e.hooks) {
1326
- let c = this.defaults.hooks || new P();
1327
- for (let l in e.hooks) {
1328
- if (!(l in c)) throw Error(`hook '${l}' does not exist`);
1329
- if (["options", "block"].includes(l)) continue;
1330
- let u = l, d = e.hooks[u], f = c[u];
1331
- P.passThroughHooks.has(l) ? c[u] = (e) => {
1332
- if (this.defaults.async && P.passThroughHooksRespectAsync.has(l)) return (async () => {
1333
- let l = await d.call(c, e);
1334
- return f.call(c, l);
1331
+ let s = this.defaults.hooks || new P();
1332
+ for (let c in e.hooks) {
1333
+ if (!(c in s)) throw Error(`hook '${c}' does not exist`);
1334
+ if (["options", "block"].includes(c)) continue;
1335
+ let l = c, u = e.hooks[l], d = s[l];
1336
+ P.passThroughHooks.has(c) ? s[l] = (e) => {
1337
+ if (this.defaults.async && P.passThroughHooksRespectAsync.has(c)) return (async () => {
1338
+ let c = await u.call(s, e);
1339
+ return d.call(s, c);
1335
1340
  })();
1336
- let u = d.call(c, e);
1337
- return f.call(c, u);
1338
- } : c[u] = (...e) => {
1341
+ let l = u.call(s, e);
1342
+ return d.call(s, l);
1343
+ } : s[l] = (...e) => {
1339
1344
  if (this.defaults.async) return (async () => {
1340
- let l = await d.apply(c, e);
1341
- return l === !1 && (l = await f.apply(c, e)), l;
1345
+ let c = await u.apply(s, e);
1346
+ return c === !1 && (c = await d.apply(s, e)), c;
1342
1347
  })();
1343
- let l = d.apply(c, e);
1344
- return l === !1 && (l = f.apply(c, e)), l;
1348
+ let c = u.apply(s, e);
1349
+ return c === !1 && (c = d.apply(s, e)), c;
1345
1350
  };
1346
1351
  }
1347
- l.hooks = c;
1352
+ c.hooks = s;
1348
1353
  }
1349
1354
  if (e.walkTokens) {
1350
- let c = this.defaults.walkTokens, u = e.walkTokens;
1351
- l.walkTokens = function(e) {
1352
- let l = [];
1353
- return l.push(u.call(this, e)), c && (l = l.concat(c.call(this, e))), l;
1355
+ let s = this.defaults.walkTokens, l = e.walkTokens;
1356
+ c.walkTokens = function(e) {
1357
+ let c = [];
1358
+ return c.push(l.call(this, e)), s && (c = c.concat(s.call(this, e))), c;
1354
1359
  };
1355
1360
  }
1356
1361
  this.defaults = {
1357
1362
  ...this.defaults,
1358
- ...l
1363
+ ...c
1359
1364
  };
1360
1365
  }), this;
1361
1366
  }
@@ -1365,57 +1370,57 @@ ${e}</tr>
1365
1370
  ...e
1366
1371
  }, this;
1367
1372
  }
1368
- lexer(e, c) {
1369
- return x.lex(e, c ?? this.defaults);
1373
+ lexer(e, s) {
1374
+ return x.lex(e, s ?? this.defaults);
1370
1375
  }
1371
- parser(e, c) {
1372
- return b.parse(e, c ?? this.defaults);
1376
+ parser(e, s) {
1377
+ return b.parse(e, s ?? this.defaults);
1373
1378
  }
1374
1379
  parseMarkdown(e) {
1375
- return (c, l) => {
1376
- let u = { ...l }, d = {
1380
+ return (s, c) => {
1381
+ let l = { ...c }, u = {
1377
1382
  ...this.defaults,
1378
- ...u
1379
- }, f = this.onError(!!d.silent, !!d.async);
1380
- if (this.defaults.async === !0 && u.async === !1) return f(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1381
- if (typeof c > "u" || c === null) return f(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1382
- if (typeof c != "string") return f(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(c) + ", string expected"));
1383
- if (d.hooks && (d.hooks.options = d, d.hooks.block = e), d.async) return (async () => {
1384
- let l = d.hooks ? await d.hooks.preprocess(c) : c, u = await (d.hooks ? await d.hooks.provideLexer() : e ? x.lex : x.lexInline)(l, d), f = d.hooks ? await d.hooks.processAllTokens(u) : u;
1385
- d.walkTokens && await Promise.all(this.walkTokens(f, d.walkTokens));
1386
- let p = await (d.hooks ? await d.hooks.provideParser() : e ? b.parse : b.parseInline)(f, d);
1387
- return d.hooks ? await d.hooks.postprocess(p) : p;
1388
- })().catch(f);
1383
+ ...l
1384
+ }, d = this.onError(!!u.silent, !!u.async);
1385
+ if (this.defaults.async === !0 && l.async === !1) return d(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1386
+ if (typeof s > "u" || s === null) return d(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1387
+ if (typeof s != "string") return d(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(s) + ", string expected"));
1388
+ if (u.hooks && (u.hooks.options = u, u.hooks.block = e), u.async) return (async () => {
1389
+ let c = u.hooks ? await u.hooks.preprocess(s) : s, l = await (u.hooks ? await u.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(c, u), d = u.hooks ? await u.hooks.processAllTokens(l) : l;
1390
+ u.walkTokens && await Promise.all(this.walkTokens(d, u.walkTokens));
1391
+ let f = await (u.hooks ? await u.hooks.provideParser(e) : e ? b.parse : b.parseInline)(d, u);
1392
+ return u.hooks ? await u.hooks.postprocess(f) : f;
1393
+ })().catch(d);
1389
1394
  try {
1390
- d.hooks && (c = d.hooks.preprocess(c));
1391
- let l = (d.hooks ? d.hooks.provideLexer() : e ? x.lex : x.lexInline)(c, d);
1392
- d.hooks && (l = d.hooks.processAllTokens(l)), d.walkTokens && this.walkTokens(l, d.walkTokens);
1393
- let u = (d.hooks ? d.hooks.provideParser() : e ? b.parse : b.parseInline)(l, d);
1394
- return d.hooks && (u = d.hooks.postprocess(u)), u;
1395
+ u.hooks && (s = u.hooks.preprocess(s));
1396
+ let c = (u.hooks ? u.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(s, u);
1397
+ u.hooks && (c = u.hooks.processAllTokens(c)), u.walkTokens && this.walkTokens(c, u.walkTokens);
1398
+ let l = (u.hooks ? u.hooks.provideParser(e) : e ? b.parse : b.parseInline)(c, u);
1399
+ return u.hooks && (l = u.hooks.postprocess(l)), l;
1395
1400
  } catch (e) {
1396
- return f(e);
1401
+ return d(e);
1397
1402
  }
1398
1403
  };
1399
1404
  }
1400
- onError(e, c) {
1401
- return (l) => {
1402
- if (l.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1403
- let e = "<p>An error occurred:</p><pre>" + O(l.message + "", !0) + "</pre>";
1404
- return c ? Promise.resolve(e) : e;
1405
+ onError(e, s) {
1406
+ return (c) => {
1407
+ if (c.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1408
+ let e = "<p>An error occurred:</p><pre>" + T(c.message + "", !0) + "</pre>";
1409
+ return s ? Promise.resolve(e) : e;
1405
1410
  }
1406
- if (c) return Promise.reject(l);
1407
- throw l;
1411
+ if (s) return Promise.reject(c);
1412
+ throw c;
1408
1413
  };
1409
1414
  }
1410
1415
  }();
1411
- function g(e, c) {
1412
- return L.parse(e, c);
1416
+ function g(e, s) {
1417
+ return L.parse(e, s);
1413
1418
  }
1414
1419
  g.options = g.setOptions = function(e) {
1415
- return L.setOptions(e), g.defaults = L.defaults, H(g.defaults), g;
1416
- }, g.getDefaults = M, g.defaults = T, g.use = function(...e) {
1417
- return L.use(...e), g.defaults = L.defaults, H(g.defaults), g;
1418
- }, g.walkTokens = function(e, c) {
1419
- return L.walkTokens(e, c);
1420
+ return L.setOptions(e), g.defaults = L.defaults, G(g.defaults), g;
1421
+ }, g.getDefaults = M, g.defaults = O, g.use = function(...e) {
1422
+ return L.use(...e), g.defaults = L.defaults, G(g.defaults), g;
1423
+ }, g.walkTokens = function(e, s) {
1424
+ return L.walkTokens(e, s);
1420
1425
  }, g.parseInline = L.parseInline, g.Parser = b, g.parser = b.parse, g.Renderer = y, g.TextRenderer = $, g.Lexer = x, g.lexer = x.lex, g.Tokenizer = w, g.Hooks = P, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, b.parse, x.lex;
1421
1426
  export { x };