@pagelines/sdk 1.0.419 → 1.0.421

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.
@@ -2,8 +2,8 @@ var Dn = Object.defineProperty;
2
2
  var ws = (l, t, e) => t in l ? Dn(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
3
3
  var u = (l, t) => Dn(l, "name", { value: t, configurable: !0 });
4
4
  var C = (l, t, e) => ws(l, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as Ee, openBlock as T, createElementBlock as S, createElementVNode as v, normalizeClass as y, ref as Y, watch as Je, computed as W, createCommentVNode as B, renderSlot as Yn, onMounted as Kt, Fragment as Te, renderList as gt, withDirectives as Zn, vModelText as Xn, unref as Vt, toDisplayString as ue, nextTick as Ut, createVNode as Bt, createTextVNode as ht, shallowRef as vs } from "vue";
6
- import { SettingsObject as ys, Agent as bt, getDefaultAvatarUrl as Kn, createLogger as Ts } from "@pagelines/core";
5
+ import { defineComponent as Ee, openBlock as A, createElementBlock as E, createElementVNode as T, normalizeClass as _, ref as V, watch as Je, computed as F, createCommentVNode as G, renderSlot as Yn, onMounted as Kt, Fragment as Te, renderList as mt, withDirectives as Zn, vModelText as Xn, unref as Vt, toDisplayString as ue, nextTick as Ut, createVNode as Bt, createTextVNode as pt, shallowRef as vs } from "vue";
6
+ import { SettingsObject as ys, Agent as kt, getDefaultAvatarUrl as Kn, 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",
@@ -15,10 +15,10 @@ const As = { class: "spinner max-w-sm" }, Es = {
15
15
  colorMode: { type: String, default: "primary" }
16
16
  },
17
17
  setup(l) {
18
- return (t, e) => (T(), S("div", As, [
19
- (T(), S("svg", Es, [
20
- v("circle", {
21
- class: y([l.colorMode, "ring-path"]),
18
+ return (t, e) => (A(), E("div", As, [
19
+ (A(), E("svg", Es, [
20
+ T("circle", {
21
+ class: _([l.colorMode, "ring-path"]),
22
22
  cx: "50",
23
23
  cy: "50",
24
24
  r: "20",
@@ -41,16 +41,16 @@ const As = { class: "spinner max-w-sm" }, Es = {
41
41
  C(this, "isConnecting", !1);
42
42
  // Chat conversation tracking (server-managed persistence)
43
43
  C(this, "conversationId");
44
- C(this, "textState", Y({
44
+ C(this, "textState", V({
45
45
  isActive: !1,
46
46
  isConnected: !1,
47
47
  isThinking: !1,
48
48
  connectionStatus: "disconnected"
49
49
  }));
50
- C(this, "agentMode", Y("self"));
51
- C(this, "sharedMessages", Y([]));
50
+ C(this, "agentMode", V("self"));
51
+ C(this, "sharedMessages", V([]));
52
52
  C(this, "_agent");
53
- this._agent = e.agent instanceof bt ? e.agent : new bt({ config: e.agent }), this.setupModeWatcher();
53
+ this._agent = e.agent instanceof kt ? e.agent : new kt({ config: e.agent }), this.setupModeWatcher();
54
54
  }
55
55
  get chatEnabled() {
56
56
  return this._agent.chatAvailable.value;
@@ -165,39 +165,39 @@ Current User:
165
165
  this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
166
166
  const a = `stream-${Date.now()}`;
167
167
  let o = !1;
168
- const c = /* @__PURE__ */ u((m) => {
168
+ const c = /* @__PURE__ */ u((g) => {
169
169
  o || (o = !0, this.sharedMessages.value = [
170
170
  ...this.sharedMessages.value,
171
171
  { id: a, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
172
172
  ]);
173
- const f = this.sharedMessages.value, k = f[f.length - 1];
174
- k?.id === a && (k.text += m, this.sharedMessages.value = [...f]);
175
- }, "onDelta"), d = /* @__PURE__ */ u((m) => {
176
- const f = this.sharedMessages.value, k = f[f.length - 1];
177
- if (k?.id === a && k.text) {
178
- let _ = k.text;
173
+ const m = this.sharedMessages.value, y = m[m.length - 1];
174
+ y?.id === a && (y.text += g, this.sharedMessages.value = [...m]);
175
+ }, "onDelta"), d = /* @__PURE__ */ u((g) => {
176
+ const m = this.sharedMessages.value, y = m[m.length - 1];
177
+ if (y?.id === a && y.text) {
178
+ let S = y.text;
179
179
  for (const O of _s)
180
- O.pattern.test(_) && (console.debug(`[chat] filtered directive: ${O.label}`), _ = _.replace(O.pattern, "").trim(), O.pattern.lastIndex = 0);
181
- _ ? _ !== k.text && (k.text = _, this.sharedMessages.value = [...f]) : this.sharedMessages.value = f.slice(0, -1);
182
- }
183
- m && (this.conversationId = m), this.updateState(this.textState, { isThinking: !1 });
184
- }, "onDone"), g = /* @__PURE__ */ u((m) => {
185
- const f = this.sharedMessages.value, k = f[f.length - 1];
186
- k?.id === a && !k.text && (this.sharedMessages.value = f.slice(0, -1));
187
- const _ = this.mapChatError(m);
188
- this.isTransientError(m) ? (this.addMessage(_, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(_));
189
- }, "onError"), p = /* @__PURE__ */ u((m) => {
190
- this.addMessage(m, "system");
180
+ O.pattern.test(S) && (console.debug(`[chat] filtered directive: ${O.label}`), S = S.replace(O.pattern, "").trim(), O.pattern.lastIndex = 0);
181
+ S ? S !== y.text && (y.text = S, this.sharedMessages.value = [...m]) : this.sharedMessages.value = m.slice(0, -1);
182
+ }
183
+ g && (this.conversationId = g), this.updateState(this.textState, { isThinking: !1 });
184
+ }, "onDone"), f = /* @__PURE__ */ u((g) => {
185
+ const m = this.sharedMessages.value, y = m[m.length - 1];
186
+ y?.id === a && !y.text && (this.sharedMessages.value = m.slice(0, -1));
187
+ const S = this.mapChatError(g);
188
+ this.isTransientError(g) ? (this.addMessage(S, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(S));
189
+ }, "onError"), p = /* @__PURE__ */ u((g) => {
190
+ this.addMessage(g, "system");
191
191
  }, "onStatus");
192
192
  try {
193
- const m = s ? s({
193
+ const g = s ? s({
194
194
  message: e,
195
195
  attachments: n,
196
196
  conversationId: this.conversationId,
197
197
  history: this.buildHistory(),
198
198
  onDelta: c,
199
199
  onDone: d,
200
- onError: g,
200
+ onError: f,
201
201
  onStatus: p
202
202
  }) : r.chatStream({
203
203
  handle: this._agent.handle.value,
@@ -209,15 +209,15 @@ Current User:
209
209
  context: this.getDynamicSettings().context || void 0,
210
210
  onDelta: c,
211
211
  onDone: d,
212
- onError: g,
212
+ onError: f,
213
213
  onStatus: p
214
214
  });
215
215
  await Promise.race([
216
- m,
217
- new Promise((f, k) => setTimeout(() => k(new Error("timed out")), Rs))
216
+ g,
217
+ new Promise((m, y) => setTimeout(() => y(new Error("timed out")), Rs))
218
218
  ]);
219
- } catch (m) {
220
- g(m.message || "Something went wrong");
219
+ } catch (g) {
220
+ f(g.message || "Something went wrong");
221
221
  }
222
222
  }
223
223
  buildHistory() {
@@ -274,38 +274,38 @@ const Ds = {
274
274
  iconAfter: {}
275
275
  },
276
276
  setup(l) {
277
- const t = W(() => ({
277
+ const t = F(() => ({
278
278
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
279
279
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
280
280
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
281
281
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
282
- })[l.theme]), e = W(() => ({
282
+ })[l.theme]), e = F(() => ({
283
283
  sm: "px-4 py-2 text-sm",
284
284
  md: "px-6 py-3 text-base",
285
285
  lg: "px-8 py-4 text-base"
286
- })[l.size]), n = W(() => ({
286
+ })[l.size]), n = F(() => ({
287
287
  sm: "size-4",
288
288
  md: "size-4",
289
289
  lg: "size-5"
290
290
  })[l.size]);
291
- return (s, r) => (T(), S("button", {
292
- class: y(["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]])
291
+ return (s, r) => (A(), E("button", {
292
+ 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]])
293
293
  }, [
294
- l.loading ? (T(), S("div", Ds, [...r[0] || (r[0] = [
295
- v("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
296
- ])])) : B("", !0),
297
- v("span", {
298
- class: y(["flex items-center gap-2 transition-opacity duration-200", l.loading ? "opacity-0" : "opacity-100"])
294
+ l.loading ? (A(), E("div", Ds, [...r[0] || (r[0] = [
295
+ T("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
296
+ ])])) : G("", !0),
297
+ T("span", {
298
+ class: _(["flex items-center gap-2 transition-opacity duration-200", l.loading ? "opacity-0" : "opacity-100"])
299
299
  }, [
300
- l.icon ? (T(), S("i", {
300
+ l.icon ? (A(), E("i", {
301
301
  key: 0,
302
- class: y([l.icon, n.value])
303
- }, null, 2)) : B("", !0),
302
+ class: _([l.icon, n.value])
303
+ }, null, 2)) : G("", !0),
304
304
  Yn(s.$slots, "default"),
305
- l.iconAfter ? (T(), S("i", {
305
+ l.iconAfter ? (A(), E("i", {
306
306
  key: 1,
307
- class: y([l.iconAfter, n.value])
308
- }, null, 2)) : B("", !0)
307
+ class: _([l.iconAfter, n.value])
308
+ }, null, 2)) : G("", !0)
309
309
  ], 2)
310
310
  ], 2));
311
311
  }
@@ -317,7 +317,7 @@ const Ds = {
317
317
  emits: ["update:modelValue"],
318
318
  setup(l, { emit: t }) {
319
319
  const e = t;
320
- return (n, s) => (T(), S("input", {
320
+ return (n, s) => (A(), E("input", {
321
321
  type: "email",
322
322
  autocomplete: "email",
323
323
  placeholder: "Enter Your Email",
@@ -336,7 +336,7 @@ const Ds = {
336
336
  },
337
337
  emits: ["update:modelValue", "autoSubmit"],
338
338
  setup(l, { emit: t }) {
339
- const e = l, n = t, s = Y([]), r = Y(Array.from({ length: e.length }).fill("")), a = Y(!1);
339
+ const e = l, n = t, s = V([]), r = V(Array.from({ length: e.length }).fill("")), a = V(!1);
340
340
  Kt(() => {
341
341
  e.modelValue && (r.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && s.value[0]?.focus();
342
342
  }), Je(() => e.modelValue, (p) => {
@@ -345,57 +345,57 @@ const Ds = {
345
345
  const p = r.value.filter(Boolean).join("");
346
346
  n("update:modelValue", p), p.length === e.length && n("autoSubmit", p);
347
347
  }, { deep: !0 });
348
- function o(p, m) {
349
- m.preventDefault(), a.value = !0;
350
- const f = (m.clipboardData?.getData("text") || "").replace(/\D/g, "");
351
- if (f.length === e.length)
352
- r.value = f.split(""), setTimeout(() => {
348
+ function o(p, g) {
349
+ g.preventDefault(), a.value = !0;
350
+ const m = (g.clipboardData?.getData("text") || "").replace(/\D/g, "");
351
+ if (m.length === e.length)
352
+ r.value = m.split(""), setTimeout(() => {
353
353
  s.value[e.length - 1]?.focus(), a.value = !1;
354
354
  }, 10);
355
355
  else {
356
- const k = [...r.value];
357
- f.split("").slice(0, e.length - p).forEach((O, ee) => {
358
- k[p + ee] = O;
359
- }), r.value = k;
360
- const _ = Math.min(p + f.length, e.length - 1);
356
+ const y = [...r.value];
357
+ m.split("").slice(0, e.length - p).forEach((O, ge) => {
358
+ y[p + ge] = O;
359
+ }), r.value = y;
360
+ const S = Math.min(p + m.length, e.length - 1);
361
361
  setTimeout(() => {
362
- s.value[_]?.focus(), a.value = !1;
362
+ s.value[S]?.focus(), a.value = !1;
363
363
  }, 10);
364
364
  }
365
365
  }
366
366
  u(o, "onPaste");
367
- function c(p, m) {
368
- const f = m.target.value.slice(-1).replace(/\D/g, "");
369
- r.value[p] = f, f && p < e.length - 1 && s.value[p + 1]?.focus();
367
+ function c(p, g) {
368
+ const m = g.target.value.slice(-1).replace(/\D/g, "");
369
+ r.value[p] = m, m && p < e.length - 1 && s.value[p + 1]?.focus();
370
370
  }
371
371
  u(c, "onInput");
372
- function d(p, m) {
373
- m.key === "Backspace" ? (m.preventDefault(), r.value[p] = "", p > 0 && s.value[p - 1]?.focus()) : m.key === "ArrowLeft" && p > 0 ? s.value[p - 1]?.focus() : m.key === "ArrowRight" && p < e.length - 1 && s.value[p + 1]?.focus();
372
+ function d(p, g) {
373
+ g.key === "Backspace" ? (g.preventDefault(), r.value[p] = "", p > 0 && s.value[p - 1]?.focus()) : g.key === "ArrowLeft" && p > 0 ? s.value[p - 1]?.focus() : g.key === "ArrowRight" && p < e.length - 1 && s.value[p + 1]?.focus();
374
374
  }
375
375
  u(d, "onKeydown");
376
- function g(p) {
376
+ function f(p) {
377
377
  if (s.value[p]?.select(), !a.value && r.value[p])
378
- for (let m = p; m < e.length; m++)
379
- r.value[m] = "";
378
+ for (let g = p; g < e.length; g++)
379
+ r.value[g] = "";
380
380
  }
381
- return u(g, "onFocus"), (p, m) => (T(), S("div", Is, [
382
- (T(!0), S(Te, null, gt(l.length, (f) => Zn((T(), S("input", {
383
- key: f,
381
+ return u(f, "onFocus"), (p, g) => (A(), E("div", Is, [
382
+ (A(!0), E(Te, null, mt(l.length, (m) => Zn((A(), E("input", {
383
+ key: m,
384
384
  ref_for: !0,
385
- ref: /* @__PURE__ */ u((k) => s.value[f - 1] = k, "ref"),
386
- "onUpdate:modelValue": /* @__PURE__ */ u((k) => r.value[f - 1] = k, "onUpdate:modelValue"),
385
+ ref: /* @__PURE__ */ u((y) => s.value[m - 1] = y, "ref"),
386
+ "onUpdate:modelValue": /* @__PURE__ */ u((y) => r.value[m - 1] = y, "onUpdate:modelValue"),
387
387
  type: "text",
388
388
  inputmode: "numeric",
389
389
  autocomplete: "one-time-code",
390
390
  class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
391
391
  style: { "font-size": "16px" },
392
392
  maxlength: "1",
393
- onInput: /* @__PURE__ */ u((k) => c(f - 1, k), "onInput"),
394
- onKeydown: /* @__PURE__ */ u((k) => d(f - 1, k), "onKeydown"),
395
- onPaste: /* @__PURE__ */ u((k) => o(f - 1, k), "onPaste"),
396
- onFocus: /* @__PURE__ */ u((k) => g(f - 1), "onFocus")
393
+ onInput: /* @__PURE__ */ u((y) => c(m - 1, y), "onInput"),
394
+ onKeydown: /* @__PURE__ */ u((y) => d(m - 1, y), "onKeydown"),
395
+ onPaste: /* @__PURE__ */ u((y) => o(m - 1, y), "onPaste"),
396
+ onFocus: /* @__PURE__ */ u((y) => f(m - 1), "onFocus")
397
397
  }, null, 40, Ms)), [
398
- [Xn, r.value[f - 1]]
398
+ [Xn, r.value[m - 1]]
399
399
  ])), 128))
400
400
  ]));
401
401
  }
@@ -411,16 +411,16 @@ const Ds = {
411
411
  layout: { default: "centered" }
412
412
  },
413
413
  setup(l) {
414
- return (t, e) => (T(), S("div", {
415
- class: y(["flex gap-4", [
414
+ return (t, e) => (A(), E("div", {
415
+ class: _(["flex gap-4", [
416
416
  l.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
417
417
  ]])
418
418
  }, [
419
- v("div", Ls, [
420
- v("div", {
421
- class: y(["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"])
419
+ T("div", Ls, [
420
+ T("div", {
421
+ 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"])
422
422
  }, [
423
- v("img", {
423
+ T("img", {
424
424
  src: l.agent.avatarUrl.value,
425
425
  alt: l.agent.displayName.value,
426
426
  class: "w-full h-full object-cover",
@@ -428,25 +428,25 @@ const Ds = {
428
428
  (...n) => Vt(Ln) && Vt(Ln)(...n))
429
429
  }, null, 40, zs)
430
430
  ], 2),
431
- v("div", Os, [
432
- l.isOnline ? (T(), S(Te, { key: 0 }, [
433
- e[1] || (e[1] = v("div", {
431
+ T("div", Os, [
432
+ l.isOnline ? (A(), E(Te, { key: 0 }, [
433
+ e[1] || (e[1] = T("div", {
434
434
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
435
435
  style: { "animation-duration": "3s" }
436
436
  }, null, -1)),
437
- e[2] || (e[2] = v("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
438
- ], 64)) : (T(), S("div", Ns))
437
+ e[2] || (e[2] = T("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
438
+ ], 64)) : (A(), E("div", Ns))
439
439
  ])
440
440
  ]),
441
- v("div", Ps, [
442
- v("h1", {
443
- class: y(["font-light text-white mb-1 truncate", [
441
+ T("div", Ps, [
442
+ T("h1", {
443
+ class: _(["font-light text-white mb-1 truncate", [
444
444
  l.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
445
445
  l.layout === "horizontal" ? "text-white/95" : ""
446
446
  ]])
447
447
  }, ue(l.agent.displayName.value), 3),
448
- v("p", {
449
- class: y(["font-light line-clamp-1", [
448
+ T("p", {
449
+ class: _(["font-light line-clamp-1", [
450
450
  l.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
451
451
  l.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
452
452
  ]])
@@ -463,14 +463,14 @@ const {
463
463
  getOwnPropertyDescriptor: Fs
464
464
  } = Object;
465
465
  let {
466
- freeze: X,
466
+ freeze: Z,
467
467
  seal: te,
468
- create: mt
468
+ create: xt
469
469
  } = Object, {
470
470
  apply: Yt,
471
471
  construct: Zt
472
472
  } = typeof Reflect < "u" && Reflect;
473
- X || (X = /* @__PURE__ */ u(function(t) {
473
+ Z || (Z = /* @__PURE__ */ u(function(t) {
474
474
  return t;
475
475
  }, "freeze"));
476
476
  te || (te = /* @__PURE__ */ u(function(t) {
@@ -486,8 +486,8 @@ Zt || (Zt = /* @__PURE__ */ u(function(t) {
486
486
  n[s - 1] = arguments[s];
487
487
  return new t(...n);
488
488
  }, "construct"));
489
- const pt = K(Array.prototype.forEach), Hs = K(Array.prototype.lastIndexOf), On = K(Array.prototype.pop), je = K(Array.prototype.push), Gs = K(Array.prototype.splice), xt = K(String.prototype.toLowerCase), Ft = K(String.prototype.toString), Ht = K(String.prototype.match), qe = K(String.prototype.replace), Ws = K(String.prototype.indexOf), js = K(String.prototype.trim), J = K(Object.prototype.hasOwnProperty), V = K(RegExp.prototype.test), Ve = qs(TypeError);
490
- function K(l) {
489
+ const dt = X(Array.prototype.forEach), Hs = X(Array.prototype.lastIndexOf), On = X(Array.prototype.pop), je = X(Array.prototype.push), Gs = X(Array.prototype.splice), bt = X(String.prototype.toLowerCase), Ft = X(String.prototype.toString), Ht = X(String.prototype.match), qe = X(String.prototype.replace), Ws = X(String.prototype.indexOf), js = X(String.prototype.trim), Q = X(Object.prototype.hasOwnProperty), q = X(RegExp.prototype.test), Ve = qs(TypeError);
490
+ function X(l) {
491
491
  return function(t) {
492
492
  t instanceof RegExp && (t.lastIndex = 0);
493
493
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
@@ -495,7 +495,7 @@ function K(l) {
495
495
  return Yt(l, t, n);
496
496
  };
497
497
  }
498
- u(K, "unapply");
498
+ u(X, "unapply");
499
499
  function qs(l) {
500
500
  return function() {
501
501
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
@@ -504,8 +504,8 @@ function qs(l) {
504
504
  };
505
505
  }
506
506
  u(qs, "unconstruct");
507
- function D(l, t) {
508
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : xt;
507
+ function R(l, t) {
508
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : bt;
509
509
  zn && zn(l, null);
510
510
  let n = t.length;
511
511
  for (; n--; ) {
@@ -518,17 +518,17 @@ function D(l, t) {
518
518
  }
519
519
  return l;
520
520
  }
521
- u(D, "addToSet");
521
+ u(R, "addToSet");
522
522
  function Vs(l) {
523
523
  for (let t = 0; t < l.length; t++)
524
- J(l, t) || (l[t] = null);
524
+ Q(l, t) || (l[t] = null);
525
525
  return l;
526
526
  }
527
527
  u(Vs, "cleanArray");
528
528
  function oe(l) {
529
- const t = mt(null);
529
+ const t = xt(null);
530
530
  for (const [e, n] of Qn(l))
531
- J(l, e) && (Array.isArray(n) ? t[e] = Vs(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = oe(n) : t[e] = n);
531
+ Q(l, e) && (Array.isArray(n) ? t[e] = Vs(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = oe(n) : t[e] = n);
532
532
  return t;
533
533
  }
534
534
  u(oe, "clone");
@@ -537,9 +537,9 @@ function Ye(l, t) {
537
537
  const n = Fs(l, t);
538
538
  if (n) {
539
539
  if (n.get)
540
- return K(n.get);
540
+ return X(n.get);
541
541
  if (typeof n.value == "function")
542
- return K(n.value);
542
+ return X(n.value);
543
543
  }
544
544
  l = Bs(l);
545
545
  }
@@ -549,7 +549,7 @@ function Ye(l, t) {
549
549
  return u(e, "fallbackValue"), e;
550
550
  }
551
551
  u(Ye, "lookupGetter");
552
- const Nn = X(["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"]), Gt = X(["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"]), Wt = X(["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 = X(["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"]), jt = X(["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 = X(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Pn = X(["#text"]), $n = X(["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"]), qt = X(["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"]), Un = X(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), dt = X(["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]+$/), Jn = te(
552
+ 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"]), Gt = 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"]), Wt = 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"]), jt = 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"]), Pn = Z(["#text"]), $n = 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"]), qt = 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"]), Un = Z(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), ft = 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]+$/), Jn = te(
553
553
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
554
554
  // eslint-disable-line no-useless-escape
555
555
  ), tr = te(/^(?:\w+script|data):/i), nr = te(
@@ -624,43 +624,43 @@ function ts() {
624
624
  Node: o,
625
625
  Element: c,
626
626
  NodeFilter: d,
627
- NamedNodeMap: g = l.NamedNodeMap || l.MozNamedAttrMap,
627
+ NamedNodeMap: f = l.NamedNodeMap || l.MozNamedAttrMap,
628
628
  HTMLFormElement: p,
629
- DOMParser: m,
630
- trustedTypes: f
631
- } = l, k = c.prototype, _ = Ye(k, "cloneNode"), O = Ye(k, "remove"), ee = Ye(k, "nextSibling"), Re = Ye(k, "childNodes"), ne = Ye(k, "parentNode");
629
+ DOMParser: g,
630
+ trustedTypes: m
631
+ } = l, y = c.prototype, S = Ye(y, "cloneNode"), O = Ye(y, "remove"), ge = Ye(y, "nextSibling"), me = Ye(y, "childNodes"), ne = Ye(y, "parentNode");
632
632
  if (typeof a == "function") {
633
633
  const w = e.createElement("template");
634
634
  w.content && w.content.ownerDocument && (e = w.content.ownerDocument);
635
635
  }
636
- let P, he = "";
636
+ let $, j = "";
637
637
  const {
638
- implementation: q,
639
- createNodeIterator: se,
640
- createDocumentFragment: St,
641
- getElementsByTagName: tt
638
+ implementation: se,
639
+ createNodeIterator: he,
640
+ createDocumentFragment: tt,
641
+ getElementsByTagName: L
642
642
  } = e, {
643
643
  importNode: nt
644
644
  } = n;
645
- let F = Fn();
646
- t.isSupported = typeof Qn == "function" && typeof ne == "function" && q && q.createHTMLDocument !== void 0;
645
+ let U = Fn();
646
+ t.isSupported = typeof Qn == "function" && typeof ne == "function" && se && se.createHTMLDocument !== void 0;
647
647
  const {
648
- MUSTACHE_EXPR: De,
648
+ MUSTACHE_EXPR: Re,
649
649
  ERB_EXPR: Fe,
650
- TMPLIT_EXPR: M,
650
+ TMPLIT_EXPR: De,
651
651
  DATA_ATTR: At,
652
652
  ARIA_ATTR: Et,
653
653
  IS_SCRIPT_OR_DATA: _t,
654
- ATTR_WHITESPACE: He,
655
- CUSTOM_ELEMENT: st
654
+ ATTR_WHITESPACE: st,
655
+ CUSTOM_ELEMENT: rt
656
656
  } = Bn;
657
657
  let {
658
- IS_ALLOWED_URI: E
659
- } = Bn, x = null;
660
- const R = D({}, [...Nn, ...Gt, ...Wt, ...jt, ...Pn]);
661
- let A = null;
662
- const H = D({}, [...$n, ...qt, ...Un, ...dt]);
663
- let z = Object.seal(mt(null, {
658
+ IS_ALLOWED_URI: He
659
+ } = Bn, b = null;
660
+ const v = R({}, [...Nn, ...Gt, ...Wt, ...jt, ...Pn]);
661
+ let k = null;
662
+ const z = R({}, [...$n, ...qt, ...Un, ...ft]);
663
+ let D = Object.seal(xt(null, {
664
664
  tagNameCheck: {
665
665
  writable: !0,
666
666
  configurable: !1,
@@ -679,8 +679,8 @@ function ts() {
679
679
  enumerable: !0,
680
680
  value: !1
681
681
  }
682
- })), ge = null, me = null;
683
- const xe = Object.seal(mt(null, {
682
+ })), J = null, we = null;
683
+ const ee = Object.seal(xt(null, {
684
684
  tagCheck: {
685
685
  writable: !0,
686
686
  configurable: !1,
@@ -694,45 +694,45 @@ function ts() {
694
694
  value: null
695
695
  }
696
696
  }));
697
- let cn = !0, Rt = !0, un = !1, hn = !0, Ce = !1, rt = !0, ve = !1, Dt = !1, Ct = !1, Ie = !1, it = !1, at = !1, pn = !0, dn = !1;
697
+ let cn = !0, Rt = !0, un = !1, hn = !0, Ce = !1, it = !0, ve = !1, Dt = !1, Ct = !1, Ie = !1, at = !1, lt = !1, pn = !0, dn = !1;
698
698
  const ps = "user-content-";
699
699
  let It = !0, Ge = !1, Me = {}, ae = null;
700
- const Mt = D({}, ["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"]);
700
+ 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"]);
701
701
  let fn = null;
702
- const gn = D({}, ["audio", "video", "img", "source", "image", "track"]);
702
+ const gn = R({}, ["audio", "video", "img", "source", "image", "track"]);
703
703
  let Lt = null;
704
- const mn = D({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), lt = "http://www.w3.org/1998/Math/MathML", ot = "http://www.w3.org/2000/svg", pe = "http://www.w3.org/1999/xhtml";
704
+ const mn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ot = "http://www.w3.org/1998/Math/MathML", ct = "http://www.w3.org/2000/svg", pe = "http://www.w3.org/1999/xhtml";
705
705
  let Le = pe, zt = !1, Ot = null;
706
- const ds = D({}, [lt, ot, pe], Ft);
707
- let ct = D({}, ["mi", "mo", "mn", "ms", "mtext"]), ut = D({}, ["annotation-xml"]);
708
- const fs = D({}, ["title", "style", "font", "a", "script"]);
706
+ const ds = R({}, [ot, ct, pe], Ft);
707
+ let ut = R({}, ["mi", "mo", "mn", "ms", "mtext"]), ht = R({}, ["annotation-xml"]);
708
+ const fs = R({}, ["title", "style", "font", "a", "script"]);
709
709
  let We = null;
710
710
  const gs = ["application/xhtml+xml", "text/html"], ms = "text/html";
711
- let U = null, ze = null;
711
+ let B = null, ze = null;
712
712
  const xs = e.createElement("form"), xn = /* @__PURE__ */ u(function(i) {
713
713
  return i instanceof RegExp || i instanceof Function;
714
714
  }, "isRegexOrFunction"), Nt = /* @__PURE__ */ u(function() {
715
715
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
716
716
  if (!(ze && ze === i)) {
717
717
  if ((!i || typeof i != "object") && (i = {}), i = oe(i), We = // eslint-disable-next-line unicorn/prefer-includes
718
- gs.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? ms : i.PARSER_MEDIA_TYPE, U = We === "application/xhtml+xml" ? Ft : xt, x = J(i, "ALLOWED_TAGS") ? D({}, i.ALLOWED_TAGS, U) : R, A = J(i, "ALLOWED_ATTR") ? D({}, i.ALLOWED_ATTR, U) : H, Ot = J(i, "ALLOWED_NAMESPACES") ? D({}, i.ALLOWED_NAMESPACES, Ft) : ds, Lt = J(i, "ADD_URI_SAFE_ATTR") ? D(oe(mn), i.ADD_URI_SAFE_ATTR, U) : mn, fn = J(i, "ADD_DATA_URI_TAGS") ? D(oe(gn), i.ADD_DATA_URI_TAGS, U) : gn, ae = J(i, "FORBID_CONTENTS") ? D({}, i.FORBID_CONTENTS, U) : Mt, ge = J(i, "FORBID_TAGS") ? D({}, i.FORBID_TAGS, U) : oe({}), me = J(i, "FORBID_ATTR") ? D({}, i.FORBID_ATTR, U) : oe({}), Me = J(i, "USE_PROFILES") ? i.USE_PROFILES : !1, cn = i.ALLOW_ARIA_ATTR !== !1, Rt = i.ALLOW_DATA_ATTR !== !1, un = i.ALLOW_UNKNOWN_PROTOCOLS || !1, hn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ce = i.SAFE_FOR_TEMPLATES || !1, rt = i.SAFE_FOR_XML !== !1, ve = i.WHOLE_DOCUMENT || !1, Ie = i.RETURN_DOM || !1, it = i.RETURN_DOM_FRAGMENT || !1, at = i.RETURN_TRUSTED_TYPE || !1, Ct = i.FORCE_BODY || !1, pn = i.SANITIZE_DOM !== !1, dn = i.SANITIZE_NAMED_PROPS || !1, It = i.KEEP_CONTENT !== !1, Ge = i.IN_PLACE || !1, E = i.ALLOWED_URI_REGEXP || Jn, Le = i.NAMESPACE || pe, ct = i.MATHML_TEXT_INTEGRATION_POINTS || ct, ut = i.HTML_INTEGRATION_POINTS || ut, z = i.CUSTOM_ELEMENT_HANDLING || {}, i.CUSTOM_ELEMENT_HANDLING && xn(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (z.tagNameCheck = i.CUSTOM_ELEMENT_HANDLING.tagNameCheck), i.CUSTOM_ELEMENT_HANDLING && xn(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (z.attributeNameCheck = i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ce && (Rt = !1), it && (Ie = !0), Me && (x = D({}, Pn), A = mt(null), Me.html === !0 && (D(x, Nn), D(A, $n)), Me.svg === !0 && (D(x, Gt), D(A, qt), D(A, dt)), Me.svgFilters === !0 && (D(x, Wt), D(A, qt), D(A, dt)), Me.mathMl === !0 && (D(x, jt), D(A, Un), D(A, dt))), J(i, "ADD_TAGS") || (xe.tagCheck = null), J(i, "ADD_ATTR") || (xe.attributeCheck = null), i.ADD_TAGS && (typeof i.ADD_TAGS == "function" ? xe.tagCheck = i.ADD_TAGS : (x === R && (x = oe(x)), D(x, i.ADD_TAGS, U))), i.ADD_ATTR && (typeof i.ADD_ATTR == "function" ? xe.attributeCheck = i.ADD_ATTR : (A === H && (A = oe(A)), D(A, i.ADD_ATTR, U))), i.ADD_URI_SAFE_ATTR && D(Lt, i.ADD_URI_SAFE_ATTR, U), i.FORBID_CONTENTS && (ae === Mt && (ae = oe(ae)), D(ae, i.FORBID_CONTENTS, U)), i.ADD_FORBID_CONTENTS && (ae === Mt && (ae = oe(ae)), D(ae, i.ADD_FORBID_CONTENTS, U)), It && (x["#text"] = !0), ve && D(x, ["html", "head", "body"]), x.table && (D(x, ["tbody"]), delete ge.tbody), i.TRUSTED_TYPES_POLICY) {
718
+ gs.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? ms : i.PARSER_MEDIA_TYPE, B = We === "application/xhtml+xml" ? Ft : bt, b = Q(i, "ALLOWED_TAGS") ? R({}, i.ALLOWED_TAGS, B) : v, k = Q(i, "ALLOWED_ATTR") ? R({}, i.ALLOWED_ATTR, B) : z, Ot = Q(i, "ALLOWED_NAMESPACES") ? R({}, i.ALLOWED_NAMESPACES, Ft) : ds, Lt = Q(i, "ADD_URI_SAFE_ATTR") ? R(oe(mn), i.ADD_URI_SAFE_ATTR, B) : mn, fn = Q(i, "ADD_DATA_URI_TAGS") ? R(oe(gn), i.ADD_DATA_URI_TAGS, B) : gn, ae = Q(i, "FORBID_CONTENTS") ? R({}, i.FORBID_CONTENTS, B) : Mt, J = Q(i, "FORBID_TAGS") ? R({}, i.FORBID_TAGS, B) : oe({}), we = Q(i, "FORBID_ATTR") ? R({}, i.FORBID_ATTR, B) : oe({}), Me = Q(i, "USE_PROFILES") ? i.USE_PROFILES : !1, cn = i.ALLOW_ARIA_ATTR !== !1, Rt = i.ALLOW_DATA_ATTR !== !1, un = i.ALLOW_UNKNOWN_PROTOCOLS || !1, hn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ce = i.SAFE_FOR_TEMPLATES || !1, it = i.SAFE_FOR_XML !== !1, ve = i.WHOLE_DOCUMENT || !1, Ie = i.RETURN_DOM || !1, at = i.RETURN_DOM_FRAGMENT || !1, lt = i.RETURN_TRUSTED_TYPE || !1, Ct = i.FORCE_BODY || !1, pn = i.SANITIZE_DOM !== !1, dn = i.SANITIZE_NAMED_PROPS || !1, It = i.KEEP_CONTENT !== !1, Ge = i.IN_PLACE || !1, He = i.ALLOWED_URI_REGEXP || Jn, Le = i.NAMESPACE || pe, ut = i.MATHML_TEXT_INTEGRATION_POINTS || ut, ht = i.HTML_INTEGRATION_POINTS || ht, D = i.CUSTOM_ELEMENT_HANDLING || {}, i.CUSTOM_ELEMENT_HANDLING && xn(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (D.tagNameCheck = i.CUSTOM_ELEMENT_HANDLING.tagNameCheck), i.CUSTOM_ELEMENT_HANDLING && xn(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (D.attributeNameCheck = i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (D.allowCustomizedBuiltInElements = i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ce && (Rt = !1), at && (Ie = !0), Me && (b = R({}, Pn), k = xt(null), Me.html === !0 && (R(b, Nn), R(k, $n)), Me.svg === !0 && (R(b, Gt), R(k, qt), R(k, ft)), Me.svgFilters === !0 && (R(b, Wt), R(k, qt), R(k, ft)), Me.mathMl === !0 && (R(b, jt), R(k, Un), R(k, ft))), Q(i, "ADD_TAGS") || (ee.tagCheck = null), Q(i, "ADD_ATTR") || (ee.attributeCheck = null), i.ADD_TAGS && (typeof i.ADD_TAGS == "function" ? ee.tagCheck = i.ADD_TAGS : (b === v && (b = oe(b)), R(b, i.ADD_TAGS, B))), i.ADD_ATTR && (typeof i.ADD_ATTR == "function" ? ee.attributeCheck = i.ADD_ATTR : (k === z && (k = oe(k)), R(k, i.ADD_ATTR, B))), i.ADD_URI_SAFE_ATTR && R(Lt, i.ADD_URI_SAFE_ATTR, B), i.FORBID_CONTENTS && (ae === Mt && (ae = oe(ae)), R(ae, i.FORBID_CONTENTS, B)), i.ADD_FORBID_CONTENTS && (ae === Mt && (ae = oe(ae)), R(ae, i.ADD_FORBID_CONTENTS, B)), It && (b["#text"] = !0), ve && R(b, ["html", "head", "body"]), b.table && (R(b, ["tbody"]), delete J.tbody), i.TRUSTED_TYPES_POLICY) {
719
719
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
720
720
  throw Ve('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
721
721
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
722
722
  throw Ve('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
723
- P = i.TRUSTED_TYPES_POLICY, he = P.createHTML("");
723
+ $ = i.TRUSTED_TYPES_POLICY, j = $.createHTML("");
724
724
  } else
725
- P === void 0 && (P = ir(f, s)), P !== null && typeof he == "string" && (he = P.createHTML(""));
726
- X && X(i), ze = i;
725
+ $ === void 0 && ($ = ir(m, s)), $ !== null && typeof j == "string" && (j = $.createHTML(""));
726
+ Z && Z(i), ze = i;
727
727
  }
728
- }, "_parseConfig"), bn = D({}, [...Gt, ...Wt, ...Ys]), kn = D({}, [...jt, ...Zs]), bs = /* @__PURE__ */ u(function(i) {
728
+ }, "_parseConfig"), bn = R({}, [...Gt, ...Wt, ...Ys]), kn = R({}, [...jt, ...Zs]), bs = /* @__PURE__ */ u(function(i) {
729
729
  let h = ne(i);
730
730
  (!h || !h.tagName) && (h = {
731
731
  namespaceURI: Le,
732
732
  tagName: "template"
733
733
  });
734
- const b = xt(i.tagName), N = xt(h.tagName);
735
- return Ot[i.namespaceURI] ? i.namespaceURI === ot ? h.namespaceURI === pe ? b === "svg" : h.namespaceURI === lt ? b === "svg" && (N === "annotation-xml" || ct[N]) : !!bn[b] : i.namespaceURI === lt ? h.namespaceURI === pe ? b === "math" : h.namespaceURI === ot ? b === "math" && ut[N] : !!kn[b] : i.namespaceURI === pe ? h.namespaceURI === ot && !ut[N] || h.namespaceURI === lt && !ct[N] ? !1 : !kn[b] && (fs[b] || !bn[b]) : !!(We === "application/xhtml+xml" && Ot[i.namespaceURI]) : !1;
734
+ const x = bt(i.tagName), N = bt(h.tagName);
735
+ return Ot[i.namespaceURI] ? i.namespaceURI === ct ? h.namespaceURI === pe ? x === "svg" : h.namespaceURI === ot ? x === "svg" && (N === "annotation-xml" || ut[N]) : !!bn[x] : i.namespaceURI === ot ? h.namespaceURI === pe ? x === "math" : h.namespaceURI === ct ? x === "math" && ht[N] : !!kn[x] : i.namespaceURI === pe ? h.namespaceURI === ct && !ht[N] || h.namespaceURI === ot && !ut[N] ? !1 : !kn[x] && (fs[x] || !bn[x]) : !!(We === "application/xhtml+xml" && Ot[i.namespaceURI]) : !1;
736
736
  }, "_checkValidNamespace"), le = /* @__PURE__ */ u(function(i) {
737
737
  je(t.removed, {
738
738
  element: i
@@ -755,7 +755,7 @@ function ts() {
755
755
  });
756
756
  }
757
757
  if (h.removeAttribute(i), i === "is")
758
- if (Ie || it)
758
+ if (Ie || at)
759
759
  try {
760
760
  le(h);
761
761
  } catch {
@@ -766,31 +766,31 @@ function ts() {
766
766
  } catch {
767
767
  }
768
768
  }, "_removeAttribute"), wn = /* @__PURE__ */ u(function(i) {
769
- let h = null, b = null;
769
+ let h = null, x = null;
770
770
  if (Ct)
771
771
  i = "<remove></remove>" + i;
772
772
  else {
773
- const $ = Ht(i, /^[\r\n\t ]+/);
774
- b = $ && $[0];
773
+ const P = Ht(i, /^[\r\n\t ]+/);
774
+ x = P && P[0];
775
775
  }
776
776
  We === "application/xhtml+xml" && Le === pe && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
777
- const N = P ? P.createHTML(i) : i;
777
+ const N = $ ? $.createHTML(i) : i;
778
778
  if (Le === pe)
779
779
  try {
780
- h = new m().parseFromString(N, We);
780
+ h = new g().parseFromString(N, We);
781
781
  } catch {
782
782
  }
783
783
  if (!h || !h.documentElement) {
784
- h = q.createDocument(Le, "template", null);
784
+ h = se.createDocument(Le, "template", null);
785
785
  try {
786
- h.documentElement.innerHTML = zt ? he : N;
786
+ h.documentElement.innerHTML = zt ? j : N;
787
787
  } catch {
788
788
  }
789
789
  }
790
- const j = h.body || h.documentElement;
791
- return i && b && j.insertBefore(e.createTextNode(b), j.childNodes[0] || null), Le === pe ? tt.call(h, ve ? "html" : "body")[0] : ve ? h.documentElement : j;
790
+ const W = h.body || h.documentElement;
791
+ return i && x && W.insertBefore(e.createTextNode(x), W.childNodes[0] || null), Le === pe ? L.call(h, ve ? "html" : "body")[0] : ve ? h.documentElement : W;
792
792
  }, "_initDocument"), vn = /* @__PURE__ */ u(function(i) {
793
- return se.call(
793
+ return he.call(
794
794
  i.ownerDocument || i,
795
795
  i,
796
796
  // eslint-disable-next-line no-bitwise
@@ -798,66 +798,66 @@ function ts() {
798
798
  null
799
799
  );
800
800
  }, "_createNodeIterator"), Pt = /* @__PURE__ */ u(function(i) {
801
- 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");
801
+ return i instanceof p && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof f) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
802
802
  }, "_isClobbered"), yn = /* @__PURE__ */ u(function(i) {
803
803
  return typeof o == "function" && i instanceof o;
804
804
  }, "_isNode");
805
805
  function de(w, i, h) {
806
- pt(w, (b) => {
807
- b.call(t, i, h, ze);
806
+ dt(w, (x) => {
807
+ x.call(t, i, h, ze);
808
808
  });
809
809
  }
810
810
  u(de, "_executeHooks");
811
811
  const Tn = /* @__PURE__ */ u(function(i) {
812
812
  let h = null;
813
- if (de(F.beforeSanitizeElements, i, null), Pt(i))
813
+ if (de(U.beforeSanitizeElements, i, null), Pt(i))
814
814
  return le(i), !0;
815
- const b = U(i.nodeName);
816
- if (de(F.uponSanitizeElement, i, {
817
- tagName: b,
818
- allowedTags: x
819
- }), rt && i.hasChildNodes() && !yn(i.firstElementChild) && V(/<[/\w!]/g, i.innerHTML) && V(/<[/\w!]/g, i.textContent) || i.nodeType === Ze.progressingInstruction || rt && i.nodeType === Ze.comment && V(/<[/\w]/g, i.data))
815
+ const x = B(i.nodeName);
816
+ if (de(U.uponSanitizeElement, i, {
817
+ tagName: x,
818
+ allowedTags: b
819
+ }), it && i.hasChildNodes() && !yn(i.firstElementChild) && q(/<[/\w!]/g, i.innerHTML) && q(/<[/\w!]/g, i.textContent) || i.nodeType === Ze.progressingInstruction || it && i.nodeType === Ze.comment && q(/<[/\w]/g, i.data))
820
820
  return le(i), !0;
821
- if (!(xe.tagCheck instanceof Function && xe.tagCheck(b)) && (!x[b] || ge[b])) {
822
- if (!ge[b] && An(b) && (z.tagNameCheck instanceof RegExp && V(z.tagNameCheck, b) || z.tagNameCheck instanceof Function && z.tagNameCheck(b)))
821
+ if (!(ee.tagCheck instanceof Function && ee.tagCheck(x)) && (!b[x] || J[x])) {
822
+ if (!J[x] && An(x) && (D.tagNameCheck instanceof RegExp && q(D.tagNameCheck, x) || D.tagNameCheck instanceof Function && D.tagNameCheck(x)))
823
823
  return !1;
824
- if (It && !ae[b]) {
825
- const N = ne(i) || i.parentNode, j = Re(i) || i.childNodes;
826
- if (j && N) {
827
- const $ = j.length;
828
- for (let Q = $ - 1; Q >= 0; --Q) {
829
- const fe = _(j[Q], !0);
830
- fe.__removalCount = (i.__removalCount || 0) + 1, N.insertBefore(fe, ee(i));
824
+ if (It && !ae[x]) {
825
+ const N = ne(i) || i.parentNode, W = me(i) || i.childNodes;
826
+ if (W && N) {
827
+ const P = W.length;
828
+ for (let K = P - 1; K >= 0; --K) {
829
+ const fe = S(W[K], !0);
830
+ fe.__removalCount = (i.__removalCount || 0) + 1, N.insertBefore(fe, ge(i));
831
831
  }
832
832
  }
833
833
  }
834
834
  return le(i), !0;
835
835
  }
836
- return i instanceof c && !bs(i) || (b === "noscript" || b === "noembed" || b === "noframes") && V(/<\/no(script|embed|frames)/i, i.innerHTML) ? (le(i), !0) : (Ce && i.nodeType === Ze.text && (h = i.textContent, pt([De, Fe, M], (N) => {
836
+ return i instanceof c && !bs(i) || (x === "noscript" || x === "noembed" || x === "noframes") && q(/<\/no(script|embed|frames)/i, i.innerHTML) ? (le(i), !0) : (Ce && i.nodeType === Ze.text && (h = i.textContent, dt([Re, Fe, De], (N) => {
837
837
  h = qe(h, N, " ");
838
838
  }), i.textContent !== h && (je(t.removed, {
839
839
  element: i.cloneNode()
840
- }), i.textContent = h)), de(F.afterSanitizeElements, i, null), !1);
841
- }, "_sanitizeElements"), Sn = /* @__PURE__ */ u(function(i, h, b) {
842
- if (me[h] || pn && (h === "id" || h === "name") && (b in e || b in xs))
840
+ }), i.textContent = h)), de(U.afterSanitizeElements, i, null), !1);
841
+ }, "_sanitizeElements"), Sn = /* @__PURE__ */ u(function(i, h, x) {
842
+ if (we[h] || pn && (h === "id" || h === "name") && (x in e || x in xs))
843
843
  return !1;
844
- if (!(Rt && !me[h] && V(At, h))) {
845
- if (!(cn && V(Et, h))) {
846
- if (!(xe.attributeCheck instanceof Function && xe.attributeCheck(h, i))) {
847
- if (!A[h] || me[h]) {
844
+ if (!(Rt && !we[h] && q(At, h))) {
845
+ if (!(cn && q(Et, h))) {
846
+ if (!(ee.attributeCheck instanceof Function && ee.attributeCheck(h, i))) {
847
+ if (!k[h] || we[h]) {
848
848
  if (
849
849
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
850
850
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
851
851
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
852
- !(An(i) && (z.tagNameCheck instanceof RegExp && V(z.tagNameCheck, i) || z.tagNameCheck instanceof Function && z.tagNameCheck(i)) && (z.attributeNameCheck instanceof RegExp && V(z.attributeNameCheck, h) || z.attributeNameCheck instanceof Function && z.attributeNameCheck(h, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
852
+ !(An(i) && (D.tagNameCheck instanceof RegExp && q(D.tagNameCheck, i) || D.tagNameCheck instanceof Function && D.tagNameCheck(i)) && (D.attributeNameCheck instanceof RegExp && q(D.attributeNameCheck, h) || D.attributeNameCheck instanceof Function && D.attributeNameCheck(h, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
853
853
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
854
- h === "is" && z.allowCustomizedBuiltInElements && (z.tagNameCheck instanceof RegExp && V(z.tagNameCheck, b) || z.tagNameCheck instanceof Function && z.tagNameCheck(b)))
854
+ h === "is" && D.allowCustomizedBuiltInElements && (D.tagNameCheck instanceof RegExp && q(D.tagNameCheck, x) || D.tagNameCheck instanceof Function && D.tagNameCheck(x)))
855
855
  ) return !1;
856
856
  } else if (!Lt[h]) {
857
- if (!V(E, qe(b, He, ""))) {
858
- if (!((h === "src" || h === "xlink:href" || h === "href") && i !== "script" && Ws(b, "data:") === 0 && fn[i])) {
859
- if (!(un && !V(_t, qe(b, He, "")))) {
860
- if (b)
857
+ if (!q(He, qe(x, st, ""))) {
858
+ if (!((h === "src" || h === "xlink:href" || h === "href") && i !== "script" && Ws(x, "data:") === 0 && fn[i])) {
859
+ if (!(un && !q(_t, qe(x, st, "")))) {
860
+ if (x)
861
861
  return !1;
862
862
  }
863
863
  }
@@ -868,83 +868,83 @@ function ts() {
868
868
  }
869
869
  return !0;
870
870
  }, "_isValidAttribute"), An = /* @__PURE__ */ u(function(i) {
871
- return i !== "annotation-xml" && Ht(i, st);
871
+ return i !== "annotation-xml" && Ht(i, rt);
872
872
  }, "_isBasicCustomElement"), En = /* @__PURE__ */ u(function(i) {
873
- de(F.beforeSanitizeAttributes, i, null);
873
+ de(U.beforeSanitizeAttributes, i, null);
874
874
  const {
875
875
  attributes: h
876
876
  } = i;
877
877
  if (!h || Pt(i))
878
878
  return;
879
- const b = {
879
+ const x = {
880
880
  attrName: "",
881
881
  attrValue: "",
882
882
  keepAttr: !0,
883
- allowedAttributes: A,
883
+ allowedAttributes: k,
884
884
  forceKeepAttr: void 0
885
885
  };
886
886
  let N = h.length;
887
887
  for (; N--; ) {
888
- const j = h[N], {
889
- name: $,
890
- namespaceURI: Q,
888
+ const W = h[N], {
889
+ name: P,
890
+ namespaceURI: K,
891
891
  value: fe
892
- } = j, Oe = U($), $t = fe;
893
- let G = $ === "value" ? $t : js($t);
894
- if (b.attrName = Oe, b.attrValue = G, b.keepAttr = !0, b.forceKeepAttr = void 0, de(F.uponSanitizeAttribute, i, b), G = b.attrValue, dn && (Oe === "id" || Oe === "name") && (ye($, i), G = ps + G), rt && V(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, G)) {
895
- ye($, i);
892
+ } = W, Oe = B(P), $t = fe;
893
+ let H = P === "value" ? $t : js($t);
894
+ if (x.attrName = Oe, x.attrValue = H, x.keepAttr = !0, x.forceKeepAttr = void 0, de(U.uponSanitizeAttribute, i, x), H = x.attrValue, dn && (Oe === "id" || Oe === "name") && (ye(P, i), H = ps + H), it && q(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, H)) {
895
+ ye(P, i);
896
896
  continue;
897
897
  }
898
- if (Oe === "attributename" && Ht(G, "href")) {
899
- ye($, i);
898
+ if (Oe === "attributename" && Ht(H, "href")) {
899
+ ye(P, i);
900
900
  continue;
901
901
  }
902
- if (b.forceKeepAttr)
902
+ if (x.forceKeepAttr)
903
903
  continue;
904
- if (!b.keepAttr) {
905
- ye($, i);
904
+ if (!x.keepAttr) {
905
+ ye(P, i);
906
906
  continue;
907
907
  }
908
- if (!hn && V(/\/>/i, G)) {
909
- ye($, i);
908
+ if (!hn && q(/\/>/i, H)) {
909
+ ye(P, i);
910
910
  continue;
911
911
  }
912
- Ce && pt([De, Fe, M], (Rn) => {
913
- G = qe(G, Rn, " ");
912
+ Ce && dt([Re, Fe, De], (Rn) => {
913
+ H = qe(H, Rn, " ");
914
914
  });
915
- const _n = U(i.nodeName);
916
- if (!Sn(_n, Oe, G)) {
917
- ye($, i);
915
+ const _n = B(i.nodeName);
916
+ if (!Sn(_n, Oe, H)) {
917
+ ye(P, i);
918
918
  continue;
919
919
  }
920
- if (P && typeof f == "object" && typeof f.getAttributeType == "function" && !Q)
921
- switch (f.getAttributeType(_n, Oe)) {
920
+ if ($ && typeof m == "object" && typeof m.getAttributeType == "function" && !K)
921
+ switch (m.getAttributeType(_n, Oe)) {
922
922
  case "TrustedHTML": {
923
- G = P.createHTML(G);
923
+ H = $.createHTML(H);
924
924
  break;
925
925
  }
926
926
  case "TrustedScriptURL": {
927
- G = P.createScriptURL(G);
927
+ H = $.createScriptURL(H);
928
928
  break;
929
929
  }
930
930
  }
931
- if (G !== $t)
931
+ if (H !== $t)
932
932
  try {
933
- Q ? i.setAttributeNS(Q, $, G) : i.setAttribute($, G), Pt(i) ? le(i) : On(t.removed);
933
+ K ? i.setAttributeNS(K, P, H) : i.setAttribute(P, H), Pt(i) ? le(i) : On(t.removed);
934
934
  } catch {
935
- ye($, i);
935
+ ye(P, i);
936
936
  }
937
937
  }
938
- de(F.afterSanitizeAttributes, i, null);
938
+ de(U.afterSanitizeAttributes, i, null);
939
939
  }, "_sanitizeAttributes"), ks = /* @__PURE__ */ u(function w(i) {
940
940
  let h = null;
941
- const b = vn(i);
942
- for (de(F.beforeSanitizeShadowDOM, i, null); h = b.nextNode(); )
943
- de(F.uponSanitizeShadowNode, h, null), Tn(h), En(h), h.content instanceof r && w(h.content);
944
- de(F.afterSanitizeShadowDOM, i, null);
941
+ const x = vn(i);
942
+ for (de(U.beforeSanitizeShadowDOM, i, null); h = x.nextNode(); )
943
+ de(U.uponSanitizeShadowNode, h, null), Tn(h), En(h), h.content instanceof r && w(h.content);
944
+ de(U.afterSanitizeShadowDOM, i, null);
945
945
  }, "_sanitizeShadowDOM");
946
946
  return t.sanitize = function(w) {
947
- let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = null, b = null, N = null, j = null;
947
+ let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = null, x = null, N = null, W = null;
948
948
  if (zt = !w, zt && (w = "<!-->"), typeof w != "string" && !yn(w))
949
949
  if (typeof w.toString == "function") {
950
950
  if (w = w.toString(), typeof w != "string")
@@ -955,38 +955,38 @@ function ts() {
955
955
  return w;
956
956
  if (Dt || Nt(i), t.removed = [], typeof w == "string" && (Ge = !1), Ge) {
957
957
  if (w.nodeName) {
958
- const fe = U(w.nodeName);
959
- if (!x[fe] || ge[fe])
958
+ const fe = B(w.nodeName);
959
+ if (!b[fe] || J[fe])
960
960
  throw Ve("root node is forbidden and cannot be sanitized in-place");
961
961
  }
962
962
  } else if (w instanceof o)
963
- h = wn("<!---->"), b = h.ownerDocument.importNode(w, !0), b.nodeType === Ze.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? h = b : h.appendChild(b);
963
+ h = wn("<!---->"), x = h.ownerDocument.importNode(w, !0), x.nodeType === Ze.element && x.nodeName === "BODY" || x.nodeName === "HTML" ? h = x : h.appendChild(x);
964
964
  else {
965
965
  if (!Ie && !Ce && !ve && // eslint-disable-next-line unicorn/prefer-includes
966
966
  w.indexOf("<") === -1)
967
- return P && at ? P.createHTML(w) : w;
967
+ return $ && lt ? $.createHTML(w) : w;
968
968
  if (h = wn(w), !h)
969
- return Ie ? null : at ? he : "";
969
+ return Ie ? null : lt ? j : "";
970
970
  }
971
971
  h && Ct && le(h.firstChild);
972
- const $ = vn(Ge ? w : h);
973
- for (; N = $.nextNode(); )
972
+ const P = vn(Ge ? w : h);
973
+ for (; N = P.nextNode(); )
974
974
  Tn(N), En(N), N.content instanceof r && ks(N.content);
975
975
  if (Ge)
976
976
  return w;
977
977
  if (Ie) {
978
- if (it)
979
- for (j = St.call(h.ownerDocument); h.firstChild; )
980
- j.appendChild(h.firstChild);
978
+ if (at)
979
+ for (W = tt.call(h.ownerDocument); h.firstChild; )
980
+ W.appendChild(h.firstChild);
981
981
  else
982
- j = h;
983
- return (A.shadowroot || A.shadowrootmode) && (j = nt.call(n, j, !0)), j;
982
+ W = h;
983
+ return (k.shadowroot || k.shadowrootmode) && (W = nt.call(n, W, !0)), W;
984
984
  }
985
- let Q = ve ? h.outerHTML : h.innerHTML;
986
- return ve && x["!doctype"] && h.ownerDocument && h.ownerDocument.doctype && h.ownerDocument.doctype.name && V(es, h.ownerDocument.doctype.name) && (Q = "<!DOCTYPE " + h.ownerDocument.doctype.name + `>
987
- ` + Q), Ce && pt([De, Fe, M], (fe) => {
988
- Q = qe(Q, fe, " ");
989
- }), P && at ? P.createHTML(Q) : Q;
985
+ let K = ve ? h.outerHTML : h.innerHTML;
986
+ return ve && b["!doctype"] && h.ownerDocument && h.ownerDocument.doctype && h.ownerDocument.doctype.name && q(es, h.ownerDocument.doctype.name) && (K = "<!DOCTYPE " + h.ownerDocument.doctype.name + `>
987
+ ` + K), Ce && dt([Re, Fe, De], (fe) => {
988
+ K = qe(K, fe, " ");
989
+ }), $ && lt ? $.createHTML(K) : K;
990
990
  }, t.setConfig = function() {
991
991
  let w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
992
992
  Nt(w), Dt = !0;
@@ -994,20 +994,20 @@ function ts() {
994
994
  ze = null, Dt = !1;
995
995
  }, t.isValidAttribute = function(w, i, h) {
996
996
  ze || Nt({});
997
- const b = U(w), N = U(i);
998
- return Sn(b, N, h);
997
+ const x = B(w), N = B(i);
998
+ return Sn(x, N, h);
999
999
  }, t.addHook = function(w, i) {
1000
- typeof i == "function" && je(F[w], i);
1000
+ typeof i == "function" && je(U[w], i);
1001
1001
  }, t.removeHook = function(w, i) {
1002
1002
  if (i !== void 0) {
1003
- const h = Hs(F[w], i);
1004
- return h === -1 ? void 0 : Gs(F[w], h, 1)[0];
1003
+ const h = Hs(U[w], i);
1004
+ return h === -1 ? void 0 : Gs(U[w], h, 1)[0];
1005
1005
  }
1006
- return On(F[w]);
1006
+ return On(U[w]);
1007
1007
  }, t.removeHooks = function(w) {
1008
- F[w] = [];
1008
+ U[w] = [];
1009
1009
  }, t.removeAllHooks = function() {
1010
- F = Fn();
1010
+ U = Fn();
1011
1011
  }, t;
1012
1012
  }
1013
1013
  u(ts, "createDOMPurify");
@@ -1025,7 +1025,7 @@ var Se = { exec: /* @__PURE__ */ u(() => null, "exec") };
1025
1025
  function I(l, t = "") {
1026
1026
  let e = typeof l == "string" ? l : l.source, n = { replace: /* @__PURE__ */ u((s, r) => {
1027
1027
  let a = typeof r == "string" ? r : r.source;
1028
- return a = a.replace(Z.caret, "$1"), e = e.replace(s, a), n;
1028
+ return a = a.replace(Y.caret, "$1"), e = e.replace(s, a), n;
1029
1029
  }, "replace"), getRegex: /* @__PURE__ */ u(() => new RegExp(e, t), "getRegex") };
1030
1030
  return n;
1031
1031
  }
@@ -1036,18 +1036,18 @@ var lr = (() => {
1036
1036
  } catch {
1037
1037
  return !1;
1038
1038
  }
1039
- })(), Z = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ u((l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ u((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|$)|$)/, et = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, hr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Jt = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ss = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, rs = I(ss).replace(/bull/g, Jt).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(ss).replace(/bull/g, Jt).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(), en = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, dr = /^[^\n]+/, tn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, fr = I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", tn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), gr = I(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Jt).getRegex(), yt = "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", nn = /<!--(?:-?>|[\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", nn).replace("tag", yt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), is = I(en).replace("hr", et).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", yt).getRegex(), xr = I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", is).getRegex(), sn = { blockquote: xr, code: cr, def: fr, fences: ur, heading: hr, hr: et, html: mr, lheading: rs, list: gr, newline: or, paragraph: is, table: Se, text: dr }, Hn = I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", et).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", yt).getRegex(), br = { ...sn, lheading: pr, table: Hn, paragraph: I(en).replace("hr", et).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Hn).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", yt).getRegex() }, kr = { ...sn, html: I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", nn).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: Se, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: I(en).replace("hr", et).replace("heading", ` *#{1,6} *[^
1040
- ]`).replace("lheading", rs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, vr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, as = /^( {2,}|\\)\n(?!\s*$)/, yr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Be = /[\p{P}\p{S}]/u, Tt = /[\s\p{P}\p{S}]/u, rn = /[^\s\p{P}\p{S}]/u, Tr = I(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Tt).getRegex(), ls = /(?!~)[\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(), os = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, _r = I(os, "u").replace(/punct/g, Be).getRegex(), Rr = I(os, "u").replace(/punct/g, ls).getRegex(), cs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Dr = I(cs, "gu").replace(/notPunctSpace/g, rn).replace(/punctSpace/g, Tt).replace(/punct/g, Be).getRegex(), Cr = I(cs, "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, Sr).replace(/punct/g, ls).getRegex(), Ir = I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, rn).replace(/punctSpace/g, Tt).replace(/punct/g, Be).getRegex(), Mr = I(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Be).getRegex(), Lr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", zr = I(Lr, "gu").replace(/notPunctSpace/g, rn).replace(/punctSpace/g, Tt).replace(/punct/g, Be).getRegex(), Or = I(/\\(punct)/, "gu").replace(/punct/g, Be).getRegex(), Nr = 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(), Pr = I(nn).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", Pr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), kt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Ur = I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", kt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), us = I(/^!?\[(label)\]\[(ref)\]/).replace("label", kt).replace("ref", tn).getRegex(), hs = I(/^!?\[(ref)\](?:\[\])?/).replace("ref", tn).getRegex(), Br = I("reflink|nolink(?!\\()", "g").replace("reflink", us).replace("nolink", hs).getRegex(), Gn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, an = { _backpedal: Se, anyPunctuation: Or, autolink: Nr, blockSkip: Er, br: as, code: vr, del: Se, delLDelim: Se, delRDelim: Se, emStrongLDelim: _r, emStrongRDelimAst: Dr, emStrongRDelimUnd: Ir, escape: wr, link: Ur, nolink: hs, punctuation: Tr, reflink: us, reflinkSearch: Br, tag: $r, text: yr, url: Se }, Fr = { ...an, link: I(/^!?\[(label)\]\((.*?)\)/).replace("label", kt).getRegex(), reflink: I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", kt).getRegex() }, Xt = { ...an, emStrongRDelimAst: Cr, emStrongLDelim: Rr, delLDelim: Mr, delRDelim: zr, url: I(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Gn).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", Gn).getRegex() }, Hr = { ...Xt, br: I(as).replace("{2,}", "*").getRegex(), text: I(Xt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ft = { normal: sn, gfm: br, pedantic: kr }, Xe = { normal: an, gfm: Xt, breaks: Hr, pedantic: Fr }, Gr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Wn = /* @__PURE__ */ u((l) => Gr[l], "ke");
1039
+ })(), 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__ */ u((l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ u((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ u((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|$)|$)/, et = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, hr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Jt = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ss = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, rs = I(ss).replace(/bull/g, Jt).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(ss).replace(/bull/g, Jt).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(), en = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, dr = /^[^\n]+/, tn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, fr = I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", tn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), gr = I(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Jt).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", nn = /<!--(?:-?>|[\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", nn).replace("tag", Tt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), is = I(en).replace("hr", et).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", is).getRegex(), sn = { blockquote: xr, code: cr, def: fr, fences: ur, heading: hr, hr: et, html: mr, lheading: rs, list: gr, newline: or, paragraph: is, table: Se, text: dr }, Hn = I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", et).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 = { ...sn, lheading: pr, table: Hn, paragraph: I(en).replace("hr", et).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Hn).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 = { ...sn, html: I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", nn).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: Se, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: I(en).replace("hr", et).replace("heading", ` *#{1,6} *[^
1040
+ ]`).replace("lheading", rs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, vr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, as = /^( {2,}|\\)\n(?!\s*$)/, yr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Be = /[\p{P}\p{S}]/u, St = /[\s\p{P}\p{S}]/u, rn = /[^\s\p{P}\p{S}]/u, Tr = I(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, St).getRegex(), ls = /(?!~)[\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(), os = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, _r = I(os, "u").replace(/punct/g, Be).getRegex(), Rr = I(os, "u").replace(/punct/g, ls).getRegex(), cs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Dr = I(cs, "gu").replace(/notPunctSpace/g, rn).replace(/punctSpace/g, St).replace(/punct/g, Be).getRegex(), Cr = I(cs, "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, Sr).replace(/punct/g, ls).getRegex(), Ir = I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, rn).replace(/punctSpace/g, St).replace(/punct/g, Be).getRegex(), Mr = I(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Be).getRegex(), Lr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", zr = I(Lr, "gu").replace(/notPunctSpace/g, rn).replace(/punctSpace/g, St).replace(/punct/g, Be).getRegex(), Or = I(/\\(punct)/, "gu").replace(/punct/g, Be).getRegex(), Nr = 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(), Pr = I(nn).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", Pr).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(), us = I(/^!?\[(label)\]\[(ref)\]/).replace("label", wt).replace("ref", tn).getRegex(), hs = I(/^!?\[(ref)\](?:\[\])?/).replace("ref", tn).getRegex(), Br = I("reflink|nolink(?!\\()", "g").replace("reflink", us).replace("nolink", hs).getRegex(), Gn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, an = { _backpedal: Se, anyPunctuation: Or, autolink: Nr, blockSkip: Er, br: as, code: vr, del: Se, delLDelim: Se, delRDelim: Se, emStrongLDelim: _r, emStrongRDelimAst: Dr, emStrongRDelimUnd: Ir, escape: wr, link: Ur, nolink: hs, punctuation: Tr, reflink: us, reflinkSearch: Br, tag: $r, text: yr, url: Se }, Fr = { ...an, link: I(/^!?\[(label)\]\((.*?)\)/).replace("label", wt).getRegex(), reflink: I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", wt).getRegex() }, Xt = { ...an, emStrongRDelimAst: Cr, emStrongLDelim: Rr, delLDelim: Mr, delRDelim: zr, url: I(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Gn).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", Gn).getRegex() }, Hr = { ...Xt, br: I(as).replace("{2,}", "*").getRegex(), text: I(Xt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, gt = { normal: sn, gfm: br, pedantic: kr }, Xe = { normal: an, gfm: Xt, breaks: Hr, pedantic: Fr }, Gr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Wn = /* @__PURE__ */ u((l) => Gr[l], "ke");
1041
1041
  function ce(l, t) {
1042
1042
  if (t) {
1043
- if (Z.escapeTest.test(l)) return l.replace(Z.escapeReplace, Wn);
1044
- } else if (Z.escapeTestNoEncode.test(l)) return l.replace(Z.escapeReplaceNoEncode, Wn);
1043
+ if (Y.escapeTest.test(l)) return l.replace(Y.escapeReplace, Wn);
1044
+ } else if (Y.escapeTestNoEncode.test(l)) return l.replace(Y.escapeReplaceNoEncode, Wn);
1045
1045
  return l;
1046
1046
  }
1047
1047
  u(ce, "T");
1048
1048
  function jn(l) {
1049
1049
  try {
1050
- l = encodeURI(l).replace(Z.percentDecode, "%");
1050
+ l = encodeURI(l).replace(Y.percentDecode, "%");
1051
1051
  } catch {
1052
1052
  return null;
1053
1053
  }
@@ -1055,14 +1055,14 @@ function jn(l) {
1055
1055
  }
1056
1056
  u(jn, "J");
1057
1057
  function qn(l, t) {
1058
- let e = l.replace(Z.findPipe, (r, a, o) => {
1058
+ let e = l.replace(Y.findPipe, (r, a, o) => {
1059
1059
  let c = !1, d = a;
1060
1060
  for (; --d >= 0 && o[d] === "\\"; ) c = !c;
1061
1061
  return c ? "|" : " |";
1062
- }), n = e.split(Z.splitPipe), s = 0;
1062
+ }), n = e.split(Y.splitPipe), s = 0;
1063
1063
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1064
1064
  else for (; n.length < t; ) n.push("");
1065
- for (; s < n.length; s++) n[s] = n[s].trim().replace(Z.slashPipe, "|");
1065
+ for (; s < n.length; s++) n[s] = n[s].trim().replace(Y.slashPipe, "|");
1066
1066
  return n;
1067
1067
  }
1068
1068
  u(qn, "V");
@@ -1114,7 +1114,7 @@ function qr(l, t, e) {
1114
1114
  `);
1115
1115
  }
1116
1116
  u(qr, "nt");
1117
- var Ne, wt = (Ne = class {
1117
+ var Ne, vt = (Ne = class {
1118
1118
  constructor(t) {
1119
1119
  C(this, "options");
1120
1120
  C(this, "rules");
@@ -1168,27 +1168,27 @@ var Ne, wt = (Ne = class {
1168
1168
  else if (!o) c.push(n[d]);
1169
1169
  else break;
1170
1170
  n = n.slice(d);
1171
- let g = c.join(`
1172
- `), p = g.replace(this.rules.other.blockquoteSetextReplace, `
1171
+ let f = c.join(`
1172
+ `), p = f.replace(this.rules.other.blockquoteSetextReplace, `
1173
1173
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1174
1174
  s = s ? `${s}
1175
- ${g}` : g, r = r ? `${r}
1175
+ ${f}` : f, r = r ? `${r}
1176
1176
  ${p}` : p;
1177
- let m = this.lexer.state.top;
1178
- if (this.lexer.state.top = !0, this.lexer.blockTokens(p, a, !0), this.lexer.state.top = m, n.length === 0) break;
1179
- let f = a.at(-1);
1180
- if (f?.type === "code") break;
1181
- if (f?.type === "blockquote") {
1182
- let k = f, _ = k.raw + `
1177
+ let g = this.lexer.state.top;
1178
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(p, a, !0), this.lexer.state.top = g, n.length === 0) break;
1179
+ let m = a.at(-1);
1180
+ if (m?.type === "code") break;
1181
+ if (m?.type === "blockquote") {
1182
+ let y = m, S = y.raw + `
1183
1183
  ` + n.join(`
1184
- `), O = this.blockquote(_);
1185
- a[a.length - 1] = O, s = s.substring(0, s.length - k.raw.length) + O.raw, r = r.substring(0, r.length - k.text.length) + O.text;
1184
+ `), O = this.blockquote(S);
1185
+ a[a.length - 1] = O, s = s.substring(0, s.length - y.raw.length) + O.raw, r = r.substring(0, r.length - y.text.length) + O.text;
1186
1186
  break;
1187
- } else if (f?.type === "list") {
1188
- let k = f, _ = k.raw + `
1187
+ } else if (m?.type === "list") {
1188
+ let y = m, S = y.raw + `
1189
1189
  ` + n.join(`
1190
- `), O = this.list(_);
1191
- a[a.length - 1] = O, s = s.substring(0, s.length - f.raw.length) + O.raw, r = r.substring(0, r.length - k.raw.length) + O.raw, n = _.substring(a.at(-1).raw.length).split(`
1190
+ `), O = this.list(S);
1191
+ a[a.length - 1] = O, s = s.substring(0, s.length - m.raw.length) + O.raw, r = r.substring(0, r.length - y.raw.length) + O.raw, n = S.substring(a.at(-1).raw.length).split(`
1192
1192
  `);
1193
1193
  continue;
1194
1194
  }
@@ -1203,31 +1203,31 @@ ${p}` : p;
1203
1203
  n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
1204
1204
  let a = this.rules.other.listItemRegex(n), o = !1;
1205
1205
  for (; t; ) {
1206
- let d = !1, g = "", p = "";
1206
+ let d = !1, f = "", p = "";
1207
1207
  if (!(e = a.exec(t)) || this.rules.block.hr.test(t)) break;
1208
- g = e[0], t = t.substring(g.length);
1209
- let m = jr(e[2].split(`
1210
- `, 1)[0], e[1].length), f = t.split(`
1211
- `, 1)[0], k = !m.trim(), _ = 0;
1212
- if (this.options.pedantic ? (_ = 2, p = m.trimStart()) : k ? _ = e[1].length + 1 : (_ = m.search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, p = m.slice(_), _ += e[1].length), k && this.rules.other.blankLine.test(f) && (g += f + `
1213
- `, t = t.substring(f.length + 1), d = !0), !d) {
1214
- let O = this.rules.other.nextBulletRegex(_), ee = this.rules.other.hrRegex(_), Re = this.rules.other.fencesBeginRegex(_), ne = this.rules.other.headingBeginRegex(_), P = this.rules.other.htmlBeginRegex(_), he = this.rules.other.blockquoteBeginRegex(_);
1208
+ f = e[0], t = t.substring(f.length);
1209
+ let g = jr(e[2].split(`
1210
+ `, 1)[0], e[1].length), m = t.split(`
1211
+ `, 1)[0], y = !g.trim(), S = 0;
1212
+ if (this.options.pedantic ? (S = 2, p = g.trimStart()) : y ? S = e[1].length + 1 : (S = g.search(this.rules.other.nonSpaceChar), S = S > 4 ? 1 : S, p = g.slice(S), S += e[1].length), y && this.rules.other.blankLine.test(m) && (f += m + `
1213
+ `, t = t.substring(m.length + 1), d = !0), !d) {
1214
+ let O = this.rules.other.nextBulletRegex(S), ge = 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);
1215
1215
  for (; t; ) {
1216
- let q = t.split(`
1217
- `, 1)[0], se;
1218
- if (f = q, this.options.pedantic ? (f = f.replace(this.rules.other.listReplaceNesting, " "), se = f) : se = f.replace(this.rules.other.tabCharGlobal, " "), Re.test(f) || ne.test(f) || P.test(f) || he.test(f) || O.test(f) || ee.test(f)) break;
1219
- if (se.search(this.rules.other.nonSpaceChar) >= _ || !f.trim()) p += `
1220
- ` + se.slice(_);
1216
+ let se = t.split(`
1217
+ `, 1)[0], he;
1218
+ if (m = se, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), he = m) : he = m.replace(this.rules.other.tabCharGlobal, " "), me.test(m) || ne.test(m) || $.test(m) || j.test(m) || O.test(m) || ge.test(m)) break;
1219
+ if (he.search(this.rules.other.nonSpaceChar) >= S || !m.trim()) p += `
1220
+ ` + he.slice(S);
1221
1221
  else {
1222
- if (k || m.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Re.test(m) || ne.test(m) || ee.test(m)) break;
1222
+ if (y || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || me.test(g) || ne.test(g) || ge.test(g)) break;
1223
1223
  p += `
1224
- ` + f;
1224
+ ` + m;
1225
1225
  }
1226
- k = !f.trim(), g += q + `
1227
- `, t = t.substring(q.length + 1), m = se.slice(_);
1226
+ y = !m.trim(), f += se + `
1227
+ `, t = t.substring(se.length + 1), g = he.slice(S);
1228
1228
  }
1229
1229
  }
1230
- 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;
1230
+ r.loose || (o ? r.loose = !0 : this.rules.other.doubleBlankLine.test(f) && (o = !0)), r.items.push({ type: "list_item", raw: f, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: !1, text: p, tokens: [] }), r.raw += f;
1231
1231
  }
1232
1232
  let c = r.items.at(-1);
1233
1233
  if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
@@ -1242,20 +1242,20 @@ ${p}` : p;
1242
1242
  break;
1243
1243
  }
1244
1244
  }
1245
- let g = this.rules.other.listTaskCheckbox.exec(d.raw);
1246
- if (g) {
1247
- let p = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
1245
+ let f = this.rules.other.listTaskCheckbox.exec(d.raw);
1246
+ if (f) {
1247
+ let p = { type: "checkbox", raw: f[0] + " ", checked: f[0] !== "[ ]" };
1248
1248
  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);
1249
1249
  }
1250
1250
  }
1251
1251
  if (!r.loose) {
1252
- let g = d.tokens.filter((m) => m.type === "space"), p = g.length > 0 && g.some((m) => this.rules.other.anyLine.test(m.raw));
1252
+ let f = d.tokens.filter((g) => g.type === "space"), p = f.length > 0 && f.some((g) => this.rules.other.anyLine.test(g.raw));
1253
1253
  r.loose = p;
1254
1254
  }
1255
1255
  }
1256
1256
  if (r.loose) for (let d of r.items) {
1257
1257
  d.loose = !0;
1258
- for (let g of d.tokens) g.type === "text" && (g.type = "paragraph");
1258
+ for (let f of d.tokens) f.type === "text" && (f.type = "paragraph");
1259
1259
  }
1260
1260
  return r;
1261
1261
  }
@@ -1348,8 +1348,8 @@ ${p}` : p;
1348
1348
  emStrong(t, e, n = "") {
1349
1349
  let s = this.rules.inline.emStrongLDelim.exec(t);
1350
1350
  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))) {
1351
- let r = [...s[0]].length - 1, a, o, c = r, d = 0, g = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1352
- for (g.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = g.exec(e)) !== null; ) {
1351
+ let r = [...s[0]].length - 1, a, o, c = r, d = 0, f = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1352
+ for (f.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = f.exec(e)) !== null; ) {
1353
1353
  if (a = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !a) continue;
1354
1354
  if (o = [...a].length, s[3] || s[4]) {
1355
1355
  c += o;
@@ -1360,13 +1360,13 @@ ${p}` : p;
1360
1360
  }
1361
1361
  if (c -= o, c > 0) continue;
1362
1362
  o = Math.min(o, o + c + d);
1363
- let p = [...s[0]][0].length, m = t.slice(0, r + s.index + p + o);
1363
+ let p = [...s[0]][0].length, g = t.slice(0, r + s.index + p + o);
1364
1364
  if (Math.min(r, o) % 2) {
1365
- let k = m.slice(1, -1);
1366
- return { type: "em", raw: m, text: k, tokens: this.lexer.inlineTokens(k) };
1365
+ let y = g.slice(1, -1);
1366
+ return { type: "em", raw: g, text: y, tokens: this.lexer.inlineTokens(y) };
1367
1367
  }
1368
- let f = m.slice(2, -2);
1369
- return { type: "strong", raw: m, text: f, tokens: this.lexer.inlineTokens(f) };
1368
+ let m = g.slice(2, -2);
1369
+ return { type: "strong", raw: g, text: m, tokens: this.lexer.inlineTokens(m) };
1370
1370
  }
1371
1371
  }
1372
1372
  }
@@ -1393,8 +1393,8 @@ ${p}` : p;
1393
1393
  }
1394
1394
  if (c -= o, c > 0) continue;
1395
1395
  o = Math.min(o, o + c);
1396
- let g = [...s[0]][0].length, p = t.slice(0, r + s.index + g + o), m = p.slice(r, -r);
1397
- return { type: "del", raw: p, text: m, tokens: this.lexer.inlineTokens(m) };
1396
+ let f = [...s[0]][0].length, p = t.slice(0, r + s.index + f + o), g = p.slice(r, -r);
1397
+ return { type: "del", raw: p, text: g, tokens: this.lexer.inlineTokens(g) };
1398
1398
  }
1399
1399
  }
1400
1400
  }
@@ -1427,28 +1427,28 @@ ${p}` : p;
1427
1427
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1428
1428
  }
1429
1429
  }
1430
- }, u(Ne, "w"), Ne), ke, re = (ke = class {
1430
+ }, u(Ne, "w"), Ne), be, re = (be = class {
1431
1431
  constructor(t) {
1432
1432
  C(this, "tokens");
1433
1433
  C(this, "options");
1434
1434
  C(this, "state");
1435
1435
  C(this, "inlineQueue");
1436
1436
  C(this, "tokenizer");
1437
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || _e, this.options.tokenizer = this.options.tokenizer || new wt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1438
- let e = { other: Z, block: ft.normal, inline: Xe.normal };
1439
- this.options.pedantic ? (e.block = ft.pedantic, e.inline = Xe.pedantic) : this.options.gfm && (e.block = ft.gfm, this.options.breaks ? e.inline = Xe.breaks : e.inline = Xe.gfm), this.tokenizer.rules = e;
1437
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || _e, 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 };
1438
+ let e = { other: Y, block: gt.normal, inline: Xe.normal };
1439
+ this.options.pedantic ? (e.block = gt.pedantic, e.inline = Xe.pedantic) : this.options.gfm && (e.block = gt.gfm, this.options.breaks ? e.inline = Xe.breaks : e.inline = Xe.gfm), this.tokenizer.rules = e;
1440
1440
  }
1441
1441
  static get rules() {
1442
- return { block: ft, inline: Xe };
1442
+ return { block: gt, inline: Xe };
1443
1443
  }
1444
1444
  static lex(t, e) {
1445
- return new ke(e).lex(t);
1445
+ return new be(e).lex(t);
1446
1446
  }
1447
1447
  static lexInline(t, e) {
1448
- return new ke(e).inlineTokens(t);
1448
+ return new be(e).inlineTokens(t);
1449
1449
  }
1450
1450
  lex(t) {
1451
- t = t.replace(Z.carriageReturn, `
1451
+ t = t.replace(Y.carriageReturn, `
1452
1452
  `), this.blockTokens(t, this.tokens);
1453
1453
  for (let e = 0; e < this.inlineQueue.length; e++) {
1454
1454
  let n = this.inlineQueue[e];
@@ -1457,7 +1457,7 @@ ${p}` : p;
1457
1457
  return this.inlineQueue = [], this.tokens;
1458
1458
  }
1459
1459
  blockTokens(t, e = [], n = !1) {
1460
- for (this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(Z.tabCharGlobal, " ").replace(Z.spaceLine, "")); t; ) {
1460
+ for (this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(Y.tabCharGlobal, " ").replace(Y.spaceLine, "")); t; ) {
1461
1461
  let s;
1462
1462
  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;
1463
1463
  if (s = this.tokenizer.space(t)) {
@@ -1569,7 +1569,7 @@ ${p}` : p;
1569
1569
  for (; t; ) {
1570
1570
  a || (o = ""), a = !1;
1571
1571
  let c;
1572
- if (this.options.extensions?.inline?.some((g) => (c = g.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1572
+ if (this.options.extensions?.inline?.some((f) => (c = f.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1573
1573
  if (c = this.tokenizer.escape(t)) {
1574
1574
  t = t.substring(c.raw.length), e.push(c);
1575
1575
  continue;
@@ -1584,8 +1584,8 @@ ${p}` : p;
1584
1584
  }
1585
1585
  if (c = this.tokenizer.reflink(t, this.tokens.links)) {
1586
1586
  t = t.substring(c.raw.length);
1587
- let g = e.at(-1);
1588
- c.type === "text" && g?.type === "text" ? (g.raw += c.raw, g.text += c.text) : e.push(c);
1587
+ let f = e.at(-1);
1588
+ c.type === "text" && f?.type === "text" ? (f.raw += c.raw, f.text += c.text) : e.push(c);
1589
1589
  continue;
1590
1590
  }
1591
1591
  if (c = this.tokenizer.emStrong(t, n, o)) {
@@ -1614,28 +1614,28 @@ ${p}` : p;
1614
1614
  }
1615
1615
  let d = t;
1616
1616
  if (this.options.extensions?.startInline) {
1617
- let g = 1 / 0, p = t.slice(1), m;
1618
- this.options.extensions.startInline.forEach((f) => {
1619
- m = f.call({ lexer: this }, p), typeof m == "number" && m >= 0 && (g = Math.min(g, m));
1620
- }), g < 1 / 0 && g >= 0 && (d = t.substring(0, g + 1));
1617
+ let f = 1 / 0, p = t.slice(1), g;
1618
+ this.options.extensions.startInline.forEach((m) => {
1619
+ g = m.call({ lexer: this }, p), typeof g == "number" && g >= 0 && (f = Math.min(f, g));
1620
+ }), f < 1 / 0 && f >= 0 && (d = t.substring(0, f + 1));
1621
1621
  }
1622
1622
  if (c = this.tokenizer.inlineText(d)) {
1623
1623
  t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), a = !0;
1624
- let g = e.at(-1);
1625
- g?.type === "text" ? (g.raw += c.raw, g.text += c.text) : e.push(c);
1624
+ let f = e.at(-1);
1625
+ f?.type === "text" ? (f.raw += c.raw, f.text += c.text) : e.push(c);
1626
1626
  continue;
1627
1627
  }
1628
1628
  if (t) {
1629
- let g = "Infinite loop on byte: " + t.charCodeAt(0);
1629
+ let f = "Infinite loop on byte: " + t.charCodeAt(0);
1630
1630
  if (this.options.silent) {
1631
- console.error(g);
1631
+ console.error(f);
1632
1632
  break;
1633
- } else throw new Error(g);
1633
+ } else throw new Error(f);
1634
1634
  }
1635
1635
  }
1636
1636
  return e;
1637
1637
  }
1638
- }, u(ke, "u"), ke), Pe, vt = (Pe = class {
1638
+ }, u(be, "u"), be), Pe, yt = (Pe = class {
1639
1639
  constructor(t) {
1640
1640
  C(this, "options");
1641
1641
  C(this, "parser");
@@ -1645,7 +1645,7 @@ ${p}` : p;
1645
1645
  return "";
1646
1646
  }
1647
1647
  code({ text: t, lang: e, escaped: n }) {
1648
- let s = (e || "").match(Z.notSpaceStart)?.[0], r = t.replace(Z.endingNewline, "") + `
1648
+ let s = (e || "").match(Y.notSpaceStart)?.[0], r = t.replace(Y.endingNewline, "") + `
1649
1649
  `;
1650
1650
  return s ? '<pre><code class="language-' + ce(s) + '">' + (n ? r : ce(r, !0)) + `</code></pre>
1651
1651
  ` : "<pre><code>" + (n ? r : ce(r, !0)) + `</code></pre>
@@ -1783,18 +1783,18 @@ ${t}</tr>
1783
1783
  checkbox({ raw: t }) {
1784
1784
  return t;
1785
1785
  }
1786
- }, u($e, "$"), $e), we, ie = (we = class {
1786
+ }, u($e, "$"), $e), ke, ie = (ke = class {
1787
1787
  constructor(t) {
1788
1788
  C(this, "options");
1789
1789
  C(this, "renderer");
1790
1790
  C(this, "textRenderer");
1791
- this.options = t || _e, this.options.renderer = this.options.renderer || new vt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new ln();
1791
+ this.options = t || _e, 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 ln();
1792
1792
  }
1793
1793
  static parse(t, e) {
1794
- return new we(e).parse(t);
1794
+ return new ke(e).parse(t);
1795
1795
  }
1796
1796
  static parseInline(t, e) {
1797
- return new we(e).parseInline(t);
1797
+ return new ke(e).parseInline(t);
1798
1798
  }
1799
1799
  parse(t) {
1800
1800
  this.renderer.parser = this;
@@ -1934,7 +1934,7 @@ ${t}</tr>
1934
1934
  }
1935
1935
  return n;
1936
1936
  }
1937
- }, u(we, "u"), we), be, Qe = (be = class {
1937
+ }, u(ke, "u"), ke), xe, Qe = (xe = class {
1938
1938
  constructor(t) {
1939
1939
  C(this, "options");
1940
1940
  C(this, "block");
@@ -1958,17 +1958,17 @@ ${t}</tr>
1958
1958
  provideParser(t = this.block) {
1959
1959
  return t ? ie.parse : ie.parseInline;
1960
1960
  }
1961
- }, u(be, "P"), C(be, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), C(be, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), be), Ue, Vr = (Ue = class {
1961
+ }, u(xe, "P"), C(xe, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), C(xe, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), xe), Ue, Vr = (Ue = class {
1962
1962
  constructor(...t) {
1963
1963
  C(this, "defaults", Qt());
1964
1964
  C(this, "options", this.setOptions);
1965
1965
  C(this, "parse", this.parseMarkdown(!0));
1966
1966
  C(this, "parseInline", this.parseMarkdown(!1));
1967
1967
  C(this, "Parser", ie);
1968
- C(this, "Renderer", vt);
1968
+ C(this, "Renderer", yt);
1969
1969
  C(this, "TextRenderer", ln);
1970
1970
  C(this, "Lexer", re);
1971
- C(this, "Tokenizer", wt);
1971
+ C(this, "Tokenizer", vt);
1972
1972
  C(this, "Hooks", Qe);
1973
1973
  this.use(...t);
1974
1974
  }
@@ -2016,27 +2016,27 @@ ${t}</tr>
2016
2016
  }
2017
2017
  "childTokens" in r && r.childTokens && (e.childTokens[r.name] = r.childTokens);
2018
2018
  }), s.extensions = e), n.renderer) {
2019
- let r = this.defaults.renderer || new vt(this.defaults);
2019
+ let r = this.defaults.renderer || new yt(this.defaults);
2020
2020
  for (let a in n.renderer) {
2021
2021
  if (!(a in r)) throw new Error(`renderer '${a}' does not exist`);
2022
2022
  if (["options", "parser"].includes(a)) continue;
2023
2023
  let o = a, c = n.renderer[o], d = r[o];
2024
- r[o] = (...g) => {
2025
- let p = c.apply(r, g);
2026
- return p === !1 && (p = d.apply(r, g)), p || "";
2024
+ r[o] = (...f) => {
2025
+ let p = c.apply(r, f);
2026
+ return p === !1 && (p = d.apply(r, f)), p || "";
2027
2027
  };
2028
2028
  }
2029
2029
  s.renderer = r;
2030
2030
  }
2031
2031
  if (n.tokenizer) {
2032
- let r = this.defaults.tokenizer || new wt(this.defaults);
2032
+ let r = this.defaults.tokenizer || new vt(this.defaults);
2033
2033
  for (let a in n.tokenizer) {
2034
2034
  if (!(a in r)) throw new Error(`tokenizer '${a}' does not exist`);
2035
2035
  if (["options", "rules", "lexer"].includes(a)) continue;
2036
2036
  let o = a, c = n.tokenizer[o], d = r[o];
2037
- r[o] = (...g) => {
2038
- let p = c.apply(r, g);
2039
- return p === !1 && (p = d.apply(r, g)), p;
2037
+ r[o] = (...f) => {
2038
+ let p = c.apply(r, f);
2039
+ return p === !1 && (p = d.apply(r, f)), p;
2040
2040
  };
2041
2041
  }
2042
2042
  s.tokenizer = r;
@@ -2047,20 +2047,20 @@ ${t}</tr>
2047
2047
  if (!(a in r)) throw new Error(`hook '${a}' does not exist`);
2048
2048
  if (["options", "block"].includes(a)) continue;
2049
2049
  let o = a, c = n.hooks[o], d = r[o];
2050
- Qe.passThroughHooks.has(a) ? r[o] = (g) => {
2050
+ Qe.passThroughHooks.has(a) ? r[o] = (f) => {
2051
2051
  if (this.defaults.async && Qe.passThroughHooksRespectAsync.has(a)) return (async () => {
2052
- let m = await c.call(r, g);
2053
- return d.call(r, m);
2052
+ let g = await c.call(r, f);
2053
+ return d.call(r, g);
2054
2054
  })();
2055
- let p = c.call(r, g);
2055
+ let p = c.call(r, f);
2056
2056
  return d.call(r, p);
2057
- } : r[o] = (...g) => {
2057
+ } : r[o] = (...f) => {
2058
2058
  if (this.defaults.async) return (async () => {
2059
- let m = await c.apply(r, g);
2060
- return m === !1 && (m = await d.apply(r, g)), m;
2059
+ let g = await c.apply(r, f);
2060
+ return g === !1 && (g = await d.apply(r, f)), g;
2061
2061
  })();
2062
- let p = c.apply(r, g);
2063
- return p === !1 && (p = d.apply(r, g)), p;
2062
+ let p = c.apply(r, f);
2063
+ return p === !1 && (p = d.apply(r, f)), p;
2064
2064
  };
2065
2065
  }
2066
2066
  s.hooks = r;
@@ -2093,8 +2093,8 @@ ${t}</tr>
2093
2093
  if (r.hooks && (r.hooks.options = r, r.hooks.block = t), r.async) return (async () => {
2094
2094
  let o = r.hooks ? await r.hooks.preprocess(e) : e, c = await (r.hooks ? await r.hooks.provideLexer(t) : t ? re.lex : re.lexInline)(o, r), d = r.hooks ? await r.hooks.processAllTokens(c) : c;
2095
2095
  r.walkTokens && await Promise.all(this.walkTokens(d, r.walkTokens));
2096
- let g = await (r.hooks ? await r.hooks.provideParser(t) : t ? ie.parse : ie.parseInline)(d, r);
2097
- return r.hooks ? await r.hooks.postprocess(g) : g;
2096
+ let f = await (r.hooks ? await r.hooks.provideParser(t) : t ? ie.parse : ie.parseInline)(d, r);
2097
+ return r.hooks ? await r.hooks.postprocess(f) : f;
2098
2098
  })().catch(a);
2099
2099
  try {
2100
2100
  r.hooks && (e = r.hooks.preprocess(e));
@@ -2119,51 +2119,54 @@ Please report this to https://github.com/markedjs/marked.`, t) {
2119
2119
  };
2120
2120
  }
2121
2121
  }, u(Ue, "D"), Ue), Ae = new Vr();
2122
- function L(l, t) {
2122
+ function M(l, t) {
2123
2123
  return Ae.parse(l, t);
2124
2124
  }
2125
- u(L, "g");
2126
- L.options = L.setOptions = function(l) {
2127
- return Ae.setOptions(l), L.defaults = Ae.defaults, ns(L.defaults), L;
2125
+ u(M, "g");
2126
+ M.options = M.setOptions = function(l) {
2127
+ return Ae.setOptions(l), M.defaults = Ae.defaults, ns(M.defaults), M;
2128
2128
  };
2129
- L.getDefaults = Qt;
2130
- L.defaults = _e;
2131
- L.use = function(...l) {
2132
- return Ae.use(...l), L.defaults = Ae.defaults, ns(L.defaults), L;
2129
+ M.getDefaults = Qt;
2130
+ M.defaults = _e;
2131
+ M.use = function(...l) {
2132
+ return Ae.use(...l), M.defaults = Ae.defaults, ns(M.defaults), M;
2133
2133
  };
2134
- L.walkTokens = function(l, t) {
2134
+ M.walkTokens = function(l, t) {
2135
2135
  return Ae.walkTokens(l, t);
2136
2136
  };
2137
- L.parseInline = Ae.parseInline;
2138
- L.Parser = ie;
2139
- L.parser = ie.parse;
2140
- L.Renderer = vt;
2141
- L.TextRenderer = ln;
2142
- L.Lexer = re;
2143
- L.lexer = re.lex;
2144
- L.Tokenizer = wt;
2145
- L.Hooks = Qe;
2146
- L.parse = L;
2147
- L.options;
2148
- L.setOptions;
2149
- L.use;
2150
- L.walkTokens;
2151
- L.parseInline;
2137
+ M.parseInline = Ae.parseInline;
2138
+ M.Parser = ie;
2139
+ M.parser = ie.parse;
2140
+ M.Renderer = yt;
2141
+ M.TextRenderer = ln;
2142
+ M.Lexer = re;
2143
+ M.lexer = re.lex;
2144
+ M.Tokenizer = vt;
2145
+ M.Hooks = Qe;
2146
+ M.parse = M;
2147
+ M.options;
2148
+ M.setOptions;
2149
+ M.use;
2150
+ M.walkTokens;
2151
+ M.parseInline;
2152
2152
  ie.parse;
2153
2153
  re.lex;
2154
- const Yr = { class: "flex flex-col h-full relative" }, Zr = {
2154
+ const Yr = { class: "@container/chat flex flex-col h-full relative" }, Zr = {
2155
2155
  key: 0,
2156
2156
  class: "pb-4"
2157
2157
  }, Xr = {
2158
2158
  key: 0,
2159
- class: "flex flex-col items-center justify-center pt-12 pb-6 px-4"
2160
- }, Kr = { class: "relative mb-3" }, Qr = ["src", "alt"], Jr = ["title"], ei = {
2159
+ class: "flex flex-col items-center justify-center px-4 min-h-full"
2160
+ }, Kr = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Qr = ["src", "alt"], Jr = ["title"], ei = {
2161
2161
  key: 0,
2162
2162
  class: "flex items-center gap-3 py-3 px-2"
2163
- }, ti = ["src", "alt"], ni = ["src", "alt"], si = ["src"], ri = ["href"], ii = ["innerHTML"], ai = {
2163
+ }, ti = {
2164
+ key: 0,
2165
+ class: "flex-shrink-0 size-7 @sm/chat:size-8"
2166
+ }, ni = ["src", "alt"], si = ["src", "alt"], ri = ["src"], ii = ["href"], ai = ["innerHTML"], li = {
2164
2167
  key: 1,
2165
- class: "flex gap-2 justify-start items-end mb-4"
2166
- }, li = { class: "flex-shrink-0" }, oi = ["src", "alt"], ci = {
2168
+ class: "flex gap-2 justify-start items-center mb-4"
2169
+ }, oi = ["src", "alt"], ci = {
2167
2170
  key: 0,
2168
2171
  class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto"
2169
2172
  }, ui = ["src", "alt"], hi = { class: "max-w-20 truncate" }, pi = ["onClick"], di = {
@@ -2181,7 +2184,6 @@ const Yr = { class: "flex flex-col h-full relative" }, Zr = {
2181
2184
  chatController: {},
2182
2185
  agent: {},
2183
2186
  variant: { default: "dark" },
2184
- scale: { default: "md" },
2185
2187
  uploadFn: { type: Function },
2186
2188
  scope: { default: "private" },
2187
2189
  scopeName: {},
@@ -2189,13 +2191,13 @@ const Yr = { class: "flex flex-col h-full relative" }, Zr = {
2189
2191
  emptyStateMessage: {}
2190
2192
  },
2191
2193
  setup(l) {
2192
- const t = new L.Renderer();
2193
- t.link = ({ href: E, text: x }) => `<a href="${E}" target="_blank" rel="noopener noreferrer">${x}</a>`, L.setOptions({ breaks: !0, gfm: !0, renderer: t });
2194
- function e(E) {
2195
- if (!E)
2194
+ const t = new M.Renderer();
2195
+ t.link = ({ href: b, text: v }) => `<a href="${b}" target="_blank" rel="noopener noreferrer">${v}</a>`, M.setOptions({ breaks: !0, gfm: !0, renderer: t });
2196
+ function e(b) {
2197
+ if (!b)
2196
2198
  return "";
2197
- const x = L.parse(E, { async: !1 });
2198
- return ar.sanitize(x, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2199
+ const v = M.parse(b, { async: !1 });
2200
+ return ar.sanitize(v, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2199
2201
  }
2200
2202
  u(e, "renderMarkdown");
2201
2203
  const n = {
@@ -2206,361 +2208,343 @@ const Yr = { class: "flex flex-col h-full relative" }, Zr = {
2206
2208
  private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
2207
2209
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
2208
2210
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
2209
- }, r = W(() => l.setupHint ?? n[l.scope]), a = W(() => {
2210
- const E = { ...s[l.scope] };
2211
- return l.scope === "org" && l.scopeName && (E.label = l.scopeName, E.tooltip = `Visible to ${l.scopeName} members`), E;
2212
- }), o = W(() => l.scale === "lg"), c = Y(""), d = Y(!1), g = Y(), p = Y(), m = Y(), f = Y([]), k = Y(!1);
2213
- function _(E, x) {
2214
- const R = E[x], A = E[x + 1];
2215
- return !A || A.sender !== R.sender;
2211
+ }, r = F(() => l.setupHint ?? n[l.scope]), a = F(() => {
2212
+ const b = { ...s[l.scope] };
2213
+ return l.scope === "org" && l.scopeName && (b.label = l.scopeName, b.tooltip = `Visible to ${l.scopeName} members`), b;
2214
+ }), o = V(""), c = V(!1), d = V(), f = V(), p = V(), g = V([]), m = V(!1);
2215
+ function y(b, v) {
2216
+ const k = b[v], z = b[v + 1];
2217
+ return !z || z.sender !== k.sender;
2216
2218
  }
2217
- u(_, "shouldShowAvatar");
2218
- const O = W(() => l.chatController?.textState.value), ee = W(() => O.value?.isConnected ?? !1), Re = W(() => O.value?.isThinking ?? !1), ne = W(() => O.value?.connectionStatus === "disconnected" && !!O.value?.error), P = W(() => O.value?.connectionStatus !== "connected" && !O.value?.error), he = W(() => O.value?.error), q = W(() => l.chatController?.sharedMessages.value?.filter((E) => E.sender !== "system") ?? []), se = W(() => !ee.value), St = W(() => ne.value ? "Agent is offline" : P.value ? "Connecting..." : "Message"), tt = W(() => (c.value.trim() || f.value.length > 0) && !se.value && !k.value);
2219
+ u(y, "shouldShowAvatar");
2220
+ const S = F(() => l.chatController?.textState.value), O = F(() => S.value?.isConnected ?? !1), ge = 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(() => !O.value), he = F(() => me.value ? "Agent is offline" : ne.value ? "Connecting..." : "Message"), tt = F(() => (o.value.trim() || g.value.length > 0) && !se.value && !m.value), L = F(() => l.variant === "light"), nt = F(
2221
+ () => L.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2222
+ ), U = F(() => L.value ? "text-theme-300" : "text-white/30");
2219
2223
  Kt(async () => {
2220
- if (l.chatController && !ee.value)
2224
+ if (l.chatController && !O.value)
2221
2225
  try {
2222
2226
  await l.chatController.startTextConversation();
2223
- } catch (E) {
2224
- console.error("Failed to start text conversation:", E);
2227
+ } catch (b) {
2228
+ console.error("Failed to start text conversation:", b);
2225
2229
  }
2226
2230
  });
2227
- async function nt() {
2228
- const E = c.value.trim(), x = f.value.length > 0;
2229
- if (!E && !x || !l.chatController || !ee.value || k.value)
2231
+ async function Re() {
2232
+ const b = o.value.trim(), v = g.value.length > 0;
2233
+ if (!b && !v || !l.chatController || !O.value || m.value)
2230
2234
  return;
2231
- const R = c.value, A = x ? [...f.value] : void 0;
2232
- c.value = "", f.value = [], p.value && (p.value.style.height = "auto", p.value.focus());
2235
+ const k = o.value, z = v ? [...g.value] : void 0;
2236
+ o.value = "", g.value = [], f.value && (f.value.style.height = "auto", f.value.focus());
2233
2237
  try {
2234
- await l.chatController.sendChatMessage(R, A), De();
2235
- } catch (H) {
2236
- console.error("Error sending message:", H);
2238
+ await l.chatController.sendChatMessage(k, z), De();
2239
+ } catch (D) {
2240
+ console.error("Error sending message:", D);
2237
2241
  }
2238
2242
  }
2239
- u(nt, "sendMessage");
2240
- function F(E) {
2241
- E.key === "Enter" && !E.shiftKey && (E.preventDefault(), nt());
2243
+ u(Re, "sendMessage");
2244
+ function Fe(b) {
2245
+ b.key === "Enter" && !b.shiftKey && (b.preventDefault(), Re());
2242
2246
  }
2243
- u(F, "handleKeydown");
2247
+ u(Fe, "handleKeydown");
2244
2248
  function De() {
2245
- g.value && Ut(() => {
2246
- g.value.scrollTop = g.value.scrollHeight;
2249
+ d.value && Ut(() => {
2250
+ d.value.scrollTop = d.value.scrollHeight;
2247
2251
  });
2248
2252
  }
2249
2253
  u(De, "scrollToBottom");
2250
- function Fe() {
2251
- p.value && (p.value.style.height = "auto", p.value.style.height = `${Math.min(p.value.scrollHeight, 150)}px`);
2252
- }
2253
- u(Fe, "adjustTextareaHeight"), Je(c, () => Ut(() => Fe()));
2254
- const M = W(() => l.variant === "light");
2255
2254
  function At() {
2256
- m.value?.click();
2255
+ f.value && (f.value.style.height = "auto", f.value.style.height = `${Math.min(f.value.scrollHeight, 150)}px`);
2257
2256
  }
2258
- u(At, "triggerFileInput");
2259
- async function Et(E) {
2260
- const x = E.target, R = x.files?.[0];
2261
- if (!(!R || !l.uploadFn)) {
2262
- k.value = !0;
2257
+ u(At, "adjustTextareaHeight"), Je(o, () => Ut(() => At()));
2258
+ function Et() {
2259
+ p.value?.click();
2260
+ }
2261
+ u(Et, "triggerFileInput");
2262
+ async function _t(b) {
2263
+ const v = b.target, k = v.files?.[0];
2264
+ if (!(!k || !l.uploadFn)) {
2265
+ m.value = !0;
2263
2266
  try {
2264
- const A = await l.uploadFn(R);
2265
- f.value = [...f.value, A];
2266
- } catch (A) {
2267
- console.error("Upload failed:", A);
2267
+ const z = await l.uploadFn(k);
2268
+ g.value = [...g.value, z];
2269
+ } catch (z) {
2270
+ console.error("Upload failed:", z);
2268
2271
  } finally {
2269
- k.value = !1, x.value = "";
2272
+ m.value = !1, v.value = "";
2270
2273
  }
2271
2274
  }
2272
2275
  }
2273
- u(Et, "handleFileSelect");
2274
- function _t(E) {
2275
- f.value = f.value.filter((x, R) => R !== E);
2276
+ u(_t, "handleFileSelect");
2277
+ function st(b) {
2278
+ g.value = g.value.filter((v, k) => k !== b);
2276
2279
  }
2277
- u(_t, "removeAttachment");
2278
- function He(E, x) {
2279
- if (x === 0) {
2280
- const me = E[x];
2281
- return me?.timestamp ? st(new Date(me.timestamp)) : null;
2282
- }
2283
- const R = E[x - 1], A = E[x];
2284
- if (!R?.timestamp || !A?.timestamp) return null;
2285
- const H = new Date(R.timestamp).getTime();
2286
- return new Date(A.timestamp).getTime() - H > 36e5 ? st(new Date(A.timestamp)) : null;
2280
+ u(st, "removeAttachment");
2281
+ function rt(b, v) {
2282
+ if (v === 0) {
2283
+ const ee = b[v];
2284
+ return ee?.timestamp ? He(new Date(ee.timestamp)) : null;
2285
+ }
2286
+ const k = b[v - 1], z = b[v];
2287
+ if (!k?.timestamp || !z?.timestamp) return null;
2288
+ const D = new Date(k.timestamp).getTime();
2289
+ return new Date(z.timestamp).getTime() - D > 36e5 ? He(new Date(z.timestamp)) : null;
2287
2290
  }
2288
- u(He, "shouldShowTimeDivider");
2289
- function st(E) {
2290
- const x = /* @__PURE__ */ new Date(), R = E.toDateString() === x.toDateString(), A = new Date(x);
2291
- A.setDate(A.getDate() - 1);
2292
- const H = E.toDateString() === A.toDateString(), z = E.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2293
- if (R) return z;
2294
- if (H) return `Yesterday, ${z}`;
2295
- const ge = E.getFullYear() === x.getFullYear();
2296
- return `${E.toLocaleDateString("en-US", {
2291
+ u(rt, "shouldShowTimeDivider");
2292
+ function He(b) {
2293
+ const v = /* @__PURE__ */ new Date(), k = b.toDateString() === v.toDateString(), z = new Date(v);
2294
+ z.setDate(z.getDate() - 1);
2295
+ const D = b.toDateString() === z.toDateString(), J = b.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2296
+ if (k) return J;
2297
+ if (D) return `Yesterday, ${J}`;
2298
+ const we = b.getFullYear() === v.getFullYear();
2299
+ return `${b.toLocaleDateString("en-US", {
2297
2300
  weekday: "long",
2298
2301
  month: "short",
2299
2302
  day: "numeric",
2300
- ...ge ? {} : { year: "numeric" }
2301
- })}, ${z}`;
2303
+ ...we ? {} : { year: "numeric" }
2304
+ })}, ${J}`;
2302
2305
  }
2303
- return u(st, "formatTimeDivider"), Je(q, (E) => {
2304
- E.length > 0 && Ut(() => De());
2305
- }, { immediate: !0, deep: !0 }), (E, x) => (T(), S("div", Yr, [
2306
- M.value ? B("", !0) : (T(), S("div", Zr, [
2306
+ return u(He, "formatTimeDivider"), Je(j, (b) => {
2307
+ b.length > 0 && Ut(() => De());
2308
+ }, { immediate: !0, deep: !0 }), (b, v) => (A(), E("div", Yr, [
2309
+ L.value ? G("", !0) : (A(), E("div", Zr, [
2307
2310
  Bt($s, {
2308
2311
  agent: l.agent,
2309
- "is-online": ee.value
2312
+ "is-online": O.value
2310
2313
  }, null, 8, ["agent", "is-online"])
2311
2314
  ])),
2312
- ne.value ? (T(), S("div", {
2315
+ me.value ? (A(), E("div", {
2313
2316
  key: 1,
2314
- class: y(["py-16 flex flex-col items-center justify-center gap-3 text-sm", M.value ? "text-theme-400" : "text-white/60"])
2317
+ class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", L.value ? "text-theme-400" : "text-white/60"])
2315
2318
  }, [
2316
- v("i", {
2317
- class: y(["i-heroicons-cloud-arrow-down size-8", M.value ? "text-theme-300" : "text-white/40"])
2319
+ T("i", {
2320
+ class: _(["i-heroicons-cloud-arrow-down size-8", L.value ? "text-theme-300" : "text-white/40"])
2318
2321
  }, null, 2),
2319
- v("span", null, ue(he.value), 1)
2320
- ], 2)) : P.value ? (T(), S("div", {
2322
+ T("span", null, ue($.value), 1)
2323
+ ], 2)) : ne.value ? (A(), E("div", {
2321
2324
  key: 2,
2322
- class: y(["py-16 flex flex-col items-center justify-center gap-2 text-sm", M.value ? "text-theme-400" : "text-theme-600"])
2325
+ class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", L.value ? "text-theme-400" : "text-theme-600"])
2323
2326
  }, [
2324
2327
  Bt(Cn, { class: "size-4" })
2325
- ], 2)) : r.value ? (T(), S("div", {
2328
+ ], 2)) : r.value ? (A(), E("div", {
2326
2329
  key: 3,
2327
- class: y(["flex items-center justify-center gap-1.5 py-2 text-[11px]", M.value ? "text-theme-300" : "text-white/30"])
2330
+ class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", U.value])
2328
2331
  }, [
2329
- x[4] || (x[4] = v("i", { class: "i-tabler-tool size-3" }, null, -1)),
2330
- v("span", null, ue(r.value), 1)
2331
- ], 2)) : B("", !0),
2332
- v("div", {
2332
+ v[5] || (v[5] = T("i", { class: "i-tabler-tool size-3" }, null, -1)),
2333
+ T("span", null, ue(r.value), 1)
2334
+ ], 2)) : G("", !0),
2335
+ T("div", {
2333
2336
  ref_key: "messagesContainer",
2334
- ref: g,
2337
+ ref: d,
2335
2338
  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"
2336
2339
  }, [
2337
- q.value.length === 0 && !P.value && !ne.value ? (T(), S("div", Xr, [
2338
- v("div", Kr, [
2339
- v("img", {
2340
+ j.value.length === 0 && !ne.value && !me.value ? (A(), E("div", Xr, [
2341
+ T("div", Kr, [
2342
+ T("img", {
2340
2343
  src: l.agent.avatarUrl.value,
2341
2344
  alt: l.agent.displayName.value,
2342
- class: y(["rounded-full object-cover", o.value ? "size-28" : "size-20"])
2345
+ class: _(["size-full rounded-full object-cover ring-1", L.value ? "ring-black/5" : "ring-white/10"])
2343
2346
  }, null, 10, Qr),
2344
- ee.value ? (T(), S("span", {
2347
+ O.value ? (A(), E("span", {
2345
2348
  key: 0,
2346
- class: y(["absolute bottom-0.5 right-0.5 flex items-center justify-center", o.value ? "size-6" : "size-5"])
2347
- }, [
2348
- v("span", {
2349
- class: y(["absolute inline-flex rounded-full bg-emerald-400/40 animate-ping", o.value ? "size-4" : "size-3"]),
2350
- style: { "animation-duration": "2.5s" }
2351
- }, null, 2),
2352
- v("span", {
2353
- class: y(["relative inline-flex rounded-full bg-emerald-500 ring-2", [
2354
- o.value ? "size-3" : "size-2.5",
2355
- M.value ? "ring-white" : "ring-theme-900"
2356
- ]])
2357
- }, null, 2)
2358
- ], 2)) : B("", !0)
2349
+ 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"])
2350
+ }, [...v[6] || (v[6] = [
2351
+ T("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2352
+ ])], 2)) : G("", !0)
2359
2353
  ]),
2360
- v("div", {
2361
- class: y(["font-semibold", [M.value ? "text-theme-900" : "text-white", o.value ? "text-lg" : "text-base"]])
2354
+ T("div", {
2355
+ class: _(["text-base @sm/chat:text-lg font-semibold", L.value ? "text-theme-900" : "text-white"])
2362
2356
  }, ue(l.agent.displayName.value), 3),
2363
- v("p", {
2364
- class: y(["mt-1 text-center", [M.value ? "text-theme-300" : "text-white/30", o.value ? "text-sm" : "text-xs"]])
2357
+ T("p", {
2358
+ class: _(["mt-1 text-center text-xs @sm/chat:text-sm", U.value])
2365
2359
  }, ue(l.emptyStateMessage || "Send a message to get started"), 3),
2366
- v("div", {
2367
- class: y(["inline-flex items-center gap-1.5 mt-6 px-2.5 py-1 rounded-full text-[11px]", M.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2360
+ T("div", {
2361
+ 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"]),
2368
2362
  title: a.value.tooltip
2369
2363
  }, [
2370
- v("i", {
2371
- class: y([a.value.icon, "size-3"])
2364
+ T("i", {
2365
+ class: _([a.value.icon, "size-3"])
2372
2366
  }, null, 2),
2373
- v("span", null, ue(a.value.label), 1)
2367
+ T("span", null, ue(a.value.label), 1)
2374
2368
  ], 10, Jr)
2375
- ])) : B("", !0),
2376
- (T(!0), S(Te, null, gt(q.value, (R, A) => (T(), S(Te, {
2377
- key: R.id
2369
+ ])) : G("", !0),
2370
+ (A(!0), E(Te, null, mt(j.value, (k, z) => (A(), E(Te, {
2371
+ key: k.id
2378
2372
  }, [
2379
- He(q.value, A) ? (T(), S("div", ei, [
2380
- v("div", {
2381
- class: y(["flex-1 h-px", M.value ? "bg-theme-200" : "bg-white/10"])
2373
+ rt(j.value, z) ? (A(), E("div", ei, [
2374
+ T("div", {
2375
+ class: _(["flex-1 h-px", nt.value])
2382
2376
  }, null, 2),
2383
- v("span", {
2384
- class: y(["font-medium shrink-0", [M.value ? "text-theme-400" : "text-white/40", o.value ? "text-xs" : "text-[11px]"]])
2385
- }, ue(He(q.value, A)), 3),
2386
- v("div", {
2387
- class: y(["flex-1 h-px", M.value ? "bg-theme-200" : "bg-white/10"])
2377
+ T("span", {
2378
+ class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", U.value])
2379
+ }, ue(rt(j.value, z)), 3),
2380
+ T("div", {
2381
+ class: _(["flex-1 h-px", nt.value])
2388
2382
  }, null, 2)
2389
- ])) : B("", !0),
2390
- v("div", {
2391
- class: y(["flex gap-2 items-end", {
2392
- "justify-end": R.sender === "user",
2393
- "justify-start": R.sender === "agent",
2394
- "mb-4": _(q.value, A)
2383
+ ])) : G("", !0),
2384
+ T("div", {
2385
+ class: _(["flex gap-2 items-end", {
2386
+ "justify-end": k.sender === "user",
2387
+ "justify-start": k.sender === "agent",
2388
+ "mb-4": y(j.value, z)
2395
2389
  }])
2396
2390
  }, [
2397
- R.sender === "agent" ? (T(), S("div", {
2398
- key: 0,
2399
- class: y(["flex-shrink-0", o.value ? "size-10" : "size-8"])
2400
- }, [
2401
- _(q.value, A) ? (T(), S("img", {
2391
+ k.sender === "agent" ? (A(), E("div", ti, [
2392
+ y(j.value, z) ? (A(), E("img", {
2402
2393
  key: 0,
2403
2394
  src: l.agent.avatarUrl.value,
2404
2395
  alt: l.agent.displayName.value,
2405
- class: y(["rounded-full object-cover", o.value ? "size-10" : "size-7"])
2406
- }, null, 10, ti)) : B("", !0)
2407
- ], 2)) : B("", !0),
2408
- v("div", {
2409
- class: y(R.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2396
+ class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", L.value ? "ring-1 ring-black/5" : ""])
2397
+ }, null, 10, ni)) : G("", !0)
2398
+ ])) : G("", !0),
2399
+ T("div", {
2400
+ class: _(k.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2410
2401
  }, [
2411
- R.attachments?.length ? (T(), S("div", {
2402
+ k.attachments?.length ? (A(), E("div", {
2412
2403
  key: 0,
2413
- class: y(["mb-1 space-y-1", R.sender === "user" ? "flex flex-col items-end" : ""])
2404
+ class: _(["mb-1 space-y-1", k.sender === "user" ? "flex flex-col items-end" : ""])
2414
2405
  }, [
2415
- (T(!0), S(Te, null, gt(R.attachments, (H, z) => (T(), S(Te, { key: z }, [
2416
- H.type === "image" ? (T(), S("img", {
2406
+ (A(!0), E(Te, null, mt(k.attachments, (D, J) => (A(), E(Te, { key: J }, [
2407
+ D.type === "image" ? (A(), E("img", {
2417
2408
  key: 0,
2418
- src: H.url,
2419
- alt: H.name,
2420
- class: y(["rounded-xl object-cover max-h-48", o.value ? "max-w-[320px]" : "max-w-[240px]"])
2421
- }, null, 10, ni)) : H.type === "audio" ? (T(), S("audio", {
2409
+ src: D.url,
2410
+ alt: D.name,
2411
+ class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2412
+ }, null, 8, si)) : D.type === "audio" ? (A(), E("audio", {
2422
2413
  key: 1,
2423
- src: H.url,
2414
+ src: D.url,
2424
2415
  controls: "",
2425
2416
  class: "max-w-full"
2426
- }, null, 8, si)) : (T(), S("a", {
2417
+ }, null, 8, ri)) : (A(), E("a", {
2427
2418
  key: 2,
2428
- href: H.url,
2419
+ href: D.url,
2429
2420
  target: "_blank",
2430
2421
  rel: "noopener",
2431
- class: y(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", M.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2422
+ 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"])
2432
2423
  }, [
2433
- x[5] || (x[5] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2434
- ht(" " + ue(H.name), 1)
2435
- ], 10, ri))
2424
+ v[7] || (v[7] = T("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2425
+ pt(" " + ue(D.name), 1)
2426
+ ], 10, ii))
2436
2427
  ], 64))), 128))
2437
- ], 2)) : B("", !0),
2438
- R.text ? (T(), S("div", {
2428
+ ], 2)) : G("", !0),
2429
+ k.text ? (A(), E("div", {
2439
2430
  key: 1,
2440
- class: y(["rounded-2xl px-3.5 py-2", R.sender === "user" ? "bg-primary-500 text-white" : M.value ? "bg-theme-100 text-theme-800" : "bg-white/15 backdrop-blur-sm text-white/95"])
2431
+ class: _(["rounded-2xl px-3.5 py-2", [
2432
+ 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]"
2433
+ ]])
2441
2434
  }, [
2442
- v("div", {
2443
- class: y(["chat-msg-prose break-words", [
2444
- o.value ? "text-[15px] leading-[1.6]" : "text-[13px] leading-[1.55]",
2445
- R.sender === "user" || !M.value ? "chat-msg-prose-invert" : ""
2446
- ]]),
2447
- innerHTML: e(R.text)
2448
- }, null, 10, ii)
2449
- ], 2)) : B("", !0)
2435
+ T("div", {
2436
+ 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" : ""]),
2437
+ innerHTML: e(k.text)
2438
+ }, null, 10, ai)
2439
+ ], 2)) : G("", !0)
2450
2440
  ], 2)
2451
2441
  ], 2)
2452
2442
  ], 64))), 128)),
2453
- Re.value ? (T(), S("div", ai, [
2454
- v("div", li, [
2455
- v("img", {
2456
- src: l.agent.avatarUrl.value,
2457
- alt: l.agent.displayName.value,
2458
- class: y(["rounded-full object-cover", o.value ? "size-10" : "size-8"])
2459
- }, null, 10, oi)
2460
- ]),
2461
- v("div", {
2462
- class: y(["rounded-2xl px-4 py-2.5 flex items-center", M.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2443
+ ge.value ? (A(), E("div", li, [
2444
+ T("img", {
2445
+ src: l.agent.avatarUrl.value,
2446
+ alt: l.agent.displayName.value,
2447
+ class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", L.value ? "ring-1 ring-black/5" : ""])
2448
+ }, null, 10, oi),
2449
+ T("div", {
2450
+ class: _(["rounded-2xl px-3.5 py-2.5 flex items-center", L.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2463
2451
  }, [
2464
- v("i", {
2465
- class: y(["i-svg-spinners-3-dots-fade size-6", M.value ? "text-theme-400" : "text-white/70"])
2452
+ T("i", {
2453
+ class: _(["i-svg-spinners-3-dots-bounce size-7", L.value ? "text-theme-400" : "text-white/50"])
2466
2454
  }, null, 2)
2467
2455
  ], 2)
2468
- ])) : B("", !0)
2456
+ ])) : G("", !0)
2469
2457
  ], 512),
2470
- v("div", {
2471
- class: y(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", M.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"])
2458
+ T("div", {
2459
+ 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"])
2472
2460
  }, [
2473
- f.value.length > 0 ? (T(), S("div", ci, [
2474
- (T(!0), S(Te, null, gt(f.value, (R, A) => (T(), S("div", {
2475
- key: A,
2461
+ g.value.length > 0 ? (A(), E("div", ci, [
2462
+ (A(!0), E(Te, null, mt(g.value, (k, z) => (A(), E("div", {
2463
+ key: z,
2476
2464
  class: "relative shrink-0 group"
2477
2465
  }, [
2478
- R.type === "image" ? (T(), S("img", {
2466
+ k.type === "image" ? (A(), E("img", {
2479
2467
  key: 0,
2480
- src: R.url,
2481
- alt: R.name,
2482
- class: y(["size-14 rounded-xl object-cover border", M.value ? "border-black/10" : "border-white/20"])
2483
- }, null, 10, ui)) : (T(), S("div", {
2468
+ src: k.url,
2469
+ alt: k.name,
2470
+ class: _(["size-14 rounded-xl object-cover border", L.value ? "border-black/10" : "border-white/20"])
2471
+ }, null, 10, ui)) : (A(), E("div", {
2484
2472
  key: 1,
2485
- class: y(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", M.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2473
+ 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"])
2486
2474
  }, [
2487
- x[6] || (x[6] = v("i", { class: "i-tabler-file size-4" }, null, -1)),
2488
- v("span", hi, ue(R.name), 1)
2475
+ v[8] || (v[8] = T("i", { class: "i-tabler-file size-4" }, null, -1)),
2476
+ T("span", hi, ue(k.name), 1)
2489
2477
  ], 2)),
2490
- v("button", {
2478
+ T("button", {
2491
2479
  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",
2492
- onClick: /* @__PURE__ */ u((H) => _t(A), "onClick")
2493
- }, [...x[7] || (x[7] = [
2494
- v("i", { class: "i-tabler-x size-3" }, null, -1)
2480
+ onClick: /* @__PURE__ */ u((D) => st(z), "onClick")
2481
+ }, [...v[9] || (v[9] = [
2482
+ T("i", { class: "i-tabler-x size-3" }, null, -1)
2495
2483
  ])], 8, pi)
2496
2484
  ]))), 128)),
2497
- k.value ? (T(), S("div", di, [
2485
+ m.value ? (A(), E("div", di, [
2498
2486
  Bt(Cn, { class: "size-5" })
2499
- ])) : B("", !0)
2500
- ])) : B("", !0),
2501
- l.uploadFn ? (T(), S("input", {
2487
+ ])) : G("", !0)
2488
+ ])) : G("", !0),
2489
+ l.uploadFn ? (A(), E("input", {
2502
2490
  key: 1,
2503
2491
  ref_key: "fileInput",
2504
- ref: m,
2492
+ ref: p,
2505
2493
  type: "file",
2506
2494
  accept: "image/*,audio/*,video/*",
2507
2495
  class: "hidden",
2508
- onChange: Et
2509
- }, null, 544)) : B("", !0),
2510
- v("div", {
2511
- class: y(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", M.value ? d.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" : d.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2496
+ onChange: _t
2497
+ }, null, 544)) : G("", !0),
2498
+ T("div", {
2499
+ 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"])
2512
2500
  }, [
2513
- l.uploadFn ? (T(), S("button", {
2514
- key: 0,
2515
- class: y(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 cursor-pointer", [
2516
- o.value ? "size-10" : "size-9",
2517
- M.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2518
- k.value ? "opacity-50 pointer-events-none" : ""
2501
+ T("button", {
2502
+ class: _(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2503
+ l.uploadFn ? "cursor-pointer" : "cursor-default",
2504
+ L.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2505
+ m.value ? "opacity-50 pointer-events-none" : ""
2519
2506
  ]]),
2520
- disabled: se.value || k.value,
2521
- onClick: At
2507
+ disabled: se.value || m.value || !l.uploadFn,
2508
+ onClick: v[0] || (v[0] = (k) => l.uploadFn && Et())
2522
2509
  }, [
2523
- k.value ? (T(), S("i", gi)) : (T(), S("i", mi))
2524
- ], 10, fi)) : B("", !0),
2525
- Zn(v("textarea", {
2510
+ m.value ? (A(), E("i", gi)) : (A(), E("i", mi))
2511
+ ], 10, fi),
2512
+ Zn(T("textarea", {
2526
2513
  ref_key: "textarea",
2527
- ref: p,
2528
- "onUpdate:modelValue": x[0] || (x[0] = (R) => c.value = R),
2514
+ ref: f,
2515
+ "onUpdate:modelValue": v[1] || (v[1] = (k) => o.value = k),
2529
2516
  rows: "1",
2530
2517
  enterkeyhint: "send",
2531
- placeholder: St.value,
2518
+ placeholder: he.value,
2532
2519
  disabled: se.value,
2533
2520
  style: { fontSize: "16px", resize: "none" },
2534
- class: y(["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", M.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2535
- onKeydown: F,
2536
- onFocus: x[1] || (x[1] = (R) => d.value = !0),
2537
- onBlur: x[2] || (x[2] = (R) => d.value = !1)
2521
+ 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"]),
2522
+ onKeydown: Fe,
2523
+ onFocus: v[2] || (v[2] = (k) => c.value = !0),
2524
+ onBlur: v[3] || (v[3] = (k) => c.value = !1)
2538
2525
  }, null, 42, xi), [
2539
- [Xn, c.value]
2526
+ [Xn, o.value]
2540
2527
  ]),
2541
- v("button", {
2542
- class: y(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5", [
2543
- o.value ? "size-10" : "size-9",
2544
- tt.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : M.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"
2545
- ]]),
2528
+ T("button", {
2529
+ 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", tt.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"]),
2546
2530
  disabled: !tt.value,
2547
- onClick: x[3] || (x[3] = (R) => nt())
2548
- }, [...x[8] || (x[8] = [
2549
- v("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2531
+ onClick: v[4] || (v[4] = (k) => Re())
2532
+ }, [...v[10] || (v[10] = [
2533
+ T("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2550
2534
  ])], 10, bi)
2551
2535
  ], 2),
2552
- v("div", {
2553
- class: y(["text-[10px] text-center mt-2.5 select-none opacity-70", M.value ? "text-theme-400" : "text-white/50"])
2536
+ T("div", {
2537
+ class: _(["text-[10px] text-center mt-2.5 select-none opacity-70", L.value ? "text-theme-400" : "text-white/50"])
2554
2538
  }, [
2555
- x[9] || (x[9] = ht(" Press ", -1)),
2556
- v("kbd", {
2557
- class: y(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", M.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2539
+ v[11] || (v[11] = pt(" Press ", -1)),
2540
+ T("kbd", {
2541
+ 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"])
2558
2542
  }, "Enter", 2),
2559
- x[10] || (x[10] = ht(" to send, ", -1)),
2560
- v("kbd", {
2561
- class: y(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", M.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2543
+ v[12] || (v[12] = pt(" to send, ", -1)),
2544
+ T("kbd", {
2545
+ 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"])
2562
2546
  }, "Shift+Enter", 2),
2563
- x[11] || (x[11] = ht(" for new line ", -1))
2547
+ v[13] || (v[13] = pt(" for new line ", -1))
2564
2548
  ], 2)
2565
2549
  ], 2)
2566
2550
  ]));
@@ -2585,7 +2569,7 @@ const Yr = { class: "flex flex-col h-full relative" }, Zr = {
2585
2569
  const t = Ts("AgentWrap"), e = l, n = e.sdk || Ss.getInstance({
2586
2570
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2587
2571
  ...e.apiBase && { apiBase: e.apiBase }
2588
- }), s = Y(!e.agent), r = vs(e.agent ? new bt({ config: e.agent }) : void 0), a = Y();
2572
+ }), s = V(!e.agent), r = vs(e.agent ? new kt({ config: e.agent }) : void 0), a = V();
2589
2573
  return Kt(async () => {
2590
2574
  if (e.agent) {
2591
2575
  t.debug("Agent provided via props, skipping fetch", {
@@ -2612,7 +2596,7 @@ const Yr = { class: "flex flex-col h-full relative" }, Zr = {
2612
2596
  try {
2613
2597
  s.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2614
2598
  const o = await n.getPublicAgent({ handle: e.handle });
2615
- o ? (r.value = new bt({ config: o }), t.debug("Successfully fetched public agent", {
2599
+ o ? (r.value = new kt({ config: o }), t.debug("Successfully fetched public agent", {
2616
2600
  agentId: o.agentId,
2617
2601
  handle: o.handle
2618
2602
  }), o.agentId && n.track({
@@ -2662,9 +2646,9 @@ const Yr = { class: "flex flex-col h-full relative" }, Zr = {
2662
2646
  }
2663
2647
  });
2664
2648
  }
2665
- }), (o, c) => (T(), S("div", ki, [
2666
- s.value ? (T(), S("div", wi, [...c[0] || (c[0] = [
2667
- v("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2649
+ }), (o, c) => (A(), E("div", ki, [
2650
+ s.value ? (A(), E("div", wi, [...c[0] || (c[0] = [
2651
+ T("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2668
2652
  ])])) : r.value ? Yn(o.$slots, "default", {
2669
2653
  key: 1,
2670
2654
  sdk: Vt(n),
@@ -2674,7 +2658,7 @@ const Yr = { class: "flex flex-col h-full relative" }, Zr = {
2674
2658
  buttonText: l.buttonText,
2675
2659
  buttonIcon: l.buttonIcon,
2676
2660
  loading: s.value
2677
- }) : B("", !0)
2661
+ }) : G("", !0)
2678
2662
  ]));
2679
2663
  }
2680
2664
  });