@pagelines/sdk 1.0.654 → 1.0.655
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (a, t) =>
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as Me, openBlock as h, createElementBlock as f, createElementVNode as
|
|
6
|
-
import { SettingsObject as
|
|
1
|
+
var os = Object.defineProperty;
|
|
2
|
+
var pa = (a, t, e) => t in a ? os(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var u = (a, t) => os(a, "name", { value: t, configurable: !0 });
|
|
4
|
+
var P = (a, t, e) => pa(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { defineComponent as Me, openBlock as h, createElementBlock as f, createElementVNode as y, normalizeClass as _, ref as ge, computed as T, shallowRef as It, watch as Kt, createCommentVNode as G, renderSlot as fn, onMounted as Yt, unref as on, Fragment as se, toDisplayString as W, reactive as fa, onUnmounted as Os, createBlock as mt, Teleport as ma, createVNode as Je, Transition as ga, withCtx as zs, withDirectives as Ns, normalizeStyle as K, createTextVNode as nt, vShow as va, nextTick as Ps, renderList as ve, onBeforeUnmount as Fs, withModifiers as Oe, vModelText as xa, withKeys as Bt } from "vue";
|
|
6
|
+
import { SettingsObject as Bs, Agent as cn, CHAT_ISSUE_COPY as ba, getDefaultAvatarUrl as Nn, parseChatVisualFencePayload as ya, createLogger as ka } from "@pagelines/core";
|
|
7
7
|
import { P as wa } from "./sdkClient.js";
|
|
8
8
|
const Ta = { class: "spinner max-w-sm" }, Sa = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
|
-
},
|
|
11
|
+
}, cs = /* @__PURE__ */ Me({
|
|
12
12
|
__name: "FSpinner",
|
|
13
13
|
props: {
|
|
14
14
|
width: { type: String, default: "" },
|
|
@@ -17,8 +17,8 @@ const Ta = { class: "spinner max-w-sm" }, Sa = {
|
|
|
17
17
|
setup(a) {
|
|
18
18
|
return (t, e) => (h(), f("div", Ta, [
|
|
19
19
|
(h(), f("svg", Sa, [
|
|
20
|
-
|
|
21
|
-
class:
|
|
20
|
+
y("circle", {
|
|
21
|
+
class: _([a.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
23
23
|
cy: "50",
|
|
24
24
|
r: "20",
|
|
@@ -44,22 +44,22 @@ function _a() {
|
|
|
44
44
|
return typeof MediaRecorder > "u" ? "" : ["audio/webm;codecs=opus", "audio/mp4", "audio/webm"].find((t) => MediaRecorder.isTypeSupported?.(t)) || "";
|
|
45
45
|
}
|
|
46
46
|
u(_a, "recorderMimeType");
|
|
47
|
-
const
|
|
47
|
+
const qn = class qn extends Bs {
|
|
48
48
|
constructor(e) {
|
|
49
49
|
super("VoiceRecorderController", e);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
P(this, "state", ge({ phase: "idle", elapsedMs: 0 }));
|
|
51
|
+
P(this, "isActive", T(() => this.state.value.phase !== "idle"));
|
|
52
|
+
P(this, "isBusy", T(() => this.state.value.phase !== "idle"));
|
|
53
|
+
P(this, "elapsedLabel", T(() => Aa({ ms: this.state.value.elapsedMs })));
|
|
54
|
+
P(this, "statusText", T(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send"));
|
|
55
|
+
P(this, "recorder");
|
|
56
|
+
P(this, "stream");
|
|
57
|
+
P(this, "chunks", []);
|
|
58
|
+
P(this, "timer");
|
|
59
|
+
P(this, "startedAt", 0);
|
|
60
|
+
P(this, "cancelOnStop", !1);
|
|
61
|
+
P(this, "stopAfterStart", !1);
|
|
62
|
+
P(this, "startToken", 0);
|
|
63
63
|
}
|
|
64
64
|
get canUseBrowserRecording() {
|
|
65
65
|
return !!this.settings.getUserMedia || typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof MediaRecorder < "u";
|
|
@@ -155,20 +155,21 @@ const Kn = class Kn extends Us {
|
|
|
155
155
|
(this.settings.clearInterval ?? clearInterval)(e);
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
-
u(
|
|
159
|
-
let
|
|
158
|
+
u(qn, "VoiceRecorderController");
|
|
159
|
+
let $n = qn;
|
|
160
160
|
function Ra(a) {
|
|
161
161
|
return a.turnOutcome === "failed" ? "failed" : a.turnOutcome === "stopped" ? "stopped" : a.sender === "system" ? "failed" : "completed";
|
|
162
162
|
}
|
|
163
163
|
u(Ra, "durableJournalOutcome");
|
|
164
|
-
const
|
|
164
|
+
const pt = {
|
|
165
165
|
waiting: "Waiting for results",
|
|
166
|
+
finishing: "Finishing up",
|
|
166
167
|
completed: "Work complete",
|
|
167
168
|
failed: "Couldn’t finish",
|
|
168
169
|
stopped: "Stopped",
|
|
169
170
|
notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
|
|
170
|
-
leaveHint: "You can leave this chat while I work."
|
|
171
|
-
},
|
|
171
|
+
leaveHint: "Taking longer than usual. You can leave this chat while I work."
|
|
172
|
+
}, Us = 15e3, Ca = 6e4, Sn = 3;
|
|
172
173
|
function un(a) {
|
|
173
174
|
if (!a)
|
|
174
175
|
return;
|
|
@@ -180,15 +181,15 @@ function $t(a) {
|
|
|
180
181
|
return un(a.endedAt) ?? un(a.startedAt) ?? 0;
|
|
181
182
|
}
|
|
182
183
|
u($t, "eventMs");
|
|
183
|
-
function
|
|
184
|
+
function Dn(a, t) {
|
|
184
185
|
return $t(a) - $t(t);
|
|
185
186
|
}
|
|
186
|
-
u(
|
|
187
|
+
u(Dn, "byEvent");
|
|
187
188
|
function nn(a, t) {
|
|
188
|
-
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(Dn), n = [];
|
|
189
190
|
for (const i of e) {
|
|
190
191
|
const s = i.status === "completed" ? "done" : "failed", l = n[n.length - 1];
|
|
191
|
-
if (s === "done" && l?.tone === "done" && l.label === i.label && $t(i) - l.lastMs <=
|
|
192
|
+
if (s === "done" && l?.tone === "done" && l.label === i.label && $t(i) - l.lastMs <= Us) {
|
|
192
193
|
l.count += 1, l.lastMs = $t(i);
|
|
193
194
|
continue;
|
|
194
195
|
}
|
|
@@ -209,74 +210,77 @@ function An(a) {
|
|
|
209
210
|
};
|
|
210
211
|
}
|
|
211
212
|
u(An, "splitRows");
|
|
212
|
-
function
|
|
213
|
-
const { activities: t, outcome: e, nowMs: n, canNotifyOnCompletion: i,
|
|
213
|
+
function us(a) {
|
|
214
|
+
const { activities: t, outcome: e, nowMs: n, canNotifyOnCompletion: i, lastVisibleProgressAtMs: s, includeFailureNote: l = !0 } = a;
|
|
214
215
|
if (e === "completed")
|
|
215
216
|
return {
|
|
216
217
|
outcome: e,
|
|
217
218
|
visibleRows: [],
|
|
218
219
|
hiddenRows: nn(t, /* @__PURE__ */ new Set()),
|
|
219
|
-
terminal: { id: "work-complete", tone: "completed", label:
|
|
220
|
+
terminal: { id: "work-complete", tone: "completed", label: pt.completed }
|
|
220
221
|
};
|
|
221
222
|
if (e === "failed") {
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
const { visibleRows:
|
|
223
|
+
const N = t.filter((j) => j.status === "failed").sort(Dn).pop(), z = /* @__PURE__ */ new Set();
|
|
224
|
+
N && z.add(N.activityId);
|
|
225
|
+
const { visibleRows: F, hiddenRows: H } = An(nn(t, z));
|
|
225
226
|
return {
|
|
226
227
|
outcome: e,
|
|
227
|
-
visibleRows:
|
|
228
|
-
hiddenRows:
|
|
228
|
+
visibleRows: F,
|
|
229
|
+
hiddenRows: H,
|
|
229
230
|
terminal: {
|
|
230
231
|
id: "work-failed",
|
|
231
232
|
tone: "failed",
|
|
232
|
-
label:
|
|
233
|
-
...
|
|
233
|
+
label: pt.failed,
|
|
234
|
+
...l && N?.note ? { note: N.note } : {}
|
|
234
235
|
}
|
|
235
236
|
};
|
|
236
237
|
}
|
|
237
238
|
if (e === "stopped") {
|
|
238
|
-
const { visibleRows:
|
|
239
|
+
const { visibleRows: N, hiddenRows: z } = An(nn(t, /* @__PURE__ */ new Set()));
|
|
239
240
|
return {
|
|
240
241
|
outcome: e,
|
|
241
|
-
visibleRows:
|
|
242
|
-
hiddenRows:
|
|
243
|
-
terminal: { id: "work-stopped", tone: "stopped", label:
|
|
242
|
+
visibleRows: N,
|
|
243
|
+
hiddenRows: z,
|
|
244
|
+
terminal: { id: "work-stopped", tone: "stopped", label: pt.stopped }
|
|
244
245
|
};
|
|
245
246
|
}
|
|
246
|
-
const { visibleRows:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
const { visibleRows: o, hiddenRows: p } = An(nn(t, /* @__PURE__ */ new Set())), d = t.filter((N) => N.status === "started").sort(Dn).pop(), k = t.reduce(
|
|
248
|
+
(N, z) => Math.max(N, $t(z)),
|
|
249
|
+
s ?? Number.NEGATIVE_INFINITY
|
|
250
|
+
), A = Number.isFinite(k) ? k : n, x = t.reduce((N, z) => {
|
|
251
|
+
const F = un(z.startedAt) ?? un(z.endedAt);
|
|
252
|
+
return F === void 0 ? N : Math.min(N, F);
|
|
253
|
+
}, Number.POSITIVE_INFINITY), w = A + Us, C = (Number.isFinite(x) ? x : A) + Ca, E = n >= w, $ = d || E ? {
|
|
254
|
+
id: d?.activityId ?? "work-active",
|
|
251
255
|
tone: "active",
|
|
252
|
-
label:
|
|
253
|
-
} : void 0,
|
|
256
|
+
label: E ? d ? pt.waiting : pt.finishing : d.label
|
|
257
|
+
} : void 0, Q = E && n >= C ? i ? pt.notifyHint : pt.leaveHint : void 0, D = [w, C].filter((N) => N > n).sort((N, z) => N - z)[0];
|
|
254
258
|
return {
|
|
255
259
|
outcome: e,
|
|
256
|
-
visibleRows:
|
|
257
|
-
hiddenRows:
|
|
258
|
-
|
|
259
|
-
...
|
|
260
|
-
...
|
|
260
|
+
visibleRows: o,
|
|
261
|
+
hiddenRows: p,
|
|
262
|
+
...$ ? { terminal: $ } : {},
|
|
263
|
+
...Q ? { hint: Q } : {},
|
|
264
|
+
...D !== void 0 ? { nextBoundaryAtMs: D } : {}
|
|
261
265
|
};
|
|
262
266
|
}
|
|
263
|
-
u(
|
|
267
|
+
u(us, "buildWorkJournalModel");
|
|
264
268
|
const Ma = [
|
|
265
269
|
{ pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
|
|
266
270
|
{ pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
|
|
267
|
-
],
|
|
271
|
+
], Hs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Ia = /* @__PURE__ */ new Set([...Hs, "EMPTY_STREAM", "RATE_LIMIT"]), js = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), $a = {
|
|
268
272
|
CREDIT_LIMIT: "billing_budget_reached",
|
|
269
273
|
OVERAGE_CAP: "billing_runaway_cap"
|
|
270
274
|
};
|
|
271
275
|
function Da(a) {
|
|
272
276
|
if (!(a.bucket !== void 0 || Ia.has(a.code)))
|
|
273
277
|
return { surface: "hard" };
|
|
274
|
-
const e = a.bucket ?? (
|
|
278
|
+
const e = a.bucket ?? (Hs.has(a.code) ? "account" : "error"), n = {
|
|
275
279
|
...a.actionLabel ? { actionLabel: a.actionLabel } : {},
|
|
276
280
|
...a.actionUrl ? { actionUrl: a.actionUrl } : {},
|
|
277
281
|
...a.help ? { help: a.help } : {}
|
|
278
282
|
};
|
|
279
|
-
return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } :
|
|
283
|
+
return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } : js.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 } };
|
|
280
284
|
}
|
|
281
285
|
u(Da, "presentChatStreamError");
|
|
282
286
|
function La(a) {
|
|
@@ -284,35 +288,31 @@ function La(a) {
|
|
|
284
288
|
return t ? ba[t].oneLine : a.error;
|
|
285
289
|
}
|
|
286
290
|
u(La, "transcriptMessageForChatStreamError");
|
|
287
|
-
const
|
|
291
|
+
const Kn = class Kn extends Bs {
|
|
288
292
|
constructor(e) {
|
|
289
293
|
super("AgentChatController", e);
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
+
P(this, "isTextMode", !1);
|
|
295
|
+
P(this, "lastMessage", { hash: "", time: 0 });
|
|
296
|
+
P(this, "isConnecting", !1);
|
|
297
|
+
P(this, "activeTurnGeneration", 0);
|
|
294
298
|
// One projection clock, advanced only when a scheduled boundary fires — never
|
|
295
299
|
// a ticking counter. buildWorkJournalModel reads this to decide the slow/long
|
|
296
300
|
// transitions; it never creates a row (plans/bots/bot-tool-calling.md).
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
// (plans/bots/bot-tool-calling.md § "deltas are progress"): while this is true
|
|
302
|
-
// the journal suppresses its wait tip. Flips false when a new tool starts after
|
|
303
|
-
// text began, and resets at each turn boundary.
|
|
304
|
-
z(this, "isStreamingText", It(!1));
|
|
301
|
+
P(this, "boundaryTimer");
|
|
302
|
+
P(this, "nowMs", It(Date.now()));
|
|
303
|
+
P(this, "toolActivityTiming", It({}));
|
|
304
|
+
P(this, "lastVisibleProgressAtMs", It());
|
|
305
305
|
// Chat conversation tracking (server-managed persistence)
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
P(this, "conversationId");
|
|
307
|
+
P(this, "textState", ge({
|
|
308
308
|
isActive: !1,
|
|
309
309
|
isConnected: !1,
|
|
310
310
|
isThinking: !1,
|
|
311
311
|
connectionStatus: "disconnected"
|
|
312
312
|
}));
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
P(this, "agentMode", ge("self"));
|
|
314
|
+
P(this, "sharedMessages", ge([]));
|
|
315
|
+
P(this, "composerState", ge({
|
|
316
316
|
text: "",
|
|
317
317
|
pendingAttachments: [],
|
|
318
318
|
isUploading: !1
|
|
@@ -323,24 +323,24 @@ const Yn = class Yn extends Us {
|
|
|
323
323
|
* the two are mutually exclusive). Transient live work is always `running`;
|
|
324
324
|
* Task 7 owns `stopped`.
|
|
325
325
|
*/
|
|
326
|
-
|
|
326
|
+
P(this, "workJournal", T(() => {
|
|
327
327
|
const e = this.textState.value.isThinking ? "running" : this.textState.value.turnOutcome;
|
|
328
328
|
if (!e)
|
|
329
329
|
return;
|
|
330
330
|
const n = this.textState.value.toolActivities;
|
|
331
331
|
if (n?.length)
|
|
332
|
-
return
|
|
332
|
+
return us({
|
|
333
333
|
activities: n,
|
|
334
334
|
outcome: e,
|
|
335
335
|
nowMs: this.nowMs.value,
|
|
336
336
|
canNotifyOnCompletion: !1,
|
|
337
|
-
|
|
337
|
+
lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
|
|
338
338
|
});
|
|
339
339
|
}));
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
340
|
+
P(this, "canUseComposer", T(() => this.textState.value.isConnected && !this.textState.value.sendBlockedReason && !this.composerState.value.isUploading && !this.textState.value.isThinking));
|
|
341
|
+
P(this, "canAttachFile", T(() => !!this.settings.uploadFileFn));
|
|
342
|
+
P(this, "canRecordAudio", T(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0));
|
|
343
|
+
P(this, "voiceRecorder", new $n({
|
|
344
344
|
getCanRecord: /* @__PURE__ */ u(() => this.canRecordAudio.value, "getCanRecord"),
|
|
345
345
|
getUploadFn: /* @__PURE__ */ u(() => {
|
|
346
346
|
const e = this.settings.uploadFileFn;
|
|
@@ -348,10 +348,10 @@ const Yn = class Yn extends Us {
|
|
|
348
348
|
}, "getUploadFn"),
|
|
349
349
|
getChatController: /* @__PURE__ */ u(() => this, "getChatController")
|
|
350
350
|
}));
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
351
|
+
P(this, "canSend", T(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value));
|
|
352
|
+
P(this, "canStop", T(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value));
|
|
353
|
+
P(this, "composerAction", T(() => this.canStop.value ? "stop" : this.canSend.value ? "send" : "idle"));
|
|
354
|
+
P(this, "_agent");
|
|
355
355
|
this._agent = e.agent instanceof cn ? e.agent : new cn({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
|
|
356
356
|
}
|
|
357
357
|
get chatEnabled() {
|
|
@@ -458,11 +458,11 @@ Current User:
|
|
|
458
458
|
updateState(e, n) {
|
|
459
459
|
e.value = { ...e.value, ...n };
|
|
460
460
|
}
|
|
461
|
-
|
|
462
|
-
this.toolActivityTiming.value = {}, this.clearBoundaryTimer();
|
|
461
|
+
resetWorkJournalTiming() {
|
|
462
|
+
this.toolActivityTiming.value = {}, this.lastVisibleProgressAtMs.value = void 0, this.clearBoundaryTimer();
|
|
463
463
|
}
|
|
464
464
|
resetState() {
|
|
465
|
-
this.
|
|
465
|
+
this.resetWorkJournalTiming(), this.updateState(this.textState, {
|
|
466
466
|
isActive: !1,
|
|
467
467
|
isConnected: !1,
|
|
468
468
|
isThinking: !1,
|
|
@@ -541,11 +541,12 @@ Current User:
|
|
|
541
541
|
*/
|
|
542
542
|
workJournalFor(e) {
|
|
543
543
|
if (e.activities?.length)
|
|
544
|
-
return
|
|
544
|
+
return us({
|
|
545
545
|
activities: e.activities,
|
|
546
546
|
outcome: e.outcome,
|
|
547
547
|
nowMs: this.nowMs.value,
|
|
548
|
-
canNotifyOnCompletion: !1
|
|
548
|
+
canNotifyOnCompletion: !1,
|
|
549
|
+
includeFailureNote: e.includeFailureNote
|
|
549
550
|
});
|
|
550
551
|
}
|
|
551
552
|
setupModeWatcher() {
|
|
@@ -637,60 +638,66 @@ Current User:
|
|
|
637
638
|
this.handleError(new Error("Agent handle required for chat"));
|
|
638
639
|
return;
|
|
639
640
|
}
|
|
640
|
-
this.addMessage(e, "user", n), this.
|
|
641
|
+
this.addMessage(e, "user", n), this.resetWorkJournalTiming(), this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, toolActivities: [], transientIssue: void 0, turnOutcome: void 0 });
|
|
641
642
|
const l = ++this.activeTurnGeneration, o = `stream-${Date.now()}`;
|
|
642
643
|
let p = !1, d = !1;
|
|
643
|
-
const k = /* @__PURE__ */ u(() => l === this.activeTurnGeneration, "isCurrentTurn"),
|
|
644
|
+
const k = /* @__PURE__ */ u(() => l === this.activeTurnGeneration, "isCurrentTurn"), A = /* @__PURE__ */ u((D, N = "assistant") => {
|
|
644
645
|
if (!k())
|
|
645
646
|
return;
|
|
646
|
-
this.updateState(this.textState, { workingDescription: void 0 }),
|
|
647
|
+
this.updateState(this.textState, { workingDescription: void 0 }), N === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), p || (p = !0, this.sharedMessages.value = [
|
|
647
648
|
...this.sharedMessages.value,
|
|
648
|
-
{ id: o, text: "", sender:
|
|
649
|
+
{ id: o, text: "", sender: N === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
649
650
|
]);
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
}, "onDelta"), x = /* @__PURE__ */ u((
|
|
651
|
+
const z = this.sharedMessages.value, F = z[z.length - 1];
|
|
652
|
+
F?.id === o && (F.text += D, this.sharedMessages.value = [...z]);
|
|
653
|
+
}, "onDelta"), x = /* @__PURE__ */ u((D) => {
|
|
653
654
|
if (!k())
|
|
654
655
|
return;
|
|
655
|
-
d = !0, p = !0
|
|
656
|
-
const
|
|
657
|
-
this.finishToolActivities(
|
|
658
|
-
const
|
|
659
|
-
|
|
656
|
+
d = !0, p = !0;
|
|
657
|
+
const N = D.sender === "system" || D.turnOutcome === "failed" ? "failed" : "completed";
|
|
658
|
+
this.finishToolActivities(N);
|
|
659
|
+
const z = this.textState.value.toolActivities, F = D.toolActivities?.length || !z?.length ? D : { ...D, toolActivities: z };
|
|
660
|
+
this.updateState(this.textState, {
|
|
661
|
+
workingDescription: void 0,
|
|
662
|
+
toolActivities: [],
|
|
663
|
+
turnOutcome: void 0
|
|
664
|
+
});
|
|
665
|
+
const H = this.sharedMessages.value, j = H.findIndex((re) => re.id === F.id);
|
|
666
|
+
if (j >= 0)
|
|
660
667
|
this.sharedMessages.value = [
|
|
661
|
-
...
|
|
662
|
-
|
|
663
|
-
...
|
|
668
|
+
...H.slice(0, j),
|
|
669
|
+
F,
|
|
670
|
+
...H.slice(j + 1)
|
|
664
671
|
];
|
|
665
672
|
else {
|
|
666
|
-
const
|
|
667
|
-
this.sharedMessages.value =
|
|
673
|
+
const re = H[H.length - 1];
|
|
674
|
+
this.sharedMessages.value = re?.id === o ? [...H.slice(0, -1), F] : [...H, F];
|
|
668
675
|
}
|
|
669
|
-
|
|
670
|
-
}, "onMessage"), w = /* @__PURE__ */ u((
|
|
676
|
+
F.sender === "system" && F.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : F.sender === "system" && F.issue?.code && js.has(F.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
677
|
+
}, "onMessage"), w = /* @__PURE__ */ u((D) => {
|
|
671
678
|
if (!k())
|
|
672
679
|
return;
|
|
673
680
|
if (!p && !d) {
|
|
674
|
-
|
|
681
|
+
C("empty_stream — assistant returned no content");
|
|
675
682
|
return;
|
|
676
683
|
}
|
|
677
684
|
this.finishToolActivities("completed");
|
|
678
|
-
const
|
|
679
|
-
if (
|
|
680
|
-
let
|
|
685
|
+
const N = this.sharedMessages.value, z = N[N.length - 1];
|
|
686
|
+
if (z?.id === o && z.sender === "agent" && z.text) {
|
|
687
|
+
let F = z.text;
|
|
681
688
|
for (const H of Ma)
|
|
682
|
-
H.pattern.test(
|
|
683
|
-
|
|
689
|
+
H.pattern.test(F) && (console.debug(`[chat] filtered directive: ${H.label}`), F = F.replace(H.pattern, "").trim(), H.pattern.lastIndex = 0);
|
|
690
|
+
F ? F !== z.text && (z.text = F, this.sharedMessages.value = [...N]) : this.sharedMessages.value = N.slice(0, -1);
|
|
684
691
|
}
|
|
685
|
-
|
|
686
|
-
}, "onDone"),
|
|
692
|
+
D && (this.conversationId = D), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
|
|
693
|
+
}, "onDone"), C = /* @__PURE__ */ u((D) => {
|
|
687
694
|
if (!k())
|
|
688
695
|
return;
|
|
689
|
-
if (typeof
|
|
690
|
-
const
|
|
691
|
-
for (let
|
|
692
|
-
if (
|
|
693
|
-
this.sharedMessages.value = [...
|
|
696
|
+
if (typeof D == "object" && D.code === "TURN_ACTIVE") {
|
|
697
|
+
const j = this.sharedMessages.value;
|
|
698
|
+
for (let re = j.length - 1; re >= 0; re--)
|
|
699
|
+
if (j[re].sender === "user" && j[re].text === e) {
|
|
700
|
+
this.sharedMessages.value = [...j.slice(0, re), ...j.slice(re + 1)];
|
|
694
701
|
break;
|
|
695
702
|
}
|
|
696
703
|
this.composerState.value.text || (this.composerState.value = {
|
|
@@ -699,30 +706,30 @@ Current User:
|
|
|
699
706
|
pendingAttachments: n ?? []
|
|
700
707
|
}), this.updateState(this.textState, {
|
|
701
708
|
isThinking: !1,
|
|
702
|
-
transientIssue: { code:
|
|
709
|
+
transientIssue: { code: D.code, message: D.error }
|
|
703
710
|
});
|
|
704
711
|
return;
|
|
705
712
|
}
|
|
706
713
|
this.updateState(this.textState, { workingDescription: void 0, turnOutcome: "failed" }), this.finishToolActivities("failed");
|
|
707
|
-
const
|
|
708
|
-
if (
|
|
709
|
-
const
|
|
710
|
-
|
|
714
|
+
const N = this.sharedMessages.value, z = N[N.length - 1];
|
|
715
|
+
if (z?.id === o && !z.text && (this.sharedMessages.value = N.slice(0, -1)), typeof D == "object" && D.code && D.error) {
|
|
716
|
+
const j = Da(D);
|
|
717
|
+
j.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: j.issue }) : j.surface === "transcript" ? (this.addMessage(La(D), "system", void 0, j.issue), this.updateState(this.textState, {
|
|
711
718
|
isThinking: !1,
|
|
712
|
-
...
|
|
713
|
-
})) : this.handleError(new Error(
|
|
719
|
+
...j.sendBlockedReason ? { sendBlockedReason: j.sendBlockedReason } : {}
|
|
720
|
+
})) : this.handleError(new Error(D.error));
|
|
714
721
|
return;
|
|
715
722
|
}
|
|
716
|
-
const
|
|
717
|
-
this.isTransientError(
|
|
718
|
-
}, "onError"),
|
|
723
|
+
const F = typeof D == "string" ? D : D.error, H = this.mapChatError(F);
|
|
724
|
+
this.isTransientError(F) ? (this.logger.warn("Chat turn failed (transient):", { raw: F, friendly: H }), this.addMessage(H, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(H), F);
|
|
725
|
+
}, "onError"), E = /* @__PURE__ */ u((D) => {
|
|
719
726
|
if (!k())
|
|
720
727
|
return;
|
|
721
|
-
const
|
|
722
|
-
this.updateState(this.textState, { workingDescription:
|
|
723
|
-
}, "onStatus"),
|
|
724
|
-
k() && (
|
|
725
|
-
}, "onToolActivity"),
|
|
728
|
+
const N = D.trim();
|
|
729
|
+
this.updateState(this.textState, { workingDescription: N || void 0 });
|
|
730
|
+
}, "onStatus"), $ = /* @__PURE__ */ u((D) => {
|
|
731
|
+
k() && (this.lastVisibleProgressAtMs.value = Date.now(), this.updateToolActivity(D));
|
|
732
|
+
}, "onToolActivity"), Q = /* @__PURE__ */ u(() => {
|
|
726
733
|
k() && this.updateState(this.textState, { workingDescription: void 0 });
|
|
727
734
|
}, "onWorkingEnd");
|
|
728
735
|
try {
|
|
@@ -731,29 +738,29 @@ Current User:
|
|
|
731
738
|
attachments: n,
|
|
732
739
|
conversationId: this.conversationId,
|
|
733
740
|
history: this.buildHistory(),
|
|
734
|
-
onDelta:
|
|
741
|
+
onDelta: A,
|
|
735
742
|
onMessage: x,
|
|
736
743
|
onDone: w,
|
|
737
|
-
onError:
|
|
738
|
-
onStatus:
|
|
739
|
-
onToolActivity:
|
|
740
|
-
onWorkingEnd:
|
|
744
|
+
onError: C,
|
|
745
|
+
onStatus: E,
|
|
746
|
+
onToolActivity: $,
|
|
747
|
+
onWorkingEnd: Q
|
|
741
748
|
}) : s.chat.chatStreamPublic({
|
|
742
749
|
handle: this._agent.handle.value,
|
|
743
750
|
message: e,
|
|
744
751
|
attachments: n,
|
|
745
752
|
anonymousId: s.user.generateAnonId(),
|
|
746
753
|
context: this.getDynamicSettings().context || void 0,
|
|
747
|
-
onDelta:
|
|
754
|
+
onDelta: A,
|
|
748
755
|
onMessage: x,
|
|
749
756
|
onDone: w,
|
|
750
|
-
onError:
|
|
751
|
-
onStatus:
|
|
752
|
-
onToolActivity:
|
|
753
|
-
onWorkingEnd:
|
|
757
|
+
onError: C,
|
|
758
|
+
onStatus: E,
|
|
759
|
+
onToolActivity: $,
|
|
760
|
+
onWorkingEnd: Q
|
|
754
761
|
}));
|
|
755
|
-
} catch (
|
|
756
|
-
|
|
762
|
+
} catch (D) {
|
|
763
|
+
C(D.message || "Something went wrong");
|
|
757
764
|
}
|
|
758
765
|
}
|
|
759
766
|
async stopChatTurn() {
|
|
@@ -796,8 +803,8 @@ Current User:
|
|
|
796
803
|
this.clearBoundaryTimer(), this.voiceRecorder.teardown(), await this.endConversation();
|
|
797
804
|
}
|
|
798
805
|
};
|
|
799
|
-
u(
|
|
800
|
-
let
|
|
806
|
+
u(Kn, "AgentChatController");
|
|
807
|
+
let ds = Kn;
|
|
801
808
|
function sn(a) {
|
|
802
809
|
if (!a)
|
|
803
810
|
return;
|
|
@@ -805,19 +812,19 @@ function sn(a) {
|
|
|
805
812
|
return Number.isFinite(t) ? t : void 0;
|
|
806
813
|
}
|
|
807
814
|
u(sn, "parseToolActivityMs");
|
|
808
|
-
function
|
|
815
|
+
function hs(a) {
|
|
809
816
|
return a ? typeof a == "string" ? a : a.src || "" : "";
|
|
810
817
|
}
|
|
811
|
-
u(
|
|
818
|
+
u(hs, "getImageSrc");
|
|
812
819
|
function ho(a) {
|
|
813
|
-
return
|
|
820
|
+
return hs(a.cover) || hs(a.avatar) || Nn(a.name);
|
|
814
821
|
}
|
|
815
822
|
u(ho, "getAgentAvatarUrl");
|
|
816
|
-
function
|
|
823
|
+
function ps(a) {
|
|
817
824
|
const t = a.target;
|
|
818
|
-
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src =
|
|
825
|
+
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = Nn());
|
|
819
826
|
}
|
|
820
|
-
u(
|
|
827
|
+
u(ps, "handleImageError");
|
|
821
828
|
function po(a) {
|
|
822
829
|
const { template: t, agent: e } = a;
|
|
823
830
|
return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
|
|
@@ -851,23 +858,23 @@ const Oa = {
|
|
|
851
858
|
lg: "size-5"
|
|
852
859
|
})[a.size]);
|
|
853
860
|
return (i, s) => (h(), f("button", {
|
|
854
|
-
class:
|
|
861
|
+
class: _(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
|
|
855
862
|
}, [
|
|
856
863
|
a.loading ? (h(), f("div", Oa, [...s[0] || (s[0] = [
|
|
857
|
-
|
|
858
|
-
])])) :
|
|
859
|
-
|
|
860
|
-
class:
|
|
864
|
+
y("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
865
|
+
])])) : G("", !0),
|
|
866
|
+
y("span", {
|
|
867
|
+
class: _(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
|
|
861
868
|
}, [
|
|
862
869
|
a.icon ? (h(), f("i", {
|
|
863
870
|
key: 0,
|
|
864
|
-
class:
|
|
865
|
-
}, null, 2)) :
|
|
871
|
+
class: _([a.icon, n.value])
|
|
872
|
+
}, null, 2)) : G("", !0),
|
|
866
873
|
fn(i.$slots, "default"),
|
|
867
874
|
a.iconAfter ? (h(), f("i", {
|
|
868
875
|
key: 1,
|
|
869
|
-
class:
|
|
870
|
-
}, null, 2)) :
|
|
876
|
+
class: _([a.iconAfter, n.value])
|
|
877
|
+
}, null, 2)) : G("", !0)
|
|
871
878
|
], 2)
|
|
872
879
|
], 2));
|
|
873
880
|
}
|
|
@@ -929,7 +936,7 @@ const Oa = {
|
|
|
929
936
|
onInput: l
|
|
930
937
|
}, null, 40, Na));
|
|
931
938
|
}
|
|
932
|
-
}), Pa = { class: "relative flex-shrink-0" },
|
|
939
|
+
}), Pa = { class: "relative flex-shrink-0" }, Fa = ["src", "alt"], Ba = { class: "absolute top-1 right-1" }, Ua = {
|
|
933
940
|
key: 1,
|
|
934
941
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
935
942
|
}, Ha = { class: "min-w-0" }, ja = /* @__PURE__ */ Me({
|
|
@@ -942,45 +949,45 @@ const Oa = {
|
|
|
942
949
|
},
|
|
943
950
|
setup(a) {
|
|
944
951
|
return (t, e) => (h(), f("div", {
|
|
945
|
-
class:
|
|
952
|
+
class: _(["flex gap-4", [
|
|
946
953
|
a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
947
954
|
]])
|
|
948
955
|
}, [
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
class:
|
|
956
|
+
y("div", Pa, [
|
|
957
|
+
y("div", {
|
|
958
|
+
class: _(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
952
959
|
}, [
|
|
953
|
-
|
|
960
|
+
y("img", {
|
|
954
961
|
src: a.agent.avatarUrl.value,
|
|
955
962
|
alt: a.agent.displayName.value,
|
|
956
963
|
class: "w-full h-full object-cover",
|
|
957
964
|
onError: e[0] || (e[0] = //@ts-ignore
|
|
958
|
-
(...n) => on(
|
|
959
|
-
}, null, 40,
|
|
965
|
+
(...n) => on(ps) && on(ps)(...n))
|
|
966
|
+
}, null, 40, Fa)
|
|
960
967
|
], 2),
|
|
961
|
-
|
|
968
|
+
y("div", Ba, [
|
|
962
969
|
a.isOnline ? (h(), f(se, { key: 0 }, [
|
|
963
|
-
e[1] || (e[1] =
|
|
970
|
+
e[1] || (e[1] = y("div", {
|
|
964
971
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
965
972
|
style: { "animation-duration": "3s" }
|
|
966
973
|
}, null, -1)),
|
|
967
|
-
e[2] || (e[2] =
|
|
974
|
+
e[2] || (e[2] = y("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
|
|
968
975
|
], 64)) : (h(), f("div", Ua))
|
|
969
976
|
])
|
|
970
977
|
]),
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
class:
|
|
978
|
+
y("div", Ha, [
|
|
979
|
+
y("h1", {
|
|
980
|
+
class: _(["font-light text-white mb-1 truncate", [
|
|
974
981
|
a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
975
982
|
a.layout === "horizontal" ? "text-white/95" : ""
|
|
976
983
|
]])
|
|
977
|
-
},
|
|
978
|
-
|
|
979
|
-
class:
|
|
984
|
+
}, W(a.agent.displayName.value), 3),
|
|
985
|
+
y("p", {
|
|
986
|
+
class: _(["font-light line-clamp-1", [
|
|
980
987
|
a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
981
988
|
a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
982
989
|
]])
|
|
983
|
-
},
|
|
990
|
+
}, W(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
|
|
984
991
|
])
|
|
985
992
|
], 2));
|
|
986
993
|
}
|
|
@@ -1000,7 +1007,7 @@ const Oa = {
|
|
|
1000
1007
|
direction: { default: "top" }
|
|
1001
1008
|
},
|
|
1002
1009
|
setup(a) {
|
|
1003
|
-
const t = ge(null), e = ge(null), n = ge(!1), i = ge(null), s = ge(null), l =
|
|
1010
|
+
const t = ge(null), e = ge(null), n = ge(!1), i = ge(null), s = ge(null), l = fa({
|
|
1004
1011
|
left: "0px",
|
|
1005
1012
|
top: "0px",
|
|
1006
1013
|
maxWidth: `${a.maxWidth}px`
|
|
@@ -1008,27 +1015,27 @@ const Oa = {
|
|
|
1008
1015
|
function p() {
|
|
1009
1016
|
if (!t.value || !e.value)
|
|
1010
1017
|
return;
|
|
1011
|
-
const
|
|
1012
|
-
let
|
|
1018
|
+
const E = t.value.getBoundingClientRect(), $ = e.value.getBoundingClientRect(), Q = 8;
|
|
1019
|
+
let D, N;
|
|
1013
1020
|
switch (a.direction) {
|
|
1014
1021
|
case "bottom":
|
|
1015
|
-
|
|
1022
|
+
D = E.left + window.scrollX + E.width / 2 - $.width / 2, N = E.bottom + window.scrollY + Q;
|
|
1016
1023
|
break;
|
|
1017
1024
|
case "top":
|
|
1018
|
-
|
|
1025
|
+
D = E.left + window.scrollX + E.width / 2 - $.width / 2, N = E.top + window.scrollY - $.height - Q;
|
|
1019
1026
|
break;
|
|
1020
1027
|
case "left":
|
|
1021
|
-
|
|
1028
|
+
D = E.left + window.scrollX - $.width - Q, N = E.top + window.scrollY + E.height / 2 - $.height / 2;
|
|
1022
1029
|
break;
|
|
1023
1030
|
default:
|
|
1024
|
-
|
|
1031
|
+
D = E.right + window.scrollX + Q, N = E.top + window.scrollY + E.height / 2 - $.height / 2;
|
|
1025
1032
|
}
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1033
|
+
const z = 8;
|
|
1034
|
+
D = Math.max(z, Math.min(D, window.innerWidth - $.width - z)), N = Math.max(z, Math.min(N, window.innerHeight - $.height - z)), l.left = `${D}px`, l.top = `${N}px`;
|
|
1028
1035
|
}
|
|
1029
1036
|
u(p, "updatePosition");
|
|
1030
1037
|
function d() {
|
|
1031
|
-
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,
|
|
1038
|
+
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, Ps(p), a.timeout > 0 && (s.value = setTimeout(() => {
|
|
1032
1039
|
n.value = !1;
|
|
1033
1040
|
}, a.timeout))));
|
|
1034
1041
|
}
|
|
@@ -1037,39 +1044,39 @@ const Oa = {
|
|
|
1037
1044
|
a.disabled || (s.value && (clearTimeout(s.value), s.value = null), i.value = setTimeout(d, a.delay));
|
|
1038
1045
|
}
|
|
1039
1046
|
u(k, "onMouseEnter");
|
|
1040
|
-
function
|
|
1047
|
+
function A() {
|
|
1041
1048
|
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;
|
|
1042
1049
|
}
|
|
1043
|
-
u(
|
|
1050
|
+
u(A, "onMouseLeave");
|
|
1044
1051
|
function x() {
|
|
1045
1052
|
a.disabled || (i.value && (clearTimeout(i.value), i.value = null), d());
|
|
1046
1053
|
}
|
|
1047
1054
|
u(x, "onFocusIn");
|
|
1048
1055
|
function w() {
|
|
1049
|
-
|
|
1056
|
+
A();
|
|
1050
1057
|
}
|
|
1051
1058
|
u(w, "onFocusOut"), Yt(() => {
|
|
1052
1059
|
window.addEventListener("resize", p), window.addEventListener("scroll", p, !0);
|
|
1053
|
-
}),
|
|
1060
|
+
}), Os(() => {
|
|
1054
1061
|
window.removeEventListener("resize", p), window.removeEventListener("scroll", p, !0), i.value && clearTimeout(i.value), s.value && clearTimeout(s.value);
|
|
1055
1062
|
});
|
|
1056
|
-
const
|
|
1063
|
+
const C = T(() => `absolute size-2 rotate-45 bg-theme-900 dark:bg-theme-600 ${{
|
|
1057
1064
|
bottom: "left-1/2 -translate-x-1/2 -top-1",
|
|
1058
1065
|
top: "left-1/2 -translate-x-1/2 -bottom-1",
|
|
1059
1066
|
left: "right-[-4px] top-1/2 -translate-y-1/2",
|
|
1060
1067
|
right: "left-[-4px] top-1/2 -translate-y-1/2"
|
|
1061
1068
|
}[a.direction]}`);
|
|
1062
|
-
return (
|
|
1069
|
+
return (E, $) => (h(), f("div", {
|
|
1063
1070
|
ref_key: "triggerRef",
|
|
1064
1071
|
ref: t,
|
|
1065
1072
|
onMouseenter: k,
|
|
1066
|
-
onMouseleave:
|
|
1073
|
+
onMouseleave: A,
|
|
1067
1074
|
onFocusin: x,
|
|
1068
1075
|
onFocusout: w
|
|
1069
1076
|
}, [
|
|
1070
|
-
fn(
|
|
1071
|
-
(h(),
|
|
1072
|
-
|
|
1077
|
+
fn(E.$slots, "default"),
|
|
1078
|
+
(h(), mt(ma, { to: "body" }, [
|
|
1079
|
+
Je(ga, {
|
|
1073
1080
|
"enter-active-class": "transition ease-out duration-200",
|
|
1074
1081
|
"enter-from-class": "opacity-0 scale-95",
|
|
1075
1082
|
"enter-to-class": "opacity-100 scale-100",
|
|
@@ -1077,16 +1084,16 @@ const Oa = {
|
|
|
1077
1084
|
"leave-from-class": "opacity-100 scale-100",
|
|
1078
1085
|
"leave-to-class": "opacity-0 scale-95"
|
|
1079
1086
|
}, {
|
|
1080
|
-
default:
|
|
1081
|
-
|
|
1087
|
+
default: zs(() => [
|
|
1088
|
+
Ns(y("div", {
|
|
1082
1089
|
ref_key: "tooltipRef",
|
|
1083
1090
|
ref: e,
|
|
1084
1091
|
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",
|
|
1085
1092
|
style: K(l)
|
|
1086
1093
|
}, [
|
|
1087
|
-
nt(
|
|
1088
|
-
|
|
1089
|
-
class:
|
|
1094
|
+
nt(W(o.value) + " ", 1),
|
|
1095
|
+
y("div", {
|
|
1096
|
+
class: _(C.value)
|
|
1090
1097
|
}, null, 2)
|
|
1091
1098
|
], 4), [
|
|
1092
1099
|
[va, n.value && !a.disabled]
|
|
@@ -1114,25 +1121,25 @@ const Oa = {
|
|
|
1114
1121
|
height: "clamp(7px, 14%, 14px)"
|
|
1115
1122
|
}, n = T(() => a.position.startsWith("top") ? "bottom" : "top");
|
|
1116
1123
|
return (i, s) => (h(), f(se, null, [
|
|
1117
|
-
a.tooltip ? (h(),
|
|
1124
|
+
a.tooltip ? (h(), mt(Ga, {
|
|
1118
1125
|
key: 0,
|
|
1119
1126
|
content: a.tooltip,
|
|
1120
1127
|
direction: n.value,
|
|
1121
1128
|
"max-width": 240,
|
|
1122
|
-
class:
|
|
1129
|
+
class: _(["absolute rounded-full ring-2 ring-white z-10", a.dotClass]),
|
|
1123
1130
|
style: K({ ...e, ...t.value }),
|
|
1124
1131
|
role: "status",
|
|
1125
1132
|
"aria-label": a.tooltip
|
|
1126
1133
|
}, null, 8, ["content", "direction", "class", "style", "aria-label"])) : (h(), f("span", {
|
|
1127
1134
|
key: 1,
|
|
1128
|
-
class:
|
|
1135
|
+
class: _(["absolute rounded-full ring-2 ring-white z-10", a.dotClass]),
|
|
1129
1136
|
style: K({ ...e, ...t.value })
|
|
1130
1137
|
}, null, 6)),
|
|
1131
1138
|
a.showPing ? (h(), f("span", {
|
|
1132
1139
|
key: 2,
|
|
1133
|
-
class:
|
|
1140
|
+
class: _(["absolute rounded-full animate-ping [animation-duration:3s] opacity-50 pointer-events-none", a.dotClass]),
|
|
1134
1141
|
style: K({ ...e, ...t.value })
|
|
1135
|
-
}, null, 6)) :
|
|
1142
|
+
}, null, 6)) : G("", !0)
|
|
1136
1143
|
], 64));
|
|
1137
1144
|
}
|
|
1138
1145
|
}), qa = ["src", "alt"], Ka = ["src"], Ya = /* @__PURE__ */ Me({
|
|
@@ -1152,36 +1159,36 @@ const Oa = {
|
|
|
1152
1159
|
setup(a) {
|
|
1153
1160
|
const t = T(() => `rounded-${a.rounded}`);
|
|
1154
1161
|
return (e, n) => (h(), f("div", {
|
|
1155
|
-
class:
|
|
1162
|
+
class: _(["shrink-0 relative", [t.value, a.editable ? "cursor-pointer group/avatar" : ""]])
|
|
1156
1163
|
}, [
|
|
1157
|
-
|
|
1158
|
-
class:
|
|
1164
|
+
y("div", {
|
|
1165
|
+
class: _(["size-full overflow-hidden ring-1 ring-black/5", t.value])
|
|
1159
1166
|
}, [
|
|
1160
|
-
|
|
1167
|
+
y("img", {
|
|
1161
1168
|
src: a.src,
|
|
1162
1169
|
alt: a.alt,
|
|
1163
1170
|
class: "size-full object-cover"
|
|
1164
1171
|
}, null, 8, qa),
|
|
1165
1172
|
a.editable ? (h(), f("div", {
|
|
1166
1173
|
key: 0,
|
|
1167
|
-
class:
|
|
1174
|
+
class: _(["absolute inset-0 flex items-center justify-center opacity-0 group-hover/avatar:opacity-100 transition-opacity bg-black/40", t.value])
|
|
1168
1175
|
}, [...n[0] || (n[0] = [
|
|
1169
|
-
|
|
1170
|
-
])], 2)) :
|
|
1176
|
+
y("i", { class: "i-tabler-camera text-xl text-white" }, null, -1)
|
|
1177
|
+
])], 2)) : G("", !0)
|
|
1171
1178
|
], 2),
|
|
1172
1179
|
a.subSrc ? (h(), f("img", {
|
|
1173
1180
|
key: 0,
|
|
1174
1181
|
src: a.subSrc,
|
|
1175
1182
|
alt: "",
|
|
1176
1183
|
class: "absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2 ring-white"
|
|
1177
|
-
}, null, 8, Ka)) :
|
|
1178
|
-
a.dotClass ? (h(),
|
|
1184
|
+
}, null, 8, Ka)) : G("", !0),
|
|
1185
|
+
a.dotClass ? (h(), mt(Va, {
|
|
1179
1186
|
key: 1,
|
|
1180
1187
|
"dot-class": a.dotClass,
|
|
1181
1188
|
tooltip: a.dotTooltip,
|
|
1182
1189
|
"show-ping": a.showPing,
|
|
1183
1190
|
position: a.dotPosition
|
|
1184
|
-
}, null, 8, ["dot-class", "tooltip", "show-ping", "position"])) :
|
|
1191
|
+
}, null, 8, ["dot-class", "tooltip", "show-ping", "position"])) : G("", !0)
|
|
1185
1192
|
], 2));
|
|
1186
1193
|
}
|
|
1187
1194
|
}), Xa = /* @__PURE__ */ Me({
|
|
@@ -1196,10 +1203,10 @@ const Oa = {
|
|
|
1196
1203
|
subAvatarSrc: {}
|
|
1197
1204
|
},
|
|
1198
1205
|
setup(a) {
|
|
1199
|
-
const t = T(() => a.agent.avatarUrl.value ||
|
|
1206
|
+
const t = T(() => a.agent.avatarUrl.value || Nn(a.agent.name.value)), e = T(() => a.agent.state.value), n = T(
|
|
1200
1207
|
() => a.showStatus && e.value.lifecycle !== "unknown" ? Wa[e.value.color] : null
|
|
1201
1208
|
);
|
|
1202
|
-
return (i, s) => (h(),
|
|
1209
|
+
return (i, s) => (h(), mt(Ya, {
|
|
1203
1210
|
src: t.value,
|
|
1204
1211
|
alt: a.agent.name.value || "Agent",
|
|
1205
1212
|
rounded: a.rounded,
|
|
@@ -1216,7 +1223,7 @@ const Oa = {
|
|
|
1216
1223
|
class: "sr-only",
|
|
1217
1224
|
role: "status",
|
|
1218
1225
|
"aria-live": "polite"
|
|
1219
|
-
},
|
|
1226
|
+
}, Ja = ["aria-expanded", "disabled"], Qa = ["aria-expanded"], ei = {
|
|
1220
1227
|
class: "flex w-5 shrink-0 justify-center self-stretch",
|
|
1221
1228
|
"aria-hidden": "true"
|
|
1222
1229
|
}, ti = ["data-journal-row"], ni = {
|
|
@@ -1226,7 +1233,7 @@ const Oa = {
|
|
|
1226
1233
|
key: 1,
|
|
1227
1234
|
"data-journal-station": "failed",
|
|
1228
1235
|
class: "i-tabler-alert-circle size-3.5 text-red-600"
|
|
1229
|
-
},
|
|
1236
|
+
}, fs = /* @__PURE__ */ Me({
|
|
1230
1237
|
__name: "AgentToolActivityGroup",
|
|
1231
1238
|
props: {
|
|
1232
1239
|
model: {},
|
|
@@ -1265,10 +1272,10 @@ const Oa = {
|
|
|
1265
1272
|
function d(k) {
|
|
1266
1273
|
return k === "active" ? t.isLight ? "text-[13px] font-medium text-theme-900" : "text-[13px] font-medium text-white" : k === "failed" ? "text-[12.5px] font-medium text-red-600" : k === "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";
|
|
1267
1274
|
}
|
|
1268
|
-
return u(d, "labelClass"), (k,
|
|
1269
|
-
class:
|
|
1275
|
+
return u(d, "labelClass"), (k, A) => (h(), f("div", {
|
|
1276
|
+
class: _(["w-full py-0.5", p.value.muted])
|
|
1270
1277
|
}, [
|
|
1271
|
-
l.value ? (h(), f("span", Za,
|
|
1278
|
+
l.value ? (h(), f("span", Za, W(l.value), 1)) : G("", !0),
|
|
1272
1279
|
i.value ? (h(), f("button", {
|
|
1273
1280
|
key: 1,
|
|
1274
1281
|
type: "button",
|
|
@@ -1276,107 +1283,107 @@ const Oa = {
|
|
|
1276
1283
|
"data-journal-disclosure": "",
|
|
1277
1284
|
"aria-expanded": e.value,
|
|
1278
1285
|
disabled: s.value === 0,
|
|
1279
|
-
class:
|
|
1286
|
+
class: _(["grid min-h-11 w-full grid-cols-[1.25rem_minmax(0,1fr)_auto] items-center gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", p.value.ring]),
|
|
1280
1287
|
onClick: n
|
|
1281
1288
|
}, [
|
|
1282
|
-
|
|
1289
|
+
A[0] || (A[0] = y("span", {
|
|
1283
1290
|
class: "grid size-5 shrink-0 place-items-center",
|
|
1284
1291
|
"data-journal-station": "completed",
|
|
1285
1292
|
"aria-hidden": "true"
|
|
1286
1293
|
}, [
|
|
1287
|
-
|
|
1294
|
+
y("i", { class: "i-tabler-circle-check-filled size-3.5 text-green-600" })
|
|
1288
1295
|
], -1)),
|
|
1289
|
-
|
|
1290
|
-
class:
|
|
1291
|
-
},
|
|
1296
|
+
y("span", {
|
|
1297
|
+
class: _(["min-w-0 truncate text-[12.5px] font-medium leading-none", p.value.muted])
|
|
1298
|
+
}, W(a.model.terminal?.label), 3),
|
|
1292
1299
|
s.value ? (h(), f("span", {
|
|
1293
1300
|
key: 0,
|
|
1294
|
-
class:
|
|
1301
|
+
class: _(["flex shrink-0 items-center gap-0.5 whitespace-nowrap text-[12px] font-medium leading-none", p.value.muted])
|
|
1295
1302
|
}, [
|
|
1296
|
-
nt(
|
|
1297
|
-
|
|
1298
|
-
class:
|
|
1303
|
+
nt(W(s.value) + " earlier updates ", 1),
|
|
1304
|
+
y("i", {
|
|
1305
|
+
class: _(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1299
1306
|
"aria-hidden": "true"
|
|
1300
1307
|
}, null, 2)
|
|
1301
|
-
], 2)) :
|
|
1302
|
-
], 10,
|
|
1308
|
+
], 2)) : G("", !0)
|
|
1309
|
+
], 10, Ja)) : s.value ? (h(), f("button", {
|
|
1303
1310
|
key: 2,
|
|
1304
1311
|
type: "button",
|
|
1305
1312
|
"data-test": "messaging-tool-activity-summary",
|
|
1306
1313
|
"data-journal-disclosure": "",
|
|
1307
1314
|
"aria-expanded": e.value,
|
|
1308
|
-
class:
|
|
1315
|
+
class: _(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", p.value.ring]),
|
|
1309
1316
|
onClick: n
|
|
1310
1317
|
}, [
|
|
1311
|
-
|
|
1312
|
-
|
|
1318
|
+
y("span", ei, [
|
|
1319
|
+
y("span", {
|
|
1313
1320
|
"data-journal-spine": "dashed",
|
|
1314
|
-
class:
|
|
1321
|
+
class: _(["w-0 border-l border-dashed", p.value.dashed])
|
|
1315
1322
|
}, null, 2)
|
|
1316
1323
|
]),
|
|
1317
|
-
|
|
1318
|
-
class:
|
|
1324
|
+
y("span", {
|
|
1325
|
+
class: _(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", p.value.muted])
|
|
1319
1326
|
}, [
|
|
1320
|
-
nt(
|
|
1321
|
-
|
|
1322
|
-
class:
|
|
1327
|
+
nt(W(s.value) + " earlier updates ", 1),
|
|
1328
|
+
y("i", {
|
|
1329
|
+
class: _(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1323
1330
|
"aria-hidden": "true"
|
|
1324
1331
|
}, null, 2)
|
|
1325
1332
|
], 2)
|
|
1326
|
-
], 10,
|
|
1333
|
+
], 10, Qa)) : G("", !0),
|
|
1327
1334
|
(h(!0), f(se, null, ve(o.value, (x, w) => (h(), f("div", {
|
|
1328
1335
|
key: x.id,
|
|
1329
1336
|
"data-test": "messaging-tool-activity-row",
|
|
1330
1337
|
"data-journal-row": x.tone,
|
|
1331
|
-
class:
|
|
1338
|
+
class: _([i.value ? "pl-[30px]" : "", "flex gap-x-2.5"])
|
|
1332
1339
|
}, [
|
|
1333
|
-
|
|
1334
|
-
|
|
1340
|
+
y("div", ni, [
|
|
1341
|
+
y("span", si, [
|
|
1335
1342
|
x.tone === "active" ? (h(), f("span", {
|
|
1336
1343
|
key: 0,
|
|
1337
1344
|
"data-journal-station": "active",
|
|
1338
|
-
class:
|
|
1345
|
+
class: _(["size-3.5 animate-spin rounded-full border-[1.5px] motion-reduce:animate-none", p.value.activeSpinner])
|
|
1339
1346
|
}, null, 2)) : x.tone === "failed" ? (h(), f("i", ai)) : x.tone === "stopped" ? (h(), f("span", {
|
|
1340
1347
|
key: 2,
|
|
1341
1348
|
"data-journal-station": "stopped",
|
|
1342
|
-
class:
|
|
1349
|
+
class: _(["size-[9px] rounded-[2px]", p.value.stoppedSquare])
|
|
1343
1350
|
}, null, 2)) : (h(), f("span", {
|
|
1344
1351
|
key: 3,
|
|
1345
1352
|
"data-journal-station": "done",
|
|
1346
|
-
class:
|
|
1353
|
+
class: _(["size-[7px] rounded-full", p.value.doneDot])
|
|
1347
1354
|
}, null, 2))
|
|
1348
1355
|
]),
|
|
1349
1356
|
w !== o.value.length - 1 ? (h(), f("span", {
|
|
1350
1357
|
key: 0,
|
|
1351
|
-
class:
|
|
1352
|
-
}, null, 2)) :
|
|
1358
|
+
class: _(["w-px flex-1", p.value.spine])
|
|
1359
|
+
}, null, 2)) : G("", !0)
|
|
1353
1360
|
]),
|
|
1354
|
-
|
|
1355
|
-
class:
|
|
1361
|
+
y("div", {
|
|
1362
|
+
class: _(["min-w-0 flex-1", w === o.value.length - 1 ? "" : "pb-2"])
|
|
1356
1363
|
}, [
|
|
1357
|
-
|
|
1358
|
-
class:
|
|
1359
|
-
},
|
|
1364
|
+
y("span", {
|
|
1365
|
+
class: _(["block leading-snug", d(x.tone)])
|
|
1366
|
+
}, W(x.label), 3),
|
|
1360
1367
|
x.note ? (h(), f("p", {
|
|
1361
1368
|
key: 0,
|
|
1362
|
-
class:
|
|
1363
|
-
},
|
|
1369
|
+
class: _(["pt-0.5 text-[11.5px] leading-snug", p.value.muted])
|
|
1370
|
+
}, W(x.note), 3)) : G("", !0)
|
|
1364
1371
|
], 2)
|
|
1365
1372
|
], 10, ti))), 128)),
|
|
1366
1373
|
!i.value && a.model.hint ? (h(), f("p", {
|
|
1367
1374
|
key: 3,
|
|
1368
1375
|
"data-test": "messaging-tool-activity-hint",
|
|
1369
|
-
class:
|
|
1370
|
-
},
|
|
1376
|
+
class: _(["pl-[30px] pt-2.5 text-[12px] leading-snug", p.value.muted])
|
|
1377
|
+
}, W(a.model.hint), 3)) : G("", !0)
|
|
1371
1378
|
], 2));
|
|
1372
1379
|
}
|
|
1373
1380
|
});
|
|
1374
|
-
function
|
|
1381
|
+
function ms(a, t) {
|
|
1375
1382
|
(t == null || t > a.length) && (t = a.length);
|
|
1376
1383
|
for (var e = 0, n = Array(t); e < t; e++) n[e] = a[e];
|
|
1377
1384
|
return n;
|
|
1378
1385
|
}
|
|
1379
|
-
u(
|
|
1386
|
+
u(ms, "_arrayLikeToArray");
|
|
1380
1387
|
function ii(a) {
|
|
1381
1388
|
if (Array.isArray(a)) return a;
|
|
1382
1389
|
}
|
|
@@ -1411,37 +1418,37 @@ function oi(a, t) {
|
|
|
1411
1418
|
u(oi, "_slicedToArray");
|
|
1412
1419
|
function ci(a, t) {
|
|
1413
1420
|
if (a) {
|
|
1414
|
-
if (typeof a == "string") return
|
|
1421
|
+
if (typeof a == "string") return ms(a, t);
|
|
1415
1422
|
var e = {}.toString.call(a).slice(8, -1);
|
|
1416
|
-
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) ?
|
|
1423
|
+
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) ? ms(a, t) : void 0;
|
|
1417
1424
|
}
|
|
1418
1425
|
}
|
|
1419
1426
|
u(ci, "_unsupportedIterableToArray");
|
|
1420
|
-
const
|
|
1421
|
-
let Ce = Object.freeze, Ne = Object.seal, Mt = Object.create,
|
|
1427
|
+
const Ws = Object.entries, gs = Object.setPrototypeOf, ui = Object.isFrozen, di = Object.getPrototypeOf, hi = Object.getOwnPropertyDescriptor;
|
|
1428
|
+
let Ce = Object.freeze, Ne = Object.seal, Mt = Object.create, Gs = typeof Reflect < "u" && Reflect, Ln = Gs.apply, On = Gs.construct;
|
|
1422
1429
|
Ce || (Ce = /* @__PURE__ */ u(function(t) {
|
|
1423
1430
|
return t;
|
|
1424
1431
|
}, "freeze"));
|
|
1425
1432
|
Ne || (Ne = /* @__PURE__ */ u(function(t) {
|
|
1426
1433
|
return t;
|
|
1427
1434
|
}, "seal"));
|
|
1428
|
-
|
|
1435
|
+
Ln || (Ln = /* @__PURE__ */ u(function(t, e) {
|
|
1429
1436
|
for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
|
|
1430
1437
|
i[s - 2] = arguments[s];
|
|
1431
1438
|
return t.apply(e, i);
|
|
1432
1439
|
}, "apply"));
|
|
1433
|
-
|
|
1440
|
+
On || (On = /* @__PURE__ */ u(function(t) {
|
|
1434
1441
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
1435
1442
|
n[i - 1] = arguments[i];
|
|
1436
1443
|
return new t(...n);
|
|
1437
1444
|
}, "construct"));
|
|
1438
|
-
const St = xe(Array.prototype.forEach), pi = xe(Array.prototype.lastIndexOf),
|
|
1445
|
+
const St = xe(Array.prototype.forEach), pi = xe(Array.prototype.lastIndexOf), vs = xe(Array.prototype.pop), At = xe(Array.prototype.push), fi = xe(Array.prototype.splice), Re = Array.isArray, Vt = xe(String.prototype.toLowerCase), En = xe(String.prototype.toString), xs = xe(String.prototype.match), Et = xe(String.prototype.replace), bs = xe(String.prototype.indexOf), mi = xe(String.prototype.trim), gi = xe(Number.prototype.toString), vi = xe(Boolean.prototype.toString), ys = typeof BigInt > "u" ? null : xe(BigInt.prototype.toString), ks = typeof Symbol > "u" ? null : xe(Symbol.prototype.toString), he = xe(Object.prototype.hasOwnProperty), Ut = xe(Object.prototype.toString), we = xe(RegExp.prototype.test), Ht = xi(TypeError);
|
|
1439
1446
|
function xe(a) {
|
|
1440
1447
|
return function(t) {
|
|
1441
1448
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1442
1449
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
1443
1450
|
n[i - 1] = arguments[i];
|
|
1444
|
-
return
|
|
1451
|
+
return Ln(a, t, n);
|
|
1445
1452
|
};
|
|
1446
1453
|
}
|
|
1447
1454
|
u(xe, "unapply");
|
|
@@ -1449,13 +1456,13 @@ function xi(a) {
|
|
|
1449
1456
|
return function() {
|
|
1450
1457
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
1451
1458
|
e[n] = arguments[n];
|
|
1452
|
-
return
|
|
1459
|
+
return On(a, e);
|
|
1453
1460
|
};
|
|
1454
1461
|
}
|
|
1455
1462
|
u(xi, "unconstruct");
|
|
1456
1463
|
function q(a, t) {
|
|
1457
1464
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Vt;
|
|
1458
|
-
if (
|
|
1465
|
+
if (gs && gs(a, null), !Re(t))
|
|
1459
1466
|
return a;
|
|
1460
1467
|
let n = t.length;
|
|
1461
1468
|
for (; n--; ) {
|
|
@@ -1471,16 +1478,16 @@ function q(a, t) {
|
|
|
1471
1478
|
u(q, "addToSet");
|
|
1472
1479
|
function bi(a) {
|
|
1473
1480
|
for (let t = 0; t < a.length; t++)
|
|
1474
|
-
|
|
1481
|
+
he(a, t) || (a[t] = null);
|
|
1475
1482
|
return a;
|
|
1476
1483
|
}
|
|
1477
1484
|
u(bi, "cleanArray");
|
|
1478
1485
|
function Se(a) {
|
|
1479
1486
|
const t = Mt(null);
|
|
1480
|
-
for (const n of
|
|
1487
|
+
for (const n of Ws(a)) {
|
|
1481
1488
|
var e = oi(n, 2);
|
|
1482
1489
|
const i = e[0], s = e[1];
|
|
1483
|
-
|
|
1490
|
+
he(a, i) && (Re(s) ? t[i] = bi(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = Se(s) : t[i] = s);
|
|
1484
1491
|
}
|
|
1485
1492
|
return t;
|
|
1486
1493
|
}
|
|
@@ -1494,16 +1501,16 @@ function yi(a) {
|
|
|
1494
1501
|
case "boolean":
|
|
1495
1502
|
return vi(a);
|
|
1496
1503
|
case "bigint":
|
|
1497
|
-
return
|
|
1504
|
+
return ys ? ys(a) : "0";
|
|
1498
1505
|
case "symbol":
|
|
1499
|
-
return
|
|
1506
|
+
return ks ? ks(a) : "Symbol()";
|
|
1500
1507
|
case "undefined":
|
|
1501
1508
|
return Ut(a);
|
|
1502
1509
|
case "function":
|
|
1503
1510
|
case "object": {
|
|
1504
1511
|
if (a === null)
|
|
1505
1512
|
return Ut(a);
|
|
1506
|
-
const t = a, e =
|
|
1513
|
+
const t = a, e = Qe(t, "toString");
|
|
1507
1514
|
if (typeof e == "function") {
|
|
1508
1515
|
const n = e(t);
|
|
1509
1516
|
return typeof n == "string" ? n : Ut(n);
|
|
@@ -1515,7 +1522,7 @@ function yi(a) {
|
|
|
1515
1522
|
}
|
|
1516
1523
|
}
|
|
1517
1524
|
u(yi, "stringifyValue");
|
|
1518
|
-
function
|
|
1525
|
+
function Qe(a, t) {
|
|
1519
1526
|
for (; a !== null; ) {
|
|
1520
1527
|
const n = hi(a, t);
|
|
1521
1528
|
if (n) {
|
|
@@ -1531,7 +1538,7 @@ function Je(a, t) {
|
|
|
1531
1538
|
}
|
|
1532
1539
|
return u(e, "fallbackValue"), e;
|
|
1533
1540
|
}
|
|
1534
|
-
u(
|
|
1541
|
+
u(Qe, "lookupGetter");
|
|
1535
1542
|
function ki(a) {
|
|
1536
1543
|
try {
|
|
1537
1544
|
return we(a, ""), !0;
|
|
@@ -1540,7 +1547,7 @@ function ki(a) {
|
|
|
1540
1547
|
}
|
|
1541
1548
|
}
|
|
1542
1549
|
u(ki, "isRegex");
|
|
1543
|
-
const
|
|
1550
|
+
const ws = Ce(["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"]), _n = Ce(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Rn = Ce(["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"]), wi = Ce(["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"]), Cn = Ce(["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"]), Ti = Ce(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ts = Ce(["#text"]), Ss = Ce(["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"]), Mn = Ce(["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"]), As = Ce(["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"]), an = Ce(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Si = Ne(/{{[\w\W]*|^[\w\W]*}}/g), Ai = Ne(/<%[\w\W]*|^[\w\W]*%>/g), Ei = Ne(/\${[\w\W]*/g), _i = Ne(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ri = Ne(/^aria-[\-\w]+$/), Es = Ne(
|
|
1544
1551
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
1545
1552
|
// eslint-disable-line no-useless-escape
|
|
1546
1553
|
), Ci = Ne(/^(?:\w+script|data):/i), Mi = Ne(
|
|
@@ -1583,7 +1590,7 @@ const Ts = Ce(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
1583
1590
|
} catch {
|
|
1584
1591
|
return console.warn("TrustedTypes policy " + s + " could not be created."), null;
|
|
1585
1592
|
}
|
|
1586
|
-
}, "_createTrustedTypesPolicy"),
|
|
1593
|
+
}, "_createTrustedTypesPolicy"), _s = /* @__PURE__ */ u(function() {
|
|
1587
1594
|
return {
|
|
1588
1595
|
afterSanitizeAttributes: [],
|
|
1589
1596
|
afterSanitizeElements: [],
|
|
@@ -1596,9 +1603,9 @@ const Ts = Ce(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
1596
1603
|
uponSanitizeShadowNode: []
|
|
1597
1604
|
};
|
|
1598
1605
|
}, "_createHooksMap");
|
|
1599
|
-
function
|
|
1606
|
+
function Vs() {
|
|
1600
1607
|
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Di();
|
|
1601
|
-
const t = /* @__PURE__ */ u((
|
|
1608
|
+
const t = /* @__PURE__ */ u((B) => Vs(B), "DOMPurify");
|
|
1602
1609
|
if (t.version = "3.4.7", t.removed = [], !a || !a.document || a.document.nodeType !== Ze.document || !a.Element)
|
|
1603
1610
|
return t.isSupported = !1, t;
|
|
1604
1611
|
let e = a.document;
|
|
@@ -1606,20 +1613,20 @@ function qs() {
|
|
|
1606
1613
|
a.DocumentFragment;
|
|
1607
1614
|
const s = a.HTMLTemplateElement, l = a.Node, o = a.Element, p = a.NodeFilter, d = a.NamedNodeMap;
|
|
1608
1615
|
d === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
1609
|
-
const k = a.DOMParser,
|
|
1616
|
+
const k = a.DOMParser, A = a.trustedTypes, x = o.prototype, w = Qe(x, "cloneNode"), C = Qe(x, "remove"), E = Qe(x, "nextSibling"), $ = Qe(x, "childNodes"), Q = Qe(x, "parentNode"), D = Qe(x, "shadowRoot"), N = Qe(x, "attributes"), z = l && l.prototype ? Qe(l.prototype, "nodeType") : null, F = l && l.prototype ? Qe(l.prototype, "nodeName") : null;
|
|
1610
1617
|
if (typeof s == "function") {
|
|
1611
|
-
const
|
|
1612
|
-
|
|
1613
|
-
}
|
|
1614
|
-
let H,
|
|
1615
|
-
const
|
|
1616
|
-
let
|
|
1617
|
-
t.isSupported = typeof
|
|
1618
|
-
const at = Si, be = Ai, je = Ei,
|
|
1619
|
-
let Ge =
|
|
1620
|
-
const it = q({}, [...
|
|
1618
|
+
const B = e.createElement("template");
|
|
1619
|
+
B.content && B.content.ownerDocument && (e = B.content.ownerDocument);
|
|
1620
|
+
}
|
|
1621
|
+
let H, j = "";
|
|
1622
|
+
const re = e, Ie = re.implementation, ue = re.createNodeIterator, $e = re.createDocumentFragment, xt = re.getElementsByTagName, st = n.importNode;
|
|
1623
|
+
let ce = _s();
|
|
1624
|
+
t.isSupported = typeof Ws == "function" && typeof Q == "function" && Ie && Ie.createHTMLDocument !== void 0;
|
|
1625
|
+
const at = Si, be = Ai, je = Ei, bt = _i, Ee = Ri, Le = Ci, We = Mi, ke = $i;
|
|
1626
|
+
let Ge = Es, X = null;
|
|
1627
|
+
const it = q({}, [...ws, ..._n, ...Rn, ...Cn, ...Ts]);
|
|
1621
1628
|
let ie = null;
|
|
1622
|
-
const rt = q({}, [...
|
|
1629
|
+
const rt = q({}, [...Ss, ...Mn, ...As, ...an]);
|
|
1623
1630
|
let te = Object.seal(Mt(null, {
|
|
1624
1631
|
tagNameCheck: {
|
|
1625
1632
|
writable: !0,
|
|
@@ -1640,7 +1647,7 @@ function qs() {
|
|
|
1640
1647
|
value: !1
|
|
1641
1648
|
}
|
|
1642
1649
|
})), Ve = null, g = null;
|
|
1643
|
-
const
|
|
1650
|
+
const S = Object.seal(Mt(null, {
|
|
1644
1651
|
tagCheck: {
|
|
1645
1652
|
writable: !0,
|
|
1646
1653
|
configurable: !1,
|
|
@@ -1654,57 +1661,57 @@ function qs() {
|
|
|
1654
1661
|
value: null
|
|
1655
1662
|
}
|
|
1656
1663
|
}));
|
|
1657
|
-
let c = !0,
|
|
1658
|
-
const
|
|
1659
|
-
let v = !0,
|
|
1664
|
+
let c = !0, M = !0, L = !1, O = !0, V = !1, le = !0, pe = !1, de = !1, fe = !1, Te = !1, De = !1, _e = !1, qe = !0, Pe = !1;
|
|
1665
|
+
const R = "user-content-";
|
|
1666
|
+
let v = !0, b = !1, Z = {}, U = null;
|
|
1660
1667
|
const ae = q({}, ["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"]);
|
|
1661
1668
|
let Ke = null;
|
|
1662
|
-
const
|
|
1669
|
+
const yt = q({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
1663
1670
|
let vn = null;
|
|
1664
|
-
const
|
|
1665
|
-
let
|
|
1666
|
-
const
|
|
1671
|
+
const Yn = q({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Zt = "http://www.w3.org/1998/Math/MathML", Jt = "http://www.w3.org/2000/svg", Ye = "http://www.w3.org/1999/xhtml";
|
|
1672
|
+
let kt = Ye, xn = !1, bn = null;
|
|
1673
|
+
const ra = q({}, [Zt, Jt, Ye], En);
|
|
1667
1674
|
let yn = q({}, ["mi", "mo", "mn", "ms", "mtext"]), kn = q({}, ["annotation-xml"]);
|
|
1668
|
-
const
|
|
1675
|
+
const la = q({}, ["title", "style", "font", "a", "script"]);
|
|
1669
1676
|
let Pt = null;
|
|
1670
|
-
const
|
|
1671
|
-
let me = null,
|
|
1672
|
-
const
|
|
1677
|
+
const oa = ["application/xhtml+xml", "text/html"], ca = "text/html";
|
|
1678
|
+
let me = null, wt = null;
|
|
1679
|
+
const ua = e.createElement("form"), Xn = /* @__PURE__ */ u(function(r) {
|
|
1673
1680
|
return r instanceof RegExp || r instanceof Function;
|
|
1674
1681
|
}, "isRegexOrFunction"), wn = /* @__PURE__ */ u(function() {
|
|
1675
1682
|
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1676
|
-
if (
|
|
1683
|
+
if (wt && wt === r)
|
|
1677
1684
|
return;
|
|
1678
1685
|
(!r || typeof r != "object") && (r = {}), r = Se(r), Pt = // eslint-disable-next-line unicorn/prefer-includes
|
|
1679
|
-
|
|
1680
|
-
const m =
|
|
1681
|
-
if (te = Mt(null),
|
|
1686
|
+
oa.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? ca : r.PARSER_MEDIA_TYPE, me = Pt === "application/xhtml+xml" ? En : Vt, X = he(r, "ALLOWED_TAGS") && Re(r.ALLOWED_TAGS) ? q({}, r.ALLOWED_TAGS, me) : it, ie = he(r, "ALLOWED_ATTR") && Re(r.ALLOWED_ATTR) ? q({}, r.ALLOWED_ATTR, me) : rt, bn = he(r, "ALLOWED_NAMESPACES") && Re(r.ALLOWED_NAMESPACES) ? q({}, r.ALLOWED_NAMESPACES, En) : ra, vn = he(r, "ADD_URI_SAFE_ATTR") && Re(r.ADD_URI_SAFE_ATTR) ? q(Se(Yn), r.ADD_URI_SAFE_ATTR, me) : Yn, Ke = he(r, "ADD_DATA_URI_TAGS") && Re(r.ADD_DATA_URI_TAGS) ? q(Se(yt), r.ADD_DATA_URI_TAGS, me) : yt, U = he(r, "FORBID_CONTENTS") && Re(r.FORBID_CONTENTS) ? q({}, r.FORBID_CONTENTS, me) : ae, Ve = he(r, "FORBID_TAGS") && Re(r.FORBID_TAGS) ? q({}, r.FORBID_TAGS, me) : Se({}), g = he(r, "FORBID_ATTR") && Re(r.FORBID_ATTR) ? q({}, r.FORBID_ATTR, me) : Se({}), Z = he(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? Se(r.USE_PROFILES) : r.USE_PROFILES : !1, c = r.ALLOW_ARIA_ATTR !== !1, M = r.ALLOW_DATA_ATTR !== !1, L = r.ALLOW_UNKNOWN_PROTOCOLS || !1, O = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = r.SAFE_FOR_TEMPLATES || !1, le = r.SAFE_FOR_XML !== !1, pe = r.WHOLE_DOCUMENT || !1, Te = r.RETURN_DOM || !1, De = r.RETURN_DOM_FRAGMENT || !1, _e = r.RETURN_TRUSTED_TYPE || !1, fe = r.FORCE_BODY || !1, qe = r.SANITIZE_DOM !== !1, Pe = r.SANITIZE_NAMED_PROPS || !1, v = r.KEEP_CONTENT !== !1, b = r.IN_PLACE || !1, Ge = ki(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : Es, kt = typeof r.NAMESPACE == "string" ? r.NAMESPACE : Ye, yn = he(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Se(r.MATHML_TEXT_INTEGRATION_POINTS) : q({}, ["mi", "mo", "mn", "ms", "mtext"]), kn = he(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? Se(r.HTML_INTEGRATION_POINTS) : q({}, ["annotation-xml"]);
|
|
1687
|
+
const m = he(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? Se(r.CUSTOM_ELEMENT_HANDLING) : Mt(null);
|
|
1688
|
+
if (te = Mt(null), he(m, "tagNameCheck") && Xn(m.tagNameCheck) && (te.tagNameCheck = m.tagNameCheck), he(m, "attributeNameCheck") && Xn(m.attributeNameCheck) && (te.attributeNameCheck = m.attributeNameCheck), he(m, "allowCustomizedBuiltInElements") && typeof m.allowCustomizedBuiltInElements == "boolean" && (te.allowCustomizedBuiltInElements = m.allowCustomizedBuiltInElements), V && (M = !1), De && (Te = !0), Z && (X = q({}, Ts), ie = Mt(null), Z.html === !0 && (q(X, ws), q(ie, Ss)), Z.svg === !0 && (q(X, _n), q(ie, Mn), q(ie, an)), Z.svgFilters === !0 && (q(X, Rn), q(ie, Mn), q(ie, an)), Z.mathMl === !0 && (q(X, Cn), q(ie, As), q(ie, an))), S.tagCheck = null, S.attributeCheck = null, he(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? S.tagCheck = r.ADD_TAGS : Re(r.ADD_TAGS) && (X === it && (X = Se(X)), q(X, r.ADD_TAGS, me))), he(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? S.attributeCheck = r.ADD_ATTR : Re(r.ADD_ATTR) && (ie === rt && (ie = Se(ie)), q(ie, r.ADD_ATTR, me))), he(r, "ADD_URI_SAFE_ATTR") && Re(r.ADD_URI_SAFE_ATTR) && q(vn, r.ADD_URI_SAFE_ATTR, me), he(r, "FORBID_CONTENTS") && Re(r.FORBID_CONTENTS) && (U === ae && (U = Se(U)), q(U, r.FORBID_CONTENTS, me)), he(r, "ADD_FORBID_CONTENTS") && Re(r.ADD_FORBID_CONTENTS) && (U === ae && (U = Se(U)), q(U, r.ADD_FORBID_CONTENTS, me)), v && (X["#text"] = !0), pe && q(X, ["html", "head", "body"]), X.table && (q(X, ["tbody"]), delete Ve.tbody), r.TRUSTED_TYPES_POLICY) {
|
|
1682
1689
|
if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
1683
1690
|
throw Ht('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1684
1691
|
if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
1685
1692
|
throw Ht('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
1686
|
-
H = r.TRUSTED_TYPES_POLICY,
|
|
1693
|
+
H = r.TRUSTED_TYPES_POLICY, j = H.createHTML("");
|
|
1687
1694
|
} else
|
|
1688
|
-
H === void 0 && (H = Li(
|
|
1689
|
-
(
|
|
1690
|
-
}, "_parseConfig"),
|
|
1691
|
-
let m =
|
|
1695
|
+
H === void 0 && (H = Li(A, i)), H !== null && typeof j == "string" && (j = H.createHTML(""));
|
|
1696
|
+
(ce.uponSanitizeElement.length > 0 || ce.uponSanitizeAttribute.length > 0) && X === it && (X = Se(X)), ce.uponSanitizeAttribute.length > 0 && ie === rt && (ie = Se(ie)), Ce && Ce(r), wt = r;
|
|
1697
|
+
}, "_parseConfig"), Zn = q({}, [..._n, ...Rn, ...wi]), Jn = q({}, [...Cn, ...Ti]), da = /* @__PURE__ */ u(function(r) {
|
|
1698
|
+
let m = Q(r);
|
|
1692
1699
|
(!m || !m.tagName) && (m = {
|
|
1693
|
-
namespaceURI:
|
|
1700
|
+
namespaceURI: kt,
|
|
1694
1701
|
tagName: "template"
|
|
1695
1702
|
});
|
|
1696
|
-
const
|
|
1697
|
-
return bn[r.namespaceURI] ? r.namespaceURI ===
|
|
1698
|
-
}, "_checkValidNamespace"),
|
|
1703
|
+
const I = Vt(r.tagName), ne = Vt(m.tagName);
|
|
1704
|
+
return bn[r.namespaceURI] ? r.namespaceURI === Jt ? m.namespaceURI === Ye ? I === "svg" : m.namespaceURI === Zt ? I === "svg" && (ne === "annotation-xml" || yn[ne]) : !!Zn[I] : r.namespaceURI === Zt ? m.namespaceURI === Ye ? I === "math" : m.namespaceURI === Jt ? I === "math" && kn[ne] : !!Jn[I] : r.namespaceURI === Ye ? m.namespaceURI === Jt && !kn[ne] || m.namespaceURI === Zt && !yn[ne] ? !1 : !Jn[I] && (la[I] || !Zn[I]) : !!(Pt === "application/xhtml+xml" && bn[r.namespaceURI]) : !1;
|
|
1705
|
+
}, "_checkValidNamespace"), Fe = /* @__PURE__ */ u(function(r) {
|
|
1699
1706
|
At(t.removed, {
|
|
1700
1707
|
element: r
|
|
1701
1708
|
});
|
|
1702
1709
|
try {
|
|
1703
|
-
|
|
1710
|
+
Q(r).removeChild(r);
|
|
1704
1711
|
} catch {
|
|
1705
|
-
|
|
1712
|
+
C(r);
|
|
1706
1713
|
}
|
|
1707
|
-
}, "_forceRemove"),
|
|
1714
|
+
}, "_forceRemove"), ht = /* @__PURE__ */ u(function(r, m) {
|
|
1708
1715
|
try {
|
|
1709
1716
|
At(t.removed, {
|
|
1710
1717
|
attribute: m.getAttributeNode(r),
|
|
@@ -1719,7 +1726,7 @@ function qs() {
|
|
|
1719
1726
|
if (m.removeAttribute(r), r === "is")
|
|
1720
1727
|
if (Te || De)
|
|
1721
1728
|
try {
|
|
1722
|
-
|
|
1729
|
+
Fe(m);
|
|
1723
1730
|
} catch {
|
|
1724
1731
|
}
|
|
1725
1732
|
else
|
|
@@ -1727,69 +1734,69 @@ function qs() {
|
|
|
1727
1734
|
m.setAttribute(r, "");
|
|
1728
1735
|
} catch {
|
|
1729
1736
|
}
|
|
1730
|
-
}, "_removeAttribute"),
|
|
1731
|
-
let m = null,
|
|
1737
|
+
}, "_removeAttribute"), Qn = /* @__PURE__ */ u(function(r) {
|
|
1738
|
+
let m = null, I = null;
|
|
1732
1739
|
if (fe)
|
|
1733
1740
|
r = "<remove></remove>" + r;
|
|
1734
1741
|
else {
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1742
|
+
const oe = xs(r, /^[\r\n\t ]+/);
|
|
1743
|
+
I = oe && oe[0];
|
|
1737
1744
|
}
|
|
1738
|
-
Pt === "application/xhtml+xml" &&
|
|
1745
|
+
Pt === "application/xhtml+xml" && kt === Ye && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
|
|
1739
1746
|
const ne = H ? H.createHTML(r) : r;
|
|
1740
|
-
if (
|
|
1747
|
+
if (kt === Ye)
|
|
1741
1748
|
try {
|
|
1742
1749
|
m = new k().parseFromString(ne, Pt);
|
|
1743
1750
|
} catch {
|
|
1744
1751
|
}
|
|
1745
1752
|
if (!m || !m.documentElement) {
|
|
1746
|
-
m = Ie.createDocument(
|
|
1753
|
+
m = Ie.createDocument(kt, "template", null);
|
|
1747
1754
|
try {
|
|
1748
|
-
m.documentElement.innerHTML = xn ?
|
|
1755
|
+
m.documentElement.innerHTML = xn ? j : ne;
|
|
1749
1756
|
} catch {
|
|
1750
1757
|
}
|
|
1751
1758
|
}
|
|
1752
1759
|
const Y = m.body || m.documentElement;
|
|
1753
|
-
return r &&
|
|
1754
|
-
}, "_initDocument"),
|
|
1755
|
-
return
|
|
1760
|
+
return r && I && Y.insertBefore(e.createTextNode(I), Y.childNodes[0] || null), kt === Ye ? xt.call(m, pe ? "html" : "body")[0] : pe ? m.documentElement : Y;
|
|
1761
|
+
}, "_initDocument"), es = /* @__PURE__ */ u(function(r) {
|
|
1762
|
+
return ue.call(
|
|
1756
1763
|
r.ownerDocument || r,
|
|
1757
1764
|
r,
|
|
1758
1765
|
// eslint-disable-next-line no-bitwise
|
|
1759
1766
|
p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
|
|
1760
1767
|
null
|
|
1761
1768
|
);
|
|
1762
|
-
}, "_createNodeIterator"),
|
|
1769
|
+
}, "_createNodeIterator"), ts = /* @__PURE__ */ u(function(r) {
|
|
1763
1770
|
r.normalize();
|
|
1764
|
-
const m =
|
|
1771
|
+
const m = ue.call(
|
|
1765
1772
|
r.ownerDocument || r,
|
|
1766
1773
|
r,
|
|
1767
1774
|
// eslint-disable-next-line no-bitwise
|
|
1768
1775
|
p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION,
|
|
1769
1776
|
null
|
|
1770
1777
|
);
|
|
1771
|
-
let
|
|
1772
|
-
for (;
|
|
1773
|
-
let ne =
|
|
1778
|
+
let I = m.nextNode();
|
|
1779
|
+
for (; I; ) {
|
|
1780
|
+
let ne = I.data;
|
|
1774
1781
|
St([at, be, je], (Y) => {
|
|
1775
1782
|
ne = Et(ne, Y, " ");
|
|
1776
|
-
}),
|
|
1783
|
+
}), I.data = ne, I = m.nextNode();
|
|
1777
1784
|
}
|
|
1778
|
-
}, "_scrubTemplateExpressions"),
|
|
1779
|
-
const m =
|
|
1785
|
+
}, "_scrubTemplateExpressions"), Qt = /* @__PURE__ */ u(function(r) {
|
|
1786
|
+
const m = F ? F(r) : null;
|
|
1780
1787
|
return typeof m != "string" || me(m) !== "form" ? !1 : typeof r.nodeName != "string" || typeof r.textContent != "string" || typeof r.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
1781
1788
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
1782
1789
|
// makes the direct read diverge from the cached read; a clean form
|
|
1783
1790
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
1784
1791
|
// canonical NamedNodeMap.
|
|
1785
|
-
r.attributes !==
|
|
1792
|
+
r.attributes !== N(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
|
|
1786
1793
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
1787
1794
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
1788
1795
|
// the named child element. Cheap addition — nodeType is read from
|
|
1789
1796
|
// an internal slot, no serialization cost — and removes a residual
|
|
1790
1797
|
// clobbering surface used by several mXSS / PI / comment branches
|
|
1791
1798
|
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
1792
|
-
r.nodeType !==
|
|
1799
|
+
r.nodeType !== z(r) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
1793
1800
|
// "childNodes" shadows the prototype getter. Direct reads of
|
|
1794
1801
|
// form.childNodes from a clobbered form return the named child
|
|
1795
1802
|
// instead of the real NodeList, so any walk that reads it directly
|
|
@@ -1800,80 +1807,80 @@ function qs() {
|
|
|
1800
1807
|
// select, etc.) regardless of whether the named child happens to
|
|
1801
1808
|
// carry a numeric .length, which a typeof-based probe would miss
|
|
1802
1809
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
1803
|
-
r.childNodes !==
|
|
1804
|
-
}, "_isClobbered"),
|
|
1805
|
-
if (!
|
|
1810
|
+
r.childNodes !== $(r);
|
|
1811
|
+
}, "_isClobbered"), Ft = /* @__PURE__ */ u(function(r) {
|
|
1812
|
+
if (!z || typeof r != "object" || r === null)
|
|
1806
1813
|
return !1;
|
|
1807
1814
|
try {
|
|
1808
|
-
return
|
|
1815
|
+
return z(r) === Ze.documentFragment;
|
|
1809
1816
|
} catch {
|
|
1810
1817
|
return !1;
|
|
1811
1818
|
}
|
|
1812
1819
|
}, "_isDocumentFragment"), en = /* @__PURE__ */ u(function(r) {
|
|
1813
|
-
if (!
|
|
1820
|
+
if (!z || typeof r != "object" || r === null)
|
|
1814
1821
|
return !1;
|
|
1815
1822
|
try {
|
|
1816
|
-
return typeof
|
|
1823
|
+
return typeof z(r) == "number";
|
|
1817
1824
|
} catch {
|
|
1818
1825
|
return !1;
|
|
1819
1826
|
}
|
|
1820
1827
|
}, "_isNode");
|
|
1821
|
-
function tt(
|
|
1822
|
-
St(
|
|
1823
|
-
|
|
1828
|
+
function tt(B, r, m) {
|
|
1829
|
+
St(B, (I) => {
|
|
1830
|
+
I.call(t, r, m, wt);
|
|
1824
1831
|
});
|
|
1825
1832
|
}
|
|
1826
1833
|
u(tt, "_executeHooks");
|
|
1827
|
-
const
|
|
1834
|
+
const ns = /* @__PURE__ */ u(function(r) {
|
|
1828
1835
|
let m = null;
|
|
1829
|
-
if (tt(
|
|
1830
|
-
return
|
|
1831
|
-
const
|
|
1832
|
-
if (tt(
|
|
1833
|
-
tagName:
|
|
1836
|
+
if (tt(ce.beforeSanitizeElements, r, null), Qt(r))
|
|
1837
|
+
return Fe(r), !0;
|
|
1838
|
+
const I = me(r.nodeName);
|
|
1839
|
+
if (tt(ce.uponSanitizeElement, r, {
|
|
1840
|
+
tagName: I,
|
|
1834
1841
|
allowedTags: X
|
|
1835
|
-
}),
|
|
1836
|
-
return
|
|
1837
|
-
if (Ve[
|
|
1838
|
-
if (!Ve[
|
|
1842
|
+
}), le && r.hasChildNodes() && !en(r.firstElementChild) && we(/<[/\w!]/g, r.innerHTML) && we(/<[/\w!]/g, r.textContent) || le && r.namespaceURI === Ye && I === "style" && en(r.firstElementChild) || r.nodeType === Ze.progressingInstruction || le && r.nodeType === Ze.comment && we(/<[/\w]/g, r.data))
|
|
1843
|
+
return Fe(r), !0;
|
|
1844
|
+
if (Ve[I] || !(S.tagCheck instanceof Function && S.tagCheck(I)) && !X[I]) {
|
|
1845
|
+
if (!Ve[I] && as(I) && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck, I) || te.tagNameCheck instanceof Function && te.tagNameCheck(I)))
|
|
1839
1846
|
return !1;
|
|
1840
|
-
if (v && !
|
|
1841
|
-
const Y =
|
|
1842
|
-
if (
|
|
1843
|
-
const ze =
|
|
1847
|
+
if (v && !U[I]) {
|
|
1848
|
+
const Y = Q(r), oe = $(r);
|
|
1849
|
+
if (oe && Y) {
|
|
1850
|
+
const ze = oe.length;
|
|
1844
1851
|
for (let Xe = ze - 1; Xe >= 0; --Xe) {
|
|
1845
|
-
const
|
|
1846
|
-
Y.insertBefore(
|
|
1852
|
+
const Be = w(oe[Xe], !0);
|
|
1853
|
+
Y.insertBefore(Be, E(r));
|
|
1847
1854
|
}
|
|
1848
1855
|
}
|
|
1849
1856
|
}
|
|
1850
|
-
return
|
|
1857
|
+
return Fe(r), !0;
|
|
1851
1858
|
}
|
|
1852
|
-
return (
|
|
1859
|
+
return (z ? z(r) : r.nodeType) === Ze.element && !da(r) || (I === "noscript" || I === "noembed" || I === "noframes") && we(/<\/no(script|embed|frames)/i, r.innerHTML) ? (Fe(r), !0) : (V && r.nodeType === Ze.text && (m = r.textContent, St([at, be, je], (Y) => {
|
|
1853
1860
|
m = Et(m, Y, " ");
|
|
1854
1861
|
}), r.textContent !== m && (At(t.removed, {
|
|
1855
1862
|
element: r.cloneNode()
|
|
1856
|
-
}), r.textContent = m)), tt(
|
|
1857
|
-
}, "_sanitizeElements"),
|
|
1858
|
-
if (g[m] || qe && (m === "id" || m === "name") && (
|
|
1863
|
+
}), r.textContent = m)), tt(ce.afterSanitizeElements, r, null), !1);
|
|
1864
|
+
}, "_sanitizeElements"), ss = /* @__PURE__ */ u(function(r, m, I) {
|
|
1865
|
+
if (g[m] || qe && (m === "id" || m === "name") && (I in e || I in ua))
|
|
1859
1866
|
return !1;
|
|
1860
|
-
const ne = ie[m] ||
|
|
1861
|
-
if (!(
|
|
1867
|
+
const ne = ie[m] || S.attributeCheck instanceof Function && S.attributeCheck(m, r);
|
|
1868
|
+
if (!(M && !g[m] && we(bt, m))) {
|
|
1862
1869
|
if (!(c && we(Ee, m))) {
|
|
1863
1870
|
if (!ne || g[m]) {
|
|
1864
1871
|
if (
|
|
1865
1872
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1866
1873
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1867
1874
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
1868
|
-
!(
|
|
1875
|
+
!(as(r) && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck, r) || te.tagNameCheck instanceof Function && te.tagNameCheck(r)) && (te.attributeNameCheck instanceof RegExp && we(te.attributeNameCheck, m) || te.attributeNameCheck instanceof Function && te.attributeNameCheck(m, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
1869
1876
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1870
|
-
m === "is" && te.allowCustomizedBuiltInElements && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck,
|
|
1877
|
+
m === "is" && te.allowCustomizedBuiltInElements && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck, I) || te.tagNameCheck instanceof Function && te.tagNameCheck(I)))
|
|
1871
1878
|
) return !1;
|
|
1872
1879
|
} else if (!vn[m]) {
|
|
1873
|
-
if (!we(Ge, Et(
|
|
1874
|
-
if (!((m === "src" || m === "xlink:href" || m === "href") && r !== "script" &&
|
|
1875
|
-
if (!(L && !we(Le, Et(
|
|
1876
|
-
if (
|
|
1880
|
+
if (!we(Ge, Et(I, We, ""))) {
|
|
1881
|
+
if (!((m === "src" || m === "xlink:href" || m === "href") && r !== "script" && bs(I, "data:") === 0 && Ke[r])) {
|
|
1882
|
+
if (!(L && !we(Le, Et(I, We, "")))) {
|
|
1883
|
+
if (I)
|
|
1877
1884
|
return !1;
|
|
1878
1885
|
}
|
|
1879
1886
|
}
|
|
@@ -1882,14 +1889,14 @@ function qs() {
|
|
|
1882
1889
|
}
|
|
1883
1890
|
}
|
|
1884
1891
|
return !0;
|
|
1885
|
-
}, "_isValidAttribute"),
|
|
1886
|
-
return !
|
|
1887
|
-
}, "_isBasicCustomElement"),
|
|
1888
|
-
tt(
|
|
1892
|
+
}, "_isValidAttribute"), ha = q({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), as = /* @__PURE__ */ u(function(r) {
|
|
1893
|
+
return !ha[Vt(r)] && we(ke, r);
|
|
1894
|
+
}, "_isBasicCustomElement"), is = /* @__PURE__ */ u(function(r) {
|
|
1895
|
+
tt(ce.beforeSanitizeAttributes, r, null);
|
|
1889
1896
|
const m = r.attributes;
|
|
1890
|
-
if (!m ||
|
|
1897
|
+
if (!m || Qt(r))
|
|
1891
1898
|
return;
|
|
1892
|
-
const
|
|
1899
|
+
const I = {
|
|
1893
1900
|
attrName: "",
|
|
1894
1901
|
attrValue: "",
|
|
1895
1902
|
keepAttr: !0,
|
|
@@ -1898,36 +1905,36 @@ function qs() {
|
|
|
1898
1905
|
};
|
|
1899
1906
|
let ne = m.length;
|
|
1900
1907
|
for (; ne--; ) {
|
|
1901
|
-
const Y = m[ne],
|
|
1902
|
-
let ye =
|
|
1903
|
-
if (
|
|
1904
|
-
|
|
1908
|
+
const Y = m[ne], oe = Y.name, ze = Y.namespaceURI, Xe = Y.value, Be = me(oe), Tn = Xe;
|
|
1909
|
+
let ye = oe === "value" ? Tn : mi(Tn);
|
|
1910
|
+
if (I.attrName = Be, I.attrValue = ye, I.keepAttr = !0, I.forceKeepAttr = void 0, tt(ce.uponSanitizeAttribute, r, I), ye = I.attrValue, Pe && (Be === "id" || Be === "name") && bs(ye, R) !== 0 && (ht(oe, r), ye = R + ye), le && we(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, ye)) {
|
|
1911
|
+
ht(oe, r);
|
|
1905
1912
|
continue;
|
|
1906
1913
|
}
|
|
1907
|
-
if (
|
|
1908
|
-
|
|
1914
|
+
if (Be === "attributename" && xs(ye, "href")) {
|
|
1915
|
+
ht(oe, r);
|
|
1909
1916
|
continue;
|
|
1910
1917
|
}
|
|
1911
|
-
if (
|
|
1918
|
+
if (I.forceKeepAttr)
|
|
1912
1919
|
continue;
|
|
1913
|
-
if (
|
|
1914
|
-
|
|
1920
|
+
if (!I.keepAttr) {
|
|
1921
|
+
ht(oe, r);
|
|
1915
1922
|
continue;
|
|
1916
1923
|
}
|
|
1917
1924
|
if (!O && we(/\/>/i, ye)) {
|
|
1918
|
-
|
|
1925
|
+
ht(oe, r);
|
|
1919
1926
|
continue;
|
|
1920
1927
|
}
|
|
1921
|
-
|
|
1922
|
-
ye = Et(ye,
|
|
1928
|
+
V && St([at, be, je], (ls) => {
|
|
1929
|
+
ye = Et(ye, ls, " ");
|
|
1923
1930
|
});
|
|
1924
|
-
const
|
|
1925
|
-
if (!
|
|
1926
|
-
|
|
1931
|
+
const rs = me(r.nodeName);
|
|
1932
|
+
if (!ss(rs, Be, ye)) {
|
|
1933
|
+
ht(oe, r);
|
|
1927
1934
|
continue;
|
|
1928
1935
|
}
|
|
1929
|
-
if (H && typeof
|
|
1930
|
-
switch (
|
|
1936
|
+
if (H && typeof A == "object" && typeof A.getAttributeType == "function" && !ze)
|
|
1937
|
+
switch (A.getAttributeType(rs, Be)) {
|
|
1931
1938
|
case "TrustedHTML": {
|
|
1932
1939
|
ye = H.createHTML(ye);
|
|
1933
1940
|
break;
|
|
@@ -1939,77 +1946,77 @@ function qs() {
|
|
|
1939
1946
|
}
|
|
1940
1947
|
if (ye !== Tn)
|
|
1941
1948
|
try {
|
|
1942
|
-
ze ? r.setAttributeNS(ze,
|
|
1949
|
+
ze ? r.setAttributeNS(ze, oe, ye) : r.setAttribute(oe, ye), Qt(r) ? Fe(r) : vs(t.removed);
|
|
1943
1950
|
} catch {
|
|
1944
|
-
|
|
1951
|
+
ht(oe, r);
|
|
1945
1952
|
}
|
|
1946
1953
|
}
|
|
1947
|
-
tt(
|
|
1954
|
+
tt(ce.afterSanitizeAttributes, r, null);
|
|
1948
1955
|
}, "_sanitizeAttributes"), tn = /* @__PURE__ */ u(function(r) {
|
|
1949
1956
|
let m = null;
|
|
1950
|
-
const
|
|
1951
|
-
for (tt(
|
|
1952
|
-
if (tt(
|
|
1953
|
-
const Y =
|
|
1954
|
-
|
|
1957
|
+
const I = es(r);
|
|
1958
|
+
for (tt(ce.beforeSanitizeShadowDOM, r, null); m = I.nextNode(); )
|
|
1959
|
+
if (tt(ce.uponSanitizeShadowNode, m, null), ns(m), is(m), Ft(m.content) && tn(m.content), (z ? z(m) : m.nodeType) === Ze.element) {
|
|
1960
|
+
const Y = D ? D(m) : m.shadowRoot;
|
|
1961
|
+
Ft(Y) && (Tt(Y), tn(Y));
|
|
1955
1962
|
}
|
|
1956
|
-
tt(
|
|
1957
|
-
}, "_sanitizeShadowDOM"),
|
|
1958
|
-
const m =
|
|
1963
|
+
tt(ce.afterSanitizeShadowDOM, r, null);
|
|
1964
|
+
}, "_sanitizeShadowDOM"), Tt = /* @__PURE__ */ u(function(r) {
|
|
1965
|
+
const m = z ? z(r) : r.nodeType;
|
|
1959
1966
|
if (m === Ze.element) {
|
|
1960
|
-
const Y =
|
|
1961
|
-
|
|
1967
|
+
const Y = D ? D(r) : r.shadowRoot;
|
|
1968
|
+
Ft(Y) && (Tt(Y), tn(Y));
|
|
1962
1969
|
}
|
|
1963
|
-
const
|
|
1964
|
-
if (
|
|
1970
|
+
const I = $ ? $(r) : r.childNodes;
|
|
1971
|
+
if (!I)
|
|
1965
1972
|
return;
|
|
1966
1973
|
const ne = [];
|
|
1967
|
-
St(
|
|
1974
|
+
St(I, (Y) => {
|
|
1968
1975
|
At(ne, Y);
|
|
1969
1976
|
});
|
|
1970
1977
|
for (const Y of ne)
|
|
1971
|
-
|
|
1978
|
+
Tt(Y);
|
|
1972
1979
|
if (m === Ze.element) {
|
|
1973
|
-
const Y =
|
|
1980
|
+
const Y = F ? F(r) : null;
|
|
1974
1981
|
if (typeof Y == "string" && me(Y) === "template") {
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1982
|
+
const oe = r.content;
|
|
1983
|
+
Ft(oe) && Tt(oe);
|
|
1977
1984
|
}
|
|
1978
1985
|
}
|
|
1979
1986
|
}, "_sanitizeAttachedShadowRoots");
|
|
1980
|
-
return t.sanitize = function(
|
|
1981
|
-
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = null,
|
|
1982
|
-
if (xn = !
|
|
1987
|
+
return t.sanitize = function(B) {
|
|
1988
|
+
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = null, I = null, ne = null, Y = null;
|
|
1989
|
+
if (xn = !B, xn && (B = "<!-->"), typeof B != "string" && !en(B) && (B = yi(B), typeof B != "string"))
|
|
1983
1990
|
throw Ht("dirty is not a string, aborting");
|
|
1984
1991
|
if (!t.isSupported)
|
|
1985
|
-
return
|
|
1986
|
-
if (
|
|
1987
|
-
const Xe =
|
|
1992
|
+
return B;
|
|
1993
|
+
if (de || wn(r), t.removed = [], typeof B == "string" && (b = !1), b) {
|
|
1994
|
+
const Xe = F ? F(B) : B.nodeName;
|
|
1988
1995
|
if (typeof Xe == "string") {
|
|
1989
|
-
const
|
|
1990
|
-
if (!X[
|
|
1996
|
+
const Be = me(Xe);
|
|
1997
|
+
if (!X[Be] || Ve[Be])
|
|
1991
1998
|
throw Ht("root node is forbidden and cannot be sanitized in-place");
|
|
1992
1999
|
}
|
|
1993
|
-
if (
|
|
2000
|
+
if (Qt(B))
|
|
1994
2001
|
throw Ht("root node is clobbered and cannot be sanitized in-place");
|
|
1995
|
-
|
|
1996
|
-
} else if (en(
|
|
1997
|
-
m =
|
|
2002
|
+
Tt(B);
|
|
2003
|
+
} else if (en(B))
|
|
2004
|
+
m = Qn("<!---->"), I = m.ownerDocument.importNode(B, !0), I.nodeType === Ze.element && I.nodeName === "BODY" || I.nodeName === "HTML" ? m = I : m.appendChild(I), Tt(I);
|
|
1998
2005
|
else {
|
|
1999
|
-
if (!Te && !
|
|
2000
|
-
|
|
2001
|
-
return H && _e ? H.createHTML(
|
|
2002
|
-
if (m =
|
|
2003
|
-
return Te ? null : _e ?
|
|
2006
|
+
if (!Te && !V && !pe && // eslint-disable-next-line unicorn/prefer-includes
|
|
2007
|
+
B.indexOf("<") === -1)
|
|
2008
|
+
return H && _e ? H.createHTML(B) : B;
|
|
2009
|
+
if (m = Qn(B), !m)
|
|
2010
|
+
return Te ? null : _e ? j : "";
|
|
2004
2011
|
}
|
|
2005
|
-
m && fe &&
|
|
2006
|
-
const
|
|
2007
|
-
for (; ne =
|
|
2008
|
-
|
|
2009
|
-
if (
|
|
2010
|
-
return
|
|
2012
|
+
m && fe && Fe(m.firstChild);
|
|
2013
|
+
const oe = es(b ? B : m);
|
|
2014
|
+
for (; ne = oe.nextNode(); )
|
|
2015
|
+
ns(ne), is(ne), Ft(ne.content) && tn(ne.content);
|
|
2016
|
+
if (b)
|
|
2017
|
+
return V && ts(B), B;
|
|
2011
2018
|
if (Te) {
|
|
2012
|
-
if (
|
|
2019
|
+
if (V && ts(m), De)
|
|
2013
2020
|
for (Y = $e.call(m.ownerDocument); m.firstChild; )
|
|
2014
2021
|
Y.appendChild(m.firstChild);
|
|
2015
2022
|
else
|
|
@@ -2018,43 +2025,43 @@ function qs() {
|
|
|
2018
2025
|
}
|
|
2019
2026
|
let ze = pe ? m.outerHTML : m.innerHTML;
|
|
2020
2027
|
return pe && X["!doctype"] && m.ownerDocument && m.ownerDocument.doctype && m.ownerDocument.doctype.name && we(Ii, m.ownerDocument.doctype.name) && (ze = "<!DOCTYPE " + m.ownerDocument.doctype.name + `>
|
|
2021
|
-
` + ze),
|
|
2028
|
+
` + ze), V && St([at, be, je], (Xe) => {
|
|
2022
2029
|
ze = Et(ze, Xe, " ");
|
|
2023
2030
|
}), H && _e ? H.createHTML(ze) : ze;
|
|
2024
2031
|
}, t.setConfig = function() {
|
|
2025
|
-
let
|
|
2026
|
-
wn(
|
|
2032
|
+
let B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2033
|
+
wn(B), de = !0;
|
|
2027
2034
|
}, t.clearConfig = function() {
|
|
2028
|
-
|
|
2029
|
-
}, t.isValidAttribute = function(
|
|
2030
|
-
|
|
2031
|
-
const
|
|
2032
|
-
return
|
|
2033
|
-
}, t.addHook = function(
|
|
2034
|
-
typeof r == "function" && At(
|
|
2035
|
-
}, t.removeHook = function(
|
|
2035
|
+
wt = null, de = !1;
|
|
2036
|
+
}, t.isValidAttribute = function(B, r, m) {
|
|
2037
|
+
wt || wn({});
|
|
2038
|
+
const I = me(B), ne = me(r);
|
|
2039
|
+
return ss(I, ne, m);
|
|
2040
|
+
}, t.addHook = function(B, r) {
|
|
2041
|
+
typeof r == "function" && At(ce[B], r);
|
|
2042
|
+
}, t.removeHook = function(B, r) {
|
|
2036
2043
|
if (r !== void 0) {
|
|
2037
|
-
const m = pi(
|
|
2038
|
-
return m === -1 ? void 0 : fi(
|
|
2044
|
+
const m = pi(ce[B], r);
|
|
2045
|
+
return m === -1 ? void 0 : fi(ce[B], m, 1)[0];
|
|
2039
2046
|
}
|
|
2040
|
-
return
|
|
2041
|
-
}, t.removeHooks = function(
|
|
2042
|
-
|
|
2047
|
+
return vs(ce[B]);
|
|
2048
|
+
}, t.removeHooks = function(B) {
|
|
2049
|
+
ce[B] = [];
|
|
2043
2050
|
}, t.removeAllHooks = function() {
|
|
2044
|
-
|
|
2051
|
+
ce = _s();
|
|
2045
2052
|
}, t;
|
|
2046
2053
|
}
|
|
2047
|
-
u(
|
|
2048
|
-
var Oi =
|
|
2049
|
-
function
|
|
2054
|
+
u(Vs, "createDOMPurify");
|
|
2055
|
+
var Oi = Vs();
|
|
2056
|
+
function Pn() {
|
|
2050
2057
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
2051
2058
|
}
|
|
2052
|
-
u(
|
|
2053
|
-
var
|
|
2054
|
-
function
|
|
2055
|
-
|
|
2059
|
+
u(Pn, "M");
|
|
2060
|
+
var vt = Pn();
|
|
2061
|
+
function qs(a) {
|
|
2062
|
+
vt = a;
|
|
2056
2063
|
}
|
|
2057
|
-
u(
|
|
2064
|
+
u(qs, "N");
|
|
2058
2065
|
var ft = { exec: /* @__PURE__ */ u(() => null, "exec") };
|
|
2059
2066
|
function _t(a) {
|
|
2060
2067
|
let t = [];
|
|
@@ -2064,30 +2071,30 @@ function _t(a) {
|
|
|
2064
2071
|
};
|
|
2065
2072
|
}
|
|
2066
2073
|
u(_t, "E");
|
|
2067
|
-
function
|
|
2074
|
+
function J(a, t = "") {
|
|
2068
2075
|
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ u((i, s) => {
|
|
2069
2076
|
let l = typeof s == "string" ? s : s.source;
|
|
2070
2077
|
return l = l.replace(Ae.caret, "$1"), e = e.replace(i, l), n;
|
|
2071
2078
|
}, "replace"), getRegex: /* @__PURE__ */ u(() => new RegExp(e, t), "getRegex") };
|
|
2072
2079
|
return n;
|
|
2073
2080
|
}
|
|
2074
|
-
u(
|
|
2081
|
+
u(J, "d");
|
|
2075
2082
|
var zi = ((a = "") => {
|
|
2076
2083
|
try {
|
|
2077
2084
|
return !!new RegExp("(?<=1)(?<!1)" + a);
|
|
2078
2085
|
} catch {
|
|
2079
2086
|
return !1;
|
|
2080
2087
|
}
|
|
2081
|
-
})(), Ae = { 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__ */ u((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: _t((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: _t((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: _t((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: _t((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: _t((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: _t((a) => new RegExp(`^ {0,${a}}>`)) }, Ni = /^(?:[ \t]*(?:\n|$))+/, Pi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,
|
|
2082
|
-
]`).replace("lheading",
|
|
2088
|
+
})(), Ae = { 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__ */ u((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: _t((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: _t((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: _t((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: _t((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: _t((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: _t((a) => new RegExp(`^ {0,${a}}>`)) }, Ni = /^(?:[ \t]*(?:\n|$))+/, Pi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Fi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Xt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Bi = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Fn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ks = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ys = J(Ks).replace(/bull/g, Fn).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(), Ui = J(Ks).replace(/bull/g, Fn).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(), Bn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Hi = /^[^\n]+/, Un = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ji = J(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Un).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Wi = J(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Fn).getRegex(), mn = "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", Hn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Gi = J("^ {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", Hn).replace("tag", mn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Xs = J(Bn).replace("hr", Xt).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", mn).getRegex(), Vi = J(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Xs).getRegex(), jn = { blockquote: Vi, code: Pi, def: ji, fences: Fi, heading: Bi, hr: Xt, html: Gi, lheading: Ys, list: Wi, newline: Ni, paragraph: Xs, table: ft, text: Hi }, Rs = J("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Xt).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", mn).getRegex(), qi = { ...jn, lheading: Ui, table: Rs, paragraph: J(Bn).replace("hr", Xt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Rs).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", mn).getRegex() }, Ki = { ...jn, html: J(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Hn).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: ft, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: J(Bn).replace("hr", Xt).replace("heading", ` *#{1,6} *[^
|
|
2089
|
+
]`).replace("lheading", Ys).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Yi = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Xi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Zs = /^( {2,}|\\)\n(?!\s*$)/, Zi = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Nt = /[\p{P}\p{S}]/u, gn = /[\s\p{P}\p{S}]/u, Wn = /[^\s\p{P}\p{S}]/u, Ji = J(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, gn).getRegex(), Js = /(?!~)[\p{P}\p{S}]/u, Qi = /(?!~)[\s\p{P}\p{S}]/u, er = /(?:[^\s\p{P}\p{S}]|~)/u, tr = J(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", zi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Qs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, nr = J(Qs, "u").replace(/punct/g, Nt).getRegex(), sr = J(Qs, "u").replace(/punct/g, Js).getRegex(), ea = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ar = J(ea, "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, gn).replace(/punct/g, Nt).getRegex(), ir = J(ea, "gu").replace(/notPunctSpace/g, er).replace(/punctSpace/g, Qi).replace(/punct/g, Js).getRegex(), rr = J("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, gn).replace(/punct/g, Nt).getRegex(), lr = J(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Nt).getRegex(), or = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", cr = J(or, "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, gn).replace(/punct/g, Nt).getRegex(), ur = J(/\\(punct)/, "gu").replace(/punct/g, Nt).getRegex(), dr = J(/^<(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(), hr = J(Hn).replace("(?:-->|$)", "-->").getRegex(), pr = J("^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", hr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), dn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, fr = J(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", dn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ta = J(/^!?\[(label)\]\[(ref)\]/).replace("label", dn).replace("ref", Un).getRegex(), na = J(/^!?\[(ref)\](?:\[\])?/).replace("ref", Un).getRegex(), mr = J("reflink|nolink(?!\\()", "g").replace("reflink", ta).replace("nolink", na).getRegex(), Cs = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Gn = { _backpedal: ft, anyPunctuation: ur, autolink: dr, blockSkip: tr, br: Zs, code: Xi, del: ft, delLDelim: ft, delRDelim: ft, emStrongLDelim: nr, emStrongRDelimAst: ar, emStrongRDelimUnd: rr, escape: Yi, link: fr, nolink: na, punctuation: Ji, reflink: ta, reflinkSearch: mr, tag: pr, text: Zi, url: ft }, gr = { ...Gn, link: J(/^!?\[(label)\]\((.*?)\)/).replace("label", dn).getRegex(), reflink: J(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", dn).getRegex() }, zn = { ...Gn, emStrongRDelimAst: ir, emStrongLDelim: sr, delLDelim: lr, delRDelim: cr, url: J(/^((?: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: J(/^([`~]+|[^`~])(?:(?= {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() }, vr = { ...zn, br: J(Zs).replace("{2,}", "*").getRegex(), text: J(zn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, rn = { normal: jn, gfm: qi, pedantic: Ki }, jt = { normal: Gn, gfm: zn, breaks: vr, pedantic: gr }, xr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Ms = /* @__PURE__ */ u((a) => xr[a], "ge");
|
|
2083
2090
|
function et(a, t) {
|
|
2084
2091
|
if (t) {
|
|
2085
|
-
if (Ae.escapeTest.test(a)) return a.replace(Ae.escapeReplace,
|
|
2086
|
-
} else if (Ae.escapeTestNoEncode.test(a)) return a.replace(Ae.escapeReplaceNoEncode,
|
|
2092
|
+
if (Ae.escapeTest.test(a)) return a.replace(Ae.escapeReplace, Ms);
|
|
2093
|
+
} else if (Ae.escapeTestNoEncode.test(a)) return a.replace(Ae.escapeReplaceNoEncode, Ms);
|
|
2087
2094
|
return a;
|
|
2088
2095
|
}
|
|
2089
2096
|
u(et, "O");
|
|
2090
|
-
function
|
|
2097
|
+
function Is(a) {
|
|
2091
2098
|
try {
|
|
2092
2099
|
a = encodeURI(a).replace(Ae.percentDecode, "%");
|
|
2093
2100
|
} catch {
|
|
@@ -2095,8 +2102,8 @@ function $s(a) {
|
|
|
2095
2102
|
}
|
|
2096
2103
|
return a;
|
|
2097
2104
|
}
|
|
2098
|
-
u(
|
|
2099
|
-
function
|
|
2105
|
+
u(Is, "V");
|
|
2106
|
+
function $s(a, t) {
|
|
2100
2107
|
let e = a.replace(Ae.findPipe, (s, l, o) => {
|
|
2101
2108
|
let p = !1, d = l;
|
|
2102
2109
|
for (; --d >= 0 && o[d] === "\\"; ) p = !p;
|
|
@@ -2107,7 +2114,7 @@ function Ds(a, t) {
|
|
|
2107
2114
|
for (; i < n.length; i++) n[i] = n[i].trim().replace(Ae.slashPipe, "|");
|
|
2108
2115
|
return n;
|
|
2109
2116
|
}
|
|
2110
|
-
u(
|
|
2117
|
+
u($s, "Y");
|
|
2111
2118
|
function lt(a, t, e) {
|
|
2112
2119
|
let n = a.length;
|
|
2113
2120
|
if (n === 0) return "";
|
|
@@ -2117,14 +2124,14 @@ function lt(a, t, e) {
|
|
|
2117
2124
|
return a.slice(0, n - i);
|
|
2118
2125
|
}
|
|
2119
2126
|
u(lt, "$");
|
|
2120
|
-
function
|
|
2127
|
+
function Ds(a) {
|
|
2121
2128
|
let t = a.split(`
|
|
2122
2129
|
`), e = t.length - 1;
|
|
2123
2130
|
for (; e >= 0 && Ae.blankLine.test(t[e]); ) e--;
|
|
2124
2131
|
return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
|
|
2125
2132
|
`);
|
|
2126
2133
|
}
|
|
2127
|
-
u(
|
|
2134
|
+
u(Ds, "ee");
|
|
2128
2135
|
function br(a, t) {
|
|
2129
2136
|
if (a.indexOf(t[1]) === -1) return -1;
|
|
2130
2137
|
let e = 0;
|
|
@@ -2143,13 +2150,13 @@ function yr(a, t = 0) {
|
|
|
2143
2150
|
return n;
|
|
2144
2151
|
}
|
|
2145
2152
|
u(yr, "me");
|
|
2146
|
-
function
|
|
2153
|
+
function Ls(a, t, e, n, i) {
|
|
2147
2154
|
let s = t.href, l = t.title || null, o = a[1].replace(i.other.outputLinkReplace, "$1");
|
|
2148
2155
|
n.state.inLink = !0;
|
|
2149
2156
|
let p = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
|
|
2150
2157
|
return n.state.inLink = !1, p;
|
|
2151
2158
|
}
|
|
2152
|
-
u(
|
|
2159
|
+
u(Ls, "xe");
|
|
2153
2160
|
function kr(a, t, e) {
|
|
2154
2161
|
let n = a.match(e.other.indentCodeCompensation);
|
|
2155
2162
|
if (n === null) return t;
|
|
@@ -2166,10 +2173,10 @@ function kr(a, t, e) {
|
|
|
2166
2173
|
u(kr, "st");
|
|
2167
2174
|
var Dt, hn = (Dt = class {
|
|
2168
2175
|
constructor(t) {
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
this.options = t ||
|
|
2176
|
+
P(this, "options");
|
|
2177
|
+
P(this, "rules");
|
|
2178
|
+
P(this, "lexer");
|
|
2179
|
+
this.options = t || vt;
|
|
2173
2180
|
}
|
|
2174
2181
|
space(t) {
|
|
2175
2182
|
let e = this.rules.block.newline.exec(t);
|
|
@@ -2178,7 +2185,7 @@ var Dt, hn = (Dt = class {
|
|
|
2178
2185
|
code(t) {
|
|
2179
2186
|
let e = this.rules.block.code.exec(t);
|
|
2180
2187
|
if (e) {
|
|
2181
|
-
let n = this.options.pedantic ? e[0] :
|
|
2188
|
+
let n = this.options.pedantic ? e[0] : Ds(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
2182
2189
|
return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
|
|
2183
2190
|
}
|
|
2184
2191
|
}
|
|
@@ -2219,26 +2226,26 @@ var Dt, hn = (Dt = class {
|
|
|
2219
2226
|
else break;
|
|
2220
2227
|
n = n.slice(d);
|
|
2221
2228
|
let k = p.join(`
|
|
2222
|
-
`),
|
|
2229
|
+
`), A = k.replace(this.rules.other.blockquoteSetextReplace, `
|
|
2223
2230
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
2224
2231
|
i = i ? `${i}
|
|
2225
2232
|
${k}` : k, s = s ? `${s}
|
|
2226
|
-
${
|
|
2233
|
+
${A}` : A;
|
|
2227
2234
|
let x = this.lexer.state.top;
|
|
2228
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(
|
|
2235
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(A, l, !0), this.lexer.state.top = x, n.length === 0) break;
|
|
2229
2236
|
let w = l.at(-1);
|
|
2230
2237
|
if (w?.type === "code") break;
|
|
2231
2238
|
if (w?.type === "blockquote") {
|
|
2232
|
-
let
|
|
2239
|
+
let C = w, E = C.raw + `
|
|
2233
2240
|
` + n.join(`
|
|
2234
|
-
`),
|
|
2235
|
-
l[l.length - 1] =
|
|
2241
|
+
`), $ = this.blockquote(E);
|
|
2242
|
+
l[l.length - 1] = $, i = i.substring(0, i.length - C.raw.length) + $.raw, s = s.substring(0, s.length - C.text.length) + $.text;
|
|
2236
2243
|
break;
|
|
2237
2244
|
} else if (w?.type === "list") {
|
|
2238
|
-
let
|
|
2245
|
+
let C = w, E = C.raw + `
|
|
2239
2246
|
` + n.join(`
|
|
2240
|
-
`),
|
|
2241
|
-
l[l.length - 1] =
|
|
2247
|
+
`), $ = this.list(E);
|
|
2248
|
+
l[l.length - 1] = $, i = i.substring(0, i.length - w.raw.length) + $.raw, s = s.substring(0, s.length - C.raw.length) + $.raw, n = E.substring(l.at(-1).raw.length).split(`
|
|
2242
2249
|
`);
|
|
2243
2250
|
continue;
|
|
2244
2251
|
}
|
|
@@ -2253,31 +2260,31 @@ ${E}` : E;
|
|
|
2253
2260
|
n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
|
|
2254
2261
|
let l = this.rules.other.listItemRegex(n), o = !1;
|
|
2255
2262
|
for (; t; ) {
|
|
2256
|
-
let d = !1, k = "",
|
|
2263
|
+
let d = !1, k = "", A = "";
|
|
2257
2264
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
2258
2265
|
k = e[0], t = t.substring(k.length);
|
|
2259
2266
|
let x = yr(e[2].split(`
|
|
2260
2267
|
`, 1)[0], e[1].length), w = t.split(`
|
|
2261
|
-
`, 1)[0],
|
|
2262
|
-
if (this.options.pedantic ? (
|
|
2268
|
+
`, 1)[0], C = !x.trim(), E = 0;
|
|
2269
|
+
if (this.options.pedantic ? (E = 2, A = x.trimStart()) : C ? E = e[1].length + 1 : (E = x.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, A = x.slice(E), E += e[1].length), C && this.rules.other.blankLine.test(w) && (k += w + `
|
|
2263
2270
|
`, t = t.substring(w.length + 1), d = !0), !d) {
|
|
2264
|
-
let
|
|
2271
|
+
let $ = this.rules.other.nextBulletRegex(E), Q = this.rules.other.hrRegex(E), D = this.rules.other.fencesBeginRegex(E), N = this.rules.other.headingBeginRegex(E), z = this.rules.other.htmlBeginRegex(E), F = this.rules.other.blockquoteBeginRegex(E);
|
|
2265
2272
|
for (; t; ) {
|
|
2266
2273
|
let H = t.split(`
|
|
2267
|
-
`, 1)[0],
|
|
2268
|
-
if (w = H, this.options.pedantic ? (w = w.replace(this.rules.other.listReplaceNesting, " "),
|
|
2269
|
-
if (
|
|
2270
|
-
` +
|
|
2274
|
+
`, 1)[0], j;
|
|
2275
|
+
if (w = H, this.options.pedantic ? (w = w.replace(this.rules.other.listReplaceNesting, " "), j = w) : j = w.replace(this.rules.other.tabCharGlobal, " "), D.test(w) || N.test(w) || z.test(w) || F.test(w) || $.test(w) || Q.test(w)) break;
|
|
2276
|
+
if (j.search(this.rules.other.nonSpaceChar) >= E || !w.trim()) A += `
|
|
2277
|
+
` + j.slice(E);
|
|
2271
2278
|
else {
|
|
2272
|
-
if (
|
|
2273
|
-
|
|
2279
|
+
if (C || x.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || D.test(x) || N.test(x) || Q.test(x)) break;
|
|
2280
|
+
A += `
|
|
2274
2281
|
` + w;
|
|
2275
2282
|
}
|
|
2276
|
-
|
|
2277
|
-
`, t = t.substring(H.length + 1), x =
|
|
2283
|
+
C = !w.trim(), k += H + `
|
|
2284
|
+
`, t = t.substring(H.length + 1), x = j.slice(E);
|
|
2278
2285
|
}
|
|
2279
2286
|
}
|
|
2280
|
-
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(k) && (o = !0)), s.items.push({ type: "list_item", raw: k, task: !!this.options.gfm && this.rules.other.listIsTask.test(
|
|
2287
|
+
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(k) && (o = !0)), s.items.push({ type: "list_item", raw: k, task: !!this.options.gfm && this.rules.other.listIsTask.test(A), loose: !1, text: A, tokens: [] }), s.raw += k;
|
|
2281
2288
|
}
|
|
2282
2289
|
let p = s.items.at(-1);
|
|
2283
2290
|
if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
|
|
@@ -2292,14 +2299,14 @@ ${E}` : E;
|
|
|
2292
2299
|
this.lexer.inlineQueue[x].src = this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask, "");
|
|
2293
2300
|
break;
|
|
2294
2301
|
}
|
|
2295
|
-
let
|
|
2296
|
-
if (
|
|
2297
|
-
let x = { type: "checkbox", raw:
|
|
2302
|
+
let A = this.rules.other.listTaskCheckbox.exec(d.raw);
|
|
2303
|
+
if (A) {
|
|
2304
|
+
let x = { type: "checkbox", raw: A[0] + " ", checked: A[0] !== "[ ]" };
|
|
2298
2305
|
d.checked = x.checked, s.loose ? d.tokens[0] && ["paragraph", "text"].includes(d.tokens[0].type) && "tokens" in d.tokens[0] && d.tokens[0].tokens ? (d.tokens[0].raw = x.raw + d.tokens[0].raw, d.tokens[0].text = x.raw + d.tokens[0].text, d.tokens[0].tokens.unshift(x)) : d.tokens.unshift({ type: "paragraph", raw: x.raw, text: x.raw, tokens: [x] }) : d.tokens.unshift(x);
|
|
2299
2306
|
}
|
|
2300
2307
|
} else d.task && (d.task = !1);
|
|
2301
2308
|
if (!s.loose) {
|
|
2302
|
-
let
|
|
2309
|
+
let A = d.tokens.filter((w) => w.type === "space"), x = A.length > 0 && A.some((w) => this.rules.other.anyLine.test(w.raw));
|
|
2303
2310
|
s.loose = x;
|
|
2304
2311
|
}
|
|
2305
2312
|
}
|
|
@@ -2313,7 +2320,7 @@ ${E}` : E;
|
|
|
2313
2320
|
html(t) {
|
|
2314
2321
|
let e = this.rules.block.html.exec(t);
|
|
2315
2322
|
if (e) {
|
|
2316
|
-
let n =
|
|
2323
|
+
let n = Ds(e[0]);
|
|
2317
2324
|
return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
|
|
2318
2325
|
}
|
|
2319
2326
|
}
|
|
@@ -2328,13 +2335,13 @@ ${E}` : E;
|
|
|
2328
2335
|
table(t) {
|
|
2329
2336
|
let e = this.rules.block.table.exec(t);
|
|
2330
2337
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
2331
|
-
let n =
|
|
2338
|
+
let n = $s(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
2332
2339
|
`) : [], l = { type: "table", raw: lt(e[0], `
|
|
2333
2340
|
`), header: [], align: [], rows: [] };
|
|
2334
2341
|
if (n.length === i.length) {
|
|
2335
2342
|
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);
|
|
2336
2343
|
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] });
|
|
2337
|
-
for (let o of s) l.rows.push(
|
|
2344
|
+
for (let o of s) l.rows.push($s(o, l.header.length).map((p, d) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[d] })));
|
|
2338
2345
|
return l;
|
|
2339
2346
|
}
|
|
2340
2347
|
}
|
|
@@ -2387,7 +2394,7 @@ ${E}` : E;
|
|
|
2387
2394
|
let l = this.rules.other.pedanticHrefTitle.exec(i);
|
|
2388
2395
|
l && (i = l[1], s = l[3]);
|
|
2389
2396
|
} else s = e[3] ? e[3].slice(1, -1) : "";
|
|
2390
|
-
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)),
|
|
2397
|
+
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)), Ls(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);
|
|
2391
2398
|
}
|
|
2392
2399
|
}
|
|
2393
2400
|
reflink(t, e) {
|
|
@@ -2398,7 +2405,7 @@ ${E}` : E;
|
|
|
2398
2405
|
let l = n[0].charAt(0);
|
|
2399
2406
|
return { type: "text", raw: l, text: l };
|
|
2400
2407
|
}
|
|
2401
|
-
return
|
|
2408
|
+
return Ls(n, s, n[0], this.lexer, this.rules);
|
|
2402
2409
|
}
|
|
2403
2410
|
}
|
|
2404
2411
|
emStrong(t, e, n = "") {
|
|
@@ -2416,10 +2423,10 @@ ${E}` : E;
|
|
|
2416
2423
|
}
|
|
2417
2424
|
if (p -= o, p > 0) continue;
|
|
2418
2425
|
o = Math.min(o, o + p + d);
|
|
2419
|
-
let
|
|
2426
|
+
let A = [...i[0]][0].length, x = t.slice(0, s + i.index + A + o);
|
|
2420
2427
|
if (Math.min(s, o) % 2) {
|
|
2421
|
-
let
|
|
2422
|
-
return { type: "em", raw: x, text:
|
|
2428
|
+
let C = x.slice(1, -1);
|
|
2429
|
+
return { type: "em", raw: x, text: C, tokens: this.lexer.inlineTokens(C) };
|
|
2423
2430
|
}
|
|
2424
2431
|
let w = x.slice(2, -2);
|
|
2425
2432
|
return { type: "strong", raw: x, text: w, tokens: this.lexer.inlineTokens(w) };
|
|
@@ -2449,8 +2456,8 @@ ${E}` : E;
|
|
|
2449
2456
|
}
|
|
2450
2457
|
if (p -= o, p > 0) continue;
|
|
2451
2458
|
o = Math.min(o, o + p);
|
|
2452
|
-
let k = [...i[0]][0].length,
|
|
2453
|
-
return { type: "del", raw:
|
|
2459
|
+
let k = [...i[0]][0].length, A = t.slice(0, s + i.index + k + o), x = A.slice(s, -s);
|
|
2460
|
+
return { type: "del", raw: A, text: x, tokens: this.lexer.inlineTokens(x) };
|
|
2454
2461
|
}
|
|
2455
2462
|
}
|
|
2456
2463
|
}
|
|
@@ -2483,14 +2490,14 @@ ${E}` : E;
|
|
|
2483
2490
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
2484
2491
|
}
|
|
2485
2492
|
}
|
|
2486
|
-
}, u(Dt, "w"), Dt),
|
|
2493
|
+
}, u(Dt, "w"), Dt), ut, Ue = (ut = class {
|
|
2487
2494
|
constructor(t) {
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t ||
|
|
2495
|
+
P(this, "tokens");
|
|
2496
|
+
P(this, "options");
|
|
2497
|
+
P(this, "state");
|
|
2498
|
+
P(this, "inlineQueue");
|
|
2499
|
+
P(this, "tokenizer");
|
|
2500
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || vt, this.options.tokenizer = this.options.tokenizer || new hn(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
2494
2501
|
let e = { other: Ae, block: rn.normal, inline: jt.normal };
|
|
2495
2502
|
this.options.pedantic ? (e.block = rn.pedantic, e.inline = jt.pedantic) : this.options.gfm && (e.block = rn.gfm, this.options.breaks ? e.inline = jt.breaks : e.inline = jt.gfm), this.tokenizer.rules = e;
|
|
2496
2503
|
}
|
|
@@ -2498,10 +2505,10 @@ ${E}` : E;
|
|
|
2498
2505
|
return { block: rn, inline: jt };
|
|
2499
2506
|
}
|
|
2500
2507
|
static lex(t, e) {
|
|
2501
|
-
return new
|
|
2508
|
+
return new ut(e).lex(t);
|
|
2502
2509
|
}
|
|
2503
2510
|
static lexInline(t, e) {
|
|
2504
|
-
return new
|
|
2511
|
+
return new ut(e).inlineTokens(t);
|
|
2505
2512
|
}
|
|
2506
2513
|
lex(t) {
|
|
2507
2514
|
t = t.replace(Ae.carriageReturn, `
|
|
@@ -2634,7 +2641,7 @@ ${E}` : E;
|
|
|
2634
2641
|
}
|
|
2635
2642
|
l || (o = ""), l = !1;
|
|
2636
2643
|
let d;
|
|
2637
|
-
if (this.options.extensions?.inline?.some((
|
|
2644
|
+
if (this.options.extensions?.inline?.some((A) => (d = A.call({ lexer: this }, t, e)) ? (t = t.substring(d.raw.length), e.push(d), !0) : !1)) continue;
|
|
2638
2645
|
if (d = this.tokenizer.escape(t)) {
|
|
2639
2646
|
t = t.substring(d.raw.length), e.push(d);
|
|
2640
2647
|
continue;
|
|
@@ -2649,8 +2656,8 @@ ${E}` : E;
|
|
|
2649
2656
|
}
|
|
2650
2657
|
if (d = this.tokenizer.reflink(t, this.tokens.links)) {
|
|
2651
2658
|
t = t.substring(d.raw.length);
|
|
2652
|
-
let
|
|
2653
|
-
d.type === "text" &&
|
|
2659
|
+
let A = e.at(-1);
|
|
2660
|
+
d.type === "text" && A?.type === "text" ? (A.raw += d.raw, A.text += d.text) : e.push(d);
|
|
2654
2661
|
continue;
|
|
2655
2662
|
}
|
|
2656
2663
|
if (d = this.tokenizer.emStrong(t, n, o)) {
|
|
@@ -2679,15 +2686,15 @@ ${E}` : E;
|
|
|
2679
2686
|
}
|
|
2680
2687
|
let k = t;
|
|
2681
2688
|
if (this.options.extensions?.startInline) {
|
|
2682
|
-
let
|
|
2683
|
-
this.options.extensions.startInline.forEach((
|
|
2684
|
-
w =
|
|
2685
|
-
}),
|
|
2689
|
+
let A = 1 / 0, x = t.slice(1), w;
|
|
2690
|
+
this.options.extensions.startInline.forEach((C) => {
|
|
2691
|
+
w = C.call({ lexer: this }, x), typeof w == "number" && w >= 0 && (A = Math.min(A, w));
|
|
2692
|
+
}), A < 1 / 0 && A >= 0 && (k = t.substring(0, A + 1));
|
|
2686
2693
|
}
|
|
2687
2694
|
if (d = this.tokenizer.inlineText(k)) {
|
|
2688
2695
|
t = t.substring(d.raw.length), d.raw.slice(-1) !== "_" && (o = d.raw.slice(-1)), l = !0;
|
|
2689
|
-
let
|
|
2690
|
-
|
|
2696
|
+
let A = e.at(-1);
|
|
2697
|
+
A?.type === "text" ? (A.raw += d.raw, A.text += d.text) : e.push(d);
|
|
2691
2698
|
continue;
|
|
2692
2699
|
}
|
|
2693
2700
|
if (t) {
|
|
@@ -2702,11 +2709,11 @@ ${E}` : E;
|
|
|
2702
2709
|
if (this.options.silent) console.error(e);
|
|
2703
2710
|
else throw new Error(e);
|
|
2704
2711
|
}
|
|
2705
|
-
}, u(
|
|
2712
|
+
}, u(ut, "l"), ut), Lt, pn = (Lt = class {
|
|
2706
2713
|
constructor(t) {
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
this.options = t ||
|
|
2714
|
+
P(this, "options");
|
|
2715
|
+
P(this, "parser");
|
|
2716
|
+
this.options = t || vt;
|
|
2710
2717
|
}
|
|
2711
2718
|
space(t) {
|
|
2712
2719
|
return "";
|
|
@@ -2802,7 +2809,7 @@ ${t}</tr>
|
|
|
2802
2809
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
2803
2810
|
}
|
|
2804
2811
|
link({ href: t, title: e, tokens: n }) {
|
|
2805
|
-
let i = this.parser.parseInline(n), s =
|
|
2812
|
+
let i = this.parser.parseInline(n), s = Is(t);
|
|
2806
2813
|
if (s === null) return i;
|
|
2807
2814
|
t = s;
|
|
2808
2815
|
let l = '<a href="' + t + '"';
|
|
@@ -2810,7 +2817,7 @@ ${t}</tr>
|
|
|
2810
2817
|
}
|
|
2811
2818
|
image({ href: t, title: e, text: n, tokens: i }) {
|
|
2812
2819
|
i && (n = this.parser.parseInline(i, this.parser.textRenderer));
|
|
2813
|
-
let s =
|
|
2820
|
+
let s = Is(t);
|
|
2814
2821
|
if (s === null) return et(n);
|
|
2815
2822
|
t = s;
|
|
2816
2823
|
let l = `<img src="${t}" alt="${et(n)}"`;
|
|
@@ -2819,7 +2826,7 @@ ${t}</tr>
|
|
|
2819
2826
|
text(t) {
|
|
2820
2827
|
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : et(t.text);
|
|
2821
2828
|
}
|
|
2822
|
-
}, u(Lt, "y"), Lt), Ot,
|
|
2829
|
+
}, u(Lt, "y"), Lt), Ot, Vn = (Ot = class {
|
|
2823
2830
|
strong({ text: t }) {
|
|
2824
2831
|
return t;
|
|
2825
2832
|
}
|
|
@@ -2850,18 +2857,18 @@ ${t}</tr>
|
|
|
2850
2857
|
checkbox({ raw: t }) {
|
|
2851
2858
|
return t;
|
|
2852
2859
|
}
|
|
2853
|
-
}, u(Ot, "L"), Ot),
|
|
2860
|
+
}, u(Ot, "L"), Ot), dt, He = (dt = class {
|
|
2854
2861
|
constructor(t) {
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
this.options = t ||
|
|
2862
|
+
P(this, "options");
|
|
2863
|
+
P(this, "renderer");
|
|
2864
|
+
P(this, "textRenderer");
|
|
2865
|
+
this.options = t || vt, this.options.renderer = this.options.renderer || new pn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Vn();
|
|
2859
2866
|
}
|
|
2860
2867
|
static parse(t, e) {
|
|
2861
|
-
return new
|
|
2868
|
+
return new dt(e).parse(t);
|
|
2862
2869
|
}
|
|
2863
2870
|
static parseInline(t, e) {
|
|
2864
|
-
return new
|
|
2871
|
+
return new dt(e).parseInline(t);
|
|
2865
2872
|
}
|
|
2866
2873
|
parse(t) {
|
|
2867
2874
|
this.renderer.parser = this;
|
|
@@ -3001,11 +3008,11 @@ ${t}</tr>
|
|
|
3001
3008
|
}
|
|
3002
3009
|
return n;
|
|
3003
3010
|
}
|
|
3004
|
-
}, u(
|
|
3011
|
+
}, u(dt, "l"), dt), ct, qt = (ct = class {
|
|
3005
3012
|
constructor(t) {
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
this.options = t ||
|
|
3013
|
+
P(this, "options");
|
|
3014
|
+
P(this, "block");
|
|
3015
|
+
this.options = t || vt;
|
|
3009
3016
|
}
|
|
3010
3017
|
preprocess(t) {
|
|
3011
3018
|
return t;
|
|
@@ -3025,18 +3032,18 @@ ${t}</tr>
|
|
|
3025
3032
|
provideParser(t = this.block) {
|
|
3026
3033
|
return t ? He.parse : He.parseInline;
|
|
3027
3034
|
}
|
|
3028
|
-
}, u(ct, "P"),
|
|
3035
|
+
}, u(ct, "P"), P(ct, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), P(ct, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), ct), zt, wr = (zt = class {
|
|
3029
3036
|
constructor(...t) {
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3037
|
+
P(this, "defaults", Pn());
|
|
3038
|
+
P(this, "options", this.setOptions);
|
|
3039
|
+
P(this, "parse", this.parseMarkdown(!0));
|
|
3040
|
+
P(this, "parseInline", this.parseMarkdown(!1));
|
|
3041
|
+
P(this, "Parser", He);
|
|
3042
|
+
P(this, "Renderer", pn);
|
|
3043
|
+
P(this, "TextRenderer", Vn);
|
|
3044
|
+
P(this, "Lexer", Ue);
|
|
3045
|
+
P(this, "Tokenizer", hn);
|
|
3046
|
+
P(this, "Hooks", qt);
|
|
3040
3047
|
this.use(...t);
|
|
3041
3048
|
}
|
|
3042
3049
|
walkTokens(t, e) {
|
|
@@ -3089,8 +3096,8 @@ ${t}</tr>
|
|
|
3089
3096
|
if (["options", "parser"].includes(l)) continue;
|
|
3090
3097
|
let o = l, p = n.renderer[o], d = s[o];
|
|
3091
3098
|
s[o] = (...k) => {
|
|
3092
|
-
let
|
|
3093
|
-
return
|
|
3099
|
+
let A = p.apply(s, k);
|
|
3100
|
+
return A === !1 && (A = d.apply(s, k)), A || "";
|
|
3094
3101
|
};
|
|
3095
3102
|
}
|
|
3096
3103
|
i.renderer = s;
|
|
@@ -3102,8 +3109,8 @@ ${t}</tr>
|
|
|
3102
3109
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
3103
3110
|
let o = l, p = n.tokenizer[o], d = s[o];
|
|
3104
3111
|
s[o] = (...k) => {
|
|
3105
|
-
let
|
|
3106
|
-
return
|
|
3112
|
+
let A = p.apply(s, k);
|
|
3113
|
+
return A === !1 && (A = d.apply(s, k)), A;
|
|
3107
3114
|
};
|
|
3108
3115
|
}
|
|
3109
3116
|
i.tokenizer = s;
|
|
@@ -3119,15 +3126,15 @@ ${t}</tr>
|
|
|
3119
3126
|
let x = await p.call(s, k);
|
|
3120
3127
|
return d.call(s, x);
|
|
3121
3128
|
})();
|
|
3122
|
-
let
|
|
3123
|
-
return d.call(s,
|
|
3129
|
+
let A = p.call(s, k);
|
|
3130
|
+
return d.call(s, A);
|
|
3124
3131
|
} : s[o] = (...k) => {
|
|
3125
3132
|
if (this.defaults.async) return (async () => {
|
|
3126
3133
|
let x = await p.apply(s, k);
|
|
3127
3134
|
return x === !1 && (x = await d.apply(s, k)), x;
|
|
3128
3135
|
})();
|
|
3129
|
-
let
|
|
3130
|
-
return
|
|
3136
|
+
let A = p.apply(s, k);
|
|
3137
|
+
return A === !1 && (A = d.apply(s, k)), A;
|
|
3131
3138
|
};
|
|
3132
3139
|
}
|
|
3133
3140
|
i.hooks = s;
|
|
@@ -3185,27 +3192,27 @@ Please report this to https://github.com/markedjs/marked.`, t) {
|
|
|
3185
3192
|
throw n;
|
|
3186
3193
|
};
|
|
3187
3194
|
}
|
|
3188
|
-
}, u(zt, "q"), zt),
|
|
3195
|
+
}, u(zt, "q"), zt), gt = new wr();
|
|
3189
3196
|
function ee(a, t) {
|
|
3190
|
-
return
|
|
3197
|
+
return gt.parse(a, t);
|
|
3191
3198
|
}
|
|
3192
3199
|
u(ee, "g");
|
|
3193
3200
|
ee.options = ee.setOptions = function(a) {
|
|
3194
|
-
return
|
|
3201
|
+
return gt.setOptions(a), ee.defaults = gt.defaults, qs(ee.defaults), ee;
|
|
3195
3202
|
};
|
|
3196
|
-
ee.getDefaults =
|
|
3197
|
-
ee.defaults =
|
|
3203
|
+
ee.getDefaults = Pn;
|
|
3204
|
+
ee.defaults = vt;
|
|
3198
3205
|
ee.use = function(...a) {
|
|
3199
|
-
return
|
|
3206
|
+
return gt.use(...a), ee.defaults = gt.defaults, qs(ee.defaults), ee;
|
|
3200
3207
|
};
|
|
3201
3208
|
ee.walkTokens = function(a, t) {
|
|
3202
|
-
return
|
|
3209
|
+
return gt.walkTokens(a, t);
|
|
3203
3210
|
};
|
|
3204
|
-
ee.parseInline =
|
|
3211
|
+
ee.parseInline = gt.parseInline;
|
|
3205
3212
|
ee.Parser = He;
|
|
3206
3213
|
ee.parser = He.parse;
|
|
3207
3214
|
ee.Renderer = pn;
|
|
3208
|
-
ee.TextRenderer =
|
|
3215
|
+
ee.TextRenderer = Vn;
|
|
3209
3216
|
ee.Lexer = Ue;
|
|
3210
3217
|
ee.lexer = Ue.lex;
|
|
3211
3218
|
ee.Tokenizer = hn;
|
|
@@ -3255,48 +3262,48 @@ function Ar(a) {
|
|
|
3255
3262
|
}
|
|
3256
3263
|
const i = [...n.entries()].sort(([x], [w]) => x - w), s = Math.max(1, ...i.map(([, x]) => x.length)), l = Math.max(1, i.length), o = t === "horizontal" ? ot * 2 + l * Rt + (l - 1) * Wt : ot * 2 + s * Rt + (s - 1) * Wt, p = t === "horizontal" ? ot * 2 + s * Ct + (s - 1) * Gt : ot * 2 + l * Ct + (l - 1) * Gt, d = [];
|
|
3257
3264
|
for (const [x, [, w]] of i.entries()) {
|
|
3258
|
-
const
|
|
3259
|
-
for (const [
|
|
3260
|
-
const
|
|
3265
|
+
const C = (s - w.length) * (t === "horizontal" ? Ct + Gt : Rt + Wt) / 2;
|
|
3266
|
+
for (const [E, $] of w.entries()) {
|
|
3267
|
+
const Q = t === "horizontal" ? ot + x * (Rt + Wt) : ot + C + E * (Rt + Wt), D = t === "horizontal" ? ot + C + E * (Ct + Gt) : ot + x * (Ct + Gt);
|
|
3261
3268
|
d.push({
|
|
3262
|
-
id:
|
|
3263
|
-
label:
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
x:
|
|
3267
|
-
y:
|
|
3269
|
+
id: $.id,
|
|
3270
|
+
label: $.label,
|
|
3271
|
+
...$.detail ? { detail: $.detail } : {},
|
|
3272
|
+
...$.kind ? { kind: $.kind } : {},
|
|
3273
|
+
x: Q,
|
|
3274
|
+
y: D,
|
|
3268
3275
|
width: Rt,
|
|
3269
3276
|
height: Ct
|
|
3270
3277
|
});
|
|
3271
3278
|
}
|
|
3272
3279
|
}
|
|
3273
|
-
const k = new Map(d.map((x) => [x.id, x])),
|
|
3274
|
-
const
|
|
3275
|
-
if (!
|
|
3280
|
+
const k = new Map(d.map((x) => [x.id, x])), A = a.edges.flatMap((x, w) => {
|
|
3281
|
+
const C = k.get(x.from), E = k.get(x.to);
|
|
3282
|
+
if (!C || !E)
|
|
3276
3283
|
return [];
|
|
3277
|
-
const
|
|
3284
|
+
const $ = t === "horizontal" ? C.x + C.width : C.x + C.width / 2, Q = t === "horizontal" ? C.y + C.height / 2 : C.y + C.height, D = t === "horizontal" ? E.x : E.x + E.width / 2, N = t === "horizontal" ? E.y + E.height / 2 : E.y;
|
|
3278
3285
|
return [{
|
|
3279
3286
|
key: `${x.from}-${x.to}-${w}`,
|
|
3280
3287
|
from: x.from,
|
|
3281
3288
|
to: x.to,
|
|
3282
3289
|
...x.label ? { label: x.label } : {},
|
|
3283
|
-
x1:
|
|
3284
|
-
y1:
|
|
3285
|
-
x2:
|
|
3286
|
-
y2:
|
|
3287
|
-
labelX: (
|
|
3288
|
-
labelY: (
|
|
3290
|
+
x1: $,
|
|
3291
|
+
y1: Q,
|
|
3292
|
+
x2: D,
|
|
3293
|
+
y2: N,
|
|
3294
|
+
labelX: ($ + D) / 2,
|
|
3295
|
+
labelY: (Q + N) / 2
|
|
3289
3296
|
}];
|
|
3290
3297
|
});
|
|
3291
|
-
return { width: o, height: p, orientation: t, nodes: d, edges:
|
|
3298
|
+
return { width: o, height: p, orientation: t, nodes: d, edges: A };
|
|
3292
3299
|
}
|
|
3293
3300
|
u(Ar, "layoutChatDiagram");
|
|
3294
|
-
function
|
|
3301
|
+
function sa(a) {
|
|
3295
3302
|
const { value: t } = a, e = Math.abs(t);
|
|
3296
3303
|
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);
|
|
3297
3304
|
}
|
|
3298
|
-
u(
|
|
3299
|
-
function
|
|
3305
|
+
u(sa, "formatChatVisualValue");
|
|
3306
|
+
function aa(a) {
|
|
3300
3307
|
const { seconds: t } = a, e = Math.round(Math.abs(t)), n = t < 0 ? "-" : "";
|
|
3301
3308
|
if (e < 60)
|
|
3302
3309
|
return `${n}${e}s`;
|
|
@@ -3307,29 +3314,29 @@ function ia(a) {
|
|
|
3307
3314
|
const i = Math.floor(e / 3600), s = Math.floor(e % 3600 / 60);
|
|
3308
3315
|
return s ? `${n}${i}h ${s}m` : `${n}${i}h`;
|
|
3309
3316
|
}
|
|
3310
|
-
u(
|
|
3311
|
-
function
|
|
3317
|
+
u(aa, "formatChatVisualDuration");
|
|
3318
|
+
function ia(a) {
|
|
3312
3319
|
return {
|
|
3313
3320
|
prefix: a?.valuePrefix ?? (a?.valueFormat === "currency" ? "$" : ""),
|
|
3314
3321
|
suffix: a?.valueSuffix ?? (a?.valueFormat === "percent" ? "%" : "")
|
|
3315
3322
|
};
|
|
3316
3323
|
}
|
|
3317
|
-
u(
|
|
3324
|
+
u(ia, "affixes");
|
|
3318
3325
|
function In(a) {
|
|
3319
|
-
const { value: t, series: e } = a, { prefix: n, suffix: i } =
|
|
3326
|
+
const { value: t, series: e } = a, { prefix: n, suffix: i } = ia(e);
|
|
3320
3327
|
let s;
|
|
3321
3328
|
switch (e?.valueFormat) {
|
|
3322
3329
|
case "integer":
|
|
3323
3330
|
s = `${Math.round(t)}`;
|
|
3324
3331
|
break;
|
|
3325
3332
|
case "duration":
|
|
3326
|
-
s =
|
|
3333
|
+
s = aa({ seconds: t });
|
|
3327
3334
|
break;
|
|
3328
3335
|
case "raw":
|
|
3329
3336
|
s = Number.isInteger(t) ? `${t}` : t.toFixed(1);
|
|
3330
3337
|
break;
|
|
3331
3338
|
default:
|
|
3332
|
-
s =
|
|
3339
|
+
s = sa({ value: t });
|
|
3333
3340
|
}
|
|
3334
3341
|
return `${n}${s}${i}`;
|
|
3335
3342
|
}
|
|
@@ -3344,22 +3351,22 @@ u(Er, "resolveSharedSeriesFormat");
|
|
|
3344
3351
|
function _r(a) {
|
|
3345
3352
|
const { value: t, shared: e } = a;
|
|
3346
3353
|
if (e?.valueFormat === "duration")
|
|
3347
|
-
return
|
|
3348
|
-
const { prefix: n, suffix: i } =
|
|
3349
|
-
return `${n}${
|
|
3354
|
+
return aa({ seconds: t });
|
|
3355
|
+
const { prefix: n, suffix: i } = ia(e);
|
|
3356
|
+
return `${n}${sa({ value: t })}${i}`;
|
|
3350
3357
|
}
|
|
3351
3358
|
u(_r, "formatChatVisualTick");
|
|
3352
3359
|
const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagram-type", "aria-label"], Cr = { class: "mb-2.5" }, Mr = ["aria-label"], Ir = {
|
|
3353
3360
|
key: 0,
|
|
3354
3361
|
"data-test": "chat-visual-horizontal-bars",
|
|
3355
3362
|
class: "grid gap-3"
|
|
3356
|
-
}, $r = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Dr = ["viewBox"], Lr = ["x1", "x2", "y1", "y2"], Or = ["x", "y"], zr = ["data-row-index", "data-series-index", "data-data-key", "x", "y", "width", "height"], Nr = ["data-trend-key", "d"], Pr = ["d"],
|
|
3363
|
+
}, $r = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Dr = ["viewBox"], Lr = ["x1", "x2", "y1", "y2"], Or = ["x", "y"], zr = ["data-row-index", "data-series-index", "data-data-key", "x", "y", "width", "height"], Nr = ["data-trend-key", "d"], Pr = ["d"], Fr = ["cx", "cy"], Br = ["cx", "cy"], Ur = ["x", "y", "text-anchor"], Hr = {
|
|
3357
3364
|
key: 2,
|
|
3358
3365
|
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
3359
3366
|
}, jr = {
|
|
3360
3367
|
key: 1,
|
|
3361
3368
|
class: "grid gap-3"
|
|
3362
|
-
}, Wr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Gr = { class: "shrink-0 tabular-nums" }, Vr = { key: 2 }, qr = ["viewBox", "aria-label"], Kr = ["data-from", "data-to", "x1", "y1", "x2", "y2"], Yr = ["cx", "cy"], Xr = ["x", "y"], Zr = ["data-node-id", "data-node-kind", "transform"],
|
|
3369
|
+
}, Wr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Gr = { class: "shrink-0 tabular-nums" }, Vr = { key: 2 }, qr = ["viewBox", "aria-label"], Kr = ["data-from", "data-to", "x1", "y1", "x2", "y2"], Yr = ["cx", "cy"], Xr = ["x", "y"], Zr = ["data-node-id", "data-node-kind", "transform"], Jr = ["points"], Qr = ["width", "height"], el = ["width", "height"], tl = {
|
|
3363
3370
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3364
3371
|
class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
|
|
3365
3372
|
}, nl = /* @__PURE__ */ Me({
|
|
@@ -3378,146 +3385,146 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3378
3385
|
return g?.chartType === "pie";
|
|
3379
3386
|
}
|
|
3380
3387
|
u(l, "isPieChart");
|
|
3381
|
-
const o = T(() => n.value?.data ?? []), p = T(() => s(n.value) ? n.value : null), d = T(() => p.value?.series ?? []), k = T(() => l(n.value) ? n.value : null),
|
|
3388
|
+
const o = T(() => n.value?.data ?? []), p = T(() => s(n.value) ? n.value : null), d = T(() => p.value?.series ?? []), k = T(() => l(n.value) ? n.value : null), A = T(() => p.value?.chartType === "bar" && p.value.stacking === "stacked");
|
|
3382
3389
|
function x(g) {
|
|
3383
3390
|
return typeof g == "number" && Number.isFinite(g) ? g : null;
|
|
3384
3391
|
}
|
|
3385
3392
|
u(x, "numericValue");
|
|
3386
|
-
function w(g,
|
|
3387
|
-
return String(g[
|
|
3393
|
+
function w(g, S) {
|
|
3394
|
+
return String(g[S] ?? "").trim();
|
|
3388
3395
|
}
|
|
3389
3396
|
u(w, "categoryLabel");
|
|
3390
|
-
function
|
|
3391
|
-
const c = g.map((O) => w(O,
|
|
3397
|
+
function C(g, S) {
|
|
3398
|
+
const c = g.map((O) => w(O, S)).filter(Boolean);
|
|
3392
3399
|
if (!c.length)
|
|
3393
3400
|
return !1;
|
|
3394
|
-
const
|
|
3395
|
-
return
|
|
3401
|
+
const M = Math.max(...c.map((O) => O.length)), L = c.reduce((O, V) => O + V.length, 0) / c.length;
|
|
3402
|
+
return M >= 16 || c.length > 5 && L >= 10;
|
|
3396
3403
|
}
|
|
3397
|
-
u(
|
|
3398
|
-
function
|
|
3399
|
-
return g.data.map((c,
|
|
3400
|
-
const L = x(c[
|
|
3401
|
-
return L === null ? null : { index:
|
|
3404
|
+
u(C, "hasLongCategoryLabels");
|
|
3405
|
+
function E(g, S) {
|
|
3406
|
+
return g.data.map((c, M) => {
|
|
3407
|
+
const L = x(c[S]);
|
|
3408
|
+
return L === null ? null : { index: M, value: L };
|
|
3402
3409
|
}).filter((c) => c !== null);
|
|
3403
3410
|
}
|
|
3404
|
-
u(
|
|
3405
|
-
function
|
|
3411
|
+
u(E, "trendLinePoints");
|
|
3412
|
+
function $(g) {
|
|
3406
3413
|
if (g.length < 2) return null;
|
|
3407
|
-
const
|
|
3408
|
-
if (
|
|
3409
|
-
const
|
|
3410
|
-
return { slope:
|
|
3414
|
+
const S = g.length, c = g.reduce((de, fe) => de + fe.index, 0), M = g.reduce((de, fe) => de + fe.value, 0), L = g.reduce((de, fe) => de + fe.index * fe.index, 0), O = g.reduce((de, fe) => de + fe.index * fe.value, 0), V = S * L - c * c;
|
|
3415
|
+
if (V === 0) return null;
|
|
3416
|
+
const le = (S * O - c * M) / V, pe = (M - le * c) / S;
|
|
3417
|
+
return { slope: le, intercept: pe };
|
|
3411
3418
|
}
|
|
3412
|
-
u(
|
|
3413
|
-
const
|
|
3414
|
-
const g = [],
|
|
3415
|
-
if (!
|
|
3416
|
-
if (
|
|
3417
|
-
for (const c of
|
|
3418
|
-
let
|
|
3419
|
-
for (const O of
|
|
3420
|
-
const
|
|
3421
|
-
|
|
3419
|
+
u($, "linearTrend");
|
|
3420
|
+
const Q = T(() => {
|
|
3421
|
+
const g = [], S = p.value;
|
|
3422
|
+
if (!S) return g;
|
|
3423
|
+
if (S.chartType === "bar" && S.stacking === "stacked")
|
|
3424
|
+
for (const c of S.data) {
|
|
3425
|
+
let M = 0, L = 0;
|
|
3426
|
+
for (const O of S.series) {
|
|
3427
|
+
const V = x(c[O.dataKey]);
|
|
3428
|
+
V !== null && (V >= 0 ? M += V : L += V);
|
|
3422
3429
|
}
|
|
3423
|
-
g.push(
|
|
3430
|
+
g.push(M, L);
|
|
3424
3431
|
}
|
|
3425
3432
|
else
|
|
3426
|
-
for (const c of
|
|
3427
|
-
for (const
|
|
3428
|
-
const L = x(c[
|
|
3433
|
+
for (const c of S.data)
|
|
3434
|
+
for (const M of S.series) {
|
|
3435
|
+
const L = x(c[M.dataKey]);
|
|
3429
3436
|
L !== null && g.push(L);
|
|
3430
3437
|
}
|
|
3431
|
-
if (
|
|
3432
|
-
const c =
|
|
3438
|
+
if (S.trendLine && (S.chartType === "line" || S.chartType === "scatter")) {
|
|
3439
|
+
const c = E(S, S.trendLine.dataKey);
|
|
3433
3440
|
g.push(...c.map((L) => L.value));
|
|
3434
|
-
const
|
|
3435
|
-
if (
|
|
3441
|
+
const M = $(c);
|
|
3442
|
+
if (M && c.length) {
|
|
3436
3443
|
const L = c[0].index, O = c[c.length - 1].index;
|
|
3437
|
-
g.push(
|
|
3444
|
+
g.push(M.intercept + M.slope * L, M.intercept + M.slope * O);
|
|
3438
3445
|
}
|
|
3439
3446
|
}
|
|
3440
3447
|
return g;
|
|
3441
3448
|
});
|
|
3442
|
-
function
|
|
3443
|
-
const c = g > 0 ? g : 1,
|
|
3449
|
+
function D(g, S) {
|
|
3450
|
+
const c = g > 0 ? g : 1, M = Math.floor(Math.log10(c)), L = c / 10 ** M;
|
|
3444
3451
|
let O;
|
|
3445
|
-
return
|
|
3452
|
+
return S ? O = L < 1.5 ? 1 : L < 3 ? 2 : L < 7 ? 5 : 10 : O = L <= 1 ? 1 : L <= 2 ? 2 : L <= 5 ? 5 : 10, O * 10 ** M;
|
|
3446
3453
|
}
|
|
3447
|
-
u(
|
|
3448
|
-
const
|
|
3449
|
-
const g =
|
|
3450
|
-
if (c ===
|
|
3451
|
-
return { min: 0, max:
|
|
3452
|
-
const
|
|
3453
|
-
for (let
|
|
3454
|
-
pe.push(Number(
|
|
3455
|
-
return { min:
|
|
3456
|
-
}),
|
|
3457
|
-
const g =
|
|
3458
|
-
return { width: 360, height: 168, left: g === "duration" ? 46 :
|
|
3454
|
+
u(D, "niceNum");
|
|
3455
|
+
const N = T(() => {
|
|
3456
|
+
const g = Q.value, S = g.length ? Math.max(0, ...g) : 1, c = g.length ? Math.min(0, ...g) : 0;
|
|
3457
|
+
if (c === S)
|
|
3458
|
+
return { min: 0, max: S || 1, ticks: [0, S || 1] };
|
|
3459
|
+
const M = 4, L = D(S - c, !1), O = D(L / (M - 1), !0), V = Math.floor(c / O) * O, le = Math.ceil(S / O) * O, pe = [];
|
|
3460
|
+
for (let de = V; de <= le + O * 0.5; de += O)
|
|
3461
|
+
pe.push(Number(de.toFixed(6)));
|
|
3462
|
+
return { min: V, max: le, ticks: pe };
|
|
3463
|
+
}), z = T(() => Er({ series: d.value })), F = T(() => {
|
|
3464
|
+
const g = z.value?.valueFormat, S = !!(z.value && (g === "currency" || g === "percent" || z.value.valuePrefix || z.value.valueSuffix));
|
|
3465
|
+
return { width: 360, height: 168, left: g === "duration" ? 46 : S ? 38 : 30, right: 12, top: 10, bottom: 24 };
|
|
3459
3466
|
});
|
|
3460
|
-
function H(g,
|
|
3461
|
-
const c =
|
|
3462
|
-
return
|
|
3467
|
+
function H(g, S) {
|
|
3468
|
+
const c = F.value, M = c.width - c.left - c.right;
|
|
3469
|
+
return S <= 1 ? c.left + M / 2 : c.left + M * g / (S - 1);
|
|
3463
3470
|
}
|
|
3464
3471
|
u(H, "xForIndex");
|
|
3465
|
-
function
|
|
3466
|
-
const { min:
|
|
3467
|
-
return
|
|
3472
|
+
function j(g) {
|
|
3473
|
+
const { min: S, max: c } = N.value, M = F.value, L = M.height - M.top - M.bottom;
|
|
3474
|
+
return M.top + (c - g) / (c - S || 1) * L;
|
|
3468
3475
|
}
|
|
3469
|
-
u(
|
|
3470
|
-
function
|
|
3471
|
-
const
|
|
3472
|
-
return
|
|
3476
|
+
u(j, "yForValue");
|
|
3477
|
+
function re(g) {
|
|
3478
|
+
const S = p.value;
|
|
3479
|
+
return S ? S.data.map((c, M) => {
|
|
3473
3480
|
const L = x(c[g]) ?? 0;
|
|
3474
|
-
return `${
|
|
3481
|
+
return `${M === 0 ? "M" : "L"} ${H(M, S.data.length).toFixed(1)} ${j(L).toFixed(1)}`;
|
|
3475
3482
|
}).join(" ") : "";
|
|
3476
3483
|
}
|
|
3477
|
-
u(
|
|
3484
|
+
u(re, "pathForSeries");
|
|
3478
3485
|
const Ie = T(() => {
|
|
3479
3486
|
const g = p.value;
|
|
3480
3487
|
if (!g?.trendLine || g.chartType !== "line" && g.chartType !== "scatter") return null;
|
|
3481
|
-
const
|
|
3482
|
-
if (!c || !
|
|
3483
|
-
const
|
|
3488
|
+
const S = E(g, g.trendLine.dataKey), c = $(S);
|
|
3489
|
+
if (!c || !S.length) return null;
|
|
3490
|
+
const M = S[0].index, L = S[S.length - 1].index, O = c.intercept + c.slope * M, V = c.intercept + c.slope * L, le = Math.max(0, g.series.findIndex((pe) => pe.dataKey === g.trendLine?.dataKey));
|
|
3484
3491
|
return {
|
|
3485
|
-
path: `M ${H(
|
|
3492
|
+
path: `M ${H(M, g.data.length).toFixed(1)} ${j(O).toFixed(1)} L ${H(L, g.data.length).toFixed(1)} ${j(V).toFixed(1)}`,
|
|
3486
3493
|
dataKey: g.trendLine.dataKey,
|
|
3487
|
-
seriesIndex:
|
|
3494
|
+
seriesIndex: le
|
|
3488
3495
|
};
|
|
3489
|
-
}),
|
|
3496
|
+
}), ue = T(() => {
|
|
3490
3497
|
const g = p.value;
|
|
3491
3498
|
if (!g || g.chartType !== "bar") return [];
|
|
3492
|
-
const
|
|
3493
|
-
if (
|
|
3494
|
-
const
|
|
3499
|
+
const S = F.value, M = (S.width - S.left - S.right) / Math.max(g.data.length, 1), L = j(0);
|
|
3500
|
+
if (A.value) {
|
|
3501
|
+
const de = Math.max(4, Math.min(24, M * 0.42));
|
|
3495
3502
|
return g.data.flatMap((fe, Te) => {
|
|
3496
3503
|
let De = 0, _e = 0;
|
|
3497
|
-
const qe =
|
|
3498
|
-
return g.series.map((Pe,
|
|
3499
|
-
const v = x(fe[Pe.dataKey]) ?? 0,
|
|
3504
|
+
const qe = S.left + Te * M + (M - de) / 2;
|
|
3505
|
+
return g.series.map((Pe, R) => {
|
|
3506
|
+
const v = x(fe[Pe.dataKey]) ?? 0, b = v >= 0 ? De : _e, Z = b + v, U = j(b), ae = j(Z);
|
|
3500
3507
|
return v >= 0 ? De = Z : _e = Z, {
|
|
3501
3508
|
key: `${Te}-${Pe.dataKey}`,
|
|
3502
3509
|
x: qe,
|
|
3503
|
-
y: Math.min(
|
|
3504
|
-
width:
|
|
3505
|
-
height: Math.max(1.5, Math.abs(
|
|
3506
|
-
seriesIndex:
|
|
3510
|
+
y: Math.min(U, ae),
|
|
3511
|
+
width: de,
|
|
3512
|
+
height: Math.max(1.5, Math.abs(U - ae)),
|
|
3513
|
+
seriesIndex: R,
|
|
3507
3514
|
rowIndex: Te,
|
|
3508
3515
|
dataKey: Pe.dataKey
|
|
3509
3516
|
};
|
|
3510
3517
|
});
|
|
3511
3518
|
});
|
|
3512
3519
|
}
|
|
3513
|
-
const O = Math.max(g.series.length, 1),
|
|
3514
|
-
return g.data.flatMap((
|
|
3515
|
-
const _e = x(
|
|
3520
|
+
const O = Math.max(g.series.length, 1), V = O > 1 ? 2 : 0, le = Math.max(3, Math.min(20, (M * 0.62 - V * (O - 1)) / O)), pe = le * O + V * (O - 1);
|
|
3521
|
+
return g.data.flatMap((de, fe) => g.series.map((Te, De) => {
|
|
3522
|
+
const _e = x(de[Te.dataKey]) ?? 0, qe = j(_e), Pe = S.left + fe * M + (M - pe) / 2 + De * (le + V);
|
|
3516
3523
|
return {
|
|
3517
3524
|
key: `${fe}-${Te.dataKey}`,
|
|
3518
3525
|
x: Pe,
|
|
3519
3526
|
y: Math.min(qe, L),
|
|
3520
|
-
width:
|
|
3527
|
+
width: le,
|
|
3521
3528
|
height: Math.max(1.5, Math.abs(L - qe)),
|
|
3522
3529
|
seriesIndex: De,
|
|
3523
3530
|
rowIndex: fe,
|
|
@@ -3527,83 +3534,83 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3527
3534
|
}), $e = T(() => {
|
|
3528
3535
|
const g = p.value;
|
|
3529
3536
|
if (!g) return [];
|
|
3530
|
-
const
|
|
3531
|
-
if (!
|
|
3532
|
-
const c = g.xKey,
|
|
3533
|
-
for (let
|
|
3534
|
-
O.add(
|
|
3535
|
-
return [...O].sort((
|
|
3536
|
-
key: `${
|
|
3537
|
-
label: String(
|
|
3538
|
-
x: H(
|
|
3539
|
-
anchor:
|
|
3540
|
-
})).filter((
|
|
3541
|
-
}),
|
|
3537
|
+
const S = g.data;
|
|
3538
|
+
if (!S.length) return [];
|
|
3539
|
+
const c = g.xKey, M = S.length - 1, L = M <= 6 ? 1 : Math.ceil(M / 4), O = /* @__PURE__ */ new Set([0, M]);
|
|
3540
|
+
for (let V = 0; V <= M; V += L)
|
|
3541
|
+
O.add(V);
|
|
3542
|
+
return [...O].sort((V, le) => V - le).map((V) => ({
|
|
3543
|
+
key: `${V}`,
|
|
3544
|
+
label: String(S[V]?.[c] ?? ""),
|
|
3545
|
+
x: H(V, S.length),
|
|
3546
|
+
anchor: V === 0 ? "start" : V === M ? "end" : "middle"
|
|
3547
|
+
})).filter((V) => V.label);
|
|
3548
|
+
}), xt = T(() => {
|
|
3542
3549
|
const g = p.value;
|
|
3543
|
-
if (!g || g.chartType !== "bar" || g.series.length !== 1 ||
|
|
3550
|
+
if (!g || g.chartType !== "bar" || g.series.length !== 1 || A.value)
|
|
3544
3551
|
return [];
|
|
3545
|
-
const
|
|
3546
|
-
const
|
|
3547
|
-
return !
|
|
3552
|
+
const S = g.series[0], c = g.data.map((O, V) => {
|
|
3553
|
+
const le = w(O, g.xKey), pe = x(O[S.dataKey]);
|
|
3554
|
+
return !le || pe === null ? null : { key: `${V}-${le}`, label: le, rawValue: pe };
|
|
3548
3555
|
}).filter((O) => O !== null);
|
|
3549
3556
|
if (!c.length || c.some((O) => O.rawValue < 0))
|
|
3550
3557
|
return [];
|
|
3551
|
-
if (!(g.layout === "horizontal" ||
|
|
3558
|
+
if (!(g.layout === "horizontal" || C(g.data, g.xKey)))
|
|
3552
3559
|
return [];
|
|
3553
3560
|
const L = Math.max(...c.map((O) => O.rawValue), 1);
|
|
3554
3561
|
return c.map((O) => ({
|
|
3555
3562
|
key: O.key,
|
|
3556
3563
|
label: O.label,
|
|
3557
|
-
value: In({ value: O.rawValue, series:
|
|
3564
|
+
value: In({ value: O.rawValue, series: S }),
|
|
3558
3565
|
width: O.rawValue <= 0 ? 0 : Math.max(2, O.rawValue / L * 100),
|
|
3559
3566
|
seriesIndex: 0
|
|
3560
3567
|
}));
|
|
3561
3568
|
}), st = T(() => {
|
|
3562
3569
|
const g = p.value;
|
|
3563
3570
|
if (!g?.data.length) return [];
|
|
3564
|
-
const
|
|
3565
|
-
return g.series.map((c,
|
|
3566
|
-
const L = x(
|
|
3571
|
+
const S = g.data[g.data.length - 1];
|
|
3572
|
+
return g.series.map((c, M) => {
|
|
3573
|
+
const L = x(S?.[c.dataKey]);
|
|
3567
3574
|
return {
|
|
3568
3575
|
key: c.dataKey,
|
|
3569
3576
|
label: c.label || c.dataKey,
|
|
3570
3577
|
value: L === null ? "—" : In({ value: L, series: c }),
|
|
3571
|
-
seriesIndex:
|
|
3578
|
+
seriesIndex: M
|
|
3572
3579
|
};
|
|
3573
3580
|
});
|
|
3574
|
-
}),
|
|
3581
|
+
}), ce = T(() => {
|
|
3575
3582
|
const g = p.value;
|
|
3576
3583
|
if (!g?.data.length || g.chartType !== "line") return [];
|
|
3577
|
-
const
|
|
3578
|
-
return g.series.map((
|
|
3579
|
-
const O = x(c?.[
|
|
3580
|
-
return O === null ? null : { key:
|
|
3581
|
-
}).filter((
|
|
3584
|
+
const S = g.data.length - 1, c = g.data[S];
|
|
3585
|
+
return g.series.map((M, L) => {
|
|
3586
|
+
const O = x(c?.[M.dataKey]);
|
|
3587
|
+
return O === null ? null : { key: M.dataKey, cx: H(S, g.data.length), cy: j(O), seriesIndex: L };
|
|
3588
|
+
}).filter((M) => M !== null);
|
|
3582
3589
|
}), at = T(() => {
|
|
3583
3590
|
const g = k.value;
|
|
3584
3591
|
if (!g) return [];
|
|
3585
|
-
const
|
|
3592
|
+
const S = g.data.map((L) => ({
|
|
3586
3593
|
name: String(L[g.nameKey] ?? ""),
|
|
3587
3594
|
value: x(L[g.valueKey]) ?? 0
|
|
3588
|
-
})).filter((L) => L.name && L.value >= 0).sort((L, O) => O.value - L.value), c =
|
|
3589
|
-
return
|
|
3595
|
+
})).filter((L) => L.name && L.value >= 0).sort((L, O) => O.value - L.value), c = S.reduce((L, O) => L + O.value, 0) || 1, M = g.series?.[0];
|
|
3596
|
+
return S.map((L, O) => ({
|
|
3590
3597
|
...L,
|
|
3591
3598
|
key: `${O}-${L.name}`,
|
|
3592
3599
|
percent: L.value / c,
|
|
3593
|
-
display: In({ value: L.value, series:
|
|
3600
|
+
display: In({ value: L.value, series: M })
|
|
3594
3601
|
}));
|
|
3595
3602
|
}), be = T(() => i.value ? Ar(i.value) : null), je = [
|
|
3596
3603
|
"var(--color-theme-900)",
|
|
3597
3604
|
"var(--color-primary-500)",
|
|
3598
3605
|
"color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
|
|
3599
|
-
],
|
|
3606
|
+
], bt = [
|
|
3600
3607
|
"rgba(255, 255, 255, 0.92)",
|
|
3601
3608
|
"color-mix(in oklch, white 30%, var(--color-primary-500))",
|
|
3602
3609
|
"rgba(255, 255, 255, 0.55)"
|
|
3603
3610
|
];
|
|
3604
3611
|
function Ee(g) {
|
|
3605
|
-
const
|
|
3606
|
-
return
|
|
3612
|
+
const S = t.inverted ? bt : je;
|
|
3613
|
+
return S[g % S.length];
|
|
3607
3614
|
}
|
|
3608
3615
|
u(Ee, "seriesColor");
|
|
3609
3616
|
function Le(g) {
|
|
@@ -3615,54 +3622,54 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3615
3622
|
}
|
|
3616
3623
|
u(We, "diagramNodeStroke");
|
|
3617
3624
|
const ke = T(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), Ge = T(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), X = T(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), it = T(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), ie = T(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), rt = T(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), te = T(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Ve = T(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
3618
|
-
return (g,
|
|
3625
|
+
return (g, S) => e.value ? (h(), f("section", {
|
|
3619
3626
|
key: 0,
|
|
3620
3627
|
"data-test": "chat-visual",
|
|
3621
3628
|
"data-visual-type": e.value.visualType,
|
|
3622
3629
|
"data-chart-type": n.value?.chartType,
|
|
3623
|
-
"data-stacking":
|
|
3630
|
+
"data-stacking": A.value ? "stacked" : void 0,
|
|
3624
3631
|
"data-diagram-type": i.value?.diagramType,
|
|
3625
3632
|
class: "my-6 w-full border-y py-5",
|
|
3626
3633
|
style: K({ borderColor: rt.value }),
|
|
3627
3634
|
"aria-label": e.value.meta.title
|
|
3628
3635
|
}, [
|
|
3629
|
-
|
|
3630
|
-
|
|
3636
|
+
y("header", Cr, [
|
|
3637
|
+
y("h4", {
|
|
3631
3638
|
class: "text-[13px] font-semibold leading-tight",
|
|
3632
3639
|
style: K({ color: ke.value })
|
|
3633
|
-
},
|
|
3640
|
+
}, W(e.value.meta.title), 5),
|
|
3634
3641
|
e.value.meta.description ? (h(), f("p", {
|
|
3635
3642
|
key: 0,
|
|
3636
3643
|
class: "mt-0.5 text-[12px] leading-snug",
|
|
3637
3644
|
style: K({ color: Ge.value })
|
|
3638
|
-
},
|
|
3645
|
+
}, W(e.value.meta.description), 5)) : G("", !0)
|
|
3639
3646
|
]),
|
|
3640
3647
|
p.value ? (h(), f("div", {
|
|
3641
3648
|
key: 0,
|
|
3642
3649
|
role: "img",
|
|
3643
3650
|
"aria-label": e.value.meta.title
|
|
3644
3651
|
}, [
|
|
3645
|
-
|
|
3646
|
-
(h(!0), f(se, null, ve(
|
|
3652
|
+
xt.value.length ? (h(), f("div", Ir, [
|
|
3653
|
+
(h(!0), f(se, null, ve(xt.value, (c) => (h(), f("div", {
|
|
3647
3654
|
key: c.key,
|
|
3648
3655
|
"data-test": "chat-visual-horizontal-bar",
|
|
3649
3656
|
class: "min-w-0"
|
|
3650
3657
|
}, [
|
|
3651
|
-
|
|
3652
|
-
|
|
3658
|
+
y("div", $r, [
|
|
3659
|
+
y("span", {
|
|
3653
3660
|
class: "line-clamp-2 min-w-0 font-medium leading-snug",
|
|
3654
3661
|
style: K({ color: ke.value })
|
|
3655
|
-
},
|
|
3656
|
-
|
|
3662
|
+
}, W(c.label), 5),
|
|
3663
|
+
y("span", {
|
|
3657
3664
|
class: "shrink-0 font-semibold tabular-nums",
|
|
3658
3665
|
style: K({ color: ke.value })
|
|
3659
|
-
},
|
|
3666
|
+
}, W(c.value), 5)
|
|
3660
3667
|
]),
|
|
3661
|
-
|
|
3668
|
+
y("div", {
|
|
3662
3669
|
class: "h-2 w-full overflow-hidden rounded-full",
|
|
3663
3670
|
style: K({ background: Ve.value })
|
|
3664
3671
|
}, [
|
|
3665
|
-
|
|
3672
|
+
y("div", {
|
|
3666
3673
|
class: "h-full rounded-full",
|
|
3667
3674
|
style: K({ width: `${c.width}%`, background: Ee(c.seriesIndex) })
|
|
3668
3675
|
}, null, 4)
|
|
@@ -3671,32 +3678,32 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3671
3678
|
])) : (h(), f("svg", {
|
|
3672
3679
|
key: 1,
|
|
3673
3680
|
class: "block h-auto w-full overflow-visible",
|
|
3674
|
-
viewBox: `0 0 ${
|
|
3675
|
-
style: K({ aspectRatio: `${
|
|
3681
|
+
viewBox: `0 0 ${F.value.width} ${F.value.height}`,
|
|
3682
|
+
style: K({ aspectRatio: `${F.value.width} / ${F.value.height}` }),
|
|
3676
3683
|
preserveAspectRatio: "xMidYMid meet",
|
|
3677
3684
|
"aria-hidden": "true"
|
|
3678
3685
|
}, [
|
|
3679
|
-
(h(!0), f(se, null, ve(
|
|
3686
|
+
(h(!0), f(se, null, ve(N.value.ticks, (c) => (h(), f("line", {
|
|
3680
3687
|
key: `grid-${c}`,
|
|
3681
|
-
x1:
|
|
3682
|
-
x2:
|
|
3683
|
-
y1:
|
|
3684
|
-
y2:
|
|
3688
|
+
x1: F.value.left,
|
|
3689
|
+
x2: F.value.width - F.value.right,
|
|
3690
|
+
y1: j(c),
|
|
3691
|
+
y2: j(c),
|
|
3685
3692
|
"stroke-width": "1",
|
|
3686
3693
|
"vector-effect": "non-scaling-stroke",
|
|
3687
3694
|
style: K({ stroke: c === 0 ? ie.value : it.value })
|
|
3688
3695
|
}, null, 12, Lr))), 128)),
|
|
3689
|
-
|
|
3690
|
-
(h(!0), f(se, null, ve(
|
|
3696
|
+
y("g", null, [
|
|
3697
|
+
(h(!0), f(se, null, ve(N.value.ticks, (c) => (h(), f("text", {
|
|
3691
3698
|
key: `y-${c}`,
|
|
3692
|
-
x:
|
|
3693
|
-
y:
|
|
3699
|
+
x: F.value.left - 7,
|
|
3700
|
+
y: j(c) + 3,
|
|
3694
3701
|
"text-anchor": "end",
|
|
3695
3702
|
"font-size": "9.5",
|
|
3696
3703
|
style: K({ fill: X.value })
|
|
3697
|
-
},
|
|
3704
|
+
}, W(on(_r)({ value: c, shared: z.value })), 13, Or))), 128))
|
|
3698
3705
|
]),
|
|
3699
|
-
p.value.chartType === "bar" ? (h(!0), f(se, { key: 0 }, ve(
|
|
3706
|
+
p.value.chartType === "bar" ? (h(!0), f(se, { key: 0 }, ve(ue.value, (c) => (h(), f("rect", {
|
|
3700
3707
|
key: c.key,
|
|
3701
3708
|
"data-test": "chat-visual-bar",
|
|
3702
3709
|
"data-row-index": c.rowIndex,
|
|
@@ -3721,94 +3728,94 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3721
3728
|
"stroke-dasharray": "4 3",
|
|
3722
3729
|
"vector-effect": "non-scaling-stroke",
|
|
3723
3730
|
style: K({ stroke: Ee(Ie.value.seriesIndex) })
|
|
3724
|
-
}, null, 12, Nr)) :
|
|
3725
|
-
(h(!0), f(se, null, ve(d.value, (c,
|
|
3731
|
+
}, null, 12, Nr)) : G("", !0),
|
|
3732
|
+
(h(!0), f(se, null, ve(d.value, (c, M) => (h(), f("g", {
|
|
3726
3733
|
key: c.dataKey
|
|
3727
3734
|
}, [
|
|
3728
3735
|
p.value.chartType === "line" ? (h(), f("path", {
|
|
3729
3736
|
key: 0,
|
|
3730
|
-
d:
|
|
3737
|
+
d: re(c.dataKey),
|
|
3731
3738
|
fill: "none",
|
|
3732
3739
|
"stroke-width": "2",
|
|
3733
3740
|
"stroke-linecap": "round",
|
|
3734
3741
|
"stroke-linejoin": "round",
|
|
3735
3742
|
"vector-effect": "non-scaling-stroke",
|
|
3736
|
-
style: K({ stroke: Ee(
|
|
3737
|
-
}, null, 12, Pr)) :
|
|
3743
|
+
style: K({ stroke: Ee(M) })
|
|
3744
|
+
}, null, 12, Pr)) : G("", !0),
|
|
3738
3745
|
(h(!0), f(se, null, ve(o.value, (L, O) => (h(), f(se, {
|
|
3739
3746
|
key: `${c.dataKey}-${O}`
|
|
3740
3747
|
}, [
|
|
3741
3748
|
p.value.chartType === "scatter" ? (h(), f("circle", {
|
|
3742
3749
|
key: 0,
|
|
3743
3750
|
cx: H(O, o.value.length),
|
|
3744
|
-
cy:
|
|
3751
|
+
cy: j(x(L[c.dataKey]) ?? 0),
|
|
3745
3752
|
r: "2.6",
|
|
3746
|
-
style: K({ fill: Ee(
|
|
3747
|
-
}, null, 12,
|
|
3753
|
+
style: K({ fill: Ee(M) })
|
|
3754
|
+
}, null, 12, Fr)) : G("", !0)
|
|
3748
3755
|
], 64))), 128))
|
|
3749
3756
|
]))), 128)),
|
|
3750
|
-
(h(!0), f(se, null, ve(
|
|
3757
|
+
(h(!0), f(se, null, ve(ce.value, (c) => (h(), f("circle", {
|
|
3751
3758
|
key: `marker-${c.key}`,
|
|
3752
3759
|
cx: c.cx,
|
|
3753
3760
|
cy: c.cy,
|
|
3754
3761
|
r: "3",
|
|
3755
3762
|
style: K({ fill: Ee(c.seriesIndex) })
|
|
3756
|
-
}, null, 12,
|
|
3763
|
+
}, null, 12, Br))), 128))
|
|
3757
3764
|
], 64)),
|
|
3758
3765
|
(h(!0), f(se, null, ve($e.value, (c) => (h(), f("text", {
|
|
3759
3766
|
key: c.key,
|
|
3760
3767
|
x: c.x,
|
|
3761
|
-
y:
|
|
3768
|
+
y: F.value.height - 6,
|
|
3762
3769
|
"text-anchor": c.anchor,
|
|
3763
3770
|
"font-size": "9.5",
|
|
3764
3771
|
style: K({ fill: X.value })
|
|
3765
|
-
},
|
|
3772
|
+
}, W(c.label), 13, Ur))), 128))
|
|
3766
3773
|
], 12, Dr)),
|
|
3767
3774
|
st.value.length > 1 || p.value.chartType !== "bar" ? (h(), f("div", Hr, [
|
|
3768
3775
|
(h(!0), f(se, null, ve(st.value, (c) => (h(), f("div", {
|
|
3769
3776
|
key: c.key,
|
|
3770
3777
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
3771
3778
|
}, [
|
|
3772
|
-
|
|
3779
|
+
y("span", {
|
|
3773
3780
|
class: "size-2.5 shrink-0 rounded-full",
|
|
3774
3781
|
style: K({ background: Ee(c.seriesIndex) })
|
|
3775
3782
|
}, null, 4),
|
|
3776
|
-
|
|
3783
|
+
y("span", {
|
|
3777
3784
|
style: K({ color: Ge.value })
|
|
3778
|
-
},
|
|
3779
|
-
|
|
3785
|
+
}, W(c.label), 5),
|
|
3786
|
+
y("span", {
|
|
3780
3787
|
class: "font-semibold tabular-nums",
|
|
3781
3788
|
style: K({ color: ke.value })
|
|
3782
|
-
},
|
|
3789
|
+
}, W(c.value), 5)
|
|
3783
3790
|
]))), 128))
|
|
3784
|
-
])) :
|
|
3791
|
+
])) : G("", !0)
|
|
3785
3792
|
], 8, Mr)) : k.value ? (h(), f("div", jr, [
|
|
3786
|
-
(h(!0), f(se, null, ve(at.value, (c,
|
|
3793
|
+
(h(!0), f(se, null, ve(at.value, (c, M) => (h(), f("div", {
|
|
3787
3794
|
key: c.key
|
|
3788
3795
|
}, [
|
|
3789
|
-
|
|
3790
|
-
|
|
3796
|
+
y("div", Wr, [
|
|
3797
|
+
y("span", {
|
|
3791
3798
|
class: "truncate font-medium",
|
|
3792
3799
|
style: K({ color: ke.value })
|
|
3793
|
-
},
|
|
3794
|
-
|
|
3795
|
-
|
|
3800
|
+
}, W(c.name), 5),
|
|
3801
|
+
y("span", Gr, [
|
|
3802
|
+
y("span", {
|
|
3796
3803
|
class: "font-semibold",
|
|
3797
3804
|
style: K({ color: ke.value })
|
|
3798
|
-
},
|
|
3799
|
-
|
|
3805
|
+
}, W(c.display), 5),
|
|
3806
|
+
y("span", {
|
|
3800
3807
|
class: "ml-1.5",
|
|
3801
3808
|
style: K({ color: Ge.value })
|
|
3802
|
-
},
|
|
3809
|
+
}, W(Math.round(c.percent * 100)) + "%", 5)
|
|
3803
3810
|
])
|
|
3804
3811
|
]),
|
|
3805
|
-
|
|
3812
|
+
y("div", {
|
|
3806
3813
|
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
3807
3814
|
style: K({ background: Ve.value })
|
|
3808
3815
|
}, [
|
|
3809
|
-
|
|
3816
|
+
y("div", {
|
|
3810
3817
|
class: "h-full rounded-full",
|
|
3811
|
-
style: K({ width: `${Math.max(2, c.percent * 100)}%`, background: Ee(
|
|
3818
|
+
style: K({ width: `${Math.max(2, c.percent * 100)}%`, background: Ee(M) })
|
|
3812
3819
|
}, null, 4)
|
|
3813
3820
|
], 4)
|
|
3814
3821
|
]))), 128))
|
|
@@ -3849,11 +3856,11 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3849
3856
|
width: "86",
|
|
3850
3857
|
height: "22"
|
|
3851
3858
|
}, [
|
|
3852
|
-
|
|
3859
|
+
y("div", {
|
|
3853
3860
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3854
3861
|
class: "flex h-full items-center justify-center px-1 text-center text-[8.5px] font-medium leading-none",
|
|
3855
3862
|
style: K({ color: Ge.value, background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)" })
|
|
3856
|
-
},
|
|
3863
|
+
}, W(c.label), 5)
|
|
3857
3864
|
], 8, Xr))), 128)),
|
|
3858
3865
|
(h(!0), f(se, null, ve(be.value.nodes, (c) => (h(), f("g", {
|
|
3859
3866
|
key: c.id,
|
|
@@ -3868,7 +3875,7 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3868
3875
|
"stroke-width": "1",
|
|
3869
3876
|
"vector-effect": "non-scaling-stroke",
|
|
3870
3877
|
style: K({ fill: Le(c.kind), stroke: We(c.kind) })
|
|
3871
|
-
}, null, 12,
|
|
3878
|
+
}, null, 12, Jr)) : (h(), f("rect", {
|
|
3872
3879
|
key: 1,
|
|
3873
3880
|
width: c.width,
|
|
3874
3881
|
height: c.height,
|
|
@@ -3876,34 +3883,34 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3876
3883
|
"stroke-width": "1",
|
|
3877
3884
|
"vector-effect": "non-scaling-stroke",
|
|
3878
3885
|
style: K({ fill: Le(c.kind), stroke: We(c.kind) })
|
|
3879
|
-
}, null, 12,
|
|
3886
|
+
}, null, 12, Qr)),
|
|
3880
3887
|
(h(), f("foreignObject", {
|
|
3881
3888
|
x: "8",
|
|
3882
3889
|
y: "5",
|
|
3883
3890
|
width: c.width - 16,
|
|
3884
3891
|
height: c.height - 10
|
|
3885
3892
|
}, [
|
|
3886
|
-
|
|
3887
|
-
|
|
3893
|
+
y("div", tl, [
|
|
3894
|
+
y("div", {
|
|
3888
3895
|
class: "line-clamp-2 text-[10.5px] font-semibold leading-tight",
|
|
3889
3896
|
style: K({ color: ke.value })
|
|
3890
|
-
},
|
|
3897
|
+
}, W(c.label), 5),
|
|
3891
3898
|
c.detail ? (h(), f("div", {
|
|
3892
3899
|
key: 0,
|
|
3893
3900
|
class: "mt-0.5 line-clamp-1 text-[8.5px] leading-none",
|
|
3894
3901
|
style: K({ color: Ge.value })
|
|
3895
|
-
},
|
|
3902
|
+
}, W(c.detail), 5)) : G("", !0)
|
|
3896
3903
|
])
|
|
3897
3904
|
], 8, el))
|
|
3898
3905
|
], 8, Zr))), 128))
|
|
3899
3906
|
], 12, qr))
|
|
3900
|
-
])) :
|
|
3907
|
+
])) : G("", !0),
|
|
3901
3908
|
e.value.meta.footer ? (h(), f("footer", {
|
|
3902
3909
|
key: 3,
|
|
3903
3910
|
class: "mt-3 text-[11px] leading-snug",
|
|
3904
3911
|
style: K({ color: X.value })
|
|
3905
|
-
},
|
|
3906
|
-
], 12, Rr)) :
|
|
3912
|
+
}, W(e.value.meta.footer), 5)) : G("", !0)
|
|
3913
|
+
], 12, Rr)) : G("", !0);
|
|
3907
3914
|
}
|
|
3908
3915
|
}), sl = ["innerHTML"], ln = /* @__PURE__ */ Me({
|
|
3909
3916
|
__name: "ChatRichText",
|
|
@@ -3917,8 +3924,8 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3917
3924
|
let n;
|
|
3918
3925
|
Kt(
|
|
3919
3926
|
[() => t.text, () => t.streaming],
|
|
3920
|
-
([w,
|
|
3921
|
-
if (!
|
|
3927
|
+
([w, C]) => {
|
|
3928
|
+
if (!C) {
|
|
3922
3929
|
n !== void 0 && (cancelAnimationFrame(n), n = void 0), e.value = w;
|
|
3923
3930
|
return;
|
|
3924
3931
|
}
|
|
@@ -3930,43 +3937,43 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3930
3937
|
n !== void 0 && cancelAnimationFrame(n);
|
|
3931
3938
|
});
|
|
3932
3939
|
const i = new ee.Renderer();
|
|
3933
|
-
i.link = ({ href: w, text:
|
|
3934
|
-
const
|
|
3935
|
-
if (!
|
|
3936
|
-
return
|
|
3937
|
-
let
|
|
3940
|
+
i.link = ({ href: w, text: C }) => {
|
|
3941
|
+
const E = w.trim();
|
|
3942
|
+
if (!E || E === "#")
|
|
3943
|
+
return C;
|
|
3944
|
+
let $ = !1;
|
|
3938
3945
|
if (typeof window < "u")
|
|
3939
3946
|
try {
|
|
3940
|
-
|
|
3947
|
+
$ = new URL(w, window.location.href).origin === window.location.origin;
|
|
3941
3948
|
} catch {
|
|
3942
|
-
|
|
3949
|
+
$ = !1;
|
|
3943
3950
|
}
|
|
3944
|
-
return
|
|
3951
|
+
return $ ? `<a href="${w}">${C}</a>` : `<a href="${w}" target="_blank" rel="noopener noreferrer">${C}</a>`;
|
|
3945
3952
|
}, ee.setOptions({ breaks: !0, gfm: !0, renderer: i });
|
|
3946
3953
|
function s(w) {
|
|
3947
3954
|
if (!w) return "";
|
|
3948
|
-
const
|
|
3949
|
-
return Oi.sanitize(
|
|
3955
|
+
const C = ee.parse(w, { async: !1 });
|
|
3956
|
+
return Oi.sanitize(C, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
|
|
3950
3957
|
}
|
|
3951
3958
|
u(s, "renderMarkdown");
|
|
3952
3959
|
function l(w) {
|
|
3953
3960
|
if (typeof w != "string") return null;
|
|
3954
|
-
const
|
|
3955
|
-
return
|
|
3961
|
+
const C = w.trim();
|
|
3962
|
+
return C ? C.slice(0, 80) : null;
|
|
3956
3963
|
}
|
|
3957
3964
|
u(l, "safePayloadString");
|
|
3958
3965
|
function o(w) {
|
|
3959
3966
|
try {
|
|
3960
|
-
const
|
|
3961
|
-
if (!
|
|
3967
|
+
const C = JSON.parse(w);
|
|
3968
|
+
if (!C || typeof C != "object" || Array.isArray(C))
|
|
3962
3969
|
return { topLevelKeys: [], declaredVisualType: null, declaredChartType: null, declaredDiagramType: null, inputType: null };
|
|
3963
|
-
const
|
|
3970
|
+
const E = C;
|
|
3964
3971
|
return {
|
|
3965
|
-
topLevelKeys: Object.keys(
|
|
3966
|
-
declaredVisualType: l(
|
|
3967
|
-
declaredChartType: l(
|
|
3968
|
-
declaredDiagramType: l(
|
|
3969
|
-
inputType: l(
|
|
3972
|
+
topLevelKeys: Object.keys(E).sort().slice(0, 24),
|
|
3973
|
+
declaredVisualType: l(E.visualType),
|
|
3974
|
+
declaredChartType: l(E.chartType),
|
|
3975
|
+
declaredDiagramType: l(E.diagramType),
|
|
3976
|
+
inputType: l(E.type)
|
|
3970
3977
|
};
|
|
3971
3978
|
} catch {
|
|
3972
3979
|
return { topLevelKeys: [], declaredVisualType: null, declaredChartType: null, declaredDiagramType: null, inputType: null };
|
|
@@ -3992,55 +3999,55 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
3992
3999
|
}
|
|
3993
4000
|
u(d, "onRichTextAssetError");
|
|
3994
4001
|
const k = /```(?:pl-visual|pl-platform-visual)[ \t]*(?:\r?\n|$)/;
|
|
3995
|
-
function
|
|
3996
|
-
const { text:
|
|
3997
|
-
let
|
|
3998
|
-
for (;
|
|
3999
|
-
const
|
|
4000
|
-
Ie &&
|
|
4001
|
-
const
|
|
4002
|
-
if (
|
|
4003
|
-
|
|
4002
|
+
function A(w) {
|
|
4003
|
+
const { text: C, streaming: E } = w, $ = [], Q = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g;
|
|
4004
|
+
let D = 0, N = 0, z = Q.exec(C);
|
|
4005
|
+
for (; z !== null; ) {
|
|
4006
|
+
const re = C.slice(D, z.index), Ie = s(re);
|
|
4007
|
+
Ie && $.push({ kind: "markdown", key: `md-${N}`, html: Ie });
|
|
4008
|
+
const ue = ya(z[1].trim());
|
|
4009
|
+
if (ue.ok)
|
|
4010
|
+
$.push({ kind: "visual", key: `visual-${N}`, result: ue });
|
|
4004
4011
|
else {
|
|
4005
4012
|
typeof console < "u" && console.warn("[pl-visual] parse_failed", {
|
|
4006
|
-
reason:
|
|
4007
|
-
message:
|
|
4008
|
-
hasFallbackMarkdown: !!
|
|
4009
|
-
payloadChars:
|
|
4010
|
-
...o(
|
|
4013
|
+
reason: ue.reason,
|
|
4014
|
+
message: ue.message,
|
|
4015
|
+
hasFallbackMarkdown: !!ue.fallbackMarkdown,
|
|
4016
|
+
payloadChars: z[1].trim().length,
|
|
4017
|
+
...o(z[1].trim())
|
|
4011
4018
|
});
|
|
4012
|
-
const $e =
|
|
4013
|
-
$e &&
|
|
4019
|
+
const $e = ue.fallbackMarkdown ? s(ue.fallbackMarkdown) : "";
|
|
4020
|
+
$e && $.push({ kind: "markdown", key: `visual-${N}`, html: $e });
|
|
4014
4021
|
}
|
|
4015
|
-
|
|
4022
|
+
D = z.index + z[0].length, N += 1, z = Q.exec(C);
|
|
4016
4023
|
}
|
|
4017
|
-
const
|
|
4024
|
+
const F = C.slice(D), H = E ? k.exec(F) : null;
|
|
4018
4025
|
if (H) {
|
|
4019
|
-
const
|
|
4020
|
-
return
|
|
4026
|
+
const re = s(F.slice(0, H.index));
|
|
4027
|
+
return re && $.push({ kind: "markdown", key: `md-${N}`, html: re }), $.push({ kind: "pending-visual", key: `pending-${N}` }), $;
|
|
4021
4028
|
}
|
|
4022
|
-
const
|
|
4023
|
-
return
|
|
4029
|
+
const j = s(F);
|
|
4030
|
+
return j && $.push({ kind: "markdown", key: `md-${N}`, html: j }), $;
|
|
4024
4031
|
}
|
|
4025
|
-
u(
|
|
4032
|
+
u(A, "richTextSegments");
|
|
4026
4033
|
const x = T(() => {
|
|
4027
4034
|
const w = e.value;
|
|
4028
|
-
return w ?
|
|
4035
|
+
return w ? A({ text: w, streaming: !!t.streaming }) : [];
|
|
4029
4036
|
});
|
|
4030
|
-
return (w,
|
|
4037
|
+
return (w, C) => (h(), f("div", {
|
|
4031
4038
|
class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed",
|
|
4032
4039
|
onErrorCapture: d
|
|
4033
4040
|
}, [
|
|
4034
|
-
(h(!0), f(se, null, ve(x.value, (
|
|
4035
|
-
key:
|
|
4041
|
+
(h(!0), f(se, null, ve(x.value, (E) => (h(), f(se, {
|
|
4042
|
+
key: E.key
|
|
4036
4043
|
}, [
|
|
4037
|
-
|
|
4044
|
+
E.kind === "markdown" ? (h(), f("div", {
|
|
4038
4045
|
key: 0,
|
|
4039
|
-
class:
|
|
4040
|
-
innerHTML:
|
|
4041
|
-
}, null, 10, sl)) :
|
|
4046
|
+
class: _(["chat-msg-prose", a.inverted ? "chat-msg-prose-invert" : ""]),
|
|
4047
|
+
innerHTML: E.html
|
|
4048
|
+
}, null, 10, sl)) : E.kind === "visual" ? (h(), mt(nl, {
|
|
4042
4049
|
key: 1,
|
|
4043
|
-
result:
|
|
4050
|
+
result: E.result,
|
|
4044
4051
|
inverted: a.inverted
|
|
4045
4052
|
}, null, 8, ["result", "inverted"])) : (h(), f("div", {
|
|
4046
4053
|
key: 2,
|
|
@@ -4051,8 +4058,8 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4051
4058
|
borderColor: a.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)",
|
|
4052
4059
|
color: a.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
|
|
4053
4060
|
})
|
|
4054
|
-
}, [...
|
|
4055
|
-
|
|
4061
|
+
}, [...C[0] || (C[0] = [
|
|
4062
|
+
y("span", {
|
|
4056
4063
|
class: "size-2 shrink-0 animate-pulse rounded-full",
|
|
4057
4064
|
style: { background: "currentcolor" }
|
|
4058
4065
|
}, null, -1),
|
|
@@ -4090,10 +4097,10 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4090
4097
|
}), (d, k) => (h(), f("div", {
|
|
4091
4098
|
ref_key: "viewport",
|
|
4092
4099
|
ref: e,
|
|
4093
|
-
class:
|
|
4100
|
+
class: _(["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]" : ""]),
|
|
4094
4101
|
onScrollPassive: o
|
|
4095
4102
|
}, [
|
|
4096
|
-
|
|
4103
|
+
y("div", {
|
|
4097
4104
|
ref_key: "content",
|
|
4098
4105
|
ref: n,
|
|
4099
4106
|
class: "flex-1 flex flex-col"
|
|
@@ -4119,17 +4126,17 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4119
4126
|
}, ml = { class: "relative mb-4 size-20 @sm/chat:size-24" }, gl = ["src", "alt"], vl = ["title"], xl = {
|
|
4120
4127
|
key: 0,
|
|
4121
4128
|
class: "flex items-center gap-3 py-3 px-2"
|
|
4122
|
-
}, bl = ["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"],
|
|
4129
|
+
}, bl = ["data-journal-outcome"], yl = ["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"], kl = { class: "max-w-[85%] min-w-0" }, wl = ["href"], Tl = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-streaming"], Sl = ["data-test", "data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-streaming"], Al = {
|
|
4123
4130
|
key: 0,
|
|
4124
4131
|
class: "flex-shrink-0 size-7 @sm/chat:size-8"
|
|
4125
|
-
},
|
|
4132
|
+
}, El = ["src", "alt"], _l = ["src", "alt"], Rl = ["src"], Cl = ["href"], Ml = {
|
|
4126
4133
|
key: 0,
|
|
4127
4134
|
"data-test": "messaging-message-text-part"
|
|
4128
|
-
}, Il = ["src", "alt", "data-attachment-placement"], $l = ["src", "data-attachment-placement"], Dl = ["href", "data-attachment-placement"], Ll = ["data-journal-outcome"], Ol = ["data-working-description"], zl = { class: "truncate" }, Nl = ["data-issue-code"], Pl = ["href"],
|
|
4135
|
+
}, Il = ["src", "alt", "data-attachment-placement"], $l = ["src", "data-attachment-placement"], Dl = ["href", "data-attachment-placement"], Ll = ["data-journal-outcome"], Ol = ["data-working-description"], zl = { class: "truncate" }, Nl = ["data-issue-code"], Pl = ["href"], Fl = {
|
|
4129
4136
|
key: 3,
|
|
4130
4137
|
"data-test": "messaging-thinking-indicator",
|
|
4131
4138
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
4132
|
-
},
|
|
4139
|
+
}, Bl = ["src", "alt"], Ul = {
|
|
4133
4140
|
key: 0,
|
|
4134
4141
|
class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
4135
4142
|
}, Hl = ["src", "alt"], jl = { class: "max-w-20 truncate" }, Wl = ["onClick"], Gl = {
|
|
@@ -4141,7 +4148,7 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4141
4148
|
}, Yl = {
|
|
4142
4149
|
key: 1,
|
|
4143
4150
|
class: "i-tabler-paperclip size-5"
|
|
4144
|
-
}, Xl = { class: "sr-only" }, Zl = ["placeholder", "disabled"],
|
|
4151
|
+
}, Xl = { class: "sr-only" }, Zl = ["placeholder", "disabled"], Jl = { class: "font-mono text-sm tabular-nums" }, Ql = ["aria-label", "title"], eo = { class: "sr-only" }, to = ["data-composer-action", "disabled", "aria-label", "title"], no = {
|
|
4145
4152
|
key: 0,
|
|
4146
4153
|
class: "i-tabler-player-stop-filled size-4"
|
|
4147
4154
|
}, so = {
|
|
@@ -4166,553 +4173,544 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4166
4173
|
org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
|
|
4167
4174
|
public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
|
|
4168
4175
|
}, e = T(() => {
|
|
4169
|
-
const
|
|
4170
|
-
return a.scope === "org" && a.scopeName && (
|
|
4176
|
+
const R = { ...t[a.scope] };
|
|
4177
|
+
return a.scope === "org" && a.scopeName && (R.label = a.scopeName, R.tooltip = `Visible to ${a.scopeName} members`), R;
|
|
4171
4178
|
}), n = ge(!1), i = ge(), s = ge(), l = ge();
|
|
4172
|
-
function o(
|
|
4173
|
-
return
|
|
4179
|
+
function o(R) {
|
|
4180
|
+
return R ? /\[[^\]]+\]\([^)]+\)/.test(R) : !1;
|
|
4174
4181
|
}
|
|
4175
4182
|
u(o, "containsMarkdownLink");
|
|
4176
|
-
function p(
|
|
4177
|
-
return
|
|
4183
|
+
function p(R) {
|
|
4184
|
+
return R.sender === "system" && (!!R.issue || R.id === $e.value);
|
|
4178
4185
|
}
|
|
4179
4186
|
u(p, "isSystemExplainerMessage");
|
|
4180
|
-
function d(
|
|
4181
|
-
const
|
|
4182
|
-
return !Z || Z.sender !==
|
|
4187
|
+
function d(R, v) {
|
|
4188
|
+
const b = R[v], Z = R[v + 1];
|
|
4189
|
+
return !Z || Z.sender !== b.sender;
|
|
4183
4190
|
}
|
|
4184
4191
|
u(d, "shouldShowAvatar");
|
|
4185
|
-
const k = T(() => a.chatController?.textState.value),
|
|
4186
|
-
if (!
|
|
4192
|
+
const k = T(() => a.chatController?.textState.value), A = T(() => k.value?.isConnected ?? !1), x = T(() => k.value?.isThinking ?? !1), w = T(() => k.value?.connectionStatus === "disconnected" && !!k.value?.error), C = T(() => k.value?.connectionStatus !== "connected" && !k.value?.error), E = T(() => k.value?.error), $ = T(() => a.chatController?.sharedMessages.value ?? []), Q = T(() => a.chatController?.workJournal?.value ? void 0 : k.value?.workingDescription?.trim() || void 0), D = T(() => a.chatController?.workJournal?.value), N = T(() => {
|
|
4193
|
+
if (!D.value)
|
|
4187
4194
|
return;
|
|
4188
|
-
const
|
|
4195
|
+
const R = $.value, v = R[R.length - 1];
|
|
4189
4196
|
if (v)
|
|
4190
|
-
return v.sender === "agent" || v.sender === "system" ?
|
|
4191
|
-
}),
|
|
4192
|
-
const
|
|
4193
|
-
for (const v of
|
|
4194
|
-
if (!v.toolActivities?.length)
|
|
4197
|
+
return v.sender === "agent" || v.sender === "system" ? R.length >= 2 ? R[R.length - 2].id : void 0 : v.id;
|
|
4198
|
+
}), z = T(() => {
|
|
4199
|
+
const R = {};
|
|
4200
|
+
for (const v of $.value) {
|
|
4201
|
+
if (v.sender === "user" || !v.toolActivities?.length)
|
|
4195
4202
|
continue;
|
|
4196
|
-
const
|
|
4203
|
+
const b = a.chatController?.workJournalFor?.({
|
|
4197
4204
|
activities: v.toolActivities,
|
|
4198
|
-
outcome: Ra(v)
|
|
4205
|
+
outcome: Ra(v),
|
|
4206
|
+
includeFailureNote: v.sender !== "system"
|
|
4199
4207
|
});
|
|
4200
|
-
|
|
4208
|
+
b && (R[v.id] = b);
|
|
4201
4209
|
}
|
|
4202
|
-
return
|
|
4210
|
+
return R;
|
|
4203
4211
|
});
|
|
4204
|
-
function
|
|
4205
|
-
return
|
|
4212
|
+
function F(R) {
|
|
4213
|
+
return z.value[R.id];
|
|
4206
4214
|
}
|
|
4207
|
-
u(
|
|
4208
|
-
function H(
|
|
4209
|
-
return
|
|
4215
|
+
u(F, "messageWorkJournal");
|
|
4216
|
+
function H(R, v) {
|
|
4217
|
+
return R.placement?.kind !== "inline" || !Number.isFinite(R.placement.offset) ? null : Math.max(0, Math.min(v.length, Math.trunc(R.placement.offset)));
|
|
4210
4218
|
}
|
|
4211
4219
|
u(H, "inlineOffset");
|
|
4212
|
-
function
|
|
4213
|
-
return
|
|
4220
|
+
function j(R, v) {
|
|
4221
|
+
return R.mediaId || `${R.src}:${v}`;
|
|
4214
4222
|
}
|
|
4215
|
-
u(
|
|
4216
|
-
function
|
|
4217
|
-
return (
|
|
4223
|
+
u(j, "attachmentKey");
|
|
4224
|
+
function re(R) {
|
|
4225
|
+
return (R.attachments ?? []).map((v, b) => ({ attachment: v, index: b })).filter(({ attachment: v }) => H(v, R.text) === null);
|
|
4218
4226
|
}
|
|
4219
|
-
u(
|
|
4220
|
-
function Ie(
|
|
4221
|
-
const v =
|
|
4222
|
-
if (
|
|
4223
|
-
return v ? [{ kind: "text", key: `${
|
|
4224
|
-
const
|
|
4225
|
-
if (
|
|
4226
|
-
return v ? [{ kind: "text", key: `${
|
|
4227
|
+
u(re, "blockAttachmentsForMessage");
|
|
4228
|
+
function Ie(R) {
|
|
4229
|
+
const v = R.text ?? "";
|
|
4230
|
+
if (R.sender !== "agent")
|
|
4231
|
+
return v ? [{ kind: "text", key: `${R.id}:text`, text: v }] : [];
|
|
4232
|
+
const b = (R.attachments ?? []).map((ae, Ke) => ({ attachment: ae, index: Ke, offset: H(ae, v) })).filter((ae) => ae.offset !== null).sort((ae, Ke) => ae.offset - Ke.offset || ae.index - Ke.index);
|
|
4233
|
+
if (b.length === 0)
|
|
4234
|
+
return v ? [{ kind: "text", key: `${R.id}:text`, text: v }] : [];
|
|
4227
4235
|
const Z = [];
|
|
4228
|
-
let
|
|
4229
|
-
for (const ae of
|
|
4230
|
-
ae.offset >
|
|
4236
|
+
let U = 0;
|
|
4237
|
+
for (const ae of b)
|
|
4238
|
+
ae.offset > U && Z.push({
|
|
4231
4239
|
kind: "text",
|
|
4232
|
-
key: `${
|
|
4233
|
-
text: v.slice(
|
|
4240
|
+
key: `${R.id}:text:${U}`,
|
|
4241
|
+
text: v.slice(U, ae.offset)
|
|
4234
4242
|
}), Z.push({
|
|
4235
4243
|
kind: "attachment",
|
|
4236
|
-
key: `${
|
|
4244
|
+
key: `${R.id}:attachment:${j(ae.attachment, ae.index)}`,
|
|
4237
4245
|
attachment: ae.attachment,
|
|
4238
4246
|
placement: "inline"
|
|
4239
|
-
}),
|
|
4240
|
-
return
|
|
4247
|
+
}), U = ae.offset;
|
|
4248
|
+
return U < v.length && Z.push({
|
|
4241
4249
|
kind: "text",
|
|
4242
|
-
key: `${
|
|
4243
|
-
text: v.slice(
|
|
4250
|
+
key: `${R.id}:text:${U}`,
|
|
4251
|
+
text: v.slice(U)
|
|
4244
4252
|
}), Z;
|
|
4245
4253
|
}
|
|
4246
4254
|
u(Ie, "messageRenderParts");
|
|
4247
|
-
const
|
|
4255
|
+
const ue = T(() => k.value?.transientIssue), $e = T(() => {
|
|
4248
4256
|
if (!x.value) return;
|
|
4249
|
-
const
|
|
4257
|
+
const R = $.value, v = R[R.length - 1];
|
|
4250
4258
|
return v?.sender === "agent" || v?.sender === "system" ? v.id : void 0;
|
|
4251
|
-
}),
|
|
4259
|
+
}), xt = T(() => !x.value || Q.value || D.value ? !1 : $e.value === void 0), st = T(() => k.value?.sendBlockedReason), ce = T(() => !A.value || st.value !== void 0), at = T(() => w.value ? "Agent is offline" : C.value ? "Connecting..." : st.value === "agent_deleted" ? "This assistant was deleted" : st.value === "account" ? "Open billing to keep chatting" : "Message"), be = T(() => a.chatController?.composerState?.value ?? {
|
|
4252
4260
|
text: "",
|
|
4253
4261
|
pendingAttachments: [],
|
|
4254
4262
|
isUploading: !1
|
|
4255
4263
|
}), je = T({
|
|
4256
4264
|
get: /* @__PURE__ */ u(() => be.value.text, "get"),
|
|
4257
|
-
set: /* @__PURE__ */ u((
|
|
4258
|
-
}),
|
|
4265
|
+
set: /* @__PURE__ */ u((R) => a.chatController?.setComposerText?.({ text: R }), "set")
|
|
4266
|
+
}), bt = T(() => be.value.pendingAttachments), Ee = T(() => be.value.isUploading), Le = T(() => a.chatController?.voiceRecorder), We = T(() => Le.value?.isBusy.value ?? !1), ke = T(() => a.chatController?.canAttachFile?.value ?? !1), Ge = T(() => a.chatController?.canRecordAudio?.value ?? !1), X = T(() => a.chatController?.composerAction?.value ?? "idle"), it = T(() => X.value !== "idle"), ie = T(() => X.value === "stop" ? "Stop reply" : "Send message"), rt = T(() => X.value === "idle" && Ge.value && !We.value && !!Le.value?.canUseBrowserRecording), te = T(() => Le.value?.isActive.value ?? !1), Ve = T(() => Le.value?.elapsedLabel.value ?? "0:00"), g = T(() => Le.value?.statusText.value ?? "Release to send"), S = T(() => Le.value?.state.value.phase === "sending" ? "Sending voice message" : te.value ? "Release to send voice message" : "Hold to record voice message"), c = T(() => a.variant === "light"), M = T(
|
|
4259
4267
|
() => c.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
4260
4268
|
), L = T(() => c.value ? "text-theme-300" : "text-white/30");
|
|
4261
4269
|
Yt(async () => {
|
|
4262
|
-
a.chatController && !
|
|
4263
|
-
}),
|
|
4270
|
+
a.chatController && !A.value && await a.chatController.startTextConversation();
|
|
4271
|
+
}), Os(() => {
|
|
4264
4272
|
a.chatController?.voiceRecorder?.teardown();
|
|
4265
4273
|
});
|
|
4266
4274
|
async function O() {
|
|
4267
4275
|
!a.chatController || X.value !== "send" || (s.value && (s.value.style.height = "auto", s.value.focus()), i.value?.pin(), await a.chatController.sendComposerMessage());
|
|
4268
4276
|
}
|
|
4269
4277
|
u(O, "sendMessage");
|
|
4270
|
-
async function
|
|
4278
|
+
async function V() {
|
|
4271
4279
|
a.chatController && (X.value === "send" && i.value?.pin(), await a.chatController.handleComposerAction());
|
|
4272
4280
|
}
|
|
4273
|
-
u(
|
|
4274
|
-
async function
|
|
4275
|
-
|
|
4281
|
+
u(V, "handleComposerAction");
|
|
4282
|
+
async function le(R) {
|
|
4283
|
+
R.key === "Enter" && !R.shiftKey && (R.preventDefault(), await O());
|
|
4276
4284
|
}
|
|
4277
|
-
u(
|
|
4285
|
+
u(le, "handleKeydown");
|
|
4278
4286
|
function pe() {
|
|
4279
4287
|
s.value && (s.value.style.height = "auto", s.value.style.height = `${Math.min(s.value.scrollHeight, 150)}px`);
|
|
4280
4288
|
}
|
|
4281
|
-
u(pe, "adjustTextareaHeight"), Kt(je, () =>
|
|
4282
|
-
function
|
|
4289
|
+
u(pe, "adjustTextareaHeight"), Kt(je, () => Ps(() => pe()));
|
|
4290
|
+
function de() {
|
|
4283
4291
|
l.value?.click();
|
|
4284
4292
|
}
|
|
4285
|
-
u(
|
|
4286
|
-
async function fe(
|
|
4287
|
-
const v =
|
|
4288
|
-
!
|
|
4293
|
+
u(de, "triggerFileInput");
|
|
4294
|
+
async function fe(R) {
|
|
4295
|
+
const v = R.target, b = v.files?.[0];
|
|
4296
|
+
!b || !a.chatController || We.value || (await a.chatController.attachFile({ file: b }), v.value = "");
|
|
4289
4297
|
}
|
|
4290
4298
|
u(fe, "handleFileSelect");
|
|
4291
|
-
function Te(
|
|
4292
|
-
a.chatController?.removeAttachment({ index:
|
|
4299
|
+
function Te(R) {
|
|
4300
|
+
a.chatController?.removeAttachment({ index: R });
|
|
4293
4301
|
}
|
|
4294
4302
|
u(Te, "removeAttachment");
|
|
4295
4303
|
function De() {
|
|
4296
4304
|
Le.value?.start();
|
|
4297
4305
|
}
|
|
4298
4306
|
u(De, "startRecording");
|
|
4299
|
-
function _e(
|
|
4300
|
-
Le.value?.finish(
|
|
4307
|
+
function _e(R) {
|
|
4308
|
+
Le.value?.finish(R);
|
|
4301
4309
|
}
|
|
4302
4310
|
u(_e, "finishRecording");
|
|
4303
|
-
function qe(
|
|
4311
|
+
function qe(R, v) {
|
|
4304
4312
|
if (v === 0) {
|
|
4305
|
-
const
|
|
4306
|
-
return
|
|
4313
|
+
const yt = R[v];
|
|
4314
|
+
return yt?.timestamp ? Pe(new Date(yt.timestamp)) : null;
|
|
4307
4315
|
}
|
|
4308
|
-
const
|
|
4309
|
-
if (!
|
|
4310
|
-
const
|
|
4311
|
-
return new Date(Z.timestamp).getTime() -
|
|
4316
|
+
const b = R[v - 1], Z = R[v];
|
|
4317
|
+
if (!b?.timestamp || !Z?.timestamp) return null;
|
|
4318
|
+
const U = new Date(b.timestamp).getTime();
|
|
4319
|
+
return new Date(Z.timestamp).getTime() - U > 36e5 ? Pe(new Date(Z.timestamp)) : null;
|
|
4312
4320
|
}
|
|
4313
4321
|
u(qe, "shouldShowTimeDivider");
|
|
4314
|
-
function Pe(
|
|
4315
|
-
const v = /* @__PURE__ */ new Date(),
|
|
4322
|
+
function Pe(R) {
|
|
4323
|
+
const v = /* @__PURE__ */ new Date(), b = R.toDateString() === v.toDateString(), Z = new Date(v);
|
|
4316
4324
|
Z.setDate(Z.getDate() - 1);
|
|
4317
|
-
const
|
|
4318
|
-
if (
|
|
4319
|
-
if (
|
|
4320
|
-
const Ke =
|
|
4321
|
-
return `${
|
|
4325
|
+
const U = R.toDateString() === Z.toDateString(), ae = R.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
4326
|
+
if (b) return ae;
|
|
4327
|
+
if (U) return `Yesterday, ${ae}`;
|
|
4328
|
+
const Ke = R.getFullYear() === v.getFullYear();
|
|
4329
|
+
return `${R.toLocaleDateString("en-US", {
|
|
4322
4330
|
weekday: "long",
|
|
4323
4331
|
month: "short",
|
|
4324
4332
|
day: "numeric",
|
|
4325
4333
|
...Ke ? {} : { year: "numeric" }
|
|
4326
4334
|
})}, ${ae}`;
|
|
4327
4335
|
}
|
|
4328
|
-
return u(Pe, "formatTimeDivider"), (
|
|
4336
|
+
return u(Pe, "formatTimeDivider"), (R, v) => (h(), f("div", rl, [
|
|
4329
4337
|
c.value ? a.showHeader ? (h(), f("div", ol, [
|
|
4330
|
-
|
|
4331
|
-
|
|
4338
|
+
y("div", cl, [
|
|
4339
|
+
Je(Xa, {
|
|
4332
4340
|
agent: a.agent,
|
|
4333
4341
|
"show-status": !0,
|
|
4334
4342
|
rounded: "full",
|
|
4335
4343
|
class: "size-10"
|
|
4336
4344
|
}, null, 8, ["agent"]),
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4345
|
+
y("div", ul, [
|
|
4346
|
+
y("div", dl, W(a.agent.displayName.value), 1),
|
|
4347
|
+
y("div", hl, W(a.agent.title.value || "Assistant"), 1)
|
|
4340
4348
|
]),
|
|
4341
|
-
a.headerMeta ? (h(), f("span", pl,
|
|
4349
|
+
a.headerMeta ? (h(), f("span", pl, W(a.headerMeta), 1)) : G("", !0)
|
|
4342
4350
|
])
|
|
4343
|
-
])) :
|
|
4344
|
-
|
|
4351
|
+
])) : G("", !0) : (h(), f("div", ll, [
|
|
4352
|
+
Je(ja, {
|
|
4345
4353
|
agent: a.agent,
|
|
4346
|
-
"is-online":
|
|
4354
|
+
"is-online": A.value
|
|
4347
4355
|
}, null, 8, ["agent", "is-online"])
|
|
4348
4356
|
])),
|
|
4349
4357
|
w.value ? (h(), f("div", {
|
|
4350
4358
|
key: 2,
|
|
4351
|
-
class:
|
|
4359
|
+
class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", c.value ? "text-theme-400" : "text-white/60"])
|
|
4352
4360
|
}, [
|
|
4353
|
-
|
|
4354
|
-
class:
|
|
4361
|
+
y("i", {
|
|
4362
|
+
class: _(["i-heroicons-cloud-arrow-down size-8", c.value ? "text-theme-300" : "text-white/40"])
|
|
4355
4363
|
}, null, 2),
|
|
4356
|
-
|
|
4357
|
-
], 2)) :
|
|
4364
|
+
y("span", null, W(E.value), 1)
|
|
4365
|
+
], 2)) : C.value ? (h(), f("div", {
|
|
4358
4366
|
key: 3,
|
|
4359
|
-
class:
|
|
4367
|
+
class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", c.value ? "text-theme-400" : "text-theme-600"])
|
|
4360
4368
|
}, [
|
|
4361
|
-
|
|
4369
|
+
Je(cs, { class: "size-4" })
|
|
4362
4370
|
], 2)) : a.setupHint ? (h(), f("div", {
|
|
4363
4371
|
key: 4,
|
|
4364
|
-
class:
|
|
4372
|
+
class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", L.value])
|
|
4365
4373
|
}, [
|
|
4366
|
-
v[18] || (v[18] =
|
|
4367
|
-
|
|
4368
|
-
], 2)) :
|
|
4369
|
-
|
|
4374
|
+
v[18] || (v[18] = y("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
4375
|
+
y("span", null, W(a.setupHint), 1)
|
|
4376
|
+
], 2)) : G("", !0),
|
|
4377
|
+
Je(il, {
|
|
4370
4378
|
ref_key: "chatScroller",
|
|
4371
4379
|
ref: i,
|
|
4372
4380
|
class: "flex-1"
|
|
4373
4381
|
}, {
|
|
4374
|
-
default:
|
|
4375
|
-
|
|
4376
|
-
class:
|
|
4382
|
+
default: zs(() => [
|
|
4383
|
+
y("div", {
|
|
4384
|
+
class: _($.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")
|
|
4377
4385
|
}, [
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4386
|
+
$.value.length === 0 && !C.value && !w.value ? (h(), f("div", fl, [
|
|
4387
|
+
y("div", ml, [
|
|
4388
|
+
y("img", {
|
|
4381
4389
|
src: a.agent.avatarUrl.value,
|
|
4382
4390
|
alt: a.agent.displayName.value,
|
|
4383
|
-
class:
|
|
4391
|
+
class: _(["size-full rounded-full object-cover ring-1", c.value ? "ring-black/5" : "ring-white/10"])
|
|
4384
4392
|
}, null, 10, gl),
|
|
4385
|
-
|
|
4393
|
+
A.value ? (h(), f("span", {
|
|
4386
4394
|
key: 0,
|
|
4387
|
-
class:
|
|
4395
|
+
class: _(["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", c.value ? "bg-white" : "bg-theme-900"])
|
|
4388
4396
|
}, [...v[19] || (v[19] = [
|
|
4389
|
-
|
|
4390
|
-
])], 2)) :
|
|
4397
|
+
y("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
4398
|
+
])], 2)) : G("", !0)
|
|
4391
4399
|
]),
|
|
4392
|
-
|
|
4393
|
-
class:
|
|
4394
|
-
},
|
|
4395
|
-
|
|
4396
|
-
class:
|
|
4397
|
-
},
|
|
4398
|
-
|
|
4399
|
-
class:
|
|
4400
|
+
y("div", {
|
|
4401
|
+
class: _(["text-base @sm/chat:text-lg font-semibold", c.value ? "text-theme-900" : "text-white"])
|
|
4402
|
+
}, W(a.agent.displayName.value), 3),
|
|
4403
|
+
y("p", {
|
|
4404
|
+
class: _(["mt-1 text-center text-xs @sm/chat:text-sm", L.value])
|
|
4405
|
+
}, W(a.emptyStateMessage || "Type your message to get started."), 3),
|
|
4406
|
+
y("div", {
|
|
4407
|
+
class: _(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", c.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
4400
4408
|
title: e.value.tooltip
|
|
4401
4409
|
}, [
|
|
4402
|
-
|
|
4403
|
-
class:
|
|
4410
|
+
y("i", {
|
|
4411
|
+
class: _([e.value.icon, "size-3"])
|
|
4404
4412
|
}, null, 2),
|
|
4405
|
-
|
|
4413
|
+
y("span", null, W(e.value.label), 1)
|
|
4406
4414
|
], 10, vl)
|
|
4407
|
-
])) :
|
|
4408
|
-
(h(!0), f(se, null, ve(
|
|
4409
|
-
key:
|
|
4415
|
+
])) : G("", !0),
|
|
4416
|
+
(h(!0), f(se, null, ve($.value, (b, Z) => (h(), f(se, {
|
|
4417
|
+
key: b.id
|
|
4410
4418
|
}, [
|
|
4411
|
-
qe(
|
|
4412
|
-
|
|
4413
|
-
class:
|
|
4419
|
+
qe($.value, Z) ? (h(), f("div", xl, [
|
|
4420
|
+
y("div", {
|
|
4421
|
+
class: _(["flex-1 h-px", M.value])
|
|
4414
4422
|
}, null, 2),
|
|
4415
|
-
|
|
4416
|
-
class:
|
|
4417
|
-
},
|
|
4418
|
-
|
|
4419
|
-
class:
|
|
4423
|
+
y("span", {
|
|
4424
|
+
class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", L.value])
|
|
4425
|
+
}, W(qe($.value, Z)), 3),
|
|
4426
|
+
y("div", {
|
|
4427
|
+
class: _(["flex-1 h-px", M.value])
|
|
4420
4428
|
}, null, 2)
|
|
4421
|
-
])) :
|
|
4422
|
-
|
|
4429
|
+
])) : G("", !0),
|
|
4430
|
+
F(b) ? (h(), f("div", {
|
|
4423
4431
|
key: 1,
|
|
4432
|
+
"data-test": "messaging-message-tool-activity",
|
|
4433
|
+
"data-journal-outcome": F(b)?.outcome,
|
|
4434
|
+
class: "mb-3 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
|
|
4435
|
+
}, [
|
|
4436
|
+
Je(fs, {
|
|
4437
|
+
model: F(b),
|
|
4438
|
+
"is-light": c.value
|
|
4439
|
+
}, null, 8, ["model", "is-light"])
|
|
4440
|
+
], 8, bl)) : G("", !0),
|
|
4441
|
+
p(b) ? (h(), f("div", {
|
|
4442
|
+
key: 2,
|
|
4424
4443
|
"data-test": "messaging-system-msg",
|
|
4425
|
-
"data-message-id":
|
|
4426
|
-
"data-message-sender":
|
|
4427
|
-
"data-conversation-id":
|
|
4428
|
-
"data-message-sequence":
|
|
4429
|
-
"data-system-kind":
|
|
4430
|
-
"data-issue-code":
|
|
4431
|
-
"data-issue-bucket":
|
|
4432
|
-
"data-issue-action-label":
|
|
4433
|
-
"data-issue-action-url":
|
|
4434
|
-
"data-streaming":
|
|
4444
|
+
"data-message-id": b.id,
|
|
4445
|
+
"data-message-sender": b.sender,
|
|
4446
|
+
"data-conversation-id": b.conversationId,
|
|
4447
|
+
"data-message-sequence": b.sequence,
|
|
4448
|
+
"data-system-kind": b.systemKind,
|
|
4449
|
+
"data-issue-code": b.issue?.code,
|
|
4450
|
+
"data-issue-bucket": b.issue?.bucket,
|
|
4451
|
+
"data-issue-action-label": b.issue?.actionLabel,
|
|
4452
|
+
"data-issue-action-url": b.issue?.actionUrl,
|
|
4453
|
+
"data-streaming": b.id === $e.value ? "true" : void 0,
|
|
4435
4454
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
4436
4455
|
}, [
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
class:
|
|
4456
|
+
y("div", kl, [
|
|
4457
|
+
y("div", {
|
|
4458
|
+
class: _(["mb-1 pl-1 text-[11px] font-medium", c.value ? "text-theme-500" : "text-white/45"])
|
|
4440
4459
|
}, " System Message ", 2),
|
|
4441
|
-
|
|
4442
|
-
class:
|
|
4460
|
+
y("div", {
|
|
4461
|
+
class: _(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", c.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
|
|
4443
4462
|
}, [
|
|
4444
|
-
|
|
4463
|
+
b.text ? (h(), mt(ln, {
|
|
4445
4464
|
key: 0,
|
|
4446
|
-
text:
|
|
4465
|
+
text: b.text,
|
|
4447
4466
|
inverted: !c.value,
|
|
4448
|
-
streaming:
|
|
4467
|
+
streaming: b.id === $e.value,
|
|
4449
4468
|
onClick: v[0] || (v[0] = Oe(() => {
|
|
4450
4469
|
}, ["stop"]))
|
|
4451
|
-
}, null, 8, ["text", "inverted", "streaming"])) :
|
|
4470
|
+
}, null, 8, ["text", "inverted", "streaming"])) : b.issue?.help ? (h(), mt(ln, {
|
|
4452
4471
|
key: 1,
|
|
4453
|
-
text:
|
|
4472
|
+
text: b.issue.help,
|
|
4454
4473
|
inverted: !c.value
|
|
4455
|
-
}, null, 8, ["text", "inverted"])) :
|
|
4456
|
-
|
|
4474
|
+
}, null, 8, ["text", "inverted"])) : G("", !0),
|
|
4475
|
+
b.issue?.actionUrl && !o(b.text) ? (h(), f("a", {
|
|
4457
4476
|
key: 2,
|
|
4458
|
-
href:
|
|
4477
|
+
href: b.issue.actionUrl,
|
|
4459
4478
|
"data-test": "messaging-system-msg-action",
|
|
4460
|
-
class:
|
|
4479
|
+
class: _(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", c.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
4461
4480
|
onClick: v[1] || (v[1] = Oe(() => {
|
|
4462
4481
|
}, ["stop"]))
|
|
4463
4482
|
}, [
|
|
4464
|
-
nt(
|
|
4465
|
-
v[20] || (v[20] =
|
|
4466
|
-
], 10,
|
|
4483
|
+
nt(W(b.issue.actionLabel) + " ", 1),
|
|
4484
|
+
v[20] || (v[20] = y("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
4485
|
+
], 10, wl)) : G("", !0)
|
|
4467
4486
|
], 2)
|
|
4468
4487
|
])
|
|
4469
|
-
], 8,
|
|
4470
|
-
key:
|
|
4488
|
+
], 8, yl)) : b.sender === "system" ? (h(), f("div", {
|
|
4489
|
+
key: 3,
|
|
4471
4490
|
"data-test": "messaging-system-status-msg",
|
|
4472
|
-
"data-message-id":
|
|
4473
|
-
"data-message-sender":
|
|
4474
|
-
"data-conversation-id":
|
|
4475
|
-
"data-message-sequence":
|
|
4476
|
-
"data-system-kind":
|
|
4477
|
-
"data-issue-code":
|
|
4478
|
-
"data-issue-bucket":
|
|
4479
|
-
"data-streaming":
|
|
4480
|
-
class:
|
|
4491
|
+
"data-message-id": b.id,
|
|
4492
|
+
"data-message-sender": b.sender,
|
|
4493
|
+
"data-conversation-id": b.conversationId,
|
|
4494
|
+
"data-message-sequence": b.sequence,
|
|
4495
|
+
"data-system-kind": b.systemKind,
|
|
4496
|
+
"data-issue-code": b.issue?.code,
|
|
4497
|
+
"data-issue-bucket": b.issue?.bucket,
|
|
4498
|
+
"data-streaming": b.id === $e.value ? "true" : void 0,
|
|
4499
|
+
class: _(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", c.value ? "text-theme-500" : "text-white/60"])
|
|
4481
4500
|
}, [
|
|
4482
|
-
v[21] || (v[21] =
|
|
4483
|
-
|
|
4484
|
-
text:
|
|
4501
|
+
v[21] || (v[21] = y("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
|
|
4502
|
+
Je(ln, {
|
|
4503
|
+
text: b.text,
|
|
4485
4504
|
inverted: !c.value,
|
|
4486
4505
|
onClick: v[2] || (v[2] = Oe(() => {
|
|
4487
4506
|
}, ["stop"]))
|
|
4488
4507
|
}, null, 8, ["text", "inverted"])
|
|
4489
|
-
], 10,
|
|
4490
|
-
key:
|
|
4491
|
-
"data-test":
|
|
4492
|
-
"data-message-id":
|
|
4493
|
-
"data-message-sender":
|
|
4494
|
-
"data-conversation-id":
|
|
4495
|
-
"data-message-sequence":
|
|
4496
|
-
"data-system-kind":
|
|
4497
|
-
"data-streaming":
|
|
4498
|
-
class:
|
|
4499
|
-
"justify-end":
|
|
4500
|
-
"justify-start":
|
|
4508
|
+
], 10, Tl)) : (h(), f("div", {
|
|
4509
|
+
key: 4,
|
|
4510
|
+
"data-test": b.sender === "agent" ? "messaging-assistant-msg" : b.sender === "user" ? "messaging-user-msg" : void 0,
|
|
4511
|
+
"data-message-id": b.id,
|
|
4512
|
+
"data-message-sender": b.sender,
|
|
4513
|
+
"data-conversation-id": b.conversationId,
|
|
4514
|
+
"data-message-sequence": b.sequence,
|
|
4515
|
+
"data-system-kind": b.systemKind,
|
|
4516
|
+
"data-streaming": b.id === $e.value ? "true" : void 0,
|
|
4517
|
+
class: _(["flex gap-2 items-end", {
|
|
4518
|
+
"justify-end": b.sender === "user",
|
|
4519
|
+
"justify-start": b.sender === "agent",
|
|
4501
4520
|
// Group-aware rhythm: tight (space-y) within a speaker's turn,
|
|
4502
4521
|
// generous at the boundary between speakers (end of a group).
|
|
4503
|
-
"mb-6": d(
|
|
4522
|
+
"mb-6": d($.value, Z)
|
|
4504
4523
|
}])
|
|
4505
4524
|
}, [
|
|
4506
|
-
|
|
4507
|
-
d(
|
|
4525
|
+
b.sender === "agent" ? (h(), f("div", Al, [
|
|
4526
|
+
d($.value, Z) ? (h(), f("img", {
|
|
4508
4527
|
key: 0,
|
|
4509
4528
|
src: a.agent.avatarUrl.value,
|
|
4510
4529
|
alt: a.agent.displayName.value,
|
|
4511
|
-
class:
|
|
4512
|
-
}, null, 10,
|
|
4513
|
-
])) :
|
|
4514
|
-
|
|
4530
|
+
class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", c.value ? "ring-1 ring-black/5" : ""])
|
|
4531
|
+
}, null, 10, El)) : G("", !0)
|
|
4532
|
+
])) : G("", !0),
|
|
4533
|
+
y("div", {
|
|
4515
4534
|
"data-test": "messaging-message-body",
|
|
4516
|
-
class:
|
|
4535
|
+
class: _(b.sender === "user" ? "max-w-[min(75%,22rem)]" : "max-w-[min(82%,68ch)]")
|
|
4517
4536
|
}, [
|
|
4518
|
-
|
|
4537
|
+
re(b).length ? (h(), f("div", {
|
|
4519
4538
|
key: 0,
|
|
4520
|
-
"
|
|
4521
|
-
"data-journal-outcome": U(y)?.outcome,
|
|
4522
|
-
class: "mb-3 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
|
|
4539
|
+
class: _(["mb-1 space-y-1", b.sender === "user" ? "flex flex-col items-end" : ""])
|
|
4523
4540
|
}, [
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
"is-light": c.value
|
|
4527
|
-
}, null, 8, ["model", "is-light"])
|
|
4528
|
-
], 8, El)) : W("", !0),
|
|
4529
|
-
he(y).length ? (h(), f("div", {
|
|
4530
|
-
key: 1,
|
|
4531
|
-
class: R(["mb-1 space-y-1", y.sender === "user" ? "flex flex-col items-end" : ""])
|
|
4532
|
-
}, [
|
|
4533
|
-
(h(!0), f(se, null, ve(he(y), ({ attachment: F, index: ae }) => (h(), f(se, {
|
|
4534
|
-
key: V(F, ae)
|
|
4541
|
+
(h(!0), f(se, null, ve(re(b), ({ attachment: U, index: ae }) => (h(), f(se, {
|
|
4542
|
+
key: j(U, ae)
|
|
4535
4543
|
}, [
|
|
4536
|
-
|
|
4544
|
+
U.type === "image" ? (h(), f("img", {
|
|
4537
4545
|
key: 0,
|
|
4538
|
-
src:
|
|
4539
|
-
alt:
|
|
4546
|
+
src: U.src,
|
|
4547
|
+
alt: U.filename,
|
|
4540
4548
|
"data-test": "messaging-attachment",
|
|
4541
4549
|
"data-attachment-placement": "block",
|
|
4542
4550
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4543
|
-
}, null, 8, _l)) :
|
|
4551
|
+
}, null, 8, _l)) : U.type === "audio" ? (h(), f("audio", {
|
|
4544
4552
|
key: 1,
|
|
4545
|
-
src:
|
|
4553
|
+
src: U.src,
|
|
4546
4554
|
controls: "",
|
|
4547
4555
|
"data-test": "messaging-attachment",
|
|
4548
4556
|
"data-attachment-placement": "block",
|
|
4549
4557
|
class: "max-w-full"
|
|
4550
4558
|
}, null, 8, Rl)) : (h(), f("a", {
|
|
4551
4559
|
key: 2,
|
|
4552
|
-
href:
|
|
4560
|
+
href: U.src,
|
|
4553
4561
|
target: "_blank",
|
|
4554
4562
|
rel: "noopener",
|
|
4555
4563
|
"data-test": "messaging-attachment",
|
|
4556
4564
|
"data-attachment-placement": "block",
|
|
4557
|
-
class:
|
|
4565
|
+
class: _(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", c.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
4558
4566
|
}, [
|
|
4559
|
-
v[22] || (v[22] =
|
|
4560
|
-
nt(" " +
|
|
4567
|
+
v[22] || (v[22] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
4568
|
+
nt(" " + W(U.filename), 1)
|
|
4561
4569
|
], 10, Cl))
|
|
4562
4570
|
], 64))), 128))
|
|
4563
|
-
], 2)) :
|
|
4564
|
-
Ie(
|
|
4565
|
-
key:
|
|
4571
|
+
], 2)) : G("", !0),
|
|
4572
|
+
Ie(b).length ? (h(), f("div", {
|
|
4573
|
+
key: 1,
|
|
4566
4574
|
"data-test": "messaging-message-content",
|
|
4567
|
-
class:
|
|
4568
|
-
|
|
4575
|
+
class: _(
|
|
4576
|
+
b.sender === "user" ? c.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" : c.value ? "text-theme-800" : "text-white/95"
|
|
4569
4577
|
)
|
|
4570
4578
|
}, [
|
|
4571
|
-
(h(!0), f(se, null, ve(Ie(
|
|
4572
|
-
key:
|
|
4579
|
+
(h(!0), f(se, null, ve(Ie(b), (U) => (h(), f(se, {
|
|
4580
|
+
key: U.key
|
|
4573
4581
|
}, [
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
text:
|
|
4577
|
-
inverted:
|
|
4578
|
-
streaming:
|
|
4582
|
+
U.kind === "text" && U.text ? (h(), f("div", Ml, [
|
|
4583
|
+
Je(ln, {
|
|
4584
|
+
text: U.text,
|
|
4585
|
+
inverted: b.sender === "user" || !c.value,
|
|
4586
|
+
streaming: b.id === $e.value,
|
|
4579
4587
|
onClick: v[3] || (v[3] = Oe(() => {
|
|
4580
4588
|
}, ["stop"]))
|
|
4581
4589
|
}, null, 8, ["text", "inverted", "streaming"])
|
|
4582
|
-
])) :
|
|
4590
|
+
])) : U.kind === "attachment" && U.attachment.type === "image" ? (h(), f("img", {
|
|
4583
4591
|
key: 1,
|
|
4584
|
-
src:
|
|
4585
|
-
alt:
|
|
4592
|
+
src: U.attachment.src,
|
|
4593
|
+
alt: U.attachment.filename,
|
|
4586
4594
|
"data-test": "messaging-attachment",
|
|
4587
|
-
"data-attachment-placement":
|
|
4595
|
+
"data-attachment-placement": U.placement,
|
|
4588
4596
|
class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4589
|
-
}, null, 8, Il)) :
|
|
4597
|
+
}, null, 8, Il)) : U.kind === "attachment" && U.attachment.type === "audio" ? (h(), f("audio", {
|
|
4590
4598
|
key: 2,
|
|
4591
|
-
src:
|
|
4599
|
+
src: U.attachment.src,
|
|
4592
4600
|
controls: "",
|
|
4593
4601
|
"data-test": "messaging-attachment",
|
|
4594
|
-
"data-attachment-placement":
|
|
4602
|
+
"data-attachment-placement": U.placement,
|
|
4595
4603
|
class: "my-2 max-w-full"
|
|
4596
|
-
}, null, 8, $l)) :
|
|
4604
|
+
}, null, 8, $l)) : U.kind === "attachment" ? (h(), f("a", {
|
|
4597
4605
|
key: 3,
|
|
4598
|
-
href:
|
|
4606
|
+
href: U.attachment.src,
|
|
4599
4607
|
target: "_blank",
|
|
4600
4608
|
rel: "noopener",
|
|
4601
4609
|
"data-test": "messaging-attachment",
|
|
4602
|
-
"data-attachment-placement":
|
|
4603
|
-
class:
|
|
4610
|
+
"data-attachment-placement": U.placement,
|
|
4611
|
+
class: _(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", c.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
4604
4612
|
}, [
|
|
4605
|
-
v[23] || (v[23] =
|
|
4606
|
-
nt(" " +
|
|
4607
|
-
], 10, Dl)) :
|
|
4613
|
+
v[23] || (v[23] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
4614
|
+
nt(" " + W(U.attachment.filename), 1)
|
|
4615
|
+
], 10, Dl)) : G("", !0)
|
|
4608
4616
|
], 64))), 128))
|
|
4609
|
-
], 2)) :
|
|
4617
|
+
], 2)) : G("", !0)
|
|
4610
4618
|
], 2)
|
|
4611
|
-
], 10,
|
|
4612
|
-
|
|
4613
|
-
key:
|
|
4614
|
-
|
|
4615
|
-
"
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
class: "mb-3 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
|
|
4624
|
-
}, [
|
|
4625
|
-
Qe(ms, {
|
|
4626
|
-
model: S.value,
|
|
4627
|
-
"is-light": c.value
|
|
4628
|
-
}, null, 8, ["model", "is-light"])
|
|
4629
|
-
], 8, Ll)
|
|
4630
|
-
]),
|
|
4631
|
-
_: 1
|
|
4632
|
-
})) : W("", !0)
|
|
4619
|
+
], 10, Sl)),
|
|
4620
|
+
D.value && b.id === N.value ? (h(), f("div", {
|
|
4621
|
+
key: 5,
|
|
4622
|
+
"data-test": "messaging-tool-activity",
|
|
4623
|
+
"data-journal-outcome": D.value.outcome,
|
|
4624
|
+
class: "mb-3 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
|
|
4625
|
+
}, [
|
|
4626
|
+
Je(fs, {
|
|
4627
|
+
model: D.value,
|
|
4628
|
+
"is-light": c.value
|
|
4629
|
+
}, null, 8, ["model", "is-light"])
|
|
4630
|
+
], 8, Ll)) : G("", !0)
|
|
4633
4631
|
], 64))), 128)),
|
|
4634
|
-
|
|
4632
|
+
Q.value ? (h(), f("div", {
|
|
4635
4633
|
key: 1,
|
|
4636
4634
|
"data-test": "messaging-working-state",
|
|
4637
|
-
"data-working-description":
|
|
4638
|
-
class:
|
|
4635
|
+
"data-working-description": Q.value,
|
|
4636
|
+
class: _(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", c.value ? "text-theme-500" : "text-white/45"])
|
|
4639
4637
|
}, [
|
|
4640
|
-
v[24] || (v[24] =
|
|
4638
|
+
v[24] || (v[24] = y("i", {
|
|
4641
4639
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
4642
4640
|
"aria-hidden": "true"
|
|
4643
4641
|
}, null, -1)),
|
|
4644
|
-
|
|
4645
|
-
], 10, Ol)) :
|
|
4646
|
-
|
|
4642
|
+
y("span", zl, W(Q.value), 1)
|
|
4643
|
+
], 10, Ol)) : G("", !0),
|
|
4644
|
+
ue.value ? (h(), f("div", {
|
|
4647
4645
|
key: 2,
|
|
4648
4646
|
"data-test": "messaging-transient-issue",
|
|
4649
|
-
"data-issue-code":
|
|
4650
|
-
class:
|
|
4647
|
+
"data-issue-code": ue.value.code,
|
|
4648
|
+
class: _(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", c.value ? "text-theme-600" : "text-white/60"])
|
|
4651
4649
|
}, [
|
|
4652
|
-
v[25] || (v[25] =
|
|
4650
|
+
v[25] || (v[25] = y("i", {
|
|
4653
4651
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
4654
4652
|
"aria-hidden": "true"
|
|
4655
4653
|
}, null, -1)),
|
|
4656
|
-
|
|
4657
|
-
nt(
|
|
4658
|
-
|
|
4659
|
-
nt(
|
|
4660
|
-
], 64)) :
|
|
4654
|
+
y("span", null, [
|
|
4655
|
+
nt(W(ue.value.message), 1),
|
|
4656
|
+
ue.value.help ? (h(), f(se, { key: 0 }, [
|
|
4657
|
+
nt(W(ue.value.help), 1)
|
|
4658
|
+
], 64)) : G("", !0)
|
|
4661
4659
|
]),
|
|
4662
|
-
|
|
4660
|
+
ue.value.actionUrl && ue.value.actionLabel ? (h(), f("a", {
|
|
4663
4661
|
key: 0,
|
|
4664
|
-
href:
|
|
4662
|
+
href: ue.value.actionUrl,
|
|
4665
4663
|
class: "shrink-0 underline underline-offset-2",
|
|
4666
4664
|
onClick: v[4] || (v[4] = Oe(() => {
|
|
4667
4665
|
}, ["stop"]))
|
|
4668
|
-
},
|
|
4669
|
-
], 10, Nl)) :
|
|
4670
|
-
|
|
4671
|
-
|
|
4666
|
+
}, W(ue.value.actionLabel), 9, Pl)) : G("", !0)
|
|
4667
|
+
], 10, Nl)) : G("", !0),
|
|
4668
|
+
xt.value ? (h(), f("div", Fl, [
|
|
4669
|
+
y("img", {
|
|
4672
4670
|
src: a.agent.avatarUrl.value,
|
|
4673
4671
|
alt: a.agent.displayName.value,
|
|
4674
|
-
class:
|
|
4675
|
-
}, null, 10,
|
|
4676
|
-
|
|
4677
|
-
class:
|
|
4672
|
+
class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", c.value ? "ring-1 ring-black/5" : ""])
|
|
4673
|
+
}, null, 10, Bl),
|
|
4674
|
+
y("i", {
|
|
4675
|
+
class: _(["i-svg-spinners-3-dots-bounce size-7", c.value ? "text-theme-400" : "text-white/50"]),
|
|
4678
4676
|
"aria-hidden": "true"
|
|
4679
4677
|
}, null, 2)
|
|
4680
|
-
])) :
|
|
4678
|
+
])) : G("", !0)
|
|
4681
4679
|
], 2)
|
|
4682
4680
|
]),
|
|
4683
4681
|
_: 1
|
|
4684
4682
|
}, 512),
|
|
4685
|
-
|
|
4686
|
-
class:
|
|
4683
|
+
y("div", {
|
|
4684
|
+
class: _(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", c.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"])
|
|
4687
4685
|
}, [
|
|
4688
|
-
|
|
4689
|
-
(h(!0), f(se, null, ve(
|
|
4686
|
+
bt.value.length > 0 ? (h(), f("div", Ul, [
|
|
4687
|
+
(h(!0), f(se, null, ve(bt.value, (b, Z) => (h(), f("div", {
|
|
4690
4688
|
key: Z,
|
|
4691
4689
|
class: "relative shrink-0 group"
|
|
4692
4690
|
}, [
|
|
4693
|
-
|
|
4691
|
+
b.type === "image" ? (h(), f("img", {
|
|
4694
4692
|
key: 0,
|
|
4695
|
-
src:
|
|
4696
|
-
alt:
|
|
4697
|
-
class:
|
|
4693
|
+
src: b.src,
|
|
4694
|
+
alt: b.filename,
|
|
4695
|
+
class: _(["size-14 rounded-xl object-cover border", c.value ? "border-black/10" : "border-white/20"])
|
|
4698
4696
|
}, null, 10, Hl)) : (h(), f("div", {
|
|
4699
4697
|
key: 1,
|
|
4700
|
-
class:
|
|
4698
|
+
class: _(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", c.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
4701
4699
|
}, [
|
|
4702
|
-
v[26] || (v[26] =
|
|
4703
|
-
|
|
4700
|
+
v[26] || (v[26] = y("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
4701
|
+
y("span", jl, W(b.filename), 1)
|
|
4704
4702
|
], 2)),
|
|
4705
|
-
|
|
4703
|
+
y("button", {
|
|
4706
4704
|
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",
|
|
4707
|
-
onClick: /* @__PURE__ */ u((
|
|
4705
|
+
onClick: /* @__PURE__ */ u((U) => Te(Z), "onClick")
|
|
4708
4706
|
}, [...v[27] || (v[27] = [
|
|
4709
|
-
|
|
4707
|
+
y("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
4710
4708
|
])], 8, Wl)
|
|
4711
4709
|
]))), 128)),
|
|
4712
4710
|
Ee.value ? (h(), f("div", Gl, [
|
|
4713
|
-
|
|
4714
|
-
])) :
|
|
4715
|
-
])) :
|
|
4711
|
+
Je(cs, { class: "size-5" })
|
|
4712
|
+
])) : G("", !0)
|
|
4713
|
+
])) : G("", !0),
|
|
4716
4714
|
ke.value ? (h(), f("input", {
|
|
4717
4715
|
key: 1,
|
|
4718
4716
|
ref_key: "fileInput",
|
|
@@ -4721,89 +4719,89 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4721
4719
|
accept: "image/*,audio/*,video/*",
|
|
4722
4720
|
class: "hidden",
|
|
4723
4721
|
onChange: fe
|
|
4724
|
-
}, null, 544)) :
|
|
4725
|
-
|
|
4722
|
+
}, null, 544)) : G("", !0),
|
|
4723
|
+
y("div", {
|
|
4726
4724
|
"data-test": "messaging-composer",
|
|
4727
4725
|
"data-composer-action": X.value,
|
|
4728
|
-
class:
|
|
4726
|
+
class: _(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", c.value ? n.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : n.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
|
|
4729
4727
|
}, [
|
|
4730
|
-
|
|
4731
|
-
class:
|
|
4728
|
+
y("button", {
|
|
4729
|
+
class: _(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
4732
4730
|
ke.value ? "cursor-pointer" : "cursor-default",
|
|
4733
4731
|
c.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
4734
4732
|
Ee.value || We.value ? "opacity-50 pointer-events-none" : ""
|
|
4735
4733
|
]]),
|
|
4736
|
-
disabled:
|
|
4734
|
+
disabled: ce.value || Ee.value || We.value || !ke.value,
|
|
4737
4735
|
"aria-label": ke.value ? "Attach file" : "File attachments unavailable",
|
|
4738
4736
|
title: ke.value ? "Attach file" : "File attachments unavailable",
|
|
4739
|
-
onClick: v[5] || (v[5] = (
|
|
4737
|
+
onClick: v[5] || (v[5] = (b) => ke.value && de())
|
|
4740
4738
|
}, [
|
|
4741
4739
|
Ee.value ? (h(), f("i", Kl)) : (h(), f("i", Yl)),
|
|
4742
|
-
|
|
4740
|
+
y("span", Xl, W(ke.value ? "Attach file" : "File attachments unavailable"), 1)
|
|
4743
4741
|
], 10, ql),
|
|
4744
4742
|
te.value ? (h(), f("div", {
|
|
4745
4743
|
key: 1,
|
|
4746
4744
|
"data-test": "messaging-recording-state",
|
|
4747
|
-
class:
|
|
4745
|
+
class: _(["flex min-w-0 flex-1 items-center gap-2 px-1 py-2", c.value ? "text-theme-700" : "text-white/80"])
|
|
4748
4746
|
}, [
|
|
4749
|
-
v[28] || (v[28] =
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
class:
|
|
4753
|
-
},
|
|
4754
|
-
], 2)) :
|
|
4747
|
+
v[28] || (v[28] = y("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
4748
|
+
y("span", Jl, W(Ve.value), 1),
|
|
4749
|
+
y("span", {
|
|
4750
|
+
class: _(["min-w-0 truncate text-sm", c.value ? "text-theme-400" : "text-white/45"])
|
|
4751
|
+
}, W(g.value), 3)
|
|
4752
|
+
], 2)) : Ns((h(), f("textarea", {
|
|
4755
4753
|
key: 0,
|
|
4756
4754
|
ref_key: "textarea",
|
|
4757
4755
|
ref: s,
|
|
4758
|
-
"onUpdate:modelValue": v[6] || (v[6] = (
|
|
4756
|
+
"onUpdate:modelValue": v[6] || (v[6] = (b) => je.value = b),
|
|
4759
4757
|
"data-test": "messaging-input",
|
|
4760
4758
|
rows: "1",
|
|
4761
4759
|
enterkeyhint: "send",
|
|
4762
4760
|
placeholder: at.value,
|
|
4763
|
-
disabled:
|
|
4761
|
+
disabled: ce.value,
|
|
4764
4762
|
style: { fontSize: "16px", resize: "none" },
|
|
4765
|
-
class:
|
|
4766
|
-
onKeydown:
|
|
4767
|
-
onFocus: v[7] || (v[7] = (
|
|
4768
|
-
onBlur: v[8] || (v[8] = (
|
|
4763
|
+
class: _(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", c.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
4764
|
+
onKeydown: le,
|
|
4765
|
+
onFocus: v[7] || (v[7] = (b) => n.value = !0),
|
|
4766
|
+
onBlur: v[8] || (v[8] = (b) => n.value = !1)
|
|
4769
4767
|
}, null, 42, Zl)), [
|
|
4770
4768
|
[xa, je.value]
|
|
4771
4769
|
]),
|
|
4772
4770
|
rt.value || te.value ? (h(), f("button", {
|
|
4773
4771
|
key: 2,
|
|
4774
4772
|
"data-test": "messaging-record-audio-btn",
|
|
4775
|
-
class:
|
|
4776
|
-
"aria-label":
|
|
4777
|
-
title:
|
|
4778
|
-
onPointerdown: v[9] || (v[9] = Oe((
|
|
4779
|
-
onPointerup: v[10] || (v[10] = Oe((
|
|
4780
|
-
onPointercancel: v[11] || (v[11] = Oe((
|
|
4773
|
+
class: _(["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", te.value ? "bg-theme-900 text-theme-0 scale-105 cursor-pointer" : c.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"]),
|
|
4774
|
+
"aria-label": S.value,
|
|
4775
|
+
title: S.value,
|
|
4776
|
+
onPointerdown: v[9] || (v[9] = Oe((b) => De(), ["prevent"])),
|
|
4777
|
+
onPointerup: v[10] || (v[10] = Oe((b) => _e({ cancelled: !1 }), ["prevent"])),
|
|
4778
|
+
onPointercancel: v[11] || (v[11] = Oe((b) => _e({ cancelled: !0 }), ["prevent"])),
|
|
4781
4779
|
onKeydown: [
|
|
4782
|
-
v[12] || (v[12] =
|
|
4783
|
-
v[14] || (v[14] =
|
|
4784
|
-
v[16] || (v[16] =
|
|
4780
|
+
v[12] || (v[12] = Bt(Oe((b) => De(), ["prevent"]), ["enter"])),
|
|
4781
|
+
v[14] || (v[14] = Bt(Oe((b) => De(), ["prevent"]), ["space"])),
|
|
4782
|
+
v[16] || (v[16] = Bt(Oe((b) => _e({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
4785
4783
|
],
|
|
4786
4784
|
onKeyup: [
|
|
4787
|
-
v[13] || (v[13] =
|
|
4788
|
-
v[15] || (v[15] =
|
|
4785
|
+
v[13] || (v[13] = Bt(Oe((b) => _e({ cancelled: !1 }), ["prevent"]), ["enter"])),
|
|
4786
|
+
v[15] || (v[15] = Bt(Oe((b) => _e({ cancelled: !1 }), ["prevent"]), ["space"]))
|
|
4789
4787
|
]
|
|
4790
4788
|
}, [
|
|
4791
|
-
|
|
4792
|
-
class:
|
|
4789
|
+
y("i", {
|
|
4790
|
+
class: _([te.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-5"])
|
|
4793
4791
|
}, null, 2),
|
|
4794
|
-
|
|
4795
|
-
], 42,
|
|
4792
|
+
y("span", eo, W(S.value), 1)
|
|
4793
|
+
], 42, Ql)) : (h(), f("button", {
|
|
4796
4794
|
key: 3,
|
|
4797
4795
|
"data-test": "messaging-send-btn",
|
|
4798
4796
|
"data-composer-action": X.value,
|
|
4799
|
-
class:
|
|
4797
|
+
class: _(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", it.value ? c.value ? "bg-theme-900 text-theme-0 hover:scale-105 active:scale-95 cursor-pointer" : "bg-theme-0 text-theme-950 hover:scale-105 active:scale-95 cursor-pointer" : c.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
4800
4798
|
disabled: !it.value,
|
|
4801
4799
|
"aria-label": ie.value,
|
|
4802
4800
|
title: ie.value,
|
|
4803
|
-
onClick: v[17] || (v[17] = (
|
|
4801
|
+
onClick: v[17] || (v[17] = (b) => V())
|
|
4804
4802
|
}, [
|
|
4805
4803
|
X.value === "stop" ? (h(), f("i", no)) : (h(), f("i", so)),
|
|
4806
|
-
|
|
4804
|
+
y("span", ao, W(ie.value), 1)
|
|
4807
4805
|
], 10, to))
|
|
4808
4806
|
], 10, Vl)
|
|
4809
4807
|
], 2)
|
|
@@ -4908,7 +4906,7 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4908
4906
|
}
|
|
4909
4907
|
}), (o, p) => (h(), f("div", io, [
|
|
4910
4908
|
i.value ? (h(), f("div", ro, [...p[0] || (p[0] = [
|
|
4911
|
-
|
|
4909
|
+
y("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
|
|
4912
4910
|
])])) : s.value ? fn(o.$slots, "default", {
|
|
4913
4911
|
key: 1,
|
|
4914
4912
|
sdk: on(n),
|
|
@@ -4918,22 +4916,22 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
|
|
|
4918
4916
|
buttonText: a.buttonText,
|
|
4919
4917
|
buttonIcon: a.buttonIcon,
|
|
4920
4918
|
loading: i.value
|
|
4921
|
-
}) :
|
|
4919
|
+
}) : G("", !0)
|
|
4922
4920
|
]));
|
|
4923
4921
|
}
|
|
4924
4922
|
});
|
|
4925
4923
|
export {
|
|
4926
|
-
|
|
4924
|
+
ds as A,
|
|
4927
4925
|
xo as _,
|
|
4928
4926
|
ln as a,
|
|
4929
4927
|
vo as b,
|
|
4930
4928
|
mo as c,
|
|
4931
4929
|
fo as d,
|
|
4932
4930
|
go as e,
|
|
4933
|
-
|
|
4931
|
+
cs as f,
|
|
4934
4932
|
ho as g,
|
|
4935
4933
|
ja as h,
|
|
4936
|
-
|
|
4934
|
+
ps as i,
|
|
4937
4935
|
po as p
|
|
4938
4936
|
};
|
|
4939
4937
|
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map
|