@veracity/ai 2.4.3 → 2.4.5
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/veracity-ai.es.js
CHANGED
|
@@ -171,7 +171,7 @@ class ft extends Lr {
|
|
|
171
171
|
}
|
|
172
172
|
async summarizeTitleAsync(t, r, s, i) {
|
|
173
173
|
this._abortController = new AbortController(), (this._cancellationToken = new ze()).addListener(() => this._abortController.abort());
|
|
174
|
-
const
|
|
174
|
+
const o = await t(r, {
|
|
175
175
|
method: "POST",
|
|
176
176
|
headers: {
|
|
177
177
|
"Content-Type": "application/json"
|
|
@@ -179,25 +179,25 @@ class ft extends Lr {
|
|
|
179
179
|
body: JSON.stringify({ type: Qe.Messages, messages: s, chatId: i }),
|
|
180
180
|
signal: this._abortController.signal
|
|
181
181
|
});
|
|
182
|
-
if (
|
|
182
|
+
if (o.status === 400)
|
|
183
183
|
return null;
|
|
184
|
-
if (!
|
|
185
|
-
return
|
|
184
|
+
if (!o.ok) throw new Error(`Failed to start chat completion SSE: ${o.status} ${o.statusText}`);
|
|
185
|
+
return o.json();
|
|
186
186
|
}
|
|
187
|
-
async startAsync(t, r, s, i,
|
|
187
|
+
async startAsync(t, r, s, i, o) {
|
|
188
188
|
this._abortController = new AbortController(), (this._cancellationToken = new ze()).addListener(() => this._abortController.abort());
|
|
189
|
-
const
|
|
189
|
+
const a = await t(r, {
|
|
190
190
|
method: "POST",
|
|
191
191
|
headers: {
|
|
192
192
|
"Content-Type": "application/json"
|
|
193
193
|
},
|
|
194
|
-
body: JSON.stringify({ type: Qe.Messages, messages: s, chatId: i, copilotId:
|
|
194
|
+
body: JSON.stringify({ type: Qe.Messages, messages: s, chatId: i, copilotId: o }),
|
|
195
195
|
signal: this._abortController.signal
|
|
196
196
|
});
|
|
197
|
-
if (
|
|
197
|
+
if (a.status === 429)
|
|
198
198
|
throw new vn();
|
|
199
|
-
if (!
|
|
200
|
-
this._reader =
|
|
199
|
+
if (!a.ok) throw new Error(`Failed to start chat completion SSE: ${a.status} ${a.statusText}`);
|
|
200
|
+
this._reader = a.body.getReader(), this.readMessagesAsync();
|
|
201
201
|
}
|
|
202
202
|
stop() {
|
|
203
203
|
this._cancellationToken.cancel();
|
|
@@ -213,8 +213,8 @@ class ft extends Lr {
|
|
|
213
213
|
for (; this._buffer.length - this._bufferOffset < t; ) {
|
|
214
214
|
const { done: s, value: i } = await this._reader.read();
|
|
215
215
|
if (s) {
|
|
216
|
-
const
|
|
217
|
-
return this._buffer = new Uint8Array(0), this._bufferOffset = 0,
|
|
216
|
+
const o = this._buffer.subarray(this._bufferOffset);
|
|
217
|
+
return this._buffer = new Uint8Array(0), this._bufferOffset = 0, o;
|
|
218
218
|
}
|
|
219
219
|
this._buffer = Fr(this._buffer, i, this._bufferOffset), this._bufferOffset = 0;
|
|
220
220
|
}
|
|
@@ -237,13 +237,13 @@ class ft extends Lr {
|
|
|
237
237
|
const r = t[0];
|
|
238
238
|
switch (r) {
|
|
239
239
|
case j.MessageBegin: {
|
|
240
|
-
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(),
|
|
240
|
+
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync(), a = await this.readUtf8StringAsync(), u = await this.readUtf8StringAsync(), l = await this.readUtf8StringAsync(), c = await this.readUtf8StringAsync(), p = await this.readUtf8StringAsync();
|
|
241
241
|
return {
|
|
242
242
|
type: r,
|
|
243
243
|
conversationId: s,
|
|
244
244
|
messageAuthorRole: i,
|
|
245
|
-
messageAuthorId:
|
|
246
|
-
messageAuthorPictureUrl:
|
|
245
|
+
messageAuthorId: o,
|
|
246
|
+
messageAuthorPictureUrl: a,
|
|
247
247
|
messageAuthorDisplayName: u,
|
|
248
248
|
messageAuthorEmail: l,
|
|
249
249
|
messageId: c,
|
|
@@ -259,24 +259,24 @@ class ft extends Lr {
|
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
case j.MessageToolCallUpdate: {
|
|
262
|
-
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(),
|
|
262
|
+
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(), o = await this.readLittleEndianInt32Async(), a = await this.readUtf8StringAsync(), u = await this.readUtf8StringAsync();
|
|
263
263
|
return {
|
|
264
264
|
type: r,
|
|
265
265
|
conversationId: s,
|
|
266
266
|
llmFunctionId: i,
|
|
267
|
-
toolCallUpdateIndex:
|
|
268
|
-
toolCallUpdateName:
|
|
267
|
+
toolCallUpdateIndex: o,
|
|
268
|
+
toolCallUpdateName: a,
|
|
269
269
|
toolCallUpdateArguments: u
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
272
|
case j.MessageInvokeClientFunction: {
|
|
273
|
-
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(),
|
|
273
|
+
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync(), a = await this.readUtf8StringAsync(), u = await this.readUtf8StringAsync();
|
|
274
274
|
return {
|
|
275
275
|
type: r,
|
|
276
276
|
conversationId: s,
|
|
277
277
|
llmFunctionId: i,
|
|
278
|
-
operationId:
|
|
279
|
-
clientFunctionName:
|
|
278
|
+
operationId: o,
|
|
279
|
+
clientFunctionName: a,
|
|
280
280
|
argumentsAsJSON: u
|
|
281
281
|
};
|
|
282
282
|
}
|
|
@@ -297,13 +297,13 @@ class ft extends Lr {
|
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
299
|
case j.MessageSubConversationBegin: {
|
|
300
|
-
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(),
|
|
300
|
+
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync(), a = await this.readUtf8StringAsync(), u = await this.readUtf8StringAsync(), l = await this.readUtf8StringAsync(), c = await this.readUtf8StringAsync();
|
|
301
301
|
return {
|
|
302
302
|
type: r,
|
|
303
303
|
conversationId: s,
|
|
304
304
|
subConversationId: i,
|
|
305
|
-
messageAuthorId:
|
|
306
|
-
messageAuthorPictureUrl:
|
|
305
|
+
messageAuthorId: o,
|
|
306
|
+
messageAuthorPictureUrl: a,
|
|
307
307
|
messageAuthorDisplayName: u,
|
|
308
308
|
messageAuthorEmail: l,
|
|
309
309
|
subConversationTitle: c
|
|
@@ -327,12 +327,12 @@ class ft extends Lr {
|
|
|
327
327
|
return { type: r, conversationId: s };
|
|
328
328
|
}
|
|
329
329
|
case j.ConversationError: {
|
|
330
|
-
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(),
|
|
330
|
+
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync();
|
|
331
331
|
return {
|
|
332
332
|
type: r,
|
|
333
333
|
conversationId: s,
|
|
334
334
|
error: i,
|
|
335
|
-
stackTrace:
|
|
335
|
+
stackTrace: o
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
338
|
case j.MessageExecuteLlmFunctionsBegin:
|
|
@@ -363,30 +363,30 @@ class ft extends Lr {
|
|
|
363
363
|
// };
|
|
364
364
|
// }
|
|
365
365
|
case j.MessageToolCallBegin: {
|
|
366
|
-
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(),
|
|
366
|
+
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync();
|
|
367
367
|
return {
|
|
368
368
|
type: r,
|
|
369
369
|
conversationId: s,
|
|
370
370
|
llmFunctionId: i,
|
|
371
|
-
toolCallBeginInfo:
|
|
371
|
+
toolCallBeginInfo: o
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
374
|
case j.MessageToolCallResult: {
|
|
375
|
-
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(),
|
|
375
|
+
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync();
|
|
376
376
|
return {
|
|
377
377
|
type: r,
|
|
378
378
|
conversationId: s,
|
|
379
379
|
llmFunctionId: i,
|
|
380
|
-
result:
|
|
380
|
+
result: o
|
|
381
381
|
};
|
|
382
382
|
}
|
|
383
383
|
case j.MessageToolCallError: {
|
|
384
|
-
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(),
|
|
384
|
+
const s = await this.readUtf8StringAsync(), i = await this.readUtf8StringAsync(), o = await this.readUtf8StringAsync();
|
|
385
385
|
return {
|
|
386
386
|
type: r,
|
|
387
387
|
conversationId: s,
|
|
388
388
|
llmFunctionId: i,
|
|
389
|
-
error:
|
|
389
|
+
error: o
|
|
390
390
|
};
|
|
391
391
|
}
|
|
392
392
|
default:
|
|
@@ -456,8 +456,8 @@ ne.prototype = { getArgs: function() {
|
|
|
456
456
|
} };
|
|
457
457
|
ne.fromString = N(function(e) {
|
|
458
458
|
var n = e.indexOf("("), t = e.lastIndexOf(")"), r = e.substring(0, n), s = e.substring(n + 1, t).split(","), i = e.substring(t + 1);
|
|
459
|
-
if (i.indexOf("@") === 0) var
|
|
460
|
-
return new ne({ functionName: r, args: s || void 0, fileName:
|
|
459
|
+
if (i.indexOf("@") === 0) var o = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i, ""), a = o[1], u = o[2], l = o[3];
|
|
460
|
+
return new ne({ functionName: r, args: s || void 0, fileName: a, lineNumber: u || void 0, columnNumber: l || void 0 });
|
|
461
461
|
}, "StackFrame$$fromString");
|
|
462
462
|
for (Be = 0; Be < De.length; Be++) ne.prototype["get" + _e(De[Be])] = ct(De[Be]), ne.prototype["set" + _e(De[Be])] = /* @__PURE__ */ function(e) {
|
|
463
463
|
return function(n) {
|
|
@@ -495,10 +495,10 @@ function _n() {
|
|
|
495
495
|
}, this);
|
|
496
496
|
return r.map(function(s) {
|
|
497
497
|
s.indexOf("(eval ") > -1 && (s = s.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
|
|
498
|
-
var i = s.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""),
|
|
499
|
-
i =
|
|
500
|
-
var
|
|
501
|
-
return new mt({ functionName: u, fileName: l, lineNumber:
|
|
498
|
+
var i = s.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), o = i.match(/ (\(.+\)$)/);
|
|
499
|
+
i = o ? i.replace(o[0], "") : i;
|
|
500
|
+
var a = this.extractLocation(o ? o[1] : i), u = o && i || void 0, l = ["eval", "<anonymous>"].indexOf(a[0]) > -1 ? void 0 : a[0];
|
|
501
|
+
return new mt({ functionName: u, fileName: l, lineNumber: a[1], columnNumber: a[2], source: s });
|
|
502
502
|
}, this);
|
|
503
503
|
}, "ErrorStackParser$$parseV8OrIE"), parseFFOrSafari: N(function(t) {
|
|
504
504
|
var r = t.stack.split(`
|
|
@@ -507,8 +507,8 @@ function _n() {
|
|
|
507
507
|
}, this);
|
|
508
508
|
return r.map(function(s) {
|
|
509
509
|
if (s.indexOf(" > eval") > -1 && (s = s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), s.indexOf("@") === -1 && s.indexOf(":") === -1) return new mt({ functionName: s });
|
|
510
|
-
var i = /((.*".+"[^@]*)?[^@]*)(?:@)/,
|
|
511
|
-
return new mt({ functionName:
|
|
510
|
+
var i = /((.*".+"[^@]*)?[^@]*)(?:@)/, o = s.match(i), a = o && o[1] ? o[1] : void 0, u = this.extractLocation(s.replace(i, ""));
|
|
511
|
+
return new mt({ functionName: a, fileName: u[0], lineNumber: u[1], columnNumber: u[2], source: s });
|
|
512
512
|
}, this);
|
|
513
513
|
}, "ErrorStackParser$$parseFFOrSafari") };
|
|
514
514
|
}
|
|
@@ -545,10 +545,10 @@ function Mn(e, n) {
|
|
|
545
545
|
return { response: fetch(t, n ? { integrity: n } : {}) };
|
|
546
546
|
}
|
|
547
547
|
N(Mn, "browser_getBinaryResponse");
|
|
548
|
-
var
|
|
549
|
-
ge ?
|
|
548
|
+
var ot;
|
|
549
|
+
ge ? ot = Fn : ot = Mn;
|
|
550
550
|
async function Rn(e, n) {
|
|
551
|
-
let { response: t, binary: r } =
|
|
551
|
+
let { response: t, binary: r } = ot(e, n);
|
|
552
552
|
if (r) return r;
|
|
553
553
|
let s = await t;
|
|
554
554
|
if (!s.ok) throw new Error(`Failed to load '${e}': request failed.`);
|
|
@@ -601,77 +601,77 @@ function Pn(e) {
|
|
|
601
601
|
let n = e.FS, t = e.FS.filesystems.MEMFS, r = e.PATH, s = { DIR_MODE: 16895, FILE_MODE: 33279, mount: function(i) {
|
|
602
602
|
if (!i.opts.fileSystemHandle) throw new Error("opts.fileSystemHandle is required");
|
|
603
603
|
return t.mount.apply(null, arguments);
|
|
604
|
-
}, syncfs: async (i,
|
|
604
|
+
}, syncfs: async (i, o, a) => {
|
|
605
605
|
try {
|
|
606
|
-
let u = s.getLocalSet(i), l = await s.getRemoteSet(i), c =
|
|
607
|
-
await s.reconcile(i, c, p),
|
|
606
|
+
let u = s.getLocalSet(i), l = await s.getRemoteSet(i), c = o ? l : u, p = o ? u : l;
|
|
607
|
+
await s.reconcile(i, c, p), a(null);
|
|
608
608
|
} catch (u) {
|
|
609
|
-
|
|
609
|
+
a(u);
|
|
610
610
|
}
|
|
611
611
|
}, getLocalSet: (i) => {
|
|
612
|
-
let
|
|
613
|
-
function
|
|
612
|
+
let o = /* @__PURE__ */ Object.create(null);
|
|
613
|
+
function a(c) {
|
|
614
614
|
return c !== "." && c !== "..";
|
|
615
615
|
}
|
|
616
|
-
N(
|
|
616
|
+
N(a, "isRealDir");
|
|
617
617
|
function u(c) {
|
|
618
618
|
return (p) => r.join2(c, p);
|
|
619
619
|
}
|
|
620
620
|
N(u, "toAbsolute");
|
|
621
|
-
let l = n.readdir(i.mountpoint).filter(
|
|
621
|
+
let l = n.readdir(i.mountpoint).filter(a).map(u(i.mountpoint));
|
|
622
622
|
for (; l.length; ) {
|
|
623
623
|
let c = l.pop(), p = n.stat(c);
|
|
624
|
-
n.isDir(p.mode) && l.push.apply(l, n.readdir(c).filter(
|
|
624
|
+
n.isDir(p.mode) && l.push.apply(l, n.readdir(c).filter(a).map(u(c))), o[c] = { timestamp: p.mtime, mode: p.mode };
|
|
625
625
|
}
|
|
626
|
-
return { type: "local", entries:
|
|
626
|
+
return { type: "local", entries: o };
|
|
627
627
|
}, getRemoteSet: async (i) => {
|
|
628
|
-
let
|
|
629
|
-
for (let [u, l] of
|
|
630
|
-
return { type: "remote", entries:
|
|
628
|
+
let o = /* @__PURE__ */ Object.create(null), a = await Wr(i.opts.fileSystemHandle);
|
|
629
|
+
for (let [u, l] of a) u !== "." && (o[r.join2(i.mountpoint, u)] = { timestamp: l.kind === "file" ? (await l.getFile()).lastModifiedDate : /* @__PURE__ */ new Date(), mode: l.kind === "file" ? s.FILE_MODE : s.DIR_MODE });
|
|
630
|
+
return { type: "remote", entries: o, handles: a };
|
|
631
631
|
}, loadLocalEntry: (i) => {
|
|
632
|
-
let
|
|
633
|
-
if (n.isDir(
|
|
634
|
-
if (n.isFile(
|
|
632
|
+
let o = n.lookupPath(i).node, a = n.stat(i);
|
|
633
|
+
if (n.isDir(a.mode)) return { timestamp: a.mtime, mode: a.mode };
|
|
634
|
+
if (n.isFile(a.mode)) return o.contents = t.getFileDataAsTypedArray(o), { timestamp: a.mtime, mode: a.mode, contents: o.contents };
|
|
635
635
|
throw new Error("node type not supported");
|
|
636
|
-
}, storeLocalEntry: (i,
|
|
637
|
-
if (n.isDir(
|
|
638
|
-
else if (n.isFile(
|
|
636
|
+
}, storeLocalEntry: (i, o) => {
|
|
637
|
+
if (n.isDir(o.mode)) n.mkdirTree(i, o.mode);
|
|
638
|
+
else if (n.isFile(o.mode)) n.writeFile(i, o.contents, { canOwn: !0 });
|
|
639
639
|
else throw new Error("node type not supported");
|
|
640
|
-
n.chmod(i,
|
|
640
|
+
n.chmod(i, o.mode), n.utime(i, o.timestamp, o.timestamp);
|
|
641
641
|
}, removeLocalEntry: (i) => {
|
|
642
|
-
var
|
|
643
|
-
n.isDir(
|
|
642
|
+
var o = n.stat(i);
|
|
643
|
+
n.isDir(o.mode) ? n.rmdir(i) : n.isFile(o.mode) && n.unlink(i);
|
|
644
644
|
}, loadRemoteEntry: async (i) => {
|
|
645
645
|
if (i.kind === "file") {
|
|
646
|
-
let
|
|
647
|
-
return { contents: new Uint8Array(await
|
|
646
|
+
let o = await i.getFile();
|
|
647
|
+
return { contents: new Uint8Array(await o.arrayBuffer()), mode: s.FILE_MODE, timestamp: o.lastModifiedDate };
|
|
648
648
|
} else {
|
|
649
649
|
if (i.kind === "directory") return { mode: s.DIR_MODE, timestamp: /* @__PURE__ */ new Date() };
|
|
650
650
|
throw new Error("unknown kind: " + i.kind);
|
|
651
651
|
}
|
|
652
|
-
}, storeRemoteEntry: async (i,
|
|
653
|
-
let u = i.get(r.dirname(
|
|
652
|
+
}, storeRemoteEntry: async (i, o, a) => {
|
|
653
|
+
let u = i.get(r.dirname(o)), l = n.isFile(a.mode) ? await u.getFileHandle(r.basename(o), { create: !0 }) : await u.getDirectoryHandle(r.basename(o), { create: !0 });
|
|
654
654
|
if (l.kind === "file") {
|
|
655
655
|
let c = await l.createWritable();
|
|
656
|
-
await c.write(
|
|
656
|
+
await c.write(a.contents), await c.close();
|
|
657
657
|
}
|
|
658
|
-
i.set(
|
|
659
|
-
}, removeRemoteEntry: async (i,
|
|
660
|
-
await i.get(r.dirname(
|
|
661
|
-
}, reconcile: async (i,
|
|
658
|
+
i.set(o, l);
|
|
659
|
+
}, removeRemoteEntry: async (i, o) => {
|
|
660
|
+
await i.get(r.dirname(o)).removeEntry(r.basename(o)), i.delete(o);
|
|
661
|
+
}, reconcile: async (i, o, a) => {
|
|
662
662
|
let u = 0, l = [];
|
|
663
|
-
Object.keys(
|
|
664
|
-
let h =
|
|
663
|
+
Object.keys(o.entries).forEach(function(m) {
|
|
664
|
+
let h = o.entries[m], C = a.entries[m];
|
|
665
665
|
(!C || n.isFile(h.mode) && h.timestamp.getTime() > C.timestamp.getTime()) && (l.push(m), u++);
|
|
666
666
|
}), l.sort();
|
|
667
667
|
let c = [];
|
|
668
|
-
if (Object.keys(
|
|
669
|
-
|
|
668
|
+
if (Object.keys(a.entries).forEach(function(m) {
|
|
669
|
+
o.entries[m] || (c.push(m), u++);
|
|
670
670
|
}), c.sort().reverse(), !u) return;
|
|
671
|
-
let p =
|
|
671
|
+
let p = o.type === "remote" ? o.handles : a.handles;
|
|
672
672
|
for (let m of l) {
|
|
673
673
|
let h = r.normalize(m.replace(i.mountpoint, "/")).substring(1);
|
|
674
|
-
if (
|
|
674
|
+
if (a.type === "local") {
|
|
675
675
|
let C = p.get(h), S = await s.loadRemoteEntry(C);
|
|
676
676
|
s.storeLocalEntry(m, S);
|
|
677
677
|
} else {
|
|
@@ -679,7 +679,7 @@ function Pn(e) {
|
|
|
679
679
|
await s.storeRemoteEntry(p, h, C);
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
for (let m of c) if (
|
|
682
|
+
for (let m of c) if (a.type === "local") s.removeLocalEntry(m);
|
|
683
683
|
else {
|
|
684
684
|
let h = r.normalize(m.replace(i.mountpoint, "/")).substring(1);
|
|
685
685
|
await s.removeRemoteEntry(p, h);
|
|
@@ -753,14 +753,14 @@ function Hn(e) {
|
|
|
753
753
|
}
|
|
754
754
|
N(Hn, "getFileSystemInitializationFuncs");
|
|
755
755
|
function Kn(e) {
|
|
756
|
-
let { binary: n, response: t } =
|
|
756
|
+
let { binary: n, response: t } = ot(e + "pyodide.asm.wasm");
|
|
757
757
|
return function(r, s) {
|
|
758
758
|
return async function() {
|
|
759
759
|
try {
|
|
760
760
|
let i;
|
|
761
761
|
t ? i = await WebAssembly.instantiateStreaming(t, r) : i = await WebAssembly.instantiate(await n, r);
|
|
762
|
-
let { instance:
|
|
763
|
-
typeof WasmOffsetConverter < "u" && (wasmOffsetConverter = new WasmOffsetConverter(wasmBinary,
|
|
762
|
+
let { instance: o, module: a } = i;
|
|
763
|
+
typeof WasmOffsetConverter < "u" && (wasmOffsetConverter = new WasmOffsetConverter(wasmBinary, a)), s(o, a);
|
|
764
764
|
} catch (i) {
|
|
765
765
|
console.warn("wasm instantiation failed!"), console.warn(i);
|
|
766
766
|
}
|
|
@@ -776,26 +776,26 @@ async function Gn(e = {}) {
|
|
|
776
776
|
r = Ct(r), r.endsWith("/") || (r += "/"), e.indexURL = r;
|
|
777
777
|
let s = { fullStdLib: !1, jsglobals: globalThis, stdin: globalThis.prompt ? globalThis.prompt : void 0, lockFileURL: r + "pyodide-lock.json", args: [], _node_mounts: [], env: {}, packageCacheDir: r, packages: [], enableRunUntilComplete: !1, checkAPIVersion: !0 }, i = Object.assign(s, e);
|
|
778
778
|
(n = i.env).HOME ?? (n.HOME = "/home/pyodide"), (t = i.env).PYTHONINSPECT ?? (t.PYTHONINSPECT = "1");
|
|
779
|
-
let
|
|
780
|
-
if (
|
|
779
|
+
let o = Un(i), a = o.API;
|
|
780
|
+
if (a.lockFilePromise = On(i.lockFileURL), typeof _createPyodideModule != "function") {
|
|
781
781
|
let m = `${i.indexURL}pyodide.asm.js`;
|
|
782
782
|
await nt(m);
|
|
783
783
|
}
|
|
784
784
|
let u;
|
|
785
785
|
if (e._loadSnapshot) {
|
|
786
786
|
let m = await e._loadSnapshot;
|
|
787
|
-
ArrayBuffer.isView(m) ? u = m : u = new Uint8Array(m),
|
|
787
|
+
ArrayBuffer.isView(m) ? u = m : u = new Uint8Array(m), o.noInitialRun = !0, o.INITIAL_MEMORY = u.length;
|
|
788
788
|
}
|
|
789
|
-
let l = await _createPyodideModule(
|
|
790
|
-
if (
|
|
791
|
-
if (e.pyproxyToStringRepr &&
|
|
789
|
+
let l = await _createPyodideModule(o);
|
|
790
|
+
if (o.exited) throw o.exited.toThrow;
|
|
791
|
+
if (e.pyproxyToStringRepr && a.setPyProxyToStringMethod(!0), a.version !== $t && i.checkAPIVersion) throw new Error(`Pyodide version does not match: '${$t}' <==> '${a.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);
|
|
792
792
|
l.locateFile = (m) => {
|
|
793
793
|
throw new Error("Didn't expect to load any more file_packager files!");
|
|
794
794
|
};
|
|
795
795
|
let c;
|
|
796
|
-
u && (c =
|
|
797
|
-
let p =
|
|
798
|
-
return
|
|
796
|
+
u && (c = a.restoreSnapshot(u));
|
|
797
|
+
let p = a.finalizeBootstrap(c);
|
|
798
|
+
return a.sys.path.insert(0, a.config.env.HOME), p.version.includes("dev") || a.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${p.version}/full/`), a._pyodide.set_excepthook(), await a.packageIndexReady, a.initializeStreams(i.stdin, i.stdout, i.stderr), p;
|
|
799
799
|
}
|
|
800
800
|
N(Gn, "loadPyodide");
|
|
801
801
|
var Q = typeof globalThis < "u" && globalThis || typeof self < "u" && self || // eslint-disable-next-line no-undef
|
|
@@ -1032,11 +1032,11 @@ function Yr(e) {
|
|
|
1032
1032
|
}).forEach(function(r) {
|
|
1033
1033
|
var s = r.split(":"), i = s.shift().trim();
|
|
1034
1034
|
if (i) {
|
|
1035
|
-
var
|
|
1035
|
+
var o = s.join(":").trim();
|
|
1036
1036
|
try {
|
|
1037
|
-
n.append(i,
|
|
1038
|
-
} catch (
|
|
1039
|
-
console.warn("Response " +
|
|
1037
|
+
n.append(i, o);
|
|
1038
|
+
} catch (a) {
|
|
1039
|
+
console.warn("Response " + a.message);
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
1042
|
}), n;
|
|
@@ -1084,7 +1084,7 @@ function Qn(e, n) {
|
|
|
1084
1084
|
if (s.signal && s.signal.aborted)
|
|
1085
1085
|
return r(new Fe("Aborted", "AbortError"));
|
|
1086
1086
|
var i = new XMLHttpRequest();
|
|
1087
|
-
function
|
|
1087
|
+
function o() {
|
|
1088
1088
|
i.abort();
|
|
1089
1089
|
}
|
|
1090
1090
|
i.onload = function() {
|
|
@@ -1110,14 +1110,14 @@ function Qn(e, n) {
|
|
|
1110
1110
|
r(new Fe("Aborted", "AbortError"));
|
|
1111
1111
|
}, 0);
|
|
1112
1112
|
};
|
|
1113
|
-
function
|
|
1113
|
+
function a(l) {
|
|
1114
1114
|
try {
|
|
1115
1115
|
return l === "" && Q.location.href ? Q.location.href : l;
|
|
1116
1116
|
} catch {
|
|
1117
1117
|
return l;
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
|
-
if (i.open(s.method,
|
|
1120
|
+
if (i.open(s.method, a(s.url), !0), s.credentials === "include" ? i.withCredentials = !0 : s.credentials === "omit" && (i.withCredentials = !1), "responseType" in i && (Y.blob ? i.responseType = "blob" : Y.arrayBuffer && (i.responseType = "arraybuffer")), n && typeof n.headers == "object" && !(n.headers instanceof G || Q.Headers && n.headers instanceof Q.Headers)) {
|
|
1121
1121
|
var u = [];
|
|
1122
1122
|
Object.getOwnPropertyNames(n.headers).forEach(function(l) {
|
|
1123
1123
|
u.push(Xe(l)), i.setRequestHeader(l, Ft(n.headers[l]));
|
|
@@ -1128,8 +1128,8 @@ function Qn(e, n) {
|
|
|
1128
1128
|
s.headers.forEach(function(l, c) {
|
|
1129
1129
|
i.setRequestHeader(c, l);
|
|
1130
1130
|
});
|
|
1131
|
-
s.signal && (s.signal.addEventListener("abort",
|
|
1132
|
-
i.readyState === 4 && s.signal.removeEventListener("abort",
|
|
1131
|
+
s.signal && (s.signal.addEventListener("abort", o), i.onreadystatechange = function() {
|
|
1132
|
+
i.readyState === 4 && s.signal.removeEventListener("abort", o);
|
|
1133
1133
|
}), i.send(typeof s._bodyInit > "u" ? null : s._bodyInit);
|
|
1134
1134
|
});
|
|
1135
1135
|
}
|
|
@@ -1142,12 +1142,12 @@ class ti extends Error {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
function Se(e, n, t, r) {
|
|
1144
1144
|
return r ? new Promise((s, i) => {
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1145
|
+
const o = e.animate(n, t), a = () => {
|
|
1146
|
+
o.pause();
|
|
1147
1147
|
};
|
|
1148
|
-
r.addListener(
|
|
1149
|
-
r.removeListener(
|
|
1150
|
-
},
|
|
1148
|
+
r.addListener(a), o.onfinish = () => {
|
|
1149
|
+
r.removeListener(a), s();
|
|
1150
|
+
}, o.oncancel = () => {
|
|
1151
1151
|
i(new st());
|
|
1152
1152
|
};
|
|
1153
1153
|
}) : new Promise((s) => {
|
|
@@ -1157,8 +1157,8 @@ function Se(e, n, t, r) {
|
|
|
1157
1157
|
}
|
|
1158
1158
|
var de = /* @__PURE__ */ ((e) => (e.Primary = "btn-primary", e.Secondary = "btn-secondary", e.Tertiary = "btn-tertiary", e.Badge = "btn-badge", e.CTA = "btn-cta", e.Destructive = "btn-destructive", e))(de || {}), He = /* @__PURE__ */ ((e) => (e.Small = "btn-sm", e.Medium = "btn-md", e.Large = "btn-lg", e.ExtraLarge = "btn-xl", e))(He || {});
|
|
1159
1159
|
function Je({ as: e = "button", type: n, variant: t = "btn-primary", size: r = "btn-lg", ...s }, i) {
|
|
1160
|
-
const
|
|
1161
|
-
return e === "button" && (
|
|
1160
|
+
const o = /* @__PURE__ */ b(e, { ...s }, i);
|
|
1161
|
+
return e === "button" && (o.type = n || "button"), o.classList.add("btn"), t && o.classList.add(t), r && o.classList.add(r), o;
|
|
1162
1162
|
}
|
|
1163
1163
|
class Qt {
|
|
1164
1164
|
constructor(n, t, r) {
|
|
@@ -1234,12 +1234,12 @@ function Rt(e) {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
function me(e, n, t, r) {
|
|
1236
1236
|
const s = e.length;
|
|
1237
|
-
let i = 0,
|
|
1237
|
+
let i = 0, o;
|
|
1238
1238
|
if (n < 0 ? n = -n > s ? 0 : s + n : n = n > s ? s : n, t = t > 0 ? t : 0, r.length < 1e4)
|
|
1239
|
-
|
|
1239
|
+
o = Array.from(r), o.unshift(n, t), e.splice(...o);
|
|
1240
1240
|
else
|
|
1241
1241
|
for (t && e.splice(n, t); i < r.length; )
|
|
1242
|
-
|
|
1242
|
+
o = r.slice(i, i + 1e4), o.unshift(n, 0), e.splice(...o), i += 1e4, n += 1e4;
|
|
1243
1243
|
}
|
|
1244
1244
|
function re(e, n) {
|
|
1245
1245
|
return e.length > 0 ? (me(e, e.length, 0, n), e) : n;
|
|
@@ -1249,27 +1249,27 @@ function si(e) {
|
|
|
1249
1249
|
const n = {};
|
|
1250
1250
|
let t = -1;
|
|
1251
1251
|
for (; ++t < e.length; )
|
|
1252
|
-
|
|
1252
|
+
oi(n, e[t]);
|
|
1253
1253
|
return n;
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1255
|
+
function oi(e, n) {
|
|
1256
1256
|
let t;
|
|
1257
1257
|
for (t in n) {
|
|
1258
1258
|
const s = (Yt.call(e, t) ? e[t] : void 0) || (e[t] = {}), i = n[t];
|
|
1259
|
-
let
|
|
1259
|
+
let o;
|
|
1260
1260
|
if (i)
|
|
1261
|
-
for (
|
|
1262
|
-
Yt.call(s,
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1261
|
+
for (o in i) {
|
|
1262
|
+
Yt.call(s, o) || (s[o] = []);
|
|
1263
|
+
const a = i[o];
|
|
1264
|
+
ai(
|
|
1265
1265
|
// @ts-expect-error Looks like a list.
|
|
1266
|
-
s[
|
|
1267
|
-
Array.isArray(
|
|
1266
|
+
s[o],
|
|
1267
|
+
Array.isArray(a) ? a : a ? [a] : []
|
|
1268
1268
|
);
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1272
|
+
function ai(e, n) {
|
|
1273
1273
|
let t = -1;
|
|
1274
1274
|
const r = [];
|
|
1275
1275
|
for (; ++t < n.length; )
|
|
@@ -1320,12 +1320,12 @@ function Ee(e) {
|
|
|
1320
1320
|
function R(e, n, t, r) {
|
|
1321
1321
|
const s = r ? r - 1 : Number.POSITIVE_INFINITY;
|
|
1322
1322
|
let i = 0;
|
|
1323
|
-
return
|
|
1324
|
-
function a(u) {
|
|
1325
|
-
return F(u) ? (e.enter(t), o(u)) : n(u);
|
|
1326
|
-
}
|
|
1323
|
+
return o;
|
|
1327
1324
|
function o(u) {
|
|
1328
|
-
return F(u)
|
|
1325
|
+
return F(u) ? (e.enter(t), a(u)) : n(u);
|
|
1326
|
+
}
|
|
1327
|
+
function a(u) {
|
|
1328
|
+
return F(u) && i++ < s ? (e.consume(u), a) : (e.exit(t), n(u));
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
1331
|
const pi = {
|
|
@@ -1339,29 +1339,29 @@ function fi(e) {
|
|
|
1339
1339
|
);
|
|
1340
1340
|
let t;
|
|
1341
1341
|
return n;
|
|
1342
|
-
function r(
|
|
1343
|
-
if (
|
|
1344
|
-
e.consume(
|
|
1342
|
+
function r(a) {
|
|
1343
|
+
if (a === null) {
|
|
1344
|
+
e.consume(a);
|
|
1345
1345
|
return;
|
|
1346
1346
|
}
|
|
1347
|
-
return e.enter("lineEnding"), e.consume(
|
|
1347
|
+
return e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), R(e, n, "linePrefix");
|
|
1348
1348
|
}
|
|
1349
|
-
function s(
|
|
1350
|
-
return e.enter("paragraph"), i(
|
|
1349
|
+
function s(a) {
|
|
1350
|
+
return e.enter("paragraph"), i(a);
|
|
1351
1351
|
}
|
|
1352
|
-
function i(
|
|
1352
|
+
function i(a) {
|
|
1353
1353
|
const u = e.enter("chunkText", {
|
|
1354
1354
|
contentType: "text",
|
|
1355
1355
|
previous: t
|
|
1356
1356
|
});
|
|
1357
|
-
return t && (t.next = u), t = u, a
|
|
1357
|
+
return t && (t.next = u), t = u, o(a);
|
|
1358
1358
|
}
|
|
1359
|
-
function a
|
|
1360
|
-
if (
|
|
1361
|
-
e.exit("chunkText"), e.exit("paragraph"), e.consume(
|
|
1359
|
+
function o(a) {
|
|
1360
|
+
if (a === null) {
|
|
1361
|
+
e.exit("chunkText"), e.exit("paragraph"), e.consume(a);
|
|
1362
1362
|
return;
|
|
1363
1363
|
}
|
|
1364
|
-
return E(
|
|
1364
|
+
return E(a) ? (e.consume(a), e.exit("chunkText"), i) : (e.consume(a), o);
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
1367
|
const mi = {
|
|
@@ -1371,9 +1371,9 @@ const mi = {
|
|
|
1371
1371
|
};
|
|
1372
1372
|
function gi(e) {
|
|
1373
1373
|
const n = this, t = [];
|
|
1374
|
-
let r = 0, s, i,
|
|
1375
|
-
return
|
|
1376
|
-
function
|
|
1374
|
+
let r = 0, s, i, o;
|
|
1375
|
+
return a;
|
|
1376
|
+
function a(_) {
|
|
1377
1377
|
if (r < t.length) {
|
|
1378
1378
|
const U = t[r];
|
|
1379
1379
|
return n.containerState = U[1], e.attempt(
|
|
@@ -1405,7 +1405,7 @@ function gi(e) {
|
|
|
1405
1405
|
n.events.slice(U)
|
|
1406
1406
|
), n.events.length = L, l(_);
|
|
1407
1407
|
}
|
|
1408
|
-
return
|
|
1408
|
+
return a(_);
|
|
1409
1409
|
}
|
|
1410
1410
|
function l(_) {
|
|
1411
1411
|
if (r === t.length) {
|
|
@@ -1425,7 +1425,7 @@ function gi(e) {
|
|
|
1425
1425
|
return s && v(), z(r), m(_);
|
|
1426
1426
|
}
|
|
1427
1427
|
function p(_) {
|
|
1428
|
-
return n.parser.lazy[n.now().line] = r !== t.length,
|
|
1428
|
+
return n.parser.lazy[n.now().line] = r !== t.length, o = n.now().offset, C(_);
|
|
1429
1429
|
}
|
|
1430
1430
|
function m(_) {
|
|
1431
1431
|
return n.containerState = {}, e.attempt(
|
|
@@ -1453,7 +1453,7 @@ function gi(e) {
|
|
|
1453
1453
|
P(e.exit("chunkFlow"), !0), z(0), e.consume(_);
|
|
1454
1454
|
return;
|
|
1455
1455
|
}
|
|
1456
|
-
return E(_) ? (e.consume(_), P(e.exit("chunkFlow")), r = 0, n.interrupt = void 0,
|
|
1456
|
+
return E(_) ? (e.consume(_), P(e.exit("chunkFlow")), r = 0, n.interrupt = void 0, a) : (e.consume(_), S);
|
|
1457
1457
|
}
|
|
1458
1458
|
function P(_, U) {
|
|
1459
1459
|
const D = n.sliceStream(_);
|
|
@@ -1462,9 +1462,9 @@ function gi(e) {
|
|
|
1462
1462
|
for (; x--; )
|
|
1463
1463
|
if (
|
|
1464
1464
|
// The token starts before the line ending…
|
|
1465
|
-
s.events[x][1].start.offset <
|
|
1465
|
+
s.events[x][1].start.offset < o && // …and either is not ended yet…
|
|
1466
1466
|
(!s.events[x][1].end || // …or ends after it.
|
|
1467
|
-
s.events[x][1].end.offset >
|
|
1467
|
+
s.events[x][1].end.offset > o)
|
|
1468
1468
|
)
|
|
1469
1469
|
return;
|
|
1470
1470
|
const L = n.events.length;
|
|
@@ -1528,7 +1528,7 @@ const Et = {
|
|
|
1528
1528
|
resolveAll: wi
|
|
1529
1529
|
};
|
|
1530
1530
|
function wi(e, n) {
|
|
1531
|
-
let t = -1, r, s, i,
|
|
1531
|
+
let t = -1, r, s, i, o, a, u, l, c;
|
|
1532
1532
|
for (; ++t < e.length; )
|
|
1533
1533
|
if (e[t][0] === "enter" && e[t][1].type === "attentionSequence" && e[t][1]._close) {
|
|
1534
1534
|
for (r = t; r--; )
|
|
@@ -1538,11 +1538,11 @@ function wi(e, n) {
|
|
|
1538
1538
|
continue;
|
|
1539
1539
|
u = e[r][1].end.offset - e[r][1].start.offset > 1 && e[t][1].end.offset - e[t][1].start.offset > 1 ? 2 : 1;
|
|
1540
1540
|
const p = Object.assign({}, e[r][1].end), m = Object.assign({}, e[t][1].start);
|
|
1541
|
-
nn(p, -u), nn(m, u),
|
|
1541
|
+
nn(p, -u), nn(m, u), o = {
|
|
1542
1542
|
type: u > 1 ? "strongSequence" : "emphasisSequence",
|
|
1543
1543
|
start: p,
|
|
1544
1544
|
end: Object.assign({}, e[r][1].end)
|
|
1545
|
-
},
|
|
1545
|
+
}, a = {
|
|
1546
1546
|
type: u > 1 ? "strongSequence" : "emphasisSequence",
|
|
1547
1547
|
start: Object.assign({}, e[t][1].start),
|
|
1548
1548
|
end: m
|
|
@@ -1552,15 +1552,15 @@ function wi(e, n) {
|
|
|
1552
1552
|
end: Object.assign({}, e[t][1].start)
|
|
1553
1553
|
}, s = {
|
|
1554
1554
|
type: u > 1 ? "strong" : "emphasis",
|
|
1555
|
-
start: Object.assign({},
|
|
1556
|
-
end: Object.assign({},
|
|
1557
|
-
}, e[r][1].end = Object.assign({},
|
|
1555
|
+
start: Object.assign({}, o.start),
|
|
1556
|
+
end: Object.assign({}, a.end)
|
|
1557
|
+
}, e[r][1].end = Object.assign({}, o.start), e[t][1].start = Object.assign({}, a.end), l = [], e[r][1].end.offset - e[r][1].start.offset && (l = re(l, [
|
|
1558
1558
|
["enter", e[r][1], n],
|
|
1559
1559
|
["exit", e[r][1], n]
|
|
1560
1560
|
])), l = re(l, [
|
|
1561
1561
|
["enter", s, n],
|
|
1562
|
-
["enter",
|
|
1563
|
-
["exit",
|
|
1562
|
+
["enter", o, n],
|
|
1563
|
+
["exit", o, n],
|
|
1564
1564
|
["enter", i, n]
|
|
1565
1565
|
]), l = re(
|
|
1566
1566
|
l,
|
|
@@ -1571,8 +1571,8 @@ function wi(e, n) {
|
|
|
1571
1571
|
)
|
|
1572
1572
|
), l = re(l, [
|
|
1573
1573
|
["exit", i, n],
|
|
1574
|
-
["enter",
|
|
1575
|
-
["exit",
|
|
1574
|
+
["enter", a, n],
|
|
1575
|
+
["exit", a, n],
|
|
1576
1576
|
["exit", s, n]
|
|
1577
1577
|
]), e[t][1].end.offset - e[t][1].start.offset ? (c = 2, l = re(l, [
|
|
1578
1578
|
["enter", e[t][1], n],
|
|
@@ -1588,13 +1588,13 @@ function wi(e, n) {
|
|
|
1588
1588
|
function xi(e, n) {
|
|
1589
1589
|
const t = this.parser.constructs.attentionMarkers.null, r = this.previous, s = tn(r);
|
|
1590
1590
|
let i;
|
|
1591
|
-
return
|
|
1592
|
-
function a(u) {
|
|
1593
|
-
return i = u, e.enter("attentionSequence"), o(u);
|
|
1594
|
-
}
|
|
1591
|
+
return o;
|
|
1595
1592
|
function o(u) {
|
|
1593
|
+
return i = u, e.enter("attentionSequence"), a(u);
|
|
1594
|
+
}
|
|
1595
|
+
function a(u) {
|
|
1596
1596
|
if (u === i)
|
|
1597
|
-
return e.consume(u),
|
|
1597
|
+
return e.consume(u), a;
|
|
1598
1598
|
const l = e.exit("attentionSequence"), c = tn(u), p = !c || c === 2 && s || t.includes(u), m = !s || s === 2 && c || t.includes(r);
|
|
1599
1599
|
return l._open = !!(i === 42 ? p : p && (s || !m)), l._close = !!(i === 42 ? m : m && (c || !p)), n(u);
|
|
1600
1600
|
}
|
|
@@ -1613,13 +1613,13 @@ function ki(e, n, t) {
|
|
|
1613
1613
|
return e.enter("autolink"), e.enter("autolinkMarker"), e.consume(h), e.exit("autolinkMarker"), e.enter("autolinkProtocol"), i;
|
|
1614
1614
|
}
|
|
1615
1615
|
function i(h) {
|
|
1616
|
-
return pe(h) ? (e.consume(h),
|
|
1617
|
-
}
|
|
1618
|
-
function a(h) {
|
|
1619
|
-
return h === 43 || h === 45 || h === 46 || he(h) ? (r = 1, o(h)) : l(h);
|
|
1616
|
+
return pe(h) ? (e.consume(h), o) : l(h);
|
|
1620
1617
|
}
|
|
1621
1618
|
function o(h) {
|
|
1622
|
-
return h ===
|
|
1619
|
+
return h === 43 || h === 45 || h === 46 || he(h) ? (r = 1, a(h)) : l(h);
|
|
1620
|
+
}
|
|
1621
|
+
function a(h) {
|
|
1622
|
+
return h === 58 ? (e.consume(h), r = 0, u) : (h === 43 || h === 45 || h === 46 || he(h)) && r++ < 32 ? (e.consume(h), a) : (r = 0, l(h));
|
|
1623
1623
|
}
|
|
1624
1624
|
function u(h) {
|
|
1625
1625
|
return h === 62 ? (e.exit("autolinkProtocol"), e.enter("autolinkMarker"), e.consume(h), e.exit("autolinkMarker"), e.exit("autolink"), n) : h === null || h === 32 || h === 60 || St(h) ? t(h) : (e.consume(h), u);
|
|
@@ -1665,32 +1665,32 @@ const Yn = {
|
|
|
1665
1665
|
function vi(e, n, t) {
|
|
1666
1666
|
const r = this;
|
|
1667
1667
|
return s;
|
|
1668
|
-
function s(
|
|
1669
|
-
if (
|
|
1670
|
-
const
|
|
1671
|
-
return
|
|
1668
|
+
function s(o) {
|
|
1669
|
+
if (o === 62) {
|
|
1670
|
+
const a = r.containerState;
|
|
1671
|
+
return a.open || (e.enter("blockQuote", {
|
|
1672
1672
|
_container: !0
|
|
1673
|
-
}),
|
|
1673
|
+
}), a.open = !0), e.enter("blockQuotePrefix"), e.enter("blockQuoteMarker"), e.consume(o), e.exit("blockQuoteMarker"), i;
|
|
1674
1674
|
}
|
|
1675
|
-
return t(
|
|
1675
|
+
return t(o);
|
|
1676
1676
|
}
|
|
1677
|
-
function i(
|
|
1678
|
-
return F(
|
|
1677
|
+
function i(o) {
|
|
1678
|
+
return F(o) ? (e.enter("blockQuotePrefixWhitespace"), e.consume(o), e.exit("blockQuotePrefixWhitespace"), e.exit("blockQuotePrefix"), n) : (e.exit("blockQuotePrefix"), n(o));
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
1681
|
function Ci(e, n, t) {
|
|
1682
1682
|
const r = this;
|
|
1683
1683
|
return s;
|
|
1684
|
-
function s(
|
|
1685
|
-
return F(
|
|
1684
|
+
function s(o) {
|
|
1685
|
+
return F(o) ? R(
|
|
1686
1686
|
e,
|
|
1687
1687
|
i,
|
|
1688
1688
|
"linePrefix",
|
|
1689
1689
|
r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
|
|
1690
|
-
)(
|
|
1690
|
+
)(o) : i(o);
|
|
1691
1691
|
}
|
|
1692
|
-
function i(
|
|
1693
|
-
return e.attempt(Yn, n, t)(
|
|
1692
|
+
function i(o) {
|
|
1693
|
+
return e.attempt(Yn, n, t)(o);
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
1696
|
function Si(e) {
|
|
@@ -1715,23 +1715,23 @@ const tr = {
|
|
|
1715
1715
|
};
|
|
1716
1716
|
function Ei(e, n, t) {
|
|
1717
1717
|
const r = this;
|
|
1718
|
-
let s = 0, i,
|
|
1719
|
-
return
|
|
1720
|
-
function
|
|
1718
|
+
let s = 0, i, o;
|
|
1719
|
+
return a;
|
|
1720
|
+
function a(p) {
|
|
1721
1721
|
return e.enter("characterReference"), e.enter("characterReferenceMarker"), e.consume(p), e.exit("characterReferenceMarker"), u;
|
|
1722
1722
|
}
|
|
1723
1723
|
function u(p) {
|
|
1724
|
-
return p === 35 ? (e.enter("characterReferenceMarkerNumeric"), e.consume(p), e.exit("characterReferenceMarkerNumeric"), l) : (e.enter("characterReferenceValue"), i = 31,
|
|
1724
|
+
return p === 35 ? (e.enter("characterReferenceMarkerNumeric"), e.consume(p), e.exit("characterReferenceMarkerNumeric"), l) : (e.enter("characterReferenceValue"), i = 31, o = he, c(p));
|
|
1725
1725
|
}
|
|
1726
1726
|
function l(p) {
|
|
1727
|
-
return p === 88 || p === 120 ? (e.enter("characterReferenceMarkerHexadecimal"), e.consume(p), e.exit("characterReferenceMarkerHexadecimal"), e.enter("characterReferenceValue"), i = 6,
|
|
1727
|
+
return p === 88 || p === 120 ? (e.enter("characterReferenceMarkerHexadecimal"), e.consume(p), e.exit("characterReferenceMarkerHexadecimal"), e.enter("characterReferenceValue"), i = 6, o = ui, c) : (e.enter("characterReferenceValue"), i = 7, o = _t, c(p));
|
|
1728
1728
|
}
|
|
1729
1729
|
function c(p) {
|
|
1730
1730
|
if (p === 59 && s) {
|
|
1731
1731
|
const m = e.exit("characterReferenceValue");
|
|
1732
|
-
return
|
|
1732
|
+
return o === he && !Rt(r.sliceSerialize(m)) ? t(p) : (e.enter("characterReferenceMarker"), e.consume(p), e.exit("characterReferenceMarker"), e.exit("characterReference"), n);
|
|
1733
1733
|
}
|
|
1734
|
-
return
|
|
1734
|
+
return o(p) && s++ < i ? (e.consume(p), c) : t(p);
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
1737
|
const rn = {
|
|
@@ -1747,17 +1747,17 @@ function Ti(e, n, t) {
|
|
|
1747
1747
|
tokenize: D,
|
|
1748
1748
|
partial: !0
|
|
1749
1749
|
};
|
|
1750
|
-
let i = 0,
|
|
1750
|
+
let i = 0, o = 0, a;
|
|
1751
1751
|
return u;
|
|
1752
1752
|
function u(x) {
|
|
1753
1753
|
return l(x);
|
|
1754
1754
|
}
|
|
1755
1755
|
function l(x) {
|
|
1756
1756
|
const L = r.events[r.events.length - 1];
|
|
1757
|
-
return i = L && L[1].type === "linePrefix" ? L[2].sliceSerialize(L[1], !0).length : 0,
|
|
1757
|
+
return i = L && L[1].type === "linePrefix" ? L[2].sliceSerialize(L[1], !0).length : 0, a = x, e.enter("codeFenced"), e.enter("codeFencedFence"), e.enter("codeFencedFenceSequence"), c(x);
|
|
1758
1758
|
}
|
|
1759
1759
|
function c(x) {
|
|
1760
|
-
return x ===
|
|
1760
|
+
return x === a ? (o++, e.consume(x), c) : o < 3 ? t(x) : (e.exit("codeFencedFenceSequence"), F(x) ? R(e, p, "whitespace")(x) : p(x));
|
|
1761
1761
|
}
|
|
1762
1762
|
function p(x) {
|
|
1763
1763
|
return x === null || E(x) ? (e.exit("codeFencedFence"), r.interrupt ? n(x) : e.check(rn, S, U)(x)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
|
|
@@ -1765,7 +1765,7 @@ function Ti(e, n, t) {
|
|
|
1765
1765
|
}), m(x));
|
|
1766
1766
|
}
|
|
1767
1767
|
function m(x) {
|
|
1768
|
-
return x === null || E(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), p(x)) : F(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), R(e, h, "whitespace")(x)) : x === 96 && x ===
|
|
1768
|
+
return x === null || E(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), p(x)) : F(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), R(e, h, "whitespace")(x)) : x === 96 && x === a ? t(x) : (e.consume(x), m);
|
|
1769
1769
|
}
|
|
1770
1770
|
function h(x) {
|
|
1771
1771
|
return x === null || E(x) ? p(x) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", {
|
|
@@ -1773,7 +1773,7 @@ function Ti(e, n, t) {
|
|
|
1773
1773
|
}), C(x));
|
|
1774
1774
|
}
|
|
1775
1775
|
function C(x) {
|
|
1776
|
-
return x === null || E(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), p(x)) : x === 96 && x ===
|
|
1776
|
+
return x === null || E(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), p(x)) : x === 96 && x === a ? t(x) : (e.consume(x), C);
|
|
1777
1777
|
}
|
|
1778
1778
|
function S(x) {
|
|
1779
1779
|
return e.attempt(s, U, P)(x);
|
|
@@ -1813,10 +1813,10 @@ function Ti(e, n, t) {
|
|
|
1813
1813
|
)(O) : A(O);
|
|
1814
1814
|
}
|
|
1815
1815
|
function A(O) {
|
|
1816
|
-
return O ===
|
|
1816
|
+
return O === a ? (x.enter("codeFencedFenceSequence"), W(O)) : q(O);
|
|
1817
1817
|
}
|
|
1818
1818
|
function W(O) {
|
|
1819
|
-
return O ===
|
|
1819
|
+
return O === a ? (I++, x.consume(O), W) : I >= o ? (x.exit("codeFencedFenceSequence"), F(O) ? R(x, H, "whitespace")(O) : H(O)) : q(O);
|
|
1820
1820
|
}
|
|
1821
1821
|
function H(O) {
|
|
1822
1822
|
return O === null || E(O) ? (x.exit("codeFencedFence"), L(O)) : q(O);
|
|
@@ -1826,11 +1826,11 @@ function Ti(e, n, t) {
|
|
|
1826
1826
|
function Ai(e, n, t) {
|
|
1827
1827
|
const r = this;
|
|
1828
1828
|
return s;
|
|
1829
|
-
function s(
|
|
1830
|
-
return
|
|
1829
|
+
function s(o) {
|
|
1830
|
+
return o === null ? t(o) : (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), i);
|
|
1831
1831
|
}
|
|
1832
|
-
function i(
|
|
1833
|
-
return r.parser.lazy[r.now().line] ? t(
|
|
1832
|
+
function i(o) {
|
|
1833
|
+
return r.parser.lazy[r.now().line] ? t(o) : n(o);
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
1836
1836
|
const bt = {
|
|
@@ -1848,13 +1848,13 @@ function Ii(e, n, t) {
|
|
|
1848
1848
|
}
|
|
1849
1849
|
function i(l) {
|
|
1850
1850
|
const c = r.events[r.events.length - 1];
|
|
1851
|
-
return c && c[1].type === "linePrefix" && c[2].sliceSerialize(c[1], !0).length >= 4 ?
|
|
1852
|
-
}
|
|
1853
|
-
function a(l) {
|
|
1854
|
-
return l === null ? u(l) : E(l) ? e.attempt(Bi, a, u)(l) : (e.enter("codeFlowValue"), o(l));
|
|
1851
|
+
return c && c[1].type === "linePrefix" && c[2].sliceSerialize(c[1], !0).length >= 4 ? o(l) : t(l);
|
|
1855
1852
|
}
|
|
1856
1853
|
function o(l) {
|
|
1857
|
-
return l === null
|
|
1854
|
+
return l === null ? u(l) : E(l) ? e.attempt(Bi, o, u)(l) : (e.enter("codeFlowValue"), a(l));
|
|
1855
|
+
}
|
|
1856
|
+
function a(l) {
|
|
1857
|
+
return l === null || E(l) ? (e.exit("codeFlowValue"), o(l)) : (e.consume(l), a);
|
|
1858
1858
|
}
|
|
1859
1859
|
function u(l) {
|
|
1860
1860
|
return e.exit("codeIndented"), n(l);
|
|
@@ -1863,12 +1863,12 @@ function Ii(e, n, t) {
|
|
|
1863
1863
|
function Li(e, n, t) {
|
|
1864
1864
|
const r = this;
|
|
1865
1865
|
return s;
|
|
1866
|
-
function s(
|
|
1867
|
-
return r.parser.lazy[r.now().line] ? t(
|
|
1866
|
+
function s(o) {
|
|
1867
|
+
return r.parser.lazy[r.now().line] ? t(o) : E(o) ? (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), s) : R(e, i, "linePrefix", 5)(o);
|
|
1868
1868
|
}
|
|
1869
|
-
function i(
|
|
1870
|
-
const
|
|
1871
|
-
return
|
|
1869
|
+
function i(o) {
|
|
1870
|
+
const a = r.events[r.events.length - 1];
|
|
1871
|
+
return a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? n(o) : E(o) ? s(o) : t(o);
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
1874
|
const Fi = {
|
|
@@ -1895,12 +1895,12 @@ function Ri(e) {
|
|
|
1895
1895
|
}
|
|
1896
1896
|
function Ni(e, n, t) {
|
|
1897
1897
|
let r = 0, s, i;
|
|
1898
|
-
return
|
|
1899
|
-
function a(p) {
|
|
1900
|
-
return e.enter("codeText"), e.enter("codeTextSequence"), o(p);
|
|
1901
|
-
}
|
|
1898
|
+
return o;
|
|
1902
1899
|
function o(p) {
|
|
1903
|
-
return
|
|
1900
|
+
return e.enter("codeText"), e.enter("codeTextSequence"), a(p);
|
|
1901
|
+
}
|
|
1902
|
+
function a(p) {
|
|
1903
|
+
return p === 96 ? (e.consume(p), r++, a) : (e.exit("codeTextSequence"), u(p));
|
|
1904
1904
|
}
|
|
1905
1905
|
function u(p) {
|
|
1906
1906
|
return p === null ? t(p) : p === 32 ? (e.enter("space"), e.consume(p), e.exit("space"), u) : p === 96 ? (i = e.enter("codeTextSequence"), s = 0, c(p)) : E(p) ? (e.enter("lineEnding"), e.consume(p), e.exit("lineEnding"), u) : (e.enter("codeTextData"), l(p));
|
|
@@ -1914,7 +1914,7 @@ function Ni(e, n, t) {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
function nr(e) {
|
|
1916
1916
|
const n = {};
|
|
1917
|
-
let t = -1, r, s, i,
|
|
1917
|
+
let t = -1, r, s, i, o, a, u, l;
|
|
1918
1918
|
for (; ++t < e.length; ) {
|
|
1919
1919
|
for (; t in n; )
|
|
1920
1920
|
t = n[t];
|
|
@@ -1924,9 +1924,9 @@ function nr(e) {
|
|
|
1924
1924
|
if (r[0] === "enter")
|
|
1925
1925
|
r[1].contentType && (Object.assign(n, Oi(e, t)), t = n[t], l = !0);
|
|
1926
1926
|
else if (r[1]._container) {
|
|
1927
|
-
for (i = t, s = void 0; i-- && (
|
|
1928
|
-
|
|
1929
|
-
s && (r[1].end = Object.assign({}, e[s][1].start),
|
|
1927
|
+
for (i = t, s = void 0; i-- && (o = e[i], o[1].type === "lineEnding" || o[1].type === "lineEndingBlank"); )
|
|
1928
|
+
o[0] === "enter" && (s && (e[s][1].type = "lineEndingBlank"), o[1].type = "lineEnding", s = i);
|
|
1929
|
+
s && (r[1].end = Object.assign({}, e[s][1].start), a = e.slice(s, t), a.unshift(r), me(e, s, t - s + 1, a));
|
|
1930
1930
|
}
|
|
1931
1931
|
}
|
|
1932
1932
|
return !l;
|
|
@@ -1934,19 +1934,19 @@ function nr(e) {
|
|
|
1934
1934
|
function Oi(e, n) {
|
|
1935
1935
|
const t = e[n][1], r = e[n][2];
|
|
1936
1936
|
let s = n - 1;
|
|
1937
|
-
const i = [],
|
|
1937
|
+
const i = [], o = t._tokenizer || r.parser[t.contentType](t.start), a = o.events, u = [], l = {};
|
|
1938
1938
|
let c, p, m = -1, h = t, C = 0, S = 0;
|
|
1939
1939
|
const P = [S];
|
|
1940
1940
|
for (; h; ) {
|
|
1941
1941
|
for (; e[++s][1] !== h; )
|
|
1942
1942
|
;
|
|
1943
|
-
i.push(s), h._tokenizer || (c = r.sliceStream(h), h.next || c.push(null), p &&
|
|
1943
|
+
i.push(s), h._tokenizer || (c = r.sliceStream(h), h.next || c.push(null), p && o.defineSkip(h.start), h._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = !0), o.write(c), h._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = void 0)), p = h, h = h.next;
|
|
1944
1944
|
}
|
|
1945
|
-
for (h = t; ++m <
|
|
1945
|
+
for (h = t; ++m < a.length; )
|
|
1946
1946
|
// Find a void token that includes a break.
|
|
1947
|
-
|
|
1948
|
-
for (
|
|
1949
|
-
const z =
|
|
1947
|
+
a[m][0] === "exit" && a[m - 1][0] === "enter" && a[m][1].type === a[m - 1][1].type && a[m][1].start.line !== a[m][1].end.line && (S = m + 1, P.push(S), h._tokenizer = void 0, h.previous = void 0, h = h.next);
|
|
1948
|
+
for (o.events = [], h ? (h._tokenizer = void 0, h.previous = void 0) : P.pop(), m = P.length; m--; ) {
|
|
1949
|
+
const z = a.slice(P[m], P[m + 1]), v = i.pop();
|
|
1950
1950
|
u.unshift([v, v + z.length - 1]), me(e, v, 2, z);
|
|
1951
1951
|
}
|
|
1952
1952
|
for (m = -1; ++m < u.length; )
|
|
@@ -1966,23 +1966,23 @@ function Ui(e) {
|
|
|
1966
1966
|
function ji(e, n) {
|
|
1967
1967
|
let t;
|
|
1968
1968
|
return r;
|
|
1969
|
-
function r(
|
|
1969
|
+
function r(a) {
|
|
1970
1970
|
return e.enter("content"), t = e.enter("chunkContent", {
|
|
1971
1971
|
contentType: "content"
|
|
1972
|
-
}), s(
|
|
1972
|
+
}), s(a);
|
|
1973
1973
|
}
|
|
1974
|
-
function s(
|
|
1975
|
-
return
|
|
1974
|
+
function s(a) {
|
|
1975
|
+
return a === null ? i(a) : E(a) ? e.check(
|
|
1976
1976
|
Pi,
|
|
1977
|
-
|
|
1977
|
+
o,
|
|
1978
1978
|
i
|
|
1979
|
-
)(
|
|
1979
|
+
)(a) : (e.consume(a), s);
|
|
1980
1980
|
}
|
|
1981
|
-
function i(
|
|
1982
|
-
return e.exit("chunkContent"), e.exit("content"), n(
|
|
1981
|
+
function i(a) {
|
|
1982
|
+
return e.exit("chunkContent"), e.exit("content"), n(a);
|
|
1983
1983
|
}
|
|
1984
|
-
function a
|
|
1985
|
-
return e.consume(
|
|
1984
|
+
function o(a) {
|
|
1985
|
+
return e.consume(a), e.exit("chunkContent"), t.next = e.enter("chunkContent", {
|
|
1986
1986
|
contentType: "content",
|
|
1987
1987
|
previous: t
|
|
1988
1988
|
}), t = t.next, s;
|
|
@@ -1991,86 +1991,86 @@ function ji(e, n) {
|
|
|
1991
1991
|
function qi(e, n, t) {
|
|
1992
1992
|
const r = this;
|
|
1993
1993
|
return s;
|
|
1994
|
-
function s(
|
|
1995
|
-
return e.exit("chunkContent"), e.enter("lineEnding"), e.consume(
|
|
1994
|
+
function s(o) {
|
|
1995
|
+
return e.exit("chunkContent"), e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), R(e, i, "linePrefix");
|
|
1996
1996
|
}
|
|
1997
|
-
function i(
|
|
1998
|
-
if (
|
|
1999
|
-
return t(
|
|
2000
|
-
const
|
|
2001
|
-
return !r.parser.constructs.disable.null.includes("codeIndented") &&
|
|
1997
|
+
function i(o) {
|
|
1998
|
+
if (o === null || E(o))
|
|
1999
|
+
return t(o);
|
|
2000
|
+
const a = r.events[r.events.length - 1];
|
|
2001
|
+
return !r.parser.constructs.disable.null.includes("codeIndented") && a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? n(o) : e.interrupt(r.parser.constructs.flow, t, n)(o);
|
|
2002
2002
|
}
|
|
2003
2003
|
}
|
|
2004
|
-
function rr(e, n, t, r, s, i,
|
|
2004
|
+
function rr(e, n, t, r, s, i, o, a, u) {
|
|
2005
2005
|
const l = u || Number.POSITIVE_INFINITY;
|
|
2006
2006
|
let c = 0;
|
|
2007
2007
|
return p;
|
|
2008
2008
|
function p(z) {
|
|
2009
|
-
return z === 60 ? (e.enter(r), e.enter(s), e.enter(i), e.consume(z), e.exit(i), m) : z === null || z === 32 || z === 41 || St(z) ? t(z) : (e.enter(r), e.enter(
|
|
2009
|
+
return z === 60 ? (e.enter(r), e.enter(s), e.enter(i), e.consume(z), e.exit(i), m) : z === null || z === 32 || z === 41 || St(z) ? t(z) : (e.enter(r), e.enter(o), e.enter(a), e.enter("chunkString", {
|
|
2010
2010
|
contentType: "string"
|
|
2011
2011
|
}), S(z));
|
|
2012
2012
|
}
|
|
2013
2013
|
function m(z) {
|
|
2014
|
-
return z === 62 ? (e.enter(i), e.consume(z), e.exit(i), e.exit(s), e.exit(r), n) : (e.enter(
|
|
2014
|
+
return z === 62 ? (e.enter(i), e.consume(z), e.exit(i), e.exit(s), e.exit(r), n) : (e.enter(a), e.enter("chunkString", {
|
|
2015
2015
|
contentType: "string"
|
|
2016
2016
|
}), h(z));
|
|
2017
2017
|
}
|
|
2018
2018
|
function h(z) {
|
|
2019
|
-
return z === 62 ? (e.exit("chunkString"), e.exit(
|
|
2019
|
+
return z === 62 ? (e.exit("chunkString"), e.exit(a), m(z)) : z === null || z === 60 || E(z) ? t(z) : (e.consume(z), z === 92 ? C : h);
|
|
2020
2020
|
}
|
|
2021
2021
|
function C(z) {
|
|
2022
2022
|
return z === 60 || z === 62 || z === 92 ? (e.consume(z), h) : h(z);
|
|
2023
2023
|
}
|
|
2024
2024
|
function S(z) {
|
|
2025
|
-
return !c && (z === null || z === 41 || Z(z)) ? (e.exit("chunkString"), e.exit(
|
|
2025
|
+
return !c && (z === null || z === 41 || Z(z)) ? (e.exit("chunkString"), e.exit(a), e.exit(o), e.exit(r), n(z)) : c < l && z === 40 ? (e.consume(z), c++, S) : z === 41 ? (e.consume(z), c--, S) : z === null || z === 32 || z === 40 || St(z) ? t(z) : (e.consume(z), z === 92 ? P : S);
|
|
2026
2026
|
}
|
|
2027
2027
|
function P(z) {
|
|
2028
2028
|
return z === 40 || z === 41 || z === 92 ? (e.consume(z), S) : S(z);
|
|
2029
2029
|
}
|
|
2030
2030
|
}
|
|
2031
2031
|
function ir(e, n, t, r, s, i) {
|
|
2032
|
-
const
|
|
2033
|
-
let
|
|
2032
|
+
const o = this;
|
|
2033
|
+
let a = 0, u;
|
|
2034
2034
|
return l;
|
|
2035
2035
|
function l(h) {
|
|
2036
2036
|
return e.enter(r), e.enter(s), e.consume(h), e.exit(s), e.enter(i), c;
|
|
2037
2037
|
}
|
|
2038
2038
|
function c(h) {
|
|
2039
|
-
return
|
|
2039
|
+
return a > 999 || h === null || h === 91 || h === 93 && !u || // To do: remove in the future once we’ve switched from
|
|
2040
2040
|
// `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
|
|
2041
2041
|
// which doesn’t need this.
|
|
2042
2042
|
// Hidden footnotes hook.
|
|
2043
2043
|
/* c8 ignore next 3 */
|
|
2044
|
-
h === 94 && !
|
|
2044
|
+
h === 94 && !a && "_hiddenFootnoteSupport" in o.parser.constructs ? t(h) : h === 93 ? (e.exit(i), e.enter(s), e.consume(h), e.exit(s), e.exit(r), n) : E(h) ? (e.enter("lineEnding"), e.consume(h), e.exit("lineEnding"), c) : (e.enter("chunkString", {
|
|
2045
2045
|
contentType: "string"
|
|
2046
2046
|
}), p(h));
|
|
2047
2047
|
}
|
|
2048
2048
|
function p(h) {
|
|
2049
|
-
return h === null || h === 91 || h === 93 || E(h) ||
|
|
2049
|
+
return h === null || h === 91 || h === 93 || E(h) || a++ > 999 ? (e.exit("chunkString"), c(h)) : (e.consume(h), u || (u = !F(h)), h === 92 ? m : p);
|
|
2050
2050
|
}
|
|
2051
2051
|
function m(h) {
|
|
2052
|
-
return h === 91 || h === 92 || h === 93 ? (e.consume(h),
|
|
2052
|
+
return h === 91 || h === 92 || h === 93 ? (e.consume(h), a++, p) : p(h);
|
|
2053
2053
|
}
|
|
2054
2054
|
}
|
|
2055
2055
|
function sr(e, n, t, r, s, i) {
|
|
2056
|
-
let
|
|
2057
|
-
return
|
|
2058
|
-
function
|
|
2059
|
-
return m === 34 || m === 39 || m === 40 ? (e.enter(r), e.enter(s), e.consume(m), e.exit(s),
|
|
2056
|
+
let o;
|
|
2057
|
+
return a;
|
|
2058
|
+
function a(m) {
|
|
2059
|
+
return m === 34 || m === 39 || m === 40 ? (e.enter(r), e.enter(s), e.consume(m), e.exit(s), o = m === 40 ? 41 : m, u) : t(m);
|
|
2060
2060
|
}
|
|
2061
2061
|
function u(m) {
|
|
2062
|
-
return m ===
|
|
2062
|
+
return m === o ? (e.enter(s), e.consume(m), e.exit(s), e.exit(r), n) : (e.enter(i), l(m));
|
|
2063
2063
|
}
|
|
2064
2064
|
function l(m) {
|
|
2065
|
-
return m ===
|
|
2065
|
+
return m === o ? (e.exit(i), u(o)) : m === null ? t(m) : E(m) ? (e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), R(e, l, "linePrefix")) : (e.enter("chunkString", {
|
|
2066
2066
|
contentType: "string"
|
|
2067
2067
|
}), c(m));
|
|
2068
2068
|
}
|
|
2069
2069
|
function c(m) {
|
|
2070
|
-
return m ===
|
|
2070
|
+
return m === o || m === null || E(m) ? (e.exit("chunkString"), l(m)) : (e.consume(m), m === 92 ? p : c);
|
|
2071
2071
|
}
|
|
2072
2072
|
function p(m) {
|
|
2073
|
-
return m ===
|
|
2073
|
+
return m === o || m === 92 ? (e.consume(m), c) : c(m);
|
|
2074
2074
|
}
|
|
2075
2075
|
}
|
|
2076
2076
|
function Ve(e, n) {
|
|
@@ -2096,13 +2096,13 @@ function Hi(e, n, t) {
|
|
|
2096
2096
|
let s;
|
|
2097
2097
|
return i;
|
|
2098
2098
|
function i(h) {
|
|
2099
|
-
return e.enter("definition"),
|
|
2099
|
+
return e.enter("definition"), o(h);
|
|
2100
2100
|
}
|
|
2101
|
-
function
|
|
2101
|
+
function o(h) {
|
|
2102
2102
|
return ir.call(
|
|
2103
2103
|
r,
|
|
2104
2104
|
e,
|
|
2105
|
-
|
|
2105
|
+
a,
|
|
2106
2106
|
// Note: we don’t need to reset the way `markdown-rs` does.
|
|
2107
2107
|
t,
|
|
2108
2108
|
"definitionLabel",
|
|
@@ -2110,7 +2110,7 @@ function Hi(e, n, t) {
|
|
|
2110
2110
|
"definitionLabelString"
|
|
2111
2111
|
)(h);
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2113
|
+
function a(h) {
|
|
2114
2114
|
return s = We(
|
|
2115
2115
|
r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)
|
|
2116
2116
|
), h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), u) : t(h);
|
|
@@ -2143,10 +2143,10 @@ function Hi(e, n, t) {
|
|
|
2143
2143
|
}
|
|
2144
2144
|
function Ki(e, n, t) {
|
|
2145
2145
|
return r;
|
|
2146
|
-
function r(
|
|
2147
|
-
return Z(
|
|
2146
|
+
function r(a) {
|
|
2147
|
+
return Z(a) ? Ve(e, s)(a) : t(a);
|
|
2148
2148
|
}
|
|
2149
|
-
function s(
|
|
2149
|
+
function s(a) {
|
|
2150
2150
|
return sr(
|
|
2151
2151
|
e,
|
|
2152
2152
|
i,
|
|
@@ -2154,13 +2154,13 @@ function Ki(e, n, t) {
|
|
|
2154
2154
|
"definitionTitle",
|
|
2155
2155
|
"definitionTitleMarker",
|
|
2156
2156
|
"definitionTitleString"
|
|
2157
|
-
)(
|
|
2157
|
+
)(a);
|
|
2158
2158
|
}
|
|
2159
|
-
function i(
|
|
2160
|
-
return F(
|
|
2159
|
+
function i(a) {
|
|
2160
|
+
return F(a) ? R(e, o, "whitespace")(a) : o(a);
|
|
2161
2161
|
}
|
|
2162
|
-
function a
|
|
2163
|
-
return
|
|
2162
|
+
function o(a) {
|
|
2163
|
+
return a === null || E(a) ? n(a) : t(a);
|
|
2164
2164
|
}
|
|
2165
2165
|
}
|
|
2166
2166
|
const Gi = {
|
|
@@ -2206,19 +2206,19 @@ function Ji(e, n, t) {
|
|
|
2206
2206
|
return e.enter("atxHeading"), i(c);
|
|
2207
2207
|
}
|
|
2208
2208
|
function i(c) {
|
|
2209
|
-
return e.enter("atxHeadingSequence"),
|
|
2210
|
-
}
|
|
2211
|
-
function a(c) {
|
|
2212
|
-
return c === 35 && r++ < 6 ? (e.consume(c), a) : c === null || Z(c) ? (e.exit("atxHeadingSequence"), o(c)) : t(c);
|
|
2209
|
+
return e.enter("atxHeadingSequence"), o(c);
|
|
2213
2210
|
}
|
|
2214
2211
|
function o(c) {
|
|
2215
|
-
return c === 35 ? (e.
|
|
2212
|
+
return c === 35 && r++ < 6 ? (e.consume(c), o) : c === null || Z(c) ? (e.exit("atxHeadingSequence"), a(c)) : t(c);
|
|
2213
|
+
}
|
|
2214
|
+
function a(c) {
|
|
2215
|
+
return c === 35 ? (e.enter("atxHeadingSequence"), u(c)) : c === null || E(c) ? (e.exit("atxHeading"), n(c)) : F(c) ? R(e, a, "whitespace")(c) : (e.enter("atxHeadingText"), l(c));
|
|
2216
2216
|
}
|
|
2217
2217
|
function u(c) {
|
|
2218
|
-
return c === 35 ? (e.consume(c), u) : (e.exit("atxHeadingSequence"),
|
|
2218
|
+
return c === 35 ? (e.consume(c), u) : (e.exit("atxHeadingSequence"), a(c));
|
|
2219
2219
|
}
|
|
2220
2220
|
function l(c) {
|
|
2221
|
-
return c === null || c === 35 || Z(c) ? (e.exit("atxHeadingText"),
|
|
2221
|
+
return c === null || c === 35 || Z(c) ? (e.exit("atxHeadingText"), a(c)) : (e.consume(c), l);
|
|
2222
2222
|
}
|
|
2223
2223
|
}
|
|
2224
2224
|
const Zi = [
|
|
@@ -2284,7 +2284,7 @@ const Zi = [
|
|
|
2284
2284
|
"tr",
|
|
2285
2285
|
"track",
|
|
2286
2286
|
"ul"
|
|
2287
|
-
],
|
|
2287
|
+
], on = ["pre", "script", "style", "textarea"], Yi = {
|
|
2288
2288
|
name: "htmlFlow",
|
|
2289
2289
|
tokenize: rs,
|
|
2290
2290
|
resolveTo: ns,
|
|
@@ -2304,7 +2304,7 @@ function ns(e) {
|
|
|
2304
2304
|
}
|
|
2305
2305
|
function rs(e, n, t) {
|
|
2306
2306
|
const r = this;
|
|
2307
|
-
let s, i,
|
|
2307
|
+
let s, i, o, a, u;
|
|
2308
2308
|
return l;
|
|
2309
2309
|
function l(f) {
|
|
2310
2310
|
return c(f);
|
|
@@ -2313,27 +2313,27 @@ function rs(e, n, t) {
|
|
|
2313
2313
|
return e.enter("htmlFlow"), e.enter("htmlFlowData"), e.consume(f), p;
|
|
2314
2314
|
}
|
|
2315
2315
|
function p(f) {
|
|
2316
|
-
return f === 33 ? (e.consume(f), m) : f === 47 ? (e.consume(f), i = !0, S) : f === 63 ? (e.consume(f), s = 3, r.interrupt ? n : d) : pe(f) ? (e.consume(f),
|
|
2316
|
+
return f === 33 ? (e.consume(f), m) : f === 47 ? (e.consume(f), i = !0, S) : f === 63 ? (e.consume(f), s = 3, r.interrupt ? n : d) : pe(f) ? (e.consume(f), o = String.fromCharCode(f), P) : t(f);
|
|
2317
2317
|
}
|
|
2318
2318
|
function m(f) {
|
|
2319
|
-
return f === 45 ? (e.consume(f), s = 2, h) : f === 91 ? (e.consume(f), s = 5,
|
|
2319
|
+
return f === 45 ? (e.consume(f), s = 2, h) : f === 91 ? (e.consume(f), s = 5, a = 0, C) : pe(f) ? (e.consume(f), s = 4, r.interrupt ? n : d) : t(f);
|
|
2320
2320
|
}
|
|
2321
2321
|
function h(f) {
|
|
2322
2322
|
return f === 45 ? (e.consume(f), r.interrupt ? n : d) : t(f);
|
|
2323
2323
|
}
|
|
2324
2324
|
function C(f) {
|
|
2325
2325
|
const le = "CDATA[";
|
|
2326
|
-
return f === le.charCodeAt(
|
|
2326
|
+
return f === le.charCodeAt(a++) ? (e.consume(f), a === le.length ? r.interrupt ? n : A : C) : t(f);
|
|
2327
2327
|
}
|
|
2328
2328
|
function S(f) {
|
|
2329
|
-
return pe(f) ? (e.consume(f),
|
|
2329
|
+
return pe(f) ? (e.consume(f), o = String.fromCharCode(f), P) : t(f);
|
|
2330
2330
|
}
|
|
2331
2331
|
function P(f) {
|
|
2332
2332
|
if (f === null || f === 47 || f === 62 || Z(f)) {
|
|
2333
|
-
const le = f === 47, Te =
|
|
2334
|
-
return !le && !i &&
|
|
2333
|
+
const le = f === 47, Te = o.toLowerCase();
|
|
2334
|
+
return !le && !i && on.includes(Te) ? (s = 1, r.interrupt ? n(f) : A(f)) : Zi.includes(o.toLowerCase()) ? (s = 6, le ? (e.consume(f), z) : r.interrupt ? n(f) : A(f)) : (s = 7, r.interrupt && !r.parser.lazy[r.now().line] ? t(f) : i ? v(f) : _(f));
|
|
2335
2335
|
}
|
|
2336
|
-
return f === 45 || he(f) ? (e.consume(f),
|
|
2336
|
+
return f === 45 || he(f) ? (e.consume(f), o += String.fromCharCode(f), P) : t(f);
|
|
2337
2337
|
}
|
|
2338
2338
|
function z(f) {
|
|
2339
2339
|
return f === 62 ? (e.consume(f), r.interrupt ? n : A) : t(f);
|
|
@@ -2369,7 +2369,7 @@ function rs(e, n, t) {
|
|
|
2369
2369
|
return f === null || E(f) ? A(f) : F(f) ? (e.consume(f), T) : t(f);
|
|
2370
2370
|
}
|
|
2371
2371
|
function A(f) {
|
|
2372
|
-
return f === 45 && s === 2 ? (e.consume(f), J) : f === 60 && s === 1 ? (e.consume(f), $) : f === 62 && s === 4 ? (e.consume(f),
|
|
2372
|
+
return f === 45 && s === 2 ? (e.consume(f), J) : f === 60 && s === 1 ? (e.consume(f), $) : f === 62 && s === 4 ? (e.consume(f), ae) : f === 63 && s === 3 ? (e.consume(f), d) : f === 93 && s === 5 ? (e.consume(f), be) : E(f) && (s === 6 || s === 7) ? (e.exit("htmlFlowData"), e.check(
|
|
2373
2373
|
es,
|
|
2374
2374
|
we,
|
|
2375
2375
|
W
|
|
@@ -2392,23 +2392,23 @@ function rs(e, n, t) {
|
|
|
2392
2392
|
return f === 45 ? (e.consume(f), d) : A(f);
|
|
2393
2393
|
}
|
|
2394
2394
|
function $(f) {
|
|
2395
|
-
return f === 47 ? (e.consume(f),
|
|
2395
|
+
return f === 47 ? (e.consume(f), o = "", oe) : A(f);
|
|
2396
2396
|
}
|
|
2397
|
-
function
|
|
2397
|
+
function oe(f) {
|
|
2398
2398
|
if (f === 62) {
|
|
2399
|
-
const le =
|
|
2400
|
-
return
|
|
2399
|
+
const le = o.toLowerCase();
|
|
2400
|
+
return on.includes(le) ? (e.consume(f), ae) : A(f);
|
|
2401
2401
|
}
|
|
2402
|
-
return pe(f) &&
|
|
2402
|
+
return pe(f) && o.length < 8 ? (e.consume(f), o += String.fromCharCode(f), oe) : A(f);
|
|
2403
2403
|
}
|
|
2404
2404
|
function be(f) {
|
|
2405
2405
|
return f === 93 ? (e.consume(f), d) : A(f);
|
|
2406
2406
|
}
|
|
2407
2407
|
function d(f) {
|
|
2408
|
-
return f === 62 ? (e.consume(f),
|
|
2408
|
+
return f === 62 ? (e.consume(f), ae) : f === 45 && s === 2 ? (e.consume(f), d) : A(f);
|
|
2409
2409
|
}
|
|
2410
|
-
function
|
|
2411
|
-
return f === null || E(f) ? (e.exit("htmlFlowData"), we(f)) : (e.consume(f),
|
|
2410
|
+
function ae(f) {
|
|
2411
|
+
return f === null || E(f) ? (e.exit("htmlFlowData"), we(f)) : (e.consume(f), ae);
|
|
2412
2412
|
}
|
|
2413
2413
|
function we(f) {
|
|
2414
2414
|
return e.exit("htmlFlow"), n(f);
|
|
@@ -2417,11 +2417,11 @@ function rs(e, n, t) {
|
|
|
2417
2417
|
function is(e, n, t) {
|
|
2418
2418
|
const r = this;
|
|
2419
2419
|
return s;
|
|
2420
|
-
function s(
|
|
2421
|
-
return E(
|
|
2420
|
+
function s(o) {
|
|
2421
|
+
return E(o) ? (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), i) : t(o);
|
|
2422
2422
|
}
|
|
2423
|
-
function i(
|
|
2424
|
-
return r.parser.lazy[r.now().line] ? t(
|
|
2423
|
+
function i(o) {
|
|
2424
|
+
return r.parser.lazy[r.now().line] ? t(o) : n(o);
|
|
2425
2425
|
}
|
|
2426
2426
|
}
|
|
2427
2427
|
function ss(e, n, t) {
|
|
@@ -2430,15 +2430,15 @@ function ss(e, n, t) {
|
|
|
2430
2430
|
return e.enter("lineEnding"), e.consume(s), e.exit("lineEnding"), e.attempt(ht, n, t);
|
|
2431
2431
|
}
|
|
2432
2432
|
}
|
|
2433
|
-
const
|
|
2433
|
+
const os = {
|
|
2434
2434
|
name: "htmlText",
|
|
2435
|
-
tokenize:
|
|
2435
|
+
tokenize: as
|
|
2436
2436
|
};
|
|
2437
|
-
function
|
|
2437
|
+
function as(e, n, t) {
|
|
2438
2438
|
const r = this;
|
|
2439
|
-
let s, i,
|
|
2440
|
-
return
|
|
2441
|
-
function
|
|
2439
|
+
let s, i, o;
|
|
2440
|
+
return a;
|
|
2441
|
+
function a(d) {
|
|
2442
2442
|
return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(d), u;
|
|
2443
2443
|
}
|
|
2444
2444
|
function u(d) {
|
|
@@ -2451,7 +2451,7 @@ function os(e, n, t) {
|
|
|
2451
2451
|
return d === 45 ? (e.consume(d), h) : t(d);
|
|
2452
2452
|
}
|
|
2453
2453
|
function p(d) {
|
|
2454
|
-
return d === null ? t(d) : d === 45 ? (e.consume(d), m) : E(d) ? (
|
|
2454
|
+
return d === null ? t(d) : d === 45 ? (e.consume(d), m) : E(d) ? (o = p, $(d)) : (e.consume(d), p);
|
|
2455
2455
|
}
|
|
2456
2456
|
function m(d) {
|
|
2457
2457
|
return d === 45 ? (e.consume(d), h) : p(d);
|
|
@@ -2460,11 +2460,11 @@ function os(e, n, t) {
|
|
|
2460
2460
|
return d === 62 ? J(d) : d === 45 ? m(d) : p(d);
|
|
2461
2461
|
}
|
|
2462
2462
|
function C(d) {
|
|
2463
|
-
const
|
|
2464
|
-
return d ===
|
|
2463
|
+
const ae = "CDATA[";
|
|
2464
|
+
return d === ae.charCodeAt(i++) ? (e.consume(d), i === ae.length ? S : C) : t(d);
|
|
2465
2465
|
}
|
|
2466
2466
|
function S(d) {
|
|
2467
|
-
return d === null ? t(d) : d === 93 ? (e.consume(d), P) : E(d) ? (
|
|
2467
|
+
return d === null ? t(d) : d === 93 ? (e.consume(d), P) : E(d) ? (o = S, $(d)) : (e.consume(d), S);
|
|
2468
2468
|
}
|
|
2469
2469
|
function P(d) {
|
|
2470
2470
|
return d === 93 ? (e.consume(d), z) : S(d);
|
|
@@ -2473,10 +2473,10 @@ function os(e, n, t) {
|
|
|
2473
2473
|
return d === 62 ? J(d) : d === 93 ? (e.consume(d), z) : S(d);
|
|
2474
2474
|
}
|
|
2475
2475
|
function v(d) {
|
|
2476
|
-
return d === null || d === 62 ? J(d) : E(d) ? (
|
|
2476
|
+
return d === null || d === 62 ? J(d) : E(d) ? (o = v, $(d)) : (e.consume(d), v);
|
|
2477
2477
|
}
|
|
2478
2478
|
function _(d) {
|
|
2479
|
-
return d === null ? t(d) : d === 63 ? (e.consume(d), U) : E(d) ? (
|
|
2479
|
+
return d === null ? t(d) : d === 63 ? (e.consume(d), U) : E(d) ? (o = _, $(d)) : (e.consume(d), _);
|
|
2480
2480
|
}
|
|
2481
2481
|
function U(d) {
|
|
2482
2482
|
return d === 62 ? J(d) : _(d);
|
|
@@ -2488,25 +2488,25 @@ function os(e, n, t) {
|
|
|
2488
2488
|
return d === 45 || he(d) ? (e.consume(d), x) : L(d);
|
|
2489
2489
|
}
|
|
2490
2490
|
function L(d) {
|
|
2491
|
-
return E(d) ? (
|
|
2491
|
+
return E(d) ? (o = L, $(d)) : F(d) ? (e.consume(d), L) : J(d);
|
|
2492
2492
|
}
|
|
2493
2493
|
function q(d) {
|
|
2494
2494
|
return d === 45 || he(d) ? (e.consume(d), q) : d === 47 || d === 62 || Z(d) ? I(d) : t(d);
|
|
2495
2495
|
}
|
|
2496
2496
|
function I(d) {
|
|
2497
|
-
return d === 47 ? (e.consume(d), J) : d === 58 || d === 95 || pe(d) ? (e.consume(d), g) : E(d) ? (
|
|
2497
|
+
return d === 47 ? (e.consume(d), J) : d === 58 || d === 95 || pe(d) ? (e.consume(d), g) : E(d) ? (o = I, $(d)) : F(d) ? (e.consume(d), I) : J(d);
|
|
2498
2498
|
}
|
|
2499
2499
|
function g(d) {
|
|
2500
2500
|
return d === 45 || d === 46 || d === 58 || d === 95 || he(d) ? (e.consume(d), g) : T(d);
|
|
2501
2501
|
}
|
|
2502
2502
|
function T(d) {
|
|
2503
|
-
return d === 61 ? (e.consume(d), A) : E(d) ? (
|
|
2503
|
+
return d === 61 ? (e.consume(d), A) : E(d) ? (o = T, $(d)) : F(d) ? (e.consume(d), T) : I(d);
|
|
2504
2504
|
}
|
|
2505
2505
|
function A(d) {
|
|
2506
|
-
return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? t(d) : d === 34 || d === 39 ? (e.consume(d), s = d, W) : E(d) ? (
|
|
2506
|
+
return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? t(d) : d === 34 || d === 39 ? (e.consume(d), s = d, W) : E(d) ? (o = A, $(d)) : F(d) ? (e.consume(d), A) : (e.consume(d), H);
|
|
2507
2507
|
}
|
|
2508
2508
|
function W(d) {
|
|
2509
|
-
return d === s ? (e.consume(d), s = void 0, O) : d === null ? t(d) : E(d) ? (
|
|
2509
|
+
return d === s ? (e.consume(d), s = void 0, O) : d === null ? t(d) : E(d) ? (o = W, $(d)) : (e.consume(d), W);
|
|
2510
2510
|
}
|
|
2511
2511
|
function H(d) {
|
|
2512
2512
|
return d === null || d === 34 || d === 39 || d === 60 || d === 61 || d === 96 ? t(d) : d === 47 || d === 62 || Z(d) ? I(d) : (e.consume(d), H);
|
|
@@ -2518,9 +2518,9 @@ function os(e, n, t) {
|
|
|
2518
2518
|
return d === 62 ? (e.consume(d), e.exit("htmlTextData"), e.exit("htmlText"), n) : t(d);
|
|
2519
2519
|
}
|
|
2520
2520
|
function $(d) {
|
|
2521
|
-
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(d), e.exit("lineEnding"),
|
|
2521
|
+
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(d), e.exit("lineEnding"), oe;
|
|
2522
2522
|
}
|
|
2523
|
-
function
|
|
2523
|
+
function oe(d) {
|
|
2524
2524
|
return F(d) ? R(
|
|
2525
2525
|
e,
|
|
2526
2526
|
be,
|
|
@@ -2529,7 +2529,7 @@ function os(e, n, t) {
|
|
|
2529
2529
|
)(d) : be(d);
|
|
2530
2530
|
}
|
|
2531
2531
|
function be(d) {
|
|
2532
|
-
return e.enter("htmlTextData"),
|
|
2532
|
+
return e.enter("htmlTextData"), o(d);
|
|
2533
2533
|
}
|
|
2534
2534
|
}
|
|
2535
2535
|
const Ot = {
|
|
@@ -2553,18 +2553,18 @@ function hs(e) {
|
|
|
2553
2553
|
return e;
|
|
2554
2554
|
}
|
|
2555
2555
|
function ds(e, n) {
|
|
2556
|
-
let t = e.length, r = 0, s, i,
|
|
2556
|
+
let t = e.length, r = 0, s, i, o, a;
|
|
2557
2557
|
for (; t--; )
|
|
2558
2558
|
if (s = e[t][1], i) {
|
|
2559
2559
|
if (s.type === "link" || s.type === "labelLink" && s._inactive)
|
|
2560
2560
|
break;
|
|
2561
2561
|
e[t][0] === "enter" && s.type === "labelLink" && (s._inactive = !0);
|
|
2562
|
-
} else if (
|
|
2562
|
+
} else if (o) {
|
|
2563
2563
|
if (e[t][0] === "enter" && (s.type === "labelImage" || s.type === "labelLink") && !s._balanced && (i = t, s.type !== "labelLink")) {
|
|
2564
2564
|
r = 2;
|
|
2565
2565
|
break;
|
|
2566
2566
|
}
|
|
2567
|
-
} else s.type === "labelEnd" && (
|
|
2567
|
+
} else s.type === "labelEnd" && (o = t);
|
|
2568
2568
|
const u = {
|
|
2569
2569
|
type: e[i][1].type === "labelLink" ? "link" : "image",
|
|
2570
2570
|
start: Object.assign({}, e[i][1].start),
|
|
@@ -2572,40 +2572,40 @@ function ds(e, n) {
|
|
|
2572
2572
|
}, l = {
|
|
2573
2573
|
type: "label",
|
|
2574
2574
|
start: Object.assign({}, e[i][1].start),
|
|
2575
|
-
end: Object.assign({}, e[
|
|
2575
|
+
end: Object.assign({}, e[o][1].end)
|
|
2576
2576
|
}, c = {
|
|
2577
2577
|
type: "labelText",
|
|
2578
2578
|
start: Object.assign({}, e[i + r + 2][1].end),
|
|
2579
|
-
end: Object.assign({}, e[
|
|
2579
|
+
end: Object.assign({}, e[o - 2][1].start)
|
|
2580
2580
|
};
|
|
2581
|
-
return
|
|
2581
|
+
return a = [
|
|
2582
2582
|
["enter", u, n],
|
|
2583
2583
|
["enter", l, n]
|
|
2584
|
-
],
|
|
2585
|
-
|
|
2584
|
+
], a = re(a, e.slice(i + 1, i + r + 3)), a = re(a, [["enter", c, n]]), a = re(
|
|
2585
|
+
a,
|
|
2586
2586
|
Nt(
|
|
2587
2587
|
n.parser.constructs.insideSpan.null,
|
|
2588
|
-
e.slice(i + r + 4,
|
|
2588
|
+
e.slice(i + r + 4, o - 3),
|
|
2589
2589
|
n
|
|
2590
2590
|
)
|
|
2591
|
-
),
|
|
2591
|
+
), a = re(a, [
|
|
2592
2592
|
["exit", c, n],
|
|
2593
|
-
e[
|
|
2594
|
-
e[
|
|
2593
|
+
e[o - 2],
|
|
2594
|
+
e[o - 1],
|
|
2595
2595
|
["exit", l, n]
|
|
2596
|
-
]),
|
|
2596
|
+
]), a = re(a, e.slice(o + 1)), a = re(a, [["exit", u, n]]), me(e, i, e.length, a), e;
|
|
2597
2597
|
}
|
|
2598
2598
|
function ps(e, n, t) {
|
|
2599
2599
|
const r = this;
|
|
2600
|
-
let s = r.events.length, i,
|
|
2600
|
+
let s = r.events.length, i, o;
|
|
2601
2601
|
for (; s--; )
|
|
2602
2602
|
if ((r.events[s][1].type === "labelImage" || r.events[s][1].type === "labelLink") && !r.events[s][1]._balanced) {
|
|
2603
2603
|
i = r.events[s][1];
|
|
2604
2604
|
break;
|
|
2605
2605
|
}
|
|
2606
|
-
return
|
|
2607
|
-
function
|
|
2608
|
-
return i ? i._inactive ? p(m) : (
|
|
2606
|
+
return a;
|
|
2607
|
+
function a(m) {
|
|
2608
|
+
return i ? i._inactive ? p(m) : (o = r.parser.defined.includes(
|
|
2609
2609
|
We(
|
|
2610
2610
|
r.sliceSerialize({
|
|
2611
2611
|
start: i.end,
|
|
@@ -2618,12 +2618,12 @@ function ps(e, n, t) {
|
|
|
2618
2618
|
return m === 40 ? e.attempt(
|
|
2619
2619
|
ls,
|
|
2620
2620
|
c,
|
|
2621
|
-
|
|
2621
|
+
o ? c : p
|
|
2622
2622
|
)(m) : m === 91 ? e.attempt(
|
|
2623
2623
|
us,
|
|
2624
2624
|
c,
|
|
2625
|
-
|
|
2626
|
-
)(m) :
|
|
2625
|
+
o ? l : p
|
|
2626
|
+
)(m) : o ? c(m) : p(m);
|
|
2627
2627
|
}
|
|
2628
2628
|
function l(m) {
|
|
2629
2629
|
return e.attempt(
|
|
@@ -2650,8 +2650,8 @@ function fs(e, n, t) {
|
|
|
2650
2650
|
function i(p) {
|
|
2651
2651
|
return p === 41 ? c(p) : rr(
|
|
2652
2652
|
e,
|
|
2653
|
-
a,
|
|
2654
2653
|
o,
|
|
2654
|
+
a,
|
|
2655
2655
|
"resourceDestination",
|
|
2656
2656
|
"resourceDestinationLiteral",
|
|
2657
2657
|
"resourceDestinationLiteralMarker",
|
|
@@ -2660,10 +2660,10 @@ function fs(e, n, t) {
|
|
|
2660
2660
|
32
|
|
2661
2661
|
)(p);
|
|
2662
2662
|
}
|
|
2663
|
-
function
|
|
2663
|
+
function o(p) {
|
|
2664
2664
|
return Z(p) ? Ve(e, u)(p) : c(p);
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2666
|
+
function a(p) {
|
|
2667
2667
|
return t(p);
|
|
2668
2668
|
}
|
|
2669
2669
|
function u(p) {
|
|
@@ -2686,26 +2686,26 @@ function fs(e, n, t) {
|
|
|
2686
2686
|
function ms(e, n, t) {
|
|
2687
2687
|
const r = this;
|
|
2688
2688
|
return s;
|
|
2689
|
-
function s(
|
|
2689
|
+
function s(a) {
|
|
2690
2690
|
return ir.call(
|
|
2691
2691
|
r,
|
|
2692
2692
|
e,
|
|
2693
2693
|
i,
|
|
2694
|
-
|
|
2694
|
+
o,
|
|
2695
2695
|
"reference",
|
|
2696
2696
|
"referenceMarker",
|
|
2697
2697
|
"referenceString"
|
|
2698
|
-
)(
|
|
2698
|
+
)(a);
|
|
2699
2699
|
}
|
|
2700
|
-
function i(
|
|
2700
|
+
function i(a) {
|
|
2701
2701
|
return r.parser.defined.includes(
|
|
2702
2702
|
We(
|
|
2703
2703
|
r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)
|
|
2704
2704
|
)
|
|
2705
|
-
) ? n(
|
|
2705
|
+
) ? n(a) : t(a);
|
|
2706
2706
|
}
|
|
2707
|
-
function a
|
|
2708
|
-
return t(
|
|
2707
|
+
function o(a) {
|
|
2708
|
+
return t(a);
|
|
2709
2709
|
}
|
|
2710
2710
|
}
|
|
2711
2711
|
function gs(e, n, t) {
|
|
@@ -2725,14 +2725,14 @@ const bs = {
|
|
|
2725
2725
|
function ws(e, n, t) {
|
|
2726
2726
|
const r = this;
|
|
2727
2727
|
return s;
|
|
2728
|
-
function s(
|
|
2729
|
-
return e.enter("labelImage"), e.enter("labelImageMarker"), e.consume(
|
|
2728
|
+
function s(a) {
|
|
2729
|
+
return e.enter("labelImage"), e.enter("labelImageMarker"), e.consume(a), e.exit("labelImageMarker"), i;
|
|
2730
2730
|
}
|
|
2731
|
-
function i(
|
|
2732
|
-
return
|
|
2731
|
+
function i(a) {
|
|
2732
|
+
return a === 91 ? (e.enter("labelMarker"), e.consume(a), e.exit("labelMarker"), e.exit("labelImage"), o) : t(a);
|
|
2733
2733
|
}
|
|
2734
|
-
function a
|
|
2735
|
-
return
|
|
2734
|
+
function o(a) {
|
|
2735
|
+
return a === 94 && "_hiddenFootnoteSupport" in r.parser.constructs ? t(a) : n(a);
|
|
2736
2736
|
}
|
|
2737
2737
|
}
|
|
2738
2738
|
const xs = {
|
|
@@ -2743,11 +2743,11 @@ const xs = {
|
|
|
2743
2743
|
function ys(e, n, t) {
|
|
2744
2744
|
const r = this;
|
|
2745
2745
|
return s;
|
|
2746
|
-
function s(
|
|
2747
|
-
return e.enter("labelLink"), e.enter("labelMarker"), e.consume(
|
|
2746
|
+
function s(o) {
|
|
2747
|
+
return e.enter("labelLink"), e.enter("labelMarker"), e.consume(o), e.exit("labelMarker"), e.exit("labelLink"), i;
|
|
2748
2748
|
}
|
|
2749
|
-
function i(
|
|
2750
|
-
return
|
|
2749
|
+
function i(o) {
|
|
2750
|
+
return o === 94 && "_hiddenFootnoteSupport" in r.parser.constructs ? t(o) : n(o);
|
|
2751
2751
|
}
|
|
2752
2752
|
}
|
|
2753
2753
|
const wt = {
|
|
@@ -2768,16 +2768,16 @@ function zs(e, n, t) {
|
|
|
2768
2768
|
let r = 0, s;
|
|
2769
2769
|
return i;
|
|
2770
2770
|
function i(l) {
|
|
2771
|
-
return e.enter("thematicBreak"),
|
|
2772
|
-
}
|
|
2773
|
-
function a(l) {
|
|
2774
|
-
return s = l, o(l);
|
|
2771
|
+
return e.enter("thematicBreak"), o(l);
|
|
2775
2772
|
}
|
|
2776
2773
|
function o(l) {
|
|
2774
|
+
return s = l, a(l);
|
|
2775
|
+
}
|
|
2776
|
+
function a(l) {
|
|
2777
2777
|
return l === s ? (e.enter("thematicBreakSequence"), u(l)) : r >= 3 && (l === null || E(l)) ? (e.exit("thematicBreak"), n(l)) : t(l);
|
|
2778
2778
|
}
|
|
2779
2779
|
function u(l) {
|
|
2780
|
-
return l === s ? (e.consume(l), r++, u) : (e.exit("thematicBreakSequence"), F(l) ? R(e,
|
|
2780
|
+
return l === s ? (e.consume(l), r++, u) : (e.exit("thematicBreakSequence"), F(l) ? R(e, a, "whitespace")(l) : a(l));
|
|
2781
2781
|
}
|
|
2782
2782
|
}
|
|
2783
2783
|
const ee = {
|
|
@@ -2796,9 +2796,9 @@ const ee = {
|
|
|
2796
2796
|
};
|
|
2797
2797
|
function Ss(e, n, t) {
|
|
2798
2798
|
const r = this, s = r.events[r.events.length - 1];
|
|
2799
|
-
let i = s && s[1].type === "linePrefix" ? s[2].sliceSerialize(s[1], !0).length : 0,
|
|
2800
|
-
return
|
|
2801
|
-
function
|
|
2799
|
+
let i = s && s[1].type === "linePrefix" ? s[2].sliceSerialize(s[1], !0).length : 0, o = 0;
|
|
2800
|
+
return a;
|
|
2801
|
+
function a(h) {
|
|
2802
2802
|
const C = r.containerState.type || (h === 42 || h === 43 || h === 45 ? "listUnordered" : "listOrdered");
|
|
2803
2803
|
if (C === "listUnordered" ? !r.containerState.marker || h === r.containerState.marker : _t(h)) {
|
|
2804
2804
|
if (r.containerState.type || (r.containerState.type = C, e.enter(C, {
|
|
@@ -2811,7 +2811,7 @@ function Ss(e, n, t) {
|
|
|
2811
2811
|
return t(h);
|
|
2812
2812
|
}
|
|
2813
2813
|
function u(h) {
|
|
2814
|
-
return _t(h) && ++
|
|
2814
|
+
return _t(h) && ++o < 10 ? (e.consume(h), u) : (!r.interrupt || o < 2) && (r.containerState.marker ? h === r.containerState.marker : h === 41 || h === 46) ? (e.exit("listItemValue"), l(h)) : t(h);
|
|
2815
2815
|
}
|
|
2816
2816
|
function l(h) {
|
|
2817
2817
|
return e.enter("listItemMarker"), e.consume(h), e.exit("listItemMarker"), r.containerState.marker = r.containerState.marker || h, e.check(
|
|
@@ -2838,24 +2838,24 @@ function Ss(e, n, t) {
|
|
|
2838
2838
|
function _s(e, n, t) {
|
|
2839
2839
|
const r = this;
|
|
2840
2840
|
return r.containerState._closeFlow = void 0, e.check(ht, s, i);
|
|
2841
|
-
function s(
|
|
2841
|
+
function s(a) {
|
|
2842
2842
|
return r.containerState.furtherBlankLines = r.containerState.furtherBlankLines || r.containerState.initialBlankLine, R(
|
|
2843
2843
|
e,
|
|
2844
2844
|
n,
|
|
2845
2845
|
"listItemIndent",
|
|
2846
2846
|
r.containerState.size + 1
|
|
2847
|
-
)(
|
|
2847
|
+
)(a);
|
|
2848
2848
|
}
|
|
2849
|
-
function i(
|
|
2850
|
-
return r.containerState.furtherBlankLines || !F(
|
|
2849
|
+
function i(a) {
|
|
2850
|
+
return r.containerState.furtherBlankLines || !F(a) ? (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, o(a)) : (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, e.attempt(Cs, n, o)(a));
|
|
2851
2851
|
}
|
|
2852
|
-
function a
|
|
2852
|
+
function o(a) {
|
|
2853
2853
|
return r.containerState._closeFlow = !0, r.interrupt = void 0, R(
|
|
2854
2854
|
e,
|
|
2855
2855
|
e.attempt(ee, n, t),
|
|
2856
2856
|
"linePrefix",
|
|
2857
2857
|
r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
|
|
2858
|
-
)(
|
|
2858
|
+
)(a);
|
|
2859
2859
|
}
|
|
2860
2860
|
}
|
|
2861
2861
|
function Es(e, n, t) {
|
|
@@ -2867,8 +2867,8 @@ function Es(e, n, t) {
|
|
|
2867
2867
|
r.containerState.size + 1
|
|
2868
2868
|
);
|
|
2869
2869
|
function s(i) {
|
|
2870
|
-
const
|
|
2871
|
-
return
|
|
2870
|
+
const o = r.events[r.events.length - 1];
|
|
2871
|
+
return o && o[1].type === "listItemIndent" && o[2].sliceSerialize(o[1], !0).length === r.containerState.size ? n(i) : t(i);
|
|
2872
2872
|
}
|
|
2873
2873
|
}
|
|
2874
2874
|
function Ts(e) {
|
|
@@ -2883,11 +2883,11 @@ function As(e, n, t) {
|
|
|
2883
2883
|
r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5
|
|
2884
2884
|
);
|
|
2885
2885
|
function s(i) {
|
|
2886
|
-
const
|
|
2887
|
-
return !F(i) &&
|
|
2886
|
+
const o = r.events[r.events.length - 1];
|
|
2887
|
+
return !F(i) && o && o[1].type === "listItemPrefixWhitespace" ? n(i) : t(i);
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
|
-
const
|
|
2890
|
+
const an = {
|
|
2891
2891
|
name: "setextUnderline",
|
|
2892
2892
|
tokenize: Is,
|
|
2893
2893
|
resolveTo: Bs
|
|
@@ -2903,12 +2903,12 @@ function Bs(e, n) {
|
|
|
2903
2903
|
e[t][1].type === "paragraph" && (s = t);
|
|
2904
2904
|
} else
|
|
2905
2905
|
e[t][1].type === "content" && e.splice(t, 1), !i && e[t][1].type === "definition" && (i = t);
|
|
2906
|
-
const
|
|
2906
|
+
const o = {
|
|
2907
2907
|
type: "setextHeading",
|
|
2908
2908
|
start: Object.assign({}, e[s][1].start),
|
|
2909
2909
|
end: Object.assign({}, e[e.length - 1][1].end)
|
|
2910
2910
|
};
|
|
2911
|
-
return e[s][1].type = "setextHeadingText", i ? (e.splice(s, 0, ["enter",
|
|
2911
|
+
return e[s][1].type = "setextHeadingText", i ? (e.splice(s, 0, ["enter", o, n]), e.splice(i + 1, 0, ["exit", e[r][1], n]), e[r][1].end = Object.assign({}, e[i][1].end)) : e[r][1] = o, e.push(["exit", o, n]), e;
|
|
2912
2912
|
}
|
|
2913
2913
|
function Is(e, n, t) {
|
|
2914
2914
|
const r = this;
|
|
@@ -2921,13 +2921,13 @@ function Is(e, n, t) {
|
|
|
2921
2921
|
p = r.events[c][1].type === "paragraph";
|
|
2922
2922
|
break;
|
|
2923
2923
|
}
|
|
2924
|
-
return !r.parser.lazy[r.now().line] && (r.interrupt || p) ? (e.enter("setextHeadingLine"), s = l,
|
|
2925
|
-
}
|
|
2926
|
-
function a(l) {
|
|
2927
|
-
return e.enter("setextHeadingLineSequence"), o(l);
|
|
2924
|
+
return !r.parser.lazy[r.now().line] && (r.interrupt || p) ? (e.enter("setextHeadingLine"), s = l, o(l)) : t(l);
|
|
2928
2925
|
}
|
|
2929
2926
|
function o(l) {
|
|
2930
|
-
return
|
|
2927
|
+
return e.enter("setextHeadingLineSequence"), a(l);
|
|
2928
|
+
}
|
|
2929
|
+
function a(l) {
|
|
2930
|
+
return l === s ? (e.consume(l), a) : (e.exit("setextHeadingLineSequence"), F(l) ? R(e, u, "lineSuffix")(l) : u(l));
|
|
2931
2931
|
}
|
|
2932
2932
|
function u(l) {
|
|
2933
2933
|
return l === null || E(l) ? (e.exit("setextHeadingLine"), n(l)) : t(l);
|
|
@@ -2973,22 +2973,22 @@ function Fs(e) {
|
|
|
2973
2973
|
}
|
|
2974
2974
|
}
|
|
2975
2975
|
const Ms = {
|
|
2976
|
-
resolveAll:
|
|
2977
|
-
}, Rs =
|
|
2978
|
-
function
|
|
2976
|
+
resolveAll: ar()
|
|
2977
|
+
}, Rs = or("string"), Ns = or("text");
|
|
2978
|
+
function or(e) {
|
|
2979
2979
|
return {
|
|
2980
2980
|
tokenize: n,
|
|
2981
|
-
resolveAll:
|
|
2981
|
+
resolveAll: ar(
|
|
2982
2982
|
e === "text" ? Os : void 0
|
|
2983
2983
|
)
|
|
2984
2984
|
};
|
|
2985
2985
|
function n(t) {
|
|
2986
|
-
const r = this, s = this.parser.constructs[e], i = t.attempt(s,
|
|
2987
|
-
return
|
|
2988
|
-
function a(c) {
|
|
2989
|
-
return l(c) ? i(c) : o(c);
|
|
2990
|
-
}
|
|
2986
|
+
const r = this, s = this.parser.constructs[e], i = t.attempt(s, o, a);
|
|
2987
|
+
return o;
|
|
2991
2988
|
function o(c) {
|
|
2989
|
+
return l(c) ? i(c) : a(c);
|
|
2990
|
+
}
|
|
2991
|
+
function a(c) {
|
|
2992
2992
|
if (c === null) {
|
|
2993
2993
|
t.consume(c);
|
|
2994
2994
|
return;
|
|
@@ -3013,7 +3013,7 @@ function ar(e) {
|
|
|
3013
3013
|
}
|
|
3014
3014
|
}
|
|
3015
3015
|
}
|
|
3016
|
-
function
|
|
3016
|
+
function ar(e) {
|
|
3017
3017
|
return n;
|
|
3018
3018
|
function n(t, r) {
|
|
3019
3019
|
let s = -1, i;
|
|
@@ -3027,30 +3027,30 @@ function Os(e, n) {
|
|
|
3027
3027
|
for (; ++t <= e.length; )
|
|
3028
3028
|
if ((t === e.length || e[t][1].type === "lineEnding") && e[t - 1][1].type === "data") {
|
|
3029
3029
|
const r = e[t - 1][1], s = n.sliceStream(r);
|
|
3030
|
-
let i = s.length,
|
|
3030
|
+
let i = s.length, o = -1, a = 0, u;
|
|
3031
3031
|
for (; i--; ) {
|
|
3032
3032
|
const l = s[i];
|
|
3033
3033
|
if (typeof l == "string") {
|
|
3034
|
-
for (
|
|
3035
|
-
|
|
3036
|
-
if (
|
|
3037
|
-
|
|
3034
|
+
for (o = l.length; l.charCodeAt(o - 1) === 32; )
|
|
3035
|
+
a++, o--;
|
|
3036
|
+
if (o) break;
|
|
3037
|
+
o = -1;
|
|
3038
3038
|
} else if (l === -2)
|
|
3039
|
-
u = !0,
|
|
3039
|
+
u = !0, a++;
|
|
3040
3040
|
else if (l !== -1) {
|
|
3041
3041
|
i++;
|
|
3042
3042
|
break;
|
|
3043
3043
|
}
|
|
3044
3044
|
}
|
|
3045
|
-
if (
|
|
3045
|
+
if (a) {
|
|
3046
3046
|
const l = {
|
|
3047
|
-
type: t === e.length || u ||
|
|
3047
|
+
type: t === e.length || u || a < 2 ? "lineSuffix" : "hardBreakTrailing",
|
|
3048
3048
|
start: {
|
|
3049
3049
|
line: r.end.line,
|
|
3050
|
-
column: r.end.column -
|
|
3051
|
-
offset: r.end.offset -
|
|
3050
|
+
column: r.end.column - a,
|
|
3051
|
+
offset: r.end.offset - a,
|
|
3052
3052
|
_index: r.start._index + i,
|
|
3053
|
-
_bufferIndex: i ?
|
|
3053
|
+
_bufferIndex: i ? o : r.start._bufferIndex + o
|
|
3054
3054
|
},
|
|
3055
3055
|
end: Object.assign({}, r.end)
|
|
3056
3056
|
};
|
|
@@ -3078,7 +3078,7 @@ function Ds(e, n, t) {
|
|
|
3078
3078
|
}
|
|
3079
3079
|
);
|
|
3080
3080
|
const s = {}, i = [];
|
|
3081
|
-
let
|
|
3081
|
+
let o = [], a = [];
|
|
3082
3082
|
const u = {
|
|
3083
3083
|
consume: v,
|
|
3084
3084
|
enter: _,
|
|
@@ -3103,13 +3103,13 @@ function Ds(e, n, t) {
|
|
|
3103
3103
|
let c = n.tokenize.call(l, u);
|
|
3104
3104
|
return n.resolveAll && i.push(n), l;
|
|
3105
3105
|
function p(T) {
|
|
3106
|
-
return
|
|
3106
|
+
return o = re(o, T), P(), o[o.length - 1] !== null ? [] : (q(n, 0), l.events = Nt(i, l.events, l), l.events);
|
|
3107
3107
|
}
|
|
3108
3108
|
function m(T, A) {
|
|
3109
3109
|
return Us(h(T), A);
|
|
3110
3110
|
}
|
|
3111
3111
|
function h(T) {
|
|
3112
|
-
return Ps(
|
|
3112
|
+
return Ps(o, T);
|
|
3113
3113
|
}
|
|
3114
3114
|
function C() {
|
|
3115
3115
|
const { line: T, column: A, offset: W, _index: H, _bufferIndex: O } = r;
|
|
@@ -3126,8 +3126,8 @@ function Ds(e, n, t) {
|
|
|
3126
3126
|
}
|
|
3127
3127
|
function P() {
|
|
3128
3128
|
let T;
|
|
3129
|
-
for (; r._index <
|
|
3130
|
-
const A =
|
|
3129
|
+
for (; r._index < o.length; ) {
|
|
3130
|
+
const A = o[r._index];
|
|
3131
3131
|
if (typeof A == "string")
|
|
3132
3132
|
for (T = r._index, r._bufferIndex < 0 && (r._bufferIndex = 0); r._index === T && r._bufferIndex < A.length; )
|
|
3133
3133
|
z(A.charCodeAt(r._bufferIndex));
|
|
@@ -3139,14 +3139,14 @@ function Ds(e, n, t) {
|
|
|
3139
3139
|
c = c(T);
|
|
3140
3140
|
}
|
|
3141
3141
|
function v(T) {
|
|
3142
|
-
E(T) ? (r.line++, r.column = 1, r.offset += T === -3 ? 2 : 1, g()) : T !== -1 && (r.column++, r.offset++), r._bufferIndex < 0 ? r._index++ : (r._bufferIndex++, r._bufferIndex ===
|
|
3142
|
+
E(T) ? (r.line++, r.column = 1, r.offset += T === -3 ? 2 : 1, g()) : T !== -1 && (r.column++, r.offset++), r._bufferIndex < 0 ? r._index++ : (r._bufferIndex++, r._bufferIndex === o[r._index].length && (r._bufferIndex = -1, r._index++)), l.previous = T;
|
|
3143
3143
|
}
|
|
3144
3144
|
function _(T, A) {
|
|
3145
3145
|
const W = A || {};
|
|
3146
|
-
return W.type = T, W.start = C(), l.events.push(["enter", W, l]),
|
|
3146
|
+
return W.type = T, W.start = C(), l.events.push(["enter", W, l]), a.push(W), W;
|
|
3147
3147
|
}
|
|
3148
3148
|
function U(T) {
|
|
3149
|
-
const A =
|
|
3149
|
+
const A = a.pop();
|
|
3150
3150
|
return A.end = C(), l.events.push(["exit", A, l]), A;
|
|
3151
3151
|
}
|
|
3152
3152
|
function D(T, A) {
|
|
@@ -3158,12 +3158,12 @@ function Ds(e, n, t) {
|
|
|
3158
3158
|
function L(T, A) {
|
|
3159
3159
|
return W;
|
|
3160
3160
|
function W(H, O, J) {
|
|
3161
|
-
let $,
|
|
3161
|
+
let $, oe, be, d;
|
|
3162
3162
|
return Array.isArray(H) ? we(H) : "tokenize" in H ? (
|
|
3163
3163
|
// @ts-expect-error Looks like a construct.
|
|
3164
3164
|
we([H])
|
|
3165
|
-
) :
|
|
3166
|
-
function
|
|
3165
|
+
) : ae(H);
|
|
3166
|
+
function ae(V) {
|
|
3167
3167
|
return Ke;
|
|
3168
3168
|
function Ke(ve) {
|
|
3169
3169
|
const Re = ve !== null && V[ve], Ne = ve !== null && V.null, Ye = [
|
|
@@ -3176,7 +3176,7 @@ function Ds(e, n, t) {
|
|
|
3176
3176
|
}
|
|
3177
3177
|
}
|
|
3178
3178
|
function we(V) {
|
|
3179
|
-
return $ = V,
|
|
3179
|
+
return $ = V, oe = 0, V.length === 0 ? J : f(V[oe]);
|
|
3180
3180
|
}
|
|
3181
3181
|
function f(V) {
|
|
3182
3182
|
return Ke;
|
|
@@ -3196,7 +3196,7 @@ function Ds(e, n, t) {
|
|
|
3196
3196
|
return T(be, d), O;
|
|
3197
3197
|
}
|
|
3198
3198
|
function Te(V) {
|
|
3199
|
-
return d.restore(), ++
|
|
3199
|
+
return d.restore(), ++oe < $.length ? f($[oe]) : J;
|
|
3200
3200
|
}
|
|
3201
3201
|
}
|
|
3202
3202
|
}
|
|
@@ -3209,13 +3209,13 @@ function Ds(e, n, t) {
|
|
|
3209
3209
|
), T.resolveTo && (l.events = T.resolveTo(l.events, l));
|
|
3210
3210
|
}
|
|
3211
3211
|
function I() {
|
|
3212
|
-
const T = C(), A = l.previous, W = l.currentConstruct, H = l.events.length, O = Array.from(
|
|
3212
|
+
const T = C(), A = l.previous, W = l.currentConstruct, H = l.events.length, O = Array.from(a);
|
|
3213
3213
|
return {
|
|
3214
3214
|
restore: J,
|
|
3215
3215
|
from: H
|
|
3216
3216
|
};
|
|
3217
3217
|
function J() {
|
|
3218
|
-
r = T, l.previous = A, l.currentConstruct = W, l.events.length = H,
|
|
3218
|
+
r = T, l.previous = A, l.currentConstruct = W, l.events.length = H, a = O, g();
|
|
3219
3219
|
}
|
|
3220
3220
|
}
|
|
3221
3221
|
function g() {
|
|
@@ -3224,17 +3224,17 @@ function Ds(e, n, t) {
|
|
|
3224
3224
|
}
|
|
3225
3225
|
function Ps(e, n) {
|
|
3226
3226
|
const t = n.start._index, r = n.start._bufferIndex, s = n.end._index, i = n.end._bufferIndex;
|
|
3227
|
-
let
|
|
3227
|
+
let o;
|
|
3228
3228
|
if (t === s)
|
|
3229
|
-
|
|
3229
|
+
o = [e[t].slice(r, i)];
|
|
3230
3230
|
else {
|
|
3231
|
-
if (
|
|
3232
|
-
const
|
|
3233
|
-
typeof
|
|
3231
|
+
if (o = e.slice(t, s), r > -1) {
|
|
3232
|
+
const a = o[0];
|
|
3233
|
+
typeof a == "string" ? o[0] = a.slice(r) : o.shift();
|
|
3234
3234
|
}
|
|
3235
|
-
i > 0 &&
|
|
3235
|
+
i > 0 && o.push(e[s].slice(0, i));
|
|
3236
3236
|
}
|
|
3237
|
-
return
|
|
3237
|
+
return o;
|
|
3238
3238
|
}
|
|
3239
3239
|
function Us(e, n) {
|
|
3240
3240
|
let t = -1;
|
|
@@ -3242,38 +3242,38 @@ function Us(e, n) {
|
|
|
3242
3242
|
let s;
|
|
3243
3243
|
for (; ++t < e.length; ) {
|
|
3244
3244
|
const i = e[t];
|
|
3245
|
-
let
|
|
3245
|
+
let o;
|
|
3246
3246
|
if (typeof i == "string")
|
|
3247
|
-
|
|
3247
|
+
o = i;
|
|
3248
3248
|
else
|
|
3249
3249
|
switch (i) {
|
|
3250
3250
|
case -5: {
|
|
3251
|
-
|
|
3251
|
+
o = "\r";
|
|
3252
3252
|
break;
|
|
3253
3253
|
}
|
|
3254
3254
|
case -4: {
|
|
3255
|
-
|
|
3255
|
+
o = `
|
|
3256
3256
|
`;
|
|
3257
3257
|
break;
|
|
3258
3258
|
}
|
|
3259
3259
|
case -3: {
|
|
3260
|
-
|
|
3260
|
+
o = `\r
|
|
3261
3261
|
`;
|
|
3262
3262
|
break;
|
|
3263
3263
|
}
|
|
3264
3264
|
case -2: {
|
|
3265
|
-
|
|
3265
|
+
o = n ? " " : " ";
|
|
3266
3266
|
break;
|
|
3267
3267
|
}
|
|
3268
3268
|
case -1: {
|
|
3269
3269
|
if (!n && s) continue;
|
|
3270
|
-
|
|
3270
|
+
o = " ";
|
|
3271
3271
|
break;
|
|
3272
3272
|
}
|
|
3273
3273
|
default:
|
|
3274
|
-
|
|
3274
|
+
o = String.fromCharCode(i);
|
|
3275
3275
|
}
|
|
3276
|
-
s = i === -2, r.push(
|
|
3276
|
+
s = i === -2, r.push(o);
|
|
3277
3277
|
}
|
|
3278
3278
|
return r.join("");
|
|
3279
3279
|
}
|
|
@@ -3301,9 +3301,9 @@ const js = {
|
|
|
3301
3301
|
}, Xs = {
|
|
3302
3302
|
35: Vi,
|
|
3303
3303
|
42: rt,
|
|
3304
|
-
45: [
|
|
3304
|
+
45: [an, rt],
|
|
3305
3305
|
60: Yi,
|
|
3306
|
-
61:
|
|
3306
|
+
61: an,
|
|
3307
3307
|
95: rt,
|
|
3308
3308
|
96: sn,
|
|
3309
3309
|
126: sn
|
|
@@ -3317,7 +3317,7 @@ const js = {
|
|
|
3317
3317
|
33: bs,
|
|
3318
3318
|
38: tr,
|
|
3319
3319
|
42: Et,
|
|
3320
|
-
60: [yi,
|
|
3320
|
+
60: [yi, os],
|
|
3321
3321
|
91: xs,
|
|
3322
3322
|
92: [Gi, er],
|
|
3323
3323
|
93: Ot,
|
|
@@ -3357,9 +3357,9 @@ function Js(e) {
|
|
|
3357
3357
|
};
|
|
3358
3358
|
return r;
|
|
3359
3359
|
function s(i) {
|
|
3360
|
-
return
|
|
3361
|
-
function a
|
|
3362
|
-
return Ds(r, i,
|
|
3360
|
+
return o;
|
|
3361
|
+
function o(a) {
|
|
3362
|
+
return Ds(r, i, a);
|
|
3363
3363
|
}
|
|
3364
3364
|
}
|
|
3365
3365
|
}
|
|
@@ -3372,10 +3372,10 @@ const ln = /[\0\t\n\r]/g;
|
|
|
3372
3372
|
function Ys() {
|
|
3373
3373
|
let e = 1, n = "", t = !0, r;
|
|
3374
3374
|
return s;
|
|
3375
|
-
function s(i,
|
|
3375
|
+
function s(i, o, a) {
|
|
3376
3376
|
const u = [];
|
|
3377
3377
|
let l, c, p, m, h;
|
|
3378
|
-
for (i = n + (typeof i == "string" ? i.toString() : new TextDecoder(
|
|
3378
|
+
for (i = n + (typeof i == "string" ? i.toString() : new TextDecoder(o || void 0).decode(i)), p = 0, n = "", t && (i.charCodeAt(0) === 65279 && p++, t = void 0); p < i.length; ) {
|
|
3379
3379
|
if (ln.lastIndex = p, l = ln.exec(i), m = l && l.index !== void 0 ? l.index : i.length, h = i.charCodeAt(m), !l) {
|
|
3380
3380
|
n = i.slice(p);
|
|
3381
3381
|
break;
|
|
@@ -3401,14 +3401,14 @@ function Ys() {
|
|
|
3401
3401
|
}
|
|
3402
3402
|
p = m + 1;
|
|
3403
3403
|
}
|
|
3404
|
-
return
|
|
3404
|
+
return a && (r && u.push(-5), n && u.push(n), u.push(null)), u;
|
|
3405
3405
|
}
|
|
3406
3406
|
}
|
|
3407
|
-
const
|
|
3408
|
-
function
|
|
3409
|
-
return e.replace(
|
|
3407
|
+
const eo = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
|
|
3408
|
+
function to(e) {
|
|
3409
|
+
return e.replace(eo, no);
|
|
3410
3410
|
}
|
|
3411
|
-
function
|
|
3411
|
+
function no(e, n, t) {
|
|
3412
3412
|
if (n)
|
|
3413
3413
|
return n;
|
|
3414
3414
|
if (t.charCodeAt(0) === 35) {
|
|
@@ -3430,10 +3430,10 @@ function cn(e) {
|
|
|
3430
3430
|
return e && typeof e == "number" ? e : 1;
|
|
3431
3431
|
}
|
|
3432
3432
|
const lr = {}.hasOwnProperty;
|
|
3433
|
-
function
|
|
3434
|
-
return typeof n != "string" && (t = n, n = void 0),
|
|
3433
|
+
function ro(e, n, t) {
|
|
3434
|
+
return typeof n != "string" && (t = n, n = void 0), io(t)(Zs(Js(t).document().write(Ys()(e, n, !0))));
|
|
3435
3435
|
}
|
|
3436
|
-
function
|
|
3436
|
+
function io(e) {
|
|
3437
3437
|
const n = {
|
|
3438
3438
|
transforms: [],
|
|
3439
3439
|
canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
|
|
@@ -3446,26 +3446,26 @@ function ia(e) {
|
|
|
3446
3446
|
characterEscape: I,
|
|
3447
3447
|
characterReference: I,
|
|
3448
3448
|
codeFenced: i(Ye),
|
|
3449
|
-
codeFencedFenceInfo:
|
|
3450
|
-
codeFencedFenceMeta:
|
|
3451
|
-
codeIndented: i(Ye,
|
|
3452
|
-
codeText: i(br,
|
|
3449
|
+
codeFencedFenceInfo: o,
|
|
3450
|
+
codeFencedFenceMeta: o,
|
|
3451
|
+
codeIndented: i(Ye, o),
|
|
3452
|
+
codeText: i(br, o),
|
|
3453
3453
|
codeTextData: I,
|
|
3454
3454
|
data: I,
|
|
3455
3455
|
codeFlowValue: I,
|
|
3456
3456
|
definition: i(wr),
|
|
3457
|
-
definitionDestinationString:
|
|
3458
|
-
definitionLabelString:
|
|
3459
|
-
definitionTitleString:
|
|
3457
|
+
definitionDestinationString: o,
|
|
3458
|
+
definitionLabelString: o,
|
|
3459
|
+
definitionTitleString: o,
|
|
3460
3460
|
emphasis: i(xr),
|
|
3461
3461
|
hardBreakEscape: i(Wt),
|
|
3462
3462
|
hardBreakTrailing: i(Wt),
|
|
3463
|
-
htmlFlow: i(Xt,
|
|
3463
|
+
htmlFlow: i(Xt, o),
|
|
3464
3464
|
htmlFlowData: I,
|
|
3465
|
-
htmlText: i(Xt,
|
|
3465
|
+
htmlText: i(Xt, o),
|
|
3466
3466
|
htmlTextData: I,
|
|
3467
3467
|
image: i(yr),
|
|
3468
|
-
label:
|
|
3468
|
+
label: o,
|
|
3469
3469
|
link: i(Ht),
|
|
3470
3470
|
listItem: i(kr),
|
|
3471
3471
|
listItemValue: m,
|
|
@@ -3473,9 +3473,9 @@ function ia(e) {
|
|
|
3473
3473
|
listUnordered: i(Kt),
|
|
3474
3474
|
paragraph: i(zr),
|
|
3475
3475
|
reference: f,
|
|
3476
|
-
referenceString:
|
|
3477
|
-
resourceDestinationString:
|
|
3478
|
-
resourceTitleString:
|
|
3476
|
+
referenceString: o,
|
|
3477
|
+
resourceDestinationString: o,
|
|
3478
|
+
resourceTitleString: o,
|
|
3479
3479
|
setextHeading: i(qt),
|
|
3480
3480
|
strong: i(vr),
|
|
3481
3481
|
thematicBreak: i(Sr)
|
|
@@ -3514,7 +3514,7 @@ function ia(e) {
|
|
|
3514
3514
|
htmlTextData: g,
|
|
3515
3515
|
image: u($),
|
|
3516
3516
|
label: be,
|
|
3517
|
-
labelText:
|
|
3517
|
+
labelText: oe,
|
|
3518
3518
|
lineEnding: T,
|
|
3519
3519
|
link: u(J),
|
|
3520
3520
|
listItem: u(),
|
|
@@ -3523,7 +3523,7 @@ function ia(e) {
|
|
|
3523
3523
|
paragraph: u(),
|
|
3524
3524
|
referenceString: le,
|
|
3525
3525
|
resourceDestinationString: d,
|
|
3526
|
-
resourceTitleString:
|
|
3526
|
+
resourceTitleString: ae,
|
|
3527
3527
|
resource: we,
|
|
3528
3528
|
setextHeading: u(q),
|
|
3529
3529
|
setextHeadingLineSequence: L,
|
|
@@ -3544,9 +3544,9 @@ function ia(e) {
|
|
|
3544
3544
|
stack: [k],
|
|
3545
3545
|
tokenStack: [],
|
|
3546
3546
|
config: n,
|
|
3547
|
-
enter:
|
|
3547
|
+
enter: a,
|
|
3548
3548
|
exit: l,
|
|
3549
|
-
buffer:
|
|
3549
|
+
buffer: o,
|
|
3550
3550
|
resume: c,
|
|
3551
3551
|
data: t
|
|
3552
3552
|
}, M = [];
|
|
@@ -3637,16 +3637,16 @@ function ia(e) {
|
|
|
3637
3637
|
function i(w, k) {
|
|
3638
3638
|
return B;
|
|
3639
3639
|
function B(M) {
|
|
3640
|
-
|
|
3640
|
+
a.call(this, w(M), M), k && k.call(this, M);
|
|
3641
3641
|
}
|
|
3642
3642
|
}
|
|
3643
|
-
function
|
|
3643
|
+
function o() {
|
|
3644
3644
|
this.stack.push({
|
|
3645
3645
|
type: "fragment",
|
|
3646
3646
|
children: []
|
|
3647
3647
|
});
|
|
3648
3648
|
}
|
|
3649
|
-
function
|
|
3649
|
+
function a(w, k, B) {
|
|
3650
3650
|
this.stack[this.stack.length - 1].children.push(w), this.stack.push(w), this.tokenStack.push([k, B || void 0]), w.position = {
|
|
3651
3651
|
start: Ce(k.start),
|
|
3652
3652
|
// @ts-expect-error: `end` will be patched later.
|
|
@@ -3784,9 +3784,9 @@ function ia(e) {
|
|
|
3784
3784
|
delete w.identifier, delete w.label;
|
|
3785
3785
|
this.data.referenceType = void 0;
|
|
3786
3786
|
}
|
|
3787
|
-
function
|
|
3787
|
+
function oe(w) {
|
|
3788
3788
|
const k = this.sliceSerialize(w), B = this.stack[this.stack.length - 2];
|
|
3789
|
-
B.label =
|
|
3789
|
+
B.label = to(k), B.identifier = We(k).toLowerCase();
|
|
3790
3790
|
}
|
|
3791
3791
|
function be() {
|
|
3792
3792
|
const w = this.stack[this.stack.length - 1], k = this.resume(), B = this.stack[this.stack.length - 1];
|
|
@@ -3800,7 +3800,7 @@ function ia(e) {
|
|
|
3800
3800
|
const w = this.resume(), k = this.stack[this.stack.length - 1];
|
|
3801
3801
|
k.url = w;
|
|
3802
3802
|
}
|
|
3803
|
-
function
|
|
3803
|
+
function ae() {
|
|
3804
3804
|
const w = this.resume(), k = this.stack[this.stack.length - 1];
|
|
3805
3805
|
k.title = w;
|
|
3806
3806
|
}
|
|
@@ -3960,10 +3960,10 @@ function ur(e, n) {
|
|
|
3960
3960
|
let t = -1;
|
|
3961
3961
|
for (; ++t < n.length; ) {
|
|
3962
3962
|
const r = n[t];
|
|
3963
|
-
Array.isArray(r) ? ur(e, r) :
|
|
3963
|
+
Array.isArray(r) ? ur(e, r) : so(e, r);
|
|
3964
3964
|
}
|
|
3965
3965
|
}
|
|
3966
|
-
function
|
|
3966
|
+
function so(e, n) {
|
|
3967
3967
|
let t;
|
|
3968
3968
|
for (t in n)
|
|
3969
3969
|
if (lr.call(n, t))
|
|
@@ -3998,7 +3998,7 @@ function hn(e, n) {
|
|
|
3998
3998
|
end: n.end
|
|
3999
3999
|
}) + ") is still open");
|
|
4000
4000
|
}
|
|
4001
|
-
class
|
|
4001
|
+
class oo {
|
|
4002
4002
|
/**
|
|
4003
4003
|
* Create a new edit map.
|
|
4004
4004
|
*/
|
|
@@ -4014,7 +4014,7 @@ class aa {
|
|
|
4014
4014
|
* @returns {undefined}
|
|
4015
4015
|
*/
|
|
4016
4016
|
add(n, t, r) {
|
|
4017
|
-
|
|
4017
|
+
ao(this, n, t, r);
|
|
4018
4018
|
}
|
|
4019
4019
|
// To do: add this when moving to `micromark`.
|
|
4020
4020
|
// /**
|
|
@@ -4035,8 +4035,8 @@ class aa {
|
|
|
4035
4035
|
* @returns {undefined}
|
|
4036
4036
|
*/
|
|
4037
4037
|
consume(n) {
|
|
4038
|
-
if (this.map.sort(function(i,
|
|
4039
|
-
return i[0] -
|
|
4038
|
+
if (this.map.sort(function(i, o) {
|
|
4039
|
+
return i[0] - o[0];
|
|
4040
4040
|
}), this.map.length === 0)
|
|
4041
4041
|
return;
|
|
4042
4042
|
let t = this.map.length;
|
|
@@ -4050,7 +4050,7 @@ class aa {
|
|
|
4050
4050
|
this.map.length = 0;
|
|
4051
4051
|
}
|
|
4052
4052
|
}
|
|
4053
|
-
function
|
|
4053
|
+
function ao(e, n, t, r) {
|
|
4054
4054
|
let s = 0;
|
|
4055
4055
|
if (!(t === 0 && r.length === 0)) {
|
|
4056
4056
|
for (; s < e.map.length; ) {
|
|
@@ -4063,7 +4063,7 @@ function oa(e, n, t, r) {
|
|
|
4063
4063
|
e.map.push([n, t, r]);
|
|
4064
4064
|
}
|
|
4065
4065
|
}
|
|
4066
|
-
function
|
|
4066
|
+
function lo(e, n) {
|
|
4067
4067
|
let t = !1;
|
|
4068
4068
|
const r = [];
|
|
4069
4069
|
for (; n < e.length; ) {
|
|
@@ -4083,22 +4083,22 @@ function la(e, n) {
|
|
|
4083
4083
|
}
|
|
4084
4084
|
return r;
|
|
4085
4085
|
}
|
|
4086
|
-
function
|
|
4086
|
+
function uo() {
|
|
4087
4087
|
return {
|
|
4088
4088
|
flow: {
|
|
4089
4089
|
null: {
|
|
4090
4090
|
name: "table",
|
|
4091
|
-
tokenize:
|
|
4092
|
-
resolveAll:
|
|
4091
|
+
tokenize: co,
|
|
4092
|
+
resolveAll: ho
|
|
4093
4093
|
}
|
|
4094
4094
|
}
|
|
4095
4095
|
};
|
|
4096
4096
|
}
|
|
4097
|
-
function
|
|
4097
|
+
function co(e, n, t) {
|
|
4098
4098
|
const r = this;
|
|
4099
|
-
let s = 0, i = 0,
|
|
4100
|
-
return
|
|
4101
|
-
function
|
|
4099
|
+
let s = 0, i = 0, o;
|
|
4100
|
+
return a;
|
|
4101
|
+
function a(g) {
|
|
4102
4102
|
let T = r.events.length - 1;
|
|
4103
4103
|
for (; T > -1; ) {
|
|
4104
4104
|
const H = r.events[T][1].type;
|
|
@@ -4113,10 +4113,10 @@ function ca(e, n, t) {
|
|
|
4113
4113
|
return e.enter("tableHead"), e.enter("tableRow"), l(g);
|
|
4114
4114
|
}
|
|
4115
4115
|
function l(g) {
|
|
4116
|
-
return g === 124 || (
|
|
4116
|
+
return g === 124 || (o = !0, i += 1), c(g);
|
|
4117
4117
|
}
|
|
4118
4118
|
function c(g) {
|
|
4119
|
-
return g === null ? t(g) : E(g) ? i > 1 ? (i = 0, r.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(g), e.exit("lineEnding"), h) : t(g) : F(g) ? R(e, c, "whitespace")(g) : (i += 1,
|
|
4119
|
+
return g === null ? t(g) : E(g) ? i > 1 ? (i = 0, r.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(g), e.exit("lineEnding"), h) : t(g) : F(g) ? R(e, c, "whitespace")(g) : (i += 1, o && (o = !1, s += 1), g === 124 ? (e.enter("tableCellDivider"), e.consume(g), e.exit("tableCellDivider"), o = !0, c) : (e.enter("data"), p(g)));
|
|
4120
4120
|
}
|
|
4121
4121
|
function p(g) {
|
|
4122
4122
|
return g === null || g === 124 || Z(g) ? (e.exit("data"), c(g)) : (e.consume(g), g === 92 ? m : p);
|
|
@@ -4125,28 +4125,28 @@ function ca(e, n, t) {
|
|
|
4125
4125
|
return g === 92 || g === 124 ? (e.consume(g), p) : p(g);
|
|
4126
4126
|
}
|
|
4127
4127
|
function h(g) {
|
|
4128
|
-
return r.interrupt = !1, r.parser.lazy[r.now().line] ? t(g) : (e.enter("tableDelimiterRow"),
|
|
4128
|
+
return r.interrupt = !1, r.parser.lazy[r.now().line] ? t(g) : (e.enter("tableDelimiterRow"), o = !1, F(g) ? R(e, C, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(g) : C(g));
|
|
4129
4129
|
}
|
|
4130
4130
|
function C(g) {
|
|
4131
|
-
return g === 45 || g === 58 ? P(g) : g === 124 ? (
|
|
4131
|
+
return g === 45 || g === 58 ? P(g) : g === 124 ? (o = !0, e.enter("tableCellDivider"), e.consume(g), e.exit("tableCellDivider"), S) : D(g);
|
|
4132
4132
|
}
|
|
4133
4133
|
function S(g) {
|
|
4134
4134
|
return F(g) ? R(e, P, "whitespace")(g) : P(g);
|
|
4135
4135
|
}
|
|
4136
4136
|
function P(g) {
|
|
4137
|
-
return g === 58 ? (i += 1,
|
|
4137
|
+
return g === 58 ? (i += 1, o = !0, e.enter("tableDelimiterMarker"), e.consume(g), e.exit("tableDelimiterMarker"), z) : g === 45 ? (i += 1, z(g)) : g === null || E(g) ? U(g) : D(g);
|
|
4138
4138
|
}
|
|
4139
4139
|
function z(g) {
|
|
4140
4140
|
return g === 45 ? (e.enter("tableDelimiterFiller"), v(g)) : D(g);
|
|
4141
4141
|
}
|
|
4142
4142
|
function v(g) {
|
|
4143
|
-
return g === 45 ? (e.consume(g), v) : g === 58 ? (
|
|
4143
|
+
return g === 45 ? (e.consume(g), v) : g === 58 ? (o = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(g), e.exit("tableDelimiterMarker"), _) : (e.exit("tableDelimiterFiller"), _(g));
|
|
4144
4144
|
}
|
|
4145
4145
|
function _(g) {
|
|
4146
4146
|
return F(g) ? R(e, U, "whitespace")(g) : U(g);
|
|
4147
4147
|
}
|
|
4148
4148
|
function U(g) {
|
|
4149
|
-
return g === 124 ? C(g) : g === null || E(g) ? !
|
|
4149
|
+
return g === 124 ? C(g) : g === null || E(g) ? !o || s !== i ? D(g) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), n(g)) : D(g);
|
|
4150
4150
|
}
|
|
4151
4151
|
function D(g) {
|
|
4152
4152
|
return t(g);
|
|
@@ -4164,41 +4164,41 @@ function ca(e, n, t) {
|
|
|
4164
4164
|
return g === 92 || g === 124 ? (e.consume(g), q) : q(g);
|
|
4165
4165
|
}
|
|
4166
4166
|
}
|
|
4167
|
-
function
|
|
4168
|
-
let t = -1, r = !0, s = 0, i = [0, 0, 0, 0],
|
|
4169
|
-
const m = new
|
|
4167
|
+
function ho(e, n) {
|
|
4168
|
+
let t = -1, r = !0, s = 0, i = [0, 0, 0, 0], o = [0, 0, 0, 0], a = !1, u = 0, l, c, p;
|
|
4169
|
+
const m = new oo();
|
|
4170
4170
|
for (; ++t < e.length; ) {
|
|
4171
4171
|
const h = e[t], C = h[1];
|
|
4172
|
-
h[0] === "enter" ? C.type === "tableHead" ? (
|
|
4172
|
+
h[0] === "enter" ? C.type === "tableHead" ? (a = !1, u !== 0 && (dn(m, n, u, l, c), c = void 0, u = 0), l = {
|
|
4173
4173
|
type: "table",
|
|
4174
4174
|
start: Object.assign({}, C.start),
|
|
4175
4175
|
// Note: correct end is set later.
|
|
4176
4176
|
end: Object.assign({}, C.end)
|
|
4177
|
-
}, m.add(t, 0, [["enter", l, n]])) : C.type === "tableRow" || C.type === "tableDelimiterRow" ? (r = !0, p = void 0, i = [0, 0, 0, 0],
|
|
4177
|
+
}, m.add(t, 0, [["enter", l, n]])) : C.type === "tableRow" || C.type === "tableDelimiterRow" ? (r = !0, p = void 0, i = [0, 0, 0, 0], o = [0, t + 1, 0, 0], a && (a = !1, c = {
|
|
4178
4178
|
type: "tableBody",
|
|
4179
4179
|
start: Object.assign({}, C.start),
|
|
4180
4180
|
// Note: correct end is set later.
|
|
4181
4181
|
end: Object.assign({}, C.end)
|
|
4182
|
-
}, m.add(t, 0, [["enter", c, n]])), s = C.type === "tableDelimiterRow" ? 2 : c ? 3 : 1) : s && (C.type === "data" || C.type === "tableDelimiterMarker" || C.type === "tableDelimiterFiller") ? (r = !1,
|
|
4182
|
+
}, m.add(t, 0, [["enter", c, n]])), s = C.type === "tableDelimiterRow" ? 2 : c ? 3 : 1) : s && (C.type === "data" || C.type === "tableDelimiterMarker" || C.type === "tableDelimiterFiller") ? (r = !1, o[2] === 0 && (i[1] !== 0 && (o[0] = o[1], p = tt(m, n, i, s, void 0, p), i = [0, 0, 0, 0]), o[2] = t)) : C.type === "tableCellDivider" && (r ? r = !1 : (i[1] !== 0 && (o[0] = o[1], p = tt(m, n, i, s, void 0, p)), i = o, o = [i[1], t, 0, 0])) : C.type === "tableHead" ? (a = !0, u = t) : C.type === "tableRow" || C.type === "tableDelimiterRow" ? (u = t, i[1] !== 0 ? (o[0] = o[1], p = tt(m, n, i, s, t, p)) : o[1] !== 0 && (p = tt(m, n, o, s, t, p)), s = 0) : s && (C.type === "data" || C.type === "tableDelimiterMarker" || C.type === "tableDelimiterFiller") && (o[3] = t);
|
|
4183
4183
|
}
|
|
4184
4184
|
for (u !== 0 && dn(m, n, u, l, c), m.consume(n.events), t = -1; ++t < n.events.length; ) {
|
|
4185
4185
|
const h = n.events[t];
|
|
4186
|
-
h[0] === "enter" && h[1].type === "table" && (h[1]._align =
|
|
4186
|
+
h[0] === "enter" && h[1].type === "table" && (h[1]._align = lo(n.events, t));
|
|
4187
4187
|
}
|
|
4188
4188
|
return e;
|
|
4189
4189
|
}
|
|
4190
4190
|
function tt(e, n, t, r, s, i) {
|
|
4191
|
-
const
|
|
4191
|
+
const o = r === 1 ? "tableHeader" : r === 2 ? "tableDelimiter" : "tableData", a = "tableContent";
|
|
4192
4192
|
t[0] !== 0 && (i.end = Object.assign({}, je(n.events, t[0])), e.add(t[0], 0, [["exit", i, n]]));
|
|
4193
4193
|
const u = je(n.events, t[1]);
|
|
4194
4194
|
if (i = {
|
|
4195
|
-
type:
|
|
4195
|
+
type: o,
|
|
4196
4196
|
start: Object.assign({}, u),
|
|
4197
4197
|
// Note: correct end is set later.
|
|
4198
4198
|
end: Object.assign({}, u)
|
|
4199
4199
|
}, e.add(t[1], 0, [["enter", i, n]]), t[2] !== 0) {
|
|
4200
4200
|
const l = je(n.events, t[2]), c = je(n.events, t[3]), p = {
|
|
4201
|
-
type:
|
|
4201
|
+
type: a,
|
|
4202
4202
|
start: Object.assign({}, l),
|
|
4203
4203
|
end: Object.assign({}, c)
|
|
4204
4204
|
};
|
|
@@ -4214,31 +4214,31 @@ function tt(e, n, t, r, s, i) {
|
|
|
4214
4214
|
return s !== void 0 && (i.end = Object.assign({}, je(n.events, s)), e.add(s, 0, [["exit", i, n]]), i = void 0), i;
|
|
4215
4215
|
}
|
|
4216
4216
|
function dn(e, n, t, r, s) {
|
|
4217
|
-
const i = [],
|
|
4218
|
-
s && (s.end = Object.assign({},
|
|
4217
|
+
const i = [], o = je(n.events, t);
|
|
4218
|
+
s && (s.end = Object.assign({}, o), i.push(["exit", s, n])), r.end = Object.assign({}, o), i.push(["exit", r, n]), e.add(t + 1, 0, i);
|
|
4219
4219
|
}
|
|
4220
4220
|
function je(e, n) {
|
|
4221
4221
|
const t = e[n], r = t[0] === "enter" ? "start" : "end";
|
|
4222
4222
|
return t[1][r];
|
|
4223
4223
|
}
|
|
4224
|
-
function
|
|
4224
|
+
function po() {
|
|
4225
4225
|
return {
|
|
4226
4226
|
enter: {
|
|
4227
|
-
table:
|
|
4227
|
+
table: fo,
|
|
4228
4228
|
tableData: pn,
|
|
4229
4229
|
tableHeader: pn,
|
|
4230
|
-
tableRow:
|
|
4230
|
+
tableRow: go
|
|
4231
4231
|
},
|
|
4232
4232
|
exit: {
|
|
4233
|
-
codeText:
|
|
4234
|
-
table:
|
|
4233
|
+
codeText: bo,
|
|
4234
|
+
table: mo,
|
|
4235
4235
|
tableData: xt,
|
|
4236
4236
|
tableHeader: xt,
|
|
4237
4237
|
tableRow: xt
|
|
4238
4238
|
}
|
|
4239
4239
|
};
|
|
4240
4240
|
}
|
|
4241
|
-
function
|
|
4241
|
+
function fo(e) {
|
|
4242
4242
|
const n = e._align;
|
|
4243
4243
|
this.enter(
|
|
4244
4244
|
{
|
|
@@ -4251,10 +4251,10 @@ function pa(e) {
|
|
|
4251
4251
|
e
|
|
4252
4252
|
), this.data.inTable = !0;
|
|
4253
4253
|
}
|
|
4254
|
-
function
|
|
4254
|
+
function mo(e) {
|
|
4255
4255
|
this.exit(e), this.data.inTable = void 0;
|
|
4256
4256
|
}
|
|
4257
|
-
function
|
|
4257
|
+
function go(e) {
|
|
4258
4258
|
this.enter({ type: "tableRow", children: [] }, e);
|
|
4259
4259
|
}
|
|
4260
4260
|
function xt(e) {
|
|
@@ -4263,13 +4263,13 @@ function xt(e) {
|
|
|
4263
4263
|
function pn(e) {
|
|
4264
4264
|
this.enter({ type: "tableCell", children: [] }, e);
|
|
4265
4265
|
}
|
|
4266
|
-
function
|
|
4266
|
+
function bo(e) {
|
|
4267
4267
|
let n = this.resume();
|
|
4268
|
-
this.data.inTable && (n = n.replace(/\\([\\|])/g,
|
|
4268
|
+
this.data.inTable && (n = n.replace(/\\([\\|])/g, wo));
|
|
4269
4269
|
const t = this.stack[this.stack.length - 1];
|
|
4270
4270
|
t.type, t.value = n, this.exit(e);
|
|
4271
4271
|
}
|
|
4272
|
-
function
|
|
4272
|
+
function wo(e, n) {
|
|
4273
4273
|
return n === "|" ? n : e;
|
|
4274
4274
|
}
|
|
4275
4275
|
class cr {
|
|
@@ -4282,7 +4282,7 @@ class cr {
|
|
|
4282
4282
|
this.node = /* @__PURE__ */ b("pre", null, this.codeNode = /* @__PURE__ */ b("code", null)), this.updateCodeAsync(n, t, this._ct = new ze());
|
|
4283
4283
|
}
|
|
4284
4284
|
async updateCodeAsync(n, t, r) {
|
|
4285
|
-
const s =
|
|
4285
|
+
const s = yo(n);
|
|
4286
4286
|
if (s) {
|
|
4287
4287
|
if (await s.promise, r.isCancellationRequested) return;
|
|
4288
4288
|
this._language = n, this._code = t, this.codeNode.innerHTML = ke.result.default.highlight(t, {
|
|
@@ -4296,14 +4296,14 @@ class cr {
|
|
|
4296
4296
|
}
|
|
4297
4297
|
}
|
|
4298
4298
|
let ke;
|
|
4299
|
-
function
|
|
4299
|
+
function xo() {
|
|
4300
4300
|
return ke || (ke = { promise: import("./core-CdG-ENX3.js") }, ke.promise.then((e) => ke.result = e).catch((e) => ke.error = e), ke);
|
|
4301
4301
|
}
|
|
4302
4302
|
const fn = {};
|
|
4303
|
-
function
|
|
4303
|
+
function yo(e) {
|
|
4304
4304
|
let n = fn[e];
|
|
4305
4305
|
if (n) return n;
|
|
4306
|
-
|
|
4306
|
+
xo();
|
|
4307
4307
|
let t;
|
|
4308
4308
|
switch (e) {
|
|
4309
4309
|
case "javascript":
|
|
@@ -4331,29 +4331,29 @@ function xa(e) {
|
|
|
4331
4331
|
})()
|
|
4332
4332
|
}, fn[e] = n, n.promise.then((r) => n.result = r).catch((r) => n.error = r), n;
|
|
4333
4333
|
}
|
|
4334
|
-
function
|
|
4334
|
+
function ko(e, n) {
|
|
4335
4335
|
console.debug("getImageFromPyodide", n);
|
|
4336
4336
|
var t = e.FS.readFile(n, { encoding: "binary" });
|
|
4337
4337
|
const r = new Blob([t], { type: "image/png" });
|
|
4338
4338
|
return URL.createObjectURL(r);
|
|
4339
4339
|
}
|
|
4340
|
-
const
|
|
4341
|
-
tokenize:
|
|
4340
|
+
const zo = {
|
|
4341
|
+
tokenize: vo,
|
|
4342
4342
|
concrete: !0,
|
|
4343
4343
|
name: "mathFlow"
|
|
4344
4344
|
}, mn = {
|
|
4345
|
-
tokenize:
|
|
4345
|
+
tokenize: Co,
|
|
4346
4346
|
partial: !0
|
|
4347
4347
|
};
|
|
4348
|
-
function
|
|
4348
|
+
function vo(e, n, t) {
|
|
4349
4349
|
const r = this, s = r.events[r.events.length - 1], i = s && s[1].type === "linePrefix" ? s[2].sliceSerialize(s[1], !0).length : 0;
|
|
4350
|
-
let
|
|
4351
|
-
return
|
|
4352
|
-
function
|
|
4350
|
+
let o = 0;
|
|
4351
|
+
return a;
|
|
4352
|
+
function a(v) {
|
|
4353
4353
|
return e.enter("mathFlow"), e.enter("mathFlowFence"), e.enter("mathFlowFenceSequence"), u(v);
|
|
4354
4354
|
}
|
|
4355
4355
|
function u(v) {
|
|
4356
|
-
return v === 36 ? (e.consume(v),
|
|
4356
|
+
return v === 36 ? (e.consume(v), o++, u) : o < 2 ? t(v) : (e.exit("mathFlowFenceSequence"), R(e, l, "whitespace")(v));
|
|
4357
4357
|
}
|
|
4358
4358
|
function l(v) {
|
|
4359
4359
|
return v === null || E(v) ? p(v) : (e.enter("mathFlowFenceMeta"), e.enter("chunkString", {
|
|
@@ -4391,52 +4391,52 @@ function za(e, n, t) {
|
|
|
4391
4391
|
return v.enter("mathFlowFence"), v.enter("mathFlowFenceSequence"), L(I);
|
|
4392
4392
|
}
|
|
4393
4393
|
function L(I) {
|
|
4394
|
-
return I === 36 ? (D++, v.consume(I), L) : D <
|
|
4394
|
+
return I === 36 ? (D++, v.consume(I), L) : D < o ? U(I) : (v.exit("mathFlowFenceSequence"), R(v, q, "whitespace")(I));
|
|
4395
4395
|
}
|
|
4396
4396
|
function q(I) {
|
|
4397
4397
|
return I === null || E(I) ? (v.exit("mathFlowFence"), _(I)) : U(I);
|
|
4398
4398
|
}
|
|
4399
4399
|
}
|
|
4400
4400
|
}
|
|
4401
|
-
function
|
|
4401
|
+
function Co(e, n, t) {
|
|
4402
4402
|
const r = this;
|
|
4403
4403
|
return s;
|
|
4404
|
-
function s(
|
|
4405
|
-
return
|
|
4404
|
+
function s(o) {
|
|
4405
|
+
return o === null ? n(o) : (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), i);
|
|
4406
4406
|
}
|
|
4407
|
-
function i(
|
|
4408
|
-
return r.parser.lazy[r.now().line] ? t(
|
|
4407
|
+
function i(o) {
|
|
4408
|
+
return r.parser.lazy[r.now().line] ? t(o) : n(o);
|
|
4409
4409
|
}
|
|
4410
4410
|
}
|
|
4411
|
-
function
|
|
4411
|
+
function So(e) {
|
|
4412
4412
|
let t = {}.singleDollarTextMath;
|
|
4413
4413
|
return t == null && (t = !0), {
|
|
4414
4414
|
tokenize: r,
|
|
4415
|
-
resolve:
|
|
4416
|
-
previous:
|
|
4415
|
+
resolve: _o,
|
|
4416
|
+
previous: Eo,
|
|
4417
4417
|
name: "mathText"
|
|
4418
4418
|
};
|
|
4419
|
-
function r(s, i,
|
|
4420
|
-
let
|
|
4419
|
+
function r(s, i, o) {
|
|
4420
|
+
let a = 0, u, l;
|
|
4421
4421
|
return c;
|
|
4422
4422
|
function c(S) {
|
|
4423
4423
|
return s.enter("mathText"), s.enter("mathTextSequence"), p(S);
|
|
4424
4424
|
}
|
|
4425
4425
|
function p(S) {
|
|
4426
|
-
return S === 36 ? (s.consume(S),
|
|
4426
|
+
return S === 36 ? (s.consume(S), a++, p) : a < 2 && !t ? o(S) : (s.exit("mathTextSequence"), m(S));
|
|
4427
4427
|
}
|
|
4428
4428
|
function m(S) {
|
|
4429
|
-
return S === null ?
|
|
4429
|
+
return S === null ? o(S) : S === 36 ? (l = s.enter("mathTextSequence"), u = 0, C(S)) : S === 32 ? (s.enter("space"), s.consume(S), s.exit("space"), m) : E(S) ? (s.enter("lineEnding"), s.consume(S), s.exit("lineEnding"), m) : (s.enter("mathTextData"), h(S));
|
|
4430
4430
|
}
|
|
4431
4431
|
function h(S) {
|
|
4432
4432
|
return S === null || S === 32 || S === 36 || E(S) ? (s.exit("mathTextData"), m(S)) : (s.consume(S), h);
|
|
4433
4433
|
}
|
|
4434
4434
|
function C(S) {
|
|
4435
|
-
return S === 36 ? (s.consume(S), u++, C) : u ===
|
|
4435
|
+
return S === 36 ? (s.consume(S), u++, C) : u === a ? (s.exit("mathTextSequence"), s.exit("mathText"), i(S)) : (l.type = "mathTextData", h(S));
|
|
4436
4436
|
}
|
|
4437
4437
|
}
|
|
4438
4438
|
}
|
|
4439
|
-
function
|
|
4439
|
+
function _o(e) {
|
|
4440
4440
|
let n = e.length - 4, t = 3, r, s;
|
|
4441
4441
|
if ((e[t][1].type === "lineEnding" || e[t][1].type === "space") && (e[n][1].type === "lineEnding" || e[n][1].type === "space")) {
|
|
4442
4442
|
for (r = t; ++r < n; )
|
|
@@ -4449,20 +4449,20 @@ function Sa(e) {
|
|
|
4449
4449
|
s === void 0 ? r !== n && e[r][1].type !== "lineEnding" && (s = r) : (r === n || e[r][1].type === "lineEnding") && (e[s][1].type = "mathTextData", r !== s + 2 && (e[s][1].end = e[r - 1][1].end, e.splice(s + 2, r - s - 2), n -= r - s - 2, r = s + 2), s = void 0);
|
|
4450
4450
|
return e;
|
|
4451
4451
|
}
|
|
4452
|
-
function
|
|
4452
|
+
function Eo(e) {
|
|
4453
4453
|
return e !== 36 || this.events[this.events.length - 1][1].type === "characterEscape";
|
|
4454
4454
|
}
|
|
4455
|
-
function
|
|
4455
|
+
function To(e) {
|
|
4456
4456
|
return {
|
|
4457
4457
|
flow: {
|
|
4458
|
-
36:
|
|
4458
|
+
36: zo
|
|
4459
4459
|
},
|
|
4460
4460
|
text: {
|
|
4461
|
-
36:
|
|
4461
|
+
36: So()
|
|
4462
4462
|
}
|
|
4463
4463
|
};
|
|
4464
4464
|
}
|
|
4465
|
-
function
|
|
4465
|
+
function Ao() {
|
|
4466
4466
|
return {
|
|
4467
4467
|
enter: {
|
|
4468
4468
|
mathFlow: e,
|
|
@@ -4473,9 +4473,9 @@ function Ta() {
|
|
|
4473
4473
|
mathFlow: s,
|
|
4474
4474
|
mathFlowFence: r,
|
|
4475
4475
|
mathFlowFenceMeta: t,
|
|
4476
|
-
mathFlowValue:
|
|
4477
|
-
mathText:
|
|
4478
|
-
mathTextData:
|
|
4476
|
+
mathFlowValue: a,
|
|
4477
|
+
mathText: o,
|
|
4478
|
+
mathTextData: a
|
|
4479
4479
|
}
|
|
4480
4480
|
};
|
|
4481
4481
|
function e(u) {
|
|
@@ -4528,28 +4528,28 @@ function Ta() {
|
|
|
4528
4528
|
u
|
|
4529
4529
|
), this.buffer();
|
|
4530
4530
|
}
|
|
4531
|
-
function
|
|
4531
|
+
function o(u) {
|
|
4532
4532
|
const l = this.resume(), c = this.stack[this.stack.length - 1];
|
|
4533
4533
|
c.type, this.exit(u), c.value = l, /** @type {Array<HastElementContent>} */
|
|
4534
4534
|
// @ts-expect-error: we defined it in `enterMathFlow`.
|
|
4535
4535
|
c.data.hChildren.push({ type: "text", value: l });
|
|
4536
4536
|
}
|
|
4537
|
-
function
|
|
4537
|
+
function a(u) {
|
|
4538
4538
|
this.config.enter.data.call(this, u), this.config.exit.data.call(this, u);
|
|
4539
4539
|
}
|
|
4540
4540
|
}
|
|
4541
|
-
function
|
|
4541
|
+
function Bo(e) {
|
|
4542
4542
|
const n = /(```[\s\S]+?```|~~~[\s\S]+?~~~)/g, t = e.split(n), r = /\\\((.*?)\\\)/g, s = /\\\[([\s\S]*?)\\\]/g;
|
|
4543
4543
|
for (let i = 0; i < t.length; i++)
|
|
4544
|
-
i % 2 === 0 && (t[i] = t[i].replace(r, (
|
|
4544
|
+
i % 2 === 0 && (t[i] = t[i].replace(r, (o, a) => `$${a}$`).replace(s, (o, a) => `$$${a}$$`));
|
|
4545
4545
|
return t.join("");
|
|
4546
4546
|
}
|
|
4547
4547
|
function Dt(e, n, t, r) {
|
|
4548
|
-
const s =
|
|
4549
|
-
extensions: [
|
|
4550
|
-
mdastExtensions: [
|
|
4551
|
-
}), i = {},
|
|
4552
|
-
hr(s, i,
|
|
4548
|
+
const s = ro(Bo(n), {
|
|
4549
|
+
extensions: [uo(), To()],
|
|
4550
|
+
mdastExtensions: [po(), Ao(), ...r]
|
|
4551
|
+
}), i = {}, o = {};
|
|
4552
|
+
hr(s, i, o), At(s, e, i, o, t);
|
|
4553
4553
|
}
|
|
4554
4554
|
function hr(e, n, t) {
|
|
4555
4555
|
for (const r of e.children) {
|
|
@@ -4563,44 +4563,44 @@ function hr(e, n, t) {
|
|
|
4563
4563
|
}
|
|
4564
4564
|
}
|
|
4565
4565
|
function At(e, n, t, r, s) {
|
|
4566
|
-
var
|
|
4566
|
+
var o;
|
|
4567
4567
|
let i = n.firstChild;
|
|
4568
|
-
for (const
|
|
4568
|
+
for (const a of e.children) {
|
|
4569
4569
|
let u;
|
|
4570
|
-
switch (
|
|
4570
|
+
switch (a.type) {
|
|
4571
4571
|
// Literals
|
|
4572
4572
|
case "inlineMath": {
|
|
4573
|
-
if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "SPAN" &&
|
|
4573
|
+
if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "SPAN" && at.has(i))) {
|
|
4574
4574
|
for (; i; ) {
|
|
4575
4575
|
const c = i.nextSibling;
|
|
4576
4576
|
i.remove(), i = c;
|
|
4577
4577
|
}
|
|
4578
4578
|
i = document.createElement("span"), n.appendChild(i);
|
|
4579
4579
|
}
|
|
4580
|
-
gn(i,
|
|
4580
|
+
gn(i, a.value), i = i.nextSibling;
|
|
4581
4581
|
continue;
|
|
4582
4582
|
}
|
|
4583
4583
|
case "math": {
|
|
4584
|
-
if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "DIV" &&
|
|
4584
|
+
if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "DIV" && at.has(i))) {
|
|
4585
4585
|
for (; i; ) {
|
|
4586
4586
|
const c = i.nextSibling;
|
|
4587
4587
|
i.remove(), i = c;
|
|
4588
4588
|
}
|
|
4589
4589
|
i = document.createElement("div"), n.appendChild(i);
|
|
4590
4590
|
}
|
|
4591
|
-
gn(i,
|
|
4591
|
+
gn(i, a.value), i = i.nextSibling;
|
|
4592
4592
|
continue;
|
|
4593
4593
|
}
|
|
4594
4594
|
case "code": {
|
|
4595
4595
|
let c = bn.get(i);
|
|
4596
4596
|
if (c)
|
|
4597
|
-
c.updateCode(
|
|
4597
|
+
c.updateCode(a.lang, a.value);
|
|
4598
4598
|
else {
|
|
4599
4599
|
for (; i; ) {
|
|
4600
4600
|
const p = i.nextSibling;
|
|
4601
4601
|
i.remove(), i = p;
|
|
4602
4602
|
}
|
|
4603
|
-
c = new cr(
|
|
4603
|
+
c = new cr(a.lang, a.value), i = c.node, bn.set(i, c), n.appendChild(i);
|
|
4604
4604
|
}
|
|
4605
4605
|
i = i.nextSibling;
|
|
4606
4606
|
continue;
|
|
@@ -4613,7 +4613,7 @@ function At(e, n, t, r, s) {
|
|
|
4613
4613
|
}
|
|
4614
4614
|
i = document.createElement("span"), n.appendChild(i);
|
|
4615
4615
|
}
|
|
4616
|
-
i.innerHTML =
|
|
4616
|
+
i.innerHTML = a.value, i = i.nextSibling;
|
|
4617
4617
|
continue;
|
|
4618
4618
|
case "inlineCode":
|
|
4619
4619
|
if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === "CODE")) {
|
|
@@ -4623,7 +4623,7 @@ function At(e, n, t, r, s) {
|
|
|
4623
4623
|
}
|
|
4624
4624
|
i = document.createElement("code"), n.appendChild(i);
|
|
4625
4625
|
}
|
|
4626
|
-
i.textContent =
|
|
4626
|
+
i.textContent = a.value, i = i.nextSibling;
|
|
4627
4627
|
continue;
|
|
4628
4628
|
// case "text":
|
|
4629
4629
|
// let value = c.value,
|
|
@@ -4688,13 +4688,13 @@ function At(e, n, t, r, s) {
|
|
|
4688
4688
|
// continue;
|
|
4689
4689
|
case "text":
|
|
4690
4690
|
if ((i == null ? void 0 : i.nodeType) === Node.TEXT_NODE)
|
|
4691
|
-
i.nodeValue =
|
|
4691
|
+
i.nodeValue = a.value;
|
|
4692
4692
|
else {
|
|
4693
4693
|
for (; i; ) {
|
|
4694
4694
|
const c = i.nextSibling;
|
|
4695
4695
|
i.remove(), i = c;
|
|
4696
4696
|
}
|
|
4697
|
-
n.appendChild(i = document.createTextNode(
|
|
4697
|
+
n.appendChild(i = document.createTextNode(a.value));
|
|
4698
4698
|
}
|
|
4699
4699
|
i = i.nextSibling;
|
|
4700
4700
|
continue;
|
|
@@ -4730,18 +4730,18 @@ function At(e, n, t, r, s) {
|
|
|
4730
4730
|
}
|
|
4731
4731
|
i = document.createElement("img"), n.appendChild(i);
|
|
4732
4732
|
}
|
|
4733
|
-
const c =
|
|
4733
|
+
const c = a.url;
|
|
4734
4734
|
if (c)
|
|
4735
4735
|
if (c.startsWith("python://")) {
|
|
4736
4736
|
let p = c.substring(9);
|
|
4737
4737
|
try {
|
|
4738
|
-
i.src =
|
|
4738
|
+
i.src = ko(s, p);
|
|
4739
4739
|
} catch (m) {
|
|
4740
4740
|
console.error(m), i.src = "";
|
|
4741
4741
|
}
|
|
4742
4742
|
} else i.src = c;
|
|
4743
4743
|
else i.src = "";
|
|
4744
|
-
i.alt =
|
|
4744
|
+
i.alt = a.alt || "", i.title = a.title || "", i = i.nextSibling;
|
|
4745
4745
|
continue;
|
|
4746
4746
|
}
|
|
4747
4747
|
case "linkReference":
|
|
@@ -4753,14 +4753,14 @@ function At(e, n, t, r, s) {
|
|
|
4753
4753
|
i = document.createElement("a"), n.appendChild(i);
|
|
4754
4754
|
}
|
|
4755
4755
|
At(
|
|
4756
|
-
|
|
4756
|
+
a,
|
|
4757
4757
|
i,
|
|
4758
4758
|
t,
|
|
4759
4759
|
r,
|
|
4760
4760
|
s
|
|
4761
4761
|
);
|
|
4762
4762
|
let l;
|
|
4763
|
-
switch (
|
|
4763
|
+
switch (a.referenceType) {
|
|
4764
4764
|
case "shortcut":
|
|
4765
4765
|
l = t[i.textContent.toLowerCase()];
|
|
4766
4766
|
break;
|
|
@@ -4768,7 +4768,7 @@ function At(e, n, t, r, s) {
|
|
|
4768
4768
|
l = r[i.textContent.toLowerCase()] || t[i.textContent.toLowerCase()];
|
|
4769
4769
|
break;
|
|
4770
4770
|
case "full":
|
|
4771
|
-
l = r[(
|
|
4771
|
+
l = r[(o = a.identifier) == null ? void 0 : o.toLowerCase()];
|
|
4772
4772
|
break;
|
|
4773
4773
|
}
|
|
4774
4774
|
i.href = (l == null ? void 0 : l.url) || "", i.target = "_blank", i.title = (l == null ? void 0 : l.title) || "", i = i.nextSibling;
|
|
@@ -4790,13 +4790,13 @@ function At(e, n, t, r, s) {
|
|
|
4790
4790
|
u = "EM";
|
|
4791
4791
|
break;
|
|
4792
4792
|
case "heading":
|
|
4793
|
-
u = "H" +
|
|
4793
|
+
u = "H" + a.depth;
|
|
4794
4794
|
break;
|
|
4795
4795
|
case "link":
|
|
4796
4796
|
u = "A";
|
|
4797
4797
|
break;
|
|
4798
4798
|
case "list":
|
|
4799
|
-
u =
|
|
4799
|
+
u = a.ordered ? "OL" : "UL";
|
|
4800
4800
|
break;
|
|
4801
4801
|
case "listItem":
|
|
4802
4802
|
u = "LI";
|
|
@@ -4817,7 +4817,7 @@ function At(e, n, t, r, s) {
|
|
|
4817
4817
|
u = "TR";
|
|
4818
4818
|
break;
|
|
4819
4819
|
default:
|
|
4820
|
-
console.warn("Unknown MDAST node type: " +
|
|
4820
|
+
console.warn("Unknown MDAST node type: " + a.type);
|
|
4821
4821
|
continue;
|
|
4822
4822
|
}
|
|
4823
4823
|
if (!((i == null ? void 0 : i.nodeType) === Node.ELEMENT_NODE && i.nodeName === u)) {
|
|
@@ -4827,8 +4827,8 @@ function At(e, n, t, r, s) {
|
|
|
4827
4827
|
}
|
|
4828
4828
|
i = document.createElement(u), n.appendChild(i);
|
|
4829
4829
|
}
|
|
4830
|
-
u === "A" && (i.href =
|
|
4831
|
-
|
|
4830
|
+
u === "A" && (i.href = a.url || "", i.target = "_blank", i.title = a.title || ""), At(
|
|
4831
|
+
a,
|
|
4832
4832
|
i,
|
|
4833
4833
|
t,
|
|
4834
4834
|
r,
|
|
@@ -4836,47 +4836,47 @@ function At(e, n, t, r, s) {
|
|
|
4836
4836
|
), i = i.nextSibling;
|
|
4837
4837
|
}
|
|
4838
4838
|
for (; i; ) {
|
|
4839
|
-
const
|
|
4840
|
-
i.remove(), i =
|
|
4839
|
+
const a = i.nextSibling;
|
|
4840
|
+
i.remove(), i = a;
|
|
4841
4841
|
}
|
|
4842
4842
|
}
|
|
4843
4843
|
let yt;
|
|
4844
|
-
function
|
|
4844
|
+
function Io() {
|
|
4845
4845
|
return yt || (yt = import("./katex-c21813vb.js")), yt;
|
|
4846
4846
|
}
|
|
4847
4847
|
async function gn(e, n) {
|
|
4848
|
-
let t =
|
|
4849
|
-
t == null || t.cancel(),
|
|
4850
|
-
const r = await
|
|
4848
|
+
let t = at.get(e);
|
|
4849
|
+
t == null || t.cancel(), at.set(e, t = new ze()), (async () => {
|
|
4850
|
+
const r = await Io();
|
|
4851
4851
|
t.isCancellationRequested || r.default.render(n, e, { throwOnError: !1 });
|
|
4852
4852
|
})();
|
|
4853
4853
|
}
|
|
4854
|
-
const
|
|
4855
|
-
function
|
|
4854
|
+
const at = /* @__PURE__ */ new WeakMap(), bn = /* @__PURE__ */ new WeakMap();
|
|
4855
|
+
function Lo(e) {
|
|
4856
4856
|
const t = e.trim().replace(/[^\w\s]|_/g, "").replace(/\s+/g, " ").toUpperCase().split(" ");
|
|
4857
4857
|
if (t.length === 1 && t[0] === "")
|
|
4858
4858
|
return "?";
|
|
4859
4859
|
let r = t[0][0];
|
|
4860
4860
|
return t.length > 1 && (r += t[1][0]), r;
|
|
4861
4861
|
}
|
|
4862
|
-
function
|
|
4862
|
+
function Fo({ as: e = "div", size: n = "avatar-lg", id: t, ...r }, s) {
|
|
4863
4863
|
const i = /* @__PURE__ */ b(e, { ...r }, s);
|
|
4864
|
-
return e === "button" && !("type" in r) && (i.type = "button"), i.classList.add("avatar"), n && i.classList.add(n), t && i.classList.add(...
|
|
4865
|
-
}
|
|
4866
|
-
const
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4864
|
+
return e === "button" && !("type" in r) && (i.type = "button"), i.classList.add("avatar"), n && i.classList.add(n), t && i.classList.add(...jo(t)), i;
|
|
4865
|
+
}
|
|
4866
|
+
const Mo = ["bg-Land-Green-95", "text-Land-Green-30"], Ro = ["bg-Sunflower-85", "text-Sunflower-20"], No = ["bg-Energy-Red-95", "text-Energy-Red-45"], Oo = ["bg-Sea-Blue-Main-28", "text-Sky-Blue-95"], Do = ["bg-Lavender-90", "text-Lavender-50"], Po = ["bg-Eucalyptus-85", "text-Eucalyptus-20"], Uo = ["bg-Terracotta-85", "text-Terracotta-20"], wn = [
|
|
4867
|
+
Mo,
|
|
4868
|
+
Ro,
|
|
4869
|
+
No,
|
|
4870
|
+
Oo,
|
|
4871
|
+
Do,
|
|
4872
|
+
Po,
|
|
4873
|
+
Uo
|
|
4874
4874
|
];
|
|
4875
|
-
function
|
|
4876
|
-
const n =
|
|
4875
|
+
function jo(e) {
|
|
4876
|
+
const n = qo(e);
|
|
4877
4877
|
return wn[Math.floor(Math.abs(n % wn.length))];
|
|
4878
4878
|
}
|
|
4879
|
-
function
|
|
4879
|
+
function qo(e) {
|
|
4880
4880
|
let n = 0;
|
|
4881
4881
|
for (let t = 0; t < e.length; t++)
|
|
4882
4882
|
n = e.charCodeAt(t) + ((n << 5) - n);
|
|
@@ -4955,7 +4955,7 @@ function pt({
|
|
|
4955
4955
|
}
|
|
4956
4956
|
class ut {
|
|
4957
4957
|
}
|
|
4958
|
-
class
|
|
4958
|
+
class Wo extends ut {
|
|
4959
4959
|
constructor(t, r) {
|
|
4960
4960
|
super();
|
|
4961
4961
|
y(this, "node");
|
|
@@ -4981,9 +4981,9 @@ class qa extends ut {
|
|
|
4981
4981
|
break;
|
|
4982
4982
|
}
|
|
4983
4983
|
s.classList.add("shrink-0");
|
|
4984
|
-
for (const
|
|
4984
|
+
for (const o of r.buttons) this.buttons[o.value] = new Xo(this, o);
|
|
4985
4985
|
let i;
|
|
4986
|
-
this.node = /* @__PURE__ */ b("section", { class: "max-w-lg text-left my-2 bg-Sandstone-97 select-none border border-Light" }, /* @__PURE__ */ b("div", { class: "p-6 pb-3 flex gap-5" }, s, /* @__PURE__ */ b("div", null, /* @__PURE__ */ b("h6", null, r.title), i = /* @__PURE__ */ b("div", { class: "prose prose-sm prose-neutral" }))), this.buttonsFieldset = /* @__PURE__ */ b("fieldset", { class: "p-6 pt-3 flex justify-end gap-3" }, Object.values(this.buttons).map((
|
|
4986
|
+
this.node = /* @__PURE__ */ b("section", { class: "max-w-lg text-left my-2 bg-Sandstone-97 select-none border border-Light" }, /* @__PURE__ */ b("div", { class: "p-6 pb-3 flex gap-5" }, s, /* @__PURE__ */ b("div", null, /* @__PURE__ */ b("h6", null, r.title), i = /* @__PURE__ */ b("div", { class: "prose prose-sm prose-neutral" }))), this.buttonsFieldset = /* @__PURE__ */ b("fieldset", { class: "p-6 pt-3 flex justify-end gap-3" }, Object.values(this.buttons).map((o) => o.node))), Dt(
|
|
4987
4987
|
i,
|
|
4988
4988
|
r.textInMarkdown,
|
|
4989
4989
|
this.context.conversationMessage.chat.pyodide,
|
|
@@ -5002,14 +5002,14 @@ class qa extends ut {
|
|
|
5002
5002
|
for (const r in this.buttons) this.buttons[r].possiblyRemoveSpinner();
|
|
5003
5003
|
}
|
|
5004
5004
|
}
|
|
5005
|
-
class
|
|
5005
|
+
class Xo {
|
|
5006
5006
|
constructor(n, t) {
|
|
5007
5007
|
y(this, "node");
|
|
5008
5008
|
y(this, "_spinner");
|
|
5009
5009
|
this.dialog = n, this.buttonOption = t, this.node = /* @__PURE__ */ b(
|
|
5010
5010
|
Je,
|
|
5011
5011
|
{
|
|
5012
|
-
class:
|
|
5012
|
+
class: Ho(this.buttonOption.variant) + " min-w-24",
|
|
5013
5013
|
size: He.Medium,
|
|
5014
5014
|
onclick: () => this.onClickAsync()
|
|
5015
5015
|
},
|
|
@@ -5032,7 +5032,7 @@ class Wa {
|
|
|
5032
5032
|
(n = this._spinner) == null || n.remove();
|
|
5033
5033
|
}
|
|
5034
5034
|
}
|
|
5035
|
-
function
|
|
5035
|
+
function Ho(e) {
|
|
5036
5036
|
switch (e) {
|
|
5037
5037
|
case qe.Primary:
|
|
5038
5038
|
return de.Primary;
|
|
@@ -5046,7 +5046,7 @@ function Xa(e) {
|
|
|
5046
5046
|
return de.CTA;
|
|
5047
5047
|
}
|
|
5048
5048
|
}
|
|
5049
|
-
class
|
|
5049
|
+
class Ko {
|
|
5050
5050
|
constructor() {
|
|
5051
5051
|
y(this, "_dataByIndex", {});
|
|
5052
5052
|
}
|
|
@@ -5067,7 +5067,7 @@ class pr {
|
|
|
5067
5067
|
this.llmFunctionId = n, this.functionName = t, this.functionArguments = r;
|
|
5068
5068
|
}
|
|
5069
5069
|
}
|
|
5070
|
-
function
|
|
5070
|
+
function Go(e) {
|
|
5071
5071
|
const n = [];
|
|
5072
5072
|
let t = 0;
|
|
5073
5073
|
for (; t < e.length; )
|
|
@@ -5122,8 +5122,8 @@ function Ka(e) {
|
|
|
5122
5122
|
n.push(e[t]), t++;
|
|
5123
5123
|
return n.join("");
|
|
5124
5124
|
}
|
|
5125
|
-
function
|
|
5126
|
-
const n = [
|
|
5125
|
+
function $o(e) {
|
|
5126
|
+
const n = [...Vo(e)];
|
|
5127
5127
|
if (n.length) {
|
|
5128
5128
|
const r = n[n.length - 1];
|
|
5129
5129
|
r === "," ? n.pop() : r === ":" && n.push("undefined");
|
|
@@ -5143,7 +5143,7 @@ function Ga(e) {
|
|
|
5143
5143
|
t.pop() === "{" ? n.push("}") : n.push("]");
|
|
5144
5144
|
return JSON.parse(n.join(""));
|
|
5145
5145
|
}
|
|
5146
|
-
function*
|
|
5146
|
+
function* Vo(e) {
|
|
5147
5147
|
for (let n = 0; n < e.length; ++n) {
|
|
5148
5148
|
let t = e[n];
|
|
5149
5149
|
switch (t) {
|
|
@@ -5339,34 +5339,34 @@ class xn {
|
|
|
5339
5339
|
const t = this.context.conversationMessage.chat, r = [];
|
|
5340
5340
|
try {
|
|
5341
5341
|
await t.lazyInitializePyodideAsync(), t.pyodide.setStdout({
|
|
5342
|
-
batched: (
|
|
5343
|
-
const
|
|
5342
|
+
batched: (o) => {
|
|
5343
|
+
const a = o.split(`
|
|
5344
5344
|
`);
|
|
5345
5345
|
if (r.length) {
|
|
5346
5346
|
const u = r[r.length - 1];
|
|
5347
|
-
u.isStderr ? r.push(...
|
|
5348
|
-
} else r.push(...
|
|
5349
|
-
this.getOrAddStdoutNode().textContent +=
|
|
5347
|
+
u.isStderr ? r.push(...a.map((l) => ({ isStderr: !1, text: l }))) : (u.text += a.shift(), r.push(...a.map((l) => ({ isStderr: !1, text: l }))));
|
|
5348
|
+
} else r.push(...a.map((u) => ({ isStderr: !1, text: u })));
|
|
5349
|
+
this.getOrAddStdoutNode().textContent += o;
|
|
5350
5350
|
}
|
|
5351
5351
|
}), t.pyodide.setStderr({
|
|
5352
|
-
batched: (
|
|
5353
|
-
const
|
|
5352
|
+
batched: (o) => {
|
|
5353
|
+
const a = o.split(`
|
|
5354
5354
|
`);
|
|
5355
5355
|
if (r.length) {
|
|
5356
5356
|
const u = r[r.length - 1];
|
|
5357
|
-
u.isStderr ? (u.text +=
|
|
5358
|
-
} else r.push(...
|
|
5359
|
-
this.getOrAddStderrNode().textContent +=
|
|
5357
|
+
u.isStderr ? (u.text += a.shift(), r.push(...a.map((l) => ({ isStderr: !0, text: l })))) : r.push(...a.map((l) => ({ isStderr: !0, text: l })));
|
|
5358
|
+
} else r.push(...a.map((u) => ({ isStderr: !0, text: u })));
|
|
5359
|
+
this.getOrAddStderrNode().textContent += o;
|
|
5360
5360
|
}
|
|
5361
5361
|
});
|
|
5362
5362
|
const i = await t.runPythonCodeAsync(n);
|
|
5363
5363
|
var s = i === void 0 ? "None" : String(i);
|
|
5364
5364
|
} catch (i) {
|
|
5365
5365
|
this.setButtonError();
|
|
5366
|
-
const
|
|
5367
|
-
this.getOrAddErrorNode().textContent =
|
|
5366
|
+
const o = String(i);
|
|
5367
|
+
this.getOrAddErrorNode().textContent = o, console.error(i), await this.context.postResultAsync({
|
|
5368
5368
|
terminatedWithError: !0,
|
|
5369
|
-
error:
|
|
5369
|
+
error: o,
|
|
5370
5370
|
stdoutAndStderr: r
|
|
5371
5371
|
});
|
|
5372
5372
|
return;
|
|
@@ -5386,18 +5386,18 @@ function yn(e) {
|
|
|
5386
5386
|
if (n != -1 && e.substring(0, n).trim() == "{" && (e = '{"Code":' + e.substring(n + 5)), n = e.indexOf('"""'), n != -1) {
|
|
5387
5387
|
var t = e.lastIndexOf('"""');
|
|
5388
5388
|
if (n < t && e.substring(t + 3).trim() == "}") {
|
|
5389
|
-
var r =
|
|
5389
|
+
var r = Go(e.substring(n + 3, t - (n + 3))), s = e.substring(0, n) + JSON.stringify(r) + e.substring(t + 3);
|
|
5390
5390
|
e = s;
|
|
5391
5391
|
}
|
|
5392
5392
|
}
|
|
5393
5393
|
try {
|
|
5394
|
-
var i =
|
|
5394
|
+
var i = $o(e);
|
|
5395
5395
|
} catch {
|
|
5396
5396
|
return console.warn("Error parsing Python code arguments provided as JSON.", e), "";
|
|
5397
5397
|
}
|
|
5398
5398
|
return (i == null ? void 0 : i.Code) || (i == null ? void 0 : i.code) || "";
|
|
5399
5399
|
}
|
|
5400
|
-
class
|
|
5400
|
+
class Qo {
|
|
5401
5401
|
constructor(n, t) {
|
|
5402
5402
|
y(this, "node");
|
|
5403
5403
|
y(this, "_buttonNode");
|
|
@@ -5422,7 +5422,7 @@ class Va {
|
|
|
5422
5422
|
run(n) {
|
|
5423
5423
|
}
|
|
5424
5424
|
}
|
|
5425
|
-
class
|
|
5425
|
+
class Jo extends ut {
|
|
5426
5426
|
constructor(t, r) {
|
|
5427
5427
|
super();
|
|
5428
5428
|
y(this, "node");
|
|
@@ -5488,7 +5488,7 @@ function zt({ size: e = se.Medium, ...n }) {
|
|
|
5488
5488
|
"M12.6687 5.83304C12.6687 5.22006 12.6649 4.91019 12.6394 4.70413L12.6062 4.52542C12.4471 3.93179 12.0022 3.45922 11.4255 3.26272L11.3083 3.22757C11.0963 3.17075 10.8175 3.16507 9.99974 3.16507H8.0554C7.04558 3.16507 6.62456 3.17475 6.32982 3.26175L6.2097 3.30374C5.95005 3.41089 5.71908 3.57635 5.53392 3.78616L5.45677 3.87796C5.30475 4.0748 5.20336 4.33135 5.03392 4.91702L4.83763 5.6221L4.45677 7.01761C4.24829 7.78204 4.10326 8.31846 4.02318 8.73929C3.94374 9.15672 3.94298 9.39229 3.98119 9.56448L4.03587 9.75784C4.18618 10.1996 4.50043 10.5702 4.91771 10.7901L5.05052 10.8477C5.20009 10.9014 5.40751 10.9429 5.72533 10.9678C6.15231 11.0012 6.70771 11.002 7.49974 11.002C7.71076 11.002 7.90952 11.1018 8.0349 11.2715C8.14465 11.4201 8.18683 11.6067 8.15404 11.7862L8.13548 11.8623L7.34447 14.4326C7.01523 15.5033 7.71404 16.6081 8.81126 16.7813L11.5095 12.0606L11.5827 11.9405C11.8445 11.5461 12.2289 11.2561 12.6687 11.1094V5.83304ZM17.3318 8.33304C17.3318 8.97366 17.3364 9.43432 17.2615 9.82327L17.2234 9.98538C16.949 11.0094 16.1821 11.8233 15.1872 12.1621L14.9861 12.2237C14.5624 12.3372 14.0656 12.3321 13.3337 12.3321C13.0915 12.3321 12.8651 12.4453 12.7204 12.6348L12.6638 12.7198L9.74388 17.8301C9.61066 18.0631 9.35005 18.1935 9.08372 18.1602L8.70579 18.1123C6.75379 17.8682 5.49542 15.9213 6.07396 14.041L6.60033 12.3272C6.22861 12.3233 5.90377 12.3161 5.62083 12.294C5.18804 12.26 4.79914 12.1931 4.44701 12.0391L4.29857 11.9668C3.52688 11.5605 2.95919 10.8555 2.72533 10.0205L2.68333 9.85257C2.58769 9.42154 2.62379 8.97768 2.71654 8.49026C2.80865 8.00634 2.97082 7.41139 3.17357 6.668L3.55443 5.27249L3.74583 4.58011C3.9286 3.94171 4.10186 3.45682 4.40404 3.06546L4.53685 2.9053C4.85609 2.54372 5.25433 2.25896 5.70189 2.07425L5.93626 1.99222C6.49455 1.82612 7.15095 1.83499 8.0554 1.83499H12.6667C13.3558 1.83499 13.9128 1.83434 14.363 1.87112C14.8208 1.90854 15.2266 1.98789 15.6033 2.17972L15.821 2.30179C16.317 2.6059 16.7215 3.04226 16.987 3.56351L17.0535 3.70608C17.1977 4.04236 17.2629 4.40311 17.2956 4.80374C17.3324 5.25398 17.3318 5.81094 17.3318 6.50003V8.33304ZM13.9978 10.9961C14.3321 10.9901 14.5013 10.977 14.6413 10.9395L14.7585 10.9033C15.3353 10.7069 15.7801 10.2353 15.9392 9.64163L15.9724 9.46292C15.998 9.25682 16.0017 8.94657 16.0017 8.33304V6.50003C16.0017 5.78899 16.0008 5.29566 15.9695 4.91214C15.9464 4.6301 15.9086 4.44069 15.8572 4.2969L15.8015 4.16702C15.6475 3.86478 15.4133 3.6119 15.1257 3.43558L14.9997 3.36526C14.8418 3.28477 14.6302 3.228 14.2546 3.19729C14.0221 3.1783 13.7491 3.17109 13.4118 3.168C13.6267 3.47028 13.7914 3.81126 13.8904 4.18069L13.9275 4.34378C13.981 4.62163 13.9947 4.93582 13.9978 5.3262V10.9961Z"
|
|
5489
5489
|
), t.appendChild(r), t.classList.add("icon"), t;
|
|
5490
5490
|
}
|
|
5491
|
-
function
|
|
5491
|
+
function Zo({ size: e = se.Medium, ...n }) {
|
|
5492
5492
|
const t = K("svg");
|
|
5493
5493
|
t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("fill", "currentColor"), t.setAttribute("width", e), t.setAttribute("height", e), ie(t, n);
|
|
5494
5494
|
const r = K("path");
|
|
@@ -5497,8 +5497,9 @@ function Ja({ size: e = se.Medium, ...n }) {
|
|
|
5497
5497
|
"M18.1215 16.0003L24.5315 9.59034L25.8534 8.26846C26.0484 8.07346 26.0484 7.75659 25.8534 7.56159L24.439 6.14721C24.244 5.95221 23.9271 5.95221 23.7321 6.14721L16.0002 13.8791L8.26837 6.14659C8.07337 5.95159 7.75649 5.95159 7.56149 6.14659L6.14649 7.56096C5.95149 7.75596 5.95149 8.07284 6.14649 8.26784L13.879 16.0003L6.14649 23.7322C5.95149 23.9272 5.95149 24.2441 6.14649 24.4391L7.56087 25.8535C7.75587 26.0485 8.07274 26.0485 8.26774 25.8535L16.0002 18.1216L22.4102 24.5316L23.7321 25.8535C23.9271 26.0485 24.244 26.0485 24.439 25.8535L25.8534 24.4391C26.0484 24.2441 26.0484 23.9272 25.8534 23.7322L18.1215 16.0003Z"
|
|
5498
5498
|
), t.appendChild(r), t.classList.add("icon"), t;
|
|
5499
5499
|
}
|
|
5500
|
+
const Yo = ".dialog-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:10000;font-family:Gantari,sans-serif}.dialog-content{background:#fff;box-shadow:0 4px 20px #00000026;position:relative;max-width:600px;width:90%;max-height:90vh;overflow-y:auto}.dialog-close-button{position:absolute;top:16px;right:16px;background:transparent;border:none;cursor:pointer;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:background .1s ease-out;color:#2248aa}.dialog-close-button:hover{background:#f0f0f0}.dialog-header{padding:24px 24px 0;border-bottom:none}.dialog-body{padding:0 24px;display:flex;flex-direction:column;gap:20px}.dialog-footer{padding:0 24px 24px;border-top:none}.text-label-md{font-size:var(--text-lg, 1.5rem);font-weight:var(--font-weight-semibold, 600);color:#08122b;margin:0}.text-label-sm{font-size:var(--text-sm, .875rem);font-weight:var(--font-weight-normal, 400);color:#08122b;line-height:1.5}.feedback-suggestion-text{display:inline-block;padding:8px 16px;margin:4px 8px 4px 0;background:#d3eef8;border-radius:6px;cursor:pointer;transition:all .1s ease-out;font-size:var(--text-sm, .875rem);letter-spacing:.05rem;color:#2248aa}.feedback-suggestion-text:hover:not(.feedback-suggestion-text-active){background:#bce6f5;border-color:#17789b}.feedback-suggestion-text-active{background:#001333;color:#fff;border-color:#001333}.feedback-comment-text{width:100%;min-height:100px;padding:8px;border:2px solid hsl(40,3%,79%);font-family:Gantari,sans-serif;font-size:var(--text-sm, 1rem);font-weight:var(--font-weight-normal, 400);letter-spacing:.05rem;resize:none;box-sizing:border-box;transition:border-color .1s ease-out}.feedback-comment-text:focus{outline:none;border:4px solid hsl(218,100%,50%);box-shadow:0 0 0 2px #1e6ea71a}.feedback-comment-text::-moz-placeholder{color:#b5b3b0}.feedback-comment-text::placeholder{color:#b5b3b0}.btn-base{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;border-radius:0;display:inline-flex;height:auto;margin:0;outline:none;text-decoration:none;transition:background .1s ease-out,border-color .1s ease-out,color .1s ease-out,box-shadow .1s ease-out;white-space:nowrap;cursor:pointer;font-family:Gantari,sans-serif;font-size:var(--text-sm, .875rem);font-weight:var(--font-weight-medium, 500);justify-content:center}.btn-primary{background:#193680;color:#fff;border:1px solid hsl(223,67%,30%)}.btn-primary:disabled{background:#95adea;color:#fff;border-color:#0000;cursor:not-allowed;opacity:.5}.btn-primary:hover,.btn-primary:active{background:#002566}.btn-primary:disabled:hover{background:#95adea;color:#fff;border-color:#0000}.btn-lg{padding:10px 20px;min-width:100px;font-size:16px;letter-spacing:.05rem;height:50px}.btn-link{background:transparent;border:none;color:#1e6ea7;text-decoration:none;cursor:pointer;padding:8px;border-radius:4px;transition:background .1s ease-out}.btn-link:hover{background:#e6f3fb}.flex{display:flex}.flex-col{flex-direction:column}.justify-end{justify-content:flex-end}.gap-2{gap:8px;padding-top:40px}.gap-5{gap:20px}.w-\\[600px\\]{width:600px}.pl-7{padding-top:28px}.p-1{padding:4px}.footer-note{font-size:12px;color:#6c757d;line-height:1.5;margin:0;padding:0;text-align:left;font-weight:400;font-family:Gantari,sans-serif;letter-spacing:.02rem}.footer-note a{color:#6c757d;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px;font-weight:500;transition:color .1s ease-out}.footer-note a:hover{color:#6c757d;text-decoration-thickness:2px}@media (prefers-color-scheme: dark){.dialog-content{background:#0f214d;color:#fff}.text-label-md,.text-label-sm{color:#fff}.dialog-close-button:hover{background:#152d6a}.feedback-suggestion-text{background:#0d1b40;border-color:#0d1b40;color:#e0e0e0}.feedback-suggestion-text:hover:not(.feedback-suggestion-text-active){background:#1d3f95;border-color:#8fffb2}.feedback-suggestion-text-active{background:#2651c0;color:#00e649;border-color:#8fffb2}.feedback-comment-text{background:#2d2d2d;border-color:#404040;color:#fff}.feedback-comment-text:focus{border-color:#009930;box-shadow:0 0 0 2px #4caf501a}.feedback-comment-text::-moz-placeholder{color:#b5b3b0}.feedback-comment-text::placeholder{color:#b5b3b0}.btn-primary{background:#8fffb2;color:#0f214d;border-color:#8fffb2}.btn-primary:disabled{background:#dcf2d9;color:#d4def7;border-color:#dcf2d9}.btn-primary:disabled:hover{background:#00cc41;color:#0d1b40;border-color:#00cc41}.btn-primary:hover{background:#00cc41}.btn-link{color:#009930}.btn-link:hover{background:#1e6ea740}.footer-note{color:#8d8d8d}.footer-note a{color:#8fffb2;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}.footer-note a:hover{color:#00cc41;text-decoration-thickness:2px}}.dialog-close-button:focus-visible,.btn-base:focus-visible,.btn-link:focus-visible{box-shadow:0 0 0 2px #8bc8f0}.btn-base:disabled{opacity:.5;cursor:not-allowed}";
|
|
5500
5501
|
class mr {
|
|
5501
|
-
constructor(n, t, r, s, i,
|
|
5502
|
+
constructor(n, t, r, s, i, o, a, u) {
|
|
5502
5503
|
y(this, "node");
|
|
5503
5504
|
y(this, "_rightColumnNode");
|
|
5504
5505
|
y(this, "_feedbackNode");
|
|
@@ -5507,7 +5508,7 @@ class mr {
|
|
|
5507
5508
|
y(this, "_currentMessageBlockNode");
|
|
5508
5509
|
y(this, "_currentMessageBlockNodeMarkdown");
|
|
5509
5510
|
y(this, "_accumulatedMarkdown", "");
|
|
5510
|
-
y(this, "_toolCallBuilder", new
|
|
5511
|
+
y(this, "_toolCallBuilder", new Ko());
|
|
5511
5512
|
y(this, "_clientFunctionInvocationsByOperationId", {});
|
|
5512
5513
|
y(this, "_clientFunctionInvocationsByLlmFunctionId", {});
|
|
5513
5514
|
//private _completedClientFunctionInvocationsInCurrentLoop = new Set<ClientFunctionInvocation>();
|
|
@@ -5515,12 +5516,17 @@ class mr {
|
|
|
5515
5516
|
y(this, "_pulseNode");
|
|
5516
5517
|
y(this, "_pulseNodeAnimation");
|
|
5517
5518
|
y(this, "_suggestionTextList");
|
|
5518
|
-
this.conversation = n, this.authorRole = t, this.authorId = r, this.authorPictureUrl = s, this.authorDisplayName = i, this.authorEmail =
|
|
5519
|
+
this.conversation = n, this.authorRole = t, this.authorId = r, this.authorPictureUrl = s, this.authorDisplayName = i, this.authorEmail = o, this.messageId = a, this.copilitId = u, this.node = /* @__PURE__ */ b("li", { class: "p-2 flex gap-2" }, /* @__PURE__ */ b(Fo, { class: "shrink-0", id: this.authorId, title: this.authorDisplayName }, this.authorPictureUrl ? /* @__PURE__ */ b("img", { src: this.authorPictureUrl, class: "w-full h-full" }) : /* @__PURE__ */ b("span", { marginTop: "-.1em" }, Lo(this.authorDisplayName))), this._rightColumnNode = /* @__PURE__ */ b("div", { class: "shrink-0 flex-1" }, /* @__PURE__ */ b("div", { class: "font-medium text-base leading-5" }, this.authorDisplayName))), this.ensureCurrentMessageBlockNode(), this._suggestionTextList = [{ text: "Irrelevant answer", isActive: !1 }, { text: "Incorrect information", isActive: !1 }, { text: "Incomplete answer", isActive: !1 }, { text: "Offensive content", isActive: !1 }, { text: "Other", isActive: !1 }];
|
|
5519
5520
|
}
|
|
5520
5521
|
//private _completedSubConversationsInCurrentLoop = new Set<SubConversation>();
|
|
5521
5522
|
get chat() {
|
|
5522
5523
|
return this.conversation.chat;
|
|
5523
5524
|
}
|
|
5525
|
+
ensureStyles() {
|
|
5526
|
+
if (document.getElementById("FeedBackDialog")) return;
|
|
5527
|
+
const n = document.createElement("style");
|
|
5528
|
+
n.id = "FeedBackDialog", n.textContent = Yo, document.head.appendChild(n);
|
|
5529
|
+
}
|
|
5524
5530
|
ensureCurrentMessageBlockNode() {
|
|
5525
5531
|
if (!this._currentMessageBlockNode && (this._rightColumnNode.appendChild(
|
|
5526
5532
|
this._toolCallInfoNode = /* @__PURE__ */ b("div", { class: "prose prose-neutral prose-sm max-w-none" })
|
|
@@ -5554,7 +5560,7 @@ class mr {
|
|
|
5554
5560
|
this._currentMessageBlockNodeMarkdown,
|
|
5555
5561
|
this.chat.pyodide,
|
|
5556
5562
|
this.chat.mdastExtensions
|
|
5557
|
-
), this._pulseNode && (this._pulseNodeAnimation.currentTime = t, this._pulseNode.classList.add("ml-[1ch]"),
|
|
5563
|
+
), this._pulseNode && (this._pulseNodeAnimation.currentTime = t, this._pulseNode.classList.add("ml-[1ch]"), ea(this._currentMessageBlockNode).appendChild(this._pulseNode), this._pulseNodeAnimation.play());
|
|
5558
5564
|
}
|
|
5559
5565
|
toolCallUpdate(n) {
|
|
5560
5566
|
var r;
|
|
@@ -5567,29 +5573,29 @@ class mr {
|
|
|
5567
5573
|
}
|
|
5568
5574
|
const i = this.chat.clientFunctionInvocationHandlersPartial[t.functionName];
|
|
5569
5575
|
if (i) {
|
|
5570
|
-
const
|
|
5571
|
-
this._clientFunctionInvocationsByLlmFunctionId[t.llmFunctionId] =
|
|
5576
|
+
const o = new Qt(t.llmFunctionId, null, this), a = i(o, t);
|
|
5577
|
+
this._clientFunctionInvocationsByLlmFunctionId[t.llmFunctionId] = a, this.removePulseNodeIfItIsThere(), a.node && (this._rightColumnNode.appendChild(a.node), a instanceof ut && a.context.conversationMessage.expandAsync(), this._currentMessageBlockNode = null, this._currentMessageBlockNodeMarkdown = null);
|
|
5572
5578
|
}
|
|
5573
5579
|
}
|
|
5574
5580
|
}
|
|
5575
5581
|
onOpcodeMessageInvokeClientFunctionReceived(n, t, r, s) {
|
|
5576
5582
|
var l, c;
|
|
5577
5583
|
const i = JSON.parse(s);
|
|
5578
|
-
let
|
|
5579
|
-
if (
|
|
5580
|
-
|
|
5584
|
+
let o = this._clientFunctionInvocationsByOperationId[t];
|
|
5585
|
+
if (o) {
|
|
5586
|
+
o.run(...i);
|
|
5581
5587
|
return;
|
|
5582
5588
|
}
|
|
5583
|
-
if (
|
|
5584
|
-
|
|
5589
|
+
if (o = this._clientFunctionInvocationsByLlmFunctionId[n], o && !o.context.operationId) {
|
|
5590
|
+
o.context.operationId = t, this.chat.clientFunctionInvocationsByOperationId[t] = o, this._clientFunctionInvocationsByOperationId[t] = o, (l = o.run) == null || l.call(o, ...i);
|
|
5585
5591
|
return;
|
|
5586
5592
|
}
|
|
5587
|
-
const
|
|
5593
|
+
const a = new Qt(n, t, this), u = this.chat.clientFunctionInvocationHandlers[r];
|
|
5588
5594
|
if (u)
|
|
5589
|
-
|
|
5595
|
+
o = u(a, ...i), this.chat.clientFunctionInvocationsByOperationId[t] = o, this._clientFunctionInvocationsByOperationId[t] = o, this._clientFunctionInvocationsByLlmFunctionId[n] = o, (c = o.run) == null || c.call(o, ...i), this.removePulseNodeIfItIsThere(), o.node && (this._rightColumnNode.appendChild(o.node), o instanceof ut && o.context.conversationMessage.expandAsync(), this._currentMessageBlockNode = null, this._currentMessageBlockNodeMarkdown = null);
|
|
5590
5596
|
else {
|
|
5591
5597
|
const p = `Function '${r}' not found. This occurs if a tool / function has been invoked, that requires some sort of user interaction (e.g. to obtain confirmation or to fill out some form values), then contacts the front-end to obtain a response, but the front-end is unable to handle the request because the function to be invoked does not exist. This error was thrown in the front-end. This most likely indicates that the bot is set up incorrectly, and the user should contact support.`;
|
|
5592
|
-
|
|
5598
|
+
a.postErrorAsync(p);
|
|
5593
5599
|
}
|
|
5594
5600
|
}
|
|
5595
5601
|
setClientInvocationResult(n, t) {
|
|
@@ -5613,7 +5619,7 @@ class mr {
|
|
|
5613
5619
|
} catch {
|
|
5614
5620
|
r = t;
|
|
5615
5621
|
}
|
|
5616
|
-
this.ensureCurrentMessageBlockNode(), this._showToolCallResult && this._toolCallInfoNode.appendChild(
|
|
5622
|
+
this.ensureCurrentMessageBlockNode(), this._showToolCallResult && t.length > 0 && this._toolCallInfoNode.appendChild(
|
|
5617
5623
|
/* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("div", { class: "p-1" }, /* @__PURE__ */ b("pre", { class: "whitespace-pre-wrap" }, JSON.stringify(r, null, 2))))
|
|
5618
5624
|
);
|
|
5619
5625
|
let s = this._clientFunctionInvocationsByLlmFunctionId[n];
|
|
@@ -5632,35 +5638,49 @@ class mr {
|
|
|
5632
5638
|
executeLlmFunctionsEnd() {
|
|
5633
5639
|
this.ensureCurrentMessageBlockNode(), this._clientFunctionInvocationsByLlmFunctionId = {}, this._subConversations = {};
|
|
5634
5640
|
}
|
|
5635
|
-
subConversationBegin(n, t, r, s, i,
|
|
5636
|
-
const
|
|
5637
|
-
this.chat.conversationsById.set(n,
|
|
5641
|
+
subConversationBegin(n, t, r, s, i, o) {
|
|
5642
|
+
const a = new kn(this.chat, n, this, o);
|
|
5643
|
+
this.chat.conversationsById.set(n, a), this._subConversations[n] = a, this.removePulseNodeIfItIsThere(), this._rightColumnNode.appendChild(a.node), this._currentMessageBlockNode = null, this._currentMessageBlockNodeMarkdown = null;
|
|
5638
5644
|
}
|
|
5639
5645
|
notifySubConversationEnded(n, t) {
|
|
5640
5646
|
delete this._subConversations[n.id], !t && !Object.keys(this._subConversations).length && !Object.keys(this._clientFunctionInvocationsByLlmFunctionId).length && this.ensureCurrentMessageBlockNode();
|
|
5641
5647
|
}
|
|
5642
5648
|
onOpcodeEndReceived() {
|
|
5643
|
-
this.removePulseNodeIfItIsThere(), this._toolCallBuilder.clear(), this._clientFunctionInvocationsByLlmFunctionId = {}, this._subConversations = {};
|
|
5649
|
+
this.removePulseNodeIfItIsThere(), this._toolCallBuilder.clear(), this._clientFunctionInvocationsByLlmFunctionId = {}, this._subConversations = {}, this.ensureStyles();
|
|
5644
5650
|
const n = this.conversation.chat.feedbackByMessageId.get(this.messageId);
|
|
5645
5651
|
n != null ? this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link p-1" }, /* @__PURE__ */ b(n ? kt : zt, null))) : this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link p-1", onclick: () => {
|
|
5646
5652
|
this.conversation.chat.setLikeAsync(this.messageId, this.copilitId, !0), this._feedbackNode.replaceWith(
|
|
5647
5653
|
this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link p-1" }, /* @__PURE__ */ b(kt, null)))
|
|
5648
5654
|
);
|
|
5649
5655
|
} }, /* @__PURE__ */ b(kt, null)), /* @__PURE__ */ b("a", { class: "btn btn-link p-1", onclick: () => {
|
|
5650
|
-
const t = /* @__PURE__ */ b("div", { class: "
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5656
|
+
const t = /* @__PURE__ */ b("div", { class: "dialog-overlay" }, /* @__PURE__ */ b("div", { role: "dialog", class: "dialog-content w-[600px] gap-5" }, /* @__PURE__ */ b("button", { onclick: () => t.remove(), class: "dialog-close-button" }, /* @__PURE__ */ b(Zo, { size: "22" })), /* @__PURE__ */ b("div", { class: "dialog-header" }, /* @__PURE__ */ b("label", { class: "text-label-md pl-7" }, "Tell us more")), /* @__PURE__ */ b("div", { class: "dialog-body flex flex-col gap-5" }, /* @__PURE__ */ b("div", { class: "text-label-sm pl-7" }, this._suggestionTextList.map((s, i) => /* @__PURE__ */ b("span", { class: "feedback-suggestion-text", onclick: (o) => {
|
|
5657
|
+
const a = this;
|
|
5658
|
+
this._suggestionTextList.filter((c, p) => p !== i && c.isActive).forEach((c) => c.isActive = !1), t.querySelectorAll(".feedback-suggestion-text").forEach((c) => c.classList.toggle("feedback-suggestion-text-active", !1)), s.isActive = !s.isActive, o.currentTarget.classList.toggle("feedback-suggestion-text-active", s.isActive), r.call(a);
|
|
5659
|
+
} }, s.text))), /* @__PURE__ */ b("textarea", { placeholder: "Add special details (optional)", class: "feedback-comment-text" }), /* @__PURE__ */ b("div", { class: "footer-note" }, /* @__PURE__ */ b("a", { href: "https://id.veracity.com/terms-of-use", target: "_blank", rel: "noopener noreferrer" }, "Learn more"), " about how this data is used and your rights. By pressing Submit, your conversation will be used to improve Veracity products and services. ", /* @__PURE__ */ b("a", { href: "https://services.veracity.com/PrivacyStatement", target: "_blank", rel: "noopener noreferrer" }, "Privacy statement."))), /* @__PURE__ */ b("div", { class: "dialog-footer flex justify-end gap-2" }, /* @__PURE__ */ b(
|
|
5660
|
+
"button",
|
|
5661
|
+
{
|
|
5662
|
+
id: "submit-btn",
|
|
5663
|
+
class: "btn-base btn-primary btn-lg",
|
|
5664
|
+
disabled: !0,
|
|
5665
|
+
onclick: () => {
|
|
5666
|
+
let s = "";
|
|
5667
|
+
this._suggestionTextList.map((a, u) => {
|
|
5668
|
+
a.isActive && (s = a.text);
|
|
5669
|
+
});
|
|
5670
|
+
let i = "";
|
|
5671
|
+
const o = t.querySelector(".feedback-comment-text").value;
|
|
5672
|
+
o !== "" && (i = o), this.conversation.chat.setLikeAsync(this.messageId, this.copilitId, !1, s, i), t.remove(), this._feedbackNode.replaceWith(
|
|
5673
|
+
this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link p-1" }, /* @__PURE__ */ b(zt, null)))
|
|
5674
|
+
);
|
|
5675
|
+
}
|
|
5676
|
+
},
|
|
5677
|
+
"Submit"
|
|
5678
|
+
))));
|
|
5679
|
+
function r() {
|
|
5680
|
+
const s = t.querySelector("#submit-btn");
|
|
5681
|
+
this._suggestionTextList.some((o) => o.isActive) ? s.disabled = !1 : s.disabled = !0;
|
|
5682
|
+
}
|
|
5683
|
+
setTimeout(() => r.call(this), 0), document.body.appendChild(t);
|
|
5664
5684
|
} }, /* @__PURE__ */ b(zt, null))), this._rightColumnNode.appendChild(this._feedbackNode);
|
|
5665
5685
|
}
|
|
5666
5686
|
onErrorWhileReadingBodyStream(n) {
|
|
@@ -5686,10 +5706,10 @@ class mr {
|
|
|
5686
5706
|
n.clientFunctionInvocationHandlers.python = (t, r) => {
|
|
5687
5707
|
const s = new xn(t, r);
|
|
5688
5708
|
return s.run(r), s;
|
|
5689
|
-
}, n.clientFunctionInvocationHandlersPartial.python = (t, r) => new xn(t, r), n.clientFunctionInvocationHandlers.ButtonOptionsDialog = (t, r) => new
|
|
5709
|
+
}, n.clientFunctionInvocationHandlersPartial.python = (t, r) => new xn(t, r), n.clientFunctionInvocationHandlers.ButtonOptionsDialog = (t, r) => new Wo(t, r), n.clientFunctionInvocationHandlers.search = (t, r) => new Qo(t, r), n.clientFunctionInvocationHandlers.WindowOpenDialog = (t, r) => new Jo(t, r);
|
|
5690
5710
|
}
|
|
5691
5711
|
}
|
|
5692
|
-
function
|
|
5712
|
+
function ea(e) {
|
|
5693
5713
|
for (; ; )
|
|
5694
5714
|
for (let n = e.lastChild; ; n = n.previousSibling)
|
|
5695
5715
|
if (n) {
|
|
@@ -5712,7 +5732,7 @@ class gr {
|
|
|
5712
5732
|
y(this, "_onErrorWhileReadingBodyStreamCalled");
|
|
5713
5733
|
this.chat = n, this.id = t, this.node = this.messagesListNode = /* @__PURE__ */ b("ol", null);
|
|
5714
5734
|
}
|
|
5715
|
-
onOpcodeMessageBeginReceived(n, t, r, s, i,
|
|
5735
|
+
onOpcodeMessageBeginReceived(n, t, r, s, i, o, a) {
|
|
5716
5736
|
const u = new mr(
|
|
5717
5737
|
this,
|
|
5718
5738
|
n,
|
|
@@ -5720,8 +5740,8 @@ class gr {
|
|
|
5720
5740
|
r,
|
|
5721
5741
|
s,
|
|
5722
5742
|
i,
|
|
5723
|
-
|
|
5724
|
-
|
|
5743
|
+
o,
|
|
5744
|
+
a
|
|
5725
5745
|
);
|
|
5726
5746
|
return this.messages.push(this.activeMessage = u), this.messagesListNode.appendChild(u.node), u;
|
|
5727
5747
|
}
|
|
@@ -5754,14 +5774,14 @@ class gr {
|
|
|
5754
5774
|
s
|
|
5755
5775
|
);
|
|
5756
5776
|
}
|
|
5757
|
-
onOpcodeMessageSubConversationBeginReceived(n, t, r, s, i,
|
|
5777
|
+
onOpcodeMessageSubConversationBeginReceived(n, t, r, s, i, o) {
|
|
5758
5778
|
this.activeMessage.subConversationBegin(
|
|
5759
5779
|
n,
|
|
5760
5780
|
t,
|
|
5761
5781
|
r,
|
|
5762
5782
|
s,
|
|
5763
5783
|
i,
|
|
5764
|
-
|
|
5784
|
+
o
|
|
5765
5785
|
);
|
|
5766
5786
|
}
|
|
5767
5787
|
handleMessage(n) {
|
|
@@ -5948,12 +5968,12 @@ class kn extends gr {
|
|
|
5948
5968
|
(t = this.activeMessage) == null || t.onOpcodeEndReceived(), this.setButtonSuccess(), this.parentMessage.notifySubConversationEnded(this, !1);
|
|
5949
5969
|
}
|
|
5950
5970
|
onOpcodeConversationErrorReceived(t, r) {
|
|
5951
|
-
var
|
|
5971
|
+
var o;
|
|
5952
5972
|
t && console.debug(t, r);
|
|
5953
5973
|
const s = "An undisclosed error occurred. Please contact Veracity Support.";
|
|
5954
5974
|
this.displayError("Error", s);
|
|
5955
5975
|
const i = new Error(s);
|
|
5956
|
-
(
|
|
5976
|
+
(o = this.activeMessage) == null || o.onErrorWhileReadingBodyStream(i), this.setButtonError(), this.parentMessage.notifySubConversationEnded(this, !1);
|
|
5957
5977
|
}
|
|
5958
5978
|
// Don't need to override this method as it will never be called for a sub-conversation
|
|
5959
5979
|
// onErrorBeforeReadingBodyStreamStarted(error: any) {
|
|
@@ -5968,7 +5988,7 @@ class kn extends gr {
|
|
|
5968
5988
|
await this.parentMessage.expandAsync(), this._expanded ? this._expandPromise && await this._expandPromise : await this.doExpandAsync();
|
|
5969
5989
|
}
|
|
5970
5990
|
}
|
|
5971
|
-
class
|
|
5991
|
+
class na {
|
|
5972
5992
|
constructor(n) {
|
|
5973
5993
|
y(this, "node");
|
|
5974
5994
|
y(this, "url");
|
|
@@ -6051,10 +6071,10 @@ class eo {
|
|
|
6051
6071
|
});
|
|
6052
6072
|
for (let i = 0; i < s.length; ++i)
|
|
6053
6073
|
if (s[i].role === "user") {
|
|
6054
|
-
const
|
|
6055
|
-
for (;
|
|
6074
|
+
const o = i + 1;
|
|
6075
|
+
for (; o < s.length && s[o].role === "user"; )
|
|
6056
6076
|
s[i].content += `
|
|
6057
|
-
` + s[
|
|
6077
|
+
` + s[o].content, s.splice(o, 1);
|
|
6058
6078
|
}
|
|
6059
6079
|
try {
|
|
6060
6080
|
return await r.summarizeTitleAsync(this.fetch, this.summarizeTitleUrl, s, n);
|
|
@@ -6072,16 +6092,16 @@ class eo {
|
|
|
6072
6092
|
});
|
|
6073
6093
|
for (let i = 0; i < s.length; ++i)
|
|
6074
6094
|
if (s[i].role === "user") {
|
|
6075
|
-
const
|
|
6076
|
-
for (;
|
|
6095
|
+
const o = i + 1;
|
|
6096
|
+
for (; o < s.length && s[o].role === "user"; )
|
|
6077
6097
|
s[i].content += `
|
|
6078
|
-
` + s[
|
|
6098
|
+
` + s[o].content, s.splice(o, 1);
|
|
6079
6099
|
}
|
|
6080
6100
|
try {
|
|
6081
6101
|
await this._completion.startAsync(this.fetch, this.url, s, t, r);
|
|
6082
6102
|
} catch (i) {
|
|
6083
|
-
let
|
|
6084
|
-
this._completion = null, this.rootConversation.onErrorBeforeReadingBodyStreamStarted(i,
|
|
6103
|
+
let o = this._completion.wasStopped;
|
|
6104
|
+
this._completion = null, this.rootConversation.onErrorBeforeReadingBodyStreamStarted(i, o);
|
|
6085
6105
|
return;
|
|
6086
6106
|
}
|
|
6087
6107
|
try {
|
|
@@ -6089,13 +6109,13 @@ class eo {
|
|
|
6089
6109
|
for (const i of this._completion.read()) {
|
|
6090
6110
|
switch (i.type) {
|
|
6091
6111
|
case j.MessageInvokeClientFunctionResult: {
|
|
6092
|
-
const
|
|
6093
|
-
|
|
6112
|
+
const o = this.clientFunctionInvocationsByOperationId[i.operationId];
|
|
6113
|
+
o.context.conversationMessage.setClientInvocationResult(o, JSON.parse(i.result));
|
|
6094
6114
|
continue;
|
|
6095
6115
|
}
|
|
6096
6116
|
case j.MessageInvokeClientFunctionError: {
|
|
6097
|
-
const
|
|
6098
|
-
|
|
6117
|
+
const o = this.clientFunctionInvocationsByOperationId[i.operationId];
|
|
6118
|
+
o.context.conversationMessage.setClientInvocationError(o, i.error);
|
|
6099
6119
|
continue;
|
|
6100
6120
|
}
|
|
6101
6121
|
}
|
|
@@ -6112,15 +6132,15 @@ class eo {
|
|
|
6112
6132
|
(n = this._completion) == null || n.stop();
|
|
6113
6133
|
}
|
|
6114
6134
|
async setLikeAsync(n, t, r, s = null, i = null) {
|
|
6115
|
-
const
|
|
6135
|
+
const o = await this.fetch(this.feedbackUrl, {
|
|
6116
6136
|
method: "POST",
|
|
6117
6137
|
headers: {
|
|
6118
6138
|
"Content-Type": "application/json"
|
|
6119
6139
|
},
|
|
6120
6140
|
body: JSON.stringify({ messageId: n, isThumbsUp: r, copilotId: t, category: s, comment: i })
|
|
6121
6141
|
});
|
|
6122
|
-
if (!
|
|
6123
|
-
throw new Error(`Failed to send feedback: ${
|
|
6142
|
+
if (!o.ok)
|
|
6143
|
+
throw new Error(`Failed to send feedback: ${o.status} ${o.statusText}`);
|
|
6124
6144
|
this.feedbackByMessageId.set(n, r);
|
|
6125
6145
|
}
|
|
6126
6146
|
async LoadLikesAsync() {
|
|
@@ -6138,5 +6158,5 @@ class eo {
|
|
|
6138
6158
|
}
|
|
6139
6159
|
}
|
|
6140
6160
|
export {
|
|
6141
|
-
|
|
6161
|
+
na as Chat
|
|
6142
6162
|
};
|