@pagelines/sdk 1.0.821 → 1.0.823

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/AgentWrap.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { n as e } from "./rolldown-runtime.js";
2
- import { s as t, t as n } from "./sdkClient.js";
3
- import { Agent as r, CHAT_ISSUE_COPY as i, CUSTOMER_AGENT_STATE_LABEL as a, SettingsObject as o, createLogger as s, customerAgentState as c, getDefaultAvatarUrl as u, isAssistantSilenceControl as f, parseChatCardFencePayload as p, parseChatVisualFencePayload as m } from "@pagelines/core";
4
- import { Fragment as h, Transition as _, computed as v, createBlock as te, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as T, defineComponent as k, nextTick as A, normalizeClass as j, normalizeStyle as M, onBeforeUnmount as ne, onMounted as re, onUnmounted as ie, openBlock as P, ref as F, renderList as I, renderSlot as ae, resolveDynamicComponent as R, shallowRef as B, toDisplayString as H, unref as oe, useTemplateRef as se, vModelText as ce, watch as ue, withCtx as U, withDirectives as de, withKeys as pe, withModifiers as W } from "vue";
2
+ import { c as t, s as n, t as r } from "./sdkClient.js";
3
+ import { Agent as i, CHAT_ISSUE_COPY as a, CUSTOMER_AGENT_STATE_LABEL as o, SettingsObject as s, createLogger as c, customerAgentState as u, getDefaultAvatarUrl as f, isAssistantSilenceControl as p, parseChatCardFencePayload as m, parseChatVisualFencePayload as te, readChatEventStream as h, zVoiceSessionMint as _ } from "@pagelines/core";
4
+ import { Fragment as v, Transition as ne, computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as T, createTextVNode as k, createVNode as A, defineComponent as j, nextTick as re, normalizeClass as M, normalizeStyle as P, onBeforeUnmount as ie, onMounted as ae, onUnmounted as oe, openBlock as F, ref as I, renderList as R, renderSlot as B, resolveDynamicComponent as se, shallowRef as ce, toDisplayString as H, unref as ue, useTemplateRef as U, vModelText as de, watch as pe, withCtx as he, withDirectives as _e, withKeys as W, withModifiers as G } from "vue";
5
5
  //#region ui/FSpinner.vue?vue&type=script&setup=true&lang.ts
