@pagelines/sdk 1.0.612 → 1.0.614

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