ipsumify 0.0.0-stage → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1649 @@
1
+
2
+ // node_modules/marked/lib/marked.esm.js
3
+ function M() {
4
+ return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
5
+ }
6
+ var O = M();
7
+ function G(u3) {
8
+ O = u3;
9
+ }
10
+ var _ = { exec: () => null };
11
+ function k(u3, e = "") {
12
+ let t = typeof u3 == "string" ? u3 : u3.source, n = { replace: (r, i) => {
13
+ let s = typeof i == "string" ? i : i.source;
14
+ return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
15
+ }, getRegex: () => new RegExp(t, e) };
16
+ return n;
17
+ }
18
+ var be = (() => {
19
+ try {
20
+ return !!new RegExp("(?<=1)(?<!1)");
21
+ } catch {
22
+ return false;
23
+ }
24
+ })();
25
+ var m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (u3) => new RegExp(`^( {0,3}${u3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}#`), htmlBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}>`) };
26
+ var Re = /^(?:[ \t]*(?:\n|$))+/;
27
+ var Oe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
28
+ var Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
29
+ var C = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
30
+ var we = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
31
+ var Q = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
32
+ var se = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
33
+ var 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();
34
+ var 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();
35
+ var j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
36
+ var Pe = /^[^\n]+/;
37
+ var F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
38
+ var 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();
39
+ var $e = k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex();
40
+ var 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";
41
+ var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
42
+ var _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();
43
+ var 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();
44
+ var Le = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oe).getRegex();
45
+ var K = { blockquote: Le, code: Oe, def: Se, fences: Te, heading: we, hr: C, html: _e, lheading: ie, list: $e, newline: Re, paragraph: oe, table: _, text: Pe };
46
+ var 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();
47
+ var Me = { ...K, lheading: ye, table: ne, 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() };
48
+ var ze = { ...K, 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(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(j).replace("hr", C).replace("heading", ` *#{1,6} *[^
49
+ ]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
50
+ var Ee = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
51
+ var Ie = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
52
+ var ae = /^( {2,}|\\)\n(?!\s*$)/;
53
+ var Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
54
+ var z = /[\p{P}\p{S}]/u;
55
+ var H = /[\s\p{P}\p{S}]/u;
56
+ var W = /[^\s\p{P}\p{S}]/u;
57
+ var Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, H).getRegex();
58
+ var le = /(?!~)[\p{P}\p{S}]/u;
59
+ var Be = /(?!~)[\s\p{P}\p{S}]/u;
60
+ var De = /(?:[^\s\p{P}\p{S}]|~)/u;
61
+ var 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();
62
+ var ue = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
63
+ var ve = k(ue, "u").replace(/punct/g, z).getRegex();
64
+ var He = k(ue, "u").replace(/punct/g, le).getRegex();
65
+ var pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
66
+ var Ze = k(pe, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H).replace(/punct/g, z).getRegex();
67
+ var Ge = k(pe, "gu").replace(/notPunctSpace/g, De).replace(/punctSpace/g, Be).replace(/punct/g, le).getRegex();
68
+ var 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();
69
+ var Qe = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, z).getRegex();
70
+ var je = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
71
+ var Fe = k(je, "gu").replace(/notPunctSpace/g, W).replace(/punctSpace/g, H).replace(/punct/g, z).getRegex();
72
+ var Ue = k(/\\(punct)/, "gu").replace(/punct/g, z).getRegex();
73
+ var 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();
74
+ var We = k(U).replace("(?:-->|$)", "-->").getRegex();
75
+ var 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();
76
+ var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
77
+ var 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();
78
+ var ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex();
79
+ var he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex();
80
+ var Ve = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex();
81
+ var re = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
82
+ var X = { _backpedal: _, anyPunctuation: Ue, autolink: Ke, blockSkip: qe, br: ae, code: Ie, del: _, delLDelim: _, delRDelim: _, emStrongLDelim: ve, emStrongRDelimAst: Ze, emStrongRDelimUnd: Ne, escape: Ee, link: Je, nolink: he, punctuation: Ce, reflink: ce, reflinkSearch: Ve, tag: Xe, text: Ae, url: _ };
83
+ var Ye = { ...X, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
84
+ var N = { ...X, emStrongRDelimAst: Ge, emStrongLDelim: He, delLDelim: Qe, delRDelim: Fe, 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(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, 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() };
85
+ var et = { ...N, br: k(ae).replace("{2,}", "*").getRegex(), text: k(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
86
+ var B = { normal: K, gfm: Me, pedantic: ze };
87
+ var E = { normal: X, gfm: N, breaks: et, pedantic: Ye };
88
+ var tt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
89
+ var ke = (u3) => tt[u3];
90
+ function T(u3, e) {
91
+ if (e) {
92
+ if (m.escapeTest.test(u3)) return u3.replace(m.escapeReplace, ke);
93
+ } else if (m.escapeTestNoEncode.test(u3)) return u3.replace(m.escapeReplaceNoEncode, ke);
94
+ return u3;
95
+ }
96
+ function J(u3) {
97
+ try {
98
+ u3 = encodeURI(u3).replace(m.percentDecode, "%");
99
+ } catch {
100
+ return null;
101
+ }
102
+ return u3;
103
+ }
104
+ function V(u3, e) {
105
+ let t = u3.replace(m.findPipe, (i, s, a) => {
106
+ let o = false, l = s;
107
+ for (; --l >= 0 && a[l] === "\\"; ) o = !o;
108
+ return o ? "|" : " |";
109
+ }), n = t.split(m.splitPipe), r = 0;
110
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
111
+ else for (; n.length < e; ) n.push("");
112
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
113
+ return n;
114
+ }
115
+ function I(u3, e, t) {
116
+ let n = u3.length;
117
+ if (n === 0) return "";
118
+ let r = 0;
119
+ for (; r < n; ) {
120
+ let i = u3.charAt(n - r - 1);
121
+ if (i === e && !t) r++;
122
+ else if (i !== e && t) r++;
123
+ else break;
124
+ }
125
+ return u3.slice(0, n - r);
126
+ }
127
+ function de(u3, e) {
128
+ if (u3.indexOf(e[1]) === -1) return -1;
129
+ let t = 0;
130
+ for (let n = 0; n < u3.length; n++) if (u3[n] === "\\") n++;
131
+ else if (u3[n] === e[0]) t++;
132
+ else if (u3[n] === e[1] && (t--, t < 0)) return n;
133
+ return t > 0 ? -2 : -1;
134
+ }
135
+ function ge(u3, e = 0) {
136
+ let t = e, n = "";
137
+ for (let r of u3) if (r === " ") {
138
+ let i = 4 - t % 4;
139
+ n += " ".repeat(i), t += i;
140
+ } else n += r, t++;
141
+ return n;
142
+ }
143
+ function fe(u3, e, t, n, r) {
144
+ let i = e.href, s = e.title || null, a = u3[1].replace(r.other.outputLinkReplace, "$1");
145
+ n.state.inLink = true;
146
+ let o = { type: u3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
147
+ return n.state.inLink = false, o;
148
+ }
149
+ function nt(u3, e, t) {
150
+ let n = u3.match(t.other.indentCodeCompensation);
151
+ if (n === null) return e;
152
+ let r = n[1];
153
+ return e.split(`
154
+ `).map((i) => {
155
+ let s = i.match(t.other.beginningSpace);
156
+ if (s === null) return i;
157
+ let [a] = s;
158
+ return a.length >= r.length ? i.slice(r.length) : i;
159
+ }).join(`
160
+ `);
161
+ }
162
+ var w = class {
163
+ options;
164
+ rules;
165
+ lexer;
166
+ constructor(e) {
167
+ this.options = e || O;
168
+ }
169
+ space(e) {
170
+ let t = this.rules.block.newline.exec(e);
171
+ if (t && t[0].length > 0) return { type: "space", raw: t[0] };
172
+ }
173
+ code(e) {
174
+ let t = this.rules.block.code.exec(e);
175
+ if (t) {
176
+ let n = t[0].replace(this.rules.other.codeRemoveIndent, "");
177
+ return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : I(n, `
178
+ `) };
179
+ }
180
+ }
181
+ fences(e) {
182
+ let t = this.rules.block.fences.exec(e);
183
+ if (t) {
184
+ let n = t[0], r = nt(n, t[3] || "", this.rules);
185
+ return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
186
+ }
187
+ }
188
+ heading(e) {
189
+ let t = this.rules.block.heading.exec(e);
190
+ if (t) {
191
+ let n = t[2].trim();
192
+ if (this.rules.other.endingHash.test(n)) {
193
+ let r = I(n, "#");
194
+ (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
195
+ }
196
+ return { type: "heading", raw: t[0], depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
197
+ }
198
+ }
199
+ hr(e) {
200
+ let t = this.rules.block.hr.exec(e);
201
+ if (t) return { type: "hr", raw: I(t[0], `
202
+ `) };
203
+ }
204
+ blockquote(e) {
205
+ let t = this.rules.block.blockquote.exec(e);
206
+ if (t) {
207
+ let n = I(t[0], `
208
+ `).split(`
209
+ `), r = "", i = "", s = [];
210
+ for (; n.length > 0; ) {
211
+ let a = false, o = [], l;
212
+ for (l = 0; l < n.length; l++) if (this.rules.other.blockquoteStart.test(n[l])) o.push(n[l]), a = true;
213
+ else if (!a) o.push(n[l]);
214
+ else break;
215
+ n = n.slice(l);
216
+ let p = o.join(`
217
+ `), c = p.replace(this.rules.other.blockquoteSetextReplace, `
218
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
219
+ r = r ? `${r}
220
+ ${p}` : p, i = i ? `${i}
221
+ ${c}` : c;
222
+ let d = this.lexer.state.top;
223
+ if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = d, n.length === 0) break;
224
+ let h = s.at(-1);
225
+ if (h?.type === "code") break;
226
+ if (h?.type === "blockquote") {
227
+ let R = h, f = R.raw + `
228
+ ` + n.join(`
229
+ `), S = this.blockquote(f);
230
+ s[s.length - 1] = S, r = r.substring(0, r.length - R.raw.length) + S.raw, i = i.substring(0, i.length - R.text.length) + S.text;
231
+ break;
232
+ } else if (h?.type === "list") {
233
+ let R = h, f = R.raw + `
234
+ ` + n.join(`
235
+ `), S = this.list(f);
236
+ s[s.length - 1] = S, r = r.substring(0, r.length - h.raw.length) + S.raw, i = i.substring(0, i.length - R.raw.length) + S.raw, n = f.substring(s.at(-1).raw.length).split(`
237
+ `);
238
+ continue;
239
+ }
240
+ }
241
+ return { type: "blockquote", raw: r, tokens: s, text: i };
242
+ }
243
+ }
244
+ list(e) {
245
+ let t = this.rules.block.list.exec(e);
246
+ if (t) {
247
+ let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
248
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
249
+ let s = this.rules.other.listItemRegex(n), a = false;
250
+ for (; e; ) {
251
+ let l = false, p = "", c = "";
252
+ if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
253
+ p = t[0], e = e.substring(p.length);
254
+ let d = ge(t[2].split(`
255
+ `, 1)[0], t[1].length), h = e.split(`
256
+ `, 1)[0], R = !d.trim(), f = 0;
257
+ if (this.options.pedantic ? (f = 2, c = d.trimStart()) : R ? f = t[1].length + 1 : (f = d.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = d.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (p += h + `
258
+ `, e = e.substring(h.length + 1), l = true), !l) {
259
+ let S = this.rules.other.nextBulletRegex(f), Y = this.rules.other.hrRegex(f), ee = this.rules.other.fencesBeginRegex(f), te = this.rules.other.headingBeginRegex(f), me = this.rules.other.htmlBeginRegex(f), xe = this.rules.other.blockquoteBeginRegex(f);
260
+ for (; e; ) {
261
+ let Z = e.split(`
262
+ `, 1)[0], A;
263
+ if (h = Z, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), ee.test(h) || te.test(h) || me.test(h) || xe.test(h) || S.test(h) || Y.test(h)) break;
264
+ if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
265
+ ` + A.slice(f);
266
+ else {
267
+ if (R || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(d) || te.test(d) || Y.test(d)) break;
268
+ c += `
269
+ ` + h;
270
+ }
271
+ R = !h.trim(), p += Z + `
272
+ `, e = e.substring(Z.length + 1), d = A.slice(f);
273
+ }
274
+ }
275
+ i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (a = true)), i.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: false, text: c, tokens: [] }), i.raw += p;
276
+ }
277
+ let o = i.items.at(-1);
278
+ if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
279
+ else return;
280
+ i.raw = i.raw.trimEnd();
281
+ for (let l of i.items) {
282
+ if (this.lexer.state.top = false, l.tokens = this.lexer.blockTokens(l.text, []), l.task) {
283
+ if (l.text = l.text.replace(this.rules.other.listReplaceTask, ""), l.tokens[0]?.type === "text" || l.tokens[0]?.type === "paragraph") {
284
+ l.tokens[0].raw = l.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), l.tokens[0].text = l.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
285
+ for (let c = this.lexer.inlineQueue.length - 1; c >= 0; c--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)) {
286
+ this.lexer.inlineQueue[c].src = this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask, "");
287
+ break;
288
+ }
289
+ }
290
+ let p = this.rules.other.listTaskCheckbox.exec(l.raw);
291
+ if (p) {
292
+ let c = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
293
+ l.checked = c.checked, i.loose ? l.tokens[0] && ["paragraph", "text"].includes(l.tokens[0].type) && "tokens" in l.tokens[0] && l.tokens[0].tokens ? (l.tokens[0].raw = c.raw + l.tokens[0].raw, l.tokens[0].text = c.raw + l.tokens[0].text, l.tokens[0].tokens.unshift(c)) : l.tokens.unshift({ type: "paragraph", raw: c.raw, text: c.raw, tokens: [c] }) : l.tokens.unshift(c);
294
+ }
295
+ }
296
+ if (!i.loose) {
297
+ let p = l.tokens.filter((d) => d.type === "space"), c = p.length > 0 && p.some((d) => this.rules.other.anyLine.test(d.raw));
298
+ i.loose = c;
299
+ }
300
+ }
301
+ if (i.loose) for (let l of i.items) {
302
+ l.loose = true;
303
+ for (let p of l.tokens) p.type === "text" && (p.type = "paragraph");
304
+ }
305
+ return i;
306
+ }
307
+ }
308
+ html(e) {
309
+ let t = this.rules.block.html.exec(e);
310
+ if (t) return { type: "html", block: true, raw: t[0], pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: t[0] };
311
+ }
312
+ def(e) {
313
+ let t = this.rules.block.def.exec(e);
314
+ if (t) {
315
+ let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
316
+ return { type: "def", tag: n, raw: t[0], href: r, title: i };
317
+ }
318
+ }
319
+ table(e) {
320
+ let t = this.rules.block.table.exec(e);
321
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
322
+ let n = V(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
323
+ `) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
324
+ if (n.length === r.length) {
325
+ for (let a of r) this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
326
+ for (let a = 0; a < n.length; a++) s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
327
+ for (let a of i) s.rows.push(V(a, s.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[l] })));
328
+ return s;
329
+ }
330
+ }
331
+ lheading(e) {
332
+ let t = this.rules.block.lheading.exec(e);
333
+ if (t) {
334
+ let n = t[1].trim();
335
+ return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
336
+ }
337
+ }
338
+ paragraph(e) {
339
+ let t = this.rules.block.paragraph.exec(e);
340
+ if (t) {
341
+ let n = t[1].charAt(t[1].length - 1) === `
342
+ ` ? t[1].slice(0, -1) : t[1];
343
+ return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
344
+ }
345
+ }
346
+ text(e) {
347
+ let t = this.rules.block.text.exec(e);
348
+ if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
349
+ }
350
+ escape(e) {
351
+ let t = this.rules.inline.escape.exec(e);
352
+ if (t) return { type: "escape", raw: t[0], text: t[1] };
353
+ }
354
+ tag(e) {
355
+ let t = this.rules.inline.tag.exec(e);
356
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t[0] };
357
+ }
358
+ link(e) {
359
+ let t = this.rules.inline.link.exec(e);
360
+ if (t) {
361
+ let n = t[2].trim();
362
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
363
+ if (!this.rules.other.endAngleBracket.test(n)) return;
364
+ let s = I(n.slice(0, -1), "\\");
365
+ if ((n.length - s.length) % 2 === 0) return;
366
+ } else {
367
+ let s = de(t[2], "()");
368
+ if (s === -2) return;
369
+ if (s > -1) {
370
+ let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
371
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
372
+ }
373
+ }
374
+ let r = t[2], i = "";
375
+ if (this.options.pedantic) {
376
+ let s = this.rules.other.pedanticHrefTitle.exec(r);
377
+ s && (r = s[1], i = s[3]);
378
+ } else i = t[3] ? t[3].slice(1, -1) : "";
379
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), fe(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
380
+ }
381
+ }
382
+ reflink(e, t) {
383
+ let n;
384
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
385
+ let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t[r.toLowerCase()];
386
+ if (!i) {
387
+ let s = n[0].charAt(0);
388
+ return { type: "text", raw: s, text: s };
389
+ }
390
+ return fe(n, i, n[0], this.lexer, this.rules);
391
+ }
392
+ }
393
+ emStrong(e, t, n = "") {
394
+ let r = this.rules.inline.emStrongLDelim.exec(e);
395
+ if (!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
396
+ if (!(r[1] || r[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
397
+ let s = [...r[0]].length - 1, a, o, l = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
398
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) !== null; ) {
399
+ if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
400
+ if (o = [...a].length, r[3] || r[4]) {
401
+ l += o;
402
+ continue;
403
+ } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
404
+ p += o;
405
+ continue;
406
+ }
407
+ if (l -= o, l > 0) continue;
408
+ o = Math.min(o, o + l + p);
409
+ let d = [...r[0]][0].length, h = e.slice(0, s + r.index + d + o);
410
+ if (Math.min(s, o) % 2) {
411
+ let f = h.slice(1, -1);
412
+ return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
413
+ }
414
+ let R = h.slice(2, -2);
415
+ return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
416
+ }
417
+ }
418
+ }
419
+ codespan(e) {
420
+ let t = this.rules.inline.code.exec(e);
421
+ if (t) {
422
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
423
+ return r && i && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
424
+ }
425
+ }
426
+ br(e) {
427
+ let t = this.rules.inline.br.exec(e);
428
+ if (t) return { type: "br", raw: t[0] };
429
+ }
430
+ del(e, t, n = "") {
431
+ let r = this.rules.inline.delLDelim.exec(e);
432
+ if (!r) return;
433
+ if (!(r[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
434
+ let s = [...r[0]].length - 1, a, o, l = s, p = this.rules.inline.delRDelim;
435
+ for (p.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = p.exec(t)) !== null; ) {
436
+ if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a || (o = [...a].length, o !== s)) continue;
437
+ if (r[3] || r[4]) {
438
+ l += o;
439
+ continue;
440
+ }
441
+ if (l -= o, l > 0) continue;
442
+ o = Math.min(o, o + l);
443
+ let c = [...r[0]][0].length, d = e.slice(0, s + r.index + c + o), h = d.slice(s, -s);
444
+ return { type: "del", raw: d, text: h, tokens: this.lexer.inlineTokens(h) };
445
+ }
446
+ }
447
+ }
448
+ autolink(e) {
449
+ let t = this.rules.inline.autolink.exec(e);
450
+ if (t) {
451
+ let n, r;
452
+ return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
453
+ }
454
+ }
455
+ url(e) {
456
+ let t;
457
+ if (t = this.rules.inline.url.exec(e)) {
458
+ let n, r;
459
+ if (t[2] === "@") n = t[0], r = "mailto:" + n;
460
+ else {
461
+ let i;
462
+ do
463
+ i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
464
+ while (i !== t[0]);
465
+ n = t[0], t[1] === "www." ? r = "http://" + t[0] : r = t[0];
466
+ }
467
+ return { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
468
+ }
469
+ }
470
+ inlineText(e) {
471
+ let t = this.rules.inline.text.exec(e);
472
+ if (t) {
473
+ let n = this.lexer.state.inRawBlock;
474
+ return { type: "text", raw: t[0], text: t[0], escaped: n };
475
+ }
476
+ }
477
+ };
478
+ var x = class u {
479
+ tokens;
480
+ options;
481
+ state;
482
+ inlineQueue;
483
+ tokenizer;
484
+ constructor(e) {
485
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ 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 = { inLink: false, inRawBlock: false, top: true };
486
+ let t = { other: m, block: B.normal, inline: E.normal };
487
+ this.options.pedantic ? (t.block = B.pedantic, t.inline = E.pedantic) : this.options.gfm && (t.block = B.gfm, this.options.breaks ? t.inline = E.breaks : t.inline = E.gfm), this.tokenizer.rules = t;
488
+ }
489
+ static get rules() {
490
+ return { block: B, inline: E };
491
+ }
492
+ static lex(e, t) {
493
+ return new u(t).lex(e);
494
+ }
495
+ static lexInline(e, t) {
496
+ return new u(t).inlineTokens(e);
497
+ }
498
+ lex(e) {
499
+ e = e.replace(m.carriageReturn, `
500
+ `), this.blockTokens(e, this.tokens);
501
+ for (let t = 0; t < this.inlineQueue.length; t++) {
502
+ let n = this.inlineQueue[t];
503
+ this.inlineTokens(n.src, n.tokens);
504
+ }
505
+ return this.inlineQueue = [], this.tokens;
506
+ }
507
+ blockTokens(e, t = [], n = false) {
508
+ for (this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
509
+ let r;
510
+ if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
511
+ if (r = this.tokenizer.space(e)) {
512
+ e = e.substring(r.raw.length);
513
+ let s = t.at(-1);
514
+ r.raw.length === 1 && s !== void 0 ? s.raw += `
515
+ ` : t.push(r);
516
+ continue;
517
+ }
518
+ if (r = this.tokenizer.code(e)) {
519
+ e = e.substring(r.raw.length);
520
+ let s = t.at(-1);
521
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
522
+ `) ? "" : `
523
+ `) + r.raw, s.text += `
524
+ ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
525
+ continue;
526
+ }
527
+ if (r = this.tokenizer.fences(e)) {
528
+ e = e.substring(r.raw.length), t.push(r);
529
+ continue;
530
+ }
531
+ if (r = this.tokenizer.heading(e)) {
532
+ e = e.substring(r.raw.length), t.push(r);
533
+ continue;
534
+ }
535
+ if (r = this.tokenizer.hr(e)) {
536
+ e = e.substring(r.raw.length), t.push(r);
537
+ continue;
538
+ }
539
+ if (r = this.tokenizer.blockquote(e)) {
540
+ e = e.substring(r.raw.length), t.push(r);
541
+ continue;
542
+ }
543
+ if (r = this.tokenizer.list(e)) {
544
+ e = e.substring(r.raw.length), t.push(r);
545
+ continue;
546
+ }
547
+ if (r = this.tokenizer.html(e)) {
548
+ e = e.substring(r.raw.length), t.push(r);
549
+ continue;
550
+ }
551
+ if (r = this.tokenizer.def(e)) {
552
+ e = e.substring(r.raw.length);
553
+ let s = t.at(-1);
554
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
555
+ `) ? "" : `
556
+ `) + r.raw, s.text += `
557
+ ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t.push(r));
558
+ continue;
559
+ }
560
+ if (r = this.tokenizer.table(e)) {
561
+ e = e.substring(r.raw.length), t.push(r);
562
+ continue;
563
+ }
564
+ if (r = this.tokenizer.lheading(e)) {
565
+ e = e.substring(r.raw.length), t.push(r);
566
+ continue;
567
+ }
568
+ let i = e;
569
+ if (this.options.extensions?.startBlock) {
570
+ let s = 1 / 0, a = e.slice(1), o;
571
+ this.options.extensions.startBlock.forEach((l) => {
572
+ o = l.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
573
+ }), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
574
+ }
575
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
576
+ let s = t.at(-1);
577
+ n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
578
+ `) ? "" : `
579
+ `) + r.raw, s.text += `
580
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
581
+ continue;
582
+ }
583
+ if (r = this.tokenizer.text(e)) {
584
+ e = e.substring(r.raw.length);
585
+ let s = t.at(-1);
586
+ s?.type === "text" ? (s.raw += (s.raw.endsWith(`
587
+ `) ? "" : `
588
+ `) + r.raw, s.text += `
589
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
590
+ continue;
591
+ }
592
+ if (e) {
593
+ let s = "Infinite loop on byte: " + e.charCodeAt(0);
594
+ if (this.options.silent) {
595
+ console.error(s);
596
+ break;
597
+ } else throw new Error(s);
598
+ }
599
+ }
600
+ return this.state.top = true, t;
601
+ }
602
+ inline(e, t = []) {
603
+ return this.inlineQueue.push({ src: e, tokens: t }), t;
604
+ }
605
+ inlineTokens(e, t = []) {
606
+ this.tokenizer.lexer = this;
607
+ let n = e, r = null;
608
+ if (this.tokens.links) {
609
+ let o = Object.keys(this.tokens.links);
610
+ if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) o.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));
611
+ }
612
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
613
+ let i;
614
+ 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);
615
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
616
+ let s = false, a = "";
617
+ for (; e; ) {
618
+ s || (a = ""), s = false;
619
+ let o;
620
+ if (this.options.extensions?.inline?.some((p) => (o = p.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
621
+ if (o = this.tokenizer.escape(e)) {
622
+ e = e.substring(o.raw.length), t.push(o);
623
+ continue;
624
+ }
625
+ if (o = this.tokenizer.tag(e)) {
626
+ e = e.substring(o.raw.length), t.push(o);
627
+ continue;
628
+ }
629
+ if (o = this.tokenizer.link(e)) {
630
+ e = e.substring(o.raw.length), t.push(o);
631
+ continue;
632
+ }
633
+ if (o = this.tokenizer.reflink(e, this.tokens.links)) {
634
+ e = e.substring(o.raw.length);
635
+ let p = t.at(-1);
636
+ o.type === "text" && p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
637
+ continue;
638
+ }
639
+ if (o = this.tokenizer.emStrong(e, n, a)) {
640
+ e = e.substring(o.raw.length), t.push(o);
641
+ continue;
642
+ }
643
+ if (o = this.tokenizer.codespan(e)) {
644
+ e = e.substring(o.raw.length), t.push(o);
645
+ continue;
646
+ }
647
+ if (o = this.tokenizer.br(e)) {
648
+ e = e.substring(o.raw.length), t.push(o);
649
+ continue;
650
+ }
651
+ if (o = this.tokenizer.del(e, n, a)) {
652
+ e = e.substring(o.raw.length), t.push(o);
653
+ continue;
654
+ }
655
+ if (o = this.tokenizer.autolink(e)) {
656
+ e = e.substring(o.raw.length), t.push(o);
657
+ continue;
658
+ }
659
+ if (!this.state.inLink && (o = this.tokenizer.url(e))) {
660
+ e = e.substring(o.raw.length), t.push(o);
661
+ continue;
662
+ }
663
+ let l = e;
664
+ if (this.options.extensions?.startInline) {
665
+ let p = 1 / 0, c = e.slice(1), d;
666
+ this.options.extensions.startInline.forEach((h) => {
667
+ d = h.call({ lexer: this }, c), typeof d == "number" && d >= 0 && (p = Math.min(p, d));
668
+ }), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
669
+ }
670
+ if (o = this.tokenizer.inlineText(l)) {
671
+ e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
672
+ let p = t.at(-1);
673
+ p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
674
+ continue;
675
+ }
676
+ if (e) {
677
+ let p = "Infinite loop on byte: " + e.charCodeAt(0);
678
+ if (this.options.silent) {
679
+ console.error(p);
680
+ break;
681
+ } else throw new Error(p);
682
+ }
683
+ }
684
+ return t;
685
+ }
686
+ };
687
+ var y = class {
688
+ options;
689
+ parser;
690
+ constructor(e) {
691
+ this.options = e || O;
692
+ }
693
+ space(e) {
694
+ return "";
695
+ }
696
+ code({ text: e, lang: t, escaped: n }) {
697
+ let r = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
698
+ `;
699
+ return r ? '<pre><code class="language-' + T(r) + '">' + (n ? i : T(i, true)) + `</code></pre>
700
+ ` : "<pre><code>" + (n ? i : T(i, true)) + `</code></pre>
701
+ `;
702
+ }
703
+ blockquote({ tokens: e }) {
704
+ return `<blockquote>
705
+ ${this.parser.parse(e)}</blockquote>
706
+ `;
707
+ }
708
+ html({ text: e }) {
709
+ return e;
710
+ }
711
+ def(e) {
712
+ return "";
713
+ }
714
+ heading({ tokens: e, depth: t }) {
715
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
716
+ `;
717
+ }
718
+ hr(e) {
719
+ return `<hr>
720
+ `;
721
+ }
722
+ list(e) {
723
+ let t = e.ordered, n = e.start, r = "";
724
+ for (let a = 0; a < e.items.length; a++) {
725
+ let o = e.items[a];
726
+ r += this.listitem(o);
727
+ }
728
+ let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
729
+ return "<" + i + s + `>
730
+ ` + r + "</" + i + `>
731
+ `;
732
+ }
733
+ listitem(e) {
734
+ return `<li>${this.parser.parse(e.tokens)}</li>
735
+ `;
736
+ }
737
+ checkbox({ checked: e }) {
738
+ return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
739
+ }
740
+ paragraph({ tokens: e }) {
741
+ return `<p>${this.parser.parseInline(e)}</p>
742
+ `;
743
+ }
744
+ table(e) {
745
+ let t = "", n = "";
746
+ for (let i = 0; i < e.header.length; i++) n += this.tablecell(e.header[i]);
747
+ t += this.tablerow({ text: n });
748
+ let r = "";
749
+ for (let i = 0; i < e.rows.length; i++) {
750
+ let s = e.rows[i];
751
+ n = "";
752
+ for (let a = 0; a < s.length; a++) n += this.tablecell(s[a]);
753
+ r += this.tablerow({ text: n });
754
+ }
755
+ return r && (r = `<tbody>${r}</tbody>`), `<table>
756
+ <thead>
757
+ ` + t + `</thead>
758
+ ` + r + `</table>
759
+ `;
760
+ }
761
+ tablerow({ text: e }) {
762
+ return `<tr>
763
+ ${e}</tr>
764
+ `;
765
+ }
766
+ tablecell(e) {
767
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
768
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
769
+ `;
770
+ }
771
+ strong({ tokens: e }) {
772
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
773
+ }
774
+ em({ tokens: e }) {
775
+ return `<em>${this.parser.parseInline(e)}</em>`;
776
+ }
777
+ codespan({ text: e }) {
778
+ return `<code>${T(e, true)}</code>`;
779
+ }
780
+ br(e) {
781
+ return "<br>";
782
+ }
783
+ del({ tokens: e }) {
784
+ return `<del>${this.parser.parseInline(e)}</del>`;
785
+ }
786
+ link({ href: e, title: t, tokens: n }) {
787
+ let r = this.parser.parseInline(n), i = J(e);
788
+ if (i === null) return r;
789
+ e = i;
790
+ let s = '<a href="' + e + '"';
791
+ return t && (s += ' title="' + T(t) + '"'), s += ">" + r + "</a>", s;
792
+ }
793
+ image({ href: e, title: t, text: n, tokens: r }) {
794
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
795
+ let i = J(e);
796
+ if (i === null) return T(n);
797
+ e = i;
798
+ let s = `<img src="${e}" alt="${T(n)}"`;
799
+ return t && (s += ` title="${T(t)}"`), s += ">", s;
800
+ }
801
+ text(e) {
802
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : T(e.text);
803
+ }
804
+ };
805
+ var $ = class {
806
+ strong({ text: e }) {
807
+ return e;
808
+ }
809
+ em({ text: e }) {
810
+ return e;
811
+ }
812
+ codespan({ text: e }) {
813
+ return e;
814
+ }
815
+ del({ text: e }) {
816
+ return e;
817
+ }
818
+ html({ text: e }) {
819
+ return e;
820
+ }
821
+ text({ text: e }) {
822
+ return e;
823
+ }
824
+ link({ text: e }) {
825
+ return "" + e;
826
+ }
827
+ image({ text: e }) {
828
+ return "" + e;
829
+ }
830
+ br() {
831
+ return "";
832
+ }
833
+ checkbox({ raw: e }) {
834
+ return e;
835
+ }
836
+ };
837
+ var b = class u2 {
838
+ options;
839
+ renderer;
840
+ textRenderer;
841
+ constructor(e) {
842
+ 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 $();
843
+ }
844
+ static parse(e, t) {
845
+ return new u2(t).parse(e);
846
+ }
847
+ static parseInline(e, t) {
848
+ return new u2(t).parseInline(e);
849
+ }
850
+ parse(e) {
851
+ this.renderer.parser = this;
852
+ let t = "";
853
+ for (let n = 0; n < e.length; n++) {
854
+ let r = e[n];
855
+ if (this.options.extensions?.renderers?.[r.type]) {
856
+ let s = r, a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
857
+ if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
858
+ t += a || "";
859
+ continue;
860
+ }
861
+ }
862
+ let i = r;
863
+ switch (i.type) {
864
+ case "space": {
865
+ t += this.renderer.space(i);
866
+ break;
867
+ }
868
+ case "hr": {
869
+ t += this.renderer.hr(i);
870
+ break;
871
+ }
872
+ case "heading": {
873
+ t += this.renderer.heading(i);
874
+ break;
875
+ }
876
+ case "code": {
877
+ t += this.renderer.code(i);
878
+ break;
879
+ }
880
+ case "table": {
881
+ t += this.renderer.table(i);
882
+ break;
883
+ }
884
+ case "blockquote": {
885
+ t += this.renderer.blockquote(i);
886
+ break;
887
+ }
888
+ case "list": {
889
+ t += this.renderer.list(i);
890
+ break;
891
+ }
892
+ case "checkbox": {
893
+ t += this.renderer.checkbox(i);
894
+ break;
895
+ }
896
+ case "html": {
897
+ t += this.renderer.html(i);
898
+ break;
899
+ }
900
+ case "def": {
901
+ t += this.renderer.def(i);
902
+ break;
903
+ }
904
+ case "paragraph": {
905
+ t += this.renderer.paragraph(i);
906
+ break;
907
+ }
908
+ case "text": {
909
+ t += this.renderer.text(i);
910
+ break;
911
+ }
912
+ default: {
913
+ let s = 'Token with "' + i.type + '" type was not found.';
914
+ if (this.options.silent) return console.error(s), "";
915
+ throw new Error(s);
916
+ }
917
+ }
918
+ }
919
+ return t;
920
+ }
921
+ parseInline(e, t = this.renderer) {
922
+ this.renderer.parser = this;
923
+ let n = "";
924
+ for (let r = 0; r < e.length; r++) {
925
+ let i = e[r];
926
+ if (this.options.extensions?.renderers?.[i.type]) {
927
+ let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
928
+ if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
929
+ n += a || "";
930
+ continue;
931
+ }
932
+ }
933
+ let s = i;
934
+ switch (s.type) {
935
+ case "escape": {
936
+ n += t.text(s);
937
+ break;
938
+ }
939
+ case "html": {
940
+ n += t.html(s);
941
+ break;
942
+ }
943
+ case "link": {
944
+ n += t.link(s);
945
+ break;
946
+ }
947
+ case "image": {
948
+ n += t.image(s);
949
+ break;
950
+ }
951
+ case "checkbox": {
952
+ n += t.checkbox(s);
953
+ break;
954
+ }
955
+ case "strong": {
956
+ n += t.strong(s);
957
+ break;
958
+ }
959
+ case "em": {
960
+ n += t.em(s);
961
+ break;
962
+ }
963
+ case "codespan": {
964
+ n += t.codespan(s);
965
+ break;
966
+ }
967
+ case "br": {
968
+ n += t.br(s);
969
+ break;
970
+ }
971
+ case "del": {
972
+ n += t.del(s);
973
+ break;
974
+ }
975
+ case "text": {
976
+ n += t.text(s);
977
+ break;
978
+ }
979
+ default: {
980
+ let a = 'Token with "' + s.type + '" type was not found.';
981
+ if (this.options.silent) return console.error(a), "";
982
+ throw new Error(a);
983
+ }
984
+ }
985
+ }
986
+ return n;
987
+ }
988
+ };
989
+ var P = class {
990
+ options;
991
+ block;
992
+ constructor(e) {
993
+ this.options = e || O;
994
+ }
995
+ static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
996
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
997
+ preprocess(e) {
998
+ return e;
999
+ }
1000
+ postprocess(e) {
1001
+ return e;
1002
+ }
1003
+ processAllTokens(e) {
1004
+ return e;
1005
+ }
1006
+ emStrongMask(e) {
1007
+ return e;
1008
+ }
1009
+ provideLexer(e = this.block) {
1010
+ return e ? x.lex : x.lexInline;
1011
+ }
1012
+ provideParser(e = this.block) {
1013
+ return e ? b.parse : b.parseInline;
1014
+ }
1015
+ };
1016
+ var D = class {
1017
+ defaults = M();
1018
+ options = this.setOptions;
1019
+ parse = this.parseMarkdown(true);
1020
+ parseInline = this.parseMarkdown(false);
1021
+ Parser = b;
1022
+ Renderer = y;
1023
+ TextRenderer = $;
1024
+ Lexer = x;
1025
+ Tokenizer = w;
1026
+ Hooks = P;
1027
+ constructor(...e) {
1028
+ this.use(...e);
1029
+ }
1030
+ walkTokens(e, t) {
1031
+ let n = [];
1032
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
1033
+ case "table": {
1034
+ let i = r;
1035
+ for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
1036
+ for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
1037
+ break;
1038
+ }
1039
+ case "list": {
1040
+ let i = r;
1041
+ n = n.concat(this.walkTokens(i.items, t));
1042
+ break;
1043
+ }
1044
+ default: {
1045
+ let i = r;
1046
+ this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
1047
+ let a = i[s].flat(1 / 0);
1048
+ n = n.concat(this.walkTokens(a, t));
1049
+ }) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
1050
+ }
1051
+ }
1052
+ return n;
1053
+ }
1054
+ use(...e) {
1055
+ let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
1056
+ return e.forEach((n) => {
1057
+ let r = { ...n };
1058
+ if (r.async = this.defaults.async || r.async || false, n.extensions && (n.extensions.forEach((i) => {
1059
+ if (!i.name) throw new Error("extension name required");
1060
+ if ("renderer" in i) {
1061
+ let s = t.renderers[i.name];
1062
+ s ? t.renderers[i.name] = function(...a) {
1063
+ let o = i.renderer.apply(this, a);
1064
+ return o === false && (o = s.apply(this, a)), o;
1065
+ } : t.renderers[i.name] = i.renderer;
1066
+ }
1067
+ if ("tokenizer" in i) {
1068
+ if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1069
+ let s = t[i.level];
1070
+ s ? s.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
1071
+ }
1072
+ "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1073
+ }), r.extensions = t), n.renderer) {
1074
+ let i = this.defaults.renderer || new y(this.defaults);
1075
+ for (let s in n.renderer) {
1076
+ if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
1077
+ if (["options", "parser"].includes(s)) continue;
1078
+ let a = s, o = n.renderer[a], l = i[a];
1079
+ i[a] = (...p) => {
1080
+ let c = o.apply(i, p);
1081
+ return c === false && (c = l.apply(i, p)), c || "";
1082
+ };
1083
+ }
1084
+ r.renderer = i;
1085
+ }
1086
+ if (n.tokenizer) {
1087
+ let i = this.defaults.tokenizer || new w(this.defaults);
1088
+ for (let s in n.tokenizer) {
1089
+ if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
1090
+ if (["options", "rules", "lexer"].includes(s)) continue;
1091
+ let a = s, o = n.tokenizer[a], l = i[a];
1092
+ i[a] = (...p) => {
1093
+ let c = o.apply(i, p);
1094
+ return c === false && (c = l.apply(i, p)), c;
1095
+ };
1096
+ }
1097
+ r.tokenizer = i;
1098
+ }
1099
+ if (n.hooks) {
1100
+ let i = this.defaults.hooks || new P();
1101
+ for (let s in n.hooks) {
1102
+ if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
1103
+ if (["options", "block"].includes(s)) continue;
1104
+ let a = s, o = n.hooks[a], l = i[a];
1105
+ P.passThroughHooks.has(s) ? i[a] = (p) => {
1106
+ if (this.defaults.async && P.passThroughHooksRespectAsync.has(s)) return (async () => {
1107
+ let d = await o.call(i, p);
1108
+ return l.call(i, d);
1109
+ })();
1110
+ let c = o.call(i, p);
1111
+ return l.call(i, c);
1112
+ } : i[a] = (...p) => {
1113
+ if (this.defaults.async) return (async () => {
1114
+ let d = await o.apply(i, p);
1115
+ return d === false && (d = await l.apply(i, p)), d;
1116
+ })();
1117
+ let c = o.apply(i, p);
1118
+ return c === false && (c = l.apply(i, p)), c;
1119
+ };
1120
+ }
1121
+ r.hooks = i;
1122
+ }
1123
+ if (n.walkTokens) {
1124
+ let i = this.defaults.walkTokens, s = n.walkTokens;
1125
+ r.walkTokens = function(a) {
1126
+ let o = [];
1127
+ return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
1128
+ };
1129
+ }
1130
+ this.defaults = { ...this.defaults, ...r };
1131
+ }), this;
1132
+ }
1133
+ setOptions(e) {
1134
+ return this.defaults = { ...this.defaults, ...e }, this;
1135
+ }
1136
+ lexer(e, t) {
1137
+ return x.lex(e, t ?? this.defaults);
1138
+ }
1139
+ parser(e, t) {
1140
+ return b.parse(e, t ?? this.defaults);
1141
+ }
1142
+ parseMarkdown(e) {
1143
+ return (n, r) => {
1144
+ let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
1145
+ if (this.defaults.async === true && i.async === false) return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1146
+ if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
1147
+ if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1148
+ if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
1149
+ let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
1150
+ s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
1151
+ let h = await (s.hooks ? await s.hooks.provideParser(e) : e ? b.parse : b.parseInline)(c, s);
1152
+ return s.hooks ? await s.hooks.postprocess(h) : h;
1153
+ })().catch(a);
1154
+ try {
1155
+ s.hooks && (n = s.hooks.preprocess(n));
1156
+ let l = (s.hooks ? s.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(n, s);
1157
+ s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
1158
+ let c = (s.hooks ? s.hooks.provideParser(e) : e ? b.parse : b.parseInline)(l, s);
1159
+ return s.hooks && (c = s.hooks.postprocess(c)), c;
1160
+ } catch (o) {
1161
+ return a(o);
1162
+ }
1163
+ };
1164
+ }
1165
+ onError(e, t) {
1166
+ return (n) => {
1167
+ if (n.message += `
1168
+ Please report this to https://github.com/markedjs/marked.`, e) {
1169
+ let r = "<p>An error occurred:</p><pre>" + T(n.message + "", true) + "</pre>";
1170
+ return t ? Promise.resolve(r) : r;
1171
+ }
1172
+ if (t) return Promise.reject(n);
1173
+ throw n;
1174
+ };
1175
+ }
1176
+ };
1177
+ var L = new D();
1178
+ function g(u3, e) {
1179
+ return L.parse(u3, e);
1180
+ }
1181
+ g.options = g.setOptions = function(u3) {
1182
+ return L.setOptions(u3), g.defaults = L.defaults, G(g.defaults), g;
1183
+ };
1184
+ g.getDefaults = M;
1185
+ g.defaults = O;
1186
+ g.use = function(...u3) {
1187
+ return L.use(...u3), g.defaults = L.defaults, G(g.defaults), g;
1188
+ };
1189
+ g.walkTokens = function(u3, e) {
1190
+ return L.walkTokens(u3, e);
1191
+ };
1192
+ g.parseInline = L.parseInline;
1193
+ g.Parser = b;
1194
+ g.parser = b.parse;
1195
+ g.Renderer = y;
1196
+ g.TextRenderer = $;
1197
+ g.Lexer = x;
1198
+ g.lexer = x.lex;
1199
+ g.Tokenizer = w;
1200
+ g.Hooks = P;
1201
+ g.parse = g;
1202
+ var Qt = g.options;
1203
+ var jt = g.setOptions;
1204
+ var Ft = g.use;
1205
+ var Ut = g.walkTokens;
1206
+ var Kt = g.parseInline;
1207
+ var Xt = b.parse;
1208
+ var Jt = x.lex;
1209
+
1210
+ // data/themes.ts
1211
+ var themes = [
1212
+ {
1213
+ id: "lorem",
1214
+ label: "Lorem Ipsum",
1215
+ icon: "i-lucide-scroll-text",
1216
+ paragraphs: [
1217
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.",
1218
+ "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.",
1219
+ "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis.",
1220
+ "Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.",
1221
+ "Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt.",
1222
+ "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias.",
1223
+ "Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est.",
1224
+ "Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae.",
1225
+ "Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.",
1226
+ "Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur."
1227
+ ],
1228
+ headings: [
1229
+ "Overview",
1230
+ "Introduction",
1231
+ "Summary",
1232
+ "Details",
1233
+ "Features",
1234
+ "Usage",
1235
+ "Examples",
1236
+ "Notes",
1237
+ "Lorem Ipsum",
1238
+ "Dolor Sit Amet",
1239
+ "Getting Started",
1240
+ "Key Concepts",
1241
+ "Best Practices",
1242
+ "Common Patterns",
1243
+ "Quick Reference",
1244
+ "Consectetur Adipiscing Elit",
1245
+ "Sed Do Eiusmod Tempor",
1246
+ "Understanding the Basics",
1247
+ "Advanced Configuration Options",
1248
+ "Working with Components",
1249
+ "Implementation Guidelines",
1250
+ "Troubleshooting Common Issues",
1251
+ "Performance Optimization Tips"
1252
+ ],
1253
+ listItems: ["Item one", "Item two", "Item three"]
1254
+ },
1255
+ {
1256
+ id: "dog",
1257
+ label: "Dog-em Ipsum",
1258
+ icon: "i-lucide-dog",
1259
+ paragraphs: [
1260
+ "Canis familiaris borkus maximus, Labrador retrievus golden floofen. Corgi pembrokius welshii adorabilis, Shiba inu doge originalis. Vizsla hungaricus pointer nobilum, Weimaraner grayus ghosticus elegantum.",
1261
+ "Pomeranian spitzus flooficus, Papillon butterflii earus magnificus. Basenji barklessum africanum, Akita inuus loyalis protectum. Samoyed cloudus whiteum smilius, Malamute alaskanus pullum sledicus.",
1262
+ "Beagle snoopicus howlii detectivum, Basset houndus droopii earus longum. Dachshund wienerii tunnelus shortlegum, Bloodhound trackerii scentus supremum. Borzoi russianus speedii elegantus.",
1263
+ "Schnauzer beardicus germanium miniatus, Affenpinscher monkii terrius scruffum. Keeshond dutchii floofium grayus, Schipperke belgicus blackus smallum. Leonberger giantus goldenii gentleum.",
1264
+ "Cavalier kingus spanielii heartum, Havanese cubanensis silkii lapus. Maltese whiteus ancienti nobleum, Bichon friseum powderii puffus. Shih tzu lionus chrysanthemum flowen.",
1265
+ "Doberman pinscherii guardus athleticus, Rottweiler romanum driverii strongum. Boxer playfulis musculus goofium, German shepherdii loyalis intelligentum. Mastiff enormicus gentleum giantus.",
1266
+ "Husky sibericus blueeyes pullum, Bernese mountainus tricolorus sweetum. Newfoundland waterus rescuii giantum, Saint Bernard alpinus rescuii barrelum. Great Dane apollous tallestum dogicus.",
1267
+ "Poodle standardus curlius smarticum, Goldendoodle hybridicus floofium allergii. Labradoodle crossii friendlius serviceum, Cockapoo mixus adorablis cuddleum. Maltipoo tinicus fluffium lapsum.",
1268
+ "Bulldog englishum wrinklii stockium, Frenchie batears snortius compactum. Pug wrinklorum snorticus curlytailus, Boston terrier tuxedous gentlemanicum. Boxer wiggleum excitus playfulium.",
1269
+ "Terrier spiritus feistii braveum, Yorkshire tinicus silkii bluetan. Jack Russell energius boundlessum zoomii, Westie whiteum scottius cheerfulem. Airedale kingus terrierii largestum."
1270
+ ],
1271
+ headings: [
1272
+ "Woof",
1273
+ "Good Boy",
1274
+ "Fetch Time",
1275
+ "Treats",
1276
+ "Walkies",
1277
+ "Zoomies",
1278
+ "Snoot Boops",
1279
+ "Belly Rubs",
1280
+ "The Pack Life",
1281
+ "Puppy Love",
1282
+ "Tail Wagging Tales",
1283
+ "Bark Park Adventures",
1284
+ "Loyal Companions",
1285
+ "Paw Patrol",
1286
+ "Furry Friends Forever",
1287
+ "The Art of the Fetch",
1288
+ "Mastering Puppy Eyes",
1289
+ "Advanced Treat Negotiations",
1290
+ "Squirrel Watching 101",
1291
+ "Nap Time Strategies",
1292
+ "The Perfect Belly Rub",
1293
+ "Mailman Alertness Training",
1294
+ "Ultimate Zoomie Techniques"
1295
+ ],
1296
+ listItems: ["Woof woof", "Bark bark", "Good boy"]
1297
+ },
1298
+ {
1299
+ id: "cat",
1300
+ label: "Cat-em Ipsum",
1301
+ icon: "i-lucide-cat",
1302
+ paragraphs: [
1303
+ "Felis catus purrensis maximus, Siamese vocalius blueeyes pointum. Abyssinian tickedus wildii ancienti, Persian flooficum flatfaceus luxurium. Maine Coon giantus gentleus tuftedum earus.",
1304
+ "Ragdoll floppicus docilum blueum, Birman sacredus burmanis mittenii. Tonkinese aquaeus mixicum sociablis, Burmese musculus sableum voicium. Balinese longhairus siamicum gracilum.",
1305
+ "Russian Blue grayus plushicum shyus, Chartreux frenchii smileum quietum. Korat silverii thailandus luckium, British Shorthair chonkus roundii calmicum. Scottish Fold earfoldus sweetium.",
1306
+ "Sphynx hairlessum warmicus wrinkleum, Peterbald elegantus russianum baldicum. Devon Rex elficus curlium pixius, Cornish Rex wavycoatum slenderum playfulem. Oriental sleekus largeearus vocalem.",
1307
+ "Bengal leopardicus wildii glitterum, Savannah tallestus africanicum servalum. Ocicat spotticum domesticus wildlookum, Egyptian Mau ancienti spottium fastestum. Toyger stripedus tigerium miniatum.",
1308
+ "Norwegian Forest flufficus vikingii waterproofum, Siberian hypoallergicus russianum forestii. Nebelung longhairum grayplushum rareum, Turkish Van swimmicus vanum patternum. Somali foxii longhairus tickedum.",
1309
+ "Himalayan persicum pointus fluffium, Exotic Shorthair teddybearum calmicus. Ragamuffin largeum sweeticus docilum, Selkirk Rex curlycoatum sheepii patientum. LaPerm curlicus wavium uniqueum.",
1310
+ "Manx taillessum islandicus roundum, Japanese Bobtail pompomii luckyus ancienti. Cymric longhairus manxicum floofem, American Bobtail wildlookum bobbium friendlius. Pixie-Bob polydactylum largeus.",
1311
+ "Singapura smallestum draincat sepiatum, Havana Brown chocolatum greeneyeum sleekus. Bombay pantherii blackus coppereyeum, Burmilla shimmeryum silverii gentleum. Chausie jungleum hybridicus athletum.",
1312
+ "Turkish Angora ancienti elegantum silkium, Javanese colorpointum longhairum vocalem. Snowshoe pointicum mittenus blueeyes, Khao Manee diamondeyeum whiteum raricum. Lykoi werewolfii partialum hairlessum."
1313
+ ],
1314
+ headings: [
1315
+ "Meow",
1316
+ "Purr Life",
1317
+ "Nap Time",
1318
+ "Judgment",
1319
+ "Treats Now",
1320
+ "Box Fort",
1321
+ "Zoomies",
1322
+ "Worship",
1323
+ "Feline Royalty",
1324
+ "The Art of Napping",
1325
+ "Sunbeam Seeking",
1326
+ "Human Training",
1327
+ "Cardboard Castles",
1328
+ "Mysterious Ways",
1329
+ "Graceful Hunters",
1330
+ "Mastering the Slow Blink",
1331
+ "Advanced Ankle Weaving",
1332
+ "Strategic Hairball Placement",
1333
+ "Window Bird Theater",
1334
+ "Midnight Zoomie Protocol",
1335
+ "Perfecting the Judgmental Stare",
1336
+ "Keyboard Sitting Techniques",
1337
+ "The Unwritten Laws of If It Fits"
1338
+ ],
1339
+ listItems: ["Meow meow", "Purr purr", "Feed me now"]
1340
+ },
1341
+ {
1342
+ id: "baked",
1343
+ label: "Baked-em Ipsum",
1344
+ icon: "i-lucide-croissant",
1345
+ paragraphs: [
1346
+ "Brioche enrichum butteratum, p\xE2te feuillet\xE9e laminatum croissantus. G\xE9noise spongicum lightus, mille-feuille layerus crispatum. Baguette croustillant scoreum, pain de campagne rusticorum artisanum.",
1347
+ "Kouign-amann caramelus buttericum bretonnium, canel\xE9 bordelais crustatum custardum. Financier almondium brownbutterum, madeleine shellicus proustium. P\xE2te \xE0 choux profiterolum \xE9clairum.",
1348
+ "Challah braidicum enrichum eggyatum, babka swirlius chocolatum cinnamonum. Panettone milanensis fruiticum domeus, stollen germanicum marzipanum powderus. Pandoro starshapum goldenum veronensis.",
1349
+ "Fougasse proven\xE7alum olivatum herbus, focaccia italicum dimpledus rosmarinum. Ciabatta slipperum holeum crustycrumbum, grissini stickum thinicum crispus. Pane pugliese durumwheaticum semolinum.",
1350
+ "Tarte tatin caramelum inversus appleum, galette rusticorum freeformum buttercrust. Clafoutis cherrium custardum limousinum, far breton pruneatum densium. G\xE2teau basque creamfilledus almondcrust.",
1351
+ "Viennoiserie butteratum laminum, pain au chocolat croissantdoughum. Chausson aux pommes appleturnoverum, palmier elephantearus sugarcrispum. Brioche feuillet\xE9e hybridium richum.",
1352
+ "Sachertorte viennensis chocolatum apricotglazeum, schwarzw\xE4lder kirschtorte cherryum creamum. Dobos torta hungaricum carameltopum layerus, esterh\xE1zy walnuttum buttercreamus. Linzer torte latticum raspberryjam.",
1353
+ "Sfogliatella napoletanum shellicum ricottafillum, cassata siciliana marzipanum candiedfruitum. Cannoli tubicum crispum sweetricottum, zeppole choux friedum creamtoppum. Baba au rhum yeastcakem syrupsoakum.",
1354
+ "Cr\xE8me p\xE2tissi\xE8re vanillum custardum pipeum, frangipane almondcreamum tartfillingus. Cr\xE9meux smoothum richicum glossyum, ganache chocolatum creaminfusum. Buttercream swissum italicum frenchum.",
1355
+ "Levain naturalum yeastium starterus, poolish prefermentum frenchium hydrateum. Biga italicum stiffum flavordevlopum, tangzhong asianicum waterroux softicum. Autolyse restum hydrateum glutenum."
1356
+ ],
1357
+ headings: [
1358
+ "Fresh",
1359
+ "Golden",
1360
+ "Flaky",
1361
+ "Sweet",
1362
+ "Crusty",
1363
+ "Doughy",
1364
+ "Baked",
1365
+ "Yummy",
1366
+ "From the Oven",
1367
+ "Rise and Shine",
1368
+ "Butter Makes Better",
1369
+ "Sugar and Spice",
1370
+ "Crust Perfection",
1371
+ "The Proof is Rising",
1372
+ "Flour Power",
1373
+ "The Art of Lamination",
1374
+ "Mastering Sourdough Starters",
1375
+ "Perfect Pie Crust Techniques",
1376
+ "Croissant Folding Guide",
1377
+ "Cookie Science Explained",
1378
+ "Bread Scoring Patterns",
1379
+ "Frosting and Decorating Tips",
1380
+ "The Magic of Fermentation"
1381
+ ],
1382
+ listItems: ["Yum yum", "So tasty", "Freshly baked"]
1383
+ },
1384
+ {
1385
+ id: "bbq",
1386
+ label: "BBQ-em Ipsum",
1387
+ icon: "i-lucide-flame",
1388
+ paragraphs: [
1389
+ "Brisketum pectoralis slowcookum, puntum deckle fattium marbleum. Hickorium quercus mesquitum pecanwood, fumum aromatus carbonis ignum. Pitmasterus tendum focum, temperaturum constantus duecentum.",
1390
+ "Costae spareum backribus, sancti ludovici trimatum neaticus. Fricatum paprikum sugarbrownum, allium cuminatum piperum salum. Involvum chartapaper foilum, requiem sliceum servum.",
1391
+ "Porcus pullum shoulderum, forkum tenderum shredicus altum. Carolina acetum mustardus, Kansas Civitas dulcis crassum. Coleslavium pickledus panisalbus, proprium plateum completum.",
1392
+ "Brisketum planum puntum totum, pinguem capsum updownum debatum. Fumus annulus roseum halum, probatum technicum igneum. Sectum contra granum semper, humidus macer finibus ustum.",
1393
+ "Finibus ustum dulcis carneum, caramelum cubum iactum salsamentum. Puntum separatum cubum, revertum fumatorium horam plus. Crispum marginibus tenerum centrum, pitmasterus praemium meritum.",
1394
+ "Farciminis nexum calidus intestinum, crepitus tegumen sucus eruptum. Bubulum porcinum mixtum conditum, fumum iuxta praecipuum sectum. Obliquum servum superbus, sinapis optionalum acceptum.",
1395
+ "Pullum femur quartum totum, pellis crispum carnem sucum. Alabama salsamentum album, acetum Carolina moppum stylum. Tractum fumatum grillum optiones, gallinaceum rectum bonum.",
1396
+ "Fricatum siccum pasta humidum, pernoctem frigidarium marinatum requiem. Sal piper simplex Texanum, complexum Memphis mixtum secretum. Applicare generosum aequum tegmen, cortex formatur pulchre.",
1397
+ "Lateribus fabae coleslavium paniscornum, caseum macaroni salatum tuberosum. Pickledus cepae jalape\xF1us, panisalbus butyrum sectum. Completum plateum aequilibratum prandium, carneum stella lateribus sustentum.",
1398
+ "Fumus surgit caminus ascendit, linea formatur mane fidelis. Venditum signum timendum, mane avis obtinet carneum. Dignum omnis expectatio minutum, pitmasterus ars respectum."
1399
+ ],
1400
+ headings: [
1401
+ "Smoked",
1402
+ "Low and Slow",
1403
+ "The Pit",
1404
+ "Fire",
1405
+ "Bark",
1406
+ "Rub",
1407
+ "Sauce",
1408
+ "Tender",
1409
+ "Pitmaster Wisdom",
1410
+ "Smoke Ring Secrets",
1411
+ "Brisket Basics",
1412
+ "Rib Techniques",
1413
+ "Regional Styles",
1414
+ "Wood Selection",
1415
+ "Temperature Control",
1416
+ "The Art of the Smoke",
1417
+ "Building the Perfect Fire",
1418
+ "Mastering the Meat Sweats",
1419
+ "Competition BBQ Secrets",
1420
+ "Sauce Versus Dry Rub",
1421
+ "Choosing Your Wood",
1422
+ "The Overnight Cook",
1423
+ "From Pit to Plate"
1424
+ ],
1425
+ listItems: ["Smoky goodness", "Fall off the bone", "Worth the wait"]
1426
+ }
1427
+ ];
1428
+
1429
+ // utils/random.ts
1430
+ var LCPRNG_MULTIPLIER = 9301;
1431
+ var LCPRNG_INCREMENT = 49297;
1432
+ var LCPRNG_MODULUS = 233280;
1433
+ var MAX_SEED = 2147483647;
1434
+ function normalizeSeed(seedValue) {
1435
+ if (!Number.isFinite(seedValue)) return 0;
1436
+ const whole = Math.trunc(seedValue);
1437
+ return (whole % LCPRNG_MODULUS + LCPRNG_MODULUS) % LCPRNG_MODULUS;
1438
+ }
1439
+ var SEED_PERIOD = LCPRNG_MODULUS;
1440
+ var SEED_OFFSETS = {
1441
+ HEADINGS: 500,
1442
+ BLOCK_SIZES: 1e3
1443
+ };
1444
+ function seededRandom(seedValue) {
1445
+ let currentSeed = normalizeSeed(seedValue);
1446
+ return {
1447
+ next: () => {
1448
+ currentSeed = (currentSeed * LCPRNG_MULTIPLIER + LCPRNG_INCREMENT) % LCPRNG_MODULUS;
1449
+ return currentSeed / LCPRNG_MODULUS;
1450
+ },
1451
+ nextInt: (min, max) => {
1452
+ currentSeed = (currentSeed * LCPRNG_MULTIPLIER + LCPRNG_INCREMENT) % LCPRNG_MODULUS;
1453
+ return Math.floor(currentSeed / LCPRNG_MODULUS * (max - min + 1)) + min;
1454
+ }
1455
+ };
1456
+ }
1457
+ function shuffleWithSeed(array, seedValue) {
1458
+ const shuffled = [...array];
1459
+ const rng = seededRandom(seedValue);
1460
+ for (let i = shuffled.length - 1; i > 0; i--) {
1461
+ const j2 = Math.floor(rng.next() * (i + 1));
1462
+ const temp = shuffled[i];
1463
+ shuffled[i] = shuffled[j2];
1464
+ shuffled[j2] = temp;
1465
+ }
1466
+ return shuffled;
1467
+ }
1468
+
1469
+ // utils/generate.ts
1470
+ function generate(params) {
1471
+ const { theme, blocks, seed, options } = params;
1472
+ const paragraphs2 = shuffleWithSeed(theme.paragraphs, seed);
1473
+ const headings = shuffleWithSeed(theme.headings, seed + SEED_OFFSETS.HEADINGS);
1474
+ const listItems = theme.listItems;
1475
+ const rng = seededRandom(seed + SEED_OFFSETS.BLOCK_SIZES);
1476
+ const blockSeparator = options.noWrap ? " " : "\n\n";
1477
+ const bodyBlocks = [];
1478
+ let output = "";
1479
+ let paragraphIndex = 0;
1480
+ let headingIndex = 0;
1481
+ let currentHeadingLevel = 1;
1482
+ let blocksUntilNextHeading = 0;
1483
+ const getNextHeading = () => {
1484
+ const text = headings[headingIndex % headings.length] ?? "Section";
1485
+ headingIndex++;
1486
+ return options.capitalize ? text : text.toLowerCase();
1487
+ };
1488
+ const makeHeading = (level, text) => {
1489
+ const hashes = "#".repeat(level);
1490
+ if (options.noWrap) {
1491
+ return `${hashes} ${text} `;
1492
+ }
1493
+ return `${hashes} ${text}
1494
+
1495
+ `;
1496
+ };
1497
+ for (let i = 0; i < blocks; i++) {
1498
+ const blockSize = rng.nextInt(1, 3);
1499
+ let blockContent = "";
1500
+ for (let j2 = 0; j2 < blockSize; j2++) {
1501
+ const rawSentence = paragraphs2[paragraphIndex % paragraphs2.length] ?? "";
1502
+ paragraphIndex++;
1503
+ const sentence = options.capitalize ? rawSentence : rawSentence.toLowerCase();
1504
+ blockContent += sentence + " ";
1505
+ }
1506
+ blockContent = blockContent.trim();
1507
+ bodyBlocks.push(blockContent);
1508
+ if (options.headers) {
1509
+ if (i === 0) {
1510
+ output += makeHeading(1, getNextHeading());
1511
+ currentHeadingLevel = 2;
1512
+ blocksUntilNextHeading = rng.nextInt(1, 3);
1513
+ } else if (blocksUntilNextHeading <= 0) {
1514
+ const decision = rng.nextInt(1, 10);
1515
+ if (decision <= 3 && currentHeadingLevel < 4) {
1516
+ currentHeadingLevel++;
1517
+ } else if (decision <= 5 && currentHeadingLevel > 2) {
1518
+ currentHeadingLevel--;
1519
+ } else if (decision <= 7 && currentHeadingLevel > 2) {
1520
+ currentHeadingLevel = 2;
1521
+ }
1522
+ output += makeHeading(currentHeadingLevel, getNextHeading());
1523
+ blocksUntilNextHeading = rng.nextInt(1, 4);
1524
+ } else {
1525
+ blocksUntilNextHeading--;
1526
+ }
1527
+ }
1528
+ if (options.codeSnippets && i % 3 === 0) {
1529
+ if (options.noWrap) {
1530
+ output += "`const example = 'code';` ";
1531
+ } else {
1532
+ output += "```javascript\nconst example = 'code';\n```\n\n";
1533
+ }
1534
+ }
1535
+ if (options.blockquotes && i % 2 === 1) {
1536
+ if (options.noWrap) {
1537
+ output += `> ${blockContent.slice(0, 100)}... `;
1538
+ } else {
1539
+ output += `> ${blockContent.slice(0, 100)}...
1540
+
1541
+ `;
1542
+ }
1543
+ }
1544
+ if (options.lists && i % 3 === 2) {
1545
+ if (options.noWrap) {
1546
+ const items = listItems.map((item) => `\u2022 ${options.capitalize ? item : item.toLowerCase()}`).join(" ");
1547
+ output += items + " ";
1548
+ } else {
1549
+ const items = listItems.map((item) => `- ${options.capitalize ? item : item.toLowerCase()}`).join("\n");
1550
+ output += items + "\n\n";
1551
+ }
1552
+ }
1553
+ if (options.links && i % 4 === 0) {
1554
+ const linkText = options.capitalize ? "Learn more" : "learn more";
1555
+ output += `[${linkText}](https://example.com) `;
1556
+ }
1557
+ output += blockContent + blockSeparator;
1558
+ }
1559
+ if (options.noWrap) {
1560
+ output = output.replace(/<br\s*\/?>/gi, " ");
1561
+ output = output.replace(/\n+/g, " ");
1562
+ output = output.replace(/\s+/g, " ");
1563
+ output = output.trim();
1564
+ } else if (output.endsWith("\n\n")) {
1565
+ output = output.slice(0, -2);
1566
+ }
1567
+ return { text: output, blocks: bodyBlocks };
1568
+ }
1569
+ function generateText(params) {
1570
+ return generate(params).text;
1571
+ }
1572
+ function generateBlocks(params) {
1573
+ return generate(params).blocks;
1574
+ }
1575
+ function markdownToPlainText(markdown) {
1576
+ return markdown.replace(/```[\s\S]*?```/g, "").replace(/`[^`]*`/g, "").replace(/(^|\s)#{1,6}[ \t]+/g, "$1").replace(/(^|\s)>[ \t]+/g, "$1").replace(/(^|\s)[-*•][ \t]+/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/[ \t]{2,}/g, " ").replace(/\n{3,}/g, "\n\n").trim();
1577
+ }
1578
+
1579
+ // packages/ipsumify/src/index.ts
1580
+ var MIN_BLOCKS = 1;
1581
+ var MAX_BLOCKS = 20;
1582
+ var DEFAULT_BLOCKS = 5;
1583
+ var DEFAULT_THEME = "lorem";
1584
+ var FORMATS = ["markdown", "text", "html"];
1585
+ var themes2 = themes.map((t) => ({ id: t.id, label: t.label }));
1586
+ function randomSeed() {
1587
+ return Math.floor(Math.random() * SEED_PERIOD);
1588
+ }
1589
+ function resolve(options) {
1590
+ const themeId = options.theme ?? DEFAULT_THEME;
1591
+ const theme = themes.find((t) => t.id === themeId);
1592
+ if (!theme) {
1593
+ throw new RangeError(`Invalid theme "${themeId}". Valid themes: ${themes.map((t) => t.id).join(", ")}`);
1594
+ }
1595
+ const blocks = options.blocks ?? DEFAULT_BLOCKS;
1596
+ if (!Number.isInteger(blocks) || blocks < MIN_BLOCKS || blocks > MAX_BLOCKS) {
1597
+ throw new RangeError(`Invalid blocks "${blocks}". Must be a whole number between ${MIN_BLOCKS} and ${MAX_BLOCKS}.`);
1598
+ }
1599
+ const seed = options.seed ?? randomSeed();
1600
+ if (!Number.isInteger(seed) || seed < 0 || seed > MAX_SEED) {
1601
+ throw new RangeError(`Invalid seed "${seed}". Must be a whole number between 0 and ${MAX_SEED}.`);
1602
+ }
1603
+ const format = options.format ?? "markdown";
1604
+ if (!FORMATS.includes(format)) {
1605
+ throw new RangeError(`Invalid format "${format}". Valid formats: ${FORMATS.join(", ")}`);
1606
+ }
1607
+ return {
1608
+ format,
1609
+ params: {
1610
+ theme,
1611
+ blocks,
1612
+ seed,
1613
+ options: {
1614
+ headers: options.headers ?? false,
1615
+ codeSnippets: options.code ?? false,
1616
+ blockquotes: options.quotes ?? false,
1617
+ lists: options.lists ?? false,
1618
+ links: options.links ?? false,
1619
+ capitalize: !(options.lowercase ?? false),
1620
+ noWrap: options.noWrap ?? false
1621
+ }
1622
+ }
1623
+ };
1624
+ }
1625
+ function ipsumify(options = {}) {
1626
+ const { format, params } = resolve(options);
1627
+ const markdown = generateText(params);
1628
+ if (format === "text") return markdownToPlainText(markdown);
1629
+ if (format === "html") return g.parse(markdown, { async: false }).trimEnd();
1630
+ return markdown;
1631
+ }
1632
+ function paragraphs(options = {}) {
1633
+ return generateBlocks(resolve(options).params);
1634
+ }
1635
+ var src_default = ipsumify;
1636
+
1637
+ export {
1638
+ MAX_SEED,
1639
+ MIN_BLOCKS,
1640
+ MAX_BLOCKS,
1641
+ DEFAULT_BLOCKS,
1642
+ DEFAULT_THEME,
1643
+ FORMATS,
1644
+ themes2 as themes,
1645
+ randomSeed,
1646
+ ipsumify,
1647
+ paragraphs,
1648
+ src_default
1649
+ };