@pagelines/sdk 1.0.914 → 1.0.915
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BotProvider.js +115 -115
- package/dist/BotProvider.js.map +1 -1
- package/dist/BotWidgetModal.js +30 -185
- package/dist/BotWidgetModal.js.map +1 -1
- package/dist/BotWrap.js +1365 -1042
- package/dist/BotWrap.js.map +1 -1
- package/dist/bot/BotController.d.ts +22 -0
- package/dist/bot/index.d.ts +3 -2
- package/dist/bot/ui/ShareReplyDialog.vue.d.ts +14 -0
- package/dist/bot/ui/VoiceMode.vue.d.ts +3 -2
- package/dist/bot/voice/voice-end-copy.d.ts +8 -0
- package/dist/bot/voice/voice-session-client.d.ts +3 -1
- package/dist/bot.js +9 -9
- package/dist/bot.js.map +1 -1
- package/dist/sdk.css +1 -1
- package/dist/widget.js +49 -49
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/BotWrap.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime.js";
|
|
2
2
|
import { c as t, t as n } from "./sdkClient.js";
|
|
3
3
|
import { CUSTOMER_COMPUTER_STATE_LABEL as r, SettingsObject as i, chatTransportError as a, createLogger as o, customerComputerState as s, getDefaultAvatarUrl as c, isAssistantSilenceControl as d, parseChatCardFencePayload as f, parseChatVisualFencePayload as p } from "@pagelines/core";
|
|
4
|
-
import { Fragment as m,
|
|
4
|
+
import { Fragment as m, Teleport as g, Transition as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as w, createTextVNode as T, createVNode as E, defineComponent as D, guardReactiveProps as A, nextTick as ee, normalizeClass as j, normalizeProps as M, normalizeStyle as N, onBeforeUnmount as te, onMounted as ne, onUnmounted as ae, openBlock as R, ref as B, renderList as V, renderSlot as ce, resolveDynamicComponent as H, shallowRef as U, toDisplayString as G, unref as le, useTemplateRef as ue, vModelText as fe, watch as pe, withCtx as me, withDirectives as he, withKeys as ge, withModifiers as K } from "vue";
|
|
5
5
|
//#region \0plugin-vue:export-helper
|
|
6
|
-
var
|
|
6
|
+
var _e = /* @__PURE__ */ e((e, t) => {
|
|
7
7
|
let n = e.__vccOpts || e;
|
|
8
8
|
for (let [e, r] of t) n[e] = r;
|
|
9
9
|
return n;
|
|
10
|
-
}, "default"),
|
|
10
|
+
}, "default"), J = {}, ve = { class: "spinner max-w-sm" };
|
|
11
11
|
function _sfc_render(e, t) {
|
|
12
|
-
return
|
|
12
|
+
return R(), x("div", ve, [...t[0] || (t[0] = [w("svg", {
|
|
13
13
|
class: "ring-circular h-full w-full origin-center",
|
|
14
14
|
viewBox: "25 25 50 50"
|
|
15
|
-
}, [
|
|
15
|
+
}, [w("circle", {
|
|
16
16
|
class: "ring-path",
|
|
17
17
|
cx: "50",
|
|
18
18
|
cy: "50",
|
|
@@ -23,7 +23,7 @@ function _sfc_render(e, t) {
|
|
|
23
23
|
"stroke-miterlimit": "30"
|
|
24
24
|
})], -1)])]);
|
|
25
25
|
}
|
|
26
|
-
var
|
|
26
|
+
var Y = /*#__PURE__*/ _e(J, [["render", _sfc_render]]);
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region bot/VoiceRecorderController.ts
|
|
29
29
|
function formatVoiceRecordingDuration(e) {
|
|
@@ -40,12 +40,12 @@ function recorderMimeType() {
|
|
|
40
40
|
"audio/webm"
|
|
41
41
|
].find((e) => MediaRecorder.isTypeSupported?.(e)) || "";
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var ye = 400, VoiceRecorderController = class extends i {
|
|
44
44
|
constructor(e) {
|
|
45
|
-
super("VoiceRecorderController", e), t(this, "state",
|
|
45
|
+
super("VoiceRecorderController", e), t(this, "state", B({
|
|
46
46
|
phase: "idle",
|
|
47
47
|
elapsedMs: 0
|
|
48
|
-
})), t(this, "isActive",
|
|
48
|
+
})), t(this, "isActive", v(() => this.state.value.phase !== "idle")), t(this, "isBusy", v(() => this.state.value.phase !== "idle")), t(this, "elapsedLabel", v(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), t(this, "statusText", v(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), t(this, "recorder", void 0), t(this, "stream", void 0), t(this, "chunks", []), t(this, "timer", void 0), t(this, "startedAt", 0), t(this, "cancelOnStop", !1), t(this, "stopAfterStart", !1), t(this, "startToken", 0);
|
|
49
49
|
}
|
|
50
50
|
get canUseBrowserRecording() {
|
|
51
51
|
return !!this.settings.getUserMedia || typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof MediaRecorder < "u";
|
|
@@ -74,7 +74,7 @@ var U = 400, VoiceRecorderController = class extends i {
|
|
|
74
74
|
this.stream = t, this.recorder = r, this.chunks = [], r.addEventListener("dataavailable", (e) => {
|
|
75
75
|
e.data.size > 0 && this.chunks.push(e.data);
|
|
76
76
|
}), r.addEventListener("stop", async () => {
|
|
77
|
-
let e = new Blob(this.chunks, { type: r.mimeType || n || "audio/webm" }), t = this.now() - this.startedAt, i = !this.cancelOnStop && e.size > 0 && t >=
|
|
77
|
+
let e = new Blob(this.chunks, { type: r.mimeType || n || "audio/webm" }), t = this.now() - this.startedAt, i = !this.cancelOnStop && e.size > 0 && t >= ye;
|
|
78
78
|
if (this.stopCapture(), !i) {
|
|
79
79
|
this.reset();
|
|
80
80
|
return;
|
|
@@ -157,7 +157,7 @@ var U = 400, VoiceRecorderController = class extends i {
|
|
|
157
157
|
function durableJournalOutcome(e) {
|
|
158
158
|
return e.turnOutcome === "failed" ? "failed" : e.turnOutcome === "stopped" ? "stopped" : e.sender === "system" ? "failed" : "completed";
|
|
159
159
|
}
|
|
160
|
-
var
|
|
160
|
+
var xe = {
|
|
161
161
|
finishing: "Finishing up",
|
|
162
162
|
slowHint: "Taking longer than usual.",
|
|
163
163
|
completed: "Work complete",
|
|
@@ -165,7 +165,7 @@ var G = {
|
|
|
165
165
|
stopped: "Stopped",
|
|
166
166
|
notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
|
|
167
167
|
leaveHint: "Taking longer than usual. You can leave this chat while I work."
|
|
168
|
-
},
|
|
168
|
+
}, Se = 1e4, Ce = 15e3, Ee = 6e4, De = 3;
|
|
169
169
|
function toMs(e) {
|
|
170
170
|
if (!e) return;
|
|
171
171
|
let t = Date.parse(e);
|
|
@@ -181,7 +181,7 @@ function milestoneRows(e, t) {
|
|
|
181
181
|
let n = e.filter((e) => e.status === "completed" || e.status === "failed" && !!e.note).filter((e) => !t.has(e.activityId)).slice().sort(byEvent), r = [];
|
|
182
182
|
for (let e of n) {
|
|
183
183
|
let t = e.status === "completed" ? "done" : "failed", n = r[r.length - 1];
|
|
184
|
-
if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <=
|
|
184
|
+
if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= Ce) {
|
|
185
185
|
n.count += 1, n.lastMs = eventMs(e);
|
|
186
186
|
continue;
|
|
187
187
|
}
|
|
@@ -202,12 +202,12 @@ function milestoneRows(e, t) {
|
|
|
202
202
|
}));
|
|
203
203
|
}
|
|
204
204
|
function splitRows(e) {
|
|
205
|
-
return e.length <=
|
|
205
|
+
return e.length <= De ? {
|
|
206
206
|
visibleRows: e,
|
|
207
207
|
hiddenRows: []
|
|
208
208
|
} : {
|
|
209
|
-
visibleRows: e.slice(e.length -
|
|
210
|
-
hiddenRows: e.slice(0, e.length -
|
|
209
|
+
visibleRows: e.slice(e.length - De),
|
|
210
|
+
hiddenRows: e.slice(0, e.length - De)
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
213
|
function buildWorkJournalModel(e) {
|
|
@@ -219,7 +219,7 @@ function buildWorkJournalModel(e) {
|
|
|
219
219
|
terminal: {
|
|
220
220
|
id: "work-complete",
|
|
221
221
|
tone: "completed",
|
|
222
|
-
label:
|
|
222
|
+
label: xe.completed
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
if (n === "failed") {
|
|
@@ -233,7 +233,7 @@ function buildWorkJournalModel(e) {
|
|
|
233
233
|
terminal: {
|
|
234
234
|
id: "work-failed",
|
|
235
235
|
tone: "failed",
|
|
236
|
-
label:
|
|
236
|
+
label: xe.failed,
|
|
237
237
|
...o && e?.note ? { note: e.note } : {}
|
|
238
238
|
}
|
|
239
239
|
};
|
|
@@ -247,18 +247,18 @@ function buildWorkJournalModel(e) {
|
|
|
247
247
|
terminal: {
|
|
248
248
|
id: "work-stopped",
|
|
249
249
|
tone: "stopped",
|
|
250
|
-
label:
|
|
250
|
+
label: xe.stopped
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
254
|
let { visibleRows: s, hiddenRows: c } = splitRows(milestoneRows(t, /* @__PURE__ */ new Set())), d = t.filter((e) => e.status === "started").sort(byEvent).pop(), f = t.reduce((e, t) => Math.max(e, eventMs(t)), a ?? -Infinity), p = Number.isFinite(f) ? f : r, m = t.reduce((e, t) => {
|
|
255
255
|
let n = toMs(t.startedAt) ?? toMs(t.endedAt);
|
|
256
256
|
return n === void 0 ? e : Math.min(e, n);
|
|
257
|
-
}, Infinity), g = p +
|
|
257
|
+
}, Infinity), g = p + Se, _ = (Number.isFinite(m) ? m : p) + Ee, v = r >= g, y = d || v ? {
|
|
258
258
|
id: d?.activityId ?? "work-active",
|
|
259
259
|
tone: "active",
|
|
260
|
-
label: d?.label ??
|
|
261
|
-
} : void 0, b = v && r >= _ ? i ?
|
|
260
|
+
label: d?.label ?? xe.finishing
|
|
261
|
+
} : void 0, b = v && r >= _ ? i ? xe.notifyHint : xe.leaveHint : void 0, x = [g, _].filter((e) => e > r).sort((e, t) => e - t)[0];
|
|
262
262
|
return {
|
|
263
263
|
outcome: n,
|
|
264
264
|
visibleRows: s,
|
|
@@ -352,16 +352,16 @@ var BotChatController = class extends i {
|
|
|
352
352
|
super("BotChatController", e), t(this, "isTextMode", !1), t(this, "lastMessage", {
|
|
353
353
|
hash: "",
|
|
354
354
|
time: 0
|
|
355
|
-
}), t(this, "isConnecting", !1), t(this, "turnEpoch", 0), t(this, "nextStreamToken", 0), t(this, "runningStreamToken", void 0), t(this, "suppressedStreamTokens", /* @__PURE__ */ new Set()), t(this, "queuedMessageIdSet",
|
|
355
|
+
}), t(this, "isConnecting", !1), t(this, "turnEpoch", 0), t(this, "nextStreamToken", 0), t(this, "runningStreamToken", void 0), t(this, "suppressedStreamTokens", /* @__PURE__ */ new Set()), t(this, "queuedMessageIdSet", B(/* @__PURE__ */ new Set())), t(this, "queuedMessageIds", v(() => this.queuedMessageIdSet.value)), t(this, "boundaryTimer", void 0), t(this, "nowMs", U(Date.now())), t(this, "toolActivityTiming", U({})), t(this, "lastVisibleProgressAtMs", U()), t(this, "liveSegments", U([])), t(this, "liveStreamMessageId", U(void 0)), t(this, "conversationId", void 0), t(this, "textState", B({
|
|
356
356
|
isActive: !1,
|
|
357
357
|
isConnected: !1,
|
|
358
358
|
isThinking: !1,
|
|
359
359
|
connectionStatus: "disconnected"
|
|
360
|
-
})), t(this, "botMode",
|
|
360
|
+
})), t(this, "botMode", B("self")), t(this, "sharedMessages", B([])), t(this, "composerState", B({
|
|
361
361
|
text: "",
|
|
362
362
|
pendingAttachments: [],
|
|
363
363
|
isUploading: !1
|
|
364
|
-
})), t(this, "workJournal",
|
|
364
|
+
})), t(this, "workJournal", v(() => {
|
|
365
365
|
let e = this.textState.value.isThinking ? "running" : this.textState.value.turnOutcome;
|
|
366
366
|
if (!e) return;
|
|
367
367
|
let t = this.textState.value.toolActivities;
|
|
@@ -372,7 +372,7 @@ var BotChatController = class extends i {
|
|
|
372
372
|
canNotifyOnCompletion: !1,
|
|
373
373
|
lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
|
|
374
374
|
});
|
|
375
|
-
})), t(this, "liveTurnBlocks",
|
|
375
|
+
})), t(this, "liveTurnBlocks", v(() => {
|
|
376
376
|
if (!this.textState.value.isThinking) return [];
|
|
377
377
|
let e = this.textState.value.toolActivities ?? [], t = this.liveSegments.value;
|
|
378
378
|
return !t.length && !e.length ? [] : buildLiveTurnBlocks({
|
|
@@ -382,14 +382,14 @@ var BotChatController = class extends i {
|
|
|
382
382
|
canNotifyOnCompletion: !1,
|
|
383
383
|
lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
|
|
384
384
|
});
|
|
385
|
-
})), t(this, "canUseComposer",
|
|
385
|
+
})), t(this, "canUseComposer", v(() => this.textState.value.sendBlockedReason !== "bot_deleted" && !this.composerState.value.isUploading)), t(this, "canAttachFile", v(() => !!this.settings.uploadFileFn)), t(this, "canRecordAudio", v(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), t(this, "voiceRecorder", new VoiceRecorderController({
|
|
386
386
|
getCanRecord: () => this.canRecordAudio.value,
|
|
387
387
|
getUploadFn: () => {
|
|
388
388
|
let e = this.settings.uploadFileFn;
|
|
389
389
|
return e ? (t) => e({ file: t }) : void 0;
|
|
390
390
|
},
|
|
391
391
|
getChatController: () => this
|
|
392
|
-
})), t(this, "canSend",
|
|
392
|
+
})), t(this, "canSend", v(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), t(this, "canStop", v(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), t(this, "composerAction", v(() => this.canSend.value ? "send" : this.canStop.value ? "stop" : "idle")), t(this, "composerShowsSecondaryStop", v(() => this.canStop.value && this.composerAction.value === "send")), t(this, "canStartVoice", v(() => {
|
|
393
393
|
let e = this.settings.sdk;
|
|
394
394
|
return this.textState.value.sendBlockedReason !== "bot_deleted" && !!e?.activeUser.value && !!this._bot.botId.value && !!this._bot.orgId.value && !!this.settings.createVoiceClientFn && voiceBrowserSupported();
|
|
395
395
|
})), t(this, "_bot", void 0), t(this, "localMessageSeq", 0), this._bot = e.bot, this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
|
|
@@ -426,6 +426,9 @@ var BotChatController = class extends i {
|
|
|
426
426
|
notify(e, t) {
|
|
427
427
|
e && this.addMessage(e, "system", void 0, t);
|
|
428
428
|
}
|
|
429
|
+
get messageShare() {
|
|
430
|
+
return this.settings.messageShareFns;
|
|
431
|
+
}
|
|
429
432
|
get canReportMessages() {
|
|
430
433
|
return !!this.settings.reportMessageFn;
|
|
431
434
|
}
|
|
@@ -934,10 +937,10 @@ function parseButtonTemplate(e) {
|
|
|
934
937
|
}
|
|
935
938
|
//#endregion
|
|
936
939
|
//#region bot/ui/ElBotButton.vue?vue&type=script&setup=true&lang.ts
|
|
937
|
-
var
|
|
940
|
+
var ke = {
|
|
938
941
|
key: 0,
|
|
939
942
|
class: "absolute inset-0 flex items-center justify-center"
|
|
940
|
-
},
|
|
943
|
+
}, Ae = /* @__PURE__ */ D({
|
|
941
944
|
__name: "ElBotButton",
|
|
942
945
|
props: {
|
|
943
946
|
theme: { default: "primary" },
|
|
@@ -950,40 +953,40 @@ var De = {
|
|
|
950
953
|
iconAfter: {}
|
|
951
954
|
},
|
|
952
955
|
setup(e) {
|
|
953
|
-
let t =
|
|
956
|
+
let t = v(() => ({
|
|
954
957
|
primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
|
|
955
958
|
green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
|
|
956
959
|
red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
|
|
957
960
|
default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20",
|
|
958
961
|
dark: "bg-theme-900 border-transparent hover:bg-theme-800"
|
|
959
|
-
})[e.theme]), n =
|
|
962
|
+
})[e.theme]), n = v(() => ({
|
|
960
963
|
sm: "px-4 py-2 text-sm",
|
|
961
964
|
md: "px-6 py-3 text-base",
|
|
962
965
|
lg: "px-8 py-4 text-base"
|
|
963
|
-
})[e.size]), r =
|
|
966
|
+
})[e.size]), r = v(() => ({
|
|
964
967
|
sm: "size-4",
|
|
965
968
|
md: "size-4",
|
|
966
969
|
lg: "size-5"
|
|
967
970
|
})[e.size]);
|
|
968
|
-
return (i, a) => (
|
|
969
|
-
e.icon ? (
|
|
971
|
+
return (i, a) => (R(), x("button", { class: j(["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, n.value]]) }, [e.loading ? (R(), x("div", ke, [...a[0] || (a[0] = [w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : b("", !0), w("span", { class: j(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
|
|
972
|
+
e.icon ? (R(), x("i", {
|
|
970
973
|
key: 0,
|
|
971
|
-
class:
|
|
972
|
-
}, null, 2)) :
|
|
974
|
+
class: j([e.icon, r.value])
|
|
975
|
+
}, null, 2)) : b("", !0),
|
|
973
976
|
ce(i.$slots, "default"),
|
|
974
|
-
e.iconAfter ? (
|
|
977
|
+
e.iconAfter ? (R(), x("i", {
|
|
975
978
|
key: 1,
|
|
976
|
-
class:
|
|
977
|
-
}, null, 2)) :
|
|
979
|
+
class: j([e.iconAfter, r.value])
|
|
980
|
+
}, null, 2)) : b("", !0)
|
|
978
981
|
], 2)], 2));
|
|
979
982
|
}
|
|
980
|
-
}),
|
|
983
|
+
}), je = ["value"], Me = /* @__PURE__ */ D({
|
|
981
984
|
__name: "BotInputEmail",
|
|
982
985
|
props: { modelValue: { default: "" } },
|
|
983
986
|
emits: ["update:modelValue"],
|
|
984
987
|
setup(e, { emit: t }) {
|
|
985
988
|
let n = t;
|
|
986
|
-
return (t, r) => (
|
|
989
|
+
return (t, r) => (R(), x("input", {
|
|
987
990
|
name: "username",
|
|
988
991
|
type: "email",
|
|
989
992
|
inputmode: "email",
|
|
@@ -996,9 +999,9 @@ var De = {
|
|
|
996
999
|
class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
|
|
997
1000
|
style: { "font-size": "16px" },
|
|
998
1001
|
onInput: r[0] || (r[0] = (e) => n("update:modelValue", e.target.value))
|
|
999
|
-
}, null, 40,
|
|
1002
|
+
}, null, 40, je));
|
|
1000
1003
|
}
|
|
1001
|
-
}),
|
|
1004
|
+
}), Ne = ["placeholder", "value"], Pe = /* @__PURE__ */ D({
|
|
1002
1005
|
__name: "BotInputOneTimeCode",
|
|
1003
1006
|
props: {
|
|
1004
1007
|
modelValue: {},
|
|
@@ -1007,7 +1010,7 @@ var De = {
|
|
|
1007
1010
|
},
|
|
1008
1011
|
emits: ["update:modelValue", "autoSubmit"],
|
|
1009
1012
|
setup(e, { emit: t }) {
|
|
1010
|
-
let n = e, r = t, i =
|
|
1013
|
+
let n = e, r = t, i = B(null), a = v(() => "0".repeat(n.length));
|
|
1011
1014
|
ne(() => {
|
|
1012
1015
|
n.focusFirst && !("ontouchstart" in window) && i.value?.focus();
|
|
1013
1016
|
});
|
|
@@ -1015,7 +1018,7 @@ var De = {
|
|
|
1015
1018
|
let t = e.target.value.replace(/\D/g, "").slice(0, n.length);
|
|
1016
1019
|
r("update:modelValue", t), t.length === n.length && r("autoSubmit", t);
|
|
1017
1020
|
}
|
|
1018
|
-
return (t, n) => (
|
|
1021
|
+
return (t, n) => (R(), x("input", {
|
|
1019
1022
|
ref_key: "input",
|
|
1020
1023
|
ref: i,
|
|
1021
1024
|
name: "one-time-code",
|
|
@@ -1031,12 +1034,12 @@ var De = {
|
|
|
1031
1034
|
class: "w-full px-6 py-3 text-center font-mono tracking-[0.35em] text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
|
|
1032
1035
|
style: { "font-size": "16px" },
|
|
1033
1036
|
onInput
|
|
1034
|
-
}, null, 40,
|
|
1037
|
+
}, null, 40, Ne));
|
|
1035
1038
|
}
|
|
1036
|
-
}),
|
|
1039
|
+
}), Fe = { class: "relative flex-shrink-0" }, Ie = ["src", "alt"], Le = { class: "absolute top-1 right-1" }, ze = {
|
|
1037
1040
|
key: 1,
|
|
1038
1041
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
1039
|
-
},
|
|
1042
|
+
}, Be = { class: "min-w-0" }, Ve = /* @__PURE__ */ D({
|
|
1040
1043
|
__name: "ElModeHeader",
|
|
1041
1044
|
props: {
|
|
1042
1045
|
bot: {},
|
|
@@ -1048,17 +1051,31 @@ var De = {
|
|
|
1048
1051
|
layout: { default: "centered" }
|
|
1049
1052
|
},
|
|
1050
1053
|
setup(e) {
|
|
1051
|
-
return (t, n) => (
|
|
1054
|
+
return (t, n) => (R(), x("div", { class: j(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [w("div", Fe, [w("div", { class: j(["rounded-full overflow-hidden border-white", e.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"]) }, [w("img", {
|
|
1052
1055
|
src: e.bot.avatarUrl.value,
|
|
1053
1056
|
alt: e.bot.displayName.value,
|
|
1054
1057
|
class: "w-full h-full object-cover",
|
|
1055
|
-
onError: n[0] || (n[0] = (...e) =>
|
|
1056
|
-
}, null, 40,
|
|
1058
|
+
onError: n[0] || (n[0] = (...e) => le(handleImageError) && le(handleImageError)(...e))
|
|
1059
|
+
}, null, 40, Ie)], 2), w("div", Le, [e.isOnline ? (R(), x(m, { key: 0 }, [n[1] || (n[1] = w("div", {
|
|
1057
1060
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
1058
1061
|
style: { "animation-duration": "3s" }
|
|
1059
|
-
}, null, -1)), n[2] || (n[2] =
|
|
1062
|
+
}, null, -1)), n[2] || (n[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (R(), x("div", ze))])]), w("div", Be, [w("h1", { class: j(["font-light text-white mb-1 truncate", [e.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight", e.layout === "horizontal" ? "text-white/95" : ""]]) }, G(e.bot.displayName.value), 3), w("p", { class: j(["font-light line-clamp-1", [e.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base", e.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"]]) }, G(e.layout === "horizontal" ? e.bot.title.value || "Assistant" : e.bot.title.value), 3)])], 2));
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
//#endregion
|
|
1066
|
+
//#region bot/voice/voice-end-copy.ts
|
|
1067
|
+
function voiceEndNotice(e, t) {
|
|
1068
|
+
switch (e) {
|
|
1069
|
+
case "bot": return `${t} ended the call`;
|
|
1070
|
+
case "idle-timeout": return "Call ended after 30 seconds of silence";
|
|
1071
|
+
case "network": return "Call dropped. Connection lost.";
|
|
1072
|
+
case "session-cap": return "Call reached its time limit";
|
|
1073
|
+
case "unavailable": return "Call couldn’t connect";
|
|
1060
1074
|
}
|
|
1061
|
-
}
|
|
1075
|
+
}
|
|
1076
|
+
//#endregion
|
|
1077
|
+
//#region bot/ui/BotAvatar.vue?vue&type=script&setup=true&lang.ts
|
|
1078
|
+
var He = { class: "relative shrink-0 rounded-full" }, Ue = ["src", "alt"], We = ["src", "alt"], Ge = ["aria-label"], Ke = /* @__PURE__ */ D({
|
|
1062
1079
|
__name: "BotAvatar",
|
|
1063
1080
|
props: {
|
|
1064
1081
|
bot: {},
|
|
@@ -1081,7 +1098,7 @@ var De = {
|
|
|
1081
1098
|
amber: "bg-amber-500",
|
|
1082
1099
|
red: "bg-red-500",
|
|
1083
1100
|
grey: "bg-theme-300"
|
|
1084
|
-
}, n =
|
|
1101
|
+
}, n = v(() => {
|
|
1085
1102
|
let n = e.bot.state.value;
|
|
1086
1103
|
return e.showStatus && n.lifecycle !== "unknown" ? t[n.color] : null;
|
|
1087
1104
|
}), r = {
|
|
@@ -1089,67 +1106,67 @@ var De = {
|
|
|
1089
1106
|
height: "clamp(7px, 14%, 14px)",
|
|
1090
1107
|
top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
|
|
1091
1108
|
right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
|
|
1092
|
-
}, i =
|
|
1093
|
-
return (t, a) => (
|
|
1094
|
-
|
|
1109
|
+
}, i = v(() => e.isLight ? "ring-white" : "ring-theme-900");
|
|
1110
|
+
return (t, a) => (R(), x("div", He, [
|
|
1111
|
+
w("img", {
|
|
1095
1112
|
src: e.bot.avatarUrl.value,
|
|
1096
1113
|
alt: e.bot.displayName.value,
|
|
1097
|
-
class:
|
|
1098
|
-
}, null, 10,
|
|
1099
|
-
e.showOwnerMark && e.bot.ownerMarkUrl.value ? (
|
|
1114
|
+
class: j(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
|
|
1115
|
+
}, null, 10, Ue),
|
|
1116
|
+
e.showOwnerMark && e.bot.ownerMarkUrl.value ? (R(), x("img", {
|
|
1100
1117
|
key: 0,
|
|
1101
1118
|
src: e.bot.ownerMarkUrl.value,
|
|
1102
1119
|
alt: e.bot.owner.value?.fullName ? `Owned by ${e.bot.owner.value.fullName}` : "Owner",
|
|
1103
|
-
class:
|
|
1104
|
-
}, null, 10,
|
|
1105
|
-
n.value ? (
|
|
1120
|
+
class: j(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
|
|
1121
|
+
}, null, 10, We)) : b("", !0),
|
|
1122
|
+
n.value ? (R(), x("span", {
|
|
1106
1123
|
key: 1,
|
|
1107
1124
|
role: "status",
|
|
1108
1125
|
"aria-label": e.bot.state.value.tooltip,
|
|
1109
|
-
class:
|
|
1126
|
+
class: j(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
|
|
1110
1127
|
style: r
|
|
1111
|
-
}, null, 10,
|
|
1112
|
-
n.value && e.bot.state.value.lifecycle === "running" ? (
|
|
1128
|
+
}, null, 10, Ge)) : b("", !0),
|
|
1129
|
+
n.value && e.bot.state.value.lifecycle === "running" ? (R(), x("span", {
|
|
1113
1130
|
key: 2,
|
|
1114
1131
|
"aria-hidden": "true",
|
|
1115
|
-
class:
|
|
1132
|
+
class: j(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
|
|
1116
1133
|
style: r
|
|
1117
|
-
}, null, 2)) :
|
|
1134
|
+
}, null, 2)) : b("", !0)
|
|
1118
1135
|
]));
|
|
1119
1136
|
}
|
|
1120
|
-
}),
|
|
1137
|
+
}), qe = {
|
|
1121
1138
|
key: 0,
|
|
1122
1139
|
class: "sr-only",
|
|
1123
1140
|
role: "status",
|
|
1124
1141
|
"aria-live": "polite"
|
|
1125
|
-
},
|
|
1142
|
+
}, Je = ["aria-expanded", "disabled"], Ye = ["aria-expanded"], Xe = {
|
|
1126
1143
|
class: "flex w-5 shrink-0 justify-center self-stretch",
|
|
1127
1144
|
"aria-hidden": "true"
|
|
1128
|
-
},
|
|
1145
|
+
}, Ze = ["data-journal-row"], Qe = {
|
|
1129
1146
|
class: "flex w-5 shrink-0 flex-col items-center self-stretch",
|
|
1130
1147
|
"aria-hidden": "true"
|
|
1131
|
-
},
|
|
1148
|
+
}, $e = { class: "flex h-[17px] shrink-0 items-center" }, et = {
|
|
1132
1149
|
key: 0,
|
|
1133
1150
|
class: "sr-only"
|
|
1134
|
-
},
|
|
1151
|
+
}, tt = /* @__PURE__ */ D({
|
|
1135
1152
|
__name: "BotToolActivityGroup",
|
|
1136
1153
|
props: {
|
|
1137
1154
|
model: {},
|
|
1138
1155
|
isLight: { type: Boolean }
|
|
1139
1156
|
},
|
|
1140
1157
|
setup(e) {
|
|
1141
|
-
let t = e, n =
|
|
1158
|
+
let t = e, n = U(!1);
|
|
1142
1159
|
function toggle() {
|
|
1143
1160
|
n.value = !n.value;
|
|
1144
1161
|
}
|
|
1145
|
-
let r =
|
|
1162
|
+
let r = v(() => t.model.outcome === "completed"), i = v(() => t.model.hiddenRows.length), a = v(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = v(() => {
|
|
1146
1163
|
let e = t.model;
|
|
1147
1164
|
return r.value ? n.value ? e.hiddenRows : [] : [
|
|
1148
1165
|
...n.value ? e.hiddenRows : [],
|
|
1149
1166
|
...e.visibleRows,
|
|
1150
1167
|
...e.terminal ? [e.terminal] : []
|
|
1151
1168
|
];
|
|
1152
|
-
}), s =
|
|
1169
|
+
}), s = v(() => t.isLight ? {
|
|
1153
1170
|
spine: "bg-theme-200",
|
|
1154
1171
|
dashed: "border-theme-300",
|
|
1155
1172
|
doneMark: "text-theme-400",
|
|
@@ -1167,7 +1184,7 @@ var De = {
|
|
|
1167
1184
|
stoppedSquare: "bg-white/50",
|
|
1168
1185
|
muted: "text-white/50",
|
|
1169
1186
|
ring: "focus-visible:ring-white"
|
|
1170
|
-
}), c =
|
|
1187
|
+
}), c = v(() => {
|
|
1171
1188
|
let e = t.isLight;
|
|
1172
1189
|
return {
|
|
1173
1190
|
done: {
|
|
@@ -1210,64 +1227,64 @@ var De = {
|
|
|
1210
1227
|
}
|
|
1211
1228
|
};
|
|
1212
1229
|
});
|
|
1213
|
-
return (t, d) => (
|
|
1214
|
-
a.value ? (
|
|
1215
|
-
r.value ? (
|
|
1230
|
+
return (t, d) => (R(), x("div", { class: j(["w-full py-0.5", s.value.muted]) }, [
|
|
1231
|
+
a.value ? (R(), x("span", qe, G(a.value), 1)) : b("", !0),
|
|
1232
|
+
r.value ? (R(), x("button", {
|
|
1216
1233
|
key: 1,
|
|
1217
1234
|
type: "button",
|
|
1218
1235
|
"data-test": "messaging-tool-activity-summary",
|
|
1219
1236
|
"data-journal-disclosure": "",
|
|
1220
1237
|
"aria-expanded": n.value,
|
|
1221
1238
|
disabled: i.value === 0,
|
|
1222
|
-
class:
|
|
1239
|
+
class: j(["flex min-h-11 items-center gap-x-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", s.value.ring]),
|
|
1223
1240
|
onClick: toggle
|
|
1224
1241
|
}, [
|
|
1225
|
-
d[0] || (d[0] =
|
|
1242
|
+
d[0] || (d[0] = w("i", {
|
|
1226
1243
|
"data-journal-station": "completed",
|
|
1227
1244
|
class: "i-tabler-circle-check size-3.5 shrink-0 text-green-600",
|
|
1228
1245
|
"aria-hidden": "true"
|
|
1229
1246
|
}, null, -1)),
|
|
1230
|
-
|
|
1231
|
-
i.value ? (
|
|
1247
|
+
w("span", { class: j(["text-[12px] font-medium leading-none", s.value.muted]) }, G(e.model.terminal?.label), 3),
|
|
1248
|
+
i.value ? (R(), x("i", {
|
|
1232
1249
|
key: 0,
|
|
1233
|
-
class:
|
|
1250
|
+
class: j(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
|
|
1234
1251
|
"aria-hidden": "true"
|
|
1235
|
-
}, null, 2)) :
|
|
1236
|
-
], 10,
|
|
1252
|
+
}, null, 2)) : b("", !0)
|
|
1253
|
+
], 10, Je)) : i.value ? (R(), x("button", {
|
|
1237
1254
|
key: 2,
|
|
1238
1255
|
type: "button",
|
|
1239
1256
|
"data-test": "messaging-tool-activity-summary",
|
|
1240
1257
|
"data-journal-disclosure": "",
|
|
1241
1258
|
"aria-expanded": n.value,
|
|
1242
|
-
class:
|
|
1259
|
+
class: j(["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", s.value.ring]),
|
|
1243
1260
|
onClick: toggle
|
|
1244
|
-
}, [
|
|
1261
|
+
}, [w("span", Xe, [w("span", {
|
|
1245
1262
|
"data-journal-spine": "dashed",
|
|
1246
|
-
class:
|
|
1247
|
-
}, null, 2)]),
|
|
1248
|
-
class:
|
|
1263
|
+
class: j(["w-0 border-l border-dashed", s.value.dashed])
|
|
1264
|
+
}, null, 2)]), w("span", { class: j(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [T(G(i.value) + " earlier updates ", 1), w("i", {
|
|
1265
|
+
class: j(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
|
|
1249
1266
|
"aria-hidden": "true"
|
|
1250
|
-
}, null, 2)], 2)], 10,
|
|
1251
|
-
(
|
|
1267
|
+
}, null, 2)], 2)], 10, Ye)) : b("", !0),
|
|
1268
|
+
(R(!0), x(m, null, V(o.value, (e, t) => (R(), x("div", {
|
|
1252
1269
|
key: e.id,
|
|
1253
1270
|
"data-test": "messaging-tool-activity-row",
|
|
1254
1271
|
"data-journal-row": e.tone,
|
|
1255
|
-
class:
|
|
1256
|
-
}, [
|
|
1272
|
+
class: j([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
|
|
1273
|
+
}, [w("div", Qe, [w("span", $e, [(R(), y(H(c.value[e.tone].station.tag), {
|
|
1257
1274
|
"data-journal-station": e.tone,
|
|
1258
|
-
class:
|
|
1259
|
-
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ?
|
|
1275
|
+
class: j(c.value[e.tone].station.class)
|
|
1276
|
+
}, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? b("", !0) : (R(), x("span", {
|
|
1260
1277
|
key: 0,
|
|
1261
|
-
class:
|
|
1262
|
-
}, null, 2))]),
|
|
1278
|
+
class: j(["w-px flex-1", s.value.spine])
|
|
1279
|
+
}, null, 2))]), w("div", { class: j(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [w("span", { class: j(["relative block leading-snug", c.value[e.tone].label]) }, [T(G(e.label), 1), c.value[e.tone].statusWord ? (R(), x("span", et, ", " + G(c.value[e.tone].statusWord), 1)) : b("", !0)], 2), e.note ? (R(), x("p", {
|
|
1263
1280
|
key: 0,
|
|
1264
|
-
class:
|
|
1265
|
-
},
|
|
1266
|
-
!r.value && e.model.hint ? (
|
|
1281
|
+
class: j(["pt-0.5 text-[12px] leading-snug", s.value.muted])
|
|
1282
|
+
}, G(e.note), 3)) : b("", !0)], 2)], 10, Ze))), 128)),
|
|
1283
|
+
!r.value && e.model.hint ? (R(), x("p", {
|
|
1267
1284
|
key: 3,
|
|
1268
1285
|
"data-test": "messaging-tool-activity-hint",
|
|
1269
|
-
class:
|
|
1270
|
-
},
|
|
1286
|
+
class: j(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
|
|
1287
|
+
}, G(e.model.hint), 3)) : b("", !0)
|
|
1271
1288
|
], 2));
|
|
1272
1289
|
}
|
|
1273
1290
|
});
|
|
@@ -1312,86 +1329,86 @@ function _unsupportedIterableToArray(e, t) {
|
|
|
1312
1329
|
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(e, t) : void 0;
|
|
1313
1330
|
}
|
|
1314
1331
|
}
|
|
1315
|
-
var
|
|
1316
|
-
|
|
1332
|
+
var nt = Object.entries, rt = Object.setPrototypeOf, it = Object.isFrozen, at = Object.getPrototypeOf, ot = Object.getOwnPropertyDescriptor, X = Object.freeze, Z = Object.seal, st = Object.create, ct = typeof Reflect < "u" && Reflect, lt = ct.apply, ut = ct.construct;
|
|
1333
|
+
X || (X = function freeze(e) {
|
|
1317
1334
|
return e;
|
|
1318
|
-
}),
|
|
1335
|
+
}), Z || (Z = function seal(e) {
|
|
1319
1336
|
return e;
|
|
1320
|
-
}),
|
|
1337
|
+
}), lt || (lt = function apply(e, t) {
|
|
1321
1338
|
var n = [...arguments].slice(2);
|
|
1322
1339
|
return e.apply(t, n);
|
|
1323
|
-
}),
|
|
1340
|
+
}), ut || (ut = function construct(e) {
|
|
1324
1341
|
return new e(...[...arguments].slice(1));
|
|
1325
1342
|
});
|
|
1326
|
-
var
|
|
1343
|
+
var dt = unapply(Array.prototype.forEach), Q = unapply(Array.prototype.lastIndexOf), ft = unapply(Array.prototype.pop), pt = unapply(Array.prototype.push), mt = unapply(Array.prototype.splice), ht = Array.isArray, gt = unapply(String.prototype.toLowerCase), _t = unapply(String.prototype.toString), vt = unapply(String.prototype.match), bt = unapply(String.prototype.replace), xt = unapply(String.prototype.indexOf), St = unapply(String.prototype.trim), Ct = unapply(Number.prototype.toString), wt = unapply(Boolean.prototype.toString), Tt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), Et = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), Dt = unapply(Object.prototype.hasOwnProperty), $ = unapply(Object.prototype.toString), Ot = unapply(RegExp.prototype.test), kt = unconstruct(TypeError);
|
|
1327
1344
|
function unapply(e) {
|
|
1328
1345
|
return function(t) {
|
|
1329
1346
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1330
1347
|
var n = [...arguments].slice(1);
|
|
1331
|
-
return
|
|
1348
|
+
return lt(e, t, n);
|
|
1332
1349
|
};
|
|
1333
1350
|
}
|
|
1334
1351
|
function unconstruct(e) {
|
|
1335
1352
|
return function() {
|
|
1336
|
-
return
|
|
1353
|
+
return ut(e, [...arguments]);
|
|
1337
1354
|
};
|
|
1338
1355
|
}
|
|
1339
1356
|
function addToSet(e, t) {
|
|
1340
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1341
|
-
if (
|
|
1357
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : gt;
|
|
1358
|
+
if (rt && rt(e, null), !ht(t)) return e;
|
|
1342
1359
|
let r = t.length;
|
|
1343
1360
|
for (; r--;) {
|
|
1344
1361
|
let i = t[r];
|
|
1345
1362
|
if (typeof i == "string") {
|
|
1346
1363
|
let e = n(i);
|
|
1347
|
-
e !== i && (
|
|
1364
|
+
e !== i && (it(t) || (t[r] = e), i = e);
|
|
1348
1365
|
}
|
|
1349
1366
|
e[i] = !0;
|
|
1350
1367
|
}
|
|
1351
1368
|
return e;
|
|
1352
1369
|
}
|
|
1353
1370
|
function cleanArray(e) {
|
|
1354
|
-
for (let t = 0; t < e.length; t++)
|
|
1371
|
+
for (let t = 0; t < e.length; t++) Dt(e, t) || (e[t] = null);
|
|
1355
1372
|
return e;
|
|
1356
1373
|
}
|
|
1357
1374
|
function clone(e) {
|
|
1358
|
-
let t =
|
|
1359
|
-
for (let r of
|
|
1375
|
+
let t = st(null);
|
|
1376
|
+
for (let r of nt(e)) {
|
|
1360
1377
|
var n = _slicedToArray(r, 2);
|
|
1361
1378
|
let i = n[0], a = n[1];
|
|
1362
|
-
|
|
1379
|
+
Dt(e, i) && (t[i] = ht(a) ? cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? clone(a) : a);
|
|
1363
1380
|
}
|
|
1364
1381
|
return t;
|
|
1365
1382
|
}
|
|
1366
1383
|
function stringifyValue(e) {
|
|
1367
1384
|
switch (typeof e) {
|
|
1368
1385
|
case "string": return e;
|
|
1369
|
-
case "number": return
|
|
1370
|
-
case "boolean": return
|
|
1371
|
-
case "bigint": return
|
|
1372
|
-
case "symbol": return
|
|
1373
|
-
case "undefined": return
|
|
1386
|
+
case "number": return Ct(e);
|
|
1387
|
+
case "boolean": return wt(e);
|
|
1388
|
+
case "bigint": return Tt ? Tt(e) : "0";
|
|
1389
|
+
case "symbol": return Et ? Et(e) : "Symbol()";
|
|
1390
|
+
case "undefined": return $(e);
|
|
1374
1391
|
case "function":
|
|
1375
1392
|
case "object": {
|
|
1376
|
-
if (e === null) return
|
|
1393
|
+
if (e === null) return $(e);
|
|
1377
1394
|
let t = e, n = lookupGetter(t, "toString");
|
|
1378
1395
|
if (typeof n == "function") {
|
|
1379
1396
|
let e = n(t);
|
|
1380
|
-
return typeof e == "string" ? e :
|
|
1397
|
+
return typeof e == "string" ? e : $(e);
|
|
1381
1398
|
}
|
|
1382
|
-
return
|
|
1399
|
+
return $(e);
|
|
1383
1400
|
}
|
|
1384
|
-
default: return
|
|
1401
|
+
default: return $(e);
|
|
1385
1402
|
}
|
|
1386
1403
|
}
|
|
1387
1404
|
function lookupGetter(e, t) {
|
|
1388
1405
|
for (; e !== null;) {
|
|
1389
|
-
let n =
|
|
1406
|
+
let n = ot(e, t);
|
|
1390
1407
|
if (n) {
|
|
1391
1408
|
if (n.get) return unapply(n.get);
|
|
1392
1409
|
if (typeof n.value == "function") return unapply(n.value);
|
|
1393
1410
|
}
|
|
1394
|
-
e =
|
|
1411
|
+
e = at(e);
|
|
1395
1412
|
}
|
|
1396
1413
|
function fallbackValue() {
|
|
1397
1414
|
return null;
|
|
@@ -1400,12 +1417,12 @@ function lookupGetter(e, t) {
|
|
|
1400
1417
|
}
|
|
1401
1418
|
function isRegex(e) {
|
|
1402
1419
|
try {
|
|
1403
|
-
return
|
|
1420
|
+
return Ot(e, ""), !0;
|
|
1404
1421
|
} catch {
|
|
1405
1422
|
return !1;
|
|
1406
1423
|
}
|
|
1407
1424
|
}
|
|
1408
|
-
var
|
|
1425
|
+
var At = X(/* @__PURE__ */ "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".split(".")), jt = X(/* @__PURE__ */ "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".split(".")), Mt = X([
|
|
1409
1426
|
"feBlend",
|
|
1410
1427
|
"feColorMatrix",
|
|
1411
1428
|
"feComponentTransfer",
|
|
@@ -1431,7 +1448,7 @@ var kt = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1431
1448
|
"feSpotLight",
|
|
1432
1449
|
"feTile",
|
|
1433
1450
|
"feTurbulence"
|
|
1434
|
-
]),
|
|
1451
|
+
]), Nt = X([
|
|
1435
1452
|
"animate",
|
|
1436
1453
|
"color-profile",
|
|
1437
1454
|
"cursor",
|
|
@@ -1454,7 +1471,7 @@ var kt = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1454
1471
|
"solidcolor",
|
|
1455
1472
|
"unknown",
|
|
1456
1473
|
"use"
|
|
1457
|
-
]),
|
|
1474
|
+
]), Ft = X(/* @__PURE__ */ "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".split(".")), It = X([
|
|
1458
1475
|
"maction",
|
|
1459
1476
|
"maligngroup",
|
|
1460
1477
|
"malignmark",
|
|
@@ -1470,13 +1487,13 @@ var kt = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1470
1487
|
"annotation-xml",
|
|
1471
1488
|
"mprescripts",
|
|
1472
1489
|
"none"
|
|
1473
|
-
]),
|
|
1490
|
+
]), Lt = X(["#text"]), Rt = X(/* @__PURE__ */ "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".split(".")), zt = X(/* @__PURE__ */ "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.dominant-baseline.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-orientation.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".split(".")), Bt = X(/* @__PURE__ */ "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".split(".")), Vt = X([
|
|
1474
1491
|
"xlink:href",
|
|
1475
1492
|
"xml:id",
|
|
1476
1493
|
"xlink:title",
|
|
1477
1494
|
"xml:space",
|
|
1478
1495
|
"xmlns:xlink"
|
|
1479
|
-
]),
|
|
1496
|
+
]), Ht = Z(/{{[\w\W]*|^[\w\W]*}}/g), Ut = Z(/<%[\w\W]*|^[\w\W]*%>/g), Wt = Z(/\${[\w\W]*/g), Gt = Z(/^data-[\-\w.\u00B7-\uFFFF]+$/), Kt = Z(/^aria-[\-\w]+$/), qt = Z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Jt = Z(/^(?:\w+script|data):/i), Yt = Z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Xt = Z(/^html$/i), Zt = Z(/^[a-z][.\w]*(-[.\w]+)+$/i), Qt = Z(/<[/\w!]/g), $t = Z(/<[/\w]/g), en = Z(/<\/no(script|embed|frames)/i), tn = Z(/\/>/i), nn = {
|
|
1480
1497
|
element: 1,
|
|
1481
1498
|
attribute: 2,
|
|
1482
1499
|
text: 3,
|
|
@@ -1489,9 +1506,9 @@ var kt = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1489
1506
|
documentType: 10,
|
|
1490
1507
|
documentFragment: 11,
|
|
1491
1508
|
notation: 12
|
|
1492
|
-
},
|
|
1509
|
+
}, rn = function getGlobal() {
|
|
1493
1510
|
return typeof window > "u" ? null : window;
|
|
1494
|
-
},
|
|
1511
|
+
}, an = function _createTrustedTypesPolicy(e, t) {
|
|
1495
1512
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
1496
1513
|
let n = null, r = "data-tt-policy-suffix";
|
|
1497
1514
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -1508,7 +1525,7 @@ var kt = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1508
1525
|
} catch {
|
|
1509
1526
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
1510
1527
|
}
|
|
1511
|
-
},
|
|
1528
|
+
}, on = function _createHooksMap() {
|
|
1512
1529
|
return {
|
|
1513
1530
|
afterSanitizeAttributes: [],
|
|
1514
1531
|
afterSanitizeElements: [],
|
|
@@ -1520,12 +1537,12 @@ var kt = Y(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1520
1537
|
uponSanitizeElement: [],
|
|
1521
1538
|
uponSanitizeShadowNode: []
|
|
1522
1539
|
};
|
|
1523
|
-
},
|
|
1524
|
-
return
|
|
1540
|
+
}, sn = function _resolveSetOption(e, t, n, r) {
|
|
1541
|
+
return Dt(e, t) && ht(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
|
|
1525
1542
|
};
|
|
1526
1543
|
function createDOMPurify() {
|
|
1527
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1528
|
-
if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !==
|
|
1544
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : rn(), DOMPurify = (e) => createDOMPurify(e);
|
|
1545
|
+
if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== nn.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
|
|
1529
1546
|
let t = e.document, n = t, r = n.currentScript;
|
|
1530
1547
|
e.DocumentFragment;
|
|
1531
1548
|
let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
|
|
@@ -1535,38 +1552,38 @@ function createDOMPurify() {
|
|
|
1535
1552
|
let e = t.createElement("template");
|
|
1536
1553
|
e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
|
|
1537
1554
|
}
|
|
1538
|
-
let T, E = "",
|
|
1539
|
-
if (
|
|
1540
|
-
},
|
|
1541
|
-
|
|
1555
|
+
let T, E = "", D, A = !1, ee = 0, j = function _assertNotInTrustedTypesPolicy() {
|
|
1556
|
+
if (ee > 0) throw kt("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
|
|
1557
|
+
}, M = function _createTrustedHTML(e) {
|
|
1558
|
+
j(), ee++;
|
|
1542
1559
|
try {
|
|
1543
1560
|
return T.createHTML(e);
|
|
1544
1561
|
} finally {
|
|
1545
|
-
|
|
1562
|
+
ee--;
|
|
1546
1563
|
}
|
|
1547
|
-
},
|
|
1548
|
-
|
|
1564
|
+
}, N = function _createTrustedScriptURL(e) {
|
|
1565
|
+
j(), ee++;
|
|
1549
1566
|
try {
|
|
1550
1567
|
return T.createScriptURL(e);
|
|
1551
1568
|
} finally {
|
|
1552
|
-
|
|
1553
|
-
}
|
|
1554
|
-
},
|
|
1555
|
-
return
|
|
1556
|
-
},
|
|
1557
|
-
DOMPurify.isSupported = typeof
|
|
1558
|
-
let
|
|
1559
|
-
...kt,
|
|
1569
|
+
ee--;
|
|
1570
|
+
}
|
|
1571
|
+
}, te = function _getDefaultTrustedTypesPolicy() {
|
|
1572
|
+
return A || (D = an(d, r), A = !0), D;
|
|
1573
|
+
}, ne = t, ae = ne.implementation, R = ne.createNodeIterator, B = ne.createDocumentFragment, V = ne.getElementsByTagName, ce = n.importNode, H = on();
|
|
1574
|
+
DOMPurify.isSupported = typeof nt == "function" && typeof v == "function" && ae && ae.createHTMLDocument !== void 0;
|
|
1575
|
+
let U = Ht, G = Ut, le = Wt, ue = Gt, fe = Kt, pe = Jt, me = Yt, he = Zt, ge = qt, K = null, _e = addToSet({}, [
|
|
1560
1576
|
...At,
|
|
1561
1577
|
...jt,
|
|
1562
|
-
...
|
|
1563
|
-
...
|
|
1564
|
-
|
|
1565
|
-
|
|
1578
|
+
...Mt,
|
|
1579
|
+
...Ft,
|
|
1580
|
+
...Lt
|
|
1581
|
+
]), J = null, ve = addToSet({}, [
|
|
1566
1582
|
...Rt,
|
|
1567
1583
|
...zt,
|
|
1568
|
-
...Bt
|
|
1569
|
-
|
|
1584
|
+
...Bt,
|
|
1585
|
+
...Vt
|
|
1586
|
+
]), Y = Object.seal(st(null, {
|
|
1570
1587
|
tagNameCheck: {
|
|
1571
1588
|
writable: !0,
|
|
1572
1589
|
configurable: !1,
|
|
@@ -1585,7 +1602,7 @@ function createDOMPurify() {
|
|
|
1585
1602
|
enumerable: !0,
|
|
1586
1603
|
value: !1
|
|
1587
1604
|
}
|
|
1588
|
-
})),
|
|
1605
|
+
})), ye = null, xe = null, Se = Object.seal(st(null, {
|
|
1589
1606
|
tagCheck: {
|
|
1590
1607
|
writable: !0,
|
|
1591
1608
|
configurable: !1,
|
|
@@ -1598,14 +1615,14 @@ function createDOMPurify() {
|
|
|
1598
1615
|
enumerable: !0,
|
|
1599
1616
|
value: null
|
|
1600
1617
|
}
|
|
1601
|
-
})),
|
|
1618
|
+
})), Ce = !0, Ee = !0, De = !1, ke = !0, Ae = !1, je = !0, Me = !1, Ne = !1, Pe = null, Fe = null, Ie = !1, Le = !1, ze = !1, Be = !1, Ve = !0, He = !1, Ue = "user-content-", We = !0, Ge = !1, Ke = {}, qe = null, Je = addToSet({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Ye = null, Xe = addToSet({}, [
|
|
1602
1619
|
"audio",
|
|
1603
1620
|
"video",
|
|
1604
1621
|
"img",
|
|
1605
1622
|
"source",
|
|
1606
1623
|
"image",
|
|
1607
1624
|
"track"
|
|
1608
|
-
]),
|
|
1625
|
+
]), Ze = null, Qe = addToSet({}, [
|
|
1609
1626
|
"alt",
|
|
1610
1627
|
"class",
|
|
1611
1628
|
"for",
|
|
@@ -1620,84 +1637,84 @@ function createDOMPurify() {
|
|
|
1620
1637
|
"value",
|
|
1621
1638
|
"style",
|
|
1622
1639
|
"xmlns"
|
|
1623
|
-
]),
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
],
|
|
1640
|
+
]), $e = "http://www.w3.org/1998/Math/MathML", et = "http://www.w3.org/2000/svg", tt = "http://www.w3.org/1999/xhtml", rt = tt, it = !1, at = null, ot = addToSet({}, [
|
|
1641
|
+
$e,
|
|
1642
|
+
et,
|
|
1643
|
+
tt
|
|
1644
|
+
], _t), ct = X([
|
|
1628
1645
|
"mi",
|
|
1629
1646
|
"mo",
|
|
1630
1647
|
"mn",
|
|
1631
1648
|
"ms",
|
|
1632
1649
|
"mtext"
|
|
1633
|
-
]),
|
|
1650
|
+
]), lt = addToSet({}, ct), ut = X(["annotation-xml"]), Ct = addToSet({}, ut), wt = addToSet({}, [
|
|
1634
1651
|
"title",
|
|
1635
1652
|
"style",
|
|
1636
1653
|
"font",
|
|
1637
1654
|
"a",
|
|
1638
1655
|
"script"
|
|
1639
|
-
]),
|
|
1656
|
+
]), Tt = null, Et = ["application/xhtml+xml", "text/html"], $ = null, cn = null, ln = t.createElement("form"), un = function isRegexOrFunction(e) {
|
|
1640
1657
|
return e instanceof RegExp || e instanceof Function;
|
|
1641
1658
|
}, dn = function _parseConfig() {
|
|
1642
1659
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1643
|
-
if (
|
|
1644
|
-
(!e || typeof e != "object") && (e = {}), e = clone(e),
|
|
1645
|
-
transform:
|
|
1646
|
-
base: et
|
|
1647
|
-
}), Ze = on(e, "ADD_DATA_URI_TAGS", Qe, {
|
|
1648
|
-
transform: Q,
|
|
1660
|
+
if (cn && cn === e) return;
|
|
1661
|
+
(!e || typeof e != "object") && (e = {}), e = clone(e), Tt = Et.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, $ = Tt === "application/xhtml+xml" ? _t : gt, K = sn(e, "ALLOWED_TAGS", _e, { transform: $ }), J = sn(e, "ALLOWED_ATTR", ve, { transform: $ }), at = sn(e, "ALLOWED_NAMESPACES", ot, { transform: _t }), Ze = sn(e, "ADD_URI_SAFE_ATTR", Qe, {
|
|
1662
|
+
transform: $,
|
|
1649
1663
|
base: Qe
|
|
1650
|
-
}), Ye =
|
|
1651
|
-
|
|
1652
|
-
|
|
1664
|
+
}), Ye = sn(e, "ADD_DATA_URI_TAGS", Xe, {
|
|
1665
|
+
transform: $,
|
|
1666
|
+
base: Xe
|
|
1667
|
+
}), qe = sn(e, "FORBID_CONTENTS", Je, { transform: $ }), ye = sn(e, "FORBID_TAGS", clone({}), { transform: $ }), xe = sn(e, "FORBID_ATTR", clone({}), { transform: $ }), Ke = Dt(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, Ce = e.ALLOW_ARIA_ATTR !== !1, Ee = e.ALLOW_DATA_ATTR !== !1, De = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ke = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ae = e.SAFE_FOR_TEMPLATES || !1, je = e.SAFE_FOR_XML !== !1, Me = e.WHOLE_DOCUMENT || !1, Le = e.RETURN_DOM || !1, ze = e.RETURN_DOM_FRAGMENT || !1, Be = e.RETURN_TRUSTED_TYPE || !1, Ie = e.FORCE_BODY || !1, Ve = e.SANITIZE_DOM !== !1, He = e.SANITIZE_NAMED_PROPS || !1, We = e.KEEP_CONTENT !== !1, Ge = e.IN_PLACE || !1, ge = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : qt, rt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : tt, lt = Dt(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, ct), Ct = Dt(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, ut);
|
|
1668
|
+
let t = Dt(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : st(null);
|
|
1669
|
+
if (Y = st(null), Dt(t, "tagNameCheck") && un(t.tagNameCheck) && (Y.tagNameCheck = t.tagNameCheck), Dt(t, "attributeNameCheck") && un(t.attributeNameCheck) && (Y.attributeNameCheck = t.attributeNameCheck), Dt(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (Y.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), Z(Y), Ae && (Ee = !1), ze && (Le = !0), Ke && (K = addToSet({}, Lt), J = st(null), Ke.html === !0 && (addToSet(K, At), addToSet(J, Rt)), Ke.svg === !0 && (addToSet(K, jt), addToSet(J, zt), addToSet(J, Vt)), Ke.svgFilters === !0 && (addToSet(K, Mt), addToSet(J, zt), addToSet(J, Vt)), Ke.mathMl === !0 && (addToSet(K, Ft), addToSet(J, Bt), addToSet(J, Vt))), Se.tagCheck = null, Se.attributeCheck = null, Dt(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Se.tagCheck = e.ADD_TAGS : ht(e.ADD_TAGS) && (K === _e && (K = clone(K)), addToSet(K, e.ADD_TAGS, $))), Dt(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Se.attributeCheck = e.ADD_ATTR : ht(e.ADD_ATTR) && (J === ve && (J = clone(J)), addToSet(J, e.ADD_ATTR, $))), Dt(e, "ADD_URI_SAFE_ATTR") && ht(e.ADD_URI_SAFE_ATTR) && addToSet(Ze, e.ADD_URI_SAFE_ATTR, $), Dt(e, "FORBID_CONTENTS") && ht(e.FORBID_CONTENTS) && (qe === Je && (qe = clone(qe)), addToSet(qe, e.FORBID_CONTENTS, $)), Dt(e, "ADD_FORBID_CONTENTS") && ht(e.ADD_FORBID_CONTENTS) && (qe === Je && (qe = clone(qe)), addToSet(qe, e.ADD_FORBID_CONTENTS, $)), We && (K["#text"] = !0), Me && addToSet(K, [
|
|
1653
1670
|
"html",
|
|
1654
1671
|
"head",
|
|
1655
1672
|
"body"
|
|
1656
|
-
]),
|
|
1657
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
1658
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
1673
|
+
]), K.table && (addToSet(K, ["tbody"]), delete ye.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
1674
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw kt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
1675
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw kt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
1659
1676
|
let t = T;
|
|
1660
1677
|
T = e.TRUSTED_TYPES_POLICY;
|
|
1661
1678
|
try {
|
|
1662
|
-
E =
|
|
1679
|
+
E = M("");
|
|
1663
1680
|
} catch (e) {
|
|
1664
1681
|
throw T = t, e;
|
|
1665
1682
|
}
|
|
1666
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, E = "") : (T === void 0 && (T =
|
|
1667
|
-
|
|
1683
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, E = "") : (T === void 0 && (T = te()), T && typeof E == "string" && (E = M("")));
|
|
1684
|
+
X && X(e), cn = e;
|
|
1668
1685
|
}, fn = addToSet({}, [
|
|
1669
|
-
...At,
|
|
1670
1686
|
...jt,
|
|
1671
|
-
...Mt
|
|
1672
|
-
|
|
1673
|
-
|
|
1687
|
+
...Mt,
|
|
1688
|
+
...Nt
|
|
1689
|
+
]), pn = addToSet({}, [...Ft, ...It]), mn = function _checkSvgNamespace(e, t, n) {
|
|
1690
|
+
return t.namespaceURI === tt ? e === "svg" : t.namespaceURI === $e ? e === "svg" && (n === "annotation-xml" || lt[n]) : !!fn[e];
|
|
1674
1691
|
}, hn = function _checkMathMlNamespace(e, t, n) {
|
|
1675
|
-
return t.namespaceURI ===
|
|
1692
|
+
return t.namespaceURI === tt ? e === "math" : t.namespaceURI === et ? e === "math" && Ct[n] : !!pn[e];
|
|
1676
1693
|
}, gn = function _checkHtmlNamespace(e, t, n) {
|
|
1677
|
-
return t.namespaceURI ===
|
|
1694
|
+
return t.namespaceURI === et && !Ct[n] || t.namespaceURI === $e && !lt[n] ? !1 : !pn[e] && (wt[e] || !fn[e]);
|
|
1678
1695
|
}, _n = function _checkValidNamespace(e) {
|
|
1679
1696
|
let t = v(e);
|
|
1680
1697
|
(!t || !t.tagName) && (t = {
|
|
1681
|
-
namespaceURI:
|
|
1698
|
+
namespaceURI: rt,
|
|
1682
1699
|
tagName: "template"
|
|
1683
1700
|
});
|
|
1684
|
-
let n =
|
|
1685
|
-
return
|
|
1701
|
+
let n = gt(e.tagName), r = gt(t.tagName);
|
|
1702
|
+
return at[e.namespaceURI] ? e.namespaceURI === et ? mn(n, t, r) : e.namespaceURI === $e ? hn(n, t, r) : e.namespaceURI === tt ? gn(n, t, r) : !!(Tt === "application/xhtml+xml" && at[e.namespaceURI]) : !1;
|
|
1686
1703
|
}, vn = function _forceRemove(e) {
|
|
1687
|
-
|
|
1704
|
+
pt(DOMPurify.removed, { element: e });
|
|
1688
1705
|
try {
|
|
1689
1706
|
v(e).removeChild(e);
|
|
1690
1707
|
} catch {
|
|
1691
|
-
if (m(e), !v(e)) throw
|
|
1708
|
+
if (m(e), !v(e)) throw kt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
1692
1709
|
}
|
|
1693
1710
|
}, yn = function _neutralizeRoot(e) {
|
|
1694
1711
|
Sn(e);
|
|
1695
1712
|
let t = _(e);
|
|
1696
1713
|
if (t) {
|
|
1697
1714
|
let e = [];
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
}),
|
|
1715
|
+
dt(t, (t) => {
|
|
1716
|
+
pt(e, t);
|
|
1717
|
+
}), dt(e, (e) => {
|
|
1701
1718
|
try {
|
|
1702
1719
|
m(e);
|
|
1703
1720
|
} catch {}
|
|
@@ -1712,18 +1729,18 @@ function createDOMPurify() {
|
|
|
1712
1729
|
}
|
|
1713
1730
|
}, bn = function _removeAttribute(e, t) {
|
|
1714
1731
|
try {
|
|
1715
|
-
|
|
1732
|
+
pt(DOMPurify.removed, {
|
|
1716
1733
|
attribute: t.getAttributeNode(e),
|
|
1717
1734
|
from: t
|
|
1718
1735
|
});
|
|
1719
1736
|
} catch {
|
|
1720
|
-
|
|
1737
|
+
pt(DOMPurify.removed, {
|
|
1721
1738
|
attribute: null,
|
|
1722
1739
|
from: t
|
|
1723
1740
|
});
|
|
1724
1741
|
}
|
|
1725
1742
|
if (t.removeAttribute(e), e === "is") {
|
|
1726
|
-
if (
|
|
1743
|
+
if (Le || ze) try {
|
|
1727
1744
|
vn(t);
|
|
1728
1745
|
} catch {}
|
|
1729
1746
|
else try {
|
|
@@ -1734,7 +1751,7 @@ function createDOMPurify() {
|
|
|
1734
1751
|
let t = b(e);
|
|
1735
1752
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
1736
1753
|
let r = t[n], i = r && r.name;
|
|
1737
|
-
if (!(typeof i != "string" ||
|
|
1754
|
+
if (!(typeof i != "string" || J[$(i)])) try {
|
|
1738
1755
|
e.removeAttribute(i);
|
|
1739
1756
|
} catch {}
|
|
1740
1757
|
}
|
|
@@ -1742,23 +1759,23 @@ function createDOMPurify() {
|
|
|
1742
1759
|
let t = [e];
|
|
1743
1760
|
for (; t.length > 0;) {
|
|
1744
1761
|
let e = t.pop();
|
|
1745
|
-
(x ? x(e) : e.nodeType) ===
|
|
1762
|
+
(x ? x(e) : e.nodeType) === nn.element && xn(e);
|
|
1746
1763
|
let n = _(e);
|
|
1747
1764
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
1748
1765
|
}
|
|
1749
1766
|
}, Cn = function _neutralizePatchLinkage(e) {
|
|
1750
|
-
if (!
|
|
1767
|
+
if (!je) return;
|
|
1751
1768
|
let t = [e];
|
|
1752
1769
|
for (; t.length > 0;) {
|
|
1753
1770
|
let e = t.pop(), n = x ? x(e) : e.nodeType;
|
|
1754
|
-
if (n ===
|
|
1771
|
+
if (n === nn.processingInstruction || n === nn.comment && Ot($t, e.data)) {
|
|
1755
1772
|
try {
|
|
1756
1773
|
m(e);
|
|
1757
1774
|
} catch {}
|
|
1758
1775
|
continue;
|
|
1759
1776
|
}
|
|
1760
|
-
if (n ===
|
|
1761
|
-
let t = e, n =
|
|
1777
|
+
if (n === nn.element) {
|
|
1778
|
+
let t = e, n = $(w ? w(e) : e.nodeName);
|
|
1762
1779
|
try {
|
|
1763
1780
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
|
|
1764
1781
|
} catch {}
|
|
@@ -1768,43 +1785,43 @@ function createDOMPurify() {
|
|
|
1768
1785
|
}
|
|
1769
1786
|
}, wn = function _initDocument(e) {
|
|
1770
1787
|
let n = null, r = null;
|
|
1771
|
-
if (
|
|
1788
|
+
if (Ie) e = "<remove></remove>" + e;
|
|
1772
1789
|
else {
|
|
1773
|
-
let t =
|
|
1790
|
+
let t = vt(e, /^[\r\n\t ]+/);
|
|
1774
1791
|
r = t && t[0];
|
|
1775
1792
|
}
|
|
1776
|
-
|
|
1777
|
-
let i = T ?
|
|
1778
|
-
if (
|
|
1779
|
-
n = new c().parseFromString(i,
|
|
1793
|
+
Tt === "application/xhtml+xml" && rt === tt && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
1794
|
+
let i = T ? M(e) : e;
|
|
1795
|
+
if (rt === tt) try {
|
|
1796
|
+
n = new c().parseFromString(i, Tt);
|
|
1780
1797
|
} catch {}
|
|
1781
1798
|
if (!n || !n.documentElement) {
|
|
1782
|
-
n =
|
|
1799
|
+
n = ae.createDocument(rt, "template", null);
|
|
1783
1800
|
try {
|
|
1784
|
-
n.documentElement.innerHTML =
|
|
1801
|
+
n.documentElement.innerHTML = it ? E : i;
|
|
1785
1802
|
} catch {}
|
|
1786
1803
|
}
|
|
1787
1804
|
let a = n.body || n.documentElement;
|
|
1788
|
-
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null),
|
|
1805
|
+
return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), rt === tt ? V.call(n, Me ? "html" : "body")[0] : Me ? n.documentElement : a;
|
|
1789
1806
|
}, Tn = function _createNodeIterator(e) {
|
|
1790
|
-
return
|
|
1807
|
+
return R.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
|
|
1791
1808
|
}, En = function _stripTemplateExpressions(e) {
|
|
1792
|
-
return e =
|
|
1809
|
+
return e = bt(e, U, " "), e = bt(e, G, " "), e = bt(e, le, " "), e;
|
|
1793
1810
|
}, Dn = function _scrubTemplateExpressions(e) {
|
|
1794
1811
|
e.normalize();
|
|
1795
|
-
let t =
|
|
1812
|
+
let t = R.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
|
|
1796
1813
|
for (; n;) n.data = En(n.data), n = t.nextNode();
|
|
1797
1814
|
let r = e.querySelectorAll?.call(e, "template");
|
|
1798
|
-
r &&
|
|
1815
|
+
r && dt(r, (e) => {
|
|
1799
1816
|
kn(e.content) && Dn(e.content);
|
|
1800
1817
|
});
|
|
1801
1818
|
}, On = function _isClobbered(e) {
|
|
1802
1819
|
let t = w ? w(e) : null;
|
|
1803
|
-
return typeof t != "string" ||
|
|
1820
|
+
return typeof t != "string" || $(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== b(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== x(e) || e.childNodes !== _(e);
|
|
1804
1821
|
}, kn = function _isDocumentFragment(e) {
|
|
1805
1822
|
if (!x || typeof e != "object" || !e) return !1;
|
|
1806
1823
|
try {
|
|
1807
|
-
return x(e) ===
|
|
1824
|
+
return x(e) === nn.documentFragment;
|
|
1808
1825
|
} catch {
|
|
1809
1826
|
return !1;
|
|
1810
1827
|
}
|
|
@@ -1817,51 +1834,51 @@ function createDOMPurify() {
|
|
|
1817
1834
|
}
|
|
1818
1835
|
};
|
|
1819
1836
|
function _executeHooks(e, t, n) {
|
|
1820
|
-
e.length !== 0 &&
|
|
1821
|
-
e.call(DOMPurify, t, n,
|
|
1837
|
+
e.length !== 0 && dt(e, (e) => {
|
|
1838
|
+
e.call(DOMPurify, t, n, cn);
|
|
1822
1839
|
});
|
|
1823
1840
|
}
|
|
1824
1841
|
let jn = function _isUnsafeNode(e, t) {
|
|
1825
|
-
return !!(
|
|
1842
|
+
return !!(je && e.hasChildNodes() && !An(e.firstElementChild) && Ot(Qt, e.textContent) && Ot(Qt, e.innerHTML) || je && e.namespaceURI === tt && t === "style" && An(e.firstElementChild) || e.nodeType === nn.processingInstruction || je && e.nodeType === nn.comment && Ot($t, e.data));
|
|
1826
1843
|
}, Mn = function _sanitizeDisallowedNode(e, t) {
|
|
1827
|
-
if (!
|
|
1828
|
-
if (
|
|
1844
|
+
if (!ye[t] && In(t) && (Y.tagNameCheck instanceof RegExp && Ot(Y.tagNameCheck, t) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(t))) return !1;
|
|
1845
|
+
if (We && !qe[t]) {
|
|
1829
1846
|
let t = v(e), n = _(e);
|
|
1830
1847
|
if (n && t) {
|
|
1831
1848
|
let r = n.length;
|
|
1832
1849
|
for (let i = r - 1; i >= 0; --i) {
|
|
1833
|
-
let r =
|
|
1850
|
+
let r = Ge ? n[i] : p(n[i], !0);
|
|
1834
1851
|
t.insertBefore(r, g(e));
|
|
1835
1852
|
}
|
|
1836
1853
|
}
|
|
1837
1854
|
}
|
|
1838
1855
|
return vn(e), !0;
|
|
1839
1856
|
}, Nn = function _sanitizeElements(e, t) {
|
|
1840
|
-
if (_executeHooks(
|
|
1857
|
+
if (_executeHooks(H.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
|
|
1841
1858
|
if (On(e)) return vn(e), !0;
|
|
1842
|
-
let n =
|
|
1843
|
-
if (_executeHooks(
|
|
1859
|
+
let n = $(w ? w(e) : e.nodeName);
|
|
1860
|
+
if (_executeHooks(H.uponSanitizeElement, e, {
|
|
1844
1861
|
tagName: n,
|
|
1845
|
-
allowedTags:
|
|
1862
|
+
allowedTags: K
|
|
1846
1863
|
}), e !== t && v(e) === null) return !0;
|
|
1847
1864
|
if (jn(e, n)) return vn(e), !0;
|
|
1848
|
-
if (
|
|
1865
|
+
if (ye[n] || !(Se.tagCheck instanceof Function && Se.tagCheck(n)) && !K[n]) {
|
|
1849
1866
|
let t = Mn(e, n);
|
|
1850
|
-
return t === !1 && _executeHooks(
|
|
1867
|
+
return t === !1 && _executeHooks(H.afterSanitizeElements, e, null), t;
|
|
1851
1868
|
}
|
|
1852
|
-
if ((x ? x(e) : e.nodeType) ===
|
|
1853
|
-
if (
|
|
1869
|
+
if ((x ? x(e) : e.nodeType) === nn.element && !_n(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Ot(en, e.innerHTML)) return vn(e), !0;
|
|
1870
|
+
if (Ae && e.nodeType === nn.text) {
|
|
1854
1871
|
let t = En(e.textContent);
|
|
1855
|
-
e.textContent !== t && (
|
|
1872
|
+
e.textContent !== t && (pt(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
|
|
1856
1873
|
}
|
|
1857
|
-
return _executeHooks(
|
|
1874
|
+
return _executeHooks(H.afterSanitizeElements, e, null), !1;
|
|
1858
1875
|
}, Pn = function _isValidAttribute(e, n, r) {
|
|
1859
|
-
if (
|
|
1860
|
-
let i =
|
|
1861
|
-
if (!(
|
|
1876
|
+
if (xe[n] || je && n === "patchsrc" || je && n === "for" && e !== "label" && e !== "output" || Ve && (n === "id" || n === "name") && (r in t || r in ln)) return !1;
|
|
1877
|
+
let i = J[n] || Se.attributeCheck instanceof Function && Se.attributeCheck(n, e);
|
|
1878
|
+
if (!(Ee && Ot(ue, n)) && !(Ce && Ot(fe, n))) {
|
|
1862
1879
|
if (!i) {
|
|
1863
|
-
if (!(In(e) && (
|
|
1864
|
-
} else if (
|
|
1880
|
+
if (!(In(e) && (Y.tagNameCheck instanceof RegExp && Ot(Y.tagNameCheck, e) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(e)) && (Y.attributeNameCheck instanceof RegExp && Ot(Y.attributeNameCheck, n) || Y.attributeNameCheck instanceof Function && Y.attributeNameCheck(n, e)) || n === "is" && Y.allowCustomizedBuiltInElements && (Y.tagNameCheck instanceof RegExp && Ot(Y.tagNameCheck, r) || Y.tagNameCheck instanceof Function && Y.tagNameCheck(r)))) return !1;
|
|
1881
|
+
} else if (!Ze[n] && !Ot(ge, bt(r, me, "")) && (n !== "src" && n !== "xlink:href" && n !== "href" || e === "script" || xt(r, "data:") !== 0 || !Ye[e]) && (!De || Ot(pe, bt(r, me, ""))) && r) return !1;
|
|
1865
1882
|
}
|
|
1866
1883
|
return !0;
|
|
1867
1884
|
}, Fn = addToSet({}, [
|
|
@@ -1874,37 +1891,37 @@ function createDOMPurify() {
|
|
|
1874
1891
|
"font-face-uri",
|
|
1875
1892
|
"missing-glyph"
|
|
1876
1893
|
]), In = function _isBasicCustomElement(e) {
|
|
1877
|
-
return !Fn[
|
|
1894
|
+
return !Fn[gt(e)] && Ot(he, e);
|
|
1878
1895
|
}, Ln = function _applyTrustedTypesToAttribute(e, t, n, r) {
|
|
1879
1896
|
if (T && typeof d == "object" && typeof d.getAttributeType == "function" && !n) switch (d.getAttributeType(e, t)) {
|
|
1880
|
-
case "TrustedHTML": return
|
|
1881
|
-
case "TrustedScriptURL": return
|
|
1897
|
+
case "TrustedHTML": return M(r);
|
|
1898
|
+
case "TrustedScriptURL": return N(r);
|
|
1882
1899
|
}
|
|
1883
1900
|
return r;
|
|
1884
1901
|
}, Rn = function _setAttributeValue(e, t, n, r) {
|
|
1885
1902
|
try {
|
|
1886
|
-
n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), On(e) ? vn(e) :
|
|
1903
|
+
n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), On(e) ? vn(e) : ft(DOMPurify.removed);
|
|
1887
1904
|
} catch {
|
|
1888
1905
|
bn(t, e);
|
|
1889
1906
|
}
|
|
1890
1907
|
}, zn = function _sanitizeAttributes(e) {
|
|
1891
|
-
_executeHooks(
|
|
1908
|
+
_executeHooks(H.beforeSanitizeAttributes, e, null);
|
|
1892
1909
|
let t = e.attributes;
|
|
1893
1910
|
if (!t || On(e)) return;
|
|
1894
1911
|
let n = {
|
|
1895
1912
|
attrName: "",
|
|
1896
1913
|
attrValue: "",
|
|
1897
1914
|
keepAttr: !0,
|
|
1898
|
-
allowedAttributes:
|
|
1915
|
+
allowedAttributes: J,
|
|
1899
1916
|
forceKeepAttr: void 0
|
|
1900
|
-
}, r = t.length, i =
|
|
1917
|
+
}, r = t.length, i = $(e.nodeName);
|
|
1901
1918
|
for (; r--;) {
|
|
1902
|
-
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, d =
|
|
1903
|
-
if (n.attrName = d, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(
|
|
1919
|
+
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, d = $(o), f = c, p = o === "value" ? f : St(f);
|
|
1920
|
+
if (n.attrName = d, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(H.uponSanitizeAttribute, e, n), p = n.attrValue, He && (d === "id" || d === "name") && xt(p, Ue) !== 0 && (bn(o, e), p = Ue + p), je && Ot(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
|
|
1904
1921
|
bn(o, e);
|
|
1905
1922
|
continue;
|
|
1906
1923
|
}
|
|
1907
|
-
if (d === "attributename" &&
|
|
1924
|
+
if (d === "attributename" && vt(p, "href")) {
|
|
1908
1925
|
bn(o, e);
|
|
1909
1926
|
continue;
|
|
1910
1927
|
}
|
|
@@ -1913,25 +1930,25 @@ function createDOMPurify() {
|
|
|
1913
1930
|
bn(o, e);
|
|
1914
1931
|
continue;
|
|
1915
1932
|
}
|
|
1916
|
-
if (!
|
|
1933
|
+
if (!ke && Ot(tn, p)) {
|
|
1917
1934
|
bn(o, e);
|
|
1918
1935
|
continue;
|
|
1919
1936
|
}
|
|
1920
|
-
if (
|
|
1937
|
+
if (Ae && (p = En(p)), !Pn(i, d, p)) {
|
|
1921
1938
|
bn(o, e);
|
|
1922
1939
|
continue;
|
|
1923
1940
|
}
|
|
1924
1941
|
p = Ln(i, d, s, p), p !== f && Rn(e, o, s, p);
|
|
1925
1942
|
}
|
|
1926
1943
|
}
|
|
1927
|
-
_executeHooks(
|
|
1944
|
+
_executeHooks(H.afterSanitizeAttributes, e, null);
|
|
1928
1945
|
}, Bn = function _sanitizeShadowDOM(e) {
|
|
1929
1946
|
let t = null, n = Tn(e);
|
|
1930
|
-
for (_executeHooks(
|
|
1947
|
+
for (_executeHooks(H.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(H.uponSanitizeShadowNode, t, null), Nn(t, e), zn(t), kn(t.content) && Bn(t.content), (x ? x(t) : t.nodeType) === nn.element) {
|
|
1931
1948
|
let e = y(t);
|
|
1932
1949
|
kn(e) && (Vn(e), Bn(e));
|
|
1933
1950
|
}
|
|
1934
|
-
_executeHooks(
|
|
1951
|
+
_executeHooks(H.afterSanitizeShadowDOM, e, null);
|
|
1935
1952
|
}, Vn = function _sanitizeAttachedShadowRoots(e) {
|
|
1936
1953
|
let t = [{
|
|
1937
1954
|
node: e,
|
|
@@ -1943,14 +1960,14 @@ function createDOMPurify() {
|
|
|
1943
1960
|
Bn(e.shadow);
|
|
1944
1961
|
continue;
|
|
1945
1962
|
}
|
|
1946
|
-
let n = e.node, r = (x ? x(n) : n.nodeType) ===
|
|
1963
|
+
let n = e.node, r = (x ? x(n) : n.nodeType) === nn.element, i = _(n);
|
|
1947
1964
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
1948
1965
|
node: i[e],
|
|
1949
1966
|
shadow: null
|
|
1950
1967
|
});
|
|
1951
1968
|
if (r) {
|
|
1952
1969
|
let e = w ? w(n) : null;
|
|
1953
|
-
if (typeof e == "string" &&
|
|
1970
|
+
if (typeof e == "string" && $(e) === "template") {
|
|
1954
1971
|
let e = n.content;
|
|
1955
1972
|
kn(e) && t.push({
|
|
1956
1973
|
node: e,
|
|
@@ -1972,73 +1989,73 @@ function createDOMPurify() {
|
|
|
1972
1989
|
};
|
|
1973
1990
|
return DOMPurify.sanitize = function(e) {
|
|
1974
1991
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
|
|
1975
|
-
if (
|
|
1992
|
+
if (it = !e, it && (e = "<!-->"), typeof e != "string" && !An(e) && (e = stringifyValue(e), typeof e != "string")) throw kt("dirty is not a string, aborting");
|
|
1976
1993
|
if (!DOMPurify.isSupported) return e;
|
|
1977
|
-
|
|
1978
|
-
let s =
|
|
1994
|
+
Ne ? (K = Pe, J = Fe) : dn(t), (H.uponSanitizeElement.length > 0 || H.uponSanitizeAttribute.length > 0) && (K = clone(K)), H.uponSanitizeAttribute.length > 0 && (J = clone(J)), DOMPurify.removed = [];
|
|
1995
|
+
let s = Ge && typeof e != "string" && An(e);
|
|
1979
1996
|
if (s) {
|
|
1980
1997
|
Cn(e);
|
|
1981
1998
|
let t = w ? w(e) : e.nodeName;
|
|
1982
1999
|
if (typeof t == "string") {
|
|
1983
|
-
let n =
|
|
1984
|
-
if (!
|
|
2000
|
+
let n = $(t);
|
|
2001
|
+
if (!K[n] || ye[n]) throw yn(e), kt("root node is forbidden and cannot be sanitized in-place");
|
|
1985
2002
|
}
|
|
1986
|
-
if (On(e)) throw yn(e),
|
|
2003
|
+
if (On(e)) throw yn(e), kt("root node is clobbered and cannot be sanitized in-place");
|
|
1987
2004
|
try {
|
|
1988
2005
|
Vn(e);
|
|
1989
2006
|
} catch (t) {
|
|
1990
2007
|
throw yn(e), t;
|
|
1991
2008
|
}
|
|
1992
|
-
} else if (An(e)) r = wn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType ===
|
|
2009
|
+
} else if (An(e)) r = wn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === nn.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), Vn(i);
|
|
1993
2010
|
else {
|
|
1994
|
-
if (!
|
|
1995
|
-
if (r = wn(e), !r) return
|
|
2011
|
+
if (!Le && !Ae && !Me && e.indexOf("<") === -1) return T && Be ? M(e) : e;
|
|
2012
|
+
if (r = wn(e), !r) return Le ? null : Be ? E : "";
|
|
1996
2013
|
}
|
|
1997
|
-
r &&
|
|
2014
|
+
r && Ie && vn(r.firstChild);
|
|
1998
2015
|
let c = s ? e : r, d = Tn(c);
|
|
1999
2016
|
try {
|
|
2000
2017
|
for (; a = d.nextNode();) Nn(a, c), zn(a), kn(a.content) && Bn(a.content);
|
|
2001
2018
|
} catch (t) {
|
|
2002
|
-
throw s && (yn(e),
|
|
2019
|
+
throw s && (yn(e), dt(DOMPurify.removed, (e) => {
|
|
2003
2020
|
e.element && Sn(e.element);
|
|
2004
2021
|
})), t;
|
|
2005
2022
|
}
|
|
2006
|
-
if (s) return
|
|
2023
|
+
if (s) return dt(DOMPurify.removed, (e) => {
|
|
2007
2024
|
e.element && Sn(e.element);
|
|
2008
|
-
}),
|
|
2009
|
-
if (
|
|
2010
|
-
if (
|
|
2025
|
+
}), Ae && Dn(e), e;
|
|
2026
|
+
if (Le) {
|
|
2027
|
+
if (Ae && Dn(r), ze) for (o = B.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
|
|
2011
2028
|
else o = r;
|
|
2012
|
-
return (
|
|
2029
|
+
return (J.shadowroot || J.shadowrootmode) && (o = ce.call(n, o, !0)), o;
|
|
2013
2030
|
}
|
|
2014
|
-
let f =
|
|
2015
|
-
return
|
|
2031
|
+
let f = Me ? r.outerHTML : r.innerHTML;
|
|
2032
|
+
return Me && K["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Ot(Xt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), Ae && (f = En(f)), T && Be ? M(f) : f;
|
|
2016
2033
|
}, DOMPurify.setConfig = function() {
|
|
2017
2034
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2018
|
-
dn(e),
|
|
2035
|
+
dn(e), Ne = !0, Pe = K, Fe = J;
|
|
2019
2036
|
}, DOMPurify.clearConfig = function() {
|
|
2020
|
-
|
|
2037
|
+
cn = null, Ne = !1, Pe = null, Fe = null, T = D, E = "";
|
|
2021
2038
|
}, DOMPurify.isValidAttribute = function(e, t, n) {
|
|
2022
|
-
|
|
2023
|
-
let r =
|
|
2039
|
+
cn || dn({});
|
|
2040
|
+
let r = $(e), i = $(t);
|
|
2024
2041
|
return Pn(r, i, n);
|
|
2025
2042
|
}, DOMPurify.addHook = function(e, t) {
|
|
2026
|
-
typeof t == "function" &&
|
|
2043
|
+
typeof t == "function" && Dt(H, e) && pt(H[e], t);
|
|
2027
2044
|
}, DOMPurify.removeHook = function(e, t) {
|
|
2028
|
-
if (
|
|
2045
|
+
if (Dt(H, e)) {
|
|
2029
2046
|
if (t !== void 0) {
|
|
2030
|
-
let n =
|
|
2031
|
-
return n === -1 ? void 0 :
|
|
2047
|
+
let n = Q(H[e], t);
|
|
2048
|
+
return n === -1 ? void 0 : mt(H[e], n, 1)[0];
|
|
2032
2049
|
}
|
|
2033
|
-
return
|
|
2050
|
+
return ft(H[e]);
|
|
2034
2051
|
}
|
|
2035
2052
|
}, DOMPurify.removeHooks = function(e) {
|
|
2036
|
-
|
|
2053
|
+
Dt(H, e) && (H[e] = []);
|
|
2037
2054
|
}, DOMPurify.removeAllHooks = function() {
|
|
2038
|
-
|
|
2055
|
+
H = on();
|
|
2039
2056
|
}, DOMPurify;
|
|
2040
2057
|
}
|
|
2041
|
-
var
|
|
2058
|
+
var cn = createDOMPurify(), _Class;
|
|
2042
2059
|
function I() {
|
|
2043
2060
|
return {
|
|
2044
2061
|
async: !1,
|
|
@@ -2053,11 +2070,11 @@ function I() {
|
|
|
2053
2070
|
walkTokens: null
|
|
2054
2071
|
};
|
|
2055
2072
|
}
|
|
2056
|
-
var
|
|
2073
|
+
var ln = I();
|
|
2057
2074
|
function W(e) {
|
|
2058
|
-
|
|
2075
|
+
ln = e;
|
|
2059
2076
|
}
|
|
2060
|
-
var
|
|
2077
|
+
var un = { exec: () => null };
|
|
2061
2078
|
function C(e) {
|
|
2062
2079
|
let t = [];
|
|
2063
2080
|
return (n) => {
|
|
@@ -2069,19 +2086,19 @@ function h(e, t = "") {
|
|
|
2069
2086
|
let n = typeof e == "string" ? e : e.source, r = {
|
|
2070
2087
|
replace: (e, t) => {
|
|
2071
2088
|
let i = typeof t == "string" ? t : t.source;
|
|
2072
|
-
return i = i.replace(
|
|
2089
|
+
return i = i.replace(fn.caret, "$1"), n = n.replace(e, i), r;
|
|
2073
2090
|
},
|
|
2074
2091
|
getRegex: () => new RegExp(n, t)
|
|
2075
2092
|
};
|
|
2076
2093
|
return r;
|
|
2077
2094
|
}
|
|
2078
|
-
var
|
|
2095
|
+
var dn = ((e = "") => {
|
|
2079
2096
|
try {
|
|
2080
2097
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
2081
2098
|
} catch {
|
|
2082
2099
|
return !1;
|
|
2083
2100
|
}
|
|
2084
|
-
})(),
|
|
2101
|
+
})(), fn = {
|
|
2085
2102
|
codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
|
|
2086
2103
|
outputLinkReplace: /\\([\[\]])/g,
|
|
2087
2104
|
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
@@ -2139,125 +2156,125 @@ var ln = ((e = "") => {
|
|
|
2139
2156
|
hrRegex: C((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
2140
2157
|
fencesBeginRegex: C((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
2141
2158
|
headingBeginRegex: C((e) => RegExp(`^ {0,${e}}#`)),
|
|
2142
|
-
htmlBeginRegex: C((e) => RegExp(`^ {0,${e}}(?:</?(?:${
|
|
2159
|
+
htmlBeginRegex: C((e) => RegExp(`^ {0,${e}}(?:</?(?:${Dn})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
|
|
2143
2160
|
blockquoteBeginRegex: C((e) => RegExp(`^ {0,${e}}>`))
|
|
2144
|
-
},
|
|
2145
|
-
blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
2146
|
-
code:
|
|
2147
|
-
def:
|
|
2148
|
-
fences:
|
|
2149
|
-
heading:
|
|
2150
|
-
hr:
|
|
2151
|
-
html:
|
|
2152
|
-
lheading:
|
|
2153
|
-
list:
|
|
2154
|
-
newline:
|
|
2155
|
-
paragraph:
|
|
2156
|
-
table:
|
|
2157
|
-
text:
|
|
2158
|
-
},
|
|
2159
|
-
...
|
|
2160
|
-
lheading:
|
|
2161
|
-
table:
|
|
2162
|
-
paragraph: h(
|
|
2163
|
-
},
|
|
2164
|
-
...
|
|
2165
|
-
html: h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",
|
|
2161
|
+
}, pn = /^(?:[ \t]*(?:\n|$))+/, mn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, hn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, gn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _n = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, vn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, yn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, bn = h(yn).replace(/bull/g, vn).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), xn = h(yn).replace(/bull/g, vn).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Sn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Cn = /^[^\n]+/, wn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Tn = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", wn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), En = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, vn).getRegex(), Dn = "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", On = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, kn = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", On).replace("tag", Dn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), de = (e) => h(Sn).replace("hr", gn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Dn).getRegex(), An = de(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), jn = de(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Mn = {
|
|
2162
|
+
blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", jn).getRegex(),
|
|
2163
|
+
code: mn,
|
|
2164
|
+
def: Tn,
|
|
2165
|
+
fences: hn,
|
|
2166
|
+
heading: _n,
|
|
2167
|
+
hr: gn,
|
|
2168
|
+
html: kn,
|
|
2169
|
+
lheading: bn,
|
|
2170
|
+
list: En,
|
|
2171
|
+
newline: pn,
|
|
2172
|
+
paragraph: An,
|
|
2173
|
+
table: un,
|
|
2174
|
+
text: Cn
|
|
2175
|
+
}, Nn = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", gn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Dn).getRegex(), Pn = {
|
|
2176
|
+
...Mn,
|
|
2177
|
+
lheading: xn,
|
|
2178
|
+
table: Nn,
|
|
2179
|
+
paragraph: h(Sn).replace("hr", gn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Nn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Dn).getRegex()
|
|
2180
|
+
}, Fn = {
|
|
2181
|
+
...Mn,
|
|
2182
|
+
html: h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", On).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(),
|
|
2166
2183
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
2167
2184
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
2168
|
-
fences:
|
|
2185
|
+
fences: un,
|
|
2169
2186
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
2170
|
-
paragraph: h(
|
|
2171
|
-
},
|
|
2172
|
-
_backpedal:
|
|
2173
|
-
anyPunctuation:
|
|
2174
|
-
autolink:
|
|
2175
|
-
blockSkip:
|
|
2176
|
-
br:
|
|
2177
|
-
code:
|
|
2178
|
-
del:
|
|
2179
|
-
delLDelim:
|
|
2180
|
-
delRDelim:
|
|
2181
|
-
emStrongLDelim:
|
|
2182
|
-
emStrongRDelimAst:
|
|
2183
|
-
emStrongRDelimUnd:
|
|
2184
|
-
escape:
|
|
2185
|
-
link:
|
|
2186
|
-
nolink:
|
|
2187
|
-
punctuation:
|
|
2188
|
-
reflink:
|
|
2189
|
-
reflinkSearch:
|
|
2190
|
-
tag:
|
|
2191
|
-
text:
|
|
2192
|
-
url:
|
|
2193
|
-
}, yr = {
|
|
2194
|
-
...vr,
|
|
2195
|
-
emStrongLDelim: Yn,
|
|
2196
|
-
emStrongRDelimAst: $n,
|
|
2197
|
-
emStrongRDelimUnd: tr,
|
|
2198
|
-
link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", lr).getRegex(),
|
|
2199
|
-
reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", lr).getRegex()
|
|
2200
|
-
}, br = {
|
|
2201
|
-
...vr,
|
|
2202
|
-
emStrongRDelimAst: Qn,
|
|
2203
|
-
emStrongLDelim: Jn,
|
|
2204
|
-
delLDelim: nr,
|
|
2205
|
-
delRDelim: rr,
|
|
2206
|
-
url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", _r).replace("protocol", gr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
2207
|
-
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
2208
|
-
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
2209
|
-
text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", gr).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
2210
|
-
}, xr = {
|
|
2211
|
-
...br,
|
|
2212
|
-
br: h(Fn).replace("{2,}", "*").getRegex(),
|
|
2213
|
-
text: h(br.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
2187
|
+
paragraph: h(Sn).replace("hr", gn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", bn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
2188
|
+
}, In = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ln = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Rn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, zn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Bn = /[\p{P}\p{S}]/u, Vn = /[\s\p{P}\p{S}]/u, Hn = /[^\s\p{P}\p{S}]/u, Un = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Vn).getRegex(), Wn = /[\p{Pi}\p{Ps}"']/u, Gn = /(?!~)[\p{P}\p{S}]/u, Kn = /(?!~)[\s\p{P}\p{S}]/u, qn = /(?:[^\s\p{P}\p{S}]|~)/u, Jn = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", dn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Yn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Xn = h(Yn, "u").replace(/punct/g, Bn).getRegex(), Zn = h(Yn, "u").replace(/punct/g, Gn).getRegex(), Qn = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Wn).replace(/punct/g, Bn).getRegex(), $n = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", er = h($n, "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), tr = h($n, "gu").replace(/notPunctSpace/g, qn).replace(/punctSpace/g, Kn).replace(/punct/g, Gn).getRegex(), nr = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), rr = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), ir = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), ar = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Bn).getRegex(), or = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Hn).replace(/punctSpace/g, Vn).replace(/punct/g, Bn).getRegex(), sr = h(/\\(punct)/, "gu").replace(/punct/g, Bn).getRegex(), cr = h(/^<(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(), lr = h(On).replace("(?:-->|$)", "-->").getRegex(), ur = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", lr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), dr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, fr = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", dr).getRegex(), pr = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", fr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), mr = h(/^!?\[(label)\]\[(ref)\]/).replace("label", fr).replace("ref", wn).getRegex(), hr = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", wn).getRegex(), gr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, _r = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", dr).getRegex(), vr = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", _r).replace("ref", gr).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", gr).getRegex()).getRegex(), yr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, br = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), xr = {
|
|
2189
|
+
_backpedal: un,
|
|
2190
|
+
anyPunctuation: sr,
|
|
2191
|
+
autolink: cr,
|
|
2192
|
+
blockSkip: Jn,
|
|
2193
|
+
br: Rn,
|
|
2194
|
+
code: Ln,
|
|
2195
|
+
del: un,
|
|
2196
|
+
delLDelim: un,
|
|
2197
|
+
delRDelim: un,
|
|
2198
|
+
emStrongLDelim: Xn,
|
|
2199
|
+
emStrongRDelimAst: er,
|
|
2200
|
+
emStrongRDelimUnd: rr,
|
|
2201
|
+
escape: In,
|
|
2202
|
+
link: pr,
|
|
2203
|
+
nolink: hr,
|
|
2204
|
+
punctuation: Un,
|
|
2205
|
+
reflink: mr,
|
|
2206
|
+
reflinkSearch: vr,
|
|
2207
|
+
tag: ur,
|
|
2208
|
+
text: zn,
|
|
2209
|
+
url: un
|
|
2214
2210
|
}, Sr = {
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2211
|
+
...xr,
|
|
2212
|
+
emStrongLDelim: Qn,
|
|
2213
|
+
emStrongRDelimAst: nr,
|
|
2214
|
+
emStrongRDelimUnd: ir,
|
|
2215
|
+
link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", fr).getRegex(),
|
|
2216
|
+
reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", fr).getRegex()
|
|
2218
2217
|
}, Cr = {
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2218
|
+
...xr,
|
|
2219
|
+
emStrongRDelimAst: tr,
|
|
2220
|
+
emStrongLDelim: Zn,
|
|
2221
|
+
delLDelim: ar,
|
|
2222
|
+
delRDelim: or,
|
|
2223
|
+
url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", br).replace("protocol", yr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
2224
|
+
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
2225
|
+
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
2226
|
+
text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", yr).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
2223
2227
|
}, wr = {
|
|
2228
|
+
...Cr,
|
|
2229
|
+
br: h(Rn).replace("{2,}", "*").getRegex(),
|
|
2230
|
+
text: h(Cr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
2231
|
+
}, Tr = {
|
|
2232
|
+
normal: Mn,
|
|
2233
|
+
gfm: Pn,
|
|
2234
|
+
pedantic: Fn
|
|
2235
|
+
}, Er = {
|
|
2236
|
+
normal: xr,
|
|
2237
|
+
gfm: Cr,
|
|
2238
|
+
breaks: wr,
|
|
2239
|
+
pedantic: Sr
|
|
2240
|
+
}, Dr = {
|
|
2224
2241
|
"&": "&",
|
|
2225
2242
|
"<": "<",
|
|
2226
2243
|
">": ">",
|
|
2227
2244
|
"\"": """,
|
|
2228
2245
|
"'": "'"
|
|
2229
|
-
}, be = (e) =>
|
|
2246
|
+
}, be = (e) => Dr[e];
|
|
2230
2247
|
function O(e, t) {
|
|
2231
2248
|
if (t) {
|
|
2232
|
-
if (
|
|
2233
|
-
} else if (
|
|
2249
|
+
if (fn.escapeTest.test(e)) return e.replace(fn.escapeReplace, be);
|
|
2250
|
+
} else if (fn.escapeTestNoEncode.test(e)) return e.replace(fn.escapeReplaceNoEncode, be);
|
|
2234
2251
|
return e;
|
|
2235
2252
|
}
|
|
2236
2253
|
function Re(e) {
|
|
2237
|
-
return e.replace(
|
|
2254
|
+
return e.replace(fn.numericCharacterReference, (e, t, n) => {
|
|
2238
2255
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
2239
2256
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
|
|
2240
2257
|
});
|
|
2241
2258
|
}
|
|
2242
2259
|
function re(e) {
|
|
2243
2260
|
try {
|
|
2244
|
-
e = encodeURI(e).replace(
|
|
2261
|
+
e = encodeURI(e).replace(fn.percentDecode, "%");
|
|
2245
2262
|
} catch {
|
|
2246
2263
|
return null;
|
|
2247
2264
|
}
|
|
2248
2265
|
return e;
|
|
2249
2266
|
}
|
|
2250
2267
|
function se(e, t) {
|
|
2251
|
-
let n = e.replace(
|
|
2268
|
+
let n = e.replace(fn.findPipe, (e, t, n) => {
|
|
2252
2269
|
let r = !1, i = t;
|
|
2253
2270
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
2254
2271
|
return r ? "|" : " |";
|
|
2255
|
-
}).split(
|
|
2272
|
+
}).split(fn.splitPipe), r = 0;
|
|
2256
2273
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
|
|
2257
2274
|
if (n.length > t) n.splice(t);
|
|
2258
2275
|
else for (; n.length < t;) n.push("");
|
|
2259
2276
|
}
|
|
2260
|
-
for (; r < n.length; r++) n[r] = n[r].trim().replace(
|
|
2277
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(fn.slashPipe, "|");
|
|
2261
2278
|
return n;
|
|
2262
2279
|
}
|
|
2263
2280
|
function L(e, t, n) {
|
|
@@ -2274,7 +2291,7 @@ function L(e, t, n) {
|
|
|
2274
2291
|
}
|
|
2275
2292
|
function ie(e) {
|
|
2276
2293
|
let t = e.split("\n"), n = t.length - 1;
|
|
2277
|
-
for (; n >= 0 &&
|
|
2294
|
+
for (; n >= 0 && fn.blankLine.test(t[n]);) n--;
|
|
2278
2295
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
2279
2296
|
}
|
|
2280
2297
|
function q(e) {
|
|
@@ -2354,7 +2371,7 @@ function we(e, t, n, r) {
|
|
|
2354
2371
|
}
|
|
2355
2372
|
var P = class {
|
|
2356
2373
|
constructor(e) {
|
|
2357
|
-
t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e ||
|
|
2374
|
+
t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e || ln;
|
|
2358
2375
|
}
|
|
2359
2376
|
space(e) {
|
|
2360
2377
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -2817,25 +2834,25 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2817
2834
|
};
|
|
2818
2835
|
}
|
|
2819
2836
|
}
|
|
2820
|
-
},
|
|
2837
|
+
}, Or = class l {
|
|
2821
2838
|
constructor(e) {
|
|
2822
|
-
t(this, "tokens", void 0), t(this, "options", void 0), t(this, "state", void 0), t(this, "inlineQueue", void 0), t(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
2839
|
+
t(this, "tokens", void 0), t(this, "options", void 0), t(this, "state", void 0), t(this, "inlineQueue", void 0), t(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || ln, this.options.tokenizer = this.options.tokenizer || new P(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
2823
2840
|
inLink: !1,
|
|
2824
2841
|
inRawBlock: !1,
|
|
2825
2842
|
linkEmitted: !1,
|
|
2826
2843
|
top: !0
|
|
2827
2844
|
};
|
|
2828
2845
|
let n = {
|
|
2829
|
-
other:
|
|
2830
|
-
block:
|
|
2831
|
-
inline:
|
|
2846
|
+
other: fn,
|
|
2847
|
+
block: Tr.normal,
|
|
2848
|
+
inline: Er.normal
|
|
2832
2849
|
};
|
|
2833
|
-
this.options.pedantic ? (n.block =
|
|
2850
|
+
this.options.pedantic ? (n.block = Tr.pedantic, n.inline = Er.pedantic) : this.options.gfm && (n.block = Tr.gfm, n.inline = this.options.breaks ? Er.breaks : Er.gfm), this.tokenizer.rules = n;
|
|
2834
2851
|
}
|
|
2835
2852
|
static get rules() {
|
|
2836
2853
|
return {
|
|
2837
|
-
block:
|
|
2838
|
-
inline:
|
|
2854
|
+
block: Tr,
|
|
2855
|
+
inline: Er
|
|
2839
2856
|
};
|
|
2840
2857
|
}
|
|
2841
2858
|
static lex(e, t) {
|
|
@@ -2845,7 +2862,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2845
2862
|
return new l(t).inlineTokens(e);
|
|
2846
2863
|
}
|
|
2847
2864
|
lex(e) {
|
|
2848
|
-
e = e.replace(
|
|
2865
|
+
e = e.replace(fn.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
2849
2866
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
2850
2867
|
let t = this.inlineQueue[e];
|
|
2851
2868
|
this.inlineTokens(t.src, t.tokens);
|
|
@@ -2853,7 +2870,7 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2853
2870
|
return this.inlineQueue = [], this.tokens;
|
|
2854
2871
|
}
|
|
2855
2872
|
blockTokens(e, t = [], n = !1) {
|
|
2856
|
-
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(
|
|
2873
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(fn.tabCharGlobal, " ").replace(fn.spaceLine, ""));
|
|
2857
2874
|
let r = 1 / 0;
|
|
2858
2875
|
for (; e;) {
|
|
2859
2876
|
if (e.length < r) r = e.length;
|
|
@@ -3055,13 +3072,13 @@ ${p.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
3055
3072
|
}
|
|
3056
3073
|
}, S = class {
|
|
3057
3074
|
constructor(e) {
|
|
3058
|
-
t(this, "options", void 0), t(this, "parser", void 0), this.options = e ||
|
|
3075
|
+
t(this, "options", void 0), t(this, "parser", void 0), this.options = e || ln;
|
|
3059
3076
|
}
|
|
3060
3077
|
space(e) {
|
|
3061
3078
|
return "";
|
|
3062
3079
|
}
|
|
3063
3080
|
code({ text: e, lang: t, escaped: n }) {
|
|
3064
|
-
let r = (t || "").match(
|
|
3081
|
+
let r = (t || "").match(fn.notSpaceStart)?.[0], i = e ? e.replace(fn.endingNewline, "") + "\n" : "";
|
|
3065
3082
|
return r ? "<pre><code class=\"language-" + O(r) + "\">" + (n ? i : O(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : O(i, !0)) + "</code></pre>\n";
|
|
3066
3083
|
}
|
|
3067
3084
|
blockquote({ tokens: e }) {
|
|
@@ -3189,9 +3206,9 @@ ${e}</tr>
|
|
|
3189
3206
|
checkbox({ raw: e }) {
|
|
3190
3207
|
return e;
|
|
3191
3208
|
}
|
|
3192
|
-
},
|
|
3209
|
+
}, kr = class l {
|
|
3193
3210
|
constructor(e) {
|
|
3194
|
-
t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e ||
|
|
3211
|
+
t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e || ln, this.options.renderer = this.options.renderer || new S(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z();
|
|
3195
3212
|
}
|
|
3196
3213
|
static parse(e, t) {
|
|
3197
3214
|
return new l(t).parse(e);
|
|
@@ -3339,9 +3356,9 @@ ${e}</tr>
|
|
|
3339
3356
|
}
|
|
3340
3357
|
return n;
|
|
3341
3358
|
}
|
|
3342
|
-
},
|
|
3359
|
+
}, Ar = (_Class = class {
|
|
3343
3360
|
constructor(e) {
|
|
3344
|
-
t(this, "options", void 0), t(this, "block", void 0), this.options = e ||
|
|
3361
|
+
t(this, "options", void 0), t(this, "block", void 0), this.options = e || ln;
|
|
3345
3362
|
}
|
|
3346
3363
|
preprocess(e) {
|
|
3347
3364
|
return e;
|
|
@@ -3356,10 +3373,10 @@ ${e}</tr>
|
|
|
3356
3373
|
return e;
|
|
3357
3374
|
}
|
|
3358
3375
|
provideLexer(e = this.block) {
|
|
3359
|
-
return e ?
|
|
3376
|
+
return e ? Or.lex : Or.lexInline;
|
|
3360
3377
|
}
|
|
3361
3378
|
provideParser(e = this.block) {
|
|
3362
|
-
return e ?
|
|
3379
|
+
return e ? kr.parse : kr.parseInline;
|
|
3363
3380
|
}
|
|
3364
3381
|
}, t(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
3365
3382
|
"preprocess",
|
|
@@ -3372,7 +3389,7 @@ ${e}</tr>
|
|
|
3372
3389
|
"processAllTokens"
|
|
3373
3390
|
])), _Class), F = class {
|
|
3374
3391
|
constructor(...e) {
|
|
3375
|
-
t(this, "defaults", I()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser",
|
|
3392
|
+
t(this, "defaults", I()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser", kr), t(this, "Renderer", S), t(this, "TextRenderer", z), t(this, "Lexer", Or), t(this, "Tokenizer", P), t(this, "Hooks", Ar), this.use(...e);
|
|
3376
3393
|
}
|
|
3377
3394
|
walkTokens(e, t) {
|
|
3378
3395
|
let n = [];
|
|
@@ -3451,13 +3468,13 @@ ${e}</tr>
|
|
|
3451
3468
|
n.tokenizer = t;
|
|
3452
3469
|
}
|
|
3453
3470
|
if (e.hooks) {
|
|
3454
|
-
let t = this.defaults.hooks || new
|
|
3471
|
+
let t = this.defaults.hooks || new Ar();
|
|
3455
3472
|
for (let n in e.hooks) {
|
|
3456
3473
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
3457
3474
|
if (["options", "block"].includes(n)) continue;
|
|
3458
3475
|
let r = n, i = e.hooks[r], a = t[r];
|
|
3459
|
-
t[r] =
|
|
3460
|
-
if (this.defaults.async &&
|
|
3476
|
+
t[r] = Ar.passThroughHooks.has(n) ? (e) => {
|
|
3477
|
+
if (this.defaults.async && Ar.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
3461
3478
|
let n = await i.call(t, e);
|
|
3462
3479
|
return a.call(t, n);
|
|
3463
3480
|
})();
|
|
@@ -3494,10 +3511,10 @@ ${e}</tr>
|
|
|
3494
3511
|
}, this;
|
|
3495
3512
|
}
|
|
3496
3513
|
lexer(e, t) {
|
|
3497
|
-
return
|
|
3514
|
+
return Or.lex(e, t ?? this.defaults);
|
|
3498
3515
|
}
|
|
3499
3516
|
parser(e, t) {
|
|
3500
|
-
return
|
|
3517
|
+
return kr.parse(e, t ?? this.defaults);
|
|
3501
3518
|
}
|
|
3502
3519
|
parseMarkdown(e) {
|
|
3503
3520
|
return (t, n) => {
|
|
@@ -3509,16 +3526,16 @@ ${e}</tr>
|
|
|
3509
3526
|
if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
3510
3527
|
if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
|
|
3511
3528
|
if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
|
|
3512
|
-
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ?
|
|
3529
|
+
let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? Or.lex : Or.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
|
|
3513
3530
|
i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
|
|
3514
|
-
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ?
|
|
3531
|
+
let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? kr.parse : kr.parseInline)(a, i);
|
|
3515
3532
|
return i.hooks ? await i.hooks.postprocess(o) : o;
|
|
3516
3533
|
})().catch(a);
|
|
3517
3534
|
try {
|
|
3518
3535
|
i.hooks && (t = i.hooks.preprocess(t));
|
|
3519
|
-
let n = (i.hooks ? i.hooks.provideLexer(e) : e ?
|
|
3536
|
+
let n = (i.hooks ? i.hooks.provideLexer(e) : e ? Or.lex : Or.lexInline)(t, i);
|
|
3520
3537
|
i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
|
|
3521
|
-
let r = (i.hooks ? i.hooks.provideParser(e) : e ?
|
|
3538
|
+
let r = (i.hooks ? i.hooks.provideParser(e) : e ? kr.parse : kr.parseInline)(n, i);
|
|
3522
3539
|
return i.hooks && (r = i.hooks.postprocess(r)), r;
|
|
3523
3540
|
} catch (e) {
|
|
3524
3541
|
return a(e);
|
|
@@ -3535,22 +3552,22 @@ ${e}</tr>
|
|
|
3535
3552
|
throw n;
|
|
3536
3553
|
};
|
|
3537
3554
|
}
|
|
3538
|
-
},
|
|
3555
|
+
}, jr = new F();
|
|
3539
3556
|
function k(e, t) {
|
|
3540
|
-
return
|
|
3557
|
+
return jr.parse(e, t);
|
|
3541
3558
|
}
|
|
3542
3559
|
k.options = k.setOptions = function(e) {
|
|
3543
|
-
return
|
|
3544
|
-
}, k.getDefaults = I, k.defaults =
|
|
3560
|
+
return jr.setOptions(e), k.defaults = jr.defaults, W(k.defaults), k;
|
|
3561
|
+
}, k.getDefaults = I, k.defaults = ln;
|
|
3545
3562
|
function Pt(...e) {
|
|
3546
|
-
return
|
|
3563
|
+
return jr.use(...e), k.defaults = jr.defaults, W(k.defaults), k;
|
|
3547
3564
|
}
|
|
3548
3565
|
k.use = Pt, k.walkTokens = function(e, t) {
|
|
3549
|
-
return
|
|
3550
|
-
}, k.parseInline =
|
|
3566
|
+
return jr.walkTokens(e, t);
|
|
3567
|
+
}, k.parseInline = jr.parseInline, k.Parser = kr, k.parser = kr.parse, k.Renderer = S, k.TextRenderer = z, k.Lexer = Or, k.lexer = Or.lex, k.Tokenizer = P, k.Hooks = Ar, k.parse = k, k.options, k.setOptions, k.walkTokens, k.parseInline, kr.parse, Or.lex;
|
|
3551
3568
|
//#endregion
|
|
3552
3569
|
//#region bot/ui/ChatCardBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3553
|
-
var
|
|
3570
|
+
var Mr = ["aria-label"], Nr = { class: "px-4 pb-2 pt-4" }, Pr = ["innerHTML"], Fr = ["onClick"], Ir = /* @__PURE__ */ D({
|
|
3554
3571
|
__name: "ChatCardBlock",
|
|
3555
3572
|
props: {
|
|
3556
3573
|
spec: {},
|
|
@@ -3558,11 +3575,11 @@ var kr = ["aria-label"], Ar = { class: "px-4 pb-2 pt-4" }, jr = ["innerHTML"], M
|
|
|
3558
3575
|
},
|
|
3559
3576
|
emits: ["action"],
|
|
3560
3577
|
setup(e, { emit: t }) {
|
|
3561
|
-
let n = e, r = t, i =
|
|
3578
|
+
let n = e, r = t, i = v(() => {
|
|
3562
3579
|
if (!n.spec.body) return "";
|
|
3563
3580
|
let e = k.parse(n.spec.body, { async: !1 });
|
|
3564
|
-
return
|
|
3565
|
-
}), a =
|
|
3581
|
+
return cn.sanitize(e, { ADD_ATTR: ["target"] });
|
|
3582
|
+
}), a = v(() => n.inverted ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.16)"), o = v(() => n.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-200) 80%, transparent)"), s = v(() => n.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), c = v(() => n.inverted ? "rgba(255, 255, 255, 0.8)" : "var(--color-theme-800)"), d = v(() => n.inverted ? `inset 0 0 0 1px ${a.value}` : `inset 0 0 0 1px ${a.value}, 0 4px 16px rgba(15, 23, 42, 0.05)`), f = v(() => n.inverted ? "transparent" : "var(--color-theme-0)");
|
|
3566
3583
|
function actionStyle(e) {
|
|
3567
3584
|
return e === "primary" || e === "destructive" ? {
|
|
3568
3585
|
background: n.inverted ? "rgba(255, 255, 255, 0.92)" : "var(--color-theme-900)",
|
|
@@ -3572,45 +3589,45 @@ var kr = ["aria-label"], Ar = { class: "px-4 pb-2 pt-4" }, jr = ["innerHTML"], M
|
|
|
3572
3589
|
color: s.value
|
|
3573
3590
|
};
|
|
3574
3591
|
}
|
|
3575
|
-
return (t, n) => (
|
|
3592
|
+
return (t, n) => (R(), x("div", {
|
|
3576
3593
|
"data-test": "chat-card",
|
|
3577
3594
|
class: "my-6 w-full self-start overflow-hidden rounded-2xl",
|
|
3578
|
-
style:
|
|
3595
|
+
style: N({
|
|
3579
3596
|
background: f.value,
|
|
3580
3597
|
boxShadow: d.value
|
|
3581
3598
|
}),
|
|
3582
3599
|
"aria-label": e.spec.title
|
|
3583
3600
|
}, [
|
|
3584
|
-
|
|
3601
|
+
w("div", Nr, [w("div", {
|
|
3585
3602
|
class: "text-[14px] font-semibold leading-tight",
|
|
3586
|
-
style:
|
|
3587
|
-
},
|
|
3588
|
-
i.value ? (
|
|
3603
|
+
style: N({ color: s.value })
|
|
3604
|
+
}, G(e.spec.title), 5)]),
|
|
3605
|
+
i.value ? (R(), x("div", {
|
|
3589
3606
|
key: 0,
|
|
3590
3607
|
class: "chat-msg-prose px-4 pb-4 pt-2 text-[14px] leading-relaxed",
|
|
3591
|
-
style:
|
|
3608
|
+
style: N({ color: c.value }),
|
|
3592
3609
|
innerHTML: i.value
|
|
3593
|
-
}, null, 12,
|
|
3594
|
-
e.spec.actions?.length ? (
|
|
3610
|
+
}, null, 12, Pr)) : b("", !0),
|
|
3611
|
+
e.spec.actions?.length ? (R(), x("div", {
|
|
3595
3612
|
key: 1,
|
|
3596
3613
|
class: "flex flex-wrap items-center gap-2 px-3 py-2.5",
|
|
3597
|
-
style:
|
|
3598
|
-
}, [(
|
|
3614
|
+
style: N({ borderTop: `1px solid ${o.value}` })
|
|
3615
|
+
}, [(R(!0), x(m, null, V(e.spec.actions, (e) => (R(), x("button", {
|
|
3599
3616
|
key: e.label,
|
|
3600
3617
|
type: "button",
|
|
3601
3618
|
"data-test": "chat-card-action",
|
|
3602
3619
|
class: "inline-flex h-10 items-center justify-center rounded-full px-5 text-[14px] font-semibold transition-colors duration-150 active:opacity-80",
|
|
3603
|
-
style:
|
|
3620
|
+
style: N(actionStyle(e.style)),
|
|
3604
3621
|
onClick: (t) => r("action", e.reply)
|
|
3605
|
-
},
|
|
3606
|
-
], 12,
|
|
3622
|
+
}, G(e.label), 13, Fr))), 128))], 4)) : b("", !0)
|
|
3623
|
+
], 12, Mr));
|
|
3607
3624
|
}
|
|
3608
|
-
}),
|
|
3625
|
+
}), Lr = 112, Rr = 52, zr = 14, Br = 54, Vr = 34, Hr = 260;
|
|
3609
3626
|
function nodeWidthFor(e) {
|
|
3610
3627
|
let { orientation: t, maxRows: n, maxWidth: r } = e;
|
|
3611
|
-
if (t === "horizontal" || !r) return
|
|
3612
|
-
let i = r - 28 - (n - 1) *
|
|
3613
|
-
return Math.min(
|
|
3628
|
+
if (t === "horizontal" || !r) return Lr;
|
|
3629
|
+
let i = r - 28 - (n - 1) * Br;
|
|
3630
|
+
return Math.min(Hr, Math.max(Lr, Math.floor(i / n)));
|
|
3614
3631
|
}
|
|
3615
3632
|
function orientationFor(e) {
|
|
3616
3633
|
return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
|
|
@@ -3647,11 +3664,11 @@ function buildLayout(e, t, n) {
|
|
|
3647
3664
|
orientation: t,
|
|
3648
3665
|
maxRows: o,
|
|
3649
3666
|
...n === void 0 ? {} : { maxWidth: n }
|
|
3650
|
-
}), d = t === "horizontal" ? 28 + s * c + (s - 1) *
|
|
3667
|
+
}), d = t === "horizontal" ? 28 + s * c + (s - 1) * Br : 28 + o * c + (o - 1) * Br, f = t === "horizontal" ? 28 + o * Rr + (o - 1) * Vr : 28 + s * Rr + (s - 1) * Vr, p = [];
|
|
3651
3668
|
for (let [e, [, n]] of a.entries()) {
|
|
3652
|
-
let r = (o - n.length) * (t === "horizontal" ? 86 : c +
|
|
3669
|
+
let r = (o - n.length) * (t === "horizontal" ? 86 : c + Br) / 2;
|
|
3653
3670
|
for (let [i, a] of n.entries()) {
|
|
3654
|
-
let n = t === "horizontal" ?
|
|
3671
|
+
let n = t === "horizontal" ? zr + e * (c + Br) : zr + r + i * (c + Br), o = t === "horizontal" ? zr + r + i * 86 : zr + e * 86;
|
|
3655
3672
|
p.push({
|
|
3656
3673
|
id: a.id,
|
|
3657
3674
|
label: a.label,
|
|
@@ -3660,7 +3677,7 @@ function buildLayout(e, t, n) {
|
|
|
3660
3677
|
x: n,
|
|
3661
3678
|
y: o,
|
|
3662
3679
|
width: c,
|
|
3663
|
-
height:
|
|
3680
|
+
height: Rr
|
|
3664
3681
|
});
|
|
3665
3682
|
}
|
|
3666
3683
|
}
|
|
@@ -3737,14 +3754,14 @@ function formatChatVisualTick(e) {
|
|
|
3737
3754
|
let { prefix: r, suffix: i } = affixes(n);
|
|
3738
3755
|
return `${r}${formatChatVisualValue({ value: t })}${i}`;
|
|
3739
3756
|
}
|
|
3740
|
-
var
|
|
3757
|
+
var Ur = 5.4, Wr = 10, Gr = 15, Kr = 16;
|
|
3741
3758
|
function planChatVisualXLabels(e) {
|
|
3742
3759
|
let { labels: t, plotWidth: n } = e;
|
|
3743
3760
|
if (!t.length || n <= 0) return {
|
|
3744
3761
|
mode: "horizontal",
|
|
3745
3762
|
entries: []
|
|
3746
3763
|
};
|
|
3747
|
-
let r = t.map((e) => e.length >
|
|
3764
|
+
let r = t.map((e) => e.length > Kr ? `${e.slice(0, 15).trimEnd()}\u2026` : e), i = t.length - 1;
|
|
3748
3765
|
if (i === 0) return {
|
|
3749
3766
|
mode: "horizontal",
|
|
3750
3767
|
entries: [{
|
|
@@ -3752,14 +3769,14 @@ function planChatVisualXLabels(e) {
|
|
|
3752
3769
|
text: r[0]
|
|
3753
3770
|
}]
|
|
3754
3771
|
};
|
|
3755
|
-
if ((Math.max(...r.map((e) => e.length *
|
|
3772
|
+
if ((Math.max(...r.map((e) => e.length * Ur)) + Wr) * t.length <= n) return {
|
|
3756
3773
|
mode: "horizontal",
|
|
3757
3774
|
entries: r.map((e, t) => ({
|
|
3758
3775
|
index: t,
|
|
3759
3776
|
text: e
|
|
3760
3777
|
}))
|
|
3761
3778
|
};
|
|
3762
|
-
let a = Math.max(2, Math.floor(n /
|
|
3779
|
+
let a = Math.max(2, Math.floor(n / Gr));
|
|
3763
3780
|
if (t.length <= a) return {
|
|
3764
3781
|
mode: "angled",
|
|
3765
3782
|
entries: r.map((e, t) => ({
|
|
@@ -3779,22 +3796,22 @@ function planChatVisualXLabels(e) {
|
|
|
3779
3796
|
}
|
|
3780
3797
|
//#endregion
|
|
3781
3798
|
//#region bot/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3782
|
-
var
|
|
3799
|
+
var qr = [
|
|
3783
3800
|
"data-visual-type",
|
|
3784
3801
|
"data-chart-type",
|
|
3785
3802
|
"data-stacking",
|
|
3786
3803
|
"data-diagram-type",
|
|
3787
3804
|
"aria-label"
|
|
3788
|
-
],
|
|
3805
|
+
], Jr = { class: "mb-2.5" }, Yr = ["aria-label"], Xr = {
|
|
3789
3806
|
key: 0,
|
|
3790
3807
|
"data-test": "chat-visual-horizontal-bars",
|
|
3791
3808
|
class: "grid gap-3"
|
|
3792
|
-
},
|
|
3809
|
+
}, Zr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Qr = ["viewBox"], $r = [
|
|
3793
3810
|
"x1",
|
|
3794
3811
|
"x2",
|
|
3795
3812
|
"y1",
|
|
3796
3813
|
"y2"
|
|
3797
|
-
],
|
|
3814
|
+
], ei = ["x", "y"], ti = [
|
|
3798
3815
|
"data-row-index",
|
|
3799
3816
|
"data-series-index",
|
|
3800
3817
|
"data-data-key",
|
|
@@ -3802,56 +3819,56 @@ var Wr = [
|
|
|
3802
3819
|
"y",
|
|
3803
3820
|
"width",
|
|
3804
3821
|
"height"
|
|
3805
|
-
],
|
|
3822
|
+
], ni = ["data-trend-key", "d"], ri = ["d"], ii = ["cx", "cy"], ai = ["cx", "cy"], oi = [
|
|
3806
3823
|
"x",
|
|
3807
3824
|
"y",
|
|
3808
3825
|
"text-anchor",
|
|
3809
3826
|
"transform"
|
|
3810
|
-
],
|
|
3827
|
+
], si = {
|
|
3811
3828
|
key: 2,
|
|
3812
3829
|
class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
|
|
3813
|
-
},
|
|
3830
|
+
}, ci = {
|
|
3814
3831
|
key: 1,
|
|
3815
3832
|
class: "grid gap-3"
|
|
3816
|
-
},
|
|
3833
|
+
}, li = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, ui = { class: "shrink-0 tabular-nums" }, di = {
|
|
3817
3834
|
key: 2,
|
|
3818
3835
|
class: "overflow-x-auto"
|
|
3819
|
-
},
|
|
3836
|
+
}, fi = ["viewBox", "aria-label"], pi = [
|
|
3820
3837
|
"data-from",
|
|
3821
3838
|
"data-to",
|
|
3822
3839
|
"x1",
|
|
3823
3840
|
"y1",
|
|
3824
3841
|
"x2",
|
|
3825
3842
|
"y2"
|
|
3826
|
-
],
|
|
3843
|
+
], mi = ["cx", "cy"], hi = ["x", "y"], gi = [
|
|
3827
3844
|
"data-node-id",
|
|
3828
3845
|
"data-node-kind",
|
|
3829
3846
|
"transform"
|
|
3830
|
-
],
|
|
3847
|
+
], _i = ["points"], vi = ["width", "height"], yi = ["width", "height"], bi = {
|
|
3831
3848
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
3832
3849
|
class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
|
|
3833
|
-
},
|
|
3850
|
+
}, xi = /* @__PURE__ */ D({
|
|
3834
3851
|
__name: "ChatVisualBlock",
|
|
3835
3852
|
props: {
|
|
3836
3853
|
result: {},
|
|
3837
3854
|
inverted: { type: Boolean }
|
|
3838
3855
|
},
|
|
3839
3856
|
setup(e) {
|
|
3840
|
-
let t = e, n =
|
|
3857
|
+
let t = e, n = B(), r = U(360), i;
|
|
3841
3858
|
ne(() => {
|
|
3842
3859
|
typeof ResizeObserver < "u" && n.value && (i = new ResizeObserver((e) => {
|
|
3843
3860
|
let t = e[0]?.contentRect.width;
|
|
3844
3861
|
t && (r.value = Math.round(t));
|
|
3845
3862
|
}), i.observe(n.value));
|
|
3846
3863
|
}), te(() => i?.disconnect());
|
|
3847
|
-
let a =
|
|
3864
|
+
let a = v(() => Math.min(720, Math.max(280, r.value))), o = v(() => t.result.ok ? t.result.spec : null), s = v(() => o.value?.visualType === "chart" ? o.value : null), c = v(() => o.value?.visualType === "diagram" ? o.value : null);
|
|
3848
3865
|
function isCartesianChart(e) {
|
|
3849
3866
|
return e?.chartType === "bar" || e?.chartType === "line" || e?.chartType === "scatter";
|
|
3850
3867
|
}
|
|
3851
3868
|
function isPieChart(e) {
|
|
3852
3869
|
return e?.chartType === "pie";
|
|
3853
3870
|
}
|
|
3854
|
-
let d =
|
|
3871
|
+
let d = v(() => s.value?.data ?? []), f = v(() => isCartesianChart(s.value) ? s.value : null), p = v(() => f.value?.series ?? []), g = v(() => isPieChart(s.value) ? s.value : null), _ = v(() => f.value?.chartType === "bar" && f.value.stacking === "stacked");
|
|
3855
3872
|
function numericValue(e) {
|
|
3856
3873
|
return typeof e == "number" && Number.isFinite(e) ? e : null;
|
|
3857
3874
|
}
|
|
@@ -3883,7 +3900,7 @@ var Wr = [
|
|
|
3883
3900
|
intercept: (r - s * n) / t
|
|
3884
3901
|
};
|
|
3885
3902
|
}
|
|
3886
|
-
let
|
|
3903
|
+
let y = v(() => {
|
|
3887
3904
|
let e = [], t = f.value;
|
|
3888
3905
|
if (!t) return e;
|
|
3889
3906
|
if (t.chartType === "bar" && t.stacking === "stacked") for (let n of t.data) {
|
|
@@ -3913,8 +3930,8 @@ var Wr = [
|
|
|
3913
3930
|
let n = e > 0 ? e : 1, r = Math.floor(Math.log10(n)), i = n / 10 ** r, a;
|
|
3914
3931
|
return a = t ? i < 1.5 ? 1 : i < 3 ? 2 : i < 7 ? 5 : 10 : i <= 1 ? 1 : i <= 2 ? 2 : i <= 5 ? 5 : 10, a * 10 ** r;
|
|
3915
3932
|
}
|
|
3916
|
-
let T =
|
|
3917
|
-
let e =
|
|
3933
|
+
let T = v(() => {
|
|
3934
|
+
let e = y.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
|
|
3918
3935
|
if (n === t) return {
|
|
3919
3936
|
min: 0,
|
|
3920
3937
|
max: t || 1,
|
|
@@ -3927,7 +3944,7 @@ var Wr = [
|
|
|
3927
3944
|
max: a,
|
|
3928
3945
|
ticks: o
|
|
3929
3946
|
};
|
|
3930
|
-
}), E =
|
|
3947
|
+
}), E = v(() => resolveSharedSeriesFormat({ series: p.value })), D = v(() => {
|
|
3931
3948
|
let e = f.value;
|
|
3932
3949
|
if (!e) return {
|
|
3933
3950
|
mode: "horizontal",
|
|
@@ -3938,8 +3955,8 @@ var Wr = [
|
|
|
3938
3955
|
labels: e.data.map((e) => String(e?.[t] ?? "")),
|
|
3939
3956
|
plotWidth: Math.max(200, a.value - 42)
|
|
3940
3957
|
});
|
|
3941
|
-
}),
|
|
3942
|
-
let e = E.value?.valueFormat, t = !!(E.value && (e === "currency" || e === "percent" || E.value.valuePrefix || E.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r =
|
|
3958
|
+
}), A = v(() => {
|
|
3959
|
+
let e = E.value?.valueFormat, t = !!(E.value && (e === "currency" || e === "percent" || E.value.valuePrefix || E.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = D.value.mode === "angled";
|
|
3943
3960
|
return {
|
|
3944
3961
|
width: a.value,
|
|
3945
3962
|
height: 168 + (r ? 36 : 0),
|
|
@@ -3950,7 +3967,7 @@ var Wr = [
|
|
|
3950
3967
|
};
|
|
3951
3968
|
});
|
|
3952
3969
|
function labelCenterX(e, t) {
|
|
3953
|
-
let n = f.value, r =
|
|
3970
|
+
let n = f.value, r = A.value;
|
|
3954
3971
|
if (n?.chartType === "bar") {
|
|
3955
3972
|
let n = r.width - r.left - r.right;
|
|
3956
3973
|
return r.left + (e + .5) * (n / Math.max(t, 1));
|
|
@@ -3958,11 +3975,11 @@ var Wr = [
|
|
|
3958
3975
|
return xForIndex(e, t);
|
|
3959
3976
|
}
|
|
3960
3977
|
function xForIndex(e, t) {
|
|
3961
|
-
let n =
|
|
3978
|
+
let n = A.value, r = n.width - n.left - n.right;
|
|
3962
3979
|
return t <= 1 ? n.left + r / 2 : n.left + r * e / (t - 1);
|
|
3963
3980
|
}
|
|
3964
3981
|
function yForValue(e) {
|
|
3965
|
-
let { min: t, max: n } = T.value, r =
|
|
3982
|
+
let { min: t, max: n } = T.value, r = A.value, i = r.height - r.top - r.bottom;
|
|
3966
3983
|
return r.top + (n - e) / (n - t || 1) * i;
|
|
3967
3984
|
}
|
|
3968
3985
|
function pathForSeries(e) {
|
|
@@ -3972,7 +3989,7 @@ var Wr = [
|
|
|
3972
3989
|
return `${r === 0 ? "M" : "L"} ${xForIndex(r, t.data.length).toFixed(1)} ${yForValue(i).toFixed(1)}`;
|
|
3973
3990
|
}).join(" ") : "";
|
|
3974
3991
|
}
|
|
3975
|
-
let
|
|
3992
|
+
let ee = v(() => {
|
|
3976
3993
|
let e = f.value;
|
|
3977
3994
|
if (!e?.trendLine || e.chartType !== "line" && e.chartType !== "scatter") return null;
|
|
3978
3995
|
let t = trendLinePoints(e, e.trendLine.dataKey), n = linearTrend(t);
|
|
@@ -3983,11 +4000,11 @@ var Wr = [
|
|
|
3983
4000
|
dataKey: e.trendLine.dataKey,
|
|
3984
4001
|
seriesIndex: s
|
|
3985
4002
|
};
|
|
3986
|
-
}),
|
|
4003
|
+
}), j = v(() => {
|
|
3987
4004
|
let e = f.value;
|
|
3988
4005
|
if (!e || e.chartType !== "bar") return [];
|
|
3989
|
-
let t =
|
|
3990
|
-
if (
|
|
4006
|
+
let t = A.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
|
|
4007
|
+
if (_.value) {
|
|
3991
4008
|
let r = Math.max(4, Math.min(24, n * .42));
|
|
3992
4009
|
return e.data.flatMap((i, a) => {
|
|
3993
4010
|
let o = 0, s = 0, c = t.left + a * n + (n - r) / 2;
|
|
@@ -4020,12 +4037,12 @@ var Wr = [
|
|
|
4020
4037
|
dataKey: e.dataKey
|
|
4021
4038
|
};
|
|
4022
4039
|
}));
|
|
4023
|
-
}),
|
|
4040
|
+
}), M = v(() => {
|
|
4024
4041
|
let e = f.value;
|
|
4025
4042
|
if (!e) return [];
|
|
4026
4043
|
let t = e.data;
|
|
4027
4044
|
if (!t.length) return [];
|
|
4028
|
-
let n = t.length - 1, r =
|
|
4045
|
+
let n = t.length - 1, r = D.value, i = r.mode === "angled";
|
|
4029
4046
|
return r.entries.map(({ index: e, text: r }) => ({
|
|
4030
4047
|
key: `${e}`,
|
|
4031
4048
|
label: r,
|
|
@@ -4033,9 +4050,9 @@ var Wr = [
|
|
|
4033
4050
|
anchor: i ? "end" : e === 0 ? "start" : e === n ? "end" : "middle",
|
|
4034
4051
|
angled: i
|
|
4035
4052
|
})).filter((e) => e.label);
|
|
4036
|
-
}),
|
|
4053
|
+
}), ae = v(() => {
|
|
4037
4054
|
let e = f.value;
|
|
4038
|
-
if (!e || e.chartType !== "bar" || e.series.length !== 1 ||
|
|
4055
|
+
if (!e || e.chartType !== "bar" || e.series.length !== 1 || _.value) return [];
|
|
4039
4056
|
let t = e.series[0], n = e.data.map((n, r) => {
|
|
4040
4057
|
let i = categoryLabel(n, e.xKey), a = numericValue(n[t.dataKey]);
|
|
4041
4058
|
return !i || a === null ? null : {
|
|
@@ -4056,7 +4073,7 @@ var Wr = [
|
|
|
4056
4073
|
width: e.rawValue <= 0 ? 0 : Math.max(2, e.rawValue / r * 100),
|
|
4057
4074
|
seriesIndex: 0
|
|
4058
4075
|
}));
|
|
4059
|
-
}),
|
|
4076
|
+
}), ce = v(() => {
|
|
4060
4077
|
let e = f.value;
|
|
4061
4078
|
if (!e?.data.length) return [];
|
|
4062
4079
|
let t = e.data[e.data.length - 1];
|
|
@@ -4072,7 +4089,7 @@ var Wr = [
|
|
|
4072
4089
|
seriesIndex: n
|
|
4073
4090
|
};
|
|
4074
4091
|
});
|
|
4075
|
-
}),
|
|
4092
|
+
}), H = v(() => {
|
|
4076
4093
|
let e = f.value;
|
|
4077
4094
|
if (!e?.data.length || e.chartType !== "line") return [];
|
|
4078
4095
|
let t = e.data.length - 1, n = e.data[t];
|
|
@@ -4085,7 +4102,7 @@ var Wr = [
|
|
|
4085
4102
|
seriesIndex: i
|
|
4086
4103
|
};
|
|
4087
4104
|
}).filter((e) => e !== null);
|
|
4088
|
-
}),
|
|
4105
|
+
}), ue = v(() => {
|
|
4089
4106
|
let e = g.value;
|
|
4090
4107
|
if (!e) return [];
|
|
4091
4108
|
let t = e.data.map((t) => ({
|
|
@@ -4101,104 +4118,104 @@ var Wr = [
|
|
|
4101
4118
|
series: r
|
|
4102
4119
|
})
|
|
4103
4120
|
}));
|
|
4104
|
-
}),
|
|
4121
|
+
}), fe = v(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), pe = [
|
|
4105
4122
|
"var(--color-theme-900)",
|
|
4106
4123
|
"var(--color-primary-500)",
|
|
4107
4124
|
"color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
|
|
4108
|
-
],
|
|
4125
|
+
], me = [
|
|
4109
4126
|
"rgba(255, 255, 255, 0.92)",
|
|
4110
4127
|
"color-mix(in oklch, white 30%, var(--color-primary-500))",
|
|
4111
4128
|
"rgba(255, 255, 255, 0.55)"
|
|
4112
4129
|
];
|
|
4113
4130
|
function seriesColor(e) {
|
|
4114
|
-
let n = t.inverted ?
|
|
4131
|
+
let n = t.inverted ? me : pe;
|
|
4115
4132
|
return n[e % n.length];
|
|
4116
4133
|
}
|
|
4117
4134
|
function diagramNodeFill(e) {
|
|
4118
4135
|
return t.inverted ? e === "decision" ? "rgba(255, 255, 255, 0.1)" : "rgba(255, 255, 255, 0.06)" : e === "decision" ? "color-mix(in oklch, var(--color-primary-500) 6%, var(--color-theme-0))" : e === "output" ? "color-mix(in oklch, var(--color-theme-900) 5%, var(--color-theme-0))" : "var(--color-theme-0)";
|
|
4119
4136
|
}
|
|
4120
4137
|
function diagramNodeStroke(e) {
|
|
4121
|
-
return t.inverted ? "rgba(255, 255, 255, 0.22)" :
|
|
4138
|
+
return t.inverted ? "rgba(255, 255, 255, 0.22)" : ve.value;
|
|
4122
4139
|
}
|
|
4123
|
-
let
|
|
4124
|
-
return (e, r) => o.value ? (
|
|
4140
|
+
let he = v(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ge = v(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), K = v(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), _e = v(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), J = v(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), ve = v(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), Y = v(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), ye = v(() => t.inverted ? "transparent" : "var(--color-theme-0)"), xe = v(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Se = v(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
4141
|
+
return (e, r) => o.value ? (R(), x("section", {
|
|
4125
4142
|
key: 0,
|
|
4126
4143
|
"data-test": "chat-visual",
|
|
4127
4144
|
"data-visual-type": o.value.visualType,
|
|
4128
4145
|
"data-chart-type": s.value?.chartType,
|
|
4129
|
-
"data-stacking":
|
|
4146
|
+
"data-stacking": _.value ? "stacked" : void 0,
|
|
4130
4147
|
"data-diagram-type": c.value?.diagramType,
|
|
4131
4148
|
class: "my-6 w-full rounded-[20px] px-4 pb-3.5 pt-4",
|
|
4132
|
-
style:
|
|
4133
|
-
background:
|
|
4134
|
-
boxShadow: `inset 0 0 0 1px ${
|
|
4149
|
+
style: N({
|
|
4150
|
+
background: ye.value,
|
|
4151
|
+
boxShadow: `inset 0 0 0 1px ${Y.value}`
|
|
4135
4152
|
}),
|
|
4136
4153
|
"aria-label": o.value.meta.title
|
|
4137
4154
|
}, [
|
|
4138
|
-
|
|
4155
|
+
w("header", Jr, [w("h4", {
|
|
4139
4156
|
class: "text-[13px] font-semibold leading-tight",
|
|
4140
|
-
style:
|
|
4141
|
-
},
|
|
4157
|
+
style: N({ color: he.value })
|
|
4158
|
+
}, G(o.value.meta.title), 5), o.value.meta.description ? (R(), x("p", {
|
|
4142
4159
|
key: 0,
|
|
4143
4160
|
class: "mt-0.5 text-[12px] leading-snug",
|
|
4144
|
-
style:
|
|
4145
|
-
},
|
|
4146
|
-
|
|
4161
|
+
style: N({ color: ge.value })
|
|
4162
|
+
}, G(o.value.meta.description), 5)) : b("", !0)]),
|
|
4163
|
+
w("div", {
|
|
4147
4164
|
ref_key: "bodyEl",
|
|
4148
4165
|
ref: n
|
|
4149
|
-
}, [f.value ? (
|
|
4166
|
+
}, [f.value ? (R(), x("div", {
|
|
4150
4167
|
key: 0,
|
|
4151
4168
|
role: "img",
|
|
4152
4169
|
"aria-label": o.value.meta.title
|
|
4153
|
-
}, [
|
|
4170
|
+
}, [ae.value.length ? (R(), x("div", Xr, [(R(!0), x(m, null, V(ae.value, (e) => (R(), x("div", {
|
|
4154
4171
|
key: e.key,
|
|
4155
4172
|
"data-test": "chat-visual-horizontal-bar",
|
|
4156
4173
|
class: "min-w-0"
|
|
4157
|
-
}, [
|
|
4174
|
+
}, [w("div", Zr, [w("span", {
|
|
4158
4175
|
class: "line-clamp-2 min-w-0 font-medium leading-snug",
|
|
4159
|
-
style:
|
|
4160
|
-
},
|
|
4176
|
+
style: N({ color: he.value })
|
|
4177
|
+
}, G(e.label), 5), w("span", {
|
|
4161
4178
|
class: "shrink-0 font-semibold tabular-nums",
|
|
4162
|
-
style:
|
|
4163
|
-
},
|
|
4179
|
+
style: N({ color: he.value })
|
|
4180
|
+
}, G(e.value), 5)]), w("div", {
|
|
4164
4181
|
class: "h-2 w-full overflow-hidden rounded-full",
|
|
4165
|
-
style:
|
|
4166
|
-
}, [
|
|
4182
|
+
style: N({ background: Se.value })
|
|
4183
|
+
}, [w("div", {
|
|
4167
4184
|
class: "h-full rounded-full",
|
|
4168
|
-
style:
|
|
4185
|
+
style: N({
|
|
4169
4186
|
width: `${e.width}%`,
|
|
4170
4187
|
background: seriesColor(e.seriesIndex)
|
|
4171
4188
|
})
|
|
4172
|
-
}, null, 4)], 4)]))), 128))])) : (
|
|
4189
|
+
}, null, 4)], 4)]))), 128))])) : (R(), x("svg", {
|
|
4173
4190
|
key: 1,
|
|
4174
4191
|
class: "block h-auto w-full overflow-visible",
|
|
4175
|
-
viewBox: `0 0 ${
|
|
4176
|
-
style:
|
|
4192
|
+
viewBox: `0 0 ${A.value.width} ${A.value.height}`,
|
|
4193
|
+
style: N({ aspectRatio: `${A.value.width} / ${A.value.height}` }),
|
|
4177
4194
|
preserveAspectRatio: "xMidYMid meet",
|
|
4178
4195
|
"aria-hidden": "true"
|
|
4179
4196
|
}, [
|
|
4180
|
-
(
|
|
4197
|
+
(R(!0), x(m, null, V(T.value.ticks, (e) => (R(), x("line", {
|
|
4181
4198
|
key: `grid-${e}`,
|
|
4182
|
-
x1:
|
|
4183
|
-
x2:
|
|
4199
|
+
x1: A.value.left,
|
|
4200
|
+
x2: A.value.width - A.value.right,
|
|
4184
4201
|
y1: yForValue(e),
|
|
4185
4202
|
y2: yForValue(e),
|
|
4186
4203
|
"stroke-width": "1",
|
|
4187
4204
|
"vector-effect": "non-scaling-stroke",
|
|
4188
|
-
style:
|
|
4189
|
-
}, null, 12,
|
|
4190
|
-
|
|
4205
|
+
style: N({ stroke: e === 0 ? J.value : _e.value })
|
|
4206
|
+
}, null, 12, $r))), 128)),
|
|
4207
|
+
w("g", null, [(R(!0), x(m, null, V(T.value.ticks, (e) => (R(), x("text", {
|
|
4191
4208
|
key: `y-${e}`,
|
|
4192
|
-
x:
|
|
4209
|
+
x: A.value.left - 7,
|
|
4193
4210
|
y: yForValue(e) + 3,
|
|
4194
4211
|
"text-anchor": "end",
|
|
4195
4212
|
"font-size": "9.5",
|
|
4196
|
-
style:
|
|
4197
|
-
},
|
|
4213
|
+
style: N({ fill: K.value })
|
|
4214
|
+
}, G(le(formatChatVisualTick)({
|
|
4198
4215
|
value: e,
|
|
4199
4216
|
shared: E.value
|
|
4200
|
-
})), 13,
|
|
4201
|
-
f.value.chartType === "bar" ? (
|
|
4217
|
+
})), 13, ei))), 128))]),
|
|
4218
|
+
f.value.chartType === "bar" ? (R(!0), x(m, { key: 0 }, V(j.value, (e) => (R(), x("rect", {
|
|
4202
4219
|
key: e.key,
|
|
4203
4220
|
"data-test": "chat-visual-bar",
|
|
4204
4221
|
"data-row-index": e.rowIndex,
|
|
@@ -4209,22 +4226,22 @@ var Wr = [
|
|
|
4209
4226
|
width: e.width,
|
|
4210
4227
|
height: e.height,
|
|
4211
4228
|
rx: "2.5",
|
|
4212
|
-
style:
|
|
4213
|
-
}, null, 12,
|
|
4214
|
-
|
|
4229
|
+
style: N({ fill: seriesColor(e.seriesIndex) })
|
|
4230
|
+
}, null, 12, ti))), 128)) : (R(), x(m, { key: 1 }, [
|
|
4231
|
+
ee.value ? (R(), x("path", {
|
|
4215
4232
|
key: 0,
|
|
4216
4233
|
"data-test": "chat-visual-trend-line",
|
|
4217
|
-
"data-trend-key":
|
|
4218
|
-
d:
|
|
4234
|
+
"data-trend-key": ee.value.dataKey,
|
|
4235
|
+
d: ee.value.path,
|
|
4219
4236
|
fill: "none",
|
|
4220
4237
|
"stroke-width": "1.4",
|
|
4221
4238
|
"stroke-linecap": "round",
|
|
4222
4239
|
"stroke-linejoin": "round",
|
|
4223
4240
|
"stroke-dasharray": "4 3",
|
|
4224
4241
|
"vector-effect": "non-scaling-stroke",
|
|
4225
|
-
style:
|
|
4226
|
-
}, null, 12,
|
|
4227
|
-
(
|
|
4242
|
+
style: N({ stroke: seriesColor(ee.value.seriesIndex) })
|
|
4243
|
+
}, null, 12, ni)) : b("", !0),
|
|
4244
|
+
(R(!0), x(m, null, V(p.value, (e, t) => (R(), x("g", { key: e.dataKey }, [f.value.chartType === "line" ? (R(), x("path", {
|
|
4228
4245
|
key: 0,
|
|
4229
4246
|
d: pathForSeries(e.dataKey),
|
|
4230
4247
|
fill: "none",
|
|
@@ -4232,74 +4249,74 @@ var Wr = [
|
|
|
4232
4249
|
"stroke-linecap": "round",
|
|
4233
4250
|
"stroke-linejoin": "round",
|
|
4234
4251
|
"vector-effect": "non-scaling-stroke",
|
|
4235
|
-
style:
|
|
4236
|
-
}, null, 12,
|
|
4252
|
+
style: N({ stroke: seriesColor(t) })
|
|
4253
|
+
}, null, 12, ri)) : b("", !0), (R(!0), x(m, null, V(d.value, (n, r) => (R(), x(m, { key: `${e.dataKey}-${r}` }, [f.value.chartType === "scatter" ? (R(), x("circle", {
|
|
4237
4254
|
key: 0,
|
|
4238
4255
|
cx: xForIndex(r, d.value.length),
|
|
4239
4256
|
cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
|
|
4240
4257
|
r: "2.6",
|
|
4241
|
-
style:
|
|
4242
|
-
}, null, 12,
|
|
4243
|
-
(
|
|
4258
|
+
style: N({ fill: seriesColor(t) })
|
|
4259
|
+
}, null, 12, ii)) : b("", !0)], 64))), 128))]))), 128)),
|
|
4260
|
+
(R(!0), x(m, null, V(H.value, (e) => (R(), x("circle", {
|
|
4244
4261
|
key: `marker-${e.key}`,
|
|
4245
4262
|
cx: e.cx,
|
|
4246
4263
|
cy: e.cy,
|
|
4247
4264
|
r: "3",
|
|
4248
|
-
style:
|
|
4249
|
-
}, null, 12,
|
|
4265
|
+
style: N({ fill: seriesColor(e.seriesIndex) })
|
|
4266
|
+
}, null, 12, ai))), 128))
|
|
4250
4267
|
], 64)),
|
|
4251
|
-
(
|
|
4268
|
+
(R(!0), x(m, null, V(M.value, (e) => (R(), x("text", {
|
|
4252
4269
|
key: e.key,
|
|
4253
4270
|
x: e.x,
|
|
4254
|
-
y: e.angled ?
|
|
4271
|
+
y: e.angled ? A.value.height - A.value.bottom + 12 : A.value.height - 6,
|
|
4255
4272
|
"text-anchor": e.anchor,
|
|
4256
4273
|
"font-size": "9.5",
|
|
4257
|
-
transform: e.angled ? `rotate(${
|
|
4258
|
-
style:
|
|
4259
|
-
},
|
|
4260
|
-
], 12,
|
|
4274
|
+
transform: e.angled ? `rotate(${le(-40)} ${e.x} ${A.value.height - A.value.bottom + 12})` : void 0,
|
|
4275
|
+
style: N({ fill: K.value })
|
|
4276
|
+
}, G(e.label), 13, oi))), 128))
|
|
4277
|
+
], 12, Qr)), ce.value.length > 1 || f.value.chartType !== "bar" ? (R(), x("div", si, [(R(!0), x(m, null, V(ce.value, (e) => (R(), x("div", {
|
|
4261
4278
|
key: e.key,
|
|
4262
4279
|
class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
|
|
4263
4280
|
}, [
|
|
4264
|
-
|
|
4281
|
+
w("span", {
|
|
4265
4282
|
class: "size-2.5 shrink-0 rounded-full",
|
|
4266
|
-
style:
|
|
4283
|
+
style: N({ background: seriesColor(e.seriesIndex) })
|
|
4267
4284
|
}, null, 4),
|
|
4268
|
-
|
|
4269
|
-
|
|
4285
|
+
w("span", { style: N({ color: ge.value }) }, G(e.label), 5),
|
|
4286
|
+
w("span", {
|
|
4270
4287
|
class: "font-semibold tabular-nums",
|
|
4271
|
-
style:
|
|
4272
|
-
},
|
|
4273
|
-
]))), 128))])) :
|
|
4288
|
+
style: N({ color: he.value })
|
|
4289
|
+
}, G(e.value), 5)
|
|
4290
|
+
]))), 128))])) : b("", !0)], 8, Yr)) : g.value ? (R(), x("div", ci, [(R(!0), x(m, null, V(ue.value, (e, t) => (R(), x("div", { key: e.key }, [w("div", li, [w("span", {
|
|
4274
4291
|
class: "truncate font-medium",
|
|
4275
|
-
style:
|
|
4276
|
-
},
|
|
4292
|
+
style: N({ color: he.value })
|
|
4293
|
+
}, G(e.name), 5), w("span", ui, [w("span", {
|
|
4277
4294
|
class: "font-semibold",
|
|
4278
|
-
style:
|
|
4279
|
-
},
|
|
4295
|
+
style: N({ color: he.value })
|
|
4296
|
+
}, G(e.display), 5), w("span", {
|
|
4280
4297
|
class: "ml-1.5",
|
|
4281
|
-
style:
|
|
4282
|
-
},
|
|
4298
|
+
style: N({ color: ge.value })
|
|
4299
|
+
}, G(Math.round(e.percent * 100)) + "%", 5)])]), w("div", {
|
|
4283
4300
|
class: "h-1.5 w-full overflow-hidden rounded-full",
|
|
4284
|
-
style:
|
|
4285
|
-
}, [
|
|
4301
|
+
style: N({ background: Se.value })
|
|
4302
|
+
}, [w("div", {
|
|
4286
4303
|
class: "h-full rounded-full",
|
|
4287
|
-
style:
|
|
4304
|
+
style: N({
|
|
4288
4305
|
width: `${Math.max(2, e.percent * 100)}%`,
|
|
4289
4306
|
background: seriesColor(t)
|
|
4290
4307
|
})
|
|
4291
|
-
}, null, 4)], 4)]))), 128))])) : c.value &&
|
|
4308
|
+
}, null, 4)], 4)]))), 128))])) : c.value && fe.value ? (R(), x("div", di, [(R(), x("svg", {
|
|
4292
4309
|
"data-test": "chat-visual-diagram-svg",
|
|
4293
4310
|
class: "block h-auto overflow-visible",
|
|
4294
|
-
viewBox: `0 0 ${
|
|
4295
|
-
style:
|
|
4296
|
-
width: `${
|
|
4297
|
-
aspectRatio: `${
|
|
4311
|
+
viewBox: `0 0 ${fe.value.width} ${fe.value.height}`,
|
|
4312
|
+
style: N({
|
|
4313
|
+
width: `${fe.value.width}px`,
|
|
4314
|
+
aspectRatio: `${fe.value.width} / ${fe.value.height}`
|
|
4298
4315
|
}),
|
|
4299
4316
|
role: "img",
|
|
4300
4317
|
"aria-label": o.value.meta.title
|
|
4301
4318
|
}, [
|
|
4302
|
-
(
|
|
4319
|
+
(R(!0), x(m, null, V(fe.value.edges, (e) => (R(), x("line", {
|
|
4303
4320
|
key: e.key,
|
|
4304
4321
|
"data-test": "chat-visual-diagram-edge",
|
|
4305
4322
|
"data-from": e.from,
|
|
@@ -4311,77 +4328,77 @@ var Wr = [
|
|
|
4311
4328
|
"stroke-width": "1.4",
|
|
4312
4329
|
"stroke-linecap": "round",
|
|
4313
4330
|
"vector-effect": "non-scaling-stroke",
|
|
4314
|
-
style:
|
|
4315
|
-
}, null, 12,
|
|
4316
|
-
(
|
|
4331
|
+
style: N({ stroke: xe.value })
|
|
4332
|
+
}, null, 12, pi))), 128)),
|
|
4333
|
+
(R(!0), x(m, null, V(fe.value.edges, (e) => (R(), x("circle", {
|
|
4317
4334
|
key: `${e.key}-dot`,
|
|
4318
4335
|
cx: e.x2,
|
|
4319
4336
|
cy: e.y2,
|
|
4320
4337
|
r: "2.4",
|
|
4321
|
-
style:
|
|
4322
|
-
}, null, 12,
|
|
4323
|
-
(
|
|
4338
|
+
style: N({ fill: xe.value })
|
|
4339
|
+
}, null, 12, mi))), 128)),
|
|
4340
|
+
(R(!0), x(m, null, V(fe.value.edges.filter((e) => e.label), (e) => (R(), x("foreignObject", {
|
|
4324
4341
|
key: `${e.key}-label`,
|
|
4325
4342
|
x: e.labelX - 55,
|
|
4326
4343
|
y: e.labelY - 12,
|
|
4327
4344
|
width: "110",
|
|
4328
4345
|
height: "24"
|
|
4329
|
-
}, [
|
|
4346
|
+
}, [w("div", {
|
|
4330
4347
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
4331
4348
|
class: "flex h-full items-center justify-center px-1 text-center text-[10.5px] font-medium leading-none",
|
|
4332
|
-
style:
|
|
4333
|
-
color:
|
|
4349
|
+
style: N({
|
|
4350
|
+
color: ge.value,
|
|
4334
4351
|
background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
|
|
4335
4352
|
})
|
|
4336
|
-
},
|
|
4337
|
-
(
|
|
4353
|
+
}, G(e.label), 5)], 8, hi))), 128)),
|
|
4354
|
+
(R(!0), x(m, null, V(fe.value.nodes, (e) => (R(), x("g", {
|
|
4338
4355
|
key: e.id,
|
|
4339
4356
|
"data-test": "chat-visual-diagram-node",
|
|
4340
4357
|
"data-node-id": e.id,
|
|
4341
4358
|
"data-node-kind": e.kind,
|
|
4342
4359
|
transform: `translate(${e.x} ${e.y})`
|
|
4343
|
-
}, [e.kind === "decision" ? (
|
|
4360
|
+
}, [e.kind === "decision" ? (R(), x("polygon", {
|
|
4344
4361
|
key: 0,
|
|
4345
4362
|
points: `${e.width / 2},0 ${e.width},${e.height / 2} ${e.width / 2},${e.height} 0,${e.height / 2}`,
|
|
4346
4363
|
"stroke-width": "1",
|
|
4347
4364
|
"vector-effect": "non-scaling-stroke",
|
|
4348
|
-
style:
|
|
4365
|
+
style: N({
|
|
4349
4366
|
fill: diagramNodeFill(e.kind),
|
|
4350
4367
|
stroke: diagramNodeStroke(e.kind)
|
|
4351
4368
|
})
|
|
4352
|
-
}, null, 12,
|
|
4369
|
+
}, null, 12, _i)) : (R(), x("rect", {
|
|
4353
4370
|
key: 1,
|
|
4354
4371
|
width: e.width,
|
|
4355
4372
|
height: e.height,
|
|
4356
4373
|
rx: "9",
|
|
4357
4374
|
"stroke-width": "1",
|
|
4358
4375
|
"vector-effect": "non-scaling-stroke",
|
|
4359
|
-
style:
|
|
4376
|
+
style: N({
|
|
4360
4377
|
fill: diagramNodeFill(e.kind),
|
|
4361
4378
|
stroke: diagramNodeStroke(e.kind)
|
|
4362
4379
|
})
|
|
4363
|
-
}, null, 12,
|
|
4380
|
+
}, null, 12, vi)), (R(), x("foreignObject", {
|
|
4364
4381
|
x: "8",
|
|
4365
4382
|
y: "5",
|
|
4366
4383
|
width: e.width - 16,
|
|
4367
4384
|
height: e.height - 10
|
|
4368
|
-
}, [
|
|
4385
|
+
}, [w("div", bi, [w("div", {
|
|
4369
4386
|
class: "line-clamp-2 text-[13px] font-medium leading-snug",
|
|
4370
|
-
style:
|
|
4371
|
-
},
|
|
4387
|
+
style: N({ color: he.value })
|
|
4388
|
+
}, G(e.label), 5), e.detail ? (R(), x("div", {
|
|
4372
4389
|
key: 0,
|
|
4373
4390
|
class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
|
|
4374
|
-
style:
|
|
4375
|
-
},
|
|
4376
|
-
], 12,
|
|
4377
|
-
o.value.meta.footer ? (
|
|
4391
|
+
style: N({ color: ge.value })
|
|
4392
|
+
}, G(e.detail), 5)) : b("", !0)])], 8, yi))], 8, gi))), 128))
|
|
4393
|
+
], 12, fi))])) : b("", !0)], 512),
|
|
4394
|
+
o.value.meta.footer ? (R(), x("footer", {
|
|
4378
4395
|
key: 0,
|
|
4379
4396
|
class: "mt-3 text-[11px] leading-snug",
|
|
4380
|
-
style:
|
|
4381
|
-
},
|
|
4382
|
-
], 12,
|
|
4397
|
+
style: N({ color: K.value })
|
|
4398
|
+
}, G(o.value.meta.footer), 5)) : b("", !0)
|
|
4399
|
+
], 12, qr)) : b("", !0);
|
|
4383
4400
|
}
|
|
4384
|
-
}),
|
|
4401
|
+
}), Si = ["innerHTML"], Ci = /* @__PURE__ */ D({
|
|
4385
4402
|
__name: "ChatRichText",
|
|
4386
4403
|
props: {
|
|
4387
4404
|
text: {},
|
|
@@ -4390,7 +4407,7 @@ var Wr = [
|
|
|
4390
4407
|
},
|
|
4391
4408
|
emits: ["action"],
|
|
4392
4409
|
setup(e, { emit: t }) {
|
|
4393
|
-
let n = e, r = t, i =
|
|
4410
|
+
let n = e, r = t, i = U(n.text), a;
|
|
4394
4411
|
pe([() => n.text, () => n.streaming], ([e, t]) => {
|
|
4395
4412
|
if (!t) {
|
|
4396
4413
|
a !== void 0 && (cancelAnimationFrame(a), a = void 0), i.value = e;
|
|
@@ -4421,7 +4438,7 @@ var Wr = [
|
|
|
4421
4438
|
function renderMarkdown(e) {
|
|
4422
4439
|
if (!e) return "";
|
|
4423
4440
|
let t = k.parse(e, { async: !1 });
|
|
4424
|
-
return
|
|
4441
|
+
return cn.sanitize(t, {
|
|
4425
4442
|
ADD_ATTR: ["target"],
|
|
4426
4443
|
ADD_DATA_URI_TAGS: ["img"]
|
|
4427
4444
|
});
|
|
@@ -4545,58 +4562,58 @@ var Wr = [
|
|
|
4545
4562
|
html: g
|
|
4546
4563
|
}), r;
|
|
4547
4564
|
}
|
|
4548
|
-
let c =
|
|
4565
|
+
let c = v(() => {
|
|
4549
4566
|
let e = i.value;
|
|
4550
4567
|
return e ? richTextSegments({
|
|
4551
4568
|
text: e,
|
|
4552
4569
|
streaming: !!n.streaming
|
|
4553
4570
|
}) : [];
|
|
4554
4571
|
});
|
|
4555
|
-
return (t, n) => (
|
|
4572
|
+
return (t, n) => (R(), x("div", {
|
|
4556
4573
|
class: "chat-msg-rich break-words text-[14px] leading-[1.55] @sm/chat:text-[15px] @sm/chat:leading-[1.5]",
|
|
4557
4574
|
onErrorCapture: onRichTextAssetError
|
|
4558
|
-
}, [(
|
|
4575
|
+
}, [(R(!0), x(m, null, V(c.value, (t) => (R(), x(m, { key: t.key }, [t.kind === "markdown" ? (R(), x("div", {
|
|
4559
4576
|
key: 0,
|
|
4560
|
-
class:
|
|
4577
|
+
class: j(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
|
|
4561
4578
|
innerHTML: t.html
|
|
4562
|
-
}, null, 10,
|
|
4579
|
+
}, null, 10, Si)) : t.kind === "visual" ? (R(), y(xi, {
|
|
4563
4580
|
key: 1,
|
|
4564
4581
|
result: t.result,
|
|
4565
4582
|
inverted: e.inverted
|
|
4566
|
-
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (
|
|
4583
|
+
}, null, 8, ["result", "inverted"])) : t.kind === "card" ? (R(), y(Ir, {
|
|
4567
4584
|
key: 2,
|
|
4568
4585
|
spec: t.spec,
|
|
4569
4586
|
inverted: e.inverted,
|
|
4570
4587
|
onAction: n[0] || (n[0] = (e) => r("action", e))
|
|
4571
|
-
}, null, 8, ["spec", "inverted"])) : (
|
|
4588
|
+
}, null, 8, ["spec", "inverted"])) : (R(), x("div", {
|
|
4572
4589
|
key: 3,
|
|
4573
4590
|
"data-test": "chat-visual-pending",
|
|
4574
4591
|
role: "status",
|
|
4575
4592
|
class: "my-6 flex items-center gap-2.5 rounded-[20px] px-4 py-5 text-[12px] font-medium",
|
|
4576
|
-
style:
|
|
4593
|
+
style: N({
|
|
4577
4594
|
background: e.inverted ? "transparent" : "var(--color-theme-0)",
|
|
4578
4595
|
boxShadow: `inset 0 0 0 1px ${e.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"}`,
|
|
4579
4596
|
color: e.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
|
|
4580
4597
|
})
|
|
4581
|
-
}, [...n[1] || (n[1] = [
|
|
4598
|
+
}, [...n[1] || (n[1] = [w("span", {
|
|
4582
4599
|
class: "size-2 shrink-0 animate-pulse rounded-full",
|
|
4583
4600
|
style: { background: "currentcolor" }
|
|
4584
|
-
}, null, -1),
|
|
4601
|
+
}, null, -1), T(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
|
|
4585
4602
|
}
|
|
4586
|
-
}),
|
|
4603
|
+
}), wi = 80, Ti = 600, Ei = /* @__PURE__ */ D({
|
|
4587
4604
|
__name: "ChatScroller",
|
|
4588
4605
|
setup(e, { expose: t }) {
|
|
4589
|
-
let n =
|
|
4606
|
+
let n = B(), r = B(), i = B(!0), a, o, s = 0;
|
|
4590
4607
|
function scrollToBottom() {
|
|
4591
4608
|
let e = n.value;
|
|
4592
4609
|
e && (e.scrollTop = e.scrollHeight);
|
|
4593
4610
|
}
|
|
4594
4611
|
function onScroll() {
|
|
4595
4612
|
let e = n.value;
|
|
4596
|
-
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
4613
|
+
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= wi);
|
|
4597
4614
|
}
|
|
4598
4615
|
function markUserGesture() {
|
|
4599
|
-
s = Date.now() +
|
|
4616
|
+
s = Date.now() + Ti;
|
|
4600
4617
|
}
|
|
4601
4618
|
function followPinned() {
|
|
4602
4619
|
i.value && Date.now() > s && scrollToBottom();
|
|
@@ -4615,20 +4632,295 @@ var Wr = [
|
|
|
4615
4632
|
}));
|
|
4616
4633
|
}), te(() => {
|
|
4617
4634
|
a?.disconnect(), o?.disconnect();
|
|
4618
|
-
}), (e, t) => (
|
|
4635
|
+
}), (e, t) => (R(), x("div", {
|
|
4619
4636
|
ref_key: "viewport",
|
|
4620
4637
|
ref: n,
|
|
4621
|
-
class:
|
|
4638
|
+
class: j(["overflow-y-auto overscroll-contain overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
|
|
4622
4639
|
onScrollPassive: onScroll,
|
|
4623
4640
|
onWheelPassive: markUserGesture,
|
|
4624
4641
|
onTouchstartPassive: markUserGesture
|
|
4625
|
-
}, [
|
|
4642
|
+
}, [w("div", {
|
|
4626
4643
|
ref_key: "content",
|
|
4627
4644
|
ref: r,
|
|
4628
4645
|
class: "flex-1 flex flex-col"
|
|
4629
4646
|
}, [ce(e.$slots, "default")], 512)], 34));
|
|
4630
4647
|
}
|
|
4631
|
-
}),
|
|
4648
|
+
}), Di = ["aria-label"], Oi = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden" }, ki = /* @__PURE__ */ D({
|
|
4649
|
+
name: "FClose",
|
|
4650
|
+
__name: "FClose",
|
|
4651
|
+
props: { ariaLabel: {} },
|
|
4652
|
+
emits: ["click"],
|
|
4653
|
+
setup(e) {
|
|
4654
|
+
let t = B(!1);
|
|
4655
|
+
return ne(() => {
|
|
4656
|
+
setTimeout(() => {
|
|
4657
|
+
t.value = !0;
|
|
4658
|
+
}, 100);
|
|
4659
|
+
}), (n, r) => (R(), x("button", {
|
|
4660
|
+
type: "button",
|
|
4661
|
+
"aria-label": e.ariaLabel || "Close",
|
|
4662
|
+
class: "close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90",
|
|
4663
|
+
onClick: r[0] || (r[0] = (e) => n.$emit("click", e))
|
|
4664
|
+
}, [r[1] || (r[1] = w("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), w("span", Oi, [w("span", {
|
|
4665
|
+
class: j(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 rotate-45" : "translate-y-[30px] -translate-x-[30px] rotate-0"]),
|
|
4666
|
+
style: {
|
|
4667
|
+
"background-color": "currentColor",
|
|
4668
|
+
"transition-delay": "0.15s"
|
|
4669
|
+
}
|
|
4670
|
+
}, null, 2), w("span", {
|
|
4671
|
+
class: j(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 -rotate-45" : "-translate-y-[30px] -translate-x-[30px] rotate-0"]),
|
|
4672
|
+
style: {
|
|
4673
|
+
"background-color": "currentColor",
|
|
4674
|
+
"transition-delay": "0.45s"
|
|
4675
|
+
}
|
|
4676
|
+
}, null, 2)])], 8, Di));
|
|
4677
|
+
}
|
|
4678
|
+
}), Ai = { class: "flex min-h-full items-center justify-center text-center p-4" }, ji = {
|
|
4679
|
+
key: 0,
|
|
4680
|
+
class: "text-base p-4 font-semibold"
|
|
4681
|
+
}, Mi = {
|
|
4682
|
+
key: 1,
|
|
4683
|
+
class: "flex items-center gap-2 px-2"
|
|
4684
|
+
}, Ni = /* @__PURE__ */ D({
|
|
4685
|
+
inheritAttrs: !1,
|
|
4686
|
+
name: "FModal",
|
|
4687
|
+
__name: "FModal",
|
|
4688
|
+
props: {
|
|
4689
|
+
vis: {
|
|
4690
|
+
type: Boolean,
|
|
4691
|
+
default: !1
|
|
4692
|
+
},
|
|
4693
|
+
modalClass: {},
|
|
4694
|
+
styleClass: {},
|
|
4695
|
+
fullScreen: {
|
|
4696
|
+
type: Boolean,
|
|
4697
|
+
default: !1
|
|
4698
|
+
},
|
|
4699
|
+
hasClose: {
|
|
4700
|
+
type: Boolean,
|
|
4701
|
+
default: !1
|
|
4702
|
+
},
|
|
4703
|
+
title: { default: "" },
|
|
4704
|
+
transitionMode: { default: "modal" },
|
|
4705
|
+
teleportTo: { default: "body" },
|
|
4706
|
+
disableTeleport: {
|
|
4707
|
+
type: Boolean,
|
|
4708
|
+
default: !1
|
|
4709
|
+
}
|
|
4710
|
+
},
|
|
4711
|
+
emits: [
|
|
4712
|
+
"update:vis",
|
|
4713
|
+
"close",
|
|
4714
|
+
"escape"
|
|
4715
|
+
],
|
|
4716
|
+
setup(e, { emit: t }) {
|
|
4717
|
+
let n = t, r = B(!1);
|
|
4718
|
+
function close(e) {
|
|
4719
|
+
let { reason: t } = e;
|
|
4720
|
+
n("update:vis", !1), n("close", !0), t === "escape" && n("escape", !0);
|
|
4721
|
+
}
|
|
4722
|
+
let i = v(() => {
|
|
4723
|
+
let t = e.modalClass ? [e.modalClass] : ["max-w-screen-md p-24"], n = e.styleClass ? [e.styleClass] : ["bg-theme-0", "shadow-xl"];
|
|
4724
|
+
return e.fullScreen ? t.push("fixed inset-0") : t.push("rounded-2xl"), [
|
|
4725
|
+
"relative",
|
|
4726
|
+
"text-left",
|
|
4727
|
+
"transform",
|
|
4728
|
+
"transition-all",
|
|
4729
|
+
"w-full",
|
|
4730
|
+
"overflow-hidden",
|
|
4731
|
+
...t,
|
|
4732
|
+
...n
|
|
4733
|
+
];
|
|
4734
|
+
}), a = B(!1), o = [];
|
|
4735
|
+
function onKeydown(t) {
|
|
4736
|
+
t.key === "Escape" && e.vis && close({ reason: "escape" });
|
|
4737
|
+
}
|
|
4738
|
+
ne(async () => {
|
|
4739
|
+
r.value = !0;
|
|
4740
|
+
let t = pe(() => e.vis, (e) => {
|
|
4741
|
+
e ? setTimeout(() => a.value = !0, 300) : a.value = !1;
|
|
4742
|
+
}, { immediate: !0 });
|
|
4743
|
+
o.push(t), typeof document < "u" && (document.addEventListener("keydown", onKeydown), o.push(() => document.removeEventListener("keydown", onKeydown)));
|
|
4744
|
+
}), ae(() => {
|
|
4745
|
+
o.forEach((e) => e());
|
|
4746
|
+
});
|
|
4747
|
+
let s = v(() => e.transitionMode === "slideUp" ? {
|
|
4748
|
+
enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
|
|
4749
|
+
enterFromClass: "opacity-0 translate-y-full scale-95",
|
|
4750
|
+
enterToClass: "opacity-100 translate-y-0 scale-100",
|
|
4751
|
+
leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
|
|
4752
|
+
leaveFromClass: "opacity-100 translate-y-0 scale-100",
|
|
4753
|
+
leaveToClass: "opacity-0 translate-y-full scale-95"
|
|
4754
|
+
} : {
|
|
4755
|
+
enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
|
|
4756
|
+
enterFromClass: "opacity-0 scale-75",
|
|
4757
|
+
enterToClass: "opacity-100 translate-y-0 scale-100",
|
|
4758
|
+
leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
|
|
4759
|
+
leaveFromClass: "opacity-100 translate-y-0 scale-100",
|
|
4760
|
+
leaveToClass: "opacity-0 scale-75"
|
|
4761
|
+
});
|
|
4762
|
+
return (t, n) => r.value ? (R(), y(g, {
|
|
4763
|
+
key: 0,
|
|
4764
|
+
to: e.teleportTo,
|
|
4765
|
+
disabled: e.disableTeleport
|
|
4766
|
+
}, [w("div", {
|
|
4767
|
+
class: j(["fixed inset-0 z-50", e.vis ? "" : "pointer-events-none"]),
|
|
4768
|
+
"aria-labelledby": "modal-title",
|
|
4769
|
+
role: "dialog",
|
|
4770
|
+
"aria-modal": "true"
|
|
4771
|
+
}, [E(_, {
|
|
4772
|
+
"enter-active-class": "ease-out duration-300",
|
|
4773
|
+
"enter-from-class": "opacity-0",
|
|
4774
|
+
"enter-to-class": "opacity-100",
|
|
4775
|
+
"leave-active-class": "ease-in duration-200",
|
|
4776
|
+
"leave-from-class": "opacity-100",
|
|
4777
|
+
"leave-to-class": "opacity-0"
|
|
4778
|
+
}, {
|
|
4779
|
+
default: me(() => [e.vis ? (R(), x("div", {
|
|
4780
|
+
key: 0,
|
|
4781
|
+
class: "fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity",
|
|
4782
|
+
onClick: n[0] || (n[0] = (e) => close({ reason: "escape" }))
|
|
4783
|
+
})) : b("", !0)]),
|
|
4784
|
+
_: 1
|
|
4785
|
+
}), w("div", {
|
|
4786
|
+
class: "fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar",
|
|
4787
|
+
onClick: n[3] || (n[3] = (e) => close({ reason: "escape" }))
|
|
4788
|
+
}, [w("div", Ai, [E(_, M(A(s.value)), {
|
|
4789
|
+
default: me(() => [e.vis ? (R(), x("div", {
|
|
4790
|
+
key: 0,
|
|
4791
|
+
class: j([i.value, "w-full"]),
|
|
4792
|
+
onClick: n[2] || (n[2] = K(() => {}, ["stop"]))
|
|
4793
|
+
}, [e.hasClose || e.title || t.$slots.actions ? (R(), x("div", {
|
|
4794
|
+
key: 0,
|
|
4795
|
+
class: j(!e.title && (e.hasClose || t.$slots.actions) ? "absolute top-0 right-0 z-10" : "flex justify-between items-center")
|
|
4796
|
+
}, [e.title ? (R(), x("h2", ji, G(e.title), 1)) : b("", !0), e.hasClose || t.$slots.actions ? (R(), x("div", Mi, [ce(t.$slots, "actions"), e.hasClose ? (R(), y(ki, {
|
|
4797
|
+
key: 0,
|
|
4798
|
+
class: "relative",
|
|
4799
|
+
"data-test-id": "close-modal",
|
|
4800
|
+
onClick: n[1] || (n[1] = K((e) => close({ reason: "escape" }), ["stop"]))
|
|
4801
|
+
})) : b("", !0)])) : b("", !0)], 2)) : b("", !0), ce(t.$slots, "default")], 2)) : b("", !0)]),
|
|
4802
|
+
_: 3
|
|
4803
|
+
}, 16)])])], 2)], 8, ["to", "disabled"])) : b("", !0);
|
|
4804
|
+
}
|
|
4805
|
+
}), Pi = {
|
|
4806
|
+
"data-test": "share-reply-dialog",
|
|
4807
|
+
class: "flex flex-col"
|
|
4808
|
+
}, Fi = { class: "flex h-[60px] shrink-0 items-center justify-between border-b border-theme-950/[0.06] px-5" }, Ii = { class: "flex flex-col gap-4 p-5" }, Li = { class: "relative max-h-[300px] overflow-hidden rounded-2xl bg-theme-25 p-4 ring-1 ring-theme-950/[0.06]" }, Ri = { class: "flex flex-col gap-3 text-[13px] leading-relaxed text-theme-800" }, zi = {
|
|
4809
|
+
key: 0,
|
|
4810
|
+
class: "max-w-[85%] self-end whitespace-pre-wrap rounded-[14px] bg-theme-50 px-3 py-2"
|
|
4811
|
+
}, Bi = {
|
|
4812
|
+
key: 0,
|
|
4813
|
+
class: "flex h-11 items-center gap-2 rounded-xl bg-theme-50 px-3"
|
|
4814
|
+
}, Vi = ["value"], Hi = {
|
|
4815
|
+
key: 1,
|
|
4816
|
+
class: "text-[13px] text-red-600"
|
|
4817
|
+
}, Ui = { class: "flex items-center gap-3" }, Wi = ["disabled"], Gi = ["disabled"], Ki = /* @__PURE__ */ D({
|
|
4818
|
+
__name: "ShareReplyDialog",
|
|
4819
|
+
props: {
|
|
4820
|
+
message: {},
|
|
4821
|
+
prompt: {},
|
|
4822
|
+
share: {}
|
|
4823
|
+
},
|
|
4824
|
+
emits: ["close"],
|
|
4825
|
+
setup(e, { emit: t }) {
|
|
4826
|
+
let n = t, r = B(), i = B(!1), a = B(!1), o = B(!1), s = B(), c;
|
|
4827
|
+
pe(() => e.message?.id, async (t) => {
|
|
4828
|
+
if (r.value = void 0, s.value = void 0, o.value = !1, t) {
|
|
4829
|
+
i.value = !0;
|
|
4830
|
+
try {
|
|
4831
|
+
r.value = (await e.share.get({ messageId: t }))?.url;
|
|
4832
|
+
} catch {
|
|
4833
|
+
s.value = "Could not load this reply's link.";
|
|
4834
|
+
} finally {
|
|
4835
|
+
i.value = !1;
|
|
4836
|
+
}
|
|
4837
|
+
}
|
|
4838
|
+
}, { immediate: !0 });
|
|
4839
|
+
async function copyLink() {
|
|
4840
|
+
if (e.message && !a.value) {
|
|
4841
|
+
a.value = !0, s.value = void 0;
|
|
4842
|
+
try {
|
|
4843
|
+
r.value ?? (r.value = (await e.share.create({ messageId: e.message.id })).url);
|
|
4844
|
+
} catch {
|
|
4845
|
+
s.value = "Could not create a link. Try again.", a.value = !1;
|
|
4846
|
+
return;
|
|
4847
|
+
}
|
|
4848
|
+
try {
|
|
4849
|
+
await navigator.clipboard.writeText(r.value), o.value = !0, clearTimeout(c), c = setTimeout(() => {
|
|
4850
|
+
o.value = !1;
|
|
4851
|
+
}, 1500);
|
|
4852
|
+
} catch {
|
|
4853
|
+
s.value = "Copy the link from the field above.";
|
|
4854
|
+
} finally {
|
|
4855
|
+
a.value = !1;
|
|
4856
|
+
}
|
|
4857
|
+
}
|
|
4858
|
+
}
|
|
4859
|
+
async function deleteLink() {
|
|
4860
|
+
if (e.message && !a.value) {
|
|
4861
|
+
a.value = !0, s.value = void 0;
|
|
4862
|
+
try {
|
|
4863
|
+
await e.share.remove({ messageId: e.message.id }), r.value = void 0, o.value = !1;
|
|
4864
|
+
} catch {
|
|
4865
|
+
s.value = "Could not delete the link. Try again.";
|
|
4866
|
+
} finally {
|
|
4867
|
+
a.value = !1;
|
|
4868
|
+
}
|
|
4869
|
+
}
|
|
4870
|
+
}
|
|
4871
|
+
return (t, c) => (R(), y(Ni, {
|
|
4872
|
+
vis: !!e.message,
|
|
4873
|
+
"modal-class": "w-full max-w-[480px] p-0",
|
|
4874
|
+
onClose: c[2] || (c[2] = (e) => n("close"))
|
|
4875
|
+
}, {
|
|
4876
|
+
default: me(() => [w("div", Pi, [w("div", Fi, [c[4] || (c[4] = w("span", { class: "text-[15px] font-semibold text-theme-900" }, "Share reply", -1)), w("button", {
|
|
4877
|
+
type: "button",
|
|
4878
|
+
"aria-label": "Close",
|
|
4879
|
+
class: "grid size-9 cursor-pointer place-items-center rounded-full text-theme-500 transition-colors hover:bg-theme-950/5 hover:text-theme-900",
|
|
4880
|
+
onClick: c[0] || (c[0] = (e) => n("close"))
|
|
4881
|
+
}, [...c[3] || (c[3] = [w("i", {
|
|
4882
|
+
class: "i-tabler-x size-[17px]",
|
|
4883
|
+
"aria-hidden": "true"
|
|
4884
|
+
}, null, -1)])])]), w("div", Ii, [
|
|
4885
|
+
w("div", Li, [w("div", Ri, [e.prompt ? (R(), x("div", zi, G(e.prompt), 1)) : b("", !0), e.message ? (R(), y(Ci, {
|
|
4886
|
+
key: 1,
|
|
4887
|
+
text: e.message.text
|
|
4888
|
+
}, null, 8, ["text"])) : b("", !0)]), c[5] || (c[5] = w("div", { class: "pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-theme-25 to-transparent" }, null, -1))]),
|
|
4889
|
+
c[8] || (c[8] = w("p", { class: "text-[13px] leading-relaxed text-theme-500" }, " Anyone with the link can see this message and reply. Messages after it stay private. ", -1)),
|
|
4890
|
+
r.value ? (R(), x("div", Bi, [c[6] || (c[6] = w("i", {
|
|
4891
|
+
class: "i-tabler-link size-[15px] shrink-0 text-theme-400",
|
|
4892
|
+
"aria-hidden": "true"
|
|
4893
|
+
}, null, -1)), w("input", {
|
|
4894
|
+
"data-test": "share-reply-url",
|
|
4895
|
+
value: r.value,
|
|
4896
|
+
readonly: "",
|
|
4897
|
+
"aria-label": "Share link",
|
|
4898
|
+
class: "min-w-0 flex-1 truncate bg-transparent text-[14px] text-theme-800 outline-none",
|
|
4899
|
+
onFocus: c[1] || (c[1] = (e) => e.target.select())
|
|
4900
|
+
}, null, 40, Vi)])) : b("", !0),
|
|
4901
|
+
s.value ? (R(), x("p", Hi, G(s.value), 1)) : b("", !0),
|
|
4902
|
+
w("div", Ui, [r.value ? (R(), x("button", {
|
|
4903
|
+
key: 0,
|
|
4904
|
+
type: "button",
|
|
4905
|
+
"data-test": "share-reply-delete",
|
|
4906
|
+
disabled: a.value,
|
|
4907
|
+
class: "flex h-11 cursor-pointer items-center gap-1.5 px-1 text-[14px] font-medium text-theme-500 transition-colors hover:text-red-600 disabled:opacity-50",
|
|
4908
|
+
onClick: deleteLink
|
|
4909
|
+
}, [...c[7] || (c[7] = [w("i", {
|
|
4910
|
+
class: "i-tabler-trash size-[15px]",
|
|
4911
|
+
"aria-hidden": "true"
|
|
4912
|
+
}, null, -1), T(" Delete link ", -1)])], 8, Wi)) : b("", !0), w("button", {
|
|
4913
|
+
type: "button",
|
|
4914
|
+
"data-test": "share-reply-copy",
|
|
4915
|
+
disabled: i.value || a.value,
|
|
4916
|
+
class: "ml-auto h-11 cursor-pointer rounded-full bg-theme-900 px-5 text-[15px] font-semibold text-theme-0 transition-transform active:scale-[0.98] disabled:opacity-50",
|
|
4917
|
+
onClick: copyLink
|
|
4918
|
+
}, G(o.value ? "Copied" : "Copy link"), 9, Gi)])
|
|
4919
|
+
])])]),
|
|
4920
|
+
_: 1
|
|
4921
|
+
}, 8, ["vis"]));
|
|
4922
|
+
}
|
|
4923
|
+
}), qi = {
|
|
4632
4924
|
VOICE_MIC_UNAVAILABLE: "I couldn't reach your microphone. Check that this site is allowed to use it, then try again.",
|
|
4633
4925
|
VOICE_BOT_UNAVAILABLE: "Your assistant didn't pick up. Give it a moment and start the call again.",
|
|
4634
4926
|
VOICE_CONNECT_TIMEOUT: "The call took too long to connect. Try again in a moment.",
|
|
@@ -4637,21 +4929,21 @@ var Wr = [
|
|
|
4637
4929
|
VOICE_UNAVAILABLE: "Voice isn't available right now. You can keep going by typing.",
|
|
4638
4930
|
VOICE_MINT_INVALID: "That call couldn't be started. Refresh the page and try again.",
|
|
4639
4931
|
VOICE_PROVIDER_ERROR: "The call ended unexpectedly. Try again, or keep going by typing."
|
|
4640
|
-
},
|
|
4932
|
+
}, Ji = "The call ended unexpectedly. Try again, or keep going by typing.";
|
|
4641
4933
|
function voiceErrorMessage(e) {
|
|
4642
|
-
return e &&
|
|
4934
|
+
return e && qi[e] || Ji;
|
|
4643
4935
|
}
|
|
4644
4936
|
//#endregion
|
|
4645
4937
|
//#region bot/ui/VoiceHistogramController.ts
|
|
4646
|
-
var
|
|
4938
|
+
var Yi = [
|
|
4647
4939
|
0,
|
|
4648
4940
|
2,
|
|
4649
4941
|
4,
|
|
4650
4942
|
6,
|
|
4651
4943
|
8
|
|
4652
|
-
],
|
|
4944
|
+
], Xi = 5, Zi = 33, Qi = .7, $i = .1, ea = 60, ta = 320, na = .55, ra = .1, ia = .32, aa = .9, oa = Yi.map(() => 0), sa = Yi.map(() => Xi), VoiceHistogramController = class {
|
|
4653
4945
|
constructor(e = typeof window > "u" ? void 0 : window) {
|
|
4654
|
-
t(this, "browser", void 0), t(this, "heights",
|
|
4946
|
+
t(this, "browser", void 0), t(this, "heights", U(sa)), t(this, "targetBars", oa), t(this, "displayBars", oa), t(this, "level", {
|
|
4655
4947
|
source: "mic",
|
|
4656
4948
|
level: 0
|
|
4657
4949
|
}), t(this, "isMuted", !1), t(this, "usesIdleWave", !1), t(this, "frameId", 0), t(this, "lastFrameAt", 0), t(this, "easeFrame", (e) => {
|
|
@@ -4660,12 +4952,12 @@ var Ei = [
|
|
|
4660
4952
|
this.frameId = 0;
|
|
4661
4953
|
let n = Math.min(64, Math.max(0, e - this.lastFrameAt));
|
|
4662
4954
|
this.lastFrameAt = e;
|
|
4663
|
-
let r = this.usesIdleWave ?
|
|
4664
|
-
let r = e / 1e3 *
|
|
4665
|
-
return
|
|
4955
|
+
let r = this.usesIdleWave ? Yi.map((t, n) => {
|
|
4956
|
+
let r = e / 1e3 * na * 2 * Math.PI - n * aa;
|
|
4957
|
+
return ra + ia * (Math.sin(r) + 1) / 2;
|
|
4666
4958
|
}) : this.targetBars;
|
|
4667
4959
|
this.displayBars = this.displayBars.map((e, t) => {
|
|
4668
|
-
let i = r[t] ?? 0, a = i > e ?
|
|
4960
|
+
let i = r[t] ?? 0, a = i > e ? ea : ta;
|
|
4669
4961
|
return e + (i - e) * (1 - Math.exp(-n / a));
|
|
4670
4962
|
}), this.publish();
|
|
4671
4963
|
let i = this.displayBars.every((e, t) => Math.abs((r[t] ?? 0) - e) <= 5e-4);
|
|
@@ -4685,20 +4977,20 @@ var Ei = [
|
|
|
4685
4977
|
this.frameId && this.browser?.cancelAnimationFrame(this.frameId), this.frameId = 0;
|
|
4686
4978
|
}
|
|
4687
4979
|
updateTargets() {
|
|
4688
|
-
let gate = (e) => Math.max(0, e -
|
|
4689
|
-
this.targetBars =
|
|
4980
|
+
let gate = (e) => Math.max(0, e - $i) / .9, e = this.isMuted && this.level.source === "mic";
|
|
4981
|
+
this.targetBars = Yi.map((t) => e ? 0 : gate(Math.min(1, Math.max(0, this.level.bands?.[t] ?? this.level.level)))), this.start();
|
|
4690
4982
|
}
|
|
4691
4983
|
start() {
|
|
4692
4984
|
if (!this.browser || this.browser.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
4693
|
-
this.displayBars = this.usesIdleWave ?
|
|
4985
|
+
this.displayBars = this.usesIdleWave ? oa : this.targetBars, this.publish();
|
|
4694
4986
|
return;
|
|
4695
4987
|
}
|
|
4696
4988
|
this.frameId || (this.lastFrameAt = this.browser.performance.now(), this.frameId = this.browser.requestAnimationFrame(this.easeFrame));
|
|
4697
4989
|
}
|
|
4698
4990
|
publish() {
|
|
4699
|
-
this.heights.value = this.displayBars.map((e) => Math.round((
|
|
4991
|
+
this.heights.value = this.displayBars.map((e) => Math.round((Xi + Math.min(1, Math.max(0, e)) ** Qi * Zi) * 10) / 10);
|
|
4700
4992
|
}
|
|
4701
|
-
},
|
|
4993
|
+
}, ca = {
|
|
4702
4994
|
connecting: {
|
|
4703
4995
|
label: "Connecting",
|
|
4704
4996
|
tone: "bg-amber-500",
|
|
@@ -4736,7 +5028,7 @@ function deriveActivity(e) {
|
|
|
4736
5028
|
return e.hadError ? "error" : e.sessionState === "live" ? e.speaking.bot ? "speaking" : e.speaking.user ? "listening" : e.work.active ? "working" : e.providerThinking ? "thinking" : "listening" : "connecting";
|
|
4737
5029
|
}
|
|
4738
5030
|
function deriveVoiceModePresentation(e) {
|
|
4739
|
-
let t = deriveActivity(e), n =
|
|
5031
|
+
let t = deriveActivity(e), n = ca[t], r = t === "working" ? e.work.description || "Working on it" : n.label, i = t === "working" ? r : n.visibleText ?? "", a = e.takingLonger && (t === "thinking" || t === "working"), o = a ? `${i} ${xe.slowHint}` : i;
|
|
4740
5032
|
return {
|
|
4741
5033
|
activity: t,
|
|
4742
5034
|
label: a ? o : r,
|
|
@@ -4748,32 +5040,32 @@ function deriveVoiceModePresentation(e) {
|
|
|
4748
5040
|
}
|
|
4749
5041
|
//#endregion
|
|
4750
5042
|
//#region bot/ui/VoiceMode.vue?vue&type=script&setup=true&lang.ts
|
|
4751
|
-
var
|
|
5043
|
+
var la = ["data-voice-state", "data-voice-activity"], ua = ["src"], da = {
|
|
4752
5044
|
key: 1,
|
|
4753
5045
|
"data-test": "voice-background-fallback",
|
|
4754
5046
|
"aria-hidden": "true",
|
|
4755
5047
|
class: "pointer-events-none absolute inset-0 bg-[#0A1522]"
|
|
4756
|
-
},
|
|
5048
|
+
}, fa = {
|
|
4757
5049
|
"data-test": "voice-stage",
|
|
4758
5050
|
class: "relative z-10 flex flex-1 flex-col items-center px-8"
|
|
4759
|
-
},
|
|
5051
|
+
}, pa = { "data-voice-assistant-avatar": "" }, ma = {
|
|
4760
5052
|
"data-test": "voice-lower-stage",
|
|
4761
5053
|
class: "flex flex-1 flex-col items-center pt-10"
|
|
4762
|
-
},
|
|
5054
|
+
}, ha = {
|
|
4763
5055
|
"data-test": "voice-histogram",
|
|
4764
5056
|
"aria-hidden": "true",
|
|
4765
5057
|
class: "flex h-[38px] items-center gap-[5px]"
|
|
4766
|
-
},
|
|
5058
|
+
}, ga = {
|
|
4767
5059
|
"data-test": "voice-presence-status",
|
|
4768
5060
|
role: "status",
|
|
4769
5061
|
"aria-live": "polite",
|
|
4770
5062
|
class: "sr-only"
|
|
4771
|
-
},
|
|
5063
|
+
}, _a = ["data-taking-longer"], va = { class: "absolute inset-x-0 bottom-0 z-20 flex items-center justify-between px-14 pb-[max(3rem,env(safe-area-inset-bottom))] sm:px-12" }, ya = [
|
|
4772
5064
|
"disabled",
|
|
4773
5065
|
"aria-label",
|
|
4774
5066
|
"aria-pressed",
|
|
4775
5067
|
"title"
|
|
4776
|
-
],
|
|
5068
|
+
], ba = /* @__PURE__ */ D({
|
|
4777
5069
|
__name: "VoiceMode",
|
|
4778
5070
|
props: {
|
|
4779
5071
|
bot: {},
|
|
@@ -4783,61 +5075,61 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
4783
5075
|
},
|
|
4784
5076
|
emits: ["end"],
|
|
4785
5077
|
setup(e, { expose: t, emit: n }) {
|
|
4786
|
-
let r = n, i =
|
|
5078
|
+
let r = n, i = U(!1), a = U(), o = U(!1), s = U({
|
|
4787
5079
|
user: !1,
|
|
4788
5080
|
bot: !1
|
|
4789
|
-
}),
|
|
4790
|
-
sessionState:
|
|
5081
|
+
}), c = U({ active: !1 }), d = U(!1), f = U(!1), p = U(), g = v(() => p.value?.state.value ?? "idle"), _ = v(() => p.value?.isMuted.value ?? !1), y = new VoiceHistogramController(), b = y.heights, T = ue("endButton"), D = ue("muteButton"), A = !1, ee, M, te, B = v(() => deriveVoiceModePresentation({
|
|
5082
|
+
sessionState: g.value,
|
|
4791
5083
|
hadError: i.value,
|
|
4792
|
-
providerThinking:
|
|
4793
|
-
speaking:
|
|
4794
|
-
work:
|
|
4795
|
-
isMuted:
|
|
4796
|
-
takingLonger:
|
|
4797
|
-
})),
|
|
4798
|
-
if (
|
|
4799
|
-
if (
|
|
5084
|
+
providerThinking: o.value,
|
|
5085
|
+
speaking: s.value,
|
|
5086
|
+
work: c.value,
|
|
5087
|
+
isMuted: _.value,
|
|
5088
|
+
takingLonger: d.value
|
|
5089
|
+
})), ce = v(() => {
|
|
5090
|
+
if (B.value.activity === "thinking") return "thinking";
|
|
5091
|
+
if (B.value.activity === "working") return `working:${c.value.description ?? ""}`;
|
|
4800
5092
|
});
|
|
4801
|
-
pe(() =>
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
},
|
|
5093
|
+
pe(() => B.value.usesIdleWave, (e) => y.setIdleWave(e), { immediate: !0 }), pe(_, (e) => y.setMuted(e), { immediate: !0 }), pe(ce, (e) => {
|
|
5094
|
+
te && clearTimeout(te), d.value = !1, e && (te = setTimeout(() => {
|
|
5095
|
+
te = void 0, d.value = !0;
|
|
5096
|
+
}, Se), te.unref?.());
|
|
4805
5097
|
}, { immediate: !0 });
|
|
4806
5098
|
async function end() {
|
|
4807
|
-
|
|
5099
|
+
A = !0, await p.value?.end();
|
|
4808
5100
|
}
|
|
4809
5101
|
t({ end });
|
|
4810
5102
|
function emitEnd() {
|
|
4811
|
-
|
|
5103
|
+
A || (A = !0, r("end", ee));
|
|
4812
5104
|
}
|
|
4813
5105
|
function trapFocus(e) {
|
|
4814
|
-
e.shiftKey && document.activeElement ===
|
|
5106
|
+
e.shiftKey && document.activeElement === T.value ? (e.preventDefault(), D.value?.focus()) : !e.shiftKey && document.activeElement === D.value && (e.preventDefault(), T.value?.focus());
|
|
4815
5107
|
}
|
|
4816
5108
|
async function toggleMute() {
|
|
4817
|
-
let e =
|
|
4818
|
-
e && !
|
|
5109
|
+
let e = p.value;
|
|
5110
|
+
e && !f.value && (f.value = !0, await e.toggleMuted(), f.value = !1);
|
|
4819
5111
|
}
|
|
4820
5112
|
return ne(async () => {
|
|
4821
|
-
|
|
5113
|
+
T.value?.focus({ preventScroll: !0 });
|
|
4822
5114
|
let t = e.chatController?.createVoiceClient({
|
|
4823
|
-
onLevel: (e) =>
|
|
5115
|
+
onLevel: (e) => y.updateLevel(e),
|
|
4824
5116
|
onEnded: (e) => {
|
|
4825
|
-
|
|
5117
|
+
ee = e;
|
|
4826
5118
|
},
|
|
4827
5119
|
onStateChange: (e) => {
|
|
4828
5120
|
e === "ended" && (i.value ? M = setTimeout(emitEnd, 1600) : emitEnd());
|
|
4829
5121
|
},
|
|
4830
5122
|
onThinkingChange: (e) => {
|
|
4831
|
-
|
|
5123
|
+
o.value = e;
|
|
4832
5124
|
},
|
|
4833
5125
|
onSpeakingChange: (e) => {
|
|
4834
|
-
|
|
5126
|
+
s.value = e;
|
|
4835
5127
|
},
|
|
4836
5128
|
onWorkChange: (e) => {
|
|
4837
|
-
|
|
5129
|
+
c.value = e;
|
|
4838
5130
|
},
|
|
4839
5131
|
onError: (t) => {
|
|
4840
|
-
i.value = !0,
|
|
5132
|
+
i.value = !0, t.code !== "VOICE_CONNECTION_LOST" && (a.value = voiceErrorMessage(t.code)), e.chatController?.logger?.warn("voice.session.failed", {
|
|
4841
5133
|
code: t.code,
|
|
4842
5134
|
providerMessage: t.message
|
|
4843
5135
|
});
|
|
@@ -4850,17 +5142,17 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
4850
5142
|
emitEnd();
|
|
4851
5143
|
return;
|
|
4852
5144
|
}
|
|
4853
|
-
|
|
5145
|
+
p.value = t, await t.start();
|
|
4854
5146
|
}), ae(() => {
|
|
4855
|
-
|
|
4856
|
-
}), (t, n) => (
|
|
5147
|
+
A = !0, M && clearTimeout(M), te && clearTimeout(te), y.stop(), p.value?.end();
|
|
5148
|
+
}), (t, n) => (R(), x("div", {
|
|
4857
5149
|
"data-test": "voice-mode",
|
|
4858
|
-
"data-voice-state":
|
|
4859
|
-
"data-voice-activity":
|
|
5150
|
+
"data-voice-state": g.value,
|
|
5151
|
+
"data-voice-activity": B.value.activity,
|
|
4860
5152
|
class: "relative flex min-h-0 flex-1 flex-col overflow-hidden bg-[#0A1522] text-white",
|
|
4861
5153
|
onKeydown: ge(trapFocus, ["tab"])
|
|
4862
5154
|
}, [
|
|
4863
|
-
e.backdropSrc ? (
|
|
5155
|
+
e.backdropSrc ? (R(), x("img", {
|
|
4864
5156
|
key: 0,
|
|
4865
5157
|
"data-test": "voice-background-image",
|
|
4866
5158
|
src: e.backdropSrc,
|
|
@@ -4868,89 +5160,89 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
4868
5160
|
"aria-hidden": "true",
|
|
4869
5161
|
draggable: "false",
|
|
4870
5162
|
class: "pointer-events-none absolute inset-0 size-full object-cover"
|
|
4871
|
-
}, null, 8,
|
|
4872
|
-
n[2] || (n[2] =
|
|
5163
|
+
}, null, 8, ua)) : (R(), x("div", da)),
|
|
5164
|
+
n[2] || (n[2] = w("div", {
|
|
4873
5165
|
"data-test": "voice-background-overlay",
|
|
4874
5166
|
"aria-hidden": "true",
|
|
4875
5167
|
class: "pointer-events-none absolute inset-0 bg-gradient-to-b from-[#050F19]/82 via-[#050F19]/90 to-[#050F19]/99"
|
|
4876
5168
|
}, null, -1)),
|
|
4877
|
-
|
|
4878
|
-
n[0] || (n[0] =
|
|
5169
|
+
w("div", fa, [
|
|
5170
|
+
n[0] || (n[0] = w("div", {
|
|
4879
5171
|
"data-test": "voice-stage-spacer",
|
|
4880
5172
|
"aria-hidden": "true",
|
|
4881
5173
|
class: "flex-1"
|
|
4882
5174
|
}, null, -1)),
|
|
4883
|
-
|
|
5175
|
+
w("div", pa, [E(Ke, {
|
|
4884
5176
|
bot: e.bot,
|
|
4885
5177
|
"show-status": !1,
|
|
4886
5178
|
"show-owner-mark": !1,
|
|
4887
5179
|
"is-light": !1,
|
|
4888
5180
|
class: "size-32"
|
|
4889
5181
|
}, null, 8, ["bot"])]),
|
|
4890
|
-
|
|
4891
|
-
|
|
5182
|
+
w("div", ma, [
|
|
5183
|
+
w("div", ha, [(R(!0), x(m, null, V(le(b), (e, t) => (R(), x("span", {
|
|
4892
5184
|
key: t,
|
|
4893
5185
|
"data-test": "voice-histogram-bar",
|
|
4894
|
-
class:
|
|
4895
|
-
style:
|
|
5186
|
+
class: j(["w-[5px] rounded-full transition-colors duration-150", B.value.tone]),
|
|
5187
|
+
style: N({ height: `${e}px` })
|
|
4896
5188
|
}, null, 6))), 128))]),
|
|
4897
|
-
|
|
4898
|
-
|
|
5189
|
+
w("div", ga, G(a.value ?? B.value.label), 1),
|
|
5190
|
+
w("p", {
|
|
4899
5191
|
"data-test": "voice-visible-status",
|
|
4900
|
-
"data-taking-longer":
|
|
5192
|
+
"data-taking-longer": B.value.takingLonger || void 0,
|
|
4901
5193
|
"aria-hidden": "true",
|
|
4902
5194
|
class: "mt-5 min-h-5 text-center text-sm font-medium tracking-wide text-white/80"
|
|
4903
|
-
},
|
|
5195
|
+
}, G(a.value ?? B.value.visibleStatus), 9, _a)
|
|
4904
5196
|
])
|
|
4905
5197
|
]),
|
|
4906
|
-
|
|
5198
|
+
w("div", va, [w("button", {
|
|
4907
5199
|
ref_key: "endButton",
|
|
4908
|
-
ref:
|
|
5200
|
+
ref: T,
|
|
4909
5201
|
type: "button",
|
|
4910
5202
|
"data-test": "voice-end-btn",
|
|
4911
5203
|
class: "flex size-16 cursor-pointer items-center justify-center rounded-full bg-white/10 text-white ring-1 ring-white/20 transition-colors hover:bg-white/15 active:bg-white/25",
|
|
4912
5204
|
"aria-label": "Hang up",
|
|
4913
5205
|
title: "Hang up",
|
|
4914
5206
|
onClick: emitEnd
|
|
4915
|
-
}, [...n[1] || (n[1] = [
|
|
5207
|
+
}, [...n[1] || (n[1] = [w("i", {
|
|
4916
5208
|
class: "i-tabler-x size-[25px]",
|
|
4917
5209
|
"aria-hidden": "true"
|
|
4918
|
-
}, null, -1)])], 512),
|
|
5210
|
+
}, null, -1)])], 512), w("button", {
|
|
4919
5211
|
ref_key: "muteButton",
|
|
4920
|
-
ref:
|
|
5212
|
+
ref: D,
|
|
4921
5213
|
type: "button",
|
|
4922
5214
|
"data-test": "voice-mute-btn",
|
|
4923
|
-
class:
|
|
4924
|
-
disabled:
|
|
4925
|
-
"aria-label":
|
|
4926
|
-
"aria-pressed":
|
|
4927
|
-
title:
|
|
5215
|
+
class: j(["flex size-16 items-center justify-center rounded-full ring-1 transition-colors active:opacity-70", [_.value ? "bg-white text-[#050F19] ring-white" : "bg-white/10 text-white ring-white/20", g.value === "live" && !f.value ? "cursor-pointer" : "cursor-default opacity-50"]]),
|
|
5216
|
+
disabled: g.value !== "live" || f.value,
|
|
5217
|
+
"aria-label": _.value ? "Unmute microphone" : "Mute microphone",
|
|
5218
|
+
"aria-pressed": _.value,
|
|
5219
|
+
title: _.value ? "Unmute microphone" : "Mute microphone",
|
|
4928
5220
|
onClick: toggleMute
|
|
4929
|
-
}, [
|
|
4930
|
-
class:
|
|
5221
|
+
}, [w("i", {
|
|
5222
|
+
class: j([_.value ? "i-tabler-microphone-off" : "i-tabler-microphone", "size-[25px]"]),
|
|
4931
5223
|
"aria-hidden": "true"
|
|
4932
|
-
}, null, 2)], 10,
|
|
4933
|
-
], 40,
|
|
5224
|
+
}, null, 2)], 10, ya)])
|
|
5225
|
+
], 40, la));
|
|
4934
5226
|
}
|
|
4935
|
-
}),
|
|
5227
|
+
}), xa = {
|
|
4936
5228
|
key: 0,
|
|
4937
5229
|
class: "pb-4"
|
|
4938
|
-
},
|
|
5230
|
+
}, Sa = {
|
|
4939
5231
|
key: 1,
|
|
4940
5232
|
"data-test": "messaging-sdk-header",
|
|
4941
5233
|
class: "shrink-0 border-b border-theme-100 px-4 py-3"
|
|
4942
|
-
},
|
|
5234
|
+
}, Ca = { class: "min-w-0 flex-1" }, wa = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, Ta = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, Ea = {
|
|
4943
5235
|
key: 0,
|
|
4944
5236
|
class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
|
|
4945
|
-
},
|
|
5237
|
+
}, Da = ["aria-label"], Oa = {
|
|
4946
5238
|
key: 0,
|
|
4947
5239
|
"data-test": "messaging-empty-state",
|
|
4948
5240
|
class: "flex flex-col items-center justify-center px-4"
|
|
4949
|
-
},
|
|
5241
|
+
}, ka = ["title"], Aa = {
|
|
4950
5242
|
key: 0,
|
|
4951
5243
|
"data-test": "messaging-time-divider",
|
|
4952
5244
|
class: "flex items-center gap-3 py-3 px-2"
|
|
4953
|
-
},
|
|
5245
|
+
}, ja = ["data-journal-outcome"], Ma = [
|
|
4954
5246
|
"data-message-id",
|
|
4955
5247
|
"data-message-sender",
|
|
4956
5248
|
"data-conversation-id",
|
|
@@ -4961,7 +5253,7 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
4961
5253
|
"data-issue-action-label",
|
|
4962
5254
|
"data-issue-action-url",
|
|
4963
5255
|
"data-streaming"
|
|
4964
|
-
],
|
|
5256
|
+
], Na = { class: "flex items-center gap-3" }, Pa = ["href"], Fa = [
|
|
4965
5257
|
"data-test",
|
|
4966
5258
|
"data-message-id",
|
|
4967
5259
|
"data-message-sender",
|
|
@@ -4969,7 +5261,7 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
4969
5261
|
"data-message-sequence",
|
|
4970
5262
|
"data-system-kind",
|
|
4971
5263
|
"data-routine-run-id"
|
|
4972
|
-
],
|
|
5264
|
+
], Ia = [
|
|
4973
5265
|
"data-message-id",
|
|
4974
5266
|
"data-message-sender",
|
|
4975
5267
|
"data-conversation-id",
|
|
@@ -4978,7 +5270,7 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
4978
5270
|
"data-issue-code",
|
|
4979
5271
|
"data-issue-bucket",
|
|
4980
5272
|
"data-streaming"
|
|
4981
|
-
],
|
|
5273
|
+
], La = [
|
|
4982
5274
|
"data-test",
|
|
4983
5275
|
"data-message-id",
|
|
4984
5276
|
"data-message-sender",
|
|
@@ -4988,63 +5280,63 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
4988
5280
|
"data-streaming",
|
|
4989
5281
|
"data-queued",
|
|
4990
5282
|
"aria-label"
|
|
4991
|
-
],
|
|
5283
|
+
], Ra = ["data-routine-run-id"], za = ["src", "alt"], Ba = ["src"], Va = ["href"], Ha = {
|
|
4992
5284
|
key: 0,
|
|
4993
5285
|
"data-test": "messaging-message-text-part"
|
|
4994
|
-
},
|
|
5286
|
+
}, Ua = [
|
|
4995
5287
|
"src",
|
|
4996
5288
|
"alt",
|
|
4997
5289
|
"data-attachment-placement"
|
|
4998
|
-
],
|
|
5290
|
+
], Wa = ["src", "data-attachment-placement"], Ga = ["href", "data-attachment-placement"], Ka = ["data-actions-reveal"], qa = [
|
|
4999
5291
|
"data-copied",
|
|
5000
5292
|
"title",
|
|
5001
5293
|
"aria-label",
|
|
5002
5294
|
"onClick"
|
|
5003
|
-
],
|
|
5295
|
+
], Ja = ["onClick"], Ya = ["onClick"], Xa = ["data-journal-outcome"], Za = ["data-journal-outcome"], Qa = ["data-test", "data-working-description"], $a = {
|
|
5004
5296
|
key: 0,
|
|
5005
5297
|
class: "truncate"
|
|
5006
|
-
},
|
|
5298
|
+
}, eo = {
|
|
5007
5299
|
key: 1,
|
|
5008
5300
|
class: "sr-only"
|
|
5009
|
-
},
|
|
5301
|
+
}, to = ["data-issue-code"], no = { class: "min-w-0 flex-1" }, ro = {
|
|
5010
5302
|
"data-test": "messaging-transient-issue-title",
|
|
5011
5303
|
class: "font-medium"
|
|
5012
|
-
},
|
|
5304
|
+
}, io = { "data-test": "messaging-transient-issue-help" }, ao = ["href"], oo = ["inert", "aria-hidden"], so = ["data-seat-state"], co = ["src", "alt"], lo = { class: "max-w-20 truncate" }, uo = ["onClick"], fo = {
|
|
5013
5305
|
key: 0,
|
|
5014
5306
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
5015
|
-
},
|
|
5307
|
+
}, po = ["data-composer-action"], mo = ["placeholder", "disabled"], ho = { class: "font-mono text-sm tabular-nums" }, go = { class: "mt-2.5 flex items-center" }, _o = [
|
|
5016
5308
|
"disabled",
|
|
5017
5309
|
"aria-label",
|
|
5018
5310
|
"title"
|
|
5019
|
-
],
|
|
5311
|
+
], vo = {
|
|
5020
5312
|
key: 0,
|
|
5021
5313
|
class: "i-svg-spinners-ring-resize size-5"
|
|
5022
|
-
},
|
|
5314
|
+
}, yo = {
|
|
5023
5315
|
key: 1,
|
|
5024
5316
|
class: "i-tabler-plus size-5"
|
|
5025
|
-
},
|
|
5317
|
+
}, bo = { class: "sr-only" }, xo = { class: "flex items-center gap-2" }, So = ["aria-label", "title"], Co = { class: "sr-only" }, wo = [
|
|
5026
5318
|
"disabled",
|
|
5027
5319
|
"aria-label",
|
|
5028
5320
|
"title"
|
|
5029
|
-
],
|
|
5321
|
+
], To = {
|
|
5030
5322
|
class: "flex h-4 items-center gap-[2px]",
|
|
5031
5323
|
"aria-hidden": "true"
|
|
5032
|
-
},
|
|
5324
|
+
}, Eo = [
|
|
5033
5325
|
"data-composer-action",
|
|
5034
5326
|
"disabled",
|
|
5035
5327
|
"aria-label",
|
|
5036
5328
|
"title"
|
|
5037
|
-
],
|
|
5329
|
+
], Do = {
|
|
5038
5330
|
key: 0,
|
|
5039
5331
|
class: "i-tabler-player-stop-filled size-3.5"
|
|
5040
|
-
},
|
|
5332
|
+
}, Oo = {
|
|
5041
5333
|
key: 1,
|
|
5042
5334
|
class: "i-tabler-arrow-up size-[17px]"
|
|
5043
|
-
},
|
|
5335
|
+
}, ko = { class: "sr-only" }, Ao = {
|
|
5044
5336
|
key: 2,
|
|
5045
5337
|
"data-test": "messaging-ai-notice",
|
|
5046
5338
|
class: "mx-auto max-w-[640px] @5xl/chat:max-w-[720px] pt-3 text-center text-[11.5px] leading-none text-theme-300"
|
|
5047
|
-
},
|
|
5339
|
+
}, jo = /*#__PURE__*/ _e(/* @__PURE__ */ D({
|
|
5048
5340
|
__name: "ElBotChat",
|
|
5049
5341
|
props: {
|
|
5050
5342
|
chatController: {},
|
|
@@ -5081,37 +5373,37 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5081
5373
|
label: "Public",
|
|
5082
5374
|
tooltip: "Anyone with the link can see this"
|
|
5083
5375
|
}
|
|
5084
|
-
}, n =
|
|
5376
|
+
}, n = v(() => {
|
|
5085
5377
|
let n = { ...t[e.scope] };
|
|
5086
5378
|
return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
|
|
5087
|
-
}), i =
|
|
5379
|
+
}), i = B(), a = B(), o = B();
|
|
5088
5380
|
function containsMarkdownLink(e) {
|
|
5089
5381
|
return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
|
|
5090
5382
|
}
|
|
5091
5383
|
function isSystemExplainerMessage(e) {
|
|
5092
|
-
return e.sender === "system" && (!!e.issue || e.id ===
|
|
5384
|
+
return e.sender === "system" && (!!e.issue || e.id === J.value);
|
|
5093
5385
|
}
|
|
5094
5386
|
function isGroupEnd(e, t) {
|
|
5095
5387
|
let n = e[t], r = e[t + 1];
|
|
5096
5388
|
return !r || r.sender !== n.sender;
|
|
5097
5389
|
}
|
|
5098
|
-
let c =
|
|
5099
|
-
for (let e =
|
|
5100
|
-
let t =
|
|
5390
|
+
let c = v(() => e.chatController?.textState.value), d = v(() => c.value?.isConnected ?? !1), f = v(() => c.value?.isThinking ?? !1), p = v(() => c.value?.connectionStatus !== "connected" && !c.value?.error), g = v(() => e.chatController?.liveTurnBlocks?.value ?? []), D = v(() => {
|
|
5391
|
+
for (let e = g.value.length - 1; e >= 0; e--) {
|
|
5392
|
+
let t = g.value[e];
|
|
5101
5393
|
if (t?.kind === "text") return t.id;
|
|
5102
5394
|
}
|
|
5103
|
-
}),
|
|
5395
|
+
}), A = v(() => e.chatController?.liveStreamMessageId?.value), M = v(() => {
|
|
5104
5396
|
let t = e.chatController?.sharedMessages.value ?? [];
|
|
5105
|
-
return
|
|
5106
|
-
}),
|
|
5397
|
+
return g.value.length && A.value ? t.filter((e) => e.id !== A.value) : t;
|
|
5398
|
+
}), te = v(() => {
|
|
5107
5399
|
if (!e.chatController?.workJournal?.value) return c.value?.workingDescription?.trim() || void 0;
|
|
5108
|
-
}),
|
|
5109
|
-
if (!
|
|
5110
|
-
let e =
|
|
5400
|
+
}), H = v(() => e.chatController?.workJournal?.value), le = v(() => {
|
|
5401
|
+
if (!H.value && !g.value.length) return;
|
|
5402
|
+
let e = M.value, t = e[e.length - 1];
|
|
5111
5403
|
if (t) return t.sender === "bot" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
|
|
5112
|
-
}),
|
|
5404
|
+
}), ue = v(() => {
|
|
5113
5405
|
let t = {};
|
|
5114
|
-
for (let n of
|
|
5406
|
+
for (let n of M.value) {
|
|
5115
5407
|
if (n.sender === "user" || !n.toolActivities?.length) continue;
|
|
5116
5408
|
let r = e.chatController?.workJournalFor?.({
|
|
5117
5409
|
activities: n.toolActivities,
|
|
@@ -5123,7 +5415,7 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5123
5415
|
return t;
|
|
5124
5416
|
});
|
|
5125
5417
|
function messageWorkJournal(e) {
|
|
5126
|
-
return
|
|
5418
|
+
return ue.value[e.id];
|
|
5127
5419
|
}
|
|
5128
5420
|
function inlineOffset(e, t) {
|
|
5129
5421
|
return e.placement?.kind !== "inline" || !Number.isFinite(e.placement.offset) ? null : Math.max(0, Math.min(t.length, Math.trunc(e.placement.offset)));
|
|
@@ -5171,79 +5463,84 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5171
5463
|
text: t.slice(i)
|
|
5172
5464
|
}), r;
|
|
5173
5465
|
}
|
|
5174
|
-
let
|
|
5466
|
+
let _e = v(() => c.value?.transientIssue), J = v(() => {
|
|
5175
5467
|
if (!f.value) return;
|
|
5176
|
-
let e =
|
|
5468
|
+
let e = M.value, t = e[e.length - 1];
|
|
5177
5469
|
return t?.sender === "bot" || t?.sender === "system" ? t.id : void 0;
|
|
5178
|
-
}),
|
|
5179
|
-
if (
|
|
5470
|
+
}), ve = v(() => !f.value || te.value || H.value || g.value.length ? !1 : J.value === void 0), ye = v(() => !!te.value || ve.value), xe = v(() => c.value?.sendBlockedReason), Se = v(() => xe.value === "bot_deleted"), Ce = v(() => p.value ? "Connecting..." : xe.value === "bot_deleted" ? "This assistant was deleted" : "Send a message"), Ee = v(() => s(e.bot.state.value)), De = v(() => {
|
|
5471
|
+
if (at.value || !Ee.value || Ee.value === "awake") return;
|
|
5180
5472
|
let t = e.bot.displayName.value || e.bot.name.value || "Your assistant";
|
|
5181
|
-
return
|
|
5182
|
-
}),
|
|
5473
|
+
return Ee.value === "changing" ? `${t} will be right back…` : Ee.value === "stuck" ? `${t} needs attention.` : `${t} is ${r[Ee.value].toLowerCase()}.`;
|
|
5474
|
+
}), ke = v(() => e.chatController?.composerState?.value ?? {
|
|
5183
5475
|
text: "",
|
|
5184
5476
|
pendingAttachments: [],
|
|
5185
5477
|
isUploading: !1
|
|
5186
|
-
}),
|
|
5187
|
-
get: () =>
|
|
5478
|
+
}), Ae = v({
|
|
5479
|
+
get: () => ke.value.text,
|
|
5188
5480
|
set: (t) => e.chatController?.setComposerText?.({ text: t })
|
|
5189
|
-
}),
|
|
5481
|
+
}), je = v(() => ke.value.pendingAttachments), Me = v(() => ke.value.isUploading), Ne = v(() => e.chatController?.voiceRecorder), Pe = v(() => Ne.value?.isBusy.value ?? !1), Fe = v(() => e.chatController?.canAttachFile?.value ?? !1), Ie = v(() => e.chatController?.canRecordAudio?.value ?? !1), Le = v(() => e.chatController?.composerAction?.value ?? "idle"), ze = v(() => Le.value !== "idle"), Be = v(() => e.chatController?.composerShowsSecondaryStop?.value ?? !1), He = v(() => e.chatController?.queuedMessageIds?.value);
|
|
5190
5482
|
function isQueuedMessage(e) {
|
|
5191
|
-
return
|
|
5483
|
+
return He.value?.has(e) ?? !1;
|
|
5192
5484
|
}
|
|
5193
|
-
let
|
|
5485
|
+
let Ue = B(), We;
|
|
5194
5486
|
function canCopyMessage(e) {
|
|
5195
|
-
return e.sender === "bot" && e.id !==
|
|
5487
|
+
return e.sender === "bot" && e.id !== J.value && !!e.text?.trim();
|
|
5196
5488
|
}
|
|
5197
|
-
let
|
|
5489
|
+
let Ge = v(() => [...M.value].reverse().find(canCopyMessage)?.id);
|
|
5198
5490
|
async function copyMessage(t) {
|
|
5199
5491
|
try {
|
|
5200
|
-
await navigator.clipboard.writeText(t.text),
|
|
5201
|
-
|
|
5492
|
+
await navigator.clipboard.writeText(t.text), Ue.value = t.id, clearTimeout(We), We = setTimeout(() => {
|
|
5493
|
+
Ue.value = void 0;
|
|
5202
5494
|
}, 1500);
|
|
5203
5495
|
} catch (t) {
|
|
5204
5496
|
console.warn("ElBotChat: copy to clipboard rejected", t), e.chatController?.notify?.("Could not copy that message.");
|
|
5205
5497
|
}
|
|
5206
5498
|
}
|
|
5207
|
-
ae(() => clearTimeout(
|
|
5208
|
-
let
|
|
5209
|
-
let e =
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5499
|
+
ae(() => clearTimeout(We));
|
|
5500
|
+
let qe = v(() => e.chatController?.canReportMessages ?? !1), Je = v(() => e.chatController?.messageShare), Ye = B(), Xe = v(() => {
|
|
5501
|
+
let e = Ye.value;
|
|
5502
|
+
if (!e) return;
|
|
5503
|
+
let t = M.value, n = t.findIndex((t) => t.id === e.id);
|
|
5504
|
+
return t.slice(0, Math.max(n, 0)).reverse().find((e) => e.sender === "user")?.text;
|
|
5505
|
+
}), Ze = v(() => Le.value === "stop" ? "Stop reply" : Be.value ? "Send — answered after current work" : "Send message"), Qe = v(() => Ie.value && !Pe.value && !!Ne.value?.canUseBrowserRecording), $e = v(() => Ne.value?.isActive.value ?? !1), et = v(() => Ne.value?.state.value.phase === "sending"), nt = v(() => Ne.value?.elapsedLabel.value ?? "0:00"), rt = v(() => {
|
|
5506
|
+
let e = Ne.value?.state.value.phase;
|
|
5507
|
+
return e === "preparing" || e === "sending" ? Ne.value?.statusText.value ?? "Starting microphone" : mt.value ? "Release to send" : "Click mic to send";
|
|
5508
|
+
}), it = v(() => Ne.value?.state.value.phase === "sending" ? "Sending voice message" : $e.value ? mt.value ? "Release to send voice message" : "Stop and send voice message" : "Record voice message"), at = B(!1), ot = B(), X = B(), Z = B(), st = 0, ct = v(() => e.chatController?.canStartVoice?.value ?? !1);
|
|
5509
|
+
pe([() => e.bot.avatar.value?.src, ct], ([e, t]) => {
|
|
5510
|
+
let n = ++st;
|
|
5511
|
+
if (Z.value = void 0, !t || !e || typeof Image > "u") return;
|
|
5215
5512
|
let r = new Image();
|
|
5216
5513
|
r.onload = () => {
|
|
5217
|
-
n ===
|
|
5514
|
+
n === st && (Z.value = e);
|
|
5218
5515
|
}, r.src = e;
|
|
5219
5516
|
}, { immediate: !0 });
|
|
5220
|
-
let
|
|
5517
|
+
let lt = v(() => ct.value && !at.value && !$e.value && Le.value === "idle"), ut = v(() => !d.value), dt = v(() => ut.value ? `Voice available when ${e.bot.displayName.value || e.bot.name.value || "the assistant"} is awake` : "Start voice conversation");
|
|
5221
5518
|
function startVoiceConversation() {
|
|
5222
|
-
|
|
5519
|
+
lt.value && !ut.value && (X.value = Z.value, at.value = !0);
|
|
5223
5520
|
}
|
|
5224
5521
|
async function endVoiceConversation(t) {
|
|
5225
|
-
if (!
|
|
5226
|
-
let n =
|
|
5227
|
-
|
|
5522
|
+
if (!at.value) return;
|
|
5523
|
+
let n = ot.value;
|
|
5524
|
+
at.value = !1, X.value = void 0, await ee(), await n?.end(), window.matchMedia("(pointer: coarse)").matches || a.value?.focus(), await e.chatController?.refreshMessages(), t && e.chatController?.notify(voiceEndNotice(t, e.bot.displayName.value || e.bot.name.value || "Your assistant"), { systemKind: "voice_ended" });
|
|
5228
5525
|
}
|
|
5229
|
-
let
|
|
5526
|
+
let Q = v(() => e.variant === "light"), ft = v(() => Q.value ? "bg-theme-200/70" : "bg-white/15"), pt = v(() => Q.value ? "text-theme-300" : "text-white/30");
|
|
5230
5527
|
ne(async () => {
|
|
5231
5528
|
e.chatController && !d.value && await e.chatController.startTextConversation();
|
|
5232
5529
|
}), ae(() => {
|
|
5233
5530
|
e.chatController?.voiceRecorder?.teardown();
|
|
5234
5531
|
});
|
|
5235
5532
|
async function sendMessage() {
|
|
5236
|
-
e.chatController &&
|
|
5533
|
+
e.chatController && Le.value === "send" && (a.value && (a.value.style.height = "auto", window.matchMedia("(pointer: coarse)").matches ? (a.value.blur(), requestAnimationFrame(() => {
|
|
5237
5534
|
let e = document.activeElement;
|
|
5238
5535
|
e && (e.tagName === "TEXTAREA" || e.tagName === "INPUT") && e.blur();
|
|
5239
5536
|
})) : a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
|
|
5240
5537
|
}
|
|
5241
5538
|
async function handleCardAction(t) {
|
|
5242
|
-
e.chatController && !
|
|
5539
|
+
e.chatController && !Se.value && (i.value?.pin(), await e.chatController.sendChatMessage(t));
|
|
5243
5540
|
}
|
|
5244
5541
|
async function handleComposerAction() {
|
|
5245
5542
|
if (e.chatController) {
|
|
5246
|
-
if (
|
|
5543
|
+
if (Le.value === "send") {
|
|
5247
5544
|
await sendMessage();
|
|
5248
5545
|
return;
|
|
5249
5546
|
}
|
|
@@ -5254,44 +5551,44 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5254
5551
|
e.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
|
|
5255
5552
|
}
|
|
5256
5553
|
function focusComposer(e) {
|
|
5257
|
-
|
|
5554
|
+
$e.value || Se.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
|
|
5258
5555
|
}
|
|
5259
5556
|
function adjustTextareaHeight() {
|
|
5260
5557
|
a.value && (a.value.style.height = "auto", a.value.style.height = `${Math.min(a.value.scrollHeight, 150)}px`);
|
|
5261
5558
|
}
|
|
5262
|
-
pe(
|
|
5559
|
+
pe(Ae, () => ee(() => adjustTextareaHeight()));
|
|
5263
5560
|
function triggerFileInput() {
|
|
5264
5561
|
o.value?.click();
|
|
5265
5562
|
}
|
|
5266
5563
|
async function handleFileSelect(t) {
|
|
5267
5564
|
let n = t.target, r = n.files?.[0];
|
|
5268
|
-
r && e.chatController && !
|
|
5565
|
+
r && e.chatController && !Pe.value && (await e.chatController.attachFile({ file: r }), n.value = "");
|
|
5269
5566
|
}
|
|
5270
5567
|
function removeAttachment(t) {
|
|
5271
5568
|
e.chatController?.removeAttachment({ index: t });
|
|
5272
5569
|
}
|
|
5273
5570
|
function startRecording() {
|
|
5274
|
-
|
|
5571
|
+
Ne.value?.start();
|
|
5275
5572
|
}
|
|
5276
5573
|
function finishRecording(e) {
|
|
5277
|
-
|
|
5574
|
+
Ne.value?.finish(e);
|
|
5278
5575
|
}
|
|
5279
|
-
let
|
|
5576
|
+
let mt = U(!1), ht = !1;
|
|
5280
5577
|
function onRecordPointerDown(e) {
|
|
5281
|
-
e.pointerType === "touch" && (
|
|
5578
|
+
e.pointerType === "touch" && (ht = !0, mt.value = !0, e.currentTarget.setPointerCapture?.(e.pointerId), startRecording());
|
|
5282
5579
|
}
|
|
5283
5580
|
function onRecordPointerUp(e) {
|
|
5284
|
-
e.pointerType === "touch" &&
|
|
5581
|
+
e.pointerType === "touch" && mt.value && (mt.value = !1, finishRecording({ cancelled: !1 }));
|
|
5285
5582
|
}
|
|
5286
5583
|
function onRecordPointerCancel(e) {
|
|
5287
|
-
e.pointerType === "touch" &&
|
|
5584
|
+
e.pointerType === "touch" && mt.value && (mt.value = !1, ht = !1, finishRecording({ cancelled: !0 }));
|
|
5288
5585
|
}
|
|
5289
5586
|
function toggleRecording() {
|
|
5290
|
-
|
|
5587
|
+
$e.value ? finishRecording({ cancelled: !1 }) : startRecording();
|
|
5291
5588
|
}
|
|
5292
5589
|
function onRecordClick() {
|
|
5293
|
-
if (
|
|
5294
|
-
|
|
5590
|
+
if (ht) {
|
|
5591
|
+
ht = !1;
|
|
5295
5592
|
return;
|
|
5296
5593
|
}
|
|
5297
5594
|
toggleRecording();
|
|
@@ -5323,24 +5620,24 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5323
5620
|
...o ? {} : { year: "numeric" }
|
|
5324
5621
|
})}, ${a}`;
|
|
5325
5622
|
}
|
|
5326
|
-
return (t, r) => (
|
|
5623
|
+
return (t, r) => (R(), x("div", {
|
|
5327
5624
|
"data-test": "messaging-root",
|
|
5328
|
-
class:
|
|
5625
|
+
class: j(["@container/chat relative flex h-full flex-col", M.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""])
|
|
5329
5626
|
}, [
|
|
5330
|
-
e.showHeader && !
|
|
5627
|
+
e.showHeader && !Q.value ? (R(), x("div", xa, [E(Ve, {
|
|
5331
5628
|
bot: e.bot,
|
|
5332
5629
|
"is-online": d.value
|
|
5333
|
-
}, null, 8, ["bot", "is-online"])])) : e.showHeader ? (
|
|
5334
|
-
|
|
5630
|
+
}, null, 8, ["bot", "is-online"])])) : e.showHeader ? (R(), x("div", Sa, [w("div", { class: j(["flex items-center gap-3", e.centered ? "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto" : ""]) }, [
|
|
5631
|
+
E(Ke, {
|
|
5335
5632
|
bot: e.bot,
|
|
5336
|
-
"is-light":
|
|
5633
|
+
"is-light": Q.value,
|
|
5337
5634
|
class: "size-10"
|
|
5338
5635
|
}, null, 8, ["bot", "is-light"]),
|
|
5339
|
-
|
|
5340
|
-
e.headerMeta ? (
|
|
5341
|
-
], 2)])) :
|
|
5342
|
-
|
|
5343
|
-
default: me(() => [
|
|
5636
|
+
w("div", Ca, [w("div", wa, G(e.bot.displayName.value), 1), w("div", Ta, G(e.bot.title.value || "Assistant"), 1)]),
|
|
5637
|
+
e.headerMeta ? (R(), x("span", Ea, G(e.headerMeta), 1)) : b("", !0)
|
|
5638
|
+
], 2)])) : b("", !0),
|
|
5639
|
+
E(_, { name: "voice-call" }, {
|
|
5640
|
+
default: me(() => [at.value ? (R(), x("div", {
|
|
5344
5641
|
key: 0,
|
|
5345
5642
|
"data-test": "voice-call-overlay",
|
|
5346
5643
|
role: "dialog",
|
|
@@ -5348,12 +5645,12 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5348
5645
|
"aria-label": `Voice conversation with ${e.bot.displayName.value}`,
|
|
5349
5646
|
class: "fixed inset-0 z-[100] flex items-stretch justify-stretch bg-[#050F19] sm:items-center sm:justify-center sm:bg-[#050F19]/45 sm:p-6",
|
|
5350
5647
|
onKeydown: r[0] || (r[0] = ge((e) => endVoiceConversation(), ["esc"]))
|
|
5351
|
-
}, [
|
|
5648
|
+
}, [E(ba, {
|
|
5352
5649
|
ref_key: "voiceMode",
|
|
5353
|
-
ref:
|
|
5650
|
+
ref: ot,
|
|
5354
5651
|
bot: e.bot,
|
|
5355
5652
|
"chat-controller": e.chatController,
|
|
5356
|
-
"backdrop-src":
|
|
5653
|
+
"backdrop-src": X.value,
|
|
5357
5654
|
"is-light": !1,
|
|
5358
5655
|
class: "voice-call-card h-full w-full sm:max-h-[620px] sm:max-w-[420px] sm:flex-none sm:rounded-[32px] sm:shadow-[0_32px_80px_rgba(5,15,25,0.45)]",
|
|
5359
5656
|
onEnd: endVoiceConversation
|
|
@@ -5361,51 +5658,51 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5361
5658
|
"bot",
|
|
5362
5659
|
"chat-controller",
|
|
5363
5660
|
"backdrop-src"
|
|
5364
|
-
])], 40,
|
|
5661
|
+
])], 40, Da)) : b("", !0)]),
|
|
5365
5662
|
_: 1
|
|
5366
5663
|
}),
|
|
5367
|
-
p.value ? (
|
|
5664
|
+
p.value ? (R(), x("div", {
|
|
5368
5665
|
key: 2,
|
|
5369
|
-
class:
|
|
5370
|
-
}, [
|
|
5666
|
+
class: j(["py-16 flex flex-col items-center justify-center gap-2 text-sm", Q.value ? "text-theme-400" : "text-theme-600"])
|
|
5667
|
+
}, [E(Y, { class: "size-4" })], 2)) : e.setupHint ? (R(), x("div", {
|
|
5371
5668
|
key: 3,
|
|
5372
|
-
class:
|
|
5373
|
-
}, [r[
|
|
5374
|
-
|
|
5669
|
+
class: j(["flex items-center justify-center gap-1.5 py-2 text-[11px]", pt.value])
|
|
5670
|
+
}, [r[15] || (r[15] = w("i", { class: "i-tabler-tool size-3" }, null, -1)), w("span", null, G(e.setupHint), 1)], 2)) : b("", !0),
|
|
5671
|
+
E(Ei, {
|
|
5375
5672
|
ref_key: "chatScroller",
|
|
5376
5673
|
ref: i,
|
|
5377
|
-
inert:
|
|
5378
|
-
"aria-hidden":
|
|
5379
|
-
class:
|
|
5674
|
+
inert: at.value,
|
|
5675
|
+
"aria-hidden": at.value ? "true" : void 0,
|
|
5676
|
+
class: j(M.value.length === 0 ? "flex-none" : "flex-1")
|
|
5380
5677
|
}, {
|
|
5381
|
-
default: me(() => [
|
|
5382
|
-
|
|
5678
|
+
default: me(() => [w("div", { class: j([M.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : e.centered ? "pt-20 pb-5 px-3 @lg/chat:px-8 space-y-2" : "pt-4 pb-[120px] px-3 @lg/chat:px-8 space-y-2", e.centered ? M.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto w-full" : ""]) }, [
|
|
5679
|
+
M.value.length === 0 && !p.value ? (R(), x("div", Oa, [ce(t.$slots, "empty-heading", {
|
|
5383
5680
|
bot: e.bot,
|
|
5384
|
-
isLight:
|
|
5385
|
-
}, () => [
|
|
5681
|
+
isLight: Q.value
|
|
5682
|
+
}, () => [E(Ke, {
|
|
5386
5683
|
bot: e.bot,
|
|
5387
|
-
"is-light":
|
|
5684
|
+
"is-light": Q.value,
|
|
5388
5685
|
class: "mb-4 size-20 @sm/chat:size-24"
|
|
5389
|
-
}, null, 8, ["bot", "is-light"]),
|
|
5390
|
-
class:
|
|
5686
|
+
}, null, 8, ["bot", "is-light"]), w("div", { class: j(["text-base @sm/chat:text-lg font-semibold", Q.value ? "text-theme-900" : "text-white"]) }, G(e.bot.displayName.value), 3)], !0), e.emptyStateMessage === "" ? b("", !0) : (R(), x(m, { key: 0 }, [w("p", { class: j(["mt-1 text-center text-xs @sm/chat:text-sm", pt.value]) }, G(e.emptyStateMessage || "Type your message to get started."), 3), w("div", {
|
|
5687
|
+
class: j(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", Q.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
5391
5688
|
title: n.value.tooltip
|
|
5392
|
-
}, [
|
|
5393
|
-
(
|
|
5394
|
-
shouldShowTimeDivider(
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
])) :
|
|
5399
|
-
messageWorkJournal(t) ? (
|
|
5689
|
+
}, [w("i", { class: j([n.value.icon, "size-3"]) }, null, 2), w("span", null, G(n.value.label), 1)], 10, ka)], 64))])) : b("", !0),
|
|
5690
|
+
(R(!0), x(m, null, V(M.value, (t, n) => (R(), x(m, { key: t.id }, [
|
|
5691
|
+
shouldShowTimeDivider(M.value, n) ? (R(), x("div", Aa, [
|
|
5692
|
+
w("div", { class: j(["flex-1 h-px", ft.value]) }, null, 2),
|
|
5693
|
+
w("span", { class: j(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", pt.value]) }, G(shouldShowTimeDivider(M.value, n)), 3),
|
|
5694
|
+
w("div", { class: j(["flex-1 h-px", ft.value]) }, null, 2)
|
|
5695
|
+
])) : b("", !0),
|
|
5696
|
+
messageWorkJournal(t) ? (R(), x("div", {
|
|
5400
5697
|
key: 1,
|
|
5401
5698
|
"data-test": "messaging-message-tool-activity",
|
|
5402
5699
|
"data-journal-outcome": messageWorkJournal(t)?.outcome,
|
|
5403
5700
|
class: "mb-4 w-full"
|
|
5404
|
-
}, [
|
|
5701
|
+
}, [E(tt, {
|
|
5405
5702
|
model: messageWorkJournal(t),
|
|
5406
|
-
"is-light":
|
|
5407
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5408
|
-
isSystemExplainerMessage(t) ? (
|
|
5703
|
+
"is-light": Q.value
|
|
5704
|
+
}, null, 8, ["model", "is-light"])], 8, ja)) : b("", !0),
|
|
5705
|
+
isSystemExplainerMessage(t) ? (R(), x("section", {
|
|
5409
5706
|
key: 2,
|
|
5410
5707
|
"data-test": "messaging-system-msg",
|
|
5411
5708
|
"data-message-id": t.id,
|
|
@@ -5417,42 +5714,42 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5417
5714
|
"data-issue-bucket": t.issue?.bucket,
|
|
5418
5715
|
"data-issue-action-label": t.issue?.actionLabel,
|
|
5419
5716
|
"data-issue-action-url": t.issue?.actionUrl,
|
|
5420
|
-
"data-streaming": t.id ===
|
|
5717
|
+
"data-streaming": t.id === J.value ? "true" : void 0,
|
|
5421
5718
|
class: "mb-6 w-full"
|
|
5422
|
-
}, [
|
|
5423
|
-
|
|
5719
|
+
}, [w("div", { class: j(["mb-1.5 text-center text-[10.5px] font-medium", pt.value]) }, "System message", 2), w("div", Na, [
|
|
5720
|
+
w("span", {
|
|
5424
5721
|
"data-test": "messaging-system-divider-line",
|
|
5425
5722
|
"aria-hidden": "true",
|
|
5426
|
-
class:
|
|
5723
|
+
class: j(["hidden h-px flex-1 opacity-60 @md/chat:block", ft.value])
|
|
5427
5724
|
}, null, 2),
|
|
5428
|
-
|
|
5725
|
+
w("div", { class: j(["w-[46ch] min-w-0 max-w-full rounded-2xl px-5 py-3.5 text-center text-[13px] ring-1 [&_.chat-msg-rich]:max-w-none [&_.chat-msg-rich]:text-[13px] [&_.chat-msg-rich]:italic [&_.chat-msg-rich]:leading-[1.6]", Q.value ? "text-theme-700 ring-theme-200/50" : "text-white/85 ring-white/10"]) }, [t.text ? (R(), y(Ci, {
|
|
5429
5726
|
key: 0,
|
|
5430
5727
|
text: t.text,
|
|
5431
|
-
inverted: !
|
|
5432
|
-
streaming: t.id ===
|
|
5433
|
-
onClick: r[1] || (r[1] =
|
|
5728
|
+
inverted: !Q.value,
|
|
5729
|
+
streaming: t.id === J.value,
|
|
5730
|
+
onClick: r[1] || (r[1] = K(() => {}, ["stop"])),
|
|
5434
5731
|
onAction: handleCardAction
|
|
5435
5732
|
}, null, 8, [
|
|
5436
5733
|
"text",
|
|
5437
5734
|
"inverted",
|
|
5438
5735
|
"streaming"
|
|
5439
|
-
])) : t.issue?.help ? (
|
|
5736
|
+
])) : t.issue?.help ? (R(), y(Ci, {
|
|
5440
5737
|
key: 1,
|
|
5441
5738
|
text: t.issue.help,
|
|
5442
|
-
inverted: !
|
|
5443
|
-
}, null, 8, ["text", "inverted"])) :
|
|
5739
|
+
inverted: !Q.value
|
|
5740
|
+
}, null, 8, ["text", "inverted"])) : b("", !0), t.issue?.actionUrl && !containsMarkdownLink(t.text) ? (R(), x("a", {
|
|
5444
5741
|
key: 2,
|
|
5445
5742
|
href: t.issue.actionUrl,
|
|
5446
5743
|
"data-test": "messaging-system-msg-action",
|
|
5447
|
-
class:
|
|
5448
|
-
onClick: r[2] || (r[2] =
|
|
5449
|
-
}, [
|
|
5450
|
-
|
|
5744
|
+
class: j(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", Q.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
5745
|
+
onClick: r[2] || (r[2] = K(() => {}, ["stop"]))
|
|
5746
|
+
}, [T(G(t.issue.actionLabel) + " ", 1), r[16] || (r[16] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, Pa)) : b("", !0)], 2),
|
|
5747
|
+
w("span", {
|
|
5451
5748
|
"data-test": "messaging-system-divider-line",
|
|
5452
5749
|
"aria-hidden": "true",
|
|
5453
|
-
class:
|
|
5750
|
+
class: j(["hidden h-px flex-1 opacity-60 @md/chat:block", ft.value])
|
|
5454
5751
|
}, null, 2)
|
|
5455
|
-
])], 8,
|
|
5752
|
+
])], 8, Ma)) : t.sender === "system" && (t.systemKind === "routine_completed" || t.systemKind === "voice_ended") ? (R(), x("div", {
|
|
5456
5753
|
key: 3,
|
|
5457
5754
|
"data-test": t.systemKind === "routine_completed" ? "messaging-routine-receipt" : "messaging-voice-receipt",
|
|
5458
5755
|
"data-message-id": t.id,
|
|
@@ -5461,11 +5758,11 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5461
5758
|
"data-message-sequence": t.sequence,
|
|
5462
5759
|
"data-system-kind": t.systemKind,
|
|
5463
5760
|
"data-routine-run-id": t.routine?.run.routineRunId,
|
|
5464
|
-
class:
|
|
5465
|
-
}, [
|
|
5466
|
-
class:
|
|
5761
|
+
class: j(["mb-6 flex items-center justify-center gap-2 text-[12px] leading-relaxed", Q.value ? "text-theme-400" : "text-white/50"])
|
|
5762
|
+
}, [w("i", {
|
|
5763
|
+
class: j(["size-3.5 shrink-0", t.systemKind === "voice_ended" ? "i-tabler-phone-off" : "i-tabler-clock"]),
|
|
5467
5764
|
"aria-hidden": "true"
|
|
5468
|
-
}, null, 2),
|
|
5765
|
+
}, null, 2), w("span", null, G(t.text), 1)], 10, Fa)) : t.sender === "system" ? (R(), x("div", {
|
|
5469
5766
|
key: 4,
|
|
5470
5767
|
"data-test": "messaging-system-status-msg",
|
|
5471
5768
|
"data-message-id": t.id,
|
|
@@ -5475,16 +5772,16 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5475
5772
|
"data-system-kind": t.systemKind,
|
|
5476
5773
|
"data-issue-code": t.issue?.code,
|
|
5477
5774
|
"data-issue-bucket": t.issue?.bucket,
|
|
5478
|
-
"data-streaming": t.id ===
|
|
5479
|
-
class:
|
|
5480
|
-
}, [r[
|
|
5775
|
+
"data-streaming": t.id === J.value ? "true" : void 0,
|
|
5776
|
+
class: j(["mb-4 flex w-fit max-w-[85%] items-start gap-2 rounded-2xl px-3 py-2 text-[13px] leading-relaxed ring-1", Q.value ? "bg-theme-100 text-theme-600 ring-theme-200" : "bg-white/10 text-white/70 ring-white/10"])
|
|
5777
|
+
}, [r[17] || (r[17] = w("i", {
|
|
5481
5778
|
class: "i-tabler-info-circle size-4 mt-0.5 shrink-0",
|
|
5482
5779
|
"aria-hidden": "true"
|
|
5483
|
-
}, null, -1)),
|
|
5780
|
+
}, null, -1)), E(Ci, {
|
|
5484
5781
|
text: t.text,
|
|
5485
|
-
inverted: !
|
|
5486
|
-
onClick: r[3] || (r[3] =
|
|
5487
|
-
}, null, 8, ["text", "inverted"])], 10,
|
|
5782
|
+
inverted: !Q.value,
|
|
5783
|
+
onClick: r[3] || (r[3] = K(() => {}, ["stop"]))
|
|
5784
|
+
}, null, 8, ["text", "inverted"])], 10, Ia)) : (R(), x("div", {
|
|
5488
5785
|
key: 5,
|
|
5489
5786
|
"data-test": t.sender === "bot" ? "messaging-assistant-msg" : t.sender === "user" ? "messaging-user-msg" : void 0,
|
|
5490
5787
|
"data-message-id": t.id,
|
|
@@ -5492,199 +5789,214 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5492
5789
|
"data-conversation-id": t.conversationId,
|
|
5493
5790
|
"data-message-sequence": t.sequence,
|
|
5494
5791
|
"data-system-kind": t.systemKind,
|
|
5495
|
-
"data-streaming": t.id ===
|
|
5792
|
+
"data-streaming": t.id === J.value ? "true" : void 0,
|
|
5496
5793
|
"data-queued": isQueuedMessage(t.id) ? "true" : void 0,
|
|
5497
5794
|
"aria-label": isQueuedMessage(t.id) ? "Sent — will be answered after the current work finishes" : void 0,
|
|
5498
|
-
class:
|
|
5795
|
+
class: j(["group/msg flex gap-2 items-end", {
|
|
5499
5796
|
"justify-end": t.sender === "user",
|
|
5500
5797
|
"justify-start": t.sender === "bot",
|
|
5501
|
-
"mb-6": isGroupEnd(
|
|
5798
|
+
"mb-6": isGroupEnd(M.value, n),
|
|
5502
5799
|
"opacity-70": isQueuedMessage(t.id)
|
|
5503
5800
|
}])
|
|
5504
|
-
}, [
|
|
5801
|
+
}, [w("div", {
|
|
5505
5802
|
"data-test": "messaging-message-body",
|
|
5506
|
-
class:
|
|
5803
|
+
class: j(t.sender === "user" ? "min-w-0 ml-3 @sm/chat:ml-[2em]" : "w-full min-w-0 pr-3 @sm/chat:pr-[2em]")
|
|
5507
5804
|
}, [
|
|
5508
|
-
t.sender === "bot" && t.routine ? (
|
|
5805
|
+
t.sender === "bot" && t.routine ? (R(), x("div", {
|
|
5509
5806
|
key: 0,
|
|
5510
5807
|
"data-test": "messaging-routine-label",
|
|
5511
5808
|
"data-routine-run-id": t.routine.run.routineRunId,
|
|
5512
|
-
class:
|
|
5513
|
-
}, [r[
|
|
5809
|
+
class: j(["mb-2 flex items-start gap-2 text-[12px] leading-relaxed", Q.value ? "text-theme-400" : "text-white/50"])
|
|
5810
|
+
}, [r[18] || (r[18] = w("i", {
|
|
5514
5811
|
class: "i-tabler-clock size-3.5 mt-0.5 shrink-0",
|
|
5515
5812
|
"aria-hidden": "true"
|
|
5516
|
-
}, null, -1)),
|
|
5517
|
-
blockAttachmentsForMessage(t).length ? (
|
|
5813
|
+
}, null, -1)), w("span", null, "Ran " + G(t.routine.run.name || t.routine.run.sourceLabel || "a routine"), 1)], 10, Ra)) : b("", !0),
|
|
5814
|
+
blockAttachmentsForMessage(t).length ? (R(), x("div", {
|
|
5518
5815
|
key: 1,
|
|
5519
|
-
class:
|
|
5520
|
-
}, [(
|
|
5816
|
+
class: j(["mb-1 space-y-1", t.sender === "user" ? "flex flex-col items-end" : ""])
|
|
5817
|
+
}, [(R(!0), x(m, null, V(blockAttachmentsForMessage(t), ({ attachment: e, index: t }) => (R(), x(m, { key: attachmentKey(e, t) }, [e.type === "image" ? (R(), x("img", {
|
|
5521
5818
|
key: 0,
|
|
5522
5819
|
src: e.src,
|
|
5523
5820
|
alt: e.filename,
|
|
5524
5821
|
"data-test": "messaging-attachment",
|
|
5525
5822
|
"data-attachment-placement": "block",
|
|
5526
5823
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
5527
|
-
}, null, 8,
|
|
5824
|
+
}, null, 8, za)) : e.type === "audio" ? (R(), x("audio", {
|
|
5528
5825
|
key: 1,
|
|
5529
5826
|
src: e.src,
|
|
5530
5827
|
controls: "",
|
|
5531
5828
|
"data-test": "messaging-attachment",
|
|
5532
5829
|
"data-attachment-placement": "block",
|
|
5533
5830
|
class: "max-w-full"
|
|
5534
|
-
}, null, 8,
|
|
5831
|
+
}, null, 8, Ba)) : (R(), x("a", {
|
|
5535
5832
|
key: 2,
|
|
5536
5833
|
href: e.src,
|
|
5537
5834
|
target: "_blank",
|
|
5538
5835
|
rel: "noopener",
|
|
5539
5836
|
"data-test": "messaging-attachment",
|
|
5540
5837
|
"data-attachment-placement": "block",
|
|
5541
|
-
class:
|
|
5542
|
-
}, [r[
|
|
5543
|
-
messageRenderParts(t).length ? (
|
|
5838
|
+
class: j(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Q.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
5839
|
+
}, [r[19] || (r[19] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)), T(" " + G(e.filename), 1)], 10, Va))], 64))), 128))], 2)) : b("", !0),
|
|
5840
|
+
messageRenderParts(t).length ? (R(), x("div", {
|
|
5544
5841
|
key: 2,
|
|
5545
5842
|
"data-test": "messaging-message-content",
|
|
5546
|
-
class:
|
|
5547
|
-
}, [(
|
|
5843
|
+
class: j(t.sender === "user" ? Q.value ? "rounded-[14px] px-4 py-2.5 bg-theme-50 text-theme-900" : "rounded-[14px] px-4 py-2.5 bg-white/10 text-white" : Q.value ? "text-theme-800" : "text-white/95")
|
|
5844
|
+
}, [(R(!0), x(m, null, V(messageRenderParts(t), (e) => (R(), x(m, { key: e.key }, [e.kind === "text" && e.text ? (R(), x("div", Ha, [E(Ci, {
|
|
5548
5845
|
text: e.text,
|
|
5549
|
-
inverted: t.sender === "user" || !
|
|
5550
|
-
streaming: t.id ===
|
|
5551
|
-
onClick: r[4] || (r[4] =
|
|
5846
|
+
inverted: t.sender === "user" || !Q.value,
|
|
5847
|
+
streaming: t.id === J.value,
|
|
5848
|
+
onClick: r[4] || (r[4] = K(() => {}, ["stop"])),
|
|
5552
5849
|
onAction: handleCardAction
|
|
5553
5850
|
}, null, 8, [
|
|
5554
5851
|
"text",
|
|
5555
5852
|
"inverted",
|
|
5556
5853
|
"streaming"
|
|
5557
|
-
])])) : e.kind === "attachment" && e.attachment.type === "image" ? (
|
|
5854
|
+
])])) : e.kind === "attachment" && e.attachment.type === "image" ? (R(), x("img", {
|
|
5558
5855
|
key: 1,
|
|
5559
5856
|
src: e.attachment.src,
|
|
5560
5857
|
alt: e.attachment.filename,
|
|
5561
5858
|
"data-test": "messaging-attachment",
|
|
5562
5859
|
"data-attachment-placement": e.placement,
|
|
5563
5860
|
class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
5564
|
-
}, null, 8,
|
|
5861
|
+
}, null, 8, Ua)) : e.kind === "attachment" && e.attachment.type === "audio" ? (R(), x("audio", {
|
|
5565
5862
|
key: 2,
|
|
5566
5863
|
src: e.attachment.src,
|
|
5567
5864
|
controls: "",
|
|
5568
5865
|
"data-test": "messaging-attachment",
|
|
5569
5866
|
"data-attachment-placement": e.placement,
|
|
5570
5867
|
class: "my-2 max-w-full"
|
|
5571
|
-
}, null, 8,
|
|
5868
|
+
}, null, 8, Wa)) : e.kind === "attachment" ? (R(), x("a", {
|
|
5572
5869
|
key: 3,
|
|
5573
5870
|
href: e.attachment.src,
|
|
5574
5871
|
target: "_blank",
|
|
5575
5872
|
rel: "noopener",
|
|
5576
5873
|
"data-test": "messaging-attachment",
|
|
5577
5874
|
"data-attachment-placement": e.placement,
|
|
5578
|
-
class:
|
|
5579
|
-
}, [r[
|
|
5580
|
-
canCopyMessage(t) ? (
|
|
5875
|
+
class: j(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", Q.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
5876
|
+
}, [r[20] || (r[20] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)), T(" " + G(e.attachment.filename), 1)], 10, Ga)) : b("", !0)], 64))), 128))], 2)) : b("", !0),
|
|
5877
|
+
canCopyMessage(t) ? (R(), x("div", {
|
|
5581
5878
|
key: 3,
|
|
5582
5879
|
"data-test": "messaging-message-actions",
|
|
5583
|
-
"data-actions-reveal": t.id ===
|
|
5584
|
-
class:
|
|
5585
|
-
}, [
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
"
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5880
|
+
"data-actions-reveal": t.id === Ge.value ? "always" : "hover",
|
|
5881
|
+
class: j(["-ml-1 flex items-center gap-1 pt-1 transition-opacity", [Q.value ? "text-theme-300" : "text-white/35", t.id === Ge.value ? "" : "opacity-0 group-hover/msg:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100"]])
|
|
5882
|
+
}, [
|
|
5883
|
+
w("button", {
|
|
5884
|
+
type: "button",
|
|
5885
|
+
"data-test": "messaging-message-copy",
|
|
5886
|
+
"data-copied": Ue.value === t.id || void 0,
|
|
5887
|
+
title: Ue.value === t.id ? "Copied" : "Copy",
|
|
5888
|
+
"aria-label": Ue.value === t.id ? "Copied" : "Copy",
|
|
5889
|
+
class: j(["grid size-6 cursor-pointer place-items-center transition-colors", Q.value ? "hover:text-theme-800" : "hover:text-white"]),
|
|
5890
|
+
onClick: K((e) => copyMessage(t), ["stop"])
|
|
5891
|
+
}, [w("i", {
|
|
5892
|
+
class: j(["size-3.5", Ue.value === t.id ? "i-tabler-check" : "i-tabler-copy"]),
|
|
5893
|
+
"aria-hidden": "true"
|
|
5894
|
+
}, null, 2)], 10, qa),
|
|
5895
|
+
Je.value ? (R(), x("button", {
|
|
5896
|
+
key: 0,
|
|
5897
|
+
type: "button",
|
|
5898
|
+
"data-test": "messaging-message-share",
|
|
5899
|
+
title: "Share",
|
|
5900
|
+
"aria-label": "Share",
|
|
5901
|
+
class: j(["grid size-6 cursor-pointer place-items-center transition-colors", Q.value ? "hover:text-theme-800" : "hover:text-white"]),
|
|
5902
|
+
onClick: K((e) => Ye.value = t, ["stop"])
|
|
5903
|
+
}, [...r[21] || (r[21] = [w("i", {
|
|
5904
|
+
class: "i-tabler-share-2 size-3.5",
|
|
5905
|
+
"aria-hidden": "true"
|
|
5906
|
+
}, null, -1)])], 10, Ja)) : b("", !0),
|
|
5907
|
+
qe.value ? (R(), x("button", {
|
|
5908
|
+
key: 1,
|
|
5909
|
+
type: "button",
|
|
5910
|
+
"data-test": "messaging-message-report",
|
|
5911
|
+
title: "Report",
|
|
5912
|
+
"aria-label": "Report",
|
|
5913
|
+
class: j(["grid size-6 cursor-pointer place-items-center transition-colors", Q.value ? "hover:text-theme-800" : "hover:text-white"]),
|
|
5914
|
+
onClick: K((n) => e.chatController?.reportMessage(t.id), ["stop"])
|
|
5915
|
+
}, [...r[22] || (r[22] = [w("i", {
|
|
5916
|
+
class: "i-tabler-flag size-3.5",
|
|
5917
|
+
"aria-hidden": "true"
|
|
5918
|
+
}, null, -1)])], 10, Ya)) : b("", !0)
|
|
5919
|
+
], 10, Ka)) : b("", !0)
|
|
5920
|
+
], 2)], 10, La)),
|
|
5921
|
+
t.id === le.value ? (R(), x(m, { key: 6 }, [g.value.length ? (R(!0), x(m, { key: 0 }, V(g.value, (e) => (R(), x(m, { key: e.id }, [e.kind === "work" ? (R(), x("div", {
|
|
5610
5922
|
key: 0,
|
|
5611
5923
|
"data-test": "messaging-tool-activity",
|
|
5612
5924
|
"data-journal-outcome": e.journal.outcome,
|
|
5613
5925
|
class: "chat-live-enter mb-4 w-full"
|
|
5614
|
-
}, [
|
|
5926
|
+
}, [E(tt, {
|
|
5615
5927
|
model: e.journal,
|
|
5616
|
-
"is-light":
|
|
5617
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5928
|
+
"is-light": Q.value
|
|
5929
|
+
}, null, 8, ["model", "is-light"])], 8, Xa)) : e.kind === "text" && e.content ? (R(), x("div", {
|
|
5618
5930
|
key: 1,
|
|
5619
5931
|
"data-test": "messaging-live-text-block",
|
|
5620
|
-
class:
|
|
5621
|
-
}, [
|
|
5932
|
+
class: j(["mb-4", Q.value ? "text-theme-800" : "text-white/95"])
|
|
5933
|
+
}, [E(Ci, {
|
|
5622
5934
|
text: e.content,
|
|
5623
|
-
inverted: !
|
|
5624
|
-
streaming: e.id ===
|
|
5625
|
-
onClick: r[5] || (r[5] =
|
|
5935
|
+
inverted: !Q.value,
|
|
5936
|
+
streaming: e.id === D.value,
|
|
5937
|
+
onClick: r[5] || (r[5] = K(() => {}, ["stop"])),
|
|
5626
5938
|
onAction: handleCardAction
|
|
5627
5939
|
}, null, 8, [
|
|
5628
5940
|
"text",
|
|
5629
5941
|
"inverted",
|
|
5630
5942
|
"streaming"
|
|
5631
|
-
])], 2)) : (
|
|
5943
|
+
])], 2)) : (R(), x("div", {
|
|
5632
5944
|
key: 2,
|
|
5633
5945
|
"data-test": "messaging-tool-activity-tail",
|
|
5634
5946
|
"aria-label": "Assistant is still working",
|
|
5635
|
-
class:
|
|
5636
|
-
}, [...r[
|
|
5947
|
+
class: j(["chat-live-enter mb-4 grid h-[17px] w-5 place-items-center", Q.value ? "text-theme-500" : "text-white/70"])
|
|
5948
|
+
}, [...r[23] || (r[23] = [w("span", {
|
|
5637
5949
|
class: "chat-dots chat-dots--mini",
|
|
5638
5950
|
"aria-hidden": "true"
|
|
5639
5951
|
}, [
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
], -1)])], 2))], 64))), 128)) :
|
|
5952
|
+
w("span"),
|
|
5953
|
+
w("span"),
|
|
5954
|
+
w("span")
|
|
5955
|
+
], -1)])], 2))], 64))), 128)) : H.value ? (R(), x("div", {
|
|
5644
5956
|
key: 1,
|
|
5645
5957
|
"data-test": "messaging-tool-activity",
|
|
5646
|
-
"data-journal-outcome":
|
|
5958
|
+
"data-journal-outcome": H.value.outcome,
|
|
5647
5959
|
class: "chat-live-enter mb-4 w-full"
|
|
5648
|
-
}, [
|
|
5649
|
-
model:
|
|
5650
|
-
"is-light":
|
|
5651
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
5960
|
+
}, [E(tt, {
|
|
5961
|
+
model: H.value,
|
|
5962
|
+
"is-light": Q.value
|
|
5963
|
+
}, null, 8, ["model", "is-light"])], 8, Za)) : b("", !0)], 64)) : b("", !0)
|
|
5652
5964
|
], 64))), 128)),
|
|
5653
|
-
|
|
5965
|
+
ye.value ? (R(), x("div", {
|
|
5654
5966
|
key: 1,
|
|
5655
|
-
"data-test":
|
|
5656
|
-
"data-working-description":
|
|
5967
|
+
"data-test": te.value ? "messaging-working-state" : "messaging-thinking-indicator",
|
|
5968
|
+
"data-working-description": te.value,
|
|
5657
5969
|
role: "status",
|
|
5658
5970
|
"aria-live": "polite",
|
|
5659
|
-
class:
|
|
5660
|
-
}, [r[
|
|
5971
|
+
class: j(["chat-live-enter relative mb-4 flex h-[17px] items-center gap-2.5 pl-0.5 text-[13.5px] leading-snug", Q.value ? "text-theme-500" : "text-white/50"])
|
|
5972
|
+
}, [r[24] || (r[24] = w("span", {
|
|
5661
5973
|
"data-test": "messaging-thinking-dots",
|
|
5662
5974
|
class: "chat-dots shrink-0",
|
|
5663
5975
|
"aria-hidden": "true"
|
|
5664
5976
|
}, [
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
], -1)),
|
|
5669
|
-
|
|
5977
|
+
w("span"),
|
|
5978
|
+
w("span"),
|
|
5979
|
+
w("span")
|
|
5980
|
+
], -1)), te.value ? (R(), x("span", $a, G(te.value), 1)) : (R(), x("span", eo, "Thinking"))], 10, Qa)) : b("", !0),
|
|
5981
|
+
_e.value ? (R(), x("div", {
|
|
5670
5982
|
key: 2,
|
|
5671
5983
|
"data-test": "messaging-transient-issue",
|
|
5672
|
-
"data-issue-code":
|
|
5984
|
+
"data-issue-code": _e.value.code,
|
|
5673
5985
|
role: "alert",
|
|
5674
|
-
class:
|
|
5986
|
+
class: j(["chat-live-enter mb-4 flex items-start gap-2 px-2 text-[13px] leading-snug", Q.value ? "text-theme-600" : "text-white/60"])
|
|
5675
5987
|
}, [
|
|
5676
|
-
r[
|
|
5988
|
+
r[26] || (r[26] = w("i", {
|
|
5677
5989
|
class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
|
|
5678
5990
|
"aria-hidden": "true"
|
|
5679
5991
|
}, null, -1)),
|
|
5680
|
-
|
|
5681
|
-
|
|
5992
|
+
w("span", no, [w("span", ro, [T(G(_e.value.message), 1), _e.value.help ? (R(), x(m, { key: 0 }, [T(":")], 64)) : b("", !0)]), _e.value.help ? (R(), x(m, { key: 0 }, [r[25] || (r[25] = T(G(" "), -1)), w("span", io, G(_e.value.help), 1)], 64)) : b("", !0)]),
|
|
5993
|
+
_e.value.actionUrl && _e.value.actionLabel ? (R(), x("a", {
|
|
5682
5994
|
key: 0,
|
|
5683
|
-
href:
|
|
5995
|
+
href: _e.value.actionUrl,
|
|
5684
5996
|
class: "shrink-0 underline underline-offset-2",
|
|
5685
|
-
onClick: r[6] || (r[6] =
|
|
5686
|
-
},
|
|
5687
|
-
], 10,
|
|
5997
|
+
onClick: r[6] || (r[6] = K(() => {}, ["stop"]))
|
|
5998
|
+
}, G(_e.value.actionLabel), 9, ao)) : b("", !0)
|
|
5999
|
+
], 10, to)) : b("", !0)
|
|
5688
6000
|
], 2)]),
|
|
5689
6001
|
_: 3
|
|
5690
6002
|
}, 8, [
|
|
@@ -5692,42 +6004,42 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5692
6004
|
"aria-hidden",
|
|
5693
6005
|
"class"
|
|
5694
6006
|
]),
|
|
5695
|
-
|
|
6007
|
+
w("div", {
|
|
5696
6008
|
"data-test": "messaging-composer-footer",
|
|
5697
|
-
inert:
|
|
5698
|
-
"aria-hidden":
|
|
5699
|
-
class:
|
|
5700
|
-
|
|
5701
|
-
e.centered &&
|
|
5702
|
-
|
|
6009
|
+
inert: at.value,
|
|
6010
|
+
"aria-hidden": at.value ? "true" : void 0,
|
|
6011
|
+
class: j(["left-0 right-0 z-30 px-3 @lg/chat:px-8 pb-[max(env(safe-area-inset-bottom),1rem)]", [
|
|
6012
|
+
M.value.length === 0 || e.centered ? "relative shrink-0" : "absolute bottom-0",
|
|
6013
|
+
e.centered && M.value.length > 0 ? "pt-0 sm:pb-7" : "pt-3",
|
|
6014
|
+
Q.value ? e.centered ? "bg-transparent" : "bg-theme-0" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"
|
|
5703
6015
|
]])
|
|
5704
|
-
}, [ce(t.$slots, "composer", {}, () => [
|
|
6016
|
+
}, [ce(t.$slots, "composer", {}, () => [De.value ? (R(), x("div", {
|
|
5705
6017
|
key: 0,
|
|
5706
6018
|
"data-test": "messaging-seat",
|
|
5707
|
-
"data-seat-state":
|
|
6019
|
+
"data-seat-state": Ee.value,
|
|
5708
6020
|
role: "status",
|
|
5709
6021
|
"aria-live": "polite",
|
|
5710
|
-
class:
|
|
5711
|
-
},
|
|
5712
|
-
|
|
6022
|
+
class: j(["py-3 text-center text-[14px]", Q.value ? "text-theme-500" : "text-white/70"])
|
|
6023
|
+
}, G(De.value), 11, so)) : (R(), x(m, { key: 1 }, [
|
|
6024
|
+
je.value.length > 0 ? (R(), x("div", {
|
|
5713
6025
|
key: 0,
|
|
5714
|
-
class:
|
|
5715
|
-
}, [(
|
|
6026
|
+
class: j(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[640px] @5xl/chat:max-w-[720px] mx-auto" : ""])
|
|
6027
|
+
}, [(R(!0), x(m, null, V(je.value, (e, t) => (R(), x("div", {
|
|
5716
6028
|
key: t,
|
|
5717
6029
|
class: "relative shrink-0 group"
|
|
5718
|
-
}, [e.type === "image" ? (
|
|
6030
|
+
}, [e.type === "image" ? (R(), x("img", {
|
|
5719
6031
|
key: 0,
|
|
5720
6032
|
src: e.src,
|
|
5721
6033
|
alt: e.filename,
|
|
5722
|
-
class:
|
|
5723
|
-
}, null, 10,
|
|
6034
|
+
class: j(["size-14 rounded-xl object-cover border", Q.value ? "border-black/10" : "border-white/20"])
|
|
6035
|
+
}, null, 10, co)) : (R(), x("div", {
|
|
5724
6036
|
key: 1,
|
|
5725
|
-
class:
|
|
5726
|
-
}, [r[
|
|
6037
|
+
class: j(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", Q.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
6038
|
+
}, [r[27] || (r[27] = w("i", { class: "i-tabler-file size-4" }, null, -1)), w("span", lo, G(e.filename), 1)], 2)), w("button", {
|
|
5727
6039
|
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 duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] cursor-pointer",
|
|
5728
6040
|
onClick: (e) => removeAttachment(t)
|
|
5729
|
-
}, [...r[
|
|
5730
|
-
|
|
6041
|
+
}, [...r[28] || (r[28] = [w("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, uo)]))), 128)), Me.value ? (R(), x("div", fo, [E(Y, { class: "size-5" })])) : b("", !0)], 2)) : b("", !0),
|
|
6042
|
+
Fe.value ? (R(), x("input", {
|
|
5731
6043
|
key: 1,
|
|
5732
6044
|
ref_key: "fileInput",
|
|
5733
6045
|
ref: o,
|
|
@@ -5735,25 +6047,25 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5735
6047
|
accept: "image/*,audio/*,video/*",
|
|
5736
6048
|
class: "hidden",
|
|
5737
6049
|
onChange: handleFileSelect
|
|
5738
|
-
}, null, 544)) :
|
|
5739
|
-
|
|
6050
|
+
}, null, 544)) : b("", !0),
|
|
6051
|
+
w("div", {
|
|
5740
6052
|
"data-test": "messaging-composer",
|
|
5741
|
-
"data-composer-action":
|
|
5742
|
-
class:
|
|
6053
|
+
"data-composer-action": Le.value,
|
|
6054
|
+
class: j(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-4 transition-colors duration-200", [e.centered ? "mx-auto max-w-[640px] @5xl/chat:max-w-[740px] @5xl/chat:px-5 @5xl/chat:pt-3.5 @5xl/chat:pb-3" : "", Q.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.04),0_12px_32px_rgba(15,23,42,0.07)] ring-1 ring-theme-950/20 hover:ring-theme-950/30 focus-within:ring-theme-950/30" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25 focus-within:bg-white/15 focus-within:ring-white/25"]]),
|
|
5743
6055
|
onClick: focusComposer
|
|
5744
|
-
}, [
|
|
6056
|
+
}, [$e.value ? (R(), x("div", {
|
|
5745
6057
|
key: 1,
|
|
5746
6058
|
"data-test": "messaging-recording-state",
|
|
5747
|
-
class:
|
|
6059
|
+
class: j(["flex min-w-0 items-center gap-2 py-1", Q.value ? "text-theme-700" : "text-white/80"])
|
|
5748
6060
|
}, [
|
|
5749
|
-
r[
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
], 2)) : he((
|
|
6061
|
+
r[29] || (r[29] = w("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
6062
|
+
w("span", ho, G(nt.value), 1),
|
|
6063
|
+
w("span", { class: j(["min-w-0 truncate text-sm", Q.value ? "text-theme-400" : "text-white/45"]) }, G(rt.value), 3)
|
|
6064
|
+
], 2)) : he((R(), x("textarea", {
|
|
5753
6065
|
key: 0,
|
|
5754
6066
|
ref_key: "textarea",
|
|
5755
6067
|
ref: a,
|
|
5756
|
-
"onUpdate:modelValue": r[7] || (r[7] = (e) =>
|
|
6068
|
+
"onUpdate:modelValue": r[7] || (r[7] = (e) => Ae.value = e),
|
|
5757
6069
|
"data-test": "messaging-input",
|
|
5758
6070
|
rows: "1",
|
|
5759
6071
|
enterkeyhint: "send",
|
|
@@ -5762,104 +6074,115 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5762
6074
|
autocapitalize: "sentences",
|
|
5763
6075
|
autocorrect: "on",
|
|
5764
6076
|
spellcheck: "true",
|
|
5765
|
-
placeholder:
|
|
5766
|
-
disabled:
|
|
6077
|
+
placeholder: Ce.value,
|
|
6078
|
+
disabled: Se.value,
|
|
5767
6079
|
style: {
|
|
5768
6080
|
fontSize: "16px",
|
|
5769
6081
|
resize: "none"
|
|
5770
6082
|
},
|
|
5771
|
-
class:
|
|
6083
|
+
class: j(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", Q.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
5772
6084
|
onKeydown: handleKeydown
|
|
5773
|
-
}, null, 42,
|
|
5774
|
-
|
|
5775
|
-
class:
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
6085
|
+
}, null, 42, mo)), [[fe, Ae.value]]), w("div", go, [
|
|
6086
|
+
w("button", {
|
|
6087
|
+
class: j(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", [
|
|
6088
|
+
Fe.value ? "cursor-pointer" : "cursor-default",
|
|
6089
|
+
Q.value ? "text-theme-500" : "text-white/50",
|
|
6090
|
+
Me.value || Pe.value ? "opacity-50 pointer-events-none" : ""
|
|
5779
6091
|
]]),
|
|
5780
|
-
disabled:
|
|
5781
|
-
"aria-label":
|
|
5782
|
-
title:
|
|
5783
|
-
onClick: r[8] || (r[8] = (e) =>
|
|
5784
|
-
}, [
|
|
5785
|
-
r[
|
|
5786
|
-
|
|
5787
|
-
|
|
6092
|
+
disabled: Se.value || Me.value || Pe.value || !Fe.value,
|
|
6093
|
+
"aria-label": Fe.value ? "Attach file" : "File attachments unavailable",
|
|
6094
|
+
title: Fe.value ? "Attach file" : "File attachments unavailable",
|
|
6095
|
+
onClick: r[8] || (r[8] = (e) => Fe.value && triggerFileInput())
|
|
6096
|
+
}, [Me.value ? (R(), x("i", vo)) : (R(), x("i", yo)), w("span", bo, G(Fe.value ? "Attach file" : "File attachments unavailable"), 1)], 10, _o),
|
|
6097
|
+
r[33] || (r[33] = w("div", { class: "flex-1" }, null, -1)),
|
|
6098
|
+
w("div", xo, [
|
|
6099
|
+
$e.value && !et.value && !at.value ? (R(), x("button", {
|
|
5788
6100
|
key: 0,
|
|
5789
6101
|
"data-test": "messaging-record-discard-btn",
|
|
5790
|
-
class:
|
|
6102
|
+
class: j(["flex size-8 cursor-pointer items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", Q.value ? "text-theme-400" : "text-white/40"]),
|
|
5791
6103
|
"aria-label": "Discard recording",
|
|
5792
6104
|
title: "Discard recording",
|
|
5793
6105
|
onClick: r[9] || (r[9] = (e) => finishRecording({ cancelled: !0 }))
|
|
5794
|
-
}, [...r[
|
|
6106
|
+
}, [...r[30] || (r[30] = [w("i", {
|
|
5795
6107
|
class: "i-tabler-x size-[18px]",
|
|
5796
6108
|
"aria-hidden": "true"
|
|
5797
|
-
}, null, -1)])], 2)) :
|
|
5798
|
-
(
|
|
6109
|
+
}, null, -1)])], 2)) : b("", !0),
|
|
6110
|
+
(Qe.value || $e.value) && !et.value && !at.value ? (R(), x("button", {
|
|
5799
6111
|
key: 1,
|
|
5800
6112
|
"data-test": "messaging-record-audio-btn",
|
|
5801
|
-
class:
|
|
5802
|
-
"aria-label":
|
|
5803
|
-
title:
|
|
5804
|
-
onPointerdown:
|
|
5805
|
-
onPointerup:
|
|
5806
|
-
onPointercancel:
|
|
6113
|
+
class: j(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] hover:opacity-70 pointer-coarse:size-11", $e.value ? Q.value ? "text-theme-900 scale-110" : "text-white scale-110" : Q.value ? "text-theme-500" : "text-white/60"]),
|
|
6114
|
+
"aria-label": it.value,
|
|
6115
|
+
title: it.value,
|
|
6116
|
+
onPointerdown: K(onRecordPointerDown, ["prevent"]),
|
|
6117
|
+
onPointerup: K(onRecordPointerUp, ["prevent"]),
|
|
6118
|
+
onPointercancel: K(onRecordPointerCancel, ["prevent"]),
|
|
5807
6119
|
onClick: onRecordClick,
|
|
5808
|
-
onKeydown: r[10] || (r[10] = ge(
|
|
5809
|
-
}, [
|
|
5810
|
-
|
|
6120
|
+
onKeydown: r[10] || (r[10] = ge(K((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
6121
|
+
}, [w("i", { class: j([$e.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), w("span", Co, G(it.value), 1)], 42, So)) : b("", !0),
|
|
6122
|
+
lt.value ? (R(), x("button", {
|
|
5811
6123
|
key: 2,
|
|
5812
6124
|
"data-test": "messaging-voice-start-btn",
|
|
5813
|
-
class:
|
|
5814
|
-
disabled:
|
|
5815
|
-
"aria-label":
|
|
5816
|
-
title:
|
|
6125
|
+
class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [Q.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100", ut.value ? "cursor-not-allowed opacity-40" : "cursor-pointer"]]),
|
|
6126
|
+
disabled: ut.value,
|
|
6127
|
+
"aria-label": dt.value,
|
|
6128
|
+
title: dt.value,
|
|
5817
6129
|
onClick: r[11] || (r[11] = (e) => startVoiceConversation())
|
|
5818
|
-
}, [
|
|
6130
|
+
}, [w("span", To, [(R(), x(m, null, V([
|
|
5819
6131
|
7,
|
|
5820
6132
|
13,
|
|
5821
6133
|
16,
|
|
5822
6134
|
11,
|
|
5823
6135
|
14
|
|
5824
|
-
], (e) =>
|
|
6136
|
+
], (e) => w("span", {
|
|
5825
6137
|
key: e,
|
|
5826
6138
|
class: "w-[2px] rounded-full bg-current",
|
|
5827
|
-
style:
|
|
5828
|
-
}, null, 4)), 64))]), r[
|
|
6139
|
+
style: N({ height: `${e}px` })
|
|
6140
|
+
}, null, 4)), 64))]), r[31] || (r[31] = w("span", { class: "sr-only" }, "Start voice conversation", -1))], 10, wo)) : $e.value ? b("", !0) : (R(), x(m, { key: 3 }, [Be.value ? (R(), x("button", {
|
|
5829
6141
|
key: 0,
|
|
5830
6142
|
"data-test": "messaging-secondary-stop-btn",
|
|
5831
|
-
class:
|
|
6143
|
+
class: j(["mr-2 flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Q.value ? "bg-theme-100 text-theme-700 hover:bg-theme-200" : "bg-white/10 text-white/70 hover:bg-white/15"]),
|
|
5832
6144
|
"aria-label": "Stop work",
|
|
5833
6145
|
title: "Stop work",
|
|
5834
6146
|
onClick: r[12] || (r[12] = (t) => e.chatController?.stopChatTurn())
|
|
5835
|
-
}, [...r[
|
|
6147
|
+
}, [...r[32] || (r[32] = [w("i", {
|
|
5836
6148
|
class: "i-tabler-player-stop-filled size-3.5",
|
|
5837
6149
|
"aria-hidden": "true"
|
|
5838
|
-
}, null, -1),
|
|
6150
|
+
}, null, -1), w("span", { class: "sr-only" }, "Stop work", -1)])], 2)) : b("", !0), w("button", {
|
|
5839
6151
|
"data-test": "messaging-send-btn",
|
|
5840
|
-
"data-composer-action":
|
|
5841
|
-
class:
|
|
5842
|
-
disabled: !
|
|
5843
|
-
"aria-label":
|
|
5844
|
-
title:
|
|
6152
|
+
"data-composer-action": Le.value,
|
|
6153
|
+
class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", ze.value ? Q.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800 cursor-pointer" : "bg-theme-0 text-theme-950 hover:bg-theme-100 cursor-pointer" : Q.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
|
|
6154
|
+
disabled: !ze.value,
|
|
6155
|
+
"aria-label": Ze.value,
|
|
6156
|
+
title: Ze.value,
|
|
5845
6157
|
onClick: r[13] || (r[13] = (e) => handleComposerAction())
|
|
5846
|
-
}, [
|
|
6158
|
+
}, [Le.value === "stop" ? (R(), x("i", Do)) : (R(), x("i", Oo)), w("span", ko, G(Ze.value), 1)], 10, Eo)], 64))
|
|
5847
6159
|
])
|
|
5848
|
-
])], 10,
|
|
5849
|
-
e.centered &&
|
|
5850
|
-
], 64))], !0)], 10,
|
|
6160
|
+
])], 10, po),
|
|
6161
|
+
e.centered && M.value.length > 0 ? (R(), x("p", Ao, G(e.bot.displayName.value) + " is AI and can make mistakes. ", 1)) : b("", !0)
|
|
6162
|
+
], 64))], !0)], 10, oo),
|
|
6163
|
+
Je.value ? (R(), y(Ki, {
|
|
6164
|
+
key: 4,
|
|
6165
|
+
message: Ye.value,
|
|
6166
|
+
prompt: Xe.value,
|
|
6167
|
+
share: Je.value,
|
|
6168
|
+
onClose: r[14] || (r[14] = (e) => Ye.value = void 0)
|
|
6169
|
+
}, null, 8, [
|
|
6170
|
+
"message",
|
|
6171
|
+
"prompt",
|
|
6172
|
+
"share"
|
|
6173
|
+
])) : b("", !0)
|
|
5851
6174
|
], 2));
|
|
5852
6175
|
}
|
|
5853
|
-
}), [["__scopeId", "data-v-
|
|
6176
|
+
}), [["__scopeId", "data-v-89d3bf69"]]), Mo = { class: "bot-wrap" }, No = {
|
|
5854
6177
|
key: 0,
|
|
5855
6178
|
class: "flex items-center justify-center h-full"
|
|
5856
|
-
},
|
|
6179
|
+
}, Po = {
|
|
5857
6180
|
key: 2,
|
|
5858
6181
|
class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
|
|
5859
6182
|
role: "status",
|
|
5860
6183
|
"aria-live": "polite",
|
|
5861
6184
|
"data-test": "bot-unavailable"
|
|
5862
|
-
},
|
|
6185
|
+
}, Fo = /* @__PURE__ */ D({
|
|
5863
6186
|
__name: "BotWrap",
|
|
5864
6187
|
props: {
|
|
5865
6188
|
sdk: {},
|
|
@@ -5879,7 +6202,7 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5879
6202
|
let t = o("BotWrap"), r = e, i = r.sdk || n.getInstance({
|
|
5880
6203
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
5881
6204
|
...r.apiBase && { apiBase: r.apiBase }
|
|
5882
|
-
}), a =
|
|
6205
|
+
}), a = U(!r.bot), s = U(r.bot), c = U();
|
|
5883
6206
|
async function loadBot() {
|
|
5884
6207
|
if (r.bot) {
|
|
5885
6208
|
t.debug("Bot provided via props, skipping fetch", {
|
|
@@ -5955,23 +6278,23 @@ var Bi = ["data-voice-state", "data-voice-activity"], Vi = ["src"], Hi = {
|
|
|
5955
6278
|
});
|
|
5956
6279
|
}
|
|
5957
6280
|
}
|
|
5958
|
-
return ne(loadBot), (t, n) => (
|
|
5959
|
-
sdk:
|
|
6281
|
+
return ne(loadBot), (t, n) => (R(), x("div", Mo, [a.value ? (R(), x("div", No, [w("div", { class: j(["size-6 animate-spin rounded-full border-b-2", r.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : s.value ? ce(t.$slots, "default", {
|
|
6282
|
+
sdk: le(i),
|
|
5960
6283
|
bot: s.value,
|
|
5961
6284
|
context: e.clientContext ?? e.context,
|
|
5962
6285
|
firstMessage: e.firstMessage,
|
|
5963
6286
|
buttonText: e.buttonText,
|
|
5964
6287
|
buttonIcon: e.buttonIcon,
|
|
5965
6288
|
loading: a.value
|
|
5966
|
-
}, void 0, void 0, 1) : c.value ? (
|
|
6289
|
+
}, void 0, void 0, 1) : c.value ? (R(), x("div", Po, [n[0] || (n[0] = w("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), w("button", {
|
|
5967
6290
|
type: "button",
|
|
5968
6291
|
class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
|
|
5969
6292
|
"data-test": "bot-unavailable-retry",
|
|
5970
6293
|
onClick: loadBot
|
|
5971
|
-
}, " Try again ")])) :
|
|
6294
|
+
}, " Try again ")])) : b("", !0)]));
|
|
5972
6295
|
}
|
|
5973
6296
|
});
|
|
5974
6297
|
//#endregion
|
|
5975
|
-
export {
|
|
6298
|
+
export { Ci as a, Me as c, handleImageError as d, parseButtonTemplate as f, _e as h, Ni as i, Ae as l, Y as m, jo as n, Ve as o, BotChatController as p, ba as r, Pe as s, Fo as t, getBotAvatarUrl as u };
|
|
5976
6299
|
|
|
5977
6300
|
//# sourceMappingURL=BotWrap.js.map
|