@peasant-labs/fairtrade 0.0.51 → 0.0.52

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 (116) hide show
  1. package/dist/lib/commons.js +544 -522
  2. package/dist/lib/components.css +1 -1
  3. package/dist/lib/share.js +2 -2
  4. package/dist/lib/tokens.css +2 -2
  5. package/dist/lib/tokens.json +2 -2
  6. package/dist/lib/types/AppSidebar.d.ts +9 -11
  7. package/dist/lib/types/Avatar.d.ts +2 -2
  8. package/dist/lib/types/Dialog.d.ts +1 -1
  9. package/dist/lib/types/Input.d.ts +3 -3
  10. package/dist/lib/types/OverflowList.d.ts +1 -1
  11. package/dist/lib/types/RepoPicker.d.ts +3 -1
  12. package/dist/lib/types/Switch.d.ts +1 -1
  13. package/dist/lib/types/commons/Explore.d.ts +1 -1
  14. package/dist/lib/types/commons/types.d.ts +12 -0
  15. package/dist/lib/{ui-Do7A_I-0.js → ui-BVkbnMN5.js} +1637 -1597
  16. package/dist/lib/ui.js +1 -1
  17. package/package.json +1 -1
  18. package/dist/lib/abnfDiagram-WEYOIA3C-D4LMNFIJ.js +0 -89
  19. package/dist/lib/arc-1xTxsoRi.js +0 -80
  20. package/dist/lib/architecture-WOLXFQ4H-c6RsZuzu.js +0 -3
  21. package/dist/lib/architectureDiagram-ZHVYKT53-DTINqD5R.js +0 -4145
  22. package/dist/lib/array-CApNbSU9.js +0 -6
  23. package/dist/lib/blockDiagram-RJAE7QA3-CUYHoR3g.js +0 -1946
  24. package/dist/lib/c4Diagram-XDPPPE54-Cdx6_DsI.js +0 -2990
  25. package/dist/lib/channel-DagAO2vE.js +0 -5
  26. package/dist/lib/chunk-2E7WHVMD-BzhgXW3b.js +0 -490
  27. package/dist/lib/chunk-2Q5K7J3B-DWNwIK5Y.js +0 -15
  28. package/dist/lib/chunk-4EMNKR2T-DhFrQz9k.js +0 -236
  29. package/dist/lib/chunk-55XCU76K-CI0GXDkJ.js +0 -61
  30. package/dist/lib/chunk-5VM5RSS4-BAQ-46g4.js +0 -5
  31. package/dist/lib/chunk-7S6XSTFO-CMt_p-O6.js +0 -1373
  32. package/dist/lib/chunk-AQDTSKZB-DrZccIQa.js +0 -1847
  33. package/dist/lib/chunk-DSNLSHJZ-CpA9d2CJ.js +0 -4044
  34. package/dist/lib/chunk-DUW6YSOI-C-tN4Kiv.js +0 -10
  35. package/dist/lib/chunk-EJLWFMJV-B30MNYvY.js +0 -75
  36. package/dist/lib/chunk-HAGFOTED-DMU2JNZM.js +0 -4487
  37. package/dist/lib/chunk-HNE4Q36P-BIA0n2gA.js +0 -363
  38. package/dist/lib/chunk-J5ZVWO5B-CA_-jk8G.js +0 -12
  39. package/dist/lib/chunk-JWPE2WC7-KRpHbrIX.js +0 -8
  40. package/dist/lib/chunk-LNGE3PJU-CMGaAEAh.js +0 -1513
  41. package/dist/lib/chunk-NGNAAXSQ-D7Dvct7J.js +0 -19774
  42. package/dist/lib/chunk-NQOKRVIF-MK9F46y3.js +0 -4258
  43. package/dist/lib/chunk-OYAV6JZA-B1yICcbU.js +0 -10
  44. package/dist/lib/chunk-UHW7PFBP-CLrOaA0y.js +0 -67
  45. package/dist/lib/chunk-VQ5W62QI-_ZR3gKe4.js +0 -26
  46. package/dist/lib/chunk-WQQL4CDK-DFtyhYZq.js +0 -693
  47. package/dist/lib/chunk-XXDRQBXY-uzyNBbgx.js +0 -9
  48. package/dist/lib/chunk-Y2CYZVJY-BYzrzvCI.js +0 -12
  49. package/dist/lib/chunk-YZO67HFG-D1jKt78p.js +0 -275
  50. package/dist/lib/chunk-ZAUX2LTX-7XO0Yj1z.js +0 -37
  51. package/dist/lib/chunk-ZCHMQSOR-CxoKltfF.js +0 -349
  52. package/dist/lib/classDiagram-v2-4MYWR3UA-BPvwhZqw.js +0 -3397
  53. package/dist/lib/cose-bilkent-JH36ORCC-Oj79uOIQ.js +0 -2250
  54. package/dist/lib/cynefin-EF2NZ3EQ-COX3NRum.js +0 -3
  55. package/dist/lib/cynefinDiagram-WF24UDRP-UzTptNAX.js +0 -349
  56. package/dist/lib/cytoscape.esm-0ojxgO9x.js +0 -18161
  57. package/dist/lib/dagre-NK4GIZVX-DWZr-NGm.js +0 -2356
  58. package/dist/lib/defaultLocale-BbgDuMnp.js +0 -201
  59. package/dist/lib/diagram-CBK3MWTC-CsyKuv-w.js +0 -525
  60. package/dist/lib/diagram-I5XIIV2D-DWY2JSPC.js +0 -134
  61. package/dist/lib/diagram-ODIL2UCW-DUptj0JZ.js +0 -301
  62. package/dist/lib/diagram-PFBEJUXE-N5XnIBqM.js +0 -447
  63. package/dist/lib/diagram-RJA3I4VV-B9XgohYo.js +0 -214
  64. package/dist/lib/diagram-TYUNFSNR-XnsJIeAd.js +0 -5084
  65. package/dist/lib/dist-AMlsjiDX.js +0 -59
  66. package/dist/lib/ebnfDiagram-V4P3TTPT-BssHqFox.js +0 -100
  67. package/dist/lib/elk-QONTBCTQ-DwmwqYgP.js +0 -47944
  68. package/dist/lib/erDiagram-KYQIGQAA-BQiXw1Tw.js +0 -1970
  69. package/dist/lib/eventmodeling-K75KTNOO-DDb--yMc.js +0 -3
  70. package/dist/lib/flowDiagram-IUGLLWBU-BEqqF1y2.js +0 -17
  71. package/dist/lib/ganttDiagram-R7GPNTJY-BWtGXxEF.js +0 -3094
  72. package/dist/lib/gitGraph-VSP46ZUC-BSwOaak_.js +0 -3
  73. package/dist/lib/gitGraphDiagram-PDYL7XHY-CHGNuGbk.js +0 -729
  74. package/dist/lib/graphlib-Dndp26xU.js +0 -1267
  75. package/dist/lib/info-OHQRW6UA-Dk06sZRe.js +0 -3
  76. package/dist/lib/infoDiagram-MVDRKAX5-Cdhxnjmi.js +0 -20
  77. package/dist/lib/init-Bwwdo3M6.js +0 -15
  78. package/dist/lib/ishikawaDiagram-HPEHV2GE-Dzhti-GJ.js +0 -719
  79. package/dist/lib/journeyDiagram-BOSHW7O7-C3_vsSjw.js +0 -884
  80. package/dist/lib/kanban-definition-FNSA4HC5-XsfCEsjn.js +0 -976
  81. package/dist/lib/katex-Dw0PnoPU.js +0 -21850
  82. package/dist/lib/line-C9krU3Sv.js +0 -34
  83. package/dist/lib/linear-Cvilv3OA.js +0 -289
  84. package/dist/lib/mermaid-parser.core-I7qQ_fxz.js +0 -638
  85. package/dist/lib/mermaid.core-UNHMAbBP.js +0 -1126
  86. package/dist/lib/mindmap-definition-6OY57UG3-CAua-JvB.js +0 -1011
  87. package/dist/lib/ordinal-C55HfHHp.js +0 -65
  88. package/dist/lib/packet-JDAUHWVQ-DZ-MKx4I.js +0 -3
  89. package/dist/lib/path-DNvJyUE8.js +0 -85
  90. package/dist/lib/pegDiagram-ECIUJNBX-BCxa_IO0.js +0 -94
  91. package/dist/lib/pie-XZMESJXO-DpCa-Nnq.js +0 -3
  92. package/dist/lib/pieDiagram-GNMPY74T-CE_C3dCB.js +0 -205
  93. package/dist/lib/quadrantDiagram-D57K4MC3-CDgzdMoL.js +0 -2001
  94. package/dist/lib/radar-ABXABTNO-BOVK7L9p.js +0 -3
  95. package/dist/lib/railroad-I3PHUGI6-B6spKM0Z.js +0 -3
  96. package/dist/lib/railroad-abnf-LNEFI6M7-DEWqfByZ.js +0 -3
  97. package/dist/lib/railroad-ebnf-DWYD2UWJ-CWRLtxHB.js +0 -3
  98. package/dist/lib/railroad-peg-JR7BVNR7-C-3NHSsk.js +0 -3
  99. package/dist/lib/railroadDiagram-Y72NRBL7-a8YVk8LT.js +0 -76
  100. package/dist/lib/requirementDiagram-EQYSW5RA-B9HolqxU.js +0 -2228
  101. package/dist/lib/rough.esm-a8mysczE.js +0 -1352
  102. package/dist/lib/sankeyDiagram-SY24JHO5-CLFMtMJG.js +0 -970
  103. package/dist/lib/sequenceDiagram-BLEHNHQU-B5wfSV85.js +0 -4253
  104. package/dist/lib/sizeCapture-INFHLROL-BWGCc9aa.js +0 -46
  105. package/dist/lib/src-Dcy0zUZH.js +0 -2153
  106. package/dist/lib/stateDiagram-v2-A6IESKWZ-C92vye4N.js +0 -2143
  107. package/dist/lib/swimlanes-B3ENRKFQ-B6-i-tPc.js +0 -4764
  108. package/dist/lib/swimlanesDiagram-AYQRV4AK-CbkBeql-.js +0 -28
  109. package/dist/lib/timeline-definition-JXYKGLGB-D2Ip4r72.js +0 -1073
  110. package/dist/lib/treeView-D4JQ5SDB-CFaKQ_2T.js +0 -3
  111. package/dist/lib/treemap-SAJKECNS-BQ6z7Z3g.js +0 -3
  112. package/dist/lib/usecaseDiagram-WPOLBNNX-BK1Anch1.js +0 -7190
  113. package/dist/lib/vennDiagram-Q3Y3IDCW-B6YTBqTS.js +0 -1880
  114. package/dist/lib/wardley-7MLQ67FV-DChYwu4i.js +0 -3
  115. package/dist/lib/wardleyDiagram-IVAIDKWA-D5I1qLUK.js +0 -645
  116. package/dist/lib/xychartDiagram-4URNHDU4-B6RXyhTO.js +0 -2218