6
- var he = { class: "spinner max-w-sm" }, G = {
6
+ var K = { class: "spinner max-w-sm" }, ve = {
7
7
  class: "ring-circular h-full w-full origin-center",
8
8
  viewBox: "25 25 50 50"
9
- }, _e = /* @__PURE__ */ k({
9
+ }, q = /* @__PURE__ */ j({
10
10
  __name: "FSpinner",
11
11
  props: {
12
12
  width: {
@@ -19,8 +19,8 @@ var he = { class: "spinner max-w-sm" }, G = {
19
19
  }
20
20
  },
21
21
  setup(e) {
22
- return (t, n) => (P(), x("div", he, [(P(), x("svg", G, [S("circle", {
23
- class: j([e.colorMode, "ring-path"]),
22
+ return (t, n) => (F(), C("div", K, [(F(), C("svg", ve, [T("circle", {
23
+ class: M([e.colorMode, "ring-path"]),
24
24
  cx: "50",
25
25
  cy: "50",
26
26
  r: "20",
@@ -30,7 +30,7 @@ var he = { class: "spinner max-w-sm" }, G = {
30
30
  "stroke-miterlimit": "30"
31
31
  }, null, 2)]))]));
32
32
  }
33
- }), K = [
33
+ }), ye = [
34
34
  {
35
35
  mode: "self",
36
36
  label: "Overview",
@@ -68,12 +68,12 @@ function recorderMimeType() {
68
68
  "audio/webm"
69
69
  ].find((e) => MediaRecorder.isTypeSupported?.(e)) || "";
70
70
  }
71
- var VoiceRecorderController = class extends o {
71
+ var VoiceRecorderController = class extends s {
72
72
  constructor(e) {
73
- super("VoiceRecorderController", e), t(this, "state", F({
73
+ super("VoiceRecorderController", e), n(this, "state", I({
74
74
  phase: "idle",
75
75
  elapsedMs: 0
76
- })), 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);
76
+ })), n(this, "isActive", b(() => this.state.value.phase !== "idle")), n(this, "isBusy", b(() => this.state.value.phase !== "idle")), n(this, "elapsedLabel", b(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), n(this, "statusText", b(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), n(this, "recorder", void 0), n(this, "stream", void 0), n(this, "chunks", []), n(this, "timer", void 0), n(this, "startedAt", 0), n(this, "cancelOnStop", !1), n(this, "stopAfterStart", !1), n(this, "startToken", 0);
77
77
  }
78
78
  get canUseBrowserRecording() {
79
79
  return !!this.settings.getUserMedia || typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof MediaRecorder < "u";
@@ -185,7 +185,7 @@ var VoiceRecorderController = class extends o {
185
185
  function durableJournalOutcome(e) {
186
186
  return e.turnOutcome === "failed" ? "failed" : e.turnOutcome === "stopped" ? "stopped" : e.sender === "system" ? "failed" : "completed";
187
187
  }
188
- var ve = {
188
+ var be = {
189
189
  waiting: "Waiting for results",
190
190
  finishing: "Finishing up",
191
191
  completed: "Work complete",
@@ -193,7 +193,7 @@ var ve = {
193
193
  stopped: "Stopped",
194
194
  notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
195
195
  leaveHint: "Taking longer than usual. You can leave this chat while I work."
196
- }, q = 15e3, ye = 6e4, be = 3;
196
+ }, Se = 15e3, Ce = 6e4, we = 3;
197
197
  function toMs(e) {
198
198
  if (!e) return;
199
199
  let t = Date.parse(e);
@@ -209,7 +209,7 @@ function milestoneRows(e, t) {
209
209
  let n = e.filter((e) => e.status === "completed" || e.status === "failed" && !!e.note).filter((e) => !t.has(e.activityId)).slice().sort(byEvent), r = [];
210
210
  for (let e of n) {
211
211
  let t = e.status === "completed" ? "done" : "failed", n = r[r.length - 1];
212
- if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= q) {
212
+ if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= Se) {
213
213
  n.count += 1, n.lastMs = eventMs(e);
214
214
  continue;
215
215
  }
@@ -230,12 +230,12 @@ function milestoneRows(e, t) {
230
230
  }));
231
231
  }
232
232
  function splitRows(e) {
233
- return e.length <= be ? {
233
+ return e.length <= we ? {
234
234
  visibleRows: e,
235
235
  hiddenRows: []
236
236
  } : {
237
- visibleRows: e.slice(e.length - be),
238
- hiddenRows: e.slice(0, e.length - be)
237
+ visibleRows: e.slice(e.length - we),
238
+ hiddenRows: e.slice(0, e.length - we)
239
239
  };
240
240
  }
241
241
  function buildWorkJournalModel(e) {
@@ -247,7 +247,7 @@ function buildWorkJournalModel(e) {
247
247
  terminal: {
248
248
  id: "work-complete",
249
249
  tone: "completed",
250
- label: ve.completed
250
+ label: be.completed
251
251
  }
252
252
  };
253
253
  if (n === "failed") {
@@ -261,7 +261,7 @@ function buildWorkJournalModel(e) {
261
261
  terminal: {
262
262
  id: "work-failed",
263
263
  tone: "failed",
264
- label: ve.failed,
264
+ label: be.failed,
265
265
  ...o && e?.note ? { note: e.note } : {}
266
266
  }
267
267
  };
@@ -275,25 +275,25 @@ function buildWorkJournalModel(e) {
275
275
  terminal: {
276
276
  id: "work-stopped",
277
277
  tone: "stopped",
278
- label: ve.stopped
278
+ label: be.stopped
279
279
  }
280
280
  };
281
281
  }
282
282
  let { visibleRows: s, hiddenRows: c } = splitRows(milestoneRows(t, /* @__PURE__ */ new Set())), u = 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) => {
283
283
  let n = toMs(t.startedAt) ?? toMs(t.endedAt);
284
284
  return n === void 0 ? e : Math.min(e, n);
285
- }, Infinity), h = p + q, _ = (Number.isFinite(m) ? m : p) + ye, v = r >= h, te = u || v ? {
285
+ }, Infinity), te = p + Se, h = (Number.isFinite(m) ? m : p) + Ce, _ = r >= te, v = u || _ ? {
286
286
  id: u?.activityId ?? "work-active",
287
287
  tone: "active",
288
- label: v ? u ? ve.waiting : ve.finishing : u.label
289
- } : void 0, b = v && r >= _ ? i ? ve.notifyHint : ve.leaveHint : void 0, x = [h, _].filter((e) => e > r).sort((e, t) => e - t)[0];
288
+ label: _ ? u ? be.waiting : be.finishing : u.label
289
+ } : void 0, ne = _ && r >= h ? i ? be.notifyHint : be.leaveHint : void 0, b = [te, h].filter((e) => e > r).sort((e, t) => e - t)[0];
290
290
  return {
291
291
  outcome: n,
292
292
  visibleRows: s,
293
293
  hiddenRows: c,
294
- ...te ? { terminal: te } : {},
295
- ...b ? { hint: b } : {},
296
- ...x === void 0 ? {} : { nextBoundaryAtMs: x }
294
+ ...v ? { terminal: v } : {},
295
+ ...ne ? { hint: ne } : {},
296
+ ...b === void 0 ? {} : { nextBoundaryAtMs: b }
297
297
  };
298
298
  }
299
299
  function buildLiveTurnBlocks(e) {
@@ -352,17 +352,17 @@ function buildLiveTurnBlocks(e) {
352
352
  }
353
353
  //#endregion
354
354
  //#region agent/AgentController.ts
355
- var Se = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Ce = /* @__PURE__ */ new Set([
356
- ...Se,
355
+ var Te = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Ee = /* @__PURE__ */ new Set([
356
+ ...Te,
357
357
  "EMPTY_STREAM",
358
358
  "RATE_LIMIT"
359
- ]), we = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), Te = {
359
+ ]), De = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), Oe = {
360
360
  CREDIT_LIMIT: "billing_budget_reached",
361
361
  OVERAGE_CAP: "billing_runaway_cap"
362
362
  };
363
363
  function presentChatStreamError(e) {
364
- if (!(e.bucket !== void 0 || Ce.has(e.code))) return { surface: "hard" };
365
- let t = e.bucket ?? (Se.has(e.code) ? "account" : "error"), n = {
364
+ if (!(e.bucket !== void 0 || Ee.has(e.code))) return { surface: "hard" };
365
+ let t = e.bucket ?? (Te.has(e.code) ? "account" : "error"), n = {
366
366
  ...e.actionLabel ? { actionLabel: e.actionLabel } : {},
367
367
  ...e.actionUrl ? { actionUrl: e.actionUrl } : {},
368
368
  ...e.help ? { help: e.help } : {}
@@ -375,7 +375,7 @@ function presentChatStreamError(e) {
375
375
  ...n
376
376
  },
377
377
  sendBlockedReason: "account"
378
- } : we.has(e.code) ? {
378
+ } : De.has(e.code) ? {
379
379
  surface: "transcript",
380
380
  issue: {
381
381
  code: e.code,
@@ -393,10 +393,10 @@ function presentChatStreamError(e) {
393
393
  };
394
394
  }
395
395
  function transcriptMessageForChatStreamError(e) {
396
- let t = Te[e.code];
397
- return t ? i[t].oneLine : e.error;
396
+ let t = Oe[e.code];
397
+ return t ? a[t].oneLine : e.error;
398
398
  }
399
- var AgentChatController = class extends o {
399
+ var AgentChatController = class extends s {
400
400
  isQueuedMessage(e) {
401
401
  return this.queuedMessageIdSet.value.has(e);
402
402
  }
@@ -421,19 +421,19 @@ var AgentChatController = class extends o {
421
421
  await this.settings.refreshMessagesFn?.();
422
422
  }
423
423
  constructor(e) {
424
- super("AgentChatController", e), t(this, "isTextMode", !1), t(this, "lastMessage", {
424
+ super("AgentChatController", e), n(this, "isTextMode", !1), n(this, "lastMessage", {
425
425
  hash: "",
426
426
  time: 0
427
- }), 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", F(/* @__PURE__ */ new Set())), t(this, "queuedMessageIds", v(() => this.queuedMessageIdSet.value)), t(this, "boundaryTimer", void 0), t(this, "nowMs", B(Date.now())), t(this, "toolActivityTiming", B({})), t(this, "lastVisibleProgressAtMs", B()), t(this, "liveSegments", B([])), t(this, "liveStreamMessageId", B(void 0)), t(this, "conversationId", void 0), t(this, "textState", F({
427
+ }), n(this, "isConnecting", !1), n(this, "turnEpoch", 0), n(this, "nextStreamToken", 0), n(this, "runningStreamToken", void 0), n(this, "suppressedStreamTokens", /* @__PURE__ */ new Set()), n(this, "queuedMessageIdSet", I(/* @__PURE__ */ new Set())), n(this, "queuedMessageIds", b(() => this.queuedMessageIdSet.value)), n(this, "boundaryTimer", void 0), n(this, "nowMs", ce(Date.now())), n(this, "toolActivityTiming", ce({})), n(this, "lastVisibleProgressAtMs", ce()), n(this, "liveSegments", ce([])), n(this, "liveStreamMessageId", ce(void 0)), n(this, "conversationId", void 0), n(this, "textState", I({
428
428
  isActive: !1,
429
429
  isConnected: !1,
430
430
  isThinking: !1,
431
431
  connectionStatus: "disconnected"
432
- })), t(this, "agentMode", F("self")), t(this, "sharedMessages", F([])), t(this, "composerState", F({
432
+ })), n(this, "agentMode", I("self")), n(this, "sharedMessages", I([])), n(this, "composerState", I({
433
433
  text: "",
434
434
  pendingAttachments: [],
435
435
  isUploading: !1
436
- })), t(this, "workJournal", v(() => {
436
+ })), n(this, "workJournal", b(() => {
437
437
  let e = this.textState.value.isThinking ? "running" : this.textState.value.turnOutcome;
438
438
  if (!e) return;
439
439
  let t = this.textState.value.toolActivities;
@@ -444,7 +444,7 @@ var AgentChatController = class extends o {
444
444
  canNotifyOnCompletion: !1,
445
445
  lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
446
446
  });
447
- })), t(this, "liveTurnBlocks", v(() => {
447
+ })), n(this, "liveTurnBlocks", b(() => {
448
448
  if (!this.textState.value.isThinking) return [];
449
449
  let e = this.textState.value.toolActivities ?? [], t = this.liveSegments.value;
450
450
  return !t.length && !e.length ? [] : buildLiveTurnBlocks({
@@ -454,17 +454,17 @@ var AgentChatController = class extends o {
454
454
  canNotifyOnCompletion: !1,
455
455
  lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
456
456
  });
457
- })), t(this, "canUseComposer", v(() => this.textState.value.sendBlockedReason !== "agent_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({
457
+ })), n(this, "canUseComposer", b(() => this.textState.value.sendBlockedReason !== "agent_deleted" && !this.composerState.value.isUploading)), n(this, "canAttachFile", b(() => !!this.settings.uploadFileFn)), n(this, "canRecordAudio", b(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), n(this, "voiceRecorder", new VoiceRecorderController({
458
458
  getCanRecord: () => this.canRecordAudio.value,
459
459
  getUploadFn: () => {
460
460
  let e = this.settings.uploadFileFn;
461
461
  return e ? (t) => e({ file: t }) : void 0;
462
462
  },
463
463
  getChatController: () => this
464
- })), 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(() => {
464
+ })), n(this, "canSend", b(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), n(this, "canStop", b(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), n(this, "composerAction", b(() => this.canSend.value ? "send" : this.canStop.value ? "stop" : "idle")), n(this, "composerShowsSecondaryStop", b(() => this.canStop.value && this.composerAction.value === "send")), n(this, "canStartVoice", b(() => {
465
465
  let e = this.settings.sdk;
466
466
  return this.textState.value.sendBlockedReason !== "agent_deleted" && !!e?.activeUser.value && !!this._agent.agentId.value && !!this._agent.orgId.value && !!this.settings.createVoiceClientFn && voiceBrowserSupported();
467
- })), t(this, "_agent", void 0), t(this, "localMessageSeq", 0), this._agent = e.agent instanceof r ? e.agent : new r({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
467
+ })), n(this, "_agent", void 0), n(this, "localMessageSeq", 0), this._agent = e.agent instanceof i ? e.agent : new i({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
468
468
  }
469
469
  get chatEnabled() {
470
470
  let e = this._agent.state.value.lifecycle;
@@ -613,7 +613,7 @@ Current User:
613
613
  });
614
614
  }
615
615
  setupBoundaryWatcher() {
616
- ue(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
616
+ pe(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
617
617
  this.scheduleBoundary(e);
618
618
  });
619
619
  }
@@ -675,12 +675,12 @@ Current User:
675
675
  });
676
676
  }
677
677
  setupModeWatcher() {
678
- ue(this.agentMode, async (e, t) => {
678
+ pe(this.agentMode, async (e, t) => {
679
679
  this.logger.info(`Mode changed from ${t} to ${e}`), this.isTextMode && (t === "talk" || t === "chat") && await this.endConversation();
680
680
  });
681
681
  }
682
682
  setupAvailabilityWatcher() {
683
- ue(() => [this.chatEnabled, this._agent.state.value.lifecycle], ([e]) => {
683
+ pe(() => [this.chatEnabled, this._agent.state.value.lifecycle], ([e]) => {
684
684
  if (!(!this.isTextMode || this.isConnecting)) {
685
685
  if (e) {
686
686
  this.textState.value.isConnected || this.updateState(this.textState, {
@@ -772,7 +772,7 @@ Current User:
772
772
  transientIssue: void 0,
773
773
  turnOutcome: void 0
774
774
  }));
775
- let u = `stream-${Date.now()}-${c}`, p = !1, m = !1, isCurrentTurn = () => s === this.turnEpoch && !this.suppressedStreamTokens.has(c), claimLiveTurn = () => {
775
+ let u = `stream-${Date.now()}-${c}`, f = !1, m = !1, isCurrentTurn = () => s === this.turnEpoch && !this.suppressedStreamTokens.has(c), claimLiveTurn = () => {
776
776
  this.runningStreamToken !== c && (this.runningStreamToken = c, this.consumeQueuedThrough(o), this.resetWorkJournalTiming(), this.updateState(this.textState, {
777
777
  isThinking: !0,
778
778
  workingDescription: void 0,
@@ -782,7 +782,7 @@ Current User:
782
782
  }));
783
783
  }, onDelta = (e, t = "assistant") => {
784
784
  if (!isCurrentTurn()) return;
785
- claimLiveTurn(), this.updateState(this.textState, { workingDescription: void 0 }), t === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), p || (p = !0, this.liveStreamMessageId.value = u, this.sharedMessages.value = [...this.sharedMessages.value, {
785
+ claimLiveTurn(), this.updateState(this.textState, { workingDescription: void 0 }), t === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), f || (f = !0, this.liveStreamMessageId.value = u, this.sharedMessages.value = [...this.sharedMessages.value, {
786
786
  id: u,
787
787
  text: "",
788
788
  sender: t === "system" ? "system" : "agent",
@@ -800,11 +800,11 @@ Current User:
800
800
  a?.id === u && (a.text += e, this.sharedMessages.value = [...i]);
801
801
  }, onMessage = (e) => {
802
802
  if (!isCurrentTurn()) return;
803
- if (claimLiveTurn(), m = !0, e.sender === "agent" && f(e.text)) {
803
+ if (claimLiveTurn(), m = !0, e.sender === "agent" && p(e.text)) {
804
804
  this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.sharedMessages.value = this.sharedMessages.value.filter((e) => e.id !== u);
805
805
  return;
806
806
  }
807
- p = !0;
807
+ f = !0;
808
808
  let t = e.sender === "system" || e.turnOutcome === "failed" ? "failed" : "completed";
809
809
  this.finishToolActivities(t);
810
810
  let n = this.textState.value.toolActivities, r = e.toolActivities?.length || !n?.length ? e : {
@@ -826,16 +826,16 @@ Current User:
826
826
  let e = i[i.length - 1];
827
827
  this.sharedMessages.value = e?.id === u ? [...i.slice(0, -1), r] : [...i, r];
828
828
  }
829
- r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code && we.has(r.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
829
+ r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code && De.has(r.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
830
830
  }, onDone = (e) => {
831
831
  if (!isCurrentTurn()) return;
832
- if (!p && !m) {
832
+ if (!f && !m) {
833
833
  onError("empty_stream — assistant returned no content");
834
834
  return;
835
835
  }
836
836
  this.finishToolActivities("completed");
837
837
  let t = this.sharedMessages.value, n = t[t.length - 1];
838
- n?.id === u && n.sender === "agent" && f(n.text) && (this.sharedMessages.value = t.slice(0, -1)), e && (this.conversationId = e), this.updateState(this.textState, {
838
+ n?.id === u && n.sender === "agent" && p(n.text) && (this.sharedMessages.value = t.slice(0, -1)), e && (this.conversationId = e), this.updateState(this.textState, {
839
839
  isThinking: !1,
840
840
  workingDescription: void 0,
841
841
  transientIssue: void 0
@@ -951,7 +951,7 @@ Current User:
951
951
  }
952
952
  loadMessages(e) {
953
953
  this.conversationId = e.conversationId;
954
- let t = this.sharedMessages.value, n = e.messages.filter((e) => e.sender !== "agent" || !f(e.text));
954
+ let t = this.sharedMessages.value, n = e.messages.filter((e) => e.sender !== "agent" || !p(e.text));
955
955
  this.sharedMessages.value = [...n, ...t], e.activeToolActivities?.length && (e.activeToolActivities.forEach((e) => this.rememberToolActivity(e)), this.updateState(this.textState, {
956
956
  isThinking: !0,
957
957
  workingDescription: void 0,
@@ -977,11 +977,11 @@ function getImageSrc(e) {
977
977
  return e ? typeof e == "string" ? e : e.src || "" : "";
978
978
  }
979
979
  function getAgentAvatarUrl(e) {
980
- return getImageSrc(e.cover) || getImageSrc(e.avatar) || u(e.name);
980
+ return getImageSrc(e.cover) || getImageSrc(e.avatar) || f(e.name);
981
981
  }
982
982
  function handleImageError(e) {
983
983
  let t = e.target;
984
- t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = u());
984
+ t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = f());
985
985
  }
986
986
  function parseButtonTemplate(e) {
987
987
  let { template: t, agent: n } = e;
@@ -989,10 +989,10 @@ function parseButtonTemplate(e) {
989
989
  }
990
990
  //#endregion
991
991
  //#region agent/ui/ElAgentButton.vue?vue&type=script&setup=true&lang.ts
992
- var Ee = {
992
+ var ke = {
993
993
  key: 0,
994
994
  class: "absolute inset-0 flex items-center justify-center"
995
- }, De = /* @__PURE__ */ k({
995
+ }, Ae = /* @__PURE__ */ j({
996
996
  __name: "ElAgentButton",
997
997
  props: {
998
998
  theme: { default: "primary" },
@@ -1005,40 +1005,40 @@ var Ee = {
1005
1005
  iconAfter: {}
1006
1006
  },
1007
1007
  setup(e) {
1008
- let t = v(() => ({
1008
+ let t = b(() => ({
1009
1009
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
1010
1010
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
1011
1011
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
1012
1012
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20",
1013
1013
  dark: "bg-theme-900 border-transparent hover:bg-theme-800"
1014
- })[e.theme]), n = v(() => ({
1014
+ })[e.theme]), n = b(() => ({
1015
1015
  sm: "px-4 py-2 text-sm",
1016
1016
  md: "px-6 py-3 text-base",
1017
1017
  lg: "px-8 py-4 text-base"
1018
- })[e.size]), r = v(() => ({
1018
+ })[e.size]), r = b(() => ({
1019
1019
  sm: "size-4",
1020
1020
  md: "size-4",
1021
1021
  lg: "size-5"
1022
1022
  })[e.size]);
1023
- return (i, a) => (P(), 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 ? (P(), x("div", Ee, [...a[0] || (a[0] = [S("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : b("", !0), S("span", { class: j(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
1024
- e.icon ? (P(), x("i", {
1023
+ return (i, a) => (F(), C("button", { class: M(["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 ? (F(), C("div", ke, [...a[0] || (a[0] = [T("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : S("", !0), T("span", { class: M(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
1024
+ e.icon ? (F(), C("i", {
1025
1025
  key: 0,
1026
- class: j([e.icon, r.value])
1027
- }, null, 2)) : b("", !0),
1028
- ae(i.$slots, "default"),
1029
- e.iconAfter ? (P(), x("i", {
1026
+ class: M([e.icon, r.value])
1027
+ }, null, 2)) : S("", !0),
1028
+ B(i.$slots, "default"),
1029
+ e.iconAfter ? (F(), C("i", {
1030
1030
  key: 1,
1031
- class: j([e.iconAfter, r.value])
1032
- }, null, 2)) : b("", !0)
1031
+ class: M([e.iconAfter, r.value])
1032
+ }, null, 2)) : S("", !0)
1033
1033
  ], 2)], 2));
1034
1034
  }
1035
- }), Oe = ["value"], ke = /* @__PURE__ */ k({
1035
+ }), je = ["value"], Me = /* @__PURE__ */ j({
1036
1036
  __name: "AgentInputEmail",
1037
1037
  props: { modelValue: { default: "" } },
1038
1038
  emits: ["update:modelValue"],
1039
1039
  setup(e, { emit: t }) {
1040
1040
  let n = t;
1041
- return (t, r) => (P(), x("input", {
1041
+ return (t, r) => (F(), C("input", {
1042
1042
  name: "username",
1043
1043
  type: "email",
1044
1044
  inputmode: "email",
@@ -1051,9 +1051,9 @@ var Ee = {
1051
1051
  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",
1052
1052
  style: { "font-size": "16px" },
1053
1053
  onInput: r[0] || (r[0] = (e) => n("update:modelValue", e.target.value))
1054
- }, null, 40, Oe));
1054
+ }, null, 40, je));
1055
1055
  }
1056
- }), Ae = ["placeholder", "value"], je = /* @__PURE__ */ k({
1056
+ }), Ne = ["placeholder", "value"], Pe = /* @__PURE__ */ j({
1057
1057
  __name: "AgentInputOneTimeCode",
1058
1058
  props: {
1059
1059
  modelValue: {},
@@ -1062,15 +1062,15 @@ var Ee = {
1062
1062
  },
1063
1063
  emits: ["update:modelValue", "autoSubmit"],
1064
1064
  setup(e, { emit: t }) {
1065
- let n = e, r = t, i = F(null), a = v(() => "0".repeat(n.length));
1066
- re(() => {
1065
+ let n = e, r = t, i = I(null), a = b(() => "0".repeat(n.length));
1066
+ ae(() => {
1067
1067
  n.focusFirst && !("ontouchstart" in window) && i.value?.focus();
1068
1068
  });
1069
1069
  function onInput(e) {
1070
1070
  let t = e.target.value.replace(/\D/g, "").slice(0, n.length);
1071
1071
  r("update:modelValue", t), t.length === n.length && r("autoSubmit", t);
1072
1072
  }
1073
- return (t, n) => (P(), x("input", {
1073
+ return (t, n) => (F(), C("input", {
1074
1074
  ref_key: "input",
1075
1075
  ref: i,
1076
1076
  name: "one-time-code",
@@ -1086,12 +1086,12 @@ var Ee = {
1086
1086
  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",
1087
1087
  style: { "font-size": "16px" },
1088
1088
  onInput
1089
- }, null, 40, Ae));
1089
+ }, null, 40, Ne));
1090
1090
  }
1091
- }), Me = { class: "relative flex-shrink-0" }, Ne = ["src", "alt"], Pe = { class: "absolute top-1 right-1" }, Fe = {
1091
+ }), Fe = { class: "relative flex-shrink-0" }, Ie = ["src", "alt"], Le = { class: "absolute top-1 right-1" }, Re = {
1092
1092
  key: 1,
1093
1093
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
1094
- }, Ie = { class: "min-w-0" }, Le = /* @__PURE__ */ k({
1094
+ }, ze = { class: "min-w-0" }, Be = /* @__PURE__ */ j({
1095
1095
  __name: "ElModeHeader",
1096
1096
  props: {
1097
1097
  agent: {},
@@ -1103,17 +1103,17 @@ var Ee = {
1103
1103
  layout: { default: "centered" }
1104
1104
  },
1105
1105
  setup(e) {
1106
- return (t, n) => (P(), x("div", { class: j(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [S("div", Me, [S("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"]) }, [S("img", {
1106
+ return (t, n) => (F(), C("div", { class: M(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [T("div", Fe, [T("div", { class: M(["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"]) }, [T("img", {
1107
1107
  src: e.agent.avatarUrl.value,
1108
1108
  alt: e.agent.displayName.value,
1109
1109
  class: "w-full h-full object-cover",
1110
- onError: n[0] || (n[0] = (...e) => oe(handleImageError) && oe(handleImageError)(...e))
1111
- }, null, 40, Ne)], 2), S("div", Pe, [e.isOnline ? (P(), x(h, { key: 0 }, [n[1] || (n[1] = S("div", {
1110
+ onError: n[0] || (n[0] = (...e) => ue(handleImageError) && ue(handleImageError)(...e))
1111
+ }, null, 40, Ie)], 2), T("div", Le, [e.isOnline ? (F(), C(v, { key: 0 }, [n[1] || (n[1] = T("div", {
1112
1112
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
1113
1113
  style: { "animation-duration": "3s" }
1114
- }, null, -1)), n[2] || (n[2] = S("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (P(), x("div", Fe))])]), S("div", Ie, [S("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" : ""]]) }, H(e.agent.displayName.value), 3), S("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"]]) }, H(e.layout === "horizontal" ? e.agent.title.value || "Assistant" : e.agent.title.value), 3)])], 2));
1114
+ }, null, -1)), n[2] || (n[2] = T("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (F(), C("div", Re))])]), T("div", ze, [T("h1", { class: M(["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" : ""]]) }, H(e.agent.displayName.value), 3), T("p", { class: M(["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"]]) }, H(e.layout === "horizontal" ? e.agent.title.value || "Assistant" : e.agent.title.value), 3)])], 2));
1115
1115
  }
1116
- }), Re = { class: "relative shrink-0 rounded-full" }, ze = ["src", "alt"], Be = ["src", "alt"], Ve = ["aria-label"], He = /* @__PURE__ */ k({
1116
+ }), Ve = { class: "relative shrink-0 rounded-full" }, He = ["src", "alt"], Ue = ["src", "alt"], We = ["aria-label"], Ge = /* @__PURE__ */ j({
1117
1117
  __name: "AgentAvatar",
1118
1118
  props: {
1119
1119
  agent: {},
@@ -1136,7 +1136,7 @@ var Ee = {
1136
1136
  amber: "bg-amber-500",
1137
1137
  red: "bg-red-500",
1138
1138
  grey: "bg-theme-300"
1139
- }, n = v(() => {
1139
+ }, n = b(() => {
1140
1140
  let n = e.agent.state.value;
1141
1141
  return e.showStatus && n.lifecycle !== "unknown" ? t[n.color] : null;
1142
1142
  }), r = {
@@ -1144,67 +1144,67 @@ var Ee = {
1144
1144
  height: "clamp(7px, 14%, 14px)",
1145
1145
  top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
1146
1146
  right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
1147
- }, i = v(() => e.isLight ? "ring-white" : "ring-theme-900");
1148
- return (t, a) => (P(), x("div", Re, [
1149
- S("img", {
1147
+ }, i = b(() => e.isLight ? "ring-white" : "ring-theme-900");
1148
+ return (t, a) => (F(), C("div", Ve, [
1149
+ T("img", {
1150
1150
  src: e.agent.avatarUrl.value,
1151
1151
  alt: e.agent.displayName.value,
1152
- class: j(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
1153
- }, null, 10, ze),
1154
- e.showOwnerMark && e.agent.ownerMarkUrl.value ? (P(), x("img", {
1152
+ class: M(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
1153
+ }, null, 10, He),
1154
+ e.showOwnerMark && e.agent.ownerMarkUrl.value ? (F(), C("img", {
1155
1155
  key: 0,
1156
1156
  src: e.agent.ownerMarkUrl.value,
1157
1157
  alt: e.agent.owner.value?.fullName ? `Owned by ${e.agent.owner.value.fullName}` : "Owner",
1158
- class: j(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
1159
- }, null, 10, Be)) : b("", !0),
1160
- n.value ? (P(), x("span", {
1158
+ class: M(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
1159
+ }, null, 10, Ue)) : S("", !0),
1160
+ n.value ? (F(), C("span", {
1161
1161
  key: 1,
1162
1162
  role: "status",
1163
1163
  "aria-label": e.agent.state.value.tooltip,
1164
- class: j(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
1164
+ class: M(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
1165
1165
  style: r
1166
- }, null, 10, Ve)) : b("", !0),
1167
- n.value && e.agent.state.value.lifecycle === "running" ? (P(), x("span", {
1166
+ }, null, 10, We)) : S("", !0),
1167
+ n.value && e.agent.state.value.lifecycle === "running" ? (F(), C("span", {
1168
1168
  key: 2,
1169
1169
  "aria-hidden": "true",
1170
- class: j(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
1170
+ class: M(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
1171
1171
  style: r
1172
- }, null, 2)) : b("", !0)
1172
+ }, null, 2)) : S("", !0)
1173
1173
  ]));
1174
1174
  }
1175
- }), Ue = {
1175
+ }), Ke = {
1176
1176
  key: 0,
1177
1177
  class: "sr-only",
1178
1178
  role: "status",
1179
1179
  "aria-live": "polite"
1180
- }, We = ["aria-expanded", "disabled"], Ge = ["aria-expanded"], Ke = {
1180
+ }, qe = ["aria-expanded", "disabled"], Je = ["aria-expanded"], Ye = {
1181
1181
  class: "flex w-5 shrink-0 justify-center self-stretch",
1182
1182
  "aria-hidden": "true"
1183
- }, qe = ["data-journal-row"], Je = {
1183
+ }, Xe = ["data-journal-row"], Ze = {
1184
1184
  class: "flex w-5 shrink-0 flex-col items-center self-stretch",
1185
1185
  "aria-hidden": "true"
1186
- }, Ye = { class: "flex h-[17px] shrink-0 items-center" }, Xe = {
1186
+ }, Qe = { class: "flex h-[17px] shrink-0 items-center" }, $e = {
1187
1187
  key: 0,
1188
1188
  class: "sr-only"
1189
- }, Ze = /* @__PURE__ */ k({
1189
+ }, et = /* @__PURE__ */ j({
1190
1190
  __name: "AgentToolActivityGroup",
1191
1191
  props: {
1192
1192
  model: {},
1193
1193
  isLight: { type: Boolean }
1194
1194
  },
1195
1195
  setup(e) {
1196
- let t = e, n = B(!1);
1196
+ let t = e, n = ce(!1);
1197
1197
  function toggle() {
1198
1198
  n.value = !n.value;
1199
1199
  }
1200
- 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(() => {
1200
+ let r = b(() => t.model.outcome === "completed"), i = b(() => t.model.hiddenRows.length), a = b(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = b(() => {
1201
1201
  let e = t.model;
1202
1202
  return r.value ? n.value ? e.hiddenRows : [] : [
1203
1203
  ...n.value ? e.hiddenRows : [],
1204
1204
  ...e.visibleRows,
1205
1205
  ...e.terminal ? [e.terminal] : []
1206
1206
  ];
1207
- }), s = v(() => t.isLight ? {
1207
+ }), s = b(() => t.isLight ? {
1208
1208
  spine: "bg-theme-200",
1209
1209
  dashed: "border-theme-300",
1210
1210
  doneMark: "text-theme-400",
@@ -1220,7 +1220,7 @@ var Ee = {
1220
1220
  stoppedSquare: "bg-white/55",
1221
1221
  muted: "text-white/55",
1222
1222
  ring: "focus-visible:ring-white"
1223
- }), c = v(() => {
1223
+ }), c = b(() => {
1224
1224
  let e = t.isLight;
1225
1225
  return {
1226
1226
  done: {
@@ -1263,64 +1263,64 @@ var Ee = {
1263
1263
  }
1264
1264
  };
1265
1265
  });
1266
- return (t, u) => (P(), x("div", { class: j(["w-full py-0.5", s.value.muted]) }, [
1267
- a.value ? (P(), x("span", Ue, H(a.value), 1)) : b("", !0),
1268
- r.value ? (P(), x("button", {
1266
+ return (t, u) => (F(), C("div", { class: M(["w-full py-0.5", s.value.muted]) }, [
1267
+ a.value ? (F(), C("span", Ke, H(a.value), 1)) : S("", !0),
1268
+ r.value ? (F(), C("button", {
1269
1269
  key: 1,
1270
1270
  type: "button",
1271
1271
  "data-test": "messaging-tool-activity-summary",
1272
1272
  "data-journal-disclosure": "",
1273
1273
  "aria-expanded": n.value,
1274
1274
  disabled: i.value === 0,
1275
- 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]),
1275
+ class: M(["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]),
1276
1276
  onClick: toggle
1277
1277
  }, [
1278
- u[0] || (u[0] = S("i", {
1278
+ u[0] || (u[0] = T("i", {
1279
1279
  "data-journal-station": "completed",
1280
1280
  class: "i-tabler-circle-check size-3.5 shrink-0 text-green-600",
1281
1281
  "aria-hidden": "true"
1282
1282
  }, null, -1)),
1283
- S("span", { class: j(["text-[12.5px] font-medium leading-none", s.value.muted]) }, H(e.model.terminal?.label), 3),
1284
- i.value ? (P(), x("i", {
1283
+ T("span", { class: M(["text-[12.5px] font-medium leading-none", s.value.muted]) }, H(e.model.terminal?.label), 3),
1284
+ i.value ? (F(), C("i", {
1285
1285
  key: 0,
1286
- class: j(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
1286
+ class: M(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
1287
1287
  "aria-hidden": "true"
1288
- }, null, 2)) : b("", !0)
1289
- ], 10, We)) : i.value ? (P(), x("button", {
1288
+ }, null, 2)) : S("", !0)
1289
+ ], 10, qe)) : i.value ? (F(), C("button", {
1290
1290
  key: 2,
1291
1291
  type: "button",
1292
1292
  "data-test": "messaging-tool-activity-summary",
1293
1293
  "data-journal-disclosure": "",
1294
1294
  "aria-expanded": n.value,
1295
- 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]),
1295
+ class: M(["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]),
1296
1296
  onClick: toggle
1297
- }, [S("span", Ke, [S("span", {
1297
+ }, [T("span", Ye, [T("span", {
1298
1298
  "data-journal-spine": "dashed",
1299
- class: j(["w-0 border-l border-dashed", s.value.dashed])
1300
- }, null, 2)]), S("span", { class: j(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [C(H(i.value) + " earlier updates ", 1), S("i", {
1301
- class: j(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1299
+ class: M(["w-0 border-l border-dashed", s.value.dashed])
1300
+ }, null, 2)]), T("span", { class: M(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [k(H(i.value) + " earlier updates ", 1), T("i", {
1301
+ class: M(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1302
1302
  "aria-hidden": "true"
1303
- }, null, 2)], 2)], 10, Ge)) : b("", !0),
1304
- (P(!0), x(h, null, I(o.value, (e, t) => (P(), x("div", {
1303
+ }, null, 2)], 2)], 10, Je)) : S("", !0),
1304
+ (F(!0), C(v, null, R(o.value, (e, t) => (F(), C("div", {
1305
1305
  key: e.id,
1306
1306
  "data-test": "messaging-tool-activity-row",
1307
1307
  "data-journal-row": e.tone,
1308
- class: j([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
1309
- }, [S("div", Je, [S("span", Ye, [(P(), te(R(c.value[e.tone].station.tag), {
1308
+ class: M([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
1309
+ }, [T("div", Ze, [T("span", Qe, [(F(), x(se(c.value[e.tone].station.tag), {
1310
1310
  "data-journal-station": e.tone,
1311
- class: j(c.value[e.tone].station.class)
1312
- }, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? b("", !0) : (P(), x("span", {
1311
+ class: M(c.value[e.tone].station.class)
1312
+ }, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? S("", !0) : (F(), C("span", {
1313
1313
  key: 0,
1314
- class: j(["w-px flex-1", s.value.spine])
1315
- }, null, 2))]), S("div", { class: j(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [S("span", { class: j(["relative block leading-snug", c.value[e.tone].label]) }, [C(H(e.label), 1), c.value[e.tone].statusWord ? (P(), x("span", Xe, ", " + H(c.value[e.tone].statusWord), 1)) : b("", !0)], 2), e.note ? (P(), x("p", {
1314
+ class: M(["w-px flex-1", s.value.spine])
1315
+ }, null, 2))]), T("div", { class: M(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [T("span", { class: M(["relative block leading-snug", c.value[e.tone].label]) }, [k(H(e.label), 1), c.value[e.tone].statusWord ? (F(), C("span", $e, ", " + H(c.value[e.tone].statusWord), 1)) : S("", !0)], 2), e.note ? (F(), C("p", {
1316
1316
  key: 0,
1317
- class: j(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
1318
- }, H(e.note), 3)) : b("", !0)], 2)], 10, qe))), 128)),
1319
- !r.value && e.model.hint ? (P(), x("p", {
1317
+ class: M(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
1318
+ }, H(e.note), 3)) : S("", !0)], 2)], 10, Xe))), 128)),
1319
+ !r.value && e.model.hint ? (F(), C("p", {
1320
1320
  key: 3,
1321
1321
  "data-test": "messaging-tool-activity-hint",
1322
- class: j(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
1323
- }, H(e.model.hint), 3)) : b("", !0)
1322
+ class: M(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
1323
+ }, H(e.model.hint), 3)) : S("", !0)
1324
1324
  ], 2));
1325
1325
  }
1326
1326
  });
@@ -1365,86 +1365,86 @@ function _unsupportedIterableToArray(e, t) {
1365
1365
  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;
1366
1366
  }
1367
1367
  }
1368
- var Qe = Object.entries, $e = Object.setPrototypeOf, et = Object.isFrozen, J = Object.getPrototypeOf, tt = Object.getOwnPropertyDescriptor, X = Object.freeze, nt = Object.seal, rt = Object.create, it = typeof Reflect < "u" && Reflect, at = it.apply, st = it.construct;
1369
- X || (X = function freeze(e) {
1368
+ var J = Object.entries, tt = Object.setPrototypeOf, nt = Object.isFrozen, rt = Object.getPrototypeOf, it = Object.getOwnPropertyDescriptor, at = Object.freeze, st = Object.seal, ct = Object.create, lt = typeof Reflect < "u" && Reflect, ut = lt.apply, dt = lt.construct;
1369
+ at || (at = function freeze(e) {
1370
1370
  return e;
1371
- }), nt || (nt = function seal(e) {
1371
+ }), st || (st = function seal(e) {
1372
1372
  return e;
1373
- }), at || (at = function apply(e, t) {
1373
+ }), ut || (ut = function apply(e, t) {
1374
1374
  var n = [...arguments].slice(2);
1375
1375
  return e.apply(t, n);
1376
- }), st || (st = function construct(e) {
1376
+ }), dt || (dt = function construct(e) {
1377
1377
  return new e(...[...arguments].slice(1));
1378
1378
  });
1379
- var ct = unapply(Array.prototype.forEach), lt = unapply(Array.prototype.lastIndexOf), ut = unapply(Array.prototype.pop), dt = unapply(Array.prototype.push), ft = unapply(Array.prototype.splice), pt = Array.isArray, mt = unapply(String.prototype.toLowerCase), ht = unapply(String.prototype.toString), gt = unapply(String.prototype.match), _t = unapply(String.prototype.replace), vt = unapply(String.prototype.indexOf), yt = unapply(String.prototype.trim), bt = unapply(Number.prototype.toString), xt = unapply(Boolean.prototype.toString), St = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), Ct = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), wt = unapply(Object.prototype.hasOwnProperty), Z = unapply(Object.prototype.toString), Q = unapply(RegExp.prototype.test), Tt = unconstruct(TypeError);
1379
+ var ft = unapply(Array.prototype.forEach), pt = unapply(Array.prototype.lastIndexOf), mt = unapply(Array.prototype.pop), ht = unapply(Array.prototype.push), gt = unapply(Array.prototype.splice), _t = Array.isArray, vt = unapply(String.prototype.toLowerCase), yt = unapply(String.prototype.toString), bt = unapply(String.prototype.match), xt = unapply(String.prototype.replace), St = unapply(String.prototype.indexOf), Ct = unapply(String.prototype.trim), wt = unapply(Number.prototype.toString), X = unapply(Boolean.prototype.toString), Tt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), Et = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), Z = unapply(Object.prototype.hasOwnProperty), Dt = unapply(Object.prototype.toString), Q = unapply(RegExp.prototype.test), Ot = unconstruct(TypeError);
1380
1380
  function unapply(e) {
1381
1381
  return function(t) {
1382
1382
  t instanceof RegExp && (t.lastIndex = 0);
1383
1383
  var n = [...arguments].slice(1);
1384
- return at(e, t, n);
1384
+ return ut(e, t, n);
1385
1385
  };
1386
1386
  }
1387
1387
  function unconstruct(e) {
1388
1388
  return function() {
1389
- return st(e, [...arguments]);
1389
+ return dt(e, [...arguments]);
1390
1390
  };
1391
1391
  }
1392
1392
  function addToSet(e, t) {
1393
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : mt;
1394
- if ($e && $e(e, null), !pt(t)) return e;
1393
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : vt;
1394
+ if (tt && tt(e, null), !_t(t)) return e;
1395
1395
  let r = t.length;
1396
1396
  for (; r--;) {
1397
1397
  let i = t[r];
1398
1398
  if (typeof i == "string") {
1399
1399
  let e = n(i);
1400
- e !== i && (et(t) || (t[r] = e), i = e);
1400
+ e !== i && (nt(t) || (t[r] = e), i = e);
1401
1401
  }
1402
1402
  e[i] = !0;
1403
1403
  }
1404
1404
  return e;
1405
1405
  }
1406
1406
  function cleanArray(e) {
1407
- for (let t = 0; t < e.length; t++) wt(e, t) || (e[t] = null);
1407
+ for (let t = 0; t < e.length; t++) Z(e, t) || (e[t] = null);
1408
1408
  return e;
1409
1409
  }
1410
1410
  function clone(e) {
1411
- let t = rt(null);
1412
- for (let r of Qe(e)) {
1411
+ let t = ct(null);
1412
+ for (let r of J(e)) {
1413
1413
  var n = _slicedToArray(r, 2);
1414
1414
  let i = n[0], a = n[1];
1415
- wt(e, i) && (pt(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
1415
+ Z(e, i) && (_t(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
1416
1416
  }
1417
1417
  return t;
1418
1418
  }
1419
1419
  function stringifyValue(e) {
1420
1420
  switch (typeof e) {
1421
1421
  case "string": return e;
1422
- case "number": return bt(e);
1423
- case "boolean": return xt(e);
1424
- case "bigint": return St ? St(e) : "0";
1425
- case "symbol": return Ct ? Ct(e) : "Symbol()";
1426
- case "undefined": return Z(e);
1422
+ case "number": return wt(e);
1423
+ case "boolean": return X(e);
1424
+ case "bigint": return Tt ? Tt(e) : "0";
1425
+ case "symbol": return Et ? Et(e) : "Symbol()";
1426
+ case "undefined": return Dt(e);
1427
1427
  case "function":
1428
1428
  case "object": {
1429
- if (e === null) return Z(e);
1429
+ if (e === null) return Dt(e);
1430
1430
  let t = e, n = lookupGetter(t, "toString");
1431
1431
  if (typeof n == "function") {
1432
1432
  let e = n(t);
1433
- return typeof e == "string" ? e : Z(e);
1433
+ return typeof e == "string" ? e : Dt(e);
1434
1434
  }
1435
- return Z(e);
1435
+ return Dt(e);
1436
1436
  }
1437
- default: return Z(e);
1437
+ default: return Dt(e);
1438
1438
  }
1439
1439
  }
1440
1440
  function lookupGetter(e, t) {
1441
1441
  for (; e !== null;) {
1442
- let n = tt(e, t);
1442
+ let n = it(e, t);
1443
1443
  if (n) {
1444
1444
  if (n.get) return unapply(n.get);
1445
1445
  if (typeof n.value == "function") return unapply(n.value);
1446
1446
  }
1447
- e = J(e);
1447
+ e = rt(e);
1448
1448
  }
1449
1449
  function fallbackValue() {
1450
1450
  return null;
@@ -1458,7 +1458,7 @@ function isRegex(e) {
1458
1458
  return !1;
1459
1459
  }
1460
1460
  }
1461
- var Et = 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(".")), Dt = 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(".")), Ot = X([
1461
+ var kt = at(/* @__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(".")), At = at(/* @__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(".")), jt = at([
1462
1462
  "feBlend",
1463
1463
  "feColorMatrix",
1464
1464
  "feComponentTransfer",
@@ -1484,7 +1484,7 @@ var Et = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1484
1484
  "feSpotLight",
1485
1485
  "feTile",
1486
1486
  "feTurbulence"
1487
- ]), kt = X([
1487
+ ]), Mt = at([
1488
1488
  "animate",
1489
1489
  "color-profile",
1490
1490
  "cursor",
@@ -1507,7 +1507,7 @@ var Et = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1507
1507
  "solidcolor",
1508
1508
  "unknown",
1509
1509
  "use"
1510
- ]), At = 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(".")), jt = X([
1510
+ ]), Nt = at(/* @__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(".")), Pt = at([
1511
1511
  "maction",
1512
1512
  "maligngroup",
1513
1513
  "malignmark",
@@ -1523,13 +1523,13 @@ var Et = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1523
1523
  "annotation-xml",
1524
1524
  "mprescripts",
1525
1525
  "none"
1526
- ]), Mt = X(["#text"]), Nt = 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(".")), Pt = 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(".")), Ft = 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(".")), It = X([
1526
+ ]), Ft = at(["#text"]), It = at(/* @__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(".")), Lt = at(/* @__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(".")), Rt = at(/* @__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(".")), zt = at([
1527
1527
  "xlink:href",
1528
1528
  "xml:id",
1529
1529
  "xlink:title",
1530
1530
  "xml:space",
1531
1531
  "xmlns:xlink"
1532
- ]), Lt = nt(/{{[\w\W]*|^[\w\W]*}}/g), Rt = nt(/<%[\w\W]*|^[\w\W]*%>/g), zt = nt(/\${[\w\W]*/g), Bt = nt(/^data-[\-\w.\u00B7-\uFFFF]+$/), Vt = nt(/^aria-[\-\w]+$/), Ht = nt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ut = nt(/^(?:\w+script|data):/i), Wt = nt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Gt = nt(/^html$/i), Kt = nt(/^[a-z][.\w]*(-[.\w]+)+$/i), qt = nt(/<[/\w!]/g), Jt = nt(/<[/\w]/g), Yt = nt(/<\/no(script|embed|frames)/i), Xt = nt(/\/>/i), Zt = {
1532
+ ]), Bt = st(/{{[\w\W]*|^[\w\W]*}}/g), Vt = st(/<%[\w\W]*|^[\w\W]*%>/g), Ht = st(/\${[\w\W]*/g), Ut = st(/^data-[\-\w.\u00B7-\uFFFF]+$/), Wt = st(/^aria-[\-\w]+$/), Gt = st(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Kt = st(/^(?:\w+script|data):/i), qt = st(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Jt = st(/^html$/i), Yt = st(/^[a-z][.\w]*(-[.\w]+)+$/i), Xt = st(/<[/\w!]/g), Zt = st(/<[/\w]/g), Qt = st(/<\/no(script|embed|frames)/i), $t = st(/\/>/i), en = {
1533
1533
  element: 1,
1534
1534
  attribute: 2,
1535
1535
  text: 3,
@@ -1542,9 +1542,9 @@ var Et = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1542
1542
  documentType: 10,
1543
1543
  documentFragment: 11,
1544
1544
  notation: 12
1545
- }, Qt = function getGlobal() {
1545
+ }, tn = function getGlobal() {
1546
1546
  return typeof window > "u" ? null : window;
1547
- }, $t = function _createTrustedTypesPolicy(e, t) {
1547
+ }, nn = function _createTrustedTypesPolicy(e, t) {
1548
1548
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
1549
1549
  let n = null, r = "data-tt-policy-suffix";
1550
1550
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -1561,7 +1561,7 @@ var Et = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1561
1561
  } catch {
1562
1562
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
1563
1563
  }
1564
- }, en = function _createHooksMap() {
1564
+ }, rn = function _createHooksMap() {
1565
1565
  return {
1566
1566
  afterSanitizeAttributes: [],
1567
1567
  afterSanitizeElements: [],
@@ -1573,53 +1573,53 @@ var Et = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1573
1573
  uponSanitizeElement: [],
1574
1574
  uponSanitizeShadowNode: []
1575
1575
  };
1576
- }, tn = function _resolveSetOption(e, t, n, r) {
1577
- return wt(e, t) && pt(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
1576
+ }, an = function _resolveSetOption(e, t, n, r) {
1577
+ return Z(e, t) && _t(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
1578
1578
  };
1579
1579
  function createDOMPurify() {
1580
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qt(), DOMPurify = (e) => createDOMPurify(e);
1581
- if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== Zt.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
1580
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : tn(), DOMPurify = (e) => createDOMPurify(e);
1581
+ if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== en.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
1582
1582
  let t = e.document, n = t, r = n.currentScript;
1583
1583
  e.DocumentFragment;
1584
1584
  let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
1585
1585
  e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
1586
- let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), h = lookupGetter(f, "nextSibling"), _ = lookupGetter(f, "childNodes"), v = lookupGetter(f, "parentNode"), te = lookupGetter(f, "shadowRoot"), b = lookupGetter(f, "attributes"), x = a && a.prototype ? lookupGetter(a.prototype, "nodeType") : null, S = a && a.prototype ? lookupGetter(a.prototype, "nodeName") : null;
1586
+ let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), te = lookupGetter(f, "nextSibling"), h = lookupGetter(f, "childNodes"), _ = lookupGetter(f, "parentNode"), v = lookupGetter(f, "shadowRoot"), ne = lookupGetter(f, "attributes"), b = a && a.prototype ? lookupGetter(a.prototype, "nodeType") : null, x = a && a.prototype ? lookupGetter(a.prototype, "nodeName") : null;
1587
1587
  if (typeof i == "function") {
1588
1588
  let e = t.createElement("template");
1589
1589
  e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
1590
1590
  }
1591
- let C, T = "", k, A = !1, j = 0, M = function _assertNotInTrustedTypesPolicy() {
1592
- if (j > 0) throw Tt("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.");
1593
- }, ne = function _createTrustedHTML(e) {
1594
- M(), j++;
1591
+ let S, C = "", T, k = !1, A = 0, j = function _assertNotInTrustedTypesPolicy() {
1592
+ if (A > 0) throw Ot("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.");
1593
+ }, re = function _createTrustedHTML(e) {
1594
+ j(), A++;
1595
1595
  try {
1596
- return C.createHTML(e);
1596
+ return S.createHTML(e);
1597
1597
  } finally {
1598
- j--;
1598
+ A--;
1599
1599
  }
1600
- }, re = function _createTrustedScriptURL(e) {
1601
- M(), j++;
1600
+ }, M = function _createTrustedScriptURL(e) {
1601
+ j(), A++;
1602
1602
  try {
1603
- return C.createScriptURL(e);
1603
+ return S.createScriptURL(e);
1604
1604
  } finally {
1605
- j--;
1606
- }
1607
- }, ie = function _getDefaultTrustedTypesPolicy() {
1608
- return A || (k = $t(u, r), A = !0), k;
1609
- }, P = t, F = P.implementation, I = P.createNodeIterator, ae = P.createDocumentFragment, R = P.getElementsByTagName, B = n.importNode, H = en();
1610
- DOMPurify.isSupported = typeof Qe == "function" && typeof v == "function" && F && F.createHTMLDocument !== void 0;
1611
- let oe = Lt, se = Rt, ce = zt, ue = Bt, U = Vt, de = Ut, pe = Wt, W = Kt, he = Ht, G = null, _e = addToSet({}, [
1612
- ...Et,
1613
- ...Dt,
1614
- ...Ot,
1605
+ A--;
1606
+ }
1607
+ }, P = function _getDefaultTrustedTypesPolicy() {
1608
+ return k || (T = nn(u, r), k = !0), T;
1609
+ }, ie = t, ae = ie.implementation, oe = ie.createNodeIterator, F = ie.createDocumentFragment, I = ie.getElementsByTagName, R = n.importNode, B = rn();
1610
+ DOMPurify.isSupported = typeof J == "function" && typeof _ == "function" && ae && ae.createHTMLDocument !== void 0;
1611
+ let se = Bt, ce = Vt, H = Ht, ue = Ut, U = Wt, de = Kt, pe = qt, he = Yt, _e = Gt, W = null, G = addToSet({}, [
1612
+ ...kt,
1615
1613
  ...At,
1616
- ...Mt
1617
- ]), K = null, ve = addToSet({}, [
1614
+ ...jt,
1618
1615
  ...Nt,
1619
- ...Pt,
1620
- ...Ft,
1621
- ...It
1622
- ]), q = Object.seal(rt(null, {
1616
+ ...Ft
1617
+ ]), K = null, ve = addToSet({}, [
1618
+ ...It,
1619
+ ...Lt,
1620
+ ...Rt,
1621
+ ...zt
1622
+ ]), q = Object.seal(ct(null, {
1623
1623
  tagNameCheck: {
1624
1624
  writable: !0,
1625
1625
  configurable: !1,
@@ -1638,7 +1638,7 @@ function createDOMPurify() {
1638
1638
  enumerable: !0,
1639
1639
  value: !1
1640
1640
  }
1641
- })), ye = null, be = null, Se = Object.seal(rt(null, {
1641
+ })), ye = null, be = null, Se = Object.seal(ct(null, {
1642
1642
  tagCheck: {
1643
1643
  writable: !0,
1644
1644
  configurable: !1,
@@ -1673,90 +1673,90 @@ function createDOMPurify() {
1673
1673
  "value",
1674
1674
  "style",
1675
1675
  "xmlns"
1676
- ]), Ye = "http://www.w3.org/1998/Math/MathML", Xe = "http://www.w3.org/2000/svg", Ze = "http://www.w3.org/1999/xhtml", $e = Ze, et = !1, J = null, tt = addToSet({}, [
1676
+ ]), Ye = "http://www.w3.org/1998/Math/MathML", Xe = "http://www.w3.org/2000/svg", Ze = "http://www.w3.org/1999/xhtml", Qe = Ze, $e = !1, et = null, tt = addToSet({}, [
1677
1677
  Ye,
1678
1678
  Xe,
1679
1679
  Ze
1680
- ], ht), it = X([
1680
+ ], yt), nt = at([
1681
1681
  "mi",
1682
1682
  "mo",
1683
1683
  "mn",
1684
1684
  "ms",
1685
1685
  "mtext"
1686
- ]), at = addToSet({}, it), st = X(["annotation-xml"]), bt = addToSet({}, st), xt = addToSet({}, [
1686
+ ]), rt = addToSet({}, nt), it = at(["annotation-xml"]), lt = addToSet({}, it), ut = addToSet({}, [
1687
1687
  "title",
1688
1688
  "style",
1689
1689
  "font",
1690
1690
  "a",
1691
1691
  "script"
1692
- ]), St = null, Ct = ["application/xhtml+xml", "text/html"], Z = null, nn = null, rn = t.createElement("form"), an = function isRegexOrFunction(e) {
1692
+ ]), dt = null, wt = ["application/xhtml+xml", "text/html"], X = null, Tt = null, Et = t.createElement("form"), Dt = function isRegexOrFunction(e) {
1693
1693
  return e instanceof RegExp || e instanceof Function;
1694
1694
  }, on = function _parseConfig() {
1695
1695
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1696
- if (nn && nn === e) return;
1697
- (!e || typeof e != "object") && (e = {}), e = clone(e), St = Ct.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Z = St === "application/xhtml+xml" ? ht : mt, G = tn(e, "ALLOWED_TAGS", _e, { transform: Z }), K = tn(e, "ALLOWED_ATTR", ve, { transform: Z }), J = tn(e, "ALLOWED_NAMESPACES", tt, { transform: ht }), qe = tn(e, "ADD_URI_SAFE_ATTR", Je, {
1698
- transform: Z,
1696
+ if (Tt && Tt === e) return;
1697
+ (!e || typeof e != "object") && (e = {}), e = clone(e), dt = wt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, X = dt === "application/xhtml+xml" ? yt : vt, W = an(e, "ALLOWED_TAGS", G, { transform: X }), K = an(e, "ALLOWED_ATTR", ve, { transform: X }), et = an(e, "ALLOWED_NAMESPACES", tt, { transform: yt }), qe = an(e, "ADD_URI_SAFE_ATTR", Je, {
1698
+ transform: X,
1699
1699
  base: Je
1700
- }), Ge = tn(e, "ADD_DATA_URI_TAGS", Ke, {
1701
- transform: Z,
1700
+ }), Ge = an(e, "ADD_DATA_URI_TAGS", Ke, {
1701
+ transform: X,
1702
1702
  base: Ke
1703
- }), Ue = tn(e, "FORBID_CONTENTS", We, { transform: Z }), ye = tn(e, "FORBID_TAGS", clone({}), { transform: Z }), be = tn(e, "FORBID_ATTR", clone({}), { transform: Z }), He = wt(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, we = e.ALLOW_DATA_ATTR !== !1, Te = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ee = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, De = e.SAFE_FOR_TEMPLATES || !1, Oe = e.SAFE_FOR_XML !== !1, ke = e.WHOLE_DOCUMENT || !1, Pe = e.RETURN_DOM || !1, Fe = e.RETURN_DOM_FRAGMENT || !1, Ie = e.RETURN_TRUSTED_TYPE || !1, Ne = e.FORCE_BODY || !1, Le = e.SANITIZE_DOM !== !1, Re = e.SANITIZE_NAMED_PROPS || !1, Be = e.KEEP_CONTENT !== !1, Ve = e.IN_PLACE || !1, he = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Ht, $e = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Ze, at = wt(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, it), bt = wt(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, st);
1704
- let t = wt(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : rt(null);
1705
- if (q = rt(null), wt(t, "tagNameCheck") && an(t.tagNameCheck) && (q.tagNameCheck = t.tagNameCheck), wt(t, "attributeNameCheck") && an(t.attributeNameCheck) && (q.attributeNameCheck = t.attributeNameCheck), wt(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (q.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), nt(q), De && (we = !1), Fe && (Pe = !0), He && (G = addToSet({}, Mt), K = rt(null), He.html === !0 && (addToSet(G, Et), addToSet(K, Nt)), He.svg === !0 && (addToSet(G, Dt), addToSet(K, Pt), addToSet(K, It)), He.svgFilters === !0 && (addToSet(G, Ot), addToSet(K, Pt), addToSet(K, It)), He.mathMl === !0 && (addToSet(G, At), addToSet(K, Ft), addToSet(K, It))), Se.tagCheck = null, Se.attributeCheck = null, wt(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Se.tagCheck = e.ADD_TAGS : pt(e.ADD_TAGS) && (G === _e && (G = clone(G)), addToSet(G, e.ADD_TAGS, Z))), wt(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Se.attributeCheck = e.ADD_ATTR : pt(e.ADD_ATTR) && (K === ve && (K = clone(K)), addToSet(K, e.ADD_ATTR, Z))), wt(e, "ADD_URI_SAFE_ATTR") && pt(e.ADD_URI_SAFE_ATTR) && addToSet(qe, e.ADD_URI_SAFE_ATTR, Z), wt(e, "FORBID_CONTENTS") && pt(e.FORBID_CONTENTS) && (Ue === We && (Ue = clone(Ue)), addToSet(Ue, e.FORBID_CONTENTS, Z)), wt(e, "ADD_FORBID_CONTENTS") && pt(e.ADD_FORBID_CONTENTS) && (Ue === We && (Ue = clone(Ue)), addToSet(Ue, e.ADD_FORBID_CONTENTS, Z)), Be && (G["#text"] = !0), ke && addToSet(G, [
1703
+ }), Ue = an(e, "FORBID_CONTENTS", We, { transform: X }), ye = an(e, "FORBID_TAGS", clone({}), { transform: X }), be = an(e, "FORBID_ATTR", clone({}), { transform: X }), He = Z(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, we = e.ALLOW_DATA_ATTR !== !1, Te = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ee = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, De = e.SAFE_FOR_TEMPLATES || !1, Oe = e.SAFE_FOR_XML !== !1, ke = e.WHOLE_DOCUMENT || !1, Pe = e.RETURN_DOM || !1, Fe = e.RETURN_DOM_FRAGMENT || !1, Ie = e.RETURN_TRUSTED_TYPE || !1, Ne = e.FORCE_BODY || !1, Le = e.SANITIZE_DOM !== !1, Re = e.SANITIZE_NAMED_PROPS || !1, Be = e.KEEP_CONTENT !== !1, Ve = e.IN_PLACE || !1, _e = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Gt, Qe = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Ze, rt = Z(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, nt), lt = Z(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, it);
1704
+ let t = Z(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : ct(null);
1705
+ if (q = ct(null), Z(t, "tagNameCheck") && Dt(t.tagNameCheck) && (q.tagNameCheck = t.tagNameCheck), Z(t, "attributeNameCheck") && Dt(t.attributeNameCheck) && (q.attributeNameCheck = t.attributeNameCheck), Z(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (q.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), st(q), De && (we = !1), Fe && (Pe = !0), He && (W = addToSet({}, Ft), K = ct(null), He.html === !0 && (addToSet(W, kt), addToSet(K, It)), He.svg === !0 && (addToSet(W, At), addToSet(K, Lt), addToSet(K, zt)), He.svgFilters === !0 && (addToSet(W, jt), addToSet(K, Lt), addToSet(K, zt)), He.mathMl === !0 && (addToSet(W, Nt), addToSet(K, Rt), addToSet(K, zt))), Se.tagCheck = null, Se.attributeCheck = null, Z(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Se.tagCheck = e.ADD_TAGS : _t(e.ADD_TAGS) && (W === G && (W = clone(W)), addToSet(W, e.ADD_TAGS, X))), Z(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Se.attributeCheck = e.ADD_ATTR : _t(e.ADD_ATTR) && (K === ve && (K = clone(K)), addToSet(K, e.ADD_ATTR, X))), Z(e, "ADD_URI_SAFE_ATTR") && _t(e.ADD_URI_SAFE_ATTR) && addToSet(qe, e.ADD_URI_SAFE_ATTR, X), Z(e, "FORBID_CONTENTS") && _t(e.FORBID_CONTENTS) && (Ue === We && (Ue = clone(Ue)), addToSet(Ue, e.FORBID_CONTENTS, X)), Z(e, "ADD_FORBID_CONTENTS") && _t(e.ADD_FORBID_CONTENTS) && (Ue === We && (Ue = clone(Ue)), addToSet(Ue, e.ADD_FORBID_CONTENTS, X)), Be && (W["#text"] = !0), ke && addToSet(W, [
1706
1706
  "html",
1707
1707
  "head",
1708
1708
  "body"
1709
- ]), G.table && (addToSet(G, ["tbody"]), delete ye.tbody), e.TRUSTED_TYPES_POLICY) {
1710
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Tt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1711
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Tt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1712
- let t = C;
1713
- C = e.TRUSTED_TYPES_POLICY;
1709
+ ]), W.table && (addToSet(W, ["tbody"]), delete ye.tbody), e.TRUSTED_TYPES_POLICY) {
1710
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Ot("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1711
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Ot("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1712
+ let t = S;
1713
+ S = e.TRUSTED_TYPES_POLICY;
1714
1714
  try {
1715
- T = ne("");
1715
+ C = re("");
1716
1716
  } catch (e) {
1717
- throw C = t, e;
1717
+ throw S = t, e;
1718
1718
  }
1719
- } else e.TRUSTED_TYPES_POLICY === null ? (C = void 0, T = "") : (C === void 0 && (C = ie()), C && typeof T == "string" && (T = ne("")));
1720
- X && X(e), nn = e;
1719
+ } else e.TRUSTED_TYPES_POLICY === null ? (S = void 0, C = "") : (S === void 0 && (S = P()), S && typeof C == "string" && (C = re("")));
1720
+ at && at(e), Tt = e;
1721
1721
  }, sn = addToSet({}, [
1722
- ...Dt,
1723
- ...Ot,
1724
- ...kt
1725
- ]), cn = addToSet({}, [...At, ...jt]), ln = function _checkSvgNamespace(e, t, n) {
1726
- return t.namespaceURI === Ze ? e === "svg" : t.namespaceURI === Ye ? e === "svg" && (n === "annotation-xml" || at[n]) : !!sn[e];
1722
+ ...At,
1723
+ ...jt,
1724
+ ...Mt
1725
+ ]), cn = addToSet({}, [...Nt, ...Pt]), ln = function _checkSvgNamespace(e, t, n) {
1726
+ return t.namespaceURI === Ze ? e === "svg" : t.namespaceURI === Ye ? e === "svg" && (n === "annotation-xml" || rt[n]) : !!sn[e];
1727
1727
  }, un = function _checkMathMlNamespace(e, t, n) {
1728
- return t.namespaceURI === Ze ? e === "math" : t.namespaceURI === Xe ? e === "math" && bt[n] : !!cn[e];
1728
+ return t.namespaceURI === Ze ? e === "math" : t.namespaceURI === Xe ? e === "math" && lt[n] : !!cn[e];
1729
1729
  }, dn = function _checkHtmlNamespace(e, t, n) {
1730
- return t.namespaceURI === Xe && !bt[n] || t.namespaceURI === Ye && !at[n] ? !1 : !cn[e] && (xt[e] || !sn[e]);
1730
+ return t.namespaceURI === Xe && !lt[n] || t.namespaceURI === Ye && !rt[n] ? !1 : !cn[e] && (ut[e] || !sn[e]);
1731
1731
  }, fn = function _checkValidNamespace(e) {
1732
- let t = v(e);
1732
+ let t = _(e);
1733
1733
  (!t || !t.tagName) && (t = {
1734
- namespaceURI: $e,
1734
+ namespaceURI: Qe,
1735
1735
  tagName: "template"
1736
1736
  });
1737
- let n = mt(e.tagName), r = mt(t.tagName);
1738
- return J[e.namespaceURI] ? e.namespaceURI === Xe ? ln(n, t, r) : e.namespaceURI === Ye ? un(n, t, r) : e.namespaceURI === Ze ? dn(n, t, r) : !!(St === "application/xhtml+xml" && J[e.namespaceURI]) : !1;
1737
+ let n = vt(e.tagName), r = vt(t.tagName);
1738
+ return et[e.namespaceURI] ? e.namespaceURI === Xe ? ln(n, t, r) : e.namespaceURI === Ye ? un(n, t, r) : e.namespaceURI === Ze ? dn(n, t, r) : !!(dt === "application/xhtml+xml" && et[e.namespaceURI]) : !1;
1739
1739
  }, pn = function _forceRemove(e) {
1740
- dt(DOMPurify.removed, { element: e });
1740
+ ht(DOMPurify.removed, { element: e });
1741
1741
  try {
1742
- v(e).removeChild(e);
1742
+ _(e).removeChild(e);
1743
1743
  } catch {
1744
- if (m(e), !v(e)) throw Tt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1744
+ if (m(e), !_(e)) throw Ot("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1745
1745
  }
1746
1746
  }, mn = function _neutralizeRoot(e) {
1747
1747
  _n(e);
1748
- let t = _(e);
1748
+ let t = h(e);
1749
1749
  if (t) {
1750
1750
  let e = [];
1751
- ct(t, (t) => {
1752
- dt(e, t);
1753
- }), ct(e, (e) => {
1751
+ ft(t, (t) => {
1752
+ ht(e, t);
1753
+ }), ft(e, (e) => {
1754
1754
  try {
1755
1755
  m(e);
1756
1756
  } catch {}
1757
1757
  });
1758
1758
  }
1759
- let n = b(e);
1759
+ let n = ne(e);
1760
1760
  if (n) for (let t = n.length - 1; t >= 0; --t) {
1761
1761
  let r = n[t], i = r && r.name;
1762
1762
  if (typeof i == "string") try {
@@ -1765,12 +1765,12 @@ function createDOMPurify() {
1765
1765
  }
1766
1766
  }, hn = function _removeAttribute(e, t) {
1767
1767
  try {
1768
- dt(DOMPurify.removed, {
1768
+ ht(DOMPurify.removed, {
1769
1769
  attribute: t.getAttributeNode(e),
1770
1770
  from: t
1771
1771
  });
1772
1772
  } catch {
1773
- dt(DOMPurify.removed, {
1773
+ ht(DOMPurify.removed, {
1774
1774
  attribute: null,
1775
1775
  from: t
1776
1776
  });
@@ -1782,10 +1782,10 @@ function createDOMPurify() {
1782
1782
  t.setAttribute(e, "");
1783
1783
  } catch {}
1784
1784
  }, gn = function _stripDisallowedAttributes(e) {
1785
- let t = b(e);
1785
+ let t = ne(e);
1786
1786
  if (t) for (let n = t.length - 1; n >= 0; --n) {
1787
1787
  let r = t[n], i = r && r.name;
1788
- if (!(typeof i != "string" || K[Z(i)])) try {
1788
+ if (!(typeof i != "string" || K[X(i)])) try {
1789
1789
  e.removeAttribute(i);
1790
1790
  } catch {}
1791
1791
  }
@@ -1793,126 +1793,126 @@ function createDOMPurify() {
1793
1793
  let t = [e];
1794
1794
  for (; t.length > 0;) {
1795
1795
  let e = t.pop();
1796
- (x ? x(e) : e.nodeType) === Zt.element && gn(e);
1797
- let n = _(e);
1796
+ (b ? b(e) : e.nodeType) === en.element && gn(e);
1797
+ let n = h(e);
1798
1798
  if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
1799
1799
  }
1800
1800
  }, vn = function _neutralizePatchLinkage(e) {
1801
1801
  if (!Oe) return;
1802
1802
  let t = [e];
1803
1803
  for (; t.length > 0;) {
1804
- let e = t.pop(), n = x ? x(e) : e.nodeType;
1805
- if (n === Zt.processingInstruction || n === Zt.comment && Q(Jt, e.data)) {
1804
+ let e = t.pop(), n = b ? b(e) : e.nodeType;
1805
+ if (n === en.processingInstruction || n === en.comment && Q(Zt, e.data)) {
1806
1806
  try {
1807
1807
  m(e);
1808
1808
  } catch {}
1809
1809
  continue;
1810
1810
  }
1811
- if (n === Zt.element) {
1812
- let t = e, n = Z(S ? S(e) : e.nodeName);
1811
+ if (n === en.element) {
1812
+ let t = e, n = X(x ? x(e) : e.nodeName);
1813
1813
  try {
1814
1814
  t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
1815
1815
  } catch {}
1816
1816
  }
1817
- let r = _(e);
1817
+ let r = h(e);
1818
1818
  if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
1819
1819
  }
1820
1820
  }, yn = function _initDocument(e) {
1821
1821
  let n = null, r = null;
1822
1822
  if (Ne) e = "<remove></remove>" + e;
1823
1823
  else {
1824
- let t = gt(e, /^[\r\n\t ]+/);
1824
+ let t = bt(e, /^[\r\n\t ]+/);
1825
1825
  r = t && t[0];
1826
1826
  }
1827
- St === "application/xhtml+xml" && $e === Ze && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
1828
- let i = C ? ne(e) : e;
1829
- if ($e === Ze) try {
1830
- n = new c().parseFromString(i, St);
1827
+ dt === "application/xhtml+xml" && Qe === Ze && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
1828
+ let i = S ? re(e) : e;
1829
+ if (Qe === Ze) try {
1830
+ n = new c().parseFromString(i, dt);
1831
1831
  } catch {}
1832
1832
  if (!n || !n.documentElement) {
1833
- n = F.createDocument($e, "template", null);
1833
+ n = ae.createDocument(Qe, "template", null);
1834
1834
  try {
1835
- n.documentElement.innerHTML = et ? T : i;
1835
+ n.documentElement.innerHTML = $e ? C : i;
1836
1836
  } catch {}
1837
1837
  }
1838
1838
  let a = n.body || n.documentElement;
1839
- return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), $e === Ze ? R.call(n, ke ? "html" : "body")[0] : ke ? n.documentElement : a;
1839
+ return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), Qe === Ze ? I.call(n, ke ? "html" : "body")[0] : ke ? n.documentElement : a;
1840
1840
  }, bn = function _createNodeIterator(e) {
1841
- return I.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
1841
+ return oe.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
1842
1842
  }, xn = function _stripTemplateExpressions(e) {
1843
- return e = _t(e, oe, " "), e = _t(e, se, " "), e = _t(e, ce, " "), e;
1843
+ return e = xt(e, se, " "), e = xt(e, ce, " "), e = xt(e, H, " "), e;
1844
1844
  }, Sn = function _scrubTemplateExpressions(e) {
1845
1845
  e.normalize();
1846
- let t = I.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
1846
+ let t = oe.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
1847
1847
  for (; n;) n.data = xn(n.data), n = t.nextNode();
1848
1848
  let r = e.querySelectorAll?.call(e, "template");
1849
- r && ct(r, (e) => {
1849
+ r && ft(r, (e) => {
1850
1850
  wn(e.content) && Sn(e.content);
1851
1851
  });
1852
1852
  }, Cn = function _isClobbered(e) {
1853
- let t = S ? S(e) : null;
1854
- return typeof t != "string" || Z(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);
1853
+ let t = x ? x(e) : null;
1854
+ return typeof t != "string" || X(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ne(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== b(e) || e.childNodes !== h(e);
1855
1855
  }, wn = function _isDocumentFragment(e) {
1856
- if (!x || typeof e != "object" || !e) return !1;
1856
+ if (!b || typeof e != "object" || !e) return !1;
1857
1857
  try {
1858
- return x(e) === Zt.documentFragment;
1858
+ return b(e) === en.documentFragment;
1859
1859
  } catch {
1860
1860
  return !1;
1861
1861
  }
1862
1862
  }, Tn = function _isNode(e) {
1863
- if (!x || typeof e != "object" || !e) return !1;
1863
+ if (!b || typeof e != "object" || !e) return !1;
1864
1864
  try {
1865
- return typeof x(e) == "number";
1865
+ return typeof b(e) == "number";
1866
1866
  } catch {
1867
1867
  return !1;
1868
1868
  }
1869
1869
  };
1870
1870
  function _executeHooks(e, t, n) {
1871
- e.length !== 0 && ct(e, (e) => {
1872
- e.call(DOMPurify, t, n, nn);
1871
+ e.length !== 0 && ft(e, (e) => {
1872
+ e.call(DOMPurify, t, n, Tt);
1873
1873
  });
1874
1874
  }
1875
1875
  let En = function _isUnsafeNode(e, t) {
1876
- return !!(Oe && e.hasChildNodes() && !Tn(e.firstElementChild) && Q(qt, e.textContent) && Q(qt, e.innerHTML) || Oe && e.namespaceURI === Ze && t === "style" && Tn(e.firstElementChild) || e.nodeType === Zt.processingInstruction || Oe && e.nodeType === Zt.comment && Q(Jt, e.data));
1876
+ return !!(Oe && e.hasChildNodes() && !Tn(e.firstElementChild) && Q(Xt, e.textContent) && Q(Xt, e.innerHTML) || Oe && e.namespaceURI === Ze && t === "style" && Tn(e.firstElementChild) || e.nodeType === en.processingInstruction || Oe && e.nodeType === en.comment && Q(Zt, e.data));
1877
1877
  }, Dn = function _sanitizeDisallowedNode(e, t) {
1878
1878
  if (!ye[t] && jn(t) && (q.tagNameCheck instanceof RegExp && Q(q.tagNameCheck, t) || q.tagNameCheck instanceof Function && q.tagNameCheck(t))) return !1;
1879
1879
  if (Be && !Ue[t]) {
1880
- let t = v(e), n = _(e);
1880
+ let t = _(e), n = h(e);
1881
1881
  if (n && t) {
1882
1882
  let r = n.length;
1883
1883
  for (let i = r - 1; i >= 0; --i) {
1884
1884
  let r = Ve ? n[i] : p(n[i], !0);
1885
- t.insertBefore(r, h(e));
1885
+ t.insertBefore(r, te(e));
1886
1886
  }
1887
1887
  }
1888
1888
  }
1889
1889
  return pn(e), !0;
1890
1890
  }, On = function _sanitizeElements(e, t) {
1891
- if (_executeHooks(H.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
1891
+ if (_executeHooks(B.beforeSanitizeElements, e, null), e !== t && _(e) === null) return !0;
1892
1892
  if (Cn(e)) return pn(e), !0;
1893
- let n = Z(S ? S(e) : e.nodeName);
1894
- if (_executeHooks(H.uponSanitizeElement, e, {
1893
+ let n = X(x ? x(e) : e.nodeName);
1894
+ if (_executeHooks(B.uponSanitizeElement, e, {
1895
1895
  tagName: n,
1896
- allowedTags: G
1897
- }), e !== t && v(e) === null) return !0;
1896
+ allowedTags: W
1897
+ }), e !== t && _(e) === null) return !0;
1898
1898
  if (En(e, n)) return pn(e), !0;
1899
- if (ye[n] || !(Se.tagCheck instanceof Function && Se.tagCheck(n)) && !G[n]) {
1899
+ if (ye[n] || !(Se.tagCheck instanceof Function && Se.tagCheck(n)) && !W[n]) {
1900
1900
  let t = Dn(e, n);
1901
- return t === !1 && _executeHooks(H.afterSanitizeElements, e, null), t;
1901
+ return t === !1 && _executeHooks(B.afterSanitizeElements, e, null), t;
1902
1902
  }
1903
- if ((x ? x(e) : e.nodeType) === Zt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Q(Yt, e.innerHTML)) return pn(e), !0;
1904
- if (De && e.nodeType === Zt.text) {
1903
+ if ((b ? b(e) : e.nodeType) === en.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && Q(Qt, e.innerHTML)) return pn(e), !0;
1904
+ if (De && e.nodeType === en.text) {
1905
1905
  let t = xn(e.textContent);
1906
- e.textContent !== t && (dt(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
1906
+ e.textContent !== t && (ht(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
1907
1907
  }
1908
- return _executeHooks(H.afterSanitizeElements, e, null), !1;
1908
+ return _executeHooks(B.afterSanitizeElements, e, null), !1;
1909
1909
  }, kn = function _isValidAttribute(e, n, r) {
1910
- if (be[n] || Oe && n === "patchsrc" || Oe && n === "for" && e !== "label" && e !== "output" || Le && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
1910
+ if (be[n] || Oe && n === "patchsrc" || Oe && n === "for" && e !== "label" && e !== "output" || Le && (n === "id" || n === "name") && (r in t || r in Et)) return !1;
1911
1911
  let i = K[n] || Se.attributeCheck instanceof Function && Se.attributeCheck(n, e);
1912
1912
  if (!(we && Q(ue, n)) && !(Ce && Q(U, n))) {
1913
1913
  if (!i) {
1914
1914
  if (!(jn(e) && (q.tagNameCheck instanceof RegExp && Q(q.tagNameCheck, e) || q.tagNameCheck instanceof Function && q.tagNameCheck(e)) && (q.attributeNameCheck instanceof RegExp && Q(q.attributeNameCheck, n) || q.attributeNameCheck instanceof Function && q.attributeNameCheck(n, e)) || n === "is" && q.allowCustomizedBuiltInElements && (q.tagNameCheck instanceof RegExp && Q(q.tagNameCheck, r) || q.tagNameCheck instanceof Function && q.tagNameCheck(r)))) return !1;
1915
- } else if (!qe[n] && !Q(he, _t(r, pe, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && vt(r, "data:") === 0 && Ge[e]) && !(Te && !Q(de, _t(r, pe, ""))) && r) return !1;
1915
+ } else if (!qe[n] && !Q(_e, xt(r, pe, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && St(r, "data:") === 0 && Ge[e]) && !(Te && !Q(de, xt(r, pe, ""))) && r) return !1;
1916
1916
  }
1917
1917
  return !0;
1918
1918
  }, An = addToSet({}, [
@@ -1925,21 +1925,21 @@ function createDOMPurify() {
1925
1925
  "font-face-uri",
1926
1926
  "missing-glyph"
1927
1927
  ]), jn = function _isBasicCustomElement(e) {
1928
- return !An[mt(e)] && Q(W, e);
1928
+ return !An[vt(e)] && Q(he, e);
1929
1929
  }, Mn = function _applyTrustedTypesToAttribute(e, t, n, r) {
1930
- if (C && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
1931
- case "TrustedHTML": return ne(r);
1932
- case "TrustedScriptURL": return re(r);
1930
+ if (S && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
1931
+ case "TrustedHTML": return re(r);
1932
+ case "TrustedScriptURL": return M(r);
1933
1933
  }
1934
1934
  return r;
1935
1935
  }, Nn = function _setAttributeValue(e, t, n, r) {
1936
1936
  try {
1937
- n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), Cn(e) ? pn(e) : ut(DOMPurify.removed);
1937
+ n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), Cn(e) ? pn(e) : mt(DOMPurify.removed);
1938
1938
  } catch {
1939
1939
  hn(t, e);
1940
1940
  }
1941
1941
  }, Pn = function _sanitizeAttributes(e) {
1942
- _executeHooks(H.beforeSanitizeAttributes, e, null);
1942
+ _executeHooks(B.beforeSanitizeAttributes, e, null);
1943
1943
  let t = e.attributes;
1944
1944
  if (!t || Cn(e)) return;
1945
1945
  let n = {
@@ -1948,14 +1948,14 @@ function createDOMPurify() {
1948
1948
  keepAttr: !0,
1949
1949
  allowedAttributes: K,
1950
1950
  forceKeepAttr: void 0
1951
- }, r = t.length, i = Z(e.nodeName);
1951
+ }, r = t.length, i = X(e.nodeName);
1952
1952
  for (; r--;) {
1953
- let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = Z(o), f = c, p = o === "value" ? f : yt(f);
1954
- if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(H.uponSanitizeAttribute, e, n), p = n.attrValue, Re && (u === "id" || u === "name") && vt(p, ze) !== 0 && (hn(o, e), p = ze + p), Oe && Q(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
1953
+ let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = X(o), f = c, p = o === "value" ? f : Ct(f);
1954
+ if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(B.uponSanitizeAttribute, e, n), p = n.attrValue, Re && (u === "id" || u === "name") && St(p, ze) !== 0 && (hn(o, e), p = ze + p), Oe && Q(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
1955
1955
  hn(o, e);
1956
1956
  continue;
1957
1957
  }
1958
- if (u === "attributename" && gt(p, "href")) {
1958
+ if (u === "attributename" && bt(p, "href")) {
1959
1959
  hn(o, e);
1960
1960
  continue;
1961
1961
  }
@@ -1964,7 +1964,7 @@ function createDOMPurify() {
1964
1964
  hn(o, e);
1965
1965
  continue;
1966
1966
  }
1967
- if (!Ee && Q(Xt, p)) {
1967
+ if (!Ee && Q($t, p)) {
1968
1968
  hn(o, e);
1969
1969
  continue;
1970
1970
  }
@@ -1975,14 +1975,14 @@ function createDOMPurify() {
1975
1975
  p = Mn(i, u, s, p), p !== f && Nn(e, o, s, p);
1976
1976
  }
1977
1977
  }
1978
- _executeHooks(H.afterSanitizeAttributes, e, null);
1978
+ _executeHooks(B.afterSanitizeAttributes, e, null);
1979
1979
  }, Fn = function _sanitizeShadowDOM(e) {
1980
1980
  let t = null, n = bn(e);
1981
- for (_executeHooks(H.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(H.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (x ? x(t) : t.nodeType) === Zt.element) {
1982
- let e = te(t);
1981
+ for (_executeHooks(B.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(B.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (b ? b(t) : t.nodeType) === en.element) {
1982
+ let e = v(t);
1983
1983
  wn(e) && (In(e), Fn(e));
1984
1984
  }
1985
- _executeHooks(H.afterSanitizeShadowDOM, e, null);
1985
+ _executeHooks(B.afterSanitizeShadowDOM, e, null);
1986
1986
  }, In = function _sanitizeAttachedShadowRoots(e) {
1987
1987
  let t = [{
1988
1988
  node: e,
@@ -1994,14 +1994,14 @@ function createDOMPurify() {
1994
1994
  Fn(e.shadow);
1995
1995
  continue;
1996
1996
  }
1997
- let n = e.node, r = (x ? x(n) : n.nodeType) === Zt.element, i = _(n);
1997
+ let n = e.node, r = (b ? b(n) : n.nodeType) === en.element, i = h(n);
1998
1998
  if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
1999
1999
  node: i[e],
2000
2000
  shadow: null
2001
2001
  });
2002
2002
  if (r) {
2003
- let e = S ? S(n) : null;
2004
- if (typeof e == "string" && Z(e) === "template") {
2003
+ let e = x ? x(n) : null;
2004
+ if (typeof e == "string" && X(e) === "template") {
2005
2005
  let e = n.content;
2006
2006
  wn(e) && t.push({
2007
2007
  node: e,
@@ -2010,7 +2010,7 @@ function createDOMPurify() {
2010
2010
  }
2011
2011
  }
2012
2012
  if (r) {
2013
- let e = te(n);
2013
+ let e = v(n);
2014
2014
  wn(e) && t.push({
2015
2015
  node: null,
2016
2016
  shadow: e
@@ -2023,73 +2023,73 @@ function createDOMPurify() {
2023
2023
  };
2024
2024
  return DOMPurify.sanitize = function(e) {
2025
2025
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
2026
- if (et = !e, et && (e = "<!-->"), typeof e != "string" && !Tn(e) && (e = stringifyValue(e), typeof e != "string")) throw Tt("dirty is not a string, aborting");
2026
+ if ($e = !e, $e && (e = "<!-->"), typeof e != "string" && !Tn(e) && (e = stringifyValue(e), typeof e != "string")) throw Ot("dirty is not a string, aborting");
2027
2027
  if (!DOMPurify.isSupported) return e;
2028
- Ae ? (G = je, K = Me) : on(t), (H.uponSanitizeElement.length > 0 || H.uponSanitizeAttribute.length > 0) && (G = clone(G)), H.uponSanitizeAttribute.length > 0 && (K = clone(K)), DOMPurify.removed = [];
2028
+ Ae ? (W = je, K = Me) : on(t), (B.uponSanitizeElement.length > 0 || B.uponSanitizeAttribute.length > 0) && (W = clone(W)), B.uponSanitizeAttribute.length > 0 && (K = clone(K)), DOMPurify.removed = [];
2029
2029
  let s = Ve && typeof e != "string" && Tn(e);
2030
2030
  if (s) {
2031
2031
  vn(e);
2032
- let t = S ? S(e) : e.nodeName;
2032
+ let t = x ? x(e) : e.nodeName;
2033
2033
  if (typeof t == "string") {
2034
- let n = Z(t);
2035
- if (!G[n] || ye[n]) throw mn(e), Tt("root node is forbidden and cannot be sanitized in-place");
2034
+ let n = X(t);
2035
+ if (!W[n] || ye[n]) throw mn(e), Ot("root node is forbidden and cannot be sanitized in-place");
2036
2036
  }
2037
- if (Cn(e)) throw mn(e), Tt("root node is clobbered and cannot be sanitized in-place");
2037
+ if (Cn(e)) throw mn(e), Ot("root node is clobbered and cannot be sanitized in-place");
2038
2038
  try {
2039
2039
  In(e);
2040
2040
  } catch (t) {
2041
2041
  throw mn(e), t;
2042
2042
  }
2043
- } else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === Zt.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), In(i);
2043
+ } else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === en.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), In(i);
2044
2044
  else {
2045
- if (!Pe && !De && !ke && e.indexOf("<") === -1) return C && Ie ? ne(e) : e;
2046
- if (r = yn(e), !r) return Pe ? null : Ie ? T : "";
2045
+ if (!Pe && !De && !ke && e.indexOf("<") === -1) return S && Ie ? re(e) : e;
2046
+ if (r = yn(e), !r) return Pe ? null : Ie ? C : "";
2047
2047
  }
2048
2048
  r && Ne && pn(r.firstChild);
2049
2049
  let c = s ? e : r, u = bn(c);
2050
2050
  try {
2051
2051
  for (; a = u.nextNode();) On(a, c), Pn(a), wn(a.content) && Fn(a.content);
2052
2052
  } catch (t) {
2053
- throw s && (mn(e), ct(DOMPurify.removed, (e) => {
2053
+ throw s && (mn(e), ft(DOMPurify.removed, (e) => {
2054
2054
  e.element && _n(e.element);
2055
2055
  })), t;
2056
2056
  }
2057
- if (s) return ct(DOMPurify.removed, (e) => {
2057
+ if (s) return ft(DOMPurify.removed, (e) => {
2058
2058
  e.element && _n(e.element);
2059
2059
  }), De && Sn(e), e;
2060
2060
  if (Pe) {
2061
- if (De && Sn(r), Fe) for (o = ae.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
2061
+ if (De && Sn(r), Fe) for (o = F.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
2062
2062
  else o = r;
2063
- return (K.shadowroot || K.shadowrootmode) && (o = B.call(n, o, !0)), o;
2063
+ return (K.shadowroot || K.shadowrootmode) && (o = R.call(n, o, !0)), o;
2064
2064
  }
2065
2065
  let f = ke ? r.outerHTML : r.innerHTML;
2066
- return ke && G["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Q(Gt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), De && (f = xn(f)), C && Ie ? ne(f) : f;
2066
+ return ke && W["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && Q(Jt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), De && (f = xn(f)), S && Ie ? re(f) : f;
2067
2067
  }, DOMPurify.setConfig = function() {
2068
2068
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2069
- on(e), Ae = !0, je = G, Me = K;
2069
+ on(e), Ae = !0, je = W, Me = K;
2070
2070
  }, DOMPurify.clearConfig = function() {
2071
- nn = null, Ae = !1, je = null, Me = null, C = k, T = "";
2071
+ Tt = null, Ae = !1, je = null, Me = null, S = T, C = "";
2072
2072
  }, DOMPurify.isValidAttribute = function(e, t, n) {
2073
- nn || on({});
2074
- let r = Z(e), i = Z(t);
2073
+ Tt || on({});
2074
+ let r = X(e), i = X(t);
2075
2075
  return kn(r, i, n);
2076
2076
  }, DOMPurify.addHook = function(e, t) {
2077
- typeof t == "function" && wt(H, e) && dt(H[e], t);
2077
+ typeof t == "function" && Z(B, e) && ht(B[e], t);
2078
2078
  }, DOMPurify.removeHook = function(e, t) {
2079
- if (wt(H, e)) {
2079
+ if (Z(B, e)) {
2080
2080
  if (t !== void 0) {
2081
- let n = lt(H[e], t);
2082
- return n === -1 ? void 0 : ft(H[e], n, 1)[0];
2081
+ let n = pt(B[e], t);
2082
+ return n === -1 ? void 0 : gt(B[e], n, 1)[0];
2083
2083
  }
2084
- return ut(H[e]);
2084
+ return mt(B[e]);
2085
2085
  }
2086
2086
  }, DOMPurify.removeHooks = function(e) {
2087
- wt(H, e) && (H[e] = []);
2087
+ Z(B, e) && (B[e] = []);
2088
2088
  }, DOMPurify.removeAllHooks = function() {
2089
- H = en();
2089
+ B = rn();
2090
2090
  }, DOMPurify;
2091
2091
  }
2092
- var nn = createDOMPurify(), _Class;
2092
+ var on = createDOMPurify(), _Class;
2093
2093
  function z() {
2094
2094
  return {
2095
2095
  async: !1,
@@ -2104,11 +2104,11 @@ function z() {
2104
2104
  walkTokens: null
2105
2105
  };
2106
2106
  }
2107
- var rn = z();
2107
+ var sn = z();
2108
2108
  function N(e) {
2109
- rn = e;
2109
+ sn = e;
2110
2110
  }
2111
- var an = { exec: () => null };
2111
+ var cn = { exec: () => null };
2112
2112
  function E(e) {
2113
2113
  let t = [];
2114
2114
  return (n) => {
@@ -2120,19 +2120,19 @@ function d(e, t = "") {
2120
2120
  let n = typeof e == "string" ? e : e.source, r = {
2121
2121
  replace: (e, t) => {
2122
2122
  let i = typeof t == "string" ? t : t.source;
2123
- return i = i.replace(sn.caret, "$1"), n = n.replace(e, i), r;
2123
+ return i = i.replace(un.caret, "$1"), n = n.replace(e, i), r;
2124
2124
  },
2125
2125
  getRegex: () => new RegExp(n, t)
2126
2126
  };
2127
2127
  return r;
2128
2128
  }
2129
- var on = ((e = "") => {
2129
+ var ln = ((e = "") => {
2130
2130
  try {
2131
2131
  return !!RegExp("(?<=1)(?<!1)" + e);
2132
2132
  } catch {
2133
2133
  return !1;
2134
2134
  }
2135
- })(), sn = {
2135
+ })(), un = {
2136
2136
  codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
2137
2137
  outputLinkReplace: /\\([\[\]])/g,
2138
2138
  indentCodeCompensation: /^(\s+)(?:```)/,
@@ -2189,112 +2189,112 @@ var on = ((e = "") => {
2189
2189
  headingBeginRegex: E((e) => RegExp(`^ {0,${e}}#`)),
2190
2190
  htmlBeginRegex: E((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
2191
2191
  blockquoteBeginRegex: E((e) => RegExp(`^ {0,${e}}>`))
2192
- }, cn = /^(?:[ \t]*(?:\n|$))+/, ln = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, un = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, dn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, fn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, pn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, mn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, hn = d(mn).replace(/bull/g, pn).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(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), gn = d(mn).replace(/bull/g, pn).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(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), _n = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, vn = /^[^\n]+/, yn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, bn = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", yn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), xn = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, pn).getRegex(), Sn = "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", Cn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, wn = d("^ {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][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Cn).replace("tag", Sn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (e) => d(_n).replace("hr", dn).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", Sn).getRegex(), Tn = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), En = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Dn = {
2193
- blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", En).getRegex(),
2194
- code: ln,
2195
- def: bn,
2196
- fences: un,
2197
- heading: fn,
2198
- hr: dn,
2199
- html: wn,
2200
- lheading: hn,
2201
- list: xn,
2202
- newline: cn,
2203
- paragraph: Tn,
2204
- table: an,
2205
- text: vn
2206
- }, On = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", dn).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", Sn).getRegex(), kn = {
2207
- ...Dn,
2208
- lheading: gn,
2209
- table: On,
2210
- paragraph: d(_n).replace("hr", dn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", On).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", Sn).getRegex()
2211
- }, An = {
2212
- ...Dn,
2213
- html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Cn).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(),
2192
+ }, dn = /^(?:[ \t]*(?:\n|$))+/, fn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, pn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, mn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, hn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, gn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, _n = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, vn = d(_n).replace(/bull/g, gn).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(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), yn = d(_n).replace(/bull/g, gn).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(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), bn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, xn = /^[^\n]+/, Sn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Cn = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Sn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), wn = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, gn).getRegex(), Tn = "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", En = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Dn = d("^ {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][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", En).replace("tag", Tn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (e) => d(bn).replace("hr", mn).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", Tn).getRegex(), On = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), kn = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), An = {
2193
+ blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", kn).getRegex(),
2194
+ code: fn,
2195
+ def: Cn,
2196
+ fences: pn,
2197
+ heading: hn,
2198
+ hr: mn,
2199
+ html: Dn,
2200
+ lheading: vn,
2201
+ list: wn,
2202
+ newline: dn,
2203
+ paragraph: On,
2204
+ table: cn,
2205
+ text: xn
2206
+ }, jn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", mn).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", Tn).getRegex(), Mn = {
2207
+ ...An,
2208
+ lheading: yn,
2209
+ table: jn,
2210
+ paragraph: d(bn).replace("hr", mn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", jn).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", Tn).getRegex()
2211
+ }, Nn = {
2212
+ ...An,
2213
+ html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", En).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(),
2214
2214
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
2215
2215
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
2216
- fences: an,
2216
+ fences: cn,
2217
2217
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
2218
- paragraph: d(_n).replace("hr", dn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", hn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2219
- }, jn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Mn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Nn = /^( {2,}|\\)\n(?!\s*$)/, Pn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Fn = /[\p{P}\p{S}]/u, In = /[\s\p{P}\p{S}]/u, Ln = /[^\s\p{P}\p{S}]/u, Rn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, In).getRegex(), zn = /(?!~)[\p{P}\p{S}]/u, Bn = /(?!~)[\s\p{P}\p{S}]/u, Vn = /(?:[^\s\p{P}\p{S}]|~)/u, Hn = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", on ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Un = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Wn = d(Un, "u").replace(/punct/g, Fn).getRegex(), Gn = d(Un, "u").replace(/punct/g, zn).getRegex(), Kn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", qn = d(Kn, "gu").replace(/notPunctSpace/g, Ln).replace(/punctSpace/g, In).replace(/punct/g, Fn).getRegex(), Jn = d(Kn, "gu").replace(/notPunctSpace/g, Vn).replace(/punctSpace/g, Bn).replace(/punct/g, zn).getRegex(), Yn = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Ln).replace(/punctSpace/g, In).replace(/punct/g, Fn).getRegex(), Xn = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Fn).getRegex(), Zn = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Ln).replace(/punctSpace/g, In).replace(/punct/g, Fn).getRegex(), Qn = d(/\\(punct)/, "gu").replace(/punct/g, Fn).getRegex(), $n = d(/^<(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(), er = d(Cn).replace("(?:-->|$)", "-->").getRegex(), tr = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", er).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), nr = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, rr = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", nr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ir = d(/^!?\[(label)\]\[(ref)\]/).replace("label", nr).replace("ref", yn).getRegex(), ar = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", yn).getRegex(), or = d("reflink|nolink(?!\\()", "g").replace("reflink", ir).replace("nolink", ar).getRegex(), sr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, cr = {
2220
- _backpedal: an,
2221
- anyPunctuation: Qn,
2222
- autolink: $n,
2223
- blockSkip: Hn,
2224
- br: Nn,
2225
- code: Mn,
2226
- del: an,
2227
- delLDelim: an,
2228
- delRDelim: an,
2229
- emStrongLDelim: Wn,
2230
- emStrongRDelimAst: qn,
2231
- emStrongRDelimUnd: Yn,
2232
- escape: jn,
2233
- link: rr,
2234
- nolink: ar,
2235
- punctuation: Rn,
2236
- reflink: ir,
2237
- reflinkSearch: or,
2238
- tag: tr,
2239
- text: Pn,
2240
- url: an
2241
- }, lr = {
2242
- ...cr,
2243
- link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", nr).getRegex(),
2244
- reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", nr).getRegex()
2245
- }, ur = {
2246
- ...cr,
2247
- emStrongRDelimAst: Jn,
2248
- emStrongLDelim: Gn,
2249
- delLDelim: Xn,
2250
- delRDelim: Zn,
2251
- url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", sr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
2252
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
2253
- del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
2254
- text: d(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", sr).getRegex()
2255
- }, dr = {
2256
- ...ur,
2257
- br: d(Nn).replace("{2,}", "*").getRegex(),
2258
- text: d(ur.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2218
+ paragraph: d(bn).replace("hr", mn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", vn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2219
+ }, Pn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Fn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, In = /^( {2,}|\\)\n(?!\s*$)/, Ln = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Rn = /[\p{P}\p{S}]/u, zn = /[\s\p{P}\p{S}]/u, Bn = /[^\s\p{P}\p{S}]/u, Vn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, zn).getRegex(), Hn = /(?!~)[\p{P}\p{S}]/u, Un = /(?!~)[\s\p{P}\p{S}]/u, Wn = /(?:[^\s\p{P}\p{S}]|~)/u, Gn = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ln ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Kn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, qn = d(Kn, "u").replace(/punct/g, Rn).getRegex(), Jn = d(Kn, "u").replace(/punct/g, Hn).getRegex(), Yn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Xn = d(Yn, "gu").replace(/notPunctSpace/g, Bn).replace(/punctSpace/g, zn).replace(/punct/g, Rn).getRegex(), Zn = d(Yn, "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, Un).replace(/punct/g, Hn).getRegex(), Qn = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Bn).replace(/punctSpace/g, zn).replace(/punct/g, Rn).getRegex(), $n = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Rn).getRegex(), er = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Bn).replace(/punctSpace/g, zn).replace(/punct/g, Rn).getRegex(), tr = d(/\\(punct)/, "gu").replace(/punct/g, Rn).getRegex(), nr = d(/^<(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(), rr = d(En).replace("(?:-->|$)", "-->").getRegex(), ir = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", rr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), ar = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, or = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", ar).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), sr = d(/^!?\[(label)\]\[(ref)\]/).replace("label", ar).replace("ref", Sn).getRegex(), cr = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", Sn).getRegex(), lr = d("reflink|nolink(?!\\()", "g").replace("reflink", sr).replace("nolink", cr).getRegex(), ur = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, dr = {
2220
+ _backpedal: cn,
2221
+ anyPunctuation: tr,
2222
+ autolink: nr,
2223
+ blockSkip: Gn,
2224
+ br: In,
2225
+ code: Fn,
2226
+ del: cn,
2227
+ delLDelim: cn,
2228
+ delRDelim: cn,
2229
+ emStrongLDelim: qn,
2230
+ emStrongRDelimAst: Xn,
2231
+ emStrongRDelimUnd: Qn,
2232
+ escape: Pn,
2233
+ link: or,
2234
+ nolink: cr,
2235
+ punctuation: Vn,
2236
+ reflink: sr,
2237
+ reflinkSearch: lr,
2238
+ tag: ir,
2239
+ text: Ln,
2240
+ url: cn
2259
2241
  }, fr = {
2260
- normal: Dn,
2261
- gfm: kn,
2262
- pedantic: An
2242
+ ...dr,
2243
+ link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", ar).getRegex(),
2244
+ reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", ar).getRegex()
2263
2245
  }, pr = {
2264
- normal: cr,
2265
- gfm: ur,
2266
- breaks: dr,
2267
- pedantic: lr
2246
+ ...dr,
2247
+ emStrongRDelimAst: Zn,
2248
+ emStrongLDelim: Jn,
2249
+ delLDelim: $n,
2250
+ delRDelim: er,
2251
+ url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ur).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
2252
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
2253
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
2254
+ text: d(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ur).getRegex()
2268
2255
  }, mr = {
2256
+ ...pr,
2257
+ br: d(In).replace("{2,}", "*").getRegex(),
2258
+ text: d(pr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2259
+ }, hr = {
2260
+ normal: An,
2261
+ gfm: Mn,
2262
+ pedantic: Nn
2263
+ }, gr = {
2264
+ normal: dr,
2265
+ gfm: pr,
2266
+ breaks: mr,
2267
+ pedantic: fr
2268
+ }, _r = {
2269
2269
  "&": "&amp;",
2270
2270
  "<": "&lt;",
2271
2271
  ">": "&gt;",
2272
2272
  "\"": "&quot;",
2273
2273
  "'": "&#39;"
2274
- }, ge = (e) => mr[e];
2274
+ }, ge = (e) => _r[e];
2275
2275
  function O(e, t) {
2276
2276
  if (t) {
2277
- if (sn.escapeTest.test(e)) return e.replace(sn.escapeReplace, ge);
2278
- } else if (sn.escapeTestNoEncode.test(e)) return e.replace(sn.escapeReplaceNoEncode, ge);
2277
+ if (un.escapeTest.test(e)) return e.replace(un.escapeReplace, ge);
2278
+ } else if (un.escapeTestNoEncode.test(e)) return e.replace(un.escapeReplaceNoEncode, ge);
2279
2279
  return e;
2280
2280
  }
2281
2281
  function V(e) {
2282
2282
  try {
2283
- e = encodeURI(e).replace(sn.percentDecode, "%");
2283
+ e = encodeURI(e).replace(un.percentDecode, "%");
2284
2284
  } catch {
2285
2285
  return null;
2286
2286
  }
2287
2287
  return e;
2288
2288
  }
2289
2289
  function Y(e, t) {
2290
- let n = e.replace(sn.findPipe, (e, t, n) => {
2290
+ let n = e.replace(un.findPipe, (e, t, n) => {
2291
2291
  let r = !1, i = t;
2292
2292
  for (; --i >= 0 && n[i] === "\\";) r = !r;
2293
2293
  return r ? "|" : " |";
2294
- }).split(sn.splitPipe), r = 0;
2294
+ }).split(un.splitPipe), r = 0;
2295
2295
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
2296
2296
  else for (; n.length < t;) n.push("");
2297
- for (; r < n.length; r++) n[r] = n[r].trim().replace(sn.slashPipe, "|");
2297
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(un.slashPipe, "|");
2298
2298
  return n;
2299
2299
  }
2300
2300
  function $(e, t, n) {
@@ -2311,7 +2311,7 @@ function $(e, t, n) {
2311
2311
  }
2312
2312
  function ee(e) {
2313
2313
  let t = e.split("\n"), n = t.length - 1;
2314
- for (; n >= 0 && sn.blankLine.test(t[n]);) n--;
2314
+ for (; n >= 0 && un.blankLine.test(t[n]);) n--;
2315
2315
  return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
2316
2316
  }
2317
2317
  function fe(e, t) {
@@ -2356,7 +2356,7 @@ function ot(e, t, n) {
2356
2356
  }
2357
2357
  var w = class {
2358
2358
  constructor(e) {
2359
- t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e || rn;
2359
+ n(this, "options", void 0), n(this, "rules", void 0), n(this, "lexer", void 0), this.options = e || sn;
2360
2360
  }
2361
2361
  space(e) {
2362
2362
  let t = this.rules.block.newline.exec(e);
@@ -2470,14 +2470,14 @@ ${c}` : c;
2470
2470
  if (this.options.pedantic ? (p = 2, s = c.trimStart()) : f ? p = t[1].length + 1 : (p = c.search(this.rules.other.nonSpaceChar), p = p > 4 ? 1 : p, s = c.slice(p), p += t[1].length), f && this.rules.other.blankLine.test(u) && (r += u + "\n", e = e.substring(u.length + 1), n = !0), !n) {
2471
2471
  let t = this.rules.other.nextBulletRegex(p), n = this.rules.other.hrRegex(p), i = this.rules.other.fencesBeginRegex(p), a = this.rules.other.headingBeginRegex(p), o = this.rules.other.htmlBeginRegex(p), m = this.rules.other.blockquoteBeginRegex(p);
2472
2472
  for (; e;) {
2473
- let h = e.split("\n", 1)[0], _;
2474
- if (u = h, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), _ = u) : _ = u.replace(this.rules.other.tabCharGlobal, " "), i.test(u) || a.test(u) || o.test(u) || m.test(u) || t.test(u) || n.test(u)) break;
2475
- if (_.search(this.rules.other.nonSpaceChar) >= p || !u.trim()) s += "\n" + _.slice(p);
2473
+ let te = e.split("\n", 1)[0], h;
2474
+ if (u = te, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), h = u) : h = u.replace(this.rules.other.tabCharGlobal, " "), i.test(u) || a.test(u) || o.test(u) || m.test(u) || t.test(u) || n.test(u)) break;
2475
+ if (h.search(this.rules.other.nonSpaceChar) >= p || !u.trim()) s += "\n" + h.slice(p);
2476
2476
  else {
2477
2477
  if (f || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
2478
2478
  s += "\n" + u;
2479
2479
  }
2480
- f = !u.trim(), r += h + "\n", e = e.substring(h.length + 1), c = _.slice(p);
2480
+ f = !u.trim(), r += te + "\n", e = e.substring(te.length + 1), c = h.slice(p);
2481
2481
  }
2482
2482
  }
2483
2483
  i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
@@ -2806,24 +2806,24 @@ ${c}` : c;
2806
2806
  };
2807
2807
  }
2808
2808
  }
2809
- }, hr = class l {
2809
+ }, vr = class l {
2810
2810
  constructor(e) {
2811
- 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 || rn, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2811
+ n(this, "tokens", void 0), n(this, "options", void 0), n(this, "state", void 0), n(this, "inlineQueue", void 0), n(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || sn, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2812
2812
  inLink: !1,
2813
2813
  inRawBlock: !1,
2814
2814
  top: !0
2815
2815
  };
2816
- let n = {
2817
- other: sn,
2818
- block: fr.normal,
2819
- inline: pr.normal
2816
+ let t = {
2817
+ other: un,
2818
+ block: hr.normal,
2819
+ inline: gr.normal
2820
2820
  };
2821
- this.options.pedantic ? (n.block = fr.pedantic, n.inline = pr.pedantic) : this.options.gfm && (n.block = fr.gfm, this.options.breaks ? n.inline = pr.breaks : n.inline = pr.gfm), this.tokenizer.rules = n;
2821
+ this.options.pedantic ? (t.block = hr.pedantic, t.inline = gr.pedantic) : this.options.gfm && (t.block = hr.gfm, this.options.breaks ? t.inline = gr.breaks : t.inline = gr.gfm), this.tokenizer.rules = t;
2822
2822
  }
2823
2823
  static get rules() {
2824
2824
  return {
2825
- block: fr,
2826
- inline: pr
2825
+ block: hr,
2826
+ inline: gr
2827
2827
  };
2828
2828
  }
2829
2829
  static lex(e, t) {
@@ -2833,7 +2833,7 @@ ${c}` : c;
2833
2833
  return new l(t).inlineTokens(e);
2834
2834
  }
2835
2835
  lex(e) {
2836
- e = e.replace(sn.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
2836
+ e = e.replace(un.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
2837
2837
  for (let e = 0; e < this.inlineQueue.length; e++) {
2838
2838
  let t = this.inlineQueue[e];
2839
2839
  this.inlineTokens(t.src, t.tokens);
@@ -2841,7 +2841,7 @@ ${c}` : c;
2841
2841
  return this.inlineQueue = [], this.tokens;
2842
2842
  }
2843
2843
  blockTokens(e, t = [], n = !1) {
2844
- this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(sn.tabCharGlobal, " ").replace(sn.spaceLine, ""));
2844
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(un.tabCharGlobal, " ").replace(un.spaceLine, ""));
2845
2845
  let r = Infinity;
2846
2846
  for (; e;) {
2847
2847
  if (e.length < r) r = e.length;
@@ -3025,13 +3025,13 @@ ${c}` : c;
3025
3025
  }
3026
3026
  }, y = class {
3027
3027
  constructor(e) {
3028
- t(this, "options", void 0), t(this, "parser", void 0), this.options = e || rn;
3028
+ n(this, "options", void 0), n(this, "parser", void 0), this.options = e || sn;
3029
3029
  }
3030
3030
  space(e) {
3031
3031
  return "";
3032
3032
  }
3033
3033
  code({ text: e, lang: t, escaped: n }) {
3034
- let r = (t || "").match(sn.notSpaceStart)?.[0], i = e.replace(sn.endingNewline, "") + "\n";
3034
+ let r = (t || "").match(un.notSpaceStart)?.[0], i = e.replace(un.endingNewline, "") + "\n";
3035
3035
  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";
3036
3036
  }
3037
3037
  blockquote({ tokens: e }) {
@@ -3159,9 +3159,9 @@ ${e}</tr>
3159
3159
  checkbox({ raw: e }) {
3160
3160
  return e;
3161
3161
  }
3162
- }, gr = class l {
3162
+ }, yr = class l {
3163
3163
  constructor(e) {
3164
- t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e || rn, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
3164
+ n(this, "options", void 0), n(this, "renderer", void 0), n(this, "textRenderer", void 0), this.options = e || sn, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
3165
3165
  }
3166
3166
  static parse(e, t) {
3167
3167
  return new l(t).parse(e);
@@ -3307,9 +3307,9 @@ ${e}</tr>
3307
3307
  }
3308
3308
  return n;
3309
3309
  }
3310
- }, _r = (_Class = class {
3310
+ }, br = (_Class = class {
3311
3311
  constructor(e) {
3312
- t(this, "options", void 0), t(this, "block", void 0), this.options = e || rn;
3312
+ n(this, "options", void 0), n(this, "block", void 0), this.options = e || sn;
3313
3313
  }
3314
3314
  preprocess(e) {
3315
3315
  return e;
@@ -3324,23 +3324,23 @@ ${e}</tr>
3324
3324
  return e;
3325
3325
  }
3326
3326
  provideLexer(e = this.block) {
3327
- return e ? hr.lex : hr.lexInline;
3327
+ return e ? vr.lex : vr.lexInline;
3328
3328
  }
3329
3329
  provideParser(e = this.block) {
3330
- return e ? gr.parse : gr.parseInline;
3330
+ return e ? yr.parse : yr.parseInline;
3331
3331
  }
3332
- }, t(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
3332
+ }, n(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
3333
3333
  "preprocess",
3334
3334
  "postprocess",
3335
3335
  "processAllTokens",
3336
3336
  "emStrongMask"
3337
- ])), t(_Class, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set([
3337
+ ])), n(_Class, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set([
3338
3338
  "preprocess",
3339
3339
  "postprocess",
3340
3340
  "processAllTokens"
3341
3341
  ])), _Class), D = class {
3342
3342
  constructor(...e) {
3343
- t(this, "defaults", z()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser", gr), t(this, "Renderer", y), t(this, "TextRenderer", L), t(this, "Lexer", hr), t(this, "Tokenizer", w), t(this, "Hooks", _r), this.use(...e);
3343
+ n(this, "defaults", z()), n(this, "options", this.setOptions), n(this, "parse", this.parseMarkdown(!0)), n(this, "parseInline", this.parseMarkdown(!1)), n(this, "Parser", yr), n(this, "Renderer", y), n(this, "TextRenderer", L), n(this, "Lexer", vr), n(this, "Tokenizer", w), n(this, "Hooks", br), this.use(...e);
3344
3344
  }
3345
3345
  walkTokens(e, t) {
3346
3346
  let n = [];
@@ -3419,13 +3419,13 @@ ${e}</tr>
3419
3419
  n.tokenizer = t;
3420
3420
  }
3421
3421
  if (e.hooks) {
3422
- let t = this.defaults.hooks || new _r();
3422
+ let t = this.defaults.hooks || new br();
3423
3423
  for (let n in e.hooks) {
3424
3424
  if (!(n in t)) throw Error(`hook '${n}' does not exist`);
3425
3425
  if (["options", "block"].includes(n)) continue;
3426
3426
  let r = n, i = e.hooks[r], a = t[r];
3427
- _r.passThroughHooks.has(n) ? t[r] = (e) => {
3428
- if (this.defaults.async && _r.passThroughHooksRespectAsync.has(n)) return (async () => {
3427
+ br.passThroughHooks.has(n) ? t[r] = (e) => {
3428
+ if (this.defaults.async && br.passThroughHooksRespectAsync.has(n)) return (async () => {
3429
3429
  let n = await i.call(t, e);
3430
3430
  return a.call(t, n);
3431
3431
  })();
@@ -3462,10 +3462,10 @@ ${e}</tr>
3462
3462
  }, this;
3463
3463
  }
3464
3464
  lexer(e, t) {
3465
- return hr.lex(e, t ?? this.defaults);
3465
+ return vr.lex(e, t ?? this.defaults);
3466
3466
  }
3467
3467
  parser(e, t) {
3468
- return gr.parse(e, t ?? this.defaults);
3468
+ return yr.parse(e, t ?? this.defaults);
3469
3469
  }
3470
3470
  parseMarkdown(e) {
3471
3471
  return (t, n) => {
@@ -3477,16 +3477,16 @@ ${e}</tr>
3477
3477
  if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
3478
3478
  if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
3479
3479
  if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
3480
- let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? hr.lex : hr.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
3480
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? vr.lex : vr.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
3481
3481
  i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
3482
- let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? gr.parse : gr.parseInline)(a, i);
3482
+ let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? yr.parse : yr.parseInline)(a, i);
3483
3483
  return i.hooks ? await i.hooks.postprocess(o) : o;
3484
3484
  })().catch(a);
3485
3485
  try {
3486
3486
  i.hooks && (t = i.hooks.preprocess(t));
3487
- let n = (i.hooks ? i.hooks.provideLexer(e) : e ? hr.lex : hr.lexInline)(t, i);
3487
+ let n = (i.hooks ? i.hooks.provideLexer(e) : e ? vr.lex : vr.lexInline)(t, i);
3488
3488
  i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
3489
- let r = (i.hooks ? i.hooks.provideParser(e) : e ? gr.parse : gr.parseInline)(n, i);
3489
+ let r = (i.hooks ? i.hooks.provideParser(e) : e ? yr.parse : yr.parseInline)(n, i);
3490
3490
  return i.hooks && (r = i.hooks.postprocess(r)), r;
3491
3491
  } catch (e) {
3492
3492
  return a(e);
@@ -3503,20 +3503,20 @@ ${e}</tr>
3503
3503
  throw n;
3504
3504
  };
3505
3505
  }
3506
- }, vr = new D();
3506
+ }, xr = new D();
3507
3507
  function g(e, t) {
3508
- return vr.parse(e, t);
3508
+ return xr.parse(e, t);
3509
3509
  }
3510
3510
  g.options = g.setOptions = function(e) {
3511
- return vr.setOptions(e), g.defaults = vr.defaults, N(g.defaults), g;
3512
- }, g.getDefaults = z, g.defaults = rn, g.use = function(...e) {
3513
- return vr.use(...e), g.defaults = vr.defaults, N(g.defaults), g;
3511
+ return xr.setOptions(e), g.defaults = xr.defaults, N(g.defaults), g;
3512
+ }, g.getDefaults = z, g.defaults = sn, g.use = function(...e) {
3513
+ return xr.use(...e), g.defaults = xr.defaults, N(g.defaults), g;
3514
3514
  }, g.walkTokens = function(e, t) {
3515
- return vr.walkTokens(e, t);
3516
- }, g.parseInline = vr.parseInline, g.Parser = gr, g.parser = gr.parse, g.Renderer = y, g.TextRenderer = L, g.Lexer = hr, g.lexer = hr.lex, g.Tokenizer = w, g.Hooks = _r, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, gr.parse, hr.lex;
3515
+ return xr.walkTokens(e, t);
3516
+ }, g.parseInline = xr.parseInline, g.Parser = yr, g.parser = yr.parse, g.Renderer = y, g.TextRenderer = L, g.Lexer = vr, g.lexer = vr.lex, g.Tokenizer = w, g.Hooks = br, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, yr.parse, vr.lex;
3517
3517
  //#endregion
3518
3518
  //#region agent/ui/ChatCardBlock.vue?vue&type=script&setup=true&lang.ts
3519
- var yr = ["aria-label"], br = { class: "px-4 pb-2 pt-4" }, xr = ["innerHTML"], Sr = ["onClick"], Cr = /* @__PURE__ */ k({
3519
+ var Sr = ["aria-label"], Cr = { class: "px-4 pb-2 pt-4" }, wr = ["innerHTML"], Tr = ["onClick"], Er = /* @__PURE__ */ j({
3520
3520
  __name: "ChatCardBlock",
3521
3521
  props: {
3522
3522
  spec: {},
@@ -3524,11 +3524,11 @@ var yr = ["aria-label"], br = { class: "px-4 pb-2 pt-4" }, xr = ["innerHTML"], S
3524
3524
  },
3525
3525
  emits: ["action"],
3526
3526
  setup(e, { emit: t }) {
3527
- let n = e, r = t, i = v(() => {
3527
+ let n = e, r = t, i = b(() => {
3528
3528
  if (!n.spec.body) return "";
3529
3529
  let e = g.parse(n.spec.body, { async: !1 });
3530
- return nn.sanitize(e, { ADD_ATTR: ["target"] });
3531
- }), 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)"), u = 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)");
3530
+ return on.sanitize(e, { ADD_ATTR: ["target"] });
3531
+ }), a = b(() => n.inverted ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.16)"), o = b(() => n.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-200) 80%, transparent)"), s = b(() => n.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), c = b(() => n.inverted ? "rgba(255, 255, 255, 0.8)" : "var(--color-theme-800)"), u = b(() => 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 = b(() => n.inverted ? "transparent" : "var(--color-theme-0)");
3532
3532
  function actionStyle(e) {
3533
3533
  return e === "primary" || e === "destructive" ? {
3534
3534
  background: n.inverted ? "rgba(255, 255, 255, 0.92)" : "var(--color-theme-900)",
@@ -3538,45 +3538,45 @@ var yr = ["aria-label"], br = { class: "px-4 pb-2 pt-4" }, xr = ["innerHTML"], S
3538
3538
  color: s.value
3539
3539
  };
3540
3540
  }
3541
- return (t, n) => (P(), x("div", {
3541
+ return (t, n) => (F(), C("div", {
3542
3542
  "data-test": "chat-card",
3543
3543
  class: "my-6 w-full max-w-[55ch] self-start overflow-hidden rounded-2xl",
3544
- style: M({
3544
+ style: P({
3545
3545
  background: f.value,
3546
3546
  boxShadow: u.value
3547
3547
  }),
3548
3548
  "aria-label": e.spec.title
3549
3549
  }, [
3550
- S("div", br, [S("div", {
3550
+ T("div", Cr, [T("div", {
3551
3551
  class: "text-[14px] font-semibold leading-tight",
3552
- style: M({ color: s.value })
3552
+ style: P({ color: s.value })
3553
3553
  }, H(e.spec.title), 5)]),
3554
- i.value ? (P(), x("div", {
3554
+ i.value ? (F(), C("div", {
3555
3555
  key: 0,
3556
3556
  class: "chat-msg-prose px-4 pb-4 pt-2 text-[14px] leading-relaxed",
3557
- style: M({ color: c.value }),
3557
+ style: P({ color: c.value }),
3558
3558
  innerHTML: i.value
3559
- }, null, 12, xr)) : b("", !0),
3560
- e.spec.actions?.length ? (P(), x("div", {
3559
+ }, null, 12, wr)) : S("", !0),
3560
+ e.spec.actions?.length ? (F(), C("div", {
3561
3561
  key: 1,
3562
3562
  class: "flex flex-wrap items-center gap-2 px-3 py-2.5",
3563
- style: M({ borderTop: `1px solid ${o.value}` })
3564
- }, [(P(!0), x(h, null, I(e.spec.actions, (e) => (P(), x("button", {
3563
+ style: P({ borderTop: `1px solid ${o.value}` })
3564
+ }, [(F(!0), C(v, null, R(e.spec.actions, (e) => (F(), C("button", {
3565
3565
  key: e.label,
3566
3566
  type: "button",
3567
3567
  "data-test": "chat-card-action",
3568
3568
  class: "inline-flex h-10 items-center justify-center rounded-full px-5 text-[14px] font-semibold transition-colors duration-150 active:opacity-80",
3569
- style: M(actionStyle(e.style)),
3569
+ style: P(actionStyle(e.style)),
3570
3570
  onClick: (t) => r("action", e.reply)
3571
- }, H(e.label), 13, Sr))), 128))], 4)) : b("", !0)
3572
- ], 12, yr));
3571
+ }, H(e.label), 13, Tr))), 128))], 4)) : S("", !0)
3572
+ ], 12, Sr));
3573
3573
  }
3574
- }), wr = 112, Tr = 52, Er = 14, Dr = 54, Or = 34, kr = 260;
3574
+ }), Dr = 112, Or = 52, kr = 14, Ar = 54, jr = 34, Mr = 260;
3575
3575
  function nodeWidthFor(e) {
3576
3576
  let { orientation: t, maxRows: n, maxWidth: r } = e;
3577
- if (t === "horizontal" || !r) return wr;
3578
- let i = r - Er * 2 - (n - 1) * Dr;
3579
- return Math.min(kr, Math.max(wr, Math.floor(i / n)));
3577
+ if (t === "horizontal" || !r) return Dr;
3578
+ let i = r - kr * 2 - (n - 1) * Ar;
3579
+ return Math.min(Mr, Math.max(Dr, Math.floor(i / n)));
3580
3580
  }
3581
3581
  function orientationFor(e) {
3582
3582
  return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
@@ -3613,11 +3613,11 @@ function buildLayout(e, t, n) {
3613
3613
  orientation: t,
3614
3614
  maxRows: o,
3615
3615
  ...n === void 0 ? {} : { maxWidth: n }
3616
- }), u = t === "horizontal" ? Er * 2 + s * c + (s - 1) * Dr : Er * 2 + o * c + (o - 1) * Dr, f = t === "horizontal" ? Er * 2 + o * Tr + (o - 1) * Or : Er * 2 + s * Tr + (s - 1) * Or, p = [];
3616
+ }), u = t === "horizontal" ? kr * 2 + s * c + (s - 1) * Ar : kr * 2 + o * c + (o - 1) * Ar, f = t === "horizontal" ? kr * 2 + o * Or + (o - 1) * jr : kr * 2 + s * Or + (s - 1) * jr, p = [];
3617
3617
  for (let [e, [, n]] of a.entries()) {
3618
- let r = (o - n.length) * (t === "horizontal" ? 86 : c + Dr) / 2;
3618
+ let r = (o - n.length) * (t === "horizontal" ? 86 : c + Ar) / 2;
3619
3619
  for (let [i, a] of n.entries()) {
3620
- let n = t === "horizontal" ? Er + e * (c + Dr) : Er + r + i * (c + Dr), o = t === "horizontal" ? Er + r + i * 86 : Er + e * 86;
3620
+ let n = t === "horizontal" ? kr + e * (c + Ar) : kr + r + i * (c + Ar), o = t === "horizontal" ? kr + r + i * 86 : kr + e * 86;
3621
3621
  p.push({
3622
3622
  id: a.id,
3623
3623
  label: a.label,
@@ -3626,7 +3626,7 @@ function buildLayout(e, t, n) {
3626
3626
  x: n,
3627
3627
  y: o,
3628
3628
  width: c,
3629
- height: Tr
3629
+ height: Or
3630
3630
  });
3631
3631
  }
3632
3632
  }
@@ -3703,14 +3703,14 @@ function formatChatVisualTick(e) {
3703
3703
  let { prefix: r, suffix: i } = affixes(n);
3704
3704
  return `${r}${formatChatVisualValue({ value: t })}${i}`;
3705
3705
  }
3706
- var Ar = 5.4, jr = 10, Mr = 15, Nr = 16;
3706
+ var Nr = 5.4, Pr = 10, Fr = 15, Ir = 16;
3707
3707
  function planChatVisualXLabels(e) {
3708
3708
  let { labels: t, plotWidth: n } = e;
3709
3709
  if (!t.length || n <= 0) return {
3710
3710
  mode: "horizontal",
3711
3711
  entries: []
3712
3712
  };
3713
- let r = t.map((e) => e.length > Nr ? `${e.slice(0, Nr - 1).trimEnd()}\u2026` : e), i = t.length - 1;
3713
+ let r = t.map((e) => e.length > Ir ? `${e.slice(0, Ir - 1).trimEnd()}\u2026` : e), i = t.length - 1;
3714
3714
  if (i === 0) return {
3715
3715
  mode: "horizontal",
3716
3716
  entries: [{
@@ -3718,14 +3718,14 @@ function planChatVisualXLabels(e) {
3718
3718
  text: r[0]
3719
3719
  }]
3720
3720
  };
3721
- if ((Math.max(...r.map((e) => e.length * Ar)) + jr) * t.length <= n) return {
3721
+ if ((Math.max(...r.map((e) => e.length * Nr)) + Pr) * t.length <= n) return {
3722
3722
  mode: "horizontal",
3723
3723
  entries: r.map((e, t) => ({
3724
3724
  index: t,
3725
3725
  text: e
3726
3726
  }))
3727
3727
  };
3728
- let a = Math.max(2, Math.floor(n / Mr));
3728
+ let a = Math.max(2, Math.floor(n / Fr));
3729
3729
  if (t.length <= a) return {
3730
3730
  mode: "angled",
3731
3731
  entries: r.map((e, t) => ({
@@ -3745,22 +3745,22 @@ function planChatVisualXLabels(e) {
3745
3745
  }
3746
3746
  //#endregion
3747
3747
  //#region agent/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
3748
- var Pr = [
3748
+ var Lr = [
3749
3749
  "data-visual-type",
3750
3750
  "data-chart-type",
3751
3751
  "data-stacking",
3752
3752
  "data-diagram-type",
3753
3753
  "aria-label"
3754
- ], Fr = { class: "mb-2.5" }, Ir = ["aria-label"], Lr = {
3754
+ ], Rr = { class: "mb-2.5" }, zr = ["aria-label"], Br = {
3755
3755
  key: 0,
3756
3756
  "data-test": "chat-visual-horizontal-bars",
3757
3757
  class: "grid gap-3"
3758
- }, Rr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, zr = ["viewBox"], Br = [
3758
+ }, Vr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Hr = ["viewBox"], Ur = [
3759
3759
  "x1",
3760
3760
  "x2",
3761
3761
  "y1",
3762
3762
  "y2"
3763
- ], Vr = ["x", "y"], Hr = [
3763
+ ], Wr = ["x", "y"], Gr = [
3764
3764
  "data-row-index",
3765
3765
  "data-series-index",
3766
3766
  "data-data-key",
@@ -3768,56 +3768,56 @@ var Pr = [
3768
3768
  "y",
3769
3769
  "width",
3770
3770
  "height"
3771
- ], Ur = ["data-trend-key", "d"], Wr = ["d"], Gr = ["cx", "cy"], Kr = ["cx", "cy"], qr = [
3771
+ ], Kr = ["data-trend-key", "d"], qr = ["d"], Jr = ["cx", "cy"], Yr = ["cx", "cy"], Xr = [
3772
3772
  "x",
3773
3773
  "y",
3774
3774
  "text-anchor",
3775
3775
  "transform"
3776
- ], Jr = {
3776
+ ], Zr = {
3777
3777
  key: 2,
3778
3778
  class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
3779
- }, Yr = {
3779
+ }, Qr = {
3780
3780
  key: 1,
3781
3781
  class: "grid gap-3"
3782
- }, Xr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Zr = { class: "shrink-0 tabular-nums" }, Qr = {
3782
+ }, $r = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, ei = { class: "shrink-0 tabular-nums" }, ti = {
3783
3783
  key: 2,
3784
3784
  class: "overflow-x-auto"
3785
- }, $r = ["viewBox", "aria-label"], ei = [
3785
+ }, ni = ["viewBox", "aria-label"], ri = [
3786
3786
  "data-from",
3787
3787
  "data-to",
3788
3788
  "x1",
3789
3789
  "y1",
3790
3790
  "x2",
3791
3791
  "y2"
3792
- ], ti = ["cx", "cy"], ni = ["x", "y"], ri = [
3792
+ ], ii = ["cx", "cy"], ai = ["x", "y"], oi = [
3793
3793
  "data-node-id",
3794
3794
  "data-node-kind",
3795
3795
  "transform"
3796
- ], ii = ["points"], ai = ["width", "height"], oi = ["width", "height"], si = {
3796
+ ], si = ["points"], ci = ["width", "height"], li = ["width", "height"], ui = {
3797
3797
  xmlns: "http://www.w3.org/1999/xhtml",
3798
3798
  class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
3799
- }, ci = /* @__PURE__ */ k({
3799
+ }, di = /* @__PURE__ */ j({
3800
3800
  __name: "ChatVisualBlock",
3801
3801
  props: {
3802
3802
  result: {},
3803
3803
  inverted: { type: Boolean }
3804
3804
  },
3805
3805
  setup(e) {
3806
- let t = e, n = F(), r = B(360), i;
3807
- re(() => {
3806
+ let t = e, n = I(), r = ce(360), i;
3807
+ ae(() => {
3808
3808
  typeof ResizeObserver > "u" || !n.value || (i = new ResizeObserver((e) => {
3809
3809
  let t = e[0]?.contentRect.width;
3810
3810
  t && (r.value = Math.round(t));
3811
3811
  }), i.observe(n.value));
3812
- }), ne(() => i?.disconnect());
3813
- 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);
3812
+ }), ie(() => i?.disconnect());
3813
+ let a = b(() => Math.min(720, Math.max(280, r.value))), o = b(() => t.result.ok ? t.result.spec : null), s = b(() => o.value?.visualType === "chart" ? o.value : null), c = b(() => o.value?.visualType === "diagram" ? o.value : null);
3814
3814
  function isCartesianChart(e) {
3815
3815
  return e?.chartType === "bar" || e?.chartType === "line" || e?.chartType === "scatter";
3816
3816
  }
3817
3817
  function isPieChart(e) {
3818
3818
  return e?.chartType === "pie";
3819
3819
  }
3820
- let u = v(() => s.value?.data ?? []), f = v(() => isCartesianChart(s.value) ? s.value : null), p = v(() => f.value?.series ?? []), m = v(() => isPieChart(s.value) ? s.value : null), _ = v(() => f.value?.chartType === "bar" && f.value.stacking === "stacked");
3820
+ let u = b(() => s.value?.data ?? []), f = b(() => isCartesianChart(s.value) ? s.value : null), p = b(() => f.value?.series ?? []), m = b(() => isPieChart(s.value) ? s.value : null), te = b(() => f.value?.chartType === "bar" && f.value.stacking === "stacked");
3821
3821
  function numericValue(e) {
3822
3822
  return typeof e == "number" && Number.isFinite(e) ? e : null;
3823
3823
  }
@@ -3849,7 +3849,7 @@ var Pr = [
3849
3849
  intercept: (r - s * n) / t
3850
3850
  };
3851
3851
  }
3852
- let te = v(() => {
3852
+ let h = b(() => {
3853
3853
  let e = [], t = f.value;
3854
3854
  if (!t) return e;
3855
3855
  if (t.chartType === "bar" && t.stacking === "stacked") for (let n of t.data) {
@@ -3879,8 +3879,8 @@ var Pr = [
3879
3879
  let n = e > 0 ? e : 1, r = Math.floor(Math.log10(n)), i = n / 10 ** r, a;
3880
3880
  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;
3881
3881
  }
3882
- let C = v(() => {
3883
- let e = te.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
3882
+ let _ = b(() => {
3883
+ let e = h.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
3884
3884
  if (n === t) return {
3885
3885
  min: 0,
3886
3886
  max: t || 1,
@@ -3893,7 +3893,7 @@ var Pr = [
3893
3893
  max: a,
3894
3894
  ticks: o
3895
3895
  };
3896
- }), T = v(() => resolveSharedSeriesFormat({ series: p.value })), k = v(() => {
3896
+ }), ne = b(() => resolveSharedSeriesFormat({ series: p.value })), x = b(() => {
3897
3897
  let e = f.value;
3898
3898
  if (!e) return {
3899
3899
  mode: "horizontal",
@@ -3904,8 +3904,8 @@ var Pr = [
3904
3904
  labels: e.data.map((e) => String(e?.[t] ?? "")),
3905
3905
  plotWidth: Math.max(200, a.value - 42)
3906
3906
  });
3907
- }), A = v(() => {
3908
- let e = T.value?.valueFormat, t = !!(T.value && (e === "currency" || e === "percent" || T.value.valuePrefix || T.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = k.value.mode === "angled";
3907
+ }), k = b(() => {
3908
+ let e = ne.value?.valueFormat, t = !!(ne.value && (e === "currency" || e === "percent" || ne.value.valuePrefix || ne.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = x.value.mode === "angled";
3909
3909
  return {
3910
3910
  width: a.value,
3911
3911
  height: 168 + (r ? 36 : 0),
@@ -3916,7 +3916,7 @@ var Pr = [
3916
3916
  };
3917
3917
  });
3918
3918
  function labelCenterX(e, t) {
3919
- let n = f.value, r = A.value;
3919
+ let n = f.value, r = k.value;
3920
3920
  if (n?.chartType === "bar") {
3921
3921
  let n = r.width - r.left - r.right;
3922
3922
  return r.left + (e + .5) * (n / Math.max(t, 1));
@@ -3924,11 +3924,11 @@ var Pr = [
3924
3924
  return xForIndex(e, t);
3925
3925
  }
3926
3926
  function xForIndex(e, t) {
3927
- let n = A.value, r = n.width - n.left - n.right;
3927
+ let n = k.value, r = n.width - n.left - n.right;
3928
3928
  return t <= 1 ? n.left + r / 2 : n.left + r * e / (t - 1);
3929
3929
  }
3930
3930
  function yForValue(e) {
3931
- let { min: t, max: n } = C.value, r = A.value, i = r.height - r.top - r.bottom;
3931
+ let { min: t, max: n } = _.value, r = k.value, i = r.height - r.top - r.bottom;
3932
3932
  return r.top + (n - e) / (n - t || 1) * i;
3933
3933
  }
3934
3934
  function pathForSeries(e) {
@@ -3938,7 +3938,7 @@ var Pr = [
3938
3938
  return `${r === 0 ? "M" : "L"} ${xForIndex(r, t.data.length).toFixed(1)} ${yForValue(i).toFixed(1)}`;
3939
3939
  }).join(" ") : "";
3940
3940
  }
3941
- let j = v(() => {
3941
+ let A = b(() => {
3942
3942
  let e = f.value;
3943
3943
  if (!e?.trendLine || e.chartType !== "line" && e.chartType !== "scatter") return null;
3944
3944
  let t = trendLinePoints(e, e.trendLine.dataKey), n = linearTrend(t);
@@ -3949,11 +3949,11 @@ var Pr = [
3949
3949
  dataKey: e.trendLine.dataKey,
3950
3950
  seriesIndex: s
3951
3951
  };
3952
- }), ie = v(() => {
3952
+ }), j = b(() => {
3953
3953
  let e = f.value;
3954
3954
  if (!e || e.chartType !== "bar") return [];
3955
- let t = A.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
3956
- if (_.value) {
3955
+ let t = k.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
3956
+ if (te.value) {
3957
3957
  let r = Math.max(4, Math.min(24, n * .42));
3958
3958
  return e.data.flatMap((i, a) => {
3959
3959
  let o = 0, s = 0, c = t.left + a * n + (n - r) / 2;
@@ -3986,12 +3986,12 @@ var Pr = [
3986
3986
  dataKey: e.dataKey
3987
3987
  };
3988
3988
  }));
3989
- }), ae = v(() => {
3989
+ }), re = b(() => {
3990
3990
  let e = f.value;
3991
3991
  if (!e) return [];
3992
3992
  let t = e.data;
3993
3993
  if (!t.length) return [];
3994
- let n = t.length - 1, r = k.value, i = r.mode === "angled";
3994
+ let n = t.length - 1, r = x.value, i = r.mode === "angled";
3995
3995
  return r.entries.map(({ index: e, text: r }) => ({
3996
3996
  key: `${e}`,
3997
3997
  label: r,
@@ -3999,9 +3999,9 @@ var Pr = [
3999
3999
  anchor: i ? "end" : e === 0 ? "start" : e === n ? "end" : "middle",
4000
4000
  angled: i
4001
4001
  })).filter((e) => e.label);
4002
- }), R = v(() => {
4002
+ }), M = b(() => {
4003
4003
  let e = f.value;
4004
- if (!e || e.chartType !== "bar" || e.series.length !== 1 || _.value) return [];
4004
+ if (!e || e.chartType !== "bar" || e.series.length !== 1 || te.value) return [];
4005
4005
  let t = e.series[0], n = e.data.map((n, r) => {
4006
4006
  let i = categoryLabel(n, e.xKey), a = numericValue(n[t.dataKey]);
4007
4007
  return !i || a === null ? null : {
@@ -4022,7 +4022,7 @@ var Pr = [
4022
4022
  width: e.rawValue <= 0 ? 0 : Math.max(2, e.rawValue / r * 100),
4023
4023
  seriesIndex: 0
4024
4024
  }));
4025
- }), se = v(() => {
4025
+ }), oe = b(() => {
4026
4026
  let e = f.value;
4027
4027
  if (!e?.data.length) return [];
4028
4028
  let t = e.data[e.data.length - 1];
@@ -4038,7 +4038,7 @@ var Pr = [
4038
4038
  seriesIndex: n
4039
4039
  };
4040
4040
  });
4041
- }), ce = v(() => {
4041
+ }), B = b(() => {
4042
4042
  let e = f.value;
4043
4043
  if (!e?.data.length || e.chartType !== "line") return [];
4044
4044
  let t = e.data.length - 1, n = e.data[t];
@@ -4051,7 +4051,7 @@ var Pr = [
4051
4051
  seriesIndex: i
4052
4052
  };
4053
4053
  }).filter((e) => e !== null);
4054
- }), ue = v(() => {
4054
+ }), se = b(() => {
4055
4055
  let e = m.value;
4056
4056
  if (!e) return [];
4057
4057
  let t = e.data.map((t) => ({
@@ -4067,7 +4067,7 @@ var Pr = [
4067
4067
  series: r
4068
4068
  })
4069
4069
  }));
4070
- }), U = v(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), de = [
4070
+ }), U = b(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), de = [
4071
4071
  "var(--color-theme-900)",
4072
4072
  "var(--color-primary-500)",
4073
4073
  "color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
@@ -4086,85 +4086,85 @@ var Pr = [
4086
4086
  function diagramNodeStroke(e) {
4087
4087
  return t.inverted ? "rgba(255, 255, 255, 0.22)" : ve.value;
4088
4088
  }
4089
- let W = v(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), he = v(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), G = 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)"), K = 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)"), q = 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)"), be = 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)");
4090
- return (e, r) => o.value ? (P(), x("section", {
4089
+ let he = b(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), _e = b(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), W = b(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), G = b(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), K = b(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), ve = b(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), q = b(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), ye = b(() => t.inverted ? "transparent" : "var(--color-theme-0)"), be = b(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Se = b(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
4090
+ return (e, r) => o.value ? (F(), C("section", {
4091
4091
  key: 0,
4092
4092
  "data-test": "chat-visual",
4093
4093
  "data-visual-type": o.value.visualType,
4094
4094
  "data-chart-type": s.value?.chartType,
4095
- "data-stacking": _.value ? "stacked" : void 0,
4095
+ "data-stacking": te.value ? "stacked" : void 0,
4096
4096
  "data-diagram-type": c.value?.diagramType,
4097
4097
  class: "my-6 w-full rounded-[20px] px-4 pb-3.5 pt-4",
4098
- style: M({
4098
+ style: P({
4099
4099
  background: ye.value,
4100
4100
  boxShadow: `inset 0 0 0 1px ${q.value}`
4101
4101
  }),
4102
4102
  "aria-label": o.value.meta.title
4103
4103
  }, [
4104
- S("header", Fr, [S("h4", {
4104
+ T("header", Rr, [T("h4", {
4105
4105
  class: "text-[13px] font-semibold leading-tight",
4106
- style: M({ color: W.value })
4107
- }, H(o.value.meta.title), 5), o.value.meta.description ? (P(), x("p", {
4106
+ style: P({ color: he.value })
4107
+ }, H(o.value.meta.title), 5), o.value.meta.description ? (F(), C("p", {
4108
4108
  key: 0,
4109
4109
  class: "mt-0.5 text-[12px] leading-snug",
4110
- style: M({ color: he.value })
4111
- }, H(o.value.meta.description), 5)) : b("", !0)]),
4112
- S("div", {
4110
+ style: P({ color: _e.value })
4111
+ }, H(o.value.meta.description), 5)) : S("", !0)]),
4112
+ T("div", {
4113
4113
  ref_key: "bodyEl",
4114
4114
  ref: n
4115
- }, [f.value ? (P(), x("div", {
4115
+ }, [f.value ? (F(), C("div", {
4116
4116
  key: 0,
4117
4117
  role: "img",
4118
4118
  "aria-label": o.value.meta.title
4119
- }, [R.value.length ? (P(), x("div", Lr, [(P(!0), x(h, null, I(R.value, (e) => (P(), x("div", {
4119
+ }, [M.value.length ? (F(), C("div", Br, [(F(!0), C(v, null, R(M.value, (e) => (F(), C("div", {
4120
4120
  key: e.key,
4121
4121
  "data-test": "chat-visual-horizontal-bar",
4122
4122
  class: "min-w-0"
4123
- }, [S("div", Rr, [S("span", {
4123
+ }, [T("div", Vr, [T("span", {
4124
4124
  class: "line-clamp-2 min-w-0 font-medium leading-snug",
4125
- style: M({ color: W.value })
4126
- }, H(e.label), 5), S("span", {
4125
+ style: P({ color: he.value })
4126
+ }, H(e.label), 5), T("span", {
4127
4127
  class: "shrink-0 font-semibold tabular-nums",
4128
- style: M({ color: W.value })
4129
- }, H(e.value), 5)]), S("div", {
4128
+ style: P({ color: he.value })
4129
+ }, H(e.value), 5)]), T("div", {
4130
4130
  class: "h-2 w-full overflow-hidden rounded-full",
4131
- style: M({ background: Se.value })
4132
- }, [S("div", {
4131
+ style: P({ background: Se.value })
4132
+ }, [T("div", {
4133
4133
  class: "h-full rounded-full",
4134
- style: M({
4134
+ style: P({
4135
4135
  width: `${e.width}%`,
4136
4136
  background: seriesColor(e.seriesIndex)
4137
4137
  })
4138
- }, null, 4)], 4)]))), 128))])) : (P(), x("svg", {
4138
+ }, null, 4)], 4)]))), 128))])) : (F(), C("svg", {
4139
4139
  key: 1,
4140
4140
  class: "block h-auto w-full overflow-visible",
4141
- viewBox: `0 0 ${A.value.width} ${A.value.height}`,
4142
- style: M({ aspectRatio: `${A.value.width} / ${A.value.height}` }),
4141
+ viewBox: `0 0 ${k.value.width} ${k.value.height}`,
4142
+ style: P({ aspectRatio: `${k.value.width} / ${k.value.height}` }),
4143
4143
  preserveAspectRatio: "xMidYMid meet",
4144
4144
  "aria-hidden": "true"
4145
4145
  }, [
4146
- (P(!0), x(h, null, I(C.value.ticks, (e) => (P(), x("line", {
4146
+ (F(!0), C(v, null, R(_.value.ticks, (e) => (F(), C("line", {
4147
4147
  key: `grid-${e}`,
4148
- x1: A.value.left,
4149
- x2: A.value.width - A.value.right,
4148
+ x1: k.value.left,
4149
+ x2: k.value.width - k.value.right,
4150
4150
  y1: yForValue(e),
4151
4151
  y2: yForValue(e),
4152
4152
  "stroke-width": "1",
4153
4153
  "vector-effect": "non-scaling-stroke",
4154
- style: M({ stroke: e === 0 ? K.value : _e.value })
4155
- }, null, 12, Br))), 128)),
4156
- S("g", null, [(P(!0), x(h, null, I(C.value.ticks, (e) => (P(), x("text", {
4154
+ style: P({ stroke: e === 0 ? K.value : G.value })
4155
+ }, null, 12, Ur))), 128)),
4156
+ T("g", null, [(F(!0), C(v, null, R(_.value.ticks, (e) => (F(), C("text", {
4157
4157
  key: `y-${e}`,
4158
- x: A.value.left - 7,
4158
+ x: k.value.left - 7,
4159
4159
  y: yForValue(e) + 3,
4160
4160
  "text-anchor": "end",
4161
4161
  "font-size": "9.5",
4162
- style: M({ fill: G.value })
4163
- }, H(oe(formatChatVisualTick)({
4162
+ style: P({ fill: W.value })
4163
+ }, H(ue(formatChatVisualTick)({
4164
4164
  value: e,
4165
- shared: T.value
4166
- })), 13, Vr))), 128))]),
4167
- f.value.chartType === "bar" ? (P(!0), x(h, { key: 0 }, I(ie.value, (e) => (P(), x("rect", {
4165
+ shared: ne.value
4166
+ })), 13, Wr))), 128))]),
4167
+ f.value.chartType === "bar" ? (F(!0), C(v, { key: 0 }, R(j.value, (e) => (F(), C("rect", {
4168
4168
  key: e.key,
4169
4169
  "data-test": "chat-visual-bar",
4170
4170
  "data-row-index": e.rowIndex,
@@ -4175,22 +4175,22 @@ var Pr = [
4175
4175
  width: e.width,
4176
4176
  height: e.height,
4177
4177
  rx: "2.5",
4178
- style: M({ fill: seriesColor(e.seriesIndex) })
4179
- }, null, 12, Hr))), 128)) : (P(), x(h, { key: 1 }, [
4180
- j.value ? (P(), x("path", {
4178
+ style: P({ fill: seriesColor(e.seriesIndex) })
4179
+ }, null, 12, Gr))), 128)) : (F(), C(v, { key: 1 }, [
4180
+ A.value ? (F(), C("path", {
4181
4181
  key: 0,
4182
4182
  "data-test": "chat-visual-trend-line",
4183
- "data-trend-key": j.value.dataKey,
4184
- d: j.value.path,
4183
+ "data-trend-key": A.value.dataKey,
4184
+ d: A.value.path,
4185
4185
  fill: "none",
4186
4186
  "stroke-width": "1.4",
4187
4187
  "stroke-linecap": "round",
4188
4188
  "stroke-linejoin": "round",
4189
4189
  "stroke-dasharray": "4 3",
4190
4190
  "vector-effect": "non-scaling-stroke",
4191
- style: M({ stroke: seriesColor(j.value.seriesIndex) })
4192
- }, null, 12, Ur)) : b("", !0),
4193
- (P(!0), x(h, null, I(p.value, (e, t) => (P(), x("g", { key: e.dataKey }, [f.value.chartType === "line" ? (P(), x("path", {
4191
+ style: P({ stroke: seriesColor(A.value.seriesIndex) })
4192
+ }, null, 12, Kr)) : S("", !0),
4193
+ (F(!0), C(v, null, R(p.value, (e, t) => (F(), C("g", { key: e.dataKey }, [f.value.chartType === "line" ? (F(), C("path", {
4194
4194
  key: 0,
4195
4195
  d: pathForSeries(e.dataKey),
4196
4196
  fill: "none",
@@ -4198,74 +4198,74 @@ var Pr = [
4198
4198
  "stroke-linecap": "round",
4199
4199
  "stroke-linejoin": "round",
4200
4200
  "vector-effect": "non-scaling-stroke",
4201
- style: M({ stroke: seriesColor(t) })
4202
- }, null, 12, Wr)) : b("", !0), (P(!0), x(h, null, I(u.value, (n, r) => (P(), x(h, { key: `${e.dataKey}-${r}` }, [f.value.chartType === "scatter" ? (P(), x("circle", {
4201
+ style: P({ stroke: seriesColor(t) })
4202
+ }, null, 12, qr)) : S("", !0), (F(!0), C(v, null, R(u.value, (n, r) => (F(), C(v, { key: `${e.dataKey}-${r}` }, [f.value.chartType === "scatter" ? (F(), C("circle", {
4203
4203
  key: 0,
4204
4204
  cx: xForIndex(r, u.value.length),
4205
4205
  cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
4206
4206
  r: "2.6",
4207
- style: M({ fill: seriesColor(t) })
4208
- }, null, 12, Gr)) : b("", !0)], 64))), 128))]))), 128)),
4209
- (P(!0), x(h, null, I(ce.value, (e) => (P(), x("circle", {
4207
+ style: P({ fill: seriesColor(t) })
4208
+ }, null, 12, Jr)) : S("", !0)], 64))), 128))]))), 128)),
4209
+ (F(!0), C(v, null, R(B.value, (e) => (F(), C("circle", {
4210
4210
  key: `marker-${e.key}`,
4211
4211
  cx: e.cx,
4212
4212
  cy: e.cy,
4213
4213
  r: "3",
4214
- style: M({ fill: seriesColor(e.seriesIndex) })
4215
- }, null, 12, Kr))), 128))
4214
+ style: P({ fill: seriesColor(e.seriesIndex) })
4215
+ }, null, 12, Yr))), 128))
4216
4216
  ], 64)),
4217
- (P(!0), x(h, null, I(ae.value, (e) => (P(), x("text", {
4217
+ (F(!0), C(v, null, R(re.value, (e) => (F(), C("text", {
4218
4218
  key: e.key,
4219
4219
  x: e.x,
4220
- y: e.angled ? A.value.height - A.value.bottom + 12 : A.value.height - 6,
4220
+ y: e.angled ? k.value.height - k.value.bottom + 12 : k.value.height - 6,
4221
4221
  "text-anchor": e.anchor,
4222
4222
  "font-size": "9.5",
4223
- transform: e.angled ? `rotate(${oe(-40)} ${e.x} ${A.value.height - A.value.bottom + 12})` : void 0,
4224
- style: M({ fill: G.value })
4225
- }, H(e.label), 13, qr))), 128))
4226
- ], 12, zr)), se.value.length > 1 || f.value.chartType !== "bar" ? (P(), x("div", Jr, [(P(!0), x(h, null, I(se.value, (e) => (P(), x("div", {
4223
+ transform: e.angled ? `rotate(${ue(-40)} ${e.x} ${k.value.height - k.value.bottom + 12})` : void 0,
4224
+ style: P({ fill: W.value })
4225
+ }, H(e.label), 13, Xr))), 128))
4226
+ ], 12, Hr)), oe.value.length > 1 || f.value.chartType !== "bar" ? (F(), C("div", Zr, [(F(!0), C(v, null, R(oe.value, (e) => (F(), C("div", {
4227
4227
  key: e.key,
4228
4228
  class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
4229
4229
  }, [
4230
- S("span", {
4230
+ T("span", {
4231
4231
  class: "size-2.5 shrink-0 rounded-full",
4232
- style: M({ background: seriesColor(e.seriesIndex) })
4232
+ style: P({ background: seriesColor(e.seriesIndex) })
4233
4233
  }, null, 4),
4234
- S("span", { style: M({ color: he.value }) }, H(e.label), 5),
4235
- S("span", {
4234
+ T("span", { style: P({ color: _e.value }) }, H(e.label), 5),
4235
+ T("span", {
4236
4236
  class: "font-semibold tabular-nums",
4237
- style: M({ color: W.value })
4237
+ style: P({ color: he.value })
4238
4238
  }, H(e.value), 5)
4239
- ]))), 128))])) : b("", !0)], 8, Ir)) : m.value ? (P(), x("div", Yr, [(P(!0), x(h, null, I(ue.value, (e, t) => (P(), x("div", { key: e.key }, [S("div", Xr, [S("span", {
4239
+ ]))), 128))])) : S("", !0)], 8, zr)) : m.value ? (F(), C("div", Qr, [(F(!0), C(v, null, R(se.value, (e, t) => (F(), C("div", { key: e.key }, [T("div", $r, [T("span", {
4240
4240
  class: "truncate font-medium",
4241
- style: M({ color: W.value })
4242
- }, H(e.name), 5), S("span", Zr, [S("span", {
4241
+ style: P({ color: he.value })
4242
+ }, H(e.name), 5), T("span", ei, [T("span", {
4243
4243
  class: "font-semibold",
4244
- style: M({ color: W.value })
4245
- }, H(e.display), 5), S("span", {
4244
+ style: P({ color: he.value })
4245
+ }, H(e.display), 5), T("span", {
4246
4246
  class: "ml-1.5",
4247
- style: M({ color: he.value })
4248
- }, H(Math.round(e.percent * 100)) + "%", 5)])]), S("div", {
4247
+ style: P({ color: _e.value })
4248
+ }, H(Math.round(e.percent * 100)) + "%", 5)])]), T("div", {
4249
4249
  class: "h-1.5 w-full overflow-hidden rounded-full",
4250
- style: M({ background: Se.value })
4251
- }, [S("div", {
4250
+ style: P({ background: Se.value })
4251
+ }, [T("div", {
4252
4252
  class: "h-full rounded-full",
4253
- style: M({
4253
+ style: P({
4254
4254
  width: `${Math.max(2, e.percent * 100)}%`,
4255
4255
  background: seriesColor(t)
4256
4256
  })
4257
- }, null, 4)], 4)]))), 128))])) : c.value && U.value ? (P(), x("div", Qr, [(P(), x("svg", {
4257
+ }, null, 4)], 4)]))), 128))])) : c.value && U.value ? (F(), C("div", ti, [(F(), C("svg", {
4258
4258
  "data-test": "chat-visual-diagram-svg",
4259
4259
  class: "block h-auto overflow-visible",
4260
4260
  viewBox: `0 0 ${U.value.width} ${U.value.height}`,
4261
- style: M({
4261
+ style: P({
4262
4262
  width: `${U.value.width}px`,
4263
4263
  aspectRatio: `${U.value.width} / ${U.value.height}`
4264
4264
  }),
4265
4265
  role: "img",
4266
4266
  "aria-label": o.value.meta.title
4267
4267
  }, [
4268
- (P(!0), x(h, null, I(U.value.edges, (e) => (P(), x("line", {
4268
+ (F(!0), C(v, null, R(U.value.edges, (e) => (F(), C("line", {
4269
4269
  key: e.key,
4270
4270
  "data-test": "chat-visual-diagram-edge",
4271
4271
  "data-from": e.from,
@@ -4277,77 +4277,77 @@ var Pr = [
4277
4277
  "stroke-width": "1.4",
4278
4278
  "stroke-linecap": "round",
4279
4279
  "vector-effect": "non-scaling-stroke",
4280
- style: M({ stroke: be.value })
4281
- }, null, 12, ei))), 128)),
4282
- (P(!0), x(h, null, I(U.value.edges, (e) => (P(), x("circle", {
4280
+ style: P({ stroke: be.value })
4281
+ }, null, 12, ri))), 128)),
4282
+ (F(!0), C(v, null, R(U.value.edges, (e) => (F(), C("circle", {
4283
4283
  key: `${e.key}-dot`,
4284
4284
  cx: e.x2,
4285
4285
  cy: e.y2,
4286
4286
  r: "2.4",
4287
- style: M({ fill: be.value })
4288
- }, null, 12, ti))), 128)),
4289
- (P(!0), x(h, null, I(U.value.edges.filter((e) => e.label), (e) => (P(), x("foreignObject", {
4287
+ style: P({ fill: be.value })
4288
+ }, null, 12, ii))), 128)),
4289
+ (F(!0), C(v, null, R(U.value.edges.filter((e) => e.label), (e) => (F(), C("foreignObject", {
4290
4290
  key: `${e.key}-label`,
4291
4291
  x: e.labelX - 55,
4292
4292
  y: e.labelY - 12,
4293
4293
  width: "110",
4294
4294
  height: "24"
4295
- }, [S("div", {
4295
+ }, [T("div", {
4296
4296
  xmlns: "http://www.w3.org/1999/xhtml",
4297
4297
  class: "flex h-full items-center justify-center px-1 text-center text-[10.5px] font-medium leading-none",
4298
- style: M({
4299
- color: he.value,
4298
+ style: P({
4299
+ color: _e.value,
4300
4300
  background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
4301
4301
  })
4302
- }, H(e.label), 5)], 8, ni))), 128)),
4303
- (P(!0), x(h, null, I(U.value.nodes, (e) => (P(), x("g", {
4302
+ }, H(e.label), 5)], 8, ai))), 128)),
4303
+ (F(!0), C(v, null, R(U.value.nodes, (e) => (F(), C("g", {
4304
4304
  key: e.id,
4305
4305
  "data-test": "chat-visual-diagram-node",
4306
4306
  "data-node-id": e.id,
4307
4307
  "data-node-kind": e.kind,
4308
4308
  transform: `translate(${e.x} ${e.y})`
4309
- }, [e.kind === "decision" ? (P(), x("polygon", {
4309
+ }, [e.kind === "decision" ? (F(), C("polygon", {
4310
4310
  key: 0,
4311
4311
  points: `${e.width / 2},0 ${e.width},${e.height / 2} ${e.width / 2},${e.height} 0,${e.height / 2}`,
4312
4312
  "stroke-width": "1",
4313
4313
  "vector-effect": "non-scaling-stroke",
4314
- style: M({
4314
+ style: P({
4315
4315
  fill: diagramNodeFill(e.kind),
4316
4316
  stroke: diagramNodeStroke(e.kind)
4317
4317
  })
4318
- }, null, 12, ii)) : (P(), x("rect", {
4318
+ }, null, 12, si)) : (F(), C("rect", {
4319
4319
  key: 1,
4320
4320
  width: e.width,
4321
4321
  height: e.height,
4322
4322
  rx: "9",
4323
4323
  "stroke-width": "1",
4324
4324
  "vector-effect": "non-scaling-stroke",
4325
- style: M({
4325
+ style: P({
4326
4326
  fill: diagramNodeFill(e.kind),
4327
4327
  stroke: diagramNodeStroke(e.kind)
4328
4328
  })
4329
- }, null, 12, ai)), (P(), x("foreignObject", {
4329
+ }, null, 12, ci)), (F(), C("foreignObject", {
4330
4330
  x: "8",
4331
4331
  y: "5",
4332
4332
  width: e.width - 16,
4333
4333
  height: e.height - 10
4334
- }, [S("div", si, [S("div", {
4334
+ }, [T("div", ui, [T("div", {
4335
4335
  class: "line-clamp-2 text-[13px] font-medium leading-snug",
4336
- style: M({ color: W.value })
4337
- }, H(e.label), 5), e.detail ? (P(), x("div", {
4336
+ style: P({ color: he.value })
4337
+ }, H(e.label), 5), e.detail ? (F(), C("div", {
4338
4338
  key: 0,
4339
4339
  class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
4340
- style: M({ color: he.value })
4341
- }, H(e.detail), 5)) : b("", !0)])], 8, oi))], 8, ri))), 128))
4342
- ], 12, $r))])) : b("", !0)], 512),
4343
- o.value.meta.footer ? (P(), x("footer", {
4340
+ style: P({ color: _e.value })
4341
+ }, H(e.detail), 5)) : S("", !0)])], 8, li))], 8, oi))), 128))
4342
+ ], 12, ni))])) : S("", !0)], 512),
4343
+ o.value.meta.footer ? (F(), C("footer", {
4344
4344
  key: 0,
4345
4345
  class: "mt-3 text-[11px] leading-snug",
4346
- style: M({ color: G.value })
4347
- }, H(o.value.meta.footer), 5)) : b("", !0)
4348
- ], 12, Pr)) : b("", !0);
4346
+ style: P({ color: W.value })
4347
+ }, H(o.value.meta.footer), 5)) : S("", !0)
4348
+ ], 12, Lr)) : S("", !0);
4349
4349
  }
4350
- }), li = ["innerHTML"], ui = /* @__PURE__ */ k({
4350
+ }), fi = ["innerHTML"], pi = /* @__PURE__ */ j({
4351
4351
  __name: "ChatRichText",
4352
4352
  props: {
4353
4353
  text: {},
@@ -4356,8 +4356,8 @@ var Pr = [
4356
4356
  },
4357
4357
  emits: ["action"],
4358
4358
  setup(e, { emit: t }) {
4359
- let n = e, r = t, i = B(n.text), a;
4360
- ue([() => n.text, () => n.streaming], ([e, t]) => {
4359
+ let n = e, r = t, i = ce(n.text), a;
4360
+ pe([() => n.text, () => n.streaming], ([e, t]) => {
4361
4361
  if (!t) {
4362
4362
  a !== void 0 && (cancelAnimationFrame(a), a = void 0), i.value = e;
4363
4363
  return;
@@ -4365,7 +4365,7 @@ var Pr = [
4365
4365
  a === void 0 && (a = requestAnimationFrame(() => {
4366
4366
  a = void 0, i.value = n.text;
4367
4367
  }));
4368
- }), ne(() => {
4368
+ }), ie(() => {
4369
4369
  a !== void 0 && cancelAnimationFrame(a);
4370
4370
  });
4371
4371
  let o = new g.Renderer();
@@ -4387,7 +4387,7 @@ var Pr = [
4387
4387
  function renderMarkdown(e) {
4388
4388
  if (!e) return "";
4389
4389
  let t = g.parse(e, { async: !1 });
4390
- return nn.sanitize(t, {
4390
+ return on.sanitize(t, {
4391
4391
  ADD_ATTR: ["target"],
4392
4392
  ADD_DATA_URI_TAGS: ["img"]
4393
4393
  });
@@ -4453,7 +4453,7 @@ var Pr = [
4453
4453
  });
4454
4454
  let n = c[1], s = c[2].trim();
4455
4455
  if (n === "pl-card") {
4456
- let e = p(s);
4456
+ let e = m(s);
4457
4457
  e.ok ? r.push({
4458
4458
  kind: "card",
4459
4459
  key: `card-${o}`,
@@ -4468,7 +4468,7 @@ var Pr = [
4468
4468
  html: renderMarkdown(`\`\`\`\n${s}\n\`\`\``)
4469
4469
  }));
4470
4470
  } else {
4471
- let e = m(s);
4471
+ let e = te(s);
4472
4472
  if (e.ok) r.push({
4473
4473
  kind: "visual",
4474
4474
  key: `visual-${o}`,
@@ -4504,65 +4504,65 @@ var Pr = [
4504
4504
  key: `pending-${o}`
4505
4505
  }), r;
4506
4506
  }
4507
- let h = renderMarkdown(u);
4508
- return h && r.push({
4507
+ let p = renderMarkdown(u);
4508
+ return p && r.push({
4509
4509
  kind: "markdown",
4510
4510
  key: `md-${o}`,
4511
- html: h
4511
+ html: p
4512
4512
  }), r;
4513
4513
  }
4514
- let c = v(() => {
4514
+ let c = b(() => {
4515
4515
  let e = i.value;
4516
4516
  return e ? richTextSegments({
4517
4517
  text: e,
4518
4518
  streaming: !!n.streaming
4519
4519
  }) : [];
4520
4520
  });
4521
- return (t, n) => (P(), x("div", {
4521
+ return (t, n) => (F(), C("div", {
4522
4522
  class: "chat-msg-rich break-words text-[14px] leading-[1.55] @sm/chat:max-w-[55ch] @sm/chat:text-[15px] @sm/chat:leading-[1.5]",
4523
4523
  onErrorCapture: onRichTextAssetError
4524
- }, [(P(!0), x(h, null, I(c.value, (t) => (P(), x(h, { key: t.key }, [t.kind === "markdown" ? (P(), x("div", {
4524
+ }, [(F(!0), C(v, null, R(c.value, (t) => (F(), C(v, { key: t.key }, [t.kind === "markdown" ? (F(), C("div", {
4525
4525
  key: 0,
4526
- class: j(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
4526
+ class: M(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
4527
4527
  innerHTML: t.html
4528
- }, null, 10, li)) : t.kind === "visual" ? (P(), te(ci, {
4528
+ }, null, 10, fi)) : t.kind === "visual" ? (F(), x(di, {
4529
4529
  key: 1,
4530
4530
  result: t.result,
4531
4531
  inverted: e.inverted
4532
- }, null, 8, ["result", "inverted"])) : t.kind === "card" ? (P(), te(Cr, {
4532
+ }, null, 8, ["result", "inverted"])) : t.kind === "card" ? (F(), x(Er, {
4533
4533
  key: 2,
4534
4534
  spec: t.spec,
4535
4535
  inverted: e.inverted,
4536
4536
  onAction: n[0] || (n[0] = (e) => r("action", e))
4537
- }, null, 8, ["spec", "inverted"])) : (P(), x("div", {
4537
+ }, null, 8, ["spec", "inverted"])) : (F(), C("div", {
4538
4538
  key: 3,
4539
4539
  "data-test": "chat-visual-pending",
4540
4540
  role: "status",
4541
4541
  class: "my-6 flex items-center gap-2.5 rounded-[20px] px-4 py-5 text-[12px] font-medium",
4542
- style: M({
4542
+ style: P({
4543
4543
  background: e.inverted ? "transparent" : "var(--color-theme-0)",
4544
4544
  boxShadow: `inset 0 0 0 1px ${e.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"}`,
4545
4545
  color: e.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
4546
4546
  })
4547
- }, [...n[1] || (n[1] = [S("span", {
4547
+ }, [...n[1] || (n[1] = [T("span", {
4548
4548
  class: "size-2 shrink-0 animate-pulse rounded-full",
4549
4549
  style: { background: "currentcolor" }
4550
- }, null, -1), C(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
4550
+ }, null, -1), k(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
4551
4551
  }
4552
- }), di = 80, fi = 600, pi = /* @__PURE__ */ k({
4552
+ }), mi = 80, hi = 600, gi = /* @__PURE__ */ j({
4553
4553
  __name: "ChatScroller",
4554
4554
  setup(e, { expose: t }) {
4555
- let n = F(), r = F(), i = F(!0), a, o, s = 0;
4555
+ let n = I(), r = I(), i = I(!0), a, o, s = 0;
4556
4556
  function scrollToBottom() {
4557
4557
  let e = n.value;
4558
4558
  e && (e.scrollTop = e.scrollHeight);
4559
4559
  }
4560
4560
  function onScroll() {
4561
4561
  let e = n.value;
4562
- e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= di);
4562
+ e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= mi);
4563
4563
  }
4564
4564
  function markUserGesture() {
4565
- s = Date.now() + fi;
4565
+ s = Date.now() + hi;
4566
4566
  }
4567
4567
  function followPinned() {
4568
4568
  i.value && Date.now() > s && scrollToBottom();
@@ -4572,29 +4572,328 @@ var Pr = [
4572
4572
  scrollToBottom(), requestAnimationFrame(scrollToBottom);
4573
4573
  });
4574
4574
  }
4575
- return t({ pin }), re(() => {
4575
+ return t({ pin }), ae(() => {
4576
4576
  requestAnimationFrame(() => {
4577
4577
  scrollToBottom(), requestAnimationFrame(scrollToBottom);
4578
4578
  }), r.value && (a = new ResizeObserver(followPinned), a.observe(r.value), n.value && a.observe(n.value), o = new MutationObserver(followPinned), o.observe(r.value, {
4579
4579
  childList: !0,
4580
4580
  subtree: !0
4581
4581
  }));
4582
- }), ne(() => {
4582
+ }), ie(() => {
4583
4583
  a?.disconnect(), o?.disconnect();
4584
- }), (e, t) => (P(), x("div", {
4584
+ }), (e, t) => (F(), C("div", {
4585
4585
  ref_key: "viewport",
4586
4586
  ref: n,
4587
- 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]" : ""]),
4587
+ class: M(["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]" : ""]),
4588
4588
  onScrollPassive: onScroll,
4589
4589
  onWheelPassive: markUserGesture,
4590
4590
  onTouchstartPassive: markUserGesture
4591
- }, [S("div", {
4591
+ }, [T("div", {
4592
4592
  ref_key: "content",
4593
4593
  ref: r,
4594
4594
  class: "flex-1 flex flex-col"
4595
- }, [ae(e.$slots, "default")], 512)], 34));
4595
+ }, [B(e.$slots, "default")], 512)], 34));
4596
+ }
4597
+ });
4598
+ //#endregion
4599
+ //#region agent/voice/provider.ts
4600
+ function isVoiceAudible(e) {
4601
+ return e >= .08;
4602
+ }
4603
+ var createVoiceProviderClient = async (e) => {
4604
+ switch (e.provider) {
4605
+ case "elevenlabs": {
4606
+ let { ElevenLabsVoiceProvider: t } = await import("./provider.js");
4607
+ return new t(e);
4608
+ }
4609
+ case "livekit": {
4610
+ let { LiveKitVoiceProvider: t } = await import("./provider2.js");
4611
+ return new t(e);
4612
+ }
4596
4613
  }
4597
- }), mi = {
4614
+ };
4615
+ function voiceSpectrum(e, t, n, r = 9) {
4616
+ if (!Number.isFinite(t) || t <= 0 || !Number.isFinite(n) || n <= 0 || r <= 0) return [];
4617
+ let i = t / n, a = [];
4618
+ for (let t = 0; t < r; t++) {
4619
+ let n = Math.max(0, Math.ceil(80 * 50 ** (t / r) / i)), o = Math.min(e.length, Math.ceil(80 * 50 ** ((t + 1) / r) / i));
4620
+ if (o <= n) {
4621
+ a.push(0);
4622
+ continue;
4623
+ }
4624
+ let s = 0;
4625
+ for (let t = n; t < o; t++) s += (e[t] / 255) ** 2;
4626
+ a.push(Math.sqrt(s / (o - n)));
4627
+ }
4628
+ return a;
4629
+ }
4630
+ function voiceRangeSpectrum(e, t = 9) {
4631
+ return !e.length || t <= 0 ? [] : Array.from({ length: t }, (n, r) => {
4632
+ let i = Math.floor(r * e.length / t), a = Math.max(i + 1, Math.floor((r + 1) * e.length / t)), o = 0;
4633
+ for (let t = i; t < Math.min(a, e.length); t++) o += (e[t] / 255) ** 2;
4634
+ return Math.sqrt(o / Math.max(1, Math.min(a, e.length) - i));
4635
+ });
4636
+ }
4637
+ //#endregion
4638
+ //#region agent/voice/voice-work-state.ts
4639
+ function createVoiceWorkState() {
4640
+ return { turnIds: /* @__PURE__ */ new Set() };
4641
+ }
4642
+ function reduceVoiceWorkEvent(e, t) {
4643
+ if (t.event === "message") {
4644
+ let n = t.data.message;
4645
+ if (n.role === "user" && n.metadata?.clientContext === "voice") return {
4646
+ ...e,
4647
+ turnIds: new Set(e.turnIds).add(n.messageId)
4648
+ };
4649
+ let r = typeof n.metadata?.turnId == "string" ? n.metadata.turnId : void 0;
4650
+ if (r && e.turnIds.has(r)) {
4651
+ let t = new Set(e.turnIds);
4652
+ return t.delete(r), e.activeTurnId === r ? { turnIds: t } : {
4653
+ ...e,
4654
+ turnIds: t
4655
+ };
4656
+ }
4657
+ return e;
4658
+ }
4659
+ let n = "turnId" in t.data && typeof t.data.turnId == "string" ? t.data.turnId : void 0;
4660
+ return !n || !e.turnIds.has(n) ? e : t.event === "working_state" ? {
4661
+ ...e,
4662
+ activeTurnId: n,
4663
+ description: t.data.description.trim() || "Working on it"
4664
+ } : t.event === "tool_activity" && t.data.status === "started" ? {
4665
+ ...e,
4666
+ activeTurnId: n,
4667
+ description: e.activeTurnId === n && e.description ? e.description : t.data.label
4668
+ } : t.event === "working_end" || t.event === "stream_end" ? {
4669
+ ...e,
4670
+ activeTurnId: void 0,
4671
+ description: void 0
4672
+ } : e;
4673
+ }
4674
+ //#endregion
4675
+ //#region agent/voice/voice-session-client.ts
4676
+ var _i = {
4677
+ start: "/audio/start-call.mp3",
4678
+ end: "/audio/end-call.mp3"
4679
+ }, vi = .7, yi = 50, bi = 15e3;
4680
+ function createBrowserVoiceChimePlayer(e) {
4681
+ let t = Object.fromEntries(Object.entries(_i).map(([t, n]) => {
4682
+ let r = new Audio(`${e}${n}`);
4683
+ return r.preload = "auto", r.volume = vi, [t, r];
4684
+ }));
4685
+ return (e) => {
4686
+ t[e].currentTime = 0, t[e].play().catch(() => {});
4687
+ };
4688
+ }
4689
+ function createBrowserVoiceWorkCue(e) {
4690
+ let t = new Audio(`${e}/audio/thinking.mp3`);
4691
+ return t.preload = "auto", t.loop = !0, t.volume = .16, (e) => {
4692
+ if (e) {
4693
+ t.play().catch(() => {});
4694
+ return;
4695
+ }
4696
+ t.pause(), t.currentTime = 0;
4697
+ };
4698
+ }
4699
+ var VoiceSessionClient = class extends s {
4700
+ constructor(e) {
4701
+ super("VoiceSessionClient", e), n(this, "state", I("idle")), n(this, "isMuted", I(!1)), n(this, "provider", void 0), n(this, "chime", void 0), n(this, "workCue", void 0), n(this, "generation", 0), n(this, "levelTimer", void 0), n(this, "startAtMs", 0), n(this, "liveAtMs", 0), n(this, "firstPlaybackEmitted", !1), n(this, "mutePending", !1), n(this, "conversationId", void 0), n(this, "workAbort", void 0), n(this, "workState", createVoiceWorkState()), n(this, "workCuePlaying", !1), n(this, "audible", !1), this.chime = e.playChime, this.workCue = e.setWorkCue;
4702
+ }
4703
+ async start() {
4704
+ if (this.state.value !== "idle") return;
4705
+ let e = ++this.generation;
4706
+ this.startAtMs = Date.now(), this.liveAtMs = 0, this.firstPlaybackEmitted = !1, this.workState = createVoiceWorkState(), this.setState("minting");
4707
+ try {
4708
+ let t = await this.mintSession(e);
4709
+ if (!t || e !== this.generation) return;
4710
+ this.conversationId && this.startWorkStream(this.conversationId, e), this.setState("connecting"), await this.connect({
4711
+ mint: t,
4712
+ generation: e
4713
+ });
4714
+ } catch (t) {
4715
+ if (e !== this.generation) return;
4716
+ this.fail(this.toSessionError(t, "VOICE_MINT_FAILED"));
4717
+ }
4718
+ }
4719
+ async end() {
4720
+ if (this.state.value === "idle" || this.state.value === "ended") return;
4721
+ let e = this.state.value === "live";
4722
+ this.generation++, e && this.playChime("end"), this.setState("ended"), await this.teardown();
4723
+ }
4724
+ async connect(e) {
4725
+ let { mint: t, generation: n } = e, r = await (this.settings.createProvider ?? createVoiceProviderClient)(t);
4726
+ if (n !== this.generation) {
4727
+ await r.disconnect().catch(() => {});
4728
+ return;
4729
+ }
4730
+ this.provider = r;
4731
+ let i = r.connect({
4732
+ onDisconnected: (e) => {
4733
+ if (!(n !== this.generation || this.provider !== r)) {
4734
+ if (this.state.value === "live" && e === "agent") {
4735
+ this.generation++, this.playChime("end"), this.setState("ended"), this.teardown();
4736
+ return;
4737
+ }
4738
+ this.fail({
4739
+ code: this.state.value === "live" ? "VOICE_CONNECTION_LOST" : "VOICE_CONNECT_FAILED",
4740
+ message: this.state.value === "live" ? "The voice connection dropped." : "Could not open the voice connection."
4741
+ });
4742
+ }
4743
+ },
4744
+ onError: (e) => {
4745
+ n === this.generation && this.provider === r && this.fail(e);
4746
+ },
4747
+ onThinkingChange: (e) => {
4748
+ n === this.generation && this.provider === r && this.settings.onThinkingChange?.(e);
4749
+ }
4750
+ }), a;
4751
+ try {
4752
+ await Promise.race([i, new Promise((e, t) => {
4753
+ a = setTimeout(() => t(Object.assign(/* @__PURE__ */ Error("Voice connection timed out."), { code: "VOICE_CONNECT_TIMEOUT" })), bi);
4754
+ })]);
4755
+ } catch (e) {
4756
+ if (i.then(() => r.disconnect()).catch(() => {}), n !== this.generation || this.provider !== r) return;
4757
+ this.fail(this.toSessionError(e, "VOICE_CONNECT_FAILED"));
4758
+ return;
4759
+ } finally {
4760
+ a && clearTimeout(a);
4761
+ }
4762
+ n !== this.generation || this.provider !== r || (this.startLevelTimer(r, n), this.liveAtMs = Date.now(), this.setState("live"), this.updateWorkCue(), this.emitMetric("voice.ready", this.liveAtMs - this.startAtMs), this.playChime("start"));
4763
+ }
4764
+ get canSendUserMessage() {
4765
+ return this.state.value === "live" && !!this.provider?.sendUserMessage;
4766
+ }
4767
+ sendUserMessage(e) {
4768
+ let t = e.trim();
4769
+ return !t || !this.canSendUserMessage ? !1 : (this.provider.sendUserMessage(t), !0);
4770
+ }
4771
+ async toggleMuted() {
4772
+ let e = this.provider;
4773
+ if (this.state.value !== "live" || !e?.setMuted || this.mutePending) return;
4774
+ let t = this.generation, n = !this.isMuted.value;
4775
+ this.mutePending = !0;
4776
+ try {
4777
+ return await e.setMuted(n), t !== this.generation || this.provider !== e || this.state.value !== "live" ? void 0 : (this.isMuted.value = n, n);
4778
+ } catch {
4779
+ return;
4780
+ } finally {
4781
+ this.mutePending = !1;
4782
+ }
4783
+ }
4784
+ emitMetric(e, t) {
4785
+ this.settings.onMetric?.({
4786
+ name: e,
4787
+ durationMs: Math.max(0, Math.round(t))
4788
+ });
4789
+ }
4790
+ setState(e) {
4791
+ this.state.value !== e && (this.state.value = e, this.settings.onStateChange?.(e));
4792
+ }
4793
+ fail(e) {
4794
+ let t = this.state.value === "live";
4795
+ this.generation++, t && this.playChime("end"), this.settings.onError?.(e), this.setState("ended"), this.teardown();
4796
+ }
4797
+ async teardown() {
4798
+ this.workAbort?.abort(), this.workAbort = void 0;
4799
+ let e = !!this.workState.activeTurnId;
4800
+ this.workState = createVoiceWorkState(), e && this.settings.onWorkChange?.({ active: !1 }), this.audible = !1, this.settings.onThinkingChange?.(!1), this.setWorkCue(!1), this.levelTimer !== void 0 && (clearInterval(this.levelTimer), this.levelTimer = void 0);
4801
+ let t = this.provider;
4802
+ this.provider = void 0, this.isMuted.value = !1, this.settings.onLevel?.({
4803
+ source: "playback",
4804
+ level: 0
4805
+ }), t && await t.disconnect().catch(() => {});
4806
+ }
4807
+ startLevelTimer(e, t) {
4808
+ this.levelTimer === void 0 && (this.levelTimer = setInterval(() => {
4809
+ if (t !== this.generation || this.provider !== e) return;
4810
+ let n = e.sampleLevel();
4811
+ n && (this.settings.onLevel?.(n), this.audible = isVoiceAudible(n.level), this.updateWorkCue(), !this.firstPlaybackEmitted && n.source === "playback" && isVoiceAudible(n.level) && this.liveAtMs > 0 && (this.firstPlaybackEmitted = !0, this.emitMetric("voice.first_playback", Date.now() - this.liveAtMs)));
4812
+ }, yi));
4813
+ }
4814
+ authHeaders() {
4815
+ return this.settings.token ? { Authorization: `Bearer ${this.settings.token}` } : {};
4816
+ }
4817
+ startWorkStream(e, n) {
4818
+ this.workAbort?.abort();
4819
+ let r = new AbortController();
4820
+ this.workAbort = r;
4821
+ let i = t(this.settings.apiBase, this.settings.isDev), a = this.settings.fetchFn ?? fetch, o = this.settings.latestSequence ? `${i}/api/conversations/${encodeURIComponent(e)}/stream?since=${encodeURIComponent(this.settings.latestSequence)}` : `${i}/api/conversations/${encodeURIComponent(e)}/stream`;
4822
+ (async () => {
4823
+ let e = await a(o, {
4824
+ headers: {
4825
+ Accept: "text/event-stream",
4826
+ ...this.authHeaders()
4827
+ },
4828
+ credentials: "include",
4829
+ signal: r.signal
4830
+ });
4831
+ if (!(!e.ok || !e.body)) for await (let t of h(e.body.getReader())) {
4832
+ if (r.signal.aborted || n !== this.generation) return;
4833
+ let e = this.workState, i = reduceVoiceWorkEvent(e, t);
4834
+ i !== e && (this.workState = i, (i.activeTurnId !== e.activeTurnId || i.description !== e.description) && (this.settings.onWorkChange?.({
4835
+ active: !!i.activeTurnId,
4836
+ ...i.description ? { description: i.description } : {}
4837
+ }), this.updateWorkCue()));
4838
+ }
4839
+ })().catch(() => {});
4840
+ }
4841
+ updateWorkCue() {
4842
+ this.setWorkCue(this.state.value === "live" && !!this.workState.activeTurnId && !this.audible);
4843
+ }
4844
+ setWorkCue(e) {
4845
+ this.workCuePlaying !== e && (this.workCuePlaying = e, this.workCue ?? (this.workCue = createBrowserVoiceWorkCue(t(this.settings.apiBase, this.settings.isDev))), this.workCue(e));
4846
+ }
4847
+ playChime(e) {
4848
+ this.chime ?? (this.chime = createBrowserVoiceChimePlayer(t(this.settings.apiBase, this.settings.isDev))), this.chime(e);
4849
+ }
4850
+ async post(e) {
4851
+ let n = t(this.settings.apiBase, this.settings.isDev), r = await (this.settings.fetchFn ?? fetch)(`${n}${e.path}`, {
4852
+ method: "POST",
4853
+ headers: {
4854
+ "Content-Type": "application/json",
4855
+ ...this.authHeaders()
4856
+ },
4857
+ credentials: "include",
4858
+ body: JSON.stringify(e.body)
4859
+ }), i = await r.json();
4860
+ if (!r.ok || !i.ok) {
4861
+ let e = i.ok ? `HTTP ${r.status}` : i.error, t = !i.ok && i.code ? i.code : "VOICE_MINT_FAILED";
4862
+ throw Object.assign(Error(e || "Voice request failed."), { code: t });
4863
+ }
4864
+ return i.data;
4865
+ }
4866
+ async mintSession(e) {
4867
+ let t = this.settings.conversationId;
4868
+ if (!t && (t = (await this.post({
4869
+ path: "/api/conversations",
4870
+ body: {
4871
+ orgId: this.settings.orgId,
4872
+ participants: [{
4873
+ type: "agent",
4874
+ id: this.settings.agentId
4875
+ }]
4876
+ }
4877
+ })).conversationId, e !== this.generation)) return null;
4878
+ let n = await this.post({
4879
+ path: "/api/voice/sessions",
4880
+ body: { conversationId: t }
4881
+ });
4882
+ if (e !== this.generation) return null;
4883
+ let r = _.safeParse(n);
4884
+ if (!r.success) throw Object.assign(/* @__PURE__ */ Error("Voice session mint returned an unexpected shape."), { code: "VOICE_MINT_INVALID" });
4885
+ return this.conversationId = t, r.data;
4886
+ }
4887
+ toSessionError(e, t) {
4888
+ return e instanceof Error ? {
4889
+ code: "code" in e ? String(e.code) : t,
4890
+ message: e.message
4891
+ } : {
4892
+ code: t,
4893
+ message: "Voice session failed to start."
4894
+ };
4895
+ }
4896
+ }, xi = {
4598
4897
  VOICE_MIC_UNAVAILABLE: "I couldn't reach your microphone. Check that this site is allowed to use it, then try again.",
4599
4898
  VOICE_AGENT_UNAVAILABLE: "Your assistant didn't pick up. Give it a moment and start the call again.",
4600
4899
  VOICE_CONNECT_TIMEOUT: "The call took too long to connect. Try again in a moment.",
@@ -4602,36 +4901,36 @@ var Pr = [
4602
4901
  VOICE_UNAVAILABLE: "Voice isn't available right now. You can keep going by typing.",
4603
4902
  VOICE_MINT_INVALID: "That call couldn't be started. Refresh the page and try again.",
4604
4903
  VOICE_PROVIDER_ERROR: "The call ended unexpectedly. Try again, or keep going by typing."
4605
- }, hi = "The call ended unexpectedly. Try again, or keep going by typing.";
4904
+ }, Si = "The call ended unexpectedly. Try again, or keep going by typing.";
4606
4905
  function voiceErrorMessage(e) {
4607
- return e && mi[e] || hi;
4906
+ return e && xi[e] || Si;
4608
4907
  }
4609
4908
  //#endregion
4610
4909
  //#region agent/ui/VoiceMode.vue?vue&type=script&setup=true&lang.ts
4611
- var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4910
+ var Ci = ["data-voice-state", "data-voice-activity"], wi = ["src"], Ti = {
4612
4911
  key: 1,
4613
4912
  "data-test": "voice-background-fallback",
4614
4913
  "aria-hidden": "true",
4615
4914
  class: "pointer-events-none absolute inset-0 bg-[#0A1522]"
4616
- }, yi = { class: "relative z-10 flex flex-1 flex-col items-center justify-center px-8 pb-24" }, bi = { "data-voice-assistant-avatar": "" }, xi = {
4915
+ }, Ei = { class: "relative z-10 flex flex-1 flex-col items-center justify-center px-8 pb-24" }, Di = { "data-voice-assistant-avatar": "" }, Oi = {
4617
4916
  "data-test": "voice-histogram",
4618
4917
  "aria-hidden": "true",
4619
4918
  class: "mt-10 flex h-[38px] items-center gap-[5px]"
4620
- }, Si = {
4919
+ }, ki = {
4621
4920
  "data-test": "voice-presence-status",
4622
4921
  role: "status",
4623
4922
  "aria-live": "polite",
4624
4923
  class: "sr-only"
4625
- }, Ci = {
4924
+ }, Ai = {
4626
4925
  "data-test": "voice-visible-status",
4627
4926
  "aria-hidden": "true",
4628
4927
  class: "mt-5 min-h-5 text-center text-sm font-medium tracking-wide text-white/80"
4629
- }, wi = { 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" }, Ti = [
4928
+ }, ji = { 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" }, Mi = [
4630
4929
  "disabled",
4631
4930
  "aria-label",
4632
4931
  "aria-pressed",
4633
4932
  "title"
4634
- ], Ei = 5, Di = 33, Oi = .7, ki = .1, Ai = 60, ji = 320, Mi = /*@__PURE__*/ k({
4933
+ ], Ni = 5, Pi = 33, Fi = .7, Ii = .1, Li = 60, Ri = 320, zi = /*@__PURE__*/ j({
4635
4934
  __name: "VoiceMode",
4636
4935
  props: {
4637
4936
  agent: {},
@@ -4641,48 +4940,82 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4641
4940
  },
4642
4941
  emits: ["end"],
4643
4942
  setup(e, { expose: t, emit: n }) {
4644
- let r = n, i = F(0), a = F("mic"), o = F("idle"), s = F(!1), c = F(!1), u = F({ active: !1 }), f = B(!1), p = B(!1), m = B(), _ = se("endButton"), te = se("muteButton"), b = !1, C, k = v(() => s.value ? "error" : o.value === "live" ? i.value > .01 ? a.value === "playback" ? "speaking" : "listening" : u.value.active ? "working" : c.value ? "thinking" : "listening" : "connecting"), A = v(() => k.value === "connecting" || k.value === "thinking" || k.value === "working"), ne = [
4943
+ let r = n, i = I(0), a = I("mic"), o = I("idle"), s = I(!1), c = I(!1), u = I({ active: !1 }), f = ce(!1), p = ce(!1), m = ce(), te = U("endButton"), h = U("muteButton"), _ = !1, ne, x = {
4944
+ connecting: {
4945
+ label: "Connecting",
4946
+ tone: "bg-amber-500",
4947
+ waits: !0,
4948
+ showsText: !1
4949
+ },
4950
+ listening: {
4951
+ label: "Listening",
4952
+ tone: "bg-green-500",
4953
+ waits: !1,
4954
+ showsText: !1
4955
+ },
4956
+ thinking: {
4957
+ label: "Thinking",
4958
+ tone: "bg-amber-500",
4959
+ waits: !0,
4960
+ showsText: !1
4961
+ },
4962
+ working: {
4963
+ label: "Working",
4964
+ tone: "bg-primary-500",
4965
+ waits: !0,
4966
+ showsText: !0
4967
+ },
4968
+ speaking: {
4969
+ label: "Speaking",
4970
+ tone: "bg-primary-500",
4971
+ waits: !1,
4972
+ showsText: !1
4973
+ },
4974
+ error: {
4975
+ label: "Connection problem",
4976
+ tone: "bg-red-500",
4977
+ waits: !1,
4978
+ showsText: !0,
4979
+ visibleText: "Connection lost"
4980
+ }
4981
+ }, S = b(() => s.value ? "error" : o.value === "live" ? isVoiceAudible(i.value) ? a.value === "playback" ? "speaking" : "listening" : u.value.active ? "working" : c.value ? "thinking" : "listening" : "connecting"), k = b(() => x[S.value]), j = b(() => k.value.waits), re = [
4645
4982
  0,
4646
4983
  2,
4647
4984
  4,
4648
4985
  6,
4649
4986
  8
4650
- ], ae = ne.map(() => 0), R = F(ae), oe = F(ae), ce = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : void 0, ue = typeof window < "u" && typeof window.requestAnimationFrame == "function" ? (e) => window.requestAnimationFrame(e) : (e) => setTimeout(() => e(performance.now()), 16), U = 0, de = 0;
4987
+ ], ie = re.map(() => 0), B = I(ie), se = I(ie), ue = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : void 0, de = typeof window < "u" && typeof window.requestAnimationFrame == "function" ? (e) => window.requestAnimationFrame(e) : (e) => setTimeout(() => e(performance.now()), 16), pe = 0, he = 0;
4651
4988
  async function end() {
4652
- b = !0, await m.value?.end();
4989
+ _ = !0, await m.value?.end();
4653
4990
  }
4654
4991
  t({ end });
4655
4992
  function easeFrame(e) {
4656
- U = 0;
4657
- let t = Math.min(64, Math.max(0, e - de));
4658
- de = e;
4993
+ pe = 0;
4994
+ let t = Math.min(64, Math.max(0, e - he));
4995
+ he = e;
4659
4996
  let ease = (e, n) => {
4660
- let r = n > e ? Ai : ji;
4997
+ let r = n > e ? Li : Ri;
4661
4998
  return e + (n - e) * (1 - Math.exp(-t / r));
4662
4999
  };
4663
- oe.value = oe.value.map((e, t) => ease(e, R.value[t] ?? 0)), !oe.value.every((e, t) => Math.abs((R.value[t] ?? 0) - e) <= 5e-4) || R.value.some((e) => e > 0) ? U = ue(easeFrame) : oe.value = ae;
5000
+ se.value = se.value.map((e, t) => ease(e, B.value[t] ?? 0)), !se.value.every((e, t) => Math.abs((B.value[t] ?? 0) - e) <= 5e-4) || B.value.some((e) => e > 0) ? pe = de(easeFrame) : se.value = ie;
4664
5001
  }
4665
5002
  function followLevel(e) {
4666
- let gate = (e) => Math.max(0, e - ki) / (1 - ki);
4667
- if (R.value = ne.map((t) => f.value ? 0 : gate(Math.min(1, Math.max(0, e?.[t] ?? i.value)))), ce?.matches) {
4668
- oe.value = R.value;
5003
+ let gate = (e) => Math.max(0, e - Ii) / (1 - Ii);
5004
+ if (B.value = re.map((t) => f.value ? 0 : gate(Math.min(1, Math.max(0, e?.[t] ?? i.value)))), ue?.matches) {
5005
+ se.value = B.value;
4669
5006
  return;
4670
5007
  }
4671
- U || (de = performance.now(), U = ue(easeFrame));
4672
- }
4673
- let W = v(() => oe.value.map((e) => Math.round((Ei + Math.min(1, Math.max(0, e)) ** Oi * Di) * 10) / 10)), he = v(() => k.value === "error" ? "bg-red-500" : f.value ? "bg-theme-400" : k.value === "connecting" || k.value === "thinking" ? "bg-amber-500" : k.value === "working" || k.value === "speaking" ? "bg-primary-500" : "bg-green-500"), G = {
4674
- connecting: "Connecting",
4675
- listening: "Listening",
4676
- thinking: "Thinking",
4677
- working: "Working",
4678
- speaking: "Speaking",
4679
- error: "Connection problem"
4680
- }, _e = v(() => k.value === "working" ? u.value.description || "Working on it" : G[k.value]), K = v(() => k.value === "working" || k.value === "error" ? _e.value : "");
5008
+ pe || (he = performance.now(), pe = de(easeFrame));
5009
+ }
5010
+ let _e = b(() => se.value.map((e) => Math.round((Ni + Math.min(1, Math.max(0, e)) ** Fi * Pi) * 10) / 10)), G = b(() => f.value && S.value !== "error" ? "bg-theme-400" : k.value.tone), K = b(() => S.value === "working" ? u.value.description || "Working on it" : k.value.label), ve = b(() => {
5011
+ let e = k.value;
5012
+ return e.showsText ? S.value === "working" ? K.value : e.visibleText ?? e.label : "";
5013
+ });
4681
5014
  function emitEnd() {
4682
- b || (b = !0, r("end"));
5015
+ _ || (_ = !0, r("end"));
4683
5016
  }
4684
5017
  function trapFocus(e) {
4685
- e.shiftKey && document.activeElement === _.value ? (e.preventDefault(), te.value?.focus()) : !e.shiftKey && document.activeElement === te.value && (e.preventDefault(), _.value?.focus());
5018
+ e.shiftKey && document.activeElement === te.value ? (e.preventDefault(), h.value?.focus()) : !e.shiftKey && document.activeElement === h.value && (e.preventDefault(), te.value?.focus());
4686
5019
  }
4687
5020
  async function toggleMute() {
4688
5021
  let e = m.value;
@@ -4691,14 +5024,14 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4691
5024
  let t = await e.toggleMuted();
4692
5025
  t !== void 0 && (f.value = t, followLevel(void 0)), p.value = !1;
4693
5026
  }
4694
- return re(async () => {
4695
- _.value?.focus({ preventScroll: !0 });
5027
+ return ae(async () => {
5028
+ te.value?.focus({ preventScroll: !0 });
4696
5029
  let t = e.chatController?.createVoiceClient({
4697
5030
  onLevel: (e) => {
4698
5031
  a.value = e.source, i.value = e.level, followLevel(e.bands);
4699
5032
  },
4700
5033
  onStateChange: (e) => {
4701
- o.value = e, e === "ended" && (s.value ? C = setTimeout(emitEnd, 1600) : emitEnd());
5034
+ o.value = e, e === "ended" && (s.value ? ne = setTimeout(emitEnd, 1600) : emitEnd());
4702
5035
  },
4703
5036
  onThinkingChange: (e) => {
4704
5037
  c.value = e;
@@ -4721,16 +5054,16 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4721
5054
  return;
4722
5055
  }
4723
5056
  m.value = t, await t.start();
4724
- }), ie(() => {
4725
- b = !0, C && clearTimeout(C), U && typeof window < "u" && typeof window.cancelAnimationFrame == "function" && window.cancelAnimationFrame(U), U = 0, m.value?.end();
4726
- }), (t, n) => (P(), x("div", {
5057
+ }), oe(() => {
5058
+ _ = !0, ne && clearTimeout(ne), pe && typeof window < "u" && typeof window.cancelAnimationFrame == "function" && window.cancelAnimationFrame(pe), pe = 0, m.value?.end();
5059
+ }), (t, n) => (F(), C("div", {
4727
5060
  "data-test": "voice-mode",
4728
5061
  "data-voice-state": o.value,
4729
- "data-voice-activity": k.value,
5062
+ "data-voice-activity": S.value,
4730
5063
  class: "relative flex min-h-0 flex-1 flex-col overflow-hidden bg-[#0A1522] text-white",
4731
- onKeydown: pe(trapFocus, ["tab"])
5064
+ onKeydown: W(trapFocus, ["tab"])
4732
5065
  }, [
4733
- e.backdropSrc ? (P(), x("img", {
5066
+ e.backdropSrc ? (F(), C("img", {
4734
5067
  key: 0,
4735
5068
  "data-test": "voice-background-image",
4736
5069
  src: e.backdropSrc,
@@ -4738,83 +5071,83 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4738
5071
  "aria-hidden": "true",
4739
5072
  draggable: "false",
4740
5073
  class: "pointer-events-none absolute inset-0 size-full object-cover"
4741
- }, null, 8, _i)) : (P(), x("div", vi)),
4742
- n[1] || (n[1] = S("div", {
5074
+ }, null, 8, wi)) : (F(), C("div", Ti)),
5075
+ n[1] || (n[1] = T("div", {
4743
5076
  "data-test": "voice-background-overlay",
4744
5077
  "aria-hidden": "true",
4745
5078
  class: "pointer-events-none absolute inset-0 bg-gradient-to-b from-[#050F19]/65 via-[#050F19]/75 to-[#050F19]/90"
4746
5079
  }, null, -1)),
4747
- S("div", yi, [
4748
- S("div", bi, [T(He, {
5080
+ T("div", Ei, [
5081
+ T("div", Di, [A(Ge, {
4749
5082
  agent: e.agent,
4750
5083
  "show-status": !1,
4751
5084
  "show-owner-mark": !1,
4752
5085
  "is-light": !1,
4753
5086
  class: "size-32"
4754
5087
  }, null, 8, ["agent"])]),
4755
- S("div", xi, [(P(!0), x(h, null, I(W.value, (e, t) => (P(), x("span", {
5088
+ T("div", Oi, [(F(!0), C(v, null, R(_e.value, (e, t) => (F(), C("span", {
4756
5089
  key: t,
4757
5090
  "data-test": "voice-histogram-bar",
4758
- class: j(["w-[5px] rounded-full transition-colors duration-150", [he.value, A.value ? "pl-voice-bar-wave" : ""]]),
4759
- style: M({
5091
+ class: M(["w-[5px] rounded-full transition-colors duration-150", [G.value, j.value ? "pl-voice-bar-wave" : ""]]),
5092
+ style: P({
4760
5093
  height: `${e}px`,
4761
- ...A.value ? { animationDelay: `${t * 90}ms` } : {}
5094
+ ...j.value ? { animationDelay: `${t * 90}ms` } : {}
4762
5095
  })
4763
5096
  }, null, 6))), 128))]),
4764
- S("div", Si, H(_e.value), 1),
4765
- S("p", Ci, H(K.value), 1)
5097
+ T("div", ki, H(K.value), 1),
5098
+ T("p", Ai, H(ve.value), 1)
4766
5099
  ]),
4767
- S("div", wi, [S("button", {
5100
+ T("div", ji, [T("button", {
4768
5101
  ref_key: "endButton",
4769
- ref: _,
5102
+ ref: te,
4770
5103
  type: "button",
4771
5104
  "data-test": "voice-end-btn",
4772
5105
  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",
4773
5106
  "aria-label": "Hang up",
4774
5107
  title: "Hang up",
4775
5108
  onClick: emitEnd
4776
- }, [...n[0] || (n[0] = [S("i", {
5109
+ }, [...n[0] || (n[0] = [T("i", {
4777
5110
  class: "i-tabler-x size-[25px]",
4778
5111
  "aria-hidden": "true"
4779
- }, null, -1)])], 512), S("button", {
5112
+ }, null, -1)])], 512), T("button", {
4780
5113
  ref_key: "muteButton",
4781
- ref: te,
5114
+ ref: h,
4782
5115
  type: "button",
4783
5116
  "data-test": "voice-mute-btn",
4784
- class: j(["flex size-16 items-center justify-center rounded-full ring-1 transition-colors active:opacity-70", [f.value ? "bg-white text-[#050F19] ring-white" : "bg-white/10 text-white ring-white/20", o.value === "live" && !p.value ? "cursor-pointer" : "cursor-default opacity-50"]]),
5117
+ class: M(["flex size-16 items-center justify-center rounded-full ring-1 transition-colors active:opacity-70", [f.value ? "bg-white text-[#050F19] ring-white" : "bg-white/10 text-white ring-white/20", o.value === "live" && !p.value ? "cursor-pointer" : "cursor-default opacity-50"]]),
4785
5118
  disabled: o.value !== "live" || p.value,
4786
5119
  "aria-label": f.value ? "Unmute microphone" : "Mute microphone",
4787
5120
  "aria-pressed": f.value,
4788
5121
  title: f.value ? "Unmute microphone" : "Mute microphone",
4789
5122
  onClick: toggleMute
4790
- }, [S("i", {
4791
- class: j([f.value ? "i-tabler-microphone-off" : "i-tabler-microphone", "size-[25px]"]),
5123
+ }, [T("i", {
5124
+ class: M([f.value ? "i-tabler-microphone-off" : "i-tabler-microphone", "size-[25px]"]),
4792
5125
  "aria-hidden": "true"
4793
- }, null, 2)], 10, Ti)])
4794
- ], 40, gi));
5126
+ }, null, 2)], 10, Mi)])
5127
+ ], 40, Ci));
4795
5128
  }
4796
- }), Ni = /* @__PURE__ */ e((e, t) => {
5129
+ }), Bi = /* @__PURE__ */ e((e, t) => {
4797
5130
  let n = e.__vccOpts || e;
4798
5131
  for (let [e, r] of t) n[e] = r;
4799
5132
  return n;
4800
- }, "default"), Pi = /*#__PURE__*/ Ni(Mi, [["__scopeId", "data-v-0ef90b85"]]), Fi = {
5133
+ }, "default"), Vi = /*#__PURE__*/ Bi(zi, [["__scopeId", "data-v-62c3b75d"]]), Hi = {
4801
5134
  key: 0,
4802
5135
  class: "pb-4"
4803
- }, Ii = {
5136
+ }, Ui = {
4804
5137
  key: 1,
4805
5138
  "data-test": "messaging-sdk-header",
4806
5139
  class: "shrink-0 border-b border-theme-100 px-4 py-3"
4807
- }, Li = { class: "min-w-0 flex-1" }, Ri = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, zi = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, Bi = {
5140
+ }, Wi = { class: "min-w-0 flex-1" }, Gi = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, Ki = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, qi = {
4808
5141
  key: 0,
4809
5142
  class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
4810
- }, Vi = ["aria-label"], Hi = {
5143
+ }, Ji = ["aria-label"], Yi = {
4811
5144
  key: 0,
4812
5145
  "data-test": "messaging-empty-state",
4813
5146
  class: "flex flex-col items-center justify-center px-4"
4814
- }, Ui = ["title"], Wi = {
5147
+ }, Xi = ["title"], Zi = {
4815
5148
  key: 0,
4816
5149
  class: "flex items-center gap-3 py-3 px-2"
4817
- }, Gi = ["data-journal-outcome"], Ki = [
5150
+ }, Qi = ["data-journal-outcome"], $i = [
4818
5151
  "data-message-id",
4819
5152
  "data-message-sender",
4820
5153
  "data-conversation-id",
@@ -4825,7 +5158,7 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4825
5158
  "data-issue-action-label",
4826
5159
  "data-issue-action-url",
4827
5160
  "data-streaming"
4828
- ], qi = { class: "max-w-[85%] min-w-0" }, Ji = ["href"], Yi = [
5161
+ ], ea = { class: "max-w-[85%] min-w-0" }, ta = ["href"], na = [
4829
5162
  "data-message-id",
4830
5163
  "data-message-sender",
4831
5164
  "data-conversation-id",
@@ -4834,7 +5167,7 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4834
5167
  "data-issue-code",
4835
5168
  "data-issue-bucket",
4836
5169
  "data-streaming"
4837
- ], Xi = [
5170
+ ], ra = [
4838
5171
  "data-test",
4839
5172
  "data-message-id",
4840
5173
  "data-message-sender",
@@ -4844,57 +5177,57 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4844
5177
  "data-streaming",
4845
5178
  "data-queued",
4846
5179
  "aria-label"
4847
- ], Zi = ["src", "alt"], Qi = ["src"], $i = ["href"], ea = {
5180
+ ], ia = ["src", "alt"], aa = ["src"], oa = ["href"], sa = {
4848
5181
  key: 0,
4849
5182
  "data-test": "messaging-message-text-part"
4850
- }, ta = [
5183
+ }, ca = [
4851
5184
  "src",
4852
5185
  "alt",
4853
5186
  "data-attachment-placement"
4854
- ], na = ["src", "data-attachment-placement"], ra = ["href", "data-attachment-placement"], ia = ["data-journal-outcome"], aa = {
5187
+ ], la = ["src", "data-attachment-placement"], ua = ["href", "data-attachment-placement"], da = ["data-journal-outcome"], fa = {
4855
5188
  key: 2,
4856
5189
  "data-test": "messaging-tool-activity-tail",
4857
5190
  "aria-label": "Assistant is still working",
4858
5191
  class: "mb-4 grid h-[17px] w-5 place-items-center"
4859
- }, oa = ["data-journal-outcome"], sa = ["data-test", "data-working-description"], ca = {
5192
+ }, pa = ["data-journal-outcome"], ma = ["data-test", "data-working-description"], ha = {
4860
5193
  class: "flex items-center gap-[5px]",
4861
5194
  "aria-hidden": "true"
4862
- }, la = { class: "truncate" }, ua = ["data-issue-code"], da = ["href"], fa = ["inert", "aria-hidden"], pa = ["data-seat-state"], ma = ["src", "alt"], ha = { class: "max-w-20 truncate" }, ga = ["onClick"], _a = {
5195
+ }, ga = { class: "truncate" }, _a = ["data-issue-code"], va = ["href"], ya = ["inert", "aria-hidden"], ba = ["data-seat-state"], xa = ["src", "alt"], Sa = { class: "max-w-20 truncate" }, Ca = ["onClick"], wa = {
4863
5196
  key: 0,
4864
5197
  class: "shrink-0 flex items-center justify-center size-14"
4865
- }, va = ["data-composer-action"], ya = ["placeholder", "disabled"], ba = { class: "font-mono text-sm tabular-nums" }, xa = { class: "mt-2.5 flex items-center" }, Sa = [
5198
+ }, Ta = ["data-composer-action"], Ea = ["placeholder", "disabled"], Da = { class: "font-mono text-sm tabular-nums" }, Oa = { class: "mt-2.5 flex items-center" }, ka = [
4866
5199
  "disabled",
4867
5200
  "aria-label",
4868
5201
  "title"
4869
- ], Ca = {
5202
+ ], Aa = {
4870
5203
  key: 0,
4871
5204
  class: "i-svg-spinners-ring-resize size-5"
4872
- }, wa = {
5205
+ }, ja = {
4873
5206
  key: 1,
4874
5207
  class: "i-tabler-plus size-5"
4875
- }, Ta = { class: "sr-only" }, Ea = { class: "flex items-center gap-2" }, Da = ["aria-label", "title"], Oa = { class: "sr-only" }, ka = [
5208
+ }, Ma = { class: "sr-only" }, Na = { class: "flex items-center gap-2" }, Pa = ["aria-label", "title"], Fa = { class: "sr-only" }, Ia = [
4876
5209
  "disabled",
4877
5210
  "aria-label",
4878
5211
  "title"
4879
- ], Aa = {
5212
+ ], La = {
4880
5213
  class: "flex h-4 items-center gap-[2px]",
4881
5214
  "aria-hidden": "true"
4882
- }, ja = [
5215
+ }, Ra = [
4883
5216
  "data-composer-action",
4884
5217
  "disabled",
4885
5218
  "aria-label",
4886
5219
  "title"
4887
- ], Ma = {
5220
+ ], za = {
4888
5221
  key: 0,
4889
5222
  class: "i-tabler-player-stop-filled size-3.5"
4890
- }, Na = {
5223
+ }, Ba = {
4891
5224
  key: 1,
4892
5225
  class: "i-tabler-arrow-up size-[17px]"
4893
- }, Pa = { class: "sr-only" }, Fa = {
5226
+ }, Va = { class: "sr-only" }, Ha = {
4894
5227
  key: 2,
4895
5228
  "data-test": "messaging-ai-notice",
4896
5229
  class: "mx-auto max-w-[720px] pt-2 text-center text-[11.5px] leading-none text-theme-300"
4897
- }, Ia = /*#__PURE__*/ Ni(/* @__PURE__ */ k({
5230
+ }, Ua = /*#__PURE__*/ Bi(/* @__PURE__ */ j({
4898
5231
  __name: "ElAgentChat",
4899
5232
  props: {
4900
5233
  chatController: {},
@@ -4931,37 +5264,37 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4931
5264
  label: "Public",
4932
5265
  tooltip: "Anyone with the link can see this"
4933
5266
  }
4934
- }, n = v(() => {
5267
+ }, n = b(() => {
4935
5268
  let n = { ...t[e.scope] };
4936
5269
  return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
4937
- }), r = F(), i = F(), o = F();
5270
+ }), r = I(), i = I(), a = I();
4938
5271
  function containsMarkdownLink(e) {
4939
5272
  return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
4940
5273
  }
4941
5274
  function isSystemExplainerMessage(e) {
4942
- return e.sender === "system" && (!!e.issue || e.id === K.value);
5275
+ return e.sender === "system" && (!!e.issue || e.id === U.value);
4943
5276
  }
4944
5277
  function isGroupEnd(e, t) {
4945
5278
  let n = e[t], r = e[t + 1];
4946
5279
  return !r || r.sender !== n.sender;
4947
5280
  }
4948
- let s = v(() => e.chatController?.textState.value), u = v(() => s.value?.isConnected ?? !1), f = v(() => s.value?.isThinking ?? !1), p = v(() => s.value?.connectionStatus !== "connected" && !s.value?.error), m = v(() => e.chatController?.liveTurnBlocks?.value ?? []), k = v(() => {
5281
+ let s = b(() => e.chatController?.textState.value), c = b(() => s.value?.isConnected ?? !1), f = b(() => s.value?.isThinking ?? !1), p = b(() => s.value?.connectionStatus !== "connected" && !s.value?.error), m = b(() => e.chatController?.liveTurnBlocks?.value ?? []), te = b(() => {
4949
5282
  for (let e = m.value.length - 1; e >= 0; e--) {
4950
5283
  let t = m.value[e];
4951
5284
  if (t?.kind === "text") return t.id;
4952
5285
  }
4953
- }), ne = v(() => e.chatController?.liveStreamMessageId?.value), R = v(() => {
5286
+ }), h = b(() => e.chatController?.liveStreamMessageId?.value), _ = b(() => {
4954
5287
  let t = e.chatController?.sharedMessages.value ?? [];
4955
- return m.value.length && ne.value ? t.filter((e) => e.id !== ne.value) : t;
4956
- }), B = v(() => {
5288
+ return m.value.length && h.value ? t.filter((e) => e.id !== h.value) : t;
5289
+ }), j = b(() => {
4957
5290
  if (!e.chatController?.workJournal?.value) return s.value?.workingDescription?.trim() || void 0;
4958
- }), oe = v(() => e.chatController?.workJournal?.value), se = v(() => {
4959
- if (!oe.value && !m.value.length) return;
4960
- let e = R.value, t = e[e.length - 1];
5291
+ }), ie = b(() => e.chatController?.workJournal?.value), se = b(() => {
5292
+ if (!ie.value && !m.value.length) return;
5293
+ let e = _.value, t = e[e.length - 1];
4961
5294
  if (t) return t.sender === "agent" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
4962
- }), he = v(() => {
5295
+ }), ce = b(() => {
4963
5296
  let t = {};
4964
- for (let n of R.value) {
5297
+ for (let n of _.value) {
4965
5298
  if (n.sender === "user" || !n.toolActivities?.length) continue;
4966
5299
  let r = e.chatController?.workJournalFor?.({
4967
5300
  activities: n.toolActivities,
@@ -4973,7 +5306,7 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
4973
5306
  return t;
4974
5307
  });
4975
5308
  function messageWorkJournal(e) {
4976
- return he.value[e.id];
5309
+ return ce.value[e.id];
4977
5310
  }
4978
5311
  function inlineOffset(e, t) {
4979
5312
  return e.placement?.kind !== "inline" || !Number.isFinite(e.placement.offset) ? null : Math.max(0, Math.min(t.length, Math.trunc(e.placement.offset)));
@@ -5021,47 +5354,47 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5021
5354
  text: t.slice(i)
5022
5355
  }), r;
5023
5356
  }
5024
- let G = v(() => s.value?.transientIssue), K = v(() => {
5357
+ let ue = b(() => s.value?.transientIssue), U = b(() => {
5025
5358
  if (!f.value) return;
5026
- let e = R.value, t = e[e.length - 1];
5359
+ let e = _.value, t = e[e.length - 1];
5027
5360
  return t?.sender === "agent" || t?.sender === "system" ? t.id : void 0;
5028
- }), ve = v(() => !f.value || B.value || oe.value || m.value.length ? !1 : K.value === void 0), q = v(() => B.value ?? (ve.value ? "Thinking…" : void 0)), ye = v(() => s.value?.sendBlockedReason), be = v(() => ye.value === "agent_deleted"), Se = v(() => p.value ? "Connecting..." : ye.value === "agent_deleted" ? "This assistant was deleted" : "Send a message"), Ce = v(() => c(e.agent.state.value)), we = v(() => {
5029
- if (Ge.value || !Ce.value || Ce.value === "awake") return;
5361
+ }), K = b(() => !f.value || j.value || ie.value || m.value.length ? !1 : U.value === void 0), ve = b(() => j.value ?? (K.value ? "Thinking…" : void 0)), ye = b(() => s.value?.sendBlockedReason), be = b(() => ye.value === "agent_deleted"), Se = b(() => p.value ? "Connecting..." : ye.value === "agent_deleted" ? "This assistant was deleted" : "Send a message"), Ce = b(() => u(e.agent.state.value)), we = b(() => {
5362
+ if (We.value || !Ce.value || Ce.value === "awake") return;
5030
5363
  let t = e.agent.displayName.value || e.agent.name.value || "Your assistant";
5031
- return Ce.value === "changing" ? `${t} will be right back…` : `${t} is ${a[Ce.value].toLowerCase()}.`;
5032
- }), Te = v(() => e.chatController?.composerState?.value ?? {
5364
+ return Ce.value === "changing" ? `${t} will be right back…` : `${t} is ${o[Ce.value].toLowerCase()}.`;
5365
+ }), Te = b(() => e.chatController?.composerState?.value ?? {
5033
5366
  text: "",
5034
5367
  pendingAttachments: [],
5035
5368
  isUploading: !1
5036
- }), Ee = v({
5369
+ }), Ee = b({
5037
5370
  get: () => Te.value.text,
5038
5371
  set: (t) => e.chatController?.setComposerText?.({ text: t })
5039
- }), De = v(() => Te.value.pendingAttachments), Oe = v(() => Te.value.isUploading), ke = v(() => e.chatController?.voiceRecorder), Ae = v(() => ke.value?.isBusy.value ?? !1), je = v(() => e.chatController?.canAttachFile?.value ?? !1), Me = v(() => e.chatController?.canRecordAudio?.value ?? !1), Ne = v(() => e.chatController?.composerAction?.value ?? "idle"), Pe = v(() => Ne.value !== "idle"), Fe = v(() => e.chatController?.composerShowsSecondaryStop?.value ?? !1), Ie = v(() => e.chatController?.queuedMessageIds?.value);
5372
+ }), De = b(() => Te.value.pendingAttachments), Oe = b(() => Te.value.isUploading), ke = b(() => e.chatController?.voiceRecorder), Ae = b(() => ke.value?.isBusy.value ?? !1), je = b(() => e.chatController?.canAttachFile?.value ?? !1), Me = b(() => e.chatController?.canRecordAudio?.value ?? !1), Ne = b(() => e.chatController?.composerAction?.value ?? "idle"), Pe = b(() => Ne.value !== "idle"), Fe = b(() => e.chatController?.composerShowsSecondaryStop?.value ?? !1), Ie = b(() => e.chatController?.queuedMessageIds?.value);
5040
5373
  function isQueuedMessage(e) {
5041
5374
  return Ie.value?.has(e) ?? !1;
5042
5375
  }
5043
- let Re = v(() => Ne.value === "stop" ? "Stop reply" : Fe.value ? "Send — answered after current work" : "Send message"), ze = v(() => Me.value && !Ae.value && !!ke.value?.canUseBrowserRecording), Be = v(() => ke.value?.isActive.value ?? !1), Ve = v(() => ke.value?.elapsedLabel.value ?? "0:00"), Ue = v(() => ke.value?.statusText.value ?? "Release to send"), We = v(() => ke.value?.state.value.phase === "sending" ? "Sending voice message" : Be.value ? "Release to send voice message" : "Hold to record voice message"), Ge = F(!1), Ke = F(), qe = F(), Je = F(), Ye = 0;
5044
- ue(() => e.agent.avatar.value?.src, (e) => {
5045
- let t = ++Ye;
5046
- if (Je.value = void 0, !e || typeof Image > "u") return;
5047
- let n = new Image();
5048
- n.onload = () => {
5049
- t === Ye && (Je.value = e);
5050
- }, n.src = e;
5376
+ let Le = b(() => Ne.value === "stop" ? "Stop reply" : Fe.value ? "Send — answered after current work" : "Send message"), Re = b(() => Me.value && !Ae.value && !!ke.value?.canUseBrowserRecording), ze = b(() => ke.value?.isActive.value ?? !1), Ve = b(() => ke.value?.elapsedLabel.value ?? "0:00"), He = b(() => ke.value?.statusText.value ?? "Release to send"), Ue = b(() => ke.value?.state.value.phase === "sending" ? "Sending voice message" : ze.value ? "Release to send voice message" : "Hold to record voice message"), We = I(!1), Ke = I(), qe = I(), Je = I(), Ye = 0, Xe = b(() => e.chatController?.canStartVoice?.value ?? !1);
5377
+ pe([() => e.agent.avatar.value?.src, Xe], ([e, t]) => {
5378
+ let n = ++Ye;
5379
+ if (Je.value = void 0, !t || !e || typeof Image > "u") return;
5380
+ let r = new Image();
5381
+ r.onload = () => {
5382
+ n === Ye && (Je.value = e);
5383
+ }, r.src = e;
5051
5384
  }, { immediate: !0 });
5052
- let Xe = v(() => e.chatController?.canStartVoice?.value ?? !1), Qe = v(() => Xe.value && !Ge.value && !Be.value && Ne.value === "idle"), $e = v(() => !u.value), et = v(() => $e.value ? `Voice available when ${e.agent.displayName.value || e.agent.name.value || "the assistant"} is awake` : "Start voice conversation");
5385
+ let Ze = b(() => Xe.value && !We.value && !ze.value && Ne.value === "idle"), Qe = b(() => !c.value), $e = b(() => Qe.value ? `Voice available when ${e.agent.displayName.value || e.agent.name.value || "the assistant"} is awake` : "Start voice conversation");
5053
5386
  function startVoiceConversation() {
5054
- !Qe.value || $e.value || (qe.value = Je.value, Ge.value = !0);
5387
+ !Ze.value || Qe.value || (qe.value = Je.value, We.value = !0);
5055
5388
  }
5056
5389
  async function endVoiceConversation() {
5057
- if (!Ge.value) return;
5390
+ if (!We.value) return;
5058
5391
  let t = Ke.value?.end();
5059
- Ge.value = !1, qe.value = void 0, await A(), await t, i.value?.focus(), await e.chatController?.refreshMessages();
5392
+ We.value = !1, qe.value = void 0, await re(), await t, i.value?.focus(), await e.chatController?.refreshMessages();
5060
5393
  }
5061
- let J = v(() => e.variant === "light"), tt = v(() => J.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), X = v(() => J.value ? "text-theme-300" : "text-white/30");
5062
- re(async () => {
5063
- e.chatController && !u.value && await e.chatController.startTextConversation();
5064
- }), ie(() => {
5394
+ let J = b(() => e.variant === "light"), tt = b(() => J.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), nt = b(() => J.value ? "text-theme-300" : "text-white/30");
5395
+ ae(async () => {
5396
+ e.chatController && !c.value && await e.chatController.startTextConversation();
5397
+ }), oe(() => {
5065
5398
  e.chatController?.voiceRecorder?.teardown();
5066
5399
  });
5067
5400
  async function sendMessage() {
@@ -5083,14 +5416,14 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5083
5416
  e.isComposing || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
5084
5417
  }
5085
5418
  function focusComposer(e) {
5086
- Be.value || be.value || e.target instanceof Element && e.target.closest("button, a, textarea") || i.value?.focus();
5419
+ ze.value || be.value || e.target instanceof Element && e.target.closest("button, a, textarea") || i.value?.focus();
5087
5420
  }
5088
5421
  function adjustTextareaHeight() {
5089
5422
  i.value && (i.value.style.height = "auto", i.value.style.height = `${Math.min(i.value.scrollHeight, 150)}px`);
5090
5423
  }
5091
- ue(Ee, () => A(() => adjustTextareaHeight()));
5424
+ pe(Ee, () => re(() => adjustTextareaHeight()));
5092
5425
  function triggerFileInput() {
5093
- o.value?.click();
5426
+ a.value?.click();
5094
5427
  }
5095
5428
  async function handleFileSelect(t) {
5096
5429
  let n = t.target, r = n.files?.[0];
@@ -5132,32 +5465,32 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5132
5465
  ...o ? {} : { year: "numeric" }
5133
5466
  })}, ${a}`;
5134
5467
  }
5135
- return (t, a) => (P(), x("div", {
5468
+ return (t, o) => (F(), C("div", {
5136
5469
  "data-test": "messaging-root",
5137
- class: j(["@container/chat relative flex h-full flex-col", R.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""])
5470
+ class: M(["@container/chat relative flex h-full flex-col", _.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""])
5138
5471
  }, [
5139
- e.showHeader && !J.value ? (P(), x("div", Fi, [T(Le, {
5472
+ e.showHeader && !J.value ? (F(), C("div", Hi, [A(Be, {
5140
5473
  agent: e.agent,
5141
- "is-online": u.value
5142
- }, null, 8, ["agent", "is-online"])])) : e.showHeader ? (P(), x("div", Ii, [S("div", { class: j(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
5143
- T(He, {
5474
+ "is-online": c.value
5475
+ }, null, 8, ["agent", "is-online"])])) : e.showHeader ? (F(), C("div", Ui, [T("div", { class: M(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
5476
+ A(Ge, {
5144
5477
  agent: e.agent,
5145
5478
  "is-light": J.value,
5146
5479
  class: "size-10"
5147
5480
  }, null, 8, ["agent", "is-light"]),
5148
- S("div", Li, [S("div", Ri, H(e.agent.displayName.value), 1), S("div", zi, H(e.agent.title.value || "Assistant"), 1)]),
5149
- e.headerMeta ? (P(), x("span", Bi, H(e.headerMeta), 1)) : b("", !0)
5150
- ], 2)])) : b("", !0),
5151
- T(_, { name: "voice-call" }, {
5152
- default: U(() => [Ge.value ? (P(), x("div", {
5481
+ T("div", Wi, [T("div", Gi, H(e.agent.displayName.value), 1), T("div", Ki, H(e.agent.title.value || "Assistant"), 1)]),
5482
+ e.headerMeta ? (F(), C("span", qi, H(e.headerMeta), 1)) : S("", !0)
5483
+ ], 2)])) : S("", !0),
5484
+ A(ne, { name: "voice-call" }, {
5485
+ default: he(() => [We.value ? (F(), C("div", {
5153
5486
  key: 0,
5154
5487
  "data-test": "voice-call-overlay",
5155
5488
  role: "dialog",
5156
5489
  "aria-modal": "true",
5157
5490
  "aria-label": `Voice conversation with ${e.agent.displayName.value}`,
5158
5491
  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",
5159
- onKeydown: a[0] || (a[0] = pe((e) => endVoiceConversation(), ["esc"]))
5160
- }, [T(Pi, {
5492
+ onKeydown: o[0] || (o[0] = W((e) => endVoiceConversation(), ["esc"]))
5493
+ }, [A(Vi, {
5161
5494
  ref_key: "voiceMode",
5162
5495
  ref: Ke,
5163
5496
  agent: e.agent,
@@ -5170,51 +5503,51 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5170
5503
  "agent",
5171
5504
  "chat-controller",
5172
5505
  "backdrop-src"
5173
- ])], 40, Vi)) : b("", !0)]),
5506
+ ])], 40, Ji)) : S("", !0)]),
5174
5507
  _: 1
5175
5508
  }),
5176
- p.value ? (P(), x("div", {
5509
+ p.value ? (F(), C("div", {
5177
5510
  key: 2,
5178
- class: j(["py-16 flex flex-col items-center justify-center gap-2 text-sm", J.value ? "text-theme-400" : "text-theme-600"])
5179
- }, [T(_e, { class: "size-4" })], 2)) : e.setupHint ? (P(), x("div", {
5511
+ class: M(["py-16 flex flex-col items-center justify-center gap-2 text-sm", J.value ? "text-theme-400" : "text-theme-600"])
5512
+ }, [A(q, { class: "size-4" })], 2)) : e.setupHint ? (F(), C("div", {
5180
5513
  key: 3,
5181
- class: j(["flex items-center justify-center gap-1.5 py-2 text-[11px]", X.value])
5182
- }, [a[20] || (a[20] = S("i", { class: "i-tabler-tool size-3" }, null, -1)), S("span", null, H(e.setupHint), 1)], 2)) : b("", !0),
5183
- T(pi, {
5514
+ class: M(["flex items-center justify-center gap-1.5 py-2 text-[11px]", nt.value])
5515
+ }, [o[20] || (o[20] = T("i", { class: "i-tabler-tool size-3" }, null, -1)), T("span", null, H(e.setupHint), 1)], 2)) : S("", !0),
5516
+ A(gi, {
5184
5517
  ref_key: "chatScroller",
5185
5518
  ref: r,
5186
- inert: Ge.value,
5187
- "aria-hidden": Ge.value ? "true" : void 0,
5188
- class: j(R.value.length === 0 ? "flex-none" : "flex-1")
5519
+ inert: We.value,
5520
+ "aria-hidden": We.value ? "true" : void 0,
5521
+ class: M(_.value.length === 0 ? "flex-none" : "flex-1")
5189
5522
  }, {
5190
- default: U(() => [S("div", { class: j([R.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-5 space-y-2" : "pt-4 pb-[120px] px-3 @lg/chat:px-5 space-y-2", e.centered ? R.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[720px] mx-auto w-full" : ""]) }, [
5191
- R.value.length === 0 && !p.value ? (P(), x("div", Hi, [ae(t.$slots, "empty-heading", {
5523
+ default: he(() => [T("div", { class: 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-5 space-y-2" : "pt-4 pb-[120px] px-3 @lg/chat:px-5 space-y-2", e.centered ? _.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[720px] mx-auto w-full" : ""]) }, [
5524
+ _.value.length === 0 && !p.value ? (F(), C("div", Yi, [B(t.$slots, "empty-heading", {
5192
5525
  agent: e.agent,
5193
5526
  isLight: J.value
5194
- }, () => [T(He, {
5527
+ }, () => [A(Ge, {
5195
5528
  agent: e.agent,
5196
5529
  "is-light": J.value,
5197
5530
  class: "mb-4 size-20 @sm/chat:size-24"
5198
- }, null, 8, ["agent", "is-light"]), S("div", { class: j(["text-base @sm/chat:text-lg font-semibold", J.value ? "text-theme-900" : "text-white"]) }, H(e.agent.displayName.value), 3)], !0), e.emptyStateMessage === "" ? b("", !0) : (P(), x(h, { key: 0 }, [S("p", { class: j(["mt-1 text-center text-xs @sm/chat:text-sm", X.value]) }, H(e.emptyStateMessage || "Type your message to get started."), 3), S("div", {
5199
- class: j(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", J.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
5531
+ }, null, 8, ["agent", "is-light"]), T("div", { class: M(["text-base @sm/chat:text-lg font-semibold", J.value ? "text-theme-900" : "text-white"]) }, H(e.agent.displayName.value), 3)], !0), e.emptyStateMessage === "" ? S("", !0) : (F(), C(v, { key: 0 }, [T("p", { class: M(["mt-1 text-center text-xs @sm/chat:text-sm", nt.value]) }, H(e.emptyStateMessage || "Type your message to get started."), 3), T("div", {
5532
+ class: M(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", J.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
5200
5533
  title: n.value.tooltip
5201
- }, [S("i", { class: j([n.value.icon, "size-3"]) }, null, 2), S("span", null, H(n.value.label), 1)], 10, Ui)], 64))])) : b("", !0),
5202
- (P(!0), x(h, null, I(R.value, (e, t) => (P(), x(h, { key: e.id }, [
5203
- shouldShowTimeDivider(R.value, t) ? (P(), x("div", Wi, [
5204
- S("div", { class: j(["flex-1 h-px", tt.value]) }, null, 2),
5205
- S("span", { class: j(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", X.value]) }, H(shouldShowTimeDivider(R.value, t)), 3),
5206
- S("div", { class: j(["flex-1 h-px", tt.value]) }, null, 2)
5207
- ])) : b("", !0),
5208
- messageWorkJournal(e) ? (P(), x("div", {
5534
+ }, [T("i", { class: M([n.value.icon, "size-3"]) }, null, 2), T("span", null, H(n.value.label), 1)], 10, Xi)], 64))])) : S("", !0),
5535
+ (F(!0), C(v, null, R(_.value, (e, t) => (F(), C(v, { key: e.id }, [
5536
+ shouldShowTimeDivider(_.value, t) ? (F(), C("div", Zi, [
5537
+ T("div", { class: M(["flex-1 h-px", tt.value]) }, null, 2),
5538
+ T("span", { class: M(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", nt.value]) }, H(shouldShowTimeDivider(_.value, t)), 3),
5539
+ T("div", { class: M(["flex-1 h-px", tt.value]) }, null, 2)
5540
+ ])) : S("", !0),
5541
+ messageWorkJournal(e) ? (F(), C("div", {
5209
5542
  key: 1,
5210
5543
  "data-test": "messaging-message-tool-activity",
5211
5544
  "data-journal-outcome": messageWorkJournal(e)?.outcome,
5212
5545
  class: "mb-4 w-full"
5213
- }, [T(Ze, {
5546
+ }, [A(et, {
5214
5547
  model: messageWorkJournal(e),
5215
5548
  "is-light": J.value
5216
- }, null, 8, ["model", "is-light"])], 8, Gi)) : b("", !0),
5217
- isSystemExplainerMessage(e) ? (P(), x("div", {
5549
+ }, null, 8, ["model", "is-light"])], 8, Qi)) : S("", !0),
5550
+ isSystemExplainerMessage(e) ? (F(), C("div", {
5218
5551
  key: 2,
5219
5552
  "data-test": "messaging-system-msg",
5220
5553
  "data-message-id": e.id,
@@ -5226,30 +5559,30 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5226
5559
  "data-issue-bucket": e.issue?.bucket,
5227
5560
  "data-issue-action-label": e.issue?.actionLabel,
5228
5561
  "data-issue-action-url": e.issue?.actionUrl,
5229
- "data-streaming": e.id === K.value ? "true" : void 0,
5562
+ "data-streaming": e.id === U.value ? "true" : void 0,
5230
5563
  class: "flex gap-2 items-end justify-start mb-4"
5231
- }, [S("div", qi, [S("div", { class: j(["mb-1 pl-1 text-[11px] font-medium", J.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), S("div", { class: j(["pl-1", J.value ? "text-theme-700" : "text-white/85"]) }, [e.text ? (P(), te(ui, {
5564
+ }, [T("div", ea, [T("div", { class: M(["mb-1 pl-1 text-[11px] font-medium", J.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), T("div", { class: M(["pl-1", J.value ? "text-theme-700" : "text-white/85"]) }, [e.text ? (F(), x(pi, {
5232
5565
  key: 0,
5233
5566
  text: e.text,
5234
5567
  inverted: !J.value,
5235
- streaming: e.id === K.value,
5236
- onClick: a[1] || (a[1] = W(() => {}, ["stop"])),
5568
+ streaming: e.id === U.value,
5569
+ onClick: o[1] || (o[1] = G(() => {}, ["stop"])),
5237
5570
  onAction: handleCardAction
5238
5571
  }, null, 8, [
5239
5572
  "text",
5240
5573
  "inverted",
5241
5574
  "streaming"
5242
- ])) : e.issue?.help ? (P(), te(ui, {
5575
+ ])) : e.issue?.help ? (F(), x(pi, {
5243
5576
  key: 1,
5244
5577
  text: e.issue.help,
5245
5578
  inverted: !J.value
5246
- }, null, 8, ["text", "inverted"])) : b("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (P(), x("a", {
5579
+ }, null, 8, ["text", "inverted"])) : S("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (F(), C("a", {
5247
5580
  key: 2,
5248
5581
  href: e.issue.actionUrl,
5249
5582
  "data-test": "messaging-system-msg-action",
5250
- class: j(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", J.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
5251
- onClick: a[2] || (a[2] = W(() => {}, ["stop"]))
5252
- }, [C(H(e.issue.actionLabel) + " ", 1), a[21] || (a[21] = S("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, Ji)) : b("", !0)], 2)])], 8, Ki)) : e.sender === "system" ? (P(), x("div", {
5583
+ class: M(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", J.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
5584
+ onClick: o[2] || (o[2] = G(() => {}, ["stop"]))
5585
+ }, [k(H(e.issue.actionLabel) + " ", 1), o[21] || (o[21] = T("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, ta)) : S("", !0)], 2)])], 8, $i)) : e.sender === "system" ? (F(), C("div", {
5253
5586
  key: 3,
5254
5587
  "data-test": "messaging-system-status-msg",
5255
5588
  "data-message-id": e.id,
@@ -5259,16 +5592,16 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5259
5592
  "data-system-kind": e.systemKind,
5260
5593
  "data-issue-code": e.issue?.code,
5261
5594
  "data-issue-bucket": e.issue?.bucket,
5262
- "data-streaming": e.id === K.value ? "true" : void 0,
5263
- 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", J.value ? "bg-theme-100 text-theme-600 ring-theme-200" : "bg-white/10 text-white/70 ring-white/10"])
5264
- }, [a[22] || (a[22] = S("i", {
5595
+ "data-streaming": e.id === U.value ? "true" : void 0,
5596
+ class: M(["mb-4 flex w-fit max-w-[85%] items-start gap-2 rounded-2xl px-3 py-2 text-[13px] leading-relaxed ring-1", J.value ? "bg-theme-100 text-theme-600 ring-theme-200" : "bg-white/10 text-white/70 ring-white/10"])
5597
+ }, [o[22] || (o[22] = T("i", {
5265
5598
  class: "i-tabler-info-circle size-4 mt-0.5 shrink-0",
5266
5599
  "aria-hidden": "true"
5267
- }, null, -1)), T(ui, {
5600
+ }, null, -1)), A(pi, {
5268
5601
  text: e.text,
5269
5602
  inverted: !J.value,
5270
- onClick: a[3] || (a[3] = W(() => {}, ["stop"]))
5271
- }, null, 8, ["text", "inverted"])], 10, Yi)) : (P(), x("div", {
5603
+ onClick: o[3] || (o[3] = G(() => {}, ["stop"]))
5604
+ }, null, 8, ["text", "inverted"])], 10, na)) : (F(), C("div", {
5272
5605
  key: 4,
5273
5606
  "data-test": e.sender === "agent" ? "messaging-assistant-msg" : e.sender === "user" ? "messaging-user-msg" : void 0,
5274
5607
  "data-message-id": e.id,
@@ -5276,143 +5609,143 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5276
5609
  "data-conversation-id": e.conversationId,
5277
5610
  "data-message-sequence": e.sequence,
5278
5611
  "data-system-kind": e.systemKind,
5279
- "data-streaming": e.id === K.value ? "true" : void 0,
5612
+ "data-streaming": e.id === U.value ? "true" : void 0,
5280
5613
  "data-queued": isQueuedMessage(e.id) ? "true" : void 0,
5281
5614
  "aria-label": isQueuedMessage(e.id) ? "Sent — will be answered after the current work finishes" : void 0,
5282
- class: j(["flex gap-2 items-end", {
5615
+ class: M(["flex gap-2 items-end", {
5283
5616
  "justify-end": e.sender === "user",
5284
5617
  "justify-start": e.sender === "agent",
5285
- "mb-6": isGroupEnd(R.value, t),
5618
+ "mb-6": isGroupEnd(_.value, t),
5286
5619
  "opacity-70": isQueuedMessage(e.id)
5287
5620
  }])
5288
- }, [S("div", {
5621
+ }, [T("div", {
5289
5622
  "data-test": "messaging-message-body",
5290
- class: j(e.sender === "user" ? "max-w-[min(78%,30rem)]" : "w-full min-w-0")
5291
- }, [blockAttachmentsForMessage(e).length ? (P(), x("div", {
5623
+ class: M(e.sender === "user" ? "max-w-[min(78%,30rem)]" : "w-full min-w-0")
5624
+ }, [blockAttachmentsForMessage(e).length ? (F(), C("div", {
5292
5625
  key: 0,
5293
- class: j(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
5294
- }, [(P(!0), x(h, null, I(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (P(), x(h, { key: attachmentKey(e, t) }, [e.type === "image" ? (P(), x("img", {
5626
+ class: M(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
5627
+ }, [(F(!0), C(v, null, R(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (F(), C(v, { key: attachmentKey(e, t) }, [e.type === "image" ? (F(), C("img", {
5295
5628
  key: 0,
5296
5629
  src: e.src,
5297
5630
  alt: e.filename,
5298
5631
  "data-test": "messaging-attachment",
5299
5632
  "data-attachment-placement": "block",
5300
5633
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
5301
- }, null, 8, Zi)) : e.type === "audio" ? (P(), x("audio", {
5634
+ }, null, 8, ia)) : e.type === "audio" ? (F(), C("audio", {
5302
5635
  key: 1,
5303
5636
  src: e.src,
5304
5637
  controls: "",
5305
5638
  "data-test": "messaging-attachment",
5306
5639
  "data-attachment-placement": "block",
5307
5640
  class: "max-w-full"
5308
- }, null, 8, Qi)) : (P(), x("a", {
5641
+ }, null, 8, aa)) : (F(), C("a", {
5309
5642
  key: 2,
5310
5643
  href: e.src,
5311
5644
  target: "_blank",
5312
5645
  rel: "noopener",
5313
5646
  "data-test": "messaging-attachment",
5314
5647
  "data-attachment-placement": "block",
5315
- class: j(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", J.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
5316
- }, [a[23] || (a[23] = S("i", { class: "i-tabler-file size-3.5" }, null, -1)), C(" " + H(e.filename), 1)], 10, $i))], 64))), 128))], 2)) : b("", !0), messageRenderParts(e).length ? (P(), x("div", {
5648
+ class: M(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", J.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
5649
+ }, [o[23] || (o[23] = T("i", { class: "i-tabler-file size-3.5" }, null, -1)), k(" " + H(e.filename), 1)], 10, oa))], 64))), 128))], 2)) : S("", !0), messageRenderParts(e).length ? (F(), C("div", {
5317
5650
  key: 1,
5318
5651
  "data-test": "messaging-message-content",
5319
- class: j(e.sender === "user" ? J.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" : J.value ? "text-theme-800" : "text-white/95")
5320
- }, [(P(!0), x(h, null, I(messageRenderParts(e), (t) => (P(), x(h, { key: t.key }, [t.kind === "text" && t.text ? (P(), x("div", ea, [T(ui, {
5652
+ class: M(e.sender === "user" ? J.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" : J.value ? "text-theme-800" : "text-white/95")
5653
+ }, [(F(!0), C(v, null, R(messageRenderParts(e), (t) => (F(), C(v, { key: t.key }, [t.kind === "text" && t.text ? (F(), C("div", sa, [A(pi, {
5321
5654
  text: t.text,
5322
5655
  inverted: e.sender === "user" || !J.value,
5323
- streaming: e.id === K.value,
5324
- onClick: a[4] || (a[4] = W(() => {}, ["stop"])),
5656
+ streaming: e.id === U.value,
5657
+ onClick: o[4] || (o[4] = G(() => {}, ["stop"])),
5325
5658
  onAction: handleCardAction
5326
5659
  }, null, 8, [
5327
5660
  "text",
5328
5661
  "inverted",
5329
5662
  "streaming"
5330
- ])])) : t.kind === "attachment" && t.attachment.type === "image" ? (P(), x("img", {
5663
+ ])])) : t.kind === "attachment" && t.attachment.type === "image" ? (F(), C("img", {
5331
5664
  key: 1,
5332
5665
  src: t.attachment.src,
5333
5666
  alt: t.attachment.filename,
5334
5667
  "data-test": "messaging-attachment",
5335
5668
  "data-attachment-placement": t.placement,
5336
5669
  class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
5337
- }, null, 8, ta)) : t.kind === "attachment" && t.attachment.type === "audio" ? (P(), x("audio", {
5670
+ }, null, 8, ca)) : t.kind === "attachment" && t.attachment.type === "audio" ? (F(), C("audio", {
5338
5671
  key: 2,
5339
5672
  src: t.attachment.src,
5340
5673
  controls: "",
5341
5674
  "data-test": "messaging-attachment",
5342
5675
  "data-attachment-placement": t.placement,
5343
5676
  class: "my-2 max-w-full"
5344
- }, null, 8, na)) : t.kind === "attachment" ? (P(), x("a", {
5677
+ }, null, 8, la)) : t.kind === "attachment" ? (F(), C("a", {
5345
5678
  key: 3,
5346
5679
  href: t.attachment.src,
5347
5680
  target: "_blank",
5348
5681
  rel: "noopener",
5349
5682
  "data-test": "messaging-attachment",
5350
5683
  "data-attachment-placement": t.placement,
5351
- class: j(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", J.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
5352
- }, [a[24] || (a[24] = S("i", { class: "i-tabler-file size-3.5" }, null, -1)), C(" " + H(t.attachment.filename), 1)], 10, ra)) : b("", !0)], 64))), 128))], 2)) : b("", !0)], 2)], 10, Xi)),
5353
- e.id === se.value ? (P(), x(h, { key: 5 }, [m.value.length ? (P(!0), x(h, { key: 0 }, I(m.value, (e) => (P(), x(h, { key: e.id }, [e.kind === "work" ? (P(), x("div", {
5684
+ class: M(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", J.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
5685
+ }, [o[24] || (o[24] = T("i", { class: "i-tabler-file size-3.5" }, null, -1)), k(" " + H(t.attachment.filename), 1)], 10, ua)) : S("", !0)], 64))), 128))], 2)) : S("", !0)], 2)], 10, ra)),
5686
+ e.id === se.value ? (F(), C(v, { key: 5 }, [m.value.length ? (F(!0), C(v, { key: 0 }, R(m.value, (e) => (F(), C(v, { key: e.id }, [e.kind === "work" ? (F(), C("div", {
5354
5687
  key: 0,
5355
5688
  "data-test": "messaging-tool-activity",
5356
5689
  "data-journal-outcome": e.journal.outcome,
5357
5690
  class: "mb-4 w-full"
5358
- }, [T(Ze, {
5691
+ }, [A(et, {
5359
5692
  model: e.journal,
5360
5693
  "is-light": J.value
5361
- }, null, 8, ["model", "is-light"])], 8, ia)) : e.kind === "text" && e.content ? (P(), x("div", {
5694
+ }, null, 8, ["model", "is-light"])], 8, da)) : e.kind === "text" && e.content ? (F(), C("div", {
5362
5695
  key: 1,
5363
5696
  "data-test": "messaging-live-text-block",
5364
- class: j(["mb-4", J.value ? "text-theme-800" : "text-white/95"])
5365
- }, [T(ui, {
5697
+ class: M(["mb-4", J.value ? "text-theme-800" : "text-white/95"])
5698
+ }, [A(pi, {
5366
5699
  text: e.content,
5367
5700
  inverted: !J.value,
5368
- streaming: e.id === k.value,
5369
- onClick: a[5] || (a[5] = W(() => {}, ["stop"])),
5701
+ streaming: e.id === te.value,
5702
+ onClick: o[5] || (o[5] = G(() => {}, ["stop"])),
5370
5703
  onAction: handleCardAction
5371
5704
  }, null, 8, [
5372
5705
  "text",
5373
5706
  "inverted",
5374
5707
  "streaming"
5375
- ])], 2)) : (P(), x("div", aa, [T(_e, { class: j(["size-3.5", J.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : oe.value ? (P(), x("div", {
5708
+ ])], 2)) : (F(), C("div", fa, [A(q, { class: M(["size-3.5", J.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : ie.value ? (F(), C("div", {
5376
5709
  key: 1,
5377
5710
  "data-test": "messaging-tool-activity",
5378
- "data-journal-outcome": oe.value.outcome,
5711
+ "data-journal-outcome": ie.value.outcome,
5379
5712
  class: "mb-4 w-full"
5380
- }, [T(Ze, {
5381
- model: oe.value,
5713
+ }, [A(et, {
5714
+ model: ie.value,
5382
5715
  "is-light": J.value
5383
- }, null, 8, ["model", "is-light"])], 8, oa)) : b("", !0)], 64)) : b("", !0)
5716
+ }, null, 8, ["model", "is-light"])], 8, pa)) : S("", !0)], 64)) : S("", !0)
5384
5717
  ], 64))), 128)),
5385
- q.value ? (P(), x("div", {
5718
+ ve.value ? (F(), C("div", {
5386
5719
  key: 1,
5387
- "data-test": B.value ? "messaging-working-state" : "messaging-thinking-indicator",
5388
- "data-working-description": B.value,
5720
+ "data-test": j.value ? "messaging-working-state" : "messaging-thinking-indicator",
5721
+ "data-working-description": j.value,
5389
5722
  role: "status",
5390
5723
  "aria-live": "polite",
5391
- class: j(["mb-4 flex items-center gap-2.5 pl-0.5 text-[13.5px] leading-snug", J.value ? "text-theme-500" : "text-white/50"])
5392
- }, [S("span", ca, [(P(), x(h, null, I(3, (e) => S("span", {
5724
+ class: M(["mb-4 flex items-center gap-2.5 pl-0.5 text-[13.5px] leading-snug", J.value ? "text-theme-500" : "text-white/50"])
5725
+ }, [T("span", ha, [(F(), C(v, null, R(3, (e) => T("span", {
5393
5726
  key: e,
5394
5727
  "data-test": "messaging-thinking-dot",
5395
5728
  class: "chat-working-dot size-1.5 rounded-full bg-current",
5396
- style: M({ animationDelay: `${(e - 1) * .18}s` })
5397
- }, null, 4)), 64))]), S("span", la, H(q.value), 1)], 10, sa)) : b("", !0),
5398
- G.value ? (P(), x("div", {
5729
+ style: P({ animationDelay: `${(e - 1) * .18}s` })
5730
+ }, null, 4)), 64))]), T("span", ga, H(ve.value), 1)], 10, ma)) : S("", !0),
5731
+ ue.value ? (F(), C("div", {
5399
5732
  key: 2,
5400
5733
  "data-test": "messaging-transient-issue",
5401
- "data-issue-code": G.value.code,
5402
- class: j(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", J.value ? "text-theme-600" : "text-white/60"])
5734
+ "data-issue-code": ue.value.code,
5735
+ class: M(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", J.value ? "text-theme-600" : "text-white/60"])
5403
5736
  }, [
5404
- a[25] || (a[25] = S("i", {
5737
+ o[25] || (o[25] = T("i", {
5405
5738
  class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
5406
5739
  "aria-hidden": "true"
5407
5740
  }, null, -1)),
5408
- S("span", null, [C(H(G.value.message), 1), G.value.help ? (P(), x(h, { key: 0 }, [C(H(G.value.help), 1)], 64)) : b("", !0)]),
5409
- G.value.actionUrl && G.value.actionLabel ? (P(), x("a", {
5741
+ T("span", null, [k(H(ue.value.message), 1), ue.value.help ? (F(), C(v, { key: 0 }, [k(H(ue.value.help), 1)], 64)) : S("", !0)]),
5742
+ ue.value.actionUrl && ue.value.actionLabel ? (F(), C("a", {
5410
5743
  key: 0,
5411
- href: G.value.actionUrl,
5744
+ href: ue.value.actionUrl,
5412
5745
  class: "shrink-0 underline underline-offset-2",
5413
- onClick: a[6] || (a[6] = W(() => {}, ["stop"]))
5414
- }, H(G.value.actionLabel), 9, da)) : b("", !0)
5415
- ], 10, ua)) : b("", !0)
5746
+ onClick: o[6] || (o[6] = G(() => {}, ["stop"]))
5747
+ }, H(ue.value.actionLabel), 9, va)) : S("", !0)
5748
+ ], 10, _a)) : S("", !0)
5416
5749
  ], 2)]),
5417
5750
  _: 3
5418
5751
  }, 8, [
@@ -5420,68 +5753,68 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5420
5753
  "aria-hidden",
5421
5754
  "class"
5422
5755
  ]),
5423
- S("div", {
5756
+ T("div", {
5424
5757
  "data-test": "messaging-composer-footer",
5425
- inert: Ge.value,
5426
- "aria-hidden": Ge.value ? "true" : void 0,
5427
- class: j(["left-0 right-0 z-30 px-3 @lg/chat:px-5 pb-[max(env(safe-area-inset-bottom),1rem)]", [
5428
- R.value.length === 0 || e.centered ? "relative shrink-0" : "absolute bottom-0",
5429
- e.centered && R.value.length > 0 ? "pt-0 sm:pb-7" : "pt-3",
5758
+ inert: We.value,
5759
+ "aria-hidden": We.value ? "true" : void 0,
5760
+ class: M(["left-0 right-0 z-30 px-3 @lg/chat:px-5 pb-[max(env(safe-area-inset-bottom),1rem)]", [
5761
+ _.value.length === 0 || e.centered ? "relative shrink-0" : "absolute bottom-0",
5762
+ e.centered && _.value.length > 0 ? "pt-0 sm:pb-7" : "pt-3",
5430
5763
  J.value ? e.centered ? "bg-theme-0" : "bg-gradient-to-t from-theme-0/90 via-theme-0/55 to-transparent" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"
5431
5764
  ]])
5432
- }, [ae(t.$slots, "composer", {}, () => [we.value ? (P(), x("div", {
5765
+ }, [B(t.$slots, "composer", {}, () => [we.value ? (F(), C("div", {
5433
5766
  key: 0,
5434
5767
  "data-test": "messaging-seat",
5435
5768
  "data-seat-state": Ce.value,
5436
5769
  role: "status",
5437
5770
  "aria-live": "polite",
5438
- class: j(["py-3 text-center text-[14px]", J.value ? "text-theme-500" : "text-white/70"])
5439
- }, H(we.value), 11, pa)) : (P(), x(h, { key: 1 }, [
5440
- De.value.length > 0 ? (P(), x("div", {
5771
+ class: M(["py-3 text-center text-[14px]", J.value ? "text-theme-500" : "text-white/70"])
5772
+ }, H(we.value), 11, ba)) : (F(), C(v, { key: 1 }, [
5773
+ De.value.length > 0 ? (F(), C("div", {
5441
5774
  key: 0,
5442
- class: j(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
5443
- }, [(P(!0), x(h, null, I(De.value, (e, t) => (P(), x("div", {
5775
+ class: M(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
5776
+ }, [(F(!0), C(v, null, R(De.value, (e, t) => (F(), C("div", {
5444
5777
  key: t,
5445
5778
  class: "relative shrink-0 group"
5446
- }, [e.type === "image" ? (P(), x("img", {
5779
+ }, [e.type === "image" ? (F(), C("img", {
5447
5780
  key: 0,
5448
5781
  src: e.src,
5449
5782
  alt: e.filename,
5450
- class: j(["size-14 rounded-xl object-cover border", J.value ? "border-black/10" : "border-white/20"])
5451
- }, null, 10, ma)) : (P(), x("div", {
5783
+ class: M(["size-14 rounded-xl object-cover border", J.value ? "border-black/10" : "border-white/20"])
5784
+ }, null, 10, xa)) : (F(), C("div", {
5452
5785
  key: 1,
5453
- class: j(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", J.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
5454
- }, [a[26] || (a[26] = S("i", { class: "i-tabler-file size-4" }, null, -1)), S("span", ha, H(e.filename), 1)], 2)), S("button", {
5786
+ class: M(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", J.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
5787
+ }, [o[26] || (o[26] = T("i", { class: "i-tabler-file size-4" }, null, -1)), T("span", Sa, H(e.filename), 1)], 2)), T("button", {
5455
5788
  class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform cursor-pointer",
5456
5789
  onClick: (e) => removeAttachment(t)
5457
- }, [...a[27] || (a[27] = [S("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, ga)]))), 128)), Oe.value ? (P(), x("div", _a, [T(_e, { class: "size-5" })])) : b("", !0)], 2)) : b("", !0),
5458
- je.value ? (P(), x("input", {
5790
+ }, [...o[27] || (o[27] = [T("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Ca)]))), 128)), Oe.value ? (F(), C("div", wa, [A(q, { class: "size-5" })])) : S("", !0)], 2)) : S("", !0),
5791
+ je.value ? (F(), C("input", {
5459
5792
  key: 1,
5460
5793
  ref_key: "fileInput",
5461
- ref: o,
5794
+ ref: a,
5462
5795
  type: "file",
5463
5796
  accept: "image/*,audio/*,video/*",
5464
5797
  class: "hidden",
5465
5798
  onChange: handleFileSelect
5466
- }, null, 544)) : b("", !0),
5467
- S("div", {
5799
+ }, null, 544)) : S("", !0),
5800
+ T("div", {
5468
5801
  "data-test": "messaging-composer",
5469
5802
  "data-composer-action": Ne.value,
5470
- class: j(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? R.value.length === 0 ? "max-w-[680px] mx-auto" : "max-w-[720px] mx-auto" : "", J.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-200 hover:ring-theme-300 focus-within:ring-theme-300" : "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"]]),
5803
+ class: M(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? _.value.length === 0 ? "max-w-[680px] mx-auto" : "max-w-[720px] mx-auto" : "", J.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-200 hover:ring-theme-300 focus-within:ring-theme-300" : "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"]]),
5471
5804
  onClick: focusComposer
5472
- }, [Be.value ? (P(), x("div", {
5805
+ }, [ze.value ? (F(), C("div", {
5473
5806
  key: 1,
5474
5807
  "data-test": "messaging-recording-state",
5475
- class: j(["flex min-w-0 items-center gap-2 py-1", J.value ? "text-theme-700" : "text-white/80"])
5808
+ class: M(["flex min-w-0 items-center gap-2 py-1", J.value ? "text-theme-700" : "text-white/80"])
5476
5809
  }, [
5477
- a[28] || (a[28] = S("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
5478
- S("span", ba, H(Ve.value), 1),
5479
- S("span", { class: j(["min-w-0 truncate text-sm", J.value ? "text-theme-400" : "text-white/45"]) }, H(Ue.value), 3)
5480
- ], 2)) : de((P(), x("textarea", {
5810
+ o[28] || (o[28] = T("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
5811
+ T("span", Da, H(Ve.value), 1),
5812
+ T("span", { class: M(["min-w-0 truncate text-sm", J.value ? "text-theme-400" : "text-white/45"]) }, H(He.value), 3)
5813
+ ], 2)) : _e((F(), C("textarea", {
5481
5814
  key: 0,
5482
5815
  ref_key: "textarea",
5483
5816
  ref: i,
5484
- "onUpdate:modelValue": a[7] || (a[7] = (e) => Ee.value = e),
5817
+ "onUpdate:modelValue": o[7] || (o[7] = (e) => Ee.value = e),
5485
5818
  "data-test": "messaging-input",
5486
5819
  rows: "1",
5487
5820
  enterkeyhint: "send",
@@ -5496,11 +5829,11 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5496
5829
  fontSize: "16px",
5497
5830
  resize: "none"
5498
5831
  },
5499
- 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", J.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
5832
+ class: M(["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", J.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
5500
5833
  onKeydown: handleKeydown
5501
- }, null, 42, ya)), [[ce, Ee.value]]), S("div", xa, [
5502
- S("button", {
5503
- class: j(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", [
5834
+ }, null, 42, Ea)), [[de, Ee.value]]), T("div", Oa, [
5835
+ T("button", {
5836
+ class: M(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", [
5504
5837
  je.value ? "cursor-pointer" : "cursor-default",
5505
5838
  J.value ? "text-theme-500" : "text-white/50",
5506
5839
  Oe.value || Ae.value ? "opacity-50 pointer-events-none" : ""
@@ -5508,76 +5841,76 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5508
5841
  disabled: be.value || Oe.value || Ae.value || !je.value,
5509
5842
  "aria-label": je.value ? "Attach file" : "File attachments unavailable",
5510
5843
  title: je.value ? "Attach file" : "File attachments unavailable",
5511
- onClick: a[8] || (a[8] = (e) => je.value && triggerFileInput())
5512
- }, [Oe.value ? (P(), x("i", Ca)) : (P(), x("i", wa)), S("span", Ta, H(je.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Sa),
5513
- a[31] || (a[31] = S("div", { class: "flex-1" }, null, -1)),
5514
- S("div", Ea, [(ze.value || Be.value) && !Ge.value ? (P(), x("button", {
5844
+ onClick: o[8] || (o[8] = (e) => je.value && triggerFileInput())
5845
+ }, [Oe.value ? (F(), C("i", Aa)) : (F(), C("i", ja)), T("span", Ma, H(je.value ? "Attach file" : "File attachments unavailable"), 1)], 10, ka),
5846
+ o[31] || (o[31] = T("div", { class: "flex-1" }, null, -1)),
5847
+ T("div", Na, [(Re.value || ze.value) && !We.value ? (F(), C("button", {
5515
5848
  key: 0,
5516
5849
  "data-test": "messaging-record-audio-btn",
5517
- class: j(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70 pointer-coarse:size-11", Be.value ? J.value ? "text-theme-900 scale-110" : "text-white scale-110" : J.value ? "text-theme-500" : "text-white/60"]),
5518
- "aria-label": We.value,
5519
- title: We.value,
5520
- onPointerdown: a[9] || (a[9] = W((e) => startRecording(), ["prevent"])),
5521
- onPointerup: a[10] || (a[10] = W((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
5522
- onPointercancel: a[11] || (a[11] = W((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
5850
+ class: M(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70 pointer-coarse:size-11", ze.value ? J.value ? "text-theme-900 scale-110" : "text-white scale-110" : J.value ? "text-theme-500" : "text-white/60"]),
5851
+ "aria-label": Ue.value,
5852
+ title: Ue.value,
5853
+ onPointerdown: o[9] || (o[9] = G((e) => startRecording(), ["prevent"])),
5854
+ onPointerup: o[10] || (o[10] = G((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
5855
+ onPointercancel: o[11] || (o[11] = G((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
5523
5856
  onKeydown: [
5524
- a[12] || (a[12] = pe(W((e) => startRecording(), ["prevent"]), ["enter"])),
5525
- a[14] || (a[14] = pe(W((e) => startRecording(), ["prevent"]), ["space"])),
5526
- a[16] || (a[16] = pe(W((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
5857
+ o[12] || (o[12] = W(G((e) => startRecording(), ["prevent"]), ["enter"])),
5858
+ o[14] || (o[14] = W(G((e) => startRecording(), ["prevent"]), ["space"])),
5859
+ o[16] || (o[16] = W(G((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
5527
5860
  ],
5528
- onKeyup: [a[13] || (a[13] = pe(W((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), a[15] || (a[15] = pe(W((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
5529
- }, [S("i", { class: j([Be.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), S("span", Oa, H(We.value), 1)], 42, Da)) : b("", !0), Qe.value ? (P(), x("button", {
5861
+ onKeyup: [o[13] || (o[13] = W(G((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), o[15] || (o[15] = W(G((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
5862
+ }, [T("i", { class: M([ze.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), T("span", Fa, H(Ue.value), 1)], 42, Pa)) : S("", !0), Ze.value ? (F(), C("button", {
5530
5863
  key: 1,
5531
5864
  "data-test": "messaging-voice-start-btn",
5532
- class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [J.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100", $e.value ? "cursor-not-allowed opacity-40" : "cursor-pointer"]]),
5533
- disabled: $e.value,
5534
- "aria-label": et.value,
5535
- title: et.value,
5536
- onClick: a[17] || (a[17] = (e) => startVoiceConversation())
5537
- }, [S("span", Aa, [(P(), x(h, null, I([
5865
+ class: M(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [J.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100", Qe.value ? "cursor-not-allowed opacity-40" : "cursor-pointer"]]),
5866
+ disabled: Qe.value,
5867
+ "aria-label": $e.value,
5868
+ title: $e.value,
5869
+ onClick: o[17] || (o[17] = (e) => startVoiceConversation())
5870
+ }, [T("span", La, [(F(), C(v, null, R([
5538
5871
  7,
5539
5872
  13,
5540
5873
  16,
5541
5874
  11,
5542
5875
  14
5543
- ], (e) => S("span", {
5876
+ ], (e) => T("span", {
5544
5877
  key: e,
5545
5878
  class: "w-[2px] rounded-full bg-current",
5546
- style: M({ height: `${e}px` })
5547
- }, null, 4)), 64))]), a[29] || (a[29] = S("span", { class: "sr-only" }, "Start voice conversation", -1))], 10, ka)) : Be.value ? b("", !0) : (P(), x(h, { key: 2 }, [Fe.value ? (P(), x("button", {
5879
+ style: P({ height: `${e}px` })
5880
+ }, null, 4)), 64))]), o[29] || (o[29] = T("span", { class: "sr-only" }, "Start voice conversation", -1))], 10, Ia)) : ze.value ? S("", !0) : (F(), C(v, { key: 2 }, [Fe.value ? (F(), C("button", {
5548
5881
  key: 0,
5549
5882
  "data-test": "messaging-secondary-stop-btn",
5550
- class: j(["mr-2 flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", J.value ? "bg-theme-100 text-theme-700 hover:bg-theme-200" : "bg-white/10 text-white/70 hover:bg-white/15"]),
5883
+ class: M(["mr-2 flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", J.value ? "bg-theme-100 text-theme-700 hover:bg-theme-200" : "bg-white/10 text-white/70 hover:bg-white/15"]),
5551
5884
  "aria-label": "Stop work",
5552
5885
  title: "Stop work",
5553
- onClick: a[18] || (a[18] = (t) => e.chatController?.stopChatTurn())
5554
- }, [...a[30] || (a[30] = [S("i", {
5886
+ onClick: o[18] || (o[18] = (t) => e.chatController?.stopChatTurn())
5887
+ }, [...o[30] || (o[30] = [T("i", {
5555
5888
  class: "i-tabler-player-stop-filled size-3.5",
5556
5889
  "aria-hidden": "true"
5557
- }, null, -1), S("span", { class: "sr-only" }, "Stop work", -1)])], 2)) : b("", !0), S("button", {
5890
+ }, null, -1), T("span", { class: "sr-only" }, "Stop work", -1)])], 2)) : S("", !0), T("button", {
5558
5891
  "data-test": "messaging-send-btn",
5559
5892
  "data-composer-action": Ne.value,
5560
- class: j(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Pe.value ? J.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" : J.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
5893
+ class: M(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Pe.value ? J.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" : J.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
5561
5894
  disabled: !Pe.value,
5562
- "aria-label": Re.value,
5563
- title: Re.value,
5564
- onClick: a[19] || (a[19] = (e) => handleComposerAction())
5565
- }, [Ne.value === "stop" ? (P(), x("i", Ma)) : (P(), x("i", Na)), S("span", Pa, H(Re.value), 1)], 10, ja)], 64))])
5566
- ])], 10, va),
5567
- e.centered && R.value.length > 0 ? (P(), x("p", Fa, H(e.agent.displayName.value) + " is AI and can make mistakes. ", 1)) : b("", !0)
5568
- ], 64))], !0)], 10, fa)
5895
+ "aria-label": Le.value,
5896
+ title: Le.value,
5897
+ onClick: o[19] || (o[19] = (e) => handleComposerAction())
5898
+ }, [Ne.value === "stop" ? (F(), C("i", za)) : (F(), C("i", Ba)), T("span", Va, H(Le.value), 1)], 10, Ra)], 64))])
5899
+ ])], 10, Ta),
5900
+ e.centered && _.value.length > 0 ? (F(), C("p", Ha, H(e.agent.displayName.value) + " is AI and can make mistakes. ", 1)) : S("", !0)
5901
+ ], 64))], !0)], 10, ya)
5569
5902
  ], 2));
5570
5903
  }
5571
- }), [["__scopeId", "data-v-6feb48be"]]), La = { class: "agent-wrap" }, Ra = {
5904
+ }), [["__scopeId", "data-v-4b08d62d"]]), Wa = { class: "agent-wrap" }, Ga = {
5572
5905
  key: 0,
5573
5906
  class: "flex items-center justify-center h-full"
5574
- }, za = {
5907
+ }, Ka = {
5575
5908
  key: 2,
5576
5909
  class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
5577
5910
  role: "status",
5578
5911
  "aria-live": "polite",
5579
5912
  "data-test": "agent-unavailable"
5580
- }, Ba = /* @__PURE__ */ k({
5913
+ }, qa = /* @__PURE__ */ j({
5581
5914
  __name: "AgentWrap",
5582
5915
  props: {
5583
5916
  sdk: {},
@@ -5594,25 +5927,25 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5594
5927
  apiBase: {}
5595
5928
  },
5596
5929
  setup(e) {
5597
- let t = s("AgentWrap"), i = e, a = i.sdk || n.getInstance({
5930
+ let t = c("AgentWrap"), n = e, a = n.sdk || r.getInstance({
5598
5931
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
5599
- ...i.apiBase && { apiBase: i.apiBase }
5600
- }), o = B(!i.agent), c = B(i.agent ? new r({ config: i.agent }) : void 0), u = B();
5932
+ ...n.apiBase && { apiBase: n.apiBase }
5933
+ }), o = ce(!n.agent), s = ce(n.agent ? new i({ config: n.agent }) : void 0), u = ce();
5601
5934
  async function loadAgent() {
5602
- if (i.agent) {
5935
+ if (n.agent) {
5603
5936
  t.debug("Agent provided via props, skipping fetch", {
5604
- agentId: i.agent.agentId,
5605
- handle: i.agent.handle
5937
+ agentId: n.agent.agentId,
5938
+ handle: n.agent.handle
5606
5939
  }), o.value = !1;
5607
5940
  return;
5608
5941
  }
5609
- if (!i.handle) {
5942
+ if (!n.handle) {
5610
5943
  u.value = "No handle or agent provided", t.warn("AgentWrap mounted without handle or agent", {
5611
5944
  propsReceived: {
5612
- handle: i.handle,
5613
- agent: i.agent,
5614
- context: i.clientContext ?? i.context,
5615
- apiBase: i.apiBase
5945
+ handle: n.handle,
5946
+ agent: n.agent,
5947
+ context: n.clientContext ?? n.context,
5948
+ apiBase: n.apiBase
5616
5949
  },
5617
5950
  sdkState: {
5618
5951
  isDev: a.isDev,
@@ -5622,9 +5955,9 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5622
5955
  return;
5623
5956
  }
5624
5957
  try {
5625
- o.value = !0, u.value = void 0, t.debug("Fetching public agent", { handle: i.handle });
5626
- let e = await a.user.getPublicAgent({ handle: i.handle });
5627
- e ? (c.value = new r({ config: e }), t.debug("Successfully fetched public agent", {
5958
+ o.value = !0, u.value = void 0, t.debug("Fetching public agent", { handle: n.handle });
5959
+ let e = await a.user.getPublicAgent({ handle: n.handle });
5960
+ e ? (s.value = new i({ config: e }), t.debug("Successfully fetched public agent", {
5628
5961
  agentId: e.agentId,
5629
5962
  handle: e.handle
5630
5963
  }), e.agentId && a.user.track({
@@ -5632,7 +5965,7 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5632
5965
  agentId: e.agentId,
5633
5966
  properties: { viewSource: "widget" }
5634
5967
  })) : (u.value = a.error.value || "Agent not found", t.error("Failed to fetch public agent - no data returned", {
5635
- handle: i.handle,
5968
+ handle: n.handle,
5636
5969
  sdkError: a.error.value,
5637
5970
  sdkState: {
5638
5971
  isDev: a.isDev,
@@ -5642,7 +5975,7 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5642
5975
  }));
5643
5976
  } catch (e) {
5644
5977
  u.value = e instanceof Error ? e.message : "Failed to fetch agent", t.error("Exception while fetching public agent", {
5645
- handle: i.handle,
5978
+ handle: n.handle,
5646
5979
  error: e instanceof Error ? {
5647
5980
  message: e.message,
5648
5981
  stack: e.stack
@@ -5654,16 +5987,16 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5654
5987
  }
5655
5988
  });
5656
5989
  } finally {
5657
- o.value = !1, c.value || t.debug("AgentWrap component will render unavailable state", {
5990
+ o.value = !1, s.value || t.debug("AgentWrap component will render unavailable state", {
5658
5991
  state: {
5659
5992
  loading: o.value,
5660
- hasAgent: !!c.value,
5993
+ hasAgent: !!s.value,
5661
5994
  error: u.value
5662
5995
  },
5663
5996
  props: {
5664
- handle: i.handle,
5665
- context: i.clientContext ?? i.context,
5666
- apiBase: i.apiBase
5997
+ handle: n.handle,
5998
+ context: n.clientContext ?? n.context,
5999
+ apiBase: n.apiBase
5667
6000
  },
5668
6001
  sdkState: {
5669
6002
  isDev: a.isDev,
@@ -5673,23 +6006,23 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
5673
6006
  });
5674
6007
  }
5675
6008
  }
5676
- return re(loadAgent), (t, n) => (P(), x("div", La, [o.value ? (P(), x("div", Ra, [S("div", { class: j(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? ae(t.$slots, "default", {
5677
- sdk: oe(a),
5678
- agent: c.value,
6009
+ return ae(loadAgent), (t, r) => (F(), C("div", Wa, [o.value ? (F(), C("div", Ga, [T("div", { class: M(["size-6 animate-spin rounded-full border-b-2", n.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : s.value ? B(t.$slots, "default", {
6010
+ sdk: ue(a),
6011
+ agent: s.value,
5679
6012
  context: e.clientContext ?? e.context,
5680
6013
  firstMessage: e.firstMessage,
5681
6014
  buttonText: e.buttonText,
5682
6015
  buttonIcon: e.buttonIcon,
5683
6016
  loading: o.value
5684
- }, void 0, void 0, 1) : u.value ? (P(), x("div", za, [n[0] || (n[0] = S("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), S("button", {
6017
+ }, void 0, void 0, 1) : u.value ? (F(), C("div", Ka, [r[0] || (r[0] = T("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), T("button", {
5685
6018
  type: "button",
5686
6019
  class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
5687
6020
  "data-test": "agent-unavailable-retry",
5688
6021
  onClick: loadAgent
5689
- }, " Try again ")])) : b("", !0)]));
6022
+ }, " Try again ")])) : S("", !0)]));
5690
6023
  }
5691
6024
  });
5692
6025
  //#endregion
5693
- export { ui as a, ke as c, handleImageError as d, parseButtonTemplate as f, _e as g, r as h, Ni as i, De as l, K as m, Ia as n, Le as o, AgentChatController as p, Pi as r, je as s, Ba as t, getAgentAvatarUrl as u };
6026
+ export { ye as _, VoiceSessionClient as a, pi as c, Me as d, Ae as f, AgentChatController as g, parseButtonTemplate as h, Bi as i, Be as l, handleImageError as m, Ua as n, voiceRangeSpectrum as o, getAgentAvatarUrl as p, Vi as r, voiceSpectrum as s, qa as t, Pe as u, i as v, q as y };
5694
6027
 
5695
6028
  //# sourceMappingURL=AgentWrap.js.map