@pagelines/sdk 1.0.612 → 1.0.613
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.
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var d = (a, t) =>
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import { SettingsObject as
|
|
7
|
-
import { P as
|
|
8
|
-
const
|
|
1
|
+
var Gn = Object.defineProperty;
|
|
2
|
+
var Fs = (a, t, e) => t in a ? Gn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var d = (a, t) => Gn(a, "name", { value: t, configurable: !0 });
|
|
4
|
+
var F = (a, t, e) => Fs(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { defineComponent as Ne, openBlock as f, createElementBlock as m, createElementVNode as T, normalizeClass as D, ref as xe, watch as Ft, computed as I, createCommentVNode as q, renderSlot as fn, onMounted as jt, unref as cn, Fragment as re, toDisplayString as Z, normalizeStyle as se, renderList as me, shallowRef as fs, onBeforeUnmount as gs, createBlock as un, nextTick as Bs, createVNode as lt, withCtx as Us, withModifiers as yt, createTextVNode as Ot, withDirectives as Hs, vModelText as Gs } from "vue";
|
|
6
|
+
import { SettingsObject as js, Agent as Bt, getDefaultAvatarUrl as ms, parseChatVisualFencePayload as Ws, createLogger as qs } from "@pagelines/core";
|
|
7
|
+
import { P as Vs } from "./sdkClient.js";
|
|
8
|
+
const Ys = { class: "spinner max-w-sm" }, Ks = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
|
-
},
|
|
11
|
+
}, jn = /* @__PURE__ */ Ne({
|
|
12
12
|
__name: "FSpinner",
|
|
13
13
|
props: {
|
|
14
14
|
width: { type: String, default: "" },
|
|
15
15
|
colorMode: { type: String, default: "primary" }
|
|
16
16
|
},
|
|
17
17
|
setup(a) {
|
|
18
|
-
return (t, e) => (
|
|
19
|
-
(
|
|
20
|
-
|
|
21
|
-
class:
|
|
18
|
+
return (t, e) => (f(), m("div", Ys, [
|
|
19
|
+
(f(), m("svg", Ks, [
|
|
20
|
+
T("circle", {
|
|
21
|
+
class: D([a.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
23
23
|
cy: "50",
|
|
24
24
|
r: "20",
|
|
@@ -30,40 +30,40 @@ const qs = { class: "spinner max-w-sm" }, Ys = {
|
|
|
30
30
|
]))
|
|
31
31
|
]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), Zs = [
|
|
34
34
|
{ pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
|
|
35
35
|
{ pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
|
|
36
|
-
],
|
|
37
|
-
function
|
|
38
|
-
if (!(a.bucket !== void 0 ||
|
|
36
|
+
], Xs = 9e4, xs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Qs = /* @__PURE__ */ new Set([...xs, "EMPTY_STREAM", "RATE_LIMIT"]), ks = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]);
|
|
37
|
+
function Js(a) {
|
|
38
|
+
if (!(a.bucket !== void 0 || Qs.has(a.code)))
|
|
39
39
|
return { surface: "hard" };
|
|
40
|
-
const e = a.bucket ?? (
|
|
40
|
+
const e = a.bucket ?? (xs.has(a.code) ? "account" : "error"), n = {
|
|
41
41
|
...a.actionLabel ? { actionLabel: a.actionLabel } : {},
|
|
42
42
|
...a.actionUrl ? { actionUrl: a.actionUrl } : {},
|
|
43
43
|
...a.help ? { help: a.help } : {}
|
|
44
44
|
};
|
|
45
|
-
return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } :
|
|
45
|
+
return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } : ks.has(a.code) ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "agent_deleted" } : { surface: "transient", issue: { code: a.code, message: a.error, ...n } };
|
|
46
46
|
}
|
|
47
|
-
d(
|
|
48
|
-
const
|
|
47
|
+
d(Js, "presentChatStreamError");
|
|
48
|
+
const Sn = class Sn extends js {
|
|
49
49
|
constructor(e) {
|
|
50
50
|
super("AgentChatController", e);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
F(this, "isTextMode", !1);
|
|
52
|
+
F(this, "lastMessage", { hash: "", time: 0 });
|
|
53
|
+
F(this, "isConnecting", !1);
|
|
54
|
+
F(this, "activeTurnGeneration", 0);
|
|
55
55
|
// Chat conversation tracking (server-managed persistence)
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
F(this, "conversationId");
|
|
57
|
+
F(this, "textState", xe({
|
|
58
58
|
isActive: !1,
|
|
59
59
|
isConnected: !1,
|
|
60
60
|
isThinking: !1,
|
|
61
61
|
connectionStatus: "disconnected"
|
|
62
62
|
}));
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this._agent = e.agent instanceof
|
|
63
|
+
F(this, "agentMode", xe("self"));
|
|
64
|
+
F(this, "sharedMessages", xe([]));
|
|
65
|
+
F(this, "_agent");
|
|
66
|
+
this._agent = e.agent instanceof Bt ? e.agent : new Bt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
|
|
67
67
|
}
|
|
68
68
|
get chatEnabled() {
|
|
69
69
|
const e = this._agent.state.value.lifecycle;
|
|
@@ -152,12 +152,12 @@ Current User:
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
setupModeWatcher() {
|
|
155
|
-
|
|
155
|
+
Ft(this.agentMode, async (e, n) => {
|
|
156
156
|
this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
setupAvailabilityWatcher() {
|
|
160
|
-
|
|
160
|
+
Ft(() => this.chatEnabled, (e) => {
|
|
161
161
|
if (!(!this.isTextMode || this.isConnecting)) {
|
|
162
162
|
if (e) {
|
|
163
163
|
this.textState.value.isConnected || this.updateState(this.textState, {
|
|
@@ -242,106 +242,106 @@ Current User:
|
|
|
242
242
|
}
|
|
243
243
|
this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, toolActivities: [], transientIssue: void 0 });
|
|
244
244
|
const l = ++this.activeTurnGeneration, o = `stream-${Date.now()}`;
|
|
245
|
-
let
|
|
246
|
-
const
|
|
247
|
-
if (!
|
|
245
|
+
let u = !1, c = !1;
|
|
246
|
+
const y = /* @__PURE__ */ d(() => l === this.activeTurnGeneration, "isCurrentTurn"), v = /* @__PURE__ */ d(($, P = "assistant") => {
|
|
247
|
+
if (!y())
|
|
248
248
|
return;
|
|
249
|
-
this.updateState(this.textState, { workingDescription: void 0 }),
|
|
249
|
+
this.updateState(this.textState, { workingDescription: void 0 }), u || (u = !0, this.sharedMessages.value = [
|
|
250
250
|
...this.sharedMessages.value,
|
|
251
|
-
{ id: o, text: "", sender:
|
|
251
|
+
{ id: o, text: "", sender: P === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
252
252
|
]);
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
}, "onDelta"),
|
|
256
|
-
if (!
|
|
253
|
+
const N = this.sharedMessages.value, V = N[N.length - 1];
|
|
254
|
+
V?.id === o && (V.text += $, this.sharedMessages.value = [...N]);
|
|
255
|
+
}, "onDelta"), A = /* @__PURE__ */ d(($) => {
|
|
256
|
+
if (!y())
|
|
257
257
|
return;
|
|
258
|
-
c = !0,
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
258
|
+
c = !0, u = !0, this.updateState(this.textState, { workingDescription: void 0 }), this.finishToolActivities("completed");
|
|
259
|
+
const P = this.sharedMessages.value, N = P.findIndex((V) => V.id === $.id);
|
|
260
|
+
if (N >= 0)
|
|
261
261
|
this.sharedMessages.value = [
|
|
262
|
-
...
|
|
263
|
-
|
|
264
|
-
...
|
|
262
|
+
...P.slice(0, N),
|
|
263
|
+
$,
|
|
264
|
+
...P.slice(N + 1)
|
|
265
265
|
];
|
|
266
266
|
else {
|
|
267
|
-
const
|
|
268
|
-
this.sharedMessages.value =
|
|
267
|
+
const V = P[P.length - 1];
|
|
268
|
+
this.sharedMessages.value = V?.id === o ? [...P.slice(0, -1), $] : [...P, $];
|
|
269
269
|
}
|
|
270
|
-
|
|
271
|
-
}, "onMessage"),
|
|
272
|
-
if (!
|
|
270
|
+
$.sender === "system" && $.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : $.sender === "system" && $.issue?.code && ks.has($.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
271
|
+
}, "onMessage"), _ = /* @__PURE__ */ d(($) => {
|
|
272
|
+
if (!y())
|
|
273
273
|
return;
|
|
274
|
-
if (!
|
|
275
|
-
|
|
274
|
+
if (!u && !c) {
|
|
275
|
+
G("empty_stream — assistant returned no content");
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
278
|
this.finishToolActivities("completed");
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
let
|
|
282
|
-
for (const
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
}, "onDone"),
|
|
288
|
-
if (!
|
|
279
|
+
const P = this.sharedMessages.value, N = P[P.length - 1];
|
|
280
|
+
if (N?.id === o && N.sender === "agent" && N.text) {
|
|
281
|
+
let V = N.text;
|
|
282
|
+
for (const U of Zs)
|
|
283
|
+
U.pattern.test(V) && (console.debug(`[chat] filtered directive: ${U.label}`), V = V.replace(U.pattern, "").trim(), U.pattern.lastIndex = 0);
|
|
284
|
+
V ? V !== N.text && (N.text = V, this.sharedMessages.value = [...P]) : this.sharedMessages.value = P.slice(0, -1);
|
|
285
|
+
}
|
|
286
|
+
$ && (this.conversationId = $), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
|
|
287
|
+
}, "onDone"), G = /* @__PURE__ */ d(($) => {
|
|
288
|
+
if (!y())
|
|
289
289
|
return;
|
|
290
290
|
this.updateState(this.textState, { workingDescription: void 0 }), this.finishToolActivities("failed");
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
const
|
|
294
|
-
|
|
291
|
+
const P = this.sharedMessages.value, N = P[P.length - 1];
|
|
292
|
+
if (N?.id === o && !N.text && (this.sharedMessages.value = P.slice(0, -1)), typeof $ == "object" && $.code && $.error) {
|
|
293
|
+
const J = Js($);
|
|
294
|
+
J.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: J.issue }) : J.surface === "transcript" ? (this.addMessage($.error, "system", void 0, J.issue), this.updateState(this.textState, {
|
|
295
295
|
isThinking: !1,
|
|
296
|
-
...
|
|
297
|
-
})) : this.handleError(new Error(
|
|
296
|
+
...J.sendBlockedReason ? { sendBlockedReason: J.sendBlockedReason } : {}
|
|
297
|
+
})) : this.handleError(new Error($.error));
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
const
|
|
301
|
-
this.isTransientError(
|
|
302
|
-
}, "onError"),
|
|
303
|
-
if (!
|
|
300
|
+
const V = typeof $ == "string" ? $ : $.error, U = this.mapChatError(V);
|
|
301
|
+
this.isTransientError(V) ? (this.logger.warn("Chat turn failed (transient):", { raw: V, friendly: U }), this.addMessage(U, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(U), V);
|
|
302
|
+
}, "onError"), R = /* @__PURE__ */ d(($) => {
|
|
303
|
+
if (!y())
|
|
304
304
|
return;
|
|
305
|
-
const
|
|
306
|
-
this.updateState(this.textState, { workingDescription:
|
|
307
|
-
}, "onStatus"), X = /* @__PURE__ */ d((
|
|
308
|
-
|
|
309
|
-
}, "onToolActivity"),
|
|
310
|
-
|
|
305
|
+
const P = $.trim();
|
|
306
|
+
this.updateState(this.textState, { workingDescription: P || void 0 });
|
|
307
|
+
}, "onStatus"), X = /* @__PURE__ */ d(($) => {
|
|
308
|
+
y() && this.updateToolActivity($);
|
|
309
|
+
}, "onToolActivity"), ee = /* @__PURE__ */ d(() => {
|
|
310
|
+
y() && this.updateState(this.textState, { workingDescription: void 0 });
|
|
311
311
|
}, "onWorkingEnd");
|
|
312
312
|
try {
|
|
313
|
-
const
|
|
313
|
+
const $ = i ? i({
|
|
314
314
|
message: e,
|
|
315
315
|
attachments: n,
|
|
316
316
|
conversationId: this.conversationId,
|
|
317
317
|
history: this.buildHistory(),
|
|
318
|
-
onDelta:
|
|
319
|
-
onMessage:
|
|
320
|
-
onDone:
|
|
321
|
-
onError:
|
|
322
|
-
onStatus:
|
|
318
|
+
onDelta: v,
|
|
319
|
+
onMessage: A,
|
|
320
|
+
onDone: _,
|
|
321
|
+
onError: G,
|
|
322
|
+
onStatus: R,
|
|
323
323
|
onToolActivity: X,
|
|
324
|
-
onWorkingEnd:
|
|
324
|
+
onWorkingEnd: ee
|
|
325
325
|
}) : s.chat.chatStreamPublic({
|
|
326
326
|
handle: this._agent.handle.value,
|
|
327
327
|
message: e,
|
|
328
328
|
attachments: n,
|
|
329
329
|
anonymousId: s.user.generateAnonId(),
|
|
330
330
|
context: this.getDynamicSettings().context || void 0,
|
|
331
|
-
onDelta:
|
|
332
|
-
onMessage:
|
|
333
|
-
onDone:
|
|
334
|
-
onError:
|
|
335
|
-
onStatus:
|
|
331
|
+
onDelta: v,
|
|
332
|
+
onMessage: A,
|
|
333
|
+
onDone: _,
|
|
334
|
+
onError: G,
|
|
335
|
+
onStatus: R,
|
|
336
336
|
onToolActivity: X,
|
|
337
|
-
onWorkingEnd:
|
|
337
|
+
onWorkingEnd: ee
|
|
338
338
|
});
|
|
339
339
|
await Promise.race([
|
|
340
|
-
|
|
341
|
-
new Promise((
|
|
340
|
+
$,
|
|
341
|
+
new Promise((P, N) => setTimeout(() => N(new Error("timed out")), Xs))
|
|
342
342
|
]);
|
|
343
|
-
} catch (
|
|
344
|
-
|
|
343
|
+
} catch ($) {
|
|
344
|
+
G($.message || "Something went wrong");
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
async stopChatTurn() {
|
|
@@ -378,30 +378,30 @@ Current User:
|
|
|
378
378
|
await this.endConversation();
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
|
-
d(
|
|
382
|
-
let
|
|
383
|
-
function
|
|
381
|
+
d(Sn, "AgentChatController");
|
|
382
|
+
let Wn = Sn;
|
|
383
|
+
function qn(a) {
|
|
384
384
|
return a ? typeof a == "string" ? a : a.src || "" : "";
|
|
385
385
|
}
|
|
386
|
-
d(
|
|
387
|
-
function
|
|
388
|
-
return
|
|
386
|
+
d(qn, "getImageSrc");
|
|
387
|
+
function Br(a) {
|
|
388
|
+
return qn(a.cover) || qn(a.avatar) || ms(a.name);
|
|
389
389
|
}
|
|
390
|
-
d(
|
|
391
|
-
function
|
|
390
|
+
d(Br, "getAgentAvatarUrl");
|
|
391
|
+
function Vn(a) {
|
|
392
392
|
const t = a.target;
|
|
393
|
-
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src =
|
|
393
|
+
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = ms());
|
|
394
394
|
}
|
|
395
|
-
d(
|
|
396
|
-
function
|
|
395
|
+
d(Vn, "handleImageError");
|
|
396
|
+
function Ur(a) {
|
|
397
397
|
const { template: t, agent: e } = a;
|
|
398
398
|
return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
|
|
399
399
|
}
|
|
400
|
-
d(
|
|
401
|
-
const
|
|
400
|
+
d(Ur, "parseButtonTemplate");
|
|
401
|
+
const ei = {
|
|
402
402
|
key: 0,
|
|
403
403
|
class: "absolute inset-0 flex items-center justify-center"
|
|
404
|
-
},
|
|
404
|
+
}, Hr = /* @__PURE__ */ Ne({
|
|
405
405
|
__name: "ElAgentButton",
|
|
406
406
|
props: {
|
|
407
407
|
theme: { default: "primary" },
|
|
@@ -411,42 +411,42 @@ const Qs = {
|
|
|
411
411
|
iconAfter: {}
|
|
412
412
|
},
|
|
413
413
|
setup(a) {
|
|
414
|
-
const t =
|
|
414
|
+
const t = I(() => ({
|
|
415
415
|
primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
|
|
416
416
|
green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
|
|
417
417
|
red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
|
|
418
418
|
default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
|
|
419
|
-
})[a.theme]), e =
|
|
419
|
+
})[a.theme]), e = I(() => ({
|
|
420
420
|
sm: "px-4 py-2 text-sm",
|
|
421
421
|
md: "px-6 py-3 text-base",
|
|
422
422
|
lg: "px-8 py-4 text-base"
|
|
423
|
-
})[a.size]), n =
|
|
423
|
+
})[a.size]), n = I(() => ({
|
|
424
424
|
sm: "size-4",
|
|
425
425
|
md: "size-4",
|
|
426
426
|
lg: "size-5"
|
|
427
427
|
})[a.size]);
|
|
428
|
-
return (i, s) => (
|
|
429
|
-
class:
|
|
428
|
+
return (i, s) => (f(), m("button", {
|
|
429
|
+
class: D(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
|
|
430
430
|
}, [
|
|
431
|
-
a.loading ? (
|
|
432
|
-
|
|
433
|
-
])])) :
|
|
434
|
-
|
|
435
|
-
class:
|
|
431
|
+
a.loading ? (f(), m("div", ei, [...s[0] || (s[0] = [
|
|
432
|
+
T("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
433
|
+
])])) : q("", !0),
|
|
434
|
+
T("span", {
|
|
435
|
+
class: D(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
|
|
436
436
|
}, [
|
|
437
|
-
a.icon ? (
|
|
437
|
+
a.icon ? (f(), m("i", {
|
|
438
438
|
key: 0,
|
|
439
|
-
class:
|
|
440
|
-
}, null, 2)) :
|
|
441
|
-
|
|
442
|
-
a.iconAfter ? (
|
|
439
|
+
class: D([a.icon, n.value])
|
|
440
|
+
}, null, 2)) : q("", !0),
|
|
441
|
+
fn(i.$slots, "default"),
|
|
442
|
+
a.iconAfter ? (f(), m("i", {
|
|
443
443
|
key: 1,
|
|
444
|
-
class:
|
|
445
|
-
}, null, 2)) :
|
|
444
|
+
class: D([a.iconAfter, n.value])
|
|
445
|
+
}, null, 2)) : q("", !0)
|
|
446
446
|
], 2)
|
|
447
447
|
], 2));
|
|
448
448
|
}
|
|
449
|
-
}),
|
|
449
|
+
}), ti = ["value"], Gr = /* @__PURE__ */ Ne({
|
|
450
450
|
__name: "AgentInputEmail",
|
|
451
451
|
props: {
|
|
452
452
|
modelValue: { default: "" }
|
|
@@ -454,7 +454,7 @@ const Qs = {
|
|
|
454
454
|
emits: ["update:modelValue"],
|
|
455
455
|
setup(a, { emit: t }) {
|
|
456
456
|
const e = t;
|
|
457
|
-
return (n, i) => (
|
|
457
|
+
return (n, i) => (f(), m("input", {
|
|
458
458
|
name: "username",
|
|
459
459
|
type: "email",
|
|
460
460
|
inputmode: "email",
|
|
@@ -467,9 +467,9 @@ const Qs = {
|
|
|
467
467
|
class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
|
|
468
468
|
style: { "font-size": "16px" },
|
|
469
469
|
onInput: i[0] || (i[0] = (s) => e("update:modelValue", s.target.value))
|
|
470
|
-
}, null, 40,
|
|
470
|
+
}, null, 40, ti));
|
|
471
471
|
}
|
|
472
|
-
}),
|
|
472
|
+
}), ni = ["placeholder", "value"], jr = /* @__PURE__ */ Ne({
|
|
473
473
|
__name: "AgentInputOneTimeCode",
|
|
474
474
|
props: {
|
|
475
475
|
modelValue: {},
|
|
@@ -478,15 +478,15 @@ const Qs = {
|
|
|
478
478
|
},
|
|
479
479
|
emits: ["update:modelValue", "autoSubmit"],
|
|
480
480
|
setup(a, { emit: t }) {
|
|
481
|
-
const e = a, n = t, i =
|
|
482
|
-
|
|
481
|
+
const e = a, n = t, i = xe(null), s = I(() => "0".repeat(e.length));
|
|
482
|
+
jt(() => {
|
|
483
483
|
e.focusFirst && !("ontouchstart" in window) && i.value?.focus();
|
|
484
484
|
});
|
|
485
485
|
function l(o) {
|
|
486
|
-
const
|
|
487
|
-
n("update:modelValue",
|
|
486
|
+
const u = o.target.value.replace(/\D/g, "").slice(0, e.length);
|
|
487
|
+
n("update:modelValue", u), u.length === e.length && n("autoSubmit", u);
|
|
488
488
|
}
|
|
489
|
-
return d(l, "onInput"), (o,
|
|
489
|
+
return d(l, "onInput"), (o, u) => (f(), m("input", {
|
|
490
490
|
ref_key: "input",
|
|
491
491
|
ref: i,
|
|
492
492
|
name: "one-time-code",
|
|
@@ -502,12 +502,12 @@ const Qs = {
|
|
|
502
502
|
class: "w-full px-6 py-3 text-center font-mono tracking-[0.35em] text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
|
|
503
503
|
style: { "font-size": "16px" },
|
|
504
504
|
onInput: l
|
|
505
|
-
}, null, 40,
|
|
505
|
+
}, null, 40, ni));
|
|
506
506
|
}
|
|
507
|
-
}),
|
|
507
|
+
}), si = { class: "relative flex-shrink-0" }, ii = ["src", "alt"], ai = { class: "absolute top-1 right-1" }, ri = {
|
|
508
508
|
key: 1,
|
|
509
509
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
510
|
-
},
|
|
510
|
+
}, li = { class: "min-w-0" }, oi = /* @__PURE__ */ Ne({
|
|
511
511
|
__name: "ElModeHeader",
|
|
512
512
|
props: {
|
|
513
513
|
agent: {},
|
|
@@ -516,46 +516,46 @@ const Qs = {
|
|
|
516
516
|
layout: { default: "centered" }
|
|
517
517
|
},
|
|
518
518
|
setup(a) {
|
|
519
|
-
return (t, e) => (
|
|
520
|
-
class:
|
|
519
|
+
return (t, e) => (f(), m("div", {
|
|
520
|
+
class: D(["flex gap-4", [
|
|
521
521
|
a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
522
522
|
]])
|
|
523
523
|
}, [
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
class:
|
|
524
|
+
T("div", si, [
|
|
525
|
+
T("div", {
|
|
526
|
+
class: D(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
527
527
|
}, [
|
|
528
|
-
|
|
528
|
+
T("img", {
|
|
529
529
|
src: a.agent.avatarUrl.value,
|
|
530
530
|
alt: a.agent.displayName.value,
|
|
531
531
|
class: "w-full h-full object-cover",
|
|
532
532
|
onError: e[0] || (e[0] = //@ts-ignore
|
|
533
|
-
(...n) =>
|
|
534
|
-
}, null, 40,
|
|
533
|
+
(...n) => cn(Vn) && cn(Vn)(...n))
|
|
534
|
+
}, null, 40, ii)
|
|
535
535
|
], 2),
|
|
536
|
-
|
|
537
|
-
a.isOnline ? (
|
|
538
|
-
e[1] || (e[1] =
|
|
536
|
+
T("div", ai, [
|
|
537
|
+
a.isOnline ? (f(), m(re, { key: 0 }, [
|
|
538
|
+
e[1] || (e[1] = T("div", {
|
|
539
539
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
540
540
|
style: { "animation-duration": "3s" }
|
|
541
541
|
}, null, -1)),
|
|
542
|
-
e[2] || (e[2] =
|
|
543
|
-
], 64)) : (
|
|
542
|
+
e[2] || (e[2] = T("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
|
|
543
|
+
], 64)) : (f(), m("div", ri))
|
|
544
544
|
])
|
|
545
545
|
]),
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
class:
|
|
546
|
+
T("div", li, [
|
|
547
|
+
T("h1", {
|
|
548
|
+
class: D(["font-light text-white mb-1 truncate", [
|
|
549
549
|
a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
550
550
|
a.layout === "horizontal" ? "text-white/95" : ""
|
|
551
551
|
]])
|
|
552
|
-
},
|
|
553
|
-
|
|
554
|
-
class:
|
|
552
|
+
}, Z(a.agent.displayName.value), 3),
|
|
553
|
+
T("p", {
|
|
554
|
+
class: D(["font-light line-clamp-1", [
|
|
555
555
|
a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
556
556
|
a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
557
557
|
]])
|
|
558
|
-
},
|
|
558
|
+
}, Z(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
|
|
559
559
|
])
|
|
560
560
|
], 2));
|
|
561
561
|
}
|
|
@@ -566,21 +566,21 @@ function Yn(a, t) {
|
|
|
566
566
|
return n;
|
|
567
567
|
}
|
|
568
568
|
d(Yn, "_arrayLikeToArray");
|
|
569
|
-
function
|
|
569
|
+
function ci(a) {
|
|
570
570
|
if (Array.isArray(a)) return a;
|
|
571
571
|
}
|
|
572
|
-
d(
|
|
573
|
-
function
|
|
572
|
+
d(ci, "_arrayWithHoles");
|
|
573
|
+
function ui(a, t) {
|
|
574
574
|
var e = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
|
|
575
575
|
if (e != null) {
|
|
576
|
-
var n, i, s, l, o = [],
|
|
576
|
+
var n, i, s, l, o = [], u = !0, c = !1;
|
|
577
577
|
try {
|
|
578
|
-
if (s = (e = e.call(a)).next, t !== 0) for (; !(
|
|
579
|
-
} catch (
|
|
580
|
-
c = !0, i =
|
|
578
|
+
if (s = (e = e.call(a)).next, t !== 0) for (; !(u = (n = s.call(e)).done) && (o.push(n.value), o.length !== t); u = !0) ;
|
|
579
|
+
} catch (y) {
|
|
580
|
+
c = !0, i = y;
|
|
581
581
|
} finally {
|
|
582
582
|
try {
|
|
583
|
-
if (!
|
|
583
|
+
if (!u && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
584
584
|
} finally {
|
|
585
585
|
if (c) throw i;
|
|
586
586
|
}
|
|
@@ -588,154 +588,154 @@ function oi(a, t) {
|
|
|
588
588
|
return o;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
d(
|
|
592
|
-
function
|
|
591
|
+
d(ui, "_iterableToArrayLimit");
|
|
592
|
+
function hi() {
|
|
593
593
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
594
594
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
595
595
|
}
|
|
596
|
-
d(
|
|
597
|
-
function
|
|
598
|
-
return
|
|
596
|
+
d(hi, "_nonIterableRest");
|
|
597
|
+
function di(a, t) {
|
|
598
|
+
return ci(a) || ui(a, t) || pi(a, t) || hi();
|
|
599
599
|
}
|
|
600
|
-
d(
|
|
601
|
-
function
|
|
600
|
+
d(di, "_slicedToArray");
|
|
601
|
+
function pi(a, t) {
|
|
602
602
|
if (a) {
|
|
603
603
|
if (typeof a == "string") return Yn(a, t);
|
|
604
604
|
var e = {}.toString.call(a).slice(8, -1);
|
|
605
605
|
return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Yn(a, t) : void 0;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
d(
|
|
609
|
-
const bs = Object.entries,
|
|
610
|
-
let
|
|
611
|
-
|
|
608
|
+
d(pi, "_unsupportedIterableToArray");
|
|
609
|
+
const bs = Object.entries, Kn = Object.setPrototypeOf, fi = Object.isFrozen, gi = Object.getPrototypeOf, mi = Object.getOwnPropertyDescriptor;
|
|
610
|
+
let ke = Object.freeze, Ae = Object.seal, dt = Object.create, vs = typeof Reflect < "u" && Reflect, hn = vs.apply, dn = vs.construct;
|
|
611
|
+
ke || (ke = /* @__PURE__ */ d(function(t) {
|
|
612
612
|
return t;
|
|
613
613
|
}, "freeze"));
|
|
614
|
-
|
|
614
|
+
Ae || (Ae = /* @__PURE__ */ d(function(t) {
|
|
615
615
|
return t;
|
|
616
616
|
}, "seal"));
|
|
617
|
-
|
|
617
|
+
hn || (hn = /* @__PURE__ */ d(function(t, e) {
|
|
618
618
|
for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
|
|
619
619
|
i[s - 2] = arguments[s];
|
|
620
620
|
return t.apply(e, i);
|
|
621
621
|
}, "apply"));
|
|
622
|
-
|
|
622
|
+
dn || (dn = /* @__PURE__ */ d(function(t) {
|
|
623
623
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
624
624
|
n[i - 1] = arguments[i];
|
|
625
625
|
return new t(...n);
|
|
626
626
|
}, "construct"));
|
|
627
|
-
const
|
|
628
|
-
function
|
|
627
|
+
const ot = oe(Array.prototype.forEach), xi = oe(Array.prototype.lastIndexOf), Zn = oe(Array.prototype.pop), ct = oe(Array.prototype.push), ki = oe(Array.prototype.splice), ge = Array.isArray, At = oe(String.prototype.toLowerCase), sn = oe(String.prototype.toString), Xn = oe(String.prototype.match), ut = oe(String.prototype.replace), Qn = oe(String.prototype.indexOf), bi = oe(String.prototype.trim), vi = oe(Number.prototype.toString), yi = oe(Boolean.prototype.toString), Jn = typeof BigInt > "u" ? null : oe(BigInt.prototype.toString), es = typeof Symbol > "u" ? null : oe(Symbol.prototype.toString), ae = oe(Object.prototype.hasOwnProperty), wt = oe(Object.prototype.toString), he = oe(RegExp.prototype.test), Tt = wi(TypeError);
|
|
628
|
+
function oe(a) {
|
|
629
629
|
return function(t) {
|
|
630
630
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
631
631
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
632
632
|
n[i - 1] = arguments[i];
|
|
633
|
-
return
|
|
633
|
+
return hn(a, t, n);
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
d(
|
|
637
|
-
function
|
|
636
|
+
d(oe, "unapply");
|
|
637
|
+
function wi(a) {
|
|
638
638
|
return function() {
|
|
639
639
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
640
640
|
e[n] = arguments[n];
|
|
641
|
-
return
|
|
641
|
+
return dn(a, e);
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
|
-
d(
|
|
645
|
-
function
|
|
646
|
-
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
647
|
-
if (
|
|
644
|
+
d(wi, "unconstruct");
|
|
645
|
+
function O(a, t) {
|
|
646
|
+
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : At;
|
|
647
|
+
if (Kn && Kn(a, null), !ge(t))
|
|
648
648
|
return a;
|
|
649
649
|
let n = t.length;
|
|
650
650
|
for (; n--; ) {
|
|
651
651
|
let i = t[n];
|
|
652
652
|
if (typeof i == "string") {
|
|
653
653
|
const s = e(i);
|
|
654
|
-
s !== i && (
|
|
654
|
+
s !== i && (fi(t) || (t[n] = s), i = s);
|
|
655
655
|
}
|
|
656
656
|
a[i] = !0;
|
|
657
657
|
}
|
|
658
658
|
return a;
|
|
659
659
|
}
|
|
660
|
-
d(
|
|
661
|
-
function
|
|
660
|
+
d(O, "addToSet");
|
|
661
|
+
function Ti(a) {
|
|
662
662
|
for (let t = 0; t < a.length; t++)
|
|
663
|
-
|
|
663
|
+
ae(a, t) || (a[t] = null);
|
|
664
664
|
return a;
|
|
665
665
|
}
|
|
666
|
-
d(
|
|
667
|
-
function
|
|
668
|
-
const t =
|
|
666
|
+
d(Ti, "cleanArray");
|
|
667
|
+
function de(a) {
|
|
668
|
+
const t = dt(null);
|
|
669
669
|
for (const n of bs(a)) {
|
|
670
|
-
var e =
|
|
670
|
+
var e = di(n, 2);
|
|
671
671
|
const i = e[0], s = e[1];
|
|
672
|
-
|
|
672
|
+
ae(a, i) && (ge(s) ? t[i] = Ti(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = de(s) : t[i] = s);
|
|
673
673
|
}
|
|
674
674
|
return t;
|
|
675
675
|
}
|
|
676
|
-
d(
|
|
677
|
-
function
|
|
676
|
+
d(de, "clone");
|
|
677
|
+
function Si(a) {
|
|
678
678
|
switch (typeof a) {
|
|
679
679
|
case "string":
|
|
680
680
|
return a;
|
|
681
681
|
case "number":
|
|
682
|
-
return
|
|
682
|
+
return vi(a);
|
|
683
683
|
case "boolean":
|
|
684
|
-
return
|
|
684
|
+
return yi(a);
|
|
685
685
|
case "bigint":
|
|
686
|
-
return
|
|
686
|
+
return Jn ? Jn(a) : "0";
|
|
687
687
|
case "symbol":
|
|
688
|
-
return
|
|
688
|
+
return es ? es(a) : "Symbol()";
|
|
689
689
|
case "undefined":
|
|
690
|
-
return
|
|
690
|
+
return wt(a);
|
|
691
691
|
case "function":
|
|
692
692
|
case "object": {
|
|
693
693
|
if (a === null)
|
|
694
|
-
return
|
|
695
|
-
const t = a, e =
|
|
694
|
+
return wt(a);
|
|
695
|
+
const t = a, e = Le(t, "toString");
|
|
696
696
|
if (typeof e == "function") {
|
|
697
697
|
const n = e(t);
|
|
698
|
-
return typeof n == "string" ? n :
|
|
698
|
+
return typeof n == "string" ? n : wt(n);
|
|
699
699
|
}
|
|
700
|
-
return
|
|
700
|
+
return wt(a);
|
|
701
701
|
}
|
|
702
702
|
default:
|
|
703
|
-
return
|
|
703
|
+
return wt(a);
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
|
-
d(
|
|
707
|
-
function
|
|
706
|
+
d(Si, "stringifyValue");
|
|
707
|
+
function Le(a, t) {
|
|
708
708
|
for (; a !== null; ) {
|
|
709
|
-
const n =
|
|
709
|
+
const n = mi(a, t);
|
|
710
710
|
if (n) {
|
|
711
711
|
if (n.get)
|
|
712
|
-
return
|
|
712
|
+
return oe(n.get);
|
|
713
713
|
if (typeof n.value == "function")
|
|
714
|
-
return
|
|
714
|
+
return oe(n.value);
|
|
715
715
|
}
|
|
716
|
-
a =
|
|
716
|
+
a = gi(a);
|
|
717
717
|
}
|
|
718
718
|
function e() {
|
|
719
719
|
return null;
|
|
720
720
|
}
|
|
721
721
|
return d(e, "fallbackValue"), e;
|
|
722
722
|
}
|
|
723
|
-
d(
|
|
724
|
-
function
|
|
723
|
+
d(Le, "lookupGetter");
|
|
724
|
+
function Ai(a) {
|
|
725
725
|
try {
|
|
726
|
-
return
|
|
726
|
+
return he(a, ""), !0;
|
|
727
727
|
} catch {
|
|
728
728
|
return !1;
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
d(
|
|
732
|
-
const
|
|
731
|
+
d(Ai, "isRegex");
|
|
732
|
+
const ts = ke(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), an = ke(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), rn = ke(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), _i = ke(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), ln = ke(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ei = ke(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ns = ke(["#text"]), ss = ke(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), on = ke(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), is = ke(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Nt = ke(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ri = Ae(/{{[\w\W]*|^[\w\W]*}}/g), Ci = Ae(/<%[\w\W]*|^[\w\W]*%>/g), Ii = Ae(/\${[\w\W]*/g), Di = Ae(/^data-[\-\w.\u00B7-\uFFFF]+$/), Mi = Ae(/^aria-[\-\w]+$/), as = Ae(
|
|
733
733
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
734
734
|
// eslint-disable-line no-useless-escape
|
|
735
|
-
),
|
|
735
|
+
), $i = Ae(/^(?:\w+script|data):/i), Li = Ae(
|
|
736
736
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
737
737
|
// eslint-disable-line no-control-regex
|
|
738
|
-
), Oi =
|
|
738
|
+
), Oi = Ae(/^html$/i), Ni = Ae(/^[a-z][.\w]*(-[.\w]+)+$/i), $e = {
|
|
739
739
|
element: 1,
|
|
740
740
|
attribute: 2,
|
|
741
741
|
text: 3,
|
|
@@ -751,9 +751,9 @@ const es = le(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
751
751
|
documentFragment: 11,
|
|
752
752
|
notation: 12
|
|
753
753
|
// Deprecated
|
|
754
|
-
},
|
|
754
|
+
}, zi = /* @__PURE__ */ d(function() {
|
|
755
755
|
return typeof window > "u" ? null : window;
|
|
756
|
-
}, "getGlobal"),
|
|
756
|
+
}, "getGlobal"), Pi = /* @__PURE__ */ d(function(t, e) {
|
|
757
757
|
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
758
758
|
return null;
|
|
759
759
|
let n = null;
|
|
@@ -772,7 +772,7 @@ const es = le(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
772
772
|
} catch {
|
|
773
773
|
return console.warn("TrustedTypes policy " + s + " could not be created."), null;
|
|
774
774
|
}
|
|
775
|
-
}, "_createTrustedTypesPolicy"),
|
|
775
|
+
}, "_createTrustedTypesPolicy"), rs = /* @__PURE__ */ d(function() {
|
|
776
776
|
return {
|
|
777
777
|
afterSanitizeAttributes: [],
|
|
778
778
|
afterSanitizeElements: [],
|
|
@@ -785,31 +785,31 @@ const es = le(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
785
785
|
uponSanitizeShadowNode: []
|
|
786
786
|
};
|
|
787
787
|
}, "_createHooksMap");
|
|
788
|
-
function
|
|
789
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
790
|
-
const t = /* @__PURE__ */ d((
|
|
791
|
-
if (t.version = "3.4.7", t.removed = [], !a || !a.document || a.document.nodeType !==
|
|
788
|
+
function ys() {
|
|
789
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : zi();
|
|
790
|
+
const t = /* @__PURE__ */ d((C) => ys(C), "DOMPurify");
|
|
791
|
+
if (t.version = "3.4.7", t.removed = [], !a || !a.document || a.document.nodeType !== $e.document || !a.Element)
|
|
792
792
|
return t.isSupported = !1, t;
|
|
793
793
|
let e = a.document;
|
|
794
794
|
const n = e, i = n.currentScript;
|
|
795
795
|
a.DocumentFragment;
|
|
796
|
-
const s = a.HTMLTemplateElement, l = a.Node, o = a.Element,
|
|
796
|
+
const s = a.HTMLTemplateElement, l = a.Node, o = a.Element, u = a.NodeFilter, c = a.NamedNodeMap;
|
|
797
797
|
c === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
798
|
-
const
|
|
798
|
+
const y = a.DOMParser, v = a.trustedTypes, A = o.prototype, _ = Le(A, "cloneNode"), G = Le(A, "remove"), R = Le(A, "nextSibling"), X = Le(A, "childNodes"), ee = Le(A, "parentNode"), $ = Le(A, "shadowRoot"), P = Le(A, "attributes"), N = l && l.prototype ? Le(l.prototype, "nodeType") : null, V = l && l.prototype ? Le(l.prototype, "nodeName") : null;
|
|
799
799
|
if (typeof s == "function") {
|
|
800
|
-
const
|
|
801
|
-
|
|
802
|
-
}
|
|
803
|
-
let
|
|
804
|
-
const
|
|
805
|
-
let
|
|
806
|
-
t.isSupported = typeof bs == "function" && typeof
|
|
807
|
-
const
|
|
808
|
-
let
|
|
809
|
-
const
|
|
810
|
-
let
|
|
811
|
-
const
|
|
812
|
-
let
|
|
800
|
+
const C = e.createElement("template");
|
|
801
|
+
C.content && C.content.ownerDocument && (e = C.content.ownerDocument);
|
|
802
|
+
}
|
|
803
|
+
let U, J = "";
|
|
804
|
+
const ze = e, fe = ze.implementation, Te = ze.createNodeIterator, Ye = ze.createDocumentFragment, Ke = ze.getElementsByTagName, Ue = n.importNode;
|
|
805
|
+
let ie = rs();
|
|
806
|
+
t.isSupported = typeof bs == "function" && typeof ee == "function" && fe && fe.createHTMLDocument !== void 0;
|
|
807
|
+
const ve = Ri, ye = Ci, ce = Ii, He = Di, z = Mi, et = $i, Pe = Li, Ge = Ni;
|
|
808
|
+
let tt = as, te = null;
|
|
809
|
+
const k = O({}, [...ts, ...an, ...rn, ...ln, ...ns]);
|
|
810
|
+
let w = null;
|
|
811
|
+
const x = O({}, [...ss, ...on, ...is, ...Nt]);
|
|
812
|
+
let b = Object.seal(dt(null, {
|
|
813
813
|
tagNameCheck: {
|
|
814
814
|
writable: !0,
|
|
815
815
|
configurable: !1,
|
|
@@ -828,8 +828,8 @@ function vs() {
|
|
|
828
828
|
enumerable: !0,
|
|
829
829
|
value: !1
|
|
830
830
|
}
|
|
831
|
-
})),
|
|
832
|
-
const
|
|
831
|
+
})), M = null, H = null;
|
|
832
|
+
const j = Object.seal(dt(null, {
|
|
833
833
|
tagCheck: {
|
|
834
834
|
writable: !0,
|
|
835
835
|
configurable: !1,
|
|
@@ -843,142 +843,142 @@ function vs() {
|
|
|
843
843
|
value: null
|
|
844
844
|
}
|
|
845
845
|
}));
|
|
846
|
-
let
|
|
847
|
-
const
|
|
848
|
-
let
|
|
849
|
-
const
|
|
850
|
-
let
|
|
851
|
-
const
|
|
852
|
-
let
|
|
853
|
-
const
|
|
854
|
-
let
|
|
855
|
-
const
|
|
856
|
-
let
|
|
857
|
-
const
|
|
858
|
-
let
|
|
859
|
-
const
|
|
860
|
-
let
|
|
861
|
-
const Ns = e.createElement("form"),
|
|
846
|
+
let E = !0, g = !0, p = !1, L = !0, Q = !1, be = !0, we = !1, Fe = !1, Vt = !1, nt = !1, Rt = !1, Ct = !1, An = !0, _n = !1;
|
|
847
|
+
const En = "user-content-";
|
|
848
|
+
let Yt = !0, kt = !1, st = {}, Ie = null;
|
|
849
|
+
const Kt = O({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
850
|
+
let Rn = null;
|
|
851
|
+
const Cn = O({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
852
|
+
let Zt = null;
|
|
853
|
+
const In = O({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), It = "http://www.w3.org/1998/Math/MathML", Dt = "http://www.w3.org/2000/svg", De = "http://www.w3.org/1999/xhtml";
|
|
854
|
+
let it = De, Xt = !1, Qt = null;
|
|
855
|
+
const Ms = O({}, [It, Dt, De], sn);
|
|
856
|
+
let Jt = O({}, ["mi", "mo", "mn", "ms", "mtext"]), en = O({}, ["annotation-xml"]);
|
|
857
|
+
const $s = O({}, ["title", "style", "font", "a", "script"]);
|
|
858
|
+
let bt = null;
|
|
859
|
+
const Ls = ["application/xhtml+xml", "text/html"], Os = "text/html";
|
|
860
|
+
let le = null, at = null;
|
|
861
|
+
const Ns = e.createElement("form"), Dn = /* @__PURE__ */ d(function(r) {
|
|
862
862
|
return r instanceof RegExp || r instanceof Function;
|
|
863
|
-
}, "isRegexOrFunction"),
|
|
863
|
+
}, "isRegexOrFunction"), tn = /* @__PURE__ */ d(function() {
|
|
864
864
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
865
|
-
if (
|
|
865
|
+
if (at && at === r)
|
|
866
866
|
return;
|
|
867
|
-
(!r || typeof r != "object") && (r = {}), r =
|
|
868
|
-
|
|
869
|
-
const
|
|
870
|
-
if (
|
|
867
|
+
(!r || typeof r != "object") && (r = {}), r = de(r), bt = // eslint-disable-next-line unicorn/prefer-includes
|
|
868
|
+
Ls.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? Os : r.PARSER_MEDIA_TYPE, le = bt === "application/xhtml+xml" ? sn : At, te = ae(r, "ALLOWED_TAGS") && ge(r.ALLOWED_TAGS) ? O({}, r.ALLOWED_TAGS, le) : k, w = ae(r, "ALLOWED_ATTR") && ge(r.ALLOWED_ATTR) ? O({}, r.ALLOWED_ATTR, le) : x, Qt = ae(r, "ALLOWED_NAMESPACES") && ge(r.ALLOWED_NAMESPACES) ? O({}, r.ALLOWED_NAMESPACES, sn) : Ms, Zt = ae(r, "ADD_URI_SAFE_ATTR") && ge(r.ADD_URI_SAFE_ATTR) ? O(de(In), r.ADD_URI_SAFE_ATTR, le) : In, Rn = ae(r, "ADD_DATA_URI_TAGS") && ge(r.ADD_DATA_URI_TAGS) ? O(de(Cn), r.ADD_DATA_URI_TAGS, le) : Cn, Ie = ae(r, "FORBID_CONTENTS") && ge(r.FORBID_CONTENTS) ? O({}, r.FORBID_CONTENTS, le) : Kt, M = ae(r, "FORBID_TAGS") && ge(r.FORBID_TAGS) ? O({}, r.FORBID_TAGS, le) : de({}), H = ae(r, "FORBID_ATTR") && ge(r.FORBID_ATTR) ? O({}, r.FORBID_ATTR, le) : de({}), st = ae(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? de(r.USE_PROFILES) : r.USE_PROFILES : !1, E = r.ALLOW_ARIA_ATTR !== !1, g = r.ALLOW_DATA_ATTR !== !1, p = r.ALLOW_UNKNOWN_PROTOCOLS || !1, L = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Q = r.SAFE_FOR_TEMPLATES || !1, be = r.SAFE_FOR_XML !== !1, we = r.WHOLE_DOCUMENT || !1, nt = r.RETURN_DOM || !1, Rt = r.RETURN_DOM_FRAGMENT || !1, Ct = r.RETURN_TRUSTED_TYPE || !1, Vt = r.FORCE_BODY || !1, An = r.SANITIZE_DOM !== !1, _n = r.SANITIZE_NAMED_PROPS || !1, Yt = r.KEEP_CONTENT !== !1, kt = r.IN_PLACE || !1, tt = Ai(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : as, it = typeof r.NAMESPACE == "string" ? r.NAMESPACE : De, Jt = ae(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? de(r.MATHML_TEXT_INTEGRATION_POINTS) : O({}, ["mi", "mo", "mn", "ms", "mtext"]), en = ae(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? de(r.HTML_INTEGRATION_POINTS) : O({}, ["annotation-xml"]);
|
|
869
|
+
const h = ae(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? de(r.CUSTOM_ELEMENT_HANDLING) : dt(null);
|
|
870
|
+
if (b = dt(null), ae(h, "tagNameCheck") && Dn(h.tagNameCheck) && (b.tagNameCheck = h.tagNameCheck), ae(h, "attributeNameCheck") && Dn(h.attributeNameCheck) && (b.attributeNameCheck = h.attributeNameCheck), ae(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (b.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), Q && (g = !1), Rt && (nt = !0), st && (te = O({}, ns), w = dt(null), st.html === !0 && (O(te, ts), O(w, ss)), st.svg === !0 && (O(te, an), O(w, on), O(w, Nt)), st.svgFilters === !0 && (O(te, rn), O(w, on), O(w, Nt)), st.mathMl === !0 && (O(te, ln), O(w, is), O(w, Nt))), j.tagCheck = null, j.attributeCheck = null, ae(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? j.tagCheck = r.ADD_TAGS : ge(r.ADD_TAGS) && (te === k && (te = de(te)), O(te, r.ADD_TAGS, le))), ae(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? j.attributeCheck = r.ADD_ATTR : ge(r.ADD_ATTR) && (w === x && (w = de(w)), O(w, r.ADD_ATTR, le))), ae(r, "ADD_URI_SAFE_ATTR") && ge(r.ADD_URI_SAFE_ATTR) && O(Zt, r.ADD_URI_SAFE_ATTR, le), ae(r, "FORBID_CONTENTS") && ge(r.FORBID_CONTENTS) && (Ie === Kt && (Ie = de(Ie)), O(Ie, r.FORBID_CONTENTS, le)), ae(r, "ADD_FORBID_CONTENTS") && ge(r.ADD_FORBID_CONTENTS) && (Ie === Kt && (Ie = de(Ie)), O(Ie, r.ADD_FORBID_CONTENTS, le)), Yt && (te["#text"] = !0), we && O(te, ["html", "head", "body"]), te.table && (O(te, ["tbody"]), delete M.tbody), r.TRUSTED_TYPES_POLICY) {
|
|
871
871
|
if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
872
|
-
throw
|
|
872
|
+
throw Tt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
873
873
|
if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
874
|
-
throw
|
|
875
|
-
|
|
874
|
+
throw Tt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
875
|
+
U = r.TRUSTED_TYPES_POLICY, J = U.createHTML("");
|
|
876
876
|
} else
|
|
877
|
-
|
|
878
|
-
(
|
|
879
|
-
}, "_parseConfig"),
|
|
880
|
-
let
|
|
881
|
-
(!
|
|
882
|
-
namespaceURI:
|
|
877
|
+
U === void 0 && (U = Pi(v, i)), U !== null && typeof J == "string" && (J = U.createHTML(""));
|
|
878
|
+
(ie.uponSanitizeElement.length > 0 || ie.uponSanitizeAttribute.length > 0) && te === k && (te = de(te)), ie.uponSanitizeAttribute.length > 0 && w === x && (w = de(w)), ke && ke(r), at = r;
|
|
879
|
+
}, "_parseConfig"), Mn = O({}, [...an, ...rn, ..._i]), $n = O({}, [...ln, ...Ei]), zs = /* @__PURE__ */ d(function(r) {
|
|
880
|
+
let h = ee(r);
|
|
881
|
+
(!h || !h.tagName) && (h = {
|
|
882
|
+
namespaceURI: it,
|
|
883
883
|
tagName: "template"
|
|
884
884
|
});
|
|
885
|
-
const
|
|
886
|
-
return
|
|
887
|
-
}, "_checkValidNamespace"),
|
|
888
|
-
|
|
885
|
+
const S = At(r.tagName), K = At(h.tagName);
|
|
886
|
+
return Qt[r.namespaceURI] ? r.namespaceURI === Dt ? h.namespaceURI === De ? S === "svg" : h.namespaceURI === It ? S === "svg" && (K === "annotation-xml" || Jt[K]) : !!Mn[S] : r.namespaceURI === It ? h.namespaceURI === De ? S === "math" : h.namespaceURI === Dt ? S === "math" && en[K] : !!$n[S] : r.namespaceURI === De ? h.namespaceURI === Dt && !en[K] || h.namespaceURI === It && !Jt[K] ? !1 : !$n[S] && ($s[S] || !Mn[S]) : !!(bt === "application/xhtml+xml" && Qt[r.namespaceURI]) : !1;
|
|
887
|
+
}, "_checkValidNamespace"), _e = /* @__PURE__ */ d(function(r) {
|
|
888
|
+
ct(t.removed, {
|
|
889
889
|
element: r
|
|
890
890
|
});
|
|
891
891
|
try {
|
|
892
|
-
|
|
892
|
+
ee(r).removeChild(r);
|
|
893
893
|
} catch {
|
|
894
|
-
|
|
894
|
+
G(r);
|
|
895
895
|
}
|
|
896
|
-
}, "_forceRemove"),
|
|
896
|
+
}, "_forceRemove"), Ze = /* @__PURE__ */ d(function(r, h) {
|
|
897
897
|
try {
|
|
898
|
-
|
|
899
|
-
attribute:
|
|
900
|
-
from:
|
|
898
|
+
ct(t.removed, {
|
|
899
|
+
attribute: h.getAttributeNode(r),
|
|
900
|
+
from: h
|
|
901
901
|
});
|
|
902
902
|
} catch {
|
|
903
|
-
|
|
903
|
+
ct(t.removed, {
|
|
904
904
|
attribute: null,
|
|
905
|
-
from:
|
|
905
|
+
from: h
|
|
906
906
|
});
|
|
907
907
|
}
|
|
908
|
-
if (
|
|
909
|
-
if (
|
|
908
|
+
if (h.removeAttribute(r), r === "is")
|
|
909
|
+
if (nt || Rt)
|
|
910
910
|
try {
|
|
911
|
-
|
|
911
|
+
_e(h);
|
|
912
912
|
} catch {
|
|
913
913
|
}
|
|
914
914
|
else
|
|
915
915
|
try {
|
|
916
|
-
|
|
916
|
+
h.setAttribute(r, "");
|
|
917
917
|
} catch {
|
|
918
918
|
}
|
|
919
919
|
}, "_removeAttribute"), Ln = /* @__PURE__ */ d(function(r) {
|
|
920
|
-
let
|
|
921
|
-
if (
|
|
920
|
+
let h = null, S = null;
|
|
921
|
+
if (Vt)
|
|
922
922
|
r = "<remove></remove>" + r;
|
|
923
923
|
else {
|
|
924
|
-
const
|
|
925
|
-
|
|
924
|
+
const ne = Xn(r, /^[\r\n\t ]+/);
|
|
925
|
+
S = ne && ne[0];
|
|
926
926
|
}
|
|
927
|
-
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
927
|
+
bt === "application/xhtml+xml" && it === De && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
|
|
928
|
+
const K = U ? U.createHTML(r) : r;
|
|
929
|
+
if (it === De)
|
|
930
930
|
try {
|
|
931
|
-
|
|
931
|
+
h = new y().parseFromString(K, bt);
|
|
932
932
|
} catch {
|
|
933
933
|
}
|
|
934
|
-
if (!
|
|
935
|
-
|
|
934
|
+
if (!h || !h.documentElement) {
|
|
935
|
+
h = fe.createDocument(it, "template", null);
|
|
936
936
|
try {
|
|
937
|
-
|
|
937
|
+
h.documentElement.innerHTML = Xt ? J : K;
|
|
938
938
|
} catch {
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
|
-
const
|
|
942
|
-
return r &&
|
|
941
|
+
const B = h.body || h.documentElement;
|
|
942
|
+
return r && S && B.insertBefore(e.createTextNode(S), B.childNodes[0] || null), it === De ? Ke.call(h, we ? "html" : "body")[0] : we ? h.documentElement : B;
|
|
943
943
|
}, "_initDocument"), On = /* @__PURE__ */ d(function(r) {
|
|
944
|
-
return
|
|
944
|
+
return Te.call(
|
|
945
945
|
r.ownerDocument || r,
|
|
946
946
|
r,
|
|
947
947
|
// eslint-disable-next-line no-bitwise
|
|
948
|
-
|
|
948
|
+
u.SHOW_ELEMENT | u.SHOW_COMMENT | u.SHOW_TEXT | u.SHOW_PROCESSING_INSTRUCTION | u.SHOW_CDATA_SECTION,
|
|
949
949
|
null
|
|
950
950
|
);
|
|
951
|
-
}, "_createNodeIterator"),
|
|
951
|
+
}, "_createNodeIterator"), Nn = /* @__PURE__ */ d(function(r) {
|
|
952
952
|
r.normalize();
|
|
953
|
-
const
|
|
953
|
+
const h = Te.call(
|
|
954
954
|
r.ownerDocument || r,
|
|
955
955
|
r,
|
|
956
956
|
// eslint-disable-next-line no-bitwise
|
|
957
|
-
|
|
957
|
+
u.SHOW_TEXT | u.SHOW_COMMENT | u.SHOW_CDATA_SECTION | u.SHOW_PROCESSING_INSTRUCTION,
|
|
958
958
|
null
|
|
959
959
|
);
|
|
960
|
-
let
|
|
961
|
-
for (;
|
|
962
|
-
let
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
}),
|
|
966
|
-
}
|
|
967
|
-
}, "_scrubTemplateExpressions"),
|
|
968
|
-
const
|
|
969
|
-
return typeof
|
|
960
|
+
let S = h.nextNode();
|
|
961
|
+
for (; S; ) {
|
|
962
|
+
let K = S.data;
|
|
963
|
+
ot([ve, ye, ce], (B) => {
|
|
964
|
+
K = ut(K, B, " ");
|
|
965
|
+
}), S.data = K, S = h.nextNode();
|
|
966
|
+
}
|
|
967
|
+
}, "_scrubTemplateExpressions"), Mt = /* @__PURE__ */ d(function(r) {
|
|
968
|
+
const h = V ? V(r) : null;
|
|
969
|
+
return typeof h != "string" || le(h) !== "form" ? !1 : typeof r.nodeName != "string" || typeof r.textContent != "string" || typeof r.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
970
970
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
971
971
|
// makes the direct read diverge from the cached read; a clean form
|
|
972
972
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
973
973
|
// canonical NamedNodeMap.
|
|
974
|
-
r.attributes !==
|
|
974
|
+
r.attributes !== P(r) || typeof r.removeAttribute != "function" || typeof r.setAttribute != "function" || typeof r.namespaceURI != "string" || typeof r.insertBefore != "function" || typeof r.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
975
975
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
976
976
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
977
977
|
// the named child element. Cheap addition — nodeType is read from
|
|
978
978
|
// an internal slot, no serialization cost — and removes a residual
|
|
979
979
|
// clobbering surface used by several mXSS / PI / comment branches
|
|
980
980
|
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
981
|
-
r.nodeType !==
|
|
981
|
+
r.nodeType !== N(r) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
982
982
|
// "childNodes" shadows the prototype getter. Direct reads of
|
|
983
983
|
// form.childNodes from a clobbered form return the named child
|
|
984
984
|
// instead of the real NodeList, so any walk that reads it directly
|
|
@@ -990,79 +990,79 @@ function vs() {
|
|
|
990
990
|
// carry a numeric .length, which a typeof-based probe would miss
|
|
991
991
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
992
992
|
r.childNodes !== X(r);
|
|
993
|
-
}, "_isClobbered"),
|
|
994
|
-
if (!
|
|
993
|
+
}, "_isClobbered"), vt = /* @__PURE__ */ d(function(r) {
|
|
994
|
+
if (!N || typeof r != "object" || r === null)
|
|
995
995
|
return !1;
|
|
996
996
|
try {
|
|
997
|
-
return
|
|
997
|
+
return N(r) === $e.documentFragment;
|
|
998
998
|
} catch {
|
|
999
999
|
return !1;
|
|
1000
1000
|
}
|
|
1001
|
-
}, "_isDocumentFragment"),
|
|
1002
|
-
if (!
|
|
1001
|
+
}, "_isDocumentFragment"), $t = /* @__PURE__ */ d(function(r) {
|
|
1002
|
+
if (!N || typeof r != "object" || r === null)
|
|
1003
1003
|
return !1;
|
|
1004
1004
|
try {
|
|
1005
|
-
return typeof
|
|
1005
|
+
return typeof N(r) == "number";
|
|
1006
1006
|
} catch {
|
|
1007
1007
|
return !1;
|
|
1008
1008
|
}
|
|
1009
1009
|
}, "_isNode");
|
|
1010
|
-
function
|
|
1011
|
-
|
|
1012
|
-
|
|
1010
|
+
function Be(C, r, h) {
|
|
1011
|
+
ot(C, (S) => {
|
|
1012
|
+
S.call(t, r, h, at);
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
|
-
d(
|
|
1016
|
-
const
|
|
1017
|
-
let
|
|
1018
|
-
if (
|
|
1019
|
-
return
|
|
1020
|
-
const
|
|
1021
|
-
if (
|
|
1022
|
-
tagName:
|
|
1023
|
-
allowedTags:
|
|
1024
|
-
}),
|
|
1025
|
-
return
|
|
1026
|
-
if (
|
|
1027
|
-
if (!
|
|
1015
|
+
d(Be, "_executeHooks");
|
|
1016
|
+
const zn = /* @__PURE__ */ d(function(r) {
|
|
1017
|
+
let h = null;
|
|
1018
|
+
if (Be(ie.beforeSanitizeElements, r, null), Mt(r))
|
|
1019
|
+
return _e(r), !0;
|
|
1020
|
+
const S = le(r.nodeName);
|
|
1021
|
+
if (Be(ie.uponSanitizeElement, r, {
|
|
1022
|
+
tagName: S,
|
|
1023
|
+
allowedTags: te
|
|
1024
|
+
}), be && r.hasChildNodes() && !$t(r.firstElementChild) && he(/<[/\w!]/g, r.innerHTML) && he(/<[/\w!]/g, r.textContent) || be && r.namespaceURI === De && S === "style" && $t(r.firstElementChild) || r.nodeType === $e.progressingInstruction || be && r.nodeType === $e.comment && he(/<[/\w]/g, r.data))
|
|
1025
|
+
return _e(r), !0;
|
|
1026
|
+
if (M[S] || !(j.tagCheck instanceof Function && j.tagCheck(S)) && !te[S]) {
|
|
1027
|
+
if (!M[S] && Fn(S) && (b.tagNameCheck instanceof RegExp && he(b.tagNameCheck, S) || b.tagNameCheck instanceof Function && b.tagNameCheck(S)))
|
|
1028
1028
|
return !1;
|
|
1029
|
-
if (
|
|
1030
|
-
const
|
|
1031
|
-
if (
|
|
1032
|
-
const
|
|
1033
|
-
for (let
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1029
|
+
if (Yt && !Ie[S]) {
|
|
1030
|
+
const B = ee(r), ne = X(r);
|
|
1031
|
+
if (ne && B) {
|
|
1032
|
+
const Se = ne.length;
|
|
1033
|
+
for (let Me = Se - 1; Me >= 0; --Me) {
|
|
1034
|
+
const Ee = _(ne[Me], !0);
|
|
1035
|
+
B.insertBefore(Ee, R(r));
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
return
|
|
1039
|
+
return _e(r), !0;
|
|
1040
1040
|
}
|
|
1041
|
-
return (
|
|
1042
|
-
|
|
1043
|
-
}), r.textContent !==
|
|
1041
|
+
return (N ? N(r) : r.nodeType) === $e.element && !zs(r) || (S === "noscript" || S === "noembed" || S === "noframes") && he(/<\/no(script|embed|frames)/i, r.innerHTML) ? (_e(r), !0) : (Q && r.nodeType === $e.text && (h = r.textContent, ot([ve, ye, ce], (B) => {
|
|
1042
|
+
h = ut(h, B, " ");
|
|
1043
|
+
}), r.textContent !== h && (ct(t.removed, {
|
|
1044
1044
|
element: r.cloneNode()
|
|
1045
|
-
}), r.textContent =
|
|
1046
|
-
}, "_sanitizeElements"),
|
|
1047
|
-
if (
|
|
1045
|
+
}), r.textContent = h)), Be(ie.afterSanitizeElements, r, null), !1);
|
|
1046
|
+
}, "_sanitizeElements"), Pn = /* @__PURE__ */ d(function(r, h, S) {
|
|
1047
|
+
if (H[h] || An && (h === "id" || h === "name") && (S in e || S in Ns))
|
|
1048
1048
|
return !1;
|
|
1049
|
-
const
|
|
1050
|
-
if (!(g && !
|
|
1051
|
-
if (!(
|
|
1052
|
-
if (!
|
|
1049
|
+
const K = w[h] || j.attributeCheck instanceof Function && j.attributeCheck(h, r);
|
|
1050
|
+
if (!(g && !H[h] && he(He, h))) {
|
|
1051
|
+
if (!(E && he(z, h))) {
|
|
1052
|
+
if (!K || H[h]) {
|
|
1053
1053
|
if (
|
|
1054
1054
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1055
1055
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1056
1056
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
1057
|
-
!(
|
|
1057
|
+
!(Fn(r) && (b.tagNameCheck instanceof RegExp && he(b.tagNameCheck, r) || b.tagNameCheck instanceof Function && b.tagNameCheck(r)) && (b.attributeNameCheck instanceof RegExp && he(b.attributeNameCheck, h) || b.attributeNameCheck instanceof Function && b.attributeNameCheck(h, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
1058
1058
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1059
|
-
|
|
1059
|
+
h === "is" && b.allowCustomizedBuiltInElements && (b.tagNameCheck instanceof RegExp && he(b.tagNameCheck, S) || b.tagNameCheck instanceof Function && b.tagNameCheck(S)))
|
|
1060
1060
|
) return !1;
|
|
1061
|
-
} else if (!
|
|
1062
|
-
if (!
|
|
1063
|
-
if (!((
|
|
1064
|
-
if (!(p && !
|
|
1065
|
-
if (
|
|
1061
|
+
} else if (!Zt[h]) {
|
|
1062
|
+
if (!he(tt, ut(S, Pe, ""))) {
|
|
1063
|
+
if (!((h === "src" || h === "xlink:href" || h === "href") && r !== "script" && Qn(S, "data:") === 0 && Rn[r])) {
|
|
1064
|
+
if (!(p && !he(et, ut(S, Pe, "")))) {
|
|
1065
|
+
if (S)
|
|
1066
1066
|
return !1;
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
@@ -1071,233 +1071,233 @@ function vs() {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
1073
1073
|
return !0;
|
|
1074
|
-
}, "_isValidAttribute"),
|
|
1075
|
-
return
|
|
1076
|
-
}, "_isBasicCustomElement"),
|
|
1077
|
-
|
|
1078
|
-
const
|
|
1079
|
-
if (!
|
|
1074
|
+
}, "_isValidAttribute"), Ps = O({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Fn = /* @__PURE__ */ d(function(r) {
|
|
1075
|
+
return !Ps[At(r)] && he(Ge, r);
|
|
1076
|
+
}, "_isBasicCustomElement"), Bn = /* @__PURE__ */ d(function(r) {
|
|
1077
|
+
Be(ie.beforeSanitizeAttributes, r, null);
|
|
1078
|
+
const h = r.attributes;
|
|
1079
|
+
if (!h || Mt(r))
|
|
1080
1080
|
return;
|
|
1081
|
-
const
|
|
1081
|
+
const S = {
|
|
1082
1082
|
attrName: "",
|
|
1083
1083
|
attrValue: "",
|
|
1084
1084
|
keepAttr: !0,
|
|
1085
|
-
allowedAttributes:
|
|
1085
|
+
allowedAttributes: w,
|
|
1086
1086
|
forceKeepAttr: void 0
|
|
1087
1087
|
};
|
|
1088
|
-
let
|
|
1089
|
-
for (;
|
|
1090
|
-
const
|
|
1091
|
-
let
|
|
1092
|
-
if (
|
|
1093
|
-
|
|
1088
|
+
let K = h.length;
|
|
1089
|
+
for (; K--; ) {
|
|
1090
|
+
const B = h[K], ne = B.name, Se = B.namespaceURI, Me = B.value, Ee = le(ne), nn = Me;
|
|
1091
|
+
let ue = ne === "value" ? nn : bi(nn);
|
|
1092
|
+
if (S.attrName = Ee, S.attrValue = ue, S.keepAttr = !0, S.forceKeepAttr = void 0, Be(ie.uponSanitizeAttribute, r, S), ue = S.attrValue, _n && (Ee === "id" || Ee === "name") && Qn(ue, En) !== 0 && (Ze(ne, r), ue = En + ue), be && he(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, ue)) {
|
|
1093
|
+
Ze(ne, r);
|
|
1094
1094
|
continue;
|
|
1095
1095
|
}
|
|
1096
|
-
if (
|
|
1097
|
-
|
|
1096
|
+
if (Ee === "attributename" && Xn(ue, "href")) {
|
|
1097
|
+
Ze(ne, r);
|
|
1098
1098
|
continue;
|
|
1099
1099
|
}
|
|
1100
|
-
if (
|
|
1100
|
+
if (S.forceKeepAttr)
|
|
1101
1101
|
continue;
|
|
1102
|
-
if (!
|
|
1103
|
-
|
|
1102
|
+
if (!S.keepAttr) {
|
|
1103
|
+
Ze(ne, r);
|
|
1104
1104
|
continue;
|
|
1105
1105
|
}
|
|
1106
|
-
if (!
|
|
1107
|
-
|
|
1106
|
+
if (!L && he(/\/>/i, ue)) {
|
|
1107
|
+
Ze(ne, r);
|
|
1108
1108
|
continue;
|
|
1109
1109
|
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1110
|
+
Q && ot([ve, ye, ce], (Hn) => {
|
|
1111
|
+
ue = ut(ue, Hn, " ");
|
|
1112
1112
|
});
|
|
1113
|
-
const
|
|
1114
|
-
if (!
|
|
1115
|
-
|
|
1113
|
+
const Un = le(r.nodeName);
|
|
1114
|
+
if (!Pn(Un, Ee, ue)) {
|
|
1115
|
+
Ze(ne, r);
|
|
1116
1116
|
continue;
|
|
1117
1117
|
}
|
|
1118
|
-
if (
|
|
1119
|
-
switch (
|
|
1118
|
+
if (U && typeof v == "object" && typeof v.getAttributeType == "function" && !Se)
|
|
1119
|
+
switch (v.getAttributeType(Un, Ee)) {
|
|
1120
1120
|
case "TrustedHTML": {
|
|
1121
|
-
|
|
1121
|
+
ue = U.createHTML(ue);
|
|
1122
1122
|
break;
|
|
1123
1123
|
}
|
|
1124
1124
|
case "TrustedScriptURL": {
|
|
1125
|
-
|
|
1125
|
+
ue = U.createScriptURL(ue);
|
|
1126
1126
|
break;
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
if (
|
|
1129
|
+
if (ue !== nn)
|
|
1130
1130
|
try {
|
|
1131
|
-
|
|
1131
|
+
Se ? r.setAttributeNS(Se, ne, ue) : r.setAttribute(ne, ue), Mt(r) ? _e(r) : Zn(t.removed);
|
|
1132
1132
|
} catch {
|
|
1133
|
-
|
|
1133
|
+
Ze(ne, r);
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
|
-
|
|
1137
|
-
}, "_sanitizeAttributes"),
|
|
1138
|
-
let
|
|
1139
|
-
const
|
|
1140
|
-
for (
|
|
1141
|
-
if (
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
|
-
}, "_sanitizeShadowDOM"),
|
|
1147
|
-
const
|
|
1148
|
-
if (
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1151
|
-
}
|
|
1152
|
-
const
|
|
1153
|
-
if (!
|
|
1136
|
+
Be(ie.afterSanitizeAttributes, r, null);
|
|
1137
|
+
}, "_sanitizeAttributes"), Lt = /* @__PURE__ */ d(function(r) {
|
|
1138
|
+
let h = null;
|
|
1139
|
+
const S = On(r);
|
|
1140
|
+
for (Be(ie.beforeSanitizeShadowDOM, r, null); h = S.nextNode(); )
|
|
1141
|
+
if (Be(ie.uponSanitizeShadowNode, h, null), zn(h), Bn(h), vt(h.content) && Lt(h.content), (N ? N(h) : h.nodeType) === $e.element) {
|
|
1142
|
+
const B = $ ? $(h) : h.shadowRoot;
|
|
1143
|
+
vt(B) && (rt(B), Lt(B));
|
|
1144
|
+
}
|
|
1145
|
+
Be(ie.afterSanitizeShadowDOM, r, null);
|
|
1146
|
+
}, "_sanitizeShadowDOM"), rt = /* @__PURE__ */ d(function(r) {
|
|
1147
|
+
const h = N ? N(r) : r.nodeType;
|
|
1148
|
+
if (h === $e.element) {
|
|
1149
|
+
const B = $ ? $(r) : r.shadowRoot;
|
|
1150
|
+
vt(B) && (rt(B), Lt(B));
|
|
1151
|
+
}
|
|
1152
|
+
const S = X ? X(r) : r.childNodes;
|
|
1153
|
+
if (!S)
|
|
1154
1154
|
return;
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
|
|
1155
|
+
const K = [];
|
|
1156
|
+
ot(S, (B) => {
|
|
1157
|
+
ct(K, B);
|
|
1158
1158
|
});
|
|
1159
|
-
for (const
|
|
1160
|
-
|
|
1161
|
-
if (
|
|
1162
|
-
const
|
|
1163
|
-
if (typeof
|
|
1164
|
-
const
|
|
1165
|
-
|
|
1159
|
+
for (const B of K)
|
|
1160
|
+
rt(B);
|
|
1161
|
+
if (h === $e.element) {
|
|
1162
|
+
const B = V ? V(r) : null;
|
|
1163
|
+
if (typeof B == "string" && le(B) === "template") {
|
|
1164
|
+
const ne = r.content;
|
|
1165
|
+
vt(ne) && rt(ne);
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
1168
|
}, "_sanitizeAttachedShadowRoots");
|
|
1169
|
-
return t.sanitize = function(
|
|
1170
|
-
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
1171
|
-
if (
|
|
1172
|
-
throw
|
|
1169
|
+
return t.sanitize = function(C) {
|
|
1170
|
+
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = null, S = null, K = null, B = null;
|
|
1171
|
+
if (Xt = !C, Xt && (C = "<!-->"), typeof C != "string" && !$t(C) && (C = Si(C), typeof C != "string"))
|
|
1172
|
+
throw Tt("dirty is not a string, aborting");
|
|
1173
1173
|
if (!t.isSupported)
|
|
1174
|
-
return
|
|
1175
|
-
if (
|
|
1176
|
-
const
|
|
1177
|
-
if (typeof
|
|
1178
|
-
const
|
|
1179
|
-
if (!
|
|
1180
|
-
throw
|
|
1181
|
-
}
|
|
1182
|
-
if (
|
|
1183
|
-
throw
|
|
1184
|
-
|
|
1185
|
-
} else if (
|
|
1186
|
-
|
|
1174
|
+
return C;
|
|
1175
|
+
if (Fe || tn(r), t.removed = [], typeof C == "string" && (kt = !1), kt) {
|
|
1176
|
+
const Me = V ? V(C) : C.nodeName;
|
|
1177
|
+
if (typeof Me == "string") {
|
|
1178
|
+
const Ee = le(Me);
|
|
1179
|
+
if (!te[Ee] || M[Ee])
|
|
1180
|
+
throw Tt("root node is forbidden and cannot be sanitized in-place");
|
|
1181
|
+
}
|
|
1182
|
+
if (Mt(C))
|
|
1183
|
+
throw Tt("root node is clobbered and cannot be sanitized in-place");
|
|
1184
|
+
rt(C);
|
|
1185
|
+
} else if ($t(C))
|
|
1186
|
+
h = Ln("<!---->"), S = h.ownerDocument.importNode(C, !0), S.nodeType === $e.element && S.nodeName === "BODY" || S.nodeName === "HTML" ? h = S : h.appendChild(S), rt(S);
|
|
1187
1187
|
else {
|
|
1188
|
-
if (!
|
|
1189
|
-
|
|
1190
|
-
return
|
|
1191
|
-
if (
|
|
1192
|
-
return
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
|
-
const
|
|
1196
|
-
for (;
|
|
1197
|
-
|
|
1198
|
-
if (
|
|
1199
|
-
return
|
|
1200
|
-
if (
|
|
1201
|
-
if (
|
|
1202
|
-
for (
|
|
1203
|
-
|
|
1188
|
+
if (!nt && !Q && !we && // eslint-disable-next-line unicorn/prefer-includes
|
|
1189
|
+
C.indexOf("<") === -1)
|
|
1190
|
+
return U && Ct ? U.createHTML(C) : C;
|
|
1191
|
+
if (h = Ln(C), !h)
|
|
1192
|
+
return nt ? null : Ct ? J : "";
|
|
1193
|
+
}
|
|
1194
|
+
h && Vt && _e(h.firstChild);
|
|
1195
|
+
const ne = On(kt ? C : h);
|
|
1196
|
+
for (; K = ne.nextNode(); )
|
|
1197
|
+
zn(K), Bn(K), vt(K.content) && Lt(K.content);
|
|
1198
|
+
if (kt)
|
|
1199
|
+
return Q && Nn(C), C;
|
|
1200
|
+
if (nt) {
|
|
1201
|
+
if (Q && Nn(h), Rt)
|
|
1202
|
+
for (B = Ye.call(h.ownerDocument); h.firstChild; )
|
|
1203
|
+
B.appendChild(h.firstChild);
|
|
1204
1204
|
else
|
|
1205
|
-
|
|
1206
|
-
return (
|
|
1207
|
-
}
|
|
1208
|
-
let
|
|
1209
|
-
return
|
|
1210
|
-
` +
|
|
1211
|
-
|
|
1212
|
-
}),
|
|
1205
|
+
B = h;
|
|
1206
|
+
return (w.shadowroot || w.shadowrootmode) && (B = Ue.call(n, B, !0)), B;
|
|
1207
|
+
}
|
|
1208
|
+
let Se = we ? h.outerHTML : h.innerHTML;
|
|
1209
|
+
return we && te["!doctype"] && h.ownerDocument && h.ownerDocument.doctype && h.ownerDocument.doctype.name && he(Oi, h.ownerDocument.doctype.name) && (Se = "<!DOCTYPE " + h.ownerDocument.doctype.name + `>
|
|
1210
|
+
` + Se), Q && ot([ve, ye, ce], (Me) => {
|
|
1211
|
+
Se = ut(Se, Me, " ");
|
|
1212
|
+
}), U && Ct ? U.createHTML(Se) : Se;
|
|
1213
1213
|
}, t.setConfig = function() {
|
|
1214
|
-
let
|
|
1215
|
-
|
|
1214
|
+
let C = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1215
|
+
tn(C), Fe = !0;
|
|
1216
1216
|
}, t.clearConfig = function() {
|
|
1217
|
-
|
|
1218
|
-
}, t.isValidAttribute = function(
|
|
1219
|
-
|
|
1220
|
-
const
|
|
1221
|
-
return
|
|
1222
|
-
}, t.addHook = function(
|
|
1223
|
-
typeof r == "function" &&
|
|
1224
|
-
}, t.removeHook = function(
|
|
1217
|
+
at = null, Fe = !1;
|
|
1218
|
+
}, t.isValidAttribute = function(C, r, h) {
|
|
1219
|
+
at || tn({});
|
|
1220
|
+
const S = le(C), K = le(r);
|
|
1221
|
+
return Pn(S, K, h);
|
|
1222
|
+
}, t.addHook = function(C, r) {
|
|
1223
|
+
typeof r == "function" && ct(ie[C], r);
|
|
1224
|
+
}, t.removeHook = function(C, r) {
|
|
1225
1225
|
if (r !== void 0) {
|
|
1226
|
-
const
|
|
1227
|
-
return
|
|
1226
|
+
const h = xi(ie[C], r);
|
|
1227
|
+
return h === -1 ? void 0 : ki(ie[C], h, 1)[0];
|
|
1228
1228
|
}
|
|
1229
|
-
return Zn(
|
|
1230
|
-
}, t.removeHooks = function(
|
|
1231
|
-
|
|
1229
|
+
return Zn(ie[C]);
|
|
1230
|
+
}, t.removeHooks = function(C) {
|
|
1231
|
+
ie[C] = [];
|
|
1232
1232
|
}, t.removeAllHooks = function() {
|
|
1233
|
-
|
|
1233
|
+
ie = rs();
|
|
1234
1234
|
}, t;
|
|
1235
1235
|
}
|
|
1236
|
-
d(
|
|
1237
|
-
var
|
|
1238
|
-
function
|
|
1236
|
+
d(ys, "createDOMPurify");
|
|
1237
|
+
var Fi = ys();
|
|
1238
|
+
function gn() {
|
|
1239
1239
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1240
1240
|
}
|
|
1241
|
-
d(
|
|
1242
|
-
var
|
|
1243
|
-
function
|
|
1244
|
-
|
|
1241
|
+
d(gn, "M");
|
|
1242
|
+
var Je = gn();
|
|
1243
|
+
function ws(a) {
|
|
1244
|
+
Je = a;
|
|
1245
1245
|
}
|
|
1246
|
-
d(
|
|
1247
|
-
var
|
|
1248
|
-
function
|
|
1246
|
+
d(ws, "N");
|
|
1247
|
+
var Xe = { exec: /* @__PURE__ */ d(() => null, "exec") };
|
|
1248
|
+
function ht(a) {
|
|
1249
1249
|
let t = [];
|
|
1250
1250
|
return (e) => {
|
|
1251
1251
|
let n = Math.max(0, Math.min(3, e - 1)), i = t[n];
|
|
1252
1252
|
return i || (i = a(n), t[n] = i), i;
|
|
1253
1253
|
};
|
|
1254
1254
|
}
|
|
1255
|
-
d(
|
|
1256
|
-
function
|
|
1255
|
+
d(ht, "E");
|
|
1256
|
+
function W(a, t = "") {
|
|
1257
1257
|
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ d((i, s) => {
|
|
1258
1258
|
let l = typeof s == "string" ? s : s.source;
|
|
1259
|
-
return l = l.replace(
|
|
1259
|
+
return l = l.replace(pe.caret, "$1"), e = e.replace(i, l), n;
|
|
1260
1260
|
}, "replace"), getRegex: /* @__PURE__ */ d(() => new RegExp(e, t), "getRegex") };
|
|
1261
1261
|
return n;
|
|
1262
1262
|
}
|
|
1263
|
-
d(
|
|
1264
|
-
var
|
|
1263
|
+
d(W, "d");
|
|
1264
|
+
var Bi = ((a = "") => {
|
|
1265
1265
|
try {
|
|
1266
1266
|
return !!new RegExp("(?<=1)(?<!1)" + a);
|
|
1267
1267
|
} catch {
|
|
1268
1268
|
return !1;
|
|
1269
1269
|
}
|
|
1270
|
-
})(),
|
|
1271
|
-
]`).replace("lheading",
|
|
1272
|
-
function
|
|
1270
|
+
})(), pe = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ d((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: ht((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: ht((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: ht((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: ht((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: ht((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: ht((a) => new RegExp(`^ {0,${a}}>`)) }, Ui = /^(?:[ \t]*(?:\n|$))+/, Hi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Gi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Et = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ji = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, mn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ts = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ss = W(Ts).replace(/bull/g, mn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Wi = W(Ts).replace(/bull/g, mn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), xn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, qi = /^[^\n]+/, kn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Vi = W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", kn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Yi = W(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, mn).getRegex(), Wt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", bn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ki = W("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", bn).replace("tag", Wt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), As = W(xn).replace("hr", Et).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Wt).getRegex(), Zi = W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", As).getRegex(), vn = { blockquote: Zi, code: Hi, def: Vi, fences: Gi, heading: ji, hr: Et, html: Ki, lheading: Ss, list: Yi, newline: Ui, paragraph: As, table: Xe, text: qi }, ls = W("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Et).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Wt).getRegex(), Xi = { ...vn, lheading: Wi, table: ls, paragraph: W(xn).replace("hr", Et).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ls).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Wt).getRegex() }, Qi = { ...vn, html: W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", bn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: Xe, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: W(xn).replace("hr", Et).replace("heading", ` *#{1,6} *[^
|
|
1271
|
+
]`).replace("lheading", Ss).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ji = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ea = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _s = /^( {2,}|\\)\n(?!\s*$)/, ta = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, xt = /[\p{P}\p{S}]/u, qt = /[\s\p{P}\p{S}]/u, yn = /[^\s\p{P}\p{S}]/u, na = W(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, qt).getRegex(), Es = /(?!~)[\p{P}\p{S}]/u, sa = /(?!~)[\s\p{P}\p{S}]/u, ia = /(?:[^\s\p{P}\p{S}]|~)/u, aa = W(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Bi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Rs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ra = W(Rs, "u").replace(/punct/g, xt).getRegex(), la = W(Rs, "u").replace(/punct/g, Es).getRegex(), Cs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", oa = W(Cs, "gu").replace(/notPunctSpace/g, yn).replace(/punctSpace/g, qt).replace(/punct/g, xt).getRegex(), ca = W(Cs, "gu").replace(/notPunctSpace/g, ia).replace(/punctSpace/g, sa).replace(/punct/g, Es).getRegex(), ua = W("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, yn).replace(/punctSpace/g, qt).replace(/punct/g, xt).getRegex(), ha = W(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, xt).getRegex(), da = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", pa = W(da, "gu").replace(/notPunctSpace/g, yn).replace(/punctSpace/g, qt).replace(/punct/g, xt).getRegex(), fa = W(/\\(punct)/, "gu").replace(/punct/g, xt).getRegex(), ga = W(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ma = W(bn).replace("(?:-->|$)", "-->").getRegex(), xa = W("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ma).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ut = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ka = W(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Ut).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Is = W(/^!?\[(label)\]\[(ref)\]/).replace("label", Ut).replace("ref", kn).getRegex(), Ds = W(/^!?\[(ref)\](?:\[\])?/).replace("ref", kn).getRegex(), ba = W("reflink|nolink(?!\\()", "g").replace("reflink", Is).replace("nolink", Ds).getRegex(), os = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, wn = { _backpedal: Xe, anyPunctuation: fa, autolink: ga, blockSkip: aa, br: _s, code: ea, del: Xe, delLDelim: Xe, delRDelim: Xe, emStrongLDelim: ra, emStrongRDelimAst: oa, emStrongRDelimUnd: ua, escape: Ji, link: ka, nolink: Ds, punctuation: na, reflink: Is, reflinkSearch: ba, tag: xa, text: ta, url: Xe }, va = { ...wn, link: W(/^!?\[(label)\]\((.*?)\)/).replace("label", Ut).getRegex(), reflink: W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ut).getRegex() }, pn = { ...wn, emStrongRDelimAst: ca, emStrongLDelim: la, delLDelim: ha, delRDelim: pa, url: W(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", os).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: W(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", os).getRegex() }, ya = { ...pn, br: W(_s).replace("{2,}", "*").getRegex(), text: W(pn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, zt = { normal: vn, gfm: Xi, pedantic: Qi }, St = { normal: wn, gfm: pn, breaks: ya, pedantic: va }, wa = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, cs = /* @__PURE__ */ d((a) => wa[a], "ge");
|
|
1272
|
+
function Oe(a, t) {
|
|
1273
1273
|
if (t) {
|
|
1274
|
-
if (
|
|
1275
|
-
} else if (
|
|
1274
|
+
if (pe.escapeTest.test(a)) return a.replace(pe.escapeReplace, cs);
|
|
1275
|
+
} else if (pe.escapeTestNoEncode.test(a)) return a.replace(pe.escapeReplaceNoEncode, cs);
|
|
1276
1276
|
return a;
|
|
1277
1277
|
}
|
|
1278
|
-
d(
|
|
1279
|
-
function
|
|
1278
|
+
d(Oe, "O");
|
|
1279
|
+
function us(a) {
|
|
1280
1280
|
try {
|
|
1281
|
-
a = encodeURI(a).replace(
|
|
1281
|
+
a = encodeURI(a).replace(pe.percentDecode, "%");
|
|
1282
1282
|
} catch {
|
|
1283
1283
|
return null;
|
|
1284
1284
|
}
|
|
1285
1285
|
return a;
|
|
1286
1286
|
}
|
|
1287
|
-
d(
|
|
1288
|
-
function
|
|
1289
|
-
let e = a.replace(
|
|
1290
|
-
let
|
|
1291
|
-
for (; --c >= 0 && o[c] === "\\"; )
|
|
1292
|
-
return
|
|
1293
|
-
}), n = e.split(
|
|
1287
|
+
d(us, "V");
|
|
1288
|
+
function hs(a, t) {
|
|
1289
|
+
let e = a.replace(pe.findPipe, (s, l, o) => {
|
|
1290
|
+
let u = !1, c = l;
|
|
1291
|
+
for (; --c >= 0 && o[c] === "\\"; ) u = !u;
|
|
1292
|
+
return u ? "|" : " |";
|
|
1293
|
+
}), n = e.split(pe.splitPipe), i = 0;
|
|
1294
1294
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
|
|
1295
1295
|
else for (; n.length < t; ) n.push("");
|
|
1296
|
-
for (; i < n.length; i++) n[i] = n[i].trim().replace(
|
|
1296
|
+
for (; i < n.length; i++) n[i] = n[i].trim().replace(pe.slashPipe, "|");
|
|
1297
1297
|
return n;
|
|
1298
1298
|
}
|
|
1299
|
-
d(
|
|
1300
|
-
function
|
|
1299
|
+
d(hs, "Y");
|
|
1300
|
+
function je(a, t, e) {
|
|
1301
1301
|
let n = a.length;
|
|
1302
1302
|
if (n === 0) return "";
|
|
1303
1303
|
let i = 0;
|
|
@@ -1305,16 +1305,16 @@ function Ie(a, t, e) {
|
|
|
1305
1305
|
i++;
|
|
1306
1306
|
return a.slice(0, n - i);
|
|
1307
1307
|
}
|
|
1308
|
-
d(
|
|
1309
|
-
function
|
|
1308
|
+
d(je, "$");
|
|
1309
|
+
function ds(a) {
|
|
1310
1310
|
let t = a.split(`
|
|
1311
1311
|
`), e = t.length - 1;
|
|
1312
|
-
for (; e >= 0 &&
|
|
1312
|
+
for (; e >= 0 && pe.blankLine.test(t[e]); ) e--;
|
|
1313
1313
|
return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
|
|
1314
1314
|
`);
|
|
1315
1315
|
}
|
|
1316
|
-
d(
|
|
1317
|
-
function
|
|
1316
|
+
d(ds, "ee");
|
|
1317
|
+
function Ta(a, t) {
|
|
1318
1318
|
if (a.indexOf(t[1]) === -1) return -1;
|
|
1319
1319
|
let e = 0;
|
|
1320
1320
|
for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
|
|
@@ -1322,8 +1322,8 @@ function ya(a, t) {
|
|
|
1322
1322
|
else if (a[n] === t[1] && (e--, e < 0)) return n;
|
|
1323
1323
|
return e > 0 ? -2 : -1;
|
|
1324
1324
|
}
|
|
1325
|
-
d(
|
|
1326
|
-
function
|
|
1325
|
+
d(Ta, "fe");
|
|
1326
|
+
function Sa(a, t = 0) {
|
|
1327
1327
|
let e = t, n = "";
|
|
1328
1328
|
for (let i of a) if (i === " ") {
|
|
1329
1329
|
let s = 4 - e % 4;
|
|
@@ -1331,15 +1331,15 @@ function wa(a, t = 0) {
|
|
|
1331
1331
|
} else n += i, e++;
|
|
1332
1332
|
return n;
|
|
1333
1333
|
}
|
|
1334
|
-
d(
|
|
1335
|
-
function
|
|
1334
|
+
d(Sa, "me");
|
|
1335
|
+
function ps(a, t, e, n, i) {
|
|
1336
1336
|
let s = t.href, l = t.title || null, o = a[1].replace(i.other.outputLinkReplace, "$1");
|
|
1337
1337
|
n.state.inLink = !0;
|
|
1338
|
-
let
|
|
1339
|
-
return n.state.inLink = !1,
|
|
1338
|
+
let u = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
|
|
1339
|
+
return n.state.inLink = !1, u;
|
|
1340
1340
|
}
|
|
1341
|
-
d(
|
|
1342
|
-
function
|
|
1341
|
+
d(ps, "xe");
|
|
1342
|
+
function Aa(a, t, e) {
|
|
1343
1343
|
let n = a.match(e.other.indentCodeCompensation);
|
|
1344
1344
|
if (n === null) return t;
|
|
1345
1345
|
let i = n[1];
|
|
@@ -1352,13 +1352,13 @@ function Ta(a, t, e) {
|
|
|
1352
1352
|
}).join(`
|
|
1353
1353
|
`);
|
|
1354
1354
|
}
|
|
1355
|
-
d(
|
|
1356
|
-
var
|
|
1355
|
+
d(Aa, "st");
|
|
1356
|
+
var pt, Ht = (pt = class {
|
|
1357
1357
|
constructor(t) {
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
this.options = t ||
|
|
1358
|
+
F(this, "options");
|
|
1359
|
+
F(this, "rules");
|
|
1360
|
+
F(this, "lexer");
|
|
1361
|
+
this.options = t || Je;
|
|
1362
1362
|
}
|
|
1363
1363
|
space(t) {
|
|
1364
1364
|
let e = this.rules.block.newline.exec(t);
|
|
@@ -1367,14 +1367,14 @@ var st, Bt = (st = class {
|
|
|
1367
1367
|
code(t) {
|
|
1368
1368
|
let e = this.rules.block.code.exec(t);
|
|
1369
1369
|
if (e) {
|
|
1370
|
-
let n = this.options.pedantic ? e[0] :
|
|
1370
|
+
let n = this.options.pedantic ? e[0] : ds(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
1371
1371
|
return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
1374
|
fences(t) {
|
|
1375
1375
|
let e = this.rules.block.fences.exec(t);
|
|
1376
1376
|
if (e) {
|
|
1377
|
-
let n = e[0], i =
|
|
1377
|
+
let n = e[0], i = Aa(n, e[3] || "", this.rules);
|
|
1378
1378
|
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: i };
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
@@ -1383,51 +1383,51 @@ var st, Bt = (st = class {
|
|
|
1383
1383
|
if (e) {
|
|
1384
1384
|
let n = e[2].trim();
|
|
1385
1385
|
if (this.rules.other.endingHash.test(n)) {
|
|
1386
|
-
let i =
|
|
1386
|
+
let i = je(n, "#");
|
|
1387
1387
|
(this.options.pedantic || !i || this.rules.other.endingSpaceChar.test(i)) && (n = i.trim());
|
|
1388
1388
|
}
|
|
1389
|
-
return { type: "heading", raw:
|
|
1389
|
+
return { type: "heading", raw: je(e[0], `
|
|
1390
1390
|
`), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
1393
|
hr(t) {
|
|
1394
1394
|
let e = this.rules.block.hr.exec(t);
|
|
1395
|
-
if (e) return { type: "hr", raw:
|
|
1395
|
+
if (e) return { type: "hr", raw: je(e[0], `
|
|
1396
1396
|
`) };
|
|
1397
1397
|
}
|
|
1398
1398
|
blockquote(t) {
|
|
1399
1399
|
let e = this.rules.block.blockquote.exec(t);
|
|
1400
1400
|
if (e) {
|
|
1401
|
-
let n =
|
|
1401
|
+
let n = je(e[0], `
|
|
1402
1402
|
`).split(`
|
|
1403
1403
|
`), i = "", s = "", l = [];
|
|
1404
1404
|
for (; n.length > 0; ) {
|
|
1405
|
-
let o = !1,
|
|
1406
|
-
for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c]))
|
|
1407
|
-
else if (!o)
|
|
1405
|
+
let o = !1, u = [], c;
|
|
1406
|
+
for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) u.push(n[c]), o = !0;
|
|
1407
|
+
else if (!o) u.push(n[c]);
|
|
1408
1408
|
else break;
|
|
1409
1409
|
n = n.slice(c);
|
|
1410
|
-
let
|
|
1411
|
-
`),
|
|
1410
|
+
let y = u.join(`
|
|
1411
|
+
`), v = y.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1412
1412
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1413
1413
|
i = i ? `${i}
|
|
1414
|
-
${
|
|
1415
|
-
${
|
|
1416
|
-
let
|
|
1417
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(
|
|
1418
|
-
let
|
|
1419
|
-
if (
|
|
1420
|
-
if (
|
|
1421
|
-
let
|
|
1414
|
+
${y}` : y, s = s ? `${s}
|
|
1415
|
+
${v}` : v;
|
|
1416
|
+
let A = this.lexer.state.top;
|
|
1417
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(v, l, !0), this.lexer.state.top = A, n.length === 0) break;
|
|
1418
|
+
let _ = l.at(-1);
|
|
1419
|
+
if (_?.type === "code") break;
|
|
1420
|
+
if (_?.type === "blockquote") {
|
|
1421
|
+
let G = _, R = G.raw + `
|
|
1422
1422
|
` + n.join(`
|
|
1423
|
-
`), X = this.blockquote(
|
|
1424
|
-
l[l.length - 1] = X, i = i.substring(0, i.length -
|
|
1423
|
+
`), X = this.blockquote(R);
|
|
1424
|
+
l[l.length - 1] = X, i = i.substring(0, i.length - G.raw.length) + X.raw, s = s.substring(0, s.length - G.text.length) + X.text;
|
|
1425
1425
|
break;
|
|
1426
|
-
} else if (
|
|
1427
|
-
let
|
|
1426
|
+
} else if (_?.type === "list") {
|
|
1427
|
+
let G = _, R = G.raw + `
|
|
1428
1428
|
` + n.join(`
|
|
1429
|
-
`), X = this.list(
|
|
1430
|
-
l[l.length - 1] = X, i = i.substring(0, i.length -
|
|
1429
|
+
`), X = this.list(R);
|
|
1430
|
+
l[l.length - 1] = X, i = i.substring(0, i.length - _.raw.length) + X.raw, s = s.substring(0, s.length - G.raw.length) + X.raw, n = R.substring(l.at(-1).raw.length).split(`
|
|
1431
1431
|
`);
|
|
1432
1432
|
continue;
|
|
1433
1433
|
}
|
|
@@ -1442,59 +1442,59 @@ ${x}` : x;
|
|
|
1442
1442
|
n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
|
|
1443
1443
|
let l = this.rules.other.listItemRegex(n), o = !1;
|
|
1444
1444
|
for (; t; ) {
|
|
1445
|
-
let c = !1,
|
|
1445
|
+
let c = !1, y = "", v = "";
|
|
1446
1446
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1447
|
-
|
|
1448
|
-
let
|
|
1449
|
-
`, 1)[0], e[1].length),
|
|
1450
|
-
`, 1)[0],
|
|
1451
|
-
if (this.options.pedantic ? (
|
|
1452
|
-
`, t = t.substring(
|
|
1453
|
-
let X = this.rules.other.nextBulletRegex(
|
|
1447
|
+
y = e[0], t = t.substring(y.length);
|
|
1448
|
+
let A = Sa(e[2].split(`
|
|
1449
|
+
`, 1)[0], e[1].length), _ = t.split(`
|
|
1450
|
+
`, 1)[0], G = !A.trim(), R = 0;
|
|
1451
|
+
if (this.options.pedantic ? (R = 2, v = A.trimStart()) : G ? R = e[1].length + 1 : (R = A.search(this.rules.other.nonSpaceChar), R = R > 4 ? 1 : R, v = A.slice(R), R += e[1].length), G && this.rules.other.blankLine.test(_) && (y += _ + `
|
|
1452
|
+
`, t = t.substring(_.length + 1), c = !0), !c) {
|
|
1453
|
+
let X = this.rules.other.nextBulletRegex(R), ee = this.rules.other.hrRegex(R), $ = this.rules.other.fencesBeginRegex(R), P = this.rules.other.headingBeginRegex(R), N = this.rules.other.htmlBeginRegex(R), V = this.rules.other.blockquoteBeginRegex(R);
|
|
1454
1454
|
for (; t; ) {
|
|
1455
|
-
let
|
|
1456
|
-
`, 1)[0],
|
|
1457
|
-
if (
|
|
1458
|
-
if (
|
|
1459
|
-
` +
|
|
1455
|
+
let U = t.split(`
|
|
1456
|
+
`, 1)[0], J;
|
|
1457
|
+
if (_ = U, this.options.pedantic ? (_ = _.replace(this.rules.other.listReplaceNesting, " "), J = _) : J = _.replace(this.rules.other.tabCharGlobal, " "), $.test(_) || P.test(_) || N.test(_) || V.test(_) || X.test(_) || ee.test(_)) break;
|
|
1458
|
+
if (J.search(this.rules.other.nonSpaceChar) >= R || !_.trim()) v += `
|
|
1459
|
+
` + J.slice(R);
|
|
1460
1460
|
else {
|
|
1461
|
-
if (
|
|
1462
|
-
|
|
1463
|
-
` +
|
|
1461
|
+
if (G || A.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || $.test(A) || P.test(A) || ee.test(A)) break;
|
|
1462
|
+
v += `
|
|
1463
|
+
` + _;
|
|
1464
1464
|
}
|
|
1465
|
-
|
|
1466
|
-
`, t = t.substring(
|
|
1465
|
+
G = !_.trim(), y += U + `
|
|
1466
|
+
`, t = t.substring(U.length + 1), A = J.slice(R);
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
|
-
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(
|
|
1469
|
+
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(y) && (o = !0)), s.items.push({ type: "list_item", raw: y, task: !!this.options.gfm && this.rules.other.listIsTask.test(v), loose: !1, text: v, tokens: [] }), s.raw += y;
|
|
1470
1470
|
}
|
|
1471
|
-
let
|
|
1472
|
-
if (
|
|
1471
|
+
let u = s.items.at(-1);
|
|
1472
|
+
if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
|
|
1473
1473
|
else return;
|
|
1474
1474
|
s.raw = s.raw.trimEnd();
|
|
1475
1475
|
for (let c of s.items) {
|
|
1476
1476
|
this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []);
|
|
1477
|
-
let
|
|
1478
|
-
if (c.task && (
|
|
1479
|
-
c.text = c.text.replace(this.rules.other.listReplaceTask, ""),
|
|
1480
|
-
for (let
|
|
1481
|
-
this.lexer.inlineQueue[
|
|
1477
|
+
let y = c.tokens[0];
|
|
1478
|
+
if (c.task && (y?.type === "text" || y?.type === "paragraph")) {
|
|
1479
|
+
c.text = c.text.replace(this.rules.other.listReplaceTask, ""), y.raw = y.raw.replace(this.rules.other.listReplaceTask, ""), y.text = y.text.replace(this.rules.other.listReplaceTask, "");
|
|
1480
|
+
for (let A = this.lexer.inlineQueue.length - 1; A >= 0; A--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[A].src)) {
|
|
1481
|
+
this.lexer.inlineQueue[A].src = this.lexer.inlineQueue[A].src.replace(this.rules.other.listReplaceTask, "");
|
|
1482
1482
|
break;
|
|
1483
1483
|
}
|
|
1484
|
-
let
|
|
1485
|
-
if (
|
|
1486
|
-
let
|
|
1487
|
-
c.checked =
|
|
1484
|
+
let v = this.rules.other.listTaskCheckbox.exec(c.raw);
|
|
1485
|
+
if (v) {
|
|
1486
|
+
let A = { type: "checkbox", raw: v[0] + " ", checked: v[0] !== "[ ]" };
|
|
1487
|
+
c.checked = A.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = A.raw + c.tokens[0].raw, c.tokens[0].text = A.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(A)) : c.tokens.unshift({ type: "paragraph", raw: A.raw, text: A.raw, tokens: [A] }) : c.tokens.unshift(A);
|
|
1488
1488
|
}
|
|
1489
1489
|
} else c.task && (c.task = !1);
|
|
1490
1490
|
if (!s.loose) {
|
|
1491
|
-
let
|
|
1492
|
-
s.loose =
|
|
1491
|
+
let v = c.tokens.filter((_) => _.type === "space"), A = v.length > 0 && v.some((_) => this.rules.other.anyLine.test(_.raw));
|
|
1492
|
+
s.loose = A;
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
if (s.loose) for (let c of s.items) {
|
|
1496
1496
|
c.loose = !0;
|
|
1497
|
-
for (let
|
|
1497
|
+
for (let y of c.tokens) y.type === "text" && (y.type = "paragraph");
|
|
1498
1498
|
}
|
|
1499
1499
|
return s;
|
|
1500
1500
|
}
|
|
@@ -1502,7 +1502,7 @@ ${x}` : x;
|
|
|
1502
1502
|
html(t) {
|
|
1503
1503
|
let e = this.rules.block.html.exec(t);
|
|
1504
1504
|
if (e) {
|
|
1505
|
-
let n =
|
|
1505
|
+
let n = ds(e[0]);
|
|
1506
1506
|
return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
@@ -1510,20 +1510,20 @@ ${x}` : x;
|
|
|
1510
1510
|
let e = this.rules.block.def.exec(t);
|
|
1511
1511
|
if (e) {
|
|
1512
1512
|
let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), i = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
|
|
1513
|
-
return { type: "def", tag: n, raw:
|
|
1513
|
+
return { type: "def", tag: n, raw: je(e[0], `
|
|
1514
1514
|
`), href: i, title: s };
|
|
1515
1515
|
}
|
|
1516
1516
|
}
|
|
1517
1517
|
table(t) {
|
|
1518
1518
|
let e = this.rules.block.table.exec(t);
|
|
1519
1519
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
1520
|
-
let n =
|
|
1521
|
-
`) : [], l = { type: "table", raw:
|
|
1520
|
+
let n = hs(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
1521
|
+
`) : [], l = { type: "table", raw: je(e[0], `
|
|
1522
1522
|
`), header: [], align: [], rows: [] };
|
|
1523
1523
|
if (n.length === i.length) {
|
|
1524
1524
|
for (let o of i) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
|
|
1525
1525
|
for (let o = 0; o < n.length; o++) l.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: l.align[o] });
|
|
1526
|
-
for (let o of s) l.rows.push(
|
|
1526
|
+
for (let o of s) l.rows.push(hs(o, l.header.length).map((u, c) => ({ text: u, tokens: this.lexer.inline(u), header: !1, align: l.align[c] })));
|
|
1527
1527
|
return l;
|
|
1528
1528
|
}
|
|
1529
1529
|
}
|
|
@@ -1531,7 +1531,7 @@ ${x}` : x;
|
|
|
1531
1531
|
let e = this.rules.block.lheading.exec(t);
|
|
1532
1532
|
if (e) {
|
|
1533
1533
|
let n = e[1].trim();
|
|
1534
|
-
return { type: "heading", raw:
|
|
1534
|
+
return { type: "heading", raw: je(e[0], `
|
|
1535
1535
|
`), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
@@ -1561,10 +1561,10 @@ ${x}` : x;
|
|
|
1561
1561
|
let n = e[2].trim();
|
|
1562
1562
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
1563
1563
|
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
1564
|
-
let l =
|
|
1564
|
+
let l = je(n.slice(0, -1), "\\");
|
|
1565
1565
|
if ((n.length - l.length) % 2 === 0) return;
|
|
1566
1566
|
} else {
|
|
1567
|
-
let l =
|
|
1567
|
+
let l = Ta(e[2], "()");
|
|
1568
1568
|
if (l === -2) return;
|
|
1569
1569
|
if (l > -1) {
|
|
1570
1570
|
let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
|
|
@@ -1576,7 +1576,7 @@ ${x}` : x;
|
|
|
1576
1576
|
let l = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1577
1577
|
l && (i = l[1], s = l[3]);
|
|
1578
1578
|
} else s = e[3] ? e[3].slice(1, -1) : "";
|
|
1579
|
-
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? i = i.slice(1) : i = i.slice(1, -1)),
|
|
1579
|
+
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? i = i.slice(1) : i = i.slice(1, -1)), ps(e, { href: i && i.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
1580
1580
|
}
|
|
1581
1581
|
}
|
|
1582
1582
|
reflink(t, e) {
|
|
@@ -1587,31 +1587,31 @@ ${x}` : x;
|
|
|
1587
1587
|
let l = n[0].charAt(0);
|
|
1588
1588
|
return { type: "text", raw: l, text: l };
|
|
1589
1589
|
}
|
|
1590
|
-
return
|
|
1590
|
+
return ps(n, s, n[0], this.lexer, this.rules);
|
|
1591
1591
|
}
|
|
1592
1592
|
}
|
|
1593
1593
|
emStrong(t, e, n = "") {
|
|
1594
1594
|
let i = this.rules.inline.emStrongLDelim.exec(t);
|
|
1595
1595
|
if (!(!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(i[1] || i[3]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1596
|
-
let s = [...i[0]].length - 1, l, o,
|
|
1597
|
-
for (
|
|
1596
|
+
let s = [...i[0]].length - 1, l, o, u = s, c = 0, y = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1597
|
+
for (y.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = y.exec(e)) !== null; ) {
|
|
1598
1598
|
if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l) continue;
|
|
1599
1599
|
if (o = [...l].length, i[3] || i[4]) {
|
|
1600
|
-
|
|
1600
|
+
u += o;
|
|
1601
1601
|
continue;
|
|
1602
1602
|
} else if ((i[5] || i[6]) && s % 3 && !((s + o) % 3)) {
|
|
1603
1603
|
c += o;
|
|
1604
1604
|
continue;
|
|
1605
1605
|
}
|
|
1606
|
-
if (
|
|
1607
|
-
o = Math.min(o, o +
|
|
1608
|
-
let
|
|
1606
|
+
if (u -= o, u > 0) continue;
|
|
1607
|
+
o = Math.min(o, o + u + c);
|
|
1608
|
+
let v = [...i[0]][0].length, A = t.slice(0, s + i.index + v + o);
|
|
1609
1609
|
if (Math.min(s, o) % 2) {
|
|
1610
|
-
let
|
|
1611
|
-
return { type: "em", raw:
|
|
1610
|
+
let G = A.slice(1, -1);
|
|
1611
|
+
return { type: "em", raw: A, text: G, tokens: this.lexer.inlineTokens(G) };
|
|
1612
1612
|
}
|
|
1613
|
-
let
|
|
1614
|
-
return { type: "strong", raw:
|
|
1613
|
+
let _ = A.slice(2, -2);
|
|
1614
|
+
return { type: "strong", raw: A, text: _, tokens: this.lexer.inlineTokens(_) };
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
@@ -1629,17 +1629,17 @@ ${x}` : x;
|
|
|
1629
1629
|
del(t, e, n = "") {
|
|
1630
1630
|
let i = this.rules.inline.delLDelim.exec(t);
|
|
1631
1631
|
if (i && (!i[1] || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1632
|
-
let s = [...i[0]].length - 1, l, o,
|
|
1632
|
+
let s = [...i[0]].length - 1, l, o, u = s, c = this.rules.inline.delRDelim;
|
|
1633
1633
|
for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = c.exec(e)) !== null; ) {
|
|
1634
1634
|
if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l || (o = [...l].length, o !== s)) continue;
|
|
1635
1635
|
if (i[3] || i[4]) {
|
|
1636
|
-
|
|
1636
|
+
u += o;
|
|
1637
1637
|
continue;
|
|
1638
1638
|
}
|
|
1639
|
-
if (
|
|
1640
|
-
o = Math.min(o, o +
|
|
1641
|
-
let
|
|
1642
|
-
return { type: "del", raw:
|
|
1639
|
+
if (u -= o, u > 0) continue;
|
|
1640
|
+
o = Math.min(o, o + u);
|
|
1641
|
+
let y = [...i[0]][0].length, v = t.slice(0, s + i.index + y + o), A = v.slice(s, -s);
|
|
1642
|
+
return { type: "del", raw: v, text: A, tokens: this.lexer.inlineTokens(A) };
|
|
1643
1643
|
}
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
@@ -1672,28 +1672,28 @@ ${x}` : x;
|
|
|
1672
1672
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
|
-
}, d(
|
|
1675
|
+
}, d(pt, "w"), pt), qe, Re = (qe = class {
|
|
1676
1676
|
constructor(t) {
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t ||
|
|
1683
|
-
let e = { other:
|
|
1684
|
-
this.options.pedantic ? (e.block =
|
|
1677
|
+
F(this, "tokens");
|
|
1678
|
+
F(this, "options");
|
|
1679
|
+
F(this, "state");
|
|
1680
|
+
F(this, "inlineQueue");
|
|
1681
|
+
F(this, "tokenizer");
|
|
1682
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Je, this.options.tokenizer = this.options.tokenizer || new Ht(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1683
|
+
let e = { other: pe, block: zt.normal, inline: St.normal };
|
|
1684
|
+
this.options.pedantic ? (e.block = zt.pedantic, e.inline = St.pedantic) : this.options.gfm && (e.block = zt.gfm, this.options.breaks ? e.inline = St.breaks : e.inline = St.gfm), this.tokenizer.rules = e;
|
|
1685
1685
|
}
|
|
1686
1686
|
static get rules() {
|
|
1687
|
-
return { block:
|
|
1687
|
+
return { block: zt, inline: St };
|
|
1688
1688
|
}
|
|
1689
1689
|
static lex(t, e) {
|
|
1690
|
-
return new
|
|
1690
|
+
return new qe(e).lex(t);
|
|
1691
1691
|
}
|
|
1692
1692
|
static lexInline(t, e) {
|
|
1693
|
-
return new
|
|
1693
|
+
return new qe(e).inlineTokens(t);
|
|
1694
1694
|
}
|
|
1695
1695
|
lex(t) {
|
|
1696
|
-
t = t.replace(
|
|
1696
|
+
t = t.replace(pe.carriageReturn, `
|
|
1697
1697
|
`), this.blockTokens(t, this.tokens);
|
|
1698
1698
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
1699
1699
|
let n = this.inlineQueue[e];
|
|
@@ -1702,7 +1702,7 @@ ${x}` : x;
|
|
|
1702
1702
|
return this.inlineQueue = [], this.tokens;
|
|
1703
1703
|
}
|
|
1704
1704
|
blockTokens(t, e = [], n = !1) {
|
|
1705
|
-
this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(
|
|
1705
|
+
this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(pe.tabCharGlobal, " ").replace(pe.spaceLine, ""));
|
|
1706
1706
|
let i = 1 / 0;
|
|
1707
1707
|
for (; t; ) {
|
|
1708
1708
|
if (t.length < i) i = t.length;
|
|
@@ -1771,9 +1771,9 @@ ${x}` : x;
|
|
|
1771
1771
|
}
|
|
1772
1772
|
let l = t;
|
|
1773
1773
|
if (this.options.extensions?.startBlock) {
|
|
1774
|
-
let o = 1 / 0,
|
|
1775
|
-
this.options.extensions.startBlock.forEach((
|
|
1776
|
-
c =
|
|
1774
|
+
let o = 1 / 0, u = t.slice(1), c;
|
|
1775
|
+
this.options.extensions.startBlock.forEach((y) => {
|
|
1776
|
+
c = y.call({ lexer: this }, u), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
|
|
1777
1777
|
}), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
|
|
1778
1778
|
}
|
|
1779
1779
|
if (this.state.top && (s = this.tokenizer.paragraph(l))) {
|
|
@@ -1814,16 +1814,16 @@ ${x}` : x;
|
|
|
1814
1814
|
let s;
|
|
1815
1815
|
for (; (i = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) s = i[2] ? i[2].length : 0, n = n.slice(0, i.index + s) + "[" + "a".repeat(i[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1816
1816
|
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
1817
|
-
let l = !1, o = "",
|
|
1817
|
+
let l = !1, o = "", u = 1 / 0;
|
|
1818
1818
|
for (; t; ) {
|
|
1819
|
-
if (t.length <
|
|
1819
|
+
if (t.length < u) u = t.length;
|
|
1820
1820
|
else {
|
|
1821
1821
|
this.infiniteLoopError(t.charCodeAt(0));
|
|
1822
1822
|
break;
|
|
1823
1823
|
}
|
|
1824
1824
|
l || (o = ""), l = !1;
|
|
1825
1825
|
let c;
|
|
1826
|
-
if (this.options.extensions?.inline?.some((
|
|
1826
|
+
if (this.options.extensions?.inline?.some((v) => (c = v.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
|
|
1827
1827
|
if (c = this.tokenizer.escape(t)) {
|
|
1828
1828
|
t = t.substring(c.raw.length), e.push(c);
|
|
1829
1829
|
continue;
|
|
@@ -1838,8 +1838,8 @@ ${x}` : x;
|
|
|
1838
1838
|
}
|
|
1839
1839
|
if (c = this.tokenizer.reflink(t, this.tokens.links)) {
|
|
1840
1840
|
t = t.substring(c.raw.length);
|
|
1841
|
-
let
|
|
1842
|
-
c.type === "text" &&
|
|
1841
|
+
let v = e.at(-1);
|
|
1842
|
+
c.type === "text" && v?.type === "text" ? (v.raw += c.raw, v.text += c.text) : e.push(c);
|
|
1843
1843
|
continue;
|
|
1844
1844
|
}
|
|
1845
1845
|
if (c = this.tokenizer.emStrong(t, n, o)) {
|
|
@@ -1866,17 +1866,17 @@ ${x}` : x;
|
|
|
1866
1866
|
t = t.substring(c.raw.length), e.push(c);
|
|
1867
1867
|
continue;
|
|
1868
1868
|
}
|
|
1869
|
-
let
|
|
1869
|
+
let y = t;
|
|
1870
1870
|
if (this.options.extensions?.startInline) {
|
|
1871
|
-
let
|
|
1872
|
-
this.options.extensions.startInline.forEach((
|
|
1873
|
-
|
|
1874
|
-
}),
|
|
1871
|
+
let v = 1 / 0, A = t.slice(1), _;
|
|
1872
|
+
this.options.extensions.startInline.forEach((G) => {
|
|
1873
|
+
_ = G.call({ lexer: this }, A), typeof _ == "number" && _ >= 0 && (v = Math.min(v, _));
|
|
1874
|
+
}), v < 1 / 0 && v >= 0 && (y = t.substring(0, v + 1));
|
|
1875
1875
|
}
|
|
1876
|
-
if (c = this.tokenizer.inlineText(
|
|
1876
|
+
if (c = this.tokenizer.inlineText(y)) {
|
|
1877
1877
|
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
|
|
1878
|
-
let
|
|
1879
|
-
|
|
1878
|
+
let v = e.at(-1);
|
|
1879
|
+
v?.type === "text" ? (v.raw += c.raw, v.text += c.text) : e.push(c);
|
|
1880
1880
|
continue;
|
|
1881
1881
|
}
|
|
1882
1882
|
if (t) {
|
|
@@ -1891,20 +1891,20 @@ ${x}` : x;
|
|
|
1891
1891
|
if (this.options.silent) console.error(e);
|
|
1892
1892
|
else throw new Error(e);
|
|
1893
1893
|
}
|
|
1894
|
-
}, d(
|
|
1894
|
+
}, d(qe, "l"), qe), ft, Gt = (ft = class {
|
|
1895
1895
|
constructor(t) {
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
this.options = t ||
|
|
1896
|
+
F(this, "options");
|
|
1897
|
+
F(this, "parser");
|
|
1898
|
+
this.options = t || Je;
|
|
1899
1899
|
}
|
|
1900
1900
|
space(t) {
|
|
1901
1901
|
return "";
|
|
1902
1902
|
}
|
|
1903
1903
|
code({ text: t, lang: e, escaped: n }) {
|
|
1904
|
-
let i = (e || "").match(
|
|
1904
|
+
let i = (e || "").match(pe.notSpaceStart)?.[0], s = t.replace(pe.endingNewline, "") + `
|
|
1905
1905
|
`;
|
|
1906
|
-
return i ? '<pre><code class="language-' +
|
|
1907
|
-
` : "<pre><code>" + (n ? s :
|
|
1906
|
+
return i ? '<pre><code class="language-' + Oe(i) + '">' + (n ? s : Oe(s, !0)) + `</code></pre>
|
|
1907
|
+
` : "<pre><code>" + (n ? s : Oe(s, !0)) + `</code></pre>
|
|
1908
1908
|
`;
|
|
1909
1909
|
}
|
|
1910
1910
|
blockquote({ tokens: t }) {
|
|
@@ -1929,8 +1929,8 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
1929
1929
|
list(t) {
|
|
1930
1930
|
let e = t.ordered, n = t.start, i = "";
|
|
1931
1931
|
for (let o = 0; o < t.items.length; o++) {
|
|
1932
|
-
let
|
|
1933
|
-
i += this.listitem(
|
|
1932
|
+
let u = t.items[o];
|
|
1933
|
+
i += this.listitem(u);
|
|
1934
1934
|
}
|
|
1935
1935
|
let s = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
|
|
1936
1936
|
return "<" + s + l + `>
|
|
@@ -1982,7 +1982,7 @@ ${t}</tr>
|
|
|
1982
1982
|
return `<em>${this.parser.parseInline(t)}</em>`;
|
|
1983
1983
|
}
|
|
1984
1984
|
codespan({ text: t }) {
|
|
1985
|
-
return `<code>${
|
|
1985
|
+
return `<code>${Oe(t, !0)}</code>`;
|
|
1986
1986
|
}
|
|
1987
1987
|
br(t) {
|
|
1988
1988
|
return "<br>";
|
|
@@ -1991,24 +1991,24 @@ ${t}</tr>
|
|
|
1991
1991
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
1992
1992
|
}
|
|
1993
1993
|
link({ href: t, title: e, tokens: n }) {
|
|
1994
|
-
let i = this.parser.parseInline(n), s =
|
|
1994
|
+
let i = this.parser.parseInline(n), s = us(t);
|
|
1995
1995
|
if (s === null) return i;
|
|
1996
1996
|
t = s;
|
|
1997
1997
|
let l = '<a href="' + t + '"';
|
|
1998
|
-
return e && (l += ' title="' +
|
|
1998
|
+
return e && (l += ' title="' + Oe(e) + '"'), l += ">" + i + "</a>", l;
|
|
1999
1999
|
}
|
|
2000
2000
|
image({ href: t, title: e, text: n, tokens: i }) {
|
|
2001
2001
|
i && (n = this.parser.parseInline(i, this.parser.textRenderer));
|
|
2002
|
-
let s =
|
|
2003
|
-
if (s === null) return
|
|
2002
|
+
let s = us(t);
|
|
2003
|
+
if (s === null) return Oe(n);
|
|
2004
2004
|
t = s;
|
|
2005
|
-
let l = `<img src="${t}" alt="${
|
|
2006
|
-
return e && (l += ` title="${
|
|
2005
|
+
let l = `<img src="${t}" alt="${Oe(n)}"`;
|
|
2006
|
+
return e && (l += ` title="${Oe(e)}"`), l += ">", l;
|
|
2007
2007
|
}
|
|
2008
2008
|
text(t) {
|
|
2009
|
-
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text :
|
|
2009
|
+
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : Oe(t.text);
|
|
2010
2010
|
}
|
|
2011
|
-
}, d(
|
|
2011
|
+
}, d(ft, "y"), ft), gt, Tn = (gt = class {
|
|
2012
2012
|
strong({ text: t }) {
|
|
2013
2013
|
return t;
|
|
2014
2014
|
}
|
|
@@ -2039,18 +2039,18 @@ ${t}</tr>
|
|
|
2039
2039
|
checkbox({ raw: t }) {
|
|
2040
2040
|
return t;
|
|
2041
2041
|
}
|
|
2042
|
-
}, d(
|
|
2042
|
+
}, d(gt, "L"), gt), Ve, Ce = (Ve = class {
|
|
2043
2043
|
constructor(t) {
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
this.options = t ||
|
|
2044
|
+
F(this, "options");
|
|
2045
|
+
F(this, "renderer");
|
|
2046
|
+
F(this, "textRenderer");
|
|
2047
|
+
this.options = t || Je, this.options.renderer = this.options.renderer || new Gt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Tn();
|
|
2048
2048
|
}
|
|
2049
2049
|
static parse(t, e) {
|
|
2050
|
-
return new
|
|
2050
|
+
return new Ve(e).parse(t);
|
|
2051
2051
|
}
|
|
2052
2052
|
static parseInline(t, e) {
|
|
2053
|
-
return new
|
|
2053
|
+
return new Ve(e).parseInline(t);
|
|
2054
2054
|
}
|
|
2055
2055
|
parse(t) {
|
|
2056
2056
|
this.renderer.parser = this;
|
|
@@ -2190,11 +2190,11 @@ ${t}</tr>
|
|
|
2190
2190
|
}
|
|
2191
2191
|
return n;
|
|
2192
2192
|
}
|
|
2193
|
-
}, d(
|
|
2193
|
+
}, d(Ve, "l"), Ve), We, _t = (We = class {
|
|
2194
2194
|
constructor(t) {
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
this.options = t ||
|
|
2195
|
+
F(this, "options");
|
|
2196
|
+
F(this, "block");
|
|
2197
|
+
this.options = t || Je;
|
|
2198
2198
|
}
|
|
2199
2199
|
preprocess(t) {
|
|
2200
2200
|
return t;
|
|
@@ -2209,23 +2209,23 @@ ${t}</tr>
|
|
|
2209
2209
|
return t;
|
|
2210
2210
|
}
|
|
2211
2211
|
provideLexer(t = this.block) {
|
|
2212
|
-
return t ?
|
|
2212
|
+
return t ? Re.lex : Re.lexInline;
|
|
2213
2213
|
}
|
|
2214
2214
|
provideParser(t = this.block) {
|
|
2215
|
-
return t ?
|
|
2215
|
+
return t ? Ce.parse : Ce.parseInline;
|
|
2216
2216
|
}
|
|
2217
|
-
}, d(
|
|
2217
|
+
}, d(We, "P"), F(We, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), F(We, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), We), mt, _a = (mt = class {
|
|
2218
2218
|
constructor(...t) {
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2219
|
+
F(this, "defaults", gn());
|
|
2220
|
+
F(this, "options", this.setOptions);
|
|
2221
|
+
F(this, "parse", this.parseMarkdown(!0));
|
|
2222
|
+
F(this, "parseInline", this.parseMarkdown(!1));
|
|
2223
|
+
F(this, "Parser", Ce);
|
|
2224
|
+
F(this, "Renderer", Gt);
|
|
2225
|
+
F(this, "TextRenderer", Tn);
|
|
2226
|
+
F(this, "Lexer", Re);
|
|
2227
|
+
F(this, "Tokenizer", Ht);
|
|
2228
|
+
F(this, "Hooks", _t);
|
|
2229
2229
|
this.use(...t);
|
|
2230
2230
|
}
|
|
2231
2231
|
walkTokens(t, e) {
|
|
@@ -2261,8 +2261,8 @@ ${t}</tr>
|
|
|
2261
2261
|
if ("renderer" in s) {
|
|
2262
2262
|
let l = e.renderers[s.name];
|
|
2263
2263
|
l ? e.renderers[s.name] = function(...o) {
|
|
2264
|
-
let
|
|
2265
|
-
return
|
|
2264
|
+
let u = s.renderer.apply(this, o);
|
|
2265
|
+
return u === !1 && (u = l.apply(this, o)), u;
|
|
2266
2266
|
} : e.renderers[s.name] = s.renderer;
|
|
2267
2267
|
}
|
|
2268
2268
|
if ("tokenizer" in s) {
|
|
@@ -2272,51 +2272,51 @@ ${t}</tr>
|
|
|
2272
2272
|
}
|
|
2273
2273
|
"childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
|
|
2274
2274
|
}), i.extensions = e), n.renderer) {
|
|
2275
|
-
let s = this.defaults.renderer || new
|
|
2275
|
+
let s = this.defaults.renderer || new Gt(this.defaults);
|
|
2276
2276
|
for (let l in n.renderer) {
|
|
2277
2277
|
if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
|
|
2278
2278
|
if (["options", "parser"].includes(l)) continue;
|
|
2279
|
-
let o = l,
|
|
2280
|
-
s[o] = (...
|
|
2281
|
-
let
|
|
2282
|
-
return
|
|
2279
|
+
let o = l, u = n.renderer[o], c = s[o];
|
|
2280
|
+
s[o] = (...y) => {
|
|
2281
|
+
let v = u.apply(s, y);
|
|
2282
|
+
return v === !1 && (v = c.apply(s, y)), v || "";
|
|
2283
2283
|
};
|
|
2284
2284
|
}
|
|
2285
2285
|
i.renderer = s;
|
|
2286
2286
|
}
|
|
2287
2287
|
if (n.tokenizer) {
|
|
2288
|
-
let s = this.defaults.tokenizer || new
|
|
2288
|
+
let s = this.defaults.tokenizer || new Ht(this.defaults);
|
|
2289
2289
|
for (let l in n.tokenizer) {
|
|
2290
2290
|
if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
|
|
2291
2291
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
2292
|
-
let o = l,
|
|
2293
|
-
s[o] = (...
|
|
2294
|
-
let
|
|
2295
|
-
return
|
|
2292
|
+
let o = l, u = n.tokenizer[o], c = s[o];
|
|
2293
|
+
s[o] = (...y) => {
|
|
2294
|
+
let v = u.apply(s, y);
|
|
2295
|
+
return v === !1 && (v = c.apply(s, y)), v;
|
|
2296
2296
|
};
|
|
2297
2297
|
}
|
|
2298
2298
|
i.tokenizer = s;
|
|
2299
2299
|
}
|
|
2300
2300
|
if (n.hooks) {
|
|
2301
|
-
let s = this.defaults.hooks || new
|
|
2301
|
+
let s = this.defaults.hooks || new _t();
|
|
2302
2302
|
for (let l in n.hooks) {
|
|
2303
2303
|
if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
|
|
2304
2304
|
if (["options", "block"].includes(l)) continue;
|
|
2305
|
-
let o = l,
|
|
2306
|
-
|
|
2307
|
-
if (this.defaults.async &&
|
|
2308
|
-
let
|
|
2309
|
-
return c.call(s,
|
|
2305
|
+
let o = l, u = n.hooks[o], c = s[o];
|
|
2306
|
+
_t.passThroughHooks.has(l) ? s[o] = (y) => {
|
|
2307
|
+
if (this.defaults.async && _t.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
2308
|
+
let A = await u.call(s, y);
|
|
2309
|
+
return c.call(s, A);
|
|
2310
2310
|
})();
|
|
2311
|
-
let
|
|
2312
|
-
return c.call(s,
|
|
2313
|
-
} : s[o] = (...
|
|
2311
|
+
let v = u.call(s, y);
|
|
2312
|
+
return c.call(s, v);
|
|
2313
|
+
} : s[o] = (...y) => {
|
|
2314
2314
|
if (this.defaults.async) return (async () => {
|
|
2315
|
-
let
|
|
2316
|
-
return
|
|
2315
|
+
let A = await u.apply(s, y);
|
|
2316
|
+
return A === !1 && (A = await c.apply(s, y)), A;
|
|
2317
2317
|
})();
|
|
2318
|
-
let
|
|
2319
|
-
return
|
|
2318
|
+
let v = u.apply(s, y);
|
|
2319
|
+
return v === !1 && (v = c.apply(s, y)), v;
|
|
2320
2320
|
};
|
|
2321
2321
|
}
|
|
2322
2322
|
i.hooks = s;
|
|
@@ -2324,8 +2324,8 @@ ${t}</tr>
|
|
|
2324
2324
|
if (n.walkTokens) {
|
|
2325
2325
|
let s = this.defaults.walkTokens, l = n.walkTokens;
|
|
2326
2326
|
i.walkTokens = function(o) {
|
|
2327
|
-
let
|
|
2328
|
-
return
|
|
2327
|
+
let u = [];
|
|
2328
|
+
return u.push(l.call(this, o)), s && (u = u.concat(s.call(this, o))), u;
|
|
2329
2329
|
};
|
|
2330
2330
|
}
|
|
2331
2331
|
this.defaults = { ...this.defaults, ...i };
|
|
@@ -2335,10 +2335,10 @@ ${t}</tr>
|
|
|
2335
2335
|
return this.defaults = { ...this.defaults, ...t }, this;
|
|
2336
2336
|
}
|
|
2337
2337
|
lexer(t, e) {
|
|
2338
|
-
return
|
|
2338
|
+
return Re.lex(t, e ?? this.defaults);
|
|
2339
2339
|
}
|
|
2340
2340
|
parser(t, e) {
|
|
2341
|
-
return
|
|
2341
|
+
return Ce.parse(t, e ?? this.defaults);
|
|
2342
2342
|
}
|
|
2343
2343
|
parseMarkdown(t) {
|
|
2344
2344
|
return (e, n) => {
|
|
@@ -2347,17 +2347,17 @@ ${t}</tr>
|
|
|
2347
2347
|
if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
|
|
2348
2348
|
if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
2349
2349
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
|
|
2350
|
-
let o = s.hooks ? await s.hooks.preprocess(e) : e,
|
|
2350
|
+
let o = s.hooks ? await s.hooks.preprocess(e) : e, u = await (s.hooks ? await s.hooks.provideLexer(t) : t ? Re.lex : Re.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(u) : u;
|
|
2351
2351
|
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
2352
|
-
let
|
|
2353
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
2352
|
+
let y = await (s.hooks ? await s.hooks.provideParser(t) : t ? Ce.parse : Ce.parseInline)(c, s);
|
|
2353
|
+
return s.hooks ? await s.hooks.postprocess(y) : y;
|
|
2354
2354
|
})().catch(l);
|
|
2355
2355
|
try {
|
|
2356
2356
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
2357
|
-
let o = (s.hooks ? s.hooks.provideLexer(t) : t ?
|
|
2357
|
+
let o = (s.hooks ? s.hooks.provideLexer(t) : t ? Re.lex : Re.lexInline)(e, s);
|
|
2358
2358
|
s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
|
|
2359
|
-
let
|
|
2360
|
-
return s.hooks && (
|
|
2359
|
+
let u = (s.hooks ? s.hooks.provideParser(t) : t ? Ce.parse : Ce.parseInline)(o, s);
|
|
2360
|
+
return s.hooks && (u = s.hooks.postprocess(u)), u;
|
|
2361
2361
|
} catch (o) {
|
|
2362
2362
|
return l(o);
|
|
2363
2363
|
}
|
|
@@ -2367,47 +2367,433 @@ ${t}</tr>
|
|
|
2367
2367
|
return (n) => {
|
|
2368
2368
|
if (n.message += `
|
|
2369
2369
|
Please report this to https://github.com/markedjs/marked.`, t) {
|
|
2370
|
-
let i = "<p>An error occurred:</p><pre>" +
|
|
2370
|
+
let i = "<p>An error occurred:</p><pre>" + Oe(n.message + "", !0) + "</pre>";
|
|
2371
2371
|
return e ? Promise.resolve(i) : i;
|
|
2372
2372
|
}
|
|
2373
2373
|
if (e) return Promise.reject(n);
|
|
2374
2374
|
throw n;
|
|
2375
2375
|
};
|
|
2376
2376
|
}
|
|
2377
|
-
}, d(
|
|
2378
|
-
function
|
|
2379
|
-
return
|
|
2377
|
+
}, d(mt, "q"), mt), Qe = new _a();
|
|
2378
|
+
function Y(a, t) {
|
|
2379
|
+
return Qe.parse(a, t);
|
|
2380
2380
|
}
|
|
2381
|
-
d(
|
|
2382
|
-
|
|
2383
|
-
return
|
|
2381
|
+
d(Y, "g");
|
|
2382
|
+
Y.options = Y.setOptions = function(a) {
|
|
2383
|
+
return Qe.setOptions(a), Y.defaults = Qe.defaults, ws(Y.defaults), Y;
|
|
2384
2384
|
};
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
return
|
|
2385
|
+
Y.getDefaults = gn;
|
|
2386
|
+
Y.defaults = Je;
|
|
2387
|
+
Y.use = function(...a) {
|
|
2388
|
+
return Qe.use(...a), Y.defaults = Qe.defaults, ws(Y.defaults), Y;
|
|
2389
2389
|
};
|
|
2390
|
-
|
|
2391
|
-
return
|
|
2390
|
+
Y.walkTokens = function(a, t) {
|
|
2391
|
+
return Qe.walkTokens(a, t);
|
|
2392
2392
|
};
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
const
|
|
2393
|
+
Y.parseInline = Qe.parseInline;
|
|
2394
|
+
Y.Parser = Ce;
|
|
2395
|
+
Y.parser = Ce.parse;
|
|
2396
|
+
Y.Renderer = Gt;
|
|
2397
|
+
Y.TextRenderer = Tn;
|
|
2398
|
+
Y.Lexer = Re;
|
|
2399
|
+
Y.lexer = Re.lex;
|
|
2400
|
+
Y.Tokenizer = Ht;
|
|
2401
|
+
Y.Hooks = _t;
|
|
2402
|
+
Y.parse = Y;
|
|
2403
|
+
Y.options;
|
|
2404
|
+
Y.setOptions;
|
|
2405
|
+
Y.use;
|
|
2406
|
+
Y.walkTokens;
|
|
2407
|
+
Y.parseInline;
|
|
2408
|
+
Ce.parse;
|
|
2409
|
+
Re.lex;
|
|
2410
|
+
const Ea = ["data-visual-type", "data-chart-type", "data-diagram-type", "aria-label"], Ra = { class: "mb-2.5" }, Ca = ["aria-label"], Ia = ["viewBox"], Da = ["x1", "x2", "y1", "y2"], Ma = ["x", "y"], $a = ["x", "y", "width", "height"], La = ["d"], Oa = ["cx", "cy"], Na = ["cx", "cy"], za = ["x", "y", "text-anchor"], Pa = {
|
|
2411
|
+
key: 0,
|
|
2412
|
+
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
2413
|
+
}, Fa = {
|
|
2414
|
+
key: 1,
|
|
2415
|
+
class: "grid gap-3"
|
|
2416
|
+
}, Ba = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Ua = { key: 2 }, Ha = { class: "relative flex flex-col items-center" }, Ga = { class: "min-w-0 pb-3.5" }, ja = /* @__PURE__ */ Ne({
|
|
2417
|
+
__name: "ChatVisualBlock",
|
|
2418
|
+
props: {
|
|
2419
|
+
result: {},
|
|
2420
|
+
inverted: { type: Boolean }
|
|
2421
|
+
},
|
|
2422
|
+
setup(a) {
|
|
2423
|
+
const t = a, e = I(() => t.result.ok ? t.result.spec : null), n = I(() => e.value?.visualType === "chart" ? e.value : null), i = I(() => e.value?.visualType === "diagram" ? e.value : null);
|
|
2424
|
+
function s(k) {
|
|
2425
|
+
return k?.chartType === "bar" || k?.chartType === "line" || k?.chartType === "scatter";
|
|
2426
|
+
}
|
|
2427
|
+
d(s, "isCartesianChart");
|
|
2428
|
+
function l(k) {
|
|
2429
|
+
return k?.chartType === "pie";
|
|
2430
|
+
}
|
|
2431
|
+
d(l, "isPieChart");
|
|
2432
|
+
const o = I(() => n.value?.data ?? []), u = I(() => s(n.value) ? n.value : null), c = I(() => u.value?.series ?? []), y = I(() => l(n.value) ? n.value : null);
|
|
2433
|
+
function v(k) {
|
|
2434
|
+
return typeof k == "number" && Number.isFinite(k) ? k : null;
|
|
2435
|
+
}
|
|
2436
|
+
d(v, "numericValue");
|
|
2437
|
+
const A = I(() => {
|
|
2438
|
+
const k = [], w = u.value;
|
|
2439
|
+
if (!w) return k;
|
|
2440
|
+
for (const x of w.data)
|
|
2441
|
+
for (const b of w.series) {
|
|
2442
|
+
const M = v(x[b.dataKey]);
|
|
2443
|
+
M !== null && k.push(M);
|
|
2444
|
+
}
|
|
2445
|
+
return k;
|
|
2446
|
+
});
|
|
2447
|
+
function _(k, w) {
|
|
2448
|
+
const x = k > 0 ? k : 1, b = Math.floor(Math.log10(x)), M = x / 10 ** b;
|
|
2449
|
+
let H;
|
|
2450
|
+
return w ? H = M < 1.5 ? 1 : M < 3 ? 2 : M < 7 ? 5 : 10 : H = M <= 1 ? 1 : M <= 2 ? 2 : M <= 5 ? 5 : 10, H * 10 ** b;
|
|
2451
|
+
}
|
|
2452
|
+
d(_, "niceNum");
|
|
2453
|
+
const G = I(() => {
|
|
2454
|
+
const k = A.value, w = k.length ? Math.max(...k) : 1, x = k.length ? Math.min(0, ...k) : 0;
|
|
2455
|
+
if (x === w)
|
|
2456
|
+
return { min: 0, max: w || 1, ticks: [0, w || 1] };
|
|
2457
|
+
const b = 4, M = _(w - x, !1), H = _(M / (b - 1), !0), j = Math.floor(x / H) * H, E = Math.ceil(w / H) * H, g = [];
|
|
2458
|
+
for (let p = j; p <= E + H * 0.5; p += H)
|
|
2459
|
+
g.push(Number(p.toFixed(6)));
|
|
2460
|
+
return { min: j, max: E, ticks: g };
|
|
2461
|
+
}), R = { width: 360, height: 168, left: 30, right: 12, top: 10, bottom: 24 };
|
|
2462
|
+
function X(k, w) {
|
|
2463
|
+
const x = R.width - R.left - R.right;
|
|
2464
|
+
return w <= 1 ? R.left + x / 2 : R.left + x * k / (w - 1);
|
|
2465
|
+
}
|
|
2466
|
+
d(X, "xForIndex");
|
|
2467
|
+
function ee(k) {
|
|
2468
|
+
const { min: w, max: x } = G.value, b = R.height - R.top - R.bottom;
|
|
2469
|
+
return R.top + (x - k) / (x - w || 1) * b;
|
|
2470
|
+
}
|
|
2471
|
+
d(ee, "yForValue");
|
|
2472
|
+
function $(k) {
|
|
2473
|
+
const w = u.value;
|
|
2474
|
+
return w ? w.data.map((x, b) => {
|
|
2475
|
+
const M = v(x[k]) ?? 0;
|
|
2476
|
+
return `${b === 0 ? "M" : "L"} ${X(b, w.data.length).toFixed(1)} ${ee(M).toFixed(1)}`;
|
|
2477
|
+
}).join(" ") : "";
|
|
2478
|
+
}
|
|
2479
|
+
d($, "pathForSeries");
|
|
2480
|
+
const P = I(() => {
|
|
2481
|
+
const k = u.value;
|
|
2482
|
+
if (!k || k.chartType !== "bar") return [];
|
|
2483
|
+
const x = (R.width - R.left - R.right) / Math.max(k.data.length, 1), b = Math.max(k.series.length, 1), M = b > 1 ? 2 : 0, H = Math.max(3, Math.min(20, (x * 0.62 - M * (b - 1)) / b)), j = H * b + M * (b - 1), E = ee(0);
|
|
2484
|
+
return k.data.flatMap((g, p) => k.series.map((L, Q) => {
|
|
2485
|
+
const be = v(g[L.dataKey]) ?? 0, we = ee(be), Fe = R.left + p * x + (x - j) / 2 + Q * (H + M);
|
|
2486
|
+
return {
|
|
2487
|
+
key: `${p}-${L.dataKey}`,
|
|
2488
|
+
x: Fe,
|
|
2489
|
+
y: Math.min(we, E),
|
|
2490
|
+
width: H,
|
|
2491
|
+
height: Math.max(1.5, Math.abs(E - we)),
|
|
2492
|
+
seriesIndex: Q
|
|
2493
|
+
};
|
|
2494
|
+
}));
|
|
2495
|
+
}), N = I(() => {
|
|
2496
|
+
const k = u.value;
|
|
2497
|
+
if (!k) return [];
|
|
2498
|
+
const w = k.data;
|
|
2499
|
+
if (!w.length) return [];
|
|
2500
|
+
const x = k.xKey, b = w.length - 1, M = b <= 6 ? 1 : Math.ceil(b / 4), H = /* @__PURE__ */ new Set([0, b]);
|
|
2501
|
+
for (let j = 0; j <= b; j += M)
|
|
2502
|
+
H.add(j);
|
|
2503
|
+
return [...H].sort((j, E) => j - E).map((j) => ({
|
|
2504
|
+
key: `${j}`,
|
|
2505
|
+
label: String(w[j]?.[x] ?? ""),
|
|
2506
|
+
x: X(j, w.length),
|
|
2507
|
+
anchor: j === 0 ? "start" : j === b ? "end" : "middle"
|
|
2508
|
+
})).filter((j) => j.label);
|
|
2509
|
+
});
|
|
2510
|
+
function V(k) {
|
|
2511
|
+
const w = Math.abs(k);
|
|
2512
|
+
return w >= 1e6 ? `${(k / 1e6).toFixed(1).replace(/\.0$/, "")}M` : w >= 1e3 ? `${(k / 1e3).toFixed(1).replace(/\.0$/, "")}k` : Number.isInteger(k) ? `${k}` : k.toFixed(1);
|
|
2513
|
+
}
|
|
2514
|
+
d(V, "formatValue");
|
|
2515
|
+
function U(k, w) {
|
|
2516
|
+
const x = w?.valuePrefix ?? (w?.valueFormat === "currency" ? "$" : ""), b = w?.valueSuffix ?? (w?.valueFormat === "percent" ? "%" : "");
|
|
2517
|
+
let M;
|
|
2518
|
+
switch (w?.valueFormat) {
|
|
2519
|
+
case "integer":
|
|
2520
|
+
M = `${Math.round(k)}`;
|
|
2521
|
+
break;
|
|
2522
|
+
case "raw":
|
|
2523
|
+
M = Number.isInteger(k) ? `${k}` : k.toFixed(1);
|
|
2524
|
+
break;
|
|
2525
|
+
default:
|
|
2526
|
+
M = V(k);
|
|
2527
|
+
}
|
|
2528
|
+
return `${x}${M}${b}`;
|
|
2529
|
+
}
|
|
2530
|
+
d(U, "formatSeriesValue");
|
|
2531
|
+
const J = I(() => {
|
|
2532
|
+
const k = u.value;
|
|
2533
|
+
if (!k?.data.length) return [];
|
|
2534
|
+
const w = k.data[k.data.length - 1];
|
|
2535
|
+
return k.series.map((x, b) => {
|
|
2536
|
+
const M = v(w?.[x.dataKey]);
|
|
2537
|
+
return {
|
|
2538
|
+
key: x.dataKey,
|
|
2539
|
+
label: x.label || x.dataKey,
|
|
2540
|
+
value: M === null ? "—" : U(M, x),
|
|
2541
|
+
seriesIndex: b
|
|
2542
|
+
};
|
|
2543
|
+
});
|
|
2544
|
+
}), ze = I(() => {
|
|
2545
|
+
const k = u.value;
|
|
2546
|
+
if (!k?.data.length || k.chartType !== "line") return [];
|
|
2547
|
+
const w = k.data.length - 1, x = k.data[w];
|
|
2548
|
+
return k.series.map((b, M) => {
|
|
2549
|
+
const H = v(x?.[b.dataKey]);
|
|
2550
|
+
return H === null ? null : { key: b.dataKey, cx: X(w, k.data.length), cy: ee(H), seriesIndex: M };
|
|
2551
|
+
}).filter((b) => b !== null);
|
|
2552
|
+
}), fe = I(() => {
|
|
2553
|
+
const k = y.value;
|
|
2554
|
+
if (!k) return [];
|
|
2555
|
+
const w = k.data.map((b) => ({
|
|
2556
|
+
name: String(b[k.nameKey] ?? ""),
|
|
2557
|
+
value: v(b[k.valueKey]) ?? 0
|
|
2558
|
+
})).filter((b) => b.name && b.value >= 0).sort((b, M) => M.value - b.value), x = w.reduce((b, M) => b + M.value, 0) || 1;
|
|
2559
|
+
return w.map((b, M) => ({
|
|
2560
|
+
...b,
|
|
2561
|
+
key: `${M}-${b.name}`,
|
|
2562
|
+
percent: b.value / x
|
|
2563
|
+
}));
|
|
2564
|
+
}), Te = I(() => {
|
|
2565
|
+
const k = /* @__PURE__ */ new Map();
|
|
2566
|
+
for (const w of i.value?.nodes ?? [])
|
|
2567
|
+
k.set(w.id, w);
|
|
2568
|
+
return k;
|
|
2569
|
+
}), Ye = I(() => {
|
|
2570
|
+
const k = i.value;
|
|
2571
|
+
if (!k?.edges.length) return [];
|
|
2572
|
+
const w = new Set(k.edges.map((g) => g.to)), x = k.edges.find((g) => !w.has(g.from)) ?? k.edges[0];
|
|
2573
|
+
if (!x) return [];
|
|
2574
|
+
const b = [], M = /* @__PURE__ */ new Set(), H = /* @__PURE__ */ d((g) => `${g.from}->${g.to}`, "edgeKey"), j = /* @__PURE__ */ d((g, p) => {
|
|
2575
|
+
const L = Te.value.get(g);
|
|
2576
|
+
L && b.push({ key: `node-${g}-${b.length}`, label: L.label, note: p });
|
|
2577
|
+
}, "pushStep");
|
|
2578
|
+
let E = x.from;
|
|
2579
|
+
for (; E; ) {
|
|
2580
|
+
const g = k.edges.find((p) => p.from === E && !M.has(H(p)));
|
|
2581
|
+
if (j(E, g?.label), !g)
|
|
2582
|
+
break;
|
|
2583
|
+
M.add(H(g)), E = g.to;
|
|
2584
|
+
}
|
|
2585
|
+
for (const g of k.edges) {
|
|
2586
|
+
const p = H(g);
|
|
2587
|
+
M.has(p) || (j(g.from, g.label), j(g.to, void 0));
|
|
2588
|
+
}
|
|
2589
|
+
return b;
|
|
2590
|
+
}), Ke = I(() => i.value?.nodes ?? []), Ue = [
|
|
2591
|
+
"var(--color-theme-900)",
|
|
2592
|
+
"var(--color-primary-500)",
|
|
2593
|
+
"color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
|
|
2594
|
+
], ie = [
|
|
2595
|
+
"rgba(255, 255, 255, 0.92)",
|
|
2596
|
+
"color-mix(in oklch, white 30%, var(--color-primary-500))",
|
|
2597
|
+
"rgba(255, 255, 255, 0.55)"
|
|
2598
|
+
];
|
|
2599
|
+
function ve(k) {
|
|
2600
|
+
const w = t.inverted ? ie : Ue;
|
|
2601
|
+
return w[k % w.length];
|
|
2602
|
+
}
|
|
2603
|
+
d(ve, "seriesColor");
|
|
2604
|
+
const ye = I(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ce = I(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), He = I(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), z = I(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), et = I(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Pe = I(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), Ge = I(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), tt = I(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)"), te = I(() => t.inverted ? "transparent" : "var(--color-theme-0)");
|
|
2605
|
+
return (k, w) => e.value ? (f(), m("section", {
|
|
2606
|
+
key: 0,
|
|
2607
|
+
"data-test": "chat-visual",
|
|
2608
|
+
"data-visual-type": e.value.visualType,
|
|
2609
|
+
"data-chart-type": n.value?.chartType,
|
|
2610
|
+
"data-diagram-type": i.value?.diagramType,
|
|
2611
|
+
class: "my-6 w-full border-y py-5",
|
|
2612
|
+
style: se({ borderColor: Pe.value }),
|
|
2613
|
+
"aria-label": e.value.meta.title
|
|
2614
|
+
}, [
|
|
2615
|
+
T("header", Ra, [
|
|
2616
|
+
T("h4", {
|
|
2617
|
+
class: "text-[13px] font-semibold leading-tight",
|
|
2618
|
+
style: se({ color: ye.value })
|
|
2619
|
+
}, Z(e.value.meta.title), 5),
|
|
2620
|
+
e.value.meta.description ? (f(), m("p", {
|
|
2621
|
+
key: 0,
|
|
2622
|
+
class: "mt-0.5 text-[12px] leading-snug",
|
|
2623
|
+
style: se({ color: ce.value })
|
|
2624
|
+
}, Z(e.value.meta.description), 5)) : q("", !0)
|
|
2625
|
+
]),
|
|
2626
|
+
u.value ? (f(), m("div", {
|
|
2627
|
+
key: 0,
|
|
2628
|
+
role: "img",
|
|
2629
|
+
"aria-label": e.value.meta.title
|
|
2630
|
+
}, [
|
|
2631
|
+
(f(), m("svg", {
|
|
2632
|
+
class: "block h-auto w-full overflow-visible",
|
|
2633
|
+
viewBox: `0 0 ${R.width} ${R.height}`,
|
|
2634
|
+
style: se({ aspectRatio: `${R.width} / ${R.height}` }),
|
|
2635
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
2636
|
+
"aria-hidden": "true"
|
|
2637
|
+
}, [
|
|
2638
|
+
(f(!0), m(re, null, me(G.value.ticks, (x) => (f(), m("line", {
|
|
2639
|
+
key: `grid-${x}`,
|
|
2640
|
+
x1: R.left,
|
|
2641
|
+
x2: R.width - R.right,
|
|
2642
|
+
y1: ee(x),
|
|
2643
|
+
y2: ee(x),
|
|
2644
|
+
"stroke-width": "1",
|
|
2645
|
+
"vector-effect": "non-scaling-stroke",
|
|
2646
|
+
style: se({ stroke: x === 0 ? et.value : z.value })
|
|
2647
|
+
}, null, 12, Da))), 128)),
|
|
2648
|
+
T("g", null, [
|
|
2649
|
+
(f(!0), m(re, null, me(G.value.ticks, (x) => (f(), m("text", {
|
|
2650
|
+
key: `y-${x}`,
|
|
2651
|
+
x: R.left - 7,
|
|
2652
|
+
y: ee(x) + 3,
|
|
2653
|
+
"text-anchor": "end",
|
|
2654
|
+
"font-size": "9.5",
|
|
2655
|
+
style: se({ fill: He.value })
|
|
2656
|
+
}, Z(V(x)), 13, Ma))), 128))
|
|
2657
|
+
]),
|
|
2658
|
+
u.value.chartType === "bar" ? (f(!0), m(re, { key: 0 }, me(P.value, (x) => (f(), m("rect", {
|
|
2659
|
+
key: x.key,
|
|
2660
|
+
x: x.x,
|
|
2661
|
+
y: x.y,
|
|
2662
|
+
width: x.width,
|
|
2663
|
+
height: x.height,
|
|
2664
|
+
rx: "2.5",
|
|
2665
|
+
style: se({ fill: ve(x.seriesIndex) })
|
|
2666
|
+
}, null, 12, $a))), 128)) : (f(), m(re, { key: 1 }, [
|
|
2667
|
+
(f(!0), m(re, null, me(c.value, (x, b) => (f(), m("g", {
|
|
2668
|
+
key: x.dataKey
|
|
2669
|
+
}, [
|
|
2670
|
+
u.value.chartType === "line" ? (f(), m("path", {
|
|
2671
|
+
key: 0,
|
|
2672
|
+
d: $(x.dataKey),
|
|
2673
|
+
fill: "none",
|
|
2674
|
+
"stroke-width": "2",
|
|
2675
|
+
"stroke-linecap": "round",
|
|
2676
|
+
"stroke-linejoin": "round",
|
|
2677
|
+
"vector-effect": "non-scaling-stroke",
|
|
2678
|
+
style: se({ stroke: ve(b) })
|
|
2679
|
+
}, null, 12, La)) : q("", !0),
|
|
2680
|
+
(f(!0), m(re, null, me(o.value, (M, H) => (f(), m(re, {
|
|
2681
|
+
key: `${x.dataKey}-${H}`
|
|
2682
|
+
}, [
|
|
2683
|
+
u.value.chartType === "scatter" ? (f(), m("circle", {
|
|
2684
|
+
key: 0,
|
|
2685
|
+
cx: X(H, o.value.length),
|
|
2686
|
+
cy: ee(v(M[x.dataKey]) ?? 0),
|
|
2687
|
+
r: "2.6",
|
|
2688
|
+
style: se({ fill: ve(b) })
|
|
2689
|
+
}, null, 12, Oa)) : q("", !0)
|
|
2690
|
+
], 64))), 128))
|
|
2691
|
+
]))), 128)),
|
|
2692
|
+
(f(!0), m(re, null, me(ze.value, (x) => (f(), m("circle", {
|
|
2693
|
+
key: `marker-${x.key}`,
|
|
2694
|
+
cx: x.cx,
|
|
2695
|
+
cy: x.cy,
|
|
2696
|
+
r: "3",
|
|
2697
|
+
style: se({ fill: ve(x.seriesIndex) })
|
|
2698
|
+
}, null, 12, Na))), 128))
|
|
2699
|
+
], 64)),
|
|
2700
|
+
(f(!0), m(re, null, me(N.value, (x) => (f(), m("text", {
|
|
2701
|
+
key: x.key,
|
|
2702
|
+
x: x.x,
|
|
2703
|
+
y: R.height - 6,
|
|
2704
|
+
"text-anchor": x.anchor,
|
|
2705
|
+
"font-size": "9.5",
|
|
2706
|
+
style: se({ fill: He.value })
|
|
2707
|
+
}, Z(x.label), 13, za))), 128))
|
|
2708
|
+
], 12, Ia)),
|
|
2709
|
+
J.value.length > 1 || u.value.chartType !== "bar" ? (f(), m("div", Pa, [
|
|
2710
|
+
(f(!0), m(re, null, me(J.value, (x) => (f(), m("div", {
|
|
2711
|
+
key: x.key,
|
|
2712
|
+
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
2713
|
+
}, [
|
|
2714
|
+
T("span", {
|
|
2715
|
+
class: "size-2.5 shrink-0 rounded-full",
|
|
2716
|
+
style: se({ background: ve(x.seriesIndex) })
|
|
2717
|
+
}, null, 4),
|
|
2718
|
+
T("span", {
|
|
2719
|
+
style: se({ color: ce.value })
|
|
2720
|
+
}, Z(x.label), 5),
|
|
2721
|
+
T("span", {
|
|
2722
|
+
class: "font-semibold tabular-nums",
|
|
2723
|
+
style: se({ color: ye.value })
|
|
2724
|
+
}, Z(x.value), 5)
|
|
2725
|
+
]))), 128))
|
|
2726
|
+
])) : q("", !0)
|
|
2727
|
+
], 8, Ca)) : y.value ? (f(), m("div", Fa, [
|
|
2728
|
+
(f(!0), m(re, null, me(fe.value, (x, b) => (f(), m("div", {
|
|
2729
|
+
key: x.key
|
|
2730
|
+
}, [
|
|
2731
|
+
T("div", Ba, [
|
|
2732
|
+
T("span", {
|
|
2733
|
+
class: "truncate font-medium",
|
|
2734
|
+
style: se({ color: ye.value })
|
|
2735
|
+
}, Z(x.name), 5),
|
|
2736
|
+
T("span", {
|
|
2737
|
+
class: "tabular-nums",
|
|
2738
|
+
style: se({ color: ce.value })
|
|
2739
|
+
}, Z(Math.round(x.percent * 100)) + "%", 5)
|
|
2740
|
+
]),
|
|
2741
|
+
T("div", {
|
|
2742
|
+
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
2743
|
+
style: se({ background: tt.value })
|
|
2744
|
+
}, [
|
|
2745
|
+
T("div", {
|
|
2746
|
+
class: "h-full rounded-full",
|
|
2747
|
+
style: se({ width: `${Math.max(2, x.percent * 100)}%`, background: ve(b) })
|
|
2748
|
+
}, null, 4)
|
|
2749
|
+
], 4)
|
|
2750
|
+
]))), 128))
|
|
2751
|
+
])) : i.value ? (f(), m("div", Ua, [
|
|
2752
|
+
Ye.value.length ? (f(!0), m(re, { key: 0 }, me(Ye.value, (x, b) => (f(), m("div", {
|
|
2753
|
+
key: x.key,
|
|
2754
|
+
class: "grid grid-cols-[1.5rem_minmax(0,1fr)] items-start gap-x-2.5"
|
|
2755
|
+
}, [
|
|
2756
|
+
T("div", Ha, [
|
|
2757
|
+
T("span", {
|
|
2758
|
+
class: "grid size-5 place-items-center rounded-full border text-[10px] font-semibold leading-none",
|
|
2759
|
+
style: se({ borderColor: Ge.value, color: ce.value, background: te.value })
|
|
2760
|
+
}, Z(b + 1), 5),
|
|
2761
|
+
b !== Ye.value.length - 1 ? (f(), m("span", {
|
|
2762
|
+
key: 0,
|
|
2763
|
+
class: "w-px flex-1",
|
|
2764
|
+
style: se({ background: Ge.value, minHeight: "1.1rem" })
|
|
2765
|
+
}, null, 4)) : q("", !0)
|
|
2766
|
+
]),
|
|
2767
|
+
T("div", Ga, [
|
|
2768
|
+
T("div", {
|
|
2769
|
+
class: "text-[12.5px] font-semibold leading-snug",
|
|
2770
|
+
style: se({ color: ye.value })
|
|
2771
|
+
}, Z(x.label), 5),
|
|
2772
|
+
x.note ? (f(), m("div", {
|
|
2773
|
+
key: 0,
|
|
2774
|
+
class: "mt-0.5 text-[11px] leading-snug",
|
|
2775
|
+
style: se({ color: ce.value })
|
|
2776
|
+
}, Z(x.note), 5)) : q("", !0)
|
|
2777
|
+
])
|
|
2778
|
+
]))), 128)) : (f(!0), m(re, { key: 1 }, me(Ke.value, (x) => (f(), m("div", {
|
|
2779
|
+
key: x.id,
|
|
2780
|
+
class: "mb-1.5 rounded-xl border px-2.5 py-2 text-[12px] font-medium leading-tight",
|
|
2781
|
+
style: se({ borderColor: Ge.value, color: ye.value })
|
|
2782
|
+
}, Z(x.label), 5))), 128))
|
|
2783
|
+
])) : q("", !0),
|
|
2784
|
+
e.value.meta.footer ? (f(), m("footer", {
|
|
2785
|
+
key: 3,
|
|
2786
|
+
class: "mt-3 text-[11px] leading-snug",
|
|
2787
|
+
style: se({ color: He.value })
|
|
2788
|
+
}, Z(e.value.meta.footer), 5)) : q("", !0)
|
|
2789
|
+
], 12, Ea)) : (f(), m("section", {
|
|
2790
|
+
key: 1,
|
|
2791
|
+
"data-test": "chat-visual-fallback",
|
|
2792
|
+
class: "mt-3 mb-2 w-full border-y py-2 text-[12px] leading-snug",
|
|
2793
|
+
style: se({ borderColor: Pe.value, color: ce.value })
|
|
2794
|
+
}, " Visual unavailable. Showing the written answer instead. ", 4));
|
|
2795
|
+
}
|
|
2796
|
+
}), Wa = { class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed" }, qa = ["innerHTML"], Pt = /* @__PURE__ */ Ne({
|
|
2411
2797
|
__name: "ChatRichText",
|
|
2412
2798
|
props: {
|
|
2413
2799
|
text: {},
|
|
@@ -2415,51 +2801,81 @@ const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
|
2415
2801
|
streaming: { type: Boolean }
|
|
2416
2802
|
},
|
|
2417
2803
|
setup(a) {
|
|
2418
|
-
const t = a, e =
|
|
2804
|
+
const t = a, e = fs(t.text);
|
|
2419
2805
|
let n;
|
|
2420
|
-
|
|
2806
|
+
Ft(
|
|
2421
2807
|
[() => t.text, () => t.streaming],
|
|
2422
|
-
([
|
|
2423
|
-
if (!
|
|
2424
|
-
n !== void 0 && (cancelAnimationFrame(n), n = void 0), e.value =
|
|
2808
|
+
([u, c]) => {
|
|
2809
|
+
if (!c) {
|
|
2810
|
+
n !== void 0 && (cancelAnimationFrame(n), n = void 0), e.value = u;
|
|
2425
2811
|
return;
|
|
2426
2812
|
}
|
|
2427
2813
|
n === void 0 && (n = requestAnimationFrame(() => {
|
|
2428
2814
|
n = void 0, e.value = t.text;
|
|
2429
2815
|
}));
|
|
2430
2816
|
}
|
|
2431
|
-
),
|
|
2817
|
+
), gs(() => {
|
|
2432
2818
|
n !== void 0 && cancelAnimationFrame(n);
|
|
2433
2819
|
});
|
|
2434
|
-
const i = new
|
|
2435
|
-
i.link = ({ href:
|
|
2436
|
-
const
|
|
2437
|
-
if (!
|
|
2438
|
-
return
|
|
2439
|
-
let
|
|
2820
|
+
const i = new Y.Renderer();
|
|
2821
|
+
i.link = ({ href: u, text: c }) => {
|
|
2822
|
+
const y = u.trim();
|
|
2823
|
+
if (!y || y === "#")
|
|
2824
|
+
return c;
|
|
2825
|
+
let v = !1;
|
|
2440
2826
|
if (typeof window < "u")
|
|
2441
2827
|
try {
|
|
2442
|
-
|
|
2828
|
+
v = new URL(u, window.location.href).origin === window.location.origin;
|
|
2443
2829
|
} catch {
|
|
2444
|
-
|
|
2830
|
+
v = !1;
|
|
2445
2831
|
}
|
|
2446
|
-
return
|
|
2447
|
-
},
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2832
|
+
return v ? `<a href="${u}">${c}</a>` : `<a href="${u}" target="_blank" rel="noopener noreferrer">${c}</a>`;
|
|
2833
|
+
}, Y.setOptions({ breaks: !0, gfm: !0, renderer: i });
|
|
2834
|
+
function s(u) {
|
|
2835
|
+
if (!u) return "";
|
|
2836
|
+
const c = Y.parse(u, { async: !1 });
|
|
2837
|
+
return Fi.sanitize(c, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
|
|
2838
|
+
}
|
|
2839
|
+
d(s, "renderMarkdown");
|
|
2840
|
+
function l(u) {
|
|
2841
|
+
const c = [], y = /```pl-visual[ \t]*\r?\n([\s\S]*?)```/g;
|
|
2842
|
+
let v = 0, A = 0, _ = y.exec(u);
|
|
2843
|
+
for (; _ !== null; ) {
|
|
2844
|
+
const X = u.slice(v, _.index), ee = s(X);
|
|
2845
|
+
ee && c.push({ kind: "markdown", key: `md-${A}`, html: ee }), c.push({
|
|
2846
|
+
kind: "visual",
|
|
2847
|
+
key: `visual-${A}`,
|
|
2848
|
+
result: Ws(_[1].trim())
|
|
2849
|
+
}), v = _.index + _[0].length, A += 1, _ = y.exec(u);
|
|
2850
|
+
}
|
|
2851
|
+
const G = u.slice(v), R = s(G);
|
|
2852
|
+
return R && c.push({ kind: "markdown", key: `md-${A}`, html: R }), c;
|
|
2853
|
+
}
|
|
2854
|
+
d(l, "richTextSegments");
|
|
2855
|
+
const o = I(() => {
|
|
2856
|
+
const u = e.value;
|
|
2857
|
+
return u ? l(u) : [];
|
|
2453
2858
|
});
|
|
2454
|
-
return (
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2859
|
+
return (u, c) => (f(), m("div", Wa, [
|
|
2860
|
+
(f(!0), m(re, null, me(o.value, (y) => (f(), m(re, {
|
|
2861
|
+
key: y.key
|
|
2862
|
+
}, [
|
|
2863
|
+
y.kind === "markdown" ? (f(), m("div", {
|
|
2864
|
+
key: 0,
|
|
2865
|
+
class: D(["chat-msg-prose", a.inverted ? "chat-msg-prose-invert" : ""]),
|
|
2866
|
+
innerHTML: y.html
|
|
2867
|
+
}, null, 10, qa)) : (f(), un(ja, {
|
|
2868
|
+
key: 1,
|
|
2869
|
+
result: y.result,
|
|
2870
|
+
inverted: a.inverted
|
|
2871
|
+
}, null, 8, ["result", "inverted"]))
|
|
2872
|
+
], 64))), 128))
|
|
2873
|
+
]));
|
|
2458
2874
|
}
|
|
2459
|
-
}),
|
|
2875
|
+
}), Va = 80, Ya = /* @__PURE__ */ Ne({
|
|
2460
2876
|
__name: "ChatScroller",
|
|
2461
2877
|
setup(a, { expose: t }) {
|
|
2462
|
-
const e =
|
|
2878
|
+
const e = xe(), n = xe();
|
|
2463
2879
|
let i = !0, s;
|
|
2464
2880
|
function l() {
|
|
2465
2881
|
const c = e.value;
|
|
@@ -2468,70 +2884,70 @@ const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
|
2468
2884
|
d(l, "scrollToBottom");
|
|
2469
2885
|
function o() {
|
|
2470
2886
|
const c = e.value;
|
|
2471
|
-
c && (i = c.scrollHeight - c.scrollTop - c.clientHeight <=
|
|
2887
|
+
c && (i = c.scrollHeight - c.scrollTop - c.clientHeight <= Va);
|
|
2472
2888
|
}
|
|
2473
2889
|
d(o, "onScroll");
|
|
2474
|
-
function
|
|
2890
|
+
function u() {
|
|
2475
2891
|
i = !0, l();
|
|
2476
2892
|
}
|
|
2477
|
-
return d(
|
|
2893
|
+
return d(u, "pin"), t({ pin: u }), jt(() => {
|
|
2478
2894
|
requestAnimationFrame(() => {
|
|
2479
2895
|
l(), requestAnimationFrame(l);
|
|
2480
2896
|
}), n.value && (s = new ResizeObserver(() => {
|
|
2481
2897
|
i && l();
|
|
2482
2898
|
}), s.observe(n.value));
|
|
2483
|
-
}),
|
|
2899
|
+
}), gs(() => {
|
|
2484
2900
|
s?.disconnect();
|
|
2485
|
-
}), (c,
|
|
2901
|
+
}), (c, y) => (f(), m("div", {
|
|
2486
2902
|
ref_key: "viewport",
|
|
2487
2903
|
ref: e,
|
|
2488
2904
|
class: "overflow-y-auto overflow-x-hidden min-h-0 flex flex-col [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
2489
2905
|
onScrollPassive: o
|
|
2490
2906
|
}, [
|
|
2491
|
-
|
|
2907
|
+
T("div", {
|
|
2492
2908
|
ref_key: "content",
|
|
2493
2909
|
ref: n,
|
|
2494
2910
|
class: "flex-1 flex flex-col"
|
|
2495
2911
|
}, [
|
|
2496
|
-
|
|
2912
|
+
fn(c.$slots, "default")
|
|
2497
2913
|
], 512)
|
|
2498
2914
|
], 544));
|
|
2499
2915
|
}
|
|
2500
|
-
}),
|
|
2916
|
+
}), Ka = { class: "@container/chat flex flex-col h-full relative" }, Za = {
|
|
2501
2917
|
key: 0,
|
|
2502
2918
|
class: "pb-4"
|
|
2503
|
-
},
|
|
2919
|
+
}, Xa = {
|
|
2504
2920
|
key: 0,
|
|
2505
2921
|
class: "flex flex-col items-center justify-center px-4 min-h-full"
|
|
2506
|
-
},
|
|
2922
|
+
}, Qa = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Ja = ["src", "alt"], er = ["title"], tr = {
|
|
2507
2923
|
key: 0,
|
|
2508
2924
|
class: "flex items-center gap-3 py-3 px-2"
|
|
2509
|
-
},
|
|
2925
|
+
}, nr = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-issue-action-label", "data-issue-action-url", "data-streaming"], sr = { class: "max-w-[85%] min-w-0" }, ir = ["href"], ar = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-streaming"], rr = ["data-test", "data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-streaming"], lr = {
|
|
2510
2926
|
key: 0,
|
|
2511
2927
|
class: "flex-shrink-0 size-7 @sm/chat:size-8"
|
|
2512
|
-
},
|
|
2928
|
+
}, or = ["src", "alt"], cr = ["src", "alt"], ur = ["src"], hr = ["href"], dr = ["data-tool-activity-status"], pr = { class: "truncate" }, fr = ["data-working-description"], gr = { class: "truncate" }, mr = ["data-tool-activity-status"], xr = { class: "truncate" }, kr = ["data-issue-code"], br = ["href"], vr = {
|
|
2513
2929
|
key: 4,
|
|
2514
2930
|
"data-test": "messaging-thinking-indicator",
|
|
2515
2931
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
2516
|
-
},
|
|
2932
|
+
}, yr = ["src", "alt"], wr = {
|
|
2517
2933
|
key: 0,
|
|
2518
2934
|
class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
2519
|
-
},
|
|
2935
|
+
}, Tr = ["src", "alt"], Sr = { class: "max-w-20 truncate" }, Ar = ["onClick"], _r = {
|
|
2520
2936
|
key: 0,
|
|
2521
2937
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
2522
|
-
},
|
|
2938
|
+
}, Er = ["disabled"], Rr = {
|
|
2523
2939
|
key: 0,
|
|
2524
2940
|
class: "i-svg-spinners-ring-resize size-4"
|
|
2525
|
-
},
|
|
2941
|
+
}, Cr = {
|
|
2526
2942
|
key: 1,
|
|
2527
2943
|
class: "i-tabler-paperclip size-5"
|
|
2528
|
-
},
|
|
2944
|
+
}, Ir = ["placeholder", "disabled"], Dr = ["data-composer-action", "disabled", "aria-label"], Mr = {
|
|
2529
2945
|
key: 0,
|
|
2530
2946
|
class: "i-tabler-player-stop-filled size-4"
|
|
2531
|
-
},
|
|
2947
|
+
}, $r = {
|
|
2532
2948
|
key: 1,
|
|
2533
2949
|
class: "i-tabler-arrow-up size-5"
|
|
2534
|
-
},
|
|
2950
|
+
}, Wr = /* @__PURE__ */ Ne({
|
|
2535
2951
|
__name: "ElAgentChat",
|
|
2536
2952
|
props: {
|
|
2537
2953
|
chatController: {},
|
|
@@ -2548,218 +2964,218 @@ const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
|
2548
2964
|
private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
|
|
2549
2965
|
org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
|
|
2550
2966
|
public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
|
|
2551
|
-
}, e =
|
|
2552
|
-
const
|
|
2553
|
-
return a.scope === "org" && a.scopeName && (
|
|
2554
|
-
}), n =
|
|
2555
|
-
function
|
|
2556
|
-
return
|
|
2557
|
-
}
|
|
2558
|
-
d(
|
|
2559
|
-
function
|
|
2560
|
-
return
|
|
2561
|
-
}
|
|
2562
|
-
d(
|
|
2563
|
-
function
|
|
2564
|
-
const p =
|
|
2565
|
-
return !
|
|
2566
|
-
}
|
|
2567
|
-
d(
|
|
2568
|
-
const
|
|
2569
|
-
function
|
|
2570
|
-
if (!
|
|
2967
|
+
}, e = I(() => {
|
|
2968
|
+
const E = { ...t[a.scope] };
|
|
2969
|
+
return a.scope === "org" && a.scopeName && (E.label = a.scopeName, E.tooltip = `Visible to ${a.scopeName} members`), E;
|
|
2970
|
+
}), n = xe(""), i = xe(!1), s = xe(), l = xe(), o = xe(), u = xe([]), c = xe(!1);
|
|
2971
|
+
function y(E) {
|
|
2972
|
+
return E ? /\[[^\]]+\]\([^)]+\)/.test(E) : !1;
|
|
2973
|
+
}
|
|
2974
|
+
d(y, "containsMarkdownLink");
|
|
2975
|
+
function v(E) {
|
|
2976
|
+
return E.sender === "system" && (!!E.issue || E.id === Te.value);
|
|
2977
|
+
}
|
|
2978
|
+
d(v, "isSystemExplainerMessage");
|
|
2979
|
+
function A(E, g) {
|
|
2980
|
+
const p = E[g], L = E[g + 1];
|
|
2981
|
+
return !L || L.sender !== p.sender;
|
|
2982
|
+
}
|
|
2983
|
+
d(A, "shouldShowAvatar");
|
|
2984
|
+
const _ = I(() => a.chatController?.textState.value), G = I(() => _.value?.isConnected ?? !1), R = I(() => _.value?.isThinking ?? !1), X = I(() => _.value?.connectionStatus === "disconnected" && !!_.value?.error), ee = I(() => _.value?.connectionStatus !== "connected" && !_.value?.error), $ = I(() => _.value?.error), P = I(() => a.chatController?.sharedMessages.value ?? []), N = I(() => _.value?.workingDescription?.trim() || void 0), V = I(() => R.value ? _.value?.toolActivities ?? [] : []), U = I(() => J(V.value));
|
|
2985
|
+
function J(E) {
|
|
2986
|
+
if (!E?.length)
|
|
2571
2987
|
return;
|
|
2572
|
-
const g =
|
|
2988
|
+
const g = ze(E, "started");
|
|
2573
2989
|
if (g)
|
|
2574
2990
|
return { status: "started", icon: "i-tabler-loader-2 animate-spin", label: g.label };
|
|
2575
|
-
const p =
|
|
2991
|
+
const p = ze(E, "failed");
|
|
2576
2992
|
if (p)
|
|
2577
2993
|
return { status: "failed", icon: "i-tabler-alert-circle text-theme-500", label: p.label };
|
|
2578
|
-
const
|
|
2579
|
-
if (
|
|
2994
|
+
const L = E.filter((Q) => Q.status === "completed").length;
|
|
2995
|
+
if (L > 0)
|
|
2580
2996
|
return {
|
|
2581
2997
|
status: "completed",
|
|
2582
2998
|
icon: "i-tabler-circle-check-filled text-primary-500",
|
|
2583
|
-
label:
|
|
2999
|
+
label: L === 1 ? "1 action completed" : `${L} actions completed`
|
|
2584
3000
|
};
|
|
2585
3001
|
}
|
|
2586
|
-
d(
|
|
2587
|
-
function
|
|
2588
|
-
for (let p =
|
|
2589
|
-
const
|
|
2590
|
-
if (
|
|
2591
|
-
return
|
|
3002
|
+
d(J, "toolActivityLineFor");
|
|
3003
|
+
function ze(E, g) {
|
|
3004
|
+
for (let p = E.length - 1; p >= 0; p--) {
|
|
3005
|
+
const L = E[p];
|
|
3006
|
+
if (L?.status === g)
|
|
3007
|
+
return L;
|
|
2592
3008
|
}
|
|
2593
3009
|
}
|
|
2594
|
-
d(
|
|
2595
|
-
const
|
|
2596
|
-
if (!
|
|
2597
|
-
const
|
|
3010
|
+
d(ze, "lastToolActivityWithStatus");
|
|
3011
|
+
const fe = I(() => _.value?.transientIssue), Te = I(() => {
|
|
3012
|
+
if (!R.value) return;
|
|
3013
|
+
const E = P.value, g = E[E.length - 1];
|
|
2598
3014
|
return g?.sender === "agent" || g?.sender === "system" ? g.id : void 0;
|
|
2599
|
-
}),
|
|
2600
|
-
() =>
|
|
2601
|
-
),
|
|
2602
|
-
|
|
2603
|
-
a.chatController && !
|
|
3015
|
+
}), Ye = I(() => !R.value || N.value ? !1 : Te.value === void 0), Ke = I(() => _.value?.sendBlockedReason), Ue = I(() => !G.value || Ke.value !== void 0), ie = I(() => X.value ? "Agent is offline" : ee.value ? "Connecting..." : Ke.value === "agent_deleted" ? "This assistant was deleted" : Ke.value === "account" ? "Resolve the billing issue above to continue" : "Message"), ve = I(() => (n.value.trim() || u.value.length > 0) && !Ue.value && !c.value && !R.value), ye = I(() => !!a.chatController && R.value && !c.value), ce = I(() => ye.value ? "stop" : ve.value ? "send" : "idle"), He = I(() => ce.value !== "idle"), z = I(() => a.variant === "light"), et = I(
|
|
3016
|
+
() => z.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
3017
|
+
), Pe = I(() => z.value ? "text-theme-300" : "text-white/30");
|
|
3018
|
+
jt(async () => {
|
|
3019
|
+
a.chatController && !G.value && await a.chatController.startTextConversation();
|
|
2604
3020
|
});
|
|
2605
|
-
async function
|
|
2606
|
-
const
|
|
2607
|
-
if (!
|
|
3021
|
+
async function Ge() {
|
|
3022
|
+
const E = n.value.trim(), g = u.value.length > 0;
|
|
3023
|
+
if (!E && !g || !a.chatController || Ue.value || c.value || R.value)
|
|
2608
3024
|
return;
|
|
2609
|
-
const p = n.value,
|
|
2610
|
-
n.value = "",
|
|
3025
|
+
const p = n.value, L = g ? [...u.value] : void 0;
|
|
3026
|
+
n.value = "", u.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await a.chatController.sendChatMessage(p, L);
|
|
2611
3027
|
}
|
|
2612
|
-
d(
|
|
2613
|
-
async function
|
|
2614
|
-
!a.chatController || !
|
|
3028
|
+
d(Ge, "sendMessage");
|
|
3029
|
+
async function tt() {
|
|
3030
|
+
!a.chatController || !ye.value || await a.chatController.stopChatTurn();
|
|
2615
3031
|
}
|
|
2616
|
-
d(
|
|
2617
|
-
async function
|
|
2618
|
-
if (
|
|
2619
|
-
await
|
|
3032
|
+
d(tt, "stopMessage");
|
|
3033
|
+
async function te() {
|
|
3034
|
+
if (ce.value === "stop") {
|
|
3035
|
+
await tt();
|
|
2620
3036
|
return;
|
|
2621
3037
|
}
|
|
2622
|
-
|
|
3038
|
+
ce.value === "send" && await Ge();
|
|
2623
3039
|
}
|
|
2624
|
-
d(
|
|
2625
|
-
async function
|
|
2626
|
-
|
|
3040
|
+
d(te, "handleComposerAction");
|
|
3041
|
+
async function k(E) {
|
|
3042
|
+
E.key === "Enter" && !E.shiftKey && (E.preventDefault(), await Ge());
|
|
2627
3043
|
}
|
|
2628
|
-
d(
|
|
2629
|
-
function
|
|
3044
|
+
d(k, "handleKeydown");
|
|
3045
|
+
function w() {
|
|
2630
3046
|
l.value && (l.value.style.height = "auto", l.value.style.height = `${Math.min(l.value.scrollHeight, 150)}px`);
|
|
2631
3047
|
}
|
|
2632
|
-
d(
|
|
2633
|
-
function
|
|
3048
|
+
d(w, "adjustTextareaHeight"), Ft(n, () => Bs(() => w()));
|
|
3049
|
+
function x() {
|
|
2634
3050
|
o.value?.click();
|
|
2635
3051
|
}
|
|
2636
|
-
d(
|
|
2637
|
-
async function
|
|
2638
|
-
const g =
|
|
3052
|
+
d(x, "triggerFileInput");
|
|
3053
|
+
async function b(E) {
|
|
3054
|
+
const g = E.target, p = g.files?.[0];
|
|
2639
3055
|
if (!(!p || !a.uploadFn)) {
|
|
2640
3056
|
c.value = !0;
|
|
2641
3057
|
try {
|
|
2642
|
-
const
|
|
2643
|
-
|
|
2644
|
-
} catch (
|
|
2645
|
-
const
|
|
2646
|
-
a.chatController?.notify(`Upload failed — ${
|
|
3058
|
+
const L = await a.uploadFn(p);
|
|
3059
|
+
u.value = [...u.value, L];
|
|
3060
|
+
} catch (L) {
|
|
3061
|
+
const Q = L instanceof Error ? L.message : "Couldn't attach that file.";
|
|
3062
|
+
a.chatController?.notify(`Upload failed — ${Q}`);
|
|
2647
3063
|
} finally {
|
|
2648
3064
|
c.value = !1, g.value = "";
|
|
2649
3065
|
}
|
|
2650
3066
|
}
|
|
2651
3067
|
}
|
|
2652
|
-
d(
|
|
2653
|
-
function
|
|
2654
|
-
|
|
3068
|
+
d(b, "handleFileSelect");
|
|
3069
|
+
function M(E) {
|
|
3070
|
+
u.value = u.value.filter((g, p) => p !== E);
|
|
2655
3071
|
}
|
|
2656
|
-
d(
|
|
2657
|
-
function
|
|
3072
|
+
d(M, "removeAttachment");
|
|
3073
|
+
function H(E, g) {
|
|
2658
3074
|
if (g === 0) {
|
|
2659
|
-
const
|
|
2660
|
-
return
|
|
2661
|
-
}
|
|
2662
|
-
const p =
|
|
2663
|
-
if (!p?.timestamp || !
|
|
2664
|
-
const
|
|
2665
|
-
return new Date(
|
|
2666
|
-
}
|
|
2667
|
-
d(
|
|
2668
|
-
function
|
|
2669
|
-
const g = /* @__PURE__ */ new Date(), p =
|
|
2670
|
-
|
|
2671
|
-
const
|
|
2672
|
-
if (p) return
|
|
2673
|
-
if (
|
|
2674
|
-
const
|
|
2675
|
-
return `${
|
|
3075
|
+
const Fe = E[g];
|
|
3076
|
+
return Fe?.timestamp ? j(new Date(Fe.timestamp)) : null;
|
|
3077
|
+
}
|
|
3078
|
+
const p = E[g - 1], L = E[g];
|
|
3079
|
+
if (!p?.timestamp || !L?.timestamp) return null;
|
|
3080
|
+
const Q = new Date(p.timestamp).getTime();
|
|
3081
|
+
return new Date(L.timestamp).getTime() - Q > 36e5 ? j(new Date(L.timestamp)) : null;
|
|
3082
|
+
}
|
|
3083
|
+
d(H, "shouldShowTimeDivider");
|
|
3084
|
+
function j(E) {
|
|
3085
|
+
const g = /* @__PURE__ */ new Date(), p = E.toDateString() === g.toDateString(), L = new Date(g);
|
|
3086
|
+
L.setDate(L.getDate() - 1);
|
|
3087
|
+
const Q = E.toDateString() === L.toDateString(), be = E.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
3088
|
+
if (p) return be;
|
|
3089
|
+
if (Q) return `Yesterday, ${be}`;
|
|
3090
|
+
const we = E.getFullYear() === g.getFullYear();
|
|
3091
|
+
return `${E.toLocaleDateString("en-US", {
|
|
2676
3092
|
weekday: "long",
|
|
2677
3093
|
month: "short",
|
|
2678
3094
|
day: "numeric",
|
|
2679
|
-
...
|
|
2680
|
-
})}, ${
|
|
3095
|
+
...we ? {} : { year: "numeric" }
|
|
3096
|
+
})}, ${be}`;
|
|
2681
3097
|
}
|
|
2682
|
-
return d(
|
|
2683
|
-
|
|
2684
|
-
|
|
3098
|
+
return d(j, "formatTimeDivider"), (E, g) => (f(), m("div", Ka, [
|
|
3099
|
+
z.value ? q("", !0) : (f(), m("div", Za, [
|
|
3100
|
+
lt(oi, {
|
|
2685
3101
|
agent: a.agent,
|
|
2686
|
-
"is-online":
|
|
3102
|
+
"is-online": G.value
|
|
2687
3103
|
}, null, 8, ["agent", "is-online"])
|
|
2688
3104
|
])),
|
|
2689
|
-
X.value ? (
|
|
3105
|
+
X.value ? (f(), m("div", {
|
|
2690
3106
|
key: 1,
|
|
2691
|
-
class:
|
|
3107
|
+
class: D(["py-16 flex flex-col items-center justify-center gap-3 text-sm", z.value ? "text-theme-400" : "text-white/60"])
|
|
2692
3108
|
}, [
|
|
2693
|
-
|
|
2694
|
-
class:
|
|
3109
|
+
T("i", {
|
|
3110
|
+
class: D(["i-heroicons-cloud-arrow-down size-8", z.value ? "text-theme-300" : "text-white/40"])
|
|
2695
3111
|
}, null, 2),
|
|
2696
|
-
|
|
2697
|
-
], 2)) :
|
|
3112
|
+
T("span", null, Z($.value), 1)
|
|
3113
|
+
], 2)) : ee.value ? (f(), m("div", {
|
|
2698
3114
|
key: 2,
|
|
2699
|
-
class:
|
|
3115
|
+
class: D(["py-16 flex flex-col items-center justify-center gap-2 text-sm", z.value ? "text-theme-400" : "text-theme-600"])
|
|
2700
3116
|
}, [
|
|
2701
|
-
|
|
2702
|
-
], 2)) : a.setupHint ? (
|
|
3117
|
+
lt(jn, { class: "size-4" })
|
|
3118
|
+
], 2)) : a.setupHint ? (f(), m("div", {
|
|
2703
3119
|
key: 3,
|
|
2704
|
-
class:
|
|
3120
|
+
class: D(["flex items-center justify-center gap-1.5 py-2 text-[11px]", Pe.value])
|
|
2705
3121
|
}, [
|
|
2706
|
-
g[10] || (g[10] =
|
|
2707
|
-
|
|
2708
|
-
], 2)) :
|
|
2709
|
-
|
|
3122
|
+
g[10] || (g[10] = T("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
3123
|
+
T("span", null, Z(a.setupHint), 1)
|
|
3124
|
+
], 2)) : q("", !0),
|
|
3125
|
+
lt(Ya, {
|
|
2710
3126
|
ref_key: "chatScroller",
|
|
2711
3127
|
ref: s,
|
|
2712
3128
|
class: "flex-1"
|
|
2713
3129
|
}, {
|
|
2714
|
-
default:
|
|
2715
|
-
|
|
2716
|
-
class:
|
|
3130
|
+
default: Us(() => [
|
|
3131
|
+
T("div", {
|
|
3132
|
+
class: D(P.value.length === 0 ? "flex-1 flex flex-col items-center justify-center px-3" : "pt-4 pb-[120px] px-3 space-y-1")
|
|
2717
3133
|
}, [
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
3134
|
+
P.value.length === 0 && !ee.value && !X.value ? (f(), m("div", Xa, [
|
|
3135
|
+
T("div", Qa, [
|
|
3136
|
+
T("img", {
|
|
2721
3137
|
src: a.agent.avatarUrl.value,
|
|
2722
3138
|
alt: a.agent.displayName.value,
|
|
2723
|
-
class:
|
|
2724
|
-
}, null, 10,
|
|
2725
|
-
|
|
3139
|
+
class: D(["size-full rounded-full object-cover ring-1", z.value ? "ring-black/5" : "ring-white/10"])
|
|
3140
|
+
}, null, 10, Ja),
|
|
3141
|
+
G.value ? (f(), m("span", {
|
|
2726
3142
|
key: 0,
|
|
2727
|
-
class:
|
|
3143
|
+
class: D(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", z.value ? "bg-white" : "bg-theme-900"])
|
|
2728
3144
|
}, [...g[11] || (g[11] = [
|
|
2729
|
-
|
|
2730
|
-
])], 2)) :
|
|
3145
|
+
T("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
3146
|
+
])], 2)) : q("", !0)
|
|
2731
3147
|
]),
|
|
2732
|
-
|
|
2733
|
-
class:
|
|
2734
|
-
},
|
|
2735
|
-
|
|
2736
|
-
class:
|
|
2737
|
-
},
|
|
2738
|
-
|
|
2739
|
-
class:
|
|
3148
|
+
T("div", {
|
|
3149
|
+
class: D(["text-base @sm/chat:text-lg font-semibold", z.value ? "text-theme-900" : "text-white"])
|
|
3150
|
+
}, Z(a.agent.displayName.value), 3),
|
|
3151
|
+
T("p", {
|
|
3152
|
+
class: D(["mt-1 text-center text-xs @sm/chat:text-sm", Pe.value])
|
|
3153
|
+
}, Z(a.emptyStateMessage || "Type your message to get started."), 3),
|
|
3154
|
+
T("div", {
|
|
3155
|
+
class: D(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", z.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
2740
3156
|
title: e.value.tooltip
|
|
2741
3157
|
}, [
|
|
2742
|
-
|
|
2743
|
-
class:
|
|
3158
|
+
T("i", {
|
|
3159
|
+
class: D([e.value.icon, "size-3"])
|
|
2744
3160
|
}, null, 2),
|
|
2745
|
-
|
|
2746
|
-
], 10,
|
|
2747
|
-
])) :
|
|
2748
|
-
(
|
|
3161
|
+
T("span", null, Z(e.value.label), 1)
|
|
3162
|
+
], 10, er)
|
|
3163
|
+
])) : q("", !0),
|
|
3164
|
+
(f(!0), m(re, null, me(P.value, (p, L) => (f(), m(re, {
|
|
2749
3165
|
key: p.id
|
|
2750
3166
|
}, [
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
class:
|
|
3167
|
+
H(P.value, L) ? (f(), m("div", tr, [
|
|
3168
|
+
T("div", {
|
|
3169
|
+
class: D(["flex-1 h-px", et.value])
|
|
2754
3170
|
}, null, 2),
|
|
2755
|
-
|
|
2756
|
-
class:
|
|
2757
|
-
},
|
|
2758
|
-
|
|
2759
|
-
class:
|
|
3171
|
+
T("span", {
|
|
3172
|
+
class: D(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", Pe.value])
|
|
3173
|
+
}, Z(H(P.value, L)), 3),
|
|
3174
|
+
T("div", {
|
|
3175
|
+
class: D(["flex-1 h-px", et.value])
|
|
2760
3176
|
}, null, 2)
|
|
2761
|
-
])) :
|
|
2762
|
-
|
|
3177
|
+
])) : q("", !0),
|
|
3178
|
+
v(p) ? (f(), m("div", {
|
|
2763
3179
|
key: 1,
|
|
2764
3180
|
"data-test": "messaging-system-msg",
|
|
2765
3181
|
"data-message-id": p.id,
|
|
@@ -2771,42 +3187,42 @@ const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
|
2771
3187
|
"data-issue-bucket": p.issue?.bucket,
|
|
2772
3188
|
"data-issue-action-label": p.issue?.actionLabel,
|
|
2773
3189
|
"data-issue-action-url": p.issue?.actionUrl,
|
|
2774
|
-
"data-streaming": p.id ===
|
|
3190
|
+
"data-streaming": p.id === Te.value ? "true" : void 0,
|
|
2775
3191
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
2776
3192
|
}, [
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
class:
|
|
3193
|
+
T("div", sr, [
|
|
3194
|
+
T("div", {
|
|
3195
|
+
class: D(["mb-1 pl-1 text-[11px] font-medium", z.value ? "text-theme-500" : "text-white/45"])
|
|
2780
3196
|
}, " System Message ", 2),
|
|
2781
|
-
|
|
2782
|
-
class:
|
|
3197
|
+
T("div", {
|
|
3198
|
+
class: D(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", z.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
|
|
2783
3199
|
}, [
|
|
2784
|
-
p.text ? (
|
|
3200
|
+
p.text ? (f(), un(Pt, {
|
|
2785
3201
|
key: 0,
|
|
2786
3202
|
text: p.text,
|
|
2787
|
-
inverted: !
|
|
2788
|
-
streaming: p.id ===
|
|
2789
|
-
onClick: g[0] || (g[0] =
|
|
3203
|
+
inverted: !z.value,
|
|
3204
|
+
streaming: p.id === Te.value,
|
|
3205
|
+
onClick: g[0] || (g[0] = yt(() => {
|
|
2790
3206
|
}, ["stop"]))
|
|
2791
|
-
}, null, 8, ["text", "inverted", "streaming"])) : p.issue?.help ? (
|
|
3207
|
+
}, null, 8, ["text", "inverted", "streaming"])) : p.issue?.help ? (f(), un(Pt, {
|
|
2792
3208
|
key: 1,
|
|
2793
3209
|
text: p.issue.help,
|
|
2794
|
-
inverted: !
|
|
2795
|
-
}, null, 8, ["text", "inverted"])) :
|
|
2796
|
-
p.issue?.actionUrl && !
|
|
3210
|
+
inverted: !z.value
|
|
3211
|
+
}, null, 8, ["text", "inverted"])) : q("", !0),
|
|
3212
|
+
p.issue?.actionUrl && !y(p.text) ? (f(), m("a", {
|
|
2797
3213
|
key: 2,
|
|
2798
3214
|
href: p.issue.actionUrl,
|
|
2799
3215
|
"data-test": "messaging-system-msg-action",
|
|
2800
|
-
class:
|
|
2801
|
-
onClick: g[1] || (g[1] =
|
|
3216
|
+
class: D(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", z.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
3217
|
+
onClick: g[1] || (g[1] = yt(() => {
|
|
2802
3218
|
}, ["stop"]))
|
|
2803
3219
|
}, [
|
|
2804
|
-
|
|
2805
|
-
g[12] || (g[12] =
|
|
2806
|
-
], 10,
|
|
3220
|
+
Ot(Z(p.issue.actionLabel) + " ", 1),
|
|
3221
|
+
g[12] || (g[12] = T("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
3222
|
+
], 10, ir)) : q("", !0)
|
|
2807
3223
|
], 2)
|
|
2808
3224
|
])
|
|
2809
|
-
], 8,
|
|
3225
|
+
], 8, nr)) : p.sender === "system" ? (f(), m("div", {
|
|
2810
3226
|
key: 2,
|
|
2811
3227
|
"data-test": "messaging-system-status-msg",
|
|
2812
3228
|
"data-message-id": p.id,
|
|
@@ -2816,17 +3232,17 @@ const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
|
2816
3232
|
"data-system-kind": p.systemKind,
|
|
2817
3233
|
"data-issue-code": p.issue?.code,
|
|
2818
3234
|
"data-issue-bucket": p.issue?.bucket,
|
|
2819
|
-
"data-streaming": p.id ===
|
|
2820
|
-
class:
|
|
3235
|
+
"data-streaming": p.id === Te.value ? "true" : void 0,
|
|
3236
|
+
class: D(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", z.value ? "text-theme-500" : "text-white/60"])
|
|
2821
3237
|
}, [
|
|
2822
|
-
g[13] || (g[13] =
|
|
2823
|
-
|
|
3238
|
+
g[13] || (g[13] = T("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
|
|
3239
|
+
lt(Pt, {
|
|
2824
3240
|
text: p.text,
|
|
2825
|
-
inverted: !
|
|
2826
|
-
onClick: g[2] || (g[2] =
|
|
3241
|
+
inverted: !z.value,
|
|
3242
|
+
onClick: g[2] || (g[2] = yt(() => {
|
|
2827
3243
|
}, ["stop"]))
|
|
2828
3244
|
}, null, 8, ["text", "inverted"])
|
|
2829
|
-
], 10,
|
|
3245
|
+
], 10, ar)) : (f(), m("div", {
|
|
2830
3246
|
key: 3,
|
|
2831
3247
|
"data-test": p.sender === "agent" ? "messaging-assistant-msg" : p.sender === "user" ? "messaging-user-msg" : void 0,
|
|
2832
3248
|
"data-message-id": p.id,
|
|
@@ -2834,235 +3250,235 @@ const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
|
2834
3250
|
"data-conversation-id": p.conversationId,
|
|
2835
3251
|
"data-message-sequence": p.sequence,
|
|
2836
3252
|
"data-system-kind": p.systemKind,
|
|
2837
|
-
"data-streaming": p.id ===
|
|
2838
|
-
class:
|
|
3253
|
+
"data-streaming": p.id === Te.value ? "true" : void 0,
|
|
3254
|
+
class: D(["flex gap-2 items-end", {
|
|
2839
3255
|
"justify-end": p.sender === "user",
|
|
2840
3256
|
"justify-start": p.sender === "agent",
|
|
2841
|
-
"mb-4":
|
|
3257
|
+
"mb-4": A(P.value, L)
|
|
2842
3258
|
}])
|
|
2843
3259
|
}, [
|
|
2844
|
-
p.sender === "agent" ? (
|
|
2845
|
-
|
|
3260
|
+
p.sender === "agent" ? (f(), m("div", lr, [
|
|
3261
|
+
A(P.value, L) ? (f(), m("img", {
|
|
2846
3262
|
key: 0,
|
|
2847
3263
|
src: a.agent.avatarUrl.value,
|
|
2848
3264
|
alt: a.agent.displayName.value,
|
|
2849
|
-
class:
|
|
2850
|
-
}, null, 10,
|
|
2851
|
-
])) :
|
|
2852
|
-
|
|
2853
|
-
class:
|
|
3265
|
+
class: D(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", z.value ? "ring-1 ring-black/5" : ""])
|
|
3266
|
+
}, null, 10, or)) : q("", !0)
|
|
3267
|
+
])) : q("", !0),
|
|
3268
|
+
T("div", {
|
|
3269
|
+
class: D(p.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
|
|
2854
3270
|
}, [
|
|
2855
|
-
p.attachments?.length ? (
|
|
3271
|
+
p.attachments?.length ? (f(), m("div", {
|
|
2856
3272
|
key: 0,
|
|
2857
|
-
class:
|
|
3273
|
+
class: D(["mb-1 space-y-1", p.sender === "user" ? "flex flex-col items-end" : ""])
|
|
2858
3274
|
}, [
|
|
2859
|
-
(
|
|
2860
|
-
|
|
3275
|
+
(f(!0), m(re, null, me(p.attachments, (Q, be) => (f(), m(re, { key: be }, [
|
|
3276
|
+
Q.type === "image" ? (f(), m("img", {
|
|
2861
3277
|
key: 0,
|
|
2862
|
-
src:
|
|
2863
|
-
alt:
|
|
3278
|
+
src: Q.src,
|
|
3279
|
+
alt: Q.filename,
|
|
2864
3280
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
2865
|
-
}, null, 8,
|
|
3281
|
+
}, null, 8, cr)) : Q.type === "audio" ? (f(), m("audio", {
|
|
2866
3282
|
key: 1,
|
|
2867
|
-
src:
|
|
3283
|
+
src: Q.src,
|
|
2868
3284
|
controls: "",
|
|
2869
3285
|
class: "max-w-full"
|
|
2870
|
-
}, null, 8,
|
|
3286
|
+
}, null, 8, ur)) : (f(), m("a", {
|
|
2871
3287
|
key: 2,
|
|
2872
|
-
href:
|
|
3288
|
+
href: Q.src,
|
|
2873
3289
|
target: "_blank",
|
|
2874
3290
|
rel: "noopener",
|
|
2875
|
-
class:
|
|
3291
|
+
class: D(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", z.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
2876
3292
|
}, [
|
|
2877
|
-
g[14] || (g[14] =
|
|
2878
|
-
|
|
2879
|
-
], 10,
|
|
3293
|
+
g[14] || (g[14] = T("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
3294
|
+
Ot(" " + Z(Q.filename), 1)
|
|
3295
|
+
], 10, hr))
|
|
2880
3296
|
], 64))), 128))
|
|
2881
|
-
], 2)) :
|
|
2882
|
-
p.text ? (
|
|
3297
|
+
], 2)) : q("", !0),
|
|
3298
|
+
p.text ? (f(), m("div", {
|
|
2883
3299
|
key: 1,
|
|
2884
|
-
class:
|
|
2885
|
-
p.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" :
|
|
3300
|
+
class: D(["rounded-2xl px-3.5 py-2", [
|
|
3301
|
+
p.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : z.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
|
|
2886
3302
|
]])
|
|
2887
3303
|
}, [
|
|
2888
|
-
|
|
3304
|
+
lt(Pt, {
|
|
2889
3305
|
text: p.text,
|
|
2890
|
-
inverted: p.sender === "user" || !
|
|
2891
|
-
streaming: p.id ===
|
|
2892
|
-
onClick: g[3] || (g[3] =
|
|
3306
|
+
inverted: p.sender === "user" || !z.value,
|
|
3307
|
+
streaming: p.id === Te.value,
|
|
3308
|
+
onClick: g[3] || (g[3] = yt(() => {
|
|
2893
3309
|
}, ["stop"]))
|
|
2894
3310
|
}, null, 8, ["text", "inverted", "streaming"])
|
|
2895
|
-
], 2)) :
|
|
2896
|
-
|
|
3311
|
+
], 2)) : q("", !0),
|
|
3312
|
+
J(p.toolActivities) ? (f(), m("div", {
|
|
2897
3313
|
key: 2,
|
|
2898
3314
|
"data-test": "messaging-message-tool-activity",
|
|
2899
|
-
"data-tool-activity-status":
|
|
2900
|
-
class:
|
|
3315
|
+
"data-tool-activity-status": J(p.toolActivities)?.status,
|
|
3316
|
+
class: D(["mt-1 flex items-center gap-1.5 pl-2 pr-3 text-[12px] leading-none", z.value ? "text-theme-500" : "text-white/45"])
|
|
2901
3317
|
}, [
|
|
2902
|
-
|
|
2903
|
-
class:
|
|
3318
|
+
T("i", {
|
|
3319
|
+
class: D(["size-3.5 shrink-0 opacity-80", J(p.toolActivities)?.icon]),
|
|
2904
3320
|
"aria-hidden": "true"
|
|
2905
3321
|
}, null, 2),
|
|
2906
|
-
|
|
2907
|
-
], 10,
|
|
3322
|
+
T("span", pr, Z(J(p.toolActivities)?.label), 1)
|
|
3323
|
+
], 10, dr)) : q("", !0)
|
|
2908
3324
|
], 2)
|
|
2909
|
-
], 10,
|
|
3325
|
+
], 10, rr))
|
|
2910
3326
|
], 64))), 128)),
|
|
2911
|
-
|
|
3327
|
+
N.value ? (f(), m("div", {
|
|
2912
3328
|
key: 1,
|
|
2913
3329
|
"data-test": "messaging-working-state",
|
|
2914
|
-
"data-working-description":
|
|
2915
|
-
class:
|
|
3330
|
+
"data-working-description": N.value,
|
|
3331
|
+
class: D(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", z.value ? "text-theme-500" : "text-white/45"])
|
|
2916
3332
|
}, [
|
|
2917
|
-
g[15] || (g[15] =
|
|
3333
|
+
g[15] || (g[15] = T("i", {
|
|
2918
3334
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
2919
3335
|
"aria-hidden": "true"
|
|
2920
3336
|
}, null, -1)),
|
|
2921
|
-
|
|
2922
|
-
], 10,
|
|
2923
|
-
|
|
3337
|
+
T("span", gr, Z(N.value), 1)
|
|
3338
|
+
], 10, fr)) : q("", !0),
|
|
3339
|
+
U.value ? (f(), m("div", {
|
|
2924
3340
|
key: 2,
|
|
2925
3341
|
"data-test": "messaging-tool-activity",
|
|
2926
|
-
"data-tool-activity-status":
|
|
2927
|
-
class:
|
|
3342
|
+
"data-tool-activity-status": U.value.status,
|
|
3343
|
+
class: D(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", z.value ? "text-theme-500" : "text-white/45"])
|
|
2928
3344
|
}, [
|
|
2929
|
-
|
|
2930
|
-
class:
|
|
3345
|
+
T("i", {
|
|
3346
|
+
class: D(["size-3.5 shrink-0 opacity-80", U.value.icon]),
|
|
2931
3347
|
"aria-hidden": "true"
|
|
2932
3348
|
}, null, 2),
|
|
2933
|
-
|
|
2934
|
-
], 10,
|
|
2935
|
-
|
|
3349
|
+
T("span", xr, Z(U.value.label), 1)
|
|
3350
|
+
], 10, mr)) : q("", !0),
|
|
3351
|
+
fe.value ? (f(), m("div", {
|
|
2936
3352
|
key: 3,
|
|
2937
3353
|
"data-test": "messaging-transient-issue",
|
|
2938
|
-
"data-issue-code":
|
|
2939
|
-
class:
|
|
3354
|
+
"data-issue-code": fe.value.code,
|
|
3355
|
+
class: D(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", z.value ? "text-theme-600" : "text-white/60"])
|
|
2940
3356
|
}, [
|
|
2941
|
-
g[16] || (g[16] =
|
|
3357
|
+
g[16] || (g[16] = T("i", {
|
|
2942
3358
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
2943
3359
|
"aria-hidden": "true"
|
|
2944
3360
|
}, null, -1)),
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
], 64)) :
|
|
3361
|
+
T("span", null, [
|
|
3362
|
+
Ot(Z(fe.value.message), 1),
|
|
3363
|
+
fe.value.help ? (f(), m(re, { key: 0 }, [
|
|
3364
|
+
Ot(Z(fe.value.help), 1)
|
|
3365
|
+
], 64)) : q("", !0)
|
|
2950
3366
|
]),
|
|
2951
|
-
|
|
3367
|
+
fe.value.actionUrl && fe.value.actionLabel ? (f(), m("a", {
|
|
2952
3368
|
key: 0,
|
|
2953
|
-
href:
|
|
3369
|
+
href: fe.value.actionUrl,
|
|
2954
3370
|
class: "shrink-0 underline underline-offset-2",
|
|
2955
|
-
onClick: g[4] || (g[4] =
|
|
3371
|
+
onClick: g[4] || (g[4] = yt(() => {
|
|
2956
3372
|
}, ["stop"]))
|
|
2957
|
-
},
|
|
2958
|
-
], 10,
|
|
2959
|
-
|
|
2960
|
-
|
|
3373
|
+
}, Z(fe.value.actionLabel), 9, br)) : q("", !0)
|
|
3374
|
+
], 10, kr)) : q("", !0),
|
|
3375
|
+
Ye.value ? (f(), m("div", vr, [
|
|
3376
|
+
T("img", {
|
|
2961
3377
|
src: a.agent.avatarUrl.value,
|
|
2962
3378
|
alt: a.agent.displayName.value,
|
|
2963
|
-
class:
|
|
2964
|
-
}, null, 10,
|
|
2965
|
-
|
|
2966
|
-
class:
|
|
3379
|
+
class: D(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", z.value ? "ring-1 ring-black/5" : ""])
|
|
3380
|
+
}, null, 10, yr),
|
|
3381
|
+
T("div", {
|
|
3382
|
+
class: D(["rounded-2xl px-3.5 py-2.5 flex items-center", z.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
|
|
2967
3383
|
}, [
|
|
2968
|
-
|
|
2969
|
-
class:
|
|
3384
|
+
T("i", {
|
|
3385
|
+
class: D(["i-svg-spinners-3-dots-bounce size-7", z.value ? "text-theme-400" : "text-white/50"])
|
|
2970
3386
|
}, null, 2)
|
|
2971
3387
|
], 2)
|
|
2972
|
-
])) :
|
|
3388
|
+
])) : q("", !0)
|
|
2973
3389
|
], 2)
|
|
2974
3390
|
]),
|
|
2975
3391
|
_: 1
|
|
2976
3392
|
}, 512),
|
|
2977
|
-
|
|
2978
|
-
class:
|
|
3393
|
+
T("div", {
|
|
3394
|
+
class: D(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", z.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
|
|
2979
3395
|
}, [
|
|
2980
|
-
|
|
2981
|
-
(
|
|
2982
|
-
key:
|
|
3396
|
+
u.value.length > 0 ? (f(), m("div", wr, [
|
|
3397
|
+
(f(!0), m(re, null, me(u.value, (p, L) => (f(), m("div", {
|
|
3398
|
+
key: L,
|
|
2983
3399
|
class: "relative shrink-0 group"
|
|
2984
3400
|
}, [
|
|
2985
|
-
p.type === "image" ? (
|
|
3401
|
+
p.type === "image" ? (f(), m("img", {
|
|
2986
3402
|
key: 0,
|
|
2987
3403
|
src: p.src,
|
|
2988
3404
|
alt: p.filename,
|
|
2989
|
-
class:
|
|
2990
|
-
}, null, 10,
|
|
3405
|
+
class: D(["size-14 rounded-xl object-cover border", z.value ? "border-black/10" : "border-white/20"])
|
|
3406
|
+
}, null, 10, Tr)) : (f(), m("div", {
|
|
2991
3407
|
key: 1,
|
|
2992
|
-
class:
|
|
3408
|
+
class: D(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", z.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
2993
3409
|
}, [
|
|
2994
|
-
g[17] || (g[17] =
|
|
2995
|
-
|
|
3410
|
+
g[17] || (g[17] = T("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
3411
|
+
T("span", Sr, Z(p.filename), 1)
|
|
2996
3412
|
], 2)),
|
|
2997
|
-
|
|
3413
|
+
T("button", {
|
|
2998
3414
|
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform cursor-pointer",
|
|
2999
|
-
onClick: /* @__PURE__ */ d((
|
|
3415
|
+
onClick: /* @__PURE__ */ d((Q) => M(L), "onClick")
|
|
3000
3416
|
}, [...g[18] || (g[18] = [
|
|
3001
|
-
|
|
3002
|
-
])], 8,
|
|
3417
|
+
T("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
3418
|
+
])], 8, Ar)
|
|
3003
3419
|
]))), 128)),
|
|
3004
|
-
c.value ? (
|
|
3005
|
-
|
|
3006
|
-
])) :
|
|
3007
|
-
])) :
|
|
3008
|
-
a.uploadFn ? (
|
|
3420
|
+
c.value ? (f(), m("div", _r, [
|
|
3421
|
+
lt(jn, { class: "size-5" })
|
|
3422
|
+
])) : q("", !0)
|
|
3423
|
+
])) : q("", !0),
|
|
3424
|
+
a.uploadFn ? (f(), m("input", {
|
|
3009
3425
|
key: 1,
|
|
3010
3426
|
ref_key: "fileInput",
|
|
3011
3427
|
ref: o,
|
|
3012
3428
|
type: "file",
|
|
3013
3429
|
accept: "image/*,audio/*,video/*",
|
|
3014
3430
|
class: "hidden",
|
|
3015
|
-
onChange:
|
|
3016
|
-
}, null, 544)) :
|
|
3017
|
-
|
|
3018
|
-
class:
|
|
3431
|
+
onChange: b
|
|
3432
|
+
}, null, 544)) : q("", !0),
|
|
3433
|
+
T("div", {
|
|
3434
|
+
class: D(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", z.value ? i.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : i.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
|
|
3019
3435
|
}, [
|
|
3020
|
-
|
|
3021
|
-
class:
|
|
3436
|
+
T("button", {
|
|
3437
|
+
class: D(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
3022
3438
|
a.uploadFn ? "cursor-pointer" : "cursor-default",
|
|
3023
|
-
|
|
3439
|
+
z.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
3024
3440
|
c.value ? "opacity-50 pointer-events-none" : ""
|
|
3025
3441
|
]]),
|
|
3026
|
-
disabled:
|
|
3027
|
-
onClick: g[5] || (g[5] = (p) => a.uploadFn &&
|
|
3442
|
+
disabled: Ue.value || c.value || !a.uploadFn,
|
|
3443
|
+
onClick: g[5] || (g[5] = (p) => a.uploadFn && x())
|
|
3028
3444
|
}, [
|
|
3029
|
-
c.value ? (
|
|
3030
|
-
], 10,
|
|
3031
|
-
|
|
3445
|
+
c.value ? (f(), m("i", Rr)) : (f(), m("i", Cr))
|
|
3446
|
+
], 10, Er),
|
|
3447
|
+
Hs(T("textarea", {
|
|
3032
3448
|
ref_key: "textarea",
|
|
3033
3449
|
ref: l,
|
|
3034
3450
|
"onUpdate:modelValue": g[6] || (g[6] = (p) => n.value = p),
|
|
3035
3451
|
"data-test": "messaging-input",
|
|
3036
3452
|
rows: "1",
|
|
3037
3453
|
enterkeyhint: "send",
|
|
3038
|
-
placeholder:
|
|
3039
|
-
disabled:
|
|
3454
|
+
placeholder: ie.value,
|
|
3455
|
+
disabled: Ue.value,
|
|
3040
3456
|
style: { fontSize: "16px", resize: "none" },
|
|
3041
|
-
class:
|
|
3042
|
-
onKeydown:
|
|
3457
|
+
class: D(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", z.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
3458
|
+
onKeydown: k,
|
|
3043
3459
|
onFocus: g[7] || (g[7] = (p) => i.value = !0),
|
|
3044
3460
|
onBlur: g[8] || (g[8] = (p) => i.value = !1)
|
|
3045
|
-
}, null, 42,
|
|
3046
|
-
[
|
|
3461
|
+
}, null, 42, Ir), [
|
|
3462
|
+
[Gs, n.value]
|
|
3047
3463
|
]),
|
|
3048
|
-
|
|
3464
|
+
T("button", {
|
|
3049
3465
|
"data-test": "messaging-send-btn",
|
|
3050
|
-
"data-composer-action":
|
|
3051
|
-
class:
|
|
3052
|
-
disabled: !
|
|
3053
|
-
"aria-label":
|
|
3054
|
-
onClick: g[9] || (g[9] = (p) =>
|
|
3466
|
+
"data-composer-action": ce.value,
|
|
3467
|
+
class: D(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", He.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : z.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
3468
|
+
disabled: !He.value,
|
|
3469
|
+
"aria-label": ce.value === "stop" ? "Stop reply" : "Send message",
|
|
3470
|
+
onClick: g[9] || (g[9] = (p) => te())
|
|
3055
3471
|
}, [
|
|
3056
|
-
|
|
3057
|
-
], 10,
|
|
3472
|
+
ce.value === "stop" ? (f(), m("i", Mr)) : (f(), m("i", $r))
|
|
3473
|
+
], 10, Dr)
|
|
3058
3474
|
], 2)
|
|
3059
3475
|
], 2)
|
|
3060
3476
|
]));
|
|
3061
3477
|
}
|
|
3062
|
-
}),
|
|
3478
|
+
}), Lr = { class: "agent-wrap" }, Or = {
|
|
3063
3479
|
key: 0,
|
|
3064
3480
|
class: "flex items-center justify-center h-full"
|
|
3065
|
-
},
|
|
3481
|
+
}, qr = /* @__PURE__ */ Ne({
|
|
3066
3482
|
__name: "AgentWrap",
|
|
3067
3483
|
props: {
|
|
3068
3484
|
sdk: {},
|
|
@@ -3076,11 +3492,11 @@ const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
|
3076
3492
|
apiBase: {}
|
|
3077
3493
|
},
|
|
3078
3494
|
setup(a) {
|
|
3079
|
-
const t =
|
|
3495
|
+
const t = qs("AgentWrap"), e = a, n = e.sdk || Vs.getInstance({
|
|
3080
3496
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
3081
3497
|
...e.apiBase && { apiBase: e.apiBase }
|
|
3082
|
-
}), i =
|
|
3083
|
-
return
|
|
3498
|
+
}), i = xe(!e.agent), s = fs(e.agent ? new Bt({ config: e.agent }) : void 0), l = xe();
|
|
3499
|
+
return jt(async () => {
|
|
3084
3500
|
if (e.agent) {
|
|
3085
3501
|
t.debug("Agent provided via props, skipping fetch", {
|
|
3086
3502
|
agentId: e.agent.agentId,
|
|
@@ -3106,7 +3522,7 @@ const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
|
3106
3522
|
try {
|
|
3107
3523
|
i.value = !0, t.debug("Fetching public agent", { handle: e.handle });
|
|
3108
3524
|
const o = await n.user.getPublicAgent({ handle: e.handle });
|
|
3109
|
-
o ? (s.value = new
|
|
3525
|
+
o ? (s.value = new Bt({ config: o }), t.debug("Successfully fetched public agent", {
|
|
3110
3526
|
agentId: o.agentId,
|
|
3111
3527
|
handle: o.handle
|
|
3112
3528
|
}), o.agentId && n.user.track({
|
|
@@ -3156,33 +3572,33 @@ const Aa = ["innerHTML"], Nt = /* @__PURE__ */ Re({
|
|
|
3156
3572
|
}
|
|
3157
3573
|
});
|
|
3158
3574
|
}
|
|
3159
|
-
}), (o,
|
|
3160
|
-
i.value ? (
|
|
3161
|
-
|
|
3162
|
-
])])) : s.value ?
|
|
3575
|
+
}), (o, u) => (f(), m("div", Lr, [
|
|
3576
|
+
i.value ? (f(), m("div", Or, [...u[0] || (u[0] = [
|
|
3577
|
+
T("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
|
|
3578
|
+
])])) : s.value ? fn(o.$slots, "default", {
|
|
3163
3579
|
key: 1,
|
|
3164
|
-
sdk:
|
|
3580
|
+
sdk: cn(n),
|
|
3165
3581
|
agent: s.value,
|
|
3166
3582
|
context: a.context,
|
|
3167
3583
|
firstMessage: a.firstMessage,
|
|
3168
3584
|
buttonText: a.buttonText,
|
|
3169
3585
|
buttonIcon: a.buttonIcon,
|
|
3170
3586
|
loading: i.value
|
|
3171
|
-
}) :
|
|
3587
|
+
}) : q("", !0)
|
|
3172
3588
|
]));
|
|
3173
3589
|
}
|
|
3174
3590
|
});
|
|
3175
3591
|
export {
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3592
|
+
Wn as A,
|
|
3593
|
+
qr as _,
|
|
3594
|
+
Wr as a,
|
|
3595
|
+
Gr as b,
|
|
3596
|
+
Hr as c,
|
|
3597
|
+
jr as d,
|
|
3598
|
+
jn as e,
|
|
3599
|
+
oi as f,
|
|
3600
|
+
Br as g,
|
|
3601
|
+
Vn as h,
|
|
3602
|
+
Ur as p
|
|
3187
3603
|
};
|
|
3188
3604
|
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map
|