@wsxjs/wsx-press 0.0.23 → 0.0.24

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.
package/dist/node.js CHANGED
@@ -2,63 +2,74 @@ var Te = Object.defineProperty;
2
2
  var ne = (a) => {
3
3
  throw TypeError(a);
4
4
  };
5
- var ze = (a, t, e) => t in a ? Te(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
6
- var k = (a, t, e) => ze(a, typeof t != "symbol" ? t + "" : t, e), Re = (a, t, e) => t.has(a) || ne("Cannot " + e);
7
- var se = (a, t, e) => t.has(a) ? ne("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, e);
8
- var v = (a, t, e) => (Re(a, t, "access private method"), e);
5
+ var ze = (a, n, e) => n in a ? Te(a, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[n] = e;
6
+ var k = (a, n, e) => ze(a, typeof n != "symbol" ? n + "" : n, e), Re = (a, n, e) => n.has(a) || ne("Cannot " + e);
7
+ var se = (a, n, e) => n.has(a) ? ne("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, e);
8
+ var v = (a, n, e) => (Re(a, n, "access private method"), e);
9
9
  import { glob as Se } from "glob";
10
10
  import x from "path";
11
11
  import m from "fs-extra";
12
- import { Application as _e, TSConfigReader as Ie, TypeDocReader as Ae } from "typedoc";
13
- import { c as Ce } from "./index-RqS0LFTH.js";
12
+ import { Application as _e, TSConfigReader as Ae, TypeDocReader as Ie } from "typedoc";
13
+ import { c as Ee } from "./index-RqS0LFTH.js";
14
14
  async function O(a) {
15
- const t = await Se("**/*.md", { cwd: a, absolute: !0 }), e = {};
16
- for (const n of t) {
17
- const i = x.relative(a, n), r = await m.readFile(n, "utf-8"), s = je(r), l = i.replace(/\.md$/, ""), o = x.dirname(i);
15
+ const n = await Se("**/*.md", { cwd: a, absolute: !0 }), e = {};
16
+ for (const t of n) {
17
+ const i = x.relative(a, t), r = await m.readFile(t, "utf-8"), s = Ce(r), l = i.replace(/\.md$/, ""), o = x.dirname(i);
18
18
  e[l] = {
19
- title: s.title || x.basename(n, ".md"),
20
- category: o === "." ? "." : o,
19
+ title: s.title || x.basename(t, ".md"),
20
+ // 优先使用 frontmatter 中的 category,如果没有则使用 dirname
21
+ category: s.category || (o === "." ? "." : o),
21
22
  route: `/docs/${l}`,
22
23
  ...s
23
24
  };
24
25
  }
25
- return Ee(e);
26
+ return je(e);
26
27
  }
27
- function je(a) {
28
- const t = a.match(/^---\n([\s\S]*?)\n---/);
29
- if (!t)
28
+ function Ce(a) {
29
+ const n = a.match(/^---\n([\s\S]*?)\n---/);
30
+ if (!n)
30
31
  return {};
31
- const e = t[1], n = {};
32
+ const e = n[1], t = {};
32
33
  return e.split(`
33
34
  `).forEach((i) => {
34
35
  const r = i.indexOf(":");
35
36
  if (r === -1)
36
37
  return;
37
38
  const s = i.substring(0, r).trim(), l = i.substring(r + 1).trim();
38
- s && l && (s === "title" || s === "description" || s === "category" ? n[s] = l : s === "tags" ? n.tags = l.replace(/[[\]]/g, "").split(",").map((o) => o.trim()) : n[s] = l);
39
- }), n;
39
+ if (s && l)
40
+ if (s === "title" || s === "description" || s === "category") {
41
+ let o = l.replace(/^["']|["']$/g, "");
42
+ o.includes("&") && (o = o.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&")), t[s] = o;
43
+ } else if (s === "order") {
44
+ const o = Number.parseInt(l, 10);
45
+ Number.isNaN(o) || (t.order = o);
46
+ } else s === "tags" ? t.tags = l.replace(/[[\]]/g, "").split(",").map((o) => o.trim()) : t[s] = l;
47
+ }), t;
40
48
  }
41
- function Ee(a) {
42
- const t = /* @__PURE__ */ new Map();
43
- for (const [e, n] of Object.entries(a)) {
44
- const i = n.category;
45
- t.has(i) || t.set(i, []), t.get(i).push(e);
46
- }
47
- for (const [e, n] of t) {
48
- n.sort();
49
- for (let i = 0; i < n.length; i++) {
50
- const r = n[i];
51
- a[r].prev = i > 0 ? `/docs/${n[i - 1]}` : null, a[r].next = i < n.length - 1 ? `/docs/${n[i + 1]}` : null;
49
+ function je(a) {
50
+ const n = /* @__PURE__ */ new Map();
51
+ for (const [e, t] of Object.entries(a)) {
52
+ const i = t.category;
53
+ n.has(i) || n.set(i, []), n.get(i).push(e);
54
+ }
55
+ for (const [e, t] of n) {
56
+ t.sort((i, r) => {
57
+ const s = a[i].order ?? Number.MAX_SAFE_INTEGER, l = a[r].order ?? Number.MAX_SAFE_INTEGER;
58
+ return s !== l ? s - l : i.localeCompare(r);
59
+ });
60
+ for (let i = 0; i < t.length; i++) {
61
+ const r = t[i];
62
+ a[r].prev = i > 0 ? `/docs/${t[i - 1]}` : null, a[r].next = i < t.length - 1 ? `/docs/${t[i + 1]}` : null;
52
63
  }
53
64
  }
54
65
  return a;
55
66
  }
56
- async function ie(a, t) {
67
+ async function ie(a, n) {
57
68
  const e = [];
58
- for (const [n, i] of Object.entries(a)) {
59
- const r = x.join(t, `${n}.md`), l = (await m.readFile(r, "utf-8")).replace(/^---[\s\S]*?---/, "").replace(/```[\s\S]*?```/g, "").replace(/[#*`_[\]()]/g, "").trim();
69
+ for (const [t, i] of Object.entries(a)) {
70
+ const r = x.join(n, `${t}.md`), l = (await m.readFile(r, "utf-8")).replace(/^---[\s\S]*?---/, "").replace(/```[\s\S]*?```/g, "").replace(/[#*`_[\]()]/g, "").trim();
60
71
  e.push({
61
- id: n,
72
+ id: t,
62
73
  title: i.title,
63
74
  category: i.category,
64
75
  route: i.route,
@@ -80,23 +91,23 @@ async function ie(a, t) {
80
91
  }
81
92
  async function Pe(a) {
82
93
  const {
83
- entryPoints: t,
94
+ entryPoints: n,
84
95
  tsconfig: e,
85
- outputDir: n,
96
+ outputDir: t,
86
97
  excludePrivate: i = !0,
87
98
  excludeProtected: r = !1,
88
99
  excludeInternal: s = !0,
89
100
  publicPath: l = "/api/"
90
101
  } = a;
91
- for (const o of t)
102
+ for (const o of n)
92
103
  if (!await m.pathExists(o))
93
104
  throw new Error(`Entry point not found: ${o}`);
94
105
  if (!await m.pathExists(e))
95
106
  throw new Error(`TypeScript config not found: ${e}`);
96
- await m.ensureDir(n);
107
+ await m.ensureDir(t);
97
108
  try {
98
109
  const o = await _e.bootstrapWithPlugins({
99
- entryPoints: t,
110
+ entryPoints: n,
100
111
  tsconfig: e,
101
112
  plugin: ["typedoc-plugin-markdown"],
102
113
  theme: "markdown",
@@ -107,11 +118,11 @@ async function Pe(a) {
107
118
  excludeInternal: s,
108
119
  publicPath: l
109
120
  });
110
- o.options.addReader(new Ie()), o.options.addReader(new Ae());
121
+ o.options.addReader(new Ae()), o.options.addReader(new Ie());
111
122
  const p = await o.convert();
112
123
  if (!p)
113
124
  throw new Error("Failed to convert TypeScript project");
114
- await o.generateDocs(p, n);
125
+ await o.generateDocs(p, t);
115
126
  } catch (o) {
116
127
  throw new Error(
117
128
  `Failed to generate API documentation: ${o instanceof Error ? o.message : String(o)}`
@@ -132,9 +143,9 @@ function J() {
132
143
  walkTokens: null
133
144
  };
134
145
  }
135
- let I = J();
146
+ let A = J();
136
147
  function pe(a) {
137
- I = a;
148
+ A = a;
138
149
  }
139
150
  const ue = /[&<>"']/, ve = new RegExp(ue.source, "g"), fe = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Oe = new RegExp(fe.source, "g"), Le = {
140
151
  "&": "&amp;",
@@ -143,8 +154,8 @@ const ue = /[&<>"']/, ve = new RegExp(ue.source, "g"), fe = /[<>"']|&(?!(#\d{1,7
143
154
  '"': "&quot;",
144
155
  "'": "&#39;"
145
156
  }, re = (a) => Le[a];
146
- function b(a, t) {
147
- if (t) {
157
+ function b(a, n) {
158
+ if (n) {
148
159
  if (ue.test(a))
149
160
  return a.replace(ve, re);
150
161
  } else if (fe.test(a))
@@ -152,21 +163,21 @@ function b(a, t) {
152
163
  return a;
153
164
  }
154
165
  const De = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
155
- function Ze(a) {
156
- return a.replace(De, (t, e) => (e = e.toLowerCase(), e === "colon" ? ":" : e.charAt(0) === "#" ? e.charAt(1) === "x" ? String.fromCharCode(parseInt(e.substring(2), 16)) : String.fromCharCode(+e.substring(1)) : ""));
166
+ function Ne(a) {
167
+ return a.replace(De, (n, e) => (e = e.toLowerCase(), e === "colon" ? ":" : e.charAt(0) === "#" ? e.charAt(1) === "x" ? String.fromCharCode(parseInt(e.substring(2), 16)) : String.fromCharCode(+e.substring(1)) : ""));
157
168
  }
158
- const qe = /(^|[^\[])\^/g;
159
- function d(a, t) {
169
+ const Ze = /(^|[^\[])\^/g;
170
+ function d(a, n) {
160
171
  let e = typeof a == "string" ? a : a.source;
161
- t = t || "";
162
- const n = {
172
+ n = n || "";
173
+ const t = {
163
174
  replace: (i, r) => {
164
175
  let s = typeof r == "string" ? r : r.source;
165
- return s = s.replace(qe, "$1"), e = e.replace(i, s), n;
176
+ return s = s.replace(Ze, "$1"), e = e.replace(i, s), t;
166
177
  },
167
- getRegex: () => new RegExp(e, t)
178
+ getRegex: () => new RegExp(e, n)
168
179
  };
169
- return n;
180
+ return t;
170
181
  }
171
182
  function oe(a) {
172
183
  try {
@@ -176,60 +187,60 @@ function oe(a) {
176
187
  }
177
188
  return a;
178
189
  }
179
- const C = { exec: () => null };
180
- function le(a, t) {
190
+ const E = { exec: () => null };
191
+ function le(a, n) {
181
192
  const e = a.replace(/\|/g, (r, s, l) => {
182
193
  let o = !1, p = s;
183
194
  for (; --p >= 0 && l[p] === "\\"; )
184
195
  o = !o;
185
196
  return o ? "|" : " |";
186
- }), n = e.split(/ \|/);
197
+ }), t = e.split(/ \|/);
187
198
  let i = 0;
188
- if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), t)
189
- if (n.length > t)
190
- n.splice(t);
199
+ if (t[0].trim() || t.shift(), t.length > 0 && !t[t.length - 1].trim() && t.pop(), n)
200
+ if (t.length > n)
201
+ t.splice(n);
191
202
  else
192
- for (; n.length < t; )
193
- n.push("");
194
- for (; i < n.length; i++)
195
- n[i] = n[i].trim().replace(/\\\|/g, "|");
196
- return n;
203
+ for (; t.length < n; )
204
+ t.push("");
205
+ for (; i < t.length; i++)
206
+ t[i] = t[i].trim().replace(/\\\|/g, "|");
207
+ return t;
197
208
  }
198
- function L(a, t, e) {
199
- const n = a.length;
200
- if (n === 0)
209
+ function L(a, n, e) {
210
+ const t = a.length;
211
+ if (t === 0)
201
212
  return "";
202
213
  let i = 0;
203
- for (; i < n && a.charAt(n - i - 1) === t; )
214
+ for (; i < t && a.charAt(t - i - 1) === n; )
204
215
  i++;
205
- return a.slice(0, n - i);
216
+ return a.slice(0, t - i);
206
217
  }
207
- function Be(a, t) {
208
- if (a.indexOf(t[1]) === -1)
218
+ function qe(a, n) {
219
+ if (a.indexOf(n[1]) === -1)
209
220
  return -1;
210
221
  let e = 0;
211
- for (let n = 0; n < a.length; n++)
212
- if (a[n] === "\\")
213
- n++;
214
- else if (a[n] === t[0])
222
+ for (let t = 0; t < a.length; t++)
223
+ if (a[t] === "\\")
224
+ t++;
225
+ else if (a[t] === n[0])
215
226
  e++;
216
- else if (a[n] === t[1] && (e--, e < 0))
217
- return n;
227
+ else if (a[t] === n[1] && (e--, e < 0))
228
+ return t;
218
229
  return -1;
219
230
  }
220
- function ae(a, t, e, n) {
221
- const i = t.href, r = t.title ? b(t.title) : null, s = a[1].replace(/\\([\[\]])/g, "$1");
231
+ function ae(a, n, e, t) {
232
+ const i = n.href, r = n.title ? b(n.title) : null, s = a[1].replace(/\\([\[\]])/g, "$1");
222
233
  if (a[0].charAt(0) !== "!") {
223
- n.state.inLink = !0;
234
+ t.state.inLink = !0;
224
235
  const l = {
225
236
  type: "link",
226
237
  raw: e,
227
238
  href: i,
228
239
  title: r,
229
240
  text: s,
230
- tokens: n.inlineTokens(s)
241
+ tokens: t.inlineTokens(s)
231
242
  };
232
- return n.state.inLink = !1, l;
243
+ return t.state.inLink = !1, l;
233
244
  }
234
245
  return {
235
246
  type: "image",
@@ -239,138 +250,138 @@ function ae(a, t, e, n) {
239
250
  text: b(s)
240
251
  };
241
252
  }
242
- function Me(a, t) {
253
+ function Be(a, n) {
243
254
  const e = a.match(/^(\s+)(?:```)/);
244
255
  if (e === null)
245
- return t;
246
- const n = e[1];
247
- return t.split(`
256
+ return n;
257
+ const t = e[1];
258
+ return n.split(`
248
259
  `).map((i) => {
249
260
  const r = i.match(/^\s+/);
250
261
  if (r === null)
251
262
  return i;
252
263
  const [s] = r;
253
- return s.length >= n.length ? i.slice(n.length) : i;
264
+ return s.length >= t.length ? i.slice(t.length) : i;
254
265
  }).join(`
255
266
  `);
256
267
  }
257
- class Z {
268
+ class N {
258
269
  // set by the lexer
259
- constructor(t) {
270
+ constructor(n) {
260
271
  k(this, "options");
261
272
  k(this, "rules");
262
273
  // set by the lexer
263
274
  k(this, "lexer");
264
- this.options = t || I;
275
+ this.options = n || A;
265
276
  }
266
- space(t) {
267
- const e = this.rules.block.newline.exec(t);
277
+ space(n) {
278
+ const e = this.rules.block.newline.exec(n);
268
279
  if (e && e[0].length > 0)
269
280
  return {
270
281
  type: "space",
271
282
  raw: e[0]
272
283
  };
273
284
  }
274
- code(t) {
275
- const e = this.rules.block.code.exec(t);
285
+ code(n) {
286
+ const e = this.rules.block.code.exec(n);
276
287
  if (e) {
277
- const n = e[0].replace(/^ {1,4}/gm, "");
288
+ const t = e[0].replace(/^ {1,4}/gm, "");
278
289
  return {
279
290
  type: "code",
280
291
  raw: e[0],
281
292
  codeBlockStyle: "indented",
282
- text: this.options.pedantic ? n : L(n, `
293
+ text: this.options.pedantic ? t : L(t, `
283
294
  `)
284
295
  };
285
296
  }
286
297
  }
287
- fences(t) {
288
- const e = this.rules.block.fences.exec(t);
298
+ fences(n) {
299
+ const e = this.rules.block.fences.exec(n);
289
300
  if (e) {
290
- const n = e[0], i = Me(n, e[3] || "");
301
+ const t = e[0], i = Be(t, e[3] || "");
291
302
  return {
292
303
  type: "code",
293
- raw: n,
304
+ raw: t,
294
305
  lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2],
295
306
  text: i
296
307
  };
297
308
  }
298
309
  }
299
- heading(t) {
300
- const e = this.rules.block.heading.exec(t);
310
+ heading(n) {
311
+ const e = this.rules.block.heading.exec(n);
301
312
  if (e) {
302
- let n = e[2].trim();
303
- if (/#$/.test(n)) {
304
- const i = L(n, "#");
305
- (this.options.pedantic || !i || / $/.test(i)) && (n = i.trim());
313
+ let t = e[2].trim();
314
+ if (/#$/.test(t)) {
315
+ const i = L(t, "#");
316
+ (this.options.pedantic || !i || / $/.test(i)) && (t = i.trim());
306
317
  }
307
318
  return {
308
319
  type: "heading",
309
320
  raw: e[0],
310
321
  depth: e[1].length,
311
- text: n,
312
- tokens: this.lexer.inline(n)
322
+ text: t,
323
+ tokens: this.lexer.inline(t)
313
324
  };
314
325
  }
315
326
  }
316
- hr(t) {
317
- const e = this.rules.block.hr.exec(t);
327
+ hr(n) {
328
+ const e = this.rules.block.hr.exec(n);
318
329
  if (e)
319
330
  return {
320
331
  type: "hr",
321
332
  raw: e[0]
322
333
  };
323
334
  }
324
- blockquote(t) {
325
- const e = this.rules.block.blockquote.exec(t);
335
+ blockquote(n) {
336
+ const e = this.rules.block.blockquote.exec(n);
326
337
  if (e) {
327
- let n = e[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
338
+ let t = e[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
328
339
  $1`);
329
- n = L(n.replace(/^ *>[ \t]?/gm, ""), `
340
+ t = L(t.replace(/^ *>[ \t]?/gm, ""), `
330
341
  `);
331
342
  const i = this.lexer.state.top;
332
343
  this.lexer.state.top = !0;
333
- const r = this.lexer.blockTokens(n);
344
+ const r = this.lexer.blockTokens(t);
334
345
  return this.lexer.state.top = i, {
335
346
  type: "blockquote",
336
347
  raw: e[0],
337
348
  tokens: r,
338
- text: n
349
+ text: t
339
350
  };
340
351
  }
341
352
  }
342
- list(t) {
343
- let e = this.rules.block.list.exec(t);
353
+ list(n) {
354
+ let e = this.rules.block.list.exec(n);
344
355
  if (e) {
345
- let n = e[1].trim();
346
- const i = n.length > 1, r = {
356
+ let t = e[1].trim();
357
+ const i = t.length > 1, r = {
347
358
  type: "list",
348
359
  raw: "",
349
360
  ordered: i,
350
- start: i ? +n.slice(0, -1) : "",
361
+ start: i ? +t.slice(0, -1) : "",
351
362
  loose: !1,
352
363
  items: []
353
364
  };
354
- n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
355
- const s = new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);
365
+ t = i ? `\\d{1,9}\\${t.slice(-1)}` : `\\${t}`, this.options.pedantic && (t = i ? t : "[*+-]");
366
+ const s = new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`);
356
367
  let l = "", o = "", p = !1;
357
- for (; t; ) {
368
+ for (; n; ) {
358
369
  let c = !1;
359
- if (!(e = s.exec(t)) || this.rules.block.hr.test(t))
370
+ if (!(e = s.exec(n)) || this.rules.block.hr.test(n))
360
371
  break;
361
- l = e[0], t = t.substring(l.length);
372
+ l = e[0], n = n.substring(l.length);
362
373
  let u = e[2].split(`
363
- `, 1)[0].replace(/^\t+/, (N) => " ".repeat(3 * N.length)), h = t.split(`
374
+ `, 1)[0].replace(/^\t+/, (M) => " ".repeat(3 * M.length)), h = n.split(`
364
375
  `, 1)[0], f = 0;
365
376
  this.options.pedantic ? (f = 2, o = u.trimStart()) : (f = e[2].search(/[^ ]/), f = f > 4 ? 1 : f, o = u.slice(f), f += e[1].length);
366
377
  let w = !1;
367
378
  if (!u && /^ *$/.test(h) && (l += h + `
368
- `, t = t.substring(h.length + 1), c = !0), !c) {
369
- const N = new RegExp(`^ {0,${Math.min(3, f - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), Y = new RegExp(`^ {0,${Math.min(3, f - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), ee = new RegExp(`^ {0,${Math.min(3, f - 1)}}(?:\`\`\`|~~~)`), te = new RegExp(`^ {0,${Math.min(3, f - 1)}}#`);
370
- for (; t; ) {
371
- const F = t.split(`
379
+ `, n = n.substring(h.length + 1), c = !0), !c) {
380
+ const M = new RegExp(`^ {0,${Math.min(3, f - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), Y = new RegExp(`^ {0,${Math.min(3, f - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), ee = new RegExp(`^ {0,${Math.min(3, f - 1)}}(?:\`\`\`|~~~)`), te = new RegExp(`^ {0,${Math.min(3, f - 1)}}#`);
381
+ for (; n; ) {
382
+ const F = n.split(`
372
383
  `, 1)[0];
373
- if (h = F, this.options.pedantic && (h = h.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), ee.test(h) || te.test(h) || N.test(h) || Y.test(t))
384
+ if (h = F, this.options.pedantic && (h = h.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), ee.test(h) || te.test(h) || M.test(h) || Y.test(n))
374
385
  break;
375
386
  if (h.search(/[^ ]/) >= f || !h.trim())
376
387
  o += `
@@ -382,7 +393,7 @@ class Z {
382
393
  ` + h;
383
394
  }
384
395
  !w && !h.trim() && (w = !0), l += F + `
385
- `, t = t.substring(F.length + 1), u = h.slice(f);
396
+ `, n = n.substring(F.length + 1), u = h.slice(f);
386
397
  }
387
398
  }
388
399
  r.loose || (p ? r.loose = !0 : /\n *\n *$/.test(l) && (p = !0));
@@ -409,8 +420,8 @@ class Z {
409
420
  return r;
410
421
  }
411
422
  }
412
- html(t) {
413
- const e = this.rules.block.html.exec(t);
423
+ html(n) {
424
+ const e = this.rules.block.html.exec(n);
414
425
  if (e)
415
426
  return {
416
427
  type: "html",
@@ -420,24 +431,24 @@ class Z {
420
431
  text: e[0]
421
432
  };
422
433
  }
423
- def(t) {
424
- const e = this.rules.block.def.exec(t);
434
+ def(n) {
435
+ const e = this.rules.block.def.exec(n);
425
436
  if (e) {
426
- const n = e[1].toLowerCase().replace(/\s+/g, " "), i = e[2] ? e[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
437
+ const t = e[1].toLowerCase().replace(/\s+/g, " "), i = e[2] ? e[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
427
438
  return {
428
439
  type: "def",
429
- tag: n,
440
+ tag: t,
430
441
  raw: e[0],
431
442
  href: i,
432
443
  title: r
433
444
  };
434
445
  }
435
446
  }
436
- table(t) {
437
- const e = this.rules.block.table.exec(t);
447
+ table(n) {
448
+ const e = this.rules.block.table.exec(n);
438
449
  if (!e || !/[:|]/.test(e[2]))
439
450
  return;
440
- const n = le(e[1]), i = e[2].replace(/^\||\| *$/g, "").split("|"), r = e[3] && e[3].trim() ? e[3].replace(/\n[ \t]*$/, "").split(`
451
+ const t = le(e[1]), i = e[2].replace(/^\||\| *$/g, "").split("|"), r = e[3] && e[3].trim() ? e[3].replace(/\n[ \t]*$/, "").split(`
441
452
  `) : [], s = {
442
453
  type: "table",
443
454
  raw: e[0],
@@ -445,10 +456,10 @@ class Z {
445
456
  align: [],
446
457
  rows: []
447
458
  };
448
- if (n.length === i.length) {
459
+ if (t.length === i.length) {
449
460
  for (const l of i)
450
461
  /^ *-+: *$/.test(l) ? s.align.push("right") : /^ *:-+: *$/.test(l) ? s.align.push("center") : /^ *:-+ *$/.test(l) ? s.align.push("left") : s.align.push(null);
451
- for (const l of n)
462
+ for (const l of t)
452
463
  s.header.push({
453
464
  text: l,
454
465
  tokens: this.lexer.inline(l)
@@ -461,8 +472,8 @@ class Z {
461
472
  return s;
462
473
  }
463
474
  }
464
- lheading(t) {
465
- const e = this.rules.block.lheading.exec(t);
475
+ lheading(n) {
476
+ const e = this.rules.block.lheading.exec(n);
466
477
  if (e)
467
478
  return {
468
479
  type: "heading",
@@ -472,21 +483,21 @@ class Z {
472
483
  tokens: this.lexer.inline(e[1])
473
484
  };
474
485
  }
475
- paragraph(t) {
476
- const e = this.rules.block.paragraph.exec(t);
486
+ paragraph(n) {
487
+ const e = this.rules.block.paragraph.exec(n);
477
488
  if (e) {
478
- const n = e[1].charAt(e[1].length - 1) === `
489
+ const t = e[1].charAt(e[1].length - 1) === `
479
490
  ` ? e[1].slice(0, -1) : e[1];
480
491
  return {
481
492
  type: "paragraph",
482
493
  raw: e[0],
483
- text: n,
484
- tokens: this.lexer.inline(n)
494
+ text: t,
495
+ tokens: this.lexer.inline(t)
485
496
  };
486
497
  }
487
498
  }
488
- text(t) {
489
- const e = this.rules.block.text.exec(t);
499
+ text(n) {
500
+ const e = this.rules.block.text.exec(n);
490
501
  if (e)
491
502
  return {
492
503
  type: "text",
@@ -495,8 +506,8 @@ class Z {
495
506
  tokens: this.lexer.inline(e[0])
496
507
  };
497
508
  }
498
- escape(t) {
499
- const e = this.rules.inline.escape.exec(t);
509
+ escape(n) {
510
+ const e = this.rules.inline.escape.exec(n);
500
511
  if (e)
501
512
  return {
502
513
  type: "escape",
@@ -504,8 +515,8 @@ class Z {
504
515
  text: b(e[1])
505
516
  };
506
517
  }
507
- tag(t) {
508
- const e = this.rules.inline.tag.exec(t);
518
+ tag(n) {
519
+ const e = this.rules.inline.tag.exec(n);
509
520
  if (e)
510
521
  return !this.lexer.state.inLink && /^<a /i.test(e[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(e[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(e[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0]) && (this.lexer.state.inRawBlock = !1), {
511
522
  type: "html",
@@ -516,18 +527,18 @@ class Z {
516
527
  text: e[0]
517
528
  };
518
529
  }
519
- link(t) {
520
- const e = this.rules.inline.link.exec(t);
530
+ link(n) {
531
+ const e = this.rules.inline.link.exec(n);
521
532
  if (e) {
522
- const n = e[2].trim();
523
- if (!this.options.pedantic && /^</.test(n)) {
524
- if (!/>$/.test(n))
533
+ const t = e[2].trim();
534
+ if (!this.options.pedantic && /^</.test(t)) {
535
+ if (!/>$/.test(t))
525
536
  return;
526
- const s = L(n.slice(0, -1), "\\");
527
- if ((n.length - s.length) % 2 === 0)
537
+ const s = L(t.slice(0, -1), "\\");
538
+ if ((t.length - s.length) % 2 === 0)
528
539
  return;
529
540
  } else {
530
- const s = Be(e[2], "()");
541
+ const s = qe(e[2], "()");
531
542
  if (s > -1) {
532
543
  const o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + s;
533
544
  e[2] = e[2].substring(0, s), e[0] = e[0].substring(0, o).trim(), e[3] = "";
@@ -539,36 +550,36 @@ class Z {
539
550
  s && (i = s[1], r = s[3]);
540
551
  } else
541
552
  r = e[3] ? e[3].slice(1, -1) : "";
542
- return i = i.trim(), /^</.test(i) && (this.options.pedantic && !/>$/.test(n) ? i = i.slice(1) : i = i.slice(1, -1)), ae(e, {
553
+ return i = i.trim(), /^</.test(i) && (this.options.pedantic && !/>$/.test(t) ? i = i.slice(1) : i = i.slice(1, -1)), ae(e, {
543
554
  href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
544
555
  title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
545
556
  }, e[0], this.lexer);
546
557
  }
547
558
  }
548
- reflink(t, e) {
549
- let n;
550
- if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
551
- const i = (n[2] || n[1]).replace(/\s+/g, " "), r = e[i.toLowerCase()];
559
+ reflink(n, e) {
560
+ let t;
561
+ if ((t = this.rules.inline.reflink.exec(n)) || (t = this.rules.inline.nolink.exec(n))) {
562
+ const i = (t[2] || t[1]).replace(/\s+/g, " "), r = e[i.toLowerCase()];
552
563
  if (!r) {
553
- const s = n[0].charAt(0);
564
+ const s = t[0].charAt(0);
554
565
  return {
555
566
  type: "text",
556
567
  raw: s,
557
568
  text: s
558
569
  };
559
570
  }
560
- return ae(n, r, n[0], this.lexer);
571
+ return ae(t, r, t[0], this.lexer);
561
572
  }
562
573
  }
563
- emStrong(t, e, n = "") {
564
- let i = this.rules.inline.emStrongLDelim.exec(t);
565
- if (!i || i[3] && n.match(/[\p{L}\p{N}]/u))
574
+ emStrong(n, e, t = "") {
575
+ let i = this.rules.inline.emStrongLDelim.exec(n);
576
+ if (!i || i[3] && t.match(/[\p{L}\p{N}]/u))
566
577
  return;
567
- if (!(i[1] || i[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
578
+ if (!(i[1] || i[2] || "") || !t || this.rules.inline.punctuation.exec(t)) {
568
579
  const s = [...i[0]].length - 1;
569
580
  let l, o, p = s, c = 0;
570
581
  const u = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
571
- for (u.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = u.exec(e)) != null; ) {
582
+ for (u.lastIndex = 0, e = e.slice(-1 * n.length + s); (i = u.exec(e)) != null; ) {
572
583
  if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l)
573
584
  continue;
574
585
  if (o = [...l].length, i[3] || i[4]) {
@@ -581,7 +592,7 @@ class Z {
581
592
  if (p -= o, p > 0)
582
593
  continue;
583
594
  o = Math.min(o, o + p + c);
584
- const h = [...i[0]][0].length, f = t.slice(0, s + i.index + h + o);
595
+ const h = [...i[0]][0].length, f = n.slice(0, s + i.index + h + o);
585
596
  if (Math.min(s, o) % 2) {
586
597
  const y = f.slice(1, -1);
587
598
  return {
@@ -601,28 +612,28 @@ class Z {
601
612
  }
602
613
  }
603
614
  }
604
- codespan(t) {
605
- const e = this.rules.inline.code.exec(t);
615
+ codespan(n) {
616
+ const e = this.rules.inline.code.exec(n);
606
617
  if (e) {
607
- let n = e[2].replace(/\n/g, " ");
608
- const i = /[^ ]/.test(n), r = /^ /.test(n) && / $/.test(n);
609
- return i && r && (n = n.substring(1, n.length - 1)), n = b(n, !0), {
618
+ let t = e[2].replace(/\n/g, " ");
619
+ const i = /[^ ]/.test(t), r = /^ /.test(t) && / $/.test(t);
620
+ return i && r && (t = t.substring(1, t.length - 1)), t = b(t, !0), {
610
621
  type: "codespan",
611
622
  raw: e[0],
612
- text: n
623
+ text: t
613
624
  };
614
625
  }
615
626
  }
616
- br(t) {
617
- const e = this.rules.inline.br.exec(t);
627
+ br(n) {
628
+ const e = this.rules.inline.br.exec(n);
618
629
  if (e)
619
630
  return {
620
631
  type: "br",
621
632
  raw: e[0]
622
633
  };
623
634
  }
624
- del(t) {
625
- const e = this.rules.inline.del.exec(t);
635
+ del(n) {
636
+ const e = this.rules.inline.del.exec(n);
626
637
  if (e)
627
638
  return {
628
639
  type: "del",
@@ -631,36 +642,36 @@ class Z {
631
642
  tokens: this.lexer.inlineTokens(e[2])
632
643
  };
633
644
  }
634
- autolink(t) {
635
- const e = this.rules.inline.autolink.exec(t);
645
+ autolink(n) {
646
+ const e = this.rules.inline.autolink.exec(n);
636
647
  if (e) {
637
- let n, i;
638
- return e[2] === "@" ? (n = b(e[1]), i = "mailto:" + n) : (n = b(e[1]), i = n), {
648
+ let t, i;
649
+ return e[2] === "@" ? (t = b(e[1]), i = "mailto:" + t) : (t = b(e[1]), i = t), {
639
650
  type: "link",
640
651
  raw: e[0],
641
- text: n,
652
+ text: t,
642
653
  href: i,
643
654
  tokens: [
644
655
  {
645
656
  type: "text",
646
- raw: n,
647
- text: n
657
+ raw: t,
658
+ text: t
648
659
  }
649
660
  ]
650
661
  };
651
662
  }
652
663
  }
653
- url(t) {
654
- var n;
664
+ url(n) {
665
+ var t;
655
666
  let e;
656
- if (e = this.rules.inline.url.exec(t)) {
667
+ if (e = this.rules.inline.url.exec(n)) {
657
668
  let i, r;
658
669
  if (e[2] === "@")
659
670
  i = b(e[0]), r = "mailto:" + i;
660
671
  else {
661
672
  let s;
662
673
  do
663
- s = e[0], e[0] = ((n = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : n[0]) ?? "";
674
+ s = e[0], e[0] = ((t = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : t[0]) ?? "";
664
675
  while (s !== e[0]);
665
676
  i = b(e[0]), e[1] === "www." ? r = "http://" + e[0] : r = e[0];
666
677
  }
@@ -679,55 +690,55 @@ class Z {
679
690
  };
680
691
  }
681
692
  }
682
- inlineText(t) {
683
- const e = this.rules.inline.text.exec(t);
693
+ inlineText(n) {
694
+ const e = this.rules.inline.text.exec(n);
684
695
  if (e) {
685
- let n;
686
- return this.lexer.state.inRawBlock ? n = e[0] : n = b(e[0]), {
696
+ let t;
697
+ return this.lexer.state.inRawBlock ? t = e[0] : t = b(e[0]), {
687
698
  type: "text",
688
699
  raw: e[0],
689
- text: n
700
+ text: t
690
701
  };
691
702
  }
692
703
  }
693
704
  }
694
- const Ne = /^(?: *(?:\n|$))+/, Fe = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Qe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, He = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ge = /(?:[*+-]|\d{1,9}[.)])/, de = d(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, ge).replace(/blockCode/g, / {4}/).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/).getRegex(), W = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Je = /^[^\n]+/, G = /(?!\s*\])(?:\\.|[^\[\]\\])+/, We = d(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", G).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ge = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, ge).getRegex(), M = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ue = d("^ {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", M).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ke = d(W).replace("hr", E).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", M).getRegex(), Xe = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ke).getRegex(), X = {
705
+ const Me = /^(?: *(?:\n|$))+/, Fe = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Qe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, j = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, He = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ge = /(?:[*+-]|\d{1,9}[.)])/, de = d(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, ge).replace(/blockCode/g, / {4}/).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/).getRegex(), W = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Je = /^[^\n]+/, G = /(?!\s*\])(?:\\.|[^\[\]\\])+/, We = d(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", G).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ge = d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, ge).getRegex(), B = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ue = d("^ {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", B).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ke = d(W).replace("hr", j).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", B).getRegex(), Xe = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ke).getRegex(), X = {
695
706
  blockquote: Xe,
696
707
  code: Fe,
697
708
  def: We,
698
709
  fences: Qe,
699
710
  heading: He,
700
- hr: E,
711
+ hr: j,
701
712
  html: Ue,
702
713
  lheading: de,
703
714
  list: Ge,
704
- newline: Ne,
715
+ newline: Me,
705
716
  paragraph: ke,
706
- table: C,
717
+ table: E,
707
718
  text: Je
708
- }, ce = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\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", M).getRegex(), Ke = {
719
+ }, ce = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", j).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\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", B).getRegex(), Ve = {
709
720
  ...X,
710
721
  table: ce,
711
- paragraph: d(W).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ce).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", M).getRegex()
712
- }, Ve = {
722
+ paragraph: d(W).replace("hr", j).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ce).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", B).getRegex()
723
+ }, Ke = {
713
724
  ...X,
714
725
  html: d(`^ *(?: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(),
715
726
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
716
727
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
717
- fences: C,
728
+ fences: E,
718
729
  // fences not supported
719
730
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
720
- paragraph: d(W).replace("hr", E).replace("heading", ` *#{1,6} *[^
731
+ paragraph: d(W).replace("hr", j).replace("heading", ` *#{1,6} *[^
721
732
  ]`).replace("lheading", de).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
722
- }, xe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ye = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, me = /^( {2,}|\\)\n(?!\s*$)/, et = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, P = "\\p{P}\\p{S}", tt = d(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, P).getRegex(), nt = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, st = d(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, P).getRegex(), it = d("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, P).getRegex(), rt = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, P).getRegex(), ot = d(/\\([punct])/, "gu").replace(/punct/g, P).getRegex(), lt = d(/^<(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(), at = d(U).replace("(?:-->|$)", "-->").getRegex(), ct = d("^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", at).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, ht = d(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), we = d(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", G).getRegex(), be = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", G).getRegex(), pt = d("reflink|nolink(?!\\()", "g").replace("reflink", we).replace("nolink", be).getRegex(), K = {
723
- _backpedal: C,
733
+ }, xe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ye = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, me = /^( {2,}|\\)\n(?!\s*$)/, et = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, P = "\\p{P}\\p{S}", tt = d(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, P).getRegex(), nt = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, st = d(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, P).getRegex(), it = d("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, P).getRegex(), rt = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, P).getRegex(), ot = d(/\\([punct])/, "gu").replace(/punct/g, P).getRegex(), lt = d(/^<(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(), at = d(U).replace("(?:-->|$)", "-->").getRegex(), ct = d("^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", at).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Z = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, ht = d(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", Z).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), we = d(/^!?\[(label)\]\[(ref)\]/).replace("label", Z).replace("ref", G).getRegex(), be = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", G).getRegex(), pt = d("reflink|nolink(?!\\()", "g").replace("reflink", we).replace("nolink", be).getRegex(), V = {
734
+ _backpedal: E,
724
735
  // only used for GFM url
725
736
  anyPunctuation: ot,
726
737
  autolink: lt,
727
738
  blockSkip: nt,
728
739
  br: me,
729
740
  code: Ye,
730
- del: C,
741
+ del: E,
731
742
  emStrongLDelim: st,
732
743
  emStrongRDelimAst: it,
733
744
  emStrongRDelimUnd: rt,
@@ -739,13 +750,13 @@ const Ne = /^(?: *(?:\n|$))+/, Fe = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Qe =
739
750
  reflinkSearch: pt,
740
751
  tag: ct,
741
752
  text: et,
742
- url: C
753
+ url: E
743
754
  }, ut = {
744
- ...K,
745
- link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(),
746
- reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex()
755
+ ...V,
756
+ link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Z).getRegex(),
757
+ reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Z).getRegex()
747
758
  }, Q = {
748
- ...K,
759
+ ...V,
749
760
  escape: d(xe).replace("])", "~|])").getRegex(),
750
761
  url: d(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
751
762
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
@@ -757,31 +768,31 @@ const Ne = /^(?: *(?:\n|$))+/, Fe = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Qe =
757
768
  text: d(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
758
769
  }, D = {
759
770
  normal: X,
760
- gfm: Ke,
761
- pedantic: Ve
762
- }, A = {
763
- normal: K,
771
+ gfm: Ve,
772
+ pedantic: Ke
773
+ }, I = {
774
+ normal: V,
764
775
  gfm: Q,
765
776
  breaks: ft,
766
777
  pedantic: ut
767
778
  };
768
779
  class T {
769
- constructor(t) {
780
+ constructor(n) {
770
781
  k(this, "tokens");
771
782
  k(this, "options");
772
783
  k(this, "state");
773
784
  k(this, "tokenizer");
774
785
  k(this, "inlineQueue");
775
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || I, this.options.tokenizer = this.options.tokenizer || new Z(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
786
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = n || A, this.options.tokenizer = this.options.tokenizer || new N(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
776
787
  inLink: !1,
777
788
  inRawBlock: !1,
778
789
  top: !0
779
790
  };
780
791
  const e = {
781
792
  block: D.normal,
782
- inline: A.normal
793
+ inline: I.normal
783
794
  };
784
- this.options.pedantic ? (e.block = D.pedantic, e.inline = A.pedantic) : this.options.gfm && (e.block = D.gfm, this.options.breaks ? e.inline = A.breaks : e.inline = A.gfm), this.tokenizer.rules = e;
795
+ this.options.pedantic ? (e.block = D.pedantic, e.inline = I.pedantic) : this.options.gfm && (e.block = D.gfm, this.options.breaks ? e.inline = I.breaks : e.inline = I.gfm), this.tokenizer.rules = e;
785
796
  }
786
797
  /**
787
798
  * Expose Rules
@@ -789,112 +800,112 @@ class T {
789
800
  static get rules() {
790
801
  return {
791
802
  block: D,
792
- inline: A
803
+ inline: I
793
804
  };
794
805
  }
795
806
  /**
796
807
  * Static Lex Method
797
808
  */
798
- static lex(t, e) {
799
- return new T(e).lex(t);
809
+ static lex(n, e) {
810
+ return new T(e).lex(n);
800
811
  }
801
812
  /**
802
813
  * Static Lex Inline Method
803
814
  */
804
- static lexInline(t, e) {
805
- return new T(e).inlineTokens(t);
815
+ static lexInline(n, e) {
816
+ return new T(e).inlineTokens(n);
806
817
  }
807
818
  /**
808
819
  * Preprocessing
809
820
  */
810
- lex(t) {
811
- t = t.replace(/\r\n|\r/g, `
812
- `), this.blockTokens(t, this.tokens);
821
+ lex(n) {
822
+ n = n.replace(/\r\n|\r/g, `
823
+ `), this.blockTokens(n, this.tokens);
813
824
  for (let e = 0; e < this.inlineQueue.length; e++) {
814
- const n = this.inlineQueue[e];
815
- this.inlineTokens(n.src, n.tokens);
825
+ const t = this.inlineQueue[e];
826
+ this.inlineTokens(t.src, t.tokens);
816
827
  }
817
828
  return this.inlineQueue = [], this.tokens;
818
829
  }
819
- blockTokens(t, e = []) {
820
- this.options.pedantic ? t = t.replace(/\t/g, " ").replace(/^ +$/gm, "") : t = t.replace(/^( *)(\t+)/gm, (l, o, p) => o + " ".repeat(p.length));
821
- let n, i, r, s;
822
- for (; t; )
823
- if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((l) => (n = l.call({ lexer: this }, t, e)) ? (t = t.substring(n.raw.length), e.push(n), !0) : !1))) {
824
- if (n = this.tokenizer.space(t)) {
825
- t = t.substring(n.raw.length), n.raw.length === 1 && e.length > 0 ? e[e.length - 1].raw += `
826
- ` : e.push(n);
830
+ blockTokens(n, e = []) {
831
+ this.options.pedantic ? n = n.replace(/\t/g, " ").replace(/^ +$/gm, "") : n = n.replace(/^( *)(\t+)/gm, (l, o, p) => o + " ".repeat(p.length));
832
+ let t, i, r, s;
833
+ for (; n; )
834
+ if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((l) => (t = l.call({ lexer: this }, n, e)) ? (n = n.substring(t.raw.length), e.push(t), !0) : !1))) {
835
+ if (t = this.tokenizer.space(n)) {
836
+ n = n.substring(t.raw.length), t.raw.length === 1 && e.length > 0 ? e[e.length - 1].raw += `
837
+ ` : e.push(t);
827
838
  continue;
828
839
  }
829
- if (n = this.tokenizer.code(t)) {
830
- t = t.substring(n.raw.length), i = e[e.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
831
- ` + n.raw, i.text += `
832
- ` + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : e.push(n);
840
+ if (t = this.tokenizer.code(n)) {
841
+ n = n.substring(t.raw.length), i = e[e.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
842
+ ` + t.raw, i.text += `
843
+ ` + t.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : e.push(t);
833
844
  continue;
834
845
  }
835
- if (n = this.tokenizer.fences(t)) {
836
- t = t.substring(n.raw.length), e.push(n);
846
+ if (t = this.tokenizer.fences(n)) {
847
+ n = n.substring(t.raw.length), e.push(t);
837
848
  continue;
838
849
  }
839
- if (n = this.tokenizer.heading(t)) {
840
- t = t.substring(n.raw.length), e.push(n);
850
+ if (t = this.tokenizer.heading(n)) {
851
+ n = n.substring(t.raw.length), e.push(t);
841
852
  continue;
842
853
  }
843
- if (n = this.tokenizer.hr(t)) {
844
- t = t.substring(n.raw.length), e.push(n);
854
+ if (t = this.tokenizer.hr(n)) {
855
+ n = n.substring(t.raw.length), e.push(t);
845
856
  continue;
846
857
  }
847
- if (n = this.tokenizer.blockquote(t)) {
848
- t = t.substring(n.raw.length), e.push(n);
858
+ if (t = this.tokenizer.blockquote(n)) {
859
+ n = n.substring(t.raw.length), e.push(t);
849
860
  continue;
850
861
  }
851
- if (n = this.tokenizer.list(t)) {
852
- t = t.substring(n.raw.length), e.push(n);
862
+ if (t = this.tokenizer.list(n)) {
863
+ n = n.substring(t.raw.length), e.push(t);
853
864
  continue;
854
865
  }
855
- if (n = this.tokenizer.html(t)) {
856
- t = t.substring(n.raw.length), e.push(n);
866
+ if (t = this.tokenizer.html(n)) {
867
+ n = n.substring(t.raw.length), e.push(t);
857
868
  continue;
858
869
  }
859
- if (n = this.tokenizer.def(t)) {
860
- t = t.substring(n.raw.length), i = e[e.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
861
- ` + n.raw, i.text += `
862
- ` + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[n.tag] || (this.tokens.links[n.tag] = {
863
- href: n.href,
864
- title: n.title
870
+ if (t = this.tokenizer.def(n)) {
871
+ n = n.substring(t.raw.length), i = e[e.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
872
+ ` + t.raw, i.text += `
873
+ ` + t.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[t.tag] || (this.tokens.links[t.tag] = {
874
+ href: t.href,
875
+ title: t.title
865
876
  });
866
877
  continue;
867
878
  }
868
- if (n = this.tokenizer.table(t)) {
869
- t = t.substring(n.raw.length), e.push(n);
879
+ if (t = this.tokenizer.table(n)) {
880
+ n = n.substring(t.raw.length), e.push(t);
870
881
  continue;
871
882
  }
872
- if (n = this.tokenizer.lheading(t)) {
873
- t = t.substring(n.raw.length), e.push(n);
883
+ if (t = this.tokenizer.lheading(n)) {
884
+ n = n.substring(t.raw.length), e.push(t);
874
885
  continue;
875
886
  }
876
- if (r = t, this.options.extensions && this.options.extensions.startBlock) {
887
+ if (r = n, this.options.extensions && this.options.extensions.startBlock) {
877
888
  let l = 1 / 0;
878
- const o = t.slice(1);
889
+ const o = n.slice(1);
879
890
  let p;
880
891
  this.options.extensions.startBlock.forEach((c) => {
881
892
  p = c.call({ lexer: this }, o), typeof p == "number" && p >= 0 && (l = Math.min(l, p));
882
- }), l < 1 / 0 && l >= 0 && (r = t.substring(0, l + 1));
893
+ }), l < 1 / 0 && l >= 0 && (r = n.substring(0, l + 1));
883
894
  }
884
- if (this.state.top && (n = this.tokenizer.paragraph(r))) {
895
+ if (this.state.top && (t = this.tokenizer.paragraph(r))) {
885
896
  i = e[e.length - 1], s && i.type === "paragraph" ? (i.raw += `
886
- ` + n.raw, i.text += `
887
- ` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : e.push(n), s = r.length !== t.length, t = t.substring(n.raw.length);
897
+ ` + t.raw, i.text += `
898
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : e.push(t), s = r.length !== n.length, n = n.substring(t.raw.length);
888
899
  continue;
889
900
  }
890
- if (n = this.tokenizer.text(t)) {
891
- t = t.substring(n.raw.length), i = e[e.length - 1], i && i.type === "text" ? (i.raw += `
892
- ` + n.raw, i.text += `
893
- ` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : e.push(n);
901
+ if (t = this.tokenizer.text(n)) {
902
+ n = n.substring(t.raw.length), i = e[e.length - 1], i && i.type === "text" ? (i.raw += `
903
+ ` + t.raw, i.text += `
904
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : e.push(t);
894
905
  continue;
895
906
  }
896
- if (t) {
897
- const l = "Infinite loop on byte: " + t.charCodeAt(0);
907
+ if (n) {
908
+ const l = "Infinite loop on byte: " + n.charCodeAt(0);
898
909
  if (this.options.silent) {
899
910
  console.error(l);
900
911
  break;
@@ -904,14 +915,14 @@ class T {
904
915
  }
905
916
  return this.state.top = !0, e;
906
917
  }
907
- inline(t, e = []) {
908
- return this.inlineQueue.push({ src: t, tokens: e }), e;
918
+ inline(n, e = []) {
919
+ return this.inlineQueue.push({ src: n, tokens: e }), e;
909
920
  }
910
921
  /**
911
922
  * Lexing/Compiling
912
923
  */
913
- inlineTokens(t, e = []) {
914
- let n, i, r, s = t, l, o, p;
924
+ inlineTokens(n, e = []) {
925
+ let t, i, r, s = n, l, o, p;
915
926
  if (this.tokens.links) {
916
927
  const c = Object.keys(this.tokens.links);
917
928
  if (c.length > 0)
@@ -922,62 +933,62 @@ class T {
922
933
  s = s.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
923
934
  for (; (l = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; )
924
935
  s = s.slice(0, l.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
925
- for (; t; )
926
- if (o || (p = ""), o = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((c) => (n = c.call({ lexer: this }, t, e)) ? (t = t.substring(n.raw.length), e.push(n), !0) : !1))) {
927
- if (n = this.tokenizer.escape(t)) {
928
- t = t.substring(n.raw.length), e.push(n);
936
+ for (; n; )
937
+ if (o || (p = ""), o = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((c) => (t = c.call({ lexer: this }, n, e)) ? (n = n.substring(t.raw.length), e.push(t), !0) : !1))) {
938
+ if (t = this.tokenizer.escape(n)) {
939
+ n = n.substring(t.raw.length), e.push(t);
929
940
  continue;
930
941
  }
931
- if (n = this.tokenizer.tag(t)) {
932
- t = t.substring(n.raw.length), i = e[e.length - 1], i && n.type === "text" && i.type === "text" ? (i.raw += n.raw, i.text += n.text) : e.push(n);
942
+ if (t = this.tokenizer.tag(n)) {
943
+ n = n.substring(t.raw.length), i = e[e.length - 1], i && t.type === "text" && i.type === "text" ? (i.raw += t.raw, i.text += t.text) : e.push(t);
933
944
  continue;
934
945
  }
935
- if (n = this.tokenizer.link(t)) {
936
- t = t.substring(n.raw.length), e.push(n);
946
+ if (t = this.tokenizer.link(n)) {
947
+ n = n.substring(t.raw.length), e.push(t);
937
948
  continue;
938
949
  }
939
- if (n = this.tokenizer.reflink(t, this.tokens.links)) {
940
- t = t.substring(n.raw.length), i = e[e.length - 1], i && n.type === "text" && i.type === "text" ? (i.raw += n.raw, i.text += n.text) : e.push(n);
950
+ if (t = this.tokenizer.reflink(n, this.tokens.links)) {
951
+ n = n.substring(t.raw.length), i = e[e.length - 1], i && t.type === "text" && i.type === "text" ? (i.raw += t.raw, i.text += t.text) : e.push(t);
941
952
  continue;
942
953
  }
943
- if (n = this.tokenizer.emStrong(t, s, p)) {
944
- t = t.substring(n.raw.length), e.push(n);
954
+ if (t = this.tokenizer.emStrong(n, s, p)) {
955
+ n = n.substring(t.raw.length), e.push(t);
945
956
  continue;
946
957
  }
947
- if (n = this.tokenizer.codespan(t)) {
948
- t = t.substring(n.raw.length), e.push(n);
958
+ if (t = this.tokenizer.codespan(n)) {
959
+ n = n.substring(t.raw.length), e.push(t);
949
960
  continue;
950
961
  }
951
- if (n = this.tokenizer.br(t)) {
952
- t = t.substring(n.raw.length), e.push(n);
962
+ if (t = this.tokenizer.br(n)) {
963
+ n = n.substring(t.raw.length), e.push(t);
953
964
  continue;
954
965
  }
955
- if (n = this.tokenizer.del(t)) {
956
- t = t.substring(n.raw.length), e.push(n);
966
+ if (t = this.tokenizer.del(n)) {
967
+ n = n.substring(t.raw.length), e.push(t);
957
968
  continue;
958
969
  }
959
- if (n = this.tokenizer.autolink(t)) {
960
- t = t.substring(n.raw.length), e.push(n);
970
+ if (t = this.tokenizer.autolink(n)) {
971
+ n = n.substring(t.raw.length), e.push(t);
961
972
  continue;
962
973
  }
963
- if (!this.state.inLink && (n = this.tokenizer.url(t))) {
964
- t = t.substring(n.raw.length), e.push(n);
974
+ if (!this.state.inLink && (t = this.tokenizer.url(n))) {
975
+ n = n.substring(t.raw.length), e.push(t);
965
976
  continue;
966
977
  }
967
- if (r = t, this.options.extensions && this.options.extensions.startInline) {
978
+ if (r = n, this.options.extensions && this.options.extensions.startInline) {
968
979
  let c = 1 / 0;
969
- const u = t.slice(1);
980
+ const u = n.slice(1);
970
981
  let h;
971
982
  this.options.extensions.startInline.forEach((f) => {
972
983
  h = f.call({ lexer: this }, u), typeof h == "number" && h >= 0 && (c = Math.min(c, h));
973
- }), c < 1 / 0 && c >= 0 && (r = t.substring(0, c + 1));
984
+ }), c < 1 / 0 && c >= 0 && (r = n.substring(0, c + 1));
974
985
  }
975
- if (n = this.tokenizer.inlineText(r)) {
976
- t = t.substring(n.raw.length), n.raw.slice(-1) !== "_" && (p = n.raw.slice(-1)), o = !0, i = e[e.length - 1], i && i.type === "text" ? (i.raw += n.raw, i.text += n.text) : e.push(n);
986
+ if (t = this.tokenizer.inlineText(r)) {
987
+ n = n.substring(t.raw.length), t.raw.slice(-1) !== "_" && (p = t.raw.slice(-1)), o = !0, i = e[e.length - 1], i && i.type === "text" ? (i.raw += t.raw, i.text += t.text) : e.push(t);
977
988
  continue;
978
989
  }
979
- if (t) {
980
- const c = "Infinite loop on byte: " + t.charCodeAt(0);
990
+ if (n) {
991
+ const c = "Infinite loop on byte: " + n.charCodeAt(0);
981
992
  if (this.options.silent) {
982
993
  console.error(c);
983
994
  break;
@@ -988,167 +999,167 @@ class T {
988
999
  return e;
989
1000
  }
990
1001
  }
991
- class B {
992
- constructor(t) {
1002
+ class q {
1003
+ constructor(n) {
993
1004
  k(this, "options");
994
- this.options = t || I;
1005
+ this.options = n || A;
995
1006
  }
996
- code(t, e, n) {
1007
+ code(n, e, t) {
997
1008
  var r;
998
1009
  const i = (r = (e || "").match(/^\S*/)) == null ? void 0 : r[0];
999
- return t = t.replace(/\n$/, "") + `
1000
- `, i ? '<pre><code class="language-' + b(i) + '">' + (n ? t : b(t, !0)) + `</code></pre>
1001
- ` : "<pre><code>" + (n ? t : b(t, !0)) + `</code></pre>
1010
+ return n = n.replace(/\n$/, "") + `
1011
+ `, i ? '<pre><code class="language-' + b(i) + '">' + (t ? n : b(n, !0)) + `</code></pre>
1012
+ ` : "<pre><code>" + (t ? n : b(n, !0)) + `</code></pre>
1002
1013
  `;
1003
1014
  }
1004
- blockquote(t) {
1015
+ blockquote(n) {
1005
1016
  return `<blockquote>
1006
- ${t}</blockquote>
1017
+ ${n}</blockquote>
1007
1018
  `;
1008
1019
  }
1009
- html(t, e) {
1010
- return t;
1020
+ html(n, e) {
1021
+ return n;
1011
1022
  }
1012
- heading(t, e, n) {
1013
- return `<h${e}>${t}</h${e}>
1023
+ heading(n, e, t) {
1024
+ return `<h${e}>${n}</h${e}>
1014
1025
  `;
1015
1026
  }
1016
1027
  hr() {
1017
1028
  return `<hr>
1018
1029
  `;
1019
1030
  }
1020
- list(t, e, n) {
1021
- const i = e ? "ol" : "ul", r = e && n !== 1 ? ' start="' + n + '"' : "";
1031
+ list(n, e, t) {
1032
+ const i = e ? "ol" : "ul", r = e && t !== 1 ? ' start="' + t + '"' : "";
1022
1033
  return "<" + i + r + `>
1023
- ` + t + "</" + i + `>
1034
+ ` + n + "</" + i + `>
1024
1035
  `;
1025
1036
  }
1026
- listitem(t, e, n) {
1027
- return `<li>${t}</li>
1037
+ listitem(n, e, t) {
1038
+ return `<li>${n}</li>
1028
1039
  `;
1029
1040
  }
1030
- checkbox(t) {
1031
- return "<input " + (t ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
1041
+ checkbox(n) {
1042
+ return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
1032
1043
  }
1033
- paragraph(t) {
1034
- return `<p>${t}</p>
1044
+ paragraph(n) {
1045
+ return `<p>${n}</p>
1035
1046
  `;
1036
1047
  }
1037
- table(t, e) {
1048
+ table(n, e) {
1038
1049
  return e && (e = `<tbody>${e}</tbody>`), `<table>
1039
1050
  <thead>
1040
- ` + t + `</thead>
1051
+ ` + n + `</thead>
1041
1052
  ` + e + `</table>
1042
1053
  `;
1043
1054
  }
1044
- tablerow(t) {
1055
+ tablerow(n) {
1045
1056
  return `<tr>
1046
- ${t}</tr>
1057
+ ${n}</tr>
1047
1058
  `;
1048
1059
  }
1049
- tablecell(t, e) {
1050
- const n = e.header ? "th" : "td";
1051
- return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
1060
+ tablecell(n, e) {
1061
+ const t = e.header ? "th" : "td";
1062
+ return (e.align ? `<${t} align="${e.align}">` : `<${t}>`) + n + `</${t}>
1052
1063
  `;
1053
1064
  }
1054
1065
  /**
1055
1066
  * span level renderer
1056
1067
  */
1057
- strong(t) {
1058
- return `<strong>${t}</strong>`;
1068
+ strong(n) {
1069
+ return `<strong>${n}</strong>`;
1059
1070
  }
1060
- em(t) {
1061
- return `<em>${t}</em>`;
1071
+ em(n) {
1072
+ return `<em>${n}</em>`;
1062
1073
  }
1063
- codespan(t) {
1064
- return `<code>${t}</code>`;
1074
+ codespan(n) {
1075
+ return `<code>${n}</code>`;
1065
1076
  }
1066
1077
  br() {
1067
1078
  return "<br>";
1068
1079
  }
1069
- del(t) {
1070
- return `<del>${t}</del>`;
1080
+ del(n) {
1081
+ return `<del>${n}</del>`;
1071
1082
  }
1072
- link(t, e, n) {
1073
- const i = oe(t);
1083
+ link(n, e, t) {
1084
+ const i = oe(n);
1074
1085
  if (i === null)
1075
- return n;
1076
- t = i;
1077
- let r = '<a href="' + t + '"';
1078
- return e && (r += ' title="' + e + '"'), r += ">" + n + "</a>", r;
1086
+ return t;
1087
+ n = i;
1088
+ let r = '<a href="' + n + '"';
1089
+ return e && (r += ' title="' + e + '"'), r += ">" + t + "</a>", r;
1079
1090
  }
1080
- image(t, e, n) {
1081
- const i = oe(t);
1091
+ image(n, e, t) {
1092
+ const i = oe(n);
1082
1093
  if (i === null)
1083
- return n;
1084
- t = i;
1085
- let r = `<img src="${t}" alt="${n}"`;
1094
+ return t;
1095
+ n = i;
1096
+ let r = `<img src="${n}" alt="${t}"`;
1086
1097
  return e && (r += ` title="${e}"`), r += ">", r;
1087
1098
  }
1088
- text(t) {
1089
- return t;
1099
+ text(n) {
1100
+ return n;
1090
1101
  }
1091
1102
  }
1092
- class V {
1103
+ class K {
1093
1104
  // no need for block level renderers
1094
- strong(t) {
1095
- return t;
1105
+ strong(n) {
1106
+ return n;
1096
1107
  }
1097
- em(t) {
1098
- return t;
1108
+ em(n) {
1109
+ return n;
1099
1110
  }
1100
- codespan(t) {
1101
- return t;
1111
+ codespan(n) {
1112
+ return n;
1102
1113
  }
1103
- del(t) {
1104
- return t;
1114
+ del(n) {
1115
+ return n;
1105
1116
  }
1106
- html(t) {
1107
- return t;
1117
+ html(n) {
1118
+ return n;
1108
1119
  }
1109
- text(t) {
1110
- return t;
1120
+ text(n) {
1121
+ return n;
1111
1122
  }
1112
- link(t, e, n) {
1113
- return "" + n;
1123
+ link(n, e, t) {
1124
+ return "" + t;
1114
1125
  }
1115
- image(t, e, n) {
1116
- return "" + n;
1126
+ image(n, e, t) {
1127
+ return "" + t;
1117
1128
  }
1118
1129
  br() {
1119
1130
  return "";
1120
1131
  }
1121
1132
  }
1122
1133
  class z {
1123
- constructor(t) {
1134
+ constructor(n) {
1124
1135
  k(this, "options");
1125
1136
  k(this, "renderer");
1126
1137
  k(this, "textRenderer");
1127
- this.options = t || I, this.options.renderer = this.options.renderer || new B(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new V();
1138
+ this.options = n || A, this.options.renderer = this.options.renderer || new q(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new K();
1128
1139
  }
1129
1140
  /**
1130
1141
  * Static Parse Method
1131
1142
  */
1132
- static parse(t, e) {
1133
- return new z(e).parse(t);
1143
+ static parse(n, e) {
1144
+ return new z(e).parse(n);
1134
1145
  }
1135
1146
  /**
1136
1147
  * Static Parse Inline Method
1137
1148
  */
1138
- static parseInline(t, e) {
1139
- return new z(e).parseInline(t);
1149
+ static parseInline(n, e) {
1150
+ return new z(e).parseInline(n);
1140
1151
  }
1141
1152
  /**
1142
1153
  * Parse Loop
1143
1154
  */
1144
- parse(t, e = !0) {
1145
- let n = "";
1146
- for (let i = 0; i < t.length; i++) {
1147
- const r = t[i];
1155
+ parse(n, e = !0) {
1156
+ let t = "";
1157
+ for (let i = 0; i < n.length; i++) {
1158
+ const r = n[i];
1148
1159
  if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) {
1149
1160
  const s = r, l = this.options.extensions.renderers[s.type].call({ parser: this }, s);
1150
1161
  if (l !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(s.type)) {
1151
- n += l || "";
1162
+ t += l || "";
1152
1163
  continue;
1153
1164
  }
1154
1165
  }
@@ -1156,17 +1167,17 @@ class z {
1156
1167
  case "space":
1157
1168
  continue;
1158
1169
  case "hr": {
1159
- n += this.renderer.hr();
1170
+ t += this.renderer.hr();
1160
1171
  continue;
1161
1172
  }
1162
1173
  case "heading": {
1163
1174
  const s = r;
1164
- n += this.renderer.heading(this.parseInline(s.tokens), s.depth, Ze(this.parseInline(s.tokens, this.textRenderer)));
1175
+ t += this.renderer.heading(this.parseInline(s.tokens), s.depth, Ne(this.parseInline(s.tokens, this.textRenderer)));
1165
1176
  continue;
1166
1177
  }
1167
1178
  case "code": {
1168
1179
  const s = r;
1169
- n += this.renderer.code(s.text, s.lang, !!s.escaped);
1180
+ t += this.renderer.code(s.text, s.lang, !!s.escaped);
1170
1181
  continue;
1171
1182
  }
1172
1183
  case "table": {
@@ -1183,12 +1194,12 @@ class z {
1183
1194
  o += this.renderer.tablecell(this.parseInline(u[h].tokens), { header: !1, align: s.align[h] });
1184
1195
  p += this.renderer.tablerow(o);
1185
1196
  }
1186
- n += this.renderer.table(l, p);
1197
+ t += this.renderer.table(l, p);
1187
1198
  continue;
1188
1199
  }
1189
1200
  case "blockquote": {
1190
1201
  const s = r, l = this.parse(s.tokens);
1191
- n += this.renderer.blockquote(l);
1202
+ t += this.renderer.blockquote(l);
1192
1203
  continue;
1193
1204
  }
1194
1205
  case "list": {
@@ -1206,25 +1217,25 @@ class z {
1206
1217
  }
1207
1218
  y += this.parse(h.tokens, p), c += this.renderer.listitem(y, w, !!f);
1208
1219
  }
1209
- n += this.renderer.list(c, l, o);
1220
+ t += this.renderer.list(c, l, o);
1210
1221
  continue;
1211
1222
  }
1212
1223
  case "html": {
1213
1224
  const s = r;
1214
- n += this.renderer.html(s.text, s.block);
1225
+ t += this.renderer.html(s.text, s.block);
1215
1226
  continue;
1216
1227
  }
1217
1228
  case "paragraph": {
1218
1229
  const s = r;
1219
- n += this.renderer.paragraph(this.parseInline(s.tokens));
1230
+ t += this.renderer.paragraph(this.parseInline(s.tokens));
1220
1231
  continue;
1221
1232
  }
1222
1233
  case "text": {
1223
1234
  let s = r, l = s.tokens ? this.parseInline(s.tokens) : s.text;
1224
- for (; i + 1 < t.length && t[i + 1].type === "text"; )
1225
- s = t[++i], l += `
1235
+ for (; i + 1 < n.length && n[i + 1].type === "text"; )
1236
+ s = n[++i], l += `
1226
1237
  ` + (s.tokens ? this.parseInline(s.tokens) : s.text);
1227
- n += e ? this.renderer.paragraph(l) : l;
1238
+ t += e ? this.renderer.paragraph(l) : l;
1228
1239
  continue;
1229
1240
  }
1230
1241
  default: {
@@ -1235,71 +1246,71 @@ class z {
1235
1246
  }
1236
1247
  }
1237
1248
  }
1238
- return n;
1249
+ return t;
1239
1250
  }
1240
1251
  /**
1241
1252
  * Parse Inline Tokens
1242
1253
  */
1243
- parseInline(t, e) {
1254
+ parseInline(n, e) {
1244
1255
  e = e || this.renderer;
1245
- let n = "";
1246
- for (let i = 0; i < t.length; i++) {
1247
- const r = t[i];
1256
+ let t = "";
1257
+ for (let i = 0; i < n.length; i++) {
1258
+ const r = n[i];
1248
1259
  if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) {
1249
1260
  const s = this.options.extensions.renderers[r.type].call({ parser: this }, r);
1250
1261
  if (s !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) {
1251
- n += s || "";
1262
+ t += s || "";
1252
1263
  continue;
1253
1264
  }
1254
1265
  }
1255
1266
  switch (r.type) {
1256
1267
  case "escape": {
1257
1268
  const s = r;
1258
- n += e.text(s.text);
1269
+ t += e.text(s.text);
1259
1270
  break;
1260
1271
  }
1261
1272
  case "html": {
1262
1273
  const s = r;
1263
- n += e.html(s.text);
1274
+ t += e.html(s.text);
1264
1275
  break;
1265
1276
  }
1266
1277
  case "link": {
1267
1278
  const s = r;
1268
- n += e.link(s.href, s.title, this.parseInline(s.tokens, e));
1279
+ t += e.link(s.href, s.title, this.parseInline(s.tokens, e));
1269
1280
  break;
1270
1281
  }
1271
1282
  case "image": {
1272
1283
  const s = r;
1273
- n += e.image(s.href, s.title, s.text);
1284
+ t += e.image(s.href, s.title, s.text);
1274
1285
  break;
1275
1286
  }
1276
1287
  case "strong": {
1277
1288
  const s = r;
1278
- n += e.strong(this.parseInline(s.tokens, e));
1289
+ t += e.strong(this.parseInline(s.tokens, e));
1279
1290
  break;
1280
1291
  }
1281
1292
  case "em": {
1282
1293
  const s = r;
1283
- n += e.em(this.parseInline(s.tokens, e));
1294
+ t += e.em(this.parseInline(s.tokens, e));
1284
1295
  break;
1285
1296
  }
1286
1297
  case "codespan": {
1287
1298
  const s = r;
1288
- n += e.codespan(s.text);
1299
+ t += e.codespan(s.text);
1289
1300
  break;
1290
1301
  }
1291
1302
  case "br": {
1292
- n += e.br();
1303
+ t += e.br();
1293
1304
  break;
1294
1305
  }
1295
1306
  case "del": {
1296
1307
  const s = r;
1297
- n += e.del(this.parseInline(s.tokens, e));
1308
+ t += e.del(this.parseInline(s.tokens, e));
1298
1309
  break;
1299
1310
  }
1300
1311
  case "text": {
1301
1312
  const s = r;
1302
- n += e.text(s.text);
1313
+ t += e.text(s.text);
1303
1314
  break;
1304
1315
  }
1305
1316
  default: {
@@ -1310,91 +1321,91 @@ class z {
1310
1321
  }
1311
1322
  }
1312
1323
  }
1313
- return n;
1324
+ return t;
1314
1325
  }
1315
1326
  }
1316
- class j {
1317
- constructor(t) {
1327
+ class C {
1328
+ constructor(n) {
1318
1329
  k(this, "options");
1319
- this.options = t || I;
1330
+ this.options = n || A;
1320
1331
  }
1321
1332
  /**
1322
1333
  * Process markdown before marked
1323
1334
  */
1324
- preprocess(t) {
1325
- return t;
1335
+ preprocess(n) {
1336
+ return n;
1326
1337
  }
1327
1338
  /**
1328
1339
  * Process HTML after marked is finished
1329
1340
  */
1330
- postprocess(t) {
1331
- return t;
1341
+ postprocess(n) {
1342
+ return n;
1332
1343
  }
1333
1344
  /**
1334
1345
  * Process all tokens before walk tokens
1335
1346
  */
1336
- processAllTokens(t) {
1337
- return t;
1347
+ processAllTokens(n) {
1348
+ return n;
1338
1349
  }
1339
1350
  }
1340
- k(j, "passThroughHooks", /* @__PURE__ */ new Set([
1351
+ k(C, "passThroughHooks", /* @__PURE__ */ new Set([
1341
1352
  "preprocess",
1342
1353
  "postprocess",
1343
1354
  "processAllTokens"
1344
1355
  ]));
1345
1356
  var _, H, ye;
1346
1357
  class gt {
1347
- constructor(...t) {
1358
+ constructor(...n) {
1348
1359
  se(this, _);
1349
1360
  k(this, "defaults", J());
1350
1361
  k(this, "options", this.setOptions);
1351
1362
  k(this, "parse", v(this, _, H).call(this, T.lex, z.parse));
1352
1363
  k(this, "parseInline", v(this, _, H).call(this, T.lexInline, z.parseInline));
1353
1364
  k(this, "Parser", z);
1354
- k(this, "Renderer", B);
1355
- k(this, "TextRenderer", V);
1365
+ k(this, "Renderer", q);
1366
+ k(this, "TextRenderer", K);
1356
1367
  k(this, "Lexer", T);
1357
- k(this, "Tokenizer", Z);
1358
- k(this, "Hooks", j);
1359
- this.use(...t);
1368
+ k(this, "Tokenizer", N);
1369
+ k(this, "Hooks", C);
1370
+ this.use(...n);
1360
1371
  }
1361
1372
  /**
1362
1373
  * Run callback for every token
1363
1374
  */
1364
- walkTokens(t, e) {
1375
+ walkTokens(n, e) {
1365
1376
  var i, r;
1366
- let n = [];
1367
- for (const s of t)
1368
- switch (n = n.concat(e.call(this, s)), s.type) {
1377
+ let t = [];
1378
+ for (const s of n)
1379
+ switch (t = t.concat(e.call(this, s)), s.type) {
1369
1380
  case "table": {
1370
1381
  const l = s;
1371
1382
  for (const o of l.header)
1372
- n = n.concat(this.walkTokens(o.tokens, e));
1383
+ t = t.concat(this.walkTokens(o.tokens, e));
1373
1384
  for (const o of l.rows)
1374
1385
  for (const p of o)
1375
- n = n.concat(this.walkTokens(p.tokens, e));
1386
+ t = t.concat(this.walkTokens(p.tokens, e));
1376
1387
  break;
1377
1388
  }
1378
1389
  case "list": {
1379
1390
  const l = s;
1380
- n = n.concat(this.walkTokens(l.items, e));
1391
+ t = t.concat(this.walkTokens(l.items, e));
1381
1392
  break;
1382
1393
  }
1383
1394
  default: {
1384
1395
  const l = s;
1385
1396
  (r = (i = this.defaults.extensions) == null ? void 0 : i.childTokens) != null && r[l.type] ? this.defaults.extensions.childTokens[l.type].forEach((o) => {
1386
1397
  const p = l[o].flat(1 / 0);
1387
- n = n.concat(this.walkTokens(p, e));
1388
- }) : l.tokens && (n = n.concat(this.walkTokens(l.tokens, e)));
1398
+ t = t.concat(this.walkTokens(p, e));
1399
+ }) : l.tokens && (t = t.concat(this.walkTokens(l.tokens, e)));
1389
1400
  }
1390
1401
  }
1391
- return n;
1402
+ return t;
1392
1403
  }
1393
- use(...t) {
1404
+ use(...n) {
1394
1405
  const e = this.defaults.extensions || { renderers: {}, childTokens: {} };
1395
- return t.forEach((n) => {
1396
- const i = { ...n };
1397
- if (i.async = this.defaults.async || i.async || !1, n.extensions && (n.extensions.forEach((r) => {
1406
+ return n.forEach((t) => {
1407
+ const i = { ...t };
1408
+ if (i.async = this.defaults.async || i.async || !1, t.extensions && (t.extensions.forEach((r) => {
1398
1409
  if (!r.name)
1399
1410
  throw new Error("extension name required");
1400
1411
  if ("renderer" in r) {
@@ -1411,14 +1422,14 @@ class gt {
1411
1422
  s ? s.unshift(r.tokenizer) : e[r.level] = [r.tokenizer], r.start && (r.level === "block" ? e.startBlock ? e.startBlock.push(r.start) : e.startBlock = [r.start] : r.level === "inline" && (e.startInline ? e.startInline.push(r.start) : e.startInline = [r.start]));
1412
1423
  }
1413
1424
  "childTokens" in r && r.childTokens && (e.childTokens[r.name] = r.childTokens);
1414
- }), i.extensions = e), n.renderer) {
1415
- const r = this.defaults.renderer || new B(this.defaults);
1416
- for (const s in n.renderer) {
1425
+ }), i.extensions = e), t.renderer) {
1426
+ const r = this.defaults.renderer || new q(this.defaults);
1427
+ for (const s in t.renderer) {
1417
1428
  if (!(s in r))
1418
1429
  throw new Error(`renderer '${s}' does not exist`);
1419
1430
  if (s === "options")
1420
1431
  continue;
1421
- const l = s, o = n.renderer[l], p = r[l];
1432
+ const l = s, o = t.renderer[l], p = r[l];
1422
1433
  r[l] = (...c) => {
1423
1434
  let u = o.apply(r, c);
1424
1435
  return u === !1 && (u = p.apply(r, c)), u || "";
@@ -1426,14 +1437,14 @@ class gt {
1426
1437
  }
1427
1438
  i.renderer = r;
1428
1439
  }
1429
- if (n.tokenizer) {
1430
- const r = this.defaults.tokenizer || new Z(this.defaults);
1431
- for (const s in n.tokenizer) {
1440
+ if (t.tokenizer) {
1441
+ const r = this.defaults.tokenizer || new N(this.defaults);
1442
+ for (const s in t.tokenizer) {
1432
1443
  if (!(s in r))
1433
1444
  throw new Error(`tokenizer '${s}' does not exist`);
1434
1445
  if (["options", "rules", "lexer"].includes(s))
1435
1446
  continue;
1436
- const l = s, o = n.tokenizer[l], p = r[l];
1447
+ const l = s, o = t.tokenizer[l], p = r[l];
1437
1448
  r[l] = (...c) => {
1438
1449
  let u = o.apply(r, c);
1439
1450
  return u === !1 && (u = p.apply(r, c)), u;
@@ -1441,15 +1452,15 @@ class gt {
1441
1452
  }
1442
1453
  i.tokenizer = r;
1443
1454
  }
1444
- if (n.hooks) {
1445
- const r = this.defaults.hooks || new j();
1446
- for (const s in n.hooks) {
1455
+ if (t.hooks) {
1456
+ const r = this.defaults.hooks || new C();
1457
+ for (const s in t.hooks) {
1447
1458
  if (!(s in r))
1448
1459
  throw new Error(`hook '${s}' does not exist`);
1449
1460
  if (s === "options")
1450
1461
  continue;
1451
- const l = s, o = n.hooks[l], p = r[l];
1452
- j.passThroughHooks.has(s) ? r[l] = (c) => {
1462
+ const l = s, o = t.hooks[l], p = r[l];
1463
+ C.passThroughHooks.has(s) ? r[l] = (c) => {
1453
1464
  if (this.defaults.async)
1454
1465
  return Promise.resolve(o.call(r, c)).then((h) => p.call(r, h));
1455
1466
  const u = o.call(r, c);
@@ -1461,8 +1472,8 @@ class gt {
1461
1472
  }
1462
1473
  i.hooks = r;
1463
1474
  }
1464
- if (n.walkTokens) {
1465
- const r = this.defaults.walkTokens, s = n.walkTokens;
1475
+ if (t.walkTokens) {
1476
+ const r = this.defaults.walkTokens, s = t.walkTokens;
1466
1477
  i.walkTokens = function(l) {
1467
1478
  let o = [];
1468
1479
  return o.push(s.call(this, l)), r && (o = o.concat(r.call(this, l))), o;
@@ -1471,30 +1482,30 @@ class gt {
1471
1482
  this.defaults = { ...this.defaults, ...i };
1472
1483
  }), this;
1473
1484
  }
1474
- setOptions(t) {
1475
- return this.defaults = { ...this.defaults, ...t }, this;
1485
+ setOptions(n) {
1486
+ return this.defaults = { ...this.defaults, ...n }, this;
1476
1487
  }
1477
- lexer(t, e) {
1478
- return T.lex(t, e ?? this.defaults);
1488
+ lexer(n, e) {
1489
+ return T.lex(n, e ?? this.defaults);
1479
1490
  }
1480
- parser(t, e) {
1481
- return z.parse(t, e ?? this.defaults);
1491
+ parser(n, e) {
1492
+ return z.parse(n, e ?? this.defaults);
1482
1493
  }
1483
1494
  }
1484
- _ = new WeakSet(), H = function(t, e) {
1485
- return (n, i) => {
1495
+ _ = new WeakSet(), H = function(n, e) {
1496
+ return (t, i) => {
1486
1497
  const r = { ...i }, s = { ...this.defaults, ...r };
1487
1498
  this.defaults.async === !0 && r.async === !1 && (s.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), s.async = !0);
1488
1499
  const l = v(this, _, ye).call(this, !!s.silent, !!s.async);
1489
- if (typeof n > "u" || n === null)
1500
+ if (typeof t > "u" || t === null)
1490
1501
  return l(new Error("marked(): input parameter is undefined or null"));
1491
- if (typeof n != "string")
1492
- return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1502
+ if (typeof t != "string")
1503
+ return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1493
1504
  if (s.hooks && (s.hooks.options = s), s.async)
1494
- return Promise.resolve(s.hooks ? s.hooks.preprocess(n) : n).then((o) => t(o, s)).then((o) => s.hooks ? s.hooks.processAllTokens(o) : o).then((o) => s.walkTokens ? Promise.all(this.walkTokens(o, s.walkTokens)).then(() => o) : o).then((o) => e(o, s)).then((o) => s.hooks ? s.hooks.postprocess(o) : o).catch(l);
1505
+ return Promise.resolve(s.hooks ? s.hooks.preprocess(t) : t).then((o) => n(o, s)).then((o) => s.hooks ? s.hooks.processAllTokens(o) : o).then((o) => s.walkTokens ? Promise.all(this.walkTokens(o, s.walkTokens)).then(() => o) : o).then((o) => e(o, s)).then((o) => s.hooks ? s.hooks.postprocess(o) : o).catch(l);
1495
1506
  try {
1496
- s.hooks && (n = s.hooks.preprocess(n));
1497
- let o = t(n, s);
1507
+ s.hooks && (t = s.hooks.preprocess(t));
1508
+ let o = n(t, s);
1498
1509
  s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
1499
1510
  let p = e(o, s);
1500
1511
  return s.hooks && (p = s.hooks.postprocess(p)), p;
@@ -1502,42 +1513,42 @@ _ = new WeakSet(), H = function(t, e) {
1502
1513
  return l(o);
1503
1514
  }
1504
1515
  };
1505
- }, ye = function(t, e) {
1506
- return (n) => {
1507
- if (n.message += `
1508
- Please report this to https://github.com/markedjs/marked.`, t) {
1509
- const i = "<p>An error occurred:</p><pre>" + b(n.message + "", !0) + "</pre>";
1516
+ }, ye = function(n, e) {
1517
+ return (t) => {
1518
+ if (t.message += `
1519
+ Please report this to https://github.com/markedjs/marked.`, n) {
1520
+ const i = "<p>An error occurred:</p><pre>" + b(t.message + "", !0) + "</pre>";
1510
1521
  return e ? Promise.resolve(i) : i;
1511
1522
  }
1512
1523
  if (e)
1513
- return Promise.reject(n);
1514
- throw n;
1524
+ return Promise.reject(t);
1525
+ throw t;
1515
1526
  };
1516
1527
  };
1517
1528
  const S = new gt();
1518
- function g(a, t) {
1519
- return S.parse(a, t);
1529
+ function g(a, n) {
1530
+ return S.parse(a, n);
1520
1531
  }
1521
1532
  g.options = g.setOptions = function(a) {
1522
1533
  return S.setOptions(a), g.defaults = S.defaults, pe(g.defaults), g;
1523
1534
  };
1524
1535
  g.getDefaults = J;
1525
- g.defaults = I;
1536
+ g.defaults = A;
1526
1537
  g.use = function(...a) {
1527
1538
  return S.use(...a), g.defaults = S.defaults, pe(g.defaults), g;
1528
1539
  };
1529
- g.walkTokens = function(a, t) {
1530
- return S.walkTokens(a, t);
1540
+ g.walkTokens = function(a, n) {
1541
+ return S.walkTokens(a, n);
1531
1542
  };
1532
1543
  g.parseInline = S.parseInline;
1533
1544
  g.Parser = z;
1534
1545
  g.parser = z.parse;
1535
- g.Renderer = B;
1536
- g.TextRenderer = V;
1546
+ g.Renderer = q;
1547
+ g.TextRenderer = K;
1537
1548
  g.Lexer = T;
1538
1549
  g.lexer = T.lex;
1539
- g.Tokenizer = Z;
1540
- g.Hooks = j;
1550
+ g.Tokenizer = N;
1551
+ g.Hooks = C;
1541
1552
  g.parse = g;
1542
1553
  g.options;
1543
1554
  g.setOptions;
@@ -1547,9 +1558,9 @@ g.parseInline;
1547
1558
  z.parse;
1548
1559
  T.lex;
1549
1560
  function dt(a) {
1550
- const t = a.replace(/^---[\s\S]*?---\n/, "");
1561
+ const n = a.replace(/^---[\s\S]*?---\n/, "");
1551
1562
  try {
1552
- const e = g.lexer(t), n = [], i = [];
1563
+ const e = g.lexer(n), t = [], i = [];
1553
1564
  for (const r of e)
1554
1565
  if (r.type === "heading") {
1555
1566
  const s = r, l = s.depth, o = $e(s.tokens), p = kt(o), c = {
@@ -1560,19 +1571,19 @@ function dt(a) {
1560
1571
  };
1561
1572
  for (; i.length > 0 && i[i.length - 1].level >= l; )
1562
1573
  i.pop();
1563
- i.length === 0 ? n.push(c) : i[i.length - 1].children.push(c), i.push(c);
1574
+ i.length === 0 ? t.push(c) : i[i.length - 1].children.push(c), i.push(c);
1564
1575
  }
1565
- return n;
1576
+ return t;
1566
1577
  } catch (e) {
1567
1578
  return console.warn("Failed to extract TOC from markdown:", e), [];
1568
1579
  }
1569
1580
  }
1570
1581
  function $e(a) {
1571
- return a.map((t) => {
1572
- if (t.type === "text")
1573
- return t.text;
1574
- if (t.type === "strong" || t.type === "em") {
1575
- const e = t;
1582
+ return a.map((n) => {
1583
+ if (n.type === "text")
1584
+ return n.text;
1585
+ if (n.type === "strong" || n.type === "em") {
1586
+ const e = n;
1576
1587
  if ("tokens" in e && Array.isArray(e.tokens))
1577
1588
  return $e(e.tokens);
1578
1589
  }
@@ -1582,20 +1593,20 @@ function $e(a) {
1582
1593
  function kt(a) {
1583
1594
  return a.toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").trim();
1584
1595
  }
1585
- async function he(a, t) {
1596
+ async function he(a, n) {
1586
1597
  const e = {};
1587
- for (const [n, i] of Object.entries(a)) {
1588
- const r = x.join(t, `${n}.md`);
1598
+ for (const [t, i] of Object.entries(a)) {
1599
+ const r = x.join(n, `${t}.md`);
1589
1600
  if (await m.pathExists(r)) {
1590
1601
  const s = await m.readFile(r, "utf-8"), l = dt(s);
1591
- e[n] = l;
1602
+ e[t] = l;
1592
1603
  }
1593
1604
  }
1594
1605
  return e;
1595
1606
  }
1596
- const $ = Ce("WSXPress");
1607
+ const $ = Ee("WSXPress");
1597
1608
  function Tt(a) {
1598
- const { docsRoot: t, api: e, outputDir: n = ".wsx-press" } = a;
1609
+ const { docsRoot: n, api: e, outputDir: t = ".wsx-press" } = a;
1599
1610
  let i, r;
1600
1611
  return {
1601
1612
  name: "vite-plugin-wsx-press",
@@ -1605,7 +1616,7 @@ function Tt(a) {
1605
1616
  */
1606
1617
  configResolved(s) {
1607
1618
  const l = (o) => o.startsWith("/") || /^[A-Za-z]:/.test(o) || o.startsWith("\\\\");
1608
- i = l(n) ? n : x.resolve(s.root, n), r = l(t) ? t : x.resolve(s.root, t);
1619
+ i = l(t) ? t : x.resolve(s.root, t), r = l(n) ? n : x.resolve(s.root, n);
1609
1620
  },
1610
1621
  /**
1611
1622
  * 构建开始时生成元数据和搜索索引
@@ -1614,7 +1625,7 @@ function Tt(a) {
1614
1625
  try {
1615
1626
  if (!i || !r) {
1616
1627
  const c = (u) => u.startsWith("/") || /^[A-Za-z]:/.test(u) || u.startsWith("\\\\");
1617
- i = c(n) ? n : x.resolve(process.cwd(), n), r = c(t) ? t : x.resolve(process.cwd(), t);
1628
+ i = c(t) ? t : x.resolve(process.cwd(), t), r = c(n) ? n : x.resolve(process.cwd(), n);
1618
1629
  }
1619
1630
  await m.ensureDir(i), $.info("Starting documentation generation..."), $.info(`Docs root: ${r}`), $.info(`Output dir: ${i}`);
1620
1631
  const s = await O(r), l = x.join(i, "docs-meta.json");
@@ -1699,8 +1710,8 @@ function Tt(a) {
1699
1710
  };
1700
1711
  }
1701
1712
  export {
1702
- Ee as addPrevNextLinks,
1703
- je as extractFrontmatter,
1713
+ je as addPrevNextLinks,
1714
+ Ce as extractFrontmatter,
1704
1715
  Pe as generateApiDocs,
1705
1716
  ie as generateSearchIndex,
1706
1717
  O as scanDocsMetadata,