@pagelines/sdk 1.0.447 → 1.0.449

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 Dn = Object.defineProperty;
2
- var ws = (l, t, e) => t in l ? Dn(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
3
- var h = (l, t) => Dn(l, "name", { value: t, configurable: !0 });
4
- var D = (l, t, e) => ws(l, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as De, openBlock as A, createElementBlock as E, createElementVNode as T, normalizeClass as _, ref as V, watch as nt, computed as F, createCommentVNode as G, renderSlot as Zn, onMounted as Qt, Fragment as _e, renderList as xt, withDirectives as Xn, vModelText as Kn, unref as Yt, toDisplayString as pe, nextTick as Bt, createVNode as Ft, createTextVNode as ft, shallowRef as vs } from "vue";
6
- import { SettingsObject as ys, Agent as kt, getDefaultAvatarUrl as Qn, createLogger as Ts } from "@pagelines/core";
1
+ var In = Object.defineProperty;
2
+ var ws = (l, t, e) => t in l ? In(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
3
+ var h = (l, t) => In(l, "name", { value: t, configurable: !0 });
4
+ var C = (l, t, e) => ws(l, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as Ie, openBlock as S, createElementBlock as A, createElementVNode as w, normalizeClass as E, ref as Z, watch as rt, computed as H, createCommentVNode as U, renderSlot as Zn, onMounted as Jt, Fragment as _e, renderList as bt, withDirectives as Xn, vModelText as Kn, unref as Zt, toDisplayString as re, nextTick as Ft, createVNode as Ht, createTextVNode as Ye, shallowRef as vs } from "vue";
6
+ import { SettingsObject as ys, Agent as wt, getDefaultAvatarUrl as Qn, createLogger as Ts } from "@pagelines/core";
7
7
  import { P as Ss } from "./sdkClient.js";
8
8
  const As = { class: "spinner max-w-sm" }, Es = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
- }, In = /* @__PURE__ */ De({
11
+ }, Dn = /* @__PURE__ */ Ie({
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(l) {
18
- return (t, e) => (A(), E("div", As, [
19
- (A(), E("svg", Es, [
20
- T("circle", {
21
- class: _([l.colorMode, "ring-path"]),
18
+ return (t, e) => (S(), A("div", As, [
19
+ (S(), A("svg", Es, [
20
+ w("circle", {
21
+ class: E([l.colorMode, "ring-path"]),
22
22
  cx: "50",
23
23
  cy: "50",
24
24
  r: "20",
@@ -33,24 +33,24 @@ const As = { class: "spinner max-w-sm" }, Es = {
33
33
  }), _s = [
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
- ], Rs = 9e4, cn = class cn extends ys {
36
+ ], Rs = 9e4, un = class un extends ys {
37
37
  constructor(e) {
38
38
  super("AgentChatController", e);
39
- D(this, "isTextMode", !1);
40
- D(this, "lastMessage", { hash: "", time: 0 });
41
- D(this, "isConnecting", !1);
39
+ C(this, "isTextMode", !1);
40
+ C(this, "lastMessage", { hash: "", time: 0 });
41
+ C(this, "isConnecting", !1);
42
42
  // Chat conversation tracking (server-managed persistence)
43
- D(this, "conversationId");
44
- D(this, "textState", V({
43
+ C(this, "conversationId");
44
+ C(this, "textState", Z({
45
45
  isActive: !1,
46
46
  isConnected: !1,
47
47
  isThinking: !1,
48
48
  connectionStatus: "disconnected"
49
49
  }));
50
- D(this, "agentMode", V("self"));
51
- D(this, "sharedMessages", V([]));
52
- D(this, "_agent");
53
- this._agent = e.agent instanceof kt ? e.agent : new kt({ config: e.agent }), this.setupModeWatcher();
50
+ C(this, "agentMode", Z("self"));
51
+ C(this, "sharedMessages", Z([]));
52
+ C(this, "_agent");
53
+ this._agent = e.agent instanceof wt ? e.agent : new wt({ config: e.agent }), this.setupModeWatcher();
54
54
  }
55
55
  get chatEnabled() {
56
56
  return this._agent.chatAvailable.value;
@@ -68,10 +68,10 @@ const As = { class: "spinner max-w-sm" }, Es = {
68
68
  const s = `${n}:${e.toLowerCase().trim()}`, r = Date.now(), a = s === this.lastMessage.hash && r - this.lastMessage.time < 500;
69
69
  return a || (this.lastMessage = { hash: s, time: r }), a;
70
70
  }
71
- addMessage(e, n, s) {
71
+ addMessage(e, n, s, r) {
72
72
  this.isDuplicateMessage(e, n) || (this.sharedMessages.value = [
73
73
  ...this.sharedMessages.value,
74
- { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: s }
74
+ { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: s, ...r ? { issue: r } : {} }
75
75
  ]);
76
76
  }
77
77
  getDynamicSettings() {
@@ -103,7 +103,7 @@ Current User:
103
103
  });
104
104
  }
105
105
  setupModeWatcher() {
106
- nt(this.agentMode, async (e, n) => {
106
+ rt(this.agentMode, async (e, n) => {
107
107
  this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
108
108
  });
109
109
  }
@@ -149,6 +149,16 @@ Current User:
149
149
  this.isTextMode = !1;
150
150
  }
151
151
  }
152
+ /**
153
+ * Start a fresh conversation — clears the visible transcript and unsets
154
+ * conversationId so the next send creates a new thread on the server.
155
+ * Prior session stays in DB for history; only the in-memory view resets.
156
+ * Use when an issue bubble (billing, error) is blocking the current
157
+ * conversation and the user wants a clean slate after resolving it.
158
+ */
159
+ newConversation() {
160
+ this.conversationId = void 0, this.sharedMessages.value = [], this.lastMessage = { hash: "", time: 0 }, this.updateState(this.textState, { isThinking: !1, accountGated: !1 });
161
+ }
152
162
  async sendChatMessage(e, n) {
153
163
  if (!this.isTextMode)
154
164
  return;
@@ -165,52 +175,52 @@ Current User:
165
175
  this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
166
176
  const a = `stream-${Date.now()}`;
167
177
  let o = !1;
168
- const c = /* @__PURE__ */ h((f) => {
178
+ const c = /* @__PURE__ */ h((p) => {
169
179
  o || (o = !0, this.sharedMessages.value = [
170
180
  ...this.sharedMessages.value,
171
181
  { id: a, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
172
182
  ]);
173
- const m = this.sharedMessages.value, y = m[m.length - 1];
174
- y?.id === a && (y.text += f, this.sharedMessages.value = [...m]);
175
- }, "onDelta"), d = /* @__PURE__ */ h((f) => {
183
+ const m = this.sharedMessages.value, T = m[m.length - 1];
184
+ T?.id === a && (T.text += p, this.sharedMessages.value = [...m]);
185
+ }, "onDelta"), f = /* @__PURE__ */ h((p) => {
176
186
  if (!o) {
177
187
  g("empty_stream — assistant returned no content");
178
188
  return;
179
189
  }
180
- const m = this.sharedMessages.value, y = m[m.length - 1];
181
- if (y?.id === a && y.text) {
182
- let S = y.text;
190
+ const m = this.sharedMessages.value, T = m[m.length - 1];
191
+ if (T?.id === a && T.text) {
192
+ let _ = T.text;
183
193
  for (const z of _s)
184
- z.pattern.test(S) && (console.debug(`[chat] filtered directive: ${z.label}`), S = S.replace(z.pattern, "").trim(), z.pattern.lastIndex = 0);
185
- S ? S !== y.text && (y.text = S, this.sharedMessages.value = [...m]) : this.sharedMessages.value = m.slice(0, -1);
186
- }
187
- f && (this.conversationId = f), this.updateState(this.textState, { isThinking: !1 });
188
- }, "onDone"), g = /* @__PURE__ */ h((f) => {
189
- const m = this.sharedMessages.value, y = m[m.length - 1];
190
- if (y?.id === a && !y.text && (this.sharedMessages.value = m.slice(0, -1)), typeof f == "object" && f.code && f.error) {
191
- (/* @__PURE__ */ new Set([
192
- "CREDIT_LIMIT",
193
- "OVERAGE_CAP",
194
- "EMPTY_STREAM",
195
- "RATE_LIMIT"
196
- ])).has(f.code) ? (this.addMessage(f.error, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(f.error));
194
+ z.pattern.test(_) && (console.debug(`[chat] filtered directive: ${z.label}`), _ = _.replace(z.pattern, "").trim(), z.pattern.lastIndex = 0);
195
+ _ ? _ !== T.text && (T.text = _, this.sharedMessages.value = [...m]) : this.sharedMessages.value = m.slice(0, -1);
196
+ }
197
+ p && (this.conversationId = p), this.updateState(this.textState, { isThinking: !1 });
198
+ }, "onDone"), g = /* @__PURE__ */ h((p) => {
199
+ const m = this.sharedMessages.value, T = m[m.length - 1];
200
+ if (T?.id === a && !T.text && (this.sharedMessages.value = m.slice(0, -1)), typeof p == "object" && p.code && p.error) {
201
+ const { bucket: te, actionUrl: ae, actionLabel: J, help: P } = p;
202
+ if (te !== void 0 || (/* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP", "EMPTY_STREAM", "RATE_LIMIT"])).has(p.code)) {
203
+ const ne = te && ae && J ? { code: p.code, bucket: te, actionLabel: J, actionUrl: ae, ...P ? { help: P } : {} } : void 0;
204
+ this.addMessage(p.error, "system", void 0, ne), te === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
205
+ } else
206
+ this.handleError(new Error(p.error));
197
207
  return;
198
208
  }
199
- const S = typeof f == "string" ? f : f.error, z = this.mapChatError(S);
200
- this.isTransientError(S) ? (this.addMessage(z, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(z));
201
- }, "onError"), p = /* @__PURE__ */ h((f) => {
202
- this.addMessage(f, "system");
209
+ const _ = typeof p == "string" ? p : p.error, z = this.mapChatError(_);
210
+ this.isTransientError(_) ? (this.addMessage(z, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(z));
211
+ }, "onError"), d = /* @__PURE__ */ h((p) => {
212
+ this.addMessage(p, "system");
203
213
  }, "onStatus");
204
214
  try {
205
- const f = s ? s({
215
+ const p = s ? s({
206
216
  message: e,
207
217
  attachments: n,
208
218
  conversationId: this.conversationId,
209
219
  history: this.buildHistory(),
210
220
  onDelta: c,
211
- onDone: d,
221
+ onDone: f,
212
222
  onError: g,
213
- onStatus: p
223
+ onStatus: d
214
224
  }) : r.chatStream({
215
225
  handle: this._agent.handle.value,
216
226
  message: e,
@@ -220,16 +230,16 @@ Current User:
220
230
  visitorId: r.generateAnonId(),
221
231
  context: this.getDynamicSettings().context || void 0,
222
232
  onDelta: c,
223
- onDone: d,
233
+ onDone: f,
224
234
  onError: g,
225
- onStatus: p
235
+ onStatus: d
226
236
  });
227
237
  await Promise.race([
228
- f,
229
- new Promise((m, y) => setTimeout(() => y(new Error("timed out")), Rs))
238
+ p,
239
+ new Promise((m, T) => setTimeout(() => T(new Error("timed out")), Rs))
230
240
  ]);
231
- } catch (f) {
232
- g(f.message || "Something went wrong");
241
+ } catch (p) {
242
+ g(p.message || "Something went wrong");
233
243
  }
234
244
  }
235
245
  buildHistory() {
@@ -253,30 +263,30 @@ Current User:
253
263
  await this.endConversation();
254
264
  }
255
265
  };
256
- h(cn, "AgentChatController");
257
- let Mn = cn;
266
+ h(un, "AgentChatController");
267
+ let Mn = un;
258
268
  function Ln(l) {
259
269
  return l ? typeof l == "string" ? l : l.src || "" : "";
260
270
  }
261
271
  h(Ln, "getImageSrc");
262
- function Ei(l) {
272
+ function Ii(l) {
263
273
  return Ln(l.cover) || Ln(l.avatar) || Qn(l.name);
264
274
  }
265
- h(Ei, "getAgentAvatarUrl");
275
+ h(Ii, "getAgentAvatarUrl");
266
276
  function zn(l) {
267
277
  const t = l.target;
268
278
  t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = Qn());
269
279
  }
270
280
  h(zn, "handleImageError");
271
- function _i(l) {
281
+ function Di(l) {
272
282
  const { template: t, agent: e } = l;
273
283
  return t.replace(/{name}/g, e.name || "Digital Agent").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
274
284
  }
275
- h(_i, "parseButtonTemplate");
285
+ h(Di, "parseButtonTemplate");
276
286
  const Cs = {
277
287
  key: 0,
278
288
  class: "absolute inset-0 flex items-center justify-center"
279
- }, Ri = /* @__PURE__ */ De({
289
+ }, Mi = /* @__PURE__ */ Ie({
280
290
  __name: "ElAgentButton",
281
291
  props: {
282
292
  theme: { default: "primary" },
@@ -286,42 +296,42 @@ const Cs = {
286
296
  iconAfter: {}
287
297
  },
288
298
  setup(l) {
289
- const t = F(() => ({
299
+ const t = H(() => ({
290
300
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
291
301
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
292
302
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
293
303
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
294
- })[l.theme]), e = F(() => ({
304
+ })[l.theme]), e = H(() => ({
295
305
  sm: "px-4 py-2 text-sm",
296
306
  md: "px-6 py-3 text-base",
297
307
  lg: "px-8 py-4 text-base"
298
- })[l.size]), n = F(() => ({
308
+ })[l.size]), n = H(() => ({
299
309
  sm: "size-4",
300
310
  md: "size-4",
301
311
  lg: "size-5"
302
312
  })[l.size]);
303
- return (s, r) => (A(), E("button", {
304
- class: _(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
313
+ return (s, r) => (S(), A("button", {
314
+ class: E(["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]])
305
315
  }, [
306
- l.loading ? (A(), E("div", Cs, [...r[0] || (r[0] = [
307
- T("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
308
- ])])) : G("", !0),
309
- T("span", {
310
- class: _(["flex items-center gap-2 transition-opacity duration-200", l.loading ? "opacity-0" : "opacity-100"])
316
+ l.loading ? (S(), A("div", Cs, [...r[0] || (r[0] = [
317
+ w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
318
+ ])])) : U("", !0),
319
+ w("span", {
320
+ class: E(["flex items-center gap-2 transition-opacity duration-200", l.loading ? "opacity-0" : "opacity-100"])
311
321
  }, [
312
- l.icon ? (A(), E("i", {
322
+ l.icon ? (S(), A("i", {
313
323
  key: 0,
314
- class: _([l.icon, n.value])
315
- }, null, 2)) : G("", !0),
324
+ class: E([l.icon, n.value])
325
+ }, null, 2)) : U("", !0),
316
326
  Zn(s.$slots, "default"),
317
- l.iconAfter ? (A(), E("i", {
327
+ l.iconAfter ? (S(), A("i", {
318
328
  key: 1,
319
- class: _([l.iconAfter, n.value])
320
- }, null, 2)) : G("", !0)
329
+ class: E([l.iconAfter, n.value])
330
+ }, null, 2)) : U("", !0)
321
331
  ], 2)
322
332
  ], 2));
323
333
  }
324
- }), Ds = ["value"], Ci = /* @__PURE__ */ De({
334
+ }), Is = ["value"], Li = /* @__PURE__ */ Ie({
325
335
  __name: "AgentInputEmail",
326
336
  props: {
327
337
  modelValue: { default: "" }
@@ -329,7 +339,7 @@ const Cs = {
329
339
  emits: ["update:modelValue"],
330
340
  setup(l, { emit: t }) {
331
341
  const e = t;
332
- return (n, s) => (A(), E("input", {
342
+ return (n, s) => (S(), A("input", {
333
343
  type: "email",
334
344
  autocomplete: "email",
335
345
  placeholder: "Enter Your Email",
@@ -337,9 +347,9 @@ const Cs = {
337
347
  class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-all",
338
348
  style: { "font-size": "16px" },
339
349
  onInput: s[0] || (s[0] = (r) => e("update:modelValue", r.target.value))
340
- }, null, 40, Ds));
350
+ }, null, 40, Is));
341
351
  }
342
- }), Is = { class: "flex gap-1.5 justify-center" }, Ms = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Di = /* @__PURE__ */ De({
352
+ }), Ds = { class: "flex gap-1.5 justify-center" }, Ms = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], zi = /* @__PURE__ */ Ie({
343
353
  __name: "AgentInputOneTimeCode",
344
354
  props: {
345
355
  modelValue: {},
@@ -348,64 +358,64 @@ const Cs = {
348
358
  },
349
359
  emits: ["update:modelValue", "autoSubmit"],
350
360
  setup(l, { emit: t }) {
351
- const e = l, n = t, s = V([]), r = V(Array.from({ length: e.length }).fill("")), a = V(!1);
352
- Qt(() => {
361
+ const e = l, n = t, s = Z([]), r = Z(Array.from({ length: e.length }).fill("")), a = Z(!1);
362
+ Jt(() => {
353
363
  e.modelValue && (r.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && s.value[0]?.focus();
354
- }), nt(() => e.modelValue, (p) => {
355
- r.value = p ? p.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
356
- }), nt(r, () => {
357
- const p = r.value.filter(Boolean).join("");
358
- n("update:modelValue", p), p.length === e.length && n("autoSubmit", p);
364
+ }), rt(() => e.modelValue, (d) => {
365
+ r.value = d ? d.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
366
+ }), rt(r, () => {
367
+ const d = r.value.filter(Boolean).join("");
368
+ n("update:modelValue", d), d.length === e.length && n("autoSubmit", d);
359
369
  }, { deep: !0 });
360
- function o(p, f) {
361
- f.preventDefault(), a.value = !0;
362
- const m = (f.clipboardData?.getData("text") || "").replace(/\D/g, "");
370
+ function o(d, p) {
371
+ p.preventDefault(), a.value = !0;
372
+ const m = (p.clipboardData?.getData("text") || "").replace(/\D/g, "");
363
373
  if (m.length === e.length)
364
374
  r.value = m.split(""), setTimeout(() => {
365
375
  s.value[e.length - 1]?.focus(), a.value = !1;
366
376
  }, 10);
367
377
  else {
368
- const y = [...r.value];
369
- m.split("").slice(0, e.length - p).forEach((z, de) => {
370
- y[p + de] = z;
371
- }), r.value = y;
372
- const S = Math.min(p + m.length, e.length - 1);
378
+ const T = [...r.value];
379
+ m.split("").slice(0, e.length - d).forEach((z, te) => {
380
+ T[d + te] = z;
381
+ }), r.value = T;
382
+ const _ = Math.min(d + m.length, e.length - 1);
373
383
  setTimeout(() => {
374
- s.value[S]?.focus(), a.value = !1;
384
+ s.value[_]?.focus(), a.value = !1;
375
385
  }, 10);
376
386
  }
377
387
  }
378
388
  h(o, "onPaste");
379
- function c(p, f) {
380
- const m = f.target.value.slice(-1).replace(/\D/g, "");
381
- r.value[p] = m, m && p < e.length - 1 && s.value[p + 1]?.focus();
389
+ function c(d, p) {
390
+ const m = p.target.value.slice(-1).replace(/\D/g, "");
391
+ r.value[d] = m, m && d < e.length - 1 && s.value[d + 1]?.focus();
382
392
  }
383
393
  h(c, "onInput");
384
- function d(p, f) {
385
- f.key === "Backspace" ? (f.preventDefault(), r.value[p] = "", p > 0 && s.value[p - 1]?.focus()) : f.key === "ArrowLeft" && p > 0 ? s.value[p - 1]?.focus() : f.key === "ArrowRight" && p < e.length - 1 && s.value[p + 1]?.focus();
394
+ function f(d, p) {
395
+ p.key === "Backspace" ? (p.preventDefault(), r.value[d] = "", d > 0 && s.value[d - 1]?.focus()) : p.key === "ArrowLeft" && d > 0 ? s.value[d - 1]?.focus() : p.key === "ArrowRight" && d < e.length - 1 && s.value[d + 1]?.focus();
386
396
  }
387
- h(d, "onKeydown");
388
- function g(p) {
389
- if (s.value[p]?.select(), !a.value && r.value[p])
390
- for (let f = p; f < e.length; f++)
391
- r.value[f] = "";
397
+ h(f, "onKeydown");
398
+ function g(d) {
399
+ if (s.value[d]?.select(), !a.value && r.value[d])
400
+ for (let p = d; p < e.length; p++)
401
+ r.value[p] = "";
392
402
  }
393
- return h(g, "onFocus"), (p, f) => (A(), E("div", Is, [
394
- (A(!0), E(_e, null, xt(l.length, (m) => Xn((A(), E("input", {
403
+ return h(g, "onFocus"), (d, p) => (S(), A("div", Ds, [
404
+ (S(!0), A(_e, null, bt(l.length, (m) => Xn((S(), A("input", {
395
405
  key: m,
396
406
  ref_for: !0,
397
- ref: /* @__PURE__ */ h((y) => s.value[m - 1] = y, "ref"),
398
- "onUpdate:modelValue": /* @__PURE__ */ h((y) => r.value[m - 1] = y, "onUpdate:modelValue"),
407
+ ref: /* @__PURE__ */ h((T) => s.value[m - 1] = T, "ref"),
408
+ "onUpdate:modelValue": /* @__PURE__ */ h((T) => r.value[m - 1] = T, "onUpdate:modelValue"),
399
409
  type: "text",
400
410
  inputmode: "numeric",
401
411
  autocomplete: "one-time-code",
402
412
  class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
403
413
  style: { "font-size": "16px" },
404
414
  maxlength: "1",
405
- onInput: /* @__PURE__ */ h((y) => c(m - 1, y), "onInput"),
406
- onKeydown: /* @__PURE__ */ h((y) => d(m - 1, y), "onKeydown"),
407
- onPaste: /* @__PURE__ */ h((y) => o(m - 1, y), "onPaste"),
408
- onFocus: /* @__PURE__ */ h((y) => g(m - 1), "onFocus")
415
+ onInput: /* @__PURE__ */ h((T) => c(m - 1, T), "onInput"),
416
+ onKeydown: /* @__PURE__ */ h((T) => f(m - 1, T), "onKeydown"),
417
+ onPaste: /* @__PURE__ */ h((T) => o(m - 1, T), "onPaste"),
418
+ onFocus: /* @__PURE__ */ h((T) => g(m - 1), "onFocus")
409
419
  }, null, 40, Ms)), [
410
420
  [Kn, r.value[m - 1]]
411
421
  ])), 128))
@@ -414,7 +424,7 @@ const Cs = {
414
424
  }), Ls = { class: "relative flex-shrink-0" }, zs = ["src", "alt"], Os = { class: "absolute top-1 right-1" }, Ps = {
415
425
  key: 1,
416
426
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
417
- }, Ns = { class: "min-w-0" }, $s = /* @__PURE__ */ De({
427
+ }, Ns = { class: "min-w-0" }, $s = /* @__PURE__ */ Ie({
418
428
  __name: "ElModeHeader",
419
429
  props: {
420
430
  agent: {},
@@ -423,46 +433,46 @@ const Cs = {
423
433
  layout: { default: "centered" }
424
434
  },
425
435
  setup(l) {
426
- return (t, e) => (A(), E("div", {
427
- class: _(["flex gap-4", [
436
+ return (t, e) => (S(), A("div", {
437
+ class: E(["flex gap-4", [
428
438
  l.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
429
439
  ]])
430
440
  }, [
431
- T("div", Ls, [
432
- T("div", {
433
- class: _(["rounded-full overflow-hidden border-white", l.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
441
+ w("div", Ls, [
442
+ w("div", {
443
+ class: E(["rounded-full overflow-hidden border-white", l.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
434
444
  }, [
435
- T("img", {
445
+ w("img", {
436
446
  src: l.agent.avatarUrl.value,
437
447
  alt: l.agent.displayName.value,
438
448
  class: "w-full h-full object-cover",
439
449
  onError: e[0] || (e[0] = //@ts-ignore
440
- (...n) => Yt(zn) && Yt(zn)(...n))
450
+ (...n) => Zt(zn) && Zt(zn)(...n))
441
451
  }, null, 40, zs)
442
452
  ], 2),
443
- T("div", Os, [
444
- l.isOnline ? (A(), E(_e, { key: 0 }, [
445
- e[1] || (e[1] = T("div", {
453
+ w("div", Os, [
454
+ l.isOnline ? (S(), A(_e, { key: 0 }, [
455
+ e[1] || (e[1] = w("div", {
446
456
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
447
457
  style: { "animation-duration": "3s" }
448
458
  }, null, -1)),
449
- e[2] || (e[2] = T("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
450
- ], 64)) : (A(), E("div", Ps))
459
+ e[2] || (e[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
460
+ ], 64)) : (S(), A("div", Ps))
451
461
  ])
452
462
  ]),
453
- T("div", Ns, [
454
- T("h1", {
455
- class: _(["font-light text-white mb-1 truncate", [
463
+ w("div", Ns, [
464
+ w("h1", {
465
+ class: E(["font-light text-white mb-1 truncate", [
456
466
  l.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
457
467
  l.layout === "horizontal" ? "text-white/95" : ""
458
468
  ]])
459
- }, pe(l.agent.displayName.value), 3),
460
- T("p", {
461
- class: _(["font-light line-clamp-1", [
469
+ }, re(l.agent.displayName.value), 3),
470
+ w("p", {
471
+ class: E(["font-light line-clamp-1", [
462
472
  l.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
463
473
  l.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
464
474
  ]])
465
- }, pe(l.layout === "horizontal" ? l.agent.title.value || "Digital Agent" : l.agent.title.value), 3)
475
+ }, re(l.layout === "horizontal" ? l.agent.title.value || "Digital Agent" : l.agent.title.value), 3)
466
476
  ])
467
477
  ], 2));
468
478
  }
@@ -475,49 +485,49 @@ const {
475
485
  getOwnPropertyDescriptor: Fs
476
486
  } = Object;
477
487
  let {
478
- freeze: Z,
479
- seal: te,
480
- create: et
488
+ freeze: K,
489
+ seal: ie,
490
+ create: nt
481
491
  } = Object, {
482
- apply: Zt,
483
- construct: Xt
492
+ apply: Xt,
493
+ construct: Kt
484
494
  } = typeof Reflect < "u" && Reflect;
485
- Z || (Z = /* @__PURE__ */ h(function(t) {
495
+ K || (K = /* @__PURE__ */ h(function(t) {
486
496
  return t;
487
497
  }, "freeze"));
488
- te || (te = /* @__PURE__ */ h(function(t) {
498
+ ie || (ie = /* @__PURE__ */ h(function(t) {
489
499
  return t;
490
500
  }, "seal"));
491
- Zt || (Zt = /* @__PURE__ */ h(function(t, e) {
501
+ Xt || (Xt = /* @__PURE__ */ h(function(t, e) {
492
502
  for (var n = arguments.length, s = new Array(n > 2 ? n - 2 : 0), r = 2; r < n; r++)
493
503
  s[r - 2] = arguments[r];
494
504
  return t.apply(e, s);
495
505
  }, "apply"));
496
- Xt || (Xt = /* @__PURE__ */ h(function(t) {
506
+ Kt || (Kt = /* @__PURE__ */ h(function(t) {
497
507
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
498
508
  n[s - 1] = arguments[s];
499
509
  return new t(...n);
500
510
  }, "construct"));
501
- const Ve = X(Array.prototype.forEach), Hs = X(Array.prototype.lastIndexOf), Pn = X(Array.prototype.pop), Ye = X(Array.prototype.push), Gs = X(Array.prototype.splice), bt = X(String.prototype.toLowerCase), Ht = X(String.prototype.toString), Gt = X(String.prototype.match), Ne = X(String.prototype.replace), Ws = X(String.prototype.indexOf), js = X(String.prototype.trim), ie = X(Object.prototype.hasOwnProperty), q = X(RegExp.prototype.test), Ze = qs(TypeError);
502
- function X(l) {
511
+ const Ze = Q(Array.prototype.forEach), Hs = Q(Array.prototype.lastIndexOf), Pn = Q(Array.prototype.pop), Xe = Q(Array.prototype.push), Gs = Q(Array.prototype.splice), kt = Q(String.prototype.toLowerCase), Gt = Q(String.prototype.toString), Wt = Q(String.prototype.match), Ne = Q(String.prototype.replace), Ws = Q(String.prototype.indexOf), js = Q(String.prototype.trim), ce = Q(Object.prototype.hasOwnProperty), Y = Q(RegExp.prototype.test), Ke = qs(TypeError);
512
+ function Q(l) {
503
513
  return function(t) {
504
514
  t instanceof RegExp && (t.lastIndex = 0);
505
515
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
506
516
  n[s - 1] = arguments[s];
507
- return Zt(l, t, n);
517
+ return Xt(l, t, n);
508
518
  };
509
519
  }
510
- h(X, "unapply");
520
+ h(Q, "unapply");
511
521
  function qs(l) {
512
522
  return function() {
513
523
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
514
524
  e[n] = arguments[n];
515
- return Xt(l, e);
525
+ return Kt(l, e);
516
526
  };
517
527
  }
518
528
  h(qs, "unconstruct");
519
529
  function R(l, t) {
520
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : bt;
530
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : kt;
521
531
  On && On(l, null);
522
532
  let n = t.length;
523
533
  for (; n--; ) {
@@ -533,25 +543,25 @@ function R(l, t) {
533
543
  h(R, "addToSet");
534
544
  function Vs(l) {
535
545
  for (let t = 0; t < l.length; t++)
536
- ie(l, t) || (l[t] = null);
546
+ ce(l, t) || (l[t] = null);
537
547
  return l;
538
548
  }
539
549
  h(Vs, "cleanArray");
540
- function ue(l) {
541
- const t = et(null);
550
+ function fe(l) {
551
+ const t = nt(null);
542
552
  for (const [e, n] of Jn(l))
543
- ie(l, e) && (Array.isArray(n) ? t[e] = Vs(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = ue(n) : t[e] = n);
553
+ ce(l, e) && (Array.isArray(n) ? t[e] = Vs(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = fe(n) : t[e] = n);
544
554
  return t;
545
555
  }
546
- h(ue, "clone");
547
- function Xe(l, t) {
556
+ h(fe, "clone");
557
+ function Qe(l, t) {
548
558
  for (; l !== null; ) {
549
559
  const n = Fs(l, t);
550
560
  if (n) {
551
561
  if (n.get)
552
- return X(n.get);
562
+ return Q(n.get);
553
563
  if (typeof n.value == "function")
554
- return X(n.value);
564
+ return Q(n.value);
555
565
  }
556
566
  l = Bs(l);
557
567
  }
@@ -560,14 +570,14 @@ function Xe(l, t) {
560
570
  }
561
571
  return h(e, "fallbackValue"), e;
562
572
  }
563
- h(Xe, "lookupGetter");
564
- const Nn = Z(["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"]), Wt = Z(["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"]), jt = Z(["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"]), Ys = Z(["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"]), qt = Z(["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"]), Zs = Z(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), $n = Z(["#text"]), Un = Z(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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", "slot"]), Vt = Z(["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"]), Bn = Z(["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"]), gt = Z(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Xs = te(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Ks = te(/<%[\w\W]*|[\w\W]*%>/gm), Qs = te(/\$\{[\w\W]*/gm), Js = te(/^data-[\-\w.\u00B7-\uFFFF]+$/), er = te(/^aria-[\-\w]+$/), es = te(
573
+ h(Qe, "lookupGetter");
574
+ const Nn = K(["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"]), jt = K(["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"]), qt = K(["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"]), Ys = K(["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"]), Vt = K(["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"]), Zs = K(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), $n = K(["#text"]), Un = K(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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", "slot"]), Yt = K(["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"]), Bn = K(["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"]), mt = K(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Xs = ie(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Ks = ie(/<%[\w\W]*|[\w\W]*%>/gm), Qs = ie(/\$\{[\w\W]*/gm), Js = ie(/^data-[\-\w.\u00B7-\uFFFF]+$/), er = ie(/^aria-[\-\w]+$/), es = ie(
565
575
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
566
576
  // eslint-disable-line no-useless-escape
567
- ), tr = te(/^(?:\w+script|data):/i), nr = te(
577
+ ), tr = ie(/^(?:\w+script|data):/i), nr = ie(
568
578
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
569
579
  // eslint-disable-line no-control-regex
570
- ), ts = te(/^html$/i), sr = te(/^[a-z][.\w]*(-[.\w]+)+$/i);
580
+ ), ts = ie(/^html$/i), sr = ie(/^[a-z][.\w]*(-[.\w]+)+$/i);
571
581
  var Fn = /* @__PURE__ */ Object.freeze({
572
582
  __proto__: null,
573
583
  ARIA_ATTR: er,
@@ -581,7 +591,7 @@ var Fn = /* @__PURE__ */ Object.freeze({
581
591
  MUSTACHE_EXPR: Xs,
582
592
  TMPLIT_EXPR: Qs
583
593
  });
584
- const Ke = {
594
+ const Je = {
585
595
  element: 1,
586
596
  text: 3,
587
597
  // Deprecated
@@ -624,8 +634,8 @@ const Ke = {
624
634
  }, "_createHooksMap");
625
635
  function ns() {
626
636
  let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : rr();
627
- const t = /* @__PURE__ */ h((v) => ns(v), "DOMPurify");
628
- if (t.version = "3.4.0", t.removed = [], !l || !l.document || l.document.nodeType !== Ke.document || !l.Element)
637
+ const t = /* @__PURE__ */ h((y) => ns(y), "DOMPurify");
638
+ if (t.version = "3.4.0", t.removed = [], !l || !l.document || l.document.nodeType !== Je.document || !l.Element)
629
639
  return t.isSupported = !1, t;
630
640
  let {
631
641
  document: e
@@ -635,44 +645,44 @@ function ns() {
635
645
  HTMLTemplateElement: a,
636
646
  Node: o,
637
647
  Element: c,
638
- NodeFilter: d,
648
+ NodeFilter: f,
639
649
  NamedNodeMap: g = l.NamedNodeMap || l.MozNamedAttrMap,
640
- HTMLFormElement: p,
641
- DOMParser: f,
650
+ HTMLFormElement: d,
651
+ DOMParser: p,
642
652
  trustedTypes: m
643
- } = l, y = c.prototype, S = Xe(y, "cloneNode"), z = Xe(y, "remove"), de = Xe(y, "nextSibling"), me = Xe(y, "childNodes"), ne = Xe(y, "parentNode");
653
+ } = l, T = c.prototype, _ = Qe(T, "cloneNode"), z = Qe(T, "remove"), te = Qe(T, "nextSibling"), ae = Qe(T, "childNodes"), J = Qe(T, "parentNode");
644
654
  if (typeof a == "function") {
645
- const v = e.createElement("template");
646
- v.content && v.content.ownerDocument && (e = v.content.ownerDocument);
655
+ const y = e.createElement("template");
656
+ y.content && y.content.ownerDocument && (e = y.content.ownerDocument);
647
657
  }
648
- let $, j = "";
658
+ let P, W = "";
649
659
  const {
650
- implementation: se,
651
- createNodeIterator: fe,
652
- createDocumentFragment: rt,
653
- getElementsByTagName: L
660
+ implementation: le,
661
+ createNodeIterator: ne,
662
+ createDocumentFragment: Et,
663
+ getElementsByTagName: at
654
664
  } = e, {
655
- importNode: it
665
+ importNode: I
656
666
  } = n;
657
- let U = Hn();
658
- t.isSupported = typeof Jn == "function" && typeof ne == "function" && se && se.createHTMLDocument !== void 0;
667
+ let G = Hn();
668
+ t.isSupported = typeof Jn == "function" && typeof J == "function" && le && le.createHTMLDocument !== void 0;
659
669
  const {
660
- MUSTACHE_EXPR: ve,
670
+ MUSTACHE_EXPR: xe,
661
671
  ERB_EXPR: Me,
662
672
  TMPLIT_EXPR: ye,
663
- DATA_ATTR: At,
664
- ARIA_ATTR: Et,
665
- IS_SCRIPT_OR_DATA: _t,
666
- ATTR_WHITESPACE: at,
667
- CUSTOM_ELEMENT: lt
673
+ DATA_ATTR: _t,
674
+ ARIA_ATTR: lt,
675
+ IS_SCRIPT_OR_DATA: Rt,
676
+ ATTR_WHITESPACE: ot,
677
+ CUSTOM_ELEMENT: Ct
668
678
  } = Fn;
669
679
  let {
670
- IS_ALLOWED_URI: Ge
671
- } = Fn, b = null;
672
- const w = R({}, [...Nn, ...Wt, ...jt, ...qt, ...$n]);
673
- let k = null;
674
- const O = R({}, [...Un, ...Vt, ...Bn, ...gt]);
675
- let C = Object.seal(et(null, {
680
+ IS_ALLOWED_URI: ct
681
+ } = Fn, N = null;
682
+ const Ge = R({}, [...Nn, ...jt, ...qt, ...Vt, ...$n]);
683
+ let v = null;
684
+ const k = R({}, [...Un, ...Yt, ...Bn, ...mt]);
685
+ let x = Object.seal(nt(null, {
676
686
  tagNameCheck: {
677
687
  writable: !0,
678
688
  configurable: !1,
@@ -691,8 +701,8 @@ function ns() {
691
701
  enumerable: !0,
692
702
  value: !1
693
703
  }
694
- })), J = null, Te = null;
695
- const ee = Object.seal(et(null, {
704
+ })), L = null, B = null;
705
+ const V = Object.seal(nt(null, {
696
706
  tagCheck: {
697
707
  writable: !0,
698
708
  configurable: !1,
@@ -706,70 +716,70 @@ function ns() {
706
716
  value: null
707
717
  }
708
718
  }));
709
- let un = !0, Rt = !0, hn = !1, pn = !0, Se = !1, We = !0, Ae = !1, Ct = !1, Dt = !1, Le = !1, ot = !1, ct = !1, dn = !0, fn = !1;
719
+ let We = !0, Te = !0, hn = !1, pn = !0, Se = !1, je = !0, Ae = !1, It = !1, Dt = !1, Le = !1, ut = !1, ht = !1, dn = !0, fn = !1;
710
720
  const ds = "user-content-";
711
- let It = !0, je = !1, ze = {}, oe = null;
712
- const Mt = R({}, ["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"]);
721
+ let Mt = !0, qe = !1, ze = {}, pe = null;
722
+ const Lt = R({}, ["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"]);
713
723
  let gn = null;
714
724
  const mn = R({}, ["audio", "video", "img", "source", "image", "track"]);
715
- let Lt = null;
716
- const xn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ut = "http://www.w3.org/1998/Math/MathML", ht = "http://www.w3.org/2000/svg", ce = "http://www.w3.org/1999/xhtml";
717
- let Oe = ce, zt = !1, Ot = null;
718
- const fs = R({}, [ut, ht, ce], Ht);
719
- let pt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), dt = R({}, ["annotation-xml"]);
725
+ let zt = null;
726
+ const xn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), pt = "http://www.w3.org/1998/Math/MathML", dt = "http://www.w3.org/2000/svg", de = "http://www.w3.org/1999/xhtml";
727
+ let Oe = de, Ot = !1, Pt = null;
728
+ const fs = R({}, [pt, dt, de], Gt);
729
+ let ft = R({}, ["mi", "mo", "mn", "ms", "mtext"]), gt = R({}, ["annotation-xml"]);
720
730
  const gs = R({}, ["title", "style", "font", "a", "script"]);
721
- let qe = null;
731
+ let Ve = null;
722
732
  const ms = ["application/xhtml+xml", "text/html"], xs = "text/html";
723
- let B = null, Pe = null;
733
+ let F = null, Pe = null;
724
734
  const bs = e.createElement("form"), bn = /* @__PURE__ */ h(function(i) {
725
735
  return i instanceof RegExp || i instanceof Function;
726
- }, "isRegexOrFunction"), Pt = /* @__PURE__ */ h(function() {
736
+ }, "isRegexOrFunction"), Nt = /* @__PURE__ */ h(function() {
727
737
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
728
738
  if (!(Pe && Pe === i)) {
729
- if ((!i || typeof i != "object") && (i = {}), i = ue(i), qe = // eslint-disable-next-line unicorn/prefer-includes
730
- ms.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? xs : i.PARSER_MEDIA_TYPE, B = qe === "application/xhtml+xml" ? Ht : bt, b = ie(i, "ALLOWED_TAGS") ? R({}, i.ALLOWED_TAGS, B) : w, k = ie(i, "ALLOWED_ATTR") ? R({}, i.ALLOWED_ATTR, B) : O, Ot = ie(i, "ALLOWED_NAMESPACES") ? R({}, i.ALLOWED_NAMESPACES, Ht) : fs, Lt = ie(i, "ADD_URI_SAFE_ATTR") ? R(ue(xn), i.ADD_URI_SAFE_ATTR, B) : xn, gn = ie(i, "ADD_DATA_URI_TAGS") ? R(ue(mn), i.ADD_DATA_URI_TAGS, B) : mn, oe = ie(i, "FORBID_CONTENTS") ? R({}, i.FORBID_CONTENTS, B) : Mt, J = ie(i, "FORBID_TAGS") ? R({}, i.FORBID_TAGS, B) : ue({}), Te = ie(i, "FORBID_ATTR") ? R({}, i.FORBID_ATTR, B) : ue({}), ze = ie(i, "USE_PROFILES") ? i.USE_PROFILES : !1, un = i.ALLOW_ARIA_ATTR !== !1, Rt = i.ALLOW_DATA_ATTR !== !1, hn = i.ALLOW_UNKNOWN_PROTOCOLS || !1, pn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Se = i.SAFE_FOR_TEMPLATES || !1, We = i.SAFE_FOR_XML !== !1, Ae = i.WHOLE_DOCUMENT || !1, Le = i.RETURN_DOM || !1, ot = i.RETURN_DOM_FRAGMENT || !1, ct = i.RETURN_TRUSTED_TYPE || !1, Dt = i.FORCE_BODY || !1, dn = i.SANITIZE_DOM !== !1, fn = i.SANITIZE_NAMED_PROPS || !1, It = i.KEEP_CONTENT !== !1, je = i.IN_PLACE || !1, Ge = i.ALLOWED_URI_REGEXP || es, Oe = i.NAMESPACE || ce, pt = i.MATHML_TEXT_INTEGRATION_POINTS || pt, dt = i.HTML_INTEGRATION_POINTS || dt, C = i.CUSTOM_ELEMENT_HANDLING || et(null), i.CUSTOM_ELEMENT_HANDLING && bn(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (C.tagNameCheck = i.CUSTOM_ELEMENT_HANDLING.tagNameCheck), i.CUSTOM_ELEMENT_HANDLING && bn(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (C.attributeNameCheck = i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (C.allowCustomizedBuiltInElements = i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Se && (Rt = !1), ot && (Le = !0), ze && (b = R({}, $n), k = et(null), ze.html === !0 && (R(b, Nn), R(k, Un)), ze.svg === !0 && (R(b, Wt), R(k, Vt), R(k, gt)), ze.svgFilters === !0 && (R(b, jt), R(k, Vt), R(k, gt)), ze.mathMl === !0 && (R(b, qt), R(k, Bn), R(k, gt))), ee.tagCheck = null, ee.attributeCheck = null, i.ADD_TAGS && (typeof i.ADD_TAGS == "function" ? ee.tagCheck = i.ADD_TAGS : (b === w && (b = ue(b)), R(b, i.ADD_TAGS, B))), i.ADD_ATTR && (typeof i.ADD_ATTR == "function" ? ee.attributeCheck = i.ADD_ATTR : (k === O && (k = ue(k)), R(k, i.ADD_ATTR, B))), i.ADD_URI_SAFE_ATTR && R(Lt, i.ADD_URI_SAFE_ATTR, B), i.FORBID_CONTENTS && (oe === Mt && (oe = ue(oe)), R(oe, i.FORBID_CONTENTS, B)), i.ADD_FORBID_CONTENTS && (oe === Mt && (oe = ue(oe)), R(oe, i.ADD_FORBID_CONTENTS, B)), It && (b["#text"] = !0), Ae && R(b, ["html", "head", "body"]), b.table && (R(b, ["tbody"]), delete J.tbody), i.TRUSTED_TYPES_POLICY) {
739
+ if ((!i || typeof i != "object") && (i = {}), i = fe(i), Ve = // eslint-disable-next-line unicorn/prefer-includes
740
+ ms.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? xs : i.PARSER_MEDIA_TYPE, F = Ve === "application/xhtml+xml" ? Gt : kt, N = ce(i, "ALLOWED_TAGS") ? R({}, i.ALLOWED_TAGS, F) : Ge, v = ce(i, "ALLOWED_ATTR") ? R({}, i.ALLOWED_ATTR, F) : k, Pt = ce(i, "ALLOWED_NAMESPACES") ? R({}, i.ALLOWED_NAMESPACES, Gt) : fs, zt = ce(i, "ADD_URI_SAFE_ATTR") ? R(fe(xn), i.ADD_URI_SAFE_ATTR, F) : xn, gn = ce(i, "ADD_DATA_URI_TAGS") ? R(fe(mn), i.ADD_DATA_URI_TAGS, F) : mn, pe = ce(i, "FORBID_CONTENTS") ? R({}, i.FORBID_CONTENTS, F) : Lt, L = ce(i, "FORBID_TAGS") ? R({}, i.FORBID_TAGS, F) : fe({}), B = ce(i, "FORBID_ATTR") ? R({}, i.FORBID_ATTR, F) : fe({}), ze = ce(i, "USE_PROFILES") ? i.USE_PROFILES : !1, We = i.ALLOW_ARIA_ATTR !== !1, Te = i.ALLOW_DATA_ATTR !== !1, hn = i.ALLOW_UNKNOWN_PROTOCOLS || !1, pn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Se = i.SAFE_FOR_TEMPLATES || !1, je = i.SAFE_FOR_XML !== !1, Ae = i.WHOLE_DOCUMENT || !1, Le = i.RETURN_DOM || !1, ut = i.RETURN_DOM_FRAGMENT || !1, ht = i.RETURN_TRUSTED_TYPE || !1, Dt = i.FORCE_BODY || !1, dn = i.SANITIZE_DOM !== !1, fn = i.SANITIZE_NAMED_PROPS || !1, Mt = i.KEEP_CONTENT !== !1, qe = i.IN_PLACE || !1, ct = i.ALLOWED_URI_REGEXP || es, Oe = i.NAMESPACE || de, ft = i.MATHML_TEXT_INTEGRATION_POINTS || ft, gt = i.HTML_INTEGRATION_POINTS || gt, x = i.CUSTOM_ELEMENT_HANDLING || nt(null), i.CUSTOM_ELEMENT_HANDLING && bn(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (x.tagNameCheck = i.CUSTOM_ELEMENT_HANDLING.tagNameCheck), i.CUSTOM_ELEMENT_HANDLING && bn(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (x.attributeNameCheck = i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (x.allowCustomizedBuiltInElements = i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Se && (Te = !1), ut && (Le = !0), ze && (N = R({}, $n), v = nt(null), ze.html === !0 && (R(N, Nn), R(v, Un)), ze.svg === !0 && (R(N, jt), R(v, Yt), R(v, mt)), ze.svgFilters === !0 && (R(N, qt), R(v, Yt), R(v, mt)), ze.mathMl === !0 && (R(N, Vt), R(v, Bn), R(v, mt))), V.tagCheck = null, V.attributeCheck = null, i.ADD_TAGS && (typeof i.ADD_TAGS == "function" ? V.tagCheck = i.ADD_TAGS : (N === Ge && (N = fe(N)), R(N, i.ADD_TAGS, F))), i.ADD_ATTR && (typeof i.ADD_ATTR == "function" ? V.attributeCheck = i.ADD_ATTR : (v === k && (v = fe(v)), R(v, i.ADD_ATTR, F))), i.ADD_URI_SAFE_ATTR && R(zt, i.ADD_URI_SAFE_ATTR, F), i.FORBID_CONTENTS && (pe === Lt && (pe = fe(pe)), R(pe, i.FORBID_CONTENTS, F)), i.ADD_FORBID_CONTENTS && (pe === Lt && (pe = fe(pe)), R(pe, i.ADD_FORBID_CONTENTS, F)), Mt && (N["#text"] = !0), Ae && R(N, ["html", "head", "body"]), N.table && (R(N, ["tbody"]), delete L.tbody), i.TRUSTED_TYPES_POLICY) {
731
741
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
732
- throw Ze('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
742
+ throw Ke('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
733
743
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
734
- throw Ze('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
735
- $ = i.TRUSTED_TYPES_POLICY, j = $.createHTML("");
744
+ throw Ke('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
745
+ P = i.TRUSTED_TYPES_POLICY, W = P.createHTML("");
736
746
  } else
737
- $ === void 0 && ($ = ir(m, s)), $ !== null && typeof j == "string" && (j = $.createHTML(""));
738
- Z && Z(i), Pe = i;
747
+ P === void 0 && (P = ir(m, s)), P !== null && typeof W == "string" && (W = P.createHTML(""));
748
+ K && K(i), Pe = i;
739
749
  }
740
- }, "_parseConfig"), kn = R({}, [...Wt, ...jt, ...Ys]), wn = R({}, [...qt, ...Zs]), ks = /* @__PURE__ */ h(function(i) {
741
- let u = ne(i);
750
+ }, "_parseConfig"), kn = R({}, [...jt, ...qt, ...Ys]), wn = R({}, [...Vt, ...Zs]), ks = /* @__PURE__ */ h(function(i) {
751
+ let u = J(i);
742
752
  (!u || !u.tagName) && (u = {
743
753
  namespaceURI: Oe,
744
754
  tagName: "template"
745
755
  });
746
- const x = bt(i.tagName), P = bt(u.tagName);
747
- return Ot[i.namespaceURI] ? i.namespaceURI === ht ? u.namespaceURI === ce ? x === "svg" : u.namespaceURI === ut ? x === "svg" && (P === "annotation-xml" || pt[P]) : !!kn[x] : i.namespaceURI === ut ? u.namespaceURI === ce ? x === "math" : u.namespaceURI === ht ? x === "math" && dt[P] : !!wn[x] : i.namespaceURI === ce ? u.namespaceURI === ht && !dt[P] || u.namespaceURI === ut && !pt[P] ? !1 : !wn[x] && (gs[x] || !kn[x]) : !!(qe === "application/xhtml+xml" && Ot[i.namespaceURI]) : !1;
748
- }, "_checkValidNamespace"), re = /* @__PURE__ */ h(function(i) {
749
- Ye(t.removed, {
756
+ const b = kt(i.tagName), O = kt(u.tagName);
757
+ return Pt[i.namespaceURI] ? i.namespaceURI === dt ? u.namespaceURI === de ? b === "svg" : u.namespaceURI === pt ? b === "svg" && (O === "annotation-xml" || ft[O]) : !!kn[b] : i.namespaceURI === pt ? u.namespaceURI === de ? b === "math" : u.namespaceURI === dt ? b === "math" && gt[O] : !!wn[b] : i.namespaceURI === de ? u.namespaceURI === dt && !gt[O] || u.namespaceURI === pt && !ft[O] ? !1 : !wn[b] && (gs[b] || !kn[b]) : !!(Ve === "application/xhtml+xml" && Pt[i.namespaceURI]) : !1;
758
+ }, "_checkValidNamespace"), oe = /* @__PURE__ */ h(function(i) {
759
+ Xe(t.removed, {
750
760
  element: i
751
761
  });
752
762
  try {
753
- ne(i).removeChild(i);
763
+ J(i).removeChild(i);
754
764
  } catch {
755
765
  z(i);
756
766
  }
757
767
  }, "_forceRemove"), Ee = /* @__PURE__ */ h(function(i, u) {
758
768
  try {
759
- Ye(t.removed, {
769
+ Xe(t.removed, {
760
770
  attribute: u.getAttributeNode(i),
761
771
  from: u
762
772
  });
763
773
  } catch {
764
- Ye(t.removed, {
774
+ Xe(t.removed, {
765
775
  attribute: null,
766
776
  from: u
767
777
  });
768
778
  }
769
779
  if (u.removeAttribute(i), i === "is")
770
- if (Le || ot)
780
+ if (Le || ut)
771
781
  try {
772
- re(u);
782
+ oe(u);
773
783
  } catch {
774
784
  }
775
785
  else
@@ -778,98 +788,98 @@ function ns() {
778
788
  } catch {
779
789
  }
780
790
  }, "_removeAttribute"), vn = /* @__PURE__ */ h(function(i) {
781
- let u = null, x = null;
791
+ let u = null, b = null;
782
792
  if (Dt)
783
793
  i = "<remove></remove>" + i;
784
794
  else {
785
- const N = Gt(i, /^[\r\n\t ]+/);
786
- x = N && N[0];
795
+ const $ = Wt(i, /^[\r\n\t ]+/);
796
+ b = $ && $[0];
787
797
  }
788
- qe === "application/xhtml+xml" && Oe === ce && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
789
- const P = $ ? $.createHTML(i) : i;
790
- if (Oe === ce)
798
+ Ve === "application/xhtml+xml" && Oe === de && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
799
+ const O = P ? P.createHTML(i) : i;
800
+ if (Oe === de)
791
801
  try {
792
- u = new f().parseFromString(P, qe);
802
+ u = new p().parseFromString(O, Ve);
793
803
  } catch {
794
804
  }
795
805
  if (!u || !u.documentElement) {
796
- u = se.createDocument(Oe, "template", null);
806
+ u = le.createDocument(Oe, "template", null);
797
807
  try {
798
- u.documentElement.innerHTML = zt ? j : P;
808
+ u.documentElement.innerHTML = Ot ? W : O;
799
809
  } catch {
800
810
  }
801
811
  }
802
- const W = u.body || u.documentElement;
803
- return i && x && W.insertBefore(e.createTextNode(x), W.childNodes[0] || null), Oe === ce ? L.call(u, Ae ? "html" : "body")[0] : Ae ? u.documentElement : W;
812
+ const q = u.body || u.documentElement;
813
+ return i && b && q.insertBefore(e.createTextNode(b), q.childNodes[0] || null), Oe === de ? at.call(u, Ae ? "html" : "body")[0] : Ae ? u.documentElement : q;
804
814
  }, "_initDocument"), yn = /* @__PURE__ */ h(function(i) {
805
- return fe.call(
815
+ return ne.call(
806
816
  i.ownerDocument || i,
807
817
  i,
808
818
  // eslint-disable-next-line no-bitwise
809
- d.SHOW_ELEMENT | d.SHOW_COMMENT | d.SHOW_TEXT | d.SHOW_PROCESSING_INSTRUCTION | d.SHOW_CDATA_SECTION,
819
+ f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION,
810
820
  null
811
821
  );
812
- }, "_createNodeIterator"), Nt = /* @__PURE__ */ h(function(i) {
813
- return i instanceof p && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof g) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
814
- }, "_isClobbered"), $t = /* @__PURE__ */ h(function(i) {
822
+ }, "_createNodeIterator"), $t = /* @__PURE__ */ h(function(i) {
823
+ return i instanceof d && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof g) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
824
+ }, "_isClobbered"), Ut = /* @__PURE__ */ h(function(i) {
815
825
  return typeof o == "function" && i instanceof o;
816
826
  }, "_isNode");
817
- function ge(v, i, u) {
818
- Ve(v, (x) => {
819
- x.call(t, i, u, Pe);
827
+ function me(y, i, u) {
828
+ Ze(y, (b) => {
829
+ b.call(t, i, u, Pe);
820
830
  });
821
831
  }
822
- h(ge, "_executeHooks");
832
+ h(me, "_executeHooks");
823
833
  const Tn = /* @__PURE__ */ h(function(i) {
824
834
  let u = null;
825
- if (ge(U.beforeSanitizeElements, i, null), Nt(i))
826
- return re(i), !0;
827
- const x = B(i.nodeName);
828
- if (ge(U.uponSanitizeElement, i, {
829
- tagName: x,
830
- allowedTags: b
831
- }), We && i.hasChildNodes() && !$t(i.firstElementChild) && q(/<[/\w!]/g, i.innerHTML) && q(/<[/\w!]/g, i.textContent) || We && i.namespaceURI === ce && x === "style" && $t(i.firstElementChild) || i.nodeType === Ke.progressingInstruction || We && i.nodeType === Ke.comment && q(/<[/\w]/g, i.data))
832
- return re(i), !0;
833
- if (J[x] || !(ee.tagCheck instanceof Function && ee.tagCheck(x)) && !b[x]) {
834
- if (!J[x] && An(x) && (C.tagNameCheck instanceof RegExp && q(C.tagNameCheck, x) || C.tagNameCheck instanceof Function && C.tagNameCheck(x)))
835
+ if (me(G.beforeSanitizeElements, i, null), $t(i))
836
+ return oe(i), !0;
837
+ const b = F(i.nodeName);
838
+ if (me(G.uponSanitizeElement, i, {
839
+ tagName: b,
840
+ allowedTags: N
841
+ }), je && i.hasChildNodes() && !Ut(i.firstElementChild) && Y(/<[/\w!]/g, i.innerHTML) && Y(/<[/\w!]/g, i.textContent) || je && i.namespaceURI === de && b === "style" && Ut(i.firstElementChild) || i.nodeType === Je.progressingInstruction || je && i.nodeType === Je.comment && Y(/<[/\w]/g, i.data))
842
+ return oe(i), !0;
843
+ if (L[b] || !(V.tagCheck instanceof Function && V.tagCheck(b)) && !N[b]) {
844
+ if (!L[b] && An(b) && (x.tagNameCheck instanceof RegExp && Y(x.tagNameCheck, b) || x.tagNameCheck instanceof Function && x.tagNameCheck(b)))
835
845
  return !1;
836
- if (It && !oe[x]) {
837
- const P = ne(i) || i.parentNode, W = me(i) || i.childNodes;
838
- if (W && P) {
839
- const N = W.length;
840
- for (let K = N - 1; K >= 0; --K) {
841
- const Q = S(W[K], !0);
842
- Q.__removalCount = (i.__removalCount || 0) + 1, P.insertBefore(Q, de(i));
846
+ if (Mt && !pe[b]) {
847
+ const O = J(i) || i.parentNode, q = ae(i) || i.childNodes;
848
+ if (q && O) {
849
+ const $ = q.length;
850
+ for (let ee = $ - 1; ee >= 0; --ee) {
851
+ const se = _(q[ee], !0);
852
+ se.__removalCount = (i.__removalCount || 0) + 1, O.insertBefore(se, te(i));
843
853
  }
844
854
  }
845
855
  }
846
- return re(i), !0;
856
+ return oe(i), !0;
847
857
  }
848
- return i instanceof c && !ks(i) || (x === "noscript" || x === "noembed" || x === "noframes") && q(/<\/no(script|embed|frames)/i, i.innerHTML) ? (re(i), !0) : (Se && i.nodeType === Ke.text && (u = i.textContent, Ve([ve, Me, ye], (P) => {
849
- u = Ne(u, P, " ");
850
- }), i.textContent !== u && (Ye(t.removed, {
858
+ return i instanceof c && !ks(i) || (b === "noscript" || b === "noembed" || b === "noframes") && Y(/<\/no(script|embed|frames)/i, i.innerHTML) ? (oe(i), !0) : (Se && i.nodeType === Je.text && (u = i.textContent, Ze([xe, Me, ye], (O) => {
859
+ u = Ne(u, O, " ");
860
+ }), i.textContent !== u && (Xe(t.removed, {
851
861
  element: i.cloneNode()
852
- }), i.textContent = u)), ge(U.afterSanitizeElements, i, null), !1);
853
- }, "_sanitizeElements"), Sn = /* @__PURE__ */ h(function(i, u, x) {
854
- if (Te[u] || dn && (u === "id" || u === "name") && (x in e || x in bs))
862
+ }), i.textContent = u)), me(G.afterSanitizeElements, i, null), !1);
863
+ }, "_sanitizeElements"), Sn = /* @__PURE__ */ h(function(i, u, b) {
864
+ if (B[u] || dn && (u === "id" || u === "name") && (b in e || b in bs))
855
865
  return !1;
856
- if (!(Rt && !Te[u] && q(At, u))) {
857
- if (!(un && q(Et, u))) {
858
- if (!(ee.attributeCheck instanceof Function && ee.attributeCheck(u, i))) {
859
- if (!k[u] || Te[u]) {
866
+ if (!(Te && !B[u] && Y(_t, u))) {
867
+ if (!(We && Y(lt, u))) {
868
+ if (!(V.attributeCheck instanceof Function && V.attributeCheck(u, i))) {
869
+ if (!v[u] || B[u]) {
860
870
  if (
861
871
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
862
872
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
863
873
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
864
- !(An(i) && (C.tagNameCheck instanceof RegExp && q(C.tagNameCheck, i) || C.tagNameCheck instanceof Function && C.tagNameCheck(i)) && (C.attributeNameCheck instanceof RegExp && q(C.attributeNameCheck, u) || C.attributeNameCheck instanceof Function && C.attributeNameCheck(u, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
874
+ !(An(i) && (x.tagNameCheck instanceof RegExp && Y(x.tagNameCheck, i) || x.tagNameCheck instanceof Function && x.tagNameCheck(i)) && (x.attributeNameCheck instanceof RegExp && Y(x.attributeNameCheck, u) || x.attributeNameCheck instanceof Function && x.attributeNameCheck(u, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
865
875
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
866
- u === "is" && C.allowCustomizedBuiltInElements && (C.tagNameCheck instanceof RegExp && q(C.tagNameCheck, x) || C.tagNameCheck instanceof Function && C.tagNameCheck(x)))
876
+ u === "is" && x.allowCustomizedBuiltInElements && (x.tagNameCheck instanceof RegExp && Y(x.tagNameCheck, b) || x.tagNameCheck instanceof Function && x.tagNameCheck(b)))
867
877
  ) return !1;
868
- } else if (!Lt[u]) {
869
- if (!q(Ge, Ne(x, at, ""))) {
870
- if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Ws(x, "data:") === 0 && gn[i])) {
871
- if (!(hn && !q(_t, Ne(x, at, "")))) {
872
- if (x)
878
+ } else if (!zt[u]) {
879
+ if (!Y(ct, Ne(b, ot, ""))) {
880
+ if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Ws(b, "data:") === 0 && gn[i])) {
881
+ if (!(hn && !Y(Rt, Ne(b, ot, "")))) {
882
+ if (b)
873
883
  return !1;
874
884
  }
875
885
  }
@@ -880,193 +890,193 @@ function ns() {
880
890
  }
881
891
  return !0;
882
892
  }, "_isValidAttribute"), An = /* @__PURE__ */ h(function(i) {
883
- return i !== "annotation-xml" && Gt(i, lt);
893
+ return i !== "annotation-xml" && Wt(i, Ct);
884
894
  }, "_isBasicCustomElement"), En = /* @__PURE__ */ h(function(i) {
885
- ge(U.beforeSanitizeAttributes, i, null);
895
+ me(G.beforeSanitizeAttributes, i, null);
886
896
  const {
887
897
  attributes: u
888
898
  } = i;
889
- if (!u || Nt(i))
899
+ if (!u || $t(i))
890
900
  return;
891
- const x = {
901
+ const b = {
892
902
  attrName: "",
893
903
  attrValue: "",
894
904
  keepAttr: !0,
895
- allowedAttributes: k,
905
+ allowedAttributes: v,
896
906
  forceKeepAttr: void 0
897
907
  };
898
- let P = u.length;
899
- for (; P--; ) {
900
- const W = u[P], {
901
- name: N,
902
- namespaceURI: K,
903
- value: Q
904
- } = W, xe = B(N), Ut = Q;
905
- let H = N === "value" ? Ut : js(Ut);
906
- if (x.attrName = xe, x.attrValue = H, x.keepAttr = !0, x.forceKeepAttr = void 0, ge(U.uponSanitizeAttribute, i, x), H = x.attrValue, fn && (xe === "id" || xe === "name") && (Ee(N, i), H = ds + H), We && q(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, H)) {
907
- Ee(N, i);
908
+ let O = u.length;
909
+ for (; O--; ) {
910
+ const q = u[O], {
911
+ name: $,
912
+ namespaceURI: ee,
913
+ value: se
914
+ } = q, be = F($), Bt = se;
915
+ let j = $ === "value" ? Bt : js(Bt);
916
+ if (b.attrName = be, b.attrValue = j, b.keepAttr = !0, b.forceKeepAttr = void 0, me(G.uponSanitizeAttribute, i, b), j = b.attrValue, fn && (be === "id" || be === "name") && (Ee($, i), j = ds + j), je && Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, j)) {
917
+ Ee($, i);
908
918
  continue;
909
919
  }
910
- if (xe === "attributename" && Gt(H, "href")) {
911
- Ee(N, i);
920
+ if (be === "attributename" && Wt(j, "href")) {
921
+ Ee($, i);
912
922
  continue;
913
923
  }
914
- if (x.forceKeepAttr)
924
+ if (b.forceKeepAttr)
915
925
  continue;
916
- if (!x.keepAttr) {
917
- Ee(N, i);
926
+ if (!b.keepAttr) {
927
+ Ee($, i);
918
928
  continue;
919
929
  }
920
- if (!pn && q(/\/>/i, H)) {
921
- Ee(N, i);
930
+ if (!pn && Y(/\/>/i, j)) {
931
+ Ee($, i);
922
932
  continue;
923
933
  }
924
- Se && Ve([ve, Me, ye], (Cn) => {
925
- H = Ne(H, Cn, " ");
934
+ Se && Ze([xe, Me, ye], (Cn) => {
935
+ j = Ne(j, Cn, " ");
926
936
  });
927
- const Rn = B(i.nodeName);
928
- if (!Sn(Rn, xe, H)) {
929
- Ee(N, i);
937
+ const Rn = F(i.nodeName);
938
+ if (!Sn(Rn, be, j)) {
939
+ Ee($, i);
930
940
  continue;
931
941
  }
932
- if ($ && typeof m == "object" && typeof m.getAttributeType == "function" && !K)
933
- switch (m.getAttributeType(Rn, xe)) {
942
+ if (P && typeof m == "object" && typeof m.getAttributeType == "function" && !ee)
943
+ switch (m.getAttributeType(Rn, be)) {
934
944
  case "TrustedHTML": {
935
- H = $.createHTML(H);
945
+ j = P.createHTML(j);
936
946
  break;
937
947
  }
938
948
  case "TrustedScriptURL": {
939
- H = $.createScriptURL(H);
949
+ j = P.createScriptURL(j);
940
950
  break;
941
951
  }
942
952
  }
943
- if (H !== Ut)
953
+ if (j !== Bt)
944
954
  try {
945
- K ? i.setAttributeNS(K, N, H) : i.setAttribute(N, H), Nt(i) ? re(i) : Pn(t.removed);
955
+ ee ? i.setAttributeNS(ee, $, j) : i.setAttribute($, j), $t(i) ? oe(i) : Pn(t.removed);
946
956
  } catch {
947
- Ee(N, i);
957
+ Ee($, i);
948
958
  }
949
959
  }
950
- ge(U.afterSanitizeAttributes, i, null);
960
+ me(G.afterSanitizeAttributes, i, null);
951
961
  }, "_sanitizeAttributes"), _n = /* @__PURE__ */ h(function(i) {
952
962
  let u = null;
953
- const x = yn(i);
954
- for (ge(U.beforeSanitizeShadowDOM, i, null); u = x.nextNode(); )
955
- ge(U.uponSanitizeShadowNode, u, null), Tn(u), En(u), u.content instanceof r && _n(u.content);
956
- ge(U.afterSanitizeShadowDOM, i, null);
963
+ const b = yn(i);
964
+ for (me(G.beforeSanitizeShadowDOM, i, null); u = b.nextNode(); )
965
+ me(G.uponSanitizeShadowNode, u, null), Tn(u), En(u), u.content instanceof r && _n(u.content);
966
+ me(G.afterSanitizeShadowDOM, i, null);
957
967
  }, "_sanitizeShadowDOM");
958
- return t.sanitize = function(v) {
959
- let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, x = null, P = null, W = null;
960
- if (zt = !v, zt && (v = "<!-->"), typeof v != "string" && !$t(v))
961
- if (typeof v.toString == "function") {
962
- if (v = v.toString(), typeof v != "string")
963
- throw Ze("dirty is not a string, aborting");
968
+ return t.sanitize = function(y) {
969
+ let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, b = null, O = null, q = null;
970
+ if (Ot = !y, Ot && (y = "<!-->"), typeof y != "string" && !Ut(y))
971
+ if (typeof y.toString == "function") {
972
+ if (y = y.toString(), typeof y != "string")
973
+ throw Ke("dirty is not a string, aborting");
964
974
  } else
965
- throw Ze("toString is not a function");
975
+ throw Ke("toString is not a function");
966
976
  if (!t.isSupported)
967
- return v;
968
- if (Ct || Pt(i), t.removed = [], typeof v == "string" && (je = !1), je) {
969
- if (v.nodeName) {
970
- const Q = B(v.nodeName);
971
- if (!b[Q] || J[Q])
972
- throw Ze("root node is forbidden and cannot be sanitized in-place");
973
- }
974
- } else if (v instanceof o)
975
- u = vn("<!---->"), x = u.ownerDocument.importNode(v, !0), x.nodeType === Ke.element && x.nodeName === "BODY" || x.nodeName === "HTML" ? u = x : u.appendChild(x);
977
+ return y;
978
+ if (It || Nt(i), t.removed = [], typeof y == "string" && (qe = !1), qe) {
979
+ if (y.nodeName) {
980
+ const se = F(y.nodeName);
981
+ if (!N[se] || L[se])
982
+ throw Ke("root node is forbidden and cannot be sanitized in-place");
983
+ }
984
+ } else if (y instanceof o)
985
+ u = vn("<!---->"), b = u.ownerDocument.importNode(y, !0), b.nodeType === Je.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? u = b : u.appendChild(b);
976
986
  else {
977
987
  if (!Le && !Se && !Ae && // eslint-disable-next-line unicorn/prefer-includes
978
- v.indexOf("<") === -1)
979
- return $ && ct ? $.createHTML(v) : v;
980
- if (u = vn(v), !u)
981
- return Le ? null : ct ? j : "";
982
- }
983
- u && Dt && re(u.firstChild);
984
- const N = yn(je ? v : u);
985
- for (; P = N.nextNode(); )
986
- Tn(P), En(P), P.content instanceof r && _n(P.content);
987
- if (je)
988
- return v;
988
+ y.indexOf("<") === -1)
989
+ return P && ht ? P.createHTML(y) : y;
990
+ if (u = vn(y), !u)
991
+ return Le ? null : ht ? W : "";
992
+ }
993
+ u && Dt && oe(u.firstChild);
994
+ const $ = yn(qe ? y : u);
995
+ for (; O = $.nextNode(); )
996
+ Tn(O), En(O), O.content instanceof r && _n(O.content);
997
+ if (qe)
998
+ return y;
989
999
  if (Le) {
990
1000
  if (Se) {
991
1001
  u.normalize();
992
- let Q = u.innerHTML;
993
- Ve([ve, Me, ye], (xe) => {
994
- Q = Ne(Q, xe, " ");
995
- }), u.innerHTML = Q;
996
- }
997
- if (ot)
998
- for (W = rt.call(u.ownerDocument); u.firstChild; )
999
- W.appendChild(u.firstChild);
1002
+ let se = u.innerHTML;
1003
+ Ze([xe, Me, ye], (be) => {
1004
+ se = Ne(se, be, " ");
1005
+ }), u.innerHTML = se;
1006
+ }
1007
+ if (ut)
1008
+ for (q = Et.call(u.ownerDocument); u.firstChild; )
1009
+ q.appendChild(u.firstChild);
1000
1010
  else
1001
- W = u;
1002
- return (k.shadowroot || k.shadowrootmode) && (W = it.call(n, W, !0)), W;
1003
- }
1004
- let K = Ae ? u.outerHTML : u.innerHTML;
1005
- return Ae && b["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && q(ts, u.ownerDocument.doctype.name) && (K = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1006
- ` + K), Se && Ve([ve, Me, ye], (Q) => {
1007
- K = Ne(K, Q, " ");
1008
- }), $ && ct ? $.createHTML(K) : K;
1011
+ q = u;
1012
+ return (v.shadowroot || v.shadowrootmode) && (q = I.call(n, q, !0)), q;
1013
+ }
1014
+ let ee = Ae ? u.outerHTML : u.innerHTML;
1015
+ return Ae && N["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && Y(ts, u.ownerDocument.doctype.name) && (ee = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1016
+ ` + ee), Se && Ze([xe, Me, ye], (se) => {
1017
+ ee = Ne(ee, se, " ");
1018
+ }), P && ht ? P.createHTML(ee) : ee;
1009
1019
  }, t.setConfig = function() {
1010
- let v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1011
- Pt(v), Ct = !0;
1020
+ let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1021
+ Nt(y), It = !0;
1012
1022
  }, t.clearConfig = function() {
1013
- Pe = null, Ct = !1;
1014
- }, t.isValidAttribute = function(v, i, u) {
1015
- Pe || Pt({});
1016
- const x = B(v), P = B(i);
1017
- return Sn(x, P, u);
1018
- }, t.addHook = function(v, i) {
1019
- typeof i == "function" && Ye(U[v], i);
1020
- }, t.removeHook = function(v, i) {
1023
+ Pe = null, It = !1;
1024
+ }, t.isValidAttribute = function(y, i, u) {
1025
+ Pe || Nt({});
1026
+ const b = F(y), O = F(i);
1027
+ return Sn(b, O, u);
1028
+ }, t.addHook = function(y, i) {
1029
+ typeof i == "function" && Xe(G[y], i);
1030
+ }, t.removeHook = function(y, i) {
1021
1031
  if (i !== void 0) {
1022
- const u = Hs(U[v], i);
1023
- return u === -1 ? void 0 : Gs(U[v], u, 1)[0];
1032
+ const u = Hs(G[y], i);
1033
+ return u === -1 ? void 0 : Gs(G[y], u, 1)[0];
1024
1034
  }
1025
- return Pn(U[v]);
1026
- }, t.removeHooks = function(v) {
1027
- U[v] = [];
1035
+ return Pn(G[y]);
1036
+ }, t.removeHooks = function(y) {
1037
+ G[y] = [];
1028
1038
  }, t.removeAllHooks = function() {
1029
- U = Hn();
1039
+ G = Hn();
1030
1040
  }, t;
1031
1041
  }
1032
1042
  h(ns, "createDOMPurify");
1033
1043
  var ar = ns();
1034
- function Jt() {
1044
+ function en() {
1035
1045
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1036
1046
  }
1037
- h(Jt, "M");
1038
- var Ie = Jt();
1047
+ h(en, "M");
1048
+ var De = en();
1039
1049
  function ss(l) {
1040
- Ie = l;
1050
+ De = l;
1041
1051
  }
1042
1052
  h(ss, "G");
1043
1053
  var Re = { exec: /* @__PURE__ */ h(() => null, "exec") };
1044
- function I(l, t = "") {
1054
+ function D(l, t = "") {
1045
1055
  let e = typeof l == "string" ? l : l.source, n = { replace: /* @__PURE__ */ h((s, r) => {
1046
1056
  let a = typeof r == "string" ? r : r.source;
1047
- return a = a.replace(Y.caret, "$1"), e = e.replace(s, a), n;
1057
+ return a = a.replace(X.caret, "$1"), e = e.replace(s, a), n;
1048
1058
  }, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
1049
1059
  return n;
1050
1060
  }
1051
- h(I, "k");
1061
+ h(D, "k");
1052
1062
  var lr = (() => {
1053
1063
  try {
1054
1064
  return !!new RegExp("(?<=1)(?<!1)");
1055
1065
  } catch {
1056
1066
  return !1;
1057
1067
  }
1058
- })(), Y = { 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((l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}>`), "blockquoteBeginRegex") }, or = /^(?:[ \t]*(?:\n|$))+/, cr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ur = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, st = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, hr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, en = / {0,3}(?:[*+-]|\d{1,9}[.)])/, rs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, is = I(rs).replace(/bull/g, en).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(), pr = I(rs).replace(/bull/g, en).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(), tn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, dr = /^[^\n]+/, nn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, fr = I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", nn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), gr = I(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, en).getRegex(), Tt = "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", sn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, mr = I("^ {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", sn).replace("tag", Tt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), as = I(tn).replace("hr", st).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]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Tt).getRegex(), xr = I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", as).getRegex(), rn = { blockquote: xr, code: cr, def: fr, fences: ur, heading: hr, hr: st, html: mr, lheading: is, list: gr, newline: or, paragraph: as, table: Re, text: dr }, Gn = I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", st).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", Tt).getRegex(), br = { ...rn, lheading: pr, table: Gn, paragraph: I(tn).replace("hr", st).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Gn).replace("blockquote", " {0,3}>").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", Tt).getRegex() }, kr = { ...rn, html: I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", sn).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: Re, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: I(tn).replace("hr", st).replace("heading", ` *#{1,6} *[^
1059
- ]`).replace("lheading", is).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, vr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ls = /^( {2,}|\\)\n(?!\s*$)/, yr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, He = /[\p{P}\p{S}]/u, St = /[\s\p{P}\p{S}]/u, an = /[^\s\p{P}\p{S}]/u, Tr = I(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, St).getRegex(), os = /(?!~)[\p{P}\p{S}]/u, Sr = /(?!~)[\s\p{P}\p{S}]/u, Ar = /(?:[^\s\p{P}\p{S}]|~)/u, Er = I(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", lr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), cs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, _r = I(cs, "u").replace(/punct/g, He).getRegex(), Rr = I(cs, "u").replace(/punct/g, os).getRegex(), us = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Cr = I(us, "gu").replace(/notPunctSpace/g, an).replace(/punctSpace/g, St).replace(/punct/g, He).getRegex(), Dr = I(us, "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, Sr).replace(/punct/g, os).getRegex(), Ir = I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, an).replace(/punctSpace/g, St).replace(/punct/g, He).getRegex(), Mr = I(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, He).getRegex(), Lr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", zr = I(Lr, "gu").replace(/notPunctSpace/g, an).replace(/punctSpace/g, St).replace(/punct/g, He).getRegex(), Or = I(/\\(punct)/, "gu").replace(/punct/g, He).getRegex(), Pr = I(/^<(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(), Nr = I(sn).replace("(?:-->|$)", "-->").getRegex(), $r = I("^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", Nr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), wt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Ur = I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", wt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), hs = I(/^!?\[(label)\]\[(ref)\]/).replace("label", wt).replace("ref", nn).getRegex(), ps = I(/^!?\[(ref)\](?:\[\])?/).replace("ref", nn).getRegex(), Br = I("reflink|nolink(?!\\()", "g").replace("reflink", hs).replace("nolink", ps).getRegex(), Wn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, ln = { _backpedal: Re, anyPunctuation: Or, autolink: Pr, blockSkip: Er, br: ls, code: vr, del: Re, delLDelim: Re, delRDelim: Re, emStrongLDelim: _r, emStrongRDelimAst: Cr, emStrongRDelimUnd: Ir, escape: wr, link: Ur, nolink: ps, punctuation: Tr, reflink: hs, reflinkSearch: Br, tag: $r, text: yr, url: Re }, Fr = { ...ln, link: I(/^!?\[(label)\]\((.*?)\)/).replace("label", wt).getRegex(), reflink: I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", wt).getRegex() }, Kt = { ...ln, emStrongRDelimAst: Dr, emStrongLDelim: Rr, delLDelim: Mr, delRDelim: zr, url: I(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Wn).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: I(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Wn).getRegex() }, Hr = { ...Kt, br: I(ls).replace("{2,}", "*").getRegex(), text: I(Kt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, mt = { normal: rn, gfm: br, pedantic: kr }, Qe = { normal: ln, gfm: Kt, breaks: Hr, pedantic: Fr }, Gr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, jn = /* @__PURE__ */ h((l) => Gr[l], "ke");
1060
- function he(l, t) {
1068
+ })(), X = { 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((l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}>`), "blockquoteBeginRegex") }, or = /^(?:[ \t]*(?:\n|$))+/, cr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ur = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, it = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, hr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, tn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, rs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, is = D(rs).replace(/bull/g, tn).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(), pr = D(rs).replace(/bull/g, tn).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(), nn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, dr = /^[^\n]+/, sn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, fr = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", sn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), gr = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, tn).getRegex(), St = "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", rn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, mr = D("^ {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", rn).replace("tag", St).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), as = D(nn).replace("hr", it).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]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", St).getRegex(), xr = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", as).getRegex(), an = { blockquote: xr, code: cr, def: fr, fences: ur, heading: hr, hr: it, html: mr, lheading: is, list: gr, newline: or, paragraph: as, table: Re, text: dr }, Gn = D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", it).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", St).getRegex(), br = { ...an, lheading: pr, table: Gn, paragraph: D(nn).replace("hr", it).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Gn).replace("blockquote", " {0,3}>").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", St).getRegex() }, kr = { ...an, html: D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", rn).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: Re, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(nn).replace("hr", it).replace("heading", ` *#{1,6} *[^
1069
+ ]`).replace("lheading", is).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, vr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ls = /^( {2,}|\\)\n(?!\s*$)/, yr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, He = /[\p{P}\p{S}]/u, At = /[\s\p{P}\p{S}]/u, ln = /[^\s\p{P}\p{S}]/u, Tr = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, At).getRegex(), os = /(?!~)[\p{P}\p{S}]/u, Sr = /(?!~)[\s\p{P}\p{S}]/u, Ar = /(?:[^\s\p{P}\p{S}]|~)/u, Er = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", lr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), cs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, _r = D(cs, "u").replace(/punct/g, He).getRegex(), Rr = D(cs, "u").replace(/punct/g, os).getRegex(), us = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Cr = D(us, "gu").replace(/notPunctSpace/g, ln).replace(/punctSpace/g, At).replace(/punct/g, He).getRegex(), Ir = D(us, "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, Sr).replace(/punct/g, os).getRegex(), Dr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ln).replace(/punctSpace/g, At).replace(/punct/g, He).getRegex(), Mr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, He).getRegex(), Lr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", zr = D(Lr, "gu").replace(/notPunctSpace/g, ln).replace(/punctSpace/g, At).replace(/punct/g, He).getRegex(), Or = D(/\\(punct)/, "gu").replace(/punct/g, He).getRegex(), Pr = D(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Nr = D(rn).replace("(?:-->|$)", "-->").getRegex(), $r = D("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Nr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), vt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Ur = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", vt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), hs = D(/^!?\[(label)\]\[(ref)\]/).replace("label", vt).replace("ref", sn).getRegex(), ps = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", sn).getRegex(), Br = D("reflink|nolink(?!\\()", "g").replace("reflink", hs).replace("nolink", ps).getRegex(), Wn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, on = { _backpedal: Re, anyPunctuation: Or, autolink: Pr, blockSkip: Er, br: ls, code: vr, del: Re, delLDelim: Re, delRDelim: Re, emStrongLDelim: _r, emStrongRDelimAst: Cr, emStrongRDelimUnd: Dr, escape: wr, link: Ur, nolink: ps, punctuation: Tr, reflink: hs, reflinkSearch: Br, tag: $r, text: yr, url: Re }, Fr = { ...on, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", vt).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", vt).getRegex() }, Qt = { ...on, emStrongRDelimAst: Ir, emStrongLDelim: Rr, delLDelim: Mr, delRDelim: zr, url: D(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Wn).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: D(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Wn).getRegex() }, Hr = { ...Qt, br: D(ls).replace("{2,}", "*").getRegex(), text: D(Qt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, xt = { normal: an, gfm: br, pedantic: kr }, et = { normal: on, gfm: Qt, breaks: Hr, pedantic: Fr }, Gr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, jn = /* @__PURE__ */ h((l) => Gr[l], "ke");
1070
+ function ge(l, t) {
1061
1071
  if (t) {
1062
- if (Y.escapeTest.test(l)) return l.replace(Y.escapeReplace, jn);
1063
- } else if (Y.escapeTestNoEncode.test(l)) return l.replace(Y.escapeReplaceNoEncode, jn);
1072
+ if (X.escapeTest.test(l)) return l.replace(X.escapeReplace, jn);
1073
+ } else if (X.escapeTestNoEncode.test(l)) return l.replace(X.escapeReplaceNoEncode, jn);
1064
1074
  return l;
1065
1075
  }
1066
- h(he, "T");
1076
+ h(ge, "T");
1067
1077
  function qn(l) {
1068
1078
  try {
1069
- l = encodeURI(l).replace(Y.percentDecode, "%");
1079
+ l = encodeURI(l).replace(X.percentDecode, "%");
1070
1080
  } catch {
1071
1081
  return null;
1072
1082
  }
@@ -1074,18 +1084,18 @@ function qn(l) {
1074
1084
  }
1075
1085
  h(qn, "J");
1076
1086
  function Vn(l, t) {
1077
- let e = l.replace(Y.findPipe, (r, a, o) => {
1078
- let c = !1, d = a;
1079
- for (; --d >= 0 && o[d] === "\\"; ) c = !c;
1087
+ let e = l.replace(X.findPipe, (r, a, o) => {
1088
+ let c = !1, f = a;
1089
+ for (; --f >= 0 && o[f] === "\\"; ) c = !c;
1080
1090
  return c ? "|" : " |";
1081
- }), n = e.split(Y.splitPipe), s = 0;
1091
+ }), n = e.split(X.splitPipe), s = 0;
1082
1092
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1083
1093
  else for (; n.length < t; ) n.push("");
1084
- for (; s < n.length; s++) n[s] = n[s].trim().replace(Y.slashPipe, "|");
1094
+ for (; s < n.length; s++) n[s] = n[s].trim().replace(X.slashPipe, "|");
1085
1095
  return n;
1086
1096
  }
1087
1097
  h(Vn, "V");
1088
- function Je(l, t, e) {
1098
+ function tt(l, t, e) {
1089
1099
  let n = l.length;
1090
1100
  if (n === 0) return "";
1091
1101
  let s = 0;
@@ -1093,7 +1103,7 @@ function Je(l, t, e) {
1093
1103
  s++;
1094
1104
  return l.slice(0, n - s);
1095
1105
  }
1096
- h(Je, "I");
1106
+ h(tt, "I");
1097
1107
  function Wr(l, t) {
1098
1108
  if (l.indexOf(t[1]) === -1) return -1;
1099
1109
  let e = 0;
@@ -1133,12 +1143,12 @@ function qr(l, t, e) {
1133
1143
  `);
1134
1144
  }
1135
1145
  h(qr, "nt");
1136
- var $e, vt = ($e = class {
1146
+ var $e, yt = ($e = class {
1137
1147
  constructor(t) {
1138
- D(this, "options");
1139
- D(this, "rules");
1140
- D(this, "lexer");
1141
- this.options = t || Ie;
1148
+ C(this, "options");
1149
+ C(this, "rules");
1150
+ C(this, "lexer");
1151
+ this.options = t || De;
1142
1152
  }
1143
1153
  space(t) {
1144
1154
  let e = this.rules.block.newline.exec(t);
@@ -1148,7 +1158,7 @@ var $e, vt = ($e = class {
1148
1158
  let e = this.rules.block.code.exec(t);
1149
1159
  if (e) {
1150
1160
  let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
1151
- return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : Je(n, `
1161
+ return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : tt(n, `
1152
1162
  `) };
1153
1163
  }
1154
1164
  }
@@ -1164,7 +1174,7 @@ var $e, vt = ($e = class {
1164
1174
  if (e) {
1165
1175
  let n = e[2].trim();
1166
1176
  if (this.rules.other.endingHash.test(n)) {
1167
- let s = Je(n, "#");
1177
+ let s = tt(n, "#");
1168
1178
  (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim());
1169
1179
  }
1170
1180
  return { type: "heading", raw: e[0], depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
@@ -1172,42 +1182,42 @@ var $e, vt = ($e = class {
1172
1182
  }
1173
1183
  hr(t) {
1174
1184
  let e = this.rules.block.hr.exec(t);
1175
- if (e) return { type: "hr", raw: Je(e[0], `
1185
+ if (e) return { type: "hr", raw: tt(e[0], `
1176
1186
  `) };
1177
1187
  }
1178
1188
  blockquote(t) {
1179
1189
  let e = this.rules.block.blockquote.exec(t);
1180
1190
  if (e) {
1181
- let n = Je(e[0], `
1191
+ let n = tt(e[0], `
1182
1192
  `).split(`
1183
1193
  `), s = "", r = "", a = [];
1184
1194
  for (; n.length > 0; ) {
1185
- let o = !1, c = [], d;
1186
- for (d = 0; d < n.length; d++) if (this.rules.other.blockquoteStart.test(n[d])) c.push(n[d]), o = !0;
1187
- else if (!o) c.push(n[d]);
1195
+ let o = !1, c = [], f;
1196
+ for (f = 0; f < n.length; f++) if (this.rules.other.blockquoteStart.test(n[f])) c.push(n[f]), o = !0;
1197
+ else if (!o) c.push(n[f]);
1188
1198
  else break;
1189
- n = n.slice(d);
1199
+ n = n.slice(f);
1190
1200
  let g = c.join(`
1191
- `), p = g.replace(this.rules.other.blockquoteSetextReplace, `
1201
+ `), d = g.replace(this.rules.other.blockquoteSetextReplace, `
1192
1202
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1193
1203
  s = s ? `${s}
1194
1204
  ${g}` : g, r = r ? `${r}
1195
- ${p}` : p;
1196
- let f = this.lexer.state.top;
1197
- if (this.lexer.state.top = !0, this.lexer.blockTokens(p, a, !0), this.lexer.state.top = f, n.length === 0) break;
1205
+ ${d}` : d;
1206
+ let p = this.lexer.state.top;
1207
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(d, a, !0), this.lexer.state.top = p, n.length === 0) break;
1198
1208
  let m = a.at(-1);
1199
1209
  if (m?.type === "code") break;
1200
1210
  if (m?.type === "blockquote") {
1201
- let y = m, S = y.raw + `
1211
+ let T = m, _ = T.raw + `
1202
1212
  ` + n.join(`
1203
- `), z = this.blockquote(S);
1204
- a[a.length - 1] = z, s = s.substring(0, s.length - y.raw.length) + z.raw, r = r.substring(0, r.length - y.text.length) + z.text;
1213
+ `), z = this.blockquote(_);
1214
+ a[a.length - 1] = z, s = s.substring(0, s.length - T.raw.length) + z.raw, r = r.substring(0, r.length - T.text.length) + z.text;
1205
1215
  break;
1206
1216
  } else if (m?.type === "list") {
1207
- let y = m, S = y.raw + `
1217
+ let T = m, _ = T.raw + `
1208
1218
  ` + n.join(`
1209
- `), z = this.list(S);
1210
- a[a.length - 1] = z, s = s.substring(0, s.length - m.raw.length) + z.raw, r = r.substring(0, r.length - y.raw.length) + z.raw, n = S.substring(a.at(-1).raw.length).split(`
1219
+ `), z = this.list(_);
1220
+ a[a.length - 1] = z, s = s.substring(0, s.length - m.raw.length) + z.raw, r = r.substring(0, r.length - T.raw.length) + z.raw, n = _.substring(a.at(-1).raw.length).split(`
1211
1221
  `);
1212
1222
  continue;
1213
1223
  }
@@ -1222,59 +1232,59 @@ ${p}` : p;
1222
1232
  n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
1223
1233
  let a = this.rules.other.listItemRegex(n), o = !1;
1224
1234
  for (; t; ) {
1225
- let d = !1, g = "", p = "";
1235
+ let f = !1, g = "", d = "";
1226
1236
  if (!(e = a.exec(t)) || this.rules.block.hr.test(t)) break;
1227
1237
  g = e[0], t = t.substring(g.length);
1228
- let f = jr(e[2].split(`
1238
+ let p = jr(e[2].split(`
1229
1239
  `, 1)[0], e[1].length), m = t.split(`
1230
- `, 1)[0], y = !f.trim(), S = 0;
1231
- if (this.options.pedantic ? (S = 2, p = f.trimStart()) : y ? S = e[1].length + 1 : (S = f.search(this.rules.other.nonSpaceChar), S = S > 4 ? 1 : S, p = f.slice(S), S += e[1].length), y && this.rules.other.blankLine.test(m) && (g += m + `
1232
- `, t = t.substring(m.length + 1), d = !0), !d) {
1233
- let z = this.rules.other.nextBulletRegex(S), de = this.rules.other.hrRegex(S), me = this.rules.other.fencesBeginRegex(S), ne = this.rules.other.headingBeginRegex(S), $ = this.rules.other.htmlBeginRegex(S), j = this.rules.other.blockquoteBeginRegex(S);
1240
+ `, 1)[0], T = !p.trim(), _ = 0;
1241
+ if (this.options.pedantic ? (_ = 2, d = p.trimStart()) : T ? _ = e[1].length + 1 : (_ = p.search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, d = p.slice(_), _ += e[1].length), T && this.rules.other.blankLine.test(m) && (g += m + `
1242
+ `, t = t.substring(m.length + 1), f = !0), !f) {
1243
+ let z = this.rules.other.nextBulletRegex(_), te = this.rules.other.hrRegex(_), ae = this.rules.other.fencesBeginRegex(_), J = this.rules.other.headingBeginRegex(_), P = this.rules.other.htmlBeginRegex(_), W = this.rules.other.blockquoteBeginRegex(_);
1234
1244
  for (; t; ) {
1235
- let se = t.split(`
1236
- `, 1)[0], fe;
1237
- if (m = se, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), fe = m) : fe = m.replace(this.rules.other.tabCharGlobal, " "), me.test(m) || ne.test(m) || $.test(m) || j.test(m) || z.test(m) || de.test(m)) break;
1238
- if (fe.search(this.rules.other.nonSpaceChar) >= S || !m.trim()) p += `
1239
- ` + fe.slice(S);
1245
+ let le = t.split(`
1246
+ `, 1)[0], ne;
1247
+ if (m = le, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), ne = m) : ne = m.replace(this.rules.other.tabCharGlobal, " "), ae.test(m) || J.test(m) || P.test(m) || W.test(m) || z.test(m) || te.test(m)) break;
1248
+ if (ne.search(this.rules.other.nonSpaceChar) >= _ || !m.trim()) d += `
1249
+ ` + ne.slice(_);
1240
1250
  else {
1241
- if (y || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || me.test(f) || ne.test(f) || de.test(f)) break;
1242
- p += `
1251
+ if (T || p.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ae.test(p) || J.test(p) || te.test(p)) break;
1252
+ d += `
1243
1253
  ` + m;
1244
1254
  }
1245
- y = !m.trim(), g += se + `
1246
- `, t = t.substring(se.length + 1), f = fe.slice(S);
1255
+ T = !m.trim(), g += le + `
1256
+ `, t = t.substring(le.length + 1), p = ne.slice(_);
1247
1257
  }
1248
1258
  }
1249
- r.loose || (o ? r.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (o = !0)), r.items.push({ type: "list_item", raw: g, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: !1, text: p, tokens: [] }), r.raw += g;
1259
+ r.loose || (o ? r.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (o = !0)), r.items.push({ type: "list_item", raw: g, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: !1, text: d, tokens: [] }), r.raw += g;
1250
1260
  }
1251
1261
  let c = r.items.at(-1);
1252
1262
  if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
1253
1263
  else return;
1254
1264
  r.raw = r.raw.trimEnd();
1255
- for (let d of r.items) {
1256
- if (this.lexer.state.top = !1, d.tokens = this.lexer.blockTokens(d.text, []), d.task) {
1257
- if (d.text = d.text.replace(this.rules.other.listReplaceTask, ""), d.tokens[0]?.type === "text" || d.tokens[0]?.type === "paragraph") {
1258
- d.tokens[0].raw = d.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), d.tokens[0].text = d.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
1259
- for (let p = this.lexer.inlineQueue.length - 1; p >= 0; p--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)) {
1260
- this.lexer.inlineQueue[p].src = this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask, "");
1265
+ for (let f of r.items) {
1266
+ if (this.lexer.state.top = !1, f.tokens = this.lexer.blockTokens(f.text, []), f.task) {
1267
+ if (f.text = f.text.replace(this.rules.other.listReplaceTask, ""), f.tokens[0]?.type === "text" || f.tokens[0]?.type === "paragraph") {
1268
+ f.tokens[0].raw = f.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), f.tokens[0].text = f.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
1269
+ for (let d = this.lexer.inlineQueue.length - 1; d >= 0; d--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)) {
1270
+ this.lexer.inlineQueue[d].src = this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask, "");
1261
1271
  break;
1262
1272
  }
1263
1273
  }
1264
- let g = this.rules.other.listTaskCheckbox.exec(d.raw);
1274
+ let g = this.rules.other.listTaskCheckbox.exec(f.raw);
1265
1275
  if (g) {
1266
- let p = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
1267
- d.checked = p.checked, r.loose ? d.tokens[0] && ["paragraph", "text"].includes(d.tokens[0].type) && "tokens" in d.tokens[0] && d.tokens[0].tokens ? (d.tokens[0].raw = p.raw + d.tokens[0].raw, d.tokens[0].text = p.raw + d.tokens[0].text, d.tokens[0].tokens.unshift(p)) : d.tokens.unshift({ type: "paragraph", raw: p.raw, text: p.raw, tokens: [p] }) : d.tokens.unshift(p);
1276
+ let d = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
1277
+ f.checked = d.checked, r.loose ? f.tokens[0] && ["paragraph", "text"].includes(f.tokens[0].type) && "tokens" in f.tokens[0] && f.tokens[0].tokens ? (f.tokens[0].raw = d.raw + f.tokens[0].raw, f.tokens[0].text = d.raw + f.tokens[0].text, f.tokens[0].tokens.unshift(d)) : f.tokens.unshift({ type: "paragraph", raw: d.raw, text: d.raw, tokens: [d] }) : f.tokens.unshift(d);
1268
1278
  }
1269
1279
  }
1270
1280
  if (!r.loose) {
1271
- let g = d.tokens.filter((f) => f.type === "space"), p = g.length > 0 && g.some((f) => this.rules.other.anyLine.test(f.raw));
1272
- r.loose = p;
1281
+ let g = f.tokens.filter((p) => p.type === "space"), d = g.length > 0 && g.some((p) => this.rules.other.anyLine.test(p.raw));
1282
+ r.loose = d;
1273
1283
  }
1274
1284
  }
1275
- if (r.loose) for (let d of r.items) {
1276
- d.loose = !0;
1277
- for (let g of d.tokens) g.type === "text" && (g.type = "paragraph");
1285
+ if (r.loose) for (let f of r.items) {
1286
+ f.loose = !0;
1287
+ for (let g of f.tokens) g.type === "text" && (g.type = "paragraph");
1278
1288
  }
1279
1289
  return r;
1280
1290
  }
@@ -1298,7 +1308,7 @@ ${p}` : p;
1298
1308
  if (n.length === s.length) {
1299
1309
  for (let o of s) this.rules.other.tableAlignRight.test(o) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? a.align.push("left") : a.align.push(null);
1300
1310
  for (let o = 0; o < n.length; o++) a.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: a.align[o] });
1301
- for (let o of r) a.rows.push(Vn(o, a.header.length).map((c, d) => ({ text: c, tokens: this.lexer.inline(c), header: !1, align: a.align[d] })));
1311
+ for (let o of r) a.rows.push(Vn(o, a.header.length).map((c, f) => ({ text: c, tokens: this.lexer.inline(c), header: !1, align: a.align[f] })));
1302
1312
  return a;
1303
1313
  }
1304
1314
  }
@@ -1335,7 +1345,7 @@ ${p}` : p;
1335
1345
  let n = e[2].trim();
1336
1346
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
1337
1347
  if (!this.rules.other.endAngleBracket.test(n)) return;
1338
- let a = Je(n.slice(0, -1), "\\");
1348
+ let a = tt(n.slice(0, -1), "\\");
1339
1349
  if ((n.length - a.length) % 2 === 0) return;
1340
1350
  } else {
1341
1351
  let a = Wr(e[2], "()");
@@ -1367,25 +1377,25 @@ ${p}` : p;
1367
1377
  emStrong(t, e, n = "") {
1368
1378
  let s = this.rules.inline.emStrongLDelim.exec(t);
1369
1379
  if (!(!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1370
- let r = [...s[0]].length - 1, a, o, c = r, d = 0, g = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1380
+ let r = [...s[0]].length - 1, a, o, c = r, f = 0, g = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1371
1381
  for (g.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = g.exec(e)) !== null; ) {
1372
1382
  if (a = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !a) continue;
1373
1383
  if (o = [...a].length, s[3] || s[4]) {
1374
1384
  c += o;
1375
1385
  continue;
1376
1386
  } else if ((s[5] || s[6]) && r % 3 && !((r + o) % 3)) {
1377
- d += o;
1387
+ f += o;
1378
1388
  continue;
1379
1389
  }
1380
1390
  if (c -= o, c > 0) continue;
1381
- o = Math.min(o, o + c + d);
1382
- let p = [...s[0]][0].length, f = t.slice(0, r + s.index + p + o);
1391
+ o = Math.min(o, o + c + f);
1392
+ let d = [...s[0]][0].length, p = t.slice(0, r + s.index + d + o);
1383
1393
  if (Math.min(r, o) % 2) {
1384
- let y = f.slice(1, -1);
1385
- return { type: "em", raw: f, text: y, tokens: this.lexer.inlineTokens(y) };
1394
+ let T = p.slice(1, -1);
1395
+ return { type: "em", raw: p, text: T, tokens: this.lexer.inlineTokens(T) };
1386
1396
  }
1387
- let m = f.slice(2, -2);
1388
- return { type: "strong", raw: f, text: m, tokens: this.lexer.inlineTokens(m) };
1397
+ let m = p.slice(2, -2);
1398
+ return { type: "strong", raw: p, text: m, tokens: this.lexer.inlineTokens(m) };
1389
1399
  }
1390
1400
  }
1391
1401
  }
@@ -1403,8 +1413,8 @@ ${p}` : p;
1403
1413
  del(t, e, n = "") {
1404
1414
  let s = this.rules.inline.delLDelim.exec(t);
1405
1415
  if (s && (!s[1] || !n || this.rules.inline.punctuation.exec(n))) {
1406
- let r = [...s[0]].length - 1, a, o, c = r, d = this.rules.inline.delRDelim;
1407
- for (d.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = d.exec(e)) !== null; ) {
1416
+ let r = [...s[0]].length - 1, a, o, c = r, f = this.rules.inline.delRDelim;
1417
+ for (f.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = f.exec(e)) !== null; ) {
1408
1418
  if (a = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !a || (o = [...a].length, o !== r)) continue;
1409
1419
  if (s[3] || s[4]) {
1410
1420
  c += o;
@@ -1412,8 +1422,8 @@ ${p}` : p;
1412
1422
  }
1413
1423
  if (c -= o, c > 0) continue;
1414
1424
  o = Math.min(o, o + c);
1415
- let g = [...s[0]][0].length, p = t.slice(0, r + s.index + g + o), f = p.slice(r, -r);
1416
- return { type: "del", raw: p, text: f, tokens: this.lexer.inlineTokens(f) };
1425
+ let g = [...s[0]][0].length, d = t.slice(0, r + s.index + g + o), p = d.slice(r, -r);
1426
+ return { type: "del", raw: d, text: p, tokens: this.lexer.inlineTokens(p) };
1417
1427
  }
1418
1428
  }
1419
1429
  }
@@ -1446,28 +1456,28 @@ ${p}` : p;
1446
1456
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1447
1457
  }
1448
1458
  }
1449
- }, h($e, "w"), $e), ke, ae = (ke = class {
1459
+ }, h($e, "w"), $e), we, ue = (we = class {
1450
1460
  constructor(t) {
1451
- D(this, "tokens");
1452
- D(this, "options");
1453
- D(this, "state");
1454
- D(this, "inlineQueue");
1455
- D(this, "tokenizer");
1456
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Ie, this.options.tokenizer = this.options.tokenizer || new vt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1457
- let e = { other: Y, block: mt.normal, inline: Qe.normal };
1458
- this.options.pedantic ? (e.block = mt.pedantic, e.inline = Qe.pedantic) : this.options.gfm && (e.block = mt.gfm, this.options.breaks ? e.inline = Qe.breaks : e.inline = Qe.gfm), this.tokenizer.rules = e;
1461
+ C(this, "tokens");
1462
+ C(this, "options");
1463
+ C(this, "state");
1464
+ C(this, "inlineQueue");
1465
+ C(this, "tokenizer");
1466
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || De, this.options.tokenizer = this.options.tokenizer || new yt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1467
+ let e = { other: X, block: xt.normal, inline: et.normal };
1468
+ this.options.pedantic ? (e.block = xt.pedantic, e.inline = et.pedantic) : this.options.gfm && (e.block = xt.gfm, this.options.breaks ? e.inline = et.breaks : e.inline = et.gfm), this.tokenizer.rules = e;
1459
1469
  }
1460
1470
  static get rules() {
1461
- return { block: mt, inline: Qe };
1471
+ return { block: xt, inline: et };
1462
1472
  }
1463
1473
  static lex(t, e) {
1464
- return new ke(e).lex(t);
1474
+ return new we(e).lex(t);
1465
1475
  }
1466
1476
  static lexInline(t, e) {
1467
- return new ke(e).inlineTokens(t);
1477
+ return new we(e).inlineTokens(t);
1468
1478
  }
1469
1479
  lex(t) {
1470
- t = t.replace(Y.carriageReturn, `
1480
+ t = t.replace(X.carriageReturn, `
1471
1481
  `), this.blockTokens(t, this.tokens);
1472
1482
  for (let e = 0; e < this.inlineQueue.length; e++) {
1473
1483
  let n = this.inlineQueue[e];
@@ -1476,7 +1486,7 @@ ${p}` : p;
1476
1486
  return this.inlineQueue = [], this.tokens;
1477
1487
  }
1478
1488
  blockTokens(t, e = [], n = !1) {
1479
- for (this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(Y.tabCharGlobal, " ").replace(Y.spaceLine, "")); t; ) {
1489
+ for (this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(X.tabCharGlobal, " ").replace(X.spaceLine, "")); t; ) {
1480
1490
  let s;
1481
1491
  if (this.options.extensions?.block?.some((a) => (s = a.call({ lexer: this }, t, e)) ? (t = t.substring(s.raw.length), e.push(s), !0) : !1)) continue;
1482
1492
  if (s = this.tokenizer.space(t)) {
@@ -1539,8 +1549,8 @@ ${p}` : p;
1539
1549
  let r = t;
1540
1550
  if (this.options.extensions?.startBlock) {
1541
1551
  let a = 1 / 0, o = t.slice(1), c;
1542
- this.options.extensions.startBlock.forEach((d) => {
1543
- c = d.call({ lexer: this }, o), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
1552
+ this.options.extensions.startBlock.forEach((f) => {
1553
+ c = f.call({ lexer: this }, o), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
1544
1554
  }), a < 1 / 0 && a >= 0 && (r = t.substring(0, a + 1));
1545
1555
  }
1546
1556
  if (this.state.top && (s = this.tokenizer.paragraph(r))) {
@@ -1631,14 +1641,14 @@ ${p}` : p;
1631
1641
  t = t.substring(c.raw.length), e.push(c);
1632
1642
  continue;
1633
1643
  }
1634
- let d = t;
1644
+ let f = t;
1635
1645
  if (this.options.extensions?.startInline) {
1636
- let g = 1 / 0, p = t.slice(1), f;
1646
+ let g = 1 / 0, d = t.slice(1), p;
1637
1647
  this.options.extensions.startInline.forEach((m) => {
1638
- f = m.call({ lexer: this }, p), typeof f == "number" && f >= 0 && (g = Math.min(g, f));
1639
- }), g < 1 / 0 && g >= 0 && (d = t.substring(0, g + 1));
1648
+ p = m.call({ lexer: this }, d), typeof p == "number" && p >= 0 && (g = Math.min(g, p));
1649
+ }), g < 1 / 0 && g >= 0 && (f = t.substring(0, g + 1));
1640
1650
  }
1641
- if (c = this.tokenizer.inlineText(d)) {
1651
+ if (c = this.tokenizer.inlineText(f)) {
1642
1652
  t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), a = !0;
1643
1653
  let g = e.at(-1);
1644
1654
  g?.type === "text" ? (g.raw += c.raw, g.text += c.text) : e.push(c);
@@ -1654,20 +1664,20 @@ ${p}` : p;
1654
1664
  }
1655
1665
  return e;
1656
1666
  }
1657
- }, h(ke, "u"), ke), Ue, yt = (Ue = class {
1667
+ }, h(we, "u"), we), Ue, Tt = (Ue = class {
1658
1668
  constructor(t) {
1659
- D(this, "options");
1660
- D(this, "parser");
1661
- this.options = t || Ie;
1669
+ C(this, "options");
1670
+ C(this, "parser");
1671
+ this.options = t || De;
1662
1672
  }
1663
1673
  space(t) {
1664
1674
  return "";
1665
1675
  }
1666
1676
  code({ text: t, lang: e, escaped: n }) {
1667
- let s = (e || "").match(Y.notSpaceStart)?.[0], r = t.replace(Y.endingNewline, "") + `
1677
+ let s = (e || "").match(X.notSpaceStart)?.[0], r = t.replace(X.endingNewline, "") + `
1668
1678
  `;
1669
- return s ? '<pre><code class="language-' + he(s) + '">' + (n ? r : he(r, !0)) + `</code></pre>
1670
- ` : "<pre><code>" + (n ? r : he(r, !0)) + `</code></pre>
1679
+ return s ? '<pre><code class="language-' + ge(s) + '">' + (n ? r : ge(r, !0)) + `</code></pre>
1680
+ ` : "<pre><code>" + (n ? r : ge(r, !0)) + `</code></pre>
1671
1681
  `;
1672
1682
  }
1673
1683
  blockquote({ tokens: t }) {
@@ -1745,7 +1755,7 @@ ${t}</tr>
1745
1755
  return `<em>${this.parser.parseInline(t)}</em>`;
1746
1756
  }
1747
1757
  codespan({ text: t }) {
1748
- return `<code>${he(t, !0)}</code>`;
1758
+ return `<code>${ge(t, !0)}</code>`;
1749
1759
  }
1750
1760
  br(t) {
1751
1761
  return "<br>";
@@ -1758,20 +1768,20 @@ ${t}</tr>
1758
1768
  if (r === null) return s;
1759
1769
  t = r;
1760
1770
  let a = '<a href="' + t + '"';
1761
- return e && (a += ' title="' + he(e) + '"'), a += ">" + s + "</a>", a;
1771
+ return e && (a += ' title="' + ge(e) + '"'), a += ">" + s + "</a>", a;
1762
1772
  }
1763
1773
  image({ href: t, title: e, text: n, tokens: s }) {
1764
1774
  s && (n = this.parser.parseInline(s, this.parser.textRenderer));
1765
1775
  let r = qn(t);
1766
- if (r === null) return he(n);
1776
+ if (r === null) return ge(n);
1767
1777
  t = r;
1768
- let a = `<img src="${t}" alt="${he(n)}"`;
1769
- return e && (a += ` title="${he(e)}"`), a += ">", a;
1778
+ let a = `<img src="${t}" alt="${ge(n)}"`;
1779
+ return e && (a += ` title="${ge(e)}"`), a += ">", a;
1770
1780
  }
1771
1781
  text(t) {
1772
- return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : he(t.text);
1782
+ return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : ge(t.text);
1773
1783
  }
1774
- }, h(Ue, "y"), Ue), Be, on = (Be = class {
1784
+ }, h(Ue, "y"), Ue), Be, cn = (Be = class {
1775
1785
  strong({ text: t }) {
1776
1786
  return t;
1777
1787
  }
@@ -1802,18 +1812,18 @@ ${t}</tr>
1802
1812
  checkbox({ raw: t }) {
1803
1813
  return t;
1804
1814
  }
1805
- }, h(Be, "$"), Be), we, le = (we = class {
1815
+ }, h(Be, "$"), Be), ve, he = (ve = class {
1806
1816
  constructor(t) {
1807
- D(this, "options");
1808
- D(this, "renderer");
1809
- D(this, "textRenderer");
1810
- this.options = t || Ie, this.options.renderer = this.options.renderer || new yt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new on();
1817
+ C(this, "options");
1818
+ C(this, "renderer");
1819
+ C(this, "textRenderer");
1820
+ this.options = t || De, this.options.renderer = this.options.renderer || new Tt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new cn();
1811
1821
  }
1812
1822
  static parse(t, e) {
1813
- return new we(e).parse(t);
1823
+ return new ve(e).parse(t);
1814
1824
  }
1815
1825
  static parseInline(t, e) {
1816
- return new we(e).parseInline(t);
1826
+ return new ve(e).parseInline(t);
1817
1827
  }
1818
1828
  parse(t) {
1819
1829
  this.renderer.parser = this;
@@ -1953,11 +1963,11 @@ ${t}</tr>
1953
1963
  }
1954
1964
  return n;
1955
1965
  }
1956
- }, h(we, "u"), we), be, tt = (be = class {
1966
+ }, h(ve, "u"), ve), ke, st = (ke = class {
1957
1967
  constructor(t) {
1958
- D(this, "options");
1959
- D(this, "block");
1960
- this.options = t || Ie;
1968
+ C(this, "options");
1969
+ C(this, "block");
1970
+ this.options = t || De;
1961
1971
  }
1962
1972
  preprocess(t) {
1963
1973
  return t;
@@ -1972,23 +1982,23 @@ ${t}</tr>
1972
1982
  return t;
1973
1983
  }
1974
1984
  provideLexer(t = this.block) {
1975
- return t ? ae.lex : ae.lexInline;
1985
+ return t ? ue.lex : ue.lexInline;
1976
1986
  }
1977
1987
  provideParser(t = this.block) {
1978
- return t ? le.parse : le.parseInline;
1988
+ return t ? he.parse : he.parseInline;
1979
1989
  }
1980
- }, h(be, "P"), D(be, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), D(be, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), be), Fe, Vr = (Fe = class {
1990
+ }, h(ke, "P"), C(ke, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), C(ke, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), ke), Fe, Vr = (Fe = class {
1981
1991
  constructor(...t) {
1982
- D(this, "defaults", Jt());
1983
- D(this, "options", this.setOptions);
1984
- D(this, "parse", this.parseMarkdown(!0));
1985
- D(this, "parseInline", this.parseMarkdown(!1));
1986
- D(this, "Parser", le);
1987
- D(this, "Renderer", yt);
1988
- D(this, "TextRenderer", on);
1989
- D(this, "Lexer", ae);
1990
- D(this, "Tokenizer", vt);
1991
- D(this, "Hooks", tt);
1992
+ C(this, "defaults", en());
1993
+ C(this, "options", this.setOptions);
1994
+ C(this, "parse", this.parseMarkdown(!0));
1995
+ C(this, "parseInline", this.parseMarkdown(!1));
1996
+ C(this, "Parser", he);
1997
+ C(this, "Renderer", Tt);
1998
+ C(this, "TextRenderer", cn);
1999
+ C(this, "Lexer", ue);
2000
+ C(this, "Tokenizer", yt);
2001
+ C(this, "Hooks", st);
1992
2002
  this.use(...t);
1993
2003
  }
1994
2004
  walkTokens(t, e) {
@@ -2035,51 +2045,51 @@ ${t}</tr>
2035
2045
  }
2036
2046
  "childTokens" in r && r.childTokens && (e.childTokens[r.name] = r.childTokens);
2037
2047
  }), s.extensions = e), n.renderer) {
2038
- let r = this.defaults.renderer || new yt(this.defaults);
2048
+ let r = this.defaults.renderer || new Tt(this.defaults);
2039
2049
  for (let a in n.renderer) {
2040
2050
  if (!(a in r)) throw new Error(`renderer '${a}' does not exist`);
2041
2051
  if (["options", "parser"].includes(a)) continue;
2042
- let o = a, c = n.renderer[o], d = r[o];
2052
+ let o = a, c = n.renderer[o], f = r[o];
2043
2053
  r[o] = (...g) => {
2044
- let p = c.apply(r, g);
2045
- return p === !1 && (p = d.apply(r, g)), p || "";
2054
+ let d = c.apply(r, g);
2055
+ return d === !1 && (d = f.apply(r, g)), d || "";
2046
2056
  };
2047
2057
  }
2048
2058
  s.renderer = r;
2049
2059
  }
2050
2060
  if (n.tokenizer) {
2051
- let r = this.defaults.tokenizer || new vt(this.defaults);
2061
+ let r = this.defaults.tokenizer || new yt(this.defaults);
2052
2062
  for (let a in n.tokenizer) {
2053
2063
  if (!(a in r)) throw new Error(`tokenizer '${a}' does not exist`);
2054
2064
  if (["options", "rules", "lexer"].includes(a)) continue;
2055
- let o = a, c = n.tokenizer[o], d = r[o];
2065
+ let o = a, c = n.tokenizer[o], f = r[o];
2056
2066
  r[o] = (...g) => {
2057
- let p = c.apply(r, g);
2058
- return p === !1 && (p = d.apply(r, g)), p;
2067
+ let d = c.apply(r, g);
2068
+ return d === !1 && (d = f.apply(r, g)), d;
2059
2069
  };
2060
2070
  }
2061
2071
  s.tokenizer = r;
2062
2072
  }
2063
2073
  if (n.hooks) {
2064
- let r = this.defaults.hooks || new tt();
2074
+ let r = this.defaults.hooks || new st();
2065
2075
  for (let a in n.hooks) {
2066
2076
  if (!(a in r)) throw new Error(`hook '${a}' does not exist`);
2067
2077
  if (["options", "block"].includes(a)) continue;
2068
- let o = a, c = n.hooks[o], d = r[o];
2069
- tt.passThroughHooks.has(a) ? r[o] = (g) => {
2070
- if (this.defaults.async && tt.passThroughHooksRespectAsync.has(a)) return (async () => {
2071
- let f = await c.call(r, g);
2072
- return d.call(r, f);
2078
+ let o = a, c = n.hooks[o], f = r[o];
2079
+ st.passThroughHooks.has(a) ? r[o] = (g) => {
2080
+ if (this.defaults.async && st.passThroughHooksRespectAsync.has(a)) return (async () => {
2081
+ let p = await c.call(r, g);
2082
+ return f.call(r, p);
2073
2083
  })();
2074
- let p = c.call(r, g);
2075
- return d.call(r, p);
2084
+ let d = c.call(r, g);
2085
+ return f.call(r, d);
2076
2086
  } : r[o] = (...g) => {
2077
2087
  if (this.defaults.async) return (async () => {
2078
- let f = await c.apply(r, g);
2079
- return f === !1 && (f = await d.apply(r, g)), f;
2088
+ let p = await c.apply(r, g);
2089
+ return p === !1 && (p = await f.apply(r, g)), p;
2080
2090
  })();
2081
- let p = c.apply(r, g);
2082
- return p === !1 && (p = d.apply(r, g)), p;
2091
+ let d = c.apply(r, g);
2092
+ return d === !1 && (d = f.apply(r, g)), d;
2083
2093
  };
2084
2094
  }
2085
2095
  s.hooks = r;
@@ -2098,10 +2108,10 @@ ${t}</tr>
2098
2108
  return this.defaults = { ...this.defaults, ...t }, this;
2099
2109
  }
2100
2110
  lexer(t, e) {
2101
- return ae.lex(t, e ?? this.defaults);
2111
+ return ue.lex(t, e ?? this.defaults);
2102
2112
  }
2103
2113
  parser(t, e) {
2104
- return le.parse(t, e ?? this.defaults);
2114
+ return he.parse(t, e ?? this.defaults);
2105
2115
  }
2106
2116
  parseMarkdown(t) {
2107
2117
  return (e, n) => {
@@ -2110,16 +2120,16 @@ ${t}</tr>
2110
2120
  if (typeof e > "u" || e === null) return a(new Error("marked(): input parameter is undefined or null"));
2111
2121
  if (typeof e != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2112
2122
  if (r.hooks && (r.hooks.options = r, r.hooks.block = t), r.async) return (async () => {
2113
- let o = r.hooks ? await r.hooks.preprocess(e) : e, c = await (r.hooks ? await r.hooks.provideLexer(t) : t ? ae.lex : ae.lexInline)(o, r), d = r.hooks ? await r.hooks.processAllTokens(c) : c;
2114
- r.walkTokens && await Promise.all(this.walkTokens(d, r.walkTokens));
2115
- let g = await (r.hooks ? await r.hooks.provideParser(t) : t ? le.parse : le.parseInline)(d, r);
2123
+ let o = r.hooks ? await r.hooks.preprocess(e) : e, c = await (r.hooks ? await r.hooks.provideLexer(t) : t ? ue.lex : ue.lexInline)(o, r), f = r.hooks ? await r.hooks.processAllTokens(c) : c;
2124
+ r.walkTokens && await Promise.all(this.walkTokens(f, r.walkTokens));
2125
+ let g = await (r.hooks ? await r.hooks.provideParser(t) : t ? he.parse : he.parseInline)(f, r);
2116
2126
  return r.hooks ? await r.hooks.postprocess(g) : g;
2117
2127
  })().catch(a);
2118
2128
  try {
2119
2129
  r.hooks && (e = r.hooks.preprocess(e));
2120
- let o = (r.hooks ? r.hooks.provideLexer(t) : t ? ae.lex : ae.lexInline)(e, r);
2130
+ let o = (r.hooks ? r.hooks.provideLexer(t) : t ? ue.lex : ue.lexInline)(e, r);
2121
2131
  r.hooks && (o = r.hooks.processAllTokens(o)), r.walkTokens && this.walkTokens(o, r.walkTokens);
2122
- let c = (r.hooks ? r.hooks.provideParser(t) : t ? le.parse : le.parseInline)(o, r);
2132
+ let c = (r.hooks ? r.hooks.provideParser(t) : t ? he.parse : he.parseInline)(o, r);
2123
2133
  return r.hooks && (c = r.hooks.postprocess(c)), c;
2124
2134
  } catch (o) {
2125
2135
  return a(o);
@@ -2130,7 +2140,7 @@ ${t}</tr>
2130
2140
  return (n) => {
2131
2141
  if (n.message += `
2132
2142
  Please report this to https://github.com/markedjs/marked.`, t) {
2133
- let s = "<p>An error occurred:</p><pre>" + he(n.message + "", !0) + "</pre>";
2143
+ let s = "<p>An error occurred:</p><pre>" + ge(n.message + "", !0) + "</pre>";
2134
2144
  return e ? Promise.resolve(s) : s;
2135
2145
  }
2136
2146
  if (e) return Promise.reject(n);
@@ -2145,8 +2155,8 @@ h(M, "g");
2145
2155
  M.options = M.setOptions = function(l) {
2146
2156
  return Ce.setOptions(l), M.defaults = Ce.defaults, ss(M.defaults), M;
2147
2157
  };
2148
- M.getDefaults = Jt;
2149
- M.defaults = Ie;
2158
+ M.getDefaults = en;
2159
+ M.defaults = De;
2150
2160
  M.use = function(...l) {
2151
2161
  return Ce.use(...l), M.defaults = Ce.defaults, ss(M.defaults), M;
2152
2162
  };
@@ -2154,22 +2164,22 @@ M.walkTokens = function(l, t) {
2154
2164
  return Ce.walkTokens(l, t);
2155
2165
  };
2156
2166
  M.parseInline = Ce.parseInline;
2157
- M.Parser = le;
2158
- M.parser = le.parse;
2159
- M.Renderer = yt;
2160
- M.TextRenderer = on;
2161
- M.Lexer = ae;
2162
- M.lexer = ae.lex;
2163
- M.Tokenizer = vt;
2164
- M.Hooks = tt;
2167
+ M.Parser = he;
2168
+ M.parser = he.parse;
2169
+ M.Renderer = Tt;
2170
+ M.TextRenderer = cn;
2171
+ M.Lexer = ue;
2172
+ M.lexer = ue.lex;
2173
+ M.Tokenizer = yt;
2174
+ M.Hooks = st;
2165
2175
  M.parse = M;
2166
2176
  M.options;
2167
2177
  M.setOptions;
2168
2178
  M.use;
2169
2179
  M.walkTokens;
2170
2180
  M.parseInline;
2171
- le.parse;
2172
- ae.lex;
2181
+ he.parse;
2182
+ ue.lex;
2173
2183
  const Yr = { class: "@container/chat flex flex-col h-full relative" }, Zr = {
2174
2184
  key: 0,
2175
2185
  class: "pb-4"
@@ -2177,27 +2187,30 @@ const Yr = { class: "@container/chat flex flex-col h-full relative" }, Zr = {
2177
2187
  key: 0,
2178
2188
  class: "flex flex-col items-center justify-center px-4 min-h-full"
2179
2189
  }, Kr = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Qr = ["src", "alt"], Jr = ["title"], ei = {
2190
+ key: 1,
2191
+ class: "flex justify-end px-2 pb-2"
2192
+ }, ti = {
2180
2193
  key: 0,
2181
2194
  class: "flex items-center gap-3 py-3 px-2"
2182
- }, ti = ["data-test"], ni = {
2195
+ }, ni = ["data-issue-code", "data-issue-bucket"], si = { class: "flex flex-col gap-1 min-w-0" }, ri = ["href"], ii = ["data-test"], ai = {
2183
2196
  key: 0,
2184
2197
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
2185
- }, si = ["src", "alt"], ri = ["src", "alt"], ii = ["src"], ai = ["href"], li = ["innerHTML"], oi = {
2186
- key: 1,
2198
+ }, li = ["src", "alt"], oi = ["src", "alt"], ci = ["src"], ui = ["href"], hi = ["innerHTML"], pi = {
2199
+ key: 2,
2187
2200
  class: "flex gap-2 justify-start items-center mb-4"
2188
- }, ci = ["src", "alt"], ui = {
2201
+ }, di = ["src", "alt"], fi = {
2189
2202
  key: 0,
2190
2203
  class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto"
2191
- }, hi = ["src", "alt"], pi = { class: "max-w-20 truncate" }, di = ["onClick"], fi = {
2204
+ }, gi = ["src", "alt"], mi = { class: "max-w-20 truncate" }, xi = ["onClick"], bi = {
2192
2205
  key: 0,
2193
2206
  class: "shrink-0 flex items-center justify-center size-14"
2194
- }, gi = ["disabled"], mi = {
2207
+ }, ki = ["disabled"], wi = {
2195
2208
  key: 0,
2196
2209
  class: "i-svg-spinners-ring-resize size-4"
2197
- }, xi = {
2210
+ }, vi = {
2198
2211
  key: 1,
2199
2212
  class: "i-tabler-paperclip size-5"
2200
- }, bi = ["placeholder", "disabled"], ki = ["disabled"], Ii = /* @__PURE__ */ De({
2213
+ }, yi = ["placeholder", "disabled"], Ti = ["disabled"], Oi = /* @__PURE__ */ Ie({
2201
2214
  __name: "ElAgentChat",
2202
2215
  props: {
2203
2216
  chatController: {},
@@ -2211,12 +2224,12 @@ const Yr = { class: "@container/chat flex flex-col h-full relative" }, Zr = {
2211
2224
  },
2212
2225
  setup(l) {
2213
2226
  const t = new M.Renderer();
2214
- t.link = ({ href: b, text: w }) => `<a href="${b}" target="_blank" rel="noopener noreferrer">${w}</a>`, M.setOptions({ breaks: !0, gfm: !0, renderer: t });
2215
- function e(b) {
2216
- if (!b)
2227
+ t.link = ({ href: v, text: k }) => `<a href="${v}" target="_blank" rel="noopener noreferrer">${k}</a>`, M.setOptions({ breaks: !0, gfm: !0, renderer: t });
2228
+ function e(v) {
2229
+ if (!v)
2217
2230
  return "";
2218
- const w = M.parse(b, { async: !1 });
2219
- return ar.sanitize(w, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2231
+ const k = M.parse(v, { async: !1 });
2232
+ return ar.sanitize(k, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2220
2233
  }
2221
2234
  h(e, "renderMarkdown");
2222
2235
  const n = {
@@ -2227,354 +2240,396 @@ const Yr = { class: "@container/chat flex flex-col h-full relative" }, Zr = {
2227
2240
  private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
2228
2241
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
2229
2242
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
2230
- }, r = F(() => l.setupHint ?? n[l.scope]), a = F(() => {
2231
- const b = { ...s[l.scope] };
2232
- return l.scope === "org" && l.scopeName && (b.label = l.scopeName, b.tooltip = `Visible to ${l.scopeName} members`), b;
2233
- }), o = V(""), c = V(!1), d = V(), g = V(), p = V(), f = V([]), m = V(!1);
2234
- function y(b, w) {
2235
- const k = b[w], O = b[w + 1];
2236
- return !O || O.sender !== k.sender;
2237
- }
2238
- h(y, "shouldShowAvatar");
2239
- const S = F(() => l.chatController?.textState.value), z = F(() => S.value?.isConnected ?? !1), de = F(() => S.value?.isThinking ?? !1), me = F(() => S.value?.connectionStatus === "disconnected" && !!S.value?.error), ne = F(() => S.value?.connectionStatus !== "connected" && !S.value?.error), $ = F(() => S.value?.error), j = F(() => l.chatController?.sharedMessages.value?.filter((b) => b.sender !== "system") ?? []), se = F(() => !z.value), fe = F(() => me.value ? "Agent is offline" : ne.value ? "Connecting..." : "Message"), rt = F(() => (o.value.trim() || f.value.length > 0) && !se.value && !m.value), L = F(() => l.variant === "light"), it = F(
2240
- () => L.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2241
- ), U = F(() => L.value ? "text-theme-300" : "text-white/30");
2242
- Qt(async () => {
2243
+ }, r = H(() => l.setupHint ?? n[l.scope]), a = H(() => {
2244
+ const v = { ...s[l.scope] };
2245
+ return l.scope === "org" && l.scopeName && (v.label = l.scopeName, v.tooltip = `Visible to ${l.scopeName} members`), v;
2246
+ }), o = Z(""), c = Z(!1), f = Z(), g = Z(), d = Z(), p = Z([]), m = Z(!1);
2247
+ function T(v, k) {
2248
+ const x = v[k], L = v[k + 1];
2249
+ return !L || L.sender !== x.sender;
2250
+ }
2251
+ h(T, "shouldShowAvatar");
2252
+ const _ = H(() => l.chatController?.textState.value), z = H(() => _.value?.isConnected ?? !1), te = H(() => _.value?.isThinking ?? !1), ae = H(() => _.value?.connectionStatus === "disconnected" && !!_.value?.error), J = H(() => _.value?.connectionStatus !== "connected" && !_.value?.error), P = H(() => _.value?.error), W = H(() => l.chatController?.sharedMessages.value ?? []), le = H(() => _.value?.accountGated ?? !1), ne = H(() => !z.value || le.value), Et = H(() => ae.value ? "Agent is offline" : J.value ? "Connecting..." : le.value ? "Resolve the billing issue above to continue" : "Message"), at = H(() => (o.value.trim() || p.value.length > 0) && !ne.value && !m.value), I = H(() => l.variant === "light"), G = H(
2253
+ () => I.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2254
+ ), xe = H(() => I.value ? "text-theme-300" : "text-white/30");
2255
+ Jt(async () => {
2243
2256
  if (l.chatController && !z.value)
2244
2257
  try {
2245
2258
  await l.chatController.startTextConversation();
2246
- } catch (b) {
2247
- console.error("Failed to start text conversation:", b);
2259
+ } catch (v) {
2260
+ console.error("Failed to start text conversation:", v);
2248
2261
  }
2249
2262
  });
2250
- async function ve() {
2251
- const b = o.value.trim(), w = f.value.length > 0;
2252
- if (!b && !w || !l.chatController || !z.value || m.value)
2263
+ function Me() {
2264
+ l.chatController?.newConversation();
2265
+ }
2266
+ h(Me, "startNewConversation");
2267
+ async function ye() {
2268
+ const v = o.value.trim(), k = p.value.length > 0;
2269
+ if (!v && !k || !l.chatController || !z.value || m.value)
2253
2270
  return;
2254
- const k = o.value, O = w ? [...f.value] : void 0;
2255
- o.value = "", f.value = [], g.value && (g.value.style.height = "auto", g.value.focus());
2271
+ const x = o.value, L = k ? [...p.value] : void 0;
2272
+ o.value = "", p.value = [], g.value && (g.value.style.height = "auto", g.value.focus());
2256
2273
  try {
2257
- await l.chatController.sendChatMessage(k, O), ye();
2258
- } catch (C) {
2259
- console.error("Error sending message:", C);
2274
+ await l.chatController.sendChatMessage(x, L), lt();
2275
+ } catch (B) {
2276
+ console.error("Error sending message:", B);
2260
2277
  }
2261
2278
  }
2262
- h(ve, "sendMessage");
2263
- function Me(b) {
2264
- b.key === "Enter" && !b.shiftKey && (b.preventDefault(), ve());
2279
+ h(ye, "sendMessage");
2280
+ function _t(v) {
2281
+ v.key === "Enter" && !v.shiftKey && (v.preventDefault(), ye());
2265
2282
  }
2266
- h(Me, "handleKeydown");
2267
- function ye() {
2268
- d.value && Bt(() => {
2269
- d.value.scrollTop = d.value.scrollHeight;
2283
+ h(_t, "handleKeydown");
2284
+ function lt() {
2285
+ f.value && Ft(() => {
2286
+ f.value.scrollTop = f.value.scrollHeight;
2270
2287
  });
2271
2288
  }
2272
- h(ye, "scrollToBottom");
2273
- function At() {
2289
+ h(lt, "scrollToBottom");
2290
+ function Rt() {
2274
2291
  g.value && (g.value.style.height = "auto", g.value.style.height = `${Math.min(g.value.scrollHeight, 150)}px`);
2275
2292
  }
2276
- h(At, "adjustTextareaHeight"), nt(o, () => Bt(() => At()));
2277
- function Et() {
2278
- p.value?.click();
2293
+ h(Rt, "adjustTextareaHeight"), rt(o, () => Ft(() => Rt()));
2294
+ function ot() {
2295
+ d.value?.click();
2279
2296
  }
2280
- h(Et, "triggerFileInput");
2281
- async function _t(b) {
2282
- const w = b.target, k = w.files?.[0];
2283
- if (!(!k || !l.uploadFn)) {
2297
+ h(ot, "triggerFileInput");
2298
+ async function Ct(v) {
2299
+ const k = v.target, x = k.files?.[0];
2300
+ if (!(!x || !l.uploadFn)) {
2284
2301
  m.value = !0;
2285
2302
  try {
2286
- const O = await l.uploadFn(k);
2287
- f.value = [...f.value, O];
2288
- } catch (O) {
2289
- console.error("Upload failed:", O);
2303
+ const L = await l.uploadFn(x);
2304
+ p.value = [...p.value, L];
2305
+ } catch (L) {
2306
+ console.error("Upload failed:", L);
2290
2307
  } finally {
2291
- m.value = !1, w.value = "";
2308
+ m.value = !1, k.value = "";
2292
2309
  }
2293
2310
  }
2294
2311
  }
2295
- h(_t, "handleFileSelect");
2296
- function at(b) {
2297
- f.value = f.value.filter((w, k) => k !== b);
2298
- }
2299
- h(at, "removeAttachment");
2300
- function lt(b, w) {
2301
- if (w === 0) {
2302
- const ee = b[w];
2303
- return ee?.timestamp ? Ge(new Date(ee.timestamp)) : null;
2304
- }
2305
- const k = b[w - 1], O = b[w];
2306
- if (!k?.timestamp || !O?.timestamp) return null;
2307
- const C = new Date(k.timestamp).getTime();
2308
- return new Date(O.timestamp).getTime() - C > 36e5 ? Ge(new Date(O.timestamp)) : null;
2309
- }
2310
- h(lt, "shouldShowTimeDivider");
2311
- function Ge(b) {
2312
- const w = /* @__PURE__ */ new Date(), k = b.toDateString() === w.toDateString(), O = new Date(w);
2313
- O.setDate(O.getDate() - 1);
2314
- const C = b.toDateString() === O.toDateString(), J = b.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2315
- if (k) return J;
2316
- if (C) return `Yesterday, ${J}`;
2317
- const Te = b.getFullYear() === w.getFullYear();
2318
- return `${b.toLocaleDateString("en-US", {
2312
+ h(Ct, "handleFileSelect");
2313
+ function ct(v) {
2314
+ p.value = p.value.filter((k, x) => x !== v);
2315
+ }
2316
+ h(ct, "removeAttachment");
2317
+ function N(v, k) {
2318
+ if (k === 0) {
2319
+ const Te = v[k];
2320
+ return Te?.timestamp ? Ge(new Date(Te.timestamp)) : null;
2321
+ }
2322
+ const x = v[k - 1], L = v[k];
2323
+ if (!x?.timestamp || !L?.timestamp) return null;
2324
+ const B = new Date(x.timestamp).getTime();
2325
+ return new Date(L.timestamp).getTime() - B > 36e5 ? Ge(new Date(L.timestamp)) : null;
2326
+ }
2327
+ h(N, "shouldShowTimeDivider");
2328
+ function Ge(v) {
2329
+ const k = /* @__PURE__ */ new Date(), x = v.toDateString() === k.toDateString(), L = new Date(k);
2330
+ L.setDate(L.getDate() - 1);
2331
+ const B = v.toDateString() === L.toDateString(), V = v.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2332
+ if (x) return V;
2333
+ if (B) return `Yesterday, ${V}`;
2334
+ const We = v.getFullYear() === k.getFullYear();
2335
+ return `${v.toLocaleDateString("en-US", {
2319
2336
  weekday: "long",
2320
2337
  month: "short",
2321
2338
  day: "numeric",
2322
- ...Te ? {} : { year: "numeric" }
2323
- })}, ${J}`;
2324
- }
2325
- return h(Ge, "formatTimeDivider"), nt(j, (b) => {
2326
- b.length > 0 && Bt(() => ye());
2327
- }, { immediate: !0, deep: !0 }), (b, w) => (A(), E("div", Yr, [
2328
- L.value ? G("", !0) : (A(), E("div", Zr, [
2329
- Ft($s, {
2339
+ ...We ? {} : { year: "numeric" }
2340
+ })}, ${V}`;
2341
+ }
2342
+ return h(Ge, "formatTimeDivider"), rt(W, (v) => {
2343
+ v.length > 0 && Ft(() => lt());
2344
+ }, { immediate: !0, deep: !0 }), (v, k) => (S(), A("div", Yr, [
2345
+ I.value ? U("", !0) : (S(), A("div", Zr, [
2346
+ Ht($s, {
2330
2347
  agent: l.agent,
2331
2348
  "is-online": z.value
2332
2349
  }, null, 8, ["agent", "is-online"])
2333
2350
  ])),
2334
- me.value ? (A(), E("div", {
2351
+ ae.value ? (S(), A("div", {
2335
2352
  key: 1,
2336
- class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", L.value ? "text-theme-400" : "text-white/60"])
2353
+ class: E(["py-16 flex flex-col items-center justify-center gap-3 text-sm", I.value ? "text-theme-400" : "text-white/60"])
2337
2354
  }, [
2338
- T("i", {
2339
- class: _(["i-heroicons-cloud-arrow-down size-8", L.value ? "text-theme-300" : "text-white/40"])
2355
+ w("i", {
2356
+ class: E(["i-heroicons-cloud-arrow-down size-8", I.value ? "text-theme-300" : "text-white/40"])
2340
2357
  }, null, 2),
2341
- T("span", null, pe($.value), 1)
2342
- ], 2)) : ne.value ? (A(), E("div", {
2358
+ w("span", null, re(P.value), 1)
2359
+ ], 2)) : J.value ? (S(), A("div", {
2343
2360
  key: 2,
2344
- class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", L.value ? "text-theme-400" : "text-theme-600"])
2361
+ class: E(["py-16 flex flex-col items-center justify-center gap-2 text-sm", I.value ? "text-theme-400" : "text-theme-600"])
2345
2362
  }, [
2346
- Ft(In, { class: "size-4" })
2347
- ], 2)) : r.value ? (A(), E("div", {
2363
+ Ht(Dn, { class: "size-4" })
2364
+ ], 2)) : r.value ? (S(), A("div", {
2348
2365
  key: 3,
2349
- class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", U.value])
2366
+ class: E(["flex items-center justify-center gap-1.5 py-2 text-[11px]", xe.value])
2350
2367
  }, [
2351
- w[5] || (w[5] = T("i", { class: "i-tabler-tool size-3" }, null, -1)),
2352
- T("span", null, pe(r.value), 1)
2353
- ], 2)) : G("", !0),
2354
- T("div", {
2368
+ k[5] || (k[5] = w("i", { class: "i-tabler-tool size-3" }, null, -1)),
2369
+ w("span", null, re(r.value), 1)
2370
+ ], 2)) : U("", !0),
2371
+ w("div", {
2355
2372
  ref_key: "messagesContainer",
2356
- ref: d,
2373
+ ref: f,
2357
2374
  class: "flex-1 overflow-y-auto overflow-x-hidden pt-4 pb-[120px] px-3 space-y-1 min-h-0 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
2358
2375
  }, [
2359
- j.value.length === 0 && !ne.value && !me.value ? (A(), E("div", Xr, [
2360
- T("div", Kr, [
2361
- T("img", {
2376
+ W.value.length === 0 && !J.value && !ae.value ? (S(), A("div", Xr, [
2377
+ w("div", Kr, [
2378
+ w("img", {
2362
2379
  src: l.agent.avatarUrl.value,
2363
2380
  alt: l.agent.displayName.value,
2364
- class: _(["size-full rounded-full object-cover ring-1", L.value ? "ring-black/5" : "ring-white/10"])
2381
+ class: E(["size-full rounded-full object-cover ring-1", I.value ? "ring-black/5" : "ring-white/10"])
2365
2382
  }, null, 10, Qr),
2366
- z.value ? (A(), E("span", {
2383
+ z.value ? (S(), A("span", {
2367
2384
  key: 0,
2368
- class: _(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", L.value ? "bg-white" : "bg-theme-900"])
2369
- }, [...w[6] || (w[6] = [
2370
- T("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2371
- ])], 2)) : G("", !0)
2385
+ class: E(["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"])
2386
+ }, [...k[6] || (k[6] = [
2387
+ w("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2388
+ ])], 2)) : U("", !0)
2372
2389
  ]),
2373
- T("div", {
2374
- class: _(["text-base @sm/chat:text-lg font-semibold", L.value ? "text-theme-900" : "text-white"])
2375
- }, pe(l.agent.displayName.value), 3),
2376
- T("p", {
2377
- class: _(["mt-1 text-center text-xs @sm/chat:text-sm", U.value])
2378
- }, pe(l.emptyStateMessage || "Send a message to get started"), 3),
2379
- T("div", {
2380
- class: _(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", L.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2390
+ w("div", {
2391
+ class: E(["text-base @sm/chat:text-lg font-semibold", I.value ? "text-theme-900" : "text-white"])
2392
+ }, re(l.agent.displayName.value), 3),
2393
+ w("p", {
2394
+ class: E(["mt-1 text-center text-xs @sm/chat:text-sm", xe.value])
2395
+ }, re(l.emptyStateMessage || "Send a message to get started"), 3),
2396
+ w("div", {
2397
+ class: E(["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"]),
2381
2398
  title: a.value.tooltip
2382
2399
  }, [
2383
- T("i", {
2384
- class: _([a.value.icon, "size-3"])
2400
+ w("i", {
2401
+ class: E([a.value.icon, "size-3"])
2385
2402
  }, null, 2),
2386
- T("span", null, pe(a.value.label), 1)
2403
+ w("span", null, re(a.value.label), 1)
2387
2404
  ], 10, Jr)
2388
- ])) : G("", !0),
2389
- (A(!0), E(_e, null, xt(j.value, (k, O) => (A(), E(_e, {
2390
- key: k.id
2405
+ ])) : U("", !0),
2406
+ W.value.length > 0 ? (S(), A("div", ei, [
2407
+ w("button", {
2408
+ type: "button",
2409
+ "data-test": "chat-new-session",
2410
+ class: E(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", I.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
2411
+ onClick: Me
2412
+ }, [...k[7] || (k[7] = [
2413
+ w("i", { class: "i-tabler-refresh size-3" }, null, -1),
2414
+ w("span", null, "New chat", -1)
2415
+ ])], 2)
2416
+ ])) : U("", !0),
2417
+ (S(!0), A(_e, null, bt(W.value, (x, L) => (S(), A(_e, {
2418
+ key: x.id
2391
2419
  }, [
2392
- lt(j.value, O) ? (A(), E("div", ei, [
2393
- T("div", {
2394
- class: _(["flex-1 h-px", it.value])
2420
+ N(W.value, L) ? (S(), A("div", ti, [
2421
+ w("div", {
2422
+ class: E(["flex-1 h-px", G.value])
2395
2423
  }, null, 2),
2396
- T("span", {
2397
- class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", U.value])
2398
- }, pe(lt(j.value, O)), 3),
2399
- T("div", {
2400
- class: _(["flex-1 h-px", it.value])
2424
+ w("span", {
2425
+ class: E(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", xe.value])
2426
+ }, re(N(W.value, L)), 3),
2427
+ w("div", {
2428
+ class: E(["flex-1 h-px", G.value])
2401
2429
  }, null, 2)
2402
- ])) : G("", !0),
2403
- T("div", {
2404
- "data-test": k.sender === "agent" ? "messaging-assistant-msg" : k.sender === "user" ? "messaging-user-msg" : void 0,
2405
- class: _(["flex gap-2 items-end", {
2406
- "justify-end": k.sender === "user",
2407
- "justify-start": k.sender === "agent",
2408
- "mb-4": y(j.value, O)
2430
+ ])) : U("", !0),
2431
+ x.sender === "system" ? (S(), A("div", {
2432
+ key: 1,
2433
+ "data-test": "messaging-system-msg",
2434
+ "data-issue-code": x.issue?.code,
2435
+ "data-issue-bucket": x.issue?.bucket,
2436
+ class: E(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", I.value ? "text-theme-500" : "text-white/70"])
2437
+ }, [
2438
+ w("i", {
2439
+ class: E(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", x.issue?.bucket === "account" ? I.value ? "text-amber-500" : "text-amber-300" : I.value ? "text-red-500" : "text-red-300"])
2440
+ }, null, 2),
2441
+ w("div", si, [
2442
+ w("span", null, re(x.text), 1),
2443
+ x.issue?.help ? (S(), A("span", {
2444
+ key: 0,
2445
+ class: E(["text-[12px]", I.value ? "text-theme-400" : "text-white/55"])
2446
+ }, re(x.issue.help), 3)) : U("", !0),
2447
+ x.issue?.actionUrl ? (S(), A("a", {
2448
+ key: 1,
2449
+ href: x.issue.actionUrl,
2450
+ "data-test": "messaging-system-msg-action",
2451
+ class: E(["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"])
2452
+ }, [
2453
+ Ye(re(x.issue.actionLabel) + " ", 1),
2454
+ k[8] || (k[8] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2455
+ ], 10, ri)) : U("", !0)
2456
+ ])
2457
+ ], 10, ni)) : (S(), A("div", {
2458
+ key: 2,
2459
+ "data-test": x.sender === "agent" ? "messaging-assistant-msg" : x.sender === "user" ? "messaging-user-msg" : void 0,
2460
+ class: E(["flex gap-2 items-end", {
2461
+ "justify-end": x.sender === "user",
2462
+ "justify-start": x.sender === "agent",
2463
+ "mb-4": T(W.value, L)
2409
2464
  }])
2410
2465
  }, [
2411
- k.sender === "agent" ? (A(), E("div", ni, [
2412
- y(j.value, O) ? (A(), E("img", {
2466
+ x.sender === "agent" ? (S(), A("div", ai, [
2467
+ T(W.value, L) ? (S(), A("img", {
2413
2468
  key: 0,
2414
2469
  src: l.agent.avatarUrl.value,
2415
2470
  alt: l.agent.displayName.value,
2416
- class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", L.value ? "ring-1 ring-black/5" : ""])
2417
- }, null, 10, si)) : G("", !0)
2418
- ])) : G("", !0),
2419
- T("div", {
2420
- class: _(k.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2471
+ class: E(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
2472
+ }, null, 10, li)) : U("", !0)
2473
+ ])) : U("", !0),
2474
+ w("div", {
2475
+ class: E(x.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2421
2476
  }, [
2422
- k.attachments?.length ? (A(), E("div", {
2477
+ x.attachments?.length ? (S(), A("div", {
2423
2478
  key: 0,
2424
- class: _(["mb-1 space-y-1", k.sender === "user" ? "flex flex-col items-end" : ""])
2479
+ class: E(["mb-1 space-y-1", x.sender === "user" ? "flex flex-col items-end" : ""])
2425
2480
  }, [
2426
- (A(!0), E(_e, null, xt(k.attachments, (C, J) => (A(), E(_e, { key: J }, [
2427
- C.type === "image" ? (A(), E("img", {
2481
+ (S(!0), A(_e, null, bt(x.attachments, (B, V) => (S(), A(_e, { key: V }, [
2482
+ B.type === "image" ? (S(), A("img", {
2428
2483
  key: 0,
2429
- src: C.url,
2430
- alt: C.name,
2484
+ src: B.url,
2485
+ alt: B.name,
2431
2486
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2432
- }, null, 8, ri)) : C.type === "audio" ? (A(), E("audio", {
2487
+ }, null, 8, oi)) : B.type === "audio" ? (S(), A("audio", {
2433
2488
  key: 1,
2434
- src: C.url,
2489
+ src: B.url,
2435
2490
  controls: "",
2436
2491
  class: "max-w-full"
2437
- }, null, 8, ii)) : (A(), E("a", {
2492
+ }, null, 8, ci)) : (S(), A("a", {
2438
2493
  key: 2,
2439
- href: C.url,
2494
+ href: B.url,
2440
2495
  target: "_blank",
2441
2496
  rel: "noopener",
2442
- class: _(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", L.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2497
+ class: E(["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"])
2443
2498
  }, [
2444
- w[7] || (w[7] = T("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2445
- ft(" " + pe(C.name), 1)
2446
- ], 10, ai))
2499
+ k[9] || (k[9] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2500
+ Ye(" " + re(B.name), 1)
2501
+ ], 10, ui))
2447
2502
  ], 64))), 128))
2448
- ], 2)) : G("", !0),
2449
- k.text ? (A(), E("div", {
2503
+ ], 2)) : U("", !0),
2504
+ x.text ? (S(), A("div", {
2450
2505
  key: 1,
2451
- class: _(["rounded-2xl px-3.5 py-2", [
2452
- k.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : L.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]"
2506
+ class: E(["rounded-2xl px-3.5 py-2", [
2507
+ x.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]"
2453
2508
  ]])
2454
2509
  }, [
2455
- T("div", {
2456
- class: _(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", k.sender === "user" || !L.value ? "chat-msg-prose-invert" : ""]),
2457
- innerHTML: e(k.text)
2458
- }, null, 10, li)
2459
- ], 2)) : G("", !0)
2510
+ w("div", {
2511
+ class: E(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", x.sender === "user" || !I.value ? "chat-msg-prose-invert" : ""]),
2512
+ innerHTML: e(x.text)
2513
+ }, null, 10, hi)
2514
+ ], 2)) : U("", !0)
2460
2515
  ], 2)
2461
- ], 10, ti)
2516
+ ], 10, ii))
2462
2517
  ], 64))), 128)),
2463
- de.value ? (A(), E("div", oi, [
2464
- T("img", {
2518
+ te.value ? (S(), A("div", pi, [
2519
+ w("img", {
2465
2520
  src: l.agent.avatarUrl.value,
2466
2521
  alt: l.agent.displayName.value,
2467
- class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", L.value ? "ring-1 ring-black/5" : ""])
2468
- }, null, 10, ci),
2469
- T("div", {
2470
- class: _(["rounded-2xl px-3.5 py-2.5 flex items-center", L.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2522
+ class: E(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
2523
+ }, null, 10, di),
2524
+ w("div", {
2525
+ class: E(["rounded-2xl px-3.5 py-2.5 flex items-center", I.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2471
2526
  }, [
2472
- T("i", {
2473
- class: _(["i-svg-spinners-3-dots-bounce size-7", L.value ? "text-theme-400" : "text-white/50"])
2527
+ w("i", {
2528
+ class: E(["i-svg-spinners-3-dots-bounce size-7", I.value ? "text-theme-400" : "text-white/50"])
2474
2529
  }, null, 2)
2475
2530
  ], 2)
2476
- ])) : G("", !0)
2531
+ ])) : U("", !0)
2477
2532
  ], 512),
2478
- T("div", {
2479
- class: _(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", L.value ? "bg-gradient-to-t from-white via-white/95 to-white/70" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2533
+ w("div", {
2534
+ class: E(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", I.value ? "bg-gradient-to-t from-white via-white/95 to-white/70" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2480
2535
  }, [
2481
- f.value.length > 0 ? (A(), E("div", ui, [
2482
- (A(!0), E(_e, null, xt(f.value, (k, O) => (A(), E("div", {
2483
- key: O,
2536
+ p.value.length > 0 ? (S(), A("div", fi, [
2537
+ (S(!0), A(_e, null, bt(p.value, (x, L) => (S(), A("div", {
2538
+ key: L,
2484
2539
  class: "relative shrink-0 group"
2485
2540
  }, [
2486
- k.type === "image" ? (A(), E("img", {
2541
+ x.type === "image" ? (S(), A("img", {
2487
2542
  key: 0,
2488
- src: k.url,
2489
- alt: k.name,
2490
- class: _(["size-14 rounded-xl object-cover border", L.value ? "border-black/10" : "border-white/20"])
2491
- }, null, 10, hi)) : (A(), E("div", {
2543
+ src: x.url,
2544
+ alt: x.name,
2545
+ class: E(["size-14 rounded-xl object-cover border", I.value ? "border-black/10" : "border-white/20"])
2546
+ }, null, 10, gi)) : (S(), A("div", {
2492
2547
  key: 1,
2493
- class: _(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", L.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2548
+ class: E(["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"])
2494
2549
  }, [
2495
- w[8] || (w[8] = T("i", { class: "i-tabler-file size-4" }, null, -1)),
2496
- T("span", pi, pe(k.name), 1)
2550
+ k[10] || (k[10] = w("i", { class: "i-tabler-file size-4" }, null, -1)),
2551
+ w("span", mi, re(x.name), 1)
2497
2552
  ], 2)),
2498
- T("button", {
2553
+ w("button", {
2499
2554
  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",
2500
- onClick: /* @__PURE__ */ h((C) => at(O), "onClick")
2501
- }, [...w[9] || (w[9] = [
2502
- T("i", { class: "i-tabler-x size-3" }, null, -1)
2503
- ])], 8, di)
2555
+ onClick: /* @__PURE__ */ h((B) => ct(L), "onClick")
2556
+ }, [...k[11] || (k[11] = [
2557
+ w("i", { class: "i-tabler-x size-3" }, null, -1)
2558
+ ])], 8, xi)
2504
2559
  ]))), 128)),
2505
- m.value ? (A(), E("div", fi, [
2506
- Ft(In, { class: "size-5" })
2507
- ])) : G("", !0)
2508
- ])) : G("", !0),
2509
- l.uploadFn ? (A(), E("input", {
2560
+ m.value ? (S(), A("div", bi, [
2561
+ Ht(Dn, { class: "size-5" })
2562
+ ])) : U("", !0)
2563
+ ])) : U("", !0),
2564
+ l.uploadFn ? (S(), A("input", {
2510
2565
  key: 1,
2511
2566
  ref_key: "fileInput",
2512
- ref: p,
2567
+ ref: d,
2513
2568
  type: "file",
2514
2569
  accept: "image/*,audio/*,video/*",
2515
2570
  class: "hidden",
2516
- onChange: _t
2517
- }, null, 544)) : G("", !0),
2518
- T("div", {
2519
- class: _(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", L.value ? c.value ? "bg-white ring-1 ring-black/10 shadow-[0_4px_16px_rgba(0,0,0,0.06)]" : "bg-theme-50 ring-1 ring-transparent hover:ring-black/5" : c.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2571
+ onChange: Ct
2572
+ }, null, 544)) : U("", !0),
2573
+ w("div", {
2574
+ class: E(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", I.value ? c.value ? "bg-white ring-1 ring-black/10 shadow-[0_4px_16px_rgba(0,0,0,0.06)]" : "bg-theme-50 ring-1 ring-transparent hover:ring-black/5" : c.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2520
2575
  }, [
2521
- T("button", {
2522
- class: _(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2576
+ w("button", {
2577
+ class: E(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2523
2578
  l.uploadFn ? "cursor-pointer" : "cursor-default",
2524
- L.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2579
+ I.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2525
2580
  m.value ? "opacity-50 pointer-events-none" : ""
2526
2581
  ]]),
2527
- disabled: se.value || m.value || !l.uploadFn,
2528
- onClick: w[0] || (w[0] = (k) => l.uploadFn && Et())
2582
+ disabled: ne.value || m.value || !l.uploadFn,
2583
+ onClick: k[0] || (k[0] = (x) => l.uploadFn && ot())
2529
2584
  }, [
2530
- m.value ? (A(), E("i", mi)) : (A(), E("i", xi))
2531
- ], 10, gi),
2532
- Xn(T("textarea", {
2585
+ m.value ? (S(), A("i", wi)) : (S(), A("i", vi))
2586
+ ], 10, ki),
2587
+ Xn(w("textarea", {
2533
2588
  ref_key: "textarea",
2534
2589
  ref: g,
2535
- "onUpdate:modelValue": w[1] || (w[1] = (k) => o.value = k),
2590
+ "onUpdate:modelValue": k[1] || (k[1] = (x) => o.value = x),
2536
2591
  "data-test": "messaging-input",
2537
2592
  rows: "1",
2538
2593
  enterkeyhint: "send",
2539
- placeholder: fe.value,
2540
- disabled: se.value,
2594
+ placeholder: Et.value,
2595
+ disabled: ne.value,
2541
2596
  style: { fontSize: "16px", resize: "none" },
2542
- class: _(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", L.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2543
- onKeydown: Me,
2544
- onFocus: w[2] || (w[2] = (k) => c.value = !0),
2545
- onBlur: w[3] || (w[3] = (k) => c.value = !1)
2546
- }, null, 42, bi), [
2597
+ class: E(["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"]),
2598
+ onKeydown: _t,
2599
+ onFocus: k[2] || (k[2] = (x) => c.value = !0),
2600
+ onBlur: k[3] || (k[3] = (x) => c.value = !1)
2601
+ }, null, 42, yi), [
2547
2602
  [Kn, o.value]
2548
2603
  ]),
2549
- T("button", {
2604
+ w("button", {
2550
2605
  "data-test": "messaging-send-btn",
2551
- class: _(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", rt.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : L.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2552
- disabled: !rt.value,
2553
- onClick: w[4] || (w[4] = (k) => ve())
2554
- }, [...w[10] || (w[10] = [
2555
- T("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2556
- ])], 10, ki)
2606
+ class: E(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", at.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : I.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2607
+ disabled: !at.value,
2608
+ onClick: k[4] || (k[4] = (x) => ye())
2609
+ }, [...k[12] || (k[12] = [
2610
+ w("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2611
+ ])], 10, Ti)
2557
2612
  ], 2),
2558
- T("div", {
2559
- class: _(["text-[10px] text-center mt-2.5 select-none opacity-70", L.value ? "text-theme-400" : "text-white/50"])
2613
+ w("div", {
2614
+ class: E(["text-[10px] text-center mt-2.5 select-none opacity-70", I.value ? "text-theme-400" : "text-white/50"])
2560
2615
  }, [
2561
- w[11] || (w[11] = ft(" Press ", -1)),
2562
- T("kbd", {
2563
- class: _(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", L.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2616
+ k[13] || (k[13] = Ye(" Press ", -1)),
2617
+ w("kbd", {
2618
+ class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", I.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2564
2619
  }, "Enter", 2),
2565
- w[12] || (w[12] = ft(" to send, ", -1)),
2566
- T("kbd", {
2567
- class: _(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", L.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2620
+ k[14] || (k[14] = Ye(" to send, ", -1)),
2621
+ w("kbd", {
2622
+ class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", I.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2568
2623
  }, "Shift+Enter", 2),
2569
- w[13] || (w[13] = ft(" for new line ", -1))
2624
+ k[15] || (k[15] = Ye(" for new line ", -1))
2570
2625
  ], 2)
2571
2626
  ], 2)
2572
2627
  ]));
2573
2628
  }
2574
- }), wi = { class: "agent-wrap" }, vi = {
2629
+ }), Si = { class: "agent-wrap" }, Ai = {
2575
2630
  key: 0,
2576
2631
  class: "flex items-center justify-center h-full"
2577
- }, Mi = /* @__PURE__ */ De({
2632
+ }, Pi = /* @__PURE__ */ Ie({
2578
2633
  __name: "AgentWrap",
2579
2634
  props: {
2580
2635
  sdk: {},
@@ -2591,8 +2646,8 @@ const Yr = { class: "@container/chat flex flex-col h-full relative" }, Zr = {
2591
2646
  const t = Ts("AgentWrap"), e = l, n = e.sdk || Ss.getInstance({
2592
2647
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2593
2648
  ...e.apiBase && { apiBase: e.apiBase }
2594
- }), s = V(!e.agent), r = vs(e.agent ? new kt({ config: e.agent }) : void 0), a = V();
2595
- return Qt(async () => {
2649
+ }), s = Z(!e.agent), r = vs(e.agent ? new wt({ config: e.agent }) : void 0), a = Z();
2650
+ return Jt(async () => {
2596
2651
  if (e.agent) {
2597
2652
  t.debug("Agent provided via props, skipping fetch", {
2598
2653
  agentId: e.agent.agentId,
@@ -2618,7 +2673,7 @@ const Yr = { class: "@container/chat flex flex-col h-full relative" }, Zr = {
2618
2673
  try {
2619
2674
  s.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2620
2675
  const o = await n.getPublicAgent({ handle: e.handle });
2621
- o ? (r.value = new kt({ config: o }), t.debug("Successfully fetched public agent", {
2676
+ o ? (r.value = new wt({ config: o }), t.debug("Successfully fetched public agent", {
2622
2677
  agentId: o.agentId,
2623
2678
  handle: o.handle
2624
2679
  }), o.agentId && n.track({
@@ -2668,33 +2723,33 @@ const Yr = { class: "@container/chat flex flex-col h-full relative" }, Zr = {
2668
2723
  }
2669
2724
  });
2670
2725
  }
2671
- }), (o, c) => (A(), E("div", wi, [
2672
- s.value ? (A(), E("div", vi, [...c[0] || (c[0] = [
2673
- T("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2726
+ }), (o, c) => (S(), A("div", Si, [
2727
+ s.value ? (S(), A("div", Ai, [...c[0] || (c[0] = [
2728
+ w("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2674
2729
  ])])) : r.value ? Zn(o.$slots, "default", {
2675
2730
  key: 1,
2676
- sdk: Yt(n),
2731
+ sdk: Zt(n),
2677
2732
  agent: r.value,
2678
2733
  context: l.context,
2679
2734
  firstMessage: l.firstMessage,
2680
2735
  buttonText: l.buttonText,
2681
2736
  buttonIcon: l.buttonIcon,
2682
2737
  loading: s.value
2683
- }) : G("", !0)
2738
+ }) : U("", !0)
2684
2739
  ]));
2685
2740
  }
2686
2741
  });
2687
2742
  export {
2688
2743
  Mn as A,
2689
- Mi as _,
2690
- Ii as a,
2691
- Ci as b,
2692
- Ri as c,
2693
- Di as d,
2694
- In as e,
2744
+ Pi as _,
2745
+ Oi as a,
2746
+ Li as b,
2747
+ Mi as c,
2748
+ zi as d,
2749
+ Dn as e,
2695
2750
  $s as f,
2696
- Ei as g,
2751
+ Ii as g,
2697
2752
  zn as h,
2698
- _i as p
2753
+ Di as p
2699
2754
  };
2700
2755
  //# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map