@pagelines/sdk 1.0.506 → 1.0.508

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
1
  var Mn = Object.defineProperty;
2
- var Rs = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var h = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
4
- var I = (a, t, e) => Rs(a, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as Me, openBlock as T, createElementBlock as S, createElementVNode as w, normalizeClass as A, ref as ee, watch as Ye, computed as W, createCommentVNode as U, renderSlot as ns, onMounted as tn, Fragment as Te, renderList as at, withDirectives as ss, vModelText as rs, unref as Kt, toDisplayString as ie, nextTick as jt, createVNode as Wt, createTextVNode as et, withModifiers as Cs, shallowRef as Is } from "vue";
6
- import { SettingsObject as Ds, Agent as yt, getDefaultAvatarUrl as is, createLogger as Ms } from "@pagelines/core";
7
- import { P as Ls } from "./sdkClient.js";
8
- const Os = { class: "spinner max-w-sm" }, zs = {
2
+ var Cs = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var p = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
4
+ var I = (a, t, e) => Cs(a, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as ke, openBlock as y, createElementBlock as T, createElementVNode as v, normalizeClass as E, ref as Z, watch as qe, computed as $, createCommentVNode as B, renderSlot as en, onMounted as St, Fragment as Te, renderList as at, withDirectives as ns, vModelText as ss, unref as Xt, toDisplayString as re, shallowRef as rs, onBeforeUnmount as is, nextTick as Is, createVNode as Je, withCtx as Ds, createTextVNode as et, withModifiers as Ms } from "vue";
6
+ import { SettingsObject as Ls, Agent as wt, getDefaultAvatarUrl as as, createLogger as Os } from "@pagelines/core";
7
+ import { P as zs } from "./sdkClient.js";
8
+ const Ps = { class: "spinner max-w-sm" }, Ns = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
- }, Ln = /* @__PURE__ */ Me({
11
+ }, Ln = /* @__PURE__ */ ke({
12
12
  __name: "FSpinner",
13
13
  props: {
14
14
  width: { type: String, default: "" },
15
15
  colorMode: { type: String, default: "primary" }
16
16
  },
17
17
  setup(a) {
18
- return (t, e) => (T(), S("div", Os, [
19
- (T(), S("svg", zs, [
20
- w("circle", {
21
- class: A([a.colorMode, "ring-path"]),
18
+ return (t, e) => (y(), T("div", Ps, [
19
+ (y(), T("svg", Ns, [
20
+ v("circle", {
21
+ class: E([a.colorMode, "ring-path"]),
22
22
  cx: "50",
23
23
  cy: "50",
24
24
  r: "20",
@@ -30,10 +30,10 @@ const Os = { class: "spinner max-w-sm" }, zs = {
30
30
  ]))
31
31
  ]));
32
32
  }
33
- }), Ps = [
33
+ }), $s = [
34
34
  { pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
35
35
  { pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
36
- ], Ns = 9e4, as = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), $s = /* @__PURE__ */ new Set([...as, "EMPTY_STREAM", "RATE_LIMIT"]), pn = class pn extends Ds {
36
+ ], Us = 9e4, ls = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Bs = /* @__PURE__ */ new Set([...ls, "EMPTY_STREAM", "RATE_LIMIT"]), hn = class hn extends Ls {
37
37
  constructor(e) {
38
38
  super("AgentChatController", e);
39
39
  I(this, "isTextMode", !1);
@@ -41,16 +41,16 @@ const Os = { class: "spinner max-w-sm" }, zs = {
41
41
  I(this, "isConnecting", !1);
42
42
  // Chat conversation tracking (server-managed persistence)
43
43
  I(this, "conversationId");
44
- I(this, "textState", ee({
44
+ I(this, "textState", Z({
45
45
  isActive: !1,
46
46
  isConnected: !1,
47
47
  isThinking: !1,
48
48
  connectionStatus: "disconnected"
49
49
  }));
50
- I(this, "agentMode", ee("self"));
51
- I(this, "sharedMessages", ee([]));
50
+ I(this, "agentMode", Z("self"));
51
+ I(this, "sharedMessages", Z([]));
52
52
  I(this, "_agent");
53
- this._agent = e.agent instanceof yt ? e.agent : new yt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
53
+ this._agent = e.agent instanceof wt ? e.agent : new wt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
54
54
  }
55
55
  get chatEnabled() {
56
56
  return this._agent.chatAvailable.value;
@@ -72,8 +72,8 @@ const Os = { class: "spinner max-w-sm" }, zs = {
72
72
  return e.includes("timed out") || e.includes("starting up") || e.includes("503") || e.includes("429") || e.includes("[no-reply]") || e.includes("[stream-open]") || e.includes("[stream-read]") || e.includes("[api]");
73
73
  }
74
74
  isDuplicateMessage(e, n) {
75
- const r = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), o = r === this.lastMessage.hash && s - this.lastMessage.time < 500;
76
- return o || (this.lastMessage = { hash: r, time: s }), o;
75
+ const r = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), l = r === this.lastMessage.hash && s - this.lastMessage.time < 500;
76
+ return l || (this.lastMessage = { hash: r, time: s }), l;
77
77
  }
78
78
  addMessage(e, n, r, s) {
79
79
  this.isDuplicateMessage(e, n) || (this.sharedMessages.value = [
@@ -96,7 +96,7 @@ const Os = { class: "spinner max-w-sm" }, zs = {
96
96
  getDynamicSettings() {
97
97
  const { sdk: e } = this.settings;
98
98
  if (!e) return { context: this.settings.context || "", firstMessage: this.settings.firstMessage || "" };
99
- const n = e.activeUser.value, r = n?.agents?.find((o) => o.agentId === n.primaryAgentId), s = n ? `
99
+ const n = e.activeUser.value, r = n?.agents?.find((l) => l.agentId === n.primaryAgentId), s = n ? `
100
100
 
101
101
  Current User:
102
102
  - Name: ${r?.name || "Anonymous"}
@@ -122,12 +122,12 @@ Current User:
122
122
  });
123
123
  }
124
124
  setupModeWatcher() {
125
- Ye(this.agentMode, async (e, n) => {
125
+ qe(this.agentMode, async (e, n) => {
126
126
  this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
127
127
  });
128
128
  }
129
129
  setupAvailabilityWatcher() {
130
- Ye(() => this._agent.chatAvailable.value, (e) => {
130
+ qe(() => this._agent.chatAvailable.value, (e) => {
131
131
  if (!(!this.isTextMode || this.isConnecting)) {
132
132
  if (e) {
133
133
  this.textState.value.isConnected || this.updateState(this.textState, {
@@ -225,77 +225,77 @@ Current User:
225
225
  return;
226
226
  }
227
227
  this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
228
- const o = `stream-${Date.now()}`;
229
- let l = !1;
230
- const m = /* @__PURE__ */ h((d) => {
231
- l || (l = !0, this.sharedMessages.value = [
228
+ const l = `stream-${Date.now()}`;
229
+ let o = !1;
230
+ const d = /* @__PURE__ */ p((m) => {
231
+ o || (o = !0, this.sharedMessages.value = [
232
232
  ...this.sharedMessages.value,
233
- { id: o, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
233
+ { id: l, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
234
234
  ]);
235
- const g = this.sharedMessages.value, y = g[g.length - 1];
236
- y?.id === o && (y.text += d, this.sharedMessages.value = [...g]);
237
- }, "onDelta"), c = /* @__PURE__ */ h((d) => {
238
- if (!l) {
235
+ const f = this.sharedMessages.value, w = f[f.length - 1];
236
+ w?.id === l && (w.text += m, this.sharedMessages.value = [...f]);
237
+ }, "onDelta"), c = /* @__PURE__ */ p((m) => {
238
+ if (!o) {
239
239
  b("empty_stream — assistant returned no content");
240
240
  return;
241
241
  }
242
- const g = this.sharedMessages.value, y = g[g.length - 1];
243
- if (y?.id === o && y.text) {
244
- let E = y.text;
245
- for (const O of Ps)
246
- O.pattern.test(E) && (console.debug(`[chat] filtered directive: ${O.label}`), E = E.replace(O.pattern, "").trim(), O.pattern.lastIndex = 0);
247
- E ? E !== y.text && (y.text = E, this.sharedMessages.value = [...g]) : this.sharedMessages.value = g.slice(0, -1);
248
- }
249
- d && (this.conversationId = d), this.updateState(this.textState, { isThinking: !1 });
250
- }, "onDone"), b = /* @__PURE__ */ h((d) => {
251
- const g = this.sharedMessages.value, y = g[g.length - 1];
252
- if (y?.id === o && !y.text && (this.sharedMessages.value = g.slice(0, -1)), typeof d == "object" && d.code && d.error) {
253
- const { bucket: ce, actionUrl: ue, actionLabel: ne, help: N } = d;
254
- if (ce !== void 0 || $s.has(d.code)) {
255
- const ae = ce ?? (as.has(d.code) ? "account" : "error"), Q = {
256
- code: d.code,
242
+ const f = this.sharedMessages.value, w = f[f.length - 1];
243
+ if (w?.id === l && w.text) {
244
+ let _ = w.text;
245
+ for (const O of $s)
246
+ O.pattern.test(_) && (console.debug(`[chat] filtered directive: ${O.label}`), _ = _.replace(O.pattern, "").trim(), O.pattern.lastIndex = 0);
247
+ _ ? _ !== w.text && (w.text = _, this.sharedMessages.value = [...f]) : this.sharedMessages.value = f.slice(0, -1);
248
+ }
249
+ m && (this.conversationId = m), this.updateState(this.textState, { isThinking: !1 });
250
+ }, "onDone"), b = /* @__PURE__ */ p((m) => {
251
+ const f = this.sharedMessages.value, w = f[f.length - 1];
252
+ if (w?.id === l && !w.text && (this.sharedMessages.value = f.slice(0, -1)), typeof m == "object" && m.code && m.error) {
253
+ const { bucket: ie, actionUrl: be, actionLabel: G, help: P } = m;
254
+ if (ie !== void 0 || Bs.has(m.code)) {
255
+ const ae = ie ?? (ls.has(m.code) ? "account" : "error"), Q = {
256
+ code: m.code,
257
257
  bucket: ae,
258
- ...ne ? { actionLabel: ne } : {},
259
- ...ue ? { actionUrl: ue } : {},
260
- ...N ? { help: N } : {}
258
+ ...G ? { actionLabel: G } : {},
259
+ ...be ? { actionUrl: be } : {},
260
+ ...P ? { help: P } : {}
261
261
  };
262
- this.addMessage(d.error, "system", void 0, Q), ae === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
262
+ this.addMessage(m.error, "system", void 0, Q), ae === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
263
263
  } else
264
- this.handleError(new Error(d.error));
264
+ this.handleError(new Error(m.error));
265
265
  return;
266
266
  }
267
- const E = typeof d == "string" ? d : d.error, O = this.mapChatError(E);
268
- this.isTransientError(E) ? (this.logger.warn("Chat turn failed (transient):", { raw: E, friendly: O }), this.addMessage(O, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(O), E);
269
- }, "onError"), p = /* @__PURE__ */ h((d) => {
270
- this.addMessage(d, "system");
267
+ const _ = typeof m == "string" ? m : m.error, O = this.mapChatError(_);
268
+ this.isTransientError(_) ? (this.logger.warn("Chat turn failed (transient):", { raw: _, friendly: O }), this.addMessage(O, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(O), _);
269
+ }, "onError"), u = /* @__PURE__ */ p((m) => {
270
+ this.addMessage(m, "system");
271
271
  }, "onStatus");
272
272
  try {
273
- const d = r ? r({
273
+ const m = r ? r({
274
274
  message: e,
275
275
  attachments: n,
276
276
  conversationId: this.conversationId,
277
277
  history: this.buildHistory(),
278
- onDelta: m,
278
+ onDelta: d,
279
279
  onDone: c,
280
280
  onError: b,
281
- onStatus: p
281
+ onStatus: u
282
282
  }) : s.chat.chatStreamPublic({
283
283
  handle: this._agent.handle.value,
284
284
  message: e,
285
285
  attachments: n,
286
286
  anonymousId: s.user.generateAnonId(),
287
287
  context: this.getDynamicSettings().context || void 0,
288
- onDelta: m,
288
+ onDelta: d,
289
289
  onDone: c,
290
290
  onError: b,
291
- onStatus: p
291
+ onStatus: u
292
292
  });
293
293
  await Promise.race([
294
- d,
295
- new Promise((g, y) => setTimeout(() => y(new Error("timed out")), Ns))
294
+ m,
295
+ new Promise((f, w) => setTimeout(() => w(new Error("timed out")), Us))
296
296
  ]);
297
- } catch (d) {
298
- b(d.message || "Something went wrong");
297
+ } catch (m) {
298
+ b(m.message || "Something went wrong");
299
299
  }
300
300
  }
301
301
  buildHistory() {
@@ -319,30 +319,30 @@ Current User:
319
319
  await this.endConversation();
320
320
  }
321
321
  };
322
- h(pn, "AgentChatController");
323
- let On = pn;
322
+ p(hn, "AgentChatController");
323
+ let On = hn;
324
324
  function zn(a) {
325
325
  return a ? typeof a == "string" ? a : a.src || "" : "";
326
326
  }
327
- h(zn, "getImageSrc");
328
- function Wi(a) {
329
- return zn(a.cover) || zn(a.avatar) || is(a.name);
327
+ p(zn, "getImageSrc");
328
+ function Ki(a) {
329
+ return zn(a.cover) || zn(a.avatar) || as(a.name);
330
330
  }
331
- h(Wi, "getAgentAvatarUrl");
331
+ p(Ki, "getAgentAvatarUrl");
332
332
  function Pn(a) {
333
333
  const t = a.target;
334
- t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = is());
334
+ t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = as());
335
335
  }
336
- h(Pn, "handleImageError");
337
- function qi(a) {
336
+ p(Pn, "handleImageError");
337
+ function Qi(a) {
338
338
  const { template: t, agent: e } = a;
339
339
  return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
340
340
  }
341
- h(qi, "parseButtonTemplate");
342
- const Us = {
341
+ p(Qi, "parseButtonTemplate");
342
+ const Fs = {
343
343
  key: 0,
344
344
  class: "absolute inset-0 flex items-center justify-center"
345
- }, Vi = /* @__PURE__ */ Me({
345
+ }, Ji = /* @__PURE__ */ ke({
346
346
  __name: "ElAgentButton",
347
347
  props: {
348
348
  theme: { default: "primary" },
@@ -352,42 +352,42 @@ const Us = {
352
352
  iconAfter: {}
353
353
  },
354
354
  setup(a) {
355
- const t = W(() => ({
355
+ const t = $(() => ({
356
356
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
357
357
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
358
358
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
359
359
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
360
- })[a.theme]), e = W(() => ({
360
+ })[a.theme]), e = $(() => ({
361
361
  sm: "px-4 py-2 text-sm",
362
362
  md: "px-6 py-3 text-base",
363
363
  lg: "px-8 py-4 text-base"
364
- })[a.size]), n = W(() => ({
364
+ })[a.size]), n = $(() => ({
365
365
  sm: "size-4",
366
366
  md: "size-4",
367
367
  lg: "size-5"
368
368
  })[a.size]);
369
- return (r, s) => (T(), S("button", {
370
- class: A(["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]])
369
+ return (r, s) => (y(), T("button", {
370
+ class: E(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
371
371
  }, [
372
- a.loading ? (T(), S("div", Us, [...s[0] || (s[0] = [
373
- w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
374
- ])])) : U("", !0),
375
- w("span", {
376
- class: A(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
372
+ a.loading ? (y(), T("div", Fs, [...s[0] || (s[0] = [
373
+ v("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
374
+ ])])) : B("", !0),
375
+ v("span", {
376
+ class: E(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
377
377
  }, [
378
- a.icon ? (T(), S("i", {
378
+ a.icon ? (y(), T("i", {
379
379
  key: 0,
380
- class: A([a.icon, n.value])
381
- }, null, 2)) : U("", !0),
382
- ns(r.$slots, "default"),
383
- a.iconAfter ? (T(), S("i", {
380
+ class: E([a.icon, n.value])
381
+ }, null, 2)) : B("", !0),
382
+ en(r.$slots, "default"),
383
+ a.iconAfter ? (y(), T("i", {
384
384
  key: 1,
385
- class: A([a.iconAfter, n.value])
386
- }, null, 2)) : U("", !0)
385
+ class: E([a.iconAfter, n.value])
386
+ }, null, 2)) : B("", !0)
387
387
  ], 2)
388
388
  ], 2));
389
389
  }
390
- }), Bs = ["value"], Yi = /* @__PURE__ */ Me({
390
+ }), Hs = ["value"], ea = /* @__PURE__ */ ke({
391
391
  __name: "AgentInputEmail",
392
392
  props: {
393
393
  modelValue: { default: "" }
@@ -395,7 +395,7 @@ const Us = {
395
395
  emits: ["update:modelValue"],
396
396
  setup(a, { emit: t }) {
397
397
  const e = t;
398
- return (n, r) => (T(), S("input", {
398
+ return (n, r) => (y(), T("input", {
399
399
  type: "email",
400
400
  autocomplete: "email",
401
401
  placeholder: "Enter your email",
@@ -403,9 +403,9 @@ const Us = {
403
403
  class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-all",
404
404
  style: { "font-size": "16px" },
405
405
  onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
406
- }, null, 40, Bs));
406
+ }, null, 40, Hs));
407
407
  }
408
- }), Fs = { class: "flex gap-1.5 justify-center" }, Hs = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Zi = /* @__PURE__ */ Me({
408
+ }), Gs = { class: "flex gap-1.5 justify-center" }, js = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], ta = /* @__PURE__ */ ke({
409
409
  __name: "AgentInputOneTimeCode",
410
410
  props: {
411
411
  modelValue: {},
@@ -414,73 +414,73 @@ const Us = {
414
414
  },
415
415
  emits: ["update:modelValue", "autoSubmit"],
416
416
  setup(a, { emit: t }) {
417
- const e = a, n = t, r = ee([]), s = ee(Array.from({ length: e.length }).fill("")), o = ee(!1);
418
- tn(() => {
417
+ const e = a, n = t, r = Z([]), s = Z(Array.from({ length: e.length }).fill("")), l = Z(!1);
418
+ St(() => {
419
419
  e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
420
- }), Ye(() => e.modelValue, (p) => {
421
- s.value = p ? p.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
422
- }), Ye(s, () => {
423
- const p = s.value.filter(Boolean).join("");
424
- n("update:modelValue", p), p.length === e.length && n("autoSubmit", p);
420
+ }), qe(() => e.modelValue, (u) => {
421
+ s.value = u ? u.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
422
+ }), qe(s, () => {
423
+ const u = s.value.filter(Boolean).join("");
424
+ n("update:modelValue", u), u.length === e.length && n("autoSubmit", u);
425
425
  }, { deep: !0 });
426
- function l(p, d) {
427
- d.preventDefault(), o.value = !0;
428
- const g = (d.clipboardData?.getData("text") || "").replace(/\D/g, "");
429
- if (g.length === e.length)
430
- s.value = g.split(""), setTimeout(() => {
431
- r.value[e.length - 1]?.focus(), o.value = !1;
426
+ function o(u, m) {
427
+ m.preventDefault(), l.value = !0;
428
+ const f = (m.clipboardData?.getData("text") || "").replace(/\D/g, "");
429
+ if (f.length === e.length)
430
+ s.value = f.split(""), setTimeout(() => {
431
+ r.value[e.length - 1]?.focus(), l.value = !1;
432
432
  }, 10);
433
433
  else {
434
- const y = [...s.value];
435
- g.split("").slice(0, e.length - p).forEach((O, ce) => {
436
- y[p + ce] = O;
437
- }), s.value = y;
438
- const E = Math.min(p + g.length, e.length - 1);
434
+ const w = [...s.value];
435
+ f.split("").slice(0, e.length - u).forEach((O, ie) => {
436
+ w[u + ie] = O;
437
+ }), s.value = w;
438
+ const _ = Math.min(u + f.length, e.length - 1);
439
439
  setTimeout(() => {
440
- r.value[E]?.focus(), o.value = !1;
440
+ r.value[_]?.focus(), l.value = !1;
441
441
  }, 10);
442
442
  }
443
443
  }
444
- h(l, "onPaste");
445
- function m(p, d) {
446
- const g = d.target.value.slice(-1).replace(/\D/g, "");
447
- s.value[p] = g, g && p < e.length - 1 && r.value[p + 1]?.focus();
444
+ p(o, "onPaste");
445
+ function d(u, m) {
446
+ const f = m.target.value.slice(-1).replace(/\D/g, "");
447
+ s.value[u] = f, f && u < e.length - 1 && r.value[u + 1]?.focus();
448
448
  }
449
- h(m, "onInput");
450
- function c(p, d) {
451
- d.key === "Backspace" ? (d.preventDefault(), s.value[p] = "", p > 0 && r.value[p - 1]?.focus()) : d.key === "ArrowLeft" && p > 0 ? r.value[p - 1]?.focus() : d.key === "ArrowRight" && p < e.length - 1 && r.value[p + 1]?.focus();
449
+ p(d, "onInput");
450
+ function c(u, m) {
451
+ m.key === "Backspace" ? (m.preventDefault(), s.value[u] = "", u > 0 && r.value[u - 1]?.focus()) : m.key === "ArrowLeft" && u > 0 ? r.value[u - 1]?.focus() : m.key === "ArrowRight" && u < e.length - 1 && r.value[u + 1]?.focus();
452
452
  }
453
- h(c, "onKeydown");
454
- function b(p) {
455
- if (r.value[p]?.select(), !o.value && s.value[p])
456
- for (let d = p; d < e.length; d++)
457
- s.value[d] = "";
453
+ p(c, "onKeydown");
454
+ function b(u) {
455
+ if (r.value[u]?.select(), !l.value && s.value[u])
456
+ for (let m = u; m < e.length; m++)
457
+ s.value[m] = "";
458
458
  }
459
- return h(b, "onFocus"), (p, d) => (T(), S("div", Fs, [
460
- (T(!0), S(Te, null, at(a.length, (g) => ss((T(), S("input", {
461
- key: g,
459
+ return p(b, "onFocus"), (u, m) => (y(), T("div", Gs, [
460
+ (y(!0), T(Te, null, at(a.length, (f) => ns((y(), T("input", {
461
+ key: f,
462
462
  ref_for: !0,
463
- ref: /* @__PURE__ */ h((y) => r.value[g - 1] = y, "ref"),
464
- "onUpdate:modelValue": /* @__PURE__ */ h((y) => s.value[g - 1] = y, "onUpdate:modelValue"),
463
+ ref: /* @__PURE__ */ p((w) => r.value[f - 1] = w, "ref"),
464
+ "onUpdate:modelValue": /* @__PURE__ */ p((w) => s.value[f - 1] = w, "onUpdate:modelValue"),
465
465
  type: "text",
466
466
  inputmode: "numeric",
467
467
  autocomplete: "one-time-code",
468
468
  class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
469
469
  style: { "font-size": "16px" },
470
470
  maxlength: "1",
471
- onInput: /* @__PURE__ */ h((y) => m(g - 1, y), "onInput"),
472
- onKeydown: /* @__PURE__ */ h((y) => c(g - 1, y), "onKeydown"),
473
- onPaste: /* @__PURE__ */ h((y) => l(g - 1, y), "onPaste"),
474
- onFocus: /* @__PURE__ */ h((y) => b(g - 1), "onFocus")
475
- }, null, 40, Hs)), [
476
- [rs, s.value[g - 1]]
471
+ onInput: /* @__PURE__ */ p((w) => d(f - 1, w), "onInput"),
472
+ onKeydown: /* @__PURE__ */ p((w) => c(f - 1, w), "onKeydown"),
473
+ onPaste: /* @__PURE__ */ p((w) => o(f - 1, w), "onPaste"),
474
+ onFocus: /* @__PURE__ */ p((w) => b(f - 1), "onFocus")
475
+ }, null, 40, js)), [
476
+ [ss, s.value[f - 1]]
477
477
  ])), 128))
478
478
  ]));
479
479
  }
480
- }), Gs = { class: "relative flex-shrink-0" }, js = ["src", "alt"], Ws = { class: "absolute top-1 right-1" }, qs = {
480
+ }), Ws = { class: "relative flex-shrink-0" }, qs = ["src", "alt"], Vs = { class: "absolute top-1 right-1" }, Ys = {
481
481
  key: 1,
482
482
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
483
- }, Vs = { class: "min-w-0" }, Ys = /* @__PURE__ */ Me({
483
+ }, Zs = { class: "min-w-0" }, Xs = /* @__PURE__ */ ke({
484
484
  __name: "ElModeHeader",
485
485
  props: {
486
486
  agent: {},
@@ -489,136 +489,136 @@ const Us = {
489
489
  layout: { default: "centered" }
490
490
  },
491
491
  setup(a) {
492
- return (t, e) => (T(), S("div", {
493
- class: A(["flex gap-4", [
492
+ return (t, e) => (y(), T("div", {
493
+ class: E(["flex gap-4", [
494
494
  a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
495
495
  ]])
496
496
  }, [
497
- w("div", Gs, [
498
- w("div", {
499
- class: A(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
497
+ v("div", Ws, [
498
+ v("div", {
499
+ class: E(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
500
500
  }, [
501
- w("img", {
501
+ v("img", {
502
502
  src: a.agent.avatarUrl.value,
503
503
  alt: a.agent.displayName.value,
504
504
  class: "w-full h-full object-cover",
505
505
  onError: e[0] || (e[0] = //@ts-ignore
506
- (...n) => Kt(Pn) && Kt(Pn)(...n))
507
- }, null, 40, js)
506
+ (...n) => Xt(Pn) && Xt(Pn)(...n))
507
+ }, null, 40, qs)
508
508
  ], 2),
509
- w("div", Ws, [
510
- a.isOnline ? (T(), S(Te, { key: 0 }, [
511
- e[1] || (e[1] = w("div", {
509
+ v("div", Vs, [
510
+ a.isOnline ? (y(), T(Te, { key: 0 }, [
511
+ e[1] || (e[1] = v("div", {
512
512
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
513
513
  style: { "animation-duration": "3s" }
514
514
  }, null, -1)),
515
- e[2] || (e[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
516
- ], 64)) : (T(), S("div", qs))
515
+ e[2] || (e[2] = v("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
516
+ ], 64)) : (y(), T("div", Ys))
517
517
  ])
518
518
  ]),
519
- w("div", Vs, [
520
- w("h1", {
521
- class: A(["font-light text-white mb-1 truncate", [
519
+ v("div", Zs, [
520
+ v("h1", {
521
+ class: E(["font-light text-white mb-1 truncate", [
522
522
  a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
523
523
  a.layout === "horizontal" ? "text-white/95" : ""
524
524
  ]])
525
- }, ie(a.agent.displayName.value), 3),
526
- w("p", {
527
- class: A(["font-light line-clamp-1", [
525
+ }, re(a.agent.displayName.value), 3),
526
+ v("p", {
527
+ class: E(["font-light line-clamp-1", [
528
528
  a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
529
529
  a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
530
530
  ]])
531
- }, ie(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
531
+ }, re(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
532
532
  ])
533
533
  ], 2));
534
534
  }
535
535
  });
536
536
  const {
537
- entries: ls,
537
+ entries: os,
538
538
  setPrototypeOf: Nn,
539
- isFrozen: Zs,
540
- getPrototypeOf: Xs,
541
- getOwnPropertyDescriptor: Ks
539
+ isFrozen: Ks,
540
+ getPrototypeOf: Qs,
541
+ getOwnPropertyDescriptor: Js
542
542
  } = Object;
543
543
  let {
544
544
  freeze: te,
545
545
  seal: oe,
546
- create: He
546
+ create: Be
547
547
  } = Object, {
548
- apply: Qt,
549
- construct: Jt
548
+ apply: Kt,
549
+ construct: Qt
550
550
  } = typeof Reflect < "u" && Reflect;
551
- te || (te = /* @__PURE__ */ h(function(t) {
551
+ te || (te = /* @__PURE__ */ p(function(t) {
552
552
  return t;
553
553
  }, "freeze"));
554
- oe || (oe = /* @__PURE__ */ h(function(t) {
554
+ oe || (oe = /* @__PURE__ */ p(function(t) {
555
555
  return t;
556
556
  }, "seal"));
557
- Qt || (Qt = /* @__PURE__ */ h(function(t, e) {
557
+ Kt || (Kt = /* @__PURE__ */ p(function(t, e) {
558
558
  for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
559
559
  r[s - 2] = arguments[s];
560
560
  return t.apply(e, r);
561
561
  }, "apply"));
562
- Jt || (Jt = /* @__PURE__ */ h(function(t) {
562
+ Qt || (Qt = /* @__PURE__ */ p(function(t) {
563
563
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
564
564
  n[r - 1] = arguments[r];
565
565
  return new t(...n);
566
566
  }, "construct"));
567
- const tt = G(Array.prototype.forEach), Qs = G(Array.prototype.lastIndexOf), $n = G(Array.prototype.pop), nt = G(Array.prototype.push), Js = G(Array.prototype.splice), J = Array.isArray, lt = G(String.prototype.toLowerCase), qt = G(String.prototype.toString), Un = G(String.prototype.match), Fe = G(String.prototype.replace), Bn = G(String.prototype.indexOf), er = G(String.prototype.trim), tr = G(Number.prototype.toString), nr = G(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : G(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : G(Symbol.prototype.toString), $ = G(Object.prototype.hasOwnProperty), st = G(Object.prototype.toString), Z = G(RegExp.prototype.test), xt = sr(TypeError);
568
- function G(a) {
567
+ const tt = H(Array.prototype.forEach), er = H(Array.prototype.lastIndexOf), $n = H(Array.prototype.pop), nt = H(Array.prototype.push), tr = H(Array.prototype.splice), ee = Array.isArray, lt = H(String.prototype.toLowerCase), Wt = H(String.prototype.toString), Un = H(String.prototype.match), Ue = H(String.prototype.replace), Bn = H(String.prototype.indexOf), nr = H(String.prototype.trim), sr = H(Number.prototype.toString), rr = H(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : H(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : H(Symbol.prototype.toString), N = H(Object.prototype.hasOwnProperty), st = H(Object.prototype.toString), Y = H(RegExp.prototype.test), bt = ir(TypeError);
568
+ function H(a) {
569
569
  return function(t) {
570
570
  t instanceof RegExp && (t.lastIndex = 0);
571
571
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
572
572
  n[r - 1] = arguments[r];
573
- return Qt(a, t, n);
573
+ return Kt(a, t, n);
574
574
  };
575
575
  }
576
- h(G, "unapply");
577
- function sr(a) {
576
+ p(H, "unapply");
577
+ function ir(a) {
578
578
  return function() {
579
579
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
580
580
  e[n] = arguments[n];
581
- return Jt(a, e);
581
+ return Qt(a, e);
582
582
  };
583
583
  }
584
- h(sr, "unconstruct");
584
+ p(ir, "unconstruct");
585
585
  function R(a, t) {
586
586
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lt;
587
- if (Nn && Nn(a, null), !J(t))
587
+ if (Nn && Nn(a, null), !ee(t))
588
588
  return a;
589
589
  let n = t.length;
590
590
  for (; n--; ) {
591
591
  let r = t[n];
592
592
  if (typeof r == "string") {
593
593
  const s = e(r);
594
- s !== r && (Zs(t) || (t[n] = s), r = s);
594
+ s !== r && (Ks(t) || (t[n] = s), r = s);
595
595
  }
596
596
  a[r] = !0;
597
597
  }
598
598
  return a;
599
599
  }
600
- h(R, "addToSet");
601
- function rr(a) {
600
+ p(R, "addToSet");
601
+ function ar(a) {
602
602
  for (let t = 0; t < a.length; t++)
603
- $(a, t) || (a[t] = null);
603
+ N(a, t) || (a[t] = null);
604
604
  return a;
605
605
  }
606
- h(rr, "cleanArray");
607
- function re(a) {
608
- const t = He(null);
609
- for (const [e, n] of ls(a))
610
- $(a, e) && (J(n) ? t[e] = rr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = re(n) : t[e] = n);
606
+ p(ar, "cleanArray");
607
+ function se(a) {
608
+ const t = Be(null);
609
+ for (const [e, n] of os(a))
610
+ N(a, e) && (ee(n) ? t[e] = ar(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = se(n) : t[e] = n);
611
611
  return t;
612
612
  }
613
- h(re, "clone");
614
- function ir(a) {
613
+ p(se, "clone");
614
+ function lr(a) {
615
615
  switch (typeof a) {
616
616
  case "string":
617
617
  return a;
618
618
  case "number":
619
- return tr(a);
619
+ return sr(a);
620
620
  case "boolean":
621
- return nr(a);
621
+ return rr(a);
622
622
  case "bigint":
623
623
  return Fn ? Fn(a) : "0";
624
624
  case "symbol":
@@ -629,7 +629,7 @@ function ir(a) {
629
629
  case "object": {
630
630
  if (a === null)
631
631
  return st(a);
632
- const t = a, e = Ge(t, "toString");
632
+ const t = a, e = Fe(t, "toString");
633
633
  if (typeof e == "function") {
634
634
  const n = e(t);
635
635
  return typeof n == "string" ? n : st(n);
@@ -640,51 +640,51 @@ function ir(a) {
640
640
  return st(a);
641
641
  }
642
642
  }
643
- h(ir, "stringifyValue");
644
- function Ge(a, t) {
643
+ p(lr, "stringifyValue");
644
+ function Fe(a, t) {
645
645
  for (; a !== null; ) {
646
- const n = Ks(a, t);
646
+ const n = Js(a, t);
647
647
  if (n) {
648
648
  if (n.get)
649
- return G(n.get);
649
+ return H(n.get);
650
650
  if (typeof n.value == "function")
651
- return G(n.value);
651
+ return H(n.value);
652
652
  }
653
- a = Xs(a);
653
+ a = Qs(a);
654
654
  }
655
655
  function e() {
656
656
  return null;
657
657
  }
658
- return h(e, "fallbackValue"), e;
658
+ return p(e, "fallbackValue"), e;
659
659
  }
660
- h(Ge, "lookupGetter");
661
- function ar(a) {
660
+ p(Fe, "lookupGetter");
661
+ function or(a) {
662
662
  try {
663
- return Z(a, ""), !0;
663
+ return Y(a, ""), !0;
664
664
  } catch {
665
665
  return !1;
666
666
  }
667
667
  }
668
- h(ar, "isRegex");
669
- const Gn = te(["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"]), Vt = te(["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"]), Yt = te(["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"]), lr = te(["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"]), Zt = te(["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"]), or = te(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = te(["#text"]), Wn = te(["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"]), Xt = te(["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"]), qn = te(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), kt = te(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), cr = oe(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ur = oe(/<%[\w\W]*|[\w\W]*%>/gm), hr = oe(/\$\{[\w\W]*/gm), pr = oe(/^data-[\-\w.\u00B7-\uFFFF]+$/), dr = oe(/^aria-[\-\w]+$/), os = oe(
668
+ p(or, "isRegex");
669
+ const Gn = te(["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"]), qt = te(["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"]), Vt = te(["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"]), cr = te(["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"]), Yt = te(["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"]), ur = te(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = te(["#text"]), Wn = te(["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"]), Zt = te(["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"]), qn = te(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), xt = te(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), hr = oe(/\{\{[\w\W]*|[\w\W]*\}\}/gm), pr = oe(/<%[\w\W]*|[\w\W]*%>/gm), dr = oe(/\$\{[\w\W]*/gm), fr = oe(/^data-[\-\w.\u00B7-\uFFFF]+$/), gr = oe(/^aria-[\-\w]+$/), cs = oe(
670
670
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
671
671
  // eslint-disable-line no-useless-escape
672
- ), fr = oe(/^(?:\w+script|data):/i), gr = oe(
672
+ ), mr = oe(/^(?:\w+script|data):/i), br = oe(
673
673
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
674
674
  // eslint-disable-line no-control-regex
675
- ), cs = oe(/^html$/i), mr = oe(/^[a-z][.\w]*(-[.\w]+)+$/i);
675
+ ), us = oe(/^html$/i), xr = oe(/^[a-z][.\w]*(-[.\w]+)+$/i);
676
676
  var Vn = /* @__PURE__ */ Object.freeze({
677
677
  __proto__: null,
678
- ARIA_ATTR: dr,
679
- ATTR_WHITESPACE: gr,
680
- CUSTOM_ELEMENT: mr,
681
- DATA_ATTR: pr,
682
- DOCTYPE_NAME: cs,
683
- ERB_EXPR: ur,
684
- IS_ALLOWED_URI: os,
685
- IS_SCRIPT_OR_DATA: fr,
686
- MUSTACHE_EXPR: cr,
687
- TMPLIT_EXPR: hr
678
+ ARIA_ATTR: gr,
679
+ ATTR_WHITESPACE: br,
680
+ CUSTOM_ELEMENT: xr,
681
+ DATA_ATTR: fr,
682
+ DOCTYPE_NAME: us,
683
+ ERB_EXPR: pr,
684
+ IS_ALLOWED_URI: cs,
685
+ IS_SCRIPT_OR_DATA: mr,
686
+ MUSTACHE_EXPR: hr,
687
+ TMPLIT_EXPR: dr
688
688
  });
689
689
  const rt = {
690
690
  element: 1,
@@ -693,9 +693,9 @@ const rt = {
693
693
  progressingInstruction: 7,
694
694
  comment: 8,
695
695
  document: 9
696
- }, br = /* @__PURE__ */ h(function() {
696
+ }, kr = /* @__PURE__ */ p(function() {
697
697
  return typeof window > "u" ? null : window;
698
- }, "getGlobal"), xr = /* @__PURE__ */ h(function(t, e) {
698
+ }, "getGlobal"), wr = /* @__PURE__ */ p(function(t, e) {
699
699
  if (typeof t != "object" || typeof t.createPolicy != "function")
700
700
  return null;
701
701
  let n = null;
@@ -704,17 +704,17 @@ const rt = {
704
704
  const s = "dompurify" + (n ? "#" + n : "");
705
705
  try {
706
706
  return t.createPolicy(s, {
707
- createHTML(o) {
708
- return o;
707
+ createHTML(l) {
708
+ return l;
709
709
  },
710
- createScriptURL(o) {
711
- return o;
710
+ createScriptURL(l) {
711
+ return l;
712
712
  }
713
713
  });
714
714
  } catch {
715
715
  return console.warn("TrustedTypes policy " + s + " could not be created."), null;
716
716
  }
717
- }, "_createTrustedTypesPolicy"), Yn = /* @__PURE__ */ h(function() {
717
+ }, "_createTrustedTypesPolicy"), Yn = /* @__PURE__ */ p(function() {
718
718
  return {
719
719
  afterSanitizeAttributes: [],
720
720
  afterSanitizeElements: [],
@@ -727,9 +727,9 @@ const rt = {
727
727
  uponSanitizeShadowNode: []
728
728
  };
729
729
  }, "_createHooksMap");
730
- function us() {
731
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : br();
732
- const t = /* @__PURE__ */ h((v) => us(v), "DOMPurify");
730
+ function hs() {
731
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : kr();
732
+ const t = /* @__PURE__ */ p((S) => hs(S), "DOMPurify");
733
733
  if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== rt.document || !a.Element)
734
734
  return t.isSupported = !1, t;
735
735
  let {
@@ -737,20 +737,20 @@ function us() {
737
737
  } = a;
738
738
  const n = e, r = n.currentScript, {
739
739
  DocumentFragment: s,
740
- HTMLTemplateElement: o,
741
- Node: l,
742
- Element: m,
740
+ HTMLTemplateElement: l,
741
+ Node: o,
742
+ Element: d,
743
743
  NodeFilter: c,
744
744
  NamedNodeMap: b = a.NamedNodeMap || a.MozNamedAttrMap,
745
- HTMLFormElement: p,
746
- DOMParser: d,
747
- trustedTypes: g
748
- } = a, y = m.prototype, E = Ge(y, "cloneNode"), O = Ge(y, "remove"), ce = Ge(y, "nextSibling"), ue = Ge(y, "childNodes"), ne = Ge(y, "parentNode");
749
- if (typeof o == "function") {
750
- const v = e.createElement("template");
751
- v.content && v.content.ownerDocument && (e = v.content.ownerDocument);
752
- }
753
- let N, Y = "";
745
+ HTMLFormElement: u,
746
+ DOMParser: m,
747
+ trustedTypes: f
748
+ } = a, w = d.prototype, _ = Fe(w, "cloneNode"), O = Fe(w, "remove"), ie = Fe(w, "nextSibling"), be = Fe(w, "childNodes"), G = Fe(w, "parentNode");
749
+ if (typeof l == "function") {
750
+ const S = e.createElement("template");
751
+ S.content && S.content.ownerDocument && (e = S.content.ownerDocument);
752
+ }
753
+ let P, de = "";
754
754
  const {
755
755
  implementation: ae,
756
756
  createNodeIterator: Q,
@@ -760,24 +760,24 @@ function us() {
760
760
  importNode: C
761
761
  } = n;
762
762
  let q = Yn();
763
- t.isSupported = typeof ls == "function" && typeof ne == "function" && ae && ae.createHTMLDocument !== void 0;
763
+ t.isSupported = typeof os == "function" && typeof G == "function" && ae && ae.createHTMLDocument !== void 0;
764
764
  const {
765
765
  MUSTACHE_EXPR: we,
766
766
  ERB_EXPR: Oe,
767
- TMPLIT_EXPR: ye,
767
+ TMPLIT_EXPR: ve,
768
768
  DATA_ATTR: Rt,
769
769
  ARIA_ATTR: Ct,
770
- IS_SCRIPT_OR_DATA: ht,
771
- ATTR_WHITESPACE: pt,
772
- CUSTOM_ELEMENT: It
770
+ IS_SCRIPT_OR_DATA: It,
771
+ ATTR_WHITESPACE: ht,
772
+ CUSTOM_ELEMENT: Dt
773
773
  } = Vn;
774
774
  let {
775
- IS_ALLOWED_URI: dt
776
- } = Vn, B = null;
777
- const Xe = R({}, [...Gn, ...Vt, ...Yt, ...Zt, ...jn]);
778
- let F = null;
779
- const _ = R({}, [...Wn, ...Xt, ...qn, ...kt]);
780
- let f = Object.seal(He(null, {
775
+ IS_ALLOWED_URI: pt
776
+ } = Vn, U = null;
777
+ const Ye = R({}, [...Gn, ...qt, ...Vt, ...Yt, ...jn]);
778
+ let A = null;
779
+ const k = R({}, [...Wn, ...Zt, ...qn, ...xt]);
780
+ let g = Object.seal(Be(null, {
781
781
  tagNameCheck: {
782
782
  writable: !0,
783
783
  configurable: !1,
@@ -796,8 +796,8 @@ function us() {
796
796
  enumerable: !0,
797
797
  value: !1
798
798
  }
799
- })), x = null, M = null;
800
- const P = Object.seal(He(null, {
799
+ })), M = null, j = null;
800
+ const J = Object.seal(Be(null, {
801
801
  tagCheck: {
802
802
  writable: !0,
803
803
  configurable: !1,
@@ -811,104 +811,104 @@ function us() {
811
811
  value: null
812
812
  }
813
813
  }));
814
- let xe = !0, ze = !0, Pe = !1, dn = !0, _e = !1, Ke = !0, Re = !1, Dt = !1, Mt = !1, Ne = !1, ft = !1, gt = !1, fn = !0, gn = !1;
814
+ let Ze = !0, _e = !0, pn = !1, dn = !0, Re = !1, Xe = !0, Ce = !1, Mt = !1, Lt = !1, ze = !1, dt = !1, ft = !1, fn = !0, gn = !1;
815
815
  const mn = "user-content-";
816
- let Lt = !0, Qe = !1, $e = {}, ge = null;
817
- const Ot = 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"]);
816
+ let Ot = !0, Ke = !1, Pe = {}, fe = null;
817
+ const zt = 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"]);
818
818
  let bn = null;
819
819
  const xn = R({}, ["audio", "video", "img", "source", "image", "track"]);
820
- let zt = null;
821
- const kn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), mt = "http://www.w3.org/1998/Math/MathML", bt = "http://www.w3.org/2000/svg", me = "http://www.w3.org/1999/xhtml";
822
- let Ue = me, Pt = !1, Nt = null;
823
- const ys = R({}, [mt, bt, me], qt);
824
- let $t = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = R({}, ["annotation-xml"]);
825
- const vs = R({}, ["title", "style", "font", "a", "script"]);
826
- let Je = null;
827
- const Ts = ["application/xhtml+xml", "text/html"], Ss = "text/html";
828
- let j = null, Be = null;
829
- const As = e.createElement("form"), wn = /* @__PURE__ */ h(function(i) {
820
+ let Pt = null;
821
+ const kn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), gt = "http://www.w3.org/1998/Math/MathML", mt = "http://www.w3.org/2000/svg", ge = "http://www.w3.org/1999/xhtml";
822
+ let Ne = ge, Nt = !1, $t = null;
823
+ const ys = R({}, [gt, mt, ge], Wt);
824
+ let Ut = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Bt = R({}, ["annotation-xml"]);
825
+ const Ts = R({}, ["title", "style", "font", "a", "script"]);
826
+ let Qe = null;
827
+ const Ss = ["application/xhtml+xml", "text/html"], As = "text/html";
828
+ let W = null, $e = null;
829
+ const Es = e.createElement("form"), wn = /* @__PURE__ */ p(function(i) {
830
830
  return i instanceof RegExp || i instanceof Function;
831
- }, "isRegexOrFunction"), Bt = /* @__PURE__ */ h(function() {
831
+ }, "isRegexOrFunction"), Ft = /* @__PURE__ */ p(function() {
832
832
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
833
- if (Be && Be === i)
833
+ if ($e && $e === i)
834
834
  return;
835
- (!i || typeof i != "object") && (i = {}), i = re(i), Je = // eslint-disable-next-line unicorn/prefer-includes
836
- Ts.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Ss : i.PARSER_MEDIA_TYPE, j = Je === "application/xhtml+xml" ? qt : lt, B = $(i, "ALLOWED_TAGS") && J(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, j) : Xe, F = $(i, "ALLOWED_ATTR") && J(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, j) : _, Nt = $(i, "ALLOWED_NAMESPACES") && J(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, qt) : ys, zt = $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) ? R(re(kn), i.ADD_URI_SAFE_ATTR, j) : kn, bn = $(i, "ADD_DATA_URI_TAGS") && J(i.ADD_DATA_URI_TAGS) ? R(re(xn), i.ADD_DATA_URI_TAGS, j) : xn, ge = $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, j) : Ot, x = $(i, "FORBID_TAGS") && J(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, j) : re({}), M = $(i, "FORBID_ATTR") && J(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, j) : re({}), $e = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? re(i.USE_PROFILES) : i.USE_PROFILES : !1, xe = i.ALLOW_ARIA_ATTR !== !1, ze = i.ALLOW_DATA_ATTR !== !1, Pe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, dn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, _e = i.SAFE_FOR_TEMPLATES || !1, Ke = i.SAFE_FOR_XML !== !1, Re = i.WHOLE_DOCUMENT || !1, Ne = i.RETURN_DOM || !1, ft = i.RETURN_DOM_FRAGMENT || !1, gt = i.RETURN_TRUSTED_TYPE || !1, Mt = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, Lt = i.KEEP_CONTENT !== !1, Qe = i.IN_PLACE || !1, dt = ar(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : os, Ue = typeof i.NAMESPACE == "string" ? i.NAMESPACE : me, $t = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? re(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? re(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
837
- const u = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? re(i.CUSTOM_ELEMENT_HANDLING) : He(null);
838
- if (f = He(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (f.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (f.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), _e && (ze = !1), ft && (Ne = !0), $e && (B = R({}, jn), F = He(null), $e.html === !0 && (R(B, Gn), R(F, Wn)), $e.svg === !0 && (R(B, Vt), R(F, Xt), R(F, kt)), $e.svgFilters === !0 && (R(B, Yt), R(F, Xt), R(F, kt)), $e.mathMl === !0 && (R(B, Zt), R(F, qn), R(F, kt))), P.tagCheck = null, P.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? P.tagCheck = i.ADD_TAGS : J(i.ADD_TAGS) && (B === Xe && (B = re(B)), R(B, i.ADD_TAGS, j))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? P.attributeCheck = i.ADD_ATTR : J(i.ADD_ATTR) && (F === _ && (F = re(F)), R(F, i.ADD_ATTR, j))), $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) && R(zt, i.ADD_URI_SAFE_ATTR, j), $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) && (ge === Ot && (ge = re(ge)), R(ge, i.FORBID_CONTENTS, j)), $(i, "ADD_FORBID_CONTENTS") && J(i.ADD_FORBID_CONTENTS) && (ge === Ot && (ge = re(ge)), R(ge, i.ADD_FORBID_CONTENTS, j)), Lt && (B["#text"] = !0), Re && R(B, ["html", "head", "body"]), B.table && (R(B, ["tbody"]), delete x.tbody), i.TRUSTED_TYPES_POLICY) {
835
+ (!i || typeof i != "object") && (i = {}), i = se(i), Qe = // eslint-disable-next-line unicorn/prefer-includes
836
+ Ss.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? As : i.PARSER_MEDIA_TYPE, W = Qe === "application/xhtml+xml" ? Wt : lt, U = N(i, "ALLOWED_TAGS") && ee(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, W) : Ye, A = N(i, "ALLOWED_ATTR") && ee(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, W) : k, $t = N(i, "ALLOWED_NAMESPACES") && ee(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, Wt) : ys, Pt = N(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) ? R(se(kn), i.ADD_URI_SAFE_ATTR, W) : kn, bn = N(i, "ADD_DATA_URI_TAGS") && ee(i.ADD_DATA_URI_TAGS) ? R(se(xn), i.ADD_DATA_URI_TAGS, W) : xn, fe = N(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, W) : zt, M = N(i, "FORBID_TAGS") && ee(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, W) : se({}), j = N(i, "FORBID_ATTR") && ee(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, W) : se({}), Pe = N(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? se(i.USE_PROFILES) : i.USE_PROFILES : !1, Ze = i.ALLOW_ARIA_ATTR !== !1, _e = i.ALLOW_DATA_ATTR !== !1, pn = i.ALLOW_UNKNOWN_PROTOCOLS || !1, dn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Re = i.SAFE_FOR_TEMPLATES || !1, Xe = i.SAFE_FOR_XML !== !1, Ce = i.WHOLE_DOCUMENT || !1, ze = i.RETURN_DOM || !1, dt = i.RETURN_DOM_FRAGMENT || !1, ft = i.RETURN_TRUSTED_TYPE || !1, Lt = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, Ot = i.KEEP_CONTENT !== !1, Ke = i.IN_PLACE || !1, pt = or(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : cs, Ne = typeof i.NAMESPACE == "string" ? i.NAMESPACE : ge, Ut = N(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? se(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Bt = N(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? se(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
837
+ const h = N(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? se(i.CUSTOM_ELEMENT_HANDLING) : Be(null);
838
+ if (g = Be(null), N(h, "tagNameCheck") && wn(h.tagNameCheck) && (g.tagNameCheck = h.tagNameCheck), N(h, "attributeNameCheck") && wn(h.attributeNameCheck) && (g.attributeNameCheck = h.attributeNameCheck), N(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (g.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), Re && (_e = !1), dt && (ze = !0), Pe && (U = R({}, jn), A = Be(null), Pe.html === !0 && (R(U, Gn), R(A, Wn)), Pe.svg === !0 && (R(U, qt), R(A, Zt), R(A, xt)), Pe.svgFilters === !0 && (R(U, Vt), R(A, Zt), R(A, xt)), Pe.mathMl === !0 && (R(U, Yt), R(A, qn), R(A, xt))), J.tagCheck = null, J.attributeCheck = null, N(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? J.tagCheck = i.ADD_TAGS : ee(i.ADD_TAGS) && (U === Ye && (U = se(U)), R(U, i.ADD_TAGS, W))), N(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? J.attributeCheck = i.ADD_ATTR : ee(i.ADD_ATTR) && (A === k && (A = se(A)), R(A, i.ADD_ATTR, W))), N(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) && R(Pt, i.ADD_URI_SAFE_ATTR, W), N(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) && (fe === zt && (fe = se(fe)), R(fe, i.FORBID_CONTENTS, W)), N(i, "ADD_FORBID_CONTENTS") && ee(i.ADD_FORBID_CONTENTS) && (fe === zt && (fe = se(fe)), R(fe, i.ADD_FORBID_CONTENTS, W)), Ot && (U["#text"] = !0), Ce && R(U, ["html", "head", "body"]), U.table && (R(U, ["tbody"]), delete M.tbody), i.TRUSTED_TYPES_POLICY) {
839
839
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
840
- throw xt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
840
+ throw bt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
841
841
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
842
- throw xt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
843
- N = i.TRUSTED_TYPES_POLICY, Y = N.createHTML("");
842
+ throw bt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
843
+ P = i.TRUSTED_TYPES_POLICY, de = P.createHTML("");
844
844
  } else
845
- N === void 0 && (N = xr(g, r)), N !== null && typeof Y == "string" && (Y = N.createHTML(""));
846
- te && te(i), Be = i;
847
- }, "_parseConfig"), yn = R({}, [...Vt, ...Yt, ...lr]), vn = R({}, [...Zt, ...or]), Es = /* @__PURE__ */ h(function(i) {
848
- let u = ne(i);
849
- (!u || !u.tagName) && (u = {
850
- namespaceURI: Ue,
845
+ P === void 0 && (P = wr(f, r)), P !== null && typeof de == "string" && (de = P.createHTML(""));
846
+ te && te(i), $e = i;
847
+ }, "_parseConfig"), vn = R({}, [...qt, ...Vt, ...cr]), yn = R({}, [...Yt, ...ur]), _s = /* @__PURE__ */ p(function(i) {
848
+ let h = G(i);
849
+ (!h || !h.tagName) && (h = {
850
+ namespaceURI: Ne,
851
851
  tagName: "template"
852
852
  });
853
- const k = lt(i.tagName), z = lt(u.tagName);
854
- return Nt[i.namespaceURI] ? i.namespaceURI === bt ? u.namespaceURI === me ? k === "svg" : u.namespaceURI === mt ? k === "svg" && (z === "annotation-xml" || $t[z]) : !!yn[k] : i.namespaceURI === mt ? u.namespaceURI === me ? k === "math" : u.namespaceURI === bt ? k === "math" && Ut[z] : !!vn[k] : i.namespaceURI === me ? u.namespaceURI === bt && !Ut[z] || u.namespaceURI === mt && !$t[z] ? !1 : !vn[k] && (vs[k] || !yn[k]) : !!(Je === "application/xhtml+xml" && Nt[i.namespaceURI]) : !1;
855
- }, "_checkValidNamespace"), he = /* @__PURE__ */ h(function(i) {
853
+ const x = lt(i.tagName), z = lt(h.tagName);
854
+ return $t[i.namespaceURI] ? i.namespaceURI === mt ? h.namespaceURI === ge ? x === "svg" : h.namespaceURI === gt ? x === "svg" && (z === "annotation-xml" || Ut[z]) : !!vn[x] : i.namespaceURI === gt ? h.namespaceURI === ge ? x === "math" : h.namespaceURI === mt ? x === "math" && Bt[z] : !!yn[x] : i.namespaceURI === ge ? h.namespaceURI === mt && !Bt[z] || h.namespaceURI === gt && !Ut[z] ? !1 : !yn[x] && (Ts[x] || !vn[x]) : !!(Qe === "application/xhtml+xml" && $t[i.namespaceURI]) : !1;
855
+ }, "_checkValidNamespace"), ce = /* @__PURE__ */ p(function(i) {
856
856
  nt(t.removed, {
857
857
  element: i
858
858
  });
859
859
  try {
860
- ne(i).removeChild(i);
860
+ G(i).removeChild(i);
861
861
  } catch {
862
862
  O(i);
863
863
  }
864
- }, "_forceRemove"), Ce = /* @__PURE__ */ h(function(i, u) {
864
+ }, "_forceRemove"), Ie = /* @__PURE__ */ p(function(i, h) {
865
865
  try {
866
866
  nt(t.removed, {
867
- attribute: u.getAttributeNode(i),
868
- from: u
867
+ attribute: h.getAttributeNode(i),
868
+ from: h
869
869
  });
870
870
  } catch {
871
871
  nt(t.removed, {
872
872
  attribute: null,
873
- from: u
873
+ from: h
874
874
  });
875
875
  }
876
- if (u.removeAttribute(i), i === "is")
877
- if (Ne || ft)
876
+ if (h.removeAttribute(i), i === "is")
877
+ if (ze || dt)
878
878
  try {
879
- he(u);
879
+ ce(h);
880
880
  } catch {
881
881
  }
882
882
  else
883
883
  try {
884
- u.setAttribute(i, "");
884
+ h.setAttribute(i, "");
885
885
  } catch {
886
886
  }
887
- }, "_removeAttribute"), Tn = /* @__PURE__ */ h(function(i) {
888
- let u = null, k = null;
889
- if (Mt)
887
+ }, "_removeAttribute"), Tn = /* @__PURE__ */ p(function(i) {
888
+ let h = null, x = null;
889
+ if (Lt)
890
890
  i = "<remove></remove>" + i;
891
891
  else {
892
- const H = Un(i, /^[\r\n\t ]+/);
893
- k = H && H[0];
892
+ const F = Un(i, /^[\r\n\t ]+/);
893
+ x = F && F[0];
894
894
  }
895
- Je === "application/xhtml+xml" && Ue === me && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
896
- const z = N ? N.createHTML(i) : i;
897
- if (Ue === me)
895
+ Qe === "application/xhtml+xml" && Ne === ge && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
896
+ const z = P ? P.createHTML(i) : i;
897
+ if (Ne === ge)
898
898
  try {
899
- u = new d().parseFromString(z, Je);
899
+ h = new m().parseFromString(z, Qe);
900
900
  } catch {
901
901
  }
902
- if (!u || !u.documentElement) {
903
- u = ae.createDocument(Ue, "template", null);
902
+ if (!h || !h.documentElement) {
903
+ h = ae.createDocument(Ne, "template", null);
904
904
  try {
905
- u.documentElement.innerHTML = Pt ? Y : z;
905
+ h.documentElement.innerHTML = Nt ? de : z;
906
906
  } catch {
907
907
  }
908
908
  }
909
- const X = u.body || u.documentElement;
910
- return i && k && X.insertBefore(e.createTextNode(k), X.childNodes[0] || null), Ue === me ? ut.call(u, Re ? "html" : "body")[0] : Re ? u.documentElement : X;
911
- }, "_initDocument"), Sn = /* @__PURE__ */ h(function(i) {
909
+ const X = h.body || h.documentElement;
910
+ return i && x && X.insertBefore(e.createTextNode(x), X.childNodes[0] || null), Ne === ge ? ut.call(h, Ce ? "html" : "body")[0] : Ce ? h.documentElement : X;
911
+ }, "_initDocument"), Sn = /* @__PURE__ */ p(function(i) {
912
912
  return Q.call(
913
913
  i.ownerDocument || i,
914
914
  i,
@@ -916,67 +916,67 @@ function us() {
916
916
  c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
917
917
  null
918
918
  );
919
- }, "_createNodeIterator"), Ft = /* @__PURE__ */ h(function(i) {
920
- return i instanceof p && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof b) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
921
- }, "_isClobbered"), Ht = /* @__PURE__ */ h(function(i) {
922
- return typeof l == "function" && i instanceof l;
919
+ }, "_createNodeIterator"), Ht = /* @__PURE__ */ p(function(i) {
920
+ return i instanceof u && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof b) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
921
+ }, "_isClobbered"), Gt = /* @__PURE__ */ p(function(i) {
922
+ return typeof o == "function" && i instanceof o;
923
923
  }, "_isNode");
924
- function ke(v, i, u) {
925
- tt(v, (k) => {
926
- k.call(t, i, u, Be);
924
+ function xe(S, i, h) {
925
+ tt(S, (x) => {
926
+ x.call(t, i, h, $e);
927
927
  });
928
928
  }
929
- h(ke, "_executeHooks");
930
- const An = /* @__PURE__ */ h(function(i) {
931
- let u = null;
932
- if (ke(q.beforeSanitizeElements, i, null), Ft(i))
933
- return he(i), !0;
934
- const k = j(i.nodeName);
935
- if (ke(q.uponSanitizeElement, i, {
936
- tagName: k,
937
- allowedTags: B
938
- }), Ke && i.hasChildNodes() && !Ht(i.firstElementChild) && Z(/<[/\w!]/g, i.innerHTML) && Z(/<[/\w!]/g, i.textContent) || Ke && i.namespaceURI === me && k === "style" && Ht(i.firstElementChild) || i.nodeType === rt.progressingInstruction || Ke && i.nodeType === rt.comment && Z(/<[/\w]/g, i.data))
939
- return he(i), !0;
940
- if (x[k] || !(P.tagCheck instanceof Function && P.tagCheck(k)) && !B[k]) {
941
- if (!x[k] && _n(k) && (f.tagNameCheck instanceof RegExp && Z(f.tagNameCheck, k) || f.tagNameCheck instanceof Function && f.tagNameCheck(k)))
929
+ p(xe, "_executeHooks");
930
+ const An = /* @__PURE__ */ p(function(i) {
931
+ let h = null;
932
+ if (xe(q.beforeSanitizeElements, i, null), Ht(i))
933
+ return ce(i), !0;
934
+ const x = W(i.nodeName);
935
+ if (xe(q.uponSanitizeElement, i, {
936
+ tagName: x,
937
+ allowedTags: U
938
+ }), Xe && i.hasChildNodes() && !Gt(i.firstElementChild) && Y(/<[/\w!]/g, i.innerHTML) && Y(/<[/\w!]/g, i.textContent) || Xe && i.namespaceURI === ge && x === "style" && Gt(i.firstElementChild) || i.nodeType === rt.progressingInstruction || Xe && i.nodeType === rt.comment && Y(/<[/\w]/g, i.data))
939
+ return ce(i), !0;
940
+ if (M[x] || !(J.tagCheck instanceof Function && J.tagCheck(x)) && !U[x]) {
941
+ if (!M[x] && _n(x) && (g.tagNameCheck instanceof RegExp && Y(g.tagNameCheck, x) || g.tagNameCheck instanceof Function && g.tagNameCheck(x)))
942
942
  return !1;
943
- if (Lt && !ge[k]) {
944
- const z = ne(i) || i.parentNode, X = ue(i) || i.childNodes;
943
+ if (Ot && !fe[x]) {
944
+ const z = G(i) || i.parentNode, X = be(i) || i.childNodes;
945
945
  if (X && z) {
946
- const H = X.length;
947
- for (let se = H - 1; se >= 0; --se) {
948
- const le = E(X[se], !0);
949
- z.insertBefore(le, ce(i));
946
+ const F = X.length;
947
+ for (let ne = F - 1; ne >= 0; --ne) {
948
+ const le = _(X[ne], !0);
949
+ z.insertBefore(le, ie(i));
950
950
  }
951
951
  }
952
952
  }
953
- return he(i), !0;
953
+ return ce(i), !0;
954
954
  }
955
- return i instanceof m && !Es(i) || (k === "noscript" || k === "noembed" || k === "noframes") && Z(/<\/no(script|embed|frames)/i, i.innerHTML) ? (he(i), !0) : (_e && i.nodeType === rt.text && (u = i.textContent, tt([we, Oe, ye], (z) => {
956
- u = Fe(u, z, " ");
957
- }), i.textContent !== u && (nt(t.removed, {
955
+ return i instanceof d && !_s(i) || (x === "noscript" || x === "noembed" || x === "noframes") && Y(/<\/no(script|embed|frames)/i, i.innerHTML) ? (ce(i), !0) : (Re && i.nodeType === rt.text && (h = i.textContent, tt([we, Oe, ve], (z) => {
956
+ h = Ue(h, z, " ");
957
+ }), i.textContent !== h && (nt(t.removed, {
958
958
  element: i.cloneNode()
959
- }), i.textContent = u)), ke(q.afterSanitizeElements, i, null), !1);
960
- }, "_sanitizeElements"), En = /* @__PURE__ */ h(function(i, u, k) {
961
- if (M[u] || fn && (u === "id" || u === "name") && (k in e || k in As))
959
+ }), i.textContent = h)), xe(q.afterSanitizeElements, i, null), !1);
960
+ }, "_sanitizeElements"), En = /* @__PURE__ */ p(function(i, h, x) {
961
+ if (j[h] || fn && (h === "id" || h === "name") && (x in e || x in Es))
962
962
  return !1;
963
- if (!(ze && !M[u] && Z(Rt, u))) {
964
- if (!(xe && Z(Ct, u))) {
965
- if (!(P.attributeCheck instanceof Function && P.attributeCheck(u, i))) {
966
- if (!F[u] || M[u]) {
963
+ if (!(_e && !j[h] && Y(Rt, h))) {
964
+ if (!(Ze && Y(Ct, h))) {
965
+ if (!(J.attributeCheck instanceof Function && J.attributeCheck(h, i))) {
966
+ if (!A[h] || j[h]) {
967
967
  if (
968
968
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
969
969
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
970
970
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
971
- !(_n(i) && (f.tagNameCheck instanceof RegExp && Z(f.tagNameCheck, i) || f.tagNameCheck instanceof Function && f.tagNameCheck(i)) && (f.attributeNameCheck instanceof RegExp && Z(f.attributeNameCheck, u) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(u, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
971
+ !(_n(i) && (g.tagNameCheck instanceof RegExp && Y(g.tagNameCheck, i) || g.tagNameCheck instanceof Function && g.tagNameCheck(i)) && (g.attributeNameCheck instanceof RegExp && Y(g.attributeNameCheck, h) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(h, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
972
972
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
973
- u === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && Z(f.tagNameCheck, k) || f.tagNameCheck instanceof Function && f.tagNameCheck(k)))
973
+ h === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && Y(g.tagNameCheck, x) || g.tagNameCheck instanceof Function && g.tagNameCheck(x)))
974
974
  ) return !1;
975
- } else if (!zt[u]) {
976
- if (!Z(dt, Fe(k, pt, ""))) {
977
- if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Bn(k, "data:") === 0 && bn[i])) {
978
- if (!(Pe && !Z(ht, Fe(k, pt, "")))) {
979
- if (k)
975
+ } else if (!Pt[h]) {
976
+ if (!Y(pt, Ue(x, ht, ""))) {
977
+ if (!((h === "src" || h === "xlink:href" || h === "href") && i !== "script" && Bn(x, "data:") === 0 && bn[i])) {
978
+ if (!(pn && !Y(It, Ue(x, ht, "")))) {
979
+ if (x)
980
980
  return !1;
981
981
  }
982
982
  }
@@ -986,188 +986,188 @@ function us() {
986
986
  }
987
987
  }
988
988
  return !0;
989
- }, "_isValidAttribute"), _s = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ h(function(i) {
990
- return !_s[lt(i)] && Z(It, i);
991
- }, "_isBasicCustomElement"), Rn = /* @__PURE__ */ h(function(i) {
992
- ke(q.beforeSanitizeAttributes, i, null);
989
+ }, "_isValidAttribute"), Rs = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ p(function(i) {
990
+ return !Rs[lt(i)] && Y(Dt, i);
991
+ }, "_isBasicCustomElement"), Rn = /* @__PURE__ */ p(function(i) {
992
+ xe(q.beforeSanitizeAttributes, i, null);
993
993
  const {
994
- attributes: u
994
+ attributes: h
995
995
  } = i;
996
- if (!u || Ft(i))
996
+ if (!h || Ht(i))
997
997
  return;
998
- const k = {
998
+ const x = {
999
999
  attrName: "",
1000
1000
  attrValue: "",
1001
1001
  keepAttr: !0,
1002
- allowedAttributes: F,
1002
+ allowedAttributes: A,
1003
1003
  forceKeepAttr: void 0
1004
1004
  };
1005
- let z = u.length;
1005
+ let z = h.length;
1006
1006
  for (; z--; ) {
1007
- const X = u[z], {
1008
- name: H,
1009
- namespaceURI: se,
1007
+ const X = h[z], {
1008
+ name: F,
1009
+ namespaceURI: ne,
1010
1010
  value: le
1011
- } = X, pe = j(H), Gt = le;
1012
- let V = H === "value" ? Gt : er(Gt);
1013
- if (k.attrName = pe, k.attrValue = V, k.keepAttr = !0, k.forceKeepAttr = void 0, ke(q.uponSanitizeAttribute, i, k), V = k.attrValue, gn && (pe === "id" || pe === "name") && Bn(V, mn) !== 0 && (Ce(H, i), V = mn + V), Ke && Z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
1014
- Ce(H, i);
1011
+ } = X, ue = W(F), jt = le;
1012
+ let V = F === "value" ? jt : nr(jt);
1013
+ if (x.attrName = ue, x.attrValue = V, x.keepAttr = !0, x.forceKeepAttr = void 0, xe(q.uponSanitizeAttribute, i, x), V = x.attrValue, gn && (ue === "id" || ue === "name") && Bn(V, mn) !== 0 && (Ie(F, i), V = mn + V), Xe && Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
1014
+ Ie(F, i);
1015
1015
  continue;
1016
1016
  }
1017
- if (pe === "attributename" && Un(V, "href")) {
1018
- Ce(H, i);
1017
+ if (ue === "attributename" && Un(V, "href")) {
1018
+ Ie(F, i);
1019
1019
  continue;
1020
1020
  }
1021
- if (k.forceKeepAttr)
1021
+ if (x.forceKeepAttr)
1022
1022
  continue;
1023
- if (!k.keepAttr) {
1024
- Ce(H, i);
1023
+ if (!x.keepAttr) {
1024
+ Ie(F, i);
1025
1025
  continue;
1026
1026
  }
1027
- if (!dn && Z(/\/>/i, V)) {
1028
- Ce(H, i);
1027
+ if (!dn && Y(/\/>/i, V)) {
1028
+ Ie(F, i);
1029
1029
  continue;
1030
1030
  }
1031
- _e && tt([we, Oe, ye], (Dn) => {
1032
- V = Fe(V, Dn, " ");
1031
+ Re && tt([we, Oe, ve], (Dn) => {
1032
+ V = Ue(V, Dn, " ");
1033
1033
  });
1034
- const In = j(i.nodeName);
1035
- if (!En(In, pe, V)) {
1036
- Ce(H, i);
1034
+ const In = W(i.nodeName);
1035
+ if (!En(In, ue, V)) {
1036
+ Ie(F, i);
1037
1037
  continue;
1038
1038
  }
1039
- if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !se)
1040
- switch (g.getAttributeType(In, pe)) {
1039
+ if (P && typeof f == "object" && typeof f.getAttributeType == "function" && !ne)
1040
+ switch (f.getAttributeType(In, ue)) {
1041
1041
  case "TrustedHTML": {
1042
- V = N.createHTML(V);
1042
+ V = P.createHTML(V);
1043
1043
  break;
1044
1044
  }
1045
1045
  case "TrustedScriptURL": {
1046
- V = N.createScriptURL(V);
1046
+ V = P.createScriptURL(V);
1047
1047
  break;
1048
1048
  }
1049
1049
  }
1050
- if (V !== Gt)
1050
+ if (V !== jt)
1051
1051
  try {
1052
- se ? i.setAttributeNS(se, H, V) : i.setAttribute(H, V), Ft(i) ? he(i) : $n(t.removed);
1052
+ ne ? i.setAttributeNS(ne, F, V) : i.setAttribute(F, V), Ht(i) ? ce(i) : $n(t.removed);
1053
1053
  } catch {
1054
- Ce(H, i);
1054
+ Ie(F, i);
1055
1055
  }
1056
1056
  }
1057
- ke(q.afterSanitizeAttributes, i, null);
1058
- }, "_sanitizeAttributes"), Cn = /* @__PURE__ */ h(function(i) {
1059
- let u = null;
1060
- const k = Sn(i);
1061
- for (ke(q.beforeSanitizeShadowDOM, i, null); u = k.nextNode(); )
1062
- ke(q.uponSanitizeShadowNode, u, null), An(u), Rn(u), u.content instanceof s && Cn(u.content);
1063
- ke(q.afterSanitizeShadowDOM, i, null);
1057
+ xe(q.afterSanitizeAttributes, i, null);
1058
+ }, "_sanitizeAttributes"), Cn = /* @__PURE__ */ p(function(i) {
1059
+ let h = null;
1060
+ const x = Sn(i);
1061
+ for (xe(q.beforeSanitizeShadowDOM, i, null); h = x.nextNode(); )
1062
+ xe(q.uponSanitizeShadowNode, h, null), An(h), Rn(h), h.content instanceof s && Cn(h.content);
1063
+ xe(q.afterSanitizeShadowDOM, i, null);
1064
1064
  }, "_sanitizeShadowDOM");
1065
- return t.sanitize = function(v) {
1066
- let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, k = null, z = null, X = null;
1067
- if (Pt = !v, Pt && (v = "<!-->"), typeof v != "string" && !Ht(v) && (v = ir(v), typeof v != "string"))
1068
- throw xt("dirty is not a string, aborting");
1065
+ return t.sanitize = function(S) {
1066
+ let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = null, x = null, z = null, X = null;
1067
+ if (Nt = !S, Nt && (S = "<!-->"), typeof S != "string" && !Gt(S) && (S = lr(S), typeof S != "string"))
1068
+ throw bt("dirty is not a string, aborting");
1069
1069
  if (!t.isSupported)
1070
- return v;
1071
- if (Dt || Bt(i), t.removed = [], typeof v == "string" && (Qe = !1), Qe) {
1072
- const le = v.nodeName;
1070
+ return S;
1071
+ if (Mt || Ft(i), t.removed = [], typeof S == "string" && (Ke = !1), Ke) {
1072
+ const le = S.nodeName;
1073
1073
  if (typeof le == "string") {
1074
- const pe = j(le);
1075
- if (!B[pe] || x[pe])
1076
- throw xt("root node is forbidden and cannot be sanitized in-place");
1074
+ const ue = W(le);
1075
+ if (!U[ue] || M[ue])
1076
+ throw bt("root node is forbidden and cannot be sanitized in-place");
1077
1077
  }
1078
- } else if (v instanceof l)
1079
- u = Tn("<!---->"), k = u.ownerDocument.importNode(v, !0), k.nodeType === rt.element && k.nodeName === "BODY" || k.nodeName === "HTML" ? u = k : u.appendChild(k);
1078
+ } else if (S instanceof o)
1079
+ h = Tn("<!---->"), x = h.ownerDocument.importNode(S, !0), x.nodeType === rt.element && x.nodeName === "BODY" || x.nodeName === "HTML" ? h = x : h.appendChild(x);
1080
1080
  else {
1081
- if (!Ne && !_e && !Re && // eslint-disable-next-line unicorn/prefer-includes
1082
- v.indexOf("<") === -1)
1083
- return N && gt ? N.createHTML(v) : v;
1084
- if (u = Tn(v), !u)
1085
- return Ne ? null : gt ? Y : "";
1086
- }
1087
- u && Mt && he(u.firstChild);
1088
- const H = Sn(Qe ? v : u);
1089
- for (; z = H.nextNode(); )
1081
+ if (!ze && !Re && !Ce && // eslint-disable-next-line unicorn/prefer-includes
1082
+ S.indexOf("<") === -1)
1083
+ return P && ft ? P.createHTML(S) : S;
1084
+ if (h = Tn(S), !h)
1085
+ return ze ? null : ft ? de : "";
1086
+ }
1087
+ h && Lt && ce(h.firstChild);
1088
+ const F = Sn(Ke ? S : h);
1089
+ for (; z = F.nextNode(); )
1090
1090
  An(z), Rn(z), z.content instanceof s && Cn(z.content);
1091
- if (Qe)
1092
- return v;
1093
- if (Ne) {
1094
- if (_e) {
1095
- u.normalize();
1096
- let le = u.innerHTML;
1097
- tt([we, Oe, ye], (pe) => {
1098
- le = Fe(le, pe, " ");
1099
- }), u.innerHTML = le;
1100
- }
1101
- if (ft)
1102
- for (X = _t.call(u.ownerDocument); u.firstChild; )
1103
- X.appendChild(u.firstChild);
1091
+ if (Ke)
1092
+ return S;
1093
+ if (ze) {
1094
+ if (Re) {
1095
+ h.normalize();
1096
+ let le = h.innerHTML;
1097
+ tt([we, Oe, ve], (ue) => {
1098
+ le = Ue(le, ue, " ");
1099
+ }), h.innerHTML = le;
1100
+ }
1101
+ if (dt)
1102
+ for (X = _t.call(h.ownerDocument); h.firstChild; )
1103
+ X.appendChild(h.firstChild);
1104
1104
  else
1105
- X = u;
1106
- return (F.shadowroot || F.shadowrootmode) && (X = C.call(n, X, !0)), X;
1107
- }
1108
- let se = Re ? u.outerHTML : u.innerHTML;
1109
- return Re && B["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && Z(cs, u.ownerDocument.doctype.name) && (se = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1110
- ` + se), _e && tt([we, Oe, ye], (le) => {
1111
- se = Fe(se, le, " ");
1112
- }), N && gt ? N.createHTML(se) : se;
1105
+ X = h;
1106
+ return (A.shadowroot || A.shadowrootmode) && (X = C.call(n, X, !0)), X;
1107
+ }
1108
+ let ne = Ce ? h.outerHTML : h.innerHTML;
1109
+ return Ce && U["!doctype"] && h.ownerDocument && h.ownerDocument.doctype && h.ownerDocument.doctype.name && Y(us, h.ownerDocument.doctype.name) && (ne = "<!DOCTYPE " + h.ownerDocument.doctype.name + `>
1110
+ ` + ne), Re && tt([we, Oe, ve], (le) => {
1111
+ ne = Ue(ne, le, " ");
1112
+ }), P && ft ? P.createHTML(ne) : ne;
1113
1113
  }, t.setConfig = function() {
1114
- let v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1115
- Bt(v), Dt = !0;
1114
+ let S = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1115
+ Ft(S), Mt = !0;
1116
1116
  }, t.clearConfig = function() {
1117
- Be = null, Dt = !1;
1118
- }, t.isValidAttribute = function(v, i, u) {
1119
- Be || Bt({});
1120
- const k = j(v), z = j(i);
1121
- return En(k, z, u);
1122
- }, t.addHook = function(v, i) {
1123
- typeof i == "function" && nt(q[v], i);
1124
- }, t.removeHook = function(v, i) {
1117
+ $e = null, Mt = !1;
1118
+ }, t.isValidAttribute = function(S, i, h) {
1119
+ $e || Ft({});
1120
+ const x = W(S), z = W(i);
1121
+ return En(x, z, h);
1122
+ }, t.addHook = function(S, i) {
1123
+ typeof i == "function" && nt(q[S], i);
1124
+ }, t.removeHook = function(S, i) {
1125
1125
  if (i !== void 0) {
1126
- const u = Qs(q[v], i);
1127
- return u === -1 ? void 0 : Js(q[v], u, 1)[0];
1126
+ const h = er(q[S], i);
1127
+ return h === -1 ? void 0 : tr(q[S], h, 1)[0];
1128
1128
  }
1129
- return $n(q[v]);
1130
- }, t.removeHooks = function(v) {
1131
- q[v] = [];
1129
+ return $n(q[S]);
1130
+ }, t.removeHooks = function(S) {
1131
+ q[S] = [];
1132
1132
  }, t.removeAllHooks = function() {
1133
1133
  q = Yn();
1134
1134
  }, t;
1135
1135
  }
1136
- h(us, "createDOMPurify");
1137
- var kr = us();
1138
- function nn() {
1136
+ p(hs, "createDOMPurify");
1137
+ var vr = hs();
1138
+ function tn() {
1139
1139
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1140
1140
  }
1141
- h(nn, "z");
1142
- var Le = nn();
1143
- function hs(a) {
1141
+ p(tn, "z");
1142
+ var Le = tn();
1143
+ function ps(a) {
1144
1144
  Le = a;
1145
1145
  }
1146
- h(hs, "G");
1147
- var Ie = { exec: /* @__PURE__ */ h(() => null, "exec") };
1146
+ p(ps, "G");
1147
+ var De = { exec: /* @__PURE__ */ p(() => null, "exec") };
1148
1148
  function D(a, t = "") {
1149
- let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((r, s) => {
1150
- let o = typeof s == "string" ? s : s.source;
1151
- return o = o.replace(K.caret, "$1"), e = e.replace(r, o), n;
1152
- }, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
1149
+ let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ p((r, s) => {
1150
+ let l = typeof s == "string" ? s : s.source;
1151
+ return l = l.replace(K.caret, "$1"), e = e.replace(r, l), n;
1152
+ }, "replace"), getRegex: /* @__PURE__ */ p(() => new RegExp(e, t), "getRegex") };
1153
1153
  return n;
1154
1154
  }
1155
- h(D, "k");
1156
- var wr = ((a = "") => {
1155
+ p(D, "k");
1156
+ var yr = ((a = "") => {
1157
1157
  try {
1158
1158
  return !!new RegExp("(?<=1)(?<!1)" + a);
1159
1159
  } catch {
1160
1160
  return !1;
1161
1161
  }
1162
- })(), K = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, yr = /^(?:[ \t]*(?:\n|$))+/, vr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Tr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ct = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Sr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, sn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ps = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ds = D(ps).replace(/bull/g, sn).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(), Ar = D(ps).replace(/bull/g, sn).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(), rn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Er = /^[^\n]+/, an = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, _r = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", an).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Rr = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, sn).getRegex(), At = "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", ln = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Cr = D("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ln).replace("tag", At).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), fs = D(rn).replace("hr", ct).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", At).getRegex(), Ir = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", fs).getRegex(), on = { blockquote: Ir, code: vr, def: _r, fences: Tr, heading: Sr, hr: ct, html: Cr, lheading: ds, list: Rr, newline: yr, paragraph: fs, table: Ie, text: Er }, Zn = D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ct).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", At).getRegex(), Dr = { ...on, lheading: Ar, table: Zn, paragraph: D(rn).replace("hr", ct).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).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", At).getRegex() }, Mr = { ...on, html: D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ln).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: Ie, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(rn).replace("hr", ct).replace("heading", ` *#{1,6} *[^
1163
- ]`).replace("lheading", ds).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Lr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Or = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, gs = /^( {2,}|\\)\n(?!\s*$)/, zr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ze = /[\p{P}\p{S}]/u, Et = /[\s\p{P}\p{S}]/u, cn = /[^\s\p{P}\p{S}]/u, Pr = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Et).getRegex(), ms = /(?!~)[\p{P}\p{S}]/u, Nr = /(?!~)[\s\p{P}\p{S}]/u, $r = /(?:[^\s\p{P}\p{S}]|~)/u, Ur = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", wr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), bs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Br = D(bs, "u").replace(/punct/g, Ze).getRegex(), Fr = D(bs, "u").replace(/punct/g, ms).getRegex(), xs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Hr = D(xs, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Et).replace(/punct/g, Ze).getRegex(), Gr = D(xs, "gu").replace(/notPunctSpace/g, $r).replace(/punctSpace/g, Nr).replace(/punct/g, ms).getRegex(), jr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Et).replace(/punct/g, Ze).getRegex(), Wr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ze).getRegex(), qr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Vr = D(qr, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Et).replace(/punct/g, Ze).getRegex(), Yr = D(/\\(punct)/, "gu").replace(/punct/g, Ze).getRegex(), Zr = D(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Xr = D(ln).replace("(?:-->|$)", "-->").getRegex(), Kr = D("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Xr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), vt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Qr = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", vt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ks = D(/^!?\[(label)\]\[(ref)\]/).replace("label", vt).replace("ref", an).getRegex(), ws = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", an).getRegex(), Jr = D("reflink|nolink(?!\\()", "g").replace("reflink", ks).replace("nolink", ws).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, un = { _backpedal: Ie, anyPunctuation: Yr, autolink: Zr, blockSkip: Ur, br: gs, code: Or, del: Ie, delLDelim: Ie, delRDelim: Ie, emStrongLDelim: Br, emStrongRDelimAst: Hr, emStrongRDelimUnd: jr, escape: Lr, link: Qr, nolink: ws, punctuation: Pr, reflink: ks, reflinkSearch: Jr, tag: Kr, text: zr, url: Ie }, ei = { ...un, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", vt).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", vt).getRegex() }, en = { ...un, emStrongRDelimAst: Gr, emStrongLDelim: Fr, delLDelim: Wr, delRDelim: Vr, url: D(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: D(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, ti = { ...en, br: D(gs).replace("{2,}", "*").getRegex(), text: D(en.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, wt = { normal: on, gfm: Dr, pedantic: Mr }, it = { normal: un, gfm: en, breaks: ti, pedantic: ei }, ni = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Kn = /* @__PURE__ */ h((a) => ni[a], "de");
1164
- function be(a, t) {
1162
+ })(), K = { 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__ */ p((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, Tr = /^(?:[ \t]*(?:\n|$))+/, Sr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ar = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ct = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Er = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, nn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ds = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, fs = D(ds).replace(/bull/g, nn).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(), _r = D(ds).replace(/bull/g, nn).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(), sn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Rr = /^[^\n]+/, rn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Cr = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", rn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ir = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, nn).getRegex(), At = "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", an = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Dr = D("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", an).replace("tag", At).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), gs = D(sn).replace("hr", ct).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", At).getRegex(), Mr = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", gs).getRegex(), ln = { blockquote: Mr, code: Sr, def: Cr, fences: Ar, heading: Er, hr: ct, html: Dr, lheading: fs, list: Ir, newline: Tr, paragraph: gs, table: De, text: Rr }, Zn = D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ct).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", At).getRegex(), Lr = { ...ln, lheading: _r, table: Zn, paragraph: D(sn).replace("hr", ct).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).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", At).getRegex() }, Or = { ...ln, html: D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", an).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: De, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(sn).replace("hr", ct).replace("heading", ` *#{1,6} *[^
1163
+ ]`).replace("lheading", fs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, zr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ms = /^( {2,}|\\)\n(?!\s*$)/, Nr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ve = /[\p{P}\p{S}]/u, Et = /[\s\p{P}\p{S}]/u, on = /[^\s\p{P}\p{S}]/u, $r = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Et).getRegex(), bs = /(?!~)[\p{P}\p{S}]/u, Ur = /(?!~)[\s\p{P}\p{S}]/u, Br = /(?:[^\s\p{P}\p{S}]|~)/u, Fr = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", yr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), xs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Hr = D(xs, "u").replace(/punct/g, Ve).getRegex(), Gr = D(xs, "u").replace(/punct/g, bs).getRegex(), ks = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", jr = D(ks, "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, Et).replace(/punct/g, Ve).getRegex(), Wr = D(ks, "gu").replace(/notPunctSpace/g, Br).replace(/punctSpace/g, Ur).replace(/punct/g, bs).getRegex(), qr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, Et).replace(/punct/g, Ve).getRegex(), Vr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ve).getRegex(), Yr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Zr = D(Yr, "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, Et).replace(/punct/g, Ve).getRegex(), Xr = D(/\\(punct)/, "gu").replace(/punct/g, Ve).getRegex(), Kr = D(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Qr = D(an).replace("(?:-->|$)", "-->").getRegex(), Jr = D("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), vt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ei = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", vt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ws = D(/^!?\[(label)\]\[(ref)\]/).replace("label", vt).replace("ref", rn).getRegex(), vs = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", rn).getRegex(), ti = D("reflink|nolink(?!\\()", "g").replace("reflink", ws).replace("nolink", vs).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, cn = { _backpedal: De, anyPunctuation: Xr, autolink: Kr, blockSkip: Fr, br: ms, code: Pr, del: De, delLDelim: De, delRDelim: De, emStrongLDelim: Hr, emStrongRDelimAst: jr, emStrongRDelimUnd: qr, escape: zr, link: ei, nolink: vs, punctuation: $r, reflink: ws, reflinkSearch: ti, tag: Jr, text: Nr, url: De }, ni = { ...cn, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", vt).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", vt).getRegex() }, Jt = { ...cn, emStrongRDelimAst: Wr, emStrongLDelim: Gr, delLDelim: Vr, delRDelim: Zr, url: D(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: D(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, si = { ...Jt, br: D(ms).replace("{2,}", "*").getRegex(), text: D(Jt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, kt = { normal: ln, gfm: Lr, pedantic: Or }, it = { normal: cn, gfm: Jt, breaks: si, pedantic: ni }, ri = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Kn = /* @__PURE__ */ p((a) => ri[a], "de");
1164
+ function me(a, t) {
1165
1165
  if (t) {
1166
1166
  if (K.escapeTest.test(a)) return a.replace(K.escapeReplace, Kn);
1167
1167
  } else if (K.escapeTestNoEncode.test(a)) return a.replace(K.escapeReplaceNoEncode, Kn);
1168
1168
  return a;
1169
1169
  }
1170
- h(be, "O");
1170
+ p(me, "O");
1171
1171
  function Qn(a) {
1172
1172
  try {
1173
1173
  a = encodeURI(a).replace(K.percentDecode, "%");
@@ -1176,20 +1176,20 @@ function Qn(a) {
1176
1176
  }
1177
1177
  return a;
1178
1178
  }
1179
- h(Qn, "J");
1179
+ p(Qn, "J");
1180
1180
  function Jn(a, t) {
1181
- let e = a.replace(K.findPipe, (s, o, l) => {
1182
- let m = !1, c = o;
1183
- for (; --c >= 0 && l[c] === "\\"; ) m = !m;
1184
- return m ? "|" : " |";
1181
+ let e = a.replace(K.findPipe, (s, l, o) => {
1182
+ let d = !1, c = l;
1183
+ for (; --c >= 0 && o[c] === "\\"; ) d = !d;
1184
+ return d ? "|" : " |";
1185
1185
  }), n = e.split(K.splitPipe), r = 0;
1186
1186
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1187
1187
  else for (; n.length < t; ) n.push("");
1188
1188
  for (; r < n.length; r++) n[r] = n[r].trim().replace(K.slashPipe, "|");
1189
1189
  return n;
1190
1190
  }
1191
- h(Jn, "V");
1192
- function ve(a, t, e) {
1191
+ p(Jn, "V");
1192
+ function ye(a, t, e) {
1193
1193
  let n = a.length;
1194
1194
  if (n === 0) return "";
1195
1195
  let r = 0;
@@ -1197,7 +1197,7 @@ function ve(a, t, e) {
1197
1197
  r++;
1198
1198
  return a.slice(0, n - r);
1199
1199
  }
1200
- h(ve, "$");
1200
+ p(ye, "$");
1201
1201
  function es(a) {
1202
1202
  let t = a.split(`
1203
1203
  `), e = t.length - 1;
@@ -1205,8 +1205,8 @@ function es(a) {
1205
1205
  return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
1206
1206
  `);
1207
1207
  }
1208
- h(es, "Y");
1209
- function si(a, t) {
1208
+ p(es, "Y");
1209
+ function ii(a, t) {
1210
1210
  if (a.indexOf(t[1]) === -1) return -1;
1211
1211
  let e = 0;
1212
1212
  for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
@@ -1214,8 +1214,8 @@ function si(a, t) {
1214
1214
  else if (a[n] === t[1] && (e--, e < 0)) return n;
1215
1215
  return e > 0 ? -2 : -1;
1216
1216
  }
1217
- h(si, "ge");
1218
- function ri(a, t = 0) {
1217
+ p(ii, "ge");
1218
+ function ai(a, t = 0) {
1219
1219
  let e = t, n = "";
1220
1220
  for (let r of a) if (r === " ") {
1221
1221
  let s = 4 - e % 4;
@@ -1223,29 +1223,29 @@ function ri(a, t = 0) {
1223
1223
  } else n += r, e++;
1224
1224
  return n;
1225
1225
  }
1226
- h(ri, "fe");
1226
+ p(ai, "fe");
1227
1227
  function ts(a, t, e, n, r) {
1228
- let s = t.href, o = t.title || null, l = a[1].replace(r.other.outputLinkReplace, "$1");
1228
+ let s = t.href, l = t.title || null, o = a[1].replace(r.other.outputLinkReplace, "$1");
1229
1229
  n.state.inLink = !0;
1230
- let m = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: o, text: l, tokens: n.inlineTokens(l) };
1231
- return n.state.inLink = !1, m;
1230
+ let d = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
1231
+ return n.state.inLink = !1, d;
1232
1232
  }
1233
- h(ts, "me");
1234
- function ii(a, t, e) {
1233
+ p(ts, "me");
1234
+ function li(a, t, e) {
1235
1235
  let n = a.match(e.other.indentCodeCompensation);
1236
1236
  if (n === null) return t;
1237
1237
  let r = n[1];
1238
1238
  return t.split(`
1239
1239
  `).map((s) => {
1240
- let o = s.match(e.other.beginningSpace);
1241
- if (o === null) return s;
1242
- let [l] = o;
1243
- return l.length >= r.length ? s.slice(r.length) : s;
1240
+ let l = s.match(e.other.beginningSpace);
1241
+ if (l === null) return s;
1242
+ let [o] = l;
1243
+ return o.length >= r.length ? s.slice(r.length) : s;
1244
1244
  }).join(`
1245
1245
  `);
1246
1246
  }
1247
- h(ii, "rt");
1248
- var je, Tt = (je = class {
1247
+ p(li, "rt");
1248
+ var He, yt = (He = class {
1249
1249
  constructor(t) {
1250
1250
  I(this, "options");
1251
1251
  I(this, "rules");
@@ -1266,7 +1266,7 @@ var je, Tt = (je = class {
1266
1266
  fences(t) {
1267
1267
  let e = this.rules.block.fences.exec(t);
1268
1268
  if (e) {
1269
- let n = e[0], r = ii(n, e[3] || "", this.rules);
1269
+ let n = e[0], r = li(n, e[3] || "", this.rules);
1270
1270
  return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
1271
1271
  }
1272
1272
  }
@@ -1275,56 +1275,56 @@ var je, Tt = (je = class {
1275
1275
  if (e) {
1276
1276
  let n = e[2].trim();
1277
1277
  if (this.rules.other.endingHash.test(n)) {
1278
- let r = ve(n, "#");
1278
+ let r = ye(n, "#");
1279
1279
  (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
1280
1280
  }
1281
- return { type: "heading", raw: ve(e[0], `
1281
+ return { type: "heading", raw: ye(e[0], `
1282
1282
  `), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
1283
1283
  }
1284
1284
  }
1285
1285
  hr(t) {
1286
1286
  let e = this.rules.block.hr.exec(t);
1287
- if (e) return { type: "hr", raw: ve(e[0], `
1287
+ if (e) return { type: "hr", raw: ye(e[0], `
1288
1288
  `) };
1289
1289
  }
1290
1290
  blockquote(t) {
1291
1291
  let e = this.rules.block.blockquote.exec(t);
1292
1292
  if (e) {
1293
- let n = ve(e[0], `
1293
+ let n = ye(e[0], `
1294
1294
  `).split(`
1295
- `), r = "", s = "", o = [];
1295
+ `), r = "", s = "", l = [];
1296
1296
  for (; n.length > 0; ) {
1297
- let l = !1, m = [], c;
1298
- for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) m.push(n[c]), l = !0;
1299
- else if (!l) m.push(n[c]);
1297
+ let o = !1, d = [], c;
1298
+ for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) d.push(n[c]), o = !0;
1299
+ else if (!o) d.push(n[c]);
1300
1300
  else break;
1301
1301
  n = n.slice(c);
1302
- let b = m.join(`
1303
- `), p = b.replace(this.rules.other.blockquoteSetextReplace, `
1302
+ let b = d.join(`
1303
+ `), u = b.replace(this.rules.other.blockquoteSetextReplace, `
1304
1304
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1305
1305
  r = r ? `${r}
1306
1306
  ${b}` : b, s = s ? `${s}
1307
- ${p}` : p;
1308
- let d = this.lexer.state.top;
1309
- if (this.lexer.state.top = !0, this.lexer.blockTokens(p, o, !0), this.lexer.state.top = d, n.length === 0) break;
1310
- let g = o.at(-1);
1311
- if (g?.type === "code") break;
1312
- if (g?.type === "blockquote") {
1313
- let y = g, E = y.raw + `
1307
+ ${u}` : u;
1308
+ let m = this.lexer.state.top;
1309
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(u, l, !0), this.lexer.state.top = m, n.length === 0) break;
1310
+ let f = l.at(-1);
1311
+ if (f?.type === "code") break;
1312
+ if (f?.type === "blockquote") {
1313
+ let w = f, _ = w.raw + `
1314
1314
  ` + n.join(`
1315
- `), O = this.blockquote(E);
1316
- o[o.length - 1] = O, r = r.substring(0, r.length - y.raw.length) + O.raw, s = s.substring(0, s.length - y.text.length) + O.text;
1315
+ `), O = this.blockquote(_);
1316
+ l[l.length - 1] = O, r = r.substring(0, r.length - w.raw.length) + O.raw, s = s.substring(0, s.length - w.text.length) + O.text;
1317
1317
  break;
1318
- } else if (g?.type === "list") {
1319
- let y = g, E = y.raw + `
1318
+ } else if (f?.type === "list") {
1319
+ let w = f, _ = w.raw + `
1320
1320
  ` + n.join(`
1321
- `), O = this.list(E);
1322
- o[o.length - 1] = O, r = r.substring(0, r.length - g.raw.length) + O.raw, s = s.substring(0, s.length - y.raw.length) + O.raw, n = E.substring(o.at(-1).raw.length).split(`
1321
+ `), O = this.list(_);
1322
+ l[l.length - 1] = O, r = r.substring(0, r.length - f.raw.length) + O.raw, s = s.substring(0, s.length - w.raw.length) + O.raw, n = _.substring(l.at(-1).raw.length).split(`
1323
1323
  `);
1324
1324
  continue;
1325
1325
  }
1326
1326
  }
1327
- return { type: "blockquote", raw: r, tokens: o, text: s };
1327
+ return { type: "blockquote", raw: r, tokens: l, text: s };
1328
1328
  }
1329
1329
  }
1330
1330
  list(t) {
@@ -1332,56 +1332,56 @@ ${p}` : p;
1332
1332
  if (e) {
1333
1333
  let n = e[1].trim(), r = n.length > 1, s = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: !1, items: [] };
1334
1334
  n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1335
- let o = this.rules.other.listItemRegex(n), l = !1;
1335
+ let l = this.rules.other.listItemRegex(n), o = !1;
1336
1336
  for (; t; ) {
1337
- let c = !1, b = "", p = "";
1338
- if (!(e = o.exec(t)) || this.rules.block.hr.test(t)) break;
1337
+ let c = !1, b = "", u = "";
1338
+ if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
1339
1339
  b = e[0], t = t.substring(b.length);
1340
- let d = ri(e[2].split(`
1341
- `, 1)[0], e[1].length), g = t.split(`
1342
- `, 1)[0], y = !d.trim(), E = 0;
1343
- if (this.options.pedantic ? (E = 2, p = d.trimStart()) : y ? E = e[1].length + 1 : (E = d.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, p = d.slice(E), E += e[1].length), y && this.rules.other.blankLine.test(g) && (b += g + `
1344
- `, t = t.substring(g.length + 1), c = !0), !c) {
1345
- let O = this.rules.other.nextBulletRegex(E), ce = this.rules.other.hrRegex(E), ue = this.rules.other.fencesBeginRegex(E), ne = this.rules.other.headingBeginRegex(E), N = this.rules.other.htmlBeginRegex(E), Y = this.rules.other.blockquoteBeginRegex(E);
1340
+ let m = ai(e[2].split(`
1341
+ `, 1)[0], e[1].length), f = t.split(`
1342
+ `, 1)[0], w = !m.trim(), _ = 0;
1343
+ if (this.options.pedantic ? (_ = 2, u = m.trimStart()) : w ? _ = e[1].length + 1 : (_ = m.search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, u = m.slice(_), _ += e[1].length), w && this.rules.other.blankLine.test(f) && (b += f + `
1344
+ `, t = t.substring(f.length + 1), c = !0), !c) {
1345
+ let O = this.rules.other.nextBulletRegex(_), ie = this.rules.other.hrRegex(_), be = this.rules.other.fencesBeginRegex(_), G = this.rules.other.headingBeginRegex(_), P = this.rules.other.htmlBeginRegex(_), de = this.rules.other.blockquoteBeginRegex(_);
1346
1346
  for (; t; ) {
1347
1347
  let ae = t.split(`
1348
1348
  `, 1)[0], Q;
1349
- if (g = ae, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), Q = g) : Q = g.replace(this.rules.other.tabCharGlobal, " "), ue.test(g) || ne.test(g) || N.test(g) || Y.test(g) || O.test(g) || ce.test(g)) break;
1350
- if (Q.search(this.rules.other.nonSpaceChar) >= E || !g.trim()) p += `
1351
- ` + Q.slice(E);
1349
+ if (f = ae, this.options.pedantic ? (f = f.replace(this.rules.other.listReplaceNesting, " "), Q = f) : Q = f.replace(this.rules.other.tabCharGlobal, " "), be.test(f) || G.test(f) || P.test(f) || de.test(f) || O.test(f) || ie.test(f)) break;
1350
+ if (Q.search(this.rules.other.nonSpaceChar) >= _ || !f.trim()) u += `
1351
+ ` + Q.slice(_);
1352
1352
  else {
1353
- if (y || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ue.test(d) || ne.test(d) || ce.test(d)) break;
1354
- p += `
1355
- ` + g;
1353
+ if (w || m.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || be.test(m) || G.test(m) || ie.test(m)) break;
1354
+ u += `
1355
+ ` + f;
1356
1356
  }
1357
- y = !g.trim(), b += ae + `
1358
- `, t = t.substring(ae.length + 1), d = Q.slice(E);
1357
+ w = !f.trim(), b += ae + `
1358
+ `, t = t.substring(ae.length + 1), m = Q.slice(_);
1359
1359
  }
1360
1360
  }
1361
- s.loose || (l ? s.loose = !0 : this.rules.other.doubleBlankLine.test(b) && (l = !0)), s.items.push({ type: "list_item", raw: b, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: !1, text: p, tokens: [] }), s.raw += b;
1361
+ s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(b) && (o = !0)), s.items.push({ type: "list_item", raw: b, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), s.raw += b;
1362
1362
  }
1363
- let m = s.items.at(-1);
1364
- if (m) m.raw = m.raw.trimEnd(), m.text = m.text.trimEnd();
1363
+ let d = s.items.at(-1);
1364
+ if (d) d.raw = d.raw.trimEnd(), d.text = d.text.trimEnd();
1365
1365
  else return;
1366
1366
  s.raw = s.raw.trimEnd();
1367
1367
  for (let c of s.items) {
1368
1368
  if (this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []), c.task) {
1369
1369
  if (c.text = c.text.replace(this.rules.other.listReplaceTask, ""), c.tokens[0]?.type === "text" || c.tokens[0]?.type === "paragraph") {
1370
1370
  c.tokens[0].raw = c.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), c.tokens[0].text = c.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
1371
- for (let p = this.lexer.inlineQueue.length - 1; p >= 0; p--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)) {
1372
- this.lexer.inlineQueue[p].src = this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask, "");
1371
+ for (let u = this.lexer.inlineQueue.length - 1; u >= 0; u--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)) {
1372
+ this.lexer.inlineQueue[u].src = this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask, "");
1373
1373
  break;
1374
1374
  }
1375
1375
  }
1376
1376
  let b = this.rules.other.listTaskCheckbox.exec(c.raw);
1377
1377
  if (b) {
1378
- let p = { type: "checkbox", raw: b[0] + " ", checked: b[0] !== "[ ]" };
1379
- c.checked = p.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = p.raw + c.tokens[0].raw, c.tokens[0].text = p.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(p)) : c.tokens.unshift({ type: "paragraph", raw: p.raw, text: p.raw, tokens: [p] }) : c.tokens.unshift(p);
1378
+ let u = { type: "checkbox", raw: b[0] + " ", checked: b[0] !== "[ ]" };
1379
+ c.checked = u.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = u.raw + c.tokens[0].raw, c.tokens[0].text = u.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(u)) : c.tokens.unshift({ type: "paragraph", raw: u.raw, text: u.raw, tokens: [u] }) : c.tokens.unshift(u);
1380
1380
  }
1381
1381
  }
1382
1382
  if (!s.loose) {
1383
- let b = c.tokens.filter((d) => d.type === "space"), p = b.length > 0 && b.some((d) => this.rules.other.anyLine.test(d.raw));
1384
- s.loose = p;
1383
+ let b = c.tokens.filter((m) => m.type === "space"), u = b.length > 0 && b.some((m) => this.rules.other.anyLine.test(m.raw));
1384
+ s.loose = u;
1385
1385
  }
1386
1386
  }
1387
1387
  if (s.loose) for (let c of s.items) {
@@ -1402,7 +1402,7 @@ ${p}` : p;
1402
1402
  let e = this.rules.block.def.exec(t);
1403
1403
  if (e) {
1404
1404
  let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
1405
- return { type: "def", tag: n, raw: ve(e[0], `
1405
+ return { type: "def", tag: n, raw: ye(e[0], `
1406
1406
  `), href: r, title: s };
1407
1407
  }
1408
1408
  }
@@ -1410,20 +1410,20 @@ ${p}` : p;
1410
1410
  let e = this.rules.block.table.exec(t);
1411
1411
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
1412
1412
  let n = Jn(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1413
- `) : [], o = { type: "table", raw: ve(e[0], `
1413
+ `) : [], l = { type: "table", raw: ye(e[0], `
1414
1414
  `), header: [], align: [], rows: [] };
1415
1415
  if (n.length === r.length) {
1416
- for (let l of r) this.rules.other.tableAlignRight.test(l) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? o.align.push("left") : o.align.push(null);
1417
- for (let l = 0; l < n.length; l++) o.header.push({ text: n[l], tokens: this.lexer.inline(n[l]), header: !0, align: o.align[l] });
1418
- for (let l of s) o.rows.push(Jn(l, o.header.length).map((m, c) => ({ text: m, tokens: this.lexer.inline(m), header: !1, align: o.align[c] })));
1419
- return o;
1416
+ for (let o of r) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
1417
+ for (let o = 0; o < n.length; o++) l.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: l.align[o] });
1418
+ for (let o of s) l.rows.push(Jn(o, l.header.length).map((d, c) => ({ text: d, tokens: this.lexer.inline(d), header: !1, align: l.align[c] })));
1419
+ return l;
1420
1420
  }
1421
1421
  }
1422
1422
  lheading(t) {
1423
1423
  let e = this.rules.block.lheading.exec(t);
1424
1424
  if (e) {
1425
1425
  let n = e[1].trim();
1426
- return { type: "heading", raw: ve(e[0], `
1426
+ return { type: "heading", raw: ye(e[0], `
1427
1427
  `), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
1428
1428
  }
1429
1429
  }
@@ -1453,20 +1453,20 @@ ${p}` : p;
1453
1453
  let n = e[2].trim();
1454
1454
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
1455
1455
  if (!this.rules.other.endAngleBracket.test(n)) return;
1456
- let o = ve(n.slice(0, -1), "\\");
1457
- if ((n.length - o.length) % 2 === 0) return;
1456
+ let l = ye(n.slice(0, -1), "\\");
1457
+ if ((n.length - l.length) % 2 === 0) return;
1458
1458
  } else {
1459
- let o = si(e[2], "()");
1460
- if (o === -2) return;
1461
- if (o > -1) {
1462
- let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + o;
1463
- e[2] = e[2].substring(0, o), e[0] = e[0].substring(0, l).trim(), e[3] = "";
1459
+ let l = ii(e[2], "()");
1460
+ if (l === -2) return;
1461
+ if (l > -1) {
1462
+ let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
1463
+ e[2] = e[2].substring(0, l), e[0] = e[0].substring(0, o).trim(), e[3] = "";
1464
1464
  }
1465
1465
  }
1466
1466
  let r = e[2], s = "";
1467
1467
  if (this.options.pedantic) {
1468
- let o = this.rules.other.pedanticHrefTitle.exec(r);
1469
- o && (r = o[1], s = o[3]);
1468
+ let l = this.rules.other.pedanticHrefTitle.exec(r);
1469
+ l && (r = l[1], s = l[3]);
1470
1470
  } else s = e[3] ? e[3].slice(1, -1) : "";
1471
1471
  return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ts(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
1472
1472
  }
@@ -1476,8 +1476,8 @@ ${p}` : p;
1476
1476
  if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
1477
1477
  let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[r.toLowerCase()];
1478
1478
  if (!s) {
1479
- let o = n[0].charAt(0);
1480
- return { type: "text", raw: o, text: o };
1479
+ let l = n[0].charAt(0);
1480
+ return { type: "text", raw: l, text: l };
1481
1481
  }
1482
1482
  return ts(n, s, n[0], this.lexer, this.rules);
1483
1483
  }
@@ -1485,25 +1485,25 @@ ${p}` : p;
1485
1485
  emStrong(t, e, n = "") {
1486
1486
  let r = this.rules.inline.emStrongLDelim.exec(t);
1487
1487
  if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1488
- let s = [...r[0]].length - 1, o, l, m = s, c = 0, b = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1488
+ let s = [...r[0]].length - 1, l, o, d = s, c = 0, b = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1489
1489
  for (b.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = b.exec(e)) !== null; ) {
1490
- if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
1491
- if (l = [...o].length, r[3] || r[4]) {
1492
- m += l;
1490
+ if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l) continue;
1491
+ if (o = [...l].length, r[3] || r[4]) {
1492
+ d += o;
1493
1493
  continue;
1494
- } else if ((r[5] || r[6]) && s % 3 && !((s + l) % 3)) {
1495
- c += l;
1494
+ } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
1495
+ c += o;
1496
1496
  continue;
1497
1497
  }
1498
- if (m -= l, m > 0) continue;
1499
- l = Math.min(l, l + m + c);
1500
- let p = [...r[0]][0].length, d = t.slice(0, s + r.index + p + l);
1501
- if (Math.min(s, l) % 2) {
1502
- let y = d.slice(1, -1);
1503
- return { type: "em", raw: d, text: y, tokens: this.lexer.inlineTokens(y) };
1498
+ if (d -= o, d > 0) continue;
1499
+ o = Math.min(o, o + d + c);
1500
+ let u = [...r[0]][0].length, m = t.slice(0, s + r.index + u + o);
1501
+ if (Math.min(s, o) % 2) {
1502
+ let w = m.slice(1, -1);
1503
+ return { type: "em", raw: m, text: w, tokens: this.lexer.inlineTokens(w) };
1504
1504
  }
1505
- let g = d.slice(2, -2);
1506
- return { type: "strong", raw: d, text: g, tokens: this.lexer.inlineTokens(g) };
1505
+ let f = m.slice(2, -2);
1506
+ return { type: "strong", raw: m, text: f, tokens: this.lexer.inlineTokens(f) };
1507
1507
  }
1508
1508
  }
1509
1509
  }
@@ -1521,17 +1521,17 @@ ${p}` : p;
1521
1521
  del(t, e, n = "") {
1522
1522
  let r = this.rules.inline.delLDelim.exec(t);
1523
1523
  if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
1524
- let s = [...r[0]].length - 1, o, l, m = s, c = this.rules.inline.delRDelim;
1524
+ let s = [...r[0]].length - 1, l, o, d = s, c = this.rules.inline.delRDelim;
1525
1525
  for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = c.exec(e)) !== null; ) {
1526
- if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o || (l = [...o].length, l !== s)) continue;
1526
+ if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l || (o = [...l].length, o !== s)) continue;
1527
1527
  if (r[3] || r[4]) {
1528
- m += l;
1528
+ d += o;
1529
1529
  continue;
1530
1530
  }
1531
- if (m -= l, m > 0) continue;
1532
- l = Math.min(l, l + m);
1533
- let b = [...r[0]][0].length, p = t.slice(0, s + r.index + b + l), d = p.slice(s, -s);
1534
- return { type: "del", raw: p, text: d, tokens: this.lexer.inlineTokens(d) };
1531
+ if (d -= o, d > 0) continue;
1532
+ o = Math.min(o, o + d);
1533
+ let b = [...r[0]][0].length, u = t.slice(0, s + r.index + b + o), m = u.slice(s, -s);
1534
+ return { type: "del", raw: u, text: m, tokens: this.lexer.inlineTokens(m) };
1535
1535
  }
1536
1536
  }
1537
1537
  }
@@ -1564,19 +1564,19 @@ ${p}` : p;
1564
1564
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1565
1565
  }
1566
1566
  }
1567
- }, h(je, "w"), je), Ae, de = (Ae = class {
1567
+ }, p(He, "w"), He), Ae, he = (Ae = class {
1568
1568
  constructor(t) {
1569
1569
  I(this, "tokens");
1570
1570
  I(this, "options");
1571
1571
  I(this, "state");
1572
1572
  I(this, "inlineQueue");
1573
1573
  I(this, "tokenizer");
1574
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new Tt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1575
- let e = { other: K, block: wt.normal, inline: it.normal };
1576
- this.options.pedantic ? (e.block = wt.pedantic, e.inline = it.pedantic) : this.options.gfm && (e.block = wt.gfm, this.options.breaks ? e.inline = it.breaks : e.inline = it.gfm), this.tokenizer.rules = e;
1574
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new yt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1575
+ let e = { other: K, block: kt.normal, inline: it.normal };
1576
+ this.options.pedantic ? (e.block = kt.pedantic, e.inline = it.pedantic) : this.options.gfm && (e.block = kt.gfm, this.options.breaks ? e.inline = it.breaks : e.inline = it.gfm), this.tokenizer.rules = e;
1577
1577
  }
1578
1578
  static get rules() {
1579
- return { block: wt, inline: it };
1579
+ return { block: kt, inline: it };
1580
1580
  }
1581
1581
  static lex(t, e) {
1582
1582
  return new Ae(e).lex(t);
@@ -1603,21 +1603,21 @@ ${p}` : p;
1603
1603
  break;
1604
1604
  }
1605
1605
  let s;
1606
- if (this.options.extensions?.block?.some((l) => (s = l.call({ lexer: this }, t, e)) ? (t = t.substring(s.raw.length), e.push(s), !0) : !1)) continue;
1606
+ if (this.options.extensions?.block?.some((o) => (s = o.call({ lexer: this }, t, e)) ? (t = t.substring(s.raw.length), e.push(s), !0) : !1)) continue;
1607
1607
  if (s = this.tokenizer.space(t)) {
1608
1608
  t = t.substring(s.raw.length);
1609
- let l = e.at(-1);
1610
- s.raw.length === 1 && l !== void 0 ? l.raw += `
1609
+ let o = e.at(-1);
1610
+ s.raw.length === 1 && o !== void 0 ? o.raw += `
1611
1611
  ` : e.push(s);
1612
1612
  continue;
1613
1613
  }
1614
1614
  if (s = this.tokenizer.code(t)) {
1615
1615
  t = t.substring(s.raw.length);
1616
- let l = e.at(-1);
1617
- l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith(`
1616
+ let o = e.at(-1);
1617
+ o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
1618
1618
  `) ? "" : `
1619
- `) + s.raw, l.text += `
1620
- ` + s.text, this.inlineQueue.at(-1).src = l.text) : e.push(s);
1619
+ `) + s.raw, o.text += `
1620
+ ` + s.text, this.inlineQueue.at(-1).src = o.text) : e.push(s);
1621
1621
  continue;
1622
1622
  }
1623
1623
  if (s = this.tokenizer.fences(t)) {
@@ -1646,11 +1646,11 @@ ${p}` : p;
1646
1646
  }
1647
1647
  if (s = this.tokenizer.def(t)) {
1648
1648
  t = t.substring(s.raw.length);
1649
- let l = e.at(-1);
1650
- l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith(`
1649
+ let o = e.at(-1);
1650
+ o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
1651
1651
  `) ? "" : `
1652
- `) + s.raw, l.text += `
1653
- ` + s.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[s.tag] || (this.tokens.links[s.tag] = { href: s.href, title: s.title }, e.push(s));
1652
+ `) + s.raw, o.text += `
1653
+ ` + s.raw, this.inlineQueue.at(-1).src = o.text) : this.tokens.links[s.tag] || (this.tokens.links[s.tag] = { href: s.href, title: s.title }, e.push(s));
1654
1654
  continue;
1655
1655
  }
1656
1656
  if (s = this.tokenizer.table(t)) {
@@ -1661,28 +1661,28 @@ ${p}` : p;
1661
1661
  t = t.substring(s.raw.length), e.push(s);
1662
1662
  continue;
1663
1663
  }
1664
- let o = t;
1664
+ let l = t;
1665
1665
  if (this.options.extensions?.startBlock) {
1666
- let l = 1 / 0, m = t.slice(1), c;
1666
+ let o = 1 / 0, d = t.slice(1), c;
1667
1667
  this.options.extensions.startBlock.forEach((b) => {
1668
- c = b.call({ lexer: this }, m), typeof c == "number" && c >= 0 && (l = Math.min(l, c));
1669
- }), l < 1 / 0 && l >= 0 && (o = t.substring(0, l + 1));
1668
+ c = b.call({ lexer: this }, d), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1669
+ }), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
1670
1670
  }
1671
- if (this.state.top && (s = this.tokenizer.paragraph(o))) {
1672
- let l = e.at(-1);
1673
- n && l?.type === "paragraph" ? (l.raw += (l.raw.endsWith(`
1671
+ if (this.state.top && (s = this.tokenizer.paragraph(l))) {
1672
+ let o = e.at(-1);
1673
+ n && o?.type === "paragraph" ? (o.raw += (o.raw.endsWith(`
1674
1674
  `) ? "" : `
1675
- `) + s.raw, l.text += `
1676
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : e.push(s), n = o.length !== t.length, t = t.substring(s.raw.length);
1675
+ `) + s.raw, o.text += `
1676
+ ` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : e.push(s), n = l.length !== t.length, t = t.substring(s.raw.length);
1677
1677
  continue;
1678
1678
  }
1679
1679
  if (s = this.tokenizer.text(t)) {
1680
1680
  t = t.substring(s.raw.length);
1681
- let l = e.at(-1);
1682
- l?.type === "text" ? (l.raw += (l.raw.endsWith(`
1681
+ let o = e.at(-1);
1682
+ o?.type === "text" ? (o.raw += (o.raw.endsWith(`
1683
1683
  `) ? "" : `
1684
- `) + s.raw, l.text += `
1685
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : e.push(s);
1684
+ `) + s.raw, o.text += `
1685
+ ` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : e.push(s);
1686
1686
  continue;
1687
1687
  }
1688
1688
  if (t) {
@@ -1706,16 +1706,16 @@ ${p}` : p;
1706
1706
  let s;
1707
1707
  for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) s = r[2] ? r[2].length : 0, n = n.slice(0, r.index + s) + "[" + "a".repeat(r[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1708
1708
  n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
1709
- let o = !1, l = "", m = 1 / 0;
1709
+ let l = !1, o = "", d = 1 / 0;
1710
1710
  for (; t; ) {
1711
- if (t.length < m) m = t.length;
1711
+ if (t.length < d) d = t.length;
1712
1712
  else {
1713
1713
  this.infiniteLoopError(t.charCodeAt(0));
1714
1714
  break;
1715
1715
  }
1716
- o || (l = ""), o = !1;
1716
+ l || (o = ""), l = !1;
1717
1717
  let c;
1718
- if (this.options.extensions?.inline?.some((p) => (c = p.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1718
+ if (this.options.extensions?.inline?.some((u) => (c = u.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1719
1719
  if (c = this.tokenizer.escape(t)) {
1720
1720
  t = t.substring(c.raw.length), e.push(c);
1721
1721
  continue;
@@ -1730,11 +1730,11 @@ ${p}` : p;
1730
1730
  }
1731
1731
  if (c = this.tokenizer.reflink(t, this.tokens.links)) {
1732
1732
  t = t.substring(c.raw.length);
1733
- let p = e.at(-1);
1734
- c.type === "text" && p?.type === "text" ? (p.raw += c.raw, p.text += c.text) : e.push(c);
1733
+ let u = e.at(-1);
1734
+ c.type === "text" && u?.type === "text" ? (u.raw += c.raw, u.text += c.text) : e.push(c);
1735
1735
  continue;
1736
1736
  }
1737
- if (c = this.tokenizer.emStrong(t, n, l)) {
1737
+ if (c = this.tokenizer.emStrong(t, n, o)) {
1738
1738
  t = t.substring(c.raw.length), e.push(c);
1739
1739
  continue;
1740
1740
  }
@@ -1746,7 +1746,7 @@ ${p}` : p;
1746
1746
  t = t.substring(c.raw.length), e.push(c);
1747
1747
  continue;
1748
1748
  }
1749
- if (c = this.tokenizer.del(t, n, l)) {
1749
+ if (c = this.tokenizer.del(t, n, o)) {
1750
1750
  t = t.substring(c.raw.length), e.push(c);
1751
1751
  continue;
1752
1752
  }
@@ -1760,15 +1760,15 @@ ${p}` : p;
1760
1760
  }
1761
1761
  let b = t;
1762
1762
  if (this.options.extensions?.startInline) {
1763
- let p = 1 / 0, d = t.slice(1), g;
1764
- this.options.extensions.startInline.forEach((y) => {
1765
- g = y.call({ lexer: this }, d), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
1766
- }), p < 1 / 0 && p >= 0 && (b = t.substring(0, p + 1));
1763
+ let u = 1 / 0, m = t.slice(1), f;
1764
+ this.options.extensions.startInline.forEach((w) => {
1765
+ f = w.call({ lexer: this }, m), typeof f == "number" && f >= 0 && (u = Math.min(u, f));
1766
+ }), u < 1 / 0 && u >= 0 && (b = t.substring(0, u + 1));
1767
1767
  }
1768
1768
  if (c = this.tokenizer.inlineText(b)) {
1769
- t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (l = c.raw.slice(-1)), o = !0;
1770
- let p = e.at(-1);
1771
- p?.type === "text" ? (p.raw += c.raw, p.text += c.text) : e.push(c);
1769
+ t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
1770
+ let u = e.at(-1);
1771
+ u?.type === "text" ? (u.raw += c.raw, u.text += c.text) : e.push(c);
1772
1772
  continue;
1773
1773
  }
1774
1774
  if (t) {
@@ -1783,7 +1783,7 @@ ${p}` : p;
1783
1783
  if (this.options.silent) console.error(e);
1784
1784
  else throw new Error(e);
1785
1785
  }
1786
- }, h(Ae, "l"), Ae), We, St = (We = class {
1786
+ }, p(Ae, "l"), Ae), Ge, Tt = (Ge = class {
1787
1787
  constructor(t) {
1788
1788
  I(this, "options");
1789
1789
  I(this, "parser");
@@ -1795,8 +1795,8 @@ ${p}` : p;
1795
1795
  code({ text: t, lang: e, escaped: n }) {
1796
1796
  let r = (e || "").match(K.notSpaceStart)?.[0], s = t.replace(K.endingNewline, "") + `
1797
1797
  `;
1798
- return r ? '<pre><code class="language-' + be(r) + '">' + (n ? s : be(s, !0)) + `</code></pre>
1799
- ` : "<pre><code>" + (n ? s : be(s, !0)) + `</code></pre>
1798
+ return r ? '<pre><code class="language-' + me(r) + '">' + (n ? s : me(s, !0)) + `</code></pre>
1799
+ ` : "<pre><code>" + (n ? s : me(s, !0)) + `</code></pre>
1800
1800
  `;
1801
1801
  }
1802
1802
  blockquote({ tokens: t }) {
@@ -1820,12 +1820,12 @@ ${this.parser.parse(t)}</blockquote>
1820
1820
  }
1821
1821
  list(t) {
1822
1822
  let e = t.ordered, n = t.start, r = "";
1823
- for (let l = 0; l < t.items.length; l++) {
1824
- let m = t.items[l];
1825
- r += this.listitem(m);
1823
+ for (let o = 0; o < t.items.length; o++) {
1824
+ let d = t.items[o];
1825
+ r += this.listitem(d);
1826
1826
  }
1827
- let s = e ? "ol" : "ul", o = e && n !== 1 ? ' start="' + n + '"' : "";
1828
- return "<" + s + o + `>
1827
+ let s = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
1828
+ return "<" + s + l + `>
1829
1829
  ` + r + "</" + s + `>
1830
1830
  `;
1831
1831
  }
@@ -1846,9 +1846,9 @@ ${this.parser.parse(t)}</blockquote>
1846
1846
  e += this.tablerow({ text: n });
1847
1847
  let r = "";
1848
1848
  for (let s = 0; s < t.rows.length; s++) {
1849
- let o = t.rows[s];
1849
+ let l = t.rows[s];
1850
1850
  n = "";
1851
- for (let l = 0; l < o.length; l++) n += this.tablecell(o[l]);
1851
+ for (let o = 0; o < l.length; o++) n += this.tablecell(l[o]);
1852
1852
  r += this.tablerow({ text: n });
1853
1853
  }
1854
1854
  return r && (r = `<tbody>${r}</tbody>`), `<table>
@@ -1874,7 +1874,7 @@ ${t}</tr>
1874
1874
  return `<em>${this.parser.parseInline(t)}</em>`;
1875
1875
  }
1876
1876
  codespan({ text: t }) {
1877
- return `<code>${be(t, !0)}</code>`;
1877
+ return `<code>${me(t, !0)}</code>`;
1878
1878
  }
1879
1879
  br(t) {
1880
1880
  return "<br>";
@@ -1886,21 +1886,21 @@ ${t}</tr>
1886
1886
  let r = this.parser.parseInline(n), s = Qn(t);
1887
1887
  if (s === null) return r;
1888
1888
  t = s;
1889
- let o = '<a href="' + t + '"';
1890
- return e && (o += ' title="' + be(e) + '"'), o += ">" + r + "</a>", o;
1889
+ let l = '<a href="' + t + '"';
1890
+ return e && (l += ' title="' + me(e) + '"'), l += ">" + r + "</a>", l;
1891
1891
  }
1892
1892
  image({ href: t, title: e, text: n, tokens: r }) {
1893
1893
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1894
1894
  let s = Qn(t);
1895
- if (s === null) return be(n);
1895
+ if (s === null) return me(n);
1896
1896
  t = s;
1897
- let o = `<img src="${t}" alt="${be(n)}"`;
1898
- return e && (o += ` title="${be(e)}"`), o += ">", o;
1897
+ let l = `<img src="${t}" alt="${me(n)}"`;
1898
+ return e && (l += ` title="${me(e)}"`), l += ">", l;
1899
1899
  }
1900
1900
  text(t) {
1901
- return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : be(t.text);
1901
+ return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : me(t.text);
1902
1902
  }
1903
- }, h(We, "y"), We), qe, hn = (qe = class {
1903
+ }, p(Ge, "y"), Ge), je, un = (je = class {
1904
1904
  strong({ text: t }) {
1905
1905
  return t;
1906
1906
  }
@@ -1931,12 +1931,12 @@ ${t}</tr>
1931
1931
  checkbox({ raw: t }) {
1932
1932
  return t;
1933
1933
  }
1934
- }, h(qe, "L"), qe), Ee, fe = (Ee = class {
1934
+ }, p(je, "L"), je), Ee, pe = (Ee = class {
1935
1935
  constructor(t) {
1936
1936
  I(this, "options");
1937
1937
  I(this, "renderer");
1938
1938
  I(this, "textRenderer");
1939
- this.options = t || Le, this.options.renderer = this.options.renderer || new St(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new hn();
1939
+ this.options = t || Le, this.options.renderer = this.options.renderer || new Tt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new un();
1940
1940
  }
1941
1941
  static parse(t, e) {
1942
1942
  return new Ee(e).parse(t);
@@ -1950,9 +1950,9 @@ ${t}</tr>
1950
1950
  for (let n = 0; n < t.length; n++) {
1951
1951
  let r = t[n];
1952
1952
  if (this.options.extensions?.renderers?.[r.type]) {
1953
- let o = r, l = this.options.extensions.renderers[o.type].call({ parser: this }, o);
1954
- if (l !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(o.type)) {
1955
- e += l || "";
1953
+ let l = r, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1954
+ if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
1955
+ e += o || "";
1956
1956
  continue;
1957
1957
  }
1958
1958
  }
@@ -2007,9 +2007,9 @@ ${t}</tr>
2007
2007
  break;
2008
2008
  }
2009
2009
  default: {
2010
- let o = 'Token with "' + s.type + '" type was not found.';
2011
- if (this.options.silent) return console.error(o), "";
2012
- throw new Error(o);
2010
+ let l = 'Token with "' + s.type + '" type was not found.';
2011
+ if (this.options.silent) return console.error(l), "";
2012
+ throw new Error(l);
2013
2013
  }
2014
2014
  }
2015
2015
  }
@@ -2021,68 +2021,68 @@ ${t}</tr>
2021
2021
  for (let r = 0; r < t.length; r++) {
2022
2022
  let s = t[r];
2023
2023
  if (this.options.extensions?.renderers?.[s.type]) {
2024
- let l = this.options.extensions.renderers[s.type].call({ parser: this }, s);
2025
- if (l !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
2026
- n += l || "";
2024
+ let o = this.options.extensions.renderers[s.type].call({ parser: this }, s);
2025
+ if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
2026
+ n += o || "";
2027
2027
  continue;
2028
2028
  }
2029
2029
  }
2030
- let o = s;
2031
- switch (o.type) {
2030
+ let l = s;
2031
+ switch (l.type) {
2032
2032
  case "escape": {
2033
- n += e.text(o);
2033
+ n += e.text(l);
2034
2034
  break;
2035
2035
  }
2036
2036
  case "html": {
2037
- n += e.html(o);
2037
+ n += e.html(l);
2038
2038
  break;
2039
2039
  }
2040
2040
  case "link": {
2041
- n += e.link(o);
2041
+ n += e.link(l);
2042
2042
  break;
2043
2043
  }
2044
2044
  case "image": {
2045
- n += e.image(o);
2045
+ n += e.image(l);
2046
2046
  break;
2047
2047
  }
2048
2048
  case "checkbox": {
2049
- n += e.checkbox(o);
2049
+ n += e.checkbox(l);
2050
2050
  break;
2051
2051
  }
2052
2052
  case "strong": {
2053
- n += e.strong(o);
2053
+ n += e.strong(l);
2054
2054
  break;
2055
2055
  }
2056
2056
  case "em": {
2057
- n += e.em(o);
2057
+ n += e.em(l);
2058
2058
  break;
2059
2059
  }
2060
2060
  case "codespan": {
2061
- n += e.codespan(o);
2061
+ n += e.codespan(l);
2062
2062
  break;
2063
2063
  }
2064
2064
  case "br": {
2065
- n += e.br(o);
2065
+ n += e.br(l);
2066
2066
  break;
2067
2067
  }
2068
2068
  case "del": {
2069
- n += e.del(o);
2069
+ n += e.del(l);
2070
2070
  break;
2071
2071
  }
2072
2072
  case "text": {
2073
- n += e.text(o);
2073
+ n += e.text(l);
2074
2074
  break;
2075
2075
  }
2076
2076
  default: {
2077
- let l = 'Token with "' + o.type + '" type was not found.';
2078
- if (this.options.silent) return console.error(l), "";
2079
- throw new Error(l);
2077
+ let o = 'Token with "' + l.type + '" type was not found.';
2078
+ if (this.options.silent) return console.error(o), "";
2079
+ throw new Error(o);
2080
2080
  }
2081
2081
  }
2082
2082
  }
2083
2083
  return n;
2084
2084
  }
2085
- }, h(Ee, "l"), Ee), Se, ot = (Se = class {
2085
+ }, p(Ee, "l"), Ee), Se, ot = (Se = class {
2086
2086
  constructor(t) {
2087
2087
  I(this, "options");
2088
2088
  I(this, "block");
@@ -2101,22 +2101,22 @@ ${t}</tr>
2101
2101
  return t;
2102
2102
  }
2103
2103
  provideLexer(t = this.block) {
2104
- return t ? de.lex : de.lexInline;
2104
+ return t ? he.lex : he.lexInline;
2105
2105
  }
2106
2106
  provideParser(t = this.block) {
2107
- return t ? fe.parse : fe.parseInline;
2107
+ return t ? pe.parse : pe.parseInline;
2108
2108
  }
2109
- }, h(Se, "P"), I(Se, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), I(Se, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Se), Ve, ai = (Ve = class {
2109
+ }, p(Se, "P"), I(Se, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), I(Se, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Se), We, oi = (We = class {
2110
2110
  constructor(...t) {
2111
- I(this, "defaults", nn());
2111
+ I(this, "defaults", tn());
2112
2112
  I(this, "options", this.setOptions);
2113
2113
  I(this, "parse", this.parseMarkdown(!0));
2114
2114
  I(this, "parseInline", this.parseMarkdown(!1));
2115
- I(this, "Parser", fe);
2116
- I(this, "Renderer", St);
2117
- I(this, "TextRenderer", hn);
2118
- I(this, "Lexer", de);
2119
- I(this, "Tokenizer", Tt);
2115
+ I(this, "Parser", pe);
2116
+ I(this, "Renderer", Tt);
2117
+ I(this, "TextRenderer", un);
2118
+ I(this, "Lexer", he);
2119
+ I(this, "Tokenizer", yt);
2120
2120
  I(this, "Hooks", ot);
2121
2121
  this.use(...t);
2122
2122
  }
@@ -2125,8 +2125,8 @@ ${t}</tr>
2125
2125
  for (let r of t) switch (n = n.concat(e.call(this, r)), r.type) {
2126
2126
  case "table": {
2127
2127
  let s = r;
2128
- for (let o of s.header) n = n.concat(this.walkTokens(o.tokens, e));
2129
- for (let o of s.rows) for (let l of o) n = n.concat(this.walkTokens(l.tokens, e));
2128
+ for (let l of s.header) n = n.concat(this.walkTokens(l.tokens, e));
2129
+ for (let l of s.rows) for (let o of l) n = n.concat(this.walkTokens(o.tokens, e));
2130
2130
  break;
2131
2131
  }
2132
2132
  case "list": {
@@ -2136,9 +2136,9 @@ ${t}</tr>
2136
2136
  }
2137
2137
  default: {
2138
2138
  let s = r;
2139
- this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((o) => {
2140
- let l = s[o].flat(1 / 0);
2141
- n = n.concat(this.walkTokens(l, e));
2139
+ this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((l) => {
2140
+ let o = s[l].flat(1 / 0);
2141
+ n = n.concat(this.walkTokens(o, e));
2142
2142
  }) : s.tokens && (n = n.concat(this.walkTokens(s.tokens, e)));
2143
2143
  }
2144
2144
  }
@@ -2151,73 +2151,73 @@ ${t}</tr>
2151
2151
  if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
2152
2152
  if (!s.name) throw new Error("extension name required");
2153
2153
  if ("renderer" in s) {
2154
- let o = e.renderers[s.name];
2155
- o ? e.renderers[s.name] = function(...l) {
2156
- let m = s.renderer.apply(this, l);
2157
- return m === !1 && (m = o.apply(this, l)), m;
2154
+ let l = e.renderers[s.name];
2155
+ l ? e.renderers[s.name] = function(...o) {
2156
+ let d = s.renderer.apply(this, o);
2157
+ return d === !1 && (d = l.apply(this, o)), d;
2158
2158
  } : e.renderers[s.name] = s.renderer;
2159
2159
  }
2160
2160
  if ("tokenizer" in s) {
2161
2161
  if (!s.level || s.level !== "block" && s.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
2162
- let o = e[s.level];
2163
- o ? o.unshift(s.tokenizer) : e[s.level] = [s.tokenizer], s.start && (s.level === "block" ? e.startBlock ? e.startBlock.push(s.start) : e.startBlock = [s.start] : s.level === "inline" && (e.startInline ? e.startInline.push(s.start) : e.startInline = [s.start]));
2162
+ let l = e[s.level];
2163
+ l ? l.unshift(s.tokenizer) : e[s.level] = [s.tokenizer], s.start && (s.level === "block" ? e.startBlock ? e.startBlock.push(s.start) : e.startBlock = [s.start] : s.level === "inline" && (e.startInline ? e.startInline.push(s.start) : e.startInline = [s.start]));
2164
2164
  }
2165
2165
  "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
2166
2166
  }), r.extensions = e), n.renderer) {
2167
- let s = this.defaults.renderer || new St(this.defaults);
2168
- for (let o in n.renderer) {
2169
- if (!(o in s)) throw new Error(`renderer '${o}' does not exist`);
2170
- if (["options", "parser"].includes(o)) continue;
2171
- let l = o, m = n.renderer[l], c = s[l];
2172
- s[l] = (...b) => {
2173
- let p = m.apply(s, b);
2174
- return p === !1 && (p = c.apply(s, b)), p || "";
2167
+ let s = this.defaults.renderer || new Tt(this.defaults);
2168
+ for (let l in n.renderer) {
2169
+ if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
2170
+ if (["options", "parser"].includes(l)) continue;
2171
+ let o = l, d = n.renderer[o], c = s[o];
2172
+ s[o] = (...b) => {
2173
+ let u = d.apply(s, b);
2174
+ return u === !1 && (u = c.apply(s, b)), u || "";
2175
2175
  };
2176
2176
  }
2177
2177
  r.renderer = s;
2178
2178
  }
2179
2179
  if (n.tokenizer) {
2180
- let s = this.defaults.tokenizer || new Tt(this.defaults);
2181
- for (let o in n.tokenizer) {
2182
- if (!(o in s)) throw new Error(`tokenizer '${o}' does not exist`);
2183
- if (["options", "rules", "lexer"].includes(o)) continue;
2184
- let l = o, m = n.tokenizer[l], c = s[l];
2185
- s[l] = (...b) => {
2186
- let p = m.apply(s, b);
2187
- return p === !1 && (p = c.apply(s, b)), p;
2180
+ let s = this.defaults.tokenizer || new yt(this.defaults);
2181
+ for (let l in n.tokenizer) {
2182
+ if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
2183
+ if (["options", "rules", "lexer"].includes(l)) continue;
2184
+ let o = l, d = n.tokenizer[o], c = s[o];
2185
+ s[o] = (...b) => {
2186
+ let u = d.apply(s, b);
2187
+ return u === !1 && (u = c.apply(s, b)), u;
2188
2188
  };
2189
2189
  }
2190
2190
  r.tokenizer = s;
2191
2191
  }
2192
2192
  if (n.hooks) {
2193
2193
  let s = this.defaults.hooks || new ot();
2194
- for (let o in n.hooks) {
2195
- if (!(o in s)) throw new Error(`hook '${o}' does not exist`);
2196
- if (["options", "block"].includes(o)) continue;
2197
- let l = o, m = n.hooks[l], c = s[l];
2198
- ot.passThroughHooks.has(o) ? s[l] = (b) => {
2199
- if (this.defaults.async && ot.passThroughHooksRespectAsync.has(o)) return (async () => {
2200
- let d = await m.call(s, b);
2201
- return c.call(s, d);
2194
+ for (let l in n.hooks) {
2195
+ if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
2196
+ if (["options", "block"].includes(l)) continue;
2197
+ let o = l, d = n.hooks[o], c = s[o];
2198
+ ot.passThroughHooks.has(l) ? s[o] = (b) => {
2199
+ if (this.defaults.async && ot.passThroughHooksRespectAsync.has(l)) return (async () => {
2200
+ let m = await d.call(s, b);
2201
+ return c.call(s, m);
2202
2202
  })();
2203
- let p = m.call(s, b);
2204
- return c.call(s, p);
2205
- } : s[l] = (...b) => {
2203
+ let u = d.call(s, b);
2204
+ return c.call(s, u);
2205
+ } : s[o] = (...b) => {
2206
2206
  if (this.defaults.async) return (async () => {
2207
- let d = await m.apply(s, b);
2208
- return d === !1 && (d = await c.apply(s, b)), d;
2207
+ let m = await d.apply(s, b);
2208
+ return m === !1 && (m = await c.apply(s, b)), m;
2209
2209
  })();
2210
- let p = m.apply(s, b);
2211
- return p === !1 && (p = c.apply(s, b)), p;
2210
+ let u = d.apply(s, b);
2211
+ return u === !1 && (u = c.apply(s, b)), u;
2212
2212
  };
2213
2213
  }
2214
2214
  r.hooks = s;
2215
2215
  }
2216
2216
  if (n.walkTokens) {
2217
- let s = this.defaults.walkTokens, o = n.walkTokens;
2218
- r.walkTokens = function(l) {
2219
- let m = [];
2220
- return m.push(o.call(this, l)), s && (m = m.concat(s.call(this, l))), m;
2217
+ let s = this.defaults.walkTokens, l = n.walkTokens;
2218
+ r.walkTokens = function(o) {
2219
+ let d = [];
2220
+ return d.push(l.call(this, o)), s && (d = d.concat(s.call(this, o))), d;
2221
2221
  };
2222
2222
  }
2223
2223
  this.defaults = { ...this.defaults, ...r };
@@ -2227,31 +2227,31 @@ ${t}</tr>
2227
2227
  return this.defaults = { ...this.defaults, ...t }, this;
2228
2228
  }
2229
2229
  lexer(t, e) {
2230
- return de.lex(t, e ?? this.defaults);
2230
+ return he.lex(t, e ?? this.defaults);
2231
2231
  }
2232
2232
  parser(t, e) {
2233
- return fe.parse(t, e ?? this.defaults);
2233
+ return pe.parse(t, e ?? this.defaults);
2234
2234
  }
2235
2235
  parseMarkdown(t) {
2236
2236
  return (e, n) => {
2237
- let r = { ...n }, s = { ...this.defaults, ...r }, o = this.onError(!!s.silent, !!s.async);
2238
- if (this.defaults.async === !0 && r.async === !1) return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2239
- if (typeof e > "u" || e === null) return o(new Error("marked(): input parameter is undefined or null"));
2240
- if (typeof e != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2237
+ let r = { ...n }, s = { ...this.defaults, ...r }, l = this.onError(!!s.silent, !!s.async);
2238
+ if (this.defaults.async === !0 && r.async === !1) return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2239
+ if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
2240
+ if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2241
2241
  if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
2242
- let l = s.hooks ? await s.hooks.preprocess(e) : e, m = await (s.hooks ? await s.hooks.provideLexer(t) : t ? de.lex : de.lexInline)(l, s), c = s.hooks ? await s.hooks.processAllTokens(m) : m;
2242
+ let o = s.hooks ? await s.hooks.preprocess(e) : e, d = await (s.hooks ? await s.hooks.provideLexer(t) : t ? he.lex : he.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(d) : d;
2243
2243
  s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
2244
- let b = await (s.hooks ? await s.hooks.provideParser(t) : t ? fe.parse : fe.parseInline)(c, s);
2244
+ let b = await (s.hooks ? await s.hooks.provideParser(t) : t ? pe.parse : pe.parseInline)(c, s);
2245
2245
  return s.hooks ? await s.hooks.postprocess(b) : b;
2246
- })().catch(o);
2246
+ })().catch(l);
2247
2247
  try {
2248
2248
  s.hooks && (e = s.hooks.preprocess(e));
2249
- let l = (s.hooks ? s.hooks.provideLexer(t) : t ? de.lex : de.lexInline)(e, s);
2250
- s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
2251
- let m = (s.hooks ? s.hooks.provideParser(t) : t ? fe.parse : fe.parseInline)(l, s);
2252
- return s.hooks && (m = s.hooks.postprocess(m)), m;
2253
- } catch (l) {
2254
- return o(l);
2249
+ let o = (s.hooks ? s.hooks.provideLexer(t) : t ? he.lex : he.lexInline)(e, s);
2250
+ s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
2251
+ let d = (s.hooks ? s.hooks.provideParser(t) : t ? pe.parse : pe.parseInline)(o, s);
2252
+ return s.hooks && (d = s.hooks.postprocess(d)), d;
2253
+ } catch (o) {
2254
+ return l(o);
2255
2255
  }
2256
2256
  };
2257
2257
  }
@@ -2259,37 +2259,37 @@ ${t}</tr>
2259
2259
  return (n) => {
2260
2260
  if (n.message += `
2261
2261
  Please report this to https://github.com/markedjs/marked.`, t) {
2262
- let r = "<p>An error occurred:</p><pre>" + be(n.message + "", !0) + "</pre>";
2262
+ let r = "<p>An error occurred:</p><pre>" + me(n.message + "", !0) + "</pre>";
2263
2263
  return e ? Promise.resolve(r) : r;
2264
2264
  }
2265
2265
  if (e) return Promise.reject(n);
2266
2266
  throw n;
2267
2267
  };
2268
2268
  }
2269
- }, h(Ve, "D"), Ve), De = new ai();
2269
+ }, p(We, "D"), We), Me = new oi();
2270
2270
  function L(a, t) {
2271
- return De.parse(a, t);
2271
+ return Me.parse(a, t);
2272
2272
  }
2273
- h(L, "g");
2273
+ p(L, "g");
2274
2274
  L.options = L.setOptions = function(a) {
2275
- return De.setOptions(a), L.defaults = De.defaults, hs(L.defaults), L;
2275
+ return Me.setOptions(a), L.defaults = Me.defaults, ps(L.defaults), L;
2276
2276
  };
2277
- L.getDefaults = nn;
2277
+ L.getDefaults = tn;
2278
2278
  L.defaults = Le;
2279
2279
  L.use = function(...a) {
2280
- return De.use(...a), L.defaults = De.defaults, hs(L.defaults), L;
2280
+ return Me.use(...a), L.defaults = Me.defaults, ps(L.defaults), L;
2281
2281
  };
2282
2282
  L.walkTokens = function(a, t) {
2283
- return De.walkTokens(a, t);
2283
+ return Me.walkTokens(a, t);
2284
2284
  };
2285
- L.parseInline = De.parseInline;
2286
- L.Parser = fe;
2287
- L.parser = fe.parse;
2288
- L.Renderer = St;
2289
- L.TextRenderer = hn;
2290
- L.Lexer = de;
2291
- L.lexer = de.lex;
2292
- L.Tokenizer = Tt;
2285
+ L.parseInline = Me.parseInline;
2286
+ L.Parser = pe;
2287
+ L.parser = pe.parse;
2288
+ L.Renderer = Tt;
2289
+ L.TextRenderer = un;
2290
+ L.Lexer = he;
2291
+ L.lexer = he.lex;
2292
+ L.Tokenizer = yt;
2293
2293
  L.Hooks = ot;
2294
2294
  L.parse = L;
2295
2295
  L.options;
@@ -2297,43 +2297,129 @@ L.setOptions;
2297
2297
  L.use;
2298
2298
  L.walkTokens;
2299
2299
  L.parseInline;
2300
- fe.parse;
2301
- de.lex;
2302
- const li = { class: "@container/chat flex flex-col h-full relative" }, oi = {
2300
+ pe.parse;
2301
+ he.lex;
2302
+ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2303
+ __name: "ChatRichText",
2304
+ props: {
2305
+ text: {},
2306
+ inverted: { type: Boolean },
2307
+ streaming: { type: Boolean }
2308
+ },
2309
+ setup(a) {
2310
+ const t = a, e = rs(t.text);
2311
+ let n;
2312
+ qe(
2313
+ [() => t.text, () => t.streaming],
2314
+ ([l, o]) => {
2315
+ if (!o) {
2316
+ n !== void 0 && (cancelAnimationFrame(n), n = void 0), e.value = l;
2317
+ return;
2318
+ }
2319
+ n === void 0 && (n = requestAnimationFrame(() => {
2320
+ n = void 0, e.value = t.text;
2321
+ }));
2322
+ }
2323
+ ), is(() => {
2324
+ n !== void 0 && cancelAnimationFrame(n);
2325
+ });
2326
+ const r = new L.Renderer();
2327
+ r.link = ({ href: l, text: o }) => {
2328
+ let d = !1;
2329
+ if (typeof window < "u")
2330
+ try {
2331
+ d = new URL(l, window.location.href).origin === window.location.origin;
2332
+ } catch {
2333
+ d = !1;
2334
+ }
2335
+ return d ? `<a href="${l}">${o}</a>` : `<a href="${l}" target="_blank" rel="noopener noreferrer">${o}</a>`;
2336
+ }, L.setOptions({ breaks: !0, gfm: !0, renderer: r });
2337
+ const s = $(() => {
2338
+ const l = e.value;
2339
+ if (!l) return "";
2340
+ const o = L.parse(l, { async: !1 });
2341
+ return vr.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2342
+ });
2343
+ return (l, o) => (y(), T("div", {
2344
+ class: E(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", a.inverted ? "chat-msg-prose-invert" : ""]),
2345
+ innerHTML: s.value
2346
+ }, null, 10, ci));
2347
+ }
2348
+ }), hi = 80, pi = /* @__PURE__ */ ke({
2349
+ __name: "ChatScroller",
2350
+ setup(a, { expose: t }) {
2351
+ const e = Z(), n = Z();
2352
+ let r = !0, s;
2353
+ function l() {
2354
+ const c = e.value;
2355
+ c && (c.scrollTop = c.scrollHeight);
2356
+ }
2357
+ p(l, "scrollToBottom");
2358
+ function o() {
2359
+ const c = e.value;
2360
+ c && (r = c.scrollHeight - c.scrollTop - c.clientHeight <= hi);
2361
+ }
2362
+ p(o, "onScroll");
2363
+ function d() {
2364
+ r = !0, l();
2365
+ }
2366
+ return p(d, "pin"), t({ pin: d }), St(() => {
2367
+ requestAnimationFrame(() => {
2368
+ l(), requestAnimationFrame(l);
2369
+ }), n.value && (s = new ResizeObserver(() => {
2370
+ r && l();
2371
+ }), s.observe(n.value));
2372
+ }), is(() => {
2373
+ s?.disconnect();
2374
+ }), (c, b) => (y(), T("div", {
2375
+ ref_key: "viewport",
2376
+ ref: e,
2377
+ class: "overflow-y-auto overflow-x-hidden min-h-0 [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
2378
+ onScrollPassive: o
2379
+ }, [
2380
+ v("div", {
2381
+ ref_key: "content",
2382
+ ref: n
2383
+ }, [
2384
+ en(c.$slots, "default")
2385
+ ], 512)
2386
+ ], 544));
2387
+ }
2388
+ }), di = { class: "@container/chat flex flex-col h-full relative" }, fi = {
2303
2389
  key: 0,
2304
2390
  class: "pb-4"
2305
- }, ci = {
2391
+ }, gi = { class: "pt-4 pb-[120px] px-3 space-y-1" }, mi = {
2306
2392
  key: 0,
2307
2393
  class: "flex flex-col items-center justify-center px-4 min-h-full"
2308
- }, ui = { class: "relative mb-4 size-20 @sm/chat:size-24" }, hi = ["src", "alt"], pi = {
2394
+ }, bi = { class: "relative mb-4 size-20 @sm/chat:size-24" }, xi = ["src", "alt"], ki = {
2309
2395
  key: 0,
2310
2396
  class: "mt-5 flex flex-col items-stretch gap-2 w-full max-w-xs"
2311
- }, di = ["onClick"], fi = ["title"], gi = {
2397
+ }, wi = ["onClick"], vi = ["title"], yi = {
2312
2398
  key: 1,
2313
2399
  class: "flex justify-end px-2 pb-2"
2314
- }, mi = {
2400
+ }, Ti = {
2315
2401
  key: 0,
2316
2402
  class: "flex items-center gap-3 py-3 px-2"
2317
- }, bi = ["data-issue-code", "data-issue-bucket"], xi = { class: "flex flex-col gap-1 min-w-0" }, ki = ["href"], wi = ["data-test"], yi = {
2403
+ }, Si = ["data-issue-code", "data-issue-bucket"], Ai = { class: "flex flex-col gap-1 min-w-0" }, Ei = ["href"], _i = ["data-test"], Ri = {
2318
2404
  key: 0,
2319
2405
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
2320
- }, vi = ["src", "alt"], Ti = ["src", "alt"], Si = ["src"], Ai = ["href"], Ei = ["innerHTML"], _i = {
2406
+ }, Ci = ["src", "alt"], Ii = ["src", "alt"], Di = ["src"], Mi = ["href"], Li = {
2321
2407
  key: 2,
2322
2408
  "data-test": "messaging-thinking-indicator",
2323
2409
  class: "flex gap-2 justify-start items-center mb-4"
2324
- }, Ri = ["src", "alt"], Ci = {
2410
+ }, Oi = ["src", "alt"], zi = {
2325
2411
  key: 0,
2326
2412
  class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
2327
- }, Ii = ["src", "alt"], Di = { class: "max-w-20 truncate" }, Mi = ["onClick"], Li = {
2413
+ }, Pi = ["src", "alt"], Ni = { class: "max-w-20 truncate" }, $i = ["onClick"], Ui = {
2328
2414
  key: 0,
2329
2415
  class: "shrink-0 flex items-center justify-center size-14"
2330
- }, Oi = ["disabled"], zi = {
2416
+ }, Bi = ["disabled"], Fi = {
2331
2417
  key: 0,
2332
2418
  class: "i-svg-spinners-ring-resize size-4"
2333
- }, Pi = {
2419
+ }, Hi = {
2334
2420
  key: 1,
2335
2421
  class: "i-tabler-paperclip size-5"
2336
- }, Ni = ["placeholder", "disabled"], $i = ["disabled"], Xi = /* @__PURE__ */ Me({
2422
+ }, Gi = ["placeholder", "disabled"], ji = ["disabled"], na = /* @__PURE__ */ ke({
2337
2423
  __name: "ElAgentChat",
2338
2424
  props: {
2339
2425
  chatController: {},
@@ -2347,430 +2433,414 @@ const li = { class: "@container/chat flex flex-col h-full relative" }, oi = {
2347
2433
  starterPrompts: {}
2348
2434
  },
2349
2435
  setup(a) {
2350
- const t = new L.Renderer();
2351
- t.link = ({ href: _, text: f }) => {
2352
- let x = !1;
2353
- if (typeof window < "u")
2354
- try {
2355
- x = new URL(_, window.location.href).origin === window.location.origin;
2356
- } catch {
2357
- x = !1;
2358
- }
2359
- return x ? `<a href="${_}">${f}</a>` : `<a href="${_}" target="_blank" rel="noopener noreferrer">${f}</a>`;
2360
- }, L.setOptions({ breaks: !0, gfm: !0, renderer: t });
2361
- function e(_) {
2362
- if (!_)
2363
- return "";
2364
- const f = L.parse(_, { async: !1 });
2365
- return kr.sanitize(f, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2366
- }
2367
- h(e, "renderMarkdown");
2368
- const n = {
2436
+ const t = {
2369
2437
  private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
2370
2438
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
2371
2439
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
2372
- }, r = [
2440
+ }, e = [
2373
2441
  "Brief me on tomorrow",
2374
2442
  "Triage my inbox",
2375
2443
  "What's on my plate this week"
2376
- ], s = W(
2377
- () => a.starterPrompts ?? r
2378
- ), o = W(() => {
2379
- const _ = { ...n[a.scope] };
2380
- return a.scope === "org" && a.scopeName && (_.label = a.scopeName, _.tooltip = `Visible to ${a.scopeName} members`), _;
2381
- }), l = ee(""), m = ee(!1), c = ee(), b = ee(), p = ee(), d = ee([]), g = ee(!1);
2382
- function y(_, f) {
2383
- const x = _[f], M = _[f + 1];
2384
- return !M || M.sender !== x.sender;
2385
- }
2386
- h(y, "shouldShowAvatar");
2387
- const E = W(() => a.chatController?.textState.value), O = W(() => E.value?.isConnected ?? !1), ce = W(() => E.value?.isThinking ?? !1), ue = W(() => E.value?.connectionStatus === "disconnected" && !!E.value?.error), ne = W(() => E.value?.connectionStatus !== "connected" && !E.value?.error), N = W(() => E.value?.error), Y = W(() => a.chatController?.sharedMessages.value ?? []), ae = W(() => E.value?.accountGated ?? !1), Q = W(() => !O.value || ae.value), _t = W(() => ue.value ? "Agent is offline" : ne.value ? "Connecting..." : ae.value ? "Resolve the billing issue above to continue" : "Message"), ut = W(() => (l.value.trim() || d.value.length > 0) && !Q.value && !g.value), C = W(() => a.variant === "light"), q = W(
2444
+ ], n = $(
2445
+ () => a.starterPrompts ?? e
2446
+ ), r = $(() => {
2447
+ const A = { ...t[a.scope] };
2448
+ return a.scope === "org" && a.scopeName && (A.label = a.scopeName, A.tooltip = `Visible to ${a.scopeName} members`), A;
2449
+ }), s = Z(""), l = Z(!1), o = Z(), d = Z(), c = Z(), b = Z([]), u = Z(!1);
2450
+ function m(A, k) {
2451
+ const g = A[k], M = A[k + 1];
2452
+ return !M || M.sender !== g.sender;
2453
+ }
2454
+ p(m, "shouldShowAvatar");
2455
+ const f = $(() => a.chatController?.textState.value), w = $(() => f.value?.isConnected ?? !1), _ = $(() => f.value?.isThinking ?? !1), O = $(() => f.value?.connectionStatus === "disconnected" && !!f.value?.error), ie = $(() => f.value?.connectionStatus !== "connected" && !f.value?.error), be = $(() => f.value?.error), G = $(() => a.chatController?.sharedMessages.value ?? []), P = $(() => {
2456
+ if (!_.value) return;
2457
+ const A = G.value, k = A[A.length - 1];
2458
+ return k?.sender === "agent" ? k.id : void 0;
2459
+ }), de = $(() => _.value ? P.value === void 0 : !1), ae = $(() => f.value?.accountGated ?? !1), Q = $(() => !w.value || ae.value), _t = $(() => O.value ? "Agent is offline" : ie.value ? "Connecting..." : ae.value ? "Resolve the billing issue above to continue" : "Message"), ut = $(() => (s.value.trim() || b.value.length > 0) && !Q.value && !u.value), C = $(() => a.variant === "light"), q = $(
2388
2460
  () => C.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2389
- ), we = W(() => C.value ? "text-theme-300" : "text-white/30");
2390
- tn(async () => {
2391
- a.chatController && !O.value && await a.chatController.startTextConversation();
2461
+ ), we = $(() => C.value ? "text-theme-300" : "text-white/30");
2462
+ St(async () => {
2463
+ a.chatController && !w.value && await a.chatController.startTextConversation();
2392
2464
  });
2393
2465
  function Oe() {
2394
2466
  a.chatController?.newConversation();
2395
2467
  }
2396
- h(Oe, "startNewConversation");
2397
- async function ye() {
2398
- const _ = l.value.trim(), f = d.value.length > 0;
2399
- if (!_ && !f || !a.chatController || !O.value || g.value)
2468
+ p(Oe, "startNewConversation");
2469
+ async function ve() {
2470
+ const A = s.value.trim(), k = b.value.length > 0;
2471
+ if (!A && !k || !a.chatController || !w.value || u.value)
2400
2472
  return;
2401
- const x = l.value, M = f ? [...d.value] : void 0;
2402
- l.value = "", d.value = [], b.value && (b.value.style.height = "auto", b.value.focus()), await a.chatController.sendChatMessage(x, M), ht();
2403
- }
2404
- h(ye, "sendMessage");
2405
- async function Rt(_) {
2406
- Q.value || (l.value = _, await ye());
2473
+ const g = s.value, M = k ? [...b.value] : void 0;
2474
+ s.value = "", b.value = [], d.value && (d.value.style.height = "auto", d.value.focus()), o.value?.pin(), await a.chatController.sendChatMessage(g, M);
2407
2475
  }
2408
- h(Rt, "sendStarterPrompt");
2409
- async function Ct(_) {
2410
- _.key === "Enter" && !_.shiftKey && (_.preventDefault(), await ye());
2411
- }
2412
- h(Ct, "handleKeydown");
2413
- function ht() {
2414
- c.value && jt(() => {
2415
- c.value.scrollTop = c.value.scrollHeight;
2416
- });
2476
+ p(ve, "sendMessage");
2477
+ async function Rt(A) {
2478
+ Q.value || (s.value = A, await ve());
2417
2479
  }
2418
- h(ht, "scrollToBottom");
2419
- function pt() {
2420
- b.value && (b.value.style.height = "auto", b.value.style.height = `${Math.min(b.value.scrollHeight, 150)}px`);
2480
+ p(Rt, "sendStarterPrompt");
2481
+ async function Ct(A) {
2482
+ A.key === "Enter" && !A.shiftKey && (A.preventDefault(), await ve());
2421
2483
  }
2422
- h(pt, "adjustTextareaHeight"), Ye(l, () => jt(() => pt()));
2484
+ p(Ct, "handleKeydown");
2423
2485
  function It() {
2424
- p.value?.click();
2486
+ d.value && (d.value.style.height = "auto", d.value.style.height = `${Math.min(d.value.scrollHeight, 150)}px`);
2487
+ }
2488
+ p(It, "adjustTextareaHeight"), qe(s, () => Is(() => It()));
2489
+ function ht() {
2490
+ c.value?.click();
2425
2491
  }
2426
- h(It, "triggerFileInput");
2427
- async function dt(_) {
2428
- const f = _.target, x = f.files?.[0];
2429
- if (!(!x || !a.uploadFn)) {
2430
- g.value = !0;
2492
+ p(ht, "triggerFileInput");
2493
+ async function Dt(A) {
2494
+ const k = A.target, g = k.files?.[0];
2495
+ if (!(!g || !a.uploadFn)) {
2496
+ u.value = !0;
2431
2497
  try {
2432
- const M = await a.uploadFn(x);
2433
- d.value = [...d.value, M];
2498
+ const M = await a.uploadFn(g);
2499
+ b.value = [...b.value, M];
2434
2500
  } catch (M) {
2435
- const P = M instanceof Error ? M.message : "Couldn't attach that file.";
2436
- a.chatController?.notify(`Upload failed — ${P}`);
2501
+ const j = M instanceof Error ? M.message : "Couldn't attach that file.";
2502
+ a.chatController?.notify(`Upload failed — ${j}`);
2437
2503
  } finally {
2438
- g.value = !1, f.value = "";
2504
+ u.value = !1, k.value = "";
2439
2505
  }
2440
2506
  }
2441
2507
  }
2442
- h(dt, "handleFileSelect");
2443
- function B(_) {
2444
- d.value = d.value.filter((f, x) => x !== _);
2508
+ p(Dt, "handleFileSelect");
2509
+ function pt(A) {
2510
+ b.value = b.value.filter((k, g) => g !== A);
2445
2511
  }
2446
- h(B, "removeAttachment");
2447
- function Xe(_, f) {
2448
- if (f === 0) {
2449
- const Pe = _[f];
2450
- return Pe?.timestamp ? F(new Date(Pe.timestamp)) : null;
2512
+ p(pt, "removeAttachment");
2513
+ function U(A, k) {
2514
+ if (k === 0) {
2515
+ const _e = A[k];
2516
+ return _e?.timestamp ? Ye(new Date(_e.timestamp)) : null;
2451
2517
  }
2452
- const x = _[f - 1], M = _[f];
2453
- if (!x?.timestamp || !M?.timestamp) return null;
2454
- const P = new Date(x.timestamp).getTime();
2455
- return new Date(M.timestamp).getTime() - P > 36e5 ? F(new Date(M.timestamp)) : null;
2518
+ const g = A[k - 1], M = A[k];
2519
+ if (!g?.timestamp || !M?.timestamp) return null;
2520
+ const j = new Date(g.timestamp).getTime();
2521
+ return new Date(M.timestamp).getTime() - j > 36e5 ? Ye(new Date(M.timestamp)) : null;
2456
2522
  }
2457
- h(Xe, "shouldShowTimeDivider");
2458
- function F(_) {
2459
- const f = /* @__PURE__ */ new Date(), x = _.toDateString() === f.toDateString(), M = new Date(f);
2523
+ p(U, "shouldShowTimeDivider");
2524
+ function Ye(A) {
2525
+ const k = /* @__PURE__ */ new Date(), g = A.toDateString() === k.toDateString(), M = new Date(k);
2460
2526
  M.setDate(M.getDate() - 1);
2461
- const P = _.toDateString() === M.toDateString(), xe = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2462
- if (x) return xe;
2463
- if (P) return `Yesterday, ${xe}`;
2464
- const ze = _.getFullYear() === f.getFullYear();
2465
- return `${_.toLocaleDateString("en-US", {
2527
+ const j = A.toDateString() === M.toDateString(), J = A.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2528
+ if (g) return J;
2529
+ if (j) return `Yesterday, ${J}`;
2530
+ const Ze = A.getFullYear() === k.getFullYear();
2531
+ return `${A.toLocaleDateString("en-US", {
2466
2532
  weekday: "long",
2467
2533
  month: "short",
2468
2534
  day: "numeric",
2469
- ...ze ? {} : { year: "numeric" }
2470
- })}, ${xe}`;
2471
- }
2472
- return h(F, "formatTimeDivider"), Ye(Y, (_) => {
2473
- _.length > 0 && jt(() => ht());
2474
- }, { immediate: !0, deep: !0 }), (_, f) => (T(), S("div", li, [
2475
- C.value ? U("", !0) : (T(), S("div", oi, [
2476
- Wt(Ys, {
2535
+ ...Ze ? {} : { year: "numeric" }
2536
+ })}, ${J}`;
2537
+ }
2538
+ return p(Ye, "formatTimeDivider"), (A, k) => (y(), T("div", di, [
2539
+ C.value ? B("", !0) : (y(), T("div", fi, [
2540
+ Je(Xs, {
2477
2541
  agent: a.agent,
2478
- "is-online": O.value
2542
+ "is-online": w.value
2479
2543
  }, null, 8, ["agent", "is-online"])
2480
2544
  ])),
2481
- ue.value ? (T(), S("div", {
2545
+ O.value ? (y(), T("div", {
2482
2546
  key: 1,
2483
- class: A(["py-16 flex flex-col items-center justify-center gap-3 text-sm", C.value ? "text-theme-400" : "text-white/60"])
2547
+ class: E(["py-16 flex flex-col items-center justify-center gap-3 text-sm", C.value ? "text-theme-400" : "text-white/60"])
2484
2548
  }, [
2485
- w("i", {
2486
- class: A(["i-heroicons-cloud-arrow-down size-8", C.value ? "text-theme-300" : "text-white/40"])
2549
+ v("i", {
2550
+ class: E(["i-heroicons-cloud-arrow-down size-8", C.value ? "text-theme-300" : "text-white/40"])
2487
2551
  }, null, 2),
2488
- w("span", null, ie(N.value), 1)
2489
- ], 2)) : ne.value ? (T(), S("div", {
2552
+ v("span", null, re(be.value), 1)
2553
+ ], 2)) : ie.value ? (y(), T("div", {
2490
2554
  key: 2,
2491
- class: A(["py-16 flex flex-col items-center justify-center gap-2 text-sm", C.value ? "text-theme-400" : "text-theme-600"])
2555
+ class: E(["py-16 flex flex-col items-center justify-center gap-2 text-sm", C.value ? "text-theme-400" : "text-theme-600"])
2492
2556
  }, [
2493
- Wt(Ln, { class: "size-4" })
2494
- ], 2)) : a.setupHint ? (T(), S("div", {
2557
+ Je(Ln, { class: "size-4" })
2558
+ ], 2)) : a.setupHint ? (y(), T("div", {
2495
2559
  key: 3,
2496
- class: A(["flex items-center justify-center gap-1.5 py-2 text-[11px]", we.value])
2560
+ class: E(["flex items-center justify-center gap-1.5 py-2 text-[11px]", we.value])
2497
2561
  }, [
2498
- f[6] || (f[6] = w("i", { class: "i-tabler-tool size-3" }, null, -1)),
2499
- w("span", null, ie(a.setupHint), 1)
2500
- ], 2)) : U("", !0),
2501
- w("div", {
2502
- ref_key: "messagesContainer",
2503
- ref: c,
2504
- 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"
2505
- }, [
2506
- Y.value.length === 0 && !ne.value && !ue.value ? (T(), S("div", ci, [
2507
- w("div", ui, [
2508
- w("img", {
2509
- src: a.agent.avatarUrl.value,
2510
- alt: a.agent.displayName.value,
2511
- class: A(["size-full rounded-full object-cover ring-1", C.value ? "ring-black/5" : "ring-white/10"])
2512
- }, null, 10, hi),
2513
- O.value ? (T(), S("span", {
2514
- key: 0,
2515
- class: A(["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", C.value ? "bg-white" : "bg-theme-900"])
2516
- }, [...f[7] || (f[7] = [
2517
- w("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2518
- ])], 2)) : U("", !0)
2519
- ]),
2520
- w("div", {
2521
- class: A(["text-base @sm/chat:text-lg font-semibold", C.value ? "text-theme-900" : "text-white"])
2522
- }, ie(a.agent.displayName.value), 3),
2523
- w("p", {
2524
- class: A(["mt-1 text-center text-xs @sm/chat:text-sm", we.value])
2525
- }, ie(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
2526
- s.value.length > 0 && !Q.value ? (T(), S("div", pi, [
2527
- (T(!0), S(Te, null, at(s.value, (x) => (T(), S("button", {
2528
- key: x,
2529
- type: "button",
2530
- "data-test": "chat-starter-prompt",
2531
- class: A(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", C.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
2532
- onClick: /* @__PURE__ */ h((M) => Rt(x), "onClick")
2533
- }, ie(x), 11, di))), 128))
2534
- ])) : U("", !0),
2535
- w("div", {
2536
- class: A(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", C.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2537
- title: o.value.tooltip
2538
- }, [
2539
- w("i", {
2540
- class: A([o.value.icon, "size-3"])
2541
- }, null, 2),
2542
- w("span", null, ie(o.value.label), 1)
2543
- ], 10, fi)
2544
- ])) : U("", !0),
2545
- Y.value.length > 0 ? (T(), S("div", gi, [
2546
- w("button", {
2547
- type: "button",
2548
- "data-test": "chat-new-session",
2549
- class: A(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", C.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
2550
- onClick: Oe
2551
- }, [...f[8] || (f[8] = [
2552
- w("i", { class: "i-tabler-refresh size-3" }, null, -1),
2553
- w("span", null, "New chat", -1)
2554
- ])], 2)
2555
- ])) : U("", !0),
2556
- (T(!0), S(Te, null, at(Y.value, (x, M) => (T(), S(Te, {
2557
- key: x.id
2558
- }, [
2559
- Xe(Y.value, M) ? (T(), S("div", mi, [
2560
- w("div", {
2561
- class: A(["flex-1 h-px", q.value])
2562
- }, null, 2),
2563
- w("span", {
2564
- class: A(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", we.value])
2565
- }, ie(Xe(Y.value, M)), 3),
2566
- w("div", {
2567
- class: A(["flex-1 h-px", q.value])
2568
- }, null, 2)
2569
- ])) : U("", !0),
2570
- x.sender === "system" ? (T(), S("div", {
2571
- key: 1,
2572
- "data-test": "messaging-system-msg",
2573
- "data-issue-code": x.issue?.code,
2574
- "data-issue-bucket": x.issue?.bucket,
2575
- class: A(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", C.value ? "text-theme-500" : "text-white/70"])
2576
- }, [
2577
- w("i", {
2578
- class: A(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", x.issue?.bucket === "account" ? C.value ? "text-amber-500" : "text-amber-300" : C.value ? "text-red-500" : "text-red-300"])
2579
- }, null, 2),
2580
- w("div", xi, [
2581
- w("span", null, ie(x.text), 1),
2582
- x.issue?.help ? (T(), S("span", {
2583
- key: 0,
2584
- class: A(["text-[12px]", C.value ? "text-theme-400" : "text-white/55"])
2585
- }, ie(x.issue.help), 3)) : U("", !0),
2586
- x.issue?.actionUrl ? (T(), S("a", {
2587
- key: 1,
2588
- href: x.issue.actionUrl,
2589
- "data-test": "messaging-system-msg-action",
2590
- class: A(["text-[12px] font-medium inline-flex items-center gap-1", C.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
2562
+ k[6] || (k[6] = v("i", { class: "i-tabler-tool size-3" }, null, -1)),
2563
+ v("span", null, re(a.setupHint), 1)
2564
+ ], 2)) : B("", !0),
2565
+ Je(pi, {
2566
+ ref_key: "chatScroller",
2567
+ ref: o,
2568
+ class: "flex-1"
2569
+ }, {
2570
+ default: Ds(() => [
2571
+ v("div", gi, [
2572
+ G.value.length === 0 && !ie.value && !O.value ? (y(), T("div", mi, [
2573
+ v("div", bi, [
2574
+ v("img", {
2575
+ src: a.agent.avatarUrl.value,
2576
+ alt: a.agent.displayName.value,
2577
+ class: E(["size-full rounded-full object-cover ring-1", C.value ? "ring-black/5" : "ring-white/10"])
2578
+ }, null, 10, xi),
2579
+ w.value ? (y(), T("span", {
2580
+ key: 0,
2581
+ class: E(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", C.value ? "bg-white" : "bg-theme-900"])
2582
+ }, [...k[7] || (k[7] = [
2583
+ v("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2584
+ ])], 2)) : B("", !0)
2585
+ ]),
2586
+ v("div", {
2587
+ class: E(["text-base @sm/chat:text-lg font-semibold", C.value ? "text-theme-900" : "text-white"])
2588
+ }, re(a.agent.displayName.value), 3),
2589
+ v("p", {
2590
+ class: E(["mt-1 text-center text-xs @sm/chat:text-sm", we.value])
2591
+ }, re(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
2592
+ n.value.length > 0 && !Q.value ? (y(), T("div", ki, [
2593
+ (y(!0), T(Te, null, at(n.value, (g) => (y(), T("button", {
2594
+ key: g,
2595
+ type: "button",
2596
+ "data-test": "chat-starter-prompt",
2597
+ class: E(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", C.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
2598
+ onClick: /* @__PURE__ */ p((M) => Rt(g), "onClick")
2599
+ }, re(g), 11, wi))), 128))
2600
+ ])) : B("", !0),
2601
+ v("div", {
2602
+ class: E(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", C.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2603
+ title: r.value.tooltip
2591
2604
  }, [
2592
- et(ie(x.issue.actionLabel) + " ", 1),
2593
- f[9] || (f[9] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2594
- ], 10, ki)) : U("", !0)
2595
- ])
2596
- ], 10, bi)) : (T(), S("div", {
2597
- key: 2,
2598
- "data-test": x.sender === "agent" ? "messaging-assistant-msg" : x.sender === "user" ? "messaging-user-msg" : void 0,
2599
- class: A(["flex gap-2 items-end", {
2600
- "justify-end": x.sender === "user",
2601
- "justify-start": x.sender === "agent",
2602
- "mb-4": y(Y.value, M)
2603
- }])
2604
- }, [
2605
- x.sender === "agent" ? (T(), S("div", yi, [
2606
- y(Y.value, M) ? (T(), S("img", {
2607
- key: 0,
2608
- src: a.agent.avatarUrl.value,
2609
- alt: a.agent.displayName.value,
2610
- class: A(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
2611
- }, null, 10, vi)) : U("", !0)
2612
- ])) : U("", !0),
2613
- w("div", {
2614
- class: A(x.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2605
+ v("i", {
2606
+ class: E([r.value.icon, "size-3"])
2607
+ }, null, 2),
2608
+ v("span", null, re(r.value.label), 1)
2609
+ ], 10, vi)
2610
+ ])) : B("", !0),
2611
+ G.value.length > 0 ? (y(), T("div", yi, [
2612
+ v("button", {
2613
+ type: "button",
2614
+ "data-test": "chat-new-session",
2615
+ class: E(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", C.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
2616
+ onClick: Oe
2617
+ }, [...k[8] || (k[8] = [
2618
+ v("i", { class: "i-tabler-refresh size-3" }, null, -1),
2619
+ v("span", null, "New chat", -1)
2620
+ ])], 2)
2621
+ ])) : B("", !0),
2622
+ (y(!0), T(Te, null, at(G.value, (g, M) => (y(), T(Te, {
2623
+ key: g.id
2615
2624
  }, [
2616
- x.attachments?.length ? (T(), S("div", {
2617
- key: 0,
2618
- class: A(["mb-1 space-y-1", x.sender === "user" ? "flex flex-col items-end" : ""])
2625
+ U(G.value, M) ? (y(), T("div", Ti, [
2626
+ v("div", {
2627
+ class: E(["flex-1 h-px", q.value])
2628
+ }, null, 2),
2629
+ v("span", {
2630
+ class: E(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", we.value])
2631
+ }, re(U(G.value, M)), 3),
2632
+ v("div", {
2633
+ class: E(["flex-1 h-px", q.value])
2634
+ }, null, 2)
2635
+ ])) : B("", !0),
2636
+ g.sender === "system" ? (y(), T("div", {
2637
+ key: 1,
2638
+ "data-test": "messaging-system-msg",
2639
+ "data-issue-code": g.issue?.code,
2640
+ "data-issue-bucket": g.issue?.bucket,
2641
+ class: E(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", C.value ? "text-theme-500" : "text-white/70"])
2619
2642
  }, [
2620
- (T(!0), S(Te, null, at(x.attachments, (P, xe) => (T(), S(Te, { key: xe }, [
2621
- P.type === "image" ? (T(), S("img", {
2643
+ v("i", {
2644
+ class: E(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", g.issue?.bucket === "account" ? C.value ? "text-amber-500" : "text-amber-300" : C.value ? "text-red-500" : "text-red-300"])
2645
+ }, null, 2),
2646
+ v("div", Ai, [
2647
+ v("span", null, re(g.text), 1),
2648
+ g.issue?.help ? (y(), T("span", {
2622
2649
  key: 0,
2623
- src: P.url,
2624
- alt: P.name,
2625
- class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2626
- }, null, 8, Ti)) : P.type === "audio" ? (T(), S("audio", {
2650
+ class: E(["text-[12px]", C.value ? "text-theme-400" : "text-white/55"])
2651
+ }, re(g.issue.help), 3)) : B("", !0),
2652
+ g.issue?.actionUrl ? (y(), T("a", {
2627
2653
  key: 1,
2628
- src: P.url,
2629
- controls: "",
2630
- class: "max-w-full"
2631
- }, null, 8, Si)) : (T(), S("a", {
2632
- key: 2,
2633
- href: P.url,
2634
- target: "_blank",
2635
- rel: "noopener",
2636
- class: A(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", C.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2654
+ href: g.issue.actionUrl,
2655
+ "data-test": "messaging-system-msg-action",
2656
+ class: E(["text-[12px] font-medium inline-flex items-center gap-1", C.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
2637
2657
  }, [
2638
- f[10] || (f[10] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2639
- et(" " + ie(P.name), 1)
2640
- ], 10, Ai))
2641
- ], 64))), 128))
2642
- ], 2)) : U("", !0),
2643
- x.text ? (T(), S("div", {
2644
- key: 1,
2645
- class: A(["rounded-2xl px-3.5 py-2", [
2646
- x.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : C.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]"
2647
- ]])
2658
+ et(re(g.issue.actionLabel) + " ", 1),
2659
+ k[9] || (k[9] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2660
+ ], 10, Ei)) : B("", !0)
2661
+ ])
2662
+ ], 10, Si)) : (y(), T("div", {
2663
+ key: 2,
2664
+ "data-test": g.sender === "agent" ? "messaging-assistant-msg" : g.sender === "user" ? "messaging-user-msg" : void 0,
2665
+ class: E(["flex gap-2 items-end", {
2666
+ "justify-end": g.sender === "user",
2667
+ "justify-start": g.sender === "agent",
2668
+ "mb-4": m(G.value, M)
2669
+ }])
2648
2670
  }, [
2649
- w("div", {
2650
- class: A(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", x.sender === "user" || !C.value ? "chat-msg-prose-invert" : ""]),
2651
- innerHTML: e(x.text),
2652
- onClick: f[0] || (f[0] = Cs(() => {
2653
- }, ["stop"]))
2654
- }, null, 10, Ei)
2655
- ], 2)) : U("", !0)
2656
- ], 2)
2657
- ], 10, wi))
2658
- ], 64))), 128)),
2659
- ce.value ? (T(), S("div", _i, [
2660
- w("img", {
2661
- src: a.agent.avatarUrl.value,
2662
- alt: a.agent.displayName.value,
2663
- class: A(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
2664
- }, null, 10, Ri),
2665
- w("div", {
2666
- class: A(["rounded-2xl px-3.5 py-2.5 flex items-center", C.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2667
- }, [
2668
- w("i", {
2669
- class: A(["i-svg-spinners-3-dots-bounce size-7", C.value ? "text-theme-400" : "text-white/50"])
2670
- }, null, 2)
2671
- ], 2)
2672
- ])) : U("", !0)
2673
- ], 512),
2674
- w("div", {
2675
- class: A(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", C.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"])
2671
+ g.sender === "agent" ? (y(), T("div", Ri, [
2672
+ m(G.value, M) ? (y(), T("img", {
2673
+ key: 0,
2674
+ src: a.agent.avatarUrl.value,
2675
+ alt: a.agent.displayName.value,
2676
+ class: E(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
2677
+ }, null, 10, Ci)) : B("", !0)
2678
+ ])) : B("", !0),
2679
+ v("div", {
2680
+ class: E(g.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2681
+ }, [
2682
+ g.attachments?.length ? (y(), T("div", {
2683
+ key: 0,
2684
+ class: E(["mb-1 space-y-1", g.sender === "user" ? "flex flex-col items-end" : ""])
2685
+ }, [
2686
+ (y(!0), T(Te, null, at(g.attachments, (j, J) => (y(), T(Te, { key: J }, [
2687
+ j.type === "image" ? (y(), T("img", {
2688
+ key: 0,
2689
+ src: j.url,
2690
+ alt: j.name,
2691
+ class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2692
+ }, null, 8, Ii)) : j.type === "audio" ? (y(), T("audio", {
2693
+ key: 1,
2694
+ src: j.url,
2695
+ controls: "",
2696
+ class: "max-w-full"
2697
+ }, null, 8, Di)) : (y(), T("a", {
2698
+ key: 2,
2699
+ href: j.url,
2700
+ target: "_blank",
2701
+ rel: "noopener",
2702
+ class: E(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", C.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2703
+ }, [
2704
+ k[10] || (k[10] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2705
+ et(" " + re(j.name), 1)
2706
+ ], 10, Mi))
2707
+ ], 64))), 128))
2708
+ ], 2)) : B("", !0),
2709
+ g.text ? (y(), T("div", {
2710
+ key: 1,
2711
+ class: E(["rounded-2xl px-3.5 py-2", [
2712
+ g.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : C.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]"
2713
+ ]])
2714
+ }, [
2715
+ Je(ui, {
2716
+ text: g.text,
2717
+ inverted: g.sender === "user" || !C.value,
2718
+ streaming: g.id === P.value,
2719
+ onClick: k[0] || (k[0] = Ms(() => {
2720
+ }, ["stop"]))
2721
+ }, null, 8, ["text", "inverted", "streaming"])
2722
+ ], 2)) : B("", !0)
2723
+ ], 2)
2724
+ ], 10, _i))
2725
+ ], 64))), 128)),
2726
+ de.value ? (y(), T("div", Li, [
2727
+ v("img", {
2728
+ src: a.agent.avatarUrl.value,
2729
+ alt: a.agent.displayName.value,
2730
+ class: E(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
2731
+ }, null, 10, Oi),
2732
+ v("div", {
2733
+ class: E(["rounded-2xl px-3.5 py-2.5 flex items-center", C.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2734
+ }, [
2735
+ v("i", {
2736
+ class: E(["i-svg-spinners-3-dots-bounce size-7", C.value ? "text-theme-400" : "text-white/50"])
2737
+ }, null, 2)
2738
+ ], 2)
2739
+ ])) : B("", !0)
2740
+ ])
2741
+ ]),
2742
+ _: 1
2743
+ }, 512),
2744
+ v("div", {
2745
+ class: E(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", C.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"])
2676
2746
  }, [
2677
- d.value.length > 0 ? (T(), S("div", Ci, [
2678
- (T(!0), S(Te, null, at(d.value, (x, M) => (T(), S("div", {
2747
+ b.value.length > 0 ? (y(), T("div", zi, [
2748
+ (y(!0), T(Te, null, at(b.value, (g, M) => (y(), T("div", {
2679
2749
  key: M,
2680
2750
  class: "relative shrink-0 group"
2681
2751
  }, [
2682
- x.type === "image" ? (T(), S("img", {
2752
+ g.type === "image" ? (y(), T("img", {
2683
2753
  key: 0,
2684
- src: x.url,
2685
- alt: x.name,
2686
- class: A(["size-14 rounded-xl object-cover border", C.value ? "border-black/10" : "border-white/20"])
2687
- }, null, 10, Ii)) : (T(), S("div", {
2754
+ src: g.url,
2755
+ alt: g.name,
2756
+ class: E(["size-14 rounded-xl object-cover border", C.value ? "border-black/10" : "border-white/20"])
2757
+ }, null, 10, Pi)) : (y(), T("div", {
2688
2758
  key: 1,
2689
- class: A(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", C.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2759
+ class: E(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", C.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2690
2760
  }, [
2691
- f[11] || (f[11] = w("i", { class: "i-tabler-file size-4" }, null, -1)),
2692
- w("span", Di, ie(x.name), 1)
2761
+ k[11] || (k[11] = v("i", { class: "i-tabler-file size-4" }, null, -1)),
2762
+ v("span", Ni, re(g.name), 1)
2693
2763
  ], 2)),
2694
- w("button", {
2764
+ v("button", {
2695
2765
  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",
2696
- onClick: /* @__PURE__ */ h((P) => B(M), "onClick")
2697
- }, [...f[12] || (f[12] = [
2698
- w("i", { class: "i-tabler-x size-3" }, null, -1)
2699
- ])], 8, Mi)
2766
+ onClick: /* @__PURE__ */ p((j) => pt(M), "onClick")
2767
+ }, [...k[12] || (k[12] = [
2768
+ v("i", { class: "i-tabler-x size-3" }, null, -1)
2769
+ ])], 8, $i)
2700
2770
  ]))), 128)),
2701
- g.value ? (T(), S("div", Li, [
2702
- Wt(Ln, { class: "size-5" })
2703
- ])) : U("", !0)
2704
- ])) : U("", !0),
2705
- a.uploadFn ? (T(), S("input", {
2771
+ u.value ? (y(), T("div", Ui, [
2772
+ Je(Ln, { class: "size-5" })
2773
+ ])) : B("", !0)
2774
+ ])) : B("", !0),
2775
+ a.uploadFn ? (y(), T("input", {
2706
2776
  key: 1,
2707
2777
  ref_key: "fileInput",
2708
- ref: p,
2778
+ ref: c,
2709
2779
  type: "file",
2710
2780
  accept: "image/*,audio/*,video/*",
2711
2781
  class: "hidden",
2712
- onChange: dt
2713
- }, null, 544)) : U("", !0),
2714
- w("div", {
2715
- class: A(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", C.value ? m.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" : m.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2782
+ onChange: Dt
2783
+ }, null, 544)) : B("", !0),
2784
+ v("div", {
2785
+ class: E(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", C.value ? l.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" : l.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2716
2786
  }, [
2717
- w("button", {
2718
- class: A(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2787
+ v("button", {
2788
+ class: E(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2719
2789
  a.uploadFn ? "cursor-pointer" : "cursor-default",
2720
2790
  C.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2721
- g.value ? "opacity-50 pointer-events-none" : ""
2791
+ u.value ? "opacity-50 pointer-events-none" : ""
2722
2792
  ]]),
2723
- disabled: Q.value || g.value || !a.uploadFn,
2724
- onClick: f[1] || (f[1] = (x) => a.uploadFn && It())
2793
+ disabled: Q.value || u.value || !a.uploadFn,
2794
+ onClick: k[1] || (k[1] = (g) => a.uploadFn && ht())
2725
2795
  }, [
2726
- g.value ? (T(), S("i", zi)) : (T(), S("i", Pi))
2727
- ], 10, Oi),
2728
- ss(w("textarea", {
2796
+ u.value ? (y(), T("i", Fi)) : (y(), T("i", Hi))
2797
+ ], 10, Bi),
2798
+ ns(v("textarea", {
2729
2799
  ref_key: "textarea",
2730
- ref: b,
2731
- "onUpdate:modelValue": f[2] || (f[2] = (x) => l.value = x),
2800
+ ref: d,
2801
+ "onUpdate:modelValue": k[2] || (k[2] = (g) => s.value = g),
2732
2802
  "data-test": "messaging-input",
2733
2803
  rows: "1",
2734
2804
  enterkeyhint: "send",
2735
2805
  placeholder: _t.value,
2736
2806
  disabled: Q.value,
2737
2807
  style: { fontSize: "16px", resize: "none" },
2738
- class: A(["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", C.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2808
+ class: E(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", C.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2739
2809
  onKeydown: Ct,
2740
- onFocus: f[3] || (f[3] = (x) => m.value = !0),
2741
- onBlur: f[4] || (f[4] = (x) => m.value = !1)
2742
- }, null, 42, Ni), [
2743
- [rs, l.value]
2810
+ onFocus: k[3] || (k[3] = (g) => l.value = !0),
2811
+ onBlur: k[4] || (k[4] = (g) => l.value = !1)
2812
+ }, null, 42, Gi), [
2813
+ [ss, s.value]
2744
2814
  ]),
2745
- w("button", {
2815
+ v("button", {
2746
2816
  "data-test": "messaging-send-btn",
2747
- class: A(["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", ut.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : C.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2817
+ class: E(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", ut.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : C.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2748
2818
  disabled: !ut.value,
2749
- onClick: f[5] || (f[5] = (x) => ye())
2750
- }, [...f[13] || (f[13] = [
2751
- w("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2752
- ])], 10, $i)
2819
+ onClick: k[5] || (k[5] = (g) => ve())
2820
+ }, [...k[13] || (k[13] = [
2821
+ v("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2822
+ ])], 10, ji)
2753
2823
  ], 2),
2754
- w("div", {
2755
- class: A(["text-[10px] text-center mt-2.5 select-none opacity-70", C.value ? "text-theme-400" : "text-white/50"])
2824
+ v("div", {
2825
+ class: E(["text-[10px] text-center mt-2.5 select-none opacity-70", C.value ? "text-theme-400" : "text-white/50"])
2756
2826
  }, [
2757
- f[14] || (f[14] = et(" Press ", -1)),
2758
- w("kbd", {
2759
- class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", C.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2827
+ k[14] || (k[14] = et(" Press ", -1)),
2828
+ v("kbd", {
2829
+ class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", C.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2760
2830
  }, "Enter", 2),
2761
- f[15] || (f[15] = et(" to send, ", -1)),
2762
- w("kbd", {
2763
- class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", C.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2831
+ k[15] || (k[15] = et(" to send, ", -1)),
2832
+ v("kbd", {
2833
+ class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", C.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2764
2834
  }, "Shift+Enter", 2),
2765
- f[16] || (f[16] = et(" for new line ", -1))
2835
+ k[16] || (k[16] = et(" for new line ", -1))
2766
2836
  ], 2)
2767
2837
  ], 2)
2768
2838
  ]));
2769
2839
  }
2770
- }), Ui = { class: "agent-wrap" }, Bi = {
2840
+ }), Wi = { class: "agent-wrap" }, qi = {
2771
2841
  key: 0,
2772
2842
  class: "flex items-center justify-center h-full"
2773
- }, Ki = /* @__PURE__ */ Me({
2843
+ }, sa = /* @__PURE__ */ ke({
2774
2844
  __name: "AgentWrap",
2775
2845
  props: {
2776
2846
  sdk: {},
@@ -2784,11 +2854,11 @@ const li = { class: "@container/chat flex flex-col h-full relative" }, oi = {
2784
2854
  apiBase: {}
2785
2855
  },
2786
2856
  setup(a) {
2787
- const t = Ms("AgentWrap"), e = a, n = e.sdk || Ls.getInstance({
2857
+ const t = Os("AgentWrap"), e = a, n = e.sdk || zs.getInstance({
2788
2858
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2789
2859
  ...e.apiBase && { apiBase: e.apiBase }
2790
- }), r = ee(!e.agent), s = Is(e.agent ? new yt({ config: e.agent }) : void 0), o = ee();
2791
- return tn(async () => {
2860
+ }), r = Z(!e.agent), s = rs(e.agent ? new wt({ config: e.agent }) : void 0), l = Z();
2861
+ return St(async () => {
2792
2862
  if (e.agent) {
2793
2863
  t.debug("Agent provided via props, skipping fetch", {
2794
2864
  agentId: e.agent.agentId,
@@ -2797,7 +2867,7 @@ const li = { class: "@container/chat flex flex-col h-full relative" }, oi = {
2797
2867
  return;
2798
2868
  }
2799
2869
  if (!e.handle) {
2800
- o.value = "No handle or agent provided", t.warn("AgentWrap mounted without handle or agent", {
2870
+ l.value = "No handle or agent provided", t.warn("AgentWrap mounted without handle or agent", {
2801
2871
  propsReceived: {
2802
2872
  handle: e.handle,
2803
2873
  agent: e.agent,
@@ -2813,17 +2883,17 @@ const li = { class: "@container/chat flex flex-col h-full relative" }, oi = {
2813
2883
  }
2814
2884
  try {
2815
2885
  r.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2816
- const l = await n.user.getPublicAgent({ handle: e.handle });
2817
- l ? (s.value = new yt({ config: l }), t.debug("Successfully fetched public agent", {
2818
- agentId: l.agentId,
2819
- handle: l.handle
2820
- }), l.agentId && n.user.track({
2886
+ const o = await n.user.getPublicAgent({ handle: e.handle });
2887
+ o ? (s.value = new wt({ config: o }), t.debug("Successfully fetched public agent", {
2888
+ agentId: o.agentId,
2889
+ handle: o.handle
2890
+ }), o.agentId && n.user.track({
2821
2891
  event: "view_profile",
2822
- agentId: l.agentId,
2892
+ agentId: o.agentId,
2823
2893
  properties: {
2824
2894
  viewSource: "widget"
2825
2895
  }
2826
- })) : (o.value = n.error.value || "Agent not found", t.error("Failed to fetch public agent - no data returned", {
2896
+ })) : (l.value = n.error.value || "Agent not found", t.error("Failed to fetch public agent - no data returned", {
2827
2897
  handle: e.handle,
2828
2898
  sdkError: n.error.value,
2829
2899
  sdkState: {
@@ -2832,13 +2902,13 @@ const li = { class: "@container/chat flex flex-col h-full relative" }, oi = {
2832
2902
  loading: n.loading.value
2833
2903
  }
2834
2904
  }));
2835
- } catch (l) {
2836
- o.value = l instanceof Error ? l.message : "Failed to fetch agent", t.error("Exception while fetching public agent", {
2905
+ } catch (o) {
2906
+ l.value = o instanceof Error ? o.message : "Failed to fetch agent", t.error("Exception while fetching public agent", {
2837
2907
  handle: e.handle,
2838
- error: l instanceof Error ? {
2839
- message: l.message,
2840
- stack: l.stack
2841
- } : l,
2908
+ error: o instanceof Error ? {
2909
+ message: o.message,
2910
+ stack: o.stack
2911
+ } : o,
2842
2912
  sdkState: {
2843
2913
  isDev: n.isDev,
2844
2914
  apiBase: n.apiBase,
@@ -2850,7 +2920,7 @@ const li = { class: "@container/chat flex flex-col h-full relative" }, oi = {
2850
2920
  state: {
2851
2921
  loading: r.value,
2852
2922
  hasAgent: !!s.value,
2853
- error: o.value
2923
+ error: l.value
2854
2924
  },
2855
2925
  props: {
2856
2926
  handle: e.handle,
@@ -2864,33 +2934,33 @@ const li = { class: "@container/chat flex flex-col h-full relative" }, oi = {
2864
2934
  }
2865
2935
  });
2866
2936
  }
2867
- }), (l, m) => (T(), S("div", Ui, [
2868
- r.value ? (T(), S("div", Bi, [...m[0] || (m[0] = [
2869
- w("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2870
- ])])) : s.value ? ns(l.$slots, "default", {
2937
+ }), (o, d) => (y(), T("div", Wi, [
2938
+ r.value ? (y(), T("div", qi, [...d[0] || (d[0] = [
2939
+ v("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2940
+ ])])) : s.value ? en(o.$slots, "default", {
2871
2941
  key: 1,
2872
- sdk: Kt(n),
2942
+ sdk: Xt(n),
2873
2943
  agent: s.value,
2874
2944
  context: a.context,
2875
2945
  firstMessage: a.firstMessage,
2876
2946
  buttonText: a.buttonText,
2877
2947
  buttonIcon: a.buttonIcon,
2878
2948
  loading: r.value
2879
- }) : U("", !0)
2949
+ }) : B("", !0)
2880
2950
  ]));
2881
2951
  }
2882
2952
  });
2883
2953
  export {
2884
2954
  On as A,
2885
- Ki as _,
2886
- Xi as a,
2887
- Yi as b,
2888
- Vi as c,
2889
- Zi as d,
2955
+ sa as _,
2956
+ na as a,
2957
+ ea as b,
2958
+ Ji as c,
2959
+ ta as d,
2890
2960
  Ln as e,
2891
- Ys as f,
2892
- Wi as g,
2961
+ Xs as f,
2962
+ Ki as g,
2893
2963
  Pn as h,
2894
- qi as p
2964
+ Qi as p
2895
2965
  };
2896
2966
  //# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map