@@ -1,1847 +0,0 @@
1
- import { m as e, p as t } from "./src-Dcy0zUZH.js";
2
- import { n } from "./chunk-Y2CYZVJY-BYzrzvCI.js";
3
- import { F as r, k as i, s as a, y as o, z as s } from "./chunk-DSNLSHJZ-CpA9d2CJ.js";
4
- import { a as c } from "./chunk-7S6XSTFO-CMt_p-O6.js";
5
- import { n as l, t as u } from "./chunk-YZO67HFG-D1jKt78p.js";
6
- //#region node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.js
7
- function d() {
8
- return {
9
- async: !1,
10
- breaks: !1,
11
- extensions: null,
12
- gfm: !0,
13
- hooks: null,
14
- pedantic: !1,
15
- renderer: null,
16
- silent: !1,
17
- tokenizer: null,
18
- walkTokens: null
19
- };
20
- }
21
- var f = d();
22
- function p(e) {
23
- f = e;
24
- }
25
- var m = { exec: () => null };
26
- function h(e, t = "") {
27
- let n = typeof e == "string" ? e : e.source, r = {
28
- replace: (e, t) => {
29
- let i = typeof t == "string" ? t : t.source;
30
- return i = i.replace(_.caret, "$1"), n = n.replace(e, i), r;
31
- },
32
- getRegex: () => new RegExp(n, t)
33
- };
34
- return r;
35
- }
36
- var g = (() => {
37
- try {
38
- return !0;
39
- } catch {
40
- return !1;
41
- }
42
- })(), _ = {
43
- codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
44
- outputLinkReplace: /\\([\[\]])/g,
45
- indentCodeCompensation: /^(\s+)(?:```)/,
46
- beginningSpace: /^\s+/,
47
- endingHash: /#$/,
48
- startingSpaceChar: /^ /,
49
- endingSpaceChar: / $/,
50
- nonSpaceChar: /[^ ]/,
51
- newLineCharGlobal: /\n/g,
52
- tabCharGlobal: /\t/g,
53
- multipleSpaceGlobal: /\s+/g,
54
- blankLine: /^[ \t]*$/,
55
- doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
56
- blockquoteStart: /^ {0,3}>/,
57
- blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
58
- blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
59
- listReplaceTabs: /^\t+/,
60
- listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
61
- listIsTask: /^\[[ xX]\] /,
62
- listReplaceTask: /^\[[ xX]\] +/,
63
- anyLine: /\n.*\n/,
64
- hrefBrackets: /^<(.*)>$/,
65
- tableDelimiter: /[:|]/,
66
- tableAlignChars: /^\||\| *$/g,
67
- tableRowBlankLine: /\n[ \t]*$/,
68
- tableAlignRight: /^ *-+: *$/,
69
- tableAlignCenter: /^ *:-+: *$/,
70
- tableAlignLeft: /^ *:-+ *$/,
71
- startATag: /^<a /i,
72
- endATag: /^<\/a>/i,
73
- startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
74
- endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
75
- startAngleBracket: /^</,
76
- endAngleBracket: />$/,
77
- pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
78
- unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
79
- escapeTest: /[&<>"']/,
80
- escapeReplace: /[&<>"']/g,
81
- escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
82
- escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
83
- unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
84
- caret: /(^|[^\[])\^/g,
85
- percentDecode: /%25/g,
86
- findPipe: /\|/g,
87
- splitPipe: / \|/,
88
- slashPipe: /\\\|/g,
89
- carriageReturn: /\r\n|\r/g,
90
- spaceLine: /^ +$/gm,
91
- notSpaceStart: /^\S*/,
92
- endingNewline: /\n$/,
93
- listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
94
- nextBulletRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
95
- hrRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
96
- fencesBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
97
- headingBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
98
- htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i")
99
- }, ee = /^(?:[ \t]*(?:\n|$))+/, te = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ne = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, v = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, re = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, y = /(?:[*+-]|\d{1,9}[.)])/, ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = h(ie).replace(/bull/g, y).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(), oe = h(ie).replace(/bull/g, y).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(), b = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, se = /^[^\n]+/, x = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ce = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", x).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), le = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, y).getRegex(), S = "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", C = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ue = h("^ {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", C).replace("tag", S).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), de = h(b).replace("hr", v).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[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", S).getRegex(), w = {
100
- blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", de).getRegex(),
101
- code: te,
102
- def: ce,
103
- fences: ne,
104
- heading: re,
105
- hr: v,
106
- html: ue,
107
- lheading: ae,
108
- list: le,
109
- newline: ee,
110
- paragraph: de,
111
- table: m,
112
- text: se
113
- }, fe = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", v).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[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", S).getRegex(), pe = {
114
- ...w,
115
- lheading: oe,
116
- table: fe,
117
- paragraph: h(b).replace("hr", v).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", fe).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", S).getRegex()
118
- }, me = {
119
- ...w,
120
- html: h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", C).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(),
121
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
122
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
123
- fences: m,
124
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
125
- paragraph: h(b).replace("hr", v).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
126
- }, he = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ge = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _e = /^( {2,}|\\)\n(?!\s*$)/, ve = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, T = /[\p{P}\p{S}]/u, E = /[\s\p{P}\p{S}]/u, ye = /[^\s\p{P}\p{S}]/u, be = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, E).getRegex(), xe = /(?!~)[\p{P}\p{S}]/u, Se = /(?!~)[\s\p{P}\p{S}]/u, Ce = /(?:[^\s\p{P}\p{S}]|~)/u, we = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", g ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Te = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ee = h(Te, "u").replace(/punct/g, T).getRegex(), De = h(Te, "u").replace(/punct/g, xe).getRegex(), Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ke = h(Oe, "gu").replace(/notPunctSpace/g, ye).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Ae = h(Oe, "gu").replace(/notPunctSpace/g, Ce).replace(/punctSpace/g, Se).replace(/punct/g, xe).getRegex(), je = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ye).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Me = h(/\\(punct)/, "gu").replace(/punct/g, T).getRegex(), Ne = h(/^<(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(), Pe = h(C).replace("(?:-->|$)", "-->").getRegex(), Fe = h("^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", Pe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), D = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ie = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", D).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Le = h(/^!?\[(label)\]\[(ref)\]/).replace("label", D).replace("ref", x).getRegex(), Re = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", x).getRegex(), ze = h("reflink|nolink(?!\\()", "g").replace("reflink", Le).replace("nolink", Re).getRegex(), Be = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, O = {
127
- _backpedal: m,
128
- anyPunctuation: Me,
129
- autolink: Ne,
130
- blockSkip: we,
131
- br: _e,
132
- code: ge,
133
- del: m,
134
- emStrongLDelim: Ee,
135
- emStrongRDelimAst: ke,
136
- emStrongRDelimUnd: je,
137
- escape: he,
138
- link: Ie,
139
- nolink: Re,
140
- punctuation: be,
141
- reflink: Le,
142
- reflinkSearch: ze,
143
- tag: Fe,
144
- text: ve,
145
- url: m
146
- }, Ve = {
147
- ...O,
148
- link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", D).getRegex(),
149
- reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", D).getRegex()
150
- }, k = {
151
- ...O,
152
- emStrongRDelimAst: Ae,
153
- emStrongLDelim: De,
154
- url: h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Be).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
155
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
156
- del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
157
- text: h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Be).getRegex()
158
- }, He = {
159
- ...k,
160
- br: h(_e).replace("{2,}", "*").getRegex(),
161
- text: h(k.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
162
- }, A = {
163
- normal: w,
164
- gfm: pe,
165
- pedantic: me
166
- }, j = {
167
- normal: O,
168
- gfm: k,
169
- breaks: He,
170
- pedantic: Ve
171
- }, Ue = {
172
- "&": "&amp;",
173
- "<": "&lt;",
174
- ">": "&gt;",
175
- "\"": "&quot;",
176
- "'": "&#39;"
177
- }, We = (e) => Ue[e];
178
- function M(e, t) {
179
- if (t) {
180
- if (_.escapeTest.test(e)) return e.replace(_.escapeReplace, We);
181
- } else if (_.escapeTestNoEncode.test(e)) return e.replace(_.escapeReplaceNoEncode, We);
182
- return e;
183
- }
184
- function Ge(e) {
185
- try {
186
- e = encodeURI(e).replace(_.percentDecode, "%");
187
- } catch {
188
- return null;
189
- }
190
- return e;
191
- }
192
- function Ke(e, t) {
193
- let n = e.replace(_.findPipe, (e, t, n) => {
194
- let r = !1, i = t;
195
- for (; --i >= 0 && n[i] === "\\";) r = !r;
196
- return r ? "|" : " |";
197
- }).split(_.splitPipe), r = 0;
198
- if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
199
- else for (; n.length < t;) n.push("");
200
- for (; r < n.length; r++) n[r] = n[r].trim().replace(_.slashPipe, "|");
201
- return n;
202
- }
203
- function N(e, t, n) {
204
- let r = e.length;
205
- if (r === 0) return "";
206
- let i = 0;
207
- for (; i < r;) {
208
- let a = e.charAt(r - i - 1);
209
- if (a === t && !n) i++;
210
- else if (a !== t && n) i++;
211
- else break;
212
- }
213
- return e.slice(0, r - i);
214
- }
215
- function qe(e, t) {
216
- if (e.indexOf(t[1]) === -1) return -1;
217
- let n = 0;
218
- for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
219
- else if (e[r] === t[0]) n++;
220
- else if (e[r] === t[1] && (n--, n < 0)) return r;
221
- return n > 0 ? -2 : -1;
222
- }
223
- function Je(e, t, n, r, i) {
224
- let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
225
- r.state.inLink = !0;
226
- let c = {
227
- type: e[0].charAt(0) === "!" ? "image" : "link",
228
- raw: n,
229
- href: a,
230
- title: o,
231
- text: s,
232
- tokens: r.inlineTokens(s)
233
- };
234
- return r.state.inLink = !1, c;
235
- }
236
- function Ye(e, t, n) {
237
- let r = e.match(n.other.indentCodeCompensation);
238
- if (r === null) return t;
239
- let i = r[1];
240
- return t.split("\n").map((e) => {
241
- let t = e.match(n.other.beginningSpace);
242
- if (t === null) return e;
243
- let [r] = t;
244
- return r.length >= i.length ? e.slice(i.length) : e;
245
- }).join("\n");
246
- }
247
- var P = class {
248
- options;
249
- rules;
250
- lexer;
251
- constructor(e) {
252
- this.options = e || f;
253
- }
254
- space(e) {
255
- let t = this.rules.block.newline.exec(e);
256
- if (t && t[0].length > 0) return {
257
- type: "space",
258
- raw: t[0]
259
- };
260
- }
261
- code(e) {
262
- let t = this.rules.block.code.exec(e);
263
- if (t) {
264
- let e = t[0].replace(this.rules.other.codeRemoveIndent, "");
265
- return {
266
- type: "code",
267
- raw: t[0],
268
- codeBlockStyle: "indented",
269
- text: this.options.pedantic ? e : N(e, "\n")
270
- };
271
- }
272
- }
273
- fences(e) {
274
- let t = this.rules.block.fences.exec(e);
275
- if (t) {
276
- let e = t[0], n = Ye(e, t[3] || "", this.rules);
277
- return {
278
- type: "code",
279
- raw: e,
280
- lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
281
- text: n
282
- };
283
- }
284
- }
285
- heading(e) {
286
- let t = this.rules.block.heading.exec(e);
287
- if (t) {
288
- let e = t[2].trim();
289
- if (this.rules.other.endingHash.test(e)) {
290
- let t = N(e, "#");
291
- (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
292
- }
293
- return {
294
- type: "heading",
295
- raw: t[0],
296
- depth: t[1].length,
297
- text: e,
298
- tokens: this.lexer.inline(e)
299
- };
300
- }
301
- }
302
- hr(e) {
303
- let t = this.rules.block.hr.exec(e);
304
- if (t) return {
305
- type: "hr",
306
- raw: N(t[0], "\n")
307
- };
308
- }
309
- blockquote(e) {
310
- let t = this.rules.block.blockquote.exec(e);
311
- if (t) {
312
- let e = N(t[0], "\n").split("\n"), n = "", r = "", i = [];
313
- for (; e.length > 0;) {
314
- let t = !1, a = [], o;
315
- for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
316
- else if (!t) a.push(e[o]);
317
- else break;
318
- e = e.slice(o);
319
- let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
320
- n = n ? `${n}
321
- ${s}` : s, r = r ? `${r}
322
- ${c}` : c;
323
- let l = this.lexer.state.top;
324
- if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
325
- let u = i.at(-1);
326
- if (u?.type === "code") break;
327
- if (u?.type === "blockquote") {
328
- let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
329
- i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
330
- break;
331
- } else if (u?.type === "list") {
332
- let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
333
- i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
334
- continue;
335
- }
336
- }
337
- return {
338
- type: "blockquote",
339
- raw: n,
340
- tokens: i,
341
- text: r
342
- };
343
- }
344
- }
345
- list(e) {
346
- let t = this.rules.block.list.exec(e);
347
- if (t) {
348
- let n = t[1].trim(), r = n.length > 1, i = {
349
- type: "list",
350
- raw: "",
351
- ordered: r,
352
- start: r ? +n.slice(0, -1) : "",
353
- loose: !1,
354
- items: []
355
- };
356
- n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
357
- let a = this.rules.other.listItemRegex(n), o = !1;
358
- for (; e;) {
359
- let n = !1, r = "", s = "";
360
- if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
361
- r = t[0], e = e.substring(r.length);
362
- let c = t[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (e) => " ".repeat(3 * e.length)), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
363
- if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = t[2].search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
364
- let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d);
365
- for (; e;) {
366
- let f = e.split("\n", 1)[0], p;
367
- if (l = f, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), p = l) : p = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || t.test(l) || n.test(l)) break;
368
- if (p.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + p.slice(d);
369
- else {
370
- if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
371
- s += "\n" + l;
372
- }
373
- !u && !l.trim() && (u = !0), r += f + "\n", e = e.substring(f.length + 1), c = p.slice(d);
374
- }
375
- }
376
- i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0));
377
- let f = null, p;
378
- this.options.gfm && (f = this.rules.other.listIsTask.exec(s), f && (p = f[0] !== "[ ] ", s = s.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
379
- type: "list_item",
380
- raw: r,
381
- task: !!f,
382
- checked: p,
383
- loose: !1,
384
- text: s,
385
- tokens: []
386
- }), i.raw += r;
387
- }
388
- let s = i.items.at(-1);
389
- if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
390
- else return;
391
- i.raw = i.raw.trimEnd();
392
- for (let e = 0; e < i.items.length; e++) if (this.lexer.state.top = !1, i.items[e].tokens = this.lexer.blockTokens(i.items[e].text, []), !i.loose) {
393
- let t = i.items[e].tokens.filter((e) => e.type === "space");
394
- i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
395
- }
396
- if (i.loose) for (let e = 0; e < i.items.length; e++) i.items[e].loose = !0;
397
- return i;
398
- }
399
- }
400
- html(e) {
401
- let t = this.rules.block.html.exec(e);
402
- if (t) return {
403
- type: "html",
404
- block: !0,
405
- raw: t[0],
406
- pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
407
- text: t[0]
408
- };
409
- }
410
- def(e) {
411
- let t = this.rules.block.def.exec(e);
412
- if (t) {
413
- let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
414
- return {
415
- type: "def",
416
- tag: e,
417
- raw: t[0],
418
- href: n,
419
- title: r
420
- };
421
- }
422
- }
423
- table(e) {
424
- let t = this.rules.block.table.exec(e);
425
- if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
426
- let n = Ke(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
427
- type: "table",
428
- raw: t[0],
429
- header: [],
430
- align: [],
431
- rows: []
432
- };
433
- if (n.length === r.length) {
434
- for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
435
- for (let e = 0; e < n.length; e++) a.header.push({
436
- text: n[e],
437
- tokens: this.lexer.inline(n[e]),
438
- header: !0,
439
- align: a.align[e]
440
- });
441
- for (let e of i) a.rows.push(Ke(e, a.header.length).map((e, t) => ({
442
- text: e,
443
- tokens: this.lexer.inline(e),
444
- header: !1,
445
- align: a.align[t]
446
- })));
447
- return a;
448
- }
449
- }
450
- lheading(e) {
451
- let t = this.rules.block.lheading.exec(e);
452
- if (t) return {
453
- type: "heading",
454
- raw: t[0],
455
- depth: t[2].charAt(0) === "=" ? 1 : 2,
456
- text: t[1],
457
- tokens: this.lexer.inline(t[1])
458
- };
459
- }
460
- paragraph(e) {
461
- let t = this.rules.block.paragraph.exec(e);
462
- if (t) {
463
- let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
464
- return {
465
- type: "paragraph",
466
- raw: t[0],
467
- text: e,
468
- tokens: this.lexer.inline(e)
469
- };
470
- }
471
- }
472
- text(e) {
473
- let t = this.rules.block.text.exec(e);
474
- if (t) return {
475
- type: "text",
476
- raw: t[0],
477
- text: t[0],
478
- tokens: this.lexer.inline(t[0])
479
- };
480
- }
481
- escape(e) {
482
- let t = this.rules.inline.escape.exec(e);
483
- if (t) return {
484
- type: "escape",
485
- raw: t[0],
486
- text: t[1]
487
- };
488
- }
489
- tag(e) {
490
- let t = this.rules.inline.tag.exec(e);
491
- if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
492
- type: "html",
493
- raw: t[0],
494
- inLink: this.lexer.state.inLink,
495
- inRawBlock: this.lexer.state.inRawBlock,
496
- block: !1,
497
- text: t[0]
498
- };
499
- }
500
- link(e) {
501
- let t = this.rules.inline.link.exec(e);
502
- if (t) {
503
- let e = t[2].trim();
504
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
505
- if (!this.rules.other.endAngleBracket.test(e)) return;
506
- let t = N(e.slice(0, -1), "\\");
507
- if ((e.length - t.length) % 2 == 0) return;
508
- } else {
509
- let e = qe(t[2], "()");
510
- if (e === -2) return;
511
- if (e > -1) {
512
- let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
513
- t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
514
- }
515
- }
516
- let n = t[2], r = "";
517
- if (this.options.pedantic) {
518
- let e = this.rules.other.pedanticHrefTitle.exec(n);
519
- e && (n = e[1], r = e[3]);
520
- } else r = t[3] ? t[3].slice(1, -1) : "";
521
- return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), Je(t, {
522
- href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
523
- title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
524
- }, t[0], this.lexer, this.rules);
525
- }
526
- }
527
- reflink(e, t) {
528
- let n;
529
- if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
530
- let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
531
- if (!e) {
532
- let e = n[0].charAt(0);
533
- return {
534
- type: "text",
535
- raw: e,
536
- text: e
537
- };
538
- }
539
- return Je(n, e, n[0], this.lexer, this.rules);
540
- }
541
- }
542
- emStrong(e, t, n = "") {
543
- let r = this.rules.inline.emStrongLDelim.exec(e);
544
- if (!(!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
545
- let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
546
- for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) != null;) {
547
- if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
548
- if (a = [...i].length, r[3] || r[4]) {
549
- o += a;
550
- continue;
551
- } else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
552
- s += a;
553
- continue;
554
- }
555
- if (o -= a, o > 0) continue;
556
- a = Math.min(a, a + o + s);
557
- let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
558
- if (Math.min(n, a) % 2) {
559
- let e = c.slice(1, -1);
560
- return {
561
- type: "em",
562
- raw: c,
563
- text: e,
564
- tokens: this.lexer.inlineTokens(e)
565
- };
566
- }
567
- let l = c.slice(2, -2);
568
- return {
569
- type: "strong",
570
- raw: c,
571
- text: l,
572
- tokens: this.lexer.inlineTokens(l)
573
- };
574
- }
575
- }
576
- }
577
- codespan(e) {
578
- let t = this.rules.inline.code.exec(e);
579
- if (t) {
580
- let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
581
- return n && r && (e = e.substring(1, e.length - 1)), {
582
- type: "codespan",
583
- raw: t[0],
584
- text: e
585
- };
586
- }
587
- }
588
- br(e) {
589
- let t = this.rules.inline.br.exec(e);
590
- if (t) return {
591
- type: "br",
592
- raw: t[0]
593
- };
594
- }
595
- del(e) {
596
- let t = this.rules.inline.del.exec(e);
597
- if (t) return {
598
- type: "del",
599
- raw: t[0],
600
- text: t[2],
601
- tokens: this.lexer.inlineTokens(t[2])
602
- };
603
- }
604
- autolink(e) {
605
- let t = this.rules.inline.autolink.exec(e);
606
- if (t) {
607
- let e, n;
608
- return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
609
- type: "link",
610
- raw: t[0],
611
- text: e,
612
- href: n,
613
- tokens: [{
614
- type: "text",
615
- raw: e,
616
- text: e
617
- }]
618
- };
619
- }
620
- }
621
- url(e) {
622
- let t;
623
- if (t = this.rules.inline.url.exec(e)) {
624
- let e, n;
625
- if (t[2] === "@") e = t[0], n = "mailto:" + e;
626
- else {
627
- let r;
628
- do
629
- r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
630
- while (r !== t[0]);
631
- e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
632
- }
633
- return {
634
- type: "link",
635
- raw: t[0],
636
- text: e,
637
- href: n,
638
- tokens: [{
639
- type: "text",
640
- raw: e,
641
- text: e
642
- }]
643
- };
644
- }
645
- }
646
- inlineText(e) {
647
- let t = this.rules.inline.text.exec(e);
648
- if (t) {
649
- let e = this.lexer.state.inRawBlock;
650
- return {
651
- type: "text",
652
- raw: t[0],
653
- text: t[0],
654
- escaped: e
655
- };
656
- }
657
- }
658
- }, F = class e {
659
- tokens;
660
- options;
661
- state;
662
- tokenizer;
663
- inlineQueue;
664
- constructor(e) {
665
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || f, this.options.tokenizer = this.options.tokenizer || new P(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
666
- inLink: !1,
667
- inRawBlock: !1,
668
- top: !0
669
- };
670
- let t = {
671
- other: _,
672
- block: A.normal,
673
- inline: j.normal
674
- };
675
- this.options.pedantic ? (t.block = A.pedantic, t.inline = j.pedantic) : this.options.gfm && (t.block = A.gfm, this.options.breaks ? t.inline = j.breaks : t.inline = j.gfm), this.tokenizer.rules = t;
676
- }
677
- static get rules() {
678
- return {
679
- block: A,
680
- inline: j
681
- };
682
- }
683
- static lex(t, n) {
684
- return new e(n).lex(t);
685
- }
686
- static lexInline(t, n) {
687
- return new e(n).inlineTokens(t);
688
- }
689
- lex(e) {
690
- e = e.replace(_.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
691
- for (let e = 0; e < this.inlineQueue.length; e++) {
692
- let t = this.inlineQueue[e];
693
- this.inlineTokens(t.src, t.tokens);
694
- }
695
- return this.inlineQueue = [], this.tokens;
696
- }
697
- blockTokens(e, t = [], n = !1) {
698
- for (this.options.pedantic && (e = e.replace(_.tabCharGlobal, " ").replace(_.spaceLine, "")); e;) {
699
- let r;
700
- if (this.options.extensions?.block?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
701
- if (r = this.tokenizer.space(e)) {
702
- e = e.substring(r.raw.length);
703
- let n = t.at(-1);
704
- r.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(r);
705
- continue;
706
- }
707
- if (r = this.tokenizer.code(e)) {
708
- e = e.substring(r.raw.length);
709
- let n = t.at(-1);
710
- n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.at(-1).src = n.text) : t.push(r);
711
- continue;
712
- }
713
- if (r = this.tokenizer.fences(e)) {
714
- e = e.substring(r.raw.length), t.push(r);
715
- continue;
716
- }
717
- if (r = this.tokenizer.heading(e)) {
718
- e = e.substring(r.raw.length), t.push(r);
719
- continue;
720
- }
721
- if (r = this.tokenizer.hr(e)) {
722
- e = e.substring(r.raw.length), t.push(r);
723
- continue;
724
- }
725
- if (r = this.tokenizer.blockquote(e)) {
726
- e = e.substring(r.raw.length), t.push(r);
727
- continue;
728
- }
729
- if (r = this.tokenizer.list(e)) {
730
- e = e.substring(r.raw.length), t.push(r);
731
- continue;
732
- }
733
- if (r = this.tokenizer.html(e)) {
734
- e = e.substring(r.raw.length), t.push(r);
735
- continue;
736
- }
737
- if (r = this.tokenizer.def(e)) {
738
- e = e.substring(r.raw.length);
739
- let n = t.at(-1);
740
- n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
741
- href: r.href,
742
- title: r.title
743
- }, t.push(r));
744
- continue;
745
- }
746
- if (r = this.tokenizer.table(e)) {
747
- e = e.substring(r.raw.length), t.push(r);
748
- continue;
749
- }
750
- if (r = this.tokenizer.lheading(e)) {
751
- e = e.substring(r.raw.length), t.push(r);
752
- continue;
753
- }
754
- let i = e;
755
- if (this.options.extensions?.startBlock) {
756
- let t = Infinity, n = e.slice(1), r;
757
- this.options.extensions.startBlock.forEach((e) => {
758
- r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
759
- }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
760
- }
761
- if (this.state.top && (r = this.tokenizer.paragraph(i))) {
762
- let a = t.at(-1);
763
- n && a?.type === "paragraph" ? (a.raw += (a.raw.endsWith("\n") ? "" : "\n") + r.raw, a.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
764
- continue;
765
- }
766
- if (r = this.tokenizer.text(e)) {
767
- e = e.substring(r.raw.length);
768
- let n = t.at(-1);
769
- n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + r.raw, n.text += "\n" + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(r);
770
- continue;
771
- }
772
- if (e) {
773
- let t = "Infinite loop on byte: " + e.charCodeAt(0);
774
- if (this.options.silent) {
775
- console.error(t);
776
- break;
777
- } else throw Error(t);
778
- }
779
- }
780
- return this.state.top = !0, t;
781
- }
782
- inline(e, t = []) {
783
- return this.inlineQueue.push({
784
- src: e,
785
- tokens: t
786
- }), t;
787
- }
788
- inlineTokens(e, t = []) {
789
- let n = e, r = null;
790
- if (this.tokens.links) {
791
- let e = Object.keys(this.tokens.links);
792
- if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;) e.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
793
- }
794
- for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
795
- let i;
796
- for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null;) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
797
- n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
798
- let a = !1, o = "";
799
- for (; e;) {
800
- a || (o = ""), a = !1;
801
- let r;
802
- if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
803
- if (r = this.tokenizer.escape(e)) {
804
- e = e.substring(r.raw.length), t.push(r);
805
- continue;
806
- }
807
- if (r = this.tokenizer.tag(e)) {
808
- e = e.substring(r.raw.length), t.push(r);
809
- continue;
810
- }
811
- if (r = this.tokenizer.link(e)) {
812
- e = e.substring(r.raw.length), t.push(r);
813
- continue;
814
- }
815
- if (r = this.tokenizer.reflink(e, this.tokens.links)) {
816
- e = e.substring(r.raw.length);
817
- let n = t.at(-1);
818
- r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
819
- continue;
820
- }
821
- if (r = this.tokenizer.emStrong(e, n, o)) {
822
- e = e.substring(r.raw.length), t.push(r);
823
- continue;
824
- }
825
- if (r = this.tokenizer.codespan(e)) {
826
- e = e.substring(r.raw.length), t.push(r);
827
- continue;
828
- }
829
- if (r = this.tokenizer.br(e)) {
830
- e = e.substring(r.raw.length), t.push(r);
831
- continue;
832
- }
833
- if (r = this.tokenizer.del(e)) {
834
- e = e.substring(r.raw.length), t.push(r);
835
- continue;
836
- }
837
- if (r = this.tokenizer.autolink(e)) {
838
- e = e.substring(r.raw.length), t.push(r);
839
- continue;
840
- }
841
- if (!this.state.inLink && (r = this.tokenizer.url(e))) {
842
- e = e.substring(r.raw.length), t.push(r);
843
- continue;
844
- }
845
- let i = e;
846
- if (this.options.extensions?.startInline) {
847
- let t = Infinity, n = e.slice(1), r;
848
- this.options.extensions.startInline.forEach((e) => {
849
- r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
850
- }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
851
- }
852
- if (r = this.tokenizer.inlineText(i)) {
853
- e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (o = r.raw.slice(-1)), a = !0;
854
- let n = t.at(-1);
855
- n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
856
- continue;
857
- }
858
- if (e) {
859
- let t = "Infinite loop on byte: " + e.charCodeAt(0);
860
- if (this.options.silent) {
861
- console.error(t);
862
- break;
863
- } else throw Error(t);
864
- }
865
- }
866
- return t;
867
- }
868
- }, I = class {
869
- options;
870
- parser;
871
- constructor(e) {
872
- this.options = e || f;
873
- }
874
- space(e) {
875
- return "";
876
- }
877
- code({ text: e, lang: t, escaped: n }) {
878
- let r = (t || "").match(_.notSpaceStart)?.[0], i = e.replace(_.endingNewline, "") + "\n";
879
- return r ? "<pre><code class=\"language-" + M(r) + "\">" + (n ? i : M(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : M(i, !0)) + "</code></pre>\n";
880
- }
881
- blockquote({ tokens: e }) {
882
- return `<blockquote>
883
- ${this.parser.parse(e)}</blockquote>
884
- `;
885
- }
886
- html({ text: e }) {
887
- return e;
888
- }
889
- def(e) {
890
- return "";
891
- }
892
- heading({ tokens: e, depth: t }) {
893
- return `<h${t}>${this.parser.parseInline(e)}</h${t}>
894
- `;
895
- }
896
- hr(e) {
897
- return "<hr>\n";
898
- }
899
- list(e) {
900
- let t = e.ordered, n = e.start, r = "";
901
- for (let t = 0; t < e.items.length; t++) {
902
- let n = e.items[t];
903
- r += this.listitem(n);
904
- }
905
- let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
906
- return "<" + i + a + ">\n" + r + "</" + i + ">\n";
907
- }
908
- listitem(e) {
909
- let t = "";
910
- if (e.task) {
911
- let n = this.checkbox({ checked: !!e.checked });
912
- e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + M(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({
913
- type: "text",
914
- raw: n + " ",
915
- text: n + " ",
916
- escaped: !0
917
- }) : t += n + " ";
918
- }
919
- return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
920
- `;
921
- }
922
- checkbox({ checked: e }) {
923
- return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\">";
924
- }
925
- paragraph({ tokens: e }) {
926
- return `<p>${this.parser.parseInline(e)}</p>
927
- `;
928
- }
929
- table(e) {
930
- let t = "", n = "";
931
- for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
932
- t += this.tablerow({ text: n });
933
- let r = "";
934
- for (let t = 0; t < e.rows.length; t++) {
935
- let i = e.rows[t];
936
- n = "";
937
- for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
938
- r += this.tablerow({ text: n });
939
- }
940
- return r &&= `<tbody>${r}</tbody>`, "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
941
- }
942
- tablerow({ text: e }) {
943
- return `<tr>
944
- ${e}</tr>
945
- `;
946
- }
947
- tablecell(e) {
948
- let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
949
- return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
950
- `;
951
- }
952
- strong({ tokens: e }) {
953
- return `<strong>${this.parser.parseInline(e)}</strong>`;
954
- }
955
- em({ tokens: e }) {
956
- return `<em>${this.parser.parseInline(e)}</em>`;
957
- }
958
- codespan({ text: e }) {
959
- return `<code>${M(e, !0)}</code>`;
960
- }
961
- br(e) {
962
- return "<br>";
963
- }
964
- del({ tokens: e }) {
965
- return `<del>${this.parser.parseInline(e)}</del>`;
966
- }
967
- link({ href: e, title: t, tokens: n }) {
968
- let r = this.parser.parseInline(n), i = Ge(e);
969
- if (i === null) return r;
970
- e = i;
971
- let a = "<a href=\"" + e + "\"";
972
- return t && (a += " title=\"" + M(t) + "\""), a += ">" + r + "</a>", a;
973
- }
974
- image({ href: e, title: t, text: n, tokens: r }) {
975
- r && (n = this.parser.parseInline(r, this.parser.textRenderer));
976
- let i = Ge(e);
977
- if (i === null) return M(n);
978
- e = i;
979
- let a = `<img src="${e}" alt="${n}"`;
980
- return t && (a += ` title="${M(t)}"`), a += ">", a;
981
- }
982
- text(e) {
983
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : M(e.text);
984
- }
985
- }, L = class {
986
- strong({ text: e }) {
987
- return e;
988
- }
989
- em({ text: e }) {
990
- return e;
991
- }
992
- codespan({ text: e }) {
993
- return e;
994
- }
995
- del({ text: e }) {
996
- return e;
997
- }
998
- html({ text: e }) {
999
- return e;
1000
- }
1001
- text({ text: e }) {
1002
- return e;
1003
- }
1004
- link({ text: e }) {
1005
- return "" + e;
1006
- }
1007
- image({ text: e }) {
1008
- return "" + e;
1009
- }
1010
- br() {
1011
- return "";
1012
- }
1013
- }, R = class e {
1014
- options;
1015
- renderer;
1016
- textRenderer;
1017
- constructor(e) {
1018
- this.options = e || f, this.options.renderer = this.options.renderer || new I(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
1019
- }
1020
- static parse(t, n) {
1021
- return new e(n).parse(t);
1022
- }
1023
- static parseInline(t, n) {
1024
- return new e(n).parseInline(t);
1025
- }
1026
- parse(e, t = !0) {
1027
- let n = "";
1028
- for (let r = 0; r < e.length; r++) {
1029
- let i = e[r];
1030
- if (this.options.extensions?.renderers?.[i.type]) {
1031
- let e = i, t = this.options.extensions.renderers[e.type].call({ parser: this }, e);
1032
- if (t !== !1 || ![
1033
- "space",
1034
- "hr",
1035
- "heading",
1036
- "code",
1037
- "table",
1038
- "blockquote",
1039
- "list",
1040
- "html",
1041
- "def",
1042
- "paragraph",
1043
- "text"
1044
- ].includes(e.type)) {
1045
- n += t || "";
1046
- continue;
1047
- }
1048
- }
1049
- let a = i;
1050
- switch (a.type) {
1051
- case "space":
1052
- n += this.renderer.space(a);
1053
- continue;
1054
- case "hr":
1055
- n += this.renderer.hr(a);
1056
- continue;
1057
- case "heading":
1058
- n += this.renderer.heading(a);
1059
- continue;
1060
- case "code":
1061
- n += this.renderer.code(a);
1062
- continue;
1063
- case "table":
1064
- n += this.renderer.table(a);
1065
- continue;
1066
- case "blockquote":
1067
- n += this.renderer.blockquote(a);
1068
- continue;
1069
- case "list":
1070
- n += this.renderer.list(a);
1071
- continue;
1072
- case "html":
1073
- n += this.renderer.html(a);
1074
- continue;
1075
- case "def":
1076
- n += this.renderer.def(a);
1077
- continue;
1078
- case "paragraph":
1079
- n += this.renderer.paragraph(a);
1080
- continue;
1081
- case "text": {
1082
- let i = a, o = this.renderer.text(i);
1083
- for (; r + 1 < e.length && e[r + 1].type === "text";) i = e[++r], o += "\n" + this.renderer.text(i);
1084
- t ? n += this.renderer.paragraph({
1085
- type: "paragraph",
1086
- raw: o,
1087
- text: o,
1088
- tokens: [{
1089
- type: "text",
1090
- raw: o,
1091
- text: o,
1092
- escaped: !0
1093
- }]
1094
- }) : n += o;
1095
- continue;
1096
- }
1097
- default: {
1098
- let e = "Token with \"" + a.type + "\" type was not found.";
1099
- if (this.options.silent) return console.error(e), "";
1100
- throw Error(e);
1101
- }
1102
- }
1103
- }
1104
- return n;
1105
- }
1106
- parseInline(e, t = this.renderer) {
1107
- let n = "";
1108
- for (let r = 0; r < e.length; r++) {
1109
- let i = e[r];
1110
- if (this.options.extensions?.renderers?.[i.type]) {
1111
- let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1112
- if (e !== !1 || ![
1113
- "escape",
1114
- "html",
1115
- "link",
1116
- "image",
1117
- "strong",
1118
- "em",
1119
- "codespan",
1120
- "br",
1121
- "del",
1122
- "text"
1123
- ].includes(i.type)) {
1124
- n += e || "";
1125
- continue;
1126
- }
1127
- }
1128
- let a = i;
1129
- switch (a.type) {
1130
- case "escape":
1131
- n += t.text(a);
1132
- break;
1133
- case "html":
1134
- n += t.html(a);
1135
- break;
1136
- case "link":
1137
- n += t.link(a);
1138
- break;
1139
- case "image":
1140
- n += t.image(a);
1141
- break;
1142
- case "strong":
1143
- n += t.strong(a);
1144
- break;
1145
- case "em":
1146
- n += t.em(a);
1147
- break;
1148
- case "codespan":
1149
- n += t.codespan(a);
1150
- break;
1151
- case "br":
1152
- n += t.br(a);
1153
- break;
1154
- case "del":
1155
- n += t.del(a);
1156
- break;
1157
- case "text":
1158
- n += t.text(a);
1159
- break;
1160
- default: {
1161
- let e = "Token with \"" + a.type + "\" type was not found.";
1162
- if (this.options.silent) return console.error(e), "";
1163
- throw Error(e);
1164
- }
1165
- }
1166
- }
1167
- return n;
1168
- }
1169
- }, z = class {
1170
- options;
1171
- block;
1172
- constructor(e) {
1173
- this.options = e || f;
1174
- }
1175
- static passThroughHooks = /* @__PURE__ */ new Set([
1176
- "preprocess",
1177
- "postprocess",
1178
- "processAllTokens",
1179
- "emStrongMask"
1180
- ]);
1181
- static passThroughHooksRespectAsync = /* @__PURE__ */ new Set([
1182
- "preprocess",
1183
- "postprocess",
1184
- "processAllTokens"
1185
- ]);
1186
- preprocess(e) {
1187
- return e;
1188
- }
1189
- postprocess(e) {
1190
- return e;
1191
- }
1192
- processAllTokens(e) {
1193
- return e;
1194
- }
1195
- emStrongMask(e) {
1196
- return e;
1197
- }
1198
- provideLexer() {
1199
- return this.block ? F.lex : F.lexInline;
1200
- }
1201
- provideParser() {
1202
- return this.block ? R.parse : R.parseInline;
1203
- }
1204
- }, B = new class {
1205
- defaults = d();
1206
- options = this.setOptions;
1207
- parse = this.parseMarkdown(!0);
1208
- parseInline = this.parseMarkdown(!1);
1209
- Parser = R;
1210
- Renderer = I;
1211
- TextRenderer = L;
1212
- Lexer = F;
1213
- Tokenizer = P;
1214
- Hooks = z;
1215
- constructor(...e) {
1216
- this.use(...e);
1217
- }
1218
- walkTokens(e, t) {
1219
- let n = [];
1220
- for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1221
- case "table": {
1222
- let e = r;
1223
- for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
1224
- for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
1225
- break;
1226
- }
1227
- case "list": {
1228
- let e = r;
1229
- n = n.concat(this.walkTokens(e.items, t));
1230
- break;
1231
- }
1232
- default: {
1233
- let e = r;
1234
- this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
1235
- let i = e[r].flat(Infinity);
1236
- n = n.concat(this.walkTokens(i, t));
1237
- }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
1238
- }
1239
- }
1240
- return n;
1241
- }
1242
- use(...e) {
1243
- let t = this.defaults.extensions || {
1244
- renderers: {},
1245
- childTokens: {}
1246
- };
1247
- return e.forEach((e) => {
1248
- let n = { ...e };
1249
- if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
1250
- if (!e.name) throw Error("extension name required");
1251
- if ("renderer" in e) {
1252
- let n = t.renderers[e.name];
1253
- n ? t.renderers[e.name] = function(...t) {
1254
- let r = e.renderer.apply(this, t);
1255
- return r === !1 && (r = n.apply(this, t)), r;
1256
- } : t.renderers[e.name] = e.renderer;
1257
- }
1258
- if ("tokenizer" in e) {
1259
- if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
1260
- let n = t[e.level];
1261
- n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
1262
- }
1263
- "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
1264
- }), n.extensions = t), e.renderer) {
1265
- let t = this.defaults.renderer || new I(this.defaults);
1266
- for (let n in e.renderer) {
1267
- if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
1268
- if (["options", "parser"].includes(n)) continue;
1269
- let r = n, i = e.renderer[r], a = t[r];
1270
- t[r] = (...e) => {
1271
- let n = i.apply(t, e);
1272
- return n === !1 && (n = a.apply(t, e)), n || "";
1273
- };
1274
- }
1275
- n.renderer = t;
1276
- }
1277
- if (e.tokenizer) {
1278
- let t = this.defaults.tokenizer || new P(this.defaults);
1279
- for (let n in e.tokenizer) {
1280
- if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
1281
- if ([
1282
- "options",
1283
- "rules",
1284
- "lexer"
1285
- ].includes(n)) continue;
1286
- let r = n, i = e.tokenizer[r], a = t[r];
1287
- t[r] = (...e) => {
1288
- let n = i.apply(t, e);
1289
- return n === !1 && (n = a.apply(t, e)), n;
1290
- };
1291
- }
1292
- n.tokenizer = t;
1293
- }
1294
- if (e.hooks) {
1295
- let t = this.defaults.hooks || new z();
1296
- for (let n in e.hooks) {
1297
- if (!(n in t)) throw Error(`hook '${n}' does not exist`);
1298
- if (["options", "block"].includes(n)) continue;
1299
- let r = n, i = e.hooks[r], a = t[r];
1300
- z.passThroughHooks.has(n) ? t[r] = (e) => {
1301
- if (this.defaults.async && z.passThroughHooksRespectAsync.has(n)) return (async () => {
1302
- let n = await i.call(t, e);
1303
- return a.call(t, n);
1304
- })();
1305
- let r = i.call(t, e);
1306
- return a.call(t, r);
1307
- } : t[r] = (...e) => {
1308
- if (this.defaults.async) return (async () => {
1309
- let n = await i.apply(t, e);
1310
- return n === !1 && (n = await a.apply(t, e)), n;
1311
- })();
1312
- let n = i.apply(t, e);
1313
- return n === !1 && (n = a.apply(t, e)), n;
1314
- };
1315
- }
1316
- n.hooks = t;
1317
- }
1318
- if (e.walkTokens) {
1319
- let t = this.defaults.walkTokens, r = e.walkTokens;
1320
- n.walkTokens = function(e) {
1321
- let n = [];
1322
- return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
1323
- };
1324
- }
1325
- this.defaults = {
1326
- ...this.defaults,
1327
- ...n
1328
- };
1329
- }), this;
1330
- }
1331
- setOptions(e) {
1332
- return this.defaults = {
1333
- ...this.defaults,
1334
- ...e
1335
- }, this;
1336
- }
1337
- lexer(e, t) {
1338
- return F.lex(e, t ?? this.defaults);
1339
- }
1340
- parser(e, t) {
1341
- return R.parse(e, t ?? this.defaults);
1342
- }
1343
- parseMarkdown(e) {
1344
- return (t, n) => {
1345
- let r = { ...n }, i = {
1346
- ...this.defaults,
1347
- ...r
1348
- }, a = this.onError(!!i.silent, !!i.async);
1349
- if (this.defaults.async === !0 && r.async === !1) return a(/* @__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."));
1350
- if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
1351
- if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1352
- if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
1353
- let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer() : e ? F.lex : F.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
1354
- i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
1355
- let o = await (i.hooks ? await i.hooks.provideParser() : e ? R.parse : R.parseInline)(a, i);
1356
- return i.hooks ? await i.hooks.postprocess(o) : o;
1357
- })().catch(a);
1358
- try {
1359
- i.hooks && (t = i.hooks.preprocess(t));
1360
- let n = (i.hooks ? i.hooks.provideLexer() : e ? F.lex : F.lexInline)(t, i);
1361
- i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
1362
- let r = (i.hooks ? i.hooks.provideParser() : e ? R.parse : R.parseInline)(n, i);
1363
- return i.hooks && (r = i.hooks.postprocess(r)), r;
1364
- } catch (e) {
1365
- return a(e);
1366
- }
1367
- };
1368
- }
1369
- onError(e, t) {
1370
- return (n) => {
1371
- if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
1372
- let e = "<p>An error occurred:</p><pre>" + M(n.message + "", !0) + "</pre>";
1373
- return t ? Promise.resolve(e) : e;
1374
- }
1375
- if (t) return Promise.reject(n);
1376
- throw n;
1377
- };
1378
- }
1379
- }();
1380
- function V(e, t) {
1381
- return B.parse(e, t);
1382
- }
1383
- V.options = V.setOptions = function(e) {
1384
- return B.setOptions(e), V.defaults = B.defaults, p(V.defaults), V;
1385
- }, V.getDefaults = d, V.defaults = f, V.use = function(...e) {
1386
- return B.use(...e), V.defaults = B.defaults, p(V.defaults), V;
1387
- }, V.walkTokens = function(e, t) {
1388
- return B.walkTokens(e, t);
1389
- }, V.parseInline = B.parseInline, V.Parser = R, V.parser = R.parse, V.Renderer = I, V.TextRenderer = L, V.Lexer = F, V.lexer = F.lex, V.Tokenizer = P, V.Hooks = z, V.parse = V, V.options, V.setOptions, V.use, V.walkTokens, V.parseInline, R.parse, F.lex;
1390
- //#endregion
1391
- //#region node_modules/.pnpm/ts-dedent@2.3.0/node_modules/ts-dedent/esm/index.js
1392
- function Xe(e) {
1393
- var t = [...arguments].slice(1), n = Array.from(typeof e == "string" ? [e] : e);
1394
- n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
1395
- var r = n.reduce(function(e, t) {
1396
- var n = t.match(/\n([\t ]+|(?!\s).)/g);
1397
- return n ? e.concat(n.map(function(e) {
1398
- return e.match(/[\t ]/g)?.length ?? 0;
1399
- })) : e;
1400
- }, []);
1401
- if (r.length) {
1402
- var i = RegExp(`
1403
- [ ]{${Math.min.apply(Math, r)}}`, "g");
1404
- n = n.map(function(e) {
1405
- return e.replace(i, "\n");
1406
- });
1407
- }
1408
- n[0] = n[0].replace(/^\r?\n/, "");
1409
- var a = n[0];
1410
- return t.forEach(function(e, t) {
1411
- var r = a.match(/(?:^|\n)( *)$/), i = r ? r[1] : "", o = e;
1412
- typeof e == "string" && e.includes("\n") && (o = String(e).split("\n").map(function(e, t) {
1413
- return t === 0 ? e : `${i}${e}`;
1414
- }).join("\n")), a += o + n[t + 1];
1415
- }), a;
1416
- }
1417
- //#endregion
1418
- //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-AQDTSKZB.mjs
1419
- var H = typeof performance < "u" && typeof performance.now == "function", U = /* @__PURE__ */ n(() => H ? performance.now() : 0, "now"), W = "🧜 ", Ze = "Mermaid render", Qe = "Mermaid", $e = {
1420
- parse: "tertiary",
1421
- prepare: "secondary",
1422
- measure: "primary",
1423
- layout: "primary-dark",
1424
- layoutCore: "error",
1425
- draw: "primary-light",
1426
- paint: "secondary-dark",
1427
- serialize: "tertiary-dark",
1428
- render: "primary-light"
1429
- };
1430
- (class {
1431
- constructor() {
1432
- this.enabled = !1, this.autoPrint = !0, this.records = [], this.maxRecords = 200, this.roots = [], this.stack = [], this.buckets = {};
1433
- }
1434
- static {
1435
- n(this, "Profiler");
1436
- }
1437
- enable() {
1438
- return this.enabled = !0, this;
1439
- }
1440
- disable() {
1441
- return this.enabled = !1, this;
1442
- }
1443
- start(e) {
1444
- this.enabled && (this.roots = [], this.stack = [], this.buckets = {}, this.begin(e));
1445
- }
1446
- tickSync(e, t) {
1447
- if (!this.enabled) return t();
1448
- let n = U();
1449
- try {
1450
- return t();
1451
- } finally {
1452
- this.buckets[e] = (this.buckets[e] ?? 0) + (U() - n);
1453
- }
1454
- }
1455
- async tick(e, t) {
1456
- if (!this.enabled) return t();
1457
- let n = U();
1458
- try {
1459
- return await t();
1460
- } finally {
1461
- this.buckets[e] = (this.buckets[e] ?? 0) + (U() - n);
1462
- }
1463
- }
1464
- stop() {
1465
- if (!this.enabled) return;
1466
- for (; this.stack.length > 0;) this.end();
1467
- let e = this.roots.at(-1), t = this.runLabel ?? e?.name;
1468
- return e && (this.records.push({
1469
- label: t ?? e.name,
1470
- tree: e,
1471
- buckets: { ...this.buckets }
1472
- }), this.records.length > this.maxRecords && this.records.splice(0, this.records.length - this.maxRecords), this.autoPrint && this.printSummary(e, t)), this.runLabel = void 0, e;
1473
- }
1474
- begin(e) {
1475
- if (!this.enabled) return;
1476
- let t = {
1477
- name: e,
1478
- start: U(),
1479
- duration: -1,
1480
- children: []
1481
- }, n = this.stack.at(-1);
1482
- if (n ? n.children.push(t) : this.roots.push(t), this.stack.push(t), H && typeof performance.mark == "function") try {
1483
- performance.mark(`${W}${e} \u25B6`);
1484
- } catch {}
1485
- }
1486
- end() {
1487
- if (!this.enabled) return;
1488
- let e = this.stack.pop();
1489
- if (!e) return;
1490
- let t = U();
1491
- if (e.duration = t - e.start, H && typeof performance.measure == "function") try {
1492
- performance.measure(`${W}${e.name}`, {
1493
- start: e.start,
1494
- end: t,
1495
- detail: { devtools: {
1496
- dataType: "track-entry",
1497
- track: Ze,
1498
- trackGroup: Qe,
1499
- color: $e[e.name] ?? "primary",
1500
- tooltipText: `${e.name} \u2014 ${e.duration.toFixed(1)} ms`
1501
- } }
1502
- });
1503
- } catch {}
1504
- }
1505
- async span(e, t) {
1506
- if (!this.enabled) return t();
1507
- this.begin(e);
1508
- try {
1509
- return await t();
1510
- } finally {
1511
- this.end();
1512
- }
1513
- }
1514
- report() {
1515
- return this.records.at(-1)?.tree ?? this.roots.at(-1);
1516
- }
1517
- clear() {
1518
- this.records.length = 0, this.roots = [], this.stack = [], this.runLabel = void 0;
1519
- }
1520
- reset() {
1521
- this.roots = [], this.stack = [];
1522
- }
1523
- printSummary(e = this.report(), t) {
1524
- if (!e) return;
1525
- let r = e.duration, i = t && t !== e.name ? `${e.name} [${t}]` : e.name, a = ["ms % phase"], o = /* @__PURE__ */ n((e, t) => {
1526
- let n = " ".repeat(t), i = e.duration.toFixed(1).padStart(8), s = r > 0 ? `${(e.duration / r * 100).toFixed(0).padStart(3)}%` : " -";
1527
- a.push(`${i} ${s} ${n}${e.name}`);
1528
- for (let n of e.children) o(n, t + 1);
1529
- if (e.children.length > 0) {
1530
- let t = e.children.reduce((e, t) => e + t.duration, 0), r = e.duration - t;
1531
- if (r > .5) {
1532
- let e = r.toFixed(1).padStart(8);
1533
- a.push(`${e} ${n} (self)`);
1534
- }
1535
- }
1536
- }, "walk");
1537
- o(e, 0);
1538
- let s = Object.keys(this.buckets);
1539
- if (s.length > 0) {
1540
- a.push("—— buckets (summed) ——");
1541
- for (let e of s) a.push(`${this.buckets[e].toFixed(1).padStart(8)} ${e}`);
1542
- }
1543
- console.log(`${W}mermaid render profile \xB7 ${i}
1544
- ${a.join("\n")}`);
1545
- }
1546
- }), globalThis.injected ??= {
1547
- includeLargeFeatures: !0,
1548
- profiling: !1,
1549
- version: "0.0.0"
1550
- };
1551
- function et(e, { markdownAutoWrap: t }) {
1552
- return Xe(e.replace(/<br\/>/g, "\n").replace(/\n{2,}/g, "\n"));
1553
- }
1554
- n(et, "preprocessMarkdown");
1555
- function tt(e) {
1556
- return e.split(/\\n|\n|<br\s*\/?>/gi).map((e) => e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map((e) => ({
1557
- content: e,
1558
- type: "normal"
1559
- })) ?? []);
1560
- }
1561
- n(tt, "nonMarkdownToLines");
1562
- function G(e, t = {}) {
1563
- let r = et(e, t), i = V.lexer(r), a = [[]], o = 0;
1564
- function s(e, t = "normal") {
1565
- e.type === "text" ? e.text.split("\n").forEach((e, n) => {
1566
- n !== 0 && (o++, a.push([])), e.split(" ").forEach((e) => {
1567
- e = e.replace(/&#39;/g, "'"), e && a[o].push({
1568
- content: e,
1569
- type: t
1570
- });
1571
- });
1572
- }) : e.type === "strong" || e.type === "em" ? e.tokens.forEach((t) => {
1573
- s(t, e.type);
1574
- }) : e.type === "html" && a[o].push({
1575
- content: e.text,
1576
- type: "normal"
1577
- });
1578
- }
1579
- return n(s, "processNode"), i.forEach((e) => {
1580
- e.type === "paragraph" ? e.tokens?.forEach((e) => {
1581
- s(e);
1582
- }) : e.type === "html" ? a[o].push({
1583
- content: e.text,
1584
- type: "normal"
1585
- }) : a[o].push({
1586
- content: e.raw,
1587
- type: "normal"
1588
- });
1589
- }), a;
1590
- }
1591
- n(G, "markdownToLines");
1592
- function nt(e) {
1593
- return e ? `<p>${e.replace(/\\n|\n/g, "<br />")}</p>` : "";
1594
- }
1595
- n(nt, "nonMarkdownToHTML");
1596
- function rt(t, { markdownAutoWrap: r } = {}) {
1597
- let i = V.lexer(t);
1598
- function a(t) {
1599
- return t.type === "text" ? r === !1 ? t.text.replace(/\n */g, "<br/>").replace(/ /g, "&nbsp;") : t.text.replace(/\n */g, "<br/>") : t.type === "strong" ? `<strong>${t.tokens?.map(a).join("")}</strong>` : t.type === "em" ? `<em>${t.tokens?.map(a).join("")}</em>` : t.type === "paragraph" ? `<p>${t.tokens?.map(a).join("")}</p>` : t.type === "space" ? "" : t.type === "html" ? `${t.text}` : t.type === "escape" ? t.text : (e.warn(`Unsupported markdown: ${t.type}`), t.raw);
1600
- }
1601
- return n(a, "output"), i.map(a).join("");
1602
- }
1603
- n(rt, "markdownToHTML");
1604
- var it = (function(e) {
1605
- var t = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || function(e) {
1606
- return setTimeout(e, 16);
1607
- };
1608
- function r() {
1609
- var n = this;
1610
- n.reads = [], n.writes = [], n.raf = t.bind(e);
1611
- }
1612
- n(r, "FastDom"), r.prototype = {
1613
- constructor: r,
1614
- runTasks: /* @__PURE__ */ n(function(e) {
1615
- for (var t; t = e.shift();) t();
1616
- }, "runTasks"),
1617
- measure: /* @__PURE__ */ n(function(e, t) {
1618
- var n = t ? e.bind(t) : e;
1619
- return this.reads.push(n), i(this), n;
1620
- }, "measure"),
1621
- mutate: /* @__PURE__ */ n(function(e, t) {
1622
- var n = t ? e.bind(t) : e;
1623
- return this.writes.push(n), i(this), n;
1624
- }, "mutate"),
1625
- clear: /* @__PURE__ */ n(function(e) {
1626
- return o(this.reads, e) || o(this.writes, e);
1627
- }, "clear"),
1628
- extend: /* @__PURE__ */ n(function(e) {
1629
- if (typeof e != "object") throw Error("expected object");
1630
- var t = Object.create(this);
1631
- return s(t, e), t.fastdom = this, t.initialize && t.initialize(), t;
1632
- }, "extend"),
1633
- catch: null
1634
- };
1635
- function i(e) {
1636
- e.scheduled || (e.scheduled = !0, e.raf(a.bind(null, e)));
1637
- }
1638
- n(i, "scheduleFlush");
1639
- function a(e) {
1640
- var t = e.writes, n = e.reads, r;
1641
- try {
1642
- n.length, e.runTasks(n), t.length, e.runTasks(t);
1643
- } catch (e) {
1644
- r = e;
1645
- }
1646
- if (e.scheduled = !1, (n.length || t.length) && i(e), r) if (r.message, e.catch) e.catch(r);
1647
- else throw r;
1648
- }
1649
- n(a, "flush");
1650
- function o(e, t) {
1651
- var n = e.indexOf(t);
1652
- return !!~n && !!e.splice(n, 1);
1653
- }
1654
- n(o, "remove");
1655
- function s(e, t) {
1656
- for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
1657
- }
1658
- return n(s, "mixin"), e.fastdom = e.fastdom || new r();
1659
- })(typeof window < "u" ? window : globalThis), at = {
1660
- initialize: /* @__PURE__ */ n(function() {
1661
- this._tasks = /* @__PURE__ */ new Map();
1662
- }, "initialize"),
1663
- mutate: /* @__PURE__ */ n(function(e, t) {
1664
- return K(this, "mutate", e, t);
1665
- }, "mutate"),
1666
- measure: /* @__PURE__ */ n(function(e, t) {
1667
- return K(this, "measure", e, t);
1668
- }, "measure"),
1669
- clear: /* @__PURE__ */ n(function(e) {
1670
- var t = this._tasks, n = t.get(e);
1671
- this.fastdom.clear(n), t.delete(e);
1672
- }, "clear")
1673
- };
1674
- function K(e, t, n, r) {
1675
- var i = e._tasks, a = e.fastdom, o, s = new Promise(function(e, c) {
1676
- o = a[t](function() {
1677
- i.delete(s);
1678
- try {
1679
- e(r ? n.call(r) : n());
1680
- } catch (e) {
1681
- c(e);
1682
- }
1683
- }, r);
1684
- });
1685
- return i.set(s, o), s;
1686
- }
1687
- n(K, "create");
1688
- var { initialize: ot, mutate: st, measure: ct, clear: lt } = at, ut = at, dt = it.extend({ raf(e) {
1689
- typeof queueMicrotask == "function" ? queueMicrotask(e) : setTimeout(e, 0);
1690
- } }).extend(ut);
1691
- function ft(e) {
1692
- return Intl.Segmenter ? [...new Intl.Segmenter().segment(e)].map((e) => e.segment) : [...e];
1693
- }
1694
- n(ft, "splitTextToChars");
1695
- function pt(e, t) {
1696
- return q(e, [], ft(t.content), t.type);
1697
- }
1698
- n(pt, "splitWordToFitWidth");
1699
- function q(e, t, n, r) {
1700
- if (n.length === 0) return [{
1701
- content: t.join(""),
1702
- type: r
1703
- }, {
1704
- content: "",
1705
- type: r
1706
- }];
1707
- let [i, ...a] = n, o = [...t, i];
1708
- return e([{
1709
- content: o.join(""),
1710
- type: r
1711
- }]) ? q(e, o, a, r) : (t.length === 0 && i && (t.push(i), n.shift()), [{
1712
- content: t.join(""),
1713
- type: r
1714
- }, {
1715
- content: n.join(""),
1716
- type: r
1717
- }]);
1718
- }
1719
- n(q, "splitWordToFitWidthRecursion");
1720
- function mt(e, t) {
1721
- if (e.some(({ content: e }) => e.includes("\n"))) throw Error("splitLineToFitWidth does not support newlines in the line");
1722
- return J(e, t);
1723
- }
1724
- n(mt, "splitLineToFitWidth");
1725
- function J(e, t, n = [], r = []) {
1726
- if (e.length === 0) return r.length > 0 && n.push(r), n.length > 0 ? n : [];
1727
- let i = "";
1728
- e[0].content === " " && (i = " ", e.shift());
1729
- let a = e.shift() ?? {
1730
- content: " ",
1731
- type: "normal"
1732
- }, o = [...r];
1733
- if (i !== "" && o.push({
1734
- content: i,
1735
- type: "normal"
1736
- }), o.push(a), t(o)) return J(e, t, n, o);
1737
- if (r.length > 0) n.push(r), e.unshift(a);
1738
- else if (a.content) {
1739
- let [r, i] = pt(t, a);
1740
- n.push([r]), i.content && e.unshift(i);
1741
- }
1742
- return J(e, t, n);
1743
- }
1744
- n(J, "splitLineToFitWidthRecursion");
1745
- function Y(e, t) {
1746
- t && e.attr("style", t);
1747
- }
1748
- n(Y, "applyStyle");
1749
- var ht = 16384;
1750
- async function X(e, t, n, c, l = !1, u = o(), d = 0) {
1751
- let f = e.append("foreignObject");
1752
- f.attr("width", `${Math.min(10 * n, ht)}px`), f.attr("height", `${Math.min(10 * n, ht)}px`);
1753
- let p = f.append("xhtml:div"), m = i(t.label) ? await r(t.label.replace(a.lineBreakRegex, "\n"), u) : s(t.label, u), h = t.isNode ? "nodeLabel" : "edgeLabel", g = p.append("span");
1754
- g.html(m), Y(g, t.labelStyle), g.attr("class", `${h} ${c}`), Y(p, t.labelStyle), p.style("display", "table-cell"), p.style("white-space", "nowrap"), p.style("line-height", "1.5"), n !== Infinity && (p.style("max-width", n + "px"), p.style("text-align", "center")), p.attr("xmlns", "http://www.w3.org/1999/xhtml"), l && p.attr("class", "labelBkg");
1755
- let _ = await dt.measure(() => p.node().getBoundingClientRect());
1756
- return _.width === n ? (p.style("display", "table"), p.style("white-space", "break-spaces"), p.style("width", n + "px")) : _.width < d && (p.style("display", "table"), p.style("width", d + "px"), p.style("text-align", "center")), f.node();
1757
- }
1758
- n(X, "addHtmlSpan");
1759
- function Z(e, t, n, r = !1) {
1760
- let i = e.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", t * n - .1 + "em").attr("dy", n + "em");
1761
- return r && i.attr("text-anchor", "middle"), i;
1762
- }
1763
- n(Z, "createTspan");
1764
- function gt(e, t, n) {
1765
- let r = e.append("text"), i = Z(r, 1, t);
1766
- $(i, n);
1767
- let a = i.node().getComputedTextLength();
1768
- return r.remove(), a;
1769
- }
1770
- n(gt, "computeWidthOfText");
1771
- function _t(e, t, n) {
1772
- let r = e.append("text"), i = Z(r, 1, t);
1773
- $(i, [{
1774
- content: n,
1775
- type: "normal"
1776
- }]);
1777
- let a = i.node()?.getBoundingClientRect();
1778
- return a && r.remove(), a;
1779
- }
1780
- n(_t, "computeDimensionOfText");
1781
- function vt(e, t, r, i = !1, a = !1) {
1782
- let o = 1.1, s = t.append("g"), c = s.insert("rect").attr("class", "background").attr("style", "stroke: none"), l = s.append("text").attr("y", "-10.1");
1783
- a && l.attr("text-anchor", "middle");
1784
- let u = 0;
1785
- for (let t of r) {
1786
- let r = /* @__PURE__ */ n((t) => gt(s, o, t) <= e, "checkWidth"), i = r(t) ? [t] : mt(t, r);
1787
- for (let e of i) $(Z(l, u, o, a), e), u++;
1788
- }
1789
- if (i) {
1790
- let e = l.node().getBBox();
1791
- return c.attr("x", e.x - 2).attr("y", e.y - 2).attr("width", e.width + 4).attr("height", e.height + 4), s.node();
1792
- } else return l.node();
1793
- }
1794
- n(vt, "createFormattedText");
1795
- function Q(e) {
1796
- return e.replace(/&(amp|lt|gt);/g, (e, t) => {
1797
- switch (t) {
1798
- case "amp": return "&";
1799
- case "lt": return "<";
1800
- case "gt": return ">";
1801
- default: return e;
1802
- }
1803
- });
1804
- }
1805
- n(Q, "decodeHTMLEntities");
1806
- function $(e, t) {
1807
- e.text(""), t.forEach((t, n) => {
1808
- let r = e.append("tspan").attr("font-style", t.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal");
1809
- n === 0 ? r.text(Q(t.content)) : r.text(" " + Q(t.content));
1810
- });
1811
- }
1812
- n($, "updateTextContentAndStyles");
1813
- async function yt(e, t = {}) {
1814
- let n = [];
1815
- e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (e, r, i) => (n.push((async () => {
1816
- let n = `${r}:${i}`;
1817
- return await l(n) ? await u(n, void 0, { class: "label-icon" }) : `<i class='${s(e, t).replace(":", " ")}'></i>`;
1818
- })()), e));
1819
- let r = await Promise.all(n);
1820
- return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => r.shift() ?? "");
1821
- }
1822
- n(yt, "replaceIconSubstring");
1823
- var bt = /* @__PURE__ */ n(async (n, r = "", { style: a = "", isTitle: o = !1, classes: s = "", useHtmlLabels: l = !0, markdown: u = !0, isNode: d = !0, width: f = 200, minWidth: p = 0, addSvgBackground: m = !1 } = {}, h) => {
1824
- if (e.debug("XYZ createText", r, a, o, s, l, d, "addSvgBackground: ", m), l) {
1825
- let e = await yt(c(u ? rt(r, h) : nt(r)), h), t = r.replace(/\\\\/g, "\\");
1826
- return await X(n, {
1827
- isNode: d,
1828
- label: i(r) ? t : e,
1829
- labelStyle: a.replace("fill:", "color:")
1830
- }, f, s, m, h, p);
1831
- } else {
1832
- let e = c(r.replace(/<br\s*\/?>/g, "<br/>")), i = vt(f, n, u ? G(e.replace("<br>", "<br/>"), h) : tt(e), r ? m : !1, !d);
1833
- if (d) {
1834
- /stroke:/.exec(a) && (a = a.replace("stroke:", "lineColor:"));
1835
- let e = a.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1836
- t(i).attr("style", e);
1837
- } else {
1838
- let e = a.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
1839
- t(i).select("rect").attr("style", e.replace(/background:/g, "fill:"));
1840
- let n = a.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
1841
- t(i).select("text").attr("style", n);
1842
- }
1843
- return o ? t(i).selectAll("tspan.text-outer-tspan").classed("title-row", !0) : t(i).selectAll("tspan.text-outer-tspan").classed("row", !0), i;
1844
- }
1845
- }, "createText");
1846
- //#endregion
1847
- export { Xe as a, G as i, bt as n, dt as r, _t as t };