@pagelines/sdk 1.0.661 → 1.0.662
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +877 -882
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +4 -6
- package/dist/demo/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/dist/sdkClient.d.ts +6 -9
- package/dist/sdkClient.js +232 -223
- package/dist/sdkClient.js.map +1 -1
- package/dist/widget/composables/useWidgetState.d.ts +6 -9
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var d = (a, t) =>
|
|
4
|
-
var P = (a, t, e) =>
|
|
5
|
-
import { defineComponent as Re, openBlock as h, createElementBlock as f, createElementVNode as w, normalizeClass as C, ref as ge, computed as S, shallowRef as ht, watch as Qt, createCommentVNode as
|
|
6
|
-
import { SettingsObject as
|
|
7
|
-
import { P as
|
|
8
|
-
const
|
|
1
|
+
var hs = Object.defineProperty;
|
|
2
|
+
var ga = (a, t, e) => t in a ? hs(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var d = (a, t) => hs(a, "name", { value: t, configurable: !0 });
|
|
4
|
+
var P = (a, t, e) => ga(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { defineComponent as Re, openBlock as h, createElementBlock as f, createElementVNode as w, normalizeClass as C, ref as ge, computed as S, shallowRef as ht, watch as Qt, createCommentVNode as H, renderSlot as vn, onMounted as tn, unref as en, Fragment as ee, toDisplayString as j, reactive as va, onUnmounted as Ps, createBlock as kt, Teleport as xa, createVNode as Ne, Transition as ya, withCtx as Bs, withDirectives as Fs, normalizeStyle as q, createTextVNode as ot, vShow as ba, nextTick as Us, renderList as me, onBeforeUnmount as Hs, withModifiers as Le, vModelText as ka, withKeys as jt } from "vue";
|
|
6
|
+
import { SettingsObject as js, Agent as hn, isAssistantSilenceControl as _n, CHAT_ISSUE_COPY as wa, getDefaultAvatarUrl as Hn, parseChatVisualFencePayload as Ta, createLogger as Sa } from "@pagelines/core";
|
|
7
|
+
import { P as Aa } from "./sdkClient.js";
|
|
8
|
+
const _a = { class: "spinner max-w-sm" }, Ea = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
11
|
}, En = /* @__PURE__ */ Re({
|
|
@@ -15,7 +15,7 @@ const Aa = { class: "spinner max-w-sm" }, Ea = {
|
|
|
15
15
|
colorMode: { type: String, default: "primary" }
|
|
16
16
|
},
|
|
17
17
|
setup(a) {
|
|
18
|
-
return (t, e) => (h(), f("div",
|
|
18
|
+
return (t, e) => (h(), f("div", _a, [
|
|
19
19
|
(h(), f("svg", Ea, [
|
|
20
20
|
w("circle", {
|
|
21
21
|
class: C([a.colorMode, "ring-path"]),
|
|
@@ -31,26 +31,26 @@ const Aa = { class: "spinner max-w-sm" }, Ea = {
|
|
|
31
31
|
]));
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
function
|
|
34
|
+
function Ra(a) {
|
|
35
35
|
const t = Math.max(0, Math.floor(a.ms / 1e3)), e = Math.floor(t / 60), n = t % 60;
|
|
36
36
|
return `${e}:${n.toString().padStart(2, "0")}`;
|
|
37
37
|
}
|
|
38
|
-
d(
|
|
39
|
-
function
|
|
38
|
+
d(Ra, "formatVoiceRecordingDuration");
|
|
39
|
+
function Ma(a) {
|
|
40
40
|
return a.mimeType.includes("mp4") || a.mimeType.includes("m4a") ? "m4a" : a.mimeType.includes("ogg") ? "ogg" : a.mimeType.includes("wav") ? "wav" : "webm";
|
|
41
41
|
}
|
|
42
|
-
d(
|
|
43
|
-
function
|
|
42
|
+
d(Ma, "audioExtension");
|
|
43
|
+
function Ca() {
|
|
44
44
|
return typeof MediaRecorder > "u" ? "" : ["audio/webm;codecs=opus", "audio/mp4", "audio/webm"].find((t) => MediaRecorder.isTypeSupported?.(t)) || "";
|
|
45
45
|
}
|
|
46
|
-
d(
|
|
47
|
-
const
|
|
46
|
+
d(Ca, "recorderMimeType");
|
|
47
|
+
const Jn = class Jn extends js {
|
|
48
48
|
constructor(e) {
|
|
49
49
|
super("VoiceRecorderController", e);
|
|
50
50
|
P(this, "state", ge({ phase: "idle", elapsedMs: 0 }));
|
|
51
51
|
P(this, "isActive", S(() => this.state.value.phase !== "idle"));
|
|
52
52
|
P(this, "isBusy", S(() => this.state.value.phase !== "idle"));
|
|
53
|
-
P(this, "elapsedLabel", S(() =>
|
|
53
|
+
P(this, "elapsedLabel", S(() => Ra({ ms: this.state.value.elapsedMs })));
|
|
54
54
|
P(this, "statusText", S(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send"));
|
|
55
55
|
P(this, "recorder");
|
|
56
56
|
P(this, "stream");
|
|
@@ -79,7 +79,7 @@ const Zn = class Zn extends Hs {
|
|
|
79
79
|
n.getTracks().forEach((l) => l.stop());
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
const i =
|
|
82
|
+
const i = Ca(), s = this.createRecorder({ stream: n, mimeType: i });
|
|
83
83
|
this.stream = n, this.recorder = s, this.chunks = [], s.addEventListener("dataavailable", (l) => {
|
|
84
84
|
l.data.size > 0 && this.chunks.push(l.data);
|
|
85
85
|
}), s.addEventListener("stop", async () => {
|
|
@@ -128,7 +128,7 @@ const Zn = class Zn extends Hs {
|
|
|
128
128
|
return;
|
|
129
129
|
const s = e.blob.type || "audio/webm", l = new File(
|
|
130
130
|
[e.blob],
|
|
131
|
-
`voice-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.${
|
|
131
|
+
`voice-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.${Ma({ mimeType: s })}`,
|
|
132
132
|
{ type: s }
|
|
133
133
|
);
|
|
134
134
|
try {
|
|
@@ -155,13 +155,13 @@ const Zn = class Zn extends Hs {
|
|
|
155
155
|
(this.settings.clearInterval ?? clearInterval)(e);
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
-
d(
|
|
159
|
-
let
|
|
160
|
-
function
|
|
158
|
+
d(Jn, "VoiceRecorderController");
|
|
159
|
+
let zn = Jn;
|
|
160
|
+
function Ia(a) {
|
|
161
161
|
return a.turnOutcome === "failed" ? "failed" : a.turnOutcome === "stopped" ? "stopped" : a.sender === "system" ? "failed" : "completed";
|
|
162
162
|
}
|
|
163
|
-
d(
|
|
164
|
-
const
|
|
163
|
+
d(Ia, "durableJournalOutcome");
|
|
164
|
+
const yt = {
|
|
165
165
|
waiting: "Waiting for results",
|
|
166
166
|
finishing: "Finishing up",
|
|
167
167
|
completed: "Work complete",
|
|
@@ -169,7 +169,7 @@ const bt = {
|
|
|
169
169
|
stopped: "Stopped",
|
|
170
170
|
notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
|
|
171
171
|
leaveHint: "Taking longer than usual. You can leave this chat while I work."
|
|
172
|
-
},
|
|
172
|
+
}, Ws = 15e3, $a = 6e4, Rn = 3;
|
|
173
173
|
function pn(a) {
|
|
174
174
|
if (!a)
|
|
175
175
|
return;
|
|
@@ -181,15 +181,15 @@ function Ot(a) {
|
|
|
181
181
|
return pn(a.endedAt) ?? pn(a.startedAt) ?? 0;
|
|
182
182
|
}
|
|
183
183
|
d(Ot, "eventMs");
|
|
184
|
-
function
|
|
184
|
+
function Nn(a, t) {
|
|
185
185
|
return Ot(a) - Ot(t);
|
|
186
186
|
}
|
|
187
|
-
d(
|
|
187
|
+
d(Nn, "byEvent");
|
|
188
188
|
function Xt(a, t) {
|
|
189
|
-
const e = a.filter((i) => i.status === "completed" || i.status === "failed" && !!i.note).filter((i) => !t.has(i.activityId)).slice().sort(
|
|
189
|
+
const e = a.filter((i) => i.status === "completed" || i.status === "failed" && !!i.note).filter((i) => !t.has(i.activityId)).slice().sort(Nn), n = [];
|
|
190
190
|
for (const i of e) {
|
|
191
191
|
const s = i.status === "completed" ? "done" : "failed", l = n[n.length - 1];
|
|
192
|
-
if (s === "done" && l?.tone === "done" && l.label === i.label && Ot(i) - l.lastMs <=
|
|
192
|
+
if (s === "done" && l?.tone === "done" && l.label === i.label && Ot(i) - l.lastMs <= Ws) {
|
|
193
193
|
l.count += 1, l.lastMs = Ot(i);
|
|
194
194
|
continue;
|
|
195
195
|
}
|
|
@@ -204,91 +204,91 @@ function Xt(a, t) {
|
|
|
204
204
|
}
|
|
205
205
|
d(Xt, "milestoneRows");
|
|
206
206
|
function dn(a) {
|
|
207
|
-
return a.length <=
|
|
208
|
-
visibleRows: a.slice(a.length -
|
|
209
|
-
hiddenRows: a.slice(0, a.length -
|
|
207
|
+
return a.length <= Rn ? { visibleRows: a, hiddenRows: [] } : {
|
|
208
|
+
visibleRows: a.slice(a.length - Rn),
|
|
209
|
+
hiddenRows: a.slice(0, a.length - Rn)
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
d(dn, "splitRows");
|
|
213
|
-
function
|
|
213
|
+
function Pn(a) {
|
|
214
214
|
const { activities: t, outcome: e, nowMs: n, canNotifyOnCompletion: i, lastVisibleProgressAtMs: s, includeFailureNote: l = !0 } = a;
|
|
215
215
|
if (e === "completed")
|
|
216
216
|
return {
|
|
217
217
|
outcome: e,
|
|
218
218
|
visibleRows: [],
|
|
219
219
|
hiddenRows: Xt(t, /* @__PURE__ */ new Set()),
|
|
220
|
-
terminal: { id: "work-complete", tone: "completed", label:
|
|
220
|
+
terminal: { id: "work-complete", tone: "completed", label: yt.completed }
|
|
221
221
|
};
|
|
222
222
|
if (e === "failed") {
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
const { visibleRows:
|
|
223
|
+
const $ = t.filter((V) => V.status === "failed").sort(Nn).pop(), N = /* @__PURE__ */ new Set();
|
|
224
|
+
$ && N.add($.activityId);
|
|
225
|
+
const { visibleRows: W, hiddenRows: B } = dn(Xt(t, N));
|
|
226
226
|
return {
|
|
227
227
|
outcome: e,
|
|
228
|
-
visibleRows:
|
|
228
|
+
visibleRows: W,
|
|
229
229
|
hiddenRows: B,
|
|
230
230
|
terminal: {
|
|
231
231
|
id: "work-failed",
|
|
232
232
|
tone: "failed",
|
|
233
|
-
label:
|
|
234
|
-
...l &&
|
|
233
|
+
label: yt.failed,
|
|
234
|
+
...l && $?.note ? { note: $.note } : {}
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
if (e === "stopped") {
|
|
239
|
-
const { visibleRows:
|
|
239
|
+
const { visibleRows: $, hiddenRows: N } = dn(Xt(t, /* @__PURE__ */ new Set()));
|
|
240
240
|
return {
|
|
241
241
|
outcome: e,
|
|
242
|
-
visibleRows:
|
|
243
|
-
hiddenRows:
|
|
244
|
-
terminal: { id: "work-stopped", tone: "stopped", label:
|
|
242
|
+
visibleRows: $,
|
|
243
|
+
hiddenRows: N,
|
|
244
|
+
terminal: { id: "work-stopped", tone: "stopped", label: yt.stopped }
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
const { visibleRows: o, hiddenRows: p } = dn(Xt(t, /* @__PURE__ */ new Set())), c = t.filter((
|
|
248
|
-
(
|
|
247
|
+
const { visibleRows: o, hiddenRows: p } = dn(Xt(t, /* @__PURE__ */ new Set())), c = t.filter(($) => $.status === "started").sort(Nn).pop(), b = t.reduce(
|
|
248
|
+
($, N) => Math.max($, Ot(N)),
|
|
249
249
|
s ?? Number.NEGATIVE_INFINITY
|
|
250
|
-
), R = Number.isFinite(
|
|
251
|
-
const
|
|
252
|
-
return
|
|
253
|
-
}, Number.POSITIVE_INFINITY), k = R +
|
|
250
|
+
), R = Number.isFinite(b) ? b : n, y = t.reduce(($, N) => {
|
|
251
|
+
const W = pn(N.startedAt) ?? pn(N.endedAt);
|
|
252
|
+
return W === void 0 ? $ : Math.min($, W);
|
|
253
|
+
}, Number.POSITIVE_INFINITY), k = R + Ws, A = (Number.isFinite(y) ? y : R) + $a, E = n >= k, O = c || E ? {
|
|
254
254
|
id: c?.activityId ?? "work-active",
|
|
255
255
|
tone: "active",
|
|
256
|
-
label:
|
|
257
|
-
} : void 0, Z =
|
|
256
|
+
label: E ? c ? yt.waiting : yt.finishing : c.label
|
|
257
|
+
} : void 0, Z = E && n >= A ? i ? yt.notifyHint : yt.leaveHint : void 0, I = [k, A].filter(($) => $ > n).sort(($, N) => $ - N)[0];
|
|
258
258
|
return {
|
|
259
259
|
outcome: e,
|
|
260
260
|
visibleRows: o,
|
|
261
261
|
hiddenRows: p,
|
|
262
|
-
...
|
|
262
|
+
...O ? { terminal: O } : {},
|
|
263
263
|
...Z ? { hint: Z } : {},
|
|
264
|
-
...
|
|
264
|
+
...I !== void 0 ? { nextBoundaryAtMs: I } : {}
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
|
-
d(
|
|
268
|
-
function
|
|
269
|
-
const { segments: t, activities: e, nowMs: n, canNotifyOnCompletion: i, lastVisibleProgressAtMs: s } = a, l = new Map(e.map((A) => [A.activityId, A])), o = /* @__PURE__ */ d((A) =>
|
|
267
|
+
d(Pn, "buildWorkJournalModel");
|
|
268
|
+
function La(a) {
|
|
269
|
+
const { segments: t, activities: e, nowMs: n, canNotifyOnCompletion: i, lastVisibleProgressAtMs: s } = a, l = new Map(e.map((A) => [A.activityId, A])), o = /* @__PURE__ */ d((A) => Pn({
|
|
270
270
|
activities: A,
|
|
271
271
|
outcome: "running",
|
|
272
272
|
nowMs: n,
|
|
273
273
|
canNotifyOnCompletion: i,
|
|
274
274
|
...s !== void 0 ? { lastVisibleProgressAtMs: s } : {}
|
|
275
275
|
}), "liveModel"), p = /* @__PURE__ */ d((A) => {
|
|
276
|
-
const { visibleRows:
|
|
277
|
-
if (!(
|
|
278
|
-
return { outcome: "running", visibleRows:
|
|
279
|
-
}, "staticJournal"), c = [],
|
|
276
|
+
const { visibleRows: E, hiddenRows: O } = dn(Xt(A, /* @__PURE__ */ new Set()));
|
|
277
|
+
if (!(E.length === 0 && O.length === 0))
|
|
278
|
+
return { outcome: "running", visibleRows: E, hiddenRows: O };
|
|
279
|
+
}, "staticJournal"), c = [], b = new Set(
|
|
280
280
|
t.flatMap((A) => A.kind === "work" ? A.activityIds : [])
|
|
281
|
-
), R = e.filter((A) => !
|
|
282
|
-
|
|
281
|
+
), R = e.filter((A) => !b.has(A.activityId)), y = p(R);
|
|
282
|
+
y && c.push({ kind: "work", id: "work-unsegmented", journal: y }), t.forEach((A, E) => {
|
|
283
283
|
if (A.kind === "text") {
|
|
284
|
-
A.content && c.push({ kind: "text", id: `text-${
|
|
284
|
+
A.content && c.push({ kind: "text", id: `text-${E}`, content: A.content });
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
287
|
+
const O = A.activityIds.map((I) => l.get(I)).filter((I) => I !== void 0);
|
|
288
|
+
if (O.length === 0)
|
|
289
289
|
return;
|
|
290
|
-
const Z = p(
|
|
291
|
-
Z && c.push({ kind: "work", id: `work-${A.activityIds[0] ??
|
|
290
|
+
const Z = p(O);
|
|
291
|
+
Z && c.push({ kind: "work", id: `work-${A.activityIds[0] ?? E}`, journal: Z });
|
|
292
292
|
});
|
|
293
293
|
const k = o(e);
|
|
294
294
|
return k.terminal || k.hint ? c.push({
|
|
@@ -304,31 +304,28 @@ function $a(a) {
|
|
|
304
304
|
}
|
|
305
305
|
}) : c.push({ kind: "loading", id: "work-tail" }), c;
|
|
306
306
|
}
|
|
307
|
-
d(
|
|
308
|
-
const
|
|
309
|
-
{ pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
|
|
310
|
-
{ pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
|
|
311
|
-
], Ws = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Da = /* @__PURE__ */ new Set([...Ws, "EMPTY_STREAM", "RATE_LIMIT"]), Gs = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), Oa = {
|
|
307
|
+
d(La, "buildLiveTurnBlocks");
|
|
308
|
+
const Gs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Da = /* @__PURE__ */ new Set([...Gs, "EMPTY_STREAM", "RATE_LIMIT"]), Vs = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), Oa = {
|
|
312
309
|
CREDIT_LIMIT: "billing_budget_reached",
|
|
313
310
|
OVERAGE_CAP: "billing_runaway_cap"
|
|
314
311
|
};
|
|
315
312
|
function za(a) {
|
|
316
313
|
if (!(a.bucket !== void 0 || Da.has(a.code)))
|
|
317
314
|
return { surface: "hard" };
|
|
318
|
-
const e = a.bucket ?? (
|
|
315
|
+
const e = a.bucket ?? (Gs.has(a.code) ? "account" : "error"), n = {
|
|
319
316
|
...a.actionLabel ? { actionLabel: a.actionLabel } : {},
|
|
320
317
|
...a.actionUrl ? { actionUrl: a.actionUrl } : {},
|
|
321
318
|
...a.help ? { help: a.help } : {}
|
|
322
319
|
};
|
|
323
|
-
return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } :
|
|
320
|
+
return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } : Vs.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 } };
|
|
324
321
|
}
|
|
325
322
|
d(za, "presentChatStreamError");
|
|
326
323
|
function Na(a) {
|
|
327
324
|
const t = Oa[a.code];
|
|
328
|
-
return t ?
|
|
325
|
+
return t ? wa[t].oneLine : a.error;
|
|
329
326
|
}
|
|
330
327
|
d(Na, "transcriptMessageForChatStreamError");
|
|
331
|
-
const
|
|
328
|
+
const Qn = class Qn extends js {
|
|
332
329
|
constructor(e) {
|
|
333
330
|
super("AgentChatController", e);
|
|
334
331
|
P(this, "isTextMode", !1);
|
|
@@ -374,7 +371,7 @@ const Jn = class Jn extends Hs {
|
|
|
374
371
|
return;
|
|
375
372
|
const n = this.textState.value.toolActivities;
|
|
376
373
|
if (n?.length)
|
|
377
|
-
return
|
|
374
|
+
return Pn({
|
|
378
375
|
activities: n,
|
|
379
376
|
outcome: e,
|
|
380
377
|
nowMs: this.nowMs.value,
|
|
@@ -391,7 +388,7 @@ const Jn = class Jn extends Hs {
|
|
|
391
388
|
if (!this.textState.value.isThinking)
|
|
392
389
|
return [];
|
|
393
390
|
const e = this.textState.value.toolActivities ?? [], n = this.liveSegments.value;
|
|
394
|
-
return !n.length && !e.length ? [] :
|
|
391
|
+
return !n.length && !e.length ? [] : La({
|
|
395
392
|
segments: n,
|
|
396
393
|
activities: e,
|
|
397
394
|
nowMs: this.nowMs.value,
|
|
@@ -402,7 +399,7 @@ const Jn = class Jn extends Hs {
|
|
|
402
399
|
P(this, "canUseComposer", S(() => this.textState.value.isConnected && !this.textState.value.sendBlockedReason && !this.composerState.value.isUploading && !this.textState.value.isThinking));
|
|
403
400
|
P(this, "canAttachFile", S(() => !!this.settings.uploadFileFn));
|
|
404
401
|
P(this, "canRecordAudio", S(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0));
|
|
405
|
-
P(this, "voiceRecorder", new
|
|
402
|
+
P(this, "voiceRecorder", new zn({
|
|
406
403
|
getCanRecord: /* @__PURE__ */ d(() => this.canRecordAudio.value, "getCanRecord"),
|
|
407
404
|
getUploadFn: /* @__PURE__ */ d(() => {
|
|
408
405
|
const e = this.settings.uploadFileFn;
|
|
@@ -603,7 +600,7 @@ Current User:
|
|
|
603
600
|
*/
|
|
604
601
|
workJournalFor(e) {
|
|
605
602
|
if (e.activities?.length)
|
|
606
|
-
return
|
|
603
|
+
return Pn({
|
|
607
604
|
activities: e.activities,
|
|
608
605
|
outcome: e.outcome,
|
|
609
606
|
nowMs: this.nowMs.value,
|
|
@@ -703,65 +700,63 @@ Current User:
|
|
|
703
700
|
this.addMessage(e, "user", n), this.resetWorkJournalTiming(), this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, toolActivities: [], transientIssue: void 0, turnOutcome: void 0 });
|
|
704
701
|
const l = ++this.activeTurnGeneration, o = `stream-${Date.now()}`;
|
|
705
702
|
let p = !1, c = !1;
|
|
706
|
-
const
|
|
707
|
-
if (!
|
|
703
|
+
const b = /* @__PURE__ */ d(() => l === this.activeTurnGeneration, "isCurrentTurn"), R = /* @__PURE__ */ d((I, $ = "assistant") => {
|
|
704
|
+
if (!b())
|
|
708
705
|
return;
|
|
709
|
-
this.updateState(this.textState, { workingDescription: void 0 }),
|
|
706
|
+
this.updateState(this.textState, { workingDescription: void 0 }), $ === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), p || (p = !0, this.liveStreamMessageId.value = o, this.sharedMessages.value = [
|
|
710
707
|
...this.sharedMessages.value,
|
|
711
|
-
{ id: o, text: "", sender:
|
|
708
|
+
{ id: o, text: "", sender: $ === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
712
709
|
]);
|
|
713
|
-
const
|
|
714
|
-
this.liveSegments.value =
|
|
710
|
+
const N = this.liveSegments.value, W = N[N.length - 1];
|
|
711
|
+
this.liveSegments.value = W?.kind === "text" ? [...N.slice(0, -1), { kind: "text", content: W.content + I }] : [...N, { kind: "text", content: I }];
|
|
715
712
|
const B = this.sharedMessages.value, V = B[B.length - 1];
|
|
716
|
-
V?.id === o && (V.text +=
|
|
717
|
-
}, "onDelta"),
|
|
718
|
-
if (!
|
|
713
|
+
V?.id === o && (V.text += I, this.sharedMessages.value = [...B]);
|
|
714
|
+
}, "onDelta"), y = /* @__PURE__ */ d((I) => {
|
|
715
|
+
if (!b())
|
|
716
|
+
return;
|
|
717
|
+
if (c = !0, I.sender === "agent" && _n(I.text)) {
|
|
718
|
+
this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.sharedMessages.value = this.sharedMessages.value.filter((J) => J.id !== o);
|
|
719
719
|
return;
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
720
|
+
}
|
|
721
|
+
p = !0;
|
|
722
|
+
const $ = I.sender === "system" || I.turnOutcome === "failed" ? "failed" : "completed";
|
|
723
|
+
this.finishToolActivities($);
|
|
724
|
+
const N = this.textState.value.toolActivities, W = I.toolActivities?.length || !N?.length ? I : { ...I, toolActivities: N };
|
|
724
725
|
this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.updateState(this.textState, {
|
|
725
726
|
workingDescription: void 0,
|
|
726
727
|
toolActivities: [],
|
|
727
728
|
turnOutcome: void 0
|
|
728
729
|
});
|
|
729
|
-
const B = this.sharedMessages.value, V = B.findIndex((
|
|
730
|
+
const B = this.sharedMessages.value, V = B.findIndex((J) => J.id === W.id);
|
|
730
731
|
if (V >= 0)
|
|
731
732
|
this.sharedMessages.value = [
|
|
732
733
|
...B.slice(0, V),
|
|
733
|
-
|
|
734
|
+
W,
|
|
734
735
|
...B.slice(V + 1)
|
|
735
736
|
];
|
|
736
737
|
else {
|
|
737
|
-
const
|
|
738
|
-
this.sharedMessages.value =
|
|
738
|
+
const J = B[B.length - 1];
|
|
739
|
+
this.sharedMessages.value = J?.id === o ? [...B.slice(0, -1), W] : [...B, W];
|
|
739
740
|
}
|
|
740
|
-
|
|
741
|
-
}, "onMessage"), k = /* @__PURE__ */ d((
|
|
742
|
-
if (!
|
|
741
|
+
W.sender === "system" && W.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : W.sender === "system" && W.issue?.code && Vs.has(W.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
742
|
+
}, "onMessage"), k = /* @__PURE__ */ d((I) => {
|
|
743
|
+
if (!b())
|
|
743
744
|
return;
|
|
744
745
|
if (!p && !c) {
|
|
745
746
|
A("empty_stream — assistant returned no content");
|
|
746
747
|
return;
|
|
747
748
|
}
|
|
748
749
|
this.finishToolActivities("completed");
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
B.pattern.test(H) && (console.debug(`[chat] filtered directive: ${B.label}`), H = H.replace(B.pattern, "").trim(), B.pattern.lastIndex = 0);
|
|
754
|
-
H ? H !== O.text && (O.text = H, this.sharedMessages.value = [...I]) : this.sharedMessages.value = I.slice(0, -1);
|
|
755
|
-
}
|
|
756
|
-
L && (this.conversationId = L), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
|
|
757
|
-
}, "onDone"), A = /* @__PURE__ */ d((L) => {
|
|
758
|
-
if (!y())
|
|
750
|
+
const $ = this.sharedMessages.value, N = $[$.length - 1];
|
|
751
|
+
N?.id === o && N.sender === "agent" && _n(N.text) && (this.sharedMessages.value = $.slice(0, -1)), I && (this.conversationId = I), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
|
|
752
|
+
}, "onDone"), A = /* @__PURE__ */ d((I) => {
|
|
753
|
+
if (!b())
|
|
759
754
|
return;
|
|
760
|
-
if (typeof
|
|
755
|
+
if (typeof I == "object" && I.code === "TURN_ACTIVE") {
|
|
761
756
|
const V = this.sharedMessages.value;
|
|
762
|
-
for (let
|
|
763
|
-
if (V[
|
|
764
|
-
this.sharedMessages.value = [...V.slice(0,
|
|
757
|
+
for (let J = V.length - 1; J >= 0; J--)
|
|
758
|
+
if (V[J].sender === "user" && V[J].text === e) {
|
|
759
|
+
this.sharedMessages.value = [...V.slice(0, J), ...V.slice(J + 1)];
|
|
765
760
|
break;
|
|
766
761
|
}
|
|
767
762
|
this.composerState.value.text || (this.composerState.value = {
|
|
@@ -770,37 +765,37 @@ Current User:
|
|
|
770
765
|
pendingAttachments: n ?? []
|
|
771
766
|
}), this.updateState(this.textState, {
|
|
772
767
|
isThinking: !1,
|
|
773
|
-
transientIssue: { code:
|
|
768
|
+
transientIssue: { code: I.code, message: I.error }
|
|
774
769
|
});
|
|
775
770
|
return;
|
|
776
771
|
}
|
|
777
772
|
this.updateState(this.textState, { workingDescription: void 0, turnOutcome: "failed" }), this.finishToolActivities("failed");
|
|
778
|
-
const
|
|
779
|
-
if (
|
|
780
|
-
const V = za(
|
|
781
|
-
V.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: V.issue }) : V.surface === "transcript" ? (this.addMessage(Na(
|
|
773
|
+
const $ = this.sharedMessages.value, N = $[$.length - 1];
|
|
774
|
+
if (N?.id === o && !N.text && (this.sharedMessages.value = $.slice(0, -1)), typeof I == "object" && I.code && I.error) {
|
|
775
|
+
const V = za(I);
|
|
776
|
+
V.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: V.issue }) : V.surface === "transcript" ? (this.addMessage(Na(I), "system", void 0, V.issue), this.updateState(this.textState, {
|
|
782
777
|
isThinking: !1,
|
|
783
778
|
...V.sendBlockedReason ? { sendBlockedReason: V.sendBlockedReason } : {}
|
|
784
|
-
})) : this.handleError(new Error(
|
|
779
|
+
})) : this.handleError(new Error(I.error));
|
|
785
780
|
return;
|
|
786
781
|
}
|
|
787
|
-
const
|
|
788
|
-
this.isTransientError(
|
|
789
|
-
}, "onError"),
|
|
790
|
-
if (!
|
|
782
|
+
const W = typeof I == "string" ? I : I.error, B = this.mapChatError(W);
|
|
783
|
+
this.isTransientError(W) ? (this.logger.warn("Chat turn failed (transient):", { raw: W, friendly: B }), this.addMessage(B, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(B), W);
|
|
784
|
+
}, "onError"), E = /* @__PURE__ */ d((I) => {
|
|
785
|
+
if (!b())
|
|
791
786
|
return;
|
|
792
|
-
const
|
|
793
|
-
this.updateState(this.textState, { workingDescription:
|
|
794
|
-
}, "onStatus"),
|
|
795
|
-
if (
|
|
796
|
-
if (this.lastVisibleProgressAtMs.value = Date.now(),
|
|
797
|
-
const
|
|
798
|
-
|
|
787
|
+
const $ = I.trim();
|
|
788
|
+
this.updateState(this.textState, { workingDescription: $ || void 0 });
|
|
789
|
+
}, "onStatus"), O = /* @__PURE__ */ d((I) => {
|
|
790
|
+
if (b()) {
|
|
791
|
+
if (this.lastVisibleProgressAtMs.value = Date.now(), I.status === "started") {
|
|
792
|
+
const $ = this.liveSegments.value, N = $[$.length - 1];
|
|
793
|
+
N?.kind !== "work" ? this.liveSegments.value = [...$, { kind: "work", activityIds: [I.activityId] }] : N.activityIds.includes(I.activityId) || (this.liveSegments.value = [...$.slice(0, -1), { kind: "work", activityIds: [...N.activityIds, I.activityId] }]);
|
|
799
794
|
}
|
|
800
|
-
this.updateToolActivity(
|
|
795
|
+
this.updateToolActivity(I);
|
|
801
796
|
}
|
|
802
797
|
}, "onToolActivity"), Z = /* @__PURE__ */ d(() => {
|
|
803
|
-
|
|
798
|
+
b() && this.updateState(this.textState, { workingDescription: void 0 });
|
|
804
799
|
}, "onWorkingEnd");
|
|
805
800
|
try {
|
|
806
801
|
await (i ? i({
|
|
@@ -809,11 +804,11 @@ Current User:
|
|
|
809
804
|
conversationId: this.conversationId,
|
|
810
805
|
history: this.buildHistory(),
|
|
811
806
|
onDelta: R,
|
|
812
|
-
onMessage:
|
|
807
|
+
onMessage: y,
|
|
813
808
|
onDone: k,
|
|
814
809
|
onError: A,
|
|
815
|
-
onStatus:
|
|
816
|
-
onToolActivity:
|
|
810
|
+
onStatus: E,
|
|
811
|
+
onToolActivity: O,
|
|
817
812
|
onWorkingEnd: Z
|
|
818
813
|
}) : s.chat.chatStreamPublic({
|
|
819
814
|
handle: this._agent.handle.value,
|
|
@@ -822,15 +817,15 @@ Current User:
|
|
|
822
817
|
anonymousId: s.user.generateAnonId(),
|
|
823
818
|
context: this.getDynamicSettings().context || void 0,
|
|
824
819
|
onDelta: R,
|
|
825
|
-
onMessage:
|
|
820
|
+
onMessage: y,
|
|
826
821
|
onDone: k,
|
|
827
822
|
onError: A,
|
|
828
|
-
onStatus:
|
|
829
|
-
onToolActivity:
|
|
823
|
+
onStatus: E,
|
|
824
|
+
onToolActivity: O,
|
|
830
825
|
onWorkingEnd: Z
|
|
831
826
|
}));
|
|
832
|
-
} catch (
|
|
833
|
-
A(
|
|
827
|
+
} catch (I) {
|
|
828
|
+
A(I.message || "Something went wrong");
|
|
834
829
|
}
|
|
835
830
|
}
|
|
836
831
|
async stopChatTurn() {
|
|
@@ -861,8 +856,8 @@ Current User:
|
|
|
861
856
|
/** Seed the controller with previously-loaded messages (e.g. from a server thread). */
|
|
862
857
|
loadMessages(e) {
|
|
863
858
|
this.conversationId = e.conversationId;
|
|
864
|
-
const n = this.sharedMessages.value;
|
|
865
|
-
this.sharedMessages.value = [...
|
|
859
|
+
const n = this.sharedMessages.value, i = e.messages.filter((s) => s.sender !== "agent" || !_n(s.text));
|
|
860
|
+
this.sharedMessages.value = [...i, ...n], e.activeToolActivities?.length && (e.activeToolActivities.forEach((s) => this.rememberToolActivity(s)), this.updateState(this.textState, {
|
|
866
861
|
isThinking: !0,
|
|
867
862
|
workingDescription: void 0,
|
|
868
863
|
toolActivities: e.activeToolActivities,
|
|
@@ -873,8 +868,8 @@ Current User:
|
|
|
873
868
|
this.clearBoundaryTimer(), this.voiceRecorder.teardown(), await this.endConversation();
|
|
874
869
|
}
|
|
875
870
|
};
|
|
876
|
-
d(
|
|
877
|
-
let
|
|
871
|
+
d(Qn, "AgentChatController");
|
|
872
|
+
let ps = Qn;
|
|
878
873
|
function on(a) {
|
|
879
874
|
if (!a)
|
|
880
875
|
return;
|
|
@@ -882,19 +877,19 @@ function on(a) {
|
|
|
882
877
|
return Number.isFinite(t) ? t : void 0;
|
|
883
878
|
}
|
|
884
879
|
d(on, "parseToolActivityMs");
|
|
885
|
-
function
|
|
880
|
+
function fs(a) {
|
|
886
881
|
return a ? typeof a == "string" ? a : a.src || "" : "";
|
|
887
882
|
}
|
|
888
|
-
d(
|
|
883
|
+
d(fs, "getImageSrc");
|
|
889
884
|
function wo(a) {
|
|
890
|
-
return
|
|
885
|
+
return fs(a.cover) || fs(a.avatar) || Hn(a.name);
|
|
891
886
|
}
|
|
892
887
|
d(wo, "getAgentAvatarUrl");
|
|
893
|
-
function
|
|
888
|
+
function ms(a) {
|
|
894
889
|
const t = a.target;
|
|
895
|
-
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src =
|
|
890
|
+
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = Hn());
|
|
896
891
|
}
|
|
897
|
-
d(
|
|
892
|
+
d(ms, "handleImageError");
|
|
898
893
|
function To(a) {
|
|
899
894
|
const { template: t, agent: e } = a;
|
|
900
895
|
return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
|
|
@@ -932,19 +927,19 @@ const Pa = {
|
|
|
932
927
|
}, [
|
|
933
928
|
a.loading ? (h(), f("div", Pa, [...s[0] || (s[0] = [
|
|
934
929
|
w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
935
|
-
])])) :
|
|
930
|
+
])])) : H("", !0),
|
|
936
931
|
w("span", {
|
|
937
932
|
class: C(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
|
|
938
933
|
}, [
|
|
939
934
|
a.icon ? (h(), f("i", {
|
|
940
935
|
key: 0,
|
|
941
936
|
class: C([a.icon, n.value])
|
|
942
|
-
}, null, 2)) :
|
|
937
|
+
}, null, 2)) : H("", !0),
|
|
943
938
|
vn(i.$slots, "default"),
|
|
944
939
|
a.iconAfter ? (h(), f("i", {
|
|
945
940
|
key: 1,
|
|
946
941
|
class: C([a.iconAfter, n.value])
|
|
947
|
-
}, null, 2)) :
|
|
942
|
+
}, null, 2)) : H("", !0)
|
|
948
943
|
], 2)
|
|
949
944
|
], 2));
|
|
950
945
|
}
|
|
@@ -971,7 +966,7 @@ const Pa = {
|
|
|
971
966
|
onInput: i[0] || (i[0] = (s) => e("update:modelValue", s.target.value))
|
|
972
967
|
}, null, 40, Ba));
|
|
973
968
|
}
|
|
974
|
-
}), Fa = ["placeholder", "value"],
|
|
969
|
+
}), Fa = ["placeholder", "value"], _o = /* @__PURE__ */ Re({
|
|
975
970
|
__name: "AgentInputOneTimeCode",
|
|
976
971
|
props: {
|
|
977
972
|
modelValue: {},
|
|
@@ -1032,11 +1027,11 @@ const Pa = {
|
|
|
1032
1027
|
alt: a.agent.displayName.value,
|
|
1033
1028
|
class: "w-full h-full object-cover",
|
|
1034
1029
|
onError: e[0] || (e[0] = //@ts-ignore
|
|
1035
|
-
(...n) => en(
|
|
1030
|
+
(...n) => en(ms) && en(ms)(...n))
|
|
1036
1031
|
}, null, 40, Ha)
|
|
1037
1032
|
], 2),
|
|
1038
1033
|
w("div", ja, [
|
|
1039
|
-
a.isOnline ? (h(), f(
|
|
1034
|
+
a.isOnline ? (h(), f(ee, { key: 0 }, [
|
|
1040
1035
|
e[1] || (e[1] = w("div", {
|
|
1041
1036
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
1042
1037
|
style: { "animation-duration": "3s" }
|
|
@@ -1051,13 +1046,13 @@ const Pa = {
|
|
|
1051
1046
|
a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
1052
1047
|
a.layout === "horizontal" ? "text-white/95" : ""
|
|
1053
1048
|
]])
|
|
1054
|
-
},
|
|
1049
|
+
}, j(a.agent.displayName.value), 3),
|
|
1055
1050
|
w("p", {
|
|
1056
1051
|
class: C(["font-light line-clamp-1", [
|
|
1057
1052
|
a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
1058
1053
|
a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
1059
1054
|
]])
|
|
1060
|
-
},
|
|
1055
|
+
}, j(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
|
|
1061
1056
|
])
|
|
1062
1057
|
], 2));
|
|
1063
1058
|
}
|
|
@@ -1066,7 +1061,7 @@ const Pa = {
|
|
|
1066
1061
|
amber: "bg-amber-500",
|
|
1067
1062
|
red: "bg-red-500",
|
|
1068
1063
|
grey: "bg-theme-300"
|
|
1069
|
-
},
|
|
1064
|
+
}, Ya = /* @__PURE__ */ Re({
|
|
1070
1065
|
__name: "FTooltip",
|
|
1071
1066
|
props: {
|
|
1072
1067
|
content: { default: "" },
|
|
@@ -1077,7 +1072,7 @@ const Pa = {
|
|
|
1077
1072
|
direction: { default: "top" }
|
|
1078
1073
|
},
|
|
1079
1074
|
setup(a) {
|
|
1080
|
-
const t = ge(null), e = ge(null), n = ge(!1), i = ge(null), s = ge(null), l =
|
|
1075
|
+
const t = ge(null), e = ge(null), n = ge(!1), i = ge(null), s = ge(null), l = va({
|
|
1081
1076
|
left: "0px",
|
|
1082
1077
|
top: "0px",
|
|
1083
1078
|
maxWidth: `${a.maxWidth}px`
|
|
@@ -1085,49 +1080,49 @@ const Pa = {
|
|
|
1085
1080
|
function p() {
|
|
1086
1081
|
if (!t.value || !e.value)
|
|
1087
1082
|
return;
|
|
1088
|
-
const
|
|
1089
|
-
let
|
|
1083
|
+
const E = t.value.getBoundingClientRect(), O = e.value.getBoundingClientRect(), Z = 8;
|
|
1084
|
+
let I, $;
|
|
1090
1085
|
switch (a.direction) {
|
|
1091
1086
|
case "bottom":
|
|
1092
|
-
|
|
1087
|
+
I = E.left + window.scrollX + E.width / 2 - O.width / 2, $ = E.bottom + window.scrollY + Z;
|
|
1093
1088
|
break;
|
|
1094
1089
|
case "top":
|
|
1095
|
-
|
|
1090
|
+
I = E.left + window.scrollX + E.width / 2 - O.width / 2, $ = E.top + window.scrollY - O.height - Z;
|
|
1096
1091
|
break;
|
|
1097
1092
|
case "left":
|
|
1098
|
-
|
|
1093
|
+
I = E.left + window.scrollX - O.width - Z, $ = E.top + window.scrollY + E.height / 2 - O.height / 2;
|
|
1099
1094
|
break;
|
|
1100
1095
|
default:
|
|
1101
|
-
|
|
1096
|
+
I = E.right + window.scrollX + Z, $ = E.top + window.scrollY + E.height / 2 - O.height / 2;
|
|
1102
1097
|
}
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1098
|
+
const N = 8;
|
|
1099
|
+
I = Math.max(N, Math.min(I, window.innerWidth - O.width - N)), $ = Math.max(N, Math.min($, window.innerHeight - O.height - N)), l.left = `${I}px`, l.top = `${$}px`;
|
|
1105
1100
|
}
|
|
1106
1101
|
d(p, "updatePosition");
|
|
1107
1102
|
function c() {
|
|
1108
|
-
a.disabled || (o.value = a.content || t.value?.getAttribute("title") || "", t.value?.hasAttribute("title") && (t.value.dataset.originalTitle = t.value.getAttribute("title") || "", t.value.removeAttribute("title")), o.value && (n.value = !0,
|
|
1103
|
+
a.disabled || (o.value = a.content || t.value?.getAttribute("title") || "", t.value?.hasAttribute("title") && (t.value.dataset.originalTitle = t.value.getAttribute("title") || "", t.value.removeAttribute("title")), o.value && (n.value = !0, Us(p), a.timeout > 0 && (s.value = setTimeout(() => {
|
|
1109
1104
|
n.value = !1;
|
|
1110
1105
|
}, a.timeout))));
|
|
1111
1106
|
}
|
|
1112
1107
|
d(c, "showTooltipWithDelay");
|
|
1113
|
-
function
|
|
1108
|
+
function b() {
|
|
1114
1109
|
a.disabled || (s.value && (clearTimeout(s.value), s.value = null), i.value = setTimeout(c, a.delay));
|
|
1115
1110
|
}
|
|
1116
|
-
d(
|
|
1111
|
+
d(b, "onMouseEnter");
|
|
1117
1112
|
function R() {
|
|
1118
1113
|
i.value && (clearTimeout(i.value), i.value = null), s.value && (clearTimeout(s.value), s.value = null), t.value?.dataset.originalTitle && (t.value.setAttribute("title", t.value.dataset.originalTitle), delete t.value.dataset.originalTitle), n.value = !1;
|
|
1119
1114
|
}
|
|
1120
1115
|
d(R, "onMouseLeave");
|
|
1121
|
-
function
|
|
1116
|
+
function y() {
|
|
1122
1117
|
a.disabled || (i.value && (clearTimeout(i.value), i.value = null), c());
|
|
1123
1118
|
}
|
|
1124
|
-
d(
|
|
1119
|
+
d(y, "onFocusIn");
|
|
1125
1120
|
function k() {
|
|
1126
1121
|
R();
|
|
1127
1122
|
}
|
|
1128
1123
|
d(k, "onFocusOut"), tn(() => {
|
|
1129
1124
|
window.addEventListener("resize", p), window.addEventListener("scroll", p, !0);
|
|
1130
|
-
}),
|
|
1125
|
+
}), Ps(() => {
|
|
1131
1126
|
window.removeEventListener("resize", p), window.removeEventListener("scroll", p, !0), i.value && clearTimeout(i.value), s.value && clearTimeout(s.value);
|
|
1132
1127
|
});
|
|
1133
1128
|
const A = S(() => `absolute size-2 rotate-45 bg-theme-900 dark:bg-theme-600 ${{
|
|
@@ -1136,17 +1131,17 @@ const Pa = {
|
|
|
1136
1131
|
left: "right-[-4px] top-1/2 -translate-y-1/2",
|
|
1137
1132
|
right: "left-[-4px] top-1/2 -translate-y-1/2"
|
|
1138
1133
|
}[a.direction]}`);
|
|
1139
|
-
return (
|
|
1134
|
+
return (E, O) => (h(), f("div", {
|
|
1140
1135
|
ref_key: "triggerRef",
|
|
1141
1136
|
ref: t,
|
|
1142
|
-
onMouseenter:
|
|
1137
|
+
onMouseenter: b,
|
|
1143
1138
|
onMouseleave: R,
|
|
1144
|
-
onFocusin:
|
|
1139
|
+
onFocusin: y,
|
|
1145
1140
|
onFocusout: k
|
|
1146
1141
|
}, [
|
|
1147
|
-
vn(
|
|
1148
|
-
(h(), kt(
|
|
1149
|
-
Ne(
|
|
1142
|
+
vn(E.$slots, "default"),
|
|
1143
|
+
(h(), kt(xa, { to: "body" }, [
|
|
1144
|
+
Ne(ya, {
|
|
1150
1145
|
"enter-active-class": "transition ease-out duration-200",
|
|
1151
1146
|
"enter-from-class": "opacity-0 scale-95",
|
|
1152
1147
|
"enter-to-class": "opacity-100 scale-100",
|
|
@@ -1154,14 +1149,14 @@ const Pa = {
|
|
|
1154
1149
|
"leave-from-class": "opacity-100 scale-100",
|
|
1155
1150
|
"leave-to-class": "opacity-0 scale-95"
|
|
1156
1151
|
}, {
|
|
1157
|
-
default:
|
|
1158
|
-
|
|
1152
|
+
default: Bs(() => [
|
|
1153
|
+
Fs(w("div", {
|
|
1159
1154
|
ref_key: "tooltipRef",
|
|
1160
1155
|
ref: e,
|
|
1161
1156
|
class: "fixed z-50 px-2 py-1.5 text-xs font-mono text-white bg-theme-900 dark:bg-theme-600 rounded-md shadow-lg",
|
|
1162
1157
|
style: q(l)
|
|
1163
1158
|
}, [
|
|
1164
|
-
ot(
|
|
1159
|
+
ot(j(o.value) + " ", 1),
|
|
1165
1160
|
w("div", {
|
|
1166
1161
|
class: C(A.value)
|
|
1167
1162
|
}, null, 2)
|
|
@@ -1174,7 +1169,7 @@ const Pa = {
|
|
|
1174
1169
|
]))
|
|
1175
1170
|
], 544));
|
|
1176
1171
|
}
|
|
1177
|
-
}),
|
|
1172
|
+
}), Ka = /* @__PURE__ */ Re({
|
|
1178
1173
|
__name: "StatusDot",
|
|
1179
1174
|
props: {
|
|
1180
1175
|
dotClass: {},
|
|
@@ -1190,8 +1185,8 @@ const Pa = {
|
|
|
1190
1185
|
width: "clamp(7px, 14%, 14px)",
|
|
1191
1186
|
height: "clamp(7px, 14%, 14px)"
|
|
1192
1187
|
}, n = S(() => a.position.startsWith("top") ? "bottom" : "top");
|
|
1193
|
-
return (i, s) => (h(), f(
|
|
1194
|
-
a.tooltip ? (h(), kt(
|
|
1188
|
+
return (i, s) => (h(), f(ee, null, [
|
|
1189
|
+
a.tooltip ? (h(), kt(Ya, {
|
|
1195
1190
|
key: 0,
|
|
1196
1191
|
content: a.tooltip,
|
|
1197
1192
|
direction: n.value,
|
|
@@ -1209,7 +1204,7 @@ const Pa = {
|
|
|
1209
1204
|
key: 2,
|
|
1210
1205
|
class: C(["absolute rounded-full animate-ping [animation-duration:3s] opacity-50 pointer-events-none", a.dotClass]),
|
|
1211
1206
|
style: q({ ...e, ...t.value })
|
|
1212
|
-
}, null, 6)) :
|
|
1207
|
+
}, null, 6)) : H("", !0)
|
|
1213
1208
|
], 64));
|
|
1214
1209
|
}
|
|
1215
1210
|
}), Xa = ["src", "alt"], Za = ["src"], Ja = /* @__PURE__ */ Re({
|
|
@@ -1244,21 +1239,21 @@ const Pa = {
|
|
|
1244
1239
|
class: C(["absolute inset-0 flex items-center justify-center opacity-0 group-hover/avatar:opacity-100 transition-opacity bg-black/40", t.value])
|
|
1245
1240
|
}, [...n[0] || (n[0] = [
|
|
1246
1241
|
w("i", { class: "i-tabler-camera text-xl text-white" }, null, -1)
|
|
1247
|
-
])], 2)) :
|
|
1242
|
+
])], 2)) : H("", !0)
|
|
1248
1243
|
], 2),
|
|
1249
1244
|
a.subSrc ? (h(), f("img", {
|
|
1250
1245
|
key: 0,
|
|
1251
1246
|
src: a.subSrc,
|
|
1252
1247
|
alt: "",
|
|
1253
1248
|
class: "absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2 ring-white"
|
|
1254
|
-
}, null, 8, Za)) :
|
|
1255
|
-
a.dotClass ? (h(), kt(
|
|
1249
|
+
}, null, 8, Za)) : H("", !0),
|
|
1250
|
+
a.dotClass ? (h(), kt(Ka, {
|
|
1256
1251
|
key: 1,
|
|
1257
1252
|
"dot-class": a.dotClass,
|
|
1258
1253
|
tooltip: a.dotTooltip,
|
|
1259
1254
|
"show-ping": a.showPing,
|
|
1260
1255
|
position: a.dotPosition
|
|
1261
|
-
}, null, 8, ["dot-class", "tooltip", "show-ping", "position"])) :
|
|
1256
|
+
}, null, 8, ["dot-class", "tooltip", "show-ping", "position"])) : H("", !0)
|
|
1262
1257
|
], 2));
|
|
1263
1258
|
}
|
|
1264
1259
|
}), Qa = /* @__PURE__ */ Re({
|
|
@@ -1273,7 +1268,7 @@ const Pa = {
|
|
|
1273
1268
|
subAvatarSrc: {}
|
|
1274
1269
|
},
|
|
1275
1270
|
setup(a) {
|
|
1276
|
-
const t = S(() => a.agent.avatarUrl.value ||
|
|
1271
|
+
const t = S(() => a.agent.avatarUrl.value || Hn(a.agent.name.value)), e = S(() => a.agent.state.value), n = S(
|
|
1277
1272
|
() => a.showStatus && e.value.lifecycle !== "unknown" ? qa[e.value.color] : null
|
|
1278
1273
|
);
|
|
1279
1274
|
return (i, s) => (h(), kt(Ja, {
|
|
@@ -1303,7 +1298,7 @@ const Pa = {
|
|
|
1303
1298
|
key: 1,
|
|
1304
1299
|
"data-journal-station": "failed",
|
|
1305
1300
|
class: "i-tabler-alert-circle size-3.5 text-red-600"
|
|
1306
|
-
},
|
|
1301
|
+
}, Mn = /* @__PURE__ */ Re({
|
|
1307
1302
|
__name: "AgentToolActivityGroup",
|
|
1308
1303
|
props: {
|
|
1309
1304
|
model: {},
|
|
@@ -1316,11 +1311,11 @@ const Pa = {
|
|
|
1316
1311
|
}
|
|
1317
1312
|
d(n, "toggle");
|
|
1318
1313
|
const i = S(() => t.model.outcome === "completed"), s = S(() => t.model.hiddenRows.length), l = S(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = S(() => {
|
|
1319
|
-
const
|
|
1320
|
-
return i.value ? e.value ?
|
|
1321
|
-
...e.value ?
|
|
1322
|
-
...
|
|
1323
|
-
...
|
|
1314
|
+
const b = t.model;
|
|
1315
|
+
return i.value ? e.value ? b.hiddenRows : [] : [
|
|
1316
|
+
...e.value ? b.hiddenRows : [],
|
|
1317
|
+
...b.visibleRows,
|
|
1318
|
+
...b.terminal ? [b.terminal] : []
|
|
1324
1319
|
];
|
|
1325
1320
|
}), p = S(() => t.isLight ? {
|
|
1326
1321
|
spine: "bg-theme-200",
|
|
@@ -1339,13 +1334,13 @@ const Pa = {
|
|
|
1339
1334
|
muted: "text-white/55",
|
|
1340
1335
|
ring: "focus-visible:ring-white"
|
|
1341
1336
|
});
|
|
1342
|
-
function c(
|
|
1343
|
-
return
|
|
1337
|
+
function c(b) {
|
|
1338
|
+
return b === "active" ? t.isLight ? "text-[13px] font-medium text-theme-900" : "text-[13px] font-medium text-white" : b === "failed" ? "text-[12.5px] font-medium text-red-600" : b === "stopped" ? t.isLight ? "text-[13px] font-medium text-theme-600" : "text-[13px] font-medium text-white/70" : t.isLight ? "text-[12.5px] text-theme-500" : "text-[12.5px] text-white/55";
|
|
1344
1339
|
}
|
|
1345
|
-
return d(c, "labelClass"), (
|
|
1340
|
+
return d(c, "labelClass"), (b, R) => (h(), f("div", {
|
|
1346
1341
|
class: C(["w-full py-0.5", p.value.muted])
|
|
1347
1342
|
}, [
|
|
1348
|
-
l.value ? (h(), f("span", ei,
|
|
1343
|
+
l.value ? (h(), f("span", ei, j(l.value), 1)) : H("", !0),
|
|
1349
1344
|
i.value ? (h(), f("button", {
|
|
1350
1345
|
key: 1,
|
|
1351
1346
|
type: "button",
|
|
@@ -1365,17 +1360,17 @@ const Pa = {
|
|
|
1365
1360
|
], -1)),
|
|
1366
1361
|
w("span", {
|
|
1367
1362
|
class: C(["min-w-0 truncate text-[12.5px] font-medium leading-none", p.value.muted])
|
|
1368
|
-
},
|
|
1363
|
+
}, j(a.model.terminal?.label), 3),
|
|
1369
1364
|
s.value ? (h(), f("span", {
|
|
1370
1365
|
key: 0,
|
|
1371
1366
|
class: C(["flex shrink-0 items-center gap-0.5 whitespace-nowrap text-[12px] font-medium leading-none", p.value.muted])
|
|
1372
1367
|
}, [
|
|
1373
|
-
ot(
|
|
1368
|
+
ot(j(s.value) + " earlier updates ", 1),
|
|
1374
1369
|
w("i", {
|
|
1375
1370
|
class: C(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1376
1371
|
"aria-hidden": "true"
|
|
1377
1372
|
}, null, 2)
|
|
1378
|
-
], 2)) :
|
|
1373
|
+
], 2)) : H("", !0)
|
|
1379
1374
|
], 10, ti)) : s.value ? (h(), f("button", {
|
|
1380
1375
|
key: 2,
|
|
1381
1376
|
type: "button",
|
|
@@ -1394,26 +1389,26 @@ const Pa = {
|
|
|
1394
1389
|
w("span", {
|
|
1395
1390
|
class: C(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", p.value.muted])
|
|
1396
1391
|
}, [
|
|
1397
|
-
ot(
|
|
1392
|
+
ot(j(s.value) + " earlier updates ", 1),
|
|
1398
1393
|
w("i", {
|
|
1399
1394
|
class: C(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1400
1395
|
"aria-hidden": "true"
|
|
1401
1396
|
}, null, 2)
|
|
1402
1397
|
], 2)
|
|
1403
|
-
], 10, ni)) :
|
|
1404
|
-
(h(!0), f(
|
|
1405
|
-
key:
|
|
1398
|
+
], 10, ni)) : H("", !0),
|
|
1399
|
+
(h(!0), f(ee, null, me(o.value, (y, k) => (h(), f("div", {
|
|
1400
|
+
key: y.id,
|
|
1406
1401
|
"data-test": "messaging-tool-activity-row",
|
|
1407
|
-
"data-journal-row":
|
|
1402
|
+
"data-journal-row": y.tone,
|
|
1408
1403
|
class: C([i.value ? "pl-[30px]" : "", "flex gap-x-2.5"])
|
|
1409
1404
|
}, [
|
|
1410
1405
|
w("div", ii, [
|
|
1411
1406
|
w("span", ri, [
|
|
1412
|
-
|
|
1407
|
+
y.tone === "active" ? (h(), f("span", {
|
|
1413
1408
|
key: 0,
|
|
1414
1409
|
"data-journal-station": "active",
|
|
1415
1410
|
class: C(["size-3.5 animate-spin rounded-full border-[1.5px] motion-reduce:animate-none", p.value.activeSpinner])
|
|
1416
|
-
}, null, 2)) :
|
|
1411
|
+
}, null, 2)) : y.tone === "failed" ? (h(), f("i", li)) : y.tone === "stopped" ? (h(), f("span", {
|
|
1417
1412
|
key: 2,
|
|
1418
1413
|
"data-journal-station": "stopped",
|
|
1419
1414
|
class: C(["size-[9px] rounded-[2px]", p.value.stoppedSquare])
|
|
@@ -1426,34 +1421,34 @@ const Pa = {
|
|
|
1426
1421
|
k !== o.value.length - 1 ? (h(), f("span", {
|
|
1427
1422
|
key: 0,
|
|
1428
1423
|
class: C(["w-px flex-1", p.value.spine])
|
|
1429
|
-
}, null, 2)) :
|
|
1424
|
+
}, null, 2)) : H("", !0)
|
|
1430
1425
|
]),
|
|
1431
1426
|
w("div", {
|
|
1432
1427
|
class: C(["min-w-0 flex-1", k === o.value.length - 1 ? "" : "pb-2"])
|
|
1433
1428
|
}, [
|
|
1434
1429
|
w("span", {
|
|
1435
|
-
class: C(["block leading-snug", c(
|
|
1436
|
-
},
|
|
1437
|
-
|
|
1430
|
+
class: C(["block leading-snug", c(y.tone)])
|
|
1431
|
+
}, j(y.label), 3),
|
|
1432
|
+
y.note ? (h(), f("p", {
|
|
1438
1433
|
key: 0,
|
|
1439
1434
|
class: C(["pt-0.5 text-[11.5px] leading-snug", p.value.muted])
|
|
1440
|
-
},
|
|
1435
|
+
}, j(y.note), 3)) : H("", !0)
|
|
1441
1436
|
], 2)
|
|
1442
1437
|
], 10, ai))), 128)),
|
|
1443
1438
|
!i.value && a.model.hint ? (h(), f("p", {
|
|
1444
1439
|
key: 3,
|
|
1445
1440
|
"data-test": "messaging-tool-activity-hint",
|
|
1446
1441
|
class: C(["pl-[30px] pt-2.5 text-[12px] leading-snug", p.value.muted])
|
|
1447
|
-
},
|
|
1442
|
+
}, j(a.model.hint), 3)) : H("", !0)
|
|
1448
1443
|
], 2));
|
|
1449
1444
|
}
|
|
1450
1445
|
});
|
|
1451
|
-
function
|
|
1446
|
+
function gs(a, t) {
|
|
1452
1447
|
(t == null || t > a.length) && (t = a.length);
|
|
1453
1448
|
for (var e = 0, n = Array(t); e < t; e++) n[e] = a[e];
|
|
1454
1449
|
return n;
|
|
1455
1450
|
}
|
|
1456
|
-
d(
|
|
1451
|
+
d(gs, "_arrayLikeToArray");
|
|
1457
1452
|
function oi(a) {
|
|
1458
1453
|
if (Array.isArray(a)) return a;
|
|
1459
1454
|
}
|
|
@@ -1464,8 +1459,8 @@ function ci(a, t) {
|
|
|
1464
1459
|
var n, i, s, l, o = [], p = !0, c = !1;
|
|
1465
1460
|
try {
|
|
1466
1461
|
if (s = (e = e.call(a)).next, t !== 0) for (; !(p = (n = s.call(e)).done) && (o.push(n.value), o.length !== t); p = !0) ;
|
|
1467
|
-
} catch (
|
|
1468
|
-
c = !0, i =
|
|
1462
|
+
} catch (b) {
|
|
1463
|
+
c = !0, i = b;
|
|
1469
1464
|
} finally {
|
|
1470
1465
|
try {
|
|
1471
1466
|
if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
@@ -1488,37 +1483,37 @@ function di(a, t) {
|
|
|
1488
1483
|
d(di, "_slicedToArray");
|
|
1489
1484
|
function hi(a, t) {
|
|
1490
1485
|
if (a) {
|
|
1491
|
-
if (typeof a == "string") return
|
|
1486
|
+
if (typeof a == "string") return gs(a, t);
|
|
1492
1487
|
var e = {}.toString.call(a).slice(8, -1);
|
|
1493
|
-
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) ?
|
|
1488
|
+
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) ? gs(a, t) : void 0;
|
|
1494
1489
|
}
|
|
1495
1490
|
}
|
|
1496
1491
|
d(hi, "_unsupportedIterableToArray");
|
|
1497
|
-
const
|
|
1498
|
-
let
|
|
1499
|
-
|
|
1492
|
+
const qs = Object.entries, vs = Object.setPrototypeOf, pi = Object.isFrozen, fi = Object.getPrototypeOf, mi = Object.getOwnPropertyDescriptor;
|
|
1493
|
+
let Ee = Object.freeze, He = Object.seal, Dt = Object.create, Ys = typeof Reflect < "u" && Reflect, Bn = Ys.apply, Fn = Ys.construct;
|
|
1494
|
+
Ee || (Ee = /* @__PURE__ */ d(function(t) {
|
|
1500
1495
|
return t;
|
|
1501
1496
|
}, "freeze"));
|
|
1502
1497
|
He || (He = /* @__PURE__ */ d(function(t) {
|
|
1503
1498
|
return t;
|
|
1504
1499
|
}, "seal"));
|
|
1505
|
-
|
|
1500
|
+
Bn || (Bn = /* @__PURE__ */ d(function(t, e) {
|
|
1506
1501
|
for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
|
|
1507
1502
|
i[s - 2] = arguments[s];
|
|
1508
1503
|
return t.apply(e, i);
|
|
1509
1504
|
}, "apply"));
|
|
1510
|
-
|
|
1505
|
+
Fn || (Fn = /* @__PURE__ */ d(function(t) {
|
|
1511
1506
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
1512
1507
|
n[i - 1] = arguments[i];
|
|
1513
1508
|
return new t(...n);
|
|
1514
1509
|
}, "construct"));
|
|
1515
|
-
const Rt = ve(Array.prototype.forEach), gi = ve(Array.prototype.lastIndexOf),
|
|
1510
|
+
const Rt = ve(Array.prototype.forEach), gi = ve(Array.prototype.lastIndexOf), xs = ve(Array.prototype.pop), Mt = ve(Array.prototype.push), vi = ve(Array.prototype.splice), _e = Array.isArray, Zt = ve(String.prototype.toLowerCase), Cn = ve(String.prototype.toString), ys = ve(String.prototype.match), Ct = ve(String.prototype.replace), bs = ve(String.prototype.indexOf), xi = ve(String.prototype.trim), yi = ve(Number.prototype.toString), bi = ve(Boolean.prototype.toString), ks = typeof BigInt > "u" ? null : ve(BigInt.prototype.toString), ws = typeof Symbol > "u" ? null : ve(Symbol.prototype.toString), he = ve(Object.prototype.hasOwnProperty), Wt = ve(Object.prototype.toString), we = ve(RegExp.prototype.test), Gt = ki(TypeError);
|
|
1516
1511
|
function ve(a) {
|
|
1517
1512
|
return function(t) {
|
|
1518
1513
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1519
1514
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
1520
1515
|
n[i - 1] = arguments[i];
|
|
1521
|
-
return
|
|
1516
|
+
return Bn(a, t, n);
|
|
1522
1517
|
};
|
|
1523
1518
|
}
|
|
1524
1519
|
d(ve, "unapply");
|
|
@@ -1526,13 +1521,13 @@ function ki(a) {
|
|
|
1526
1521
|
return function() {
|
|
1527
1522
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
1528
1523
|
e[n] = arguments[n];
|
|
1529
|
-
return
|
|
1524
|
+
return Fn(a, e);
|
|
1530
1525
|
};
|
|
1531
1526
|
}
|
|
1532
1527
|
d(ki, "unconstruct");
|
|
1533
1528
|
function G(a, t) {
|
|
1534
1529
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Zt;
|
|
1535
|
-
if (
|
|
1530
|
+
if (vs && vs(a, null), !_e(t))
|
|
1536
1531
|
return a;
|
|
1537
1532
|
let n = t.length;
|
|
1538
1533
|
for (; n--; ) {
|
|
@@ -1554,10 +1549,10 @@ function wi(a) {
|
|
|
1554
1549
|
d(wi, "cleanArray");
|
|
1555
1550
|
function Te(a) {
|
|
1556
1551
|
const t = Dt(null);
|
|
1557
|
-
for (const n of
|
|
1552
|
+
for (const n of qs(a)) {
|
|
1558
1553
|
var e = di(n, 2);
|
|
1559
1554
|
const i = e[0], s = e[1];
|
|
1560
|
-
he(a, i) && (
|
|
1555
|
+
he(a, i) && (_e(s) ? t[i] = wi(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = Te(s) : t[i] = s);
|
|
1561
1556
|
}
|
|
1562
1557
|
return t;
|
|
1563
1558
|
}
|
|
@@ -1567,13 +1562,13 @@ function Ti(a) {
|
|
|
1567
1562
|
case "string":
|
|
1568
1563
|
return a;
|
|
1569
1564
|
case "number":
|
|
1570
|
-
return bi(a);
|
|
1571
|
-
case "boolean":
|
|
1572
1565
|
return yi(a);
|
|
1566
|
+
case "boolean":
|
|
1567
|
+
return bi(a);
|
|
1573
1568
|
case "bigint":
|
|
1574
|
-
return
|
|
1569
|
+
return ks ? ks(a) : "0";
|
|
1575
1570
|
case "symbol":
|
|
1576
|
-
return
|
|
1571
|
+
return ws ? ws(a) : "Symbol()";
|
|
1577
1572
|
case "undefined":
|
|
1578
1573
|
return Wt(a);
|
|
1579
1574
|
case "function":
|
|
@@ -1617,7 +1612,7 @@ function Si(a) {
|
|
|
1617
1612
|
}
|
|
1618
1613
|
}
|
|
1619
1614
|
d(Si, "isRegex");
|
|
1620
|
-
const
|
|
1615
|
+
const Ts = Ee(["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"]), In = Ee(["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"]), $n = Ee(["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"]), Ai = Ee(["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 = Ee(["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"]), _i = Ee(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ss = Ee(["#text"]), As = Ee(["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"]), Dn = Ee(["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"]), _s = Ee(["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"]), cn = Ee(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ei = He(/{{[\w\W]*|^[\w\W]*}}/g), Ri = He(/<%[\w\W]*|^[\w\W]*%>/g), Mi = He(/\${[\w\W]*/g), Ci = He(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ii = He(/^aria-[\-\w]+$/), Es = He(
|
|
1621
1616
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
1622
1617
|
// eslint-disable-line no-useless-escape
|
|
1623
1618
|
), $i = He(/^(?:\w+script|data):/i), Li = He(
|
|
@@ -1660,7 +1655,7 @@ const ws = _e(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
1660
1655
|
} catch {
|
|
1661
1656
|
return console.warn("TrustedTypes policy " + s + " could not be created."), null;
|
|
1662
1657
|
}
|
|
1663
|
-
}, "_createTrustedTypesPolicy"),
|
|
1658
|
+
}, "_createTrustedTypesPolicy"), Rs = /* @__PURE__ */ d(function() {
|
|
1664
1659
|
return {
|
|
1665
1660
|
afterSanitizeAttributes: [],
|
|
1666
1661
|
afterSanitizeElements: [],
|
|
@@ -1683,20 +1678,20 @@ function Ks() {
|
|
|
1683
1678
|
a.DocumentFragment;
|
|
1684
1679
|
const s = a.HTMLTemplateElement, l = a.Node, o = a.Element, p = a.NodeFilter, c = a.NamedNodeMap;
|
|
1685
1680
|
c === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
1686
|
-
const
|
|
1681
|
+
const b = a.DOMParser, R = a.trustedTypes, y = o.prototype, k = tt(y, "cloneNode"), A = tt(y, "remove"), E = tt(y, "nextSibling"), O = tt(y, "childNodes"), Z = tt(y, "parentNode"), I = tt(y, "shadowRoot"), $ = tt(y, "attributes"), N = l && l.prototype ? tt(l.prototype, "nodeType") : null, W = l && l.prototype ? tt(l.prototype, "nodeName") : null;
|
|
1687
1682
|
if (typeof s == "function") {
|
|
1688
1683
|
const F = e.createElement("template");
|
|
1689
1684
|
F.content && F.content.ownerDocument && (e = F.content.ownerDocument);
|
|
1690
1685
|
}
|
|
1691
1686
|
let B, V = "";
|
|
1692
|
-
const
|
|
1693
|
-
let se =
|
|
1694
|
-
t.isSupported = typeof
|
|
1695
|
-
const st =
|
|
1696
|
-
let Ce = Es,
|
|
1697
|
-
const
|
|
1687
|
+
const J = e, ue = J.implementation, Ae = J.createNodeIterator, Pe = J.createDocumentFragment, St = J.getElementsByTagName, De = n.importNode;
|
|
1688
|
+
let se = Rs();
|
|
1689
|
+
t.isSupported = typeof qs == "function" && typeof Z == "function" && ue && ue.createHTMLDocument !== void 0;
|
|
1690
|
+
const st = Ei, Ye = Ri, at = Mi, Oe = Ci, gt = Ii, vt = $i, Me = Li, it = Oi;
|
|
1691
|
+
let Ce = Es, K = null;
|
|
1692
|
+
const ye = G({}, [...Ts, ...In, ...$n, ...Ln, ...Ss]);
|
|
1698
1693
|
let ie = null;
|
|
1699
|
-
const Ie = G({}, [...
|
|
1694
|
+
const Ie = G({}, [...As, ...Dn, ..._s, ...cn]);
|
|
1700
1695
|
let re = Object.seal(Dt(null, {
|
|
1701
1696
|
tagNameCheck: {
|
|
1702
1697
|
writable: !0,
|
|
@@ -1717,7 +1712,7 @@ function Ks() {
|
|
|
1717
1712
|
value: !1
|
|
1718
1713
|
}
|
|
1719
1714
|
})), Be = null, rt = null;
|
|
1720
|
-
const
|
|
1715
|
+
const be = Object.seal(Dt(null, {
|
|
1721
1716
|
tagCheck: {
|
|
1722
1717
|
writable: !0,
|
|
1723
1718
|
configurable: !1,
|
|
@@ -1731,31 +1726,31 @@ function Ks() {
|
|
|
1731
1726
|
value: null
|
|
1732
1727
|
}
|
|
1733
1728
|
}));
|
|
1734
|
-
let g = !0, M = !0, u = !1, v = !0,
|
|
1729
|
+
let g = !0, M = !0, u = !1, v = !0, L = !1, D = !0, Q = !1, pe = !1, ke = !1, le = !1, de = !1, $e = !1, Ke = !0, je = !1;
|
|
1735
1730
|
const ze = "user-content-";
|
|
1736
|
-
let Fe = !0, Xe = !1,
|
|
1731
|
+
let Fe = !0, Xe = !1, _ = {}, m = null;
|
|
1737
1732
|
const T = G({}, ["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"]);
|
|
1738
1733
|
let ae = null;
|
|
1739
1734
|
const U = G({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
1740
1735
|
let oe = null;
|
|
1741
1736
|
const Ze = G({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ct = "http://www.w3.org/1998/Math/MathML", sn = "http://www.w3.org/2000/svg", Je = "http://www.w3.org/1999/xhtml";
|
|
1742
|
-
let At = Je,
|
|
1743
|
-
const
|
|
1737
|
+
let At = Je, bn = !1, kn = null;
|
|
1738
|
+
const ca = G({}, [ct, sn, Je], Cn);
|
|
1744
1739
|
let wn = G({}, ["mi", "mo", "mn", "ms", "mtext"]), Tn = G({}, ["annotation-xml"]);
|
|
1745
|
-
const
|
|
1740
|
+
const ua = G({}, ["title", "style", "font", "a", "script"]);
|
|
1746
1741
|
let Ut = null;
|
|
1747
|
-
const
|
|
1748
|
-
let fe = null,
|
|
1749
|
-
const
|
|
1742
|
+
const da = ["application/xhtml+xml", "text/html"], ha = "text/html";
|
|
1743
|
+
let fe = null, _t = null;
|
|
1744
|
+
const pa = e.createElement("form"), es = /* @__PURE__ */ d(function(r) {
|
|
1750
1745
|
return r instanceof RegExp || r instanceof Function;
|
|
1751
1746
|
}, "isRegexOrFunction"), Sn = /* @__PURE__ */ d(function() {
|
|
1752
1747
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1753
|
-
if (
|
|
1748
|
+
if (_t && _t === r)
|
|
1754
1749
|
return;
|
|
1755
1750
|
(!r || typeof r != "object") && (r = {}), r = Te(r), Ut = // eslint-disable-next-line unicorn/prefer-includes
|
|
1756
|
-
|
|
1751
|
+
da.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? ha : r.PARSER_MEDIA_TYPE, fe = Ut === "application/xhtml+xml" ? Cn : Zt, K = he(r, "ALLOWED_TAGS") && _e(r.ALLOWED_TAGS) ? G({}, r.ALLOWED_TAGS, fe) : ye, ie = he(r, "ALLOWED_ATTR") && _e(r.ALLOWED_ATTR) ? G({}, r.ALLOWED_ATTR, fe) : Ie, kn = he(r, "ALLOWED_NAMESPACES") && _e(r.ALLOWED_NAMESPACES) ? G({}, r.ALLOWED_NAMESPACES, Cn) : ca, oe = he(r, "ADD_URI_SAFE_ATTR") && _e(r.ADD_URI_SAFE_ATTR) ? G(Te(Ze), r.ADD_URI_SAFE_ATTR, fe) : Ze, ae = he(r, "ADD_DATA_URI_TAGS") && _e(r.ADD_DATA_URI_TAGS) ? G(Te(U), r.ADD_DATA_URI_TAGS, fe) : U, m = he(r, "FORBID_CONTENTS") && _e(r.FORBID_CONTENTS) ? G({}, r.FORBID_CONTENTS, fe) : T, Be = he(r, "FORBID_TAGS") && _e(r.FORBID_TAGS) ? G({}, r.FORBID_TAGS, fe) : Te({}), rt = he(r, "FORBID_ATTR") && _e(r.FORBID_ATTR) ? G({}, r.FORBID_ATTR, fe) : Te({}), _ = he(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? Te(r.USE_PROFILES) : r.USE_PROFILES : !1, g = r.ALLOW_ARIA_ATTR !== !1, M = r.ALLOW_DATA_ATTR !== !1, u = r.ALLOW_UNKNOWN_PROTOCOLS || !1, v = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, L = r.SAFE_FOR_TEMPLATES || !1, D = r.SAFE_FOR_XML !== !1, Q = r.WHOLE_DOCUMENT || !1, le = r.RETURN_DOM || !1, de = r.RETURN_DOM_FRAGMENT || !1, $e = r.RETURN_TRUSTED_TYPE || !1, ke = r.FORCE_BODY || !1, Ke = r.SANITIZE_DOM !== !1, je = r.SANITIZE_NAMED_PROPS || !1, Fe = r.KEEP_CONTENT !== !1, Xe = r.IN_PLACE || !1, Ce = Si(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : Es, At = typeof r.NAMESPACE == "string" ? r.NAMESPACE : Je, wn = he(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Te(r.MATHML_TEXT_INTEGRATION_POINTS) : G({}, ["mi", "mo", "mn", "ms", "mtext"]), Tn = he(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? Te(r.HTML_INTEGRATION_POINTS) : G({}, ["annotation-xml"]);
|
|
1757
1752
|
const x = he(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? Te(r.CUSTOM_ELEMENT_HANDLING) : Dt(null);
|
|
1758
|
-
if (re = Dt(null), he(x, "tagNameCheck") &&
|
|
1753
|
+
if (re = Dt(null), he(x, "tagNameCheck") && es(x.tagNameCheck) && (re.tagNameCheck = x.tagNameCheck), he(x, "attributeNameCheck") && es(x.attributeNameCheck) && (re.attributeNameCheck = x.attributeNameCheck), he(x, "allowCustomizedBuiltInElements") && typeof x.allowCustomizedBuiltInElements == "boolean" && (re.allowCustomizedBuiltInElements = x.allowCustomizedBuiltInElements), L && (M = !1), de && (le = !0), _ && (K = G({}, Ss), ie = Dt(null), _.html === !0 && (G(K, Ts), G(ie, As)), _.svg === !0 && (G(K, In), G(ie, Dn), G(ie, cn)), _.svgFilters === !0 && (G(K, $n), G(ie, Dn), G(ie, cn)), _.mathMl === !0 && (G(K, Ln), G(ie, _s), G(ie, cn))), be.tagCheck = null, be.attributeCheck = null, he(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? be.tagCheck = r.ADD_TAGS : _e(r.ADD_TAGS) && (K === ye && (K = Te(K)), G(K, r.ADD_TAGS, fe))), he(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? be.attributeCheck = r.ADD_ATTR : _e(r.ADD_ATTR) && (ie === Ie && (ie = Te(ie)), G(ie, r.ADD_ATTR, fe))), he(r, "ADD_URI_SAFE_ATTR") && _e(r.ADD_URI_SAFE_ATTR) && G(oe, r.ADD_URI_SAFE_ATTR, fe), he(r, "FORBID_CONTENTS") && _e(r.FORBID_CONTENTS) && (m === T && (m = Te(m)), G(m, r.FORBID_CONTENTS, fe)), he(r, "ADD_FORBID_CONTENTS") && _e(r.ADD_FORBID_CONTENTS) && (m === T && (m = Te(m)), G(m, r.ADD_FORBID_CONTENTS, fe)), Fe && (K["#text"] = !0), Q && G(K, ["html", "head", "body"]), K.table && (G(K, ["tbody"]), delete Be.tbody), r.TRUSTED_TYPES_POLICY) {
|
|
1759
1754
|
if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
1760
1755
|
throw Gt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1761
1756
|
if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -1763,15 +1758,15 @@ function Ks() {
|
|
|
1763
1758
|
B = r.TRUSTED_TYPES_POLICY, V = B.createHTML("");
|
|
1764
1759
|
} else
|
|
1765
1760
|
B === void 0 && (B = Ni(R, i)), B !== null && typeof V == "string" && (V = B.createHTML(""));
|
|
1766
|
-
(se.uponSanitizeElement.length > 0 || se.uponSanitizeAttribute.length > 0) &&
|
|
1767
|
-
}, "_parseConfig"),
|
|
1761
|
+
(se.uponSanitizeElement.length > 0 || se.uponSanitizeAttribute.length > 0) && K === ye && (K = Te(K)), se.uponSanitizeAttribute.length > 0 && ie === Ie && (ie = Te(ie)), Ee && Ee(r), _t = r;
|
|
1762
|
+
}, "_parseConfig"), ts = G({}, [...In, ...$n, ...Ai]), ns = G({}, [...Ln, ..._i]), fa = /* @__PURE__ */ d(function(r) {
|
|
1768
1763
|
let x = Z(r);
|
|
1769
1764
|
(!x || !x.tagName) && (x = {
|
|
1770
1765
|
namespaceURI: At,
|
|
1771
1766
|
tagName: "template"
|
|
1772
1767
|
});
|
|
1773
|
-
const
|
|
1774
|
-
return kn[r.namespaceURI] ? r.namespaceURI === sn ? x.namespaceURI === Je ?
|
|
1768
|
+
const z = Zt(r.tagName), ne = Zt(x.tagName);
|
|
1769
|
+
return kn[r.namespaceURI] ? r.namespaceURI === sn ? x.namespaceURI === Je ? z === "svg" : x.namespaceURI === ct ? z === "svg" && (ne === "annotation-xml" || wn[ne]) : !!ts[z] : r.namespaceURI === ct ? x.namespaceURI === Je ? z === "math" : x.namespaceURI === sn ? z === "math" && Tn[ne] : !!ns[z] : r.namespaceURI === Je ? x.namespaceURI === sn && !Tn[ne] || x.namespaceURI === ct && !wn[ne] ? !1 : !ns[z] && (ua[z] || !ts[z]) : !!(Ut === "application/xhtml+xml" && kn[r.namespaceURI]) : !1;
|
|
1775
1770
|
}, "_checkValidNamespace"), We = /* @__PURE__ */ d(function(r) {
|
|
1776
1771
|
Mt(t.removed, {
|
|
1777
1772
|
element: r
|
|
@@ -1804,31 +1799,31 @@ function Ks() {
|
|
|
1804
1799
|
x.setAttribute(r, "");
|
|
1805
1800
|
} catch {
|
|
1806
1801
|
}
|
|
1807
|
-
}, "_removeAttribute"),
|
|
1808
|
-
let x = null,
|
|
1802
|
+
}, "_removeAttribute"), ss = /* @__PURE__ */ d(function(r) {
|
|
1803
|
+
let x = null, z = null;
|
|
1809
1804
|
if (ke)
|
|
1810
1805
|
r = "<remove></remove>" + r;
|
|
1811
1806
|
else {
|
|
1812
|
-
const ce =
|
|
1813
|
-
|
|
1807
|
+
const ce = ys(r, /^[\r\n\t ]+/);
|
|
1808
|
+
z = ce && ce[0];
|
|
1814
1809
|
}
|
|
1815
1810
|
Ut === "application/xhtml+xml" && At === Je && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
|
|
1816
1811
|
const ne = B ? B.createHTML(r) : r;
|
|
1817
1812
|
if (At === Je)
|
|
1818
1813
|
try {
|
|
1819
|
-
x = new
|
|
1814
|
+
x = new b().parseFromString(ne, Ut);
|
|
1820
1815
|
} catch {
|
|
1821
1816
|
}
|
|
1822
1817
|
if (!x || !x.documentElement) {
|
|
1823
1818
|
x = ue.createDocument(At, "template", null);
|
|
1824
1819
|
try {
|
|
1825
|
-
x.documentElement.innerHTML =
|
|
1820
|
+
x.documentElement.innerHTML = bn ? V : ne;
|
|
1826
1821
|
} catch {
|
|
1827
1822
|
}
|
|
1828
1823
|
}
|
|
1829
|
-
const
|
|
1830
|
-
return r &&
|
|
1831
|
-
}, "_initDocument"),
|
|
1824
|
+
const Y = x.body || x.documentElement;
|
|
1825
|
+
return r && z && Y.insertBefore(e.createTextNode(z), Y.childNodes[0] || null), At === Je ? St.call(x, Q ? "html" : "body")[0] : Q ? x.documentElement : Y;
|
|
1826
|
+
}, "_initDocument"), as = /* @__PURE__ */ d(function(r) {
|
|
1832
1827
|
return Ae.call(
|
|
1833
1828
|
r.ownerDocument || r,
|
|
1834
1829
|
r,
|
|
@@ -1836,7 +1831,7 @@ function Ks() {
|
|
|
1836
1831
|
p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
|
|
1837
1832
|
null
|
|
1838
1833
|
);
|
|
1839
|
-
}, "_createNodeIterator"),
|
|
1834
|
+
}, "_createNodeIterator"), is = /* @__PURE__ */ d(function(r) {
|
|
1840
1835
|
r.normalize();
|
|
1841
1836
|
const x = Ae.call(
|
|
1842
1837
|
r.ownerDocument || r,
|
|
@@ -1845,28 +1840,28 @@ function Ks() {
|
|
|
1845
1840
|
p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION,
|
|
1846
1841
|
null
|
|
1847
1842
|
);
|
|
1848
|
-
let
|
|
1849
|
-
for (;
|
|
1850
|
-
let ne =
|
|
1851
|
-
Rt([st,
|
|
1852
|
-
ne = Ct(ne,
|
|
1853
|
-
}),
|
|
1843
|
+
let z = x.nextNode();
|
|
1844
|
+
for (; z; ) {
|
|
1845
|
+
let ne = z.data;
|
|
1846
|
+
Rt([st, Ye, at], (Y) => {
|
|
1847
|
+
ne = Ct(ne, Y, " ");
|
|
1848
|
+
}), z.data = ne, z = x.nextNode();
|
|
1854
1849
|
}
|
|
1855
1850
|
}, "_scrubTemplateExpressions"), an = /* @__PURE__ */ d(function(r) {
|
|
1856
|
-
const x =
|
|
1851
|
+
const x = W ? W(r) : null;
|
|
1857
1852
|
return typeof x != "string" || fe(x) !== "form" ? !1 : typeof r.nodeName != "string" || typeof r.textContent != "string" || typeof r.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
1858
1853
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
1859
1854
|
// makes the direct read diverge from the cached read; a clean form
|
|
1860
1855
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
1861
1856
|
// canonical NamedNodeMap.
|
|
1862
|
-
r.attributes !==
|
|
1857
|
+
r.attributes !== $(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
|
|
1863
1858
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
1864
1859
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
1865
1860
|
// the named child element. Cheap addition — nodeType is read from
|
|
1866
1861
|
// an internal slot, no serialization cost — and removes a residual
|
|
1867
1862
|
// clobbering surface used by several mXSS / PI / comment branches
|
|
1868
1863
|
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
1869
|
-
r.nodeType !==
|
|
1864
|
+
r.nodeType !== N(r) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
1870
1865
|
// "childNodes" shadows the prototype getter. Direct reads of
|
|
1871
1866
|
// form.childNodes from a clobbered form return the named child
|
|
1872
1867
|
// instead of the real NodeList, so any walk that reads it directly
|
|
@@ -1877,64 +1872,64 @@ function Ks() {
|
|
|
1877
1872
|
// select, etc.) regardless of whether the named child happens to
|
|
1878
1873
|
// carry a numeric .length, which a typeof-based probe would miss
|
|
1879
1874
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
1880
|
-
r.childNodes !==
|
|
1875
|
+
r.childNodes !== O(r);
|
|
1881
1876
|
}, "_isClobbered"), Ht = /* @__PURE__ */ d(function(r) {
|
|
1882
|
-
if (!
|
|
1877
|
+
if (!N || typeof r != "object" || r === null)
|
|
1883
1878
|
return !1;
|
|
1884
1879
|
try {
|
|
1885
|
-
return
|
|
1880
|
+
return N(r) === et.documentFragment;
|
|
1886
1881
|
} catch {
|
|
1887
1882
|
return !1;
|
|
1888
1883
|
}
|
|
1889
1884
|
}, "_isDocumentFragment"), rn = /* @__PURE__ */ d(function(r) {
|
|
1890
|
-
if (!
|
|
1885
|
+
if (!N || typeof r != "object" || r === null)
|
|
1891
1886
|
return !1;
|
|
1892
1887
|
try {
|
|
1893
|
-
return typeof
|
|
1888
|
+
return typeof N(r) == "number";
|
|
1894
1889
|
} catch {
|
|
1895
1890
|
return !1;
|
|
1896
1891
|
}
|
|
1897
1892
|
}, "_isNode");
|
|
1898
1893
|
function lt(F, r, x) {
|
|
1899
|
-
Rt(F, (
|
|
1900
|
-
|
|
1894
|
+
Rt(F, (z) => {
|
|
1895
|
+
z.call(t, r, x, _t);
|
|
1901
1896
|
});
|
|
1902
1897
|
}
|
|
1903
1898
|
d(lt, "_executeHooks");
|
|
1904
|
-
const
|
|
1899
|
+
const rs = /* @__PURE__ */ d(function(r) {
|
|
1905
1900
|
let x = null;
|
|
1906
1901
|
if (lt(se.beforeSanitizeElements, r, null), an(r))
|
|
1907
1902
|
return We(r), !0;
|
|
1908
|
-
const
|
|
1903
|
+
const z = fe(r.nodeName);
|
|
1909
1904
|
if (lt(se.uponSanitizeElement, r, {
|
|
1910
|
-
tagName:
|
|
1911
|
-
allowedTags:
|
|
1912
|
-
}), D && r.hasChildNodes() && !rn(r.firstElementChild) && we(/<[/\w!]/g, r.innerHTML) && we(/<[/\w!]/g, r.textContent) || D && r.namespaceURI === Je &&
|
|
1905
|
+
tagName: z,
|
|
1906
|
+
allowedTags: K
|
|
1907
|
+
}), D && r.hasChildNodes() && !rn(r.firstElementChild) && we(/<[/\w!]/g, r.innerHTML) && we(/<[/\w!]/g, r.textContent) || D && r.namespaceURI === Je && z === "style" && rn(r.firstElementChild) || r.nodeType === et.progressingInstruction || D && r.nodeType === et.comment && we(/<[/\w]/g, r.data))
|
|
1913
1908
|
return We(r), !0;
|
|
1914
|
-
if (Be[
|
|
1915
|
-
if (!Be[
|
|
1909
|
+
if (Be[z] || !(be.tagCheck instanceof Function && be.tagCheck(z)) && !K[z]) {
|
|
1910
|
+
if (!Be[z] && os(z) && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck, z) || re.tagNameCheck instanceof Function && re.tagNameCheck(z)))
|
|
1916
1911
|
return !1;
|
|
1917
|
-
if (Fe && !m[
|
|
1918
|
-
const
|
|
1919
|
-
if (ce &&
|
|
1912
|
+
if (Fe && !m[z]) {
|
|
1913
|
+
const Y = Z(r), ce = O(r);
|
|
1914
|
+
if (ce && Y) {
|
|
1920
1915
|
const Ue = ce.length;
|
|
1921
1916
|
for (let Qe = Ue - 1; Qe >= 0; --Qe) {
|
|
1922
1917
|
const Ge = k(ce[Qe], !0);
|
|
1923
|
-
|
|
1918
|
+
Y.insertBefore(Ge, E(r));
|
|
1924
1919
|
}
|
|
1925
1920
|
}
|
|
1926
1921
|
}
|
|
1927
1922
|
return We(r), !0;
|
|
1928
1923
|
}
|
|
1929
|
-
return (
|
|
1930
|
-
x = Ct(x,
|
|
1924
|
+
return (N ? N(r) : r.nodeType) === et.element && !fa(r) || (z === "noscript" || z === "noembed" || z === "noframes") && we(/<\/no(script|embed|frames)/i, r.innerHTML) ? (We(r), !0) : (L && r.nodeType === et.text && (x = r.textContent, Rt([st, Ye, at], (Y) => {
|
|
1925
|
+
x = Ct(x, Y, " ");
|
|
1931
1926
|
}), r.textContent !== x && (Mt(t.removed, {
|
|
1932
1927
|
element: r.cloneNode()
|
|
1933
1928
|
}), r.textContent = x)), lt(se.afterSanitizeElements, r, null), !1);
|
|
1934
|
-
}, "_sanitizeElements"),
|
|
1935
|
-
if (rt[x] ||
|
|
1929
|
+
}, "_sanitizeElements"), ls = /* @__PURE__ */ d(function(r, x, z) {
|
|
1930
|
+
if (rt[x] || Ke && (x === "id" || x === "name") && (z in e || z in pa))
|
|
1936
1931
|
return !1;
|
|
1937
|
-
const ne = ie[x] ||
|
|
1932
|
+
const ne = ie[x] || be.attributeCheck instanceof Function && be.attributeCheck(x, r);
|
|
1938
1933
|
if (!(M && !rt[x] && we(Oe, x))) {
|
|
1939
1934
|
if (!(g && we(gt, x))) {
|
|
1940
1935
|
if (!ne || rt[x]) {
|
|
@@ -1942,15 +1937,15 @@ function Ks() {
|
|
|
1942
1937
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1943
1938
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1944
1939
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
1945
|
-
!(
|
|
1940
|
+
!(os(r) && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck, r) || re.tagNameCheck instanceof Function && re.tagNameCheck(r)) && (re.attributeNameCheck instanceof RegExp && we(re.attributeNameCheck, x) || re.attributeNameCheck instanceof Function && re.attributeNameCheck(x, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
1946
1941
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1947
|
-
x === "is" && re.allowCustomizedBuiltInElements && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck,
|
|
1942
|
+
x === "is" && re.allowCustomizedBuiltInElements && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck, z) || re.tagNameCheck instanceof Function && re.tagNameCheck(z)))
|
|
1948
1943
|
) return !1;
|
|
1949
1944
|
} else if (!oe[x]) {
|
|
1950
|
-
if (!we(Ce, Ct(
|
|
1951
|
-
if (!((x === "src" || x === "xlink:href" || x === "href") && r !== "script" && bs(
|
|
1952
|
-
if (!(u && !we(vt, Ct(
|
|
1953
|
-
if (
|
|
1945
|
+
if (!we(Ce, Ct(z, Me, ""))) {
|
|
1946
|
+
if (!((x === "src" || x === "xlink:href" || x === "href") && r !== "script" && bs(z, "data:") === 0 && ae[r])) {
|
|
1947
|
+
if (!(u && !we(vt, Ct(z, Me, "")))) {
|
|
1948
|
+
if (z)
|
|
1954
1949
|
return !1;
|
|
1955
1950
|
}
|
|
1956
1951
|
}
|
|
@@ -1959,14 +1954,14 @@ function Ks() {
|
|
|
1959
1954
|
}
|
|
1960
1955
|
}
|
|
1961
1956
|
return !0;
|
|
1962
|
-
}, "_isValidAttribute"),
|
|
1963
|
-
return !
|
|
1964
|
-
}, "_isBasicCustomElement"),
|
|
1957
|
+
}, "_isValidAttribute"), ma = G({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), os = /* @__PURE__ */ d(function(r) {
|
|
1958
|
+
return !ma[Zt(r)] && we(it, r);
|
|
1959
|
+
}, "_isBasicCustomElement"), cs = /* @__PURE__ */ d(function(r) {
|
|
1965
1960
|
lt(se.beforeSanitizeAttributes, r, null);
|
|
1966
1961
|
const x = r.attributes;
|
|
1967
1962
|
if (!x || an(r))
|
|
1968
1963
|
return;
|
|
1969
|
-
const
|
|
1964
|
+
const z = {
|
|
1970
1965
|
attrName: "",
|
|
1971
1966
|
attrValue: "",
|
|
1972
1967
|
keepAttr: !0,
|
|
@@ -1975,19 +1970,19 @@ function Ks() {
|
|
|
1975
1970
|
};
|
|
1976
1971
|
let ne = x.length;
|
|
1977
1972
|
for (; ne--; ) {
|
|
1978
|
-
const
|
|
1973
|
+
const Y = x[ne], ce = Y.name, Ue = Y.namespaceURI, Qe = Y.value, Ge = fe(ce), An = Qe;
|
|
1979
1974
|
let xe = ce === "value" ? An : xi(An);
|
|
1980
|
-
if (
|
|
1975
|
+
if (z.attrName = Ge, z.attrValue = xe, z.keepAttr = !0, z.forceKeepAttr = void 0, lt(se.uponSanitizeAttribute, r, z), xe = z.attrValue, je && (Ge === "id" || Ge === "name") && bs(xe, ze) !== 0 && (xt(ce, r), xe = ze + xe), D && we(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, xe)) {
|
|
1981
1976
|
xt(ce, r);
|
|
1982
1977
|
continue;
|
|
1983
1978
|
}
|
|
1984
|
-
if (Ge === "attributename" &&
|
|
1979
|
+
if (Ge === "attributename" && ys(xe, "href")) {
|
|
1985
1980
|
xt(ce, r);
|
|
1986
1981
|
continue;
|
|
1987
1982
|
}
|
|
1988
|
-
if (
|
|
1983
|
+
if (z.forceKeepAttr)
|
|
1989
1984
|
continue;
|
|
1990
|
-
if (!
|
|
1985
|
+
if (!z.keepAttr) {
|
|
1991
1986
|
xt(ce, r);
|
|
1992
1987
|
continue;
|
|
1993
1988
|
}
|
|
@@ -1995,16 +1990,16 @@ function Ks() {
|
|
|
1995
1990
|
xt(ce, r);
|
|
1996
1991
|
continue;
|
|
1997
1992
|
}
|
|
1998
|
-
|
|
1999
|
-
xe = Ct(xe,
|
|
1993
|
+
L && Rt([st, Ye, at], (ds) => {
|
|
1994
|
+
xe = Ct(xe, ds, " ");
|
|
2000
1995
|
});
|
|
2001
|
-
const
|
|
2002
|
-
if (!
|
|
1996
|
+
const us = fe(r.nodeName);
|
|
1997
|
+
if (!ls(us, Ge, xe)) {
|
|
2003
1998
|
xt(ce, r);
|
|
2004
1999
|
continue;
|
|
2005
2000
|
}
|
|
2006
2001
|
if (B && typeof R == "object" && typeof R.getAttributeType == "function" && !Ue)
|
|
2007
|
-
switch (R.getAttributeType(
|
|
2002
|
+
switch (R.getAttributeType(us, Ge)) {
|
|
2008
2003
|
case "TrustedHTML": {
|
|
2009
2004
|
xe = B.createHTML(xe);
|
|
2010
2005
|
break;
|
|
@@ -2016,7 +2011,7 @@ function Ks() {
|
|
|
2016
2011
|
}
|
|
2017
2012
|
if (xe !== An)
|
|
2018
2013
|
try {
|
|
2019
|
-
Ue ? r.setAttributeNS(Ue, ce, xe) : r.setAttribute(ce, xe), an(r) ? We(r) :
|
|
2014
|
+
Ue ? r.setAttributeNS(Ue, ce, xe) : r.setAttribute(ce, xe), an(r) ? We(r) : xs(t.removed);
|
|
2020
2015
|
} catch {
|
|
2021
2016
|
xt(ce, r);
|
|
2022
2017
|
}
|
|
@@ -2024,89 +2019,89 @@ function Ks() {
|
|
|
2024
2019
|
lt(se.afterSanitizeAttributes, r, null);
|
|
2025
2020
|
}, "_sanitizeAttributes"), ln = /* @__PURE__ */ d(function(r) {
|
|
2026
2021
|
let x = null;
|
|
2027
|
-
const
|
|
2028
|
-
for (lt(se.beforeSanitizeShadowDOM, r, null); x =
|
|
2029
|
-
if (lt(se.uponSanitizeShadowNode, x, null),
|
|
2030
|
-
const
|
|
2031
|
-
Ht(
|
|
2022
|
+
const z = as(r);
|
|
2023
|
+
for (lt(se.beforeSanitizeShadowDOM, r, null); x = z.nextNode(); )
|
|
2024
|
+
if (lt(se.uponSanitizeShadowNode, x, null), rs(x), cs(x), Ht(x.content) && ln(x.content), (N ? N(x) : x.nodeType) === et.element) {
|
|
2025
|
+
const Y = I ? I(x) : x.shadowRoot;
|
|
2026
|
+
Ht(Y) && (Et(Y), ln(Y));
|
|
2032
2027
|
}
|
|
2033
2028
|
lt(se.afterSanitizeShadowDOM, r, null);
|
|
2034
|
-
}, "_sanitizeShadowDOM"),
|
|
2035
|
-
const x =
|
|
2029
|
+
}, "_sanitizeShadowDOM"), Et = /* @__PURE__ */ d(function(r) {
|
|
2030
|
+
const x = N ? N(r) : r.nodeType;
|
|
2036
2031
|
if (x === et.element) {
|
|
2037
|
-
const
|
|
2038
|
-
Ht(
|
|
2032
|
+
const Y = I ? I(r) : r.shadowRoot;
|
|
2033
|
+
Ht(Y) && (Et(Y), ln(Y));
|
|
2039
2034
|
}
|
|
2040
|
-
const
|
|
2041
|
-
if (!
|
|
2035
|
+
const z = O ? O(r) : r.childNodes;
|
|
2036
|
+
if (!z)
|
|
2042
2037
|
return;
|
|
2043
2038
|
const ne = [];
|
|
2044
|
-
Rt(
|
|
2045
|
-
Mt(ne,
|
|
2039
|
+
Rt(z, (Y) => {
|
|
2040
|
+
Mt(ne, Y);
|
|
2046
2041
|
});
|
|
2047
|
-
for (const
|
|
2048
|
-
|
|
2042
|
+
for (const Y of ne)
|
|
2043
|
+
Et(Y);
|
|
2049
2044
|
if (x === et.element) {
|
|
2050
|
-
const
|
|
2051
|
-
if (typeof
|
|
2045
|
+
const Y = W ? W(r) : null;
|
|
2046
|
+
if (typeof Y == "string" && fe(Y) === "template") {
|
|
2052
2047
|
const ce = r.content;
|
|
2053
|
-
Ht(ce) &&
|
|
2048
|
+
Ht(ce) && Et(ce);
|
|
2054
2049
|
}
|
|
2055
2050
|
}
|
|
2056
2051
|
}, "_sanitizeAttachedShadowRoots");
|
|
2057
2052
|
return t.sanitize = function(F) {
|
|
2058
|
-
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, x = null,
|
|
2059
|
-
if (
|
|
2053
|
+
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, x = null, z = null, ne = null, Y = null;
|
|
2054
|
+
if (bn = !F, bn && (F = "<!-->"), typeof F != "string" && !rn(F) && (F = Ti(F), typeof F != "string"))
|
|
2060
2055
|
throw Gt("dirty is not a string, aborting");
|
|
2061
2056
|
if (!t.isSupported)
|
|
2062
2057
|
return F;
|
|
2063
2058
|
if (pe || Sn(r), t.removed = [], typeof F == "string" && (Xe = !1), Xe) {
|
|
2064
|
-
const Qe =
|
|
2059
|
+
const Qe = W ? W(F) : F.nodeName;
|
|
2065
2060
|
if (typeof Qe == "string") {
|
|
2066
2061
|
const Ge = fe(Qe);
|
|
2067
|
-
if (!
|
|
2062
|
+
if (!K[Ge] || Be[Ge])
|
|
2068
2063
|
throw Gt("root node is forbidden and cannot be sanitized in-place");
|
|
2069
2064
|
}
|
|
2070
2065
|
if (an(F))
|
|
2071
2066
|
throw Gt("root node is clobbered and cannot be sanitized in-place");
|
|
2072
|
-
|
|
2067
|
+
Et(F);
|
|
2073
2068
|
} else if (rn(F))
|
|
2074
|
-
x =
|
|
2069
|
+
x = ss("<!---->"), z = x.ownerDocument.importNode(F, !0), z.nodeType === et.element && z.nodeName === "BODY" || z.nodeName === "HTML" ? x = z : x.appendChild(z), Et(z);
|
|
2075
2070
|
else {
|
|
2076
|
-
if (!le &&
|
|
2071
|
+
if (!le && !L && !Q && // eslint-disable-next-line unicorn/prefer-includes
|
|
2077
2072
|
F.indexOf("<") === -1)
|
|
2078
2073
|
return B && $e ? B.createHTML(F) : F;
|
|
2079
|
-
if (x =
|
|
2074
|
+
if (x = ss(F), !x)
|
|
2080
2075
|
return le ? null : $e ? V : "";
|
|
2081
2076
|
}
|
|
2082
2077
|
x && ke && We(x.firstChild);
|
|
2083
|
-
const ce =
|
|
2078
|
+
const ce = as(Xe ? F : x);
|
|
2084
2079
|
for (; ne = ce.nextNode(); )
|
|
2085
|
-
|
|
2080
|
+
rs(ne), cs(ne), Ht(ne.content) && ln(ne.content);
|
|
2086
2081
|
if (Xe)
|
|
2087
|
-
return
|
|
2082
|
+
return L && is(F), F;
|
|
2088
2083
|
if (le) {
|
|
2089
|
-
if (
|
|
2090
|
-
for (
|
|
2091
|
-
|
|
2084
|
+
if (L && is(x), de)
|
|
2085
|
+
for (Y = Pe.call(x.ownerDocument); x.firstChild; )
|
|
2086
|
+
Y.appendChild(x.firstChild);
|
|
2092
2087
|
else
|
|
2093
|
-
|
|
2094
|
-
return (ie.shadowroot || ie.shadowrootmode) && (
|
|
2088
|
+
Y = x;
|
|
2089
|
+
return (ie.shadowroot || ie.shadowrootmode) && (Y = De.call(n, Y, !0)), Y;
|
|
2095
2090
|
}
|
|
2096
|
-
let Ue =
|
|
2097
|
-
return
|
|
2098
|
-
` + Ue),
|
|
2091
|
+
let Ue = Q ? x.outerHTML : x.innerHTML;
|
|
2092
|
+
return Q && K["!doctype"] && x.ownerDocument && x.ownerDocument.doctype && x.ownerDocument.doctype.name && we(Di, x.ownerDocument.doctype.name) && (Ue = "<!DOCTYPE " + x.ownerDocument.doctype.name + `>
|
|
2093
|
+
` + Ue), L && Rt([st, Ye, at], (Qe) => {
|
|
2099
2094
|
Ue = Ct(Ue, Qe, " ");
|
|
2100
2095
|
}), B && $e ? B.createHTML(Ue) : Ue;
|
|
2101
2096
|
}, t.setConfig = function() {
|
|
2102
2097
|
let F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2103
2098
|
Sn(F), pe = !0;
|
|
2104
2099
|
}, t.clearConfig = function() {
|
|
2105
|
-
|
|
2100
|
+
_t = null, pe = !1;
|
|
2106
2101
|
}, t.isValidAttribute = function(F, r, x) {
|
|
2107
|
-
|
|
2108
|
-
const
|
|
2109
|
-
return
|
|
2102
|
+
_t || Sn({});
|
|
2103
|
+
const z = fe(F), ne = fe(r);
|
|
2104
|
+
return ls(z, ne, x);
|
|
2110
2105
|
}, t.addHook = function(F, r) {
|
|
2111
2106
|
typeof r == "function" && Mt(se[F], r);
|
|
2112
2107
|
}, t.removeHook = function(F, r) {
|
|
@@ -2114,25 +2109,25 @@ function Ks() {
|
|
|
2114
2109
|
const x = gi(se[F], r);
|
|
2115
2110
|
return x === -1 ? void 0 : vi(se[F], x, 1)[0];
|
|
2116
2111
|
}
|
|
2117
|
-
return
|
|
2112
|
+
return xs(se[F]);
|
|
2118
2113
|
}, t.removeHooks = function(F) {
|
|
2119
2114
|
se[F] = [];
|
|
2120
2115
|
}, t.removeAllHooks = function() {
|
|
2121
|
-
se =
|
|
2116
|
+
se = Rs();
|
|
2122
2117
|
}, t;
|
|
2123
2118
|
}
|
|
2124
2119
|
d(Ks, "createDOMPurify");
|
|
2125
2120
|
var Pi = Ks();
|
|
2126
|
-
function
|
|
2121
|
+
function jn() {
|
|
2127
2122
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
2128
2123
|
}
|
|
2129
|
-
d(
|
|
2130
|
-
var Tt =
|
|
2131
|
-
function
|
|
2124
|
+
d(jn, "M");
|
|
2125
|
+
var Tt = jn();
|
|
2126
|
+
function Xs(a) {
|
|
2132
2127
|
Tt = a;
|
|
2133
2128
|
}
|
|
2134
|
-
d(
|
|
2135
|
-
var
|
|
2129
|
+
d(Xs, "N");
|
|
2130
|
+
var bt = { exec: /* @__PURE__ */ d(() => null, "exec") };
|
|
2136
2131
|
function It(a) {
|
|
2137
2132
|
let t = [];
|
|
2138
2133
|
return (e) => {
|
|
@@ -2155,16 +2150,16 @@ var Bi = ((a = "") => {
|
|
|
2155
2150
|
} catch {
|
|
2156
2151
|
return !1;
|
|
2157
2152
|
}
|
|
2158
|
-
})(), Se = { 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: It((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: It((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: It((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: It((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: It((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: It((a) => new RegExp(`^ {0,${a}}>`)) }, Fi = /^(?:[ \t]*(?:\n|$))+/, Ui = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Hi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, nn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ji = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
|
|
2159
|
-
]`).replace("lheading",
|
|
2153
|
+
})(), Se = { 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: It((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: It((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: It((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: It((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: It((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: It((a) => new RegExp(`^ {0,${a}}>`)) }, Fi = /^(?:[ \t]*(?:\n|$))+/, Ui = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Hi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, nn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ji = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Wn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Zs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Js = X(Zs).replace(/bull/g, Wn).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 = X(Zs).replace(/bull/g, Wn).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(), Gn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Gi = /^[^\n]+/, Vn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Vi = X(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Vn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), qi = X(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Wn).getRegex(), xn = "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", qn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Yi = X("^ {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", qn).replace("tag", xn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Qs = X(Gn).replace("hr", nn).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", xn).getRegex(), Ki = X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Qs).getRegex(), Yn = { blockquote: Ki, code: Ui, def: Vi, fences: Hi, heading: ji, hr: nn, html: Yi, lheading: Js, list: qi, newline: Fi, paragraph: Qs, table: bt, text: Gi }, Ms = X("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", nn).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", xn).getRegex(), Xi = { ...Yn, lheading: Wi, table: Ms, paragraph: X(Gn).replace("hr", nn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Ms).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", xn).getRegex() }, Zi = { ...Yn, html: X(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", qn).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: bt, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: X(Gn).replace("hr", nn).replace("heading", ` *#{1,6} *[^
|
|
2154
|
+
]`).replace("lheading", Js).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ji = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Qi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ea = /^( {2,}|\\)\n(?!\s*$)/, er = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ft = /[\p{P}\p{S}]/u, yn = /[\s\p{P}\p{S}]/u, Kn = /[^\s\p{P}\p{S}]/u, tr = X(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, yn).getRegex(), ta = /(?!~)[\p{P}\p{S}]/u, nr = /(?!~)[\s\p{P}\p{S}]/u, sr = /(?:[^\s\p{P}\p{S}]|~)/u, ar = X(/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(), na = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ir = X(na, "u").replace(/punct/g, Ft).getRegex(), rr = X(na, "u").replace(/punct/g, ta).getRegex(), sa = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", lr = X(sa, "gu").replace(/notPunctSpace/g, Kn).replace(/punctSpace/g, yn).replace(/punct/g, Ft).getRegex(), or = X(sa, "gu").replace(/notPunctSpace/g, sr).replace(/punctSpace/g, nr).replace(/punct/g, ta).getRegex(), cr = X("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Kn).replace(/punctSpace/g, yn).replace(/punct/g, Ft).getRegex(), ur = X(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ft).getRegex(), dr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", hr = X(dr, "gu").replace(/notPunctSpace/g, Kn).replace(/punctSpace/g, yn).replace(/punct/g, Ft).getRegex(), pr = X(/\\(punct)/, "gu").replace(/punct/g, Ft).getRegex(), fr = X(/^<(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(), mr = X(qn).replace("(?:-->|$)", "-->").getRegex(), gr = X("^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", mr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), fn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, vr = X(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", fn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), aa = X(/^!?\[(label)\]\[(ref)\]/).replace("label", fn).replace("ref", Vn).getRegex(), ia = X(/^!?\[(ref)\](?:\[\])?/).replace("ref", Vn).getRegex(), xr = X("reflink|nolink(?!\\()", "g").replace("reflink", aa).replace("nolink", ia).getRegex(), Cs = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Xn = { _backpedal: bt, anyPunctuation: pr, autolink: fr, blockSkip: ar, br: ea, code: Qi, del: bt, delLDelim: bt, delRDelim: bt, emStrongLDelim: ir, emStrongRDelimAst: lr, emStrongRDelimUnd: cr, escape: Ji, link: vr, nolink: ia, punctuation: tr, reflink: aa, reflinkSearch: xr, tag: gr, text: er, url: bt }, yr = { ...Xn, link: X(/^!?\[(label)\]\((.*?)\)/).replace("label", fn).getRegex(), reflink: X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", fn).getRegex() }, Un = { ...Xn, emStrongRDelimAst: or, emStrongLDelim: rr, delLDelim: ur, delRDelim: hr, url: X(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Cs).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: X(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Cs).getRegex() }, br = { ...Un, br: X(ea).replace("{2,}", "*").getRegex(), text: X(Un.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, un = { normal: Yn, gfm: Xi, pedantic: Zi }, Vt = { normal: Xn, gfm: Un, breaks: br, pedantic: yr }, kr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Is = /* @__PURE__ */ d((a) => kr[a], "ge");
|
|
2160
2155
|
function nt(a, t) {
|
|
2161
2156
|
if (t) {
|
|
2162
|
-
if (Se.escapeTest.test(a)) return a.replace(Se.escapeReplace,
|
|
2163
|
-
} else if (Se.escapeTestNoEncode.test(a)) return a.replace(Se.escapeReplaceNoEncode,
|
|
2157
|
+
if (Se.escapeTest.test(a)) return a.replace(Se.escapeReplace, Is);
|
|
2158
|
+
} else if (Se.escapeTestNoEncode.test(a)) return a.replace(Se.escapeReplaceNoEncode, Is);
|
|
2164
2159
|
return a;
|
|
2165
2160
|
}
|
|
2166
2161
|
d(nt, "O");
|
|
2167
|
-
function
|
|
2162
|
+
function $s(a) {
|
|
2168
2163
|
try {
|
|
2169
2164
|
a = encodeURI(a).replace(Se.percentDecode, "%");
|
|
2170
2165
|
} catch {
|
|
@@ -2172,8 +2167,8 @@ function Is(a) {
|
|
|
2172
2167
|
}
|
|
2173
2168
|
return a;
|
|
2174
2169
|
}
|
|
2175
|
-
d(
|
|
2176
|
-
function
|
|
2170
|
+
d($s, "V");
|
|
2171
|
+
function Ls(a, t) {
|
|
2177
2172
|
let e = a.replace(Se.findPipe, (s, l, o) => {
|
|
2178
2173
|
let p = !1, c = l;
|
|
2179
2174
|
for (; --c >= 0 && o[c] === "\\"; ) p = !p;
|
|
@@ -2184,7 +2179,7 @@ function $s(a, t) {
|
|
|
2184
2179
|
for (; i < n.length; i++) n[i] = n[i].trim().replace(Se.slashPipe, "|");
|
|
2185
2180
|
return n;
|
|
2186
2181
|
}
|
|
2187
|
-
d(
|
|
2182
|
+
d(Ls, "Y");
|
|
2188
2183
|
function ut(a, t, e) {
|
|
2189
2184
|
let n = a.length;
|
|
2190
2185
|
if (n === 0) return "";
|
|
@@ -2194,14 +2189,14 @@ function ut(a, t, e) {
|
|
|
2194
2189
|
return a.slice(0, n - i);
|
|
2195
2190
|
}
|
|
2196
2191
|
d(ut, "$");
|
|
2197
|
-
function
|
|
2192
|
+
function Ds(a) {
|
|
2198
2193
|
let t = a.split(`
|
|
2199
2194
|
`), e = t.length - 1;
|
|
2200
2195
|
for (; e >= 0 && Se.blankLine.test(t[e]); ) e--;
|
|
2201
2196
|
return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
|
|
2202
2197
|
`);
|
|
2203
2198
|
}
|
|
2204
|
-
d(
|
|
2199
|
+
d(Ds, "ee");
|
|
2205
2200
|
function wr(a, t) {
|
|
2206
2201
|
if (a.indexOf(t[1]) === -1) return -1;
|
|
2207
2202
|
let e = 0;
|
|
@@ -2220,13 +2215,13 @@ function Tr(a, t = 0) {
|
|
|
2220
2215
|
return n;
|
|
2221
2216
|
}
|
|
2222
2217
|
d(Tr, "me");
|
|
2223
|
-
function
|
|
2218
|
+
function Os(a, t, e, n, i) {
|
|
2224
2219
|
let s = t.href, l = t.title || null, o = a[1].replace(i.other.outputLinkReplace, "$1");
|
|
2225
2220
|
n.state.inLink = !0;
|
|
2226
2221
|
let p = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
|
|
2227
2222
|
return n.state.inLink = !1, p;
|
|
2228
2223
|
}
|
|
2229
|
-
d(
|
|
2224
|
+
d(Os, "xe");
|
|
2230
2225
|
function Sr(a, t, e) {
|
|
2231
2226
|
let n = a.match(e.other.indentCodeCompensation);
|
|
2232
2227
|
if (n === null) return t;
|
|
@@ -2255,7 +2250,7 @@ var zt, mn = (zt = class {
|
|
|
2255
2250
|
code(t) {
|
|
2256
2251
|
let e = this.rules.block.code.exec(t);
|
|
2257
2252
|
if (e) {
|
|
2258
|
-
let n = this.options.pedantic ? e[0] :
|
|
2253
|
+
let n = this.options.pedantic ? e[0] : Ds(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
2259
2254
|
return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
|
|
2260
2255
|
}
|
|
2261
2256
|
}
|
|
@@ -2295,27 +2290,27 @@ var zt, mn = (zt = class {
|
|
|
2295
2290
|
else if (!o) p.push(n[c]);
|
|
2296
2291
|
else break;
|
|
2297
2292
|
n = n.slice(c);
|
|
2298
|
-
let
|
|
2299
|
-
`), R =
|
|
2293
|
+
let b = p.join(`
|
|
2294
|
+
`), R = b.replace(this.rules.other.blockquoteSetextReplace, `
|
|
2300
2295
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
2301
2296
|
i = i ? `${i}
|
|
2302
|
-
${
|
|
2297
|
+
${b}` : b, s = s ? `${s}
|
|
2303
2298
|
${R}` : R;
|
|
2304
|
-
let
|
|
2305
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(R, l, !0), this.lexer.state.top =
|
|
2299
|
+
let y = this.lexer.state.top;
|
|
2300
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(R, l, !0), this.lexer.state.top = y, n.length === 0) break;
|
|
2306
2301
|
let k = l.at(-1);
|
|
2307
2302
|
if (k?.type === "code") break;
|
|
2308
2303
|
if (k?.type === "blockquote") {
|
|
2309
|
-
let A = k,
|
|
2304
|
+
let A = k, E = A.raw + `
|
|
2310
2305
|
` + n.join(`
|
|
2311
|
-
`),
|
|
2312
|
-
l[l.length - 1] =
|
|
2306
|
+
`), O = this.blockquote(E);
|
|
2307
|
+
l[l.length - 1] = O, i = i.substring(0, i.length - A.raw.length) + O.raw, s = s.substring(0, s.length - A.text.length) + O.text;
|
|
2313
2308
|
break;
|
|
2314
2309
|
} else if (k?.type === "list") {
|
|
2315
|
-
let A = k,
|
|
2310
|
+
let A = k, E = A.raw + `
|
|
2316
2311
|
` + n.join(`
|
|
2317
|
-
`),
|
|
2318
|
-
l[l.length - 1] =
|
|
2312
|
+
`), O = this.list(E);
|
|
2313
|
+
l[l.length - 1] = O, i = i.substring(0, i.length - k.raw.length) + O.raw, s = s.substring(0, s.length - A.raw.length) + O.raw, n = E.substring(l.at(-1).raw.length).split(`
|
|
2319
2314
|
`);
|
|
2320
2315
|
continue;
|
|
2321
2316
|
}
|
|
@@ -2330,31 +2325,31 @@ ${R}` : R;
|
|
|
2330
2325
|
n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
|
|
2331
2326
|
let l = this.rules.other.listItemRegex(n), o = !1;
|
|
2332
2327
|
for (; t; ) {
|
|
2333
|
-
let c = !1,
|
|
2328
|
+
let c = !1, b = "", R = "";
|
|
2334
2329
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
2335
|
-
|
|
2336
|
-
let
|
|
2330
|
+
b = e[0], t = t.substring(b.length);
|
|
2331
|
+
let y = Tr(e[2].split(`
|
|
2337
2332
|
`, 1)[0], e[1].length), k = t.split(`
|
|
2338
|
-
`, 1)[0], A = !
|
|
2339
|
-
if (this.options.pedantic ? (
|
|
2333
|
+
`, 1)[0], A = !y.trim(), E = 0;
|
|
2334
|
+
if (this.options.pedantic ? (E = 2, R = y.trimStart()) : A ? E = e[1].length + 1 : (E = y.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, R = y.slice(E), E += e[1].length), A && this.rules.other.blankLine.test(k) && (b += k + `
|
|
2340
2335
|
`, t = t.substring(k.length + 1), c = !0), !c) {
|
|
2341
|
-
let
|
|
2336
|
+
let O = this.rules.other.nextBulletRegex(E), Z = this.rules.other.hrRegex(E), I = this.rules.other.fencesBeginRegex(E), $ = this.rules.other.headingBeginRegex(E), N = this.rules.other.htmlBeginRegex(E), W = this.rules.other.blockquoteBeginRegex(E);
|
|
2342
2337
|
for (; t; ) {
|
|
2343
2338
|
let B = t.split(`
|
|
2344
2339
|
`, 1)[0], V;
|
|
2345
|
-
if (k = B, this.options.pedantic ? (k = k.replace(this.rules.other.listReplaceNesting, " "), V = k) : V = k.replace(this.rules.other.tabCharGlobal, " "),
|
|
2346
|
-
if (V.search(this.rules.other.nonSpaceChar) >=
|
|
2347
|
-
` + V.slice(
|
|
2340
|
+
if (k = B, this.options.pedantic ? (k = k.replace(this.rules.other.listReplaceNesting, " "), V = k) : V = k.replace(this.rules.other.tabCharGlobal, " "), I.test(k) || $.test(k) || N.test(k) || W.test(k) || O.test(k) || Z.test(k)) break;
|
|
2341
|
+
if (V.search(this.rules.other.nonSpaceChar) >= E || !k.trim()) R += `
|
|
2342
|
+
` + V.slice(E);
|
|
2348
2343
|
else {
|
|
2349
|
-
if (A ||
|
|
2344
|
+
if (A || y.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || I.test(y) || $.test(y) || Z.test(y)) break;
|
|
2350
2345
|
R += `
|
|
2351
2346
|
` + k;
|
|
2352
2347
|
}
|
|
2353
|
-
A = !k.trim(),
|
|
2354
|
-
`, t = t.substring(B.length + 1),
|
|
2348
|
+
A = !k.trim(), b += B + `
|
|
2349
|
+
`, t = t.substring(B.length + 1), y = V.slice(E);
|
|
2355
2350
|
}
|
|
2356
2351
|
}
|
|
2357
|
-
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(
|
|
2352
|
+
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(b) && (o = !0)), s.items.push({ type: "list_item", raw: b, task: !!this.options.gfm && this.rules.other.listIsTask.test(R), loose: !1, text: R, tokens: [] }), s.raw += b;
|
|
2358
2353
|
}
|
|
2359
2354
|
let p = s.items.at(-1);
|
|
2360
2355
|
if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
|
|
@@ -2362,27 +2357,27 @@ ${R}` : R;
|
|
|
2362
2357
|
s.raw = s.raw.trimEnd();
|
|
2363
2358
|
for (let c of s.items) {
|
|
2364
2359
|
this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []);
|
|
2365
|
-
let
|
|
2366
|
-
if (c.task && (
|
|
2367
|
-
c.text = c.text.replace(this.rules.other.listReplaceTask, ""),
|
|
2368
|
-
for (let
|
|
2369
|
-
this.lexer.inlineQueue[
|
|
2360
|
+
let b = c.tokens[0];
|
|
2361
|
+
if (c.task && (b?.type === "text" || b?.type === "paragraph")) {
|
|
2362
|
+
c.text = c.text.replace(this.rules.other.listReplaceTask, ""), b.raw = b.raw.replace(this.rules.other.listReplaceTask, ""), b.text = b.text.replace(this.rules.other.listReplaceTask, "");
|
|
2363
|
+
for (let y = this.lexer.inlineQueue.length - 1; y >= 0; y--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)) {
|
|
2364
|
+
this.lexer.inlineQueue[y].src = this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask, "");
|
|
2370
2365
|
break;
|
|
2371
2366
|
}
|
|
2372
2367
|
let R = this.rules.other.listTaskCheckbox.exec(c.raw);
|
|
2373
2368
|
if (R) {
|
|
2374
|
-
let
|
|
2375
|
-
c.checked =
|
|
2369
|
+
let y = { type: "checkbox", raw: R[0] + " ", checked: R[0] !== "[ ]" };
|
|
2370
|
+
c.checked = y.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 = y.raw + c.tokens[0].raw, c.tokens[0].text = y.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(y)) : c.tokens.unshift({ type: "paragraph", raw: y.raw, text: y.raw, tokens: [y] }) : c.tokens.unshift(y);
|
|
2376
2371
|
}
|
|
2377
2372
|
} else c.task && (c.task = !1);
|
|
2378
2373
|
if (!s.loose) {
|
|
2379
|
-
let R = c.tokens.filter((k) => k.type === "space"),
|
|
2380
|
-
s.loose =
|
|
2374
|
+
let R = c.tokens.filter((k) => k.type === "space"), y = R.length > 0 && R.some((k) => this.rules.other.anyLine.test(k.raw));
|
|
2375
|
+
s.loose = y;
|
|
2381
2376
|
}
|
|
2382
2377
|
}
|
|
2383
2378
|
if (s.loose) for (let c of s.items) {
|
|
2384
2379
|
c.loose = !0;
|
|
2385
|
-
for (let
|
|
2380
|
+
for (let b of c.tokens) b.type === "text" && (b.type = "paragraph");
|
|
2386
2381
|
}
|
|
2387
2382
|
return s;
|
|
2388
2383
|
}
|
|
@@ -2390,7 +2385,7 @@ ${R}` : R;
|
|
|
2390
2385
|
html(t) {
|
|
2391
2386
|
let e = this.rules.block.html.exec(t);
|
|
2392
2387
|
if (e) {
|
|
2393
|
-
let n =
|
|
2388
|
+
let n = Ds(e[0]);
|
|
2394
2389
|
return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
|
|
2395
2390
|
}
|
|
2396
2391
|
}
|
|
@@ -2405,13 +2400,13 @@ ${R}` : R;
|
|
|
2405
2400
|
table(t) {
|
|
2406
2401
|
let e = this.rules.block.table.exec(t);
|
|
2407
2402
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
2408
|
-
let n =
|
|
2403
|
+
let n = Ls(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
2409
2404
|
`) : [], l = { type: "table", raw: ut(e[0], `
|
|
2410
2405
|
`), header: [], align: [], rows: [] };
|
|
2411
2406
|
if (n.length === i.length) {
|
|
2412
2407
|
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);
|
|
2413
2408
|
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] });
|
|
2414
|
-
for (let o of s) l.rows.push(
|
|
2409
|
+
for (let o of s) l.rows.push(Ls(o, l.header.length).map((p, c) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[c] })));
|
|
2415
2410
|
return l;
|
|
2416
2411
|
}
|
|
2417
2412
|
}
|
|
@@ -2464,7 +2459,7 @@ ${R}` : R;
|
|
|
2464
2459
|
let l = this.rules.other.pedanticHrefTitle.exec(i);
|
|
2465
2460
|
l && (i = l[1], s = l[3]);
|
|
2466
2461
|
} else s = e[3] ? e[3].slice(1, -1) : "";
|
|
2467
|
-
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)),
|
|
2462
|
+
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)), Os(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);
|
|
2468
2463
|
}
|
|
2469
2464
|
}
|
|
2470
2465
|
reflink(t, e) {
|
|
@@ -2475,14 +2470,14 @@ ${R}` : R;
|
|
|
2475
2470
|
let l = n[0].charAt(0);
|
|
2476
2471
|
return { type: "text", raw: l, text: l };
|
|
2477
2472
|
}
|
|
2478
|
-
return
|
|
2473
|
+
return Os(n, s, n[0], this.lexer, this.rules);
|
|
2479
2474
|
}
|
|
2480
2475
|
}
|
|
2481
2476
|
emStrong(t, e, n = "") {
|
|
2482
2477
|
let i = this.rules.inline.emStrongLDelim.exec(t);
|
|
2483
2478
|
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))) {
|
|
2484
|
-
let s = [...i[0]].length - 1, l, o, p = s, c = 0,
|
|
2485
|
-
for (
|
|
2479
|
+
let s = [...i[0]].length - 1, l, o, p = s, c = 0, b = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
2480
|
+
for (b.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = b.exec(e)) !== null; ) {
|
|
2486
2481
|
if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l) continue;
|
|
2487
2482
|
if (o = [...l].length, i[3] || i[4]) {
|
|
2488
2483
|
p += o;
|
|
@@ -2493,13 +2488,13 @@ ${R}` : R;
|
|
|
2493
2488
|
}
|
|
2494
2489
|
if (p -= o, p > 0) continue;
|
|
2495
2490
|
o = Math.min(o, o + p + c);
|
|
2496
|
-
let R = [...i[0]][0].length,
|
|
2491
|
+
let R = [...i[0]][0].length, y = t.slice(0, s + i.index + R + o);
|
|
2497
2492
|
if (Math.min(s, o) % 2) {
|
|
2498
|
-
let A =
|
|
2499
|
-
return { type: "em", raw:
|
|
2493
|
+
let A = y.slice(1, -1);
|
|
2494
|
+
return { type: "em", raw: y, text: A, tokens: this.lexer.inlineTokens(A) };
|
|
2500
2495
|
}
|
|
2501
|
-
let k =
|
|
2502
|
-
return { type: "strong", raw:
|
|
2496
|
+
let k = y.slice(2, -2);
|
|
2497
|
+
return { type: "strong", raw: y, text: k, tokens: this.lexer.inlineTokens(k) };
|
|
2503
2498
|
}
|
|
2504
2499
|
}
|
|
2505
2500
|
}
|
|
@@ -2526,8 +2521,8 @@ ${R}` : R;
|
|
|
2526
2521
|
}
|
|
2527
2522
|
if (p -= o, p > 0) continue;
|
|
2528
2523
|
o = Math.min(o, o + p);
|
|
2529
|
-
let
|
|
2530
|
-
return { type: "del", raw: R, text:
|
|
2524
|
+
let b = [...i[0]][0].length, R = t.slice(0, s + i.index + b + o), y = R.slice(s, -s);
|
|
2525
|
+
return { type: "del", raw: R, text: y, tokens: this.lexer.inlineTokens(y) };
|
|
2531
2526
|
}
|
|
2532
2527
|
}
|
|
2533
2528
|
}
|
|
@@ -2660,8 +2655,8 @@ ${R}` : R;
|
|
|
2660
2655
|
let l = t;
|
|
2661
2656
|
if (this.options.extensions?.startBlock) {
|
|
2662
2657
|
let o = 1 / 0, p = t.slice(1), c;
|
|
2663
|
-
this.options.extensions.startBlock.forEach((
|
|
2664
|
-
c =
|
|
2658
|
+
this.options.extensions.startBlock.forEach((b) => {
|
|
2659
|
+
c = b.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
|
|
2665
2660
|
}), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
|
|
2666
2661
|
}
|
|
2667
2662
|
if (this.state.top && (s = this.tokenizer.paragraph(l))) {
|
|
@@ -2754,14 +2749,14 @@ ${R}` : R;
|
|
|
2754
2749
|
t = t.substring(c.raw.length), e.push(c);
|
|
2755
2750
|
continue;
|
|
2756
2751
|
}
|
|
2757
|
-
let
|
|
2752
|
+
let b = t;
|
|
2758
2753
|
if (this.options.extensions?.startInline) {
|
|
2759
|
-
let R = 1 / 0,
|
|
2754
|
+
let R = 1 / 0, y = t.slice(1), k;
|
|
2760
2755
|
this.options.extensions.startInline.forEach((A) => {
|
|
2761
|
-
k = A.call({ lexer: this },
|
|
2762
|
-
}), R < 1 / 0 && R >= 0 && (
|
|
2756
|
+
k = A.call({ lexer: this }, y), typeof k == "number" && k >= 0 && (R = Math.min(R, k));
|
|
2757
|
+
}), R < 1 / 0 && R >= 0 && (b = t.substring(0, R + 1));
|
|
2763
2758
|
}
|
|
2764
|
-
if (c = this.tokenizer.inlineText(
|
|
2759
|
+
if (c = this.tokenizer.inlineText(b)) {
|
|
2765
2760
|
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
|
|
2766
2761
|
let R = e.at(-1);
|
|
2767
2762
|
R?.type === "text" ? (R.raw += c.raw, R.text += c.text) : e.push(c);
|
|
@@ -2879,7 +2874,7 @@ ${t}</tr>
|
|
|
2879
2874
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
2880
2875
|
}
|
|
2881
2876
|
link({ href: t, title: e, tokens: n }) {
|
|
2882
|
-
let i = this.parser.parseInline(n), s =
|
|
2877
|
+
let i = this.parser.parseInline(n), s = $s(t);
|
|
2883
2878
|
if (s === null) return i;
|
|
2884
2879
|
t = s;
|
|
2885
2880
|
let l = '<a href="' + t + '"';
|
|
@@ -2887,7 +2882,7 @@ ${t}</tr>
|
|
|
2887
2882
|
}
|
|
2888
2883
|
image({ href: t, title: e, text: n, tokens: i }) {
|
|
2889
2884
|
i && (n = this.parser.parseInline(i, this.parser.textRenderer));
|
|
2890
|
-
let s =
|
|
2885
|
+
let s = $s(t);
|
|
2891
2886
|
if (s === null) return nt(n);
|
|
2892
2887
|
t = s;
|
|
2893
2888
|
let l = `<img src="${t}" alt="${nt(n)}"`;
|
|
@@ -2896,7 +2891,7 @@ ${t}</tr>
|
|
|
2896
2891
|
text(t) {
|
|
2897
2892
|
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : nt(t.text);
|
|
2898
2893
|
}
|
|
2899
|
-
}, d(Nt, "y"), Nt), Pt,
|
|
2894
|
+
}, d(Nt, "y"), Nt), Pt, Zn = (Pt = class {
|
|
2900
2895
|
strong({ text: t }) {
|
|
2901
2896
|
return t;
|
|
2902
2897
|
}
|
|
@@ -2932,7 +2927,7 @@ ${t}</tr>
|
|
|
2932
2927
|
P(this, "options");
|
|
2933
2928
|
P(this, "renderer");
|
|
2934
2929
|
P(this, "textRenderer");
|
|
2935
|
-
this.options = t || Tt, this.options.renderer = this.options.renderer || new gn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new
|
|
2930
|
+
this.options = t || Tt, this.options.renderer = this.options.renderer || new gn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Zn();
|
|
2936
2931
|
}
|
|
2937
2932
|
static parse(t, e) {
|
|
2938
2933
|
return new mt(e).parse(t);
|
|
@@ -3104,13 +3099,13 @@ ${t}</tr>
|
|
|
3104
3099
|
}
|
|
3105
3100
|
}, d(pt, "P"), P(pt, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), P(pt, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), pt), Bt, Ar = (Bt = class {
|
|
3106
3101
|
constructor(...t) {
|
|
3107
|
-
P(this, "defaults",
|
|
3102
|
+
P(this, "defaults", jn());
|
|
3108
3103
|
P(this, "options", this.setOptions);
|
|
3109
3104
|
P(this, "parse", this.parseMarkdown(!0));
|
|
3110
3105
|
P(this, "parseInline", this.parseMarkdown(!1));
|
|
3111
3106
|
P(this, "Parser", qe);
|
|
3112
3107
|
P(this, "Renderer", gn);
|
|
3113
|
-
P(this, "TextRenderer",
|
|
3108
|
+
P(this, "TextRenderer", Zn);
|
|
3114
3109
|
P(this, "Lexer", Ve);
|
|
3115
3110
|
P(this, "Tokenizer", mn);
|
|
3116
3111
|
P(this, "Hooks", Jt);
|
|
@@ -3165,9 +3160,9 @@ ${t}</tr>
|
|
|
3165
3160
|
if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
|
|
3166
3161
|
if (["options", "parser"].includes(l)) continue;
|
|
3167
3162
|
let o = l, p = n.renderer[o], c = s[o];
|
|
3168
|
-
s[o] = (...
|
|
3169
|
-
let R = p.apply(s,
|
|
3170
|
-
return R === !1 && (R = c.apply(s,
|
|
3163
|
+
s[o] = (...b) => {
|
|
3164
|
+
let R = p.apply(s, b);
|
|
3165
|
+
return R === !1 && (R = c.apply(s, b)), R || "";
|
|
3171
3166
|
};
|
|
3172
3167
|
}
|
|
3173
3168
|
i.renderer = s;
|
|
@@ -3178,9 +3173,9 @@ ${t}</tr>
|
|
|
3178
3173
|
if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
|
|
3179
3174
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
3180
3175
|
let o = l, p = n.tokenizer[o], c = s[o];
|
|
3181
|
-
s[o] = (...
|
|
3182
|
-
let R = p.apply(s,
|
|
3183
|
-
return R === !1 && (R = c.apply(s,
|
|
3176
|
+
s[o] = (...b) => {
|
|
3177
|
+
let R = p.apply(s, b);
|
|
3178
|
+
return R === !1 && (R = c.apply(s, b)), R;
|
|
3184
3179
|
};
|
|
3185
3180
|
}
|
|
3186
3181
|
i.tokenizer = s;
|
|
@@ -3191,20 +3186,20 @@ ${t}</tr>
|
|
|
3191
3186
|
if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
|
|
3192
3187
|
if (["options", "block"].includes(l)) continue;
|
|
3193
3188
|
let o = l, p = n.hooks[o], c = s[o];
|
|
3194
|
-
Jt.passThroughHooks.has(l) ? s[o] = (
|
|
3189
|
+
Jt.passThroughHooks.has(l) ? s[o] = (b) => {
|
|
3195
3190
|
if (this.defaults.async && Jt.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
3196
|
-
let
|
|
3197
|
-
return c.call(s,
|
|
3191
|
+
let y = await p.call(s, b);
|
|
3192
|
+
return c.call(s, y);
|
|
3198
3193
|
})();
|
|
3199
|
-
let R = p.call(s,
|
|
3194
|
+
let R = p.call(s, b);
|
|
3200
3195
|
return c.call(s, R);
|
|
3201
|
-
} : s[o] = (...
|
|
3196
|
+
} : s[o] = (...b) => {
|
|
3202
3197
|
if (this.defaults.async) return (async () => {
|
|
3203
|
-
let
|
|
3204
|
-
return
|
|
3198
|
+
let y = await p.apply(s, b);
|
|
3199
|
+
return y === !1 && (y = await c.apply(s, b)), y;
|
|
3205
3200
|
})();
|
|
3206
|
-
let R = p.apply(s,
|
|
3207
|
-
return R === !1 && (R = c.apply(s,
|
|
3201
|
+
let R = p.apply(s, b);
|
|
3202
|
+
return R === !1 && (R = c.apply(s, b)), R;
|
|
3208
3203
|
};
|
|
3209
3204
|
}
|
|
3210
3205
|
i.hooks = s;
|
|
@@ -3237,8 +3232,8 @@ ${t}</tr>
|
|
|
3237
3232
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
|
|
3238
3233
|
let o = s.hooks ? await s.hooks.preprocess(e) : e, p = await (s.hooks ? await s.hooks.provideLexer(t) : t ? Ve.lex : Ve.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
|
|
3239
3234
|
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
3240
|
-
let
|
|
3241
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
3235
|
+
let b = await (s.hooks ? await s.hooks.provideParser(t) : t ? qe.parse : qe.parseInline)(c, s);
|
|
3236
|
+
return s.hooks ? await s.hooks.postprocess(b) : b;
|
|
3242
3237
|
})().catch(l);
|
|
3243
3238
|
try {
|
|
3244
3239
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
@@ -3268,12 +3263,12 @@ function te(a, t) {
|
|
|
3268
3263
|
}
|
|
3269
3264
|
d(te, "g");
|
|
3270
3265
|
te.options = te.setOptions = function(a) {
|
|
3271
|
-
return wt.setOptions(a), te.defaults = wt.defaults,
|
|
3266
|
+
return wt.setOptions(a), te.defaults = wt.defaults, Xs(te.defaults), te;
|
|
3272
3267
|
};
|
|
3273
|
-
te.getDefaults =
|
|
3268
|
+
te.getDefaults = jn;
|
|
3274
3269
|
te.defaults = Tt;
|
|
3275
3270
|
te.use = function(...a) {
|
|
3276
|
-
return wt.use(...a), te.defaults = wt.defaults,
|
|
3271
|
+
return wt.use(...a), te.defaults = wt.defaults, Xs(te.defaults), te;
|
|
3277
3272
|
};
|
|
3278
3273
|
te.walkTokens = function(a, t) {
|
|
3279
3274
|
return wt.walkTokens(a, t);
|
|
@@ -3282,7 +3277,7 @@ te.parseInline = wt.parseInline;
|
|
|
3282
3277
|
te.Parser = qe;
|
|
3283
3278
|
te.parser = qe.parse;
|
|
3284
3279
|
te.Renderer = gn;
|
|
3285
|
-
te.TextRenderer =
|
|
3280
|
+
te.TextRenderer = Zn;
|
|
3286
3281
|
te.Lexer = Ve;
|
|
3287
3282
|
te.lexer = Ve.lex;
|
|
3288
3283
|
te.Tokenizer = mn;
|
|
@@ -3295,12 +3290,12 @@ te.walkTokens;
|
|
|
3295
3290
|
te.parseInline;
|
|
3296
3291
|
qe.parse;
|
|
3297
3292
|
Ve.lex;
|
|
3298
|
-
const $t = 112, Lt = 46, dt = 14, qt = 54,
|
|
3299
|
-
function
|
|
3293
|
+
const $t = 112, Lt = 46, dt = 14, qt = 54, Yt = 26;
|
|
3294
|
+
function _r(a) {
|
|
3300
3295
|
return a.layout === "left-to-right" || a.layout === "radial" ? "horizontal" : a.layout === "top-to-bottom" ? "vertical" : a.diagramType === "sequence" ? "horizontal" : "vertical";
|
|
3301
3296
|
}
|
|
3302
|
-
d(
|
|
3303
|
-
function
|
|
3297
|
+
d(_r, "orientationFor");
|
|
3298
|
+
function Er(a) {
|
|
3304
3299
|
const t = new Set(a.nodes.map((l) => l.id)), e = new Set(a.edges.map((l) => l.to)), n = a.nodes.map((l) => l.id).filter((l) => !e.has(l)), i = /* @__PURE__ */ new Map();
|
|
3305
3300
|
for (const l of n.length ? n : a.nodes.slice(0, 1).map((o) => o.id))
|
|
3306
3301
|
i.set(l, 0);
|
|
@@ -3312,8 +3307,8 @@ function _r(a) {
|
|
|
3312
3307
|
const c = i.get(p.from);
|
|
3313
3308
|
if (c === void 0)
|
|
3314
3309
|
continue;
|
|
3315
|
-
const
|
|
3316
|
-
(i.get(p.to) ?? -1) <
|
|
3310
|
+
const b = c + 1;
|
|
3311
|
+
(i.get(p.to) ?? -1) < b && (i.set(p.to, b), o = !0);
|
|
3317
3312
|
}
|
|
3318
3313
|
if (!o)
|
|
3319
3314
|
break;
|
|
@@ -3323,57 +3318,57 @@ function _r(a) {
|
|
|
3323
3318
|
i.has(l.id) || i.set(l.id, ++s);
|
|
3324
3319
|
return i;
|
|
3325
3320
|
}
|
|
3326
|
-
d(
|
|
3321
|
+
d(Er, "levelsFor");
|
|
3327
3322
|
function Rr(a) {
|
|
3328
|
-
const t =
|
|
3329
|
-
for (const
|
|
3330
|
-
const k = e.get(
|
|
3331
|
-
n.set(k, [...n.get(k) ?? [],
|
|
3332
|
-
}
|
|
3333
|
-
const i = [...n.entries()].sort(([
|
|
3334
|
-
for (const [
|
|
3335
|
-
const A = (s - k.length) * (t === "horizontal" ? Lt +
|
|
3336
|
-
for (const [
|
|
3337
|
-
const Z = t === "horizontal" ? dt +
|
|
3323
|
+
const t = _r(a), e = Er(a), n = /* @__PURE__ */ new Map();
|
|
3324
|
+
for (const y of a.nodes) {
|
|
3325
|
+
const k = e.get(y.id) ?? 0;
|
|
3326
|
+
n.set(k, [...n.get(k) ?? [], y]);
|
|
3327
|
+
}
|
|
3328
|
+
const i = [...n.entries()].sort(([y], [k]) => y - k), s = Math.max(1, ...i.map(([, y]) => y.length)), l = Math.max(1, i.length), o = t === "horizontal" ? dt * 2 + l * $t + (l - 1) * qt : dt * 2 + s * $t + (s - 1) * qt, p = t === "horizontal" ? dt * 2 + s * Lt + (s - 1) * Yt : dt * 2 + l * Lt + (l - 1) * Yt, c = [];
|
|
3329
|
+
for (const [y, [, k]] of i.entries()) {
|
|
3330
|
+
const A = (s - k.length) * (t === "horizontal" ? Lt + Yt : $t + qt) / 2;
|
|
3331
|
+
for (const [E, O] of k.entries()) {
|
|
3332
|
+
const Z = t === "horizontal" ? dt + y * ($t + qt) : dt + A + E * ($t + qt), I = t === "horizontal" ? dt + A + E * (Lt + Yt) : dt + y * (Lt + Yt);
|
|
3338
3333
|
c.push({
|
|
3339
|
-
id:
|
|
3340
|
-
label:
|
|
3341
|
-
...
|
|
3342
|
-
...
|
|
3334
|
+
id: O.id,
|
|
3335
|
+
label: O.label,
|
|
3336
|
+
...O.detail ? { detail: O.detail } : {},
|
|
3337
|
+
...O.kind ? { kind: O.kind } : {},
|
|
3343
3338
|
x: Z,
|
|
3344
|
-
y:
|
|
3339
|
+
y: I,
|
|
3345
3340
|
width: $t,
|
|
3346
3341
|
height: Lt
|
|
3347
3342
|
});
|
|
3348
3343
|
}
|
|
3349
3344
|
}
|
|
3350
|
-
const
|
|
3351
|
-
const A =
|
|
3352
|
-
if (!A || !
|
|
3345
|
+
const b = new Map(c.map((y) => [y.id, y])), R = a.edges.flatMap((y, k) => {
|
|
3346
|
+
const A = b.get(y.from), E = b.get(y.to);
|
|
3347
|
+
if (!A || !E)
|
|
3353
3348
|
return [];
|
|
3354
|
-
const
|
|
3349
|
+
const O = t === "horizontal" ? A.x + A.width : A.x + A.width / 2, Z = t === "horizontal" ? A.y + A.height / 2 : A.y + A.height, I = t === "horizontal" ? E.x : E.x + E.width / 2, $ = t === "horizontal" ? E.y + E.height / 2 : E.y;
|
|
3355
3350
|
return [{
|
|
3356
|
-
key: `${
|
|
3357
|
-
from:
|
|
3358
|
-
to:
|
|
3359
|
-
...
|
|
3360
|
-
x1:
|
|
3351
|
+
key: `${y.from}-${y.to}-${k}`,
|
|
3352
|
+
from: y.from,
|
|
3353
|
+
to: y.to,
|
|
3354
|
+
...y.label ? { label: y.label } : {},
|
|
3355
|
+
x1: O,
|
|
3361
3356
|
y1: Z,
|
|
3362
|
-
x2:
|
|
3363
|
-
y2:
|
|
3364
|
-
labelX: (
|
|
3365
|
-
labelY: (Z +
|
|
3357
|
+
x2: I,
|
|
3358
|
+
y2: $,
|
|
3359
|
+
labelX: (O + I) / 2,
|
|
3360
|
+
labelY: (Z + $) / 2
|
|
3366
3361
|
}];
|
|
3367
3362
|
});
|
|
3368
3363
|
return { width: o, height: p, orientation: t, nodes: c, edges: R };
|
|
3369
3364
|
}
|
|
3370
3365
|
d(Rr, "layoutChatDiagram");
|
|
3371
|
-
function
|
|
3366
|
+
function ra(a) {
|
|
3372
3367
|
const { value: t } = a, e = Math.abs(t);
|
|
3373
3368
|
return e >= 1e6 ? `${(t / 1e6).toFixed(1).replace(/\.0$/, "")}M` : e >= 1e3 ? `${(t / 1e3).toFixed(1).replace(/\.0$/, "")}k` : Number.isInteger(t) ? `${t}` : t.toFixed(1);
|
|
3374
3369
|
}
|
|
3375
|
-
d(
|
|
3376
|
-
function
|
|
3370
|
+
d(ra, "formatChatVisualValue");
|
|
3371
|
+
function la(a) {
|
|
3377
3372
|
const { seconds: t } = a, e = Math.round(Math.abs(t)), n = t < 0 ? "-" : "";
|
|
3378
3373
|
if (e < 60)
|
|
3379
3374
|
return `${n}${e}s`;
|
|
@@ -3384,33 +3379,33 @@ function ra(a) {
|
|
|
3384
3379
|
const i = Math.floor(e / 3600), s = Math.floor(e % 3600 / 60);
|
|
3385
3380
|
return s ? `${n}${i}h ${s}m` : `${n}${i}h`;
|
|
3386
3381
|
}
|
|
3387
|
-
d(
|
|
3388
|
-
function
|
|
3382
|
+
d(la, "formatChatVisualDuration");
|
|
3383
|
+
function oa(a) {
|
|
3389
3384
|
return {
|
|
3390
3385
|
prefix: a?.valuePrefix ?? (a?.valueFormat === "currency" ? "$" : ""),
|
|
3391
3386
|
suffix: a?.valueSuffix ?? (a?.valueFormat === "percent" ? "%" : "")
|
|
3392
3387
|
};
|
|
3393
3388
|
}
|
|
3394
|
-
d(
|
|
3395
|
-
function
|
|
3396
|
-
const { value: t, series: e } = a, { prefix: n, suffix: i } =
|
|
3389
|
+
d(oa, "affixes");
|
|
3390
|
+
function On(a) {
|
|
3391
|
+
const { value: t, series: e } = a, { prefix: n, suffix: i } = oa(e);
|
|
3397
3392
|
let s;
|
|
3398
3393
|
switch (e?.valueFormat) {
|
|
3399
3394
|
case "integer":
|
|
3400
3395
|
s = `${Math.round(t)}`;
|
|
3401
3396
|
break;
|
|
3402
3397
|
case "duration":
|
|
3403
|
-
s =
|
|
3398
|
+
s = la({ seconds: t });
|
|
3404
3399
|
break;
|
|
3405
3400
|
case "raw":
|
|
3406
3401
|
s = Number.isInteger(t) ? `${t}` : t.toFixed(1);
|
|
3407
3402
|
break;
|
|
3408
3403
|
default:
|
|
3409
|
-
s =
|
|
3404
|
+
s = ra({ value: t });
|
|
3410
3405
|
}
|
|
3411
3406
|
return `${n}${s}${i}`;
|
|
3412
3407
|
}
|
|
3413
|
-
d(
|
|
3408
|
+
d(On, "formatChatVisualSeriesValue");
|
|
3414
3409
|
function Mr(a) {
|
|
3415
3410
|
const [t, ...e] = a.series;
|
|
3416
3411
|
return t && e.every(
|
|
@@ -3421,30 +3416,30 @@ d(Mr, "resolveSharedSeriesFormat");
|
|
|
3421
3416
|
function Cr(a) {
|
|
3422
3417
|
const { value: t, shared: e } = a;
|
|
3423
3418
|
if (e?.valueFormat === "duration")
|
|
3424
|
-
return
|
|
3425
|
-
const { prefix: n, suffix: i } =
|
|
3426
|
-
return `${n}${
|
|
3419
|
+
return la({ seconds: t });
|
|
3420
|
+
const { prefix: n, suffix: i } = oa(e);
|
|
3421
|
+
return `${n}${ra({ value: t })}${i}`;
|
|
3427
3422
|
}
|
|
3428
3423
|
d(Cr, "formatChatVisualTick");
|
|
3429
|
-
const Ir = 5.4, $r = 10, Lr = 15,
|
|
3424
|
+
const Ir = 5.4, $r = 10, Lr = 15, zs = 16, Dr = -40, Ns = 36;
|
|
3430
3425
|
function Or(a) {
|
|
3431
3426
|
const { labels: t, plotWidth: e } = a;
|
|
3432
3427
|
if (!t.length || e <= 0)
|
|
3433
3428
|
return { mode: "horizontal", entries: [] };
|
|
3434
|
-
const n = t.map((c) => c.length >
|
|
3429
|
+
const n = t.map((c) => c.length > zs ? `${c.slice(0, zs - 1).trimEnd()}…` : c), i = t.length - 1;
|
|
3435
3430
|
if (i === 0)
|
|
3436
3431
|
return { mode: "horizontal", entries: [{ index: 0, text: n[0] }] };
|
|
3437
3432
|
if ((Math.max(...n.map((c) => c.length * Ir)) + $r) * t.length <= e)
|
|
3438
|
-
return { mode: "horizontal", entries: n.map((c,
|
|
3433
|
+
return { mode: "horizontal", entries: n.map((c, b) => ({ index: b, text: c })) };
|
|
3439
3434
|
const l = Math.max(2, Math.floor(e / Lr));
|
|
3440
3435
|
if (t.length <= l)
|
|
3441
|
-
return { mode: "angled", entries: n.map((c,
|
|
3436
|
+
return { mode: "angled", entries: n.map((c, b) => ({ index: b, text: c })) };
|
|
3442
3437
|
const o = /* @__PURE__ */ new Set([0, i]), p = i / (l - 1);
|
|
3443
3438
|
for (let c = 1; c < l - 1; c++)
|
|
3444
3439
|
o.add(Math.round(c * p));
|
|
3445
3440
|
return {
|
|
3446
3441
|
mode: "angled",
|
|
3447
|
-
entries: [...o].sort((c,
|
|
3442
|
+
entries: [...o].sort((c, b) => c - b).map((c) => ({ index: c, text: n[c] }))
|
|
3448
3443
|
};
|
|
3449
3444
|
}
|
|
3450
3445
|
d(Or, "planChatVisualXLabels");
|
|
@@ -3452,7 +3447,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3452
3447
|
key: 0,
|
|
3453
3448
|
"data-test": "chat-visual-horizontal-bars",
|
|
3454
3449
|
class: "grid gap-3"
|
|
3455
|
-
}, Fr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Ur = ["viewBox"], Hr = ["x1", "x2", "y1", "y2"], jr = ["x", "y"], Wr = ["data-row-index", "data-series-index", "data-data-key", "x", "y", "width", "height"], Gr = ["data-trend-key", "d"], Vr = ["d"], qr = ["cx", "cy"],
|
|
3450
|
+
}, Fr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Ur = ["viewBox"], Hr = ["x1", "x2", "y1", "y2"], jr = ["x", "y"], Wr = ["data-row-index", "data-series-index", "data-data-key", "x", "y", "width", "height"], Gr = ["data-trend-key", "d"], Vr = ["d"], qr = ["cx", "cy"], Yr = ["cx", "cy"], Kr = ["x", "y", "text-anchor", "transform"], Xr = {
|
|
3456
3451
|
key: 2,
|
|
3457
3452
|
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
3458
3453
|
}, Zr = {
|
|
@@ -3477,11 +3472,11 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3477
3472
|
return g?.chartType === "pie";
|
|
3478
3473
|
}
|
|
3479
3474
|
d(l, "isPieChart");
|
|
3480
|
-
const o = S(() => n.value?.data ?? []), p = S(() => s(n.value) ? n.value : null), c = S(() => p.value?.series ?? []),
|
|
3481
|
-
function
|
|
3475
|
+
const o = S(() => n.value?.data ?? []), p = S(() => s(n.value) ? n.value : null), c = S(() => p.value?.series ?? []), b = S(() => l(n.value) ? n.value : null), R = S(() => p.value?.chartType === "bar" && p.value.stacking === "stacked");
|
|
3476
|
+
function y(g) {
|
|
3482
3477
|
return typeof g == "number" && Number.isFinite(g) ? g : null;
|
|
3483
3478
|
}
|
|
3484
|
-
d(
|
|
3479
|
+
d(y, "numericValue");
|
|
3485
3480
|
function k(g, M) {
|
|
3486
3481
|
return String(g[M] ?? "").trim();
|
|
3487
3482
|
}
|
|
@@ -3490,69 +3485,69 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3490
3485
|
const u = g.map((D) => k(D, M)).filter(Boolean);
|
|
3491
3486
|
if (!u.length)
|
|
3492
3487
|
return !1;
|
|
3493
|
-
const v = Math.max(...u.map((D) => D.length)),
|
|
3494
|
-
return v >= 16 || u.length > 5 &&
|
|
3488
|
+
const v = Math.max(...u.map((D) => D.length)), L = u.reduce((D, Q) => D + Q.length, 0) / u.length;
|
|
3489
|
+
return v >= 16 || u.length > 5 && L >= 10;
|
|
3495
3490
|
}
|
|
3496
3491
|
d(A, "hasLongCategoryLabels");
|
|
3497
|
-
function
|
|
3492
|
+
function E(g, M) {
|
|
3498
3493
|
return g.data.map((u, v) => {
|
|
3499
|
-
const
|
|
3500
|
-
return
|
|
3494
|
+
const L = y(u[M]);
|
|
3495
|
+
return L === null ? null : { index: v, value: L };
|
|
3501
3496
|
}).filter((u) => u !== null);
|
|
3502
3497
|
}
|
|
3503
|
-
d(
|
|
3504
|
-
function
|
|
3498
|
+
d(E, "trendLinePoints");
|
|
3499
|
+
function O(g) {
|
|
3505
3500
|
if (g.length < 2) return null;
|
|
3506
|
-
const M = g.length, u = g.reduce((le, de) => le + de.index, 0), v = g.reduce((le, de) => le + de.value, 0),
|
|
3507
|
-
if (
|
|
3508
|
-
const pe = (M * D - u * v) /
|
|
3501
|
+
const M = g.length, u = g.reduce((le, de) => le + de.index, 0), v = g.reduce((le, de) => le + de.value, 0), L = g.reduce((le, de) => le + de.index * de.index, 0), D = g.reduce((le, de) => le + de.index * de.value, 0), Q = M * L - u * u;
|
|
3502
|
+
if (Q === 0) return null;
|
|
3503
|
+
const pe = (M * D - u * v) / Q, ke = (v - pe * u) / M;
|
|
3509
3504
|
return { slope: pe, intercept: ke };
|
|
3510
3505
|
}
|
|
3511
|
-
d(
|
|
3506
|
+
d(O, "linearTrend");
|
|
3512
3507
|
const Z = S(() => {
|
|
3513
3508
|
const g = [], M = p.value;
|
|
3514
3509
|
if (!M) return g;
|
|
3515
3510
|
if (M.chartType === "bar" && M.stacking === "stacked")
|
|
3516
3511
|
for (const u of M.data) {
|
|
3517
|
-
let v = 0,
|
|
3512
|
+
let v = 0, L = 0;
|
|
3518
3513
|
for (const D of M.series) {
|
|
3519
|
-
const
|
|
3520
|
-
|
|
3514
|
+
const Q = y(u[D.dataKey]);
|
|
3515
|
+
Q !== null && (Q >= 0 ? v += Q : L += Q);
|
|
3521
3516
|
}
|
|
3522
|
-
g.push(v,
|
|
3517
|
+
g.push(v, L);
|
|
3523
3518
|
}
|
|
3524
3519
|
else
|
|
3525
3520
|
for (const u of M.data)
|
|
3526
3521
|
for (const v of M.series) {
|
|
3527
|
-
const
|
|
3528
|
-
|
|
3522
|
+
const L = y(u[v.dataKey]);
|
|
3523
|
+
L !== null && g.push(L);
|
|
3529
3524
|
}
|
|
3530
3525
|
if (M.trendLine && (M.chartType === "line" || M.chartType === "scatter")) {
|
|
3531
|
-
const u =
|
|
3532
|
-
g.push(...u.map((
|
|
3533
|
-
const v =
|
|
3526
|
+
const u = E(M, M.trendLine.dataKey);
|
|
3527
|
+
g.push(...u.map((L) => L.value));
|
|
3528
|
+
const v = O(u);
|
|
3534
3529
|
if (v && u.length) {
|
|
3535
|
-
const
|
|
3536
|
-
g.push(v.intercept + v.slope *
|
|
3530
|
+
const L = u[0].index, D = u[u.length - 1].index;
|
|
3531
|
+
g.push(v.intercept + v.slope * L, v.intercept + v.slope * D);
|
|
3537
3532
|
}
|
|
3538
3533
|
}
|
|
3539
3534
|
return g;
|
|
3540
3535
|
});
|
|
3541
|
-
function
|
|
3542
|
-
const u = g > 0 ? g : 1, v = Math.floor(Math.log10(u)),
|
|
3536
|
+
function I(g, M) {
|
|
3537
|
+
const u = g > 0 ? g : 1, v = Math.floor(Math.log10(u)), L = u / 10 ** v;
|
|
3543
3538
|
let D;
|
|
3544
|
-
return M ? D =
|
|
3539
|
+
return M ? D = L < 1.5 ? 1 : L < 3 ? 2 : L < 7 ? 5 : 10 : D = L <= 1 ? 1 : L <= 2 ? 2 : L <= 5 ? 5 : 10, D * 10 ** v;
|
|
3545
3540
|
}
|
|
3546
|
-
d(
|
|
3547
|
-
const
|
|
3541
|
+
d(I, "niceNum");
|
|
3542
|
+
const $ = S(() => {
|
|
3548
3543
|
const g = Z.value, M = g.length ? Math.max(0, ...g) : 1, u = g.length ? Math.min(0, ...g) : 0;
|
|
3549
3544
|
if (u === M)
|
|
3550
3545
|
return { min: 0, max: M || 1, ticks: [0, M || 1] };
|
|
3551
|
-
const v = 4,
|
|
3552
|
-
for (let le =
|
|
3546
|
+
const v = 4, L = I(M - u, !1), D = I(L / (v - 1), !0), Q = Math.floor(u / D) * D, pe = Math.ceil(M / D) * D, ke = [];
|
|
3547
|
+
for (let le = Q; le <= pe + D * 0.5; le += D)
|
|
3553
3548
|
ke.push(Number(le.toFixed(6)));
|
|
3554
|
-
return { min:
|
|
3555
|
-
}),
|
|
3549
|
+
return { min: Q, max: pe, ticks: ke };
|
|
3550
|
+
}), N = S(() => Mr({ series: c.value })), W = S(() => {
|
|
3556
3551
|
const g = p.value;
|
|
3557
3552
|
if (!g)
|
|
3558
3553
|
return { mode: "horizontal", entries: [] };
|
|
@@ -3565,66 +3560,66 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3565
3560
|
plotWidth: 318
|
|
3566
3561
|
});
|
|
3567
3562
|
}), B = S(() => {
|
|
3568
|
-
const g =
|
|
3563
|
+
const g = N.value?.valueFormat, M = !!(N.value && (g === "currency" || g === "percent" || N.value.valuePrefix || N.value.valueSuffix)), u = g === "duration" ? 46 : M ? 38 : 30, v = W.value.mode === "angled";
|
|
3569
3564
|
return {
|
|
3570
3565
|
width: 360,
|
|
3571
|
-
height: 168 + (v ?
|
|
3566
|
+
height: 168 + (v ? Ns : 0),
|
|
3572
3567
|
left: u,
|
|
3573
3568
|
right: 12,
|
|
3574
3569
|
top: 10,
|
|
3575
|
-
bottom: 24 + (v ?
|
|
3570
|
+
bottom: 24 + (v ? Ns : 0)
|
|
3576
3571
|
};
|
|
3577
3572
|
});
|
|
3578
3573
|
function V(g, M) {
|
|
3579
3574
|
const u = p.value, v = B.value;
|
|
3580
3575
|
if (u?.chartType === "bar") {
|
|
3581
|
-
const
|
|
3582
|
-
return v.left + (g + 0.5) * (
|
|
3576
|
+
const L = v.width - v.left - v.right;
|
|
3577
|
+
return v.left + (g + 0.5) * (L / Math.max(M, 1));
|
|
3583
3578
|
}
|
|
3584
|
-
return
|
|
3579
|
+
return J(g, M);
|
|
3585
3580
|
}
|
|
3586
3581
|
d(V, "labelCenterX");
|
|
3587
|
-
function
|
|
3582
|
+
function J(g, M) {
|
|
3588
3583
|
const u = B.value, v = u.width - u.left - u.right;
|
|
3589
3584
|
return M <= 1 ? u.left + v / 2 : u.left + v * g / (M - 1);
|
|
3590
3585
|
}
|
|
3591
|
-
d(
|
|
3586
|
+
d(J, "xForIndex");
|
|
3592
3587
|
function ue(g) {
|
|
3593
|
-
const { min: M, max: u } =
|
|
3594
|
-
return v.top + (u - g) / (u - M || 1) *
|
|
3588
|
+
const { min: M, max: u } = $.value, v = B.value, L = v.height - v.top - v.bottom;
|
|
3589
|
+
return v.top + (u - g) / (u - M || 1) * L;
|
|
3595
3590
|
}
|
|
3596
3591
|
d(ue, "yForValue");
|
|
3597
3592
|
function Ae(g) {
|
|
3598
3593
|
const M = p.value;
|
|
3599
3594
|
return M ? M.data.map((u, v) => {
|
|
3600
|
-
const
|
|
3601
|
-
return `${v === 0 ? "M" : "L"} ${
|
|
3595
|
+
const L = y(u[g]) ?? 0;
|
|
3596
|
+
return `${v === 0 ? "M" : "L"} ${J(v, M.data.length).toFixed(1)} ${ue(L).toFixed(1)}`;
|
|
3602
3597
|
}).join(" ") : "";
|
|
3603
3598
|
}
|
|
3604
3599
|
d(Ae, "pathForSeries");
|
|
3605
3600
|
const Pe = S(() => {
|
|
3606
3601
|
const g = p.value;
|
|
3607
3602
|
if (!g?.trendLine || g.chartType !== "line" && g.chartType !== "scatter") return null;
|
|
3608
|
-
const M =
|
|
3603
|
+
const M = E(g, g.trendLine.dataKey), u = O(M);
|
|
3609
3604
|
if (!u || !M.length) return null;
|
|
3610
|
-
const v = M[0].index,
|
|
3605
|
+
const v = M[0].index, L = M[M.length - 1].index, D = u.intercept + u.slope * v, Q = u.intercept + u.slope * L, pe = Math.max(0, g.series.findIndex((ke) => ke.dataKey === g.trendLine?.dataKey));
|
|
3611
3606
|
return {
|
|
3612
|
-
path: `M ${
|
|
3607
|
+
path: `M ${J(v, g.data.length).toFixed(1)} ${ue(D).toFixed(1)} L ${J(L, g.data.length).toFixed(1)} ${ue(Q).toFixed(1)}`,
|
|
3613
3608
|
dataKey: g.trendLine.dataKey,
|
|
3614
3609
|
seriesIndex: pe
|
|
3615
3610
|
};
|
|
3616
3611
|
}), St = S(() => {
|
|
3617
3612
|
const g = p.value;
|
|
3618
3613
|
if (!g || g.chartType !== "bar") return [];
|
|
3619
|
-
const M = B.value, v = (M.width - M.left - M.right) / Math.max(g.data.length, 1),
|
|
3614
|
+
const M = B.value, v = (M.width - M.left - M.right) / Math.max(g.data.length, 1), L = ue(0);
|
|
3620
3615
|
if (R.value) {
|
|
3621
3616
|
const le = Math.max(4, Math.min(24, v * 0.42));
|
|
3622
3617
|
return g.data.flatMap((de, $e) => {
|
|
3623
|
-
let
|
|
3618
|
+
let Ke = 0, je = 0;
|
|
3624
3619
|
const ze = M.left + $e * v + (v - le) / 2;
|
|
3625
3620
|
return g.series.map((Fe, Xe) => {
|
|
3626
|
-
const
|
|
3627
|
-
return
|
|
3621
|
+
const _ = y(de[Fe.dataKey]) ?? 0, m = _ >= 0 ? Ke : je, T = m + _, ae = ue(m), U = ue(T);
|
|
3622
|
+
return _ >= 0 ? Ke = T : je = T, {
|
|
3628
3623
|
key: `${$e}-${Fe.dataKey}`,
|
|
3629
3624
|
x: ze,
|
|
3630
3625
|
y: Math.min(ae, U),
|
|
@@ -3637,16 +3632,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3637
3632
|
});
|
|
3638
3633
|
});
|
|
3639
3634
|
}
|
|
3640
|
-
const D = Math.max(g.series.length, 1),
|
|
3641
|
-
return g.data.flatMap((le, de) => g.series.map(($e,
|
|
3642
|
-
const je =
|
|
3635
|
+
const D = Math.max(g.series.length, 1), Q = D > 1 ? 2 : 0, pe = Math.max(3, Math.min(20, (v * 0.62 - Q * (D - 1)) / D)), ke = pe * D + Q * (D - 1);
|
|
3636
|
+
return g.data.flatMap((le, de) => g.series.map(($e, Ke) => {
|
|
3637
|
+
const je = y(le[$e.dataKey]) ?? 0, ze = ue(je), Fe = M.left + de * v + (v - ke) / 2 + Ke * (pe + Q);
|
|
3643
3638
|
return {
|
|
3644
3639
|
key: `${de}-${$e.dataKey}`,
|
|
3645
3640
|
x: Fe,
|
|
3646
|
-
y: Math.min(ze,
|
|
3641
|
+
y: Math.min(ze, L),
|
|
3647
3642
|
width: pe,
|
|
3648
|
-
height: Math.max(1.5, Math.abs(
|
|
3649
|
-
seriesIndex:
|
|
3643
|
+
height: Math.max(1.5, Math.abs(L - ze)),
|
|
3644
|
+
seriesIndex: Ke,
|
|
3650
3645
|
rowIndex: de,
|
|
3651
3646
|
dataKey: $e.dataKey
|
|
3652
3647
|
};
|
|
@@ -3656,32 +3651,32 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3656
3651
|
if (!g) return [];
|
|
3657
3652
|
const M = g.data;
|
|
3658
3653
|
if (!M.length) return [];
|
|
3659
|
-
const u = M.length - 1, v =
|
|
3660
|
-
return v.entries.map(({ index: D, text:
|
|
3654
|
+
const u = M.length - 1, v = W.value, L = v.mode === "angled";
|
|
3655
|
+
return v.entries.map(({ index: D, text: Q }) => ({
|
|
3661
3656
|
key: `${D}`,
|
|
3662
|
-
label:
|
|
3657
|
+
label: Q,
|
|
3663
3658
|
x: V(D, M.length),
|
|
3664
|
-
anchor:
|
|
3665
|
-
angled:
|
|
3659
|
+
anchor: L ? "end" : D === 0 ? "start" : D === u ? "end" : "middle",
|
|
3660
|
+
angled: L
|
|
3666
3661
|
})).filter((D) => D.label);
|
|
3667
3662
|
}), se = S(() => {
|
|
3668
3663
|
const g = p.value;
|
|
3669
3664
|
if (!g || g.chartType !== "bar" || g.series.length !== 1 || R.value)
|
|
3670
3665
|
return [];
|
|
3671
|
-
const M = g.series[0], u = g.data.map((D,
|
|
3672
|
-
const pe = k(D, g.xKey), ke =
|
|
3673
|
-
return !pe || ke === null ? null : { key: `${
|
|
3666
|
+
const M = g.series[0], u = g.data.map((D, Q) => {
|
|
3667
|
+
const pe = k(D, g.xKey), ke = y(D[M.dataKey]);
|
|
3668
|
+
return !pe || ke === null ? null : { key: `${Q}-${pe}`, label: pe, rawValue: ke };
|
|
3674
3669
|
}).filter((D) => D !== null);
|
|
3675
3670
|
if (!u.length || u.some((D) => D.rawValue < 0))
|
|
3676
3671
|
return [];
|
|
3677
3672
|
if (!(g.layout === "horizontal" || A(g.data, g.xKey)))
|
|
3678
3673
|
return [];
|
|
3679
|
-
const
|
|
3674
|
+
const L = Math.max(...u.map((D) => D.rawValue), 1);
|
|
3680
3675
|
return u.map((D) => ({
|
|
3681
3676
|
key: D.key,
|
|
3682
3677
|
label: D.label,
|
|
3683
|
-
value:
|
|
3684
|
-
width: D.rawValue <= 0 ? 0 : Math.max(2, D.rawValue /
|
|
3678
|
+
value: On({ value: D.rawValue, series: M }),
|
|
3679
|
+
width: D.rawValue <= 0 ? 0 : Math.max(2, D.rawValue / L * 100),
|
|
3685
3680
|
seriesIndex: 0
|
|
3686
3681
|
}));
|
|
3687
3682
|
}), st = S(() => {
|
|
@@ -3689,34 +3684,34 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3689
3684
|
if (!g?.data.length) return [];
|
|
3690
3685
|
const M = g.data[g.data.length - 1];
|
|
3691
3686
|
return g.series.map((u, v) => {
|
|
3692
|
-
const
|
|
3687
|
+
const L = y(M?.[u.dataKey]);
|
|
3693
3688
|
return {
|
|
3694
3689
|
key: u.dataKey,
|
|
3695
3690
|
label: u.label || u.dataKey,
|
|
3696
|
-
value:
|
|
3691
|
+
value: L === null ? "—" : On({ value: L, series: u }),
|
|
3697
3692
|
seriesIndex: v
|
|
3698
3693
|
};
|
|
3699
3694
|
});
|
|
3700
|
-
}),
|
|
3695
|
+
}), Ye = S(() => {
|
|
3701
3696
|
const g = p.value;
|
|
3702
3697
|
if (!g?.data.length || g.chartType !== "line") return [];
|
|
3703
3698
|
const M = g.data.length - 1, u = g.data[M];
|
|
3704
|
-
return g.series.map((v,
|
|
3705
|
-
const D =
|
|
3706
|
-
return D === null ? null : { key: v.dataKey, cx:
|
|
3699
|
+
return g.series.map((v, L) => {
|
|
3700
|
+
const D = y(u?.[v.dataKey]);
|
|
3701
|
+
return D === null ? null : { key: v.dataKey, cx: J(M, g.data.length), cy: ue(D), seriesIndex: L };
|
|
3707
3702
|
}).filter((v) => v !== null);
|
|
3708
3703
|
}), at = S(() => {
|
|
3709
|
-
const g =
|
|
3704
|
+
const g = b.value;
|
|
3710
3705
|
if (!g) return [];
|
|
3711
|
-
const M = g.data.map((
|
|
3712
|
-
name: String(
|
|
3713
|
-
value:
|
|
3714
|
-
})).filter((
|
|
3715
|
-
return M.map((
|
|
3716
|
-
|
|
3717
|
-
key: `${D}-${
|
|
3718
|
-
percent:
|
|
3719
|
-
display:
|
|
3706
|
+
const M = g.data.map((L) => ({
|
|
3707
|
+
name: String(L[g.nameKey] ?? ""),
|
|
3708
|
+
value: y(L[g.valueKey]) ?? 0
|
|
3709
|
+
})).filter((L) => L.name && L.value >= 0).sort((L, D) => D.value - L.value), u = M.reduce((L, D) => L + D.value, 0) || 1, v = g.series?.[0];
|
|
3710
|
+
return M.map((L, D) => ({
|
|
3711
|
+
...L,
|
|
3712
|
+
key: `${D}-${L.name}`,
|
|
3713
|
+
percent: L.value / u,
|
|
3714
|
+
display: On({ value: L.value, series: v })
|
|
3720
3715
|
}));
|
|
3721
3716
|
}), Oe = S(() => i.value ? Rr(i.value) : null), gt = [
|
|
3722
3717
|
"var(--color-theme-900)",
|
|
@@ -3740,7 +3735,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3740
3735
|
return g === "decision" ? t.inverted ? "rgba(255, 255, 255, 0.26)" : "color-mix(in oklch, var(--color-primary-500) 32%, var(--color-theme-300))" : Be.value;
|
|
3741
3736
|
}
|
|
3742
3737
|
d(Ce, "diagramNodeStroke");
|
|
3743
|
-
const
|
|
3738
|
+
const K = S(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = S(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), ie = S(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), Ie = S(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), re = S(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Be = S(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), rt = S(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), be = S(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
3744
3739
|
return (g, M) => e.value ? (h(), f("section", {
|
|
3745
3740
|
key: 0,
|
|
3746
3741
|
"data-test": "chat-visual",
|
|
@@ -3755,13 +3750,13 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3755
3750
|
w("header", Nr, [
|
|
3756
3751
|
w("h4", {
|
|
3757
3752
|
class: "text-[13px] font-semibold leading-tight",
|
|
3758
|
-
style: q({ color:
|
|
3759
|
-
},
|
|
3753
|
+
style: q({ color: K.value })
|
|
3754
|
+
}, j(e.value.meta.title), 5),
|
|
3760
3755
|
e.value.meta.description ? (h(), f("p", {
|
|
3761
3756
|
key: 0,
|
|
3762
3757
|
class: "mt-0.5 text-[12px] leading-snug",
|
|
3763
|
-
style: q({ color:
|
|
3764
|
-
},
|
|
3758
|
+
style: q({ color: ye.value })
|
|
3759
|
+
}, j(e.value.meta.description), 5)) : H("", !0)
|
|
3765
3760
|
]),
|
|
3766
3761
|
p.value ? (h(), f("div", {
|
|
3767
3762
|
key: 0,
|
|
@@ -3769,7 +3764,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3769
3764
|
"aria-label": e.value.meta.title
|
|
3770
3765
|
}, [
|
|
3771
3766
|
se.value.length ? (h(), f("div", Br, [
|
|
3772
|
-
(h(!0), f(
|
|
3767
|
+
(h(!0), f(ee, null, me(se.value, (u) => (h(), f("div", {
|
|
3773
3768
|
key: u.key,
|
|
3774
3769
|
"data-test": "chat-visual-horizontal-bar",
|
|
3775
3770
|
class: "min-w-0"
|
|
@@ -3777,16 +3772,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3777
3772
|
w("div", Fr, [
|
|
3778
3773
|
w("span", {
|
|
3779
3774
|
class: "line-clamp-2 min-w-0 font-medium leading-snug",
|
|
3780
|
-
style: q({ color:
|
|
3781
|
-
},
|
|
3775
|
+
style: q({ color: K.value })
|
|
3776
|
+
}, j(u.label), 5),
|
|
3782
3777
|
w("span", {
|
|
3783
3778
|
class: "shrink-0 font-semibold tabular-nums",
|
|
3784
|
-
style: q({ color:
|
|
3785
|
-
},
|
|
3779
|
+
style: q({ color: K.value })
|
|
3780
|
+
}, j(u.value), 5)
|
|
3786
3781
|
]),
|
|
3787
3782
|
w("div", {
|
|
3788
3783
|
class: "h-2 w-full overflow-hidden rounded-full",
|
|
3789
|
-
style: q({ background:
|
|
3784
|
+
style: q({ background: be.value })
|
|
3790
3785
|
}, [
|
|
3791
3786
|
w("div", {
|
|
3792
3787
|
class: "h-full rounded-full",
|
|
@@ -3802,7 +3797,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3802
3797
|
preserveAspectRatio: "xMidYMid meet",
|
|
3803
3798
|
"aria-hidden": "true"
|
|
3804
3799
|
}, [
|
|
3805
|
-
(h(!0), f(
|
|
3800
|
+
(h(!0), f(ee, null, me($.value.ticks, (u) => (h(), f("line", {
|
|
3806
3801
|
key: `grid-${u}`,
|
|
3807
3802
|
x1: B.value.left,
|
|
3808
3803
|
x2: B.value.width - B.value.right,
|
|
@@ -3813,16 +3808,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3813
3808
|
style: q({ stroke: u === 0 ? re.value : Ie.value })
|
|
3814
3809
|
}, null, 12, Hr))), 128)),
|
|
3815
3810
|
w("g", null, [
|
|
3816
|
-
(h(!0), f(
|
|
3811
|
+
(h(!0), f(ee, null, me($.value.ticks, (u) => (h(), f("text", {
|
|
3817
3812
|
key: `y-${u}`,
|
|
3818
3813
|
x: B.value.left - 7,
|
|
3819
3814
|
y: ue(u) + 3,
|
|
3820
3815
|
"text-anchor": "end",
|
|
3821
3816
|
"font-size": "9.5",
|
|
3822
3817
|
style: q({ fill: ie.value })
|
|
3823
|
-
},
|
|
3818
|
+
}, j(en(Cr)({ value: u, shared: N.value })), 13, jr))), 128))
|
|
3824
3819
|
]),
|
|
3825
|
-
p.value.chartType === "bar" ? (h(!0), f(
|
|
3820
|
+
p.value.chartType === "bar" ? (h(!0), f(ee, { key: 0 }, me(St.value, (u) => (h(), f("rect", {
|
|
3826
3821
|
key: u.key,
|
|
3827
3822
|
"data-test": "chat-visual-bar",
|
|
3828
3823
|
"data-row-index": u.rowIndex,
|
|
@@ -3834,7 +3829,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3834
3829
|
height: u.height,
|
|
3835
3830
|
rx: "2.5",
|
|
3836
3831
|
style: q({ fill: Me(u.seriesIndex) })
|
|
3837
|
-
}, null, 12, Wr))), 128)) : (h(), f(
|
|
3832
|
+
}, null, 12, Wr))), 128)) : (h(), f(ee, { key: 1 }, [
|
|
3838
3833
|
Pe.value ? (h(), f("path", {
|
|
3839
3834
|
key: 0,
|
|
3840
3835
|
"data-test": "chat-visual-trend-line",
|
|
@@ -3847,8 +3842,8 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3847
3842
|
"stroke-dasharray": "4 3",
|
|
3848
3843
|
"vector-effect": "non-scaling-stroke",
|
|
3849
3844
|
style: q({ stroke: Me(Pe.value.seriesIndex) })
|
|
3850
|
-
}, null, 12, Gr)) :
|
|
3851
|
-
(h(!0), f(
|
|
3845
|
+
}, null, 12, Gr)) : H("", !0),
|
|
3846
|
+
(h(!0), f(ee, null, me(c.value, (u, v) => (h(), f("g", {
|
|
3852
3847
|
key: u.dataKey
|
|
3853
3848
|
}, [
|
|
3854
3849
|
p.value.chartType === "line" ? (h(), f("path", {
|
|
@@ -3860,28 +3855,28 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3860
3855
|
"stroke-linejoin": "round",
|
|
3861
3856
|
"vector-effect": "non-scaling-stroke",
|
|
3862
3857
|
style: q({ stroke: Me(v) })
|
|
3863
|
-
}, null, 12, Vr)) :
|
|
3864
|
-
(h(!0), f(
|
|
3858
|
+
}, null, 12, Vr)) : H("", !0),
|
|
3859
|
+
(h(!0), f(ee, null, me(o.value, (L, D) => (h(), f(ee, {
|
|
3865
3860
|
key: `${u.dataKey}-${D}`
|
|
3866
3861
|
}, [
|
|
3867
3862
|
p.value.chartType === "scatter" ? (h(), f("circle", {
|
|
3868
3863
|
key: 0,
|
|
3869
|
-
cx:
|
|
3870
|
-
cy: ue(
|
|
3864
|
+
cx: J(D, o.value.length),
|
|
3865
|
+
cy: ue(y(L[u.dataKey]) ?? 0),
|
|
3871
3866
|
r: "2.6",
|
|
3872
3867
|
style: q({ fill: Me(v) })
|
|
3873
|
-
}, null, 12, qr)) :
|
|
3868
|
+
}, null, 12, qr)) : H("", !0)
|
|
3874
3869
|
], 64))), 128))
|
|
3875
3870
|
]))), 128)),
|
|
3876
|
-
(h(!0), f(
|
|
3871
|
+
(h(!0), f(ee, null, me(Ye.value, (u) => (h(), f("circle", {
|
|
3877
3872
|
key: `marker-${u.key}`,
|
|
3878
3873
|
cx: u.cx,
|
|
3879
3874
|
cy: u.cy,
|
|
3880
3875
|
r: "3",
|
|
3881
3876
|
style: q({ fill: Me(u.seriesIndex) })
|
|
3882
|
-
}, null, 12,
|
|
3877
|
+
}, null, 12, Yr))), 128))
|
|
3883
3878
|
], 64)),
|
|
3884
|
-
(h(!0), f(
|
|
3879
|
+
(h(!0), f(ee, null, me(De.value, (u) => (h(), f("text", {
|
|
3885
3880
|
key: u.key,
|
|
3886
3881
|
x: u.x,
|
|
3887
3882
|
y: u.angled ? B.value.height - B.value.bottom + 12 : B.value.height - 6,
|
|
@@ -3889,10 +3884,10 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3889
3884
|
"font-size": "9.5",
|
|
3890
3885
|
transform: u.angled ? `rotate(${en(Dr)} ${u.x} ${B.value.height - B.value.bottom + 12})` : void 0,
|
|
3891
3886
|
style: q({ fill: ie.value })
|
|
3892
|
-
},
|
|
3887
|
+
}, j(u.label), 13, Kr))), 128))
|
|
3893
3888
|
], 12, Ur)),
|
|
3894
3889
|
st.value.length > 1 || p.value.chartType !== "bar" ? (h(), f("div", Xr, [
|
|
3895
|
-
(h(!0), f(
|
|
3890
|
+
(h(!0), f(ee, null, me(st.value, (u) => (h(), f("div", {
|
|
3896
3891
|
key: u.key,
|
|
3897
3892
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
3898
3893
|
}, [
|
|
@@ -3901,37 +3896,37 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3901
3896
|
style: q({ background: Me(u.seriesIndex) })
|
|
3902
3897
|
}, null, 4),
|
|
3903
3898
|
w("span", {
|
|
3904
|
-
style: q({ color:
|
|
3905
|
-
},
|
|
3899
|
+
style: q({ color: ye.value })
|
|
3900
|
+
}, j(u.label), 5),
|
|
3906
3901
|
w("span", {
|
|
3907
3902
|
class: "font-semibold tabular-nums",
|
|
3908
|
-
style: q({ color:
|
|
3909
|
-
},
|
|
3903
|
+
style: q({ color: K.value })
|
|
3904
|
+
}, j(u.value), 5)
|
|
3910
3905
|
]))), 128))
|
|
3911
|
-
])) :
|
|
3912
|
-
], 8, Pr)) :
|
|
3913
|
-
(h(!0), f(
|
|
3906
|
+
])) : H("", !0)
|
|
3907
|
+
], 8, Pr)) : b.value ? (h(), f("div", Zr, [
|
|
3908
|
+
(h(!0), f(ee, null, me(at.value, (u, v) => (h(), f("div", {
|
|
3914
3909
|
key: u.key
|
|
3915
3910
|
}, [
|
|
3916
3911
|
w("div", Jr, [
|
|
3917
3912
|
w("span", {
|
|
3918
3913
|
class: "truncate font-medium",
|
|
3919
|
-
style: q({ color:
|
|
3920
|
-
},
|
|
3914
|
+
style: q({ color: K.value })
|
|
3915
|
+
}, j(u.name), 5),
|
|
3921
3916
|
w("span", Qr, [
|
|
3922
3917
|
w("span", {
|
|
3923
3918
|
class: "font-semibold",
|
|
3924
|
-
style: q({ color:
|
|
3925
|
-
},
|
|
3919
|
+
style: q({ color: K.value })
|
|
3920
|
+
}, j(u.display), 5),
|
|
3926
3921
|
w("span", {
|
|
3927
3922
|
class: "ml-1.5",
|
|
3928
|
-
style: q({ color:
|
|
3929
|
-
},
|
|
3923
|
+
style: q({ color: ye.value })
|
|
3924
|
+
}, j(Math.round(u.percent * 100)) + "%", 5)
|
|
3930
3925
|
])
|
|
3931
3926
|
]),
|
|
3932
3927
|
w("div", {
|
|
3933
3928
|
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
3934
|
-
style: q({ background:
|
|
3929
|
+
style: q({ background: be.value })
|
|
3935
3930
|
}, [
|
|
3936
3931
|
w("div", {
|
|
3937
3932
|
class: "h-full rounded-full",
|
|
@@ -3948,7 +3943,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3948
3943
|
role: "img",
|
|
3949
3944
|
"aria-label": e.value.meta.title
|
|
3950
3945
|
}, [
|
|
3951
|
-
(h(!0), f(
|
|
3946
|
+
(h(!0), f(ee, null, me(Oe.value.edges, (u) => (h(), f("line", {
|
|
3952
3947
|
key: u.key,
|
|
3953
3948
|
"data-test": "chat-visual-diagram-edge",
|
|
3954
3949
|
"data-from": u.from,
|
|
@@ -3962,14 +3957,14 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3962
3957
|
"vector-effect": "non-scaling-stroke",
|
|
3963
3958
|
style: q({ stroke: rt.value })
|
|
3964
3959
|
}, null, 12, nl))), 128)),
|
|
3965
|
-
(h(!0), f(
|
|
3960
|
+
(h(!0), f(ee, null, me(Oe.value.edges, (u) => (h(), f("circle", {
|
|
3966
3961
|
key: `${u.key}-dot`,
|
|
3967
3962
|
cx: u.x2,
|
|
3968
3963
|
cy: u.y2,
|
|
3969
3964
|
r: "2.4",
|
|
3970
3965
|
style: q({ fill: rt.value })
|
|
3971
3966
|
}, null, 12, sl))), 128)),
|
|
3972
|
-
(h(!0), f(
|
|
3967
|
+
(h(!0), f(ee, null, me(Oe.value.edges.filter((u) => u.label), (u) => (h(), f("foreignObject", {
|
|
3973
3968
|
key: `${u.key}-label`,
|
|
3974
3969
|
x: u.labelX - 43,
|
|
3975
3970
|
y: u.labelY - 11,
|
|
@@ -3979,10 +3974,10 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3979
3974
|
w("div", {
|
|
3980
3975
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3981
3976
|
class: "flex h-full items-center justify-center px-1 text-center text-[8.5px] font-medium leading-none",
|
|
3982
|
-
style: q({ color:
|
|
3983
|
-
},
|
|
3977
|
+
style: q({ color: ye.value, background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)" })
|
|
3978
|
+
}, j(u.label), 5)
|
|
3984
3979
|
], 8, al))), 128)),
|
|
3985
|
-
(h(!0), f(
|
|
3980
|
+
(h(!0), f(ee, null, me(Oe.value.nodes, (u) => (h(), f("g", {
|
|
3986
3981
|
key: u.id,
|
|
3987
3982
|
"data-test": "chat-visual-diagram-node",
|
|
3988
3983
|
"data-node-id": u.id,
|
|
@@ -4013,26 +4008,26 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4013
4008
|
w("div", cl, [
|
|
4014
4009
|
w("div", {
|
|
4015
4010
|
class: "line-clamp-2 text-[10.5px] font-semibold leading-tight",
|
|
4016
|
-
style: q({ color:
|
|
4017
|
-
},
|
|
4011
|
+
style: q({ color: K.value })
|
|
4012
|
+
}, j(u.label), 5),
|
|
4018
4013
|
u.detail ? (h(), f("div", {
|
|
4019
4014
|
key: 0,
|
|
4020
4015
|
class: "mt-0.5 line-clamp-1 text-[8.5px] leading-none",
|
|
4021
|
-
style: q({ color:
|
|
4022
|
-
},
|
|
4016
|
+
style: q({ color: ye.value })
|
|
4017
|
+
}, j(u.detail), 5)) : H("", !0)
|
|
4023
4018
|
])
|
|
4024
4019
|
], 8, ol))
|
|
4025
4020
|
], 8, il))), 128))
|
|
4026
4021
|
], 12, tl))
|
|
4027
|
-
])) :
|
|
4022
|
+
])) : H("", !0),
|
|
4028
4023
|
e.value.meta.footer ? (h(), f("footer", {
|
|
4029
4024
|
key: 3,
|
|
4030
4025
|
class: "mt-3 text-[11px] leading-snug",
|
|
4031
4026
|
style: q({ color: ie.value })
|
|
4032
|
-
},
|
|
4033
|
-
], 12, zr)) :
|
|
4027
|
+
}, j(e.value.meta.footer), 5)) : H("", !0)
|
|
4028
|
+
], 12, zr)) : H("", !0);
|
|
4034
4029
|
}
|
|
4035
|
-
}), dl = ["innerHTML"],
|
|
4030
|
+
}), dl = ["innerHTML"], Kt = /* @__PURE__ */ Re({
|
|
4036
4031
|
__name: "ChatRichText",
|
|
4037
4032
|
props: {
|
|
4038
4033
|
text: {},
|
|
@@ -4053,22 +4048,22 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4053
4048
|
n = void 0, e.value = t.text;
|
|
4054
4049
|
}));
|
|
4055
4050
|
}
|
|
4056
|
-
),
|
|
4051
|
+
), Hs(() => {
|
|
4057
4052
|
n !== void 0 && cancelAnimationFrame(n);
|
|
4058
4053
|
});
|
|
4059
4054
|
const i = new te.Renderer();
|
|
4060
4055
|
i.link = ({ href: k, text: A }) => {
|
|
4061
|
-
const
|
|
4062
|
-
if (!
|
|
4056
|
+
const E = k.trim();
|
|
4057
|
+
if (!E || E === "#")
|
|
4063
4058
|
return A;
|
|
4064
|
-
let
|
|
4059
|
+
let O = !1;
|
|
4065
4060
|
if (typeof window < "u")
|
|
4066
4061
|
try {
|
|
4067
|
-
|
|
4062
|
+
O = new URL(k, window.location.href).origin === window.location.origin;
|
|
4068
4063
|
} catch {
|
|
4069
|
-
|
|
4064
|
+
O = !1;
|
|
4070
4065
|
}
|
|
4071
|
-
return
|
|
4066
|
+
return O ? `<a href="${k}">${A}</a>` : `<a href="${k}" target="_blank" rel="noopener noreferrer">${A}</a>`;
|
|
4072
4067
|
}, te.setOptions({ breaks: !0, gfm: !0, renderer: i });
|
|
4073
4068
|
function s(k) {
|
|
4074
4069
|
if (!k) return "";
|
|
@@ -4087,13 +4082,13 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4087
4082
|
const A = JSON.parse(k);
|
|
4088
4083
|
if (!A || typeof A != "object" || Array.isArray(A))
|
|
4089
4084
|
return { topLevelKeys: [], declaredVisualType: null, declaredChartType: null, declaredDiagramType: null, inputType: null };
|
|
4090
|
-
const
|
|
4085
|
+
const E = A;
|
|
4091
4086
|
return {
|
|
4092
|
-
topLevelKeys: Object.keys(
|
|
4093
|
-
declaredVisualType: l(
|
|
4094
|
-
declaredChartType: l(
|
|
4095
|
-
declaredDiagramType: l(
|
|
4096
|
-
inputType: l(
|
|
4087
|
+
topLevelKeys: Object.keys(E).sort().slice(0, 24),
|
|
4088
|
+
declaredVisualType: l(E.visualType),
|
|
4089
|
+
declaredChartType: l(E.chartType),
|
|
4090
|
+
declaredDiagramType: l(E.diagramType),
|
|
4091
|
+
inputType: l(E.type)
|
|
4097
4092
|
};
|
|
4098
4093
|
} catch {
|
|
4099
4094
|
return { topLevelKeys: [], declaredVisualType: null, declaredChartType: null, declaredDiagramType: null, inputType: null };
|
|
@@ -4118,39 +4113,39 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4118
4113
|
});
|
|
4119
4114
|
}
|
|
4120
4115
|
d(c, "onRichTextAssetError");
|
|
4121
|
-
const
|
|
4116
|
+
const b = /```(?:pl-visual|pl-platform-visual)[ \t]*(?:\r?\n|$)/;
|
|
4122
4117
|
function R(k) {
|
|
4123
|
-
const { text: A, streaming:
|
|
4124
|
-
let
|
|
4125
|
-
for (;
|
|
4126
|
-
const
|
|
4127
|
-
ue &&
|
|
4128
|
-
const Ae =
|
|
4118
|
+
const { text: A, streaming: E } = k, O = [], Z = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g;
|
|
4119
|
+
let I = 0, $ = 0, N = Z.exec(A);
|
|
4120
|
+
for (; N !== null; ) {
|
|
4121
|
+
const J = A.slice(I, N.index), ue = s(J);
|
|
4122
|
+
ue && O.push({ kind: "markdown", key: `md-${$}`, html: ue });
|
|
4123
|
+
const Ae = Ta(N[1].trim());
|
|
4129
4124
|
if (Ae.ok)
|
|
4130
|
-
|
|
4125
|
+
O.push({ kind: "visual", key: `visual-${$}`, result: Ae });
|
|
4131
4126
|
else {
|
|
4132
4127
|
typeof console < "u" && console.warn("[pl-visual] parse_failed", {
|
|
4133
4128
|
reason: Ae.reason,
|
|
4134
4129
|
message: Ae.message,
|
|
4135
4130
|
hasFallbackMarkdown: !!Ae.fallbackMarkdown,
|
|
4136
|
-
payloadChars:
|
|
4137
|
-
...o(
|
|
4131
|
+
payloadChars: N[1].trim().length,
|
|
4132
|
+
...o(N[1].trim())
|
|
4138
4133
|
});
|
|
4139
4134
|
const Pe = Ae.fallbackMarkdown ? s(Ae.fallbackMarkdown) : "";
|
|
4140
|
-
Pe &&
|
|
4135
|
+
Pe && O.push({ kind: "markdown", key: `visual-${$}`, html: Pe });
|
|
4141
4136
|
}
|
|
4142
|
-
|
|
4137
|
+
I = N.index + N[0].length, $ += 1, N = Z.exec(A);
|
|
4143
4138
|
}
|
|
4144
|
-
const
|
|
4139
|
+
const W = A.slice(I), B = E ? b.exec(W) : null;
|
|
4145
4140
|
if (B) {
|
|
4146
|
-
const
|
|
4147
|
-
return
|
|
4141
|
+
const J = s(W.slice(0, B.index));
|
|
4142
|
+
return J && O.push({ kind: "markdown", key: `md-${$}`, html: J }), O.push({ kind: "pending-visual", key: `pending-${$}` }), O;
|
|
4148
4143
|
}
|
|
4149
|
-
const V = s(
|
|
4150
|
-
return V &&
|
|
4144
|
+
const V = s(W);
|
|
4145
|
+
return V && O.push({ kind: "markdown", key: `md-${$}`, html: V }), O;
|
|
4151
4146
|
}
|
|
4152
4147
|
d(R, "richTextSegments");
|
|
4153
|
-
const
|
|
4148
|
+
const y = S(() => {
|
|
4154
4149
|
const k = e.value;
|
|
4155
4150
|
return k ? R({ text: k, streaming: !!t.streaming }) : [];
|
|
4156
4151
|
});
|
|
@@ -4158,16 +4153,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4158
4153
|
class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed",
|
|
4159
4154
|
onErrorCapture: c
|
|
4160
4155
|
}, [
|
|
4161
|
-
(h(!0), f(
|
|
4162
|
-
key:
|
|
4156
|
+
(h(!0), f(ee, null, me(y.value, (E) => (h(), f(ee, {
|
|
4157
|
+
key: E.key
|
|
4163
4158
|
}, [
|
|
4164
|
-
|
|
4159
|
+
E.kind === "markdown" ? (h(), f("div", {
|
|
4165
4160
|
key: 0,
|
|
4166
4161
|
class: C(["chat-msg-prose", a.inverted ? "chat-msg-prose-invert" : ""]),
|
|
4167
|
-
innerHTML:
|
|
4168
|
-
}, null, 10, dl)) :
|
|
4162
|
+
innerHTML: E.html
|
|
4163
|
+
}, null, 10, dl)) : E.kind === "visual" ? (h(), kt(ul, {
|
|
4169
4164
|
key: 1,
|
|
4170
|
-
result:
|
|
4165
|
+
result: E.result,
|
|
4171
4166
|
inverted: a.inverted
|
|
4172
4167
|
}, null, 8, ["result", "inverted"])) : (h(), f("div", {
|
|
4173
4168
|
key: 2,
|
|
@@ -4212,9 +4207,9 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4212
4207
|
}), n.value && (s = new ResizeObserver(() => {
|
|
4213
4208
|
i.value && l();
|
|
4214
4209
|
}), s.observe(n.value));
|
|
4215
|
-
}),
|
|
4210
|
+
}), Hs(() => {
|
|
4216
4211
|
s?.disconnect();
|
|
4217
|
-
}), (c,
|
|
4212
|
+
}), (c, b) => (h(), f("div", {
|
|
4218
4213
|
ref_key: "viewport",
|
|
4219
4214
|
ref: e,
|
|
4220
4215
|
class: C(["overflow-y-auto overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
|
|
@@ -4236,17 +4231,17 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4236
4231
|
key: 1,
|
|
4237
4232
|
"data-test": "messaging-sdk-header",
|
|
4238
4233
|
class: "shrink-0 border-b border-theme-100 px-4 py-3"
|
|
4239
|
-
}, vl = { class: "flex items-center gap-3" }, xl = { class: "min-w-0 flex-1" },
|
|
4234
|
+
}, vl = { class: "flex items-center gap-3" }, xl = { class: "min-w-0 flex-1" }, yl = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, bl = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, kl = {
|
|
4240
4235
|
key: 0,
|
|
4241
4236
|
class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
|
|
4242
4237
|
}, wl = {
|
|
4243
4238
|
key: 0,
|
|
4244
4239
|
"data-test": "messaging-empty-state",
|
|
4245
4240
|
class: "flex flex-col items-center justify-center px-4"
|
|
4246
|
-
}, Tl = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Sl = ["src", "alt"], Al = ["title"],
|
|
4241
|
+
}, Tl = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Sl = ["src", "alt"], Al = ["title"], _l = {
|
|
4247
4242
|
key: 0,
|
|
4248
4243
|
class: "flex items-center gap-3 py-3 px-2"
|
|
4249
|
-
},
|
|
4244
|
+
}, El = ["data-journal-outcome"], Rl = ["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"], Ml = { class: "max-w-[85%] min-w-0" }, Cl = ["href"], Il = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-streaming"], $l = ["data-test", "data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-streaming"], Ll = {
|
|
4250
4245
|
key: 0,
|
|
4251
4246
|
class: "flex-shrink-0 size-7 @sm/chat:size-8"
|
|
4252
4247
|
}, Dl = ["src", "alt"], Ol = ["src", "alt"], zl = ["src"], Nl = ["href"], Pl = {
|
|
@@ -4257,7 +4252,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4257
4252
|
"data-test": "messaging-tool-activity-tail",
|
|
4258
4253
|
"aria-label": "Assistant is still working",
|
|
4259
4254
|
class: "mb-4 grid h-[17px] w-5 place-items-center"
|
|
4260
|
-
}, Wl = ["data-journal-outcome"], Gl = ["data-working-description"], Vl = { class: "truncate" }, ql = ["data-issue-code"],
|
|
4255
|
+
}, Wl = ["data-journal-outcome"], Gl = ["data-working-description"], Vl = { class: "truncate" }, ql = ["data-issue-code"], Yl = ["href"], Kl = {
|
|
4261
4256
|
key: 3,
|
|
4262
4257
|
"data-test": "messaging-thinking-indicator",
|
|
4263
4258
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
@@ -4279,7 +4274,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4279
4274
|
}, fo = {
|
|
4280
4275
|
key: 1,
|
|
4281
4276
|
class: "i-tabler-arrow-up size-5"
|
|
4282
|
-
}, mo = { class: "sr-only" },
|
|
4277
|
+
}, mo = { class: "sr-only" }, Eo = /* @__PURE__ */ Re({
|
|
4283
4278
|
__name: "ElAgentChat",
|
|
4284
4279
|
props: {
|
|
4285
4280
|
chatController: {},
|
|
@@ -4298,176 +4293,176 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4298
4293
|
org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
|
|
4299
4294
|
public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
|
|
4300
4295
|
}, e = S(() => {
|
|
4301
|
-
const
|
|
4302
|
-
return a.scope === "org" && a.scopeName && (
|
|
4296
|
+
const _ = { ...t[a.scope] };
|
|
4297
|
+
return a.scope === "org" && a.scopeName && (_.label = a.scopeName, _.tooltip = `Visible to ${a.scopeName} members`), _;
|
|
4303
4298
|
}), n = ge(!1), i = ge(), s = ge(), l = ge();
|
|
4304
|
-
function o(
|
|
4305
|
-
return
|
|
4299
|
+
function o(_) {
|
|
4300
|
+
return _ ? /\[[^\]]+\]\([^)]+\)/.test(_) : !1;
|
|
4306
4301
|
}
|
|
4307
4302
|
d(o, "containsMarkdownLink");
|
|
4308
|
-
function p(
|
|
4309
|
-
return
|
|
4303
|
+
function p(_) {
|
|
4304
|
+
return _.sender === "system" && (!!_.issue || _.id === se.value);
|
|
4310
4305
|
}
|
|
4311
4306
|
d(p, "isSystemExplainerMessage");
|
|
4312
|
-
function c(
|
|
4313
|
-
const T =
|
|
4307
|
+
function c(_, m) {
|
|
4308
|
+
const T = _[m], ae = _[m + 1];
|
|
4314
4309
|
return !ae || ae.sender !== T.sender;
|
|
4315
4310
|
}
|
|
4316
4311
|
d(c, "shouldShowAvatar");
|
|
4317
|
-
const
|
|
4318
|
-
for (let
|
|
4319
|
-
const m =
|
|
4312
|
+
const b = S(() => a.chatController?.textState.value), R = S(() => b.value?.isConnected ?? !1), y = S(() => b.value?.isThinking ?? !1), k = S(() => b.value?.connectionStatus === "disconnected" && !!b.value?.error), A = S(() => b.value?.connectionStatus !== "connected" && !b.value?.error), E = S(() => b.value?.error), O = S(() => a.chatController?.liveTurnBlocks?.value ?? []), Z = S(() => {
|
|
4313
|
+
for (let _ = O.value.length - 1; _ >= 0; _--) {
|
|
4314
|
+
const m = O.value[_];
|
|
4320
4315
|
if (m?.kind === "text")
|
|
4321
4316
|
return m.id;
|
|
4322
4317
|
}
|
|
4323
|
-
}),
|
|
4324
|
-
const
|
|
4325
|
-
return
|
|
4326
|
-
}),
|
|
4327
|
-
if (!
|
|
4318
|
+
}), I = S(() => a.chatController?.liveStreamMessageId?.value), $ = S(() => {
|
|
4319
|
+
const _ = a.chatController?.sharedMessages.value ?? [];
|
|
4320
|
+
return O.value.length && I.value ? _.filter((m) => m.id !== I.value) : _;
|
|
4321
|
+
}), N = S(() => a.chatController?.workJournal?.value ? void 0 : b.value?.workingDescription?.trim() || void 0), W = S(() => a.chatController?.workJournal?.value), B = S(() => {
|
|
4322
|
+
if (!W.value && !O.value.length)
|
|
4328
4323
|
return;
|
|
4329
|
-
const
|
|
4324
|
+
const _ = $.value, m = _[_.length - 1];
|
|
4330
4325
|
if (m)
|
|
4331
|
-
return m.sender === "agent" || m.sender === "system" ?
|
|
4326
|
+
return m.sender === "agent" || m.sender === "system" ? _.length >= 2 ? _[_.length - 2].id : void 0 : m.id;
|
|
4332
4327
|
}), V = S(() => {
|
|
4333
|
-
const
|
|
4334
|
-
for (const m of
|
|
4328
|
+
const _ = {};
|
|
4329
|
+
for (const m of $.value) {
|
|
4335
4330
|
if (m.sender === "user" || !m.toolActivities?.length)
|
|
4336
4331
|
continue;
|
|
4337
4332
|
const T = a.chatController?.workJournalFor?.({
|
|
4338
4333
|
activities: m.toolActivities,
|
|
4339
|
-
outcome:
|
|
4334
|
+
outcome: Ia(m),
|
|
4340
4335
|
includeFailureNote: m.sender !== "system"
|
|
4341
4336
|
});
|
|
4342
|
-
T && (
|
|
4337
|
+
T && (_[m.id] = T);
|
|
4343
4338
|
}
|
|
4344
|
-
return
|
|
4339
|
+
return _;
|
|
4345
4340
|
});
|
|
4346
|
-
function
|
|
4347
|
-
return V.value[
|
|
4341
|
+
function J(_) {
|
|
4342
|
+
return V.value[_.id];
|
|
4348
4343
|
}
|
|
4349
|
-
d(
|
|
4350
|
-
function ue(
|
|
4351
|
-
return
|
|
4344
|
+
d(J, "messageWorkJournal");
|
|
4345
|
+
function ue(_, m) {
|
|
4346
|
+
return _.placement?.kind !== "inline" || !Number.isFinite(_.placement.offset) ? null : Math.max(0, Math.min(m.length, Math.trunc(_.placement.offset)));
|
|
4352
4347
|
}
|
|
4353
4348
|
d(ue, "inlineOffset");
|
|
4354
|
-
function Ae(
|
|
4355
|
-
return
|
|
4349
|
+
function Ae(_, m) {
|
|
4350
|
+
return _.mediaId || `${_.src}:${m}`;
|
|
4356
4351
|
}
|
|
4357
4352
|
d(Ae, "attachmentKey");
|
|
4358
|
-
function Pe(
|
|
4359
|
-
return (
|
|
4353
|
+
function Pe(_) {
|
|
4354
|
+
return (_.attachments ?? []).map((m, T) => ({ attachment: m, index: T })).filter(({ attachment: m }) => ue(m, _.text) === null);
|
|
4360
4355
|
}
|
|
4361
4356
|
d(Pe, "blockAttachmentsForMessage");
|
|
4362
|
-
function St(
|
|
4363
|
-
const m =
|
|
4364
|
-
if (
|
|
4365
|
-
return m ? [{ kind: "text", key: `${
|
|
4366
|
-
const T = (
|
|
4357
|
+
function St(_) {
|
|
4358
|
+
const m = _.text ?? "";
|
|
4359
|
+
if (_.sender !== "agent")
|
|
4360
|
+
return m ? [{ kind: "text", key: `${_.id}:text`, text: m }] : [];
|
|
4361
|
+
const T = (_.attachments ?? []).map((oe, Ze) => ({ attachment: oe, index: Ze, offset: ue(oe, m) })).filter((oe) => oe.offset !== null).sort((oe, Ze) => oe.offset - Ze.offset || oe.index - Ze.index);
|
|
4367
4362
|
if (T.length === 0)
|
|
4368
|
-
return m ? [{ kind: "text", key: `${
|
|
4363
|
+
return m ? [{ kind: "text", key: `${_.id}:text`, text: m }] : [];
|
|
4369
4364
|
const ae = [];
|
|
4370
4365
|
let U = 0;
|
|
4371
4366
|
for (const oe of T)
|
|
4372
4367
|
oe.offset > U && ae.push({
|
|
4373
4368
|
kind: "text",
|
|
4374
|
-
key: `${
|
|
4369
|
+
key: `${_.id}:text:${U}`,
|
|
4375
4370
|
text: m.slice(U, oe.offset)
|
|
4376
4371
|
}), ae.push({
|
|
4377
4372
|
kind: "attachment",
|
|
4378
|
-
key: `${
|
|
4373
|
+
key: `${_.id}:attachment:${Ae(oe.attachment, oe.index)}`,
|
|
4379
4374
|
attachment: oe.attachment,
|
|
4380
4375
|
placement: "inline"
|
|
4381
4376
|
}), U = oe.offset;
|
|
4382
4377
|
return U < m.length && ae.push({
|
|
4383
4378
|
kind: "text",
|
|
4384
|
-
key: `${
|
|
4379
|
+
key: `${_.id}:text:${U}`,
|
|
4385
4380
|
text: m.slice(U)
|
|
4386
4381
|
}), ae;
|
|
4387
4382
|
}
|
|
4388
4383
|
d(St, "messageRenderParts");
|
|
4389
|
-
const De = S(() =>
|
|
4390
|
-
if (!
|
|
4391
|
-
const
|
|
4384
|
+
const De = S(() => b.value?.transientIssue), se = S(() => {
|
|
4385
|
+
if (!y.value) return;
|
|
4386
|
+
const _ = $.value, m = _[_.length - 1];
|
|
4392
4387
|
return m?.sender === "agent" || m?.sender === "system" ? m.id : void 0;
|
|
4393
|
-
}), st = S(() => !
|
|
4388
|
+
}), st = S(() => !y.value || N.value || W.value || O.value.length ? !1 : se.value === void 0), Ye = S(() => b.value?.sendBlockedReason), at = S(() => !R.value || Ye.value !== void 0), Oe = S(() => k.value ? "Agent is offline" : A.value ? "Connecting..." : Ye.value === "agent_deleted" ? "This assistant was deleted" : Ye.value === "account" ? "Open billing to keep chatting" : "Message"), gt = S(() => a.chatController?.composerState?.value ?? {
|
|
4394
4389
|
text: "",
|
|
4395
4390
|
pendingAttachments: [],
|
|
4396
4391
|
isUploading: !1
|
|
4397
4392
|
}), vt = S({
|
|
4398
4393
|
get: /* @__PURE__ */ d(() => gt.value.text, "get"),
|
|
4399
|
-
set: /* @__PURE__ */ d((
|
|
4400
|
-
}), Me = S(() => gt.value.pendingAttachments), it = S(() => gt.value.isUploading), Ce = S(() => a.chatController?.voiceRecorder),
|
|
4394
|
+
set: /* @__PURE__ */ d((_) => a.chatController?.setComposerText?.({ text: _ }), "set")
|
|
4395
|
+
}), Me = S(() => gt.value.pendingAttachments), it = S(() => gt.value.isUploading), Ce = S(() => a.chatController?.voiceRecorder), K = S(() => Ce.value?.isBusy.value ?? !1), ye = S(() => a.chatController?.canAttachFile?.value ?? !1), ie = S(() => a.chatController?.canRecordAudio?.value ?? !1), Ie = S(() => a.chatController?.composerAction?.value ?? "idle"), re = S(() => Ie.value !== "idle"), Be = S(() => Ie.value === "stop" ? "Stop reply" : "Send message"), rt = S(() => Ie.value === "idle" && ie.value && !K.value && !!Ce.value?.canUseBrowserRecording), be = S(() => Ce.value?.isActive.value ?? !1), g = S(() => Ce.value?.elapsedLabel.value ?? "0:00"), M = S(() => Ce.value?.statusText.value ?? "Release to send"), u = S(() => Ce.value?.state.value.phase === "sending" ? "Sending voice message" : be.value ? "Release to send voice message" : "Hold to record voice message"), v = S(() => a.variant === "light"), L = S(
|
|
4401
4396
|
() => v.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
4402
4397
|
), D = S(() => v.value ? "text-theme-300" : "text-white/30");
|
|
4403
4398
|
tn(async () => {
|
|
4404
4399
|
a.chatController && !R.value && await a.chatController.startTextConversation();
|
|
4405
|
-
}),
|
|
4400
|
+
}), Ps(() => {
|
|
4406
4401
|
a.chatController?.voiceRecorder?.teardown();
|
|
4407
4402
|
});
|
|
4408
|
-
async function
|
|
4403
|
+
async function Q() {
|
|
4409
4404
|
!a.chatController || Ie.value !== "send" || (s.value && (s.value.style.height = "auto", s.value.focus()), i.value?.pin(), await a.chatController.sendComposerMessage());
|
|
4410
4405
|
}
|
|
4411
|
-
d(
|
|
4406
|
+
d(Q, "sendMessage");
|
|
4412
4407
|
async function pe() {
|
|
4413
4408
|
a.chatController && (Ie.value === "send" && i.value?.pin(), await a.chatController.handleComposerAction());
|
|
4414
4409
|
}
|
|
4415
4410
|
d(pe, "handleComposerAction");
|
|
4416
|
-
async function ke(
|
|
4417
|
-
|
|
4411
|
+
async function ke(_) {
|
|
4412
|
+
_.key === "Enter" && !_.shiftKey && (_.preventDefault(), await Q());
|
|
4418
4413
|
}
|
|
4419
4414
|
d(ke, "handleKeydown");
|
|
4420
4415
|
function le() {
|
|
4421
4416
|
s.value && (s.value.style.height = "auto", s.value.style.height = `${Math.min(s.value.scrollHeight, 150)}px`);
|
|
4422
4417
|
}
|
|
4423
|
-
d(le, "adjustTextareaHeight"), Qt(vt, () =>
|
|
4418
|
+
d(le, "adjustTextareaHeight"), Qt(vt, () => Us(() => le()));
|
|
4424
4419
|
function de() {
|
|
4425
4420
|
l.value?.click();
|
|
4426
4421
|
}
|
|
4427
4422
|
d(de, "triggerFileInput");
|
|
4428
|
-
async function $e(
|
|
4429
|
-
const m =
|
|
4430
|
-
!T || !a.chatController ||
|
|
4423
|
+
async function $e(_) {
|
|
4424
|
+
const m = _.target, T = m.files?.[0];
|
|
4425
|
+
!T || !a.chatController || K.value || (await a.chatController.attachFile({ file: T }), m.value = "");
|
|
4431
4426
|
}
|
|
4432
4427
|
d($e, "handleFileSelect");
|
|
4433
|
-
function
|
|
4434
|
-
a.chatController?.removeAttachment({ index:
|
|
4428
|
+
function Ke(_) {
|
|
4429
|
+
a.chatController?.removeAttachment({ index: _ });
|
|
4435
4430
|
}
|
|
4436
|
-
d(
|
|
4431
|
+
d(Ke, "removeAttachment");
|
|
4437
4432
|
function je() {
|
|
4438
4433
|
Ce.value?.start();
|
|
4439
4434
|
}
|
|
4440
4435
|
d(je, "startRecording");
|
|
4441
|
-
function ze(
|
|
4442
|
-
Ce.value?.finish(
|
|
4436
|
+
function ze(_) {
|
|
4437
|
+
Ce.value?.finish(_);
|
|
4443
4438
|
}
|
|
4444
4439
|
d(ze, "finishRecording");
|
|
4445
|
-
function Fe(
|
|
4440
|
+
function Fe(_, m) {
|
|
4446
4441
|
if (m === 0) {
|
|
4447
|
-
const ct =
|
|
4442
|
+
const ct = _[m];
|
|
4448
4443
|
return ct?.timestamp ? Xe(new Date(ct.timestamp)) : null;
|
|
4449
4444
|
}
|
|
4450
|
-
const T =
|
|
4445
|
+
const T = _[m - 1], ae = _[m];
|
|
4451
4446
|
if (!T?.timestamp || !ae?.timestamp) return null;
|
|
4452
4447
|
const U = new Date(T.timestamp).getTime();
|
|
4453
4448
|
return new Date(ae.timestamp).getTime() - U > 36e5 ? Xe(new Date(ae.timestamp)) : null;
|
|
4454
4449
|
}
|
|
4455
4450
|
d(Fe, "shouldShowTimeDivider");
|
|
4456
|
-
function Xe(
|
|
4457
|
-
const m = /* @__PURE__ */ new Date(), T =
|
|
4451
|
+
function Xe(_) {
|
|
4452
|
+
const m = /* @__PURE__ */ new Date(), T = _.toDateString() === m.toDateString(), ae = new Date(m);
|
|
4458
4453
|
ae.setDate(ae.getDate() - 1);
|
|
4459
|
-
const U =
|
|
4454
|
+
const U = _.toDateString() === ae.toDateString(), oe = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
4460
4455
|
if (T) return oe;
|
|
4461
4456
|
if (U) return `Yesterday, ${oe}`;
|
|
4462
|
-
const Ze =
|
|
4463
|
-
return `${
|
|
4457
|
+
const Ze = _.getFullYear() === m.getFullYear();
|
|
4458
|
+
return `${_.toLocaleDateString("en-US", {
|
|
4464
4459
|
weekday: "long",
|
|
4465
4460
|
month: "short",
|
|
4466
4461
|
day: "numeric",
|
|
4467
4462
|
...Ze ? {} : { year: "numeric" }
|
|
4468
4463
|
})}, ${oe}`;
|
|
4469
4464
|
}
|
|
4470
|
-
return d(Xe, "formatTimeDivider"), (
|
|
4465
|
+
return d(Xe, "formatTimeDivider"), (_, m) => (h(), f("div", fl, [
|
|
4471
4466
|
v.value ? a.showHeader ? (h(), f("div", gl, [
|
|
4472
4467
|
w("div", vl, [
|
|
4473
4468
|
Ne(Qa, {
|
|
@@ -4477,12 +4472,12 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4477
4472
|
class: "size-10"
|
|
4478
4473
|
}, null, 8, ["agent"]),
|
|
4479
4474
|
w("div", xl, [
|
|
4480
|
-
w("div",
|
|
4481
|
-
w("div",
|
|
4475
|
+
w("div", yl, j(a.agent.displayName.value), 1),
|
|
4476
|
+
w("div", bl, j(a.agent.title.value || "Assistant"), 1)
|
|
4482
4477
|
]),
|
|
4483
|
-
a.headerMeta ? (h(), f("span", kl,
|
|
4478
|
+
a.headerMeta ? (h(), f("span", kl, j(a.headerMeta), 1)) : H("", !0)
|
|
4484
4479
|
])
|
|
4485
|
-
])) :
|
|
4480
|
+
])) : H("", !0) : (h(), f("div", ml, [
|
|
4486
4481
|
Ne(Va, {
|
|
4487
4482
|
agent: a.agent,
|
|
4488
4483
|
"is-online": R.value
|
|
@@ -4495,7 +4490,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4495
4490
|
w("i", {
|
|
4496
4491
|
class: C(["i-heroicons-cloud-arrow-down size-8", v.value ? "text-theme-300" : "text-white/40"])
|
|
4497
4492
|
}, null, 2),
|
|
4498
|
-
w("span", null,
|
|
4493
|
+
w("span", null, j(E.value), 1)
|
|
4499
4494
|
], 2)) : A.value ? (h(), f("div", {
|
|
4500
4495
|
key: 3,
|
|
4501
4496
|
class: C(["py-16 flex flex-col items-center justify-center gap-2 text-sm", v.value ? "text-theme-400" : "text-theme-600"])
|
|
@@ -4506,18 +4501,18 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4506
4501
|
class: C(["flex items-center justify-center gap-1.5 py-2 text-[11px]", D.value])
|
|
4507
4502
|
}, [
|
|
4508
4503
|
m[19] || (m[19] = w("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
4509
|
-
w("span", null,
|
|
4510
|
-
], 2)) :
|
|
4504
|
+
w("span", null, j(a.setupHint), 1)
|
|
4505
|
+
], 2)) : H("", !0),
|
|
4511
4506
|
Ne(pl, {
|
|
4512
4507
|
ref_key: "chatScroller",
|
|
4513
4508
|
ref: i,
|
|
4514
4509
|
class: "flex-1"
|
|
4515
4510
|
}, {
|
|
4516
|
-
default:
|
|
4511
|
+
default: Bs(() => [
|
|
4517
4512
|
w("div", {
|
|
4518
|
-
class: C(
|
|
4513
|
+
class: C($.value.length === 0 ? "flex-1 flex flex-col items-center justify-center px-3 pb-[112px]" : "pt-4 pb-[120px] px-3 space-y-2")
|
|
4519
4514
|
}, [
|
|
4520
|
-
|
|
4515
|
+
$.value.length === 0 && !A.value && !k.value ? (h(), f("div", wl, [
|
|
4521
4516
|
w("div", Tl, [
|
|
4522
4517
|
w("img", {
|
|
4523
4518
|
src: a.agent.avatarUrl.value,
|
|
@@ -4529,14 +4524,14 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4529
4524
|
class: C(["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", v.value ? "bg-white" : "bg-theme-900"])
|
|
4530
4525
|
}, [...m[20] || (m[20] = [
|
|
4531
4526
|
w("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
4532
|
-
])], 2)) :
|
|
4527
|
+
])], 2)) : H("", !0)
|
|
4533
4528
|
]),
|
|
4534
4529
|
w("div", {
|
|
4535
4530
|
class: C(["text-base @sm/chat:text-lg font-semibold", v.value ? "text-theme-900" : "text-white"])
|
|
4536
|
-
},
|
|
4531
|
+
}, j(a.agent.displayName.value), 3),
|
|
4537
4532
|
w("p", {
|
|
4538
4533
|
class: C(["mt-1 text-center text-xs @sm/chat:text-sm", D.value])
|
|
4539
|
-
},
|
|
4534
|
+
}, j(a.emptyStateMessage || "Type your message to get started."), 3),
|
|
4540
4535
|
w("div", {
|
|
4541
4536
|
class: C(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", v.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
4542
4537
|
title: e.value.tooltip
|
|
@@ -4544,34 +4539,34 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4544
4539
|
w("i", {
|
|
4545
4540
|
class: C([e.value.icon, "size-3"])
|
|
4546
4541
|
}, null, 2),
|
|
4547
|
-
w("span", null,
|
|
4542
|
+
w("span", null, j(e.value.label), 1)
|
|
4548
4543
|
], 10, Al)
|
|
4549
|
-
])) :
|
|
4550
|
-
(h(!0), f(
|
|
4544
|
+
])) : H("", !0),
|
|
4545
|
+
(h(!0), f(ee, null, me($.value, (T, ae) => (h(), f(ee, {
|
|
4551
4546
|
key: T.id
|
|
4552
4547
|
}, [
|
|
4553
|
-
Fe(
|
|
4548
|
+
Fe($.value, ae) ? (h(), f("div", _l, [
|
|
4554
4549
|
w("div", {
|
|
4555
|
-
class: C(["flex-1 h-px",
|
|
4550
|
+
class: C(["flex-1 h-px", L.value])
|
|
4556
4551
|
}, null, 2),
|
|
4557
4552
|
w("span", {
|
|
4558
4553
|
class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", D.value])
|
|
4559
|
-
},
|
|
4554
|
+
}, j(Fe($.value, ae)), 3),
|
|
4560
4555
|
w("div", {
|
|
4561
|
-
class: C(["flex-1 h-px",
|
|
4556
|
+
class: C(["flex-1 h-px", L.value])
|
|
4562
4557
|
}, null, 2)
|
|
4563
|
-
])) :
|
|
4564
|
-
|
|
4558
|
+
])) : H("", !0),
|
|
4559
|
+
J(T) ? (h(), f("div", {
|
|
4565
4560
|
key: 1,
|
|
4566
4561
|
"data-test": "messaging-message-tool-activity",
|
|
4567
|
-
"data-journal-outcome":
|
|
4562
|
+
"data-journal-outcome": J(T)?.outcome,
|
|
4568
4563
|
class: "mb-4 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
|
|
4569
4564
|
}, [
|
|
4570
|
-
Ne(
|
|
4571
|
-
model:
|
|
4565
|
+
Ne(Mn, {
|
|
4566
|
+
model: J(T),
|
|
4572
4567
|
"is-light": v.value
|
|
4573
4568
|
}, null, 8, ["model", "is-light"])
|
|
4574
|
-
], 8,
|
|
4569
|
+
], 8, El)) : H("", !0),
|
|
4575
4570
|
p(T) ? (h(), f("div", {
|
|
4576
4571
|
key: 2,
|
|
4577
4572
|
"data-test": "messaging-system-msg",
|
|
@@ -4594,18 +4589,18 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4594
4589
|
w("div", {
|
|
4595
4590
|
class: C(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", v.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
|
|
4596
4591
|
}, [
|
|
4597
|
-
T.text ? (h(), kt(
|
|
4592
|
+
T.text ? (h(), kt(Kt, {
|
|
4598
4593
|
key: 0,
|
|
4599
4594
|
text: T.text,
|
|
4600
4595
|
inverted: !v.value,
|
|
4601
4596
|
streaming: T.id === se.value,
|
|
4602
4597
|
onClick: m[0] || (m[0] = Le(() => {
|
|
4603
4598
|
}, ["stop"]))
|
|
4604
|
-
}, null, 8, ["text", "inverted", "streaming"])) : T.issue?.help ? (h(), kt(
|
|
4599
|
+
}, null, 8, ["text", "inverted", "streaming"])) : T.issue?.help ? (h(), kt(Kt, {
|
|
4605
4600
|
key: 1,
|
|
4606
4601
|
text: T.issue.help,
|
|
4607
4602
|
inverted: !v.value
|
|
4608
|
-
}, null, 8, ["text", "inverted"])) :
|
|
4603
|
+
}, null, 8, ["text", "inverted"])) : H("", !0),
|
|
4609
4604
|
T.issue?.actionUrl && !o(T.text) ? (h(), f("a", {
|
|
4610
4605
|
key: 2,
|
|
4611
4606
|
href: T.issue.actionUrl,
|
|
@@ -4614,9 +4609,9 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4614
4609
|
onClick: m[1] || (m[1] = Le(() => {
|
|
4615
4610
|
}, ["stop"]))
|
|
4616
4611
|
}, [
|
|
4617
|
-
ot(
|
|
4612
|
+
ot(j(T.issue.actionLabel) + " ", 1),
|
|
4618
4613
|
m[21] || (m[21] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
4619
|
-
], 10, Cl)) :
|
|
4614
|
+
], 10, Cl)) : H("", !0)
|
|
4620
4615
|
], 2)
|
|
4621
4616
|
])
|
|
4622
4617
|
], 8, Rl)) : T.sender === "system" ? (h(), f("div", {
|
|
@@ -4633,7 +4628,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4633
4628
|
class: C(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", v.value ? "text-theme-500" : "text-white/60"])
|
|
4634
4629
|
}, [
|
|
4635
4630
|
m[22] || (m[22] = w("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
|
|
4636
|
-
Ne(
|
|
4631
|
+
Ne(Kt, {
|
|
4637
4632
|
text: T.text,
|
|
4638
4633
|
inverted: !v.value,
|
|
4639
4634
|
onClick: m[2] || (m[2] = Le(() => {
|
|
@@ -4653,17 +4648,17 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4653
4648
|
"justify-start": T.sender === "agent",
|
|
4654
4649
|
// Group-aware rhythm: tight (space-y) within a speaker's turn,
|
|
4655
4650
|
// generous at the boundary between speakers (end of a group).
|
|
4656
|
-
"mb-6": c(
|
|
4651
|
+
"mb-6": c($.value, ae)
|
|
4657
4652
|
}])
|
|
4658
4653
|
}, [
|
|
4659
4654
|
T.sender === "agent" ? (h(), f("div", Ll, [
|
|
4660
|
-
c(
|
|
4655
|
+
c($.value, ae) ? (h(), f("img", {
|
|
4661
4656
|
key: 0,
|
|
4662
4657
|
src: a.agent.avatarUrl.value,
|
|
4663
4658
|
alt: a.agent.displayName.value,
|
|
4664
4659
|
class: C(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", v.value ? "ring-1 ring-black/5" : ""])
|
|
4665
|
-
}, null, 10, Dl)) :
|
|
4666
|
-
])) :
|
|
4660
|
+
}, null, 10, Dl)) : H("", !0)
|
|
4661
|
+
])) : H("", !0),
|
|
4667
4662
|
w("div", {
|
|
4668
4663
|
"data-test": "messaging-message-body",
|
|
4669
4664
|
class: C(T.sender === "user" ? "max-w-[min(75%,22rem)]" : "max-w-[min(82%,68ch)]")
|
|
@@ -4672,7 +4667,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4672
4667
|
key: 0,
|
|
4673
4668
|
class: C(["mb-1 space-y-1", T.sender === "user" ? "flex flex-col items-end" : ""])
|
|
4674
4669
|
}, [
|
|
4675
|
-
(h(!0), f(
|
|
4670
|
+
(h(!0), f(ee, null, me(Pe(T), ({ attachment: U, index: oe }) => (h(), f(ee, {
|
|
4676
4671
|
key: Ae(U, oe)
|
|
4677
4672
|
}, [
|
|
4678
4673
|
U.type === "image" ? (h(), f("img", {
|
|
@@ -4699,10 +4694,10 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4699
4694
|
class: C(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", v.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
4700
4695
|
}, [
|
|
4701
4696
|
m[23] || (m[23] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
4702
|
-
ot(" " +
|
|
4697
|
+
ot(" " + j(U.filename), 1)
|
|
4703
4698
|
], 10, Nl))
|
|
4704
4699
|
], 64))), 128))
|
|
4705
|
-
], 2)) :
|
|
4700
|
+
], 2)) : H("", !0),
|
|
4706
4701
|
St(T).length ? (h(), f("div", {
|
|
4707
4702
|
key: 1,
|
|
4708
4703
|
"data-test": "messaging-message-content",
|
|
@@ -4710,11 +4705,11 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4710
4705
|
T.sender === "user" ? v.value ? "rounded-2xl px-3.5 py-2 bg-theme-900 text-theme-0" : "rounded-2xl px-3.5 py-2 bg-theme-0 text-theme-950" : v.value ? "text-theme-800" : "text-white/95"
|
|
4711
4706
|
)
|
|
4712
4707
|
}, [
|
|
4713
|
-
(h(!0), f(
|
|
4708
|
+
(h(!0), f(ee, null, me(St(T), (U) => (h(), f(ee, {
|
|
4714
4709
|
key: U.key
|
|
4715
4710
|
}, [
|
|
4716
4711
|
U.kind === "text" && U.text ? (h(), f("div", Pl, [
|
|
4717
|
-
Ne(
|
|
4712
|
+
Ne(Kt, {
|
|
4718
4713
|
text: U.text,
|
|
4719
4714
|
inverted: T.sender === "user" || !v.value,
|
|
4720
4715
|
streaming: T.id === se.value,
|
|
@@ -4745,14 +4740,14 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4745
4740
|
class: C(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", v.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
4746
4741
|
}, [
|
|
4747
4742
|
m[24] || (m[24] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
4748
|
-
ot(" " +
|
|
4749
|
-
], 10, Ul)) :
|
|
4743
|
+
ot(" " + j(U.attachment.filename), 1)
|
|
4744
|
+
], 10, Ul)) : H("", !0)
|
|
4750
4745
|
], 64))), 128))
|
|
4751
|
-
], 2)) :
|
|
4746
|
+
], 2)) : H("", !0)
|
|
4752
4747
|
], 2)
|
|
4753
4748
|
], 10, $l)),
|
|
4754
|
-
T.id === B.value ? (h(), f(
|
|
4755
|
-
|
|
4749
|
+
T.id === B.value ? (h(), f(ee, { key: 5 }, [
|
|
4750
|
+
O.value.length ? (h(!0), f(ee, { key: 0 }, me(O.value, (U) => (h(), f(ee, {
|
|
4756
4751
|
key: U.id
|
|
4757
4752
|
}, [
|
|
4758
4753
|
U.kind === "work" ? (h(), f("div", {
|
|
@@ -4761,7 +4756,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4761
4756
|
"data-journal-outcome": U.journal.outcome,
|
|
4762
4757
|
class: "mb-4 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
|
|
4763
4758
|
}, [
|
|
4764
|
-
Ne(
|
|
4759
|
+
Ne(Mn, {
|
|
4765
4760
|
model: U.journal,
|
|
4766
4761
|
"is-light": v.value
|
|
4767
4762
|
}, null, 8, ["model", "is-light"])
|
|
@@ -4770,7 +4765,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4770
4765
|
"data-test": "messaging-live-text-block",
|
|
4771
4766
|
class: C(["mb-4", v.value ? "text-theme-800" : "text-white/95"])
|
|
4772
4767
|
}, [
|
|
4773
|
-
Ne(
|
|
4768
|
+
Ne(Kt, {
|
|
4774
4769
|
text: U.content,
|
|
4775
4770
|
inverted: !v.value,
|
|
4776
4771
|
streaming: U.id === Z.value,
|
|
@@ -4782,31 +4777,31 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4782
4777
|
class: C(["size-3.5", v.value ? "text-theme-500" : "text-white/70"])
|
|
4783
4778
|
}, null, 8, ["class"])
|
|
4784
4779
|
]))
|
|
4785
|
-
], 64))), 128)) :
|
|
4780
|
+
], 64))), 128)) : W.value ? (h(), f("div", {
|
|
4786
4781
|
key: 1,
|
|
4787
4782
|
"data-test": "messaging-tool-activity",
|
|
4788
|
-
"data-journal-outcome":
|
|
4783
|
+
"data-journal-outcome": W.value.outcome,
|
|
4789
4784
|
class: "mb-4 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
|
|
4790
4785
|
}, [
|
|
4791
|
-
Ne(
|
|
4792
|
-
model:
|
|
4786
|
+
Ne(Mn, {
|
|
4787
|
+
model: W.value,
|
|
4793
4788
|
"is-light": v.value
|
|
4794
4789
|
}, null, 8, ["model", "is-light"])
|
|
4795
|
-
], 8, Wl)) :
|
|
4796
|
-
], 64)) :
|
|
4790
|
+
], 8, Wl)) : H("", !0)
|
|
4791
|
+
], 64)) : H("", !0)
|
|
4797
4792
|
], 64))), 128)),
|
|
4798
|
-
|
|
4793
|
+
N.value ? (h(), f("div", {
|
|
4799
4794
|
key: 1,
|
|
4800
4795
|
"data-test": "messaging-working-state",
|
|
4801
|
-
"data-working-description":
|
|
4796
|
+
"data-working-description": N.value,
|
|
4802
4797
|
class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", v.value ? "text-theme-500" : "text-white/45"])
|
|
4803
4798
|
}, [
|
|
4804
4799
|
m[25] || (m[25] = w("i", {
|
|
4805
4800
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
4806
4801
|
"aria-hidden": "true"
|
|
4807
4802
|
}, null, -1)),
|
|
4808
|
-
w("span", Vl,
|
|
4809
|
-
], 10, Gl)) :
|
|
4803
|
+
w("span", Vl, j(N.value), 1)
|
|
4804
|
+
], 10, Gl)) : H("", !0),
|
|
4810
4805
|
De.value ? (h(), f("div", {
|
|
4811
4806
|
key: 2,
|
|
4812
4807
|
"data-test": "messaging-transient-issue",
|
|
@@ -4818,10 +4813,10 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4818
4813
|
"aria-hidden": "true"
|
|
4819
4814
|
}, null, -1)),
|
|
4820
4815
|
w("span", null, [
|
|
4821
|
-
ot(
|
|
4822
|
-
De.value.help ? (h(), f(
|
|
4823
|
-
ot(
|
|
4824
|
-
], 64)) :
|
|
4816
|
+
ot(j(De.value.message), 1),
|
|
4817
|
+
De.value.help ? (h(), f(ee, { key: 0 }, [
|
|
4818
|
+
ot(j(De.value.help), 1)
|
|
4819
|
+
], 64)) : H("", !0)
|
|
4825
4820
|
]),
|
|
4826
4821
|
De.value.actionUrl && De.value.actionLabel ? (h(), f("a", {
|
|
4827
4822
|
key: 0,
|
|
@@ -4829,9 +4824,9 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4829
4824
|
class: "shrink-0 underline underline-offset-2",
|
|
4830
4825
|
onClick: m[5] || (m[5] = Le(() => {
|
|
4831
4826
|
}, ["stop"]))
|
|
4832
|
-
},
|
|
4833
|
-
], 10, ql)) :
|
|
4834
|
-
st.value ? (h(), f("div",
|
|
4827
|
+
}, j(De.value.actionLabel), 9, Yl)) : H("", !0)
|
|
4828
|
+
], 10, ql)) : H("", !0),
|
|
4829
|
+
st.value ? (h(), f("div", Kl, [
|
|
4835
4830
|
w("img", {
|
|
4836
4831
|
src: a.agent.avatarUrl.value,
|
|
4837
4832
|
alt: a.agent.displayName.value,
|
|
@@ -4841,7 +4836,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4841
4836
|
class: C(["i-svg-spinners-3-dots-bounce size-7", v.value ? "text-theme-400" : "text-white/50"]),
|
|
4842
4837
|
"aria-hidden": "true"
|
|
4843
4838
|
}, null, 2)
|
|
4844
|
-
])) :
|
|
4839
|
+
])) : H("", !0)
|
|
4845
4840
|
], 2)
|
|
4846
4841
|
]),
|
|
4847
4842
|
_: 1
|
|
@@ -4850,7 +4845,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4850
4845
|
class: C(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", v.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"])
|
|
4851
4846
|
}, [
|
|
4852
4847
|
Me.value.length > 0 ? (h(), f("div", Zl, [
|
|
4853
|
-
(h(!0), f(
|
|
4848
|
+
(h(!0), f(ee, null, me(Me.value, (T, ae) => (h(), f("div", {
|
|
4854
4849
|
key: ae,
|
|
4855
4850
|
class: "relative shrink-0 group"
|
|
4856
4851
|
}, [
|
|
@@ -4864,20 +4859,20 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4864
4859
|
class: C(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", v.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
4865
4860
|
}, [
|
|
4866
4861
|
m[27] || (m[27] = w("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
4867
|
-
w("span", Ql,
|
|
4862
|
+
w("span", Ql, j(T.filename), 1)
|
|
4868
4863
|
], 2)),
|
|
4869
4864
|
w("button", {
|
|
4870
4865
|
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",
|
|
4871
|
-
onClick: /* @__PURE__ */ d((U) =>
|
|
4866
|
+
onClick: /* @__PURE__ */ d((U) => Ke(ae), "onClick")
|
|
4872
4867
|
}, [...m[28] || (m[28] = [
|
|
4873
4868
|
w("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
4874
4869
|
])], 8, eo)
|
|
4875
4870
|
]))), 128)),
|
|
4876
4871
|
it.value ? (h(), f("div", to, [
|
|
4877
4872
|
Ne(En, { class: "size-5" })
|
|
4878
|
-
])) :
|
|
4879
|
-
])) :
|
|
4880
|
-
|
|
4873
|
+
])) : H("", !0)
|
|
4874
|
+
])) : H("", !0),
|
|
4875
|
+
ye.value ? (h(), f("input", {
|
|
4881
4876
|
key: 1,
|
|
4882
4877
|
ref_key: "fileInput",
|
|
4883
4878
|
ref: l,
|
|
@@ -4885,7 +4880,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4885
4880
|
accept: "image/*,audio/*,video/*",
|
|
4886
4881
|
class: "hidden",
|
|
4887
4882
|
onChange: $e
|
|
4888
|
-
}, null, 544)) :
|
|
4883
|
+
}, null, 544)) : H("", !0),
|
|
4889
4884
|
w("div", {
|
|
4890
4885
|
"data-test": "messaging-composer",
|
|
4891
4886
|
"data-composer-action": Ie.value,
|
|
@@ -4893,29 +4888,29 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4893
4888
|
}, [
|
|
4894
4889
|
w("button", {
|
|
4895
4890
|
class: C(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
4896
|
-
|
|
4891
|
+
ye.value ? "cursor-pointer" : "cursor-default",
|
|
4897
4892
|
v.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
4898
|
-
it.value ||
|
|
4893
|
+
it.value || K.value ? "opacity-50 pointer-events-none" : ""
|
|
4899
4894
|
]]),
|
|
4900
|
-
disabled: at.value || it.value ||
|
|
4901
|
-
"aria-label":
|
|
4902
|
-
title:
|
|
4903
|
-
onClick: m[6] || (m[6] = (T) =>
|
|
4895
|
+
disabled: at.value || it.value || K.value || !ye.value,
|
|
4896
|
+
"aria-label": ye.value ? "Attach file" : "File attachments unavailable",
|
|
4897
|
+
title: ye.value ? "Attach file" : "File attachments unavailable",
|
|
4898
|
+
onClick: m[6] || (m[6] = (T) => ye.value && de())
|
|
4904
4899
|
}, [
|
|
4905
4900
|
it.value ? (h(), f("i", ao)) : (h(), f("i", io)),
|
|
4906
|
-
w("span", ro,
|
|
4901
|
+
w("span", ro, j(ye.value ? "Attach file" : "File attachments unavailable"), 1)
|
|
4907
4902
|
], 10, so),
|
|
4908
|
-
|
|
4903
|
+
be.value ? (h(), f("div", {
|
|
4909
4904
|
key: 1,
|
|
4910
4905
|
"data-test": "messaging-recording-state",
|
|
4911
4906
|
class: C(["flex min-w-0 flex-1 items-center gap-2 px-1 py-2", v.value ? "text-theme-700" : "text-white/80"])
|
|
4912
4907
|
}, [
|
|
4913
4908
|
m[29] || (m[29] = w("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
4914
|
-
w("span", oo,
|
|
4909
|
+
w("span", oo, j(g.value), 1),
|
|
4915
4910
|
w("span", {
|
|
4916
4911
|
class: C(["min-w-0 truncate text-sm", v.value ? "text-theme-400" : "text-white/45"])
|
|
4917
|
-
},
|
|
4918
|
-
], 2)) :
|
|
4912
|
+
}, j(M.value), 3)
|
|
4913
|
+
], 2)) : Fs((h(), f("textarea", {
|
|
4919
4914
|
key: 0,
|
|
4920
4915
|
ref_key: "textarea",
|
|
4921
4916
|
ref: s,
|
|
@@ -4931,12 +4926,12 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4931
4926
|
onFocus: m[8] || (m[8] = (T) => n.value = !0),
|
|
4932
4927
|
onBlur: m[9] || (m[9] = (T) => n.value = !1)
|
|
4933
4928
|
}, null, 42, lo)), [
|
|
4934
|
-
[
|
|
4929
|
+
[ka, vt.value]
|
|
4935
4930
|
]),
|
|
4936
|
-
rt.value ||
|
|
4931
|
+
rt.value || be.value ? (h(), f("button", {
|
|
4937
4932
|
key: 2,
|
|
4938
4933
|
"data-test": "messaging-record-audio-btn",
|
|
4939
|
-
class: C(["mb-0.5 mr-0.5 flex size-9 shrink-0 items-center justify-center rounded-full transition-transform duration-200 @sm/chat:size-10",
|
|
4934
|
+
class: C(["mb-0.5 mr-0.5 flex size-9 shrink-0 items-center justify-center rounded-full transition-transform duration-200 @sm/chat:size-10", be.value ? "bg-theme-900 text-theme-0 scale-105 cursor-pointer" : v.value ? "text-theme-500 hover:bg-black/5 hover:text-theme-700 cursor-pointer" : "text-white/60 hover:bg-white/10 hover:text-white cursor-pointer"]),
|
|
4940
4935
|
"aria-label": u.value,
|
|
4941
4936
|
title: u.value,
|
|
4942
4937
|
onPointerdown: m[10] || (m[10] = Le((T) => je(), ["prevent"])),
|
|
@@ -4953,9 +4948,9 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4953
4948
|
]
|
|
4954
4949
|
}, [
|
|
4955
4950
|
w("i", {
|
|
4956
|
-
class: C([
|
|
4951
|
+
class: C([be.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-5"])
|
|
4957
4952
|
}, null, 2),
|
|
4958
|
-
w("span", uo,
|
|
4953
|
+
w("span", uo, j(u.value), 1)
|
|
4959
4954
|
], 42, co)) : (h(), f("button", {
|
|
4960
4955
|
key: 3,
|
|
4961
4956
|
"data-test": "messaging-send-btn",
|
|
@@ -4967,7 +4962,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4967
4962
|
onClick: m[18] || (m[18] = (T) => pe())
|
|
4968
4963
|
}, [
|
|
4969
4964
|
Ie.value === "stop" ? (h(), f("i", po)) : (h(), f("i", fo)),
|
|
4970
|
-
w("span", mo,
|
|
4965
|
+
w("span", mo, j(Be.value), 1)
|
|
4971
4966
|
], 10, ho))
|
|
4972
4967
|
], 10, no)
|
|
4973
4968
|
], 2)
|
|
@@ -4990,7 +4985,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4990
4985
|
apiBase: {}
|
|
4991
4986
|
},
|
|
4992
4987
|
setup(a) {
|
|
4993
|
-
const t =
|
|
4988
|
+
const t = Sa("AgentWrap"), e = a, n = e.sdk || Aa.getInstance({
|
|
4994
4989
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
4995
4990
|
...e.apiBase && { apiBase: e.apiBase }
|
|
4996
4991
|
}), i = ge(!e.agent), s = ht(e.agent ? new hn({ config: e.agent }) : void 0), l = ge();
|
|
@@ -5082,22 +5077,22 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
5082
5077
|
buttonText: a.buttonText,
|
|
5083
5078
|
buttonIcon: a.buttonIcon,
|
|
5084
5079
|
loading: i.value
|
|
5085
|
-
}) :
|
|
5080
|
+
}) : H("", !0)
|
|
5086
5081
|
]));
|
|
5087
5082
|
}
|
|
5088
5083
|
});
|
|
5089
5084
|
export {
|
|
5090
|
-
|
|
5085
|
+
ps as A,
|
|
5091
5086
|
Ro as _,
|
|
5092
|
-
|
|
5093
|
-
|
|
5087
|
+
Kt as a,
|
|
5088
|
+
Eo as b,
|
|
5094
5089
|
Ao as c,
|
|
5095
5090
|
So as d,
|
|
5096
|
-
|
|
5091
|
+
_o as e,
|
|
5097
5092
|
En as f,
|
|
5098
5093
|
wo as g,
|
|
5099
5094
|
Va as h,
|
|
5100
|
-
|
|
5095
|
+
ms as i,
|
|
5101
5096
|
To as p
|
|
5102
5097
|
};
|
|
5103
5098
|
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map
|