wecool-chat 0.10.0 → 0.11.1
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/CHANGELOG.md +37 -0
- package/README.ja.md +9 -3
- package/README.md +14 -3
- package/dist/CopyIndicator-DcJtCBYP.js +63 -0
- package/dist/{MarkdownBody-EIz0jnQy.js → MarkdownBody-DX0DoV4C.js} +901 -893
- package/dist/VoiceControls-B_kX2Uj3.js +160 -0
- package/dist/{VoiceRuntime-DrYjNkZK.js → VoiceRuntime-D1nURNly.js} +13 -13
- package/dist/blank-line-D-aLg3m0.js +213 -0
- package/dist/{browser-M7mS-hAN.js → browser-a2qIWP48.js} +1 -1
- package/dist/core/client.d.ts +5 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/consume-stream.d.ts +18 -1
- package/dist/core/consume-stream.d.ts.map +1 -1
- package/dist/core/i18n/messages.d.ts +2 -0
- package/dist/core/i18n/messages.d.ts.map +1 -1
- package/dist/core/narration-round.d.ts +27 -0
- package/dist/core/narration-round.d.ts.map +1 -0
- package/dist/core/placeholder-manager.d.ts +30 -0
- package/dist/core/placeholder-manager.d.ts.map +1 -0
- package/dist/core/run-conversation.d.ts.map +1 -1
- package/dist/core/stream-state.d.ts +9 -1
- package/dist/core/stream-state.d.ts.map +1 -1
- package/dist/core/types.d.ts +21 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/createLucideIcon-Dc6H577p.js +120 -0
- package/dist/index.css +2 -2
- package/dist/index.js +6514 -5325
- package/dist/{jsx-runtime-Cyy0mp0f.js → jsx-runtime-2MlY8uwR.js} +132 -122
- package/dist/{messages-FvtWi3lI.js → messages-ZLdeJx9N.js} +11 -31
- package/dist/observe/__tests__/widget-self-http.test.d.ts +2 -0
- package/dist/observe/__tests__/widget-self-http.test.d.ts.map +1 -0
- package/dist/observe/__tests__/widget-self.test.d.ts +2 -0
- package/dist/observe/__tests__/widget-self.test.d.ts.map +1 -0
- package/dist/observe/observers/http.d.ts.map +1 -1
- package/dist/observe/observers/js-error.d.ts +7 -2
- package/dist/observe/observers/js-error.d.ts.map +1 -1
- package/dist/observe/widget-self.d.ts +46 -0
- package/dist/observe/widget-self.d.ts.map +1 -0
- package/dist/plugin/logger.d.ts.map +1 -1
- package/dist/plugins/qrcode.js +7 -6
- package/dist/remark-gfm-DDNju7JY.js +2247 -0
- package/dist/{remark-parse-BnwSmQr-.js → remark-parse-B3YPcONN.js} +377 -445
- package/dist/rolldown-runtime-Csywlj8R.js +25 -0
- package/dist/ui/components/ChatFooter.d.ts +4 -3
- package/dist/ui/components/ChatFooter.d.ts.map +1 -1
- package/dist/ui/components/ChatHeader.d.ts +1 -1
- package/dist/ui/components/ChatHeaderMenu.d.ts +1 -1
- package/dist/ui/components/ChatPanel.d.ts +1 -1
- package/dist/ui/components/ChatWidget.d.ts.map +1 -1
- package/dist/ui/components/CommandConfirmationCard.d.ts +1 -1
- package/dist/ui/components/CommandOverlays.d.ts +1 -1
- package/dist/ui/components/CommandPalette.d.ts +1 -1
- package/dist/ui/components/ConversationSelect.d.ts +1 -1
- package/dist/ui/components/CopyIndicator.d.ts +1 -1
- package/dist/ui/components/FloatButton.d.ts +1 -1
- package/dist/ui/components/FooterActions.d.ts +1 -1
- package/dist/ui/components/HelpDialogContent.d.ts +1 -1
- package/dist/ui/components/MessageActionsPopover.d.ts +1 -1
- package/dist/ui/components/MessageAttachments.d.ts +1 -1
- package/dist/ui/components/MessageBubble.d.ts +1 -1
- package/dist/ui/components/MessageCopyButton.d.ts +1 -1
- package/dist/ui/components/MessageEditor.d.ts +1 -1
- package/dist/ui/components/MessageList.d.ts +1 -1
- package/dist/ui/components/MessagePopoverButton.d.ts +1 -1
- package/dist/ui/components/MessageRow.d.ts +1 -1
- package/dist/ui/components/MessageRowActions.d.ts +1 -1
- package/dist/ui/components/MicButton.d.ts +1 -1
- package/dist/ui/components/ResizeHandles.d.ts +1 -1
- package/dist/ui/components/ToolConfirmationCard.d.ts +1 -1
- package/dist/ui/components/ToolConfirmationRecord.d.ts +1 -1
- package/dist/ui/components/ToolsDialogContent.d.ts +1 -1
- package/dist/ui/components/VoiceControls.d.ts +1 -1
- package/dist/ui/components/VoiceControls.d.ts.map +1 -1
- package/dist/ui/components/VoiceLoopStatusBar.d.ts +1 -1
- package/dist/ui/components/VoiceLoopToggle.d.ts +1 -1
- package/dist/ui/components/VoiceRuntime.d.ts +1 -1
- package/dist/ui/components/WidgetDialog.d.ts +1 -1
- package/dist/ui/components/markdown/CodeBlock.d.ts +1 -1
- package/dist/ui/components/markdown/MarkdownBody.d.ts +1 -1
- package/dist/ui/components/markdown/MarkdownMessage.d.ts +1 -1
- package/dist/ui/hooks/use-mic-button.d.ts +2 -0
- package/dist/ui/hooks/use-mic-button.d.ts.map +1 -1
- package/dist/ui/hooks/use-send-message.d.ts.map +1 -1
- package/dist/{unified-DctkAd9P.js → unified-DvM6W8YC.js} +3 -3
- package/dist/{use-voice-input-LtJJz-zQ.js → use-voice-input-DJtyHnsT.js} +3 -3
- package/dist/{voice-support-BeOiOzcn.js → voice-support-DYXg7xML.js} +2 -2
- package/package.json +33 -33
- package/dist/CopyIndicator-RR3hSsBA.js +0 -51
- package/dist/VoiceControls-A7N4uPTo.js +0 -146
- package/dist/blank-line-CUDmZ-mX.js +0 -143
- package/dist/createLucideIcon-C7wGkK-Q.js +0 -43
- package/dist/remark-gfm-Bzy1u34W.js +0 -1962
|
@@ -0,0 +1,2247 @@
|
|
|
1
|
+
import { t as E } from "./default-sNAxTmdF.js";
|
|
2
|
+
import { C as _, S as re, b as C, c as Ye, d as q, f as L, h as et, i as tt, l as nt, n as F, o as X, p as N, r as rt, s as Ce, t as it, u as P, v as ot, x as I, y as B } from "./blank-line-D-aLg3m0.js";
|
|
3
|
+
function pe(e, n) {
|
|
4
|
+
const t = String(e);
|
|
5
|
+
if (typeof n != "string") throw new TypeError("Expected character");
|
|
6
|
+
let i = 0, l = t.indexOf(n);
|
|
7
|
+
for (; l !== -1; )
|
|
8
|
+
i++, l = t.indexOf(n, l + n.length);
|
|
9
|
+
return i;
|
|
10
|
+
}
|
|
11
|
+
function lt(e) {
|
|
12
|
+
if (typeof e != "string") throw new TypeError("Expected a string");
|
|
13
|
+
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
14
|
+
}
|
|
15
|
+
var H = (function(e) {
|
|
16
|
+
if (e == null) return ct;
|
|
17
|
+
if (typeof e == "function") return G(e);
|
|
18
|
+
if (typeof e == "object") return Array.isArray(e) ? at(e) : ut(e);
|
|
19
|
+
if (typeof e == "string") return st(e);
|
|
20
|
+
throw new Error("Expected function, string, or object as test");
|
|
21
|
+
});
|
|
22
|
+
function at(e) {
|
|
23
|
+
const n = [];
|
|
24
|
+
let t = -1;
|
|
25
|
+
for (; ++t < e.length; ) n[t] = H(e[t]);
|
|
26
|
+
return G(i);
|
|
27
|
+
function i(...l) {
|
|
28
|
+
let o = -1;
|
|
29
|
+
for (; ++o < n.length; ) if (n[o].apply(this, l)) return !0;
|
|
30
|
+
return !1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function ut(e) {
|
|
34
|
+
const n = e;
|
|
35
|
+
return G(t);
|
|
36
|
+
function t(i) {
|
|
37
|
+
const l = i;
|
|
38
|
+
let o;
|
|
39
|
+
for (o in e) if (l[o] !== n[o]) return !1;
|
|
40
|
+
return !0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function st(e) {
|
|
44
|
+
return G(n);
|
|
45
|
+
function n(t) {
|
|
46
|
+
return t && t.type === e;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function G(e) {
|
|
50
|
+
return n;
|
|
51
|
+
function n(t, i, l) {
|
|
52
|
+
return !!(ft(t) && e.call(this, t, typeof i == "number" ? i : void 0, l || void 0));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function ct() {
|
|
56
|
+
return !0;
|
|
57
|
+
}
|
|
58
|
+
function ft(e) {
|
|
59
|
+
return e !== null && typeof e == "object" && "type" in e;
|
|
60
|
+
}
|
|
61
|
+
var Ae = [];
|
|
62
|
+
function ee(e, n, t, i) {
|
|
63
|
+
if (!e || typeof e != "object") throw new Error("Unexpected value `" + e + "` for `tree`, expected node");
|
|
64
|
+
let l = !0, o, r, u, a;
|
|
65
|
+
if (typeof t == "function" || t && typeof t == "object" ? (o = n, r = t, i && (l = !1)) : (r = n, t && (l = !1)), typeof r == "function") u = r;
|
|
66
|
+
else if (r && typeof r == "object") {
|
|
67
|
+
if (!(r.enter === null || r.enter === void 0))
|
|
68
|
+
if (typeof r.enter == "function") u = r.enter;
|
|
69
|
+
else throw new Error("Unexpected value `" + r.enter + "` for `visitors.enter`, expected optional visitor");
|
|
70
|
+
if (typeof r.exit == "function") a = r.exit;
|
|
71
|
+
else throw new Error("Unexpected value `" + r.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)");
|
|
72
|
+
} else throw new Error("Unexpected value `" + r + "` for `enter` or `visitors`, expected visitor or object with visitors");
|
|
73
|
+
const c = H(o), f = l ? 1 : -1;
|
|
74
|
+
s(e, void 0, [])();
|
|
75
|
+
function s(g, m, h) {
|
|
76
|
+
const b = g && typeof g == "object" ? g : {};
|
|
77
|
+
if (typeof b.type == "string") {
|
|
78
|
+
const k = typeof b.tagName == "string" ? b.tagName : typeof b.name == "string" ? b.name : void 0;
|
|
79
|
+
Object.defineProperty(d, "name", { value: "node (" + (g.type + (k ? "<" + k + ">" : "")) + ")" });
|
|
80
|
+
}
|
|
81
|
+
return d;
|
|
82
|
+
function d() {
|
|
83
|
+
const k = !o || c(g, m, h[h.length - 1] || void 0);
|
|
84
|
+
let w = Ae;
|
|
85
|
+
if (u && k && (w = me(u(g, h, m)), w[0] === !1))
|
|
86
|
+
return w;
|
|
87
|
+
if ("children" in g && g.children) {
|
|
88
|
+
const x = g;
|
|
89
|
+
if (x.children && w[0] !== "skip") {
|
|
90
|
+
let v = (l ? -1 : x.children.length) + f;
|
|
91
|
+
const y = [...h, x];
|
|
92
|
+
for (; v > -1 && v < x.children.length; ) {
|
|
93
|
+
const z = x.children[v], D = s(z, v, y)();
|
|
94
|
+
if (D[0] === !1) return D;
|
|
95
|
+
v = typeof D[1] == "number" ? D[1] : v + f;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (a && k) {
|
|
100
|
+
const x = me(a(g, h, m));
|
|
101
|
+
if (x[0] === "skip") throw new Error("Unexpected value `" + x[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");
|
|
102
|
+
if (x[0] === !1 || typeof x[1] == "number") return x;
|
|
103
|
+
}
|
|
104
|
+
return w;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function me(e) {
|
|
109
|
+
return Array.isArray(e) ? e : typeof e == "number" ? [!0, e] : e == null ? Ae : [e];
|
|
110
|
+
}
|
|
111
|
+
function ht(e, n, t) {
|
|
112
|
+
const i = H((t || {}).ignore || []), l = pt(n);
|
|
113
|
+
let o = -1;
|
|
114
|
+
for (; ++o < l.length; ) ee(e, "text", r);
|
|
115
|
+
function r(a, c) {
|
|
116
|
+
let f = -1, s;
|
|
117
|
+
for (; ++f < c.length; ) {
|
|
118
|
+
const g = c[f], m = s ? s.children : void 0;
|
|
119
|
+
if (i(g, m ? m.indexOf(g) : void 0, s)) return;
|
|
120
|
+
s = g;
|
|
121
|
+
}
|
|
122
|
+
if (s) return u(a, c);
|
|
123
|
+
}
|
|
124
|
+
function u(a, c) {
|
|
125
|
+
const f = c[c.length - 1], s = l[o][0], g = l[o][1];
|
|
126
|
+
let m = 0;
|
|
127
|
+
const h = f.children.indexOf(a);
|
|
128
|
+
let b = !1, d = [];
|
|
129
|
+
s.lastIndex = 0;
|
|
130
|
+
let k = s.exec(a.value);
|
|
131
|
+
for (; k; ) {
|
|
132
|
+
const w = k.index, x = {
|
|
133
|
+
index: k.index,
|
|
134
|
+
input: k.input,
|
|
135
|
+
stack: [...c, a]
|
|
136
|
+
};
|
|
137
|
+
let v = g(...k, x);
|
|
138
|
+
if (typeof v == "string" && (v = v.length > 0 ? {
|
|
139
|
+
type: "text",
|
|
140
|
+
value: v
|
|
141
|
+
} : void 0), v === !1 ? s.lastIndex = w + 1 : (m !== w && d.push({
|
|
142
|
+
type: "text",
|
|
143
|
+
value: a.value.slice(m, w)
|
|
144
|
+
}), Array.isArray(v) ? d.push(...v) : v && d.push(v), m = w + k[0].length, b = !0), !s.global) break;
|
|
145
|
+
k = s.exec(a.value);
|
|
146
|
+
}
|
|
147
|
+
return b ? (m < a.value.length && d.push({
|
|
148
|
+
type: "text",
|
|
149
|
+
value: a.value.slice(m)
|
|
150
|
+
}), f.children.splice(h, 1, ...d)) : d = [a], h + d.length;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function pt(e) {
|
|
154
|
+
const n = [];
|
|
155
|
+
if (!Array.isArray(e)) throw new TypeError("Expected find and replace tuple or list of tuples");
|
|
156
|
+
const t = !e[0] || Array.isArray(e[0]) ? e : [e];
|
|
157
|
+
let i = -1;
|
|
158
|
+
for (; ++i < t.length; ) {
|
|
159
|
+
const l = t[i];
|
|
160
|
+
n.push([mt(l[0]), gt(l[1])]);
|
|
161
|
+
}
|
|
162
|
+
return n;
|
|
163
|
+
}
|
|
164
|
+
function mt(e) {
|
|
165
|
+
return typeof e == "string" ? new RegExp(lt(e), "g") : e;
|
|
166
|
+
}
|
|
167
|
+
function gt(e) {
|
|
168
|
+
return typeof e == "function" ? e : function() {
|
|
169
|
+
return e;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
var Z = "phrasing", J = [
|
|
173
|
+
"autolink",
|
|
174
|
+
"link",
|
|
175
|
+
"image",
|
|
176
|
+
"label"
|
|
177
|
+
];
|
|
178
|
+
function kt() {
|
|
179
|
+
return {
|
|
180
|
+
transforms: [Ct],
|
|
181
|
+
enter: {
|
|
182
|
+
literalAutolink: bt,
|
|
183
|
+
literalAutolinkEmail: V,
|
|
184
|
+
literalAutolinkHttp: V,
|
|
185
|
+
literalAutolinkWww: V
|
|
186
|
+
},
|
|
187
|
+
exit: {
|
|
188
|
+
literalAutolink: yt,
|
|
189
|
+
literalAutolinkEmail: vt,
|
|
190
|
+
literalAutolinkHttp: xt,
|
|
191
|
+
literalAutolinkWww: wt
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function dt() {
|
|
196
|
+
return { unsafe: [
|
|
197
|
+
{
|
|
198
|
+
character: "@",
|
|
199
|
+
before: "[+\\-.\\w]",
|
|
200
|
+
after: "[\\-.\\w]",
|
|
201
|
+
inConstruct: Z,
|
|
202
|
+
notInConstruct: J
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
character: ".",
|
|
206
|
+
before: "[Ww]",
|
|
207
|
+
after: "[\\-.\\w]",
|
|
208
|
+
inConstruct: Z,
|
|
209
|
+
notInConstruct: J
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
character: ":",
|
|
213
|
+
before: "[ps]",
|
|
214
|
+
after: "\\/",
|
|
215
|
+
inConstruct: Z,
|
|
216
|
+
notInConstruct: J
|
|
217
|
+
}
|
|
218
|
+
] };
|
|
219
|
+
}
|
|
220
|
+
function bt(e) {
|
|
221
|
+
this.enter({
|
|
222
|
+
type: "link",
|
|
223
|
+
title: null,
|
|
224
|
+
url: "",
|
|
225
|
+
children: []
|
|
226
|
+
}, e);
|
|
227
|
+
}
|
|
228
|
+
function V(e) {
|
|
229
|
+
this.config.enter.autolinkProtocol.call(this, e);
|
|
230
|
+
}
|
|
231
|
+
function xt(e) {
|
|
232
|
+
this.config.exit.autolinkProtocol.call(this, e);
|
|
233
|
+
}
|
|
234
|
+
function wt(e) {
|
|
235
|
+
this.config.exit.data.call(this, e);
|
|
236
|
+
const n = this.stack[this.stack.length - 1];
|
|
237
|
+
n.type, n.url = "http://" + this.sliceSerialize(e);
|
|
238
|
+
}
|
|
239
|
+
function vt(e) {
|
|
240
|
+
this.config.exit.autolinkEmail.call(this, e);
|
|
241
|
+
}
|
|
242
|
+
function yt(e) {
|
|
243
|
+
this.exit(e);
|
|
244
|
+
}
|
|
245
|
+
function Ct(e) {
|
|
246
|
+
ht(e, [[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, At], [new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)", "gu"), Dt]], { ignore: ["link", "linkReference"] });
|
|
247
|
+
}
|
|
248
|
+
function At(e, n, t, i, l) {
|
|
249
|
+
let o = "";
|
|
250
|
+
if (!De(l) || (/^w/i.test(n) && (t = n + t, n = "", o = "http://"), !St(t))) return !1;
|
|
251
|
+
const r = Ft(t + i);
|
|
252
|
+
if (!r[0]) return !1;
|
|
253
|
+
const u = {
|
|
254
|
+
type: "link",
|
|
255
|
+
title: null,
|
|
256
|
+
url: o + n + r[0],
|
|
257
|
+
children: [{
|
|
258
|
+
type: "text",
|
|
259
|
+
value: n + r[0]
|
|
260
|
+
}]
|
|
261
|
+
};
|
|
262
|
+
return r[1] ? [u, {
|
|
263
|
+
type: "text",
|
|
264
|
+
value: r[1]
|
|
265
|
+
}] : u;
|
|
266
|
+
}
|
|
267
|
+
function Dt(e, n, t, i) {
|
|
268
|
+
return !De(i, !0) || /[-\d_]$/.test(t) ? !1 : {
|
|
269
|
+
type: "link",
|
|
270
|
+
title: null,
|
|
271
|
+
url: "mailto:" + n + "@" + t,
|
|
272
|
+
children: [{
|
|
273
|
+
type: "text",
|
|
274
|
+
value: n + "@" + t
|
|
275
|
+
}]
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function St(e) {
|
|
279
|
+
const n = e.split(".");
|
|
280
|
+
return !(n.length < 2 || n[n.length - 1] && (/_/.test(n[n.length - 1]) || !/[a-zA-Z\d]/.test(n[n.length - 1])) || n[n.length - 2] && (/_/.test(n[n.length - 2]) || !/[a-zA-Z\d]/.test(n[n.length - 2])));
|
|
281
|
+
}
|
|
282
|
+
function Ft(e) {
|
|
283
|
+
const n = /[!"&'),.:;<>?\]}]+$/.exec(e);
|
|
284
|
+
if (!n) return [e, void 0];
|
|
285
|
+
e = e.slice(0, n.index);
|
|
286
|
+
let t = n[0], i = t.indexOf(")");
|
|
287
|
+
const l = pe(e, "(");
|
|
288
|
+
let o = pe(e, ")");
|
|
289
|
+
for (; i !== -1 && l > o; )
|
|
290
|
+
e += t.slice(0, i + 1), t = t.slice(i + 1), i = t.indexOf(")"), o++;
|
|
291
|
+
return [e, t];
|
|
292
|
+
}
|
|
293
|
+
function De(e, n) {
|
|
294
|
+
const t = e.input.charCodeAt(e.index - 1);
|
|
295
|
+
return (e.index === 0 || _(t) || re(t)) && (!n || t !== 47);
|
|
296
|
+
}
|
|
297
|
+
Se.peek = Pt;
|
|
298
|
+
function zt() {
|
|
299
|
+
this.buffer();
|
|
300
|
+
}
|
|
301
|
+
function Tt(e) {
|
|
302
|
+
this.enter({
|
|
303
|
+
type: "footnoteReference",
|
|
304
|
+
identifier: "",
|
|
305
|
+
label: ""
|
|
306
|
+
}, e);
|
|
307
|
+
}
|
|
308
|
+
function Lt() {
|
|
309
|
+
this.buffer();
|
|
310
|
+
}
|
|
311
|
+
function Et(e) {
|
|
312
|
+
this.enter({
|
|
313
|
+
type: "footnoteDefinition",
|
|
314
|
+
identifier: "",
|
|
315
|
+
label: "",
|
|
316
|
+
children: []
|
|
317
|
+
}, e);
|
|
318
|
+
}
|
|
319
|
+
function It(e) {
|
|
320
|
+
const n = this.resume(), t = this.stack[this.stack.length - 1];
|
|
321
|
+
t.type, t.identifier = q(this.sliceSerialize(e)).toLowerCase(), t.label = n;
|
|
322
|
+
}
|
|
323
|
+
function Mt(e) {
|
|
324
|
+
this.exit(e);
|
|
325
|
+
}
|
|
326
|
+
function Rt(e) {
|
|
327
|
+
const n = this.resume(), t = this.stack[this.stack.length - 1];
|
|
328
|
+
t.type, t.identifier = q(this.sliceSerialize(e)).toLowerCase(), t.label = n;
|
|
329
|
+
}
|
|
330
|
+
function _t(e) {
|
|
331
|
+
this.exit(e);
|
|
332
|
+
}
|
|
333
|
+
function Pt() {
|
|
334
|
+
return "[";
|
|
335
|
+
}
|
|
336
|
+
function Se(e, n, t, i) {
|
|
337
|
+
const l = t.createTracker(i);
|
|
338
|
+
let o = l.move("[^");
|
|
339
|
+
const r = t.enter("footnoteReference"), u = t.enter("reference");
|
|
340
|
+
return o += l.move(t.safe(t.associationId(e), {
|
|
341
|
+
after: "]",
|
|
342
|
+
before: o
|
|
343
|
+
})), u(), r(), o += l.move("]"), o;
|
|
344
|
+
}
|
|
345
|
+
function jt() {
|
|
346
|
+
return {
|
|
347
|
+
enter: {
|
|
348
|
+
gfmFootnoteCallString: zt,
|
|
349
|
+
gfmFootnoteCall: Tt,
|
|
350
|
+
gfmFootnoteDefinitionLabelString: Lt,
|
|
351
|
+
gfmFootnoteDefinition: Et
|
|
352
|
+
},
|
|
353
|
+
exit: {
|
|
354
|
+
gfmFootnoteCallString: It,
|
|
355
|
+
gfmFootnoteCall: Mt,
|
|
356
|
+
gfmFootnoteDefinitionLabelString: Rt,
|
|
357
|
+
gfmFootnoteDefinition: _t
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function Bt(e) {
|
|
362
|
+
let n = !1;
|
|
363
|
+
return e && e.firstLineBlank && (n = !0), {
|
|
364
|
+
handlers: {
|
|
365
|
+
footnoteDefinition: t,
|
|
366
|
+
footnoteReference: Se
|
|
367
|
+
},
|
|
368
|
+
unsafe: [{
|
|
369
|
+
character: "[",
|
|
370
|
+
inConstruct: [
|
|
371
|
+
"label",
|
|
372
|
+
"phrasing",
|
|
373
|
+
"reference"
|
|
374
|
+
]
|
|
375
|
+
}]
|
|
376
|
+
};
|
|
377
|
+
function t(i, l, o, r) {
|
|
378
|
+
const u = o.createTracker(r);
|
|
379
|
+
let a = u.move("[^");
|
|
380
|
+
const c = o.enter("footnoteDefinition"), f = o.enter("label");
|
|
381
|
+
return a += u.move(o.safe(o.associationId(i), {
|
|
382
|
+
before: a,
|
|
383
|
+
after: "]"
|
|
384
|
+
})), f(), a += u.move("]:"), i.children && i.children.length > 0 && (u.shift(4), a += u.move((n ? `
|
|
385
|
+
` : " ") + o.indentLines(o.containerFlow(i, u.current()), n ? Fe : qt))), c(), a;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function qt(e, n, t) {
|
|
389
|
+
return n === 0 ? e : Fe(e, n, t);
|
|
390
|
+
}
|
|
391
|
+
function Fe(e, n, t) {
|
|
392
|
+
return (t ? "" : " ") + e;
|
|
393
|
+
}
|
|
394
|
+
var Ot = [
|
|
395
|
+
"autolink",
|
|
396
|
+
"destinationLiteral",
|
|
397
|
+
"destinationRaw",
|
|
398
|
+
"reference",
|
|
399
|
+
"titleQuote",
|
|
400
|
+
"titleApostrophe"
|
|
401
|
+
];
|
|
402
|
+
ze.peek = Ht;
|
|
403
|
+
function $t() {
|
|
404
|
+
return {
|
|
405
|
+
canContainEols: ["delete"],
|
|
406
|
+
enter: { strikethrough: Ut },
|
|
407
|
+
exit: { strikethrough: Nt }
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function Wt() {
|
|
411
|
+
return {
|
|
412
|
+
unsafe: [{
|
|
413
|
+
character: "~",
|
|
414
|
+
inConstruct: "phrasing",
|
|
415
|
+
notInConstruct: Ot
|
|
416
|
+
}],
|
|
417
|
+
handlers: { delete: ze }
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
function Ut(e) {
|
|
421
|
+
this.enter({
|
|
422
|
+
type: "delete",
|
|
423
|
+
children: []
|
|
424
|
+
}, e);
|
|
425
|
+
}
|
|
426
|
+
function Nt(e) {
|
|
427
|
+
this.exit(e);
|
|
428
|
+
}
|
|
429
|
+
function ze(e, n, t, i) {
|
|
430
|
+
const l = t.createTracker(i), o = t.enter("strikethrough");
|
|
431
|
+
let r = l.move("~~");
|
|
432
|
+
return r += t.containerPhrasing(e, {
|
|
433
|
+
...l.current(),
|
|
434
|
+
before: r,
|
|
435
|
+
after: "~"
|
|
436
|
+
}), r += l.move("~~"), o(), r;
|
|
437
|
+
}
|
|
438
|
+
function Ht() {
|
|
439
|
+
return "~";
|
|
440
|
+
}
|
|
441
|
+
function Gt(e) {
|
|
442
|
+
return e.length;
|
|
443
|
+
}
|
|
444
|
+
function Qt(e, n) {
|
|
445
|
+
const t = n || {}, i = (t.align || []).concat(), l = t.stringLength || Gt, o = [], r = [], u = [], a = [];
|
|
446
|
+
let c = 0, f = -1;
|
|
447
|
+
for (; ++f < e.length; ) {
|
|
448
|
+
const b = [], d = [];
|
|
449
|
+
let k = -1;
|
|
450
|
+
for (e[f].length > c && (c = e[f].length); ++k < e[f].length; ) {
|
|
451
|
+
const w = Kt(e[f][k]);
|
|
452
|
+
if (t.alignDelimiters !== !1) {
|
|
453
|
+
const x = l(w);
|
|
454
|
+
d[k] = x, (a[k] === void 0 || x > a[k]) && (a[k] = x);
|
|
455
|
+
}
|
|
456
|
+
b.push(w);
|
|
457
|
+
}
|
|
458
|
+
r[f] = b, u[f] = d;
|
|
459
|
+
}
|
|
460
|
+
let s = -1;
|
|
461
|
+
if (typeof i == "object" && "length" in i) for (; ++s < c; ) o[s] = ge(i[s]);
|
|
462
|
+
else {
|
|
463
|
+
const b = ge(i);
|
|
464
|
+
for (; ++s < c; ) o[s] = b;
|
|
465
|
+
}
|
|
466
|
+
s = -1;
|
|
467
|
+
const g = [], m = [];
|
|
468
|
+
for (; ++s < c; ) {
|
|
469
|
+
const b = o[s];
|
|
470
|
+
let d = "", k = "";
|
|
471
|
+
b === 99 ? (d = ":", k = ":") : b === 108 ? d = ":" : b === 114 && (k = ":");
|
|
472
|
+
let w = t.alignDelimiters === !1 ? 1 : Math.max(1, a[s] - d.length - k.length);
|
|
473
|
+
const x = d + "-".repeat(w) + k;
|
|
474
|
+
t.alignDelimiters !== !1 && (w = d.length + w + k.length, w > a[s] && (a[s] = w), m[s] = w), g[s] = x;
|
|
475
|
+
}
|
|
476
|
+
r.splice(1, 0, g), u.splice(1, 0, m), f = -1;
|
|
477
|
+
const h = [];
|
|
478
|
+
for (; ++f < r.length; ) {
|
|
479
|
+
const b = r[f], d = u[f];
|
|
480
|
+
s = -1;
|
|
481
|
+
const k = [];
|
|
482
|
+
for (; ++s < c; ) {
|
|
483
|
+
const w = b[s] || "";
|
|
484
|
+
let x = "", v = "";
|
|
485
|
+
if (t.alignDelimiters !== !1) {
|
|
486
|
+
const y = a[s] - (d[s] || 0), z = o[s];
|
|
487
|
+
z === 114 ? x = " ".repeat(y) : z === 99 ? y % 2 ? (x = " ".repeat(y / 2 + 0.5), v = " ".repeat(y / 2 - 0.5)) : (x = " ".repeat(y / 2), v = x) : v = " ".repeat(y);
|
|
488
|
+
}
|
|
489
|
+
t.delimiterStart !== !1 && !s && k.push("|"), t.padding !== !1 && !(t.alignDelimiters === !1 && w === "") && (t.delimiterStart !== !1 || s) && k.push(" "), t.alignDelimiters !== !1 && k.push(x), k.push(w), t.alignDelimiters !== !1 && k.push(v), t.padding !== !1 && k.push(" "), (t.delimiterEnd !== !1 || s !== c - 1) && k.push("|");
|
|
490
|
+
}
|
|
491
|
+
h.push(t.delimiterEnd === !1 ? k.join("").replace(/ +$/, "") : k.join(""));
|
|
492
|
+
}
|
|
493
|
+
return h.join(`
|
|
494
|
+
`);
|
|
495
|
+
}
|
|
496
|
+
function Kt(e) {
|
|
497
|
+
return e == null ? "" : String(e);
|
|
498
|
+
}
|
|
499
|
+
function ge(e) {
|
|
500
|
+
const n = typeof e == "string" ? e.codePointAt(0) : 0;
|
|
501
|
+
return n === 67 || n === 99 ? 99 : n === 76 || n === 108 ? 108 : n === 82 || n === 114 ? 114 : 0;
|
|
502
|
+
}
|
|
503
|
+
var Xt = H([
|
|
504
|
+
"break",
|
|
505
|
+
"delete",
|
|
506
|
+
"emphasis",
|
|
507
|
+
"footnote",
|
|
508
|
+
"footnoteReference",
|
|
509
|
+
"image",
|
|
510
|
+
"imageReference",
|
|
511
|
+
"inlineCode",
|
|
512
|
+
"inlineMath",
|
|
513
|
+
"link",
|
|
514
|
+
"linkReference",
|
|
515
|
+
"mdxJsxTextElement",
|
|
516
|
+
"mdxTextExpression",
|
|
517
|
+
"strong",
|
|
518
|
+
"text",
|
|
519
|
+
"textDirective"
|
|
520
|
+
]);
|
|
521
|
+
function Zt(e, n, t, i) {
|
|
522
|
+
const l = t.enter("blockquote"), o = t.createTracker(i);
|
|
523
|
+
o.move("> "), o.shift(2);
|
|
524
|
+
const r = t.indentLines(t.containerFlow(e, o.current()), Jt);
|
|
525
|
+
return l(), r;
|
|
526
|
+
}
|
|
527
|
+
function Jt(e, n, t) {
|
|
528
|
+
return ">" + (t ? "" : " ") + e;
|
|
529
|
+
}
|
|
530
|
+
function Vt(e, n) {
|
|
531
|
+
return ke(e, n.inConstruct, !0) && !ke(e, n.notInConstruct, !1);
|
|
532
|
+
}
|
|
533
|
+
function ke(e, n, t) {
|
|
534
|
+
if (typeof n == "string" && (n = [n]), !n || n.length === 0) return t;
|
|
535
|
+
let i = -1;
|
|
536
|
+
for (; ++i < n.length; ) if (e.includes(n[i])) return !0;
|
|
537
|
+
return !1;
|
|
538
|
+
}
|
|
539
|
+
function de(e, n, t, i) {
|
|
540
|
+
let l = -1;
|
|
541
|
+
for (; ++l < t.unsafe.length; ) {
|
|
542
|
+
const o = t.unsafe[l];
|
|
543
|
+
if (o.character === `
|
|
544
|
+
` && !o.before && !o.after && Vt(t.stack, o)) return /[\t ]/.test(i.before) ? "" : " ";
|
|
545
|
+
}
|
|
546
|
+
return `\\
|
|
547
|
+
`;
|
|
548
|
+
}
|
|
549
|
+
function Yt(e, n) {
|
|
550
|
+
const t = String(e);
|
|
551
|
+
let i = t.indexOf(n), l = i, o = 0, r = 0;
|
|
552
|
+
if (typeof n != "string") throw new TypeError("Expected substring");
|
|
553
|
+
for (; i !== -1; )
|
|
554
|
+
i === l ? ++o > r && (r = o) : o = 1, l = i + n.length, i = t.indexOf(n, l);
|
|
555
|
+
return r;
|
|
556
|
+
}
|
|
557
|
+
function en(e, n) {
|
|
558
|
+
return !!(n.options.fences === !1 && e.value && !e.lang && /[^\n\r ]/.test(e.value) && !/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value));
|
|
559
|
+
}
|
|
560
|
+
function tn(e) {
|
|
561
|
+
const n = e.options.fence || "`";
|
|
562
|
+
if (n !== "`" && n !== "~") throw new Error("Cannot serialize code with `" + n + "` for `options.fence`, expected `` ` `` or `~`");
|
|
563
|
+
return n;
|
|
564
|
+
}
|
|
565
|
+
function nn(e, n, t, i) {
|
|
566
|
+
const l = tn(t), o = e.value || "";
|
|
567
|
+
if (en(e, t)) {
|
|
568
|
+
const s = t.enter("codeIndented"), g = t.indentLines(o, rn);
|
|
569
|
+
return s(), g;
|
|
570
|
+
}
|
|
571
|
+
const r = t.createTracker(i), u = l.repeat(Math.max(Yt(o, l) + 1, 3)), a = t.enter("codeFenced"), c = l === "`" ? "GraveAccent" : "Tilde";
|
|
572
|
+
let f = r.move(u);
|
|
573
|
+
if (e.lang) {
|
|
574
|
+
const s = t.enter(`codeFencedLang${c}`);
|
|
575
|
+
f += r.move(t.safe(e.lang, {
|
|
576
|
+
before: f,
|
|
577
|
+
after: " ",
|
|
578
|
+
encode: ["`"],
|
|
579
|
+
...r.current()
|
|
580
|
+
})), s();
|
|
581
|
+
}
|
|
582
|
+
if (e.lang && e.meta) {
|
|
583
|
+
const s = t.enter(`codeFencedMeta${c}`);
|
|
584
|
+
f += r.move(" "), f += r.move(t.safe(e.meta, {
|
|
585
|
+
before: f,
|
|
586
|
+
after: `
|
|
587
|
+
`,
|
|
588
|
+
encode: ["`"],
|
|
589
|
+
...r.current()
|
|
590
|
+
})), s();
|
|
591
|
+
}
|
|
592
|
+
return f += r.move(`
|
|
593
|
+
`), o && (f += r.move(o + `
|
|
594
|
+
`)), f += r.move(u), a(), f;
|
|
595
|
+
}
|
|
596
|
+
function rn(e, n, t) {
|
|
597
|
+
return (t ? "" : " ") + e;
|
|
598
|
+
}
|
|
599
|
+
function ie(e) {
|
|
600
|
+
const n = e.options.quote || '"';
|
|
601
|
+
if (n !== '"' && n !== "'") throw new Error("Cannot serialize title with `" + n + "` for `options.quote`, expected `\"`, or `'`");
|
|
602
|
+
return n;
|
|
603
|
+
}
|
|
604
|
+
function on(e, n, t, i) {
|
|
605
|
+
const l = ie(t), o = l === '"' ? "Quote" : "Apostrophe", r = t.enter("definition");
|
|
606
|
+
let u = t.enter("label");
|
|
607
|
+
const a = t.createTracker(i);
|
|
608
|
+
let c = a.move("[");
|
|
609
|
+
return c += a.move(t.safe(t.associationId(e), {
|
|
610
|
+
before: c,
|
|
611
|
+
after: "]",
|
|
612
|
+
...a.current()
|
|
613
|
+
})), c += a.move("]: "), u(), !e.url || /[\0- \u007F]/.test(e.url) ? (u = t.enter("destinationLiteral"), c += a.move("<"), c += a.move(t.safe(e.url, {
|
|
614
|
+
before: c,
|
|
615
|
+
after: ">",
|
|
616
|
+
...a.current()
|
|
617
|
+
})), c += a.move(">")) : (u = t.enter("destinationRaw"), c += a.move(t.safe(e.url, {
|
|
618
|
+
before: c,
|
|
619
|
+
after: e.title ? " " : `
|
|
620
|
+
`,
|
|
621
|
+
...a.current()
|
|
622
|
+
}))), u(), e.title && (u = t.enter(`title${o}`), c += a.move(" " + l), c += a.move(t.safe(e.title, {
|
|
623
|
+
before: c,
|
|
624
|
+
after: l,
|
|
625
|
+
...a.current()
|
|
626
|
+
})), c += a.move(l), u()), r(), c;
|
|
627
|
+
}
|
|
628
|
+
function ln(e) {
|
|
629
|
+
const n = e.options.emphasis || "*";
|
|
630
|
+
if (n !== "*" && n !== "_") throw new Error("Cannot serialize emphasis with `" + n + "` for `options.emphasis`, expected `*`, or `_`");
|
|
631
|
+
return n;
|
|
632
|
+
}
|
|
633
|
+
function U(e) {
|
|
634
|
+
const n = e.codePointAt(0);
|
|
635
|
+
return n === void 0 ? "" : String.fromCodePoint(n);
|
|
636
|
+
}
|
|
637
|
+
function R(e) {
|
|
638
|
+
const n = e.codePointAt(e.length - 2);
|
|
639
|
+
return n !== void 0 && n > 65535 ? e.slice(-2) : e.slice(-1);
|
|
640
|
+
}
|
|
641
|
+
function Te(e) {
|
|
642
|
+
return "&#x" + e.toString(16).toUpperCase() + ";";
|
|
643
|
+
}
|
|
644
|
+
function be(e, n, t) {
|
|
645
|
+
const i = P(e), l = P(n);
|
|
646
|
+
return i === void 0 ? l === void 0 ? t === "_" ? {
|
|
647
|
+
inside: !0,
|
|
648
|
+
outside: !0
|
|
649
|
+
} : {
|
|
650
|
+
inside: !1,
|
|
651
|
+
outside: !1
|
|
652
|
+
} : l === 1 ? {
|
|
653
|
+
inside: !0,
|
|
654
|
+
outside: !0
|
|
655
|
+
} : {
|
|
656
|
+
inside: !1,
|
|
657
|
+
outside: !0
|
|
658
|
+
} : i === 1 ? l === void 0 ? {
|
|
659
|
+
inside: !1,
|
|
660
|
+
outside: !1
|
|
661
|
+
} : l === 1 ? {
|
|
662
|
+
inside: !0,
|
|
663
|
+
outside: !0
|
|
664
|
+
} : {
|
|
665
|
+
inside: !1,
|
|
666
|
+
outside: !1
|
|
667
|
+
} : l === void 0 ? {
|
|
668
|
+
inside: !1,
|
|
669
|
+
outside: !1
|
|
670
|
+
} : l === 1 ? {
|
|
671
|
+
inside: !0,
|
|
672
|
+
outside: !1
|
|
673
|
+
} : {
|
|
674
|
+
inside: !1,
|
|
675
|
+
outside: !1
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
function an(e) {
|
|
679
|
+
if (e.charCodeAt(0) !== 60) return;
|
|
680
|
+
const n = e.charCodeAt(1);
|
|
681
|
+
if (n === 33) {
|
|
682
|
+
const u = e.charCodeAt(2);
|
|
683
|
+
return u === 45 ? 2 : u === 91 ? 5 : L(u) ? 4 : void 0;
|
|
684
|
+
}
|
|
685
|
+
if (n === 63) return 3;
|
|
686
|
+
const t = n === 47, i = t ? 2 : 1;
|
|
687
|
+
let l = i, o = e.charCodeAt(l);
|
|
688
|
+
if (!L(o)) return;
|
|
689
|
+
for (; o === 45 || N(o); ) o = e.charCodeAt(++l);
|
|
690
|
+
const r = e.slice(i, l).toLowerCase();
|
|
691
|
+
return !t && o !== 47 && nt.includes(r) ? 1 : Ye.includes(r) ? 6 : 7;
|
|
692
|
+
}
|
|
693
|
+
var Le = /* @__PURE__ */ new Map([["*", !1], ["_", !0]]);
|
|
694
|
+
function un(e, n, t) {
|
|
695
|
+
const i = /* @__PURE__ */ new Set();
|
|
696
|
+
for (const o of e) {
|
|
697
|
+
const r = t.get(o);
|
|
698
|
+
if (r && o.attention && n.some((u) => u.attention === o.attention)) for (const u of r.tokens) i.add(u.attention);
|
|
699
|
+
}
|
|
700
|
+
const l = [];
|
|
701
|
+
for (const o of e) o.attention && i.delete(o.attention) && l.push(o.attention);
|
|
702
|
+
return l.reverse(), l;
|
|
703
|
+
}
|
|
704
|
+
function Ee(e, n, t) {
|
|
705
|
+
const i = [], l = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
706
|
+
let r = 0;
|
|
707
|
+
for (; r < e.length; ) {
|
|
708
|
+
if (!e[r].attention) {
|
|
709
|
+
r++;
|
|
710
|
+
continue;
|
|
711
|
+
}
|
|
712
|
+
const u = e[r].value.charAt(0), a = Le.get(u);
|
|
713
|
+
let c = r + 1;
|
|
714
|
+
for (; c < e.length && e[c].attention && e[c].value.charAt(0) === u; ) c++;
|
|
715
|
+
const f = r ? e[r - 1].value : n, s = P(f.charCodeAt(f.length - 1)), g = P((c < e.length ? e[c].value : t).charCodeAt(0)), m = !g || g === 2 && !!s, h = !s || s === 2 && !!g, b = {
|
|
716
|
+
tokens: e.slice(r, c),
|
|
717
|
+
markers: [],
|
|
718
|
+
start: 0,
|
|
719
|
+
end: 0,
|
|
720
|
+
open: a ? m && (!!s || !h) : m,
|
|
721
|
+
close: a ? h && (!!g || !m) : h,
|
|
722
|
+
split: a !== void 0
|
|
723
|
+
};
|
|
724
|
+
for (const d of b.tokens) {
|
|
725
|
+
l.set(d, [...b.tokens]), o.set(d, b);
|
|
726
|
+
let k = d.value.length;
|
|
727
|
+
for (; k--; ) b.markers.push(d);
|
|
728
|
+
}
|
|
729
|
+
b.end = b.markers.length, i.push(b), r = c;
|
|
730
|
+
}
|
|
731
|
+
for (cn(i, l), r = -1; ++r < e.length; ) {
|
|
732
|
+
const u = l.get(e[r]);
|
|
733
|
+
if (u) return {
|
|
734
|
+
attention: un(e, u, o),
|
|
735
|
+
index: r
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
function $(e, n) {
|
|
740
|
+
const t = e[n ? 0 : e.length - 1];
|
|
741
|
+
if (!t || t.attention) return;
|
|
742
|
+
const i = n ? U(t.value) : R(t.value), l = Te(i.codePointAt(0));
|
|
743
|
+
if (n) t.value = l + t.value.slice(i.length);
|
|
744
|
+
else {
|
|
745
|
+
let o = t.value.slice(0, t.value.length - i.length), r = 0;
|
|
746
|
+
for (; o.charCodeAt(o.length - 1 - r) === 92; ) r++;
|
|
747
|
+
r % 2 && (o += "\\"), t.value = o + l;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
function sn(e, n, t, i, l) {
|
|
751
|
+
for (const o of t.attention) {
|
|
752
|
+
const r = n.get(o) || o.sequences[0];
|
|
753
|
+
for (const u of o.sequences) {
|
|
754
|
+
if (u === r) continue;
|
|
755
|
+
const a = new Map(n);
|
|
756
|
+
a.set(o, u);
|
|
757
|
+
const c = Q(e, a, i, l), f = Ee(c, i, l);
|
|
758
|
+
if (!f || f.index > t.index) return {
|
|
759
|
+
chosen: a,
|
|
760
|
+
mistake: f,
|
|
761
|
+
tokens: c
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
function cn(e, n) {
|
|
767
|
+
const t = /* @__PURE__ */ new Map();
|
|
768
|
+
for (const i of e) {
|
|
769
|
+
const l = i.tokens[0].value.charAt(0);
|
|
770
|
+
let o = t.get(l);
|
|
771
|
+
o || (o = [], t.set(l, o));
|
|
772
|
+
let r = i.close ? o.length : 0;
|
|
773
|
+
for (; r-- && i.start < i.end; ) {
|
|
774
|
+
const u = o[r], a = u.end - u.start, c = i.end - i.start;
|
|
775
|
+
if (i.split ? (u.close || i.open) && c % 3 && !((a + c) % 3) : a !== u.markers.length || a !== c) continue;
|
|
776
|
+
const f = i.split ? a > 1 && c > 1 ? 2 : 1 : c, s = u.markers.slice(u.end - f, u.end), g = i.markers.slice(i.start, i.start + f), m = s[0], h = g[0];
|
|
777
|
+
if (m === s[f - 1] && m.value.length === f && h === g[f - 1] && h.value.length === f && m.attention === h.attention)
|
|
778
|
+
n.delete(m), n.delete(h);
|
|
779
|
+
else {
|
|
780
|
+
const b = [.../* @__PURE__ */ new Set([...s, ...g])];
|
|
781
|
+
for (const d of b) {
|
|
782
|
+
const k = n.get(d);
|
|
783
|
+
k && k.push(...b);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
u.end -= f, i.start += f, u.start === u.end && o.splice(r, 1), r = o.length;
|
|
787
|
+
}
|
|
788
|
+
i.open && i.start < i.end && o.push(i);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
function fn(e, n, t) {
|
|
792
|
+
if (n.length === 0) throw new Error("Cannot serialize `" + e + "` as attention without markers, expected one or more markers");
|
|
793
|
+
if (t.length === 0) throw new Error("Cannot serialize `" + e + "` as attention without sizes, expected one or more sizes");
|
|
794
|
+
for (const l of t) if (!Number.isSafeInteger(l) || l < 1) throw new Error("Cannot serialize `" + e + "` as attention with `" + l + "` as size, expected positive integer");
|
|
795
|
+
const i = [];
|
|
796
|
+
for (const l of n) {
|
|
797
|
+
if (l.length !== 1) throw new Error("Cannot serialize `" + e + "` as attention with `" + l + "` as marker, expected a single ascii character");
|
|
798
|
+
if (!ot(l.charCodeAt(0))) throw new Error("Cannot serialize `" + e + "` as attention with `" + l + "` as marker, expected ascii punctuation");
|
|
799
|
+
for (const o of t) i.push(l.repeat(o));
|
|
800
|
+
}
|
|
801
|
+
return i;
|
|
802
|
+
}
|
|
803
|
+
function hn(e, n, t) {
|
|
804
|
+
const i = n.indexStack, l = e.children || [], o = [];
|
|
805
|
+
let r = -1, u = t.before;
|
|
806
|
+
i.push(-1);
|
|
807
|
+
let a = n.createTracker(t);
|
|
808
|
+
for (; ++r < l.length; ) {
|
|
809
|
+
const c = l[r];
|
|
810
|
+
let f;
|
|
811
|
+
if (i[i.length - 1] = r, r + 1 < l.length) {
|
|
812
|
+
let m = n.handle.handlers[l[r + 1].type];
|
|
813
|
+
m && m.peek && (m = m.peek), f = m ? U(m(l[r + 1], e, n, {
|
|
814
|
+
before: "",
|
|
815
|
+
after: "",
|
|
816
|
+
...a.current()
|
|
817
|
+
})) : "";
|
|
818
|
+
} else f = t.after;
|
|
819
|
+
const s = o[o.length - 1];
|
|
820
|
+
typeof s == "string" && (u === "\r" || u === `
|
|
821
|
+
`) && c.type === "html" && an(c.value) !== 7 && (o[o.length - 1] = s.replace(/(\r?\n|\r)$/, " "), u = " ", a = n.createTracker(t), a.move(K(o, t.before, t.after)));
|
|
822
|
+
const g = n.handle.handlers[c.type];
|
|
823
|
+
if (g && g.attention) {
|
|
824
|
+
const m = oe(c, g.attention, n, a);
|
|
825
|
+
if (!m) continue;
|
|
826
|
+
o.push(m), u = R(m.sequences[0]);
|
|
827
|
+
} else {
|
|
828
|
+
const m = n.handle(c, e, n, {
|
|
829
|
+
...a.current(),
|
|
830
|
+
after: f,
|
|
831
|
+
before: u
|
|
832
|
+
});
|
|
833
|
+
if (!m) continue;
|
|
834
|
+
a.move(m), o.push(m), u = R(m);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
return i.pop(), o;
|
|
838
|
+
}
|
|
839
|
+
function oe(e, n, t, i) {
|
|
840
|
+
const { construct: l, markers: o, sizes: r } = n(e, t), u = fn(e.type, o, r), a = u[0], c = t.enter(l), f = t.createTracker(i.current());
|
|
841
|
+
f.move(a);
|
|
842
|
+
const s = hn(e, t, {
|
|
843
|
+
...f.current(),
|
|
844
|
+
before: a,
|
|
845
|
+
after: a
|
|
846
|
+
});
|
|
847
|
+
if (c(), s.length !== 0)
|
|
848
|
+
return i.move(a), i.move(K(s, a, a)), i.move(a), {
|
|
849
|
+
children: s,
|
|
850
|
+
sequences: u
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
function xe(e, n, t, i) {
|
|
854
|
+
let l = Q(e, n, t, i), o = Ee(l, t, i);
|
|
855
|
+
for (; o; ) {
|
|
856
|
+
const r = sn(e, n, o, t, i);
|
|
857
|
+
if (!r) return;
|
|
858
|
+
n = r.chosen, l = r.tokens, o = r.mistake;
|
|
859
|
+
}
|
|
860
|
+
return l;
|
|
861
|
+
}
|
|
862
|
+
function Ie(e, n, t, i) {
|
|
863
|
+
let l = t, o = -1;
|
|
864
|
+
for (; ++o < e.length; ) {
|
|
865
|
+
const r = e[o];
|
|
866
|
+
if (typeof r == "string") {
|
|
867
|
+
l = "";
|
|
868
|
+
continue;
|
|
869
|
+
}
|
|
870
|
+
const u = o === e.length - 1 ? i : "", a = r.sequences.find(function(c) {
|
|
871
|
+
const f = c.charAt(0);
|
|
872
|
+
return f !== l.charAt(0) && f !== u.charAt(0) || e.length === 1 && Le.has(f) && c.length > t.length;
|
|
873
|
+
}) || r.sequences[0];
|
|
874
|
+
a !== r.sequences[0] && n.set(r, a), Ie(r.children, n, a, a), l = a;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
function Q(e, n, t, i) {
|
|
878
|
+
const l = [];
|
|
879
|
+
let o, r = R(t), u = -1;
|
|
880
|
+
for (; ++u < e.length; ) {
|
|
881
|
+
const a = e[u];
|
|
882
|
+
if (typeof a == "string") {
|
|
883
|
+
const x = {
|
|
884
|
+
value: a,
|
|
885
|
+
attention: void 0
|
|
886
|
+
};
|
|
887
|
+
o && o === U(a) && $([x], !0), o = void 0, l.push(x), x.value && (r = R(x.value));
|
|
888
|
+
continue;
|
|
889
|
+
}
|
|
890
|
+
const c = n.get(a) || a.sequences[0], f = c.charAt(0), s = e[u + 1], g = r, m = U(s === void 0 ? i : typeof s == "string" ? s : n.get(s) || s.sequences[0]), h = Q(a.children, n, c, c), b = h[0].value, d = be(g.charCodeAt(g.length - 1), b.charCodeAt(0), f);
|
|
891
|
+
d.inside && $(h, !0);
|
|
892
|
+
const k = R(h[h.length - 1].value), w = be(m.charCodeAt(0), k.charCodeAt(k.length - 1), f);
|
|
893
|
+
w.inside && $(h, !1), d.outside && g !== `
|
|
894
|
+
` && g !== "\r" && $(l, !1), w.outside && (o = m), l.push({
|
|
895
|
+
value: c,
|
|
896
|
+
attention: a
|
|
897
|
+
}, ...h, {
|
|
898
|
+
value: c,
|
|
899
|
+
attention: a
|
|
900
|
+
}), r = c.charAt(c.length - 1);
|
|
901
|
+
}
|
|
902
|
+
return l;
|
|
903
|
+
}
|
|
904
|
+
function K(e, n, t) {
|
|
905
|
+
const i = /* @__PURE__ */ new Map();
|
|
906
|
+
Ie(e, i, n, t);
|
|
907
|
+
const l = (i.size > 0 ? xe(e, i, n, t) : void 0) || xe(e, /* @__PURE__ */ new Map(), n, t) || Q(e, /* @__PURE__ */ new Map(), n, t);
|
|
908
|
+
let o = "";
|
|
909
|
+
for (const r of l) o += r.value;
|
|
910
|
+
return o;
|
|
911
|
+
}
|
|
912
|
+
le.attention = Me;
|
|
913
|
+
le.peek = pn;
|
|
914
|
+
function le(e, n, t, i) {
|
|
915
|
+
const l = t.enter("phrasing"), o = oe(e, Me, t, t.createTracker(i)), r = o ? K([o], i.before, i.after) : "";
|
|
916
|
+
return l(), r;
|
|
917
|
+
}
|
|
918
|
+
function Me(e, n) {
|
|
919
|
+
return {
|
|
920
|
+
construct: "emphasis",
|
|
921
|
+
markers: ln(n) === "*" ? ["*", "_"] : ["_", "*"],
|
|
922
|
+
sizes: [1]
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
function pn(e, n, t) {
|
|
926
|
+
return t.options.emphasis || "*";
|
|
927
|
+
}
|
|
928
|
+
function mn(e, n, t, i) {
|
|
929
|
+
let l, o, r;
|
|
930
|
+
typeof t == "function" || t && typeof t == "object" ? (l = n, o = t, r = i) : (o = n, r = t), typeof o == "function" ? ee(e, l, te(o), r) : ee(e, l, gn(o), r);
|
|
931
|
+
}
|
|
932
|
+
function gn(e) {
|
|
933
|
+
return !e || typeof e != "object" ? e : {
|
|
934
|
+
enter: typeof e.enter == "function" ? te(e.enter) : e.enter,
|
|
935
|
+
exit: typeof e.exit == "function" ? te(e.exit) : e.exit
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
function te(e) {
|
|
939
|
+
return n;
|
|
940
|
+
function n(t, i, l) {
|
|
941
|
+
return e(t, l, i[i.length - 1]);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
function kn(e, n) {
|
|
945
|
+
let t = !1;
|
|
946
|
+
return mn(e, function(i) {
|
|
947
|
+
if ("value" in i && /\r?\n|\r/.test(i.value) || i.type === "break")
|
|
948
|
+
return t = !0, !1;
|
|
949
|
+
}), !!((!e.depth || e.depth < 3) && Ce(e) && (n.options.setext || t));
|
|
950
|
+
}
|
|
951
|
+
function dn(e, n, t, i) {
|
|
952
|
+
const l = Math.max(Math.min(6, e.depth || 1), 1), o = t.createTracker(i);
|
|
953
|
+
if (kn(e, t)) {
|
|
954
|
+
const s = t.enter("headingSetext"), g = t.enter("phrasing"), m = t.containerPhrasing(e, {
|
|
955
|
+
...o.current(),
|
|
956
|
+
before: `
|
|
957
|
+
`,
|
|
958
|
+
after: `
|
|
959
|
+
`
|
|
960
|
+
});
|
|
961
|
+
return g(), s(), m + `
|
|
962
|
+
` + (l === 1 ? "=" : "-").repeat(m.length - (Math.max(m.lastIndexOf("\r"), m.lastIndexOf(`
|
|
963
|
+
`)) + 1));
|
|
964
|
+
}
|
|
965
|
+
const r = "#".repeat(l), u = t.enter("headingAtx"), a = t.enter("phrasing");
|
|
966
|
+
o.move(r + " ");
|
|
967
|
+
let c = t.containerPhrasing(e, {
|
|
968
|
+
before: "# ",
|
|
969
|
+
after: `
|
|
970
|
+
`,
|
|
971
|
+
...o.current()
|
|
972
|
+
});
|
|
973
|
+
const f = c.charCodeAt(0);
|
|
974
|
+
return (f === 9 || f === 32) && (c = Te(f) + c.slice(1)), c = c ? r + " " + c : r, t.options.closeAtx && (c += " " + r), a(), u(), c;
|
|
975
|
+
}
|
|
976
|
+
Re.peek = bn;
|
|
977
|
+
function Re(e) {
|
|
978
|
+
return e.value || "";
|
|
979
|
+
}
|
|
980
|
+
function bn() {
|
|
981
|
+
return "<";
|
|
982
|
+
}
|
|
983
|
+
_e.peek = xn;
|
|
984
|
+
function _e(e, n, t, i) {
|
|
985
|
+
const l = ie(t), o = l === '"' ? "Quote" : "Apostrophe", r = t.enter("image");
|
|
986
|
+
let u = t.enter("label");
|
|
987
|
+
const a = t.createTracker(i);
|
|
988
|
+
let c = a.move("![");
|
|
989
|
+
return c += a.move(t.safe(e.alt, {
|
|
990
|
+
before: c,
|
|
991
|
+
after: "]",
|
|
992
|
+
...a.current()
|
|
993
|
+
})), c += a.move("]("), u(), !e.url && e.title || /[\0- \u007F]/.test(e.url) ? (u = t.enter("destinationLiteral"), c += a.move("<"), c += a.move(t.safe(e.url, {
|
|
994
|
+
before: c,
|
|
995
|
+
after: ">",
|
|
996
|
+
...a.current()
|
|
997
|
+
})), c += a.move(">")) : (u = t.enter("destinationRaw"), c += a.move(t.safe(e.url, {
|
|
998
|
+
before: c,
|
|
999
|
+
after: e.title ? " " : ")",
|
|
1000
|
+
...a.current()
|
|
1001
|
+
}))), u(), e.title && (u = t.enter(`title${o}`), c += a.move(" " + l), c += a.move(t.safe(e.title, {
|
|
1002
|
+
before: c,
|
|
1003
|
+
after: l,
|
|
1004
|
+
...a.current()
|
|
1005
|
+
})), c += a.move(l), u()), c += a.move(")"), r(), c;
|
|
1006
|
+
}
|
|
1007
|
+
function xn() {
|
|
1008
|
+
return "!";
|
|
1009
|
+
}
|
|
1010
|
+
Pe.peek = wn;
|
|
1011
|
+
function Pe(e, n, t, i) {
|
|
1012
|
+
const l = e.referenceType, o = t.enter("imageReference");
|
|
1013
|
+
let r = t.enter("label");
|
|
1014
|
+
const u = t.createTracker(i);
|
|
1015
|
+
let a = u.move("![");
|
|
1016
|
+
const c = t.safe(e.alt, {
|
|
1017
|
+
before: a,
|
|
1018
|
+
after: "]",
|
|
1019
|
+
...u.current()
|
|
1020
|
+
});
|
|
1021
|
+
a += u.move(c + "]["), r();
|
|
1022
|
+
const f = t.stack;
|
|
1023
|
+
t.stack = f.filter(function(g) {
|
|
1024
|
+
return g !== "phrasing";
|
|
1025
|
+
}), r = t.enter("reference");
|
|
1026
|
+
const s = t.safe(t.associationId(e), {
|
|
1027
|
+
before: a,
|
|
1028
|
+
after: "]",
|
|
1029
|
+
...u.current()
|
|
1030
|
+
});
|
|
1031
|
+
return r(), t.stack = f, o(), l === "full" || !c || c !== s ? a += u.move(s + "]") : l === "shortcut" ? a = a.slice(0, -1) : a += u.move("]"), a;
|
|
1032
|
+
}
|
|
1033
|
+
function wn() {
|
|
1034
|
+
return "!";
|
|
1035
|
+
}
|
|
1036
|
+
je.peek = vn;
|
|
1037
|
+
function je(e, n, t) {
|
|
1038
|
+
let i = e.value || "", l = "`", o = -1;
|
|
1039
|
+
for (; new RegExp("(^|[^`])" + l + "([^`]|$)").test(i); ) l += "`";
|
|
1040
|
+
for (/[^\n\r ]/.test(i) && (/^[\n\r ]/.test(i) && /[\n\r ]$/.test(i) || /^`|`$/.test(i)) && (i = " " + i + " "); ++o < t.unsafe.length; ) {
|
|
1041
|
+
const r = t.unsafe[o], u = t.compilePattern(r);
|
|
1042
|
+
if (!r.atBreak) continue;
|
|
1043
|
+
let a;
|
|
1044
|
+
for (; a = u.exec(i); ) {
|
|
1045
|
+
let c = a.index;
|
|
1046
|
+
i.charCodeAt(c) === 10 && i.charCodeAt(c - 1) === 13 && c--, i = i.slice(0, c) + " " + i.slice(a.index + 1);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
return l + i + l;
|
|
1050
|
+
}
|
|
1051
|
+
function vn() {
|
|
1052
|
+
return "`";
|
|
1053
|
+
}
|
|
1054
|
+
function Be(e, n) {
|
|
1055
|
+
const t = Ce(e);
|
|
1056
|
+
return !!(!n.options.resourceLink && e.url && !e.title && e.children && e.children.length === 1 && e.children[0].type === "text" && (t === e.url || "mailto:" + t === e.url) && /^[a-z][+\-.a-z]+:/i.test(e.url) && !/[\0- <>\u007F]/.test(e.url));
|
|
1057
|
+
}
|
|
1058
|
+
qe.peek = yn;
|
|
1059
|
+
function qe(e, n, t, i) {
|
|
1060
|
+
const l = ie(t), o = l === '"' ? "Quote" : "Apostrophe", r = t.createTracker(i);
|
|
1061
|
+
if (Be(e, t)) {
|
|
1062
|
+
const h = t.stack;
|
|
1063
|
+
t.stack = h.filter(function(k) {
|
|
1064
|
+
return k !== "phrasing";
|
|
1065
|
+
});
|
|
1066
|
+
const b = t.enter("autolink");
|
|
1067
|
+
let d = r.move("<");
|
|
1068
|
+
return d += r.move(t.containerPhrasing(e, {
|
|
1069
|
+
before: d,
|
|
1070
|
+
after: ">",
|
|
1071
|
+
...r.current()
|
|
1072
|
+
})), d += r.move(">"), b(), t.stack = h, d;
|
|
1073
|
+
}
|
|
1074
|
+
const u = t.enter("link");
|
|
1075
|
+
let a = t.enter("label"), c = r.move("[");
|
|
1076
|
+
const f = t.containerPhrasing(e, {
|
|
1077
|
+
before: c,
|
|
1078
|
+
after: "](",
|
|
1079
|
+
...r.current()
|
|
1080
|
+
});
|
|
1081
|
+
c += r.move(f), a(), c += r.move("](");
|
|
1082
|
+
const s = /[\0- \u007F]/.test(e.url), g = i.before.charAt(i.before.length - 1);
|
|
1083
|
+
let m = e.title || void 0;
|
|
1084
|
+
if (!m && !s && (g === `
|
|
1085
|
+
` || g === "\r")) {
|
|
1086
|
+
let h = 0;
|
|
1087
|
+
for (; h < f.length && f.charCodeAt(h) !== 93; ) h += f.charCodeAt(h) === 92 ? 2 : 1;
|
|
1088
|
+
f.charCodeAt(h + 1) === 58 && (m = "");
|
|
1089
|
+
}
|
|
1090
|
+
return !e.url && typeof m == "string" || s ? (a = t.enter("destinationLiteral"), c += r.move("<"), c += r.move(t.safe(e.url, {
|
|
1091
|
+
before: c,
|
|
1092
|
+
after: ">",
|
|
1093
|
+
...r.current()
|
|
1094
|
+
})), c += r.move(">")) : (a = t.enter("destinationRaw"), c += r.move(t.safe(e.url, {
|
|
1095
|
+
before: c,
|
|
1096
|
+
after: typeof m == "string" ? " " : ")",
|
|
1097
|
+
...r.current()
|
|
1098
|
+
}))), a(), typeof m == "string" && (a = t.enter(`title${o}`), c += r.move(" " + l), c += r.move(t.safe(m, {
|
|
1099
|
+
before: c,
|
|
1100
|
+
after: l,
|
|
1101
|
+
...r.current()
|
|
1102
|
+
})), c += r.move(l), a()), c += r.move(")"), u(), c;
|
|
1103
|
+
}
|
|
1104
|
+
function yn(e, n, t) {
|
|
1105
|
+
return Be(e, t) ? "<" : "[";
|
|
1106
|
+
}
|
|
1107
|
+
Oe.peek = Cn;
|
|
1108
|
+
function Oe(e, n, t, i) {
|
|
1109
|
+
const l = e.referenceType, o = t.enter("linkReference");
|
|
1110
|
+
let r = t.enter("label");
|
|
1111
|
+
const u = t.createTracker(i);
|
|
1112
|
+
let a = u.move("[");
|
|
1113
|
+
const c = t.containerPhrasing(e, {
|
|
1114
|
+
before: a,
|
|
1115
|
+
after: "]",
|
|
1116
|
+
...u.current()
|
|
1117
|
+
});
|
|
1118
|
+
a += u.move(c + "]["), r();
|
|
1119
|
+
const f = t.stack;
|
|
1120
|
+
t.stack = f.filter(function(g) {
|
|
1121
|
+
return g !== "phrasing";
|
|
1122
|
+
}), r = t.enter("reference");
|
|
1123
|
+
const s = t.safe(t.associationId(e), {
|
|
1124
|
+
before: a,
|
|
1125
|
+
after: "]",
|
|
1126
|
+
...u.current()
|
|
1127
|
+
});
|
|
1128
|
+
return r(), t.stack = f, o(), l === "full" || !c || c !== s ? a += u.move(s + "]") : l === "shortcut" ? a = a.slice(0, -1) : a += u.move("]"), a;
|
|
1129
|
+
}
|
|
1130
|
+
function Cn() {
|
|
1131
|
+
return "[";
|
|
1132
|
+
}
|
|
1133
|
+
function ae(e) {
|
|
1134
|
+
const n = e.options.bullet || "*";
|
|
1135
|
+
if (n !== "*" && n !== "+" && n !== "-") throw new Error("Cannot serialize items with `" + n + "` for `options.bullet`, expected `*`, `+`, or `-`");
|
|
1136
|
+
return n;
|
|
1137
|
+
}
|
|
1138
|
+
function An(e) {
|
|
1139
|
+
const n = ae(e), t = e.options.bulletOther;
|
|
1140
|
+
if (!t) return n === "*" ? "-" : "*";
|
|
1141
|
+
if (t !== "*" && t !== "+" && t !== "-") throw new Error("Cannot serialize items with `" + t + "` for `options.bulletOther`, expected `*`, `+`, or `-`");
|
|
1142
|
+
if (t === n) throw new Error("Expected `bullet` (`" + n + "`) and `bulletOther` (`" + t + "`) to be different");
|
|
1143
|
+
return t;
|
|
1144
|
+
}
|
|
1145
|
+
function Dn(e) {
|
|
1146
|
+
const n = e.options.bulletOrdered || ".";
|
|
1147
|
+
if (n !== "." && n !== ")") throw new Error("Cannot serialize items with `" + n + "` for `options.bulletOrdered`, expected `.` or `)`");
|
|
1148
|
+
return n;
|
|
1149
|
+
}
|
|
1150
|
+
function $e(e) {
|
|
1151
|
+
const n = e.options.rule || "*";
|
|
1152
|
+
if (n !== "*" && n !== "-" && n !== "_") throw new Error("Cannot serialize rules with `" + n + "` for `options.rule`, expected `*`, `-`, or `_`");
|
|
1153
|
+
return n;
|
|
1154
|
+
}
|
|
1155
|
+
function Sn(e, n, t, i) {
|
|
1156
|
+
const l = t.enter("list"), o = t.bulletCurrent;
|
|
1157
|
+
let r = e.ordered ? Dn(t) : ae(t);
|
|
1158
|
+
const u = e.ordered ? r === "." ? ")" : "." : An(t);
|
|
1159
|
+
let a = n && t.bulletLastUsed ? r === t.bulletLastUsed : !1;
|
|
1160
|
+
if (!e.ordered) {
|
|
1161
|
+
const f = e.children ? e.children[0] : void 0;
|
|
1162
|
+
if ((r === "*" || r === "-") && f && (!f.children || !f.children[0]) && t.stack[t.stack.length - 1] === "list" && t.stack[t.stack.length - 2] === "listItem" && t.stack[t.stack.length - 3] === "list" && t.stack[t.stack.length - 4] === "listItem" && t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (a = !0), $e(t) === r && f) {
|
|
1163
|
+
let s = -1;
|
|
1164
|
+
for (; ++s < e.children.length; ) {
|
|
1165
|
+
const g = e.children[s];
|
|
1166
|
+
if (g && g.type === "listItem" && g.children && g.children[0] && g.children[0].type === "thematicBreak") {
|
|
1167
|
+
a = !0;
|
|
1168
|
+
break;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
a && (r = u), t.bulletCurrent = r;
|
|
1174
|
+
const c = t.containerFlow(e, i);
|
|
1175
|
+
return t.bulletLastUsed = r, t.bulletCurrent = o, l(), c;
|
|
1176
|
+
}
|
|
1177
|
+
function Fn(e) {
|
|
1178
|
+
const n = e.options.listItemIndent || "one";
|
|
1179
|
+
if (n !== "tab" && n !== "one" && n !== "mixed") throw new Error("Cannot serialize items with `" + n + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");
|
|
1180
|
+
return n;
|
|
1181
|
+
}
|
|
1182
|
+
function zn(e, n, t, i) {
|
|
1183
|
+
const l = Fn(t);
|
|
1184
|
+
let o = t.bulletCurrent || ae(t);
|
|
1185
|
+
n && n.type === "list" && n.ordered && (o = (typeof n.start == "number" && n.start > -1 ? n.start : 1) + (t.options.incrementListMarker === !1 ? 0 : n.children.indexOf(e)) + o);
|
|
1186
|
+
let r = o.length + 1;
|
|
1187
|
+
(l === "tab" || l === "mixed" && (n && n.type === "list" && n.spread || e.spread)) && (r = Math.ceil(r / 4) * 4);
|
|
1188
|
+
const u = t.createTracker(i);
|
|
1189
|
+
u.move(o + " ".repeat(r - o.length)), u.shift(r);
|
|
1190
|
+
const a = t.enter("listItem"), c = t.indentLines(t.containerFlow(e, u.current()), f);
|
|
1191
|
+
return a(), c;
|
|
1192
|
+
function f(s, g, m) {
|
|
1193
|
+
return g ? (m ? "" : " ".repeat(r)) + s : (m ? o : o + " ".repeat(r - o.length)) + s;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
function Tn(e, n, t, i) {
|
|
1197
|
+
const l = t.enter("paragraph"), o = t.enter("phrasing"), r = t.containerPhrasing(e, i);
|
|
1198
|
+
return o(), l(), r;
|
|
1199
|
+
}
|
|
1200
|
+
function Ln(e, n, t, i) {
|
|
1201
|
+
if (!e.children.some(function(r) {
|
|
1202
|
+
return Xt(r);
|
|
1203
|
+
})) return t.containerFlow(e, i);
|
|
1204
|
+
const l = t.enter("phrasing"), o = t.containerPhrasing(e, i);
|
|
1205
|
+
return l(), o;
|
|
1206
|
+
}
|
|
1207
|
+
function En(e) {
|
|
1208
|
+
const n = e.options.strong || "*";
|
|
1209
|
+
if (n !== "*" && n !== "_") throw new Error("Cannot serialize strong with `" + n + "` for `options.strong`, expected `*`, or `_`");
|
|
1210
|
+
return n;
|
|
1211
|
+
}
|
|
1212
|
+
ue.attention = We;
|
|
1213
|
+
ue.peek = In;
|
|
1214
|
+
function ue(e, n, t, i) {
|
|
1215
|
+
const l = t.enter("phrasing"), o = oe(e, We, t, t.createTracker(i)), r = o ? K([o], i.before, i.after) : "";
|
|
1216
|
+
return l(), r;
|
|
1217
|
+
}
|
|
1218
|
+
function We(e, n) {
|
|
1219
|
+
return {
|
|
1220
|
+
construct: "strong",
|
|
1221
|
+
markers: En(n) === "*" ? ["*", "_"] : ["_", "*"],
|
|
1222
|
+
sizes: [2]
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
function In(e, n, t) {
|
|
1226
|
+
return t.options.strong || "*";
|
|
1227
|
+
}
|
|
1228
|
+
function Mn(e, n, t, i) {
|
|
1229
|
+
const l = n ? n.children : [], o = t.indexStack[t.indexStack.length - 1];
|
|
1230
|
+
return t.safe(e.value, {
|
|
1231
|
+
...i,
|
|
1232
|
+
afterNode: l[o + 1],
|
|
1233
|
+
beforeNode: l[o - 1]
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
function Rn(e) {
|
|
1237
|
+
const n = e.options.ruleRepetition || 3;
|
|
1238
|
+
if (n < 3) throw new Error("Cannot serialize rules with repetition `" + n + "` for `options.ruleRepetition`, expected `3` or more");
|
|
1239
|
+
return n;
|
|
1240
|
+
}
|
|
1241
|
+
function _n(e, n, t) {
|
|
1242
|
+
const i = ($e(t) + (t.options.ruleSpaces ? " " : "")).repeat(Rn(t));
|
|
1243
|
+
return t.options.ruleSpaces ? i.slice(0, -1) : i;
|
|
1244
|
+
}
|
|
1245
|
+
var Ue = {
|
|
1246
|
+
blockquote: Zt,
|
|
1247
|
+
break: de,
|
|
1248
|
+
code: nn,
|
|
1249
|
+
definition: on,
|
|
1250
|
+
emphasis: le,
|
|
1251
|
+
hardBreak: de,
|
|
1252
|
+
heading: dn,
|
|
1253
|
+
html: Re,
|
|
1254
|
+
image: _e,
|
|
1255
|
+
imageReference: Pe,
|
|
1256
|
+
inlineCode: je,
|
|
1257
|
+
link: qe,
|
|
1258
|
+
linkReference: Oe,
|
|
1259
|
+
list: Sn,
|
|
1260
|
+
listItem: zn,
|
|
1261
|
+
paragraph: Tn,
|
|
1262
|
+
root: Ln,
|
|
1263
|
+
strong: ue,
|
|
1264
|
+
text: Mn,
|
|
1265
|
+
thematicBreak: _n
|
|
1266
|
+
};
|
|
1267
|
+
function Pn() {
|
|
1268
|
+
return {
|
|
1269
|
+
enter: {
|
|
1270
|
+
table: jn,
|
|
1271
|
+
tableData: we,
|
|
1272
|
+
tableHeader: we,
|
|
1273
|
+
tableRow: qn
|
|
1274
|
+
},
|
|
1275
|
+
exit: {
|
|
1276
|
+
codeText: On,
|
|
1277
|
+
table: Bn,
|
|
1278
|
+
tableData: Y,
|
|
1279
|
+
tableHeader: Y,
|
|
1280
|
+
tableRow: Y
|
|
1281
|
+
}
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
function jn(e) {
|
|
1285
|
+
const n = e._align;
|
|
1286
|
+
this.enter({
|
|
1287
|
+
type: "table",
|
|
1288
|
+
align: n.map(function(t) {
|
|
1289
|
+
return t === "none" ? null : t;
|
|
1290
|
+
}),
|
|
1291
|
+
children: []
|
|
1292
|
+
}, e), this.data.inTable = !0;
|
|
1293
|
+
}
|
|
1294
|
+
function Bn(e) {
|
|
1295
|
+
this.exit(e), this.data.inTable = void 0;
|
|
1296
|
+
}
|
|
1297
|
+
function qn(e) {
|
|
1298
|
+
this.enter({
|
|
1299
|
+
type: "tableRow",
|
|
1300
|
+
children: []
|
|
1301
|
+
}, e);
|
|
1302
|
+
}
|
|
1303
|
+
function Y(e) {
|
|
1304
|
+
this.exit(e);
|
|
1305
|
+
}
|
|
1306
|
+
function we(e) {
|
|
1307
|
+
this.enter({
|
|
1308
|
+
type: "tableCell",
|
|
1309
|
+
children: []
|
|
1310
|
+
}, e);
|
|
1311
|
+
}
|
|
1312
|
+
function On(e) {
|
|
1313
|
+
let n = this.resume();
|
|
1314
|
+
this.data.inTable && (n = n.replace(/\\([\\|])/g, $n));
|
|
1315
|
+
const t = this.stack[this.stack.length - 1];
|
|
1316
|
+
t.type, t.value = n, this.exit(e);
|
|
1317
|
+
}
|
|
1318
|
+
function $n(e, n) {
|
|
1319
|
+
return n === "|" ? n : e;
|
|
1320
|
+
}
|
|
1321
|
+
function Wn(e) {
|
|
1322
|
+
const n = e || {}, t = n.tableCellPadding, i = n.tablePipeAlign, l = n.stringLength, o = t ? " " : "|";
|
|
1323
|
+
return {
|
|
1324
|
+
unsafe: [
|
|
1325
|
+
{
|
|
1326
|
+
character: "\r",
|
|
1327
|
+
inConstruct: "tableCell"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
character: `
|
|
1331
|
+
`,
|
|
1332
|
+
inConstruct: "tableCell"
|
|
1333
|
+
},
|
|
1334
|
+
{
|
|
1335
|
+
atBreak: !0,
|
|
1336
|
+
character: "|",
|
|
1337
|
+
after: "[ :-]"
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
character: "|",
|
|
1341
|
+
inConstruct: "tableCell"
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
atBreak: !0,
|
|
1345
|
+
character: ":",
|
|
1346
|
+
after: "-"
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
atBreak: !0,
|
|
1350
|
+
character: "-",
|
|
1351
|
+
after: "[:|-]"
|
|
1352
|
+
}
|
|
1353
|
+
],
|
|
1354
|
+
handlers: {
|
|
1355
|
+
inlineCode: g,
|
|
1356
|
+
table: r,
|
|
1357
|
+
tableCell: a,
|
|
1358
|
+
tableRow: u
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
function r(m, h, b, d) {
|
|
1362
|
+
return c(f(m, b, d), m.align);
|
|
1363
|
+
}
|
|
1364
|
+
function u(m, h, b, d) {
|
|
1365
|
+
const k = c([s(m, b, d)]);
|
|
1366
|
+
return k.slice(0, k.indexOf(`
|
|
1367
|
+
`));
|
|
1368
|
+
}
|
|
1369
|
+
function a(m, h, b, d) {
|
|
1370
|
+
const k = b.enter("tableCell"), w = b.enter("phrasing"), x = b.containerPhrasing(m, {
|
|
1371
|
+
...d,
|
|
1372
|
+
before: o,
|
|
1373
|
+
after: o
|
|
1374
|
+
});
|
|
1375
|
+
return w(), k(), x;
|
|
1376
|
+
}
|
|
1377
|
+
function c(m, h) {
|
|
1378
|
+
return Qt(m, {
|
|
1379
|
+
align: h,
|
|
1380
|
+
alignDelimiters: i,
|
|
1381
|
+
padding: t,
|
|
1382
|
+
stringLength: l
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
function f(m, h, b) {
|
|
1386
|
+
const d = m.children;
|
|
1387
|
+
let k = -1;
|
|
1388
|
+
const w = [], x = h.enter("table");
|
|
1389
|
+
for (; ++k < d.length; ) w[k] = s(d[k], h, b);
|
|
1390
|
+
return x(), w;
|
|
1391
|
+
}
|
|
1392
|
+
function s(m, h, b) {
|
|
1393
|
+
const d = m.children;
|
|
1394
|
+
let k = -1;
|
|
1395
|
+
const w = [], x = h.enter("tableRow");
|
|
1396
|
+
for (; ++k < d.length; ) w[k] = a(d[k], m, h, b);
|
|
1397
|
+
return x(), w;
|
|
1398
|
+
}
|
|
1399
|
+
function g(m, h, b) {
|
|
1400
|
+
let d = Ue.inlineCode(m, h, b);
|
|
1401
|
+
return b.stack.includes("tableCell") && (d = d.replace(/\|/g, "\\$&")), d;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
function Un() {
|
|
1405
|
+
return { exit: {
|
|
1406
|
+
taskListCheckValueChecked: ve,
|
|
1407
|
+
taskListCheckValueUnchecked: ve,
|
|
1408
|
+
paragraph: Hn
|
|
1409
|
+
} };
|
|
1410
|
+
}
|
|
1411
|
+
function Nn() {
|
|
1412
|
+
return {
|
|
1413
|
+
unsafe: [{
|
|
1414
|
+
atBreak: !0,
|
|
1415
|
+
character: "-",
|
|
1416
|
+
after: "[:|-]"
|
|
1417
|
+
}],
|
|
1418
|
+
handlers: { listItem: Gn }
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
function ve(e) {
|
|
1422
|
+
const n = this.stack[this.stack.length - 2];
|
|
1423
|
+
n.type, n.checked = e.type === "taskListCheckValueChecked";
|
|
1424
|
+
}
|
|
1425
|
+
function Hn(e) {
|
|
1426
|
+
const n = this.stack[this.stack.length - 2];
|
|
1427
|
+
if (n && n.type === "listItem" && typeof n.checked == "boolean") {
|
|
1428
|
+
const t = this.stack[this.stack.length - 1];
|
|
1429
|
+
t.type;
|
|
1430
|
+
const i = t.children[0];
|
|
1431
|
+
if (i && i.type === "text") {
|
|
1432
|
+
const l = n.children;
|
|
1433
|
+
let o = -1, r;
|
|
1434
|
+
for (; ++o < l.length; ) {
|
|
1435
|
+
const u = l[o];
|
|
1436
|
+
if (u.type === "paragraph") {
|
|
1437
|
+
r = u;
|
|
1438
|
+
break;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
r === t && (i.value = i.value.slice(1), i.value.length === 0 ? t.children.shift() : t.position && i.position && typeof i.position.start.offset == "number" && (i.position.start.column++, i.position.start.offset++, t.position.start = Object.assign({}, i.position.start)));
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
this.exit(e);
|
|
1445
|
+
}
|
|
1446
|
+
function Gn(e, n, t, i) {
|
|
1447
|
+
const l = e.children[0], o = typeof e.checked == "boolean" && l && l.type === "paragraph", r = "[" + (e.checked ? "x" : " ") + "] ", u = t.createTracker(i);
|
|
1448
|
+
o && u.move(r);
|
|
1449
|
+
let a = Ue.listItem(e, n, t, {
|
|
1450
|
+
...i,
|
|
1451
|
+
...u.current()
|
|
1452
|
+
});
|
|
1453
|
+
return o && (a = a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, c)), a;
|
|
1454
|
+
function c(f) {
|
|
1455
|
+
return f + r;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
function Qn() {
|
|
1459
|
+
return [
|
|
1460
|
+
kt(),
|
|
1461
|
+
jt(),
|
|
1462
|
+
$t(),
|
|
1463
|
+
Pn(),
|
|
1464
|
+
Un()
|
|
1465
|
+
];
|
|
1466
|
+
}
|
|
1467
|
+
function Kn(e) {
|
|
1468
|
+
return { extensions: [
|
|
1469
|
+
dt(),
|
|
1470
|
+
Bt(e),
|
|
1471
|
+
Wt(),
|
|
1472
|
+
Wn(e),
|
|
1473
|
+
Nn()
|
|
1474
|
+
] };
|
|
1475
|
+
}
|
|
1476
|
+
var Xn = {
|
|
1477
|
+
tokenize: tr,
|
|
1478
|
+
partial: !0
|
|
1479
|
+
}, Ne = {
|
|
1480
|
+
tokenize: nr,
|
|
1481
|
+
partial: !0
|
|
1482
|
+
}, He = {
|
|
1483
|
+
tokenize: rr,
|
|
1484
|
+
partial: !0
|
|
1485
|
+
}, Ge = {
|
|
1486
|
+
tokenize: ir,
|
|
1487
|
+
partial: !0
|
|
1488
|
+
}, Zn = {
|
|
1489
|
+
tokenize: or,
|
|
1490
|
+
partial: !0
|
|
1491
|
+
}, Qe = {
|
|
1492
|
+
name: "wwwAutolink",
|
|
1493
|
+
tokenize: Yn,
|
|
1494
|
+
previous: Xe
|
|
1495
|
+
}, Ke = {
|
|
1496
|
+
name: "protocolAutolink",
|
|
1497
|
+
tokenize: er,
|
|
1498
|
+
previous: Ze
|
|
1499
|
+
}, S = {
|
|
1500
|
+
name: "emailAutolink",
|
|
1501
|
+
tokenize: Vn,
|
|
1502
|
+
previous: Je
|
|
1503
|
+
}, A = {};
|
|
1504
|
+
function Jn() {
|
|
1505
|
+
return { text: A };
|
|
1506
|
+
}
|
|
1507
|
+
var T = 48;
|
|
1508
|
+
for (; T < 123; )
|
|
1509
|
+
A[T] = S, T++, T === 58 ? T = 65 : T === 91 && (T = 97);
|
|
1510
|
+
A[43] = S;
|
|
1511
|
+
A[45] = S;
|
|
1512
|
+
A[46] = S;
|
|
1513
|
+
A[95] = S;
|
|
1514
|
+
A[72] = [S, Ke];
|
|
1515
|
+
A[104] = [S, Ke];
|
|
1516
|
+
A[87] = [S, Qe];
|
|
1517
|
+
A[119] = [S, Qe];
|
|
1518
|
+
function Vn(e, n, t) {
|
|
1519
|
+
const i = this;
|
|
1520
|
+
let l, o;
|
|
1521
|
+
return r;
|
|
1522
|
+
function r(s) {
|
|
1523
|
+
return !ne(s) || !Je.call(i, i.previous) || se(i.events) ? t(s) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(s));
|
|
1524
|
+
}
|
|
1525
|
+
function u(s) {
|
|
1526
|
+
return ne(s) ? (e.consume(s), u) : s === 64 ? (e.consume(s), a) : t(s);
|
|
1527
|
+
}
|
|
1528
|
+
function a(s) {
|
|
1529
|
+
return s === 46 ? e.check(Zn, f, c)(s) : s === 45 || s === 95 || N(s) ? (o = !0, e.consume(s), a) : f(s);
|
|
1530
|
+
}
|
|
1531
|
+
function c(s) {
|
|
1532
|
+
return e.consume(s), l = !0, a;
|
|
1533
|
+
}
|
|
1534
|
+
function f(s) {
|
|
1535
|
+
return o && l && L(i.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), n(s)) : t(s);
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
function Yn(e, n, t) {
|
|
1539
|
+
const i = this;
|
|
1540
|
+
return l;
|
|
1541
|
+
function l(r) {
|
|
1542
|
+
return r !== 87 && r !== 119 || !Xe.call(i, i.previous) || se(i.events) ? t(r) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(Xn, e.attempt(Ne, e.attempt(He, o), t), t)(r));
|
|
1543
|
+
}
|
|
1544
|
+
function o(r) {
|
|
1545
|
+
return e.exit("literalAutolinkWww"), e.exit("literalAutolink"), n(r);
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
function er(e, n, t) {
|
|
1549
|
+
const i = this;
|
|
1550
|
+
let l = "", o = !1;
|
|
1551
|
+
return r;
|
|
1552
|
+
function r(s) {
|
|
1553
|
+
return (s === 72 || s === 104) && Ze.call(i, i.previous) && !se(i.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), l += String.fromCodePoint(s), e.consume(s), u) : t(s);
|
|
1554
|
+
}
|
|
1555
|
+
function u(s) {
|
|
1556
|
+
if (L(s) && l.length < 5)
|
|
1557
|
+
return l += String.fromCodePoint(s), e.consume(s), u;
|
|
1558
|
+
if (s === 58) {
|
|
1559
|
+
const g = l.toLowerCase();
|
|
1560
|
+
if (g === "http" || g === "https")
|
|
1561
|
+
return e.consume(s), a;
|
|
1562
|
+
}
|
|
1563
|
+
return t(s);
|
|
1564
|
+
}
|
|
1565
|
+
function a(s) {
|
|
1566
|
+
return s === 47 ? (e.consume(s), o ? c : (o = !0, a)) : t(s);
|
|
1567
|
+
}
|
|
1568
|
+
function c(s) {
|
|
1569
|
+
return s === null || et(s) || C(s) || _(s) || re(s) ? t(s) : e.attempt(Ne, e.attempt(He, f), t)(s);
|
|
1570
|
+
}
|
|
1571
|
+
function f(s) {
|
|
1572
|
+
return e.exit("literalAutolinkHttp"), e.exit("literalAutolink"), n(s);
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
function tr(e, n, t) {
|
|
1576
|
+
let i = 0;
|
|
1577
|
+
return l;
|
|
1578
|
+
function l(r) {
|
|
1579
|
+
return (r === 87 || r === 119) && i < 3 ? (i++, e.consume(r), l) : r === 46 && i === 3 ? (e.consume(r), o) : t(r);
|
|
1580
|
+
}
|
|
1581
|
+
function o(r) {
|
|
1582
|
+
return r === null ? t(r) : n(r);
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
function nr(e, n, t) {
|
|
1586
|
+
let i, l, o;
|
|
1587
|
+
return r;
|
|
1588
|
+
function r(c) {
|
|
1589
|
+
return c === 46 || c === 95 ? e.check(Ge, a, u)(c) : c === null || C(c) || _(c) || c !== 45 && re(c) ? a(c) : (o = !0, e.consume(c), r);
|
|
1590
|
+
}
|
|
1591
|
+
function u(c) {
|
|
1592
|
+
return c === 95 ? i = !0 : (l = i, i = void 0), e.consume(c), r;
|
|
1593
|
+
}
|
|
1594
|
+
function a(c) {
|
|
1595
|
+
return l || i || !o ? t(c) : n(c);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
function rr(e, n) {
|
|
1599
|
+
let t = 0, i = 0;
|
|
1600
|
+
return l;
|
|
1601
|
+
function l(r) {
|
|
1602
|
+
return r === 40 ? (t++, e.consume(r), l) : r === 41 && i < t ? o(r) : r === 33 || r === 34 || r === 38 || r === 39 || r === 41 || r === 42 || r === 44 || r === 46 || r === 58 || r === 59 || r === 60 || r === 63 || r === 93 || r === 95 || r === 126 ? e.check(Ge, n, o)(r) : r === null || C(r) || _(r) ? n(r) : (e.consume(r), l);
|
|
1603
|
+
}
|
|
1604
|
+
function o(r) {
|
|
1605
|
+
return r === 41 && i++, e.consume(r), l;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
function ir(e, n, t) {
|
|
1609
|
+
return i;
|
|
1610
|
+
function i(u) {
|
|
1611
|
+
return u === 33 || u === 34 || u === 39 || u === 41 || u === 42 || u === 44 || u === 46 || u === 58 || u === 59 || u === 63 || u === 95 || u === 126 ? (e.consume(u), i) : u === 38 ? (e.consume(u), o) : u === 93 ? (e.consume(u), l) : u === 60 || u === null || C(u) || _(u) ? n(u) : t(u);
|
|
1612
|
+
}
|
|
1613
|
+
function l(u) {
|
|
1614
|
+
return u === null || u === 40 || u === 91 || C(u) || _(u) ? n(u) : i(u);
|
|
1615
|
+
}
|
|
1616
|
+
function o(u) {
|
|
1617
|
+
return L(u) ? r(u) : t(u);
|
|
1618
|
+
}
|
|
1619
|
+
function r(u) {
|
|
1620
|
+
return u === 59 ? (e.consume(u), i) : L(u) ? (e.consume(u), r) : t(u);
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
function or(e, n, t) {
|
|
1624
|
+
return i;
|
|
1625
|
+
function i(o) {
|
|
1626
|
+
return e.consume(o), l;
|
|
1627
|
+
}
|
|
1628
|
+
function l(o) {
|
|
1629
|
+
return N(o) ? t(o) : n(o);
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
function Xe(e) {
|
|
1633
|
+
return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || C(e);
|
|
1634
|
+
}
|
|
1635
|
+
function Ze(e) {
|
|
1636
|
+
return !L(e);
|
|
1637
|
+
}
|
|
1638
|
+
function Je(e) {
|
|
1639
|
+
return !(e === 47 || ne(e));
|
|
1640
|
+
}
|
|
1641
|
+
function ne(e) {
|
|
1642
|
+
return e === 43 || e === 45 || e === 46 || e === 95 || N(e);
|
|
1643
|
+
}
|
|
1644
|
+
function se(e) {
|
|
1645
|
+
let n = e.length, t = !1;
|
|
1646
|
+
for (; n--; ) {
|
|
1647
|
+
const i = e[n][1];
|
|
1648
|
+
if ((i.type === "labelLink" || i.type === "labelImage") && !i._balanced) {
|
|
1649
|
+
t = !0;
|
|
1650
|
+
break;
|
|
1651
|
+
}
|
|
1652
|
+
if (i._gfmAutolinkLiteralWalkedInto) {
|
|
1653
|
+
t = !1;
|
|
1654
|
+
break;
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
return e.length > 0 && !t && (e[e.length - 1][1]._gfmAutolinkLiteralWalkedInto = !0), t;
|
|
1658
|
+
}
|
|
1659
|
+
var lr = {
|
|
1660
|
+
tokenize: mr,
|
|
1661
|
+
partial: !0
|
|
1662
|
+
};
|
|
1663
|
+
function ar() {
|
|
1664
|
+
return {
|
|
1665
|
+
document: { 91: {
|
|
1666
|
+
name: "gfmFootnoteDefinition",
|
|
1667
|
+
tokenize: fr,
|
|
1668
|
+
continuation: { tokenize: hr },
|
|
1669
|
+
exit: pr
|
|
1670
|
+
} },
|
|
1671
|
+
text: {
|
|
1672
|
+
91: {
|
|
1673
|
+
name: "gfmFootnoteCall",
|
|
1674
|
+
tokenize: cr
|
|
1675
|
+
},
|
|
1676
|
+
93: {
|
|
1677
|
+
name: "gfmPotentialFootnoteCall",
|
|
1678
|
+
add: "after",
|
|
1679
|
+
tokenize: ur,
|
|
1680
|
+
resolveTo: sr
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
function ur(e, n, t) {
|
|
1686
|
+
const i = this;
|
|
1687
|
+
let l = i.events.length;
|
|
1688
|
+
const o = i.parser.gfmFootnotes || (i.parser.gfmFootnotes = []);
|
|
1689
|
+
let r;
|
|
1690
|
+
for (; l--; ) {
|
|
1691
|
+
const a = i.events[l][1];
|
|
1692
|
+
if (a.type === "labelImage") {
|
|
1693
|
+
r = a;
|
|
1694
|
+
break;
|
|
1695
|
+
}
|
|
1696
|
+
if (a.type === "gfmFootnoteCall" || a.type === "labelLink" || a.type === "label" || a.type === "image" || a.type === "link") break;
|
|
1697
|
+
}
|
|
1698
|
+
return u;
|
|
1699
|
+
function u(a) {
|
|
1700
|
+
if (!r || !r._balanced) return t(a);
|
|
1701
|
+
const c = q(i.sliceSerialize({
|
|
1702
|
+
start: r.end,
|
|
1703
|
+
end: i.now()
|
|
1704
|
+
}));
|
|
1705
|
+
return c.codePointAt(0) !== 94 || !o.includes(c.slice(1)) ? t(a) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(a), e.exit("gfmFootnoteCallLabelMarker"), n(a));
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
function sr(e, n) {
|
|
1709
|
+
let t = e.length;
|
|
1710
|
+
for (; t--; ) if (e[t][1].type === "labelImage" && e[t][0] === "enter") {
|
|
1711
|
+
e[t][1];
|
|
1712
|
+
break;
|
|
1713
|
+
}
|
|
1714
|
+
e[t + 1][1].type = "data", e[t + 3][1].type = "gfmFootnoteCallLabelMarker";
|
|
1715
|
+
const i = {
|
|
1716
|
+
type: "gfmFootnoteCall",
|
|
1717
|
+
start: Object.assign({}, e[t + 3][1].start),
|
|
1718
|
+
end: Object.assign({}, e[e.length - 1][1].end)
|
|
1719
|
+
}, l = {
|
|
1720
|
+
type: "gfmFootnoteCallMarker",
|
|
1721
|
+
start: Object.assign({}, e[t + 3][1].end),
|
|
1722
|
+
end: Object.assign({}, e[t + 3][1].end)
|
|
1723
|
+
};
|
|
1724
|
+
l.end.column++, l.end.offset++, l.end._bufferIndex++;
|
|
1725
|
+
const o = {
|
|
1726
|
+
type: "gfmFootnoteCallString",
|
|
1727
|
+
start: Object.assign({}, l.end),
|
|
1728
|
+
end: Object.assign({}, e[e.length - 1][1].start)
|
|
1729
|
+
}, r = {
|
|
1730
|
+
type: "chunkString",
|
|
1731
|
+
contentType: "string",
|
|
1732
|
+
start: Object.assign({}, o.start),
|
|
1733
|
+
end: Object.assign({}, o.end)
|
|
1734
|
+
}, u = [
|
|
1735
|
+
e[t + 1],
|
|
1736
|
+
e[t + 2],
|
|
1737
|
+
[
|
|
1738
|
+
"enter",
|
|
1739
|
+
i,
|
|
1740
|
+
n
|
|
1741
|
+
],
|
|
1742
|
+
e[t + 3],
|
|
1743
|
+
e[t + 4],
|
|
1744
|
+
[
|
|
1745
|
+
"enter",
|
|
1746
|
+
l,
|
|
1747
|
+
n
|
|
1748
|
+
],
|
|
1749
|
+
[
|
|
1750
|
+
"exit",
|
|
1751
|
+
l,
|
|
1752
|
+
n
|
|
1753
|
+
],
|
|
1754
|
+
[
|
|
1755
|
+
"enter",
|
|
1756
|
+
o,
|
|
1757
|
+
n
|
|
1758
|
+
],
|
|
1759
|
+
[
|
|
1760
|
+
"enter",
|
|
1761
|
+
r,
|
|
1762
|
+
n
|
|
1763
|
+
],
|
|
1764
|
+
[
|
|
1765
|
+
"exit",
|
|
1766
|
+
r,
|
|
1767
|
+
n
|
|
1768
|
+
],
|
|
1769
|
+
[
|
|
1770
|
+
"exit",
|
|
1771
|
+
o,
|
|
1772
|
+
n
|
|
1773
|
+
],
|
|
1774
|
+
e[e.length - 2],
|
|
1775
|
+
e[e.length - 1],
|
|
1776
|
+
[
|
|
1777
|
+
"exit",
|
|
1778
|
+
i,
|
|
1779
|
+
n
|
|
1780
|
+
]
|
|
1781
|
+
];
|
|
1782
|
+
return e.splice(t, e.length - t + 1, ...u), e;
|
|
1783
|
+
}
|
|
1784
|
+
function cr(e, n, t) {
|
|
1785
|
+
const i = this, l = i.parser.gfmFootnotes || (i.parser.gfmFootnotes = []);
|
|
1786
|
+
let o = 0, r;
|
|
1787
|
+
return u;
|
|
1788
|
+
function u(s) {
|
|
1789
|
+
return e.enter("gfmFootnoteCall"), e.enter("gfmFootnoteCallLabelMarker"), e.consume(s), e.exit("gfmFootnoteCallLabelMarker"), a;
|
|
1790
|
+
}
|
|
1791
|
+
function a(s) {
|
|
1792
|
+
return s !== 94 ? t(s) : (e.enter("gfmFootnoteCallMarker"), e.consume(s), e.exit("gfmFootnoteCallMarker"), e.enter("gfmFootnoteCallString"), e.enter("chunkString").contentType = "string", c);
|
|
1793
|
+
}
|
|
1794
|
+
function c(s) {
|
|
1795
|
+
if (o > 999 || s === 93 && !r || s === null || s === 91 || C(s)) return t(s);
|
|
1796
|
+
if (s === 93) {
|
|
1797
|
+
e.exit("chunkString");
|
|
1798
|
+
const g = e.exit("gfmFootnoteCallString");
|
|
1799
|
+
return l.includes(q(i.sliceSerialize(g))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(s), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), n) : t(s);
|
|
1800
|
+
}
|
|
1801
|
+
return C(s) || (r = !0), o++, e.consume(s), s === 92 ? f : c;
|
|
1802
|
+
}
|
|
1803
|
+
function f(s) {
|
|
1804
|
+
return s === 91 || s === 92 || s === 93 ? (e.consume(s), o++, c) : c(s);
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
function fr(e, n, t) {
|
|
1808
|
+
const i = this, l = i.parser.gfmFootnotes || (i.parser.gfmFootnotes = []);
|
|
1809
|
+
let o, r = 0, u;
|
|
1810
|
+
return a;
|
|
1811
|
+
function a(h) {
|
|
1812
|
+
return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), c;
|
|
1813
|
+
}
|
|
1814
|
+
function c(h) {
|
|
1815
|
+
return h === 94 ? (e.enter("gfmFootnoteDefinitionMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionMarker"), e.enter("gfmFootnoteDefinitionLabelString"), e.enter("chunkString").contentType = "string", f) : t(h);
|
|
1816
|
+
}
|
|
1817
|
+
function f(h) {
|
|
1818
|
+
if (r > 999 || h === 93 && !u || h === null || h === 91 || C(h)) return t(h);
|
|
1819
|
+
if (h === 93) {
|
|
1820
|
+
e.exit("chunkString");
|
|
1821
|
+
const b = e.exit("gfmFootnoteDefinitionLabelString");
|
|
1822
|
+
return o = q(i.sliceSerialize(b)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), g;
|
|
1823
|
+
}
|
|
1824
|
+
return C(h) || (u = !0), r++, e.consume(h), h === 92 ? s : f;
|
|
1825
|
+
}
|
|
1826
|
+
function s(h) {
|
|
1827
|
+
return h === 91 || h === 92 || h === 93 ? (e.consume(h), r++, f) : f(h);
|
|
1828
|
+
}
|
|
1829
|
+
function g(h) {
|
|
1830
|
+
return h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), l.includes(o) || l.push(o), F(e, m, "gfmFootnoteDefinitionWhitespace")) : t(h);
|
|
1831
|
+
}
|
|
1832
|
+
function m(h) {
|
|
1833
|
+
return n(h);
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
function hr(e, n, t) {
|
|
1837
|
+
return e.check(it, n, e.attempt(lr, n, t));
|
|
1838
|
+
}
|
|
1839
|
+
function pr(e) {
|
|
1840
|
+
e.exit("gfmFootnoteDefinition");
|
|
1841
|
+
}
|
|
1842
|
+
function mr(e, n, t) {
|
|
1843
|
+
const i = this;
|
|
1844
|
+
return F(e, l, "gfmFootnoteDefinitionIndent", 5);
|
|
1845
|
+
function l(o) {
|
|
1846
|
+
const r = i.events[i.events.length - 1];
|
|
1847
|
+
return r && r[1].type === "gfmFootnoteDefinitionIndent" && r[2].sliceSerialize(r[1], !0).length === 4 ? n(o) : t(o);
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
function gr(e) {
|
|
1851
|
+
let n = (e || {}).singleTilde;
|
|
1852
|
+
const t = {
|
|
1853
|
+
name: "strikethrough",
|
|
1854
|
+
tokenize: l,
|
|
1855
|
+
resolveAll: i
|
|
1856
|
+
};
|
|
1857
|
+
return n == null && (n = !0), {
|
|
1858
|
+
text: { 126: t },
|
|
1859
|
+
insideSpan: { null: [t] },
|
|
1860
|
+
attentionMarkers: { null: [126] }
|
|
1861
|
+
};
|
|
1862
|
+
function i(o, r) {
|
|
1863
|
+
let u = -1;
|
|
1864
|
+
for (; ++u < o.length; ) if (o[u][0] === "enter" && o[u][1].type === "strikethroughSequenceTemporary" && o[u][1]._close) {
|
|
1865
|
+
let a = u;
|
|
1866
|
+
for (; a--; ) if (o[a][0] === "exit" && o[a][1].type === "strikethroughSequenceTemporary" && o[a][1]._open && o[u][1].end.offset - o[u][1].start.offset === o[a][1].end.offset - o[a][1].start.offset) {
|
|
1867
|
+
o[u][1].type = "strikethroughSequence", o[a][1].type = "strikethroughSequence";
|
|
1868
|
+
const c = {
|
|
1869
|
+
type: "strikethrough",
|
|
1870
|
+
start: Object.assign({}, o[a][1].start),
|
|
1871
|
+
end: Object.assign({}, o[u][1].end)
|
|
1872
|
+
}, f = {
|
|
1873
|
+
type: "strikethroughText",
|
|
1874
|
+
start: Object.assign({}, o[a][1].end),
|
|
1875
|
+
end: Object.assign({}, o[u][1].start)
|
|
1876
|
+
}, s = [
|
|
1877
|
+
[
|
|
1878
|
+
"enter",
|
|
1879
|
+
c,
|
|
1880
|
+
r
|
|
1881
|
+
],
|
|
1882
|
+
[
|
|
1883
|
+
"enter",
|
|
1884
|
+
o[a][1],
|
|
1885
|
+
r
|
|
1886
|
+
],
|
|
1887
|
+
[
|
|
1888
|
+
"exit",
|
|
1889
|
+
o[a][1],
|
|
1890
|
+
r
|
|
1891
|
+
],
|
|
1892
|
+
[
|
|
1893
|
+
"enter",
|
|
1894
|
+
f,
|
|
1895
|
+
r
|
|
1896
|
+
]
|
|
1897
|
+
], g = r.parser.constructs.insideSpan.null;
|
|
1898
|
+
g && X(s, s.length, 0, rt(g, o.slice(a + 1, u), r)), X(s, s.length, 0, [
|
|
1899
|
+
[
|
|
1900
|
+
"exit",
|
|
1901
|
+
f,
|
|
1902
|
+
r
|
|
1903
|
+
],
|
|
1904
|
+
[
|
|
1905
|
+
"enter",
|
|
1906
|
+
o[u][1],
|
|
1907
|
+
r
|
|
1908
|
+
],
|
|
1909
|
+
[
|
|
1910
|
+
"exit",
|
|
1911
|
+
o[u][1],
|
|
1912
|
+
r
|
|
1913
|
+
],
|
|
1914
|
+
[
|
|
1915
|
+
"exit",
|
|
1916
|
+
c,
|
|
1917
|
+
r
|
|
1918
|
+
]
|
|
1919
|
+
]), X(o, a - 1, u - a + 3, s), u = a + s.length - 2;
|
|
1920
|
+
break;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
for (u = -1; ++u < o.length; ) o[u][1].type === "strikethroughSequenceTemporary" && (o[u][1].type = "data");
|
|
1924
|
+
return o;
|
|
1925
|
+
}
|
|
1926
|
+
function l(o, r, u) {
|
|
1927
|
+
const a = this.previous, c = this.events;
|
|
1928
|
+
let f = 0;
|
|
1929
|
+
return s;
|
|
1930
|
+
function s(m) {
|
|
1931
|
+
return a === 126 && c[c.length - 1][1].type !== "characterEscape" ? u(m) : (o.enter("strikethroughSequenceTemporary"), g(m));
|
|
1932
|
+
}
|
|
1933
|
+
function g(m) {
|
|
1934
|
+
const h = P(a);
|
|
1935
|
+
if (m === 126)
|
|
1936
|
+
return f > 1 ? u(m) : (o.consume(m), f++, g);
|
|
1937
|
+
if (f < 2 && !n) return u(m);
|
|
1938
|
+
const b = o.exit("strikethroughSequenceTemporary"), d = P(m);
|
|
1939
|
+
return b._open = !d || d === 2 && !!h, b._close = !h || h === 2 && !!d, r(m);
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
var kr = class {
|
|
1944
|
+
constructor() {
|
|
1945
|
+
this.map = [];
|
|
1946
|
+
}
|
|
1947
|
+
add(e, n, t) {
|
|
1948
|
+
dr(this, e, n, t);
|
|
1949
|
+
}
|
|
1950
|
+
consume(e) {
|
|
1951
|
+
if (this.map.sort(function(l, o) {
|
|
1952
|
+
return l[0] - o[0];
|
|
1953
|
+
}), this.map.length === 0) return;
|
|
1954
|
+
let n = this.map.length;
|
|
1955
|
+
const t = [];
|
|
1956
|
+
for (; n > 0; )
|
|
1957
|
+
n -= 1, t.push(e.slice(this.map[n][0] + this.map[n][1]), this.map[n][2]), e.length = this.map[n][0];
|
|
1958
|
+
t.push(e.slice()), e.length = 0;
|
|
1959
|
+
let i = t.pop();
|
|
1960
|
+
for (; i; ) {
|
|
1961
|
+
for (const l of i) e.push(l);
|
|
1962
|
+
i = t.pop();
|
|
1963
|
+
}
|
|
1964
|
+
this.map.length = 0;
|
|
1965
|
+
}
|
|
1966
|
+
};
|
|
1967
|
+
function dr(e, n, t, i) {
|
|
1968
|
+
let l = 0;
|
|
1969
|
+
if (!(t === 0 && i.length === 0)) {
|
|
1970
|
+
for (; l < e.map.length; ) {
|
|
1971
|
+
if (e.map[l][0] === n) {
|
|
1972
|
+
e.map[l][1] += t, e.map[l][2].push(...i);
|
|
1973
|
+
return;
|
|
1974
|
+
}
|
|
1975
|
+
l += 1;
|
|
1976
|
+
}
|
|
1977
|
+
e.map.push([
|
|
1978
|
+
n,
|
|
1979
|
+
t,
|
|
1980
|
+
i
|
|
1981
|
+
]);
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
function br(e, n) {
|
|
1985
|
+
let t = !1;
|
|
1986
|
+
const i = [];
|
|
1987
|
+
for (; n < e.length; ) {
|
|
1988
|
+
const l = e[n];
|
|
1989
|
+
if (t) {
|
|
1990
|
+
if (l[0] === "enter")
|
|
1991
|
+
l[1].type === "tableContent" && i.push(e[n + 1][1].type === "tableDelimiterMarker" ? "left" : "none");
|
|
1992
|
+
else if (l[1].type === "tableContent") {
|
|
1993
|
+
if (e[n - 1][1].type === "tableDelimiterMarker") {
|
|
1994
|
+
const o = i.length - 1;
|
|
1995
|
+
i[o] = i[o] === "left" ? "center" : "right";
|
|
1996
|
+
}
|
|
1997
|
+
} else if (l[1].type === "tableDelimiterRow") break;
|
|
1998
|
+
} else l[0] === "enter" && l[1].type === "tableDelimiterRow" && (t = !0);
|
|
1999
|
+
n += 1;
|
|
2000
|
+
}
|
|
2001
|
+
return i;
|
|
2002
|
+
}
|
|
2003
|
+
function xr() {
|
|
2004
|
+
return { flow: { null: {
|
|
2005
|
+
name: "table",
|
|
2006
|
+
tokenize: wr,
|
|
2007
|
+
resolveAll: vr
|
|
2008
|
+
} } };
|
|
2009
|
+
}
|
|
2010
|
+
function wr(e, n, t) {
|
|
2011
|
+
const i = this;
|
|
2012
|
+
let l = 0, o = 0, r;
|
|
2013
|
+
return u;
|
|
2014
|
+
function u(p) {
|
|
2015
|
+
let j = i.events.length - 1;
|
|
2016
|
+
for (; j > -1; ) {
|
|
2017
|
+
const he = i.events[j][1].type;
|
|
2018
|
+
if (he === "lineEnding" || he === "linePrefix") j--;
|
|
2019
|
+
else break;
|
|
2020
|
+
}
|
|
2021
|
+
const ce = j > -1 ? i.events[j][1].type : null, fe = ce === "tableHead" || ce === "tableRow" ? z : a;
|
|
2022
|
+
return fe === z && i.parser.lazy[i.now().line] ? t(p) : fe(p);
|
|
2023
|
+
}
|
|
2024
|
+
function a(p) {
|
|
2025
|
+
return e.enter("tableHead"), e.enter("tableRow"), c(p);
|
|
2026
|
+
}
|
|
2027
|
+
function c(p) {
|
|
2028
|
+
return p === 124 || (r = !0, o += 1), f(p);
|
|
2029
|
+
}
|
|
2030
|
+
function f(p) {
|
|
2031
|
+
return p === null ? t(p) : B(p) ? o > 1 ? (o = 0, i.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(p), e.exit("lineEnding"), m) : t(p) : I(p) ? F(e, f, "whitespace")(p) : (o += 1, r && (r = !1, l += 1), p === 124 ? (e.enter("tableCellDivider"), e.consume(p), e.exit("tableCellDivider"), r = !0, f) : (e.enter("data"), s(p)));
|
|
2032
|
+
}
|
|
2033
|
+
function s(p) {
|
|
2034
|
+
return p === null || p === 124 || C(p) ? (e.exit("data"), f(p)) : (e.consume(p), p === 92 ? g : s);
|
|
2035
|
+
}
|
|
2036
|
+
function g(p) {
|
|
2037
|
+
return p === 92 || p === 124 ? (e.consume(p), s) : s(p);
|
|
2038
|
+
}
|
|
2039
|
+
function m(p) {
|
|
2040
|
+
return i.interrupt = !1, i.parser.lazy[i.now().line] ? t(p) : (e.enter("tableDelimiterRow"), r = !1, I(p) ? F(e, h, "linePrefix", i.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(p) : h(p));
|
|
2041
|
+
}
|
|
2042
|
+
function h(p) {
|
|
2043
|
+
return p === 45 || p === 58 ? d(p) : p === 124 ? (r = !0, e.enter("tableCellDivider"), e.consume(p), e.exit("tableCellDivider"), b) : y(p);
|
|
2044
|
+
}
|
|
2045
|
+
function b(p) {
|
|
2046
|
+
return I(p) ? F(e, d, "whitespace")(p) : d(p);
|
|
2047
|
+
}
|
|
2048
|
+
function d(p) {
|
|
2049
|
+
return p === 58 ? (o += 1, r = !0, e.enter("tableDelimiterMarker"), e.consume(p), e.exit("tableDelimiterMarker"), k) : p === 45 ? (o += 1, k(p)) : p === null || B(p) ? v(p) : y(p);
|
|
2050
|
+
}
|
|
2051
|
+
function k(p) {
|
|
2052
|
+
return p === 45 ? (e.enter("tableDelimiterFiller"), w(p)) : y(p);
|
|
2053
|
+
}
|
|
2054
|
+
function w(p) {
|
|
2055
|
+
return p === 45 ? (e.consume(p), w) : p === 58 ? (r = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(p), e.exit("tableDelimiterMarker"), x) : (e.exit("tableDelimiterFiller"), x(p));
|
|
2056
|
+
}
|
|
2057
|
+
function x(p) {
|
|
2058
|
+
return I(p) ? F(e, v, "whitespace")(p) : v(p);
|
|
2059
|
+
}
|
|
2060
|
+
function v(p) {
|
|
2061
|
+
return p === 124 ? h(p) : p === null || B(p) ? !r || l !== o ? y(p) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), n(p)) : y(p);
|
|
2062
|
+
}
|
|
2063
|
+
function y(p) {
|
|
2064
|
+
return t(p);
|
|
2065
|
+
}
|
|
2066
|
+
function z(p) {
|
|
2067
|
+
return e.enter("tableRow"), D(p);
|
|
2068
|
+
}
|
|
2069
|
+
function D(p) {
|
|
2070
|
+
return p === 124 ? (e.enter("tableCellDivider"), e.consume(p), e.exit("tableCellDivider"), D) : p === null || B(p) ? (e.exit("tableRow"), n(p)) : I(p) ? F(e, D, "whitespace")(p) : (e.enter("data"), O(p));
|
|
2071
|
+
}
|
|
2072
|
+
function O(p) {
|
|
2073
|
+
return p === null || p === 124 || C(p) ? (e.exit("data"), D(p)) : (e.consume(p), p === 92 ? Ve : O);
|
|
2074
|
+
}
|
|
2075
|
+
function Ve(p) {
|
|
2076
|
+
return p === 92 || p === 124 ? (e.consume(p), O) : O(p);
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
function vr(e, n) {
|
|
2080
|
+
let t = -1, i = !0, l = 0, o = [
|
|
2081
|
+
0,
|
|
2082
|
+
0,
|
|
2083
|
+
0,
|
|
2084
|
+
0
|
|
2085
|
+
], r = [
|
|
2086
|
+
0,
|
|
2087
|
+
0,
|
|
2088
|
+
0,
|
|
2089
|
+
0
|
|
2090
|
+
], u = !1, a = 0, c, f, s;
|
|
2091
|
+
const g = new kr();
|
|
2092
|
+
for (; ++t < e.length; ) {
|
|
2093
|
+
const m = e[t], h = m[1];
|
|
2094
|
+
m[0] === "enter" ? h.type === "tableHead" ? (u = !1, a !== 0 && (ye(g, n, a, c, f), f = void 0, a = 0), c = {
|
|
2095
|
+
type: "table",
|
|
2096
|
+
start: Object.assign({}, h.start),
|
|
2097
|
+
end: Object.assign({}, h.end)
|
|
2098
|
+
}, g.add(t, 0, [[
|
|
2099
|
+
"enter",
|
|
2100
|
+
c,
|
|
2101
|
+
n
|
|
2102
|
+
]])) : h.type === "tableRow" || h.type === "tableDelimiterRow" ? (i = !0, s = void 0, o = [
|
|
2103
|
+
0,
|
|
2104
|
+
0,
|
|
2105
|
+
0,
|
|
2106
|
+
0
|
|
2107
|
+
], r = [
|
|
2108
|
+
0,
|
|
2109
|
+
t + 1,
|
|
2110
|
+
0,
|
|
2111
|
+
0
|
|
2112
|
+
], u && (u = !1, f = {
|
|
2113
|
+
type: "tableBody",
|
|
2114
|
+
start: Object.assign({}, h.start),
|
|
2115
|
+
end: Object.assign({}, h.end)
|
|
2116
|
+
}, g.add(t, 0, [[
|
|
2117
|
+
"enter",
|
|
2118
|
+
f,
|
|
2119
|
+
n
|
|
2120
|
+
]])), l = h.type === "tableDelimiterRow" ? 2 : f ? 3 : 1) : l && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") ? (i = !1, r[2] === 0 && (o[1] !== 0 && (r[0] = r[1], s = W(g, n, o, l, void 0, s), o = [
|
|
2121
|
+
0,
|
|
2122
|
+
0,
|
|
2123
|
+
0,
|
|
2124
|
+
0
|
|
2125
|
+
]), r[2] = t)) : h.type === "tableCellDivider" && (i ? i = !1 : (o[1] !== 0 && (r[0] = r[1], s = W(g, n, o, l, void 0, s)), o = r, r = [
|
|
2126
|
+
o[1],
|
|
2127
|
+
t,
|
|
2128
|
+
0,
|
|
2129
|
+
0
|
|
2130
|
+
])) : h.type === "tableHead" ? (u = !0, a = t) : h.type === "tableRow" || h.type === "tableDelimiterRow" ? (a = t, o[1] !== 0 ? (r[0] = r[1], s = W(g, n, o, l, t, s)) : r[1] !== 0 && (s = W(g, n, r, l, t, s)), l = 0) : l && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") && (r[3] = t);
|
|
2131
|
+
}
|
|
2132
|
+
for (a !== 0 && ye(g, n, a, c, f), g.consume(n.events), t = -1; ++t < n.events.length; ) {
|
|
2133
|
+
const m = n.events[t];
|
|
2134
|
+
m[0] === "enter" && m[1].type === "table" && (m[1]._align = br(n.events, t));
|
|
2135
|
+
}
|
|
2136
|
+
return e;
|
|
2137
|
+
}
|
|
2138
|
+
function W(e, n, t, i, l, o) {
|
|
2139
|
+
const r = i === 1 ? "tableHeader" : i === 2 ? "tableDelimiter" : "tableData", u = "tableContent";
|
|
2140
|
+
t[0] !== 0 && (o.end = Object.assign({}, M(n.events, t[0])), e.add(t[0], 0, [[
|
|
2141
|
+
"exit",
|
|
2142
|
+
o,
|
|
2143
|
+
n
|
|
2144
|
+
]]));
|
|
2145
|
+
const a = M(n.events, t[1]);
|
|
2146
|
+
if (o = {
|
|
2147
|
+
type: r,
|
|
2148
|
+
start: Object.assign({}, a),
|
|
2149
|
+
end: Object.assign({}, a)
|
|
2150
|
+
}, e.add(t[1], 0, [[
|
|
2151
|
+
"enter",
|
|
2152
|
+
o,
|
|
2153
|
+
n
|
|
2154
|
+
]]), t[2] !== 0) {
|
|
2155
|
+
const c = M(n.events, t[2]), f = M(n.events, t[3]), s = {
|
|
2156
|
+
type: u,
|
|
2157
|
+
start: Object.assign({}, c),
|
|
2158
|
+
end: Object.assign({}, f)
|
|
2159
|
+
};
|
|
2160
|
+
if (e.add(t[2], 0, [[
|
|
2161
|
+
"enter",
|
|
2162
|
+
s,
|
|
2163
|
+
n
|
|
2164
|
+
]]), i !== 2) {
|
|
2165
|
+
const g = n.events[t[2]], m = n.events[t[3]];
|
|
2166
|
+
if (g[1].end = Object.assign({}, m[1].end), g[1].type = "chunkText", g[1].contentType = "text", t[3] > t[2] + 1) {
|
|
2167
|
+
const h = t[2] + 1, b = t[3] - t[2] - 1;
|
|
2168
|
+
e.add(h, b, []);
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
e.add(t[3] + 1, 0, [[
|
|
2172
|
+
"exit",
|
|
2173
|
+
s,
|
|
2174
|
+
n
|
|
2175
|
+
]]);
|
|
2176
|
+
}
|
|
2177
|
+
return l !== void 0 && (o.end = Object.assign({}, M(n.events, l)), e.add(l, 0, [[
|
|
2178
|
+
"exit",
|
|
2179
|
+
o,
|
|
2180
|
+
n
|
|
2181
|
+
]]), o = void 0), o;
|
|
2182
|
+
}
|
|
2183
|
+
function ye(e, n, t, i, l) {
|
|
2184
|
+
const o = [], r = M(n.events, t);
|
|
2185
|
+
l && (l.end = Object.assign({}, r), o.push([
|
|
2186
|
+
"exit",
|
|
2187
|
+
l,
|
|
2188
|
+
n
|
|
2189
|
+
])), i.end = Object.assign({}, r), o.push([
|
|
2190
|
+
"exit",
|
|
2191
|
+
i,
|
|
2192
|
+
n
|
|
2193
|
+
]), e.add(t + 1, 0, o);
|
|
2194
|
+
}
|
|
2195
|
+
function M(e, n) {
|
|
2196
|
+
const t = e[n], i = t[0] === "enter" ? "start" : "end";
|
|
2197
|
+
return t[1][i];
|
|
2198
|
+
}
|
|
2199
|
+
var yr = {
|
|
2200
|
+
name: "tasklistCheck",
|
|
2201
|
+
tokenize: Ar
|
|
2202
|
+
};
|
|
2203
|
+
function Cr() {
|
|
2204
|
+
return { text: { 91: yr } };
|
|
2205
|
+
}
|
|
2206
|
+
function Ar(e, n, t) {
|
|
2207
|
+
const i = this;
|
|
2208
|
+
return l;
|
|
2209
|
+
function l(a) {
|
|
2210
|
+
return i.previous !== null || !i._gfmTasklistFirstContentOfListItem ? t(a) : (e.enter("taskListCheck"), e.enter("taskListCheckMarker"), e.consume(a), e.exit("taskListCheckMarker"), o);
|
|
2211
|
+
}
|
|
2212
|
+
function o(a) {
|
|
2213
|
+
return C(a) ? (e.enter("taskListCheckValueUnchecked"), e.consume(a), e.exit("taskListCheckValueUnchecked"), r) : a === 88 || a === 120 ? (e.enter("taskListCheckValueChecked"), e.consume(a), e.exit("taskListCheckValueChecked"), r) : t(a);
|
|
2214
|
+
}
|
|
2215
|
+
function r(a) {
|
|
2216
|
+
return a === 93 ? (e.enter("taskListCheckMarker"), e.consume(a), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), u) : t(a);
|
|
2217
|
+
}
|
|
2218
|
+
function u(a) {
|
|
2219
|
+
return B(a) ? n(a) : I(a) ? e.check({ tokenize: Dr }, n, t)(a) : t(a);
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
function Dr(e, n, t) {
|
|
2223
|
+
return F(e, i, "whitespace");
|
|
2224
|
+
function i(l) {
|
|
2225
|
+
return l === null ? t(l) : n(l);
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
function Sr(e) {
|
|
2229
|
+
return tt([
|
|
2230
|
+
Jn(),
|
|
2231
|
+
ar(),
|
|
2232
|
+
gr(e),
|
|
2233
|
+
xr(),
|
|
2234
|
+
Cr()
|
|
2235
|
+
]);
|
|
2236
|
+
}
|
|
2237
|
+
var Fr = {};
|
|
2238
|
+
function Lr(e) {
|
|
2239
|
+
const n = this, t = e || Fr, i = n.data(), l = i.micromarkExtensions || (i.micromarkExtensions = []), o = i.fromMarkdownExtensions || (i.fromMarkdownExtensions = []), r = i.toMarkdownExtensions || (i.toMarkdownExtensions = []);
|
|
2240
|
+
l.push(Sr(t)), o.push(Qn()), r.push(Kn(t));
|
|
2241
|
+
}
|
|
2242
|
+
export {
|
|
2243
|
+
Lr as default,
|
|
2244
|
+
ee as n,
|
|
2245
|
+
H as r,
|
|
2246
|
+
mn as t
|
|
2247
|
+
};
|